C端小程序
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

2 行
1.5 MiB

  1. /*! Released Version 0.9.1,BUILD 137. Fengmap Javascript SDK, see: https://www.fengmap.com for details */
  2. function c(e){if(b[e])return b[e].exports;var t=b[e]={i:e,l:!1,exports:{}};return a[e].call(t.exports,t,t.exports,c),t.l=!0,t.exports}var a,b;exports.fengmap=(a=[function(e,t,n){e.exports=n(268)},function(e){function t(e){return e&&e.__esModule?e:{default:e}}e.exports=t},function(e){function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}e.exports=t},function(e,t,n){var i=n(194);function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),i(e,r.key,r)}}function a(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}e.exports=a},function(e,t,n){e.exports=n(361)},function(e,t,n){var r=n(364),i=n(367);function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=r(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}e.exports=a},function(e,t,n){var r=n(62),i=n(91);function a(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?i(e):t}e.exports=a},function(t,e,n){var r=n(371),i=n(197);function a(e){return t.exports=a=i?r:function(e){return e.__proto__||r(e)},a(e)}t.exports=a},function(e,t,n){"use strict";var y=n(19),_=n(80).f,x=n(166),w=n(11),b=n(72),M=n(43),T=n(34),S=function(r){var e=function(e,t,n){if(this instanceof r){switch(arguments.length){case 0:return new r;case 1:return new r(e);case 2:return new r(e,t)}return new r(e,t,n)}return r.apply(this,arguments)};return e.prototype=r.prototype,e};e.exports=function(e,t){var n,r,i,a,o,s,l,u,h,c=e.target,d=e.global,f=e.stat,p=e.proto,m=d?y:f?y[c]:(y[c]||{}).prototype,v=d?w:w[c]||(w[c]={}),g=v.prototype;for(a in t)n=x(d?a:c+(f?".":"#")+a,e.forced),r=!n&&m&&T(m,a),s=v[a],r&&(l=e.noTargetGet?(h=_(m,a),h&&h.value):m[a]),o=r&&l?l:t[a],r&&typeof s==typeof o||(u=e.bind&&r?b(o,y):e.wrap&&r?S(o):p&&"function"==typeof o?b(Function.call,o):o,(e.sham||o&&o.sham||s&&s.sham)&&M(u,"sham",!0),v[a]=u,p&&(i=c+"Prototype",T(w,i)||M(w,i,{}),w[i][a]=o,e.real&&g&&!g[a]&&M(g,a,o)))}},function(e,t,n){e.exports=n(415)},function(e,t,n){e.exports=n(382)},function(e){e.exports={}},function(e,t,n){e.exports=n(419)},function(e,t,n){e.exports=n(408)},function(e,t,n){e.exports=n(397)},function(e,t,n){e.exports=n(411)},function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(10)),o=r(n(2)),s=r(n(3)),l=function(){function n(e,t){(0,o.default)(this,n),this._eid=e,this._groupId=e,this.parent=null,this._nodeType=t,this._x=0,this._y=0,this._z=0,this._height=0,this._alwaysShow=!1,this._show=!0,this.renderNodeInited=!1,this.tryInit=!1,this.needAvoid=!0,this._visible=!0}return(0,s.default)(n,[{key:"findParent",value:function(e){for(var t=this.parent;t;){if(t instanceof e)return t;t=t.parent}return!1}},{key:"avoid",value:function(e){this.needAvoid=e,e||(this.show=!0)}},{key:"alwaysShow",value:function(){var e;this._alwaysShow=!0;for(var t=this.parent;t;){if(t.isGroup){e=t;break}t=t.parent}e&&this.renderNode&&e.alwaysShowMarkers.push(this.renderNode)}},{key:"isAlwaysShow",get:function(){return this._alwaysShow}},{key:"groupID",get:function(){if(this.isGroup)return this._eid;for(var e,t=this.parent;t;){if(t.isGroup){e=t;break}t=t.parent}return e?e.eid:0}},{key:"height",set:function(e){this._height=e},get:function(){return this._height}},{key:"mapCoord",set:function(e){this._mapCoord=e},get:function(){return{x:this._x,y:this._y,z:this._height}}},{key:"nodeType",set:function(e){this._nodeType=e},get:function(){return this._nodeType}},{key:"show",set:function(e){this._show=e,this._renderNode&&(this._renderNode.visible=e)},get:function(){return this._show}},{key:"x",set:function(e){this._x=e},get:function(){return this._x}},{key:"y",set:function(e){this._y=e},get:function(){return this._y}},{key:"z",set:function(e){this._z=e},get:function(){return this._z}},{key:"eid",get:function(){return this._eid}},{key:"visible",get:function(){return this._visible},set:function(e){this._visible=e,this.parent&&this.parent.parent&&this.parent.parent.parent&&(0,a.default)(this.parent.parent.parent).setRenderList()}}]),n}(),u=l;t.default=u},function(e,t,n){e.exports=n(280)},function(n,e,t){(function(e){var t=function(e){return e&&e.Math==Math&&e};n.exports=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof e&&e)||Function("return this")()}).call(this,t(47))},function(e,t,n){e.exports=n(439)},function(e,t,n){e.exports=n(441)},function(e,t,n){e.exports=n(442)},function(e){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(11);e.exports=function(e){return r[e+"Prototype"]}},function(e,t,n){var r=n(19),i=n(119),a=n(34),o=n(101),s=n(122),l=n(174),u=i("wks"),h=r.Symbol,c=l?h:h&&h.withoutSetter||o;e.exports=function(e){return a(u,e)||(s&&a(h,e)?u[e]=h[e]:u[e]=c("Symbol."+e)),u[e]}},function(e,t,n){var r=n(11),i=n(34),a=n(130),o=n(39).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});i(t,e)||o(t,e,{value:a.f(e)})}},function(e,t,n){e.exports=n(390)},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var f=r(n(32)),a=r(n(2)),o=r(n(3)),R=1e-5,_=1e-5,V=.001,s=.01,l=function(){function G(){(0,a.default)(this,G)}return(0,o.default)(G,null,[{key:"epsilon",value:function(){return V}},{key:"isZero",value:function(e){return e<R&&-R<e}},{key:"gtZero",value:function(e){return R<e}},{key:"ltZero",value:function(e){return e<-R}},{key:"pointDistanceToLine",value:function(e,t,n,r){var i,a=t.x,o=t.y,s=n.x,l=n.y,u=e.x,h=e.y,c=s-a,d=l-o,f=Math.sqrt(c*c+d*d),p=u-a,m=h-o,v=Math.sqrt(p*p+m*m);if(G.isZero(f))return r.x=t.x,r.y=t.y,i=G.isZero(v)?0:v,i;var g=c/f,y=d/f,_=g*p+y*m;if(!G.gtZero(_))return r.x=t.x,r.y=t.y,i=v,i;if(!G.ltZero(_-f)){var x=u-s,w=h-l,b=Math.sqrt(x*x+w*w);return r.x=n.x,r.y=n.y,i=b,i}var M=a+_*g,T=o+_*y,S=u-M,E=h-T,A=Math.sqrt(S*S+E*E);return r.x=M,r.y=T,i=A,i}},{key:"distanceOfTwoPoints",value:function(e,t){return e&&t?Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y)):Number.NaN}},{key:"isSamePoint",value:function(e,t){return Math.abs(e.x-t.x)<=_&&Math.abs(e.y-t.y)<=_}},{key:"isNearlySamePoint",value:function(e,t){return Math.abs(e.x-t.x)<=s&&Math.abs(e.y-t.y)<=s}},{key:"getPolygonInnerPoint",value:function(e){if(e&&0==e.length)return{x:0,y:0};var t=e.length;if(t<3)return e[0];var n=e[0],r=e[1],i={x:(n.x+r.x)/2,y:(n.y+r.y)/2},a=Math.atan2(r.y-n.y,r.x-n.x);a-=Math.PI/2;for(var o=3;.5<o;){var s={x:i.x+o*Math.cos(a),y:i.y+o*Math.sin(a)};if(G.isInPolygon(s,e))return s;o/=2}for(a+=Math.PI,o=3;.5<o;){var l={x:i.x+o*Math.cos(a),y:i.y+o*Math.sin(a)};if(G.isInPolygon(l,e))return l;o/=2}return{x:0,y:0}}},{key:"isInPolygon",value:function(e,t){for(var n=!1,r=t.length,i=0,a=r-1;i<r;a=i,++i){var o=t[i].x,s=t[i].y,l=t[a].x,u=t[a].y;if(o==e.x&&s==e.y||l==e.x&&u==e.y)return!0;if(s<e.y&&u>=e.y||s>=e.y&&u<e.y){var h=o+(e.y-s)*(l-o)/(u-s);if(h==e.x)return!0;h>e.x&&(n=!n)}}return n}},{key:"isInCircle",value:function(e,t,n,r){if(e.x<r[0]&&e.x>r[1])return!1;if(e.y<r[2]&&e.y>r[3])return!1;var i=n*n,a=e.x,o=e.y,s=t.x,l=t.y,u=s-a,h=l-o,c=u*u+h*h;return c<i}},{key:"isRectCross",value:function(e,t,n,r){return!(Math.max(e.x,t.x)<Math.min(n.x,r.x)||Math.max(e.y,t.y)<Math.min(n.y,r.y)||Math.max(n.x,r.x)<Math.min(e.x,t.x)||Math.max(n.y,r.y)<Math.min(e.y,t.y))}},{key:"pointIsInRect",value:function(e,t,n,r){return Math.abs(e.x-t.x)<n&&Math.abs(e.y-t.y)<r}},{key:"pointIsInRect1",value:function(e,t,n){var r=Math.min(t.x,n.x),i=Math.max(t.x,n.x),a=Math.min(t.y,n.y),o=Math.max(t.y,n.y);return!(e.x<r||e.x>i||e.y<a||e.y>o)}},{key:"cross",value:function(e,t,n){return(e.x-n.x)*(t.y-n.y)-(t.x-n.x)*(e.y-n.y)}},{key:"isLineSegmentCross",value:function(e,t,n,r){return!(Math.max(e.x,t.x)<Math.min(n.x,r.x)||Math.max(e.y,t.y)<Math.min(n.y,r.y)||Math.max(n.x,r.x)<Math.min(e.x,t.x)||Math.max(n.y,r.y)<Math.min(e.y,t.y)||G.cross(n,t,e)*G.cross(t,r,e)<0||G.cross(e,r,n)*G.cross(r,t,n)<0)}},{key:"rayCrossSegment",value:function(e,t,n,r,i){var a=Math.min(e.x,n.x,r.x),o=Math.max(e.x,n.x,r.x),s=Math.min(e.y,n.y,r.y),l=Math.max(e.y,n.y,r.y),u=Math.sqrt((o-a)*(o-a)+(l-s)*(l-s)),h=t/180*Math.PI,c=u*Math.cos(h)+e.x,d=u*Math.sin(h)+e.y;return 1==this.calcCrossPoint(e,{x:c,y:d},n,r,i)}},{key:"calcCrossPoint",value:function(e,t,n,r,i){if(1!=G.isLineSegmentCross(e,t,n,r))return 0;var a=(r.x-n.x)*(e.y-t.y)-(t.x-e.x)*(n.y-r.y),o=(e.y-n.y)*(t.x-e.x)*(r.x-n.x)+n.x*(r.y-n.y)*(t.x-e.x)-e.x*(t.y-e.y)*(r.x-n.x);return i.x=o/a,a=(e.x-t.x)*(r.y-n.y)-(t.y-e.y)*(n.x-r.x),o=t.y*(e.x-t.x)*(r.y-n.y)+(r.x-t.x)*(r.y-n.y)*(e.y-t.y)-r.y*(n.x-r.x)*(t.y-e.y),i.y=o/a,1}},{key:"pointInPolygon2d",value:function(e,t,n){for(var r=!1,i=null,a=null,o=0;o<n;o++)i=e[o],a=e[(o+1)%n],(i.y<t.y&&a.y>=t.y||a.y<t.y&&i.y>=t.y)&&(i.x<=t.x||a.x<=t.x)&&i.x+(t.y-i.y)/(a.y-i.y)*(a.x-i.x)<t.x&&(r=!r);return r}},{key:"pointInPolygon2d1",value:function(e,t,n){for(var r=0,i=null,a=null,o=null,s=0;s<n;s++)if(i=e[s],a=e[(s+1)%n],(i.y<t.y&&a.y>=t.y||a.y<t.y&&i.y>=t.y)&&(i.x<=t.x||a.x<=t.x)){if(o=i.x+(t.y-i.y)/(a.y-i.y)*(a.x-i.x),Math.abs(o-t.x)<=V)return 2;o<t.x&&(r=!r)}return r}},{key:"pointInPolygonVector2d",value:function(e,t,n){for(var r=!1,i=null,a=null,o=0,s=n/2,l=0;l<s;l++)o=2*l,i={x:e[o],y:e[o+1]},a={x:e[(o+2)%n],y:e[(o+3)%n]},(i.y<t.y&&a.y>=t.y||a.y<t.y&&i.y>=t.y)&&(i.x<=t.x||a.x<=t.x)&&i.x+(t.y-i.y)/(a.y-i.y)*(a.x-i.x)<t.x&&(r=!r);return r}},{key:"pointToSegmentDistance",value:function(e,t,n){var r=e.x,i=e.y,a=t.x,o=t.y,s=n.x,l=n.y,u=(s-a)*(r-a)+(l-o)*(i-o);if(u<=0)return Math.sqrt((r-a)*(r-a)+(i-o)*(i-o));var h=(s-a)*(s-a)+(l-o)*(l-o);if(h<=u)return Math.sqrt((r-s)*(r-s)+(i-l)*(i-l));var c=u/h,d=a+(s-a)*c,f=o+(l-o)*c;return Math.sqrt((r-d)*(r-d)+(f-i)*(f-i))}},{key:"pointToPolygon2d",value:function(e,t,n){for(var r=null,i=null,a=Number.MAX_VALUE,o=0;o<n;o++){r=e[o],i=e[(o+1)%n];var s=G.pointToSegmentDistance(t,r,i);s<a&&(a=s)}return a}},{key:"lineInCircle2d",value:function(e,t,n,r,i){if(e.x<i[0]&&t.x<i[0])return!1;if(e.x>i[1]&&t.x>i[1])return!1;if(e.y<i[2]&&t.y<i[2])return!1;if(e.y>i[3]&&t.y>i[3])return!1;var a=r*r,o=e.x,s=e.y,l=t.x,u=t.y,h=n.x,c=n.y,d=l-o,f=u-s,p=d*d+f*f,m=h-o,v=c-s,g=m*m+v*v;if(G.isZero(p))return!!G.isZero(g)||g<a;p=Math.sqrt(p);var y=d/p,_=f/p,x=y*m+_*v;if(!G.gtZero(x))return g<a;if(!G.ltZero(x-p)){var w=h-l,b=c-u,M=w*w+b*b;return M<a}var T=o+x*y,S=s+x*_,E=h-T,A=c-S,I=E*E+A*A;return I<a}},{key:"lineInPolygon2d",value:function(e,t,n,r){if(e.x<r[0]&&t.x<r[0])return!1;if(e.x>r[1]&&t.x>r[1])return!1;if(e.y<r[2]&&t.y<r[2])return!1;if(e.y>r[3]&&t.y>r[3])return!1;var i=n.length;if(G.pointInPolygon2d(n,e,i))return!0;if(G.pointInPolygon2d(n,t,i))return!0;for(var a=0;a<i;a++){var o=(a+1)%i;if(G.isLineSegmentCross(e,t,n[a],n[o]))return!0}return!1}},{key:"calcLineCircleCrossPoints2d",value:function(e,t,n,r,i){if(e.x<i[0]&&t.x<i[0])return null;if(e.x>i[1]&&t.x>i[1])return null;if(e.y<i[2]&&t.y<i[2])return null;if(e.y>i[3]&&t.y>i[3])return null;var a={isContain:!1,crossPoints:[]},o=r*r,s=e.x,l=e.y,u=t.x,h=t.y,c=n.x,d=n.y,f=u-s,p=h-l,m=f*f+p*p,v=c-s,g=d-l,y=v*v+g*g,_=c-u,x=d-h,w=_*_+x*x;if(G.isZero(m))return(G.isZero(y)||y<o)&&(a.isContain=!0,a.crossPoints=[e,t]),a;if(y<o&&w<o)return a.isContain=!0,a.crossPoints=[e,t],a;var b=Math.sqrt(m),M=f/b,T=p/b,S=v*M+g*T,E=S*S,A=v*v+g*g;if(o-A+E<0)return null;var I=Math.sqrt(o-A+E),L=S-I;return-R<+L&&L-b<R&&a.crossPoints.push({x:s+L*M,y:l+L*T}),L=S+I,-R<+L&&L-b<R&&a.crossPoints.push({x:s+L*M,y:l+L*T}),a}},{key:"calcLinePolygonCrossPoints2d",value:function(e,t,n,r){if(e.x<r[0]&&t.x<r[0])return null;if(e.x>r[1]&&t.x>r[1])return null;if(e.y<r[2]&&t.y<r[2])return null;if(e.y>r[3]&&t.y>r[3])return null;var i={containType:0,crossPoints:[]},a=n.length;G.pointInPolygon2d(n,e,a)&&(i.containType|=1),G.pointInPolygon2d(n,t,a)&&(i.containType|=2);for(var o=[],s=0;s<a;s++){var l,u,h=(s+1)%a,c={};G.calcCrossPoint(e,t,n[s],n[h],c)&&(l=c.x-e.x,u=c.y-e.y,o.push({dis2:l*l+u*u,point:c}))}if(0==o.length)return null;(0,f.default)(o).call(o,function(e,t){return t.dis2-e.dis2});for(var d=0;d<o.length;d++)i.crossPoints.push(o[d].point);return i}},{key:"calcCenterOfGravityPoint",value:function(e,t){for(var n=0,r=0,i=0,a=0;a<t;a++){var o=e[a],s=e[(a+1)%t],l=(o.x*s.y-o.y*s.x)/2;n+=l,r+=l*(o.x+s.x)/3,i+=l*(o.y+s.y)/3}return r/=n,i/=n,{x:r,y:i}}},{key:"calcPolygonArea2d",value:function(e){var t=e.length;if(t<3)return 0;for(var n=0,r=0;r<t;++r){var i=e[r],a=e[(r+1)%t];n+=i.x*a.y-i.y*a.x}return Math.abs(n/2)}},{key:"quickRayIntersect",value:function(e,t,n,r,i){var a=Math.min(n.x,r.x),o=Math.max(n.x,r.x),s=Math.min(n.y,r.y),l=Math.max(n.y,r.y),u=e.x,h=e.y,c=n.x,d=n.y,f=r.x,p=r.y;if(90==t){if(e.x<a||e.x>o)return!1;var m=(p-d)/(f-c),v=m*(u-c)+d;return i.y=v,i.x=u,!(v<h||!G.pointIsInRect1(i,n,r))}if(270==t){if(e.x<a||e.x>o)return!1;var g=(p-d)/(f-c),y=g*(u-c)+d;return i.y=y,i.x=u,!(h<y||!G.pointIsInRect1(i,n,r))}if(270!=t&&90!=t&&o-a<V){var _=a,x=Math.tan(t/180*Math.PI),w=x*(_-u)+h;if(i.y=w,i.x=_,G.pointIsInRect1(i,n,r)){var b=_-u,M=w-h,T=b/Math.sqrt(b*b+M*M),S=Math.cos(t/180*Math.PI);return 0<T*S}}if(l-s<=1e-6){var E=s,A=Math.tan(t/180*Math.PI),I=1/A*(E-h)+u;if(i.x=I,i.y=E,G.pointIsInRect1(i,n,r)){var L=I-u,R=E-h,N=L/Math.sqrt(L*L+R*R),k=Math.cos(t/180*Math.PI);return 0<N*k}return!1}var P=Math.tan(t/180*Math.PI),C=(p-d)/(f-c),D=(d-h-(C*c-P*u))/(P-C),O=h+P*(D-u);if(i.x=D,i.y=O,G.pointIsInRect1(i,n,r)){var F=D-u,B=O-h,U=F/Math.sqrt(F*F+B*B),z=Math.cos(t/180*Math.PI);return 0<U*z}return!1}},{key:"calcFootOfUpright",value:function(e,t,n,r){var i=Math.min(t.x,n.x),a=Math.max(t.x,n.x),o=Math.min(t.y,n.y),s=Math.max(t.y,n.y),l=e.x,u=e.y,h=t.x,c=t.y,d=n.x,f=n.y;if(Math.abs(h-d)<_)return r.x=h,r.y=u,o<=u&&u<=s;if(Math.abs(c-f)<_)return r.x=l,r.y=c,i<=l&&l<=a;var p=(f-c)/(d-h),m=-1/p,v=(f-c)/(d-h),g=(c-u-(v*h-m*l))/(m-v),y=u+m*(g-l);return r.x=g,r.y=y,!!G.pointIsInRect1(r,t,n)}},{key:"vectorCross",value:function(e,t){return{x:e.y*t.z-e.z*t.y,y:e.z*t.x-e.x*t.z,z:e.x*t.y-e.y*t.x}}},{key:"vectorDot",value:function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z}},{key:"vectorLength",value:function(e){return Math.sqrt(e.x*e.x+e.y*e.y+e.z*e.z)}},{key:"vector2DDot",value:function(e,t){return e.x*t.x+e.y*t.y}},{key:"vector2DLength",value:function(e){return Math.sqrt(e.x*e.x+e.y*e.y)}},{key:"calcRotateAngle",value:function(e,t){var n={x:e.x,y:e.y,z:0},r={x:t.x,y:t.y,z:0},i=G.vectorCross(n,r),a=G.vector2DDot(e,t),o=Math.acos(a/(G.vector2DLength(e)*G.vector2DLength(t)));return 0<i.z?o/Math.PI*180:360-o/Math.PI*180}},{key:"isPointOnSegment",value:function(e,t,n){return(e.x-t.x)*(n.y-t.y)==(n.x-t.x)*(e.y-t.y)&&Math.min(t.x,n.x)<=e.x&&e.x<=Math.max(t.x,n.x)&&Math.min(t.y,n.y)<=e.y&&e.y<=Math.max(t.y,n.y)}},{key:"segCrossPolygon",value:function(e,t,n,r){for(var i=0;i<n.length;i++){var a=n[i],o=n[(i+1)%n.length];if(1==this.calcCrossPoint(e,t,a,o,r))return!0}return!1}}]),G}(),u=l;t.default=u},function(e,t,n){var r=n(16);e.exports=!r(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},function(e,t,n){e.exports=n(386)},function(e,t,n){e.exports=n(306)},function(e,t,n){e.exports=n(375)},function(e,t,n){var r=n(460),i=n(463),a=n(468),o=n(471);function s(e){return r(e)||i(e)||a(e)||o()}e.exports=s},function(e){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(23);e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},function(e,t,n){e.exports=n(313)},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={NONE:0,EXTENT:4,FLOOR:4,MODEL:5,DYNMODEL:6,FACILITY:11,LABEL:12,LINE:21,IMAGE_MARKER:31,TEXT_MARKER:32,LOCATION_MARKER:33,SURFACEIMAGE_MARKER:34,EXTERANL_MODEL:35,EXTERNAL_MODEL:35,POLYGON_MARKER:36,WATER_MARKER:37,EXTRUDE_MARKER:38,GRADIENT_POLYGON_MARKER:39,EDGES_LINES_TYPE:40,ALL:65535,ELEMENT:100},a=i;t.default=a},function(e,t,n){var r=n(82);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(29),i=n(165),a=n(35),o=n(99),s=Object.defineProperty;t.f=r?s:function(e,t,n){if(a(e),t=o(t,!0),a(n),i)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){n(105);var r,i=n(296),a=n(19),o=n(53),s=n(43),l=n(59),u=n(25),h=u("toStringTag");for(r in i){var c=a[r],d=c&&c.prototype;d&&o(d)!==h&&s(d,h,r),l[r]=l.Array}},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(15)),o=r(n(9)),s=r(n(30)),l=r(n(2)),u=r(n(3)),h=function(){function e(){(0,l.default)(this,e)}return(0,u.default)(e,null,[{key:"toColor",value:function(e){if("number"==typeof e)return e;var t=e.split(",");return 3<=t.length?(0,s.default)(t[0])<<16|(0,s.default)(t[1])<<8|(0,s.default)(t[2]):(console.error("color format error",e),0)}},{key:"toRgba",value:function(e){if("number"==typeof e)return"rgba("+(0,s.default)(255*new fm.Color(e).r)+","+(0,s.default)(255*new fm.Color(e).g)+","+(0,s.default)(255*new fm.Color(e).b)+",1)";var t=e.split(",");return 3<=t.length?"rgba("+(0,s.default)(t[0])+","+(0,s.default)(t[1])+","+(0,s.default)(t[2])+",1)":e}},{key:"bindEvent",value:function(e,a,t,o){e.addEventListener(t,function(e){var t,n=e||window.event,r=n.target||n.srcElement,i=n.currentTarget;for(Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),n=t.length;0<=--n&&t.item(n)!==this;);return-1<n});r!==i;)r.matches(a)&&(t=r,o.call(t,n)),r=r.parentNode})}},{key:"toSceneCoord",value:function(e,t){var n=0;return t.groupID&&(n=e.getFMGroup(t.groupID).height),new fm.Vector3(t.x-e.center.x,e.center.y+n,-t.y+e.center.y)}},{key:"removeFormArray",value:function(e,t){var n=(0,o.default)(e).call(e,t);-1<n&&(0,a.default)(e).call(e,n,1)}},{key:"scrollTopAnFun",value:function(){var m,v=!1;return function t(n){var r=n.el,i=n.to,e=n.form,a=(n.time,i<e?"up":"bottom"),o=e<i?i-e:i==e?0:e-i,s=10,l=o/s,u=0,h=function(e){var t=e.val,n=e.nbak,r=e.n,i=e.elTop;return"up"==a?i+(n-r)*t:i-(n-r)*t};function c(){m=0,window.setTimeout(function(){var e=Object(n,{to:r.scrollTop});v=!1,t(e)},s+1)}var d=function(){v=!1,m=!1,0==e&&(r.scrollTop=0)},f=function e(){var t;m--,m<=0?d():(t=function(){!1!==m&&(u=h({val:s,nbak:l,n:m,elTop:i,VDIRECTIONE:a}),u&&(r.scrollTop=u),e())},window.setTimeout(t,s))};function p(){v?c():(v=!0,m=l,f())}p()}}},{key:"toVector",value:function(e){return e.hasOwnProperty("z")?new fm.Vector3(e.x,e.y,e.z):new fm.Vector2(e.x,e.y)}},{key:"sleep",value:function(e){for(var t=(new Date).getTime(),n=0;n<1e7&&!((new Date).getTime()-t>e);n++);}}]),e}(),c=h;t.default=c},function(e,t,n){var r=n(98),i=n(82);e.exports=function(e){return r(i(e))}},function(e,t,n){var r=n(29),i=n(39),a=n(81);e.exports=r?function(e,t,n){return i.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(73),i=Math.min;e.exports=function(e){return 0<e?i(r(e),9007199254740991):0}},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(36)),o=r(n(2)),s=r(n(3)),l=r(n(474)),u=r(n(209)),h=r(n(210)),c=function(){function e(){(0,o.default)(this,e),this._sceneRawData={},this._sceneDecodeData={},this._reader=new l.default,this.file_ver=1}return(0,s.default)(e,[{key:"putRawScene",value:function(e,t){this.sceneRawData[t+""]=e}},{key:"removeRawScene",value:function(e){this.sceneRawData[e+""]=void 0}},{key:"parseScene",value:function(e,t,n){var r=t?this._reader.sceneDecode(this.sceneRawData[e+""],n,e):this._reader.mapDecode(this.sceneRawData[e+""],n,e);if(!r)return r;t&&(r={scene:r,floors:[]});for(var i=r.scene.layerGroups,a=0;a<i.length;a++){var o=i[a];o.elevation=o.height}return r}},{key:"parseFloor",value:function(e,t,n){var r=this._reader.floorGeoDecode(e),i=this._reader.floorBizDecode(t),a=this._reader.floorNaviDecode(n);return[r,i,a]}},{key:"isSceneHasZone",value:function(e){var t;if(!e)return!1;var n=this._sceneDecodeData[e+""];if(!n)return!1;var r=!1;return(0,a.default)(t=n.floors).call(t,function(e){0<e.navi[0].naviZones.length&&(r=!0)}),r}},{key:"putDecodeScene",value:function(e,t){this.file_ver=e.scene.file_ver,this.sceneDecodeData[t+""]=e}},{key:"removeDecodeScene",value:function(e){this.sceneDecodeData[e+""]=void 0}},{key:"getRawScene",value:function(e){return this.sceneRawData[e+""]}},{key:"getDecodeScene",value:function(e){return this.sceneDecodeData[e+""]}},{key:"dispose",value:function(){for(var e in this._reader.dispose(),this.sceneRawData)this.sceneRawData[e]=void 0;for(var t in this.sceneDecodeData)this.sceneDecodeData[t]=void 0;this.sceneRawData=void 0,this.sceneDecodeData=void 0}},{key:"disposeById",value:function(e){this.sceneRawData[e]=void 0,this.sceneDecodeData[e]=void 0}},{key:"sceneRawData",get:function(){return this._sceneRawData},set:function(e){this._sceneRawData=e}},{key:"sceneDecodeData",get:function(){return this._sceneDecodeData},set:function(e){this._sceneDecodeData=e}}],[{key:"convertGeo2Geometry",value:function(e){var t=(new u.default).parse(e),n={vertices:t.toStrip(!0)};return t.hasHoles()&&(n.holes=t.toStripHoles(!0)),n}},{key:"convertArr2Geometry",value:function(e,t){for(var n=e[0].idxs[0],r=[],i=0;i<n-2;i+=2)r.push(t[i]),r.push(t[i+1]);var a={vertices:r};if(1<e.length){for(var o=[],s=1;s<e.length;s++){for(var l=e[s-1],u=e[s],h=[],c=l;c<u-2;c+=2)h.push(t[c]),h.push(t[c+1]);o.push(h)}a.holes=o}return a}},{key:"convertArray2Geometry",value:function(e,t){var n=(new h.default).parseGeometry(e,t),r={vertices:n.toStrip(!0)};return n.hasHoles()&&(r.holes=n.toStripHoles(!0)),r}},{key:"convertGeo2Points",value:function(e){var t=(new u.default).parse(e),n={vertices:t.points};return n}},{key:"convertArrayPoints",value:function(e,t){var n=(new h.default).parse(e,t),r={vertices:n.points};return r}},{key:"checkClockwise",value:function(e){for(var t=Number.NEGATIVE_INFINITY,n=0,r=0,i=0,a=0;a<e.length;a+=2)e[a]>t&&(t=e[a],n=a);var o=new fm.Vector3(e[n],e[n+1],0),r=0===n?e.length-2:n-2,i=n===e.length-2?0:n+2,s=new fm.Vector3(e[r],e[r+1],0),l=new fm.Vector3(e[i],e[i+1],0),u=(new fm.Vector3).copy(o).sub(s),h=(new fm.Vector3).copy(l).sub(o),c=u.cross(h);return 0<c.z}}]),e}(),d=c;t.default=d},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(20)),u=r(n(21)),h=r(n(22)),a=r(n(18)),o=r(n(13)),N=r(n(10)),k=r(n(27)),y=r(n(12)),_=r(n(55)),P=r(n(14)),x=r(n(9)),c=r(n(31)),s=r(n(2)),d=r(n(3)),f=r(n(144)),C=r(n(45)),p=r(n(497)),m=r(n(231)),v=r(n(511)),g=r(n(513)),w=r(n(525)),D=r(n(41)),E=r(n(94)),b=r(n(66)),M=n(526),T=n(527);function O(e,t){var n;if(void 0===h.default||null==(0,u.default)(e)){if((0,P.default)(e)||(n=S(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=(0,l.default)(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function S(e,t){var n;if(e){if("string"==typeof e)return A(e,t);var r=(0,o.default)(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?(0,a.default)(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?A(e,t):void 0}}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var I=function(){function n(e,t){(0,s.default)(this,n),this._scenes={},this._materialManager=new p.default(t,e),this._raycaster=new fm.Raycaster,this._focusAlphaMode=e._focusAlphaMode,this._focusAlpha=e._focusAlpha,this._map=t,this._externalModelUrl=e.mapServerURL+"/models/",this._externalLoader=new g.default(this._map,this._externalModelUrl,"fengmap"==e.mapServerURL,e.key),this._dynamicLoader=new w.default(this._map),this._externalLoader.setLoadedBack(function(){t.dispatchEvent({type:"externalLoaded"}),t.dispatchEvent({type:"gltfLoaded"}),t.checkNode(),t.setRenderList()}),this.isNeedSweep=t.MapOptions.isNeedSweep,this.sweepMax=t.MapOptions.sweepMax,this.sweepMin=t.MapOptions.sweepMin}return(0,d.default)(n,[{key:"createCompassNode",value:function(e,t,n,r,i){var a=0<arguments.length&&void 0!==e?arguments[0]:1,o=1<arguments.length?t:void 0,s=2<arguments.length?n:void 0,l=3<arguments.length?r:void 0,u=4<arguments.length?i:void 0,h=o||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAGhUlEQVR4nOWbzW/cRBjGn7HHY7u7m8RLojIF8SFUUQECFQqnimsF/wAgEIiWKEqgH+LjAJxRDwjU0kIEpZWASvQvAM6IEy1IILUqogiEaKZVluxu1tv1ztgeDvHSELLJfno3yU/KIfaM93kfjz2ej5fMzc2hEzjnLZUTQowCeBzAgwDuBbALAAfgAcgkxaoASgDmAFwG8AuAnwF8yzkvdySwRUg/DBBC3APgOQBPEEIeZYzVKKV1SqmklErTNEPDMGJCSAwAWmsjjmMjiiIahiFL/mwppau1Pg/gawBnOee/dSR2DXpmgBDCBPA0gGnTNB9zHGfRcZwqYyzoRqCU0gmCIBMEwUgURd8DmAVwjnMedXPdBl0bkAR+GMB7juNUtm3bVrJtu9YLcSup1+vujRs3xoIgyAF4DcDxbo3oygAhxEsATrmuW85mswuUUtWNmFYJw9DyfT9fq9VGAUxyzj/t9FqdGnAfgBnLsg6MjIxcZ4zVOxXQDVJKe3FxcbtS6jSAjzjnl9q9RicGzBBCTmaz2flsNltqt3I/8H1/zPf9Ca31K5zzj9qp264BR03TfNXzPGFZ1kDuejOUUnaxWORRFL3HOX+r1XpGG79xjDF2aHx8/M9hCx4ALMuqj4+P/8kYOyyEONZqvVYNOGHb9v58Pn/VMIy4Q419xzCMOJ/PX7Vte78Q4kRLdVooc8y27Rfy+bwghOguNfYdQojO5/PCtu0XWmkJ6xlwlDE26XnetR7pSw3P864xxiaFEEfXKreWATPJC29uI9z5lRBCtOd5c6ZpviqEmGlWrpkBDxBCTnqeJ4b5mV8PwzBiz/MEIeSkEOL+Vcs0qTudy+Xmh/Ft3y6WZdVzudw8gOnVzq9mwIxlWS9mMpmh+MjpBZlMpmRZ1gEhxOTKcys/hCgAOax9fTcopexCoXAnALp8ALWyBRx2XXdxswUPLD0KruuWsTRy/ZflLYACkBMTE3+kNapLmzAMrfn5+bsAMM55CPy3BTzrOE5lswYPAJRS5TiOD+DZxrHlBkxvphdfMzKZTBHLeoSGAfdRSnd3O321EWCMBZTS3Y3vgoYBTzuOUxmgrlRJYn0KuGnAPtu2q4OTlC5JrPuAJQPGCCF7tkLzb8AYCwghe4QQYwaAvYyxvsziDjNJzHsNAA9RSjfdh896JDE/ZADYRSmVgxaUNknMuwwAO7ewATsNALebphkOWlDaJDHfbgAY2ciTHp2SxDxqAMg1Vmm3EknM2XbWBTYVWmsCQBoAKlrrLWdEEnPFALAYx/GWMyCJuWIA+CuKIjpoQWkTx7EJ4LoB4NcwDNmgBaVNEvOvBoDLW9iAywaAn8IwtActKG2SmH8yAHwnpXQHLShtkpi/MwCUtNYXpJTOoEWlhZTS0Vpf4JyXGt3f1/V6PbNmrU1EEus3wM0psbO1Wm1kcJLSJYn1C+CmAVeiKDq/Fd4FUko3iqLznPMrwH/XBWar1erogHSlRhLjbOP/5QacC4IgF4ahlb6sdAjD0Ep2mZ5rHFtuQAjgDd/386krS4kkttcb64LA/1eHj9VqtVGl1Kb7MFJK2cnW2uPLj680IAIwVS6Xt6emLCWSmKZWbq5ebRj8iVLqdLVaHUtHWv/xfX9MKXWac/7JynPN5gFmK5XKhFJqww+SlFK27/sTAFbdQ9zMgIta60PFYnHHRp4siePYKBaLO7TWU812kq8V3Mkoit5PLkD6pLFvaK1JsVjckWyePtWs3Hp3900p5alSqXRrj/X1nVKpdKuU8hTn/M21yrXSvI8EQfBZsVjkG6ElJHeeB0HwGef8yHrlW32+DwZBcGZhYeG2YX4nxHFsLCws3BYEwRnO+cFW6rQTzBEp5QeFQuGOYewdlFKsUCjcIaX8oJU736CTlJmXCSEncrnc/LBsqqpWq2OVSmVCa32Qc/5hO3U7TZq6H8C0ZVkHRkdHrw9qY6VSyi6Xy42kqVnO+cV2r9Ft2twkgI9d113M5XJ/p7XKHEURrVQqtyQTG1NrdXPr0YvESQrgDQDvOI5TyWQypX7tN5JSOtVqtZE4+TaAd5eP7Dqhl6mzDMAzAKZM09zjuu6ibds9SZ2t1+uZWq02EkXRBQAfA/iSc96TTR39TJ5+HsCThJCHGWM3LMuqJ4nTaq3k6SiKrDAMmVLKllJu01r/COArAJ8PdfJ0M4QQY1hKn38ESxmndwPYjtXT568B+B3AJQA/YCl9vq89zT/uIvNLxH1bgwAAAABJRU5ErkJggg==",c=s||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODc3NkExOTBBM0QwMTFFNkI4Rjk5RTE2MjhCMzFCODAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODc3NkExOTFBM0QwMTFFNkI4Rjk5RTE2MjhCMzFCODAiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDozRkM2NUZGNUEzQ0MxMUU2QjhGOTlFMTYyOEIzMUI4MCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDozRkM2NUZGNkEzQ0MxMUU2QjhGOTlFMTYyOEIzMUI4MCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvSIOBAAAAKaSURBVHja7JvLTuMwFECddNQPQEhVNMCkCJHhESqxa5o9YofEewV7EJ3Zt0gzHzDzPbPvY1vmBwZaEOqCRXeoPIqdelBTQpu0tYPta+lKIdjXV+ceG1SB1ul0kMpDR4oPAAAAAAAAAAAAAAAAAACg6vjEKnGtVhs25TOOP6lUijxv4LgZNNkwDOkM+IVjhcZv1Y6AjWOn5+tt+k4ZAIW+vXX6TgkAK33d/z/Iu1UVABTf2TcWC/QYur874Pu7dI60AApD9uRuAU8ASzj2Qswjc5ZlBFAMuR9XC3SO3d+PMH+frpEGQCHiXtws4AHgK46DEdaRNZYMAIoj7kPWnIsOwIp49oPuAktkAKT7iTHWJ1jfBTrj7h9MIM8hjkURARyN2f1eC45FBLD5QXNxA2B+0Fy+obH6+4BHy3rQm82hnzk2cbypoNXyFzk19Wzc3SVY1MnsQ1GkaW291ZpM/unpe+GOwOP8/N+JJVtYuBAOwFM6/QPpE0hPcpjmT+HuAHwEUNt1/yVLpYEX2G3QHdA7XPdSK5XSBqM6mf4m+LC2djKWBWQtycFwMDWADGzBJbbgy0gG4LUId59kEtIAzwLbHs0Cssa2T1nXx9wAasEVtmAukgGuW0fUHKENoBacRrKAU/e5GeBZkMtdJcvluVAG5HJ1VC6/3hvCG0B/IpyFsqB785/xqoubAZ4FjlNPViqzAw1wnAaqVHymSGFAKAu63f/GsyauBlALGtiCmUADHOca9RkilQHUgnygBd3u53nXw90Az4JstpGsVmd8BmSz16hanQ1MJZMBngWZTN4HiDxnMt/jqCUWA3rvAs+Ad86+tAZ4ANbXt55Ms41I4Oe46tDgf4YUHwAAAAAAAAAAAAAAAAAAQNXxIsAAkfC85URYZVgAAAAASUVORK5CYII=",d=new v.default;d.transparent=!0,d.uniforms.scale={value:a},d.uniforms.offset={value:new fm.Vector2(l,u)},d.uniforms.mapfront={},d.uniforms.mapBack={},d.uniforms.mapfront.value=this._materialManager.loadTexture(c,function(e){e.flipY=!0,d.needsUpdate=!0}),d.uniforms.mapBack.value=this._materialManager.loadTexture(h,function(e){e.flipY=!0,d.needsUpdate=!0});var f=new m.default,p=new fm.Mesh(f,d);return p.userData.coord={x:l,y:u},p.userData.width=.5*a,p.frustumCulled=!1,p}},{key:"getModel",value:function(e,t,n,r){var i=this._scenes[e];if(!i)return[];var a=i.getGroupsModels(t);this._raycaster.setFromCamera(n,r);var o=this._raycaster.intersectObjects(a);return o}},{key:"getExternalModels",value:function(e,t,n,r){var i=this._scenes[e];if(!i)return[];var a=i.getGroupsExternalModels(t);this._raycaster.setFromCamera(n,r);var o=this._raycaster.intersectObjects(a);return o}},{key:"getModelExternal",value:function(e,t,n,r){var i=this._scenes[e];if(!i)return[];var a=i.getGroupsModels(t),o=i.getGroupsExternalModels(t),s=(0,c.default)(a).call(a,o);this._raycaster.setFromCamera(n,r);var l=this._raycaster.intersectObjects(s);return l}},{key:"getMarkers",value:function(e,t,n,r){var i=this._scenes[e];if(!i)return[];for(var a=[],o=0;o<t.length;o++)for(var s=i.getAllImageMarker(t[o]),l=0;l<s.length;l++)a.push(s[l]);this._raycaster.setFromCamera(n,r),this._raycaster.perspective="PerspectiveCamera"===r.type;var u=this._raycaster.intersectObjects(a);return u}},{key:"getNode",value:function(e,t,n,r,i){var a=this._scenes[e];if(!a)return[];var o=a.getNodesExceptFacility(t,i),s=a.getDynnodes(i,t);this._raycaster.setFromCamera(n,r),this._raycaster.perspective="PerspectiveCamera"===r.type;var l=this._raycaster.intersectObjects(o),u=this._raycaster.intersectObjects(s,!0);if(u[0])for(var h=u[0].object;h.parent;){if(h.parent.mapNode){u[0].object=h.parent;break}h=h.parent}return u[0]&&l[0]?u[0].distance>l.distance?l:u:u[0]?u:l[0]?l:[]}},{key:"getFacility",value:function(e,t,n,r,i){var a=this._scenes[e];if(!a)return[];var o=a.getFacilityByFilter(t,i);this._raycaster.setFromCamera(n,r),this._raycaster.perspective="PerspectiveCamera"===r.type;for(var s=this._raycaster.intersectObjects(o),l=0;l<s.length;l++)if(l){if(!(s[l].distance-s[l-1].distance<1e-6))break;if("number"==typeof s[l].object.material.priority&&"number"!=typeof s[l-1].object.material.priority){var u=s[l],h=s[l-1];s[l-1]=u,s[l]=h}else if("number"==typeof s[l].object.material.priority&&"number"==typeof s[l-1].object.material.priority)for(var c=0,d=1;d<=l&&s[l-c].object.material.priority>s[l-d].object.material.priority;d++){var f=s[l-c],p=s[l-d];s[l-d]=f,s[l]=p,c++}}return s}},{key:"getGroupLength",value:function(e){return this._scenes[""+e].groupLength}},{key:"getGroupIds",value:function(e){return this._scenes[""+e].groupIds}},{key:"getGroup",value:function(e,t){return this._scenes[""+e].groups[t+""]}},{key:"getRenderList",value:function(){if(this._scenes){var e,t=[];for(e in this._scenes){var n=this._scenes[e].getRenderGroup();t.push(n)}return t}}},{key:"conformatScene",value:function(e,t,n){var r=new f.default(t,e,this);r.parent=this,this._scenes[t+""]=r,this._scenes[t+""].theme=n}},{key:"checkMaterialAlpha",value:function(e,t){var n;if(e)if(this._focusAlphaMode&&t!==this._map.currentFocusGroup&&(0,x.default)(n=this._map.otherFocus).call(n,t)<0){if((0,P.default)(e.material)){var r,i=O(e.material);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.opacity=this._focusAlpha}}catch(e){i.e(e)}finally{i.f()}}else if(e.material)if(void 0===e.material.length)e.material.opacity!==this._focusAlpha&&(e.material.opacity=this._focusAlpha);else for(var o=0;o<e.material.length;o++)e.material[o].opacity!==this._focusAlpha&&(e.material[o].opacity=this._focusAlpha)}else if((0,P.default)(e.material)){var s,l=O(e.material);try{for(l.s();!(s=l.n()).done;){var u=s.value;"number"==typeof u.userData.opacity&&(u.opacity=u.userData.opacity)}}catch(e){l.e(e)}finally{l.f()}}else void 0!==e.material&&"number"==typeof e.material.userData.opacity&&(e.material.opacity=e.material.userData.opacity)}},{key:"checkNodeByFrustum",value:function(e,u,t,h,c){var d=this;if(d._scenes[c+""]){var f=d._scenes[c+""].theme,p=this._scenes[""+c].center.x,m=this._scenes[""+c].center.y,v=this._scenes[""+c].mapcenter.x,g=this._scenes[""+c].mapcenter.y,y=this._map.labelLanguage;E.default[this._map.uuid].bbox=this._scenes[""+c].bboxTh,E.default[this._map.uuid].bbox.uuid=this._map.uuid;var n=this._scenes[""+c].groups;try{var r,i=(0,_.default)(n),a=function(e){var l=n[e];if((0,x.default)(t).call(t,l.eid)<=-1)return l.visible=!1,"continue";l.visible=!0,l.traverseByAlias(["extent","model","label","facility","externalModel"],function(r,e){var t=r.bdata,n=-1===t.minlevel||-1===t.maxlevel||0!==t.minlevel&&!t.minlevel||!t.maxlevel||t.minlevel<=h&&t.maxlevel>h;if(n){switch(e){case"extent":r.renderNodeInited?d.checkMaterialAlpha(r.renderNode,l.eid):d.createExtent(r,c,l.eid);break;case"model":r.renderNodeInited?(d.checkMaterialAlpha(r.renderNode,l.eid),d.checkMaterialAlpha(r.line,l.eid)):d.createModel(r,c,l.eid);break;case"label":r.renderNodeInited?d.checkMaterialAlpha(r._renderNode,l.eid):r.tryInit||d.createLabel(r,c,y,l.eid);break;case"facility":r.renderNodeInited?d.checkMaterialAlpha(r._renderNode,l.eid):d.createFacility(r,c,l.eid);break;case"externalModel":if(r.renderNodeInited)d.checkMaterialAlpha(r._renderNode,l.eid);else{var i=r.bdata,a=r.gdata,o=f.getExteralModelTheme(i.fid);if(!o)return;d._externalLoader.preLoadModels[o.normalid]||(d._externalLoader.preLoadModels[o.normalid]={loaded:!1,isLoading:!1,modelUrl:o.model,model:null,geometry:null,material:null});var s=d._externalLoader.preLoadModels[o.normalid];s.loaded?d.createExterModel(s.geometry,s.material,a,i,o,r,p,m,l.height,v,g,s.isGltf):(d._externalLoader.waitingBacks[o.normalid]?d._externalLoader.addWaitingBacks(o.normalid,function(e,t,n){d.createExterModel(e,t,a,i,o,r,p,m,l.height,v,g,"js"!==n)},i.fid):d._externalLoader.addWaitingBacks(o.normalid,function(e,t,n){d.createExterModel(e,t,a,i,o,r,p,m,l.height,v,g,"js"!==n)},i.fid),s.isLoading||d._externalLoader.load(o.normalid))}}r.checkByFrustum(u)}else r.visible=!1})},o=O(i);try{for(o.s();!(r=o.n()).done;){var s=r.value;a(s)}}catch(e){o.e(e)}finally{o.f()}}catch(e){console.error("渲染楼层失败!",e)}}}},{key:"createModel",value:function(e,t,n){var r,i=this._scenes[""+t].center.x,a=this._scenes[""+t].center.y,o=this._scenes[""+t].mapcenter.x,s=this._scenes[""+t].mapcenter.y,l=this._scenes[""+t].theme,u=e.gdata,h=e.bdata;this._map.MapOptions.useStoreApply&&(r=l.getStoreApplyTheme(h.fid)),r=r||l.getModelTheme(h);var c=null,c=1===this._map.dataManager.file_ver?C.default.convertGeo2Geometry(u.geo):C.default.convertArray2Geometry(u.idxs,u.pts);e._data=c;var d=u.height&&-1!==u.height?u.height:2,f=this.createGeometry(c,d,t),p=this._materialManager.createNormalMaterial(r);e._geometry=f;var m,v,g=this.isNeedSweep;this.isNeedSweep&&(fm.ShaderLib.physical.vertexShader=M.vertexShader,fm.ShaderLib.physical.fragmentShader=T.fragmentShader,(0,y.default)(fm.ShaderLib.physical.uniforms,{maxPos:{value:this.sweepMax},minPos:{value:this.sweepMin},relativeModelMatrix:{value:void 0}})),e.initMesh(p,new fm.Vector3(i,a+d,0),g),e.x=o,e.y=s,e.height=d,e.currHeight=d,this.checkMaterialAlpha(e.renderNode,n),e.initLine(this._materialManager.createLineMaterial(r),u.height),this.checkMaterialAlpha(e.line,n),r.image&&r.sizes&&(m=r.sizes.split(","),v=[],r.coords&&(v=r.coords.split(",")),e.addStoreImage({image:r.image?this._map.MapOptions.mapThemeURL+"/"+this._map.MapOptions.defaultThemeName+"/"+r.image:"",angle:r.angle?r.angle:0,size:[(0,k.default)(m[0]),(0,k.default)(m[1])],mapCoord:r.coords?new fm.Vector2((0,k.default)(v[0]),(0,k.default)(v[1])):void 0}))}},{key:"createExtent",value:function(e,t,n){var r=e.gdata,i=this._scenes[t+""].theme,a=this._scenes[""+t].center.x,o=this._scenes[""+t].center.y,s=this._scenes[""+t].mapcenter.x,l=this._scenes[""+t].mapcenter.y,u=null,u=1===this._map.dataManager.file_ver?C.default.convertGeo2Geometry(r.geo):C.default.convertArray2Geometry(r.idxs,r.pts);e._geometry=this.createGeometry(u,r.height?r.height:1,t),e.x=s,e.y=l;var h=this._materialManager.createNormalMaterial();e.initMesh(h,new fm.Vector3(a,o,0),i.floorColor,i.floorOpacity),this.checkMaterialAlpha(e.renderNode,n)}},{key:"createLabel",value:function(e,t,n,r){var i=e.gdata,a=e.bdata,o=this._scenes[""+t].mapcenter.x,s=this._scenes[""+t].mapcenter.y,l=this._scenes[""+t].center.x,u=this._scenes[""+t].center.y,h=this._scenes[t+""].theme,c=null,c=1===this._map.dataManager.file_ver?C.default.convertGeo2Points(i.geo):C.default.convertArrayPoints(i.idxs,i.pts),d=-1===i.height?2.2:i.height,f=new fm.Vector3(c.vertices[0].x-o,-c.vertices[0].y+s,0).applyEuler(new fm.Euler(Math.PI/2,0,0,"XYZ")).add(new fm.Vector3(l,u+d,0)),p=a.ename,m=a.name,v=n===b.default.ZH?m:p;e.x=c.vertices[0].x,e.y=c.vertices[0].y,e.height=d,e.pos=f,e.tryInit=!0;var g,y=h.getLabelTheme(a);y&&(e.theme=y,e.size=1.4*y.fontsize,v&&(g=this._materialManager.createLabelMaterial(v,y,!1,e),e.initSprite(g,(new fm.Vector3).copy(f)),this.checkMaterialAlpha(e._renderNode,r),e.setSize()))}},{key:"createFacility",value:function(e,t,n){var r=e.gdata,i=e.bdata,a=this._scenes[""+t].center.x,o=this._scenes[""+t].center.y,s=this._scenes[""+t].mapcenter.x,l=this._scenes[""+t].mapcenter.y,u=this._scenes[t+""].theme,h=null,h=1===this._map.dataManager.file_ver?C.default.convertGeo2Points(r.geo):C.default.convertArrayPoints(r.idxs,r.pts),c=-1===r.height?2.2:r.height,d=new fm.Vector3(h.vertices[0].x-s,-h.vertices[0].y+l,0).applyEuler(new fm.Euler(Math.PI/2,0,0,"XYZ")).add(new fm.Vector3(a,o+c,0)),f=u.getPoiTheme(i),p=this._materialManager.createPoiMaterial(f,e);e.x=h.vertices[0].x,e.y=h.vertices[0].y,e.height=c,e.pos=d,f.height&&(e.size=f.height),this._map.wxInfo.pixelRatio&&(e.size*=this._map.wxInfo.pixelRatio),e.initSprite(p,(new fm.Vector3).copy(d)),this.checkMaterialAlpha(e._renderNode,n),e.setSize()}},{key:"everGroup",value:function(e,t){for(var n=0;n<e.biz.length;n++){for(var r=0;r<e.biz[n].extentLayer.length;r++)t(e.geo[n].extentLayer[r],"extentLayer",e.biz[n].extentLayer[r]);for(var i=0;i<e.biz[n].labelLayer.length;i++)t(e.geo[n].labelLayer[i],"labelLayer",e.biz[n].labelLayer[i]);for(var a=0;a<e.biz[n].modelLayer.length;a++)t(e.geo[n].modelLayer[a],"modelLayer",e.biz[n].modelLayer[a]);for(var o=0;o<e.biz[n].poiLayer.length;o++)t(e.geo[n].poiLayer[o],"poiLayer",e.biz[n].poiLayer[o]);for(var s=0;s<e.biz[n].stairLayer.length;s++)t(e.geo[n].stairLayer[s],"stairLayer",e.biz[n].stairLayer[s]);for(var l=0;l<e.biz[n].externalModelLayer.length;l++)t(e.geo[n].externalModelLayer[l],"externalModelLayer",e.biz[n].externalModelLayer[l])}}},{key:"createGeometry",value:function(e,t,n){var r=e.vertices;function i(e){for(var t=[],n=0;n<e.length;n+=2){var r=(e.length-n)/2;t[2*(r-1)]=e[n],t[2*(r-1)+1]=e[n+1]}return t}var a=C.default.checkClockwise(r);if(a||(r=i(r),e.vertices=r),6<=r.length){var o,s=new fm.Shape,l=this._scenes[""+n].mapcenter.x,u=this._scenes[""+n].mapcenter.y;if(e.holes&&0<e.holes.length){var h={};for(b in e.holes){var c=e.holes[b],d=C.default.checkClockwise(c);d||(c=i(c),e.holes[b]=c);for(var f=0;f<c.length;f+=2){var p=c[f]+"-"+c[f+1];h[p]=!0}}for(b in this.forEachVertForShape(r,function(e,t,n){e?s.moveTo(t-l,n-u):h[t+"-"+n]||s.lineTo(t-l,n-u)}),e.holes){var c=e.holes[b],m=new fm.Path;this.forEachVertForShape(c,function(e,t,n){e?m.moveTo(t-l,n-u):m.lineTo(t-l,n-u)}),s.holes.push(m)}}else this.forEachVertForShape(r,function(e,t,n){e?s.moveTo(t-l,n-u):s.lineTo(t-l,n-u)});o=0==t?new fm.ShapeGeometry(s):new fm.ExtrudeGeometry(s,{depth:t,bevelEnabled:!1});for(var v=E.default[this._map.uuid].bbox.min.x,g=E.default[this._map.uuid].bbox.min.y,y=E.default[this._map.uuid].bbox.max.x-E.default[this._map.uuid].bbox.min.x,_=E.default[this._map.uuid].bbox.max.y-E.default[this._map.uuid].bbox.min.y,x=o.faces,w=x.length,b=0;b<w;b++){var M=o.vertices[x[b].a],T=o.vertices[x[b].b],S=o.vertices[x[b].c];o.faceVertexUvs[0][b][0].x=(M.x-v)/y,o.faceVertexUvs[0][b][0].y=(M.y-g)/_,o.faceVertexUvs[0][b][1].x=(T.x-v)/y,o.faceVertexUvs[0][b][1].y=(T.y-g)/_,o.faceVertexUvs[0][b][2].x=(S.x-v)/y,o.faceVertexUvs[0][b][2].y=(S.y-g)/_}return o.computeBoundingSphere(),{geometry:o,shape:s}}return null}},{key:"createExterModel",value:function(e,t,n,r,i,a,o,s,l,u,h,c){var d=this,f=null,f=1===this._map.dataManager.file_ver?C.default.convertGeo2Points(n.geo):C.default.convertArrayPoints(n.idxs,n.pts),p=new fm.Vector3(f.vertices[0].x-u,-f.vertices[0].y+h,0).applyEuler(new fm.Euler(Math.PI/2,0,0,"XYZ")).add(new fm.Vector3(o,s+(-1===n.height?2.2:n.height),0));if(c){var m=e.scene,v=m.clone();v.traverse(function(e){if(e instanceof fm.Mesh){if(void 0!==e.material.length)for(var t=0;t<e.material.length;t++)e.material[t]=e.material[t].clone(),e.material[t].color=new fm.Color(D.default.toColor(i.color)),e.material[t].needsUpdate=!0,e.material[t].userData.opacity=e.material[t].opacity;else e.material=e.material.clone(),d.isNeedSweep&&(e.name="isNeedSweep",e.material.uniforms={maxPos:{value:d.sweepMax},minPos:{value:d.sweepMin},relativeModelMatrix:{value:e.matrixWorld}}),e.material.transparent=!0,e.material.color=new fm.Color(D.default.toColor(i.color)),e.material.needsUpdate=!0,e.material.userData.opacity=e.material.opacity;e.renderOrder=r.eid}});var g=i.scale.split(","),y=i.rotate.split(","),_=i.translate.split(","),x=new fm.Vector3;if(x.set((0,k.default)(y[0])*fm.Math.DEG2RAD,(0,k.default)(y[2])*fm.Math.DEG2RAD,(0,k.default)(y[1])*fm.Math.DEG2RAD),v.rotation.setFromVector3(x,"YXZ"),v.scale.set((0,k.default)(g[0]),(0,k.default)(g[2]),(0,k.default)(g[1])),p.add(new fm.Vector3((0,k.default)(_[0]),(0,k.default)(_[2]),(0,k.default)(_[1]))),v.position.set(p.x,p.y,p.z),a.renderNode=v,a.x=f.vertices[0].x+(0,k.default)(_[0]),a.y=f.vertices[0].y+(0,k.default)(_[1]),a.height=-1===n.height?2.2:n.height,!a._renderNode)return;a._renderNode.frustumCulled=!1,a.renderNodeInited=!0}else{if((0,P.default)(t)){var w,b=O(t);try{for(b.s();!(w=b.n()).done;){var M=w.value;M.color=new fm.Color(D.default.toColor(i.color)),M.transparent=!0,(0,N.default)(M)&&((0,N.default)(M).wrapS=fm.RepeatWrapping,(0,N.default)(M).wrapT=fm.RepeatWrapping,M.color.setScalar(1)),M.userData.opacity=M.opacity}}catch(e){b.e(e)}finally{b.f()}}else t.color=new fm.Color(D.default.toColor(i.color)),t.transparent=!0,(0,N.default)(t)&&((0,N.default)(t).wrapS=fm.RepeatWrapping,(0,N.default)(t).wrapT=fm.RepeatWrapping,t.color.setScalar(1)),t.userData.opacity=t.opacity;var T=[];if(void 0!==t.length)for(var S=0;S<t.length;S++)T.push(t[S].clone());else T.push(t.clone());var E=new fm.Mesh(e,T),A=i.scale.split(","),I=i.rotate.split(","),L=i.translate.split(",");E.scale.set((0,k.default)(A[0]),(0,k.default)(A[2]),(0,k.default)(A[1]));var R=new fm.Vector3;if(R.set((0,k.default)(I[0])*fm.Math.DEG2RAD,(0,k.default)(I[2])*fm.Math.DEG2RAD,(0,k.default)(I[1])*fm.Math.DEG2RAD),E.rotation.setFromVector3(R,"YXZ"),p.add(new fm.Vector3((0,k.default)(L[0]),(0,k.default)(L[2]),(0,k.default)(L[1]))),E.position.set(p.x,p.y,p.z),E.renderOrder=r.eid,a.renderNode=E,a.x=f.vertices[0].x+(0,k.default)(L[0]),a.y=f.vertices[0].y+(0,k.default)(L[1]),a.height=-1===n.height?2.2:n.height,!a._renderNode)return;a._renderNode.frustumCulled=!1,a.renderNodeInited=!0}}},{key:"findGltfMesh",value:function(e,t){if(e instanceof fm.Mesh)t(e);else{var n,r=O(e.children);try{for(r.s();!(n=r.n()).done;){var i=n.value;this.findGltfMesh(i,t)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"getDynLoader",value:function(){return this._dynamicLoader}},{key:"getSceneCenter",value:function(e){return(new fm.Vector3).copy(this._scenes[e+""].center)}},{key:"forEachVertForShape",value:function(e,t){var n=0;for(t(!0,e[n],e[n+1]),n=2;n<e.length;n+=2)t(!1,e[n],e[n+1]);n=0,t(!1,e[n],e[n+1])}},{key:"getCurrentNodeCenter",value:function(e,t){for(var n=this._scenes[t],r=n.center,i=0,a=0;a<e.length;a++)i+=e[a]*n.space;return new fm.Vector3(r.x,r.y+i/e.length,0)}},{key:"getHeight",value:function(e,t){return this._scenes[""+e].getHeight(t)}},{key:"getSceneById",value:function(e){return this._scenes[""+e]}},{key:"dispose",value:function(){for(var e in this._materialManager.dispose(),this._scenes)this._scenes[e].dispose(),this._scenes[e].parent=void 0;this._map=void 0,this._scenes=void 0,this._materialManager=void 0}},{key:"disposeById",value:function(e){this._scenes[e].dispose(),this._scenes[e].parent=void 0,this._scenes[e]=void 0}},{key:"map",get:function(){return this._map}},{key:"materialManager",get:function(){return this._materialManager}}]),n}(),L=I;t.default=L},function(e){var t=function(){return this}();try{t=t||new Function("return this")()}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},function(e,t,n){e.exports=n(276)},function(e,t,n){var r=n(11),i=n(19),a=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?a(r[e])||a(i[e]):r[e]&&r[e][t]||i[e]&&i[e][t]}},function(e,t,n){var o=n(29),s=n(16),l=n(34),u=Object.defineProperty,h={},c=function(e){throw e};e.exports=function(e,t){if(l(h,e))return h[e];t=t||{};var n=[][e],r=!!l(t,"ACCESSORS")&&t.ACCESSORS,i=l(t,0)?t[0]:c,a=l(t,1)?t[1]:void 0;return h[e]=!!n&&!s(function(){if(r&&!o)return!0;var e={length:-1};r?u(e,1,{enumerable:!0,get:c}):e[1]=1,n.call(e,i,a)})}},function(e,t,n){var r,i,a,o,s,l,u,h=n(169),c=n(19),d=n(23),f=n(43),p=n(34),m=n(100),v=n(83),g=c.WeakMap,y=function(e){return x(e)?l(e):s(e,{})},_=function(n){return function(e){var t;if(!d(e)||(t=l(e)).type!==n)throw TypeError("Incompatible receiver, "+n+" required");return t}},x=h?(r=new g,i=r.get,a=r.has,o=r.set,s=function(e,t){return o.call(r,e,t),t},l=function(e){return i.call(r,e)||{}},function(e){return a.call(r,e)}):(u=m("state"),v[u]=!0,s=function(e,t){return f(e,u,t),t},l=function(e){return p(e,u)?e[u]:{}},function(e){return p(e,u)});e.exports={set:s,get:l,has:x,enforce:y,getterFor:_}},function(e,t,n){var r=n(124),i=n(71),a=n(25),o=a("toStringTag"),s="Arguments"==i(function(){return arguments}()),l=function(e,t){try{return e[t]}catch(e){}};e.exports=r?i:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=l(t=Object(e),o))?n:s?i(t):"Object"==(r=i(t))&&"function"==typeof t.callee?"Arguments":r}},function(e,t,n){e.exports=n(309)},function(e,t,n){e.exports=n(379)},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={NaviNodeType_NULL:-1,NaviNodeType_COMMON:0,NaviNodeType_SIDE:1,NaviNodeType_FLOOR:2,NaviNodeType_EXTENT:3,NaviLiftType_NULL:0,NaviLiftType_Lift:1,NaviLiftType_Stair:2,NaviLiftType_Escalator:3,NaviLiftType_Accessible:4,NaviLiftEntry_BOTH:0,NaviLiftEntry_UP:1,NaviLiftEntry_DOWN:2,NaviLiftEntry_FORBID:3,NaviEntranceType_NULL:0,NaviEntranceType_EXIT:1,NaviEntranceType_ENTRANCE:2,NaviEntranceType_ACCESS:3,NaviRoadRank_MAIN:1,NaviRoadRank_MINOR:2,NaviRoadRank_NARROW:3,NaviRoadEntry_BOTH:0,NaviRoadEntry_FORWARD:1,NaviRoadEntry_BACK:2,NaviRoadEntry_FORBID:3,NaviRoadPass_NULL:-1,NaviRoadPass_NOT_THROUGH:0,NaviRoadPass_THROUGH:1,NaviZoneType_NULL:-1,NaviZoneType_PASS_UNRESTRAINT:0,NaviZoneType_PASS_THROUGH:1,NaviZoneType_PASS_NOT_THROUGH:2,NaviZoneType_NO_ENTRY:3,NaviZoneType_CORRIDOR:4,NaviModelPassType_PASS_THROUGH:0,NaviModelPassType_PASS_NOT_THROUGH:1,NaviModelPassType_NOT_PASS:2,NaviModelPassType_DECORATE:3,NaviRoadHinderType_HINDER_GENERAL:0,NaviRoadHinderType_HINDER_HIGH:1,NaviObstructType_MODEL:0,NaviObstructType_EXTENT:1};t.default=i},function(e,t,n){"use strict";var i=n(281).charAt,r=n(52),a=n(120),o="String Iterator",s=r.set,l=r.getterFor(o);a(String,"String",function(e){s(this,{type:o,string:String(e),index:0})},function(){var e,t=l(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=i(n,r),t.index+=e.length,{value:e,done:!1})})},function(e,t,n){var a=n(124),o=n(39).f,s=n(43),l=n(34),u=n(284),r=n(25),h=r("toStringTag");e.exports=function(e,t,n,r){var i;e&&(i=n?e:e.prototype,l(i,h)||o(i,h,{configurable:!0,value:t}),r&&!a&&s(i,"toString",u))}},function(e){e.exports={}},function(e,t,n){e.exports=n(295)},function(e,t,n){var x=n(72),w=n(98),b=n(38),M=n(44),T=n(128),S=[].push,r=function(f){var p=1==f,m=2==f,v=3==f,g=4==f,y=6==f,_=5==f||y;return function(e,t,n,r){for(var i,a,o=b(e),s=w(o),l=x(t,n,3),u=M(s.length),h=0,c=r||T,d=p?c(e,u):m?c(e,0):void 0;h<u;h++)if((_||h in s)&&(i=s[h],a=l(i,h,o),f))if(p)d[h]=a;else if(a)switch(f){case 3:return!0;case 5:return i;case 6:return h;case 2:S.call(d,i)}else if(g)return!1;return y?-1:v||g?g:d}};e.exports={forEach:r(0),map:r(1),filter:r(2),some:r(3),every:r(4),find:r(5),findIndex:r(6)}},function(t,e,n){var r=n(322),i=n(190);function a(e){return t.exports=a="function"==typeof i&&"symbol"==typeof r?function(e){return typeof e}:function(e){return e&&"function"==typeof i&&e.constructor===i&&e!==i.prototype?"symbol":typeof e},a(e)}t.exports=a},function(e,t,n){e.exports=n(394)},function(e,t,n){e.exports=n(404)},function(e){var n,r,t=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}function s(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{return r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var l,u=[],h=!1,c=-1;function d(){h&&l&&(h=!1,l.length?u=l.concat(u):c=-1,u.length&&f())}function f(){if(!h){var e=o(d);h=!0;for(var t=u.length;t;){for(l=u,u=[];++c<t;)l&&l[c].run();c=-1,t=u.length}l=null,h=!1,s(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}t.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new p(e,t)),1!==u.length||h||o(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=m,t.addListener=m,t.once=m,t.off=m,t.removeListener=m,t.removeAllListeners=m,t.emit=m,t.prependListener=m,t.prependOnceListener=m,t.listeners=function(){return[]},t.binding=function(){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={ZH:"zh",EN:"en",CHN:"zh"},a=i;t.default=a},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.mapOptionMessage=t.tileMessage=t.cerityMessage=void 0;var i={warn_nokey:"key%E5%80%BC%E6%9C%AA%E9%85%8D%E7%BD%AE%EF%BC%8C%E8%AF%B7%E8%AE%BF%E9%97%AE%E8%9C%82%E9%B8%9F%E4%BA%91%E6%8E%A7%E5%88%B6%E5%8F%B0%E6%9F%A5%E7%9C%8B%E5%BA%94%E7%94%A8%E5%90%8D%E7%A7%B0%E3%80%82",warn_noappname:"%E5%BA%94%E7%94%A8%E5%90%8D%E7%A7%B0%EF%BC%88appname%EF%BC%89%E6%9C%AA%E9%85%8D%E7%BD%AE%EF%BC%8C%E8%AF%B7%E8%AE%BF%E9%97%AE%E8%9C%82%E9%B8%9F%E4%BA%91%E6%8E%A7%E5%88%B6%E5%8F%B0%E6%9F%A5%E7%9C%8B%E5%BA%94%E7%94%A8%E5%90%8D%E7%A7%B0%E3%80%82",warn_nomapid:"%E5%9C%B0%E5%9B%BEID%E6%9C%AA%E9%85%8D%E7%BD%AE%EF%BC%8C%E8%AF%B7%E8%AE%BF%E9%97%AE%E8%9C%82%E9%B8%9F%E4%BA%91%E6%8E%A7%E5%88%B6%E5%8F%B0%E6%9F%A5%E7%9C%8B%E5%9C%B0%E5%9B%BEID%E3%80%82",warn_keynotright:"%E6%82%A8%E9%85%8D%E7%BD%AE%E7%9A%84key%E5%80%BC%E4%B8%8D%E6%AD%A3%E7%A1%AE%EF%BC%8C%E8%AF%B7%E8%AE%BF%E9%97%AE%E8%9C%82%E9%B8%9F%E4%BA%91%E6%8E%A7%E5%88%B6%E5%8F%B0%E6%A3%80%E6%9F%A5%E6%AD%A4%E5%BA%94%E7%94%A8%E4%B8%8B%E7%9A%84key%E5%80%BC%E3%80%82",warn_offline:"%E6%82%A8%E9%85%8D%E7%BD%AE%E7%9A%84%E5%BA%94%E7%94%A8%E5%90%8D%E7%A7%B0%EF%BC%88appname%EF%BC%89%E6%88%96key%E5%80%BC%E4%B8%8D%E6%AD%A3%E7%A1%AE%EF%BC%8C%E8%AF%B7%E8%AE%BF%E9%97%AE%E8%9C%82%E9%B8%9F%E4%BA%91%E6%8E%A7%E5%88%B6%E5%8F%B0%E6%A3%80%E6%9F%A5%E6%82%A8%E7%9A%84%E5%BA%94%E7%94%A8%E3%80%82",warn_openerror:"%E6%96%87%E4%BB%B6%E8%A7%A3%E6%9E%90%E5%A4%B1%E8%B4%A5",warn_connecterror:"%E6%97%A0%E6%B3%95%E8%BF%9E%E6%8E%A5%E5%88%B0%E8%9C%82%E9%B8%9F%E4%BA%91",warn_downloaderror:"%E4%BB%8E%E8%9C%82%E9%B8%9F%E4%BA%91%E4%B8%8A%E8%8E%B7%E5%BE%97%E5%9C%B0%E5%9B%BE%E6%95%B0%E6%8D%AE%E5%A4%B1%E8%B4%A5",warn_local:"%E6%9C%AC%E5%9C%B0%E9%AA%8C%E8%AF%81%E5%A4%B1%E8%B4%A5"};t.cerityMessage=i;var a={noGroup:"目标楼层未初始化,请检查楼层id是否越界,或者等待楼层加载!",noFocus:"焦点层不在可视楼层中,请检查焦点层和可视楼层的参数设置!"};t.tileMessage=a;var o={defaultViewCenterError:"地图初始化中心位置错误,请检查fengmap.FMMap初始化参数defaultViewCenter的正确性"};t.mapOptionMessage=o},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={MODULE_SHORTEST:1,MODULE_BEST:2},a=i;t.default=a},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={ROUTE_SUCCESS:1,ROUTE_FAILED_NO_FMDBDATA:2,ROUTE_FAILED_TOO_CLOSE:3,ROUTE_FAILED_NO_DATA_START:4,ROUTE_FAILED_NO_DATA_END:5,ROUTE_FAILED_NO_STAIR:6,ROUTE_FAILED_NOTSUPPORT:7,ROUTE_FAILED_CANNOT_CALCULATE:8,ROUTE_FAILED_CANNOT_ARRIVE:9,ROUTE_FAILED_WAYPOINT_CALCULATE_ERROR:10,ROUTE_FAILED_NO_STAIR_ARRIVAL:11,ROUTE_FAILED_NO_END_ARRIVAL:12,ROUTE_FAILED_OUTLINE:13,ROUTE_FAILED_NO_DOOR_START:14,ROUTE_FAILED_NO_DOOR_END:15},a=i;t.default=a},function(e,t,n){"use strict";var r=n(115),i=Object.keys||function(e){var t,n=[];for(t in e)n.push(t);return n};e.exports=c;var a=Object.create(n(96));a.inherits=n(78);var o=n(257),s=n(159);a.inherits(c,o);for(var l=i(s.prototype),u=0;u<l.length;u++){var h=l[u];c.prototype[h]||(c.prototype[h]=s.prototype[h])}function c(e){if(!(this instanceof c))return new c(e);o.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",d)}function d(){this.allowHalfOpen||this._writableState.ended||r.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),c.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,e)}},function(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},function(e,t,n){var a=n(48);e.exports=function(r,i,e){if(a(r),void 0===i)return r;switch(e){case 0:return function(){return r.call(i)};case 1:return function(e){return r.call(i,e)};case 2:return function(e,t){return r.call(i,e,t)};case 3:return function(e,t,n){return r.call(i,e,t,n)}}return function(){return r.apply(i,arguments)}}},function(e){var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(0<e?n:t)(e)}},function(e){e.exports=!0},function(e,t,n){e.exports=n(294)},function(e,t,n){var r=n(71);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var u=r(n(12)),h=r(n(2)),a=r(n(3)),o=function(){function l(e,t,n,r,i){var a=2<arguments.length&&void 0!==n?arguments[2]:1e3,o=3<arguments.length?r:void 0,s=4<arguments.length?i:void 0;(0,h.default)(this,l),this._left=(0,u.default)({},e),this._right=(0,u.default)({},t),this._time=a,this._enable=!1,this._countTime=0,this._endBack=o,this._runBack=s,this.speed=1,this._result=(0,u.default)({},e)}return(0,a.default)(l,[{key:"run",value:function(e){var t,n=e*this.speed,r={};if(this._countTime+n>this._time){for(var i in this._left){var a=(this._right[i]-this._left[i])*(this._time-this._countTime)/this._time;this._result[i]+=a,r[i]=a}return this._enable=!1,this._runBack(this._result,r),this._endBack(this._result,r),this._result={},void(this._countTime=0)}for(t in this._left){var o=(this._right[t]-this._left[t])*n/this._time;this._result[t]+=o,r[t]=o}this._countTime+=n,this._runBack(this._result,r)}},{key:"pause",value:function(){return this._enable=!1,this}},{key:"resume",value:function(){return this._enable=!0,this}},{key:"stop",value:function(){return this._enable=!1,this._countTime=0,this._result=(0,u.default)({},this._left),this}},{key:"start",value:function(){return this._enable=!0,this}},{key:"enable",get:function(){return this._enable},set:function(e){this._enable=e}}]),l}(),s=o;t.default=s},function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){var n;t&&(e.super_=t,n=function(){},n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e)}},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(12)),o=r(n(2)),s=r(n(3)),l=(r(n(152)),r(n(56))),u=function(){function e(){(0,o.default)(this,e),this.Id=0,this.point={},this._type=0,this.liftFloors=[],this.segLinks=[],this.liftFlag=0,this.relatedLiftNodes=[],this.treatHead=!1,this.treatTail=!1,this._dist=0,this._visited=!1,this._vPre=[]}return(0,s.default)(e,[{key:"init",value:function(e){this.Id=e,this.point={x:0,y:0},this._type=0,this.liftFlag=0,this.treatHead=!1,this.treatTail=!1}},{key:"equals",value:function(e){return this.Id==e.Id}},{key:"setNode",value:function(e){this.Id=e.Id,this.point=(0,a.default)({},e.point),this._type=e._type,this.liftFloors=[];for(var t=0;t<e.liftFloors.length;t++)this.liftFloors[t]=e.liftFloors[t];this.segLinks=[];for(var n=0;n<e.segLinks.length;n++)this.segLinks[n]=e.segLinks[n];this.liftFlag=e.liftFlag,this.relatedLiftNodes=[];for(var r=0;r<e.relatedLiftNodes.length;r++)this.relatedLiftNodes[r]=e.relatedLiftNodes[r];this.treatHead=e.treatHead,this.treatTail=e.treatTail}},{key:"getLiftFloorsLength",value:function(){return this.liftFloors.length}},{key:"getSegLinksLength",value:function(){return this.segLinks.length}},{key:"contansFloor",value:function(e){if(this.liftType==l.default.NaviLiftType_Stair)return!0;for(var t=this.liftFloors.length-1;0<=t;t--)if(this.liftFloors[t]==e)return!0;return!1}},{key:"nodeType",set:function(e){-1!=e&&(this._type|=e)},get:function(){return 3&this._type}},{key:"liftType",set:function(e){this._type|=e<<2},get:function(){return this._type>>2&7}},{key:"liftEntry",set:function(e){this._type|=e<<5},get:function(){return this._type>>5&3}},{key:"entranceType",set:function(e){this._type|=e<<7},get:function(){return this._type>>7&3}},{key:"tempType",set:function(e){this._type|=e<<9},get:function(){return _type>>9&3}}]),e}(),h=u;t.default=h},function(e,t,n){var r=n(29),i=n(117),a=n(81),o=n(42),s=n(99),l=n(34),u=n(165),h=Object.getOwnPropertyDescriptor;t.f=r?h:function(e,t){if(e=o(e),t=s(t,!0),u)try{return h(e,t)}catch(e){}if(l(e,t))return a(!i.f.call(e,t),e[t])}},function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e){e.exports={}},function(e,t,n){var r,i=n(35),a=n(175),o=n(123),s=n(83),l=n(178),u=n(118),h=n(100),c=">",d="<",f="prototype",p="script",m=h("IE_PROTO"),v=function(){},g=function(e){return d+p+c+e+d+"/"+p+c},y=function(e){e.write(g("")),e.close();var t=e.parentWindow.Object;return e=null,t},_=function(){var e,t=u("iframe"),n="java"+p+":";return t.style.display="none",l.appendChild(t),t.src=String(n),e=t.contentWindow.document,e.open(),e.write(g("document.F=Object")),e.close(),e.F},x=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(e){}x=r?y(r):_();for(var e=o.length;e--;)delete x[f][o[e]];return x()};s[m]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(v[f]=i(e),n=new v,v[f]=null,n[m]=e):n=x(),void 0===t?n:a(n,t)}},function(e,t,n){var i=n(43);e.exports=function(e,t,n,r){r&&r.enumerable?e[t]=n:i(e,t,n)}},function(e,t,n){"use strict";var i=n(99),a=n(39),o=n(81);e.exports=function(e,t,n){var r=i(t);r in e?a.f(e,r,o(0,n)):e[r]=n}},function(e,t,n){"use strict";var r=n(16);e.exports=function(e,t){var n=[][e];return!!n&&r(function(){n.call(null,t||function(){throw 1},1)})}},function(e,t,n){var r=n(83),i=n(23),a=n(34),o=n(39).f,s=n(101),l=n(184),u=s("meta"),h=0,c=Object.isExtensible||function(){return!0},d=function(e){o(e,u,{value:{objectID:"O"+ ++h,weakData:{}}})},f=function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!a(e,u)){if(!c(e))return"F";if(!t)return"E";d(e)}return e[u].objectID},p=function(e,t){if(!a(e,u)){if(!c(e))return!0;if(!t)return!1;d(e)}return e[u].weakData},m=function(e){return l&&v.REQUIRED&&c(e)&&!a(e,u)&&d(e),e},v=e.exports={REQUIRED:!1,fastKey:f,getWeakData:p,onFreeze:m};r[u]=!0},function(e,t,n){var r=n(16),i=n(25),a=n(129),o=i("species");e.exports=function(n){return 51<=a||!r(function(){var e=[],t=e.constructor={};return t[o]=function(){return{foo:1}},1!==e[n](Boolean).foo})}},function(e,t,n){var f=n(35),p=n(181),m=n(44),v=n(72),g=n(104),y=n(180),_=function(e,t){this.stopped=e,this.result=t},r=e.exports=function(e,t,n,r,i){var a,o,s,l,u,h,c,d=v(t,n,r?2:1);if(i)a=e;else{if(o=g(e),"function"!=typeof o)throw TypeError("Target is not iterable");if(p(o)){for(s=0,l=m(e.length);s<l;s++)if(u=r?d(f(c=e[s])[0],c[1]):d(e[s]),u&&u instanceof _)return u;return new _(!1)}a=o.call(e)}for(h=a.next;!(c=h.call(a)).done;)if(u=y(a,d,c.value,r),"object"==typeof u&&u&&u instanceof _)return u;return new _(!1)};r.stop=function(e){return new _(!0,e)}},function(e){function t(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}e.exports=t},function(e,t,n){e.exports=n(405)},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i="https://console.fengmap.com/api-s/",a=i;t.default=a},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=function(){function e(){(0,a.default)(this,e),this.currentModel=null,this.isToggleViewMode=!1,this.externalLoadingCount=0}return(0,o.default)(e,[{key:"dispose",value:function(e){for(var t in this[e])this[e][t]=void 0}}]),e}(),l=new s,u=l;t.default=u},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={PRIORITY_DEFAULT:1,PRIORITY_LIFTFIRST:2,PRIORITY_ESCALATORFIRST:3,PRIORITY_STAIRFIRST:4,PRIORITY_LIFTONLY:5,PRIORITY_ESCALATORONLY:6,PRIORITY_STAIRONLY:7,PRIORITY_ACCESSIBLEONLY:8,PRIORITY_LIFTFIRST1:9,PRIORITY_ESCALATORFIRST1:10,PRIORITY_STAIRFIRST1:11},a=i;t.default=a},function(e,v,t){(function(e){function t(e){return Array.isArray?Array.isArray(e):"[object Array]"===m(e)}function n(e){return"boolean"==typeof e}function r(e){return null===e}function i(e){return null==e}function a(e){return"number"==typeof e}function o(e){return"string"==typeof e}function s(e){return"symbol"==typeof e}function l(e){return void 0===e}function u(e){return"[object RegExp]"===m(e)}function h(e){return"object"==typeof e&&null!==e}function c(e){return"[object Date]"===m(e)}function d(e){return"[object Error]"===m(e)||e instanceof Error}function f(e){return"function"==typeof e}function p(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function m(e){return Object.prototype.toString.call(e)}v.isArray=t,v.isBoolean=n,v.isNull=r,v.isNullOrUndefined=i,v.isNumber=a,v.isString=o,v.isSymbol=s,v.isUndefined=l,v.isRegExp=u,v.isObject=h,v.isDate=c,v.isError=d,v.isFunction=f,v.isPrimitive=p,v.isBuffer=e.isBuffer}).call(this,t(158).Buffer)},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(32)),o=r(n(15)),s=r(n(9)),l=r(n(60)),u=r(n(2)),h=r(n(3)),c=function(){function e(){(0,u.default)(this,e),this.keys=[],this.data={}}return(0,h.default)(e,[{key:"clear",value:function(){this.keys=[],this.data={}}},{key:"put",value:function(e,t){null==this.data[e]&&(0,l.default)(this).push(e),this.data[e]=t}},{key:"get",value:function(e){return this.data[e]}},{key:"has",value:function(e){for(var t=(0,l.default)(this).length,n=0;n<t;n++){var r=(0,l.default)(this)[n];if(r==e)return!0}return!1}},{key:"remove",value:function(e){var t,n,r=(0,s.default)(t=(0,l.default)(this)).call(t,e);-1!=r&&((0,o.default)(n=(0,l.default)(this)).call(n,r,1),this.data[e]=null)}},{key:"each",value:function(e){if("function"==typeof e)for(var t=(0,l.default)(this).length,n=0;n<t;n++){var r=(0,l.default)(this)[n];e(r,this.data[r],n)}}},{key:"entrys",value:function(){for(var e=(0,l.default)(this).length,t=new Array(e),n=0;n<e;n++)t[n]={key:(0,l.default)(this)[n],value:this.data[n]};return t}},{key:"isEmpty",value:function(){return 0==(0,l.default)(this).length}},{key:"size",value:function(){return(0,l.default)(this).length}},{key:"toString",value:function(){for(var e="{",t=0;t<(0,l.default)(this).length;t++,e+=","){var n=(0,l.default)(this)[t];e+=n+"="+this.data[n]}return e+="}",e}},{key:"sort",value:function(){var e;(0,a.default)(e=(0,l.default)(this)).call(e,function(e,t){return e-t})}}]),e}(),d=c;t.default=d},function(e,t,n){var r=n(16),i=n(71),a="".split;e.exports=r(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==i(e)?a.call(e,""):Object(e)}:Object},function(e,t,n){var i=n(23);e.exports=function(e,t){if(!i(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!i(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!i(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!i(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var r=n(119),i=n(101),a=r("keys");e.exports=function(e){return a[e]||(a[e]=i(e))}},function(e){var t=0,n=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++t+n).toString(36)}},function(e,t,n){var r=n(176),i=n(123);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(73),i=Math.max,a=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):a(n,t)}},function(e,t,n){var r=n(53),i=n(59),a=n(25),o=a("iterator");e.exports=function(e){if(null!=e)return e[o]||e["@@iterator"]||i[r(e)]}},function(e,t,n){"use strict";var r=n(42),i=n(126),a=n(59),o=n(52),s=n(120),l="Array Iterator",u=o.set,h=o.getterFor(l);e.exports=s(Array,"Array",function(e,t){u(this,{type:l,target:r(e),index:0,kind:t})},function(){var e=h(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}},"values"),a.Arguments=a.Array,i("keys"),i("values"),i("entries")},function(e){e.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},function(e,t,n){var i=n(85);e.exports=function(e,t,n){for(var r in t)n&&n.unsafe&&e[r]?e[r]=t[r]:i(e,r,t[r],n);return e}},function(){},function(e){e.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},function(e,t,n){e.exports=n(399)},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(2)),s=r(n(3)),l=r(n(5)),u=r(n(6)),h=r(n(7));function c(r){var i=d();return function(){var e,t=(0,h.default)(r),n=i?(e=(0,h.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,u.default)(this,n)}}function d(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var f=function(e){(0,l.default)(n,e);var t=c(n);function n(e){return(0,o.default)(this,n),t.call(this,e)}return(0,s.default)(n,[{key:"raycast",value:function(o,e){var c=this,d=new fm.Vector3,f=new fm.Vector3,p=new fm.Vector3,s=new fm.Vector2,l=new fm.Vector2,m=new fm.Matrix4,v=new fm.Vector3,g=new fm.Vector3,y=new fm.Vector3,_=new fm.Vector2,x=new fm.Vector2,w=new fm.Vector2,u=new fm.Vector4,b=function(e,t,n,r,i,a){s.subVectors(e,n).addScalar(.5).multiply(r),o.perspective&&!c.material.sizeAttenuation&&(u.applyMatrix4(c.modelViewMatrix),s.multiplyScalar(Math.abs(u.z))),void 0!==i?(l.x=a*s.x-i*s.y,l.y=i*s.x+a*s.y):l.copy(s),e.copy(t),e.x+=l.x,e.y+=l.y,e.applyMatrix4(m)};!function(e,t){f.setFromMatrixScale(c.matrixWorld),m.getInverse(c.modelViewMatrix).premultiply(c.matrixWorld),p.setFromMatrixPosition(c.modelViewMatrix);var n,r,i=c.material.rotation;0!==i&&(r=Math.cos(i),n=Math.sin(i));var a=c.center;b(v.set(-.5,-.5,0),p,a,f,n,r),b(g.set(.5,-.5,0),p,a,f,n,r),b(y.set(.5,.5,0),p,a,f,n,r),_.set(0,0),x.set(1,0),w.set(1,1);var o,s,l,u,h=e.ray.intersectTriangle(v,g,y,!1,d);null===h&&(b(g.set(-.5,.5,0),p,a,f,n,r),x.set(0,1),h=e.ray.intersectTriangle(v,y,g,!1,d),null===h)||(o=v.clone().project(e.camera),s=g.clone().project(e.camera),l=y.clone().project(e.camera),(o.x<-1||1<o.x||o.y<-1||1<o.y)&&(s.x<-1||1<s.x||s.y<-1||1<s.y)&&(l.x<-1||1<l.x||l.y<-1||1<l.y)||(u=e.ray.origin.distanceTo(d),u<e.near||u>e.far||t.push({distance:u,point:d.clone(),uv:fm.Triangle.getUV(d,v,g,y,_,x,w,new fm.Vector2),face:null,object:c})))}(o,e)}}]),n}(fm.Sprite),p=f;t.default=p},function(e,t,n){e.exports=n(498)},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var h=r(n(33)),a=r(n(2)),o=r(n(3)),l=r(n(226)),u=r(n(28)),s=function(){function t(e){(0,a.default)(this,t),this._points=e||null,this._groupId=0,this._lineDis=[],this._linePoints=null,this._screenPoints=[],this._screenDis=[],this._radiusPoint=[],this._radiuInit=!1,this._uvys=null,this._minRadius=1,this.needSmooth=!0}return(0,o.default)(t,[{key:"initSegement",value:function(e,t){"number"!=typeof t&&(t=this._minRadius),this._linePoints=this.pointsToLinePnts(e,t),this._uvys=this.computerUVY()}},{key:"pointsToRadius",value:function(e){for(var t,n,r,i,a=[],o=new l.default,s=0;s<this._points.length;s++)0<s&&s<this._points.length-1?(t=u.default.distanceOfTwoPoints(a[a.length-1],this._points[s]),n=u.default.distanceOfTwoPoints(this._points[s],this._points[s+1]),r=.5*(n<t?n:t),i=e,r<i&&(i=r),a.push.apply(a,(0,h.default)(o.computerArcLineByPoints(a[a.length-1],this._points[s],this._points[s+1],i||1,12)))):a.push(this._points[s]);this._radiusPoint=a,this._radiuInit=!0}},{key:"pointsToLinePnts",value:function(e,t){var n;this.needSmooth?this._radiuInit||this.pointsToRadius(t):(n=[],n.push.apply(n,(0,h.default)(this._points)),this._radiusPoint=n);for(var r=[],i=0;i<this._radiusPoint.length;i++){var a,o,s=this._radiusPoint[i].x-e.x,l=this._radiusPoint[i].z,u=-this._radiusPoint[i].y+e.y;r.push(s,l,u),0!==i&&(a=new fm.Vector3(this._radiusPoint[i].x,this._radiusPoint[i].y,this._radiusPoint[i].z),o=new fm.Vector3(this._radiusPoint[i-1].x,this._radiusPoint[i-1].y,this._radiusPoint[i-1].z),this._lineDis.push(a.distanceTo(o)))}return r}},{key:"getIndexDis",value:function(e){for(var t=0,n=0;n<this._lineDis.length;n++)n<e&&(t+=this._lineDis[n]);return t}},{key:"computerUVY",value:function(){for(var e,t=[],n=this.getIndexDis(this._lineDis.length),r=0;r<this._radiusPoint.length;r++)0===r?t.push(0):r===this._radiusPoint.length-1?t.push(1):(e=this.getIndexDis(r)/n,t.push(e),t.push(e));return t}},{key:"computeScreenCoord",value:function(e,t,n,r){for(var i=[],a=0,o=[],s=e.matrixWorldInverse,l=0;l<this._linePoints.length;l+=3){var u=this._linePoints[l],h=this._linePoints[l+1],c=this._linePoints[l+2],d=new fm.Vector3(u+r.x,h+r.y,c+r.z),f=d.applyMatrix4(s);f.z,e.near;var p,m=f.applyMatrix4(e.projectionMatrix),v=new fm.Vector2(t/2+t/2*m.x,n/2-n/2*m.y);i.push(v),2<l&&(p=v.distanceTo(i[Math.round(l/3)-1]),a+=p,o.push(p))}return this._screenPoints=i,this._screenDis=o,a}},{key:"_calcMinRadius",value:function(){if(this.points){this._minRadius=1;for(var e=0;e<this._points.length-1;e++){var t=this._points[e],n=this._points[e+1],r=.368*u.default.distanceOfTwoPoints(t,n);this._minRadius>r&&(this._minRadius=r)}}}},{key:"points",get:function(){return this._points},set:function(e){this._points=e}},{key:"groupId",get:function(){return this._groupId},set:function(e){this._groupId=e}},{key:"allLength",get:function(){return this.getIndexDis(this._lineDis.length)}},{key:"linePoints",get:function(){return this._linePoints}},{key:"uvys",get:function(){return this._uvys}}]),t}(),c=s;t.default=c},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t._Math=void 0;var i={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var a=[],e=0;e<256;e++)a[e]=(e<16?"0":"")+e.toString(16);return function(){var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0,i=a[255&e]+a[e>>8&255]+a[e>>16&255]+a[e>>24&255]+"-"+a[255&t]+a[t>>8&255]+"-"+a[t>>16&15|64]+a[t>>24&255]+"-"+a[63&n|128]+a[n>>8&255]+"-"+a[n>>16&255]+a[n>>24&255]+a[255&r]+a[r>>8&255]+a[r>>16&255]+a[r>>24&255];return i.toUpperCase()}}(),clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:n<=e?1:(e=(e-t)/(n-t),e*e*(3-2*e))},smootherstep:function(e,t,n){return e<=t?0:n<=e?1:(e=(e-t)/(n-t),e*e*e*(e*(6*e-15)+10))},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*i.DEG2RAD},radToDeg:function(e){return e*i.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}};t._Math=i},function(t,e,n){"use strict";(function(s){function e(e,t,n,r){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,a,o=arguments.length;switch(o){case 0:case 1:return s.nextTick(e);case 2:return s.nextTick(function(){e.call(null,t)});case 3:return s.nextTick(function(){e.call(null,t,n)});case 4:return s.nextTick(function(){e.call(null,t,n,r)});default:for(i=new Array(o-1),a=0;a<i.length;)i[a++]=arguments[a];return s.nextTick(function(){e.apply(null,i)})}}void 0===s||!s.version||0===s.version.indexOf("v0.")||0===s.version.indexOf("v1.")&&0!==s.version.indexOf("v1.8.")?t.exports={nextTick:e}:t.exports=s}).call(this,n(65))},function(e,t,n){e.exports=n(586)},function(e,t){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!n.call({1:2},1);t.f=i?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},function(e,t,n){var r=n(19),i=n(23),a=r.document,o=i(a)&&i(a.createElement);e.exports=function(e){return o?a.createElement(e):{}}},function(e,t,n){var r=n(74),i=n(171);(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.4",mode:r?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t,n){"use strict";var g=n(8),y=n(283),_=n(121),x=n(179),w=n(58),b=n(43),M=n(85),r=n(25),T=n(74),S=n(59),i=n(172),E=i.IteratorPrototype,A=i.BUGGY_SAFARI_ITERATORS,I=r("iterator"),L="keys",R="values",N="entries",k=function(){return this};e.exports=function(e,t,n,r,i,a,o){y(n,t,r);var s,l,u,h=function(e){if(e===i&&m)return m;if(!A&&e in f)return f[e];switch(e){case L:case R:case N:return function(){return new n(this,e)}}return function(){return new n(this)}},c=t+" Iterator",d=!1,f=e.prototype,p=f[I]||f["@@iterator"]||i&&f[i],m=!A&&p||h(i),v="Array"==t&&f.entries||p;if(v&&(s=_(v.call(new e)),E!==Object.prototype&&s.next&&(T||_(s)===E||(x?x(s,E):"function"!=typeof s[I]&&b(s,I,k)),w(s,c,!0,!0),T&&(S[c]=k))),i==R&&p&&p.name!==R&&(d=!0,m=function(){return p.call(this)}),T&&!o||f[I]===m||b(f,I,m),S[t]=m,i)if(l={values:h(R),keys:a?m:h(L),entries:h(N)},o)for(u in l)!A&&!d&&u in f||M(f,u,l[u]);else g({target:t,proto:!0,forced:A||d},l);return l}},function(e,t,n){var r=n(34),i=n(38),a=n(100),o=n(173),s=a("IE_PROTO"),l=Object.prototype;e.exports=o?Object.getPrototypeOf:function(e){return e=i(e),r(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?l:null}},function(e,t,n){var r=n(16);e.exports=!!Object.getOwnPropertySymbols&&!r(function(){return!String(Symbol())})},function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t,n){var r=n(25),i=r("toStringTag"),a={};a[i]="z",e.exports="[object z]"===String(a)},function(e,t,n){var r=n(50);e.exports=r("navigator","userAgent")||""},function(e){e.exports=function(){}},function(e,t,n){e.exports=n(299)},function(e,t,n){var r=n(23),i=n(76),a=n(25),o=a("species");e.exports=function(e,t){var n;return i(e)&&(n=e.constructor,"function"!=typeof n||n!==Array&&!i(n.prototype)?r(n)&&(n=n[o],null===n&&(n=void 0)):n=void 0),new(void 0===n?Array:n)(0===t?0:t)}},function(e,t,n){var r,i,a=n(19),o=n(125),s=a.process,l=s&&s.versions,u=l&&l.v8;u?(r=u.split("."),i=r[0]+r[1]):o&&(r=o.match(/Edge\/(\d+)/),(!r||74<=r[1])&&(r=o.match(/Chrome\/(\d+)/),r&&(i=r[1]))),e.exports=i&&+i},function(e,t,n){var r=n(25);t.f=r},function(e,t,n){var r=n(176),i=n(123),a=i.concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,a)}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var r=n(194);function i(e,t,n){return t in e?r(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}e.exports=i},function(e,t,n){var r=n(82),i=n(109),a="["+i+"]",o=RegExp("^"+a+a+"*"),s=RegExp(a+a+"*$"),l=function(n){return function(e){var t=String(r(e));return 1&n&&(t=t.replace(o,"")),2&n&&(t=t.replace(s,"")),t}};e.exports={start:l(1),end:l(2),trim:l(3)}},function(e,t,n){e.exports=n(357)},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(201)),o=r(n(137)),s={AudioContext:function(){},URL:{}};(0,a.default)(s.constructor.prototype,o.default.prototype);var l=s;t.default=l},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(0)),o=r(n(92)),s=r(n(450)),l=r(n(36)),u=r(n(202)),h=r(n(195)),c=r(n(455)),d=r(n(55)),f=r(n(13)),p=r(n(10)),m=r(n(133)),v=r(n(15)),g=r(n(3)),y=r(n(2)),_=r(n(135));function x(t,e){var n,r=(0,d.default)(t);return c.default&&(n=(0,c.default)(t),e&&(n=(0,h.default)(n).call(n,function(e){return(0,u.default)(t,e).enumerable})),r.push.apply(r,n)),r}function w(t){for(var e=1;e<arguments.length;e++){var n,r,i=null!=arguments[e]?arguments[e]:{};e%2?(0,l.default)(n=x(Object(i),!0)).call(n,function(e){(0,m.default)(t,e,i[e])}):s.default?(0,o.default)(t,(0,s.default)(i)):(0,l.default)(r=x(Object(i))).call(r,function(e){(0,a.default)(t,e,(0,u.default)(i,e))})}return t}var b=new _.default,M=function e(t){(0,y.default)(this,e),this.identifier=t.identifier,this.force=void 0===t.force?1:t.force,this.pageX=t.pageX||t.x,this.pageY=t.pageY||t.y,this.clientX=t.clientX||t.x,this.clientY=t.clientY||t.y,this.screenX=this.pageX,this.screenY=this.pageY},T=function(){function e(){(0,y.default)(this,e),b.set(this,{})}return(0,g.default)(e,[{key:"addEventListener",value:function(e,t,n){var r=2<arguments.length&&void 0!==n?arguments[2]:{},i=b.get(this);i||(i={},b.set(this,i)),i[e]||(i[e]=[]),i[e].push(t),r.capture,r.once,r.passive}},{key:"removeEventListener",value:function(e,t){var n=b.get(this);if(n){var r=n[e];if(r&&0<r.length)for(var i=r.length;i--;)if(r[i]===t){(0,v.default)(r).call(r,i,1);break}}}},{key:"dispatchEvent",value:function(e){var t=0<arguments.length&&void 0!==e?arguments[0]:{};"function"!=typeof t.preventDefault&&(t.preventDefault=function(){}),"function"!=typeof t.stopPropagation&&(t.stopPropagation=function(){});var n=b.get(this)[t.type];if(n)for(var r=0;r<n.length;r++)n[r](t)}},{key:"dispatchTouchEvent",value:function(e){var t,n,r,i=0<arguments.length&&void 0!==e?arguments[0]:{},a=w({},this),o={changedTouches:(0,p.default)(t=i.changedTouches).call(t,function(e){return new M(e)}),touches:(0,p.default)(n=i.touches).call(n,function(e){return new M(e)}),targetTouches:(0,f.default)(Array.prototype).call((0,p.default)(r=i.touches).call(r,function(e){return new M(e)})),timeStamp:i.timeStamp,target:a,currentTarget:a,type:i.type,cancelBubble:!1,cancelable:!1};this.dispatchEvent(o)}}]),e}();t.default=T},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var m,l=r(n(20)),u=r(n(21)),h=r(n(22)),a=r(n(18)),o=r(n(4)),s=r(n(33)),c=r(n(62)),d=r(n(54)),f=r(n(31)),p=r(n(139)),v=r(n(75)),g=r(n(30)),S=r(n(9)),y=r(n(14)),_=r(n(15)),x=r(n(27)),w=r(n(13)),b=r(n(49)),M=r(n(2)),T=r(n(3)),E=r(n(91)),A=r(n(5)),I=r(n(6)),L=r(n(7)),R=r(n(63)),N=r(n(140)),k=r(n(141)),P=r(n(473)),C=r(n(45)),D=r(n(46)),O=r(n(528)),F=r(n(77)),B=r(n(94)),U=r(n(41)),z=r(n(241)),G=r(n(147)),V=r(n(37)),H=r(n(242)),j=r(n(28)),W=r(n(530)),Y=n(67),q=r(n(93)),X=r(n(143)),Z=r(n(531)),J=r(n(243)),K=n(67),Q=r(n(244)),$=n(245),ee=r(n(534)),te=r(n(535));function ne(e,t){var n;if(void 0===h.default||null==(0,u.default)(e)){if((0,y.default)(e)||(n=re(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=(0,l.default)(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function re(e,t){var n;if(e){if("string"==typeof e)return ie(e,t);var r=(0,w.default)(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?(0,a.default)(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ie(e,t):void 0}}function ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ae(r){var i=oe();return function(){var e,t=(0,L.default)(r),n=i?(e=(0,L.default)(this).constructor,(0,o.default)(t,arguments,e)):t.apply(this,arguments);return(0,I.default)(this,n)}}function oe(){if("undefined"==typeof Reflect||!o.default)return!1;if(o.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,o.default)(Date,[],function(){})),!0}catch(e){return!1}}function se(o){var e=this.MapOptions.mapThemeURL+"/"+this.MapOptions.defaultThemeName+"/"+this.MapOptions.defaultThemeName+".theme",s=this;this.fmServer.getTheme(e,function(e){s.initTheme(s.MapOptions.defaultThemeName,e,function(n){var e,t,r=null,i=s.MapOptions.mapServerURL,a="GET";"fengmap"===s.MapOptions.mapServerURL&&(i=q.default+"sdk/auth/downMaps",s.MapOptions.tile&&(i=q.default+"sdk/authLayered/downMaps"),e=X.default.getCerityData(s.MapOptions.key,s.MapOptions.appName,o),t={newFlag:"2",mapId:e.mapId,keyValue:e.appKey,appName:e.appName,webUrl:e.webURL,keyType:3,isSeparate:s.MapOptions.tile},r=(0,R.default)(t),a="POST"),s.fmServer.getScene(i,o,s.MapOptions.tile,r,a,function(e,t){s.dataExcute(n,e,t,r)},function(e){m&&m(e)}),s._currentSceneId=o})})}var le=function(e){(0,A.default)(h,e);var r=ae(h);function h(e){var t,n;return(0,M.default)(this,h),n=r.call(this),n.uuid=fm.Math.generateUUID(),B.default[n.uuid]={},n.wxInfo=new te.default,void 0!==e.resolutionScale&&(n.wxInfo.pixelRatio=Math.min(n.wxInfo.pixelRatio,e.resolutionScale)),n.MapOptions=new P.default(e,n.wxInfo),n.fmServer=new k.default,n.dataManager=new C.default,n.nodeManager=new D.default(n.MapOptions,(0,E.default)(n)),n.isMarkerTip=!1,e.isMarkerTip&&(n.isMarkerTip=!0),n.isMarkerMove=!1,e.isMarkerMove&&(n.isMarkerMove=!0),n.render=null,n.getRenderOption(),e.lightEffects?B.default.light=!0:B.default.light=!1,n.renderer=new Q.default(n.MapOptions,(0,E.default)(n)),n.controls=new fm.OrbitControls("3d"===n.MapOptions.defaultViewMode?n.renderer.perspectiveCamera:n.renderer.orthographicCamera,n.renderer.canvas,(0,E.default)(n)),n.controls.panSpeed*=n.wxInfo.pixelRatio,n.mapScaleLevels=[295829355.45,147914677.73,73957338.86,36978669.43,18489334.72,9244667.36,4622333.68,2311166.84,1155583.42,577791.71,288895.85,144447.93,72223.96,36111.98,18056,9028,4514,2257,1128,564,282,141,70,35,17,8,4,2,1],n._mapScaleLevel=20,n._mapScale=564,n._minScale=1,n._maxScale=295829355.45,n._minScaleLevel=1,n._maxScaleLevel=29,n._animaters=[],n._windowPops=[],n._currentSceneId="10347",n._currentFocusGroup=n.MapOptions.defaultFocusGroup,n._visibleGroups=n.MapOptions.defaultVisibleGroups,n._viewMode=n.MapOptions.defaultViewMode,n.renderer.viewMode=n.MapOptions.defaultViewMode,n._currentTime=(new Date).getTime(),n._showAllGroup=!1,n._lineMarkers=[],n._lastMoveEvent=null,n._mouseHoverTime=0,n._mouseHoverStart=!0,n._compassBG=n.MapOptions.compassBg,n._compassFG=n.MapOptions.compassFg,n.getMapScaleInfo(),n.scaleLevelInit(),n.controlEventInit(),n._loopHander=(0,$.doAnimationFrame)((0,b.default)(t=n.update).call(t,(0,E.default)(n))),n.allowRender=!0,n.pickFilterFunction=null,n.animationMixers=[],n.hoverFilterFunction=null,n._eventId=0,n._modelSelectColor={r:.97,g:.388,b:.196,a:1},n._fullScreen=!1,n._enterControl=new Z.default,n._enterControl.enableMapHover=n.MapOptions.modelHoverEffect,n._allowfps=60,n._renderTime=0,n.controls.setEnterCtrl(n._enterControl),n.otherFocus=[],n.tileLoading=!1,n.letUpdate=!1,n.selectedObjects=[],n.isFpsDisplay=void 0!==e.isFpsDisplay&&e.isFpsDisplay,n.stats=null,n.isFpsDisplay&&(n.stats=new W.default,n.stats.showPanel(0),document.body.appendChild(n.stats.dom)),n.videoMemory=new ee.default((0,E.default)(n)),n.getStation(),n}return(0,T.default)(h,[{key:"getRenderOption",value:function(){try{this.MapOptions.logarithmicDepthBuffer?this.render=new fm.WebGLRenderer({antialias:!0,alpha:!0,logarithmicDepthBuffer:!0,canvas:this.MapOptions.canvas,tempCanvas:this.MapOptions.tempCanvas}):this.render=new fm.WebGLRenderer({antialias:!0,alpha:!0,canvas:this.MapOptions.canvas,tempCanvas:this.MapOptions.tempCanvas})}catch(e){return console.error("WebGLRenderer ERROR: ",e),(new fengmap.MapError).noWebGL(this.renderOption.canvas),!1}this.canvas=this.render.domElement;var e=this.MapOptions.canvas.width,t=this.MapOptions.canvas.height;return this.perspectiveCamera=new fm.PerspectiveCamera(35,e/t,2,1e5),this.orthographicCamera=new fm.OrthographicCamera(-e/2,e/2,t/2,-t/2,1,1e5),!0}},{key:"isOnLine",value:function(e,t){var n,r=new Image;r.onload=function(){e&&e()},r.onerror=function(){t&&t()},r.style.display="none",r.src="http://www.baidu.com/img/baidu_sylogo1.gif?"+(0,w.default)(n=""+Math.random()).call(n,-6)}},{key:"openMapById",value:function(t,n){var e,r;function i(){"fengmap"===r.MapOptions.mapServerURL?X.default.checkIsOnLine(function(){X.default.checkOnLine(r.MapOptions.key,r.MapOptions.appName,t,function(){se.call(r,t,!0)},function(e){e?(console.warn(e.error_code,e.error_message),n&&n({msg:"线上验证失败!",data:e})):(console.warn("offLine 2"),se.call(r,t))},"POST")},function(){console.warn("offLine 1"),se.call(r,t)},1e3):se.call(r,t)}function a(){se.call(r,t)}m=n,t?this.MapOptions.key?(e=/^[a-zA-z\d]{32}$/,e.test(this.MapOptions.key)?this.MapOptions.appName?(this._zopStep_=1,r=this,this.MapOptions.useCompatibleOnLineCheck?this.isOnLine(i,a):i()):console.warn(decodeURIComponent(Y.cerityMessage.warn_noappname)):console.warn(decodeURIComponent(Y.cerityMessage.warn_keynotright))):console.warn(decodeURIComponent(Y.cerityMessage.warn_nokey)):console.warn(decodeURIComponent(Y.cerityMessage.warn_nomapid))}},{key:"search",value:function(e,t,n){return J.default.search(this,e,t,n)}},{key:"changeFocusToGroup",value:function(n){var r=this,e=this.nodeManager.getSceneCenter(this._currentSceneId),t=this.controls.target.y;this.currentFocusGroup=n.gid;var i=this.nodeManager.getHeight(this._currentSceneId,this.currentFocusGroup)+e.y;if(!this.MapOptions.focusAnimateMode)return this.controls.panUp(i-t),this.controls.update(),n.callback&&n.callback(),void this.setRenderList();B.default[this.uuid].currentGroupChangeAnimater&&(B.default[this.uuid].currentGroupChangeAnimater.stop(),this.removeAnimater(B.default[this.uuid].currentGroupChangeAnimater));var a=new F.default({h:t},{h:i},n.duration?1e3*n.duration:800,function(){r.removeAnimater(a),B.default[r.uuid].currentGroupChangeAnimater=null,n.callback&&n.callback()},function(e,t){r.controls.panUp(t.h),n.update&&n.update()}).start();B.default[this.uuid].currentGroupChangeAnimater=a,this._animaters.push(a)}},{key:"dataExcute",value:function(e,t,n,r){var i=this;if(this&&this.MapOptions){var a=new fm.Color(e.selectedColor);this._modelSelectColor.r=a.r,this._modelSelectColor.g=a.g,this._modelSelectColor.b=a.b,0===this.MapOptions.defaultBackgroundColor?this.MapOptions.defaultBackgroundColor=0:this.MapOptions.defaultBackgroundColor||(this.MapOptions.defaultBackgroundColor=U.default.toColor(e.data.viewtheme.clearcolor)),this.MapOptions.defaultBackgroundAlpha=(0,x.default)(e.data.viewtheme.clearalpha),this.renderer.setClearColor(this.MapOptions.defaultBackgroundColor,this.MapOptions.defaultBackgroundAlpha),this.dataManager.putRawScene(t,n);var o=this.dataManager.parseScene(n,this.MapOptions.tile,this.MapOptions.license);if(o){var s=!o.scene.key||X.default.checkOffLine(this.MapOptions.key,this.MapOptions.appName,"",o.scene.key);if(!s)return console.warn(decodeURIComponent(Y.cerityMessage.warn_offline)),void(m&&m({message:decodeURIComponent(Y.cerityMessage.warn_local)}));this.dataManager.putDecodeScene(o,n),this.nodeManager.conformatScene(o,n,e),this.groupSpace=this.MapOptions.defaultGroupSpace,this.initCameraPosition();var l=this.renderer.getFrustumByViewMode(this._viewMode),u=this.getVisibleGroups();if(this.MapOptions.tile){var h=this.nodeManager.getSceneById(this._currentSceneId);h.sdata=r;var c=h.getNeedLoadGroup(u),d=function(){var t=function(){var t=h.getNeedLoadGroup(u,!0);t.length<1?i.dispatchEvent({type:"loadComplete"}):i.loadAndExcuteData(t,h,0,!1,function(e){i.tileLoading=!1,e===t.length-1&&i.dispatchEvent({type:"loadComplete"})})};if(c.length<1)return i.dispatchEvent({type:"visibleGroupLoaded"}),void t();i.loadAndExcuteData(c,h,0,!1,function(e){i.nodeManager.checkNodeByFrustum(i.dataManager.getDecodeScene(i._currentSceneId),i.renderer.getFrustumByViewMode(i._viewMode),i.getVisibleGroups(),i.mapScaleLevel,n),i.setRenderList(),i.avoidMarkers(),e===c.length-1&&(i.dispatchEvent({type:"visibleGroupLoaded"}),t())})};this.tileLoading=!0;for(var f=-1,p=0;p<c.length;p++)if(c[p].gid&&c[p].gid==this._currentFocusGroup){f=p;break}if(f<0)return void console.error(K.tileMessage.noFocus);this.loadAndExcuteData(c,h,f,!0,function(){i.nodeManager.checkNodeByFrustum(i.dataManager.getDecodeScene(i._currentSceneId),i.renderer.getFrustumByViewMode(i._viewMode),i.getVisibleGroups(),i.mapScaleLevel,n),i.setRenderList(),i.avoidMarkers(),(0,_.default)(c).call(c,f,1),d()})}else this.nodeManager.checkNodeByFrustum(o,l,u,this.mapScaleLevel,n),this.setRenderList(),this.avoidMarkers(),this.dispatchEvent({type:"visibleGroupLoaded"}),this.dispatchEvent({type:"loadComplete"}),this.renderer.setClearColor(this.MapOptions.defaultBackgroundColor,this.MapOptions.defaultBackgroundAlpha);this.letUpdate=!0}}}},{key:"loadAndExcuteData",value:function(o,s,l,u,h){var c=this,d=o[l];this.fmServer.getFloor(this.MapOptions.mapServerURL,d.url,this._currentSceneId,d.gid,function(e,t,n,r){var i=c.dataManager.parseFloor(e,t,n),a={geo:[i[0]],biz:[i[1]],navi:[i[2]],gid:r};c.dataManager.getDecodeScene(c._currentSceneId).floors.push(a),d.layerData.loaded=!0,s.addGroup(r,a,d.layerData),h&&h(l),u||(l++,l<o.length&&c.loadAndExcuteData(o,s,l,!1,h))},s.sdata)}},{key:"moveLinesUv",value:function(e){var t,n=ne(this._lineMarkers);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.moveUv(e)}}catch(e){n.e(e)}finally{n.f()}}},{key:"resetLineRepeat",value:function(){var e,t=ne(this._lineMarkers);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.resetRepeat(this)}}catch(e){t.e(e)}finally{t.f()}}},{key:"hideOrShowLine",value:function(){var e,t=this.groupIDs[this.groupIDs.length-1],n=ne(this._lineMarkers);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.hideOrShowBy(this._visibleGroups,t)}}catch(e){n.e(e)}finally{n.f()}}},{key:"getVisibleGroups",value:function(){return this._visibleGroups}},{key:"setVisibleGroups",value:function(e){this._visibleGroups=e,this.checkNode(),this.setRenderList(),this.dispatchEvent({type:"visibleGroupIDsChanged",gids:e})}},{key:"initCameraPosition",value:function(){var e,t,n,r,i,a,o=this.getCameraDistanceByScale(this.mapScale),s=this.MapOptions.defaultViewCenter;try{s?(e=this.nodeManager.getSceneById(this._currentSceneId).mapcenter,s.x-=e.x,s.y-=e.y):s=this.nodeManager.getSceneById(this._currentSceneId).center;var l=this.nodeManager.getHeight(this._currentSceneId,this._currentFocusGroup);s.z=0,s.y+=l,this.controls.target=(new fm.Vector3).copy(s)}catch(e){console.error(K.mapOptionMessage.defaultViewCenterError)}"3d"===this._viewMode?(this.controls.minPolarAngle=(90-this.MapOptions.defaultMaxTiltAngle)*fm.Math.DEG2RAD,this.controls.maxPolarAngle=(90-this.MapOptions.defaultMinTiltAngle)*fm.Math.DEG2RAD,t=(90-this.MapOptions.defaultTiltAngle)*fm.Math.DEG2RAD,n=o*Math.cos(t),r=o*Math.sin(t),i=new fm.Vector3(0,n,r),this.controls.object.position.set(s.x+i.x,s.y+i.y,s.z+i.z),this.controls.object.lookAt(s),this.renderer.orthographicCamera.position.set(s.x+i.x,s.y+i.y,s.z+i.z),this.renderer.orthographicCamera.lookAt(s)):(a=this.getCameraScaleByScale(this.mapScale),this.controls.minPolarAngle=0,this.controls.maxPolarAngle=0,this.controls.object.position.set(s.x,s.y+o,s.z),this.controls.object.zoom=1/a,this.controls.object.lookAt(s),this.renderer.orthographicCamera.updateProjectionMatrix());var u=this.MapOptions.computePoseToAngle();this.controls.rotateLeft(u*fm.Math.DEG2RAD),this._changePanrange(o,s),this.controls.update()}},{key:"_changePanrange",value:function(){var e,t;this.MapOptions.enabledPanRange&&(e=.5,t=this.nodeManager.getSceneById(this._currentSceneId).bboxTh,this.controls.viewBox=new fm.Box3(new fm.Vector3(t.min.x,0,t.min.y),new fm.Vector3(t.max.x,this.getGroupHeight(this.groupIDs[this.groupIDs.length-1])+this.groupSpace,t.max.y)),this.controls.viewBox.min.multiplyScalar(e),this.controls.viewBox.max.multiplyScalar(e),this.controls.useRange=!0)}},{key:"scaleLevelInit",value:function(){var e;this.MapOptions.mapScaleLevelRange&&this.setMapScaleLevelRange(this.MapOptions.mapScaleLevelRange),this.MapOptions.mapScaleRange&&this.setMapScaleRange(this.MapOptions.mapScaleRange),this.MapOptions.defaultMapScaleLevel&&(e=this.MapOptions.defaultMapScaleLevel,this._mapScaleLevel=e,this._mapScale=this.levelToScale(e)),this.MapOptions.defaultMapScale&&(this.mapScale=this.MapOptions.defaultMapScale)}},{key:"setMapScaleRange",value:function(e,t){(0,y.default)(e)?(this.minScale=e[0],this.maxScale=e[1]):(this.minScale=e,this.maxScale=t)}},{key:"setMapScaleLevelRange",value:function(e,t){(0,y.default)(e)?(this.minScaleLevel=e[0],this.maxScaleLevel=e[1]):(this.minScaleLevel=e,this.maxScaleLevel=t)}},{key:"showSingerOrMultiGroup",value:function(e){var t;this._showAllGroup=e,this.visibleGroupIDs=e?(0,w.default)(t=this.getCurrGroupIds()).call(t,0):[this._currentFocusGroup]}},{key:"removeAnimater",value:function(e){var t,n,r=(0,S.default)(t=this._animaters).call(t,e);-1<r&&(0,_.default)(n=this._animaters).call(n,r,1)}},{key:"dollyOut",value:function(){var n=this,r=1,e=new F.default({scale:1},{scale:2},500,function(){n.removeAnimater(e)},function(e){var t=e.scale/r;r=e.scale,n.controls.dollyOut(t)}).start();this._animaters.push(e)}},{key:"dollyIn",value:function(){var n=this,r=1,e=new F.default({scale:1},{scale:2},500,function(){n.removeAnimater(e)},function(e){var t=e.scale/r;r=e.scale,n.controls.dollyIn(t)}).start();this._animaters.push(e)}},{key:"zoomIn",value:function(){this.dollyIn()}},{key:"zoomOut",value:function(){this.dollyOut()}},{key:"checkNode",value:function(){var e,t,n,r,i;this.renderer&&(e=this.renderer.getFrustumByViewMode(this._viewMode),t=this._currentSceneId,n=this.dataManager.getDecodeScene(t),r="top"===this._viewMode?this.getScaleByCameraScale():this.getScaleByCameraDistance(),i=this.scaleTolevel(r),this.nodeManager.checkNodeByFrustum(n,e,this.getVisibleGroups(),i,t))}},{key:"getCurrDecodeData",value:function(){var e=this._currentSceneId,t=this.dataManager.getDecodeScene(e);return t}},{key:"setBackgroundColor",value:function(e,t){var n=this;"string"==typeof e&&(e=(0,g.default)(e.replace("#","0x"))),(0,v.default)(function(){n.renderer.setClearColor(e,t)},500)}},{key:"setBackground",value:function(e){this.renderer.setClearColor(0,0),this.renderer.setBackground(e)}},{key:"addAnimationMixer",value:function(e){this.animationMixers.push(e)}},{key:"setRenderList",value:function(){var e;this.nodeManager&&(e=this.nodeManager.getRenderList(),this.renderer.renderList=e,this.renderer.resetSpriteSize())}},{key:"rushRenderNode",value:function(){this.setRenderList(),this.renderer.resetSpriteSize()}},{key:"controlEventInit",value:function(){var i=this;this.controls.addEventListener("change",function(){var e;i.checkNode(),i.setRenderList(),i.avoidMarkers(),i.renderer.compassNode&&(i.renderer.compassNode.material.uniforms.rotation.value=-i.controls.getAzimuthalAngle()),e="top"===i._viewMode?i.getScaleByCameraScale():i.getScaleByCameraDistance(),i.dispatchEvent({type:"mapViewChanged"}),.5<Math.abs(e-i._mapScale)&&i.dispatchEvent({type:"scaleLevelChanged",scale:e}),i._mapScale=e;var t=i.scaleTolevel(e);t!==i._mapScaleLevel&&(i._mapScaleLevel=t,i.dispatchEvent({type:"mapScaleLevelChanged",mapScale:t})),i._mapScaleLevel=t,i.renderer.resetSpriteSize(),i.moveLinesUv(.01),i.resetLineRepeat(),i.renderer.resetLocationsSize()});var n=0,r=0,a=null;this.isMarkerMove&&this.MapOptions.canvas.addEventListener("mousedown",function(e){var t={x:2*e.offsetX/i.MapOptions.canvas.width-1,y:1-2*e.offsetY/i.MapOptions.canvas.height};n=(new Date).getTime(),a=(0,p.default)(function(){var e;r=(new Date).getTime(),1e3<r-n&&(e=i.nodeManager.getFacility(i._currentSceneId,i.getVisibleGroups(),t,i.renderer.getCameraByViewMode(i._viewMode)),0<e.length&&i.dispatchEvent({type:"press",target:e[0].object.mapNode}),clearInterval(a))},250)}),this.controls.addEventListener("mouseup",function(e){var t=e.mousePoint,n={x:2*t.x/t.w-1,y:1-2*t.y/t.h};i._eventId++;var r=i.dispatchClickEvent(n,e.event);e.mouseButton===fm.MOUSE.LEFT&&r&&null!=r.target&&(4!=r.target._nodeType?i.modelFire(n):i.selectNull()),i.checkCompassClick(n),null!==a&&(clearInterval(a),a=null),i.dispatchEvent({type:"pressover"})}),this.controls.addEventListener("mousemove",function(e){(i.isMarkerTip||i.isMarkerMove)&&i.mouseIntoInfo(e),i._lastMoveEvent=e,i._mouseHoverTime=0,i._mouseHoverStart=!0,null!==a&&(clearInterval(a),a=null)})}},{key:"mouseIntoInfo",value:function(e){var t,n=e.mousePoint,r={x:2*n.x/n.w-1,y:1-2*n.y/n.h};this.isMarkerTip||(t=this.nodeManager.getFacility(this._currentSceneId,this.getVisibleGroups(),r,this.renderer.getCameraByViewMode(this._viewMode)),0!==t.length?this.dispatchEvent({type:"hover",target:t[0].object.mapNode}):this.dispatchEvent({type:"mouseleave"}))}},{key:"checkCompassClick",value:function(e){var t;this.renderer.compassNode&&this.showCompass&&(t=this.renderer.compassNode.userData,j.default.pointIsInRect(e,t.coord,t.width,t.width)&&this.dispatchEvent({type:"mapClickCompass",target:this.renderer.compassNode}))}},{key:"dispatchClickEvent",value:function(e,t){if(this._enterControl.enableMapSingleTap){var n,r,i=this.nodeManager.getNode(this._currentSceneId,this.getVisibleGroups(),e,this.renderer.getCameraByViewMode(this._viewMode)),a=this.nodeManager.getFacility(this._currentSceneId,this.getVisibleGroups(),e,this.renderer.getCameraByViewMode(this._viewMode)),o=this.nodeManager.getExternalModels(this._currentSceneId,this.getVisibleGroups(),e,this.renderer.getCameraByViewMode(this._viewMode)),s={type:"mapClickNode",target:null,mouse:t.mouse,domEvent:t,eventInfo:{domEvent:t,coord:null,eventID:this._eventId},nodeType:null};if(i.length<1&&a.length<1&&o.length<1)return this.dispatchEvent(s),c={target:!0},c;if(1<=a.length&&(n=0,this.pickFilterFunction&&(r=this.pickFilterFunction({nodeType:a[0].object.mapNode.nodeType,typeID:a[0].object.mapNode.bdata&&a[0].object.mapNode.bdata.type,data:a[0].object.mapNode.bdata}),r||(n=1)),c={type:"mapClickNode",target:a[0].object.mapNode,mouse:t.mouse,domEvent:t,eventInfo:{domEvent:t,coord:{x:a[0].object.mapNode.x,y:a[0].object.mapNode.y},eventID:this._eventId},mapCoord:{x:a[0].object.mapNode.x,y:a[0].object.mapNode.y},nodeType:a[0].object.mapNode.nodeType},1==n?this.dispatchEvent(s):this.dispatchEvent(c)),1<=i.length){var l,u=0;this.pickFilterFunction&&(l=this.pickFilterFunction({nodeType:i[0].object.mapNode.nodeType,typeID:i[0].object.mapNode.bdata&&i[0].object.mapNode.bdata.type,data:i[0].object.mapNode.bdata}),l||(u=1));var h=(new fm.Vector3).copy(i[0].point),c={type:"mapClickNode",target:i[0].object.mapNode,mouse:t.mouse,domEvent:t,eventInfo:{domEvent:t,threeCoord:h,coord:{x:h.x+this.center.x,y:this.center.y-h.z},eventID:this._eventId},mapCoord:{x:h.x+this.center.x,y:this.center.y-h.z},nodeType:i[0].object.mapNode.nodeType};return 1===u?(this.dispatchEvent(s),s):(this.dispatchEvent(c),c)}if(1<=o.length){var d=(new fm.Vector3).copy(o[0].point),c={type:"mapClickNode",target:o[0].object,mouse:t.mouse,domEvent:t,eventInfo:{domEvent:t,threeCoord:d,coord:{x:d.x+this.center.x,y:this.center.y-d.z},eventID:this._eventId},mapCoord:{x:d.x+this.center.x,y:this.center.y-d.z},nodeType:35};return this.dispatchEvent(c),c}}}},{key:"getDatasByAlias",value:function(e,t,n){n=n||function(){return!0};var r=this.nodeManager.getSceneById(this._currentSceneId);return r.getGroupsNodelsByFilter([e],t,n)}},{key:"mouseHoverEventFire",value:function(e){if(this._mouseHoverStart)if(this._mouseHoverTime>this.MapOptions.modelHoverTime){if(!this._enterControl.enableMapHover)return;if(!this._lastMoveEvent)return;var t,n,r,i,a,o,s=this._lastMoveEvent,l=s.mousePoint,u={x:2*l.x/l.w-1,y:1-2*l.y/l.h},h=this.nodeManager.getNode(this._currentSceneId,this.getVisibleGroups(),u,this.renderer.getCameraByViewMode(this._viewMode)),c=this.nodeManager.getFacility(this._currentSceneId,this.getVisibleGroups(),u,this.renderer.getCameraByViewMode(this._viewMode));if(h.length<1&&c.length<1)return;h[0]&&(t=(new fm.Vector3).copy(h[0].point),n={type:"mapHoverNode",target:h[0].object.mapNode,mouse:l,eventInfo:{domEvent:s.event,threeCoord:h[0].point,eventID:s.eventID,coord:{x:t.x+this.center.x,y:h[0].object.mapNode.y-t.z}},groupID:h[0].object.mapNode.groupID,nodeType:h[0].object.mapNode.nodeType},this.hoverFilterFunction?(r=this.hoverFilterFunction({nodeType:h[0].object.mapNode.nodeType,typeID:h[0].object.mapNode.bdata&&h[0].object.mapNode.bdata.type,data:h[0].object.mapNode.bdata}),r&&(h[0].object.mapNode.nodeType===V.default.MODEL&&this.MapOptions.modelHoverEffect&&this.storeSelect(h[0].object),this.dispatchEvent(n))):(h[0].object.mapNode.nodeType===V.default.MODEL&&this.MapOptions.modelHoverEffect&&this.storeSelect(h[0].object),this.dispatchEvent(n))),c[0]&&(i=(new fm.Vector3).copy(c[0].point),a={type:"mapHoverNode",target:c[0].object.mapNode,mouse:l,eventInfo:{domEvent:s.event,threeCoord:c[0].point,eventID:s.eventID,coord:{x:i.x+this.center.x,y:c[0].object.mapNode.y-i.z}},groupID:c[0].object.mapNode.groupID,nodeType:c[0].object.mapNode.nodeType},this.hoverFilterFunction?(o=this.hoverFilterFunction({nodeType:c[0].object.mapNode.nodeType,typeID:c[0].object.mapNode.bdata&&c[0].object.mapNode.bdata.type,data:c[0].object.mapNode.bdata}),o&&this.dispatchEvent(a)):this.dispatchEvent(a)),this._mouseHoverStart=!1,this._mouseHoverTime=0}else this._mouseHoverTime+=e}},{key:"selectNull",value:function(){if(B.default[this.uuid].currentModel){B.default[this.uuid].currentAnimater&&(B.default[this.uuid].currentAnimater.stop(),B.default[this.uuid].currentAnimater=void 0);var e=B.default[this.uuid].currentModel;if(void 0===B.default[this.uuid].currentModel.material.length)e.material.color=B.default[this.uuid].currentModel.material.userData.color,e.material.opacity=B.default[this.uuid].currentModel.material.userData.opacity,e.material.userData.opacity=void 0,e.material.userData.color=void 0,e.material.update=!0,B.default[this.uuid].currentModel=void 0;else{for(var t=0;t<B.default[this.uuid].currentModel.material.length;t++)e.material[t].color=B.default[this.uuid].currentModel.material[t].userData.color,e.material[t].opacity=B.default[this.uuid].currentModel.material[t].userData.opacity,e.material[t].userData.opacity=void 0,e.material[t].userData.color=void 0,e.material[t].update=!0;B.default[this.uuid].currentModel=void 0}}}},{key:"callAllLayersByAlias",value:function(e,t){this.nodeManager.getSceneById(this._currentSceneId).getAllGroupLayerByAlias(e,t)}},{key:"storeSelect",value:function(e){var n,t,r=this,i=e;if(e.nodeType&&e.nodeType===V.default.MODEL){if(!e.renderNodeInited)return;i=e.renderNode}if(B.default[this.uuid].currentModel&&B.default[this.uuid].currentModel!==i)if(B.default[this.uuid].currentAnimater&&(B.default[this.uuid].currentAnimater.stop(),B.default[this.uuid].currentAnimater=void 0),void 0===B.default[this.uuid].currentModel.material.length)B.default[this.uuid].currentModel.material.color=B.default[this.uuid].currentModel.material.userData.color,B.default[this.uuid].currentModel.material.opacity=B.default[this.uuid].currentModel.material.userData.opacity,B.default[this.uuid].currentModel.material.update=!0;else for(var a=0;a<B.default[this.uuid].currentModel.material.length;a++)B.default[this.uuid].currentModel.material[a].color=B.default[this.uuid].currentModel.material[a].userData.color,B.default[this.uuid].currentModel.material[a].opacity=B.default[this.uuid].currentModel.material[a].userData.opacity,B.default[this.uuid].currentModel.material[a].update=!0;if(B.default[this.uuid].currentModel=i,void 0===i.material.length)i.material.userData.color||(i.material.userData.color=i.material.color,i.material.userData.opacity=i.material.opacity);else for(var o=0;o<i.material.length;o++)i.material[o].userData.color||(i.material[o].userData.color=i.material[o].color,i.material[o].userData.opacity=i.material[o].opacity);B.default[this.uuid].currentAnimater||(n=this._modelSelectColor.a,0===n&&(n=1),t=new F.default({r:this._modelSelectColor.r/2,g:this._modelSelectColor.g/2,b:this._modelSelectColor.b/2,a:n/2},this._modelSelectColor,500,function(){r.removeAnimater(t),B.default[r.uuid].currentAnimater=null},function(e){if(void 0===i.material.length)i.material.userData.color&&(i.material.color=new fm.Color(e.r,e.g,e.b),i.material.opacity=n,i.material.update=!0);else for(var t=0;t<i.material.length;t++)i.material[t].userData.color&&(i.material[t].color=new fm.Color(e.r,e.g,e.b),i.material[t].opacity=n,i.material[t].update=!0)}),B.default[this.uuid].currentAnimater=t,t.start(),this._animaters.push(t))}},{key:"modelFire",value:function(e){var t=[],n=[];if(this.MapOptions.lightEffects){t=this.nodeManager.getExternalModels(this._currentSceneId,this.getVisibleGroups(),e,this.renderer.getCameraByViewMode(this._viewMode)),n=this.nodeManager.getModel(this._currentSceneId,this.getVisibleGroups(),e,this.renderer.getCameraByViewMode(this._viewMode));var r=(0,f.default)(t).call(t,n);if(r.length<1)return void this.selectNull();if(!this.MapOptions.modelSelectedEffect)return;this.storeSelect(r[0].object)}else{if(t=this.nodeManager.getModelExternal(this._currentSceneId,this.getVisibleGroups(),e,this.renderer.getCameraByViewMode(this._viewMode)),t.length<1)return void this.selectNull();if(!this.MapOptions.modelSelectedEffect)return;this.storeSelect(t[0].object)}}},{key:"setModelSelectColor",value:function(e,t){var n=new fm.Color;n.set(e),this._modelSelectColor={r:n.r,g:n.g,b:n.b,a:t}}},{key:"checkMarkerAvoid",value:function(e){if(!(e.length<1)){for(var t=e[0],n=[],r=1;r<e.length;r++)j.default.isRectCross(t.leftTop,t.rightDown,e[r].leftTop,e[r].rightDown)?e[r].target.visible=!1:(e[r].target.visible=!0,n.push(e[r]));1<n.length&&((0,d.default)(n).call(n),this.checkMarkerAvoid(n))}}},{key:"avoidMarkers",value:function(){var e=this.nodeManager.getSceneById(this._currentSceneId);if(e)for(var t=this.renderer.getCameraByViewMode(this._viewMode),n=0;n<this._visibleGroups.length;n++){var r=e.getMarkers(this._visibleGroups[n],t,this.renderer.domElementHeight);this.checkMarkerAvoid(r);for(var i=e.getUserMarkers(this._visibleGroups[n],t,this.renderer.domElementHeight),a=0;a<i.length;a++)this.checkMarkerAvoid(i[a])}}},{key:"addAnimater",value:function(e){this._animaters.push(e)}},{key:"initTheme",value:function(e,t,n){var r,i=this.MapOptions.themeFileType||t.filetype||t.fileType||t.image,a=new O.default(this.MapOptions.mapThemeURL,e);a.clearColor=this.MapOptions.defaultBackgroundColor,a.clearAlpha=this.MapOptions.defaultBackgroundAlpha,a.version=this.MapOptions.themeVersion,"rtheme"==i?(r=this.MapOptions.mapThemeURL+"/"+this.MapOptions.themeName+"/"+e+".rtheme",this.fmServer.getTheme(r,function(e){a.rtheme=e,a.data=t,n&&(a.fileType=i,n(a))},function(){a.rtheme=null,console.warn("以 rtheme 格式加入资源失败!")})):(a.rtheme=null,a.data=t,n&&n(a)),this._modelSelectColor=a.getModelSelectColor()}},{key:"levelToScale",value:function(e){return this.mapScaleLevels[e-1]}},{key:"scaleTolevel",value:function(e){if(e>this.mapScaleLevels[0])return 1;if(e<this.mapScaleLevels[this.mapScaleLevels.length-1])return this.mapScaleLevels.length;for(var t=0;t<this.mapScaleLevels.length-1;t++)if(e>=this.mapScaleLevels[t+1]&&e<=this.mapScaleLevels[t]){var n=e-this.mapScaleLevels[t+1],r=this.mapScaleLevels[t]-e;return n<r?t+2:t+1}}},{key:"getMapScaleInfo",value:function(){this._pixelsPerCentimeter=this.wxInfo.screenWidth/2.54}},{key:"getOrthoCameraSizeByPerspectiveCamera",value:function(e,t,n){e instanceof h&&(n=t,t=e.controls,e=e.mapView.camera);var r=e.fov,i=e.aspect,a=null!=n?n:t.target.distanceTo(e.position),o=Math.tan(r*fm.Math.DEG2RAD/2)*a,s=2*o,l=s*i,u=l/2;return{top:o||1,right:u}}},{key:"getCameraDistanceByScale",value:function(e){var t=this.renderer.perspectiveCamera.fov,n=e/100*(this.renderer.domElementHeight/this._pixelsPerCentimeter)/2/Math.tan(t/2*fm.Math.DEG2RAD);return n}},{key:"getScaleByCameraDistance",value:function(){var e=this.renderer.perspectiveCamera.fov,t=(new fm.Vector3).copy(this.controls.object.position).sub(this.controls.target).length(),n=100*Math.tan(e/2*fm.Math.DEG2RAD)*2/(this.renderer.domElementHeight/this._pixelsPerCentimeter);return t*n}},{key:"getCameraScaleByScale",value:function(e){var t=this.renderer.orthographicCamera.top,n=this.renderer.orthographicCamera.bottom,r=Math.abs(t-n)*this._pixelsPerCentimeter*100/this.renderer.domElementHeight;return e/r}},{key:"getScaleByCameraScale",value:function(){var e=this.renderer.orthographicCamera.top,t=this.renderer.orthographicCamera.bottom,n=Math.abs(e-t)*this._pixelsPerCentimeter*100/this.renderer.domElementHeight;return n/this.renderer.orthographicCamera.zoom}},{key:"getLayerByAlias",value:function(e,t,n){var r=[],i=this.getFMGroup(e);return i.traverseByAlias([t],function(e){r.push(e),n&&n(e)},!0),r}},{key:"moveTo",value:function(e){return this._moveTo(e,!1)}},{key:"_moveTo",value:function(n,e){var t,r=this,i=this.center,a=n.x-i.x,o=-n.y+i.y,s=this.controls.target.x,l=this.controls.target.z,u=n.groupID,h=u?(t=this.controls.target.y,this.currentFocusGroup=u,this.nodeManager.getHeight(this._currentSceneId,this.currentFocusGroup)):(t=0,0);if(!this.MapOptions.moveToAnimateMode&&!e)return u&&this.controls.panUp(h-t),this.controls.panAdd({x:a-s,z:o-l,y:0}),this.controls.update(),null;B.default[this.uuid].currentMoveMapAnimater&&(B.default[this.uuid].currentMoveMapAnimater.stop(),this.removeAnimater(B.default[this.uuid].currentMoveMapAnimater));var c=new F.default({h:t,x:s,z:l},{h:h,x:a,z:o},n.time?1e3*n.time:500,function(){r.removeAnimater(c),B.default[r.uuid].currentMoveMapAnimater=null,n.callback&&n.callback()},function(e,t){u&&r.controls.panUp(t.h),r.controls.panAdd({x:t.x,z:t.z,y:0}),r.controls.update(),n.update&&n.update()}).start();return B.default[this.uuid].currentMoveMapAnimater=c,this._animaters.push(c),c}},{key:"moveToCenter",value:function(e){var t;"object"!==(0,c.default)(e)?(t=this.center,this.moveTo({x:t.x,y:t.y,groupID:e||this.focusGroupID})):this.moveTo(e)}},{key:"rotateTo",value:function(n){var r=this,e=this.controls.getAzimuthalAngle(),t=-n.to%360*fm.Math.DEG2RAD,i=t,a=0;t-e!=0&&(a=Math.sin(t-e)/Math.abs(Math.sin(t-e))*Math.acos(Math.cos(t-e))),t=e+a,B.default[this.uuid].currentRotateAnimater&&(B.default[this.uuid].currentRotateAnimater.stop(),this.removeAnimater(B.default[this.uuid].currentRotateAnimater));var o=new F.default({theta:e},{theta:t},n.duration?1e3*n.duration:500,function(){r.removeAnimater(o),r.controls.setUpdate(void 0,void 0,void 0,i),n.callback&&n.callback()},function(e,t){r.controls.setUpdate(void 0,t.theta),n.update&&n.update()}).start();return B.default[this.uuid].currentRotateAnimater=o,this._animaters.push(o),o}},{key:"scaleTo",value:function(i,e){var a=this;if(i.scale){var t=i.scale,n=this.mapScale,r=this.getCameraDistanceByScale(t),o=this.controls.object.position.distanceTo(this.controls.target),s=(new fm.Vector3).copy(this.controls.object.position).sub(this.controls.target).normalize();if(!this.MapOptions.scaleToAnimateMode&&!e){var l=(new fm.Vector3).copy(s).multiplyScalar(r-o);this.controls.setUpdate(0,0,l);var u=this.getCameraScaleByScale(t);return this.renderer.orthographicCamera.zoom=1/u,this.renderer.orthographicCamera.updateProjectionMatrix(),this.renderer.resetSpriteSize(),null}var h=new F.default({phi:o,scale:n},{phi:r,scale:t},i.duration?1e3*i.duration:500,function(){a.removeAnimater(h),i.callback&&i.callback(),a.renderer.resetSpriteSize()},function(e,t){var n=(new fm.Vector3).copy(s).multiplyScalar(t.phi);a.controls.setUpdate(0,0,n),i.update&&i.update();var r=a.getCameraScaleByScale(e.scale);a.renderer.orthographicCamera.zoom=1/r,a.renderer.orthographicCamera.updateProjectionMatrix()}).start();return this._animaters.push(h),h}}},{key:"scaleLevelIn",value:function(){var e=this.scaleLevel;e--,this.scaleLevelTo({level:e})}},{key:"scaleLevelOut",value:function(){var e=this.scaleLevel;e++,this.scaleLevelTo({level:e})}},{key:"scaleLevelTo",value:function(i){var a=this;if(i.level){var e=this.levelToScale(i.level),t=this.mapScale,n=this.getCameraDistanceByScale(e),r=this.controls.object.position.distanceTo(this.controls.target),o=(new fm.Vector3).copy(this.controls.object.position).sub(this.controls.target).normalize();if(!i.duration){var s=(new fm.Vector3).copy(o).multiplyScalar(n-r);this.controls.setUpdate(0,0,s);var l=this.getCameraScaleByScale(e);return this.renderer.orthographicCamera.zoom=1/l,this.renderer.orthographicCamera.updateProjectionMatrix(),void this.controls.update()}var u=new F.default({phi:r,scale:t},{phi:n,scale:e},i.duration?1e3*i.duration:500,function(){a.removeAnimater(u),i.callback&&i.callback(),a.renderer.resetSpriteSize()},function(e,t){var n=(new fm.Vector3).copy(o).multiplyScalar(t.phi);a.controls.setUpdate(0,0,n),i.update&&i.update();var r=a.getCameraScaleByScale(e.scale);a.renderer.orthographicCamera.zoom=1/r,a.renderer.orthographicCamera.updateProjectionMatrix()}).start();return this._animaters.push(u),u}}},{key:"tiltTo",value:function(n){var r=this;if(0!==n.to&&n.to){var e=this.controls.getPolarAngle(),t=(90-n.to)*fm.Math.DEG2RAD,i=new F.default({phi:e},{phi:t},n.duration?1e3*n.duration:500,function(){r.removeAnimater(i),n.callback&&n.callback(),r.renderer.resetSpriteSize()},function(e,t){r.controls.setUpdate(t.phi),n.update&&n.update(e)}).start();return this._animaters.push(i),i}}},{key:"fullScreenAvaliable",value:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},{key:"coordMapToScreen",value:function(e,t,n){var r=this.threeCenter,i=this.center,a=this.controls.object,o=this.getRotationCoord(e,t,!0),s=new fm.Vector3(o.x-i.x,r.y+n,-o.y+r.y+i.y);s.project(a);var l=this.renderer.canvas.clientWidth,u=this.renderer.canvas.clientHeight,h=l/2*s.x+l/2,c=-u/2*s.y+u/2;return{x:h,y:c}}},{key:"getRotationCoord",value:function(e,t,n){var r=e-this.center.x,i=t-this.center.y,a=1;n&&(a=-1);var o=this.nodeManager._scenes[this._currentSceneId].groups[this.focusGroupID]._layers.extent[0]._scene.rotation.y,s=Math.sin(a*o)*i+Math.cos(a*o)*r,l=Math.cos(a*o)*i-Math.sin(a*o)*r,u=s-r,h=l-i;return{x:e+u,y:t+h}}},{key:"coordScreenToMap",value:function(e,t,n,r,i){var a=this.controls.object,o=1e-4,s=this.center,l=this.threeCenter,u=this.getFMGroup(this._currentFocusGroup).height;if(null!=u){n=void 0===n?u+this.MapOptions.pickCoordHeight:n;var h=null,h=r?new fm.Vector3(e,t,n):new fm.Vector3(e/this.renderer.domElementWidth*2-1,1-t/this.renderer.domElementHeight*2,.5),c=new fm.Vector3,d=new fm.Vector3;a&&a.isPerspectiveCamera?(c.setFromMatrixPosition(a.matrixWorld),d.set(h.x,h.y,.5).unproject(a).sub(c).normalize()):a&&a.isOrthographicCamera&&(c.set(h.x,h.y,(a.near+a.far)/(a.near-a.far)).unproject(a),d.set(0,0,-1).transformDirection(a.matrixWorld));var f=new fm.Vector3(0,1,0),p=f.dot(d);if(!(Math.abs(p)<o)){var m=-c.y+n+l.y,v=m/d.y,g=(new fm.Vector3).copy(c).add((new fm.Vector3).copy(d).multiplyScalar(v));return i?g:{x:g.x+s.x,y:s.y-g.z,z:n}}}}},{key:"getScalelevelValueByVectics",value:function(e,t){return this.scaleTolevel(this.getScaleValueByVectics(e,t))}},{key:"getScaleValueByVectics",value:function(e,t){var n,r,i,a,o=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y),l=this.renderer.domElementHeight,u=this.renderer.domElementWidth,h=null,h=u<=l?o/s<=u/l?(n=l/this._pixelsPerCentimeter,100*s/n):(r=u/this._pixelsPerCentimeter,100*o/r):o/s<=u/l?(i=l/this._pixelsPerCentimeter,100*s/i):(a=u/this._pixelsPerCentimeter,100*o/a);return h}},{key:"toggleToTop",value:function(n,e){var r=this,t=1<arguments.length&&void 0!==e?arguments[1]:1e3;this.controls.minPolarAngle=0,this.controls.update();var i=this.controls.getPolarAngle();B.default[this.uuid].curPolarAngle=i,this.MapOptions.viewModeAnimateMode||(t=.001);var a=new F.default({phi:i},{phi:0},t,function(){r.removeAnimater(a),r.controls.maxPolarAngle=0;var e=r.getScaleByCameraDistance(),t=r.getCameraScaleByScale(e);r.renderer.orthographicCamera.zoom=1/t,r.renderer.orthographicCamera.quaternion.copy(r.controls.object.quaternion),r.renderer.orthographicCamera.position.copy(r.controls.object.position),r.renderer.orthographicCamera.updateProjectionMatrix(),r.controls.object=r.renderer.orthographicCamera,n&&n(),r.renderer.resetSpriteSize(),B.default[r.uuid].isToggleViewMode=!1},function(e,t){r.controls.setUpdate(t.phi)}).start();B.default[this.uuid].isToggleViewMode=!0,this._animaters.push(a)}},{key:"toggleTo3D",value:function(e,t){var n=this,r=1<arguments.length&&void 0!==t?arguments[1]:1e3;this.controls.maxPolarAngle=(90-this.MapOptions.defaultMinTiltAngle)*fm.Math.DEG2RAD;var i=this.getScaleByCameraScale(),a=this.getCameraDistanceByScale(i);this.renderer.perspectiveCamera.quaternion.copy(this.controls.object.quaternion),this.renderer.perspectiveCamera.position.copy(this.controls.object.position),this.renderer.perspectiveCamera.position.setY(this.controls.target.y+a),this.renderer.perspectiveCamera.updateMatrix(),this.controls.object=this.renderer.perspectiveCamera,this.renderer.resetSpriteSize();var o=B.default[this.uuid].curPolarAngle?B.default[this.uuid].curPolarAngle:(90-this.MapOptions.defaultTiltAngle)*fm.Math.DEG2RAD;this.MapOptions.viewModeAnimateMode||(r=.001);var s=new F.default({phi:0},{phi:o},r,function(){e&&e(),n.removeAnimater(s),B.default[n.uuid].isToggleViewMode=!1,n.renderer.resetSpriteSize()},function(e,t){n.controls.setUpdate(t.phi)}).start();B.default[this.uuid].isToggleViewMode=!0,this._animaters.push(s)}},{key:"getPixelTo3DdisByGid",value:function(e){var t,n,r,i,a,o,s,l=(new fm.Vector3).copy(this.controls.target),u=this.nodeManager.getSceneCenter(this._currentSceneId);return l.y=this.getFMGroup(e).height+this.getFMGroup(e).offsetHeight+u.y,r="top"===this._viewMode?(t=this.renderer.orthographicCamera.top,n=this.renderer.orthographicCamera.bottom,10*Math.abs(t-n)/this.renderer.domElementHeight/this.renderer.orthographicCamera.zoom):(i=this.renderer.perspectiveCamera.near,a=this.renderer.perspectiveCamera.fov,o=this.controls.object.position.distanceTo(l),s=10*i*Math.tan(a/2*fm.Math.DEG2RAD)*2/this.renderer.domElementHeight,s*o/i),10/r}},{key:"dispose",value:function(){(0,$.abortAnimationFrame)(this._loopHander),this.dispatchEvent({type:"dispose"});var e,t=ne(this._lineMarkers);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.dispose(this)}}catch(e){t.e(e)}finally{t.f()}this.nodeManager.dispose(),this.dataManager.dispose(),this.controls.dispose(),this.renderer.dispose(),B.default.dispose(this.uuid),this._lineMarkers.length=0,this._windowPops.length=0,this.nodeManager=void 0,this.dataManager=void 0,this.controls=void 0,this.renderer=void 0,this.fmServer=void 0,this.MapOptions=void 0}},{key:"disposeById",value:function(e){this.nodeManager.disposeById(e),this.dataManager.disposeById(e)}},{key:"addLocationMarker",value:function(e){e.map=this,e.scene=this.nodeManager.getSceneById(this._currentSceneId),e.initSprite(this.nodeManager),this.addLocationToGroup(e,this._currentSceneId,e.groupID),e.renderNode.updateMatrixWorld(!0),this.renderer.setLocationSize(e.renderNode,e.size)}},{key:"addLocationToGroup",value:function(e,t,n){var r=this.nodeManager.getGroup(t,n);r.addLocation(e)}},{key:"removeLocationMarker",value:function(e){this.removeLocationByGroup(e,this._currentSceneId,e.groupID),e.dispose()}},{key:"removeLocationByGroup",value:function(e,t,n){var r=this.nodeManager.getGroup(t,n);r.removeLocation(e)}},{key:"addLineMarker",value:function(e,t){var n=this.center;e.initLine(n,t,this),this._lineMarkers.push(e),e.hideOrShowBy(this.visibleGroupIDs)}},{key:"removeLineMarker",value:function(e){var t,n,r=(0,S.default)(t=this._lineMarkers).call(t,e);-1<r&&(0,_.default)(n=this._lineMarkers).call(n,r,1),e.removeByMap(this)}},{key:"removeAllMarkers",value:function(){for(var e=this._lineMarkers.length-1;-1<e;e--)this._lineMarkers[e].removeByMap(this);this._lineMarkers.length=0}},{key:"clearLineMark",value:function(e){if(e)if((0,y.default)(e)){var t,n=ne(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;this.removeLineMarker(r)}}catch(e){n.e(e)}finally{n.f()}}else this.removeLineMarker(e);else this.removeAllMarkers()}},{key:"drawLineMark",value:function(e,t){t.resolution=new fm.Vector2(this.renderer.canvas.clientWidth,this.renderer.canvas.clientHeight);var n=this.renderer.getCameraByViewMode(this._viewMode);t.near=n.near,t.far=n.far,this.addLineMarker(e,t)}},{key:"setLastRender",value:function(){var e,t=this.nodeManager.getSceneById(this._currentSceneId);t&&(e=t.getLastRenderArray(),this.renderer.setBackRender(e))}},{key:"update",value:function(){var e;if(this._loopHander=(0,$.doAnimationFrame)((0,b.default)(e=this.update).call(e,this)),this.letUpdate){this.isFpsDisplay&&this.stats.begin();var t=(new Date).getTime(),n=t-this._currentTime;this._currentTime=t,this.mouseHoverEventFire(n);var r,i=ne(this._animaters);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.enable&&a.run(n)}}catch(e){i.e(e)}finally{i.f()}var o,s=ne(this.animationMixers);try{for(s.s();!(o=s.n()).done;){var l=o.value;l.update(n/1e3)}}catch(e){s.e(e)}finally{s.f()}this.dispatchEvent({type:"frameLoop",delTime:n}),this.controls.update();var u,h=!1;this._renderTime+=n,1e3/this._allowfps<this._renderTime&&(u=this._renderTime,this._renderTime=0,h=!0),this.renderer&&h&&(this.updatePopsPosition(),this.allowRender&&(this.setLastRender(),this.renderer.update(this._viewMode)),this.dispatchEvent({type:"update",fps:1e3/u})),this.isFpsDisplay&&this.stats.end()}}},{key:"on",value:function(e,t){this.addEventListener(e,t)}},{key:"off",value:function(e,t){this.removeEventListener(e,t)}},{key:"registeredPop",value:function(e){this._windowPops.push(e)}},{key:"logoutPop",value:function(e){var t,n,r=(0,S.default)(t=this._windowPops).call(t,e);-1<r&&(0,_.default)(n=this._windowPops).call(n,r,1)}},{key:"updatePopsPosition",value:function(){var e,t=this.renderer.getCameraByViewMode(this._viewMode),n=ne(this._windowPops);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.updatePopPosition(r,t)}}catch(e){n.e(e)}finally{n.f()}}},{key:"updatePopPosition",value:function(e,t){t=t||this.renderer.getCameraByViewMode(this._viewMode);var n,r=new fm.Vector3;e.threeCoord?r.copy(e.threeCoord):e.marker?e.marker instanceof H.default?0<e.marker._meshes.length&&(e.marker._meshes[0].updateMatrixWorld(),e.marker._meshes[0].updateMatrixWorld(!0),r=(new fm.Vector3).setFromMatrixPosition(e.marker._meshes[0].matrixWorld)):(e.marker.renderNode.parent.updateMatrixWorld(),e.marker.renderNode.updateMatrixWorld(!0),r=(new fm.Vector3).setFromMatrixPosition(e.marker.renderNode.matrixWorld)):(n=this.center,r=r.set(e.coord.x-n.x,this.getFMGroup(e.coord.groupID).getHeight()+e.coord.height,-e.coord.y+n.y));var i=r.project(t),a=(i.x+1)/2*this.renderer.canvas.clientWidth,o=(1-i.y)/2*this.renderer.canvas.clientHeight;e.updateCoord(a,o)}},{key:"getFMGroup",value:function(e){return this.nodeManager.getGroup(this._currentSceneId,e)}},{key:"getGroupHeight",value:function(e){return this.getFMGroup(e).getHeight()}},{key:"getContainer",value:function(){return this.renderer.canvas}},{key:"getCurrGroupLength",value:function(){this.nodeManager.getGroupLength(this._currentSceneId)}},{key:"getCurrGroupIds",value:function(){return this.nodeManager.getGroupIds(this._currentSceneId)}},{key:"screenshot",value:function(e,t,n,h,c){var d=t.x-e.x,f=t.y-e.y,r={x:0,y:0};r.x=(t.x+e.x)/2,r.y=(t.y+e.y)/2;var i=this.renderer.container.getElementsByTagName("canvas")[0].style.width,a=this.renderer.container.getElementsByTagName("canvas")[0].style.height,o=i.split("p")[0],s=a.split("p")[0],p=null,p=(t.x-e.x)/(t.y-e.y)>o/s?o/(t.x-e.x):s/(t.y-e.y),l=r.x-o/2,u=r.y-s/2,m=document.getElementsByTagName("canvas")[0],v=document.createElement("canvas"),g=document.createElement("canvas"),y=document.createElement("canvas"),_=window.devicePixelRatio,x=new Image;"3d"===this.viewMode?this.renderer.perspectiveCamera.setViewOffset(o*p,s*p,o*(p-1)/2+l*p,s*(p-1)/2+u*p,o,s):this.renderer.orthographicCamera.setViewOffset(o*p,s*p,o*(p-1)/2+l*p,s*(p-1)/2+u*p,o,s),this.renderer.update(),v.width=d*p*_,v.height=f*p*_,v.style.width=d*p*_+"px",v.style.height=f*p*_+"px",n?(g.width=1240*Math.pow(1.414,h-1),g.height=1754*Math.pow(1.414,h-1),g.style.width=1240*Math.pow(1.414,h-1)+"px",g.style.height=1754*Math.pow(1.414,h-1)+"px"):(g.height=1240*Math.pow(1.414,h-1),g.width=1754*Math.pow(1.414,h-1),g.style.height=1240*Math.pow(1.414,h-1)+"px",g.style.width=1754*Math.pow(1.414,h-1)+"px"),y.height=f*Math.pow(1.414,h-1),y.width=d*Math.pow(1.414,h-1),y.style.height=f*Math.pow(1.414,h-1)+"px",y.style.width=d*Math.pow(1.414,h-1)+"px",x.src=m.toDataURL("image/png"),"3d"===this.viewMode?this.renderer.perspectiveCamera.clearViewOffset():this.renderer.orthographicCamera.clearViewOffset();var w=v.getContext("2d"),b=g.getContext("2d"),M=y.getContext("2d"),T=this;x.onload=function(){T.viewMode,w.drawImage(x,-(o*_-d*p*_)/2,-(s*_-f*p*_)/2);var u=new Image;u.src=v.toDataURL("image/png"),u.onload=function(){var e,t,n=Math.min(1240*Math.pow(1.414,h-1)/(d*p),1754*Math.pow(1.414,h-1)/(f*p)),r=(g.width-d*p*n)/2,i=(g.height-f*p*n)/2;b.drawImage(u,r,i,d*p*n,f*p*n),M.drawImage(u,0,0,d*Math.pow(1.414,h-1),f*Math.pow(1.414,h-1));var a,o,s=g.toDataURL("image/png"),l=y.toDataURL("image/png");-1<(0,S.default)(e=navigator.userAgent).call(e,"Edge")||-1<(0,S.default)(t=navigator.userAgent).call(t,".NET4.0C")?(a=null,o=null,c(s,a,l,o)):g.toBlob(function(t){y.toBlob(function(e){c(s,t,l,e)})})}}}},{key:"enableKeys",value:function(e){this.controls.enableKeys=e}},{key:"getSearchObjects",value:function(e){for(var t=[],n=0;n<e.length;n++){var r=null;5===e[n].nodeType?r="model":4===e[n].nodeType?r="extent":12===e[n].nodeType?r="label":11===e[n].nodeType?r="facility":35===e[n].nodeType&&(r="externalModel"),t.push(this.getFMGroup(e[n].groupID).getNodeByLayerId(r,e[n].ID))}return t}},{key:"getEffectRenderer",value:function(){var e=new FMEffectRenderer(this.MapOptions,this);return this.renderer=e,e}},{key:"getCompassOffset",value:function(){return{left:this.MapOptions.compassOffset[0],top:this.MapOptions.compassOffset[1]}}},{key:"setCompassOffset",value:function(e,t){this.MapOptions.compassOffset[0]=t,this.MapOptions.compassOffset[1]=e,this.renderer.resetCompass()}},{key:"getCompassScale",value:function(){return this.MapOptions.compassSize}},{key:"setCompassScale",value:function(e){this.MapOptions.compassSize=e,this.renderer.resetCompass()}},{key:"getStation",value:function(){var e={};e.sdkVersion=z.default.VERSION+"."+z.default.BUILD,e.device=this.wxInfo.device,e.os=this.wxInfo.system,e.appName=this.MapOptions.appName,e.appkey=this.MapOptions.key,e.brand=this.wxInfo.brand,e.product="Mini";var t=(0,R.default)(e),n=new N.default;return n.open("POST",q.default+"sdk/collect",!0),n.setRequestHeader("Content-type","application/json"),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.onreadystatechange=function(){4===n.readyState&&n.status},n.send(t),e}},{key:"getVideoMemoryAmount",value:function(e){var t=null,t=this.videoMemory.getVideoMemoryAmount(e);return t}},{key:"setCompass",value:function(){var e,t,n,r,i;this.renderer.compassNode||(e=this.renderer.getAspect(),t=this.renderer.getScaleByPixels(1,this.MapOptions.compassSize),n=-this.renderer.getScaleByPixels(1,i[1]),r=this.renderer.getScaleByPixels(1,i[0])/e,i=this.renderer.getCompassOffset(this.MapOptions.compassPosition,t,e,r,n),this.renderer.compassNode=this.nodeManager.createCompassNode(t,this._compassBG,this._compassFG,i.ox,i.oy),this.renderer.compassNode.material.uniforms.rotation.value=this.controls.getAzimuthalAngle())}},{key:"setThemeByJson",value:function(e,t){var n=this,r=this.nodeManager.getSceneById(this._currentSceneId);n.initTheme(e,t,function(e){n.setBackgroundColor(e.clearColor,e.clearAlpha),r.theme=e,r.changeTheme(e)})}},{key:"setAutoRotateBymodel",value:function(e){this.autoRotateBymodel=e}},{key:"getAutoRotateBymodel",value:function(){return this.autoRotateBymodel}},{key:"setAutoRotateBymodelSpeed",value:function(e){this.autoRotateBymodelSpeed=e}},{key:"getAutoRotateBymodelSpeed",value:function(){return this.autoRotateBymodelSpeed}},{key:"showAllGroup",get:function(){return this._showAllGroup}},{key:"compass",get:function(){var t=this,n=this.renderer,r=this.nodeManager.materialManager;return{setBgImage:function(e){t._compassBG=e,n.compassNode&&(n.compassNode.material.uniforms.mapBack.value=r.loadTexture(e,function(){n.compassNode.material.needsUpdate=!0}))},setFgImage:function(e){t._compassFG=e,n.compassNode&&(n.compassNode.material.uniforms.mapfront.value=r.loadTexture(e,function(){n.compassNode.material.needsUpdate=!0}))}}}},{key:"modelSelectColor",get:function(){return this._modelSelectColor}},{key:"groupIDs",get:function(){var e=[];return e.push.apply(e,(0,s.default)(this.nodeManager.getSceneById(this._currentSceneId).groupIds)),e}},{key:"visibleGroupIDs",get:function(){return this.getVisibleGroups()},set:function(e){this._visibleGroups=e,this.hideOrShowLine(),this.checkNode(),this.setRenderList(),this.avoidMarkers(),this.renderer.resetSpriteSize(),this.dispatchEvent({type:"visibleGroupIDsChanged",gids:e})}},{key:"mapScaleLevel",set:function(e){var t,n;"object"===(0,c.default)(e)&&(t=e.duration,n=e.callback,e=e.level),e<this.minScaleLevel?e=this.minScaleLevel:e>this.maxScaleLevel&&(e=this.maxScaleLevel),this.scaleLevelTo({level:e,duration:t,callback:n}),this._mapScale=this.levelToScale(e),this._mapScaleLevel=e},get:function(){return this._mapScaleLevel}},{key:"mapScale",get:function(){return this._mapScale},set:function(e){e<this.minScale?e=this.minScale:e>this.maxScale&&(e=this.maxScale),this.scaleTo({scale:e}),this._mapScaleLevel=this.scaleTolevel(e),this._mapScale=e}},{key:"scaleLevel",get:function(){return this.mapScaleLevel}},{key:"maxScale",set:function(e){e<=this.mapScaleLevels[this.mapScaleLevels.length-1]?e=this.mapScaleLevels[this.mapScaleLevels.length-2]:e>this.mapScaleLevels[0]&&(e=this.mapScaleLevels[0]),this._minScaleLevel=this.scaleTolevel(e),this._maxScale=e,this.controls.maxDistance=this.getCameraDistanceByScale(this._maxScale)},get:function(){return this._maxScale}},{key:"minScale",set:function(e){e<this.mapScaleLevels[this.mapScaleLevels.length-1]?e=this.mapScaleLevels[this.mapScaleLevels.length-1]:e>=this.mapScaleLevels[0]&&(e=this.mapScaleLevels[1]),this._maxScaleLevel=this.scaleTolevel(e),this._minScale=e,this.controls.minDistance=this.getCameraDistanceByScale(this._minScale)},get:function(){return this._minScale}},{key:"minScaleLevel",set:function(e){e<1&&(e=1),29<=e&&(e=28),this._maxScale=this.levelToScale(e),this.controls.maxDistance=this.getCameraDistanceByScale(this._maxScale),this.controls.minZoom=1/this.getCameraScaleByScale(this._maxScale),this._minScaleLevel=e},get:function(){return this._minScaleLevel}},{key:"maxScaleLevel",set:function(e){e<=1&&(e=2),29<e&&(e=29),this._minScale=this.levelToScale(e),this._maxScaleLevel=e,this.controls.minDistance=this.getCameraDistanceByScale(this._minScale),this.controls.maxZoom=1/this.getCameraScaleByScale(this._minScale)},get:function(){return this._maxScaleLevel}},{key:"maxFps",set:function(e){this._allowfps=e},get:function(){return this._allowfps}},{key:"viewMode",get:function(){return this._viewMode},set:function(t){var n,e,r=this;B.default[this.uuid].isToggleViewMode||(n=function(){r.dispatchEvent({type:"viewModeChange",mode:t})},"3d"==t&&"3d"!=this._viewMode?(this.renderer.viewMode=t,this._viewMode=t,e=this.nodeManager.getRenderList(),this.renderer.renderList=e,this.toggleTo3D(function(){n()},1e3*this.MapOptions.viewModeAnimateTime)):"top"==t&&"top"!=this._viewMode&&this.toggleToTop(function(){r._viewMode=t,r.renderer.viewMode=t;var e=r.nodeManager.getRenderList();r.renderer.renderList=e,n()},1e3*this.MapOptions.viewModeAnimateTime))}},{key:"showCompass",set:function(e){var t,n,r,i,a;e&&!this.renderer.compassNode&&(t=this.renderer.getAspect(),n=this.renderer.getScaleByPixels(1,this.MapOptions.compassSize),r=-this.renderer.getScaleByPixels(1,this.MapOptions.compassOffset[1]),i=this.renderer.getScaleByPixels(1,this.MapOptions.compassOffset[0])/t,a=this.renderer.getCompassOffset(this.MapOptions.compassPosition,n,t,i,r),this.renderer.compassNode=this.nodeManager.createCompassNode(n,this._compassBG,this._compassFG,a.ox,a.oy),this.renderer.compassNode.material.uniforms.rotation.value=-this.controls.getAzimuthalAngle()),this.renderer.showCompass=e},get:function(){return this.renderer.showCompass}},{key:"currentFocusGroup",get:function(){return this._currentFocusGroup},set:function(e){var t;this._currentFocusGroup=e,1<this.visibleGroupIDs.length?-1<(0,S.default)(t=this.visibleGroupIDs).call(t,e)||(this.visibleGroupIDs.push(e),this.visibleGroupIDs=this.visibleGroupIDs,this.checkNode(),this.setRenderList()):this.visibleGroupIDs=[e],this.dispatchEvent({type:"focusGroupIDChanged",gid:e})}},{key:"focusGroupID",set:function(e){this.changeFocusToGroup({gid:e})},get:function(){return this.currentFocusGroup}},{key:"center",get:function(){return(new fm.Vector3).copy(this.nodeManager.getSceneById(this._currentSceneId).mapcenter)}},{key:"threeCenter",get:function(){return(new fm.Vector3).copy(this.nodeManager.getSceneById(this._currentSceneId).center)}},{key:"maxX",get:function(){return this.nodeManager.getSceneById(this._currentSceneId).bbox.max.x}},{key:"maxY",get:function(){return this.nodeManager.getSceneById(this._currentSceneId).bbox.max.y}},{key:"minX",get:function(){return this.nodeManager.getSceneById(this._currentSceneId).bbox.min.x}},{key:"minY",get:function(){return this.nodeManager.getSceneById(this._currentSceneId).bbox.min.y}},{key:"groupSpace",get:function(){return this.nodeManager.getSceneById(this._currentSceneId).space},set:function(e){var t=this.nodeManager.getSceneById(this._currentSceneId);t.space=e;var n=t.mapcenter,r=this.groupIDs[this.groupIDs.length-1];this.nodeManager.checkNodeByFrustum(this.dataManager.getDecodeScene(this._currentSceneId),this.renderer.getFrustumByViewMode(this._viewMode),this.getVisibleGroups(),this.mapScaleLevel,this._currentSceneId);var i,a=ne(this._lineMarkers);try{for(a.s();!(i=a.n()).done;){var o=i.value;o.rebuildLine(n,this,this._visibleGroups,r)}}catch(e){a.e(e)}finally{a.f()}}},{key:"themeName",set:function(t){var e=this.MapOptions.mapThemeURL+"/"+t+"/"+t+".theme",n=this,r=this.nodeManager.getSceneById(this._currentSceneId),i=r.theme.themeName;i!==t&&this.fmServer.getTheme(e,function(e){n.initTheme(t,e,function(e){n.setBackgroundColor(e.clearColor,e.clearAlpha),r.theme=e,r.changeTheme(e)})})},get:function(){var e=this.nodeManager.getSceneById(this._currentSceneId);return e.theme.themeName}},{key:"fullScreen",get:function(){return this._fullScreen},set:function(e){var t=this.renderer.canvas,t=t||document.body;try{e?(t.webkitRequestFullScreen||t.mozRequestFullScreen).call(t):(document.webkitCancelFullScreen||document.mozCancelFullScreen).call(document),this._fullScreen=e}catch(e){console.error(e)}}},{key:"rotateAngle",get:function(){return-this.controls.getAzimuthalAngle()*fm.Math.RAD2DEG},set:function(e){e=-e*fm.Math.DEG2RAD,e>Math.PI?e-=2*Math.PI:e<-Math.PI&&(e=2*Math.PI+e),e<this.controls.minAzimuthAngle&&(e=this.controls.minAzimuthAngle),e>this.controls.maxAzimuthAngle&&(e=this.controls.maxAzimuthAngle),this.controls.setUpdate(void 0,void 0,void 0,e),this.controls.update()}},{key:"maxTitleAngle",get:function(){return(Math.PI/2-this.controls.minPolarAngle)*fm.Math.RAD2DEG},set:function(e){"3d"===this._viewMode&&(this.controls.minPolarAngle=(90-e)*fm.Math.DEG2RAD),this.MapOptions.defaultMaxTiltAngle=e}},{key:"minTitleAngle",get:function(){return(Math.PI/2-this.controls.maxPolarAngle)*fm.Math.RAD2DEG},set:function(e){"3d"===this._viewMode&&(this.controls.maxPolarAngle=(90-e)*fm.Math.DEG2RAD),this.MapOptions.defaultMinTiltAngle=e}},{key:"labelLanguage",get:function(){return this.MapOptions.defaultLabelLanguage},set:function(e){var t;e!==this.labelLanguage&&(this.MapOptions.defaultLabelLanguage=e,t=this.nodeManager.getSceneById(this._currentSceneId),t&&t.setLabelLanguage(e))}},{key:"backgroundColor",set:function(e){this.renderer.renderer.setClearColor((0,g.default)(e))}},{key:"tiltAngle",get:function(){return(Math.PI/2-this.controls.getPolarAngle())*fm.Math.RAD2DEG},set:function(e){e=(90-e)*fm.Math.DEG2RAD,e<this.controls.minPolarAngle&&(e=this.controls.minPolarAngle),e>this.controls.maxPolarAngle&&(e=this.controls.maxPolarAngle),this.controls.setUpdate(void 0,void 0,void 0,void 0,e)}},{key:"listGroups",get:function(){return this.dataManager.getDecodeScene(this._currentSceneId).scene.layerGroups}},{key:"layerLocalHeight",get:function(){return 0}},{key:"gestureEnableController",get:function(){return this._enterControl}}]),h}(G.default),ue=le;t.default=ue},function(e,t,n){e.exports=n(472)},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),p=r(n(9)),m=r(n(0)),v=r(n(63)),o=r(n(31)),s=r(n(55)),l=r(n(10)),u=r(n(2)),h=r(n(3)),c=r(n(91)),d=r(n(5)),f=r(n(6)),g=r(n(7)),y=r(n(135)),_=r(n(137));function x(r){var i=w();return function(){var e,t=(0,g.default)(r),n=i?(e=(0,g.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,f.default)(this,n)}}function w(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var b=new y.default,M=new y.default,T=new y.default;function S(e,t){var n=1<arguments.length&&void 0!==t?arguments[1]:{};n.target=n.target||this,"function"==typeof this["on".concat(e)]&&this["on".concat(e)].call(this,n)}function E(e,t){var n=1<arguments.length&&void 0!==t?arguments[1]:{};this.readyState=e,n.readyState=e,S.call(this,"readystatechange",n)}function A(e){return!/^(http|https|ftp|wxfile):\/\/.*/i.test(e)}var I=function(e){(0,d.default)(f,e);var t=x(f);function f(){var e;return(0,u.default)(this,f),e=t.call(this),e.onabort=null,e.onerror=null,e.onload=null,e.onloadstart=null,e.onprogress=null,e.ontimeout=null,e.onloadend=null,e.onreadystatechange=null,e.readyState=0,e.response=null,e.responseText=null,e.responseType="text",e.dataType="string",e.responseXML=null,e.status=0,e.statusText="",e.upload={},e.withCredentials=!1,b.set((0,c.default)(e),{"content-type":"application/x-www-form-urlencoded"}),M.set((0,c.default)(e),{}),e}return(0,h.default)(f,[{key:"abort",value:function(){var e=T.get(this);e&&e.abort()}},{key:"getAllResponseHeaders",value:function(){var e,n=M.get(this);return(0,l.default)(e=(0,s.default)(n)).call(e,function(e){var t;return(0,o.default)(t="".concat(e,": ")).call(t,n[e])}).join("\n")}},{key:"getResponseHeader",value:function(e){return M.get(this)[e]}},{key:"open",value:function(e,t){this._method=e,this._url=t,E.call(this,f.OPENED)}},{key:"overrideMimeType",value:function(){}},{key:"send",value:function(e){var i=this,t=0<arguments.length&&void 0!==e?arguments[0]:"";if(this.readyState!==f.OPENED)throw new Error("Failed to execute 'send' on 'XMLHttpRequest': The object's state must be OPENED.");var n,r=this._url,a=b.get(this),o=this.responseType,s=this.dataType,l=A(r);"arraybuffer"===o||(n="utf8"),delete this.response,this.response=null;var u=function(e){var t=e.data,n=e.statusCode,r=e.header,n=void 0===n?200:n;if("string"!=typeof t&&!(t instanceof ArrayBuffer))try{t=(0,v.default)(t)}catch(e){}i.status=n,r&&M.set(i,r),S.call(i,"loadstart"),E.call(i,f.HEADERS_RECEIVED),E.call(i,f.LOADING),i.response=t,t instanceof ArrayBuffer?(0,m.default)(i,"responseText",{enumerable:!0,configurable:!0,get:function(){throw"InvalidStateError : responseType is "+this.responseType}}):i.responseText=t,E.call(i,f.DONE),S.call(i,"load"),S.call(i,"loadend")},h=function(e){var t=e.errMsg;-1!==(0,p.default)(t).call(t,"abort")?S.call(i,"abort"):S.call(i,"error",{message:t}),S.call(i,"loadend"),l&&console.warn(t)};if(l){var c=wx.getFileSystemManager(),d={filePath:r,success:u,fail:h};return n&&(d.encoding=n),void c.readFile(d)}wx.request({data:t,url:r,method:this._method,header:a,dataType:s,responseType:o,success:u,fail:h})}},{key:"setRequestHeader",value:function(e,t){var n=b.get(this);n[e]=t,b.set(this,n)}},{key:"addEventListener",value:function(e,n){var r=this;"function"==typeof n&&(this["on"+e]=function(e){var t=0<arguments.length&&void 0!==e?arguments[0]:{};t.target=t.target||r,n.call(r,t)})}},{key:"removeEventListener",value:function(e,t){this["on"+e]===t&&(this["on"+e]=null)}}]),f}(_.default);t.default=I,I.UNSEND=0,I.OPENED=1,I.HEADERS_RECEIVED=2,I.LOADING=3,I.DONE=4},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),h=r(n(205)),s=r(n(93)),l=function(){function e(){(0,a.default)(this,e),this.netArea=s.default}return(0,o.default)(e,[{key:"getScene",value:function(e,t,n,r,i,a,o){var s=n?t+".scene":t,l=e+"/"+s+".fmap",u=new h.default;r&&(n||(l=e),u.setRequestHeader({"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"})),u.requestMethod=i||"GET",u.sendData=r,u.setResponseType("arraybuffer"),u.getFile(l,function(e){a(e,t)},function(e){console.error("网络请求错误"),o&&o(e)})}},{key:"getFloor",value:function(e,t,n,r,i,a){var o=new h.default;"fengmap"==e&&(e=this.netArea+"sdk/authLayered/downMaps",o.requestMethod="POST",o.sendData=a,o.setRequestHeader({"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"}));var s=e+"/"+n+"."+t+".biz.fmap",l=e+"/"+n+"."+t+".geo.fmap",u=e+"/"+n+"."+t+".navi.fmap";o.setResponseType("arraybuffer"),o.getFile(l,function(n){o.getFile(s,function(t){o.getFile(u,function(e){i(n,t,e,r)},function(){console.error("网络请求错误")})},function(){console.error("网络请求错误")})},function(){console.error("网络请求错误")})}},{key:"getTheme",value:function(e,n){var t=new h.default;t.getFile(e,function(e){var t=JSON.parse(e);n(t)},function(){})}},{key:"getData",value:function(e,t,n,r,i,a){var o=new h.default;o.requestMethod=r||"GET",o.sendData=i,o.setRequestHeader(a),o.getFile(e,function(e){e=JSON.parse(e),t(e)},function(e){n(e)})}}]),e}(),u=l;t.default=u},function(e,pe,me){"use strict";(function(e){var t=me(1),n=me(0);n(pe,"__esModule",{value:!0}),pe.ProtoBuf=void 0;var E=t(me(75)),A=t(me(63)),I=t(me(476)),L=t(me(36)),R=t(me(10)),N=t(me(55)),k=t(me(64)),p=t(me(127)),P=t(me(14)),h=t(me(27)),r=t(me(54)),C=t(me(49)),D=t(me(13)),O=t(me(62)),F=t(me(30)),B=t(me(9)),U=t(me(0));function l(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function f(e){return!0===(e&&e.__isLong__)}l.__isLong__,(0,U.default)(l.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),l.isLong=f;var a={},o={};function i(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=o[e],r)?r:(n=v(e,(0|e)<0?-1:0,!0),i&&(o[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=a[e],r)?r:(n=v(e,e<0?-1:0,!1),i&&(a[e]=n),n))}function m(e,t){if(isNaN(e)||!isFinite(e))return t?M:b;if(t){if(e<0)return M;if(_<=e)return V}else{if(e<=-x)return H;if(x<=e+1)return G}return e<0?m(-e,t).neg():v(e%y|0,e/y|0,t)}function v(e,t,n){return new l(e,t,n)}l.fromInt=i,l.fromNumber=m,l.fromBits=v;var c=Math.pow;function d(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return b;if("number"==typeof t&&(n=t,t=!1),n=n||10,n<2||36<n)throw RangeError("radix");var r;if(0<(r=(0,B.default)(e).call(e,"-")))throw Error("interior hyphen");if(0===r)return d(e.substring(1),t,n).neg();for(var i=m(c(n,8)),a=b,o=0;o<e.length;o+=8)var s,l=Math.min(8,e.length-o),u=(0,F.default)(e.substring(o,o+l),n),a=l<8?(s=m(c(n,l)),a.mul(s).add(m(u))):(a=a.mul(i),a.add(m(u)));return a.unsigned=t,a}function g(e){return e instanceof l?e:"number"==typeof e?m(e):"string"==typeof e?d(e):v(e.low,e.high,e.unsigned)}l.fromString=d,l.fromValue=g;var s=65536,u=1<<24,y=s*s,_=y*y,x=_/2,w=i(u),b=i(0);l.ZERO=b;var M=i(0,!0);l.UZERO=M;var T=i(1);l.ONE=T;var S=i(1,!0);l.UONE=S;var z=i(-1);l.NEG_ONE=z;var G=v(-1,2147483647,!1);l.MAX_VALUE=G;var V=v(-1,-1,!0);l.MAX_UNSIGNED_VALUE=V;var H=v(0,-2147483648,!1);l.MIN_VALUE=H;var j=l.prototype;j.toInt=function(){return this.unsigned?this.low>>>0:this.low},j.toNumber=function(){return this.unsigned?(this.high>>>0)*y+(this.low>>>0):this.high*y+(this.low>>>0)},j.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(H)){var t=m(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=m(c(e,6),this.unsigned),a=this,o="";;){var s=a.div(i),l=a.sub(s.mul(i)).toInt()>>>0,u=l.toString(e),a=s;if(a.isZero())return u+o;for(;u.length<6;)u="0"+u;o=""+u+o}},j.getHighBits=function(){return this.high},j.getHighBitsUnsigned=function(){return this.high>>>0},j.getLowBits=function(){return this.low},j.getLowBitsUnsigned=function(){return this.low>>>0},j.getNumBitsAbs=function(){if(this.isNegative())return this.eq(H)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;0<t&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},j.isZero=function(){return 0===this.high&&0===this.low},j.isNegative=function(){return!this.unsigned&&this.high<0},j.isPositive=function(){return this.unsigned||0<=this.high},j.isOdd=function(){return 1==(1&this.low)},j.isEven=function(){return 0==(1&this.low)},j.equals=function(e){return f(e)||(e=g(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},j.eq=j.equals,j.notEquals=function(e){return!this.eq(e)},j.neq=j.notEquals,j.lessThan=function(e){return this.comp(e)<0},j.lt=j.lessThan,j.lessThanOrEqual=function(e){return this.comp(e)<=0},j.lte=j.lessThanOrEqual,j.greaterThan=function(e){return 0<this.comp(e)},j.gt=j.greaterThan,j.greaterThanOrEqual=function(e){return 0<=this.comp(e)},j.gte=j.greaterThanOrEqual,j.compare=function(e){if(f(e)||(e=g(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},j.comp=j.compare,j.negate=function(){return!this.unsigned&&this.eq(H)?H:this.not().add(T)},j.neg=j.negate,j.add=function(e){f(e)||(e=g(e));var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,i=65535&this.low,a=e.high>>>16,o=65535&e.high,s=e.low>>>16,l=65535&e.low,u=0,h=0,c=0,d=0;return d+=i+l,c+=d>>>16,d&=65535,c+=r+s,h+=c>>>16,c&=65535,h+=n+o,u+=h>>>16,h&=65535,u+=t+a,u&=65535,v(c<<16|d,u<<16|h,this.unsigned)},j.subtract=function(e){return f(e)||(e=g(e)),this.add(e.neg())},j.sub=j.subtract,j.multiply=function(e){if(this.isZero())return b;if(f(e)||(e=g(e)),e.isZero())return b;if(this.eq(H))return e.isOdd()?H:b;if(e.eq(H))return this.isOdd()?H:b;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(w)&&e.lt(w))return m(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,i=65535&this.low,a=e.high>>>16,o=65535&e.high,s=e.low>>>16,l=65535&e.low,u=0,h=0,c=0,d=0;return d+=i*l,c+=d>>>16,d&=65535,c+=r*l,h+=c>>>16,c&=65535,c+=i*s,h+=c>>>16,c&=65535,h+=n*l,u+=h>>>16,h&=65535,h+=r*s,u+=h>>>16,h&=65535,h+=i*o,u+=h>>>16,h&=65535,u+=t*l+n*s+r*o+i*a,u&=65535,v(c<<16|d,u<<16|h,this.unsigned)},j.mul=j.multiply,j.divide=function(e){if(f(e)||(e=g(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?M:b;var t,n;if(this.eq(H)){if(e.eq(T)||e.eq(z))return H;if(e.eq(H))return T;var r=this.shr(1),i=r.div(e).shl(1);return i.eq(b)?e.isNegative()?T:z:(t=this.sub(e.mul(i)),n=i.add(t.div(e)),n)}if(e.eq(H))return this.unsigned?M:b;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();for(n=b,t=this;t.gte(e);){i=Math.max(1,Math.floor(t.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(i)/Math.LN2),o=a<=48?1:c(2,a-48),s=m(i),l=s.mul(e);l.isNegative()||l.gt(t);)i-=o,s=m(i,this.unsigned),l=s.mul(e);s.isZero()&&(s=T),n=n.add(s),t=t.sub(l)}return n},j.div=j.divide,j.modulo=function(e){return f(e)||(e=g(e)),this.sub(this.div(e).mul(e))},j.mod=j.modulo,j.not=function(){return v(~this.low,~this.high,this.unsigned)},j.and=function(e){return f(e)||(e=g(e)),v(this.low&e.low,this.high&e.high,this.unsigned)},j.or=function(e){return f(e)||(e=g(e)),v(this.low|e.low,this.high|e.high,this.unsigned)},j.xor=function(e){return f(e)||(e=g(e)),v(this.low^e.low,this.high^e.high,this.unsigned)},j.shiftLeft=function(e){return f(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?v(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):v(0,this.low<<e-32,this.unsigned)},j.shl=j.shiftLeft,j.shiftRight=function(e){return f(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?v(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):v(this.high>>e-32,0<=this.high?0:-1,this.unsigned)},j.shr=j.shiftRight,j.shiftRightUnsigned=function(e){if(f(e)&&(e=e.toInt()),e&=63,0===e)return this;var t=this.high;if(e<32){var n=this.low;return v(n>>>e|t<<32-e,t>>>e,this.unsigned)}return v(32===e?t:t>>>e-32,0,this.unsigned)},j.shru=j.shiftRightUnsigned,j.toSigned=function(){return this.unsigned?v(this.low,this.high,!1):this},j.toUnsigned=function(){return this.unsigned?this:v(this.low,this.high,!0)};var W=function e(t,n,r){if(void 0===t&&(t=e.DEFAULT_CAPACITY),void 0===n&&(n=e.DEFAULT_ENDIAN),void 0===r&&(r=e.DEFAULT_NOASSERT),!r){if(t|=0,t<0)throw RangeError("Illegal capacity");n=!!n,r=!!r}this.buffer=0===t?q:new ArrayBuffer(t),this.view=0===t?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=t,this.littleEndian=n,this.noAssert=r};W.VERSION="5.0.1",W.LITTLE_ENDIAN=!0,W.BIG_ENDIAN=!1,W.DEFAULT_CAPACITY=16,W.DEFAULT_ENDIAN=W.BIG_ENDIAN,W.DEFAULT_NOASSERT=!1,W.Long=l||null;var Y=W.prototype;Y.__isByteBuffer__,(0,U.default)(Y,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var q=new ArrayBuffer(0),X=String.fromCharCode;function Z(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function J(){var e=[],t=[];return function(){if(0===arguments.length)return t.join("")+X.apply(String,e);1024<e.length+arguments.length&&(t.push(X.apply(String,e)),e.length=0),Array.prototype.push.apply(e,arguments)}}function K(e,t,n,r,i){var a,o,s=8*i-r-1,l=(1<<s)-1,u=l>>1,h=-7,c=n?i-1:0,d=n?-1:1,f=e[t+c];for(c+=d,a=f&(1<<-h)-1,f>>=-h,h+=s;0<h;a=256*a+e[t+c],c+=d,h-=8);for(o=a&(1<<-h)-1,a>>=-h,h+=r;0<h;o=256*o+e[t+c],c+=d,h-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:Infinity*(f?-1:1);o+=Math.pow(2,r),a-=u}return(f?-1:1)*o*Math.pow(2,a-r)}function Q(e,t,n,r,i,a){var o,s,l,u=8*a-i-1,h=(1<<u)-1,c=h>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:a-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||Infinity===t?(s=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),t+=1<=o+c?d/l:d*Math.pow(2,1-c),2<=t*l&&(o++,l/=2),h<=o+c?(s=0,o=h):1<=o+c?(s=(t*l-1)*Math.pow(2,i),o+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),o=0));8<=i;e[n+f]=255&s,f+=p,s/=256,i-=8);for(o=o<<i|s,u+=i;0<u;e[n+f]=255&o,f+=p,o/=256,u-=8);e[n+f-p]|=128*m}W.accessor=function(){return Uint8Array},W.allocate=function(e,t,n){return new W(e,t,n)},W.concat=function(e,t,n,r){"boolean"!=typeof t&&"string"==typeof t||(r=n,n=t,t=void 0);for(var i,a=0,o=0,s=e.length;o<s;++o)W.isByteBuffer(e[o])||(e[o]=W.wrap(e[o],t)),i=e[o].limit-e[o].offset,0<i&&(a+=i);if(0===a)return new W(0,n,r);for(var l,u=new W(a,n,r),o=0;o<s;)l=e[o++],i=l.limit-l.offset,i<=0||(u.view.set(l.view.subarray(l.offset,l.limit),u.offset),u.offset+=i);return u.limit=u.offset,u.offset=0,u},W.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},W.type=function(){return ArrayBuffer},W.wrap=function(e,t,n,r){if("string"!=typeof t&&(r=n,n=t,t=void 0),"string"==typeof e)switch(void 0===t&&(t="utf8"),t){case"base64":return W.fromBase64(e,n);case"hex":return W.fromHex(e,n);case"binary":return W.fromBinary(e,n);case"utf8":return W.fromUTF8(e,n);case"debug":return W.fromDebug(e,n);default:throw Error("Unsupported encoding: "+t)}if(null===e||"object"!==(0,O.default)(e))throw TypeError("Illegal buffer");var i;if(W.isByteBuffer(e))return i=Y.clone.call(e),i.markedOffset=-1,i;if(e instanceof Uint8Array)i=new W(0,n,r),0<e.length&&(i.buffer=e.buffer,i.offset=e.byteOffset,i.limit=e.byteOffset+e.byteLength,i.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)i=new W(0,n,r),0<e.byteLength&&(i.buffer=e,i.offset=0,i.limit=e.byteLength,i.view=0<e.byteLength?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");i=new W(e.length,n,r),i.limit=e.length;for(var a=0;a<e.length;++a)i.view[a]=e[a]}return i},Y.writeBitSet=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if(!(e instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r=t,i=e.length,a=i>>3,o=0;for(t+=this.writeVarint32(i,t);a--;)l=1&!!e[o++]|(1&!!e[o++])<<1|(1&!!e[o++])<<2|(1&!!e[o++])<<3|(1&!!e[o++])<<4|(1&!!e[o++])<<5|(1&!!e[o++])<<6|(1&!!e[o++])<<7,this.writeByte(l,t++);if(o<i){for(var s=0,l=0;o<i;)l|=(1&!!e[o++])<<s++;this.writeByte(l,t++)}return n?(this.offset=t,this):t-r},Y.readBitSet=function(e){var t=void 0===e;t&&(e=this.offset);var n=this.readVarint32(e),r=n.value,i=r>>3,a=0,o=[];for(e+=n.length;i--;)l=this.readByte(e++),o[a++]=!!(1&l),o[a++]=!!(2&l),o[a++]=!!(4&l),o[a++]=!!(8&l),o[a++]=!!(16&l),o[a++]=!!(32&l),o[a++]=!!(64&l),o[a++]=!!(128&l);if(a<r)for(var s=0,l=this.readByte(e++);a<r;)o[a++]=!!(l>>s++&1);return t&&(this.offset=e),o},Y.readBytes=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}var i=(0,D.default)(n=this).call(n,t,t+e);return r&&(this.offset+=e),i},Y.writeBytes=Y.append,Y.writeInt8=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var r=this.buffer.byteLength;return r<t&&this.resize((r*=2)>t?r:t),--t,this.view[t]=e,n&&(this.offset+=1),this},Y.writeByte=Y.writeInt8,Y.readInt8=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=this.view[e];return 128==(128&n)&&(n=-(255-n+1)),t&&(this.offset+=1),n},Y.readByte=Y.readInt8,Y.writeUint8=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var r=this.buffer.byteLength;return r<t&&this.resize((r*=2)>t?r:t),--t,this.view[t]=e,n&&(this.offset+=1),this},Y.writeUInt8=Y.writeUint8,Y.readUint8=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=this.view[e];return t&&(this.offset+=1),n},Y.readUInt8=Y.readUint8,Y.writeInt16=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var r=this.buffer.byteLength;return r<t&&this.resize((r*=2)>t?r:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),n&&(this.offset+=2),this},Y.writeShort=Y.writeInt16,Y.readInt16=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e],n|=this.view[e+1]<<8):(n=this.view[e]<<8,n|=this.view[e+1]),32768==(32768&n)&&(n=-(65535-n+1)),t&&(this.offset+=2),n},Y.readShort=Y.readInt16,Y.writeUint16=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var r=this.buffer.byteLength;return r<t&&this.resize((r*=2)>t?r:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),n&&(this.offset+=2),this},Y.writeUInt16=Y.writeUint16,Y.readUint16=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e],n|=this.view[e+1]<<8):(n=this.view[e]<<8,n|=this.view[e+1]),t&&(this.offset+=2),n},Y.readUInt16=Y.readUint16,Y.writeInt32=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return r<t&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),n&&(this.offset+=4),this},Y.writeInt=Y.writeInt32,Y.readInt32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0):(n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0),n|=0,t&&(this.offset+=4),n},Y.readInt=Y.readInt32,Y.writeUint32=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return r<t&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),n&&(this.offset+=4),this},Y.writeUInt32=Y.writeUint32,Y.readUint32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0):(n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0),t&&(this.offset+=4),n},Y.readUInt32=Y.readUint32,l&&(Y.writeInt64=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"==typeof e)e=l.fromNumber(e);else if("string"==typeof e)e=l.fromString(e);else if(!(e&&e instanceof l))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=l.fromNumber(e):"string"==typeof e&&(e=l.fromString(e)),t+=8;var r=this.buffer.byteLength;r<t&&this.resize((r*=2)>t?r:t),t-=8;var i=e.low,a=e.high;return this.littleEndian?(this.view[t+3]=i>>>24&255,this.view[t+2]=i>>>16&255,this.view[t+1]=i>>>8&255,this.view[t]=255&i,t+=4,this.view[t+3]=a>>>24&255,this.view[t+2]=a>>>16&255,this.view[t+1]=a>>>8&255,this.view[t]=255&a):(this.view[t]=a>>>24&255,this.view[t+1]=a>>>16&255,this.view[t+2]=a>>>8&255,this.view[t+3]=255&a,t+=4,this.view[t]=i>>>24&255,this.view[t+1]=i>>>16&255,this.view[t+2]=i>>>8&255,this.view[t+3]=255&i),n&&(this.offset+=8),this},Y.writeLong=Y.writeInt64,Y.readInt64=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var n=0,r=0;this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0,e+=4,r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0,e+=4,n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0);var i=new l(n,r,!1);return t&&(this.offset+=8),i},Y.readLong=Y.readInt64,Y.writeUint64=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"==typeof e)e=l.fromNumber(e);else if("string"==typeof e)e=l.fromString(e);else if(!(e&&e instanceof l))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=l.fromNumber(e):"string"==typeof e&&(e=l.fromString(e)),t+=8;var r=this.buffer.byteLength;r<t&&this.resize((r*=2)>t?r:t),t-=8;var i=e.low,a=e.high;return this.littleEndian?(this.view[t+3]=i>>>24&255,this.view[t+2]=i>>>16&255,this.view[t+1]=i>>>8&255,this.view[t]=255&i,t+=4,this.view[t+3]=a>>>24&255,this.view[t+2]=a>>>16&255,this.view[t+1]=a>>>8&255,this.view[t]=255&a):(this.view[t]=a>>>24&255,this.view[t+1]=a>>>16&255,this.view[t+2]=a>>>8&255,this.view[t+3]=255&a,t+=4,this.view[t]=i>>>24&255,this.view[t+1]=i>>>16&255,this.view[t+2]=i>>>8&255,this.view[t+3]=255&i),n&&(this.offset+=8),this},Y.writeUInt64=Y.writeUint64,Y.readUint64=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var n=0,r=0;this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0,e+=4,r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0,e+=4,n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0);var i=new l(n,r,!0);return t&&(this.offset+=8),i},Y.readUInt64=Y.readUint64),Y.writeFloat32=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return r<t&&this.resize((r*=2)>t?r:t),t-=4,Q(this.view,e,t,this.littleEndian,23,4),n&&(this.offset+=4),this},Y.writeFloat=Y.writeFloat32,Y.readFloat32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=K(this.view,e,this.littleEndian,23,4);return t&&(this.offset+=4),n},Y.readFloat=Y.readFloat32,Y.writeFloat64=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=8;var r=this.buffer.byteLength;return r<t&&this.resize((r*=2)>t?r:t),t-=8,Q(this.view,e,t,this.littleEndian,52,8),n&&(this.offset+=8),this},Y.writeDouble=Y.writeFloat64,Y.readFloat64=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var n=K(this.view,e,this.littleEndian,52,8);return t&&(this.offset+=8),n},Y.readDouble=Y.readFloat64,W.MAX_VARINT32_BYTES=5,W.calculateVarint32=function(e){return e>>>=0,e<128?1:e<16384?2:e<1<<21?3:e<1<<28?4:5},W.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},W.zigZagDecode32=function(e){return e>>>1^-(1&e)|0},Y.writeVarint32=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,i=W.calculateVarint32(e);t+=i;var a=this.buffer.byteLength;for(a<t&&this.resize((a*=2)>t?a:t),t-=i,e>>>=0;128<=e;)r=127&e|128,this.view[t++]=r,e>>>=7;return this.view[t++]=e,n?(this.offset=t,this):i},Y.writeVarint32ZigZag=function(e,t){return this.writeVarint32(W.zigZagEncode32(e),t)},Y.readVarint32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n,r=0,i=0;do{if(!this.noAssert&&e>this.limit){var a=Error("Truncated");throw a.truncated=!0,a}n=this.view[e++],r<5&&(i|=(127&n)<<7*r),++r}while(0!=(128&n));return i|=0,t?(this.offset=e,i):{value:i,length:r}},Y.readVarint32ZigZag=function(e){var t=this.readVarint32(e);return"object"===(0,O.default)(t)?t.value=W.zigZagDecode32(t.value):t=W.zigZagDecode32(t),t},l&&(W.MAX_VARINT64_BYTES=10,W.calculateVarint64=function(e){"number"==typeof e?e=l.fromNumber(e):"string"==typeof e&&(e=l.fromString(e));var t=e.toInt()>>>0,n=e.shiftRightUnsigned(28).toInt()>>>0,r=e.shiftRightUnsigned(56).toInt()>>>0;return 0==r?0==n?t<16384?t<128?1:2:t<1<<21?3:4:n<16384?n<128?5:6:n<1<<21?7:8:r<128?9:10},W.zigZagEncode64=function(e){return"number"==typeof e?e=l.fromNumber(e,!1):"string"==typeof e?e=l.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned()),e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()},W.zigZagDecode64=function(e){return"number"==typeof e?e=l.fromNumber(e,!1):"string"==typeof e?e=l.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned()),e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()},Y.writeVarint64=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"==typeof e)e=l.fromNumber(e);else if("string"==typeof e)e=l.fromString(e);else if(!(e&&e instanceof l))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=l.fromNumber(e,!1):"string"==typeof e?e=l.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned());var r=W.calculateVarint64(e),i=e.toInt()>>>0,a=e.shiftRightUnsigned(28).toInt()>>>0,o=e.shiftRightUnsigned(56).toInt()>>>0;t+=r;var s=this.buffer.byteLength;switch(s<t&&this.resize((s*=2)>t?s:t),t-=r,r){case 10:this.view[t+9]=o>>>7&1;case 9:this.view[t+8]=9!==r?128|o:127&o;case 8:this.view[t+7]=8!==r?a>>>21|128:a>>>21&127;case 7:this.view[t+6]=7!==r?a>>>14|128:a>>>14&127;case 6:this.view[t+5]=6!==r?a>>>7|128:a>>>7&127;case 5:this.view[t+4]=5!==r?128|a:127&a;case 4:this.view[t+3]=4!==r?i>>>21|128:i>>>21&127;case 3:this.view[t+2]=3!==r?i>>>14|128:i>>>14&127;case 2:this.view[t+1]=2!==r?i>>>7|128:i>>>7&127;case 1:this.view[t]=1!==r?128|i:127&i}return n?(this.offset+=r,this):r},Y.writeVarint64ZigZag=function(e,t){return this.writeVarint64(W.zigZagEncode64(e),t)},Y.readVarint64=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=e,r=0,i=0,a=0,o=0,o=this.view[e++],r=127&o;if(128&o&&(o=this.view[e++],r|=(127&o)<<7,(128&o||this.noAssert&&void 0===o)&&(o=this.view[e++],r|=(127&o)<<14,(128&o||this.noAssert&&void 0===o)&&(o=this.view[e++],r|=(127&o)<<21,(128&o||this.noAssert&&void 0===o)&&(o=this.view[e++],i=127&o,(128&o||this.noAssert&&void 0===o)&&(o=this.view[e++],i|=(127&o)<<7,(128&o||this.noAssert&&void 0===o)&&(o=this.view[e++],i|=(127&o)<<14,(128&o||this.noAssert&&void 0===o)&&(o=this.view[e++],i|=(127&o)<<21,(128&o||this.noAssert&&void 0===o)&&(o=this.view[e++],a=127&o,(128&o||this.noAssert&&void 0===o)&&(o=this.view[e++],a|=(127&o)<<7,128&o||this.noAssert&&void 0===o))))))))))throw Error("Buffer overrun");var s=l.fromBits(r|i<<28,i>>>4|a<<24,!1);return t?(this.offset=e,s):{value:s,length:e-n}},Y.readVarint64ZigZag=function(e){var t=this.readVarint64(e);return t&&t.value instanceof l?t.value=W.zigZagDecode64(t.value):t=W.zigZagDecode64(t),t}),Y.writeCString=function(e,t){var n,r=void 0===t;r&&(t=this.offset);var i,a=e.length;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(i=0;i<a;++i)if(0===e.charCodeAt(i))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}a=te.calculateUTF16asUTF8(Z(e))[1],t+=a+1;var o=this.buffer.byteLength;return o<t&&this.resize((o*=2)>t?o:t),t-=a+1,te.encodeUTF16toUTF8(Z(e),(0,C.default)(n=function(e){this.view[t++]=e}).call(n,this)),this.view[t++]=0,r?(this.offset=t,this):a},Y.readCString=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r,i=e,a=-1;return te.decodeUTF8toUTF16((0,C.default)(t=function(){if(0===a)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return a=this.view[e++],0===a?null:a}).call(t,this),r=J(),!0),n?(this.offset=e,r()):{string:r(),length:e-i}},Y.writeIString=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var i=t,a=te.calculateUTF16asUTF8(Z(e),this.noAssert)[1];t+=4+a;var o=this.buffer.byteLength;if(o<t&&this.resize((o*=2)>t?o:t),t-=4+a,this.littleEndian?(this.view[t+3]=a>>>24&255,this.view[t+2]=a>>>16&255,this.view[t+1]=a>>>8&255,this.view[t]=255&a):(this.view[t]=a>>>24&255,this.view[t+1]=a>>>16&255,this.view[t+2]=a>>>8&255,this.view[t+3]=255&a),t+=4,te.encodeUTF16toUTF8(Z(e),(0,C.default)(n=function(e){this.view[t++]=e}).call(n,this)),t!==i+4+a)throw RangeError("Illegal range: Truncated data, "+t+" == "+(t+4+a));return r?(this.offset=t,this):t-i},Y.readIString=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=e,r=this.readUint32(e),i=this.readUTF8String(r,W.METRICS_BYTES,e+=4);return e+=i.length,t?(this.offset=e,i.string):{string:i.string,length:e-n}},W.METRICS_CHARS="c",W.METRICS_BYTES="b",Y.writeUTF8String=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var i=t,a=te.calculateUTF16asUTF8(Z(e))[1];t+=a;var o=this.buffer.byteLength;return o<t&&this.resize((o*=2)>t?o:t),t-=a,te.encodeUTF16toUTF8(Z(e),(0,C.default)(n=function(e){this.view[t++]=e}).call(n,this)),r?(this.offset=t,this):t-i},Y.writeString=Y.writeUTF8String,W.calculateUTF8Chars=function(e){return te.calculateUTF16asUTF8(Z(e))[0]},W.calculateUTF8Bytes=function(e){return te.calculateUTF16asUTF8(Z(e))[1]},W.calculateString=W.calculateUTF8Bytes,Y.readUTF8String=function(e,t,n){"number"==typeof t&&(n=t,t=void 0);var r=void 0===n;if(r&&(n=this.offset),void 0===t&&(t=W.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,a=0,o=n;if(t===W.METRICS_CHARS){var s,l=J();if(te.decodeUTF8((0,C.default)(s=function(){return a<e&&n<this.limit?this.view[n++]:null}).call(s,this),function(e){++a,te.UTF8toUTF16(e,l)}),a!==e)throw RangeError("Illegal range: Truncated data, "+a+" == "+e);return r?(this.offset=n,l()):{string:l(),length:n-o}}if(t!==W.METRICS_BYTES)throw TypeError("Unsupported metrics: "+t);if(!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+"+e+") <= "+this.buffer.byteLength)}var u=n+e;if(te.decodeUTF8toUTF16((0,C.default)(i=function(){return n<u?this.view[n++]:null}).call(i,this),l=J(),this.noAssert),n!==u)throw RangeError("Illegal range: Truncated data, "+n+" == "+u);return r?(this.offset=n,l()):{string:l(),length:n-o}},Y.readString=Y.readUTF8String,Y.writeVString=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var i=t,a=te.calculateUTF16asUTF8(Z(e),this.noAssert)[1],o=W.calculateVarint32(a);t+=o+a;var s=this.buffer.byteLength;if(s<t&&this.resize((s*=2)>t?s:t),t-=o+a,t+=this.writeVarint32(a,t),te.encodeUTF16toUTF8(Z(e),(0,C.default)(n=function(e){this.view[t++]=e}).call(n,this)),t!==i+a+o)throw RangeError("Illegal range: Truncated data, "+t+" == "+(t+a+o));return r?(this.offset=t,this):t-i},Y.readVString=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=e,r=this.readVarint32(e),i=this.readUTF8String(r.value,W.METRICS_BYTES,e+=r.length);return e+=i.length,t?(this.offset=e,i.string):{string:i.string,length:e-n}},Y.append=function(e,t,n){"number"!=typeof t&&"string"==typeof t||(n=t,t=void 0);var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}e instanceof W||(e=W.wrap(e,t));var i=e.limit-e.offset;if(i<=0)return this;n+=i;var a=this.buffer.byteLength;return a<n&&this.resize((a*=2)>n?a:n),n-=i,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=i,r&&(this.offset+=i),this},Y.appendTo=function(e,t){return e.append(this,t),this},Y.assert=function(e){return this.noAssert=!e,this},Y.capacity=function(){return this.buffer.byteLength},Y.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},Y.clone=function(e){var t=new W(0,this.littleEndian,this.noAssert);return e?(t.buffer=new ArrayBuffer(this.buffer.byteLength),t.view=new Uint8Array(t.buffer)):(t.buffer=this.buffer,t.view=this.view),t.offset=this.offset,t.markedOffset=this.markedOffset,t.limit=this.limit,t},Y.compact=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||t<e||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(0===e&&t===this.buffer.byteLength)return this;var n=t-e;if(0===n)return this.buffer=q,this.view=null,0<=this.markedOffset&&(this.markedOffset-=e),this.offset=0,this.limit=0,this;var r=new ArrayBuffer(n),i=new Uint8Array(r);return i.set(this.view.subarray(e,t)),this.buffer=r,this.view=i,0<=this.markedOffset&&(this.markedOffset-=e),this.offset=0,this.limit=n,this},Y.copy=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||t<e||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(e===t)return new W(0,this.littleEndian,this.noAssert);var n=t-e,r=new W(n,this.littleEndian,this.noAssert);return r.offset=0,r.limit=n,0<=r.markedOffset&&(r.markedOffset-=e),this.copyTo(r,0,e,t),r},Y.copyTo=function(e,t,n,r){var i,a;if(!this.noAssert&&!W.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(a=void 0===t)?e.offset:0|t,n=(i=void 0===n)?this.offset:0|n,r=void 0===r?this.limit:0|r,t<0||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(n<0||r>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);var o=r-n;return 0===o?e:(e.ensureCapacity(t+o),e.view.set(this.view.subarray(n,r),t),i&&(this.offset+=o),a&&(e.offset+=o),this)},Y.ensureCapacity=function(e){var t=this.buffer.byteLength;return t<e?this.resize((t*=2)>e?t:e):this},Y.fill=function(e,t,n){var r=void 0===t;if(r&&(t=this.offset),"string"==typeof e&&0<e.length&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===n&&(n=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal end: Not an integer");if(n>>>=0,t<0||n<t||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(n<=t)return this;for(;t<n;)this.view[t++]=e;return r&&(this.offset=t),this},Y.flip=function(){return this.limit=this.offset,this.offset=0,this},Y.mark=function(e){if(e=void 0===e?this.offset:e,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=e,this},Y.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},Y.LE=function(e){return this.littleEndian=void 0===e||!!e,this},Y.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},Y.prepend=function(e,t,n){"number"!=typeof t&&"string"==typeof t||(n=t,t=void 0);var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}e instanceof W||(e=W.wrap(e,t));var i=e.limit-e.offset;if(i<=0)return this;var a,o,s=i-n;return 0<s?(a=new ArrayBuffer(this.buffer.byteLength+s),o=new Uint8Array(a),o.set(this.view.subarray(n,this.buffer.byteLength),i),this.buffer=a,this.view=o,this.offset+=s,0<=this.markedOffset&&(this.markedOffset+=s),this.limit+=s,n+=s):new Uint8Array(this.buffer),this.view.set(e.view.subarray(e.offset,e.limit),n-i),e.offset=e.limit,r&&(this.offset-=i),this},Y.prependTo=function(e,t){return e.prepend(this,t),this},Y.printDebug=function(e){var t;"function"!=typeof e&&(e=(0,C.default)(t=console.log).call(t,console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},Y.remaining=function(){return this.limit-this.offset},Y.reset=function(){return 0<=this.markedOffset?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},Y.resize=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if(e|=0,e<0)throw RangeError("Illegal capacity: 0 <= "+e)}var t,n;return this.buffer.byteLength<e&&(t=new ArrayBuffer(e),n=new Uint8Array(t),n.set(this.view),this.buffer=t,this.view=n),this},Y.reverse=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||t<e||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t||(0,r.default)(Array.prototype).call(this.view.subarray(e,t)),this},Y.skip=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(t<0||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},Y.slice=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||t<e||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var n=this.clone();return n.offset=e,n.limit=t,n},Y.toBuffer=function(e){var t=this.offset,n=this.limit;if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal limit: Not an integer");if(n>>>=0,t<0||n<t||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(!e&&0===t&&n===this.buffer.byteLength)return this.buffer;if(t===n)return q;var r=new ArrayBuffer(n-t);return new Uint8Array(r).set(new Uint8Array(this.buffer).subarray(t,n),0),r},Y.toArrayBuffer=Y.toBuffer,Y.toString=function(e,t,n){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(e="utf8",t=e,n=t),e){case"utf8":return this.toUTF8(t,n);case"base64":return this.toBase64(t,n);case"hex":return this.toHex(t,n);case"binary":return this.toBinary(t,n);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}};var $=function(){for(var e={},i=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],o=[],t=0,n=i.length;t<n;++t)o[i[t]]=t;return e.encode=function(e,t){for(var n,r;null!==(n=e());)t(i[n>>2&63]),r=(3&n)<<4,null!==(n=e())?(r|=n>>4&15,t(i[63&(r|n>>4&15)]),r=(15&n)<<2,null!==(n=e())?(t(i[63&(r|n>>6&3)]),t(i[63&n])):(t(i[63&r]),t(61))):(t(i[63&r]),t(61),t(61))},e.decode=function(e,t){var n,r,i;function a(e){throw Error("Illegal character code: "+e)}for(;null!==(n=e());)if(r=o[n],void 0===r&&a(n),null!==(n=e())&&(i=o[n],void 0===i&&a(n),t(r<<2>>>0|(48&i)>>4),null!==(n=e()))){if(r=o[n],void 0===r){if(61===n)break;a(n)}if(t((15&i)<<4>>>0|(60&r)>>2),null!==(n=e())){if(i=o[n],void 0===i){if(61===n)break;a(n)}t((3&r)<<6>>>0|i)}}},e.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)},e}();Y.toBase64=function(e,t){var n,r;if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),e|=0,t|=0,e<0||t>this.capacity||t<e)throw RangeError("begin, end");return $.encode((0,C.default)(n=function(){return e<t?this.view[e++]:null}).call(n,this),r=J()),r()},W.fromBase64=function(e,t){if("string"!=typeof e)throw TypeError("str");var n=new W(e.length/4*3,t),r=0;return $.decode(Z(e),function(e){n.view[r++]=e}),n.limit=r,n},W.btoa=function(e){return W.fromBinary(e).toBase64()},W.atob=function(e){return W.fromBase64(e).toBinary()},Y.toBinary=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),e|=0,t|=0,e<0||t>this.capacity()||t<e)throw RangeError("begin, end");if(e===t)return"";for(var n=[],r=[];e<t;)n.push(this.view[e++]),1024<=n.length&&(r.push(String.fromCharCode.apply(String,n)),n=[]);return r.join("")+String.fromCharCode.apply(String,n)},W.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var n,r=0,i=e.length,a=new W(i,t);r<i;){if(n=e.charCodeAt(r),255<n)throw RangeError("illegal char code: "+n);a.view[r++]=n}return a.limit=i,a},Y.toDebug=function(e){for(var t,n=-1,r=this.buffer.byteLength,i="",a="",o="";n<r;){if(-1!==n&&(t=this.view[n],i+=t<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(a+=32<t&&t<127?String.fromCharCode(t):".")),++n,e&&0<n&&n%16==0&&n!==r){for(;i.length<51;)i+=" ";o+=i+a+"\n",i=a=""}n===this.offset&&n===this.limit?i+=n===this.markedOffset?"!":"|":n===this.offset?i+=n===this.markedOffset?"[":"<":n===this.limit?i+=n===this.markedOffset?"]":">":i+=n===this.markedOffset?"'":e||0!==n&&n!==r?" ":""}if(e&&" "!==i){for(;i.length<51;)i+=" ";o+=i+a+"\n"}return e?o:i},W.fromDebug=function(e,t,n){for(var r,i,a=e.length,o=new W((a+1)/3|0,t,n),s=0,l=0,u=!1,h=!1,c=!1,d=!1,f=!1;s<a;){switch(r=e.charAt(s++)){case"!":if(!n){if(h||c||d){f=!0;break}h=c=d=!0}o.offset=o.markedOffset=o.limit=l,u=!1;break;case"|":if(!n){if(h||d){f=!0;break}h=d=!0}o.offset=o.limit=l,u=!1;break;case"[":if(!n){if(h||c){f=!0;break}h=c=!0}o.offset=o.markedOffset=l,u=!1;break;case"<":if(!n){if(h){f=!0;break}h=!0}o.offset=l,u=!1;break;case"]":if(!n){if(d||c){f=!0;break}d=c=!0}o.limit=o.markedOffset=l,u=!1;break;case">":if(!n){if(d){f=!0;break}d=!0}o.limit=l,u=!1;break;case"'":if(!n){if(c){f=!0;break}c=!0}o.markedOffset=l,u=!1;break;case" ":u=!1;break;default:if(!n&&u){f=!0;break}if(i=(0,F.default)(r+e.charAt(s++),16),!n&&(isNaN(i)||i<0||255<i))throw TypeError("Illegal str: Not a debug encoded string");o.view[l++]=i,u=!0}if(f)throw TypeError("Illegal str: Invalid symbol at "+s)}if(!n){if(!h||!d)throw TypeError("Illegal str: Missing offset or limit");if(l<o.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+l+" < "+a)}return o},Y.toHex=function(e,t){if(e=void 0===e?this.offset:e,t=void 0===t?this.limit:t,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||t<e||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var n,r=new Array(t-e);e<t;)n=this.view[e++],n<16?r.push("0",n.toString(16)):r.push(n.toString(16));return r.join("")},W.fromHex=function(e,t,n){if(!n){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if(e.length%2!=0)throw TypeError("Illegal str: Length not a multiple of 2")}for(var r,i=e.length,a=new W(i/2|0,t),o=0,s=0;o<i;o+=2){if(r=(0,F.default)(e.substring(o,o+2),16),!n&&(!isFinite(r)||r<0||255<r))throw TypeError("Illegal str: Contains non-hex characters");a.view[s++]=r}return a.limit=s,a};var ee,te=(ee={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<128?t(127&n):(n<2048?t(n>>6&31|192):(n<65536?t(n>>12&15|224):(t(n>>18&7|240),t(n>>12&63|128)),t(n>>6&63|128)),t(63&n|128)),n=null},decodeUTF8:function(e,t){for(var n,r,i,a,o=function(e){e=(0,D.default)(e).call(e,0,(0,B.default)(e).call(e,null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(n=e());)if(0==(128&n))t(n);else if(192==(224&n))null===(r=e())&&o([n,r]),t((31&n)<<6|63&r);else if(224==(240&n))null!==(r=e())&&null!==(i=e())||o([n,r,i]),t((15&n)<<12|(63&r)<<6|63&i);else{if(240!=(248&n))throw RangeError("Illegal starting byte: "+n);null!==(r=e())&&null!==(i=e())&&null!==(a=e())||o([n,r,i,a]),t((7&n)<<18|(63&r)<<12|(63&i)<<6|63&a)}},UTF16toUTF8:function(e,t){for(var n,r=null;null!==(n=null!==r?r:e());)55296<=n&&n<=57343&&null!==(r=e())&&56320<=r&&r<=57343?(t(1024*(n-55296)+r-56320+65536),r=null):t(n);null!==r&&t(r)},UTF8toUTF16:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<=65535?t(n):(n-=65536,t(55296+(n>>10)),t(n%1024+56320)),n=null},encodeUTF16toUTF8:function(e,t){ee.UTF16toUTF8(e,function(e){ee.encodeUTF8(e,t)})},decodeUTF8toUTF16:function(e,t){ee.decodeUTF8(e,function(e){ee.UTF8toUTF16(e,t)})},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,n=0;null!==(t=e());)n+=t<128?1:t<2048?2:t<65536?3:4;return n},calculateUTF16asUTF8:function(e){var t=0,n=0;return ee.UTF16toUTF8(e,function(e){++t,n+=e<128?1:e<2048?2:e<65536?3:4}),[t,n]}},ee);Y.toUTF8=function(t,n){if(void 0===t&&(t=this.offset),void 0===n&&(n=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal end: Not an integer");if(n>>>=0,t<0||n<t||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}var e,r;try{te.decodeUTF8toUTF16((0,C.default)(r=function(){return t<n?this.view[t++]:null}).call(r,this),e=J())}catch(e){if(t!==n)throw RangeError("Illegal range: Truncated data, "+t+" != "+n)}return e()},W.fromUTF8=function(e,t,n){if(!n&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var r=new W(te.calculateUTF16asUTF8(Z(e),!0)[1],t,n),i=0;return te.encodeUTF16toUTF8(Z(e),function(e){r.view[i++]=e}),r.limit=i,r};var ne,re,ie,ae,oe,se,le,ue,he,ce={};function de(t){var e,n;t.messages&&(0,L.default)(e=t.messages).call(e,function(e){e.syntax=t.syntax,de(e)}),t.enums&&(0,L.default)(n=t.enums).call(n,function(e){e.syntax=t.syntax})}function fe(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}pe.ProtoBuf=ce,ce.ByteBuffer=W,ce.Long=W.Long||null,ce.VERSION="5.0.1",ce.WIRE_TYPES={},ce.WIRE_TYPES.VARINT=0,ce.WIRE_TYPES.BITS64=1,ce.WIRE_TYPES.LDELIM=2,ce.WIRE_TYPES.STARTGROUP=3,ce.WIRE_TYPES.ENDGROUP=4,ce.WIRE_TYPES.BITS32=5,ce.PACKABLE_WIRE_TYPES=[ce.WIRE_TYPES.VARINT,ce.WIRE_TYPES.BITS64,ce.WIRE_TYPES.BITS32],ce.TYPES={int32:{name:"int32",wireType:ce.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:ce.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:ce.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:ce.WIRE_TYPES.VARINT,defaultValue:ce.Long?ce.Long.ZERO:void 0},uint64:{name:"uint64",wireType:ce.WIRE_TYPES.VARINT,defaultValue:ce.Long?ce.Long.UZERO:void 0},sint64:{name:"sint64",wireType:ce.WIRE_TYPES.VARINT,defaultValue:ce.Long?ce.Long.ZERO:void 0},bool:{name:"bool",wireType:ce.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:ce.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:ce.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:ce.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:ce.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:ce.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:ce.WIRE_TYPES.BITS64,defaultValue:ce.Long?ce.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:ce.WIRE_TYPES.BITS64,defaultValue:ce.Long?ce.Long.ZERO:void 0},float:{name:"float",wireType:ce.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:ce.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:ce.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:ce.WIRE_TYPES.STARTGROUP,defaultValue:null}},ce.MAP_KEY_TYPES=[ce.TYPES.int32,ce.TYPES.sint32,ce.TYPES.sfixed32,ce.TYPES.uint32,ce.TYPES.fixed32,ce.TYPES.int64,ce.TYPES.sint64,ce.TYPES.sfixed64,ce.TYPES.uint64,ce.TYPES.fixed64,ce.TYPES.bool,ce.TYPES.string,ce.TYPES.bytes],ce.ID_MIN=1,ce.ID_MAX=536870911,ce.convertFieldsToCamelCase=!1,ce.populateAccessors=!0,ce.populateDefaults=!0,ce.Util=(ne={},ne.IS_NODE=!("object"!==(void 0===e?"undefined":(0,O.default)(e))||e+""!="[object process]"||e.browser),ne.XHR=function(){for(var e=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],t=null,n=0;n<e.length;n++){try{t=e[n]()}catch(e){continue}break}if(!t)throw Error("XMLHttpRequest is not supported");return t},ne.fetch=function(e,n){if(n&&"function"!=typeof n&&(n=null),ne.IS_NODE){var t=me(480);if(n)t.readFile(e,function(e,t){n(e?null:""+t)});else try{return t.readFileSync(e)}catch(e){return null}}else{var r=ne.XHR();if(r.open("GET",e,!!n),r.setRequestHeader("Accept","text/plain"),"function"==typeof r.overrideMimeType&&r.overrideMimeType("text/plain"),!n)return r.send(null),200==r.status||0==r.status&&"string"==typeof r.responseText?r.responseText:null;if(r.onreadystatechange=function(){4==r.readyState&&(200==r.status||0==r.status&&"string"==typeof r.responseText?n(r.responseText):n(null))},4==r.readyState)return;r.send(null)}},ne.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,function(e,t){return t.toUpperCase()})},ne),ce.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g},ce.DotProto=function(i,o){var e={},t=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},n=t.prototype;n._readString=function(){var e='"'===this._stringOpen?o.STRING_DQ:o.STRING_SQ;e.lastIndex=this.index-1;var t=e.exec(this.source);if(!t)throw Error("unterminated string");return this.index=e.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,t[1]},n.next=function(){if(0<this.stack.length)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();var e,t,n;do{for(e=!1;o.WHITESPACE.test(n=this.source.charAt(this.index));)if("\n"===n&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,e=!0}else{if("*"!==(n=this.source.charAt(this.index)))return"/";do{if("\n"===n&&++this.line,++this.index===this.source.length)return null;t=n,n=this.source.charAt(this.index)}while("*"!==t||"/"!==n);++this.index,e=!0}}while(e);if(this.index===this.source.length)return null;var r=this.index;o.DELIM.lastIndex=0;var i=o.DELIM.test(this.source.charAt(r++));if(!i)for(;r<this.source.length&&!o.DELIM.test(this.source.charAt(r));)++r;var a=this.source.substring(this.index,this.index=r);return'"'!==a&&"'"!==a||(this._stringOpen=a),a},n.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},n.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},n.omit=function(e){return this.peek()===e&&(this.next(),!0)},n.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},e.Tokenizer=t;var r=function(e){this.tn=new t(e),this.proto3=!1},a=r.prototype;function s(e,t){var n=-1,r=1;if("-"==e.charAt(0)&&(r=-1,e=e.substring(1)),o.NUMBER_DEC.test(e))n=(0,F.default)(e);else if(o.NUMBER_HEX.test(e))n=(0,F.default)(e.substring(2),16);else{if(!o.NUMBER_OCT.test(e))throw Error("illegal id value: "+(r<0?"-":"")+e);n=(0,F.default)(e.substring(1),8)}if(n=r*n|0,!t&&n<0)throw Error("illegal id value: "+(r<0?"-":"")+e);return n}function l(e){var t=1;if("-"==e.charAt(0)&&(t=-1,e=e.substring(1)),o.NUMBER_DEC.test(e))return t*(0,F.default)(e,10);if(o.NUMBER_HEX.test(e))return t*(0,F.default)(e.substring(2),16);if(o.NUMBER_OCT.test(e))return t*(0,F.default)(e.substring(1),8);if("inf"===e)return Infinity*t;if("nan"===e)return NaN;if(o.NUMBER_FLT.test(e))return t*(0,h.default)(e);throw Error("illegal number value: "+(t<0?"-":"")+e)}function u(e,t,n){void 0===e[t]?e[t]=n:((0,P.default)(e[t])||(e[t]=[e[t]]),e[t].push(n))}return a.parse=function(){var e,t,n={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},r=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!r||null!==n.package)throw Error("unexpected 'package'");if(e=this.tn.next(),!o.TYPEREF.test(e))throw Error("illegal package name: "+e);this.tn.skip(";"),n.package=e;break;case"import":if(!r)throw Error("unexpected 'import'");e=this.tn.peek(),"public"!==e&&!(t="weak"===e)||this.tn.next(),e=this._readString(),this.tn.skip(";"),t||n.imports.push(e);break;case"syntax":if(!r)throw Error("unexpected 'syntax'");this.tn.skip("="),"proto3"===(n.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(n,null),r=!1;break;case"enum":this._parseEnum(n),r=!1;break;case"option":this._parseOption(n);break;case"service":this._parseService(n);break;case"extend":this._parseExtend(n);break;default:throw Error("unexpected '"+e+"'")}}catch(e){throw e.message="Parse error at line "+this.tn.line+": "+e.message,e}return delete n.name,n},r.parse=function(e){return new r(e).parse()},a._readString=function(){var e,t,n="";do{if(t=this.tn.next(),"'"!==t&&'"'!==t)throw Error("illegal string delimiter: "+t);n+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return n},a._readValue=function(e){var t=this.tn.peek();if('"'===t||"'"===t)return this._readString();if(this.tn.next(),o.NUMBER.test(t))return l(t);if(o.BOOL.test(t))return"true"===t.toLowerCase();if(e&&o.TYPEREF.test(t))return t;throw Error("illegal value: "+t)},a._parseOption=function(e,t){var n=this.tn.next(),r=!1;if("("===n&&(r=!0,n=this.tn.next()),!o.TYPEREF.test(n))throw Error("illegal option name: "+n);var i=n;r&&(this.tn.skip(")"),i="("+i+")",n=this.tn.peek(),o.FQTYPEREF.test(n)&&(i+=n,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,i),t||this.tn.skip(";")},a._parseOptionValue=function(e,t){var n=this.tn.peek();if("{"!==n)u(e.options,t,this._readValue(!0));else for(this.tn.skip("{");"}"!==(n=this.tn.next());){if(!o.NAME.test(n))throw Error("illegal option name: "+t+"."+n);this.tn.omit(":")?u(e.options,t+"."+n,this._readValue(!0)):this._parseOptionValue(e,t+"."+n)}},a._parseService=function(e){var t=this.tn.next();if(!o.NAME.test(t))throw Error("illegal service name at line "+this.tn.line+": "+t);var n=t,r={name:n,rpc:{},options:{}};for(this.tn.skip("{");"}"!==(t=this.tn.next());)if("option"===t)this._parseOption(r);else{if("rpc"!==t)throw Error("illegal service token: "+t);this._parseServiceRPC(r)}this.tn.omit(";"),e.services.push(r)},a._parseServiceRPC=function(e){var t="rpc",n=this.tn.next();if(!o.NAME.test(n))throw Error("illegal rpc service method name: "+n);var r=n,i={request:null,response:null,request_stream:!1,response_stream:!1,options:{}};if(this.tn.skip("("),n=this.tn.next(),"stream"===n.toLowerCase()&&(i.request_stream=!0,n=this.tn.next()),!o.TYPEREF.test(n))throw Error("illegal rpc service request type: "+n);if(i.request=n,this.tn.skip(")"),n=this.tn.next(),"returns"!==n.toLowerCase())throw Error("illegal rpc service request type delimiter: "+n);if(this.tn.skip("("),n=this.tn.next(),"stream"===n.toLowerCase()&&(i.response_stream=!0,n=this.tn.next()),i.response=n,this.tn.skip(")"),n=this.tn.peek(),"{"===n){for(this.tn.next();"}"!==(n=this.tn.next());){if("option"!==n)throw Error("illegal rpc service token: "+n);this._parseOption(i)}this.tn.omit(";")}else this.tn.skip(";");void 0===e[t]&&(e[t]={}),e[t][r]=i},a._parseMessage=function(e,t){var n=!!t,r=this.tn.next(),i={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!o.NAME.test(r))throw Error("illegal "+(n?"group":"message")+" name: "+r);for(i.name=r,n&&(this.tn.skip("="),t.id=s(this.tn.next()),i.isGroup=!0),r=this.tn.peek(),"["===r&&t&&this._parseFieldOptions(t),this.tn.skip("{");"}"!==(r=this.tn.next());)if(o.RULE.test(r))this._parseMessageField(i,r);else if("oneof"===r)this._parseMessageOneOf(i);else if("enum"===r)this._parseEnum(i);else if("message"===r)this._parseMessage(i);else if("option"===r)this._parseOption(i);else if("service"===r)this._parseService(i);else if("extensions"===r)i.extensions=this._parseExtensionRanges();else if("reserved"===r)this._parseIgnored();else if("extend"===r)this._parseExtend(i);else{if(!o.TYPEREF.test(r))throw Error("illegal message token: "+r);if(!this.proto3)throw Error("illegal field rule: "+r);this._parseMessageField(i,"optional",r)}return this.tn.omit(";"),e.messages.push(i),i},a._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},a._parseMessageField=function(e,t,n){if(!o.RULE.test(t))throw Error("illegal message field rule: "+t);var r,i={rule:t,type:"",name:"",options:{},id:0};if("map"===t){if(n)throw Error("illegal type: "+n);if(this.tn.skip("<"),r=this.tn.next(),!o.TYPE.test(r)&&!o.TYPEREF.test(r))throw Error("illegal message field type: "+r);if(i.keytype=r,this.tn.skip(","),r=this.tn.next(),!o.TYPE.test(r)&&!o.TYPEREF.test(r))throw Error("illegal message field: "+r);if(i.type=r,this.tn.skip(">"),r=this.tn.next(),!o.NAME.test(r))throw Error("illegal message field name: "+r);i.name=r,this.tn.skip("="),i.id=s(this.tn.next()),r=this.tn.peek(),"["===r&&this._parseFieldOptions(i),this.tn.skip(";")}else if(n=void 0!==n?n:this.tn.next(),"group"===n){var a=this._parseMessage(e,i);if(!/^[A-Z]/.test(a.name))throw Error("illegal group name: "+a.name);i.type=a.name,i.name=a.name.toLowerCase(),this.tn.omit(";")}else{if(!o.TYPE.test(n)&&!o.TYPEREF.test(n))throw Error("illegal message field type: "+n);if(i.type=n,r=this.tn.next(),!o.NAME.test(r))throw Error("illegal message field name: "+r);i.name=r,this.tn.skip("="),i.id=s(this.tn.next()),r=this.tn.peek(),"["===r&&this._parseFieldOptions(i),this.tn.skip(";")}return e.fields.push(i),i},a._parseMessageOneOf=function(e){var t=this.tn.next();if(!o.NAME.test(t))throw Error("illegal oneof name: "+t);var n,r=t,i=[];for(this.tn.skip("{");"}"!==(t=this.tn.next());)n=this._parseMessageField(e,"optional",t),n.oneof=r,i.push(n.id);this.tn.omit(";"),e.oneofs[r]=i},a._parseFieldOptions=function(e){this.tn.skip("[");for(var t=!0;"]"!==this.tn.peek();)t||this.tn.skip(","),this._parseOption(e,!0),t=!1;this.tn.next()},a._parseEnum=function(e){var t={name:"",values:[],options:{}},n=this.tn.next();if(!o.NAME.test(n))throw Error("illegal name: "+n);for(t.name=n,this.tn.skip("{");"}"!==(n=this.tn.next());)if("option"===n)this._parseOption(t);else{if(!o.NAME.test(n))throw Error("illegal name: "+n);this.tn.skip("=");var r={name:n,id:s(this.tn.next(),!0)},n=this.tn.peek();"["===n&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),(0,p.default)(t).push(r)}this.tn.omit(";"),e.enums.push(t)},a._parseExtensionRanges=function(){var e,t,n,r=[];do{for(t=[];;){switch(e=this.tn.next(),e){case"min":n=i.ID_MIN;break;case"max":n=i.ID_MAX;break;default:n=l(e)}if(t.push(n),2===t.length)break;if("to"!==this.tn.peek()){t.push(n);break}this.tn.next()}r.push(t)}while(this.tn.omit(","));return this.tn.skip(";"),r},a._parseExtend=function(e){var t=this.tn.next();if(!o.TYPEREF.test(t))throw Error("illegal extend reference: "+t);var n={ref:t,fields:[]};for(this.tn.skip("{");"}"!==(t=this.tn.next());)if(o.RULE.test(t))this._parseMessageField(n,t);else{if(!o.TYPEREF.test(t))throw Error("illegal extend token: "+t);if(!this.proto3)throw Error("illegal field rule: "+t);this._parseMessageField(n,"optional",t)}return this.tn.omit(";"),e.messages.push(n),n},a.toString=function(){return"Parser at line "+this.tn.line},e.Parser=r,e}(ce,ce.Lang),ce.Reflect=function(m){var o={},h=function(e,t,n){this.builder=e,this.parent=t,this.name=n,this.className},e=h.prototype;e.fqn=function(){for(var e=this.name,t=this;t=t.parent,null!=t;)e=t.name+"."+e;return e},e.toString=function(e){return(e?this.className+" ":"")+this.fqn()},e.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},o.T=h;var s=function(e,t,n,r,i){h.call(this,e,t,n),this.className="Namespace",this.children=[],this.options=r||{},this.syntax=i||"proto2"},t=s.prototype=(0,k.default)(h.prototype);t.getChildren=function(e){var t;if(e=e||null,null==e)return(0,D.default)(t=this.children).call(t);for(var n=[],r=0,i=this.children.length;r<i;++r)this.children[r]instanceof e&&n.push(this.children[r]);return n},t.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof c.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof c.Field&&e.name!==e.originalName&&null===this.getChild(e.originalName)))throw Error("Duplicate name in namespace "+this.toString(!0)+": "+e.name);e.name=e.originalName}this.children.push(e)},t.getChild=function(e){for(var t="number"==typeof e?"id":"name",n=0,r=this.children.length;n<r;++n)if(this.children[n][t]===e)return this.children[n];return null},t.resolve=function(e,t){var n,r="string"==typeof e?e.split("."):e,i=this,a=0;if(""===r[a]){for(;null!==i.parent;)i=i.parent;a++}do{do{if(!(i instanceof o.Namespace)){i=null;break}if(n=i.getChild(r[a]),!n||!(n instanceof o.T)||t&&!(n instanceof o.Namespace)){i=null;break}i=n,a++}while(a<r.length);if(null!=i)break;if(null!==this.parent)return this.parent.resolve(e,t)}while(null!=i);return i},t.qn=function(e){for(var t=[],n=e;t.unshift(n.name),n=n.parent,null!==n;);for(var r=1;r<=t.length;r++){var i=(0,D.default)(t).call(t,t.length-r);if(e===this.resolve(i,e instanceof o.Namespace))return i.join(".")}return e.fqn()},t.build=function(){for(var e,t={},n=this.children,r=0,i=n.length;r<i;++r)e=n[r],e instanceof s&&(t[e.name]=e.build());return U.default&&(0,U.default)(t,"$options",{value:this.buildOpt()}),t},t.buildOpt=function(){for(var e={},t=(0,N.default)(this.options),n=0,r=t.length;n<r;++n){var i=t[n],a=this.options[t[n]];e[i]=a}return e},t.getOption=function(e){return void 0===e?this.options:void 0!==this.options[e]?this.options[e]:null},o.Namespace=s;var d=function(e,t,n,r){var i;if(this.type=e,this.resolvedType=t,this.isMapKey=n,this.syntax=r,n&&(0,B.default)(i=m.MAP_KEY_TYPES).call(i,e)<0)throw Error("Invalid map key type: "+e.name)},n=d.prototype;function r(e){if("string"==typeof e&&(e=m.TYPES[e]),void 0===e.defaultValue)throw Error("default value for type "+e.name+" is not supported");return e==m.TYPES.bytes?new W(0):e.defaultValue}function l(e,t){if(e&&"number"==typeof e.low&&"number"==typeof e.high&&"boolean"==typeof e.unsigned&&e.low==e.low&&e.high==e.high)return new m.Long(e.low,e.high,void 0===t?e.unsigned:t);if("string"==typeof e)return m.Long.fromString(e,t||!1,10);if("number"==typeof e)return m.Long.fromNumber(e,t||!1);throw Error("not convertible to Long")}d.defaultFieldValue=r,n.verifyValue=function(t){var n=this;function r(e,t){throw Error("Illegal value for "+n.toString(!0)+" of type "+n.type.name+": "+e+" ("+t+")")}switch(this.type){case m.TYPES.int32:case m.TYPES.sint32:case m.TYPES.sfixed32:return("number"!=typeof t||t==t&&t%1!=0)&&r((0,O.default)(t),"not an integer"),4294967295<t?0|t:t;case m.TYPES.uint32:case m.TYPES.fixed32:return("number"!=typeof t||t==t&&t%1!=0)&&r((0,O.default)(t),"not an integer"),t<0?t>>>0:t;case m.TYPES.int64:case m.TYPES.sint64:case m.TYPES.sfixed64:if(m.Long)try{return l(t,!1)}catch(e){r((0,O.default)(t),e.message)}else r((0,O.default)(t),"requires Long.js");case m.TYPES.uint64:case m.TYPES.fixed64:if(m.Long)try{return l(t,!0)}catch(e){r((0,O.default)(t),e.message)}else r((0,O.default)(t),"requires Long.js");case m.TYPES.bool:return"boolean"!=typeof t&&r((0,O.default)(t),"not a boolean"),t;case m.TYPES.float:case m.TYPES.double:return"number"!=typeof t&&r((0,O.default)(t),"not a number"),t;case m.TYPES.string:return"string"==typeof t||t&&t instanceof String||r((0,O.default)(t),"not a string"),""+t;case m.TYPES.bytes:return W.isByteBuffer(t)?t:W.wrap(t,"base64");case m.TYPES.enum:for(var e=this.resolvedType.getChildren(m.Reflect.Enum.Value),i=0;i<e.length;i++){if(e[i].name==t)return e[i].id;if(e[i].id==t)return e[i].id}if("proto3"===this.syntax)return("number"!=typeof t||t==t&&t%1!=0)&&r((0,O.default)(t),"not an integer"),(4294967295<t||t<0)&&r((0,O.default)(t),"not in range for uint32"),t;r(t,"not a valid enum value");case m.TYPES.group:case m.TYPES.message:if(t&&"object"===(0,O.default)(t)||r((0,O.default)(t),"object expected"),t instanceof this.resolvedType.clazz)return t;if(t instanceof m.Builder.Message){var a={};for(i in t)t.hasOwnProperty(i)&&(a[i]=t[i]);t=a}return new this.resolvedType.clazz(t)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+t+" (undefined type "+this.type+")")},n.calculateLength=function(e,t){if(null===t)return 0;var n;switch(this.type){case m.TYPES.int32:return t<0?W.calculateVarint64(t):W.calculateVarint32(t);case m.TYPES.uint32:return W.calculateVarint32(t);case m.TYPES.sint32:return W.calculateVarint32(W.zigZagEncode32(t));case m.TYPES.fixed32:case m.TYPES.sfixed32:case m.TYPES.float:return 4;case m.TYPES.int64:case m.TYPES.uint64:return W.calculateVarint64(t);case m.TYPES.sint64:return W.calculateVarint64(W.zigZagEncode64(t));case m.TYPES.fixed64:case m.TYPES.sfixed64:return 8;case m.TYPES.bool:return 1;case m.TYPES.enum:return W.calculateVarint32(t);case m.TYPES.double:return 8;case m.TYPES.string:return n=W.calculateUTF8Bytes(t),W.calculateVarint32(n)+n;case m.TYPES.bytes:if(t.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+t.remaining()+" bytes remaining");return W.calculateVarint32(t.remaining())+t.remaining();case m.TYPES.message:return n=this.resolvedType.calculate(t),W.calculateVarint32(n)+n;case m.TYPES.group:return n=this.resolvedType.calculate(t),n+W.calculateVarint32(e<<3|m.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+t+" (unknown type)")},n.encodeValue=function(e,t,n){if(null===t)return n;switch(this.type){case m.TYPES.int32:t<0?n.writeVarint64(t):n.writeVarint32(t);break;case m.TYPES.uint32:n.writeVarint32(t);break;case m.TYPES.sint32:n.writeVarint32ZigZag(t);break;case m.TYPES.fixed32:n.writeUint32(t);break;case m.TYPES.sfixed32:n.writeInt32(t);break;case m.TYPES.int64:case m.TYPES.uint64:n.writeVarint64(t);break;case m.TYPES.sint64:n.writeVarint64ZigZag(t);break;case m.TYPES.fixed64:n.writeUint64(t);break;case m.TYPES.sfixed64:n.writeInt64(t);break;case m.TYPES.bool:"string"==typeof t?n.writeVarint32("false"===t.toLowerCase()?0:!!t):n.writeVarint32(t?1:0);break;case m.TYPES.enum:n.writeVarint32(t);break;case m.TYPES.float:n.writeFloat32(t);break;case m.TYPES.double:n.writeFloat64(t);break;case m.TYPES.string:n.writeVString(t);break;case m.TYPES.bytes:if(t.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+t.remaining()+" bytes remaining");var r=t.offset;n.writeVarint32(t.remaining()),n.append(t),t.offset=r;break;case m.TYPES.message:var i=(new W).LE();this.resolvedType.encode(t,i),n.writeVarint32(i.offset),n.append(i.flip());break;case m.TYPES.group:this.resolvedType.encode(t,n),n.writeVarint32(e<<3|m.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+t+" (unknown type)")}return n},n.decode=function(e,t,n){if(t!=this.type.wireType)throw Error("Unexpected wire type for element");var r,i;switch(this.type){case m.TYPES.int32:return 0|e.readVarint32();case m.TYPES.uint32:return e.readVarint32()>>>0;case m.TYPES.sint32:return 0|e.readVarint32ZigZag();case m.TYPES.fixed32:return e.readUint32()>>>0;case m.TYPES.sfixed32:return 0|e.readInt32();case m.TYPES.int64:return e.readVarint64();case m.TYPES.uint64:return e.readVarint64().toUnsigned();case m.TYPES.sint64:return e.readVarint64ZigZag();case m.TYPES.fixed64:return e.readUint64();case m.TYPES.sfixed64:return e.readInt64();case m.TYPES.bool:return!!e.readVarint32();case m.TYPES.enum:return e.readVarint32();case m.TYPES.float:return e.readFloat();case m.TYPES.double:return e.readDouble();case m.TYPES.string:return e.readVString();case m.TYPES.bytes:if(i=e.readVarint32(),e.remaining()<i)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+i+" required but got only "+e.remaining());return r=e.clone(),r.limit=r.offset+i,e.offset+=i,r;case m.TYPES.message:return i=e.readVarint32(),this.resolvedType.decode(e,i);case m.TYPES.group:return this.resolvedType.decode(e,-1,n)}throw Error("[INTERNAL] Illegal decode type")},n.valueFromString=function(e){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case m.TYPES.int32:case m.TYPES.sint32:case m.TYPES.sfixed32:case m.TYPES.uint32:case m.TYPES.fixed32:return this.verifyValue((0,F.default)(e));case m.TYPES.int64:case m.TYPES.sint64:case m.TYPES.sfixed64:case m.TYPES.uint64:case m.TYPES.fixed64:return this.verifyValue(e);case m.TYPES.bool:return"true"===e;case m.TYPES.string:return this.verifyValue(e);case m.TYPES.bytes:return W.fromBinary(e)}},n.valueToString=function(e){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===m.TYPES.bytes?e.toString("binary"):e.toString()},o.Element=d;var c=function(e,t,n,r,i,a){s.call(this,e,t,n,r,a),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},i=c.prototype=(0,k.default)(s.prototype);function v(e,t){var n=t.readVarint32(),r=7&n,i=n>>>3;switch(r){case m.WIRE_TYPES.VARINT:for(;n=t.readUint8(),128==(128&n););break;case m.WIRE_TYPES.BITS64:t.offset+=8;break;case m.WIRE_TYPES.LDELIM:n=t.readVarint32(),t.offset+=n;break;case m.WIRE_TYPES.STARTGROUP:v(i,t);break;case m.WIRE_TYPES.ENDGROUP:if(i===e)return!1;throw Error("Illegal GROUPEND after unknown group: "+i+" ("+e+" expected)");case m.WIRE_TYPES.BITS32:t.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+e+": "+r)}return!0}i.build=function(e){if(this.clazz&&!e)return this.clazz;var t=function(c,o){var s=o.getChildren(c.Reflect.Message.Field),l=o.getChildren(c.Reflect.Message.OneOf),r=function e(t){c.Builder.Message.call(this);for(var n,r=0,i=l.length;r<i;++r)this[l[r].name]=null;for(r=0,i=s.length;r<i;++r){var a=s[r];this[a.name]=a.repeated?[]:(0,R.default)(a)?new c.Map(a):null,!a.required&&"proto3"!==o.syntax||null===a.defaultValue||(this[a.name]=a.defaultValue)}if(0<arguments.length)if(1!==arguments.length||null===t||"object"!==(0,O.default)(t)||!("function"!=typeof t.encode||t instanceof e)||(0,P.default)(t)||t instanceof c.Map||W.isByteBuffer(t)||t instanceof ArrayBuffer||c.Long&&t instanceof c.Long)for(r=0,i=arguments.length;r<i;++r)void 0!==(n=arguments[r])&&this.$set(s[r].name,n);else this.$set(t)},a=r.prototype=(0,k.default)(c.Builder.Message.prototype);a.add=function(e,t,n){var r=o._fieldsByName[e];if(!n){if(!r)throw Error(this+"#"+e+" is undefined");if(!(r instanceof c.Reflect.Message.Field))throw Error(this+"#"+e+" is not a field: "+r.toString(!0));if(!r.repeated)throw Error(this+"#"+e+" is not a repeated field");t=r.verifyValue(t,!0)}return null===this[e]&&(this[e]=[]),this[e].push(t),this},a.$add=a.add,a.set=function(e,t,n){if(e&&"object"===(0,O.default)(e)){for(var r in n=t,e)e.hasOwnProperty(r)&&void 0!==(t=e[r])&&this.$set(r,t,n);return this}var i,a=o._fieldsByName[e];if(n)this[e]=t;else{if(!a)throw Error(this+"#"+e+" is not a field: undefined");if(!(a instanceof c.Reflect.Message.Field))throw Error(this+"#"+e+" is not a field: "+a.toString(!0));this[a.name]=t=a.verifyValue(t)}return a&&a.oneof&&(i=this[a.oneof.name],null!==t?(null!==i&&i!==a.name&&(this[i]=null),this[a.oneof.name]=a.name):i===e&&(this[a.oneof.name]=null)),this},a.$set=a.set,a.get=function(e,t){if(t)return this[e];var n=o._fieldsByName[e];if(!(n&&n instanceof c.Reflect.Message.Field))throw Error(this+"#"+e+" is not a field: undefined");if(!(n instanceof c.Reflect.Message.Field))throw Error(this+"#"+e+" is not a field: "+n.toString(!0));return this[n.name]},a.$get=a.get;for(var e=0;e<s.length;e++){var t=s[e];t instanceof c.Reflect.Message.ExtensionField||o.builder.options.populateAccessors&&function(n){var e=n.originalName.replace(/(_[a-zA-Z])/g,function(e){return e.toUpperCase().replace("_","")}),e=e.substring(0,1).toUpperCase()+e.substring(1),t=n.originalName.replace(/([A-Z])/g,function(e){return"_"+e}),r=function(e,t){return this[n.name]=t?e:n.verifyValue(e),this},i=function(){return this[n.name]};null===o.getChild("set"+e)&&(a["set"+e]=r),null===o.getChild("set_"+t)&&(a["set_"+t]=r),null===o.getChild("get"+e)&&(a["get"+e]=i),null===o.getChild("get_"+t)&&(a["get_"+t]=i)}(t)}function d(e,n,r,i){if(null===e||"object"!==(0,O.default)(e)){if(i&&i instanceof c.Reflect.Enum){var t=c.Reflect.Enum.getName(i.object,e);if(null!==t)return t}return e}if(W.isByteBuffer(e))return n?e.toBase64():e.toBuffer();if(c.Long.isLong(e))return r?e.toString():c.Long.fromValue(e);var a;if((0,P.default)(e))return a=[],(0,L.default)(e).call(e,function(e,t){a[t]=d(e,n,r,i)}),a;if(a={},e instanceof c.Map){for(var o=(0,I.default)(e).call(e),s=o.next();!s.done;s=o.next())a[e.keyElem.valueToString(s.value[0])]=d(s.value[1],n,r,e.valueElem.resolvedType);return a}var l,u=e.$type,h=void 0;for(l in e)e.hasOwnProperty(l)&&(u&&(h=u.getChild(l))?a[l]=d(e[l],n,r,h.resolvedType):a[l]=d(e[l],n,r));return a}return a.encode=function(t,e){"boolean"==typeof t&&(e=t,t=void 0);var n=!1;t||(t=new W,n=!0);var r=t.littleEndian;try{return o.encode(this,t.LE(),e),(n?t.flip():t).LE(r)}catch(e){throw t.LE(r),e}},r.encode=function(e,t,n){return new r(e).encode(t,n)},a.calculate=function(){return o.calculate(this)},a.encodeDelimited=function(e,t){var n=!1;e||(e=new W,n=!0);var r=(new W).LE();return o.encode(this,r,t).flip(),e.writeVarint32(r.remaining()),e.append(r),n?e.flip():e},a.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},a.toArrayBuffer=a.encodeAB,a.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},a.toBuffer=a.encodeNB,a.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},a.toBase64=a.encode64,a.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},a.toHex=a.encodeHex,a.toRaw=function(e,t){return d(this,!!e,!!t,this.$type)},a.encodeJSON=function(){return(0,A.default)(d(this,!0,!0,this.$type))},r.decode=function(t,e,n){"string"==typeof e&&(n=e,e=-1),"string"==typeof t&&(t=W.wrap(t,n||"base64")),t=W.isByteBuffer(t)?t:W.wrap(t);var r=t.littleEndian;try{var i=o.decode(t.LE());return t.LE(r),i}catch(e){throw t.LE(r),e}},r.decodeDelimited=function(t,e){if("string"==typeof t&&(t=W.wrap(t,e||"base64")),t=W.isByteBuffer(t)?t:W.wrap(t),t.remaining()<1)return null;var n=t.offset,r=t.readVarint32();if(t.remaining()<r)return t.offset=n,null;try{var i=o.decode((0,D.default)(t).call(t,t.offset,t.offset+r).LE());return t.offset+=r,i}catch(e){throw t.offset+=r,e}},r.decode64=function(e){return r.decode(e,"base64")},r.decodeHex=function(e){return r.decode(e,"hex")},r.decodeJSON=function(e){return new r(JSON.parse(e))},a.toString=function(){return o.toString()},U.default&&((0,U.default)(r,"$options",{value:o.buildOpt()}),(0,U.default)(a,"$options",{value:r.$options}),(0,U.default)(r,"$type",{value:o}),(0,U.default)(a,"$type",{value:o})),r}(m,this);this._fields=[],this._fieldsById={},this._fieldsByName={};for(var n,r=0,i=this.children.length;r<i;r++)if(n=this.children[r],n instanceof g||n instanceof c||n instanceof w){if(t.hasOwnProperty(n.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+n.toString(!0)+" cannot override static property '"+n.name+"'");t[n.name]=n.build()}else if(n instanceof c.Field)n.build(),this._fields.push(n),this._fieldsById[n.id]=n,this._fieldsByName[n.name]=n;else if(!(n instanceof c.OneOf||n instanceof x))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[r].toString(!0));return this.clazz=t},i.encode=function(e,t,n){for(var r,i,a=null,o=0,s=this._fields.length;o<s;++o)r=this._fields[o],i=e[r.name],r.required&&null===i?null===a&&(a=r):r.encode(n?i:r.verifyValue(i),t,e);if(null===a)return t;var l=Error("Missing at least one required field for "+this.toString(!0)+": "+a);throw l.encoded=t,l},i.calculate=function(e){for(var t,n,r=0,i=0,a=this._fields.length;i<a;++i){if(t=this._fields[i],n=e[t.name],t.required&&null===n)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);r+=t.calculate(n,e)}return r},i.decode=function(e,t,n){t="number"==typeof t?t:-1;for(var r,i,a,o,s,l,u=e.offset,h=new this.clazz;e.offset<u+t||-1===t&&0<e.remaining();){if(r=e.readVarint32(),i=7&r,a=r>>>3,i===m.WIRE_TYPES.ENDGROUP){if(a!==n)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+a+" ("+(n?n+" expected":"not a group")+")");break}if(o=this._fieldsById[a])o.repeated&&!o.options.packed?h[o.name].push(o.decode(i,e)):(0,R.default)(o)?(s=o.decode(i,e),h[o.name].set(s[0],s[1])):(h[o.name]=o.decode(i,e),o.oneof&&(l=h[o.oneof.name],null!==l&&l!==o.name&&(h[l]=null),h[o.oneof.name]=o.name));else switch(i){case m.WIRE_TYPES.VARINT:e.readVarint32();break;case m.WIRE_TYPES.BITS32:e.offset+=4;break;case m.WIRE_TYPES.BITS64:e.offset+=8;break;case m.WIRE_TYPES.LDELIM:var c=e.readVarint32();e.offset+=c;break;case m.WIRE_TYPES.STARTGROUP:for(;v(a,e););break;default:throw Error("Illegal wire type for unknown field "+a+" in "+this.toString(!0)+"#decode: "+i)}}for(var d=0,f=this._fields.length;d<f;++d)if(o=this._fields[d],null===h[o.name])if("proto3"===this.syntax)h[o.name]=o.defaultValue;else{if(o.required){var p=Error("Missing at least one required field for "+this.toString(!0)+": "+o.name);throw p.decoded=h,p}m.populateDefaults&&null!==o.defaultValue&&(h[o.name]=o.defaultValue)}return h},o.Message=c;var u=function(e,t,n,r,i,a,o,s,l,u){h.call(this,e,t,a),this.className="Message.Field",this.required="required"===n,this.repeated="repeated"===n,this.map="map"===n,this.keyType=r||null,this.type=i,this.resolvedType=null,this.id=o,this.options=s||{},this.defaultValue=null,this.oneof=l||null,this.syntax=u||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof c.ExtensionField||(this.name=m.Util.toCamelCase(this.name))},a=u.prototype=(0,k.default)(h.prototype);a.build=function(){this.element=new d(this.type,this.resolvedType,!1,this.syntax),(0,R.default)(this)&&(this.keyElement=new d(this.keyType,void 0,!0,this.syntax)),"proto3"!==this.syntax||this.repeated||(0,R.default)(this)?void 0!==this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=d.defaultFieldValue(this.type)},a.verifyValue=function(e,t){t=t||!1;var n=this;function r(e,t){throw Error("Illegal value for "+n.toString(!0)+" of type "+n.type.name+": "+e+" ("+t+")")}if(null===e)return this.required&&r((0,O.default)(e),"required"),"proto3"===this.syntax&&this.type!==m.TYPES.message&&r((0,O.default)(e),"proto3 field without field presence cannot be null"),null;if(!this.repeated||t)return(0,R.default)(this)&&!t?e instanceof m.Map?e:(e instanceof Object||r((0,O.default)(e),"expected ProtoBuf.Map or raw object for map field"),new m.Map(this,e)):(!this.repeated&&(0,P.default)(e)&&r((0,O.default)(e),"no array expected"),this.element.verifyValue(e));(0,P.default)(e)||(e=[e]);for(var i=[],a=0;a<e.length;a++)i.push(this.element.verifyValue(e[a]));return i},a.hasWirePresence=function(e,t){if("proto3"!==this.syntax)return null!==e;if(this.oneof&&t[this.oneof.name]===this.name)return!0;switch(this.type){case m.TYPES.int32:case m.TYPES.sint32:case m.TYPES.sfixed32:case m.TYPES.uint32:case m.TYPES.fixed32:return 0!==e;case m.TYPES.int64:case m.TYPES.sint64:case m.TYPES.sfixed64:case m.TYPES.uint64:case m.TYPES.fixed64:return 0!==e.low||0!==e.high;case m.TYPES.bool:return e;case m.TYPES.float:case m.TYPES.double:return 0!==e;case m.TYPES.string:return 0<e.length;case m.TYPES.bytes:return 0<e.remaining();case m.TYPES.enum:return 0!==e;case m.TYPES.message:return null!==e;default:return!0}},a.encode=function(t,r,e){if(null===this.type||"object"!==(0,O.default)(this.type))throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return r;try{var n;if(this.repeated)if(this.options.packed&&0<=(0,B.default)(n=m.PACKABLE_WIRE_TYPES).call(n,this.type.wireType)){r.writeVarint32(this.id<<3|m.WIRE_TYPES.LDELIM),r.ensureCapacity(r.offset+=1);for(var i=r.offset,a=0;a<t.length;a++)this.element.encodeValue(this.id,t[a],r);var o,s=r.offset-i,l=W.calculateVarint32(s);1<l&&(o=(0,D.default)(r).call(r,i,r.offset),i+=l-1,r.offset=i,r.append(o)),r.writeVarint32(s,i-l)}else for(a=0;a<t.length;a++)r.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t[a],r);else(0,R.default)(this)?(0,L.default)(t).call(t,function(e,t){var n=W.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,t)+W.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,e);r.writeVarint32(this.id<<3|m.WIRE_TYPES.LDELIM),r.writeVarint32(n),r.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,t,r),r.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,e,r)},this):this.hasWirePresence(t,e)&&(r.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t,r))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return r},a.calculate=function(t,e){if(t=this.verifyValue(t),null===this.type||"object"!==(0,O.default)(this.type))throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return 0;var n,r,i,a=0;try{if(this.repeated)if(this.options.packed&&0<=(0,B.default)(n=m.PACKABLE_WIRE_TYPES).call(n,this.type.wireType)){for(a+=W.calculateVarint32(this.id<<3|m.WIRE_TYPES.LDELIM),i=0,r=0;r<t.length;r++)i+=this.element.calculateLength(this.id,t[r]);a+=W.calculateVarint32(i),a+=i}else for(r=0;r<t.length;r++)a+=W.calculateVarint32(this.id<<3|this.type.wireType),a+=this.element.calculateLength(this.id,t[r]);else(0,R.default)(this)?(0,L.default)(t).call(t,function(e,t){var n=W.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,t)+W.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,e);a+=W.calculateVarint32(this.id<<3|m.WIRE_TYPES.LDELIM),a+=W.calculateVarint32(n),a+=n},this):this.hasWirePresence(t,e)&&(a+=W.calculateVarint32(this.id<<3|this.type.wireType),a+=this.element.calculateLength(this.id,t))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return a},a.decode=function(e,t,n){var r,i=!(0,R.default)(this)&&e==this.type.wireType||!n&&this.repeated&&this.options.packed&&e==m.WIRE_TYPES.LDELIM||(0,R.default)(this)&&e==m.WIRE_TYPES.LDELIM;if(!i)throw Error("Illegal wire type for field "+this.toString(!0)+": "+e+" ("+this.type.wireType+" expected)");if(e==m.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&0<=(0,B.default)(r=m.PACKABLE_WIRE_TYPES).call(r,this.type.wireType)&&!n){l=t.readVarint32(),l=t.offset+l;for(var a=[];t.offset<l;)a.push(this.decode(this.type.wireType,t,!0));return a}if((0,R.default)(this)){var o=d.defaultFieldValue(this.keyType),s=d.defaultFieldValue(this.type),l=t.readVarint32();if(t.remaining()<l)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+l+" required but got only "+t.remaining());var u=t.clone();for(u.limit=u.offset+l,t.offset+=l;0<u.remaining();){var h=u.readVarint32();e=7&h;var c=h>>>3;if(1===c)o=this.keyElement.decode(u,e,c);else{if(2!==c)throw Error("Unexpected tag in map field key/value submessage");s=this.element.decode(u,e,c)}}return[o,s]}return this.element.decode(t,e,this.id)},o.Message.Field=u;var f=function(e,t,n,r,i,a,o){u.call(this,e,t,n,null,r,i,a,o),this.extension};f.prototype=(0,k.default)(u.prototype),o.Message.ExtensionField=f;var p=function(e,t,n){h.call(this,e,t,n),this.fields=[]};o.Message.OneOf=p;var g=function(e,t,n,r,i){s.call(this,e,t,n,r,i),this.className="Enum",this.object=null};g.getName=function(e,t){for(var n,r=(0,N.default)(e),i=0;i<r.length;++i)if(e[n=r[i]]===t)return n;return null};var y=g.prototype=(0,k.default)(s.prototype);y.build=function(e){if(this.object&&!e)return this.object;for(var t=new m.Builder.Enum,n=this.getChildren(g.Value),r=0,i=n.length;r<i;++r)t[n[r].name]=n[r].id;return U.default&&(0,U.default)(t,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=t},o.Enum=g;var _=function(e,t,n,r){h.call(this,e,t,n),this.className="Enum.Value",this.id=r};_.prototype=(0,k.default)(h.prototype),o.Enum.Value=_;var x=function(e,t,n,r){h.call(this,e,t,n),this.field=r};x.prototype=(0,k.default)(h.prototype),o.Extension=x;var w=function(e,t,n,r){s.call(this,e,t,n,r),this.className="Service",this.clazz=null},b=w.prototype=(0,k.default)(s.prototype);b.build=function(e){return this.clazz&&!e?this.clazz:this.clazz=function(t,i){for(var a=function(e){t.Builder.Service.call(this),this.rpcImpl=e||function(e,t,n){(0,E.default)((0,C.default)(n).call(n,this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},e=a.prototype=(0,k.default)(t.Builder.Service.prototype),n=i.getChildren(t.Reflect.Service.RPCMethod),r=0;r<n.length;r++)!function(r){e[r.name]=function(e,n){try{try{e=r.resolvedRequestType.clazz.decode(W.wrap(e))}catch(e){if(!(e instanceof TypeError))throw e}if(null===e||"object"!==(0,O.default)(e))throw Error("Illegal arguments");e instanceof r.resolvedRequestType.clazz||(e=new r.resolvedRequestType.clazz(e)),this.rpcImpl(r.fqn(),e,function(e,t){if(e)n(e);else{null===t&&(t="");try{t=r.resolvedResponseType.clazz.decode(t)}catch(e){}t&&t instanceof r.resolvedResponseType.clazz?n(null,t):n(Error("Illegal response type received in service method "+i.name+"#"+r.name))}})}catch(e){(0,E.default)((0,C.default)(n).call(n,this,e),0)}},a[r.name]=function(e,t,n){new a(e)[r.name](t,n)},U.default&&((0,U.default)(a[r.name],"$options",{value:r.buildOpt()}),(0,U.default)(e[r.name],"$options",{value:a[r.name].$options}))}(n[r]);return U.default&&((0,U.default)(a,"$options",{value:i.buildOpt()}),(0,U.default)(e,"$options",{value:a.$options}),(0,U.default)(a,"$type",{value:i}),(0,U.default)(e,"$type",{value:i})),a}(m,this)},o.Service=w;var M=function(e,t,n,r){h.call(this,e,t,n),this.className="Service.Method",this.options=r||{}},T=M.prototype=(0,k.default)(h.prototype);T.buildOpt=t.buildOpt,o.Service.Method=M;var S=function(e,t,n,r,i,a,o,s){M.call(this,e,t,n,s),this.className="Service.RPCMethod",this.requestName=r,this.responseName=i,this.requestStream=a,this.responseStream=o,this.resolvedRequestType=null,this.resolvedResponseType=null};return S.prototype=(0,k.default)(M.prototype),o.Service.RPCMethod=S,o}(ce),ce.Builder=(re=ce,ie=ce.Lang,ae=ce.Reflect,oe=function(e){this.ns=new ae.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},se=oe.prototype,oe.isMessage=function(e){return"string"==typeof e.name&&void 0===(0,p.default)(e)&&void 0===e.rpc},oe.isMessageField=function(e){return"string"==typeof e.rule&&"string"==typeof e.name&&"string"==typeof e.type&&void 0!==e.id},oe.isEnum=function(e){return"string"==typeof e.name&&!(void 0===(0,p.default)(e)||!(0,P.default)((0,p.default)(e))||0===(0,p.default)(e).length)},oe.isService=function(e){return!("string"!=typeof e.name||"object"!==(0,O.default)(e.rpc)||!e.rpc)},oe.isExtend=function(e){return"string"==typeof e.ref},se.reset=function(){return this.ptr=this.ns,this},se.define=function(e){var t;if("string"!=typeof e||!ie.TYPEREF.test(e))throw Error("illegal namespace: "+e);return(0,L.default)(t=e.split(".")).call(t,function(e){var t=this.ptr.getChild(e);null===t&&this.ptr.addChild(t=new ae.Namespace(this,this.ptr,e)),this.ptr=t},this),this},se.create=function(e){if(!e)return this;if((0,P.default)(e)){if(0===e.length)return this;e=(0,D.default)(e).call(e)}else e=[e];for(var t=[e];0<t.length;){if(e=t.pop(),!(0,P.default)(e))throw Error("not a valid namespace: "+(0,A.default)(e));for(;0<e.length;){var n,r,i=e.shift();if(oe.isMessage(i)){var a,o,s,l,u,h=new ae.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax),c={};i.oneofs&&(0,L.default)(a=(0,N.default)(i.oneofs)).call(a,function(e){h.addChild(c[e]=new ae.Message.OneOf(this,h,e))},this),i.fields&&(0,L.default)(o=i.fields).call(o,function(e){if(null!==h.getChild(0|e.id))throw Error("duplicate or invalid field id in "+h.name+": "+e.id);if(e.options&&"object"!==(0,O.default)(e.options))throw Error("illegal field options in "+h.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=c[e.oneof]))throw Error("illegal oneof in "+h.name+"#"+e.name+": "+e.oneof);e=new ae.Message.Field(this,h,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),t&&t.fields.push(e),h.addChild(e)},this);var d=[];if(i.enums&&(0,L.default)(s=i.enums).call(s,function(e){d.push(e)}),i.messages&&(0,L.default)(l=i.messages).call(l,function(e){d.push(e)}),i.services&&(0,L.default)(u=i.services).call(u,function(e){d.push(e)}),i.extensions&&("number"==typeof i.extensions[0]?h.extensions=[i.extensions]:h.extensions=i.extensions),this.ptr.addChild(h),0<d.length){t.push(e),e=d,d=null,this.ptr=h,h=null;continue}d=null}else if(oe.isEnum(i)){var f,h=new ae.Enum(this,this.ptr,i.name,i.options,i.syntax);(0,L.default)(f=(0,p.default)(i)).call(f,function(e){h.addChild(new ae.Enum.Value(this,h,e.name,e.id))},this),this.ptr.addChild(h)}else if(oe.isService(i))h=new ae.Service(this,this.ptr,i.name,i.options),(0,L.default)(n=(0,N.default)(i.rpc)).call(n,function(e){var t=i.rpc[e];h.addChild(new ae.Service.RPCMethod(this,h,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))},this),this.ptr.addChild(h);else{if(!oe.isExtend(i))throw Error("not a valid definition: "+(0,A.default)(i));if(h=this.ptr.resolve(i.ref,!0),h)(0,L.default)(r=i.fields).call(r,function(t){if(null!==h.getChild(0|t.id))throw Error("duplicate extended field id in "+h.name+": "+t.id);if(h.extensions){var e,n=!1;if((0,L.default)(e=h.extensions).call(e,function(e){t.id>=e[0]&&t.id<=e[1]&&(n=!0)}),!n)throw Error("illegal extended field id in "+h.name+": "+t.id+" (not within valid ranges)")}var r=t.name;this.options.convertFieldsToCamelCase&&(r=re.Util.toCamelCase(r));var i=new ae.Message.ExtensionField(this,h,t.rule,t.type,this.ptr.fqn()+"."+r,t.id,t.options),a=new ae.Extension(this,this.ptr,t.name,i);i.extension=a,this.ptr.addChild(a),h.addChild(i)},this);else if(!/\.?google\.protobuf\./.test(i.ref))throw Error("extended message "+i.ref+" is not defined")}i=null,h=null}e=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},se.import=function(t,e){var n,r="/";if("string"==typeof e){if(re.Util.IS_NODE&&(e=me(207).resolve(e)),!0===this.files[e])return this.reset();this.files[e]=!0}else if("object"===(0,O.default)(e)){var i,a=e.root;re.Util.IS_NODE&&(a=me(207).resolve(a)),(0<=(0,B.default)(a).call(a,"\\")||0<=(0,B.default)(i=e.file).call(i,"\\"))&&(r="\\");var o=a+r+e.file;if(!0===this.files[o])return this.reset();this.files[o]=!0}if(t.imports&&0<t.imports.length){var s,l=!1;"object"===(0,O.default)(e)?(this.importRoot=e.root,l=!0,s=this.importRoot,e=e.file,(0<=(0,B.default)(s).call(s,"\\")||0<=(0,B.default)(e).call(e,"\\"))&&(r="\\")):"string"==typeof e?this.importRoot?s=this.importRoot:0<=(0,B.default)(e).call(e,"/")?(s=e.replace(/\/[^\/]*$/,""),""===s&&(s="/")):0<=(0,B.default)(e).call(e,"\\")?(s=e.replace(/\\[^\\]*$/,""),r="\\"):s=".":s=null;for(var u=0;u<t.imports.length;u++)if("string"==typeof t.imports[u]){if(!s)throw Error("cannot determine import root");var h=t.imports[u];if("google/protobuf/descriptor.proto"===h)continue;if(h=s+r+h,!0===this.files[h])continue;/\.proto$/i.test(h)&&!re.DotProto&&(h=h.replace(/\.proto$/,".json"));var c=re.Util.fetch(h);if(null===c)throw Error("failed to import '"+h+"' in '"+e+"': file not found");/\.json$/i.test(h)?this.import(JSON.parse(c+""),h):this.import(re.DotProto.Parser.parse(c),h)}else e?/\.(\w+)$/.test(e)?this.import(t.imports[u],e.replace(/^(.+)\.(\w+)$/,function(e,t,n){return t+"_import"+u+"."+n})):this.import(t.imports[u],e+"_import"+u):this.import(t.imports[u]);l&&(this.importRoot=null)}t.package&&this.define(t.package),t.syntax&&de(t);var d=this.ptr;return t.options&&(0,L.default)(n=(0,N.default)(t.options)).call(n,function(e){d.options[e]=t.options[e]}),t.messages&&(this.create(t.messages),this.ptr=d),t.enums&&(this.create(t.enums),this.ptr=d),t.services&&(this.create(t.services),this.ptr=d),t.extends&&this.create(t.extends),this.reset()},se.resolveAll=function(){var e,t;if(null==this.ptr||"object"===(0,O.default)(this.ptr.type))return this;if(this.ptr instanceof ae.Namespace)(0,L.default)(t=this.ptr.children).call(t,function(e){this.ptr=e,this.resolveAll()},this);else if(this.ptr instanceof ae.Message.Field){if(ie.TYPE.test(this.ptr.type))this.ptr.type=re.TYPES[this.ptr.type];else{if(!ie.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(e=(this.ptr instanceof ae.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0),!e)throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=e,e instanceof ae.Enum){if(this.ptr.type=re.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==e.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(e instanceof ae.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=e.isGroup?re.TYPES.group:re.TYPES.message}}if((0,R.default)(this.ptr)){if(!ie.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=re.TYPES[this.ptr.keyType]}}else if(this.ptr instanceof re.Reflect.Service.Method){if(!(this.ptr instanceof re.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(e=this.ptr.parent.resolve(this.ptr.requestName,!0),!(e&&e instanceof re.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=e,e=this.ptr.parent.resolve(this.ptr.responseName,!0),!(e&&e instanceof re.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=e}else if(!(this.ptr instanceof re.Reflect.Message.OneOf||this.ptr instanceof re.Reflect.Extension||this.ptr instanceof re.Reflect.Enum.Value))throw Error("illegal object in namespace: "+(0,O.default)(this.ptr)+": "+this.ptr);return this.reset()},se.build=function(e){if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!e)return this.result;for(var t="string"==typeof e?e.split("."):e,n=this.result,r=0;r<t.length;r++){if(!n[t[r]]){n=null;break}n=n[t[r]]}return n},se.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},se.toString=function(){return"Builder"},oe.Message=function(){},oe.Enum=function(){},oe.Service=function(){},oe),ce.Map=(le=ce.Reflect,ue=function(e,t){if(!(0,R.default)(e))throw Error("field is not a map");if(this.field=e,this.keyElem=new le.Element(e.keyType,null,!0,e.syntax),this.valueElem=new le.Element(e.type,e.resolvedType,!1,e.syntax),this.map={},(0,U.default)(this,"size",{get:function(){return(0,N.default)((0,R.default)(this)).length}}),t)for(var n=(0,N.default)(t),r=0;r<n.length;r++){var i=this.keyElem.valueFromString(n[r]),a=this.valueElem.verifyValue(t[n[r]]);(0,R.default)(this)[this.keyElem.valueToString(i)]={key:i,value:a}}},he=ue.prototype,he.clear=function(){this.map={}},he.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),n=t in(0,R.default)(this);return delete(0,R.default)(this)[t],n},he.entries=function(){for(var e,t=[],n=(0,N.default)((0,R.default)(this)),r=0;r<n.length;r++)t.push([(e=(0,R.default)(this)[n[r]]).key,e.value]);return fe(t)},he.keys=function(){for(var e=[],t=(0,N.default)((0,R.default)(this)),n=0;n<t.length;n++)e.push((0,R.default)(this)[t[n]].key);return fe(e)},he.values=function(){for(var e=[],t=(0,N.default)((0,R.default)(this)),n=0;n<t.length;n++)e.push((0,R.default)(this)[t[n]].value);return fe(e)},he.forEach=function(e,t){for(var n,r=(0,N.default)((0,R.default)(this)),i=0;i<r.length;i++)e.call(t,(n=(0,R.default)(this)[r[i]]).value,n.key,this)},he.set=function(e,t){var n=this.keyElem.verifyValue(e),r=this.valueElem.verifyValue(t);return(0,R.default)(this)[this.keyElem.valueToString(n)]={key:n,value:r},this},he.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));if(t in(0,R.default)(this))return(0,R.default)(this)[t].value},he.has=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));return t in(0,R.default)(this)},ue),ce.loadProto=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=void 0),ce.loadJson(ce.DotProto.Parser.parse(e),t,n)},ce.protoFromString=ce.loadProto,ce.loadProtoFile=function(t,n,r){if(n&&"object"===(0,O.default)(n)?(r=n,n=null):n&&"function"==typeof n||(n=null),n)return ce.Util.fetch("string"==typeof t?t:t.root+"/"+t.file,function(e){if(null!==e)try{n(null,ce.loadProto(e,r,t))}catch(e){n(e)}else n(Error("Failed to fetch file"))});var e=ce.Util.fetch("object"===(0,O.default)(t)?t.root+"/"+t.file:t);return null===e?null:ce.loadProto(e,r,t)},ce.protoFromFile=ce.loadProtoFile,ce.newBuilder=function(e){return e=e||{},void 0===e.convertFieldsToCamelCase&&(e.convertFieldsToCamelCase=ce.convertFieldsToCamelCase),void 0===e.populateAccessors&&(e.populateAccessors=ce.populateAccessors),new ce.Builder(e)},ce.loadJson=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=null),t&&"object"===(0,O.default)(t)||(t=ce.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),t.import(e,n),t.resolveAll(),t},ce.loadJsonFile=function(t,n,r){if(n&&"object"===(0,O.default)(n)?(r=n,n=null):n&&"function"==typeof n||(n=null),n)return ce.Util.fetch("string"==typeof t?t:t.root+"/"+t.file,function(e){if(null!==e)try{n(null,ce.loadJson(JSON.parse(e),r,t))}catch(e){n(e)}else n(Error("Failed to fetch file"))});var e=ce.Util.fetch("object"===(0,O.default)(t)?t.root+"/"+t.file:t);return null===e?null:ce.loadJson(JSON.parse(e),r,t)}}).call(this,me(65))},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(63)),o=r(n(13)),s=r(n(9)),a=r(n(208)),u=r(n(483)),h=r(n(141)),c=new h.default,d=c.netArea,f={check:d+"sdk/check",onlineCheck:d+"sdk/auth/web",fmFileServer:d+"sdk/auth/downMaps"},p="026685bf295f587b5dffc1f18d5dc27c",m=function(e,t,n){if(!e||"string"!=typeof t||32!=t.length)return!1;if(null==e||""==e)return!0;var r=a.default.decryption(t,p),i=u.default.encryption(n),r=a.default.decryption(r,i);return r==e},v=function(e,t,n){n=n||"fengmap.localhost:";var r=u.default.encryption(n+t),i=a.default.decryption(e,r);return i},g=function(){var e=new Date,t=(e.getFullYear(),e.getMonth()+1),e=e.getDate(),n=e%2==0?1:-1,r=Math.max(Math.pow(e%10+ +n,2)+n*t,0),i=Math.abs(2*e+n*t);return""+r+i},y=(g(),function(e,t,n){v(e,t);var r=location?location.host:"",i=(0,s.default)(r).call(r,":");-1<i&&(r=(0,o.default)(r).call(r,0,i));var a=r||"0.0.0.0";return{webURL:a,appKey:e,mapId:n,appName:t}}),_={checkOffLine:function(e,t,n,r){n=n||r;var i=v(e,t);return n==i},checkIsOnLine:function(e,t){c.getData(f.check,function(){e&&e()},function(){t&&t()})},checkOnLine:function(e,t,n,r,i,a){var o=f.onlineCheck,s=y(e,t,n),s=(0,l.default)(s);c.getData(o,function(e){e?e.success?r&&r(e):i&&i(e):i&&i()},function(e){e?(e=JSON.parse(e),i&&i(e)):i&&i()},a,s,{"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"})},checkLicense:m,getCerityData:y,ls:0},x=_;t.default=x},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(20)),u=r(n(14)),h=r(n(21)),c=r(n(22)),a=r(n(18)),o=r(n(13)),s=r(n(33)),d=r(n(31)),_=r(n(32)),f=r(n(12)),p=r(n(10)),m=r(n(9)),v=r(n(30)),g=r(n(2)),y=r(n(3)),x=r(n(66)),w=r(n(211));function b(e,t){var n;if(void 0===c.default||null==(0,h.default)(e)){if((0,u.default)(e)||(n=M(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=(0,l.default)(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function M(e,t){var n;if(e){if("string"==typeof e)return T(e,t);var r=(0,o.default)(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?(0,a.default)(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(e,t):void 0}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var S=function(){function r(e,t,n){(0,g.default)(this,r),this.groups={},this._id=e,this._center=new fm.Vector2,this._mapcenter=new fm.Vector2(t.scene.x,t.scene.y),this._theme=null,this.parent=n,this.layerGroups=t.scene.layerGroups,this._bbox={max:new fm.Vector2(-Infinity,-Infinity),min:new fm.Vector2(Infinity,Infinity)},this._bboxTh={max:new fm.Vector2(-Infinity,-Infinity),min:new fm.Vector2(Infinity,Infinity)},this._bbox.max.x=t.scene.maxX,this._bbox.max.y=t.scene.maxY,this._bbox.min.x=t.scene.minX,this._bbox.min.y=t.scene.minY,this._bboxTh.max.x=t.scene.maxX-t.scene.x,this._bboxTh.max.y=t.scene.maxY-t.scene.y,this._bboxTh.min.x=t.scene.minX-t.scene.x,this._bboxTh.min.y=t.scene.minY-t.scene.y,this._groupIds=[],this.initGroupByData(t),this._spcace=(0,v.default)(t.scene.layerGroups[0].height)}return(0,y.default)(r,[{key:"getNeedLoadGroup",value:function(e,t){var n,r=[],i=b(this.layerGroups);try{for(i.s();!(n=i.n()).done;){var a=n.value,o=-1<(0,m.default)(e).call(e,a.gid);t&&(o=!o),!a.loaded&&o&&r.push({gid:a.gid,url:this.getGroupLoadUrl(a.gname,a.gid),layerData:a})}}catch(e){i.e(e)}finally{i.f()}return r}},{key:"getGroupLoadUrl",value:function(e){return"floor."+e}},{key:"getLastAndNextName",value:function(e,t){var n,r,i,a=""+e,o=b(this.layerGroups);try{for(o.s();!(i=o.n()).done;){var s=i.value;s.gid===t-1&&(n="_"+s.gname),s.gid===t+1&&(r="_"+s.gname)}}catch(e){o.e(e)}finally{o.f()}return n=n||"_no",r=r||"_no",a+=n+r,a}},{key:"initGroupByData",value:function(e){var t=e.floors;this._groupLength=t.length;for(var n=0;n<t.length;n++)this.addGroup(t[n].gid,t[n],e.scene.layerGroups[n])}},{key:"addGroup",value:function(e,t,n){var r;this._groupIds.push(e);var i=new w.default(e,t,n);i.hideWithFree=(0,p.default)(this.parent).MapOptions.autoDispose,i.parent=this;var a=(0,v.default)(e);i.height=this._space*a,-1<(0,m.default)(r=(0,p.default)(this.parent).visibleGroupIDs).call(r,e)?i.visible=!0:i.visible=!1,this.groups[e+""]=i}},{key:"changeTheme",value:function(r){var i=this;this._theme=r;var a,e,t=["extent","model","label","facility"],n=function(n){i.groups[n].traverseByAlias(t,function(e,t){switch(t){case"extent":a=r;break;case"model":a=(0,p.default)(i.parent).MapOptions.useStoreApply?r.getStoreApplyTheme(e.bdata.fid):void 0,a=a||r.getModelTheme(e.bdata),a=(0,f.default)(a,{logoPath:r.data.logoPath});break;case"label":a=r.getLabelTheme(e.bdata);break;case"facility":a=r.getPoiTheme(e.bdata)}e.renderNodeInited&&(e.setByTheme(a),i.parent.checkMaterialAlpha(e.renderNode,(0,v.default)(n)),"model"==t&&i.parent.checkMaterialAlpha(e.line,(0,v.default)(n)))})};for(e in this.groups)n(e)}},{key:"getAllGroupLayerByAlias",value:function(e,t){for(var n in this.groups){var r,i=this.groups[n].layers[e],a=b(i);try{for(a.s();!(r=a.n()).done;){var o=r.value;t(o)}}catch(e){a.e(e)}finally{a.f()}}}},{key:"getFacilityByFilter",value:function(e,t){var n,r=[],i=b(e);try{for(i.s();!(n=i.n()).done;){var a=n.value,o=this.groups[a];if(o){for(var s=["imageMarker","textMarker","facility"],l=0,u=s;l<u.length;l++){var h,c=u[l],d=o.getLayers(c),f=b(d);try{for(f.s();!(h=f.n()).done;)for(var p=h.value,m=0;m<p.scene.children.length;m++)t&&!t(p.scene.children[m])||r.push(p.scene.children[m])}catch(e){f.e(e)}finally{f.f()}}for(var v=o._locationScene.children,g=0;g<v.length;g++)t&&!t(v[g])||r.push(v[g])}}}catch(e){i.e(e)}finally{i.f()}return r}},{key:"getSpriteInfo",value:function(e,t,n,r){e.updateMatrixWorld(!0);var i,a,o=(new fm.Vector3).setFromMatrixPosition(e.matrixWorld),s=o.applyMatrix4(n.matrixWorldInverse),l=s.applyMatrix4(n.projectionMatrix),u=e.mapNode.size/r*2,h=t?(i=this.parent._map.labelLanguage==x.default.ZH?e.mapNode.name:e.mapNode.ename,i&&(a=i.split("%rn%").length,u*=a),u/e.material.userData.scaleRatio):u;"PerspectiveCamera"==n.type&&(l.x*=n.aspect);var c={x:l.x-h/2,y:l.y+u/2},d={x:l.x+h/2,y:l.y-u/2};return{target:e,z:e.mapNode.eid,position:l,leftTop:c,rightDown:d}}},{key:"getMarkers",value:function(e,t,n){var r=[],i=this.groups[e];if(!i)return r;var a,o=i.getLayers("facility"),s=b(o);try{for(s.s();!(a=s.n()).done;){var l=a.value;if(l.needAvoid)for(var u=0;u<l.scene.children.length;u++){var h,c=l.scene.children[u];c.mapNode.needAvoid&&c.mapNode.show&&(h=this.getSpriteInfo(c,!1,t,n),r.push(h))}}}catch(e){s.e(e)}finally{s.f()}var d,f=i.getLayers("label"),p=b(f);try{for(p.s();!(d=p.n()).done;){var m=d.value;if(m.needAvoid)for(var v=0;v<m.scene.children.length;v++){var g,y=m.scene.children[v];y.mapNode.needAvoid&&y.mapNode.show&&(g=this.getSpriteInfo(y,!0,t,n),r.push(g))}}}catch(e){p.e(e)}finally{p.f()}return(0,_.default)(r).call(r,function(e,t){return e.z-t.z}),r}},{key:"getAllImageMarker",value:function(e){var t=[],n=this.groups[e];if(!n)return t;for(var r=n.layers.imageMarker,i=0;i<r.length;i++)for(var a=0;a<r[i].scene.children.length;a++){var o=r[i].scene.children[a];t.push(o)}return t}},{key:"getUserMarkers",value:function(e,t,n){var r=[],i=this.groups[e];if(!i)return r;for(var a=i.layers.imageMarker,o=0;o<a.length;o++){var s=[];if(a[o].needAvoid){for(var l=0;l<a[o].scene.children.length;l++){var u,h=a[o].scene.children[l];h.mapNode.needAvoid&&h.mapNode.show&&(u=this.getSpriteInfo(h,!1,t,n),s.push(u))}r.push(s)}}for(var c=i.layers.textMarker,d=0;d<c.length;d++){var f=[];if(c[d].needAvoid){for(var p=0;p<c[d].scene.children.length;p++){var m,v=c[d].scene.children[p];v.mapNode.needAvoid&&v.mapNode.show&&(m=this.getSpriteInfo(v,!0,t,n),f.push(m))}r.push(f)}}return r}},{key:"getNodesExceptFacility",value:function(e,n){var t,r=[],i=b(e);try{for(i.s();!(t=i.n()).done;){var a=t.value,o=this.groups[a];o&&o.everyLayers(["facility","label","imageMarker","textMarker","dynmodel"],function(e){for(var t=0;t<e.children.length;t++)n&&!n(e.children[t])||r.push(e.children[t])})}}catch(e){i.e(e)}finally{i.f()}return r}},{key:"getDynnodes",value:function(n,e){var t,r=[],i=b(e);try{for(i.s();!(t=i.n()).done;){var a=t.value,o=this.groups[a];o&&o.getDynmodel(function(e){for(var t=0;t<e.children.length;t++)n&&!n(e.children[t])||r.push(e.children[t])})}}catch(e){i.e(e)}finally{i.f()}return r}},{key:"getGroupsModels",value:function(e){var t,n=[],r=b(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,a=this.groups[i];if(a){var o,s=a.getLayers("model"),l=b(s);try{for(l.s();!(o=l.n()).done;){var u=o.value;u.checkSceneNode(),n=(0,d.default)(n).call(n,u.scene.children)}}catch(e){l.e(e)}finally{l.f()}}}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"getGroupsExternalModels",value:function(e){var t,n=[],r=b(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,a=this.groups[i];if(a){var o,s=a.getLayers("externalModel"),l=b(s);try{for(l.s();!(o=l.n()).done;){var u=o.value;u.checkSceneNode();for(var h=0;h<u.scene.children.length;h++)u.scene.children[h].traverse(function(e){e instanceof fm.Mesh&&n.push(e)})}}catch(e){l.e(e)}finally{l.f()}}}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"getGroupsNodelsByFilter",value:function(e,t,n){var r,i=[],a=b(e);try{for(a.s();!(r=a.n()).done;){var o,s=r.value,l=this.groups[s];for(o in l.layers)if(t===o){var u,h=l.layers[o],c=b(h);try{for(c.s();!(u=c.n()).done;){var d=u.value;d.traverse(function(e){n(e)&&i.push({nodeType:e.nodeType,typeID:e.bdata&&e.bdata.type,data:e.bdata,target:e})})}}catch(e){c.e(e)}finally{c.f()}}}}catch(e){a.e(e)}finally{a.f()}return i}},{key:"getNodesExpectExtent",value:function(e){var t,n=[],r=b(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,a=this.groups[i];a.everyLayers(["extent"],function(e){n.push.apply(n,(0,s.default)(e.children))})}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"getRenderGroup",value:function(){var e,t=[];for(e in this.groups)this.groups[e].visible&&t.push(this.groups[e]);return(0,_.default)(t).call(t,function(e,t){return e.getHeight()-t.getHeight()})}},{key:"getLastRenderArray",value:function(){var e,t=[];for(e in this.groups)t.push.apply(t,(0,s.default)(this.groups[e].alwaysShowMarkers));return t}},{key:"getHeight",value:function(e){var t=this.groups[""+e]?this.groups[""+e].getHeight():this._space*e;return t}},{key:"setLabelLanguage",value:function(t){for(var e in this.groups)this.groups[e].traverseByAlias(["label"],function(e){e.setByLanguage(t)})}},{key:"dispose",value:function(){for(var e in this.groups)this.groups[e].dispose(),this.groups[e].parent=void 0,this.groups[e]=void 0;this.groups=void 0,this._theme&&(this._theme.dispose(),this._theme=void 0)}},{key:"mapcenter",get:function(){return(new fm.Vector2).copy(this._mapcenter)}},{key:"groupLength",get:function(){return this._groupIds.length}},{key:"groupIds",get:function(){return this._groupIds}},{key:"center",get:function(){return(new fm.Vector2).copy(this._center)},set:function(e){this._center=e}},{key:"theme",set:function(e){this._theme=e},get:function(){return this._theme}},{key:"bbox",get:function(){return this._bbox}},{key:"bboxTh",get:function(){return this._bboxTh}},{key:"space",get:function(){return this._space},set:function(e){for(var t in this._space=e,this.groups){var n=(0,v.default)(t);this.groups[t].height=e*n}}}]),r}(),E=S;t.default=E},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.FMTextureUtil=void 0;var a=r(n(2)),o=r(n(3)),s=r(n(228)),l=function(){function i(){(0,a.default)(this,i)}return(0,o.default)(i,null,[{key:"createTexture",value:function(e,t,n){var r=new fm.Texture;return r.minFilter=fm.LinearFilter,r.generateMipmaps=!1,r.wrapS=fm.ClampToEdgeWrapping,r.wrapT=fm.ClampToEdgeWrapping,s.default.createImage(e,t,function(e){r.image=e,r.needsUpdate=!0,n&&n(r)}),r}},{key:"createTexture_canvas",value:function(e,t,n){var r=t.toDataURL("image/png");return i.createTexture(e,r,n)}},{key:"createTexture_URL",value:function(e,t,n){return i.createTexture(e,t,n)}},{key:"createTexture_canvasFile",value:function(t,e,n){var r=new fm.Texture;r.minFilter=fm.LinearFilter,r.generateMipmaps=!1,r.wrapS=fm.RepeatWrapping,r.wrapT=fm.RepeatWrapping;var i=e.toDataURL("image/png").replace("data:image/png;base64,",""),a=wx.getFileSystemManager(),o=wx.env.USER_DATA_PATH+"/01.png";return a.writeFile({filePath:o,data:i,encoding:"base64",success:function(){wx.saveImageToPhotosAlbum({filePath:o,success:function(){}});var e=t.createImage();e.crossOrigin="Anonymous",e.onload=function(){r.image=e,r.needsUpdate=!0,n&&n(r)},e.src=o},fail:function(){}}),r}}]),i}();t.FMTextureUtil=l},function(e,t,n){"use strict";var i=n(48),r=function(e){var n,r;this.promise=new e(function(e,t){if(void 0!==n||void 0!==r)throw TypeError("Bad Promise constructor");n=e,r=t}),this.resolve=i(n),this.reject=i(r)};e.exports.f=function(e){return new r(e)}},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(13)),a=r(n(15)),s=r(n(9)),l=r(n(2)),u=r(n(3)),h=function(){function e(){(0,l.default)(this,e)}return(0,u.default)(e,[{key:"addEventListener",value:function(e,t){var n;void 0===this._listeners&&(this._listeners={});var r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===(0,s.default)(n=r[e]).call(n,t)&&r[e].push(t)}},{key:"hasEventListener",value:function(e,t){var n;if(void 0===this._listeners)return!1;var r=this._listeners;return void 0!==r[e]&&-1!==(0,s.default)(n=r[e]).call(n,t)}},{key:"removeEventListener",value:function(e,t){var n,r,i;void 0!==this._listeners&&(n=this._listeners,r=n[e],void 0!==r&&(i=(0,s.default)(r).call(r,t),-1!==i&&(0,a.default)(r).call(r,i,1)))}},{key:"dispatchEvent",value:function(e){if(void 0!==this._listeners){var t=this._listeners,n=t[e.type];if(void 0!==n)for(var r=(0,o.default)(n).call(n,0),i=0,a=r.length;i<a;i++)r[i].call(this,e)}}}]),e}(),c=h;t.default=c},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(9)),o=r(n(2)),s=r(n(3)),l=r(n(205)),u=r(n(209)),h=r(n(210)),c=function(){function t(e){(0,o.default)(this,t),this._options=e,this._staticNaviScene=null,this._wktReader=new u.default,this._scene=null}return(0,s.default)(t,[{key:"setScene",value:function(e){this._scene=e}},{key:"queryScene",value:function(e,n){var t,r=this;this._options.useStatic?(t=this._options.naviServerURL+"/"+e+".fmap",new l.default(t,function(e){var t=r._convertStatic1(e);n(t.scene_data)},!0)):(t=this._options.naviServerURL+"/"+e,new l.default(t,function(e){var t=r._convertSite1(e);n(t.scene_data)},!0))}},{key:"queryNaviData",value:function(e,n,r){var t,i,a,o,s=this;this._options.useStatic?(t=s._convertStatic2(n),r(t)):(i=null,a=null,o=null,s=this,new l.default(this._options.naviServerURL+"/group_v2/"+e+"/"+n+"/geo",function(e){var t;i=e,null!=i&&null!=a&&null!=o&&(t=s._convertSite2(n,i,a,o),r(t))},!0),new l.default(this._options.naviServerURL+"/group_v2/"+e+"/"+n+"/biz",function(e){var t;a=e,null!=i&&null!=a&&null!=o&&(t=s._convertSite2(n,i,a,o),r(t))},!0),new l.default(this._options.naviServerURL+"/group_v2/"+e+"/"+n+"/navi",function(e){var t;o=e,null!=i&&null!=a&&null!=o&&(t=s._convertSite2(n,i,a,o),r(t))},!0))}},{key:"convertToGroup",value:function(e,t,n,r){return this._convertToGroup(e,t,n,r)}},{key:"convertGeo2Geometry",value:function(e,t){return this._convertGeo2Geometry(e,t)}},{key:"convertArray2Geometry",value:function(e,t){return this._convertArray2Geometry(e,t)}},{key:"_convertSite1",value:function(e){var t=fmSceneDecode(e),e={scene_data:t};return e}},{key:"_convertSite2",value:function(e,t,n,r){var i=fmFloorGeoDecode(t),a=fmFloorBizDecode(n),o=fmFloorNaviDecode(r);return this._convertToGroup(e,i,a,o)}},{key:"_convertGeo2Geometry",value:function(e){var t=this._wktReader.parse(e);return{points:t._points,holes:t._holes}}},{key:"_convertArray2Geometry",value:function(e,t){var n=(new h.default).parseGeometry(e,t);return{points:n._points,holes:n._holes}}},{key:"_tempFlipX",value:function(e){if(e&&"string"!=typeof e)for(var t in e){var n=e[t];if("vertices"==t||"vertex"==t)for(var r in n)r%2==0&&(n[r]=-n[r]);else"scene_data"==t?(n.x=-n.x,n.defCenX=-n.defCenX):this._tempFlipX(n)}}},{key:"_convertStringToArray",value:function(e){if(""==e||!e)return[];var t=[],n=e,r=[];return 0<=(0,a.default)(n).call(n,"|")||0<=(0,a.default)(n).call(n,"-")||0<=(0,a.default)(n).call(n,",")?(r=n.split(/[|,-]/),t.push.apply(t,r)):t.push(n),t}},{key:"_convertStatic1",value:function(e){return this._staticNaviScene=fmMapDecode(e,!1),e={scene_data:this._staticNaviScene.scene},e}},{key:"_convertStatic2",value:function(e){for(var t=this._staticNaviScene.floors,n=0;n<t.length;n++){var r=t[n];if(r.gid==e)return this._convertToGroup(e,r.geo[0],r.biz[0],r.navi[0])}return null}},{key:"_convertToGroup",value:function(e,t,n,r){for(var i={},a=[],o=[],s=[],l=[],u=[],h=this._scene.scene.file_ver,c=0,d=t.extentLayer.length;c<d;c++){var f=t.extentLayer[c],p=null,p=1===h?this._convertGeo2Geometry(f.geo):this._convertArray2Geometry(f.idxs,f.pts);f.geoArr=p.points,f.holes=p.holes,o.push(f)}for(var m=0,v=t.labelLayer.length;m<v;m++)i[t.labelLayer[m].eid]=t.labelLayer[m];for(var g=0,y=t.modelLayer.length;g<y;g++){var _=t.modelLayer[g],x=n.modelLayer[g],w={};w.fid=x.fid,w.eid=_.eid,w.pass=x.pass,w.center=1===h?this._convertGeo2Geometry(i[_.eid].geo).points[0]:this._convertArray2Geometry(i[_.eid].idxs,i[_.eid].pts).points[0];var b=null,b=1===h?this._convertGeo2Geometry(_.geo):this._convertArray2Geometry(_.idxs,_.pts);w.geoArr=b.points,w.holes=b.holes,a.push(w)}for(var M=0,T=r.naviNodes.length;M<T;M++){var S=r.naviNodes[M];S.geoArr=1===h?this._convertGeo2Geometry(S.geo).points[0]:this._convertArray2Geometry(S.idxs,S.pts).points[0],S.linkSegArr=this._convertStringToArray(S.linkSeg),S.liftFloorArr=this._convertStringToArray(S.liftFloor),s.push(S)}for(var E=0,A=r.naviSegments.length;E<A;E++){var I=r.naviSegments[E];I.geoArr=1===h?this._convertGeo2Geometry(I.geo).points:this._convertArray2Geometry(I.idxs,I.pts).points,I.m_Id=r.mid,l.push(I)}if(r.naviZones)for(var L=0,A=r.naviZones.length;L<A;L++){var R=r.naviZones[L],N=null,N=1===h?this._convertGeo2Geometry(R.geo):this._convertArray2Geometry(R.idxs,R.pts);R.geoArr=N.points,R.holes=N.holes,R.m_Id=r.mid,u.push(R)}var k={gid:e,extentLayer:o,modelLayer:a,naviSegments:l,naviNodes:s,naviZones:u};return k}}]),t}(),d=c;t.default=d},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={RIGHT:1,LEFT:2,BOTTOM:3,TOP:4,RIGHT_BOTTOM:5,LEFT_BOTTOM:6,RIGHT_TOP:7,LEFT_TOP:8,CENTER:9},a=i;t.default=a},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(2)),s=r(n(3)),l=r(n(5)),u=r(n(6)),h=r(n(7)),c=r(n(17));function d(r){var i=f();return function(){var e,t=(0,h.default)(r),n=i?(e=(0,h.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,u.default)(this,n)}}function f(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var p=function(e){(0,l.default)(i,e);var r=d(i);function i(e,t){var n;return(0,o.default)(this,i),n=r.call(this,e,t),n._renderNode=null,n._isInit=!1,n}return(0,s.default)(i,[{key:"init",value:function(){}},{key:"dispose",value:function(){this._renderNode&&(this._renderNode.material.texture&&this._renderNode.material.texture.dispose(),this._renderNode.material.dispose(),this._renderNode.geometry.dispose(),this._renderNode.material=void 0,this._renderNode.geometry=void 0,this._geometry=void 0,this._renderNode.mapNode=void 0,this._renderNode=void 0)}},{key:"renderNode",get:function(){return this._renderNode}},{key:"isInit",get:function(){return this._isInit}}]),i}(c.default),m=p;t.default=m},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(20)),u=r(n(14)),h=r(n(21)),c=r(n(22)),a=r(n(18)),o=r(n(13)),s=r(n(4)),d=r(n(9)),f=r(n(110)),v=r(n(49)),g=r(n(12)),y=r(n(10)),_=r(n(36)),p=r(n(33)),m=r(n(2)),x=r(n(3)),w=r(n(5)),b=r(n(6)),M=r(n(7)),T=r(n(17));n(249);var S=r(n(250)),E=r(n(538)),A=r(n(113)),I=r(n(248)),L=n(67);function R(r){var i=N();return function(){var e,t=(0,M.default)(r),n=i?(e=(0,M.default)(this).constructor,(0,s.default)(t,arguments,e)):t.apply(this,arguments);return(0,b.default)(this,n)}}function N(){if("undefined"==typeof Reflect||!s.default)return!1;if(s.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,s.default)(Date,[],function(){})),!0}catch(e){return!1}}function k(e,t){var n;if(void 0===c.default||null==(0,h.default)(e)){if((0,u.default)(e)||(n=P(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=(0,l.default)(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function P(e,t){var n;if(e){if("string"==typeof e)return C(e,t);var r=(0,o.default)(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?(0,a.default)(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?C(e,t):void 0}}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var D=function(e){var t,n=k(this._lineNodes);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.line.material.uniforms.offset.value.y-=.001*e.delTime,this.passed){if(r.gid!==this._passedGid)continue;r.line.material.uniforms.miny.value=this.specific}}}catch(e){n.e(e)}finally{n.f()}},O=function(e){(0,w.default)(n,e);var t=R(n);function n(){var e;return(0,m.default)(this,n),e=t.call(this),e._renderNode=null,e._segment=[],e._noAnimate=!0,e._lineDis=[],e._lineNodes=[],e._style=null,e._secLen=60,e._hwProp=10,e._passed=!0,e._passedColor="#aeaeae",e._specific=0,e}return(0,x.default)(n,[{key:"addSegment",value:function(e){this._segment.push(e)}},{key:"convertPointByCenter",value:function(e,t){return[e.x-t.x,e.z,-e.y+t.y]}},{key:"segPointsToLinePnts",value:function(e){for(var t,n,r=[],i=0;i<this._segment.points.length;i++)0<i&&i<this._segment.points.length-1&&this._segment.points[i-1],r.push.apply(r,(0,p.default)(this.convertPointByCenter(this._segment.points[i],e))),0!==i&&(t=new fm.Vector3(this._segment.points[i].x,this._segment.points[i].y,this._segment.points[i].z),n=new fm.Vector3(this._segment.points[i-1].x,this._segment.points[i-1].y,this._segment.points[i-1].z),this._lineDis.push(t.distanceTo(n)));return r}},{key:"getIndexDis",value:function(e){for(var t=0,n=0;n<this._lineDis.length;n++)n<e&&(t+=this._lineDis[n]);return t}},{key:"computerUVY",value:function(){for(var e,t=[],n=this.getIndexDis(this._lineDis.length),r=0;r<this._segment.points.length;r++)0===r?t.push(0):r===this._segment.points.length-1?t.push(1):(e=this.getIndexDis(r)/n,t.push(e),t.push(e));return t}},{key:"initLine",value:function(e,t,n){var r,i,a;this._style=t,t.mapUrl?t.useMap=!0:(r=t.lineWidth,t.lineWidth&&(r*=n.wxInfo.pixelRatio),i=this.getLineTextureParams(t.lineType,r,t.godColor,t.godEdgeColor,t.color),n.wxInfo.pixelRatio&&i.dashArray.constructor===Array&&(0,_.default)(a=i.dashArray).call(a,function(e,t){i.dashArray[t]=e*n.wxInfo.pixelRatio}),t.useMap=i.useMap,t.useMap&&(t.map=n.nodeManager.materialManager[i.textureCommand](i),(0,y.default)(t).wrapS=fm.RepeatWrapping,(0,y.default)(t).wrapT=fm.RepeatWrapping));for(var o=this._segment.length-1;-1<o;o--){var s=this.createLine(this._segment[o],e,t,n),l=n.getFMGroup(this._segment[o].groupId);if(l){if(this._lineNodes.push({line:s,gid:this._segment[o].groupId,seg:this._segment[o],isCross:!1}),l.addLine(s),-1<o-1&&this._segment[o].groupId!==this._segment[o-1].groupId){var u=n.getFMGroup(this._segment[o-1].groupId);if(!u){console.warn(L.tileMessage.noGroup);continue}var h=u.height+u.offsetHeight,c=(0,g.default)({},this._segment[o-1].points[this._segment[o-1].points.length-1]),d=(0,g.default)({},this._segment[o].points[0]),f=n.getFMGroup(this._segment[o].groupId);if(!f){console.warn(L.tileMessage.noGroup);continue}c.z=h-f.height-f.offsetHeight+c.z-d.z;var p=new A.default([c,d]);p.groupId=this._segment[o].groupId;var m=this.createLine(p,e,t,n);this._lineNodes.push({line:m,gid:this._segment[o-1].groupId,gidAn:this._segment[o].groupId,seg:p,isCross:!0}),u.addLine(m)}}else console.warn(L.tileMessage.noGroup)}this._noAnimate=t.noAnimate,this._noAnimate||n.on("frameLoop",(0,v.default)(D).call(D,this))}},{key:"computeMaterialRepeat",value:function(e,t,n,r){var i=t.allLength,a=i*n.getPixelTo3DdisByGid(t.groupId),o=Math.floor(a/r);(0,f.default)(e.uniforms).value.y=o}},{key:"resetRepeat",value:function(e){var t,n=k(this._lineNodes);try{for(n.s();!(t=n.n()).done;){var r=t.value;this.computeMaterialRepeat(r.line.material,r.seg,e,this._secLen)}}catch(e){n.e(e)}finally{n.f()}}},{key:"rebuildLine",value:function(e,t,n,r){this.removeByMap(t);for(var i=this._style,a=this._segment.length-1;-1<a;a--){var o,s,l,u,h,c,d,f=this.createLine(this._segment[a],e,i,t),p=t.getFMGroup(this._segment[a].groupId);this._lineNodes.push({line:f,gid:this._segment[a].groupId,seg:this._segment[a],isCross:!1}),p.addLine(f),-1<a-1&&this._segment[a].groupId!=this._segment[a-1].groupId&&(o=t.getFMGroup(this._segment[a-1].groupId),s=o.height+o.offsetHeight,l=(0,g.default)({},this._segment[a].points[this._segment[a].points.length-1]),u=(0,g.default)({},this._segment[a-1].points[0]),h=t.getFMGroup(this._segment[a].groupId),l.z=s-h.height-h.offsetHeight+l.z-u.z,c=new A.default([l,u]),c.groupId=this._segment[a].groupId,d=this.createLine(c,e,i,t),this._lineNodes.push({line:d,gid:this._segment[a-1].groupId,gidAn:this._segment[a].groupId,seg:c,isCross:!0}),o.addLine(d))}this.hideOrShowBy(n,r)}},{key:"removeByMap",value:function(e,t){var n,r=k(this._lineNodes);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.line.material.dispose(),i.line.geometry.dispose();var a=e.getFMGroup(i.gid);a.removeLine(i.line)}}catch(e){r.e(e)}finally{r.f()}t&&e.off("frameLoop",D),this._lineNodes.length=0}},{key:"dispose",value:function(e){this.removeByMap(e,!0)}},{key:"hideOrShowBy",value:function(e){var t,n=k(this._lineNodes);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.isCross?(0,d.default)(e).call(e,r.gid)<0||(0,d.default)(e).call(e,r.gidAn)<0?r.line.visible=!1:r.line.visible=!0:-1<(0,d.default)(e).call(e,r.gid)?r.line.visible=!0:r.line.visible=!1}}catch(e){n.e(e)}finally{n.f()}}},{key:"createLine",value:function(e,t,n,r){var i=r.getFMGroup(e.groupId),a=i.height+i.offsetHeight,o=new fm.Vector3(0,a,0),s=new S.default;e.needSmooth=!1!==n.smooth,e.initSegement(t,n.radius);for(var l=[],u=0;u<e.linePoints.length;u++)l.push(e.linePoints[u]);var h=e.uvys;s.setPositions(l),s.setUvys(h);var c=new fm.LineMaterial({linewidth:5,vertexColors:fm.VertexColors,dashed:!1,transparent:!0});n.color&&(c.color=new fm.Color(n.color)),c.resolution.set(n.resolution.x,n.resolution.y);var d=n.lineWidth;d&&(d*=r.wxInfo.pixelRatio),c.linewidth=d,n.useMap&&(c.defines.USE_MMAP=!0,n.mapUrl?(n.useMap=!0,r.nodeManager.materialManager.loadTexture(n.mapUrl,function(e){e.wrapS=fm.RepeatWrapping,e.wrapT=fm.RepeatWrapping,c.uniforms.mmap.value=e,c.needsUpdate=!0})):c.uniforms.mmap.value=(0,y.default)(n),this.computeMaterialRepeat(c,e,r,this._secLen),c.needsUpdate=!0);var f=new E.default(s,c);return f.computeLineDistances(),f.position.set(o.x,o.y,o.z),f}},{key:"initLinePoints",value:function(e,t){var n=new S.default;n.setPositions(e);var r=new fm.LineMaterial({color:t.color,linewidth:t.lineWidth,vertexColors:fm.VertexColors,dashed:!1,transparent:!0});r.lineWidth=t.lineWidth,r.resolution.set(t.resolution.x,t.resolution.y),this._renderNode=new E.default(n,r),this._renderNode.computeLineDistances()}},{key:"moveUv",value:function(e){if(this._noAnimate){var t,n=k(this._lineNodes);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.line.material.uniforms.offset.value.y-=e}}catch(e){n.e(e)}finally{n.f()}}}},{key:"getLineTextureParams",value:function(e,t,n,r,i){var a={type:"normal",width:128,height:128,color:void 0!==i?i:"#ff0000",arrowWidth:20,arrowHeightPercent:.6,arrowWidthPercent:1,arrowPercent:.1,lineType:null,dashArray:[2,1],textureCommand:"createNormalLineTexture",godHeightPercent:1,godEdgePercent:.2,godArrowPercent:.15,godColor:void 0!==n?n:"#33cc61",godEdgeColor:void 0!==r?r:"#4a82d2",godArrowColor:"#F4FEFB",godArrowXScale:4,godArrowWidthPercent:.9};switch(e){case I.default.FULL:a.useMap=!1;break;case I.default.DOTTED:a.dashArray=[1,1],a.useMap=!0;break;case I.default.DOT_DASH:a.dashArray=[2.5,1,.5,1],a.useMap=!0;break;case I.default.CENTER:a.dashArray=[3,1,1.5,1],a.useMap=!0;break;case I.default.DASH:a.dashArray=[2,1],a.useMap=!0;break;case I.default.DOUBLE_DOT_DASH:a.dashArray=[2.5,.5,.5,.5,.5,.5],a.useMap=!0;break;case I.default.TRI_DOT_DASH:a.dashArray=[2.5,.5,.5,.5,.5,.5,.5,.5],a.useMap=!0;break;case I.default.ARROW:a.dashArray=[5,0],a.useMap=!0,a.textureCommand="createArrowLineTexture";break;case I.default.FMARROW:var o=void 0!==t?t:8,s=o*this._hwProp;this._secLen=s,a.width=10*o,a.height=10*s,a.arrowWidth=a.height/8,a.dashArray=[7,0],a.useMap=!0,a.textureCommand="createArrowWidthBackTexture";break;default:a.useMap=!1}return a}},{key:"setPassed",value:function(e,t){for(var n=0,r=0,i=[],a=0;a<this._segment.length;a++)if(this._segment[a].groupId===e){i=this._segment[a]._points;break}for(var o=0;o<i.length;o++)0!==o&&(t<o&&(r+=Math.abs(Math.sqrt(Math.pow(i[o].y-i[o-1].y,2)+Math.pow(i[o].x-i[o-1].x,2)))),n+=Math.abs(Math.sqrt(Math.pow(i[o].y-i[o-1].y,2)+Math.pow(i[o].x-i[o-1].x,2))));this._specific=r/n,this._passedGid=e}},{key:"renderNode",get:function(){return this._renderNode}},{key:"segment",get:function(){return this._segment}},{key:"passed",get:function(){return this._passed},set:function(e){this._passed=e}},{key:"passedColor",get:function(){return this._passedColor},set:function(e){this._passedColor=e}},{key:"specific",get:function(){return this._specific},set:function(e){this._specific=e}}]),n}(T.default),F=O,B=F;t.default=B},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=function(){function e(){(0,a.default)(this,e),this.x=void 0,this.y=void 0,this.z=void 0,this.gid=void 0}return(0,o.default)(e,[{key:"setGeoPoint",value:function(e){this.x=e.x,this.y=e.y}}]),e}(),l=s;t.default=l},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=function(){function e(){(0,a.default)(this,e),this.minX=Number.MAX_VALUE,this.minY=Number.MAX_VALUE,this.maxX=-Number.MAX_VALUE,this.maxY=-Number.MAX_VALUE}return(0,o.default)(e,[{key:"init",value:function(){this.minX=Number.MAX_VALUE,this.minY=Number.MAX_VALUE,this.maxX=-Number.MAX_VALUE,this.maxY=-Number.MAX_VALUE}},{key:"expandBy",value:function(e){e&&e.x&&e.y&&(this.minX>e.x&&(this.minX=e.x),this.maxX<e.x&&(this.maxX=e.x),this.minY>e.y&&(this.minY=e.y),this.maxY<e.y&&(this.maxY=e.y))}},{key:"isSeparate",value:function(e){return this.minX>e.maxX||this.minY>e.maxY||this.maxX<e.minX||this.maxY<e.minY}}]),e}(),l=s;t.default=l},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.Vector3=d;var a,o,s,l,u=r(n(12)),h=n(114),c=n(256);function d(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}(0,u.default)(d.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:(l=new c.Quaternion,function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(l.setFromEuler(e))}),applyAxisAngle:(s=new c.Quaternion,function(e,t){return this.applyQuaternion(s.setFromAxisAngle(e,t))}),applyMatrix3:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this},applyQuaternion:function(e){var t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,l=s*t+a*r-o*n,u=s*n+o*t-i*r,h=s*r+i*n-a*t,c=-i*t-a*n-o*r;return this.x=l*s+c*-i+u*-o-h*-a,this.y=u*s+c*-a+h*-i-l*-o,this.z=h*s+c*-o+l*-a-u*-i,this},project:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},unproject:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)},transformDirection:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},cross:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this},projectOnVector:function(e){var t=e.dot(this)/e.lengthSq();return this.copy(e).multiplyScalar(t)},projectOnPlane:(o=new d,function(e){return o.copy(this).projectOnVector(e),this.sub(o)}),reflect:(a=new d,function(e){return this.sub(a.copy(e).multiplyScalar(2*this.dot(e)))}),angleTo:function(e){var t=this.dot(e)/Math.sqrt(this.lengthSq()*e.lengthSq());return Math.acos(h._Math.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},setFromSphericalCoords:function(e,t,n){var r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this},setFromCylindrical:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},setFromCylindricalCoords:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}})},function(e){"use strict";var t,n="object"==typeof Reflect?Reflect:null,h=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};function l(e){console&&console.warn&&console.warn(e)}t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=y,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function o(e,t,n,r){var i,a,o,s;return u(n),a=e._events,void 0===a?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]),void 0===o?(o=a[t]=n,++e._eventsCount):("function"==typeof o?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),i=c(e),0<i&&o.length>i&&!o.warned&&(o.warned=!0,s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit"),s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=o.length,l(s))),e}function s(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=s.bind(r);return i.listener=n,r.wrapFn=i,i}function f(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?g(i):m(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function m(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function v(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function g(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function y(i,a){return new Promise(function(e,t){function n(){void 0!==r&&i.removeListener("error",r),e([].slice.call(arguments))}var r;"error"!==a&&(r=function(e){i.removeListener(a,n),t(e)},i.once("error",r)),i.once(a,n)})}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r,i="error"===e,a=this._events;if(void 0!==a)i=i&&void 0===a.error;else if(!i)return!1;if(i){if(0<t.length&&(r=t[0]),r instanceof Error)throw r;var o=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw o.context=r,o}var s=a[e];if(void 0===s)return!1;if("function"==typeof s)h(s,this,t);else for(var l=s.length,u=m(s,l),n=0;n<l;++n)h(u[n],this,t);return!0},i.prototype.addListener=function(e,t){return o(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return o(this,e,t,!0)},i.prototype.once=function(e,t){return u(t),this.on(e,d(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,d(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,i,a,o;if(u(t),r=this._events,void 0===r)return this;if(n=r[e],void 0===n)return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;0<=a;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():v(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n=this._events;if(void 0===n)return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){for(var r,i=Object.keys(n),a=0;a<i.length;++a)r=i[a],"removeListener"!==r&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],"function"==typeof t)this.removeListener(e,t);else if(void 0!==t)for(a=t.length-1;0<=a;a--)this.removeListener(e,t[a]);return this},i.prototype.listeners=function(e){return f(this,e,!0)},i.prototype.rawListeners=function(e){return f(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},i.prototype.listenerCount=p,i.prototype.eventNames=function(){return 0<this._eventsCount?t(this._events):[]}},function(e,t,n){t=e.exports=n(257),t.Stream=t,t.Readable=t,t.Writable=n(159),t.Duplex=n(70),t.Transform=n(261),t.PassThrough=n(579)},function(e,t,n){var r=n(158),i=r.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(a(r,t),t.Buffer=o),a(i,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,ee,te){"use strict";(function(e){var r=te(569),a=te(570),o=te(571);function t(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}function n(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(n()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=c.prototype):(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,n){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,t,n);if("number"!=typeof e)return i(this,e,t,n);if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return h(this,e)}function i(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?p(e,t,n,r):"string"==typeof t?d(e,t,n):m(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function u(e,t,n,r){return l(t),t<=0||void 0===n?s(e,t):"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n)}function h(e,t){if(l(t),e=s(e,t<0?0:0|v(t)),!c.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function d(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!c.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|y(t,n);e=s(e,r);var i=e.write(t,n);return i!==r&&(e=e.slice(0,i)),e}function f(e,t){var n=t.length<0?0:0|v(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function p(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),c.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=c.prototype):e=f(e,t),e}function m(e,t){if(c.isBuffer(t)){var n=0|v(t.length);return e=s(e,n),0===e.length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||$(t.length)?s(e,0):f(e,t);if("Buffer"===t.type&&o(t.data))return f(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function v(e){if(e>=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|e}function g(e){return+e!=e&&(e=0),c.alloc(+e)}function y(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return K(e).length;default:if(r)return X(e).length;t=(""+t).toLowerCase(),r=!0}}function _(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e=e||"utf8";;)switch(e){case"hex":return D(this,t,n);case"utf8":case"utf-8":return R(this,t,n);case"ascii":return P(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return L(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function x(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function w(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):2147483647<n?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,i);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){var a=1,o=e.length,s=t.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i)for(var u=-1,h=n;h<o;h++)if(l(e,h)===l(t,-1===u?0:h-u)){if(-1===u&&(u=h),h-u+1===s)return u*a}else-1!==u&&(h-=h-u),u=-1;else for(o<n+s&&(n=o-s),h=n;0<=h;h--){for(var c=!0,d=0;d<s;d++)if(l(e,h+d)!==l(t,d)){c=!1;break}if(c)return h}return-1}function M(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),i<r&&(r=i)):r=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");a/2<r&&(r=a/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[n+o]=s}return o}function T(e,t,n,r){return Q(X(t,e.length-n),e,n,r)}function S(e,t,n,r){return Q(Z(t),e,n,r)}function E(e,t,n,r){return S(e,t,n,r)}function A(e,t,n,r){return Q(K(t),e,n,r)}function I(e,t,n,r){return Q(J(t,e.length-n),e,n,r)}function L(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function R(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a,o,s,l,u=e[i],h=null,c=239<u?4:223<u?3:191<u?2:1;if(i+c<=n)switch(c){case 1:u<128&&(h=u);break;case 2:a=e[i+1],128==(192&a)&&(l=(31&u)<<6|63&a,127<l&&(h=l));break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(l=(15&u)<<12|(63&a)<<6|63&o,2047<l&&(l<55296||57343<l)&&(h=l));break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s,65535<l&&l<1114112&&(h=l))}null===h?(h=65533,c=1):65535<h&&(h-=65536,r.push(h>>>10&1023|55296),h=56320|1023&h),r.push(h),i+=c}return k(r)}ee.Buffer=c,ee.SlowBuffer=g,ee.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:t(),ee.kMaxLength=n(),c.poolSize=8192,c._augment=function(e){return e.__proto__=c.prototype,e},c.from=function(e,t,n){return i(null,e,t,n)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(e,t,n){return u(null,e,t,n)},c.allocUnsafe=function(e){return h(null,e)},c.allocUnsafeSlow=function(e){return h(null,e)},c.isBuffer=function(e){return!(null==e||!e._isBuffer)},c.compare=function(e,t){if(!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;for(var n=c.allocUnsafe(t),r=0,i=0;i<e.length;++i){var a=e[i];if(!c.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,r),r+=a.length}return n},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)x(this,t,t+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)x(this,t,t+3),x(this,t+1,t+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)x(this,t,t+7),x(this,t+1,t+6),x(this,t+2,t+5),x(this,t+3,t+4);return this},c.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?R(this,0,e):_.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=ee.INSPECT_MAX_BYTES;return 0<this.length&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},c.prototype.compare=function(e,t,n,r,i){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(i<=r&&n<=t)return 0;if(i<=r)return-1;if(n<=t)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var a=i-r,o=n-t,s=Math.min(a,o),l=this.slice(r,i),u=e.slice(t,n),h=0;h<s;++h)if(l[h]!==u[h]){a=l[h],o=u[h];break}return a<o?-1:o<a?1:0},c.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},c.prototype.indexOf=function(e,t,n){return w(this,e,t,n,!0)},c.prototype.lastIndexOf=function(e,t,n){return w(this,e,t,n,!1)},c.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||i<n)&&(n=i),0<e.length&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r=r||"utf8";for(var a=!1;;)switch(r){case"hex":return M(this,e,t,n);case"utf8":case"utf-8":return T(this,e,t,n);case"ascii":return S(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return A(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var N=4096;function k(e){var t=e.length;if(t<=N)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=N));return n}function P(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function C(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function D(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||r<n)&&(n=r);for(var i="",a=t;a<n;++a)i+=q(e[a]);return i}function O(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function F(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(n<e+t)throw new RangeError("Trying to access beyond buffer length")}function B(e,t,n,r,i,a){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(i<t||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function U(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);i<a;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function z(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);i<a;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function G(e,t,n,r){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function V(e,t,n,r,i){return i||G(e,t,n,4,34028234663852886e22,-34028234663852886e22),a.write(e,t,n,r,23,4),n+4}function H(e,t,n,r,i){return i||G(e,t,n,8,17976931348623157e292,-17976931348623157e292),a.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){var n=this.length;if(e=~~e,t=void 0===t?n:~~t,e<0?(e+=n,e<0&&(e=0)):n<e&&(e=n),t<0?(t+=n,t<0&&(t=0)):n<t&&(t=n),t<e&&(t=e),c.TYPED_ARRAY_SUPPORT)i=this.subarray(e,t),i.__proto__=c.prototype;else for(var r=t-e,i=new c(r,void 0),a=0;a<r;++a)i[a]=this[a+e];return i},c.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||F(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},c.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||F(e,t,this.length);for(var r=this[e+--t],i=1;0<t&&(i*=256);)r+=this[e+--t]*i;return r},c.prototype.readUInt8=function(e,t){return t||F(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||F(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||F(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||F(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||F(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,i<=r&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||F(e,t,this.length);for(var r=t,i=1,a=this[e+--r];0<r&&(i*=256);)a+=this[e+--r]*i;return i*=128,i<=a&&(a-=Math.pow(2,8*t)),a},c.prototype.readInt8=function(e,t){return t||F(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||F(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){t||F(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return t||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||F(e,4,this.length),a.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||F(e,4,this.length),a.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||F(e,8,this.length),a.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||F(e,8,this.length),a.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,n,r){var i;e=+e,t|=0,n|=0,r||(i=Math.pow(2,8*n)-1,B(this,e,t,n,i,0));var a=1,o=0;for(this[t]=255&e;++o<n&&(a*=256);)this[t+o]=e/a&255;return t+n},c.prototype.writeUIntBE=function(e,t,n,r){var i;e=+e,t|=0,n|=0,r||(i=Math.pow(2,8*n)-1,B(this,e,t,n,i,0));var a=n-1,o=1;for(this[t+a]=255&e;0<=--a&&(o*=256);)this[t+a]=e/o&255;return t+n},c.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):U(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):U(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):z(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):z(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,n,r){var i;e=+e,t|=0,r||(i=Math.pow(2,8*n-1),B(this,e,t,n,i-1,-i));var a=0,o=1,s=0;for(this[t]=255&e;++a<n&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){var i;e=+e,t|=0,r||(i=Math.pow(2,8*n-1),B(this,e,t,n,i-1,-i));var a=n-1,o=1,s=0;for(this[t+a]=255&e;0<=--a&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):U(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):U(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):z(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):z(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,n){return V(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return V(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return H(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return H(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(n=n||0,r||0===r||(r=this.length),t>=e.length&&(t=e.length),t=t||0,0<r&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,a=r-n;if(this===e&&n<t&&t<r)for(i=a-1;0<=i;--i)e[i+t]=this[i+n];else if(a<1e3||!c.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},c.prototype.fill=function(e,t,n,r){if("string"==typeof e){var i;if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length&&(i=e.charCodeAt(0),i<256&&(e=i)),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;if(t>>>=0,n=void 0===n?this.length:n>>>0,e=e||0,"number"==typeof e)for(s=t;s<n;++s)this[s]=e;else for(var a=c.isBuffer(e)?e:X(new c(e,r).toString()),o=a.length,s=0;s<n-t;++s)this[s+t]=a[s%o];return this};var j=/[^+\/0-9A-Za-z-_]/g;function W(e){if(e=Y(e).replace(j,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function Y(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function q(e){return e<16?"0"+e.toString(16):e.toString(16)}function X(e,t){var n;t=t||Infinity;for(var r=e.length,i=null,a=[],o=0;o<r;++o){if(n=e.charCodeAt(o),55295<n&&n<57344){if(!i){if(56319<n){-1<(t-=3)&&a.push(239,191,189);continue}if(o+1===r){-1<(t-=3)&&a.push(239,191,189);continue}i=n;continue}if(n<56320){-1<(t-=3)&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&-1<(t-=3)&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function Z(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}function J(e,t){for(var n,r,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function K(e){return r.toByteArray(W(e))}function Q(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function $(e){return e!=e}}).call(this,te(47))},function(O,e,F){"use strict";(function(e,t,n){var o=F(115);function d(e){var t=this;this.next=null,this.entry=null,this.finish=function(){D(t,e)}}O.exports=y;var s,l=!e.browser&&-1<["v0.10","v0.9."].indexOf(e.version.slice(0,5))?t:o.nextTick;y.WritableState=g;var r=Object.create(F(96));r.inherits=F(78);var i={deprecate:F(577)},a=F(258),u=F(157).Buffer,h=n.Uint8Array||function(){};function c(e){return u.from(e)}function f(e){return u.isBuffer(e)||e instanceof h}var p,m=F(259);function v(){}function g(e,t){s=s||F(70),e=e||{};var n=t instanceof s;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var r=e.highWaterMark,i=e.writableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n&&(i||0===i)?i:a,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===e.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){E(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new d(this)}function y(e){if(s=s||F(70),!(p.call(y,this)||this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),a.call(this)}function _(e,t){var n=new Error("write after end");e.emit("error",n),o.nextTick(t,n)}function x(e,t,n,r){var i=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(r,a),i=!1),i}function w(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=u.from(t,n)),t}function b(e,t,n,r,i,a){var o;n||(o=w(t,r,i),r!==o&&(n=!0,i="buffer",r=o));var s=t.objectMode?1:r.length;t.length+=s;var l,u=t.length<t.highWaterMark;return u||(t.needDrain=!0),t.writing||t.corked?(l=t.lastBufferedRequest,t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1):M(e,t,!1,s,r,i,a),u}function M(e,t,n,r,i,a,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function T(e,t,n,r,i){--t.pendingcb,n?(o.nextTick(i,r),o.nextTick(P,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),P(e,t))}function S(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function E(e,t){var n,r=e._writableState,i=r.sync,a=r.writecb;S(r),t?T(e,r,i,t,a):(n=R(r),n||r.corked||r.bufferProcessing||!r.bufferedRequest||L(e,r),i?l(A,e,r,n,a):A(e,r,n,a))}function A(e,t,n,r){n||I(e,t),t.pendingcb--,r(),P(e,t)}function I(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function L(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),a=t.corkedRequestsFree;a.entry=n;for(var o=0,s=!0;n;)i[o]=n,n.isBuf||(s=!1),n=n.next,o+=1;i.allBuffers=s,M(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new d(t),t.bufferedRequestCount=0}else{for(;n;){var l=n.chunk,u=n.encoding,h=n.callback,c=t.objectMode?1:l.length;if(M(e,t,!1,c,l,u,h),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function R(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function N(t,n){t._final(function(e){n.pendingcb--,e&&t.emit("error",e),n.prefinished=!0,t.emit("prefinish"),P(t,n)})}function k(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(N,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function P(e,t){var n=R(t);return n&&(k(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}function C(e,t,n){t.ending=!0,P(e,t),n&&(t.finished?o.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}function D(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}r.inherits(y,a),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:i.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===y&&e&&e._writableState instanceof g}})):p=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,n){var r=this._writableState,i=!1,a=!r.objectMode&&f(e);return a&&!u.isBuffer(e)&&(e=c(e)),"function"==typeof t&&(n=t,t=null),t=a?"buffer":t||r.defaultEncoding,"function"!=typeof n&&(n=v),r.ended?_(this,n):(a||x(this,r,e,n))&&(r.pendingcb++,i=b(this,r,a,e,t,n)),i},y.prototype.cork=function(){var e=this._writableState;e.corked++},y.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||L(this,e))},y.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(-1<["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||C(this,r,n)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,F(65),F(575).setImmediate,F(47))},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=function(){function i(e,t,n,r){(0,a.default)(this,i),this._groupId=e,this._length=t,this._pointList=n||[],this._nodeList=r||[]}return(0,o.default)(i,[{key:"dispose",value:function(){this._pointList=[],this._nodeList=[]}},{key:"getPointList",value:function(){for(var e=[],t=0,n=this._pointList.length;t<n;t++)e.push({x:this._pointList[t].x,y:this._pointList[t].y,groupId:this._groupId});return e}},{key:"groupId",get:function(){return this._groupId}},{key:"GroupId",get:function(){return this._groupId}},{key:"length",get:function(){return this._length}},{key:"Length",get:function(){return this._length}},{key:"pointList",get:function(){return this.getPointList()}},{key:"PointList",get:function(){return this.getPointList()}}]),i}(),l=s;t.default=l},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(12)),o=r(n(2)),s=r(n(3)),l=r(n(28)),u=(r(n(152)),function(){function e(){(0,o.default)(this,e),this.Id=0,this.startId=-1,this.startPoint={},this.endId=-1,this.endPoint={},this.length=0,this._type=0,this.pointVector=[],this.extentId=-1,this._isInAdj=!1,this._info=0}return(0,s.default)(e,[{key:"setRoad",value:function(e){this.Id=e.Id,this.startId=e.startId,this.startPoint=(0,a.default)({},e.startPoint),this.endId=e.endId,this.endPoint=(0,a.default)({},e.endPoint),this.length=e.length,this._type=e._type,this.pointVector=[],this.extentId=e.extentId;for(var t=0;t<e.pointVector.length;t++)this.pointVector[t]=e.pointVector[t]}},{key:"calcLength",value:function(){this.length=l.default.distanceOfTwoPoints(this.startPoint,this.endPoint)}},{key:"calcManhattanDistance",value:function(){var e=this.startPoint.x-this.endPoint.x,t=this.startPoint.y-this.endPoint.y;this.length=Math.abs(e)+Math.abs(t)}},{key:"calcMiddlePoint",value:function(){var e={};return e.x=(this.startPoint.x+this.endPoint.x)/2,e.y=(this.startPoint.y+this.endPoint.y)/2,e}},{key:"roadRank",set:function(e){this._type|=e},get:function(){return 3&this._type}},{key:"roadEntry",set:function(e){this._type|=e<<2},get:function(){return this._type>>2&3}},{key:"tempType",set:function(e){this._type|=e<<4},get:function(){return this._type>>4&3}},{key:"through",set:function(e){e?this._type|=16:this._type&=-17},get:function(){return 16&this._type?1:0}}]),e}()),h=u;t.default=h},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.NodeDistance=t.default=void 0;var a=r(n(30)),u=r(n(116)),o=r(n(33)),p=r(n(60)),s=r(n(15)),c=r(n(27)),f=r(n(32)),l=r(n(3)),h=r(n(2)),m=r(n(28)),v=r(n(79)),g=r(n(56)),y=r(n(97)),_=function e(){(0,h.default)(this,e),this.distance=Number.MAX_VALUE,this.node=null};t.NodeDistance=_;var d=function(){function d(e,t,n,r){(0,h.default)(this,d),this.groupId=0,this._type=r,this.nodeVector=e,this.roadVector=t,this.obstructModels=[],this.obstructExtents=[],this.obstructLines=[],this.zones=[],this.zoneIDMap=new y.default,this.vertexLen=[],this.adjList=new y.default,this.nextFloorMap=new y.default,this._needVertex=n,this._roadDiffusion=[],this._nodeMap=new y.default,this._roadMap=new y.default,this._maxNodeId=0,this._maxRoadId=0,this.simplify(),this._init()}return(0,l.default)(d,[{key:"dispose",value:function(){this.nodeVector=null,this.roadVector=null,this.obstructModels=null,this.obstructExtents=null,this.obstructLines=null,this.zones=null,null!=this.zoneIDMap&&(this.zoneIDMap.clear(),this.zoneIDMap=null),null!=this.adjList&&(this.adjList.clear(),this.adjList=null),this.vertexLen=null,null!=this.nextFloorMap&&(this.nextFloorMap.clear(),this.nextFloorMap=null),this._roadDiffusion=null,null!=this._nodeMap&&(this._nodeMap.clear(),this._nodeMap=null),null!=this._roadMap&&(this._roadMap.clear(),this._roadMap=null)}},{key:"initVertexLen",value:function(e){for(var t,n,r=Number.MAX_VALUE,i=0;i<this.roadVector.length;i++)0!=this.needVertex&&(t=this.roadVector[i],1==e?r=t.length:2==e&&(r=t.length*t.roadRank),n=t.roadEntry,n!=g.default.NaviRoadEntry_BOTH&&n!=g.default.NaviRoadEntry_FORWARD||(this.vertexLen[t.startId][t.endId]=r),n!=g.default.NaviRoadEntry_BOTH&&n!=g.default.NaviRoadEntry_BACK||(this.vertexLen[t.endId][t.startId]=r))}},{key:"invalide",value:function(){return 0==this.nodeVector.length||0==this.roadVector.length}},{key:"reset",value:function(){for(var e=0;e<this.nodeVector.length;e++)this.nodeVector[e]._treatHead=!1;if(1==this._needVertex)for(var t=this.nodeVector.length+1,n=0;n<t;n++)for(var r=0;r<t;r++)void 0!==this.vertexLen[n]&&void 0!==this.vertexLen[n][r]&&(this.vertexLen[n][r]=Number.MAX_VALUE)}},{key:"obstructsToZones",value:function(){this.zones=[];for(var e=0;e<this.obstructExtents.length;e++){var t=this.obstructExtents[e],n=t.toZone();this.zones.push(n)}for(var r=0;r<this.obstructModels.length;r++){var i=this.obstructExtents[r],a=i.toZone();this.zones.push(a)}}},{key:"getZone",value:function(e){for(var t=0;t<this.zones.length;t++){var n=this.zones[t];if(n&&n.Id==e)return n}return null}},{key:"queryZoneByPoint",value:function(e){for(var t=0;t<this.zones.length;t++){var n=this.zones[t];if(n&&1==n.contain(e))return n}return null}},{key:"transpose",value:function(){}},{key:"queryEntranceCoordByPoint",value:function(e,t){var n=null;if(this.nodeVector.length<=0||this.roadVector.length<=0)return n;for(var r=[],i=0,a=this.nodeVector.length;i<a;i++){var o,s=this.nodeVector[i],l=s.entranceType;l!=t&&l!=g.default.NaviEntranceType_ACCESS||(o=new _,o.node=s,o.distance=m.default.distanceOfTwoPoints(e,s.point),r.push(o))}return 0==r.length||(r=(0,f.default)(r).call(r,this._nodeDistanceFunc),n=r[0].node.point),n}},{key:"queryEntranceCoords",value:function(e){var t=[];if(this.nodeVector.length<=0||this.roadVector.length<=0)return t;for(var n=0,r=this.nodeVector.length;n<r;n++){var i=this.nodeVector[n],a=i.entranceType;a!=e&&a!=g.default.NaviEntranceType_ACCESS||t.push(i.point)}return t}},{key:"nodesAccess",value:function(e,t){if(this.nodeVector.length<=0||this.roadVector.length<=0)return!1;if(e.Id==t.Id)return!0;this._resetRoadDiffusion();var n=[];n.push(e.Id);for(var r=null,i=null,a=0,o=a;a!=n.length;){o=a,a=n.length;for(var s=o;s<n.length;s++)for(var l=0;l<this.roadVector.length;l++)if(1!=this._roadDiffusion[l]){if(r=this.roadVector[l],i=r.roadEntry,r.startId==n[s]&&(i==g.default.NaviRoadEntry_BOTH||i==g.default.NaviRoadEntry_FORWARD)){if(r.endId==t.Id)return!0;n.push(r.endId),this._roadDiffusion[l]=!0}if(r.endId==n[s]&&(i==g.default.NaviRoadEntry_BOTH||i==g.default.NaviRoadEntry_BACK)){if(r.startId==t.Id)return!0;n.push(r.startId),this._roadDiffusion[l]=!0}}}return!1}},{key:"querySameExtentLiftNodesByGeoPoint",value:function(e,t,n,r){if(this.nodeVector.length<=0||this.roadVector.length<=0)return[];var i=this.queryContainExtentId(e);if(0==i)return!1;for(var a=[],o=0;o<this.nodeVector.length;o++){var s,l=this.nodeVector[o],u=this.queryContainExtentId(l.point);!l.contansFloor(t)||u!=i&&0!=i||(s=new _,s.node=l,s.distance=m.default.distanceOfTwoPoints(e,l.point),s.distance=(0,c.default)(s.distance).toFixed(4),a.push(s))}if(!a||0==a.length)return[];a=(0,f.default)(a).call(a,this._nodeDistanceFunc);for(var h=0;h<a.length;h++)n[h]=new v.default,n[h].setNode(a[h].node),r[h]=(0,c.default)(a[h].distance);return n}},{key:"queryLiftNodeByFLAGID",value:function(e,t){if(!this.nodeVector||this.nodeVector.length<=0||!this.roadVector||this.roadVector.length<=0)return!1;for(var n=0;n<this.nodeVector.length;n++){var r=this.nodeVector[n];if(r.nodeType==g.default.NaviNodeType_FLOOR){var i=r.liftFlag;if(i==e)return t.setNode(r),!0}}return!1}},{key:"queryLiftNodesByType",value:function(e,t){if(!this.nodeVector||this.nodeVector.length<=0||!this.roadVector||this.roadVector.length<=0)return!1;for(var n=0;n<this.nodeVector.length;n++){var r=this.nodeVector[n];r.liftType==e&&(t[n]=r)}return 0!=t.length}},{key:"queryContainExtentId",value:function(e){if(0==this.obstructExtents.length||!e)return 0;for(var t=0,n=this.obstructExtents.length;t<n;t++){var r=this.obstructExtents[t];if(r.contain(e))return r.Id}return 0}},{key:"isLineObstruct",value:function(e,t){if(0==this.obstructLines.length||!e||!t)return!1;for(var n=0;n<this.obstructLines.length;n++)if(this.obstructLines[n].isCross(e,t))return!0;return!1}},{key:"queryNearestSameExtentElementByGeoPoint",value:function(e,t,n,r){var i=Number.MAX_VALUE,a={};if(new v.default,this.nodeVector.length<=0||this.roadVector.length<=0)return!1;var o=this.queryContainExtentId(e);if(0==o)return!1;for(var s,l=0,u=this.roadVector.length;l<u;l++){var h,c=this.roadVector[l];c&&o==this.queryContainExtentId(c.startPoint)&&(h=m.default.pointDistanceToLine(e,c.startPoint,c.endPoint,a),this.isLineObstruct(a,e)||h<i&&(i=h,t.setRoad(c),r.x=a.x,r.y=a.y))}if(!t||t.roadEntry==g.default.NaviRoadEntry_FORBID)return!1;s=t.roadEntry==g.default.NaviRoadEntry_BACK||t.roadEntry!=g.default.NaviRoadEntry_FORWARD&&m.default.distanceOfTwoPoints(t.startPoint,r)<=m.default.distanceOfTwoPoints(t.endPoint,r)?t.startId:t.endId;for(var d=0;d<this.nodeVector.length;d++){var f=this.nodeVector[d];if(f.Id==s){n.setNode(f);break}}return!0}},{key:"queryNearestSameExtentElementByGeoPointProcessForbid",value:function(e,t,n,r){var i=Number.MAX_VALUE,a={};if(new v.default,this.nodeVector.length<=0||this.roadVector.length<=0)return!1;var o=this.queryContainExtentId(e);if(0==o)return!1;for(var s,l=0;l<this.roadVector.length;l++){var u,h=this.roadVector[l];g.default.NaviRoadEntry_BOTH==h.roadEntry&&(o!=this.queryContainExtentId(h.startPoint)&&0!=o||(u=m.default.pointDistanceToLine(e,h.startPoint,h.endPoint,a),this.isLineObstruct(a,e)||u<i&&(i=u,t.setRoad(h),r.x=a.x,r.y=a.y)))}if(-1==t.Id)return!1;s=m.default.distanceOfTwoPoints(t.startPoint,r)<=m.default.distanceOfTwoPoints(t.endPoint,r)?t.startId:t.endId;for(var c=0;c<this.nodeVector.length;c++){var d=this.nodeVector[c];if(d.Id==s){n.setNode(d);break}}return-1!=n.Id}},{key:"simplify",value:function(){this._maxNodeId=0,this._maxRoadId=0;for(var e,t=0;t<this.roadVector.length;)null==this.roadVector[t]?(0,s.default)(e=this.roadVector).call(e,t,1):(this.roadVector[t].Id>this._maxRoadId&&(this._maxRoadId=this.roadVector[t].Id),t++);for(var n,r=0;r<this.nodeVector.length;)null==this.nodeVector[r]?(0,s.default)(n=this.nodeVector).call(n,r,1):(this.nodeVector[r].Id>this._maxNodeId&&(this._maxNodeId=this.nodeVector[r].Id),r++)}},{key:"consoleAdjList",value:function(e){if(e){var t,n=this.adjList,r=(this.nodeVector,this),i=(naviMap.size(),"********* ADJLIST ************\n");for(t in(0,p.default)(n))for(var a=(0,p.default)(n)[t],o=a,s=n.get(a),l=0;l<s.length;l++){var u=s[l],h=u.nodeId,c=this._naviGraph.getIndexByNodeID(o),d=(this._naviGraph.getIndexByNodeID(h),r.nodeVector[c]),f=r.nodeVector[endidx],i=i+d.Id+","+d.point.x+","+d.point.y;i+=",",i=i+f.Id+","+f.point.x+","+f.point.y,i+="\n"}i+="*********** END **************"}}},{key:"consoleNodeInfos",value:function(e){if(e){var t=[];t.push.apply(t,(0,o.default)(this.nodeVector)),(0,f.default)(t).call(t,function(e,t){return e.Id-t.Id});for(var n=0;n<t.length;n++)for(var r=t[n],i=(r.Id,0);i<r.segLinks.length;i++)r.segLinks[i]}}},{key:"consoleNodePres",value:function(e){if(e)for(var t=0;t<this.nodeVector.length;t++)for(var n=this.nodeVector[t],r=(n.Id,0);r<n._vPre.length;r++)n._vPre[r]}},{key:"consoleRoadInfos",value:function(e){if(e){var t=[];t.push.apply(t,(0,o.default)(this.roadVector)),(0,f.default)(t).call(t,function(e,t){return e.Id-t.Id});for(var n=0;n<t.length;n++){var r=t[n];r.Id,r.startId,r.endId}}}},{key:"consoleAdjInfos",value:function(e){var t;e&&((0,f.default)(t=this.adjList).call(t),this.adjList.each(function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.nodeId,r.length.toFixed(6)}}))}},{key:"getIndexByNodeID",value:function(e){var t=this._nodeMap.get(e);return void 0===t?null:t}},{key:"getIndexByRoadID",value:function(e){var t=this._roadMap.get(e);return void 0===t?null:t}},{key:"findObstruct",value:function(e){for(var t=Number.MAX_VALUE,n=null,r=0;r<this.obstructExtents.length;++r){var i=this.obstructExtents[r],a=i.contain(e);a&&i.area<t&&(t=cur_area,n=i)}for(var o=0;o<this.obstructModels.size();++o){var s=this.obstructModels[o],l=s.contain(e);l&&s.area<t&&(t=cur_area,n=s)}return n||null}},{key:"findModel",value:function(e){for(var t=Number.MAX_VALUE,n=null,r=0;r<this.obstructModels.length;++r){var i=this.obstructModels[r],a=i.contain(e);a&&i.area<t&&(t=i.area,n=i)}return n||null}},{key:"generateNodeId",value:function(){return++this._maxNodeId}},{key:"generateRoadId",value:function(){return++this._maxRoadId}},{key:"setBaseNodeId",value:function(e){this._maxNodeId=e}},{key:"setBaseRoadId",value:function(e){this._maxRoadId=e}},{key:"createNodeMap",value:function(){for(var e=0;e<this.nodeVector.length;e++){var t=this.nodeVector[e];t&&this._nodeMap.put(t.Id,e)}}},{key:"createRoadMap",value:function(){for(var e=0;e<this.roadVector.length;e++){var t=this.roadVector[e];t&&this._roadMap.put(t.Id,e)}}},{key:"clearNodeCache",value:function(){var r=this;this._nodeMap.each(function(e,t){var n=r.nodeVector[t];n._vPre=[]})}},{key:"makeUpAdjList",value:function(){var s=this;this.adjList.clear();for(var l,e=function(e){var t=s.roadVector[e];if(null==t)return"continue";var n,r,i,a,o=t.roadEntry;g.default.NaviRoadEntry_BOTH!=o&&g.default.NaviRoadEntry_FORWARD!=o||(n=t.startId,r=s.adjList.get(n),r||(r=[],s.adjList.put(n,r)),l=(0,u.default)(r).call(r,function(e){return e.nodeId==t.endId}),null==l&&r.push({nodeId:t.endId,length:t.length})),g.default.NaviRoadEntry_BOTH!=o&&g.default.NaviRoadEntry_BACK!=o||(i=t.endId,a=s.adjList.get(i),a||(a=[],s.adjList.put(i,a)),l=(0,u.default)(a).call(a,function(e){return e.nodeId==t.startId}),null==l&&a.push({nodeId:t.startId,length:t.length}))},t=0;t<this.roadVector.length;t++)e(t)}},{key:"getIdxByNodeId",value:function(e){for(var t=9;t<this.nodeVector.length;t++)if(this.nodeVector[t].Id==e)return t;return-1}},{key:"getIdxByRoadId",value:function(e){for(var t=9;t<this.roadVector.length;t++)if(this.roadVector[t].Id==e)return t;return-1}},{key:"queryRoadsByPolygon",value:function(e){for(var t=[],n=this.roadVector,r=0;r<n.length;r++){var i=n[r].startPoint,a=n[r].endPoint,o=[];m.default.segCrossPolygon(i,a,e,o)?((0,f.default)(o).call(o,function(e,t){var n=m.default.distanceOfTwoPoints(i,e),r=m.default.distanceOfTwoPoints(i,t);return n-r}),t.push({road:n[r],crss:o})):m.default.pointInPolygon2d(e,i,e.length)&&t.push({road:n[r],crss:[]})}return t}},{key:"getModelByPoint",value:function(e){for(var t=null,n=Infinity,r=0;r<this.obstructModels.length;r++){var i=this.obstructModels[r];i.Id,i.fid,m.default.pointInPolygon2d(i.points,e,i.points.length)&&n>m.default.calcPolygonArea2d(i.points)&&(t=i,n=m.default.calcPolygonArea2d(i.points))}return t}},{key:"getZoneIdByPoint",value:function(e){for(var t=-1,n=0;n<this.zones.length;n++){var r=this.zones[n];if(m.default.pointInPolygon2d(r.points,e,r.points.length)){t=r.Id;break}}return t}},{key:"getRandomModel",value:function(){var e=this.obstructModels.length,t=(0,a.default)(Math.random()*e);return this.obstructModels[t]}},{key:"_init",value:function(){if(1==this._needVertex)for(var e=null,t=0;t<this.roadVector.length;t++)e=this.roadVector[t],void 0===this.vertexLen[e.startId]&&(this.vertexLen[e.startId]=new Array),this.vertexLen[e.startId][e.endId]=Number.MAX_VALUE,void 0===this.vertexLen[e.endId]&&(this.vertexLen[e.endId]=new Array),this.vertexLen[e.endId][e.startId]=Number.MAX_VALUE;for(var n=0;n<this.roadVector.length;n++)this._roadDiffusion[n]=!1}},{key:"_resetRoadDiffusion",value:function(){for(var e=0;e<this._roadDiffusion.length;e++)this._roadDiffusion[e]=!1}},{key:"_nodeDistanceFunc",value:function(e,t){return(0,c.default)(e.distance)-(0,c.default)(t.distance)}},{key:"getLifts",value:function(){for(var e=[],t=0;t<this.nodeVector.length;t++){var n=this.nodeVector[t];n.liftType==g.default.NaviLiftType_Lift&&e.push(n)}return e}},{key:"getNodeByFlag",value:function(e){for(var t=0;t<this.nodeVector.length;t++)if(this.nodeVector[t].liftFlag==e)return this.nodeVector[t];return null}},{key:"getEscalators",value:function(){}},{key:"getStaris",value:function(){}},{key:"getAllLifts",value:function(){for(var e=[],t=0;t<this.nodeVector.length;t++){var n=this.nodeVector[t];n.liftType!=g.default.NaviLiftType_NULL&&e.push(n)}return e}},{key:"getGraphByEid",value:function(e){for(var t=null,n=0;n<this.obstructExtents.length;n++)if(e==this.obstructExtents[n].Id){t=this.obstructExtents[n];break}if(!t)return null;for(var r=[],i=0;i<this.nodeVector.length;i++){var a=this.nodeVector[i];m.default.pointInPolygon2d(t.points,a.point,t.points.length)&&r.push(a)}for(var o=[],s=0;s<this.roadVector.length;s++){var l=this.roadVector[s];m.default.pointInPolygon2d(t.points,l.startPoint,t.points.length)&&o.push(l)}for(var u=[],n=0;n<this.obstructModels.length;n++){var h=this.obstructModels[n];m.default.pointInPolygon2d(t.points,h.center,t.points.length)&&u.push(h)}var c=new d(r,o,!0,1);return c.obstructModels=u,c.obstructExtents=[t],c}}]),d}(),x=d;t.default=x},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(36)),b=r(n(32)),M=r(n(9)),T=r(n(15)),S=r(n(49)),o=r(n(54)),s=r(n(2)),l=r(n(3)),u=r(n(68)),h=r(n(69)),c=function(){function t(e){(0,s.default)(this,t),this._naviGraph=e,this._startNode=null,this._endNode=null,this._startNodeID=-1,this._endNodeID=-1,this._mode=u.default.MODULE_SHORTEST,this._naviGraph.createNodeMap(),this._naviGraph.createRoadMap(),this._naviGraph.makeUpAdjList(),this._kEPSILON_VALUE=5e-4}return(0,l.default)(t,[{key:"routeMultiDestinations",value:function(e,t,n){this._switchToMode(n),this._destIds=t;var r=this._naviGraph.getIndexByNodeID(e);if(-1==r)return h.default.ROUTE_FAILED_CANNOT_CALCULATE;this.endIdxs=[];for(var i=0;i<t.length;i++){var a=this._naviGraph.getIndexByNodeID(t[i]);this.endIdxs.push(a)}var o=this._dijkstraAssist_1vN(this._naviGraph,r,this.endIdxs);return this._naviGraph.consoleNodePres(),!!o}},{key:"getMultiRoute",value:function(e){for(var t=0;t<this.endIdxs.length;t++){var n=[];this._getOneRoute(this.endIdxs[t],n),(0,o.default)(n).call(n),e.push(n)}}},{key:"_getOneRoute",value:function(e,t){var n=this._naviGraph.nodeVector[e];t.push(n);var r=n._vPre[0];null!=r&&this._getOneRoute(r,t)}},{key:"routeCalculate",value:function(e,t,n){this._switchToMode(n),this._startNode=e,this._endNode=t,this._startNodeID=e.Id,this._endNodeID=t.Id;var r=this._naviGraph.getIndexByNodeID(this._startNodeID);if(-1==r)return h.default.ROUTE_FAILED_CANNOT_CALCULATE;var i=this._naviGraph.getIndexByNodeID(t.Id);if(-1==i)return h.default.ROUTE_FAILED_CANNOT_CALCULATE;var a=[];a.push(i);var o=this._dijkstraAssist_1vN(this._naviGraph,r,a);return this._naviGraph.consoleNodePres(),o?h.default.ROUTE_SUCCESS:h.default.ROUTE_FAILED_CANNOT_ARRIVE}},{key:"getRouteCalculateResult",value:function(){var e=[],t=this._naviGraph.getIndexByNodeID(this._endNodeID),n=[];n.push(t);var r=[],i=[];return this._multiPathNodeVector(n,this._naviGraph.nodeVector,r,i),e.push.apply(e,r),e}},{key:"dispose",value:function(){this._naviGraph.dispose(),this._naviGraph=null,this._startNode=null,this._endNode=null}},{key:"_dijkstraAssist_1vN",value:function(e,t,n){var r;if(null==e)return!1;var i=e.nodeVector.length;if(t<0||i<=t)return!1;this._removeArrayAll(n,t);for(var a=0;a<i;++a)e.nodeVector[a]._dist=Number.MAX_VALUE,e.nodeVector[a]._visited=!1,e.nodeVector[a]._vPre=[];e.nodeVector[t]._dist=0;var o=n.length,s=0,l=[];l.push(e.nodeVector[t]);for(var u=(0,S.default)(r=this._nodeDistCompareFunc).call(r,this);0<l.length;){var h=l[0].Id;(0,T.default)(l).call(l,0,1);var c=e.getIndexByNodeID(h);if(null!=c){var d=e.nodeVector[c];if(!d._visited){d._visited=!0;var f=(0,M.default)(n).call(n,c);if(-1!=f&&(++s,s==o))return!0;if(0!=e.adjList.size()){var p=e.adjList.get(h);if(p)for(var m=0;m<p.length;m++){var v,g,y,_=p[m],x=_.nodeId,w=e.getIndexByNodeID(x);null!=w&&(v=_.length,g=e.nodeVector[w],g._visited||(g._dist>v+d._dist?(g._dist=v+d._dist,g._vPre=[],g._vPre.push(c),l.push(e.nodeVector[w]),(0,b.default)(l).call(l,u)):Math.abs(g._dist-(v+d._dist))<1e-12&&-1!=(0,M.default)(y=g._vPre).call(y,c)&&g._vPre.push(c)))}}}}}return!(s<o)}},{key:"_nodeDistCompareFunc",value:function(e,t){return e._dist-(t._dist+this._kEPSILON_VALUE)}},{key:"_removeArrayAll",value:function(e,t){for(var n=(0,M.default)(e).call(e,t);-1!=n;)(0,T.default)(e).call(e,n,1),n=(0,M.default)(e).call(e,t)}},{key:"_switchToMode",value:function(e){var t,n;this._mode!=e&&(u.default.MODULE_SHORTEST==e?(0,a.default)(t=this._naviGraph.roadVector).call(t,function(e){e.length=e.length/e.roadRank}):u.default.MODULE_BEST==e&&(0,a.default)(n=this._naviGraph.roadVector).call(n,function(e){e.length=e.length*e.roadRank}),this._naviGraph.makeUpAdjList(),this._mode=e)}},{key:"_pathNodeVector",value:function(e,t,n,r){var i;0!=t[e]._vPre.length&&(i=t[e]._vPre[0],n.push(t[i]),r.count++,this._pathNodeVector(i,t,n,r))}},{key:"_multiPathNodeVector",value:function(e,t,n,r){for(var i=0;i<e.length;i++){var a=e[i];n.push(t[a]);var o={count:1};this._pathNodeVector(a,t,n,o),r.push(o.count)}}}]),t}(),d=c;t.default=d},function(e,t,n){n(269);var r=n(11),i=r.Object,a=e.exports=function(e,t,n){return i.defineProperty(e,t,n)};i.defineProperty.sham&&(a.sham=!0)},function(e,t,n){var r=n(29),i=n(16),a=n(118);e.exports=!r&&!i(function(){return 7!=Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(16),i=/#|\.prototype\./,a=function(e,t){var n=s[o(e)];return n==u||n!=l&&("function"==typeof t?r(t):!!t)},o=a.normalize=function(e){return String(e).replace(i,".").toLowerCase()},s=a.data={},l=a.NATIVE="N",u=a.POLYFILL="P";e.exports=a},function(e,t,n){"use strict";var a=n(48),o=n(23),s=[].slice,l={},u=function(e,t,n){if(!(t in l)){for(var r=[],i=0;i<t;i++)r[i]="a["+i+"]";l[t]=Function("C,a","return new C("+r.join(",")+")")}return l[t](e,n)};e.exports=Function.bind||function(t){var n=a(this),r=s.call(arguments,1),i=function(){var e=r.concat(s.call(arguments));return this instanceof i?u(n,e.length,e):n.apply(t,e)};return o(n.prototype)&&(i.prototype=n.prototype),i}},function(e,t,n){n(57),n(286);var r=n(11);e.exports=r.Array.from},function(e,t,n){var r=n(19),i=n(170),a=r.WeakMap;e.exports="function"==typeof a&&/native code/.test(i(a))},function(e,t,n){var r=n(171),i=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return i.call(e)}),e.exports=r.inspectSource},function(e,t,n){var r=n(19),i=n(282),a="__core-js_shared__",o=r[a]||i(a,{});e.exports=o},function(e,t,n){"use strict";var r,i,a,o=n(121),s=n(43),l=n(34),u=n(25),h=n(74),c=u("iterator"),d=!1,f=function(){return this};[].keys&&(a=[].keys(),"next"in a?(i=o(o(a)),i!==Object.prototype&&(r=i)):d=!0),null==r&&(r={}),h||l(r,c)||s(r,c,f),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:d}},function(e,t,n){var r=n(16);e.exports=!r(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},function(e,t,n){var r=n(122);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(e,t,n){var r=n(29),o=n(39),s=n(35),l=n(102);e.exports=r?Object.defineProperties:function(e,t){s(e);for(var n,r=l(t),i=r.length,a=0;a<i;)o.f(e,n=r[a++],t[n]);return e}},function(e,t,n){var o=n(34),s=n(42),l=n(177).indexOf,u=n(83);e.exports=function(e,t){var n,r=s(e),i=0,a=[];for(n in r)!o(u,n)&&o(r,n)&&a.push(n);for(;t.length>i;)o(r,n=t[i++])&&(~l(a,n)||a.push(n));return a}},function(e,t,n){var l=n(42),u=n(44),h=n(103),r=function(s){return function(e,t,n){var r,i=l(e),a=u(i.length),o=h(n,a);if(s&&t!=t){for(;o<a;)if(r=i[o++],r!=r)return!0}else for(;o<a;o++)if((s||o in i)&&i[o]===t)return s||o||0;return!s&&-1}};e.exports={includes:r(!0),indexOf:r(!1)}},function(e,t,n){var r=n(50);e.exports=r("document","documentElement")},function(e,t,n){var i=n(35),a=n(285);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n,r=!1,e={};try{n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,n.call(e,[]),r=e instanceof Array}catch(e){}return function(e,t){return i(e),a(t),r?n.call(e,t):e.__proto__=t,e}}():void 0)},function(e,t,n){var a=n(35);e.exports=function(t,e,n,r){try{return r?e(a(n)[0],n[1]):e(n)}catch(e){var i=t.return;throw void 0!==i&&a(i.call(t)),e}}},function(e,t,n){var r=n(25),i=n(59),a=r("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||o[a]===e)}},function(e,t,n){var r=n(25),i=r("iterator"),a=!1;try{var o=0,s={next:function(){return{done:!!o++}},return:function(){a=!0}};s[i]=function(){return this},Array.from(s,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!a)return!1;var n=!1;try{var r={};r[i]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n}},function(e,t,n){var r=n(8),i=n(19),a=n(125),o=[].slice,s=/MSIE .\./.test(a),l=function(i){return function(e,t){var n=2<arguments.length,r=n?o.call(arguments,2):void 0;return i(n?function(){("function"==typeof e?e:Function(e)).apply(this,r)}:e,t)}};r({global:!0,bind:!0,forced:s},{setTimeout:l(i.setTimeout),setInterval:l(i.setInterval)})},function(e,t,n){var r=n(16);e.exports=!r(function(){return Object.isExtensible(Object.preventExtensions({}))})},function(e,t,n){"use strict";var r=n(8),i=n(16),a=n(76),o=n(23),l=n(38),u=n(44),h=n(86),c=n(128),s=n(89),d=n(25),f=n(129),p=d("isConcatSpreadable"),m=9007199254740991,v="Maximum allowed index exceeded",g=51<=f||!i(function(){var e=[];return e[p]=!1,e.concat()[0]!==e}),y=s("concat"),_=function(e){if(!o(e))return!1;var t=e[p];return void 0!==t?!!t:a(e)},x=!g||!y;r({target:"Array",proto:!0,forced:x},{concat:function(){for(var e,t,n,r=l(this),i=c(r,0),a=0,o=-1,s=arguments.length;o<s;o++)if(n=-1===o?r:arguments[o],_(n)){if(t=u(n.length),m<a+t)throw TypeError(v);for(e=0;e<t;e++,a++)e in n&&h(i,a,n[e])}else{if(m<=a)throw TypeError(v);h(i,a++,n)}return i.length=a,i}})},function(e,t,n){e.exports=n(318)},function(e,t,n){"use strict";var c=n(8),d=n(19),f=n(88),p=n(16),m=n(43),v=n(90),g=n(106),y=n(23),_=n(58),x=n(39).f,w=n(61).forEach,b=n(29),r=n(52),M=r.set,T=r.getterFor;e.exports=function(n,e,t){var r,o,i=-1!==n.indexOf("Map"),s=-1!==n.indexOf("Weak"),a=i?"set":"add",l=d[n],u=l&&l.prototype,h={};return b&&"function"==typeof l&&(s||u.forEach&&!p(function(){(new l).entries().next()}))?(r=e(function(e,t){M(g(e,r,n),{type:n,collection:new l}),null!=t&&v(t,e[a],e,i)}),o=T(n),w(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(i){var a="add"==i||"set"==i;i in u&&(!s||"clear"!=i)&&m(r.prototype,i,function(e,t){var n=o(this).collection;if(!a&&s&&!y(e))return"get"==i&&void 0;var r=n[i](0===e?0:e,t);return a?this:r})}),s||x(r.prototype,"size",{configurable:!0,get:function(){return o(this).collection.size}})):(r=t.getConstructor(e,n,i,a),f.REQUIRED=!0),_(r,n,!1,!0),h[n]=r,c({global:!0,forced:!0},h),s||t.setStrong(r,n,i),r}},function(e,t,n){"use strict";var r=n(50),i=n(39),a=n(25),o=n(29),s=a("species");e.exports=function(e){var t=r(e),n=i.f;o&&t&&!t[s]&&n(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,n){var r=n(26);r("iterator")},function(e,t,n){e.exports=n(325)},function(e,t,n){n(185),n(108),n(192),n(326),n(327),n(328),n(329),n(189),n(330),n(331),n(332),n(333),n(334),n(335),n(336),n(337),n(338),n(339),n(340);var r=n(11);e.exports=r.Symbol},function(e,t,n){"use strict";var r,i=n(8),a=n(19),o=n(50),s=n(74),l=n(29),u=n(122),h=n(174),c=n(16),d=n(34),f=n(76),p=n(23),m=n(35),v=n(38),g=n(42),y=n(99),_=n(81),x=n(84),w=n(102),b=n(131),M=n(193),T=n(132),S=n(80),E=n(39),A=n(117),I=n(43),L=n(85),R=n(119),N=n(100),k=n(83),P=n(101),C=n(25),D=n(130),O=n(26),F=n(58),B=n(52),U=n(61).forEach,z=N("hidden"),G="Symbol",V="prototype",H=C("toPrimitive"),j=B.set,W=B.getterFor(G),Y=Object[V],q=a.Symbol,X=o("JSON","stringify"),Z=S.f,J=E.f,K=M.f,Q=A.f,$=R("symbols"),ee=R("op-symbols"),te=R("string-to-symbol-registry"),ne=R("symbol-to-string-registry"),re=R("wks"),ie=a.QObject,ae=!ie||!ie[V]||!ie[V].findChild,oe=l&&c(function(){return 7!=x(J({},"a",{get:function(){return J(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=Z(Y,t);r&&delete Y[t],J(e,t,n),r&&e!==Y&&J(Y,t,r)}:J,se=function(e,t){var n=$[e]=x(q[V]);return j(n,{type:G,tag:e,description:t}),l||(n.description=t),n},le=h?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof q},ue=function(e,t,n){e===Y&&ue(ee,t,n),m(e);var r=y(t,!0);return m(n),d($,r)?(n.enumerable?(d(e,z)&&e[z][r]&&(e[z][r]=!1),n=x(n,{enumerable:_(0,!1)})):(d(e,z)||J(e,z,_(1,{})),e[z][r]=!0),oe(e,r,n)):J(e,r,n)},he=function(t,e){m(t);var n=g(e),r=w(n).concat(me(n));return U(r,function(e){l&&!de.call(n,e)||ue(t,e,n[e])}),t},ce=function(e,t){return void 0===t?x(e):he(x(e),t)},de=function(e){var t=y(e,!0),n=Q.call(this,t);return!(this===Y&&d($,t)&&!d(ee,t))&&(!(n||!d(this,t)||!d($,t)||d(this,z)&&this[z][t])||n)},fe=function(e,t){var n=g(e),r=y(t,!0);if(n!==Y||!d($,r)||d(ee,r)){var i=Z(n,r);return!i||!d($,r)||d(n,z)&&n[z][r]||(i.enumerable=!0),i}},pe=function(e){var t=K(g(e)),n=[];return U(t,function(e){d($,e)||d(k,e)||n.push(e)}),n},me=function(e){var t=e===Y,n=K(t?ee:g(e)),r=[];return U(n,function(e){!d($,e)||t&&!d(Y,e)||r.push($[e])}),r};u||(q=function(e){if(this instanceof q)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==e?String(arguments[0]):void 0,n=P(t),r=function(e){this===Y&&r.call(ee,e),d(this,z)&&d(this[z],n)&&(this[z][n]=!1),oe(this,n,_(1,e))};return l&&ae&&oe(Y,n,{configurable:!0,set:r}),se(n,t)},L(q[V],"toString",function(){return W(this).tag}),L(q,"withoutSetter",function(e){return se(P(e),e)}),A.f=de,E.f=ue,S.f=fe,b.f=M.f=pe,T.f=me,D.f=function(e){return se(C(e),e)},l&&(J(q[V],"description",{configurable:!0,get:function(){return W(this).description}}),s||L(Y,"propertyIsEnumerable",de,{unsafe:!0}))),i({global:!0,wrap:!0,forced:!u,sham:!u},{Symbol:q}),U(w(re),function(e){O(e)}),i({target:G,stat:!0,forced:!u},{for:function(e){var t=String(e);if(d(te,t))return te[t];var n=q(t);return te[t]=n,ne[n]=t,n},keyFor:function(e){if(!le(e))throw TypeError(e+" is not a symbol");if(d(ne,e))return ne[e]},useSetter:function(){ae=!0},useSimple:function(){ae=!1}}),i({target:"Object",stat:!0,forced:!u,sham:!l},{create:ce,defineProperty:ue,defineProperties:he,getOwnPropertyDescriptor:fe}),i({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:pe,getOwnPropertySymbols:me}),i({target:"Object",stat:!0,forced:c(function(){T.f(1)})},{getOwnPropertySymbols:function(e){return T.f(v(e))}}),X&&(r=!u||c(function(){var e=q();return"[null]"!=X([e])||"{}"!=X({a:e})||"{}"!=X(Object(e))}),i({target:"JSON",stat:!0,forced:r},{stringify:function(e,t){for(var n,r=[e],i=1;i<arguments.length;)r.push(arguments[i++]);if(n=t,(p(t)||void 0!==e)&&!le(e))return f(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!le(t))return t}),r[1]=t,X.apply(null,r)}})),q[V][H]||I(q[V],H,q[V].valueOf),F(q,G),k[z]=!0},function(e,t,n){var r=n(42),i=n(131).f,a={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return i(e)}catch(e){return o.slice()}};e.exports.f=function(e){return o&&"[object Window]"==a.call(e)?s(e):i(r(e))}},function(e,t,n){e.exports=n(346)},function(e,t,n){e.exports=n(347)},function(e,t,n){n(366);var r=n(11),i=r.Object;e.exports=function(e,t){return i.create(e,t)}},function(e,t,n){e.exports=n(368)},function(e,t,n){n(398);var r=n(11);e.exports=r.Array.isArray},function(e,t,n){var r=n(409),i=Array.prototype;e.exports=function(e){var t=e.slice;return e===i||e instanceof Array&&t===i.slice?r:t}},function(e,t,n){e.exports=n(433)},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=g;var l=r(n(20)),u=r(n(14)),h=r(n(21)),c=r(n(22)),a=r(n(18)),o=r(n(13)),s=r(n(0)),d=r(n(202)),f=r(n(446));function p(e,t){var n;if(void 0===c.default||null==(0,h.default)(e)){if((0,u.default)(e)||(n=m(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=(0,l.default)(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function m(e,t){var n;if(e){if("string"==typeof e)return v(e,t);var r=(0,o.default)(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?(0,a.default)(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(e,t):void 0}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(e,t){var n,r=p((0,f.default)(t));try{for(r.s();!(n=r.n()).done;){var i,a=n.value;"constructor"!==a&&"prototype"!==a&&"name"!==a&&(i=(0,d.default)(t,a),(0,s.default)(e,a,i))}}catch(e){r.e(e)}finally{r.f()}}},function(e,t,n){e.exports=n(443)},function(e){function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}e.exports=t},function(e,t,n){e.exports=n(464)},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=r(n(140)),l=function(){function e(){(0,a.default)(this,e),this.requestMethod="GET",this._requestHeader={},this.sendData=null}return(0,o.default)(e,[{key:"getFile",value:function(e,t,n,r,i){void 0!==this._path&&(e=this._path+e);var a,o=new s.default;for(a in o.open(this.requestMethod,e,!0),o.addEventListener("load",function(){var e=this.response;200===this.status||0===this.status||201===this.status?(0===this.status&&console.warn("FMMap FileLoader: HTTP Status 0 received."),t(e)):n(e)},!1),o.addEventListener("progress",function(){r&&r()},!1),o.addEventListener("error",function(){n()},!1),o.addEventListener("abort",function(){i&&i()},!1),void 0!==this._responseType&&(o.responseType=this._responseType),void 0!==this._withCredentials&&(o.withCredentials=this._withCredentials),o.overrideMimeType&&o.overrideMimeType(void 0!==this._mimeType?this._mimeType:"text/plain"),this._requestHeader)o.setRequestHeader(a,this._requestHeader[a]);o.send(this.sendData)}},{key:"setPath",value:function(e){return this._path=e,this}},{key:"setResponseType",value:function(e){return this._responseType=e,this}},{key:"setWithCredentials",value:function(e){return this._withCredentials=e,this}},{key:"setMimeType",value:function(e){return this._mimeType=e,this}},{key:"setRequestHeader",value:function(e){return e&&(this._requestHeader=e),this}}]),e}(),u=l;t.default=u},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={NORTH:"n",n:0,SOUTH:"s",s:180,WEST:"w",w:-90,EAST:"e",e:90,NORTH_EAST:"ne",ne:45,NORTH_WEST:"nw",nw:-45,SOUTH_EAST:"se",se:135,SOUTH_WEST:"sw",sw:-135},a=i;t.default=a},function(e,u,t){(function(i){function a(e,t){for(var n=0,r=e.length-1;0<=r;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;)e.unshift("..");return e}function r(e){"string"!=typeof e&&(e+="");for(var t=0,n=-1,r=!0,i=e.length-1;0<=i;--i)if(47===e.charCodeAt(i)){if(!r){t=i+1;break}}else-1===n&&(r=!1,n=i+1);return-1===n?"":e.slice(t,n)}function o(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}u.resolve=function(){for(var e="",t=!1,n=arguments.length-1;-1<=n&&!t;n--){var r=0<=n?arguments[n]:i.cwd();if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(e=r+"/"+e,t="/"===r.charAt(0))}return e=a(o(e.split("/"),function(e){return!!e}),!t).join("/"),(t?"/":"")+e||"."},u.normalize=function(e){var t=u.isAbsolute(e),n="/"===s(e,-1);return e=a(o(e.split("/"),function(e){return!!e}),!t).join("/"),e||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},u.isAbsolute=function(e){return"/"===e.charAt(0)},u.join=function(){var e=Array.prototype.slice.call(arguments,0);return u.normalize(o(e,function(e){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},u.relative=function(e,t){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;0<=n&&""===e[n];n--);return n<t?[]:e.slice(t,n-t+1)}e=u.resolve(e).substr(1),t=u.resolve(t).substr(1);for(var r=n(e.split("/")),i=n(t.split("/")),a=Math.min(r.length,i.length),o=a,s=0;s<a;s++)if(r[s]!==i[s]){o=s;break}for(var l=[],s=o;s<r.length;s++)l.push("..");return l=l.concat(i.slice(o)),l.join("/")},u.sep="/",u.delimiter=":",u.dirname=function(e){if("string"!=typeof e&&(e+=""),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,r=-1,i=!0,a=e.length-1;1<=a;--a)if(t=e.charCodeAt(a),47===t){if(!i){r=a;break}}else i=!1;return-1===r?n?"/":".":n&&1===r?"/":e.slice(0,r)},u.basename=function(e,t){var n=r(e);return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},u.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,n=0,r=-1,i=!0,a=0,o=e.length-1;0<=o;--o){var s=e.charCodeAt(o);if(47===s){if(i)continue;n=o+1;break}-1===r&&(i=!1,r=o+1),46===s?-1===t?t=o:1!==a&&(a=1):-1!==t&&(a=-1)}return-1===t||-1===r||0===a||1===a&&t===r-1&&t===n+1?"":e.slice(t,r)};var s="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,t(65))},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a,o,p,m,v,g,y,_,x,w,b,s=r(n(30)),l=(a=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],o=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=0,m=0,v=[2,0,0,0],g=function(e,t){for(var n=0,r=0,i=0,r=0;r<8;r++)1&t&&(n^=e),i=128&e,e<<=1,i&&(e^=27),t>>=1;return n},y=function(e,t,n){for(var r=0;r<4;r++)e[0+r]^=t[16*n+4*r],e[4+r]^=t[16*n+4*r+1],e[8+r]^=t[16*n+4*r+2],e[12+r]^=t[16*n+4*r+3]},_=function(e){for(var t,n,r,i=1;i<4;i++)for(n=0;n<i;){for(r=e[4*i+4-1],t=3;0<t;t--)e[4*i+t]=e[4*i+t-1];e[4*i+0]=r,n++}},x=function(e){for(var t,n,r,i=0;i<4;i++)for(t=0;t<4;t++)n=(240&e[4*i+t])>>4,r=15&e[4*i+t],e[4*i+t]=o[16*n+r]},w=function(e){for(var t=0;t<4;t++)e[t]=a[16*((240&e[t])>>4)+(15&e[t])]},b=function(e){return(0,s.default)(e,16)},{decryption:function(e,t){for(var n=Array(16),r=0;r<16;r++)n[r]=16*b(t.substr(2*r,1))+b(t.substr(2*r+1,1));for(var i=Array(16),r=0;r<16;r++)i[r]=16*b(e.substr(2*r,1))+b(e.substr(2*r+1,1));var a=Array(16);switch(r=[],n.length){default:case 16:p=4,m=10;break;case 24:p=6,m=12;break;case 32:p=8,m=14}for(var o=r=Array(16*(m+1)),s=Array(4),l=4*(m+1),u=0;u<p;u++)o[4*u+0]=n[4*u+0],o[4*u+1]=n[4*u+1],o[4*u+2]=n[4*u+2],o[4*u+3]=n[4*u+3];for(u=p;u<l;u++){if(s[0]=o[4*(u-1)+0],s[1]=o[4*(u-1)+1],s[2]=o[4*(u-1)+2],s[3]=o[4*(u-1)+3],0==u%p){for(var n=s,h=void 0,c=void 0,h=n[0],c=0;c<3;c++)n[c]=n[c+1];if(n[3]=h,w(s),n=u/p,1==n)v[0]=1;else if(1<n)for(v[0]=2,n--;0<n-1;)v[0]=g(v[0],2),n--;n=s,h=v,c=s,c[0]=n[0]^h[0],c[1]=n[1]^h[1],c[2]=n[2]^h[2],c[3]=n[3]^h[3]}else 6<p&&4==u%p&&w(s);o[4*u+0]=o[4*(u-p)+0]^s[0],o[4*u+1]=o[4*(u-p)+1]^s[1],o[4*u+2]=o[4*(u-p)+2]^s[2],o[4*u+3]=o[4*(u-p)+3]^s[3]}for(o=Array(16),s=0;s<4;s++)for(u=0;u<4;u++)o[4*s+u]=i[s+4*u];for(y(o,r,m),i=m-1;1<=i;i--)for(_(o),x(o),y(o,r,i),s=o,u=[14,9,13,11],l=c=void 0,n=Array(4),h=Array(4),l=0;l<4;l++){for(c=0;c<4;c++)n[c]=s[4*c+l];var c=u,d=n,f=h;for(f[0]=g(c[0],d[0])^g(c[3],d[1])^g(c[2],d[2])^g(c[1],d[3]),f[1]=g(c[1],d[0])^g(c[0],d[1])^g(c[3],d[2])^g(c[2],d[3]),f[2]=g(c[2],d[0])^g(c[1],d[1])^g(c[0],d[2])^g(c[3],d[3]),f[3]=g(c[3],d[0])^g(c[2],d[1])^g(c[1],d[2])^g(c[0],d[3]),c=0;c<4;c++)s[4*c+l]=h[c]}for(_(o),x(o),y(o,r,0),s=0;s<4;s++)for(u=0;u<4;u++)a[s+4*u]=o[4*s+u];for(i="",r=0;r<16;++r)o=a[r].toString(16),o.length<2&&(o="0"+o),i+=o;return i}}),u=l;t.default=u},function(e,n,r){"use strict";var i=r(1),a=r(0);a(n,"__esModule",{value:!0}),n.default=void 0;var d=i(r(15)),s=i(r(27)),l=i(r(9)),o=i(r(2)),u=i(r(3)),h=h||{};h.GLEN1="MULTIPOLYGON(((".length,h.GLEN2="POINT(".length,h.GLEN3="MULTILINESTRING((".length;var c=function(){function e(){(0,o.default)(this,e),this._points,this._holes}return(0,u.default)(e,[{key:"parse",value:function(e){if(this._points=[],this._holes=[],0==(0,l.default)(e).call(e,"MULTIPOLYGON((("))for(var t=e.substring(h.GLEN1,e.length-3).split(/\),\(/),n=0;n<t.length;n++){var r=t[n].split(/,/);if(0==n)for(var i=0;i<r.length;i++){var a=r[i].split(" ");this._points.push({x:(0,s.default)(a[0]),y:(0,s.default)(a[1])})}else{for(var o=[],i=0;i<r.length;i++)a=r[i].split(" "),o.push({x:(0,s.default)(a[0]),y:(0,s.default)(a[1])});this._holes.push(o)}}else if(0==(0,l.default)(e).call(e,"POINT("))a=e.substring(h.GLEN2,e.length-1).split(" "),this._points.push({x:(0,s.default)(a[0]),y:(0,s.default)(a[1])});else if(0==(0,l.default)(e).call(e,"MULTILINESTRING(("))for(r=e.substring(h.GLEN3,e.length-2).split(","),i=0;i<r.length;i++)a=r[i].split(" "),this._points.push({x:(0,s.default)(a[0]),y:(0,s.default)(a[1])});return this}},{key:"toFixed",value:function(e){return+e.toFixed(2)}},{key:"parsePnt",value:function(e){if(this._points=[],0==(0,l.default)(e).call(e,"MULTIPOLYGON((("))for(var t=e.substring(h.GLEN1,e.length-3).split(","),n=0;n<t.length;n++){var r=t[n].split(" ");this._points.push({x:(0,s.default)(r[0]),y:(0,s.default)(r[1])})}else if(0==(0,l.default)(e).call(e,"POINT("))r=e.substring(h.GLEN2,e.length-1).split(" "),this._points.push({x:(0,s.default)(r[0]),y:(0,s.default)(r[1])});else if(0==(0,l.default)(e).call(e,"MULTILINESTRING(("))for(t=e.substring(h.GLEN3,e.length-2).split(","),n=0;n<t.length;n++)r=t[n].split(" "),this._points.push({x:(0,s.default)(r[0]),y:(0,s.default)(r[1])});return this}},{key:"toPntStrip",value:function(e){var t=[],n=this._points.length;if(!0===e){if(1<=n)for(var r=0;r<n-1;r++){var i=this._points[r];t.push(i.x,i.y)}}else for(r=0;r<n;r++)i=this._points[r],t.push(i.x,i.y);return t}},{key:"mergePnts",value:function(e){for(var t=[],n=e.length,r=0;r<n;r++){for(var i=e[r],a={x:this.toFixed(i.x),y:this.toFixed(i.y)},o=t.length,s=!1,l=0;l<o;l++){var u=t[l];if(u.x==a.x&&u.y==a.y){s=!0;break}}s||t.push(a)}return t}},{key:"toStrip",value:function(e){var n,r=[],i=this._points.length;if(i<=0)return r;for(var a=(0,d.default)(n=this._points).call(n,i-1,1)[0],o=this.mergePnts(this._points),s=o.length,l=0;l<s;l++){var u=o[l];r.push(u.x,u.y)}return!0===e||(t={x:this.toFixed(a.x),y:this.toFixed(a.y)},r.push(t.x,t.y),this._points.push(a)),r}},{key:"hasHoles",value:function(){return null!=this._holes&&0<this._holes.length}},{key:"toStripHoles",value:function(e){for(var n=[],r=0;r<this._holes.length;r++){for(var i=this._holes[r],a=[],o=i.length,s=(0,d.default)(i).call(i,o-1,1)[0],l=this.mergePnts(i),u=l.length,h=0;h<u;h++){var c=l[h];a.push(c.x,c.y)}!0===e||(t={x:this.toFixed(s.x),y:this.toFixed(s.y)},a.push(t.x,t.y)),n.push(a)}return n}},{key:"holes",set:function(e){this._holes=e},get:function(){return this._holes}},{key:"points",get:function(){return this._points},set:function(e){this._points=e}}]),e}(),f=c;n.default=f},function(e,n,r){"use strict";var i=r(1),a=r(0);a(n,"__esModule",{value:!0}),n.default=void 0;var d=i(r(15)),o=i(r(2)),s=i(r(3)),l=function(){function e(){(0,o.default)(this,e),this._points,this._holes}return(0,s.default)(e,[{key:"parse",value:function(e,t){this._points=[],this._holes=[];for(var n=0,r=0;r<e.length;r++){var i=e[r].idxs,i=i||e[r];if("number"==typeof i)for(;n<i;)this._points.push({x:t[n],y:t[n+1]}),n+=2;else for(var a=0;a<i.length;a++)for(var o=i[a];n<o;)this._points.push({x:t[n],y:t[n+1]}),n+=2}return this}},{key:"parseGeometry",value:function(e,t){this._points=[],this._holes=[];for(var n=0,r=0;r<e.length;r++){var i=e[r].idxs,i=i||e[r];if("number"==typeof i)for(;n<i;)this._points.push({x:t[n],y:t[n+1]}),n+=2;else for(var a=0;a<i.length;a++)if(0===a)for(var o=i[a];n<o;)this._points.push({x:t[n],y:t[n+1]}),n+=2;else{for(var s=[],l=i[a];n<l;)s.push({x:t[n],y:t[n+1]}),n+=2;this._holes.push(s)}}return this}},{key:"mergePnts",value:function(e){for(var t=[],n=e.length,r=0;r<n;r++){for(var i=e[r],a={x:this.toFixed(i.x),y:this.toFixed(i.y)},o=t.length,s=!1,l=0;l<o;l++){var u=t[l];if(u.x==a.x&&u.y==a.y){s=!0;break}}s||t.push(a)}return t}},{key:"toStrip",value:function(e){var n,r=[],i=this._points.length;if(i<=0)return r;for(var a=(0,d.default)(n=this._points).call(n,i-1,1)[0],o=this._points,s=o.length,l=0;l<s;l++){var u=o[l];r.push(u.x,u.y)}return!0===e||(t={x:this.toFixed(a.x),y:this.toFixed(a.y)},r.push(t.x,t.y),this._points.push(a)),r}},{key:"toFixed",value:function(e){return+e.toFixed(2)}},{key:"hasHoles",value:function(){return null!=this._holes&&0<this._holes.length}},{key:"toStripHoles",value:function(e){for(var n=[],r=0;r<this._holes.length;r++){for(var i=this._holes[r],a=[],o=i.length,s=(0,d.default)(i).call(i,o-1,1)[0],l=this.mergePnts(i),u=l.length,h=0;h<u;h++){var c=l[h];a.push(c.x,c.y)}!0===e||(t={x:this.toFixed(s.x),y:this.toFixed(s.y)},a.push(t.x,t.y)),n.push(a)}return n}},{key:"holes",set:function(e){this._holes=e},get:function(){return this._holes}},{key:"points",get:function(){return this._points},set:function(e){this._points=e}}]),e}(),u=l;n.default=u},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(20)),u=r(n(14)),h=r(n(21)),c=r(n(22)),a=r(n(18)),o=r(n(13)),s=r(n(4)),d=r(n(55)),f=r(n(15)),p=r(n(9)),m=r(n(33)),v=r(n(10)),g=r(n(2)),y=r(n(3)),_=r(n(5)),x=r(n(6)),w=r(n(7)),b=r(n(17)),M=n(212),T=r(n(28)),S=r(n(45));function E(e,t){var n;if(void 0===c.default||null==(0,h.default)(e)){if((0,u.default)(e)||(n=A(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=(0,l.default)(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function A(e,t){var n;if(e){if("string"==typeof e)return I(e,t);var r=(0,o.default)(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?(0,a.default)(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?I(e,t):void 0}}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function L(r){var i=R();return function(){var e,t=(0,w.default)(r),n=i?(e=(0,w.default)(this).constructor,(0,s.default)(t,arguments,e)):t.apply(this,arguments);return(0,x.default)(this,n)}}function R(){if("undefined"==typeof Reflect||!s.default)return!1;if(s.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,s.default)(Date,[],function(){})),!0}catch(e){return!1}}var N=function(e){(0,_.default)(a,e);var i=L(a);function a(e,t,n){var r;return(0,g.default)(this,a),r=i.call(this,e),r._layers={},r.initLayers(),r.initLayersByData(t),r._visible=!0,r._groupMessage=n,r._locations=[],r._height=n.height,r._locationScene=new fm.Scene,r._locationScene.userData.type="location",r._locationScene.position.setY(r._height),r._locationScene.updateMatrix(),r._locationScene.updateWorldMatrix(),r._offsetHeight=0,r._lineScene=new fm.Scene,r._lineScene.userData.type="line",r.externalModels={},r.isGroup=!0,r.alwaysShowMarkers=[],r._groupAlias=n.alias,r._groupDesc=n.desc,r._groupName=n.gname,r._hideWithFree=!1,r.modelShadow={},r._group=new fm.Scene,r._mainLight=null,r.initScene(),r}return(0,y.default)(a,[{key:"initScene",value:function(){this._layers.extent[0]&&this._group.add(this._layers.extent[0]._scene),this._layers.model[0]&&this._group.add(this._layers.model[0]._scene)}},{key:"getHeight",value:function(){return this.height+this._offsetHeight}},{key:"getOrCreateLayer",value:function(e){if(this._layers[e][0])return this._layers[e][0];var t=M.AliasLayerMap.get(e),n=new t;return n.scene.position.setY(this._height),n.scene.updateMatrix(),n.scene.updateWorldMatrix(),n.parent=this,this._layers[e].push(n),(0,v.default)(this.parent.parent).setRenderList(),this._layers[e][0]}},{key:"getLayers",value:function(e){var t=[],n=this._layers[e];return t.push.apply(t,(0,m.default)(n)),t}},{key:"getDynmodel",value:function(e){for(var t=this._layers.dynmodel,n=0;n<t.length;n++){var r=t[n].scene;r&&e(r)}}},{key:"everyLayers",value:function(e,t){if(this._layers)for(var n in this._layers)if(!(-1<(0,p.default)(e).call(e,n)))for(var r=this._layers[n],i=0;i<r.length;i++){var a=r[i].scene;a&&t(a)}}},{key:"getNodeByLayerId",value:function(e,t){if(this._layers)return this._layers[e][0]?this._layers[e][0].getNodeById(t):void 0}},{key:"bcross",value:function(e,t){var n=e.renderNode.boundingBox.min,r=e.renderNode.boundingBox.max,i=t.renderNode.boundingBox.min,a=t.renderNode.boundingBox.max;return T.default.isRectCross(new vector2(n.x,n.z),new vector2(r.x,r.z),new vector2(i.x,i.z),new vector2(a.x,a.z))}},{key:"mergeModels",value:function(e){var t,n=this._layers.model[0],r=[];for(t in n._models)n._models[t].FID in e&&r.push(n._models[t]);var i,a=this.checkModelsNearly(r),o=E(a.l);try{for(o.s();!(i=o.n()).done;){var s=i.value;n.removeNode(s)}}catch(e){o.e(e)}finally{o.f()}}},{key:"mergeModel",value:function(e,t){var n=new ThreeBSP(e.renderNode.geometry),r=new ThreeBSP(t.renderNode.geometry),i=n.union(r.tree),a=i.toMesh(e.material);return e._renderNode=a}},{key:"couldMerge",value:function(e,t){var n=new ThreeBSP(e.renderNode.geometry),r=new ThreeBSP(t.renderNode.geometry),i=n.intersect(r.tree);return 0<i.tree.polygons.length}},{key:"checkModelsNearly",value:function(e){for(var t=[],n=0;n<e.length;n++){for(var r=0,i=0;i<e.length;i++)this.bcross(e[n],e[i])&&r++;r||t.push(n)}for(var a=t.length-1;-1<a;a--){var o=(0,p.default)(e).call(e,e[t[a]]);-1<o&&(0,f.default)(e).call(e,o,1)}for(var s=0,l=1,u=[],h=[];0<e.length;)if(this.couldMerge(e[s],e[l])){var c=this.mergeM(e[s],e[l]);h.push(e[l]),(0,f.default)(e).call(e,l,1),(0,f.default)(e).call(e,s,1),e.push(c),s=0,l=1}else{if(l!==e.length-1)return l++,{e:u,l:h};var d=(0,f.default)(e).call(e,s,1);u.push(d),s=0,l=1}}},{key:"traverse",value:function(e){if(this._layers)for(var t in this._layers)for(var n=this._layers[t],r=0;r<n.length;r++)e(n[r])}},{key:"traverseByAlias",value:function(r,i,a){var o=this;if(this._layers){var e,t=function(t){if(-1<(0,p.default)(r).call(r,t))for(var e=o._layers[t],n=0;n<e.length;n++)a?i(e[n],t):e[n].traverse(function(e){i(e,t)})};for(e in this._layers)t(e)}}},{key:"setExtentImage",value:function(e){var t,n=this.parent.parent.materialManager.loadTexture(e,function(){}),r=this.getLayers("extent"),i=E(r);try{for(i.s();!(t=i.n()).done;){var a,o=t.value;for(a in o.extents){var s=o.extents[a];(0,v.default)(s.renderNode.material)&&(0,v.default)(s.renderNode.material).dispose(),s.renderNode.material.map=n,s.renderNode.material.needsUpdate=!0}}}catch(e){i.e(e)}finally{i.f()}}},{key:"clearExtentImage",value:function(){var e,t=this.getLayers("extent"),n=E(t);try{for(n.s();!(e=n.n()).done;){var r,i=e.value;for(r in i.extents){var a=i.extents[r];(0,v.default)(a.renderNode.material).dispose(),a.renderNode.material.map=null,a.renderNode.material.needsUpdate=!0}}}catch(e){n.e(e)}finally{n.f()}}},{key:"_getLayers",value:function(e){if(this._layers){var t,n={};for(t in this._layers){for(var r=this._layers[t],i=[],a=0;a<r.length;a++){e&&r[a].checkSceneNode();var o=r[a].scene;r[a].visible&&o&&i.push(o)}n[t]=i}return n}}},{key:"initLayers",value:function(){var e,t=E(M.LayerAlias);try{for(t.s();!(e=t.n()).done;){var n=e.value;this._layers[n]=[]}}catch(e){t.e(e)}finally{t.f()}}},{key:"initLayersByData",value:function(e){var t,n=e.geo[0],r=e.biz[0],i=(0,d.default)(n),a=E(i);try{for(a.s();!(t=a.n()).done;){var o,s,l=t.value;n[l]&&0<n[l].length&&M.Prop2Alias[l]&&(o=M.AliasLayerMap.get(M.Prop2Alias[l]),s=new o(n[l],r[l]),s.scene.position.setY(this._height),s.scene.updateMatrix(),s.scene.updateWorldMatrix(),s.parent=this,this._layers[M.Prop2Alias[l]].push(s))}}catch(e){a.e(e)}finally{a.f()}}},{key:"removeAlwaysShowMarker",value:function(e){var t,n,r=(0,p.default)(t=this.alwaysShowMarkers).call(t,e);-1<r&&(0,f.default)(n=this.alwaysShowMarkers).call(n,r,1)}},{key:"dispose",value:function(){for(var e in this.alwaysShowMarkers.length=0,this.layers){for(var t=this.layers[e],n=0;n<t.length;n++)t[n].dispose(),t[n].parent=void 0;t.length=0,this._layers[e]=void 0}for(var r=this._locationScene.children.length-1;-1<r;r--)this._locationScene.remove(this._locationScene.children[r]);var i,a=E(this._locations);try{for(a.s();!(i=a.n()).done;){var o=i.value;o.parent=void 0,o.dispose()}}catch(e){a.e(e)}finally{a.f()}this._groupMessage=void 0,this._layers=void 0}},{key:"addLayer",value:function(e){e.parent=this,e.scene.position.setY(this._height),e.scene.updateMatrix(),e.scene.updateWorldMatrix(),this._layers[e.alias].push(e),(0,v.default)(this.parent.parent).setRenderList(),(e.prepareInited||0<e.prepareInitObjects.length)&&e.initPrepare()}},{key:"removeLayer",value:function(e){var t;e.removeAll&&e.removeAll(),e.parent=void 0;var n,r=(0,p.default)(t=this._layers[e.alias]).call(t,e);-1<r&&(0,f.default)(n=this._layers[e.alias]).call(n,r,1),(0,v.default)(this.parent.parent).setRenderList()}},{key:"getLayer",value:function(e){var t=this._layers[e];if(1<t.length){var n=[];return n.push.apply(n,(0,m.default)(t)),n}return t[0]}},{key:"getFirstLayer",value:function(){var e=this._layers[layer.alias];return e[0]}},{key:"addLocation",value:function(e){e.parent=this,this._locations.push(e),this._locationScene.add(e.renderNode)}},{key:"removeLocation",value:function(e){var t,n,r=(0,p.default)(t=this._locations).call(t,e);e.isAlwaysShow&&this.removeAlwaysShowMarker(e),e.parent=void 0,-1<r&&(0,f.default)(n=this._locations).call(n,r,1),this._locationScene.remove(e.renderNode)}},{key:"getCenterPosition",value:function(){return new fm.Vector3(this.parent.center.x,this.parent.center.y+this._height,0)}},{key:"getModelMeshs",value:function(){var e,t=[],n=E(this._layers.model);try{for(n.s();!(e=n.n()).done;){var r=e.value;t.push.apply(t,(0,m.default)(r.getAllMesh()))}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"getExtentMeshs",value:function(){var e,t=[],n=E(this._layers.extent);try{for(n.s();!(e=n.n()).done;){var r=e.value;t.push.apply(t,(0,m.default)(r.getAllMesh()))}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"applyHeatMap",value:function(e){e&&(e.renderToMap(this._groupId),this.heatmap_=e)}},{key:"removeHeatMap",value:function(e){e.disposeHeatMap(this._groupId),this.heatmap_=null}},{key:"addLine",value:function(e){this._lineScene.add(e)}},{key:"removeLine",value:function(e){this._lineScene.remove(e)}},{key:"locationScene",get:function(){return this._locationScene}},{key:"lineScene",get:function(){return this._lineScene}},{key:"groupAlias",get:function(){return this._groupAlias}},{key:"groupDesc",get:function(){return this._groupDesc}},{key:"groupName",get:function(){return this._groupName}},{key:"groupHeight",get:function(){return this._groupHeight}},{key:"height",set:function(t){this._height=t,this.traverse(function(e){e.scene.position.setY(t),e.scene.updateMatrix(),e.scene.updateWorldMatrix()}),this._locationScene.position.setY(t),this._locationScene.updateMatrix(),this._locationScene.updateWorldMatrix()},get:function(){return this._height}},{key:"layers",get:function(){return this._layers}},{key:"visible",get:function(){return this._visible},set:function(e){this._hideWithFree&&(e||this.traverseByAlias(["extent","label","facility","model"],function(e){e.releaseGpuMemory()})),this._visible=e}},{key:"offsetHeight",set:function(e){this._offsetHeight=e},get:function(){return this._offsetHeight}},{key:"hideWithFree",set:function(e){this._hideWithFree=e}},{key:"mapCoord",get:function(){return(new fm.Vector2).copy(this.parent.mapcenter)}},{key:"mapCoordRange",get:function(){for(var e=[{x:Number.MAX_VALUE,y:Number.MAX_VALUE},{x:-Number.MAX_VALUE,y:-Number.MAX_VALUE}],t=this._layers.extent,n=0;n<t.length;n++){var r,i=t[n],a=i._extents;for(r in a)for(var o=a[r],s=o.gdata.geo,l=null,l=null!==s?S.default.convertGeo2Geometry(s).vertices:S.default.convertArray2Geometry(o.gdata.idxs,o.gdata.pts).vertices,u=0;u<l.length;u++)u%2==0?(l[u]<e[0].x&&(e[0].x=l[u]),l[u]>e[1].x&&(e[1].x=l[u])):(l[u]<e[0].y&&(e[0].y=l[u]),l[u]>e[1].y&&(e[1].y=l[u]))}return e}}]),a}(b.default),k=N;t.default=k},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.netArea=t.LayerOrder=t.Prop2Alias=t.AliasLayerMap=t.LayerAlias=void 0;var a=r(n(186)),o=r(n(213)),s=r(n(485)),l=r(n(486)),u=r(n(217)),h=r(n(219)),c=r(n(221)),d=r(n(223)),f=r(n(224)),p=r(n(491)),m=r(n(225)),v=r(n(493)),g=r(n(494)),y=r(n(227)),_=r(n(495)),x=r(n(496)),w=["extent","model","label","facility","line","locationMarker","text","textMarker","polygonMarker","gradientPolygonMarker","extrudeMarker","imageMarker","stair","externalModel","heatmap","dynmodel","symbol","domMarker","waterMarker","dynline"];t.LayerAlias=w;var b=new a.default;t.AliasLayerMap=b,b.set("extent",o.default),b.set("externalModel",s.default),b.set("model",l.default),b.set("label",u.default),b.set("facility",h.default),b.set("imageMarker",c.default),b.set("polygonMarker",d.default),b.set("textMarker",f.default),b.set("stair",p.default),b.set("heatmap",m.default),b.set("symbol",v.default),b.set("domMarker",g.default),b.set("dynmodel",y.default),b.set("waterMarker",_.default),b.set("dynline",x.default);var M={extentLayer:"extent",externalModelLayer:"externalModel",labelLayer:"label",modelLayer:"model",poiLayer:"facility",stairLayer:"stair"};t.Prop2Alias=M;var T={extent:0,line:2,model:1,externalModel:.5,heatmap:3,polygonMarker:4,gradientPolygonMarker:4,extrudeMarker:4,location:4,facility:3.5,label:4,imageMarker:4,textMarker:4,domMarker:4,waterMarker:3,dynmodel:.5,dynline:2};t.LayerOrder=T;var S="https://www.fengmap.com/";t.netArea=S},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(10)),s=r(n(2)),l=r(n(3)),u=r(n(5)),h=r(n(6)),c=r(n(7)),d=r(n(17)),f=r(n(484));function p(r){var i=m();return function(){var e,t=(0,c.default)(r),n=i?(e=(0,c.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,h.default)(this,n)}}function m(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var v=function(e){(0,u.default)(i,e);var r=p(i);function i(e,t){var n;return(0,s.default)(this,i),n=r.call(this,"extentLayer"),n._scene=new fm.Scene,n._scene.name="extent",n._scene.userData.type="extent",n._extents={},n.initNode(e,t),n._visible=!0,n.initLight(),n.putLight(),n}return(0,l.default)(i,[{key:"initLight",value:function(){this._ambientLight=new fm.AmbientLight(7631988),this._target=new fm.Object3D,this._mainLight=new fm.DirectionalLight(8947848,1.2),this._mainLight.position.set(-1,1,1).normalize(),this._mainLight.castShadow=!1,this._mainLight.target=this._target,this._secondLight=new fm.DirectionalLight(3355443),this._secondLight.position.set(-.5,1,-1).normalize(),this._secondLight.target=this._target}},{key:"initNode",value:function(e,t){for(var n=0;n<e.length;n++)this.createNode(e[n],t[n])}},{key:"createNode",value:function(e,t){var n=new f.default(e,t);n.parent=this,this._extents[""+n.eid]=n}},{key:"addNodes",value:function(e){e.parent=this,e.renderNode&&this._scene.add(e.renderNode),this._extents[""+e.eid]=e}},{key:"putLight",value:function(){var e=this;this.scene.add(this._mainLight),this.scene.add(this._ambientLight),this.scene.add(this._secondLight),this.scene.add(this._target),this.scene.removeLight=function(){e.removeLight()}}},{key:"removeLight",value:function(){this.scene.remove(this._mainLight),this.scene.remove(this._ambientLight),this.scene.remove(this._secondLight)}},{key:"disposeLight",value:function(){this._mainLight=void 0,this._ambientLight=void 0,this._secondLight=void 0}},{key:"getNodeById",value:function(e){return this._extents[""+e]}},{key:"traverse",value:function(e){for(var t in this._extents)e&&e(this._extents[t])}},{key:"getVideoMemoryAmount",value:function(){var t=null;return this.traverse(function(e){e._renderNode&&e._renderNode.geometry&&e._renderNode.geometry._bufferGeometry&&(t+=e._renderNode.geometry._bufferGeometry.attributes.position.array.byteLength,t+=e._renderNode.geometry._bufferGeometry.attributes.color.array.byteLength,t+=e._renderNode.geometry._bufferGeometry.attributes.normal.array.byteLength,t+=e._renderNode.geometry._bufferGeometry.attributes.uv.array.byteLength)}),t}},{key:"checkSceneNode",value:function(){for(var e in this._scene.children.length=0,this._extents)this._extents[e].visible&&this._extents[e].renderNode&&this._scene.add(this._extents[e].renderNode);this.putLight()}},{key:"getAllMesh",value:function(){var e,t=[];for(e in this._extents)this._extents[e].renderNode&&t.push(this._extents[e].renderNode);return t}},{key:"dispose",value:function(){for(var e in this._extents)this._extents[e].dispose(),this._scene.remove(this._extents[e].renderNode),this._extents[e].parent=void 0,this._extents[e]=void 0;this.removeLight(),this.disposeLight(),this._scene.length=0,this._scene=void 0}},{key:"extents",get:function(){return this._extents},set:function(e){this._extents=e}},{key:"scene",get:function(){return this._scene}},{key:"visible",get:function(){return this._visible},set:function(e){this._visible=e,this.parent&&this.parent.parent&&this.parent.parent.parent&&(0,o.default)(this.parent.parent.parent).setRenderList()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}}]),i}(d.default),g=v;t.default=g},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(20)),u=r(n(21)),h=r(n(22)),a=r(n(18)),o=r(n(13)),s=r(n(4)),c=r(n(9)),d=r(n(10)),f=r(n(30)),p=r(n(14)),m=r(n(2)),v=r(n(3)),g=r(n(5)),y=r(n(6)),_=r(n(7)),x=r(n(17)),w=r(n(37)),b=r(n(41));function M(e,t){var n;if(void 0===h.default||null==(0,u.default)(e)){if((0,p.default)(e)||(n=T(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=(0,l.default)(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function T(e,t){var n;if(e){if("string"==typeof e)return S(e,t);var r=(0,o.default)(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?(0,a.default)(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?S(e,t):void 0}}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function E(r){var i=A();return function(){var e,t=(0,_.default)(r),n=i?(e=(0,_.default)(this).constructor,(0,s.default)(t,arguments,e)):t.apply(this,arguments);return(0,y.default)(this,n)}}function A(){if("undefined"==typeof Reflect||!s.default)return!1;if(s.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,s.default)(Date,[],function(){})),!0}catch(e){return!1}}var I=function(e){(0,g.default)(i,e);var r=E(i);function i(e,t){var n;return(0,m.default)(this,i),n=r.call(this,t.eid,w.default.EXTERANL_MODEL),n._parseData=null,n._isInitMesh=!0,n._visible=!0,n._renderNode=null,n._geometry=void 0,n._line=null,n._bdata=t,n._selected=!1,n._preColor=null,n._preOpacity=null,n.name=t.name,n.FID=t.fid,n.ID=t.eid,n.typeID=t.type,n.gdata=e,n}return(0,v.default)(i,[{key:"initMesh",value:function(e,t){this._geometry&&(this._renderNode=new fm.Mesh(this._geometry.geometry,e),this._renderNode.mapNode=this,this._renderNode.scale.set(-1,1,1),this._renderNode.rotation.set(Math.PI/2,0,0,"XYZ"),this._renderNode.position.copy(t),this._renderNode.parent=this.parent.scene,this._renderNode.visible=this.show)}},{key:"setByTheme",value:function(e){var t=this._renderNode.material,n=this._renderNode;if((0,p.default)(t)){var r,i=M(t);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.color=new fm.Color(b.default.toColor(e.color)),a.userData.opacity=t.opacity}}catch(e){i.e(e)}finally{i.f()}}else t.color=new fm.Color(b.default.toColor(e.color)),t.userData.opacity=t.opacity;var o=e.scale.split(","),s=e.rotate.split(",");e.translate.split(","),n.scale.set((0,f.default)(o[0]),(0,f.default)(o[1]),(0,f.default)(o[2])),n.rotation.set((0,f.default)(s[0])*fm.Math.DEG2RAD,(0,f.default)(s[2])*fm.Math.DEG2RAD,(0,f.default)(s[1])*fm.Math.DEG2RAD)}},{key:"checkByFrustum",value:function(){var e=!0;this._renderNode&&("Mesh"===this._renderNode.type||"Scene"===this._renderNode.type&&this._renderNode.traverse(function(){fm.Mesh}),this._renderNode.updateMatrixWorld(!0),this.visible=e)}},{key:"setColor",value:function(n,r){var i=this;this._renderNode.traverse(function(e){if(e instanceof fm.Mesh)if(void 0!==e.material.length)for(var t=0;t<e.material.length;t++)i._preColor=e.material[t].color,e.material[t].color=new fm.Color(b.default.toRgba(n)),i._preOpacity=e.material[t].opacity,"number"==typeof r&&(e.material[t].opacity=r),e.material[t].needsUpdate=!0;else i._preColor=e.material.color,e.material.color=new fm.Color(b.default.toRgba(n)),i._preOpacity=e.material.opacity,"number"==typeof r&&(e.material.opacity=r),e.material.needsUpdate=!0})}},{key:"setColorToDefault",value:function(){var n=this;this._renderNode.traverse(function(e){if(e instanceof fm.Mesh)if(void 0!==e.material.length)for(var t=0;t<e.material.length;t++)e.material[t].color=n._preColor,e.material[t].opacity=n._preOpacity,e.material[t].needsUpdate=!0;else e.material.color=n._preColor,e.material.opacity=n._preOpacity,e.material.needsUpdate=!0})}},{key:"gradientColor",value:function(){var e,t,n,r=this;this._renderNode&&(this._renderNode.material.userData.color=this._renderNode.material.color,e=this.findParent(NodeManager),t=(0,d.default)(e),n=t.modelSelectColor,animater=new Animater({r:n.r/2,g:n.g/2,b:n.b/2,a:n.a/2},n,500,function(){t.removeAnimater(animater),animater=void 0},function(e){r._renderNode.material.color=new fm.Color(e.r,e.g,e.b),r._renderNode.material.alpha=e.a,r._renderNode.material.update=!0}).start(),t.addAnimater(animater))}},{key:"clearGradient",value:function(){var e,t;this._renderNode&&(e=this.findParent(NodeManager),t=(0,d.default)(e),animater&&t.removeAnimater(animater),this._renderNode.material.color=this._renderNode.material.userData.color,this._renderNode.material.userData.color=void 0)}},{key:"dispose",value:function(){if(this._renderNode&&"Mesh"===this._renderNode.type){for(var e in this._renderNode.material.uniforms)e.value instanceof fm.Texture&&e.value.dispose();if((0,p.default)(this._renderNode.material)){var t,n=M(this._renderNode.material);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.dispose()}}catch(e){n.e(e)}finally{n.f()}}else this._renderNode.material.dispose();this._renderNode.geometry.dispose(),this._renderNode.material=void 0,this._renderNode.geometry=void 0,this._geometry=void 0,this._renderNode.mapNode=void 0,this._renderNode=void 0}}},{key:"visible",set:function(e){var t;e?(0,c.default)(t=this.parent.scene.children).call(t,this._renderNode)<0&&this._renderNode&&this.parent.scene.add(this._renderNode):(this._renderNode&&this.parent.scene.remove(this._renderNode),this._renderNode.parent=this.parent.scene),this._visible=e},get:function(){return this._visible}},{key:"renderNode",get:function(){return this._renderNode},set:function(e){var t;this.parent&&(this._renderNode=e,this._renderNode.mapNode=this,(0,c.default)(t=this.parent.scene.children).call(t,this._renderNode)<0&&this._renderNode&&this.parent.scene.add(this._renderNode))}},{key:"bdata",get:function(){return this._bdata},set:function(e){this._bdata=e}}]),i}(x.default),L=I;t.default=L},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a,o,s=r(n(4)),l=r(n(9)),u=r(n(216)),h=r(n(10)),c=r(n(12)),d=r(n(27)),f=r(n(2)),p=r(n(3)),m=r(n(5)),v=r(n(6)),g=r(n(7)),y=r(n(17)),_=r(n(37)),x=r(n(46)),w=r(n(77)),b=r(n(45)),M=r(n(28));function T(r){var i=S();return function(){var e,t=(0,g.default)(r),n=i?(e=(0,g.default)(this).constructor,(0,s.default)(t,arguments,e)):t.apply(this,arguments);return(0,v.default)(this,n)}}function S(){if("undefined"==typeof Reflect||!s.default)return!1;if(s.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,s.default)(Date,[],function(){})),!0}catch(e){return!1}}var E=function(e){(0,m.default)(i,e);var r=T(i);function i(e,t){var n;return(0,f.default)(this,i),n=r.call(this,t.eid,_.default.MODEL),n._parseData=null,n._isInitMesh=!0,n._visible=!0,n._renderNode=null,n._data=null,n._geometry,n._shape,n.currHeight=2,n._line=null,n._modelColor=null,n._modeAlpha=1,n._lineColor=null,n._lineAlpha=1,n._selected=!1,n._sgstat=!1,n._card={top:null,left:null,right:null,front:null,back:null},n.precolor={useModel:!1,useStroke:!1,mcolor:null,strokeColor:null,malpha:1,strokeAlpha:1},n.FID=t.fid,n.ID=t.eid,n.ename=t.ename,n.name=t.name,n.typeID=t.type,n.minlevel=t.minlevel,n.maxlevel=t.maxlevel,n.bdata=t,n.gdata=e,n.preSelect=!1,n}return(0,p.default)(i,[{key:"initMesh",value:function(e,t,n){this._geometry&&(this._renderNode=new fm.Mesh(this._geometry.geometry,e),this._renderNode.mapNode=this,this._modelColor=e.color,this._modelAlpha=e.opacity,this._renderNode.scale.set(1,-1,1),this._renderNode.rotation.set(Math.PI/2,0,0,"XYZ"),this._renderNode.position.copy(t),this._renderNode.frustumCulled=!1,this._renderNode.parent=this.parent.scene,this._renderNode.castShadow=!0,this._renderNode.name="oneModel",n&&(this._renderNode.name="isNeedSweeep",this._renderNode.material.uniforms={maxPos:{value:this.sweepMax},minPos:{value:this.sweepMin},relativeModelMatrix:{value:this._renderNode.matrixWorld}}),this.renderNodeInited=!0,this.precolor.useModel&&(this.precolor.mcolor&&(e.color=this.precolor.mcolor),"number"==typeof this.precolor.malpha&&(e.opacity=this.precolor.malpha)),this.preSelect&&(this.selected=!0,this.preSelect=!1))}},{key:"releaseGpuMemory",value:function(){this.renderNode&&(this._geometry=null,this._data=null,this.renderNodeInited=!1,this.renderNode.parent.remove(this.renderNode),this.dispose())}},{key:"restoreGpuMemeory",value:function(){}},{key:"getBbox",value:function(){}},{key:"getRadius1",value:function(){return this._renderNode.geometry.boundingSphere.radius}},{key:"getRadius",value:function(){for(var e=null,t={x:this._renderNode._x-this.parent.parent.parent.mapcenter.x,y:this._renderNode._y-this.parent.parent.parent.mapcenter.y},n=[],r=this._renderNode.geometry.vertices,i=0;i<r.length;i++){var a,o,s={};s.vertex=r[i],s.distance=Math.abs(Math.sqrt(Math.pow(r[i].x-t.x,2)+Math.pow(r[i].y-t.y,2))),n.length<2?n.push(s):2===n.length?n[0].distance>n[1].distance&&(a=null,a=n.shift(),n.push(a)):s.distance<n[1].distance&&(s.distance<n[0].distance?(o=null,n.pop(),o=n.shift(),n.push(s),n.push(o)):(n.pop(),n.push(s)))}var l={x:(n[0].vertex.x+n[1].vertex.x)/2,y:(n[0].vertex.y+n[1].vertex.y)/2},u=Math.abs(Math.sqrt(Math.pow(l.x-t.x,2)+Math.pow(l.y-t.y,2))),e=n[0].distance<u?n[0].distance:u;return e}},{key:"setByTheme",value:function(e){var t,n,r,i,a;this._renderNode&&(t=this.findParent(x.default),n=t.materialManager.createNormalMaterial(e),r=t.materialManager.createLineMaterial(e),this._lineColor=r.color,this._lineAlpha=r.opacity,this._modelColor=n.color,this._modeAlpha=n.opacity,this._renderNode.material.dispose(),this._renderNode.material=n,this._line&&(this._line.material=r),this._geometry=null,this._card.top&&this.removeStoreImage(),e.image&&e.sizes&&(i=e.sizes.split(","),a=[],e.coords&&(a=e.coords.split(",")),this.addStoreImage({image:e.image?t._map.MapOptions.themeServerURL+e.logoPath+"/"+e.image:"",angle:e.angle?e.angle:0,size:[(0,d.default)(i[0]),(0,d.default)(i[1])],mapCoord:e.coords?new fm.Vector2((0,d.default)(a[0]),(0,d.default)(a[1])):void 0})))}},{key:"initLine",value:function(e,t){if(this._geometry){var n=(new fm.Geometry).setFromPoints(this._geometry.shape.getPoints());n&&0<n.vertices.length&&n.vertices.push(n.vertices[0]);for(var r=[],i=n.vertices.length,a=0;a<i;a++)0==a||a==i-1?r.push(n.vertices[a]):r.push(n.vertices[a],n.vertices[a]);n.vertices=r;var o=new fm.LineSegments(n,e);this._lineColor=e.color,this._lineAlpha=e.opacity,o.castShadow=!1,o.position.setZ(.005*-t),o.geometry.computeBoundingSphere(),this.precolor.useStroke&&(e.color=this.precolor.strokeColor,e.opacity=this.precolor.strokeAlpha),this._line=o,this._line.frustumCulled=!1,this._line.matrixAutoUpdate=!1,this._renderNode.add(o),this._shape=this._geometry.shape,this._geometry=null}}},{key:"setHeight",value:function(e){this.currHeight&&(this._renderNode.scale.z*=e/this.currHeight,this._renderNode.position.y+=e-this.currHeight),this.currHeight=e}},{key:"checkByFrustum",value:function(e){var t=!0;this._renderNode&&(this._renderNode.updateMatrixWorld(!0),t=e.intersectsObject(this._renderNode)),this.visible=t}},{key:"setColor",value:function(e,t){if(!this._renderNode)return this.precolor.mcolor=e?new fm.Color(e):e,this.precolor.malpha=t,void(this.precolor.useModel=!0);e&&(this._renderNode.material.color=new fm.Color(e)),"number"==typeof t&&(this._renderNode.material.opacity=t,t!==this._renderNode.material.userData.opacity&&(this._renderNode.material.userData.opacity=t))}},{key:"setStrokeColor",value:function(e,t){if(!this._renderNode)return this.precolor.strokeColor=new fm.Color(e),this.precolor.strokeAlpha=t,void(this.precolor.useStroke=!0);this._line.material.color=new fm.Color(e),this._line.material.opacity=t}},{key:"setColorToDefault",value:function(){this._renderNode&&(this._renderNode.material.color=this._modelColor,this._renderNode.material.opacity=this._modeAlpha)}},{key:"setStrokeColorToDefault",value:function(){this._line.material.color=this._lineColor,this._line.material.opacity=this._lineAlpha}},{key:"addStoreImage",value:function(e){var t,n,r,i=this.findParent(x.default),a=this.parent.parent.parent,o=a.mapcenter,s=e.mapCoord?e.mapCoord:this.mapCoord;this._renderNode&&e.image&&(e=(0,c.default)({size:[5,5],height:.1,angle:0,offset:[0,0]},e),this._card.top&&this.removeStoreImage(),t=new fm.PlaneBufferGeometry(1,1,1,1),n=new fm.MeshLambertMaterial({transparent:!0,depthWrite:!1}),i.materialManager.loadTexture(e.image,function(e){e.anisotropy=4,e.minFilter=fm.LinearFilter,n.map=e,n.needsUpdate=!0}),r=new fm.Mesh(t,n),r.scale.set(e.size[0],e.size[1],-1),r.position.set(e.offset[0]+s.x-o.x,e.offset[1]+s.y-o.y,-e.height),r.rotation.z=-e.angle*fm.Math.DEG2RAD,r.renderOrder=10,this._renderNode.add(r),this._card.top=r)}},{key:"getUvTransForm",value:function(){var e=this.parent.parent.parent,t=(e.center,e.bbox);t.max.x,t.min.x,t.max.y,t.min.y,this.renderNode}},{key:"removeStoreImage",value:function(){this._card.top&&(this._renderNode.remove(this._card.top),this._card.top.geometry.dispose(),(0,h.default)(this._card.top.material)&&(0,h.default)(this._card.top.material).dispose(),this._card.top.material.dispose(),this._card.top=null)}},{key:"dispose",value:function(){this._renderNode&&(this._line&&(this._renderNode.remove(this._line),this._line.material.dispose(),this._line.geometry.dispose(),this._line=void 0),this.removeStoreImage(),this._renderNode.material.dispose(),this._renderNode.geometry.dispose(),this._renderNode.material=void 0,this._renderNode.geometry=void 0,this._geometry=void 0,this._data=void 0,this._renderNode.mapNode=void 0,this._renderNode=void 0)}},{key:"flash",value:function(){var e,t,n,r,i=this;this._renderNode&&(this._renderNode.material.userData.color=this._renderNode.material.color,e=this.findParent(x.default),t=(0,h.default)(e),n=t.modelSelectColor,r={r:n.r/2,g:n.g/2,b:n.b/2,a:n.a/2},a=function(){var e=(Math.sin((new Date).getTime()/180)+1)/2;i._renderNode.material.color=new fm.Color(r.r*(1+e),r.g*(1+e),r.b*(1+e))},t.on("frameLoop",a))}},{key:"stopFlash",value:function(){var e,t;this._renderNode&&(e=this.findParent(x.default),t=(0,h.default)(e),t.off("frameLoop",a),this._renderNode.material.color=this._renderNode.material.userData.color)}},{key:"gradientColor",value:function(){var e,t,n,r=this;this._renderNode&&(this._renderNode.material.userData.color=this._renderNode.material.color,e=this.findParent(x.default),t=(0,h.default)(e),n=t.modelSelectColor,o=new w.default({r:n.r/2,g:n.g/2,b:n.b/2,a:n.a/2},n,500,function(){t.removeAnimater(o),o=void 0},function(e){r._renderNode.material.color=new fm.Color(e.r,e.g,e.b),r._renderNode.material.alpha=e.a,r._renderNode.material.update=!0}).start(),t.addAnimater(o))}},{key:"clearGradient",value:function(){var e,t;this._renderNode&&(e=this.findParent(x.default),t=(0,h.default)(e),o&&t.removeAnimater(o),this._renderNode.material.color=this._renderNode.material.userData.color,this._renderNode.material.userData.color=void 0)}},{key:"distanceToPoint",value:function(e){var t=this._shape.getPoints(),n=M.default.isInPolygon(e,t);if(n)return 0;for(var r=u.default,i=0;i<t.length-1;i++){var a=M.default.pointDistanceToLine(e,t[i],t[i+1],new fm.Vector2);a<r&&(r=a)}return r}},{key:"selected",set:function(e){if(e!==this._selected){if(this._selected=e,!this.renderNodeInited)return void(this.preSelect=!0);e?this.gradientColor():this.clearGradient()}},get:function(){return this._selected}},{key:"visible",set:function(e){var t;e?(0,l.default)(t=this.parent.scene.children).call(t,this._renderNode)<0&&this._renderNode&&this.parent.scene.add(this._renderNode):this._renderNode&&(this.parent.scene.remove(this._renderNode),this._renderNode.parent=this.parent.scene),this._visible=e},get:function(){return this._visible}},{key:"renderNode",get:function(){return this._renderNode},set:function(e){this._renderNode=e}},{key:"mapCoord",get:function(){var e=(0,h.default)(this.parent.parent.parent.parent).dataManager.file_ver,t=this.parent.parent.layers.label[0].labels[""+this._eid];if(t){if(t.renderNodeInited)return{x:t.x,y:t.y,z:this.height};var n=null,n=1===e?b.default.convertGeo2Points(t.gdata.geo):b.default.convertArrayPoints(t.gdata.idxs,t.gdata.pts);return{x:n.vertices[0].x,y:n.vertices[0].y,z:this.height}}return{x:null,y:null,z:null}}},{key:"label",get:function(){return this.parent.parent.layers.label[0].labels[""+this._eid]}},{key:"height",set:function(e){this._height=e},get:function(){return this.renderNodeInited?this._height:this.gdata.height}},{key:"line",get:function(){return this._line}}]),i}(y.default),A=E;t.default=A},function(e,t,n){e.exports=n(487)},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(10)),s=r(n(2)),l=r(n(3)),u=r(n(5)),h=r(n(6)),c=r(n(7)),d=r(n(17)),f=r(n(218));function p(r){var i=m();return function(){var e,t=(0,c.default)(r),n=i?(e=(0,c.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,h.default)(this,n)}}function m(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var v=function(e){(0,u.default)(i,e);var r=p(i);function i(e,t){var n;return(0,s.default)(this,i),n=r.call(this),n._scene=new fm.Scene,n._scene.userData.type="label",n._scene.name="label",n.alias="label",n._labels={},n.initNode(e,t),n.needAvoid=!0,n._visible=!0,n}return(0,l.default)(i,[{key:"traverse",value:function(e){for(var t in this._labels)e&&e(this._labels[t])}},{key:"getVideoMemoryAmount",value:function(){var n=null;return this.traverse(function(e){var t;e._renderNode&&(n+=e._renderNode.geometry.attributes.position.array.byteLength,n+=e._renderNode.geometry.attributes.uv.array.byteLength,(0,o.default)(e._renderNode.material)&&(t=null,t=(0,o.default)(e._renderNode.material).image.width*(0,o.default)(e._renderNode.material).image.height*32/8,n+=t))}),n}},{key:"initNode",value:function(e,t){for(var n=0;n<e.length;n++)this.createNode(e[n],t[n])}},{key:"createNode",value:function(e,t){var n=new f.default(e,t);n.parent=this,this._labels[""+n.eid]=n}},{key:"addNodes",value:function(e){e.parent=this,e.renderNode&&this._scene.add(e.renderNode),this._labels[""+e.eid]=e}},{key:"getNodeById",value:function(e){return this._labels[""+e]}},{key:"checkSceneNode",value:function(){for(var e in this._scene.children.length=0,this._labels)this._labels[e].visible&&this._labels[e].renderNode&&this._scene.add(this._labels[e].renderNode)}},{key:"dispose",value:function(){for(var e in this._labels)this._labels[e].dispose(),this._scene.remove(this._labels[e].renderNode),this._labels[e].parent=void 0,this._labels[e]=void 0;this._scene=void 0}},{key:"scene",get:function(){return this._scene}},{key:"visible",get:function(){return this._visible},set:function(e){this._visible=e,this.parent&&this.parent.parent&&this.parent.parent.parent&&(0,o.default)(this.parent.parent.parent).rushRenderNode()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}},{key:"labels",get:function(){return this._labels}}]),i}(d.default),g=v;t.default=g},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(9)),s=r(n(10)),l=r(n(2)),u=r(n(3)),h=r(n(5)),c=r(n(6)),d=r(n(7)),f=r(n(17)),p=r(n(37)),m=r(n(46)),v=r(n(111)),g=r(n(66)),y=r(n(45));function _(r){var i=x();return function(){var e,t=(0,d.default)(r),n=i?(e=(0,d.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,c.default)(this,n)}}function x(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var w=function(e){(0,h.default)(i,e);var r=_(i);function i(e,t){var n;return(0,l.default)(this,i),n=r.call(this,t.eid,p.default.LABEL),n._isInitSprite=!0,n._visible=!0,n._renderNode=null,n._geometry=void 0,n._size=20,n._theme=void 0,n.bdata=t,n.ename=t.ename,n._text=t.name,n.gdata=e,n.FID=t.fid,n.ID=t.eid,n.name=t.name,n.typeID=t.type,n.minlevel=t.minlevel,n.maxlevel=t.maxlevel,n}return(0,u.default)(i,[{key:"checkByFrustum",value:function(e){var t=!0;this._renderNode&&(this._renderNode.updateMatrixWorld(!0),t=e.intersectsSprite(this._renderNode)),this.visible=t}},{key:"initSprite",value:function(e,t){e&&(this._renderNode=new v.default(e),this._renderNode.position.copy(t),this._renderNode.mapNode=this,this._renderNode.frustumCulled=!0,this.renderNodeInited=!0,this._renderNode.parent=this.parent.scene,this._renderNode.visible=this.show,this._renderNode.name="spirit")}},{key:"setText",value:function(e){var t;this._renderNode&&this._theme&&(t=this.findParent(m.default),(0,s.default)(this._renderNode.material)&&(0,s.default)(this._renderNode.material).dispose(),this._renderNode.material&&this._renderNode.material.dispose(),this._renderNode.material=t.materialManager.createLabelMaterial(e,this._theme),this._text=e,this.setSize())}},{key:"releaseGpuMemory",value:function(){this.renderNode&&(this.renderNodeInited=!1,this._isInitSprite=!1,this.tryInit=!1,this.renderNode.parent.remove(this.renderNode),this.dispose())}},{key:"setByLanguage",value:function(e){var t,n,r,i=e===g.default.EN?this.bdata.ename:this.bdata.name;if(!i)return this.visible=!1,void this.dispose();this._renderNode?this.setText(i):this.tryInit&&!this.renderNodeInited&&(t=this.findParent(m.default),n=this.parent.parent.parent.theme.getLabelTheme(this.bdata),this._theme=n,r=t.materialManager.createLabelMaterial(i,n),this.initSprite(r,this.pos),this.setSize()),this.visible=!0}},{key:"setByTheme",value:function(e){var t;this._text&&(t=this.findParent(m.default),this._theme=e,this.size=1.4*e.fontsize,(0,s.default)(this._renderNode.material)&&(0,s.default)(this._renderNode.material).dispose(),this._renderNode.material&&this._renderNode.material.dispose(),this._renderNode&&(this._renderNode.material=t.materialManager.createLabelMaterial(this._text,this._theme,!1,this)),this.setSize())}},{key:"setSize",value:function(){var e=this.findParent(m.default);(0,s.default)(e).renderer.setLabelSize(this._renderNode,this.size)}},{key:"dispose",value:function(){this._renderNode&&(this._renderNode.material.dispose(),this._renderNode.geometry.dispose(),this._renderNode.material=void 0,this._renderNode.geometry=void 0,this.geometry=void 0,this._renderNode.mapNode=void 0,this._renderNode=void 0,this.renderNodeInited=!1)}},{key:"mapCoord",get:function(){var e=(0,s.default)(this.parent.parent.parent.parent).dataManager.file_ver,t=this;if(t){if(t.renderNodeInited)return{x:t.x,y:t.y,z:this.height};var n=null,n=1===e?y.default.convertGeo2Points(t.gdata.geo):y.default.convertArrayPoints(t.gdata.idxs,t.gdata.pts);return{x:n.vertices[0].x,y:n.vertices[0].y,z:this.height}}return{x:null,y:null,z:null}}},{key:"model",get:function(){return this.parent.parent.layers.model[0].models[""+this._eid]}},{key:"visible",set:function(e){var t;this._renderNode&&(e?(0,o.default)(t=this.parent.scene.children).call(t,this._renderNode)<0&&this._renderNode&&this.parent.scene.add(this._renderNode):(this.parent.scene.remove(this._renderNode),this._renderNode.parent=this.parent.scene)),this._visible=e},get:function(){return this._visible}},{key:"renderNode",get:function(){return this._renderNode},set:function(e){this._renderNode=e}},{key:"size",get:function(){return this._size},set:function(e){this._size=e;var t=this.findParent(m.default);(0,s.default)(t).wxInfo.pixelRatio&&(this._size*=(0,s.default)(t).wxInfo.pixelRatio)}},{key:"theme",set:function(e){this._theme=e}}]),i}(f.default),b=w;t.default=b},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(10)),s=r(n(2)),l=r(n(3)),u=r(n(5)),h=r(n(6)),c=r(n(7)),d=r(n(17)),f=r(n(220));function p(r){var i=m();return function(){var e,t=(0,c.default)(r),n=i?(e=(0,c.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,h.default)(this,n)}}function m(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var v=function(e){(0,u.default)(i,e);var r=p(i);function i(e,t){var n;return(0,s.default)(this,i),n=r.call(this),n._scene=new fm.Scene,n._scene.userData.type="facility",n.alias="facility",n._facility={},n.needAvoid=!0,n.initNode(e,t),n._visible=!0,n}return(0,l.default)(i,[{key:"initNode",value:function(e,t){if(e)for(var n=0;n<e.length;n++)this.createNode(e[n],t[n])}},{key:"createNode",value:function(e,t){var n=new f.default(e,t);n.parent=this,this._facility[""+n.eid]=n}},{key:"addNodes",value:function(e){e.parent=this,e.renderNode&&this._scene.add(e.renderNode),this._facility[""+e.eid]=e}},{key:"traverse",value:function(e){for(var t in this._facility)e&&e(this._facility[t])}},{key:"getNodeById",value:function(e){return this._facility[""+e]}},{key:"getVideoMemoryAmount",value:function(){var n=null;return this.traverse(function(e){var t;e._renderNode&&(n+=e._renderNode.geometry.attributes.position.array.byteLength,n+=e._renderNode.geometry.attributes.uv.array.byteLength,(0,o.default)(e._renderNode.material)&&(t=null,t=(0,o.default)(e._renderNode.material).image.width*(0,o.default)(e._renderNode.material).image.height*32/8,n+=t))}),n}},{key:"checkSceneNode",value:function(){for(var e in this._scene.children.length=0,this._facility)this._facility[e].visible&&this._facility[e].renderNode&&this._scene.add(this._facility[e].renderNode)}},{key:"dispose",value:function(){for(var e in this._facility)this._facility[e].dispose(),this._scene.remove(this._facility[e].renderNode),this._facility[e].parent=void 0,this._facility[e]=void 0;this._scene=void 0}},{key:"scene",get:function(){return this._scene}},{key:"visible",get:function(){return this._visible},set:function(e){this._visible=e,this.parent&&this.parent.parent&&this.parent.parent.parent&&(0,o.default)(this.parent.parent.parent).setRenderList()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}}]),i}(d.default),g=v;t.default=g},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(27)),s=r(n(9)),l=r(n(10)),u=r(n(12)),h=r(n(2)),c=r(n(3)),d=r(n(5)),f=r(n(6)),p=r(n(7)),m=r(n(17)),v=r(n(37)),g=r(n(46)),y=r(n(111)),_=r(n(45));function x(r){var i=w();return function(){var e,t=(0,p.default)(r),n=i?(e=(0,p.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,f.default)(this,n)}}function w(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var b=function(e){(0,d.default)(i,e);var r=x(i);function i(e,t){var n;return(0,h.default)(this,i),n=r.call(this,t.eid,v.default.FACILITY),n._isInitSprite=!0,n._visible=!0,n._renderNode=null,n._geometry=void 0,n._size=20,n.bdata=t,n.gdata=e,n.FID=t.fid,n.ID=t.eid,n.ename=t.ename,n.name=t.name,n.typeID=t.type,n.minlevel=t.minlevel,n.maxlevel=t.maxlevel,n}return(0,c.default)(i,[{key:"checkByFrustum",value:function(e){var t=!0;this._renderNode&&(this._renderNode.updateMatrixWorld(!0),t=e.intersectsObject(this._renderNode)),this.visible=t}},{key:"jump",value:function(e){var n,r,i,t,a,o=this;this._renderNode&&!this._isJumping&&(this._isJumping=!0,n=(0,u.default)({height:8,times:0,duration:1,delay:0},e),"number"==typeof n.height&&"number"==typeof n.times&&"number"==typeof n.duration&&"number"==typeof n.delay&&(n.duration*=1e3,n.delay*=1e3,n.all=n.duration+n.delay,n.halfDuration=n.duration/2,r=n.height-this._height,this._origonY=this._renderNode.position.y,i=(new Date).getTime(),t=this.findParent(g.default),a=(0,l.default)(t),this.jumpEvent=function(){var e,t;o._renderNode?(e=(new Date).getTime()-i,0!=n.times&&e/n.all>n.times?o.stopJump():(e%=n.all,e>n.duration?o._renderNode.position.y!=o._origonY&&(o._renderNode.position.y=o._origonY):(t=e/n.halfDuration-1,t=1-t*t,o._renderNode.position.y=o._origonY+r*t))):a.off("frameLoop",o.jumpEvent)},a.on("frameLoop",this.jumpEvent)))}},{key:"stopJump",value:function(){var e,t;this._renderNode&&this.jumpEvent&&(this._renderNode.position.y=this._origonY,this._isJumping=!1,e=this.findParent(g.default),t=(0,l.default)(e),t.off("frameLoop",this.jumpEvent))}},{key:"boost",value:function(e){var n,r,t,i,a=this;this._renderNode&&!this._isBoosting&&(this._isBoosting=!0,n=(0,u.default)({size:8,ratio:0,duration:1,delay:0},e),"number"==typeof n.size&&"number"==typeof n.ratio&&"number"==typeof n.duration&&"number"==typeof n.delay&&(n.duration*=1e3,n.delay*=1e3,n.all=n.duration+n.delay,n.halfDuration=n.duration/2,r=n.size-this._size,this._origonSize=this._size,t=this.findParent(g.default),i=(0,l.default)(t),this.boostEvent=function(){var e,t;a._renderNode?(e=(new Date).getTime(),t=Math.sin(e*n.ratio)/2+.5,a._size=a._origonSize+t*r,a.setSize()):i.off("frameLoop",a.boostEvent)},i.on("frameLoop",this.boostEvent)))}},{key:"stopBoost",value:function(){var e,t;this._renderNode&&this.boostEvent&&(this._size=this._origonSize,this._isBoosting=!1,e=this.findParent(g.default),t=(0,l.default)(e),t.off("frameLoop",this.boostEvent),this.setSize())}},{key:"initSprite",value:function(e,t){this._renderNode=new y.default(e),this._renderNode.mapNode=this,this._renderNode.frustumCulled=!1,this._renderNode.position.copy(t),this._renderNode.parent=this.parent.scene,this.renderNodeInited=!0,this._renderNode.visible=this.show,this._renderNode.name="spirit"}},{key:"releaseGpuMemory",value:function(){this.renderNode&&(this.renderNodeInited=!1,this.renderNode.parent.remove(this.renderNode),this.dispose())}},{key:"setByTheme",value:function(e){var t,n;this._renderNode&&(t=this.findParent(g.default),n=t.materialManager.createPoiMaterial(e),this._renderNode.material.dispose(),this._renderNode.material=n)}},{key:"setSize",value:function(){var e=this.findParent(g.default);e&&(0,l.default)(e).renderer.setFacilitySize(this._renderNode,this._size)}},{key:"dispose",value:function(){this._renderNode&&(this._renderNode.material.dispose(),this._renderNode.geometry.dispose(),this._renderNode.material=void 0,this._renderNode.geometry=void 0,this.geometry=void 0,this._renderNode.mapNode=void 0,this._renderNode=void 0)}},{key:"visible",set:function(e){var t;e?(0,s.default)(t=this.parent.scene.children).call(t,this._renderNode)<0&&(this._renderNode&&this.parent.scene.add(this._renderNode),this.setSize()):(this._renderNode&&this.parent.scene.remove(this._renderNode),this._renderNode&&(this._renderNode.parent=this.parent.scene)),this._visible=e,this._visible=e},get:function(){return this._visible}},{key:"renderNode",get:function(){return this._renderNode},set:function(e){this._renderNode=e}},{key:"size",get:function(){return this._size},set:function(e){this._size=(0,o.default)(e)}},{key:"mapCoord",get:function(){var e=(0,l.default)(this.parent.parent.parent.parent).dataManager.file_ver,t=this;if(t){if(t.renderNodeInited)return{x:t.x,y:t.y,z:this.height};var n=null,n=1===e?_.default.convertGeo2Points(t.gdata.geo):_.default.convertArrayPoints(t.gdata.idxs,t.gdata.pts);return{x:n.vertices[0].x,y:n.vertices[0].y,z:this.height}}return{x:null,y:null,z:null}}}]),i}(m.default),M=b,T=M;t.default=T},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(20)),u=r(n(14)),h=r(n(21)),c=r(n(22)),a=r(n(18)),o=r(n(13)),s=r(n(4)),d=r(n(33)),f=r(n(15)),p=r(n(9)),m=r(n(2)),v=r(n(3)),g=r(n(5)),y=r(n(6)),_=r(n(7)),x=r(n(222));function w(e,t){var n;if(void 0===c.default||null==(0,h.default)(e)){if((0,u.default)(e)||(n=b(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=(0,l.default)(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function b(e,t){var n;if(e){if("string"==typeof e)return M(e,t);var r=(0,o.default)(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?(0,a.default)(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?M(e,t):void 0}}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function T(r){var i=S();return function(){var e,t=(0,_.default)(r),n=i?(e=(0,_.default)(this).constructor,(0,s.default)(t,arguments,e)):t.apply(this,arguments);return(0,y.default)(this,n)}}function S(){if("undefined"==typeof Reflect||!s.default)return!1;if(s.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,s.default)(Date,[],function(){})),!0}catch(e){return!1}}var E=function(e){(0,g.default)(n,e);var t=T(n);function n(){var e;return(0,m.default)(this,n),e=t.call(this),e._scene.userData.type="imageMarker",e.alias="imageMarker",e}return(0,v.default)(n,[{key:"removeAll",value:function(){var e,t=w(this._markers);try{for(t.s();!(e=t.n()).done;){var n=e.value;this.removeNode(n,!0)}}catch(e){t.e(e)}finally{t.f()}this._markers.length=0}},{key:"untiedMarker",value:function(e){e.parent=void 0,this._scene.remove(e.renderNode)}},{key:"removeNode",value:function(e,t){var n,r,i;e.parent=void 0,this._scene.remove(e.renderNode),e.isAlwaysShow&&(this.parent.removeAlwaysShowMarker(e.renderNode),e.show=!1),e.dispose(),t||(r=(0,p.default)(n=this._markers).call(n,e),-1<r&&(0,f.default)(i=this._markers).call(i,r,1))}},{key:"removeMarker",value:function(e){this.removeNode(e)}},{key:"markers",get:function(){var e=[];return e.push.apply(e,(0,d.default)(this._markers)),e}}]),n}(x.default),A=E;t.default=A},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(20)),u=r(n(14)),h=r(n(21)),c=r(n(22)),a=r(n(18)),o=r(n(13)),s=r(n(4)),d=r(n(15)),f=r(n(9)),p=r(n(2)),m=r(n(3)),v=r(n(5)),g=r(n(6)),y=r(n(7)),_=r(n(490));function x(e,t){var n;if(void 0===c.default||null==(0,h.default)(e)){if((0,u.default)(e)||(n=w(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=(0,l.default)(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function w(e,t){var n;if(e){if("string"==typeof e)return b(e,t);var r=(0,o.default)(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?(0,a.default)(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(e,t):void 0}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function M(r){var i=T();return function(){var e,t=(0,y.default)(r),n=i?(e=(0,y.default)(this).constructor,(0,s.default)(t,arguments,e)):t.apply(this,arguments);return(0,g.default)(this,n)}}function T(){if("undefined"==typeof Reflect||!s.default)return!1;if(s.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,s.default)(Date,[],function(){})),!0}catch(e){return!1}}var S=function(e){(0,v.default)(n,e);var t=M(n);function n(){var e;return(0,p.default)(this,n),e=t.call(this),e._markers=[],e.prepareInitMarkers=[],e}return(0,m.default)(n,[{key:"addMarker",value:function(e){e.parent=this,e.isInit||e.init()?this.pushMarker(e):this.prepareInitMarkers.push(e)}},{key:"traverse",value:function(e){var t,n=x(this._markers);try{for(n.s();!(t=n.n()).done;){var r=t.value;e&&e(r)}}catch(e){n.e(e)}finally{n.f()}}},{key:"initPrepare",value:function(){var e,t=x(this.prepareInitMarkers);try{for(t.s();!(e=t.n()).done;){var n,r,i,a=e.value;a.init()&&(r=(0,f.default)(n=this.prepareInitMarkers).call(n,a),-1<r&&(0,d.default)(i=this.prepareInitMarkers).call(i,r,1),this.pushMarker(a))}}catch(e){t.e(e)}finally{t.f()}}},{key:"pushMarker",value:function(e){this._markers.push(e),e.renderNode&&this._scene.add(e.renderNode)}},{key:"removeAll",value:function(){var e,t=x(this._markers);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.parent=void 0,this._scene.remove(n.renderNode),n.dispose()}}catch(e){t.e(e)}finally{t.f()}this._markers.length=0}},{key:"removeNode",value:function(e){this.removeMarker(e)}},{key:"removeMarker",value:function(e){var t;e.parent=void 0,this._scene.remove(e.renderNode),e.dispose();var n,r=(0,f.default)(t=this._markers).call(t,e);-1<r&&(0,d.default)(n=this._markers).call(n,r,1)}},{key:"checkSceneNode",value:function(){this._scene.children.length=0;var e,t=x(this._markers);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.visible&&n.renderNode&&this._scene.add(n.renderNode)}}catch(e){t.e(e)}finally{t.f()}}},{key:"dispose",value:function(){var e,t=x(this._markers);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.dispose(),this._scene.remove(n.renderNode),n.parent=void 0}}catch(e){t.e(e)}finally{t.f()}this._markers.length=0,this._scene=void 0}},{key:"markers",get:function(){return this._markers}}]),n}(_.default),E=S;t.default=E},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(20)),u=r(n(14)),h=r(n(21)),c=r(n(22)),a=r(n(18)),o=r(n(13)),s=r(n(4)),d=r(n(10)),f=r(n(15)),p=r(n(9)),m=r(n(2)),v=r(n(3)),g=r(n(5)),y=r(n(6)),_=r(n(7)),x=r(n(17));function w(e,t){var n;if(void 0===c.default||null==(0,h.default)(e)){if((0,u.default)(e)||(n=b(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=(0,l.default)(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function b(e,t){var n;if(e){if("string"==typeof e)return M(e,t);var r=(0,o.default)(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?(0,a.default)(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?M(e,t):void 0}}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function T(r){var i=S();return function(){var e,t=(0,_.default)(r),n=i?(e=(0,_.default)(this).constructor,(0,s.default)(t,arguments,e)):t.apply(this,arguments);return(0,y.default)(this,n)}}function S(){if("undefined"==typeof Reflect||!s.default)return!1;if(s.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,s.default)(Date,[],function(){})),!0}catch(e){return!1}}var E=function(e){(0,g.default)(n,e);var t=T(n);function n(){var e;return(0,m.default)(this,n),e=t.call(this),e._scene=new fm.Scene,e._scene.userData.type="polygonMarker",e.alias="polygonMarker",e.polygonMarkers=[],e._visible=!0,e.prepareInitObjects=[],e}return(0,v.default)(n,[{key:"addMarker",value:function(e){e.parent=this,e.isInit||e.init()?this.pushPolygonMarker(e):this.prepareInitObjects.push(e)}},{key:"traverse",value:function(e){var t,n=w(this.polygonMarkers);try{for(n.s();!(t=n.n()).done;){var r=t.value;e&&e(r)}}catch(e){n.e(e)}finally{n.f()}}},{key:"initPrepare",value:function(){var e,t=w(this.prepareInitObjects);try{for(t.s();!(e=t.n()).done;){var n,r,i,a=e.value;a.init()&&(r=(0,p.default)(n=this.prepareInitObjects).call(n,a),-1<r&&(0,f.default)(i=this.prepareInitObjects).call(i,r,1),this.pushPolygonMarker(a))}}catch(e){t.e(e)}finally{t.f()}}},{key:"pushPolygonMarker",value:function(e){this.polygonMarkers.push(e),e.renderNode&&this._scene.add(e.renderNode)}},{key:"removeAll",value:function(){var e,t=w(this.polygonMarkers);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.parent=void 0,this._scene.remove(n.renderNode),n.dispose()}}catch(e){t.e(e)}finally{t.f()}this.polygonMarkers.length=0}},{key:"removeNode",value:function(e){var t;e.parent=void 0,this._scene.remove(e.renderNode),e.dispose();var n,r=(0,p.default)(t=this.polygonMarkers).call(t,e);-1<r&&(0,f.default)(n=this.polygonMarkers).call(n,r,1)}},{key:"removeMarker",value:function(e){this.removeNode(e)}},{key:"checkSceneNode",value:function(){this._scene.children.length=0;var e,t=w(this.polygonMarkers);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.visible&&n.renderNode&&this._scene.add(n.renderNode)}}catch(e){t.e(e)}finally{t.f()}}},{key:"dispose",value:function(){var e,t=w(this.polygonMarkers);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.dispose(),this._scene.remove(n.renderNode),n.parent=void 0}}catch(e){t.e(e)}finally{t.f()}this.polygonMarkers.length=0,this._scene=void 0}},{key:"markers",get:function(){return this.polygonMarkers}},{key:"scene",get:function(){return this._scene}},{key:"visible",get:function(){return this._visible},set:function(e){this._visible=e,this.parent&&this.parent.parent&&this.parent.parent.parent&&(0,d.default)(this.parent.parent.parent).setRenderList()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}}]),n}(x.default),A=E;t.default=A},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(20)),u=r(n(14)),h=r(n(21)),c=r(n(22)),a=r(n(18)),o=r(n(13)),s=r(n(4)),d=r(n(10)),f=r(n(15)),p=r(n(9)),m=r(n(2)),v=r(n(3)),g=r(n(5)),y=r(n(6)),_=r(n(7)),x=r(n(222));function w(e,t){var n;if(void 0===c.default||null==(0,h.default)(e)){if((0,u.default)(e)||(n=b(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=(0,l.default)(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function b(e,t){var n;if(e){if("string"==typeof e)return M(e,t);var r=(0,o.default)(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?(0,a.default)(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?M(e,t):void 0}}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function T(r){var i=S();return function(){var e,t=(0,_.default)(r),n=i?(e=(0,_.default)(this).constructor,(0,s.default)(t,arguments,e)):t.apply(this,arguments);return(0,y.default)(this,n)}}function S(){if("undefined"==typeof Reflect||!s.default)return!1;if(s.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,s.default)(Date,[],function(){})),!0}catch(e){return!1}}var E=function(e){(0,g.default)(n,e);var t=T(n);function n(){var e;return(0,m.default)(this,n),e=t.call(this),e._scene.userData.type="textMarker",e._scene.name="textMarker",e.alias="textMarker",e._visible=!0,e}return(0,v.default)(n,[{key:"removeAll",value:function(){var e,t=w(this._markers);try{for(t.s();!(e=t.n()).done;){var n=e.value;this.removeNode(n,!0)}}catch(e){t.e(e)}finally{t.f()}this._markers.length=0}},{key:"untiedMarker",value:function(e){e.parent=void 0,this._scene.remove(e.renderNode)}},{key:"removeNode",value:function(e,t){var n,r,i;e.parent=void 0,this._scene.remove(e.renderNode),e.isAlwaysShow&&(this.parent.removeAlwaysShowMarker(e.renderNode),e.show=!1),e.dispose(),t||(r=(0,p.default)(n=this._markers).call(n,e),-1<r&&(0,f.default)(i=this._markers).call(i,r,1))}},{key:"removeMarker",value:function(e){this.removeNode(e)}},{key:"visible",get:function(){return this._visible},set:function(e){this._visible=e,this.parent&&this.parent.parent&&this.parent.parent.parent&&(0,d.default)(this.parent.parent.parent).setRenderList()}}]),n}(x.default),A=E;t.default=A},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(20)),u=r(n(14)),h=r(n(21)),c=r(n(22)),a=r(n(18)),o=r(n(13)),s=r(n(4)),d=r(n(10)),f=r(n(2)),p=r(n(3)),m=r(n(5)),v=r(n(6)),g=r(n(7)),y=r(n(17)),_=r(n(46)),x=r(n(492));function w(e,t){var n;if(void 0===c.default||null==(0,h.default)(e)){if((0,u.default)(e)||(n=b(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=(0,l.default)(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function b(e,t){var n;if(e){if("string"==typeof e)return M(e,t);var r=(0,o.default)(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?(0,a.default)(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?M(e,t):void 0}}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function T(r){var i=S();return function(){var e,t=(0,g.default)(r),n=i?(e=(0,g.default)(this).constructor,(0,s.default)(t,arguments,e)):t.apply(this,arguments);return(0,v.default)(this,n)}}function S(){if("undefined"==typeof Reflect||!s.default)return!1;if(s.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,s.default)(Date,[],function(){})),!0}catch(e){return!1}}var E=function(e){(0,m.default)(r,e);var n=T(r);function r(e){var t;return(0,f.default)(this,r),t=n.call(this),t._scene=new fm.Scene,t._scene.userData.type="heatmap",t.alias="heatmap",t._prepareInited=!1,t._randomInited=!0,t._randomNum=0,t._gradient=null==e.gradient?{.45:"rgb(0,0,255)",.55:"rgb(0,255,255)",.65:"rgb(0,255,0)",.95:"yellow",1:"rgb(255,0,0)"}:e.gradient,t._points=null,t._opacity="number"==typeof e.opacity?e.opacity:.5,t._prepareInitObjects=[],t._visible=!0,t}return(0,p.default)(r,[{key:"init",value:function(){var e=this.findParent(_.default);if(e&&this._points){var t=this.parent.parent,n=this.parent.getHeight(),r=t.center,i=e.materialManager,a=i.getHeatMapGradient(this._gradient),o=new x.default({},{},a);o.material.opacity=this._opacity;var s,l=w(this._points);try{for(l.s();!(s=l.n()).done;){var u=s.value,h=o.clone();h.position.set(u.x,r.y+3+n,u.y-r.y),h.mapNode=this,this._scene.add(h)}}catch(e){l.e(e)}finally{l.f()}this._prepareInited=!1}else this._prepareInited=!0}},{key:"initPrepare",value:function(){this._randomInited||(this.randomPoints(this._randomNum,!0),this._randomInited=!0,this._randomNum=0),this._points,this.init()}},{key:"removeAll",value:function(){var e=this._scene;if(e){for(var t=e.children.length-1;-1<t;t--){var n=e.children[t];e.remove(n),n.mapNode=void 0,n.geometry.dispose(),n.material.dispose(),(0,d.default)(n.material).dispose()}e.children.length=0}this._points.length=0}},{key:"clearPoints",value:function(){this.removeAll()}},{key:"addPoints",value:function(e){this._points=e,this.init()}},{key:"randomPoints",value:function(e,t){var n=this.findParent(_.default);if(!n)return this._prepareInited=!0,this._randomInited=!1,void(this._randomNum=e);for(var r=this.parent.parent,i=r.bbox,a=i.max.x-i.min.x,o=i.max.y-i.min.y,s=[],l=0;l<e;l++)s.push({x:Math.random()*a+i.min.x,y:Math.random()*o+i.min.y});this._points=s,t||this.init()}},{key:"dispose",value:function(){this.removeAll(),this._scene=void 0,this._gradient=void 0}},{key:"scene",get:function(){return this._scene}},{key:"prepareInited",get:function(){return this._prepareInited}},{key:"prepareInitObjects",get:function(){return this._prepareInitObjects}},{key:"visible",get:function(){return this._visible}}]),r}(y.default),A=E;t.default=A},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=(r(n(208)),function(){function e(){(0,a.default)(this,e)}return(0,o.default)(e,[{key:"createGeometry",value:function(e,t,n,r){for(var i=new Float32Array((t+1)*n*3),a=new Float32Array((t+1)*n*2),o=new Uint16Array(t*n*2*3),s=0;s<t+1;s++)for(var l=s/t*e,u=4/Math.sqrt(2*Math.PI)*Math.exp(-l*l/2/r)/Math.sqrt(r),h=0;h<n;h++){var c=h/n*Math.PI*2,d=l*Math.sin(c),f=l*Math.cos(c),p=s*n*3+3*h;i[p]=f,i[p+1]=u,i[p+2]=d;var m,v,g,y,_,x=s*n*2+2*h;a[x]=h/n,a[x+1]=s/t,s<t&&(v=void 0,g=void 0,y=void 0,_=void 0,m=s*n*6+6*h,v=s*n+h,g=h+1===n?s*n:v+1,y=v+n,_=g+n,o[m]=v,o[m+1]=g,o[m+2]=y,o[m+3]=g,o[m+4]=_,o[m+5]=y)}return{index:o,uv:a,vertice:i}}},{key:"computerArcLineByPoints",value:function(e,t,n,r,i){var a=(new fm.Vector3).copy(e).distanceTo(t),o=(new fm.Vector3).copy(n).distanceTo(t),s=(new fm.Vector3).copy(e),l=(new fm.Vector3).copy(e),u=[];r<a&&(s=(new fm.Vector3).copy(t).add((new fm.Vector3).copy(e).sub(t).normalize().multiplyScalar(r)),u.push(s)),r<o&&(l=(new fm.Vector3).copy(t).add((new fm.Vector3).copy(n).sub(t).normalize().multiplyScalar(r)));for(var h=new fm.QuadraticBezierCurve3(s,t,l),c=0;c<i-1;c++){var d=(c+1)/i,f=h.getPoint(d);u.push(f)}return r<o&&u.push(l),u}}]),e}()),l=s;t.default=l},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(10)),s=r(n(139)),l=r(n(2)),u=r(n(3)),h=r(n(5)),c=r(n(6)),d=r(n(7)),f=r(n(17));function p(r){var i=m();return function(){var e,t=(0,d.default)(r),n=i?(e=(0,d.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,c.default)(this,n)}}function m(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var v=function(e){(0,h.default)(n,e);var t=p(n);function n(){var e;return(0,l.default)(this,n),e=t.call(this,"dynmodel"),e._scene=new fm.Scene,e._scene.userData.type="dynmodel",e._scene.name="dynmodel",e.alias="dynmodel",e._models={},e.prepareInitObjects=[],e._visible=!0,e.initLight(),e.putLight(),e}return(0,u.default)(n,[{key:"initLight",value:function(){this._ambientLight=new fm.AmbientLight(7631988),this._target=new fm.Object3D,this._mainLight=new fm.DirectionalLight(8947848,1.2),this._mainLight.position.set(-1,1,1).normalize(),this._mainLight.target=this._target,this._secondLight=new fm.DirectionalLight(3355443),this._secondLight.position.set(-.5,1,-1).normalize(),this._secondLight.target=this._target}},{key:"addNodes",value:function(e){e.parent=this,e.renderNode&&this._scene.add(e.renderNode),this._models[""+e.eid]=e}},{key:"removeNode",value:function(n){n.parent=void 0;var r=this;n.renderNode.traverse(function(e){var t;e instanceof fm.Mesh&&(e.material.transparent=!0,n._fadeOut?t=(0,s.default)(function(){.05<e.material.opacity?e.material.opacity-=.05:(clearInterval(t),r._scene.remove(n.renderNode))},200):r._scene.remove(n.renderNode))}),n.dispose()}},{key:"putLight",value:function(){var e=this;this.scene.add(this._mainLight),this.scene.add(this._ambientLight),this.scene.add(this._secondLight),this.scene.add(this._target),this.scene.removeLight=function(){e.removeLight()}}},{key:"removeLight",value:function(){this.scene.remove(this._mainLight),this.scene.remove(this._ambientLight),this.scene.remove(this._secondLight)}},{key:"disposeLight",value:function(){this._mainLight=void 0,this._ambientLight=void 0,this._secondLight=void 0}},{key:"getNodeById",value:function(e){return this._models[""+e]}},{key:"traverse",value:function(e){for(var t in this._models)e&&e(this._models[t])}},{key:"checkSceneNode",value:function(){for(var e in this._scene.children.length=0,this._models)this._models[e].visible&&this._models[e].renderNode&&this._scene.add(this._models[e].renderNode);this.putLight()}},{key:"getAllMesh",value:function(){var e,t=[];for(e in this._models)this._models[e].renderNode&&t.push(this._models[e].renderNode);return t}},{key:"dispose",value:function(){for(var e in this._models)this._models[e].dispose(),this._scene.remove(this._models[e].renderNode),this._models[e].parent=void 0,this._models[e]=void 0;this.removeLight(),this.disposeLight(),this._scene.length=0,this._scene=void 0}},{key:"models",get:function(){return this._models},set:function(e){this._models=e}},{key:"scene",get:function(){return this._scene}},{key:"visible",get:function(){return this._visible},set:function(e){this._visible=e,this.parent&&this.parent.parent&&this.parent.parent.parent&&(0,o.default)(this.parent.parent.parent).setRenderList()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}}]),n}(f.default),g=v;t.default=g},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=function(){function e(){(0,a.default)(this,e)}return(0,o.default)(e,null,[{key:"createImage",value:function(e,t,n){var r=e.createImage();return r.crossOrigin="Anonymous",r.onload=function(){n&&n(r)},r.src=t,r}}]),e}(),l=s;t.default=l},function(e,t,n){e.exports=n(506)},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.FMMathUtils=void 0;var a=r(n(2)),o=r(n(3)),s=function(){function e(){(0,a.default)(this,e)}return(0,o.default)(e,null,[{key:"findNearNthPowerOfTwo",value:function(e){var t=e-1;return t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t<0?1:t+1}},{key:"generateUUID",value:function(){for(var e=[],t=0;t<256;t++)e[t]=(t<16?"0":"")+t.toString(16);var n=4294967295*Math.random()|0,r=4294967295*Math.random()|0,i=4294967295*Math.random()|0,a=4294967295*Math.random()|0,o=e[255&n]+e[n>>8&255]+e[n>>16&255]+e[n>>24&255]+"-"+e[255&r]+e[r>>8&255]+"-"+e[r>>16&15|64]+e[r>>24&255]+"-"+e[63&i|128]+e[i>>8&255]+"-"+e[i>>16&255]+e[i>>24&255]+e[255&a]+e[a>>8&255]+e[a>>16&255]+e[a>>24&255];return o.toUpperCase()}}]),e}();t.FMMathUtils=s},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(2)),s=r(n(5)),l=r(n(6)),u=r(n(7));function h(r){var i=c();return function(){var e,t=(0,u.default)(r),n=i?(e=(0,u.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,l.default)(this,n)}}function c(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var d=function(e){(0,s.default)(i,e);var r=h(i);function i(){var e;(0,o.default)(this,i),e=r.call(this);var t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new fm.InterleavedBuffer(t,5);return e.setIndex([0,1,2,0,2,3]),e.setAttribute("position",new fm.InterleavedBufferAttribute(n,3,0,!1)),e.setAttribute("uv",new fm.InterleavedBufferAttribute(n,2,3,!1)),e}return i}(fm.BufferGeometry),f=d;t.default=f},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var y=r(n(75)),a=r(n(12)),_=r(n(140)),x={};function o(e){this.manager=void 0!==e?e:fm.DefaultLoadingManager}(0,a.default)(o.prototype,{load:function(o,e,t,n){void 0===o&&(o=""),void 0!==this.path&&(o=this.path+o),o=this.manager.resolveURL(o);var s=this,r=fm.Cache.get(o);if(void 0!==r)return s.manager.itemStart(o),(0,y.default)(function(){e&&e(r),s.manager.itemEnd(o)},0),r;if(void 0===x[o]){var i=/^data:(.*?)(;base64)?,(.*)$/,a=o.match(i);if(a){var l=a[1],u=!!a[2],h=a[3],h=decodeURIComponent(h);u&&(h=atob(h));try{var c=(this.responseType||"").toLowerCase();switch(c){case"arraybuffer":case"blob":for(var d=new Uint8Array(h.length),f=0;f<h.length;f++)d[f]=h.charCodeAt(f);m="blob"===c?new Blob([d.buffer],{type:l}):d.buffer;break;case"document":var p=new DOMParser,m=p.parseFromString(h,l);break;case"json":m=JSON.parse(h);break;default:m=h}(0,y.default)(function(){e&&e(m),s.manager.itemEnd(o)},0)}catch(e){(0,y.default)(function(){n&&n(e),s.manager.itemError(o),s.manager.itemEnd(o)},0)}}else{x[o]=[],x[o].push({onLoad:e,onProgress:t,onError:n});var v,g=new _.default;for(v in g.open("GET",o,!0),g.addEventListener("load",function(e){var t=this.response;fm.Cache.add(o,t);var n=x[o];if(delete x[o],200===this.status||0===this.status){0===this.status&&console.warn("fm.FileLoader: HTTP Status 0 received.");for(var r=0,i=n.length;r<i;r++){var a=n[r];a.onLoad&&a.onLoad(t)}s.manager.itemEnd(o)}else{for(r=0,i=n.length;r<i;r++)a=n[r],a.onError&&a.onError(e);s.manager.itemError(o),s.manager.itemEnd(o)}},!1),g.addEventListener("progress",function(e){for(var t=x[o],n=0,r=t.length;n<r;n++){var i=t[n];i.onProgress&&i.onProgress(e)}},!1),g.addEventListener("error",function(e){var t=x[o];delete x[o];for(var n=0,r=t.length;n<r;n++){var i=t[n];i.onError&&i.onError(e)}s.manager.itemError(o),s.manager.itemEnd(o)},!1),g.addEventListener("abort",function(e){var t=x[o];delete x[o];for(var n=0,r=t.length;n<r;n++){var i=t[n];i.onError&&i.onError(e)}s.manager.itemError(o),s.manager.itemEnd(o)},!1),void 0!==this.responseType&&(g.responseType=this.responseType),void 0!==this.withCredentials&&(g.withCredentials=this.withCredentials),g.overrideMimeType&&g.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)g.setRequestHeader(v,this.requestHeader[v]);g.send(null)}return s.manager.itemStart(o),g}x[o].push({onLoad:e,onProgress:t,onError:n})},setPath:function(e){return this.path=e,this},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}});var s=o;t.default=s},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.TextureLoader=l;var a=r(n(64)),o=r(n(12)),s=n(516);function l(e,t){fm.Loader.call(this,t),this._map=e}l.prototype=(0,o.default)((0,a.default)(fm.Loader.prototype),{constructor:l,load:function(n,r,e,t){var i=new fm.Texture,a=new s.ImageLoader(this._map,this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(n,function(e){i.image=e;var t=0<n.search(/\.jpe?g($|\?)/i)||0===n.search(/^data\:image\/jpeg/);i.format=t?fm.RGBFormat:fm.RGBAFormat,i.needsUpdate=!0,void 0!==r&&r(i)},e,t),i}})},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var c=r(n(49)),A=r(n(127)),p=r(n(55)),o=r(n(32)),a=r(n(12)),s=r(n(62)),l=r(n(64)),m=r(n(10)),u=r(n(110)),I=r(n(13)),v=r(n(14)),g=r(n(517)),d=r(n(9)),h=r(n(232)),f=n(233);function y(e,t){this._map=e,this.manager=void 0!==t?t:fm.DefaultLoadingManager,this.dracoLoader=null,this.ddsLoader=null}function _(){var n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}y.prototype={constructor:y,crossOrigin:"anonymous",load:function(n,r,e,t){var i=this,a=void 0!==this.resourcePath?this.resourcePath:void 0!==this.path?this.path:fm.LoaderUtils.extractUrlBase(n);i.manager.itemStart(n);var o=function(e){t?t(e):console.error(e),i.manager.itemError(n),i.manager.itemEnd(n)},s=new h.default(i.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),"use-credentials"===i.crossOrigin&&s.setWithCredentials(!0),s.load(n,function(t){try{i.parse(t,a,function(e){r(e,t),i.manager.itemEnd(n)},o)}catch(e){console.warn("数据解析失败!"),o(e)}},e,o)},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this},setResourcePath:function(e){return this.resourcePath=e,this},setDRACOLoader:function(e){return this.dracoLoader=e,this},setDDSLoader:function(e){return this.ddsLoader=e,this},parse:function(e,t,n,r){var i,a={};if("string"==typeof e)i=e;else{var o=fm.LoaderUtils.decodeText(new Uint8Array(e,0,4));if(o===T){try{a[x.KHR_BINARY_GLTF]=new L(e)}catch(e){return void(r&&r(e))}i=a[x.KHR_BINARY_GLTF].content}else i=fm.LoaderUtils.decodeText(new Uint8Array(e))}var s=JSON.parse(i);if(void 0===s.asset||s.asset.version[0]<2)r&&r(new Error("fm.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported. Use LegacyGLTFLoader instead."));else{if(s.extensionsUsed)for(var l=0;l<s.extensionsUsed.length;++l){var u=s.extensionsUsed[l],h=s.extensionsRequired||[];switch(u){case x.KHR_LIGHTS_PUNCTUAL:a[u]=new b(s);break;case x.KHR_MATERIALS_UNLIT:a[u]=new M;break;case x.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:a[u]=new k;break;case x.KHR_DRACO_MESH_COMPRESSION:a[u]=new R(s,this.dracoLoader);break;case x.MSFT_TEXTURE_DDS:a[x.MSFT_TEXTURE_DDS]=new w(this.ddsLoader);break;case x.KHR_TEXTURE_TRANSFORM:a[x.KHR_TEXTURE_TRANSFORM]=new N;break;default:0<=(0,d.default)(h).call(h,u)&&console.warn('fm.GLTFLoader: Unknown extension "'+u+'".')}}var c=new ee(s,a,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager,map:this._map});c.parse(n,r)}}};var x={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function w(e){if(!e)throw new Error("fm.GLTFLoader: Attempting to load .dds texture without importing fm.DDSLoader");this.name=x.MSFT_TEXTURE_DDS,this.ddsLoader=e}function b(e){this.name=x.KHR_LIGHTS_PUNCTUAL;var t=e.extensions&&e.extensions[x.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function M(){this.name=x.KHR_MATERIALS_UNLIT}b.prototype.loadLight=function(e){var t,n=this.lightDefs[e],r=new fm.Color(16777215);void 0!==n.color&&r.fromArray(n.color);var i=void 0!==n.range?n.range:0;switch(n.type){case"directional":t=new fm.DirectionalLight(r),t.target.position.set(0,0,-1),t.add(t.target);break;case"point":t=new fm.PointLight(r),t.distance=i;break;case"spot":t=new fm.SpotLight(r),t.distance=i,n.spot=n.spot||{},n.spot.innerConeAngle=void 0!==n.spot.innerConeAngle?n.spot.innerConeAngle:0,n.spot.outerConeAngle=void 0!==n.spot.outerConeAngle?n.spot.outerConeAngle:Math.PI/4,t.angle=n.spot.outerConeAngle,t.penumbra=1-n.spot.innerConeAngle/n.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw new Error('fm.GLTFLoader: Unexpected light type, "'+n.type+'".')}return t.position.set(0,0,0),t.decay=2,void 0!==n.intensity&&(t.intensity=n.intensity),t.name=n.name||"light_"+e,g.default.resolve(t)},M.prototype.getMaterialType=function(){return fm.MeshBasicMaterial},M.prototype.extendParams=function(e,t,n){var r=[];e.color=new fm.Color(1,1,1),e.opacity=1;var i,a=t.pbrMetallicRoughness;return a&&((0,v.default)(a.baseColorFactor)&&(i=a.baseColorFactor,e.color.fromArray(i),e.opacity=i[3]),void 0!==a.baseColorTexture&&r.push(n.assignTexture(e,"map",a.baseColorTexture))),g.default.all(r)};var T="glTF",S=12,E={JSON:1313821514,BIN:5130562};function L(e){this.name=x.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,S);if(this.header={magic:fm.LoaderUtils.decodeText(new Uint8Array((0,I.default)(e).call(e,0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==T)throw new Error("fm.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("fm.GLTFLoader: Legacy binary file detected. Use LegacyGLTFLoader instead.");for(var n=new DataView(e,S),r=0;r<n.byteLength;){var i=n.getUint32(r,!0);r+=4;var a,o,s=n.getUint32(r,!0);r+=4,s===E.JSON?(a=new Uint8Array(e,S+r,i),this.content=fm.LoaderUtils.decodeText(a)):s===E.BIN&&(o=S+r,this.body=(0,I.default)(e).call(e,o,o+i)),r+=i}if(null===this.content)throw new Error("fm.GLTFLoader: JSON content not found.")}function R(e,t){if(!t)throw new Error("fm.GLTFLoader: No DRACOLoader instance provided.");this.name=x.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t}function N(){this.name=x.KHR_TEXTURE_TRANSFORM}function k(){return{name:x.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return fm.ShaderMaterial},extendParams:function(e,t,n){var r=t.extensions[this.name],i=fm.ShaderLib.standard,a=fm.UniformsUtils.clone(i.uniforms),o=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),s=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),l=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),u=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),h=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","material.specularRoughness = clamp( 1.0 - glossinessFactor, 0.04, 1.0 );","material.specularColor = specularFactor.rgb;"].join("\n"),c=i.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",o).replace("#include <metalnessmap_pars_fragment>",s).replace("#include <roughnessmap_fragment>",l).replace("#include <metalnessmap_fragment>",u).replace("#include <lights_physical_fragment>",h);delete a.roughness,delete a.metalness,delete a.roughnessMap,delete a.metalnessMap,a.specular={value:(new fm.Color).setHex(1118481)},a.glossiness={value:.5},a.specularMap={value:null},a.glossinessMap={value:null},e.vertexShader=i.vertexShader,e.fragmentShader=c,e.uniforms=a,e.defines={STANDARD:""},e.color=new fm.Color(1,1,1),e.opacity=1;var d,f,p=[];return(0,v.default)(r.diffuseFactor)&&(d=r.diffuseFactor,e.color.fromArray(d),e.opacity=d[3]),void 0!==r.diffuseTexture&&p.push(n.assignTexture(e,"map",r.diffuseTexture)),e.emissive=new fm.Color(0,0,0),e.glossiness=void 0!==r.glossinessFactor?r.glossinessFactor:1,e.specular=new fm.Color(1,1,1),(0,v.default)(r.specularFactor)&&e.specular.fromArray(r.specularFactor),void 0!==r.specularGlossinessTexture&&(f=r.specularGlossinessTexture,p.push(n.assignTexture(e,"glossinessMap",f)),p.push(n.assignTexture(e,"specularMap",f))),g.default.all(p)},createMaterial:function(e){var t=new fm.ShaderMaterial({defines:e.defines,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms,fog:!0,lights:!0,opacity:e.opacity,transparent:e.transparent});return t.isGLTFSpecularGlossinessMaterial=!0,t.color=e.color,t.map=void 0===(0,m.default)(e)?null:(0,m.default)(e),t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t.extensions.derivatives=!0,t},cloneMaterial:function(e){var t=e.clone();t.isGLTFSpecularGlossinessMaterial=!0;for(var n=this.specularGlossinessParams,r=0,i=n.length;r<i;r++){var a=e[n[r]];t[n[r]]=a&&a.isColor?a.clone():a}return t},refreshUniforms:function(e,t,n,r,i){var a,o,s;!0===i.isGLTFSpecularGlossinessMaterial&&(a=i.uniforms,o=i.defines,a.opacity.value=i.opacity,a.diffuse.value.copy(i.color),a.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),(0,m.default)(a).value=(0,m.default)(i),a.specularMap.value=i.specularMap,a.alphaMap.value=i.alphaMap,a.lightMap.value=i.lightMap,a.lightMapIntensity.value=i.lightMapIntensity,a.aoMap.value=i.aoMap,a.aoMapIntensity.value=i.aoMapIntensity,(0,m.default)(i)?s=(0,m.default)(i):i.specularMap?s=i.specularMap:i.displacementMap?s=i.displacementMap:i.normalMap?s=i.normalMap:i.bumpMap?s=i.bumpMap:i.glossinessMap?s=i.glossinessMap:i.alphaMap?s=i.alphaMap:i.emissiveMap&&(s=i.emissiveMap),void 0!==s&&(s.isWebGLRenderTarget&&(s=s.texture),!0===s.matrixAutoUpdate&&s.updateMatrix(),a.uvTransform.value.copy(s.matrix)),i.envMap&&(a.envMap.value=i.envMap,a.envMapIntensity.value=i.envMapIntensity,a.flipEnvMap.value=i.envMap.isCubeTexture?-1:1,a.reflectivity.value=i.reflectivity,a.refractionRatio.value=i.refractionRatio,a.maxMipLevel.value=e.properties.get(i.envMap).__maxMipLevel),a.specular.value.copy(i.specular),a.glossiness.value=i.glossiness,a.glossinessMap.value=i.glossinessMap,a.emissiveMap.value=i.emissiveMap,a.bumpMap.value=i.bumpMap,a.normalMap.value=i.normalMap,a.displacementMap.value=i.displacementMap,a.displacementScale.value=i.displacementScale,a.displacementBias.value=i.displacementBias,null!==a.glossinessMap.value&&void 0===o.USE_GLOSSINESSMAP&&(o.USE_GLOSSINESSMAP="",o.USE_ROUGHNESSMAP=""),null===a.glossinessMap.value&&void 0!==o.USE_GLOSSINESSMAP&&(delete o.USE_GLOSSINESSMAP,delete o.USE_ROUGHNESSMAP))}}}function P(e,t,n,r){fm.Interpolant.call(this,e,t,n,r)}R.prototype.decodePrimitive=function(e,t){var n,r=this.json,a=this.dracoLoader,i=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,s={},l={},u={};for(n in o){var h=z[n]||n.toLowerCase();s[h]=o[n]}for(n in e.attributes){var c,d,h=z[n]||n.toLowerCase();void 0!==o[n]&&(c=r.accessors[e.attributes[n]],d=O[c.componentType],u[h]=d,l[h]=!0===c.normalized)}return t.getDependency("bufferView",i).then(function(e){return new g.default(function(i){a.decodeDracoFile(e,function(e){for(var t in e.attributes){var n=e.attributes[t],r=l[t];void 0!==r&&(n.normalized=r)}i(e)},s,u)})})},N.prototype.extendTexture=function(e,t){return e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&(0,u.default)(e).fromArray(t.scale),void 0!==t.texCoord&&console.warn('fm.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},P.prototype=(0,l.default)(fm.Interpolant.prototype),P.prototype.constructor=P,P.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r,a=0;a!==r;a++)t[a]=n[i+a];return t},P.prototype.beforeStart_=P.prototype.copySampleValue_,P.prototype.afterEnd_=P.prototype.copySampleValue_,P.prototype.interpolate_=function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=2*o,l=3*o,u=r-t,h=(n-t)/u,c=h*h,d=c*h,f=e*l,p=f-l,m=-2*d+3*c,v=d-c,g=1-m,y=v-c+h,_=0;_!==o;_++){var x=a[p+_+o],w=a[p+_+s]*u,b=a[f+_+o],M=a[f+_]*u;i[_]=g*x+y*w+m*b+v*M}return i};var C,D={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},O={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},F={9728:fm.NearestFilter,9729:fm.LinearFilter,9984:fm.NearestMipmapNearestFilter,9985:fm.LinearMipmapNearestFilter,9986:fm.NearestMipmapLinearFilter,9987:fm.LinearMipmapLinearFilter},B={33071:fm.ClampToEdgeWrapping,33648:fm.MirroredRepeatWrapping,10497:fm.RepeatWrapping},U={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},z={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},G={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},V={CUBICSPLINE:void 0,LINEAR:fm.InterpolateLinear,STEP:fm.InterpolateDiscrete},H={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},j={"image/png":fm.RGBAFormat,"image/jpeg":fm.RGBFormat};function W(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^(wxfile:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}function Y(){return C=C||new fm.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:fm.FrontSide}),C}function q(e,t,n){for(var r in n.extensions)void 0===e[r]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function X(e,t){void 0!==t.extras&&("object"===(0,s.default)(t.extras)?(0,a.default)(e.userData,t.extras):console.warn("fm.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function Z(f,p,e){for(var m=!1,v=!1,t=0,n=p.length;t<n;t++){var r=p[t];if(void 0!==r.POSITION&&(m=!0),void 0!==r.NORMAL&&(v=!0),m&&v)break}if(!m&&!v)return g.default.resolve(f);for(var i=[],a=[],t=0,n=p.length;t<n;t++){var o,r=p[t];m&&(o=void 0!==r.POSITION?e.getDependency("accessor",r.POSITION):f.attributes.position,i.push(o)),v&&(o=void 0!==r.NORMAL?e.getDependency("accessor",r.NORMAL):f.attributes.normal,a.push(o))}return g.default.all([g.default.all(i),g.default.all(a)]).then(function(e){for(var t=e[0],n=e[1],r=0,i=t.length;r<i;r++)f.attributes.position!==t[r]&&(t[r]=$(t[r]));for(r=0,i=n.length;r<i;r++)f.attributes.normal!==n[r]&&(n[r]=$(n[r]));for(r=0,i=p.length;r<i;r++){var a=p[r],o="morphTarget"+r;if(m&&void 0!==a.POSITION){var s=t[r];s.name=o;for(var l=f.attributes.position,u=0,h=s.count;u<h;u++)s.setXYZ(u,s.getX(u)+l.getX(u),s.getY(u)+l.getY(u),s.getZ(u)+l.getZ(u))}if(v&&void 0!==a.NORMAL){var c=n[r];c.name=o;for(var d=f.attributes.normal,u=0,h=c.count;u<h;u++)c.setXYZ(u,c.getX(u)+d.getX(u),c.getY(u)+d.getY(u),c.getZ(u)+d.getZ(u))}}return m&&(f.morphAttributes.position=t),v&&(f.morphAttributes.normal=n),f})}function J(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var n=0,r=t.weights.length;n<r;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&(0,v.default)(t.extras.targetNames)){var i=t.extras.targetNames;if(e.morphTargetInfluences.length===i.length)for(e.morphTargetDictionary={},n=0,r=i.length;n<r;n++)e.morphTargetDictionary[i[n]]=n;else console.warn("fm.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function K(e){var t=e.extensions&&e.extensions[x.KHR_DRACO_MESH_COMPRESSION],n=t?"draco:"+t.bufferView+":"+t.indices+":"+Q(t.attributes):e.indices+":"+Q(e.attributes)+":"+e.mode;return n}function Q(e){for(var t,n="",r=(0,o.default)(t=(0,p.default)(e)).call(t),i=0,a=r.length;i<a;i++)n+=r[i]+":"+e[r[i]]+";";return n}function $(e){if(e.isInterleavedBufferAttribute){for(var t,n=e.count,r=e.itemSize,i=(0,I.default)(t=e.array).call(t,0,n*r),a=0,o=0;a<n;++a)i[o++]=e.getX(a),2<=r&&(i[o++]=e.getY(a)),3<=r&&(i[o++]=e.getZ(a)),4<=r&&(i[o++]=e.getW(a));return new fm.BufferAttribute(i,r,e.normalized)}return e.clone()}function ee(e,t,n){this.json=e||{},this.extensions=t||{},this.options=n||{},this.cache=new _,this.primitiveCache={},this.textureLoader=new f.TextureLoader((0,m.default)(this.options),this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new h.default(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}ee.prototype.parse=function(n,e){var r=this,i=this.json,a=this.extensions;this.cache.removeAll(),this.markDefs(),g.default.all([this.getDependencies("scene"),this.getDependencies("animation"),this.getDependencies("camera")]).then(function(e){var t={scene:e[0][i.scene||0],scenes:e[0],animations:e[1],cameras:e[2],asset:i.asset,parser:r,userData:{}};q(a,t,i),X(t,i),n(t)}).catch(e)},ee.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[],r={},i={},a=0,o=t.length;a<o;a++)for(var s=t[a].joints,l=0,u=s.length;l<u;l++)e[s[l]].isBone=!0;for(var h=0,c=e.length;h<c;h++){var d=e[h];void 0!==d.mesh&&(void 0===r[d.mesh]&&(r[d.mesh]=i[d.mesh]=0),r[d.mesh]++,void 0!==d.skin&&(n[d.mesh].isSkinnedMesh=!0))}this.json.meshReferences=r,this.json.meshUses=i},ee.prototype.getDependency=function(e,t){var n=e+":"+t,r=this.cache.get(n);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this.loadNode(t);break;case"mesh":r=this.loadMesh(t);break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this.loadBufferView(t);break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this.loadMaterial(t);break;case"texture":r=this.loadTexture(t);break;case"skin":r=this.loadSkin(t);break;case"animation":r=this.loadAnimation(t);break;case"camera":r=this.loadCamera(t);break;case"light":r=this.extensions[x.KHR_LIGHTS_PUNCTUAL].loadLight(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(n,r)}return r},ee.prototype.getDependencies=function(n){var r,e,t=this.cache.get(n);return t||(r=this,e=this.json[n+("mesh"===n?"es":"s")]||[],t=g.default.all((0,m.default)(e).call(e,function(e,t){return r.getDependency(n,t)})),this.cache.add(n,t)),t},ee.prototype.loadBuffer=function(e){var n=this.json.buffers[e],r=this.fileLoader;if(n.type&&"arraybuffer"!==n.type)throw new Error("fm.GLTFLoader: "+n.type+" buffer type is not supported.");if(void 0===n.uri&&0===e)return g.default.resolve(this.extensions[x.KHR_BINARY_GLTF].body);var i=this.options;return new g.default(function(e,t){r.load(W(n.uri,i.path),e,void 0,function(){t(new Error('fm.GLTFLoader: Failed to load buffer "'+n.uri+'".'))})})},ee.prototype.loadBufferView=function(e){var r=this.json.bufferViews[e];return this.getDependency("buffer",r.buffer).then(function(e){var t=r.byteLength||0,n=r.byteOffset||0;return(0,I.default)(e).call(e,n,n+t)})},ee.prototype.loadAccessor=function(e){var T=this,S=this.json,E=this.json.accessors[e];if(void 0===E.bufferView&&void 0===E.sparse)return g.default.resolve(null);var t=[];return void 0!==E.bufferView?t.push(this.getDependency("bufferView",E.bufferView)):t.push(null),void 0!==E.sparse&&(t.push(this.getDependency("bufferView",E.sparse.indices.bufferView)),t.push(this.getDependency("bufferView",(0,A.default)(E.sparse).bufferView))),g.default.all(t).then(function(e){var t,n,r,i,a=e[0],o=U[E.type],s=O[E.componentType],l=s.BYTES_PER_ELEMENT,u=l*o,h=E.byteOffset||0,c=void 0!==E.bufferView?S.bufferViews[E.bufferView].byteStride:void 0,d=!0===E.normalized,f=c&&c!==u?(n=Math.floor(h/c),r="InterleavedBuffer:"+E.bufferView+":"+E.componentType+":"+n+":"+E.count,i=T.cache.get(r),i||(t=new s(a,n*c,E.count*c/l),i=new fm.InterleavedBuffer(t,c/l),T.cache.add(r,i)),new fm.InterleavedBufferAttribute(i,o,h%c/l,d)):(t=null===a?new s(E.count*o):new s(a,h,E.count*o),new fm.BufferAttribute(t,o,d));if(void 0!==E.sparse){var p,m=U.SCALAR,v=O[E.sparse.indices.componentType],g=E.sparse.indices.byteOffset||0,y=(0,A.default)(E.sparse).byteOffset||0,_=new v(e[1],g,E.sparse.count*m),x=new s(e[2],y,E.sparse.count*o);null!==a&&f.setArray((0,I.default)(p=f.array).call(p));for(var w=0,b=_.length;w<b;w++){var M=_[w];if(f.setX(M,x[w*o]),2<=o&&f.setY(M,x[w*o+1]),3<=o&&f.setZ(M,x[w*o+2]),4<=o&&f.setW(M,x[w*o+3]),5<=o)throw new Error("fm.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return f})};var te=0;function ne(n,e,r){var t,i,a=e.attributes,o=[];function s(e,t){return r.getDependency("accessor",e).then(function(e){n.setAttribute(t,e)})}for(t in a){var l=z[t]||t.toLowerCase();l in n.attributes||o.push(s(a[t],l))}return void 0===e.indices||n.index||(i=r.getDependency("accessor",e.indices).then(function(e){n.setIndex(e)}),o.push(i)),X(n,e),g.default.all(o).then(function(){return void 0!==e.targets?Z(n,e.targets,r):n})}function re(e,o,s,u){var h=s.nodes[e];return u.getDependency("node",e).then(function(e){return void 0===h.skin?e:u.getDependency("skin",h.skin).then(function(e){l=e;for(var t=[],n=0,r=l.joints.length;n<r;n++)t.push(u.getDependency("node",l.joints[n]));return g.default.all(t)}).then(function(s){return e.traverse(function(e){if(e.isMesh){for(var t=[],n=[],r=0,i=s.length;r<i;r++){var a,o=s[r];o?(t.push(o),a=new fm.Matrix4,void 0!==l.inverseBindMatrices&&a.fromArray(l.inverseBindMatrices.array,16*r),n.push(a)):console.warn('fm.GLTFLoader: Joint "%s" could not be found.',l.joints[r])}(0,c.default)(e).call(e,new fm.Skeleton(t,n),e.matrixWorld)}}),e});var l}).then(function(e){o.add(e);var t=[];if(h.children)for(var n=h.children,r=0,i=n.length;r<i;r++){var a=n[r];t.push(re(a,e,s,u))}return g.default.all(t)})}ee.prototype.loadTexture=function(e){var t=this,r=this.json,i=this.options,a=this.textureLoader,o=r.textures[e],s=o.extensions||{},l=s[x.MSFT_TEXTURE_DDS]?r.images[s[x.MSFT_TEXTURE_DDS].source]:r.images[o.source],n=l.uri;return void 0!==l.bufferView&&(n=t.getDependency("bufferView",l.bufferView).then(function(r){var i=wx.getFileSystemManager();return new g.default(function(e,t){var n=wx.env.USER_DATA_PATH+"/"+te+".png";te++,i.writeFile({filePath:n,data:r,encoding:"binary",success:function(){e(n)},fail:function(){t(n)}})})})),g.default.resolve(n).then(function(n){var e=new fm.LoadingManager,r=e.getHandler(n),r=r||(s[x.MSFT_TEXTURE_DDS]?t.extensions[x.MSFT_TEXTURE_DDS].ddsLoader:a);return new g.default(function(e,t){r.load(W(n,i.path),e,void 0,t)})}).then(function(e){e.flipY=!1,void 0!==o.name&&(e.name=o.name),l.mimeType in j&&(e.format=j[l.mimeType]);var t=r.samplers||{},n=t[o.sampler]||{};return e.magFilter=F[n.magFilter]||fm.LinearFilter,e.minFilter=F[n.minFilter]||fm.LinearMipmapLinearFilter,e.wrapS=B[n.wrapS]||fm.RepeatWrapping,e.wrapT=B[n.wrapT]||fm.RepeatWrapping,e})},ee.prototype.assignTexture=function(n,r,i){var a=this;return this.getDependency("texture",i.index).then(function(e){if(!e.isCompressedTexture)switch(r){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":e.format=fm.RGBFormat}var t;a.extensions[x.KHR_TEXTURE_TRANSFORM]&&(t=void 0!==i.extensions?i.extensions[x.KHR_TEXTURE_TRANSFORM]:void 0,t&&(e=a.extensions[x.KHR_TEXTURE_TRANSFORM].extendTexture(e,t))),n[r]=e}).catch(function(e){console.warn("图片超过最大限制,贴图未能正常初始化:",e)})},ee.prototype.assignFinalMaterial=function(e){var t,n,r,i,a=e.geometry,o=e.material,s=this.extensions,l=void 0!==a.attributes.tangent,u=void 0!==a.attributes.color,h=void 0===a.attributes.normal,c=!0===e.isSkinnedMesh,d=0<(0,p.default)(a.morphAttributes).length,f=d&&void 0!==a.morphAttributes.normal;e.isPoints?(r="PointsMaterial:"+o.uuid,t=this.cache.get(r),t||(t=new fm.PointsMaterial,fm.Material.prototype.copy.call(t,o),t.color.copy(o.color),t.map=(0,m.default)(o),t.lights=!1,this.cache.add(r,t)),o=t):e.isLine&&(r="LineBasicMaterial:"+o.uuid,n=this.cache.get(r),n||(n=new fm.LineBasicMaterial,fm.Material.prototype.copy.call(n,o),n.color.copy(o.color),n.lights=!1,this.cache.add(r,n)),o=n),(l||u||h||c||d)&&(r="ClonedMaterial:"+o.uuid+":",o.isGLTFSpecularGlossinessMaterial&&(r+="specular-glossiness:"),c&&(r+="skinning:"),l&&(r+="vertex-tangents:"),u&&(r+="vertex-colors:"),h&&(r+="flat-shading:"),d&&(r+="morph-targets:"),f&&(r+="morph-normals:"),i=this.cache.get(r),i||(i=o.isGLTFSpecularGlossinessMaterial?s[x.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].cloneMaterial(o):o.clone(),c&&(i.skinning=!0),l&&(i.vertexTangents=!0),u&&(i.vertexColors=fm.VertexColors),h&&(i.flatShading=!0),d&&(i.morphTargets=!0),f&&(i.morphNormals=!0),this.cache.add(r,i)),o=i),o.aoMap&&void 0===a.attributes.uv2&&void 0!==a.attributes.uv&&a.setAttribute("uv2",new fm.BufferAttribute(a.attributes.uv.array,2)),o.isGLTFSpecularGlossinessMaterial&&(e.onBeforeRender=s[x.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].refreshUniforms),e.material=o},ee.prototype.loadMaterial=function(e){var t,n,r,i,a,o=this,s=this.json,l=this.extensions,u=s.materials[e],h={},c=u.extensions||{},d=[];c[x.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]?(t=l[x.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS],n=t.getMaterialType(),d.push(t.extendParams(h,u,o))):c[x.KHR_MATERIALS_UNLIT]?(r=l[x.KHR_MATERIALS_UNLIT],n=r.getMaterialType(),d.push(r.extendParams(h,u,o))):(n=fm.MeshStandardMaterial,i=u.pbrMetallicRoughness||{},h.color=new fm.Color(1,1,1),h.opacity=1,(0,v.default)(i.baseColorFactor)&&(a=i.baseColorFactor,h.color.fromArray(a),h.opacity=a[3]),void 0!==i.baseColorTexture&&d.push(o.assignTexture(h,"map",i.baseColorTexture)),h.metalness=void 0!==i.metallicFactor?i.metallicFactor:1,h.roughness=void 0!==i.roughnessFactor?i.roughnessFactor:1,void 0!==i.metallicRoughnessTexture&&(d.push(o.assignTexture(h,"metalnessMap",i.metallicRoughnessTexture)),d.push(o.assignTexture(h,"roughnessMap",i.metallicRoughnessTexture)))),!0===u.doubleSided&&(h.side=fm.DoubleSide);var f=u.alphaMode||H.OPAQUE;return f===H.BLEND?h.transparent=!0:(h.transparent=!1,f===H.MASK&&(h.alphaTest=void 0!==u.alphaCutoff?u.alphaCutoff:.5)),void 0!==u.normalTexture&&n!==fm.MeshBasicMaterial&&(d.push(o.assignTexture(h,"normalMap",u.normalTexture)),h.normalScale=new fm.Vector2(1,1),void 0!==u.normalTexture.scale&&h.normalScale.set(u.normalTexture.scale,u.normalTexture.scale)),void 0!==u.occlusionTexture&&n!==fm.MeshBasicMaterial&&(d.push(o.assignTexture(h,"aoMap",u.occlusionTexture)),void 0!==u.occlusionTexture.strength&&(h.aoMapIntensity=u.occlusionTexture.strength)),void 0!==u.emissiveFactor&&n!==fm.MeshBasicMaterial&&(h.emissive=(new fm.Color).fromArray(u.emissiveFactor)),void 0!==u.emissiveTexture&&n!==fm.MeshBasicMaterial&&d.push(o.assignTexture(h,"emissiveMap",u.emissiveTexture)),g.default.all(d).then(function(){var e=n===fm.ShaderMaterial?l[x.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(h):new n(h);return void 0!==u.name&&(e.name=u.name),(0,m.default)(e)&&((0,m.default)(e).encoding=fm.sRGBEncoding),e.emissiveMap&&(e.emissiveMap.encoding=fm.sRGBEncoding),e.specularMap&&(e.specularMap.encoding=fm.sRGBEncoding),X(e,u),u.extensions&&q(l,e,u),e})},ee.prototype.loadGeometries=function(e){var n=this,r=this.extensions,t=this.primitiveCache;function i(t){return r[x.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(t,n).then(function(e){return ne(e,t,n)})}for(var a=[],o=0,s=e.length;o<s;o++){var l,u=e[o],h=K(u),c=t[h];c?a.push(c.promise):(l=u.extensions&&u.extensions[x.KHR_DRACO_MESH_COMPRESSION]?i(u):ne(new fm.BufferGeometry,u,n),t[h]={primitive:u,promise:l},a.push(l))}return g.default.all(a)},ee.prototype.loadMesh=function(h){for(var c=this,e=this.json,d=e.meshes[h],f=d.primitives,t=[],n=0,r=f.length;n<r;n++){var i=void 0===f[n].material?Y():this.getDependency("material",f[n].material);t.push(i)}return g.default.all(t).then(function(u){return c.loadGeometries(f).then(function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i,a=e[n],o=f[n],s=u[n];if(o.mode===D.TRIANGLES||o.mode===D.TRIANGLE_STRIP||o.mode===D.TRIANGLE_FAN||void 0===o.mode)i=!0===d.isSkinnedMesh?new fm.SkinnedMesh(a,s):new fm.Mesh(a,s),!0!==i.isSkinnedMesh||i.geometry.attributes.skinWeight.normalized||i.normalizeSkinWeights(),o.mode===D.TRIANGLE_STRIP?i.drawMode=fm.TriangleStripDrawMode:o.mode===D.TRIANGLE_FAN&&(i.drawMode=fm.TriangleFanDrawMode);else if(o.mode===D.LINES)i=new fm.LineSegments(a,s);else if(o.mode===D.LINE_STRIP)i=new fm.Line(a,s);else if(o.mode===D.LINE_LOOP)i=new fm.LineLoop(a,s);else{if(o.mode!==D.POINTS)throw new Error("fm.GLTFLoader: Primitive mode unsupported: "+o.mode);i=new fm.Points(a,s)}0<(0,p.default)(i.geometry.morphAttributes).length&&J(i,d),i.name=d.name||"mesh_"+h,1<e.length&&(i.name+="_"+n),X(i,d),c.assignFinalMaterial(i),t.push(i)}if(1===t.length)return t[0];for(var l=new fm.Group,n=0,r=t.length;n<r;n++)l.add(t[n]);return l})})},ee.prototype.loadCamera=function(e){var t,n=this.json.cameras[e],r=n[n.type];if(r)return"perspective"===n.type?t=new fm.PerspectiveCamera(fm.Math.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):"orthographic"===n.type&&(t=new fm.OrthographicCamera(r.xmag/-2,r.xmag/2,r.ymag/2,r.ymag/-2,r.znear,r.zfar)),void 0!==n.name&&(t.name=n.name),X(t,n),g.default.resolve(t);console.warn("fm.GLTFLoader: Missing camera parameters.")},ee.prototype.loadSkin=function(e){var t=this.json.skins[e],n={joints:t.joints};return void 0===t.inverseBindMatrices?g.default.resolve(n):this.getDependency("accessor",t.inverseBindMatrices).then(function(e){return n.inverseBindMatrices=e,n})},ee.prototype.loadAnimation=function(S){for(var e=this.json,E=e.animations[S],t=[],n=[],r=[],i=[],a=[],o=0,s=E.channels.length;o<s;o++){var l=E.channels[o],u=E.samplers[l.sampler],h=l.target,c=void 0!==h.node?h.node:h.id,d=void 0!==E.parameters?E.parameters[u.input]:u.input,f=void 0!==E.parameters?E.parameters[u.output]:u.output;t.push(this.getDependency("node",c)),n.push(this.getDependency("accessor",d)),r.push(this.getDependency("accessor",f)),i.push(u),a.push(h)}return g.default.all([g.default.all(t),g.default.all(n),g.default.all(r),g.default.all(i),g.default.all(a)]).then(function(e){for(var t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=[],s=0,l=t.length;s<l;s++){var u,h=t[s],c=n[s],d=r[s],f=i[s],p=a[s];if(void 0!==h){switch(h.updateMatrix(),h.matrixAutoUpdate=!0,G[p.path]){case G.weights:u=fm.NumberKeyframeTrack;break;case G.rotation:u=fm.QuaternionKeyframeTrack;break;case G.position:case G.scale:default:u=fm.VectorKeyframeTrack}var m=h.name?h.name:h.uuid,v=void 0!==f.interpolation?V[f.interpolation]:fm.InterpolateLinear,g=[];G[p.path]===G.weights?h.traverse(function(e){!0===e.isMesh&&e.morphTargetInfluences&&g.push(e.name?e.name:e.uuid)}):g.push(m);var y,_=d.array;if(d.normalized){if(_.constructor===Int8Array)y=1/127;else if(_.constructor===Uint8Array)y=1/255;else if(_.constructor==Int16Array)y=1/32767;else{if(_.constructor!==Uint16Array)throw new Error("fm.GLTFLoader: Unsupported output accessor component type.");y=1/65535}for(var x=new Float32Array(_.length),w=0,b=_.length;w<b;w++)x[w]=_[w]*y;_=x}for(w=0,b=g.length;w<b;w++){var M=new u(g[w]+"."+G[p.path],c.array,_,v);"CUBICSPLINE"===f.interpolation&&(M.createInterpolant=function(e){return new P(this.times,(0,A.default)(this),this.getValueSize()/3,e)},M.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),o.push(M)}}}var T=void 0!==E.name?E.name:"animation_"+S;return new fm.AnimationClip(T,void 0,o)})},ee.prototype.loadNode=function(e){var t=this.json,a=this.extensions,n=this,o=t.meshReferences,s=t.meshUses,l=t.nodes[e],r=[];return void 0!==l.mesh&&r.push(n.getDependency("mesh",l.mesh).then(function(e){if(1<o[l.mesh]){var t=s[l.mesh]++,n=e.clone();n.name+="_instance_"+t,n.onBeforeRender=e.onBeforeRender;for(var r=0,i=n.children.length;r<i;r++)n.children[r].name+="_instance_"+t,n.children[r].onBeforeRender=e.children[r].onBeforeRender}else n=e;return void 0!==l.weights&&n.traverse(function(e){if(e.isMesh)for(var t=0,n=l.weights.length;t<n;t++)e.morphTargetInfluences[t]=l.weights[t]}),n})),void 0!==l.camera&&r.push(n.getDependency("camera",l.camera)),l.extensions&&l.extensions[x.KHR_LIGHTS_PUNCTUAL]&&void 0!==l.extensions[x.KHR_LIGHTS_PUNCTUAL].light&&r.push(n.getDependency("light",l.extensions[x.KHR_LIGHTS_PUNCTUAL].light)),g.default.all(r).then(function(e){var t,n=!0===l.isBone?new fm.Bone:1<e.length?new fm.Group:1===e.length?e[0]:new fm.Object3D;if(n!==e[0])for(var r=0,i=e.length;r<i;r++)n.add(e[r]);return void 0!==l.name&&(n.userData.name=l.name,n.name=fm.PropertyBinding.sanitizeNodeName(l.name)),X(n,l),l.extensions&&q(a,n,l),void 0!==l.matrix?(t=new fm.Matrix4,t.fromArray(l.matrix),n.applyMatrix(t)):(void 0!==l.translation&&n.position.fromArray(l.translation),void 0!==l.rotation&&n.quaternion.fromArray(l.rotation),void 0!==l.scale&&n.scale.fromArray(l.scale)),n})},ee.prototype.loadScene=function(e){var t=this.json,n=this.extensions,r=this.json.scenes[e],i=this,a=new fm.Scene;void 0!==r.name&&(a.name=r.name),X(a,r),r.extensions&&q(n,a,r);for(var o=r.nodes||[],s=[],l=0,u=o.length;l<u;l++)s.push(re(o[l],a,t,i));return g.default.all(s).then(function(){return a})};var ie=y;t.default=ie},function(e,t,n){var r=n(19);e.exports=r.Promise},function(e,t,n){var i=n(35),a=n(48),r=n(25),o=r("species");e.exports=function(e,t){var n,r=i(e).constructor;return void 0===r||null==(n=i(r)[o])?t:a(n)}},function(e,t,n){var r,i,a,o=n(19),s=n(16),l=n(71),u=n(72),h=n(178),c=n(118),d=n(238),f=o.location,p=o.setImmediate,m=o.clearImmediate,v=o.process,g=o.MessageChannel,y=o.Dispatch,_=0,x={},w="onreadystatechange",b=function(e){var t;x.hasOwnProperty(e)&&(t=x[e],delete x[e],t())},M=function(e){return function(){b(e)}},T=function(e){b(e.data)},S=function(e){o.postMessage(e+"",f.protocol+"//"+f.host)};p&&m||(p=function(e){for(var t=[],n=1;n<arguments.length;)t.push(arguments[n++]);return x[++_]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},r(_),_},m=function(e){delete x[e]},"process"==l(v)?r=function(e){v.nextTick(M(e))}:y&&y.now?r=function(e){y.now(M(e))}:g&&!d?(i=new g,a=i.port2,i.port1.onmessage=T,r=u(a.postMessage,a,1)):!o.addEventListener||"function"!=typeof postMessage||o.importScripts||s(S)||"file:"===f.protocol?r=w in c("script")?function(e){h.appendChild(c("script"))[w]=function(){h.removeChild(this),b(e)}}:function(e){setTimeout(M(e),0)}:(r=S,o.addEventListener("message",T,!1))),e.exports={set:p,clear:m}},function(e,t,n){var r=n(125);e.exports=/(iphone|ipod|ipad).*applewebkit/i.test(r)},function(e,t,n){var i=n(35),a=n(23),o=n(146);e.exports=function(e,t){if(i(e),a(t)&&t.constructor===e)return t;var n=o.f(e),r=n.resolve;return r(t),n.promise}},function(e){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={VERSION:"0.9.1",BUILD:137},a=i;t.default=a},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(20)),u=r(n(14)),h=r(n(21)),c=r(n(22)),a=r(n(18)),o=r(n(13)),s=r(n(4)),d=r(n(9)),f=r(n(32)),p=r(n(10)),m=r(n(55)),v=r(n(139)),g=r(n(2)),y=r(n(3)),_=r(n(5)),x=r(n(6)),w=r(n(7)),b=r(n(17)),M=r(n(46)),T=r(n(77)),S=r(n(37));function E(e,t){var n;if(void 0===c.default||null==(0,h.default)(e)){if((0,u.default)(e)||(n=A(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=(0,l.default)(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function A(e,t){var n;if(e){if("string"==typeof e)return I(e,t);var r=(0,o.default)(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?(0,a.default)(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?I(e,t):void 0}}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function L(r){var i=R();return function(){var e,t=(0,w.default)(r),n=i?(e=(0,w.default)(this).constructor,(0,s.default)(t,arguments,e)):t.apply(this,arguments);return(0,x.default)(this,n)}}function R(){if("undefined"==typeof Reflect||!s.default)return!1;if(s.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,s.default)(Date,[],function(){})),!0}catch(e){return!1}}var N=function(e){(0,_.default)(i,e);var r=L(i);function i(e,t){var n;return(0,g.default)(this,i),n=r.call(this,t.id?t.id:fm.Math.generateUUID(),S.default.DYNMODEL),n._url=t.url,n._url=n._url+"?"+n.getRandomNumber()+(new Date).getTime()+n.getRandomNumber(),n._loader=e.nodeManager.getDynLoader(),n._mixer=null,n._renderNode=null,n._gltf=null,n._visible=!0,n._actions={},n._color=t.color,n._scale=t.scale,n._rotation=t.rotation,n._moveAnimater=null,n._isMoving=!1,n._map=e,n._mapCenter=(new fm.Vector2).copy(e.center),n._meshes=[],n._fadeIn=t.fadeIn,n._fadeOut=t.fadeOut,n.init(e,t.coord,t.callback),n}return(0,y.default)(i,[{key:"init",value:function(i,a,o){var s=this;this._loader?(this._height="number"==typeof a.z?a.z:5,this._loader.load(this._url,function(e){s._fadeIn&&s.fadeIn(e.scene),s._gltf=e,s._renderNode=e.scene,s._renderNode.name="oneModel",s._getMeshes(s._renderNode,s._meshes),s._color&&s.setColor(s._color),s._scale&&s.setScale(s._scale),s._rotation&&s.setRotate(s._rotation),s._renderNode.scale.z*=-1,s._renderNode.mapNode=s,s._mixer=new fm.AnimationMixer(s._renderNode),i.addAnimationMixer(s._mixer);var t,n=E(e.animations);try{for(n.s();!(t=n.n()).done;){var r=t.value;s._actions[r.name]=s._mixer.clipAction(r)}}catch(e){n.e(e)}finally{n.f()}s.setPosition(a.x,a.y,0,s._height),s.renderNodeInited=!0,s.visible=!0,o&&o(s)},function(e){console.warn("FMDynamicModel => 模型加载失败!",e)})):console.error("外部模型加载器缺失")}},{key:"lookAt",value:function(e){var t,n,r;this.parent&&this.parent.parent?(t=this._map.center,n=this.parent.parent.height,r=new fm.Vector3(e.x-t.x,n+e.z,-e.y+t.y),this._renderNode.lookAt(r)):console.warn("请将模型加载进入地图!")}},{key:"setPosition",value:function(e,t,n,r){var i=this._mapCenter;this._height=r,this._x=e,this._y=t,this._renderNode.position.set(this._x-i.x,this._height,i.y-this._y)}},{key:"rotateTo",value:function(t){var n=this,e=this._renderNode.rotation.y,r=t.to%360*fm.Math.DEG2RAD;this.rotateAnimater&&(this.rotateAnimater.stop(),this._map.removeAnimater(this.rotateAnimater));var i=new T.default({angle:e},{angle:r},t.duration?1e3*t.duration:500,function(){n._map.removeAnimater(i),n.rotateAnimater=null,t.callback&&t.callback()},function(e){n._renderNode.rotation.y=e.angle,t.update&&t.update()}).start();this._map.addAnimater(i),this.rotateAnimater=i}},{key:"setRotate",value:function(e){this._renderNode.rotation.y=e%360*fm.Math.DEG2RAD}},{key:"setScale",value:function(e){for(var t=this._renderNode.children,n=0;n<t.length;n++)t[n].scale.x=e,t[n].scale.y=e,t[n].scale.z=e}},{key:"setColor",value:function(e){for(var t=new fm.Color(e),n=this._meshes,r=0;r<n.length;r++){var i=n[r];i.material.color.r=t.r,i.material.color.g=t.g,i.material.color.b=t.b}}},{key:"fadeIn",value:function(e){e.traverse(function(e){var t;e instanceof fm.Mesh&&(e.material.transparent=!0,e.material.opacity=0,t=(0,v.default)(function(){e.material.opacity<1?e.material.opacity+=.05:clearInterval(t)},200))})}},{key:"setHeight",value:function(e){this.setPosition(this._x,this._y,0,e)}},{key:"setAngle",value:function(e){this._renderNode&&(this._renderNode.rotation.y=e*fm.Math.DEG2RAD)}},{key:"startAction",value:function(e,t,n){var r=1<arguments.length&&void 0!==t?arguments[1]:.2,i=2<arguments.length?n:void 0,a=this._actions[e];a&&(i&&(a.clampWhenFinished=!0,a.loop=fm.LoopOnce),a.reset().setEffectiveTimeScale(1).setEffectiveWeight(1).fadeIn(r).play())}},{key:"stopAction",value:function(e,t){var n=1<arguments.length&&void 0!==t?arguments[1]:.2,r=this._actions[e];r&&r.fadeOut(n)}},{key:"getActionList",value:function(){return(0,m.default)(this._actions)}},{key:"moveTo",value:function(t){var e,n,r,i,a=this;this._isMoving||(e=this.findParent(M.default),n=t.x,r=t.y,t.time||(t.time=.5),i=new T.default({x:this.x,y:this.y},{x:n,y:r},1e3*t.time,function(){(0,p.default)(e).removeAnimater(i),a._moveAnimater=null,a._isMoving=!1,t.callback&&t.callback()},function(e){a.setPosition(e.x,e.y,0,a._height),t.update&&t.update(e)}).start(),this._isMoving=!0,(0,p.default)(e).addAnimater(i),this._moveAnimater=i)}},{key:"stopMoveTo",value:function(){var e=this.findParent(M.default);this._moveAnimater&&this._moveAnimater.stop(),(0,p.default)(e).removeAnimater(this._moveAnimater),this._isMoving=!1,this._moveAnimater=null}},{key:"_getMeshes",value:function(e,t){if(e instanceof fm.Mesh)e.material=e.material.clone(),t.push(e);else if(e.children)for(var n=0;n<e.children.length;n++)this._getMeshes(e.children[n],t)}},{key:"getRandomNumber",value:function(){for(var e=100,t=new Array,n=0;n<e;n++)t[n]=n+1;return(0,f.default)(t).call(t,function(){return.5-Math.random()}),t[Math.floor(Math.random()*e)]}},{key:"dispose",value:function(){this._renderNode.mapNode=null}},{key:"visible",set:function(e){var t;e?this.parent&&(0,d.default)(t=this.parent.scene.children).call(t,this._renderNode)<0&&this._renderNode&&this.parent.scene.add(this._renderNode):(this._renderNode&&this.parent.scene.remove(this._renderNode),this._renderNode.parent=this.parent.scene),this._visible=e},get:function(){return this._visible}},{key:"renderNode",get:function(){return this._renderNode},set:function(e){var t;this._renderNode=e,this._renderNode.mapNode=this,(0,d.default)(t=this.parent.scene.children).call(t,this._renderNode)<0&&this._renderNode&&this.parent.scene.add(this._renderNode)}},{key:"mapCoord",get:function(){if(this.parent&&this.parent.parent){var e=this._map.center,t=this.parent.parent.height,n=this._renderNode.position;return new fm.Vector3(n.x+e.x,e.y-n.z,-t+n.y)}console.warn("请将模型加载进入地图!")}}]),i}(b.default),k=N;t.default=k},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var c=r(n(9)),d=r(n(31)),y=r(n(36)),a=r(n(2)),o=r(n(3)),s=r(n(133)),_=(r(n(138)),r(n(148))),l=function(){function e(){(0,a.default)(this,e)}return(0,o.default)(e,null,[{key:"search",value:function(){}},{key:"drawNaviRoads",value:function(e){if(e&&e._currentSceneId&&e.dataManager){var t=e.dataManager._sceneDecodeData[e._currentSceneId];if(t){var n=t.floors;if(0!=n.length){var r,i=[{lineWidth:1,alpha:1,lineType:fengmap.FMLineType.FULL,color:"#00FFFF"},{lineWidth:1,alpha:1,lineType:fengmap.FMLineType.FULL,color:"#00FF00"},{lineWidth:1,alpha:1,lineType:fengmap.FMLineType.FULL,color:"#FF00FF"},{lineWidth:1,alpha:1,lineType:fengmap.FMLineType.FULL,color:"#FF0000"}],a=1,o=[];for(r in n){var s=n[r].gid;if(null!=s){var l,u=n[r].geo[0],h=n[r].biz[0],c=n[r].navi[0],d=new _.default({}),f=d.convertToGroup(s,u,h,c);for(l in f.naviSegments){var p,m=f.naviSegments[l],v=new fengmap.FMLineMarker,g=new fengmap.FMSegment;g.groupId=s,g.points=m.geoArr,(0,y.default)(p=g.points).call(p,function(e){e.z=a}),v.addSegment(g),e.drawLineMark(v,i[m.entry]),o.push(v)}}}return o}}}}},{key:"convertPointCoordsByCenter",value:function(e,t){return e.x=e.x-t.x,e.y=e.y-t.y,void 0!==e.z&&void 0!==t.z&&(e.z=e.z-t.z),e}},{key:"convertPointsCoordsByCenter",value:function(e,t){for(var n=0;n<e.length;n++)this.convertPointCoordsByCenter(e[n],t);return e}}]),e}();(0,s.default)(l,"getLayerByAlias",function(e,t,n,r){var i,a=e.getFMGroup(t);if(a&&a.layers){n=(0,d.default)(i=[]).call(i,n);for(var o=[],s=0;s<a.layers.length;s++){var l=a.layers[s];if(l._type_)-1<(0,c.default)(n).call(n,l._type_)&&(r&&r(l,l._type_)&&s--,o.push(l));else for(var u=0;u<n.length;u++){var h=n[u];fengmap.Map.layerAlias[h]&&l instanceof fengmap.Map.layerAlias[h]&&(r&&r(l,h)&&s--,o.push(l))}}return 0==o.length?null:1==o.length?o[0]:o}});var u=l;t.default=u},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(20)),u=r(n(14)),h=r(n(21)),c=r(n(22)),a=r(n(18)),o=r(n(13)),s=r(n(30)),d=r(n(9)),f=r(n(15)),p=r(n(31)),m=r(n(32)),v=r(n(2)),g=r(n(3)),y=r(n(136)),_=n(212),x=r(n(231)),w=r(n(532)),b=r(n(94));function M(e,t){var n;if(void 0===c.default||null==(0,h.default)(e)){if((0,u.default)(e)||(n=T(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=(0,l.default)(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function T(e,t){var n;if(e){if("string"==typeof e)return S(e,t);var r=(0,o.default)(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?(0,a.default)(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?S(e,t):void 0}}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function E(e,t){var n,r,i,a,o,s,l,u;b.default.d&&(n=b.default.d(t),n.minFilter=fm.LinearFilter,n.generateMipmaps=!1,r=.4,i=new fm.Vector2(r,.12*r/.5),a=new w.default,a.transparent=!0,a.uniforms.scale={value:i},o=-1*(.5*i.x/e-1),s=-1*(1-.5*i.y),a.uniforms.offset={value:new fm.Vector2(o,s)},a.uniforms.mmap={value:n},a.needsUpdate=!0,l=new x.default,u=new fm.Mesh(l,a),u.frustumCulled=!1,b.default[t.uuid].f=u)}var A=function(){function n(e,t){(0,v.default)(this,n),this.canvas=e.canvas,this.renderer=null,this._map=t,this._clearColor=16777215,this._clearAlpha=1,this._viewMode=t._viewMode,this._w=this.canvas.width,this._h=this.canvas.height,this._spriteRenderHeight=15,this._poiSpriteHeight=15,this._logarithmicDepthBuffer="boolean"==typeof e.logarithmicDepthBuffer&&e.logarithmicDepthBuffer,this.init(),this._envMap=null,this._renderList=[],this._showCompass=!1,this._compassNode=null,this._lineMarkerScene=new fm.Scene,this._backrenderScene=new fm.Scene,this.background=new fm.Scene,this._backrenderScene.userData.type="lastScene",this._fristRender=!1,this.skyEffect=null,this.reflectEffect=null,this._time=(new Date).getTime(),this._sweep={},this._sweep.max=10,this._sweep.min=0,E(this._w/this._h,t)}return(0,g.default)(n,[{key:"getFrustumByViewMode",value:function(e){var t="3d"===e?this.perspectiveCamera:this.orthographicCamera;return t.updateMatrixWorld(!0),(new fm.Frustum).setFromProjectionMatrix((new fm.Matrix4).multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse))}},{key:"getScaleByPixels",value:function(e,t){return t/(e/2*this.domElementHeight)}},{key:"setBackground",value:function(e){this.background.background=(new fm.TextureLoader).load(e)}},{key:"setSkyEffect",value:function(e){this.skyEffect=e,this.skyEffect.updateRenderList()}},{key:"setReflectEffect",value:function(e){this.reflectEffect=e}},{key:"resetCompass",value:function(){var e,t,n,r,i;this.compassNode&&(e=this.getAspect(),t=this.getScaleByPixels(1,this._map.MapOptions.compassSize),n=-this.getScaleByPixels(1,this._map.MapOptions.compassOffset[1]),r=this.getScaleByPixels(1,this._map.MapOptions.compassOffset[0])/e,i=this.getCompassOffset(this._map.MapOptions.compassPosition,t,e,r,n),this.compassNode.material.uniforms.scale={value:t},this.compassNode.material.uniforms.offset={value:new fm.Vector2(i.ox,i.oy)},this.compassNode.userData.coord={x:i.ox,y:i.oy},this.compassNode.userData.width=.5*t)}},{key:"getCompassOffset",value:function(e,t,n,r,i){var a=1,o=1;switch(e){case 3:a=-1;break;case 2:o=-1;break;case 4:o=-1,a=-1}var s=a*(.5*t/n-1),l=o*(1-.5*t);return{ox:s+r,oy:l+i}}},{key:"resetLocationsSize",value:function(){var e,t=this.renderList,n=M(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;if("location"===r.userData.type){var i,a=M(r.children);try{for(a.s();!(i=a.n()).done;){var o=i.value;this.setLocationSize(o,o.mapNode.size)}}catch(e){a.e(e)}finally{a.f()}}}}catch(e){n.e(e)}finally{n.f()}}},{key:"setLocationSize",value:function(e,t){var n,r,i,a;"3d"===this._viewMode?(n=new fm.Matrix4,n.multiplyMatrices(this.perspectiveCamera.matrixWorldInverse,e.matrixWorld),r=(new fm.Vector3).applyMatrix4(n),i=t/(this.canvas.height/(2*Math.tan(this.perspectiveCamera.fov*fm.Math.DEG2RAD/2)))*Math.abs(r.z),e.scale.set(i,i,i)):(a=t*Math.abs(this.orthographicCamera.top-this.orthographicCamera.bottom)/this.orthographicCamera.zoom/this.canvas.height,e.scale.set(a,a,a))}},{key:"setLabelSize",value:function(e,t){var n,r;"3d"===this._viewMode?(n=t/(this.canvas.height/(2*Math.tan(this.perspectiveCamera.fov*fm.Math.DEG2RAD/2))),e.scale.set(n,n,n)):(r=t*Math.abs(this.orthographicCamera.top-this.orthographicCamera.bottom)/this.orthographicCamera.zoom/this.canvas.height,e.scale.set(r,r,r)),e.scale.multiplyScalar(e.material.userData.mspriteScale),e.scale.setX(e.scale.x/e.material.userData.scaleRatio)}},{key:"setFacilitySize",value:function(e,t){var n=1,r="3d"===this._viewMode?t/(this.canvas.height/(2*Math.tan(this.perspectiveCamera.fov*fm.Math.DEG2RAD/2))):t*Math.abs(this.orthographicCamera.top-this.orthographicCamera.bottom)/this.orthographicCamera.zoom/this.canvas.height;e.material.userData.scaleRatio&&(n=e.material.userData.scaleRatio),e.scale.set(r,r/n,r)}},{key:"setImageMarkerSize",value:function(e){var t=1,n="3d"===this._viewMode?e.material.userData.size/(this.canvas.height/(2*Math.tan(this.perspectiveCamera.fov*fm.Math.DEG2RAD/2))):e.material.userData.size*Math.abs(this.orthographicCamera.top-this.orthographicCamera.bottom)/this.orthographicCamera.zoom/this.canvas.height;e.material&&(t=e.material.userData.scaleRatio),isNaN(t)&&(t=1),e.scale.set(n,n/t,n)}},{key:"parseGroup",value:function(e){var t=[],n=e._getLayers(!1);this.getShadowScene();var r,i=this.shadowscene.children;for(r in n){var a=n[r];if(!this.needshadow||"model"!==r&&"extent"!==r){var o,s=M(a);try{for(s.s();!(o=s.n()).done;){var l=o.value;l.renderOrder=_.LayerOrder[r],l.e_id=e.eid,t.push(l)}}catch(e){s.e(e)}finally{s.f()}}else{var u,h=M(a[0].children);try{for(h.s();!(u=h.n()).done;){var c=u.value;c instanceof fm.Mesh&&i.push(c)}}catch(e){h.e(e)}finally{h.f()}}}return this.needshadow&&(this.shadowscene.renderOrder=_.LayerOrder.model,t.push(this.shadowscene)),e.locationScene.renderOrder=_.LayerOrder.location,t.push(e.locationScene),e.lineScene.renderOrder=_.LayerOrder.line,t.push(e.lineScene),t}},{key:"getShadowScene",value:function(){this.shadowscene=new fm.Scene;var e=new fm.AmbientLight(7631988),t=new fm.Object3D,n=new fm.DirectionalLight(8947848,1.2);n.position.set(-1,1,1),n.target=t,n.castShadow=!0,n.shadow.camera=new fm.OrthographicCamera(-100,100,100,-100,.5,1e3),n.shadow.mapSize.width=720*y.default.devicePixelRatio,n.shadow.mapSize.height=610*y.default.devicePixelRatio;var r=new fm.DirectionalLight(3355443);r.position.set(-.5,1,-1).normalize(),r.target=t,this.shadowscene.add(n),this.shadowscene.add(e),this.shadowscene.add(r),this.shadowscene.add(t)}},{key:"parseList",value:function(e){var o=this,s=[];if(e){var t,n=M(e);try{for(n.s();!(t=n.n()).done;){var r,i=t.value,a=function(e){for(var t=o.parseGroup(e),n=[],r=0;r<t.length;r++)"model"===t[r].name?t[r].traverse(function(e){"oneModel"===e.name&&n.push(e)}):"dynmodel"===t[r].name?t[r].traverse(function(e){"oneModel"===e.name&&n.push(e)}):"extent"===t[r].name&&t[r].traverse(function(e){"oneExtent"===e.name&&n.push(e)});for(var i=0;i<t.length;i++)if("waterMarker"===t[i].name)for(var a=0;a<n.length;a++)t[i].add(n[a]);(0,m.default)(t).call(t,function(e,t){return e.renderOrder-t.renderOrder}),s=(0,p.default)(s).call(s,t)},l=M(i);try{for(l.s();!(r=l.n()).done;){var u=r.value;a(u)}}catch(e){l.e(e)}finally{l.f()}}}catch(e){n.e(e)}finally{n.f()}}return s}},{key:"setBackRender",value:function(e){this._backrenderScene.children=e}},{key:"init",value:function(){this.renderer=this._map.render,this.renderer.setClearColor(this._clearColor,this._clearAlpha);var e=this.canvas.width,t=this.canvas.height;return this.renderer.setSize(e,t),this.renderer.setPixelRatio(y.default.devicePixelRatio),this.renderer.shadowMap.enabled=!0,this.renderer.shadowMap.type=fm.PCFSoftShadowMap,this.renderer.autoClear=!1,this.canvas=this._map.canvas,this.orthographicCamera=this._map.orthographicCamera,this.perspectiveCamera=this._map.perspectiveCamera,!0}},{key:"getCameraByViewMode",value:function(e){return"3d"===e?this.perspectiveCamera:this.orthographicCamera}},{key:"getCurrentCamera",value:function(){return this.getCameraByViewMode(this._viewMode)}},{key:"resetSpriteSize",value:function(){var e,t=this.renderList,n=M(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;if("facility"===r.userData.type){var i,a=M(r.children);try{for(a.s();!(i=a.n()).done;){var o=i.value;this.setFacilitySize(o,o.mapNode.size)}}catch(e){a.e(e)}finally{a.f()}}else if("label"===r.userData.type){var s,l=M(r.children);try{for(l.s();!(s=l.n()).done;){var u=s.value;this.setLabelSize(u,u.mapNode.size)}}catch(e){l.e(e)}finally{l.f()}}else if("imageMarker"===r.userData.type){var h,c=M(r.children);try{for(c.s();!(h=c.n()).done;){var d=h.value;this.setImageMarkerSize(d)}}catch(e){c.e(e)}finally{c.f()}}else if("textMarker"===r.userData.type){var f,p=M(r.children);try{for(p.s();!(f=p.n()).done;){var m=f.value;this.setLabelSize(m,m.mapNode.size)}}catch(e){p.e(e)}finally{p.f()}}}}catch(e){n.e(e)}finally{n.f()}}},{key:"getAspect",value:function(){return this._w/this._h}},{key:"resize",value:function(){this.renderer.setSize(this._w,this._h),this.perspectiveCamera.aspect=this._w/this._h,this.resizeWater(this._w/this._h),this.perspectiveCamera.updateProjectionMatrix(),this.orthographicCamera.left=-this._w/2,this.orthographicCamera.right=this._w/2,this.orthographicCamera.top=this._h/2,this.orthographicCamera.bottom=-this._h/2,this.orthographicCamera.updateProjectionMatrix()}},{key:"resizeWater",value:function(e){var t,n,r,i;b.default[this._map.uuid].f&&(t=.4,n=new fm.Vector2(t,.12*t/.5),b.default[this._map.uuid].f.material.uniforms.scale={value:n},isNaN(e),r=-1*(.5*n.x/e-1),i=-1*(1-.5*n.y),b.default[this._map.uuid].f.material.uniforms.offset={value:new fm.Vector2(r,i)})}},{key:"resizeLine",value:function(){var e,t=this.renderList,n=M(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;if("line"===r.userData.type){var i,a=M(r.children);try{for(a.s();!(i=a.n()).done;){var o=i.value;o.material.resolution.set(this.domElementWidth,this.domElementHeight)}}catch(e){a.e(e)}finally{a.f()}}}}catch(e){n.e(e)}finally{n.f()}}},{key:"update",value:function(){var t=this;this._fristRender||(this._map.dispatchEvent({type:"firstRender"}),this._firstRender=!0),(5<Math.abs(this._w-this.canvas.width)||5<Math.abs(this._h-this.canvas.height))&&(this._w=this.canvas.width,this._h=this.canvas.height,this.resize(),this.resetSpriteSize(),this.resetLocationsSize(),this._map.updatePopsPosition(),this.resizeLine(),this.resetCompass());var e="3d"===this._viewMode?this.perspectiveCamera:this.orthographicCamera,n=this.renderList;if(n&&this.renderer){for(var r=0;r<n.length;r++)"waterMarker"===n[r].name?n[r].traverse(function(e){"water"===e.name&&(e.material.uniforms.time.value+=1/60)}):"dynline"===n[r].name&&n[r].traverse(function(e){var t,n,r,i;"line"===e.name&&(t=e.userData.colors,n=t.pop(),r=t.pop(),i=t.pop(),(0,f.default)(t).call(t,0,0,n),(0,f.default)(t).call(t,0,0,r),(0,f.default)(t).call(t,0,0,i),e.geometry.setColors(t))}),this._map.MapOptions.isNeedSweep&&(this._sweep.max<400?(this._sweep.max+=((new Date).getTime()-this._time)/40,this._sweep.min+=((new Date).getTime()-this._time)/40):(this._sweep.max=-610,this._sweep.min=-620),n[r].traverse(function(e){"isNeedSweep"===e.name&&(e.material.uniforms.maxPos.value=t._sweep.max,e.material.uniforms.minPos.value=t._sweep.min)}));if(this._time=(new Date).getTime(),this.renderer.clear(),this.renderer.clearDepth(),this._envMap&&this.renderer.render(this._envMap,e),this.lightEffects)this.effectRender(e);else{void 0!==this.background.background&&this.renderer.render(this.background,e);var i,a=M(n);try{for(a.s();!(i=a.n()).done;){var o=i.value;this.renderer.render(o,e)}}catch(e){a.e(e)}finally{a.f()}e.layers.set(0),this._showCompass&&this._compassNode&&this.renderer.render(this._compassNode,e)}b.default[this._map.uuid].f&&this.renderer.render(b.default[this._map.uuid].f,e),null!==this.skyEffect&&this.skyEffect.update(this,e),null!==this.reflectEffect&&this.reflectEffect.render()}}},{key:"setSceneNodeLayers",value:function(e,t){var n,r=M(e.children);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.mapNode&&!i.mapNode.picLoading&&i.layers.set(t)}}catch(e){r.e(e)}finally{r.f()}}},{key:"setClearColor",value:function(e,t){"string"==typeof e&&0<=(0,d.default)(e).call(e,"#")?this._clearColor=(0,s.default)(e.replace("#","0x")):this._clearColor=e,this._clearAlpha="number"==typeof t?t:1,this.renderer.setClearColor(this._clearColor,this._clearAlpha)}},{key:"setEnvMap",value:function(e){var t,n,r;e&&e.path&&e.format&&(t=e.path,n=e.format,r=(new fm.CubeTextureLoader).load([t+"px"+n,t+"nx"+n,t+"py"+n,t+"ny"+n,t+"pz"+n,t+"nz"+n]),this._envMap||(this._envMap=new fm.Scene),this._envMap.background=r)}},{key:"dispose",value:function(){this._envMap&&(this._envMap=void 0);var e=this.renderList;if(e){var t,n=M(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r){for(var i=r.children.length-1;-1<i;i--)r.remove(r.children[i]);r.children.length=0,r=void 0}}}catch(e){n.e(e)}finally{n.f()}}this._compassNode&&(this._compassNode.material.dispose(),this._compassNode.geometry.dispose());for(var a=this._lineMarkerScene.children.length-1;-1<a;a--)this._lineMarkerScene.remove(this._lineMarkerScene.children[a]);this._map=void 0,this.renderer.dispose(),this.renderer.forceContextLoss(),this.canvas=void 0,this.renderer=void 0}},{key:"renderList",set:function(e){this._renderList=this.parseList(e,void 0)},get:function(){return this._renderList}},{key:"domElementHeight",get:function(){return this.canvas.height}},{key:"domElementWidth",get:function(){return this.canvas.width}},{key:"viewMode",set:function(e){this._viewMode=e}},{key:"showCompass",set:function(e){this._showCompass=e},get:function(){return this._showCompass}},{key:"compassNode",get:function(){return this._compassNode},set:function(e){this._compassNode=e}},{key:"lineMarkerScene",get:function(){return this._lineMarkerScene}}]),n}(),I=A;t.default=I},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.abortAnimationFrame=t.doAnimationFrame=void 0;var a=r(n(75)),o=0,s=function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-o)),r=(0,a.default)(function(){e(t+n)},n);return o=t+n,r};t.doAnimationFrame=s;var l=function(e){clearTimeout(e)};t.abortAnimationFrame=l},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(9)),s=r(n(12)),l=r(n(10)),u=r(n(2)),h=r(n(3)),c=r(n(5)),d=r(n(6)),f=r(n(7)),p=r(n(46)),m=r(n(144)),v=r(n(77)),g=r(n(37)),y=r(n(111)),_=r(n(149)),x=n(67),w=r(n(150));function b(r){var i=M();return function(){var e,t=(0,f.default)(r),n=i?(e=(0,f.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,d.default)(this,n)}}function M(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var T=function(e){(0,c.default)(i,e);var r=b(i);function i(e,t){var n;return(0,u.default)(this,i),n=r.call(this,0,g.default.IMAGE_MARKER),n._map=e,n._url=t.url,n._size=t.size,n._map.wxInfo.pixelRatio&&(n._size*=n._map.wxInfo.pixelRatio),n._height=0,n._offsetHeight=t.height?t.height:0,n._opx=t.x||0,n._opy=t.y||0,n._callBack=t.callback,n._moveAnimater=null,n._isMoving=!1,n._depth=t.depth,n._isJumping=!1,n._origonY=0,n.center=n.getCenterByAnchor(t.anchor),n.picLoading=!1,n.markername=t.name,n}return(0,h.default)(i,[{key:"init",value:function(){var e=this,t=this.findParent(p.default);if(!t)return!1;var n=!0,r=t.materialManager.createPoiMaterial({imageUrl:this._url,imageSrc:this._url,alpha:1},null,function(){e._renderNode?(e.picLoading=!1,e._renderNode.layers.set(0),e._renderNode.frustumCulled=!1,(0,l.default)(t).renderer.setImageMarkerSize(e._renderNode)):n=!1},this._depth,this._priority);r.userData.size=this._size,this._renderNode=new y.default(r),this._renderNode.markername=this.markername,n&&(this.picLoading=!0,this._renderNode.layers.set(2)),this._renderNode.mapNode=this,this._renderNode.parent=this.parent.scene,this._renderNode.center.set(this.center.x,this.center.y),(0,l.default)(t).renderer.setImageMarkerSize(this._renderNode),this._renderNode.visible=this.show,this._renderNode.name="spirit",this._isInit=!0;var i=this.parent.parent.groupID,a=this.parent.parent.parent.mapcenter;return this._opx&&this._opy?(this._x=this._opx,this._y=this._opy):(this._x=a.x,this._y=a.y),this.setPosition(this.x,this.y,i,this._offsetHeight),this._callBack&&this._callBack(this),!0}},{key:"setPosition",value:function(e,t,n,r){var i,a,o=this.findParent(m.default);o?("number"==typeof n&&0<n&&this.moveToGroup(n),i=o.center,a=o.mapcenter,this._height=r,this._x=e,this._y=t,this._renderNode.position.set(this._x-a.x,i.y+this._height,i.y-this._y+a.y)):console.error("Can't change position before map init Marker")}},{key:"getPosition",value:function(){return{x:this._y,y:this._y,z:this._height,groupID:this.parent.parent.groupID}}},{key:"moveTo",value:function(t){var e,n,r,i,a,o=this;this._isMoving||(e=this.findParent(p.default),n=t.x,r=t.y,i=null,i=t.height?t.height:this._height,a=new v.default({x:this.x,y:this.y,height:this._height},{x:n,y:r,height:i},1e3*t.time,function(){(0,l.default)(e).removeAnimater(a),o._moveAnimater=null,o._isMoving=!1,t.callback()},function(e){o.setPosition(e.x,e.y,0,e.height),t.update(e)}).start(),this._isMoving=!0,(0,l.default)(e).addAnimater(a),this._moveAnimater=a)}},{key:"moveToGroup",value:function(e){var t,n=this.findParent(p.default),r=this.parent.parent.groupID;r!==e&&(this.parent.parent.parent.groups[""+e]?(this._groupId=e,t=this.parent.parent.parent.groups[""+e].getOrCreateLayer("imageMarker"),this.parent.untiedMarker(this),t.addMarker(this),this._renderNode.material.opacity=.9,(0,l.default)(n).renderer.setImageMarkerSize(this._renderNode)):console.warn(x.tileMessage.noGroup))}},{key:"stopMoveTo",value:function(){var e=this.findParent(p.default);this._moveAnimater&&this._moveAnimater.stop(),(0,l.default)(e).removeAnimater(this._moveAnimater),this._isMoving=!1,this._moveAnimater=null}},{key:"jump",value:function(e){var n,r,i,t,a,o=this;this._renderNode&&!this._isJumping&&(this._isJumping=!0,n=(0,s.default)({height:8,times:0,duration:1,delay:0},e),"number"==typeof n.height&&"number"==typeof n.times&&"number"==typeof n.duration&&"number"==typeof n.delay&&(n.duration*=1e3,n.delay*=1e3,n.all=n.duration+n.delay,n.halfDuration=n.duration/2,r=n.height-this._height,this._origonY=this._renderNode.position.y,i=(new Date).getTime(),t=this.findParent(p.default),a=(0,l.default)(t),this.jumpEvent=function(){var e,t;o._renderNode?(e=(new Date).getTime()-i,0!=n.times&&e/n.all>n.times?o.stopJump():(e%=n.all,e>n.duration?o._renderNode.position.y!=o._origonY&&(o._renderNode.position.y=o._origonY):(t=e/n.halfDuration-1,t=1-t*t,o._renderNode.position.y=o._origonY+r*t))):a.off("frameLoop",o.jumpEvent)},a.on("frameLoop",this.jumpEvent)))}},{key:"stopJump",value:function(){var e,t;this._renderNode&&this.jumpEvent&&(this._renderNode.position.y=this._origonY,this._isJumping=!1,e=this.findParent(p.default),t=(0,l.default)(e),t.off("frameLoop",this.jumpEvent))}},{key:"setSize",value:function(){var e=this.findParent(p.default);(0,l.default)(e).renderer.setFacilitySize(this._renderNode,this._size)}},{key:"getCenterByAnchor",value:function(e){var t=new fm.Vector2(.5,.5);switch(e){case _.default.LEFT:t.setX(0);break;case _.default.RIGHT:t.setX(1);break;case _.default.TOP:t.setY(1);break;case _.default.BOTTOM:t.setY(0);break;case _.default.LEFT_TOP:t.set(0,1);break;case _.default.RIGHT_TOP:t.set(1,1);break;case _.default.LEFT_BOTTOM:t.set(0,0);break;case _.default.RIGHT_BOTTOM:t.set(1,0)}return t}},{key:"url",set:function(e){var t=this.findParent(p.default);if(!t)return!1;var n=t.materialManager.createPoiMaterial({imageUrl:e,imageSrc:e,alpha:1});n.userData.size=this._size,this._renderNode.material.dispose(),this._renderNode.material=n,this._url=e},get:function(){return this._url}},{key:"visible",set:function(e){var t;e?(0,o.default)(t=this.parent.scene.children).call(t,this._renderNode)<0&&this._renderNode&&this.parent.scene.add(this._renderNode):this._renderNode&&this.parent.scene.remove(this._renderNode),this._visible=e}},{key:"size",get:function(){return this._size},set:function(e){this._size=e}},{key:"height",set:function(e){this._height=e,this._renderNode.position.y=this._height}}]),i}(w.default),S=T;t.default=S},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(2)),s=r(n(3)),l=r(n(5)),u=r(n(6)),h=r(n(7)),c=r(n(17)),d=r(n(537)),f=r(n(37)),p=r(n(77)),m=n(67);function v(r){var i=g();return function(){var e,t=(0,h.default)(r),n=i?(e=(0,h.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,u.default)(this,n)}}function g(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var y=function(e){(0,l.default)(i,e);var r=v(i);function i(e,t){var n;return(0,o.default)(this,i),n=r.call(this,0,f.default.LOCATION_MARKER),n._map=e,n._size=t.size||20,n._map.wxInfo.pixelRatio&&(n._size*=n._map.wxInfo.pixelRatio),n._url=t.url,n._groupId=t.groupID||1,n._x=t.x||n._x,n._y=t.y||n._y,n._dheight=t.height||2.1,n._gid=t.groupID||1,n._scene=null,n._renderNode=null,n._callBack=t.callback,n.rotateAnimater=null,n}return(0,s.default)(i,[{key:"initSprite",value:function(e){var t=this,n=new d.default,r=new fm.MeshBasicMaterial,i=!0;e.materialManager.loadTexture(this._url,function(e){e.minFilter=fm.LinearFilter,e.generateMipmaps=!1,e.flipY=!1,r.map=e,r.needsUpdate=!0,t._renderNode?(t.picLoading=!1,t._renderNode.layers.set(0)):i=!1}),r.side=2,r.transparent=!0,this._renderNode=new fm.Mesh(n,r),this._renderNode.mapNode=this,i&&(this.picLoading=!0,this._renderNode.layers.set(2));var a=this._scene.mapcenter;return this._x&&this._y||(this._x=a.x,this._y=a.y),this._callBack&&this._callBack(this),this.setPosition({x:this._x,y:this._y}),!0}},{key:"setPosition",value:function(e){if(this._scene){void 0!==e.zOffset&&(this._dheight=e.zOffset),void 0!==e.height&&(this._dheight=e.height);var t=this._scene.groups[this._gid];if(e.groupID&&e.groupID!==this._gid){var n=t,r=this._scene.groups[e.groupID];if(!r)return void console.warn(m.tileMessage.noGroup);n.removeLocation(this),r.addLocation(this),t=r,this.isAlwaysShow&&this.alwaysShow(),this._gid=e.groupID,this._groupId=this._gid}var i=this._scene.mapcenter;this._x=e.x,this._y=e.y,this._renderNode.position.set(this._x-i.x,this._dheight,-this._y+i.y)}else console.error("Can't change position before map init Marker")}},{key:"rotate",value:function(e){this._renderNode.rotation.y=e*fm.Math.DEG2RAD}},{key:"rotateTo",value:function(t){var n=this,e=this.renderNode.rotation.y,r=t.to%360*fm.Math.DEG2RAD,i=r,a=0;r-e!=0&&(a=Math.sin(r-e)/Math.abs(Math.sin(r-e))*Math.acos(Math.cos(r-e)));var o=e+a,s=e;this.rotateAnimater&&(this.rotateAnimater.stop(),this._map.removeAnimater(this.rotateAnimater));var l=new p.default({angle:s},{angle:o},t.duration?1e3*t.duration:500,function(){n._map.removeAnimater(l),n.rotateAnimater=null,n._renderNode.rotation.y=i,t.callback&&t.callback()},function(e){n._renderNode.rotation.y=e.angle,t.update&&t.update()}).start();this._map.addAnimater(l),this.rotateAnimater=l}},{key:"moveTo",value:function(t){var e,n,r,i=this;this._isRuning||(e=t.x,n=t.y,r=new p.default({x:this._x,y:this._y},{x:e,y:n},t.time?1e3*t.time:500,function(){i._map.removeAnimater(r),i._isRuning=!1,t.callback&&t.callback()},function(e){i.setPosition({x:e.x,y:e.y,groupID:0,height:i._dheight}),t.update&&t.update(e)}).start(),this._isRuning=!0,this._map.addAnimater(r))}},{key:"alwaysShow",value:function(){var e;this._alwaysShow=!0;for(var t=this.parent;t;){if(t.isGroup){e=t;break}t=t.parent}e&&this.renderNode&&(this.renderNode.material.depthTest=!1,e.alwaysShowMarkers.push(this.renderNode))}},{key:"dispose",value:function(){this.parent&&this.parent.removeLocation(this),this.parent=null,this._renderNode&&(this._renderNode.material.dispose(),this._renderNode.geometry.dispose(),this._renderNode.material=void 0,this._renderNode.geometry=void 0,this._renderNode.mapNode=void 0,this._renderNode=void 0)}},{key:"direction",get:function(){return this.renderNode.rotation.y},set:function(e){this.renderNode.rotation.y=e*fm.Math.DEG2RAD}},{key:"scene",set:function(e){this._scene=e}},{key:"map",set:function(e){this._map=e}},{key:"size",get:function(){return this._size}},{key:"renderNode",get:function(){return this._renderNode}},{key:"groupID",get:function(){return this._groupId}},{key:"height",get:function(){return this._dheight}}]),i}(c.default),_=y;t.default=_},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={FULL:"full",DOTTED:"dotted",DOT_DASH:"dotDash",CENTER:"center",DASH:"dash",DOUBLE_DOT_DASH:"doubleDotDash",TRI_DOT_DASH:"triDotDash",NORMAL:"normal",ARROW:"arrow",RAW:"raw",FMARROW:"fmarrow",TEXTURE:"texture"},a=i;t.default=a},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(64)),o=r(n(92));fm.UniformsLib.line={linewidth:{value:1},resolution:{value:new fm.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},mmap:{value:null},offset:{value:new fm.Vector2(0,0)},repeat:{value:new fm.Vector2(1,1)},miny:{value:0},pcolor:{value:new fm.Color(11447982)}},fm.ShaderLib.line={uniforms:fm.UniformsUtils.merge([fm.UniformsLib.common,fm.UniformsLib.fog,fm.UniformsLib.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute float uvyStart;\n\t\tattribute float uvyEnd;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\t\tattribute vec2 uv2;\n\n\n\t\tvarying vec2 vUv;\n\t\tvarying vec2 vUv2;\n\t\tvarying float uvScale;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\t\t\t\n\t\t\tfloat duvy = uvyEnd - uvyStart;\n\t\t\tfloat uvy = uvyStart + duvy * uv2.y;\n\t\t\t// vUv2 = vec2(uv2.x ,uvy);\n\t\t\tvUv2 = ( position.y < 0.5 ) ? vec2(uv2.x ,uvyStart) : vec2(uv2.x ,uvyEnd);\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tfloat scaleDir = length(dir);\n\t\t\tuvScale = 0.05/scaleDir;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\t\tuniform vec2 repeat;\n\t\tuniform vec2 offset;\n\t\tuniform float miny;\n\t\tuniform vec3 pcolor;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\t\t\n\t\t\n\n\t\t\tuniform sampler2D mmap;\n\n\t\n\n\t\tvarying float vLineDistance;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying float uvScale;\n\t\tvarying vec2 vUv;\n\t\tvarying vec2 vUv2;\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\t// if ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t// \tfloat a = vUv.x;\n\t\t\t// \tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t// \tfloat len2 = a * a + b * b;\n\n\t\t\t// \tif ( len2 > 1.0 ) discard;\n\n\t\t\t// }\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t\n\t\t\t#ifdef USE_MMAP\n\t\t\t\n\t\t\t\tif(vUv2.y>miny){\t\t\t\t\n\t\t\t\tdiffuseColor = texture2D( mmap, vUv2 * repeat + offset );\n\t\t\t\t}else{\n\t\t\t\t\tdiffuseColor = vec4(pcolor,1.0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t#endif\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\tgl_FragColor = diffuseColor;\n\n\t\t\t#include <premultiplied_alpha_fragment>\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\t\t\t#include <fog_fragment>\n\n\t\t}\n\t\t"},fm.LineMaterial=function(e){fm.ShaderMaterial.call(this,{type:"LineMaterial",uniforms:fm.UniformsUtils.clone(fm.ShaderLib.line.uniforms),vertexShader:fm.ShaderLib.line.vertexShader,fragmentShader:fm.ShaderLib.line.fragmentShader}),this.dashed=!1,(0,o.default)(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}}}),this.setValues(e)},fm.LineMaterial.prototype=(0,a.default)(fm.ShaderMaterial.prototype),fm.LineMaterial.prototype.constructor=fm.LineMaterial,fm.LineMaterial.prototype.isLineMaterial=!0,fm.LineMaterial.prototype.copy=function(e){return fm.ShaderMaterial.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.resolution=e.resolution,this};var s=fm.LineMaterial;t.default=s},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(2)),s=r(n(3)),l=r(n(5)),u=r(n(6)),h=r(n(7)),c=r(n(251));function d(r){var i=f();return function(){var e,t=(0,h.default)(r),n=i?(e=(0,h.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,u.default)(this,n)}}function f(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var p=function(e){(0,l.default)(n,e);var t=d(n);function n(){var e;return(0,o.default)(this,n),e=t.call(this),e.type="LineGeometry",e.isLineGeometry=!0,e}return(0,s.default)(n,[{key:"setPositions",value:function(e){for(var t=e.length-3,n=new Float32Array(2*t),r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return this.test="ddd",(new c.default).setPositions.call(this,n),this}},{key:"setColors",value:function(e){for(var t=e.length-3,n=new Float32Array(2*t),r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return(new c.default).setColors.call(this,n),this}},{key:"fromLine",value:function(e){var t=e.geometry;return t.isGeometry?this.setPositions(t.vertices):t.isBufferGeometry&&this.setPositions(t.position.array),this}},{key:"copy",value:function(){return this}}]),n}(c.default),m=p;t.default=m},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),s=r(n(14)),l=r(n(2)),u=r(n(3)),h=r(n(5)),o=r(n(6)),c=r(n(7));function d(r){var i=f();return function(){var e,t=(0,c.default)(r),n=i?(e=(0,c.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,o.default)(this,n)}}function f(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var p=function(e){(0,h.default)(o,e);var a=d(o);function o(){var e;(0,l.default)(this,o),e=a.call(this),e.type="LineSegmentsGeometry",new fm.BufferGeometry;var t=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],n=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],r=[0,0,1,0,0,1/3,1,1/3,0,2/3,1,2/3,0,1,1,1],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];return e.isLineSegmentsGeometry=!0,e.setIndex(i),e.setAttribute("position",new fm.Float32BufferAttribute(t,3)),e.setAttribute("uv",new fm.Float32BufferAttribute(n,2)),e.setAttribute("uv2",new fm.Float32BufferAttribute(r,2)),e}return(0,u.default)(o,[{key:"applyMatrix",value:function(e){var t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==t&&(e.applyToBufferAttribute(t),e.applyToBufferAttribute(n),t.data.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}},{key:"setPositions",value:function(e){var t;e instanceof Float32Array?t=e:(0,s.default)(e)&&(t=new Float32Array(e));var n=new fm.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceStart",new fm.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceEnd",new fm.InterleavedBufferAttribute(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}},{key:"setColors",value:function(e){var t;e instanceof Float32Array?t=e:(0,s.default)(e)&&(t=new Float32Array(e));var n=new fm.InstancedInterleavedBuffer(t,6,1);return this.addAttribute("instanceColorStart",new fm.InterleavedBufferAttribute(n,3,0)),this.addAttribute("instanceColorEnd",new fm.InterleavedBufferAttribute(n,3,3)),this}},{key:"setUvys",value:function(e){var t;e instanceof Float32Array?t=e:(0,s.default)(e)&&(t=new Float32Array(e));var n=new fm.InstancedInterleavedBuffer(t,2,1);return this.addAttribute("uvyStart",new fm.InterleavedBufferAttribute(n,1,0)),this.addAttribute("uvyEnd",new fm.InterleavedBufferAttribute(n,1,1)),this}},{key:"fromWireframeGeometry",value:function(e){return this.setPositions(e.attributes.position.array),this}},{key:"fromEdgesGeometry",value:function(e){return this.setPositions(e.attributes.position.array),this}},{key:"fromMesh",value:function(e){return this.fromWireframeGeometry(new fm.WireframeGeometry(e.geometry)),this}},{key:"fromLineSegements",value:function(e){var t=e.geometry;return t.isGeometry?this.setPositions(t.vertices):t.isBufferGeometry&&this.setPositions(t.position.array),this}},{key:"computeBoundingBox",value:function(){var e=new fm.Box3;null===this.boundingBox&&(this.boundingBox=new fm.Box3);var t=this.attributes.instanceStart,n=this.attributes.instanceEnd;void 0!==t&&void 0!==n&&(this.boundingBox.setFromBufferAttribute(t),e.setFromBufferAttribute(n),this.boundingBox.union(e))}},{key:"computeBoundingSphere",value:function(){var e=new fm.Vector3;null===this.boundingSphere&&(this.boundingSphere=new fm.Sphere),null===this.boundingBox&&this.computeBoundingBox();var t=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(void 0!==t&&void 0!==n){var r=this.boundingSphere.center;this.boundingBox.getCenter(r);for(var i=0,a=0,o=t.count;a<o;a++)e.fromBufferAttribute(t,a),i=Math.max(i,r.distanceToSquared(e)),e.fromBufferAttribute(n,a),i=Math.max(i,r.distanceToSquared(e));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("fm.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}},{key:"toJSON",value:function(){}},{key:"clone",value:function(){}},{key:"copy",value:function(){return this}}]),o}(fm.InstancedBufferGeometry),m=p;t.default=m},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=function e(){(0,a.default)(this,e),this.circle,this.polygon,this.eName,this.FID,this.groupID,this.ID,this.keyword,this.name,this.typeID,this.nodeType,this.startPoint,this.pathPoints,this.bufferRadius},s=o;t.default=s},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var j=r(n(27)),W=r(n(10)),Y=r(n(14)),q=r(n(30)),X=r(n(9)),a=r(n(2)),o=r(n(3)),Z=r(n(28)),s=function(){function t(e){(0,a.default)(this,t),this._data=e,this.Graphics=new Z.default}return(0,o.default)(t,[{key:"check2",value:function(e,t,n,r,i,a,o){var s,l,u,h,c,d,f="",p="",m="";n.name&&(f=n.name),n.eName&&(p=n.eName),n.keyword&&(m=n.keyword),n.circle&&(c=n.circle),n.polygon&&(d=2<n.polygon.length?new SearchPolygon(n.polygon,!0):null);var v,g,y,_,x,w=e.name,b=e.ename,M=e.type,T=void 0===n.typeID||!(!n.typeID||!M)&&(v="number"==typeof n.typeID?[n.typeID]:n.typeID,-1<(0,X.default)(v).call(v,(0,q.default)(M))),S=!1;b&&p&&-1<(0,X.default)(s=b.toLowerCase()).call(s,p.toLowerCase())&&(S=!0),b&&m&&-1<(0,X.default)(l=b.toLowerCase()).call(l,m.toLowerCase())&&(S=!0),w&&m&&-1<(0,X.default)(u=w.toLowerCase()).call(u,m.toLowerCase())&&(S=!0),w&&f&&-1<(0,X.default)(h=w.toLowerCase()).call(h,f.toLowerCase())&&(S=!0),m||p||f||(S=!0),y=void 0===n.FID||!(!e.fid||!n.FID)&&(g=n.FID,g=(0,Y.default)(g)?(0,W.default)(g).call(g,function(e){return e.toString()}):[g.toString()],-1<(0,X.default)(g).call(g,e.fid.toString())),x=void 0===n.ID||!(!e.eid||!n.ID)&&(_=n.ID,(0,Y.default)(_)?fids=(0,W.default)(fids).call(fids,function(e){return e.toString()}):_=[_.toString()],-1<(0,X.default)(_).call(_,e.eid.toString()));var E=S&&T&&y&&x;if(E){if(c){var A=t.geo;"model"===r&&i&&(A=i);var I=A.substring(6,A.length-1).split(" "),L=(0,j.default)(I[0]),R=(0,j.default)(I[1]),N=c.center,k=Math.sqrt((L-N.x)*(L-N.x)+(R-N.y)*(R-N.y));if(k<c.radius)return o&&(o.distance=k),!0;if("model"==r){var P=0,C=null,D=this._map.getFMGroup(a).getNodeByLayerId("model",e.eid);o.target=D,D&&D._data&&(C=D._data.vertices),null==C&&(C=DataManager.convertGeo2Geometry(t.geo).vertices);for(var O=C.length/2,F=0;F<O-1;F++){var B=2*F,P=Z.default.pointDistanceToLine(N,{x:C[B],y:C[B+1]},{x:C[B+2],y:C[B+3]},{});if(P<c.radius)return o&&(o.distance=k),!0}if(Z.default.pointInPolygonVector2d(C,N,C.length))return o.distance=k,!0}return!1}if(!d)return!0;var U=t.geo;"model"===r&&i&&(U=i);var z=U.substring(6,U.length-1).split(" "),G={x:(0,j.default)(z[0]),y:(0,j.default)(z[1])};if(d.contain(G))return o.distance=d.distanceToPoint(G),!0;if("model"==r){var V=null,H=this._map.getFMGroup(a).getNodeByLayerId("model",e.eid);if(o.target=H,H&&H._data&&(V=H._data.vertices),null==V&&(V=DataManager.convertGeo2Geometry(t.geo).vertices),d.containXYArray(V))return o.distance=d.distanceToPoint(G),!0}}return!1}},{key:"check",value:function(e,t,n,r,i,a){if(void 0!==n.FID&&n.FID!==e.fid)return!1;if(void 0!==n.groupID&&n.groupID!==a)return!1;if(void 0!==n.ID&&n.ID!==e.eid)return!1;if(void 0!==n.name&&n.name!==e.name)return!1;if(void 0!==n.eName&&n.eName!==e.ename)return!1;if(void 0!==n.typeID&&n.typeID!==e.type)return!1;var o,s,l,u;if(void 0!==n.keyword)if(e.name&&e.ename){if((0,X.default)(o=e.name.toLowerCase()).call(o,n.keyword.toLowerCase())<0&&e.ename&&(0,X.default)(s=e.ename.toLowerCase()).call(s,n.keyword.toLowerCase())<0)return!1}else if(e.name&&!e.ename){if((0,X.default)(l=e.name.toLowerCase()).call(l,n.keyword.toLowerCase())<0)return!1}else if(!e.name&&e.ename){if((0,X.default)(u=e.ename.toLowerCase()).call(u,n.keyword.toLowerCase())<0)return!1}else if(!e.name&&!e.ename)return!1;return!0}},{key:"everyModel",value:function(e,t){for(var n=e.biz[0].modelLayer.length,r=0;r<n;r++)t(e.biz[0].modelLayer[r],e.geo[0].modelLayer[r],"model",e.geo[0].labelLayer[r])}},{key:"everyExternalModel",value:function(e,t){var n=e.biz[0].externalModelLayer.length,r=e.geo[0].externalModelLayer.length,i=e.geo[0].labelLayer.length;r<n&&(n=r),i<n&&(n=i);for(var a=0;a<n;a++)e.gid,t(e.biz[0].externalModelLayer[a],e.geo[0].externalModelLayer[a],"externalModel",e.geo[0].labelLayer[a])}},{key:"everyFacility",value:function(e,t){for(var n=e.biz[0].poiLayer.length,r=0;r<n;r++)t(e.biz[0].poiLayer[r],e.geo[0].poiLayer[r],"poi")}},{key:"everyLabel",value:function(e,t){for(var n=e.biz[0].labelLayer.length,r=0;r<n;r++)t(e.biz[0].labelLayer[r],e.geo[0].labelLayer[r],"label")}}]),t}(),l=s;t.default=l},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=function e(t){(0,a.default)(this,e),this._data=t},s=o;t.default=s},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(2)),s=r(n(5)),l=r(n(6)),u=r(n(7)),h=r(n(254)),c=r(n(28));function d(r){var i=f();return function(){var e,t=(0,u.default)(r),n=i?(e=(0,u.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,l.default)(this,n)}}function f(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var p=function(e){(0,s.default)(i,e);var r=d(i);function i(e,t){var n;return(0,o.default)(this,i),n=r.call(this,e),n._map=t,n.Graphics=c.default,n}return i}(h.default),m=p;t.default=m},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.Quaternion=l;var a=r(n(92)),M=r(n(200)),o=r(n(12)),s=n(114);function l(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._w=void 0!==r?r:1}(0,o.default)(l,{slerp:function(e,t,n,r){return n.copy(e).slerp(t,r)},slerpFlat:function(e,t,n,r,i,a,o){var s,l,u,h,c,d,f,p,m=n[r+0],v=n[r+1],g=n[r+2],y=n[r+3],_=i[a+0],x=i[a+1],w=i[a+2],b=i[a+3];y===b&&m===_&&v===x&&g===w||(d=1-o,s=m*_+v*x+g*w+y*b,l=0<=s?1:-1,u=1-s*s,u>M.default&&(h=Math.sqrt(u),c=Math.atan2(h,s*l),d=Math.sin(d*c)/h,o=Math.sin(o*c)/h),f=o*l,m=m*d+_*f,v=v*d+x*f,g=g*d+w*f,y=y*d+b*f,d===1-o&&(p=1/Math.sqrt(m*m+v*v+g*g+y*y),m*=p,v*=p,g*=p,y*=p)),e[t]=m,e[t+1]=v,e[t+2]=g,e[t+3]=y}}),(0,a.default)(l.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}}),(0,o.default)(l.prototype,{isQuaternion:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,r=e._y,i=e._z,a=e.order,o=Math.cos,s=Math.sin,l=o(n/2),u=o(r/2),h=o(i/2),c=s(n/2),d=s(r/2),f=s(i/2);return"XYZ"===a?(this._x=c*u*h+l*d*f,this._y=l*d*h-c*u*f,this._z=l*u*f+c*d*h,this._w=l*u*h-c*d*f):"YXZ"===a?(this._x=c*u*h+l*d*f,this._y=l*d*h-c*u*f,this._z=l*u*f-c*d*h,this._w=l*u*h+c*d*f):"ZXY"===a?(this._x=c*u*h-l*d*f,this._y=l*d*h+c*u*f,this._z=l*u*f+c*d*h,this._w=l*u*h-c*d*f):"ZYX"===a?(this._x=c*u*h-l*d*f,this._y=l*d*h+c*u*f,this._z=l*u*f-c*d*h,this._w=l*u*h+c*d*f):"YZX"===a?(this._x=c*u*h+l*d*f,this._y=l*d*h+c*u*f,this._z=l*u*f-c*d*h,this._w=l*u*h-c*d*f):"XZY"===a&&(this._x=c*u*h-l*d*f,this._y=l*d*h-c*u*f,this._z=l*u*f+c*d*h,this._w=l*u*h+c*d*f),!1!==t&&this._onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(e){var t,n=e.elements,r=n[0],i=n[4],a=n[8],o=n[1],s=n[5],l=n[9],u=n[2],h=n[6],c=n[10],d=r+s+c;return 0<d?(t=.5/Math.sqrt(d+1),this._w=.25/t,this._x=(h-l)*t,this._y=(a-u)*t,this._z=(o-i)*t):s<r&&c<r?(t=2*Math.sqrt(1+r-s-c),this._w=(h-l)/t,this._x=.25*t,this._y=(i+o)/t,this._z=(a+u)/t):c<s?(t=2*Math.sqrt(1+s-r-c),this._w=(a-u)/t,this._x=(i+o)/t,this._y=.25*t,this._z=(l+h)/t):(t=2*Math.sqrt(1+c-r-s),this._w=(o-i)/t,this._x=(a+u)/t,this._y=(l+h)/t,this._z=.25*t),this._onChangeCallback(),this},setFromUnitVectors:function(e,t){var n=1e-6,r=e.dot(t)+1;return r<n?(r=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x),this._w=r,this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs(s._Math.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,t){var n=this.angleTo(e);if(0===n)return this;var r=Math.min(1,t/n);return this.slerp(e,r),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,l=t._z,u=t._w;return this._x=n*u+a*o+r*l-i*s,this._y=r*u+a*s+i*o-n*l,this._z=i*u+a*l+n*s-r*o,this._w=a*u-n*o-r*s-i*l,this._onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,a=this._w,o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),1<=o)return this._w=a,this._x=n,this._y=r,this._z=i,this;var s=1-o*o;if(s<=M.default){var l=1-t;return this._w=l*a+t*this._w,this._x=l*n+t*this._x,this._y=l*r+t*this._y,this._z=l*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var u=Math.sqrt(s),h=Math.atan2(u,o),c=Math.sin((1-t)*h)/u,d=Math.sin(t*h)/u;return this._w=a*c+this._w*d,this._x=n*c+this._x*d,this._y=r*c+this._y*d,this._z=i*c+this._z*d,this._onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}})},function(W,e,Y){"use strict";(function(e,g){var y=Y(115);W.exports=m;var o,r=Y(568);m.ReadableState=p,Y(155).EventEmitter;var _=function(e,t){return e.listeners(t).length},i=Y(258),s=Y(157).Buffer,t=e.Uint8Array||function(){};function l(e){return s.from(e)}function a(e){return s.isBuffer(e)||e instanceof t}var n=Object.create(Y(96));n.inherits=Y(78);var u,h=Y(572),x=void 0,x=h&&h.debuglog?h.debuglog("stream"):function(){},c=Y(573),d=Y(259);n.inherits(m,i);var f=["error","close","destroy","pause","resume"];function w(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?r(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}function p(e,t){o=o||Y(70),e=e||{};var n=t instanceof o;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,i=e.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n&&(i||0===i)?i:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new c,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(u=u||Y(260).StringDecoder,this.decoder=new u(e.encoding),this.encoding=e.encoding)}function m(e){if(o=o||Y(70),!(this instanceof m))return new m(e);this._readableState=new p(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),i.call(this)}function v(e,t,n,r,i){var a,o=e._readableState;return null===t?(o.reading=!1,I(e,o)):(i||(a=M(o,t)),a?e.emit("error",a):o.objectMode||t&&0<t.length?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=l(t)),r?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):b(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!n?(t=o.decoder.write(t),o.objectMode||0!==t.length?b(e,o,t,!1):N(e,o)):b(e,o,t,!1))):r||(o.reading=!1)),T(o)}function b(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&L(e)),N(e,t)}function M(e,t){var n;return a(t)||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function T(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),m.prototype.destroy=d.destroy,m.prototype._undestroy=d.undestroy,m.prototype._destroy=function(e,t){this.push(null),t(e)},m.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=s.from(e,t),t=""),n=!0),v(this,e,t,!1,n)},m.prototype.unshift=function(e){return v(this,e,null,!0,!1)},m.prototype.isPaused=function(){return!1===this._readableState.flowing},m.prototype.setEncoding=function(e){return u=u||Y(260).StringDecoder,this._readableState.decoder=new u(e),this._readableState.encoding=e,this};var S=8388608;function E(e){return S<=e?e=S:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function A(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=E(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function I(e,t){var n;t.ended||(t.decoder&&(n=t.decoder.end(),n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)),t.ended=!0,L(e))}function L(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(x("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?y.nextTick(R,e):R(e))}function R(e){x("emit readable"),e.emit("readable"),F(e)}function N(e,t){t.readingMore||(t.readingMore=!0,y.nextTick(k,e,t))}function k(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(x("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function P(t){return function(){var e=t._readableState;x("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&_(t,"data")&&(e.flowing=!0,F(t))}}function C(e){x("readable nexttick read 0"),e.read(0)}function D(e,t){t.resumeScheduled||(t.resumeScheduled=!0,y.nextTick(O,e,t))}function O(e,t){t.reading||(x("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),F(e),t.flowing&&!t.reading&&e.read(0)}function F(e){var t=e._readableState;for(x("flow",t.flowing);t.flowing&&null!==e.read(););}function B(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=U(e,t.buffer,t.decoder),n);var n}function U(e,t,n){var r;return e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():(n?z:G)(e,t),r}function z(e,t){var n=t.head,r=1,i=n.data;for(e-=i.length;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),e-=o,0===e){o===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++r}return t.length-=r,i}function G(e,t){var n=s.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var a=r.data,o=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,o),e-=o,0===e){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++i}return t.length-=i,n}function V(e){var t=e._readableState;if(0<t.length)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,y.nextTick(H,t,e))}function H(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function j(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}m.prototype.read=function(e){x("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return x("read: emitReadable",t.length,t.ended),(0===t.length&&t.ended?V:L)(this),null;if(e=A(e,t),0===e&&t.ended)return 0===t.length&&V(this),null;var r,i=t.needReadable;return x("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&(i=!0,x("length less than watermark",i)),t.ended||t.reading?(i=!1,x("reading or ended",i)):i&&(x("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=A(n,t))),r=0<e?B(e,t):null,null===r?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&V(this)),null!==r&&this.emit("data",r),r},m.prototype._read=function(){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(n,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=n;break;case 1:i.pipes=[i.pipes,n];break;default:i.pipes.push(n)}i.pipesCount+=1,x("pipe count=%d opts=%j",i.pipesCount,e);var t=(!e||!1!==e.end)&&n!==g.stdout&&n!==g.stderr,a=t?s:v;function o(e,t){x("onunpipe"),e===r&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,h())}function s(){x("onend"),n.end()}i.endEmitted?y.nextTick(a):r.once("end",a),n.on("unpipe",o);var l=P(r);n.on("drain",l);var u=!1;function h(){x("cleanup"),n.removeListener("close",p),n.removeListener("finish",m),n.removeListener("drain",l),n.removeListener("error",f),n.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",v),r.removeListener("data",d),u=!0,!i.awaitDrain||n._writableState&&!n._writableState.needDrain||l()}var c=!1;function d(e){x("ondata"),c=!1;var t=n.write(e);!1!==t||c||((1===i.pipesCount&&i.pipes===n||1<i.pipesCount&&-1!==j(i.pipes,n))&&!u&&(x("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,c=!0),r.pause())}function f(e){x("onerror",e),v(),n.removeListener("error",f),0===_(n,"error")&&n.emit("error",e)}function p(){n.removeListener("finish",m),v()}function m(){x("onfinish"),n.removeListener("close",p),v()}function v(){x("unpipe"),r.unpipe(n)}return r.on("data",d),w(n,"error",f),n.once("close",p),n.once("finish",m),n.emit("pipe",r),i.flowing||(x("pipe resume"),r.resume()),n},m.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e=e||t.pipes,t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)r[a].emit("unpipe",this,n);return this}var o=j(t.pipes,e);return-1===o||(t.pipes.splice(o,1),--t.pipesCount,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},m.prototype.on=function(e,t){var n,r=i.prototype.on.call(this,e,t);return"data"===e?!1!==this._readableState.flowing&&this.resume():"readable"===e&&(n=this._readableState,n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&L(this):y.nextTick(C,this))),r},m.prototype.addListener=m.prototype.on,m.prototype.resume=function(){var e=this._readableState;return e.flowing||(x("resume"),e.flowing=!0,D(this,e)),this},m.prototype.pause=function(){return x("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(x("pause"),this._readableState.flowing=!1,this.emit("pause")),this},m.prototype.wrap=function(n){var e,r=this,i=this._readableState,a=!1;for(e in n.on("end",function(){var e;x("wrapped end"),i.decoder&&!i.ended&&(e=i.decoder.end(),e&&e.length&&r.push(e)),r.push(null)}),n.on("data",function(e){var t;x("wrapped data"),i.decoder&&(e=i.decoder.write(e)),i.objectMode&&null==e||(i.objectMode||e&&e.length)&&(t=r.push(e),t||(a=!0,n.pause()))}),n)void 0===this[e]&&"function"==typeof n[e]&&(this[e]=function(e){return function(){return n[e].apply(n,arguments)}}(e));for(var t=0;t<f.length;t++)n.on(f[t],this.emit.bind(this,f[t]));return this._read=function(e){x("wrapped _read",e),a&&(a=!1,n.resume())},this},Object.defineProperty(m.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),m._fromList=B}).call(this,Y(47),Y(65))},function(e,t,n){e.exports=n(155).EventEmitter},function(e,t,n){"use strict";var a=n(115);function r(e,t){var n=this,r=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return r||i?t?t(e):!e||this._writableState&&this._writableState.errorEmitted||a.nextTick(o,this,e):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(a.nextTick(o,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})),this}function i(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(e,t){e.emit("error",t)}e.exports={destroy:r,undestroy:i}},function(e,t,n){"use strict";var r=n(578).Buffer,i=r.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function o(e){var t=a(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}function s(e){var t;switch(this.encoding=o(e),this.encoding){case"utf16le":this.text=p,this.end=m,t=4;break;case"utf8":this.fillLast=c,t=4;break;case"base64":this.text=v,this.end=g,t=3;break;default:return this.write=y,void(this.end=_)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function l(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(e,t,n){var r=t.length-1;if(r<n)return 0;var i=l(t[r]);return 0<=i?(0<i&&(e.lastNeed=i-1),i):--r<n||-2===i?0:(i=l(t[r]),0<=i?(0<i&&(e.lastNeed=i-2),i):--r<n||-2===i?0:(i=l(t[r]),0<=i?(0<i&&(2===i?i=0:e.lastNeed=i-3),i):0))}function h(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(1<e.lastNeed&&1<t.length){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(2<e.lastNeed&&2<t.length&&128!=(192&t[2]))return e.lastNeed=2,"�"}}function c(e){var t=this.lastTotal-this.lastNeed,n=h(this,e,t);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function d(e,t){var n=u(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function p(e,t){if((e.length-t)%2!=0)return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1);var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(55296<=r&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}function m(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function v(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function g(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function y(e){return e.toString(this.encoding)}function _(e){return e&&e.length?this.write(e):""}t.StringDecoder=s,s.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(t=this.fillLast(e),void 0===t)return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},s.prototype.end=f,s.prototype.text=d,s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";e.exports=o;var r=n(70),i=Object.create(n(96));function a(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);r.call(this,e),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var n=this;"function"==typeof this._flush?this._flush(function(e,t){l(n,e,t)}):l(this,null,null)}function l(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=n(78),i.inherits(o,r),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,t)},o.prototype._transform=function(){throw new Error("_transform() is not implemented")},o.prototype._write=function(e,t,n){var r,i=this._transformState;i.writecb=n,i.writechunk=e,i.writeencoding=t,i.transforming||(r=this._readableState,(i.needTransform||r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark))},o.prototype._read=function(){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},o.prototype._destroy=function(e,t){var n=this;r.prototype._destroy.call(this,e,function(e){t(e),n.emit("close")})}},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(14)),o=r(n(31)),u=r(n(12)),s=r(n(33)),l=r(n(2)),h=r(n(3)),c=r(n(28)),d=r(n(138)),f=r(n(113)),p=r(n(68)),m=r(n(95)),v=r(n(160)),g=r(n(69)),y=r(n(585));n(41);var _=function(){function t(e){(0,l.default)(this,t),this._options={},this._navi=null,this._naviResults=[],"function"==typeof d.default&&e instanceof d.default&&(this._map=null,this.init(e)),this._endDoor=null}return(0,h.default)(t,[{key:"routePassingPoints",value:function(e,t){var n=this._navi.routePassingPoints(e,t);n==g.default.ROUTE_SUCCESS?(this._naviResults=this._navi.getRouteResult(),this.failedInsertedPts=this._navi.failedInsertedPts):this._naviResults=[]}},{key:"analyzeNavi",value:function(e,t,n,r,i,a){var o=this._navi.route(e,t,n,r,i||p.default.MODULE_SHORTEST,a||m.default.PRIORITY_DEFAULT);return o==g.default.ROUTE_SUCCESS?(this._naviResults=this._navi.getRouteResult(),this._endDoor=this._navi._endDoor):this._naviResults=[],o}},{key:"init",value:function(e){this._map=e,this._navi=new y.default({}),this._navi.initByMap(e)}},{key:"initByScene",value:function(e){this._navi=new y.default({}),this._navi.initByScene(e)}},{key:"dispose",value:function(){this._map=null;for(var e=0;e<this._naviResults.length;e++){var t=this._naviResults[e];t.dispose(),t=null}this._naviResults=[],this._navi&&(this._navi.dispose(),this._navi=null)}},{key:"assignInfos",value:function(e){this._navi._assignedInfos=e,this._navi.routeAssigned(),this._naviResults=this._navi.getRouteResult()}},{key:"getNaviResults",value:function(){return this._naviResults}},{key:"getNaviResult",value:function(){return this.getNaviResults()}},{key:"getRouteAllPoints",value:function(e){var t=e||this._naviResults;if(!this._isNaviResultsValide(t))return[];var n,r=[];for(n in t)t[n].getPointList&&r.push.apply(r,(0,s.default)(t[n].getPointList()));return r}},{key:"getRouteLineSegments",value:function(e){var t=e||this._naviResults;if(!this._isNaviResultsValide(t))return[];for(var n=[],r=0;r<t.length;r++){var i=t[r],a=i.groupId,o=i.pointList,s=new f.default;s.groupId=a,s.points=[];for(var l=0;l<o.length;l++)s.points.push((0,u.default)({},o[l]));n.push(s)}return n}},{key:"getRouteDistance",value:function(e){var t=e||this._naviResults;if(!this._isNaviResultsValide(t))return 0;var n=this.getRouteAllPoints(t);if(0==n.length)return 0;for(var r=0,i=0;i<n.length-1;i++)r+=c.default.distanceOfTwoPoints(n[i],n[i+1]);return r}},{key:"getRouteGroupIds",value:function(e){var t=e||this._naviResults;if(!this._isNaviResultsValide(t))return[];var n,r=[];for(n in t)!t[n].groupId||0!=n&&r[r.length-1]==t[n].groupId||r.push(t[n].groupId);return r}},{key:"getRouteGroupPoints",value:function(e,t){var n=t||this._naviResults;if(!this._isNaviResultsValide(n))return[];var r,i=[];for(r in n)n[r].groupId&&n[r].groupId==e&&(i=(0,o.default)(i).call(i,n[r].getPointList()));return i}},{key:"pathConstraint",value:function(e,t){return this._navi?this._navi.pathConstraint(e,t):null}},{key:"_getNaviResults",value:function(e){for(var t,n=[],r=0;r<e.length;r++)null!=e[r].groupId&&(t=new v.default(e[r].groupId,e[r].length,e[r].pointVector,e[r].nodeVector),n.push(t));return n}},{key:"_isNaviResultsValide",value:function(e){if(!(0,a.default)(e))return!1;if(0==e.length)return!1;for(var t=0;t<e.length;t++)if(!e[t]instanceof v.default)return!1;return!0}},{key:"navi",get:function(){this._navi}},{key:"passPts",set:function(e){this._navi.passPts=e}},{key:"naviToDoor",set:function(e){this._navi.naviToDoor=e},get:function(){return this._navi.naviToDoor}},{key:"losedPoints",get:function(){return this._navi.failedInsertedPts}}]),t}(),x=_;t.default=x},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=r(n(28)),l=r(n(153)),u=function(){function i(e,t,n,r){(0,a.default)(this,i),this.Id=e,this.groupId=t,this._type=n,this.points=r,this.pointCount=r&&r.length?r.length:0,this._level=-1,this.inId=0,this._parent=null,this._child=null,this._brothers=[],this._linkAccessNodes=[],this._area=null,this.bb=new l.default,this.refreshBB()}return(0,o.default)(i,[{key:"contain",value:function(e){return s.default.pointInPolygon2d1(this.points,e,this.points.length-1)}},{key:"calcCrossPoint",value:function(e,t){for(var n={},r=0;r<this.pointCount;r++){var i=this.points[r],a=this.points[(r+1)%this.pointCount];if(1==s.default.calcCrossPoint(i,a,e,t,n))break}return n}},{key:"refreshBB",value:function(){this.bb.init();for(var e=0;e<this.pointCount;e++)this.bb.expandBy({x:this.points[e].x,y:this.points[e].y})}},{key:"pass",get:function(){return 3&this._type},set:function(e){this._type|=e}},{key:"level",set:function(e){this._level=31&e},get:function(){return 31&this._level}},{key:"area",get:function(){return this._area||(this._area=s.default.calcPolygonArea2d()),this._area}}]),i}(),h=u;t.default=h},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(56)),s=function e(){(0,a.default)(this,e),this.cross=null,this.road=null,this.model=null,this.distance=0,this.toDistance=0,this.stickToRoad=!1,this.obstructType=o.default.NaviObstructType_MODEL},l=s;t.default=l},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(15)),o=r(n(2)),s=r(n(3)),l=r(n(598)),f=function(){function t(e){(0,o.default)(this,t),this._wayPoints=e||[]}return(0,s.default)(t,[{key:"drop",value:function(e){for(var t,n=-1,r=0;r<this._wayPoints.length;r++)if(this[r]==e){n=r;break}n<0||(0,a.default)(t=this._wayPoints).call(t,n,1)}},{key:"cloneDrop",value:function(e){for(var t=[],n=0;n<this._wayPoints.length;n++)t.push(this._wayPoints[n]);for(var r=-1,i=0;i<t.length;i++)if(t[i]==e){r=i;break}if(!(r<0))return(0,a.default)(t).call(t,r,1),t}},{key:"toArray",value:function(){for(var e=[],t=0;t<this._wayPoints.length;t++)e.push(this._wayPoints[t]);return e}},{key:"len",value:function(){return this._wayPoints.length}}]),t}(),u=function(){function t(e){(0,o.default)(this,t),0!=e.length&&(this._adjTable=new l.default(e))}return(0,s.default)(t,[{key:"setSId",value:function(e){return this._sId=e,this}},{key:"setEId",value:function(e){return this._eId=e,this}},{key:"setWayNodes",value:function(e){return this._wayPoints=e,this}},{key:"route",value:function(){this._result=this._route(this._sId,this._eId,this._wayPoints)}},{key:"getResult",value:function(){return this._result}},{key:"_route",value:function(e,t,n){if(0==n.length){if(e==t)return{route:[e],dist:0};var r=this._adjTable.lookup(e,t);if(null!=r)return{route:[e,t],dist:r};var i=this._adjTable.enhance(e,t,this._wayPoints);return{route:[e,i.transit,t],dist:i.dist}}for(var a=new f(n),o=a.toArray(),s=Infinity,l=[],u=0;u<a.len();u++){var h,c=o[u],d=this._route(e,c,a.cloneDrop(c));null!=d.dist&&(h=this._adjTable.lookup(c,t),null==h?(i=this._adjTable.enhance(c,t,this._wayPoints),h=i.dist,h+d.dist<s&&(s=h+d.dist,d.route.push(i.transit),d.route.push(t),l=d.route)):h+d.dist<s&&(s=h+d.dist,d.route.push(t),l=d.route))}return{route:l,dist:s}}}]),t}(),h=u;t.default=h},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.SmallQueue=u,t.Queue=void 0;var a=r(n(13)),o=r(n(2)),s=r(n(3)),l=function(){function e(){(0,o.default)(this,e),this.items=[]}return(0,s.default)(e,[{key:"enqueue",value:function(e){this.items.push(e)}},{key:"dequeue",value:function(){return this.isEmpty()?"Underflow":this.items.shift()}},{key:"front",value:function(){return this.isEmpty()?"No elements in Queue":this.items[0]}},{key:"isEmpty",value:function(){return 0==this.items.length}},{key:"printQueue",value:function(){for(var e="",t=0;t<this.items.length;t++)e+=this.items[t]+" ";return e}}]),e}();function u(){var t=[],n=0;this.getLength=function(){return t.length-n},this.isEmpty=function(){return 0==t.length},this.enqueue=function(e){t.push(e)},this.dequeue=function(){if(0!=t.length){var e=t[n];return 2*++n>=t.length&&(t=(0,a.default)(t).call(t,n),n=0),e}},this.peek=function(){return 0<t.length?t[n]:void 0}}t.Queue=l},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(270),n(436),n(438),n(459);var a=r(n(138)),o=r(n(243)),s=r(n(213)),l=r(n(37)),u=r(n(246)),h=r(n(221)),c=r(n(217)),d=r(n(219)),f=r(n(536)),p=r(n(247)),m=r(n(248)),v=r(n(151)),g=r(n(113)),y=r(n(540)),_=r(n(223)),x=r(n(242)),w=r(n(227)),b=r(n(225)),M=r(n(224)),T=r(n(544)),S=r(n(545)),E=r(n(252)),A=r(n(68)),I=r(n(555)),L=r(n(95)),R=r(n(556)),N=r(n(66)),k=r(n(206)),P=r(n(69)),C=r(n(152)),D=r(n(218)),O=r(n(215)),F=r(n(220)),B=r(n(214)),U=r(n(211)),z=r(n(17)),G=r(n(557)),V=r(n(558)),H=r(n(241)),j=r(n(149)),W=r(n(244)),Y=r(n(28)),q=r(n(147)),X=r(n(45)),Z=r(n(41)),J=r(n(56)),K=r(n(148)),Q=r(n(153)),$=r(n(559)),ee=r(n(262));n(603);var te,ne={VERSION:H.default.VERSION,BUILD:H.default.BUILD,Map:a.default,FMMap:a.default,MapUtil:o.default,FMViewMode:R.default,FMDynamicModel:x.default,FMDynamicModelLayer:w.default,FMLanguageType:N.default,FMNodeType:l.default,FMImageMarker:u.default,FMTextMarker:f.default,FMLocationMarker:p.default,FMLineMarker:v.default,FMExtentLayer:s.default,FMSegment:g.default,FMPolygonMarker:y.default,FMPolygonMarkerLayer:_.default,FMImageMarkerLayer:h.default,FMLabelLayer:c.default,FMFacilityLayer:d.default,FMHeatMapLayer:b.default,FMHeatMap:T.default,FMSearchRequest:E.default,FMSearchAnalyser:S.default,FMLineType:m.default,FMNaviModule:A.default,FMNaviMode:A.default,FMTextAlign:I.default,FMNaviPriority:L.default,FMRouteCalcuResult:P.default,FMMapCoord:C.default,FMGroup:U.default,FMLabel:D.default,FMStoreModel:O.default,FMElement:B.default,FMExternalModel:B.default,FMFacility:F.default,FMNode:z.default,FMDirection:k.default,FMScreenCoord:G.default,FMTextMarkerLayer:M.default,FMMapCoordTransformer:V.default,MapCoordTransform:V.default,FMMarkerAnchor:j.default,FMRenderer:W.default,inner:{Graphics:Y.default,FMSegment:g.default,FMNaviMode:A.default,FMNaviPriority:L.default,FMRouteCalcuResult:P.default,EventDispatcher:q.default,DataManager:X.default,FMUtil:Z.default,FMImageMarker:u.default,FMLocationMarker:p.default,FMLanguageType:N.default,NaviDataType:J.default,NaviService:K.default,FMMapCoord:C.default,BoundingBox:Q.default}},re={FMNaviAnalyser:ee.default,FMNaviMode:A.default,FMNavigation:$.default,FMNaviPriority:L.default};for(te in re)re.hasOwnProperty(te)&&(ne[te]=re[te]);var ie=ne;t.default=ie},function(e,t,n){var r=n(164);e.exports=r},function(e,t,n){var r=n(8),i=n(29),a=n(39);r({target:"Object",stat:!0,forced:!i,sham:!i},{defineProperty:a.f})},function(t,e,n){(function(e){t.exports=e.fm=n(271)}).call(this,n(47))},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.AmbientLight=tm,t.AmbientLightProbe=Sm,t.AnimationClip=ep,t.AnimationLoader=up,t.AnimationMixer=sv,t.AnimationObjectGroup=av,t.ArcCurve=gp,t.ArrayCamera=rc,t.ArrowHelper=Jv,t.Audio=Dm,t.AudioAnalyser=Gm,t.AudioListener=Cm,t.AudioLoader=wm,t.AxesHelper=Kv,t.AxisHelper=hy,t.BinaryTextureLoader=my,t.Bone=Dc,t.BooleanKeyframeTrack=qf,t.BoundingBoxHelper=cy,t.Box2=vv,t.Box3=Ri,t.Box3Helper=Wv,t.BoxHelper=jv,t.BufferAttribute=ma,t.BufferGeometry=Ca,t.BufferGeometryLoader=sm,t.Camera=mo,t.CameraHelper=Gv,t.CanvasRenderer=yy,t.CanvasTexture=sd,t.CatmullRomCurve3=Mp,t.CircleBufferGeometry=If,t.CircleGeometry=Af,t.Clock=Lm,t.ClosedSplineCurve3=sy,t.Color=oa,t.ColorKeyframeTrack=Xf,t.CompressedTexture=od,t.CompressedTextureLoader=hp,t.ConeBufferGeometry=Ef,t.ConeGeometry=Sf,t.CubeCamera=_o,t.CubeTexture=lu,t.CubeTextureLoader=fp,t.CubicBezierCurve=Cp,t.CubicBezierCurve3=Dp,t.CubicInterpolant=Hf,t.Curve=mp,t.CurvePath=Vp,t.CylinderBufferGeometry=Tf,t.CylinderGeometry=Mf,t.Cylindrical=pv,t.DataTexture=wo,t.DataTexture2DArray=uu,t.DataTexture3D=hu,t.DataTextureLoader=cp,t.DepthTexture=ld,t.DirectionalLight=em,t.DirectionalLightHelper=Bv,t.DirectionalLightShadow=$p,t.DiscreteInterpolant=Wf,t.DodecahedronBufferGeometry=wd,t.DodecahedronGeometry=xd,t.DynamicBufferAttribute=Kg,t.EdgesGeometry=bf,t.EdgesHelper=dy,t.EllipseCurve=vp,t.Euler=ei,t.EventDispatcher=Ar,t.ExtrudeBufferGeometry=lf,t.ExtrudeGeometry=sf,t.Face3=ha,t.Face4=Og,t.FileLoader=lp,t.Float32Attribute=ay,t.Float32BufferAttribute=Ma,t.Float64Attribute=oy,t.Float64BufferAttribute=Ta,t.Fog=lc,t.FogExp2=sc,t.Font=vm,t.FontLoader=_m,t.Frustum=To,t.Geometry=ao,t.GridHelper=Pv,t.Group=ic,t.HemisphereLight=Yp,t.HemisphereLightHelper=kv,t.HemisphereLightProbe=Tm,t.IcosahedronBufferGeometry=_d,t.IcosahedronGeometry=yd,t.ImageBitmapLoader=pm,t.ImageLoader=dp,t.ImmediateRenderObject=xv,t.InstancedBufferAttribute=om,t.InstancedBufferGeometry=am,t.InstancedInterleavedBuffer=uv,t.InstancedMesh=zc,t.Int16Attribute=ty,t.Int16BufferAttribute=_a,t.Int32Attribute=ry,t.Int32BufferAttribute=wa,t.Int8Attribute=Qg,t.Int8BufferAttribute=va,t.InterleavedBuffer=uc,t.InterleavedBufferAttribute=dc,t.Interpolant=Vf,t.JSONLoader=_y,t.KeyframeTrack=Yf,t.LOD=Rc,t.LatheBufferGeometry=yf,t.LatheGeometry=gf,t.Layers=ti,t.LensFlare=wy,t.Light=Wp,t.LightProbe=Mm,t.LightShadow=qp,t.Line=qc,t.Line3=_v,t.LineBasicMaterial=Gc,t.LineCurve=Op,t.LineCurve3=Fp,t.LineDashedMaterial=Uf,t.LineLoop=Kc,t.LineSegments=Jc,t.LinearInterpolant=jf,t.Loader=op,t.LoadingManager=ip,t.Material=da,t.MaterialLoader=rm,t.Matrix3=Pr,t.Matrix4=Kr,t.Mesh=Qa,t.MeshBasicMaterial=fa,t.MeshDepthMaterial=Zh,t.MeshDistanceMaterial=Jh,t.MeshFaceMaterial=Vg,t.MeshLambertMaterial=Ff,t.MeshMatcapMaterial=Bf,t.MeshNormalMaterial=Of,t.MeshPhongMaterial=Cf,t.MeshPhysicalMaterial=Pf,t.MeshStandardMaterial=kf,t.MeshToonMaterial=Df,t.MultiMaterial=Hg,t.NumberKeyframeTrack=Zf,t.Object3D=mi,t.ObjectLoader=um,t.OctahedronBufferGeometry=gd,t.OctahedronGeometry=vd,t.OrthographicCamera=Qp,t.PMREMGenerator=_g,t.ParametricBufferGeometry=cd,t.ParametricGeometry=hd,t.Particle=Wg,t.ParticleBasicMaterial=Xg,t.ParticleSystem=Yg,t.ParticleSystemMaterial=Zg,t.Path=Hp,t.PerspectiveCamera=vo,t.Plane=Wi,t.PlaneBufferGeometry=Lo,t.PlaneGeometry=Io,t.PlaneHelper=Yv,t.PointCloud=jg,t.PointCloudMaterial=qg,t.PointLight=Kp,t.PointLightHelper=Iv,t.Points=rd,t.PointsMaterial=Qc,t.PolarGridHelper=Cv,t.PolyhedronBufferGeometry=fd,t.PolyhedronGeometry=dd,t.PositionalAudio=zm,t.PropertyBinding=iv,t.PropertyMixer=Vm,t.QuadraticBezierCurve=Bp,t.QuadraticBezierCurve3=Up,t.Quaternion=zr,t.QuaternionKeyframeTrack=Kf,t.QuaternionLinearInterpolant=Jf,t.RawShaderMaterial=Nf,t.Ray=Gi,t.Raycaster=hv,t.RectAreaLight=nm,t.RingBufferGeometry=vf,t.RingGeometry=mf,t.Scene=vi,t.ShaderMaterial=po,t.ShadowMaterial=Rf,t.Shape=jp,t.ShapeBufferGeometry=xf,t.ShapeGeometry=_f,t.ShapePath=mm,t.Skeleton=Cc,t.SkeletonHelper=Av,t.SkinnedMesh=Nc,t.Sphere=Pi,t.SphereBufferGeometry=pf,t.SphereGeometry=ff,t.Spherical=fv,t.SphericalHarmonics3=bm,t.Spline=uy,t.SplineCurve=zp,t.SplineCurve3=ly,t.SpotLight=Zp,t.SpotLightHelper=bv,t.SpotLightShadow=Xp,t.Sprite=Ec,t.SpriteMaterial=fc,t.StereoCamera=Im,t.StringKeyframeTrack=Qf,t.TetrahedronBufferGeometry=md,t.TetrahedronGeometry=pd,t.TextBufferGeometry=df,t.TextGeometry=cf,t.Texture=Or,t.TextureLoader=pp,t.TorusBufferGeometry=Ad,t.TorusGeometry=Ed,t.TorusKnotBufferGeometry=Sd,t.TorusKnotGeometry=Td,t.Triangle=na,t.TubeBufferGeometry=Md,t.TubeGeometry=bd,t.Uint16Attribute=ny,t.Uint16BufferAttribute=xa,t.Uint32Attribute=iy,t.Uint32BufferAttribute=ba,t.Uint8Attribute=$g,t.Uint8BufferAttribute=ga,t.Uint8ClampedAttribute=ey,t.Uint8ClampedBufferAttribute=ya,t.Uniform=lv,t.Vector2=kr,t.Vector3=Hr,t.Vector4=Fr,t.VectorKeyframeTrack=$f,t.Vertex=Jg,t.VideoTexture=ad,t.WebGLCubeRenderTarget=xo,t.WebGLMultisampleRenderTarget=Ur,t.WebGLRenderTarget=Br,t.WebGLRenderTargetCube=vy,t.WebGLRenderer=oc,t.WebGLUtils=nc,t.WireframeGeometry=ud,t.WireframeHelper=fy,t.XHRLoader=py,t.NeverDepth=t.NearestMipmapNearestFilter=t.NearestMipmapLinearFilter=t.NearestMipMapNearestFilter=t.NearestMipMapLinearFilter=t.NearestFilter=t.MultiplyOperation=t.MultiplyBlending=t.MixOperation=t.MirroredRepeatWrapping=t.MinEquation=t.MaxEquation=t.MathUtils=t.Math=t.MOUSE=t.LuminanceFormat=t.LuminanceAlphaFormat=t.LoopRepeat=t.LoopPingPong=t.LoopOnce=t.LogLuvEncoding=t.LoaderUtils=t.LinearToneMapping=t.LinearMipmapNearestFilter=t.LinearMipmapLinearFilter=t.LinearMipMapNearestFilter=t.LinearMipMapLinearFilter=t.LinearFilter=t.LinearEncoding=t.LineStrip=t.LinePieces=t.LessStencilFunc=t.LessEqualStencilFunc=t.LessEqualDepth=t.LessDepth=t.KeepStencilOp=t.InvertStencilOp=t.InterpolateSmooth=t.InterpolateLinear=t.InterpolateDiscrete=t.IntType=t.IncrementWrapStencilOp=t.IncrementStencilOp=t.ImageUtils=t.HalfFloatType=t.GreaterStencilFunc=t.GreaterEqualStencilFunc=t.GreaterEqualDepth=t.GreaterDepth=t.GeometryUtils=t.GammaEncoding=t.FrontSide=t.FrontFaceDirectionCW=t.FrontFaceDirectionCCW=t.FloatType=t.FlatShading=t.FaceColors=t.EquirectangularRefractionMapping=t.EquirectangularReflectionMapping=t.EqualStencilFunc=t.EqualDepth=t.DynamicReadUsage=t.DynamicDrawUsage=t.DynamicCopyUsage=t.DstColorFactor=t.DstAlphaFactor=t.DoubleSide=t.DepthStencilFormat=t.DepthFormat=t.DefaultLoadingManager=t.DecrementWrapStencilOp=t.DecrementStencilOp=t.CustomBlending=t.CullFaceNone=t.CullFaceFrontBack=t.CullFaceFront=t.CullFaceBack=t.CubeUVRefractionMapping=t.CubeUVReflectionMapping=t.CubeRefractionMapping=t.CubeReflectionMapping=t.ClampToEdgeWrapping=t.CineonToneMapping=t.Cache=t.ByteType=t.CubeGeometry=t.BoxGeometry=t.BoxBufferGeometry=t.BasicShadowMap=t.BasicDepthPacking=t.BackSide=t.AudioContext=t.AnimationUtils=t.AlwaysStencilFunc=t.AlwaysDepth=t.AlphaFormat=t.AdditiveBlending=t.AddOperation=t.AddEquation=t.ACESFilmicToneMapping=void 0,t.UniformsLib=t.Uncharted2ToneMapping=t.UVMapping=t.TrianglesDrawMode=t.TriangleStripDrawMode=t.TriangleFanDrawMode=t.TangentSpaceNormalMap=t.TOUCH=t.SubtractiveBlending=t.SubtractEquation=t.StreamReadUsage=t.StreamDrawUsage=t.StreamCopyUsage=t.StaticReadUsage=t.StaticDrawUsage=t.StaticCopyUsage=t.SrcColorFactor=t.SrcAlphaSaturateFactor=t.SrcAlphaFactor=t.SphericalReflectionMapping=t.SmoothShading=t.ShortType=t.ShapeUtils=t.ShaderLib=t.ShaderChunk=t.SceneUtils=t.SRGB8_ALPHA8_ASTC_8x8_Format=t.SRGB8_ALPHA8_ASTC_8x6_Format=t.SRGB8_ALPHA8_ASTC_8x5_Format=t.SRGB8_ALPHA8_ASTC_6x6_Format=t.SRGB8_ALPHA8_ASTC_6x5_Format=t.SRGB8_ALPHA8_ASTC_5x5_Format=t.SRGB8_ALPHA8_ASTC_5x4_Format=t.SRGB8_ALPHA8_ASTC_4x4_Format=t.SRGB8_ALPHA8_ASTC_12x12_Format=t.SRGB8_ALPHA8_ASTC_12x10_Format=t.SRGB8_ALPHA8_ASTC_10x8_Format=t.SRGB8_ALPHA8_ASTC_10x6_Format=t.SRGB8_ALPHA8_ASTC_10x5_Format=t.SRGB8_ALPHA8_ASTC_10x10_Format=t.ReverseSubtractEquation=t.ReplaceStencilOp=t.RepeatWrapping=t.ReinhardToneMapping=t.RedIntegerFormat=t.RedFormat=t.RGIntegerFormat=t.RGFormat=t.RGB_S3TC_DXT1_Format=t.RGB_PVRTC_4BPPV1_Format=t.RGB_PVRTC_2BPPV1_Format=t.RGB_ETC2_Format=t.RGB_ETC1_Format=t.RGBM7Encoding=t.RGBM16Encoding=t.RGBIntegerFormat=t.RGBFormat=t.RGBEFormat=t.RGBEEncoding=t.RGBDEncoding=t.RGBA_S3TC_DXT5_Format=t.RGBA_S3TC_DXT3_Format=t.RGBA_S3TC_DXT1_Format=t.RGBA_PVRTC_4BPPV1_Format=t.RGBA_PVRTC_2BPPV1_Format=t.RGBA_ETC2_EAC_Format=t.RGBA_BPTC_Format=t.RGBA_ASTC_8x8_Format=t.RGBA_ASTC_8x6_Format=t.RGBA_ASTC_8x5_Format=t.RGBA_ASTC_6x6_Format=t.RGBA_ASTC_6x5_Format=t.RGBA_ASTC_5x5_Format=t.RGBA_ASTC_5x4_Format=t.RGBA_ASTC_4x4_Format=t.RGBA_ASTC_12x12_Format=t.RGBA_ASTC_12x10_Format=t.RGBA_ASTC_10x8_Format=t.RGBA_ASTC_10x6_Format=t.RGBA_ASTC_10x5_Format=t.RGBA_ASTC_10x10_Format=t.RGBAIntegerFormat=t.RGBAFormat=t.RGBADepthPacking=t.REVISION=t.PCFSoftShadowMap=t.PCFShadowMap=t.OneMinusSrcColorFactor=t.OneMinusSrcAlphaFactor=t.OneMinusDstColorFactor=t.OneMinusDstAlphaFactor=t.OneFactor=t.ObjectSpaceNormalMap=t.NotEqualStencilFunc=t.NotEqualDepth=t.NormalBlending=t.NoToneMapping=t.NoColors=t.NoBlending=t.NeverStencilFunc=void 0,t.sRGBEncoding=t.ZeroStencilOp=t.ZeroSlopeEnding=t.ZeroFactor=t.ZeroCurvatureEnding=t.WrapAroundEnding=t.VertexColors=t.VSMShadowMap=t.UnsignedShortType=t.UnsignedShort565Type=t.UnsignedShort5551Type=t.UnsignedShort4444Type=t.UnsignedIntType=t.UnsignedInt248Type=t.UnsignedByteType=t.UniformsUtils=void 0;var a,x=r(n(272)),o=r(n(49)),d=r(n(18)),s=r(n(288)),y=r(n(75)),_=r(n(60)),g=r(n(127)),l=r(n(302)),ie=r(n(31)),ae=r(n(54)),A=r(n(36)),I=r(n(186)),ne=r(n(62)),pe=r(n(133)),U=r(n(195)),z=r(n(351)),re=r(n(135)),h=r(n(91)),u=r(n(4)),c=r(n(2)),f=r(n(5)),p=r(n(6)),m=r(n(7)),je=r(n(32)),v=r(n(55)),We=r(n(10)),w=r(n(30)),me=r(n(27)),b=r(n(63)),Ye=r(n(14)),M=r(n(110)),T=r(n(64)),S=r(n(92)),E=r(n(13)),L=r(n(15)),ve=r(n(9)),qe=r(n(12)),R=r(n(0)),oe=r(n(423)),N=r(n(428)),se=r(n(200));function k(r){var i=P();return function(){var e,t=(0,m.default)(r),n=i?(e=(0,m.default)(this).constructor,(0,u.default)(t,arguments,e)):t.apply(this,arguments);return(0,p.default)(this,n)}}function P(){if("undefined"==typeof Reflect||!u.default)return!1;if(u.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,u.default)(Date,[],function(){})),!0}catch(e){return!1}}void 0===se.default&&(Number.EPSILON=Math.pow(2,-52)),void 0===N.default&&(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===oe.default&&(Math.sign=function(e){return e<0?-1:0<e?1:+e}),"name"in Function.prototype==0&&(0,R.default)(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===qe.default&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t});var C="115";t.REVISION=C;var D={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2};t.MOUSE=D;var O={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3};t.TOUCH=O;var ge=0;t.CullFaceNone=ge;var ye=1;t.CullFaceBack=ye;var _e=2;t.CullFaceFront=_e;var F=3;t.CullFaceFrontBack=F;var B=0;t.FrontFaceDirectionCW=B;var G=1;t.FrontFaceDirectionCCW=G;var V=0;t.BasicShadowMap=V;var H=1;t.PCFShadowMap=H;var j=2;t.PCFSoftShadowMap=j;var W=3;t.VSMShadowMap=W;var Y=0;t.FrontSide=Y;var Xe=1;t.BackSide=Xe;var xe=2;t.DoubleSide=xe;var q=1;t.FlatShading=q;var X=2;t.SmoothShading=X;var we=0;t.NoBlending=we;var be=1;t.NormalBlending=be;var Me=2;t.AdditiveBlending=Me;var Te=3;t.SubtractiveBlending=Te;var Se=4;t.MultiplyBlending=Se;var Ee=5;t.CustomBlending=Ee;var Ae=100;t.AddEquation=Ae;var Ie=101;t.SubtractEquation=Ie;var Le=102;t.ReverseSubtractEquation=Le;var Re=103;t.MinEquation=Re;var Ne=104;t.MaxEquation=Ne;var ke=200;t.ZeroFactor=ke;var Pe=201;t.OneFactor=Pe;var Ce=202;t.SrcColorFactor=Ce;var De=203;t.OneMinusSrcColorFactor=De;var Oe=204;t.SrcAlphaFactor=Oe;var Fe=205;t.OneMinusSrcAlphaFactor=Fe;var Be=206;t.DstAlphaFactor=Be;var Ue=207;t.OneMinusDstAlphaFactor=Ue;var ze=208;t.DstColorFactor=ze;var Ge=209;t.OneMinusDstColorFactor=Ge;var Ve=210;t.SrcAlphaSaturateFactor=Ve;var He=0;t.NeverDepth=He;var Ze=1;t.AlwaysDepth=Ze;var Je=2;t.LessDepth=Je;var Ke=3;t.LessEqualDepth=Ke;var Qe=4;t.EqualDepth=Qe;var $e=5;t.GreaterEqualDepth=$e;var et=6;t.GreaterDepth=et;var tt=7;t.NotEqualDepth=tt;var Z=0;t.MultiplyOperation=Z;var J=1;t.MixOperation=J;var K=2;t.AddOperation=K;var Q=0;t.NoToneMapping=Q;var nt=1;t.LinearToneMapping=nt;var $=2;t.ReinhardToneMapping=$;var ee=3;t.Uncharted2ToneMapping=ee;var te=4;t.CineonToneMapping=te;var le=5;t.ACESFilmicToneMapping=le;var ue=300;t.UVMapping=ue;var he=301;t.CubeReflectionMapping=he;var ce=302;t.CubeRefractionMapping=ce;var de=303;t.EquirectangularReflectionMapping=de;var fe=304;t.EquirectangularRefractionMapping=fe;var rt=305;t.SphericalReflectionMapping=rt;var it=306;t.CubeUVReflectionMapping=it;var at=307;t.CubeUVRefractionMapping=at;var ot=1e3;t.RepeatWrapping=ot;var st=1001;t.ClampToEdgeWrapping=st;var lt=1002;t.MirroredRepeatWrapping=lt;var ut=1003;t.NearestFilter=ut;var ht=1004;t.NearestMipmapNearestFilter=ht;var ct=1004;t.NearestMipMapNearestFilter=ct;var dt=1005;t.NearestMipmapLinearFilter=dt;var ft=1005;t.NearestMipMapLinearFilter=ft;var pt=1006;t.LinearFilter=pt;var mt=1007;t.LinearMipmapNearestFilter=mt;var vt=1007;t.LinearMipMapNearestFilter=vt;var gt=1008;t.LinearMipmapLinearFilter=gt;var yt=1008;t.LinearMipMapLinearFilter=yt;var _t=1009;t.UnsignedByteType=_t;var xt=1010;t.ByteType=xt;var wt=1011;t.ShortType=wt;var bt=1012;t.UnsignedShortType=bt;var Mt=1013;t.IntType=Mt;var Tt=1014;t.UnsignedIntType=Tt;var St=1015;t.FloatType=St;var Et=1016;t.HalfFloatType=Et;var At=1017;t.UnsignedShort4444Type=At;var It=1018;t.UnsignedShort5551Type=It;var Lt=1019;t.UnsignedShort565Type=Lt;var Rt=1020;t.UnsignedInt248Type=Rt;var Nt=1021;t.AlphaFormat=Nt;var kt=1022;t.RGBFormat=kt;var Pt=1023;t.RGBAFormat=Pt;var Ct=1024;t.LuminanceFormat=Ct;var Dt=1025;t.LuminanceAlphaFormat=Dt;var Ot=Pt;t.RGBEFormat=Ot;var Ft=1026;t.DepthFormat=Ft;var Bt=1027;t.DepthStencilFormat=Bt;var Ut=1028;t.RedFormat=Ut;var zt=1029;t.RedIntegerFormat=zt;var Gt=1030;t.RGFormat=Gt;var Vt=1031;t.RGIntegerFormat=Vt;var Ht=1032;t.RGBIntegerFormat=Ht;var jt=1033;t.RGBAIntegerFormat=jt;var Wt=33776;t.RGB_S3TC_DXT1_Format=Wt;var Yt=33777;t.RGBA_S3TC_DXT1_Format=Yt;var qt=33778;t.RGBA_S3TC_DXT3_Format=qt;var Xt=33779;t.RGBA_S3TC_DXT5_Format=Xt;var Zt=35840;t.RGB_PVRTC_4BPPV1_Format=Zt;var Jt=35841;t.RGB_PVRTC_2BPPV1_Format=Jt;var Kt=35842;t.RGBA_PVRTC_4BPPV1_Format=Kt;var Qt=35843;t.RGBA_PVRTC_2BPPV1_Format=Qt;var $t=36196;t.RGB_ETC1_Format=$t;var en=37492;t.RGB_ETC2_Format=en;var tn=37496;t.RGBA_ETC2_EAC_Format=tn;var nn=37808;t.RGBA_ASTC_4x4_Format=nn;var rn=37809;t.RGBA_ASTC_5x4_Format=rn;var an=37810;t.RGBA_ASTC_5x5_Format=an;var on=37811;t.RGBA_ASTC_6x5_Format=on;var sn=37812;t.RGBA_ASTC_6x6_Format=sn;var ln=37813;t.RGBA_ASTC_8x5_Format=ln;var un=37814;t.RGBA_ASTC_8x6_Format=un;var hn=37815;t.RGBA_ASTC_8x8_Format=hn;var cn=37816;t.RGBA_ASTC_10x5_Format=cn;var dn=37817;t.RGBA_ASTC_10x6_Format=dn;var fn=37818;t.RGBA_ASTC_10x8_Format=fn;var pn=37819;t.RGBA_ASTC_10x10_Format=pn;var mn=37820;t.RGBA_ASTC_12x10_Format=mn;var vn=37821;t.RGBA_ASTC_12x12_Format=vn;var gn=36492;t.RGBA_BPTC_Format=gn;var yn=37840;t.SRGB8_ALPHA8_ASTC_4x4_Format=yn;var _n=37841;t.SRGB8_ALPHA8_ASTC_5x4_Format=_n;var xn=37842;t.SRGB8_ALPHA8_ASTC_5x5_Format=xn;var wn=37843;t.SRGB8_ALPHA8_ASTC_6x5_Format=wn;var bn=37844;t.SRGB8_ALPHA8_ASTC_6x6_Format=bn;var Mn=37845;t.SRGB8_ALPHA8_ASTC_8x5_Format=Mn;var Tn=37846;t.SRGB8_ALPHA8_ASTC_8x6_Format=Tn;var Sn=37847;t.SRGB8_ALPHA8_ASTC_8x8_Format=Sn;var En=37848;t.SRGB8_ALPHA8_ASTC_10x5_Format=En;var An=37849;t.SRGB8_ALPHA8_ASTC_10x6_Format=An;var In=37850;t.SRGB8_ALPHA8_ASTC_10x8_Format=In;var Ln=37851;t.SRGB8_ALPHA8_ASTC_10x10_Format=Ln;var Rn=37852;t.SRGB8_ALPHA8_ASTC_12x10_Format=Rn;var Nn=37853;t.SRGB8_ALPHA8_ASTC_12x12_Format=Nn;var kn=2200;t.LoopOnce=kn;var Pn=2201;t.LoopRepeat=Pn;var Cn=2202;t.LoopPingPong=Cn;var Dn=2300;t.InterpolateDiscrete=Dn;var On=2301;t.InterpolateLinear=On;var Fn=2302;t.InterpolateSmooth=Fn;var Bn=2400;t.ZeroCurvatureEnding=Bn;var Un=2401;t.ZeroSlopeEnding=Un;var zn=2402;t.WrapAroundEnding=zn;var Gn=0;t.TrianglesDrawMode=Gn;var Vn=1;t.TriangleStripDrawMode=Vn;var Hn=2;t.TriangleFanDrawMode=Hn;var jn=3e3;t.LinearEncoding=jn;var Wn=3001;t.sRGBEncoding=Wn;var Yn=3007;t.GammaEncoding=Yn;var qn=3002;t.RGBEEncoding=qn;var Xn=3003;t.LogLuvEncoding=Xn;var Zn=3004;t.RGBM7Encoding=Zn;var Jn=3005;t.RGBM16Encoding=Jn;var Kn=3006;t.RGBDEncoding=Kn;var Qn=3200;t.BasicDepthPacking=Qn;var $n=3201;t.RGBADepthPacking=$n;var er=0;t.TangentSpaceNormalMap=er;var tr=1;t.ObjectSpaceNormalMap=tr;var nr=0;t.ZeroStencilOp=nr;var rr=7680;t.KeepStencilOp=rr;var ir=7681;t.ReplaceStencilOp=ir;var ar=7682;t.IncrementStencilOp=ar;var or=7683;t.DecrementStencilOp=or;var sr=34055;t.IncrementWrapStencilOp=sr;var lr=34056;t.DecrementWrapStencilOp=lr;var ur=5386;t.InvertStencilOp=ur;var hr=512;t.NeverStencilFunc=hr;var cr=513;t.LessStencilFunc=cr;var dr=514;t.EqualStencilFunc=dr;var fr=515;t.LessEqualStencilFunc=fr;var pr=516;t.GreaterStencilFunc=pr;var mr=517;t.NotEqualStencilFunc=mr;var vr=518;t.GreaterEqualStencilFunc=vr;var gr=519;t.AlwaysStencilFunc=gr;var yr=35044;t.StaticDrawUsage=yr;var _r=35048;t.DynamicDrawUsage=_r;var xr=35040;t.StreamDrawUsage=xr;var wr=35045;t.StaticReadUsage=wr;var br=35049;t.DynamicReadUsage=br;var Mr=35041;t.StreamReadUsage=Mr;var Tr=35046;t.StaticCopyUsage=Tr;var Sr=35050;t.DynamicCopyUsage=Sr;var Er=35042;function Ar(){}t.StreamCopyUsage=Er,(0,qe.default)(Ar.prototype,{addEventListener:function(e,t){var n;void 0===this._listeners&&(this._listeners={});var r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===(0,ve.default)(n=r[e]).call(n,t)&&r[e].push(t)},hasEventListener:function(e,t){var n;if(void 0===this._listeners)return!1;var r=this._listeners;return void 0!==r[e]&&-1!==(0,ve.default)(n=r[e]).call(n,t)},removeEventListener:function(e,t){var n,r,i;void 0!==this._listeners&&(n=this._listeners,r=n[e],void 0!==r&&(i=(0,ve.default)(r).call(r,t),-1!==i&&(0,L.default)(r).call(r,i,1)))},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners,n=t[e.type];if(void 0!==n){e.target=this;for(var r=(0,E.default)(n).call(n,0),i=0,a=r.length;i<a;i++)r[i].call(this,e)}}}});for(var Ir=[],Lr=0;Lr<256;Lr++)Ir[Lr]=(Lr<16?"0":"")+Lr.toString(16);var Rr,Nr={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0,i=Ir[255&e]+Ir[e>>8&255]+Ir[e>>16&255]+Ir[e>>24&255]+"-"+Ir[255&t]+Ir[t>>8&255]+"-"+Ir[t>>16&15|64]+Ir[t>>24&255]+"-"+Ir[63&n|128]+Ir[n>>8&255]+"-"+Ir[n>>16&255]+Ir[n>>24&255]+Ir[255&r]+Ir[r>>8&255]+Ir[r>>16&255]+Ir[r>>24&255];return i.toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:n<=e?1:(e=(e-t)/(n-t),e*e*(3-2*e))},smootherstep:function(e,t,n){return e<=t?0:n<=e?1:(e=(e-t)/(n-t),e*e*e*(e*(6*e-15)+10))},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*Nr.DEG2RAD},radToDeg:function(e){return e*Nr.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,r,i){var a=Math.cos,o=Math.sin,s=a(n/2),l=o(n/2),u=a((t+r)/2),h=o((t+r)/2),c=a((t-r)/2),d=o((t-r)/2),f=a((r-t)/2),p=o((r-t)/2);"XYX"===i?e.set(s*h,l*c,l*d,s*u):"YZY"===i?e.set(l*d,s*h,l*c,s*u):"ZXZ"===i?e.set(l*c,l*d,s*h,s*u):"XZX"===i?e.set(s*h,l*p,l*f,s*u):"YXY"===i?e.set(l*f,s*h,l*p,s*u):"ZYZ"===i?e.set(l*p,l*f,s*h,s*u):console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.")}};function kr(e,t){this.x=e||0,this.y=t||0}function Pr(){this.elements=[1,0,0,0,1,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}t.MathUtils=t.Math=Nr,(0,S.default)(kr.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),(0,qe.default)(kr.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},cross:function(e){return this.x*e.y-this.y*e.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var e=Math.atan2(-this.y,-this.x)+Math.PI;return e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}}),(0,qe.default)(Pr.prototype,{isMatrix3:!0,set:function(e,t,n,r,i,a,o,s,l){var u=this.elements;return u[0]=e,u[1]=r,u[2]=o,u[3]=t,u[4]=i,u[5]=s,u[6]=n,u[7]=a,u[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this},extractBasis:function(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this},setFromMatrix4:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],l=n[1],u=n[4],h=n[7],c=n[2],d=n[5],f=n[8],p=r[0],m=r[3],v=r[6],g=r[1],y=r[4],_=r[7],x=r[2],w=r[5],b=r[8];return i[0]=a*p+o*g+s*x,i[3]=a*m+o*y+s*w,i[6]=a*v+o*_+s*b,i[1]=l*p+u*g+h*x,i[4]=l*m+u*y+h*w,i[7]=l*v+u*_+h*b,i[2]=c*p+d*g+f*x,i[5]=c*m+d*y+f*w,i[8]=c*v+d*_+f*b,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8];return t*a*u-t*o*l-n*i*u+n*o*s+r*i*l-r*a*s},getInverse:function(e,t){void 0!==t&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");var n=e.elements,r=this.elements,i=n[0],a=n[1],o=n[2],s=n[3],l=n[4],u=n[5],h=n[6],c=n[7],d=n[8],f=d*l-u*c,p=u*h-d*s,m=c*s-l*h,v=i*f+a*p+o*m;if(0===v)return this.set(0,0,0,0,0,0,0,0,0);var g=1/v;return r[0]=f*g,r[1]=(o*c-d*a)*g,r[2]=(u*a-o*l)*g,r[3]=p*g,r[4]=(d*i-o*h)*g,r[5]=(o*s-u*i)*g,r[6]=m*g,r[7]=(a*h-c*i)*g,r[8]=(l*i-a*s)*g,this},transpose:function(){var e=this.elements,t=e[1];return e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},setUvTransform:function(e,t,n,r,i,a,o){var s=Math.cos(i),l=Math.sin(i);this.set(n*s,n*l,-n*(s*a+l*o)+a+e,-r*l,r*s,-r*(-l*a+s*o)+o+t,0,0,1)},scale:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this},rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],l=r[4],u=r[7];return r[0]=t*i+n*s,r[3]=t*a+n*l,r[6]=t*o+n*u,r[1]=-n*i+t*s,r[4]=-n*a+t*l,r[7]=-n*o+t*u,this},translate:function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<9;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}});var Cr={getDataURL:function(e){if("undefined"==typeof HTMLCanvasElement)return e.src;var t,n=e instanceof HTMLCanvasElement?e:(void 0===Rr&&(Rr=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Rr.width=e.width,Rr.height=e.height,t=Rr.getContext("2d"),e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),Rr);return 2048<n.width||2048<n.height?n.toDataURL("image/jpeg",.6):n.toDataURL("image/png")}};t.ImageUtils=Cr;var Dr=0;function Or(e,t,n,r,i,a,o,s,l,u){(0,R.default)(this,"id",{value:Dr++}),this.uuid=Nr.generateUUID(),this.name="",this.image=void 0!==e?e:Or.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:Or.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:st,this.wrapT=void 0!==r?r:st,this.magFilter=void 0!==i?i:pt,this.minFilter=void 0!==a?a:gt,this.anisotropy=void 0!==l?l:1,this.format=void 0!==o?o:Pt,this.internalFormat=null,this.type=void 0!==s?s:_t,this.offset=new kr(0,0),this.repeat=new kr(1,1),this.center=new kr(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Pr,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==u?u:jn,this.version=0,this.onUpdate=null}function Fr(e,t,n,r){this.x=e||0,this.y=t||0,this.z=n||0,this.w=void 0!==r?r:1}function Br(e,t,n){this.width=e,this.height=t,this.scissor=new Fr(0,0,e,t),this.scissorTest=!1,this.viewport=new Fr(0,0,e,t),n=n||{},this.texture=new Or(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:pt,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function Ur(e,t,n){Br.call(this,e,t,n),this.samples=4}function zr(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._w=void 0!==r?r:1}Or.DEFAULT_IMAGE=void 0,Or.DEFAULT_MAPPING=ue,Or.prototype=(0,qe.default)((0,T.default)(Ar.prototype),{constructor:Or,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,(0,M.default)(this).x,(0,M.default)(this).y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){var t;return this.name=e.name,this.image=e.image,this.mipmaps=(0,E.default)(t=e.mipmaps).call(t,0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),(0,M.default)(this).copy((0,M.default)(e)),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[(0,M.default)(this).x,(0,M.default)(this).y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var r,i=this.image;if(void 0===i.uuid&&(i.uuid=Nr.generateUUID()),!t&&void 0===e.images[i.uuid]){if((0,Ye.default)(i)){r=[];for(var a=0,o=i.length;a<o;a++)r.push(Cr.getDataURL(i[a]))}else r=Cr.getDataURL(i);e.images[i.uuid]={uuid:i.uuid,url:r}}n.image=i.uuid}return t||(e.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(this.mapping!==ue)return e;if(e.applyMatrix3(this.matrix),e.x<0||1<e.x)switch(this.wrapS){case ot:e.x=e.x-Math.floor(e.x);break;case st:e.x=e.x<0?0:1;break;case lt:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||1<e.y)switch(this.wrapT){case ot:e.y=e.y-Math.floor(e.y);break;case st:e.y=e.y<0?0:1;break;case lt:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),(0,R.default)(Or.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),(0,S.default)(Fr.prototype,{width:{get:function(){return this.z},set:function(e){this.z=e}},height:{get:function(){return this.w},set:function(e){this.w=e}}}),(0,qe.default)(Fr.prototype,{isVector4:!0,set:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,n,r,i,a=.01,o=.1,s=e.elements,l=s[0],u=s[4],h=s[8],c=s[1],d=s[5],f=s[9],p=s[2],m=s[6],v=s[10];if(Math.abs(u-c)<a&&Math.abs(h-p)<a&&Math.abs(f-m)<a){if(Math.abs(u+c)<o&&Math.abs(h+p)<o&&Math.abs(f+m)<o&&Math.abs(l+d+v-3)<o)return this.set(1,0,0,0),this;t=Math.PI;var g=(l+1)/2,y=(d+1)/2,_=(v+1)/2,x=(u+c)/4,w=(h+p)/4,b=(f+m)/4;return y<g&&_<g?i=g<a?(n=0,r=.707106781,.707106781):(n=Math.sqrt(g),r=x/n,w/n):_<y?i=y<a?(n=.707106781,r=0,.707106781):(r=Math.sqrt(y),n=x/r,b/r):_<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(_),n=w/i,r=b/i),this.set(n,r,i,t),this}var M=Math.sqrt((m-f)*(m-f)+(h-p)*(h-p)+(c-u)*(c-u));return Math.abs(M)<.001&&(M=1),this.x=(m-f)/M,this.y=(h-p)/M,this.z=(c-u)/M,this.w=Math.acos((l+d+v-1)/2),this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),Br.prototype=(0,qe.default)((0,T.default)(Ar.prototype),{constructor:Br,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Ur.prototype=(0,qe.default)((0,T.default)(Br.prototype),{constructor:Ur,isWebGLMultisampleRenderTarget:!0,copy:function(e){return Br.prototype.copy.call(this,e),this.samples=e.samples,this}}),(0,qe.default)(zr,{slerp:function(e,t,n,r){return n.copy(e).slerp(t,r)},slerpFlat:function(e,t,n,r,i,a,o){var s,l,u,h,c,d,f,p,m=n[r+0],v=n[r+1],g=n[r+2],y=n[r+3],_=i[a+0],x=i[a+1],w=i[a+2],b=i[a+3];y===b&&m===_&&v===x&&g===w||(d=1-o,s=m*_+v*x+g*w+y*b,l=0<=s?1:-1,u=1-s*s,u>se.default&&(h=Math.sqrt(u),c=Math.atan2(h,s*l),d=Math.sin(d*c)/h,o=Math.sin(o*c)/h),f=o*l,m=m*d+_*f,v=v*d+x*f,g=g*d+w*f,y=y*d+b*f,d===1-o&&(p=1/Math.sqrt(m*m+v*v+g*g+y*y),m*=p,v*=p,g*=p,y*=p)),e[t]=m,e[t+1]=v,e[t+2]=g,e[t+3]=y}}),(0,S.default)(zr.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}}),(0,qe.default)(zr.prototype,{isQuaternion:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,r=e._y,i=e._z,a=e.order,o=Math.cos,s=Math.sin,l=o(n/2),u=o(r/2),h=o(i/2),c=s(n/2),d=s(r/2),f=s(i/2);return"XYZ"===a?(this._x=c*u*h+l*d*f,this._y=l*d*h-c*u*f,this._z=l*u*f+c*d*h,this._w=l*u*h-c*d*f):"YXZ"===a?(this._x=c*u*h+l*d*f,this._y=l*d*h-c*u*f,this._z=l*u*f-c*d*h,this._w=l*u*h+c*d*f):"ZXY"===a?(this._x=c*u*h-l*d*f,this._y=l*d*h+c*u*f,this._z=l*u*f+c*d*h,this._w=l*u*h-c*d*f):"ZYX"===a?(this._x=c*u*h-l*d*f,this._y=l*d*h+c*u*f,this._z=l*u*f-c*d*h,this._w=l*u*h+c*d*f):"YZX"===a?(this._x=c*u*h+l*d*f,this._y=l*d*h+c*u*f,this._z=l*u*f-c*d*h,this._w=l*u*h-c*d*f):"XZY"===a&&(this._x=c*u*h-l*d*f,this._y=l*d*h-c*u*f,this._z=l*u*f+c*d*h,this._w=l*u*h+c*d*f),!1!==t&&this._onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(e){var t,n=e.elements,r=n[0],i=n[4],a=n[8],o=n[1],s=n[5],l=n[9],u=n[2],h=n[6],c=n[10],d=r+s+c;return 0<d?(t=.5/Math.sqrt(d+1),this._w=.25/t,this._x=(h-l)*t,this._y=(a-u)*t,this._z=(o-i)*t):s<r&&c<r?(t=2*Math.sqrt(1+r-s-c),this._w=(h-l)/t,this._x=.25*t,this._y=(i+o)/t,this._z=(a+u)/t):c<s?(t=2*Math.sqrt(1+s-r-c),this._w=(a-u)/t,this._x=(i+o)/t,this._y=.25*t,this._z=(l+h)/t):(t=2*Math.sqrt(1+c-r-s),this._w=(o-i)/t,this._x=(a+u)/t,this._y=(l+h)/t,this._z=.25*t),this._onChangeCallback(),this},setFromUnitVectors:function(e,t){var n=1e-6,r=e.dot(t)+1;return r<n?(r=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x),this._w=r,this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs(Nr.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,t){var n=this.angleTo(e);if(0===n)return this;var r=Math.min(1,t/n);return this.slerp(e,r),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,l=t._z,u=t._w;return this._x=n*u+a*o+r*l-i*s,this._y=r*u+a*s+i*o-n*l,this._z=i*u+a*l+n*s-r*o,this._w=a*u-n*o-r*s-i*l,this._onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,a=this._w,o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),1<=o)return this._w=a,this._x=n,this._y=r,this._z=i,this;var s=1-o*o;if(s<=se.default){var l=1-t;return this._w=l*a+t*this._w,this._x=l*n+t*this._x,this._y=l*r+t*this._y,this._z=l*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var u=Math.sqrt(s),h=Math.atan2(u,o),c=Math.sin((1-t)*h)/u,d=Math.sin(t*h)/u;return this._w=a*c+this._w*d,this._x=n*c+this._x*d,this._y=r*c+this._y*d,this._z=i*c+this._z*d,this._onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},fromBufferAttribute:function(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}});var Gr=new Hr,Vr=new zr;function Hr(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}(0,qe.default)(Hr.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Vr.setFromEuler(e))},applyAxisAngle:function(e,t){return this.applyQuaternion(Vr.setFromAxisAngle(e,t))},applyMatrix3:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this},applyNormalMatrix:function(e){return this.applyMatrix3(e).normalize()},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this},applyQuaternion:function(e){var t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,l=s*t+a*r-o*n,u=s*n+o*t-i*r,h=s*r+i*n-a*t,c=-i*t-a*n-o*r;return this.x=l*s+c*-i+u*-o-h*-a,this.y=u*s+c*-a+h*-i-l*-o,this.z=h*s+c*-o+l*-a-u*-i,this},project:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},unproject:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)},transformDirection:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},cross:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this},projectOnVector:function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)},projectOnPlane:function(e){return Gr.copy(this).projectOnVector(e),this.sub(Gr)},reflect:function(e){return this.sub(Gr.copy(e).multiplyScalar(2*this.dot(e)))},angleTo:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var n=this.dot(e)/t;return Math.acos(Nr.clamp(n,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},setFromSphericalCoords:function(e,t,n){var r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this},setFromCylindrical:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},setFromCylindricalCoords:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},setFromMatrix3Column:function(e,t){return this.fromArray(e.elements,3*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}});var jr=new Hr,Wr=new Kr,Yr=new Hr(0,0,0),qr=new Hr(1,1,1),Xr=new Hr,Zr=new Hr,Jr=new Hr;function Kr(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}(0,qe.default)(Kr.prototype,{isMatrix4:!0,set:function(e,t,n,r,i,a,o,s,l,u,h,c,d,f,p,m){var v=this.elements;return v[0]=e,v[4]=t,v[8]=n,v[12]=r,v[1]=i,v[5]=a,v[9]=o,v[13]=s,v[2]=l,v[6]=u,v[10]=h,v[14]=c,v[3]=d,v[7]=f,v[11]=p,v[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new Kr).fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this},copyPosition:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},extractBasis:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this},extractRotation:function(e){var t=this.elements,n=e.elements,r=1/jr.setFromMatrixColumn(e,0).length(),i=1/jr.setFromMatrixColumn(e,1).length(),a=1/jr.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t,n,r,i,a,o,s,l,u,h,c,d,f=this.elements,p=e.x,m=e.y,v=e.z,g=Math.cos(p),y=Math.sin(p),_=Math.cos(m),x=Math.sin(m),w=Math.cos(v),b=Math.sin(v);return"XYZ"===e.order?(a=g*w,o=g*b,s=y*w,l=y*b,f[0]=_*w,f[4]=-_*b,f[8]=x,f[1]=o+s*x,f[5]=a-l*x,f[9]=-y*_,f[2]=l-a*x,f[6]=s+o*x,f[10]=g*_):"YXZ"===e.order?(t=_*w,n=_*b,r=x*w,i=x*b,f[0]=t+i*y,f[4]=r*y-n,f[8]=g*x,f[1]=g*b,f[5]=g*w,f[9]=-y,f[2]=n*y-r,f[6]=i+t*y,f[10]=g*_):"ZXY"===e.order?(t=_*w,n=_*b,r=x*w,i=x*b,f[0]=t-i*y,f[4]=-g*b,f[8]=r+n*y,f[1]=n+r*y,f[5]=g*w,f[9]=i-t*y,f[2]=-g*x,f[6]=y,f[10]=g*_):"ZYX"===e.order?(a=g*w,o=g*b,s=y*w,l=y*b,f[0]=_*w,f[4]=s*x-o,f[8]=a*x+l,f[1]=_*b,f[5]=l*x+a,f[9]=o*x-s,f[2]=-x,f[6]=y*_,f[10]=g*_):"YZX"===e.order?(u=g*_,h=g*x,c=y*_,d=y*x,f[0]=_*w,f[4]=d-u*b,f[8]=c*b+h,f[1]=b,f[5]=g*w,f[9]=-y*w,f[2]=-x*w,f[6]=h*b+c,f[10]=u-d*b):"XZY"===e.order&&(u=g*_,h=g*x,c=y*_,d=y*x,f[0]=_*w,f[4]=-b,f[8]=x*w,f[1]=u*b+d,f[5]=g*w,f[9]=h*b-c,f[2]=c*b-h,f[6]=y*w,f[10]=d*b+u),f[3]=0,f[7]=0,f[11]=0,f[12]=0,f[13]=0,f[14]=0,f[15]=1,this},makeRotationFromQuaternion:function(e){return this.compose(Yr,e,qr)},lookAt:function(e,t,n){var r=this.elements;return Jr.subVectors(e,t),0===Jr.lengthSq()&&(Jr.z=1),Jr.normalize(),Xr.crossVectors(n,Jr),0===Xr.lengthSq()&&(1===Math.abs(n.z)?Jr.x+=1e-4:Jr.z+=1e-4,Jr.normalize(),Xr.crossVectors(n,Jr)),Xr.normalize(),Zr.crossVectors(Jr,Xr),r[0]=Xr.x,r[4]=Zr.x,r[8]=Jr.x,r[1]=Xr.y,r[5]=Zr.y,r[9]=Jr.y,r[2]=Xr.z,r[6]=Zr.z,r[10]=Jr.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],l=n[12],u=n[1],h=n[5],c=n[9],d=n[13],f=n[2],p=n[6],m=n[10],v=n[14],g=n[3],y=n[7],_=n[11],x=n[15],w=r[0],b=r[4],M=r[8],T=r[12],S=r[1],E=r[5],A=r[9],I=r[13],L=r[2],R=r[6],N=r[10],k=r[14],P=r[3],C=r[7],D=r[11],O=r[15];return i[0]=a*w+o*S+s*L+l*P,i[4]=a*b+o*E+s*R+l*C,i[8]=a*M+o*A+s*N+l*D,i[12]=a*T+o*I+s*k+l*O,i[1]=u*w+h*S+c*L+d*P,i[5]=u*b+h*E+c*R+d*C,i[9]=u*M+h*A+c*N+d*D,i[13]=u*T+h*I+c*k+d*O,i[2]=f*w+p*S+m*L+v*P,i[6]=f*b+p*E+m*R+v*C,i[10]=f*M+p*A+m*N+v*D,i[14]=f*T+p*I+m*k+v*O,i[3]=g*w+y*S+_*L+x*P,i[7]=g*b+y*E+_*R+x*C,i[11]=g*M+y*A+_*N+x*D,i[15]=g*T+y*I+_*k+x*O,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},determinant:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],l=e[13],u=e[2],h=e[6],c=e[10],d=e[14],f=e[3],p=e[7],m=e[11],v=e[15];return f*(i*s*h-r*l*h-i*o*c+n*l*c+r*o*d-n*s*d)+p*(t*s*d-t*l*c+i*a*c-r*a*d+r*l*u-i*s*u)+m*(t*l*h-t*o*d-i*a*h+n*a*d+i*o*u-n*l*u)+v*(-r*o*u-t*s*h+t*o*c+r*a*h-n*a*c+n*s*u)},transpose:function(){var e=this.elements,t=e[1];return e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(e,t,n){var r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this},getInverse:function(e,t){void 0!==t&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");var n=this.elements,r=e.elements,i=r[0],a=r[1],o=r[2],s=r[3],l=r[4],u=r[5],h=r[6],c=r[7],d=r[8],f=r[9],p=r[10],m=r[11],v=r[12],g=r[13],y=r[14],_=r[15],x=f*y*c-g*p*c+g*h*m-u*y*m-f*h*_+u*p*_,w=v*p*c-d*y*c-v*h*m+l*y*m+d*h*_-l*p*_,b=d*g*c-v*f*c+v*u*m-l*g*m-d*u*_+l*f*_,M=v*f*h-d*g*h-v*u*p+l*g*p+d*u*y-l*f*y,T=i*x+a*w+o*b+s*M;if(0===T)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var S=1/T;return n[0]=x*S,n[1]=(g*p*s-f*y*s-g*o*m+a*y*m+f*o*_-a*p*_)*S,n[2]=(u*y*s-g*h*s+g*o*c-a*y*c-u*o*_+a*h*_)*S,n[3]=(f*h*s-u*p*s-f*o*c+a*p*c+u*o*m-a*h*m)*S,n[4]=w*S,n[5]=(d*y*s-v*p*s+v*o*m-i*y*m-d*o*_+i*p*_)*S,n[6]=(v*h*s-l*y*s-v*o*c+i*y*c+l*o*_-i*h*_)*S,n[7]=(l*p*s-d*h*s+d*o*c-i*p*c-l*o*m+i*h*m)*S,n[8]=b*S,n[9]=(v*f*s-d*g*s-v*a*m+i*g*m+d*a*_-i*f*_)*S,n[10]=(l*g*s-v*u*s+v*a*c-i*g*c-l*a*_+i*u*_)*S,n[11]=(d*u*s-l*f*s-d*a*c+i*f*c+l*a*m-i*u*m)*S,n[12]=M*S,n[13]=(d*g*o-v*f*o+v*a*p-i*g*p-d*a*y+i*f*y)*S,n[14]=(v*u*o-l*g*o-v*a*h+i*g*h+l*a*y-i*u*y)*S,n[15]=(l*f*o-d*u*o+d*a*h-i*f*h-l*a*p+i*u*p)*S,this},scale:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))},makeTranslation:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,l=i*a,u=i*o;return this.set(l*a+n,l*o-r*s,l*s+r*o,0,l*o+r*s,u*o+n,u*s-r*a,0,l*s-r*o,u*s+r*a,i*s*s+n,0,0,0,0,1),this},makeScale:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,n){var r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,l=i+i,u=a+a,h=o+o,c=i*l,d=i*u,f=i*h,p=a*u,m=a*h,v=o*h,g=s*l,y=s*u,_=s*h,x=n.x,w=n.y,b=n.z;return r[0]=(1-(p+v))*x,r[1]=(d+_)*x,r[2]=(f-y)*x,r[3]=0,r[4]=(d-_)*w,r[5]=(1-(c+v))*w,r[6]=(m+g)*w,r[7]=0,r[8]=(f+y)*b,r[9]=(m-g)*b,r[10]=(1-(c+p))*b,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this},decompose:function(e,t,n){var r=this.elements,i=jr.set(r[0],r[1],r[2]).length(),a=jr.set(r[4],r[5],r[6]).length(),o=jr.set(r[8],r[9],r[10]).length(),s=this.determinant();s<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],Wr.copy(this);var l=1/i,u=1/a,h=1/o;return Wr.elements[0]*=l,Wr.elements[1]*=l,Wr.elements[2]*=l,Wr.elements[4]*=u,Wr.elements[5]*=u,Wr.elements[6]*=u,Wr.elements[8]*=h,Wr.elements[9]*=h,Wr.elements[10]*=h,t.setFromRotationMatrix(Wr),n.x=i,n.y=a,n.z=o,this},makePerspective:function(e,t,n,r,i,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*i/(t-e),l=2*i/(n-r),u=(t+e)/(t-e),h=(n+r)/(n-r),c=-(a+i)/(a-i),d=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=u,o[12]=0,o[1]=0,o[5]=l,o[9]=h,o[13]=0,o[2]=0,o[6]=0,o[10]=c,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(e,t,n,r,i,a){var o=this.elements,s=1/(t-e),l=1/(n-r),u=1/(a-i),h=(t+e)*s,c=(n+r)*l,d=(a+i)*u;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-h,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-c,o[2]=0,o[6]=0,o[10]=-2*u,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}});var Qr=new Kr,$r=new zr;function ei(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._order=r||ei.DefaultOrder}function ti(){this.mask=1}ei.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],ei.DefaultOrder="XYZ",(0,S.default)(ei.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}}),(0,qe.default)(ei.prototype,{isEuler:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var r=Nr.clamp,i=e.elements,a=i[0],o=i[4],s=i[8],l=i[1],u=i[5],h=i[9],c=i[2],d=i[6],f=i[10];return t=t||this._order,"XYZ"===t?(this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-h,f),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(d,u),this._z=0)):"YXZ"===t?(this._x=Math.asin(-r(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(s,f),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-c,a),this._z=0)):"ZXY"===t?(this._x=Math.asin(r(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-c,f),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(l,a))):"ZYX"===t?(this._y=Math.asin(-r(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-o,u))):"YZX"===t?(this._z=Math.asin(r(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,u),this._y=Math.atan2(-c,a)):(this._x=0,this._y=Math.atan2(s,f))):"XZY"===t?(this._z=Math.asin(-r(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,u),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-h,f),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,!1!==n&&this._onChangeCallback(),this},setFromQuaternion:function(e,t,n){return Qr.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Qr,t,n)},setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(e){return $r.setFromEuler(this),this.setFromQuaternion($r,e)},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new Hr(this._x,this._y,this._z)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}}),(0,qe.default)(ti.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask|=1<<e|0},enableAll:function(){this.mask=-1},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},disableAll:function(){this.mask=0},test:function(e){return 0!=(this.mask&e.mask)}});var ni=0,ri=new Hr,ii=new zr,ai=new Kr,oi=new Hr,si=new Hr,li=new Hr,ui=new zr,hi=new Hr(1,0,0),ci=new Hr(0,1,0),di=new Hr(0,0,1),fi={type:"added"},pi={type:"removed"};function mi(){(0,R.default)(this,"id",{value:ni++}),this.uuid=Nr.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=mi.DefaultUp.clone();var e=new Hr,t=new ei,n=new zr,r=new Hr(1,1,1);function i(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(i),n._onChange(a),(0,S.default)(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Kr},normalMatrix:{value:new Pr}}),this.matrix=new Kr,this.matrixWorld=new Kr,this.matrixAutoUpdate=mi.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new ti,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function vi(){mi.call(this),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}mi.DefaultUp=new Hr(0,1,0),mi.DefaultMatrixAutoUpdate=!0,mi.prototype=(0,qe.default)((0,T.default)(Ar.prototype),{constructor:mi,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(e,t){return ii.setFromAxisAngle(e,t),this.quaternion.multiply(ii),this},rotateOnWorldAxis:function(e,t){return ii.setFromAxisAngle(e,t),this.quaternion.premultiply(ii),this},rotateX:function(e){return this.rotateOnAxis(hi,e)},rotateY:function(e){return this.rotateOnAxis(ci,e)},rotateZ:function(e){return this.rotateOnAxis(di,e)},translateOnAxis:function(e,t){return ri.copy(e).applyQuaternion(this.quaternion),this.position.add(ri.multiplyScalar(t)),this},translateX:function(e){return this.translateOnAxis(hi,e)},translateY:function(e){return this.translateOnAxis(ci,e)},translateZ:function(e){return this.translateOnAxis(di,e)},localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(e){return e.applyMatrix4(ai.getInverse(this.matrixWorld))},lookAt:function(e,t,n){e.isVector3?oi.copy(e):oi.set(e,t,n);var r=this.parent;this.updateWorldMatrix(!0,!1),si.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ai.lookAt(si,oi,this.up):ai.lookAt(oi,si,this.up),this.quaternion.setFromRotationMatrix(ai),r&&(ai.extractRotation(r.matrixWorld),ii.setFromRotationMatrix(ai),this.quaternion.premultiply(ii.inverse()))},add:function(e){if(1<arguments.length){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",e):e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(fi)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this},remove:function(e){var t;if(1<arguments.length){for(var n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}var r,i=(0,ve.default)(t=this.children).call(t,e);return-1!==i&&(e.parent=null,(0,L.default)(r=this.children).call(r,i,1),e.dispatchEvent(pi)),this},attach:function(e){return this.updateWorldMatrix(!0,!1),ai.getInverse(this.matrixWorld),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),ai.multiply(e.parent.matrixWorld)),e.applyMatrix4(ai),e.updateWorldMatrix(!1,!1),this.add(e),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var n=0,r=this.children.length;n<r;n++){var i=this.children[n],a=i.getObjectByProperty(e,t);if(void 0!==a)return a}},getWorldPosition:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),e=new Hr),this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),e=new zr),this.updateMatrixWorld(!0),this.matrixWorld.decompose(si,e,li),e},getWorldScale:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),e=new Hr),this.updateMatrixWorld(!0),this.matrixWorld.decompose(si,ui,e),e},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),e=new Hr),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()},raycast:function(){},traverse:function(e){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)},updateWorldMatrix:function(e,t){var n=this.parent;if(!0===e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t)for(var r=this.children,i=0,a=r.length;i<a;i++)r[i].updateWorldMatrix(!1,!0)},toJSON:function(n){var e=void 0===n||"string"==typeof n,t={};e&&(n={geometries:{},materials:{},textures:{},images:{},shapes:{}},t.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r,i,a,o,s={};function l(e,t){return void 0===e[t.uuid]&&(e[t.uuid]=t.toJSON(n)),t.uuid}if(s.uuid=this.uuid,s.type=this.type,""!==this.name&&(s.name=this.name),!0===this.castShadow&&(s.castShadow=!0),!0===this.receiveShadow&&(s.receiveShadow=!0),!1===this.visible&&(s.visible=!1),!1===this.frustumCulled&&(s.frustumCulled=!1),0!==this.renderOrder&&(s.renderOrder=this.renderOrder),"{}"!==(0,b.default)(this.userData)&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){s.geometry=l(n.geometries,this.geometry);var u=this.geometry.parameters;if(void 0!==u&&void 0!==u.shapes){var h=u.shapes;if((0,Ye.default)(h))for(var c=0,d=h.length;c<d;c++){var f=h[c];l(n.shapes,f)}else l(n.shapes,h)}}if(void 0!==this.material)if((0,Ye.default)(this.material)){for(var p=[],c=0,d=this.material.length;c<d;c++)p.push(l(n.materials,this.material[c]));s.material=p}else s.material=l(n.materials,this.material);if(0<this.children.length)for(s.children=[],c=0;c<this.children.length;c++)s.children.push(this.children[c].toJSON(n).object);return e&&(r=m(n.geometries),i=m(n.materials),a=m(n.textures),o=m(n.images),h=m(n.shapes),0<r.length&&(t.geometries=r),0<i.length&&(t.materials=i),0<a.length&&(t.textures=a),0<o.length&&(t.images=o),0<h.length&&(t.shapes=h)),t.object=s,t;function m(e){var t,n=[];for(t in e){var r=e[t];delete r.metadata,n.push(r)}return n}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse((0,b.default)(e.userData)),!0===t)for(var n=0;n<e.children.length;n++){var r=e.children[n];this.add(r.clone())}return this}}),vi.prototype=(0,qe.default)((0,T.default)(mi.prototype),{constructor:vi,isScene:!0,copy:function(e,t){return mi.prototype.copy.call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var t=mi.prototype.toJSON.call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.environment&&(t.object.environment=this.environment.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t},dispose:function(){this.dispatchEvent({type:"dispose"})}});var gi=[new Hr,new Hr,new Hr,new Hr,new Hr,new Hr,new Hr,new Hr],yi=new Hr,_i=new Ri,xi=new Hr,wi=new Hr,bi=new Hr,Mi=new Hr,Ti=new Hr,Si=new Hr,Ei=new Hr,Ai=new Hr,Ii=new Hr,Li=new Hr;function Ri(e,t){this.min=void 0!==e?e:new Hr(Infinity,Infinity,Infinity),this.max=void 0!==t?t:new Hr(-Infinity,-Infinity,-Infinity)}function Ni(e,t,n,r,i){for(var a=0,o=e.length-3;a<=o;a+=3){Li.fromArray(e,a);var s=i.x*Math.abs(Li.x)+i.y*Math.abs(Li.y)+i.z*Math.abs(Li.z),l=t.dot(Li),u=n.dot(Li),h=r.dot(Li);if(Math.max(-Math.max(l,u,h),Math.min(l,u,h))>s)return!1}return!0}(0,qe.default)(Ri.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=Infinity,n=Infinity,r=Infinity,i=-Infinity,a=-Infinity,o=-Infinity,s=0,l=e.length;s<l;s+=3){var u=e[s],h=e[s+1],c=e[s+2];u<t&&(t=u),h<n&&(n=h),c<r&&(r=c),i<u&&(i=u),a<h&&(a=h),o<c&&(o=c)}return this.min.set(t,n,r),this.max.set(i,a,o),this},setFromBufferAttribute:function(e){for(var t=Infinity,n=Infinity,r=Infinity,i=-Infinity,a=-Infinity,o=-Infinity,s=0,l=e.count;s<l;s++){var u=e.getX(s),h=e.getY(s),c=e.getZ(s);u<t&&(t=u),h<n&&(n=h),c<r&&(r=c),i<u&&(i=u),a<h&&(a=h),o<c&&(o=c)}return this.min.set(t,n,r),this.max.set(i,a,o),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){var n=yi.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this},setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=Infinity,this.max.x=this.max.y=this.max.z=-Infinity,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box3: .getCenter() target is now required"),e=new Hr),this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box3: .getSize() target is now required"),e=new Hr),this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:function(e){e.updateWorldMatrix(!1,!1);var t=e.geometry;void 0!==t&&(null===t.boundingBox&&t.computeBoundingBox(),_i.copy(t.boundingBox),_i.applyMatrix4(e.matrixWorld),this.union(_i));for(var n=e.children,r=0,i=n.length;r<i;r++)this.expandByObject(n[r]);return this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new Hr),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)},intersectsSphere:function(e){return this.clampPoint(e.center,yi),yi.distanceToSquared(e.center)<=e.radius*e.radius},intersectsPlane:function(e){var t,n=0<e.normal.x?(t=e.normal.x*this.min.x,e.normal.x*this.max.x):(t=e.normal.x*this.max.x,e.normal.x*this.min.x);return 0<e.normal.y?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),0<e.normal.z?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant},intersectsTriangle:function(e){if(this.isEmpty())return!1;this.getCenter(Ei),Ai.subVectors(this.max,Ei),xi.subVectors(e.a,Ei),wi.subVectors(e.b,Ei),bi.subVectors(e.c,Ei),Mi.subVectors(wi,xi),Ti.subVectors(bi,wi),Si.subVectors(xi,bi);var t=[0,-Mi.z,Mi.y,0,-Ti.z,Ti.y,0,-Si.z,Si.y,Mi.z,0,-Mi.x,Ti.z,0,-Ti.x,Si.z,0,-Si.x,-Mi.y,Mi.x,0,-Ti.y,Ti.x,0,-Si.y,Si.x,0];return!!Ni(t,xi,wi,bi,Ai)&&(t=[1,0,0,0,1,0,0,0,1],!!Ni(t,xi,wi,bi,Ai)&&(Ii.crossVectors(Mi,Ti),t=[Ii.x,Ii.y,Ii.z],Ni(t,xi,wi,bi,Ai)))},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new Hr),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){var t=yi.copy(e).clamp(this.min,this.max);return t.sub(e).length()},getBoundingSphere:function(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(yi).length(),e},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(e){return this.isEmpty()||(gi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),gi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),gi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),gi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),gi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),gi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),gi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),gi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(gi)),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var ki=new Ri;function Pi(e,t){this.center=void 0!==e?e:new Hr,this.radius=void 0!==t?t:0}(0,qe.default)(Pi.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(e,t){var n=this.center;void 0!==t?n.copy(t):ki.setFromPoints(e).getCenter(n);for(var r=0,i=0,a=e.length;i<a;i++)r=Math.max(r,n.distanceToSquared(e[i]));return this.radius=Math.sqrt(r),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,t){var n=this.center.distanceToSquared(e);return void 0===t&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),t=new Hr),t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t},getBoundingBox:function(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new Ri),e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}});var Ci=new Hr,Di=new Hr,Oi=new Hr,Fi=new Hr,Bi=new Hr,Ui=new Hr,zi=new Hr;function Gi(e,t){this.origin=void 0!==e?e:new Hr,this.direction=void 0!==t?t:new Hr(0,0,-1)}(0,qe.default)(Gi.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new Hr),t.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(e){return this.origin.copy(this.at(e,Ci)),this},closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new Hr),t.subVectors(e,this.origin);var n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(e){var t=Ci.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ci.copy(this.direction).multiplyScalar(t).add(this.origin),Ci.distanceToSquared(e))},distanceSqToSegment:function(e,t,n,r){Di.copy(e).add(t).multiplyScalar(.5),Oi.copy(t).sub(e).normalize(),Fi.copy(this.origin).sub(Di);var i,a,o,s,l=.5*e.distanceTo(t),u=-this.direction.dot(Oi),h=Fi.dot(this.direction),c=-Fi.dot(Oi),d=Fi.lengthSq(),f=Math.abs(1-u*u),p=0<f?(a=u*c-h,o=u*h-c,s=l*f,0<=a?-s<=o?o<=s?(i=1/f,a*=i,o*=i,a*(a+u*o+2*h)+o*(u*a+o+2*c)+d):(o=l,a=Math.max(0,-(u*o+h)),-a*a+o*(o+2*c)+d):(o=-l,a=Math.max(0,-(u*o+h)),-a*a+o*(o+2*c)+d):o<=-s?(a=Math.max(0,-(-u*l+h)),o=0<a?-l:Math.min(Math.max(-l,-c),l),-a*a+o*(o+2*c)+d):o<=s?(a=0,o=Math.min(Math.max(-l,-c),l),o*(o+2*c)+d):(a=Math.max(0,-(u*l+h)),o=0<a?l:Math.min(Math.max(-l,-c),l),-a*a+o*(o+2*c)+d)):(o=0<u?-l:l,a=Math.max(0,-(u*o+h)),-a*a+o*(o+2*c)+d);return n&&n.copy(this.direction).multiplyScalar(a).add(this.origin),r&&r.copy(Oi).multiplyScalar(o).add(Di),p},intersectSphere:function(e,t){Ci.subVectors(e.center,this.origin);var n=Ci.dot(this.direction),r=Ci.dot(Ci)-n*n,i=e.radius*e.radius;if(i<r)return null;var a=Math.sqrt(i-r),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,t):this.at(o,t)},intersectsSphere:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return 0<=n?n:null},intersectPlane:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);if(0===t)return!0;var n=e.normal.dot(this.direction);return n*t<0},intersectBox:function(e,t){var n,r,i,a,o=1/this.direction.x,s=1/this.direction.y,l=1/this.direction.z,u=this.origin,h=0<=o?(n=(e.min.x-u.x)*o,(e.max.x-u.x)*o):(n=(e.max.x-u.x)*o,(e.min.x-u.x)*o),c=0<=s?(r=(e.min.y-u.y)*s,(e.max.y-u.y)*s):(r=(e.max.y-u.y)*s,(e.min.y-u.y)*s);return c<n||h<r?null:((n<r||n!=n)&&(n=r),(c<h||h!=h)&&(h=c),a=0<=l?(i=(e.min.z-u.z)*l,(e.max.z-u.z)*l):(i=(e.max.z-u.z)*l,(e.min.z-u.z)*l),a<n||h<i?null:((n<i||n!=n)&&(n=i),(a<h||h!=h)&&(h=a),h<0?null:this.at(0<=n?n:h,t)))},intersectsBox:function(e){return null!==this.intersectBox(e,Ci)},intersectTriangle:function(e,t,n,r,i){Bi.subVectors(t,e),Ui.subVectors(n,e),zi.crossVectors(Bi,Ui);var a,o=this.direction.dot(zi);if(0<o){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}Fi.subVectors(this.origin,e);var s=a*this.direction.dot(Ui.crossVectors(Fi,Ui));if(s<0)return null;var l=a*this.direction.dot(Bi.cross(Fi));if(l<0)return null;if(o<s+l)return null;var u=-a*Fi.dot(zi);return u<0?null:this.at(u/o,i)},applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}});var Vi=new Hr,Hi=new Hr,ji=new Pr;function Wi(e,t){this.normal=void 0!==e?e:new Hr(1,0,0),this.constant=void 0!==t?t:0}(0,qe.default)(Wi.prototype,{isPlane:!0,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(e,t,n){var r=Vi.subVectors(n,t).cross(Hi.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return void 0===t&&(console.warn("THREE.Plane: .projectPoint() target is now required"),t=new Hr),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(e,t){void 0===t&&(console.warn("THREE.Plane: .intersectLine() target is now required"),t=new Hr);var n=e.delta(Vi),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):void 0;var i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||1<i?void 0:t.copy(n).multiplyScalar(i).add(e.start)},intersectsLine:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&0<n||n<0&&0<t},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new Hr),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(e,t){var n=t||ji.getNormalMatrix(e),r=this.coplanarPoint(Vi).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this},translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}});var Yi=new Hr,qi=new Hr,Xi=new Hr,Zi=new Hr,Ji=new Hr,Ki=new Hr,Qi=new Hr,$i=new Hr,ea=new Hr,ta=new Hr;function na(e,t,n){this.a=void 0!==e?e:new Hr,this.b=void 0!==t?t:new Hr,this.c=void 0!==n?n:new Hr}(0,qe.default)(na,{getNormal:function(e,t,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new Hr),r.subVectors(n,t),Yi.subVectors(e,t),r.cross(Yi);var i=r.lengthSq();return 0<i?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)},getBarycoord:function(e,t,n,r,i){Yi.subVectors(r,t),qi.subVectors(n,t),Xi.subVectors(e,t);var a=Yi.dot(Yi),o=Yi.dot(qi),s=Yi.dot(Xi),l=qi.dot(qi),u=qi.dot(Xi),h=a*l-o*o;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new Hr),0===h)return i.set(-2,-1,-1);var c=1/h,d=(l*s-o*u)*c,f=(a*u-o*s)*c;return i.set(1-d-f,f,d)},containsPoint:function(e,t,n,r){return na.getBarycoord(e,t,n,r,Zi),0<=Zi.x&&0<=Zi.y&&Zi.x+Zi.y<=1},getUV:function(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,Zi),s.set(0,0),s.addScaledVector(i,Zi.x),s.addScaledVector(a,Zi.y),s.addScaledVector(o,Zi.z),s},isFrontFacing:function(e,t,n,r){return Yi.subVectors(n,t),qi.subVectors(e,t),Yi.cross(qi).dot(r)<0}}),(0,qe.default)(na.prototype,{set:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},setFromPointsAndIndices:function(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},getArea:function(){return Yi.subVectors(this.c,this.b),qi.subVectors(this.a,this.b),.5*Yi.cross(qi).length()},getMidpoint:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new Hr),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return na.getNormal(this.a,this.b,this.c,e)},getPlane:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new Wi),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,t){return na.getBarycoord(e,this.a,this.b,this.c,t)},getUV:function(e,t,n,r,i){return na.getUV(e,this.a,this.b,this.c,t,n,r,i)},containsPoint:function(e){return na.containsPoint(e,this.a,this.b,this.c)},isFrontFacing:function(e){return na.isFrontFacing(this.a,this.b,this.c,e)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new Hr);var n=this.a,r=this.b,i=this.c;Ji.subVectors(r,n),Ki.subVectors(i,n),$i.subVectors(e,n);var a=Ji.dot($i),o=Ki.dot($i);if(a<=0&&o<=0)return t.copy(n);ea.subVectors(e,r);var s=Ji.dot(ea),l=Ki.dot(ea);if(0<=s&&l<=s)return t.copy(r);var u=a*l-s*o;if(u<=0&&0<=a&&s<=0)return m=a/(a-s),t.copy(n).addScaledVector(Ji,m);ta.subVectors(e,i);var h=Ji.dot(ta),c=Ki.dot(ta);if(0<=c&&h<=c)return t.copy(i);var d=h*o-a*c;if(d<=0&&0<=o&&c<=0)return v=o/(o-c),t.copy(n).addScaledVector(Ki,v);var f=s*c-h*l;if(f<=0&&0<=l-s&&0<=h-c)return Qi.subVectors(i,r),v=(l-s)/(l-s+(h-c)),t.copy(r).addScaledVector(Qi,v);var p=1/(f+d+u),m=d*p,v=u*p;return t.copy(n).addScaledVector(Ji,m).addScaledVector(Ki,v)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}});var ra={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ia={h:0,s:0,l:0},aa={h:0,s:0,l:0};function oa(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}function sa(e,t,n){return n<0&&(n+=1),1<n&&--n,n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function la(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function ua(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}function ha(e,t,n,r,i,a){this.a=e,this.b=t,this.c=n,this.normal=r&&r.isVector3?r:new Hr,this.vertexNormals=(0,Ye.default)(r)?r:[],this.color=i&&i.isColor?i:new oa,this.vertexColors=(0,Ye.default)(i)?i:[],this.materialIndex=void 0!==a?a:0}(0,qe.default)(oa.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,n){return this.r=e,this.g=t,this.b=n,this},setHSL:function(e,t,n){var r,i;return e=Nr.euclideanModulo(e,1),t=Nr.clamp(t,0,1),n=Nr.clamp(n,0,1),0===t?this.r=this.g=this.b=n:(r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r,this.r=sa(i,r,e+1/3),this.g=sa(i,r,e),this.b=sa(i,r,e-1/3)),this},setStyle:function(t){function e(e){void 0!==e&&(0,me.default)(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var r,i=n[1],a=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,(0,w.default)(r[1],10))/255,this.g=Math.min(255,(0,w.default)(r[2],10))/255,this.b=Math.min(255,(0,w.default)(r[3],10))/255,e(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,(0,w.default)(r[1],10))/100,this.g=Math.min(100,(0,w.default)(r[2],10))/100,this.b=Math.min(100,(0,w.default)(r[3],10))/100,e(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=(0,me.default)(r[1])/360,s=(0,w.default)(r[2],10)/100,l=(0,w.default)(r[3],10)/100;return e(r[5]),this.setHSL(o,s,l)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(t)){var u=n[1],h=u.length;if(3===h)return this.r=(0,w.default)(u.charAt(0)+u.charAt(0),16)/255,this.g=(0,w.default)(u.charAt(1)+u.charAt(1),16)/255,this.b=(0,w.default)(u.charAt(2)+u.charAt(2),16)/255,this;if(6===h)return this.r=(0,w.default)(u.charAt(0)+u.charAt(1),16)/255,this.g=(0,w.default)(u.charAt(2)+u.charAt(3),16)/255,this.b=(0,w.default)(u.charAt(4)+u.charAt(5),16)/255,this}return t&&0<t.length?this.setColorName(t):this},setColorName:function(e){var t=ra[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var n=0<t?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this},convertGammaToLinear:function(e){return this.copyGammaToLinear(this,e),this},convertLinearToGamma:function(e){return this.copyLinearToGamma(this,e),this},copySRGBToLinear:function(e){return this.r=la(e.r),this.g=la(e.g),this.b=la(e.b),this},copyLinearToSRGB:function(e){return this.r=ua(e.r),this.g=ua(e.g),this.b=ua(e.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){var e;return(0,E.default)(e="000000"+this.getHex().toString(16)).call(e,-6)},getHSL:function(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,n=this.r,r=this.g,i=this.b,a=Math.max(n,r,i),o=Math.min(n,r,i),s=(o+a)/2;if(o===a)t=0,u=0;else{var l=a-o,u=s<=.5?l/(a+o):l/(2-a-o);switch(a){case n:t=(r-i)/l+(r<i?6:0);break;case r:t=(i-n)/l+2;break;case i:t=(n-r)/l+4}t/=6}return e.h=t,e.s=u,e.l=s,e},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,n){return this.getHSL(ia),ia.h+=e,ia.s+=t,ia.l+=n,this.setHSL(ia.h,ia.s,ia.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},lerpHSL:function(e,t){this.getHSL(ia),e.getHSL(aa);var n=Nr.lerp(ia.h,aa.h,t),r=Nr.lerp(ia.s,aa.s,t),i=Nr.lerp(ia.l,aa.l,t);return this.setHSL(n,r,i),this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}}),oa.NAMES=ra,(0,qe.default)(ha.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,n=e.vertexNormals.length;t<n;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(t=0,n=e.vertexColors.length;t<n;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}});var ca=0;function da(){(0,R.default)(this,"id",{value:ca++}),this.uuid=Nr.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=be,this.side=Y,this.flatShading=!1,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Oe,this.blendDst=Fe,this.blendEquation=Ae,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Ke,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=gr,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=rr,this.stencilZFail=rr,this.stencilZPass=rr,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function fa(e){da.call(this),this.type="MeshBasicMaterial",this.color=new oa(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Z,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.setValues(e)}da.prototype=(0,qe.default)((0,T.default)(Ar.prototype),{constructor:da,isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(void 0!==e)for(var t in e){var n,r=e[t];void 0!==r?"shading"!==t?(n=this[t],void 0!==n?n&&n.isColor?n.set(r):n&&n.isVector3&&r&&r.isVector3?n.copy(r):this[t]=r:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")):(console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=r===q):console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(e){var t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var n,r,i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function a(e){var t,n=[];for(t in e){var r=e[t];delete r.metadata,n.push(r)}return n}return i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(i.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),(0,We.default)(this)&&(0,We.default)(this).isTexture&&(i.map=(0,We.default)(this).toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,i.reflectivity=this.reflectivity,i.refractionRatio=this.refractionRatio,void 0!==this.combine&&(i.combine=this.combine),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(i.size=this.size),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==be&&(i.blending=this.blending),!0===this.flatShading&&(i.flatShading=this.flatShading),this.side!==Y&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),0<this.alphaTest&&(i.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),1<this.wireframeLinewidth&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(i.morphTargets=!0),!0===this.morphNormals&&(i.morphNormals=!0),!0===this.skinning&&(i.skinning=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),"{}"!==(0,b.default)(this.userData)&&(i.userData=this.userData),t&&(n=a(e.textures),r=a(e.images),0<n.length&&(i.textures=n),0<r.length&&(i.images=r)),i},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,n=null;if(null!==t)for(var r=t.length,n=new Array(r),i=0;i!==r;++i)n[i]=t[i].clone();return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse((0,b.default)(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),(0,R.default)(da.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),fa.prototype=(0,T.default)(da.prototype),fa.prototype.constructor=fa,fa.prototype.isMeshBasicMaterial=!0,fa.prototype.copy=function(e){return da.prototype.copy.call(this,e),this.color.copy(e.color),this.map=(0,We.default)(e),this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this};var pa=new Hr;function ma(e,t,n){if((0,Ye.default)(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=yr,this.updateRange={offset:0,count:-1},this.version=0}function va(e,t,n){ma.call(this,new Int8Array(e),t,n)}function ga(e,t,n){ma.call(this,new Uint8Array(e),t,n)}function ya(e,t,n){ma.call(this,new Uint8ClampedArray(e),t,n)}function _a(e,t,n){ma.call(this,new Int16Array(e),t,n)}function xa(e,t,n){ma.call(this,new Uint16Array(e),t,n)}function wa(e,t,n){ma.call(this,new Int32Array(e),t,n)}function ba(e,t,n){ma.call(this,new Uint32Array(e),t,n)}function Ma(e,t,n){ma.call(this,new Float32Array(e),t,n)}function Ta(e,t,n){ma.call(this,new Float64Array(e),t,n)}function Sa(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function Ea(e){if(0===e.length)return-Infinity;for(var t=e[0],n=1,r=e.length;n<r;++n)e[n]>t&&(t=e[n]);return t}(0,R.default)(ma.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),(0,qe.default)(ma.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),a=new oa),t[n++]=a.r,t[n++]=a.g,t[n++]=a.b}return this},copyVector2sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),a=new kr),t[n++]=a.x,t[n++]=a.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),a=new Hr),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),a=new Fr),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n++]=a.w}return this},applyMatrix3:function(e){for(var t=0,n=this.count;t<n;t++)pa.x=this.getX(t),pa.y=this.getY(t),pa.z=this.getZ(t),pa.applyMatrix3(e),this.setXYZ(t,pa.x,pa.y,pa.z);return this},applyMatrix4:function(e){for(var t=0,n=this.count;t<n;t++)pa.x=this.getX(t),pa.y=this.getY(t),pa.z=this.getZ(t),pa.applyMatrix4(e),this.setXYZ(t,pa.x,pa.y,pa.z);return this},applyNormalMatrix:function(e){for(var t=0,n=this.count;t<n;t++)pa.x=this.getX(t),pa.y=this.getY(t),pa.z=this.getZ(t),pa.applyNormalMatrix(e),this.setXYZ(t,pa.x,pa.y,pa.z);return this},transformDirection:function(e){for(var t=0,n=this.count;t<n;t++)pa.x=this.getX(t),pa.y=this.getY(t),pa.z=this.getZ(t),pa.transformDirection(e),this.setXYZ(t,pa.x,pa.y,pa.z);return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:(0,E.default)(Array.prototype).call(this.array),normalized:this.normalized}}}),va.prototype=(0,T.default)(ma.prototype),va.prototype.constructor=va,ga.prototype=(0,T.default)(ma.prototype),ga.prototype.constructor=ga,ya.prototype=(0,T.default)(ma.prototype),ya.prototype.constructor=ya,_a.prototype=(0,T.default)(ma.prototype),_a.prototype.constructor=_a,xa.prototype=(0,T.default)(ma.prototype),xa.prototype.constructor=xa,wa.prototype=(0,T.default)(ma.prototype),wa.prototype.constructor=wa,ba.prototype=(0,T.default)(ma.prototype),ba.prototype.constructor=ba,Ma.prototype=(0,T.default)(ma.prototype),Ma.prototype.constructor=Ma,Ta.prototype=(0,T.default)(ma.prototype),Ta.prototype.constructor=Ta,(0,qe.default)(Sa.prototype,{computeGroups:function(e){for(var t,n=[],r=void 0,i=e.faces,a=0;a<i.length;a++){var o=i[a];o.materialIndex!==r&&(r=o.materialIndex,void 0!==t&&(t.count=3*a-t.start,n.push(t)),t={start:3*a,materialIndex:r})}void 0!==t&&(t.count=3*a-t.start,n.push(t)),this.groups=n},fromGeometry:function(e){var t,n=e.faces,r=e.vertices,i=e.faceVertexUvs,a=i[0]&&0<i[0].length,o=i[1]&&0<i[1].length,s=e.morphTargets,l=s.length;if(0<l){t=[];for(var u=0;u<l;u++)t[u]={name:s[u].name,data:[]};this.morphTargets.position=t}var h,c=e.morphNormals,d=c.length;if(0<d){for(h=[],u=0;u<d;u++)h[u]={name:c[u].name,data:[]};this.morphTargets.normal=h}var f=e.skinIndices,p=e.skinWeights,m=f.length===r.length,v=p.length===r.length;for(0<r.length&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported."),u=0;u<n.length;u++){var g=n[u];this.vertices.push(r[g.a],r[g.b],r[g.c]);var y,_=g.vertexNormals;3===_.length?this.normals.push(_[0],_[1],_[2]):(y=g.normal,this.normals.push(y,y,y));var x,w,b=g.vertexColors;3===b.length?this.colors.push(b[0],b[1],b[2]):(x=g.color,this.colors.push(x,x,x)),!0===a&&(w=i[0][u],void 0!==w?this.uvs.push(w[0],w[1],w[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",u),this.uvs.push(new kr,new kr,new kr))),!0===o&&(w=i[1][u],void 0!==w?this.uvs2.push(w[0],w[1],w[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",u),this.uvs2.push(new kr,new kr,new kr)));for(var M=0;M<l;M++){var T=s[M].vertices;t[M].data.push(T[g.a],T[g.b],T[g.c])}for(M=0;M<d;M++){var S=c[M].vertexNormals[u];h[M].data.push(S.a,S.b,S.c)}m&&this.skinIndices.push(f[g.a],f[g.b],f[g.c]),v&&this.skinWeights.push(p[g.a],p[g.b],p[g.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this}});var Aa=1,Ia=new Kr,La=new mi,Ra=new Hr,Na=new Ri,ka=new Ri,Pa=new Hr;function Ca(){(0,R.default)(this,"id",{value:Aa+=2}),this.uuid=Nr.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:Infinity},this.userData={}}Ca.prototype=(0,qe.default)((0,T.default)(Ar.prototype),{constructor:Ca,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){(0,Ye.default)(e)?this.index=new(65535<Ea(e)?ba:xa)(e,1):this.index=e},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,n){this.groups.push({start:e,count:t,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var n,r=this.attributes.normal;void 0!==r&&(n=(new Pr).getNormalMatrix(e),r.applyNormalMatrix(n),r.needsUpdate=!0);var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return Ia.makeRotationX(e),this.applyMatrix4(Ia),this},rotateY:function(e){return Ia.makeRotationY(e),this.applyMatrix4(Ia),this},rotateZ:function(e){return Ia.makeRotationZ(e),this.applyMatrix4(Ia),this},translate:function(e,t,n){return Ia.makeTranslation(e,t,n),this.applyMatrix4(Ia),this},scale:function(e,t,n){return Ia.makeScale(e,t,n),this.applyMatrix4(Ia),this},lookAt:function(e){return La.lookAt(e),La.updateMatrix(),this.applyMatrix4(La.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ra).negate(),this.translate(Ra.x,Ra.y,Ra.z),this},setFromObject:function(e){var t,n,r,i=e.geometry;return e.isPoints||e.isLine?(t=new Ma(3*i.vertices.length,3),n=new Ma(3*i.colors.length,3),this.setAttribute("position",t.copyVector3sArray(i.vertices)),this.setAttribute("color",n.copyColorsArray(i.colors)),i.lineDistances&&i.lineDistances.length===i.vertices.length&&(r=new Ma(i.lineDistances.length,1),this.setAttribute("lineDistance",r.copyArray(i.lineDistances))),null!==i.boundingSphere&&(this.boundingSphere=i.boundingSphere.clone()),null!==i.boundingBox&&(this.boundingBox=i.boundingBox.clone())):e.isMesh&&i&&i.isGeometry&&this.fromGeometry(i),this},setFromPoints:function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];t.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new Ma(t,3)),this},updateFromObject:function(e){var t,n=e.geometry;if(e.isMesh){var r=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(r=void 0,n.elementsNeedUpdate=!1),void 0===r)return this.fromGeometry(n);r.verticesNeedUpdate=n.verticesNeedUpdate,r.normalsNeedUpdate=n.normalsNeedUpdate,r.colorsNeedUpdate=n.colorsNeedUpdate,r.uvsNeedUpdate=n.uvsNeedUpdate,r.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=r}return!0===n.verticesNeedUpdate&&(t=this.attributes.position,void 0!==t&&(t.copyVector3sArray(n.vertices),t.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(t=this.attributes.normal,void 0!==t&&(t.copyVector3sArray(n.normals),t.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(t=this.attributes.color,void 0!==t&&(t.copyColorsArray(n.colors),t.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(t=this.attributes.uv,void 0!==t&&(t.copyVector2sArray(n.uvs),t.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(t=this.attributes.lineDistance,void 0!==t&&(t.copyArray(n.lineDistances),t.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(e.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new Sa).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t,n,r,i,a,o,s,l=new Float32Array(3*e.vertices.length);for(a in this.setAttribute("position",new ma(l,3).copyVector3sArray(e.vertices)),0<e.normals.length&&(t=new Float32Array(3*e.normals.length),this.setAttribute("normal",new ma(t,3).copyVector3sArray(e.normals))),0<e.colors.length&&(n=new Float32Array(3*e.colors.length),this.setAttribute("color",new ma(n,3).copyColorsArray(e.colors))),0<e.uvs.length&&(r=new Float32Array(2*e.uvs.length),this.setAttribute("uv",new ma(r,2).copyVector2sArray(e.uvs))),0<e.uvs2.length&&(i=new Float32Array(2*e.uvs2.length),this.setAttribute("uv2",new ma(i,2).copyVector2sArray(e.uvs2))),this.groups=e.groups,e.morphTargets){for(var u=[],h=e.morphTargets[a],c=0,d=h.length;c<d;c++){var f=h[c],p=new Ma(3*f.data.length,3);p.name=f.name,u.push(p.copyVector3sArray(f.data))}this.morphAttributes[a]=u}return 0<e.skinIndices.length&&(o=new Ma(4*e.skinIndices.length,4),this.setAttribute("skinIndex",o.copyVector4sArray(e.skinIndices))),0<e.skinWeights.length&&(s=new Ma(4*e.skinWeights.length,4),this.setAttribute("skinWeight",s.copyVector4sArray(e.skinWeights))),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Ri);var e=this.attributes.position,t=this.morphAttributes.position;if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(var n=0,r=t.length;n<r;n++){var i=t[n];Na.setFromBufferAttribute(i),this.morphTargetsRelative?(Pa.addVectors(this.boundingBox.min,Na.min),this.boundingBox.expandByPoint(Pa),Pa.addVectors(this.boundingBox.max,Na.max),this.boundingBox.expandByPoint(Pa)):(this.boundingBox.expandByPoint(Na.min),this.boundingBox.expandByPoint(Na.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Pi);var e=this.attributes.position,t=this.morphAttributes.position;if(e){var n=this.boundingSphere.center;if(Na.setFromBufferAttribute(e),t)for(var r=0,i=t.length;r<i;r++){var a=t[r];ka.setFromBufferAttribute(a),this.morphTargetsRelative?(Pa.addVectors(Na.min,ka.min),Na.expandByPoint(Pa),Pa.addVectors(Na.max,ka.max),Na.expandByPoint(Pa)):(Na.expandByPoint(ka.min),Na.expandByPoint(ka.max))}Na.getCenter(n);for(var o=0,r=0,i=e.count;r<i;r++)Pa.fromBufferAttribute(e,r),o=Math.max(o,n.distanceToSquared(Pa));if(t)for(r=0,i=t.length;r<i;r++)for(var a=t[r],s=this.morphTargetsRelative,l=0,u=a.count;l<u;l++)Pa.fromBufferAttribute(a,l),s&&(Ra.fromBufferAttribute(e,l),Pa.add(Ra)),o=Math.max(o,n.distanceToSquared(Pa));this.boundingSphere.radius=Math.sqrt(o),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,t=this.attributes;if(t.position){var n=t.position.array;if(void 0===t.normal)this.setAttribute("normal",new ma(new Float32Array(n.length),3));else for(var r=t.normal.array,i=0,a=r.length;i<a;i++)r[i]=0;var o,s,l,u=t.normal.array,h=new Hr,c=new Hr,d=new Hr,f=new Hr,p=new Hr;if(e)for(var m=e.array,i=0,a=e.count;i<a;i+=3)o=3*m[i+0],s=3*m[i+1],l=3*m[i+2],h.fromArray(n,o),c.fromArray(n,s),d.fromArray(n,l),f.subVectors(d,c),p.subVectors(h,c),f.cross(p),u[o]+=f.x,u[o+1]+=f.y,u[o+2]+=f.z,u[s]+=f.x,u[s+1]+=f.y,u[s+2]+=f.z,u[l]+=f.x,u[l+1]+=f.y,u[l+2]+=f.z;else for(i=0,a=n.length;i<a;i+=9)h.fromArray(n,i),c.fromArray(n,i+3),d.fromArray(n,i+6),f.subVectors(d,c),p.subVectors(h,c),f.cross(p),u[i]=f.x,u[i+1]=f.y,u[i+2]=f.z,u[i+3]=f.x,u[i+4]=f.y,u[i+5]=f.z,u[i+6]=f.x,u[i+7]=f.y,u[i+8]=f.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge:function(e,t){if(e&&e.isBufferGeometry){void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n,r=this.attributes;for(n in r)if(void 0!==e.attributes[n])for(var i=r[n],a=i.array,o=e.attributes[n],s=o.array,l=o.itemSize*t,u=Math.min(s.length,a.length-l),h=0,c=l;h<u;h++,c++)a[c]=s[h];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)},normalizeNormals:function(){for(var e=this.attributes.normal,t=0,n=e.count;t<n;t++)Pa.x=e.getX(t),Pa.y=e.getY(t),Pa.z=e.getZ(t),Pa.normalize(),e.setXYZ(t,Pa.x,Pa.y,Pa.z)},toNonIndexed:function(){function e(e,t){for(var n=e.array,r=e.itemSize,i=new n.constructor(t.length*r),a=0,o=0,s=0,l=t.length;s<l;s++){a=t[s]*r;for(var u=0;u<r;u++)i[o++]=n[a++]}return new ma(i,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t,n=new Ca,r=this.index.array,i=this.attributes;for(t in i){var a=i[t],o=e(a,r);n.setAttribute(t,o)}var s=this.morphAttributes;for(t in s){for(var l=[],u=s[t],h=0,c=u.length;h<c;h++)a=u[h],o=e(a,r),l.push(o);n.morphAttributes[t]=l}n.morphTargetsRelative=this.morphTargetsRelative;for(var d=this.groups,h=0,f=d.length;h<f;h++){var p=d[h];n.addGroup(p.start,p.count,p.materialIndex)}return n},toJSON:function(){var e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),0<(0,v.default)(this.userData).length&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(o in t)void 0!==t[o]&&(e[o]=t[o]);return e}e.data={attributes:{}};var n=this.index;null!==n&&(e.data.index={type:n.array.constructor.name,array:(0,E.default)(Array.prototype).call(n.array)});var r=this.attributes;for(o in r){var i=r[o],a=i.toJSON();""!==i.name&&(a.name=i.name),e.data.attributes[o]=a}var o,s={},l=!1;for(o in this.morphAttributes){for(var u=this.morphAttributes[o],h=[],c=0,d=u.length;c<d;c++)i=u[c],a=i.toJSON(),""!==i.name&&(a.name=i.name),h.push(a);0<h.length&&(s[o]=h,l=!0)}l&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);var f=this.groups;0<f.length&&(e.data.groups=JSON.parse((0,b.default)(f)));var p=this.boundingSphere;return null!==p&&(e.data.boundingSphere={center:p.center.toArray(),radius:p.radius}),e},clone:function(){return(new Ca).copy(this)},copy:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var t=e.index;null!==t&&this.setIndex(t.clone());var n,r=e.attributes;for(n in r){var i=r[n];this.setAttribute(n,i.clone())}var a=e.morphAttributes;for(n in a){for(var o=[],s=a[n],l=0,u=s.length;l<u;l++)o.push(s[l].clone());this.morphAttributes[n]=o}this.morphTargetsRelative=e.morphTargetsRelative;for(var h=e.groups,l=0,u=h.length;l<u;l++){var c=h[l];this.addGroup(c.start,c.count,c.materialIndex)}var d=e.boundingBox;null!==d&&(this.boundingBox=d.clone());var f=e.boundingSphere;return null!==f&&(this.boundingSphere=f.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Da=new Kr,Oa=new Gi,Fa=new Pi,Ba=new Hr,Ua=new Hr,za=new Hr,Ga=new Hr,Va=new Hr,Ha=new Hr,ja=new Hr,Wa=new Hr,Ya=new Hr,qa=new kr,Xa=new kr,Za=new kr,Ja=new Hr,Ka=new Hr;function Qa(e,t){mi.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new Ca,this.material=void 0!==t?t:new fa,this.updateMorphTargets()}function $a(e,t,n,r,i,a,o,s){var l=t.side===Xe?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,t.side!==xe,s);if(null===l)return null;Ka.copy(s),Ka.applyMatrix4(e.matrixWorld);var u=n.ray.origin.distanceTo(Ka);return u<n.near||u>n.far?null:{distance:u,point:Ka.clone(),object:e}}function eo(e,t,n,r,i,a,o,s,l,u,h,c){Ba.fromBufferAttribute(i,u),Ua.fromBufferAttribute(i,h),za.fromBufferAttribute(i,c);var d=e.morphTargetInfluences;if(t.morphTargets&&a&&d){ja.set(0,0,0),Wa.set(0,0,0),Ya.set(0,0,0);for(var f=0,p=a.length;f<p;f++){var m=d[f],v=a[f];0!==m&&(Ga.fromBufferAttribute(v,u),Va.fromBufferAttribute(v,h),Ha.fromBufferAttribute(v,c),o?(ja.addScaledVector(Ga,m),Wa.addScaledVector(Va,m),Ya.addScaledVector(Ha,m)):(ja.addScaledVector(Ga.sub(Ba),m),Wa.addScaledVector(Va.sub(Ua),m),Ya.addScaledVector(Ha.sub(za),m)))}Ba.add(ja),Ua.add(Wa),za.add(Ya)}var g,y=$a(e,t,n,r,Ba,Ua,za,Ja);return y&&(s&&(qa.fromBufferAttribute(s,u),Xa.fromBufferAttribute(s,h),Za.fromBufferAttribute(s,c),y.uv=na.getUV(Ja,Ba,Ua,za,qa,Xa,Za,new kr)),l&&(qa.fromBufferAttribute(l,u),Xa.fromBufferAttribute(l,h),Za.fromBufferAttribute(l,c),y.uv2=na.getUV(Ja,Ba,Ua,za,qa,Xa,Za,new kr)),g=new ha(u,h,c),na.getNormal(Ba,Ua,za,g.normal),y.face=g),y}Qa.prototype=(0,qe.default)((0,T.default)(mi.prototype),{constructor:Qa,isMesh:!0,copy:function(e){var t;return mi.prototype.copy.call(this,e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=(0,E.default)(t=e.morphTargetInfluences).call(t)),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=(0,qe.default)({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e,t,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,a=(0,v.default)(i);if(0<a.length){var o=i[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=r.morphTargets;void 0!==s&&0<s.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){var n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0!==r&&(null===n.boundingSphere&&n.computeBoundingSphere(),Fa.copy(n.boundingSphere),Fa.applyMatrix4(i),!1!==e.ray.intersectsSphere(Fa)&&(Da.getInverse(i),Oa.copy(e.ray).applyMatrix4(Da),null===n.boundingBox||!1!==Oa.intersectsBox(n.boundingBox))))if(n.isBufferGeometry){var a,o,s,l,u,h,c,d,f,p,m,v=n.index,g=n.attributes.position,y=n.morphAttributes.position,_=n.morphTargetsRelative,x=n.attributes.uv,w=n.attributes.uv2,b=n.groups,M=n.drawRange;if(null!==v)if((0,Ye.default)(r))for(l=0,h=b.length;l<h;l++)for(d=b[l],f=r[d.materialIndex],p=Math.max(d.start,M.start),m=Math.min(d.start+d.count,M.start+M.count),u=p,c=m;u<c;u+=3)a=v.getX(u),o=v.getX(u+1),s=v.getX(u+2),D=eo(this,f,e,Oa,g,y,_,x,w,a,o,s),D&&(D.faceIndex=Math.floor(u/3),D.face.materialIndex=d.materialIndex,t.push(D));else for(p=Math.max(0,M.start),m=Math.min(v.count,M.start+M.count),l=p,h=m;l<h;l+=3)a=v.getX(l),o=v.getX(l+1),s=v.getX(l+2),D=eo(this,r,e,Oa,g,y,_,x,w,a,o,s),D&&(D.faceIndex=Math.floor(l/3),t.push(D));else if(void 0!==g)if((0,Ye.default)(r))for(l=0,h=b.length;l<h;l++)for(d=b[l],f=r[d.materialIndex],p=Math.max(d.start,M.start),m=Math.min(d.start+d.count,M.start+M.count),u=p,c=m;u<c;u+=3)a=u,o=u+1,s=u+2,D=eo(this,f,e,Oa,g,y,_,x,w,a,o,s),D&&(D.faceIndex=Math.floor(u/3),D.face.materialIndex=d.materialIndex,t.push(D));else for(p=Math.max(0,M.start),m=Math.min(g.count,M.start+M.count),l=p,h=m;l<h;l+=3)a=l,o=l+1,s=l+2,D=eo(this,r,e,Oa,g,y,_,x,w,a,o,s),D&&(D.faceIndex=Math.floor(l/3),t.push(D))}else if(n.isGeometry){var T,S=(0,Ye.default)(r),E=n.vertices,A=n.faces,I=n.faceVertexUvs[0];0<I.length&&(T=I);for(var L=0,R=A.length;L<R;L++){var N,k,P,C,D,O=A[L],F=S?r[O.materialIndex]:r;void 0!==F&&(k=E[O.a],P=E[O.b],C=E[O.c],D=$a(this,F,e,Oa,k,P,C,Ja),D&&(T&&T[L]&&(N=T[L],qa.copy(N[0]),Xa.copy(N[1]),Za.copy(N[2]),D.uv=na.getUV(Ja,k,P,C,qa,Xa,Za,new kr)),D.face=O,D.faceIndex=L,t.push(D)))}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var to=0,no=new Kr,ro=new mi,io=new Hr;function ao(){(0,R.default)(this,"id",{value:to+=2}),this.uuid=Nr.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}ao.prototype=(0,qe.default)((0,T.default)(Ar.prototype),{constructor:ao,isGeometry:!0,applyMatrix4:function(e){for(var t=(new Pr).getNormalMatrix(e),n=0,r=this.vertices.length;n<r;n++){var i=this.vertices[n];i.applyMatrix4(e)}for(n=0,r=this.faces.length;n<r;n++){var a=this.faces[n];a.normal.applyMatrix3(t).normalize();for(var o=0,s=a.vertexNormals.length;o<s;o++)a.vertexNormals[o].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(e){return no.makeRotationX(e),this.applyMatrix4(no),this},rotateY:function(e){return no.makeRotationY(e),this.applyMatrix4(no),this},rotateZ:function(e){return no.makeRotationZ(e),this.applyMatrix4(no),this},translate:function(e,t,n){return no.makeTranslation(e,t,n),this.applyMatrix4(no),this},scale:function(e,t,n){return no.makeScale(e,t,n),this.applyMatrix4(no),this},lookAt:function(e){return ro.lookAt(e),ro.updateMatrix(),this.applyMatrix4(ro.matrix),this},fromBufferGeometry:function(e){var s=this,t=null!==e.index?e.index.array:void 0,n=e.attributes;if(void 0===n.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var r=n.position.array,l=void 0!==n.normal?n.normal.array:void 0,u=void 0!==n.color?n.color.array:void 0,h=void 0!==n.uv?n.uv.array:void 0,c=void 0!==n.uv2?n.uv2.array:void 0;void 0!==c&&(this.faceVertexUvs[1]=[]);for(var i=0;i<r.length;i+=3)s.vertices.push((new Hr).fromArray(r,i)),void 0!==u&&s.colors.push((new oa).fromArray(u,i));function a(e,t,n,r){var i=void 0===u?[]:[s.colors[e].clone(),s.colors[t].clone(),s.colors[n].clone()],a=void 0===l?[]:[(new Hr).fromArray(l,3*e),(new Hr).fromArray(l,3*t),(new Hr).fromArray(l,3*n)],o=new ha(e,t,n,a,i,r);s.faces.push(o),void 0!==h&&s.faceVertexUvs[0].push([(new kr).fromArray(h,2*e),(new kr).fromArray(h,2*t),(new kr).fromArray(h,2*n)]),void 0!==c&&s.faceVertexUvs[1].push([(new kr).fromArray(c,2*e),(new kr).fromArray(c,2*t),(new kr).fromArray(c,2*n)])}var o=e.groups;if(0<o.length)for(i=0;i<o.length;i++)for(var d=o[i],f=d.start,p=d.count,m=f,v=f+p;m<v;m+=3)void 0!==t?a(t[m],t[m+1],t[m+2],d.materialIndex):a(m,m+1,m+2,d.materialIndex);else if(void 0!==t)for(i=0;i<t.length;i+=3)a(t[i],t[i+1],t[i+2]);else for(i=0;i<r.length/3;i+=3)a(i,i+1,i+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(io).negate(),this.translate(io.x,io.y,io.z),this},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=0===t?1:1/t,r=new Kr;return r.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix4(r),this},computeFaceNormals:function(){for(var e=new Hr,t=new Hr,n=0,r=this.faces.length;n<r;n++){var i=this.faces[n],a=this.vertices[i.a],o=this.vertices[i.b],s=this.vertices[i.c];e.subVectors(s,o),t.subVectors(a,o),e.cross(t),e.normalize(),i.normal.copy(e)}},computeVertexNormals:function(e){var t,n,r,i;for(void 0===e&&(e=!0),i=new Array(this.vertices.length),t=0,n=this.vertices.length;t<n;t++)i[t]=new Hr;if(e)for(var a,o,s,l=new Hr,u=new Hr,h=0,c=this.faces.length;h<c;h++)r=this.faces[h],a=this.vertices[r.a],o=this.vertices[r.b],s=this.vertices[r.c],l.subVectors(s,o),u.subVectors(a,o),l.cross(u),i[r.a].add(l),i[r.b].add(l),i[r.c].add(l);else for(this.computeFaceNormals(),h=0,c=this.faces.length;h<c;h++)r=this.faces[h],i[r.a].add(r.normal),i[r.b].add(r.normal),i[r.c].add(r.normal);for(t=0,n=this.vertices.length;t<n;t++)i[t].normalize();for(h=0,c=this.faces.length;h<c;h++){r=this.faces[h];var d=r.vertexNormals;3===d.length?(d[0].copy(i[r.a]),d[1].copy(i[r.b]),d[2].copy(i[r.c])):(d[0]=i[r.a].clone(),d[1]=i[r.b].clone(),d[2]=i[r.c].clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,t,n;for(this.computeFaceNormals(),e=0,t=this.faces.length;e<t;e++){n=this.faces[e];var r=n.vertexNormals;3===r.length?(r[0].copy(n.normal),r[1].copy(n.normal),r[2].copy(n.normal)):(r[0]=n.normal.clone(),r[1]=n.normal.clone(),r[2]=n.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var e,t,n,r=0,i=this.faces.length;r<i;r++)for(n=this.faces[r],n.__originalFaceNormal?n.__originalFaceNormal.copy(n.normal):n.__originalFaceNormal=n.normal.clone(),n.__originalVertexNormals||(n.__originalVertexNormals=[]),e=0,t=n.vertexNormals.length;e<t;e++)n.__originalVertexNormals[e]?n.__originalVertexNormals[e].copy(n.vertexNormals[e]):n.__originalVertexNormals[e]=n.vertexNormals[e].clone();var a=new ao;for(a.faces=this.faces,e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];for(var o=this.morphNormals[e].faceNormals,s=this.morphNormals[e].vertexNormals,r=0,i=this.faces.length;r<i;r++)l=new Hr,u={a:new Hr,b:new Hr,c:new Hr},o.push(l),s.push(u)}var l,u,h=this.morphNormals[e];for(a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals(),r=0,i=this.faces.length;r<i;r++)n=this.faces[r],l=h.faceNormals[r],u=h.vertexNormals[r],l.copy(n.normal),u.a.copy(n.vertexNormals[0]),u.b.copy(n.vertexNormals[1]),u.c.copy(n.vertexNormals[2])}for(r=0,i=this.faces.length;r<i;r++)n=this.faces[r],n.normal=n.__originalFaceNormal,n.vertexNormals=n.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Ri),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Pi),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(e&&e.isGeometry){var r,i=this.vertices.length,a=this.vertices,o=e.vertices,s=this.faces,l=e.faces,u=this.colors,h=e.colors;void 0===n&&(n=0),void 0!==t&&(r=(new Pr).getNormalMatrix(t));for(var c=0,d=o.length;c<d;c++){var f=o[c],p=f.clone();void 0!==t&&p.applyMatrix4(t),a.push(p)}for(c=0,d=h.length;c<d;c++)u.push(h[c].clone());for(c=0,d=l.length;c<d;c++){var m,v,g=l[c],y=g.vertexNormals,_=g.vertexColors,x=new ha(g.a+i,g.b+i,g.c+i);x.normal.copy(g.normal),void 0!==r&&x.normal.applyMatrix3(r).normalize();for(var w=0,b=y.length;w<b;w++)m=y[w].clone(),void 0!==r&&m.applyMatrix3(r).normalize(),x.vertexNormals.push(m);for(x.color.copy(g.color),w=0,b=_.length;w<b;w++)v=_[w],x.vertexColors.push(v.clone());x.materialIndex=g.materialIndex+n,s.push(x)}for(c=0,d=e.faceVertexUvs.length;c<d;c++){var M=e.faceVertexUvs[c];for(void 0===this.faceVertexUvs[c]&&(this.faceVertexUvs[c]=[]),w=0,b=M.length;w<b;w++){for(var T=M[w],S=[],E=0,A=T.length;E<A;E++)S.push(T[E].clone());this.faceVertexUvs[c].push(S)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e)},mergeMesh:function(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)},mergeVertices:function(){for(var e,t,n,r,i,a,o={},s=[],l=[],u=4,h=Math.pow(10,u),c=0,d=this.vertices.length;c<d;c++)e=this.vertices[c],t=Math.round(e.x*h)+"_"+Math.round(e.y*h)+"_"+Math.round(e.z*h),void 0===o[t]?(o[t]=c,s.push(this.vertices[c]),l[c]=s.length-1):l[c]=l[o[t]];for(var f=[],c=0,d=this.faces.length;c<d;c++){n=this.faces[c],n.a=l[n.a],n.b=l[n.b],n.c=l[n.c],r=[n.a,n.b,n.c];for(var p=0;p<3;p++)if(r[p]===r[(p+1)%3]){f.push(c);break}}for(c=f.length-1;0<=c;c--){var m,v,g=f[c];for((0,L.default)(m=this.faces).call(m,g,1),i=0,a=this.faceVertexUvs.length;i<a;i++)(0,L.default)(v=this.faceVertexUvs[i]).call(v,g,1)}var y=this.vertices.length-s.length;return this.vertices=s,y},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var r=e[t];this.vertices.push(new Hr(r.x,r.y,r.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,n=0;n<t;n++)e[n]._id=n;function r(e,t){return e.materialIndex-t.materialIndex}(0,je.default)(e).call(e,r);var i,a,o=this.faceVertexUvs[0],s=this.faceVertexUvs[1];for(o&&o.length===t&&(i=[]),s&&s.length===t&&(a=[]),n=0;n<t;n++){var l=e[n]._id;i&&i.push(o[l]),a&&a.push(s[l])}i&&(this.faceVertexUvs[0]=i),a&&(this.faceVertexUvs[1]=a)},toJSON:function(){var e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t,n=this.parameters;for(t in n)void 0!==n[t]&&(e[t]=n[t]);return e}for(var r=[],i=0;i<this.vertices.length;i++){var a=this.vertices[i];r.push(a.x,a.y,a.z)}for(var o=[],s=[],l={},u=[],h={},c=[],d={},i=0;i<this.faces.length;i++){var f,p,m,v=this.faces[i],g=!0,y=!1,_=void 0!==this.faceVertexUvs[0][i],x=0<v.normal.length(),w=0<v.vertexNormals.length,b=1!==v.color.r||1!==v.color.g||1!==v.color.b,M=0<v.vertexColors.length,T=0,T=S(T,0,0);T=S(T,1,g),T=S(T,2,y),T=S(T,3,_),T=S(T,4,x),T=S(T,5,w),T=S(T,6,b),T=S(T,7,M),o.push(T),o.push(v.a,v.b,v.c),o.push(v.materialIndex),_&&(f=this.faceVertexUvs[0][i],o.push(I(f[0]),I(f[1]),I(f[2]))),x&&o.push(E(v.normal)),w&&(p=v.vertexNormals,o.push(E(p[0]),E(p[1]),E(p[2]))),b&&o.push(A(v.color)),M&&(m=v.vertexColors,o.push(A(m[0]),A(m[1]),A(m[2])))}function S(e,t,n){return n?e|1<<t:e&~(1<<t)}function E(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==l[t]||(l[t]=s.length/3,s.push(e.x,e.y,e.z)),l[t]}function A(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==h[t]||(h[t]=u.length,u.push(e.getHex())),h[t]}function I(e){var t=e.x.toString()+e.y.toString();return void 0!==d[t]||(d[t]=c.length/2,c.push(e.x,e.y)),d[t]}return e.data={},e.data.vertices=r,e.data.normals=s,0<u.length&&(e.data.colors=u),0<c.length&&(e.data.uvs=[c]),e.data.faces=o,e},clone:function(){return(new ao).copy(this)},copy:function(e){var t,n;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;for(var r=e.vertices,i=0,a=r.length;i<a;i++)this.vertices.push(r[i].clone());for(var o=e.colors,i=0,a=o.length;i<a;i++)this.colors.push(o[i].clone());var s=e.faces;for(i=0,a=s.length;i<a;i++)this.faces.push(s[i].clone());for(i=0,a=e.faceVertexUvs.length;i<a;i++){var l=e.faceVertexUvs[i];for(void 0===this.faceVertexUvs[i]&&(this.faceVertexUvs[i]=[]),t=0,n=l.length;t<n;t++){for(var u=l[t],h=[],c=0,d=u.length;c<d;c++){var f=u[c];h.push(f.clone())}this.faceVertexUvs[i].push(h)}}var p=e.morphTargets;for(i=0,a=p.length;i<a;i++){var m={};if(m.name=p[i].name,void 0!==p[i].vertices)for(m.vertices=[],t=0,n=p[i].vertices.length;t<n;t++)m.vertices.push(p[i].vertices[t].clone());if(void 0!==p[i].normals)for(m.normals=[],t=0,n=p[i].normals.length;t<n;t++)m.normals.push(p[i].normals[t].clone());this.morphTargets.push(m)}var v=e.morphNormals;for(i=0,a=v.length;i<a;i++){var g={};if(void 0!==v[i].vertexNormals)for(g.vertexNormals=[],t=0,n=v[i].vertexNormals.length;t<n;t++){var y=v[i].vertexNormals[t],_={};_.a=y.a.clone(),_.b=y.b.clone(),_.c=y.c.clone(),g.vertexNormals.push(_)}if(void 0!==v[i].faceNormals)for(g.faceNormals=[],t=0,n=v[i].faceNormals.length;t<n;t++)g.faceNormals.push(v[i].faceNormals[t].clone());this.morphNormals.push(g)}var x=e.skinWeights;for(i=0,a=x.length;i<a;i++)this.skinWeights.push(x[i].clone());var w=e.skinIndices;for(i=0,a=w.length;i<a;i++)this.skinIndices.push(w[i].clone());var b=e.lineDistances;for(i=0,a=b.length;i<a;i++)this.lineDistances.push(b[i]);var M=e.boundingBox;null!==M&&(this.boundingBox=M.clone());var T=e.boundingSphere;return null!==T&&(this.boundingSphere=T.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var oo=function(e){(0,f.default)(l,e);var s=k(l);function l(e,t,n,r,i,a){var o;return(0,c.default)(this,l),o=s.call(this),o.type="BoxGeometry",o.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a},o.fromBufferGeometry(new so(e,t,n,r,i,a)),o.mergeVertices(),o}return l}(ao);t.CubeGeometry=t.BoxGeometry=oo;var so=function(e){(0,f.default)(u,e);var l=k(u);function u(e,t,n,r,i,a){var o;(0,c.default)(this,u),o=l.call(this),o.type="BoxBufferGeometry",o.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};var L=(0,h.default)(o);e=e||1,t=t||1,n=n||1,r=Math.floor(r)||1,i=Math.floor(i)||1,a=Math.floor(a)||1;var R=[],N=[],k=[],P=[],C=0,D=0;function s(e,t,n,r,i,a,o,s,l,u,h){for(var c=a/l,d=o/u,f=a/2,p=o/2,m=s/2,v=l+1,g=u+1,y=0,_=0,x=new Hr,w=0;w<g;w++)for(var b=w*d-p,M=0;M<v;M++){var T=M*c-f;x[e]=T*r,x[t]=b*i,x[n]=m,N.push(x.x,x.y,x.z),x[e]=0,x[t]=0,x[n]=0<s?1:-1,k.push(x.x,x.y,x.z),P.push(M/l),P.push(1-w/u),y+=1}for(w=0;w<u;w++)for(M=0;M<l;M++){var S=C+M+v*w,E=C+M+v*(w+1),A=C+(M+1)+v*(w+1),I=C+(M+1)+v*w;R.push(S,E,I),R.push(E,A,I),_+=6}L.addGroup(D,_,h),D+=_,C+=y}return s("z","y","x",-1,-1,n,t,e,a,i,0),s("z","y","x",1,-1,n,t,-e,a,i,1),s("x","z","y",1,1,e,n,t,r,a,2),s("x","z","y",1,-1,e,n,-t,r,a,3),s("x","y","z",1,-1,e,t,n,r,i,4),s("x","y","z",-1,-1,e,t,-n,r,i,5),o.setIndex(R),o.setAttribute("position",new Ma(N,3)),o.setAttribute("normal",new Ma(k,3)),o.setAttribute("uv",new Ma(P,2)),o}return u}(Ca);function lo(e){var t,n={};for(t in e)for(var r in n[t]={},e[t]){var i=e[t][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?n[t][r]=i.clone():(0,Ye.default)(i)?n[t][r]=(0,E.default)(i).call(i):n[t][r]=i}return n}function uo(e){for(var t={},n=0;n<e.length;n++){var r,i=lo(e[n]);for(r in i)t[r]=i[r]}return t}t.BoxBufferGeometry=so;var ho={clone:lo,merge:uo};t.UniformsUtils=ho;var co="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fo="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";function po(e){da.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=co,this.fragmentShader=fo,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}function mo(){mi.call(this),this.type="Camera",this.matrixWorldInverse=new Kr,this.projectionMatrix=new Kr,this.projectionMatrixInverse=new Kr}function vo(e,t,n,r){mo.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}po.prototype=(0,T.default)(da.prototype),po.prototype.constructor=po,po.prototype.isShaderMaterial=!0,po.prototype.copy=function(e){return da.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=lo(e.uniforms),this.defines=(0,qe.default)({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},po.prototype.toJSON=function(e){var t,n=da.prototype.toJSON.call(this,e);for(t in n.uniforms={},this.uniforms){var r=this.uniforms[t],i=r.value;i&&i.isTexture?n.uniforms[t]={type:"t",value:i.toJSON(e).uuid}:i&&i.isColor?n.uniforms[t]={type:"c",value:i.getHex()}:i&&i.isVector2?n.uniforms[t]={type:"v2",value:i.toArray()}:i&&i.isVector3?n.uniforms[t]={type:"v3",value:i.toArray()}:i&&i.isVector4?n.uniforms[t]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?n.uniforms[t]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?n.uniforms[t]={type:"m4",value:i.toArray()}:n.uniforms[t]={value:i}}0<(0,v.default)(this.defines).length&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader;var a,o={};for(a in this.extensions)!0===this.extensions[a]&&(o[a]=!0);return 0<(0,v.default)(o).length&&(n.extensions=o),n},mo.prototype=(0,qe.default)((0,T.default)(mi.prototype),{constructor:mo,isCamera:!0,copy:function(e,t){return mi.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new Hr),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){mi.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(e,t){mi.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),vo.prototype=(0,qe.default)((0,T.default)(mo.prototype),{constructor:vo,isPerspectiveCamera:!0,copy:function(e,t){return mo.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:(0,qe.default)({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*Nr.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*Nr.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*Nr.RAD2DEG*Math.atan(Math.tan(.5*Nr.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,r,i,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e,t,n=this.near,r=n*Math.tan(.5*Nr.DEG2RAD*this.fov)/this.zoom,i=2*r,a=this.aspect*i,o=-.5*a,s=this.view;null!==this.view&&this.view.enabled&&(e=s.fullWidth,t=s.fullHeight,o+=s.offsetX*a/e,r-=s.offsetY*i/t,a*=s.width/e,i*=s.height/t);var l=this.filmOffset;0!==l&&(o+=n*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+a,r,r-i,n,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=mi.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=(0,qe.default)({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}});var go=90,yo=1;function _o(e,t,n,r){mi.call(this),this.type="CubeCamera";var a=new vo(go,yo,e,t);a.up.set(0,-1,0),a.lookAt(new Hr(1,0,0)),this.add(a);var o=new vo(go,yo,e,t);o.up.set(0,-1,0),o.lookAt(new Hr(-1,0,0)),this.add(o);var s=new vo(go,yo,e,t);s.up.set(0,0,1),s.lookAt(new Hr(0,1,0)),this.add(s);var l=new vo(go,yo,e,t);l.up.set(0,0,-1),l.lookAt(new Hr(0,-1,0)),this.add(l);var u=new vo(go,yo,e,t);u.up.set(0,-1,0),u.lookAt(new Hr(0,0,1)),this.add(u);var h=new vo(go,yo,e,t);h.up.set(0,-1,0),h.lookAt(new Hr(0,0,-1)),this.add(h),r=r||{format:kt,magFilter:pt,minFilter:pt},this.renderTarget=new xo(n,r),this.renderTarget.texture.name="CubeCamera",this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var n=e.getRenderTarget(),r=this.renderTarget,i=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0),e.render(t,a),e.setRenderTarget(r,1),e.render(t,o),e.setRenderTarget(r,2),e.render(t,s),e.setRenderTarget(r,3),e.render(t,l),e.setRenderTarget(r,4),e.render(t,u),r.texture.generateMipmaps=i,e.setRenderTarget(r,5),e.render(t,h),e.setRenderTarget(n)},this.clear=function(e,t,n,r){for(var i=e.getRenderTarget(),a=this.renderTarget,o=0;o<6;o++)e.setRenderTarget(a,o),e.clear(t,n,r);e.setRenderTarget(i)}}function xo(e,t,n){(0,N.default)(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),Br.call(this,e,e,t)}function wo(e,t,n,r,i,a,o,s,l,u,h,c){Or.call(this,null,a,o,s,l,u,r,i,h,c),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==l?l:ut,this.minFilter=void 0!==u?u:ut,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}_o.prototype=(0,T.default)(mi.prototype),_o.prototype.constructor=_o,xo.prototype=(0,T.default)(Br.prototype),xo.prototype.constructor=xo,xo.prototype.isWebGLCubeRenderTarget=!0,xo.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=t.format,this.texture.encoding=t.encoding;var n=new vi,r={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include <begin_vertex>","\t#include <project_vertex>","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#define RECIPROCAL_PI 0.31830988618","#define RECIPROCAL_PI2 0.15915494","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV;","\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;","\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},i=new po({type:"CubemapFromEquirect",uniforms:lo(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:Xe,blending:we});i.uniforms.tEquirect.value=t;var a=new Qa(new so(5,5,5),i);n.add(a);var o=new _o(1,10,1);return o.renderTarget=this,o.renderTarget.texture.name="CubeCameraTexture",o.update(e,n),a.geometry.dispose(),a.material.dispose(),this},wo.prototype=(0,T.default)(Or.prototype),wo.prototype.constructor=wo,wo.prototype.isDataTexture=!0;var bo=new Pi,Mo=new Hr;function To(e,t,n,r,i,a){this.planes=[void 0!==e?e:new Wi,void 0!==t?t:new Wi,void 0!==n?n:new Wi,void 0!==r?r:new Wi,void 0!==i?i:new Wi,void 0!==a?a:new Wi]}(0,qe.default)(To.prototype,{set:function(e,t,n,r,i,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this},setFromProjectionMatrix:function(e){var t=this.planes,n=e.elements,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],l=n[5],u=n[6],h=n[7],c=n[8],d=n[9],f=n[10],p=n[11],m=n[12],v=n[13],g=n[14],y=n[15];return t[0].setComponents(o-r,h-s,p-c,y-m).normalize(),t[1].setComponents(o+r,h+s,p+c,y+m).normalize(),t[2].setComponents(o+i,h+l,p+d,y+v).normalize(),t[3].setComponents(o-i,h-l,p-d,y-v).normalize(),t[4].setComponents(o-a,h-u,p-f,y-g).normalize(),t[5].setComponents(o+a,h+u,p+f,y+g).normalize(),this},intersectsObject:function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),bo.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(bo)},intersectsSprite:function(e){return bo.center.set(0,0,0),bo.radius=.7071067811865476,bo.applyMatrix4(e.matrixWorld),this.intersectsSphere(bo)},intersectsSphere:function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++){var a=t[i].distanceToPoint(n);if(a<r)return!1}return!0},intersectsBox:function(e){for(var t=this.planes,n=0;n<6;n++){var r=t[n];if(Mo.x=0<r.normal.x?e.max.x:e.min.x,Mo.y=0<r.normal.y?e.max.y:e.min.y,Mo.z=0<r.normal.z?e.max.z:e.min.z,r.distanceToPoint(Mo)<0)return!1}return!0},containsPoint:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}});var So={common:{diffuse:{value:new oa(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Pr},uv2Transform:{value:new Pr},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new kr(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new oa(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new oa(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Pr}},sprite:{diffuse:{value:new oa(15658734)},opacity:{value:1},center:{value:new kr(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Pr}}};function Eo(){var n=null,r=!1,i=null;function a(e,t){!1!==r&&(i(e,t),n.requestAnimationFrame(a))}return{start:function(){!0!==r&&null!==i&&(n.requestAnimationFrame(a),r=!0)},stop:function(){r=!1},setAnimationLoop:function(e){i=e},setContext:function(e){n=e}}}function Ao(o,e){var a=e.isWebGL2,r=new re.default;function i(e,t){var n=e.array,r=e.usage,i=o.createBuffer();o.bindBuffer(t,i),o.bufferData(t,n,r),e.onUploadCallback();var a=5126;return n instanceof Float32Array?a=5126:n instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):n instanceof Uint16Array?a=5123:n instanceof Int16Array?a=5122:n instanceof Uint32Array?a=5125:n instanceof Int32Array?a=5124:n instanceof Int8Array?a=5120:n instanceof Uint8Array&&(a=5121),{buffer:i,type:a,bytesPerElement:n.BYTES_PER_ELEMENT,version:e.version}}function s(e,t,n){var r=t.array,i=t.updateRange;o.bindBuffer(n,e),-1===i.count?o.bufferSubData(n,0,r):(a?o.bufferSubData(n,i.offset*r.BYTES_PER_ELEMENT,r,i.offset,i.count):o.bufferSubData(n,i.offset*r.BYTES_PER_ELEMENT,r.subarray(i.offset,i.offset+i.count)),i.count=-1)}function t(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)}function n(e){e.isInterleavedBufferAttribute&&(e=e.data);var t=r.get(e);t&&(o.deleteBuffer(t.buffer),r.delete(e))}function l(e,t){e.isInterleavedBufferAttribute&&(e=e.data);var n=r.get(e);void 0===n?r.set(e,i(e,t)):n.version<e.version&&(s(n.buffer,e,t),n.version=e.version)}return{get:t,remove:n,update:l}}function Io(e,t,n,r){ao.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new Lo(e,t,n,r)),this.mergeVertices()}function Lo(e,t,n,r){Ca.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r},e=e||1,t=t||1;for(var i=e/2,a=t/2,o=Math.floor(n)||1,s=Math.floor(r)||1,l=o+1,u=s+1,h=e/o,c=t/s,d=[],f=[],p=[],m=[],v=0;v<u;v++)for(var g=v*c-a,y=0;y<l;y++){var _=y*h-i;f.push(_,-g,0),p.push(0,0,1),m.push(y/o),m.push(1-v/s)}for(v=0;v<s;v++)for(y=0;y<o;y++){var x=y+l*v,w=y+l*(v+1),b=y+1+l*(v+1),M=y+1+l*v;d.push(x,w,M),d.push(w,b,M)}this.setIndex(d),this.setAttribute("position",new Ma(f,3)),this.setAttribute("normal",new Ma(p,3)),this.setAttribute("uv",new Ma(m,2))}t.UniformsLib=So,Io.prototype=(0,T.default)(ao.prototype),Io.prototype.constructor=Io,Lo.prototype=(0,T.default)(Ca.prototype),Lo.prototype.constructor=Lo;var Ro="#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",No="#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",ko="#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",Po="#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",Co="#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",Do="vec3 transformed = vec3( position );",Oo="vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",Fo="vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",Bo="#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",Uo="#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",zo="#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",Go="#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",Vo="#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",Ho="#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",jo="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",Wo="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",Yo="#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",qo="#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}",Xo="#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\nfloat getFace(vec3 direction) {\n vec3 absDirection = abs(direction);\n float face = -1.0;\n if (absDirection.x > absDirection.z) {\n if (absDirection.x > absDirection.y)\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if (absDirection.z > absDirection.y)\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n}\nvec2 getUV(vec3 direction, float face) {\n vec2 uv;\n if (face == 0.0) {\n uv = vec2(-direction.z, direction.y) / abs(direction.x);\n } else if (face == 1.0) {\n uv = vec2(direction.x, -direction.z) / abs(direction.y);\n } else if (face == 2.0) {\n uv = direction.xy / abs(direction.z);\n } else if (face == 3.0) {\n uv = vec2(direction.z, direction.y) / abs(direction.x);\n } else if (face == 4.0) {\n uv = direction.xz / abs(direction.y);\n } else {\n uv = vec2(-direction.x, direction.y) / abs(direction.z);\n }\n return 0.5 * (uv + 1.0);\n}\nvec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {\n float face = getFace(direction);\n float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n mipInt = max(mipInt, cubeUV_minMipLevel);\n float faceSize = exp2(mipInt);\n float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n vec2 uv = getUV(direction, face) * (faceSize - 1.0);\n vec2 f = fract(uv);\n uv += 0.5 - f;\n if (face > 2.0) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n if(mipInt < cubeUV_maxMipLevel){\n uv.y += 2.0 * cubeUV_maxTileSize;\n }\n uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n uv *= texelSize;\n vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize;\n vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize;\n vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize;\n vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n return mix(tm, bm, f.y);\n}\n#define r0 1.0\n#define v0 0.339\n#define m0 -2.0\n#define r1 0.8\n#define v1 0.276\n#define m1 -1.0\n#define r4 0.4\n#define v4 0.046\n#define m4 2.0\n#define r5 0.305\n#define v5 0.016\n#define m5 3.0\n#define r6 0.21\n#define v6 0.0038\n#define m6 4.0\nfloat roughnessToMip(float roughness) {\n float mip = 0.0;\n if (roughness >= r1) {\n mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;\n } else if (roughness >= r4) {\n mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;\n } else if (roughness >= r5) {\n mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;\n } else if (roughness >= r6) {\n mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;\n } else {\n mip = -2.0 * log2(1.16 * roughness); }\n return mip;\n}\nvec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {\n float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n float mipF = fract(mip);\n float mipInt = floor(mip);\n vec3 color0 = bilinearCubeUV(envMap, sampleDir, mipInt);\n if (mipF == 0.0) {\n return vec4(color0, 1.0);\n } else {\n vec3 color1 = bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);\n return vec4(mix(color0, color1, mipF), 1.0);\n }\n}\n#endif",Zo="vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",Jo="#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",Ko="#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",Qo="#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",$o="#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",es="gl_FragColor = linearToOutputTexel( gl_FragColor );",ts="\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",ns="#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",rs="#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",is="#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",as="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",os="#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) { \n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",ss="#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",ls="#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",us="#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",hs="#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",cs="#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",ds="#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",fs="#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",ps="vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",ms="uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",vs="#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",gs="ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",ys="varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",_s="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",xs="varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",ws="PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",bs="struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",Ms="\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",Ts="#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",Ss="#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",Es="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",As="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",Is="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",Ls="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",Rs="#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\t#ifdef USE_MAP_MIXCOLOR\n diffuseColor = texelColor*texelColor.a + diffuseColor*(1.0-texelColor.a);\n #else\n diffuseColor *= texelColor;\n #endif\n #endif\n",Ns="#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",ks="#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",Ps="#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",Cs="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",Ds="#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",Os="#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",Fs="#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",Bs="#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",Us="#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",zs="#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",Gs="#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",Vs="#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",Hs="#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",js="#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",Ws="vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",Ys="#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",qs="vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",Xs="#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",Zs="#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",Js="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",Ks="#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",Qs="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",$s="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",el="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",tl="float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",nl="#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",rl="#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",il="#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",al="#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",ol="float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",sl="#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",ll="#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",ul="#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",hl="#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",cl="#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",dl="#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",fl="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",pl="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",ml="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",vl="#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",gl="uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",yl="varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",_l="#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",xl="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",wl="#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",bl="#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",Ml="#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",Tl="#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",Sl="uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",El="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",Al="uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",Il="uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",Ll="uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",Rl="#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",Nl="uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",kl="#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",Pl="#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",Cl="#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",Dl="#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",Ol="#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",Fl="#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\tgl_FragColor =vec4(1.0,0.2,0.3,1.0);\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",Bl="#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",Ul="#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\nuniform vec3 diffuse;\nuniform float test;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\tif(test == 1.0){\n\tgl_FragColor = vec4( 1.0,1.0,0.2,1.0 );\n\t}\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",zl="#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",Gl="#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",Vl="#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",Hl="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",jl="uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",Wl="uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",Yl="#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",ql="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",Xl="uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",Zl={alphamap_fragment:Ro,alphamap_pars_fragment:No,alphatest_fragment:ko,aomap_fragment:Po,aomap_pars_fragment:Co,begin_vertex:Do,beginnormal_vertex:Oo,bsdfs:Fo,bumpmap_pars_fragment:Bo,clipping_planes_fragment:Uo,clipping_planes_pars_fragment:zo,clipping_planes_pars_vertex:Go,clipping_planes_vertex:Vo,color_fragment:Ho,color_pars_fragment:jo,color_pars_vertex:Wo,color_vertex:Yo,common:qo,cube_uv_reflection_fragment:Xo,defaultnormal_vertex:Zo,displacementmap_pars_vertex:Jo,displacementmap_vertex:Ko,emissivemap_fragment:Qo,emissivemap_pars_fragment:$o,encodings_fragment:es,encodings_pars_fragment:ts,envmap_fragment:ns,envmap_common_pars_fragment:rs,envmap_pars_fragment:is,envmap_pars_vertex:as,envmap_physical_pars_fragment:vs,envmap_vertex:os,fog_vertex:ss,fog_pars_vertex:ls,fog_fragment:us,fog_pars_fragment:hs,gradientmap_pars_fragment:cs,lightmap_fragment:ds,lightmap_pars_fragment:fs,lights_lambert_vertex:ps,lights_pars_begin:ms,lights_toon_fragment:gs,lights_toon_pars_fragment:ys,lights_phong_fragment:_s,lights_phong_pars_fragment:xs,lights_physical_fragment:ws,lights_physical_pars_fragment:bs,lights_fragment_begin:Ms,lights_fragment_maps:Ts,lights_fragment_end:Ss,logdepthbuf_fragment:Es,logdepthbuf_pars_fragment:As,logdepthbuf_pars_vertex:Is,logdepthbuf_vertex:Ls,map_fragment:Rs,map_pars_fragment:Ns,map_particle_fragment:ks,map_particle_pars_fragment:Ps,metalnessmap_fragment:Cs,metalnessmap_pars_fragment:Ds,morphnormal_vertex:Os,morphtarget_pars_vertex:Fs,morphtarget_vertex:Bs,normal_fragment_begin:Us,normal_fragment_maps:zs,normalmap_pars_fragment:Gs,clearcoat_normal_fragment_begin:Vs,clearcoat_normal_fragment_maps:Hs,clearcoat_pars_fragment:js,packing:Ws,premultiplied_alpha_fragment:Ys,project_vertex:qs,dithering_fragment:Xs,dithering_pars_fragment:Zs,roughnessmap_fragment:Js,roughnessmap_pars_fragment:Ks,shadowmap_pars_fragment:Qs,shadowmap_pars_vertex:$s,shadowmap_vertex:el,shadowmask_pars_fragment:tl,skinbase_vertex:nl,skinning_pars_vertex:rl,skinning_vertex:il,skinnormal_vertex:al,specularmap_fragment:ol,specularmap_pars_fragment:sl,tonemapping_fragment:ll,tonemapping_pars_fragment:ul,uv_pars_fragment:hl,uv_pars_vertex:cl,uv_vertex:dl,uv2_pars_fragment:fl,uv2_pars_vertex:pl,uv2_vertex:ml,worldpos_vertex:vl,background_frag:gl,background_vert:yl,cube_frag:_l,cube_vert:xl,depth_frag:wl,depth_vert:bl,distanceRGBA_frag:Ml,distanceRGBA_vert:Tl,equirect_frag:Sl,equirect_vert:El,linedashed_frag:Al,linedashed_vert:Il,meshbasic_frag:Ll,meshbasic_vert:Rl,meshlambert_frag:Nl,meshlambert_vert:kl,meshmatcap_frag:Pl,meshmatcap_vert:Cl,meshtoon_frag:Dl,meshtoon_vert:Ol,meshphong_frag:Fl,meshphong_vert:Bl,meshphysical_frag:Ul,meshphysical_vert:zl,normal_frag:Gl,normal_vert:Vl,points_frag:Hl,points_vert:jl,shadow_frag:Wl,shadow_vert:Yl,sprite_frag:ql,sprite_vert:Xl};t.ShaderChunk=Zl;var Jl={basic:{uniforms:uo([So.common,So.specularmap,So.envmap,So.aomap,So.lightmap,So.fog]),vertexShader:Zl.meshbasic_vert,fragmentShader:Zl.meshbasic_frag},lambert:{uniforms:uo([So.common,So.specularmap,So.envmap,So.aomap,So.lightmap,So.emissivemap,So.fog,So.lights,{emissive:{value:new oa(0)}}]),vertexShader:Zl.meshlambert_vert,fragmentShader:Zl.meshlambert_frag},phong:{uniforms:uo([So.common,So.specularmap,So.envmap,So.aomap,So.lightmap,So.emissivemap,So.bumpmap,So.normalmap,So.displacementmap,So.fog,So.lights,{emissive:{value:new oa(0)},specular:{value:new oa(1118481)},shininess:{value:30}}]),vertexShader:Zl.meshphong_vert,fragmentShader:Zl.meshphong_frag},standard:{uniforms:uo([So.common,So.envmap,So.aomap,So.lightmap,So.emissivemap,So.bumpmap,So.normalmap,So.displacementmap,So.roughnessmap,So.metalnessmap,So.fog,So.lights,{emissive:{value:new oa(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:Zl.meshphysical_vert,fragmentShader:Zl.meshphysical_frag},toon:{uniforms:uo([So.common,So.specularmap,So.aomap,So.lightmap,So.emissivemap,So.bumpmap,So.normalmap,So.displacementmap,So.gradientmap,So.fog,So.lights,{emissive:{value:new oa(0)},specular:{value:new oa(1118481)},shininess:{value:30}}]),vertexShader:Zl.meshtoon_vert,fragmentShader:Zl.meshtoon_frag},matcap:{uniforms:uo([So.common,So.bumpmap,So.normalmap,So.displacementmap,So.fog,{matcap:{value:null}}]),vertexShader:Zl.meshmatcap_vert,fragmentShader:Zl.meshmatcap_frag},points:{uniforms:uo([So.points,So.fog]),vertexShader:Zl.points_vert,fragmentShader:Zl.points_frag},dashed:{uniforms:uo([So.common,So.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Zl.linedashed_vert,fragmentShader:Zl.linedashed_frag},depth:{uniforms:uo([So.common,So.displacementmap]),vertexShader:Zl.depth_vert,fragmentShader:Zl.depth_frag},normal:{uniforms:uo([So.common,So.bumpmap,So.normalmap,So.displacementmap,{opacity:{value:1}}]),vertexShader:Zl.normal_vert,fragmentShader:Zl.normal_frag},sprite:{uniforms:uo([So.sprite,So.fog]),vertexShader:Zl.sprite_vert,fragmentShader:Zl.sprite_frag},background:{uniforms:{uvTransform:{value:new Pr},t2D:{value:null}},vertexShader:Zl.background_vert,fragmentShader:Zl.background_frag},cube:{uniforms:uo([So.envmap,{opacity:{value:1}}]),vertexShader:Zl.cube_vert,fragmentShader:Zl.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Zl.equirect_vert,fragmentShader:Zl.equirect_frag},distanceRGBA:{uniforms:uo([So.common,So.displacementmap,{referencePosition:{value:new Hr},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Zl.distanceRGBA_vert,fragmentShader:Zl.distanceRGBA_frag},shadow:{uniforms:uo([So.lights,So.fog,{color:{value:new oa(0)},opacity:{value:1}}]),vertexShader:Zl.shadow_vert,fragmentShader:Zl.shadow_frag}};function Kl(l,n,u,r){var h,c,d=new oa(0),f=0,p=null,m=0,v=null;function e(e,t,n,r){var i,a=t.background,o=l.xr,s=o.getSession&&o.getSession();s&&"additive"===s.environmentBlendMode&&(a=null),null===a?g(d,f):a&&a.isColor&&(g(a,1),r=!0),(l.autoClear||r)&&l.clear(l.autoClearColor,l.autoClearDepth,l.autoClearStencil),a&&(a.isCubeTexture||a.isWebGLCubeRenderTarget||a.mapping===it)?(void 0===c&&(c=new Qa(new so(1,1,1),new po({type:"BackgroundCubeMaterial",uniforms:lo(Jl.cube.uniforms),vertexShader:Jl.cube.vertexShader,fragmentShader:Jl.cube.fragmentShader,side:Xe,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},(0,R.default)(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),u.update(c)),i=a.isWebGLCubeRenderTarget?a.texture:a,c.material.uniforms.envMap.value=i,c.material.uniforms.flipEnvMap.value=i.isCubeTexture?-1:1,p===a&&m===i.version&&v===l.toneMapping||(c.material.needsUpdate=!0,p=a,m=i.version,v=l.toneMapping),e.unshift(c,c.geometry,c.material,0,0,null)):a&&a.isTexture&&(void 0===h&&(h=new Qa(new Lo(2,2),new po({type:"BackgroundMaterial",uniforms:lo(Jl.background.uniforms),vertexShader:Jl.background.vertexShader,fragmentShader:Jl.background.fragmentShader,side:Y,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),(0,R.default)(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),u.update(h)),h.material.uniforms.t2D.value=a,!0===a.matrixAutoUpdate&&a.updateMatrix(),h.material.uniforms.uvTransform.value.copy(a.matrix),p===a&&m===a.version&&v===l.toneMapping||(h.material.needsUpdate=!0,p=a,m=a.version,v=l.toneMapping),e.unshift(h,h.geometry,h.material,0,0,null))}function g(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,r)}return{getClearColor:function(){return d},setClearColor:function(e,t){d.set(e),f=void 0!==t?t:1,g(d,f)},getClearAlpha:function(){return f},setClearAlpha:function(e){f=e,g(d,f)},render:e}}function Ql(o,s,l,e){var u,h=e.isWebGL2;function t(e){u=e}function n(e,t){o.drawArrays(u,e,t),l.update(t,u)}function r(e,t,n,r){if(0!==r){var i,a;if(h)i=o,a="drawArraysInstanced";else if(i=s.get("ANGLE_instanced_arrays"),a="drawArraysInstancedANGLE",null===i)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");i[a](u,t,n,r),l.update(n,u,r)}}this.setMode=t,this.render=n,this.renderInstances=r}function $l(t,n,e){var r;function i(){if(void 0!==r)return r;var e=n.get("EXT_texture_filter_anisotropic");return r=null!==e?t.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,r}function a(e){if("highp"===e){if(0<t.getShaderPrecisionFormat(35633,36338).precision&&0<t.getShaderPrecisionFormat(35632,36338).precision)return"highp";e="mediump"}return"mediump"===e&&0<t.getShaderPrecisionFormat(35633,36337).precision&&0<t.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext,s=void 0!==e.precision?e.precision:"highp",l=a(s);l!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",l,"instead."),s=l);var u=!0===e.logarithmicDepthBuffer,h=t.getParameter(34930),c=t.getParameter(35660),d=t.getParameter(3379),f=t.getParameter(34076),p=t.getParameter(34921),m=t.getParameter(36347),v=t.getParameter(36348),g=t.getParameter(36349),y=0<c,_=o||!!n.get("OES_texture_float"),x=y&&_,w=o?t.getParameter(36183):0;return{isWebGL2:o,getMaxAnisotropy:i,getMaxPrecision:a,precision:s,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:c,maxTextureSize:d,maxCubemapSize:f,maxAttributes:p,maxVertexUniforms:m,maxVaryings:v,maxFragmentUniforms:g,vertexTextures:y,floatFragmentTextures:_,floatVertexTextures:x,maxSamples:w}}function eu(){var h=this,c=null,d=0,f=!1,p=!1,m=new Wi,v=new Pr,g={value:null,needsUpdate:!1};function y(){g.value!==c&&(g.value=c,g.needsUpdate=0<d),h.numPlanes=d,h.numIntersection=0}function _(e,t,n,r){var i=null!==e?e.length:0,a=null;if(0!==i){if(a=g.value,!0!==r||null===a){var o=n+4*i,s=t.matrixWorldInverse;v.getNormalMatrix(s),(null===a||a.length<o)&&(a=new Float32Array(o));for(var l=0,u=n;l!==i;++l,u+=4)m.copy(e[l]).applyMatrix4(s,v),m.normal.toArray(a,u),a[u+3]=m.constant}g.value=a,g.needsUpdate=!0}return h.numPlanes=i,h.numIntersection=0,a}this.uniform=g,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t,n){var r=0!==e.length||t||0!==d||f;return f=t,c=_(e,n,0),d=e.length,r},this.beginShadows=function(){p=!0,_(null)},this.endShadows=function(){p=!1,y()},this.setState=function(e,t,n,r,i,a){if(!f||null===e||0===e.length||p&&!n)p?_(null):y();else{var o=p?0:d,s=4*o,l=i.clippingState||null;g.value=l,l=_(e,r,s,a);for(var u=0;u!==s;++u)l[u]=c[u];i.clippingState=l,this.numIntersection=t?this.numPlanes:0,this.numPlanes+=o}}}function tu(n){var r={};return{get:function(e){if(void 0!==r[e])return r[e];var t;switch(e){case"WEBGL_depth_texture":t=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":t=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":t=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":t=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:t=n.getExtension(e)}return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),r[e]=t,t}}}function nu(e,f,a){var o=new re.default,p=new re.default;function s(e){var t,n=e.target,r=o.get(n);for(t in null!==r.index&&f.remove(r.index),r.attributes)f.remove(r.attributes[t]);n.removeEventListener("dispose",s),o.delete(n);var i=p.get(r);i&&(f.remove(i),p.delete(r)),a.memory.geometries--}function t(e,t){var n=o.get(t);return n||(t.addEventListener("dispose",s),t.isBufferGeometry?n=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new Ca).setFromObject(e)),n=t._bufferGeometry),o.set(t,n),a.memory.geometries++,n)}function n(e){var t=e.index,n=e.attributes;for(r in null!==t&&f.update(t,34963),n)f.update(n[r],34962);var r,i=e.morphAttributes;for(r in i)for(var a=i[r],o=0,s=a.length;o<s;o++)f.update(a[o],34962)}function r(e){var t=[],n=e.index,r=e.attributes.position,i=0;if(null!==n)for(var a=n.array,i=n.version,o=0,s=a.length;o<s;o+=3){var l=a[o+0],u=a[o+1],h=a[o+2];t.push(l,u,u,h,h,l)}else for(a=r.array,i=r.version,o=0,s=a.length/3-1;o<s;o+=3)l=o+0,u=o+1,h=o+2,t.push(l,u,u,h,h,l);var c=new(65535<Ea(t)?ba:xa)(t,1);c.version=i,f.update(c,34963);var d=p.get(e);d&&f.remove(d),p.set(e,c)}function i(e){var t,n=p.get(e);return n?(t=e.index,null!==t&&n.version<t.version&&r(e)):r(e),p.get(e)}return{get:t,update:n,getWireframeAttribute:i}}function ru(o,s,l,e){var u,h,c,d=e.isWebGL2;function t(e){u=e}function n(e){h=e.type,c=e.bytesPerElement}function r(e,t){o.drawElements(u,t,h,e*c),l.update(t,u)}function i(e,t,n,r){if(0!==r){var i,a;if(d)i=o,a="drawElementsInstanced";else if(i=s.get("ANGLE_instanced_arrays"),a="drawElementsInstancedANGLE",null===i)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");i[a](u,n,h,t*c,r),l.update(n,u,r)}}this.setMode=t,this.setIndex=n,this.render=r,this.renderInstances=i}function iu(){var e={geometries:0,textures:0},r={frame:0,calls:0,triangles:0,points:0,lines:0};function t(e,t,n){switch(n=n||1,r.calls++,t){case 4:r.triangles+=n*(e/3);break;case 1:r.lines+=n*(e/2);break;case 3:r.lines+=n*(e-1);break;case 2:r.lines+=n*e;break;case 0:r.points+=n*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",t)}}function n(){r.frame++,r.calls=0,r.triangles=0,r.points=0,r.lines=0}return{memory:e,render:r,programs:null,autoReset:!0,reset:n,update:t}}function au(e,t){return Math.abs(t[1])-Math.abs(e[1])}function ou(m){var v={},g=new Float32Array(8);function e(e,t,n,r){var i=e.morphTargetInfluences,a=void 0===i?0:i.length,o=v[t.id];if(void 0===o){o=[];for(var s=0;s<a;s++)o[s]=[s,0];v[t.id]=o}for(var l=n.morphTargets&&t.morphAttributes.position,u=n.morphNormals&&t.morphAttributes.normal,s=0;s<a;s++){var h=o[s];0!==h[1]&&(l&&t.deleteAttribute("morphTarget"+s),u&&t.deleteAttribute("morphNormal"+s))}for(s=0;s<a;s++)h=o[s],h[0]=s,h[1]=i[s];(0,je.default)(o).call(o,au);for(var c=0,s=0;s<8;s++){if(h=o[s],h){var d=h[0],f=h[1];if(f){l&&t.setAttribute("morphTarget"+s,l[d]),u&&t.setAttribute("morphNormal"+s,u[d]),g[s]=f,c+=f;continue}}g[s]=0}var p=t.morphTargetsRelative?1:1-c;r.getUniforms().setValue(m,"morphTargetBaseInfluence",p),r.getUniforms().setValue(m,"morphTargetInfluences",g)}return{update:e}}function su(e,i,a,o){var s=new re.default;function t(e){var t=o.render.frame,n=e.geometry,r=i.get(e,n);return s.get(r)!==t&&(n.isGeometry&&r.updateFromObject(e),i.update(r),s.set(r,t)),e.isInstancedMesh&&a.update(e.instanceMatrix,34962),r}function n(){s=new re.default}return{update:t,dispose:n}}function lu(e,t,n,r,i,a,o,s,l,u){e=void 0!==e?e:[],t=void 0!==t?t:he,o=void 0!==o?o:kt,Or.call(this,e,t,n,r,i,a,o,s,l,u),this.flipY=!1}function uu(e,t,n,r){Or.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:r||1},this.magFilter=ut,this.minFilter=ut,this.wrapR=st,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function hu(e,t,n,r){Or.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:r||1},this.magFilter=ut,this.minFilter=ut,this.wrapR=st,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}t.ShaderLib=Jl,Jl.physical={uniforms:uo([Jl.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new kr(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new oa(0)},transparency:{value:0}}]),vertexShader:Zl.meshphysical_vert,fragmentShader:Zl.meshphysical_frag},lu.prototype=(0,T.default)(Or.prototype),lu.prototype.constructor=lu,lu.prototype.isCubeTexture=!0,(0,R.default)(lu.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}}),uu.prototype=(0,T.default)(Or.prototype),uu.prototype.constructor=uu,uu.prototype.isDataTexture2DArray=!0,hu.prototype=(0,T.default)(Or.prototype),hu.prototype.constructor=hu,hu.prototype.isDataTexture3D=!0;var cu=new Or,du=new uu,fu=new hu,pu=new lu,mu=[],vu=[],gu=new Float32Array(16),yu=new Float32Array(9),_u=new Float32Array(4);function xu(e,t,n){var r=e[0];if(r<=0||0<r)return e;var i=t*n,a=mu[i];if(void 0===a&&(a=new Float32Array(i),mu[i]=a),0!==t){r.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=n,e[o].toArray(a,s)}return a}function wu(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function bu(e,t){for(var n=0,r=t.length;n<r;n++)e[n]=t[n]}function Mu(e,t){var n=vu[t];void 0===n&&(n=new Int32Array(t),vu[t]=n);for(var r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function Tu(e,t){var n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function Su(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(wu(n,t))return;e.uniform2fv(this.addr,t),bu(n,t)}}function Eu(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(wu(n,t))return;e.uniform3fv(this.addr,t),bu(n,t)}}function Au(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(wu(n,t))return;e.uniform4fv(this.addr,t),bu(n,t)}}function Iu(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(wu(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),bu(n,t)}else{if(wu(n,r))return;_u.set(r),e.uniformMatrix2fv(this.addr,!1,_u),bu(n,r)}}function Lu(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(wu(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),bu(n,t)}else{if(wu(n,r))return;yu.set(r),e.uniformMatrix3fv(this.addr,!1,yu),bu(n,r)}}function Ru(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(wu(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),bu(n,t)}else{if(wu(n,r))return;gu.set(r),e.uniformMatrix4fv(this.addr,!1,gu),bu(n,r)}}function Nu(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTexture2D(t||cu,i)}function ku(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||du,i)}function Pu(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||fu,i)}function Cu(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTextureCube(t||pu,i)}function Du(e,t){var n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function Ou(e,t){var n=this.cache;wu(n,t)||(e.uniform2iv(this.addr,t),bu(n,t))}function Fu(e,t){var n=this.cache;wu(n,t)||(e.uniform3iv(this.addr,t),bu(n,t))}function Bu(e,t){var n=this.cache;wu(n,t)||(e.uniform4iv(this.addr,t),bu(n,t))}function Uu(e,t){var n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function zu(e){switch(e){case 5126:return Tu;case 35664:return Su;case 35665:return Eu;case 35666:return Au;case 35674:return Iu;case 35675:return Lu;case 35676:return Ru;case 5124:case 35670:return Du;case 35667:case 35671:return Ou;case 35668:case 35672:return Fu;case 35669:case 35673:return Bu;case 5125:return Uu;case 35678:case 36198:case 36298:case 36306:case 35682:return Nu;case 35679:case 36299:case 36307:return Pu;case 35680:case 36300:case 36308:case 36293:return Cu;case 36289:case 36303:case 36311:case 36292:return ku}}function Gu(e,t){e.uniform1fv(this.addr,t)}function Vu(e,t){e.uniform1iv(this.addr,t)}function Hu(e,t){e.uniform2iv(this.addr,t)}function ju(e,t){e.uniform3iv(this.addr,t)}function Wu(e,t){e.uniform4iv(this.addr,t)}function Yu(e,t){var n=xu(t,this.size,2);e.uniform2fv(this.addr,n)}function qu(e,t){var n=xu(t,this.size,3);e.uniform3fv(this.addr,n)}function Xu(e,t){var n=xu(t,this.size,4);e.uniform4fv(this.addr,n)}function Zu(e,t){var n=xu(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function Ju(e,t){var n=xu(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function Ku(e,t){var n=xu(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function Qu(e,t,n){var r=t.length,i=Mu(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTexture2D(t[a]||cu,i[a])}function $u(e,t,n){var r=t.length,i=Mu(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTextureCube(t[a]||pu,i[a])}function eh(e){switch(e){case 5126:return Gu;case 35664:return Yu;case 35665:return qu;case 35666:return Xu;case 35674:return Zu;case 35675:return Ju;case 35676:return Ku;case 5124:case 35670:return Vu;case 35667:case 35671:return Hu;case 35668:case 35672:return ju;case 35669:case 35673:return Wu;case 35678:case 36198:case 36298:case 36306:case 35682:return Qu;case 35680:case 36300:case 36308:case 36293:return $u}}function th(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=zu(t.type)}function nh(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=eh(t.type)}function rh(e){this.id=e,this.seq=[],this.map={}}nh.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),bu(t,e)},rh.prototype.setValue=function(e,t,n){for(var r=this.seq,i=0,a=r.length;i!==a;++i){var o=r[i];o.setValue(e,t[o.id],n)}};var ih=/([\w\d_]+)(\])?(\[|\.)?/g;function ah(e,t){e.seq.push(t),(0,We.default)(e)[t.id]=t}function oh(e,t,n){var r=e.name,i=r.length;for(ih.lastIndex=0;;){var a=ih.exec(r),o=ih.lastIndex,s=a[1],l="]"===a[2],u=a[3];if(l&&(s|=0),void 0===u||"["===u&&o+2===i){ah(n,new(void 0===u?th:nh)(s,e,t));break}var h=(0,We.default)(n),c=h[s];void 0===c&&(c=new rh(s),ah(n,c)),n=c}}function sh(e,t){this.seq=[],this.map={};for(var n=e.getProgramParameter(t,35718),r=0;r<n;++r){var i=e.getActiveUniform(t,r),a=e.getUniformLocation(t,i.name);oh(i,a,this)}}function lh(e,t,n){var r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}sh.prototype.setValue=function(e,t,n,r){var i=(0,We.default)(this)[t];void 0!==i&&i.setValue(e,n,r)},sh.prototype.setOptional=function(e,t,n){var r=t[n];void 0!==r&&this.setValue(e,n,r)},sh.upload=function(e,t,n,r){for(var i=0,a=t.length;i!==a;++i){var o=t[i],s=n[o.id];!1!==s.needsUpdate&&o.setValue(e,s.value,r)}},sh.seqWithValue=function(e,t){for(var n=[],r=0,i=e.length;r!==i;++r){var a=e[r];a.id in t&&n.push(a)}return n};var uh=0;function hh(e){for(var t=e.split("\n"),n=0;n<t.length;n++)t[n]=n+1+": "+t[n];return t.join("\n")}function ch(e){switch(e){case jn:return["Linear","( value )"];case Wn:return["sRGB","( value )"];case qn:return["RGBE","( value )"];case Zn:return["RGBM","( value, 7.0 )"];case Jn:return["RGBM","( value, 16.0 )"];case Kn:return["RGBD","( value, 256.0 )"];case Yn:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case Xn:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+e)}}function dh(e,t,n){var r,i=e.getShaderParameter(t,35713),a=(0,z.default)(r=e.getShaderInfoLog(t)).call(r);if(i&&""===a)return"";var o=e.getShaderSource(t);return"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+a+hh(o)}function fh(e,t){var n=ch(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function ph(e,t){var n=ch(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function mh(e,t){var n;switch(t){case nt:n="Linear";break;case $:n="Reinhard";break;case ee:n="Uncharted2";break;case te:n="OptimizedCineon";break;case le:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function vh(e){var t=[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""];return(0,U.default)(t).call(t,_h).join("\n")}function gh(e){var t,n=[];for(t in e){var r=e[t];!1!==r&&n.push("#define "+t+" "+r)}return n.join("\n")}function yh(e,t){for(var n={},r=e.getProgramParameter(t,35721),i=0;i<r;i++){var a=e.getActiveAttrib(t,i),o=a.name;n[o]=e.getAttribLocation(t,o)}return n}function _h(e){return""!==e}function xh(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function wh(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var bh=/^[ \t]*#include +<([\w\d./]+)>/gm;function Mh(e){return e.replace(bh,Th)}function Th(e,t){var n=Zl[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Mh(n)}var Sh=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Eh=/#pragma unroll_loop_start[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g;function Ah(e){return e.replace(Eh,Lh).replace(Sh,Ih)}function Ih(e,t,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Lh(e,t,n,r)}function Lh(e,t,n,r){for(var i="",a=(0,w.default)(t);a<(0,w.default)(n);a++)i+=r.replace(/\[ i \]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return i}function Rh(e){var t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function Nh(e){var t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===H?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===j?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===W&&(t="SHADOWMAP_TYPE_VSM"),t}function kh(e){var t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case he:case ce:t="ENVMAP_TYPE_CUBE";break;case it:case at:t="ENVMAP_TYPE_CUBE_UV";break;case de:case fe:t="ENVMAP_TYPE_EQUIREC";break;case rt:t="ENVMAP_TYPE_SPHERE"}return t}function Ph(e){var t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case ce:case fe:t="ENVMAP_MODE_REFRACTION"}return t}function Ch(e){var t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case Z:t="ENVMAP_BLENDING_MULTIPLY";break;case J:t="ENVMAP_BLENDING_MIX";break;case K:t="ENVMAP_BLENDING_ADD"}return t}function Dh(e,t,n){var r,i,a,o,s,l,u,h,c=e.getContext(),d=n.defines,f=n.vertexShader,p=n.fragmentShader,m=Nh(n),v=kh(n),g=Ph(n),y=Ch(n),_=0<e.gammaFactor?e.gammaFactor:1,x=n.isWebGL2?"":vh(n),w=gh(d),b=c.createProgram();n.isRawShaderMaterial?(o=(0,U.default)(i=[w]).call(i,_h).join("\n"),0<o.length&&(o+="\n"),r=(0,U.default)(a=[x,w]).call(a,_h).join("\n"),0<r.length&&(r+="\n")):(o=(0,U.default)(s=[Rh(n),"#define SHADER_NAME "+n.shaderName,w,n.instancing?"#define USE_INSTANCING":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+_,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",(0,We.default)(n)?"#define USE_MAP":"",n.mapMixColor?"#define USE_MAP_MIXCOLOR":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+g:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+m:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"]).call(s,_h).join("\n"),r=(0,U.default)(l=[x,Rh(n),"#define SHADER_NAME "+n.shaderName,w,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+_,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",(0,We.default)(n)?"#define USE_MAP":"",n.mapMixColor?"#define USE_MAP_MIXCOLOR":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+v:"",n.envMap?"#define "+g:"",n.envMap?"#define "+y:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+m:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Q?"#define TONE_MAPPING":"",n.toneMapping!==Q?Zl.tonemapping_pars_fragment:"",n.toneMapping!==Q?mh("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.outputEncoding||n.mapEncoding||n.matcapEncoding||n.envMapEncoding||n.emissiveMapEncoding||n.lightMapEncoding?Zl.encodings_pars_fragment:"",n.mapEncoding?fh("mapTexelToLinear",n.mapEncoding):"",n.matcapEncoding?fh("matcapTexelToLinear",n.matcapEncoding):"",n.envMapEncoding?fh("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMapEncoding?fh("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMapEncoding?fh("lightMapTexelToLinear",n.lightMapEncoding):"",n.outputEncoding?ph("linearToOutputTexel",n.outputEncoding):"",n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"]).call(l,_h).join("\n")),f=Mh(f),f=xh(f,n),f=wh(f,n),p=Mh(p),p=xh(p,n),p=wh(p,n),f=Ah(f),p=Ah(p),n.isWebGL2&&!n.isRawShaderMaterial&&(u=!1,h=/^\s*#version\s+300\s+es\s*\n/,n.isShaderMaterial&&null!==f.match(h)&&null!==p.match(h)&&(u=!0,f=f.replace(h,""),p=p.replace(h,"")),o=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+o,r=["#version 300 es\n","#define varying in",u?"":"out highp vec4 pc_fragColor;",u?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+r);var M,T,S,E,A,I,L,R,N,k,P,C,D=o+f,O=r+p,F=lh(c,35633,D),B=lh(c,35632,O);return c.attachShader(b,F),c.attachShader(b,B),void 0!==n.index0AttributeName?c.bindAttribLocation(b,0,n.index0AttributeName):!0===n.morphTargets&&c.bindAttribLocation(b,0,"position"),c.linkProgram(b),e.debug.checkShaderErrors&&(E=(0,z.default)(M=c.getProgramInfoLog(b)).call(M),A=(0,z.default)(T=c.getShaderInfoLog(F)).call(T),I=(0,z.default)(S=c.getShaderInfoLog(B)).call(S),L=!0,R=!0,!1===c.getProgramParameter(b,35714)?(L=!1,N=dh(c,F,"vertex"),k=dh(c,B,"fragment"),console.error("THREE.WebGLProgram: shader error: ",c.getError(),"35715",c.getProgramParameter(b,35715),"gl.getProgramInfoLog",E,N,k)):""!==E?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",E):""!==A&&""!==I||(R=!1),R&&(this.diagnostics={runnable:L,programLog:E,vertexShader:{log:A,prefix:o},fragmentShader:{log:I,prefix:r}})),c.detachShader(b,F),c.detachShader(b,B),c.deleteShader(F),c.deleteShader(B),this.getUniforms=function(){return void 0===P&&(P=new sh(c,b)),P},this.getAttributes=function(){return void 0===C&&(C=yh(c,b)),C},this.destroy=function(){c.deleteProgram(b),this.program=void 0},this.name=n.shaderName,this.id=uh++,this.cacheKey=t,this.usedTimes=1,this.program=b,this.vertexShader=F,this.fragmentShader=B,this}function Oh(m,v,g){var o=[],y=g.isWebGL2,_=g.logarithmicDepthBuffer,x=g.floatVertexTextures,w=g.precision,s=g.maxVertexUniforms,b=g.vertexTextures,M={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},i=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","map","mapMixColor","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen"];function T(e,t){var n,r=t?(n=Jl[t],{name:e.type,uniforms:ho.clone(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}):{name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};return r}function S(e){var t=e.skeleton,n=t.bones;if(x)return 1024;var r=s,i=Math.floor((r-20)/4),a=Math.min(i,n.length);return a<n.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+n.length+" bones. This GPU supports "+a+"."),0):a}function E(e){var t;return e?e.isTexture?t=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),t=e.texture.encoding):t=jn,t}this.getParameters=function(e,t,n,r,i,a,o){var s=r.fog,l=e.isMeshStandardMaterial?r.environment:null,u=e.envMap||l,h=M[e.type],c=o.isSkinnedMesh?S(o):0;null!==e.precision&&(w=g.getMaxPrecision(e.precision),w!==e.precision&&console.warn("THREE.WebGLProgram.getParameters:",e.precision,"not supported, using",w,"instead."));var d=T(e,h);e.onBeforeCompile(d,m);var f=m.getRenderTarget(),p={isWebGL2:y,shaderID:h,shaderName:d.name,uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader,defines:e.defines,isRawShaderMaterial:e.isRawShaderMaterial,isShaderMaterial:e.isShaderMaterial,precision:w,instancing:!0===o.isInstancedMesh,supportsVertexTextures:b,outputEncoding:null!==f?E(f.texture):m.outputEncoding,map:!!(0,We.default)(e),mapMixColor:!!e.mapMixColor,mapEncoding:E((0,We.default)(e)),matcap:!!e.matcap,matcapEncoding:E(e.matcap),envMap:!!u,envMapMode:u&&u.mapping,envMapEncoding:E(u),envMapCubeUV:!!u&&(u.mapping===it||u.mapping===at),lightMap:!!e.lightMap,lightMapEncoding:E(e.lightMap),aoMap:!!e.aoMap,emissiveMap:!!e.emissiveMap,emissiveMapEncoding:E(e.emissiveMap),bumpMap:!!e.bumpMap,normalMap:!!e.normalMap,objectSpaceNormalMap:e.normalMapType===tr,tangentSpaceNormalMap:e.normalMapType===er,clearcoatMap:!!e.clearcoatMap,clearcoatRoughnessMap:!!e.clearcoatRoughnessMap,clearcoatNormalMap:!!e.clearcoatNormalMap,displacementMap:!!e.displacementMap,roughnessMap:!!e.roughnessMap,metalnessMap:!!e.metalnessMap,specularMap:!!e.specularMap,alphaMap:!!e.alphaMap,gradientMap:!!e.gradientMap,sheen:!!e.sheen,combine:e.combine,vertexTangents:e.normalMap&&e.vertexTangents,vertexColors:e.vertexColors,vertexUvs:!!((0,We.default)(e)||e.bumpMap||e.normalMap||e.specularMap||e.alphaMap||e.emissiveMap||e.roughnessMap||e.metalnessMap||e.clearcoatMap||e.clearcoatRoughnessMap||e.clearcoatNormalMap||e.displacementMap),uvsVertexOnly:!((0,We.default)(e)||e.bumpMap||e.normalMap||e.specularMap||e.alphaMap||e.emissiveMap||e.roughnessMap||e.metalnessMap||e.clearcoatNormalMap||!e.displacementMap),fog:!!s,useFog:e.fog,fogExp2:s&&s.isFogExp2,flatShading:e.flatShading,sizeAttenuation:e.sizeAttenuation,logarithmicDepthBuffer:_,skinning:e.skinning&&0<c,maxBones:c,useVertexTexture:x,morphTargets:e.morphTargets,morphNormals:e.morphNormals,maxMorphTargets:m.maxMorphTargets,maxMorphNormals:m.maxMorphNormals,numDirLights:t.directional.length,numPointLights:t.point.length,numSpotLights:t.spot.length,numRectAreaLights:t.rectArea.length,numHemiLights:t.hemi.length,numDirLightShadows:t.directionalShadowMap.length,numPointLightShadows:t.pointShadowMap.length,numSpotLightShadows:t.spotShadowMap.length,numClippingPlanes:i,numClipIntersection:a,dithering:e.dithering,shadowMapEnabled:m.shadowMap.enabled&&0<n.length,shadowMapType:m.shadowMap.type,toneMapping:e.toneMapped?m.toneMapping:Q,physicallyCorrectLights:m.physicallyCorrectLights,premultipliedAlpha:e.premultipliedAlpha,alphaTest:e.alphaTest,doubleSided:e.side===xe,flipSided:e.side===Xe,depthPacking:void 0!==e.depthPacking&&e.depthPacking,index0AttributeName:e.index0AttributeName,extensionDerivatives:e.extensions&&e.extensions.derivatives,extensionFragDepth:e.extensions&&e.extensions.fragDepth,extensionDrawBuffers:e.extensions&&e.extensions.drawBuffers,extensionShaderTextureLOD:e.extensions&&e.extensions.shaderTextureLOD,rendererExtensionFragDepth:y||null!==v.get("EXT_frag_depth"),rendererExtensionDrawBuffers:y||null!==v.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:y||null!==v.get("EXT_shader_texture_lod"),onBeforeCompile:e.onBeforeCompile};return p},this.getProgramCacheKey=function(e){var t=[];if(e.shaderID?t.push(e.shaderID):(t.push(e.fragmentShader),t.push(e.vertexShader)),void 0!==e.defines)for(var n in e.defines)t.push(n),t.push(e.defines[n]);if(void 0===e.isRawShaderMaterial){for(var r=0;r<i.length;r++)t.push(e[i[r]]);t.push(m.outputEncoding),t.push(m.gammaFactor)}return t.push(e.onBeforeCompile.toString()),t.join()},this.acquireProgram=function(e,t){for(var n,r=0,i=o.length;r<i;r++){var a=o[r];if(a.cacheKey===t){n=a,++n.usedTimes;break}}return void 0===n&&(n=new Dh(m,t,e),o.push(n)),n},this.releaseProgram=function(e){var t;0==--e.usedTimes&&(t=(0,ve.default)(o).call(o,e),o[t]=o[o.length-1],o.pop(),e.destroy())},this.programs=o}function Fh(){var r=new re.default;function e(e){var t=r.get(e);return void 0===t&&(t={},r.set(e,t)),t}function t(e){r.delete(e)}function n(e,t,n){r.get(e)[t]=n}function i(){r=new re.default}return{get:e,remove:t,update:n,dispose:i}}function Bh(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function Uh(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function zh(){var s=[],l=0,u=[],h=[],c={id:-1};function e(){l=0,u.length=0,h.length=0}function d(e,t,n,r,i,a){var o=s[l];return void 0===o?(o={id:e.id,object:e,geometry:t,material:n,program:n.program||c,groupOrder:r,renderOrder:e.renderOrder,z:i,group:a},s[l]=o):(o.id=e.id,o.object=e,o.geometry=t,o.material=n,o.program=n.program||c,o.groupOrder=r,o.renderOrder=e.renderOrder,o.z=i,o.group=a),l++,o}function t(e,t,n,r,i,a){var o=d(e,t,n,r,i,a);(!0===n.transparent?h:u).push(o)}function n(e,t,n,r,i,a){var o=d(e,t,n,r,i,a);(!0===n.transparent?h:u).unshift(o)}function r(e,t){1<u.length&&(0,je.default)(u).call(u,e||Bh),1<h.length&&(0,je.default)(h).call(h,t||Uh)}function i(){for(var e=l,t=s.length;e<t;e++){var n=s[e];if(null===n.id)break;n.id=null,n.object=null,n.geometry=null,n.material=null,n.program=null,n.group=null}}return{opaque:u,transparent:h,init:e,push:t,unshift:n,finish:i,sort:r}}function Gh(){var i=new re.default;function a(e){var t=e.target;t.removeEventListener("dispose",a),i.delete(t)}function e(e,t){var n,r=i.get(e);return void 0===r?(n=new zh,i.set(e,new re.default),i.get(e).set(t,n),e.addEventListener("dispose",a)):(n=r.get(t),void 0===n&&(n=new zh,r.set(t,n))),n}function t(){i=new re.default}return{get:e,dispose:t}}function Vh(){var n={};return{get:function(e){if(void 0!==n[e.id])return n[e.id];var t;switch(e.type){case"DirectionalLight":t={direction:new Hr,color:new oa};break;case"SpotLight":t={position:new Hr,direction:new Hr,color:new oa,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new Hr,color:new oa,distance:0,decay:0};break;case"HemisphereLight":t={direction:new Hr,skyColor:new oa,groundColor:new oa};break;case"RectAreaLight":t={color:new oa,position:new Hr,halfWidth:new Hr,halfHeight:new Hr}}return n[e.id]=t,t}}}function Hh(){var n={};return{get:function(e){if(void 0!==n[e.id])return n[e.id];var t;switch(e.type){case"DirectionalLight":case"SpotLight":t={shadowBias:0,shadowRadius:1,shadowMapSize:new kr};break;case"PointLight":t={shadowBias:0,shadowRadius:1,shadowMapSize:new kr,shadowCameraNear:1,shadowCameraFar:1e3}}return n[e.id]=t,t}}}var jh=0;function Wh(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function Yh(){for(var A=new Vh,I=Hh(),L={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},e=0;e<9;e++)L.probe.push(new Hr);var R=new Hr,N=new Kr,k=new Kr;function t(e,t,n){for(var r=0,i=0,a=0,o=0;o<9;o++)L.probe[o].set(0,0,0);var s=0,l=0,u=0,h=0,c=0,d=0,f=0,p=0,m=n.matrixWorldInverse;(0,je.default)(e).call(e,Wh);for(var o=0,v=e.length;o<v;o++){var g,y,_,x=e[o],w=x.color,b=x.intensity,M=x.distance,T=x.shadow&&(0,We.default)(x.shadow)?(0,We.default)(x.shadow).texture:null;if(x.isAmbientLight)r+=w.r*b,i+=w.g*b,a+=w.b*b;else if(x.isLightProbe)for(var S=0;S<9;S++)L.probe[S].addScaledVector(x.sh.coefficients[S],b);else x.isDirectionalLight?(_=A.get(x),_.color.copy(x.color).multiplyScalar(x.intensity),_.direction.setFromMatrixPosition(x.matrixWorld),R.setFromMatrixPosition(x.target.matrixWorld),_.direction.sub(R),_.direction.transformDirection(m),x.castShadow&&(g=x.shadow,y=I.get(x),y.shadowBias=g.bias,y.shadowRadius=g.radius,y.shadowMapSize=g.mapSize,L.directionalShadow[s]=y,L.directionalShadowMap[s]=T,L.directionalShadowMatrix[s]=x.shadow.matrix,d++),L.directional[s]=_,s++):x.isSpotLight?(_=A.get(x),_.position.setFromMatrixPosition(x.matrixWorld),_.position.applyMatrix4(m),_.color.copy(w).multiplyScalar(b),_.distance=M,_.direction.setFromMatrixPosition(x.matrixWorld),R.setFromMatrixPosition(x.target.matrixWorld),_.direction.sub(R),_.direction.transformDirection(m),_.coneCos=Math.cos(x.angle),_.penumbraCos=Math.cos(x.angle*(1-x.penumbra)),_.decay=x.decay,x.castShadow&&(g=x.shadow,y=I.get(x),y.shadowBias=g.bias,y.shadowRadius=g.radius,y.shadowMapSize=g.mapSize,L.spotShadow[u]=y,L.spotShadowMap[u]=T,L.spotShadowMatrix[u]=x.shadow.matrix,p++),L.spot[u]=_,u++):x.isRectAreaLight?(_=A.get(x),_.color.copy(w).multiplyScalar(b),_.position.setFromMatrixPosition(x.matrixWorld),_.position.applyMatrix4(m),k.identity(),N.copy(x.matrixWorld),N.premultiply(m),k.extractRotation(N),_.halfWidth.set(.5*x.width,0,0),_.halfHeight.set(0,.5*x.height,0),_.halfWidth.applyMatrix4(k),_.halfHeight.applyMatrix4(k),L.rectArea[h]=_,h++):x.isPointLight?(_=A.get(x),_.position.setFromMatrixPosition(x.matrixWorld),_.position.applyMatrix4(m),_.color.copy(x.color).multiplyScalar(x.intensity),_.distance=x.distance,_.decay=x.decay,x.castShadow&&(g=x.shadow,y=I.get(x),y.shadowBias=g.bias,y.shadowRadius=g.radius,y.shadowMapSize=g.mapSize,y.shadowCameraNear=g.camera.near,y.shadowCameraFar=g.camera.far,L.pointShadow[l]=y,L.pointShadowMap[l]=T,L.pointShadowMatrix[l]=x.shadow.matrix,f++),L.point[l]=_,l++):x.isHemisphereLight&&(_=A.get(x),_.direction.setFromMatrixPosition(x.matrixWorld),_.direction.transformDirection(m),_.direction.normalize(),_.skyColor.copy(x.color).multiplyScalar(b),_.groundColor.copy(x.groundColor).multiplyScalar(b),L.hemi[c]=_,c++)}L.ambient[0]=r,L.ambient[1]=i,L.ambient[2]=a;var E=L.hash;E.directionalLength===s&&E.pointLength===l&&E.spotLength===u&&E.rectAreaLength===h&&E.hemiLength===c&&E.numDirectionalShadows===d&&E.numPointShadows===f&&E.numSpotShadows===p||(L.directional.length=s,L.spot.length=u,L.rectArea.length=h,L.point.length=l,L.hemi.length=c,L.directionalShadow.length=d,L.directionalShadowMap.length=d,L.pointShadow.length=f,L.pointShadowMap.length=f,L.spotShadow.length=p,L.spotShadowMap.length=p,L.directionalShadowMatrix.length=d,L.pointShadowMatrix.length=f,L.spotShadowMatrix.length=p,E.directionalLength=s,E.pointLength=l,E.spotLength=u,E.rectAreaLength=h,E.hemiLength=c,E.numDirectionalShadows=d,E.numPointShadows=f,E.numSpotShadows=p,L.version=jh++)}return{setup:t,state:L}}function qh(){var t=new Yh,n=[],r=[];function e(){n.length=0,r.length=0}function i(e){n.push(e)}function a(e){r.push(e)}function o(e){t.setup(n,r,e)}var s={lightsArray:n,shadowsArray:r,lights:t};return{init:e,state:s,setupLights:o,pushLight:i,pushShadow:a}}function Xh(){var r=new re.default;function i(e){var t=e.target;t.removeEventListener("dispose",i),r.delete(t)}function e(e,t){var n;return!1===r.has(e)?(n=new qh,r.set(e,new re.default),r.get(e).set(t,n),e.addEventListener("dispose",i)):!1===r.get(e).has(t)?(n=new qh,r.get(e).set(t,n)):n=r.get(e).get(t),n}function t(){r=new re.default}return{get:e,dispose:t}}function Zh(e){da.call(this),this.type="MeshDepthMaterial",this.depthPacking=Qn,this.skinning=!1,this.morphTargets=!1,this.map=null,this.mapMixColor=!1,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}function Jh(e){da.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Hr,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}Zh.prototype=(0,T.default)(da.prototype),Zh.prototype.constructor=Zh,Zh.prototype.isMeshDepthMaterial=!0,Zh.prototype.copy=function(e){return da.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=(0,We.default)(e),this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},Jh.prototype=(0,T.default)(da.prototype),Jh.prototype.constructor=Jh,Jh.prototype.isMeshDistanceMaterial=!0,Jh.prototype.copy=function(e){return da.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=(0,We.default)(e),this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this};var Kh="uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}",Qh="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}";function $h(g,y,v){var _=new To,x=new kr,w=new kr,b=new Fr,a=[],o=[],M={},T={0:Xe,1:Y,2:xe},r=new po({defines:{SAMPLE_RATE:.25,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new kr},radius:{value:4}},vertexShader:Qh,fragmentShader:Kh}),i=r.clone();i.defines.HORIZONAL_PASS=1;var e=new Ca;e.setAttribute("position",new ma(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var s=new Qa(e,r),S=this;function E(e,t){var n=y.update(s);r.uniforms.shadow_pass.value=(0,We.default)(e).texture,r.uniforms.resolution.value=e.mapSize,r.uniforms.radius.value=e.radius,g.setRenderTarget(e.mapPass),g.clear(),g.renderBufferDirect(t,null,n,r,s,null),i.uniforms.shadow_pass.value=e.mapPass.texture,i.uniforms.resolution.value=e.mapSize,i.uniforms.radius.value=e.radius,g.setRenderTarget((0,We.default)(e)),g.clear(),g.renderBufferDirect(t,null,n,i,s,null)}function A(e,t,n){var r=e<<0|t<<1|n<<2,i=a[r];return void 0===i&&(i=new Zh({depthPacking:$n,morphTargets:e,skinning:t}),a[r]=i),i}function I(e,t,n){var r=e<<0|t<<1|n<<2,i=o[r];return void 0===i&&(i=new Jh({morphTargets:e,skinning:t}),o[r]=i),i}function L(e,t,n,r,i,a){var o,s,l,u,h,c,d,f=e.geometry,p=null,m=A,v=e.customDepthMaterial;return!0===n.isPointLight&&(m=I,v=e.customDistanceMaterial),p=void 0===v?(o=!1,!0===t.morphTargets&&(!0===f.isBufferGeometry?o=f.morphAttributes&&f.morphAttributes.position&&0<f.morphAttributes.position.length:!0===f.isGeometry&&(o=f.morphTargets&&0<f.morphTargets.length)),s=!1,!0===e.isSkinnedMesh&&(!0===t.skinning?s=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e)),l=!0===e.isInstancedMesh,m(o,s,l)):v,g.localClippingEnabled&&!0===t.clipShadows&&0!==t.clippingPlanes.length&&(u=p.uuid,h=t.uuid,c=M[u],void 0===c&&(c={},M[u]=c),d=c[h],void 0===d&&(d=p.clone(),c[h]=d),p=d),p.visible=t.visible,p.wireframe=t.wireframe,p.side=a===W?null!==t.shadowSide?t.shadowSide:t.side:null!==t.shadowSide?t.shadowSide:T[t.side],p.clipShadows=t.clipShadows,p.clippingPlanes=t.clippingPlanes,p.clipIntersection=t.clipIntersection,p.wireframeLinewidth=t.wireframeLinewidth,p.linewidth=t.linewidth,!0===n.isPointLight&&!0===p.isMeshDistanceMaterial&&(p.referencePosition.setFromMatrixPosition(n.matrixWorld),p.nearDistance=r,p.farDistance=i),p}function R(e,t,n,r,i){if(!1!==e.visible){var a=e.layers.test(t.layers);if(a&&(e.isMesh||e.isLine||e.isPoints)&&(e.castShadow||e.receiveShadow&&i===W)&&(!e.frustumCulled||_.intersectsObject(e))){e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld);var o=y.update(e),s=e.material;if((0,Ye.default)(s))for(var l=o.groups,u=0,h=l.length;u<h;u++){var c,d=l[u],f=s[d.materialIndex];f&&f.visible&&(c=L(e,f,r,n.near,n.far,i),g.renderBufferDirect(n,null,o,c,e,d))}else s.visible&&(c=L(e,s,r,n.near,n.far,i),g.renderBufferDirect(n,null,o,c,e,null))}for(var p=e.children,m=0,v=p.length;m<v;m++)R(p[m],t,n,r,i)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=H,this.render=function(e,t,n){if(!1!==S.enabled&&(!1!==S.autoUpdate||!1!==S.needsUpdate)&&0!==e.length){var r=g.getRenderTarget(),i=g.getActiveCubeFace(),a=g.getActiveMipmapLevel(),o=g.state;o.setBlending(we),o.buffers.color.setClear(1,1,1,1),o.buffers.depth.setTest(!0),o.setScissorTest(!1);for(var s=0,l=e.length;s<l;s++){var u=e[s],h=u.shadow;if(void 0!==h){x.copy(h.mapSize);var c,d=h.getFrameExtents();x.multiply(d),w.copy(h.mapSize),(x.x>v||x.y>v)&&(console.warn("THREE.WebGLShadowMap:",u,"has shadow exceeding max texture size, reducing"),x.x>v&&(w.x=Math.floor(v/d.x),x.x=w.x*d.x,h.mapSize.x=w.x),x.y>v&&(w.y=Math.floor(v/d.y),x.y=w.y*d.y,h.mapSize.y=w.y)),null!==(0,We.default)(h)||h.isPointLightShadow||this.type!==W||(c={minFilter:pt,magFilter:pt,format:Pt},h.map=new Br(x.x,x.y,c),(0,We.default)(h).texture.name=u.name+".shadowMap",h.mapPass=new Br(x.x,x.y,c),h.camera.updateProjectionMatrix()),null===(0,We.default)(h)&&(c={minFilter:ut,magFilter:ut,format:Pt},h.map=new Br(x.x,x.y,c),(0,We.default)(h).texture.name=u.name+".shadowMap",h.camera.updateProjectionMatrix()),g.setRenderTarget((0,We.default)(h)),g.clear();for(var f=h.getViewportCount(),p=0;p<f;p++){var m=h.getViewport(p);b.set(w.x*m.x,w.y*m.y,w.x*m.z,w.y*m.w),o.viewport(b),h.updateMatrices(u,p),_=h.getFrustum(),R(t,n,h.camera,u,this.type)}h.isPointLightShadow||this.type!==W||E(h,n)}else console.warn("THREE.WebGLShadowMap:",u,"has no shadow.")}S.needsUpdate=!1,g.setRenderTarget(r,i,a)}}}function ec(h,r,e){var t,n,i=e.isWebGL2;function a(){var t=!1,a=new Fr,n=null,o=new Fr(0,0,0,0);return{setMask:function(e){n===e||t||(h.colorMask(e,e,e,e),n=e)},setLocked:function(e){t=e},setClear:function(e,t,n,r,i){!0===i&&(e*=r,t*=r,n*=r),a.set(e,t,n,r),!1===o.equals(a)&&(h.clearColor(e,t,n,r),o.copy(a))},reset:function(){t=!1,n=null,o.set(-1,0,0,0)}}}function o(){var t=!1,n=null,r=null,i=null;return{setTest:function(e){(e?Y:q)(2929)},setMask:function(e){n===e||t||(h.depthMask(e),n=e)},setFunc:function(e){if(r!==e){if(e)switch(e){case He:h.depthFunc(512);break;case Ze:h.depthFunc(519);break;case Je:h.depthFunc(513);break;case Ke:h.depthFunc(515);break;case Qe:h.depthFunc(514);break;case $e:h.depthFunc(518);break;case et:h.depthFunc(516);break;case tt:h.depthFunc(517);break;default:h.depthFunc(515)}else h.depthFunc(515);r=e}},setLocked:function(e){t=e},setClear:function(e){i!==e&&(h.clearDepth(e),i=e)},reset:function(){t=!1,n=null,r=null,i=null}}}function s(){var t=!1,n=null,r=null,i=null,a=null,o=null,s=null,l=null,u=null;return{setTest:function(e){t||(e?Y:q)(2960)},setMask:function(e){n===e||t||(h.stencilMask(e),n=e)},setFunc:function(e,t,n){r===e&&i===t&&a===n||(h.stencilFunc(e,t,n),r=e,i=t,a=n)},setOp:function(e,t,n){o===e&&s===t&&l===n||(h.stencilOp(e,t,n),o=e,s=t,l=n)},setLocked:function(e){t=e},setClear:function(e){u!==e&&(h.clearStencil(e),u=e)},reset:function(){t=!1,n=null,r=null,i=null,a=null,o=null,s=null,l=null,u=null}}}var l=new a,u=new o,c=new s,d=h.getParameter(34921),f=new Uint8Array(d),p=new Uint8Array(d),m=new Uint8Array(d),v={},g=null,y=null,_=null,x=null,w=null,b=null,M=null,T=null,S=null,E=!1,A=null,I=null,L=null,R=null,N=null,k=h.getParameter(35661),P=!1,C=0,D=h.getParameter(7938);-1!==(0,ve.default)(D).call(D,"WebGL")?(C=(0,me.default)(/^WebGL\ ([0-9])/.exec(D)[1]),P=1<=C):-1!==(0,ve.default)(D).call(D,"OpenGL ES")&&(C=(0,me.default)(/^OpenGL\ ES\ ([0-9])/.exec(D)[1]),P=2<=C);var O=null,F={},B=new Fr,U=new Fr;function z(e,t,n){var r=new Uint8Array(4),i=h.createTexture();h.bindTexture(e,i),h.texParameteri(e,10241,9728),h.texParameteri(e,10240,9728);for(var a=0;a<n;a++)h.texImage2D(t+a,0,6408,1,1,0,6408,5121,r);return i}var G={};function V(){for(var e=0,t=f.length;e<t;e++)f[e]=0}function H(e){j(e,0)}function j(e,t){var n;f[e]=1,0===p[e]&&(h.enableVertexAttribArray(e),p[e]=1),m[e]!==t&&(n=i?h:r.get("ANGLE_instanced_arrays"),n[i?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](e,t),m[e]=t)}function W(){for(var e=0,t=p.length;e!==t;++e)p[e]!==f[e]&&(h.disableVertexAttribArray(e),p[e]=0)}function Y(e){!0!==v[e]&&(h.enable(e),v[e]=!0)}function q(e){!1!==v[e]&&(h.disable(e),v[e]=!1)}function X(e){return g!==e&&(h.useProgram(e),g=e,!0)}G[3553]=z(3553,3553,1),G[34067]=z(34067,34069,6),l.setClear(0,0,0,1),u.setClear(1),c.setClear(0),Y(2929),u.setFunc(Ke),ee(!1),te(ye),Y(2884),Q(we);var Z,J=(t={},(0,pe.default)(t,Ae,32774),(0,pe.default)(t,Ie,32778),(0,pe.default)(t,Le,32779),t);i?(J[Re]=32775,J[Ne]=32776):(Z=r.get("EXT_blend_minmax"),null!==Z&&(J[Re]=Z.MIN_EXT,J[Ne]=Z.MAX_EXT));var K=(n={},(0,pe.default)(n,ke,0),(0,pe.default)(n,Pe,1),(0,pe.default)(n,Ce,768),(0,pe.default)(n,Oe,770),(0,pe.default)(n,Ve,776),(0,pe.default)(n,ze,774),(0,pe.default)(n,Be,772),(0,pe.default)(n,De,769),(0,pe.default)(n,Fe,771),(0,pe.default)(n,Ge,775),(0,pe.default)(n,Ue,773),n);function Q(e,t,n,r,i,a,o,s){if(e!==we){if(y||(Y(3042),y=!0),e===Ee)i=i||t,a=a||n,o=o||r,t===x&&i===M||(h.blendEquationSeparate(J[t],J[i]),x=t,M=i),n===w&&r===b&&a===T&&o===S||(h.blendFuncSeparate(K[n],K[r],K[a],K[o]),w=n,b=r,T=a,S=o),_=e,E=null;else if(e!==_||s!==E){if(x===Ae&&M===Ae||(h.blendEquation(32774),x=Ae,M=Ae),s)switch(e){case be:h.blendFuncSeparate(1,771,1,771);break;case Me:h.blendFunc(1,1);break;case Te:h.blendFuncSeparate(0,0,769,771);break;case Se:h.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case be:h.blendFuncSeparate(770,771,1,771);break;case Me:h.blendFunc(770,1);break;case Te:h.blendFunc(0,769);break;case Se:h.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}w=null,b=null,T=null,S=null,_=e,E=s}}else y&&(q(3042),y=!1)}function $(e,t){(e.side===xe?q:Y)(2884);var n=e.side===Xe;t&&(n=!n),ee(n),e.blending===be&&!1===e.transparent?Q(we):Q(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),u.setFunc(e.depthFunc),u.setTest(e.depthTest),u.setMask(e.depthWrite),l.setMask(e.colorWrite);var r=e.stencilWrite;c.setTest(r),r&&(c.setMask(e.stencilWriteMask),c.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),c.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),re(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)}function ee(e){A!==e&&(e?h.frontFace(2304):h.frontFace(2305),A=e)}function te(e){e!==ge?(Y(2884),e!==I&&(e===ye?h.cullFace(1029):e===_e?h.cullFace(1028):h.cullFace(1032))):q(2884),I=e}function ne(e){e!==L&&(P&&h.lineWidth(e),L=e)}function re(e,t,n){e?(Y(32823),R===t&&N===n||(h.polygonOffset(t,n),R=t,N=n)):q(32823)}function ie(e){(e?Y:q)(3089)}function ae(e){void 0===e&&(e=33984+k-1),O!==e&&(h.activeTexture(e),O=e)}function oe(e,t){null===O&&ae();var n=F[O];void 0===n&&(n={type:void 0,texture:void 0},F[O]=n),n.type===e&&n.texture===t||(h.bindTexture(e,t||G[e]),n.type=e,n.texture=t)}function se(){var e=F[O];void 0!==e&&void 0!==e.type&&(h.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)}function le(){try{h.compressedTexImage2D.apply(h,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function ue(){try{h.texImage2D.apply(h,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function he(){try{h.texImage3D.apply(h,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function ce(e){!1===B.equals(e)&&(h.scissor(e.x,e.y,e.z,e.w),B.copy(e))}function de(e){!1===U.equals(e)&&(h.viewport(e.x,e.y,e.z,e.w),U.copy(e))}function fe(){for(var e=0;e<p.length;e++)1===p[e]&&(h.disableVertexAttribArray(e),p[e]=0);v={},O=null,F={},g=null,_=null,A=null,I=null,l.reset(),u.reset(),c.reset()}return{buffers:{color:l,depth:u,stencil:c},initAttributes:V,enableAttribute:H,enableAttributeAndDivisor:j,disableUnusedAttributes:W,enable:Y,disable:q,useProgram:X,setBlending:Q,setMaterial:$,setFlipSided:ee,setCullFace:te,setLineWidth:ne,setPolygonOffset:re,setScissorTest:ie,activeTexture:ae,bindTexture:oe,unbindTexture:se,compressedTexImage2D:le,texImage2D:ue,texImage3D:he,scissor:ce,viewport:de,reset:fe}}function tc(v,i,g,y,a,_,c,n){var e,t,h,x=a.isWebGL2,r=a.maxTextures,w=a.maxCubemapSize,p=a.maxTextureSize,o=a.maxSamples,s=new re.default,l=!1;try{l="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function d(e,t){return l?new OffscreenCanvas(e,t):n}function b(e,t,n,r){var i=1;if((e.width>r||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("object"!==(0,ne.default)(e))return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e;var a=t?Nr.floorPowerOfTwo:Math.floor,o=a(i*e.width),s=a(i*e.height);void 0===h&&(h=d(o,s));var l=n?d(o,s):h;l.width=o,l.height=s;var u=l.getContext("2d");return u.drawImage(e,0,0,o,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+o+"x"+s+")."),e.src=l.toDataURL("image/png"),e}return e}function M(e){return Nr.isPowerOfTwo(e.width)&&Nr.isPowerOfTwo(e.height)}function m(e){return!x&&(e.wrapS!==st||e.wrapT!==st||e.minFilter!==ut&&e.minFilter!==pt)}function T(e,t){return e.generateMipmaps&&t&&e.minFilter!==ut&&e.minFilter!==pt}function S(e,t,n,r){v.generateMipmap(e);var i=y.get(t);i.__maxMipLevel=Math.log(Math.max(n,r))*Math.LOG2E}function E(e,t,n){if(!1===x)return t;if(null!==e){if(void 0!==v[e])return v[e];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+e+"'")}var r=t;return 6403===t&&(5126===n&&(r=33326),5131===n&&(r=33325),5121===n&&(r=33321)),6407===t&&(5126===n&&(r=34837),5131===n&&(r=34843),5121===n&&(r=32849)),6408===t&&(5126===n&&(r=34836),5131===n&&(r=34842),5121===n&&(r=32856)),33325!==r&&33326!==r&&34842!==r&&34836!==r||i.get("EXT_color_buffer_float"),r}function u(e){return e===ut||e===ht||e===dt?9728:9729}function f(e){var t=e.target;t.removeEventListener("dispose",f),I(t),t.isVideoTexture&&s.delete(t),c.memory.textures--}function A(e){var t=e.target;t.removeEventListener("dispose",A),L(t),c.memory.textures--}function I(e){var t=y.get(e);void 0!==t.__webglInit&&(v.deleteTexture(t.__webglTexture),y.remove(e))}function L(e){var t=y.get(e),n=y.get(e.texture);if(e){if(void 0!==n.__webglTexture&&v.deleteTexture(n.__webglTexture),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(var r=0;r<6;r++)v.deleteFramebuffer(t.__webglFramebuffer[r]),t.__webglDepthbuffer&&v.deleteRenderbuffer(t.__webglDepthbuffer[r]);else v.deleteFramebuffer(t.__webglFramebuffer),t.__webglDepthbuffer&&v.deleteRenderbuffer(t.__webglDepthbuffer),t.__webglMultisampledFramebuffer&&v.deleteFramebuffer(t.__webglMultisampledFramebuffer),t.__webglColorRenderbuffer&&v.deleteRenderbuffer(t.__webglColorRenderbuffer),t.__webglDepthRenderbuffer&&v.deleteRenderbuffer(t.__webglDepthRenderbuffer);y.remove(e.texture),y.remove(e)}}var R=0;function N(){R=0}function k(){var e=R;return r<=e&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+r),R+=1,e}function P(e,t){var n=y.get(e);if(e.isVideoTexture&&K(e),0<e.version&&n.__version!==e.version){var r=e.image;if(void 0===r)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==r.complete)return void V(n,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}g.activeTexture(33984+t),g.bindTexture(3553,n.__webglTexture)}function C(e,t){var n=y.get(e);0<e.version&&n.__version!==e.version?V(n,e,t):(g.activeTexture(33984+t),g.bindTexture(35866,n.__webglTexture))}function D(e,t){var n=y.get(e);0<e.version&&n.__version!==e.version?V(n,e,t):(g.activeTexture(33984+t),g.bindTexture(32879,n.__webglTexture))}function O(e,t){if(6===e.image.length){var n=y.get(e);if(0<e.version&&n.__version!==e.version){G(n,e),g.activeTexture(33984+t),g.bindTexture(34067,n.__webglTexture),v.pixelStorei(37440,e.flipY);for(var r=e&&(e.isCompressedTexture||e.image[0].isCompressedTexture),i=e.image[0]&&e.image[0].isDataTexture,a=[],o=0;o<6;o++)a[o]=r||i?i?e.image[o].image:e.image[o]:b(e.image[o],!1,!0,w);var s,l=a[0],u=M(l)||x,h=_.convert(e.format),c=_.convert(e.type),d=E(e.internalFormat,h,c);if(z(34067,e,u),r){for(o=0;o<6;o++){s=a[o].mipmaps;for(var f=0;f<s.length;f++){var p=s[f];e.format!==Pt&&e.format!==kt?null!==h?g.compressedTexImage2D(34069+o,f,d,p.width,p.height,0,p.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):g.texImage2D(34069+o,f,d,p.width,p.height,0,h,c,p.data)}}n.__maxMipLevel=s.length-1}else{for(s=e.mipmaps,o=0;o<6;o++)if(i)for(g.texImage2D(34069+o,0,d,a[o].width,a[o].height,0,h,c,a[o].data),f=0;f<s.length;f++){var p=s[f],m=p.image[o].image;g.texImage2D(34069+o,f+1,d,m.width,m.height,0,h,c,m.data)}else for(g.texImage2D(34069+o,0,d,h,c,a[o]),f=0;f<s.length;f++)p=s[f],g.texImage2D(34069+o,f+1,d,h,c,p.image[o]);n.__maxMipLevel=s.length}T(e,u)&&S(34067,e,l.width,l.height),n.__version=e.version,e.onUpdate&&e.onUpdate(e)}else g.activeTexture(33984+t),g.bindTexture(34067,n.__webglTexture)}}function F(e,t){g.activeTexture(33984+t),g.bindTexture(34067,y.get(e).__webglTexture)}var B=(e={},(0,pe.default)(e,ot,10497),(0,pe.default)(e,st,33071),(0,pe.default)(e,lt,33648),e),U=(t={},(0,pe.default)(t,ut,9728),(0,pe.default)(t,ht,9984),(0,pe.default)(t,dt,9986),(0,pe.default)(t,pt,9729),(0,pe.default)(t,mt,9985),(0,pe.default)(t,gt,9987),t);function z(e,t,n){n?(v.texParameteri(e,10242,B[t.wrapS]),v.texParameteri(e,10243,B[t.wrapT]),32879!==e&&35866!==e||v.texParameteri(e,32882,B[t.wrapR]),v.texParameteri(e,10240,U[t.magFilter]),v.texParameteri(e,10241,U[t.minFilter])):(v.texParameteri(e,10242,33071),v.texParameteri(e,10243,33071),32879!==e&&35866!==e||v.texParameteri(e,32882,33071),t.wrapS===st&&t.wrapT===st||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),v.texParameteri(e,10240,u(t.magFilter)),v.texParameteri(e,10241,u(t.minFilter)),t.minFilter!==ut&&t.minFilter!==pt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));var r=i.get("EXT_texture_filter_anisotropic");if(r){if(t.type===St&&null===i.get("OES_texture_float_linear"))return;if(t.type===Et&&null===(x||i.get("OES_texture_half_float_linear")))return;(1<t.anisotropy||y.get(t).__currentAnisotropy)&&(v.texParameterf(e,r.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,a.getMaxAnisotropy())),y.get(t).__currentAnisotropy=t.anisotropy)}}function G(e,t){void 0===e.__webglInit&&(e.__webglInit=!0,t.addEventListener("dispose",f),e.__webglTexture=v.createTexture(),c.memory.textures++)}function V(e,t,n){var r=3553;t.isDataTexture2DArray&&(r=35866),t.isDataTexture3D&&(r=32879),G(e,t),g.activeTexture(33984+n),g.bindTexture(r,e.__webglTexture),v.pixelStorei(37440,t.flipY),v.pixelStorei(37441,t.premultiplyAlpha),v.pixelStorei(3317,t.unpackAlignment);var i=m(t)&&!1===M(t.image),a=b(t.image,i,!1,p),o=M(a)||x,s=_.convert(t.format),l=_.convert(t.type),u=E(t.internalFormat,s,l);0===a.width&&0===a.height&&(o=!0),z(r,t,o);var h,c=t.mipmaps;if(t.isDepthTexture)u=6402,x?u=t.type===St?36012:t.type===Tt?33190:t.type===Rt?35056:33189:t.type===St&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),t.format===Ft&&6402===u&&t.type!==bt&&t.type!==Tt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),t.type=bt,l=_.convert(t.type)),t.format===Bt&&6402===u&&(u=34041,t.type!==Rt&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),t.type=Rt,l=_.convert(t.type))),g.texImage2D(3553,0,u,a.width,a.height,0,s,l,null);else if(t.isDataTexture)if(0<c.length&&o){for(var d=0,f=c.length;d<f;d++)h=c[d],g.texImage2D(3553,d,u,h.width,h.height,0,s,l,h.data);t.generateMipmaps=!1,e.__maxMipLevel=c.length-1}else g.texImage2D(3553,0,u,a.width,a.height,0,s,l,a.data),e.__maxMipLevel=0;else if(t.isCompressedTexture){for(d=0,f=c.length;d<f;d++)h=c[d],t.format!==Pt&&t.format!==kt?null!==s?g.compressedTexImage2D(3553,d,u,h.width,h.height,0,h.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):g.texImage2D(3553,d,u,h.width,h.height,0,s,l,h.data);e.__maxMipLevel=c.length-1}else if(t.isDataTexture2DArray)g.texImage3D(35866,0,u,a.width,a.height,a.depth,0,s,l,a.data),e.__maxMipLevel=0;else if(t.isDataTexture3D)g.texImage3D(32879,0,u,a.width,a.height,a.depth,0,s,l,a.data),e.__maxMipLevel=0;else if(0<c.length&&o){for(d=0,f=c.length;d<f;d++)h=c[d],g.texImage2D(3553,d,u,s,l,h);t.generateMipmaps=!1,e.__maxMipLevel=c.length-1}else g.texImage2D(3553,0,u,s,l,a),e.__maxMipLevel=0;T(t,o)&&S(r,t,a.width,a.height),e.__version=t.version,t.onUpdate&&t.onUpdate(t)}function H(e,t,n,r){var i=_.convert(t.texture.format),a=_.convert(t.texture.type),o=E(t.texture.internalFormat,i,a);g.texImage2D(r,0,o,t.width,t.height,0,i,a,null),v.bindFramebuffer(36160,e),v.framebufferTexture2D(36160,n,r,y.get(t.texture).__webglTexture,0),v.bindFramebuffer(36160,null)}function j(e,t,n){var r,i,a,o,s;v.bindRenderbuffer(36161,e),t.depthBuffer&&!t.stencilBuffer?(o=33189,n?(r=t.depthTexture,r&&r.isDepthTexture&&(r.type===St?o=36012:r.type===Tt&&(o=33190)),s=J(t),v.renderbufferStorageMultisample(36161,s,o,t.width,t.height)):v.renderbufferStorage(36161,o,t.width,t.height),v.framebufferRenderbuffer(36160,36096,36161,e)):t.depthBuffer&&t.stencilBuffer?(n?(s=J(t),v.renderbufferStorageMultisample(36161,s,35056,t.width,t.height)):v.renderbufferStorage(36161,34041,t.width,t.height),v.framebufferRenderbuffer(36160,33306,36161,e)):(i=_.convert(t.texture.format),a=_.convert(t.texture.type),o=E(t.texture.internalFormat,i,a),n?(s=J(t),v.renderbufferStorageMultisample(36161,s,o,t.width,t.height)):v.renderbufferStorage(36161,o,t.width,t.height)),v.bindRenderbuffer(36161,null)}function W(e,t){var n=t&&t.isWebGLCubeRenderTarget;if(n)throw new Error("Depth Texture with cube render targets is not supported");if(v.bindFramebuffer(36160,e),!t.depthTexture||!t.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");y.get(t.depthTexture).__webglTexture&&t.depthTexture.image.width===t.width&&t.depthTexture.image.height===t.height||(t.depthTexture.image.width=t.width,t.depthTexture.image.height=t.height,t.depthTexture.needsUpdate=!0),P(t.depthTexture,0);var r=y.get(t.depthTexture).__webglTexture;if(t.depthTexture.format===Ft)v.framebufferTexture2D(36160,36096,3553,r,0);else{if(t.depthTexture.format!==Bt)throw new Error("Unknown depthTexture format");v.framebufferTexture2D(36160,33306,3553,r,0)}}function Y(e){var t=y.get(e),n=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture){if(n)throw new Error("target.depthTexture not supported in Cube render targets");W(t.__webglFramebuffer,e)}else if(n){t.__webglDepthbuffer=[];for(var r=0;r<6;r++)v.bindFramebuffer(36160,t.__webglFramebuffer[r]),t.__webglDepthbuffer[r]=v.createRenderbuffer(),j(t.__webglDepthbuffer[r],e,!1)}else v.bindFramebuffer(36160,t.__webglFramebuffer),t.__webglDepthbuffer=v.createRenderbuffer(),j(t.__webglDepthbuffer,e,!1);v.bindFramebuffer(36160,null)}function q(e){var t=y.get(e),n=y.get(e.texture);e.addEventListener("dispose",A),n.__webglTexture=v.createTexture(),c.memory.textures++;var r,i,a,o,s=!0===e.isWebGLCubeRenderTarget,l=!0===e.isWebGLMultisampleRenderTarget,u=M(e)||x;if(!x||e.texture.format!==kt||e.texture.type!==St&&e.texture.type!==Et||(e.texture.format=Pt,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),s){t.__webglFramebuffer=[];for(var h=0;h<6;h++)t.__webglFramebuffer[h]=v.createFramebuffer()}else t.__webglFramebuffer=v.createFramebuffer(),l&&(x?(t.__webglMultisampledFramebuffer=v.createFramebuffer(),t.__webglColorRenderbuffer=v.createRenderbuffer(),v.bindRenderbuffer(36161,t.__webglColorRenderbuffer),r=_.convert(e.texture.format),i=_.convert(e.texture.type),a=E(e.texture.internalFormat,r,i),o=J(e),v.renderbufferStorageMultisample(36161,o,a,e.width,e.height),v.bindFramebuffer(36160,t.__webglMultisampledFramebuffer),v.framebufferRenderbuffer(36160,36064,36161,t.__webglColorRenderbuffer),v.bindRenderbuffer(36161,null),e.depthBuffer&&(t.__webglDepthRenderbuffer=v.createRenderbuffer(),j(t.__webglDepthRenderbuffer,e,!0)),v.bindFramebuffer(36160,null)):console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."));if(s){for(g.bindTexture(34067,n.__webglTexture),z(34067,e.texture,u),h=0;h<6;h++)H(t.__webglFramebuffer[h],e,36064,34069+h);T(e.texture,u)&&S(34067,e.texture,e.width,e.height),g.bindTexture(34067,null)}else g.bindTexture(3553,n.__webglTexture),z(3553,e.texture,u),H(t.__webglFramebuffer,e,36064,3553),T(e.texture,u)&&S(3553,e.texture,e.width,e.height),g.bindTexture(3553,null);e.depthBuffer&&Y(e)}function X(e){var t,n,r=e.texture,i=M(e)||x;T(r,i)&&(t=e.isWebGLCubeRenderTarget?34067:3553,n=y.get(r).__webglTexture,g.bindTexture(t,n),S(t,r,e.width,e.height),g.bindTexture(t,null))}function Z(e){var t,n,r,i;e.isWebGLMultisampleRenderTarget&&(x?(t=y.get(e),v.bindFramebuffer(36008,t.__webglMultisampledFramebuffer),v.bindFramebuffer(36009,t.__webglFramebuffer),n=e.width,r=e.height,i=16384,e.depthBuffer&&(i|=256),e.stencilBuffer&&(i|=1024),v.blitFramebuffer(0,0,n,r,0,0,n,r,i,9728),v.bindFramebuffer(36160,t.__webglMultisampledFramebuffer)):console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."))}function J(e){return x&&e.isWebGLMultisampleRenderTarget?Math.min(o,e.samples):0}function K(e){var t=c.render.frame;s.get(e)!==t&&(s.set(e,t),e.update())}var Q=!1,$=!1;function ee(e,t){e&&e.isWebGLRenderTarget&&(!1===Q&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),Q=!0),e=e.texture),P(e,t)}function te(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===$&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),$=!0),e=e.texture),(e&&e.isCubeTexture||(0,Ye.default)(e.image)&&6===e.image.length?O:F)(e,t)}this.allocateTextureUnit=k,this.resetTextureUnits=N,this.setTexture2D=P,this.setTexture2DArray=C,this.setTexture3D=D,this.setTextureCube=O,this.setTextureCubeDynamic=F,this.setupRenderTarget=q,this.updateRenderTargetMipmap=X,this.updateMultisampleRenderTarget=Z,this.safeSetTexture2D=ee,this.safeSetTextureCube=te}function nc(e,n,t){var r=t.isWebGL2;function i(e){var t;if(e===_t)return 5121;if(e===At)return 32819;if(e===It)return 32820;if(e===Lt)return 33635;if(e===xt)return 5120;if(e===wt)return 5122;if(e===bt)return 5123;if(e===Mt)return 5124;if(e===Tt)return 5125;if(e===St)return 5126;if(e===Et)return r?5131:(t=n.get("OES_texture_half_float"),null!==t?t.HALF_FLOAT_OES:null);if(e===Nt)return 6406;if(e===kt)return 6407;if(e===Pt)return 6408;if(e===Ct)return 6409;if(e===Dt)return 6410;if(e===Ft)return 6402;if(e===Bt)return 34041;if(e===Ut)return 6403;if(e===zt)return 36244;if(e===Gt)return 33319;if(e===Vt)return 33320;if(e===Ht)return 36248;if(e===jt)return 36249;if(e===Wt||e===Yt||e===qt||e===Xt){if(t=n.get("WEBGL_compressed_texture_s3tc"),null===t)return null;if(e===Wt)return t.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===Yt)return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===qt)return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===Xt)return t.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e===Zt||e===Jt||e===Kt||e===Qt){if(t=n.get("WEBGL_compressed_texture_pvrtc"),null===t)return null;if(e===Zt)return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===Jt)return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===Kt)return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===Qt)return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e===$t)return t=n.get("WEBGL_compressed_texture_etc1"),null!==t?t.COMPRESSED_RGB_ETC1_WEBGL:null;if((e===en||e===tn)&&(t=n.get("WEBGL_compressed_texture_etc"),null!==t)){if(e===en)return t.COMPRESSED_RGB8_ETC2;if(e===tn)return t.COMPRESSED_RGBA8_ETC2_EAC}return e===nn||e===rn||e===an||e===on||e===sn||e===ln||e===un||e===hn||e===cn||e===dn||e===fn||e===pn||e===mn||e===vn||e===yn||e===_n||e===xn||e===wn||e===bn||e===Mn||e===Tn||e===Sn||e===En||e===An||e===In||e===Ln||e===Rn||e===Nn?(t=n.get("WEBGL_compressed_texture_astc"),null!==t?e:null):e===gn?(t=n.get("EXT_texture_compression_bptc"),null!==t?e:null):e===Rt?r?34042:(t=n.get("WEBGL_depth_texture"),null!==t?t.UNSIGNED_INT_24_8_WEBGL:null):void 0}return{convert:i}}function rc(e){vo.call(this),this.cameras=e||[]}function ic(){mi.call(this),this.type="Group"}function ac(f,i){var t=this,p=null,a=1,m=null,o="local-floor",v=null,g=[],s=new I.default,l=new vo;l.layers.enable(1),l.viewport=new Fr;var u=new vo;u.layers.enable(2),u.viewport=new Fr;var y=new rc([l,u]);y.layers.enable(1),y.layers.enable(2);var h=null,c=null;function d(e){var t=s.get(e.inputSource);t&&(t.targetRay&&t.targetRay.dispatchEvent({type:e.type}),t.grip&&t.grip.dispatchEvent({type:e.type}))}function _(){(0,A.default)(s).call(s,function(e,t){e.targetRay&&(e.targetRay.dispatchEvent({type:"disconnected",data:t}),e.targetRay.visible=!1),e.grip&&(e.grip.dispatchEvent({type:"disconnected",data:t}),e.grip.visible=!1)}),s.clear(),f.setFramebuffer(null),f.setRenderTarget(f.getRenderTarget()),n.stop(),t.isPresenting=!1,t.dispatchEvent({type:"sessionend"})}function x(e){m=e,n.setContext(p),n.start(),t.isPresenting=!0,t.dispatchEvent({type:"sessionstart"})}function w(e){for(var t=p.inputSources,n=0;n<g.length;n++)s.set(t[n],g[n]);for(n=0;n<e.removed.length;n++){var r=e.removed[n],i=s.get(r);i&&(i.targetRay&&i.targetRay.dispatchEvent({type:"disconnected",data:r}),i.grip&&i.grip.dispatchEvent({type:"disconnected",data:r}),s.delete(r))}for(n=0;n<e.added.length;n++)r=e.added[n],i=s.get(r),i&&(i.targetRay&&i.targetRay.dispatchEvent({type:"connected",data:r}),i.grip&&i.grip.dispatchEvent({type:"connected",data:r}))}this.enabled=!1,this.isPresenting=!1,this.getController=function(e){var t=g[e];return void 0===t&&(t={},g[e]=t),void 0===t.targetRay&&(t.targetRay=new ic,t.targetRay.matrixAutoUpdate=!1,t.targetRay.visible=!1),t.targetRay},this.getControllerGrip=function(e){var t=g[e];return void 0===t&&(t={},g[e]=t),void 0===t.grip&&(t.grip=new ic,t.grip.matrixAutoUpdate=!1,t.grip.visible=!1),t.grip},this.setFramebufferScaleFactor=function(e){a=e,1==t.isPresenting&&console.warn("WebXRManager: Cannot change framebuffer scale while presenting VR content")},this.setReferenceSpaceType=function(e){o=e},this.getReferenceSpace=function(){return m},this.getSession=function(){return p},this.setSession=function(e){var t,n,r;p=e,null!==p&&(p.addEventListener("select",d),p.addEventListener("selectstart",d),p.addEventListener("selectend",d),p.addEventListener("squeeze",d),p.addEventListener("squeezestart",d),p.addEventListener("squeezeend",d),p.addEventListener("end",_),t=i.getContextAttributes(),n={antialias:t.antialias,alpha:t.alpha,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:a},r=new XRWebGLLayer(p,i,n),p.updateRenderState({baseLayer:r}),p.requestReferenceSpace(o).then(x),p.addEventListener("inputsourceschange",w))};var b=new Hr,M=new Hr;function T(e,t,n){b.setFromMatrixPosition(t.matrixWorld),M.setFromMatrixPosition(n.matrixWorld);var r=b.distanceTo(M),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),l=(i[9]+1)/i[5],u=(i[9]-1)/i[5],h=(i[8]-1)/i[0],c=(a[8]+1)/a[0],d=o*h,f=o*c,p=r/(-h+c),m=p*-h;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(p),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.getInverse(e.matrixWorld);var v=o+p,g=s+p,y=d-m,_=f+(r-m),x=l*s/g*v,w=u*s/g*v;e.projectionMatrix.makePerspective(y,_,x,w,v,g)}function S(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.getInverse(e.matrixWorld)}this.getCamera=function(e){y.near=u.near=l.near=e.near,y.far=u.far=l.far=e.far,h===y.near&&c===y.far||(p.updateRenderState({depthNear:y.near,depthFar:y.far}),h=y.near,c=y.far);var t=e.parent,n=y.cameras;S(y,t);for(var r=0;r<n.length;r++)S(n[r],t);e.matrixWorld.copy(y.matrixWorld);for(var i=e.children,r=0,a=i.length;r<a;r++)i[r].updateMatrixWorld(!0);return T(y,l,u),y};var E=null;function e(e,t){if(v=t.getViewerPose(m),null!==v){var n=v.views,r=p.renderState.baseLayer;f.setFramebuffer(r.framebuffer);for(var i=0;i<n.length;i++){var a=n[i],o=r.getViewport(a),s=y.cameras[i];s.matrix.fromArray(a.transform.matrix),s.projectionMatrix.fromArray(a.projectionMatrix),s.viewport.set(o.x,o.y,o.width,o.height),0===i&&y.matrix.copy(s.matrix)}}for(var l=p.inputSources,i=0;i<g.length;i++){var u=g[i],h=l[i],c=null,d=null;h&&(u.targetRay&&(c=t.getPose(h.targetRaySpace,m),null!==c&&(u.targetRay.matrix.fromArray(c.transform.matrix),u.targetRay.matrix.decompose(u.targetRay.position,u.targetRay.rotation,u.targetRay.scale))),u.grip&&h.gripSpace&&(d=t.getPose(h.gripSpace,m),null!==d&&(u.grip.matrix.fromArray(d.transform.matrix),u.grip.matrix.decompose(u.grip.position,u.grip.rotation,u.grip.scale)))),u.targetRay&&(u.targetRay.visible=null!==c),u.grip&&(u.grip.visible=null!==d)}E&&E(e,t)}var n=new Eo;n.setAnimationLoop(e),this.setAnimationLoop=function(e){E=e},this.dispose=function(){}}function oc(e){e=e||{};var r=e.canvas,t=e.tempCanvas,n=void 0!==e.context?e.context:null,i=void 0!==e.alpha&&e.alpha,a=void 0===e.depth||e.depth,o=void 0===e.stencil||e.stencil,s=void 0!==e.antialias&&e.antialias,l=void 0===e.premultipliedAlpha||e.premultipliedAlpha,u=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,h=void 0!==e.powerPreference?e.powerPreference:"default",c=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat,f=null,w=null;this.domElement=r,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=jn,this.physicallyCorrectLights=!1,this.toneMapping=nt,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var M,x,b,T,p,S,E,A,I,m,v,d,g,y,L,R,N,_,k=this,P=!1,C=null,D=0,O=0,F=null,B=null,U=-1,z={geometry:null,program:null,wireframe:!1},G=null,V=null,H=new Fr,j=new Fr,W=null,Y=r.width,q=r.height,X=1,Z=null,J=null,K=new Fr(0,0,Y,q),Q=new Fr(0,0,Y,q),$=!1,ee=new To,te=new eu,ne=!1,re=!1,ie=new Kr,ae=new Hr;function oe(){return null===F?X:1}try{var se={alpha:i,depth:a,stencil:o,antialias:s,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:h,failIfMajorPerformanceCaveat:c,xrCompatible:!0};if(r.addEventListener("webglcontextlost",ce,!1),r.addEventListener("webglcontextrestored",de,!1),M=n||r.getContext("webgl",se)||r.getContext("experimental-webgl",se),null===M)throw null!==r.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===M.getShaderPrecisionFormat&&(M.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function le(){x=new tu(M),b=new $l(M,x,e),!1===b.isWebGL2&&(x.get("WEBGL_depth_texture"),x.get("OES_texture_float"),x.get("OES_texture_half_float"),x.get("OES_texture_half_float_linear"),x.get("OES_standard_derivatives"),x.get("OES_element_index_uint"),x.get("ANGLE_instanced_arrays")),x.get("OES_texture_float_linear"),_=new nc(M,x,b),T=new ec(M,x,b),T.scissor(j.copy(Q).multiplyScalar(X).floor()),T.viewport(H.copy(K).multiplyScalar(X).floor()),p=new iu(M),S=new Fh,E=new tc(M,x,T,S,b,_,p,t),A=new Ao(M,b),I=new nu(M,A,p),m=new su(M,I,A,p),L=new ou(M),v=new Oh(k,x,b),d=new Gh,g=new Xh,y=new Kl(k,T,m,l),R=new Ql(M,x,p,b),N=new ru(M,x,p,b),p.programs=v.programs,k.capabilities=b,k.extensions=x,k.properties=S,k.renderLists=d,k.state=T,k.info=p}le();var ue=new ac(k,M);this.xr=ue;var he=new $h(k,m,b.maxTextureSize);function ce(e){e.preventDefault(),P=!0}function de(){P=!1,le()}function fe(e){var t=e.target;t.removeEventListener("dispose",fe),pe(t)}function pe(e){me(e),S.remove(e)}function me(e){var t=S.get(e).program;e.program=void 0,void 0!==t&&v.releaseProgram(t)}function ve(e,t){e.render(function(e){k.renderBufferImmediate(e,t)})}this.shadowMap=he,this.getContext=function(){return M},this.getContextAttributes=function(){return M.getContextAttributes()},this.forceContextLoss=function(){var e=x.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=x.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return X},this.setPixelRatio=function(e){void 0!==e&&(X=e,this.setSize(Y,q,!1))},this.getSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),e=new kr),e.set(Y,q)},this.setSize=function(e,t,n){ue.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(Y=e,q=t,r.width=Math.floor(e*X),r.height=Math.floor(t*X),!1!==n&&(r.style.width=e+"px",r.style.height=t+"px"),this.setViewport(0,0,e,t))},this.getDrawingBufferSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),e=new kr),e.set(Y*X,q*X).floor()},this.setDrawingBufferSize=function(e,t,n){Y=e,q=t,X=n,r.width=Math.floor(e*n),r.height=Math.floor(t*n),this.setViewport(0,0,e,t)},this.getCurrentViewport=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),e=new Fr),e.copy(H)},this.getViewport=function(e){return e.copy(K)},this.setViewport=function(e,t,n,r){e.isVector4?K.set(e.x,e.y,e.z,e.w):K.set(e,t,n,r),T.viewport(H.copy(K).multiplyScalar(X).floor())},this.getScissor=function(e){return e.copy(Q)},this.setScissor=function(e,t,n,r){e.isVector4?Q.set(e.x,e.y,e.z,e.w):Q.set(e,t,n,r),T.scissor(j.copy(Q).multiplyScalar(X).floor())},this.getScissorTest=function(){return $},this.setScissorTest=function(e){T.setScissorTest($=e)},this.setOpaqueSort=function(e){Z=e},this.setTransparentSort=function(e){J=e},this.getClearColor=function(){return y.getClearColor()},this.setClearColor=function(){y.setClearColor.apply(y,arguments)},this.getClearAlpha=function(){return y.getClearAlpha()},this.setClearAlpha=function(){y.setClearAlpha.apply(y,arguments)},this.clear=function(e,t,n){var r=0;void 0!==e&&!e||(r|=16384),void 0!==t&&!t||(r|=256),void 0!==n&&!n||(r|=1024),M.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){r.removeEventListener("webglcontextlost",ce,!1),r.removeEventListener("webglcontextrestored",de,!1),d.dispose(),g.dispose(),S.dispose(),m.dispose(),ue.dispose(),we.stop(),this.forceContextLoss()},this.renderBufferImmediate=function(e,t){T.initAttributes();var n=S.get(e);e.hasPositions&&!n.position&&(n.position=M.createBuffer()),e.hasNormals&&!n.normal&&(n.normal=M.createBuffer()),e.hasUvs&&!n.uv&&(n.uv=M.createBuffer()),e.hasColors&&!n.color&&(n.color=M.createBuffer());var r=t.getAttributes();e.hasPositions&&(M.bindBuffer(34962,n.position),M.bufferData(34962,e.positionArray,35048),T.enableAttribute(r.position),M.vertexAttribPointer(r.position,3,5126,!1,0,0)),e.hasNormals&&(M.bindBuffer(34962,n.normal),M.bufferData(34962,e.normalArray,35048),T.enableAttribute(r.normal),M.vertexAttribPointer(r.normal,3,5126,!1,0,0)),e.hasUvs&&(M.bindBuffer(34962,n.uv),M.bufferData(34962,e.uvArray,35048),T.enableAttribute(r.uv),M.vertexAttribPointer(r.uv,2,5126,!1,0,0)),e.hasColors&&(M.bindBuffer(34962,n.color),M.bufferData(34962,e.colorArray,35048),T.enableAttribute(r.color),M.vertexAttribPointer(r.color,3,5126,!1,0,0)),T.disableUnusedAttributes(),M.drawArrays(4,0,e.count),e.count=0};var ge=new vi;function ye(e,t,n,r){if(!1!==b.isWebGL2||!e.isInstancedMesh&&!t.isInstancedBufferGeometry||null!==x.get("ANGLE_instanced_arrays")){T.initAttributes();var i,a=t.attributes,o=r.getAttributes(),s=n.defaultAttributeValues;for(i in o){var l=o[i];if(0<=l){var u=a[i];if(void 0!==u){var h=u.normalized,c=u.itemSize,d=A.get(u);if(void 0===d)continue;var f,p,m,v=d.buffer,g=d.type,y=d.bytesPerElement;u.isInterleavedBufferAttribute?(f=u.data,p=f.stride,m=u.offset,f&&f.isInstancedInterleavedBuffer?(T.enableAttributeAndDivisor(l,f.meshPerAttribute),void 0===t.maxInstancedCount&&(t.maxInstancedCount=f.meshPerAttribute*f.count)):T.enableAttribute(l),M.bindBuffer(34962,v),M.vertexAttribPointer(l,c,g,h,p*y,m*y)):(u.isInstancedBufferAttribute?(T.enableAttributeAndDivisor(l,u.meshPerAttribute),void 0===t.maxInstancedCount&&(t.maxInstancedCount=u.meshPerAttribute*u.count)):T.enableAttribute(l),M.bindBuffer(34962,v),M.vertexAttribPointer(l,c,g,h,0,0))}else if("instanceMatrix"===i){if(d=A.get(e.instanceMatrix),void 0===d)continue;v=d.buffer,g=d.type,T.enableAttributeAndDivisor(l+0,1),T.enableAttributeAndDivisor(l+1,1),T.enableAttributeAndDivisor(l+2,1),T.enableAttributeAndDivisor(l+3,1),M.bindBuffer(34962,v),M.vertexAttribPointer(l+0,4,g,!1,64,0),M.vertexAttribPointer(l+1,4,g,!1,64,16),M.vertexAttribPointer(l+2,4,g,!1,64,32),M.vertexAttribPointer(l+3,4,g,!1,64,48)}else if(void 0!==s){var _=s[i];if(void 0!==_)switch(_.length){case 2:M.vertexAttrib2fv(l,_);break;case 3:M.vertexAttrib3fv(l,_);break;case 4:M.vertexAttrib4fv(l,_);break;default:M.vertexAttrib1fv(l,_)}}}}T.disableUnusedAttributes()}}this.renderBufferDirect=function(e,t,n,r,i,a){null===t&&(t=ge);var o=i.isMesh&&i.matrixWorld.determinant()<0,s=Ee(e,t,r,i);T.setMaterial(r,o);var l=!1;z.geometry===n.id&&z.program===s.id&&z.wireframe===(!0===r.wireframe)||(z.geometry=n.id,z.program=s.id,z.wireframe=!0===r.wireframe,l=!0),(r.morphTargets||r.morphNormals)&&(L.update(i,n,r,s),l=!0);var u=n.index,h=n.attributes.position;if(null===u){if(void 0===h||0===h.count)return}else if(0===u.count)return;var c,d=1;!0===r.wireframe&&(u=I.getWireframeAttribute(n),d=2);var f=R;null!==u&&(c=A.get(u),f=N,f.setIndex(c)),l&&(ye(i,n,r,s),null!==u&&M.bindBuffer(34963,c.buffer));var p,m=null!==u?u.count:h.count,v=n.drawRange.start*d,g=n.drawRange.count*d,y=null!==a?a.start*d:0,_=null!==a?a.count*d:Infinity,x=Math.max(v,y),w=Math.min(m,v+g,y+_)-1,b=Math.max(0,w-x+1);0!==b&&(i.isMesh?!0===r.wireframe?(T.setLineWidth(r.wireframeLinewidth*oe()),f.setMode(1)):f.setMode(4):i.isLine?(p=r.linewidth,void 0===p&&(p=1),T.setLineWidth(p*oe()),i.isLineSegments?f.setMode(1):i.isLineLoop?f.setMode(2):f.setMode(3)):i.isPoints?f.setMode(0):i.isSprite&&f.setMode(4),i.isInstancedMesh?f.renderInstances(n,x,b,i.count):n.isInstancedBufferGeometry?f.renderInstances(n,x,b,n.maxInstancedCount):f.render(x,b))},this.compile=function(n,e){w=g.get(n,e),w.init(),n.traverse(function(e){e.isLight&&(w.pushLight(e),e.castShadow&&w.pushShadow(e))}),w.setupLights(e);var r={};n.traverse(function(e){if(e.material)if((0,Ye.default)(e.material))for(var t=0;t<e.material.length;t++)e.material[t].uuid in r==0&&(Se(e.material[t],n,e),r[e.material[t].uuid]=!0);else e.material.uuid in r==0&&(Se(e.material,n,e),r[e.material.uuid]=!0)})};var _e=null;function xe(e){ue.isPresenting||_e&&_e(e)}var we=new Eo;function be(e,t,n,r){if(!1!==e.visible){var i=e.layers.test(t.layers);if(i)if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)w.pushLight(e),e.castShadow&&w.pushShadow(e);else if(e.isSprite)e.frustumCulled&&!ee.intersectsSprite(e)||(r&&ae.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ie),a=m.update(e),o=e.material,o.visible&&f.push(e,a,o,n,ae.z,null));else if(e.isImmediateRenderObject)r&&ae.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ie),f.push(e,null,e.material,n,ae.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==p.render.frame&&(e.skeleton.update(),e.skeleton.frame=p.render.frame),!e.frustumCulled||ee.intersectsObject(e))){r&&ae.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ie);var a=m.update(e),o=e.material;if((0,Ye.default)(o))for(var s=a.groups,l=0,u=s.length;l<u;l++){var h=s[l],c=o[h.materialIndex];c&&c.visible&&f.push(e,a,c,n,ae.z,h)}else o.visible&&f.push(e,a,o,n,ae.z,null)}for(var d=e.children,l=0,u=d.length;l<u;l++)be(d[l],t,n,r)}}function Me(e,t,n,r){for(var i=0,a=e.length;i<a;i++){var o=e[i],s=o.object,l=o.geometry,u=void 0===r?o.material:r,h=o.group;if(n.isArrayCamera){V=n;for(var c=n.cameras,d=0,f=c.length;d<f;d++){var p=c[d];s.layers.test(p.layers)&&(T.viewport(H.copy(p.viewport)),w.setupLights(p),Te(s,t,p,l,u,h))}}else V=null,Te(s,t,n,l,u,h)}}function Te(e,t,n,r,i,a){var o;e.onBeforeRender(k,t,n,r,i,a),w=g.get(t,V||n),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject?(o=Ee(n,t,i,e),T.setMaterial(i),z.geometry=null,z.program=null,z.wireframe=!1,ve(e,o)):k.renderBufferDirect(n,t,r,i,e,a),e.onAfterRender(k,t,n,r,i,a),w=g.get(t,V||n)}function Se(e,t,n){var r=S.get(e),i=w.state.lights,a=w.state.shadowsArray,o=i.state.version,s=v.getParameters(e,i.state,a,t,te.numPlanes,te.numIntersection,n),l=v.getProgramCacheKey(s),u=r.program,h=!0;if(void 0===u)e.addEventListener("dispose",fe);else if(u.cacheKey!==l)me(e);else if(r.lightsStateVersion!==o)r.lightsStateVersion=o,h=!1;else{if(void 0!==s.shaderID)return;h=!1}h&&(u=v.acquireProgram(s,l),r.program=u,r.uniforms=s.uniforms,r.environment=e.isMeshStandardMaterial?t.environment:null,r.outputEncoding=k.outputEncoding,e.program=u);var c=u.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var d=0;d<k.maxMorphTargets;d++)0<=c["morphTarget"+d]&&e.numSupportedMorphTargets++}if(e.morphNormals)for(e.numSupportedMorphNormals=0,d=0;d<k.maxMorphNormals;d++)0<=c["morphNormal"+d]&&e.numSupportedMorphNormals++;var f=r.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(r.numClippingPlanes=te.numPlanes,r.numIntersection=te.numIntersection,f.clippingPlanes=te.uniform),r.fog=t.fog,r.needsLights=He(e),r.lightsStateVersion=o,r.needsLights&&(f.ambientLightColor.value=i.state.ambient,f.lightProbe.value=i.state.probe,f.directionalLights.value=i.state.directional,f.directionalLightShadows.value=i.state.directionalShadow,f.spotLights.value=i.state.spot,f.spotLightShadows.value=i.state.spotShadow,f.rectAreaLights.value=i.state.rectArea,f.pointLights.value=i.state.point,f.pointLightShadows.value=i.state.pointShadow,f.hemisphereLights.value=i.state.hemi,f.directionalShadowMap.value=i.state.directionalShadowMap,f.directionalShadowMatrix.value=i.state.directionalShadowMatrix,f.spotShadowMap.value=i.state.spotShadowMap,f.spotShadowMatrix.value=i.state.spotShadowMatrix,f.pointShadowMap.value=i.state.pointShadowMap,f.pointShadowMatrix.value=i.state.pointShadowMatrix);var p=r.program.getUniforms(),m=sh.seqWithValue(p.seq,f);r.uniformsList=m}function Ee(e,t,n,r){E.resetTextureUnits();var i,a=t.fog,o=n.isMeshStandardMaterial?t.environment:null,s=S.get(n),l=w.state.lights;ne&&(!re&&e===G||(i=e===G&&n.id===U,te.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,e,s,i))),n.version===s.__version?(void 0===s.program||n.fog&&s.fog!==a||s.environment!==o||s.needsLights&&s.lightsStateVersion!==l.state.version||void 0!==s.numClippingPlanes&&(s.numClippingPlanes!==te.numPlanes||s.numIntersection!==te.numIntersection)||s.outputEncoding!==k.outputEncoding)&&Se(n,t,r):(Se(n,t,r),s.__version=n.version);var u,h,c,d,f,p,m=!1,v=!1,g=!1,y=s.program,_=y.getUniforms(),x=s.uniforms;return T.useProgram(y.program)&&(m=!0,v=!0,g=!0),n.id!==U&&(U=n.id,v=!0),!m&&G===e||(_.setValue(M,"projectionMatrix",e.projectionMatrix),b.logarithmicDepthBuffer&&_.setValue(M,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),G!==e&&(G=e,v=!0,g=!0),(n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap)&&(u=(0,We.default)(_).cameraPosition,void 0!==u&&u.setValue(M,ae.setFromMatrixPosition(e.matrixWorld))),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&_.setValue(M,"isOrthographic",!0===e.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&_.setValue(M,"viewMatrix",e.matrixWorldInverse)),n.skinning&&(_.setOptional(M,r,"bindMatrix"),_.setOptional(M,r,"bindMatrixInverse"),h=r.skeleton,h&&(c=h.bones,b.floatVertexTextures?(void 0===h.boneTexture&&(d=Math.sqrt(4*c.length),d=Nr.ceilPowerOfTwo(d),d=Math.max(d,4),f=new Float32Array(d*d*4),f.set(h.boneMatrices),p=new wo(f,d,d,Pt,St),h.boneMatrices=f,h.boneTexture=p,h.boneTextureSize=d),_.setValue(M,"boneTexture",h.boneTexture,E),_.setValue(M,"boneTextureSize",h.boneTextureSize)):_.setOptional(M,h,"boneMatrices"))),!v&&s.receiveShadow===r.receiveShadow||(s.receiveShadow=r.receiveShadow,_.setValue(M,"receiveShadow",r.receiveShadow)),v&&(_.setValue(M,"toneMappingExposure",k.toneMappingExposure),_.setValue(M,"toneMappingWhitePoint",k.toneMappingWhitePoint),s.needsLights&&Ve(x,g),a&&n.fog&&ke(x,a),n.isMeshBasicMaterial?Ae(x,n):n.isMeshLambertMaterial?(Ae(x,n),Pe(x,n)):n.isMeshToonMaterial?(Ae(x,n),De(x,n)):n.isMeshPhongMaterial?(Ae(x,n),Ce(x,n)):n.isMeshStandardMaterial?(Ae(x,n,o),(n.isMeshPhysicalMaterial?Fe:Oe)(x,n,o)):n.isMeshMatcapMaterial?(Ae(x,n),Be(x,n)):n.isMeshDepthMaterial?(Ae(x,n),Ue(x,n)):n.isMeshDistanceMaterial?(Ae(x,n),ze(x,n)):n.isMeshNormalMaterial?(Ae(x,n),Ge(x,n)):n.isLineBasicMaterial?(Ie(x,n),n.isLineDashedMaterial&&Le(x,n)):n.isPointsMaterial?Re(x,n):n.isSpriteMaterial?Ne(x,n):n.isShadowMaterial&&(x.color.value.copy(n.color),x.opacity.value=n.opacity),void 0!==x.ltc_1&&(x.ltc_1.value=So.LTC_1),void 0!==x.ltc_2&&(x.ltc_2.value=So.LTC_2),sh.upload(M,s.uniformsList,x,E),n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(sh.upload(M,s.uniformsList,x,E),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&_.setValue(M,"center",r.center),_.setValue(M,"modelViewMatrix",r.modelViewMatrix),_.setValue(M,"normalMatrix",r.normalMatrix),_.setValue(M,"modelMatrix",r.matrixWorld),y}function Ae(e,t,n){e.opacity.value=t.opacity,(0,qe.default)(e,t.uniforms),t.color&&e.diffuse.value.copy(t.color),t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),(0,We.default)(t)&&((0,We.default)(e).value=(0,We.default)(t)),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.specularMap&&(e.specularMap.value=t.specularMap);var r,i,a=t.envMap||n;a&&(e.envMap.value=a,e.flipEnvMap.value=a.isCubeTexture?-1:1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio,e.maxMipLevel.value=S.get(a).__maxMipLevel),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity),(0,We.default)(t)?r=(0,We.default)(t):t.specularMap?r=t.specularMap:t.displacementMap?r=t.displacementMap:t.normalMap?r=t.normalMap:t.bumpMap?r=t.bumpMap:t.roughnessMap?r=t.roughnessMap:t.metalnessMap?r=t.metalnessMap:t.alphaMap?r=t.alphaMap:t.emissiveMap&&(r=t.emissiveMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix)),t.aoMap?i=t.aoMap:t.lightMap&&(i=t.lightMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uv2Transform.value.copy(i.matrix))}function Ie(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}function Le(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function Re(e,t){var n;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*X,e.scale.value=.5*q,(0,We.default)(t)&&((0,We.default)(e).value=(0,We.default)(t)),t.alphaMap&&(e.alphaMap.value=t.alphaMap),(0,We.default)(t)?n=(0,We.default)(t):t.alphaMap&&(n=t.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}function Ne(e,t){var n;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,(0,We.default)(t)&&((0,We.default)(e).value=(0,We.default)(t)),t.alphaMap&&(e.alphaMap.value=t.alphaMap),(0,We.default)(t)?n=(0,We.default)(t):t.alphaMap&&(n=t.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}function ke(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)}function Pe(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}function Ce(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===Xe&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===Xe&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function De(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.gradientMap&&(e.gradientMap.value=t.gradientMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===Xe&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===Xe&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function Oe(e,t,n){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===Xe&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===Xe&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),(t.envMap||n)&&(e.envMapIntensity.value=t.envMapIntensity)}function Fe(e,t,n){Oe(e,t,n),e.reflectivity.value=t.reflectivity,e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.sheen&&e.sheen.value.copy(t.sheen),t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap),t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,t.side===Xe&&e.clearcoatNormalScale.value.negate()),e.transparency.value=t.transparency}function Be(e,t){t.matcap&&(e.matcap.value=t.matcap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===Xe&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===Xe&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function Ue(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function ze(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}function Ge(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===Xe&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===Xe&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function Ve(e,t){e.ambientLightColor.needsUpdate=t,e.lightProbe.needsUpdate=t,e.directionalLights.needsUpdate=t,e.directionalLightShadows.needsUpdate=t,e.pointLights.needsUpdate=t,e.pointLightShadows.needsUpdate=t,e.spotLights.needsUpdate=t,e.spotLightShadows.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}function He(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}we.setAnimationLoop(xe),"undefined"!=typeof window&&we.setContext(window),this.setAnimationLoop=function(e){_e=e,ue.setAnimationLoop(e),we.start()},this.render=function(e,t,n,r){var i,a,o,s,l,u;void 0!==n&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),i=arguments[2]),void 0!==r&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),a=arguments[3]),t&&t.isCamera?P||(z.geometry=null,z.program=null,z.wireframe=!1,U=-1,G=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),ue.enabled&&ue.isPresenting&&(t=ue.getCamera(t)),w=g.get(e,t),w.init(),e.onBeforeRender(k,e,t,i||F),ie.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),ee.setFromProjectionMatrix(ie),re=this.localClippingEnabled,ne=te.init(this.clippingPlanes,re,t),f=d.get(e,t),f.init(),be(e,t,0,k.sortObjects),f.finish(),!0===k.sortObjects&&(0,je.default)(f).call(f,Z,J),ne&&te.beginShadows(),o=w.state.shadowsArray,he.render(o,e,t),w.setupLights(t),ne&&te.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==i&&this.setRenderTarget(i),y.render(f,e,t,a),s=f.opaque,l=f.transparent,e.overrideMaterial?(u=e.overrideMaterial,s.length&&Me(s,e,t,u),l.length&&Me(l,e,t,u)):(s.length&&Me(s,e,t),l.length&&Me(l,e,t)),e.onAfterRender(k,e,t),null!==F&&(E.updateRenderTargetMipmap(F),E.updateMultisampleRenderTarget(F)),T.buffers.depth.setTest(!0),T.buffers.depth.setMask(!0),T.buffers.color.setMask(!0),T.setPolygonOffset(!1),f=null,w=null):console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(e){C!==e&&null===F&&M.bindFramebuffer(36160,e),C=e},this.getActiveCubeFace=function(){return D},this.getActiveMipmapLevel=function(){return O},this.getRenderTarget=function(){return F},this.setRenderTarget=function(e,t,n){F=e,D=t,O=n,e&&void 0===S.get(e).__webglFramebuffer&&E.setupRenderTarget(e);var r,i,a=C,o=!1;W=e?(r=S.get(e).__webglFramebuffer,e.isWebGLCubeRenderTarget?(a=r[t||0],o=!0):a=e.isWebGLMultisampleRenderTarget?S.get(e).__webglMultisampledFramebuffer:r,H.copy(e.viewport),j.copy(e.scissor),e.scissorTest):(H.copy(K).multiplyScalar(X).floor(),j.copy(Q).multiplyScalar(X).floor(),$),B!==a&&(M.bindFramebuffer(36160,a),B=a),T.viewport(H),T.scissor(j),T.setScissorTest(W),o&&(i=S.get(e.texture),M.framebufferTexture2D(36160,36064,34069+(t||0),i.__webglTexture,n||0))},this.readRenderTargetPixels=function(e,t,n,r,i,a,o){if(e&&e.isWebGLRenderTarget){var s=S.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){var l=!1;s!==B&&(M.bindFramebuffer(36160,s),l=!0);try{var u=e.texture,h=u.format,c=u.type;if(h!==Pt&&_.convert(h)!==M.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(c===_t||_.convert(c)===M.getParameter(35738)||c===St&&(b.isWebGL2||x.get("OES_texture_float")||x.get("WEBGL_color_buffer_float"))||c===Et&&(b.isWebGL2?x.get("EXT_color_buffer_float"):x.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===M.checkFramebufferStatus(36160)?0<=t&&t<=e.width-r&&0<=n&&n<=e.height-i&&M.readPixels(t,n,r,i,_.convert(h),_.convert(c),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{l&&M.bindFramebuffer(36160,B)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,n){void 0===n&&(n=0);var r=Math.pow(2,-n),i=Math.floor(t.image.width*r),a=Math.floor(t.image.height*r),o=_.convert(t.format);E.setTexture2D(t,0),M.copyTexImage2D(3553,n,o,e.x,e.y,i,a,0),T.unbindTexture()},this.copyTextureToTexture=function(e,t,n,r){var i=t.image.width,a=t.image.height,o=_.convert(n.format),s=_.convert(n.type);E.setTexture2D(n,0),t.isDataTexture?M.texSubImage2D(3553,r||0,e.x,e.y,i,a,o,s,t.image.data):M.texSubImage2D(3553,r||0,e.x,e.y,o,s,t.image),T.unbindTexture()},this.initTexture=function(e){E.setTexture2D(e,0),T.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function sc(e,t){this.name="",this.color=new oa(e),this.density=void 0!==t?t:25e-5}function lc(e,t,n){this.name="",this.color=new oa(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}function uc(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=yr,this.updateRange={offset:0,count:-1},this.version=0}rc.prototype=(0,qe.default)((0,T.default)(vo.prototype),{constructor:rc,isArrayCamera:!0}),ic.prototype=(0,qe.default)((0,T.default)(mi.prototype),{constructor:ic,isGroup:!0}),(0,qe.default)(ac.prototype,Ar.prototype),(0,qe.default)(sc.prototype,{isFogExp2:!0,clone:function(){return new sc(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),(0,qe.default)(lc.prototype,{isFog:!0,clone:function(){return new lc(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),(0,R.default)(uc.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),(0,qe.default)(uc.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(var r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(e){return this.onUploadCallback=e,this}});var hc,cc=new Hr;function dc(e,t,n,r){this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===r}function fc(e){da.call(this),this.type="SpriteMaterial",this.color=new oa(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}(0,S.default)(dc.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),(0,qe.default)(dc.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(e){for(var t=0,n=this.data.count;t<n;t++)cc.x=this.getX(t),cc.y=this.getY(t),cc.z=this.getZ(t),cc.applyMatrix4(e),this.setXYZ(t,cc.x,cc.y,cc.z);return this},setX:function(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this},setY:function(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this},setZ:function(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this},setW:function(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}}),fc.prototype=(0,T.default)(da.prototype),fc.prototype.constructor=fc,fc.prototype.isSpriteMaterial=!0,fc.prototype.copy=function(e){return da.prototype.copy.call(this,e),this.color.copy(e.color),this.map=(0,We.default)(e),this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this};var pc=new Hr,mc=new Hr,vc=new Hr,gc=new kr,yc=new kr,_c=new Kr,xc=new Hr,wc=new Hr,bc=new Hr,Mc=new kr,Tc=new kr,Sc=new kr;function Ec(e){var t,n;mi.call(this),this.type="Sprite",void 0===hc&&(hc=new Ca,t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new uc(t,5),hc.setIndex([0,1,2,0,2,3]),hc.setAttribute("position",new dc(n,3,0,!1)),hc.setAttribute("uv",new dc(n,2,3,!1))),this.geometry=hc,this.material=void 0!==e?e:new fc,this.center=new kr(.5,.5)}function Ac(e,t,n,r,i,a){gc.subVectors(e,n).addScalar(.5).multiply(r),void 0!==i?(yc.x=a*gc.x-i*gc.y,yc.y=i*gc.x+a*gc.y):yc.copy(gc),e.copy(t),e.x+=yc.x,e.y+=yc.y,e.applyMatrix4(_c)}Ec.prototype=(0,qe.default)((0,T.default)(mi.prototype),{constructor:Ec,isSprite:!0,raycast:function(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),mc.setFromMatrixScale(this.matrixWorld),_c.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),vc.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&mc.multiplyScalar(-vc.z);var n,r,i=this.material.rotation;0!==i&&(r=Math.cos(i),n=Math.sin(i));var a=this.center;Ac(xc.set(-.5,-.5,0),vc,a,mc,n,r),Ac(wc.set(.5,-.5,0),vc,a,mc,n,r),Ac(bc.set(.5,.5,0),vc,a,mc,n,r),Mc.set(0,0),Tc.set(1,0),Sc.set(1,1);var o,s=e.ray.intersectTriangle(xc,wc,bc,!1,pc);null===s&&(Ac(wc.set(-.5,.5,0),vc,a,mc,n,r),Tc.set(0,1),s=e.ray.intersectTriangle(xc,bc,wc,!1,pc),null===s)||(o=e.ray.origin.distanceTo(pc),o<e.near||o>e.far||t.push({distance:o,point:pc.clone(),uv:na.getUV(pc,xc,wc,bc,Mc,Tc,Sc,new kr),face:null,object:this}))},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return mi.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this}});var Ic=new Hr,Lc=new Hr;function Rc(){mi.call(this),this._currentLevel=0,this.type="LOD",(0,S.default)(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function Nc(e,t){e&&e.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),Qa.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Kr,this.bindMatrixInverse=new Kr}Rc.prototype=(0,qe.default)((0,T.default)(mi.prototype),{constructor:Rc,isLOD:!0,copy:function(e){mi.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,r=t.length;n<r;n++){var i=t[n];this.addLevel(i.object.clone(),i.distance)}return this.autoUpdate=e.autoUpdate,this},addLevel:function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var n=this.levels,r=0;r<n.length&&!(t<n[r].distance);r++);return(0,L.default)(n).call(n,r,0,{distance:t,object:e}),this.add(e),this},getCurrentLevel:function(){return this._currentLevel},getObjectForDistance:function(e){var t=this.levels;if(0<t.length){for(var n=1,r=t.length;n<r&&!(e<t[n].distance);n++);return t[n-1].object}return null},raycast:function(e,t){var n,r=this.levels;0<r.length&&(Ic.setFromMatrixPosition(this.matrixWorld),n=e.ray.origin.distanceTo(Ic),this.getObjectForDistance(n).raycast(e,t))},update:function(e){var t=this.levels;if(1<t.length){Ic.setFromMatrixPosition(e.matrixWorld),Lc.setFromMatrixPosition(this.matrixWorld);var n=Ic.distanceTo(Lc)/e.zoom;t[0].object.visible=!0;for(var r=1,i=t.length;r<i&&n>=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;r<i;r++)t[r].object.visible=!1}},toJSON:function(e){var t=mi.prototype.toJSON.call(this,e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];for(var n=this.levels,r=0,i=n.length;r<i;r++){var a=n[r];t.object.levels.push({object:a.object.uuid,distance:a.distance})}return t}}),Nc.prototype=(0,qe.default)((0,T.default)(Qa.prototype),{constructor:Nc,isSkinnedMesh:!0,bind:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var e=new Fr,t=this.geometry.attributes.skinWeight,n=0,r=t.count;n<r;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(n);var i=1/e.manhattanLength();Infinity!==i?e.multiplyScalar(i):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}},updateMatrixWorld:function(e){Qa.prototype.updateMatrixWorld.call(this,e),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var kc=new Kr,Pc=new Kr;function Cc(e,t){if(e=e||[],this.bones=(0,E.default)(e).call(e,0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=(0,E.default)(t).call(t,0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new Kr)}}function Dc(){mi.call(this),this.type="Bone"}(0,qe.default)(Cc.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new Kr;this.bones[e]&&n.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(n)}},pose:function(){for(var e,t=0,n=this.bones.length;t<n;t++)e=this.bones[t],e&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,n=this.bones.length;t<n;t++)e=this.bones[t],e&&(e.parent&&e.parent.isBone?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},update:function(){for(var e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,i=0,a=e.length;i<a;i++){var o=e[i]?e[i].matrixWorld:Pc;kc.multiplyMatrices(o,t[i]),kc.toArray(n,16*i)}void 0!==r&&(r.needsUpdate=!0)},clone:function(){return new Cc(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,n=this.bones.length;t<n;t++){var r=this.bones[t];if(r.name===e)return r}},dispose:function(){this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=void 0)}}),Dc.prototype=(0,qe.default)((0,T.default)(mi.prototype),{constructor:Dc,isBone:!0});var Oc=new Kr,Fc=new Kr,Bc=[],Uc=new Qa;function zc(e,t,n){Qa.call(this,e,t),this.instanceMatrix=new ma(new Float32Array(16*n),16),this.count=n,this.frustumCulled=!1}function Gc(e){da.call(this),this.type="LineBasicMaterial",this.color=new oa(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(e)}zc.prototype=(0,qe.default)((0,T.default)(Qa.prototype),{constructor:zc,isInstancedMesh:!0,getMatrixAt:function(e,t){t.fromArray(this.instanceMatrix.array,16*e)},raycast:function(e,t){var n=this.matrixWorld,r=this.count;if(Uc.geometry=this.geometry,Uc.material=this.material,void 0!==Uc.material)for(var i=0;i<r;i++)this.getMatrixAt(i,Oc),Fc.multiplyMatrices(n,Oc),Uc.matrixWorld=Fc,Uc.raycast(e,Bc),0<Bc.length&&(Bc[0].instanceId=i,Bc[0].object=this,t.push(Bc[0]),Bc.length=0)},setMatrixAt:function(e,t){t.toArray(this.instanceMatrix.array,16*e)},updateMorphTargets:function(){}}),Gc.prototype=(0,T.default)(da.prototype),Gc.prototype.constructor=Gc,Gc.prototype.isLineBasicMaterial=!0,Gc.prototype.copy=function(e){return da.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this};var Vc=new Hr,Hc=new Hr,jc=new Kr,Wc=new Gi,Yc=new Pi;function qc(e,t,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),mi.call(this),this.type="Line",this.geometry=void 0!==e?e:new Ca,this.material=void 0!==t?t:new Gc}qc.prototype=(0,qe.default)((0,T.default)(mi.prototype),{constructor:qc,isLine:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],r=1,i=t.count;r<i;r++)Vc.fromBufferAttribute(t,r-1),Hc.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=Vc.distanceTo(Hc);e.setAttribute("lineDistance",new Ma(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices,n=e.lineDistances;for(n[0]=0,r=1,i=a.length;r<i;r++)n[r]=n[r-1],n[r]+=a[r-1].distanceTo(a[r])}return this},raycast:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),Yc.copy(n.boundingSphere),Yc.applyMatrix4(r),Yc.radius+=i,!1!==e.ray.intersectsSphere(Yc)){jc.getInverse(r),Wc.copy(e.ray).applyMatrix4(jc);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,s=new Hr,l=new Hr,u=new Hr,h=new Hr,c=this&&this.isLineSegments?2:1;if(n.isBufferGeometry){var d=n.index,f=n.attributes,p=f.position.array;if(null!==d)for(var m=d.array,v=0,g=m.length-1;v<g;v+=c){var y=m[v],_=m[v+1];s.fromArray(p,3*y),l.fromArray(p,3*_);var x=Wc.distanceSqToSegment(s,l,h,u);o<x||(h.applyMatrix4(this.matrixWorld),M=e.ray.origin.distanceTo(h),M<e.near||M>e.far||t.push({distance:M,point:u.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}))}else for(v=0,g=p.length/3-1;v<g;v+=c)s.fromArray(p,3*v),l.fromArray(p,3*v+3),x=Wc.distanceSqToSegment(s,l,h,u),o<x||(h.applyMatrix4(this.matrixWorld),M=e.ray.origin.distanceTo(h),M<e.near||M>e.far||t.push({distance:M,point:u.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}))}else if(n.isGeometry)for(var w=n.vertices,b=w.length,v=0;v<b-1;v+=c){var M,x=Wc.distanceSqToSegment(w[v],w[v+1],h,u);o<x||(h.applyMatrix4(this.matrixWorld),M=e.ray.origin.distanceTo(h),M<e.near||M>e.far||t.push({distance:M,point:u.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}))}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Xc=new Hr,Zc=new Hr;function Jc(e,t){qc.call(this,e,t),this.type="LineSegments"}function Kc(e,t){qc.call(this,e,t),this.type="LineLoop"}function Qc(e){da.call(this),this.type="PointsMaterial",this.color=new oa(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}Jc.prototype=(0,qe.default)((0,T.default)(qc.prototype),{constructor:Jc,isLineSegments:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[],r=0,i=t.count;r<i;r+=2)Xc.fromBufferAttribute(t,r),Zc.fromBufferAttribute(t,r+1),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+Xc.distanceTo(Zc);e.setAttribute("lineDistance",new Ma(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry)for(var a=e.vertices,n=e.lineDistances,r=0,i=a.length;r<i;r+=2)Xc.copy(a[r]),Zc.copy(a[r+1]),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+Xc.distanceTo(Zc);return this}}),Kc.prototype=(0,qe.default)((0,T.default)(qc.prototype),{constructor:Kc,isLineLoop:!0}),Qc.prototype=(0,T.default)(da.prototype),Qc.prototype.constructor=Qc,Qc.prototype.isPointsMaterial=!0,Qc.prototype.copy=function(e){return da.prototype.copy.call(this,e),this.color.copy(e.color),this.map=(0,We.default)(e),this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this};var $c=new Kr,ed=new Gi,td=new Pi,nd=new Hr;function rd(e,t){mi.call(this),this.type="Points",this.geometry=void 0!==e?e:new Ca,this.material=void 0!==t?t:new Qc,this.updateMorphTargets()}function id(e,t,n,r,i,a,o){var s=ed.distanceSqToPoint(e);if(s<n){var l=new Hr;ed.closestPointToPoint(e,l),l.applyMatrix4(r);var u=i.ray.origin.distanceTo(l);if(u<i.near||u>i.far)return;a.push({distance:u,distanceToRay:Math.sqrt(s),point:l,index:t,face:null,object:o})}}function ad(e,t,n,r,i,a,o,s,l){Or.call(this,e,t,n,r,i,a,o,s,l),this.format=void 0!==o?o:kt,this.minFilter=void 0!==a?a:pt,this.magFilter=void 0!==i?i:pt,this.generateMipmaps=!1}function od(e,t,n,r,i,a,o,s,l,u,h,c){Or.call(this,null,a,o,s,l,u,r,i,h,c),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function sd(e,t,n,r,i,a,o,s,l){Or.call(this,e,t,n,r,i,a,o,s,l),this.needsUpdate=!0}function ld(e,t,n,r,i,a,o,s,l,u){if(u=void 0!==u?u:Ft,u!==Ft&&u!==Bt)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&u===Ft&&(n=bt),void 0===n&&u===Bt&&(n=Rt),Or.call(this,null,r,i,a,o,s,u,n,l),this.image={width:e,height:t},this.magFilter=void 0!==o?o:ut,this.minFilter=void 0!==s?s:ut,this.flipY=!1,this.generateMipmaps=!1}function ud(e){Ca.call(this),this.type="WireframeGeometry";var t,n,r,i,a,o,s=[],l=[0,0],u={},h=["a","b","c"];if(e&&e.isGeometry){for(var c=e.faces,d=0,f=c.length;d<f;d++)for(var p=c[d],m=0;m<3;m++)i=p[h[m]],a=p[h[(m+1)%3]],l[0]=Math.min(i,a),l[1]=Math.max(i,a),o=l[0]+","+l[1],void 0===u[o]&&(u[o]={index1:l[0],index2:l[1]});for(o in u)r=u[o],T=e.vertices[r.index1],s.push(T.x,T.y,T.z),T=e.vertices[r.index2],s.push(T.x,T.y,T.z)}else if(e&&e.isBufferGeometry){var v,g,y,_,x,w,b,M,T=new Hr;if(null!==e.index){for(v=e.attributes.position,g=e.index,y=e.groups,0===y.length&&(y=[{start:0,count:g.count,materialIndex:0}]),t=0,n=y.length;t<n;++t)for(_=y[t],x=_.start,w=_.count,d=x,f=x+w;d<f;d+=3)for(m=0;m<3;m++)i=g.getX(d+m),a=g.getX(d+(m+1)%3),l[0]=Math.min(i,a),l[1]=Math.max(i,a),o=l[0]+","+l[1],void 0===u[o]&&(u[o]={index1:l[0],index2:l[1]});for(o in u)r=u[o],T.fromBufferAttribute(v,r.index1),s.push(T.x,T.y,T.z),T.fromBufferAttribute(v,r.index2),s.push(T.x,T.y,T.z)}else for(v=e.attributes.position,d=0,f=v.count/3;d<f;d++)for(m=0;m<3;m++)b=3*d+m,T.fromBufferAttribute(v,b),s.push(T.x,T.y,T.z),M=3*d+(m+1)%3,T.fromBufferAttribute(v,M),s.push(T.x,T.y,T.z)}this.setAttribute("position",new Ma(s,3))}function hd(e,t,n){ao.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new cd(e,t,n)),this.mergeVertices()}function cd(e,t,n){Ca.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};var r=[],i=[],a=[],o=[],s=1e-5,l=new Hr,u=new Hr,h=new Hr,c=new Hr,d=new Hr;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");for(var f=t+1,p=0;p<=n;p++)for(var m=p/n,v=0;v<=t;v++){var g=v/t;e(g,m,u),i.push(u.x,u.y,u.z),0<=g-s?(e(g-s,m,h),c.subVectors(u,h)):(e(g+s,m,h),c.subVectors(h,u)),0<=m-s?(e(g,m-s,h),d.subVectors(u,h)):(e(g,m+s,h),d.subVectors(h,u)),l.crossVectors(c,d).normalize(),a.push(l.x,l.y,l.z),o.push(g,m)}for(p=0;p<n;p++)for(v=0;v<t;v++){var y=p*f+v,_=p*f+v+1,x=(p+1)*f+v+1,w=(p+1)*f+v;r.push(y,_,w),r.push(_,x,w)}this.setIndex(r),this.setAttribute("position",new Ma(i,3)),this.setAttribute("normal",new Ma(a,3)),this.setAttribute("uv",new Ma(o,2))}function dd(e,t,n,r){ao.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},this.fromBufferGeometry(new fd(e,t,n,r)),this.mergeVertices()}function fd(r,a,e,t){Ca.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:r,indices:a,radius:e,detail:t},e=e||1,t=t||0;var h=[],c=[];function n(e){for(var t=new Hr,n=new Hr,r=new Hr,i=0;i<a.length;i+=3)u(a[i+0],t),u(a[i+1],n),u(a[i+2],r),o(t,n,r,e)}function o(e,t,n,r){for(var i=Math.pow(2,r),a=[],o=0;o<=i;o++){a[o]=[];for(var s=e.clone().lerp(n,o/i),l=t.clone().lerp(n,o/i),u=i-o,h=0;h<=u;h++)a[o][h]=0===h&&o===i?s:s.clone().lerp(l,h/u)}for(o=0;o<i;o++)for(h=0;h<2*(i-o)-1;h++){var c=Math.floor(h/2);h%2==0?(d(a[o][c+1]),d(a[o+1][c]),d(a[o][c])):(d(a[o][c+1]),d(a[o+1][c+1]),d(a[o+1][c]))}}function i(e){for(var t=new Hr,n=0;n<h.length;n+=3)t.x=h[n+0],t.y=h[n+1],t.z=h[n+2],t.normalize().multiplyScalar(e),h[n+0]=t.x,h[n+1]=t.y,h[n+2]=t.z}function s(){for(var e=new Hr,t=0;t<h.length;t+=3){e.x=h[t+0],e.y=h[t+1],e.z=h[t+2];var n=m(e)/2/Math.PI+.5,r=v(e)/Math.PI+.5;c.push(n,1-r)}f(),l()}function l(){for(var e=0;e<c.length;e+=6){var t=c[e+0],n=c[e+2],r=c[e+4],i=Math.max(t,n,r),a=Math.min(t,n,r);.9<i&&a<.1&&(t<.2&&(c[e+0]+=1),n<.2&&(c[e+2]+=1),r<.2&&(c[e+4]+=1))}}function d(e){h.push(e.x,e.y,e.z)}function u(e,t){var n=3*e;t.x=r[n+0],t.y=r[n+1],t.z=r[n+2]}function f(){for(var e=new Hr,t=new Hr,n=new Hr,r=new Hr,i=new kr,a=new kr,o=new kr,s=0,l=0;s<h.length;s+=9,l+=6){e.set(h[s+0],h[s+1],h[s+2]),t.set(h[s+3],h[s+4],h[s+5]),n.set(h[s+6],h[s+7],h[s+8]),i.set(c[l+0],c[l+1]),a.set(c[l+2],c[l+3]),o.set(c[l+4],c[l+5]),r.copy(e).add(t).add(n).divideScalar(3);var u=m(r);p(i,l+0,e,u),p(a,l+2,t,u),p(o,l+4,n,u)}}function p(e,t,n,r){r<0&&1===e.x&&(c[t]=e.x-1),0===n.x&&0===n.z&&(c[t]=r/2/Math.PI+.5)}function m(e){return Math.atan2(e.z,-e.x)}function v(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}n(t),i(e),s(),this.setAttribute("position",new Ma(h,3)),this.setAttribute("normal",new Ma((0,E.default)(h).call(h),3)),this.setAttribute("uv",new Ma(c,2)),0===t?this.computeVertexNormals():this.normalizeNormals()}function pd(e,t){ao.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new md(e,t)),this.mergeVertices()}function md(e,t){var n=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];fd.call(this,n,r,e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function vd(e,t){ao.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new gd(e,t)),this.mergeVertices()}function gd(e,t){var n=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];fd.call(this,n,r,e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function yd(e,t){ao.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new _d(e,t)),this.mergeVertices()}function _d(e,t){var n=(1+Math.sqrt(5))/2,r=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],i=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];fd.call(this,r,i,e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function xd(e,t){ao.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new wd(e,t)),this.mergeVertices()}function wd(e,t){var n=(1+Math.sqrt(5))/2,r=1/n,i=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];fd.call(this,i,a,e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function bd(e,t,n,r,i,a){ao.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new Md(e,t,n,r,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function Md(o,s,l,u,e){Ca.call(this),this.type="TubeBufferGeometry",this.parameters={path:o,tubularSegments:s,radius:l,radialSegments:u,closed:e},s=s||64,l=l||1,u=u||8,e=e||!1;var h=o.computeFrenetFrames(s,e);this.tangents=h.tangents,this.normals=h.normals,this.binormals=h.binormals;var i,c,d=new Hr,f=new Hr,t=new kr,p=new Hr,m=[],v=[],n=[],a=[];function r(){for(i=0;i<s;i++)g(i);g(!1===e?s:0),_(),y()}function g(e){p=o.getPointAt(e/s,p);var t=h.normals[e],n=h.binormals[e];for(c=0;c<=u;c++){var r=c/u*Math.PI*2,i=Math.sin(r),a=-Math.cos(r);f.x=a*t.x+i*n.x,f.y=a*t.y+i*n.y,f.z=a*t.z+i*n.z,f.normalize(),v.push(f.x,f.y,f.z),d.x=p.x+l*f.x,d.y=p.y+l*f.y,d.z=p.z+l*f.z,m.push(d.x,d.y,d.z)}}function y(){for(c=1;c<=s;c++)for(i=1;i<=u;i++){var e=(u+1)*(c-1)+(i-1),t=(u+1)*c+(i-1),n=(u+1)*c+i,r=(u+1)*(c-1)+i;a.push(e,t,r),a.push(t,n,r)}}function _(){for(i=0;i<=s;i++)for(c=0;c<=u;c++)t.x=i/s,t.y=c/u,n.push(t.x,t.y)}r(),this.setIndex(a),this.setAttribute("position",new Ma(m,3)),this.setAttribute("normal",new Ma(v,3)),this.setAttribute("uv",new Ma(n,2))}function Td(e,t,n,r,i,a,o){ao.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Sd(e,t,n,r,i,a)),this.mergeVertices()}function Sd(e,t,n,r,i,a){Ca.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},e=e||1,t=t||.4,n=Math.floor(n)||64,r=Math.floor(r)||8,i=i||2,a=a||3;for(var o,s=[],l=[],u=[],h=[],c=new Hr,d=new Hr,f=new Hr,p=new Hr,m=new Hr,v=new Hr,g=new Hr,y=0;y<=n;++y){var _=y/n*i*Math.PI*2;for(A(_,i,a,e,f),A(_+.01,i,a,e,p),v.subVectors(p,f),g.addVectors(p,f),m.crossVectors(v,g),g.crossVectors(m,v),m.normalize(),g.normalize(),o=0;o<=r;++o){var x=o/r*Math.PI*2,w=-t*Math.cos(x),b=t*Math.sin(x);c.x=f.x+(w*g.x+b*m.x),c.y=f.y+(w*g.y+b*m.y),c.z=f.z+(w*g.z+b*m.z),l.push(c.x,c.y,c.z),d.subVectors(c,f).normalize(),u.push(d.x,d.y,d.z),h.push(y/n),h.push(o/r)}}for(o=1;o<=n;o++)for(y=1;y<=r;y++){var M=(r+1)*(o-1)+(y-1),T=(r+1)*o+(y-1),S=(r+1)*o+y,E=(r+1)*(o-1)+y;s.push(M,T,E),s.push(T,S,E)}function A(e,t,n,r,i){var a=Math.cos(e),o=Math.sin(e),s=n/t*e,l=Math.cos(s);i.x=r*(2+l)*.5*a,i.y=r*(2+l)*o*.5,i.z=r*Math.sin(s)*.5}this.setIndex(s),this.setAttribute("position",new Ma(l,3)),this.setAttribute("normal",new Ma(u,3)),this.setAttribute("uv",new Ma(h,2))}function Ed(e,t,n,r,i){ao.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},this.fromBufferGeometry(new Ad(e,t,n,r,i)),this.mergeVertices()}function Ad(e,t,n,r,i){Ca.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},e=e||1,t=t||.4,n=Math.floor(n)||8,r=Math.floor(r)||6,i=i||2*Math.PI;for(var a,o=[],s=[],l=[],u=[],h=new Hr,c=new Hr,d=new Hr,f=0;f<=n;f++)for(a=0;a<=r;a++){var p=a/r*i,m=f/n*Math.PI*2;c.x=(e+t*Math.cos(m))*Math.cos(p),c.y=(e+t*Math.cos(m))*Math.sin(p),c.z=t*Math.sin(m),s.push(c.x,c.y,c.z),h.x=e*Math.cos(p),h.y=e*Math.sin(p),d.subVectors(c,h).normalize(),l.push(d.x,d.y,d.z),u.push(a/r),u.push(f/n)}for(f=1;f<=n;f++)for(a=1;a<=r;a++){var v=(r+1)*f+a-1,g=(r+1)*(f-1)+a-1,y=(r+1)*(f-1)+a,_=(r+1)*f+a;o.push(v,g,_),o.push(g,y,_)}this.setIndex(o),this.setAttribute("position",new Ma(s,3)),this.setAttribute("normal",new Ma(l,3)),this.setAttribute("uv",new Ma(u,2))}rd.prototype=(0,qe.default)((0,T.default)(mi.prototype),{constructor:rd,isPoints:!0,raycast:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),td.copy(n.boundingSphere),td.applyMatrix4(r),td.radius+=i,!1!==e.ray.intersectsSphere(td)){$c.getInverse(r),ed.copy(e.ray).applyMatrix4($c);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a;if(n.isBufferGeometry){var s=n.index,l=n.attributes,u=l.position.array;if(null!==s)for(var h=s.array,c=0,d=h.length;c<d;c++){var f=h[c];nd.fromArray(u,3*f),id(nd,f,o,r,e,t,this)}else for(var c=0,p=u.length/3;c<p;c++)nd.fromArray(u,3*c),id(nd,c,o,r,e,t,this)}else for(var m=n.vertices,c=0,p=m.length;c<p;c++)id(m[c],c,o,r,e,t,this)}},updateMorphTargets:function(){var e,t,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,a=(0,v.default)(i);if(0<a.length){var o=i[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=r.morphTargets;void 0!==s&&0<s.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),ad.prototype=(0,qe.default)((0,T.default)(Or.prototype),{constructor:ad,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),od.prototype=(0,T.default)(Or.prototype),od.prototype.constructor=od,od.prototype.isCompressedTexture=!0,sd.prototype=(0,T.default)(Or.prototype),sd.prototype.constructor=sd,sd.prototype.isCanvasTexture=!0,ld.prototype=(0,T.default)(Or.prototype),ld.prototype.constructor=ld,ld.prototype.isDepthTexture=!0,ud.prototype=(0,T.default)(Ca.prototype),ud.prototype.constructor=ud,hd.prototype=(0,T.default)(ao.prototype),hd.prototype.constructor=hd,cd.prototype=(0,T.default)(Ca.prototype),cd.prototype.constructor=cd,dd.prototype=(0,T.default)(ao.prototype),dd.prototype.constructor=dd,fd.prototype=(0,T.default)(Ca.prototype),fd.prototype.constructor=fd,pd.prototype=(0,T.default)(ao.prototype),pd.prototype.constructor=pd,md.prototype=(0,T.default)(fd.prototype),md.prototype.constructor=md,vd.prototype=(0,T.default)(ao.prototype),vd.prototype.constructor=vd,gd.prototype=(0,T.default)(fd.prototype),gd.prototype.constructor=gd,yd.prototype=(0,T.default)(ao.prototype),yd.prototype.constructor=yd,_d.prototype=(0,T.default)(fd.prototype),_d.prototype.constructor=_d,xd.prototype=(0,T.default)(ao.prototype),xd.prototype.constructor=xd,wd.prototype=(0,T.default)(fd.prototype),wd.prototype.constructor=wd,bd.prototype=(0,T.default)(ao.prototype),bd.prototype.constructor=bd,Md.prototype=(0,T.default)(Ca.prototype),Md.prototype.constructor=Md,Md.prototype.toJSON=function(){var e=Ca.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e},Td.prototype=(0,T.default)(ao.prototype),Td.prototype.constructor=Td,Sd.prototype=(0,T.default)(Ca.prototype),Sd.prototype.constructor=Sd,Ed.prototype=(0,T.default)(ao.prototype),Ed.prototype.constructor=Ed,Ad.prototype=(0,T.default)(Ca.prototype),Ad.prototype.constructor=Ad;var Id={triangulate:function(e,t,n){n=n||2;var r,i,a,o,s,l,u,h=t&&t.length,c=h?t[0]*n:e.length,d=Ld(e,0,c,n,!0),f=[];if(!d||d.next===d.prev)return f;if(h&&(d=Od(e,t,d,n)),e.length>80*n){r=a=e[0],i=o=e[1];for(var p=n;p<c;p+=n)s=e[p],l=e[p+1],s<r&&(r=s),l<i&&(i=l),a<s&&(a=s),o<l&&(o=l);u=Math.max(a-r,o-i),u=0!==u?1/u:0}return Nd(d,f,n,r,i,u),f}};function Ld(e,t,n,r,i){var a,o;if(i===0<nf(e,t,n,r))for(a=t;a<n;a+=r)o=$d(a,e[a],e[a+1],o);else for(a=n-r;t<=a;a-=r)o=$d(a,e[a],e[a+1],o);return o&&qd(o,o.next)&&(ef(o),o=o.next),o}function Rd(e,t){if(!e)return e;t=t||e;var n,r=e;do{if(n=!1,r.steiner||!qd(r,r.next)&&0!==Yd(r.prev,r,r.next))r=r.next;else{if(ef(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function Nd(e,t,n,r,i,a,o){if(e){!o&&a&&zd(e,r,i,a);for(var s,l,u=e;e.prev!==e.next;)if(s=e.prev,l=e.next,a?Pd(e,r,i,a):kd(e))t.push(s.i/n),t.push(e.i/n),t.push(l.i/n),ef(e),e=l.next,u=l.next;else if(e=l,e===u){o?1===o?(e=Cd(e,t,n),Nd(e,t,n,r,i,a,2)):2===o&&Dd(e,t,n,r,i,a):Nd(Rd(e),t,n,r,i,a,1);break}}}function kd(e){var t=e.prev,n=e,r=e.next;if(0<=Yd(t,n,r))return!1;for(var i=e.next.next;i!==e.prev;){if(jd(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&0<=Yd(i.prev,i,i.next))return!1;i=i.next}return!0}function Pd(e,t,n,r){var i=e.prev,a=e,o=e.next;if(0<=Yd(i,a,o))return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,l=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,u=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,h=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,c=Vd(s,l,t,n,r),d=Vd(u,h,t,n,r),f=e.prevZ,p=e.nextZ;f&&f.z>=c&&p&&p.z<=d;){if(f!==e.prev&&f!==e.next&&jd(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&0<=Yd(f.prev,f,f.next))return!1;if(f=f.prevZ,p!==e.prev&&p!==e.next&&jd(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=Yd(p.prev,p,p.next))return!1;p=p.nextZ}for(;f&&f.z>=c;){if(f!==e.prev&&f!==e.next&&jd(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&0<=Yd(f.prev,f,f.next))return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&jd(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=Yd(p.prev,p,p.next))return!1;p=p.nextZ}return!0}function Cd(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!qd(i,a)&&Xd(i,r,r.next,a)&&Jd(i,a)&&Jd(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),ef(r),ef(r.next),r=e=a),r=r.next}while(r!==e);return r}function Dd(e,t,n,r,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Wd(o,s)){var l=Qd(o,s),o=Rd(o,o.next),l=Rd(l,l.next);return Nd(o,t,n,r,i,a),void Nd(l,t,n,r,i,a)}s=s.next}o=o.next}while(o!==e)}function Od(e,t,n,r){for(var i,a,o,s=[],l=0,u=t.length;l<u;l++)i=t[l]*r,a=l<u-1?t[l+1]*r:e.length,o=Ld(e,i,a,r,!1),o===o.next&&(o.steiner=!0),s.push(Hd(o));for((0,je.default)(s).call(s,Fd),l=0;l<s.length;l++)Bd(s[l],n),n=Rd(n,n.next);return n}function Fd(e,t){return e.x-t.x}function Bd(e,t){var n;t=Ud(e,t),t&&(n=Qd(t,e),Rd(n,n.next))}function Ud(e,t){var n,r=t,i=e.x,a=e.y,o=-Infinity;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&o<s){if(o=s,s===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===o)return n.prev;for(var l,u=n,h=n.x,c=n.y,d=Infinity,r=n.next;r!==u;)i>=r.x&&r.x>=h&&i!==r.x&&jd(a<c?i:o,a,h,c,a<c?o:i,a,r.x,r.y)&&(l=Math.abs(a-r.y)/(i-r.x),(l<d||l===d&&r.x>n.x)&&Jd(r,e)&&(n=r,d=l)),r=r.next;return n}function zd(e,t,n,r){for(var i=e;null===i.z&&(i.z=Vd(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next,i!==e;);i.prevZ.nextZ=null,i.prevZ=null,Gd(i)}function Gd(e){var t,n,r,i,a,o,s,l,u=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t<u&&(s++,r=r.nextZ,r);t++);for(l=u;0<s||0<l&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,u*=2}while(1<o);return e}function Vd(e,t,n,r,i){return e=32767*(e-n)*i,t=32767*(t-r)*i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function Hd(e){for(var t=e,n=e;(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next,t!==e;);return n}function jd(e,t,n,r,i,a,o,s){return 0<=(i-o)*(t-s)-(e-o)*(a-s)&&0<=(e-o)*(r-s)-(n-o)*(t-s)&&0<=(n-o)*(a-s)-(i-o)*(r-s)}function Wd(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Zd(e,t)&&Jd(e,t)&&Jd(t,e)&&Kd(e,t)}function Yd(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function qd(e,t){return e.x===t.x&&e.y===t.y}function Xd(e,t,n,r){return!!(qd(e,n)&&qd(t,r)||qd(e,r)&&qd(n,t))||0<Yd(e,t,n)!=0<Yd(e,t,r)&&0<Yd(n,r,e)!=0<Yd(n,r,t)}function Zd(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Xd(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function Jd(e,t){return Yd(e.prev,e,e.next)<0?0<=Yd(e,t,e.next)&&0<=Yd(e,e.prev,t):Yd(e,t,e.prev)<0||Yd(e,e.next,t)<0}function Kd(e,t){for(var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next,n!==e;);return r}function Qd(e,t){var n=new tf(e.i,e.x,e.y),r=new tf(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function $d(e,t,n,r){var i=new tf(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function ef(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function tf(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function nf(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}var rf={area:function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n},isClockWise:function(e){return rf.area(e)<0},triangulateShape:function(e,t){var n=[],r=[],i=[];af(e),of(n,e);var a=e.length;(0,A.default)(t).call(t,af);for(var o=0;o<t.length;o++)r.push(a),a+=t[o].length,of(n,t[o]);for(var s=Id.triangulate(n,r),o=0;o<s.length;o+=3)i.push((0,E.default)(s).call(s,o,o+3));return i}};function af(e){var t=e.length;2<t&&e[t-1].equals(e[0])&&e.pop()}function of(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}function sf(e,t){ao.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new lf(e,t)),this.mergeVertices()}function lf(e,ee){Ca.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:e,options:ee},e=(0,Ye.default)(e)?e:[e];for(var te=this,ne=[],re=[],t=0,n=e.length;t<n;t++){var r=e[t];i(r)}function i(e){var r=[],t=void 0!==ee.curveSegments?ee.curveSegments:12,d=void 0!==ee.steps?ee.steps:1,n=void 0!==ee.depth?ee.depth:100,i=void 0===ee.bevelEnabled||ee.bevelEnabled,a=void 0!==ee.bevelThickness?ee.bevelThickness:6,o=void 0!==ee.bevelSize?ee.bevelSize:a-2,s=void 0!==ee.bevelOffset?ee.bevelOffset:0,f=void 0!==ee.bevelSegments?ee.bevelSegments:3,l=ee.extrudePath,u=void 0!==ee.UVGenerator?ee.UVGenerator:uf;void 0!==ee.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),n=ee.amount);var h,c,p,m,v,g,y=!1;l&&(h=l.getSpacedPoints(d),y=!0,i=!1,c=l.computeFrenetFrames(d,!1),p=new Hr,m=new Hr,v=new Hr),i||(f=0,a=0,o=0,s=0);var _=e.extractPoints(t),x=_.shape,w=_.holes,b=!rf.isClockWise(x);if(b)for(x=(0,ae.default)(x).call(x),S=0,E=w.length;S<E;S++)g=w[S],rf.isClockWise(g)&&(w[S]=(0,ae.default)(g).call(g));for(var M=rf.triangulateShape(x,w),T=x,S=0,E=w.length;S<E;S++)g=w[S],x=(0,ie.default)(x).call(x,g);function A(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}var I,L,R,N,k,P,C=x.length,D=M.length;function O(e,t,n){var r,i=e.x-t.x,a=e.y-t.y,o=n.x-e.x,s=n.y-e.y,l=i*i+a*a,u=i*s-a*o;if(Math.abs(u)>se.default){var h=Math.sqrt(l),c=Math.sqrt(o*o+s*s),d=t.x-a/h,f=t.y+i/h,p=n.x-s/c,m=n.y+o/c,v=((p-d)*s-(m-f)*o)/(i*s-a*o),g=d+i*v-e.x,y=f+a*v-e.y,_=g*g+y*y;if(_<=2)return new kr(g,y);r=Math.sqrt(_/2)}else{var x=!1;i>se.default?o>se.default&&(x=!0):i<-se.default?o<-se.default&&(x=!0):(0,oe.default)(a)===(0,oe.default)(s)&&(x=!0),r=x?(g=-a,y=i,Math.sqrt(l)):(g=i,y=a,Math.sqrt(l/2))}return new kr(g/r,y/r)}for(var F=[],B=0,U=T.length,z=U-1,G=B+1;B<U;B++,z++,G++)z===U&&(z=0),G===U&&(G=0),F[B]=O(T[B],T[z],T[G]);for(var V,H,j=[],W=(0,ie.default)(F).call(F),S=0,E=w.length;S<E;S++){for(g=w[S],V=[],B=0,U=g.length,z=U-1,G=B+1;B<U;B++,z++,G++)z===U&&(z=0),G===U&&(G=0),V[B]=O(g[B],g[z],g[G]);j.push(V),W=(0,ie.default)(W).call(W,V)}for(I=0;I<f;I++){for(R=I/f,N=a*Math.cos(R*Math.PI/2),L=o*Math.sin(R*Math.PI/2)+s,B=0,U=T.length;B<U;B++)k=A(T[B],F[B],L),Z(k.x,k.y,-N);for(S=0,E=w.length;S<E;S++)for(g=w[S],V=j[S],B=0,U=g.length;B<U;B++)k=A(g[B],V[B],L),Z(k.x,k.y,-N)}for(L=o+s,B=0;B<C;B++)k=i?A(x[B],W[B],L):x[B],y?(m.copy(c.normals[0]).multiplyScalar(k.x),p.copy(c.binormals[0]).multiplyScalar(k.y),v.copy(h[0]).add(m).add(p),Z(v.x,v.y,v.z)):Z(k.x,k.y,0);for(H=1;H<=d;H++)for(B=0;B<C;B++)k=i?A(x[B],W[B],L):x[B],y?(m.copy(c.normals[H]).multiplyScalar(k.x),p.copy(c.binormals[H]).multiplyScalar(k.y),v.copy(h[H]).add(m).add(p),Z(v.x,v.y,v.z)):Z(k.x,k.y,n/d*H);for(I=f-1;0<=I;I--){for(R=I/f,N=a*Math.cos(R*Math.PI/2),L=o*Math.sin(R*Math.PI/2)+s,B=0,U=T.length;B<U;B++)k=A(T[B],F[B],L),Z(k.x,k.y,n+N);for(S=0,E=w.length;S<E;S++)for(g=w[S],V=j[S],B=0,U=g.length;B<U;B++)k=A(g[B],V[B],L),y?Z(k.x,k.y+h[d-1].y,h[d-1].x+N):Z(k.x,k.y,n+N)}function Y(){var e=ne.length/3;if(i){var t=0,n=C*t;for(B=0;B<D;B++)P=M[B],J(P[2]+n,P[1]+n,P[0]+n);for(t=d+2*f,n=C*t,B=0;B<D;B++)P=M[B],J(P[0]+n,P[1]+n,P[2]+n)}else{for(B=0;B<D;B++)P=M[B],J(P[2],P[1],P[0]);for(B=0;B<D;B++)P=M[B],J(P[0]+C*d,P[1]+C*d,P[2]+C*d)}te.addGroup(e,ne.length/3-e,0)}function q(){var e=ne.length/3,t=0;for(X(T,t),t+=T.length,S=0,E=w.length;S<E;S++)g=w[S],X(g,t),t+=g.length;te.addGroup(e,ne.length/3-e,1)}function X(e,t){var n,r;for(B=e.length;0<=--B;){n=B,r=B-1,r<0&&(r=e.length-1);for(var i=0,a=d+2*f,i=0;i<a;i++){var o=C*i,s=C*(i+1),l=t+n+o,u=t+r+o,h=t+r+s,c=t+n+s;K(l,u,h,c)}}}function Z(e,t,n){r.push(e),r.push(t),r.push(n)}function J(e,t,n){Q(e),Q(t),Q(n);var r=ne.length/3,i=u.generateTopUV(te,ne,r-3,r-2,r-1);$(i[0]),$(i[1]),$(i[2])}function K(e,t,n,r){Q(e),Q(t),Q(r),Q(t),Q(n),Q(r);var i=ne.length/3,a=u.generateSideWallUV(te,ne,i-6,i-3,i-2,i-1);$(a[0]),$(a[1]),$(a[3]),$(a[1]),$(a[2]),$(a[3])}function Q(e){ne.push(r[3*e+0]),ne.push(r[3*e+1]),ne.push(r[3*e+2])}function $(e){re.push(e.x),re.push(e.y)}Y(),q()}this.setAttribute("position",new Ma(ne,3)),this.setAttribute("uv",new Ma(re,2)),this.computeVertexNormals()}t.ShapeUtils=rf,sf.prototype=(0,T.default)(ao.prototype),sf.prototype.constructor=sf,sf.prototype.toJSON=function(){var e=ao.prototype.toJSON.call(this),t=this.parameters.shapes,n=this.parameters.options;return hf(t,n,e)},lf.prototype=(0,T.default)(Ca.prototype),lf.prototype.constructor=lf,lf.prototype.toJSON=function(){var e=Ca.prototype.toJSON.call(this),t=this.parameters.shapes,n=this.parameters.options;return hf(t,n,e)};var uf={generateTopUV:function(e,t,n,r,i){var a=t[3*n],o=t[3*n+1],s=t[3*r],l=t[3*r+1],u=t[3*i],h=t[3*i+1];return[new kr(a,o),new kr(s,l),new kr(u,h)]},generateSideWallUV:function(e,t,n,r,i,a){var o=t[3*n],s=t[3*n+1],l=t[3*n+2],u=t[3*r],h=t[3*r+1],c=t[3*r+2],d=t[3*i],f=t[3*i+1],p=t[3*i+2],m=t[3*a],v=t[3*a+1],g=t[3*a+2];return Math.abs(s-h)<.01?[new kr(o,1-l),new kr(u,1-c),new kr(d,1-p),new kr(m,1-g)]:[new kr(s,1-l),new kr(h,1-c),new kr(f,1-p),new kr(v,1-g)]}};function hf(e,t,n){if(n.shapes=[],(0,Ye.default)(e))for(var r=0,i=e.length;r<i;r++){var a=e[r];n.shapes.push(a.uuid)}else n.shapes.push(e.uuid);return void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON()),n}function cf(e,t){ao.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new df(e,t)),this.mergeVertices()}function df(e,t){t=t||{};var n=t.font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new ao;var r=n.generateShapes(e,t.size);t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),lf.call(this,r,t),this.type="TextBufferGeometry"}function ff(e,t,n,r,i,a,o){ao.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new pf(e,t,n,r,i,a,o)),this.mergeVertices()}function pf(e,t,n,r,i,a,o){Ca.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},e=e||1,t=Math.max(3,Math.floor(t)||8),n=Math.max(2,Math.floor(n)||6),r=void 0!==r?r:0,i=void 0!==i?i:2*Math.PI,a=void 0!==a?a:0,o=void 0!==o?o:Math.PI;for(var s,l=Math.min(a+o,Math.PI),u=0,h=[],c=new Hr,d=new Hr,f=[],p=[],m=[],v=[],g=0;g<=n;g++){var y=[],_=g/n,x=0;for(0==g&&0==a?x=.5/t:g==n&&l==Math.PI&&(x=-.5/t),s=0;s<=t;s++){var w=s/t;c.x=-e*Math.cos(r+w*i)*Math.sin(a+_*o),c.y=e*Math.cos(a+_*o),c.z=e*Math.sin(r+w*i)*Math.sin(a+_*o),p.push(c.x,c.y,c.z),d.copy(c).normalize(),m.push(d.x,d.y,d.z),v.push(w+x,1-_),y.push(u++)}h.push(y)}for(g=0;g<n;g++)for(s=0;s<t;s++){var b=h[g][s+1],M=h[g][s],T=h[g+1][s],S=h[g+1][s+1];(0!==g||0<a)&&f.push(b,M,S),(g!==n-1||l<Math.PI)&&f.push(M,T,S)}this.setIndex(f),this.setAttribute("position",new Ma(p,3)),this.setAttribute("normal",new Ma(m,3)),this.setAttribute("uv",new Ma(v,2))}function mf(e,t,n,r,i,a){ao.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},this.fromBufferGeometry(new vf(e,t,n,r,i,a)),this.mergeVertices()}function vf(e,t,n,r,i,a){Ca.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},e=e||.5,t=t||1,i=void 0!==i?i:0,a=void 0!==a?a:2*Math.PI,n=void 0!==n?Math.max(3,n):8,r=void 0!==r?Math.max(1,r):1;for(var o,s=[],l=[],u=[],h=[],c=e,d=(t-e)/r,f=new Hr,p=new kr,m=0;m<=r;m++){for(g=0;g<=n;g++)o=i+g/n*a,f.x=c*Math.cos(o),f.y=c*Math.sin(o),l.push(f.x,f.y,f.z),u.push(0,0,1),p.x=(f.x/t+1)/2,p.y=(f.y/t+1)/2,h.push(p.x,p.y);c+=d}for(m=0;m<r;m++)for(var v=m*(n+1),g=0;g<n;g++){o=g+v;var y=o,_=o+n+1,x=o+n+2,w=o+1;s.push(y,_,w),s.push(_,x,w)}this.setIndex(s),this.setAttribute("position",new Ma(l,3)),this.setAttribute("normal",new Ma(u,3)),this.setAttribute("uv",new Ma(h,2))}function gf(e,t,n,r){ao.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},this.fromBufferGeometry(new yf(e,t,n,r)),this.mergeVertices()}function yf(e,t,n,r){Ca.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t)||12,n=n||0,r=r||2*Math.PI,r=Nr.clamp(r,0,2*Math.PI);for(var i=[],a=[],o=[],s=1/t,l=new Hr,u=new kr,h=0;h<=t;h++)for(var c=n+h*s*r,d=Math.sin(c),f=Math.cos(c),p=0;p<=e.length-1;p++)l.x=e[p].x*d,l.y=e[p].y,l.z=e[p].x*f,a.push(l.x,l.y,l.z),u.x=h/t,u.y=p/(e.length-1),o.push(u.x,u.y);for(h=0;h<t;h++)for(p=0;p<e.length-1;p++){M=p+h*e.length;var m=M,v=M+e.length,g=M+e.length+1,y=M+1;i.push(m,v,y),i.push(v,g,y)}if(this.setIndex(i),this.setAttribute("position",new Ma(a,3)),this.setAttribute("uv",new Ma(o,2)),this.computeVertexNormals(),r===2*Math.PI)for(var _=this.attributes.normal.array,x=new Hr,w=new Hr,b=new Hr,M=t*e.length*3,h=0,p=0;h<e.length;h++,p+=3)x.x=_[p+0],x.y=_[p+1],x.z=_[p+2],w.x=_[M+p+0],w.y=_[M+p+1],w.z=_[M+p+2],b.addVectors(x,w).normalize(),_[p+0]=_[M+p+0]=b.x,_[p+1]=_[M+p+1]=b.y,_[p+2]=_[M+p+2]=b.z}function _f(e,t){ao.call(this),this.type="ShapeGeometry","object"===(0,ne.default)(t)&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new xf(e,t)),this.mergeVertices()}function xf(e,p){Ca.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:p},p=p||12;var m=[],v=[],g=[],y=[],t=0,_=0;if(!1===(0,Ye.default)(e))r(e);else for(var n=0;n<e.length;n++)r(e[n]),this.addGroup(t,_,n),t+=_,_=0;function r(e){var t,n=v.length/3,r=e.extractPoints(p),i=r.shape,a=r.holes;for(!1===rf.isClockWise(i)&&(i=(0,ae.default)(i).call(i)),s=0,l=a.length;s<l;s++)t=a[s],!0===rf.isClockWise(t)&&(a[s]=(0,ae.default)(t).call(t));for(var o=rf.triangulateShape(i,a),s=0,l=a.length;s<l;s++)t=a[s],i=(0,ie.default)(i).call(i,t);for(s=0,l=i.length;s<l;s++){var u=i[s];v.push(u.x,u.y,0),g.push(0,0,1),y.push(u.x,u.y)}for(s=0,l=o.length;s<l;s++){var h=o[s],c=h[0]+n,d=h[1]+n,f=h[2]+n;m.push(c,d,f),_+=3}}this.setIndex(m),this.setAttribute("position",new Ma(v,3)),this.setAttribute("normal",new Ma(g,3)),this.setAttribute("uv",new Ma(y,2))}function wf(e,t){if(t.shapes=[],(0,Ye.default)(e))for(var n=0,r=e.length;n<r;n++){var i=e[n];t.shapes.push(i.uuid)}else t.shapes.push(e.uuid);return t}function bf(e,t){Ca.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=void 0!==t?t:1;var n,r,i,a,o=[],s=Math.cos(Nr.DEG2RAD*t),l=[0,0],u={},h=["a","b","c"];e.isBufferGeometry?(a=new ao,a.fromBufferGeometry(e)):a=e.clone(),a.mergeVertices(),a.computeFaceNormals();for(var c=a.vertices,d=a.faces,f=0,p=d.length;f<p;f++)for(var m=d[f],v=0;v<3;v++)n=m[h[v]],r=m[h[(v+1)%3]],l[0]=Math.min(n,r),l[1]=Math.max(n,r),i=l[0]+","+l[1],void 0===u[i]?u[i]={index1:l[0],index2:l[1],face1:f,face2:void 0}:u[i].face2=f;for(i in u){var g,y=u[i];(void 0===y.face2||d[y.face1].normal.dot(d[y.face2].normal)<=s)&&(g=c[y.index1],o.push(g.x,g.y,g.z),g=c[y.index2],o.push(g.x,g.y,g.z))}this.setAttribute("position",new Ma(o,3))}function Mf(e,t,n,r,i,a,o,s){ao.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new Tf(e,t,n,r,i,a,o,s)),this.mergeVertices()}function Tf(g,y,_,x,w,e,b,M){Ca.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:g,radiusBottom:y,height:_,radialSegments:x,heightSegments:w,openEnded:e,thetaStart:b,thetaLength:M};var T=this;g=void 0!==g?g:1,y=void 0!==y?y:1,_=_||1,x=Math.floor(x)||8,w=Math.floor(w)||1,e=void 0!==e&&e,b=void 0!==b?b:0,M=void 0!==M?M:2*Math.PI;var S=[],E=[],A=[],I=[],L=0,R=[],N=_/2,k=0;function t(){for(var e=new Hr,t=new Hr,n=0,r=(y-g)/_,i=0;i<=w;i++){for(var a=[],o=i/w,s=o*(y-g)+g,l=0;l<=x;l++){var u=l/x,h=u*M+b,c=Math.sin(h),d=Math.cos(h);t.x=s*c,t.y=-o*_+N,t.z=s*d,E.push(t.x,t.y,t.z),e.set(c,r,d).normalize(),A.push(e.x,e.y,e.z),I.push(u,1-o),a.push(L++)}R.push(a)}for(l=0;l<x;l++)for(i=0;i<w;i++){var f=R[i][l],p=R[i+1][l],m=R[i+1][l+1],v=R[i][l+1];S.push(f,p,v),S.push(p,m,v),n+=6}T.addGroup(k,n,0),k+=n}function n(e){for(var t,n=new kr,r=new Hr,i=0,a=!0===e?g:y,o=!0===e?1:-1,s=L,l=1;l<=x;l++)E.push(0,N*o,0),A.push(0,o,0),I.push(.5,.5),L++;for(t=L,l=0;l<=x;l++){var u=l/x,h=u*M+b,c=Math.cos(h),d=Math.sin(h);r.x=a*d,r.y=N*o,r.z=a*c,E.push(r.x,r.y,r.z),A.push(0,o,0),n.x=.5*c+.5,n.y=.5*d*o+.5,I.push(n.x,n.y),L++}for(l=0;l<x;l++){var f=s+l,p=t+l;!0===e?S.push(p,p+1,f):S.push(p+1,p,f),i+=3}T.addGroup(k,i,!0===e?1:2),k+=i}t(),!1===e&&(0<g&&n(!0),0<y&&n(!1)),this.setIndex(S),this.setAttribute("position",new Ma(E,3)),this.setAttribute("normal",new Ma(A,3)),this.setAttribute("uv",new Ma(I,2))}function Sf(e,t,n,r,i,a,o){Mf.call(this,0,e,t,n,r,i,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}function Ef(e,t,n,r,i,a,o){Tf.call(this,0,e,t,n,r,i,a,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}function Af(e,t,n,r){ao.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new If(e,t,n,r)),this.mergeVertices()}function If(e,t,n,r){Ca.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},e=e||1,t=void 0!==t?Math.max(3,t):8,n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var i,a,o=[],s=[],l=[],u=[],h=new Hr,c=new kr;for(s.push(0,0,0),l.push(0,0,1),u.push(.5,.5),a=0,i=3;a<=t;a++,i+=3){var d=n+a/t*r;h.x=e*Math.cos(d),h.y=e*Math.sin(d),s.push(h.x,h.y,h.z),l.push(0,0,1),c.x=(s[i]/e+1)/2,c.y=(s[i+1]/e+1)/2,u.push(c.x,c.y)}for(i=1;i<=t;i++)o.push(i,i+1,0);this.setIndex(o),this.setAttribute("position",new Ma(s,3)),this.setAttribute("normal",new Ma(l,3)),this.setAttribute("uv",new Ma(u,2))}cf.prototype=(0,T.default)(ao.prototype),cf.prototype.constructor=cf,df.prototype=(0,T.default)(lf.prototype),df.prototype.constructor=df,ff.prototype=(0,T.default)(ao.prototype),ff.prototype.constructor=ff,pf.prototype=(0,T.default)(Ca.prototype),pf.prototype.constructor=pf,mf.prototype=(0,T.default)(ao.prototype),mf.prototype.constructor=mf,vf.prototype=(0,T.default)(Ca.prototype),vf.prototype.constructor=vf,gf.prototype=(0,T.default)(ao.prototype),gf.prototype.constructor=gf,yf.prototype=(0,T.default)(Ca.prototype),yf.prototype.constructor=yf,_f.prototype=(0,T.default)(ao.prototype),_f.prototype.constructor=_f,_f.prototype.toJSON=function(){var e=ao.prototype.toJSON.call(this),t=this.parameters.shapes;return wf(t,e)},xf.prototype=(0,T.default)(Ca.prototype),xf.prototype.constructor=xf,xf.prototype.toJSON=function(){var e=Ca.prototype.toJSON.call(this),t=this.parameters.shapes;return wf(t,e)},bf.prototype=(0,T.default)(Ca.prototype),bf.prototype.constructor=bf,Mf.prototype=(0,T.default)(ao.prototype),Mf.prototype.constructor=Mf,Tf.prototype=(0,T.default)(Ca.prototype),Tf.prototype.constructor=Tf,Sf.prototype=(0,T.default)(Mf.prototype),Sf.prototype.constructor=Sf,Ef.prototype=(0,T.default)(Tf.prototype),Ef.prototype.constructor=Ef,Af.prototype=(0,T.default)(ao.prototype),Af.prototype.constructor=Af,If.prototype=(0,T.default)(Ca.prototype),If.prototype.constructor=If;var Lf=(0,l.default)({__proto__:null,WireframeGeometry:ud,ParametricGeometry:hd,ParametricBufferGeometry:cd,TetrahedronGeometry:pd,TetrahedronBufferGeometry:md,OctahedronGeometry:vd,OctahedronBufferGeometry:gd,IcosahedronGeometry:yd,IcosahedronBufferGeometry:_d,DodecahedronGeometry:xd,DodecahedronBufferGeometry:wd,PolyhedronGeometry:dd,PolyhedronBufferGeometry:fd,TubeGeometry:bd,TubeBufferGeometry:Md,TorusKnotGeometry:Td,TorusKnotBufferGeometry:Sd,TorusGeometry:Ed,TorusBufferGeometry:Ad,TextGeometry:cf,TextBufferGeometry:df,SphereGeometry:ff,SphereBufferGeometry:pf,RingGeometry:mf,RingBufferGeometry:vf,PlaneGeometry:Io,PlaneBufferGeometry:Lo,LatheGeometry:gf,LatheBufferGeometry:yf,ShapeGeometry:_f,ShapeBufferGeometry:xf,ExtrudeGeometry:sf,ExtrudeBufferGeometry:lf,EdgesGeometry:bf,ConeGeometry:Sf,ConeBufferGeometry:Ef,CylinderGeometry:Mf,CylinderBufferGeometry:Tf,CircleGeometry:Af,CircleBufferGeometry:If,BoxGeometry:oo,BoxBufferGeometry:so});function Rf(e){da.call(this),this.type="ShadowMaterial",this.color=new oa(0),this.transparent=!0,this.setValues(e)}function Nf(e){po.call(this,e),this.type="RawShaderMaterial"}function kf(e){da.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new oa(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new oa(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=er,this.normalScale=new kr(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.vertexTangents=!1,this.setValues(e)}function Pf(e){kf.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new kr(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transparency=0,this.setValues(e)}function Cf(e){da.call(this),this.type="MeshPhongMaterial",this.color=new oa(16777215),this.specular=new oa(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new oa(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=er,this.normalScale=new kr(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Z,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Df(e){da.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new oa(16777215),this.specular=new oa(1118481),this.shininess=30,this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new oa(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=er,this.normalScale=new kr(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Of(e){da.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=er,this.normalScale=new kr(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Ff(e){da.call(this),this.type="MeshLambertMaterial",this.color=new oa(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new oa(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Z,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Bf(e){da.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new oa(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=er,this.normalScale=new kr(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Uf(e){Gc.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}Rf.prototype=(0,T.default)(da.prototype),Rf.prototype.constructor=Rf,Rf.prototype.isShadowMaterial=!0,Rf.prototype.copy=function(e){return da.prototype.copy.call(this,e),this.color.copy(e.color),this},Nf.prototype=(0,T.default)(po.prototype),Nf.prototype.constructor=Nf,Nf.prototype.isRawShaderMaterial=!0,kf.prototype=(0,T.default)(da.prototype),kf.prototype.constructor=kf,kf.prototype.isMeshStandardMaterial=!0,kf.prototype.copy=function(e){return da.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=(0,We.default)(e),this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.vertexTangents=e.vertexTangents,this},Pf.prototype=(0,T.default)(kf.prototype),Pf.prototype.constructor=Pf,Pf.prototype.isMeshPhysicalMaterial=!0,Pf.prototype.copy=function(e){return kf.prototype.copy.call(this,e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.reflectivity=e.reflectivity,e.sheen?this.sheen=(this.sheen||new oa).copy(e.sheen):this.sheen=null,this.transparency=e.transparency,this},Cf.prototype=(0,T.default)(da.prototype),Cf.prototype.constructor=Cf,Cf.prototype.isMeshPhongMaterial=!0,Cf.prototype.copy=function(e){return da.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=(0,We.default)(e),this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Df.prototype=(0,T.default)(da.prototype),Df.prototype.constructor=Df,Df.prototype.isMeshToonMaterial=!0,Df.prototype.copy=function(e){return da.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=(0,We.default)(e),this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Of.prototype=(0,T.default)(da.prototype),Of.prototype.constructor=Of,Of.prototype.isMeshNormalMaterial=!0,Of.prototype.copy=function(e){return da.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Ff.prototype=(0,T.default)(da.prototype),Ff.prototype.constructor=Ff,Ff.prototype.isMeshLambertMaterial=!0,Ff.prototype.copy=function(e){return da.prototype.copy.call(this,e),this.color.copy(e.color),this.map=(0,We.default)(e),this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Bf.prototype=(0,T.default)(da.prototype),Bf.prototype.constructor=Bf,Bf.prototype.isMeshMatcapMaterial=!0,Bf.prototype.copy=function(e){return da.prototype.copy.call(this,e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=(0,We.default)(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Uf.prototype=(0,T.default)(Gc.prototype),Uf.prototype.constructor=Uf,Uf.prototype.isLineDashedMaterial=!0,Uf.prototype.copy=function(e){return Gc.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var zf=(0,l.default)({__proto__:null,ShadowMaterial:Rf,SpriteMaterial:fc,RawShaderMaterial:Nf,ShaderMaterial:po,PointsMaterial:Qc,MeshPhysicalMaterial:Pf,MeshStandardMaterial:kf,MeshPhongMaterial:Cf,MeshToonMaterial:Df,MeshNormalMaterial:Of,MeshLambertMaterial:Ff,MeshDepthMaterial:Zh,MeshDistanceMaterial:Jh,MeshBasicMaterial:fa,MeshMatcapMaterial:Bf,LineDashedMaterial:Uf,LineBasicMaterial:Gc,Material:da}),Gf={arraySlice:function(e,t,n){return Gf.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):(0,E.default)(e).call(e,t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):(0,E.default)(Array.prototype).call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(n){function e(e,t){return n[e]-n[t]}for(var t=n.length,r=new Array(t),i=0;i!==t;++i)r[i]=i;return(0,je.default)(r).call(r,e),r},sortedArray:function(e,t,n){for(var r=e.length,i=new e.constructor(r),a=0,o=0;o!==r;++a)for(var s=n[a]*t,l=0;l!==t;++l)i[o++]=e[s+l];return i},flattenJSON:function(e,t,n,r){for(var i=1,a=e[0];void 0!==a&&void 0===a[r];)a=e[i++];if(void 0!==a){var o=a[r];if(void 0!==o)if((0,Ye.default)(o))for(;o=a[r],void 0!==o&&(t.push(a.time),n.push.apply(n,o)),a=e[i++],void 0!==a;);else if(void 0!==o.toArray)for(;o=a[r],void 0!==o&&(t.push(a.time),o.toArray(n,n.length)),a=e[i++],void 0!==a;);else for(;o=a[r],void 0!==o&&(t.push(a.time),n.push(o)),a=e[i++],void 0!==a;);}},subclip:function(e,t,n,r,i){i=i||30;var a=e.clone();a.name=t;for(var o=[],s=0;s<a.tracks.length;++s){for(var l=a.tracks[s],u=l.getValueSize(),h=[],c=[],d=0;d<l.times.length;++d){var f=l.times[d]*i;if(!(f<n||r<=f)){h.push(l.times[d]);for(var p=0;p<u;++p)c.push((0,g.default)(l)[d*u+p])}}0!==h.length&&(l.times=Gf.convertArray(h,l.times.constructor),l.values=Gf.convertArray(c,(0,g.default)(l).constructor),o.push(l))}a.tracks=o;for(var m=Infinity,s=0;s<a.tracks.length;++s)m>a.tracks[s].times[0]&&(m=a.tracks[s].times[0]);for(s=0;s<a.tracks.length;++s)a.tracks[s].shift(-1*m);return a.resetDuration(),a}};function Vf(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n}function Hf(e,t,n,r){Vf.call(this,e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function jf(e,t,n,r){Vf.call(this,e,t,n,r)}function Wf(e,t,n,r){Vf.call(this,e,t,n,r)}function Yf(e,t,n,r){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Gf.convertArray(t,this.TimeBufferType),this.values=Gf.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}function qf(e,t,n){Yf.call(this,e,t,n)}function Xf(e,t,n,r){Yf.call(this,e,t,n,r)}function Zf(e,t,n,r){Yf.call(this,e,t,n,r)}function Jf(e,t,n,r){Vf.call(this,e,t,n,r)}function Kf(e,t,n,r){Yf.call(this,e,t,n,r)}function Qf(e,t,n,r){Yf.call(this,e,t,n,r)}function $f(e,t,n,r){Yf.call(this,e,t,n,r)}function ep(e,t,n){this.name=e,this.tracks=n,this.duration=void 0!==t?t:-1,this.uuid=Nr.generateUUID(),this.duration<0&&this.resetDuration()}function tp(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Zf;case"vector":case"vector2":case"vector3":case"vector4":return $f;case"color":return Xf;case"quaternion":return Kf;case"bool":case"boolean":return qf;case"string":return Qf}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}function np(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var t,n,r=tp(e.type);return void 0===e.times&&(t=[],n=[],Gf.flattenJSON((0,_.default)(e),t,n,"value"),e.times=t,e.values=n),void 0!==r.parse?r.parse(e):new r(e.name,e.times,(0,g.default)(e),e.interpolation)}t.AnimationUtils=Gf,(0,qe.default)(Vf.prototype,{evaluate:function(e){var t,n=this.parameterPositions,r=this._cachedIndex,i=n[r],a=n[r-1];e:{t:{n:{r:if(!(e<i)){for(var o=r+2;;){if(void 0===i){if(e<a)break r;return r=n.length,this._cachedIndex=r,this.afterEnd_(r-1,e,a)}if(r===o)break;if(a=i,i=n[++r],e<i)break t}t=n.length;break n}if(a<=e)break e;var s=n[1];for(e<s&&(r=2,a=s),o=r-2;;){if(void 0===a)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(r===o)break;if(i=a,a=n[--r-1],a<=e)break t}t=r,r=0}for(;r<t;){var l=r+t>>>1;e<n[l]?t=l:r=l+1}if(i=n[r],a=n[r-1],void 0===a)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(void 0===i)return r=n.length,this._cachedIndex=r,this.afterEnd_(r-1,a,e)}this._cachedIndex=r,this.intervalChanged_(r,a,i)}return this.interpolate_(r,a,e,i)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r,a=0;a!==r;++a)t[a]=n[i+a];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),(0,qe.default)(Vf.prototype,{beforeStart_:Vf.prototype.copySampleValue_,afterEnd_:Vf.prototype.copySampleValue_}),Hf.prototype=(0,qe.default)((0,T.default)(Vf.prototype),{constructor:Hf,DefaultSettings_:{endingStart:Bn,endingEnd:Bn},intervalChanged_:function(e,t,n){var r=this.parameterPositions,i=e-2,a=e+1,o=r[i],s=r[a];if(void 0===o)switch(this.getSettings_().endingStart){case Un:i=e,o=2*t-n;break;case zn:i=r.length-2,o=t+r[i]-r[i+1];break;default:i=e,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case Un:a=e,s=2*n-t;break;case zn:a=1,s=n+r[1]-r[0];break;default:a=e-1,s=t}var l=.5*(n-t),u=this.valueSize;this._weightPrev=l/(t-o),this._weightNext=l/(s-n),this._offsetPrev=i*u,this._offsetNext=a*u},interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,u=this._offsetPrev,h=this._offsetNext,c=this._weightPrev,d=this._weightNext,f=(n-t)/(r-t),p=f*f,m=p*f,v=-c*m+2*c*p-c*f,g=(1+c)*m+(-1.5-2*c)*p+(-.5+c)*f+1,y=(-1-d)*m+(1.5+d)*p+.5*f,_=d*m-d*p,x=0;x!==o;++x)i[x]=v*a[u+x]+g*a[l+x]+y*a[s+x]+_*a[h+x];return i}}),jf.prototype=(0,qe.default)((0,T.default)(Vf.prototype),{constructor:jf,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,u=(n-t)/(r-t),h=1-u,c=0;c!==o;++c)i[c]=a[l+c]*h+a[s+c]*u;return i}}),Wf.prototype=(0,qe.default)((0,T.default)(Vf.prototype),{constructor:Wf,interpolate_:function(e){return this.copySampleValue_(e-1)}}),(0,qe.default)(Yf,{toJSON:function(e){var t,n,r=e.constructor;return void 0!==r.toJSON?t=r.toJSON(e):(t={name:e.name,times:Gf.convertArray(e.times,Array),values:Gf.convertArray((0,g.default)(e),Array)},n=e.getInterpolation(),n!==e.DefaultInterpolation&&(t.interpolation=n)),t.type=e.ValueTypeName,t}}),(0,qe.default)(Yf.prototype,{constructor:Yf,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:On,InterpolantFactoryMethodDiscrete:function(e){return new Wf(this.times,(0,g.default)(this),this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new jf(this.times,(0,g.default)(this),this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new Hf(this.times,(0,g.default)(this),this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case Dn:t=this.InterpolantFactoryMethodDiscrete;break;case On:t=this.InterpolantFactoryMethodLinear;break;case Fn:t=this.InterpolantFactoryMethodSmooth}if(void 0!==t)return this.createInterpolant=t,this;var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Dn;case this.InterpolantFactoryMethodLinear:return On;case this.InterpolantFactoryMethodSmooth:return Fn}},getValueSize:function(){return(0,g.default)(this).length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]*=e;return this},trim:function(e,t){for(var n,r=this.times,i=r.length,a=0,o=i-1;a!==i&&r[a]<e;)++a;for(;-1!==o&&r[o]>t;)--o;return++o,0===a&&o===i||(o<=a&&(o=Math.max(o,1),a=o-1),n=this.getValueSize(),this.times=Gf.arraySlice(r,a,o),this.values=Gf.arraySlice((0,g.default)(this),a*n,o*n)),this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,r=(0,g.default)(this),i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var a=null,o=0;o!==i;o++){var s=n[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),e=!1;break}if(null!==a&&s<a){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),e=!1;break}a=s}if(void 0!==r&&Gf.isTypedArray(r))for(var o=0,l=r.length;o!==l;++o){var u=r[o];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,u),e=!1;break}}return e},optimize:function(){for(var e=Gf.arraySlice(this.times),t=Gf.arraySlice((0,g.default)(this)),n=this.getValueSize(),r=this.getInterpolation()===Fn,i=1,a=e.length-1,o=1;o<a;++o){var s=!1,l=e[o],u=e[o+1];if(l!==u&&(1!==o||l!==l[0]))if(r)s=!0;else for(var h=o*n,c=h-n,d=h+n,f=0;f!==n;++f){var p=t[h+f];if(p!==t[c+f]||p!==t[d+f]){s=!0;break}}if(s){if(o!==i){e[i]=e[o];for(var m=o*n,v=i*n,f=0;f!==n;++f)t[v+f]=t[m+f]}++i}}if(0<a){for(e[i]=e[a],m=a*n,v=i*n,f=0;f!==n;++f)t[v+f]=t[m+f];++i}return i!==e.length?(this.times=Gf.arraySlice(e,0,i),this.values=Gf.arraySlice(t,0,i*n)):(this.times=e,this.values=t),this},clone:function(){var e=Gf.arraySlice(this.times,0),t=Gf.arraySlice((0,g.default)(this),0),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}),qf.prototype=(0,qe.default)((0,T.default)(Yf.prototype),{constructor:qf,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Dn,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Xf.prototype=(0,qe.default)((0,T.default)(Yf.prototype),{constructor:Xf,ValueTypeName:"color"}),Zf.prototype=(0,qe.default)((0,T.default)(Yf.prototype),{constructor:Zf,ValueTypeName:"number"}),Jf.prototype=(0,qe.default)((0,T.default)(Vf.prototype),{constructor:Jf,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=(n-t)/(r-t),u=s+o;s!==u;s+=4)zr.slerpFlat(i,0,a,s-o,a,s,l);return i}}),Kf.prototype=(0,qe.default)((0,T.default)(Yf.prototype),{constructor:Kf,ValueTypeName:"quaternion",DefaultInterpolation:On,InterpolantFactoryMethodLinear:function(e){return new Jf(this.times,(0,g.default)(this),this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),Qf.prototype=(0,qe.default)((0,T.default)(Yf.prototype),{constructor:Qf,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Dn,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),$f.prototype=(0,qe.default)((0,T.default)(Yf.prototype),{constructor:$f,ValueTypeName:"vector"}),(0,qe.default)(ep,{parse:function(e){for(var t=[],n=e.tracks,r=1/(e.fps||1),i=0,a=n.length;i!==a;++i)t.push(np(n[i]).scale(r));return new ep(e.name,e.duration,t)},toJSON:function(e){for(var t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid},i=0,a=n.length;i!==a;++i)t.push(Yf.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){for(var i=t.length,a=[],o=0;o<i;o++){var s=[],l=[];s.push((o+i-1)%i,o,(o+1)%i),l.push(0,1,0);var u=Gf.getKeyframeOrder(s),s=Gf.sortedArray(s,1,u),l=Gf.sortedArray(l,1,u);r||0!==s[0]||(s.push(i),l.push(l[0])),a.push(new Zf(".morphTargetInfluences["+t[o].name+"]",s,l).scale(1/n))}return new ep(e,-1,a)},findByName:function(e,t){var n,r=e;(0,Ye.default)(e)||(n=e,r=n.geometry&&n.geometry.animations||n.animations);for(var i=0;i<r.length;i++)if(r[i].name===t)return r[i];return null},CreateClipsFromMorphTargetSequences:function(e,t,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,a=0,o=e.length;a<o;a++){var s,l=e[a],u=l.name.match(i);u&&1<u.length&&(h=u[1],s=r[h],s||(r[h]=s=[]),s.push(l))}var h,c=[];for(h in r)c.push(ep.CreateFromMorphTargetSequence(h,r[h],t,n));return c},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,r,i){var a,o;0!==n.length&&(a=[],o=[],Gf.flattenJSON(n,a,o,r),0!==a.length&&i.push(new e(t,a,o)))},r=[],i=e.name||"default",a=e.length||-1,o=e.fps||30,s=e.hierarchy||[],l=0;l<s.length;l++){var u=(0,_.default)(s[l]);if(u&&0!==u.length)if(u[0].morphTargets){for(var h,c={},d=0;d<u.length;d++)if(u[d].morphTargets)for(var f=0;f<u[d].morphTargets.length;f++)c[u[d].morphTargets[f]]=-1;for(h in c){for(var p=[],m=[],f=0;f!==u[d].morphTargets.length;++f){var v=u[d];p.push(v.time),m.push(v.morphTarget===h?1:0)}r.push(new Zf(".morphTargetInfluence["+h+"]",p,m))}a=c.length*(o||1)}else{var g=".bones["+t[l].name+"]";n($f,g+".position",u,"pos",r),n(Kf,g+".quaternion",u,"rot",r),n($f,g+".scale",u,"scl",r)}}if(0===r.length)return null;var y=new ep(i,a,r);return y}}),(0,qe.default)(ep.prototype,{resetDuration:function(){for(var e=this.tracks,t=0,n=0,r=e.length;n!==r;++n)var i=this.tracks[n],t=Math.max(t,i.times[i.times.length-1]);return this.duration=t,this},trim:function(){for(var e,t=0;t<this.tracks.length;t++)(0,z.default)(e=this.tracks[t]).call(e,0,this.duration);return this},validate:function(){for(var e=!0,t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this},clone:function(){for(var e=[],t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new ep(this.name,this.duration,e)}});var rp={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function ip(e,t,n){var r=this,i=!1,a=0,o=0,s=void 0,l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===i&&void 0!==r.onStart&&r.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,void 0!==r.onProgress&&r.onProgress(e,a,o),a===o&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){var t=(0,ve.default)(l).call(l,e);return-1!==t&&(0,L.default)(l).call(l,t,2),this},this.getHandler=function(e){for(var t=0,n=l.length;t<n;t+=2){var r=l[t],i=l[t+1];if(r.global&&(r.lastIndex=0),r.test(e))return i}return null}}t.Cache=rp;var ap=new ip;function op(e){this.manager=void 0!==e?e:ap,this.crossOrigin="anonymous",this.path="",this.resourcePath=""}t.DefaultLoadingManager=ap,(0,qe.default)(op.prototype,{load:function(){},parse:function(){},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this},setResourcePath:function(e){return this.resourcePath=e,this}});var sp={};function lp(e){op.call(this,e)}function up(e){op.call(this,e)}function hp(e){op.call(this,e)}function cp(e){op.call(this,e)}function dp(e){op.call(this,e)}function fp(e){op.call(this,e)}function pp(e){op.call(this,e)}function mp(){this.type="Curve",this.arcLengthDivisions=200}function vp(e,t,n,r,i,a,o,s){mp.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=n||1,this.yRadius=r||1,this.aStartAngle=i||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function gp(e,t,n,r,i,a){vp.call(this,e,t,n,n,r,i,a),this.type="ArcCurve"}function yp(){var i=0,a=0,o=0,s=0;function u(e,t,n,r){i=e,a=n,o=-3*e+3*t-2*n-r,s=2*e-2*t+n+r}return{initCatmullRom:function(e,t,n,r,i){u(t,n,i*(n-e),i*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,i,a,o){var s=(t-e)/i-(n-e)/(i+a)+(n-t)/a,l=(n-t)/a-(r-t)/(a+o)+(r-n)/o;s*=a,l*=a,u(t,n,s,l)},calc:function(e){var t=e*e,n=t*e;return i+a*e+o*t+s*n}}}lp.prototype=(0,qe.default)((0,T.default)(op.prototype),{constructor:lp,load:function(o,e,t,n){void 0===o&&(o=""),void 0!==this.path&&(o=this.path+o),o=this.manager.resolveURL(o);var s=this,r=rp.get(o);if(void 0!==r)return s.manager.itemStart(o),(0,y.default)(function(){e&&e(r),s.manager.itemEnd(o)},0),r;if(void 0===sp[o]){var i=/^data:(.*?)(;base64)?,(.*)$/,a=o.match(i);if(a){var l=a[1],u=!!a[2],h=a[3],h=decodeURIComponent(h);u&&(h=atob(h));try{var c=(this.responseType||"").toLowerCase();switch(c){case"arraybuffer":case"blob":for(var d=new Uint8Array(h.length),f=0;f<h.length;f++)d[f]=h.charCodeAt(f);m="blob"===c?new Blob([d.buffer],{type:l}):d.buffer;break;case"document":var p=new DOMParser,m=p.parseFromString(h,l);break;case"json":m=JSON.parse(h);break;default:m=h}(0,y.default)(function(){e&&e(m),s.manager.itemEnd(o)},0)}catch(e){(0,y.default)(function(){n&&n(e),s.manager.itemError(o),s.manager.itemEnd(o)},0)}}else{sp[o]=[],sp[o].push({onLoad:e,onProgress:t,onError:n});var v,g=new XMLHttpRequest;for(v in g.open("GET",o,!0),g.addEventListener("load",function(e){var t=this.response,n=sp[o];if(delete sp[o],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),rp.add(o,t);for(var r=0,i=n.length;r<i;r++){var a=n[r];a.onLoad&&a.onLoad(t)}s.manager.itemEnd(o)}else{for(r=0,i=n.length;r<i;r++)a=n[r],a.onError&&a.onError(e);s.manager.itemError(o),s.manager.itemEnd(o)}},!1),g.addEventListener("progress",function(e){for(var t=sp[o],n=0,r=t.length;n<r;n++){var i=t[n];i.onProgress&&i.onProgress(e)}},!1),g.addEventListener("error",function(e){var t=sp[o];delete sp[o];for(var n=0,r=t.length;n<r;n++){var i=t[n];i.onError&&i.onError(e)}s.manager.itemError(o),s.manager.itemEnd(o)},!1),g.addEventListener("abort",function(e){var t=sp[o];delete sp[o];for(var n=0,r=t.length;n<r;n++){var i=t[n];i.onError&&i.onError(e)}s.manager.itemError(o),s.manager.itemEnd(o)},!1),void 0!==this.responseType&&(g.responseType=this.responseType),void 0!==this.withCredentials&&(g.withCredentials=this.withCredentials),g.overrideMimeType&&g.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)g.setRequestHeader(v,this.requestHeader[v]);g.send(null)}return s.manager.itemStart(o),g}sp[o].push({onLoad:e,onProgress:t,onError:n})},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}}),up.prototype=(0,qe.default)((0,T.default)(op.prototype),{constructor:up,load:function(e,t,n,r){var i=this,a=new lp(i.manager);a.setPath(i.path),a.load(e,function(e){t(i.parse(JSON.parse(e)))},n,r)},parse:function(e){for(var t=[],n=0;n<e.length;n++){var r=ep.parse(e[n]);t.push(r)}return t}}),hp.prototype=(0,qe.default)((0,T.default)(op.prototype),{constructor:hp,load:function(e,a,t,r){var o=this,s=[],l=new od;l.image=s;var i=new lp(this.manager);function n(n){i.load(e[n],function(e){var t=o.parse(e,!0);s[n]={width:t.width,height:t.height,format:t.format,mipmaps:t.mipmaps},u+=1,6===u&&(1===t.mipmapCount&&(l.minFilter=pt),l.format=t.format,l.needsUpdate=!0,a&&a(l))},t,r)}if(i.setPath(this.path),i.setResponseType("arraybuffer"),(0,Ye.default)(e))for(var u=0,h=0,c=e.length;h<c;++h)n(h);else i.load(e,function(e){var t=o.parse(e,!0);if(t.isCubemap)for(var n=t.mipmaps.length/t.mipmapCount,r=0;r<n;r++){s[r]={mipmaps:[]};for(var i=0;i<t.mipmapCount;i++)s[r].mipmaps.push(t.mipmaps[r*t.mipmapCount+i]),s[r].format=t.format,s[r].width=t.width,s[r].height=t.height}else l.image.width=t.width,l.image.height=t.height,l.mipmaps=t.mipmaps;1===t.mipmapCount&&(l.minFilter=pt),l.format=t.format,l.needsUpdate=!0,a&&a(l)},t,r);return l}}),cp.prototype=(0,qe.default)((0,T.default)(op.prototype),{constructor:cp,load:function(e,n,t,r){var i=this,a=new wo,o=new lp(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(e,function(e){var t=i.parse(e);t&&(void 0!==t.image?a.image=t.image:void 0!==t.data&&(a.image.width=t.width,a.image.height=t.height,a.image.data=t.data),a.wrapS=void 0!==t.wrapS?t.wrapS:st,a.wrapT=void 0!==t.wrapT?t.wrapT:st,a.magFilter=void 0!==t.magFilter?t.magFilter:pt,a.minFilter=void 0!==t.minFilter?t.minFilter:pt,a.anisotropy=void 0!==t.anisotropy?t.anisotropy:1,void 0!==t.format&&(a.format=t.format),void 0!==t.type&&(a.type=t.type),void 0!==t.mipmaps&&(a.mipmaps=t.mipmaps,a.minFilter=gt),1===t.mipmapCount&&(a.minFilter=pt),a.needsUpdate=!0,n&&n(a,t))},t,r),a}}),dp.prototype=(0,qe.default)((0,T.default)(op.prototype),{constructor:dp,load:function(t,e,n,r){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,a=rp.get(t);if(void 0!==a)return i.manager.itemStart(t),(0,y.default)(function(){e&&e(a),i.manager.itemEnd(t)},0),a;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1),rp.add(t,this),e&&e(this),i.manager.itemEnd(t)}function l(e){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1),r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)}return o.addEventListener("load",s,!1),o.addEventListener("error",l,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(t),o.src=t,o}}),fp.prototype=(0,qe.default)((0,T.default)(op.prototype),{constructor:fp,load:function(e,n,t,r){var i=new lu,a=new dp(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(t){a.load(e[t],function(e){i.images[t]=e,o++,6===o&&(i.needsUpdate=!0,n&&n(i))},void 0,r)}for(var l=0;l<e.length;++l)s(l);return i}}),pp.prototype=(0,qe.default)((0,T.default)(op.prototype),{constructor:pp,load:function(n,r,e,t){var i=new Or,a=new dp(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(n,function(e){i.image=e;var t=0<n.search(/\.jpe?g($|\?)/i)||0===n.search(/^data\:image\/jpeg/);i.format=t?kt:Pt,i.needsUpdate=!0,void 0!==r&&r(i)},e,t),i}}),(0,qe.default)(mp.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n,r=[],i=this.getPoint(0),a=0;for(r.push(0),n=1;n<=e;n++)t=this.getPoint(n/e),a+=t.distanceTo(i),r.push(a),i=t;return this.cacheArcLengths=r,r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){for(var n,r=this.getLengths(),i=0,a=r.length,o=t||e*r[a-1],s=0,l=a-1;s<=l;)if(i=Math.floor(s+(l-s)/2),n=r[i]-o,n<0)s=i+1;else{if(!(0<n)){l=i;break}l=i-1}if(i=l,r[i]===o)return i/(a-1);var u=r[i],h=r[i+1],c=h-u,d=(o-u)/c,f=(i+d)/(a-1);return f},getTangent:function(e){var t=1e-4,n=e-t,r=e+t;n<0&&(n=0),1<r&&(r=1);var i=this.getPoint(n),a=this.getPoint(r),o=a.clone().sub(i);return o.normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){for(var n,r,i=new Hr,a=[],o=[],s=[],l=new Hr,u=new Kr,h=0;h<=e;h++)n=h/e,a[h]=this.getTangentAt(n),a[h].normalize();o[0]=new Hr,s[0]=new Hr;var c=Number.MAX_VALUE,d=Math.abs(a[0].x),f=Math.abs(a[0].y),p=Math.abs(a[0].z);for(d<=c&&(c=d,i.set(1,0,0)),f<=c&&(c=f,i.set(0,1,0)),p<=c&&i.set(0,0,1),l.crossVectors(a[0],i).normalize(),o[0].crossVectors(a[0],l),s[0].crossVectors(a[0],o[0]),h=1;h<=e;h++)o[h]=o[h-1].clone(),s[h]=s[h-1].clone(),l.crossVectors(a[h-1],a[h]),l.length()>se.default&&(l.normalize(),r=Math.acos(Nr.clamp(a[h-1].dot(a[h]),-1,1)),o[h].applyMatrix4(u.makeRotationAxis(l,r))),s[h].crossVectors(a[h],o[h]);if(!0===t)for(r=Math.acos(Nr.clamp(o[0].dot(o[e]),-1,1)),r/=e,0<a[0].dot(l.crossVectors(o[0],o[e]))&&(r=-r),h=1;h<=e;h++)o[h].applyMatrix4(u.makeRotationAxis(a[h],r*h)),s[h].crossVectors(a[h],o[h]);return{tangents:a,normals:o,binormals:s}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),vp.prototype=(0,T.default)(mp.prototype),vp.prototype.constructor=vp,vp.prototype.isEllipseCurve=!0,vp.prototype.getPoint=function(e,t){for(var n=t||new kr,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<se.default;i<0;)i+=r;for(;r<i;)i-=r;i<se.default&&(i=a?0:r),!0!==this.aClockwise||a||(i===r?i=-r:i-=r);var o,s,l,u,h=this.aStartAngle+e*i,c=this.aX+this.xRadius*Math.cos(h),d=this.aY+this.yRadius*Math.sin(h);return 0!==this.aRotation&&(o=Math.cos(this.aRotation),s=Math.sin(this.aRotation),l=c-this.aX,u=d-this.aY,c=l*o-u*s+this.aX,d=l*s+u*o+this.aY),n.set(c,d)},vp.prototype.copy=function(e){return mp.prototype.copy.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},vp.prototype.toJSON=function(){var e=mp.prototype.toJSON.call(this);return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e},vp.prototype.fromJSON=function(e){return mp.prototype.fromJSON.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},gp.prototype=(0,T.default)(vp.prototype),gp.prototype.constructor=gp,gp.prototype.isArcCurve=!0;var _p=new Hr,xp=new yp,wp=new yp,bp=new yp;function Mp(e,t,n,r){mp.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=r||.5}function Tp(e,t,n,r,i){var a=.5*(r-t),o=.5*(i-n),s=e*e,l=e*s;return(2*n-2*r+a+o)*l+(-3*n+3*r-2*a-o)*s+a*e+n}function Sp(e,t){var n=1-e;return n*n*t}function Ep(e,t){return 2*(1-e)*e*t}function Ap(e,t){return e*e*t}function Ip(e,t,n,r){return Sp(e,t)+Ep(e,n)+Ap(e,r)}function Lp(e,t){var n=1-e;return n*n*n*t}function Rp(e,t){var n=1-e;return 3*n*n*e*t}function Np(e,t){return 3*(1-e)*e*e*t}function kp(e,t){return e*e*e*t}function Pp(e,t,n,r,i){return Lp(e,t)+Rp(e,n)+Np(e,r)+kp(e,i)}function Cp(e,t,n,r){mp.call(this),this.type="CubicBezierCurve",this.v0=e||new kr,this.v1=t||new kr,this.v2=n||new kr,this.v3=r||new kr}function Dp(e,t,n,r){mp.call(this),this.type="CubicBezierCurve3",this.v0=e||new Hr,this.v1=t||new Hr,this.v2=n||new Hr,this.v3=r||new Hr}function Op(e,t){mp.call(this),this.type="LineCurve",this.v1=e||new kr,this.v2=t||new kr}function Fp(e,t){mp.call(this),this.type="LineCurve3",this.v1=e||new Hr,this.v2=t||new Hr}function Bp(e,t,n){mp.call(this),this.type="QuadraticBezierCurve",this.v0=e||new kr,this.v1=t||new kr,this.v2=n||new kr}function Up(e,t,n){mp.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new Hr,this.v1=t||new Hr,this.v2=n||new Hr}function zp(e){mp.call(this),this.type="SplineCurve",this.points=e||[]}Mp.prototype=(0,T.default)(mp.prototype),Mp.prototype.constructor=Mp,Mp.prototype.isCatmullRomCurve3=!0,Mp.prototype.getPoint=function(e,t){var n,r,i,a,o,s,l,u,h=t||new Hr,c=this.points,d=c.length,f=(d-(this.closed?0:1))*e,p=Math.floor(f),m=f-p;return this.closed?p+=0<p?0:(Math.floor(Math.abs(p)/d)+1)*d:0===m&&p===d-1&&(p=d-2,m=1),n=this.closed||0<p?c[(p-1)%d]:(_p.subVectors(c[0],c[1]).add(c[0]),_p),r=c[p%d],i=c[(p+1)%d],a=this.closed||p+2<d?c[(p+2)%d]:(_p.subVectors(c[d-1],c[d-2]).add(c[d-1]),_p),"centripetal"===this.curveType||"chordal"===this.curveType?(o="chordal"===this.curveType?.5:.25,s=Math.pow(n.distanceToSquared(r),o),l=Math.pow(r.distanceToSquared(i),o),u=Math.pow(i.distanceToSquared(a),o),l<1e-4&&(l=1),s<1e-4&&(s=l),u<1e-4&&(u=l),xp.initNonuniformCatmullRom(n.x,r.x,i.x,a.x,s,l,u),wp.initNonuniformCatmullRom(n.y,r.y,i.y,a.y,s,l,u),bp.initNonuniformCatmullRom(n.z,r.z,i.z,a.z,s,l,u)):"catmullrom"===this.curveType&&(xp.initCatmullRom(n.x,r.x,i.x,a.x,this.tension),wp.initCatmullRom(n.y,r.y,i.y,a.y,this.tension),bp.initCatmullRom(n.z,r.z,i.z,a.z,this.tension)),h.set(xp.calc(m),wp.calc(m),bp.calc(m)),h},Mp.prototype.copy=function(e){mp.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},Mp.prototype.toJSON=function(){var e=mp.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},Mp.prototype.fromJSON=function(e){mp.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new Hr).fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},Cp.prototype=(0,T.default)(mp.prototype),Cp.prototype.constructor=Cp,Cp.prototype.isCubicBezierCurve=!0,Cp.prototype.getPoint=function(e,t){var n=t||new kr,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(Pp(e,r.x,i.x,a.x,o.x),Pp(e,r.y,i.y,a.y,o.y)),n},Cp.prototype.copy=function(e){return mp.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},Cp.prototype.toJSON=function(){var e=mp.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},Cp.prototype.fromJSON=function(e){return mp.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},Dp.prototype=(0,T.default)(mp.prototype),Dp.prototype.constructor=Dp,Dp.prototype.isCubicBezierCurve3=!0,Dp.prototype.getPoint=function(e,t){var n=t||new Hr,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(Pp(e,r.x,i.x,a.x,o.x),Pp(e,r.y,i.y,a.y,o.y),Pp(e,r.z,i.z,a.z,o.z)),n},Dp.prototype.copy=function(e){return mp.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},Dp.prototype.toJSON=function(){var e=mp.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},Dp.prototype.fromJSON=function(e){return mp.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},Op.prototype=(0,T.default)(mp.prototype),Op.prototype.constructor=Op,Op.prototype.isLineCurve=!0,Op.prototype.getPoint=function(e,t){var n=t||new kr;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Op.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Op.prototype.getTangent=function(){var e=this.v2.clone().sub(this.v1);return e.normalize()},Op.prototype.copy=function(e){return mp.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Op.prototype.toJSON=function(){var e=mp.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Op.prototype.fromJSON=function(e){return mp.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Fp.prototype=(0,T.default)(mp.prototype),Fp.prototype.constructor=Fp,Fp.prototype.isLineCurve3=!0,Fp.prototype.getPoint=function(e,t){var n=t||new Hr;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Fp.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Fp.prototype.copy=function(e){return mp.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Fp.prototype.toJSON=function(){var e=mp.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Fp.prototype.fromJSON=function(e){return mp.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Bp.prototype=(0,T.default)(mp.prototype),Bp.prototype.constructor=Bp,Bp.prototype.isQuadraticBezierCurve=!0,Bp.prototype.getPoint=function(e,t){var n=t||new kr,r=this.v0,i=this.v1,a=this.v2;return n.set(Ip(e,r.x,i.x,a.x),Ip(e,r.y,i.y,a.y)),n},Bp.prototype.copy=function(e){return mp.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Bp.prototype.toJSON=function(){var e=mp.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Bp.prototype.fromJSON=function(e){return mp.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Up.prototype=(0,T.default)(mp.prototype),Up.prototype.constructor=Up,Up.prototype.isQuadraticBezierCurve3=!0,Up.prototype.getPoint=function(e,t){var n=t||new Hr,r=this.v0,i=this.v1,a=this.v2;return n.set(Ip(e,r.x,i.x,a.x),Ip(e,r.y,i.y,a.y),Ip(e,r.z,i.z,a.z)),n},Up.prototype.copy=function(e){return mp.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Up.prototype.toJSON=function(){var e=mp.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Up.prototype.fromJSON=function(e){return mp.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},zp.prototype=(0,T.default)(mp.prototype),zp.prototype.constructor=zp,zp.prototype.isSplineCurve=!0,zp.prototype.getPoint=function(e,t){var n=t||new kr,r=this.points,i=(r.length-1)*e,a=Math.floor(i),o=i-a,s=r[0===a?a:a-1],l=r[a],u=r[a>r.length-2?r.length-1:a+1],h=r[a>r.length-3?r.length-1:a+2];return n.set(Tp(o,s.x,l.x,u.x,h.x),Tp(o,s.y,l.y,u.y,h.y)),n},zp.prototype.copy=function(e){mp.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this},zp.prototype.toJSON=function(){var e=mp.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e},zp.prototype.fromJSON=function(e){mp.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new kr).fromArray(r))}return this};var Gp=(0,l.default)({__proto__:null,ArcCurve:gp,CatmullRomCurve3:Mp,CubicBezierCurve:Cp,CubicBezierCurve3:Dp,EllipseCurve:vp,LineCurve:Op,LineCurve3:Fp,QuadraticBezierCurve:Bp,QuadraticBezierCurve3:Up,SplineCurve:zp});function Vp(){mp.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Hp(e){Vp.call(this),this.type="Path",this.currentPoint=new kr,e&&this.setFromPoints(e)}function jp(e){Hp.call(this,e),this.uuid=Nr.generateUUID(),this.type="Shape",this.holes=[]}function Wp(e,t){mi.call(this),this.type="Light",this.color=new oa(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function Yp(e,t,n){Wp.call(this,e,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(mi.DefaultUp),this.updateMatrix(),this.groundColor=new oa(t)}function qp(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new kr(512,512),this.map=null,this.mapPass=null,this.matrix=new Kr,this._frustum=new To,this._frameExtents=new kr(1,1),this._viewportCount=1,this._viewports=[new Fr(0,0,1,1)]}function Xp(){qp.call(this,new vo(50,1,.5,500))}function Zp(e,t,n,r,i,a){Wp.call(this,e,t),this.type="SpotLight",this.position.copy(mi.DefaultUp),this.updateMatrix(),this.target=new mi,(0,R.default)(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==a?a:1,this.shadow=new Xp}function Jp(){qp.call(this,new vo(90,1,.5,500)),this._frameExtents=new kr(4,2),this._viewportCount=6,this._viewports=[new Fr(2,1,1,1),new Fr(0,1,1,1),new Fr(3,1,1,1),new Fr(1,1,1,1),new Fr(3,0,1,1),new Fr(1,0,1,1)],this._cubeDirections=[new Hr(1,0,0),new Hr(-1,0,0),new Hr(0,0,1),new Hr(0,0,-1),new Hr(0,1,0),new Hr(0,-1,0)],this._cubeUps=[new Hr(0,1,0),new Hr(0,1,0),new Hr(0,1,0),new Hr(0,1,0),new Hr(0,0,1),new Hr(0,0,-1)]}function Kp(e,t,n,r){Wp.call(this,e,t),this.type="PointLight",(0,R.default)(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new Jp}function Qp(e,t,n,r,i,a){mo.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==e?e:-1,this.right=void 0!==t?t:1,this.top=void 0!==n?n:1,this.bottom=void 0!==r?r:-1,this.near=void 0!==i?i:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function $p(){qp.call(this,new Qp(-5,5,5,-5,.5,500))}function em(e,t){Wp.call(this,e,t),this.type="DirectionalLight",this.position.copy(mi.DefaultUp),this.updateMatrix(),this.target=new mi,this.shadow=new $p}function tm(e,t){Wp.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function nm(e,t,n,r){Wp.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}function rm(e){op.call(this,e),this.textures={}}Vp.prototype=(0,qe.default)((0,T.default)(mp.prototype),{constructor:Vp,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Op(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=t){var i=n[r]-t,a=this.curves[r],o=a.getLength(),s=0===o?0:1-i/o;return a.getPointAt(s)}r++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e},getSpacedPoints:function(e){void 0===e&&(e=40);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,n=[],r=0,i=this.curves;r<i.length;r++)for(var a=i[r],o=a&&a.isEllipseCurve?2*e:a&&(a.isLineCurve||a.isLineCurve3)?1:a&&a.isSplineCurve?e*a.points.length:e,s=a.getPoints(o),l=0;l<s.length;l++){var u=s[l];t&&t.equals(u)||(n.push(u),t=u)}return this.autoClose&&1<n.length&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){mp.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=mp.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var r=this.curves[t];e.curves.push(r.toJSON())}return e},fromJSON:function(e){mp.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push((new Gp[r.type]).fromJSON(r))}return this}}),Hp.prototype=(0,qe.default)((0,T.default)(Vp.prototype),{constructor:Hp,setFromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this},moveTo:function(e,t){return this.currentPoint.set(e,t),this},lineTo:function(e,t){var n=new Op(this.currentPoint.clone(),new kr(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this},quadraticCurveTo:function(e,t,n,r){var i=new Bp(this.currentPoint.clone(),new kr(e,t),new kr(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this},bezierCurveTo:function(e,t,n,r,i,a){var o=new Cp(this.currentPoint.clone(),new kr(e,t),new kr(n,r),new kr(i,a));return this.curves.push(o),this.currentPoint.set(i,a),this},splineThru:function(e){var t,n=(0,ie.default)(t=[this.currentPoint.clone()]).call(t,e),r=new zp(n);return this.curves.push(r),this.currentPoint.copy(e[e.length-1]),this},arc:function(e,t,n,r,i,a){var o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(e+o,t+s,n,r,i,a),this},absarc:function(e,t,n,r,i,a){return this.absellipse(e,t,n,n,r,i,a),this},ellipse:function(e,t,n,r,i,a,o,s){var l=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(e+l,t+u,n,r,i,a,o,s),this},absellipse:function(e,t,n,r,i,a,o,s){var l,u=new vp(e,t,n,r,i,a,o,s);0<this.curves.length&&(l=u.getPoint(0),l.equals(this.currentPoint)||this.lineTo(l.x,l.y)),this.curves.push(u);var h=u.getPoint(1);return this.currentPoint.copy(h),this},copy:function(e){return Vp.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=Vp.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return Vp.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),jp.prototype=(0,qe.default)((0,T.default)(Hp.prototype),{constructor:jp,getPointsHoles:function(e){for(var t=[],n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t},extractPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},copy:function(e){Hp.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push(r.clone())}return this},toJSON:function(){var e=Hp.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var r=this.holes[t];e.holes.push(r.toJSON())}return e},fromJSON:function(e){Hp.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push((new Hp).fromJSON(r))}return this}}),Wp.prototype=(0,qe.default)((0,T.default)(mi.prototype),{constructor:Wp,isLight:!0,copy:function(e){return mi.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=mi.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}),Yp.prototype=(0,qe.default)((0,T.default)(Wp.prototype),{constructor:Yp,isHemisphereLight:!0,copy:function(e){return Wp.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),(0,qe.default)(qp.prototype,{_projScreenMatrix:new Kr,_lightPositionWorld:new Hr,_lookTarget:new Hr,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(e){var t=this.camera,n=this.matrix,r=this._projScreenMatrix,i=this._lookTarget,a=this._lightPositionWorld;a.setFromMatrixPosition(e.matrixWorld),t.position.copy(a),i.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(i),t.updateMatrixWorld(),r.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(r),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)},getViewport:function(e){return this._viewports[e]},getFrameExtents:function(){return this._frameExtents},copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}),Xp.prototype=(0,qe.default)((0,T.default)(qp.prototype),{constructor:Xp,isSpotLightShadow:!0,updateMatrices:function(e){var t=this.camera,n=2*Nr.RAD2DEG*e.angle,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;n===t.fov&&r===t.aspect&&i===t.far||(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),qp.prototype.updateMatrices.call(this,e)}}),Zp.prototype=(0,qe.default)((0,T.default)(Wp.prototype),{constructor:Zp,isSpotLight:!0,copy:function(e){return Wp.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Jp.prototype=(0,qe.default)((0,T.default)(qp.prototype),{constructor:Jp,isPointLightShadow:!0,updateMatrices:function(e,t){void 0===t&&(t=0);var n=this.camera,r=this.matrix,i=this._lightPositionWorld,a=this._lookTarget,o=this._projScreenMatrix;i.setFromMatrixPosition(e.matrixWorld),n.position.copy(i),a.copy(n.position),a.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(a),n.updateMatrixWorld(),r.makeTranslation(-i.x,-i.y,-i.z),o.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(o)}}),Kp.prototype=(0,qe.default)((0,T.default)(Wp.prototype),{constructor:Kp,isPointLight:!0,copy:function(e){return Wp.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),Qp.prototype=(0,qe.default)((0,T.default)(mo.prototype),{constructor:Qp,isOrthographicCamera:!0,copy:function(e,t){return mo.prototype.copy.call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:(0,qe.default)({},e.view),this},setViewOffset:function(e,t,n,r,i,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e,t,n=(this.right-this.left)/(2*this.zoom),r=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,a=(this.top+this.bottom)/2,o=i-n,s=i+n,l=a+r,u=a-r;null!==this.view&&this.view.enabled&&(e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom,o+=e*this.view.offsetX,s=o+e*this.view.width,l-=t*this.view.offsetY,u=l-t*this.view.height),this.projectionMatrix.makeOrthographic(o,s,l,u,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=mi.prototype.toJSON.call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=(0,qe.default)({},this.view)),t}}),$p.prototype=(0,qe.default)((0,T.default)(qp.prototype),{constructor:$p,isDirectionalLightShadow:!0,updateMatrices:function(e){qp.prototype.updateMatrices.call(this,e)}}),em.prototype=(0,qe.default)((0,T.default)(Wp.prototype),{constructor:em,isDirectionalLight:!0,copy:function(e){return Wp.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),tm.prototype=(0,qe.default)((0,T.default)(Wp.prototype),{constructor:tm,isAmbientLight:!0}),nm.prototype=(0,qe.default)((0,T.default)(Wp.prototype),{constructor:nm,isRectAreaLight:!0,copy:function(e){return Wp.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=Wp.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}),rm.prototype=(0,qe.default)((0,T.default)(op.prototype),{constructor:rm,load:function(e,t,n,r){var i=this,a=new lp(i.manager);a.setPath(i.path),a.load(e,function(e){t(i.parse(JSON.parse(e)))},n,r)},parse:function(e){var t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}var r,i=new zf[e.type];if(void 0!==e.uuid&&(i.uuid=e.uuid),void 0!==e.name&&(i.name=e.name),void 0!==e.color&&i.color.setHex(e.color),void 0!==e.roughness&&(i.roughness=e.roughness),void 0!==e.metalness&&(i.metalness=e.metalness),void 0!==e.sheen&&(i.sheen=(new oa).setHex(e.sheen)),void 0!==e.emissive&&i.emissive.setHex(e.emissive),void 0!==e.specular&&i.specular.setHex(e.specular),void 0!==e.shininess&&(i.shininess=e.shininess),void 0!==e.clearcoat&&(i.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(i.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.fog&&(i.fog=e.fog),void 0!==e.flatShading&&(i.flatShading=e.flatShading),void 0!==e.blending&&(i.blending=e.blending),void 0!==e.combine&&(i.combine=e.combine),void 0!==e.side&&(i.side=e.side),void 0!==e.opacity&&(i.opacity=e.opacity),void 0!==e.transparent&&(i.transparent=e.transparent),void 0!==e.alphaTest&&(i.alphaTest=e.alphaTest),void 0!==e.depthTest&&(i.depthTest=e.depthTest),void 0!==e.depthWrite&&(i.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(i.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(i.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(i.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(i.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(i.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(i.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(i.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(i.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(i.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(i.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(i.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(i.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(i.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(i.rotation=e.rotation),1!==e.linewidth&&(i.linewidth=e.linewidth),void 0!==e.dashSize&&(i.dashSize=e.dashSize),void 0!==e.gapSize&&(i.gapSize=e.gapSize),void 0!==e.scale&&(i.scale=e.scale),void 0!==e.polygonOffset&&(i.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(i.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(i.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.skinning&&(i.skinning=e.skinning),void 0!==e.morphTargets&&(i.morphTargets=e.morphTargets),void 0!==e.morphNormals&&(i.morphNormals=e.morphNormals),void 0!==e.dithering&&(i.dithering=e.dithering),void 0!==e.vertexTangents&&(i.vertexTangents=e.vertexTangents),void 0!==e.visible&&(i.visible=e.visible),void 0!==e.toneMapped&&(i.toneMapped=e.toneMapped),void 0!==e.userData&&(i.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?i.vertexColors=0<e.vertexColors:i.vertexColors=e.vertexColors),void 0!==e.uniforms)for(var a in e.uniforms){var o=e.uniforms[a];switch(i.uniforms[a]={},o.type){case"t":i.uniforms[a].value=n(o.value);break;case"c":i.uniforms[a].value=(new oa).setHex(o.value);break;case"v2":i.uniforms[a].value=(new kr).fromArray(o.value);break;case"v3":i.uniforms[a].value=(new Hr).fromArray(o.value);break;case"v4":i.uniforms[a].value=(new Fr).fromArray(o.value);break;case"m3":i.uniforms[a].value=(new Pr).fromArray(o.value);case"m4":i.uniforms[a].value=(new Kr).fromArray(o.value);break;default:i.uniforms[a].value=o.value}}if(void 0!==e.defines&&(i.defines=e.defines),void 0!==e.vertexShader&&(i.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(i.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(var s in e.extensions)i.extensions[s]=e.extensions[s];return void 0!==e.shading&&(i.flatShading=1===e.shading),void 0!==e.size&&(i.size=e.size),void 0!==e.sizeAttenuation&&(i.sizeAttenuation=e.sizeAttenuation),void 0!==(0,We.default)(e)&&(i.map=n((0,We.default)(e))),void 0!==e.matcap&&(i.matcap=n(e.matcap)),void 0!==e.alphaMap&&(i.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(i.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(i.bumpScale=e.bumpScale),void 0!==e.normalMap&&(i.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(i.normalMapType=e.normalMapType),void 0!==e.normalScale&&(r=e.normalScale,!1===(0,Ye.default)(r)&&(r=[r,r]),i.normalScale=(new kr).fromArray(r)),void 0!==e.displacementMap&&(i.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(i.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(i.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(i.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(i.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(i.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(i.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(i.specularMap=n(e.specularMap)),void 0!==e.envMap&&(i.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(i.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(i.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(i.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(i.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(i.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(i.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(i.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(i.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(i.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(i.clearcoatNormalScale=(new kr).fromArray(e.clearcoatNormalScale)),i},setTextures:function(e){return this.textures=e,this}});var im={decodeText:function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}},extractUrlBase:function(e){var t=(0,s.default)(e).call(e,"/");return-1===t?"./":e.substr(0,t+1)}};function am(){Ca.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function om(e,t,n,r){"number"==typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),ma.call(this,e,t,n),this.meshPerAttribute=r||1}function sm(e){op.call(this,e)}t.LoaderUtils=im,am.prototype=(0,qe.default)((0,T.default)(Ca.prototype),{constructor:am,isInstancedBufferGeometry:!0,copy:function(e){return Ca.prototype.copy.call(this,e),this.maxInstancedCount=e.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e=Ca.prototype.toJSON.call(this);return e.maxInstancedCount=this.maxInstancedCount,e.isInstancedBufferGeometry=!0,e}}),om.prototype=(0,qe.default)((0,T.default)(ma.prototype),{constructor:om,isInstancedBufferAttribute:!0,copy:function(e){return ma.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},toJSON:function(){var e=ma.prototype.toJSON.call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}),sm.prototype=(0,qe.default)((0,T.default)(op.prototype),{constructor:sm,load:function(e,t,n,r){var i=this,a=new lp(i.manager);a.setPath(i.path),a.load(e,function(e){t(i.parse(JSON.parse(e)))},n,r)},parse:function(e){var t=new(e.isInstancedBufferGeometry?am:Ca),n=e.data.index;void 0!==n&&(a=new lm[n.type](n.array),t.setIndex(new ma(a,1)));var r=e.data.attributes;for(u in r){var i=r[u],a=new lm[i.type](i.array),o=i.isInstancedBufferAttribute?om:ma,s=new o(a,i.itemSize,i.normalized);void 0!==i.name&&(s.name=i.name),t.setAttribute(u,s)}var l=e.data.morphAttributes;if(l)for(var u in l){for(var h=l[u],c=[],d=0,f=h.length;d<f;d++)i=h[d],a=new lm[i.type](i.array),s=new ma(a,i.itemSize,i.normalized),void 0!==i.name&&(s.name=i.name),c.push(s);t.morphAttributes[u]=c}var p=e.data.morphTargetsRelative;p&&(t.morphTargetsRelative=!0);var m=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==m)for(var d=0,v=m.length;d!==v;++d){var g=m[d];t.addGroup(g.start,g.count,g.materialIndex)}var y,_=e.data.boundingSphere;return void 0!==_&&(y=new Hr,void 0!==_.center&&y.fromArray(_.center),t.boundingSphere=new Pi(y,_.radius)),e.name&&(t.name=e.name),e.userData&&(t.userData=e.userData),t}});var lm={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function um(e){op.call(this,e)}um.prototype=(0,qe.default)((0,T.default)(op.prototype),{constructor:um,load:function(r,i,e,a){var o=this,t=""===this.path?im.extractUrlBase(r):this.path;this.resourcePath=this.resourcePath||t;var n=new lp(o.manager);n.setPath(this.path),n.load(r,function(e){var t=null;try{t=JSON.parse(e)}catch(e){return void 0!==a&&a(e),void console.error("THREE:ObjectLoader: Can't parse "+r+".",e.message)}var n=t.metadata;void 0!==n&&void 0!==n.type&&"geometry"!==n.type.toLowerCase()?o.parse(t,i):console.error("THREE.ObjectLoader: Can't load "+r)},e,a)},parse:function(e,t){var n=this.parseShape(e.shapes),r=this.parseGeometries(e.geometries,n),i=this.parseImages(e.images,function(){void 0!==t&&t(s)}),a=this.parseTextures(e.textures,i),o=this.parseMaterials(e.materials,a),s=this.parseObject(e.object,r,o);return e.animations&&(s.animations=this.parseAnimations(e.animations)),void 0!==e.images&&0!==e.images.length||void 0!==t&&t(s),s},parseShape:function(e){var t={};if(void 0!==e)for(var n=0,r=e.length;n<r;n++){var i=(new jp).fromJSON(e[n]);t[i.uuid]=i}return t},parseGeometries:function(e,t){var n={};if(void 0!==e)for(var r=new sm,i=0,a=e.length;i<a;i++){var o,s=e[i];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new Lf[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new Lf[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new Lf[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new Lf[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":o=new Lf[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new Lf[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":o=new Lf[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new Lf[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new Lf[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new Lf[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":o=new Lf[s.type]((new Gp[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":o=new Lf[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new Lf[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var l=[],u=0,h=s.shapes.length;u<h;u++){var c=t[s.shapes[u]];l.push(c)}o=new Lf[s.type](l,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(l=[],u=0,h=s.shapes.length;u<h;u++)c=t[s.shapes[u]],l.push(c);var d=s.options.extrudePath;void 0!==d&&(s.options.extrudePath=(new Gp[d.type]).fromJSON(d)),o=new Lf[s.type](l,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":o=r.parse(s);break;case"Geometry":console.error('THREE.ObjectLoader: Loading "Geometry" is not supported anymore.');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),!0===o.isBufferGeometry&&void 0!==s.userData&&(o.userData=s.userData),n[s.uuid]=o}return n},parseMaterials:function(e,t){var n={},r={};if(void 0!==e){var i=new rm;i.setTextures(t);for(var a=0,o=e.length;a<o;a++){var s=e[a];if("MultiMaterial"===s.type){for(var l=[],u=0;u<s.materials.length;u++){var h=s.materials[u];void 0===n[h.uuid]&&(n[h.uuid]=i.parse(h)),l.push(n[h.uuid])}r[s.uuid]=l}else void 0===n[s.uuid]&&(n[s.uuid]=i.parse(s)),r[s.uuid]=n[s.uuid]}}return r},parseAnimations:function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],i=ep.parse(r);void 0!==r.uuid&&(i.uuid=r.uuid),t.push(i)}return t},parseImages:function(e,t){var n=this,r={};function i(e){return n.manager.itemStart(e),o.load(e,function(){n.manager.itemEnd(e)},void 0,function(){n.manager.itemError(e),n.manager.itemEnd(e)})}if(void 0!==e&&0<e.length){var a=new ip(t),o=new dp(a);o.setCrossOrigin(this.crossOrigin);for(var s=0,l=e.length;s<l;s++){var u=e[s],h=u.url;if((0,Ye.default)(h)){r[u.uuid]=[];for(var c=0,d=h.length;c<d;c++){var f=h[c],p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(f)?f:n.resourcePath+f;r[u.uuid].push(i(p))}}else p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(u.url)?u.url:n.resourcePath+u.url,r[u.uuid]=i(p)}}return r},parseTextures:function(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var r={};if(void 0!==e)for(var i=0,a=e.length;i<a;i++){var o,s=e[i];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image),o=new((0,Ye.default)(t[s.image])?lu:Or)(t[s.image]),o.needsUpdate=!0,o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),void 0!==s.mapping&&(o.mapping=n(s.mapping,cm)),void 0!==s.offset&&o.offset.fromArray(s.offset),void 0!==(0,M.default)(s)&&(0,M.default)(o).fromArray((0,M.default)(s)),void 0!==s.center&&o.center.fromArray(s.center),void 0!==s.rotation&&(o.rotation=s.rotation),void 0!==s.wrap&&(o.wrapS=n(s.wrap[0],dm),o.wrapT=n(s.wrap[1],dm)),void 0!==s.format&&(o.format=s.format),void 0!==s.type&&(o.type=s.type),void 0!==s.encoding&&(o.encoding=s.encoding),void 0!==s.minFilter&&(o.minFilter=n(s.minFilter,fm)),void 0!==s.magFilter&&(o.magFilter=n(s.magFilter,fm)),void 0!==s.anisotropy&&(o.anisotropy=s.anisotropy),void 0!==s.flipY&&(o.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(o.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(o.unpackAlignment=s.unpackAlignment),r[s.uuid]=o}return r},parseObject:function(e,t,a){function n(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function r(e){if(void 0!==e){if((0,Ye.default)(e)){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];void 0===a[i]&&console.warn("THREE.ObjectLoader: Undefined material",i),t.push(a[i])}return t}return void 0===a[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),a[e]}}switch(e.type){case"Scene":s=new vi,void 0!==e.background&&(0,N.default)(e.background)&&(s.background=new oa(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?s.fog=new lc(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(s.fog=new sc(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":s=new vo(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(s.focus=e.focus),void 0!==e.zoom&&(s.zoom=e.zoom),void 0!==e.filmGauge&&(s.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(s.filmOffset=e.filmOffset),void 0!==e.view&&(s.view=(0,qe.default)({},e.view));break;case"OrthographicCamera":s=new Qp(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(s.zoom=e.zoom),void 0!==e.view&&(s.view=(0,qe.default)({},e.view));break;case"AmbientLight":s=new tm(e.color,e.intensity);break;case"DirectionalLight":s=new em(e.color,e.intensity);break;case"PointLight":s=new Kp(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":s=new nm(e.color,e.intensity,e.width,e.height);break;case"SpotLight":s=new Zp(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":s=new Yp(e.color,e.groundColor,e.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var i=n(e.geometry),o=r(e.material),s=new Qa(i,o);break;case"InstancedMesh":var i=n(e.geometry),o=r(e.material),l=e.count,u=e.instanceMatrix,s=new zc(i,o,l);s.instanceMatrix=new ma(new Float32Array(u.array),16);break;case"LOD":s=new Rc;break;case"Line":s=new qc(n(e.geometry),r(e.material),e.mode);break;case"LineLoop":s=new Kc(n(e.geometry),r(e.material));break;case"LineSegments":s=new Jc(n(e.geometry),r(e.material));break;case"PointCloud":case"Points":s=new rd(n(e.geometry),r(e.material));break;case"Sprite":s=new Ec(r(e.material));break;case"Group":s=new ic;break;default:s=new mi}if(s.uuid=e.uuid,void 0!==e.name&&(s.name=e.name),void 0!==e.matrix?(s.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(s.matrixAutoUpdate=e.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(void 0!==e.position&&s.position.fromArray(e.position),void 0!==e.rotation&&s.rotation.fromArray(e.rotation),void 0!==e.quaternion&&s.quaternion.fromArray(e.quaternion),void 0!==e.scale&&s.scale.fromArray(e.scale)),void 0!==e.castShadow&&(s.castShadow=e.castShadow),void 0!==e.receiveShadow&&(s.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(s.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(s.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&s.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(s.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(s.visible=e.visible),void 0!==e.frustumCulled&&(s.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(s.renderOrder=e.renderOrder),void 0!==e.userData&&(s.userData=e.userData),void 0!==e.layers&&(s.layers.mask=e.layers),void 0!==e.children)for(var h=e.children,c=0;c<h.length;c++)s.add(this.parseObject(h[c],t,a));if("LOD"===e.type){void 0!==e.autoUpdate&&(s.autoUpdate=e.autoUpdate);for(var d=e.levels,f=0;f<d.length;f++){var p=d[f],m=s.getObjectByProperty("uuid",p.object);void 0!==m&&s.addLevel(m,p.distance)}}return s}});var hm,cm={UVMapping:ue,CubeReflectionMapping:he,CubeRefractionMapping:ce,EquirectangularReflectionMapping:de,EquirectangularRefractionMapping:fe,SphericalReflectionMapping:rt,CubeUVReflectionMapping:it,CubeUVRefractionMapping:at},dm={RepeatWrapping:ot,ClampToEdgeWrapping:st,MirroredRepeatWrapping:lt},fm={NearestFilter:ut,NearestMipmapNearestFilter:ht,NearestMipmapLinearFilter:dt,LinearFilter:pt,LinearMipmapNearestFilter:mt,LinearMipmapLinearFilter:gt};function pm(e){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),op.call(this,e),this.options=void 0}function mm(){this.type="ShapePath",this.color=new oa,this.subPaths=[],this.currentPath=null}function vm(e){this.type="Font",this.data=e}function gm(e,t,n){for(var r=d.default?(0,d.default)(e):String(e).split(""),i=t/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,o=[],s=0,l=0,u=0;u<r.length;u++){var h,c=r[u];"\n"===c?(s=0,l-=a):(h=ym(c,i,s,l,n),s+=h.offsetX,o.push(h.path))}return o}function ym(e,t,n,r,i){var a=i.glyphs[e]||i.glyphs["?"];if(a){var o,s,l,u,h,c,d,f,p=new mm;if(a.o)for(var m=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),v=0,g=m.length;v<g;){var y=m[v++];switch(y){case"m":o=m[v++]*t+n,s=m[v++]*t+r,p.moveTo(o,s);break;case"l":o=m[v++]*t+n,s=m[v++]*t+r,p.lineTo(o,s);break;case"q":l=m[v++]*t+n,u=m[v++]*t+r,h=m[v++]*t+n,c=m[v++]*t+r,p.quadraticCurveTo(h,c,l,u);break;case"b":l=m[v++]*t+n,u=m[v++]*t+r,h=m[v++]*t+n,c=m[v++]*t+r,d=m[v++]*t+n,f=m[v++]*t+r,p.bezierCurveTo(h,c,d,f,l,u)}}return{offsetX:a.ha*t,path:p}}console.error('THREE.Font: character "'+e+'" does not exists in font family '+i.familyName+".")}function _m(e){op.call(this,e)}pm.prototype=(0,qe.default)((0,T.default)(op.prototype),{constructor:pm,setOptions:function(e){return this.options=e,this},load:function(t,n,e,r){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,a=rp.get(t);if(void 0!==a)return i.manager.itemStart(t),(0,y.default)(function(){n&&n(a),i.manager.itemEnd(t)},0),a;fetch(t).then(function(e){return e.blob()}).then(function(e){return void 0===i.options?createImageBitmap(e):createImageBitmap(e,i.options)}).then(function(e){rp.add(t,e),n&&n(e),i.manager.itemEnd(t)}).catch(function(e){r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)}),i.manager.itemStart(t)}}),(0,qe.default)(mm.prototype,{moveTo:function(e,t){return this.currentPath=new Hp,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this},lineTo:function(e,t){return this.currentPath.lineTo(e,t),this},quadraticCurveTo:function(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this},bezierCurveTo:function(e,t,n,r,i,a){return this.currentPath.bezierCurveTo(e,t,n,r,i,a),this},splineThru:function(e){return this.currentPath.splineThru(e),this},toShapes:function(e,t){function n(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n],a=new jp;a.curves=i.curves,t.push(a)}return t}function r(e,t){for(var n=t.length,r=!1,i=n-1,a=0;a<n;i=a++){var o=t[i],s=t[a],l=s.x-o.x,u=s.y-o.y;if(Math.abs(u)>se.default){if(u<0&&(o=t[a],l=-l,s=t[i],u=-u),e.y<o.y||e.y>s.y)continue;if(e.y===o.y){if(e.x===o.x)return!0}else{var h=u*(e.x-o.x)-l*(e.y-o.y);if(0===h)return!0;if(h<0)continue;r=!r}}else{if(e.y!==o.y)continue;if(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x)return!0}}return r}var i=rf.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===t)return n(a);var o,s,l,u=[];if(1===a.length)return s=a[0],l=new jp,l.curves=s.curves,u.push(l),u;var h,c=!i(a[0].getPoints()),c=e?!c:c,d=[],f=[],p=[],m=0;f[m]=void 0,p[m]=[];for(var v,g=0,y=a.length;g<y;g++)s=a[g],h=s.getPoints(),o=i(h),o=e?!o:o,o?(!c&&f[m]&&m++,f[m]={s:new jp,p:h},f[m].s.curves=s.curves,c&&m++,p[m]=[]):p[m].push({h:s,p:h[0]});if(!f[0])return n(a);if(1<f.length){for(var _=!1,x=[],w=0,b=f.length;w<b;w++)d[w]=[];for(w=0,b=f.length;w<b;w++)for(var M=p[w],T=0;T<M.length;T++){for(var S=M[T],E=!0,A=0;A<f.length;A++)r(S.p,f[A].p)&&(w!==A&&x.push({froms:w,tos:A,hole:T}),E?(E=!1,d[A].push(S)):_=!0);E&&d[w].push(S)}0<x.length&&(_||(p=d))}for(var g=0,I=f.length;g<I;g++){l=f[g].s,u.push(l),v=p[g];for(var L=0,R=v.length;L<R;L++)l.holes.push(v[L].h)}return u}}),(0,qe.default)(vm.prototype,{isFont:!0,generateShapes:function(e,t){void 0===t&&(t=100);for(var n=[],r=gm(e,t,this.data),i=0,a=r.length;i<a;i++)Array.prototype.push.apply(n,r[i].toShapes());return n}}),_m.prototype=(0,qe.default)((0,T.default)(op.prototype),{constructor:_m,load:function(e,r,t,n){var i=this,a=new lp(this.manager);a.setPath(this.path),a.load(e,function(t){var n;try{n=JSON.parse(t)}catch(e){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(t.substring(65,t.length-2))}var e=i.parse(n);r&&r(e)},t,n)},parse:function(e){return new vm(e)}});var xm={getContext:function(){return void 0===hm&&(hm=new(window.AudioContext||window.webkitAudioContext)),hm},setContext:function(e){hm=e}};function wm(e){op.call(this,e)}function bm(){this.coefficients=[];for(var e=0;e<9;e++)this.coefficients.push(new Hr)}function Mm(e,t){Wp.call(this,void 0,t),this.sh=void 0!==e?e:new bm}function Tm(e,t,n){Mm.call(this,void 0,n);var r=(new oa).set(e),i=(new oa).set(t),a=new Hr(r.r,r.g,r.b),o=new Hr(i.r,i.g,i.b),s=Math.sqrt(Math.PI),l=s*Math.sqrt(.75);this.sh.coefficients[0].copy(a).add(o).multiplyScalar(s),this.sh.coefficients[1].copy(a).sub(o).multiplyScalar(l)}function Sm(e,t){Mm.call(this,void 0,t);var n=(new oa).set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}t.AudioContext=xm,wm.prototype=(0,qe.default)((0,T.default)(op.prototype),{constructor:wm,load:function(e,r,t,n){var i=new lp(this.manager);i.setResponseType("arraybuffer"),i.setPath(this.path),i.load(e,function(e){var t=(0,E.default)(e).call(e,0),n=xm.getContext();n.decodeAudioData(t,function(e){r(e)})},t,n)}}),(0,qe.default)(bm.prototype,{isSphericalHarmonics3:!0,set:function(e){for(var t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this},zero:function(){for(var e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this},getAt:function(e,t){var n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*r),t.addScaledVector(a[2],.488603*i),t.addScaledVector(a[3],.488603*n),t.addScaledVector(a[4],n*r*1.092548),t.addScaledVector(a[5],r*i*1.092548),t.addScaledVector(a[6],.315392*(3*i*i-1)),t.addScaledVector(a[7],n*i*1.092548),t.addScaledVector(a[8],.546274*(n*n-r*r)),t},getIrradianceAt:function(e,t){var n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],1.023328*r),t.addScaledVector(a[2],1.023328*i),t.addScaledVector(a[3],1.023328*n),t.addScaledVector(a[4],.858086*n*r),t.addScaledVector(a[5],.858086*r*i),t.addScaledVector(a[6],.743125*i*i-.247708),t.addScaledVector(a[7],.858086*n*i),t.addScaledVector(a[8],.429043*(n*n-r*r)),t},add:function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this},addScaledSH:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this},scale:function(e){for(var t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this},lerp:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this},equals:function(e){for(var t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0},copy:function(e){return this.set(e.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(e,t){void 0===t&&(t=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}}),(0,qe.default)(bm,{getBasisAt:function(e,t){var n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}),Mm.prototype=(0,qe.default)((0,T.default)(Wp.prototype),{constructor:Mm,isLightProbe:!0,copy:function(e){return Wp.prototype.copy.call(this,e),this.sh.copy(e.sh),this.intensity=e.intensity,this},toJSON:function(e){var t=Wp.prototype.toJSON.call(this,e);return t}}),Tm.prototype=(0,qe.default)((0,T.default)(Mm.prototype),{constructor:Tm,isHemisphereLightProbe:!0,copy:function(e){return Mm.prototype.copy.call(this,e),this},toJSON:function(e){var t=Mm.prototype.toJSON.call(this,e);return t}}),Sm.prototype=(0,qe.default)((0,T.default)(Mm.prototype),{constructor:Sm,isAmbientLightProbe:!0,copy:function(e){return Mm.prototype.copy.call(this,e),this},toJSON:function(e){var t=Mm.prototype.toJSON.call(this,e);return t}});var Em=new Kr,Am=new Kr;function Im(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new vo,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new vo,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}function Lm(e){this.autoStart=void 0===e||e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}(0,qe.default)(Im.prototype,{update:function(e){var t,n,r,i,a,o,s=this._cache,l=s.focus!==e.focus||s.fov!==e.fov||s.aspect!==e.aspect*this.aspect||s.near!==e.near||s.far!==e.far||s.zoom!==e.zoom||s.eyeSep!==this.eyeSep;l&&(s.focus=e.focus,s.fov=e.fov,s.aspect=e.aspect*this.aspect,s.near=e.near,s.far=e.far,s.zoom=e.zoom,s.eyeSep=this.eyeSep,t=e.projectionMatrix.clone(),n=s.eyeSep/2,r=n*s.near/s.focus,i=s.near*Math.tan(Nr.DEG2RAD*s.fov*.5)/s.zoom,Am.elements[12]=-n,Em.elements[12]=n,a=-i*s.aspect+r,o=i*s.aspect+r,t.elements[0]=2*s.near/(o-a),t.elements[8]=(o+a)/(o-a),this.cameraL.projectionMatrix.copy(t),a=-i*s.aspect-r,o=i*s.aspect-r,t.elements[0]=2*s.near/(o-a),t.elements[8]=(o+a)/(o-a),this.cameraR.projectionMatrix.copy(t)),this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Am),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Em)}}),(0,qe.default)(Lm.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e,t=0;return this.autoStart&&!this.running?(this.start(),0):(this.running&&(e=("undefined"==typeof performance?Date:performance).now(),t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t),t)}});var Rm=new Hr,Nm=new zr,km=new Hr,Pm=new Hr;function Cm(){mi.call(this),this.type="AudioListener",this.context=xm.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Lm}function Dm(e){mi.call(this),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this._startedAt=0,this._pausedAt=0,this.filters=[]}Cm.prototype=(0,qe.default)((0,T.default)(mi.prototype),{constructor:Cm,getInput:function(){return this.gain},removeFilter:function(){return null!==(0,U.default)(this)&&(this.gain.disconnect((0,U.default)(this)),(0,U.default)(this).disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return(0,U.default)(this)},setFilter:function(e){return null!==(0,U.default)(this)?(this.gain.disconnect((0,U.default)(this)),(0,U.default)(this).disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect((0,U.default)(this)),(0,U.default)(this).connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this},updateMatrixWorld:function(e){mi.prototype.updateMatrixWorld.call(this,e);var t,n=this.context.listener,r=this.up;this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Rm,Nm,km),Pm.set(0,0,-1).applyQuaternion(Nm),n.positionX?(t=this.context.currentTime+this.timeDelta,n.positionX.linearRampToValueAtTime(Rm.x,t),n.positionY.linearRampToValueAtTime(Rm.y,t),n.positionZ.linearRampToValueAtTime(Rm.z,t),n.forwardX.linearRampToValueAtTime(Pm.x,t),n.forwardY.linearRampToValueAtTime(Pm.y,t),n.forwardZ.linearRampToValueAtTime(Pm.z,t),n.upX.linearRampToValueAtTime(r.x,t),n.upY.linearRampToValueAtTime(r.y,t),n.upZ.linearRampToValueAtTime(r.z,t)):(n.setPosition(Rm.x,Rm.y,Rm.z),n.setOrientation(Pm.x,Pm.y,Pm.z,r.x,r.y,r.z))}}),Dm.prototype=(0,qe.default)((0,T.default)(mi.prototype),{constructor:Dm,getOutput:function(){return this.gain},setNodeSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},setMediaElementSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this},setMediaStreamSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this},setBuffer:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(e){var t;if(void 0===e&&(e=0),!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+e;var n=this.context.createBufferSource();return n.buffer=this.buffer,n.loop=this.loop,n.loopStart=this.loopStart,n.loopEnd=this.loopEnd,n.onended=(0,o.default)(t=this.onEnded).call(t,this),n.start(this._startedAt,this._pausedAt+this.offset,this.duration),this.isPlaying=!0,this.source=n,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._pausedAt+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this._pausedAt=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(0<this.filters.length){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(0<this.filters.length){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(e){return e=e||[],!0===this.isPlaying?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},setDetune:function(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate:function(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},setLoopStart:function(e){return this.loopStart=e,this},setLoopEnd:function(e){return this.loopEnd=e,this},getVolume:function(){return this.gain.gain.value},setVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}});var Om=new Hr,Fm=new zr,Bm=new Hr,Um=new Hr;function zm(e){Dm.call(this,e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function Gm(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function Vm(e,t,n){this.binding=e,this.valueSize=n;var r,i=Float64Array;switch(t){case"quaternion":r=this._slerp;break;case"string":case"bool":i=Array,r=this._select;break;default:r=this._lerp}this.buffer=new i(4*n),this._mixBufferRegion=r,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}zm.prototype=(0,qe.default)((0,T.default)(Dm.prototype),{constructor:zm,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(e){return this.panner.refDistance=e,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(e){return this.panner.rolloffFactor=e,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(e){return this.panner.distanceModel=e,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(e){return this.panner.maxDistance=e,this},setDirectionalCone:function(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(e){var t,n;mi.prototype.updateMatrixWorld.call(this,e),!0===this.hasPlaybackControl&&!1===this.isPlaying||(this.matrixWorld.decompose(Om,Fm,Bm),Um.set(0,0,1).applyQuaternion(Fm),t=this.panner,t.positionX?(n=this.context.currentTime+this.listener.timeDelta,t.positionX.linearRampToValueAtTime(Om.x,n),t.positionY.linearRampToValueAtTime(Om.y,n),t.positionZ.linearRampToValueAtTime(Om.z,n),t.orientationX.linearRampToValueAtTime(Um.x,n),t.orientationY.linearRampToValueAtTime(Um.y,n),t.orientationZ.linearRampToValueAtTime(Um.z,n)):(t.setPosition(Om.x,Om.y,Om.z),t.setOrientation(Um.x,Um.y,Um.z)))}}),(0,qe.default)(Gm.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),n=0;n<t.length;n++)e+=t[n];return e/t.length}}),(0,qe.default)(Vm.prototype,{accumulate:function(e,t){var n=this.buffer,r=this.valueSize,i=e*r+r,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==r;++o)n[i+o]=n[o];a=t}else{a+=t;var s=t/a;this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=a},apply:function(e){var t,n=this.valueSize,r=this.buffer,i=e*n+n,a=this.cumulativeWeight,o=this.binding;this.cumulativeWeight=0,a<1&&(t=3*n,this._mixBufferRegion(r,i,t,1-a,n));for(var s=n,l=n+n;s!==l;++s)if(r[s]!==r[s+n]){o.setValue(r,i);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,r=3*n;e.getValue(t,r);for(var i=n,a=r;i!==a;++i)t[i]=t[r+i%n];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,t,n,r,i){if(.5<=r)for(var a=0;a!==i;++a)e[t+a]=e[n+a]},_slerp:function(e,t,n,r){zr.slerpFlat(e,t,e,t,e,n,r)},_lerp:function(e,t,n,r,i){for(var a=1-r,o=0;o!==i;++o){var s=t+o;e[s]=e[s]*a+e[n+o]*r}}});var Hm,jm,Wm,Ym,qm="\\[\\]\\.:\\/",Xm=new RegExp("["+qm+"]","g"),Zm="[^"+qm+"]",Jm="[^"+qm.replace("\\.","")+"]",Km=/((?:WC+[\/:])*)/.source.replace("WC",Zm),Qm=/(WCOD+)?/.source.replace("WCOD",Jm),$m=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Zm),ev=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Zm),tv=new RegExp("^"+Km+Qm+$m+ev+"$"),nv=["material","materials","bones"];function rv(e,t,n){var r=n||iv.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function iv(e,t,n){this.path=t,this.parsedPath=n||iv.parseTrackName(t),this.node=iv.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function av(){this.uuid=Nr.generateUUID(),this._objects=(0,E.default)(Array.prototype).call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}function ov(e,t,n){this._mixer=e,this._clip=t,this._localRoot=n||null;for(var r=t.tracks,i=r.length,a=new Array(i),o={endingStart:Bn,endingEnd:Bn},s=0;s!==i;++s){var l=r[s].createInterpolant(null);a[s]=l,l.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(i),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Pn,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=Infinity,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function sv(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function lv(e,t){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=t),this.value=e}function uv(e,t,n){uc.call(this,e,t),this.meshPerAttribute=n||1}function hv(e,t,n,r){this.ray=new Gi(e,t),this.near=n||0,this.far=r||Infinity,this.camera=null,this.layers=new ti,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}},(0,S.default)(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function cv(e,t){return e.distance-t.distance}function dv(e,t,n,r){if(e.layers.test(t.layers)&&e.raycast(t,n),!0===r)for(var i=e.children,a=0,o=i.length;a<o;a++)dv(i[a],t,n,!0)}function fv(e,t,n){return this.radius=void 0!==e?e:1,this.phi=void 0!==t?t:0,this.theta=void 0!==n?n:0,this}function pv(e,t,n){return this.radius=void 0!==e?e:1,this.theta=void 0!==t?t:0,this.y=void 0!==n?n:0,this}(0,qe.default)(rv.prototype,{getValue:function(e,t){var n;(0,o.default)(n=this).call(n);var r=this._targetGroup.nCachedObjects_,i=this._bindings[r];void 0!==i&&i.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)},bind:function(){for(var e,t=this._bindings,n=this._targetGroup.nCachedObjects_,r=t.length;n!==r;++n)(0,o.default)(e=t[n]).call(e)},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),(0,qe.default)(iv,{Composite:rv,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new iv.Composite(e,t,n):new iv(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(Xm,"")},parseTrackName:function(e){var t,n=tv.exec(e);if(!n)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var r,i={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},a=i.nodeName&&(0,s.default)(t=i.nodeName).call(t,".");if(void 0!==a&&-1!==a&&(r=i.nodeName.substring(a+1),-1!==(0,ve.default)(nv).call(nv,r)&&(i.nodeName=i.nodeName.substring(0,a),i.objectName=r)),null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i},findNode:function(e,a){if(!a||""===a||"."===a||-1===a||a===e.name||a===e.uuid)return e;if(e.skeleton){var t=e.skeleton.getBoneByName(a);if(void 0!==t)return t}if(e.children){var n=function e(t){for(var n=0;n<t.length;n++){var r=t[n];if(r.name===a||r.uuid===a)return r;var i=e(r.children);if(i)return i}return null},r=n(e.children);if(r)return r}return null}}),(0,qe.default)(iv.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)e[t++]=n[r]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.targetObject[this.propertyName]=e[t]},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){var n;(0,o.default)(n=this).call(n),this.getValue(e,t)},setValue:function(e,t){var n;(0,o.default)(n=this).call(n),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,r=t.propertyName,i=t.propertyIndex;if(e||(e=iv.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,e){if(n){var a=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(var o=0;o<e.length;o++)if(e[o].name===a){a=o;break}break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==a){if(void 0===e[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[a]}}var s=e[r];if(void 0!==s){var l=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?l=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(l=this.Versioning.MatrixWorldNeedsUpdate);var u=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(o=0;o<this.node.geometry.morphAttributes.position.length;o++)if(e.geometry.morphAttributes.position[o].name===i){i=o;break}}else{if(!e.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(o=0;o<this.node.geometry.morphTargets.length;o++)if(e.geometry.morphTargets[o].name===i){i=o;break}}}u=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(u=this.BindingType.HasFromToArray,this.resolvedProperty=s):(0,Ye.default)(s)?(u=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][l]}else{var h=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+h+"."+r+" but it wasn't found.",e)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),(0,qe.default)(iv.prototype,{_getValue_unbound:iv.prototype.getValue,_setValue_unbound:iv.prototype.setValue}),(0,qe.default)(op.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(e,t,n){for(var r=[],i=0;i<e.length;++i)r[i]=this.createMaterial(e[i],t,n);return r},createMaterial:(Hm={NoBlending:we,NormalBlending:be,AdditiveBlending:Me,SubtractiveBlending:Te,MultiplyBlending:Se,CustomBlending:Ee},jm=new oa,Wm=new pp,Ym=new rm,function(e,h,c){var d={};function t(e,t,n,r,i){var a=h+e,o=new ip,s=o.getHandler(a),l=null!==s?s.load(a):(Wm.setCrossOrigin(c),Wm.load(a));void 0!==t&&((0,M.default)(l).fromArray(t),1!==t[0]&&(l.wrapS=ot),1!==t[1]&&(l.wrapT=ot)),void 0!==n&&l.offset.fromArray(n),void 0!==r&&("repeat"===r[0]&&(l.wrapS=ot),"mirror"===r[0]&&(l.wrapS=lt),"repeat"===r[1]&&(l.wrapT=ot),"mirror"===r[1]&&(l.wrapT=lt)),void 0!==i&&(l.anisotropy=i);var u=Nr.generateUUID();return d[u]=l,u}var n,r={uuid:Nr.generateUUID(),type:"MeshLambertMaterial"};for(n in e){var i=e[n];switch(n){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":r.name=i;break;case"blending":r.blending=Hm[i];break;case"colorAmbient":case"mapAmbient":break;case"colorDiffuse":r.color=jm.fromArray(i).getHex();break;case"colorSpecular":r.specular=jm.fromArray(i).getHex();break;case"colorEmissive":r.emissive=jm.fromArray(i).getHex();break;case"specularCoef":r.shininess=i;break;case"shading":"basic"===i.toLowerCase()&&(r.type="MeshBasicMaterial"),"phong"===i.toLowerCase()&&(r.type="MeshPhongMaterial"),"standard"===i.toLowerCase()&&(r.type="MeshStandardMaterial");break;case"mapDiffuse":r.map=t(i,e.mapDiffuseRepeat,e.mapDiffuseOffset,e.mapDiffuseWrap,e.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":r.emissiveMap=t(i,e.mapEmissiveRepeat,e.mapEmissiveOffset,e.mapEmissiveWrap,e.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":r.lightMap=t(i,e.mapLightRepeat,e.mapLightOffset,e.mapLightWrap,e.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":r.aoMap=t(i,e.mapAORepeat,e.mapAOOffset,e.mapAOWrap,e.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":r.bumpMap=t(i,e.mapBumpRepeat,e.mapBumpOffset,e.mapBumpWrap,e.mapBumpAnisotropy);break;case"mapBumpScale":r.bumpScale=i;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":r.normalMap=t(i,e.mapNormalRepeat,e.mapNormalOffset,e.mapNormalWrap,e.mapNormalAnisotropy);break;case"mapNormalFactor":r.normalScale=i;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":r.specularMap=t(i,e.mapSpecularRepeat,e.mapSpecularOffset,e.mapSpecularWrap,e.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":r.metalnessMap=t(i,e.mapMetalnessRepeat,e.mapMetalnessOffset,e.mapMetalnessWrap,e.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":r.roughnessMap=t(i,e.mapRoughnessRepeat,e.mapRoughnessOffset,e.mapRoughnessWrap,e.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":r.alphaMap=t(i,e.mapAlphaRepeat,e.mapAlphaOffset,e.mapAlphaWrap,e.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":r.side=Xe;break;case"doubleSided":r.side=xe;break;case"transparency":r.opacity=i;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":r[n]=i;break;case"vertexColors":!0===i&&(r.vertexColors=Gg),"face"===i&&(r.vertexColors=zg)}}return"MeshBasicMaterial"===r.type&&delete r.emissive,"MeshPhongMaterial"!==r.type&&delete r.specular,r.opacity<1&&(r.transparent=!0),Ym.setTextures(d),Ym.parse(r)})}),(0,qe.default)(av.prototype,{isAnimationObjectGroup:!0,add:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._paths,a=this._parsedPaths,o=this._bindings,s=o.length,l=void 0,u=0,h=arguments.length;u!==h;++u){var c=arguments[u],d=c.uuid,f=r[d];if(void 0===f){f=t++,r[d]=f,e.push(c);for(var p=0,m=s;p!==m;++p)o[p].push(new iv(c,i[p],a[p]))}else if(f<n){l=e[f];var v=--n,g=e[v];for(r[g.uuid]=f,e[f]=g,r[d]=v,e[v]=c,p=0,m=s;p!==m;++p){var y=o[p],_=y[v],x=y[f];y[f]=_,void 0===x&&(x=new iv(c,i[p],a[p])),y[v]=x}}else e[f]!==l&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var e=this._objects,t=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,i=r.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],l=s.uuid,u=n[l];if(void 0!==u&&t<=u){var h=t++,c=e[h];n[c.uuid]=u,e[u]=c,n[l]=h,e[h]=s;for(var d=0,f=i;d!==f;++d){var p=r[d],m=p[h],v=p[u];p[u]=m,p[h]=v}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._bindings,a=i.length,o=0,s=arguments.length;o!==s;++o){var l=arguments[o],u=l.uuid,h=r[u];if(void 0!==h)if(delete r[u],h<n){var c=--n,d=e[c],f=--t,p=e[f];r[d.uuid]=h,e[h]=d,r[p.uuid]=c,e[c]=p,e.pop();for(var m=0,v=a;m!==v;++m){var g=i[m],y=g[c],_=g[f];g[h]=y,g[c]=_,g.pop()}}else for(f=--t,p=e[f],r[p.uuid]=h,e[h]=p,e.pop(),m=0,v=a;m!==v;++m)g=i[m],g[h]=g[f],g.pop()}this.nCachedObjects_=n},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(void 0!==r)return i[r];var a=this._paths,o=this._parsedPaths,s=this._objects,l=s.length,u=this.nCachedObjects_,h=new Array(l),r=i.length;n[e]=r,a.push(e),o.push(t),i.push(h);for(var c=u,d=s.length;c!==d;++c){var f=s[c];h[c]=new iv(f,e,t)}return h},unsubscribe_:function(e){var t,n,r,i,a,o,s=this._bindingsIndicesByPath,l=s[e];void 0!==l&&(t=this._paths,n=this._parsedPaths,r=this._bindings,i=r.length-1,a=r[i],o=e[i],s[o]=l,r[l]=a,r.pop(),n[l]=n[i],n.pop(),t[l]=t[i],t.pop())}}),(0,qe.default)(ov.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(e){return this._startTime=e,this},setLoop:function(e,t){return this.loop=e,this.repetitions=t,this},setEffectiveWeight:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(e){return this._scheduleFading(e,0,1)},fadeOut:function(e){return this._scheduleFading(e,1,0)},crossFadeFrom:function(e,t,n){var r,i,a,o;return e.fadeOut(t),this.fadeIn(t),n&&(r=this._clip.duration,i=e._clip.duration,a=i/r,o=r/i,e.warp(1,a,t),this.warp(o,1,t)),this},crossFadeTo:function(e,t,n){return e.crossFadeFrom(this,t,n)},stopFading:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},setEffectiveTimeScale:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},syncWith:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},halt:function(e){return this.warp(this._effectiveTimeScale,0,e)},warp:function(e,t,n){var r=this._mixer,i=r.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,l=a.sampleValues;return s[0]=i,s[1]=i+n,l[0]=e/o,l[1]=t/o,this},stopWarping:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(e,t,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var a=(e-i)*n;if(a<0||0===n)return;this._startTime=null,t=n*a}t*=this._updateTimeScale(e);var o=this._updateTime(t),s=this._updateWeight(e);if(0<s)for(var l=this._interpolants,u=this._propertyBindings,h=0,c=l.length;h!==c;++h)l[h].evaluate(o),u[h].accumulate(r,s)}else this._updateWeight(e)},_updateWeight:function(e){var t,n,r=0;return this.enabled&&(r=this.weight,t=this._weightInterpolant,null!==t&&(n=t.evaluate(e)[0],r*=n,e>t.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1)))),this._effectiveWeight=r,r},_updateTimeScale:function(e){var t,n,r=0;return this.paused||(r=this.timeScale,t=this._timeScaleInterpolant,null!==t&&(n=t.evaluate(e)[0],r*=n,e>t.parameterPositions[1]&&(this.stopWarping(),0===r?this.paused=!0:this.timeScale=r))),this._effectiveTimeScale=r,r},_updateTime:function(e){var t,n,r,i=this.time+e,a=this._clip.duration,o=this.loop,s=this._loopCount,l=o===Cn;if(0===e)return-1!==s&&l&&1==(1&s)?a-i:i;if(o===kn){-1===s&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(a<=i)i=a;else{if(!(i<0)){this.time=i;break e}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else if(-1===s&&(0<=e?(s=0,this._setEndings(!0,0===this.repetitions,l)):this._setEndings(0===this.repetitions,!0,l)),a<=i||i<0?(t=Math.floor(i/a),i-=a*t,s+=Math.abs(t),n=this.repetitions-s,n<=0?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=0<e?a:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<e?1:-1})):(1===n?(r=e<0,this._setEndings(r,!r,l)):this._setEndings(!1,!1,l),this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:t}))):this.time=i,l&&1==(1&s))return a-i;return i},_setEndings:function(e,t,n){var r=this._interpolantSettings;n?(r.endingStart=Un,r.endingEnd=Un):(r.endingStart=e?this.zeroSlopeAtStart?Un:Bn:zn,r.endingEnd=t?this.zeroSlopeAtEnd?Un:Bn:zn)},_scheduleFading:function(e,t,n){var r=this._mixer,i=r.time,a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}}),sv.prototype=(0,qe.default)((0,T.default)(Ar.prototype),{constructor:sv,_bindAction:function(e,t){var n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,l=this._bindingsByRootAndName,u=l[s];void 0===u&&(u={},l[s]=u);for(var h=0;h!==i;++h){var c=r[h],d=c.name,f=u[d];if(void 0!==f)a[h]=f;else{if(f=a[h],void 0!==f){null===f._cacheIndex&&(++f.referenceCount,this._addInactiveBinding(f,s,d));continue}var p=t&&t._propertyBindings[h].binding.parsedPath,f=new Vm(iv.create(n,d,p),c.ValueTypeName,c.getValueSize());++f.referenceCount,this._addInactiveBinding(f,s,d),a[h]=f}o[h].resultBuffer=f.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){var t,n,r;null===e._cacheIndex&&(t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n],this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t));for(var i=e._propertyBindings,a=0,o=i.length;a!==o;++a){var s=i[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&t<this._nActiveActions},_addInactiveAction:function(e,t,n){var r,i=this._actions,a=this._actionsByClip,o=a[t];void 0===o?(o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,a[t]=o):(r=o.knownActions,e._byClipCacheIndex=r.length,r.push(e)),e._cacheIndex=i.length,i.push(e),o.actionByRoot[n]=e},_removeInactiveAction:function(e){var t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;var i=e._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,l=s[s.length-1],u=e._byClipCacheIndex;l._byClipCacheIndex=u,s[u]=l,s.pop(),e._byClipCacheIndex=null;var h=o.actionByRoot,c=(e._localRoot||this._root).uuid;delete h[c],0===s.length&&delete a[i],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(e){var t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackAction:function(e){var t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_addInactiveBinding:function(e,t,n){var r=this._bindingsByRootAndName,i=r[t],a=this._bindings;void 0===i&&(i={},r[t]=i),i[n]=e,e._cacheIndex=a.length,a.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,a=this._bindingsByRootAndName,o=a[r],s=t[t.length-1],l=e._cacheIndex;s._cacheIndex=l,t[l]=s,t.pop(),delete o[i],0===(0,v.default)(o).length&&delete a[r]},_lendBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return void 0===n&&(n=new jf(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),n.__cacheIndex=t,e[t]=n),n},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];e.__cacheIndex=r,t[r]=e,i.__cacheIndex=n,t[n]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t){var n=t||this._root,r=n.uuid,i="string"==typeof e?ep.findByName(n,e):e,a=null!==i?i.uuid:e,o=this._actionsByClip[a],s=null;if(void 0!==o){var l=o.actionByRoot[r];if(void 0!==l)return l;s=o.knownActions[0],null===i&&(i=s._clip)}if(null===i)return null;var u=new ov(this,i,t);return this._bindAction(u,s),this._addInactiveAction(u,a,r),u},existingAction:function(e,t){var n=t||this._root,r=n.uuid,i="string"==typeof e?ep.findByName(n,e):e,a=i?i.uuid:e,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[r]||null},stopAllAction:function(){var e=this._actions,t=this._nActiveActions,n=this._bindings,r=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var i=0;i!==t;++i)e[i].reset();for(i=0;i!==r;++i)n[i].useCount=0;return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,r=this.time+=e,i=(0,oe.default)(e),a=this._accuIndex^=1,o=0;o!==n;++o){var s=t[o];s._update(r,e,i,a)}for(var l=this._bindings,u=this._nActiveBindings,o=0;o!==u;++o)l[o].apply(a);return this},setTime:function(e){this.time=0;for(var t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,n=e.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){for(var a=i.knownActions,o=0,s=a.length;o!==s;++o){var l=a[o];this._deactivateAction(l);var u=l._cacheIndex,h=t[t.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,h._cacheIndex=u,t[u]=h,t.pop(),this._removeInactiveBindingsForAction(l)}delete r[n]}},uncacheRoot:function(e){var t,n=e.uuid,r=this._actionsByClip;for(t in r){var i=r[t].actionByRoot,a=i[n];void 0!==a&&(this._deactivateAction(a),this._removeInactiveAction(a))}var o=this._bindingsByRootAndName,s=o[n];if(void 0!==s)for(var l in s){var u=s[l];u.restoreOriginalState(),this._removeInactiveBinding(u)}},uncacheAction:function(e,t){var n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),lv.prototype.clone=function(){return new lv(void 0===this.value.clone?this.value:this.value.clone())},uv.prototype=(0,qe.default)((0,T.default)(uc.prototype),{constructor:uv,isInstancedInterleavedBuffer:!0,copy:function(e){return uc.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),(0,qe.default)(hv.prototype,{set:function(e,t){this.ray.set(e,t)},setFromCamera:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,t,n){var r=n||[];return dv(e,this,r,t),(0,je.default)(r).call(r,cv),r},intersectObjects:function(e,t,n){var r=n||[];if(!1===(0,Ye.default)(e))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var i=0,a=e.length;i<a;i++)dv(e[i],this,r,t);return(0,je.default)(r).call(r,cv),r}}),(0,qe.default)(fv.prototype,{set:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this},makeSafe:function(){var e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Nr.clamp(t/this.radius,-1,1))),this}}),(0,qe.default)(pv.prototype,{set:function(e,t,n){return this.radius=e,this.theta=t,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}});var mv=new kr;function vv(e,t){this.min=void 0!==e?e:new kr(Infinity,Infinity),this.max=void 0!==t?t:new kr(-Infinity,-Infinity)}(0,qe.default)(vv.prototype,{set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){var n=mv.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=Infinity,this.max.x=this.max.y=-Infinity,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box2: .getCenter() target is now required"),e=new kr),this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box2: .getSize() target is now required"),e=new kr),this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new kr),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new kr),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){var t=mv.copy(e).clamp(this.min,this.max);return t.sub(e).length()},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var gv=new Hr,yv=new Hr;function _v(e,t){this.start=void 0!==e?e:new Hr,this.end=void 0!==t?t:new Hr}function xv(e){mi.call(this),this.material=e,this.render=function(){}}(0,qe.default)(_v.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new Hr),e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new Hr),e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new Hr),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(e,t){gv.subVectors(e,this.start),yv.subVectors(this.end,this.start);var n=yv.dot(yv),r=yv.dot(gv),i=r/n;return t&&(i=Nr.clamp(i,0,1)),i},closestPointToPoint:function(e,t,n){var r=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Hr),this.delta(n).multiplyScalar(r).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),xv.prototype=(0,T.default)(mi.prototype),xv.prototype.constructor=xv,xv.prototype.isImmediateRenderObject=!0;var wv=new Hr;function bv(e,t){mi.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var n=new Ca,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,a=1,o=32;i<o;i++,a++){var s=i/o*Math.PI*2,l=a/o*Math.PI*2;r.push(Math.cos(s),Math.sin(s),1,Math.cos(l),Math.sin(l),1)}n.setAttribute("position",new Ma(r,3));var u=new Gc({fog:!1,toneMapped:!1});this.cone=new Jc(n,u),this.add(this.cone),this.update()}bv.prototype=(0,T.default)(mi.prototype),bv.prototype.constructor=bv,bv.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},bv.prototype.update=function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),wv.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(wv),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var Mv=new Hr,Tv=new Kr,Sv=new Kr;function Ev(e){var t=[];e&&e.isBone&&t.push(e);for(var n=0;n<e.children.length;n++)t.push.apply(t,Ev(e.children[n]));return t}function Av(e){for(var t=Ev(e),n=new Ca,r=[],i=[],a=new oa(0,0,1),o=new oa(0,1,0),s=0;s<t.length;s++){var l=t[s];l.parent&&l.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(a.r,a.g,a.b),i.push(o.r,o.g,o.b))}n.setAttribute("position",new Ma(r,3)),n.setAttribute("color",new Ma(i,3));var u=new Gc({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});Jc.call(this,n,u),this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}function Iv(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n;var r=new pf(t,4,2),i=new fa({wireframe:!0,fog:!1,toneMapped:!1});Qa.call(this,r,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}Av.prototype=(0,T.default)(Jc.prototype),Av.prototype.constructor=Av,Av.prototype.isSkeletonHelper=!0,Av.prototype.updateMatrixWorld=function(e){var t=this.bones,n=this.geometry,r=n.getAttribute("position");Sv.getInverse(this.root.matrixWorld);for(var i=0,a=0;i<t.length;i++){var o=t[i];o.parent&&o.parent.isBone&&(Tv.multiplyMatrices(Sv,o.matrixWorld),Mv.setFromMatrixPosition(Tv),r.setXYZ(a,Mv.x,Mv.y,Mv.z),Tv.multiplyMatrices(Sv,o.parent.matrixWorld),Mv.setFromMatrixPosition(Tv),r.setXYZ(a+1,Mv.x,Mv.y,Mv.z),a+=2)}n.getAttribute("position").needsUpdate=!0,mi.prototype.updateMatrixWorld.call(this,e)},Iv.prototype=(0,T.default)(Qa.prototype),Iv.prototype.constructor=Iv,Iv.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},Iv.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};var Lv=new Hr,Rv=new oa,Nv=new oa;function kv(e,t,n){mi.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new gd(t);r.rotateY(.5*Math.PI),this.material=new fa({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);var i=r.getAttribute("position"),a=new Float32Array(3*i.count);r.setAttribute("color",new ma(a,3)),this.add(new Qa(r,this.material)),this.update()}function Pv(e,t,n,r){e=e||10,t=t||10,n=new oa(void 0!==n?n:4473924),r=new oa(void 0!==r?r:8947848);for(var i=t/2,a=e/t,o=e/2,s=[],l=[],u=0,h=0,c=-o;u<=t;u++,c+=a){s.push(-o,0,c,o,0,c),s.push(c,0,-o,c,0,o);var d=u===i?n:r;d.toArray(l,h),h+=3,d.toArray(l,h),h+=3,d.toArray(l,h),h+=3,d.toArray(l,h),h+=3}var f=new Ca;f.setAttribute("position",new Ma(s,3)),f.setAttribute("color",new Ma(l,3));var p=new Gc({vertexColors:!0,toneMapped:!1});Jc.call(this,f,p)}function Cv(e,t,n,r,i,a){e=e||10,t=t||16,n=n||8,r=r||64,i=new oa(void 0!==i?i:4473924),a=new oa(void 0!==a?a:8947848);for(var o,s,l,u,h,c,d=[],f=[],p=0;p<=t;p++)l=p/t*(2*Math.PI),o=Math.sin(l)*e,s=Math.cos(l)*e,d.push(0,0,0),d.push(o,0,s),c=1&p?i:a,f.push(c.r,c.g,c.b),f.push(c.r,c.g,c.b);for(p=0;p<=n;p++)for(c=1&p?i:a,h=e-e/n*p,u=0;u<r;u++)l=u/r*(2*Math.PI),o=Math.sin(l)*h,s=Math.cos(l)*h,d.push(o,0,s),f.push(c.r,c.g,c.b),l=(u+1)/r*(2*Math.PI),o=Math.sin(l)*h,s=Math.cos(l)*h,d.push(o,0,s),f.push(c.r,c.g,c.b);var m=new Ca;m.setAttribute("position",new Ma(d,3)),m.setAttribute("color",new Ma(f,3));var v=new Gc({vertexColors:!0,toneMapped:!1});Jc.call(this,m,v)}kv.prototype=(0,T.default)(mi.prototype),kv.prototype.constructor=kv,kv.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},kv.prototype.update=function(){var e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var t=e.geometry.getAttribute("color");Rv.copy(this.light.color),Nv.copy(this.light.groundColor);for(var n=0,r=t.count;n<r;n++){var i=n<r/2?Rv:Nv;t.setXYZ(n,i.r,i.g,i.b)}t.needsUpdate=!0}e.lookAt(Lv.setFromMatrixPosition(this.light.matrixWorld).negate())},Pv.prototype=(0,qe.default)((0,T.default)(Jc.prototype),{constructor:Pv,copy:function(e){return Jc.prototype.copy.call(this,e),this.geometry.copy(e.geometry),this.material.copy(e.material),this},clone:function(){return(new this.constructor).copy(this)}}),Cv.prototype=(0,T.default)(Jc.prototype),Cv.prototype.constructor=Cv;var Dv=new Hr,Ov=new Hr,Fv=new Hr;function Bv(e,t,n){mi.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===t&&(t=1);var r=new Ca;r.setAttribute("position",new Ma([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var i=new Gc({fog:!1,toneMapped:!1});this.lightPlane=new qc(r,i),this.add(this.lightPlane),r=new Ca,r.setAttribute("position",new Ma([0,0,0,0,0,1],3)),this.targetLine=new qc(r,i),this.add(this.targetLine),this.update()}Bv.prototype=(0,T.default)(mi.prototype),Bv.prototype.constructor=Bv,Bv.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},Bv.prototype.update=function(){Dv.setFromMatrixPosition(this.light.matrixWorld),Ov.setFromMatrixPosition(this.light.target.matrixWorld),Fv.subVectors(Ov,Dv),this.lightPlane.lookAt(Ov),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Ov),this.targetLine.scale.z=Fv.length()};var Uv=new Hr,zv=new mo;function Gv(e){var t=new Ca,n=new Gc({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],i=[],a={},o=new oa(16755200),s=new oa(16711680),l=new oa(43775),u=new oa(16777215),h=new oa(3355443);function c(e,t,n){d(e,n),d(t,n)}function d(e,t){r.push(0,0,0),i.push(t.r,t.g,t.b),void 0===a[e]&&(a[e]=[]),a[e].push(r.length/3-1)}c("n1","n2",o),c("n2","n4",o),c("n4","n3",o),c("n3","n1",o),c("f1","f2",o),c("f2","f4",o),c("f4","f3",o),c("f3","f1",o),c("n1","f1",o),c("n2","f2",o),c("n3","f3",o),c("n4","f4",o),c("p","n1",s),c("p","n2",s),c("p","n3",s),c("p","n4",s),c("u1","u2",l),c("u2","u3",l),c("u3","u1",l),c("c","t",u),c("p","c",h),c("cn1","cn2",h),c("cn3","cn4",h),c("cf1","cf2",h),c("cf3","cf4",h),t.setAttribute("position",new Ma(r,3)),t.setAttribute("color",new Ma(i,3)),Jc.call(this,t,n),this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}function Vv(e,t,n,r,i,a,o){Uv.set(i,a,o).unproject(r);var s=t[e];if(void 0!==s)for(var l=n.getAttribute("position"),u=0,h=s.length;u<h;u++)l.setXYZ(s[u],Uv.x,Uv.y,Uv.z)}Gv.prototype=(0,T.default)(Jc.prototype),Gv.prototype.constructor=Gv,Gv.prototype.update=function(){var e=this.geometry,t=this.pointMap,n=1,r=1;zv.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Vv("c",t,e,zv,0,0,-1),Vv("t",t,e,zv,0,0,1),Vv("n1",t,e,zv,-n,-r,-1),Vv("n2",t,e,zv,n,-r,-1),Vv("n3",t,e,zv,-n,r,-1),Vv("n4",t,e,zv,n,r,-1),Vv("f1",t,e,zv,-n,-r,1),Vv("f2",t,e,zv,n,-r,1),Vv("f3",t,e,zv,-n,r,1),Vv("f4",t,e,zv,n,r,1),Vv("u1",t,e,zv,.7*n,1.1*r,-1),Vv("u2",t,e,zv,.7*-n,1.1*r,-1),Vv("u3",t,e,zv,0,2*r,-1),Vv("cf1",t,e,zv,-n,0,1),Vv("cf2",t,e,zv,n,0,1),Vv("cf3",t,e,zv,0,-r,1),Vv("cf4",t,e,zv,0,r,1),Vv("cn1",t,e,zv,-n,0,-1),Vv("cn2",t,e,zv,n,0,-1),Vv("cn3",t,e,zv,0,-r,-1),Vv("cn4",t,e,zv,0,r,-1),e.getAttribute("position").needsUpdate=!0};var Hv=new Ri;function jv(e,t){this.object=e,void 0===t&&(t=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new Ca;i.setIndex(new ma(n,1)),i.setAttribute("position",new ma(r,3)),Jc.call(this,i,new Gc({color:t,toneMapped:!1})),this.matrixAutoUpdate=!1,this.update()}function Wv(e,t){this.type="Box3Helper",this.box=e,t=t||16776960;var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],i=new Ca;i.setIndex(new ma(n,1)),i.setAttribute("position",new Ma(r,3)),Jc.call(this,i,new Gc({color:t,toneMapped:!1})),this.geometry.computeBoundingSphere()}function Yv(e,t,n){this.type="PlaneHelper",this.plane=e,this.size=void 0===t?1:t;var r=void 0!==n?n:16776960,i=[1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],a=new Ca;a.setAttribute("position",new Ma(i,3)),a.computeBoundingSphere(),qc.call(this,a,new Gc({color:r,toneMapped:!1}));var o=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],s=new Ca;s.setAttribute("position",new Ma(o,3)),s.computeBoundingSphere(),this.add(new Qa(s,new fa({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}jv.prototype=(0,T.default)(Jc.prototype),jv.prototype.constructor=jv,jv.prototype.update=function(e){var t,n,r,i;void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Hv.setFromObject(this.object),Hv.isEmpty()||(t=Hv.min,n=Hv.max,r=this.geometry.attributes.position,i=r.array,i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere())},jv.prototype.setFromObject=function(e){return this.object=e,this.update(),this},jv.prototype.copy=function(e){return Jc.prototype.copy.call(this,e),this.object=e.object,this},jv.prototype.clone=function(){return(new this.constructor).copy(this)},Wv.prototype=(0,T.default)(Jc.prototype),Wv.prototype.constructor=Wv,Wv.prototype.updateMatrixWorld=function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),mi.prototype.updateMatrixWorld.call(this,e))},Yv.prototype=(0,T.default)(qc.prototype),Yv.prototype.constructor=Yv,Yv.prototype.updateMatrixWorld=function(e){var t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?Xe:Y,this.lookAt(this.plane.normal),mi.prototype.updateMatrixWorld.call(this,e)};var qv,Xv,Zv=new Hr;function Jv(e,t,n,r,i,a){mi.call(this),void 0===e&&(e=new Hr(0,0,1)),void 0===t&&(t=new Hr(0,0,0)),void 0===n&&(n=1),void 0===r&&(r=16776960),void 0===i&&(i=.2*n),void 0===a&&(a=.2*i),void 0===qv&&(qv=new Ca,qv.setAttribute("position",new Ma([0,0,0,0,1,0],3)),Xv=new Tf(0,.5,1,5,1),Xv.translate(0,-.5,0)),this.position.copy(t),this.line=new qc(qv,new Gc({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Qa(Xv,new fa({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,a)}function Kv(e){e=e||1;var t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new Ca;r.setAttribute("position",new Ma(t,3)),r.setAttribute("color",new Ma(n,3));var i=new Gc({vertexColors:!0,toneMapped:!1});Jc.call(this,r,i)}Jv.prototype=(0,T.default)(mi.prototype),Jv.prototype.constructor=Jv,Jv.prototype.setDirection=function(e){var t;.99999<e.y?this.quaternion.set(0,0,0,1):e.y<-.99999?this.quaternion.set(1,0,0,0):(Zv.set(e.z,0,-e.x).normalize(),t=Math.acos(e.y),this.quaternion.setFromAxisAngle(Zv,t))},Jv.prototype.setLength=function(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},Jv.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},Jv.prototype.copy=function(e){return mi.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},Jv.prototype.clone=function(){return(new this.constructor).copy(this)},Kv.prototype=(0,T.default)(Jc.prototype),Kv.prototype.constructor=Kv;var Qv=4,$v=8,eg=Math.pow(2,$v),tg=[.125,.215,.35,.446,.526,.582],ng=$v-Qv+1+tg.length,rg=20,ig=(a={},(0,pe.default)(a,jn,0),(0,pe.default)(a,Wn,1),(0,pe.default)(a,qn,2),(0,pe.default)(a,Zn,3),(0,pe.default)(a,Jn,4),(0,pe.default)(a,Kn,5),(0,pe.default)(a,Yn,6),a),ag=new Qp,og=Ng(rg),sg=null,lg=null,ug=xg(),hg=ug._lodPlanes,cg=ug._sizeLods,dg=ug._sigmas,fg=null,pg=null,mg=null,vg=(1+Math.sqrt(5))/2,gg=1/vg,yg=[new Hr(1,1,1),new Hr(-1,1,1),new Hr(1,1,-1),new Hr(-1,1,-1),new Hr(0,vg,gg),new Hr(0,vg,-gg),new Hr(gg,0,vg),new Hr(-gg,0,vg),new Hr(vg,gg,0),new Hr(-vg,gg,0)];function _g(e){pg=e,Sg(og)}function xg(){for(var e=[],t=[],n=[],r=$v,i=0;i<ng;i++){var a=Math.pow(2,r);t.push(a);var o=1/a;$v-Qv<i?o=tg[i-$v+Qv-1]:0==i&&(o=0),n.push(o);for(var s=1/(a-1),l=-s/2,u=1+s/2,h=[l,l,u,l,u,u,l,l,u,u,l,u],c=6,d=6,f=3,p=2,m=1,v=new Float32Array(f*d*c),g=new Float32Array(p*d*c),y=new Float32Array(m*d*c),_=0;_<c;_++){var x=_%3*2/3-1,w=2<_?0:-1,b=[x,w,0,x+2/3,w,0,x+2/3,w+1,0,x,w,0,x+2/3,w+1,0,x,w+1,0];v.set(b,f*d*_),g.set(h,p*d*_);var M=[_,_,_,_,_,_];y.set(M,m*d*_)}var T=new Ca;T.setAttribute("position",new ma(v,f)),T.setAttribute("uv",new ma(g,p)),T.setAttribute("faceIndex",new ma(y,m)),e.push(T),Qv<r&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}function wg(e){var t={magFilter:ut,minFilter:ut,generateMipmaps:!1,type:e?e.type:_t,format:e?e.format:Ot,encoding:e?e.encoding:qn,depthBuffer:!1,stencilBuffer:!1},n=Eg(t);return n.depthBuffer=!e,fg=Eg(t),n}function bg(e){fg.dispose(),pg.setRenderTarget(mg),e.scissorTest=!1,e.setSize(e.width,e.height)}function Mg(e,t,n,r){var i=90,a=1,o=new vo(i,a,t,n),s=[1,1,1,1,-1,1],l=[1,1,-1,-1,-1,1],u=pg.outputEncoding,h=pg.toneMapping,c=pg.toneMappingExposure,d=pg.getClearColor(),f=pg.getClearAlpha();pg.toneMapping=nt,pg.toneMappingExposure=1,pg.outputEncoding=jn,e.scale.z*=-1;var p,m,v,g=e.background;g&&g.isColor&&(g.convertSRGBToLinear(),p=Math.max(g.r,g.g,g.b),m=Math.min(Math.max(Math.ceil((0,x.default)(p)),-128),127),g=g.multiplyScalar(Math.pow(2,-m)),v=(m+128)/255,pg.setClearColor(g,v),e.background=null);for(var y=0;y<6;y++){var _=y%3;0==_?(o.up.set(0,s[y],0),o.lookAt(l[y],0,0)):1==_?(o.up.set(0,0,s[y]),o.lookAt(0,l[y],0)):(o.up.set(0,s[y],0),o.lookAt(0,0,l[y])),Ag(r,_*eg,2<y?eg:0,eg,eg),pg.setRenderTarget(r),pg.render(e,o)}pg.toneMapping=h,pg.toneMappingExposure=c,pg.outputEncoding=u,pg.setClearColor(d,f),e.scale.z*=-1}function Tg(e,t){var n=new vi;e.isCubeTexture?null==lg&&(lg=Pg()):null==sg&&(sg=kg());var r=e.isCubeTexture?lg:sg;n.add(new Qa(hg[0],r));var i=r.uniforms;i.envMap.value=e,e.isCubeTexture||i.texelSize.value.set(1/e.image.width,1/e.image.height),i.inputEncoding.value=ig[e.encoding],i.outputEncoding.value=ig[e.encoding],Ag(t,0,0,3*eg,2*eg),pg.setRenderTarget(t),pg.render(n,ag)}function Sg(e){var t=new vi;t.add(new Qa(hg[0],e)),pg.compile(t,ag)}function Eg(e){var t=new Br(3*eg,3*eg,e);return t.texture.mapping=it,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function Ag(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function Ig(e){var t=pg.autoClear;pg.autoClear=!1;for(var n=1;n<ng;n++){var r=Math.sqrt(dg[n]*dg[n]-dg[n-1]*dg[n-1]),i=yg[(n-1)%yg.length];Lg(e,n-1,n,r,i)}pg.autoClear=t}function Lg(e,t,n,r,i){Rg(e,fg,t,n,r,"latitudinal",i),Rg(fg,e,n,n,r,"longitudinal",i)}function Rg(e,t,n,r,i,a,o){"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");var s=3,l=new vi;l.add(new Qa(hg[r],og));var u,h,c=og.uniforms,d=cg[n]-1,f=isFinite(i)?Math.PI/(2*d):2*Math.PI/(2*rg-1),p=i/f,m=isFinite(i)?1+Math.floor(s*p):rg;rg<m&&console.warn((0,ie.default)(u=(0,ie.default)(h="sigmaRadians, ".concat(i,", is too large and will clip, as it requested ")).call(h,m," samples when the maximum is set to ")).call(u,rg));for(var v=[],g=0,y=0;y<rg;++y){var _=y/p,x=Math.exp(-_*_/2);v.push(x),0==y?g+=x:y<m&&(g+=2*x)}for(y=0;y<v.length;y++)v[y]=v[y]/g;c.envMap.value=e.texture,c.samples.value=m,c.weights.value=v,c.latitudinal.value="latitudinal"===a,o&&(c.poleAxis.value=o),c.dTheta.value=f,c.mipInt.value=$v-n,c.inputEncoding.value=ig[e.texture.encoding],c.outputEncoding.value=ig[e.texture.encoding];var w=cg[r],_=3*Math.max(0,eg-2*w),b=(0===r?0:2*eg)+2*w*($v-Qv<r?r-$v+Qv:0);Ag(t,_,b,3*w,2*w),pg.setRenderTarget(t),pg.render(l,ag)}function Ng(e){var t=new Float32Array(e),n=new Hr(0,1,0),r=new Nf({defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:t},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n},inputEncoding:{value:ig[jn]},outputEncoding:{value:ig[jn]}},vertexShader:Cg(),fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n\n".concat(Dg(),"\n\n#define ENVMAP_TYPE_CUBE_UV\n#include <cube_uv_reflection_fragment>\n\nvec3 getSample(float theta, vec3 axis) {\n\tfloat cosTheta = cos(theta);\n\t// Rodrigues' axis-angle rotation\n\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t+ cross(axis, vOutputDirection) * sin(theta)\n\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\treturn bilinearCubeUV(envMap, sampleDirection, mipInt);\n}\n\nvoid main() {\n\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\tif (all(equal(axis, vec3(0.0))))\n\t\taxis = vec3(vOutputDirection.z, 0.0, - vOutputDirection.x);\n\taxis = normalize(axis);\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb += weights[0] * getSample(0.0, axis);\n\tfor (int i = 1; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfloat theta = dTheta * float(i);\n\t\tgl_FragColor.rgb += weights[i] * getSample(-1.0 * theta, axis);\n\t\tgl_FragColor.rgb += weights[i] * getSample(theta, axis);\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t"),blending:we,depthTest:!1,depthWrite:!1});return r.type="SphericalGaussianBlur",r}function kg(){var e=new kr(1,1),t=new Nf({uniforms:{envMap:{value:null},texelSize:{value:e},inputEncoding:{value:ig[jn]},outputEncoding:{value:ig[jn]}},vertexShader:Cg(),fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform vec2 texelSize;\n\n".concat(Dg(),"\n\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tvec3 outputDirection = normalize(vOutputDirection);\n\tvec2 uv;\n\tuv.y = asin(clamp(outputDirection.y, -1.0, 1.0)) * RECIPROCAL_PI + 0.5;\n\tuv.x = atan(outputDirection.z, outputDirection.x) * RECIPROCAL_PI2 + 0.5;\n\tvec2 f = fract(uv / texelSize - 0.5);\n\tuv -= f * texelSize;\n\tvec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x += texelSize.x;\n\tvec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.y += texelSize.y;\n\tvec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x -= texelSize.x;\n\tvec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tvec3 tm = mix(tl, tr, f.x);\n\tvec3 bm = mix(bl, br, f.x);\n\tgl_FragColor.rgb = mix(tm, bm, f.y);\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t"),blending:we,depthTest:!1,depthWrite:!1});return t.type="EquirectangularToCubeUV",t}function Pg(){var e=new Nf({uniforms:{envMap:{value:null},inputEncoding:{value:ig[jn]},outputEncoding:{value:ig[jn]}},vertexShader:Cg(),fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform samplerCube envMap;\n\n".concat(Dg(),"\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb = envMapTexelToLinear(textureCube(envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ))).rgb;\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t"),blending:we,depthTest:!1,depthWrite:!1});return e.type="CubemapToCubeUV",e}function Cg(){return"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t"}function Dg(){return"\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t"}function Og(e,t,n,r,i,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new ha(e,t,n,i,a,o)}_g.prototype={constructor:_g,fromScene:function(e,t,n,r){var i=1<arguments.length&&void 0!==t?arguments[1]:0,a=2<arguments.length&&void 0!==n?arguments[2]:.1,o=3<arguments.length&&void 0!==r?arguments[3]:100;mg=pg.getRenderTarget();var s=wg();return Mg(e,a,o,s),0<i&&Lg(s,0,0,i),Ig(s),bg(s),s},fromEquirectangular:function(e){return e.magFilter=ut,e.minFilter=ut,e.generateMipmaps=!1,this.fromCubemap(e)},fromCubemap:function(e){mg=pg.getRenderTarget();var t=wg(e);return Tg(e,t),Ig(t),bg(t),t},compileCubemapShader:function(){null==lg&&(lg=Pg(),Sg(lg))},compileEquirectangularShader:function(){null==sg&&(sg=kg(),Sg(sg))},dispose:function(){og.dispose(),null!=lg&&lg.dispose(),null!=sg&&sg.dispose();for(var e=0;e<hg.length;e++)hg[e].dispose()}};var Fg=0;t.LineStrip=Fg;var Bg=1;t.LinePieces=Bg;var Ug=0;t.NoColors=Ug;var zg=1;t.FaceColors=zg;var Gg=2;function Vg(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e}function Hg(e){return void 0===e&&(e=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return(0,E.default)(e).call(e)},e}function jg(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new rd(e,t)}function Wg(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Ec(e)}function Yg(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new rd(e,t)}function qg(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new Qc(e)}function Xg(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new Qc(e)}function Zg(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new Qc(e)}function Jg(e,t,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new Hr(e,t,n)}function Kg(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new ma(e,t).setUsage(_r)}function Qg(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new va(e,t)}function $g(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new ga(e,t)}function ey(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new ya(e,t)}function ty(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new _a(e,t)}function ny(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new xa(e,t)}function ry(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new wa(e,t)}function iy(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new ba(e,t)}function ay(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Ma(e,t)}function oy(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Ta(e,t)}function sy(e){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Mp.call(this,e),this.type="catmullrom",this.closed=!0}function ly(e){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Mp.call(this,e),this.type="catmullrom"}function uy(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Mp.call(this,e),this.type="catmullrom"}function hy(e){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Kv(e)}function cy(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new jv(e,t)}function dy(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new Jc(new bf(e.geometry),new Gc({color:void 0!==t?t:16777215}))}function fy(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new Jc(new ud(e.geometry),new Gc({color:void 0!==t?t:16777215}))}function py(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new lp(e)}function my(e){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new cp(e)}function vy(e,t,n){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new xo(e,n)}t.VertexColors=Gg,mp.create=function(e,t){return e.prototype=(0,T.default)(mp.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},(0,qe.default)(Vp.prototype,{createPointsGeometry:function(e){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var t=new ao,n=0,r=e.length;n<r;n++){var i=e[n];t.vertices.push(new Hr(i.x,i.y,i.z||0))}return t}}),(0,qe.default)(Hp.prototype,{fromPoints:function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),sy.prototype=(0,T.default)(Mp.prototype),ly.prototype=(0,T.default)(Mp.prototype),uy.prototype=(0,T.default)(Mp.prototype),(0,qe.default)(uy.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),Pv.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Av.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},(0,qe.default)(op.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),im.extractUrlBase(e)}}),op.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},(0,qe.default)(um.prototype,{setTexturePath:function(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}),(0,qe.default)(vv.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),(0,qe.default)(Ri.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),To.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},_v.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},(0,qe.default)(Nr,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),Nr.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),Nr.ceilPowerOfTwo(e)}}),(0,qe.default)(Pr.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),(0,qe.default)(Kr.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new Hr).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,r,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,a)}}),Wi.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},zr.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},(0,qe.default)(Gi.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),(0,qe.default)(na.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),(0,qe.default)(na,{barycoordFromPoint:function(e,t,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),na.getBarycoord(e,t,n,r,i)},normal:function(e,t,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),na.getNormal(e,t,n,r)}}),(0,qe.default)(jp.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new sf(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new _f(this,e)}}),(0,qe.default)(kr.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),(0,qe.default)(Hr.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),(0,qe.default)(Fr.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),(0,qe.default)(ao.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),(0,qe.default)(mi.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),(0,S.default)(mi.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),(0,qe.default)(Qa.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),(0,S.default)(Qa.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),Gn},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),(0,S.default)(Rc.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),(0,R.default)(Cc.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Nc.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},(0,R.default)(mp.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),vo.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},(0,S.default)(Wp.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),(0,S.default)(ma.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===_r},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(_r)}}}),(0,qe.default)(ma.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?_r:yr),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),(0,qe.default)(Ca.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addAttribute:function(e,t,n){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new ma(arguments[1],n)))},addDrawCall:function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},applyMatrix:function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),(0,S.default)(Ca.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),(0,S.default)(hv.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(e){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=e}}}),(0,S.default)(uc.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===_r},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),(0,qe.default)(uc.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?_r:yr),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),(0,qe.default)(lf.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),(0,S.default)(lv.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),(0,S.default)(da.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new oa}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=e===q}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),(0,S.default)(Cf.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),(0,S.default)(po.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),(0,qe.default)(oc.prototype,{clearTarget:function(e,t,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,r)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),(0,S.default)(oc.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?Wn:jn}}}),(0,S.default)($h.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),(0,S.default)(Br.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),(0,M.default)(this.texture)},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),(0,S.default)(Dm.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this,n=new wm;return n.load(e,function(e){t.setBuffer(e)}),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),Gm.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},_o.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)};var gy={merge:function(e,t,n){var r;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),t.isMesh&&(t.matrixAutoUpdate&&t.updateMatrix(),r=t.matrix,t=t.geometry),e.merge(t,r,n)},center:function(e){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),e.center()}};function yy(){console.error("THREE.CanvasRenderer has been removed")}function _y(){console.error("THREE.JSONLoader has been removed.")}t.GeometryUtils=gy,Cr.crossOrigin=void 0,Cr.loadTexture=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new pp;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},Cr.loadTextureCube=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new fp;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},Cr.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Cr.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var xy={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};function wy(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")}t.SceneUtils=xy,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:C}}))},function(e,t,n){e.exports=n(273)},function(e,t,n){var r=n(274);e.exports=r},function(e,t,n){n(275);var r=n(11);e.exports=r.Math.log2},function(e,t,n){var r=n(8),i=Math.log,a=Math.LN2;r({target:"Math",stat:!0},{log2:function(e){return i(e)/a}})},function(e,t,n){var r=n(277);e.exports=r},function(e,t,n){var r=n(278),i=Function.prototype;e.exports=function(e){var t=e.bind;return e===i||e instanceof Function&&t===i.bind?r:t}},function(e,t,n){n(279);var r=n(24);e.exports=r("Function").bind},function(e,t,n){var r=n(8),i=n(167);r({target:"Function",proto:!0},{bind:i})},function(e,t,n){var r=n(168);e.exports=r},function(e,t,n){var l=n(73),u=n(82),r=function(s){return function(e,t){var n,r,i=String(u(e)),a=l(t),o=i.length;return a<0||o<=a?s?"":void 0:(n=i.charCodeAt(a),n<55296||56319<n||a+1===o||(r=i.charCodeAt(a+1))<56320||57343<r?s?i.charAt(a):n:s?i.slice(a,a+2):r-56320+(n-55296<<10)+65536)}};e.exports={codeAt:r(!1),charAt:r(!0)}},function(e,t,n){var r=n(19),i=n(43);e.exports=function(t,n){try{i(r,t,n)}catch(e){r[t]=n}return n}},function(e,t,n){"use strict";var i=n(172).IteratorPrototype,a=n(84),o=n(81),s=n(58),l=n(59),u=function(){return this};e.exports=function(e,t,n){var r=t+" Iterator";return e.prototype=a(i,{next:o(1,n)}),s(e,r,!1,!0),l[r]=u,e}},function(e,t,n){"use strict";var r=n(124),i=n(53);e.exports=r?{}.toString:function(){return"[object "+i(this)+"]"}},function(e,t,n){var r=n(23);e.exports=function(e){if(!r(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},function(e,t,n){var r=n(8),i=n(287),a=n(182),o=!a(function(e){Array.from(e)});r({target:"Array",stat:!0,forced:o},{from:i})},function(e,t,n){"use strict";var v=n(72),g=n(38),y=n(180),_=n(181),x=n(44),w=n(86),b=n(104);e.exports=function(e,t,n){var r,i,a,o,s,l,u=g(e),h="function"==typeof this?this:Array,c=arguments.length,d=1<c?t:void 0,f=void 0!==d,p=b(u),m=0;if(f&&(d=v(d,2<c?n:void 0,2)),null==p||h==Array&&_(p))for(r=x(u.length),i=new h(r);m<r;m++)l=f?d(u[m],m):u[m],w(i,m,l);else for(o=p.call(u),s=o.next,i=new h;!(a=s.call(o)).done;m++)l=f?y(o,d,[a.value,m],!0):a.value,w(i,m,l);return i.length=m,i}},function(e,t,n){e.exports=n(289)},function(e,t,n){var r=n(290);e.exports=r},function(e,t,n){var r=n(291),i=Array.prototype;e.exports=function(e){var t=e.lastIndexOf;return e===i||e instanceof Array&&t===i.lastIndexOf?r:t}},function(e,t,n){n(292);var r=n(24);e.exports=r("Array").lastIndexOf},function(e,t,n){var r=n(8),i=n(293);r({target:"Array",proto:!0,forced:i!==[].lastIndexOf},{lastIndexOf:i})},function(e,t,n){"use strict";var a=n(42),o=n(73),s=n(44),r=n(87),i=n(51),l=Math.min,u=[].lastIndexOf,h=!!u&&1/[1].lastIndexOf(1,-0)<0,c=r("lastIndexOf"),d=i("indexOf",{ACCESSORS:!0,1:0}),f=h||!c||!d;e.exports=f?function(e,t){if(h)return u.apply(this,arguments)||0;var n=a(this),r=s(n.length),i=r-1;for(1<arguments.length&&(i=l(i,o(t))),i<0&&(i=r+i);0<=i;i--)if(i in n&&n[i]===e)return i||0;return-1}:u},function(e,t,n){n(183);var r=n(11);e.exports=r.setTimeout},function(e,t,n){n(40);var r=n(297),i=n(53),a=Array.prototype,o={DOMTokenList:!0,NodeList:!0};e.exports=function(e){var t=e.keys;return e===a||e instanceof Array&&t===a.keys||o.hasOwnProperty(i(e))?r:t}},function(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(e,t,n){var r=n(298);e.exports=r},function(e,t,n){n(105);var r=n(24);e.exports=r("Array").keys},function(e,t,n){n(40);var r=n(300),i=n(53),a=Array.prototype,o={DOMTokenList:!0,NodeList:!0};e.exports=function(e){var t=e.values;return e===a||e instanceof Array&&t===a.values||o.hasOwnProperty(i(e))?r:t}},function(e,t,n){var r=n(301);e.exports=r},function(e,t,n){n(105);var r=n(24);e.exports=r("Array").values},function(e,t,n){e.exports=n(303)},function(e,t,n){var r=n(304);e.exports=r},function(e,t,n){n(305);var r=n(11);e.exports=r.Object.freeze},function(e,t,n){var r=n(8),i=n(184),a=n(16),o=n(23),s=n(88).onFreeze,l=Object.freeze,u=a(function(){l(1)});r({target:"Object",stat:!0,forced:u,sham:!i},{freeze:function(e){return l&&o(e)?l(s(e)):e}})},function(e,t,n){var r=n(307);e.exports=r},function(e,t,n){var r=n(308),i=Array.prototype;e.exports=function(e){var t=e.concat;return e===i||e instanceof Array&&t===i.concat?r:t}},function(e,t,n){n(185);var r=n(24);e.exports=r("Array").concat},function(e,t,n){var r=n(310);e.exports=r},function(e,t,n){var r=n(311),i=Array.prototype;e.exports=function(e){var t=e.reverse;return e===i||e instanceof Array&&t===i.reverse?r:t}},function(e,t,n){n(312);var r=n(24);e.exports=r("Array").reverse},function(e,t,n){"use strict";var r=n(8),i=n(76),a=[].reverse,o=[1,2];r({target:"Array",proto:!0,forced:String(o)===String(o.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),a.call(this)}})},function(e,t,n){n(40);var r=n(314),i=n(53),a=Array.prototype,o={DOMTokenList:!0,NodeList:!0};e.exports=function(e){var t=e.forEach;return e===a||e instanceof Array&&t===a.forEach||o.hasOwnProperty(i(e))?r:t}},function(e,t,n){var r=n(315);e.exports=r},function(e,t,n){n(316);var r=n(24);e.exports=r("Array").forEach},function(e,t,n){"use strict";var r=n(8),i=n(317);r({target:"Array",proto:!0,forced:[].forEach!=i},{forEach:i})},function(e,t,n){"use strict";var r=n(61).forEach,i=n(87),a=n(51),o=i("forEach"),s=a("forEach");e.exports=o&&s?[].forEach:function(e,t){return r(this,e,1<arguments.length?t:void 0)}},function(e,t,n){var r=n(319);e.exports=r},function(e,t,n){n(320),n(108),n(57),n(40);var r=n(11);e.exports=r.Map},function(e,t,n){"use strict";var r=n(187),i=n(321);e.exports=r("Map",function(t){return function(e){return t(this,arguments.length?e:void 0)}},i)},function(e,t,n){"use strict";var u=n(39).f,h=n(84),c=n(107),d=n(72),f=n(106),p=n(90),o=n(120),s=n(188),m=n(29),v=n(88).fastKey,r=n(52),g=r.set,y=r.getterFor;e.exports={getConstructor:function(e,n,r,i){var a=e(function(e,t){f(e,a,n),g(e,{type:n,index:h(null),first:void 0,last:void 0,size:0}),m||(e.size=0),null!=t&&p(t,e[i],e,r)}),s=y(n),o=function(e,t,n){var r,i,a=s(e),o=l(e,t);return o?o.value=n:(a.last=o={index:i=v(t,!0),key:t,value:n,previous:r=a.last,next:void 0,removed:!1},a.first||(a.first=o),r&&(r.next=o),m?a.size++:e.size++,"F"!==i&&(a.index[i]=o)),e},l=function(e,t){var n,r=s(e),i=v(t);if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key==t)return n};return c(a.prototype,{clear:function(){for(var e=this,t=s(e),n=t.index,r=t.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete n[r.index],r=r.next;t.first=t.last=void 0,m?t.size=0:e.size=0},delete:function(e){var t,n,r=this,i=s(r),a=l(r,e);return a&&(t=a.next,n=a.previous,delete i.index[a.index],a.removed=!0,n&&(n.next=t),t&&(t.previous=n),i.first==a&&(i.first=t),i.last==a&&(i.last=n),m?i.size--:r.size--),!!a},forEach:function(e,t){for(var n,r=s(this),i=d(e,1<arguments.length?t:void 0,3);n=n?n.next:r.first;)for(i(n.value,n.key,this);n&&n.removed;)n=n.previous},has:function(e){return!!l(this,e)}}),c(a.prototype,r?{get:function(e){var t=l(this,e);return t&&t.value},set:function(e,t){return o(this,0===e?0:e,t)}}:{add:function(e){return o(this,e=0===e?0:e,e)}}),m&&u(a.prototype,"size",{get:function(){return s(this).size}}),a},setStrong:function(e,t,n){var r=t+" Iterator",i=y(t),a=y(r);o(e,t,function(e,t){g(this,{type:r,target:e,state:i(e),kind:t,last:void 0})},function(){for(var e=a(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?"keys"==t?{value:n.key,done:!1}:"values"==t?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})},n?"entries":"values",!n,!0),s(t)}}},function(e,t,n){e.exports=n(323)},function(e,t,n){var r=n(324);e.exports=r},function(e,t,n){n(189),n(57),n(40);var r=n(130);e.exports=r.f("iterator")},function(e,t,n){var r=n(191);n(341),n(342),n(343),n(344),n(345),e.exports=r},function(e,t,n){var r=n(26);r("asyncIterator")},function(){},function(e,t,n){var r=n(26);r("hasInstance")},function(e,t,n){var r=n(26);r("isConcatSpreadable")},function(e,t,n){var r=n(26);r("match")},function(e,t,n){var r=n(26);r("matchAll")},function(e,t,n){var r=n(26);r("replace")},function(e,t,n){var r=n(26);r("search")},function(e,t,n){var r=n(26);r("species")},function(e,t,n){var r=n(26);r("split")},function(e,t,n){var r=n(26);r("toPrimitive")},function(e,t,n){var r=n(26);r("toStringTag")},function(e,t,n){var r=n(26);r("unscopables")},function(e,t,n){var r=n(58);r(Math,"Math",!0)},function(e,t,n){var r=n(19),i=n(58);i(r.JSON,"JSON",!0)},function(e,t,n){var r=n(26);r("asyncDispose")},function(e,t,n){var r=n(26);r("dispose")},function(e,t,n){var r=n(26);r("observable")},function(e,t,n){var r=n(26);r("patternMatch")},function(e,t,n){var r=n(26);r("replaceAll")},function(e,t,n){var r=n(164);e.exports=r},function(e,t,n){var r=n(348);e.exports=r},function(e,t,n){var r=n(349),i=Array.prototype;e.exports=function(e){var t=e.filter;return e===i||e instanceof Array&&t===i.filter?r:t}},function(e,t,n){n(350);var r=n(24);e.exports=r("Array").filter},function(e,t,n){"use strict";var r=n(8),i=n(61).filter,a=n(89),o=n(51),s=a("filter"),l=o("filter");r({target:"Array",proto:!0,forced:!s||!l},{filter:function(e,t){return i(this,e,1<arguments.length?t:void 0)}})},function(e,t,n){e.exports=n(352)},function(e,t,n){var r=n(353);e.exports=r},function(e,t,n){var r=n(354),i=String.prototype;e.exports=function(e){var t=e.trim;return"string"==typeof e||e===i||e instanceof String&&t===i.trim?r:t}},function(e,t,n){n(355);var r=n(24);e.exports=r("String").trim},function(e,t,n){"use strict";var r=n(8),i=n(134).trim,a=n(356);r({target:"String",proto:!0,forced:a("trim")},{trim:function(){return i(this)}})},function(e,t,n){var r=n(16),i=n(109),a="​…᠎";e.exports=function(e){return r(function(){return!!i[e]()||a[e]()!=a||i[e].name!==e})}},function(e,t,n){var r=n(358);e.exports=r},function(e,t,n){n(108),n(359),n(40);var r=n(11);e.exports=r.WeakMap},function(e,t,n){"use strict";var r,i,a,o,s,l,u=n(19),h=n(107),c=n(88),d=n(187),f=n(360),p=n(23),m=n(52).enforce,v=n(169),g=!u.ActiveXObject&&"ActiveXObject"in u,y=Object.isExtensible,_=function(t){return function(e){return t(this,arguments.length?e:void 0)}},x=e.exports=d("WeakMap",_,f);v&&g&&(r=f.getConstructor(_,"WeakMap",!0),c.REQUIRED=!0,i=x.prototype,a=i.delete,o=i.has,s=i.get,l=i.set,h(i,{delete:function(e){if(!p(e)||y(e))return a.call(this,e);var t=m(this);return t.frozen||(t.frozen=new r),a.call(this,e)||t.frozen.delete(e)},has:function(e){if(!p(e)||y(e))return o.call(this,e);var t=m(this);return t.frozen||(t.frozen=new r),o.call(this,e)||t.frozen.has(e)},get:function(e){if(!p(e)||y(e))return s.call(this,e);var t=m(this);return t.frozen||(t.frozen=new r),o.call(this,e)?s.call(this,e):t.frozen.get(e)},set:function(e,t){var n;return p(e)&&!y(e)?(n=m(this),n.frozen||(n.frozen=new r),o.call(this,e)?l.call(this,e,t):n.frozen.set(e,t)):l.call(this,e,t),this}}))},function(e,t,n){"use strict";var l=n(107),u=n(88).getWeakData,h=n(35),c=n(23),d=n(106),f=n(90),r=n(61),p=n(34),i=n(52),m=i.set,v=i.getterFor,a=r.find,o=r.findIndex,g=0,y=function(e){return e.frozen||(e.frozen=new s)},s=function(){this.entries=[]},_=function(e,t){return a(e.entries,function(e){return e[0]===t})};s.prototype={get:function(e){var t=_(this,e);if(t)return t[1]},has:function(e){return!!_(this,e)},set:function(e,t){var n=_(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(t){var e=o(this.entries,function(e){return e[0]===t});return~e&&this.entries.splice(e,1),!!~e}},e.exports={getConstructor:function(e,n,r,i){var a=e(function(e,t){d(e,a,n),m(e,{type:n,id:g++,frozen:void 0}),null!=t&&f(t,e[i],e,r)}),o=v(n),s=function(e,t,n){var r=o(e),i=u(h(t),!0);return!0===i?y(r).set(t,n):i[r.id]=n,e};return l(a.prototype,{delete:function(e){var t=o(this);if(!c(e))return!1;var n=u(e);return!0===n?y(t).delete(e):n&&p(n,t.id)&&delete n[t.id]},has:function(e){var t=o(this);if(!c(e))return!1;var n=u(e);return!0===n?y(t).has(e):n&&p(n,t.id)}}),l(a.prototype,r?{get:function(e){var t=o(this);if(c(e)){var n=u(e);return!0===n?y(t).get(e):n?n[t.id]:void 0}},set:function(e,t){return s(this,e,t)}}:{add:function(e){return s(this,e,!0)}}),a}}},function(e,t,n){var r=n(362);e.exports=r},function(e,t,n){n(363);var r=n(11);e.exports=r.Reflect.construct},function(e,t,n){var r=n(8),i=n(50),l=n(48),u=n(35),h=n(23),c=n(84),d=n(167),a=n(16),f=i("Reflect","construct"),p=a(function(){function e(){}return!(f(function(){},[],e)instanceof e)}),m=!a(function(){f(function(){})}),o=p||m;r({target:"Reflect",stat:!0,forced:o,sham:o},{construct:function(e,t,n){l(e),u(t);var r=arguments.length<3?e:l(n);if(m&&!p)return f(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var i=[null];return i.push.apply(i,t),new(d.apply(e,i))}var a=r.prototype,o=c(h(a)?a:Object.prototype),s=Function.apply.call(e,o,t);return h(s)?s:o}})},function(e,t,n){e.exports=n(365)},function(e,t,n){var r=n(196);e.exports=r},function(e,t,n){var r=n(8),i=n(29),a=n(84);r({target:"Object",stat:!0,sham:!i},{create:a})},function(n,e,t){var r=t(197);function i(e,t){return n.exports=i=r||function(e,t){return e.__proto__=t,e},i(e,t)}n.exports=i},function(e,t,n){var r=n(369);e.exports=r},function(e,t,n){n(370);var r=n(11);e.exports=r.Object.setPrototypeOf},function(e,t,n){var r=n(8),i=n(179);r({target:"Object",stat:!0},{setPrototypeOf:i})},function(e,t,n){e.exports=n(372)},function(e,t,n){var r=n(373);e.exports=r},function(e,t,n){n(374);var r=n(11);e.exports=r.Object.getPrototypeOf},function(e,t,n){var r=n(8),i=n(16),a=n(38),o=n(121),s=n(173),l=i(function(){o(1)});r({target:"Object",stat:!0,forced:l,sham:!s},{getPrototypeOf:function(e){return o(a(e))}})},function(e,t,n){var r=n(376);e.exports=r},function(e,t,n){var r=n(377),i=Array.prototype;e.exports=function(e){var t=e.sort;return e===i||e instanceof Array&&t===i.sort?r:t}},function(e,t,n){n(378);var r=n(24);e.exports=r("Array").sort},function(e,t,n){"use strict";var r=n(8),i=n(48),a=n(38),o=n(16),s=n(87),l=[],u=l.sort,h=o(function(){l.sort(void 0)}),c=o(function(){l.sort(null)}),d=s("sort"),f=h||!c||!d;r({target:"Array",proto:!0,forced:f},{sort:function(e){return void 0===e?u.call(a(this)):u.call(a(this),i(e))}})},function(e,t,n){var r=n(380);e.exports=r},function(e,t,n){n(381);var r=n(11);e.exports=r.Object.keys},function(e,t,n){var r=n(8),i=n(38),a=n(102),o=n(16),s=o(function(){a(1)});r({target:"Object",stat:!0,forced:s},{keys:function(e){return a(i(e))}})},function(e,t,n){var r=n(383);e.exports=r},function(e,t,n){var r=n(384),i=Array.prototype;e.exports=function(e){var t=e.map;return e===i||e instanceof Array&&t===i.map?r:t}},function(e,t,n){n(385);var r=n(24);e.exports=r("Array").map},function(e,t,n){"use strict";var r=n(8),i=n(61).map,a=n(89),o=n(51),s=a("map"),l=o("map");r({target:"Array",proto:!0,forced:!s||!l},{map:function(e,t){return i(this,e,1<arguments.length?t:void 0)}})},function(e,t,n){var r=n(387);e.exports=r},function(e,t,n){n(388);var r=n(11);e.exports=r.parseInt},function(e,t,n){var r=n(8),i=n(389);r({global:!0,forced:parseInt!=i},{parseInt:i})},function(e,t,n){var r=n(19),i=n(134).trim,a=n(109),o=r.parseInt,s=/^[+-]?0[Xx]/,l=8!==o(a+"08")||22!==o(a+"0x16");e.exports=l?function(e,t){var n=i(String(e));return o(n,t>>>0||(s.test(n)?16:10))}:o},function(e,t,n){var r=n(391);e.exports=r},function(e,t,n){n(392);var r=n(11);e.exports=r.parseFloat},function(e,t,n){var r=n(8),i=n(393);r({global:!0,forced:parseFloat!=i},{parseFloat:i})},function(e,t,n){var r=n(19),i=n(134).trim,a=n(109),o=r.parseFloat,s=1/o(a+"-0")!=-Infinity;e.exports=s?function(e){var t=i(String(e)),n=o(t);return 0===n&&"-"==t.charAt(0)?-0:n}:o},function(e,t,n){var r=n(395);e.exports=r},function(e,t,n){n(396);var r=n(11);r.JSON||(r.JSON={stringify:JSON.stringify}),e.exports=function(e,t,n){return r.JSON.stringify.apply(null,arguments)}},function(e,t,n){var r=n(8),i=n(50),a=n(16),o=i("JSON","stringify"),s=/[\uD800-\uDFFF]/g,l=/^[\uD800-\uDBFF]$/,u=/^[\uDC00-\uDFFF]$/,h=function(e,t,n){var r=n.charAt(t-1),i=n.charAt(t+1);return l.test(e)&&!u.test(i)||u.test(e)&&!l.test(r)?"\\u"+e.charCodeAt(0).toString(16):e},c=a(function(){return'"\\udf06\\ud834"'!==o("\udf06\ud834")||'"\\udead"'!==o("\udead")});o&&r({target:"JSON",stat:!0,forced:c},{stringify:function(e,t,n){var r=o.apply(null,arguments);return"string"==typeof r?r.replace(s,h):r}})},function(e,t,n){var r=n(198);e.exports=r},function(e,t,n){var r=n(8),i=n(76);r({target:"Array",stat:!0},{isArray:i})},function(e,t,n){var r=n(400);e.exports=r},function(e,t,n){var r=n(401),i=String.prototype;e.exports=function(e){var t=e.repeat;return"string"==typeof e||e===i||e instanceof String&&t===i.repeat?r:t}},function(e,t,n){n(402);var r=n(24);e.exports=r("String").repeat},function(e,t,n){var r=n(8),i=n(403);r({target:"String",proto:!0},{repeat:i})},function(e,t,n){"use strict";var i=n(73),a=n(82);e.exports="".repeat||function(e){var t=String(a(this)),n="",r=i(e);if(r<0||Infinity==r)throw RangeError("Wrong number of repetitions");for(;0<r;(r>>>=1)&&(t+=t))1&r&&(n+=t);return n}},function(e,t,n){var r=n(196);e.exports=r},function(e,t,n){var r=n(406);e.exports=r},function(e,t,n){n(407);var r=n(11),i=r.Object,a=e.exports=function(e,t){return i.defineProperties(e,t)};i.defineProperties.sham&&(a.sham=!0)},function(e,t,n){var r=n(8),i=n(29),a=n(175);r({target:"Object",stat:!0,forced:!i,sham:!i},{defineProperties:a})},function(e,t,n){var r=n(199);e.exports=r},function(e,t,n){n(410);var r=n(24);e.exports=r("Array").slice},function(e,t,n){"use strict";var r=n(8),u=n(23),h=n(76),c=n(103),d=n(44),f=n(42),p=n(86),i=n(25),a=n(89),o=n(51),s=a("slice"),l=o("slice",{ACCESSORS:!0,0:0,1:2}),m=i("species"),v=[].slice,g=Math.max;r({target:"Array",proto:!0,forced:!s||!l},{slice:function(e,t){var n,r,i,a=f(this),o=d(a.length),s=c(e,o),l=c(void 0===t?o:t,o);if(h(a)&&(n=a.constructor,"function"!=typeof n||n!==Array&&!h(n.prototype)?u(n)&&(n=n[m],null===n&&(n=void 0)):n=void 0,n===Array||void 0===n))return v.call(a,s,l);for(r=new(void 0===n?Array:n)(g(l-s,0)),i=0;s<l;s++,i++)s in a&&p(r,i,a[s]);return r.length=i,r}})},function(e,t,n){var r=n(412);e.exports=r},function(e,t,n){var r=n(413),i=Array.prototype;e.exports=function(e){var t=e.splice;return e===i||e instanceof Array&&t===i.splice?r:t}},function(e,t,n){n(414);var r=n(24);e.exports=r("Array").splice},function(e,t,n){"use strict";var r=n(8),d=n(103),f=n(73),p=n(44),m=n(38),v=n(128),g=n(86),i=n(89),a=n(51),o=i("splice"),s=a("splice",{ACCESSORS:!0,0:0,1:2}),y=Math.max,_=Math.min,x=9007199254740991,w="Maximum allowed length exceeded";r({target:"Array",proto:!0,forced:!o||!s},{splice:function(e,t){var n,r,i,a,o,s,l=m(this),u=p(l.length),h=d(e,u),c=arguments.length;if(0===c?n=r=0:r=1===c?(n=0,u-h):(n=c-2,_(y(f(t),0),u-h)),x<u+n-r)throw TypeError(w);for(i=v(l,r),a=0;a<r;a++)o=h+a,o in l&&g(i,a,l[o]);if(i.length=r,n<r){for(a=h;a<u-r;a++)o=a+r,s=a+n,o in l?l[s]=l[o]:delete l[s];for(a=u;u-r+n<a;a--)delete l[a-1]}else if(r<n)for(a=u-r;h<a;a--)o=a+r-1,s=a+n-1,o in l?l[s]=l[o]:delete l[s];for(a=0;a<n;a++)l[a+h]=arguments[a+2];return l.length=u-r+n,i}})},function(e,t,n){var r=n(416);e.exports=r},function(e,t,n){var r=n(417),i=Array.prototype;e.exports=function(e){var t=e.indexOf;return e===i||e instanceof Array&&t===i.indexOf?r:t}},function(e,t,n){n(418);var r=n(24);e.exports=r("Array").indexOf},function(e,t,n){"use strict";var r=n(8),i=n(177).indexOf,a=n(87),o=n(51),s=[].indexOf,l=!!s&&1/[1].indexOf(1,-0)<0,u=a("indexOf"),h=o("indexOf",{ACCESSORS:!0,1:0});r({target:"Array",proto:!0,forced:l||!u||!h},{indexOf:function(e,t){return l?s.apply(this,arguments)||0:i(this,e,1<arguments.length?t:void 0)}})},function(e,t,n){var r=n(420);e.exports=r},function(e,t,n){n(421);var r=n(11);e.exports=r.Object.assign},function(e,t,n){var r=n(8),i=n(422);r({target:"Object",stat:!0,forced:Object.assign!==i},{assign:i})},function(e,t,n){"use strict";var c=n(29),r=n(16),d=n(102),f=n(132),p=n(117),m=n(38),v=n(98),i=Object.assign,a=Object.defineProperty;e.exports=!i||r(function(){if(c&&1!==i({b:1},i(a({},"a",{enumerable:!0,get:function(){a(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=i({},e)[n]||d(i({},t)).join("")!=r})?function(e){for(var t=m(e),n=arguments.length,r=1,i=f.f,a=p.f;r<n;)for(var o,s=v(arguments[r++]),l=i?d(s).concat(i(s)):d(s),u=l.length,h=0;h<u;)o=l[h++],c&&!a.call(s,o)||(t[o]=s[o]);return t}:i},function(e,t,n){e.exports=n(424)},function(e,t,n){var r=n(425);e.exports=r},function(e,t,n){n(426);var r=n(11);e.exports=r.Math.sign},function(e,t,n){var r=n(8),i=n(427);r({target:"Math",stat:!0},{sign:i})},function(e){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},function(e,t,n){e.exports=n(429)},function(e,t,n){var r=n(430);e.exports=r},function(e,t,n){n(431);var r=n(11);e.exports=r.Number.isInteger},function(e,t,n){var r=n(8),i=n(432);r({target:"Number",stat:!0},{isInteger:i})},function(e,t,n){var r=n(23),i=Math.floor;e.exports=function(e){return!r(e)&&isFinite(e)&&i(e)===e}},function(e,t,n){var r=n(434);e.exports=r},function(e,t,n){n(435),e.exports=Math.pow(2,-52)},function(e,t,n){var r=n(8);r({target:"Number",stat:!0},{EPSILON:Math.pow(2,-52)})},function(t,e,n){(function(e){t.exports=e.TWEEN=n(437)}).call(this,n(47))},function(a,o,e){(function(t){var e,n,r=function(){this._tweens={},this._tweensAddedDuringUpdate={}};r.prototype={getAll:function(){return Object.keys(this._tweens).map(function(e){return this._tweens[e]}.bind(this))},removeAll:function(){this._tweens={}},add:function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},remove:function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},update:function(e,t){var n=Object.keys(this._tweens);if(0===n.length)return!1;for(e=void 0!==e?e:s.now();0<n.length;){this._tweensAddedDuringUpdate={};for(var r=0;r<n.length;r++){var i=this._tweens[n[r]];i&&!1===i.update(e)&&(i._isPlaying=!1,t||delete this._tweens[n[r]])}n=Object.keys(this._tweensAddedDuringUpdate)}return!0}};var i,s=new r;s.Group=r,s._nextId=0,s.nextId=function(){return s._nextId++},"undefined"==typeof self&&void 0!==t&&t.hrtime?s.now=function(){var e=t.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?s.now=self.performance.now.bind(self.performance):void 0!==Date.now?s.now=Date.now:s.now=function(){return(new Date).getTime()},s.Tween=function(e,t){this._object=e,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._repeat=0,this._repeatDelayTime=void 0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=null,this._easingFunction=s.Easing.Linear.None,this._interpolationFunction=s.Interpolation.Linear,this._chainedTweens=[],this._onStartCallback=null,this._onStartCallbackFired=!1,this._onUpdateCallback=null,this._onRepeatCallback=null,this._onCompleteCallback=null,this._onStopCallback=null,this._group=t||s,this._id=s.nextId()},s.Tween.prototype={getId:function(){return this._id},isPlaying:function(){return this._isPlaying},to:function(e,t){return this._valuesEnd=Object.create(e),void 0!==t&&(this._duration=t),this},duration:function(e){return this._duration=e,this},start:function(e){for(var t in this._group.add(this),this._isPlaying=!0,this._onStartCallbackFired=!1,this._startTime=void 0!==e?"string"==typeof e?s.now()+parseFloat(e):e:s.now(),this._startTime+=this._delayTime,this._valuesEnd){if(this._valuesEnd[t]instanceof Array){if(0===this._valuesEnd[t].length)continue;this._valuesEnd[t]=[this._object[t]].concat(this._valuesEnd[t])}void 0!==this._object[t]&&(this._valuesStart[t]=this._object[t],this._valuesStart[t]instanceof Array==0&&(this._valuesStart[t]*=1),this._valuesStartRepeat[t]=this._valuesStart[t]||0)}return this},stop:function(){return this._isPlaying&&(this._group.remove(this),this._isPlaying=!1,null!==this._onStopCallback&&this._onStopCallback(this._object),this.stopChainedTweens()),this},end:function(){return this.update(Infinity),this},stopChainedTweens:function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop()},group:function(e){return this._group=e,this},delay:function(e){return this._delayTime=e,this},repeat:function(e){return this._repeat=e,this},repeatDelay:function(e){return this._repeatDelayTime=e,this},yoyo:function(e){return this._yoyo=e,this},easing:function(e){return this._easingFunction=e,this},interpolation:function(e){return this._interpolationFunction=e,this},chain:function(){return this._chainedTweens=arguments,this},onStart:function(e){return this._onStartCallback=e,this},onUpdate:function(e){return this._onUpdateCallback=e,this},onRepeat:function(e){return this._onRepeatCallback=e,this},onComplete:function(e){return this._onCompleteCallback=e,this},onStop:function(e){return this._onStopCallback=e,this},update:function(e){var t,n,r,i,a,o;if(e<this._startTime)return!0;for(t in!1===this._onStartCallbackFired&&(null!==this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),n=(e-this._startTime)/this._duration,n=0===this._duration||1<n?1:n,r=this._easingFunction(n),this._valuesEnd)void 0!==this._valuesStart[t]&&(i=this._valuesStart[t]||0,a=this._valuesEnd[t],a instanceof Array?this._object[t]=this._interpolationFunction(a,r):("string"==typeof a&&(a="+"===a.charAt(0)||"-"===a.charAt(0)?i+parseFloat(a):parseFloat(a)),"number"==typeof a&&(this._object[t]=i+(a-i)*r)));if(null!==this._onUpdateCallback&&this._onUpdateCallback(this._object,n),1!==n)return!0;if(0<this._repeat){for(t in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)"string"==typeof this._valuesEnd[t]&&(this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(this._valuesEnd[t])),this._yoyo&&(o=this._valuesStartRepeat[t],this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=o),this._valuesStart[t]=this._valuesStartRepeat[t];return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=e+this._repeatDelayTime:this._startTime=e+this._delayTime,null!==this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}null!==this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var s=0,l=this._chainedTweens.length;s<l;s++)this._chainedTweens[s].start(this._startTime+this._duration);return!1}},s.Easing={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){return 0===e?0:1===e?1:-Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)},Out:function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin(5*(e-.1)*Math.PI)+1},InOut:function(e){return 0===e?0:1===e?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(e){return 1-s.Easing.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?.5*s.Easing.Bounce.In(2*e):.5*s.Easing.Bounce.Out(2*e-1)+.5}}},s.Interpolation={Linear:function(e,t){var n=e.length-1,r=n*t,i=Math.floor(r),a=s.Interpolation.Utils.Linear;return t<0?a(e[0],e[1],r):1<t?a(e[n],e[n-1],n-r):a(e[i],e[n<i+1?n:i+1],r-i)},Bezier:function(e,t){for(var n=0,r=e.length-1,i=Math.pow,a=s.Interpolation.Utils.Bernstein,o=0;o<=r;o++)n+=i(1-t,r-o)*i(t,o)*e[o]*a(r,o);return n},CatmullRom:function(e,t){var n=e.length-1,r=n*t,i=Math.floor(r),a=s.Interpolation.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(i=Math.floor(r=n*(1+t))),a(e[(i-1+n)%n],e[i],e[(i+1)%n],e[(i+2)%n],r-i)):t<0?e[0]-(a(e[0],e[0],e[1],e[1],-r)-e[0]):1<t?e[n]-(a(e[n],e[n],e[n-1],e[n-1],r-n)-e[n]):a(e[i?i-1:0],e[i],e[n<i+1?n:i+1],e[n<i+2?n:i+2],r-i)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=s.Interpolation.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:(i=[1],function(e){var t=1;if(i[e])return i[e];for(var n=e;1<n;n--)t*=n;return i[e]=t,t}),CatmullRom:function(e,t,n,r,i){var a=.5*(n-e),o=.5*(r-t),s=i*i,l=i*s;return(2*t-2*n+a+o)*l+(-3*t+3*n-2*a-o)*s+a*i+t}}},e=[],n=function(){return s}.apply(o,e),void 0===n||(a.exports=n)}).call(this,e(65))},function(e,t,n){"use strict";var r=n(1),i=r(n(92)),a=r(n(64)),we=r(n(15)),be=r(n(10)),Me=r(n(60)),Te=(r(n(2)),r(n(3)),r(n(136))),Se=r(n(458));fm.OrbitControls=function(e,t,n){var h,c,d,f,p,m,v,g,y,_;this.object=e,this.map=n,this.domElement=void 0!==t?t:Se.default,this.enabled=!0,this.target=new fm.Vector3,this.minDistance=0,this.maxDistance=Infinity,this.minZoom=0,this.maxZoom=Infinity,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-Infinity,this.maxAzimuthAngle=Infinity,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!1,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:fm.MOUSE.LEFT,MIDDLE:fm.MOUSE.MIDDLE,RIGHT:fm.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.rangeCenter=new fm.Vector3,this.rangeRadius=500,this.useRange=!1,this.enterCtrl=null,this.setEnterCtrl=function(e){this.enterCtrl=e},this.getPolarAngle=function(){return E.phi},this.getAzimuthalAngle=function(){return E.theta},this.setPolarAngle=function(e){E.phi=e},this.setAzimuthalAngle=function(e){E.theta=e},this.addPolarAngle=function(e){E.phi+=e},this.addAzimuthalAngle=function(e){E.theta+=e},this.panAdd=function(e){L.add(e)},this.saveState=function(){x.target0.copy(x.target),x.position0.copy(x.object.position),x.zoom0=x.object.zoom},this.reset=function(){x.target.copy(x.target0),x.object.position.copy(x.position0),x.object.zoom=x.zoom0,x.object.updateProjectionMatrix(),x.dispatchEvent(w),x.update(),T=M.NONE},this.setUpdate=function(e,t,n,r,i){h=e,c=t,d=n,f=r,p=i},this.update=(m=new fm.Vector3,v=(new fm.Quaternion).setFromUnitVectors(e.up,new fm.Vector3(0,1,0)),g=v.clone().inverse(),y=new fm.Vector3,_=new fm.Quaternion,function(){var e=x.object.position;m.copy(e).sub(x.target),m.applyQuaternion(v);var t,n,r,i,a,o,s,l,u=E.theta;return E.setFromVector3(m),E.theta=u,x.autoRotate&&T===M.NONE&&j(H()),E.theta+=A.theta,E.phi+=A.phi,"number"==typeof f&&(E.theta=f),"number"==typeof p&&(E.phi=p),"number"==typeof h&&(E.phi+=h),c&&"number"==typeof c&&(E.theta+=c),E.theta=Math.max(x.minAzimuthAngle,Math.min(x.maxAzimuthAngle,E.theta)),E.phi=Math.max(x.minPolarAngle,Math.min(x.maxPolarAngle,E.phi)),E.makeSafe(),E.radius*=I,E.radius=Math.max(x.minDistance,Math.min(x.maxDistance,E.radius)),this.useRange?(t=(new fm.Vector3).setFromMatrixPosition(x.object.matrixWorld),t.add(L),n=(new fm.Matrix4).copy(x.object.matrixWorld).setPosition(t),r=(new fm.Matrix4).getInverse(n),i=(new fm.Frustum).setFromMatrix((new fm.Matrix4).multiplyMatrices(x.object.projectionMatrix,r)),i.intersectsBox(x.viewBox)&&x.target.add(L)):x.target.add(L),m.setFromSpherical(E),m.applyQuaternion(g),d&&m.add(d),this.useRange?(a=(new fm.Vector3).setFromMatrixPosition(x.object.matrixWorld),a.add(m),o=(new fm.Matrix4).copy(x.object.matrixWorld).setPosition(a),s=(new fm.Matrix4).getInverse(o),l=(new fm.Frustum).setFromMatrix((new fm.Matrix4).multiplyMatrices(x.object.projectionMatrix,s)),l.intersectsBox(x.viewBox)&&e.copy(x.target).add(m)):e.copy(x.target).add(m),x.object.lookAt(x.target),!0===x.enableDamping?(A.theta*=1-x.dampingFactor,A.phi*=1-x.dampingFactor,L.multiplyScalar(1-x.dampingFactor)):(A.set(0,0,0),L.set(0,0,0)),h=void 0,c=void 0,d=void 0,f=void 0,p=void 0,I=1,!!(R||y.distanceToSquared(x.object.position)>S||8*(1-_.dot(x.object.quaternion))>S)&&(x.dispatchEvent(w),y.copy(x.object.position),_.copy(x.object.quaternion),R=!1,!0)}),this.dispose=function(){x.domElement.removeEventListener("contextmenu",me,!1),x.domElement.removeEventListener("mousedown",ae,!1),x.domElement.removeEventListener("wheel",he,!1),x.domElement.removeEventListener("touchstart",de,!1),x.domElement.removeEventListener("touchend",pe,!1),x.domElement.removeEventListener("touchmove",fe,!1),x.domElement.removeEventListener("mouseup",se,!1),x.domElement.removeEventListener("mousemove",le,!1),Te.default.PointerEvent&&!Te.default.TouchEvent&&(x.domElement.removeEventListener("pointerdown",ye,!1),x.domElement.removeEventListener("pointermove",_e,!1),x.domElement.removeEventListener("pointerup",xe,!1)),Se.default.removeEventListener("mousemove",oe,!1),Se.default.removeEventListener("mouseup",ue,!1),Te.default.removeEventListener("keydown",ce,!1),this.enterCtrl=void 0,this.domElement=void 0,this.object=void 0};var x=this,w={type:"change"},b={type:"start"},r={type:"end"},M={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY_PAN:4,TOUCH_PAN:5,TOUCH_DOLLY_ROTATE:6},T=M.NONE,S=1e-6,E=new fm.Spherical,A=new fm.Spherical,I=1,L=new fm.Vector3,R=!1,N=new fm.Vector2,k=new fm.Vector2,P=new fm.Vector2,C=new fm.Vector2,D=new fm.Vector2,O=(new fm.Vector2,new fm.Vector2),F=new fm.Vector2,B=new fm.Vector2,U=new fm.Vector2,z=new fm.Vector2,G=new fm.Vector2,V=new fm.Vector2;function H(){return 2*Math.PI/60/60*x.autoRotateSpeed}function i(){return Math.pow(.95,x.zoomSpeed)}function j(e){x.enterCtrl&&!x.enterCtrl.enableMapRotate||(A.theta-=e)}function W(e){x.enterCtrl&&!x.enterCtrl.enableMapIncline||(A.phi-=e)}this.rotateLeft=function(e){j(e)};var a,o,s=(a=new fm.Vector3,function(e,t){a.setFromMatrixColumn(t,0),a.multiplyScalar(-e),L.add(a)}),l=(o=new fm.Vector3,function(e,t){!0===x.screenSpacePanning?o.setFromMatrixColumn(t,1):(o.setFromMatrixColumn(t,0),o.crossVectors(x.object.up,o)),o.multiplyScalar(e),L.add(o)});this.panUp=function(e){var t=new fm.Vector3;t.y=1,t.multiplyScalar(e),L.add(t)};var u,Y=(u=new fm.Vector3,function(e,t){var n,r,i;x.enterCtrl&&!x.enterCtrl.enableMapPan||(n=x.domElement===Se.default?x.domElement.body:x.domElement,x.object.isPerspectiveCamera?(r=x.object.position,u.copy(r).sub(x.target),i=u.length(),i*=Math.tan(x.object.fov/2*Math.PI/180),s(2*e*i/n.clientHeight,x.object.matrix),l(2*t*i/n.clientHeight,x.object.matrix)):x.object.isOrthographicCamera?(s(e*(x.object.right-x.object.left)/x.object.zoom/n.clientWidth,x.object.matrix),l(t*(x.object.top-x.object.bottom)/x.object.zoom/n.clientHeight,x.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),x.enablePan=!1))});function q(e){x.enterCtrl&&!x.enterCtrl.enableMapPinch||(x.object.isPerspectiveCamera?I/=e:x.object.isOrthographicCamera?(x.object.zoom=Math.max(x.minZoom,Math.min(x.maxZoom,x.object.zoom*e)),x.object.updateProjectionMatrix(),I/=e,R=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),x.enableZoom=!1))}function X(e){x.enterCtrl&&!x.enterCtrl.enableMapPinch||(x.object.isPerspectiveCamera?I*=e:x.object.isOrthographicCamera?(x.object.zoom=Math.max(x.minZoom,Math.min(x.maxZoom,x.object.zoom/e)),x.object.updateProjectionMatrix(),R=!0,I*=e):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),x.enableZoom=!1))}function Z(e){N.set(e.clientX,e.clientY)}function J(e){U.set(e.clientX,e.clientY)}function K(e){O.set(e.clientX,e.clientY)}function Q(e){k.set(e.clientX,e.clientY),P.subVectors(k,N).multiplyScalar(x.rotateSpeed);var t=x.domElement===Se.default?x.domElement.body:x.domElement;j(2*Math.PI*P.x/t.clientHeight),W(2*Math.PI*P.y/t.clientHeight),N.copy(k)}function $(e){z.set(e.clientX,e.clientY),G.subVectors(z,U),0<G.y?q(i()):G.y<0&&X(i()),U.copy(z)}function ee(e){F.set(e.clientX,e.clientY),B.subVectors(F,O).multiplyScalar(x.panSpeed),Y(B.x,B.y),O.copy(F)}function te(){}function ne(e){e.deltaY<0?X(i()):0<e.deltaY&&q(i())}function re(e){switch(e.keyCode){case(0,Me.default)(x).UP:Y(0,x.keyPanSpeed),x.update();break;case(0,Me.default)(x).BOTTOM:Y(0,-x.keyPanSpeed),x.update();break;case(0,Me.default)(x).LEFT:Y(x.keyPanSpeed,0),x.update();break;case(0,Me.default)(x).RIGHT:Y(-x.keyPanSpeed,0),x.update()}}function ie(){}function ae(e){if(V.set(e.clientX,e.clientY,x.enabled),!1!==x.enabled){switch(e.preventDefault(),e.button){case x.mouseButtons.LEFT:if(!1===x.enablePan)return;K(e),T=M.PAN;break;case x.mouseButtons.MIDDLE:if(!1===x.enableZoom)return;J(e),T=M.DOLLY;break;case x.mouseButtons.RIGHT:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===x.enablePan)return;K(e),T=M.PAN}else{if(!1===x.enableRotate)return;Z(e),T=M.ROTATE}}T!==M.NONE&&(Se.default.addEventListener("mousemove",oe,!1),Se.default.addEventListener("mouseup",ue,!1),x.dispatchEvent(b))}}function oe(e){if(!1!==x.enabled)switch(e.preventDefault(),T){case M.ROTATE:if(!1===x.enableRotate)return;Q(e);break;case M.DOLLY:if(!1===x.enableZoom)return;$(e);break;case M.PAN:if(!1===x.enablePan)return;ee(e)}}function se(e){var t=V.distanceTo(new fm.Vector2(e.clientX,e.clientY));t<5&&x.dispatchEvent({type:"mouseup",mousePoint:{x:e.offsetX,y:e.offsetY,w:x.domElement.clientWidth,h:x.domElement.clientHeight},event:e,mouseButton:e.button})}function le(e){x.dispatchEvent({type:"mousemove",mousePoint:{x:e.offsetX,y:e.offsetY,w:x.domElement.clientWidth,h:x.domElement.clientHeight},event:e})}function ue(e){!1!==x.enabled&&(te(e),Se.default.removeEventListener("mousemove",oe,!1),Se.default.removeEventListener("mouseup",ue,!1),x.dispatchEvent(r),T=M.NONE)}function he(e){!1===x.enabled||!1===x.enableZoom||T!==M.NONE&&T!==M.ROTATE||(e.preventDefault(),e.stopPropagation(),x.dispatchEvent(b),ne(e),x.dispatchEvent(r))}function ce(e){!1!==x.enabled&&!1!==x.enableKeys&&!1!==x.enablePan&&re(e)}function de(e){if(!1!==x.enabled){switch(e.preventDefault(),(0,be.default)(x)&&(0,be.default)(x).eventTransform&&(e=(0,be.default)(x).eventTransform(e)),V.set(e.changedTouches[0].pageX,e.changedTouches[0].pageY),e.touches.length){case 1:var t,n;x.enablePan&&(t=e.touches[0].pageX,n=e.touches[0].pageY,O.set(t,n)),T=M.TOUCH_PAN;break;case 2:if(!1===x.enableZoom&&!1===x.enableRotate)return;var r,i,a,o,s,l,u;T=M.TOUCH_DOLLY_ROTATE,x.enableZoom&&(r=e.touches[0].pageX-e.touches[1].pageX,i=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(r*r+i*i),U.set(0,a)),x.enableRotate&&(o=.5*(e.touches[0].pageX+e.touches[1].pageX),s=.5*(e.touches[0].pageY+e.touches[1].pageY),N.set(o,s),l=e.touches[0].pageX-e.touches[1].pageX,u=e.touches[0].pageY-e.touches[1].pageY,C.set(l,u));break;default:T=M.NONE}T!==M.NONE&&x.dispatchEvent(b)}}function fe(e){if(!1!==x.enabled)switch(e.preventDefault(),e.stopPropagation(),(0,be.default)(x)&&(0,be.default)(x).eventTransform&&(e=(0,be.default)(x).eventTransform(e)),e.touches.length){case 1:if(T!==M.TOUCH_PAN)return;var t,n;x.enablePan&&(t=e.touches[0].pageX,n=e.touches[0].pageY,F.set(t,n),B.subVectors(F,O).multiplyScalar(x.panSpeed),Y(B.x,B.y),O.copy(F));break;case 2:if(!1===x.enableRotate&&!1===x.enableZoom)return;if(T!==M.TOUCH_DOLLY_ROTATE)return;var r,i,a,o,s,l,u,h;x.enableZoom&&(r=e.touches[0].pageX-e.touches[1].pageX,i=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(r*r+i*i),z.set(0,a),G.set(0,Math.pow(z.y/U.y,x.zoomSpeed)),q(G.y),U.copy(z)),x.enableRotate&&(o=e.touches[0].pageX-e.touches[1].pageX,s=e.touches[0].pageY-e.touches[1].pageY,D.set(o,s),l=C.angle(),u=D.angle(),k.set(.5*(e.touches[0].pageX+e.touches[1].pageX),.5*(e.touches[0].pageY+e.touches[1].pageY)),P.subVectors(k,N).multiplyScalar(x.rotateSpeed),h=x.domElement===Se.default?x.domElement.body:x.domElement,j((-u+l)*x.rotateSpeed),W(2*Math.PI*P.y/h.clientHeight),N.copy(k),C.copy(D));break;default:T=M.NONE}}function pe(e){var t,n;!1!==x.enabled&&((0,be.default)(x)&&(0,be.default)(x).eventTransform&&(e=(0,be.default)(x).eventTransform(e)),t=V.distanceTo(new fm.Vector2(e.changedTouches[0].pageX,e.changedTouches[0].pageY)),n={left:void 0!==x.domElement._left?x.domElement._left:0,top:void 0!==x.domElement._top?x.domElement._top:0},t<5&&x.dispatchEvent({type:"mouseup",mousePoint:{x:e.changedTouches[0].pageX-n.left,y:e.changedTouches[0].pageY-n.top,w:x.domElement._width,h:x.domElement._height},event:e,mouseButton:fm.MOUSE.LEFT}),ie(e),x.dispatchEvent(r),T=M.NONE)}function me(e){!1!==x.enabled&&e.preventDefault()}this.dollyIn=function(e){q(e)},this.dollyOut=function(e){X(e)},x.domElement.addEventListener("contextmenu",me,!1),x.domElement.addEventListener("mouseup",se,!1),x.domElement.addEventListener("mousemove",le,!1),x.domElement.addEventListener("mousedown",ae,!1),x.domElement.addEventListener("wheel",he,!1);var ve={touches:[],changedTouches:[],preventDefault:function(){},stopPropagation:function(){}};function ge(e){return{pointerId:e.pointerId,clientX:e.clientX,clientY:e.clientY,pageX:e.clientX,pageY:e.clientY}}function ye(e){if("touch"==e.pointerType){switch(ve.touches.length){case 0:var t={startClientX:e.clientX,startClientY:e.clientY,clientX:e.clientX,clientY:e.clientY,pageY:e.clientY,pageX:e.clientX,pointerId:e.pointerId};ve.touches.push(ge(t)),ve.changedTouches.push(ge(t)),T=M.TOUCH_PAN;break;case 1:var n={startClientX:e.clientX,startClientY:e.clientY,clientX:e.clientX,clientY:e.clientY,pageY:e.clientY,pageX:e.clientX,pointerId:e.pointerId};ve.touches.push(ge(n)),ve.changedTouches.push(ge(n)),T=M.TOUCH_DOLLY_ROTATE;break;default:T=M.NONE}1<ve.touches.length&&de(ve,!0)}else ve={touches:[],changedTouches:[],preventDefault:function(){},stopPropagation:function(){}}}function _e(e){if(!("touch"!=e.pointerType&&ve.touches.length<2)){for(var t=0,n=ve.touches.length;t<n;t++)ve.touches[t].pointerId==e.pointerId&&(ve.touches[t].clientX=e.clientX,ve.touches[t].clientY=e.clientY,ve.touches[t].pageY=e.clientY,ve.touches[t].pageX=e.clientX,ve.changedTouches[t].clientX=e.clientX,ve.changedTouches[t].clientY=e.clientY,ve.changedTouches[t].pageY=e.clientY,ve.changedTouches[t].pageX=e.clientX);1<ve.touches.length&&fe(ve)}}function xe(e){if("touch"==e.pointerType){1<ve.touches.length&&pe(ve);for(var t,n,r=ve.touches.length-1;-1<r;r--)ve.touches[r].pointerId==e.pointerId&&((0,we.default)(t=ve.touches).call(t,r,1),(0,we.default)(n=ve.changedTouches).call(n,r,1))}else ve={touches:[],changedTouches:[],preventDefault:function(){},stopPropagation:function(){}}}Te.default.PointerEvent&&!Te.default.TouchEvent&&(x.domElement.addEventListener("pointerdown",ye,!1),x.domElement.addEventListener("pointermove",_e,!1),x.domElement.addEventListener("pointerup",xe,!1)),x.domElement.addEventListener("touchstart",de,!1),x.domElement.addEventListener("touchend",pe,!1),x.domElement.addEventListener("touchmove",fe,!1),Te.default.addEventListener("keydown",ce,!1),this.update()},fm.OrbitControls.prototype=(0,a.default)(fm.EventDispatcher.prototype),fm.OrbitControls.prototype.constructor=fm.OrbitControls,(0,i.default)(fm.OrbitControls.prototype,{center:{get:function(){return console.warn("fm.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("fm.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("fm.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("fm.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("fm.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("fm.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("fm.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("fm.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("fm.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("fm.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("fm.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("fm.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("fm.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}})},function(e,t,n){n(40),n(57);var r=n(440);e.exports=r},function(e,t,n){var r=n(35),i=n(104);e.exports=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return r(t.call(e))}},function(e,t,n){n(40),n(57);var r=n(104);e.exports=r},function(e,t,n){var r=n(191);e.exports=r},function(e,t,n){var r=n(444);e.exports=r},function(e,t,n){n(445);var r=n(11),i=r.Object,a=e.exports=function(e,t){return i.getOwnPropertyDescriptor(e,t)};i.getOwnPropertyDescriptor.sham&&(a.sham=!0)},function(e,t,n){var r=n(8),i=n(16),a=n(42),o=n(80).f,s=n(29),l=i(function(){o(1)}),u=!s||l;r({target:"Object",stat:!0,forced:u,sham:!s},{getOwnPropertyDescriptor:function(e,t){return o(a(e),t)}})},function(e,t,n){e.exports=n(447)},function(e,t,n){var r=n(448);e.exports=r},function(e,t,n){n(449);var r=n(11),i=r.Object;e.exports=function(e){return i.getOwnPropertyNames(e)}},function(e,t,n){var r=n(8),i=n(16),a=n(193).f,o=i(function(){return!Object.getOwnPropertyNames(1)});r({target:"Object",stat:!0,forced:o},{getOwnPropertyNames:a})},function(e,t,n){e.exports=n(451)},function(e,t,n){var r=n(452);e.exports=r},function(e,t,n){n(453);var r=n(11);e.exports=r.Object.getOwnPropertyDescriptors},function(e,t,n){var r=n(8),i=n(29),l=n(454),u=n(42),h=n(80),c=n(86);r({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function(e){for(var t,n,r=u(e),i=h.f,a=l(r),o={},s=0;a.length>s;)n=i(r,t=a[s++]),void 0!==n&&c(o,t,n);return o}})},function(e,t,n){var r=n(50),i=n(131),a=n(132),o=n(35);e.exports=r("Reflect","ownKeys")||function(e){var t=i.f(o(e)),n=a.f;return n?t.concat(n(e)):t}},function(e,t,n){e.exports=n(456)},function(e,t,n){var r=n(457);e.exports=r},function(e,t,n){n(192);var r=n(11);e.exports=r.Object.getOwnPropertySymbols},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(201)),o=r(n(137)),s={createElement:function(e){return e=e.toLowerCase(),"canvas"===e?wx.createCanvas():"image"===e?wx.createImage():void 0}};(0,a.default)(s.constructor.prototype,o.default.prototype);var l=s;t.default=l},function(e,t,n){"use strict";var r=n(1),o=r(n(13)),s=r(n(15));fm.Evento={convert:function(i,a){return a=a||{},i.on=function(e,t){return(a[e]=a[e]||[]).push(t),i},i.getHandlers=function(e){return a[e]},i.once=function(e,t){function n(){t.apply(i.off(e,n),arguments)}return n.h=t,i.on(e,n)},i.off=function(e,t){for(var n=a[e],r=0;t&&n&&n[r];r++)n[r]!=t&&n[r].h!=t||(0,s.default)(n).call(n,r--,1);return t||delete a[e],i},i.emit=function(e){for(var t=a[e],n=0;t&&t[n];)t[n++].apply(i,(0,o.default)(t).call(arguments,1));return i},i.offAll=function(){for(var e in a)a[e]=[],delete a[e];a=void 0},i}}},function(e,t,n){var r=n(461),i=n(203);function a(e){if(r(e))return i(e)}e.exports=a},function(e,t,n){e.exports=n(462)},function(e,t,n){var r=n(198);e.exports=r},function(e,t,n){var r=n(204),i=n(465),a=n(190);function o(e){if(void 0!==a&&i(Object(e)))return r(e)}e.exports=o},function(e,t,n){var r=n(168);e.exports=r},function(e,t,n){e.exports=n(466)},function(e,t,n){n(40),n(57);var r=n(467);e.exports=r},function(e,t,n){var r=n(53),i=n(25),a=n(59),o=i("iterator");e.exports=function(e){var t=Object(e);return void 0!==t[o]||"@@iterator"in t||a.hasOwnProperty(r(t))}},function(e,t,n){var i=n(204),a=n(469),o=n(203);function r(e,t){var n;if(e){if("string"==typeof e)return o(e,t);var r=a(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?i(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}e.exports=r},function(e,t,n){e.exports=n(470)},function(e,t,n){var r=n(199);e.exports=r},function(e){function t(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}e.exports=t},function(e,t,n){n(183);var r=n(11);e.exports=r.setInterval},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(0)),o=r(n(12)),s=r(n(2)),l=r(n(3)),u=r(n(66)),h=r(n(206)),c=r(n(93)),d=function(){function r(e,t){(0,s.default)(this,r),this.wxInfo=t||{},location&&location.protocol;var n=c.default.replace("FMCloud/","").replace("www.fengmap.com","source.fengmap.com")+"webtheme";this._key=null,this._appName=null,this._mapServerURL="fengmap",this._mapThemeURL=n,this._container=null,this._canvas=null,this._tmpCanvas=null,this._tmpCanvas2=null,this._compassOffset=[28,20],this._compassSize=50,this.wxInfo.pixelRatio&&(this._compassSize*=this.wxInfo.pixelRatio),this._compassFg=null,this._compassBg=null,this.compassPosition=1,this._defaultThemeName="2001",this._focusAnimateMode=!0,this._focusAnimateTime=.3,this._focusAlphaMode=!0,this._focusAlpha=.1,this._viewModeAnimateMode=!0,this._viewModeAnimateTime=.3,this._moveToAnimateMode=!0,this._moveToAnimateTime=.3,this._scaleToAnimateMode=!0,this._modelSelectedEffect=!0,this._modelHoverEffect=!1,this._modelHoverTime=1e3,this.minScaleLevel=0,this.maxScaleLevel=6,this.defaultScaleLevel=3,this.mapScaleLevelRange=[16,23],this.mapScaleRange=null,this.defaultMapScaleLevel=20,this.defaultMapScale=null,this.minViewDistance=2e3,this.defaultVisibleGroups=[1],this.defaultFocusGroup=1,this.defaultViewMode="3d",this.shadowEnabled=!1,this.lightAngleX=45,this.lightAngleY=45,this.shadowSize=2048,this.shadowAlpha=.6,this.storeImageAngle=0,this.naviLineAnimation=!0,this.controlsRotateThreshold=.03,this.controlsScaleThreshold=.03,this.defaultGroupSpace=50,this.passiveMode=!1,this.themeVersion=null,this.themeFileType=null,this.cornerRoundLimit=1,this.stairsConfig={},this.defaultControlsPose=-15,this.defaultTiltAngle=30,this.defaultMaxTiltAngle=90,this.defaultMinTiltAngle=30,this.extentHeight=0,this.poiLabelFadeMode=!1,this.poiLabelFadeSpeed=5,this.defaultBackgroundColor=null,this.defaultBackgroundAlpha=null,this.storeImageDistanceEnabled=!1,this.storeImageDistance=500,this.useStoreApply=!0,this.frameRate=12,this.defaultViewCenter=null,this.pickCoordHeight=1,this.modelFileSuffix="js",this.enabledFXAA=!1,this.dynamicTextureScale=1,this.enabledPanRange=!1,this.tile=!1,this.levelShowOffset=0,this.lightEffects=!1,this.defaultLabelLanguage=u.default.ZH,this.font={family:'"Microsoft Yahei","微软雅黑",Tahoma,Arial'},(0,o.default)(this,e)}return(0,l.default)(r,[{key:"computePoseToAngle",value:function(){if("number"==typeof this.defaultControlsPose)return this.defaultControlsPose;if(this.defaultControlsPose){var e=h.default[this.defaultControlsPose];return e||-15}}},{key:"getImage",value:function(){return this._canvas.createImage()}},{key:"key",set:function(e){this._key=e},get:function(){return this._key}},{key:"appName",set:function(e){this._appName=e},get:function(){return this._appName}},{key:"mapServerURL",get:function(){return this._mapServerURL},set:function(e){this._mapServerURL=e}},{key:"mapThemeURL",get:function(){return this._mapThemeURL},set:function(e){this._mapThemeURL=e}},{key:"container",get:function(){return this._container},set:function(e){this._container=e,(0,a.default)(this._container,"style",{configurable:!0,get:function(){return{width:this.width+"px",height:this.height+"px"}}}),(0,a.default)(this._container,"clientHeight",{configurable:!0,get:function(){return this.height}}),(0,a.default)(this._container,"clientWidth",{configurable:!0,get:function(){return this.width}})}},{key:"canvas",get:function(){return this._canvas},set:function(e){this._canvas=e,this.wxInfo.pixelRatio&&(this._canvas.height*=this.wxInfo.pixelRatio,this._canvas.width*=this.wxInfo.pixelRatio);var n=this;(0,a.default)(this._canvas,"style",{configurable:!0,get:function(){var e=this.width,t=this.height;return n.wxInfo.pixelRatio&&(e/=n.wxInfo.pixelRatio,t/=n.wxInfo.pixelRatio),{width:e+"px",height:t+"px"}}}),(0,a.default)(this._canvas,"clientHeight",{configurable:!0,get:function(){return this.height}}),(0,a.default)(this._canvas,"clientWidth",{configurable:!0,get:function(){return this.width}})}},{key:"tempCanvas",get:function(){return this._tmpCanvas},set:function(e){this._tmpCanvas=e,(0,a.default)(this._tmpCanvas,"style",{configurable:!0,get:function(){return{width:this.width+"px",height:this.height+"px"}}}),(0,a.default)(this._tmpCanvas,"clientHeight",{configurable:!0,get:function(){return this.height}}),(0,a.default)(this._tmpCanvas,"clientWidth",{configurable:!0,get:function(){return this.width}})}},{key:"tempCanvas2",get:function(){return this._tmpCanvas2},set:function(e){this._tmpCanvas2=e,(0,a.default)(this._tmpCanvas2,"style",{configurable:!0,get:function(){return{width:this.width+"px",height:this.height+"px"}}}),(0,a.default)(this._tmpCanvas2,"clientHeight",{configurable:!0,get:function(){return this.height}}),(0,a.default)(this._tmpCanvas2,"clientWidth",{configurable:!0,get:function(){return this.width}})}},{key:"compassOffset",get:function(){return this._compassOffset},set:function(e){this._compassOffset=e}},{key:"compassSize",get:function(){return this._compassSize},set:function(e){this._compassSize=e,this.wxInfo.pixelRatio&&(this._compassSize*=this.wxInfo.pixelRatio)}},{key:"compassFg",set:function(e){this._compassFg=e},get:function(){return this._compassFg}},{key:"compassBg",set:function(e){this._compassBg=e},get:function(){return this._compassBg}},{key:"defaultThemeName",get:function(){return this._defaultThemeName},set:function(e){this._defaultThemeName=e}},{key:"focusAnimateMode",get:function(){return this._focusAnimateMode},set:function(e){this._focusAnimateMode=e}},{key:"focusAnimateTime",get:function(){return this._focusAnimateTime},set:function(e){this._focusAnimateTime=e}},{key:"focusAlphaMode",get:function(){this._focusAlphaMode},set:function(e){this._focusAlphaMode=e}},{key:"focusAlpha",set:function(e){this._focusAlpha=e},get:function(){return this._focusAlpha}},{key:"viewModeAnimateMode",set:function(e){this._viewModeAnimateMode=e},get:function(){return this._viewModeAnimateMode}},{key:"moveToAnimateMode",set:function(e){this._moveToAnimateMode=e},get:function(){return this._moveToAnimateMode}},{key:"scaleToAnimateMode",set:function(e){this._scaleToAnimateMode=e},get:function(){return this._scaleToAnimateMode}},{key:"viewModeAnimateTime",set:function(e){this._viewModeAnimateTime=e},get:function(){return this._viewModeAnimateTime}},{key:"modelHoverTime",get:function(){return this._modelHoverTime},set:function(e){e<300&&(e=300),this._modelHoverTime=e}},{key:"modelHoverEffect",get:function(){return this._modelHoverEffect},set:function(e){this._modelHoverEffect=e}},{key:"modelSelectedEffect",get:function(){return this._modelSelectedEffect},set:function(e){this._modelSelectedEffect=e}}]),r}(),f=d;t.default=f},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(20)),u=r(n(14)),h=r(n(21)),c=r(n(22)),a=r(n(18)),x=r(n(13)),o=r(n(2)),s=r(n(3)),w=r(n(475)),b=r(n(481)),M=r(n(482)),T=r(n(143));function d(e,t){var n;if(void 0===c.default||null==(0,h.default)(e)){if((0,u.default)(e)||(n=f(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=(0,l.default)(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function f(e,t){var n;if(e){if("string"==typeof e)return p(e,t);var r=(0,x.default)(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?(0,a.default)(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var m=function(){function e(){(0,o.default)(this,e)}return(0,s.default)(e,[{key:"mapDecode",value:function(e,t,n){var r=w.default.build("Map").decode(e),i="%E8%AF%B7%E8%BE%93%E5%85%A5%E6%AD%A3%E7%A1%AE%E7%9A%84license.";if(T.default.ls&&!T.default.checkLicense(r.key,t,n))return console.warn(decodeURIComponent(i)),null;for(var a={scene:null,floors:[]},o=0,s=r.buffers.length;o<s;o++){var l,u,h,c,d,f,p,m=r.buffers[o],v=m.len,g=m.data.offset,y=m.data.offset+v.low,_=m.data.buffer;1==m.btype?(l=M.default.build("Scene").decode((0,x.default)(_).call(_,g,y)),a.scene=l):(u=m.gid,h=this.containsFloor(u,a.floors),c=h.floor,h.index<0&&(c.gid=u,c.biz=[],c.navi=[],c.geo=[]),2==m.btype&&(d=b.default.build("FloorGeo").decode((0,x.default)(_).call(_,g,y)),c.geo.push(d)),3==m.btype&&(f=b.default.build("FloorBiz").decode((0,x.default)(_).call(_,g,y)),c.biz.push(f)),4==m.btype&&(p=b.default.build("FloorNavi").decode((0,x.default)(_).call(_,g,y)),c.navi.push(p)),h.index<0?a.floors.push(c):a.floors[h.index]=c)}return a}},{key:"containsFloor",value:function(e,t){for(var n=0,r=t.length;n<r;n++)if(t[n].gid==e)return{index:n,floor:t[n]};return{index:-1,floor:{}}}},{key:"sceneDecode",value:function(e,t,n){var r=M.default.build("Scene").decode(e),i="%E8%AF%B7%E8%BE%93%E5%85%A5%E6%AD%A3%E7%A1%AE%E7%9A%84license.";return T.default.ls&&!T.default.checkLicense(r.key,t,n)?(console.warn(decodeURIComponent(i)),null):r}},{key:"floorGeoDecode",value:function(e){var t=b.default.build("FloorGeo").decode(e);return t}},{key:"floorBizDecode",value:function(e){var t=b.default.build("FloorBiz").decode(e);return t}},{key:"floorNaviDecode",value:function(e){var t=b.default.build("FloorNavi").decode(e);return t}},{key:"disposeRoot",value:function(e){var t,n=e.ns,r=d(n.children);try{for(r.s();!(t=r.n()).done;){var i=t.value;i.builder=void 0,i.parent=void 0,i.children.length=0,i._fields.length=0,i._fieldsById=void 0,i._fieldsByName=void 0}}catch(e){r.e(e)}finally{r.f()}n.children.length=0,e.ns=void 0,e.ptr=void 0}},{key:"dispose",value:function(){}}]),e}(),v=m;t.default=v},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i=n(142),a=i.ProtoBuf.newBuilder({}).import({messages:[{name:"Map",fields:[{rule:"required",type:"string",name:"mid",id:1},{rule:"required",type:"int32",name:"file_ver",id:2},{rule:"required",type:"uint64",name:"date_ver",id:3},{rule:"required",type:"string",name:"mname",id:4},{rule:"required",type:"string",name:"hash_code",id:5},{rule:"optional",type:"string",name:"key",id:6},{rule:"optional",type:"string",name:"file_date",id:7},{rule:"optional",type:"string",name:"desc",id:8},{rule:"optional",type:"bool",name:"read_only",id:9,options:{default:!1}},{rule:"repeated",type:"Buffer",name:"buffers",id:10}],messages:[{name:"Buffer",fields:[{rule:"required",type:"int32",name:"gid",id:1},{rule:"required",type:"int32",name:"file_ver",id:2},{rule:"required",type:"int32",name:"btype",id:3},{rule:"required",type:"uint64",name:"len",id:4},{rule:"required",type:"bytes",name:"data",id:5}]}]}]});t.default=a},function(e,t,n){e.exports=n(477)},function(e,t,n){n(40);var r=n(478),i=n(53),a=Array.prototype,o={DOMTokenList:!0,NodeList:!0};e.exports=function(e){var t=e.entries;return e===a||e instanceof Array&&t===a.entries||o.hasOwnProperty(i(e))?r:t}},function(e,t,n){var r=n(479);e.exports=r},function(e,t,n){n(105);var r=n(24);e.exports=r("Array").entries},function(){},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i=n(142),a=i.ProtoBuf.newBuilder({}).import({messages:[{name:"FloorGeo",syntax:"proto2",fields:[{rule:"required",type:"string",name:"mid",id:1},{rule:"required",type:"int32",name:"gid",id:2},{rule:"optional",type:"float",name:"height",id:3},{rule:"repeated",type:"GeneralGeoInfo",name:"extentLayer",id:4},{rule:"repeated",type:"GeneralGeoInfo",name:"modelLayer",id:5},{rule:"repeated",type:"GeneralGeoInfo",name:"labelLayer",id:6},{rule:"repeated",type:"GeneralGeoInfo",name:"poiLayer",id:7},{rule:"repeated",type:"GeneralGeoInfo",name:"polygonLayer",id:8},{rule:"repeated",type:"GeneralGeoInfo",name:"polygonLabelLayer",id:9},{rule:"repeated",type:"GeneralGeoInfo",name:"liftLayer",id:10},{rule:"repeated",type:"GeneralGeoInfo",name:"stairLayer",id:11},{rule:"repeated",type:"GeneralGeoInfo",name:"escalatorLayer",id:12},{rule:"repeated",type:"GeneralGeoInfo",name:"externalModelLayer",id:13}],messages:[{name:"GeneralGeoInfo",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"eid",id:1},{rule:"optional",type:"string",name:"geo",id:2},{rule:"optional",type:"float",name:"height",id:3},{rule:"optional",type:"float",name:"area",id:4},{rule:"repeated",type:"Indexinfo",name:"idxs",id:5},{rule:"repeated",type:"double",name:"pts",id:6}],messages:[{name:"Indexinfo",syntax:"proto2",fields:[{rule:"repeated",type:"int32",name:"idxs",id:1}]}]}]},{name:"FloorBiz",syntax:"proto2",fields:[{rule:"required",type:"string",name:"mid",id:1},{rule:"required",type:"int32",name:"gid",id:2},{rule:"repeated",type:"ExtentBizInfo",name:"extentLayer",id:3},{rule:"repeated",type:"ModelBizInfo",name:"modelLayer",id:4},{rule:"repeated",type:"LabelBizInfo",name:"labelLayer",id:5},{rule:"repeated",type:"POIBizInfo",name:"poiLayer",id:6},{rule:"repeated",type:"PolygonBizInfo",name:"polygonLayer",id:7},{rule:"repeated",type:"LiftBizInfo",name:"liftLayer",id:8},{rule:"repeated",type:"StairBizInfo",name:"stairLayer",id:9},{rule:"repeated",type:"PolygonLabelBizInfo",name:"polygonLabelLayer",id:10},{rule:"repeated",type:"ExternalModelBizInfo",name:"externalModelLayer",id:11}],messages:[{name:"ExtentBizInfo",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"eid",id:1},{rule:"optional",type:"string",name:"fid",id:2},{rule:"optional",type:"int32",name:"type",id:3},{rule:"optional",type:"string",name:"name",id:4},{rule:"optional",type:"string",name:"ename",id:5}]},{name:"ModelBizInfo",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"eid",id:1},{rule:"optional",type:"string",name:"fid",id:2},{rule:"optional",type:"int32",name:"type",id:3},{rule:"optional",type:"string",name:"name",id:4},{rule:"optional",type:"string",name:"ename",id:5},{rule:"optional",type:"int32",name:"minlevel",id:6},{rule:"optional",type:"int32",name:"maxlevel",id:7},{rule:"optional",type:"int32",name:"pass",id:8}]},{name:"LabelBizInfo",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"eid",id:1},{rule:"optional",type:"string",name:"fid",id:2},{rule:"optional",type:"int32",name:"type",id:3},{rule:"optional",type:"string",name:"name",id:4},{rule:"optional",type:"string",name:"ename",id:5},{rule:"optional",type:"int32",name:"minlevel",id:6},{rule:"optional",type:"int32",name:"maxlevel",id:7}]},{name:"PolygonBizInfo",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"eid",id:1},{rule:"optional",type:"string",name:"fid",id:2},{rule:"optional",type:"int32",name:"type",id:3},{rule:"optional",type:"string",name:"name",id:4},{rule:"optional",type:"string",name:"ename",id:5}]},{name:"POIBizInfo",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"eid",id:1},{rule:"optional",type:"string",name:"fid",id:2},{rule:"optional",type:"int32",name:"type",id:3},{rule:"optional",type:"string",name:"name",id:4},{rule:"optional",type:"string",name:"ename",id:5},{rule:"optional",type:"int32",name:"minlevel",id:6},{rule:"optional",type:"int32",name:"maxlevel",id:7}]},{name:"LiftBizInfo",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"eid",id:1},{rule:"optional",type:"string",name:"fid",id:2},{rule:"optional",type:"int32",name:"type",id:3},{rule:"optional",type:"int32",name:"flag",id:4},{rule:"optional",type:"string",name:"floor",id:5},{rule:"optional",type:"int32",name:"minlevel",id:6},{rule:"optional",type:"int32",name:"maxlevel",id:7}]},{name:"StairBizInfo",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"eid",id:1},{rule:"optional",type:"string",name:"fid",id:2},{rule:"optional",type:"int32",name:"type",id:3},{rule:"optional",type:"int32",name:"flag",id:4},{rule:"optional",type:"int32",name:"minlevel",id:5},{rule:"optional",type:"int32",name:"maxlevel",id:6}]},{name:"PolygonLabelBizInfo",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"eid",id:1},{rule:"optional",type:"string",name:"fid",id:2},{rule:"optional",type:"int32",name:"type",id:3},{rule:"optional",type:"float",name:"width",id:4},{rule:"optional",type:"string",name:"name",id:5},{rule:"optional",type:"string",name:"ename",id:6},{rule:"optional",type:"float",name:"angle",id:7}]},{name:"ExternalModelBizInfo",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"eid",id:1},{rule:"optional",type:"string",name:"fid",id:2},{rule:"optional",type:"int32",name:"type",id:3},{rule:"optional",type:"string",name:"name",id:4},{rule:"optional",type:"string",name:"ename",id:5}]}]},{name:"FloorNavi",syntax:"proto2",fields:[{rule:"required",type:"string",name:"mid",id:1},{rule:"required",type:"int32",name:"gid",id:2},{rule:"repeated",type:"NaviNode",name:"naviNodes",id:3},{rule:"repeated",type:"NaviSegment",name:"naviSegments",id:4},{rule:"repeated",type:"NaviZone",name:"naviZones",id:5},{rule:"repeated",type:"NaviModel",name:"naviModels",id:6},{rule:"repeated",type:"int32",name:"nextFloors",id:7}],messages:[{name:"NaviNode",syntax:"proto2",fields:[{rule:"optional",type:"int32",name:"nodeId",id:1},{rule:"optional",type:"int32",name:"nodeType",id:2},{rule:"optional",type:"int32",name:"liftType",id:3},{rule:"optional",type:"int32",name:"liftFlag",id:4},{rule:"optional",type:"int32",name:"liftEntry",id:5},{rule:"optional",type:"string",name:"liftFloor",id:6},{rule:"optional",type:"string",name:"linkSeg",id:7},{rule:"optional",type:"string",name:"geo",id:8},{rule:"optional",type:"int32",name:"entranceType",id:9},{rule:"optional",type:"string",name:"entranceFloor",id:10},{rule:"optional",type:"int32",name:"doortype",id:11},{rule:"repeated",type:"int32",name:"idxs",id:12},{rule:"repeated",type:"double",name:"pts",id:13}]},{name:"NaviSegment",syntax:"proto2",fields:[{rule:"optional",type:"int32",name:"segmentId",id:1},{rule:"optional",type:"int32",name:"snode",id:2},{rule:"optional",type:"int32",name:"enode",id:3},{rule:"optional",type:"double",name:"length",id:4},{rule:"optional",type:"int32",name:"rank",id:5},{rule:"optional",type:"string",name:"name",id:6},{rule:"optional",type:"int32",name:"entry",id:7},{rule:"optional",type:"string",name:"desc",id:8},{rule:"optional",type:"string",name:"geo",id:9},{rule:"optional",type:"int32",name:"through",id:10},{rule:"repeated",type:"int32",name:"idxs",id:11},{rule:"repeated",type:"double",name:"pts",id:12}]},{name:"NaviZone",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"id",id:1},{rule:"required",type:"int32",name:"type",id:2,options:{default:0}},{rule:"required",type:"string",name:"geo",id:3},{rule:"repeated",type:"int32",name:"rejects",id:4}]},{name:"NaviModel",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"id",id:1},{rule:"repeated",type:"int32",name:"doorids",id:2},{rule:"repeated",type:"int32",name:"nodetypes",id:3},{rule:"repeated",type:"int32",name:"entrytypes",id:4}]}]}]});t.default=a},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i=n(142),a=i.ProtoBuf.newBuilder({}).import({messages:[{name:"Scene",fields:[{rule:"required",type:"string",name:"mid",id:19},{rule:"required",type:"int32",name:"file_ver",id:20},{rule:"required",type:"uint64",name:"date_ver",id:21},{rule:"required",type:"string",name:"mname",id:22},{rule:"required",type:"string",name:"hash_code",id:23},{rule:"optional",type:"string",name:"key",id:24},{rule:"optional",type:"string",name:"desc",id:25},{rule:"optional",type:"bool",name:"read_only",id:26,options:{default:!1}},{rule:"optional",type:"float",name:"x",id:1},{rule:"optional",type:"float",name:"y",id:2},{rule:"optional",type:"float",name:"z",id:3},{rule:"optional",type:"float",name:"minX",id:4},{rule:"optional",type:"float",name:"minY",id:5},{rule:"optional",type:"float",name:"maxX",id:6},{rule:"optional",type:"float",name:"maxY",id:7},{rule:"optional",type:"string",name:"defGid",id:8},{rule:"optional",type:"float",name:"defCenX",id:9},{rule:"optional",type:"float",name:"defCenY",id:10},{rule:"optional",type:"float",name:"defCenZ",id:11},{rule:"optional",type:"float",name:"height",id:12},{rule:"optional",type:"float",name:"rotateAngleX",id:13},{rule:"optional",type:"float",name:"rotateAngleY",id:14},{rule:"optional",type:"float",name:"rotateAngleZ",id:15},{rule:"optional",type:"float",name:"scale",id:16},{rule:"optional",type:"string",name:"scaleLevel",id:17},{rule:"repeated",type:"LayerGroup",name:"layerGroups",id:18}],messages:[{name:"Layer",fields:[{rule:"optional",type:"int32",name:"lid",id:1},{rule:"optional",type:"string",name:"lname",id:2},{rule:"optional",type:"string",name:"alias",id:3},{rule:"optional",type:"Type",name:"ltype",id:4},{rule:"optional",type:"float",name:"offsetX",id:5},{rule:"optional",type:"float",name:"offsetY",id:6},{rule:"optional",type:"float",name:"height",id:7},{rule:"optional",type:"float",name:"rotateAngleX",id:8},{rule:"optional",type:"float",name:"rotateAngleY",id:9},{rule:"optional",type:"float",name:"rotateAngleZ",id:10},{rule:"optional",type:"float",name:"minScaleLevel",id:11},{rule:"optional",type:"float",name:"maxScaleLevel",id:12},{rule:"optional",type:"bool",name:"isVisible",id:13},{rule:"optional",type:"bool",name:"isSelectable",id:14},{rule:"optional",type:"bool",name:"isEditable",id:15},{rule:"optional",type:"string",name:"desc",id:16}],enums:[{name:"Type",values:[{name:"GEOPOINT",id:1},{name:"GEOPOINT_ESCALATOR",id:2},{name:"GEOPOINT_LIFT",id:3},{name:"GEOPOINT_STAIR",id:4},{name:"GEOPOINT_PANORAMA",id:5},{name:"GEOPOINT_POI",id:6},{name:"GEOPOINT_STORELABEL",id:7},{name:"GEOPOINT_NAVINODE",id:8},{name:"GEOPOINT_MODEL",id:9},{name:"GEOLINE",id:20},{name:"GEOLINE_NAVISEGMENT",id:21},{name:"GEOLINE_BORDER",id:22},{name:"GEOPOLYGON",id:30},{name:"GEOPOLYGON_EXTENT",id:31},{name:"GEOPOLYGON_STORE",id:32},{name:"GEOPOLYGON_LABEL",id:33},{name:"RASTERATA",id:40},{name:"OVERLAYDATA",id:50}]}]},{name:"LayerGroup",fields:[{rule:"optional",type:"int32",name:"gid",id:1},{rule:"optional",type:"string",name:"gname",id:2},{rule:"optional",type:"string",name:"alias",id:3},{rule:"optional",type:"float",name:"height",id:4},{rule:"optional",type:"string",name:"desc",id:5},{rule:"repeated",type:"Layer",name:"layers",id:6}]}]}]});t.default=a},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a,s=r(n(31)),o=(a=function(e){return E(e)},{encryption:function(e){return a(e)}});function c(e,t){var n=(65535&e)+(65535&t),r=(e>>16)+(t>>16)+(n>>16);return r<<16|65535&n}function l(e,t){return e<<t|e>>>32-t}function u(e,t,n,r,i,a){return c(l(c(c(t,e),c(r,a)),i),n)}function d(e,t,n,r,i,a,o){return u(t&n|~t&r,e,t,i,a,o)}function f(e,t,n,r,i,a,o){return u(t&r|n&~r,e,t,i,a,o)}function p(e,t,n,r,i,a,o){return u(t^n^r,e,t,i,a,o)}function m(e,t,n,r,i,a,o){return u(n^(t|~r),e,t,i,a,o)}function h(e,t){var n,r,i,a;e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var o=1732584193,s=-271733879,l=-1732584194,u=271733878,h=0;h<e.length;h+=16)n=o,r=s,i=l,a=u,o=d(o,s,l,u,e[h],7,-680876936),u=d(u,o,s,l,e[h+1],12,-389564586),l=d(l,u,o,s,e[h+2],17,606105819),s=d(s,l,u,o,e[h+3],22,-1044525330),o=d(o,s,l,u,e[h+4],7,-176418897),u=d(u,o,s,l,e[h+5],12,1200080426),l=d(l,u,o,s,e[h+6],17,-1473231341),s=d(s,l,u,o,e[h+7],22,-45705983),o=d(o,s,l,u,e[h+8],7,1770035416),u=d(u,o,s,l,e[h+9],12,-1958414417),l=d(l,u,o,s,e[h+10],17,-42063),s=d(s,l,u,o,e[h+11],22,-1990404162),o=d(o,s,l,u,e[h+12],7,1804603682),u=d(u,o,s,l,e[h+13],12,-40341101),l=d(l,u,o,s,e[h+14],17,-1502002290),s=d(s,l,u,o,e[h+15],22,1236535329),o=f(o,s,l,u,e[h+1],5,-165796510),u=f(u,o,s,l,e[h+6],9,-1069501632),l=f(l,u,o,s,e[h+11],14,643717713),s=f(s,l,u,o,e[h],20,-373897302),o=f(o,s,l,u,e[h+5],5,-701558691),u=f(u,o,s,l,e[h+10],9,38016083),l=f(l,u,o,s,e[h+15],14,-660478335),s=f(s,l,u,o,e[h+4],20,-405537848),o=f(o,s,l,u,e[h+9],5,568446438),u=f(u,o,s,l,e[h+14],9,-1019803690),l=f(l,u,o,s,e[h+3],14,-187363961),s=f(s,l,u,o,e[h+8],20,1163531501),o=f(o,s,l,u,e[h+13],5,-1444681467),u=f(u,o,s,l,e[h+2],9,-51403784),l=f(l,u,o,s,e[h+7],14,1735328473),s=f(s,l,u,o,e[h+12],20,-1926607734),o=p(o,s,l,u,e[h+5],4,-378558),u=p(u,o,s,l,e[h+8],11,-2022574463),l=p(l,u,o,s,e[h+11],16,1839030562),s=p(s,l,u,o,e[h+14],23,-35309556),o=p(o,s,l,u,e[h+1],4,-1530992060),u=p(u,o,s,l,e[h+4],11,1272893353),l=p(l,u,o,s,e[h+7],16,-155497632),s=p(s,l,u,o,e[h+10],23,-1094730640),o=p(o,s,l,u,e[h+13],4,681279174),u=p(u,o,s,l,e[h],11,-358537222),l=p(l,u,o,s,e[h+3],16,-722521979),s=p(s,l,u,o,e[h+6],23,76029189),o=p(o,s,l,u,e[h+9],4,-640364487),u=p(u,o,s,l,e[h+12],11,-421815835),l=p(l,u,o,s,e[h+15],16,530742520),s=p(s,l,u,o,e[h+2],23,-995338651),o=m(o,s,l,u,e[h],6,-198630844),u=m(u,o,s,l,e[h+7],10,1126891415),l=m(l,u,o,s,e[h+14],15,-1416354905),s=m(s,l,u,o,e[h+5],21,-57434055),o=m(o,s,l,u,e[h+12],6,1700485571),u=m(u,o,s,l,e[h+3],10,-1894986606),l=m(l,u,o,s,e[h+10],15,-1051523),s=m(s,l,u,o,e[h+1],21,-2054922799),o=m(o,s,l,u,e[h+8],6,1873313359),u=m(u,o,s,l,e[h+15],10,-30611744),l=m(l,u,o,s,e[h+6],15,-1560198380),s=m(s,l,u,o,e[h+13],21,1309151649),o=m(o,s,l,u,e[h+4],6,-145523070),u=m(u,o,s,l,e[h+11],10,-1120210379),l=m(l,u,o,s,e[h+2],15,718787259),s=m(s,l,u,o,e[h+9],21,-343485551),o=c(o,n),s=c(s,r),l=c(l,i),u=c(u,a);return[o,s,l,u]}function v(e){for(var t="",n=32*e.length,r=0;r<n;r+=8)t+=String.fromCharCode(e[r>>5]>>>r%32&255);return t}function g(e){var t=[];for(t[(e.length>>2)-1]=void 0,r=0;r<t.length;r+=1)t[r]=0;for(var n=8*e.length,r=0;r<n;r+=8)t[r>>5]|=(255&e.charCodeAt(r/8))<<r%32;return t}function y(e){return v(h(g(e),8*e.length))}function _(e,t){var n,r,i=g(e),a=[],o=[];for(a[15]=o[15]=void 0,16<i.length&&(i=h(i,8*e.length)),n=0;n<16;n+=1)a[n]=909522486^i[n],o[n]=1549556828^i[n];return r=h((0,s.default)(a).call(a,g(t)),512+8*t.length),v(h((0,s.default)(o).call(o,r),640))}function x(e){for(var t,n="0123456789abcdef",r="",i=0;i<e.length;i+=1)t=e.charCodeAt(i),r+=n.charAt(t>>>4&15)+n.charAt(15&t);return r}function w(e){return unescape(encodeURIComponent(e))}function b(e){return y(w(e))}function M(e){return x(b(e))}function T(e,t){return _(w(e),w(t))}function S(e,t){return x(T(e,t))}function E(e,t,n){return t?(n?T:S)(t,e):(n?b:M)(e)}var A=o;t.default=A},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(9)),s=r(n(27)),l=r(n(2)),u=r(n(3)),h=r(n(5)),c=r(n(6)),d=r(n(7)),f=r(n(17)),p=r(n(37));function m(r){var i=v();return function(){var e,t=(0,d.default)(r),n=i?(e=(0,d.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,c.default)(this,n)}}function v(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var g=function(e){(0,h.default)(i,e);var r=m(i);function i(e,t){var n;return(0,l.default)(this,i),n=r.call(this,t.eid,p.default.FLOOR),n.bdata=t,n.gdata=e,n._parseData=null,n._isInitMesh=!0,n._visible=!0,n._renderNode=null,n._geometry=void 0,n}return(0,u.default)(i,[{key:"initMesh",value:function(e,t,n,r){this._geometry&&(this._renderNode=new fm.Mesh(this._geometry.geometry,e),this._renderNode.mapNode=this,e.color=new fm.Color(n),e.opacity=(0,s.default)(r),e.userData.opacity=r,e.transparent=!0,this._renderNode.scale.set(1,-1,1),this._renderNode.rotation.set(Math.PI/2,0,0,"XYZ"),this._renderNode.position.copy(t),this._renderNode.frustumCulled=!1,this._renderNode.parent=this.parent.scene,this._renderNode.visible=this.show,this._renderNode.receiveShadow=!0,this.renderNodeInited=!0,this._geometry=null)}},{key:"setByTheme",value:function(e){this._renderNode&&(this._renderNode.material.color=new fm.Color(e.floorColor),this._renderNode.material.alpha=e.floorOpacity,this._renderNode.material.userData.opacity=e.floorOpacity)}},{key:"checkByFrustum",value:function(){var e=!0;this._renderNode&&this._renderNode.updateMatrixWorld(!0),this.visible=e}},{key:"releaseGpuMemory",value:function(){this.renderNode&&(this._geometry=null,this.renderNodeInited=!1,this.renderNode.parent.remove(this.renderNode),this.dispose())}},{key:"restoreGpuMemeory",value:function(){}},{key:"getBbox",value:function(){}},{key:"dispose",value:function(){this._renderNode&&(this._renderNode.material.dispose(),this._renderNode.geometry.dispose(),this._renderNode.material=void 0,this._renderNode.geometry=void 0,this._geometry=void 0,this._renderNode.mapNode=void 0,this._renderNode=void 0)}},{key:"isInitMesh",set:function(e){this._isInitMesh=e},get:function(){return this._isInitMesh}},{key:"visible",set:function(e){var t;e?(0,o.default)(t=this.parent.scene.children).call(t,this._renderNode)<0&&this._renderNode&&this.parent.scene.add(this._renderNode):(this._renderNode&&this.parent.scene.remove(this._renderNode),this._renderNode.parent=this.parent.scene),this._visible=e},get:function(){return this._visible}},{key:"renderNode",get:function(){return this._renderNode},set:function(e){this._renderNode=e}}]),i}(f.default),y=g;t.default=y},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(10)),s=r(n(2)),l=r(n(3)),u=r(n(5)),h=r(n(6)),c=r(n(7)),d=r(n(17)),f=r(n(214)),p=r(n(94));function m(r){var i=v();return function(){var e,t=(0,c.default)(r),n=i?(e=(0,c.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,h.default)(this,n)}}function v(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var g=function(e){(0,u.default)(i,e);var r=m(i);function i(e,t){var n;return(0,s.default)(this,i),n=r.call(this,"externalModelLayer"),n._scene=new fm.Scene,n._scene.userData.type="externalModel",n.alias="externalModel",n._models={},n.initNode(e,t),n._visible=!0,n.initLight(),n.putLight(),n}return(0,l.default)(i,[{key:"initNode",value:function(e,t){for(var n=0;n<e.length;n++)this.createNode(e[n],t[n])}},{key:"createNode",value:function(e,t){var n=new f.default(e,t);n.parent=this,this._models[""+n.eid]=n}},{key:"addNodes",value:function(e){e.parent=this,e.renderNode&&this._scene.add(e.renderNode),this._models[""+e.eid]=e}},{key:"traverse",value:function(e){for(var t in this._models)e&&e(this._models[t])}},{key:"initLight",value:function(){this._target=new fm.Object3D,this._mainLight=new fm.DirectionalLight(8947848,1.2),this._mainLight.position.set(-1,1,1).normalize(),this._mainLight.target=this._target,this._secondLight=new fm.DirectionalLight(3355443),this._secondLight.position.set(-.5,1,-1).normalize(),this._secondLight.target=this._target}},{key:"putLight",value:function(){p.default.light?this._ambientLight=new fm.AmbientLight(4210752):(this._ambientLight=new fm.AmbientLight(16777215,.46),this.scene.add(this._mainLight),this.scene.add(this._secondLight),this.scene.add(this._target)),this.scene.add(this._ambientLight),this.scene.removeLight=function(){}}},{key:"removeLight",value:function(){this.scene.remove(this._mainLight),this.scene.remove(this._ambientLight),this.scene.remove(this._secondLight),this.scene.add(this._target)}},{key:"disposeLight",value:function(){this._mainLight=void 0,this._ambientLight=void 0}},{key:"getNodeById",value:function(e){return this._models[""+e]}},{key:"checkSceneNode",value:function(){for(var e in this._scene.children.length=0,this._models)this._models[e].visible&&this._models[e].renderNode&&this._scene.add(this._models[e].renderNode);this.putLight()}},{key:"dispose",value:function(){for(var e in this._models)this._models[e].dispose(),this._scene.remove(this._models[e].renderNode),this._models[e].parent=void 0,this._models[e]=void 0;this.removeLight(),this.disposeLight(),this._scene.length=0,this._scene=void 0}},{key:"scene",get:function(){return this._scene}},{key:"visible",get:function(){return this._visible},set:function(e){this._visible=e,this.parent&&this.parent.parent&&this.parent.parent.parent&&(0,o.default)(this.parent.parent.parent).setRenderList()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}}]),i}(d.default),y=g;t.default=y},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(10)),s=r(n(2)),l=r(n(3)),u=r(n(5)),h=r(n(6)),c=r(n(7)),d=r(n(17)),f=r(n(215));function p(r){var i=m();return function(){var e,t=(0,c.default)(r),n=i?(e=(0,c.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,h.default)(this,n)}}function m(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var v=function(e){(0,u.default)(i,e);var r=p(i);function i(e,t){var n;return(0,s.default)(this,i),n=r.call(this,"modelLayer"),n._scene=new fm.Scene,n._scene.name="model",n._scene.userData.type="model",n.alias="model",n._models={},n.initNode(e,t),n._visible=!0,n.initLight(),n.putLight(),n}return(0,l.default)(i,[{key:"initNode",value:function(e,t){for(var n=0;n<e.length;n++)this.createNode(e[n],t[n])}},{key:"createNode",value:function(e,t){var n=new f.default(e,t);n.parent=this,this._models[""+n.eid]=n}},{key:"addNodes",value:function(e){e.parent=this,e.renderNode&&this._scene.add(e.renderNode),this._models[""+e.eid]=e}},{key:"removeNode",value:function(e){e.renderNode&&this._scene.remove(e.renderNode)}},{key:"traverse",value:function(e){for(var t in this._models)e&&e(this._models[t])}},{key:"initLight",value:function(){this._ambientLight=new fm.AmbientLight(7631988),this._target=new fm.Object3D,this._mainLight=new fm.DirectionalLight(8947848,1.2),this._mainLight.name="directionalLight",this._mainLight.position.set(-1,1,1).normalize(),this._mainLight.target=this._target,this._secondLight=new fm.DirectionalLight(3355443),this._secondLight.position.set(-.5,1,-1).normalize(),this._secondLight.target=this._target}},{key:"putLight",value:function(){var e=this;this.scene.add(this._mainLight),this.scene.add(this._secondLight),this.scene.add(this._ambientLight),this.scene.add(this._target),this.scene.removeLight=function(){e.removeLight()}}},{key:"removeLight",value:function(){this.scene.remove(this._mainLight),this.scene.remove(this._ambientLight),this.scene.remove(this._secondLight)}},{key:"disposeLight",value:function(){this._mainLight=void 0,this._ambientLight=void 0}},{key:"getNodeById",value:function(e){return this._models[""+e]}},{key:"checkSceneNode",value:function(){for(var e in this._scene.children.length=0,this._models)this._models[e].visible&&this._models[e].renderNode&&this._scene.add(this._models[e].renderNode);this.putLight()}},{key:"getAllMesh",value:function(){var e,t=[];for(e in this._models)this._models[e].renderNode&&t.push(this._models[e].renderNode);return t}},{key:"getVideoMemoryAmount",value:function(){var t=null;return this.traverse(function(e){e._renderNode&&e._renderNode.geometry&&e._renderNode.geometry._bufferGeometry&&(t+=e._renderNode.geometry._bufferGeometry.attributes.position.array.byteLength,t+=e._renderNode.geometry._bufferGeometry.attributes.color.array.byteLength,t+=e._renderNode.geometry._bufferGeometry.attributes.normal.array.byteLength,t+=e._renderNode.geometry._bufferGeometry.attributes.uv.array.byteLength)}),t}},{key:"dispose",value:function(){for(var e in this._models)this._models[e].dispose(),this._scene.remove(this._models[e].renderNode),this._models[e].parent=void 0,this._models[e]=void 0;this.removeLight(),this.disposeLight(),this._scene.length=0,this._scene=void 0}},{key:"scene",get:function(){return this._scene}},{key:"visible",get:function(){return this._visible},set:function(e){this._visible=e,this.parent&&this.parent.parent&&this.parent.parent.parent&&(0,o.default)(this.parent.parent.parent).setRenderList()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}}]),i}(d.default),g=v;t.default=g},function(e,t,n){var r=n(488);e.exports=r},function(e,t,n){n(489),e.exports=9007199254740991},function(e,t,n){var r=n(8);r({target:"Number",stat:!0},{MAX_SAFE_INTEGER:9007199254740991})},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(2)),s=r(n(3)),l=r(n(5)),u=r(n(6)),h=r(n(7)),c=r(n(17));function d(r){var i=f();return function(){var e,t=(0,h.default)(r),n=i?(e=(0,h.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,u.default)(this,n)}}function f(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var p=function(e){(0,l.default)(n,e);var t=d(n);function n(){var e;return(0,o.default)(this,n),e=t.call(this),e._scene=new fm.Scene,e}return(0,s.default)(n,[{key:"scene",get:function(){return this._scene}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}}]),n}(c.default),m=p;t.default=m},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(2)),s=r(n(3)),l=r(n(5)),u=r(n(6)),h=r(n(7)),c=r(n(17));function d(r){var i=f();return function(){var e,t=(0,h.default)(r),n=i?(e=(0,h.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,u.default)(this,n)}}function f(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var p=function(e){(0,l.default)(n,e);var t=d(n);function n(){var e;return(0,o.default)(this,n),e=t.call(this),e._scene=new fm.Scene,e}return(0,s.default)(n,[{key:"checkSceneNode",value:function(){}},{key:"dispose",value:function(){}},{key:"scene",get:function(){return this._scene}}]),n}(c.default),m=p;t.default=m},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),u=r(n(2)),o=r(n(5)),s=r(n(6)),l=r(n(7)),h=r(n(226));function c(r){var i=d();return function(){var e,t=(0,l.default)(r),n=i?(e=(0,l.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,s.default)(this,n)}}function d(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var f=function(e){(0,o.default)(l,e);var s=c(l);function l(e,t,n){var r,i,a,o;return(0,u.default)(this,l),r=s.call(this,e,t),n&&(i=new h.default,a=i.createGeometry(1.5,20,24,.5),o=new fm.BufferGeometry,o.addAttribute("position",new fm.Float32BufferAttribute(a.vertice,3)),o.addAttribute("uv",new fm.Float32BufferAttribute(a.uv,2)),o.setIndex(new fm.Uint16BufferAttribute(a.index,1)),r.geometry=o,r.material=new fm.MeshBasicMaterial({map:n,depthTest:!1}),r.material.side=2,r.material.transparent=!0),r}return l}(fm.Mesh),p=f;t.default=p},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(2)),s=r(n(5)),l=r(n(6)),u=r(n(7)),h=r(n(17));function c(r){var i=d();return function(){var e,t=(0,u.default)(r),n=i?(e=(0,u.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,l.default)(this,n)}}function d(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var f=function(e){(0,s.default)(n,e);var t=c(n);function n(){return(0,o.default)(this,n),t.call(this)}return n}(h.default),p=f;t.default=p},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),l=r(n(49)),o=r(n(2)),s=r(n(3)),u=r(n(5)),h=r(n(6)),c=r(n(7)),d=r(n(17)),f=r(n(46));function p(r){var i=m();return function(){var e,t=(0,c.default)(r),n=i?(e=(0,c.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,h.default)(this,n)}}function m(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var v=function(e){(0,u.default)(n,e);var t=p(n);function n(){var e;return(0,o.default)(this,n),e=t.call(this),e._scene=new fm.Scene,e._scene.userData.type="domMarker",e.alias="domMarker",e._visible=!0,e.domMarkers=[],e.anchor=9,e.temp=[],e}return(0,s.default)(n,[{key:"addMarker",value:function(e){var t,n,r;e.parent=this,this.domMarkers.push(e);var i=new Date,a=i.getTime(),o=Math.random();e._param.id="domMarker"+a+o,e.initDom(e._param);var s=this.findParent(f.default);s&&(s._map.on("mapViewChanged",(0,l.default)(t=this._moveMarker).call(t,this)),s._map.on("focusGroupIDChanged",(0,l.default)(n=this._displayMarker).call(n,this)),s._map.on("visibleGroupIDsChanged",(0,l.default)(r=this._displayMarker).call(r,this)))}},{key:"_moveMarker",value:function(){var e=this.findParent(f.default);if(e)for(var t=0;t<this.domMarkers.length;t++){var n,r,i=this.domMarkers[t],a=i.domNode;a&&(n=null,n=i.height?i.height+this.height:this.height,r=e._map.coordMapToScreen(i.x,i.y,n),a.style.left=this._anchor(i,r).left,a.style.top=this._anchor(i,r).top)}}},{key:"_anchor",value:function(e,t){var n=null,r=null;switch(e.anchor){case 9:n=t.x-e.domWidth/2+"px",r=t.y-e.domHeight/2+"px";break;case 5:n=t.x-e.domWidth+"px",r=t.y-e.domHeight+"px";break;case 6:n=t.x+"px",r=t.y-e.domHeight+"px";break;case 7:n=t.x-e.domWidth+"px",r=t.y+"px";break;case 8:n=t.x+"px",r=t.y+"px";break;case 1:n=t.x-e.domWidth+"px",r=t.y-e.domHeight/2+"px";break;case 2:n=t.x+"px",r=t.y-e.domHeight/2+"px";break;case 3:n=t.x-e.domWidth/2+"px",r=t.y-e.domHeight+"px";break;case 4:n=t.x-e.domWidth/2+"px",r=t.y+"px";break;default:n=t.x-e.domWidth/2+"px",r=t.y-e.domHeight/2+"px"}return{left:n,top:r}}},{key:"_displayMarker",value:function(){var e=this.findParent(f.default);if(e)if(1===e._map._visibleGroups.length)if(this.parent.eid===e._map.focusGroupID)for(var t=0;t<this.domMarkers.length;t++)this.domMarkers[t].domNode.style.display="block",this.domMarkers[t].domNode.style.opacity=1;else for(var n=0;n<this.domMarkers.length;n++)this.domMarkers[n].domNode.style.display="none",this.domMarkers[n].domNode.style.opacity=e._map.MapOptions.focusAlpha;else if(this.parent.eid===e._map.focusGroupID)for(var r=0;r<this.domMarkers.length;r++)this.domMarkers[r].domNode.style.display="block",this.domMarkers[r].domNode.style.opacity=1;else for(var i=0;i<this.domMarkers.length;i++)this.domMarkers[i].domNode.style.display="block",this.domMarkers[i].domNode.style.opacity=e._map.MapOptions.focusAlpha}},{key:"_displayMarker2",value:function(){var e=this.findParent(f.default);e&&e._map._visibleGroups.length}},{key:"removeMarker",value:function(e){var t;void 0!==e&&(e.parent=null,t=document.getElementById(e._param.id),t&&(t.parentNode.removeChild(t),t=null))}},{key:"removeAll",value:function(){if(void 0!==this.domMarkers.length)for(var e=0;e<this.domMarkers.length;e++){var t=document.getElementById(this.domMarkers[e]._param.id);t&&(t.parentNode.removeChild(t),t=null)}}},{key:"dispose",value:function(){this.removeAll()}},{key:"scene",get:function(){return this._scene}},{key:"height",get:function(){return this.parent._height}},{key:"show",get:function(){return this.show},set:function(e){if(void 0!==this.domMarkers.length)for(var t=0;t<this.domMarkers.length;t++){var n=document.getElementById(this.domMarkers[t]._param.id);n&&(n.style.display=e?"block":"none")}}}]),n}(d.default),g=v;t.default=g},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(2)),s=r(n(3)),l=r(n(5)),u=r(n(6)),h=r(n(7)),c=r(n(17));function d(r){var i=f();return function(){var e,t=(0,h.default)(r),n=i?(e=(0,h.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,u.default)(this,n)}}function f(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var p=function(e){(0,l.default)(n,e);var t=d(n);function n(){var e;return(0,o.default)(this,n),e=t.call(this),e._scene=new fm.Scene,e._scene.name="waterMarker",e._scene.userData.type="waterMarker",e._visible=!0,e.waters=[],e.initLight(),e.putLight(),e}return(0,s.default)(n,[{key:"addMarker",value:function(e){e.parent=this,e.isInitWater||(e.initWater(),e.renderNode&&(this.waters.push(e.renderNode),this._scene.add(e.renderNode)))}},{key:"checkSceneNode",value:function(){this._scene.children.length=0;for(var e=0;e<this.waters.length;e++)this.waters[e].visible&&this.waters[e].renderNode&&this._scene.add(this.waters[e].renderNode)}},{key:"initLight",value:function(){this._ambientLight=new fm.AmbientLight(7631988),this._target=new fm.Object3D,this._mainLight=new fm.DirectionalLight(8947848,1.2),this._mainLight.position.set(-1,1,1).normalize(),this._mainLight.target=this._target,this._secondLight=new fm.DirectionalLight(3355443),this._secondLight.position.set(-.5,1,-1).normalize(),this._secondLight.target=this._target}},{key:"putLight",value:function(){var e=this;this.scene.add(this._mainLight),this.scene.add(this._ambientLight),this.scene.add(this._secondLight),this.scene.add(this._target),this.scene.removeLight=function(){e.removeLight()}}},{key:"dispose",value:function(){for(var e=0;e<this.waters.length;e++)this._scene.remove(this.waters[e].renderNode),this.waters[e].parent=void 0,this.waters[e]=void 0;this._scene.length=0,this._scene=void 0}},{key:"scene",get:function(){return this._scene}},{key:"visible",get:function(){return this._visible}}]),n}(c.default),m=p;t.default=m},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(2)),s=r(n(3)),l=r(n(5)),u=r(n(6)),h=r(n(7)),c=r(n(17));function d(r){var i=f();return function(){var e,t=(0,h.default)(r),n=i?(e=(0,h.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,u.default)(this,n)}}function f(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var p=function(e){(0,l.default)(n,e);var t=d(n);function n(){var e;return(0,o.default)(this,n),e=t.call(this),e._scene=new fm.Scene,e._scene.userData.type="dynline",e._scene.name="dynline",e.alias="dynline",e.lines=[],e._visible=!0,e}return(0,s.default)(n,[{key:"addMarker",value:function(e){e.parent=this,e.initLine(),e.renderNode&&this._scene.add(e.renderNode),this.lines.push(e)}},{key:"dispose",value:function(){for(var e=0;e<this.lines.length;e++)this._scene.remove(this.lines[e].renderNode),this.lines[e].parent=void 0,this.lines[e]=void 0;this._scene.length=0,this._scene=void 0}},{key:"scene",get:function(){return this._scene}},{key:"visible",get:function(){return this._visible}}]),n}(c.default),m=p;t.default=m},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(20)),u=r(n(14)),h=r(n(21)),c=r(n(22)),a=r(n(18)),o=r(n(13)),V=r(n(112)),H=r(n(30)),j=r(n(31)),W=r(n(9)),d=r(n(27)),s=r(n(2)),f=r(n(3)),Y=r(n(41)),p=n(503),m=n(504),v=n(145),g=r(n(505)),y=r(n(228));function q(e,t){var n;if(void 0===c.default||null==(0,h.default)(e)){if((0,u.default)(e)||(n=_(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=(0,l.default)(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function _(e,t){var n;if(e){if("string"==typeof e)return x(e,t);var r=(0,o.default)(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?(0,a.default)(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x(e,t):void 0}}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var w=function(){function n(e,t){(0,s.default)(this,n),this._map=e,this.font=t.font,this._canvas=t.canvas,this._tmpCanvas=t.tempCanvas,this._data={},this._waitData={},this._textureData={},this._waitTextureDate={},this._textureArray=[],this._textData={},this.fmCanvasUtils=new g.default(this._tmpCanvas),this.extrudeMaterial={},this.poiMaterial={}}return(0,f.default)(n,[{key:"createBasicMaterial",value:function(e){var t=new fm.MeshBasicMaterial;return e?(t.color=new fm.Color(e.color),t.transparent=!0,t.depthWrite=!0,t.opacity=(0,d.default)(e.alpha),t.userData.opacity=(0,d.default)(e.alpha)):t.userData.opacity=1,t}},{key:"createNormalMaterial",value:function(e){var t=new fm.MeshLambertMaterial;return e?(t.color=new fm.Color(e.color),t.transparent=!0,t.depthWrite=!0,t.opacity=(0,d.default)(e.alpha),t.userData.opacity=(0,d.default)(e.alpha)):t.userData.opacity=1,t}},{key:"createPhysicMaterial",value:function(e){var t=new fm.MeshStandardMaterial({roughness:.5,metalness:.5});return e?(t.color=new fm.Color(e.color),t.transparent=!0,t.depthWrite=!0,t.opacity=(0,d.default)(e.alpha),t.userData.opacity=(0,d.default)(e.alpha)):t.userData.opacity=1,t}},{key:"createMeshPhongMaterial",value:function(e){var t=new fm.MeshPhongMaterial({shininess:50,specular:16777215});return e?(t.color=new fm.Color(e.color),t.transparent=!0,t.depthWrite=!0,t.opacity=(0,d.default)(e.alpha),t.userData.opacity=(0,d.default)(e.alpha)):t.userData.opacity=1,t}},{key:"createLineMaterial",value:function(e){if(!e)return new fm.LineBasicMaterial({color:"#ff0000",linewidth:1,transparent:!0,opacity:1});var t="#ff0000",t="number"==typeof e.strokeColor||e.strokeColor?e.strokeColor:"#ff0000",n={color:t,linewidth:1,transparent:!0,opacity:(0,d.default)(e.alpha)},r=new fm.LineBasicMaterial(n);return r.userData.opacity=(0,d.default)(e.alpha),r}},{key:"createPoiMaterial",value:function(e,t,n,r,i){var a,o,s,l=this,u=this.paramCode(r,i,e.imageUrl);return this.poiMaterial[u]?(s=this.poiMaterial[u],n&&n()):(s=new fm.SpriteMaterial,s.sizeAttenuation=!1,s.opacity=1,s.userData.opacity=1,s.depthTest=!!r,s.depthWrite=!!r,s.transparent=!0,s.side=2,s.priority=i,this.poiMaterial[u]=s,this._textureData[e.imageUrl]?this._textureData[e.imageUrl].image&&this._textureData[e.imageUrl].image.complete?(a=this._textureData[e.imageUrl],s.map=a,s.needsUpdate=!0,s.userData.scaleRatio=a.scaleRatio,n&&n()):this._pushWaitTextureDate(e.imageUrl,{material:s,node:t,callback:n}):(this._pushWaitTextureDate(e.imageUrl,{material:s,node:t,callback:n}),o=v.FMTextureUtil.createTexture(this._canvas,e.imageSrc,function(e){e.scaleRatio=e.image.width/e.image.height;for(var t=0;t<l._waitTextureDate[e.url].length;t++){var n=l._waitTextureDate[e.url][t];l._setMaterialMap(n.material,e,n.node,n.callback)}l._waitTextureDate[e.url]=[]}),o.url=e.imageUrl,this._textureData[e.imageUrl]=o,this._textureArray.push(o))),s}},{key:"paramCode",value:function(e,t,n){return[!!e,t,n].join()}},{key:"_setMaterialMap",value:function(e,t,n,r){e.map=t,e.needsUpdate=!0,e.userData.scaleRatio=t.scaleRatio,n&&n.setSize(),this._map.avoidMarkers(),r&&r()}},{key:"createLabelMaterial",value:function(e,t,n,r){var i=this,a=new fm.SpriteMaterial;a.sizeAttenuation=!1,a.opacity=(0,d.default)(t.alpha),a.userData.opacity=(0,d.default)(t.alpha),a.depthTest=!!n,a.depthWrite=!!n,a.transparent=!0,a.side=2,a.opacity=1;var o,s=!1;return t.imageSrc?this._data[t.imageUrl]?this._data[t.imageUrl].complete?(s=this._data[t.imageUrl],this._createMaterialTexture(e,s,t,a)):this._pushWaitData(t.imageUrl,{name:e,theme:t,material:a,node:r}):(this._pushWaitData(t.imageUrl,{name:e,theme:t,material:a,node:r}),o=y.default.createImage(this._tmpCanvas,t.imageSrc,function(e){if(i._waitData[e.url]){for(var t=0;t<i._waitData[e.url].length;t++){var n=i._waitData[e.url][t];i._createMaterialTexture(n.name,e,n.theme,n.material,n.node)}i._waitData[e.url]=[]}}),o.url=t.imageUrl,i._data[t.imageUrl]=o):this._createMaterialTexture(e,s,t,a),a}},{key:"_pushWaitData",value:function(e,t){void 0===this._waitData[e]&&(this._waitData[e]=[]),this._waitData[e].push(t)}},{key:"_pushWaitTextureDate",value:function(e,t){void 0===this._waitTextureDate[e]&&(this._waitTextureDate[e]=[]),this._waitTextureDate[e].push(t)}},{key:"_createMaterialTexture",value:function(e,t,n,r,i){var a=this.fmCanvasUtils.createIconTextCanvas(e,this.font.family,t,n),o=v.FMTextureUtil.createTexture(this._canvas,a.toDataURL("image/png"),function(e){r.map=e,r.needsUpdate=!0});this._textureArray.push(o),r.userData.scaleRatio=a.height/a.width,r.userData.mspriteScale=a.spriteScale,i&&i.setSize(),this._map.avoidMarkers()}},{key:"excuteSDFLabelTexture",value:function(e,t,n,r){var i=1,a=1.5*i,o=12*i,s=2*i;t||(o=0,s=0);var l=2*i,u=3*i,h=3*i,c=14*i,d=1,f=2*i,p=this._tmpCanvas,m=p.getContext("2d"),v=this.font.family;m.font=c+"px "+v;var g,y,_,x,w,b,M,T=-1<(0,W.default)(e).call(e,"%rn%");if(T){g=e.split("%rn%");var S,E=0,A=0,I=q(g);try{for(I.s();!(S=I.n()).done;){var L=S.value,E=Math.max(m.measureText(L).width,E);A+=c}}catch(e){I.e(e)}finally{I.f()}A+=(g.length-1)*l,d=g.length,N=E+s+o+2*h,k=Math.max(A,o)+2*u}else var R=m.measureText(e).width,N=R+s+o+2*h,k=Math.max(c,o)+2*u;if(r)return{scaleRatio:k/N,mspriteScale:d};p.width=N,p.height=k,p.style.width=N+"px",p.style.height=k+"px",(n.platecolor||n.platestrokecolor)&&(y=n.platecolor.split(","),n.platecolor&&(m.fillStyle=(0,j.default)(_=(0,j.default)(x="rgb(".concat((0,H.default)(y[0]),",")).call(x,(0,H.default)(y[1]),",")).call(_,(0,H.default)(y[2]),")")),m.lineWidth=i,this.drawRadiuRect(m,N,k,5*i,{x:0,y:0}),n.platecolor&&(0,V.default)(m).call(m),n.platestrokecolor&&(M=n.platestrokecolor.split(","),m.strokeStyle=(0,j.default)(w=(0,j.default)(b="rgb(".concat((0,H.default)(M[0]),",")).call(b,(0,H.default)(M[1]),",")).call(w,(0,H.default)(M[2]),")"),m.stroke()),m.beginPath());var P=o+s,C=(k-o)/2,D=(k-c)/2;m.font=c+"px "+v,m.textBaseline="top",m.strokeStyle=Y.default.toRgba(n.strokecolor),m.lineWidth=f;var O=0;if(O*=i,T)for(var F=u,B=0;B<g.length;B++)B&&(F+=c+l),m.strokeText(g[B],P,F);else m.strokeText(e,P,D+a+O);if(m.fillStyle=Y.default.toRgba(n.fillcolor),T)for(var U=u,z=0;z<g.length;z++)z&&(U+=c+l),m.fillText(g[z],P,U);else m.fillText(e,P,D+a+O);t&&m.drawImage(t,0,C,o,o);var G=new fm.CanvasTexture(p);return G.minFilter=fm.LinearFilter,G.generateMipmaps=!1,G.scaleRatio=p.height/p.width,G.mspriteScale=d,G}},{key:"excuteLabelTexture",value:function(r,i,a){var o=this,e=!1;i.imageSrc&&(this._data[i.imageUrl]?e=this._data[i.imageUrl]:y.default.createImage(this._tmpCanvas,i.imageSrc,function(e){var t=o.fmCanvasUtils.createIconTextCanvas(r,o.font.family,e,i),n=v.FMTextureUtil.createTexture(o._canvas,t.toDataURL("image/png"),a);return n.scaleRatio=t.height/t.width,n.mspriteScale=t.spriteScale,o._data[i.imageUrl]=e,n}));var t=this.fmCanvasUtils.createIconTextCanvas(r,this.font.family,e,i),n=v.FMTextureUtil.createTexture(this._canvas,t.toDataURL("image/png"),a);return n.scaleRatio=t.height/t.width,n.mspriteScale=t.spriteScale,n}},{key:"createTextMaterial",value:function(e,t){var n=new fm.SpriteMaterial;n.sizeAttenuation=!1,n.opacity=(0,d.default)(1),n.userData.opacity=(0,d.default)(1),n.depthTest=!1,n.depthWrite=!1,n.transparent=!0,n.side=2;var r=this.fmCanvasUtils.createTextCanvas(e,this.font.family,!1,t);return v.FMTextureUtil.createTexture_canvas(this._canvas,r,function(e){n.map=e,n.needsUpdate=!0}),n.size=r.size,n.userData.scaleRatio=r.height/r.width,n.userData.mspriteScale=r.spriteScale,n.needsUpdate=!0,n}},{key:"drawRadiuRect",value:function(e,t,n,r,i){var a=i,o={x:i.x+t,y:i.y},s={x:i.x,y:i.y+n},l={x:i.x+t,y:i.y+n},u={x:a.x+r,y:a.y},h={x:o.x-r,y:o.y},c={x:o.x,y:o.y+r},d={x:l.x,y:l.y-r},f={x:l.x-r,y:l.y},p={x:s.x+r,y:s.y},m={x:s.x,y:s.y-r},v={x:a.x,y:a.y+r};e.beginPath(),e.moveTo(u.x,u.y),e.lineTo(h.x,h.y),e.arcTo(o.x,o.y,c.x,c.y,r),e.lineTo(d.x,d.y),e.arcTo(l.x,l.y,f.x,f.y,r),e.lineTo(p.x,p.y),e.arcTo(s.x,s.y,m.x,m.y,r),e.lineTo(v.x,v.y),e.arcTo(a.x,a.y,u.x,u.y,r),e.closePath()}},{key:"measureText",value:function(e,t,n){var r=document.createElement("div");r.style.fontSize=n+"px",r.style.position="absolute",r.style.fontStyle=e,r.style.whiteSpace="nowrap",r.innerHTML=t;var i={width:r.clientWidth,height:r.clientHeight};return document.body.removeChild(r),i}},{key:"loadTexture",value:function(t,n){var r=this;if("string"!=typeof t){var e=new fm.Texture;return e.image=t,e.needsUpdate=!0,n(e),e}"data"!==t.substring(0,4)&&this._textureData[t]&&n&&n(this._textureData[t]);var i=v.FMTextureUtil.createTexture(this._canvas,t,function(e){"data"!==t.substring(0,4)&&(r._textureData[t]=e),n&&n(e)});return this._textureArray.push(i),i}},{key:"getHeatMapGradient",value:function(e){var t=this._tmpCanvas,n=t.getContext("2d"),r=8,i=128;t.width=r,t.height=i,t.style.width=r+"px",t.style.height=i+"px";var a,o=n.createLinearGradient(0,0,8,128);for(a in e)o.addColorStop(a,e[a]);n.fillStyle=o,n.fillRect(0,0,8,128);var s=new fm.CanvasTexture(t);return this._textureArray.push(s),s}},{key:"createNormalLineTexture",value:function(e){var t=this.fmCanvasUtils.createNormalLineImage(e);return v.FMTextureUtil.createTexture(this._canvas,t)}},{key:"createArrowWidthBackTexture",value:function(e){var t=this.fmCanvasUtils.createFMArrowCanvasImage(e);return v.FMTextureUtil.createTexture(this._canvas,t)}},{key:"createArrowLineTexture",value:function(e){var t=this.fmCanvasUtils.createArrowCanvasImage(e);return v.FMTextureUtil.createTexture(this._canvas,t)}},{key:"rotateCanvas",value:function(e,t,n,r){var i=this._tmpCanvas,a=i.getContext("2d");i.width=n,i.height=r,i.style.width=n+"px",i.style.height=r+"px",a.drawImage(e,0,0,n,r)}},{key:"dispose",value:function(){var e,t,n,r,i=q(this._textureArray);try{for(i.s();!(e=i.n()).done;){var a=e.value;a.dispose()}}catch(e){i.e(e)}finally{i.f()}for(t in this._textureArray.length=0,this._textureData)this._textureData[t]=void 0;for(n in this.data)this._data[n]=void 0;for(r in this._waitData={},this._waitTextureDate={},this.extrudeMaterial)this.extrudeMaterial[r].dispose()}},{key:"getExtrudeMaterial",value:function(e,t){if(this.extrudeMaterial[e+t])return this.extrudeMaterial[e+t];var n=new fm.RawShaderMaterial({uniforms:{color:{value:new fm.Color(e)},alpha:{value:t}},vertexShader:p.RawExtrudeVertShader,fragmentShader:m.RawExtrudeFragShader});return n.transparent=!0,this.extrudeMaterial[e+t]=n,n}},{key:"data",get:function(){return this._data},set:function(e){this._data=e}},{key:"textureData",get:function(){return this._textureData},set:function(e){this._textureData=e}},{key:"textureArray",get:function(){return this._textureArray},set:function(e){this._textureArray=e}}]),n}(),b=w;t.default=b},function(e,t,n){var r=n(499);e.exports=r},function(e,t,n){var r=n(500),i=Array.prototype;e.exports=function(e){var t=e.fill;return e===i||e instanceof Array&&t===i.fill?r:t}},function(e,t,n){n(501);var r=n(24);e.exports=r("Array").fill},function(e,t,n){var r=n(8),i=n(502),a=n(126);r({target:"Array",proto:!0},{fill:i}),a("fill")},function(e,t,n){"use strict";var u=n(38),h=n(103),c=n(44);e.exports=function(e,t,n){for(var r=u(this),i=c(r.length),a=arguments.length,o=h(1<a?t:void 0,i),s=2<a?n:void 0,l=void 0===s?i:h(s,i);o<l;)r[o++]=e;return r}},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.RawExtrudeVertShader=void 0;var i="\nprecision mediump float;\nprecision mediump int;\n\nattribute vec3 position;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvoid main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n ";t.RawExtrudeVertShader=i},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.RawExtrudeFragShader=void 0;var i="\nprecision mediump float;\nprecision mediump int;\n\nuniform vec3 color;\nuniform float alpha;\n\nvoid main() {\n gl_FragColor = vec4(color,alpha);\n}\n ";t.RawExtrudeFragShader=i},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(20)),u=r(n(14)),h=r(n(21)),c=r(n(22)),a=r(n(18)),o=r(n(13)),D=r(n(27)),O=r(n(9)),F=r(n(12)),B=r(n(112)),d=r(n(36)),f=r(n(229)),s=r(n(2)),p=r(n(3)),m=n(230),U=r(n(41));function z(e,t){var n;if(void 0===c.default||null==(0,h.default)(e)){if((0,u.default)(e)||(n=v(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=(0,l.default)(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function v(e,t){var n;if(e){if("string"==typeof e)return g(e,t);var r=(0,o.default)(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?(0,a.default)(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var y=function(){function t(e){(0,s.default)(this,t),this.canvas=e}return(0,p.default)(t,[{key:"createNormalLineImage",value:function(n){this._initCanvas(n);var e=this.canvas,r=e.getContext("2d");r.save();var t=n.dashArray,i=(0,f.default)(t).call(t,function(e,t){return e+t}),a=this._getArrowMatrix(n.width,n.height),o=a.elements;r.transform(o[0],o[3],o[1],o[4],o[2],o[6]);var s=0;(0,d.default)(t).call(t,function(e,t){t%2==0&&(r.fillStyle=n.color,r.fillRect(s/i*n.width,0,e/i*n.width,n.height)),s+=e});var l=e.toDataURL("image/png");return r.restore(),l}},{key:"createFMArrowCanvasImage",value:function(e){this._initCanvas(e);var t=this.canvas,n=t.getContext("2d");n.save(),n.clearRect(0,0,e.width,e.height),n.fillStyle=e.godEdgeColor,n.fillRect(0,0,e.width,e.height);var r=e.width*(1-e.godEdgePercent);n.fillStyle=e.godColor,n.fillRect((e.width-r)/2,0,r,e.height),n.fillStyle="#ffffff",n.shadowOffsetX=-2,n.shadowOffsetY=2,n.shadowBlur=4,n.shadowColor="rgba(0,0,0,0.5)";var i={x:e.width/2,y:e.height/2},a=e.height*e.godArrowPercent,o=r*e.godArrowWidthPercent,s=e.arrowWidth,l=i.x-o/2,u=i.y+a/2;n.beginPath(),n.moveTo(l,u),n.lineTo(l,u+s),n.lineTo(l+o/2,u-a+s),n.lineTo(l+o,u+s),n.lineTo(l+o,u),n.lineTo(l+o/2,u-a),n.closePath(),n.fillStyle=e.godArrowColor,(0,B.default)(n).call(n);var h=t.toDataURL("image/png");return n.restore(),h}},{key:"createArrowCanvasImage",value:function(e){this._initCanvas(e);var t=this.canvas,n=t.getContext("2d");n.save();var r=(1-e.arrowHeightPercent)*e.height/2,i=e.height*e.arrowHeightPercent,a=this._getArrowMatrix(e.width,e.height),o=a.elements;n.transform(o[0],o[3],o[1],o[4],o[2],o[6]),n.beginPath(),n.moveTo(0,r);var s=e.width*(e.arrowWidthPercent-e.arrowPercent);n.lineTo(s,r),n.lineTo(e.width*e.arrowWidthPercent,r+i/2),n.lineTo(s,r+i),n.lineTo(0,r+i),n.lineTo(e.width*e.arrowPercent,r+i/2),n.closePath(),n.fillStyle=e.color,(0,B.default)(n).call(n);var l=t.toDataURL("image/png");return n.restore(),l}},{key:"drawRadiusRect",value:function(e,t,n,r,i){var a=i,o={x:i.x+t,y:i.y},s={x:i.x,y:i.y+n},l={x:i.x+t,y:i.y+n},u={x:a.x+r,y:a.y},h={x:o.x-r,y:o.y},c={x:o.x,y:o.y+r},d={x:l.x,y:l.y-r},f={x:l.x-r,y:l.y},p={x:s.x+r,y:s.y},m={x:s.x,y:s.y-r},v={x:a.x,y:a.y+r};e.beginPath(),e.moveTo(u.x,u.y),e.lineTo(h.x,h.y),e.arcTo(o.x,o.y,c.x,c.y,r),e.lineTo(d.x,d.y),e.arcTo(l.x,l.y,f.x,f.y,r),e.lineTo(p.x,p.y),e.arcTo(s.x,s.y,m.x,m.y,r),e.lineTo(v.x,v.y),e.arcTo(a.x,a.y,u.x,u.y,r),e.closePath()}},{key:"createIconTextCanvas",value:function(e,t,n,r){r=(0,F.default)({},r);var i,a,o=2,s=3*o,l=3*o,u=2*o,h=2*o,c=0,d=0,f=1.5*r.fontsize*o,p=f+"px sans-serif",m=o,v=1.5*r.fontsize*o,g=1;n||(v=0,u=0);var y=this.canvas,_=y.getContext("2d");_.font=p;var x,w=-1<(0,O.default)(e).call(e,"%rn%");if(w){x=e.split("%rn%");var b,M=z(x);try{for(M.s();!(b=M.n()).done;){var T=b.value,c=Math.max(_.measureText(T).width,c);d+=f}}catch(e){M.e(e)}finally{M.f()}d+=(x.length-1)*h,i=c+u+v+2*l,a=Math.max(d,v)+2*s,g=a/(f+2*s)}else c=_.measureText(e).width,i=2*l+v+u+c,a=2*s+Math.max(f,v);y.spriteScale=g,y.width=i,y.height=a,y.style.width=i+"px",y.style.height=a+"px",_.clearRect(0,0,y.width,y.height),(r.platecolor||r.platestrokecolor)&&(r.platecolor&&(_.fillStyle=U.default.toRgba(r.platecolor)),_.lineWidth=o,this.drawRadiusRect(_,i-v-u,a,5*o,{x:v,y:0}),r.platecolor&&(0,B.default)(_).call(_),r.platestrokecolor&&(_.strokeStyle=U.default.toRgba(r.platestrokecolor),_.stroke()),_.beginPath());var S=(a-v)/2;n&&_.drawImage(n,l,S,v,v);var E=l+v+u,A=(a-f)/2,I=1.5*o;_.font=p,_.textBaseline="top";var L=1;r.strokewidth&&(L=(0,D.default)(r.strokewidth));var R=0;if(R*=o,r.strokecolor&&0!==L)if(_.lineWidth=3*m,_.font=p,_.strokeStyle=U.default.toRgba(r.strokecolor),w)for(var N=s,k=0;k<x.length;k++)k&&(N+=f+h),n?_.strokeText(x[k],E,N):"left"==r.textAlign?(_.textAlign="left",_.strokeText(x[k],0,N)):"right"==r.textAlign?(_.textAlign="right",_.strokeText(x[k],i,N)):(_.textAlign="center",_.strokeText(x[k],i/2,N));else n?_.strokeText(e,E,A+I+R):"left"===r.textAlign?_.strokeText(e,0,A+I+R):"right"===r.textAlign?(_.textAlign="right",_.strokeText(e,i,A+I+R)):"center"===r.textAlign?(_.textAlign="center",_.strokeText(e,i/2,A+I+R)):(_.textAlign="left",_.strokeText(e,E,A+I+R));if(_.lineWidth=m,_.font=p,_.fillStyle=U.default.toRgba(r.fillcolor),w)for(var P=s,C=0;C<x.length;C++)C&&(P+=f+h),n?_.fillText(x[C],E,P):"left"===r.textAlign?(_.textAlign="left",_.fillText(x[C],0,P)):"right"===r.textAlign?(_.textAlign="right",_.fillText(x[C],i,P)):(_.textAlign="center",_.fillText(x[C],i/2,P));else n?_.fillText(e,E,A+I+R):"left"===r.textAlign?(_.textAlign="left",_.fillText(e,0,A+I+R)):"right"===r.textAlign?(_.textAlign="right",_.fillText(e,i,A+I+R)):"center"===r.textAlign?(_.textAlign="center",_.fillText(e,i/2,A+I+R)):(_.textAlign="left",_.fillText(e,E,A+I+R));return y}},{key:"createTextCanvas",value:function(e,t,n,r){var i,a,o=2,s=3*o,l=3*o,u=2*o,h=2*o,c=0,d=0,f=r.fontsize*o,p=f+"px sans-serif",m=2*o,v=1.5*r.fontsize*o;n||(v=0,u=0);var g,y=this.canvas,_=y.getContext("2d"),x=z(e);try{for(x.s();!(g=x.n()).done;){var w=g.value,f=w.fontsize*o;_.font=p,c=Math.max(_.measureText(w.text).width,c),d+=f}}catch(e){x.e(e)}finally{x.f()}d+=(e.length-1)*h,i=c+u+v+2*l,a=Math.max(d,v)+2*s,y.spriteScale=e.length,y.width=i,y.height=a,y.style.width=i+"px",y.style.height=a+"px",_.clearRect(0,0,y.width,y.height),r.platecolor&&(_.fillStyle=U.default.toRgba(r.platecolor),_.lineWidth=o,this.drawRadiusRect(_,i,a,5*o,{x:0,y:0}),(0,B.default)(_).call(_),r.platestrokecolor&&(_.strokeStyle=U.default.toRgba(r.platestrokecolor),_.stroke()),_.beginPath()),_.textBaseline="top";for(var b=4,M=s,T=0;T<e.length;T++)e[T].strokecolor&&(_.lineWidth=m,f=e[T].fontsize*o,_.font=p,_.strokeStyle=U.default.toRgba(e[T].strokecolor),T&&(M+=e[T-1].fontsize*o+h),0===r.textAlign?(_.textAlign="left",_.strokeText(e[T].text,0,M+b)):2===r.textAlign?(_.textAlign="right",_.strokeText(e[T].text,i,M+b)):(_.textAlign="center",_.strokeText(e[T].text,i/2,M+b)));M=s;for(var S=0;S<e.length;S++)f=e[S].fontsize*o,_.font=p,_.fillStyle=U.default.toRgba(e[S].fontcolor),S&&(M+=e[S-1].fontsize*o+h),0===r.textAlign?(_.textAlign="left",_.fillText(e[S].text,0,M+b)):2===r.textAlign?(_.textAlign="right",_.fillText(e[S].text,i,M+b)):(_.textAlign="center",_.fillText(e[S].text,i/2,M+b));d=0;for(var E=null,A=0;A<e.length;A++)d+=e[A].fontsize;return E=1<e.length?(d+h*(e.length-1)+s)/e.length:d+s,y.size=E,y}},{key:"_initCanvas",value:function(e){e.width=m.FMMathUtils.findNearNthPowerOfTwo(e.width),e.height=m.FMMathUtils.findNearNthPowerOfTwo(e.height);var t=this.canvas;t.width=e.width,t.height=e.height,t.style.width=e.width+"px",t.style.height=e.height+"px"}},{key:"_getArrowMatrix",value:function(e,t){var n=new fm.Matrix3;n.set(Math.cos(Math.PI/2),-Math.sin(Math.PI/2),e/2,Math.sin(Math.PI/2),Math.cos(Math.PI/2),t/2,0,0,1);var r=new fm.Matrix3;return r.set(1,0,-e/2,0,1,-t/2,0,0,1),n.multiply(r),n}}]),t}(),_=y;t.default=_},function(e,t,n){var r=n(507);e.exports=r},function(e,t,n){var r=n(508),i=Array.prototype;e.exports=function(e){var t=e.reduce;return e===i||e instanceof Array&&t===i.reduce?r:t}},function(e,t,n){n(509);var r=n(24);e.exports=r("Array").reduce},function(e,t,n){"use strict";var r=n(8),i=n(510).left,a=n(87),o=n(51),s=a("reduce"),l=o("reduce",{1:0});r({target:"Array",proto:!0,forced:!s||!l},{reduce:function(e,t){return i(this,e,arguments.length,1<arguments.length?t:void 0)}})},function(e,t,n){var h=n(48),c=n(38),d=n(98),f=n(44),r=function(u){return function(e,t,n,r){h(t);var i=c(e),a=d(i),o=f(i.length),s=u?o-1:0,l=u?-1:1;if(n<2)for(;;){if(s in a){r=a[s],s+=l;break}if(s+=l,u?s<0:o<=s)throw TypeError("Reduce of empty array with no initial value")}for(;u?0<=s:s<o;s+=l)s in a&&(r=t(r,a[s],s,i));return r}};e.exports={left:r(!1),right:r(!0)}},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(2)),s=r(n(5)),l=r(n(6)),u=r(n(7)),h=r(n(512));function c(r){var i=d();return function(){var e,t=(0,u.default)(r),n=i?(e=(0,u.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,l.default)(this,n)}}function d(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var f=function(e){(0,s.default)(r,e);var n=c(r);function r(e){var t;return(0,o.default)(this,r),t=n.call(this,e),t.uniforms.diffuse={value:new fm.Vector3(1,1,1)},t.uniforms.offset={value:new fm.Vector2},t.uniforms.rotation={value:0},t.uniforms.scale={value:1},t.depthTest=!1,t.vertexShader=h.default.vert,t.fragmentShader=h.default.frag,t}return r}(fm.ShaderMaterial),p=f;t.default=p},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={vert:"\n \n uniform vec2 offset;\n uniform float rotation;\n uniform float scale;\n varying vec2 vUv;\n void main() {\n vUv = uv;\n \n \n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\n rotatedPosition.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n \n \n rotatedPosition.x *= scale * abs(projectionMatrix[0][0] / projectionMatrix[1][1]);\n rotatedPosition.y *= scale;\n \n rotatedPosition.xy += offset;\n gl_Position = vec4(rotatedPosition,0.0,1.0);\n }\n ",frag:"\n uniform vec3 diffuse;\n uniform sampler2D mapBack;\n uniform sampler2D mapfront;\n #include <common>\n varying vec2 vUv;\n \n void main() {\n vec4 diffuseColor = vec4( diffuse, 1.0 );\n vec2 muv = vec2(vUv.x , 1.0 - vUv.y);\n diffuseColor = texture2D( mapfront, muv );\n \n vec4 backColor = vec4(1.0 , 0.0 ,0.0 ,1.0);\n backColor = texture2D( mapBack, muv );\n\n float alphacomp = backColor.a + diffuseColor.a * (1.0 -backColor.a);\n vec3 resultColor = diffuseColor.rgb * diffuseColor.a + backColor.rgb * (1.0 - diffuseColor.a);\n gl_FragColor = vec4(resultColor , alphacomp);\n }\n "},a=i;t.default=a},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(20)),u=r(n(14)),h=r(n(21)),c=r(n(22)),a=r(n(18)),o=r(n(13)),s=r(n(10)),d=r(n(2)),f=r(n(3)),p=r(n(514)),m=r(n(234)),v=r(n(93));function g(e,t){var n;if(void 0===c.default||null==(0,h.default)(e)){if((0,u.default)(e)||(n=y(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=(0,l.default)(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function y(e,t){var n;if(e){if("string"==typeof e)return _(e,t);var r=(0,o.default)(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?(0,a.default)(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(e,t):void 0}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var x=function(){function i(e,t,n,r){(0,d.default)(this,i),this.map=e,this.preLoadModels={},this.waitingBacks={},this.waitingNodes=[],this._path=t,this.isRemote=n,this.key=r,this.externalLoadingCount=0}return(0,f.default)(i,[{key:"load",value:function(i){var e,t,a=this;this.externalLoadingCount++,t=this.isRemote?v.default+"webmodel/":this._path;var o=this.preLoadModels[i].modelUrl.split("."),n="js"===o[1]?(e=new p.default((0,s.default)(this)),o[0]+".js?keyValue="+this.key):(e=new m.default((0,s.default)(this)),o[0]+".glb?keyValue="+this.key);this.isRemote&&(n=o[0]+"/"+n),this.preLoadModels[i].isLoading=!0,e.setPath(t),e.load(n,function(e,t){for(var n in a.waitingBacks[i]){var r=a.waitingBacks[i][n];r(e,t,o[1])}a.externalLoadingCount--,a.externalLoadingCount<1&&a.loaded&&a.loaded(),a.preLoadModels[i].isGltf="js"!==o[1],a.preLoadModels[i].geometry=e,a.preLoadModels[i].material=t,a.waitingBacks[i].length=0,a.preLoadModels[i].isLoading=!1,a.preLoadModels[i].loaded=!0},function(){},function(e){console.error("模型加载或解析失败!",e),a.externalLoadingCount--,a.externalLoadingCount<1&&a.loaded&&a.loaded(),a.preLoadModels[i].isLoading=!1})}},{key:"addWaitingBacks",value:function(e,t,n){this.waitingBacks[e]||(this.waitingBacks[e]={}),this.waitingBacks[e][n]||(this.waitingBacks[e][n]=t)}},{key:"setLoadedBack",value:function(e){this.loaded=e}},{key:"checkAndLoadwaiting",value:function(){var e,t=g(this.waitingNodes);try{for(t.s();!(e=t.n()).done;)e.value}catch(e){t.e(e)}finally{t.f()}}}]),i}(),w=x;t.default=w},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(10)),s=r(n(31)),o=r(n(12)),u=r(n(232)),l=n(515);function h(e,t){this.map=e,"boolean"==typeof t&&(console.warn("fm.JSONLoader: showStatus parameter has been removed from constructor."),t=void 0),this.manager=void 0!==t?t:fm.DefaultLoadingManager,this.withCredentials=!1}function c(e,t){function n(e,t){return e&1<<t}var r,i,a,o,s,l,u,h,c,d,f,p,m,v,g,y,_,x,w,b,M,T,S,E,A,I,L,R=e.faces,N=e.vertices,k=e.normals,P=e.colors,C=e.scale,D=0;if(void 0!==e.uvs){for(r=0;r<e.uvs.length;r++)e.uvs[r].length&&D++;for(r=0;r<D;r++)t.faceVertexUvs[r]=[]}for(o=0,s=N.length;o<s;)x=new fm.Vector3,x.x=N[o++]*C,x.y=N[o++]*C,x.z=N[o++]*C,t.vertices.push(x);for(o=0,s=R.length;o<s;)if(d=R[o++],f=n(d,0),p=n(d,1),m=n(d,3),v=n(d,4),g=n(d,5),y=n(d,6),_=n(d,7),f){if(b=new fm.Face3,b.a=R[o],b.b=R[o+1],b.c=R[o+3],M=new fm.Face3,M.a=R[o+1],M.b=R[o+2],M.c=R[o+3],o+=4,p&&(c=R[o++],b.materialIndex=c,M.materialIndex=c),a=t.faces.length,m)for(r=0;r<D;r++)for(E=e.uvs[r],t.faceVertexUvs[r][a]=[],t.faceVertexUvs[r][a+1]=[],i=0;i<4;i++)h=R[o++],I=E[2*h],L=E[2*h+1],A=new fm.Vector2(I,L),2!==i&&t.faceVertexUvs[r][a].push(A),0!==i&&t.faceVertexUvs[r][a+1].push(A);if(v&&(u=3*R[o++],b.normal.set(k[u++],k[u++],k[u]),M.normal.copy(b.normal)),g)for(r=0;r<4;r++)u=3*R[o++],S=new fm.Vector3(k[u++],k[u++],k[u]),2!==r&&b.vertexNormals.push(S),0!==r&&M.vertexNormals.push(S);if(y&&(l=R[o++],T=P[l],b.color.setHex(T),M.color.setHex(T)),_)for(r=0;r<4;r++)l=R[o++],T=P[l],2!==r&&b.vertexColors.push(new fm.Color(T)),0!==r&&M.vertexColors.push(new fm.Color(T));t.faces.push(b),t.faces.push(M)}else{if(w=new fm.Face3,w.a=R[o++],w.b=R[o++],w.c=R[o++],p&&(c=R[o++],w.materialIndex=c),a=t.faces.length,m)for(r=0;r<D;r++)for(E=e.uvs[r],t.faceVertexUvs[r][a]=[],i=0;i<3;i++)h=R[o++],I=E[2*h],L=E[2*h+1],A=new fm.Vector2(I,L),t.faceVertexUvs[r][a].push(A);if(v&&(u=3*R[o++],w.normal.set(k[u++],k[u++],k[u])),g)for(r=0;r<3;r++)u=3*R[o++],S=new fm.Vector3(k[u++],k[u++],k[u]),w.vertexNormals.push(S);if(y&&(l=R[o++],w.color.setHex(P[l])),_)for(r=0;r<3;r++)l=R[o++],w.vertexColors.push(new fm.Color(P[l]));t.faces.push(w)}}function d(e,t){var n=void 0!==e.influencesPerVertex?e.influencesPerVertex:2;if(e.skinWeights)for(var r=0,i=e.skinWeights.length;r<i;r+=n){var a=e.skinWeights[r],o=1<n?e.skinWeights[r+1]:0,s=2<n?e.skinWeights[r+2]:0,l=3<n?e.skinWeights[r+3]:0;t.skinWeights.push(new fm.Vector4(a,o,s,l))}if(e.skinIndices)for(r=0,i=e.skinIndices.length;r<i;r+=n){var u=e.skinIndices[r],h=1<n?e.skinIndices[r+1]:0,c=2<n?e.skinIndices[r+2]:0,d=3<n?e.skinIndices[r+3]:0;t.skinIndices.push(new fm.Vector4(u,h,c,d))}t.bones=e.bones,t.bones&&0<t.bones.length&&(t.skinWeights.length!==t.skinIndices.length||t.skinIndices.length!==t.vertices.length)&&console.warn("When skinning, number of vertices ("+t.vertices.length+"), skinIndices ("+t.skinIndices.length+"), and skinWeights ("+t.skinWeights.length+") should match.")}function f(e,t){var n=e.scale;if(void 0!==e.morphTargets)for(var r=0,i=e.morphTargets.length;r<i;r++){t.morphTargets[r]={},t.morphTargets[r].name=e.morphTargets[r].name,t.morphTargets[r].vertices=[];for(var a=t.morphTargets[r].vertices,o=e.morphTargets[r].vertices,s=0,l=o.length;s<l;s+=3){var u=new fm.Vector3;u.x=o[s]*n,u.y=o[s+1]*n,u.z=o[s+2]*n,a.push(u)}}if(void 0!==e.morphColors&&0<e.morphColors.length){console.warn('fm.JSONLoader: "morphColors" no longer supported. Using them as face colors.');for(var h=t.faces,c=e.morphColors[0].colors,r=0,i=h.length;r<i;r++)h[r].color.fromArray(c,3*r)}}function p(e,t){var n=[],r=[];void 0!==e.animation&&r.push(e.animation),void 0!==e.animations&&(e.animations.length?r=(0,s.default)(r).call(r,e.animations):r.push(e.animations));for(var i,a=0;a<r.length;a++){var o=fm.AnimationClip.parseAnimation(r[a],t.bones);o&&n.push(o)}t.morphTargets&&(i=fm.AnimationClip.CreateClipsFromMorphTargetSequences(t.morphTargets,10),n=(0,s.default)(n).call(n,i)),0<n.length&&(t.animations=n)}(0,o.default)(h.prototype,{crossOrigin:"anonymous",load:function(a,o,e,t){var s=this,l=void 0===this.path?fm.LoaderUtils.extractUrlBase(a):this.path;this.resourcePath=l+"maps/";var n=new u.default(this.manager);n.setPath(this.path),n.setWithCredentials(this.withCredentials),n.load(a,function(e){var t=JSON.parse(e),n=t.metadata;if(void 0!==n){var r=n.type;if(void 0!==r&&"object"===r.toLowerCase())return void console.error("fm.JSONLoader: "+a+" should be loaded with fm.ObjectLoader instead.")}var i=s.parse(t,l);o(i.geometry,i.materials)},e,t)},setPath:function(e){return this.path=e,this},setResourcePath:function(e){return this.resourcePath=e,this},setCrossOrigin:function(e){return this.crossOrigin=e,this},parse:function(e,t){void 0!==e.data&&(e=e.data),void 0!==e.scale?e.scale=1/e.scale:e.scale=1;var n=new fm.Geometry;if(c(e,n),d(e,n),f(e,n),p(e,n),n.computeFaceNormals(),n.computeBoundingSphere(),void 0===e.materials||0===e.materials.length)return{geometry:n};var r=l.Loader.prototype.initMaterials((0,a.default)(this),e.materials,this.resourcePath||t,this.crossOrigin);return{geometry:n,materials:r}}});var m=h;t.default=m},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.Loader=v;var a,o,f,s,p=r(n(110)),l=r(n(12)),m=n(230),u=n(233);function v(){}v.Handlers={handlers:[],add:function(e,t){this.handlers.push(e,t)},get:function(e){for(var t=this.handlers,n=0,r=t.length;n<r;n+=2){var i=t[n],a=t[n+1];if(i.test(e))return a}return null}},(0,l.default)(v.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(e,t,n,r){for(var i=[],a=0;a<t.length;++a)i[a]=this.createMaterial(e,t[a],n,r);return i},createMaterial:(a={NoBlending:fm.NoBlending,NormalBlending:fm.NormalBlending,AdditiveBlending:fm.AdditiveBlending,SubtractiveBlending:fm.SubtractiveBlending,MultiplyBlending:fm.MultiplyBlending,CustomBlending:fm.CustomBlending},o=new fm.Color,f=new u.TextureLoader,s=new fm.MaterialLoader,function(u,e,h,c){var d={};function t(e,t,n,r,i){var a=h+e,o=v.Handlers.get(a),s=null!==o?o.load(a):(f._map=u,f.setCrossOrigin(c),f.load(a));void 0!==t&&((0,p.default)(s).fromArray(t),1!==t[0]&&(s.wrapS=fm.RepeatWrapping),1!==t[1]&&(s.wrapT=fm.RepeatWrapping)),void 0!==n&&s.offset.fromArray(n),void 0!==r&&("repeat"===r[0]&&(s.wrapS=fm.RepeatWrapping),"mirror"===r[0]&&(s.wrapS=fm.MirroredRepeatWrapping),"repeat"===r[1]&&(s.wrapT=fm.RepeatWrapping),"mirror"===r[1]&&(s.wrapT=fm.MirroredRepeatWrapping)),void 0!==i&&(s.anisotropy=i);var l=m.FMMathUtils.generateUUID();return d[l]=s,l}var n,r={uuid:m.FMMathUtils.generateUUID(),type:"MeshLambertMaterial"};for(n in e){var i=e[n];switch(n){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":r.name=i;break;case"blending":r.blending=a[i];break;case"colorAmbient":case"mapAmbient":break;case"colorDiffuse":r.color=o.fromArray(i).getHex();break;case"colorSpecular":r.specular=o.fromArray(i).getHex();break;case"colorEmissive":r.emissive=o.fromArray(i).getHex();break;case"specularCoef":r.shininess=i;break;case"shading":"basic"===i.toLowerCase()&&(r.type="MeshBasicMaterial"),"phong"===i.toLowerCase()&&(r.type="MeshPhongMaterial"),"standard"===i.toLowerCase()&&(r.type="MeshStandardMaterial");break;case"mapDiffuse":r.map=t(i,e.mapDiffuseRepeat,e.mapDiffuseOffset,e.mapDiffuseWrap,e.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":r.emissiveMap=t(i,e.mapEmissiveRepeat,e.mapEmissiveOffset,e.mapEmissiveWrap,e.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":r.lightMap=t(i,e.mapLightRepeat,e.mapLightOffset,e.mapLightWrap,e.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":r.aoMap=t(i,e.mapAORepeat,e.mapAOOffset,e.mapAOWrap,e.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":r.bumpMap=t(i,e.mapBumpRepeat,e.mapBumpOffset,e.mapBumpWrap,e.mapBumpAnisotropy);break;case"mapBumpScale":r.bumpScale=i;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":r.normalMap=t(i,e.mapNormalRepeat,e.mapNormalOffset,e.mapNormalWrap,e.mapNormalAnisotropy);break;case"mapNormalFactor":r.normalScale=i;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":r.specularMap=t(i,e.mapSpecularRepeat,e.mapSpecularOffset,e.mapSpecularWrap,e.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":r.metalnessMap=t(i,e.mapMetalnessRepeat,e.mapMetalnessOffset,e.mapMetalnessWrap,e.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":r.roughnessMap=t(i,e.mapRoughnessRepeat,e.mapRoughnessOffset,e.mapRoughnessWrap,e.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":r.alphaMap=t(i,e.mapAlphaRepeat,e.mapAlphaOffset,e.mapAlphaWrap,e.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":r.side=fm.BackSide;break;case"doubleSided":r.side=fm.DoubleSide;break;case"transparency":r.opacity=i;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":r[n]=i;break;case"vertexColors":!0===i&&(r.vertexColors=fm.VertexColors),"face"===i&&(r.vertexColors=fm.FaceColors);break;default:console.error("THREE.Loader.createMaterial: Unsupported",n,i)}}return"MeshBasicMaterial"===r.type&&delete r.emissive,"MeshPhongMaterial"!==r.type&&delete r.specular,r.opacity<1&&(r.transparent=!0),s.setTextures(d),s.parse(r)})})},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.ImageLoader=u;var s=r(n(10)),l=r(n(75)),a=r(n(64)),o=r(n(12));function u(e,t){fm.Loader.call(this,t),this.map=e}u.prototype=(0,o.default)((0,a.default)(fm.Loader.prototype),{constructor:u,load:function(t,e,n,r){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,a=fm.Cache.get(t);if(void 0!==a)return i.manager.itemStart(t),(0,l.default)(function(){e&&e(a),i.manager.itemEnd(t)},0),a;var o=(0,s.default)(this).canvas.createImage();return o.onload=function(){fm.Cache.add(t,this),e&&e(this),i.manager.itemEnd(t)},o.onerror=function(e){r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)},"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(t),o.src=t,o}})},function(e,t,n){e.exports=n(518)},function(e,t,n){var r=n(519);e.exports=r},function(e,t,n){n(108),n(57),n(40),n(520),n(523),n(524);var r=n(11);e.exports=r.Promise},function(e,t,n){"use strict";var r,i,a,o,s=n(8),l=n(74),u=n(19),h=n(50),c=n(235),d=n(85),f=n(107),p=n(58),m=n(188),v=n(23),g=n(48),y=n(106),_=n(71),x=n(170),w=n(90),b=n(182),M=n(236),T=n(237).set,S=n(521),E=n(239),A=n(522),I=n(146),L=n(240),R=n(52),N=n(166),k=n(25),P=n(129),C=k("species"),D="Promise",O=R.get,F=R.set,B=R.getterFor(D),U=c,z=u.TypeError,G=u.document,V=u.process,H=h("fetch"),j=I.f,W=j,Y="process"==_(V),q=!!(G&&G.createEvent&&u.dispatchEvent),X="unhandledrejection",Z="rejectionhandled",J=0,K=1,Q=2,$=1,ee=2,te=N(D,function(){var e=x(U)!==String(U);if(!e){if(66===P)return!0;if(!Y&&"function"!=typeof PromiseRejectionEvent)return!0}if(l&&!U.prototype.finally)return!0;if(51<=P&&/native code/.test(U))return!1;var t=U.resolve(1),n=function(e){e(function(){},function(){})},r=t.constructor={};return r[C]=n,!(t.then(function(){})instanceof n)}),ne=te||!b(function(e){U.all(e).catch(function(){})}),re=function(e){var t;return!(!v(e)||"function"!=typeof(t=e.then))&&t},ie=function(c,d,f){var p;d.notified||(d.notified=!0,p=d.reactions,S(function(){for(var e=d.value,t=d.state==K,n=0;p.length>n;){var r,i,a,o=p[n++],s=t?o.ok:o.fail,l=o.resolve,u=o.reject,h=o.domain;try{s?(t||(d.rejection===ee&&le(c,d),d.rejection=$),!0===s?r=e:(h&&h.enter(),r=s(e),h&&(h.exit(),a=!0)),r===o.promise?u(z("Promise-chain cycle")):(i=re(r))?i.call(r,l,u):l(r)):u(e)}catch(e){h&&!a&&h.exit(),u(e)}}d.reactions=[],d.notified=!1,f&&!d.rejection&&oe(c,d)}))},ae=function(e,t,n){var r,i;q?(r=G.createEvent("Event"),r.promise=t,r.reason=n,r.initEvent(e,!1,!0),u.dispatchEvent(r)):r={promise:t,reason:n},(i=u["on"+e])?i(r):e===X&&A("Unhandled promise rejection",n)},oe=function(r,i){T.call(u,function(){var e,t=i.value,n=se(i);if(n&&(e=L(function(){Y?V.emit("unhandledRejection",t,r):ae(X,r,t)}),i.rejection=Y||se(i)?ee:$,e.error))throw e.value})},se=function(e){return e.rejection!==$&&!e.parent},le=function(e,t){T.call(u,function(){Y?V.emit("rejectionHandled",e):ae(Z,e,t.value)})},ue=function(t,n,r,i){return function(e){t(n,r,e,i)}},he=function(e,t,n,r){t.done||(t.done=!0,r&&(t=r),t.value=n,t.state=Q,ie(e,t,!0))},ce=function(n,r,e,t){if(!r.done){r.done=!0,t&&(r=t);try{if(n===e)throw z("Promise can't be resolved itself");var i=re(e);i?S(function(){var t={done:!1};try{i.call(e,ue(ce,n,t,r),ue(he,n,t,r))}catch(e){he(n,t,e,r)}}):(r.value=e,r.state=K,ie(n,r,!1))}catch(e){he(n,{done:!1},e,r)}}};te&&(U=function(e){y(this,U,D),g(e),r.call(this);var t=O(this);try{e(ue(ce,this,t),ue(he,this,t))}catch(e){he(this,t,e)}},r=function(){F(this,{type:D,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:J,value:void 0})},r.prototype=f(U.prototype,{then:function(e,t){var n=B(this),r=j(M(this,U));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=Y?V.domain:void 0,n.parent=!0,n.reactions.push(r),n.state!=J&&ie(this,n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r,t=O(e);this.promise=e,this.resolve=ue(ce,e,t),this.reject=ue(he,e,t)},I.f=j=function(e){return e===U||e===a?new i(e):W(e)},l||"function"!=typeof c||(o=c.prototype.then,d(c.prototype,"then",function(e,t){var n=this;return new U(function(e,t){o.call(n,e,t)}).then(e,t)},{unsafe:!0}),"function"==typeof H&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(){return E(U,H.apply(u,arguments))}}))),s({global:!0,wrap:!0,forced:te},{Promise:U}),p(U,D,!1,!0),m(D),a=h(D),s({target:D,stat:!0,forced:te},{reject:function(e){var t=j(this);return t.reject.call(void 0,e),t.promise}}),s({target:D,stat:!0,forced:l||te},{resolve:function(e){return E(l&&this===a?U:this,e)}}),s({target:D,stat:!0,forced:ne},{all:function(e){var s=this,t=j(s),l=t.resolve,u=t.reject,n=L(function(){var r=g(s.resolve),i=[],a=0,o=1;w(e,function(e){var t=a++,n=!1;i.push(void 0),o++,r.call(s,e).then(function(e){n||(n=!0,i[t]=e,--o||l(i))},u)}),--o||l(i)});return n.error&&u(n.value),t.promise},race:function(e){var n=this,r=j(n),i=r.reject,t=L(function(){var t=g(n.resolve);w(e,function(e){t.call(n,e).then(r.resolve,i)})});return t.error&&i(t.value),r.promise}})},function(e,t,n){var r,i,a,o,s,l,u,h,c=n(19),d=n(80).f,f=n(71),p=n(237).set,m=n(238),v=c.MutationObserver||c.WebKitMutationObserver,g=c.process,y=c.Promise,_="process"==f(g),x=d(c,"queueMicrotask"),w=x&&x.value;w||(r=function(){var e,t;for(_&&(e=g.domain)&&e.exit();i;){t=i.fn,i=i.next;try{t()}catch(e){throw i?o():a=void 0,e}}a=void 0,e&&e.enter()},o=_?function(){g.nextTick(r)}:v&&!m?(s=!0,l=document.createTextNode(""),new v(r).observe(l,{characterData:!0}),function(){l.data=s=!s}):y&&y.resolve?(u=y.resolve(void 0),h=u.then,function(){h.call(u,r)}):function(){p.call(c,r)}),e.exports=w||function(e){var t={fn:e,next:void 0};a&&(a.next=t),i||(i=t,o()),a=t}},function(e,t,n){var r=n(19);e.exports=function(e,t){var n=r.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}},function(e,t,n){"use strict";var r=n(8),u=n(48),i=n(146),a=n(240),h=n(90);r({target:"Promise",stat:!0},{allSettled:function(e){var s=this,t=i.f(s),l=t.resolve,n=t.reject,r=a(function(){var r=u(s.resolve),i=[],a=0,o=1;h(e,function(e){var t=a++,n=!1;i.push(void 0),o++,r.call(s,e).then(function(e){n||(n=!0,i[t]={status:"fulfilled",value:e},--o||l(i))},function(e){n||(n=!0,i[t]={status:"rejected",reason:e},--o||l(i))})}),--o||l(i)});return r.error&&n(r.value),t.promise}})},function(e,t,n){"use strict";var r=n(8),i=n(74),a=n(235),o=n(16),s=n(50),l=n(236),u=n(239),h=n(85),c=!!a&&o(function(){a.prototype.finally.call({then:function(){}},function(){})});r({target:"Promise",proto:!0,real:!0,forced:c},{finally:function(t){var n=l(this,s("Promise")),e="function"==typeof t;return this.then(e?function(e){return u(n,t()).then(function(){return e})}:t,e?function(e){return u(n,t()).then(function(){throw e})}:t)}}),i||"function"!=typeof a||a.prototype.finally||h(a.prototype,"finally",s("Promise").prototype.finally)},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=r(n(234)),l=function(){function t(e){(0,a.default)(this,t),this._map=e,this.dynamicModel={},this.loader=new s.default(this._map)}return(0,o.default)(t,[{key:"load",value:function(i,t,e){var a=this;this.dynamicModel[i]?0==this.dynamicModel[i].loadComplete?(this.dynamicModel[i].scbs.push(t),this.dynamicModel[i].fcbs.push(e)):this.dynamicModel[i].error?e&&e(this.dynamicModel[i].error):t&&this.loader.parse(this.dynamicModel[i].data,fm.LoaderUtils.extractUrlBase(i),function(e){t(e)},function(){}):(this.dynamicModel[i]={gltf:null,loadComplete:!1,error:null,scbs:[],fcbs:[]},this.dynamicModel[i].scbs.push(t),this.dynamicModel[i].fcbs.push(e),this.loader.load(i,function(e,t){a.dynamicModel[i].gltf=e,a.dynamicModel[i].data=t,a.dynamicModel[i].loadComplete=!0;for(var n=a.dynamicModel[i].scbs,r=0;r<n.length;r++)n[r]&&n[r](e)},void 0,function(e){a.dynamicModel[i].error=e,a.dynamicModel[i].loadComplete=!0;for(var t=a.dynamicModel[i].fcbs,n=0;n<t.length;n++)t[n]&&t[n](e)}))}},{key:"dispose",value:function(){this.dynamicModel={},this.loader=null}}]),t}(),u=l;t.default=u},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.vertexShader=void 0;var i="\n varying vec4 v_position;\n// varying vec3 vReflect;\n uniform mat4 relativeModelMatrix;\n// uniform vec3 cameraPosition2;\n\n #define STANDARD\n varying vec3 vViewPosition;\n #ifndef FLAT_SHADED\n \tvarying vec3 vNormal;\n \t#ifdef USE_TANGENT\n \t\tvarying vec3 vTangent;\n \t\tvarying vec3 vBitangent;\n \t#endif\n #endif\n #define PI 3.14159265359\n #define PI2 6.28318530718\n #define PI_HALF 1.5707963267949\n #define RECIPROCAL_PI 0.31830988618\n #define RECIPROCAL_PI2 0.15915494\n #define LOG2 1.442695\n #define EPSILON 1e-6\n #ifndef saturate\n #define saturate(a) clamp( a, 0.0, 1.0 )\n #endif\n #define whiteComplement(a) ( 1.0 - saturate( a ) )\n float pow2( const in float x ) { return x*x; }\n float pow3( const in float x ) { return x*x*x; }\n float pow4( const in float x ) { float x2 = x*x; return x2*x2; }\n float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\n highp float rand( const in vec2 uv ) {\n \tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n \thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n \treturn fract(sin(sn) * c);\n }\n #ifdef HIGH_PRECISION\n \tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n #else\n \tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n \tfloat precisionSafeLength( vec3 v ) {\n \t\tfloat maxComponent = max3( abs( v ) );\n \t\treturn length( v / maxComponent ) * maxComponent;\n \t}\n #endif\n struct IncidentLight {\n \tvec3 color;\n \tvec3 direction;\n \tbool visible;\n };\n struct ReflectedLight {\n \tvec3 directDiffuse;\n \tvec3 directSpecular;\n \tvec3 indirectDiffuse;\n \tvec3 indirectSpecular;\n };\n struct GeometricContext {\n \tvec3 position;\n \tvec3 normal;\n \tvec3 viewDir;\n #ifdef CLEARCOAT\n \tvec3 clearcoatNormal;\n #endif\n };\n vec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n \treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n }\n vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n \treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n }\n vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n \tfloat distance = dot( planeNormal, point - pointOnPlane );\n \treturn - distance * planeNormal + point;\n }\n float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n \treturn sign( dot( point - pointOnPlane, planeNormal ) );\n }\n vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n \treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n }\n mat3 transposeMat3( const in mat3 m ) {\n \tmat3 tmp;\n \ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n \ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n \ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n \treturn tmp;\n }\n float linearToRelativeLuminance( const in vec3 color ) {\n \tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n \treturn dot( weights, color.rgb );\n }\n bool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n }\n #ifdef USE_UV\n \t#ifdef UVS_VERTEX_ONLY\n \t\tvec2 vUv;\n \t#else\n \t\tvarying vec2 vUv;\n \t#endif\n \tuniform mat3 uvTransform;\n #endif\n #if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n \tattribute vec2 uv2;\n \tvarying vec2 vUv2;\n \tuniform mat3 uv2Transform;\n #endif\n #ifdef USE_DISPLACEMENTMAP\n \tuniform sampler2D displacementMap;\n \tuniform float displacementScale;\n \tuniform float displacementBias;\n #endif\n #ifdef USE_COLOR\n \tvarying vec3 vColor;\n #endif\n #ifdef USE_FOG\n \tvarying float fogDepth;\n #endif\n #ifdef USE_MORPHTARGETS\n \tuniform float morphTargetBaseInfluence;\n \t#ifndef USE_MORPHNORMALS\n \tuniform float morphTargetInfluences[ 8 ];\n \t#else\n \tuniform float morphTargetInfluences[ 4 ];\n \t#endif\n #endif\n #ifdef USE_SKINNING\n \tuniform mat4 bindMatrix;\n \tuniform mat4 bindMatrixInverse;\n \t#ifdef BONE_TEXTURE\n \t\tuniform highp sampler2D boneTexture;\n \t\tuniform int boneTextureSize;\n \t\tmat4 getBoneMatrix( const in float i ) {\n \t\t\tfloat j = i * 4.0;\n \t\t\tfloat x = mod( j, float( boneTextureSize ) );\n \t\t\tfloat y = floor( j / float( boneTextureSize ) );\n \t\t\tfloat dx = 1.0 / float( boneTextureSize );\n \t\t\tfloat dy = 1.0 / float( boneTextureSize );\n \t\t\ty = dy * ( y + 0.5 );\n \t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n \t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n \t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n \t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n \t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n \t\t\treturn bone;\n \t\t}\n \t#else\n \t\tuniform mat4 boneMatrices[ MAX_BONES ];\n \t\tmat4 getBoneMatrix( const in float i ) {\n \t\t\tmat4 bone = boneMatrices[ int(i) ];\n \t\t\treturn bone;\n \t\t}\n \t#endif\n #endif\n #ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): uniforms for area light shadows\n\n\t#endif\n\t*/\n\n#endif\n #ifdef USE_LOGDEPTHBUF\n \t#ifdef USE_LOGDEPTHBUF_EXT\n \t\tvarying float vFragDepth;\n \t\tvarying float vIsPerspective;\n \t#else\n \t\tuniform float logDepthBufFC;\n \t#endif\n #endif\n #if 0 > 0\n \tvarying vec3 vClipPosition;\n #endif\n void main() {\n // vec3 worldPosition2 = ( modelMatrix * vec4( position, 1.0 )).xyz;\n // vec3 cameraToVertex = normalize( worldPosition2 - cameraPosition2 );\n // vReflect = reflect( cameraToVertex, normal );\n \tvec4 pos = vec4(position, 1.0);\n \tv_position = relativeModelMatrix * pos;\n\n #ifdef USE_UV\n \tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n #endif\n #if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n \tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n #endif\n #ifdef USE_COLOR\n \tvColor.xyz = color.xyz;\n #endif\n vec3 objectNormal = vec3( normal );\n #ifdef USE_TANGENT\n \tvec3 objectTangent = vec3( tangent.xyz );\n #endif\n #ifdef USE_MORPHNORMALS\n \tobjectNormal *= morphTargetBaseInfluence;\n \tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n \tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n \tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n \tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n #endif\n #ifdef USE_SKINNING\n \tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n \tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n \tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n \tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n #endif\n #ifdef USE_SKINNING\n \tmat4 skinMatrix = mat4( 0.0 );\n \tskinMatrix += skinWeight.x * boneMatX;\n \tskinMatrix += skinWeight.y * boneMatY;\n \tskinMatrix += skinWeight.z * boneMatZ;\n \tskinMatrix += skinWeight.w * boneMatW;\n \tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n \tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n \t#ifdef USE_TANGENT\n \t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n \t#endif\n #endif\n vec3 transformedNormal = objectNormal;\n #ifdef USE_INSTANCING\n \tmat3 m = mat3( instanceMatrix );\n \ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n \ttransformedNormal = m * transformedNormal;\n #endif\n transformedNormal = normalMatrix * transformedNormal;\n #ifdef FLIP_SIDED\n \ttransformedNormal = - transformedNormal;\n #endif\n #ifdef USE_TANGENT\n \tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n \t#ifdef FLIP_SIDED\n \t\ttransformedTangent = - transformedTangent;\n \t#endif\n #endif\n #ifndef FLAT_SHADED\n \tvNormal = normalize( transformedNormal );\n \t#ifdef USE_TANGENT\n \t\tvTangent = normalize( transformedTangent );\n \t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n \t#endif\n #endif\n vec3 transformed = vec3( position );\n #ifdef USE_MORPHTARGETS\n \ttransformed *= morphTargetBaseInfluence;\n \ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n \ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n \ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n \ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n \t#ifndef USE_MORPHNORMALS\n \ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n \ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n \ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n \ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n \t#endif\n #endif\n #ifdef USE_SKINNING\n \tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n \tvec4 skinned = vec4( 0.0 );\n \tskinned += boneMatX * skinVertex * skinWeight.x;\n \tskinned += boneMatY * skinVertex * skinWeight.y;\n \tskinned += boneMatZ * skinVertex * skinWeight.z;\n \tskinned += boneMatW * skinVertex * skinWeight.w;\n \ttransformed = ( bindMatrixInverse * skinned ).xyz;\n #endif\n #ifdef USE_DISPLACEMENTMAP\n \ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n #endif\n vec4 mvPosition = vec4( transformed, 1.0 );\n #ifdef USE_INSTANCING\n \tmvPosition = instanceMatrix * mvPosition;\n #endif\n mvPosition = modelViewMatrix * mvPosition;\n gl_Position = projectionMatrix * mvPosition;\n #ifdef USE_LOGDEPTHBUF\n \t#ifdef USE_LOGDEPTHBUF_EXT\n \t\tvFragDepth = 1.0 + gl_Position.w;\n \t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n \t#else\n \t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n \t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n \t\t\tgl_Position.z *= gl_Position.w;\n \t\t}\n \t#endif\n #endif\n #if 0 > 0\n \tvClipPosition = - mvPosition.xyz;\n #endif\n \tvViewPosition = - mvPosition.xyz;\n #if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n \tvec4 worldPosition = vec4( transformed, 1.0 );\n \t#ifdef USE_INSTANCING\n \t\tworldPosition = instanceMatrix * worldPosition;\n \t#endif\n \tworldPosition = modelMatrix * worldPosition;\n #endif\n #ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\n\t}\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\n\t}\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\n\t}\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): update vAreaShadowCoord with area light info\n\n\t#endif\n\t*/\n\n#endif\n #ifdef USE_FOG\n \tfogDepth = -mvPosition.z;\n #endif\n }\n ";t.vertexShader=i},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.fragmentShader=void 0;var i="\n \nuniform bool isNeedSweep;\nuniform bool isRect;\nuniform bool isAnnulus;\n\nuniform float sweepW;\nuniform float sweepH;\nuniform vec2 se2N;\nuniform vec2 se2RN;\nuniform vec2 moveP;\n\nbool isInRectW(vec2 v, vec2 a, float w){\n float a1 = abs(dot(v,a));\n return a1 < w;\n}\nbool isInRectH(vec2 v, vec2 a, float h){\n float a1 = abs(dot(v,a));\n return a1 < h;\n}\n\nvarying vec2 v_Uv;\nvarying vec4 v_position;\n\n\nuniform vec2 circleC;\nuniform float maxR;\nuniform float minR;\nbool isMaxCircle(vec3 a, vec2 b, float r){\n float c = sqrt(pow((a.x-b.x),2.0)+pow((a.z-b.y),2.0));\n return c <= r;\n}\n\nbool isMinCircle(vec3 a, vec2 b, float r){\n float c = sqrt(pow((a.x-b.x),2.0)+pow((a.z-b.y),2.0));\n return c > r;\n}\n\n#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\nuniform vec3 diffuse;\n\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t\n if(isRect){\n \n vec2 v = vec2(v_position.x-moveP.x,v_position.z-moveP.y);\n if(float(isInRectW(v,se2N,sweepW) && isInRectH(v,se2RN,sweepH)) != 0.0 && isNeedSweep){\n gl_FragColor = vec4(mix(vec3(1.0, 1.0, 0.36)*0.8, gl_FragColor.rgb, 0.5), 1.0);\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); \n }\n \n }\n \n if(isAnnulus){\n \n if(float(isMaxCircle(v_position.xyz,circleC,maxR) && isMinCircle(v_position.xyz,circleC,minR) ) != 0.0 && isNeedSweep){\n gl_FragColor = vec4(mix(vec3(0.3, 1.0, 0.86),gl_FragColor.rgb,0.91), 1.0);\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n }\n // gl_FragColor = vec4(1.0,0.1,0.1,1.0);\n }\n \n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n";t.fragmentShader=i},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(20)),u=r(n(14)),h=r(n(21)),c=r(n(22)),a=r(n(18)),o=r(n(13)),f=r(n(27)),d=r(n(12)),s=r(n(2)),p=r(n(3)),m=r(n(41));function w(e,t){var n;if(void 0===c.default||null==(0,h.default)(e)){if((0,u.default)(e)||(n=v(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=(0,l.default)(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function v(e,t){var n;if(e){if("string"==typeof e)return g(e,t);var r=(0,o.default)(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?(0,a.default)(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}r(n(529));var y=function(){function n(e,t){(0,s.default)(this,n),this._themeName=t,this._themeUrl=e,this._data=null,this._type2theme={},this._poiimagetheme={},this._storePoiThemes={},this._storeLabelTypeDic={},this._storeLabelThemeDic={},this._storethemes={},this._externalModelTheme={},this._defaultTheme={color:16777215,alpha:1,strokeColor:16777215,strokeWidth:2},this._labelDefaultTheme={alpha:"0.9",fillcolor:"30,30,30",fontsize:"14.0",id:"109",image:!1,strokecolor:"255,255,255"},this.clearColor=16777215,this.clearAlpha=1,this._modelOpacity=.875,this._floorColor=16776960,this._floorOpacity=.875,this._selectedColor=16750950,this._labelStyle,this._labelSelectedStyle,this._facilitySize,this._poiMatClones={},this._storeApply={},this.navigateStyle_={color:16711680,lineWidth:8,alpha:.8,dash:{size:1,gap:1}}}return(0,p.default)(n,[{key:"initExteralModelTheme",value:function(){if(this._data.externalmodelapply){var e,t=w(this._data.externalmodelapply);try{for(t.s();!(e=t.n()).done;){var n,r=e.value,i=r.fids.split(","),a=w(i);try{for(a.s();!(n=a.n()).done;){var o,s=n.value,l=void 0,u=w(this._data.externalmodeltheme);try{for(u.s();!(o=u.n()).done;){var h=o.value;if(h.id===r.normalid){l=h;break}}}catch(e){u.e(e)}finally{u.f()}this._externalModelTheme[s]=(0,d.default)({color:l.color,model:l.model},r),this._externalModelTheme[s].fids=void 0}}catch(e){a.e(e)}finally{a.f()}}}catch(e){t.e(e)}finally{t.f()}}}},{key:"initStoreTheme",value:function(){var e={};this._defaultTheme=this._data.storetheme[0],this.storeThemes=e;for(var t=0;t<this._data.storetheme.length;t++){var n=this._data.storetheme[t];n.color=m.default.toColor(n.color),n.strokeColor=m.default.toColor(n.strokecolor),n.strokeWidth=n.strokewidth,n.alpha=n.alpha,e[n.id]=n}var r,i=this._data.floorapply;for(r in i){var a=i[r];if(a.typeapply)for(var o in a.typeapply){var s=a.typeapply[o];if(s.normalid){var l=e[s.normalid],u=e[s.selectedid];u&&(this._selectedColor=m.default.toColor(u.color));var h,c=s.type.split(",");for(h in c)this._type2theme[c[h]]=l}}}var d=this._data.extenttheme;this._floorColor=m.default.toColor(d[0].color),this._floorOpacity=(0,f.default)(d[0].alpha)}},{key:"initLabelTheme",value:function(){var e=this._data.storelabeltheme;if(this.storeLabelThemeDic={},this.storeLabelTypeDic={},e){0<e.length&&(this._labelStyle=e[0],1<e.length&&(this._labelSelectedStyle=e[1]));for(var t=0;t<e.length;t++)this.storeLabelThemeDic[e[t].id]=e[t];var n=this._data.floorstorelabelapply;if(n)for(t=0;t<n.length;t++){var r=n[t].typeapply;if("0"==n[t].floorid)for(var i=0;i<r.length;i++)for(var a=r[i],o=a.type.split(","),s=0;s<o.length;s++)this.storeLabelTypeDic[o[s]]=a}var l=this.data.storelabelapply;this._labelFidTheme={};var u,h=this._labelFidTheme,c=w(l);try{for(c.s();!(u=c.n()).done;){var d=u.value;if(d.fids){var f,p=d.fids.split(","),m=w(p);try{for(m.s();!(f=m.n()).done;){var v=f.value;h[v]=this.storeLabelThemeDic[d.normalid]}}catch(e){m.e(e)}finally{m.f()}}}}catch(e){c.e(e)}finally{c.f()}}}},{key:"initPoiTheme",value:function(){this._poiimagetheme={};var e,t=this._data.poiimagetheme,n={};for(e in this.storePoiThemes=n,t){var r=t[e];r.imagename&&(n[r.id]=r)}var i,a=this.data.floorpoiimageapply;for(i in a){var o=a[i];if(o.typeapply)for(var s in o.typeapply){var l=o.typeapply[s];if(l.normalid){var u,h=n[l.normalid],c=l.type.split(",");for(u in c)this._poiimagetheme[c[u]]=h}}}var d=this.data.poiimageapply;this._poiFidTheme={};var f,p=this._poiFidTheme,m=w(d);try{for(m.s();!(f=m.n()).done;){var v=f.value;if(v.fids){var g,y=v.fids.split(","),_=w(y);try{for(_.s();!(g=_.n()).done;){var x=g.value;p[x]=n[v.normalid]}}catch(e){_.e(e)}finally{_.f()}}}}catch(e){m.e(e)}finally{m.f()}}},{key:"getStoreApplyTheme",value:function(e){var t,n,r=w(this._data.storeapply);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.fids===e){var a,o=w(this._data.storetheme);try{for(o.s();!(a=o.n()).done;){var s=a.value;if(s.id==i.normalid)return t=(0,d.default)({},s,i),t}}catch(e){o.e(e)}finally{o.f()}}}}catch(e){r.e(e)}finally{r.f()}return null}},{key:"getRThemeTexture",value:function(e){if(this.rtheme)for(var t,n=0;n<this.rtheme.fmis.length;n++)if(t=this.rtheme.fmis[n],t.name==e)return t.content;return null}},{key:"getModelSelectColor",value:function(){var e=this._data.storetheme[1],t=e.color,n=(0,f.default)(e.alpha);return{r:(t>>16&255)/255,g:(t>>8&255)/255,b:(255&t)/255,a:n}}},{key:"getModelTheme",value:function(e){if(!e)return this._defaultTheme;var t=this._type2theme[e.type];return t||this._defaultTheme}},{key:"getPoiTheme",value:function(e){var t=e.type,n=e.fid,r=this._poiFidTheme[n],r=r||this._poiimagetheme[t];return r=(0,d.default)(r||this._poiimagetheme[0],{}),"rtheme"==this.fileType?r.imageSrc=this.getRThemeTexture(r.imagename):r.imageSrc=this._themeUrl+"/"+this.themeName+"/"+r.imagename,r.imageUrl=this._themeUrl+"/"+this.themeName+"/"+r.imagename,r.imagehead=this._themeUrl+"/"+this.themeName+"/",r}},{key:"getLabelTheme",value:function(e){var t,n,r=e.type,i=e.fid,a=this.storeLabelTypeDic[r];return i&&(n=this._labelFidTheme[i]),a||n?a&&(n=n||(this.storeLabelThemeDic[a.normalid]?this.storeLabelThemeDic[a.normalid]:this._labelStyle)):n=this._labelStyle,n=n||this._labelDefaultTheme,n.fillcolor&&n.alpha&&n.fontsize||(t={fillcolor:"0,0,0",alpha:"1.0",fontsize:"12.0"},n=(0,d.default)(n,t)),n.image?("rtheme"===this.fileType?n.imageSrc=this.getRThemeTexture(n.image):n.imageSrc=this._themeUrl+"/"+this.themeName+"/"+n.image,n.imageUrl=this._themeUrl+"/"+this.themeName+"/"+n.image):n.imageSrc=!1,n}},{key:"getExteralModelTheme",value:function(e){return this._externalModelTheme[e]}},{key:"dispose",value:function(){this._type2theme=void 0,this._poiimagetheme=void 0,this._storePoiThemes=void 0,this._storeLabelTypeDic=void 0,this._storeLabelThemeDic=void 0,this._storethemes=void 0,this._data=void 0}},{key:"themeName",get:function(){return this._themeName}},{key:"data",set:function(e){this._data=e,this.initStoreTheme(),this.initLabelTheme(),this.initPoiTheme(),this.initExteralModelTheme(),this.clearColor=m.default.toColor(this._data.viewtheme.clearcolor),this.clearAlpha=(0,f.default)(this._data.viewtheme.clearalpha)},get:function(){return this._data}},{key:"storeLabelTypeDic",get:function(){return this._storeLabelTypeDic},set:function(e){this._storeLabelTypeDic=e}},{key:"storeLabelThemeDic",get:function(){return this._storeLabelThemeDic},set:function(e){this._storeLabelThemeDic=e}},{key:"storePoiThemes",get:function(){return this._storePoiThemes},set:function(e){this._storePoiThemes=e}},{key:"storethemes",get:function(){return this._storethemes},set:function(e){this._storethemes=e}},{key:"themeUrl",get:function(){return this._themeUrl},set:function(e){this.themeUrl=e}},{key:"floorColor",set:function(e){this._floorColor=e},get:function(){return this._floorColor}},{key:"floorOpacity",set:function(e){this._floorOpacity=e},get:function(){return this._floorOpacity}},{key:"selectedColor",get:function(){return this._selectedColor}}]),n}(),_=y;t.default=_},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(20)),u=r(n(14)),h=r(n(21)),c=r(n(22)),a=r(n(18)),o=r(n(13)),s=r(n(12)),d=r(n(15)),f=r(n(9)),p=r(n(2)),m=r(n(3));function v(e,t){var n;if(void 0===c.default||null==(0,h.default)(e)){if((0,u.default)(e)||(n=g(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=(0,l.default)(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function g(e,t){var n;if(e){if("string"==typeof e)return y(e,t);var r=(0,o.default)(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?(0,a.default)(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(e,t):void 0}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _=function(){function t(e){(0,p.default)(this,t),this._data=e,this._Nodes=[]}return(0,m.default)(t,[{key:"updateNodes",value:function(){var e,t=v(this._Nodes);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.setByTheme(this._data)}}catch(e){t.e(e)}finally{t.f()}}},{key:"addNodes",value:function(e){this._Nodes.push(e)}},{key:"removeNodes",value:function(e){var t,n,r=(0,f.default)(t=this._Nodes).call(t,e);-1<r&&(0,d.default)(n=this._Nodes).call(n,r,1)}},{key:"changeData",value:function(e){(0,s.default)(this._data,e)}}]),t}(),x=_;t.default=x},function(e,t,n){"use strict";var r,i,a=n(1),o=a(n(62)),y=a(n(136)),s=function(){var e=function e(){var n=0,r=document.createElement("div");function t(e){return r.appendChild(e.dom),e}function i(e){for(var t=0;t<r.children.length;t++)r.children[t].style.display=t===e?"block":"none";n=e}r.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",r.addEventListener("click",function(e){e.preventDefault(),i(++n%r.children.length)},!1);var a,o=(performance||Date).now(),s=o,l=0,u=t(new e.Panel("FPS","#0ff","#002")),h=t(new e.Panel("MS","#0f0","#020"));return self.performance&&self.performance.memory&&(a=t(new e.Panel("MB","#f08","#201"))),i(0),{REVISION:16,dom:r,addPanel:t,showPanel:i,begin:function(){o=(performance||Date).now()},end:function(){l++;var e,t=(performance||Date).now();return h.update(t-o,200),s+1e3<=t&&(u.update(1e3*l/(t-s),100),s=t,l=0,a&&(e=performance.memory,a.update(e.usedJSHeapSize/1048576,e.jsHeapSizeLimit/1048576))),t},update:function(){o=this.end()},domElement:r,setMode:i}};return e.Panel=function(n,r,i){var a=Infinity,o=0,s=Math.round,l=s(y.default.devicePixelRatio||1),u=80*l,e=48*l,h=3*l,c=2*l,d=3*l,f=15*l,p=74*l,m=30*l,v=document.createElement("canvas");v.width=u,v.height=e,v.style.cssText="width:80px;height:48px";var g=v.getContext("2d");return g.font="bold "+9*l+"px Helvetica,Arial,sans-serif",g.textBaseline="top",g.fillStyle=i,g.fillRect(0,0,u,e),g.fillStyle=r,g.fillText(n,h,c),g.fillRect(d,f,p,m),g.fillStyle=i,g.globalAlpha=.9,g.fillRect(d,f,p,m),{dom:v,update:function(e,t){a=Math.min(a,e),o=Math.max(o,e),g.fillStyle=i,g.globalAlpha=1,g.fillRect(0,0,u,f),g.fillStyle=r,g.fillText(s(e)+" "+n+" ("+s(a)+"-"+s(o)+")",h,c),g.drawImage(v,d+l,f,p-l,m,d,f,p-l,m),g.fillRect(d+p-l,f,l,m),g.fillStyle=i,g.globalAlpha=.9,g.fillRect(d+p-l,f,l,s((1-e/t)*m))}}},e};"object"===(0,o.default)(t)&&void 0!==e?e.exports=s():(r=s,i="function"==typeof r?r.call(t,n,t,e):r,void 0===i||(e.exports=i))},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=function e(){(0,a.default)(this,e),this.enableMapPan=!0,this.enableMapRotate=!0,this.enableMapIncline=!0,this.enableMapPinch=!0,this.enableMapSingleTap=!0,this.enableMapHover=!1},s=o;t.default=s},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(2)),s=r(n(5)),l=r(n(6)),u=r(n(7)),h=r(n(533));function c(r){var i=d();return function(){var e,t=(0,u.default)(r),n=i?(e=(0,u.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,l.default)(this,n)}}function d(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var f=function(e){(0,s.default)(r,e);var n=c(r);function r(e){var t;return(0,o.default)(this,r),t=n.call(this,e),t.uniforms.offset={value:new fm.Vector2},t.uniforms.rotation={value:0},t.uniforms.scale={value:new fm.Vector2(1,1)},t.depthTest=!1,t.vertexShader=h.default.vert,t.fragmentShader=h.default.frag,t}return r}(fm.ShaderMaterial),p=f;t.default=p},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={vert:"\n \n uniform vec2 offset;\n uniform float rotation;\n uniform vec2 scale;\n varying vec2 vUv;\n void main() {\n vUv = uv;\n \n \n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\n rotatedPosition.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n \n \n rotatedPosition.x *= scale.x * abs(projectionMatrix[0][0] / projectionMatrix[1][1]);\n rotatedPosition.y *= scale.y;\n \n rotatedPosition.xy += offset;\n gl_Position = vec4(rotatedPosition,0.0,1.0);\n }\n ",frag:"\n uniform vec3 diffuse;\n uniform sampler2D mmap;\n #include <common>\n varying vec2 vUv;\n \n void main() {\n \n // vec2 muv = vec2(vUv.x , 1.0 - vUv.y);\n vec4 diffuseColor = texture2D( mmap, vUv );\n \n \n gl_FragColor = diffuseColor;\n }\n "},a=i;t.default=a},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=function(){function t(e){(0,a.default)(this,t),this.videoMemoryAmount=null,this._map=e}return(0,o.default)(t,[{key:"getVideoMemoryAmount",value:function(e){if(this._map.nodeManager){var t,n=this._map.nodeManager._scenes[""+e].groups;for(t in n)this.videoMemoryAmount+=n[""+t].layers.facility[0].getVideoMemoryAmount(),this.videoMemoryAmount+=n[""+t].layers.model[0].getVideoMemoryAmount(),this.videoMemoryAmount+=n[""+t].layers.extent[0].getVideoMemoryAmount(),this.videoMemoryAmount+=n[""+t].layers.label[0].getVideoMemoryAmount();return this.videoMemoryAmount}}},{key:"_addAmount",value:function(e){this.videoMemoryAmount+=e}},{key:"_subtractAmount",value:function(e){this.videoMemoryAmount-=e}}]),t}(),l=s;t.default=l},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=function e(){(0,a.default)(this,e);var t=wx.getSystemInfoSync();this.pixelRatio=t.pixelRatio,this.screenWidth=t.screenWidth,this.device=t.model,this.system=t.system,this.platform=t.platform,this.brand=t.brand},s=o;t.default=s},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(9)),u=r(n(10)),h=r(n(12)),c=r(n(2)),d=r(n(3)),f=r(n(5)),s=r(n(6)),l=r(n(7)),p=r(n(46)),m=r(n(111)),v=r(n(144)),g=r(n(77)),y=r(n(37)),_=r(n(149)),x=n(67),w=r(n(150));function b(r){var i=M();return function(){var e,t=(0,l.default)(r),n=i?(e=(0,l.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,s.default)(this,n)}}function M(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var T=function(e){(0,f.default)(l,e);var s=b(l);function l(e,t,n){var r;if((0,c.default)(this,l),r=s.call(this,0,y.default.TEXT_MARKER),r._map=e,r._map.wxInfo.pixelRatio&&(t.fontsize*=r._map.wxInfo.pixelRatio),r._text=t.name,r._param=t,r._opx=t.x||0,r._opy=t.y||0,r._height=t.height||0,r._isRuning=!1,r._size=1.4*t.fontsize,r._callBack=t.callback,r._fillcolor=t.fillcolor,r._platecolor=t.platecolor,r._platestrokecolor=t.platestrokecolor,r._fontsize=t.fontsize,r._strokecolor=t.strokecolor,r._content=t.content,r.needAvoid=!1,!r._content){r.needAvoid=!0;for(var i=r._text.split("%rn%"),a=[],o=0;o<i.length;o++)a.push({text:i[o],fontsize:r._fontsize,fontcolor:r._fillcolor,strokecolor:r._strokecolor});r._content=a}return r._scale=t.scale,r._target=n,r._moveAnimater,r.center=r.getCenterByAnchor(t.anchor),r.picLoading=!1,r}return(0,d.default)(l,[{key:"getCenterByAnchor",value:function(e){var t=new fm.Vector2(.5,.5);switch(e){case _.default.LEFT:t.setX(0);break;case _.default.RIGHT:t.setX(1);break;case _.default.TOP:t.setY(1);break;case _.default.BOTTOM:t.setY(0);break;case _.default.LEFT_TOP:t.set(0,1);break;case _.default.RIGHT_TOP:t.set(1,1);break;case _.default.LEFT_BOTTOM:t.set(0,0);break;case _.default.RIGHT_BOTTOM:t.set(1,0)}return t}},{key:"init",value:function(){var e=this.findParent(p.default);if(!e)return!1;var t=e.materialManager.createTextMaterial(this._content,(0,h.default)({alpha:1},this._param),this._param.depth);this._size=t.size,t.userData.size=t.size,this._renderNode=new m.default(t),this._renderNode.mapNode=this,this._renderNode.frustumCulled=!1,this._target?this.setTsize():(0,u.default)(e).renderer.setLabelSize(this._renderNode,t.size),this._renderNode.center.set(this.center.x,this.center.y),this._isInit=!0;var n,r=this.parent.parent.parent.mapcenter;return this._target?(n=this._target.mapCoord,this._x=n.x,this._y=n.y):this._opx&&this._opy?(this._x=this._opx,this._y=this._opy):(this._x=r.x,this._y=r.y),this.setPosition(this.x,this.y,0,this._height),this._callBack&&this._callBack(),this._renderNode.visible=this.show,this._renderNode.name="spirit",!0}},{key:"setTsize",value:function(){var e=this._target,t=e.getNearestDis();this.renderNode&&(this.setSize(t*this._scale),this.renderNode.material.sizeAttenuation=!0)}},{key:"setSize",value:function(e){var t=this.findParent(p.default);this._size=e,(0,u.default)(t).renderer.setLabelSize(this._renderNode,e||this._size,!!e)}},{key:"setPosition",value:function(e,t,n,r){var i,a=this.findParent(v.default);a?("number"==typeof n&&0<n&&this.moveToGroup(n),i=a.mapcenter,this._height=r,this._x=e,this._y=t,this._renderNode.position.set(this._x-i.x,this._height,-this._y+i.y)):console.error("Can't change position before map init Marker")}},{key:"getPosition",value:function(){return{x:this._y,y:this._y,z:this._height,groupID:this.parent.parent.groupID}}},{key:"moveTo",value:function(t){var e,n,r,i,a=this;this._isRuning||(e=this.findParent(p.default),n=t.x,r=t.y,i=new g.default({x:this.x,y:this.y},{x:n,y:r},1e3*t.time,function(){(0,u.default)(e).removeAnimater(i),a._moveAnimater=null,a._isRuning=!1,t.callback()},function(e){a.setPosition(e.x,e.y,0,0),t.update(e)}).start(),this._isRuning=!0,(0,u.default)(e).addAnimater(i),this._moveAnimater=i)}},{key:"moveToGroup",value:function(e){var t,n=this.findParent(p.default),r=this.parent.parent.groupID;r!==e&&(this.parent.parent.parent.groups[""+e]?(t=this.parent.parent.parent.groups[""+e].getOrCreateLayer("textMarker"),this._groupId=e,this.parent.untiedMarker(this),t.addMarker(this),(0,u.default)(n).renderer.setLabelSize(this._renderNode)):console.warn(x.tileMessage.noGroup))}},{key:"stopMoveTo",value:function(){var e=this.findParent(p.default);this._moveAnimater&&this._moveAnimater.stop(),(0,u.default)(e).removeAnimater(this._moveAnimater)}},{key:"redraw",value:function(){var e,t=this.findParent(p.default);if(!t)return!1;this.renderNode&&(e=t.materialManager.createTextMaterial(this._content,(0,h.default)({alpha:1},this._param)),(0,u.default)(this.renderNode.material).dispose(),this.renderNode.material.dispose(),this.renderNode.material=e)}},{key:"reDraw",value:function(){var e=this.findParent(p.default);if(!e)return!1;var t=e.materialManager.createLabelMaterial(this._text,(0,h.default)({alpha:1},this._param));t.userData.size=this._size,this._renderNode.material.dispose(),this._renderNode.material=void 0,this._renderNode.material=t,(0,u.default)(e).renderer.setLabelSize(this._renderNode,this._size)}},{key:"name",set:function(e){this._text=e,this.reDraw()},get:function(){return this._text}},{key:"visible",set:function(e){var t;e?(0,o.default)(t=this.parent.scene.children).call(t,this._renderNode)<0&&this._renderNode&&this.parent.scene.add(this._renderNode):this._renderNode&&this.parent.scene.remove(this._renderNode),this._visible=e},get:function(){return this._visible}},{key:"size",get:function(){return this._size}},{key:"fillcolor",get:function(){return this._fillcolor},set:function(e){this._fillcolor=e,this._param.fillcolor=e,this.reDraw()}},{key:"fontsize",get:function(){return this._fontsize}},{key:"strokecolor",get:function(){return this._strokecolor},set:function(e){this._strokecolor=e,this._param.strokecolor=e,this.reDraw()}},{key:"content",set:function(e){this._content=e}}]),l}(w.default),S=T;t.default=S},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(2)),s=r(n(5)),l=r(n(6)),u=r(n(7));function h(r){var i=c();return function(){var e,t=(0,u.default)(r),n=i?(e=(0,u.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,l.default)(this,n)}}function c(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var d=function(e){(0,s.default)(i,e);var r=h(i);function i(){var e;(0,o.default)(this,i),e=r.call(this);var t=new Float32Array([-.5,0,-.5,0,0,.5,0,-.5,1,0,.5,0,.5,1,1,-.5,0,.5,0,1]),n=new fm.InterleavedBuffer(t,5);return e.setIndex([0,1,2,0,2,3]),e.addAttribute("position",new fm.InterleavedBufferAttribute(n,3,0,!1)),e.addAttribute("uv",new fm.InterleavedBufferAttribute(n,2,3,!1)),e}return i}(fm.BufferGeometry),f=d;t.default=f},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(2)),s=r(n(3)),l=r(n(5)),u=r(n(6)),h=r(n(7)),c=r(n(539));function d(r){var i=f();return function(){var e,t=(0,h.default)(r),n=i?(e=(0,h.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,u.default)(this,n)}}function f(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}r(n(250)),r(n(249));var p=function(e){(0,l.default)(i,e);var r=d(i);function i(e,t){var n;return(0,o.default)(this,i),n=r.call(this,e,t),n.type="Line2",n.isLine2=!0,n}return(0,s.default)(i,[{key:"copy",value:function(){}}]),i}(c.default),m=p;t.default=m},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(2)),s=r(n(3)),l=r(n(5)),u=r(n(6)),h=r(n(7));function c(r){var i=d();return function(){var e,t=(0,h.default)(r),n=i?(e=(0,h.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,u.default)(this,n)}}function d(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}r(n(251));var f=function(e){(0,l.default)(i,e);var r=c(i);function i(e,t){var n;return(0,o.default)(this,i),n=r.call(this,e,t),n.type="LineSegments2",n.isLineSegments2=!0,n}return(0,s.default)(i,[{key:"computeLineDistances",value:function(){for(var e=new fm.Vector3,t=new fm.Vector3,n=this.geometry,r=n.attributes.instanceStart,i=n.attributes.instanceEnd,a=new Float32Array(2*r.data.count),o=0,s=0,l=r.data.count;o<l;o++,s+=2)e.fromBufferAttribute(r,o),t.fromBufferAttribute(i,o),a[s]=0===s?0:a[s-1],a[s+1]=a[s]+e.distanceTo(t);var u=new fm.InstancedInterleavedBuffer(a,2,1);return n.setAttribute("instanceDistanceStart",new fm.InterleavedBufferAttribute(u,1,0)),n.setAttribute("instanceDistanceEnd",new fm.InterleavedBufferAttribute(u,1,1)),this}},{key:"copy",value:function(){return this}}]),i}(fm.Mesh),p=f;t.default=p},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),m=r(n(10)),o=r(n(2)),s=r(n(3)),l=r(n(5)),u=r(n(6)),h=r(n(7)),c=r(n(37)),v=r(n(46)),g=r(n(151)),d=r(n(28)),f=r(n(541)),y=r(n(543)),p=r(n(150));function _(r){var i=x();return function(){var e,t=(0,h.default)(r),n=i?(e=(0,h.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,u.default)(this,n)}}function x(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var w=function(e){(0,l.default)(r,e);var n=_(r);function r(e){var t;return(0,o.default)(this,r),t=n.call(this,0,c.default.POLYGON_MARKER),t._alpha=void 0!==e.alpha?e.alpha:1,t._color=void 0!==e.color?e.color:"#FF0000",t._dheight=e.height||0,t._lineColor=e.lineColor||e.color||"#FF0000",t._lineWidth="number"==typeof e.lineWidth?e.lineWidth:2,t._points=void 0!==e.points?e.points:[],e.points.type&&("rectangle"===e.points.type&&e.points.startPoint&&e.points.startPoint.x&&e.points.startPoint.y?(t._x=e.points.startPoint.x+e.points.width/2,t._y=e.points.startPoint.y-e.points.height/2):(t._x=e.points.center.x,t._y=e.points.center.y)),t._line=null,t._linePoints=null,t}return(0,s.default)(r,[{key:"init",value:function(){if(!this._points)return!1;if(!this.parent)return!1;if(!this.parent.parent)return!1;var e=this.findParent(v.default);if(!e)return!1;var t={};t.resolution=new fm.Vector2((0,m.default)(e).renderer.canvas.clientWidth,(0,m.default)(e).renderer.canvas.clientHeight);var n=(0,m.default)(e).renderer.getCameraByViewMode((0,m.default)(e)._viewMode);t.near=n.near,t.far=n.far,t.color=this._lineColor,t.alpha=1,t.lineWidth=this._lineWidth;var r=this.parent.parent,i=new fm.MeshBasicMaterial;i.transparent=!0,i.opacity=this._alpha,i.color=new fm.Color(this._color),i.side=2;var a,o=r.parent.mapcenter;switch(this._x||(this._x=o.x),this._y||(this._y=o.y),this._dheight?this._height=this._dheight:this._height=0,this._points.type){case"circle":a=this.createCircleGeometry(this._points.radius,this._points.segments),h=new Float32Array(a.attributes.position.array.length-3);for(var s=0;s<a.attributes.position.array.length;s++)2<s&&(h[s-3]=a.attributes.position.array[s]);break;case"rectangle":a=this.createReactGeometry(this._points.width,this._points.height);for(var l=a.attributes.position.array.length,u=a.attributes.position.array,h=new Float32Array(l+3),c=0;c<l;c++)h[c]=a.attributes.position.array[c];h[l-6]=u[l-3],h[l-5]=u[l-2],h[l-4]=u[l-1],h[l-3]=u[l-6],h[l-2]=u[l-5],h[l-1]=u[l-4],h[l]=u[0],h[l+1]=u[1],h[l+2]=u[2];break;default:a=y.default.createShapeBufferGeometryByCenter(this._points,o);for(var d=a.attributes.position.array.length,h=new Float32Array(d+3),f=0;f<d;f++)h[f]=a.attributes.position.array[f];h[d]=a.attributes.position.array[0],h[d+1]=a.attributes.position.array[1],h[d+2]=a.attributes.position.array[2]}this._linePoints=h;var p=new g.default;return p.initLinePoints(h,t),this._line=p,this._renderNode=new fm.Mesh(a,i),this._renderNode.mapNode=this,this._renderNode.add(p.renderNode),this._renderNode.rotation.set(Math.PI/2,0,0,"XYZ"),this._renderNode.position.set(this._x-o.x,this._height,-this._y+o.y),!0}},{key:"contain",value:function(e){if(!this._points)return!1;if(!this.parent)return!1;if(!this.parent.parent)return!1;if("circle"===this._points.type){var t=Math.sqrt((e.x-this._x)*(e.x-this._x)+(e.y-this._y)*(e.y-this._y));if(t<this._points.r)return!0}else{if("rectangle"!==this._points.type)return d.default.pointInPolygon2d(this._points,e,this._points.length);if(Math.abs(e.x-this._x)<this._points.width/2&&Math.abs(e.y-this._y)<this._points.height/2)return!0}return!1}},{key:"createReactGeometry",value:function(e,t){return new fm.PlaneBufferGeometry(e,t)}},{key:"createCircleGeometry",value:function(e,t){return new fm.CircleBufferGeometry(e,t)}},{key:"createPolygonGeometry",value:function(e,t){for(var n=new fm.Shape,r=0;r<e.length;r++)0===r?n.moveTo(e[r].x-t.x,-e[r].y+t.y):n.lineTo(e[r].x-t.x,-e[r].y+t.y);return n.lineTo(e[0].x-t.x,-e[0].y+t.y),new fm.ShapeBufferGeometry(n)}},{key:"setColor",value:function(e){this._renderNode.material.color=new fm.Color(e)}},{key:"setLineColor",value:function(e){this._line._renderNode.material.color=new fm.Color(e)}},{key:"setLineWidth",value:function(e){this._renderNode.children[0].material.linewidth=e}},{key:"setAlpha",value:function(e){this._renderNode.material.opacity=e}},{key:"getPoints",value:function(){if("circle"===this._points.type){for(var e=null,t=[],e=this.createCircleGeometry(this._points.radius,this._points.segments),n=1;n<e.attributes.position.count;n++)t.push({x:e.attributes.position.array[3*n]+this._x,y:e.attributes.position.array[3*n+1]+this._y});return e.dispose(),t}if("rectangle"!==this._points.type)return this._points;var r=null,i=[],r=this.createReactGeometry(this._points.width,this._points.height);return i.push({x:r.attributes.position.array[0]+this._x,y:r.attributes.position.array[1]+this._y}),i.push({x:r.attributes.position.array[3]+this._x,y:r.attributes.position.array[4]+this._y}),i.push({x:r.attributes.position.array[9]+this._x,y:r.attributes.position.array[10]+this._y}),i.push({x:r.attributes.position.array[6]+this._x,y:r.attributes.position.array[7]+this._y}),r.dispose(),i}},{key:"center",get:function(){for(var e=this.parent.parent,t=(e.parent.mapcenter,[]),n=0;n<this._linePoints.length;n+=3)t.push([this._linePoints[n],this._linePoints[n+1]]);var r=null,r=(0,f.default)([t],.01);return"circle"!=this._points.type&&"rectangle"!=this._points.type?{x:this._x+r[0],y:this._y-r[1],z:this._height}:{x:this._x+r[0],y:this._y+r[1],z:this._height}}}]),r}(p.default),b=w;t.default=b},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(542)),y=a.default;function o(e,t){t=t||1;for(var n=Number.MAX_VALUE,r=Number.MAX_VALUE,i=Number.MIN_VALUE,a=Number.MIN_VALUE,o=0;o<e[0].length;o++){var s=e[0][o];s[0]<n&&(n=s[0]),s[1]<r&&(r=s[1]),s[0]>i&&(i=s[0]),s[1]>a&&(a=s[1])}var l=i-n,u=a-r,h=Math.min(l,u),c=h/2;if(0===h)return[n,r];for(var d=new y(void 0,_),f=n;f<i;f+=h)for(var p=r;p<a;p+=h)d.push(new x(f+c,p+c,c,e));var m=w(e),v=new x(n+l/2,r+u/2,0,e);for(v.d>m.d&&(m=v),d.length;0<d.length;){var g=d.pop();g.d>m.d&&(m=g),g.max-m.d<=t||(c=g.h/2,d.push(new x(g.x-c,g.y-c,c,e)),d.push(new x(g.x+c,g.y-c,c,e)),d.push(new x(g.x-c,g.y+c,c,e)),d.push(new x(g.x+c,g.y+c,c,e)))}return[m.x,m.y]}function _(e,t){return t.max-e.max}function x(e,t,n,r){this.x=e,this.y=t,this.h=n,this.d=s(e,t,r),this.max=this.d+this.h*Math.SQRT2}function s(e,t,n){for(var r=!1,i=Infinity,a=0;a<n.length;a++)for(var o=n[a],s=0,l=o.length,u=l-1;s<l;u=s++){var h=o[s],c=o[u];h[1]>t!=c[1]>t&&e<(c[0]-h[0])*(t-h[1])/(c[1]-h[1])+h[0]&&(r=!r),i=Math.min(i,d(e,t,h,c))}return(r?1:-1)*Math.sqrt(i)}function w(e){for(var t=0,n=0,r=0,i=e[0],a=0,o=i.length,s=o-1;a<o;s=a++){var l=i[a],u=i[s],h=l[0]*u[1]-u[0]*l[1];n+=(l[0]+u[0])*h,r+=(l[1]+u[1])*h,t+=3*h}return 0===t?new x(i[0][0],i[0][1],0,e):new x(n/t,r/t,0,e)}function d(e,t,n,r){var i,a=n[0],o=n[1],s=r[0]-a,l=r[1]-o,u=a,h=o;return 0===s&&0===l||(i=((e-a)*s+(t-o)*l)/(s*s+l*l),1<i?(u=r[0],h=r[1]):0<i&&(u+=s*i,h+=l*i)),s=e-u,l=t-h,s*s+l*l}var l=o;t.default=l},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(2)),s=r(n(3)),a=function(){function a(e,t){var n=0<arguments.length&&void 0!==e?arguments[0]:[],r=1<arguments.length&&void 0!==t?arguments[1]:l;if((0,o.default)(this,a),this.data=n,this.length=this.data.length,this.compare=r,0<this.length)for(var i=(this.length>>1)-1;0<=i;i--)this._down(i)}return(0,s.default)(a,[{key:"push",value:function(e){this.data.push(e),this.length++,this._up(this.length-1)}},{key:"pop",value:function(){if(0!==this.length){var e=this.data[0],t=this.data.pop();return this.length--,0<this.length&&(this.data[0]=t,this._down(0)),e}}},{key:"peek",value:function(){return this.data[0]}},{key:"_up",value:function(e){for(var t=this.data,n=this.compare,r=t[e];0<e;){var i=e-1>>1,a=t[i];if(0<=n(r,a))break;t[e]=a,e=i}t[e]=r}},{key:"_down",value:function(e){for(var t=this.data,n=this.compare,r=this.length>>1,i=t[e];e<r;){var a=1+(e<<1),o=t[a],s=a+1;if(s<this.length&&n(t[s],o)<0&&(a=s,o=t[s]),0<=n(o,i))break;t[e]=o,e=a}t[e]=i}}]),a}();function l(e,t){return e<t?-1:t<e?1:0}var u=a;t.default=u},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=function(){function i(){(0,a.default)(this,i)}return(0,o.default)(i,null,[{key:"createShape",value:function(e,t){var n=new fm.Shape;n.moveTo(e[0].x,e[0].y);for(var r=1;r<e.length;r++)n.lineTo(e[r].x,e[r].y);return t&&n.lineTo(e[0].x,e[0].y),n}},{key:"createReactShape",value:function(e,t){var n=new fm.Shape,r=t/2,i=e/2;return n.moveTo(-i,-r),n.lineTo(-i,r),n.lineTo(i,r),n.lineTo(i,-r),n}},{key:"createCircleShape",value:function(e){var t=new fm.Shape;return t.absarc(0,0,e,0,2*Math.PI,!1),t}},{key:"createExtrudeBufferGeometry",value:function(e,t){var n={steps:1,depth:t.depth,bevelEnabled:!1,bevelThickness:0,bevelSize:0,bevelOffset:0,bevelSegments:1};return new fm.ExtrudeBufferGeometry(e,n)}},{key:"createPointsExtrudeBufferGeometry",value:function(e,t){var n=i.createShape(e,!0);return this.createExtrudeBufferGeometry(n,t)}},{key:"createReactExtrudeBufferGeometry",value:function(e,t,n){var r=i.createReactShape(e,t);return this.createExtrudeBufferGeometry(r,n)}},{key:"createCircleExtrudeBufferGeometry",value:function(e,t,n){var r=i.createCircleShape(e,t);return this.createExtrudeBufferGeometry(r,n)}},{key:"createShapeBufferGeometry",value:function(e){var t=i.createShape(e);return new fm.ShapeBufferGeometry(t)}},{key:"createShapeBufferGeometryByCenter",value:function(e,t){var n=new fm.Shape;n.moveTo(e[0].x-t.x,-e[0].y+t.y);for(var r=1;r<e.length;r++)n.lineTo(e[r].x-t.x,-e[r].y+t.y);return n.lineTo(e[0].x-t.x,-e[0].y+t.y),new fm.ShapeBufferGeometry(n)}},{key:"createCenterBufferGeometry",value:function(e,t){for(var n=[],r=0;r<e.length-1;r++)for(var i=2;i<10;i+=2)n.push({x:e[r].x+(e[r+1].x-e[r].x)*i*.1,y:e[r].y+(e[r+1].y-e[r].y)*i*.1,z:e[r].z+(e[r+1].z-e[r].z)*i*.1});n.push({x:n[0].x,y:n[0].y,z:n[0].z});for(var a=new fm.BufferGeometry,o=[],s=[],l=0;l<n.length-1;l++)o.push(n[l].x),o.push(n[l].y),o.push(n[l].z),o.push(n[l+1].x),o.push(n[l+1].y),o.push(n[l+1].z),o.push(t.x),o.push(t.y),o.push(t.z),s.push(0,0,1);var u=new Float32Array(o);return a.setAttribute("position",new fm.Float32BufferAttribute(u,3)),a.setAttribute("gradientAlpha",new fm.Float32BufferAttribute(s,1)),a}},{key:"scalePoints",value:function(e,t,n){for(var r=[],i=0;i<e.length;i++){var a=e[i].x,o=e[i].y,s=e[i].z;r.push({x:a+(a-t.x)*(n-1),y:o+(o-t.y)*(n-1),z:s})}return r}},{key:"scaleValuePoints",value:function(e,t,n){for(var r=[],i=0;i<e.length;i++){var a={x:e[i].x,y:e[i].y,z:e[i].z};a.x-t.x<0?a.x-=n:a.x+=n,a.y-t.y<0?a.y-=n:a.y+=n,r.push(a)}return r}}]),i}(),l=s;t.default=l},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(36)),u=r(n(10)),l=r(n(112)),h=r(n(27)),s=r(n(30)),a=n(145);function c(e,t){this.map_=e,this.texture_=null,this.config(t)}c.create=function(e,t){return new c(e,t)},c.prototype={getDeviceDPI:function(){var e=[],t=wx.getSystemInfoSync();return e[0]=t.screenWidth/t.pixelRatio,e[1]=t.screenHeight/t.pixelRatio,e},getDeviceWH:function(e){e=e||{};var t=this.map_.maxX-this.map_.minX,n=this.map_.maxY-this.map_.minY,r={w:Math.round(t),h:Math.round(n)},i=this.getDeviceDPI();r.w=(0,s.default)(r.w*i[0]/25.4),r.h=(0,s.default)(r.h*i[1]/25.4);var a=1,o=e.maxSize||2048;return(r.w>=o||r.h>=o)&&(r.w>=r.h?(a=r.h/r.w,r.w=o,r.h=(0,s.default)(o*a)):(a=r.w/r.h,r.h=o,r.w=(0,s.default)(o*a))),r},getPixXY:function(e,t){var n=(e-this.map_.minX)/(this.map_.maxX-this.map_.minX),r=(this.map_.maxY-t)/(this.map_.maxY-this.map_.minY),i={x:n,y:r};return i.x=i.x*this.options.width,i.y=i.y*this.options.height,i},config:function(e){var t=this,n=t.getDeviceWH(e),r=n.w,i=n.h;t.options={width:r,height:i,opacity:e.opacity?255*e.opacity:25500,radius:e.radius?e.radius:30,bshadow:e.radius?e.radius/20:1.5,maxSize:e.mapSize||2048,boundVal:15e3,shadowBlur:Math.ceil(.3*e.radius),points:{max:e.max?e.max:100,data:[]},gradient:e.gradient?e.gradient:{.45:"rgb(0,0,255)",.55:"rgb(0,255,255)",.65:"rgb(0,255,0)",.95:"yellow",1:"rgb(255,0,0)"},isHeatPlan:e.isHeatPlan,heatHeight:e.heatHeight,tempCanvas:e.tempCanvas};var a=e.canvas,o=a.getContext("2d");a.width=r,a.height=i,a.style.width=r+"rpx",a.style.height=i+"rpx",t.options.ctx=o,t.options.canvas=a},renderShadow:function(e,t,n,r){var i=this,a=i.options.ctx,o=(i.options.radius,i.options.boundVal),s=(0,h.default)(n/i.options.points.max,10);a.shadowColor="rgba(0, 0, 0, "+s+")",a.shadowOffsetX=o,a.shadowOffsetY=o,a.shadowBlur=i.options.shadowBlur,a.beginPath(),a.arc(e-o,t-o,i.options.radius,0,2*Math.PI,!0),a.closePath(),(0,l.default)(a).call(a),r||i.cachePoint(e,t,n)},colorize:function(){for(var e=this,t=e.options.width,n=e.options.height,r=e.options.ctx,i=r.getImageData(0,0,t,n),a=i.data,o=a.length,s=e.getPalette(),l=e.options.opacity,u=3;u<o;u+=4){var h,c=a[u],d=4*c;d&&(d=Math.floor(d),h=l<c?l:c,h<.8&&(h=.8),a[u-3]=s[d],a[u-2]=s[d+1],a[u-1]=s[d+2],a[u]=h)}r.putImageData(i,0,0)},renderToMap:function(e){var t=this,n=t.options.canvas,r=a.FMTextureUtil.createTexture_canvas(this.map_.canvas,n);this.setTexture(e,r)},disposeHeatMap:function(e){var t,n;e&&(t=this.map_.getFMGroup(e).getExtentMeshs()[0],t._hasHeatMap&&(t._hasHeatMap=!1,(0,u.default)(t.material)&&(0,u.default)(t.material).dispose(),this.options.isHeatPlan?(t.material.map=null,t.material.mapMixColor=!1,t.material.transparent=!0,t.material.needsUpdate=!0,this.map_.getFMGroup(e)._layers.model[0]._scene.getObjectByName("directionalLight").remove(this.map_.getFMGroup(e)._layers.model[0]._scene.getObjectByName("heatMap"))):(n=this.map_.getFMGroup(e).getModelMeshs(),this.map_.getFMGroup(e)._layers.model[0]._scene.traverse(function(e){"heatmap"==e.name&&e.parent.remove(e)}),(0,o.default)(n).call(n,function(e){if("MultiMaterial"==e.material.type)for(var t=e.material.materials.length,n=0,r=3;n<t;){var i=e.material.materials[n];i.map=null,i.mapMixColor=!1,i.transparent=!0,i.needsUpdate=!0,r=0==n?3:2,n+=r}else i=e.material,i.map=null,i.mapMixColor=!1,i.transparent=!0,i.needsUpdate=!0}))))},getPalette:function(){var e=this.options.tempCanvas,t=e.getContext("2d");e.width=1,e.height=256;var n,r=this,i=r.options.gradient,a=t.createLinearGradient(0,0,1,256);for(n in i)a.addColorStop(n,i[n]);return t.fillStyle=a,t.fillRect(0,0,1,256),t.getImageData(0,0,1,256).data}},c.prototype.cachePoint=function(e,t,n){var r=this,i=r.options.points,a=i.data;i.max,a.push([e,t,n])},c.prototype.clearPoints=function(){this.options.points.data=[],this.clear()},c.prototype.addPoint=function(e,t,n){if(e&&t&&n){var r=this.getPixXY(e,t);if(r){var i=this;i.clear();for(var a=i.options.points.data,o=a.length,s=0;s<o;s++)i.renderShadow(a[s][0],a[s][1],a[s][2],!0);i.renderShadow(r.x,r.y,n,!1),i.colorize()}}},c.prototype.getTexture=function(e){this.clearPoints(),this.addPoints(e);var t=this.options.canvas.cloneNode();return t.getContext("2d").drawImage(this.options.canvas,0,0),new fm.CanvasTexture(t)},c.prototype.setTexture=function(e,l){var t=this.map_.getFMGroup(e).getExtentMeshs()[0];t._hasHeatMap&&this.disposeHeatMap(e);var n,r,i=t.material.color,a=t.material.opacity;this.options.isHeatPlan?(t._hasHeatMap=!0,t.material.map=l,(0,u.default)(t.material).needsUpdate=!0,t.material.needsUpdate=!0,n=t.clone(),n.name="heatMap",n.material.transparent=!0,n.material.opacity=1,n.material.color=new fm.Color(16777215),n.material.depthTest=!1,n.renderOrder=12,n.material.needsUpdate=!0,n.scale.z=.001,this.options.heatHeight?n.position.y+=this.options.heatHeight:n.position.y+=4,t.material=new fm.MeshLambertMaterial({color:i,opacity:a,transparent:!0}),this.map_.getFMGroup(e)._layers.model[0]._scene.getObjectByName("directionalLight").add(n)):(t._hasHeatMap=!0,t.material.mapMixColor=!0,t.material.map=l,(0,u.default)(t.material).needsUpdate=!0,t.material.needsUpdate=!0,r=this.map_.getFMGroup(e).getModelMeshs(),this.map_.getFMGroup(e)._layers.model[0]._scene.traverse(function(e){if(e instanceof fm.Mesh)for(var t=0;t<e.children.length;t++)if(null!==(0,u.default)(e.children[t].material)&&void 0!==(0,u.default)(e.children[t].material)){var n=e.geometry,r=e.material;r.opacity=.8,r.needsUpdate=!0;var i=new fm.MeshLambertMaterial({map:l,transparent:!0,blending:fm.CustomBlending,blendEquation:fm.AddEquation,blendSrc:fm.SrcAlphaFactor,blendDst:fm.OneMinusSrcAlphaFactor});i.opacity=.9;for(var a=[r,i],o=new fm.Group,t=0;t<a.length;t++)o.add(new fm.Mesh(n,a[t]));var s=new fm.Mesh(n,i);s.name="heatmap",s.renderOrder=11,s.material.depthTest=!1,s.material.depthWrite=!1,e.add(s)}}),(0,o.default)(r).call(r,function(e){if("MultiMaterial"==e.material.type)for(var t=e.material.materials.length,n=0,r=3;n<t;)e.material.materials[n].map=l,e.material.mapMixColor=!0,e.material.materials[n]._color=e.material.materials[n].color.clone(),e.material.materials[n].color=new fm.Color(16777215),(0,u.default)(e.material.materials[n]).needsUpdate=!0,e.material.materials[n].needsUpdate=!0,r=0==n?3:2,n+=r;else e.material.mapMixColor=!0,e.material.map=l,e.material._color=e.material.color.clone(),1===e.material.opacity&&(e.material.transparent=!1),(0,u.default)(e.material).needsUpdate=!0,e.material.needsUpdate=!0}))},c.prototype.setModelMeshTexture=function(e){if(e&&texture_)if("MultiMaterial"==e.material.type)for(var t=e.material.materials.length,n=0,r=3;n<t;)e.material.materials[n].map=texture_,e.material.materials[n]._color=e.material.materials[n].color.clone(),e.material.materials[n].color=new fm.Color(16777215),e.material.materials[n].transparent=!1,(0,u.default)(e.material.materials[n]).needsUpdate=!0,e.material.materials[n].needsUpdate=!0,r=0==n?3:2,n+=r;else e.material.map=texture_,e.material._color=e.material.color.clone(),e.material.color=new fm.Color(16777215),e.material.transparent=!1,(0,u.default)(e.material).needsUpdate=!0,e.material.needsUpdate=!0},c.prototype.clear=function(){var e=this.options.ctx;e.clearRect(0,0,this.options.width,this.options.height)},c.prototype.addPoints=function(e){var t=this;t.clear();for(var n=t.options.points.data,r=n.length,i=0;i<r;i++)t.renderShadow(n[i][0],n[i][1],n[i][2],!0);for(var a=e.length,o=0;o<a;o++){var s=this.getPixXY(e[o].x,e[o].y);if(!s)return!0;t.renderShadow(s.x,s.y,e[o].value,!1)}t.colorize()},c.prototype.randomPoints=function(e){var t=this,n=t.options.width,r=t.options.height,i=t.options.points.max;t.clear();for(var a=0;a<e;a++){var o=Math.floor(Math.random()*n+1),s=Math.floor(Math.random()*r+1),l=Math.floor(Math.random()*i+1);t.renderShadow(o,s,l)}t.colorize()};var d=c;t.default=d},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=(r(n(252)),r(n(546))),l=r(n(547)),u=r(n(548)),h=r(n(551)),c=r(n(552)),d=r(n(28)),f=r(n(45)),p=function(){function n(e,t){(0,a.default)(this,n),this._data=t||e.getCurrDecodeData(),this._map=e,this.Graphics=d.default,this.DataManager=new f.default,this.singleAttrQuery=new s.default(this._data,this._map),this.bufferQuery=new u.default(this._data),this.multiAttrQuery=new l.default(this._data,this._map),this.circleQuery=new h.default(this._data),this.polygonQuery=new c.default(this._data)}return(0,o.default)(n,[{key:"query",value:function(e,t){var n=null,n=e.queryTypes?this.getQueryResult(e,e.queryTypes):e.circle?this.getQueryResult(e,["SINGLE","CIRCLE"]):this.getQueryResult(e,["SINGLE"]);return t(n),n}},{key:"getQueryResult",value:function(e,t){for(var n=[],r=null,i=0;i<t.length;i++)switch(t[i]){case"SINGLE":n.push(this.singleAttrQuery.query(e));break;case"MULTI":n.push(this.multiAttrQuery.query(e));break;case"BUFFER":n.push(this.bufferQuery.query(e,this._map));break;case"CIRCLE":r=this.circleQuery.query(n,e,this._map),n=[],n.push(r);break;case"POLYGON":r=this.polygonQuery.query(n,e,this._map),n=[],n.push(r);break;default:n.push(this.singleAttrQuery.query(e))}return n[0]}}]),n}(),m=p;t.default=m},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(20)),u=r(n(14)),h=r(n(21)),c=r(n(22)),a=r(n(18)),o=r(n(13)),s=r(n(4)),p=r(n(27)),d=r(n(33)),f=r(n(9)),m=r(n(2)),v=r(n(3)),g=r(n(5)),y=r(n(6)),_=r(n(7)),x=r(n(253)),w=r(n(37));function b(e,t){var n;if(void 0===c.default||null==(0,h.default)(e)){if((0,u.default)(e)||(n=M(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=(0,l.default)(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function M(e,t){var n;if(e){if("string"==typeof e)return T(e,t);var r=(0,o.default)(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?(0,a.default)(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(e,t):void 0}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function S(r){var i=E();return function(){var e,t=(0,_.default)(r),n=i?(e=(0,_.default)(this).constructor,(0,s.default)(t,arguments,e)):t.apply(this,arguments);return(0,y.default)(this,n)}}function E(){if("undefined"==typeof Reflect||!s.default)return!1;if(s.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,s.default)(Date,[],function(){})),!0}catch(e){return!1}}var A=function(e){(0,g.default)(i,e);var r=S(i);function i(e,t){var n;return(0,m.default)(this,i),n=r.call(this,e),n._map=t,n}return(0,v.default)(i,[{key:"query",value:function(e){var t=[],n=e.groupID;n&&"number"==typeof n&&(n=[n]);var r,i=b(this._data.floors);try{for(i.s();!(r=i.n()).done;){var a=r.value;(!n||-1<(0,f.default)(n).call(n,a.gid))&&t.push.apply(t,(0,d.default)(this.queryGroup(a,e)))}}catch(e){i.e(e)}finally{i.f()}return t}},{key:"queryGroup",value:function(u,h){var c=this,d=this._data.scene.file_ver,e=h.nodeType?h.nodeType:w.default.ALL;"all"==e&&(e=w.default.ALL);var f=[];return e!==w.default.EXTERNAL_MODEL&&e!==w.default.ALL||this.everyExternalModel(u,function(e,t,n,r){var i=null,a=.1,o=.1,o=1===d?(i=r.geo.substring(6,r.geo.length-1).split(" "),a=(0,p.default)(i[0]),(0,p.default)(i[1])):(i=r.pts,a=i[0],i[1]),s=t.height,l={};u.gid,c.check(e,t,h,n,r.geo,u.gid,l)&&f.push({ID:e.eid,name:e.name,ename:e.ename,groupID:u.gid,FID:e.fid,typeID:e.type,nodeType:w.default.MODEL,gdata:t,target:l.target?l.target:c._map.getFMGroup(u.gid).getNodeByLayerId("externalModel",e.eid),mapCoord:{x:a,y:o,z:s}})}),e!==w.default.MODEL&&e!==w.default.ALL||this.everyModel(u,function(e,t,n,r){var i=null,a=0,o=0,o=1===d?(i=r.geo.substring(6,r.geo.length-1).split(" "),a=(0,p.default)(i[0]),(0,p.default)(i[1])):(i=r.pts,a=i[0],i[1]),s=t.height,l={};c.check(e,t,h,n,r.geo,u.gid,l)&&f.push({ID:e.eid,name:e.name,ename:e.ename,groupID:u.gid,FID:e.fid,typeID:e.type,nodeType:w.default.MODEL,gdata:t,target:l.target?l.target:c._map.getFMGroup(u.gid).getNodeByLayerId("model",e.eid),mapCoord:{x:a,y:o,z:s}})}),e!==w.default.FACILITY&&e!==w.default.ALL||this.everyFacility(u,function(e,t,n){var r=null,i=0,a=0,a=1===d?(r=t.geo.substring(6,t.geo.length-1).split(" "),i=(0,p.default)(r[0]),(0,p.default)(r[1])):(r=t.pts,i=r[0],r[1]),o=t.height;c.check(e,t,h,n,null,u.gid)&&f.push({ID:e.eid,name:e.name,ename:e.ename,groupID:u.gid,FID:e.fid,typeID:e.type,nodeType:w.default.FACILITY,gdata:t,target:c._map.getFMGroup(u.gid).getNodeByLayerId("facility",e.eid),mapCoord:{x:i,y:a,z:o}})}),e!==w.default.LABEL&&e!==w.default.ALL||this.everyLabel(u,function(e,t,n){var r=null,i=0,a=0,a=1===d?(r=t.geo.substring(6,t.geo.length-1).split(" "),i=(0,p.default)(r[0]),(0,p.default)(r[1])):(r=t.pts,i=r[0],r[1]),o=t.height;c.check(e,t,h,n,null,u.gid)&&f.push({ID:e.eid,name:e.name,ename:e.ename,groupID:u.gid,FID:e.fid,typeID:e.type,nodeType:w.default.LABEL,gdata:t,target:c._map.getFMGroup(u.gid).getNodeByLayerId("label",e.eid),mapCoord:{x:i,y:a,z:o}})}),f}}]),i}(x.default),I=A;t.default=I},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(20)),u=r(n(14)),h=r(n(21)),c=r(n(22)),a=r(n(18)),o=r(n(13)),s=r(n(4)),p=r(n(32)),m=r(n(27)),d=r(n(33)),f=r(n(9)),v=r(n(2)),g=r(n(3)),y=r(n(5)),_=r(n(6)),x=r(n(7)),w=r(n(253));function b(e,t){var n;if(void 0===c.default||null==(0,h.default)(e)){if((0,u.default)(e)||(n=M(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=(0,l.default)(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function M(e,t){var n;if(e){if("string"==typeof e)return T(e,t);var r=(0,o.default)(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?(0,a.default)(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(e,t):void 0}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function S(r){var i=E();return function(){var e,t=(0,x.default)(r),n=i?(e=(0,x.default)(this).constructor,(0,s.default)(t,arguments,e)):t.apply(this,arguments);return(0,_.default)(this,n)}}function E(){if("undefined"==typeof Reflect||!s.default)return!1;if(s.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,s.default)(Date,[],function(){})),!0}catch(e){return!1}}var A=function(e){(0,y.default)(i,e);var r=S(i);function i(e,t){var n;return(0,v.default)(this,i),n=r.call(this,e),n._map=t,n}return(0,g.default)(i,[{key:"query",value:function(e){if(e.pathPoints){var t=this.distanceSorting(e.groupID,e.pathPoints,e.startPoint,e.bufferRadius);return t}var n=[],r=e.groupID;r&&"number"==typeof r&&(r=[r]),this._data;var i,a=b(this._data.floors);try{for(a.s();!(i=a.n()).done;){var o=i.value;(!r||-1<(0,f.default)(r).call(r,o.gid))&&n.push.apply(n,(0,d.default)(this.queryGroup(o,e)))}}catch(e){a.e(e)}finally{a.f()}return n}},{key:"queryGroup",value:function(u,h){var c=this,d=this._data.scene.file_ver,e=h.nodeType?h.nodeType:fengmap.FMNodeType.ALL;"all"==e&&(e=fengmap.FMNodeType.ALL);var f=[];return e!==fengmap.FMNodeType.EXTERNAL_MODEL&&e!==fengmap.FMNodeType.ALL||this.everyExternalModel(u,function(e,t,n,r){var i=null,a=.1,o=.1,o=1===d?(i=r.geo.substring(6,r.geo.length-1).split(" "),a=(0,m.default)(i[0]),(0,m.default)(i[1])):(i=r.pts,a=i[0],i[1]),s=t.height,l={};c.check(e,t,h,n,r.geo,u.gid,l)&&f.push({ID:e.eid,name:e.name,ename:e.ename,groupID:u.gid,FID:e.fid,typeID:e.type,nodeType:fengmap.FMNodeType.MODEL,distance:"number"==typeof l.distance?l.distance:null,target:l.target?l.target:c._map.getFMGroup(u.gid).getNodeByLayerId("externalModel",e.eid),mapCoord:{x:a,y:o,z:s}})}),e!==fengmap.FMNodeType.MODEL&&e!==fengmap.FMNodeType.ALL||this.everyModel(u,function(e,t,n,r){var i=null,a=0,o=0,o=1===d?(i=r.geo.substring(6,r.geo.length-1).split(" "),a=(0,m.default)(i[0]),(0,m.default)(i[1])):(i=r.pts,a=i[0],i[1]),s=t.height,l={};c.check(e,t,h,n,r.geo,u.gid,l)&&f.push({ID:e.eid,name:e.name,ename:e.ename,groupID:u.gid,FID:e.fid,typeID:e.type,nodeType:fengmap.FMNodeType.MODEL,distance:"number"==typeof l.distance?l.distance:null,target:l.target?l.target:c._map.getFMGroup(u.gid).getNodeByLayerId("model",e.eid),mapCoord:{x:a,y:o,z:s}})}),e!==fengmap.FMNodeType.FACILITY&&e!==fengmap.FMNodeType.ALL||this.everyFacility(u,function(e,t,n){var r=null,i=0,a=0,a=1===d?(r=t.geo.substring(6,t.geo.length-1).split(" "),i=(0,m.default)(r[0]),(0,m.default)(r[1])):(r=t.pts,i=r[0],r[1]),o=t.height,s={};c.check(e,t,h,n,null,u.gid,s)&&f.push({ID:e.eid,name:e.name,ename:e.ename,groupID:u.gid,FID:e.fid,typeID:e.type,nodeType:fengmap.FMNodeType.FACILITY,distance:"number"==typeof s.distance?s.distance:null,target:c._map.getFMGroup(u.gid).getNodeByLayerId("facility",e.eid),mapCoord:{x:i,y:a,z:o}})}),e!==fengmap.FMNodeType.LABEL&&e!==fengmap.FMNodeType.ALL||this.everyLabel(u,function(e,t,n){var r=null,i=0,a=0,a=1===d?(r=t.geo.substring(6,t.geo.length-1).split(" "),i=(0,m.default)(r[0]),(0,m.default)(r[1])):(r=t.pts,i=r[0],r[1]),o=t.height,s={};c.check(e,t,h,n,null,u.gid,s)&&f.push({ID:e.eid,name:e.name,ename:e.ename,groupID:u.gid,FID:e.fid,typeID:e.type,nodeType:fengmap.FMNodeType.LABEL,distance:"number"==typeof s.distance?s.distance:null,target:c._map.getFMGroup(u.gid).getNodeByLayerId("label",e.eid),mapCoord:{x:i,y:a,z:o}})}),(h.circle||h.polygon)&&(0,p.default)(f).call(f,function(e,t){return"number"==typeof e.distance&&"number"==typeof t.distance?e.distance-t.distance:0}),f}}]),i}(w.default),I=A;t.default=I},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),N=r(n(31)),o=r(n(15)),s=r(n(2)),l=r(n(3)),u=r(n(5)),h=r(n(6)),c=r(n(7)),d=r(n(549)),k=n(550);function f(r){var i=p();return function(){var e,t=(0,c.default)(r),n=i?(e=(0,c.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,h.default)(this,n)}}function p(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var m=function(e){(0,u.default)(r,e);var n=f(r);function r(e){var t;return(0,s.default)(this,r),t=n.call(this,e),t._map=null,t}return(0,l.default)(r,[{key:"query",value:function(e,t){this._map=t;var n=this.distanceSorting(e.groupID,e.pathPoints,e.startPoint,e.bufferRadius);return n}},{key:"_calcBuffer",value:function(e,t){for(var n=0;n<e.length;n++){var r=[];r.push(e[n].x),r.push(e[n].y),(0,o.default)(e).call(e,n,1,r)}var i=(0,k.straightenPoints)(e),a=(0,k.polylineSegBuffers)(i,t);return a}},{key:"_BMIntersect",value:function(e,t,n){for(var r=0;r<n.length;r++){var i=[];i.push(n[r].x+e.x),i.push(n[r].y+e.y),(0,o.default)(n).call(n,r,1,i)}var a=(0,k.isSegBuffersIntersecots)(t,n);return a}},{key:"_BFIntersect",value:function(e,t,n){var r=[n.x+e.x,n.y+e.y],i=[r],a=(0,k.isSegBuffersIntersecots)(t,i);return a}},{key:"distanceSorting",value:function(e,t,n,r){var i,a,o=this._map.getFMGroup(e).mapCoord,s=[],l=[],u=[],h=[],c=[],d=[],f=this._map.nodeManager._scenes[this._map._currentSceneId].groups[""+e]._layers.model[0]._models,p=this._map.nodeManager._scenes[this._map._currentSceneId].groups[""+e]._layers.facility[0]._facility,m=this._calcBuffer(t,r);for(i in f){var v,g,y=(0,N.default)(v=f[i]._renderNode.children[0].geometry.vertices).call(v),_=this._BMIntersect(o,m,y);_&&(u.push(f[i]),g={model:y,fid:f[i].FID,target:u[u.length-1]},s.push(g))}for(a in p){var x,w=p[a]._renderNode.position.clone(),b=this._BFIntersect(o,m,w);b&&(h.push(f[a]),x={facility:w,fid:p[a].FID,target:h[h.length-1]},l.push(x))}for(var M=0;M<s.length;M++){var T=s[M].model,S=(0,k.distPointToPolygon)([n.x,n.y],T),E={distance:S,fid:s[M].fid,target:u[M]};c.push(E)}for(var A=0;A<l.length;A++){var I=l[A].facility,L=Math.sqrt(Math.pow(n.x-I.x,2)+Math.pow(n.y-I.y,2)),R={distance:L,fid:l[A].fid,target:h[A]};d.push(R)}return this._quickSort(c,0,c.length-1),this._quickSort(d,0,d.length-1),s=null,l=null,u=null,h=null,{model:c,facility:d}}},{key:"_quickSort",value:function(e,t,n){for(var r=[[t,n]];0<r.length;){var i=r.pop();if(!(i[0]>=i[1])){for(var a=i[0],o=i[1],s=i[0];a<o;){for(;e[o].distance>=e[s].distance&&s<o;)o--;if(o<=a)break;for(;e[a].distance<=e[s].distance&&a<o;)a++;var l=e[s];e[s]=e[o],e[o]=e[a],e[a]=l,s=a}r.push([i[0],s-1]),r.push([s+1,i[1]])}}}}]),r}(d.default),v=m;t.default=v},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(2)),s=r(n(5)),l=r(n(6)),u=r(n(7)),h=r(n(254));function c(r){var i=d();return function(){var e,t=(0,u.default)(r),n=i?(e=(0,u.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,l.default)(this,n)}}function d(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var f=function(e){(0,s.default)(n,e);var t=c(n);function n(e){return(0,o.default)(this,n),t.call(this,e)}return n}(h.default),p=f;t.default=p},function(e,t,n){"use strict";var r,i,a,o=n(1),_=o(n(62)),s=function(e){Array.prototype.merge=function(e){for(var t=0;t<e.length;t++)this.push(e[t]);return this},Array.prototype.print=function(){for(var e=0;e<this.length;e++)this[e][0],this[e][1]};var s=999999999999,n=3.1415926;function a(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],i=e[(n+1)%e.length];t.push({x1:r[0],y1:r[1],x2:i[0],y2:i[1]})}return t}function i(e,t){var n=!1,n=o(e,t);if(0==n)return n;var r=a(e),i=a(t);return n=u(r,i),!!n||!!h(e[0],t)||!!h(t[0],e)}function o(e,t){for(var n=0;n<e.length;n++)var r=e[n],i=i>r.x?i:r.x,a=a<r.x?a:r.x,o=o>r.y?o:r.y,s=s<r.y?s:r.y;for(n=0;n<t.length;n++)var l=t[n],u=u>l.x?u:l.x,h=h<l.x?h:l.x,c=c>l.y?c:l.y,d=d<l.y?d:l.y;return!(i<=h||u<=a||c<=s||o<=d)}function l(e,t,n,r,i,a,o,s){if(!(Math.min(e,n)<=Math.max(i,o)&&Math.min(a,s)<=Math.max(t,r)&&Math.min(i,o)<=Math.max(e,n)&&Math.min(t,r)<=Math.max(a,s)))return!1;var l=(i-e)*(r-t)-(n-e)*(a-t),u=(o-e)*(r-t)-(n-e)*(s-t),h=(e-i)*(s-a)-(o-i)*(t-a),c=(n-i)*(s-a)-(o-i)*(r-a);return l*u<=1e-8&&h*c<=1e-8}function u(e,t){for(var n=0;n<e.length;n++)for(var r=e[n],i=0;i<t.length;i++){var a=t[i];if(l(r.x1,r.y1,r.x2,r.y2,a.x1,a.y1,a.x2,a.y2))return!0}return!1}function h(e,t){for(var n=e[0],r=e[1],i=!1,a=0,o=t.length-1;a<t.length;o=a++){var s=t[a][0],l=t[a][1],u=t[o][0],h=t[o][1],c=r<l!=r<h&&n<(u-s)*(r-l)/(h-l)+s;c&&(i=!i)}return i}var m=function(e,t){1==arguments.length&&(this.x=e[0],this.y=arguments[0][1]),2==arguments.length&&(this.x=arguments[0],this.y=t)};m.prototype.plus=function(e){return new m(this.x+e.x,this.y+e.y)},m.prototype.minus=function(e){return new m(this.x-e.x,this.y-e.y)},m.prototype.div=function(e){return new m(this.x/e,this.y/e)},m.prototype.mul=function(e){return"object"==(0,_.default)(e)&&e instanceof m?this.x*e.x+this.y*e.y:"number"==typeof e?new m(this.x*e,this.y*e):this},m.prototype.crossMul=function(e){return this.x*e.y-e.x*this.y},m.prototype.len=function(){var e=this.x*this.x+this.y*this.y;return Math.sqrt(e)},m.prototype.toList=function(){return[this.x,this.y]};var v=function(e,t,n,r){this._row1=new m(e,t),this._row2=new m(n,r)};v.prototype.mul=function(e){if(e instanceof m)return new m(this._row1.mul(e),this._row2.mul(e))};var g=function(e){var t=e*n/180;return new v(Math.cos(t),-Math.sin(t),Math.sin(t),Math.cos(t))},c=function(e,t,n){for(var t=new m(t),e=new m(e),r=t.minus(e),r=r.div(r.len()),r=r.mul(n),i=new v(0,-1,1,0),a=i.mul(r),o=(t.plus(r),e.minus(r),t.plus(a),t.minus(a),e.plus(a),e.minus(a),a.mul(-1)),s=[],l=[],u=0;u<=18;u++){var h=g(10*u),c=h.mul(a),d=e.plus(c);s.push(d.toList());var f=h.mul(o),p=t.plus(f);l.push(p.toList())}return s.merge(l)},r=function(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r];n.push(c([i.x1,i.y1],[i.x2,i.y2],t))}return n},t=function(e,t){var n=a(e);return r(n,t)},d=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(i(r,t))return!0}return!1};function f(e,t,n,r,i,a){var o=(i-n)*(e-n)+(a-r)*(t-r);if(o<=0)return Math.sqrt((e-n)*(e-n)+(t-r)*(t-r));var s=(i-n)*(i-n)+(a-r)*(a-r);if(s<=o)return Math.sqrt((e-i)*(e-i)+(t-a)*(t-a));var l=o/s,u=n+(i-n)*l,h=r+(a-r)*l;return Math.sqrt((e-u)*(e-u)+(h-t)*(h-t))}var p=function(e,t){for(var n=s,r=0;r<t.length;r++){var i=t[r],a=t[(r+1)%t.length],o=f(e[0],e[1],i[0],i[1],a[0],a[1]);o<n&&(n=o)}return n},y=function(e){if(e.length<3)return e;var t=[];t.push(e[0]);for(var n=1;n<e.length-1;n++){var r=new m(t[t.length-1]),i=new m(e[n]).minus(r),a=new m(e[n+1]).minus(new m(e[n])),o=i.crossMul(a);Math.abs(o)<.001||t.push(e[n])}return t.push(e[e.length-1]),t};e.isPolygonIntersects=i,e.isPointInPolygon=h,e.polylineSegBuffers=t,e.isSegBuffersIntersecots=d,e.distPointToPolygon=p,e.straightenPoints=y};"object"===(0,_.default)(t)&&void 0!==e?s(t):(i=[t],r=s,a="function"==typeof r?r.apply(t,i):r,void 0===a||(e.exports=a))},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),x=r(n(27)),o=r(n(2)),s=r(n(3)),l=r(n(5)),u=r(n(6)),h=r(n(7)),c=r(n(255));function d(r){var i=f();return function(){var e,t=(0,h.default)(r),n=i?(e=(0,h.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,u.default)(this,n)}}function f(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var p=function(e){(0,l.default)(n,e);var t=d(n);function n(e){return(0,o.default)(this,n),t.call(this,e)}return(0,s.default)(n,[{key:"query",value:function(e,t,n){var r=t.circle,i=[],a=this._data.scene.file_ver;e:for(var o=0;o<e[0].length;o++){var s=e[0][o].gdata;e[0][o].nodeType;var l,u=null,h=0,c=0,c=1===a?(l=s.geo,u=l.substring(6,l.length-1).split(" "),h=(0,x.default)(u[0]),(0,x.default)(u[1])):(u=s.pts,h=u[0],u[1]),d=r.center,f=Math.sqrt((h-d.x)*(h-d.x)+(c-d.y)*(c-d.y));if(f<r.radius)e[0][o].distance=f,i.push(e[0][o]);else if(5===e[0][o].nodeType){var p=0,m=null,v=n.getFMGroup(e[0][o].groupID).getNodeByLayerId("model",e[0][o].ID);v&&v._data&&(m=v._data.vertices),null==m&&(m=DataManager.convertGeo2Geometry(s.geo).vertices);for(var g=m.length/2,y=0;y<g-1;y++){var _=2*y,p=this.Graphics.pointDistanceToLine(d,{x:m[_],y:m[_+1]},{x:m[_+2],y:m[_+3]},{});if(p<r.radius){e[0][o].distance=f,i.push(e[0][o]);continue e}}if(this.Graphics.pointInPolygonVector2d(m,d,m.length)){e[0][o].distance=f,i.push(e[0][o]);continue}}}return i}}]),n}(c.default),m=p;t.default=m},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),f=r(n(27)),o=r(n(2)),s=r(n(3)),l=r(n(5)),u=r(n(6)),h=r(n(7)),p=r(n(553)),c=r(n(255));function d(r){var i=m();return function(){var e,t=(0,h.default)(r),n=i?(e=(0,h.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,u.default)(this,n)}}function m(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var v=function(e){(0,l.default)(n,e);var t=d(n);function n(e){return(0,o.default)(this,n),t.call(this,e)}return(0,s.default)(n,[{key:"query",value:function(e,t,n){for(var r=this._data.scene.file_ver,i=2<t.polygon.length?new p.default(t.polygon,!0):null,a=[],o=0;o<e[0].length;o++){var s=e[0][o].gdata;e[0][o].nodeType;var l,u=null,h=null,u=1===r?(l=s.geo,l.substring(6,l.length-1).split(" ")):s.pts,h={x:(0,f.default)(u[0]),y:(0,f.default)(u[1])};if(i.contain(h))e[0][o].distance=i.distanceToPoint(h),a.push(e[0][o]);else if(5===e[0][o].nodeType){var c=null,d=n.getFMGroup(e[0][o].groupID).getNodeByLayerId("model",e[0][o].ID);if(d&&d._data&&(c=d._data.vertices),null==c&&(c=DataManager.convertGeo2Geometry(s.geo).vertices),i.containXYArray(c)){e[0][o].distance=i.distanceToPoint(h),a.push(e[0][o]);continue}}}return a}}]),n}(c.default),g=v;t.default=g},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=r(n(554)),l=function(){function u(e){(0,a.default)(this,u),this._points=e,this._bb=new s.default(e);var t=e.length;e[0].x==e[t-1].x&&e[0].y==e[t-1].y&&t--,this._count=t,this._center=fengmap.inner.Graphics.calcCenterOfGravityPoint(e,this._count)}return(0,o.default)(u,[{key:"contain",value:function(e){return!!this._bb.contain(e)&&fengmap.inner.Graphics.pointInPolygon2d(this._points,e,this._count)}},{key:"containXYArray",value:function(e){for(var t=e.length/2,n=[],r=!1,i=0;i<t;i++){var a=2*i,o={x:e[a],y:e[a+1]};if(this.contain(o)){r=!0;break}n.push(o)}if(r)return!0;var s=new u(n);if(fengmap.inner.Graphics.isRectCross(this._bb._min,this._bb._max,s._bb._min,s._bb._max))for(var l=0;l<this._count;l++)if(s.contain(this._points[l])){r=!0;break}return!!r}},{key:"distanceToPoint",value:function(e){return fengmap.inner.Graphics.distanceOfTwoPoints(this._center,e)}}]),u}(),u=l;t.default=u},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=function(){function r(e){if((0,a.default)(this,r),this._min={x:Number.MAX_VALUE,y:Number.MAX_VALUE},this._max={x:-Number.MAX_VALUE,y:-Number.MAX_VALUE},e)for(var t=e.length,n=0;n<t;n++)this.expandBy(e[n])}return(0,o.default)(r,[{key:"expandBy",value:function(e){e.x<this._min.x&&(this._min.x=e.x),e.y<this._min.y&&(this._min.y=e.y),e.x>this._max.x&&(this._max.x=e.x),e.y>this._max.y&&(this._max.y=e.y)}},{key:"contain",value:function(e){return!(e.x<this._min.x||e.x>this._max.x||e.y<this._min.y||e.y>this._max.y)}}]),r}(),l=s;t.default=l},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={Left:0,Center:1,Right:2},a=i;t.default=a},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={MODE_2D:"top",MODE_3D:"3d"},a=i;t.default=a},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=function e(t,n){(0,a.default)(this,e),this.x=void 0===t?0:t,this.y=void 0===n?0:n},s=o;t.default=s},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=function(){function r(e,t,n){(0,a.default)(this,r),this._locOrigion=null,this._locRange=null,this._mapOrigion=null,this._mapAxisX=null,this._mapAxisY=null,this._mapRange=null,e&&t&&n&&this.init(e,t,n)}return(0,o.default)(r,[{key:"init",value:function(e,t,n){if(4!=n.length)return!1;this._locOrigion=e,this._locRange=t,this._mapOrigion=n[0],this._mapAxisX={x:n[1].x-n[0].x,y:n[1].y-n[0].y},this._mapAxisY={x:n[3].x-n[0].x,y:n[3].y-n[0].y},this._mapRange={x:this._getVectorLen(this._mapAxisX),y:this._getVectorLen(this._mapAxisY)},this._mapAxisX.x/=this._mapRange.x,this._mapAxisX.y/=this._mapRange.x,this._mapAxisY.x/=this._mapRange.y,this._mapAxisY.y/=this._mapRange.y}},{key:"transform",value:function(e){var t={x:(e.x-this._locOrigion.x)/this._locRange.x,y:(e.y-this._locOrigion.y)/this._locRange.y},n={x:t.x*this._mapRange.x,y:t.y*this._mapRange.y},r={x:this._mapOrigion.x+this._mapAxisX.x*n.x+this._mapAxisY.x*n.y,y:this._mapOrigion.y+this._mapAxisX.y*n.x+this._mapAxisY.y*n.y};return r}},{key:"_getVectorLen",value:function(e){return Math.sqrt(e.x*e.x+e.y*e.y)}}]),r}(),l=s;t.default=l},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),p=r(n(49)),l=r(n(63)),u=r(n(36)),D=r(n(54)),h=r(n(31)),c=r(n(560)),d=r(n(15)),s=r(n(32)),f=r(n(30)),y=r(n(12)),O=r(n(10)),o=r(n(2)),m=r(n(3)),v=r(n(91)),g=r(n(5)),_=r(n(6)),x=r(n(7)),w=r(n(564)),b=r(n(566));n(567),n(584);var F=r(n(28)),M=r(n(113)),T=r(n(68)),S=r(n(95)),E=r(n(69)),A=r(n(147)),B=r(n(45)),I=r(n(41)),L=r(n(246)),R=r(n(151)),N=r(n(247)),k=r(n(66)),P=r(n(262)),C=n(245),U=n(154),z=n(114),G=n(602),V=n(256);function H(r){var i=j();return function(){var e,t=(0,x.default)(r),n=i?(e=(0,x.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,_.default)(this,n)}}function j(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var W=function(e){(0,g.default)(r,e);var n=H(r);function r(e){var t;return(0,o.default)(this,r),t=n.call(this),(0,O.default)(e)&&e.scaleLevel&&!e.scale&&(e.scale=(0,O.default)(e).mapScaleLevels[e.scaleLevel]),(0,O.default)(e)&&e.offsetHeight&&!e.lineMarkerHeight&&(e.lineMarkerHeight=e.offsetHeight),t.map=null,t.sceneData=null,t.speed=5,t.followSpeed=.2,t.followPosition=!0,t.followAngle=!1,t.locationMarkerFollowAngle=!0,t.isMultiGroups=!1,t.inTime=1.2,t.tiltAngle=80,t.changeGroupTiltAngle=30,t.scale=282,t.changeTiltAngle=!0,t.minScale=141,t.extendScale=1.3,t.locationMarkerUrl="",t.locationMarkerSize=100,t.locationMarkerHeight=3,t.lineMarkerHeight=1,t.imageMarkerHeight=6,t.directionAssert=10,t.combineAsset=5,t.completeDistance=0,t.naviLanguage=k.default.ZH,t.naviMode=T.default.MODULE_SHORTEST,t.naviPriority=S.default.PRIORITY_DEFAULT,t.autoRoute=!0,t.autoClearNaviLine=!0,t.lineStyle={lineWidth:10,radius:.5,dash:{size:4,gap:2}},t._passingPts={},t._passPtsEpson=1,t._failedInsertedPts={},(0,y.default)((0,v.default)(t),e),t._init(),t}return(0,m.default)(r,[{key:"_init",value:function(){var e,t,n=this;(0,O.default)(this)&&(this.mapServerURL&&this.mapID?(e={key:(0,O.default)(this).MapOptions.key,appName:(0,O.default)(this).MapOptions.appName,tile:!1,mapServerURL:this.mapServerURL,mapID:this.mapID},t=new b.default(e),t.openMap(function(){var e=t.dataManager._sceneDecodeData[n.mapID];n._analyser=new P.default({}),n._analyser.initByScene(e),n.callback()})):(this._analyser=new P.default,this._analyser.init((0,O.default)(this))),this._analyser=new P.default,this._analyser.init((0,O.default)(this)),this._naviDescriptionsCalculator=new w.default({map:(0,O.default)(this),directionAssert:this.directionAssert,combineAsset:this.combineAsset,naviLanguage:this.naviLanguage,completeDistance:this.completeDistance})),this._simulateParams=null,this._startData=null,this._endData=null,this._startMarker=null,this._endMarker=null,this._startMarkerLayer=null,this._endMarkerLayer=null,this._locationMarker=null,this._naviLineMarkers=[],this._naviResults=[],this._naviDescriptions=[],this._naviDescriptionsData=[],this._naviDistance=0,this._naviGroupsDistance=null,this._naviEntracesDistance=[null,null],this._timer=new fm.Clock,this._pause=!1,this._toPos=null,this._toRot=null,this._allLen=0,this._preGid=0,this._locateLastGroupID=null,this._changeGrouping=!1,this._animateFun=null,this._isSimulating=!1,this._isEnd=!1,this._groupPointsIndex=0,this._gpsData=null,this._tiltToAnimater=null,this._scaleToAnimater=null,this._moveToAnimater=null,this._focusGroupToAnimater=null,this._passingPts={},this._failedInsertedPts={}}},{key:"assignInfos",value:function(e){function t(e){var t,n=[];for(t in e){var r={gid:(0,f.default)(t),coords:e[t]};n.push(r)}(0,s.default)(n).call(n,function(e,t){return e.gid-t.gid});var i=n[n.length-1],a=n[0],o=i.coords.length;return{end:{groupID:i.gid,x:i.coords[o-1][0],y:i.coords[o-1][1]},start:{groupID:a.gid,x:a.coords[0][0],y:a.coords[0][1]}}}this._analyser.assignInfos(e),this._naviResults=this._analyser.getNaviResults(),this._addZeroResult(this._naviResults),this._getGroupsPoints();var n=this._naviDescriptionsCalculator.calculate(this._naviResults);this._naviDescriptions=n[0],this._naviDescriptionsData=n[1],this._naviDistance=n[2],this._naviGroupsDistance=n[3];var r=t(e);this._startData=r.start,this._endData=r.end,this._naviEntracesDistance[1]=this._calcEntraceDistance(this._naviResults,this._endData,!0)}},{key:"on",value:function(e,t){this.addEventListener(e,t)}},{key:"off",value:function(e,t){this.removeEventListener(e,t)}},{key:"dispose",value:function(){this.stop(),this.map=null,this._analyser&&(this._analyser.dispose(),this._analyser=null),this._naviDescriptionsCalculator&&(this._naviDescriptionsCalculator.dispose(),this._naviDescriptionsCalculator=null)}},{key:"getRouteDescriptions",value:function(e,t){var n=e||this._naviResults;if(!this._isNaviResultsValide(n))return{};var r=(0,y.default)({},t);(0,O.default)(r)||(r.map=this._map,r.analyser=this);var i=new w.default(r),a=i.calculate(n);return{naviDescriptions:a[0],naviDescriptionsData:a[1],naviDistance:a[2],naviGroupsDistance:a[3]}}},{key:"setLineStyle",value:function(e){this._naviLineMarker&&this._naviLineMarker.updateStyle(e),this.lineStyle=e}},{key:"setNaviLanguage",value:function(e){if(!e||"string"!=typeof e)return!1;var t,n=e.toLowerCase();return(n==k.default.ZH||n==k.default.EN)&&(this.naviLanguage!=n&&(this.naviLanguage=n,this._naviDescriptionsCalculator&&(this._naviDescriptionsCalculator.naviLanguage=n),0<this._naviResults.length&&(t=this._naviDescriptionsCalculator.calculate(this._naviResults),this._naviDescriptions=t[0],this._naviDescriptionsData=t[1])),!0)}},{key:"setStartPoint",value:function(e,t){this._startData=(0,y.default)({},this._startData,e,{x:e.x,y:e.y,groupID:e.groupID});var n=null;return e.url&&!t&&(n=this._createMarker(e,!0)),this.autoRoute&&(this._getNaviResult(),this._needDrawLines=!0),n}},{key:"setEndPoint",value:function(e,t){if(this._endData=(0,y.default)({},this._endData,e,{x:e.x,y:e.y,groupID:e.groupID}),this.naviToDoor)return this._endData=e,this.autoRoute&&(this._getNaviResult(),this._needDrawLines=!0),null;var n=null;return!e.url||e.noMarker||t||(n=this._createMarker(e,!1)),this.autoRoute&&(this._getNaviResult(),this._needDrawLines=!0),n}},{key:"route",value:function(e,t){this._getNaviResult(e,t),this._needDrawLines=!0}},{key:"naviConstraint",value:function(e){var t;if(this._startData&&this._endData){var n={index:-1,coord:{groupID:e.groupID},angle:null,distance:Number.MAX_VALUE,distanceToNext:Number.MAX_VALUE,remain:this._naviDistance},r=(0,O.default)(t=this._analyse()).call(t,function(e){return{x:e.x,y:e.z,z:0,groupID:e.gid,index:e._index}}),i=this._analyser._navi._graphs.get(e.groupID);if(i){for(var a=i.queryContainExtentId(e),o={},s=1;s<r.length;s++){var l,u=r[s-1],h=r[s];u.groupID===e.groupID&&h.groupID===e.groupID&&a==i.queryContainExtentId(u)&&(l=F.default.pointDistanceToLine(e,u,h,o),l<n.distance&&(n.distance=l,(0,y.default)(n.coord,o),n.angle=this._getRouteAngle(u,h),n.index=u.index,n.distanceToNext=F.default.distanceOfTwoPoints(o,h)))}if(-1==n.index)for(var c=0;c<r.length;c++){var d,f=r[c];f.groupID==e.groupID&&a==i.queryContainExtentId(f)&&(d=F.default.distanceOfTwoPoints(e,f),d<n.distance&&(n.distance=d,(0,y.default)(n.coord,f),n.index=f.index,n.distanceToNext=0,r[c+1]&&r[c+1].groupID==e.groupID&&(n.distanceToNext=F.default.distanceOfTwoPoints(e,r[c+1]))))}if(-1!=n.index){for(var p,m,v=0,g=r.length-1;g>n.index;g--)g-1>n.index&&(p=r[g],m=r[g-1],p.groupID==m.groupID&&(v+=F.default.distanceOfTwoPoints(p,m)));r[n.index+1]&&r[n.index+1].groupID==n.coord.groupID&&(v+=F.default.distanceOfTwoPoints(r[n.index+1],n.coord)),n.remain=v}return n}}}},{key:"pathConstraint",value:function(e,t){return this._analyser?this._analyser.pathConstraint(e,t):null}},{key:"locate",value:function(e,t){this._isSimulating&&this.stop(),e.groupID||e.groupId&&(e.groupID=e.groupId),e.groupID!=this._locateLastGroupID&&(this._locateLastGroupID=e.groupID),this.locateWalking(e,t)}},{key:"dropPtsByCicle",value:function(e){var t,n=[];for(t in this._passingPts)if(t==e.groupID)for(var r=0;r<this._passingPts[t].length;r++){var i,a=this._passingPts[t][r],o=Math.pow(a[0]-e.x,2),s=Math.pow(a[1]-e.y,2),l=Math.sqrt(o+s);l<this._passPtsEpson&&(n.push(a),(0,d.default)(i=this._passingPts[t]).call(i,r,1),r--)}return n}},{key:"locateWalking",value:function(e,t){var n=this.dropPtsByCicle(e),r=this.naviConstraint(e);if(r){if(this._naviLineMarker)if(this._naviLineMarker.passed)for(var i=0;i<this._naviLineMarker._lineNodes.length;i++)this._naviLineMarker._lineNodes[i].line.material.uniforms.miny.value=1-r.remain/this._naviDistance,this._naviLineMarker._lineNodes[i].line.material.uniforms.pcolor.value=new fm.Color(this._naviLineMarker.passedColor);else for(var a=0;a<this._naviLineMarker._lineNodes.length;a++)this._naviLineMarker._lineNodes[a].line.material.uniforms.miny.value=0;var o={type:"walking",distance:r.distance,remain:r.remain,walk:this._naviDistance-r.remain,distanceToNext:r.distanceToNext,angle:r.angle,point:r.coord,groupID:e.groupID,index:r.index,isReal:!0,noArrivedPassingPts:this.passingPts};0<n.length&&(o.passing=n),this.dispatchEvent(o),this._locationMarker&&(r.coord.height=this.locationMarkerHeight,this._locationMarker.setPosition(r.coord),t?this._locationMarker.rotate(t):this._locationMarker.rotate(r.angle))}}},{key:"locateNoConstraint",value:function(e,t){this._isSimulating&&this.stop(),e.groupID||e.groupId&&(e.groupID=e.groupId),e.groupID!=this._locateLastGroupID&&(this._locateLastGroupID=e.groupID),this.locateWalkingNoConstraint(e,t)}},{key:"locateWalkingNoConstraint",value:function(e,t){var n=this.naviConstraint(e);n&&(this.dispatchEvent({type:"walking",distance:n.distance,remain:n.remain,walk:this._naviDistance-n.remain,distanceToNext:n.distanceToNext,angle:n.angle,point:n.coord,groupID:e.groupID,index:n.index,isReal:!0}),this._locationMarker&&(e.height=this.locationMarkerHeight,this._locationMarker.setPosition(e),t&&this._locationMarker.rotate(t)))}},{key:"clearLocationMarker",value:function(){this._locationMarker&&((0,O.default)(this).removeLocationMarker(this._locationMarker),this._locationMarker=null)}},{key:"clearMarkers",value:function(){this._startMarker&&(this._startMarkerLayer.removeMarker(this._startMarker),this._startMarkerLayer=null,this._startMarker=null,this._startData=null),this._endMarker&&(this._endMarkerLayer.removeMarker(this._endMarker),this._endMarkerLayer=null,this._endMarker=null,this._endData=null)}},{key:"drawNaviLine",value:function(){if(this._startData&&this._endData)return this._needDrawLines=!1,this.autoClearNaviLine&&this.clearNaviLines(),this._naviLineMarker=this._drawLines(this._naviResults),this._naviLineMarker}},{key:"clearNaviLine",value:function(){this._naviLineMarker&&((0,O.default)(this).removeLineMarker(this._naviLineMarker),this._naviLineMarker=null)}},{key:"clearNaviLines",value:function(){for(var e=0;e<this._naviLineMarkers.length;e++)(0,O.default)(this).removeLineMarker(this._naviLineMarkers[e]),this._naviLineMarkers[e]=null;this._naviLineMarkers=[]}},{key:"focusNaviLineSegment",value:function(e,t){var n,r,i,a=this,o=null,s=null,l=null;this._naviDescriptionsData&&e<this._naviDescriptionsData.length&&(i=this._naviDescriptionsData[e],s=i.startPoint,l=i.endPoint,l=l||s,n=i.startGID,r=i.endGID,s.z=(0,O.default)(this).getFMGroup(n).height,l.z=(0,O.default)(this).getFMGroup(r).height,o={x:(s.x+l.x)/2,y:(s.y+l.y)/2,z:l.z}),o&&(t=t||{},t.rawLevel=!0,this._moveTo({x:o.x,y:o.y,groupID:r},this._getValueOrDefault(t,"time","duration",this.inTime),null,function(){var e;s&&l&&(e=(0,O.default)(a).getScaleValueByVectics(s,l),!(0,c.default)(e)&&0<e&&(e*=t.extendScale||a.extendScale,a._scaleTo(e,a._getValueOrDefault(t,"time","duration",a.inTime),null,t.callback)))}))}},{key:"clearAll",value:function(){this.clearMarkers(),this.clearNaviLine(),this.clearLocationMarker()}},{key:"simulate",value:function(e){var t,n,r=this;this._startData&&this._endData&&0!=this._naviResults.length&&(t=e||{},this._simulateParams=(0,y.default)({},t),n=t.inTime||this.inTime,t.scale=t.scale||this.scale||0,this._locationMarker||this._initLocationMarker(),this._locationMarkerToStartPoint(),this._needDrawLines&&this.drawNaviLine(),this.followPosition?this._focusGroupToAnimater=this._focusGroupTo(this._startData.groupID,n,null,function(){r._moveToAnimater=r._moveTo(r._startData,n,null,function(){var e=t.scale<r.minScale?r.minScale:t.scale;r.changeTiltAngle?r._tiltToAnimater=r._tiltTo(r.tiltAngle,n,null,function(){r._scaleToAnimater=r._scaleTo(e,n,null,function(){r._works()})}):r._scaleToAnimater=r._scaleTo(e,n,null,function(){r._works()})})}):this._works())}},{key:"pause",value:function(){this._tiltToAnimater&&this._tiltToAnimater.pause(),this._scaleToAnimater&&this._scaleToAnimater.pause(),this._moveToAnimater&&this._moveToAnimater.pause(),this._focusGroupToAnimater&&this._focusGroupToAnimater.pause(),this._pause=!0}},{key:"resume",value:function(){this._tiltToAnimater&&this._tiltToAnimater.resume(),this._scaleToAnimater&&this._scaleToAnimater.resume(),this._moveToAnimater&&this._moveToAnimater.resume(),this._focusGroupToAnimater&&this._focusGroupToAnimater.resume(),this._pause=!1}},{key:"stop",value:function(){this._gpsStop=!0,this._timer.stop(),this._tiltToAnimater&&((0,O.default)(this).removeAnimater(this._tiltToAnimater),this._tiltToAnimater=null),this._scaleToAnimater&&((0,O.default)(this).removeAnimater(this._scaleToAnimater),this._scaleToAnimater=null),this._moveToAnimater&&((0,O.default)(this).removeAnimater(this._moveToAnimater),this._moveToAnimater=null),this._focusGroupToAnimater&&((0,O.default)(this).removeAnimater(this._focusGroupToAnimater),this._focusGroupToAnimater=null),this._animateFun&&(0,O.default)(this).off("update",this._animateFun),this._pause=!1,this._toPos=null,this._toRot=null,this._allLen=0,this._preGid=0,this._changeGrouping=!1,this._animateFun=null,this._isSimulating=!1,this._isEnd=!1,this._groupPointsIndex=0,this._gpsData=null}},{key:"_initLocationMarker",value:function(){this._locationMarker||(this._locationMarker=new N.default((0,O.default)(this),{id:"location",url:this.locationMarkerUrl||"",size:this.locationMarkerSize}),(0,O.default)(this).addLocationMarker(this._locationMarker))}},{key:"_getValueOrDefault",value:function(e){for(var t,n=arguments.length<=1?0:arguments.length-1,r=0;r<n;r++){var i=r+1<1||arguments.length<=r+1?void 0:arguments[r+1];if(e[i])return e[i]}return t=(arguments.length<=1?0:arguments.length-1)-1+1,t<1||arguments.length<=t?void 0:arguments[t]}},{key:"_isNaviGroup",value:function(e){if(this._startData&&this._endData)return e==this._startData.groupID||e==this._endData.groupID}},{key:"_createMarker",value:function(e,t){if(e.groupID){var n=e.url?e.url:t?"image/small/marker/nav_location_start.png":"image/small/marker/nav_location_end.png",r=t?this._startMarkerLayer:this._endMarkerLayer,i=t?this._startMarker:this._endMarker,a="number"==typeof e.height?e.height:this.imageMarkerHeight;return r&&i&&r.removeMarker(i),r&&r.groupID==e.groupID||(r=(0,O.default)(this).getFMGroup(e.groupID).getOrCreateLayer("imageMarker")),i=new L.default((0,O.default)(this),{x:e.x,y:e.y,map:(0,O.default)(this),url:n,height:a,size:e.size||64,anchor:e.anchor,callback:function(){e.callback&&e.callback(i)}}),r.addMarker(i),t?(this._startMarker=i,this._startMarkerLayer=r):(this._endMarker=i,this._endMarkerLayer=r),i}}},{key:"_getGroupsPoints",value:function(){for(var e=this._naviResults,t=[],n=null,r=null,i=0;i<e.length;i++){var a,o=e[i],s=n==o.groupId;0==o.length&&0!=i&&i!=e.length-1||(s||(n=o.groupId,r&&t.push(r),r={groupId:o.groupId,pointList:[]}),r.pointList=(0,h.default)(a=r.pointList).call(a,o.pointList))}return r&&t.push(r),this._groupsPoints=t,t}},{key:"_addZeroResult",value:function(e){for(var t=0;t<e.length-1;t++){var n,r,i=e[t];i.length&&(n=i.pointList[i.pointList.length-1],r=e[t+1].pointList[0],.2<F.default.distanceOfTwoPoints(n,r)&&i.pointList.push((0,y.default)({},r)))}}},{key:"_getNaviResult",value:function(e,t){var n;this._startData&&this._endData&&(this._naviResults=this._caculateLines(this._startData,this._endData,this._startData.groupID,this._endData.groupID,e,t),this.naviToDoor&&this._analyser._endDoor&&((0,y.default)(this._endData,this._analyser._endDoor),this._createMarker(this._endData,!1)),this._addZeroResult(this._naviResults),this._getGroupsPoints(),n=this._naviDescriptionsCalculator.calculate(this._naviResults),this._naviDescriptions=n[0],this._naviDescriptionsData=n[1],this._naviDistance=n[2],this._naviGroupsDistance=n[3],this._naviEntracesDistance[1]=this._calcEntraceDistance(this._naviResults,this._endData,!0))}},{key:"_calcEntraceDistance",value:function(e,t,n){if(!(0,O.default)(this)||!e||!t.groupID)return null;if(!(0,O.default)(this).getCurrDecodeData().floors[t.groupID])return null;var r,i=(0,O.default)(this).getCurrDecodeData().floors[t.groupID].geo[0].modelLayer,a=(0,O.default)(this).getFMGroup(t.groupID).getLayer("model")._models,o=null;for(r in a){var s,l=a[r];if(l&&l._data&&(o=l._data.vertices),null==o&&(s=i[r-1],o=s.geo?B.default.convertGeo2Geometry(s.geo).vertices:B.default.convertArr2Geometry(s.idxs,s.pts).vertices),F.default.pointInPolygonVector2d(o,t,o.length))break}if(!o)return null;for(var u=[],h=[Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE],c=0;c<o.length/2;c++){var d=2*c,f=o[d],p=o[d+1];h[0]>f&&(h[0]=f),h[1]<f&&(h[1]=f),h[2]>p&&(h[2]=p),h[3]<p&&(h[3]=p),u.push({x:f,y:p})}for(var m=[],v=0;v<e.length;v++)if(e[v].groupId==t.groupID){for(var g=[],y=0;y<e[v].pointList.length;y++)g.push(e[v].pointList[y]);m.push(g)}if(n){for(var _,x=0;x<m.length;x++)(0,D.default)(_=m[x]).call(_);(0,D.default)(m).call(m)}for(var w=null,b=null,M=null,T=0;T<m.length;T++){for(var S=m[T],E=!1,A=0;A<S.length-1;A++){var I=S[A],L=S[A+1],R=F.default.calcLinePolygonCrossPoints2d(I,L,u,h);if(R){b=S,M=A,w=R.crossPoints[A],E=!0;break}}if(E)break}if(!b)return null;for(var N=0,k=0;k<=M;k++){var P=b[k],C=b[k+1];N+=k!=M?F.default.distanceOfTwoPoints(P,C):F.default.distanceOfTwoPoints(P,w)}return N}},{key:"_drawLines",value:function(o){var s=this;if(0==o.length)return null;for(var l=new R.default,e=function(e){var t=o[e],n=t.getPointList();if(0==n.length)return"continue";var r=t.groupId,i=[];(0,u.default)(n).call(n,function(e){i.push({x:e.x,y:e.y,z:s.lineMarkerHeight})}),n.length<2&&i.push({x:n[0].x,y:n[0].y,z:s.lineMarkerHeight});var a=new M.default;a.groupId=r,a.points=i,l.passed=s.passed,l.addSegment(a)},t=0;t<o.length;t++)e(t);return(0,O.default)(this).drawLineMark(l,this.lineStyle),this._naviLineMarkers.push(l),l}},{key:"_caculateLines",value:function(e,t,n,r,i,a){if("{}"!=(0,l.default)(this._passingPts)){this._analyser.passPts=this._passingPts,this._analyser.routePassingPoints({x:e.x,y:e.y,groupID:n},{x:t.x,y:t.y,groupID:r});var o=this._analyser.getNaviResults();return this._failedInsertedPts=this._analyser.losedPoints,0==o.length?[]:o}if(this._analyser.analyzeNavi(n,e,r,t,i||this.naviMode,a||this.naviPriority)!=E.default.ROUTE_SUCCESS)return[];var s=this._analyser.getNaviResults();return 0==s.length?[]:s}},{key:"_locationMarkerToStartPoint",value:function(){this._startData&&this._locationMarker.setPosition({x:this._startData.x,y:this._startData.y,height:this.locationMarkerHeight,groupID:this._startData.groupID})}},{key:"_moveTo",value:function(e,t,n,r){return(0,O.default)(this)._moveTo({x:e.x,y:e.y,time:"number"==typeof t?t:0,groupID:e.groupID,update:n,callback:r},!0)}},{key:"_tiltTo",value:function(e,t,n,r){return(0,O.default)(this).tiltTo({to:e,duration:"number"==typeof t?t:0,update:n,callback:r})}},{key:"_rotateTo",value:function(e,t,n,r){return(0,O.default)(this).rotateTo({to:e,duration:"number"==typeof t?t:0,update:n,callback:r})}},{key:"_scaleTo",value:function(e,t,n,r){return(0,O.default)(this).scaleTo({scale:e,duration:"number"==typeof t?t:0,update:n,callback:r},!0)}},{key:"_focusGroupTo",value:function(e,t,n,r){return(0,O.default)(this).visibleGroupIDs=[e],n&&n(),(0,O.default)(this).focusGroupID==e?(r&&r(),null):(0,O.default)(this).changeFocusToGroup({gid:e,duration:"number"==typeof t?t:0,update:n,callback:function(){r&&r()}})}},{key:"_getRouteAngle",value:function(e,t){var n=new U.Vector3(0,1,0),r=new U.Vector3(e.x,e.y,0),i=new U.Vector3(t.x,t.y,0),a=i.clone().sub(r).normalize(),o=a.angleTo(n)*z._Math.RAD2DEG,s=a.cross(n).z<0;return s?360-o:o}},{key:"_getTransformByLength",value:function(e,t){if(0==t)return e[0];for(var n,r,i,a=0,o=0,s=e[0],l=1;l<e.length;l++)if(n=e[l],n.gid==s.gid){if(r=n.clone().sub(s),i=r.length(),a+=i,t<=a){r.normalize();var u=s.clone().add(r.clone().multiplyScalar(t-o));return u.gid=n.gid,u.index=n._index,u}s=n.clone(),s.gid=n.gid,s.index=n._index,o=a}else s=n;var h=e[e.length-1];return h.index=h._index,h}},{key:"_analyse",value:function(){var e;if(!this._startData||!this._endData||!this._naviDescriptionsData||0==this._naviDescriptionsData.length)return[];var r=-1,t=(0,O.default)(e=this._naviDescriptionsData).call(e,function(e,t){var n=new U.Vector3(e.startPoint.x,0,e.startPoint.y);return n.gid=e.startGID,n._index=t,r=t,n}),n=this._naviDescriptionsData[this._naviDescriptionsData.length-1],i=new U.Vector3(n.endPoint.x,0,n.endPoint.y);return i.gid=n.endGID,i._index=r+1,t.push(i),t}},{key:"_follow",value:function(e,t){var n=this,r=this._simulateParams,i=r.inTime||this.inTime;r.scale=r.scale||this.scale||0;var a,o,s=r.scale<this.minScale?this.minScale:r.scale;this.isMultiGroups||(a={x:this._locationMarker.x,y:this._locationMarker.y,height:this._locationMarker.height,groupID:e.gid},o=this._groupsPoints[this._groupPointsIndex],o&&o.pointList&&0<o.pointList.length&&(a=(0,y.default)(a,o.pointList[0])),this._locationMarker.setPosition(a),this._locationMarker._renderNode.visible=!0),this.changeTiltAngle&&(this._tiltToAnimater=this._tiltTo(this.tiltAngle,i,null,null)),this._moveToAnimater=this._moveTo(t,i,null,function(){n._scaleToAnimater=n._scaleTo(s,i,null,function(){n._changeGrouping=!1})})}},{key:"_gpsAnimate",value:function(e){var t,n,r,i,a,o,s,l,u,h,c,d,f=this;this._gpsStop||(0,C.doAnimationFrame)((0,p.default)(t=this._gpsAnimate).call(t,this,e)),this._isEnd||(e.cnt++,e.cnt==e.step&&(e.cnt=0,n=this._timer.getDelta(),this._changeGrouping||this._pause||(this._allLen+=this.speed*n,0!=this._allLen&&(r=(0,y.default)({},this._getTransformByLength(e.ps,this._allLen)),i=this._naviDistance-this._allLen,a=r.y,r.y=r.z,r.z=a,r.groupID=r.gid,this._gpsData={distance:0,remain:i,walk:this._allLen,point:r,groupID:r.gid,index:r.index-1},this._toPos=(0,y.default)({},r),!r||i<=this._naviDescriptionsCalculator.tailLen?this._isEnd=!0:(this._preGid||(this._preGid=e.ps[0].gid),this._isSimulating&&(this._preGid!=r.gid&&(this._preGid=r.gid,this._groupPointsIndex++,o={x:r.x,y:r.y,groupID:r.gid},this.followPosition&&(s=this._simulateParams,l=s.inTime||this.inTime,s.scale=s.scale||this.scale||0,u=s.scale<this.minScale?this.minScale:s.scale,this._changeGrouping=!0,this.changeTiltAngle&&(this._tiltToAnimater=this._tiltTo(this.changeGroupTiltAngle,l,null,null)),this._focusGroupToAnimater=this._focusGroupTo(o.groupID,l,null,function(){f._scaleToAnimater=f._scaleTo(u,l,null,function(){f._locationMarker._renderNode.visible=!1,f.locationMarker.setPosition({x:o.x,y:o.y,height:f.locationMarkerHeight,groupID:o.groupID}),f._moveTo(o,l,null,function(){f.changeTiltAngle?f._tiltToAnimater=f._tiltTo(f.tiltAngle,l,null,function(){f._follow(r,o)}):f._follow(r,o)})})})),this.dispatchEvent({type:"crossGroup",groupId:r.gid})),h=I.default.toSceneCoord((0,O.default)(this),this._toPos),h.y=0,c=this._locationMarker._renderNode.position.clone(),c.y=0,d=new G.Matrix4,d.lookAt(c,h,this._locationMarker._renderNode.up),this._toRot=this.locationMarkerFollowAngle?(new V.Quaternion).setFromRotationMatrix(d):null))))))}},{key:"_gps",value:function(){this._gpsStop=!1;var e=this._analyse();this._timer.start(),this._isSimulating=!0,this._isEnd=!1,this._groupPointsIndex=0;var t={step:2,cnt:0,ps:e};this._gpsAnimate(t)}},{key:"_animate",value:function(){if(!this._changeGrouping&&!this._pause){if(this._toPos){var e=new U.Vector3(this._locationMarker.x,this._locationMarker.y,0),t=e.lerp(this._toPos,this.followSpeed);t.groupID=this._toPos.gid;var n=F.default.distanceOfTwoPoints(t,this._toPos);this._locationMarker.setPosition({x:t.x,y:t.y,height:this.locationMarkerHeight,groupID:t.groupID});var r=this.naviConstraint(t);if(this._naviLineMarker)if(this._naviLineMarker.passed)for(var i=0;i<this._naviLineMarker._lineNodes.length;i++)this._naviLineMarker._lineNodes[i].line.material.uniforms.miny.value=1-r.remain/this._naviDistance,this._naviLineMarker._lineNodes[i].line.material.uniforms.pcolor.value=new fm.Color(this._naviLineMarker.passedColor);else for(var a=0;a<this._naviLineMarker._lineNodes.length;a++)this._naviLineMarker._lineNodes[a].line.material.uniforms.miny.value=0;if(this.dispatchEvent((0,y.default)({},this._gpsData,{type:"walking",distance:r.distance,remain:r.remain,walk:this._naviDistance-r.remain,distanceToNext:r.distanceToNext,angle:r.angle,point:r.coord,groupID:t.groupID,index:r.index,isReal:!1})),this.followPosition?(t.groupID=t.gid,this._moveToAnimater=this._moveTo(t)):(0,O.default)(this).updateCountDown_=0,this._isEnd&&n<.5)return this.stop(),void this.dispatchEvent({type:"complete"})}if(this._toRot){if(this._locationMarker._renderNode.quaternion.slerp(this._toRot,this.followSpeed),!this.followAngle)return;var o=new U.Vector3(1,0,0),s=o.clone(),l=this._locationMarker._renderNode.matrix.clone();l.setPosition(new U.Vector3),s.applyMatrix4(l);var u=s.clone().cross(o),u=u.y<0?-1:1,h=o.angleTo(s),c=Math.PI-h*u;c+=Math.PI,(0,O.default)(this).controls.setUpdate(null,null,null,c)}}}},{key:"_works",value:function(){var e;this._gps(),this._animateFun=(0,p.default)(e=this._animate).call(e,this),(0,O.default)(this).on("update",this._animateFun)}},{key:"AdaptiveLineOverview",value:function(){for(var e=(0,O.default)(this),t=e.nodeManager._scenes[e._currentSceneId].groups[e.focusGroupID]._lineScene,n=new fm.Vector2,r=new fm.Vector2,i=new fm.Vector2,a=!0,o=0;o<t.children.length;o++)t.children[o].visible&&(a?(r.x=t.children[o].geometry.boundingBox.max.x,r.y=t.children[o].geometry.boundingBox.max.z,i.x=t.children[o].geometry.boundingBox.min.x,i.y=t.children[o].geometry.boundingBox.min.z,a=!1):(r.x<t.children[o].geometry.boundingBox.max.x&&(r.x=t.children[o].geometry.boundingBox.max.x),r.z<t.children[o].geometry.boundingBox.max.z&&(r.z=t.children[o].geometry.boundingBox.max.z),i.x>t.children[o].geometry.boundingBox.min.x&&(i.x=t.children[o].geometry.boundingBox.min.x),i.z>t.children[o].geometry.boundingBox.min.z&&(i.z=t.children[o].geometry.boundingBox.min.z)));n.x=(r.x+i.x)/2+e.center.x,n.y=-(r.x+i.y)/2+e.center.y,e.moveTo(n),e.rotateTo({to:0}),e.nodeManager._scenes[e._currentSceneId].groups[1]._layers.extent[0]._scene.children[5].geometry.computeBoundingBox();var s=e.nodeManager._scenes[e._currentSceneId].groups[1]._layers.extent[0]._scene.children[5].geometry.boundingBox,l=new fm.Vector2(s.max.x-s.min.x,s.max.y-s.min.y),u=l.length(),h=new fm.Vector2(r.x-i.x,r.y-i.y),c=h.length();e.mapScale=564*c/u,e.controls.panAdd({x:0,y:e.groupSpace/2,z:0})}},{key:"naviToDoor",set:function(e){this._analyser.naviToDoor=e},get:function(){return this._analyser.naviToDoor}},{key:"locationMarker",set:function(e){e instanceof N.default&&(this._locationMarker=e,(0,O.default)(this).addLocationMarker(this._locationMarker))},get:function(){return this._locationMarker||(this._locationMarker=new N.default((0,O.default)(this),{id:"location",url:this.locationMarkerUrl||"",size:this.locationMarkerSize}),(0,O.default)(this).addLocationMarker(this._locationMarker)),this._locationMarker}},{key:"startMarker",set:function(e){this._startMarker=e},get:function(){return this._startMarker}},{key:"endMarker",set:function(e){this._endMarker=e},get:function(){return this._endMarker}},{key:"naviDescriptions",get:function(){return this._naviDescriptions}},{key:"naviDescriptionsData",get:function(){return this._naviDescriptionsData}},{key:"naviDistance",get:function(){return this._naviDistance}},{key:"naviGroupsDistance",get:function(){return this._naviGroupsDistance}},{key:"naviEntrancesDistance",get:function(){return this._naviEntracesDistance}},{key:"nearDist",get:function(){return this._passPtsEpson},set:function(e){this._passPtsEpson=e}},{key:"passingPts",set:function(e){this._passingPts=e},get:function(){return this._passingPts}},{key:"losedPts",get:function(){return this._failedInsertedPts}}]),r}(A.default),Y=W;t.default=Y},function(e,t,n){e.exports=n(561)},function(e,t,n){var r=n(562);e.exports=r},function(e,t,n){n(563);var r=n(11);e.exports=r.Number.isNaN},function(e,t,n){var r=n(8);r({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var w=r(n(229)),s=r(n(216)),u=r(n(10)),o=r(n(30)),b=r(n(31)),a=r(n(12)),l=r(n(2)),h=r(n(3)),c=r(n(565)),d=r(n(66)),f=r(n(41)),p=n(154),m=n(114),v=function(){function t(e){(0,l.default)(this,t),this.directionAssert=10,this.combineAsset=5,this.naviLanguage=d.default.ZH,this.completeDistance=0,this.map=null,this.combinePoints=[],this.dirArr=["north","northeast","east","southeast","south","southwest","west","northwest","north"],this.dirArr2=["front_pure","right_front_pure","right_pure","right_back_pure","back_pure","left_back_pure","left_pure","left_front_pure","front_pure"],this.dirArr3=["still_go_straight","right_front","turn_right","turn_right_rear","back_to","turn_left_rear","turn_left","left_front","still_go_straight"],this._boo=!1,this._tailLen=0,(0,a.default)(this,e)}return(0,h.default)(t,[{key:"dispose",value:function(){this.map=null}},{key:"calculate",value:function(e){return this._calculate(e)}},{key:"_getNs",value:function(e){for(var t=[],n=0;n<e.length;n++)t=(0,b.default)(t).call(t,e[n]._nodeList);return t}},{key:"_getField",value:function(e,t){var n=Math.PI/4,r=e/n,i=(0,o.default)(r),a=r%1*n;return i%2==0?t<a&&(i+=1):n-t<=a&&(i+=1),i}},{key:"_getAngle",value:function(e,t){var n=t.angleTo(e),r=new p.Vector3(t.x,t.z,t.y).cross(new p.Vector3(e.x,e.z,e.y));return r.z<0&&(n=2*Math.PI-n),n}},{key:"_getDirection",value:function(e,t){if(t==e.length-1)return{index:e[e.length-1].index};var n=new p.Vector3(0,0,1),r=n;0!=t&&(r=e[t].clone().sub(e[t-1]).normalize(),r.y=0,r.z*=-1);var i=e[t+1].clone().sub(e[t]);i.y=0;var a=i.length(),o=i.normalize();o.z*=-1;var s=this._getField(this._getAngle(n,o),22.5*m._Math.DEG2RAD),l=this._getAngle(r,o),u=this._getField(l,this.directionAssert*m._Math.DEG2RAD);return{relField:u,relDesc:this._getDescribeWord(this.dirArr2[u]),relAngle:l*m._Math.RAD2DEG,absField:s,absDesc:this._getDescribeWord(this.dirArr[s]),distance:a,index:e[t].index}}},{key:"_regularPoints",value:function(e,t){for(var r=this,n=(0,u.default)(e).call(e,function(e,t){var n=(0,u.default)(r)?f.default.toSceneCoord((0,u.default)(r),e):f.default.toSceneCoord({center:{x:r.analyser.sceneData.scene.x,y:r.analyser.sceneData.scene.y}},e);return n.index=t,n}),i=[],a=0;a<n.length;a++){var o=this._getDirection(n,a);o.point=e[a],o.groupID=t,i.push(o)}for(var s=[i[0]],l=1;l<i.length;l++)i[l].relAngle<=this.combineAsset||360-i[l].relAngle<=this.combineAsset?s[s.length-1].distance+=i[l].distance:s.push(i[l]);return s}},{key:"_getGroupDes",value:function(e){var t,n="";return null!=(0,u.default)(this).getFMGroup(e)&&(t=(0,u.default)(this).getFMGroup(e),n=this.naviLanguage==d.default.ZH?t._groupMessage.desc:t._groupMessage.gname.toUpperCase(),""+n!="null"&&""+n!=""&&""+n!="undefined"||(n=t._groupMessage.gname.toUpperCase())),n}},{key:"_getDesc",value:function(e,t,n,r,i){var a,o,s,l=e[t],u=e[t+1],h=this._getDescribeWord(this.dirArr3[u.relField]);return this._boo=t==e.length-3&&u.distance<this.completeDistance,h&&!this._boo||(r?(this._boo=!1,h||(a=this._getLadderType(e[t+1].point,n,i),o=n<r?this._getDescribeWord("up_to"):this._getDescribeWord("down_to"),s=this._getGroupDes(r),h=this._getDescribeWord("take")+a+" "+o+" "+s)):(this._boo&&(this._tailLen=u.distance),h=this._getDescribeWord("arrived"))),0==t?2==e.length?this._getDescribeWord("face_to")+" "+l.absDesc+" "+this._getDescribeWord("straight")+" "+Math.ceil(l.distance)+" "+this._getDescribeWord("meter")+" "+h:this._getDescribeWord("face_to")+" "+l.absDesc+" "+this._getDescribeWord("straight")+" "+Math.ceil(l.distance)+" "+this._getDescribeWord("meter")+" "+this._getDescribeWord(this.dirArr3[e[t+1].relField]):this._getDescribeWord("straight")+" "+Math.ceil(l.distance+(this._boo&&!r?u.distance:0))+" "+this._getDescribeWord("meter")+" "+h}},{key:"_getDescData",value:function(e,t,n,r){var i,a=e[t],o=e[t+1],s=this._getDescribeWord(this.dirArr3[e[t+1].relField]);return s&&!this._boo||(r?(i=n<r?this._getDescribeWord("up"):this._getDescribeWord("down"),this._getGroupDes(r),o.relDesc=i):o.relDesc="终"),{startPoint:a.point,startGID:a.groupID,startIndex:a.index,endPoint:o.point,endGID:o.groupID,endIndex:o.index,startDirection:a.absDesc,endDirection:o.relDesc,distance:a.distance+(this._boo&&!r?o.distance:0)}}},{key:"_getLadderType",value:function(e,t,n){e.z=(0,u.default)(this).getFMGroup(t).height;for(var r,i=s.default,a=-1,o=0;o<n.length;o++)n[o]&&(r=Math.pow(n[o].point.x-e.x,2)+Math.pow(n[o].point.y-e.y,2),r<i&&(i=r,a=n[o].liftType));if(-1!=a)switch(a){case 2:return" "+this._getDescribeWord("stair_pure");case 3:return" "+this._getDescribeWord("escalator_pure");case 1:return" "+this._getDescribeWord("lift_pure")}return this._getDescribeWord("stair")}},{key:"_getDescribeWord",value:function(e){var t=c.default[this.naviLanguage][e];return t||""}},{key:"_calculate",value:function(e){this.combinePoints=[];for(var t=[],n=[],r=null,i=null,a=null,o=null,s=0,l=[],u=!1,h=null,c=null,d=this._getNs(e),f=0;f<e.length;f++){if(a=e[f],r=a.groupId,i=null,f<e.length-1)for(var p=f;p<e.length;p++)if(e[p].groupId!=r){i=e[p].groupId;break}o=a.pointList;var m,v,g,y,_=this._regularPoints(o,r);if(1<_.length&&(this.combinePoints=(0,b.default)(m=this.combinePoints).call(m,_)),1==_.length)(i||u)&&(u?n.length&&(f==e.length-1&&(t[t.length-1]+=" "+this._getDescribeWord("arrived"),n[n.length-1].endDirection=this._getDescribeWord("end")),n[n.length-1].endPoint=o[0],n[n.length-1].endGID=r):h!=r&&null!=h||(v=r<i?this._getDescribeWord("up_to"):this._getDescribeWord("down_to"),g=this._getGroupDes(i),c=this._getDescribeWord("take_stair")+" "+v+" "+g,t.push(c),n.push({startPoint:o[0],startDirection:r<i?this._getDescribeWord("up"):this._getDescribeWord("down"),startGID:r})),u=!u);else{h=r;for(var x=0;x<_.length-1&&!this._boo;x++)t.push(this._getDesc(_,x,r,i,d)),n.push(this._getDescData(_,x,r,i))}1<_.length&&(y=(0,w.default)(_).call(_,function(e,t){return e+(t.distance||0)},0),l.push({groupID:r,distance:y}),s+=y)}return[t,n,s,l]}},{key:"tailLen",get:function(){return this._tailLen}}]),t}(),g=v;t.default=g},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={zh:{straight:"直行",still_go_straight:"继续直行",back_to:"后退",turn_right:"右转",turn_left:"左转",right_front:"右前方 继续直行",left_front:"左前方 继续直行",turn_right_rear:"右后方转",turn_left_rear:"左后方转",up:"上",down:"下",up_to:"上行到达",down_to:"下行到达",meter:"米",arrived:"到达目的地",front:"前方",stair:"楼梯",stair_pure:"楼梯",escalator_pure:"扶梯",lift_pure:"直梯",take:"乘",take_stair:"乘梯",front_pure:"前",right_front_pure:"右前",right_pure:"右",right_back_pure:"右后",back_pure:"后",left_back_pure:"左后",left_pure:"左",left_front_pure:"左前",east:"东",west:"西",south:"南",north:"北",southeast:"东南",northeast:"东北",southwest:"西南",northwest:"西北",face_to:"向",start:"起",end:"终"},en:{straight:"go straight",still_go_straight:"go straight",back_to:"back to",turn_right:"turn right",turn_left:"turn left",right_front:"go straight right front ",left_front:"go straight left front ",turn_right_rear:"turn right rear",turn_left_rear:"turn left rear",up:"up",down:"up",up_to:"up to",down_to:"down to",meter:"meter",arrived:"arrived",front:"front",stair:"stair",stair_pure:"stair",escalator_pure:"escalator",lift_pure:"lift",take:"take",take_stair:"take stair",front_pure:"front",right_front_pure:"right front",right_pure:"right",right_back_pure:"right back",back_pure:"back",left_back_pure:"left back",left_pure:"left",left_front_pure:"left front",east:"east",west:"west",south:"south",north:"north",southeast:"southeast",northeast:"northeast",southwest:"southwest",northwest:"northwest",face_to:"face to",start:"start",end:"end"}};t.default=i},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l,a=r(n(2)),o=r(n(3)),u=r(n(63)),h=r(n(143)),s=r(n(141)),c=r(n(45)),d=r(n(93)),f=n(67);function p(n,r){var e,t,i=this,a=null,o=this.MapOptions.mapServerURL,s="GET";"fengmap"===this.MapOptions.mapServerURL&&(o=d.default+"sdk/auth/downMaps",this.MapOptions.tile&&(o=d.default+"sdk/authLayered/downMaps"),e=h.default.getCerityData(this.MapOptions.key,this.MapOptions.appName,n),t={mapId:e.mapId,keyValue:e.appKey,appName:e.appName,webUrl:e.webURL,keyType:3,isSeparate:!1},a=(0,u.default)(t),s="POST"),this.fmServer.getScene(o,n,this.MapOptions.tile,a,s,function(e){i.dataManager.putRawScene(e,n);var t=i.dataManager.parseScene(n,i.MapOptions.tile,i.MapOptions.license);t&&(i.dataManager.putDecodeScene(t,n),r(t))},function(e){l&&l(e)}),this._currentSceneId=n}var m=function(){function t(e){(0,a.default)(this,t),this.MapOptions=e,this.fmServer=new s.default,this.dataManager=new c.default}return(0,o.default)(t,[{key:"openMap",value:function(e,t){var n,r,i=this.MapOptions.mapID;function a(){"fengmap"===r.MapOptions.mapServerURL?h.default.checkIsOnLine(function(){h.default.checkOnLine(r.MapOptions.key,r.MapOptions.appName,i,function(){p.call(r,i,e)},function(e){e?(console.warn(e.error_code,e.error_message),t&&t({msg:"线上验证失败!",data:e})):(console.warn("offLine 2"),p.call(r,i))},"POST")},function(){console.warn("offLine 1"),p.call(r,i,e)},1e3):p.call(r,i,e)}function o(){p.call(r,i)}l=t,i?this.MapOptions.key?(n=/^[a-zA-z\d]{32}$/,n.test(this.MapOptions.key)?this.MapOptions.appName?(this._zopStep_=1,r=this,this.MapOptions.useCompatibleOnLineCheck?this.isOnLine(a,o):(navigator.onLine?a:o)()):console.warn(decodeURIComponent(f.cerityMessage.warn_noappname)):console.warn(decodeURIComponent(f.cerityMessage.warn_keynotright))):console.warn(decodeURIComponent(f.cerityMessage.warn_nokey)):console.warn(decodeURIComponent(f.cerityMessage.warn_nomapid))}}]),t}(),v=m;t.default=v},function(e,t,n){e.exports=i;var h=n(155).EventEmitter,r=n(78);function i(){h.call(this)}r(i,h),i.Readable=n(156),i.Writable=n(580),i.Duplex=n(581),i.Transform=n(582),i.PassThrough=n(583),i.Stream=i,i.prototype.pipe=function(t,e){var n=this;function r(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",r),t.on("drain",i),t._isStdio||e&&!1===e.end||(n.on("end",o),n.on("close",s));var a=!1;function o(){a||(a=!0,t.end())}function s(){a||(a=!0,"function"==typeof t.destroy&&t.destroy())}function l(e){if(u(),0===h.listenerCount(this,"error"))throw e}function u(){n.removeListener("data",r),t.removeListener("drain",i),n.removeListener("end",o),n.removeListener("close",s),n.removeListener("error",l),t.removeListener("error",l),n.removeListener("end",u),n.removeListener("close",u),t.removeListener("close",u)}return n.on("error",l),t.on("error",l),n.on("end",u),n.on("close",u),t.on("close",u),t.emit("pipe",n),t}},function(e){var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},function(e,t){"use strict";t.byteLength=a,t.toByteArray=o,t.fromByteArray=p;for(var l=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,i=n.length;r<i;++r)l[r]=n[r],u[n.charCodeAt(r)]=r;function c(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");-1===n&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function a(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r}function d(e,t,n){return 3*(t+n)/4-n}function o(e){for(var t,n=c(e),r=n[0],i=n[1],a=new h(d(e,r,i)),o=0,s=0<i?r-4:r,l=0;l<s;l+=4)t=u[e.charCodeAt(l)]<<18|u[e.charCodeAt(l+1)]<<12|u[e.charCodeAt(l+2)]<<6|u[e.charCodeAt(l+3)],a[o++]=t>>16&255,a[o++]=t>>8&255,a[o++]=255&t;return 2===i&&(t=u[e.charCodeAt(l)]<<2|u[e.charCodeAt(l+1)]>>4,a[o++]=255&t),1===i&&(t=u[e.charCodeAt(l)]<<10|u[e.charCodeAt(l+1)]<<4|u[e.charCodeAt(l+2)]>>2,a[o++]=t>>8&255,a[o++]=255&t),a}function s(e){return l[e>>18&63]+l[e>>12&63]+l[e>>6&63]+l[63&e]}function f(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),i.push(s(r));return i.join("")}function p(e){for(var t,n=e.length,r=n%3,i=[],a=16383,o=0,s=n-r;o<s;o+=a)i.push(f(e,o,s<o+a?s:o+a));return 1===r?(t=e[n-1],i.push(l[t>>2]+l[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],i.push(l[t>>10]+l[t>>4&63]+l[t<<2&63]+"=")),i.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var a,o,s=8*i-r-1,l=(1<<s)-1,u=l>>1,h=-7,c=n?i-1:0,d=n?-1:1,f=e[t+c];for(c+=d,a=f&(1<<-h)-1,f>>=-h,h+=s;0<h;a=256*a+e[t+c],c+=d,h-=8);for(o=a&(1<<-h)-1,a>>=-h,h+=r;0<h;o=256*o+e[t+c],c+=d,h-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:Infinity*(f?-1:1);o+=Math.pow(2,r),a-=u}return(f?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var o,s,l,u=8*a-i-1,h=(1<<u)-1,c=h>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:a-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||Infinity===t?(s=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),t+=1<=o+c?d/l:d*Math.pow(2,1-c),2<=t*l&&(o++,l/=2),h<=o+c?(s=0,o=h):1<=o+c?(s=(t*l-1)*Math.pow(2,i),o+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),o=0));8<=i;e[n+f]=255&s,f+=p,s/=256,i-=8);for(o=o<<i|s,u+=i;0<u;e[n+f]=255&o,f+=p,o/=256,u-=8);e[n+f-p]|=128*m}},function(e){var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},function(){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=n(157).Buffer,a=n(574);function o(e,t,n){e.copy(t,n)}function s(){r(this,s),this.head=null,this.tail=null,this.length=0}e.exports=(s.prototype.push=function(e){var t={data:e,next:null};0<this.length?this.tail.next=t:this.head=t,this.tail=t,++this.length},s.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},s.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},s.prototype.clear=function(){this.head=this.tail=null,this.length=0},s.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},s.prototype.concat=function(e){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;for(var t=i.allocUnsafe(e>>>0),n=this.head,r=0;n;)o(n.data,t,r),r+=n.data.length,n=n.next;return t},s),a&&a.inspect&&a.inspect.custom&&(e.exports.prototype[a.inspect.custom]=function(){var e=a.inspect({length:this.length});return this.constructor.name+" "+e})},function(){},function(e,i,a){(function(e){var t=void 0!==e&&e||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function r(e,t){this._id=e,this._clearFn=t}i.setTimeout=function(){return new r(n.call(setTimeout,t,arguments),clearTimeout)},i.setInterval=function(){return new r(n.call(setInterval,t,arguments),clearInterval)},i.clearTimeout=i.clearInterval=function(e){e&&e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(t,this._id)},i.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},i.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},i._unrefActive=i.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},a(576),i.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,i.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,a(47))},function(e,t,n){(function(e,y){!function(n,r){"use strict";var i,a,o,s,l,e;function t(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var r={callback:e,args:t};return a[i]=r,l(i),i++}function u(e){delete a[e]}function h(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(r,n)}}function c(e){if(o)setTimeout(c,0,e);else{var t=a[e];if(t){o=!0;try{h(t)}finally{u(e),o=!1}}}}function d(){l=function(e){y.nextTick(function(){c(e)})}}function f(){if(n.postMessage&&!n.importScripts){var e=!0,t=n.onmessage;return n.onmessage=function(){e=!1},n.postMessage("","*"),n.onmessage=t,e}}function p(){var t="setImmediate$"+Math.random()+"$",e=function(e){e.source===n&&"string"==typeof e.data&&0===e.data.indexOf(t)&&c(+e.data.slice(t.length))};n.addEventListener?n.addEventListener("message",e,!1):n.attachEvent("onmessage",e),l=function(e){n.postMessage(t+e,"*")}}function m(){var t=new MessageChannel;t.port1.onmessage=function(e){var t=e.data;c(t)},l=function(e){t.port2.postMessage(e)}}function v(){var n=s.documentElement;l=function(e){var t=s.createElement("script");t.onreadystatechange=function(){c(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}}function g(){l=function(e){setTimeout(c,0,e)}}n.setImmediate||(i=1,a={},o=!1,s=n.document,e=Object.getPrototypeOf&&Object.getPrototypeOf(n),e=e&&e.setTimeout?e:n,("[object process]"==={}.toString.call(n.process)?d:f()?p:n.MessageChannel?m:s&&"onreadystatechange"in s.createElement("script")?v:g)(),e.setImmediate=t,e.clearImmediate=u)}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(47),n(65))},function(t,e,n){(function(n){function e(e,t){if(i("noDeprecation"))return e;var n=!1;function r(){if(!n){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}return r}function i(e){try{if(!n.localStorage)return!1}catch(e){return!1}var t=n.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=e}).call(this,n(47))},function(e,t,n){var r=n(158),i=r.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(a(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),a(i,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){"use strict";e.exports=a;var r=n(261),i=Object.create(n(96));function a(e){if(!(this instanceof a))return new a(e);r.call(this,e)}i.inherits=n(78),i.inherits(a,r),a.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){e.exports=n(159)},function(e,t,n){e.exports=n(70)},function(e,t,n){e.exports=n(156).Transform},function(e,t,n){e.exports=n(156).PassThrough},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(12));function o(e){this.autoStart=void 0===e||e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}(0,a.default)(o.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e,t=0;return this.autoStart&&!this.running?(this.start(),0):(this.running&&(e=("undefined"==typeof performance?Date:performance).now(),t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t),t)}});var s=o;t.default=s},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var b=r(n(116)),d=r(n(31)),M=r(n(9)),h=r(n(12)),c=r(n(36)),T=r(n(33)),L=r(n(54)),R=r(n(15)),l=r(n(30)),S=r(n(32)),a=r(n(2)),o=r(n(3)),_=r(n(28)),s=r(n(68)),E=r(n(95)),N=r(n(69)),x=r(n(160)),u=r(n(590)),f=r(n(148)),v=r(n(97)),A=r(n(56)),w=r(n(79)),p=r(n(591)),m=r(n(161)),g=r(n(263)),y=r(n(592)),I=r(n(162)),k=r(n(593)),P=r(n(163)),C=r(n(594)),D=r(n(41)),O=r(n(596)),F=r(n(600)),B=function(){function t(e){(0,a.default)(this,t),this._options=new u.default(e),this._naviService=new f.default(this._options),this._startPoint=null,this._startGroupId=null,this._endPoint=null,this._endGroupId=null,this._startZone=null,this._mode=s.default.MODULE_SHORTEST,this._priority=E.default.PRIORITY_DEFAULT,this._graphs=new v.default,this._outlineAnalyseDijkstra=null,this._multiFloorDijkstraMap=new v.default,this._groupLiftNodes=new v.default,this._extentNodes=[],this._extentRoads=[],this._predictExtentNodes=[],this._predictLiftNodes=[],this._result=[],this._weightBias=1,this._liftLessWeightGain=1,this._liftWeightGain=1,this._liftGreaterWightGain=1,this._escalatorGreaterWightGain=1,this._escalatorWeightGain=1,this._escalatorLessWightGain=1,this._stairGreaterWeightGain=1,this._stairWeightGain=1,this._stairLessWeightGain=1,this._scene=null,this._eDijKCollection=null,this._naviToDoor=!1,this._startModel=null,this._endModel=null,this._endDoor=null,this._assignedInfos=[]}return(0,o.default)(t,[{key:"initByMap",value:function(e){var t,n;e&&e._currentSceneId&&e.dataManager&&(t=e.dataManager._sceneDecodeData[e._currentSceneId],t&&(this._naviService.setScene(t),this._scene=t,n=t.floors,0!=n.length&&(this._initNaviGraphs(n),this._initDijkstras(),this._eDijKCollection=new O.default,this._eDijKCollection.loadGraphs(this._graphs))))}},{key:"initByOptions",value:function(){}},{key:"initByScene",value:function(e){var t;e&&(this._scene=e,this._naviService.setScene(e),t=e.floors,0!=t.length&&(this._initNaviGraphs(t),this._initDijkstras()))}},{key:"initByNaviGraphs",value:function(e){e&&(this._initNaviGraphs(e),this._initDijkstras())}},{key:"dispose",value:function(){this._options=null,this._naviService=null,this._graphs.each(function(e,t){t.dispose()}),this._graphs.clear(),this._graphs=null,this._outlineAnalyseDijkstra.dispose(),this._outlineAnalyseDijkstra=null,this._multiFloorDijkstraMap.each(function(e,t){t.dispose()}),this._multiFloorDijkstraMap.clear(),this._multiFloorDijkstraMap=null,this._groupLiftNodes.clear(),this._groupLiftNodes=null,this._extentNodes=null,this._extentRoads=null,this._predictExtentNodes=null,this._predictLiftNodes=null,this._result=null}},{key:"routePassingPoints",value:function(e,t){return this.naviAdapter=new F.default(e,t,this._passPts,this._eDijKCollection),this.naviAdapter.executeCalculation(),this._result=this.naviAdapter.routes,this._failedInsertedPts=this.naviAdapter.failInsertedPts,N.default.ROUTE_SUCCESS}},{key:"calc_outlines_dist",value:function(e){for(var t=0,n=0;n<e.length-1;n++)t+=Math.abs(e[n].groupId-e[n+1].groupId);return{dist:t,seq:e}}},{key:"calc_sort_outlines_dist",value:function(e){for(var t=[],n=0;n<e.length;n++)t.push(this.calc_outlines_dist(e[n]));return(0,S.default)(t).call(t,function(e,t){return e.dist-t.dist}),t}},{key:"sort_outlineinfos_length",value:function(e){(0,S.default)(e).call(e,function(e,t){return e.seq.length-t.seq.length})}},{key:"routeAssigned",value:function(){for(var e in this._assignedInfos){var t=(0,l.default)(e),n=this._multiFloorDijkstraMap.get(t);n.assignedPts=this._assignedInfos[t],n.routeAssigned(),this._result.push({groupId:t,result:n.getRouteCalculateResult()})}}},{key:"route",value:function(e,y,t,_,x,n){var w=this;this.reset();var r=this._multiFloorDijkstraMap.get(e);if(!r)return N.default.ROUTE_FAILED_NO_DATA_START;var i=r._calcPointReachable(y);if(!i)return N.default.ROUTE_FAILED_NO_DATA_START;this._startModel=i.model;var a=this._multiFloorDijkstraMap.get(t);if(!a)return N.default.ROUTE_FAILED_NO_DATA_END;var o=a._calcPointReachable(_);if(!o)return N.default.ROUTE_FAILED_NO_DATA_END;this._endModel=o.model,this._result=[],this._startGroupId=e,this._startPoint=y,this._endGroupId=t,this._endPoint=_;var s=i.extentId,l=o.extentId,b=i.model,M=o.model;if(0==s||0==l)return N.default.ROUTE_FAILED_CANNOT_ARRIVE;var T=null;this._mode=x,this._switchToPriority(n);var u=function(){w._result=[];for(var e=[],t=[w._startPoint],n=0;n<w._predictExtentNodes.length-1;n++){var r=[],i=[];if(!w._calcPredictLiftNodes(w._predictExtentNodes[n],w._predictExtentNodes[n+1],t[t.length-1],r,i))return N.default.ROUTE_FAILED_CANNOT_ARRIVE;for(var a=!1,o=0;o<r.length;o++){var s,l,u=r[o]._wrappedNode,h=i[o]._wrappedNode,c=r[o].groupId,d=i[o].groupId;if(T=0==n?(s=w._multiFloorDijkstraMap.get(c),s._startModel=b,s.routeCalculate(y,u,x)):(l=w._multiFloorDijkstraMap.get(c),l.routeCalculate(e[e.length-1],u,x)),N.default.ROUTE_SUCCESS==T){var f=w._multiFloorDijkstraMap.get(c),p=f.getRouteCalculateResult();if(w._result.push({groupId:c,result:p}),e.push(h),t.push(h.point),a=!0,w._predictExtentNodes.length-2==n){var m,v=w._multiFloorDijkstraMap.get(d);if(v._endModel=M,T=v.routeCalculate(h,_,x),N.default.ROUTE_SUCCESS!=T){(0,R.default)(m=w._result).call(m,w._result.length-1,1),a=!1,(0,R.default)(t).call(t,t.length-1,1),(0,R.default)(e).call(e,e.length-1,1);continue}var g=v.getRouteCalculateResult();w._result.push({groupId:d,result:g})}if(N.default.ROUTE_SUCCESS==T)break}}if(!a)return N.default.ROUTE_FAILED_CANNOT_ARRIVE}return N.default.ROUTE_SUCCESS};if(e==t&&s==l){var h=this._multiFloorDijkstraMap.get(e);if(h._startModel=b,h._endModel=M,T=h.routeCalculate(y,_,x),T!=N.default.ROUTE_SUCCESS){for(var c=[],d=0;d<this._extentNodes.length;d++)this._extentNodes[d].groupId==e&&this._extentNodes[d].extentId==s&&c.push(this._extentNodes[d]);var f=this._enlarge_connected_nodes_num(c,c[0],1);if(0==f.length)return N.default.ROUTE_FAILED_OUTLINE;for(var p=this.calc_sort_outlines_dist(f),d=0;d<p.length;d++){this._predictExtentNodes=p[d].seq;var m=u();if(m==N.default.ROUTE_SUCCESS)return m}return N.default.ROUTE_FAILED_CANNOT_ARRIVE}var v=h.getRouteCalculateResult();this._result.push({groupId:e,result:v})}else{var g,S=this._calcPredictExtentNodes(e,s,t,l);if(S!=N.default.ROUTE_SUCCESS)return N.default.ROUTE_FAILED_OUTLINE;(0,L.default)(g=this._predictExtentNodes).call(g);var E=u();if(N.default.ROUTE_SUCCESS!=E){for(var A=null,I=null,d=0;d<this._extentNodes.length;d++)this._extentNodes[d].groupId==e&&this._extentNodes[d].extentId==s&&(A=this._extentNodes[d]),this._extentNodes[d].groupId==t&&this._extentNodes[d].extentId==l&&(I=this._extentNodes[d]);if(f=[],f.push([A]),this._enlarge_connected_nodes_norepeat(A,I,f),0==f.length)return N.default.ROUTE_FAILED_OUTLINE;for(p=this.calc_sort_outlines_dist(f),this.sort_outlineinfos_length(p),d=0;d<p.length;d++)if(this._predictExtentNodes=p[d].seq,m=u(),m==N.default.ROUTE_SUCCESS)return m;return N.default.ROUTE_FAILED_CANNOT_ARRIVE}}return N.default.ROUTE_SUCCESS}},{key:"getRouteResult",value:function(){if(this._naviToDoor&&(this._endDoor=null,this._endModel&&0<this._result.length)){for(var e,t=this._result[this._result.length-1],n=t.result,r={x:-1,y:-1},i=n.length-1;0<i;i--){var a=n[i],o=n[i-1];if(_.default.segCrossPolygon(a.point,o.point,this._endModel.points,r)){e=i;break}}(0,R.default)(n).call(n,e);var s=new w.default;s.Id=-1,s.point=r,n.push(s),this._endDoor=r}for(var l=[],u=0;u<this._result.length;u++){this._simplifyRouteResult(this._result[u]);for(var h=this._result[u],c=h.groupId,d=h.result,f=[],p=0,m=0;m<d.length;m++)f.push(d[m].point),m!=d.length-1&&(p+=_.default.distanceOfTwoPoints(d[m].point,d[m+1].point));var v,g,y=new x.default;y._groupId=c,y._nodeList=d,y._pointList=f,y._length=p,l.push(y),u!=this._result.length-1&&(v=this._getBeginTransitionRoute(this._result[u]),g=this._getEndTransitionRoute(this._result[u+1]),l.push(v),l.push(g))}return l}},{key:"setBannedPoltyons",value:function(e){for(var t in e){var n=(0,l.default)(t),r=this._multiFloorDijkstraMap.get(n);r.setBannedPoltyons(e[t])}}},{key:"clearBannedAreas",value:function(){this._multiFloorDijkstraMap.each(function(e,t,n){n.clearBannedArea()})}},{key:"refreshBannedArea",value:function(){this._multiFloorDijkstraMap.each(function(e,t){t._zoneIdSimpleDijkstraMap.get(-1).refreshAdjList()})}},{key:"_simplifyRouteResult",value:function(e){if(e&&e.result){var t=e.result,n=t.length;if(n&&!(n<2)){var r=[];r.push(t[0]);var i=t[0],a=t[n-1];_.default.distanceOfTwoPoints(i.point,a.point),_.default.epsilon();for(var o=1;o<n-1;o++){var s=t[o];null!=i&&_.default.distanceOfTwoPoints(i.point,s.point)<_.default.epsilon()||null!=a&&_.default.distanceOfTwoPoints(a.point,s.point)<_.default.epsilon()||r.push(s)}r.push(a),n=r.length;for(var l=new Array(n),u=0;u<n;u++)l[u]=0;for(var h=1;h<n-1;h++){for(var c=r[h],d=h-1;0!=l[d];)d--;var f=r[d],p=r[h+1];_.default.isPointOnSegment(c.point,f.point,p.point)&&(l[h]=1)}for(var m=[],v=0;v<n;v++)0==l[v]&&m.push(r[v]);e.result=m}}}},{key:"resetBanned",value:function(){this._multiFloorDijkstraMap.each(function(e,t){t.resetBanned()})}},{key:"reset",value:function(){this._predictExtentNodes=[],this._predictLiftNodes=[],this._multiFloorDijkstraMap.each(function(e,t){t.reset()})}},{key:"pathConstraint",value:function(r,i){var a=this;if(this._multiFloorDijkstraMap.size()<=0)return null;var e=this._multiFloorDijkstraMap.get(r.groupID);if(!e)return null;var t=e._naviGraph;if(!t)return null;var n=[];n.push.apply(n,(0,T.default)(t.roadVector)),e._zoneIdGraph.each(function(e,t){n.push.apply(n,(0,T.default)(t.roadVector))});var o={},s=t.queryContainExtentId(r),l={distance:Number.MAX_VALUE,road:null,coord:{groupID:r.groupID}},u=null;return n.length&&((0,c.default)(n).call(n,function(e){var t,n;e.roadEntry!=A.default.NaviRoadEntry_FORBID&&(i?0<=(0,M.default)(i).call(i,e.roadRank)&&s==e.extentId&&(t=_.default.pointDistanceToLine(r,e.startPoint,e.endPoint,o),t<l.distance&&(l.distance=t,l.road=e,l.angle=a._getRouteAngle(e.startPoint,e.endPoint),(0,h.default)(l.coord,o))):s==e.extentId&&(n=_.default.pointDistanceToLine(r,e.startPoint,e.endPoint,o),n<l.distance&&(l.distance=n,l.road=e,l.angle=a._getRouteAngle(e.startPoint,e.endPoint),(0,h.default)(l.coord,o))))}),u=l),u}},{key:"_getRouteAngle",value:function(e,t){var n=new Geo.Vector3(0,0,1),r=new Geo.Vector3(e.x,0,e.y),i=new Geo.Vector3(t.x,0,t.y),a=i.clone().sub(r).normalize(),o=a.angleTo(n)*Geo._Math.RAD2DEG,s=0<a.clone().cross(n).y;return s?360-o:o}},{key:"_initNaviGraphs",value:function(e){for(var t in this._graphs=new v.default,e){var n=e[t].gid;if(null!=n){var r=e[t].geo[0],i=e[t].biz[0],a=e[t].navi[0],o=this._naviService.convertToGroup(n,r,i,a),s=new v.default,l=this._initNaviNodes(o,s),u=this._initNaviRoads(o),h=this._initNaviZones(o),c=this._initNaviObstructExtents(o),d=this._initNaviObstructModels(o);this._processNaviObstructModels(d,l,a,s);var f=new I.default(l,u,!0,1);f.groupId=n,0!=c.length&&(f.obstructExtents=c),0!=h.length&&(f.zones=h),0!=d.length&&(f.obstructModels=d);for(var p=0;p<u.length;p++)u[p].extentId=f.queryContainExtentId(u[p].startPoint);this._graphs.put(o.gid,f)}}}},{key:"_initNaviNodes",value:function(a,o){var e,s=[],t=function(e){var t,n,r=a.naviNodes[e];if(null==r.nodeId)return"continue";var i=new w.default;i.Id=r.nodeId,i.point=r.geoArr,i.nodeType=r.nodeType,i.liftType=r.liftType,i.liftFlag=r.liftFlag,i.liftEntry=r.liftEntry,(0,c.default)(t=r.linkSegArr).call(t,function(e){i.segLinks.push((0,l.default)(e))}),(0,c.default)(n=r.liftFloorArr).call(n,function(e){i.liftFloors.push((0,l.default)(e))}),s.push(i),o.put(r.nodeId,e)};for(e in a.naviNodes)t(e);return s}},{key:"_initNaviRoads",value:function(e){var t,n=[];for(t in e.naviSegments){var r,i=e.naviSegments[t],a=i.geoArr;a&&(r=new m.default,r.Id=i.segmentId,r.startId=i.snode,r.startPoint=a[0],r.endId=i.enode,r.endPoint=a[1],r.length=i.length,r.roadEntry=i.entry,r.roadRank=i.rank,n.push(r))}return n}},{key:"_initNaviObstructExtents",value:function(e){for(var t=[],n=0,r=e.extentLayer.length;n<r;n++){var i=e.extentLayer[n],a=i.geoArr,a=a||[],o=new y.default(i.eid,e.gid,0,a,i.center,i.holes);o.fid=i.fid,t.push(o)}return t}},{key:"_initNaviObstructModels",value:function(e){for(var t=[],n=0,r=e.modelLayer.length;n<r;n++){var i=e.modelLayer[n],a=i.geoArr,a=a||[],o=new y.default(i.eid,e.gid,0,a,i.center,i.holes);o.fid=i.fid,o.pass=i.pass,t.push(o)}return t}},{key:"_initNaviZones",value:function(e){for(var t=[],n=0,r=e.naviZones.length;n<r;n++){var i=e.naviZones[n],a=new g.default(i.id,e.gid,i.type,i.geoArr);t.push(a)}return t}},{key:"_processNaviObstructModels",value:function(e,t,n,r){for(var i=new v.default,a=0;a<e.length;a++){var o=e[a];i.put(o.Id,a)}for(var s=0;s<n.naviModels.length;s++)for(var l=n.naviModels[s],u=l.id,h=e[i.get(u)],c=0;c<l.doorids.length;c++){var d=l.doorids[c],f=t[r.get(d)];h.doors.push(f);var p=l.nodetypes[c],m=l.entrytypes[c];h.doorTypes.push(p),h.doorEntrys.push(m)}}},{key:"_processLiftFloors",value:function(){var s;this._graphs.size()<=0||(s={},this._graphs.each(function(e,t){var n,r=[];for(n in t.queryLiftNodesByType(A.default.NaviLiftType_Escalator,r),r){var i,a,o=r[n];o.liftFlag&&(i=o.liftFlag,s[i]?s[i]=(0,d.default)(a=s[i]).call(a,o.liftFloors):s[i]=o.liftFloors)}}),this._graphs.each(function(e,t){var n,r=[];for(n in t.queryLiftNodesByType(A.default.NaviLiftType_Escalator,r),r){var i,a=r[n];a.liftFlag&&(i=a.liftFlag,s[i]&&(a.liftFloors=s[i]))}}))}},{key:"_initDijkstras",value:function(){var e,n=this;!this._graphs||!this._graphs instanceof v.default||(this._initExtentNodes(),this._initExtentRoads(),e=new I.default(this._extentNodes,this._extentRoads),this._outlineAnalyzeDijkstra=new P.default(e),this._graphs.each(function(e,t){n._multiFloorDijkstraMap.put(e,new C.default(t))}))}},{key:"_initExtentNodes",value:function(){var h=this;this._extentNodes=[];var c=0;this._graphs.each(function(e,t){for(var n=t.obstructExtents,r=0;r<n.length;r++){var i=n[r],a=new k.default;a.Id=c++,a.groupId=e,a.extentId=i.Id,a.extent=i;for(var o=0;o<t.nodeVector.length;o++){var s,l,u=t.nodeVector[o];u.liftType!=A.default.NaviLiftType_NULL&&_.default.pointInPolygon2d(i.points,u.point,i.pointCount)&&(s=new p.default,l=t.queryZoneByPoint(u.point),s.zone=l,s.setNode(u),s.groupId=e,s._wrappedNode=u,s._liftType=u.liftType,a.liftNodes.push(s))}h._extentNodes.push(a)}})}},{key:"_initExtentRoads",value:function(){this._extentRoads=[];for(var e=0;e<this._extentNodes.length;e++)for(var t=this._extentNodes[e],n=0;n<this._extentNodes.length;n++){var r,i,a,o=this._extentNodes[n];e!=n&&(r=this._checkConnection(t,o),null!=r&&(i=Math.abs(t.groupId-o.groupId),r*=0==i?1:i,a=new m.default,a.startId=t.Id,a.endId=o.Id,a.entryType=A.default.NaviRoadEntry_FORWARD,a.length=r,this._extentRoads.push(a)))}}},{key:"_checkConnection",value:function(e,t){for(var n=Number.MAX_VALUE,r=!1,i=e.groupId,a=t.groupId,o=i<a?A.default.NaviLiftEntry_DOWN:A.default.NaviLiftEntry_UP,s=0;s<e.liftNodes.length;s++){var l=e.liftNodes[s],u=l.liftEntry;if(u!=A.default.NaviLiftEntry_FORBID&&u!=o){var h,c=l.liftType;if(E.default.PRIORITY_LIFTONLY==this._priority){if(A.default.NaviLiftType_Lift!=c)continue}else if(E.default.PRIORITY_ESCALATORONLY==this._priority){if(A.default.NaviLiftType_Escalator!=c)continue}else if(E.default.PRIORITY_STAIRONLY==this._priority){if(A.default.NaviLiftType_Stair!=c)continue}else if(E.default.PRIORITY_ACCESSIBLEONLY==this._priority&&A.default.NaviLiftType_Accessible!=c)continue;if(c!=A.default.NaviLiftType_Stair&&-1==(0,M.default)(h=l.liftFloors).call(h,a))continue;for(var d=0;d<t.liftNodes.length;d++){var f=t.liftNodes[d];if(null!=f&&l.liftFlag==f.liftFlag)if(e.Id,t.Id,l.liftFlag,E.default.PRIORITY_LIFTFIRST==this._priority||E.default.PRIORITY_DEFAULT==this._priority){if(A.default.NaviLiftType_Lift==c||A.default.NaviLiftType_Accessible==c){var p=this._liftLessWeightGain;return p}if(A.default.NaviLiftType_Escalator==c){var m=this._escalatorWeightGain;m<n&&(n=m),r=!0;break}if(A.default.NaviLiftType_Stair==c){var v=this._stairGreaterWeightGain;v<n&&(n=v),r=!0;break}}else if(E.default.PRIORITY_ESCALATORFIRST==this._priority){if(A.default.NaviLiftType_Lift==c||A.default.NaviLiftType_Accessible==c){var g=this._liftWeightGain;g<n&&(n=g),r=!0;break}if(A.default.NaviLiftType_Escalator==c){var y=this._escalatorLessWightGain;return y}if(A.default.NaviLiftType_Stair==c){var _=this._stairGreaterWeightGain;_<n&&(n=_),r=!0;break}}else if(E.default.PRIORITY_STAIRFIRST==this._priority){if(A.default.NaviLiftType_Lift==c){var x=this._liftWeightGain;x<n&&(n=x),r=!0;break}if(A.default.NaviLiftType_Escalator==c||A.default.NaviLiftType_Accessible==c){var w=this._escalatorGreaterWeightGain;w<n&&(n=w),r=!0;break}if(A.default.NaviLiftType_Stair==c){var b=this._stairLessWeightGain;return b}}else{if(E.default.PRIORITY_LIFTFIRST1==this._priority||E.default.PRIORITY_STAIRFIRST1==this._priority||E.default.PRIORITY_ESCALATORFIRST1==this._priority)return this._weightBias;if(E.default.PRIORITY_LIFTONLY==this._priority||E.default.PRIORITY_ESCALATORONLY==this._priority||E.default.PRIORITY_STAIRONLY==this._priority||E.default.PRIORITY_ACCESSIBLEONLY==this._priority)return this._weightBias}}}}return r?n:null}},{key:"_getLiftNode",value:function(e,t){for(var n=0;n<t.length;n++)if(t[n].liftFlag==e)return t[n];return null}},{key:"_switchToPriority",value:function(e){var t;this._priority==e&&this._outlineAnalyseDijkstra||(this._priority=e,this._initExtentRoads(),t=new I.default(this._extentNodes,this._extentRoads),this._outlineAnalyseDijkstra=new P.default(t))}},{key:"_getEndTransitionRoute",value:function(e){var t=e.result,n=new x.default;return n._groupId=e.groupId,n._nodeList.push(t[0]),n._pointList.push(t[0].point),n._length=0,n}},{key:"_getBeginTransitionRoute",value:function(e){var t=e.result,n=new x.default;return n._groupId=e.groupId,n._nodeList.push(t[t.length-1]),n._pointList.push(t[t.length-1].point),n._length=0,n}},{key:"_getExtentNode",value:function(e,t){for(var n=0;n<this._extentNodes.length;n++)if(this._extentNodes[n].groupId==e&&this._extentNodes[n].extentId==t)return this._extentNodes[n];return null}},{key:"_calcPredictExtentNodes",value:function(e,t,n,r){var i=this._getExtentNode(e,t),a=this._getExtentNode(n,r),o=this._outlineAnalyseDijkstra.routeCalculate(i,a);if(o!=N.default.ROUTE_SUCCESS)return o;var s=this._outlineAnalyseDijkstra.getRouteCalculateResult();this._predictExtentNodes=[];for(var l=0;l<s.length;l++)this._predictExtentNodes.push(s[l]);return o}},{key:"_compareLiftFirstFunc",value:function(e,t){return e.liftType==A.default.NaviLiftType_Lift&&t.liftType==A.default.NaviLiftType_Lift?e._dist-t._dist:e.liftType==A.default.NaviLiftType_Lift?-1:t.liftType==A.default.NaviLiftType_Lift?1:e._dist-t._dist}},{key:"_compareEscalatorFirstFunc",value:function(e,t){return e.liftType==A.default.NaviLiftType_Escalator&&t.liftType==A.default.NaviLiftType_Escalator?e._dist-t._dist:e.liftType==A.default.NaviLiftType_Escalator?-1:t.liftType==A.default.NaviLiftType_Escalator?1:e._dist-t._dist}},{key:"_compareStairFirstFunc",value:function(e,t){return e.liftType==A.default.NaviLiftType_Stair&&t.liftType==A.default.NaviLiftType_Stair?e._dist-t._dist:e.liftType==A.default.NaviLiftType_Stair?-1:t.liftType==A.default.NaviLiftType_Stair?1:e._dist-t._dist}},{key:"_has_extent_node",value:function(e,t){if(null==e)return!1;for(var n=0;n<e.length;n++)if(e[n].Id==t.Id)return!0;return!1}},{key:"_has_adj_nodeId",value:function(e,t){if(null==e)return!1;for(var n=0;n<e.length;n++)if(e[n].nodeId==t.Id)return!0;return!1}},{key:"_enlarge_connected_nodes_num",value:function(e,t,n){var r=this._outlineAnalyseDijkstra._naviGraph.adjList;if(0==r.size())return[];var i=e.length-1,a=r.get(e[i].Id);if(null==a)return[];if(0==n)return this._has_adj_nodeId(a,t)?(e.push(t),e):[];for(var o=[],s=0;s<a.length;s++){var l,u,h,c=a[s];this._has_extent_node(e,c)||c.nodeId==t.Id||(l=(0,d.default)(e).call(e),u=this._outlineAnalyseDijkstra._naviGraph.getIndexByNodeID(c.nodeId),l.push(this._outlineAnalyseDijkstra._naviGraph.nodeVector[u]),h=this._enlarge_connected_nodes_num(l,t,n-1),0!=h.length&&o.push(h))}return o}},{key:"_enlarge_connected_nodes_norepeat",value:function(e,t,n){var r=this._outlineAnalyseDijkstra._naviGraph.adjList;if(0!=r.size()){for(var i,a=-1,o=0;o<n.length;o++)(0,M.default)(i=n[o]).call(i,e)==n[o].length-1&&(a=o);if(-1!=a){var s=n[a];(0,R.default)(n).call(n,a,1);var l=r.get(e.Id);if(null!=l)for(var u=0;u<l.length;u++){var h,c=this._extentNodes[l[u].nodeId];this._has_extent_node(s,c)||(h=[],h.push.apply(h,(0,T.default)(s)),h.push(c),n.push(h),c.Id!=t.Id&&this._enlarge_connected_nodes_norepeat(c,t,n))}}}}},{key:"_calcPredictConnectedLift",value:function(e,t,n){for(var r=e.liftNodes,i=n.liftNodes,a=0;a<r.length;a++){var o=r[a];o._dist=_.default.distanceOfTwoPoints(o.point,t)}E.default.PRIORITY_DEFAULT==this._priority||E.default.PRIORITY_LIFTONLY==this._priority||E.default.PRIORITY_LIFTONLY==this._priority?(0,S.default)(r).call(r,this._compareLiftFirstFunc):E.default.PRIORITY_ESCALATORFIRST==this._priority||E.default.PRIORITY_ESCALATORONLY==this._priority?(0,S.default)(r).call(r,this._compareEscalatorFirstFunc):E.default.PRIORITY_STAIRFIRST!=this._priority&&E.default.PRIORITY_STAIRONLY!=this._priority||(0,S.default)(r).call(r,this._compareLiftFirstFunc);for(var s=null,l=null,u=!1,h=0;h<r.length;h++){for(var c=r[h],d=c.liftFlag,f=(c.liftFloors,0);f<i.length;f++)if(i[f].liftFlag==d){s=c,l=i[f],u=!0;break}if(u)break}return null==s||null==l?null:{startLiftNodes:s,endLiftNodes:l}}},{key:"_calcPredictLiftNodesBak",value:function(e,t,n,r,i){this._startZone=this._multiFloorDijkstraMap.get(e.groupId)._naviGraph.queryZoneByPoint(n);for(var a=e.queryLiftNodes(this._startZone,n,this._endPoint,this._priority),o=0;o<a.length;o++){var s=a[o];if(A.default.NaviLiftType_Stair!=s.liftType){var l=s.liftFloors;if(-1==(0,M.default)(l).call(l,t.groupId))continue}for(var u=0;u<t.liftNodes.length;u++){var h=t.liftNodes[u];if(s.liftFlag==h.liftFlag){r.push(s),i.push(h);break}}}return 0==r.length}},{key:"_calcPredictLiftNodes",value:function(i,t,e,n,r){this._startZone=this._multiFloorDijkstraMap.get(i.groupId)._naviGraph.queryZoneByPoint(e);var a=[];function o(e,t){var n,r=i.queryLifts(e,t);(n=a).push.apply(n,(0,T.default)(r))}for(var s=i.liftNodes,l=0;l<s.length;l++){var u=s[l],h=D.default.toVector(u.point),c=D.default.toVector(this._endPoint),d=D.default.toVector(e);u._dist=c.sub(h).length()+h.sub(d).length()}var f,p=i.extent.bb,m=p.maxX-p.minX+(p.maxY-p.minY);E.default.PRIORITY_LIFTONLY!=this._priority&&E.default.PRIORITY_ESCALATORONLY!=this._priority&&E.default.PRIORITY_STAIRONLY!=this._priority&&E.default.PRIORITY_ACCESSIBLEONLY!=this._priority||(f=null,E.default.PRIORITY_LIFTONLY==this._priority&&(f=A.default.NaviLiftType_Lift),E.default.PRIORITY_ESCALATORONLY==this._priority&&(f=A.default.NaviLiftType_Escalator),E.default.PRIORITY_STAIRONLY==this._priority&&(f=A.default.NaviLiftType_Stair),E.default.PRIORITY_ACCESSIBLEONLY==this._priority&&(f=A.default.NaviLiftType_Accessible),a=i.queryLifts(f)),E.default.PRIORITY_LIFTFIRST!=this._priority&&E.default.PRIORITY_ESCALATORFIRST!=this._priority&&E.default.PRIORITY_STAIRFIRST!=this._priority&&E.default.PRIORITY_DEFAULT!=this._priority||(E.default.PRIORITY_LIFTFIRST!=this._priority&&E.default.PRIORITY_DEFAULT!=this._priority||(o(A.default.NaviLiftType_Lift,-15),o(A.default.NaviLiftType_Escalator,-8),o(A.default.NaviLiftType_Stair,0)),E.default.PRIORITY_ESCALATORFIRST==this._priority&&(o(A.default.NaviLiftType_Lift,-8),o(A.default.NaviLiftType_Escalator,-15),o(A.default.NaviLiftType_Stair,0)),E.default.PRIORITY_STAIRFIRST==this._priority&&(o(A.default.NaviLiftType_Lift,-8),o(A.default.NaviLiftType_Escalator,0),o(A.default.NaviLiftType_Stair,-15))),E.default.PRIORITY_LIFTFIRST1!=this._priority&&E.default.PRIORITY_ESCALATORFIRST1!=this._priority&&E.default.PRIORITY_STAIRFIRST1!=this._priority||(E.default.PRIORITY_LIFTFIRST1==this._priority&&(o(A.default.NaviLiftType_Lift,-m),o(A.default.NaviLiftType_Escalator,0),o(A.default.NaviLiftType_Stair,0)),E.default.PRIORITY_ESCALATORFIRST1==this._priority&&(o(A.default.NaviLiftType_Lift,0),o(A.default.NaviLiftType_Escalator,-m),o(A.default.NaviLiftType_Stair,0)),E.default.PRIORITY_STAIRFIRST1==this._priority&&(o(A.default.NaviLiftType_Lift,0),o(A.default.NaviLiftType_Escalator,0),o(A.default.NaviLiftType_Stair,-m)));var v=this;(0,S.default)(a).call(a,function(e,t){if(e.zone!=t.zone){if(e.zone==v._startZone)return-1;if(t.zone==v._startZone)return 1}return e._dist-t._dist});for(var g=0;g<a.length;g++){var y,_=a[g];if(A.default.NaviLiftType_Stair!=_._liftType&&(y=_._wrappedNode.liftFloors,(0,b.default)(y).call(y,function(e){return e==t.groupId})),!(1==_.liftEntry&&t.groupId<i.groupId||2==_.liftEntry&&t.groupId>i.groupId))for(var x=0;x<t.liftNodes.length;x++){var w=t.liftNodes[x];if(_.liftFlag==w.liftFlag){n.push(_),r.push(w);break}}}return 0!=n.length}},{key:"assginedInfos",set:function(e){this._assignedInfos=e},get:function(){return this._assignedInfos}},{key:"passPts",set:function(e){this._passPts=e}},{key:"failedInsertedPts",get:function(){return this._failedInsertedPts}},{key:"naviToDoor",get:function(){return this._naviToDoor},set:function(e){this._naviToDoor=e}}]),t}(),U=B;t.default=U},function(e,t,n){var r=n(587);e.exports=r},function(e,t,n){var r=n(588),i=Array.prototype;e.exports=function(e){var t=e.find;return e===i||e instanceof Array&&t===i.find?r:t}},function(e,t,n){n(589);var r=n(24);e.exports=r("Array").find},function(e,t,n){"use strict";var r=n(8),i=n(61).find,a=n(126),o=n(51),s="find",l=!0,u=o(s);s in[]&&Array(1)[s](function(){l=!1}),r({target:"Array",proto:!0,forced:l||!u},{find:function(e,t){return i(this,e,1<arguments.length?t:void 0)}}),a(s)},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=function(){function t(e){(0,a.default)(this,t),this._options=e,this._options.hasOwnProperty("naviServerURL")&&null!=this._options.naviServerURL||(this._options.naviServerURL=".http://source.fengmap.com/newmap"),void 0===this._options.useStatic&&(this._options.useStatic=!1)}return(0,o.default)(t,[{key:"naviServerURL",get:function(){return this._options.naviServerURL}},{key:"useStatic",get:function(){return this._options.useStatic}}]),t}(),l=s;t.default=l},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),o=r(n(2)),s=r(n(5)),l=r(n(6)),u=r(n(7)),h=r(n(79));function c(r){var i=d();return function(){var e,t=(0,u.default)(r),n=i?(e=(0,u.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,l.default)(this,n)}}function d(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var f=function(e){(0,s.default)(n,e);var t=c(n);function n(){var e;return(0,o.default)(this,n),e=t.call(this),e.liftId=0,e.groupId=0,e.zone=null,e._dist=0,e._wrappedNode=null,e._liftType=null,e}return n}(h.default),p=f;t.default=p},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(2)),a=r(n(3)),l=r(n(153)),u=r(n(28)),h=r(n(263)),o=function(){function o(e,t,n,r,i,a){(0,s.default)(this,o),this.Id=e,this.fid="",this.points=r,this.pointCount=r&&r.length?r.length:0,this.center=i,this.holes=a,this._type=n,this.groupID=t,this.doors=[],this.doorTypes=[],this.doorEntrys=[],this.parent=null,this.child=null,this.brothers=[],this.level=0,this.inId=0,this._area=null,this.isExtent=!1,this.bb=new l.default,this.refreshBB()}return(0,a.default)(o,[{key:"contain",value:function(e){return u.default.pointInPolygon2d(this.points,e,this.points.length-1)}},{key:"refreshBB",value:function(){this.bb.init();for(var e=0;e<this.pointCount;e++)this.bb.expandBy({x:this.points[e].x,y:this.points[e].y})}},{key:"toZone",value:function(){var e=new h.default(this.isExtent?-this.Id:this.Id,this.groupID,this._type,this.points);return e.pass=this.pass,e.level=this.level,e.inId=this.inId,pZone}},{key:"pass",set:function(e){this._type|=e},get:function(){return 3&this._type}},{key:"level",set:function(e){this._level=31&e},get:function(){return 31&_level}},{key:"area",get:function(){return null==this._area&&(this._area=u.default.calcPolygonArea2d(this.points)),this._area}}]),o}(),c=o;t.default=c},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(4)),f=r(n(32)),p=r(n(49)),s=r(n(33)),o=r(n(2)),l=r(n(3)),u=r(n(5)),h=r(n(6)),c=r(n(7)),d=r(n(79)),m=r(n(56)),v=r(n(95)),g=r(n(28));function y(r){var i=_();return function(){var e,t=(0,c.default)(r),n=i?(e=(0,c.default)(this).constructor,(0,a.default)(t,arguments,e)):t.apply(this,arguments);return(0,h.default)(this,n)}}function _(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var x=function(e){(0,u.default)(n,e);var t=y(n);function n(){var e;return(0,o.default)(this,n),e=t.call(this),e.groupId=0,e.extentId=0,e.liftNodes=[],e._zone=null,e._firstPriorityOffset=15,e._secondPriorityOffset=8,e}return(0,l.default)(n,[{key:"queryLifts",value:function(e,t){if(1==arguments.length){for(var n=e,r=[],i=0;i<this.liftNodes.length;i++)n==this.liftNodes[i]._liftType&&r.push(this.liftNodes[i]);return r}if(2!=arguments.length)return[];for(var n=arguments[0],a=t,o=[],i=0;i<this.liftNodes.length;i++){var s=this.liftNodes[i];n==s._liftType&&(s._dist=s._dist+a,o.push(s))}return o}},{key:"queryLiftNodes",value:function(e,t,n,r){this._zone=e;var i=[];i.push.apply(i,(0,s.default)(this.liftNodes));for(var a=0;a<i.length;a++){var o=i[a];o._dist=g.default.distanceOfTwoPoints(n,o.point)+g.default.distanceOfTwoPoints(o.point,t)}return this._liftNodeSort(i,r)}},{key:"_liftNodeSort",value:function(e,t){if(t==v.default.PRIORITY_LIFTFIRST1){var n,r=(0,p.default)(n=this._sortLiftFirst).call(n,this);(0,f.default)(e).call(e,r)}else if(t==v.default.PRIORITY_ESCALATORFIRST1){var i,a=(0,p.default)(i=this._sortEscalatorFirst).call(i,this);(0,f.default)(e).call(e,a)}else if(t!=v.default.PRIORITY_STAIRFIRST1){var o,s=(0,p.default)(o=this._sortStairFirst).call(o,this);(0,f.default)(e).call(e,s)}else{var l,u;this._modifyDistance(e,t);for(var h=[],c=0;c<e.length;c++)e[c]._dist&&h.push(e[c]);e=[],(l=e).push.apply(l,h);var d=(0,p.default)(u=this._sortDistFunc).call(u,this);(0,f.default)(e).call(e,d)}return e}},{key:"_sortLiftFirst",value:function(e,t){if(e.zone!=t.zone){if(this._zone==e.zone)return-1;if(this._zone==t.zone)return 1}return e.liftType!=m.default.NaviLiftType_Lift&&e.liftType!=m.default.NaviLiftType_Accessible||t.liftType!=m.default.NaviLiftType_Lift&&t.liftType!=m.default.NaviLiftType_Accessible?e.liftType==m.default.NaviLiftType_Lift||e.liftType==m.default.NaviLiftType_Accessible?-1:t.liftType==m.default.NaviLiftType_Lift||t.liftType==m.default.NaviLiftType_Accessible?1:e._dist-t._dist:e._dist<t._dist}},{key:"_sortEscalatorFirst",value:function(e,t){if(e.zone!=t.zone){if(this._zone==e.zone)return-1;if(this._zone==t.zone)return 1}return e.liftType==m.default.NaviLiftType_Escalator&&t.liftType==m.default.NaviLiftType_Escalator?e._dist<t._dist:e.liftType==m.default.NaviLiftType_Escalator?-1:t.liftType==m.default.NaviLiftType_Escalator?1:e._dist-t._dist}},{key:"_sortStairFirst",value:function(e,t){if(e.zone!=t.zone){if(this._zone==e.zone)return-1;if(this._zone==t.zone)return 1}return e.liftType==m.default.NaviLiftType_Stair&&t.liftType==m.default.NaviLiftType_Stair?e._dist<t._dist:e.liftType==m.default.NaviLiftType_Stair?-1:t.liftType==m.default.NaviLiftType_Stair?1:e._dist-t._dist}},{key:"_sortDistFunc",value:function(e,t){if(e.zone!=t.zone){if(this._zone==e.zone)return-1;if(this._zone==t.zone)return 1}return e._dist-t._dist}},{key:"_modifyDistance",value:function(e,t){if(t==v.default.PRIORITY_DEFAULT)for(var n=0;n<e.length;n++)e[n].liftType==m.default.NaviLiftType_Escalator?e[n]._dist-=this._firstPriorityOffset:e[n].liftType!=m.default.NaviLiftType_Lift&&e[n].liftType!=m.default.NaviLiftType_Accessible||(e[n]._dist-=this._secondPriorityOffset);else if(t==v.default.PRIORITY_STAIRFIRST)for(var r=0;r<e.length;r++)e[r].liftType==m.default.NaviLiftType_Stair?e[r]._dist-=this._firstPriorityOffset:e[r].liftType==m.default.NaviLiftType_Escalator&&(e[r]._dist-=this._secondPriorityOffset);else if(t==v.default.PRIORITY_ESCALATORFIRST)for(var i=0;i<e.length;i++)e[i].liftType==m.default.NaviLiftType_Escalator?e[i]._dist-=this._firstPriorityOffset:e[i].liftType!=m.default.NaviLiftType_Lift&&e[i].liftType!=m.default.NaviLiftType_Accessible||(e[i]._dist-=this._secondPriorityOffset);else if(t==v.default.PRIORITY_LIFTFIRST)for(var a=0;a<e.length;a++)e[a].liftType==m.default.NaviLiftType_Lift||e[a].liftType==m.default.NaviLiftType_Accessible?e[a]._dist-=this._firstPriorityOffset:e[a].liftType==m.default.NaviLiftType_Escalator&&(e[a]._dist-=this._secondPriorityOffset);else if(t==v.default.PRIORITY_STAIRONLY)for(var o=0;o<e.length;o++)e[o].liftType!=m.default.NaviLiftType_Stair&&(e[o]._dist=null);else if(t==v.default.PRIORITY_ESCALATORONLY)for(var s=0;s<e.length;s++)e[s].liftType!=m.default.NaviLiftType_Escalator&&(e[s]._dist=null);else if(t==v.default.PRIORITY_LIFTONLY)for(var l=0;l<e.length;l++)e[l].liftType!=m.default.NaviLiftType_Lift&&e[l].liftType!=m.default.NaviLiftType_Accessible&&(e[l]._dist=null);else if(t==v.default.PRIORITY_ACCESSIBLEONLY)for(var u=0;u<e.length;u++)e[u].liftType!=m.default.NaviLiftType_Accessible&&(e[u]._dist=null)}}]),n}(d.default),w=x;t.default=w},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var _=r(n(32)),l=r(n(60)),w=r(n(116)),K=r(n(9)),Q=r(n(15)),$=r(n(12)),C=r(n(54)),d=r(n(36)),D=r(n(33)),a=r(n(2)),o=r(n(3)),O=r(n(28)),ee=r(n(56)),s=r(n(68)),u=r(n(264)),te=r(n(79)),ne=r(n(161)),h=r(n(97)),c=r(n(163)),re=r(n(162)),F=r(n(69));r(n(160)),r(n(595));var f=function(){function t(e){(0,a.default)(this,t),this._startModel=null,this._endModel=null,this._naviGraph=e,this._zoneMap=new h.default,this._zoneIdGraph=new h.default,this._originDijkstra=null,this._zoneIdSimpleDijkstraMap=new h.default,this._resultVector=[],this._startZoneId=Number.INT_MIN,this._endZoneId=Number.INT_MIN,this._tmpId=-1,this._startNode=null,this._endNode=null,this._mode=s.default.MODULE_SHORTEST,this._zonePNTModelsMap=new h.default,this._zoneNPModelsMap=new h.default,this._modelIdRoadsMap=new h.default,this._variableModelPairs=[],this._unattachedTempRoads=[],this._attachedTempRoads=[],this._unattachedTempRoadTrees=[],this._kScaleVariable=100,this._kRemainedZoneId=-1,this._kMinModelAngle=15,this._kDoorToler=.1,this._tmpAdjNodeIds=[],this._assignedPts=[],this._newTempRoads=[],this._bannedPolys=[],this._assignedNodes=[],this._segmentByZones(),this._assemblePassNotThroughModels(),this._assembleNotPassModels(),this._fitVariableRoadsToModel(),this._adjustNPModelRoads()}return(0,o.default)(t,[{key:"routeCalculate",value:function(e,t,n){if(this._startZoneId=e instanceof te.default?this._calcZoneIdByCoord(e.point):this._calcZoneIdByCoord(e),this._endZoneId=t instanceof te.default?this._calcZoneIdByCoord(t.point):this._calcZoneIdByCoord(t),n&&(this._mode=n),this._naviGraph.consoleNodeInfos(),this._naviGraph.consoleRoadInfos(),e instanceof te.default)this._startNode=e;else if(F.default.ROUTE_FAILED_NO_DATA_START==this._processStartPoint(e,e))return F.default.ROUTE_FAILED_NO_DATA_START;if(this._naviGraph.consoleNodeInfos(),this._naviGraph.consoleRoadInfos(),t instanceof te.default)this._endNode=t;else if(F.default.ROUTE_FAILED_NO_DATA_END==this._processEndPoint(t,e instanceof te.default?e.point:e))return F.default.ROUTE_FAILED_NO_DATA_END;return this._naviGraph.consoleNodeInfos(),this._naviGraph.consoleRoadInfos(),null==this._startNode?F.default.ROUTE_FAILED_NO_DATA_START:null==this._endNode?F.default.ROUTE_FAILED_NO_DATA_END:(this._naviGraph.consoleNodeInfos(),this._naviGraph.consoleRoadInfos(),this._naviGraph.consoleAdjInfos(),this._routeCalculate())}},{key:"routeAssigned",value:function(){var e;this._assignedNodes=[];for(var t=0;t<this._assignedPts.length;t++){var n=this._assignedPts[t],n={x:n[0],y:n[1]},r=this._calcZoneIdByCoord(n),i=this._insertTmpIsolatedNode(r,n);this._assignedNodes.push(i)}(e=this._resultVector).push.apply(e,(0,D.default)(this._assignedNodes))}},{key:"getRouteCalculateResult",value:function(){return this._resultVector}},{key:"dispose",value:function(){this._startModel=null,this._endModel=null,this._naviGraph.dispose(),this._naviGraph=null,this._zoneMap.clear(),this._zoneMap=null,this._zoneIdGraph.each(function(e,t){t.dispose()}),this._zoneIdGraph.clear(),this._zoneIdGraph=null,null!=this._originDijkstra&&(this._originDijkstra.dispose(),this._originDijkstra=null),this._zoneIdSimpleDijkstraMap.each(function(e,t){t.dispose()}),this._zoneIdSimpleDijkstraMap.clear(),this._zoneIdSimpleDijkstraMap=null,this._resultVector=[],this._startNode=null,this._endNode=null,this._zonePNTModelsMap.clear(),this._zonePNTModelsMap=null,this._zoneNPModelsMap.clear(),this._zoneNPModelsMap=null,this._modelIdRoadsMap.clear(),this.__zoneNPModelsMap=null,this._variableModelPairs=[],this._unattachedTempRoads=[],this._attachedTempRoads=[],this._unattachedTempRoadTrees=[]}},{key:"reset",value:function(){this._resultVector=[],this._clearTempElements(-1),this._clearTempElements(this._startZoneId),this._startZoneId=Number.INT_MIN,this._clearTempElements(this._endZoneId),this._endZoneId=Number.INT_MIN,this._clearTempAdjList(),this._tmpAdjNodeIds=[];var e=this._naviGraph.roadVector.length;this._tmpId<-2*e&&(this._tmpId=-1);for(var t=0;t<this._variableModelPairs.length;t++){var n=this._variableModelPairs[t];this._switchVariableHinderTo(n.zoneId,n.model,ee.default.NaviRoadHinderType_HINDER_HIGH)}this._variableModelPairs=[],this._unattachedTempRoads=[],this._attachedTempRoads=[],this._unattachedTempRoadTrees=[]}},{key:"resetBanned",value:function(){this._newTempRoads=[];for(var e=0;e<this._noEntryRoads.length;e++){var t=this._noEntryRoads[e];t.road.roadEntry=t.originEntry}this._noEntryRoads=[],this._clearTempElements(-1);var n=this._zoneIdSimpleDijkstraMap.get(-1)._naviGraph;n.makeUpAdjList()}},{key:"setBannedPoltyons",value:function(e){this.resetBanned(),0!=e.length&&(this._bannedPolys=e,this._dealBannedAreas())}},{key:"clearBannedArea",value:function(){}},{key:"_dealBannedAreas",value:function(){for(var e=0;e<this._bannedPolys.length;e++)this._banBySinglePolygon(this._bannedPolys[e])}},{key:"_insertNewTempRoad",value:function(e,t,n,r,i){var a,o;e instanceof te.default?a=e:(a=new te.default,a.Id=t,a.point=e,this._naviGraph.nodeVector.push(a)),n instanceof te.default?o=n:(o=new te.default,o.Id=r,o.point=n,this._naviGraph.nodeVector.push(o));var s=new ne.default;s.Id=this._tmpId--,s.startId=a.Id,s.startPoint=a.point,s.endId=o.Id,s.endPoint=o.point,s.roadEntry=i,this._naviGraph.roadVector.push(s)}},{key:"_banBySinglePolygon",value:function(e){for(var t=this._naviGraph.queryRoadsByPolygon(e),n=0;n<t.length;n++){var r=t[n],i=r.road,a=i.roadEntry;this._noEntryRoads.push({road:i,originEntry:a}),i.roadEntry=ee.default.NaviRoadEntry_FORBID,1==r.crss.length&&(1==O.default.pointInPolygon2d(e,i.startPoint,e.length)?this._insertNewTempRoad(r.crss[0],this._tmpId--,i.endPoint,this._tmpId--,a):this._insertNewTempRoad(i.startPoint,this._tmpId--,r.crss[0],this._tmpId--,a)),2==r.crss.length&&(this._insertNewTempRoad(i.startPoint,this._newTempId(),r.crss[0],this._newTempId(),a),this._insertNewTempRoad(r.crss[1],this._newTempId(),i.endPoint,this._newTempId(),a))}var o=new NaviModel;o.Id=this._tmpId--,o.points=e,o.points.push(e[0]),o.pass=ee.default.NaviModelPassType_NOT_PASS,this._naviGraph.obstructModels.push(o)}},{key:"_newTempId",value:function(){return this._tmpId--}},{key:"_calcPointReachable",value:function(e){var t=this._naviGraph.queryContainExtentId(e);if(-1==t)return null;var n=this._calcZoneIdByCoord(e),r=-0,i=this._zoneIdGraph.get(n).findModel(e,r);if(null==i)return{extentId:t,model:null};if(i.pass==ee.default.NaviModelPassType_PASS_THROUGH||i.pass==ee.default.NaviModelPassType_PASS_NOT_THROUGH){if(0<i.doors.length)return{extentId:t,model:i};for(var a={},o=[],s=[],l=this._zoneIdGraph.get(n),u=l.roadVector,h=!0,c=i.points.length,d=0;d<c-1;d++)for(var f=i.points[d],p=i.points[d+1],m=0;m<u.length;m++){var v=u[m];if(1==O.default.calcCrossPoint(f,p,v.startPoint,v.endPoint,a)){if(h=!1,ee.default.NaviRoadEntry_FORBID==v.roadEntry)continue;var g=new Object;g.x=a.x,g.y=a.y,o.push(g),s.push(u[m])}}if(h)return{extentId:t,model:i};if(0==o.length)return null;i.doors=[],i.doorEntrys=[],i.doorTypes=[];for(var y=0;y<o.length;y++){var _=o[y],x=s[y],w=this._insertNodeToRoad(n,_,x);w.nodeType=ee.default.NaviNodeType_COMMON,x.roadEntry==ee.default.NaviRoadEntry_BOTH?w.entranceType=ee.default.NaviEntranceType_ACCESS:O.default.pointInPolygon2d(i.points,x.startPoint,i.points.length-1)?(x.roadEntry==ee.default.NaviRoadEntry_FORWARD&&(w.entranceType=ee.default.NaviEntranceType_EXIT),x.roadEntry==ee.default.NaviRoadEntry_BACK&&(w.entranceType=ee.default.NaviEntranceType_ENTRANCE)):(x.roadEntry==ee.default.NaviRoadEntry_FORWARD&&(w.entranceType=ee.default.NaviEntranceType_ENTRANCE),x.roadEntry==ee.default.NaviRoadEntry_BACK&&(w.entranceType=ee.default.NaviEntranceType_EXIT)),i.doors.push(w),i.doorEntrys.push(w.entranceType),i.doorTypes.push(w.nodeType)}}return i.pass!=ee.default.NaviModelPassType_NOT_PASS?{extentId:t,model:i}:null}},{key:"_processStartPoint",value:function(a,e){var o=this;this._startNode=this._insertTmpIsolatedNode(this._startZoneId,a);var t=null,r=!0,t=null!=this._startModel&&this._startModel.pass==ee.default.NaviModelPassType_PASS_THROUGH&&0==this._startModel.doors.length?this._seekNearRoads(this._startZoneId,a,e,30,this._startModel):this._seekNearRoads(this._startZoneId,a,e);if(null==this._startModel&&(r=!1),0<t.size()){r=!1,t.each(function(e,t,n){for(n=0;n<t.length;n++)0!=t[n].road.roadEntry&&(r=!0)});var s=0,l=!1,u=[];if(t.each(function(e,t){var n,r=t[0].road,i=o._exploreUprightLikelyJoints(o._startZoneId,a,r,t,o._startModel);0==i.length?s++:Math.abs(i[0].rotateAngle)>O.default.epsilon()?u.push.apply(u,(0,D.default)(i)):(l=!0,n=o._insertTempNodeToRoad(o._startZoneId,i[0].cross,i[0].road),o._joinTwoNodes(o._startZoneId,o._startNode,n))}),l||(0,d.default)(u).call(u,function(e){var t=o._insertTempNodeToRoad(o._startZoneId,e.cross,e.road);o._joinTwoNodes(o._startZoneId,o._startNode,t)}),s==t.size())return F.default.ROUTE_FAILED_NO_DATA_START}if(r&&null!=this._startModel&&0<this._startModel.doors.length){for(var n=null,i=!1,h=0;h<this._startModel.doors.length;h++){n=this._startModel.doors[h];var c=this._startModel.doorEntrys[h];c!=ee.default.NaviEntranceType_EXIT&&c!=ee.default.NaviEntranceType_ACCESS||(this._joinTwoNodes(this._startZoneId,this._startNode,n),i=!0)}if(!i)return F.default.ROUTE_FAILED_NO_DATA_START}}},{key:"_processEndPoint",value:function(a,e){var o=this;this._endNode=this._insertTmpIsolatedNode(this._endZoneId,a);var t=null,r=!0,t=null!=this._endModel&&this._endModel.pass==ee.default.NaviModelPassType_PASS_THROUGH&&0==this._endModel.doors.length?this._seekNearRoads(this._endZoneId,a,e,30,this._endModel):this._seekNearRoads(this._endZoneId,a,e);if(null==this._endModel&&(r=!1),0<t.size()){r=!1,t.each(function(e,t,n){for(n=0;n<t.length;n++)0!=t[n].road.roadEntry&&(r=!0)});var s=0,l=!1,u=[];if(t.each(function(e,t){var n,r=t[0].road,i=o._exploreUprightLikelyJoints(o._endZoneId,a,r,t,o._endModel);0==i.length?s++:Math.abs(i[0].rotateAngle)>O.default.epsilon()?u.push.apply(u,(0,D.default)(i)):(l=!0,n=o._insertTempNodeToRoad(o._endZoneId,i[0].cross,i[0].road),o._joinTwoNodes(o._endZoneId,o._endNode,n))}),l||(0,d.default)(u).call(u,function(e){var t=o._insertTempNodeToRoad(o._endZoneId,e.cross,e.road);o._joinTwoNodes(o._endZoneId,o._endNode,t)}),s==t.size())return F.default.ROUTE_FAILED_NO_DATA_END}if(r&&null!=this._endModel&&0<this._endModel.doors.length){for(var n=null,i=!1,h=0;h<this._endModel.doors.length;h++){n=this._endModel.doors[h];var c=this._endModel.doorEntrys[h];c!=ee.default.NaviEntranceType_ENTRANCE&&c!=ee.default.NaviEntranceType_ACCESS||(this._joinTwoNodes(this._endZoneId,this._endNode,n),i=!0)}if(!i)return F.default.ROUTE_FAILED_NO_DATA_END}}},{key:"_routeCalculate",value:function(){var e=this._isPointInPNTModel(this._startNode.point);e&&(this._switchVariableHinderTo(this._startZoneId,e,ee.default.NaviRoadHinderType_HINDER_GENERAL),this._variableModelPairs.push({zoneId:this._startZoneId,model:e}));var t=this._isPointInPNTModel(this._endNode.point);if(t&&(this._switchVariableHinderTo(this._endZoneId,t,ee.default.NaviRoadHinderType_HINDER_GENERAL),this._variableModelPairs.push({zoneId:this._endZoneId,model:t})),this._resultVector=[],this._startZoneId==this._endZoneId){var n,r=this._zoneIdSimpleDijkstraMap.get(this._startZoneId),i=r.routeCalculate(this._startNode,this._endNode,this._mode);if(i!=F.default.ROUTE_SUCCESS)return i;var a=r.getRouteCalculateResult();this._resultVector=[],(0,C.default)(a).call(a),(n=this._resultVector).push.apply(n,(0,D.default)(a))}else{if(-1!=this._startZoneId&&-1==this._endZoneId){var o,s,l=this._findNearZoneDoor(this._startNode.point,this._startZoneId,ee.default.NaviEntranceType_EXIT),u=this._zoneIdSimpleDijkstraMap.get(this._startZoneId),h=u.routeCalculate(this._startNode,l,this._mode);if(h!=F.default.ROUTE_SUCCESS)return h;var c=u.getRouteCalculateResult(c),d=this._zoneIdSimpleDijkstraMap.get(-1),h=d.routeCalculate(l,this._endNode,this._mode);if(h!=F.default.ROUTE_SUCCESS)return h;var f=d.getRouteCalculateResult();(0,C.default)(c).call(c),(0,C.default)(f).call(f),(o=this._resultVector).push.apply(o,(0,D.default)(c)),(s=this._resultVector).push.apply(s,(0,D.default)(f))}if(-1==this._startZoneId&&-1!=this._endZoneId){var p,m,v=this._findNearZoneDoor(this._endNode.point,this._endZoneId,ee.default.NaviEntranceType_ENTRANCE),g=this._zoneIdSimpleDijkstraMap.get(this._endZoneId),y=g.routeCalculate(v,this._endNode,this._mode);if(y!=F.default.ROUTE_SUCCESS)return y;var _=g.getRouteCalculateResult(),x=this._zoneIdSimpleDijkstraMap.get(-1),y=x.routeCalculate(this._startNode,v,this._mode);if(y!=F.default.ROUTE_SUCCESS)return y;var w=x.getRouteCalculateResult();(0,C.default)(w).call(w),(0,C.default)(_).call(_),(p=this._resultVector).push.apply(p,(0,D.default)(w)),(m=this._resultVector).push.apply(m,(0,D.default)(_))}if(-1!=this._startZoneId&&-1!=this._endZoneId){var b,M,T,S=this._findNearZoneDoor(this._startNode.point,this._startZoneId,ee.default.NaviEntranceType_EXIT),E=this._zoneIdSimpleDijkstraMap.get(this._startZoneId),A=E.routeCalculate(this._startNode,S,this._mode);if(A!=F.default.ROUTE_SUCCESS)return A;var I=E.getRouteCalculateResult(I),L=this._findNearZoneDoor(this._endNode.point,this._endZoneId,ee.default.NaviEntranceType_ENTRANCE),R=this._zoneIdSimpleDijkstraMap.get(this._endZoneId),A=R.routeCalculate(L,this._endNode,this._mode);if(A!=F.default.ROUTE_SUCCESS)return A;var N=R.getRouteCalculateResult(N),k=this._zoneIdSimpleDijkstraMap.get(-1);if(A=k.routeCalculate(S,L,this._mode),A!=F.default.ROUTE_SUCCESS)return A;var P=k.getRouteCalculateResult();(0,C.default)(I).call(I),(0,C.default)(P).call(P),(0,C.default)(N).call(N),(b=this._resultVector).push.apply(b,(0,D.default)(I)),(M=this._resultVector).push.apply(M,(0,D.default)(P)),(T=this._resultVector).push.apply(T,(0,D.default)(N))}}return F.default.ROUTE_SUCCESS}},{key:"_getIndexFormID",value:function(e,t,n){for(var r=0;r<t;r++)if(null!=e[r]&&e[r].Id==n)return r;return-1}},{key:"_calcZoneIdByCoord",value:function(e){for(var t=this._naviGraph.zones,n=0;n<t.length;n++){var r=t[n];if(r.contain(e))return r.Id}return-1}},{key:"_segmentByZones",value:function(){for(var n=this,e=this._naviGraph.zones,t=0;t<e.length;t++){var r=e[t],i=this._sliceGraph(this._naviGraph,r);this._zoneIdGraph.put(r.Id,i)}this._zoneIdGraph.put(-1,this._naviGraph),this._zoneIdGraph.each(function(e,t){t.simplify(),n._zoneIdSimpleDijkstraMap.put(e,new c.default(t))}),this._zoneIdGraph.each(function(e,t){t.consoleNodeInfos(),t.consoleRoadInfos()})}},{key:"_sliceGraph",value:function(e,t){var n;if(e&&t){for(var r,i=0,a=0,o=e.roadVector.length,s=e.nodeVector.length,l=e.roadVector,u=e.nodeVector,h=0,c=new Int8Array(o),d=0;d<o;d++)l[d]&&l[d].roadEntry!=ee.default.NaviRoadEntry_FORBID&&(r=l[d],i=t.contain(r.startPoint),a=t.contain(r.endPoint),0==i&&0==a||(h=!0),1==i&&1==a&&(c[d]=1),1==i&&0==a&&(c[d]=2),0==i&&1==a&&(c[d]=3),0==i&&0==a&&(c[d]=4),2==i&&0==a&&(c[d]=6),2==i&&1==a&&(c[d]=7),0==i&&2==a&&(c[d]=8),1==i&&2==a&&(c[d]=9));if(0==h)return null;for(var f,p,m,v,g,y,_,x,w,b,M,T,S,E,A,I,L,R,N,k,P,C=new Array(s),D=new Array(o),O=0,F=new Int8Array(s),B=c.length,U=0,z=B;U<z;U++)0!=c[U]&&6!=c[U]&&8!=c[U]&&1!=c[U]&&l[U]&&(f=l[U],p=f.roadEntry,m=[f.Id],2==c[U]||9==c[U]?(x=null,x=2==c[U]?t.calcCrossPoint(f.startPoint,f.endPoint):(0,$.default)({},f.endPoint),w=new te.default,w.Id=this._naviGraph.generateNodeId(),w.nodeType=ee.default.NaviNodeType_COMMON,w.liftType=ee.default.NaviLiftType_NULL,w.entranceType=ee.default.NaviEntranceType_ACCESS,w.point=(0,$.default)({},x),b=new ne.default,b.setRoad(f),b.Id=this._naviGraph.generateRoadId(),m.push(b.Id),w.segLinks=m,M=new te.default,M.setNode(w),p==ee.default.NaviRoadEntry_FORWARD?M.entranceType=ee.default.NaviEntranceType_EXIT:p==ee.default.NaviRoadEntry_BACK&&(M.entranceType=ee.default.NaviEntranceType_ENTRANCE),t._linkAccessNodes.push(M),O=this._getIndexFormID(u,s,b.endId),b.endPoint=(0,$.default)({},M.point),b.pointVector[1]=(0,$.default)({},M.point),b.endId=M.Id,b.calcLength(),D[U]=b,C[O]=M,O=this._getIndexFormID(u,s,b.startId),C[O]=u[O],(0,Q.default)(v=C[O].segLinks).call(v,(0,K.default)(g=C[O].segLinks).call(g,f.Id),1,b.Id),T=new te.default,T.setNode(w),f.startId=T.Id,f.startPoint=(0,$.default)({},T.point),f.pointVector[0]=(0,$.default)({},T.point),f.calcLength(),(0,Q.default)(y=u[O].segLinks).call(y,(0,K.default)(_=u[O].segLinks).call(_,f.Id),1),u.push(T),F[O]=2):3!=c[U]&&7!=c[U]||(L=null,L=3==c[U]?t.calcCrossPoint(f.startPoint,f.endPoint):(0,$.default)({},f.startPoint),R=new te.default,R.Id=this._naviGraph.generateNodeId(),R.nodeType=ee.default.NaviNodeType_COMMON,R.liftType=ee.default.NaviLiftType_NULL,R.entranceType=ee.default.NaviEntranceType_ACCESS,R.point=(0,$.default)({},L),N=new ne.default,N.setRoad(f),N.Id=this._naviGraph.generateRoadId(),m.push(N.Id),R.segLinks=m,k=new te.default,k.setNode(R),p==ee.default.NaviRoadEntry_FORWARD?k.entranceType=ee.default.NaviEntranceType_ENTRANCE:p==ee.default.NaviRoadEntry_BACK&&(k.entranceType=ee.default.NaviEntranceType_EXIT),t._linkAccessNodes.push(k),O=this._getIndexFormID(u,s,N.startId),N.startPoint=(0,$.default)({},k.point),N.pointVector[0]=(0,$.default)({},k.point),N.startId=k.Id,N.calcLength(),D[U]=N,C[O]=k,O=this._getIndexFormID(u,s,N.endId),C[O]=u[O],(0,Q.default)(S=C[O].segLinks).call(S,(0,K.default)(E=C[O].segLinks).call(E,f.Id),1,N.Id),P=new te.default,P.setNode(R),f.endId=P.Id,f.endPoint=(0,$.default)({},P.point),f.pointVector[1]=(0,$.default)({},P.point),f.calcLength(),(0,Q.default)(A=u[O].segLinks).call(A,(0,K.default)(I=u[O].segLinks).call(I,f.Id),1),u.push(P),F[O]=2));for(var G,V=0,H=B;V<H;V++)1==c[V]&&(G=l[V],G&&(D[V]=G,O=this._getIndexFormID(u,s,G.startId),2!=F[O]&&(C[O]=u[O],F[O]=1),O=this._getIndexFormID(u,s,G.endId),2!=F[O]&&(C[O]=u[O],F[O]=1),l[V]=null));for(var j=0;j<s;j++)1==F[j]&&(u[j]=null);for(var W=new re.default(C,D,!0,1),Y=[],q=e.obstructModels,X=0;X<q.length;X++){var Z,J=q[X];J&&(Z=this._modelInZone(J,t),Z&&Y.push(J))}return(n=W.obstructModels).push.apply(n,Y),W}}},{key:"_assemblePassNotThroughModels",value:function(){var o=this;this._zoneIdGraph.each(function(e,t){for(var n=t.obstructModels,r=0;r<n.length;r++){var i,a=n[r];ee.default.NaviModelPassType_PASS_NOT_THROUGH==a.pass&&(i=o._zonePNTModelsMap.get(e),i||(i=[],o._zonePNTModelsMap.put(e,i)),i.push(a))}}),this._zonePNTModelsMap.each(function(e,t){for(var n=0;n<t.length;n++)t[n].fid})}},{key:"_assembleNotPassModels",value:function(){var o=this;this._zoneIdGraph.each(function(e,t){for(var n=t.obstructModels,r=0;r<n.length;r++){var i,a=n[r];ee.default.NaviModelPassType_NOT_PASS==a.pass&&(i=o._zoneNPModelsMap.get(e),i||(i=[],o._zoneNPModelsMap.put(e,i)),i.push(a))}}),this._zoneNPModelsMap.each(function(e,t){for(var n=0;n<t.length;n++)t[n].fid})}},{key:"_fitVariableRoadsToModel",value:function(){var l=this;this._zonePNTModelsMap.each(function(e,t){for(var n=l._zoneIdGraph.get(e).roadVector,r=0;r<t.length;r++){for(var i=t[r],a=0;a<n.length;a++){var o,s=n[a].calcMiddlePoint();O.default.pointInPolygon2d(i.points,s,i.pointCount)&&(n[a].length=n[a].length*l._kScaleVariable,o=l._modelIdRoadsMap.get(i.Id),o||(o=[],l._modelIdRoadsMap.put(i.Id,o)),o.push(n[a]))}l._switchVariableHinderTo(e,i,ee.default.NaviRoadHinderType_HINDER_HIGH)}})}},{key:"_adjustNPModelRoads",value:function(){var p=this;this._zoneNPModelsMap.each(function(e,t){for(var n=p._zoneIdGraph.get(e),r=n.roadVector,i=0;i<t.length;i++)for(var a=t[i],o=0;o<r.length;o++){var s=r[o],l=s.roadEntry,u=s.calcMiddlePoint();if(O.default.pointInPolygon2d(a.points,u,a.pointCount-1)){if(s.length=Number.MAX_VALUE,l==ee.default.NaviRoadEntry_BOTH||l==ee.default.NaviRoadEntry_FORWARD){var h=p._zoneIdGraph.get(e).adjList.get(s.startId);if(h)for(var c=0;c<h.length;c++)h[c].nodeId==s.endId&&(h[c].length=s.length)}if(s.roadEntry==ee.default.NaviRoadEntry_BOTH||s.roadEntry==ee.default.NaviRoadEntry_BACK){var d=p._zoneIdGraph.get(e).adjList.get(s.endId);if(d)for(var f=0;f<d.length;f++)d[f].nodeId==s.startId&&(d[f].length=s.length)}}}})}},{key:"_switchVariableHinderTo",value:function(e,t,n){var r=this._modelIdRoadsMap.get(t.Id);if(r){if(ee.default.NaviRoadHinderType_HINDER_HIGH==n)for(var i=0;i<r.length;i++){var a=r[i];if(a.calcLength(),a.length=r.length*this._kScaleVariable,a.roadEntry==ee.default.NaviRoadEntry_BOTH||a.roadEntry==ee.default.NaviRoadEntry_FORWARD){var o=this._zoneIdGraph.get(e).adjList.get(a.startId);if(o)for(var s=0;s<o.length;s++)o[s].nodeId==a.endId&&(o[s].length=a.length)}if(a.roadEntry==ee.default.NaviRoadEntry_BOTH||a.roadEntry==ee.default.NaviRoadEntry_BACK){var l=this._zoneIdGraph.get(e).adjList.get(a.endId);if(l)for(var u=0;u<l.length;u++)l[u].nodeId==a.startId&&(l[u].length=a.length)}}if(ee.default.NaviRoadHinderType_HINDER_GENERAL==n)for(var h=0;h<r.length;h++){var c=r[h];if(c.calcLength(),c.roadEntry==ee.default.NaviRoadEntry_BOTH||c.roadEntry==ee.default.NaviRoadEntry_FORWARD){var d=this._zoneIdGraph.get(e).adjList.get(c.startId);if(d)for(var f=0;f<d.length;f++)d[f].nodeId==c.endId&&(d[f].length=c.length)}if(c.roadEntry==ee.default.NaviRoadEntry_BOTH||c.roadEntry==ee.default.NaviRoadEntry_BACK){var p=this._zoneIdGraph.get(e).adjList.get(c.endId);if(p)for(var m=0;m<p.length;m++)p[m].nodeId==c.startId&&(p[m].length=c.length)}}}}},{key:"_findNearZoneDoor",value:function(e,t,n){var r=this._naviGraph.getZone(t);if(null==r)return null;for(var i=this._zoneIdGraph.get(t).findModel(e,a),a=i.area,o=Number.MAX_VALUE,s=null,l=0;l<r._linkAccessNodes.length;l++){var u=r._linkAccessNodes[l],h=O.default.distanceOfTwoPoints(u.point,e);if((u.entranceType==ee.default.NaviEntranceType_ACCESS||u.entranceType==n)&&h<o){var c=this._findMinAreaNearestObstructModel(t,u.point);if(c!=i){if(c.pass==ee.default.NaviModelPassType_PASS_NOT_THROUGH)continue;o=h,s=u}else o=h,s=u}}return s}},{key:"_findMinAreaNearestObstructModel",value:function(e,t){for(var n=null,r=this._zoneIdGraph.get(e),i=Number.MAX_VALUE,a=Number.MAX_VALUE,o=null,s=r.obstructModels,l=0;l<s.length;l++){var u,h=s[l],c=O.default.pointToPolygon2d(h.points,t,h.points.length-1);c<a&&(a=c,o=h),this._kDoorToler>c&&(u=h.area,u<i&&(i=u,n=h))}return null==n?o:n}},{key:"_modelInZone",value:function(e,t){if(e.bb.isSeparate(t.bb))return!1;var n=e.center;return!!O.default.pointInPolygon2d(t.points,n,t.pointCount)}},{key:"_insertTempNodeToRoad",value:function(e,t,n){var r,i,a=(0,w.default)(r=this._tmpAdjNodeIds).call(r,function(e){return e==n.startId}),o=(0,w.default)(i=this._tmpAdjNodeIds).call(i,function(e){return e==n.endId});null==a&&this._tmpAdjNodeIds.push(n.startId),null==o&&this._tmpAdjNodeIds.push(n.endId);for(var s=this._unattachedTempRoadTrees,l=null,u=0;u<s.length;u++)if(s[u]._wrappedRoad==n){l=s[u];break}if(null==l)l={},l._wrappedRoad=n,s.push(l);else for(;null!=l._fromChild;)var h=l._fromChild._wrappedRoad,l=O.default.pointIsInRect1(t,h.startPoint,h.endPoint)?l._fromChild:l._toChild;n=l._wrappedRoad;var c=new te.default;c.Id=this._newTmpId(),c.point=t;var d=new ne.default;d.Id=this._newTmpId(),d.startId=n.startId,d.startPoint=n.startPoint,d.endId=c.Id,d.endPoint=c.point,d.pointVector=[n.startPoint,c.point],d.roadRank=n.roadRank;var f=new ne.default;f.Id=this._newTmpId(),f.startId=c.Id,f.startPoint=c.point,f.endId=n.endId,f.endPoint=n.endPoint,f.pointVector=[c.point,n.endPoint],f.roadRank=n.roadRank,this._unattachedTempRoads.push(d),this._unattachedTempRoads.push(f);var p={};p._wrappedRoad=d;var m={};m._wrappedRoad=f,l._fromChild=p,l._toChild=m,c.tempType=1,d.tempType=1,f.tempType=1,d.calcLength(),f.calcLength(),d.roadEntry=n.roadEntry,f.roadEntry=n.roadEntry;var v=this._zoneIdGraph.get(e);v.nodeVector.push(c),v.roadVector.push(d),v.roadVector.push(f);var g,y,_,x=this._zoneIdSimpleDijkstraMap.get(e)._naviGraph;return x._nodeMap.put(c.Id,v.nodeVector.length-1),n.roadEntry==ee.default.NaviRoadEntry_BOTH&&(g=[],g.push({nodeId:n.startId,length:d.length}),g.push({nodeId:n.endId,length:f.length}),x.adjList.put(c.Id,g),g=x.adjList.get(n.startId),g||(g=[],x.adjList.put(n.startId,g)),g.push({nodeId:c.Id,length:d.length}),g=x.adjList.get(n.endId),g||(g=[],x.adjList.put(n.endId,g)),g.push({nodeId:c.Id,length:f.length})),n.roadEntry==ee.default.NaviRoadEntry_FORWARD&&(y=[],y.push({nodeId:n.endId,length:f.length}),x.adjList.put(c.Id,y),y=x.adjList.get(n.startId),y||(y=[],x.adjList.put(n.startId,y)),y.push({nodeId:c.Id,length:d.length})),n.roadEntry==ee.default.NaviRoadEntry_BACK&&(_=[],_.push({nodeId:n.startId,length:d.length}),x.adjList.put(c.Id,_),_=x.adjList.get(n.endId),_||(_=[],x.adjList.put(n.endId,_)),_.push({nodeId:c.Id,length:f.length})),c}},{key:"_insertItemToVector",value:function(e,t){for(var n=t.length-1;0<=n;n--)if(t[n].Id&&0<t[n].Id)return(0,Q.default)(t).call(t,n+1,0,e),n+1;return-1}},{key:"_insertNodeToRoad",value:function(e,t,n,r){if(r)return this._insertTempNodeToRoad(e,t,n);var i=this._zoneIdGraph.get(e),a=new te.default;a.Id=i.generateNodeId(),a.point=t;var o=new ne.default;o.Id=i.generateRoadId(),o.startId=n.startId,o.startPoint=n.startPoint,o.endId=a.Id,o.endPoint=a.point,o.pointVector=[n.startPoint,a.point];var s=new ne.default;s.Id=i.generateRoadId(),s.startId=a.Id,s.startPoint=a.point,s.endId=n.endId,s.endPoint=n.endPoint,s.pointVector=[a.point,n.endPoint];var l=[];l.push(o.Id),l.push(s.Id),a.segLinks=l,o.calcLength(),s.calcLength(),o.roadEntry=n.roadEntry,s.roadEntry=n.roadEntry;var u,h,c,d=i.nodeVector,f=i.roadVector,p=this._insertItemToVector(a,d);return this._insertItemToVector(o,f),this._insertItemToVector(s,f),i._nodeMap.put(a.Id,p),n.roadEntry==ee.default.NaviRoadEntry_BOTH&&(u=[],u.push({nodeId:n.startId,length:o.length}),u.push({nodeId:n.endId,length:s.length}),i.adjList.put(a.Id,u),u=i.adjList.get(n.startId),u||(u=[],i.adjList.put(n.startId,u)),u.push({nodeId:a.Id,length:o.length}),u=i.adjList.get(n.endId),u||(u=[],i.adjList.put(n.endId,u)),u.push({nodeId:a.Id,length:s.length})),n.roadEntry==ee.default.NaviRoadEntry_FORWARD&&(h=[],h.push({nodeId:n.endId,length:s.length}),i.adjList.put(a.Id,h),h=i.adjList.get(n.startId),h||(h=[],i.adjList.put(n.startId,h)),h.push({nodeId:a.Id,length:o.length})),n.roadEntry==ee.default.NaviRoadEntry_BACK&&(c=[],c.push({nodeId:n.startId,length:o.length}),i.adjList.put(a.Id,c),c=i.adjList.get(n.endId),c||(c=[],i.adjList.put(n.endId,c)),c.push({nodeId:a.Id,length:s.length})),a}},{key:"_clearTmpPoint",value:function(e){if(null!=e){for(var t=this._zoneIdGraph.get(e),n=t.nodeVector.length-1;0<=n;n--){var r,i=t.nodeVector[n];if(null==i||0<=i.Id)break;(0,Q.default)(r=t.nodeVector).call(r,n,1)}for(var a=t.roadVector.length-1;0<=a;a--){var o,s=t.roadVector[a];if(null==s||0<=s.Id)break;(0,Q.default)(o=t.roadVector).call(o,a,1)}}}},{key:"_deleteTmpConnectionEntirely",value:function(e,t){var n=e.get(t);if(n)for(var r=0;r<n.length;r++)n[r].nodeId<0&&((0,Q.default)(n).call(n,r,1),r--)}},{key:"_removeConnection",value:function(e,t){for(var n=e.get(t),r=0;r<n.length;r++)this._deleteTmpConnectionEntirely(e,n[r].nodeId);e.remove(t)}},{key:"_calcAdherenceAtOneAngle",value:function(e,t,n,r,i,a){i.toDistance=Number.MAX_VALUE,i.stickToRoad=!1,i.rotateAngle=0;for(var o=Number.MAX_VALUE,s={},l=this._zoneIdGraph.get(e),u=0;u<l.roadVector.length;u++){var h,c,d=l.roadVector[u];null!=d&&d.roadEntry!=ee.default.NaviRoadEntry_FORBID&&(h=O.default.quickRayIntersect(t,n,d.startPoint,d.endPoint,s),h&&(c=O.default.distanceOfTwoPoints(t,s),(c<o||Math.abs(c-o)<.1&&d.Id<0)&&(o=c,i.cross=(0,$.default)({},s),i.distance=o,i.road=d,i.stickToRoad=!0)))}l=this._zoneIdGraph.get(-1);for(var f={},p=0;p<l.obstructModels.length;p++){var m=l.obstructModels[p];if(null!=m&&m!=a&&ee.default.NaviModelPassType_DECORATE!=m.pass&&(null==a||!O.default.pointInPolygon2d(m.points,a.center,m.points.length-1)))for(var v=m.points.length,g=0;g<v-1;g++){var y=O.default.quickRayIntersect(t,n,m.points[g],m.points[g+1],f);if(y){var _=O.default.distanceOfTwoPoints(t,f);if(_<o)return o=_,i.model=m,i.distance=Number.MAX_VALUE,i.stickToRoad=!1,i.obstructType=ee.default.NaviObstructType_MODEL,!1}}}for(var x={},w=l.obstructExtents,b=0;b<w.length;b++){for(var M=w[b],T=w[b].holes,S=0;S<T.length;S++)for(var E=T[S],A=0;A<E.length-1;A++){var I=O.default.quickRayIntersect(t,n,E[A],E[A+1],x);if(I){var L=O.default.distanceOfTwoPoints(t,x);if(L<o)return o=L,i.model=M,i.distance=Number.MAX_VALUE,i.stickToRoad=!1,i.obstructType=ee.default.NaviObstructType_EXTENT,!1}}for(var R=w[b].points,N=0;N<R.length-1;N++){var k=O.default.quickRayIntersect(t,n,R[N],R[N+1],x);if(k){var P=O.default.distanceOfTwoPoints(t,x);if(P<o)return o=P,i.model=M,i.distance=Number.MAX_VALUE,i.stickToRoad=!1,i.obstructType=ee.default.NaviObstructType_EXTENT,!1}}}return i.toDistance=O.default.distanceOfTwoPoints(i.cross,r),!0}},{key:"_adherenceCompare",value:function(e,t){return e.toDistance-t.toDistance}},{key:"_adherenceAngleCompare",value:function(e,t){return t.rotateAngle-e.rotateAngle}},{key:"_clearTempElements",value:function(e){var t=this._zoneIdGraph.get(e);if(t){for(var n=t.nodeVector,r=n.length-1;0<=r;r--){var i=n[r];if(null==i||0<=i.Id)break;(0,Q.default)(n).call(n,r,1)}for(var a=t.roadVector,o=a.length-1;0<=o;o--){var s=a[o];if(null==s||0<=s.Id)break;(0,Q.default)(a).call(a,o,1)}}}},{key:"_clearTempAdjList",value:function(){var s=this;this._zoneIdSimpleDijkstraMap.each(function(e,t){for(var n=[],r=t._naviGraph.adjList,i=0;i<(0,l.default)(r).length;i++)(0,l.default)(r)[i]<0&&n.push((0,l.default)(r)[i]);for(var a=0;a<n.length;a++)s._removeConnection(t._naviGraph.adjList,n[a]);for(var o=0;o<s._tmpAdjNodeIds.length;o++)s._deleteTmpConnectionEntirely(r,s._tmpAdjNodeIds[o])})}},{key:"_exploreUprightLikelyJoints",value:function(e,t,n,r,i){for(var a=[],o=0;o<r.length;o++)if(r[o].distance<O.default.epsilon())return a.push(r[o]),a;var s={x:0,y:0},l=O.default.calcFootOfUpright(t,n.startPoint,n.endPoint,s),u={};if(l&&this._isTwoPointsConnectedDirectly(t,s,u,i)){var h={};return h.cross=s,h.stickToRoad=!0,h.road=n,h.rotateAngle=0,h.dist=O.default.distanceOfTwoPoints(t,s),a.push(h),a}for(var c={x:s.x-t.x,y:s.y-t.y},d=0;d<r.length;d++){var f=r[d],p={x:f.cross.x-t.x,y:f.cross.y-t.y},m=O.default.calcRotateAngle(p,c),m=270<m?m-360:m;f.rotateAngle=m}(0,_.default)(r).call(r,this._adherenceAngleCompare);var v=null,g=null;if(r[r.length-1].rotateAngle<0)return v=r[r.length-1],a.push(v),a;for(var y=0;y<r.length;y++)if(0<r[y].rotateAngle)return v=r[y],0==y?a.push(v):(g=r[y-1],O.default.distanceOfTwoPoints(v.cross,n.startPoint)>O.default.distanceOfTwoPoints(g.cross,n.startPoint)?(a.push(g),a.push(v)):(a.push(v),a.push(g))),a;return a}},{key:"_calcAllAdherance",value:function(e,t,n,r,i,a){for(var o=i||30,s=0;s<360;s+=o){var l=new u.default;this._calcAdherenceAtOneAngle(e,t,s,n,l,a),1==l.stickToRoad&&r.push(l)}(0,_.default)(r).call(r,this._adherenceCompare)}},{key:"_seekNearRoads",value:function(e,t,n,r,i){var a=new h.default,o=[];for(this._calcAllAdherance(e,t,n,o,r,i);0!=o.length;){var s=o[0],l=a.get(s.road.Id);l?l.push(s):(l=[],l.push(s),a.put(s.road.Id,l)),(0,Q.default)(o).call(o,0,1)}return a}},{key:"_insertTmpIsolatedNode",value:function(e,t){var n=new te.default;n.Id=this._newTmpId(),n.point=(0,$.default)({},t);var r=this._zoneIdGraph.get(e);r.nodeVector.push(n);var i=this._zoneIdSimpleDijkstraMap.get(e);return i._naviGraph._nodeMap.put(n.Id,r.nodeVector.length-1),n}},{key:"_insertIsolatedNode",value:function(e,t,n){if(n)return this._insertTmpIsolatedNode(e,t);var r=new te.default;r.Id=this._naviGraph.generateNodeId(),r.point=(0,$.default)({},t);var i=this.zoneIdGraph.get(e),a=i.nodeVector,o=this._insertItemToVector(r,a);return i._nodeMap.put(r.Id,o),r}},{key:"_isTwoPointsConnectedDirectly",value:function(e,t,n,r){for(var i=this._zoneIdGraph.get(-1),a=null,o=0;o<i.obstructModels.length;o++)if(a=i.obstructModels[o],null!=a&&a!=r&&ee.default.NaviModelPassType_DECORATE!=a.pass)for(var s=a.points,l=0;l<s.length-1;l++)if(O.default.calcCrossPoint(e,t,s[l],s[l+1],n)){var u=O.default.distanceOfTwoPoints(e,n),h=O.default.distanceOfTwoPoints(t,n);if(!(u<=O.default.epsilon()||h<=O.default.epsilon()))return!1}for(var c=i.obstructExtents,d=0;d<c.length;d++){for(var f=c[d],p=f.holes,m=0;m<p.length;m++)for(var v=p[m],g=0;g<v.length-1;g++)if(O.default.calcCrossPoint(e,t,v[g],v[g+1],n))return!1;for(var y=f.points,_=0;_<y.length-1;_++)if(O.default.calcCrossPoint(e,t,y[_],y[_+1],n))return!1}return!0}},{key:"_joinTwoNodes",value:function(e,t,n,r,i,a){for(var o=0;o<this._attachedTempRoads.length;o++){var s=this._attachedTempRoads[o],l={};if(1==O.default.calcCrossPoint(s.startPoint,s.endPoint,t.point,n.point,l)&&O.default.distanceOfTwoPoints(t.point,l)>O.default.epsilon())return null}void 0===r&&(r=ee.default.NaviRoadEntry_BOTH),void 0===i&&(i=!0),void 0===a&&(a=!0);var u=new ne.default;u.startId=t.Id,u.startPoint=t.point,u.endId=n.Id,u.endPoint=n.point,u.pointVector=[t.point,n.point],u.roadRank=1,this._tmpAdjNodeIds.push(t.Id),this._tmpAdjNodeIds.push(n.Id),u.Id=i?this._newTmpId():this._naviGraph.generateRoadId(),u.roadEntry=r,u.calcLength(),a&&this._attachedTempRoads.push(u);var h=this._zoneIdGraph.get(e);h.roadVector.push(u);var c,d,f,p,m,v=this._zoneIdSimpleDijkstraMap.get(e);return ee.default.NaviRoadEntry_BOTH==r&&(c={nodeId:n.Id,length:u.length},d=v._naviGraph.adjList.get(t.Id),d?d.push(c):(d=[],d.push(c),v._naviGraph.adjList.put(t.Id,d)),c={nodeId:t.Id,length:u.length},d=v._naviGraph.adjList.get(n.Id),d?d.push(c):(d=[],d.push(c),v._naviGraph.adjList.put(n.Id,d))),ee.default.NaviRoadEntry_FORWARD==r&&(f={nodeId:n.Id,length:u.length},m=v._naviGraph.adjList.get(t.Id),m?m.push(f):(m=[],m.push(f),v._naviGraph.adjList(t.Id,m))),ee.default.NaviRoadEntry_BACK==r&&(p={nodeId:t.Id,length:u.length},m=v._naviGraph.adjList.get(n.Id),m?m.push(p):(m=[],m.push(p),v._naviGraph.adjList.put(n.Id,m))),u}},{key:"_isPointInPNTModel",value:function(e){var t=this._calcZoneIdByCoord(e),n=this._zonePNTModelsMap.get(t);if(n)for(var r=0;r<n.length;r++){var i=n[r];if(O.default.pointInPolygon2d(i.points,e,i.points.length))return i}return null}},{key:"_newTmpId",value:function(){return this._tmpId--}},{key:"assignedPts",set:function(e){this._assignedPts=e},get:function(){return this._assignedPts}}]),t}(),p=f;t.default=p},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=function(){function e(){(0,a.default)(this,e)}return(0,o.default)(e,null,[{key:"printRoads",value:function(){}}]),e}(),l=s;t.default=l},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),u=r(n(597)),s=function(){function e(){(0,a.default)(this,e),this._dijkCollection=[]}return(0,o.default)(e,[{key:"loadGraphs",value:function(e){var s=0,l=this;e.each(function(e,t){for(var n=t.obstructExtents,r=0;r<n.length;r++){var i=n[r].Id,a=t.getGraphByEid(i),o=new u.default(s++,a);o.gid=e,l._dijkCollection.push(o)}})}},{key:"each",value:function(e){for(var t=0;t<this._dijkCollection.length;t++)e(this._dijkCollection[t])}},{key:"len",value:function(){return this._dijkCollection.length}},{key:"get",value:function(e){return this._dijkCollection[e]}},{key:"getDijkByPoint",value:function(e,t){var n,r=this._dijkCollection;for(n in r){var i=r[n];if(e==i.gid&&i.containsPt(t))return i}return null}},{key:"getDijkById",value:function(e){var t,n=this._dijkCollection;for(t in n){var r=n[t];if(r.Id==e)return r}return null}}]),e}(),l=s;t.default=l},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(60)),w=r(n(116)),K=r(n(15)),C=r(n(54)),Q=r(n(12)),v=r(n(36)),D=r(n(33)),$=r(n(9)),_=r(n(32)),a=r(n(2)),o=r(n(3)),O=r(n(28)),ee=r(n(56)),s=r(n(68)),u=r(n(264)),te=r(n(79)),ne=r(n(161)),h=r(n(97)),c=r(n(163)),re=r(n(162)),F=r(n(69)),d=r(n(265)),f=r(n(599)),p=n(266),m=function(){function n(e,t){(0,a.default)(this,n),this.Id=e,this._startModel=null,this._endModel=null,this._naviGraph=t,this._zoneMap=new h.default,this._zoneIdGraph=new h.default,this._originDijkstra=null,this._zoneIdDijkstras=new h.default,this._resultVector=[],this._startZoneId=Number.INT_MIN,this._endZoneId=Number.INT_MIN,this._tmpId=-1,this._startNode=null,this._endNode=null,this._mode=s.default.MODULE_SHORTEST,this._zonePNTModelsMap=new h.default,this._zoneNPModelsMap=new h.default,this._modelIdRoadsMap=new h.default,this._variableModelPairs=[],this._unattachedTempRoads=[],this._attachedTempRoads=[],this._unattachedTempRoadTrees=[],this._kScaleVariable=100,this._kRemainedZoneId=-1,this._kMinModelAngle=15,this._kDoorToler=.1,this._tmp_adj_node_ids=[],this._failedInsertPts=[],this._transitNodes=[],this._segmentByZones(),this._assemblePassNotThroughModels(),this._assembleNotPassModels(),this._fitVariableRoadsToModel(),this._adjustNPModelRoads(),this._KeyNodes=new f.default(["num","id","idx","node"]),this._NtoNRoutesGraph=new h.default,this._next=new p.SmallQueue,this._visited=!1,this._lifts=[]}return(0,o.default)(n,[{key:"setWayPoints",value:function(e){this._wayPts=null==e?[]:e,this._insertWayPoints()}},{key:"setStart",value:function(e){var t;e instanceof te.default?(this._startNode=e,this._KeyNodes.append({num:this._KeyNodes.size(),id:e.Id,idx:this._naviGraph.getIdxByNodeId(e.Id),node:e})):(t=new te.default,this._insertPoint(e,t)||this._failedInsertPts.push(e),this._startNode=t,this._KeyNodes.append({num:this._KeyNodes.size(),id:t.Id,idx:this._naviGraph.getIdxByNodeId(t.Id),node:t}))}},{key:"setEnd",value:function(e){var t;e instanceof te.default?(this._endNode=e,this._KeyNodes.append({num:this._KeyNodes.size(),id:e.Id,idx:this._naviGraph.getIdxByNodeId(e.Id),node:e})):(t=new te.default,this._insertPoint(e,t)||this._failedInsertPts.push(e),this._endNode=t,this._KeyNodes.append({num:this._KeyNodes.size(),id:t.Id,idx:this._naviGraph.getIdxByNodeId(t.Id),node:t}))}},{key:"predictLift",value:function(){function e(e,t){for(var n=0,r=0;r<t.length;r++){var i=(e.x-t[r][0])*(e.x-t[r][0])+(e.y-t[r][1])*(e.y-t[r][1]);n+=Math.sqrt(i)}return n}for(var t=this._naviGraph.getAllLifts(),n=0;n<t.length;n++)t[n].dist=e(t[n].point,this.getNext()._wayPts),t[n].dist+=e(t[n].point,this._wayPts),t[n].dist=t[n].dist/(0==this.getNext()._wayPts.length?1:this.getNext()._wayPts.length),t[n].liftType==ee.default.NaviLiftType_Escalator&&(t[n].dist-=25),t[n].liftType==ee.default.NaviLiftType_Lift&&(t[n].dist-=25);for((0,_.default)(t).call(t,function(e,t){return e.dist-t.dist}),n=0;n<t.length;n++){var r,i=t[n];if(-1!=(0,$.default)(r=i.liftFloors).call(r,this.getNext().gid)&&this.getNext().getLiftByFlag(i.liftFlag))return i}return null}},{key:"hasRelationTo",value:function(e){for(var t=this._naviGraph.getAllLifts(),n=e.gid,r=this.gid,i=0;i<t.length;i++){var a,o=t[i];if((ee.default.NaviLiftType_Stair==o.liftType||-1!=(0,$.default)(a=o.liftFloors).call(a,n))&&null!=e.getLiftByFlag(o.liftFlag))if(o.liftEntry!=ee.default.NaviLiftEntry_UP){if(o.liftEntry!=ee.default.NaviLiftEntry_DOWN){if(o.liftEntry==ee.default.NaviLiftEntry_BOTH)return{related:!0,dist:Math.abs(r-n)}}else if(n<r)return{related:!0,dist:Math.abs(r-n)}}else if(r<n)return{related:!0,dist:Math.abs(r-n)}}return{related:!1,dist:Infinity}}},{key:"getLiftByFlag",value:function(e){0==this._lifts.length&&(this._lifts=this._naviGraph.getAllLifts());for(var t=0;t<this._lifts.length;t++)if(this._lifts[t].liftFlag==e)return this._lifts[t];return null}},{key:"containsPt",value:function(e){var t=this._naviGraph.obstructExtents[0].points;return!!O.default.pointInPolygon2d(t,e,t.length)}},{key:"getRouteCalculateResult",value:function(){return this._resultVector}},{key:"dispose",value:function(){this._startModel=null,this._endModel=null,this._naviGraph.dispose(),this._naviGraph=null,this._zoneMap.clear(),this._zoneMap=null,this._zoneIdGraph.each(function(e,t){t.dispose()}),this._zoneIdGraph.clear(),this._zoneIdGraph=null,null!=this._originDijkstra&&(this._originDijkstra.dispose(),this._originDijkstra=null),this._zoneIdDijkstras.each(function(e,t){t.dispose()}),this._zoneIdDijkstras.clear(),this._zoneIdDijkstras=null,this._resultVector=[],this._startNode=null,this._endNode=null,this._zonePNTModelsMap.clear(),this._zonePNTModelsMap=null,this._zoneNPModelsMap.clear(),this._zoneNPModelsMap=null,this._modelIdRoadsMap.clear(),this._zoneNPModelsMap=null,this._variableModelPairs=[],this._unattachedTempRoads=[],this._attachedTempRoads=[],this._unattachedTempRoadTrees=[]}},{key:"reset",value:function(){this._resultVector=[],this._clearTempPoint(this._startZoneId),this._startZoneId=Number.INT_MIN,this._clearTempPoint(this._endZoneId),this._endZoneId=Number.INT_MIN,this._clearTempAdjList(),this._tmp_adj_node_ids=[],this._tmpId=-1;for(var e=0;e<this._variableModelPairs.length;e++){var t=this._variableModelPairs[e];this._switchVariableHinderTo(t.zoneId,t.model,ee.default.NaviRoadHinderType_HINDER_HIGH)}this._variableModelPairs=[],this._unattachedTempRoads=[],this._attachedTempRoads=[],this._unattachedTempRoadTrees=[]}},{key:"pushNext",value:function(e){this._next.enqueue(e)}},{key:"getNext",value:function(){return this._next.peek()}},{key:"popNext",value:function(){return this._next.dequeue()}},{key:"_createGraph",value:function(){function s(e){for(var t=0,n=0;n<e.length-1;n++){var r=e[n].point.x-e[n+1].point.x,i=e[n].point.y-e[n+1].point.y;t+=Math.sqrt(r*r+i*i)}return t}this.keyGraph=[];var l=this;this._KeyNodes.foreach(function(e){var t=e.get("node"),n=l._KeyNodes.clone();n.dropLines({node:t});var r=[];n.foreach(function(e){r.push(e.get("id"))}),l._zoneIdDijkstras.get(-1).routeMultiDestinations(t.Id,r,l._mode);var i=[];l._zoneIdDijkstras.get(-1).getMultiRoute(i);for(var a=0;a<i.length;a++){var o=i[a];l.keyGraph.push([t.Id,o[o.length-1].Id,s(o),o])}})}},{key:"computeKeyRoutes",value:function(){if(this.getNext()){var e=this.predictLift();if(!e)return!1;this.setEnd(e)}var t=[];if(this._visited){var n=this._KeyNodes.query("node",this._endNode),r=this._KeyNodes.query("node",this._startNode);this._KeyNodes.clear(),this._KeyNodes.append(n),this._KeyNodes.append(r)}else for(var i=0;i<this._transitNodes.length;i++)t.push(this._transitNodes[i].Id);this._createGraph();var a=new d.default(this.keyGraph);return a.setSId(this._startNode.Id).setEId(this._endNode.Id).setWayNodes(t),a.route(),this._route=a.getResult(),this.convertRoute(),this.getNext()&&this.getNext().setStart(this.getNext()._naviGraph.getNodeByFlag(e.liftFlag)),this._KeyNodes=new f.default(["num","id","idx","node"]),this._visited=!0,!0}},{key:"convertRoute",value:function(){this._result=[];for(var e=function(e,t){for(var n=0;n<this.length;n++)if(this[n][0]==e&&this[n][1]==t)return this[n]},t=0;t<this._route.route.length-1;t++)for(var n=this._route.route[t],r=this._route.route[t+1],i=e.apply(this.keyGraph,[n,r]),a=0;a<i[3].length;a++)this._result.push(i[3][a])}},{key:"getResult",value:function(){return this._result}},{key:"_calcPointReachable",value:function(e){var t=this._naviGraph.queryContainExtentId(e);if(-1==t)return null;var n=this._calcZoneIdByCoord(e),r=-0,i=this._zoneIdGraph.get(n).findModel(e,r);if(null==i)return{extentId:t,model:null};if(i.pass==ee.default.NaviModelPassType_PASS_THROUGH||i.pass==ee.default.NaviModelPassType_PASS_NOT_THROUGH){if(0<i.doors.length)return{extentId:t,model:i};for(var a={},o=[],s=[],l=this._zoneIdGraph.get(n),u=l.roadVector,h=!0,c=i.points.length,d=0;d<c-1;d++)for(var f=i.points[d],p=i.points[d+1],m=0;m<u.length;m++){var v=u[m];if(1==O.default.calcCrossPoint(f,p,v.startPoint,v.endPoint,a)){if(h=!1,ee.default.NaviRoadEntry_FORBID==v.roadEntry)continue;var g=new Object;g.x=a.x,g.y=a.y,o.push(g),s.push(u[m])}}if(h)return{extentId:t,model:i};if(0==o.length)return null;i.doors=[],i.doorEntrys=[],i.doorTypes=[];for(var y=0;y<o.length;y++){var _=o[y],x=s[y],w=this._insertNodeToRoad(n,_,x);w.nodeType=ee.default.NaviNodeType_COMMON,x.roadEntry==ee.default.NaviRoadEntry_BOTH?w.entranceType=ee.default.NaviEntranceType_ACCESS:O.default.pointInPolygon2d(i.points,x.startPoint,i.points.length-1)?(x.roadEntry==ee.default.NaviRoadEntry_FORWARD&&(w.entranceType=ee.default.NaviEntranceType_EXIT),x.roadEntry==ee.default.NaviRoadEntry_BACK&&(w.entranceType=ee.default.NaviEntranceType_ENTRANCE)):(x.roadEntry==ee.default.NaviRoadEntry_FORWARD&&(w.entranceType=ee.default.NaviEntranceType_ENTRANCE),x.roadEntry==ee.default.NaviRoadEntry_BACK&&(w.entranceType=ee.default.NaviEntranceType_EXIT)),i.doors.push(w),i.doorEntrys.push(w.entranceType),i.doorTypes.push(w.nodeType)}}return i.pass!=ee.default.NaviModelPassType_NOT_PASS?{extentId:t,model:i}:null}},{key:"_processStartPoint",value:function(a,e){var o=this;this._startNode=this._insertTmpIsolatedNode(this._startZoneId,a);var t=null,r=!0,t=null!=this._startModel&&this._startModel.pass==ee.default.NaviModelPassType_PASS_THROUGH&&0==this._startModel.doors.length?this._seekNearRoads(this._startZoneId,a,e,30,this._startModel):this._seekNearRoads(this._startZoneId,a,e);if(null==this._startModel&&(r=!1),0<t.size()){r=!1,t.each(function(e,t,n){for(n=0;n<t.length;n++)0!=t[n].road.roadEntry&&(r=!0)});var s=0,l=!1,u=[];if(t.each(function(e,t){var n,r=t[0].road,i=o._exploreUprightLikelyJoints(o._startZoneId,a,r,t,o._startModel);0==i.length?s++:Math.abs(i[0].rotateAngle)>O.default.epsilon()?u.push.apply(u,(0,D.default)(i)):(l=!0,n=o._insertTempNodeToRoad(o._startZoneId,i[0].cross,i[0].road),o._joinTwoNodes(o._startZoneId,o._startNode,n))}),l||(0,v.default)(u).call(u,function(e){var t=o._insertTempNodeToRoad(o._startZoneId,e.cross,e.road);o._joinTwoNodes(o._startZoneId,o._startNode,t)}),s==t.size())return F.default.ROUTE_FAILED_NO_DATA_START}if(r){for(var n=null,i=!1,h=0;h<this._startModel.doors.length;h++){n=this._startModel.doors[h];var c=this._startModel.doorEntrys[h];c!=ee.default.NaviEntranceType_EXIT&&c!=ee.default.NaviEntranceType_ACCESS||(this._joinTwoNodes(this._startZoneId,this._startNode,n),i=!0)}if(!i)return F.default.ROUTE_FAILED_NO_DATA_START}}},{key:"_processEndPoint",value:function(a,e){var o=this;this._endNode=this._insertTmpIsolatedNode(this._endZoneId,a);var t=null,r=!0,t=null!=this._endModel&&this._endModel.pass==ee.default.NaviModelPassType_PASS_THROUGH&&0==this._endModel.doors.length?this._seekNearRoads(this._endZoneId,a,e,30,this._endModel):this._seekNearRoads(this._endZoneId,a,e);if(null==this._endModel&&(r=!1),0<t.size()){r=!1,t.each(function(e,t,n){for(n=0;n<t.length;n++)0!=t[n].road.roadEntry&&(r=!0)});var s=0,l=!1,u=[];if(t.each(function(e,t){var n,r=t[0].road,i=o._exploreUprightLikelyJoints(o._endZoneId,a,r,t,o._endModel);0==i.length?s++:Math.abs(i[0].rotateAngle)>O.default.epsilon()?u.push.apply(u,(0,D.default)(i)):(l=!0,n=o._insertTempNodeToRoad(o._endZoneId,i[0].cross,i[0].road),o._joinTwoNodes(o._endZoneId,o._endNode,n))}),l||(0,v.default)(u).call(u,function(e){var t=o._insertTempNodeToRoad(o._endZoneId,e.cross,e.road);o._joinTwoNodes(o._endZoneId,o._endNode,t)}),s==t.size())return F.default.ROUTE_FAILED_NO_DATA_END}if(r){for(var n=null,i=!1,h=0;h<this._endModel.doors.length;h++){n=this._endModel.doors[h];var c=this._endModel.doorEntrys[h];c!=ee.default.NaviEntranceType_EXIT&&c!=ee.default.NaviEntranceType_ACCESS||(this._joinTwoNodes(this._endZoneId,this._endNode,n),i=!0)}if(!i)return F.default.ROUTE_FAILED_NO_DATA_END}}},{key:"_insertPoint",value:function(a,o){var s=this;a instanceof Array&&2==a.length&&(a={x:a[0],y:a[1]});var e=null,r=!0,t={x:0,y:0},l=this._naviGraph.getModelByPoint(a),u=this._naviGraph.getZoneIdByPoint(a),n=this._insertTmpIsolatedNode(u,a);if((0,Q.default)(o,n),e=null!=l&&l.pass==ee.default.NaviModelPassType_PASS_THROUGH&&0==l.doors.length?this._seekNearRoads(u,a,t,30,l):this._seekNearRoads(u,a,t),null==l&&(r=!1),0<e.size()){r=!1,e.each(function(e,t,n){for(n=0;n<t.length;n++)0!=t[n].road.roadEntry&&(r=!0)});var h=0,c=!1,d=[];if(e.each(function(e,t){var n,r=t[0].road,i=s._exploreUprightLikelyJoints(u,a,r,t,l);0==i.length?h++:Math.abs(i[0].rotateAngle)>O.default.epsilon()?d.push.apply(d,(0,D.default)(i)):(c=!0,n=s._insertTempNodeToRoad(u,i[0].cross,i[0].road),s._joinTwoNodes(u,o,n))}),c||(0,v.default)(d).call(d,function(e){var t=s._insertTempNodeToRoad(u,e.cross,e.road);s._joinTwoNodes(u,o,t)}),h==e.size())return!1}if(r){for(var i=null,f=!1,p=0;p<l.doors.length;p++){i=l.doors[p];var m=l.doorEntrys[p];m!=ee.default.NaviEntranceType_EXIT&&m!=ee.default.NaviEntranceType_ACCESS||(this._joinTwoNodes(u,o,i),f=!0)}if(!f)return!1}return!0}},{key:"_routeCalculate",value:function(){var e=this._isPointInPNTModel(this._startNode.point);e&&(this._switchVariableHinderTo(this._startZoneId,e,ee.default.NaviRoadHinderType_HINDER_GENERAL),this._variableModelPairs.push({zoneId:this._startZoneId,model:e}));var t=this._isPointInPNTModel(this._endNode.point);if(t&&(this._switchVariableHinderTo(this._endZoneId,t,ee.default.NaviRoadHinderType_HINDER_GENERAL),this._variableModelPairs.push({zoneId:this._endZoneId,model:t})),this._resultVector=[],this._startZoneId==this._endZoneId){var n,r=this._zoneIdDijkstras.get(this._startZoneId),i=r.routeCalculate(this._startNode,this._endNode,this._mode);if(i!=F.default.ROUTE_SUCCESS)return i;var a=r.getRouteCalculateResult();this._resultVector=[],(0,C.default)(a).call(a),(n=this._resultVector).push.apply(n,(0,D.default)(a))}else{if(-1!=this._startZoneId&&-1==this._endZoneId){var o,s,l=this._findNearZoneDoor(this._startNode.point,this._startZoneId,ee.default.NaviEntranceType_EXIT),u=this._zoneIdDijkstras.get(this._startZoneId),h=u.routeCalculate(this._startNode,l,this._mode);if(h!=F.default.ROUTE_SUCCESS)return h;var c=u.getRouteCalculateResult(c),d=this._zoneIdDijkstras.get(-1),h=d.routeCalculate(l,this._endNode,this._mode);if(h!=F.default.ROUTE_SUCCESS)return h;var f=d.getRouteCalculateResult();(0,C.default)(c).call(c),(0,C.default)(f).call(f),(o=this._resultVector).push.apply(o,(0,D.default)(c)),(s=this._resultVector).push.apply(s,(0,D.default)(f))}if(-1==this._startZoneId&&-1!=this._endZoneId){var p,m,v=this._findNearZoneDoor(this._endNode.point,this._endZoneId,ee.default.NaviEntranceType_ENTRANCE),g=this._zoneIdDijkstras.get(this._endZoneId),y=g.routeCalculate(v,this._endNode,this._mode);if(y!=F.default.ROUTE_SUCCESS)return y;var _=g.getRouteCalculateResult(),x=this._zoneIdDijkstras.get(-1),y=x.routeCalculate(this._startNode,v,this._mode);if(y!=F.default.ROUTE_SUCCESS)return y;var w=x.getRouteCalculateResult();(0,C.default)(w).call(w),(0,C.default)(_).call(_),(p=this._resultVector).push.apply(p,(0,D.default)(w)),(m=this._resultVector).push.apply(m,(0,D.default)(_))}if(-1!=this._startZoneId&&-1!=this._endZoneId){var b,M,T,S=this._findNearZoneDoor(this._startNode.point,this._startZoneId,ee.default.NaviEntranceType_EXIT),E=this._zoneIdDijkstras.get(this._startZoneId),A=E.routeCalculate(this._startNode,S,this._mode);if(A!=F.default.ROUTE_SUCCESS)return A;var I=E.getRouteCalculateResult(I),L=this._findNearZoneDoor(this._endNode.point,this._endZoneId,ee.default.NaviEntranceType_ENTRANCE),R=this._zoneIdDijkstras.get(this._endZoneId),A=R.routeCalculate(L,this._endNode,this._mode);if(A!=F.default.ROUTE_SUCCESS)return A;var N=R.getRouteCalculateResult(N),k=this._zoneIdDijkstras.get(-1);if(A=k.routeCalculate(S,L,this._mode),A!=F.default.ROUTE_SUCCESS)return A;var P=k.getRouteCalculateResult();(0,C.default)(I).call(I),(0,C.default)(P).call(P),(0,C.default)(N).call(N),(b=this._resultVector).push.apply(b,(0,D.default)(I)),(M=this._resultVector).push.apply(M,(0,D.default)(P)),(T=this._resultVector).push.apply(T,(0,D.default)(N))}}return F.default.ROUTE_SUCCESS}},{key:"_getIndexFormID",value:function(e,t,n){for(var r=0;r<t;r++)if(null!=e[r]&&e[r].Id==n)return r;return-1}},{key:"_calcZoneIdByCoord",value:function(e){for(var t=this._naviGraph.zones,n=0;n<t.length;n++){var r=t[n];if(r.contain(e))return r.Id}return-1}},{key:"_segmentByZones",value:function(){for(var n=this,e=this._naviGraph.zones,t=0;t<e.length;t++){var r=e[t],i=this._sliceGraph(this._naviGraph,r);this._zoneIdGraph.put(r.Id,i)}this._zoneIdGraph.put(-1,this._naviGraph),this._zoneIdGraph.each(function(e,t){t.simplify(),n._zoneIdDijkstras.put(e,new c.default(t))}),this._zoneIdGraph.each(function(e,t){t.consoleNodeInfos(),t.consoleRoadInfos()})}},{key:"_sliceGraph",value:function(e,t){var n;if(e&&t){for(var r,i=0,a=0,o=e.roadVector.length,s=e.nodeVector.length,l=e.roadVector,u=e.nodeVector,h=0,c=new Int8Array(o),d=0;d<o;d++)l[d]&&l[d].roadEntry!=ee.default.NaviRoadEntry_FORBID&&(r=l[d],i=t.contain(r.startPoint),a=t.contain(r.endPoint),0==i&&0==a||(h=!0),1==i&&1==a&&(c[d]=1),1==i&&0==a&&(c[d]=2),0==i&&1==a&&(c[d]=3),0==i&&0==a&&(c[d]=4),2==i&&0==a&&(c[d]=6),2==i&&1==a&&(c[d]=7),0==i&&2==a&&(c[d]=8),1==i&&2==a&&(c[d]=9));if(0==h)return null;for(var f,p,m,v,g,y,_,x,w,b,M,T,S,E,A,I,L,R,N,k,P,C=new Array(s),D=new Array(o),O=0,F=new Int8Array(s),B=c.length,U=0,z=B;U<z;U++)0!=c[U]&&6!=c[U]&&8!=c[U]&&1!=c[U]&&l[U]&&(f=l[U],p=f.roadEntry,m=[f.Id],2==c[U]||9==c[U]?(x=null,x=2==c[U]?t.calcCrossPoint(f.startPoint,f.endPoint):(0,Q.default)({},f.endPoint),w=new te.default,w.Id=this._naviGraph.generateNodeId(),w.nodeType=ee.default.NaviNodeType_COMMON,w.liftType=ee.default.NaviLiftType_NULL,w.entranceType=ee.default.NaviEntranceType_ACCESS,w.point=(0,Q.default)({},x),b=new ne.default,b.setRoad(f),b.Id=this._naviGraph.generateRoadId(),m.push(b.Id),w.segLinks=m,M=new te.default,M.setNode(w),p==ee.default.NaviRoadEntry_FORWARD?M.entranceType=ee.default.NaviEntranceType_EXIT:p==ee.default.NaviRoadEntry_BACK&&(M.entranceType=ee.default.NaviEntranceType_ENTRANCE),t._linkAccessNodes.push(M),O=this._getIndexFormID(u,s,b.endId),b.endPoint=(0,Q.default)({},M.point),b.pointVector[1]=(0,Q.default)({},M.point),b.endId=M.Id,b.calcLength(),D[U]=b,C[O]=M,O=this._getIndexFormID(u,s,b.startId),C[O]=u[O],(0,K.default)(v=C[O].segLinks).call(v,(0,$.default)(g=C[O].segLinks).call(g,f.Id),1,b.Id),T=new te.default,T.setNode(w),f.startId=T.Id,f.startPoint=(0,Q.default)({},T.point),f.pointVector[0]=(0,Q.default)({},T.point),f.calcLength(),(0,K.default)(y=u[O].segLinks).call(y,(0,$.default)(_=u[O].segLinks).call(_,f.Id),1),u.push(T),F[O]=2):3!=c[U]&&7!=c[U]||(L=null,L=3==c[U]?t.calcCrossPoint(f.startPoint,f.endPoint):(0,Q.default)({},f.startPoint),R=new te.default,R.Id=this._naviGraph.generateNodeId(),R.nodeType=ee.default.NaviNodeType_COMMON,R.liftType=ee.default.NaviLiftType_NULL,R.entranceType=ee.default.NaviEntranceType_ACCESS,R.point=(0,Q.default)({},L),N=new ne.default,N.setRoad(f),N.Id=this._naviGraph.generateRoadId(),m.push(N.Id),R.segLinks=m,k=new te.default,k.setNode(R),p==ee.default.NaviRoadEntry_FORWARD?k.entranceType=ee.default.NaviEntranceType_ENTRANCE:p==ee.default.NaviRoadEntry_BACK&&(k.entranceType=ee.default.NaviEntranceType_EXIT),t._linkAccessNodes.push(k),O=this._getIndexFormID(u,s,N.startId),N.startPoint=(0,Q.default)({},k.point),N.pointVector[0]=(0,Q.default)({},k.point),N.startId=k.Id,N.calcLength(),D[U]=N,C[O]=k,O=this._getIndexFormID(u,s,N.endId),C[O]=u[O],(0,K.default)(S=C[O].segLinks).call(S,(0,$.default)(E=C[O].segLinks).call(E,f.Id),1,N.Id),P=new te.default,P.setNode(R),f.endId=P.Id,f.endPoint=(0,Q.default)({},P.point),f.pointVector[1]=(0,Q.default)({},P.point),f.calcLength(),(0,K.default)(A=u[O].segLinks).call(A,(0,$.default)(I=u[O].segLinks).call(I,f.Id),1),u.push(P),F[O]=2));for(var G,V=0,H=B;V<H;V++)1==c[V]&&(G=l[V],G&&(D[V]=G,O=this._getIndexFormID(u,s,G.startId),2!=F[O]&&(C[O]=u[O],F[O]=1),O=this._getIndexFormID(u,s,G.endId),2!=F[O]&&(C[O]=u[O],F[O]=1),l[V]=null));for(var j=0;j<s;j++)1==F[j]&&(u[j]=null);for(var W=new re.default(C,D,!0,1),Y=[],q=e.obstructModels,X=0;X<q.length;X++){var Z,J=q[X];J&&(Z=this._modelInZone(J,t),Z&&Y.push(J))}return(n=W.obstructModels).push.apply(n,Y),W}}},{key:"_assemblePassNotThroughModels",value:function(){var o=this;this._zoneIdGraph.each(function(e,t){for(var n=t.obstructModels,r=0;r<n.length;r++){var i,a=n[r];ee.default.NaviModelPassType_PASS_NOT_THROUGH==a.pass&&(i=o._zonePNTModelsMap.get(e),i||(i=[],o._zonePNTModelsMap.put(e,i)),i.push(a))}}),this._zonePNTModelsMap.each(function(e,t){for(var n=0;n<t.length;n++)t[n].fid})}},{key:"_assembleNotPassModels",value:function(){var o=this;this._zoneIdGraph.each(function(e,t){for(var n=t.obstructModels,r=0;r<n.length;r++){var i,a=n[r];ee.default.NaviModelPassType_NOT_PASS==a.pass&&(i=o._zoneNPModelsMap.get(e),i||(i=[],o._zoneNPModelsMap.put(e,i)),i.push(a))}}),this._zoneNPModelsMap.each(function(e,t){for(var n=0;n<t.length;n++)t[n].fid})}},{key:"_fitVariableRoadsToModel",value:function(){var l=this;this._zonePNTModelsMap.each(function(e,t){for(var n=l._zoneIdGraph.get(e).roadVector,r=0;r<t.length;r++){for(var i=t[r],a=0;a<n.length;a++){var o,s=n[a].calcMiddlePoint();O.default.pointInPolygon2d(i.points,s,i.pointCount)&&(n[a].length=n[a].length*l._kScaleVariable,o=l._modelIdRoadsMap.get(i.Id),o||(o=[],l._modelIdRoadsMap.put(i.Id,o)),o.push(n[a]))}l._switchVariableHinderTo(e,i,ee.default.NaviRoadHinderType_HINDER_HIGH)}})}},{key:"_insertWayPoints",value:function(){for(var e=0;e<this._wayPts.length;e++){var t=new te.default;this._insertPoint(this._wayPts[e],t)?(this._transitNodes.push(t),this._KeyNodes.append({num:this._KeyNodes.size(),id:t.Id,idx:this._naviGraph.getIdxByNodeId(t.Id),node:t})):this._failedInsertPts.push(this._wayPts[e])}}},{key:"_adjustNPModelRoads",value:function(){var p=this;this._zoneNPModelsMap.each(function(e,t){for(var n=p._zoneIdGraph.get(e),r=n.roadVector,i=0;i<t.length;i++)for(var a=t[i],o=0;o<r.length;o++){var s=r[o],l=s.roadEntry,u=s.calcMiddlePoint();if(O.default.pointInPolygon2d(a.points,u,a.pointCount-1)){if(s.length=Number.MAX_VALUE,l==ee.default.NaviRoadEntry_BOTH||l==ee.default.NaviRoadEntry_FORWARD){var h=p._zoneIdGraph.get(e).adjList.get(s.startId);if(h)for(var c=0;c<h.length;c++)h[c].nodeId==s.endId&&(h[c].length=s.length)}if(s.roadEntry==ee.default.NaviRoadEntry_BOTH||s.roadEntry==ee.default.NaviRoadEntry_BACK){var d=p._zoneIdGraph.get(e).adjList.get(s.endId);if(d)for(var f=0;f<d.length;f++)d[f].nodeId==s.startId&&(d[f].length=s.length)}}}})}},{key:"_switchVariableHinderTo",value:function(e,t,n){var r=this._modelIdRoadsMap.get(t.Id);if(r){if(ee.default.NaviRoadHinderType_HINDER_HIGH==n)for(var i=0;i<r.length;i++){var a=r[i];if(a.calcLength(),a.length=r.length*this._kScaleVariable,a.roadEntry==ee.default.NaviRoadEntry_BOTH||a.roadEntry==ee.default.NaviRoadEntry_FORWARD){var o=this._zoneIdGraph.get(e).adjList.get(a.startId);if(o)for(var s=0;s<o.length;s++)o[s].nodeId==a.endId&&(o[s].length=a.length)}if(a.roadEntry==ee.default.NaviRoadEntry_BOTH||a.roadEntry==ee.default.NaviRoadEntry_BACK){var l=this._zoneIdGraph.get(e).adjList.get(a.endId);if(l)for(var u=0;u<l.length;u++)l[u].nodeId==a.startId&&(l[u].length=a.length)}}if(ee.default.NaviRoadHinderType_HINDER_GENERAL==n)for(var h=0;h<r.length;h++){var c=r[h];if(c.calcLength(),c.roadEntry==ee.default.NaviRoadEntry_BOTH||c.roadEntry==ee.default.NaviRoadEntry_FORWARD){var d=this._zoneIdGraph.get(e).adjList.get(c.startId);if(d)for(var f=0;f<d.length;f++)d[f].nodeId==c.endId&&(d[f].length=c.length)}if(c.roadEntry==ee.default.NaviRoadEntry_BOTH||c.roadEntry==ee.default.NaviRoadEntry_BACK){var p=this._zoneIdGraph.get(e).adjList.get(c.endId);if(p)for(var m=0;m<p.length;m++)p[m].nodeId==c.startId&&(p[m].length=c.length)}}}}},{key:"_findNearZoneDoor",value:function(e,t,n){var r=this._naviGraph.getZone(t);if(null==r)return null;for(var i=this._zoneIdGraph.get(t).findModel(e,a),a=i.area,o=Number.MAX_VALUE,s=null,l=0;l<r._linkAccessNodes.length;l++){var u=r._linkAccessNodes[l],h=O.default.distanceOfTwoPoints(u.point,e);if((u.entranceType==ee.default.NaviEntranceType_ACCESS||u.entranceType==n)&&h<o){var c=this._findMinAreaNearestObstructModel(t,u.point);if(c!=i){if(c.pass==ee.default.NaviModelPassType_PASS_NOT_THROUGH)continue;o=h,s=u}else o=h,s=u}}return s}},{key:"_findMinAreaNearestObstructModel",value:function(e,t){for(var n=null,r=this._zoneIdGraph.get(e),i=Number.MAX_VALUE,a=Number.MAX_VALUE,o=null,s=r.obstructModels,l=0;l<s.length;l++){var u,h=s[l],c=O.default.pointToPolygon2d(h.points,t,h.points.length-1);c<a&&(a=c,o=h),this._kDoorToler>c&&(u=h.area,u<i&&(i=u,n=h))}return null==n?o:n}},{key:"_modelInZone",value:function(e,t){if(e.bb.isSeparate(t.bb))return!1;var n=e.center;return!!O.default.pointInPolygon2d(t.points,n,t.pointCount)}},{key:"_insertTempNodeToRoad",value:function(e,t,n){var r,i,a=(0,w.default)(r=this._tmp_adj_node_ids).call(r,function(e){return e==n.startId}),o=(0,w.default)(i=this._tmp_adj_node_ids).call(i,function(e){return e==n.endId});null==a&&this._tmp_adj_node_ids.push(n.startId),null==o&&this._tmp_adj_node_ids.push(n.endId);for(var s=this._unattachedTempRoadTrees,l=null,u=0;u<s.length;u++)if(s[u]._wrappedRoad==n){l=s[u];break}if(null==l)l={},l._wrappedRoad=n,s.push(l);else for(;null!=l._fromChild;)var h=l._fromChild._wrappedRoad,l=O.default.pointIsInRect1(t,h.startPoint,h.endPoint)?l._fromChild:l._toChild;n=l._wrappedRoad;var c=new te.default;c.Id=this._newTmpId(),c.point=t;var d=new ne.default;d.Id=this._newTmpId(),d.startId=n.startId,d.startPoint=n.startPoint,d.endId=c.Id,d.endPoint=c.point,d.pointVector=[n.startPoint,c.point];var f=new ne.default;f.Id=this._newTmpId(),f.startId=c.Id,f.startPoint=c.point,f.endId=n.endId,f.endPoint=n.endPoint,f.pointVector=[c.point,n.endPoint],this._unattachedTempRoads.push(d),this._unattachedTempRoads.push(f);var p={};p._wrappedRoad=d;var m={};m._wrappedRoad=f,l._fromChild=p,l._toChild=m,c.tempType=1,d.tempType=1,f.tempType=1,d.calcLength(),f.calcLength(),d.roadEntry=n.roadEntry,f.roadEntry=n.roadEntry;var v=this._zoneIdGraph.get(e);v.nodeVector.push(c),v.roadVector.push(d),v.roadVector.push(f);var g,y,_,x=this._zoneIdDijkstras.get(e)._naviGraph;return x._nodeMap.put(c.Id,v.nodeVector.length-1),n.roadEntry==ee.default.NaviRoadEntry_BOTH&&(g=[],g.push({nodeId:n.startId,length:d.length}),g.push({nodeId:n.endId,length:f.length}),x.adjList.put(c.Id,g),g=x.adjList.get(n.startId),g||(g=[],x.adjList.put(n.startId,g)),g.push({nodeId:c.Id,length:d.length}),g=x.adjList.get(n.endId),g||(g=[],x.adjList.put(n.endId,g)),g.push({nodeId:c.Id,length:f.length})),n.roadEntry==ee.default.NaviRoadEntry_FORWARD&&(y=[],y.push({nodeId:n.endId,length:f.length}),x.adjList.put(c.Id,y),y=x.adjList.get(n.startId),y||(y=[],x.adjList.put(n.startId,y)),y.push({nodeId:c.Id,length:d.length})),n.roadEntry==ee.default.NaviRoadEntry_BACK&&(_=[],_.push({nodeId:n.startId,length:d.length}),x.adjList.put(c.Id,_),_=x.adjList.get(n.endId),_||(_=[],x.adjList.put(n.endId,_)),_.push({nodeId:c.Id,length:f.length})),c}},{key:"_insertItemToVector",value:function(e,t){for(var n=t.length-1;0<=n;n--)if(t[n].Id&&0<t[n].Id)return(0,K.default)(t).call(t,n+1,0,e),n+1;return-1}},{key:"_insertNodeToRoad",value:function(e,t,n,r){if(r)return this._insertTempNodeToRoad(e,t,n);var i=this._zoneIdGraph.get(e),a=new te.default;a.Id=i.generateNodeId(),a.point=t;var o=new ne.default;o.Id=i.generateRoadId(),o.startId=n.startId,o.startPoint=n.startPoint,o.endId=a.Id,o.endPoint=a.point,o.pointVector=[n.startPoint,a.point];var s=new ne.default;s.Id=i.generateRoadId(),s.startId=a.Id,s.startPoint=a.point,s.endId=n.endId,s.endPoint=n.endPoint,s.pointVector=[a.point,n.endPoint];var l=[];l.push(o.Id),l.push(s.Id),a.segLinks=l,o.calcLength(),s.calcLength(),o.roadEntry=n.roadEntry,s.roadEntry=n.roadEntry;var u,h,c,d=i.nodeVector,f=i.roadVector,p=this._insertItemToVector(a,d);return this._insertItemToVector(o,f),this._insertItemToVector(s,f),i._nodeMap.put(a.Id,p),n.roadEntry==ee.default.NaviRoadEntry_BOTH&&(u=[],u.push({nodeId:n.startId,length:o.length}),u.push({nodeId:n.endId,length:s.length}),i.adjList.put(a.Id,u),u=i.adjList.get(n.startId),u||(u=[],i.adjList.put(n.startId,u)),u.push({nodeId:a.Id,length:o.length}),u=i.adjList.get(n.endId),u||(u=[],i.adjList.put(n.endId,u)),u.push({nodeId:a.Id,length:s.length})),n.roadEntry==ee.default.NaviRoadEntry_FORWARD&&(h=[],h.push({nodeId:n.endId,length:s.length}),i.adjList.put(a.Id,h),h=i.adjList.get(n.startId),h||(h=[],i.adjList.put(n.startId,h)),h.push({nodeId:a.Id,length:o.length})),n.roadEntry==ee.default.NaviRoadEntry_BACK&&(c=[],c.push({nodeId:n.startId,length:o.length}),i.adjList.put(a.Id,c),c=i.adjList.get(n.endId),c||(c=[],i.adjList.put(n.endId,c)),c.push({nodeId:a.Id,length:s.length})),a}},{key:"_clearTmpPoint",value:function(e){if(null!=e){for(var t=this._zoneIdGraph.get(e),n=t.nodeVector.length-1;0<=n;n--){var r,i=t.nodeVector[n];if(null==i||0<=i.Id)break;(0,K.default)(r=t.nodeVector).call(r,n,1)}for(var a=t.roadVector.length-1;0<=a;a--){var o,s=t.roadVector[a];if(null==s||0<=s.Id)break;(0,K.default)(o=t.roadVector).call(o,a,1)}}}},{key:"_deleteTmpConnectionEntirely",value:function(e,t){var n=e.get(t);if(n)for(var r=0;r<n.length;r++)n[r].nodeId<0&&((0,K.default)(n).call(n,r,1),r--)}},{key:"_removeConnection",value:function(e,t){for(var n=e.get(t),r=0;r<n.length;r++)this._deleteTmpConnectionEntirely(e,n[r].nodeId);e.remove(t)}},{key:"_calcAdherenceAtAngle",value:function(e,t,n,r,i,a){i.toDistance=Number.MAX_VALUE,i.stickToRoad=!1,i.rotateAngle=0;for(var o=Number.MAX_VALUE,s={},l=this._zoneIdGraph.get(e),u=0;u<l.roadVector.length;u++){var h,c,d=l.roadVector[u];null!=d&&(h=O.default.rayCrossSegment(t,n,d.startPoint,d.endPoint,s),h&&(c=O.default.distanceOfTwoPoints(t,s),c<o&&(o=c,i.cross=(0,Q.default)({},s),i.distance=o,i.road=d,i.stickToRoad=!0)))}l=this._zoneIdGraph.get(-1);for(var f={},p=0;p<l.obstructModels.length;p++){var m=l.obstructModels[p];if(null!=m&&m!=a&&ee.default.NaviModelPassType_DECORATE!=m.pass&&(null==a||!O.default.pointInPolygon2d(m.points,a.center,m.points.length-1)))for(var v=m.points.length,g=0;g<v-1;g++){var y=O.default.rayCrossSegment(t,n,m.points[g],m.points[g+1],f);if(y){var _=O.default.distanceOfTwoPoints(t,f);if(_<o)return o=_,i.model=m,i.distance=Number.MAX_VALUE,i.stickToRoad=!1,i.obstructType=ee.default.NaviObstructType_MODEL,!1}}}for(var x={},w=l.obstructExtents,b=0;b<w.length;b++){for(var M=w[b],T=w[b].holes,S=0;S<T.length;S++)for(var E=T[S],A=0;A<E.length-1;A++){var I=O.default.rayCrossSegment(t,n,E[A],E[A+1],x);if(I){var L=O.default.distanceOfTwoPoints(t,x);if(L<o)return o=L,i.model=M,i.distance=Number.MAX_VALUE,i.stickToRoad=!1,i.obstructType=ee.default.NaviObstructType_EXTENT,!1}}for(var R=w[b].points,N=0;N<R.length-1;N++){var k=O.default.rayCrossSegment(t,n,R[N],R[N+1],x);if(k){var P=O.default.distanceOfTwoPoints(t,x);if(P<o)return o=P,i.model=M,i.distance=Number.MAX_VALUE,i.stickToRoad=!1,i.obstructType=ee.default.NaviObstructType_EXTENT,!1}}}return i.toDistance=O.default.distanceOfTwoPoints(i.cross,r),!0}},{key:"_adherenceCompare",value:function(e,t){return e.toDistance-t.toDistance}},{key:"_adherenceAngleCompare",value:function(e,t){return t.rotateAngle-e.rotateAngle}},{key:"_clearTempPoint",value:function(e){var t=this._zoneIdGraph.get(e);if(t){for(var n=t.nodeVector,r=n.length-1;0<=r;r--){var i=n[r];if(null==i||0<=i.Id)break;(0,K.default)(n).call(n,r,1)}for(var a=t.roadVector,o=a.length-1;0<=o;o--){var s=a[o];if(null==s||0<=s.Id)break;(0,K.default)(a).call(a,o,1)}}}},{key:"_clearTempAdjList",value:function(){var s=this;this._zoneIdDijkstras.each(function(e,t){for(var n=[],r=t._naviGraph.adjList,i=0;i<(0,l.default)(r).length;i++)(0,l.default)(r)[i]<0&&n.push((0,l.default)(r)[i]);for(var a=0;a<n.length;a++)s._removeConnection(t._naviGraph.adjList,n[a]);for(var o=0;o<s._tmp_adj_node_ids.length;o++)s._deleteTmpConnectionEntirely(r,s._tmp_adj_node_ids[o])})}},{key:"_exploreUprightLikelyJoints",value:function(e,t,n,r,i){for(var a=[],o=0;o<r.length;o++)if(r[o].distance<O.default.epsilon())return a.push(r[o]),a;var s={x:0,y:0},l=O.default.calcFootOfUpright(t,n.startPoint,n.endPoint,s),u={};if(l&&this._isTwoPointsConnectedDirectly(t,s,u,i)){var h={};return h.cross=s,h.stickToRoad=!0,h.road=n,h.rotateAngle=0,h.dist=O.default.distanceOfTwoPoints(t,s),a.push(h),a}for(var c={x:s.x-t.x,y:s.y-t.y},d=0;d<r.length;d++){var f=r[d],p={x:f.cross.x-t.x,y:f.cross.y-t.y},m=O.default.calcRotateAngle(p,c),m=270<m?m-360:m;f.rotateAngle=m}(0,_.default)(r).call(r,this._adherenceAngleCompare);var v=null,g=null;if(r[r.length-1].rotateAngle<0)return v=r[r.length-1],a.push(v),a;for(var y=0;y<r.length;y++)if(0<r[y].rotateAngle)return v=r[y],0==y?a.push(v):(g=r[y-1],O.default.distanceOfTwoPoints(v.cross,n.startPoint)>O.default.distanceOfTwoPoints(g.cross,n.startPoint)?(a.push(g),a.push(v)):(a.push(v),a.push(g))),a;return a}},{key:"_calcAllAdherance",value:function(e,t,n,r,i,a){for(var o=i||30,s=0;s<360;s+=o){var l=new u.default;this._calcAdherenceAtAngle(e,t,s,n,l,a),1==l.stickToRoad&&r.push(l)}(0,_.default)(r).call(r,this._adherenceCompare)}},{key:"_seekNearRoads",value:function(e,t,n,r,i){var a=new h.default,o=[];for(this._calcAllAdherance(e,t,n,o,r,i);0!=o.length;){var s=o[0],l=a.get(s.road.Id);l?l.push(s):(l=[],l.push(s),a.put(s.road.Id,l)),(0,K.default)(o).call(o,0,1)}return a}},{key:"_insertTmpIsolatedNode",value:function(e,t){var n=new te.default;n.Id=this._newTmpId(),n.point=(0,Q.default)({},t);var r=this._zoneIdGraph.get(e);r.nodeVector.push(n);var i=this._zoneIdDijkstras.get(e);return i._naviGraph._nodeMap.put(n.Id,r.nodeVector.length-1),n}},{key:"_insertIsolatedNode",value:function(e,t,n){if(n)return this._insertTmpIsolatedNode(e,t);var r=new te.default;r.Id=this._naviGraph.generateNodeId(),r.point=(0,Q.default)({},t);var i=this.zoneIdGraph.get(e),a=i.nodeVector,o=this._insertItemToVector(r,a);return i._nodeMap.put(r.Id,o),r}},{key:"_isTwoPointsConnectedDirectly",value:function(e,t,n,r){for(var i=this._zoneIdGraph.get(-1),a=null,o=0;o<i.obstructModels.length;o++)if(a=i.obstructModels[o],null!=a&&a!=r&&ee.default.NaviModelPassType_DECORATE!=a.pass)for(var s=a.points,l=0;l<s.length-1;l++)if(O.default.calcCrossPoint(e,t,s[l],s[l+1],n)){var u=O.default.distanceOfTwoPoints(e,n),h=O.default.distanceOfTwoPoints(t,n);if(!(u<=O.default.epsilon()||h<=O.default.epsilon()))return!1}for(var c=i.obstructExtents,d=0;d<c.length;d++){for(var f=c[d],p=f.holes,m=0;m<p.length;m++)for(var v=p[m],g=0;g<v.length-1;g++)if(O.default.calcCrossPoint(e,t,v[g],v[g+1],n))return!1;for(var y=f.points,_=0;_<y.length-1;_++)if(O.default.calcCrossPoint(e,t,y[_],y[_+1],n))return!1}return!0}},{key:"_joinTwoNodes",value:function(e,t,n,r,i,a){for(var o=0;o<this._attachedTempRoads.length;o++){var s=this._attachedTempRoads[o],l={};if(1==O.default.calcCrossPoint(s.startPoint,s.endPoint,t.point,n.point,l)&&O.default.distanceOfTwoPoints(t.point,l)>O.default.epsilon())return null}void 0===r&&(r=ee.default.NaviRoadEntry_BOTH),void 0===i&&(i=!0),void 0===a&&(a=!0);var u=new ne.default;u.startId=t.Id,u.startPoint=t.point,u.endId=n.Id,u.endPoint=n.point,u.pointVector=[t.point,n.point],this._tmp_adj_node_ids.push(t.Id),this._tmp_adj_node_ids.push(n.Id),u.Id=i?this._newTmpId():this._naviGraph.generateRoadId(),u.roadEntry=r,u.calcLength(),a&&this._attachedTempRoads.push(u);var h=this._zoneIdGraph.get(e);h.roadVector.push(u);var c,d,f,p,m,v=this._zoneIdDijkstras.get(e);return ee.default.NaviRoadEntry_BOTH==r&&(c={nodeId:n.Id,length:u.length},d=v._naviGraph.adjList.get(t.Id),d?d.push(c):(d=[],d.push(c),v._naviGraph.adjList.put(t.Id,d)),c={nodeId:t.Id,length:u.length},d=v._naviGraph.adjList.get(n.Id),d?d.push(c):(d=[],d.push(c),v._naviGraph.adjList.put(n.Id,d))),ee.default.NaviRoadEntry_FORWARD==r&&(f={nodeId:n.Id,length:u.length},m=v._naviGraph.adjList.get(t.Id),m?m.push(f):(m=[],m.push(f),v._naviGraph.adjList(t.Id,m))),ee.default.NaviRoadEntry_BACK==r&&(p={nodeId:t.Id,length:u.length},m=v._naviGraph.adjList.get(n.Id),m?m.push(p):(m=[],m.push(p),v._naviGraph.adjList.put(n.Id,m))),u}},{key:"_isPointInPNTModel",value:function(e){var t=this._calcZoneIdByCoord(e),n=this._zonePNTModelsMap.get(t);if(n)for(var r=0;r<n.length;r++){var i=n[r];if(O.default.pointInPolygon2d(i.points,e,i.points.length))return i}return null}},{key:"_newTmpId",value:function(){return this._tmpId--}},{key:"gid",get:function(){return this._gid},set:function(e){this._gid=e}},{key:"route",get:function(){this._route}}]),n}(),g=m;t.default=g},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var h=r(n(9)),c=r(n(60)),o=r(n(2)),s=r(n(3)),l=r(n(97)),u=function(){function t(e){(0,o.default)(this,t),this.adj=e||[]}return(0,s.default)(t,[{key:"has",value:function(e){for(var t in this.adj)if(e==t[0])return!0;return!1}},{key:"weight",value:function(e){if(null==e)return null;for(var t in this.adj)if(e==this.adj[t][0])return this.adj[t][1];return null}},{key:"append",value:function(e){this.adj.push(e)}}]),t}(),a=function(){function a(e){for(var t in(0,o.default)(this,a),this._adjTable=new l.default,e){var n=e[t][0];e[t][1],e[t][2],this._adjTable.has(n)||this._adjTable.put(n,new u);for(var r=[],i=1;i<e[t].length;i++)r.push(e[t][i]);this._adjTable.get(n).append(r)}}return(0,s.default)(a,[{key:"get",value:function(e){return this._adjTable.has(e)?this._adjTable.get(e):null}},{key:"lookup",value:function(e,t){if(this._adjTable.has(e)){var n=this._adjTable.get(e);return n.weight(t)}return null}},{key:"keys",value:function(){return(0,c.default)(this._adjTable)}},{key:"enhance",value:function(e,t,n){var r;n=n||[];for(var i,a,o=(0,c.default)(r=this).call(r),s=Infinity,l={dist:Infinity,transit:null},u=0;u<o.length;u++)-1==(0,h.default)(n).call(n,o[u])&&(i=this.lookup(e,o[u]),a=this.lookup(o[u],t),null!=i&&null!=a&&i+a<s&&(l={dist:i+a,transit:o[u]},s=i+a));return l}}]),a}(),d=a;t.default=d},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(15)),s=r(n(9)),a=r(n(2)),l=r(n(3)),u=function(){function n(e){if((0,a.default)(this,n),e instanceof Number){this._num=e,this._array=[];for(var t=0;t<e;t++)this._array.push(null)}if(e instanceof Array)for(this._names=e,this._array=[],t=0;t<e.length;t++)this._array.push(null)}return(0,l.default)(n,[{key:"size",value:function(){return this._array.length}},{key:"set",value:function(e,t){if(e<0||e>=this.size())throw"positon is out of bounder";this._array[e]=t}},{key:"get",value:function(e){var t,n=e;return"string"==typeof e&&(n=(0,s.default)(t=this._names).call(t,e)),this._array[n]}},{key:"toArray",value:function(){for(var e=[],t=0;t<this._array.length;t++)e.push(this._array[t]);return e}},{key:"equals",value:function(e){if(this._array.length!=e._array.length)return!1;if(this._names.length!=e._names.length)return!1;for(var t=0;t<this._names.length;t++)if(this._names[t]!=e._names[t])return!1;return!0}},{key:"clone",value:function(){for(var e=0==this._names.length?new n(this._array.length):new n(this._names),t=0;t<this._array.length;t++)e._array[t]=this._array[t];return e}}]),n}(),h=function(){function n(e){(0,a.default)(this,n),this._names=e,this._table=[]}return(0,l.default)(n,[{key:"append",value:function(e){if(e instanceof u){var t=new u(e._names);if(!t.equals(e))throw"the appended item is not compatible to the TupleTable";this._table.push(e)}else{var n,r=new u(this._names);for(n in e){var i,a=(0,s.default)(i=this._names).call(i,n);0<=a&&r.set(a,e[n])}this._table.push(r)}}},{key:"query",value:function(e,t){for(var n=0;n<this._table.length;n++){var r=this._table[n];if(r.get(e)==t)return r}return null}},{key:"foreach",value:function(e,t){t=t||-1;for(var n=0;n<this._table.length;n++)e(t<0?this._table[n]:this._table[n].get(t))}},{key:"size",value:function(){return this._table.length}},{key:"clone",value:function(){for(var e=new n(this._names),t=0;t<this._table.length;t++)e.append(this._table[t].clone());return e}},{key:"dropLines",value:function(e){for(var t=0;t<this._table.length;t++){var n,r,i=!0;for(n in e){var a=this._table[t].get(n);if(a!=e[n]){i=!1;break}}i&&((0,o.default)(r=this._table).call(r,t,1),t--)}}},{key:"clear",value:function(){this._table=[]}}]),n}(),c=h;t.default=c},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var c=r(n(15)),d=r(n(9)),f=r(n(30)),a=r(n(2)),o=r(n(3)),p=r(n(265)),m=r(n(601)),s=n(266),l=s.SmallQueue,u=function(){function i(e,t,n,r){(0,a.default)(this,i),this._startPt=e,this._endPt=t,this._passPts=n,this._dijkCollection=r,this._failedInsertedPts={}}return(0,o.default)(i,[{key:"_refreshPts",value:function(){var e,t={};for(e in this._passPts)for(var n=this._passPts[e],r=0;r<n.length;r++){var i,a=n[r],o=this._dijkCollection.getDijkByPoint(e,{x:a[0],y:a[1]});o?(t[o.Id]||(t[o.Id]=[]),t[o.Id].push(a)):(i=this._failedInsertedPts[e],null==i&&(this._failedInsertedPts[e]=[]),this._failedInsertedPts[e].push(a))}this._passPts=t}},{key:"_buildGraph",value:function(){this._graph=[];for(var e=0;e<this._dijkCollection.len();e++)for(var t,n,r=this._dijkCollection.get(e),i=0;i<this._dijkCollection.len();i++)e!=i&&(t=this._dijkCollection.get(i),n=r.hasRelationTo(t),n.related&&this._graph.push([r.Id,t.Id,n.dist]))}},{key:"executeCalculation",value:function(){this.reset(),this._buildGraph(),this._refreshPts();var e,t=[];for(e in this._passPts)t.push((0,f.default)(e));var n=this._dijkCollection.getDijkByPoint(this._startPt.groupID,this._startPt).Id,r=this._dijkCollection.getDijkByPoint(this._endPt.groupID,this._endPt).Id,i=new p.default(this._graph);i.setSId(n),i.setEId(r);var a=(0,d.default)(t).call(t,n);-1!=a&&(0,c.default)(t).call(t,a,1),a=(0,d.default)(t).call(t,r),-1!=a&&(0,c.default)(t).call(t,a,1),i.setWayNodes(t),i.route();var o=i.getResult();if(2==o.route.length&&o.route[0]==o.route[1]&&(o.route=[o.route[0]]),Infinity!=o.dist){for(var s=[],l=0;l<o.route.length;l++){var u=this._dijkCollection.getDijkById(o.route[l]);if(u.setWayPoints(this._passPts[o.route[l]]),s.push(u),0<u._failedInsertPts.length){var h=this._failedInsertedPts[u.fid];for(null==h&&(this._failedInsertedPts[u.fid]=[]),l=0;l<u._failedInsertPts.length;l++)this._failedInsertedPts[u.fid].push(u._failedInsertPts[l])}}this._dijkList=new m.default,this._dijkList.load(s),this._dijkList.compute(this._startPt,this._endPt),this._routes=this._dijkList.routes}}},{key:"reset",value:function(){this._dijkCollection.each(function(e){e._next=new l,e._startNode=null,e._endNode=null,e._visited=!1,e._transitNodes=[],e._failedInsertPts=[]})}},{key:"routes",get:function(){return this._routes},set:function(e){this._routes=e}},{key:"failInsertedPts",get:function(){return this._failedInsertedPts}}]),i}(),h=u;t.default=h},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=function(){function e(){(0,a.default)(this,e),this._head=null,this.routes=[]}return(0,o.default)(e,[{key:"load",value:function(e){if(0!=e.length){this._head=e[0];for(var t=this._head,n=1;n<e.length;n++)t.pushNext(e[n]),t=e[n];t.pushNext(null)}}},{key:"compute",value:function(e,t){var n=this._head;for(n.setStart(e);n.getNext();){if(n.Id,!n.computeKeyRoutes())return!1;this.routes.push({groupId:n.gid,result:n.getResult()}),n=n.popNext()}n.setEnd(t),n.computeKeyRoutes(),this.routes.push({groupId:n.gid,result:n.getResult()})}}]),e}(),l=s;t.default=l},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.Matrix4=v;var c,d,a,o,s,l,u,h,f,p=r(n(12)),m=n(154);function v(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}(0,p.default)(v.prototype,{isMatrix4:!0,set:function(e,t,n,r,i,a,o,s,l,u,h,c,d,f,p,m){var v=this.elements;return v[0]=e,v[4]=t,v[8]=n,v[12]=r,v[1]=i,v[5]=a,v[9]=o,v[13]=s,v[2]=l,v[6]=u,v[10]=h,v[14]=c,v[3]=d,v[7]=f,v[11]=p,v[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new v).fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this},copyPosition:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},extractBasis:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this},extractRotation:(f=new m.Vector3,function(e){var t=this.elements,n=e.elements,r=1/f.setFromMatrixColumn(e,0).length(),i=1/f.setFromMatrixColumn(e,1).length(),a=1/f.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}),makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t,n,r,i,a,o,s,l,u,h,c,d,f=this.elements,p=e.x,m=e.y,v=e.z,g=Math.cos(p),y=Math.sin(p),_=Math.cos(m),x=Math.sin(m),w=Math.cos(v),b=Math.sin(v);return"XYZ"===e.order?(a=g*w,o=g*b,s=y*w,l=y*b,f[0]=_*w,f[4]=-_*b,f[8]=x,f[1]=o+s*x,f[5]=a-l*x,f[9]=-y*_,f[2]=l-a*x,f[6]=s+o*x,f[10]=g*_):"YXZ"===e.order?(t=_*w,n=_*b,r=x*w,i=x*b,f[0]=t+i*y,f[4]=r*y-n,f[8]=g*x,f[1]=g*b,f[5]=g*w,f[9]=-y,f[2]=n*y-r,f[6]=i+t*y,f[10]=g*_):"ZXY"===e.order?(t=_*w,n=_*b,r=x*w,i=x*b,f[0]=t-i*y,f[4]=-g*b,f[8]=r+n*y,f[1]=n+r*y,f[5]=g*w,f[9]=i-t*y,f[2]=-g*x,f[6]=y,f[10]=g*_):"ZYX"===e.order?(a=g*w,o=g*b,s=y*w,l=y*b,f[0]=_*w,f[4]=s*x-o,f[8]=a*x+l,f[1]=_*b,f[5]=l*x+a,f[9]=o*x-s,f[2]=-x,f[6]=y*_,f[10]=g*_):"YZX"===e.order?(u=g*_,h=g*x,c=y*_,d=y*x,f[0]=_*w,f[4]=d-u*b,f[8]=c*b+h,f[1]=b,f[5]=g*w,f[9]=-y*w,f[2]=-x*w,f[6]=h*b+c,f[10]=u-d*b):"XZY"===e.order&&(u=g*_,h=g*x,c=y*_,d=y*x,f[0]=_*w,f[4]=-b,f[8]=x*w,f[1]=u*b+d,f[5]=g*w,f[9]=h*b-c,f[2]=c*b-h,f[6]=y*w,f[10]=d*b+u),f[3]=0,f[7]=0,f[11]=0,f[12]=0,f[13]=0,f[14]=0,f[15]=1,this},makeRotationFromQuaternion:(u=new m.Vector3(0,0,0),h=new m.Vector3(1,1,1),function(e){return this.compose(u,e,h)}),lookAt:(o=new m.Vector3,s=new m.Vector3,l=new m.Vector3,function(e,t,n){var r=this.elements;return l.subVectors(e,t),0===l.lengthSq()&&(l.z=1),l.normalize(),o.crossVectors(n,l),0===o.lengthSq()&&(1===Math.abs(n.z)?l.x+=1e-4:l.z+=1e-4,l.normalize(),o.crossVectors(n,l)),o.normalize(),s.crossVectors(l,o),r[0]=o.x,r[4]=s.x,r[8]=l.x,r[1]=o.y,r[5]=s.y,r[9]=l.y,r[2]=o.z,r[6]=s.z,r[10]=l.z,this}),multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],l=n[12],u=n[1],h=n[5],c=n[9],d=n[13],f=n[2],p=n[6],m=n[10],v=n[14],g=n[3],y=n[7],_=n[11],x=n[15],w=r[0],b=r[4],M=r[8],T=r[12],S=r[1],E=r[5],A=r[9],I=r[13],L=r[2],R=r[6],N=r[10],k=r[14],P=r[3],C=r[7],D=r[11],O=r[15];return i[0]=a*w+o*S+s*L+l*P,i[4]=a*b+o*E+s*R+l*C,i[8]=a*M+o*A+s*N+l*D,i[12]=a*T+o*I+s*k+l*O,i[1]=u*w+h*S+c*L+d*P,i[5]=u*b+h*E+c*R+d*C,i[9]=u*M+h*A+c*N+d*D,i[13]=u*T+h*I+c*k+d*O,i[2]=f*w+p*S+m*L+v*P,i[6]=f*b+p*E+m*R+v*C,i[10]=f*M+p*A+m*N+v*D,i[14]=f*T+p*I+m*k+v*O,i[3]=g*w+y*S+_*L+x*P,i[7]=g*b+y*E+_*R+x*C,i[11]=g*M+y*A+_*N+x*D,i[15]=g*T+y*I+_*k+x*O,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},applyToBufferAttribute:(a=new m.Vector3,function(e){for(var t=0,n=e.count;t<n;t++)a.x=e.getX(t),a.y=e.getY(t),a.z=e.getZ(t),a.applyMatrix4(this),e.setXYZ(t,a.x,a.y,a.z);return e}),determinant:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],l=e[13],u=e[2],h=e[6],c=e[10],d=e[14],f=e[3],p=e[7],m=e[11],v=e[15];return f*(i*s*h-r*l*h-i*o*c+n*l*c+r*o*d-n*s*d)+p*(t*s*d-t*l*c+i*a*c-r*a*d+r*l*u-i*s*u)+m*(t*l*h-t*o*d-i*a*h+n*a*d+i*o*u-n*l*u)+v*(-r*o*u-t*s*h+t*o*c+r*a*h-n*a*c+n*s*u)},transpose:function(){var e=this.elements,t=e[1];return e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(e,t,n){var r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this},getInverse:function(e,t){var n=this.elements,r=e.elements,i=r[0],a=r[1],o=r[2],s=r[3],l=r[4],u=r[5],h=r[6],c=r[7],d=r[8],f=r[9],p=r[10],m=r[11],v=r[12],g=r[13],y=r[14],_=r[15],x=f*y*c-g*p*c+g*h*m-u*y*m-f*h*_+u*p*_,w=v*p*c-d*y*c-v*h*m+l*y*m+d*h*_-l*p*_,b=d*g*c-v*f*c+v*u*m-l*g*m-d*u*_+l*f*_,M=v*f*h-d*g*h-v*u*p+l*g*p+d*u*y-l*f*y,T=i*x+a*w+o*b+s*M;if(0===T){var S="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(S);return console.warn(S),this.identity()}var E=1/T;return n[0]=x*E,n[1]=(g*p*s-f*y*s-g*o*m+a*y*m+f*o*_-a*p*_)*E,n[2]=(u*y*s-g*h*s+g*o*c-a*y*c-u*o*_+a*h*_)*E,n[3]=(f*h*s-u*p*s-f*o*c+a*p*c+u*o*m-a*h*m)*E,n[4]=w*E,n[5]=(d*y*s-v*p*s+v*o*m-i*y*m-d*o*_+i*p*_)*E,n[6]=(v*h*s-l*y*s-v*o*c+i*y*c+l*o*_-i*h*_)*E,n[7]=(l*p*s-d*h*s+d*o*c-i*p*c-l*o*m+i*h*m)*E,n[8]=b*E,n[9]=(v*f*s-d*g*s-v*a*m+i*g*m+d*a*_-i*f*_)*E,n[10]=(l*g*s-v*u*s+v*a*c-i*g*c-l*a*_+i*u*_)*E,n[11]=(d*u*s-l*f*s-d*a*c+i*f*c+l*a*m-i*u*m)*E,n[12]=M*E,n[13]=(d*g*o-v*f*o+v*a*p-i*g*p-d*a*y+i*f*y)*E,n[14]=(v*u*o-l*g*o-v*a*h+i*g*h+l*a*y-i*u*y)*E,n[15]=(l*f*o-d*u*o+d*a*h-i*f*h-l*a*p+i*u*p)*E,this},scale:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))},makeTranslation:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,l=i*a,u=i*o;return this.set(l*a+n,l*o-r*s,l*s+r*o,0,l*o+r*s,u*o+n,u*s-r*a,0,l*s-r*o,u*s+r*a,i*s*s+n,0,0,0,0,1),this},makeScale:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,n){var r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,l=i+i,u=a+a,h=o+o,c=i*l,d=i*u,f=i*h,p=a*u,m=a*h,v=o*h,g=s*l,y=s*u,_=s*h,x=n.x,w=n.y,b=n.z;return r[0]=(1-(p+v))*x,r[1]=(d+_)*x,r[2]=(f-y)*x,r[3]=0,r[4]=(d-_)*w,r[5]=(1-(c+v))*w,r[6]=(m+g)*w,r[7]=0,r[8]=(f+y)*b,r[9]=(m-g)*b,r[10]=(1-(c+p))*b,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this},decompose:(c=new m.Vector3,d=new v,function(e,t,n){var r=this.elements,i=c.set(r[0],r[1],r[2]).length(),a=c.set(r[4],r[5],r[6]).length(),o=c.set(r[8],r[9],r[10]).length(),s=this.determinant();s<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],d.copy(this);var l=1/i,u=1/a,h=1/o;return d.elements[0]*=l,d.elements[1]*=l,d.elements[2]*=l,d.elements[4]*=u,d.elements[5]*=u,d.elements[6]*=u,d.elements[8]*=h,d.elements[9]*=h,d.elements[10]*=h,t.setFromRotationMatrix(d),n.x=i,n.y=a,n.z=o,this}),makePerspective:function(e,t,n,r,i,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*i/(t-e),l=2*i/(n-r),u=(t+e)/(t-e),h=(n+r)/(n-r),c=-(a+i)/(a-i),d=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=u,o[12]=0,o[1]=0,o[5]=l,o[9]=h,o[13]=0,o[2]=0,o[6]=0,o[10]=c,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(e,t,n,r,i,a){var o=this.elements,s=1/(t-e),l=1/(n-r),u=1/(a-i),h=(t+e)*s,c=(n+r)*l,d=(a+i)*u;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-h,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-c,o[2]=0,o[6]=0,o[10]=-2*u,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}})},function(e,t,n){"use strict";var r=n(1),l=r(n(112)),p=r(n(27)),i=r(n(94)),u=n(145);function m(e,t,n,r,i,a){var o=(e+n)/2,s=(t+r)/2,l=((e-n)*(e-n)+(t-r)*(t-r))/4,u=Math.sqrt(l),h=Math.sqrt(i*i-l),c=u/h,d=u*c,f=Math.PI/2,p=1,m=(n-e)/(t-r),v=-1,g=(e-n)/(t-r),y=Math.sqrt(p*p+m*m),_=Math.sqrt(v*v+g*g),x=p/y,w=m/y,b=v/_,M=g/_,T={x:o+d*x,y:s+d*w,theta:f},S={x:o+d*b,y:s+d*M,theta:f};return 0<(n-e)*(T.y-t)-(r-t)*(T.x-e)?0===a?T:S:0===a?S:T}function h(e,t,n,r){for(var i=0;i<e.length;i++)switch(e[i]){case"m":t.moveTo(r.x+(0,p.default)(e[i+1]),r.y+(0,p.default)(e[i+2])),n.x=r.x+(0,p.default)(e[i+1]),n.y=r.y+(0,p.default)(e[i+2]),r.x=n.x,r.y=n.y,i+=2;break;case"M":t.moveTo((0,p.default)(e[i+1]),(0,p.default)(e[i+2])),n.x=(0,p.default)(e[i+1]),n.y=(0,p.default)(e[i+2]),r.x=n.x,r.y=n.y,i+=2;break;case"l":t.lineTo(n.x+(0,p.default)(e[i+1]),n.y+(0,p.default)(e[i+2])),n.x=n.x+(0,p.default)(e[i+1]),n.y=n.y+(0,p.default)(e[i+2]),i+=2;break;case"L":t.lineTo((0,p.default)(e[i+1]),(0,p.default)(e[i+2])),n.x=(0,p.default)(e[i+1]),n.y=(0,p.default)(e[i+2]),i+=2;break;case"A":var a,o=(0,p.default)(e[i+1]),s=(0,p.default)(e[i+2]),l=((0,p.default)(e[i+3]),Math.PI,(0,p.default)(e[i+4]),(0,p.default)(e[i+5])),u=n.x,h=n.y,c=(0,p.default)(e[i+6]),d=(0,p.default)(e[i+7]);o===s&&(a=m(u,h,c,d,o,l),t.arcTo(a.x,a.y,c,d,a.theta),n.x=c,n.y=d),i+=7;break;case"a":var f,o=(0,p.default)(e[i+1]),s=(0,p.default)(e[i+2]),l=((0,p.default)(e[i+3]),Math.PI,(0,p.default)(e[i+4]),(0,p.default)(e[i+5])),u=n.x,h=n.y,c=u+(0,p.default)(e[i+6]),d=h+(0,p.default)(e[i+7]);o===s&&(f=m(u,h,c,d,o,l),t.arcTo(f.x,f.y,c,d,f.theta),n.x=c,n.y=d),i+=7;break;case"h":t.lineTo(n.x+(0,p.default)(e[i+1]),n.y),n.x=n.x+(0,p.default)(e[i+1]),i+=1;break;case"H":t.lineTo((0,p.default)(e[i+1]),n.y),n.x=(0,p.default)(e[i+1]),i+=1;break;case"z":case"Z":t.lineTo(r.x,r.y)}}var c=["M","0","15.07","L","0.69","1.92","A","2","2","0","0","1","2.66","0","L","11.8","0","l","-0.07","1.37","H","3.09","A","1.09","1.09","0","0","0","2","2.44","l","-0.2","4.44","h","9.37","l","-0.07","1.37","H","1.72","l","-0.36","6.82","Z"],d=["M","13.79","11","l","-0.08","1.63","a","1","1","0","0","0","1","1.08","h","8.53","l","-0.07","1.36","h","-9","A","1.84","1.84","0","0","1","12.31","13","l","0.48","-9.16","h","8.9","a","2","2","0","0","1","2","2","L","23.53","9","A","2.11","2.11","0","0","1","21.47","11","Z","m","8.4","-2.49","l","0.08","-2.16","a","1.07","1.07","0","0","0","-1.09","-1.09","H","14.09","l","-0.22","4.33","H","21","A","1.15","1.15","0","0","0","22.19","8.51","Z"],f=["M","33.94","3.86","a","1.93","1.93","0","0","1","2","1.95","l","-0.47","9.27","H","34.07","l","0.45","-8.72","a","1.09","1.09","0","0","0","-1.09","-1.1","H","26.3","l","-0.51","9.82","H","24.41","L","25","3.85","Z"],v=["M","36.48","17.72","H","45","a","1.16","1.16","0","0","0","1.16","-1.22","l","0.07","-1.43","H","38.72","a","2","2","0","0","1","-2","-2.06","l","0.37","-7.19","a","2","2","0","0","1","2.15","-2","H","48.2","l","-0.69","13.28","a","2.09","2.09","0","0","1","-2.06","2","h","-9","Z","m","9.85","-4.05","l","0.44","-8.45","H","39.53","a","1.07","1.07","0","0","0","-1.08","1.1","l","-0.32","6.27","a","1.16","1.16","0","0","0","1.1","1.1","Z"],g=["M","57.43","11.59","L","63.48","0","h","1.83","l","-0.79","15.05","H","63.15","l","0.67","-12.79","L","57.67","14","h","-0.75","L","52.07","2.34","l","-0.64","12.72","H","50","L","50.83","0","H","52.6","Z"],y=["M","69.6","10.2","l","-2.37","4.87","h","-1.5","L","73.09","0","h","1.49","l","5.77","15.05","h","-1.5","L","77","10.2","Z","m","6.86","-1.39","L","73.74","1.73","L","70.28","8.81","Z"],_=["M","82.95","15.07","H","81.57","L","82.35","0","h","10","a","1.94","1.94","0","0","1","1.85","2","L","93.89","7.4","a","2","2","0","0","1","-2","1.92","H","83.25","Z","m","8.43","-7.15","a","1.13","1.13","0","0","0","1.09","-1.09","l","0.35","-4.37","a","1.1","1.1","0","0","0","-1.08","-1.06","H","83.66","l","-0.34","6.53","Z"];function a(e){var t=e.MapOptions.tempCanvas,n=t.getContext("2d");n.save(),t.width=500,t.height=120,t.style.width="500px",t.style.height="120px";var r={x:0,y:0},i={x:0,y:0};n.transform(5,0,0,5,10,10);var a=n.createLinearGradient(5.9,15.07,5.9,0);a.addColorStop(0,"#232323"),a.addColorStop(1,"#585858"),n.fillStyle=a,n.beginPath(),h(c,n,i,r),n.closePath(),(0,l.default)(n).call(n),n.beginPath(),h(d,n,i,r),n.closePath(),(0,l.default)(n).call(n),n.beginPath(),h(f,n,i,r),n.closePath(),(0,l.default)(n).call(n),n.beginPath(),h(v,n,i,r),n.closePath(),(0,l.default)(n).call(n);var o=n.createLinearGradient(57.68,15.07,57.68,0);o.addColorStop(0,"#77bf00"),o.addColorStop(1,"#addc0c"),n.fillStyle=o,n.beginPath(),h(g,n,i,r),n.closePath(),(0,l.default)(n).call(n),n.beginPath(),h(y,n,i,r),n.closePath(),(0,l.default)(n).call(n),n.beginPath(),h(_,n,i,r),n.closePath(),(0,l.default)(n).call(n);var s=t.toDataURL("image/png");return n.restore(),u.FMTextureUtil.createTexture(e.canvas,s)}i.default.f=c,i.default.e=d,i.default.n=f,i.default.g=v,i.default.m=g,i.default.a=y,i.default.p=_,i.default.d=a}],b={},c.m=a,c.c=b,c.d=function(e,t,n){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(t,e){if(1&e&&(t=c(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(c.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)c.d(n,r,function(e){return t[e]}.bind(null,r));return n},c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="",c(c.s=267).default);