fengmap.min.js 1.4 MB

12
  1. /*! Released Version 2.5.0,BUILD 39. Fengmap Javascript SDK, see: https://www.fengmap.com for details */
  2. !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.fengmap=t():e.fengmap=t()}(this,function(){return n=[function(e,t,n){e.exports=n(284)},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 r=n(0);function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r(e,i.key,i)}}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}e.exports=a},function(e,t,n){"use strict";var i=n(114),r={};r[n(21)("toStringTag")]="z",r+""!="[object z]"&&n(49)(Object.prototype,"toString",function(){return"[object "+i(this)+"]"},!0)},function(e,t,n){"use strict";n(361);var i=n(40),r=n(108),a=n(31),o="toString",s=/./[o],l=function(e){n(49)(RegExp.prototype,o,e,!0)};n(25)(function(){return"/a/b"!=s.call({source:"a",flags:"b"})})?l(function(){var e=i(this);return"/".concat(e.source,"/","flags"in e?e.flags:!a&&e instanceof RegExp?r.call(e):void 0)}):s.name!=o&&l(function(){return s.call(this)})},function(e,t,n){e.exports=n(381)},function(e,t,n){var i=n(64),r=n(165);function a(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?r(e):t}e.exports=a},function(t,e,n){var i=n(391),r=n(221);function a(e){return t.exports=a=r?i:function(e){return e.__proto__||i(e)},a(e)}t.exports=a},function(e,t,n){var i=n(78),r=n(397);function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=i(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}e.exports=a},function(e,t,n){var i=n(42).f,r=Function.prototype,a=/^\s*function ([^ (]*)/,o="name";o in r||n(31)&&i(r,o,{configurable:!0,get:function(){try{return(""+this).match(a)[1]}catch(e){return""}}})},function(e){var t=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=t)},function(e,t,n){e.exports=n(349)},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(2)),o=i(n(3)),s=function(){function n(e,t){(0,a.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.needAvoid=!0,this.renderNodeInited=!1,this.tryInit=!1}return(0,o.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}}]),n}(),l=s;t.default=l},function(e,t,n){var m=n(20),v=n(11),g=n(46),y=n(54),_=n(55),x="prototype",b=function(e,t,n){var i,r,a,o=e&b.F,s=e&b.G,l=e&b.S,u=e&b.P,h=e&b.B,c=e&b.W,d=s?v:v[t]||(v[t]={}),f=d[x],p=s?m:l?m[t]:(m[t]||{})[x];for(i in s&&(n=t),n)r=!o&&p&&void 0!==p[i],r&&_(d,i)||(a=r?p[i]:n[i],d[i]=s&&"function"!=typeof p[i]?n[i]:h&&r?g(a,m):c&&p[i]==a?function(i){var e=function(e,t,n){if(this instanceof i){switch(arguments.length){case 0:return new i;case 1:return new i(e);case 2:return new i(e,t)}return new i(e,t,n)}return i.apply(this,arguments)};return e[x]=i[x],e}(a):u&&"function"==typeof a?g(Function.call,a):a,u&&((d.virtual||(d.virtual={}))[i]=a,e&b.R&&f&&!f[i]&&y(f,i,a)))};b.F=1,b.G=2,b.S=4,b.P=8,b.B=16,b.W=32,b.U=64,b.R=128,e.exports=b},function(e,t,n){e.exports=n(291)},function(e,t,n){e.exports=n(359)},function(e,t,n){e.exports=n(310)},function(e,t,n){e.exports=n(307)},function(e,t,n){e.exports=n(379)},function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},function(e,t,n){var i=n(135)("wks"),r=n(88),a=n(33).Symbol,o="function"==typeof a,s=e.exports=function(e){return i[e]||(i[e]=o&&a[e]||(o?a:r)("Symbol."+e))};s.store=i},function(e,t,n){"use strict";var c=n(137),_=n(40),x=n(204),b=n(156),w=n(41),M=n(113),d=n(146),i=n(25),T=Math.min,f=[].push,o="split",p="length",m="lastIndex",E=4294967295,S=!i(function(){RegExp(E,"y")});n(115)("split",2,function(r,a,v,g){var y;return y="c"=="abbc"[o](/(b)*/)[1]||4!="test"[o](/(?:)/,-1)[p]||2!="ab"[o](/(?:ab)*/)[p]||4!="."[o](/(.?)(.?)/)[p]||1<"."[o](/()()/)[p]||""[o](/.?/)[p]?function(e,t){var n=String(this);if(void 0===e&&0===t)return[];if(!c(e))return v.call(n,e,t);for(var i,r,a,o=[],s=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,u=void 0===t?E:t>>>0,h=new RegExp(e.source,s+"g");(i=d.call(h,n))&&(r=h[m],!(l<r&&(o.push(n.slice(l,i.index)),1<i[p]&&i.index<n[p]&&f.apply(o,i.slice(1)),a=i[0][p],l=r,o[p]>=u)));)h[m]===i.index&&h[m]++;return l===n[p]?!a&&h.test("")||o.push(""):o.push(n.slice(l)),o[p]>u?o.slice(0,u):o}:"0"[o](void 0,0)[p]?function(e,t){return void 0===e&&0===t?[]:v.call(this,e,t)}:v,[function(e,t){var n=r(this),i=null==e?void 0:e[a];return void 0!==i?i.call(e,n,t):y.call(String(n),e,t)},function(e,t){var n=g(y,e,this,t,y!==v);if(n.done)return n.value;var i=_(e),r=String(this),a=x(i,RegExp),o=i.unicode,s=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(S?"y":"g"),l=new a(S?i:"^(?:"+i.source+")",s),u=void 0===t?E:t>>>0;if(0===u)return[];if(0===r.length)return null===M(l,r)?[r]:[];for(var h=0,c=0,d=[];c<r.length;){l.lastIndex=S?c:0;var f,p=M(l,S?r:r.slice(c));if(null===p||(f=T(w(l.lastIndex+(S?0:c)),r.length))===h)c=b(r,c,o);else{if(d.push(r.slice(h,c)),d.length===u)return d;for(var m=1;m<=p.length-1;m++)if(d.push(p[m]),d.length===u)return d;c=h=f}}return d.push(r.slice(h)),d}]})},function(e){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){e.exports=n(344)},function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var i=n(143)("wks"),r=n(111),a=n(20).Symbol,o="function"==typeof a,s=e.exports=function(e){return i[e]||(i[e]=o&&a[e]||(o?a:r)("Symbol."+e))};s.store=i},function(e,t,n){var m=n(33),v=n(106),g=n(43),y=n(49),_=n(101),x="prototype",b=function(e,t,n){var i,r,a,o,s=e&b.F,l=e&b.G,u=e&b.S,h=e&b.P,c=e&b.B,d=l?m:u?m[t]||(m[t]={}):(m[t]||{})[x],f=l?v:v[t]||(v[t]={}),p=f[x]||(f[x]={});for(i in l&&(n=t),n)r=!s&&d&&void 0!==d[i],a=(r?d:n)[i],o=c&&r?_(a,m):h&&"function"==typeof a?_(Function.call,a):a,d&&y(d,i,a,e&b.U),f[i]!=a&&g(f,i,o),h&&p[i]!=a&&(p[i]=a)};m.core=v,b.F=1,b.G=2,b.S=4,b.P=8,b.B=16,b.W=32,b.U=64,b.R=128,e.exports=b},function(e,t,n){e.exports=n(341)},function(e,t,n){var i=n(384),r=n(385),a=n(389),o=n(390);function s(e){return i(e)||r(e)||a(e)||o()}e.exports=s},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(34),n(45);var a=i(n(2)),o=i(n(3)),k=1e-5,_=1e-5,V=.001,s=.01,l=function(){function U(){(0,a.default)(this,U)}return(0,o.default)(U,null,[{key:"epsilon",value:function(){return V}},{key:"isZero",value:function(e){return e<k&&-k<e}},{key:"gtZero",value:function(e){return k<e}},{key:"ltZero",value:function(e){return e<-k}},{key:"pointDistanceToLine",value:function(e,t,n,i){var r,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(U.isZero(f))return i.x=t.x,i.y=t.y,r=U.isZero(v)?0:v,r;var g=c/f,y=d/f,_=g*p+y*m;if(!U.gtZero(_))return i.x=t.x,i.y=t.y,r=v,r;if(!U.ltZero(_-f)){var x=u-s,b=h-l,w=Math.sqrt(x*x+b*b);return i.x=n.x,i.y=n.y,r=w,r}var M=a+_*g,T=o+_*y,E=u-M,S=h-T,A=Math.sqrt(E*E+S*S);return i.x=M,i.y=T,r=A,r}},{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],i=e[1],r={x:(n.x+i.x)/2,y:(n.y+i.y)/2},a=Math.atan2(i.y-n.y,i.x-n.x);a-=Math.PI/2;for(var o=3;.5<o;){var s={x:r.x+o*Math.cos(a),y:r.y+o*Math.sin(a)};if(U.isInPolygon(s,e))return s;o/=2}for(a+=Math.PI,o=3;.5<o;){var l={x:r.x+o*Math.cos(a),y:r.y+o*Math.sin(a)};if(U.isInPolygon(l,e))return l;o/=2}return{x:0,y:0}}},{key:"isInPolygon",value:function(e,t){for(var n=!1,i=t.length,r=0,a=i-1;r<i;a=r,++r){var o=t[r].x,s=t[r].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,i){if(e.x<i[0]&&e.x>i[1])return!1;if(e.y<i[2]&&e.y>i[3])return!1;var r=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<r}},{key:"isRectCross",value:function(e,t,n,i){return!(Math.max(e.x,t.x)<Math.min(n.x,i.x)||Math.max(e.y,t.y)<Math.min(n.y,i.y)||Math.max(n.x,i.x)<Math.min(e.x,t.x)||Math.max(n.y,i.y)<Math.min(e.y,t.y))}},{key:"pointIsInRect",value:function(e,t,n,i){return Math.abs(e.x-t.x)<n&&Math.abs(e.y-t.y)<i}},{key:"pointIsInRect1",value:function(e,t,n){var i=Math.min(t.x,n.x),r=Math.max(t.x,n.x),a=Math.min(t.y,n.y),o=Math.max(t.y,n.y);return!(e.x<i||e.x>r||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,i){return!(Math.max(e.x,t.x)<Math.min(n.x,i.x)||Math.max(e.y,t.y)<Math.min(n.y,i.y)||Math.max(n.x,i.x)<Math.min(e.x,t.x)||Math.max(n.y,i.y)<Math.min(e.y,t.y)||U.cross(n,t,e)*U.cross(t,i,e)<0||U.cross(e,i,n)*U.cross(i,t,n)<0)}},{key:"calcCrossPoint",value:function(e,t,n,i,r){return 1!=U.isLineSegmentCross(e,t,n,i)?0:(a=(i.x-n.x)*(e.y-t.y)-(t.x-e.x)*(n.y-i.y),o=(e.y-n.y)*(t.x-e.x)*(i.x-n.x)+n.x*(i.y-n.y)*(t.x-e.x)-e.x*(t.y-e.y)*(i.x-n.x),r.x=o/a,a=(e.x-t.x)*(i.y-n.y)-(t.y-e.y)*(n.x-i.x),o=t.y*(e.x-t.x)*(i.y-n.y)+(i.x-t.x)*(i.y-n.y)*(e.y-t.y)-i.y*(n.x-i.x)*(t.y-e.y),r.y=o/a,1);var a,o}},{key:"pointInPolygon2d",value:function(e,t,n){for(var i=!1,r=null,a=null,o=0;o<n;o++)r=e[o],a=e[(o+1)%n],(r.y<t.y&&a.y>=t.y||a.y<t.y&&r.y>=t.y)&&(r.x<=t.x||a.x<=t.x)&&r.x+(t.y-r.y)/(a.y-r.y)*(a.x-r.x)<t.x&&(i=!i);return i}},{key:"pointInPolygon2d1",value:function(e,t,n){for(var i=0,r=null,a=null,o=null,s=0;s<n;s++)if(r=e[s],a=e[(s+1)%n],(r.y<t.y&&a.y>=t.y||a.y<t.y&&r.y>=t.y)&&(r.x<=t.x||a.x<=t.x)){if(o=r.x+(t.y-r.y)/(a.y-r.y)*(a.x-r.x),Math.abs(o-t.x)<=V)return 2;o<t.x&&(i=!i)}return i}},{key:"pointInPolygonVector2d",value:function(e,t,n){for(var i=!1,r=null,a=null,o=0,s=n/2,l=0;l<s;l++)o=2*l,r={x:e[o],y:e[o+1]},a={x:e[(o+2)%n],y:e[(o+3)%n]},(r.y<t.y&&a.y>=t.y||a.y<t.y&&r.y>=t.y)&&(r.x<=t.x||a.x<=t.x)&&r.x+(t.y-r.y)/(a.y-r.y)*(a.x-r.x)<t.x&&(i=!i);return i}},{key:"pointToSegmentDistance",value:function(e,t,n){var i=e.x,r=e.y,a=t.x,o=t.y,s=n.x,l=n.y,u=(s-a)*(i-a)+(l-o)*(r-o);if(u<=0)return Math.sqrt((i-a)*(i-a)+(r-o)*(r-o));var h=(s-a)*(s-a)+(l-o)*(l-o);if(h<=u)return Math.sqrt((i-s)*(i-s)+(r-l)*(r-l));var c=u/h,d=a+(s-a)*c,f=o+(l-o)*c;return Math.sqrt((i-d)*(i-d)+(f-r)*(f-r))}},{key:"pointToPolygon2d",value:function(e,t,n){for(var i=null,r=null,a=Number.MAX_VALUE,o=0;o<n;o++){i=e[o],r=e[(o+1)%n];var s=U.pointToSegmentDistance(t,i,r);s<a&&(a=s)}return a}},{key:"lineInCircle2d",value:function(e,t,n,i,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 a=i*i,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(U.isZero(p))return!!U.isZero(g)||g<a;p=Math.sqrt(p);var y=d/p,_=f/p,x=y*m+_*v;if(!U.gtZero(x))return g<a;if(!U.ltZero(x-p)){var b=h-l,w=c-u,M=b*b+w*w;return M<a}var T=o+x*y,E=s+x*_,S=h-T,A=c-E,L=S*S+A*A;return L<a}},{key:"lineInPolygon2d",value:function(e,t,n,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 r=n.length;if(U.pointInPolygon2d(n,e,r))return!0;if(U.pointInPolygon2d(n,t,r))return!0;for(var a=0;a<r;a++){var o=(a+1)%r;if(U.isLineSegmentCross(e,t,n[a],n[o]))return!0}return!1}},{key:"calcLineCircleCrossPoints2d",value:function(e,t,n,i,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 a={isContain:!1,crossPoints:[]},o=i*i,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,b=_*_+x*x;if(U.isZero(m))return(U.isZero(y)||y<o)&&(a.isContain=!0,a.crossPoints=[e,t]),a;if(y<o&&b<o)return a.isContain=!0,a.crossPoints=[e,t],a;var w=Math.sqrt(m),M=f/w,T=p/w,E=v*M+g*T,S=E*E,A=v*v+g*g;if(o-A+S<0)return null;var L=Math.sqrt(o-A+S),I=E-L;return-k<+I&&I-w<k&&a.crossPoints.push({x:s+I*M,y:l+I*T}),I=E+L,-k<+I&&I-w<k&&a.crossPoints.push({x:s+I*M,y:l+I*T}),a}},{key:"calcLinePolygonCrossPoints2d",value:function(e,t,n,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 r={containType:0,crossPoints:[]},a=n.length;U.pointInPolygon2d(n,e,a)&&(r.containType|=1),U.pointInPolygon2d(n,t,a)&&(r.containType|=2);for(var o=[],s=0;s<a;s++){var l=(s+1)%a,u={};if(U.calcCrossPoint(e,t,n[s],n[l],u)){var h=u.x-e.x,c=u.y-e.y;o.push({dis2:h*h+c*c,point:u})}}if(0==o.length)return null;o.sort(function(e,t){return t.dis2-e.dis2});for(var d=0;d<o.length;d++)r.crossPoints.push(o[d].point);return r}},{key:"calcCenterOfGravityPoint",value:function(e,t){for(var n=0,i=0,r=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,i+=l*(o.x+s.x)/3,r+=l*(o.y+s.y)/3}return i/=n,r/=n,{x:i,y:r}}},{key:"calcPolygonArea2d",value:function(e){var t=e.length;if(t<3)return 0;for(var n=0,i=0;i<t;++i){var r=e[i],a=e[(i+1)%t];n+=r.x*a.y-r.y*a.x}return Math.abs(n/2)}},{key:"quickRayIntersect",value:function(e,t,n,i,r){var a=Math.min(n.x,i.x),o=Math.max(n.x,i.x),s=Math.min(n.y,i.y),l=Math.max(n.y,i.y),u=e.x,h=e.y,c=n.x,d=n.y,f=i.x,p=i.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 r.y=v,r.x=u,!(v<h||!U.pointIsInRect1(r,n,i))}if(270==t){if(e.x<a||e.x>o)return!1;var g=(p-d)/(f-c),y=g*(u-c)+d;return r.y=y,r.x=u,!(h<y||!U.pointIsInRect1(r,n,i))}if(270!=t&&90!=t&&o-a<V){var _=a,x=Math.tan(t/180*Math.PI),b=x*(_-u)+h;if(r.y=b,r.x=_,U.pointIsInRect1(r,n,i)){var w=_-u,M=b-h,T=w/Math.sqrt(w*w+M*M),E=Math.cos(t/180*Math.PI);return 0<T*E}}if(l-s<=1e-6){var S=s,A=Math.tan(t/180*Math.PI),L=1/A*(S-h)+u;if(r.x=L,r.y=S,U.pointIsInRect1(r,n,i)){var I=L-u,k=S-h,R=I/Math.sqrt(I*I+k*k),N=Math.cos(t/180*Math.PI);return 0<R*N}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(r.x=D,r.y=O,U.pointIsInRect1(r,n,i)){var F=D-u,B=O-h,G=F/Math.sqrt(F*F+B*B),z=Math.cos(t/180*Math.PI);return 0<G*z}return!1}},{key:"calcFootOfUpright",value:function(e,t,n,i){var r=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 i.x=h,i.y=u,o<=u&&u<=s;if(Math.abs(c-f)<_)return i.x=l,i.y=c,r<=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 i.x=g,i.y=y,!!U.pointIsInRect1(i,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},i={x:t.x,y:t.y,z:0},r=U.vectorCross(n,i),a=U.vector2DDot(e,t),o=Math.acos(a/(U.vector2DLength(e)*U.vector2DLength(t)));return 0<r.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)}}]),U}(),u=l;t.default=u},function(e,t,n){e.exports=!n(25)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(28));n(22);var o=i(n(2)),s=i(n(3)),l=function(){function e(){(0,o.default)(this,e)}return(0,s.default)(e,null,[{key:"toColor",value:function(e){if("number"==typeof e)return e;var t=e.split(",");return 3<=t.length?(0,a.default)(t[0])<<16|(0,a.default)(t[1])<<8|(0,a.default)(t[2]):(console.error("color format error",e),0)}},{key:"toRgba",value:function(e){if("number"==typeof e)return"rgba("+(0,a.default)(255*new fm.Color(e).r)+","+(0,a.default)(255*new fm.Color(e).g)+","+(0,a.default)(255*new fm.Color(e).b)+",1)";var t=e.split(",");return 3<=t.length?"rgba("+(0,a.default)(t[0])+","+(0,a.default)(t[1])+","+(0,a.default)(t[2])+",1)":e}},{key:"bindEvent",value:function(e,a,t,o){e.addEventListener(t,function(e){var t=e||window.event,n=t.target||t.srcElement,i=t.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});n!==i;){if(n.matches(a)){var r=n;o.call(r,t)}n=n.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=e.indexOf(t);-1<n&&e.splice(n,1)}},{key:"scrollTopAnFun",value:function(){var m,v=!1;return function t(n){var i=n.el,r=n.to,e=n.form,a=(n.time,r<e?"up":"bottom"),o=e<r?r-e:r==e?0:e-r,s=10,l=o/s,u=0,h=function(e){var t=e.val,n=e.nbak,i=e.n,r=e.elTop;return"up"==a?r+(n-i)*t:r-(n-i)*t};function c(){m=0,window.setTimeout(function(){var e=Object(n,{to:i.scrollTop});v=!1,t(e)},s+1)}var d=function(){v=!1,m=!1,0==e&&(i.scrollTop=0)},f=function e(){if(m--,m<=0)d();else{var t=function(){!1!==m&&(u=h({val:s,nbak:l,n:m,elTop:r,VDIRECTIONE:a}),u&&(i.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}(),u=l;t.default=u},function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},function(e,t,n){"use strict";var i=n(27),r=n(131),a=n(51),o=n(25),s=[].sort,l=[1,2,3];i(i.P+i.F*(o(function(){l.sort(void 0)})||!o(function(){l.sort(null)})||!n(327)(s)),"Array",{sort:function(e){return void 0===e?s.call(a(this)):s.call(a(this),r(e))}})},function(e,t,n){var i=n(23);e.exports=function(e){if(!i(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){e.exports=!n(47)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){"use strict";var i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var r={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,ALL:65535,ELEMENT:100},a=r;t.default=a},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var s=i(n(19)),l=i(n(18)),u=i(n(17)),a=i(n(15));n(5),n(4),n(79),n(10);var I=i(n(24));n(22);var _=i(n(77)),k=i(n(12)),o=i(n(2)),h=i(n(3)),c=i(n(168)),R=i(n(59)),d=i(n(417)),m=i(n(235)),v=i(n(419)),f=i(n(421)),p=i(n(431)),N=i(n(32)),M=i(n(95)),x=i(n(66));function P(e){if(void 0===u.default||null==e[l.default]){if((0,k.default)(e)||(e=g(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}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 i,r,a=!0,o=!1;return{s:function(){i=(0,s.default)(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw r}}}}function g(e,t){if(e){if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var b=function(){function n(e,t){(0,o.default)(this,n),this._scenes={},this._materialManager=new d.default(e.font),this._raycaster=new fm.Raycaster,this._focusAlphaMode=e._focusAlphaMode,this._focusAlpha=e._focusAlpha,this._map=t,this._externalModelUrl=e.mapServerURL+"/models/",this._externalLoader=new f.default(this._externalModelUrl,"fengmap"==e.mapServerURL,e.key),this._dynamicLoader=new p.default,this._externalLoader.setLoadedBack(function(){t.dispatchEvent({type:"externalLoaded"}),t.dispatchEvent({type:"gltfLoaded"}),t.checkNode(),t.setRenderList()})}return(0,h.default)(n,[{key:"createCompassNode",value:function(e,t,n,i,r){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?i:void 0,u=4<arguments.length?r: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,i){var r=this._scenes[e];if(!r)return[];var a=r.getGroupsModels(t);this._raycaster.setFromCamera(n,i);var o=this._raycaster.intersectObjects(a);return o}},{key:"getExternalModels",value:function(e,t,n,i){var r=this._scenes[e];if(!r)return[];var a=r.getGroupsExternalModels(t);this._raycaster.setFromCamera(n,i);var o=this._raycaster.intersectObjects(a);return o}},{key:"getModelExternal",value:function(e,t,n,i){var r=this._scenes[e];if(!r)return[];var a=r.getGroupsModels(t),o=r.getGroupsExternalModels(t),s=a.concat(o);this._raycaster.setFromCamera(n,i);var l=this._raycaster.intersectObjects(s);return l}},{key:"getMarkers",value:function(e,t,n,i){var r=this._scenes[e];if(!r)return[];for(var a=[],o=0;o<t.length;o++)for(var s=r.getAllImageMarker(t[o]),l=0;l<s.length;l++)a.push(s[l]);this._raycaster.setFromCamera(n,i),this._raycaster.perspective="PerspectiveCamera"===i.type;var u=this._raycaster.intersectObjects(a);return u}},{key:"getNode",value:function(e,t,n,i,r){var a=this._scenes[e];if(!a)return[];var o=a.getNodesExceptFacility(t,r),s=a.getDynnodes(r,t);this._raycaster.setFromCamera(n,i),this._raycaster.perspective="PerspectiveCamera"===i.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,i,r){var a=this._scenes[e];if(!a)return[];var o=a.getFacilityByFilter(t,r);this._raycaster.setFromCamera(n,i),this._raycaster.perspective="PerspectiveCamera"===i.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=[];for(var t in this._scenes){var n=this._scenes[t].getRenderGroup();e.push(n)}return e}}},{key:"conformatScene",value:function(e,t,n){var i=new c.default(t,e,this);i.parent=this,this._scenes[t+""]=i,this._scenes[t+""].theme=n}},{key:"checkMaterialAlpha",value:function(e,t){if(e)if(this._focusAlphaMode&&t!==this._map.currentFocusGroup&&this._map.otherFocus.indexOf(t)<0){if((0,k.default)(e.material)){var n,i=P(e.material);try{for(i.s();!(n=i.n()).done;){var r=n.value;r.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 a=0;a<e.material.length;a++)e.material[a].opacity!==this._focusAlpha&&(e.material[a].opacity=this._focusAlpha)}else if((0,k.default)(e.material)){var o,s=P(e.material);try{for(s.s();!(o=s.n()).done;){var l=o.value;"number"==typeof l.userData.opacity&&(l.opacity=l.userData.opacity)}}catch(e){s.e(e)}finally{s.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;M.default[this._map.uuid].bbox=this._scenes[""+c].bboxTh,M.default[this._map.uuid].bbox.uuid=this._map.uuid;var n,i=this._scenes[""+c].groups,r=(0,_.default)(i),a=P(r);try{var o=function(){var e=n.value,l=i[e];if(t.indexOf(l.eid)<=-1)return l.visible=!1,"continue";l.visible=!0,l.traverseByAlias(["extent","model","label","facility","externalModel"],function(i,e){var t=i.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":i.renderNodeInited?d.checkMaterialAlpha(i.renderNode,l.eid):d.createExtent(i,c,l.eid);break;case"model":i.renderNodeInited?(d.checkMaterialAlpha(i.renderNode,l.eid),d.checkMaterialAlpha(i.line,l.eid)):d.createModel(i,c,l.eid);break;case"label":i.renderNodeInited?d.checkMaterialAlpha(i._renderNode,l.eid):i.tryInit||d.createLabel(i,c,y,l.eid);break;case"facility":i.renderNodeInited?d.checkMaterialAlpha(i._renderNode,l.eid):d.createFacility(i,c,l.eid);break;case"externalModel":if(i.renderNodeInited)d.checkMaterialAlpha(i._renderNode,l.eid);else{var r=i.bdata,a=i.gdata,o=f.getExteralModelTheme(r.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,r,o,i,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,r,o,i,p,m,l.height,v,g,"js"!==n)},r.fid):d._externalLoader.addWaitingBacks(o.normalid,function(e,t,n){d.createExterModel(e,t,a,r,o,i,p,m,l.height,v,g,"js"!==n)},r.fid),s.isLoading||d._externalLoader.load(o.normalid))}}i.checkByFrustum(u)}else i.visible=!1})};for(a.s();!(n=a.n()).done;)o()}catch(e){a.e(e)}finally{a.f()}}}},{key:"createModel",value:function(e,t,n){var i,r=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&&(i=l.getStoreApplyTheme(h.fid)),i=i||l.getModelTheme(h);var c=null;c=1===this._map.dataManager.file_ver?R.default.convertGeo2Geometry(u.geo):R.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(i);if(e._geometry=f,e.initMesh(p,new fm.Vector3(r,a+d,0)),e.x=o,e.y=s,e.height=d,e.currHeight=d,this.checkMaterialAlpha(e.renderNode,n),e.initLine(this._materialManager.createLineMaterial(i),u.height),this.checkMaterialAlpha(e.line,n),i.image&&i.sizes){var m=i.sizes.split(",");e.addStoreImage({image:i.image?this._map.MapOptions.mapThemeURL+"/"+this._map.MapOptions.defaultThemeName+"/"+i.image:"",angle:i.angle?i.angle:0,size:[(0,I.default)(m[0]),(0,I.default)(m[1])],offset:i.offset?i.offset:[0,0]})}}},{key:"createExtent",value:function(e,t,n){var i=e.gdata,r=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?R.default.convertGeo2Geometry(i.geo):R.default.convertArray2Geometry(i.idxs,i.pts);var h=this.createGeometry(u,i.height?i.height:1,t);e._geometry=h,e.x=s,e.y=l;var c=this._materialManager.createNormalMaterial();e.initMesh(c,new fm.Vector3(a,o,0),r.floorColor,r.floorOpacity),this.checkMaterialAlpha(e.renderNode,n)}},{key:"createLabel",value:function(e,t,n,i){var r=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?R.default.convertGeo2Points(r.geo):R.default.convertArrayPoints(r.idxs,r.pts);var d=-1===r.height?2.2:r.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===x.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=h.getLabelTheme(a.type);if(g&&(e.theme=g,e.size=1.4*g.fontsize,v)){var y=this._materialManager.createLabelMaterial(v,g);e.initSprite(y,(new fm.Vector3).copy(f)),this.checkMaterialAlpha(e._renderNode,i),e.setSize()}}},{key:"createFacility",value:function(e,t,n){var i=e.gdata,r=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?R.default.convertGeo2Points(i.geo):R.default.convertArrayPoints(i.idxs,i.pts);var c=-1===i.height?2.2:i.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(r.type),p=this._materialManager.createPoiMaterial(f);e.x=h.vertices[0].x,e.y=h.vertices[0].y,e.height=c,e.pos=d,f.height&&(e.size=f.height),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 i=0;i<e.biz[n].extentLayer.length;i++)t(e.geo[n].extentLayer[i],"extentLayer",e.biz[n].extentLayer[i]);for(var r=0;r<e.biz[n].labelLayer.length;r++)t(e.geo[n].labelLayer[r],"labelLayer",e.biz[n].labelLayer[r]);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 i=e.vertices;if(6<=i.length){var r,a=new fm.Shape,o=this._scenes[""+n].mapcenter.x,s=this._scenes[""+n].mapcenter.y;if(e.holes&&0<e.holes.length){var l={};for(var u in e.holes)for(var h=e.holes[u],c=0;c<h.length;c+=2){var d=h[c]+"-"+h[c+1];l[d]=!0}for(var u in this.forEachVertForShape(i,function(e,t,n){e?a.moveTo(t-o,n-s):l[t+"-"+n]||a.lineTo(t-o,n-s)}),e.holes){h=e.holes[u];var f=new fm.Path;this.forEachVertForShape(h,function(e,t,n){e?f.moveTo(t-o,n-s):f.lineTo(t-o,n-s)}),a.holes.push(f)}}else this.forEachVertForShape(i,function(e,t,n){e?a.moveTo(t-o,n-s):a.lineTo(t-o,n-s)});r=0==t?new fm.ShapeGeometry(a):new fm.ExtrudeGeometry(a,{depth:t,bevelEnabled:!1});var p=M.default[this._map.uuid].bbox.min.x,m=M.default[this._map.uuid].bbox.min.y,v=M.default[this._map.uuid].bbox.max.x-M.default[this._map.uuid].bbox.min.x,g=M.default[this._map.uuid].bbox.max.y-M.default[this._map.uuid].bbox.min.y,y=r.faces,_=y.length;for(u=0;u<_;u++){var x=r.vertices[y[u].a],b=r.vertices[y[u].b],w=r.vertices[y[u].c];r.faceVertexUvs[0][u][0].x=(x.x-p)/v,r.faceVertexUvs[0][u][0].y=(x.y-m)/g,r.faceVertexUvs[0][u][1].x=(b.x-p)/v,r.faceVertexUvs[0][u][1].y=(b.y-m)/g,r.faceVertexUvs[0][u][2].x=(w.x-p)/v,r.faceVertexUvs[0][u][2].y=(w.y-m)/g}return r.computeBoundingSphere(),{geometry:r,shape:a}}return null}},{key:"createExterModel",value:function(e,t,n,i,r,a,o,s,l,u,h,c){var d=R.default.convertGeo2Points(n.geo),f=new fm.Vector3(d.vertices[0].x-u,-d.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 p=e.scene;p.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(N.default.toColor(r.color)),e.material[t].needsUpdate=!0,e.material[t].userData.opacity=e.material[t].opacity;else e.material=e.material.clone(),e.material.needsUpdate=!0,e.material.userData.opacity=e.material.opacity});var m=r.scale.split(","),v=r.rotate.split(","),g=r.translate.split(","),y=new fm.Vector3;if(y.set((0,I.default)(v[0])*fm.Math.DEG2RAD,(0,I.default)(v[2])*fm.Math.DEG2RAD,(0,I.default)(v[1])*fm.Math.DEG2RAD),p.rotation.setFromVector3(y,"YXZ"),p.scale.set((0,I.default)(m[0]),(0,I.default)(m[2]),(0,I.default)(m[1])),f.add(new fm.Vector3((0,I.default)(g[0]),(0,I.default)(g[2]),(0,I.default)(g[1]))),p.position.set(f.x,f.y,f.z),a.renderNode=p,a.x=d.vertices[0].x+(0,I.default)(g[0]),a.y=d.vertices[0].y+(0,I.default)(g[1]),a.height=-1===n.height?2.2:n.height,!a._renderNode)return;a._renderNode.frustumCulled=!1,a.renderNodeInited=!0}else{if((0,k.default)(t)){var _,x=P(t);try{for(x.s();!(_=x.n()).done;){var b=_.value;b.color=new fm.Color(N.default.toColor(r.color)),b.transparent=!0,b.map&&(b.map.wrapS=fm.RepeatWrapping,b.map.wrapT=fm.RepeatWrapping,b.color.setScalar(1)),b.userData.opacity=b.opacity}}catch(e){x.e(e)}finally{x.f()}}else t.color=new fm.Color(N.default.toColor(r.color)),t.transparent=!0,t.map&&(t.map.wrapS=fm.RepeatWrapping,t.map.wrapT=fm.RepeatWrapping,t.color.setScalar(1)),t.userData.opacity=t.opacity;var w=[];if(void 0!==t.length)for(var M=0;M<t.length;M++)w.push(t[M].clone());else w.push(t.clone());var T=new fm.Mesh(e,w),E=r.scale.split(","),S=r.rotate.split(","),A=r.translate.split(",");T.scale.set((0,I.default)(E[0]),(0,I.default)(E[2]),(0,I.default)(E[1]));var L=new fm.Vector3;if(L.set((0,I.default)(S[0])*fm.Math.DEG2RAD,(0,I.default)(S[2])*fm.Math.DEG2RAD,(0,I.default)(S[1])*fm.Math.DEG2RAD),T.rotation.setFromVector3(L,"YXZ"),f.add(new fm.Vector3((0,I.default)(A[0]),(0,I.default)(A[2]),(0,I.default)(A[1]))),T.position.set(f.x,f.y,f.z),a.renderNode=T,a.x=d.vertices[0].x+(0,I.default)(A[0]),a.y=d.vertices[0].y+(0,I.default)(A[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,i=P(e.children);try{for(i.s();!(n=i.n()).done;){var r=n.value;this.findGltfMesh(r,t)}}catch(e){i.e(e)}finally{i.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],i=n.center,r=0,a=0;a<e.length;a++)r+=e[a]*n.space;return new fm.Vector3(i.x,i.y+r/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}(),w=b;t.default=w},function(e,t,n){var i=n(35),r=n(182),a=n(130),o=Object.defineProperty;t.f=n(36)?Object.defineProperty:function(e,t,n){if(i(e),t=a(t,!0),i(n),r)try{return o(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){var i=n(48);e.exports=function(e){if(!i(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var i=n(58),r=Math.min;e.exports=function(e){return 0<e?r(i(e),9007199254740991):0}},function(e,t,n){var i=n(40),r=n(185),a=n(87),o=Object.defineProperty;t.f=n(31)?Object.defineProperty:function(e,t,n){if(i(e),t=a(t,!0),i(n),r)try{return o(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){var i=n(42),r=n(102);e.exports=n(31)?function(e,t,n){return i.f(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){"use strict";n(121)("sub",function(e){return function(){return e(this,"sub","","")}})},function(e,t,n){"use strict";var i=n(33),r=n(61),a=n(86),o=n(183),h=n(87),s=n(25),l=n(104).f,u=n(132).f,c=n(42).f,d=n(370).trim,f="Number",p=i[f],m=p,v=p.prototype,g=a(n(148)(v))==f,y="trim"in String.prototype,_=function(e){var t=h(e,!1);if("string"==typeof t&&2<t.length){t=y?t.trim():d(t,3);var n,i,r,a=t.charCodeAt(0);if(43===a||45===a){if(n=t.charCodeAt(2),88===n||120===n)return NaN}else if(48===a){switch(t.charCodeAt(1)){case 66:case 98:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+t}for(var o,s=t.slice(2),l=0,u=s.length;l<u;l++)if(o=s.charCodeAt(l),o<48||r<o)return NaN;return parseInt(s,i)}}return+t};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof p&&(g?s(function(){v.valueOf.call(n)}):a(n)!=f)?o(new m(_(t)),n,p):_(t)};for(var x,b=n(31)?l(m):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),w=0;b.length>w;w++)r(m,x=b[w])&&!r(p,x)&&c(p,x,u(m,x));p.prototype=v,v.constructor=p,n(49)(i,f,p)}},function(e,t,n){var a=n(60);e.exports=function(i,r,e){if(a(i),void 0===r)return i;switch(e){case 1:return function(e){return i.call(r,e)};case 2:return function(e,t){return i.call(r,e,t)};case 3:return function(e,t,n){return i.call(r,e,t,n)}}return function(){return i.apply(r,arguments)}}},function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var a=n(33),o=n(43),s=n(61),l=n(88)("src"),i=n(290),r="toString",u=(""+i).split(r);n(106).inspectSource=function(e){return i.call(e)},(e.exports=function(e,t,n,i){var r="function"==typeof n;r&&(s(n,"name")||o(n,"name",t)),e[t]!==n&&(r&&(s(n,l)||o(n,l,e[t]?""+e[t]:u.join(String(t)))),e===a?e[t]=n:i?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)))})(Function.prototype,r,function(){return"function"==typeof this&&this[l]||i.call(this)})},function(e,t,n){"use strict";var i=n(147),r=n(300),a=n(72),o=n(103);e.exports=n(198)(Array,"Array",function(e,t){this._t=o(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,r(1)):r(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),a.Arguments=a.Array,i("keys"),i("values"),i("entries")},function(e,t,n){var i=n(57);e.exports=function(e){return Object(i(e))}},function(e,t,n){"use strict";if(n(31)){var _=n(107),x=n(33),b=n(25),w=n(27),M=n(209),i=n(331),p=n(101),T=n(211),r=n(102),E=n(43),a=n(210),o=n(58),S=n(41),A=n(212),s=n(105),l=n(87),u=n(61),L=n(114),I=n(48),m=n(51),v=n(332),k=n(148),R=n(199),N=n(104).f,g=n(333),h=n(88),c=n(21),d=n(213),f=n(188),y=n(204),P=n(50),C=n(72),D=n(337),O=n(189),F=n(158),B=n(338),G=n(42),z=n(132),U=G.f,V=z.f,H=x.RangeError,j=x.TypeError,W=x.Uint8Array,Y="ArrayBuffer",q="Shared"+Y,X="BYTES_PER_ELEMENT",Z="prototype",J=Array[Z],K=i.ArrayBuffer,Q=i.DataView,$=d(0),ee=d(2),te=d(3),ne=d(4),ie=d(5),re=d(6),ae=f(!0),oe=f(!1),se=P.values,le=P.keys,ue=P.entries,he=J.lastIndexOf,ce=J.reduce,de=J.reduceRight,fe=J.join,pe=J.sort,me=J.slice,ve=J.toString,ge=J.toLocaleString,ye=c("iterator"),_e=c("toStringTag"),xe=h("typed_constructor"),be=h("def_constructor"),we=M.CONSTR,Me=M.TYPED,Te=M.VIEW,Ee="Wrong length!",Se=d(1,function(e,t){return Re(y(e,e[be]),t)}),Ae=b(function(){return 1===new W(new Uint16Array([1]).buffer)[0]}),Le=!!W&&!!W[Z].set&&b(function(){new W(1).set({})}),Ie=function(e,t){var n=o(e);if(n<0||n%t)throw H("Wrong offset!");return n},ke=function(e){if(I(e)&&Me in e)return e;throw j(e+" is not a typed array!")},Re=function(e,t){if(!(I(e)&&xe in e))throw j("It is not a typed array constructor!");return new e(t)},Ne=function(e,t){return Pe(y(e,e[be]),t)},Pe=function(e,t){for(var n=0,i=t.length,r=Re(e,i);n<i;)r[n]=t[n++];return r},Ce=function(e,t,n){U(e,t,{get:function(){return this._d[n]}})},De=function(e,t,n){var i,r,a,o,s,l,u=m(e),h=arguments.length,c=1<h?t:void 0,d=void 0!==c,f=g(u);if(null!=f&&!v(f)){for(l=f.call(u),a=[],i=0;!(s=l.next()).done;i++)a.push(s.value);u=a}for(d&&2<h&&(c=p(c,n,2)),i=0,r=S(u.length),o=Re(this,r);i<r;i++)o[i]=d?c(u[i],i):u[i];return o},Oe=function(){for(var e=0,t=arguments.length,n=Re(this,t);e<t;)n[e]=arguments[e++];return n},Fe=!!W&&b(function(){ge.call(new W(1))}),Be=function(){return ge.apply(Fe?me.call(ke(this)):ke(this),arguments)},Ge={copyWithin:function(e,t,n){return B.call(ke(this),e,t,2<arguments.length?n:void 0)},every:function(e,t){return ne(ke(this),e,1<arguments.length?t:void 0)},fill:function(){return F.apply(ke(this),arguments)},filter:function(e,t){return Ne(this,ee(ke(this),e,1<arguments.length?t:void 0))},find:function(e,t){return ie(ke(this),e,1<arguments.length?t:void 0)},findIndex:function(e,t){return re(ke(this),e,1<arguments.length?t:void 0)},forEach:function(e,t){$(ke(this),e,1<arguments.length?t:void 0)},indexOf:function(e,t){return oe(ke(this),e,1<arguments.length?t:void 0)},includes:function(e,t){return ae(ke(this),e,1<arguments.length?t:void 0)},join:function(){return fe.apply(ke(this),arguments)},lastIndexOf:function(){return he.apply(ke(this),arguments)},map:function(e,t){return Se(ke(this),e,1<arguments.length?t:void 0)},reduce:function(){return ce.apply(ke(this),arguments)},reduceRight:function(){return de.apply(ke(this),arguments)},reverse:function(){for(var e,t=this,n=ke(t).length,i=Math.floor(n/2),r=0;r<i;)e=t[r],t[r++]=t[--n],t[n]=e;return t},some:function(e,t){return te(ke(this),e,1<arguments.length?t:void 0)},sort:function(e){return pe.call(ke(this),e)},subarray:function(e,t){var n=ke(this),i=n.length,r=s(e,i);return new(y(n,n[be]))(n.buffer,n.byteOffset+r*n.BYTES_PER_ELEMENT,S((void 0===t?i:s(t,i))-r))}},ze=function(e,t){return Ne(this,me.call(ke(this),e,t))},Ue=function(e,t){ke(this);var n=Ie(t,1),i=this.length,r=m(e),a=S(r.length),o=0;if(i<a+n)throw H(Ee);for(;o<a;)this[n+o]=r[o++]},Ve={entries:function(){return ue.call(ke(this))},keys:function(){return le.call(ke(this))},values:function(){return se.call(ke(this))}},He=function(e,t){return I(e)&&e[Me]&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},je=function(e,t){return He(e,t=l(t,!0))?r(2,e[t]):V(e,t)},We=function(e,t,n){return!(He(e,t=l(t,!0))&&I(n)&&u(n,"value"))||u(n,"get")||u(n,"set")||n.configurable||u(n,"writable")&&!n.writable||u(n,"enumerable")&&!n.enumerable?U(e,t,n):(e[t]=n.value,e)};we||(z.f=je,G.f=We),w(w.S+w.F*!we,"Object",{getOwnPropertyDescriptor:je,defineProperty:We}),b(function(){ve.call({})})&&(ve=ge=function(){return fe.call(this)});var Ye=a({},Ge);a(Ye,Ve),E(Ye,ye,Ve.values),a(Ye,{slice:ze,set:Ue,constructor:function(){},toString:ve,toLocaleString:Be}),Ce(Ye,"buffer","b"),Ce(Ye,"byteOffset","o"),Ce(Ye,"byteLength","l"),Ce(Ye,"length","e"),U(Ye,_e,{get:function(){return this[Me]}}),e.exports=function(e,c,t,r){r=!!r;var d=e+(r?"Clamped":"")+"Array",i="get"+e,a="set"+e,f=x[d],o=f||{},n=f&&R(f),s=!f||!M.ABV,l={},u=f&&f[Z],h=function(e,t){var n=e._d;return n.v[i](t*c+n.o,Ae)},p=function(e,t,n){var i=e._d;r&&(n=(n=Math.round(n))<0?0:255<n?255:255&n),i.v[a](t*c+i.o,n,Ae)},m=function(e,t){U(e,t,{get:function(){return h(this,t)},set:function(e){return p(this,t,e)},enumerable:!0})};s?(f=t(function(e,t,n,i){T(e,f,d,"_d");var r,a,o,s,l=0,u=0;if(I(t)){if(!(t instanceof K||(s=L(t))==Y||s==q))return Me in t?Pe(f,t):De.call(f,t);r=t,u=Ie(n,c);var h=t.byteLength;if(void 0===i){if(h%c)throw H(Ee);if(a=h-u,a<0)throw H(Ee)}else if(a=S(i)*c,h<a+u)throw H(Ee);o=a/c}else o=A(t),a=o*c,r=new K(a);for(E(e,"_d",{b:r,o:u,l:a,e:o,v:new Q(r)});l<o;)m(e,l++)}),u=f[Z]=k(Ye),E(u,"constructor",f)):b(function(){f(1)})&&b(function(){new f(-1)})&&D(function(e){new f,new f(null),new f(1.5),new f(e)},!0)||(f=t(function(e,t,n,i){var r;return T(e,f,d),I(t)?t instanceof K||(r=L(t))==Y||r==q?void 0!==i?new o(t,Ie(n,c),i):void 0!==n?new o(t,Ie(n,c)):new o(t):Me in t?Pe(f,t):De.call(f,t):new o(A(t))}),$(n!==Function.prototype?N(o).concat(N(n)):N(o),function(e){e in f||E(f,e,o[e])}),f[Z]=u,_||(u.constructor=f));var v=u[ye],g=!!v&&("values"==v.name||null==v.name),y=Ve.values;E(f,xe,!0),E(u,Me,d),E(u,Te,!0),E(u,be,f),(r?new f(1)[_e]==d:_e in u)||U(u,_e,{get:function(){return d}}),l[d]=f,w(w.G+w.W+w.F*(f!=o),l),w(w.S,d,{BYTES_PER_ELEMENT:c}),w(w.S+w.F*b(function(){o.of.call(f,1)}),d,{from:De,of:Oe}),X in u||E(u,X,c),w(w.P,d,Ge),O(d),w(w.P+w.F*Le,d,{set:Ue}),w(w.P+w.F*!g,d,Ve),_||u.toString==ve||(u.toString=ve),w(w.P+w.F*b(function(){new f(1).slice()}),d,{slice:ze}),w(w.P+w.F*(b(function(){return[1,2].toLocaleString()!=new f([1,2]).toLocaleString()})||!b(function(){u.toLocaleString.call([1,2])})),d,{toLocaleString:Be}),C[d]=g?v:y,_||g||E(u,ye,y)}}else e.exports=function(){}},function(e,t,n){n(52)("Float32",4,function(i){return function(e,t,n){return i(this,e,t,n)}})},function(e,t,n){var i=n(39),r=n(85);e.exports=n(36)?function(e,t,n){return i.f(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}},function(e){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e){var t;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(null==e)throw TypeError("Can't call method on "+e);return e}},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,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(2)),o=i(n(3)),s=i(n(399)),l=i(n(227)),u=i(n(228)),h=function(){function e(){(0,a.default)(this,e),this._sceneRawData={},this._sceneDecodeData={},this._reader=new s.default,this.file_ver=1}return(0,o.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 i;if(i=t?this._reader.sceneDecode(this.sceneRawData[e+""],n,e):this._reader.mapDecode(this.sceneRawData[e+""],n,e),i){t&&(i={scene:i,floors:[]});for(var r=i.scene.layerGroups,a=0;a<r.length;a++){var o=r[a];o.elevation=o.height}return i}}},{key:"parseFloor",value:function(e,t,n){var i=this._reader.floorGeoDecode(e),r=this._reader.floorBizDecode(t),a=this._reader.floorNaviDecode(n);return[i,r,a]}},{key:"isSceneHasZone",value:function(e){if(!e)return!1;var t=this._sceneDecodeData[e+""];if(!t)return!1;var n=!1;return t.floors.forEach(function(e){0<e.navi[0].naviZones.length&&(n=!0)}),n}},{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 l.default).parse(e),n={vertices:t.toStrip(!0)};return t.hasHoles()&&(n.holes=t.toStripHoles(!0)),n}},{key:"convertArray2Geometry",value:function(e,t){var n=(new u.default).parseGeometry(e,t),i={vertices:n.toStrip(!0)};return n.hasHoles()&&(i.holes=n.toStripHoles(!0)),i}},{key:"convertGeo2Points",value:function(e){var t=(new l.default).parse(e),n={vertices:t.points};return n}},{key:"convertArrayPoints",value:function(e,t){var n=(new u.default).parse(e,t),i={vertices:n.points};return i}}]),e}(),c=h;t.default=c},function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var i=n(109);e.exports=function(e){return Object(i(e))}},function(e,t,n){for(var i=n(50),r=n(149),a=n(49),o=n(33),s=n(43),l=n(72),u=n(21),h=u("iterator"),c=u("toStringTag"),d=l.Array,f={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=r(f),m=0;m<p.length;m++){var v,g=p[m],y=f[g],_=o[g],x=_&&_.prototype;if(x&&(x[h]||s(x,h,d),x[c]||s(x,c,g),l[g]=d,y))for(v in i)x[v]||a(x,v,i[v],!0)}},function(t,e,n){var i=n(18),r=n(17);function a(e){return t.exports=a="function"==typeof r&&"symbol"==typeof i?function(e){return typeof e}:function(e){return e&&"function"==typeof r&&e.constructor===r&&e!==r.prototype?"symbol":typeof e},a(e)}t.exports=a},function(e){var n,i,t=e.exports={};function r(){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===r||!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(i===clearTimeout)return clearTimeout(t);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{return i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:r}catch(e){n=r}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(e){i=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 i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var r={ZH:"zh",EN:"en",CHN:"zh"},a=r;t.default=a},function(e,t,n){"use strict";var i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var r={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=r},function(e,t,n){"use strict";var i=n(127),r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=c;var a=Object.create(n(99));a.inherits=n(84);var o=n(272),s=n(178);a.inherits(c,o);for(var l=r(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||i.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(),i.nextTick(t,e)}},function(e,t,n){"use strict";var i=n(292)(!0);n(139)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=i(t,n),this._i+=e.length,{value:e,done:!1})})},function(e){e.exports={}},function(e,t,n){var i=n(141),r=n(109);e.exports=function(e){return i(r(e))}},function(e){e.exports={}},function(e,t,n){var i=n(111)("meta"),r=n(23),a=n(55),o=n(39).f,s=0,l=Object.isExtensible||function(){return!0},u=!n(47)(function(){return l(Object.preventExtensions({}))}),h=function(e){o(e,i,{value:{i:"O"+ ++s,w:{}}})},c=function(e,t){if(!r(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!a(e,i)){if(!l(e))return"F";if(!t)return"E";h(e)}return e[i].i},d=function(e,t){if(!a(e,i)){if(!l(e))return!0;if(!t)return!1;h(e)}return e[i].w},f=function(e){return u&&p.NEED&&l(e)&&!a(e,i)&&h(e),e},p=e.exports={KEY:i,NEED:!1,fastKey:c,getWeak:d,onFreeze:f}},function(e,t,n){n(308);for(var i=n(20),r=n(54),a=n(70),o=n(26)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l<s.length;l++){var u=s[l],h=i[u],c=h&&h.prototype;c&&!c[o]&&r(c,o,u),a[u]=a.Array}},function(e,t,n){"use strict";var T=n(40),i=n(51),E=n(41),S=n(58),A=n(156),L=n(113),I=Math.max,k=Math.min,d=Math.floor,f=/\$([$&`']|\d\d?|<[^>]*>)/g,p=/\$([$&`']|\d\d?)/g,R=function(e){return void 0===e?e:String(e)};n(115)("replace",2,function(r,a,b,w){return[function(e,t){var n=r(this),i=null==e?void 0:e[a];return void 0!==i?i.call(e,n,t):b.call(String(n),e,t)},function(e,t){var n=w(b,e,this,t);if(n.done)return n.value;var i=T(e),r=String(this),a="function"==typeof t;a||(t=String(t));var o=i.global;if(o){var s=i.unicode;i.lastIndex=0}for(var l=[];;){var u=L(i,r);if(null===u)break;if(l.push(u),!o)break;var h=String(u[0]);""===h&&(i.lastIndex=A(r,E(i.lastIndex),s))}for(var c="",d=0,f=0;f<l.length;f++){u=l[f];for(var p=String(u[0]),m=I(k(S(u.index),r.length),0),v=[],g=1;g<u.length;g++)v.push(R(u[g]));var y=u.groups;if(a){var _=[p].concat(v,m,r);void 0!==y&&_.push(y);var x=String(t.apply(void 0,_))}else x=M(p,r,m,v,y,t);d<=m&&(c+=r.slice(d,m)+x,d=m+p.length)}return c+r.slice(d)}];function M(a,o,s,l,u,e){var h=s+a.length,c=l.length,t=p;return void 0!==u&&(u=i(u),t=f),b.call(e,t,function(e,t){var n;switch(t.charAt(0)){case"$":return"$";case"&":return a;case"`":return o.slice(0,s);case"'":return o.slice(h);case"<":n=u[t.slice(1,-1)];break;default:var i=+t;if(0===i)return e;if(c<i){var r=d(i/10);return 0!==r&&r<=c?void 0===l[r-1]?t.charAt(1):l[r-1]+t.charAt(1):e}n=l[i-1]}return void 0===n?"":n})}})},function(e,t,n){var d=n(46),f=n(194),p=n(195),m=n(35),v=n(110),g=n(145),y={},_={};t=e.exports=function(e,t,n,i,r){var a,o,s,l,u=r?function(){return e}:g(e),h=d(n,i,t?2:1),c=0;if("function"!=typeof u)throw TypeError(e+" is not iterable!");if(p(u)){for(a=v(e.length);c<a;c++)if(l=t?h(m(o=e[c])[0],o[1]):h(e[c]),l===y||l===_)return l}else for(s=u.call(e);!(o=s.next()).done;)if(l=f(s,h,o.value,t),l===y||l===_)return l},t.BREAK=y,t.RETURN=_},function(e,t,n){e.exports=n(328)},function(e,t,n){e.exports=n(351)},function(e,t,n){"use strict";n(121)("fontsize",function(t){return function(e){return t(this,"font","size",e)}})},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var u=i(n(16)),h=i(n(2)),a=i(n(3)),o=function(){function l(e,t,n,i,r){var a=2<arguments.length&&void 0!==n?arguments[2]:1e3,o=3<arguments.length?i:void 0,s=4<arguments.length?r: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=e*this.speed,n={};if(this._countTime+t>this._time){for(var i in this._left){var r=(this._right[i]-this._left[i])*(this._time-this._countTime)/this._time;this._result[i]+=r,n[i]=r}return this._enable=!1,this._runBack(this._result,n),this._endBack(this._result,n),this._result={},void(this._countTime=0)}for(var a in this._left){var o=(this._right[a]-this._left[a])*t/this._time;this._result[a]+=o,n[a]=o}this._countTime+=t,this._runBack(this._result,n)}},{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,t,n){"use strict";var i=n(0);i(t,"__esModule",{value:!0}),t.mapOptionMessage=t.tileMessage=t.cerityMessage=void 0;var r={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=r;var a={noGroup:"目标楼层未初始化,请检查楼层id是否越界,或者等待楼层加载!",noFocus:"焦点层不在可视楼层中,请检查焦点层和可视楼层的参数设置!"};t.tileMessage=a;var o={defaultViewCenterError:"地图初始化中心位置错误,请检查fengmap.FMMap初始化参数defaultViewCenter的正确性"};t.mapOptionMessage=o},function(e,t,n){"use strict";var i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var r={MODULE_SHORTEST:1,MODULE_BEST:2},a=r;t.default=a},function(e,t,n){"use strict";var i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var r={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=r;t.default=a},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){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},function(e,t,n){var r=n(48);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e){var t=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++t+n).toString(36))}},function(e){e.exports=!0},function(e,t,a){var i=a(35),r=a(190),o=a(144),s=a(142)("IE_PROTO"),l=function(){},u="prototype",h=function(){var e,t=a(129)("iframe"),n=o.length,i="<",r=">";for(t.style.display="none",a(192).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(i+"script"+r+"document.F=Object"+i+"/script"+r),e.close(),h=e.F;n--;)delete h[u][o[n]];return h()};e.exports=Object.create||function(e,t){var n;return null!==e?(l[u]=i(e),n=new l,l[u]=null,n[s]=e):n=h(),void 0===t?n:r(n,t)}},function(e,t,n){var i=n(191),r=n(144);e.exports=Object.keys||function(e){return i(e,r)}},function(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},function(e,t,n){var i=n(39).f,r=n(55),a=n(26)("toStringTag");e.exports=function(e,t,n){e&&!r(e=n?e:e.prototype,a)&&i(e,a,{configurable:!0,value:t})}},function(e,t,n){var i=n(23);e.exports=function(e,t){if(!i(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(2)),o=i(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 i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(16)),o=i(n(2)),s=i(n(445)),l=function e(t){(0,o.default)(this,e),this.size=s.default.FMMap_CONTROL_NORMAL,this.position=null,this.offset=new fm.Vector2(0,0),this.imgURL="resource/style/wedgets/img/",(0,a.default)(this,t)},u=l;t.default=u},function(e,t,n){"use strict";var i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var r={LEFT_TOP:1,LEFT_BOTTOM:2,RIGHT_TOP:3,RIGHT_BOTTOM:4},a=r;t.default=a},function(e,t,n){"use strict";var i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var r={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=r;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 i(e){return null===e}function r(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=i,v.isNullOrUndefined=r,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(275).Buffer)},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(16)),o=i(n(2)),s=i(n(3)),l=(i(n(173)),i(n(67))),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 i=0;i<e.relatedLiftNodes.length;i++)this.relatedLiftNodes[i]=e.relatedLiftNodes[i];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 a=n(131);e.exports=function(i,r,e){if(a(i),void 0===r)return i;switch(e){case 1:return function(e){return i.call(r,e)};case 2:return function(e,t){return i.call(r,e,t)};case 3:return function(e,t,n){return i.call(r,e,t,n)}}return function(){return i.apply(r,arguments)}}},function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var i=n(133),r=n(57);e.exports=function(e){return i(r(e))}},function(e,t,n){var i=n(187),r=n(136).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return i(e,r)}},function(e,t,n){var i=n(58),r=Math.max,a=Math.min;e.exports=function(e,t){return e=i(e),e<0?r(e+t,0):a(e,t)}},function(e){var t=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=t)},function(e){e.exports=!1},function(e,t,n){"use strict";var i=n(40);e.exports=function(){var e=i(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var i=n(138),r=Math.min;e.exports=function(e){return 0<e?r(i(e),9007199254740991):0}},function(e){var t=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++t+n).toString(36))}},function(e,t,n){var r=n(92),a=n(26)("toStringTag"),o="Arguments"==r(function(){return arguments}()),s=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=s(t=Object(e),a))?n:o?r(t):"Object"==(i=r(t))&&"function"==typeof t.callee?"Arguments":i}},function(e,t,n){"use strict";var r=n(114),a=RegExp.prototype.exec;e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var i=n.call(e,t);if("object"!=typeof i)throw new TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==r(e))throw new TypeError("RegExp#exec called on incompatible receiver");return a.call(e,t)}},function(e,t,n){var r=n(86),a=n(21)("toStringTag"),o="Arguments"==r(function(){return arguments}()),s=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=s(t=Object(e),a))?n:o?r(t):"Object"==(i=r(t))&&"function"==typeof t.callee?"Arguments":i}},function(e,t,n){"use strict";n(299);var h=n(49),c=n(43),d=n(25),f=n(57),p=n(21),m=n(146),v=p("species"),g=!d(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),y=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(n,e,t){var i=p(n),a=!d(function(){var e={};return e[i]=function(){return 7},7!=""[n](e)}),r=a?!d(function(){var e=!1,t=/a/;return t.exec=function(){return e=!0,null},"split"===n&&(t.constructor={},t.constructor[v]=function(){return t}),t[i](""),!e}):void 0;if(!a||!r||"replace"===n&&!g||"split"===n&&!y){var o=/./[i],s=t(f,i,""[n],function(e,t,n,i,r){return t.exec===m?a&&!r?{done:!0,value:o.call(t,n,i)}:{done:!0,value:e.call(n,t,i)}:{done:!1}}),l=s[0],u=s[1];h(String.prototype,n,l),c(RegExp.prototype,i,2==e?function(e,t){return u.call(e,this,t)}:function(e){return u.call(e,this)})}}},function(e,t){t.f={}.propertyIsEnumerable},function(){},function(e,t,n){var r=n(54);e.exports=function(e,t,n){for(var i in t)n&&e[i]?e[i]=t[i]:r(e,i,t[i]);return e}},function(e){e.exports=function(e,t,n,i){if(!(e instanceof t)||void 0!==i&&i in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){e.exports=n(348)},function(e,t,n){var i=n(27),r=n(25),o=n(57),s=/"/g,a=function(e,t,n,i){var r=String(o(e)),a="<"+t;return""!==n&&(a+=" "+n+'="'+String(i).replace(s,"&quot;")+'"'),a+">"+r+"</"+t+">"};e.exports=function(t,e){var n={};n[t]=e(a),i(i.P+i.F*r(function(){var e=""[t]('"');return e!==e.toLowerCase()||3<e.split('"').length}),"String",n)}},function(e,t,n){e.exports=n(354)},function(e,t,n){var i=n(27);i(i.P,"Array",{fill:n(158)}),n(147)("fill")},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),o=i(n(2)),s=i(n(3)),l=i(n(7)),u=i(n(8)),h=i(n(9));function c(i){return function(){var e,t=(0,u.default)(i);if(d()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}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,h.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,b=new fm.Vector2,u=new fm.Vector4,w=function(e,t,n,i,r,a){s.subVectors(e,n).addScalar(.5).multiply(i),o.perspective&&!c.material.sizeAttenuation&&(u.applyMatrix4(c.modelViewMatrix),s.multiplyScalar(Math.abs(u.z))),void 0!==r?(l.x=a*s.x-r*s.y,l.y=r*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,i,r=c.material.rotation;0!==r&&(i=Math.cos(r),n=Math.sin(r));var a=c.center;w(v.set(-.5,-.5,0),p,a,f,n,i),w(g.set(.5,-.5,0),p,a,f,n,i),w(y.set(.5,.5,0),p,a,f,n,i),_.set(0,0),x.set(1,0),b.set(1,1);var o=e.ray.intersectTriangle(v,g,y,!1,d);if(null!==o||(w(g.set(-.5,.5,0),p,a,f,n,i),x.set(0,1),o=e.ray.intersectTriangle(v,y,g,!1,d),null!==o)){var s=v.clone().project(e._camera),l=g.clone().project(e._camera),u=y.clone().project(e._camera);if(!((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.x<-1||1<u.x||u.y<-1||1<u.y))){var h=e.ray.origin.distanceTo(d);h<e.near||h>e.far||t.push({distance:h,point:d.clone(),uv:fm.Triangle.getUV(d,v,g,y,_,x,b,new fm.Vector2),face:null,object:c})}}}(o,e)}}]),n}(fm.Sprite),p=f;t.default=p},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var s=i(n(19)),l=i(n(12)),u=i(n(18)),h=i(n(17)),a=i(n(15));n(10),n(5),n(4);var o=i(n(6));n(163);var m=i(n(16)),d=i(n(29)),c=i(n(2)),f=i(n(3)),p=i(n(7)),v=i(n(8)),g=i(n(9)),y=i(n(13));n(263);var _=i(n(264)),x=i(n(453)),b=i(n(126)),w=i(n(262)),M=n(81);function T(i){return function(){var e,t=(0,v.default)(i);if(E()){var n=(0,v.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,p.default)(this,e)}}function E(){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 S(e){if(void 0===h.default||null==e[u.default]){if((0,l.default)(e)||(e=A(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}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 i,r,a=!0,o=!1;return{s:function(){i=(0,s.default)(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw r}}}}function A(e,t){if(e){if("string"==typeof e)return L(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L(e,t):void 0}}function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var I=function(e){var t,n=S(this._lineNodes);try{for(n.s();!(t=n.n()).done;){var i=t.value;i.line.material.uniforms.offset.value.y-=.001*e.delTime}}catch(e){n.e(e)}finally{n.f()}},k=function(e){(0,g.default)(n,e);var t=T(n);function n(){var e;return(0,c.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}return(0,f.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=0;n<this._segment.points.length;n++)if(0<n&&n<this._segment.points.length-1&&this._segment.points[n-1],t.push.apply(t,(0,d.default)(this.convertPointByCenter(this._segment.points[n],e))),0!==n){var i=new fm.Vector3(this._segment.points[n].x,this._segment.points[n].y,this._segment.points[n].z),r=new fm.Vector3(this._segment.points[n-1].x,this._segment.points[n-1].y,this._segment.points[n-1].z);this._lineDis.push(i.distanceTo(r))}return t}},{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=this.getIndexDis(this._lineDis.length),n=0;n<this._segment.points.length;n++)if(0===n)e.push(0);else if(n===this._segment.points.length-1)e.push(1);else{var i=this.getIndexDis(n)/t;e.push(i),e.push(i)}return e}},{key:"initLine",value:function(e,t,n){this._style=t;var i=this.getLineTextureParams(t.lineType,t.lineWidth,t.godColor,t.godEdgeColor,t.color);t.useMap=i.useMap,t.map=n.nodeManager.materialManager[i.txtureCommand](i),t.map.minFilter=fm.LinearFilter,t.map.generateMipmaps=!1,t.map.anisotropy=4;for(var r=this._segment.length-1;-1<r;r--){var a=this.createLine(this._segment[r],e,t,n),o=n.getFMGroup(this._segment[r].groupId);if(o){if(this._lineNodes.push({line:a,gid:this._segment[r].groupId,seg:this._segment[r],isCross:!1}),o.addLine(a),-1<r-1&&this._segment[r].groupId!=this._segment[r-1].groupId){var s=n.getFMGroup(this._segment[r-1].groupId);if(!s){console.warn(M.tileMessage.noGroup);continue}var l=s.height+s.offsetHeight,u=(0,m.default)({},this._segment[r-1].points[this._segment[r-1].points.length-1]),h=(0,m.default)({},this._segment[r].points[0]),c=n.getFMGroup(this._segment[r].groupId);if(!c){console.warn(M.tileMessage.noGroup);continue}u.z=l-c.height-c.offsetHeight+u.z-h.z;var d=new b.default([u,h]);d.groupId=this._segment[r].groupId;var f=this.createLine(d,e,t,n);this._lineNodes.push({line:f,gid:this._segment[r-1].groupId,gidAn:this._segment[r].groupId,seg:d,isCross:!0}),s.addLine(f)}}else console.warn(M.tileMessage.noGroup)}this._noAnimate=t.noAnimate,this._noAnimate||n.on("frameLoop",I.bind(this))}},{key:"conputeMaterialRepeat",value:function(e,t,n,i){var r=t.allLength,a=r*n.getPixelTo3DdisByGid(t.groupId),o=Math.floor(a*window.devicePixelRatio/i);e.uniforms.repeat.value.y=o}},{key:"resetRepeat",value:function(e){var t,n=S(this._lineNodes);try{for(n.s();!(t=n.n()).done;){var i=t.value;this.conputeMaterialRepeat(i.line.material,i.seg,e,this._secLen)}}catch(e){n.e(e)}finally{n.f()}}},{key:"rebuildLine",value:function(e,t,n,i){this.removeByMap(t);for(var r=this._style,a=this._segment.length-1;-1<a;a--){var o=this.createLine(this._segment[a],e,r,t),s=t.getFMGroup(this._segment[a].groupId);if(this._lineNodes.push({line:o,gid:this._segment[a].groupId,seg:this._segment[a],isCross:!1}),s.addLine(o),-1<a-1&&this._segment[a].groupId!=this._segment[a-1].groupId){var l=t.getFMGroup(this._segment[a-1].groupId),u=l.height+l.offsetHeight,h=(0,m.default)({},this._segment[a].points[this._segment[a].points.length-1]),c=(0,m.default)({},this._segment[a-1].points[0]),d=t.getFMGroup(this._segment[a].groupId);h.z=u-d.height-d.offsetHeight+h.z-c.z;var f=new b.default([h,c]);f.groupId=this._segment[a].groupId;var p=this.createLine(f,e,r,t);this._lineNodes.push({line:p,gid:this._segment[a-1].groupId,gidAn:this._segment[a].groupId,seg:f,isCross:!0}),l.addLine(p)}}this.hideOrShowBy(n,i)}},{key:"removeByMap",value:function(e,t){var n,i=S(this._lineNodes);try{for(i.s();!(n=i.n()).done;){var r=n.value;r.line.material.dispose(),r.line.geometry.dispose();var a=e.getFMGroup(r.gid);a.removeLine(r.line)}}catch(e){i.e(e)}finally{i.f()}t&&e.off("frameLoop",I),this._lineNodes.length=0}},{key:"dispose",value:function(e){this.removeByMap(e,!0)}},{key:"hideOrShowBy",value:function(e){var t,n=S(this._lineNodes);try{for(n.s();!(t=n.n()).done;){var i=t.value;i.isCross?e.indexOf(i.gid)<0||e.indexOf(i.gidAn)<0?i.line.visible=!1:i.line.visible=!0:-1<e.indexOf(i.gid)?i.line.visible=!0:i.line.visible=!1}}catch(e){n.e(e)}finally{n.f()}}},{key:"createLine",value:function(e,t,n,i){var r=i.getFMGroup(e.groupId),a=r.height+r.offsetHeight,o=new fm.Vector3(0,a,0),s=new _.default;e.needSmooth=!1!==n.smooth,e.initSegement(t,n.radius);var l=[];l.push.apply(l,(0,d.default)(e.linePoints));var u=e.uvys;s.setPositions(l),s.setUvys(u);var h=new fm.LineMaterial({color:n.color,linewidth:5,vertexColors:fm.VertexColors,dashed:!1,transparent:!0});h.resolution.set(n.resolution.x,n.resolution.y),h.linewidth=n.lineWidth,n.useMap&&(h.defines.USE_MMAP=!0,h.uniforms.mmap.value=n.map,n.map.wrapS=fm.RepeatWrapping,n.map.wrapT=fm.RepeatWrapping,this.conputeMaterialRepeat(h,e,i,this._secLen),h.needsUpdate=!0);var c=new x.default(s,h);return c.computeLineDistances(),c.position.set(o.x,o.y,o.z),c}},{key:"initLinePoints",value:function(e,t){var n=new _.default;n.setPositions(e);var i=new fm.LineMaterial({color:t.color,linewidth:t.lineWidth,vertexColors:fm.VertexColors,dashed:!1,transparent:!0});i.lineWidth=t.lineWidth,i.resolution.set(t.resolution.x,t.resolution.y),this._renderNode=new x.default(n,i),this._renderNode.computeLineDistances()}},{key:"moveUv",value:function(e){if(this._noAnimate){var t,n=S(this._lineNodes);try{for(n.s();!(t=n.n()).done;){var i=t.value;i.line.material.uniforms.offset.value.y-=e}}catch(e){n.e(e)}finally{n.f()}}}},{key:"getLineTextureParams",value:function(e,t,n,i,r){t=t||6;var a=t*this._hwProp;this._secLen=a;var o={type:"normal",width:128,height:128,color:"#ff0000",arrowHeightPercent:.6,arrowWidthPercent:1,arrowPercent:.1,lineType:null,dashArray:[2,1],txtureCommand:"createNormalLineTexture",godHeightPercent:1,godEdgePercent:.2,godArrowPercent:.15,arrawWidth:20,godColor:"#33cc61",godEdgeColor:"#4a82d2",godArrowColor:"#F4FEFB",godArrowXScale:4,godArrowWidthPercent:.9};switch(n&&(o.godColor=n),i&&(o.godEdgeColor=i),r&&(o.color=r),e){case w.default.FULL:o.useMap=!1;break;case w.default.DOTTED:o.dashArray=[1,1],o.useMap=!0;break;case w.default.DOT_DASH:o.dashArray=[2.5,1,.5,1],o.useMap=!0;break;case w.default.CENTER:o.dashArray=[3,1,1.5,1],o.useMap=!0;break;case w.default.DASH:o.dashArray=[2,1],o.useMap=!0;break;case w.default.DOUBLE_DOT_DASH:o.dashArray=[2.5,.5,.5,.5,.5,.5],o.useMap=!0;break;case w.default.TRI_DOT_DASH:o.dashArray=[2.5,.5,.5,.5,.5,.5,.5,.5],o.useMap=!0;break;case w.default.ARROW:o.dashArray=[5,0],o.useMap=!0,o.txtureCommand="createArrowLineTexture";break;case w.default.FMARROW:o.width=5*t,o.height=5*a,o.arrawWidth=o.height/12,o.dashArray=[7,0],o.useMap=!0,o.txtureCommand="createArrowWidthBackTexture";break;default:o.useMap=!1}return o}},{key:"renderNode",get:function(){return this._renderNode}},{key:"segment",get:function(){return this._segment}}]),n}(y.default),R=k,N=R;t.default=N},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var h=i(n(29)),a=i(n(2)),o=i(n(3)),l=i(n(251)),u=i(n(30)),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=new l.default,i=0;i<this._points.length;i++)if(0<i&&i<this._points.length-1){var r=u.default.distanceOfTwoPoints(t[t.length-1],this._points[i]),a=u.default.distanceOfTwoPoints(this._points[i],this._points[i+1]),o=.5*(a<r?a:r),s=e;o<s&&(s=o),t.push.apply(t,(0,h.default)(n.computerArcLineByPoints(t[t.length-1],this._points[i],this._points[i+1],s||1,12)))}else t.push(this._points[i]);this._radiusPoint=t,this._radiuInit=!0}},{key:"pointsToLinePnts",value:function(e,t){if(this.needSmooth)this._radiuInit||this.pointsToRadius(t);else{var n=[];n.push.apply(n,(0,h.default)(this._points)),this._radiusPoint=n}for(var i=[],r=0;r<this._radiusPoint.length;r++){var a=this._radiusPoint[r].x-e.x,o=this._radiusPoint[r].z,s=-this._radiusPoint[r].y+e.y;if(i.push(a,o,s),0!==r){var l=new fm.Vector3(this._radiusPoint[r].x,this._radiusPoint[r].y,this._radiusPoint[r].z),u=new fm.Vector3(this._radiusPoint[r-1].x,this._radiusPoint[r-1].y,this._radiusPoint[r-1].z);this._lineDis.push(l.distanceTo(u))}}return i}},{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=this.getIndexDis(this._lineDis.length),n=0;n<this._radiusPoint.length;n++)if(0===n)e.push(0);else if(n===this._radiusPoint.length-1)e.push(1);else{var i=this.getIndexDis(n)/t;e.push(i),e.push(i)}return e}},{key:"computeScreenCoord",value:function(e,t,n,i){for(var r=[],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+i.x,h+i.y,c+i.z),f=d.applyMatrix4(s);f.z,e.near;var p=f.applyMatrix4(e.projectionMatrix),m=new fm.Vector2(t/2+t/2*p.x,n/2-n/2*p.y);if(r.push(m),2<l){var v=m.distanceTo(r[Math.round(l/3)-1]);a+=v,o.push(v)}}return this._screenPoints=r,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],i=.368*u.default.distanceOfTwoPoints(t,n);this._minRadius>i&&(this._minRadius=i)}}}},{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(t,e,n){"use strict";(function(s){function e(e,t,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var r,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,i)});default:for(r=new Array(o-1),a=0;a<r.length;)r[a++]=arguments[a];return s.nextTick(function(){e.apply(null,r)})}}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){var i=n(275),r=i.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return r(e,t,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=i:(a(i,t),t.Buffer=o),a(r,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=r(e);return void 0!==t?"string"==typeof n?i.fill(t,n):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},function(e,t,n){var i=n(23),r=n(20).document,a=i(r)&&i(r.createElement);e.exports=function(e){return a?r.createElement(e):{}}},function(e,t,n){var r=n(23);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var i=n(184),r=n(102),a=n(103),o=n(87),s=n(61),l=n(185),u=Object.getOwnPropertyDescriptor;t.f=n(31)?u:function(e,t){if(e=a(e),t=o(t,!0),l)try{return u(e,t)}catch(e){}if(s(e,t))return r(!i.f.call(e,t),e[t])}},function(e,t,n){var i=n(86);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==i(e)?e.split(""):Object(e)}},function(e,t,n){var i=n(135)("keys"),r=n(88);e.exports=function(e){return i[e]||(i[e]=r(e))}},function(e,t,n){var i=n(106),r=n(33),a="__core-js_shared__",o=r[a]||(r[a]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:i.version,mode:n(107)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var i=n(48),r=n(86),a=n(21)("match");e.exports=function(e){var t;return i(e)&&(void 0!==(t=e[a])?!!t:"RegExp"==r(e))}},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,t,n){"use strict";var _=n(89),x=n(14),b=n(140),w=n(54),M=n(70),T=n(293),E=n(93),S=n(193),A=n(26)("iterator"),L=!([].keys&&"next"in[].keys()),I="@@iterator",k="keys",R="values",N=function(){return this};e.exports=function(e,t,n,i,r,a,o){T(n,t,i);var s,l,u,h=function(e){if(!L&&e in p)return p[e];switch(e){case k:case R:return function(){return new n(this,e)}}return function(){return new n(this,e)}},c=t+" Iterator",d=r==R,f=!1,p=e.prototype,m=p[A]||p[I]||r&&p[r],v=m||h(r),g=r?d?h("entries"):v:void 0,y="Array"==t&&p.entries||m;if(y&&(u=S(y.call(new e)),u!==Object.prototype&&u.next&&(E(u,c,!0),_||"function"==typeof u[A]||w(u,A,N))),d&&m&&m.name!==R&&(f=!0,v=function(){return m.call(this)}),_&&!o||!L&&!f&&p[A]||w(p,A,v),M[t]=v,M[c]=N,r)if(s={values:d?v:h(R),keys:a?v:h(k),entries:g},o)for(l in s)l in p||b(p,l,s[l]);else x(x.P+x.F*(L||f),t,s);return s}},function(e,t,n){e.exports=n(54)},function(e,t,n){var i=n(92);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==i(e)?e.split(""):Object(e)}},function(e,t,n){var i=n(143)("keys"),r=n(111);e.exports=function(e){return i[e]||(i[e]=r(e))}},function(e,t,n){var i=n(11),r=n(20),a="__core-js_shared__",o=r[a]||(r[a]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:i.version,mode:n(89)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var i=n(112),r=n(26)("iterator"),a=n(70);e.exports=n(11).getIteratorMethod=function(e){if(null!=e)return e[r]||e["@@iterator"]||a[i(e)]}},function(e,t,n){"use strict";var i,r,o=n(108),s=RegExp.prototype.exec,l=String.prototype.replace,a=s,u="lastIndex",h=(i=/a/,r=/b*/g,s.call(i,"a"),s.call(r,"a"),0!==i[u]||0!==r[u]),c=void 0!==/()??/.exec("")[1],d=h||c;d&&(a=function(e){var t,n,i,r,a=this;return c&&(n=new RegExp("^"+a.source+"$(?!\\s)",o.call(a))),h&&(t=a[u]),i=s.call(a,e),h&&i&&(a[u]=a.global?i.index+i[0].length:t),c&&i&&1<i.length&&l.call(i[0],n,function(){for(r=1;r<arguments.length-2;r++)void 0===arguments[r]&&(i[r]=void 0)}),i}),e.exports=a},function(e,t,n){var i=n(21)("unscopables"),r=Array.prototype;null==r[i]&&n(43)(r,i,{}),e.exports=function(e){r[i][e]=!0}},function(e,t,a){var i=a(40),r=a(302),o=a(136),s=a(134)("IE_PROTO"),l=function(){},u="prototype",h=function(){var e,t=a(186)("iframe"),n=o.length,i="<",r=">";for(t.style.display="none",a(303).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(i+"script"+r+"document.F=Object"+i+"/script"+r),e.close(),h=e.F;n--;)delete h[u][o[n]];return h()};e.exports=Object.create||function(e,t){var n;return null!==e?(l[u]=i(e),n=new l,l[u]=null,n[s]=e):n=h(),void 0===t?n:r(n,t)}},function(e,t,n){var i=n(187),r=n(136);e.exports=Object.keys||function(e){return i(e,r)}},function(e,t,n){var i=n(42).f,r=n(61),a=n(21)("toStringTag");e.exports=function(e,t,n){e&&!r(e=n?e:e.prototype,a)&&i(e,a,{configurable:!0,value:t})}},function(e,t,n){var r=n(14),a=n(11),o=n(47);e.exports=function(e,t){var n=(a.Object||{})[e]||Object[e],i={};i[e]=t(n),r(r.S+r.F*o(function(){n(1)}),"Object",i)}},function(e,t,n){t.f=n(26)},function(e,t,n){var i=n(20),r=n(11),a=n(89),o=n(152),s=n(39).f;e.exports=function(e){var t=r.Symbol||(r.Symbol=!a&&i.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:o.f(e)})}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var i=n(92);e.exports=Array.isArray||function(e){return"Array"==i(e)}},function(e,t,n){"use strict";var i=n(203)(!0);e.exports=function(e,t,n){return t+(n?i(e,t).length:1)}},function(e,t,n){var _=n(46),x=n(141),b=n(62),w=n(110),i=n(322);e.exports=function(c,e){var d=1==c,f=2==c,p=3==c,m=4==c,v=6==c,g=5==c||v,y=e||i;return function(e,t,n){for(var i,r,a=b(e),o=x(a),s=_(t,n,3),l=w(o.length),u=0,h=d?y(e,l):f?y(e,0):void 0;u<l;u++)if((g||u in o)&&(i=o[u],r=s(i,u,a),c))if(d)h[u]=r;else if(r)switch(c){case 3:return!0;case 5:return i;case 6:return u;case 2:h.push(i)}else if(m)return!1;return v?-1:p||m?m:h}}},function(e,t,n){"use strict";var u=n(51),h=n(105),c=n(41);e.exports=function(e,t,n){for(var i=u(this),r=c(i.length),a=arguments.length,o=h(1<a?t:void 0,r),s=2<a?n:void 0,l=void 0===s?r:h(s,r);o<l;)i[o++]=e;return i}},function(e,t,n){n(52)("Uint16",2,function(i){return function(e,t,n){return i(this,e,t,n)}})},function(e,t,n){n(52)("Uint8",1,function(i){return function(e,t,n){return i(this,e,t,n)}})},function(e,t,n){n(52)("Int8",1,function(i){return function(e,t,n){return i(this,e,t,n)}})},function(e){e.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(e,t,n){var i=n(27);i(i.P,"String",{repeat:n(353)})},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var s=i(n(19)),l=i(n(18)),u=i(n(17)),a=i(n(15));n(10),n(5),n(4);var o=i(n(6)),c=i(n(29));n(22);var d=i(n(64));n(44),n(75);var f=i(n(28)),p=i(n(12)),v=i(n(24));n(197);var g,m=i(n(2)),y=i(n(3)),_=i(n(165)),h=i(n(7)),x=i(n(8)),b=i(n(9)),w=i(n(120)),M=i(n(222)),T=i(n(398)),E=i(n(59)),S=i(n(229)),A=i(n(38)),L=i(n(440)),I=i(n(80)),k=i(n(95)),R=i(n(32)),N=i(n(254)),P=i(n(171)),C=i(n(37)),D=i(n(255)),O=i(n(30)),F=i(n(442)),B=(n(81),i(n(225))),G=i(n(256)),z=i(n(257)),U=n(81),V=i(n(444));function H(e){if(void 0===u.default||null==e[l.default]){if((0,p.default)(e)||(e=j(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}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 i,r,a=!0,o=!1;return{s:function(){i=(0,s.default)(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw r}}}}function j(e,t){if(e){if("string"==typeof e)return W(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?W(e,t):void 0}}function W(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Y(i){return function(){var e,t=(0,x.default)(i);if(q()){var n=(0,x.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,h.default)(this,e)}}function q(){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 X(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 i=null,e=s.MapOptions.mapServerURL,t="GET";if("fengmap"===s.MapOptions.mapServerURL){e="https://www.fengmap.com/FMCloud/sdk/auth/downMaps",s.MapOptions.tile&&(e="https://www.fengmap.com/FMCloud/sdk/authLayered/downMaps");var r=B.default.getCerityData(s.MapOptions.key,s.MapOptions.appName,o),a={newFlag:"2",mapId:r.mapId,keyValue:r.appKey,appName:r.appName,webUrl:r.webURL,keyType:3,isSeparate:s.MapOptions.tile};i=(0,w.default)(a),t="POST"}s.fmServer.getScene(e,o,s.MapOptions.tile,i,t,function(e,t){s.dataExcute(n,e,t,i)},function(e){g&&g(e)}),s._currentSceneId=o})})}var Z=function(e){(0,b.default)(h,e);var n=Y(h);function h(e){var t;return(0,m.default)(this,h),t=n.call(this),t.uuid=fm.Math.generateUUID(),k.default[t.uuid]={},t.MapOptions=new T.default(e),t.fmServer=new M.default,t.dataManager=new E.default,t.nodeManager=new A.default(t.MapOptions,(0,_.default)(t)),t.isMarkerTip=!1,e.isMarkerTip&&(t.isMarkerTip=!0),t.isMarkerMove=!1,e.isMarkerMove&&(t.isMarkerMove=!0),t.render=null,t.getRenderOption(),e.lightEffects?k.default.light=!0:k.default.light=!1,t.renderer=new S.default(t.MapOptions,(0,_.default)(t)),t.controls=new fm.OrbitControls("3d"===t.MapOptions.defaultViewMode?t.renderer.perspectiveCamera:t.renderer.orthographicCamera,t.renderer.canvas,(0,_.default)(t)),t.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],t._mapScaleLevel=20,t._mapScale=564,t._minScale=1,t._maxScale=295829355.45,t._minScaleLevel=1,t._maxScaleLevel=29,t._animaters=[],t._windowPops=[],t._currentSceneId="10347",t._currentFocusGroup=t.MapOptions.defaultFocusGroup,t._visibleGroups=t.MapOptions.defaultVisibleGroups,t._viewMode=t.MapOptions.defaultViewMode,t.renderer.viewMode=t.MapOptions.defaultViewMode,t._currentTime=(new Date).getTime(),t._showAllGroup=!1,t._lineMarkers=[],t._lastMoveEvent=null,t._mouseHoverTime=0,t._mouseHoverStart=!0,t._compassBG=t.MapOptions.compassBg,t._compassFG=t.MapOptions.compassFg,t.getMapScaleInfo(),t.scaleLevelInit(),t.controlEventInit(),t._loopHander=requestAnimationFrame(t.update.bind((0,_.default)(t))),t.allowRender=!0,t.pickFilterFunction=null,t.animationMixers=[],t.hoverFilterFunction=null,t._eventId=0,t._modelSelectColor={r:.97,g:.388,b:.196,a:1},t._fullScreen=!1,t._enterControl=new G.default,t._enterControl.enableMapHover=t.MapOptions.modelHoverEffect,t._allowfps=60,t._renderTime=0,t.controls.setEnterCtrl(t._enterControl),t.otherFocus=[],t.tileLoading=!1,t.letUpdate=!1,t.selectedObjects=[],t.isFpsDisplay=!1,t.stats=null,e.isFpsDisplay&&(t.isFpsDisplay=e.isFpsDisplay),t.isFpsDisplay&&(t.stats=new F.default,t.stats.showPanel(0),document.body.appendChild(t.stats.dom)),t.videoMemory=new V.default((0,_.default)(t)),t.getStation(),t}return(0,y.default)(h,[{key:"getRenderOption",value:function(){try{this.MapOptions.logarithmicDepthBuffer?this.render=new fm.WebGLRenderer({antialias:!0,alpha:!0,logarithmicDepthBuffer:!0}):this.render=new fm.WebGLRenderer({antialias:!0,alpha:!0})}catch(e){return console.error("WebGLRenderer ERROR: ",e),(new fengmap.MapError).noWebGL(this.renderOption.container),!1}this.canvas=this.render.domElement;var e=this.MapOptions.container.clientWidth,t=this.MapOptions.container.clientHeight;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=new Image;n.onload=function(){e&&e()},n.onerror=function(){t&&t()},n.style.display="none",n.src="http://www.baidu.com/img/baidu_sylogo1.gif?"+(""+Math.random()).slice(-6)}},{key:"openMapById",value:function(t,n){if(g=n,t)if(this.MapOptions.key){var e=/^[a-zA-z\d]{32}$/;if(e.test(this.MapOptions.key))if(this.MapOptions.appName){this._zopStep_=1;var i=this;this.MapOptions.useCompatibleOnLineCheck?this.isOnLine(r,a):(navigator.onLine?r:a)()}else console.warn(decodeURIComponent(cerityMessage.warn_noappname));else console.warn(decodeURIComponent(cerityMessage.warn_keynotright))}else console.warn(decodeURIComponent(cerityMessage.warn_nokey));else console.warn(decodeURIComponent(cerityMessage.warn_nomapid));function r(){"fengmap"===i.MapOptions.mapServerURL?B.default.checkIsOnLine(function(){B.default.checkOnLine(i.MapOptions.key,i.MapOptions.appName,t,function(){X.call(i,t,!0)},function(e){e?(console.warn(e.error_code,e.error_message),n&&n({msg:"线上验证失败!",data:e})):(console.warn("offLine 2"),X.call(i,t))},"POST")},function(){console.warn("offLine 1"),X.call(i,t)},1e3):X.call(i,t)}function a(){X.call(i,t)}}},{key:"search",value:function(e,t,n){return z.default.search(this,e,t,n)}},{key:"changeFocusToGroup",value:function(n){var i=this,e=this.nodeManager.getSceneCenter(this._currentSceneId),t=this.controls.target.y;this.currentFocusGroup=n.gid;var r=this.nodeManager.getHeight(this._currentSceneId,this.currentFocusGroup)+e.y;if(!this.MapOptions.focusAnimateMode)return this.controls.panUp(r-t),this.controls.update(),n.callback&&n.callback(),void this.setRenderList();k.default[this.uuid].currentGroupChangeAnimater&&(k.default[this.uuid].currentGroupChangeAnimater.stop(),this.removeAnimater(k.default[this.uuid].currentGroupChangeAnimater));var a=new I.default({h:t},{h:r},n.duration?1e3*n.duration:800,function(){i.removeAnimater(a),k.default[i.uuid].currentGroupChangeAnimater=null,n.callback&&n.callback()},function(e,t){i.controls.panUp(t.h),n.update&&n.update()}).start();k.default[this.uuid].currentGroupChangeAnimater=a,this._animaters.push(a)}},{key:"dataExcute",value:function(e,t,n,i){var r=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=R.default.toColor(e.data.viewtheme.clearcolor)),this.MapOptions.defaultBackgroundAlpha=(0,v.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||B.default.checkOffLine(this.MapOptions.key,this.MapOptions.appName,"",o.scene.key);if(!s)return console.warn(decodeURIComponent(cerityMessage.warn_offline)),void(g&&g({message:decodeURIComponent(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.perspectiveCamera.position;l.x,l.y,l.z;var u=this.renderer.getFrustumByViewMode(this._viewMode),h=this.getVisibleGroups();if(this.MapOptions.tile){var c=this.nodeManager.getSceneById(this._currentSceneId);c.sdata=i;var d=c.getNeedLoadGroup(h),f=function(){var t=function(){var t=c.getNeedLoadGroup(h,!0);t.length<1?r.dispatchEvent({type:"loadComplete"}):r.loadAndExcuteData(t,c,0,!1,function(e){r.tileLoading=!1,e===t.length-1&&r.dispatchEvent({type:"loadComplete"})})};if(d.length<1)return r.dispatchEvent({type:"visibleGroupLoaded"}),void t();r.loadAndExcuteData(d,c,0,!1,function(e){r.nodeManager.checkNodeByFrustum(r.dataManager.getDecodeScene(r._currentSceneId),r.renderer.getFrustumByViewMode(r._viewMode),r.getVisibleGroups(),r.mapScaleLevel,n),r.setRenderList(),r.avoidMarkers(),e===d.length-1&&(r.dispatchEvent({type:"visibleGroupLoaded"}),t())})};this.tileLoading=!0;for(var p=-1,m=0;m<d.length;m++)if(d[m].gid&&d[m].gid==this._currentFocusGroup){p=m;break}if(p<0)return void console.error(U.tileMessage.noFocus);this.loadAndExcuteData(d,c,p,!0,function(){r.nodeManager.checkNodeByFrustum(r.dataManager.getDecodeScene(r._currentSceneId),r.renderer.getFrustumByViewMode(r._viewMode),r.getVisibleGroups(),r.mapScaleLevel,n),r.setRenderList(),r.avoidMarkers(),d.splice(p,1),f()})}else this.nodeManager.checkNodeByFrustum(o,u,h,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,i){var r=c.dataManager.parseFloor(e,t,n),a={geo:[r[0]],biz:[r[1]],navi:[r[2]],gid:i};c.dataManager.getDecodeScene(c._currentSceneId).floors.push(a),d.layerData.loaded=!0,s.addGroup(i,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=H(this._lineMarkers);try{for(n.s();!(t=n.n()).done;){var i=t.value;i.moveUv(e)}}catch(e){n.e(e)}finally{n.f()}}},{key:"resetLineRepeat",value:function(){var e,t=H(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=H(this._lineMarkers);try{for(n.s();!(e=n.n()).done;){var i=e.value;i.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=this.getCameraDistanceByScale(this.mapScale),t=this.MapOptions.defaultViewCenter;try{if(t){var n=this.nodeManager.getSceneById(this._currentSceneId).mapcenter;t.x-=n.x,t.y-=n.y}else t=this.nodeManager.getSceneById(this._currentSceneId).center;var i=this.nodeManager.getHeight(this._currentSceneId,this._currentFocusGroup);t.z=0,t.y+=i,this.controls.target=(new fm.Vector3).copy(t)}catch(e){console.error(U.mapOptionMessage.defaultViewCenterError)}if("3d"===this._viewMode){this.controls.minPolarAngle=(90-this.MapOptions.defaultMaxTiltAngle)*fm.Math.DEG2RAD,this.controls.maxPolarAngle=(90-this.MapOptions.defaultMinTiltAngle)*fm.Math.DEG2RAD;var r=(90-this.MapOptions.defaultTiltAngle)*fm.Math.DEG2RAD,a=e*Math.cos(r),o=e*Math.sin(r),s=new fm.Vector3(0,a,o);this.controls.object.position.set(t.x+s.x,t.y+s.y,t.z+s.z),this.controls.object.lookAt(t),this.renderer.orthographicCamera.position.set(t.x+s.x,t.y+s.y,t.z+s.z),this.renderer.orthographicCamera.lookAt(t)}else{var l=this.getCameraScaleByScale(this.mapScale);this.controls.minPolarAngle=0,this.controls.maxPolarAngle=0,this.controls.object.position.set(t.x,t.y+e,t.z),this.controls.object.zoom=1/l,this.controls.object.lookAt(t),this.renderer.orthographicCamera.updateProjectionMatrix()}var u=this.MapOptions.computePoseToAngle();this.controls.rotateLeft(u*fm.Math.DEG2RAD),this._changePanrange(e,t),this.controls.update()}},{key:"_changePanrange",value:function(){if(this.MapOptions.enabledPanRange){var 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(){if(this.MapOptions.mapScaleLevelRange&&this.setMapScaleLevelRange(this.MapOptions.mapScaleLevelRange),this.MapOptions.mapScaleRange&&this.setMapScaleRange(this.MapOptions.mapScaleRange),this.MapOptions.defaultMapScaleLevel){var 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,p.default)(e)?(this.minScale=e[0],this.maxScale=e[1]):(this.minScale=e,this.maxScale=t)}},{key:"setMapScaleLevelRange",value:function(e,t){(0,p.default)(e)?(this.minScaleLevel=e[0],this.maxScaleLevel=e[1]):(this.minScaleLevel=e,this.maxScaleLevel=t)}},{key:"showSingerOrMultiGroup",value:function(e){this._showAllGroup=e,this.visibleGroupIDs=e?this.getCurrGroupIds().slice(0):[this._currentFocusGroup]}},{key:"removeAnimater",value:function(e){var t=this._animaters.indexOf(e);-1<t&&this._animaters.splice(t,1)}},{key:"dollyOut",value:function(){var n=this,i=1,e=new I.default({scale:1},{scale:2},500,function(){n.removeAnimater(e)},function(e){var t=e.scale/i;i=e.scale,n.controls.dollyOut(t)}).start();this._animaters.push(e)}},{key:"dollyIn",value:function(){var n=this,i=1,e=new I.default({scale:1},{scale:2},500,function(){n.removeAnimater(e)},function(e){var t=e.scale/i;i=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(){if(this.renderer){var e,t=this.renderer.getFrustumByViewMode(this._viewMode),n=this._currentSceneId,i=this.dataManager.getDecodeScene(n);e="top"==this._viewMode?this.getScaleByCameraScale():this.getScaleByCameraDistance();var r=this.scaleTolevel(e);this.nodeManager.checkNodeByFrustum(i,t,this.getVisibleGroups(),r,n)}}},{key:"getCurrDecodeData",value:function(){var e=this._currentSceneId,t=this.dataManager.getDecodeScene(e);return t}},{key:"setBackgroundColor",value:function(e,t){"string"==typeof e&&(e=(0,f.default)(e.replace("#","0x"))),this.renderer.setClearColor(e,t)}},{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(){if(this.nodeManager){var 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 r=this;this.controls.addEventListener("change",function(){var e;r.checkNode(),r.setRenderList(),r.avoidMarkers(),r.renderer.compassNode&&(r.renderer.compassNode.material.uniforms.rotation.value=-r.controls.getAzimuthalAngle()),e="top"===r._viewMode?r.getScaleByCameraScale():r.getScaleByCameraDistance(),r.dispatchEvent({type:"mapViewChanged"}),.5<Math.abs(e-r._mapScale)&&r.dispatchEvent({type:"scaleLevelChanged",scale:e}),r._mapScale=e;var t=r.scaleTolevel(e);t!==r._mapScaleLevel&&(r._mapScaleLevel=t,r.dispatchEvent({type:"mapScaleLevelChanged",mapScale:t})),r._mapScaleLevel=t,r.renderer.resetSpriteSize(),r.moveLinesUv(.01),r.resetLineRepeat(),r.renderer.resetLocationsSize()});var n=0,i=0,a=null;this.isMarkerMove&&this.MapOptions.container.addEventListener("mousedown",function(e){var t={x:2*e.offsetX/r.MapOptions.container.clientWidth-1,y:1-2*e.offsetY/r.MapOptions.container.clientHeight};n=(new Date).getTime(),a=setInterval(function(){if(i=(new Date).getTime(),500<i-n){var e=r.nodeManager.getFacility(r._currentSceneId,r.getVisibleGroups(),t,r.renderer.getCameraByViewMode(r._viewMode));0<e.length&&r.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};r._eventId++;var i=r.dispatchClickEvent(n,e.event);e.mouseButton===fm.MOUSE.LEFT&&i&&null!=i.target&&(4!=i.target._nodeType?r.modelFire(n):r.selectNull()),r.checkCompassClick(n),null!==a&&(clearInterval(a),a=null),r.dispatchEvent({type:"pressover"})}),this.controls.addEventListener("mousemove",function(e){(r.isMarkerTip||r.isMarkerMove)&&r.mouseIntoInfo(e),r._lastMoveEvent=e,r._mouseHoverTime=0,r._mouseHoverStart=!0,null!==a&&(clearInterval(a),a=null)})}},{key:"mouseIntoInfo",value:function(e){var t=e.mousePoint,n={x:2*t.x/t.w-1,y:1-2*t.y/t.h};if(!this.isMarkerTip){var i=this.nodeManager.getFacility(this._currentSceneId,this.getVisibleGroups(),n,this.renderer.getCameraByViewMode(this._viewMode));0!==i.length?this.dispatchEvent({type:"hover",target:i[0].object.mapNode}):this.dispatchEvent({type:"mouseleave"})}}},{key:"checkCompassClick",value:function(e){if(this.renderer.compassNode&&this.showCompass){var t=this.renderer.compassNode.userData;O.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,i=this.nodeManager.getNode(this._currentSceneId,this.getVisibleGroups(),e,this.renderer.getCameraByViewMode(this._viewMode)),r=this.nodeManager.getFacility(this._currentSceneId,this.getVisibleGroups(),e,this.renderer.getCameraByViewMode(this._viewMode)),a={type:"mapClickNode",target:null,mouse:t.mouse,domEvent:t,eventInfo:{domEvent:t,coord:null,eventID:this._eventId},nodeType:null};if(i.length<1&&r.length<1)return this.dispatchEvent(a),n={target:!0},n;if(1<=r.length){var o=0;if(this.pickFilterFunction){var s=this.pickFilterFunction({nodeType:r[0].object.mapNode.nodeType,typeID:r[0].object.mapNode.bdata&&r[0].object.mapNode.bdata.type,data:r[0].object.mapNode.bdata});s||(o=1)}n={type:"mapClickNode",target:r[0].object.mapNode,mouse:t.mouse,domEvent:t,eventInfo:{domEvent:t,coord:{x:r[0].object.mapNode.x,y:r[0].object.mapNode.y},eventID:this._eventId},mapCoord:{x:r[0].object.mapNode.x,y:r[0].object.mapNode.y},nodeType:r[0].object.mapNode.nodeType},1==o?this.dispatchEvent(a):this.dispatchEvent(n)}if(1<=i.length){var l=0;if(this.pickFilterFunction){var u=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});u||(l=1)}var h=(new fm.Vector3).copy(i[0].point);if(n={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},5==n.target._nodeType){for(var c in n.target.parent._models)n.target.parent._models[""+c]._renderNode&&1<n.target.parent._models[""+c]._renderNode.children.length&&(n.target.parent._models[""+c]._renderNode.children[1].renderOrder=10);1<n.target._renderNode.children.length&&(n.target._renderNode.children[1].renderOrder=11)}return 1==l?(this.dispatchEvent(a),a):(this.dispatchEvent(n),n)}}}},{key:"getDatasByAlias",value:function(e,t,n){n=n||function(){return!0};var i=this.nodeManager.getSceneById(this._currentSceneId);return i.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=this._lastMoveEvent,n=t.mousePoint,i={x:2*n.x/n.w-1,y:1-2*n.y/n.h},r=this.nodeManager.getNode(this._currentSceneId,this.getVisibleGroups(),i,this.renderer.getCameraByViewMode(this._viewMode)),a=this.nodeManager.getFacility(this._currentSceneId,this.getVisibleGroups(),i,this.renderer.getCameraByViewMode(this._viewMode));if(r.length<1&&a.length<1)return;if(r[0]){var o=(new fm.Vector3).copy(r[0].point),s={type:"mapHoverNode",target:r[0].object.mapNode,mouse:n,eventInfo:{domEvent:t.event,threeCoord:r[0].point,eventID:t.eventID,coord:{x:o.x+this.center.x,y:r[0].object.mapNode.y-o.z}},groupID:r[0].object.mapNode.groupID,nodeType:r[0].object.mapNode.nodeType};if(this.hoverFilterFunction){var l=this.hoverFilterFunction({nodeType:r[0].object.mapNode.nodeType,typeID:r[0].object.mapNode.bdata&&r[0].object.mapNode.bdata.type,data:r[0].object.mapNode.bdata});l&&(r[0].object.mapNode.nodeType===C.default.MODEL&&this.MapOptions.modelHoverEffect&&this.storeSelect(r[0].object),this.dispatchEvent(s))}else r[0].object.mapNode.nodeType===C.default.MODEL&&this.MapOptions.modelHoverEffect&&this.storeSelect(r[0].object),this.dispatchEvent(s)}if(a[0]){var u=(new fm.Vector3).copy(a[0].point),h={type:"mapHoverNode",target:a[0].object.mapNode,mouse:n,eventInfo:{domEvent:t.event,threeCoord:a[0].point,eventID:t.eventID,coord:{x:u.x+this.center.x,y:a[0].object.mapNode.y-u.z}},groupID:a[0].object.mapNode.groupID,nodeType:a[0].object.mapNode.nodeType};if(this.hoverFilterFunction){var c=this.hoverFilterFunction({nodeType:a[0].object.mapNode.nodeType,typeID:a[0].object.mapNode.bdata&&a[0].object.mapNode.bdata.type,data:a[0].object.mapNode.bdata});c&&this.dispatchEvent(h)}else this.dispatchEvent(h)}this._mouseHoverStart=!1,this._mouseHoverTime=0}else this._mouseHoverTime+=e}},{key:"selectNull",value:function(){if(k.default[this.uuid].currentModel){k.default[this.uuid].currentAnimater&&(k.default[this.uuid].currentAnimater.stop(),k.default[this.uuid].currentAnimater=void 0);var e=k.default[this.uuid].currentModel;e.material.color=k.default[this.uuid].currentModel.material.userData.color,e.material.opacity=k.default[this.uuid].currentModel.material.userData.opacity,e.material.userData.opacity=void 0,e.material.userData.color=void 0,e.material.update=!0,k.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 t=this,n=e;if(e.nodeType&&e.nodeType===C.default.MODEL){if(!e.renderNodeInited)return;n=e.renderNode}if(k.default[this.uuid].currentModel&&k.default[this.uuid].currentModel!==n)if(k.default[this.uuid].currentAnimater&&(k.default[this.uuid].currentAnimater.stop(),k.default[this.uuid].currentAnimater=void 0),void 0===k.default[this.uuid].currentModel.material.length)k.default[this.uuid].currentModel.material.color=k.default[this.uuid].currentModel.material.userData.color,k.default[this.uuid].currentModel.material.opacity=k.default[this.uuid].currentModel.material.userData.opacity,k.default[this.uuid].currentModel.material.update=!0;else for(var i=0;i<k.default[this.uuid].currentModel.material.length;i++)k.default[this.uuid].currentModel.material[i].color=k.default[this.uuid].currentModel.material[i].userData.color,k.default[this.uuid].currentModel.material[i].opacity=k.default[this.uuid].currentModel.material[i].userData.opacity,k.default[this.uuid].currentModel.material[i].update=!0;if(k.default[this.uuid].currentModel=n,void 0===n.material.length)n.material.userData.color||(n.material.userData.color=n.material.color,n.material.userData.opacity=n.material.opacity);else for(var r=0;r<n.material.length;r++)n.material[r].userData.color||(n.material[r].userData.color=n.material[r].color,n.material[r].userData.opacity=n.material[r].opacity);if(!k.default[this.uuid].currentAnimater){var a=new I.default({r:this._modelSelectColor.r/2,g:this._modelSelectColor.g/2,b:this._modelSelectColor.b/2,a:this._modelSelectColor.a/2},this._modelSelectColor,500,function(){t.removeAnimater(a),k.default[t.uuid].currentAnimater=null},function(e){if(void 0===n.material.length)n.material.userData.color&&(n.material.color=new fm.Color(e.r,e.g,e.b),n.material.opacity=e.a,n.material.update=!0);else for(var t=0;t<n.material.length;t++)n.material[t].userData.color&&(n.material[t].color=new fm.Color(e.r,e.g,e.b),n.material[t].opacity=e.a,n.material[t].update=!0)});k.default[this.uuid].currentAnimater=a,a.start(),this._animaters.push(a)}}},{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 i=t.concat(n);if(i.length<1)return void this.selectNull();if(!this.MapOptions.modelSelectedEffect)return;this.storeSelect(i[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=[],i=1;i<e.length;i++)O.default.isRectCross(t.leftTop,t.rightDown,e[i].leftTop,e[i].rightDown)?e[i].target.visible=!1:(e[i].target.visible=!0,n.push(e[i]));1<n.length&&(n.reverse(),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 i=e.getMarkers(this._visibleGroups[n],t,this.renderer.domElementHeight);this.checkMarkerAvoid(i);for(var r=e.getUserMarkers(this._visibleGroups[n],t,this.renderer.domElementHeight),a=0;a<r.length;a++)this.checkMarkerAvoid(r[a])}}},{key:"addAnimater",value:function(e){this._animaters.push(e)}},{key:"initTheme",value:function(e,t,n){var i=this.MapOptions.themeFileType||t.filetype||t.fileType||t.image,r=new L.default(this.MapOptions.mapThemeURL,e);if(r.clearColor=this.MapOptions.defaultBackgroundColor,r.clearAlpha=this.MapOptions.defaultBackgroundAlpha,r.version=this.MapOptions.themeVersion,"rtheme"==i){var a=this.MapOptions.mapThemeURL+"/"+this.MapOptions.themeName+"/"+e+".rtheme";this.fmServer.getTheme(a,function(e){r.rtheme=e,r.data=t,n&&(r.fileType=i,n(r))},function(){r.rtheme=null,console.warn("以 rtheme 格式加入资源失败!")})}else r.rtheme=null,r.data=t,n&&n(r);this._modelSelectColor=r.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],i=this.mapScaleLevels[t]-e;return n<i?t+2:t+1}}},{key:"getMapScaleInfo",value:function(){for(var e,t=56;t<2e3;t++)!0===matchMedia("(max-resolution: "+t+"dpi)").matches&&(e=t/window.devicePixelRatio);if(window.screen.deviceXDPI)e=window.screen.deviceXDPI;else{var n=document.createElement("DIV");n.style.cssText="width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden",document.body.appendChild(n),e=(0,f.default)(n.offsetWidth),n.parentNode.removeChild(n)}this._pixelsPerCentimeter=e/2.54}},{key:"getOrthoCameraSizeByPerspectiveCamera",value:function(e,t,n){e instanceof h&&(n=t,t=e.controls,e=e.mapView.camera);var i=e.fov,r=e.aspect,a=null!=n?n:t.target.distanceTo(e.position),o=Math.tan(i*fm.Math.DEG2RAD/2)*a,s=2*o,l=s*r,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,i=Math.abs(t-n)*this._pixelsPerCentimeter*100/this.renderer.domElementHeight;return e/i}},{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 i=[],r=this.getFMGroup(e);return r.traverseByAlias([t],function(e){i.push(e),n&&n(e)},!0),i}},{key:"moveTo",value:function(e){return this._moveTo(e,!1)}},{key:"_moveTo",value:function(n,e){var t,i,r=this,a=this.center,o=n.x-a.x,s=-n.y+a.y,l=this.controls.target.x,u=this.controls.target.z,h=n.groupID;if(t=h?(i=this.controls.target.y,this.currentFocusGroup=h,this.nodeManager.getHeight(this._currentSceneId,this.currentFocusGroup)):(i=0,0),!this.MapOptions.moveToAnimateMode&&!e)return h&&this.controls.panUp(t-i),this.controls.panAdd({x:o-l,z:s-u,y:0}),this.controls.update(),null;k.default[this.uuid].currentMoveMapAnimater&&(k.default[this.uuid].currentMoveMapAnimater.stop(),this.removeAnimater(k.default[this.uuid].currentMoveMapAnimater));var c=new I.default({h:i,x:l,z:u},{h:t,x:o,z:s},n.time?1e3*n.time:500,function(){r.removeAnimater(c),k.default[r.uuid].currentMoveMapAnimater=null,n.callback&&n.callback()},function(e,t){h&&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 k.default[this.uuid].currentMoveMapAnimater=c,this._animaters.push(c),c}},{key:"moveToCenter",value:function(e){if("object"!==(0,d.default)(e)){var t=this.center;this.moveTo({x:t.x,y:t.y,groupID:e||this.focusGroupID})}else this.moveTo(e)}},{key:"rotateTo",value:function(n){var i=this,e=this.controls.getAzimuthalAngle(),t=-n.to%360*fm.Math.DEG2RAD,r=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,k.default[this.uuid].currentRotateAnimater&&(k.default[this.uuid].currentRotateAnimater.stop(),this.removeAnimater(k.default[this.uuid].currentRotateAnimater));var o=new I.default({theta:e},{theta:t},n.duration?1e3*n.duration:500,function(){i.removeAnimater(o),i.controls.setUpdate(void 0,void 0,void 0,r),n.callback&&n.callback()},function(e,t){i.controls.setUpdate(void 0,t.theta),n.update&&n.update()}).start();return k.default[this.uuid].currentRotateAnimater=o,this._animaters.push(o),o}},{key:"scaleTo",value:function(r,e){var a=this;if(r.scale){var t=r.scale,n=this.mapScale,i=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(i);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 I.default({phi:o,scale:n},{phi:i,scale:t},r.duration?1e3*r.duration:500,function(){a.removeAnimater(h),r.callback&&r.callback(),a.renderer.resetSpriteSize()},function(e,t){var n=(new fm.Vector3).copy(s).multiplyScalar(t.phi);a.controls.setUpdate(0,0,n),r.update&&r.update();var i=a.getCameraScaleByScale(e.scale);a.renderer.orthographicCamera.zoom=1/i,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(r){var a=this;if(r.level){var e=this.levelToScale(r.level),t=this.mapScale,n=this.getCameraDistanceByScale(e),i=this.controls.object.position.distanceTo(this.controls.target),o=(new fm.Vector3).copy(this.controls.object.position).sub(this.controls.target).normalize();if(!r.duration){var s=(new fm.Vector3).copy(o).multiplyScalar(n-i);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 I.default({phi:i,scale:t},{phi:n,scale:e},r.duration?1e3*r.duration:500,function(){a.removeAnimater(u),r.callback&&r.callback(),a.renderer.resetSpriteSize()},function(e,t){var n=(new fm.Vector3).copy(o).multiplyScalar(t.phi);a.controls.setUpdate(0,0,n),r.update&&r.update();var i=a.getCameraScaleByScale(e.scale);a.renderer.orthographicCamera.zoom=1/i,a.renderer.orthographicCamera.updateProjectionMatrix()}).start();return this._animaters.push(u),u}}},{key:"tiltTo",value:function(n){var i=this;if(0!==n.to&&n.to){var e=this.controls.getPolarAngle(),t=(90-n.to)*fm.Math.DEG2RAD,r=new I.default({phi:e},{phi:t},n.duration?1e3*n.duration:500,function(){i.removeAnimater(r),n.callback&&n.callback(),i.renderer.resetSpriteSize()},function(e,t){i.controls.setUpdate(t.phi),n.update&&n.update(e)}).start();return this._animaters.push(r),r}}},{key:"fullScreenAvaliable",value:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},{key:"coordMapToScreen",value:function(e,t,n){var i=this.threeCenter,r=this.center,a=this.controls.object,o=new fm.Vector3(e-r.x,i.y+n,-t+i.y+r.y);o.project(a);var s=this.renderer.container.clientWidth,l=this.renderer.container.clientHeight,u=s/2*o.x+s/2,h=-l/2*o.y+l/2;return{x:u,y:h}}},{key:"coordScreenToMap",value:function(e,t,n,i,r){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=i?new fm.Vector3(e,t,n):new fm.Vector3(e/this.renderer.domElementWidth*2-1,1-t/this.renderer.domElementHeight*2,.5);var 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 r?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=Math.abs(t.x-e.x),i=Math.abs(t.y-e.y),r=this.renderer.domElementHeight,a=this.renderer.domElementWidth,o=null;if(a<=r)if(n/i<=a/r){var s=r/this._pixelsPerCentimeter;o=100*i/s}else{var l=a/this._pixelsPerCentimeter;o=100*n/l}else if(n/i<=a/r){var u=r/this._pixelsPerCentimeter;o=100*i/u}else{var h=a/this._pixelsPerCentimeter;o=100*n/h}return o}},{key:"toggleToTop",value:function(n,e){var i=this,t=1<arguments.length&&void 0!==e?arguments[1]:1e3;this.controls.minPolarAngle=0,this.controls.update();var r=this.controls.getPolarAngle();k.default[this.uuid].curPolarAngle=r,this.MapOptions.viewModeAnimateMode||(t=.001);var a=new I.default({phi:r},{phi:0},t,function(){i.removeAnimater(a),i.controls.maxPolarAngle=0;var e=i.getScaleByCameraDistance(),t=i.getCameraScaleByScale(e);i.renderer.orthographicCamera.zoom=1/t,i.renderer.orthographicCamera.quaternion.copy(i.controls.object.quaternion),i.renderer.orthographicCamera.position.copy(i.controls.object.position),i.renderer.orthographicCamera.updateProjectionMatrix(),i.controls.object=i.renderer.orthographicCamera,n&&n(),i.renderer.resetSpriteSize(),k.default[i.uuid].isToggleViewMode=!1},function(e,t){i.controls.setUpdate(t.phi)}).start();k.default[this.uuid].isToggleViewMode=!0,this._animaters.push(a)}},{key:"toggleTo3D",value:function(e,t){var n=this,i=1<arguments.length&&void 0!==t?arguments[1]:1e3;this.controls.maxPolarAngle=(90-this.MapOptions.defaultMinTiltAngle)*fm.Math.DEG2RAD;var r=this.getScaleByCameraScale(),a=this.getCameraDistanceByScale(r);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=k.default[this.uuid].curPolarAngle?k.default[this.uuid].curPolarAngle:(90-this.MapOptions.defaultTiltAngle)*fm.Math.DEG2RAD;this.MapOptions.viewModeAnimateMode||(i=.001);var s=new I.default({phi:0},{phi:o},i,function(){e&&e(),n.removeAnimater(s),k.default[n.uuid].isToggleViewMode=!1,n.renderer.resetSpriteSize()},function(e,t){n.controls.setUpdate(t.phi)}).start();k.default[this.uuid].isToggleViewMode=!0,this._animaters.push(s)}},{key:"getPixelTo3DdisByGid",value:function(e){var t,n,i=(new fm.Vector3).copy(this.controls.target),r=this.nodeManager.getSceneCenter(this._currentSceneId);if(i.y=this.getFMGroup(e).height+this.getFMGroup(e).offsetHeight+r.y,"top"===this._viewMode){var a=this.renderer.orthographicCamera.top,o=this.renderer.orthographicCamera.bottom;n=10*Math.abs(a-o)/this.renderer.domElementHeight/this.renderer.orthographicCamera.zoom}else{var s=this.renderer.perspectiveCamera.near,l=this.renderer.perspectiveCamera.fov,u=this.controls.object.position.distanceTo(i);t=10*s*Math.tan(l/2*fm.Math.DEG2RAD)*2/this.renderer.domElementHeight,n=t*u/s}return 10/n}},{key:"dispose",value:function(){cancelAnimationFrame(this._loopHander),this.dispatchEvent({type:"dispose"});var e,t=H(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(),k.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 i=this.nodeManager.getGroup(t,n);i.addLocation(e)}},{key:"removeLocationMarker",value:function(e){this.removeLocationByGroup(e,this._currentSceneId,e.groupID),e.dispose()}},{key:"removeLocationByGroup",value:function(e,t,n){var i=this.nodeManager.getGroup(t,n);i.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=this._lineMarkers.indexOf(e);-1<t&&this._lineMarkers.splice(t,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,p.default)(e)){var t,n=H(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;this.removeLineMarker(i)}}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.container.clientWidth,this.renderer.container.clientHeight);var n=this.renderer.getCameraByViewMode(this._viewMode);t.near=n.near,t.far=n.far,t.url&&(t.map=this.nodeManager.materialManager.loadTexture(t.url,function(){}),t.map.wrapS=fm.RepeatWrapping,t.map.wrapT=fm.RepeatWrapping),this.addLineMarker(e,t)}},{key:"setLastRender",value:function(){var e=this.nodeManager.getSceneById(this._currentSceneId);if(e){var t=e.getLastRenderArray();this.renderer.setBackRender(t)}}},{key:"update",value:function(){if(this._loopHander=requestAnimationFrame(this.update.bind(this)),this.letUpdate){this.isFpsDisplay&&this.stats.begin();var e=(new Date).getTime(),t=e-this._currentTime;this._currentTime=e,this.mouseHoverEventFire(t);var n,i=H(this._animaters);try{for(i.s();!(n=i.n()).done;){var r=n.value;r.enable&&r.run(t)}}catch(e){i.e(e)}finally{i.f()}var a,o=H(this.animationMixers);try{for(o.s();!(a=o.n()).done;){var s=a.value;s.update(t/1e3)}}catch(e){o.e(e)}finally{o.f()}this.dispatchEvent({type:"frameLoop",delTime:t}),this.controls.update();var l,u=!1;this._renderTime+=t,1e3/this._allowfps<this._renderTime&&(l=this._renderTime,this._renderTime=0,u=!0),this.renderer&&u&&(this.updatePopsPosition(),this.allowRender&&(this.setLastRender(),this.renderer.update(this._viewMode)),this.dispatchEvent({type:"update",fps:1e3/l})),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=this._windowPops.indexOf(e);-1<t&&this._windowPops.splice(t,1)}},{key:"updatePopsPosition",value:function(){var e,t=this.renderer.getCameraByViewMode(this._viewMode),n=H(this._windowPops);try{for(n.s();!(e=n.n()).done;){var i=e.value;this.updatePopPosition(i,t)}}catch(e){n.e(e)}finally{n.f()}}},{key:"updatePopPosition",value:function(e,t){t=t||this.renderer.getCameraByViewMode(this._viewMode);var n=new fm.Vector3;if(e.threeCoord)n.copy(e.threeCoord);else if(e.marker)e.marker instanceof D.default?0<e.marker._meshes.length&&(e.marker._meshes[0].updateMatrixWorld(),e.marker._meshes[0].updateMatrixWorld(!0),n=(new fm.Vector3).setFromMatrixPosition(e.marker._meshes[0].matrixWorld)):(e.marker.renderNode.parent.updateMatrixWorld(),e.marker.renderNode.updateMatrixWorld(!0),n=(new fm.Vector3).setFromMatrixPosition(e.marker.renderNode.matrixWorld));else{var i=this.center;n=n.set(e.coord.x-i.x,this.getFMGroup(e.coord.groupID).getHeight()+e.coord.height,-e.coord.y+i.y)}var r=n.project(t),a=(r.x+1)/2*this.renderer.container.clientWidth,o=(1-r.y)/2*this.renderer.container.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.container}},{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,l,u){var h=t.x-e.x,c=t.y-e.y,i={x:0,y:0};i.x=(t.x+e.x)/2,i.y=(t.y+e.y)/2;var r=this.renderer.container.getElementsByTagName("canvas")[0].style.width,a=this.renderer.container.getElementsByTagName("canvas")[0].style.height,o=r.split("p")[0],d=a.split("p")[0],f=null;f=(t.x-e.x)/(t.y-e.y)>o/d?o/(t.x-e.x):d/(t.y-e.y);var s=i.x-o/2,p=i.y-d/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*f,d*f,o*(f-1)/2+s*f,d*(f-1)/2+p*f,o,d):this.renderer.orthographicCamera.setViewOffset(o*f,d*f,o*(f-1)/2+s*f,d*(f-1)/2+p*f,o,d),this.renderer.update(),v.width=h*f*_,v.height=c*f*_,v.style.width=h*f*_+"px",v.style.height=c*f*_+"px",n?(g.width=1240*Math.pow(1.414,l-1),g.height=1754*Math.pow(1.414,l-1),g.style.width=1240*Math.pow(1.414,l-1)+"px",g.style.height=1754*Math.pow(1.414,l-1)+"px"):(g.height=1240*Math.pow(1.414,l-1),g.width=1754*Math.pow(1.414,l-1),g.style.height=1240*Math.pow(1.414,l-1)+"px",g.style.width=1754*Math.pow(1.414,l-1)+"px"),y.height=c*Math.pow(1.414,l-1),y.width=h*Math.pow(1.414,l-1),y.style.height=c*Math.pow(1.414,l-1)+"px",y.style.width=h*Math.pow(1.414,l-1)+"px",x.src=m.toDataURL("image/png"),"3d"===this.viewMode?this.renderer.perspectiveCamera.clearViewOffset():this.renderer.orthographicCamera.clearViewOffset();var b=v.getContext("2d"),w=g.getContext("2d"),M=y.getContext("2d"),T=this;x.onload=function(){T.viewMode,b.drawImage(x,-(o*_-h*f*_)/2,-(d*_-c*f*_)/2);var s=new Image;s.src=v.toDataURL("image/png"),s.onload=function(){var e=Math.min(1240*Math.pow(1.414,l-1)/(h*f),1754*Math.pow(1.414,l-1)/(c*f)),t=(g.width-h*f*e)/2,n=(g.height-c*f*e)/2;w.drawImage(s,t,n,h*f*e,c*f*e),M.drawImage(s,0,0,h*Math.pow(1.414,l-1),c*Math.pow(1.414,l-1));var i=g.toDataURL("image/png"),r=y.toDataURL("image/png");if(-1<navigator.userAgent.indexOf("Edge")||-1<navigator.userAgent.indexOf(".NET4.0C")){var a=null,o=null;u(i,a,r,o)}else g.toBlob(function(t){y.toBlob(function(e){u(i,t,r,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 i=null;5===e[n].nodeType?i="model":4===e[n].nodeType?i="extent":12===e[n].nodeType?i="label":11===e[n].nodeType?i="facility":35===e[n].nodeType&&(i="externalModel"),t.push(this.getFMGroup(e[n].groupID).getNodeByLayerId(i,e[n].ID))}return t}},{key:"getEffectRenderer",value:function(){var e=new EffectRenderer(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={};-1<navigator.userAgent.indexOf("Opera")&&(e.userAgent="Opera"),-1<navigator.userAgent.indexOf("Firefox")&&(e.userAgent="FF"),-1<navigator.userAgent.indexOf("Chrome")&&(e.userAgent="Chrome"),-1<navigator.userAgent.indexOf("Safari")&&0===navigator.userAgent.indexOf("Chrome")&&(e.userAgent="Safari"),-1<navigator.userAgent.indexOf("compatible")&&-1<navigator.userAgent.indexOf("MSIE")&&!isOpera&&(e.userAgent="IE"),-1<navigator.userAgent.indexOf("Trident")&&(e.userAgent="Edge"),e.sdkVersion=N.default.VERSION+"."+N.default.BUILD,e.appName=this.MapOptions.appName;var t=document.createElement("canvas"),n=t.getContext("experimental-webgl"),i=n.getExtension("WEBGL_debug_renderer_info");e.gpu=n.getParameter(i.UNMASKED_RENDERER_WEBGL),e.os=navigator.platform;for(var r=!0,a=navigator.userAgent,o=new Array("Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"),s=0;s<o.length;s++)if(0<a.indexOf(o[s])){r=!1;break}r&&(e.device="pc");var l=new Date;e.time=l.getFullYear()+"-"+(l.getMonth()+1)+"-"+l.getDate()+" "+l.getHours()+":"+l.getMinutes();var u=(0,w.default)(e),h=new XMLHttpRequest;return h.open("POST","https://www.fengmap.com/FMCloud/sdk/collect",!0),h.setRequestHeader("Content-type","application/json"),h.setRequestHeader("X-Requested-With","XMLHttpRequest"),h.onreadystatechange=function(){4===h.readyState&&h.status},h.send(u),e}},{key:"getVideoMemoryAmount",value:function(e){var t=null;return t=this.videoMemory.getVideoMemoryAmount(e),t}},{key:"setThemeByJson",value:function(e,t){var n=this,i=this.nodeManager.getSceneById(this._currentSceneId);n.initTheme(e,t,function(e){n.setBackgroundColor(e.clearColor,e.clearAlpha),i.theme=e,i.changeTheme(e)})}},{key:"showAllGroup",get:function(){return this._showAllGroup}},{key:"compass",get:function(){var t=this,n=this.renderer,i=this.nodeManager.materialManager;return{setBgImage:function(e){t._compassBG=e,n.compassNode&&(n.compassNode.material.uniforms.mapBack.value=i.loadTexture(e,function(){n.compassNode.material.needsUpdate=!0}))},setFgImage:function(e){t._compassFG=e,n.compassNode&&(n.compassNode.material.uniforms.mapfront.value=i.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,c.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.renderer.resetSpriteSize(),this.dispatchEvent({type:"visibleGroupIDsChanged",gids:e})}},{key:"mapScaleLevel",set:function(e){var t,n;"object"===(0,d.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=this;if(!k.default[this.uuid].isToggleViewMode){var i=function(){n.dispatchEvent({type:"viewModeChange",mode:t})};if("3d"==t&&"3d"!=this._viewMode){this.renderer.viewMode=t,this._viewMode=t;var e=this.nodeManager.getRenderList();this.renderer.renderList=e,this.toggleTo3D(function(){i()},1e3*this.MapOptions.viewModeAnimateTime)}else"top"==t&&"top"!=this._viewMode&&this.toggleToTop(function(){n._viewMode=t,n.renderer.viewMode=t;var e=n.nodeManager.getRenderList();n.renderer.renderList=e,i()},1e3*this.MapOptions.viewModeAnimateTime)}}},{key:"showCompass",set:function(e){if(e&&!this.renderer.compassNode){var t=this.renderer.getAspect(),n=this.renderer.getScaleByPixels(1,this.MapOptions.compassSize),i=-this.renderer.getScaleByPixels(1,this.MapOptions.compassOffset[1]),r=this.renderer.getScaleByPixels(1,this.MapOptions.compassOffset[0])/t,a=this.renderer.getCompassOffset(this.MapOptions.compassPosition,n,t,r,i);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){this._currentFocusGroup=e,1<this.visibleGroupIDs.length?-1<this.visibleGroupIDs.indexOf(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,i=t.mapcenter,r=this.groupIDs[this.groupIDs.length-1],a=H(this._lineMarkers);try{for(a.s();!(n=a.n()).done;){var o=n.value;o.rebuildLine(i,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,i=this.nodeManager.getSceneById(this._currentSceneId),r=i.theme.themeName;r!==t&&this.fmServer.getTheme(e,function(e){n.initTheme(t,e,function(e){n.setBackgroundColor(e.clearColor,e.clearAlpha),i.theme=e,i.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.container;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){if(e!==this.labelLanguage){this.MapOptions.defaultLabelLanguage=e;var t=this.nodeManager.getSceneById(this._currentSceneId);t&&t.setLabelLanguage(e)}}},{key:"backgroundColor",set:function(e){this.renderer.renderer.setClearColor((0,f.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}(P.default),J=Z;t.default=J},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){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(2)),o=i(n(3)),s=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,i,r){void 0!==this._path&&(e=this._path+e);var a=new XMLHttpRequest;for(var o in a.open(this.requestMethod,e,!0),a.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),a.addEventListener("progress",function(){i&&i()},!1),a.addEventListener("error",function(){n()},!1),a.addEventListener("abort",function(){r&&r()},!1),void 0!==this._responseType&&(a.responseType=this._responseType),void 0!==this._withCredentials&&(a.withCredentials=this._withCredentials),a.overrideMimeType&&a.overrideMimeType(void 0!==this._mimeType?this._mimeType:"text/plain"),this._requestHeader)a.setRequestHeader(o,this._requestHeader[o]);a.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}(),l=s;t.default=l},function(e,ae,oe){"use strict";(function(e){var t=oe(1),n=oe(0);n(ae,"__esModule",{value:!0}),ae.ProtoBuf=void 0;var S=t(oe(120));oe(63),oe(50);var A=t(oe(77));oe(22);var L=t(oe(78)),I=t(oe(12)),h=t(oe(24));oe(75),oe(10),oe(123);var k=t(oe(64));oe(160),oe(44),oe(5),oe(4);var R=t(oe(28)),N=t(oe(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,N.default)(l.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),l.isLong=f;var a={},o={};function i(e,t){var n,i,r;return t?(e>>>=0,(r=0<=e&&e<256)&&(i=o[e],i)?i:(n=m(e,(0|e)<0?-1:0,!0),r&&(o[e]=n),n)):(e|=0,(r=-128<=e&&e<128)&&(i=a[e],i)?i:(n=m(e,e<0?-1:0,!1),r&&(a[e]=n),n))}function p(e,t){if(isNaN(e)||!isFinite(e))return t?b:x;if(t){if(e<0)return b;if(g<=e)return P}else{if(e<=-y)return C;if(y<=e+1)return E}return e<0?p(-e,t).neg():m(e%u|0,e/u|0,t)}function m(e,t,n){return new l(e,t,n)}l.fromInt=i,l.fromNumber=p,l.fromBits=m;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 x;if("number"==typeof t&&(n=t,t=!1),n=n||10,n<2||36<n)throw RangeError("radix");var i;if(0<(i=e.indexOf("-")))throw Error("interior hyphen");if(0===i)return d(e.substring(1),t,n).neg();for(var r=p(c(n,8)),a=x,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),l=(0,R.default)(e.substring(o,o+s),n);if(s<8){var u=p(c(n,s));a=a.mul(u).add(p(l))}else a=a.mul(r),a=a.add(p(l))}return a.unsigned=t,a}function v(e){return e instanceof l?e:"number"==typeof e?p(e):"string"==typeof e?d(e):m(e.low,e.high,e.unsigned)}l.fromString=d,l.fromValue=v;var r=65536,s=1<<24,u=r*r,g=u*u,y=g/2,_=i(s),x=i(0);l.ZERO=x;var b=i(0,!0);l.UZERO=b;var w=i(1);l.ONE=w;var M=i(1,!0);l.UONE=M;var T=i(-1);l.NEG_ONE=T;var E=m(-1,2147483647,!1);l.MAX_VALUE=E;var P=m(-1,-1,!0);l.MAX_UNSIGNED_VALUE=P;var C=m(0,-2147483648,!1);l.MIN_VALUE=C;var D=l.prototype;D.toInt=function(){return this.unsigned?this.low>>>0:this.low},D.toNumber=function(){return this.unsigned?(this.high>>>0)*u+(this.low>>>0):this.high*u+(this.low>>>0)},D.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(C)){var t=p(e),n=this.div(t),i=n.mul(t).sub(this);return n.toString(e)+i.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var r=p(c(e,6),this.unsigned),a=this,o="";;){var s=a.div(r),l=a.sub(s.mul(r)).toInt()>>>0,u=l.toString(e);if(a=s,a.isZero())return u+o;for(;u.length<6;)u="0"+u;o=""+u+o}},D.getHighBits=function(){return this.high},D.getHighBitsUnsigned=function(){return this.high>>>0},D.getLowBits=function(){return this.low},D.getLowBitsUnsigned=function(){return this.low>>>0},D.getNumBitsAbs=function(){if(this.isNegative())return this.eq(C)?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},D.isZero=function(){return 0===this.high&&0===this.low},D.isNegative=function(){return!this.unsigned&&this.high<0},D.isPositive=function(){return this.unsigned||0<=this.high},D.isOdd=function(){return 1==(1&this.low)},D.isEven=function(){return 0==(1&this.low)},D.equals=function(e){return f(e)||(e=v(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},D.eq=D.equals,D.notEquals=function(e){return!this.eq(e)},D.neq=D.notEquals,D.lessThan=function(e){return this.comp(e)<0},D.lt=D.lessThan,D.lessThanOrEqual=function(e){return this.comp(e)<=0},D.lte=D.lessThanOrEqual,D.greaterThan=function(e){return 0<this.comp(e)},D.gt=D.greaterThan,D.greaterThanOrEqual=function(e){return 0<=this.comp(e)},D.gte=D.greaterThanOrEqual,D.compare=function(e){if(f(e)||(e=v(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},D.comp=D.compare,D.negate=function(){return!this.unsigned&&this.eq(C)?C:this.not().add(w)},D.neg=D.negate,D.add=function(e){f(e)||(e=v(e));var t=this.high>>>16,n=65535&this.high,i=this.low>>>16,r=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+=r+l,c+=d>>>16,d&=65535,c+=i+s,h+=c>>>16,c&=65535,h+=n+o,u+=h>>>16,h&=65535,u+=t+a,u&=65535,m(c<<16|d,u<<16|h,this.unsigned)},D.subtract=function(e){return f(e)||(e=v(e)),this.add(e.neg())},D.sub=D.subtract,D.multiply=function(e){if(this.isZero())return x;if(f(e)||(e=v(e)),e.isZero())return x;if(this.eq(C))return e.isOdd()?C:x;if(e.eq(C))return this.isOdd()?C:x;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(_)&&e.lt(_))return p(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=65535&this.high,i=this.low>>>16,r=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+=r*l,c+=d>>>16,d&=65535,c+=i*l,h+=c>>>16,c&=65535,c+=r*s,h+=c>>>16,c&=65535,h+=n*l,u+=h>>>16,h&=65535,h+=i*s,u+=h>>>16,h&=65535,h+=r*o,u+=h>>>16,h&=65535,u+=t*l+n*s+i*o+r*a,u&=65535,m(c<<16|d,u<<16|h,this.unsigned)},D.mul=D.multiply,D.divide=function(e){if(f(e)||(e=v(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?b:x;var t,n,i;if(this.eq(C)){if(e.eq(w)||e.eq(T))return C;if(e.eq(C))return w;var r=this.shr(1);return t=r.div(e).shl(1),t.eq(x)?e.isNegative()?w:T:(n=this.sub(e.mul(t)),i=t.add(n.div(e)),i)}if(e.eq(C))return this.unsigned?b:x;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(i=x,n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(t)/Math.LN2),o=a<=48?1:c(2,a-48),s=p(t),l=s.mul(e);l.isNegative()||l.gt(n);)t-=o,s=p(t,this.unsigned),l=s.mul(e);s.isZero()&&(s=w),i=i.add(s),n=n.sub(l)}return i},D.div=D.divide,D.modulo=function(e){return f(e)||(e=v(e)),this.sub(this.div(e).mul(e))},D.mod=D.modulo,D.not=function(){return m(~this.low,~this.high,this.unsigned)},D.and=function(e){return f(e)||(e=v(e)),m(this.low&e.low,this.high&e.high,this.unsigned)},D.or=function(e){return f(e)||(e=v(e)),m(this.low|e.low,this.high|e.high,this.unsigned)},D.xor=function(e){return f(e)||(e=v(e)),m(this.low^e.low,this.high^e.high,this.unsigned)},D.shiftLeft=function(e){return f(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?m(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):m(0,this.low<<e-32,this.unsigned)},D.shl=D.shiftLeft,D.shiftRight=function(e){return f(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?m(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):m(this.high>>e-32,0<=this.high?0:-1,this.unsigned)},D.shr=D.shiftRight,D.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 m(n>>>e|t<<32-e,t>>>e,this.unsigned)}return m(32===e?t:t>>>e-32,0,this.unsigned)},D.shru=D.shiftRightUnsigned,D.toSigned=function(){return this.unsigned?m(this.low,this.high,!1):this},D.toUnsigned=function(){return this.unsigned?this:m(this.low,this.high,!0)};var O=function e(t,n,i){if(void 0===t&&(t=e.DEFAULT_CAPACITY),void 0===n&&(n=e.DEFAULT_ENDIAN),void 0===i&&(i=e.DEFAULT_NOASSERT),!i){if(t|=0,t<0)throw RangeError("Illegal capacity");n=!!n,i=!!i}this.buffer=0===t?B: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=i};O.VERSION="5.0.1",O.LITTLE_ENDIAN=!0,O.BIG_ENDIAN=!1,O.DEFAULT_CAPACITY=16,O.DEFAULT_ENDIAN=O.BIG_ENDIAN,O.DEFAULT_NOASSERT=!1,O.Long=l||null;var F=O.prototype;F.__isByteBuffer__,(0,N.default)(F,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var B=new ArrayBuffer(0),G=String.fromCharCode;function z(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function U(){var e=[],t=[];return function(){if(0===arguments.length)return t.join("")+G.apply(String,e);1024<e.length+arguments.length&&(t.push(G.apply(String,e)),e.length=0),Array.prototype.push.apply(e,arguments)}}function V(e,t,n,i,r){var a,o,s=8*r-i-1,l=(1<<s)-1,u=l>>1,h=-7,c=n?r-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+=i;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:1/0*(f?-1:1);o+=Math.pow(2,i),a-=u}return(f?-1:1)*o*Math.pow(2,a-i)}function H(e,t,n,i,r,a){var o,s,l,u=8*a-r-1,h=(1<<u)-1,c=h>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:a-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(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,r),o+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,r),o=0));8<=r;e[n+f]=255&s,f+=p,s/=256,r-=8);for(o=o<<r|s,u+=r;0<u;e[n+f]=255&o,f+=p,o/=256,u-=8);e[n+f-p]|=128*m}O.accessor=function(){return Uint8Array},O.allocate=function(e,t,n){return new O(e,t,n)},O.concat=function(e,t,n,i){"boolean"!=typeof t&&"string"==typeof t||(i=n,n=t,t=void 0);for(var r,a=0,o=0,s=e.length;o<s;++o)O.isByteBuffer(e[o])||(e[o]=O.wrap(e[o],t)),r=e[o].limit-e[o].offset,0<r&&(a+=r);if(0===a)return new O(0,n,i);var l,u=new O(a,n,i);for(o=0;o<s;)l=e[o++],r=l.limit-l.offset,r<=0||(u.view.set(l.view.subarray(l.offset,l.limit),u.offset),u.offset+=r);return u.limit=u.offset,u.offset=0,u},O.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},O.type=function(){return ArrayBuffer},O.wrap=function(e,t,n,i){if("string"!=typeof t&&(i=n,n=t,t=void 0),"string"==typeof e)switch(void 0===t&&(t="utf8"),t){case"base64":return O.fromBase64(e,n);case"hex":return O.fromHex(e,n);case"binary":return O.fromBinary(e,n);case"utf8":return O.fromUTF8(e,n);case"debug":return O.fromDebug(e,n);default:throw Error("Unsupported encoding: "+t)}if(null===e||"object"!==(0,k.default)(e))throw TypeError("Illegal buffer");var r;if(O.isByteBuffer(e))return r=F.clone.call(e),r.markedOffset=-1,r;if(e instanceof Uint8Array)r=new O(0,n,i),0<e.length&&(r.buffer=e.buffer,r.offset=e.byteOffset,r.limit=e.byteOffset+e.byteLength,r.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)r=new O(0,n,i),0<e.byteLength&&(r.buffer=e,r.offset=0,r.limit=e.byteLength,r.view=0<e.byteLength?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");r=new O(e.length,n,i),r.limit=e.length;for(var a=0;a<e.length;++a)r.view[a]=e[a]}return r},F.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 i,r=t,a=e.length,o=a>>3,s=0;for(t+=this.writeVarint32(a,t);o--;)i=1&!!e[s++]|(1&!!e[s++])<<1|(1&!!e[s++])<<2|(1&!!e[s++])<<3|(1&!!e[s++])<<4|(1&!!e[s++])<<5|(1&!!e[s++])<<6|(1&!!e[s++])<<7,this.writeByte(i,t++);if(s<a){var l=0;for(i=0;s<a;)i|=(1&!!e[s++])<<l++;this.writeByte(i,t++)}return n?(this.offset=t,this):t-r},F.readBitSet=function(e){var t=void 0===e;t&&(e=this.offset);var n,i=this.readVarint32(e),r=i.value,a=r>>3,o=0,s=[];for(e+=i.length;a--;)n=this.readByte(e++),s[o++]=!!(1&n),s[o++]=!!(2&n),s[o++]=!!(4&n),s[o++]=!!(8&n),s[o++]=!!(16&n),s[o++]=!!(32&n),s[o++]=!!(64&n),s[o++]=!!(128&n);if(o<r){var l=0;for(n=this.readByte(e++);o<r;)s[o++]=!!(n>>l++&1)}return t&&(this.offset=e),s},F.readBytes=function(e,t){var n=void 0===t;if(n&&(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=this.slice(t,t+e);return n&&(this.offset+=e),i},F.writeBytes=F.append,F.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 i=this.buffer.byteLength;return i<t&&this.resize((i*=2)>t?i:t),--t,this.view[t]=e,n&&(this.offset+=1),this},F.writeByte=F.writeInt8,F.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},F.readByte=F.readInt8,F.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 i=this.buffer.byteLength;return i<t&&this.resize((i*=2)>t?i:t),--t,this.view[t]=e,n&&(this.offset+=1),this},F.writeUInt8=F.writeUint8,F.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},F.readUInt8=F.readUint8,F.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 i=this.buffer.byteLength;return i<t&&this.resize((i*=2)>t?i: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},F.writeShort=F.writeInt16,F.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},F.readShort=F.readInt16,F.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 i=this.buffer.byteLength;return i<t&&this.resize((i*=2)>t?i: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},F.writeUInt16=F.writeUint16,F.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},F.readUInt16=F.readUint16,F.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 i=this.buffer.byteLength;return i<t&&this.resize((i*=2)>t?i: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},F.writeInt=F.writeInt32,F.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},F.readInt=F.readInt32,F.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 i=this.buffer.byteLength;return i<t&&this.resize((i*=2)>t?i: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},F.writeUInt32=F.writeUint32,F.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},F.readUInt32=F.readUint32,l&&(F.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 i=this.buffer.byteLength;i<t&&this.resize((i*=2)>t?i:t),t-=8;var r=e.low,a=e.high;return this.littleEndian?(this.view[t+3]=r>>>24&255,this.view[t+2]=r>>>16&255,this.view[t+1]=r>>>8&255,this.view[t]=255&r,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]=r>>>24&255,this.view[t+1]=r>>>16&255,this.view[t+2]=r>>>8&255,this.view[t+3]=255&r),n&&(this.offset+=8),this},F.writeLong=F.writeInt64,F.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,i=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,i=this.view[e+2]<<16,i|=this.view[e+1]<<8,i|=this.view[e],i+=this.view[e+3]<<24>>>0):(i=this.view[e+1]<<16,i|=this.view[e+2]<<8,i|=this.view[e+3],i+=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 r=new l(n,i,!1);return t&&(this.offset+=8),r},F.readLong=F.readInt64,F.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 i=this.buffer.byteLength;i<t&&this.resize((i*=2)>t?i:t),t-=8;var r=e.low,a=e.high;return this.littleEndian?(this.view[t+3]=r>>>24&255,this.view[t+2]=r>>>16&255,this.view[t+1]=r>>>8&255,this.view[t]=255&r,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]=r>>>24&255,this.view[t+1]=r>>>16&255,this.view[t+2]=r>>>8&255,this.view[t+3]=255&r),n&&(this.offset+=8),this},F.writeUInt64=F.writeUint64,F.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,i=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,i=this.view[e+2]<<16,i|=this.view[e+1]<<8,i|=this.view[e],i+=this.view[e+3]<<24>>>0):(i=this.view[e+1]<<16,i|=this.view[e+2]<<8,i|=this.view[e+3],i+=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 r=new l(n,i,!0);return t&&(this.offset+=8),r},F.readUInt64=F.readUint64),F.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 i=this.buffer.byteLength;return i<t&&this.resize((i*=2)>t?i:t),t-=4,H(this.view,e,t,this.littleEndian,23,4),n&&(this.offset+=4),this},F.writeFloat=F.writeFloat32,F.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=V(this.view,e,this.littleEndian,23,4);return t&&(this.offset+=4),n},F.readFloat=F.readFloat32,F.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 i=this.buffer.byteLength;return i<t&&this.resize((i*=2)>t?i:t),t-=8,H(this.view,e,t,this.littleEndian,52,8),n&&(this.offset+=8),this},F.writeDouble=F.writeFloat64,F.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=V(this.view,e,this.littleEndian,52,8);return t&&(this.offset+=8),n},F.readDouble=F.readFloat64,O.MAX_VARINT32_BYTES=5,O.calculateVarint32=function(e){return e>>>=0,e<128?1:e<16384?2:e<1<<21?3:e<1<<28?4:5},O.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},O.zigZagDecode32=function(e){return e>>>1^-(1&e)|0},F.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 i,r=O.calculateVarint32(e);t+=r;var a=this.buffer.byteLength;for(a<t&&this.resize((a*=2)>t?a:t),t-=r,e>>>=0;128<=e;)i=127&e|128,this.view[t++]=i,e>>>=7;return this.view[t++]=e,n?(this.offset=t,this):r},F.writeVarint32ZigZag=function(e,t){return this.writeVarint32(O.zigZagEncode32(e),t)},F.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,i=0,r=0;do{if(!this.noAssert&&e>this.limit){var a=Error("Truncated");throw a.truncated=!0,a}n=this.view[e++],i<5&&(r|=(127&n)<<7*i),++i}while(0!=(128&n));return r|=0,t?(this.offset=e,r):{value:r,length:i}},F.readVarint32ZigZag=function(e){var t=this.readVarint32(e);return"object"===(0,k.default)(t)?t.value=O.zigZagDecode32(t.value):t=O.zigZagDecode32(t),t},l&&(O.MAX_VARINT64_BYTES=10,O.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,i=e.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==n?t<16384?t<128?1:2:t<1<<21?3:4:n<16384?n<128?5:6:n<1<<21?7:8:i<128?9:10},O.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()},O.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()},F.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 i=O.calculateVarint64(e),r=e.toInt()>>>0,a=e.shiftRightUnsigned(28).toInt()>>>0,o=e.shiftRightUnsigned(56).toInt()>>>0;t+=i;var s=this.buffer.byteLength;switch(s<t&&this.resize((s*=2)>t?s:t),t-=i,i){case 10:this.view[t+9]=o>>>7&1;case 9:this.view[t+8]=9!==i?128|o:127&o;case 8:this.view[t+7]=8!==i?a>>>21|128:a>>>21&127;case 7:this.view[t+6]=7!==i?a>>>14|128:a>>>14&127;case 6:this.view[t+5]=6!==i?a>>>7|128:a>>>7&127;case 5:this.view[t+4]=5!==i?128|a:127&a;case 4:this.view[t+3]=4!==i?r>>>21|128:r>>>21&127;case 3:this.view[t+2]=3!==i?r>>>14|128:r>>>14&127;case 2:this.view[t+1]=2!==i?r>>>7|128:r>>>7&127;case 1:this.view[t]=1!==i?128|r:127&r}return n?(this.offset+=i,this):i},F.writeVarint64ZigZag=function(e,t){return this.writeVarint64(O.zigZagEncode64(e),t)},F.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,i=0,r=0,a=0,o=0;if(o=this.view[e++],i=127&o,128&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++],r=127&o,(128&o||this.noAssert&&void 0===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++],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(i|r<<28,r>>>4|a<<24,!1);return t?(this.offset=e,s):{value:s,length:e-n}},F.readVarint64ZigZag=function(e){var t=this.readVarint64(e);return t&&t.value instanceof l?t.value=O.zigZagDecode64(t.value):t=O.zigZagDecode64(t),t}),F.writeCString=function(e,t){var n=void 0===t;n&&(t=this.offset);var i,r=e.length;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(i=0;i<r;++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)}r=Y.calculateUTF16asUTF8(z(e))[1],t+=r+1;var a=this.buffer.byteLength;return a<t&&this.resize((a*=2)>t?a:t),t-=r+1,Y.encodeUTF16toUTF8(z(e),function(e){this.view[t++]=e}.bind(this)),this.view[t++]=0,n?(this.offset=t,this):r},F.readCString=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,i=e,r=-1;return Y.decodeUTF8toUTF16(function(){if(0===r)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return r=this.view[e++],0===r?null:r}.bind(this),n=U(),!0),t?(this.offset=e,n()):{string:n(),length:e-i}},F.writeIString=function(e,t){var n=void 0===t;if(n&&(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,r=t;i=Y.calculateUTF16asUTF8(z(e),this.noAssert)[1],t+=4+i;var a=this.buffer.byteLength;if(a<t&&this.resize((a*=2)>t?a:t),t-=4+i,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):(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),t+=4,Y.encodeUTF16toUTF8(z(e),function(e){this.view[t++]=e}.bind(this)),t!==r+4+i)throw RangeError("Illegal range: Truncated data, "+t+" == "+(t+4+i));return n?(this.offset=t,this):t-r},F.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,i=this.readUint32(e),r=this.readUTF8String(i,O.METRICS_BYTES,e+=4);return e+=r.length,t?(this.offset=e,r.string):{string:r.string,length:e-n}},O.METRICS_CHARS="c",O.METRICS_BYTES="b",F.writeUTF8String=function(e,t){var n,i=void 0===t;if(i&&(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 r=t;n=Y.calculateUTF16asUTF8(z(e))[1],t+=n;var a=this.buffer.byteLength;return a<t&&this.resize((a*=2)>t?a:t),t-=n,Y.encodeUTF16toUTF8(z(e),function(e){this.view[t++]=e}.bind(this)),i?(this.offset=t,this):t-r},F.writeString=F.writeUTF8String,O.calculateUTF8Chars=function(e){return Y.calculateUTF16asUTF8(z(e))[0]},O.calculateUTF8Bytes=function(e){return Y.calculateUTF16asUTF8(z(e))[1]},O.calculateString=O.calculateUTF8Bytes,F.readUTF8String=function(e,t,n){"number"==typeof t&&(n=t,t=void 0);var i=void 0===n;if(i&&(n=this.offset),void 0===t&&(t=O.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 r,a=0,o=n;if(t===O.METRICS_CHARS){if(r=U(),Y.decodeUTF8(function(){return a<e&&n<this.limit?this.view[n++]:null}.bind(this),function(e){++a,Y.UTF8toUTF16(e,r)}),a!==e)throw RangeError("Illegal range: Truncated data, "+a+" == "+e);return i?(this.offset=n,r()):{string:r(),length:n-o}}if(t!==O.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 s=n+e;if(Y.decodeUTF8toUTF16(function(){return n<s?this.view[n++]:null}.bind(this),r=U(),this.noAssert),n!==s)throw RangeError("Illegal range: Truncated data, "+n+" == "+s);return i?(this.offset=n,r()):{string:r(),length:n-o}},F.readString=F.readUTF8String,F.writeVString=function(e,t){var n=void 0===t;if(n&&(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,r,a=t;i=Y.calculateUTF16asUTF8(z(e),this.noAssert)[1],r=O.calculateVarint32(i),t+=r+i;var o=this.buffer.byteLength;if(o<t&&this.resize((o*=2)>t?o:t),t-=r+i,t+=this.writeVarint32(i,t),Y.encodeUTF16toUTF8(z(e),function(e){this.view[t++]=e}.bind(this)),t!==a+i+r)throw RangeError("Illegal range: Truncated data, "+t+" == "+(t+i+r));return n?(this.offset=t,this):t-a},F.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,i=this.readVarint32(e),r=this.readUTF8String(i.value,O.METRICS_BYTES,e+=i.length);return e+=r.length,t?(this.offset=e,r.string):{string:r.string,length:e-n}},F.append=function(e,t,n){"number"!=typeof t&&"string"==typeof t||(n=t,t=void 0);var i=void 0===n;if(i&&(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 O||(e=O.wrap(e,t));var r=e.limit-e.offset;if(r<=0)return this;n+=r;var a=this.buffer.byteLength;return a<n&&this.resize((a*=2)>n?a:n),n-=r,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=r,i&&(this.offset+=r),this},F.appendTo=function(e,t){return e.append(this,t),this},F.assert=function(e){return this.noAssert=!e,this},F.capacity=function(){return this.buffer.byteLength},F.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},F.clone=function(e){var t=new O(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},F.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=B,this.view=null,0<=this.markedOffset&&(this.markedOffset-=e),this.offset=0,this.limit=0,this;var i=new ArrayBuffer(n),r=new Uint8Array(i);return r.set(this.view.subarray(e,t)),this.buffer=i,this.view=r,0<=this.markedOffset&&(this.markedOffset-=e),this.offset=0,this.limit=n,this},F.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 O(0,this.littleEndian,this.noAssert);var n=t-e,i=new O(n,this.littleEndian,this.noAssert);return i.offset=0,i.limit=n,0<=i.markedOffset&&(i.markedOffset-=e),this.copyTo(i,0,e,t),i},F.copyTo=function(e,t,n,i){var r,a;if(!this.noAssert&&!O.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(a=void 0===t)?e.offset:0|t,n=(r=void 0===n)?this.offset:0|n,i=void 0===i?this.limit:0|i,t<0||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(n<0||i>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);var o=i-n;return 0===o?e:(e.ensureCapacity(t+o),e.view.set(this.view.subarray(n,i),t),r&&(this.offset+=o),a&&(e.offset+=o),this)},F.ensureCapacity=function(e){var t=this.buffer.byteLength;return t<e?this.resize((t*=2)>e?t:e):this},F.fill=function(e,t,n){var i=void 0===t;if(i&&(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 i&&(this.offset=t),this},F.flip=function(){return this.limit=this.offset,this.offset=0,this},F.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},F.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},F.LE=function(e){return this.littleEndian=void 0===e||!!e,this},F.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},F.prepend=function(e,t,n){"number"!=typeof t&&"string"==typeof t||(n=t,t=void 0);var i=void 0===n;if(i&&(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 O||(e=O.wrap(e,t));var r=e.limit-e.offset;if(r<=0)return this;var a=r-n;if(0<a){var o=new ArrayBuffer(this.buffer.byteLength+a),s=new Uint8Array(o);s.set(this.view.subarray(n,this.buffer.byteLength),r),this.buffer=o,this.view=s,this.offset+=a,0<=this.markedOffset&&(this.markedOffset+=a),this.limit+=a,n+=a}else new Uint8Array(this.buffer);return this.view.set(e.view.subarray(e.offset,e.limit),n-r),e.offset=e.limit,i&&(this.offset-=r),this},F.prependTo=function(e,t){return e.prepend(this,t),this},F.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},F.remaining=function(){return this.limit-this.offset},F.reset=function(){return 0<=this.markedOffset?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},F.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)}if(this.buffer.byteLength<e){var t=new ArrayBuffer(e),n=new Uint8Array(t);n.set(this.view),this.buffer=t,this.view=n}return this},F.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||Array.prototype.reverse.call(this.view.subarray(e,t)),this},F.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},F.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},F.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 B;var i=new ArrayBuffer(n-t);return new Uint8Array(i).set(new Uint8Array(this.buffer).subarray(t,n),0),i},F.toArrayBuffer=F.toBuffer,F.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 j=function(){for(var e={},r=[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=r.length;t<n;++t)o[r[t]]=t;return e.encode=function(e,t){for(var n,i;null!==(n=e());)t(r[n>>2&63]),i=(3&n)<<4,null!==(n=e())?(i|=n>>4&15,t(r[63&(i|n>>4&15)]),i=(15&n)<<2,null!==(n=e())?(t(r[63&(i|n>>6&3)]),t(r[63&n])):(t(r[63&i]),t(61))):(t(r[63&i]),t(61),t(61))},e.decode=function(e,t){var n,i,r;function a(e){throw Error("Illegal character code: "+e)}for(;null!==(n=e());)if(i=o[n],void 0===i&&a(n),null!==(n=e())&&(r=o[n],void 0===r&&a(n),t(i<<2>>>0|(48&r)>>4),null!==(n=e()))){if(i=o[n],void 0===i){if(61===n)break;a(n)}if(t((15&r)<<4>>>0|(60&i)>>2),null!==(n=e())){if(r=o[n],void 0===r){if(61===n)break;a(n)}t((3&i)<<6>>>0|r)}}},e.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)},e}();F.toBase64=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");var n;return j.encode(function(){return e<t?this.view[e++]:null}.bind(this),n=U()),n()},O.fromBase64=function(e,t){if("string"!=typeof e)throw TypeError("str");var n=new O(e.length/4*3,t),i=0;return j.decode(z(e),function(e){n.view[i++]=e}),n.limit=i,n},O.btoa=function(e){return O.fromBinary(e).toBase64()},O.atob=function(e){return O.fromBase64(e).toBinary()},F.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=[],i=[];e<t;)n.push(this.view[e++]),1024<=n.length&&(i.push(String.fromCharCode.apply(String,n)),n=[]);return i.join("")+String.fromCharCode.apply(String,n)},O.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var n,i=0,r=e.length,a=new O(r,t);i<r;){if(n=e.charCodeAt(i),255<n)throw RangeError("illegal char code: "+n);a.view[i++]=n}return a.limit=r,a},F.toDebug=function(e){for(var t,n=-1,i=this.buffer.byteLength,r="",a="",o="";n<i;){if(-1!==n&&(t=this.view[n],r+=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!==i){for(;r.length<51;)r+=" ";o+=r+a+"\n",r=a=""}n===this.offset&&n===this.limit?r+=n===this.markedOffset?"!":"|":n===this.offset?r+=n===this.markedOffset?"[":"<":n===this.limit?r+=n===this.markedOffset?"]":">":r+=n===this.markedOffset?"'":e||0!==n&&n!==i?" ":""}if(e&&" "!==r){for(;r.length<51;)r+=" ";o+=r+a+"\n"}return e?o:r},O.fromDebug=function(e,t,n){for(var i,r,a=e.length,o=new O((a+1)/3|0,t,n),s=0,l=0,u=!1,h=!1,c=!1,d=!1,f=!1;s<a;){switch(i=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(r=(0,R.default)(i+e.charAt(s++),16),!n&&(isNaN(r)||r<0||255<r))throw TypeError("Illegal str: Not a debug encoded string");o.view[l++]=r,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},F.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,i=new Array(t-e);e<t;)n=this.view[e++],n<16?i.push("0",n.toString(16)):i.push(n.toString(16));return i.join("")},O.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 i,r=e.length,a=new O(r/2|0,t),o=0,s=0;o<r;o+=2){if(i=(0,R.default)(e.substring(o,o+2),16),!n&&(!isFinite(i)||i<0||255<i))throw TypeError("Illegal str: Contains non-hex characters");a.view[s++]=i}return a.limit=s,a};var W,Y=(W={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,i,r,a,o=function(e){e=e.slice(0,e.indexOf(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===(i=e())&&o([n,i]),t((31&n)<<6|63&i);else if(224==(240&n))null!==(i=e())&&null!==(r=e())||o([n,i,r]),t((15&n)<<12|(63&i)<<6|63&r);else{if(240!=(248&n))throw RangeError("Illegal starting byte: "+n);null!==(i=e())&&null!==(r=e())&&null!==(a=e())||o([n,i,r,a]),t((7&n)<<18|(63&i)<<12|(63&r)<<6|63&a)}},UTF16toUTF8:function(e,t){for(var n,i=null;null!==(n=null!==i?i:e());)55296<=n&&n<=57343&&null!==(i=e())&&56320<=i&&i<=57343?(t(1024*(n-55296)+i-56320+65536),i=null):t(n);null!==i&&t(i)},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){W.UTF16toUTF8(e,function(e){W.encodeUTF8(e,t)})},decodeUTF8toUTF16:function(e,t){W.decodeUTF8(e,function(e){W.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 W.UTF16toUTF8(e,function(e){++t,n+=e<128?1:e<2048?2:e<65536?3:4}),[t,n]}},W);F.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;try{Y.decodeUTF8toUTF16(function(){return t<n?this.view[t++]:null}.bind(this),e=U())}catch(e){if(t!==n)throw RangeError("Illegal range: Truncated data, "+t+" != "+n)}return e()},O.fromUTF8=function(e,t,n){if(!n&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var i=new O(Y.calculateUTF16asUTF8(z(e),!0)[1],t,n),r=0;return Y.encodeUTF16toUTF8(z(e),function(e){i.view[r++]=e}),i.limit=r,i};var q,X,Z,J,K,Q,$,ee,te,ne={};function ie(t){t.messages&&t.messages.forEach(function(e){e.syntax=t.syntax,ie(e)}),t.enums&&t.enums.forEach(function(e){e.syntax=t.syntax})}function re(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}ae.ProtoBuf=ne,ne.ByteBuffer=O,ne.Long=O.Long||null,ne.VERSION="5.0.1",ne.WIRE_TYPES={},ne.WIRE_TYPES.VARINT=0,ne.WIRE_TYPES.BITS64=1,ne.WIRE_TYPES.LDELIM=2,ne.WIRE_TYPES.STARTGROUP=3,ne.WIRE_TYPES.ENDGROUP=4,ne.WIRE_TYPES.BITS32=5,ne.PACKABLE_WIRE_TYPES=[ne.WIRE_TYPES.VARINT,ne.WIRE_TYPES.BITS64,ne.WIRE_TYPES.BITS32],ne.TYPES={int32:{name:"int32",wireType:ne.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:ne.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:ne.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:ne.WIRE_TYPES.VARINT,defaultValue:ne.Long?ne.Long.ZERO:void 0},uint64:{name:"uint64",wireType:ne.WIRE_TYPES.VARINT,defaultValue:ne.Long?ne.Long.UZERO:void 0},sint64:{name:"sint64",wireType:ne.WIRE_TYPES.VARINT,defaultValue:ne.Long?ne.Long.ZERO:void 0},bool:{name:"bool",wireType:ne.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:ne.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:ne.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:ne.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:ne.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:ne.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:ne.WIRE_TYPES.BITS64,defaultValue:ne.Long?ne.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:ne.WIRE_TYPES.BITS64,defaultValue:ne.Long?ne.Long.ZERO:void 0},float:{name:"float",wireType:ne.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:ne.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:ne.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:ne.WIRE_TYPES.STARTGROUP,defaultValue:null}},ne.MAP_KEY_TYPES=[ne.TYPES.int32,ne.TYPES.sint32,ne.TYPES.sfixed32,ne.TYPES.uint32,ne.TYPES.fixed32,ne.TYPES.int64,ne.TYPES.sint64,ne.TYPES.sfixed64,ne.TYPES.uint64,ne.TYPES.fixed64,ne.TYPES.bool,ne.TYPES.string,ne.TYPES.bytes],ne.ID_MIN=1,ne.ID_MAX=536870911,ne.convertFieldsToCamelCase=!1,ne.populateAccessors=!0,ne.populateDefaults=!0,ne.Util=(q={},q.IS_NODE=!("object"!==(void 0===e?"undefined":(0,k.default)(e))||e+""!="[object process]"||e.browser),q.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},q.fetch=function(e,n){if(n&&"function"!=typeof n&&(n=null),q.IS_NODE){var t=oe(401);if(n)t.readFile(e,function(e,t){n(e?null:""+t)});else try{return t.readFileSync(e)}catch(e){return null}}else{var i=q.XHR();if(i.open("GET",e,!!n),i.setRequestHeader("Accept","text/plain"),"function"==typeof i.overrideMimeType&&i.overrideMimeType("text/plain"),!n)return i.send(null),200==i.status||0==i.status&&"string"==typeof i.responseText?i.responseText:null;if(i.onreadystatechange=function(){4==i.readyState&&(200==i.status||0==i.status&&"string"==typeof i.responseText?n(i.responseText):n(null))},4==i.readyState)return;i.send(null)}},q.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,function(e,t){return t.toUpperCase()})},q),ne.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},ne.DotProto=function(r,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 i=this.index;o.DELIM.lastIndex=0;var r=o.DELIM.test(this.source.charAt(i++));if(!r)for(;i<this.source.length&&!o.DELIM.test(this.source.charAt(i));)++i;var a=this.source.substring(this.index,this.index=i);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 i=function(e){this.tn=new t(e),this.proto3=!1},a=i.prototype;function s(e,t){var n=-1,i=1;if("-"==e.charAt(0)&&(i=-1,e=e.substring(1)),o.NUMBER_DEC.test(e))n=(0,R.default)(e);else if(o.NUMBER_HEX.test(e))n=(0,R.default)(e.substring(2),16);else{if(!o.NUMBER_OCT.test(e))throw Error("illegal id value: "+(i<0?"-":"")+e);n=(0,R.default)(e.substring(1),8)}if(n=i*n|0,!t&&n<0)throw Error("illegal id value: "+(i<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,R.default)(e,10);if(o.NUMBER_HEX.test(e))return t*(0,R.default)(e.substring(2),16);if(o.NUMBER_OCT.test(e))return t*(0,R.default)(e.substring(1),8);if("inf"===e)return t*(1/0);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,I.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:[]},i=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!i||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(!i)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(!i)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),i=!1;break;case"enum":this._parseEnum(n),i=!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},i.parse=function(e){return new i(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(),i=!1;if("("===n&&(i=!0,n=this.tn.next()),!o.TYPEREF.test(n))throw Error("illegal option name: "+n);var r=n;i&&(this.tn.skip(")"),r="("+r+")",n=this.tn.peek(),o.FQTYPEREF.test(n)&&(r+=n,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,r),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,i={name:n,rpc:{},options:{}};for(this.tn.skip("{");"}"!==(t=this.tn.next());)if("option"===t)this._parseOption(i);else{if("rpc"!==t)throw Error("illegal service token: "+t);this._parseServiceRPC(i)}this.tn.omit(";"),e.services.push(i)},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 i=n,r={request:null,response:null,request_stream:!1,response_stream:!1,options:{}};if(this.tn.skip("("),n=this.tn.next(),"stream"===n.toLowerCase()&&(r.request_stream=!0,n=this.tn.next()),!o.TYPEREF.test(n))throw Error("illegal rpc service request type: "+n);if(r.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()&&(r.response_stream=!0,n=this.tn.next()),r.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(r)}this.tn.omit(";")}else this.tn.skip(";");void 0===e[t]&&(e[t]={}),e[t][i]=r},a._parseMessage=function(e,t){var n=!!t,i=this.tn.next(),r={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!o.NAME.test(i))throw Error("illegal "+(n?"group":"message")+" name: "+i);for(r.name=i,n&&(this.tn.skip("="),t.id=s(this.tn.next()),r.isGroup=!0),i=this.tn.peek(),"["===i&&t&&this._parseFieldOptions(t),this.tn.skip("{");"}"!==(i=this.tn.next());)if(o.RULE.test(i))this._parseMessageField(r,i);else if("oneof"===i)this._parseMessageOneOf(r);else if("enum"===i)this._parseEnum(r);else if("message"===i)this._parseMessage(r);else if("option"===i)this._parseOption(r);else if("service"===i)this._parseService(r);else if("extensions"===i)r.extensions=this._parseExtensionRanges();else if("reserved"===i)this._parseIgnored();else if("extend"===i)this._parseExtend(r);else{if(!o.TYPEREF.test(i))throw Error("illegal message token: "+i);if(!this.proto3)throw Error("illegal field rule: "+i);this._parseMessageField(r,"optional",i)}return this.tn.omit(";"),e.messages.push(r),r},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 i,r={rule:t,type:"",name:"",options:{},id:0};if("map"===t){if(n)throw Error("illegal type: "+n);if(this.tn.skip("<"),i=this.tn.next(),!o.TYPE.test(i)&&!o.TYPEREF.test(i))throw Error("illegal message field type: "+i);if(r.keytype=i,this.tn.skip(","),i=this.tn.next(),!o.TYPE.test(i)&&!o.TYPEREF.test(i))throw Error("illegal message field: "+i);if(r.type=i,this.tn.skip(">"),i=this.tn.next(),!o.NAME.test(i))throw Error("illegal message field name: "+i);r.name=i,this.tn.skip("="),r.id=s(this.tn.next()),i=this.tn.peek(),"["===i&&this._parseFieldOptions(r),this.tn.skip(";")}else if(n=void 0!==n?n:this.tn.next(),"group"===n){var a=this._parseMessage(e,r);if(!/^[A-Z]/.test(a.name))throw Error("illegal group name: "+a.name);r.type=a.name,r.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(r.type=n,i=this.tn.next(),!o.NAME.test(i))throw Error("illegal message field name: "+i);r.name=i,this.tn.skip("="),r.id=s(this.tn.next()),i=this.tn.peek(),"["===i&&this._parseFieldOptions(r),this.tn.skip(";")}return e.fields.push(r),r},a._parseMessageOneOf=function(e){var t=this.tn.next();if(!o.NAME.test(t))throw Error("illegal oneof name: "+t);var n,i=t,r=[];for(this.tn.skip("{");"}"!==(t=this.tn.next());)n=this._parseMessageField(e,"optional",t),n.oneof=i,r.push(n.id);this.tn.omit(";"),e.oneofs[i]=r},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 i={name:n,id:s(this.tn.next(),!0)};n=this.tn.peek(),"["===n&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),t.values.push(i)}this.tn.omit(";"),e.enums.push(t)},a._parseExtensionRanges=function(){var e,t,n,i=[];do{for(t=[];;){switch(e=this.tn.next(),e){case"min":n=r.ID_MIN;break;case"max":n=r.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()}i.push(t)}while(this.tn.omit(","));return this.tn.skip(";"),i},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=i,e}(ne,ne.Lang),ne.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,i,r){h.call(this,e,t,n),this.className="Namespace",this.children=[],this.options=i||{},this.syntax=r||"proto2"},t=s.prototype=(0,L.default)(h.prototype);t.getChildren=function(e){if(e=e||null,null==e)return this.children.slice();for(var t=[],n=0,i=this.children.length;n<i;++n)this.children[n]instanceof e&&t.push(this.children[n]);return t},t.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof d.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof d.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,i=this.children.length;n<i;++n)if(this.children[n][t]===e)return this.children[n];return null},t.resolve=function(e,t){var n,i="string"==typeof e?e.split("."):e,r=this,a=0;if(""===i[a]){for(;null!==r.parent;)r=r.parent;a++}do{do{if(!(r instanceof o.Namespace)){r=null;break}if(n=r.getChild(i[a]),!n||!(n instanceof o.T)||t&&!(n instanceof o.Namespace)){r=null;break}r=n,a++}while(a<i.length);if(null!=r)break;if(null!==this.parent)return this.parent.resolve(e,t)}while(null!=r);return r},t.qn=function(e){for(var t=[],n=e;t.unshift(n.name),n=n.parent,null!==n;);for(var i=1;i<=t.length;i++){var r=t.slice(t.length-i);if(e===this.resolve(r,e instanceof o.Namespace))return r.join(".")}return e.fqn()},t.build=function(){for(var e,t={},n=this.children,i=0,r=n.length;i<r;++i)e=n[i],e instanceof s&&(t[e.name]=e.build());return N.default&&(0,N.default)(t,"$options",{value:this.buildOpt()}),t},t.buildOpt=function(){for(var e={},t=(0,A.default)(this.options),n=0,i=t.length;n<i;++n){var r=t[n],a=this.options[t[n]];e[r]=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 c=function(e,t,n,i){if(this.type=e,this.resolvedType=t,this.isMapKey=n,this.syntax=i,n&&m.MAP_KEY_TYPES.indexOf(e)<0)throw Error("Invalid map key type: "+e.name)},n=c.prototype;function i(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 O(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")}c.defaultFieldValue=i,n.verifyValue=function(t){var n=this;function i(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)&&i((0,k.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)&&i((0,k.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){i((0,k.default)(t),e.message)}else i((0,k.default)(t),"requires Long.js");case m.TYPES.uint64:case m.TYPES.fixed64:if(m.Long)try{return l(t,!0)}catch(e){i((0,k.default)(t),e.message)}else i((0,k.default)(t),"requires Long.js");case m.TYPES.bool:return"boolean"!=typeof t&&i((0,k.default)(t),"not a boolean"),t;case m.TYPES.float:case m.TYPES.double:return"number"!=typeof t&&i((0,k.default)(t),"not a number"),t;case m.TYPES.string:return"string"==typeof t||t&&t instanceof String||i((0,k.default)(t),"not a string"),""+t;case m.TYPES.bytes:return O.isByteBuffer(t)?t:O.wrap(t,"base64");case m.TYPES.enum:var e=this.resolvedType.getChildren(m.Reflect.Enum.Value);for(a=0;a<e.length;a++){if(e[a].name==t)return e[a].id;if(e[a].id==t)return e[a].id}if("proto3"===this.syntax)return("number"!=typeof t||t==t&&t%1!=0)&&i((0,k.default)(t),"not an integer"),(4294967295<t||t<0)&&i((0,k.default)(t),"not in range for uint32"),t;i(t,"not a valid enum value");case m.TYPES.group:case m.TYPES.message:if(t&&"object"===(0,k.default)(t)||i((0,k.default)(t),"object expected"),t instanceof this.resolvedType.clazz)return t;if(t instanceof m.Builder.Message){var r={};for(var a in t)t.hasOwnProperty(a)&&(r[a]=t[a]);t=r}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?O.calculateVarint64(t):O.calculateVarint32(t);case m.TYPES.uint32:return O.calculateVarint32(t);case m.TYPES.sint32:return O.calculateVarint32(O.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 O.calculateVarint64(t);case m.TYPES.sint64:return O.calculateVarint64(O.zigZagEncode64(t));case m.TYPES.fixed64:case m.TYPES.sfixed64:return 8;case m.TYPES.bool:return 1;case m.TYPES.enum:return O.calculateVarint32(t);case m.TYPES.double:return 8;case m.TYPES.string:return n=O.calculateUTF8Bytes(t),O.calculateVarint32(n)+n;case m.TYPES.bytes:if(t.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+t.remaining()+" bytes remaining");return O.calculateVarint32(t.remaining())+t.remaining();case m.TYPES.message:return n=this.resolvedType.calculate(t),O.calculateVarint32(n)+n;case m.TYPES.group:return n=this.resolvedType.calculate(t),n+O.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 i=t.offset;n.writeVarint32(t.remaining()),n.append(t),t.offset=i;break;case m.TYPES.message:var r=(new O).LE();this.resolvedType.encode(t,r),n.writeVarint32(r.offset),n.append(r.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 i,r;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(r=e.readVarint32(),e.remaining()<r)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+r+" required but got only "+e.remaining());return i=e.clone(),i.limit=i.offset+r,e.offset+=r,i;case m.TYPES.message:return r=e.readVarint32(),this.resolvedType.decode(e,r);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,R.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 O.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=c;var d=function(e,t,n,i,r,a){s.call(this,e,t,n,i,a),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!r,this._fields=null,this._fieldsById=null,this._fieldsByName=null},r=d.prototype=(0,L.default)(s.prototype);function v(e,t){var n=t.readVarint32(),i=7&n,r=n>>>3;switch(i){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(r,t);break;case m.WIRE_TYPES.ENDGROUP:if(r===e)return!1;throw Error("Illegal GROUPEND after unknown group: "+r+" ("+e+" expected)");case m.WIRE_TYPES.BITS32:t.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+e+": "+i)}return!0}r.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),i=function e(t){c.Builder.Message.call(this);for(var n=0,i=l.length;n<i;++n)this[l[n].name]=null;for(n=0,i=s.length;n<i;++n){var r=s[n];this[r.name]=r.repeated?[]:r.map?new c.Map(r):null,!r.required&&"proto3"!==o.syntax||null===r.defaultValue||(this[r.name]=r.defaultValue)}var a;if(0<arguments.length)if(1!==arguments.length||null===t||"object"!==(0,k.default)(t)||!("function"!=typeof t.encode||t instanceof e)||(0,I.default)(t)||t instanceof c.Map||O.isByteBuffer(t)||t instanceof ArrayBuffer||c.Long&&t instanceof c.Long)for(n=0,i=arguments.length;n<i;++n)void 0!==(a=arguments[n])&&this.$set(s[n].name,a);else this.$set(t)},a=i.prototype=(0,L.default)(c.Builder.Message.prototype);a.add=function(e,t,n){var i=o._fieldsByName[e];if(!n){if(!i)throw Error(this+"#"+e+" is undefined");if(!(i instanceof c.Reflect.Message.Field))throw Error(this+"#"+e+" is not a field: "+i.toString(!0));if(!i.repeated)throw Error(this+"#"+e+" is not a repeated field");t=i.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,k.default)(e)){for(var i in n=t,e)e.hasOwnProperty(i)&&void 0!==(t=e[i])&&this.$set(i,t,n);return this}var r=o._fieldsByName[e];if(n)this[e]=t;else{if(!r)throw Error(this+"#"+e+" is not a field: undefined");if(!(r instanceof c.Reflect.Message.Field))throw Error(this+"#"+e+" is not a field: "+r.toString(!0));this[r.name]=t=r.verifyValue(t)}if(r&&r.oneof){var a=this[r.oneof.name];null!==t?(null!==a&&a!==r.name&&(this[a]=null),this[r.oneof.name]=r.name):a===e&&(this[r.oneof.name]=null)}return 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);var t=n.originalName.replace(/([A-Z])/g,function(e){return"_"+e}),i=function(e,t){return this[n.name]=t?e:n.verifyValue(e),this},r=function(){return this[n.name]};null===o.getChild("set"+e)&&(a["set"+e]=i),null===o.getChild("set_"+t)&&(a["set_"+t]=i),null===o.getChild("get"+e)&&(a["get"+e]=r),null===o.getChild("get_"+t)&&(a["get_"+t]=r)}(t)}function d(e,n,i,r){if(null===e||"object"!==(0,k.default)(e)){if(r&&r instanceof c.Reflect.Enum){var t=c.Reflect.Enum.getName(r.object,e);if(null!==t)return t}return e}if(O.isByteBuffer(e))return n?e.toBase64():e.toBuffer();if(c.Long.isLong(e))return i?e.toString():c.Long.fromValue(e);var a;if((0,I.default)(e))return a=[],e.forEach(function(e,t){a[t]=d(e,n,i,r)}),a;if(a={},e instanceof c.Map){for(var o=e.entries(),s=o.next();!s.done;s=o.next())a[e.keyElem.valueToString(s.value[0])]=d(s.value[1],n,i,e.valueElem.resolvedType);return a}var l=e.$type,u=void 0;for(var h in e)e.hasOwnProperty(h)&&(l&&(u=l.getChild(h))?a[h]=d(e[h],n,i,u.resolvedType):a[h]=d(e[h],n,i));return a}return a.encode=function(t,e){"boolean"==typeof t&&(e=t,t=void 0);var n=!1;t||(t=new O,n=!0);var i=t.littleEndian;try{return o.encode(this,t.LE(),e),(n?t.flip():t).LE(i)}catch(e){throw t.LE(i),e}},i.encode=function(e,t,n){return new i(e).encode(t,n)},a.calculate=function(){return o.calculate(this)},a.encodeDelimited=function(e,t){var n=!1;e||(e=new O,n=!0);var i=(new O).LE();return o.encode(this,i,t).flip(),e.writeVarint32(i.remaining()),e.append(i),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,S.default)(d(this,!0,!0,this.$type))},i.decode=function(t,e,n){"string"==typeof e&&(n=e,e=-1),"string"==typeof t&&(t=O.wrap(t,n||"base64")),t=O.isByteBuffer(t)?t:O.wrap(t);var i=t.littleEndian;try{var r=o.decode(t.LE());return t.LE(i),r}catch(e){throw t.LE(i),e}},i.decodeDelimited=function(t,e){if("string"==typeof t&&(t=O.wrap(t,e||"base64")),t=O.isByteBuffer(t)?t:O.wrap(t),t.remaining()<1)return null;var n=t.offset,i=t.readVarint32();if(t.remaining()<i)return t.offset=n,null;try{var r=o.decode(t.slice(t.offset,t.offset+i).LE());return t.offset+=i,r}catch(e){throw t.offset+=i,e}},i.decode64=function(e){return i.decode(e,"base64")},i.decodeHex=function(e){return i.decode(e,"hex")},i.decodeJSON=function(e){return new i(JSON.parse(e))},a.toString=function(){return o.toString()},N.default&&((0,N.default)(i,"$options",{value:o.buildOpt()}),(0,N.default)(a,"$options",{value:i.$options}),(0,N.default)(i,"$type",{value:o}),(0,N.default)(a,"$type",{value:o})),i}(m,this);this._fields=[],this._fieldsById={},this._fieldsByName={};for(var n,i=0,r=this.children.length;i<r;i++)if(n=this.children[i],n instanceof g||n instanceof d||n instanceof b){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 d.Field)n.build(),this._fields.push(n),this._fieldsById[n.id]=n,this._fieldsByName[n.name]=n;else if(!(n instanceof d.OneOf||n instanceof x))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[i].toString(!0));return this.clazz=t},r.encode=function(e,t,n){for(var i,r,a=null,o=0,s=this._fields.length;o<s;++o)i=this._fields[o],r=e[i.name],i.required&&null===r?null===a&&(a=i):i.encode(n?r:i.verifyValue(r),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},r.calculate=function(e){for(var t,n,i=0,r=0,a=this._fields.length;r<a;++r){if(t=this._fields[r],n=e[t.name],t.required&&null===n)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);i+=t.calculate(n,e)}return i},r.decode=function(e,t,n){t="number"==typeof t?t:-1;for(var i,r,a,o,s=e.offset,l=new this.clazz;e.offset<s+t||-1===t&&0<e.remaining();){if(i=e.readVarint32(),r=7&i,a=i>>>3,r===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]){if(o.repeated&&!o.options.packed)l[o.name].push(o.decode(r,e));else if(o.map){var u=o.decode(r,e);l[o.name].set(u[0],u[1])}else if(l[o.name]=o.decode(r,e),o.oneof){var h=l[o.oneof.name];null!==h&&h!==o.name&&(l[h]=null),l[o.oneof.name]=o.name}}else switch(r){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: "+r)}}for(var d=0,f=this._fields.length;d<f;++d)if(o=this._fields[d],null===l[o.name])if("proto3"===this.syntax)l[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=l,p}m.populateDefaults&&null!==o.defaultValue&&(l[o.name]=o.defaultValue)}return l},o.Message=d;var u=function(e,t,n,i,r,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=i||null,this.type=r,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 d.ExtensionField||(this.name=m.Util.toCamelCase(this.name))},a=u.prototype=(0,L.default)(h.prototype);a.build=function(){this.element=new c(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new c(this.keyType,void 0,!0,this.syntax)),"proto3"!==this.syntax||this.repeated||this.map?void 0!==this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=c.defaultFieldValue(this.type)},a.verifyValue=function(e,t){t=t||!1;var n,i=this;function r(e,t){throw Error("Illegal value for "+i.toString(!0)+" of type "+i.type.name+": "+e+" ("+t+")")}if(null===e)return this.required&&r((0,k.default)(e),"required"),"proto3"===this.syntax&&this.type!==m.TYPES.message&&r((0,k.default)(e),"proto3 field without field presence cannot be null"),null;if(!this.repeated||t)return this.map&&!t?e instanceof m.Map?e:(e instanceof Object||r((0,k.default)(e),"expected ProtoBuf.Map or raw object for map field"),new m.Map(this,e)):(!this.repeated&&(0,I.default)(e)&&r((0,k.default)(e),"no array expected"),this.element.verifyValue(e));(0,I.default)(e)||(e=[e]);var a=[];for(n=0;n<e.length;n++)a.push(this.element.verifyValue(e[n]));return a},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,i,e){if(null===this.type||"object"!==(0,k.default)(this.type))throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return i;try{var n;if(this.repeated)if(this.options.packed&&0<=m.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)){i.writeVarint32(this.id<<3|m.WIRE_TYPES.LDELIM),i.ensureCapacity(i.offset+=1);var r=i.offset;for(n=0;n<t.length;n++)this.element.encodeValue(this.id,t[n],i);var a=i.offset-r,o=O.calculateVarint32(a);if(1<o){var s=i.slice(r,i.offset);r+=o-1,i.offset=r,i.append(s)}i.writeVarint32(a,r-o)}else for(n=0;n<t.length;n++)i.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t[n],i);else this.map?t.forEach(function(e,t){var n=O.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,t)+O.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,e);i.writeVarint32(this.id<<3|m.WIRE_TYPES.LDELIM),i.writeVarint32(n),i.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,t,i),i.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,e,i)},this):this.hasWirePresence(t,e)&&(i.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t,i))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return i},a.calculate=function(t,e){if(t=this.verifyValue(t),null===this.type||"object"!==(0,k.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 i=0;try{var n,r;if(this.repeated)if(this.options.packed&&0<=m.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)){for(i+=O.calculateVarint32(this.id<<3|m.WIRE_TYPES.LDELIM),r=0,n=0;n<t.length;n++)r+=this.element.calculateLength(this.id,t[n]);i+=O.calculateVarint32(r),i+=r}else for(n=0;n<t.length;n++)i+=O.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t[n]);else this.map?t.forEach(function(e,t){var n=O.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,t)+O.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,e);i+=O.calculateVarint32(this.id<<3|m.WIRE_TYPES.LDELIM),i+=O.calculateVarint32(n),i+=n},this):this.hasWirePresence(t,e)&&(i+=O.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return i},a.decode=function(e,t,n){var i,r,a=!this.map&&e==this.type.wireType||!n&&this.repeated&&this.options.packed&&e==m.WIRE_TYPES.LDELIM||this.map&&e==m.WIRE_TYPES.LDELIM;if(!a)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<=m.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)&&!n){r=t.readVarint32(),r=t.offset+r;for(var o=[];t.offset<r;)o.push(this.decode(this.type.wireType,t,!0));return o}if(this.map){var s=c.defaultFieldValue(this.keyType);if(i=c.defaultFieldValue(this.type),r=t.readVarint32(),t.remaining()<r)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+r+" required but got only "+t.remaining());var l=t.clone();for(l.limit=l.offset+r,t.offset+=r;0<l.remaining();){var u=l.readVarint32();e=7&u;var h=u>>>3;if(1===h)s=this.keyElement.decode(l,e,h);else{if(2!==h)throw Error("Unexpected tag in map field key/value submessage");i=this.element.decode(l,e,h)}}return[s,i]}return this.element.decode(t,e,this.id)},o.Message.Field=u;var f=function(e,t,n,i,r,a,o){u.call(this,e,t,n,null,i,r,a,o),this.extension};f.prototype=(0,L.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,i,r){s.call(this,e,t,n,i,r),this.className="Enum",this.object=null};g.getName=function(e,t){for(var n,i=(0,A.default)(e),r=0;r<i.length;++r)if(e[n=i[r]]===t)return n;return null};var y=g.prototype=(0,L.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),i=0,r=n.length;i<r;++i)t[n[i].name]=n[i].id;return N.default&&(0,N.default)(t,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=t},o.Enum=g;var _=function(e,t,n,i){h.call(this,e,t,n),this.className="Enum.Value",this.id=i};_.prototype=(0,L.default)(h.prototype),o.Enum.Value=_;var x=function(e,t,n,i){h.call(this,e,t,n),this.field=i};x.prototype=(0,L.default)(h.prototype),o.Extension=x;var b=function(e,t,n,i){s.call(this,e,t,n,i),this.className="Service",this.clazz=null},w=b.prototype=(0,L.default)(s.prototype);w.build=function(e){return this.clazz&&!e?this.clazz:this.clazz=function(t,r){for(var a=function(e){t.Builder.Service.call(this),this.rpcImpl=e||function(e,t,n){setTimeout(n.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},e=a.prototype=(0,L.default)(t.Builder.Service.prototype),n=r.getChildren(t.Reflect.Service.RPCMethod),i=0;i<n.length;i++)!function(i){e[i.name]=function(e,n){try{try{e=i.resolvedRequestType.clazz.decode(O.wrap(e))}catch(e){if(!(e instanceof TypeError))throw e}if(null===e||"object"!==(0,k.default)(e))throw Error("Illegal arguments");e instanceof i.resolvedRequestType.clazz||(e=new i.resolvedRequestType.clazz(e)),this.rpcImpl(i.fqn(),e,function(e,t){if(e)n(e);else{null===t&&(t="");try{t=i.resolvedResponseType.clazz.decode(t)}catch(e){}t&&t instanceof i.resolvedResponseType.clazz?n(null,t):n(Error("Illegal response type received in service method "+r.name+"#"+i.name))}})}catch(e){setTimeout(n.bind(this,e),0)}},a[i.name]=function(e,t,n){new a(e)[i.name](t,n)},N.default&&((0,N.default)(a[i.name],"$options",{value:i.buildOpt()}),(0,N.default)(e[i.name],"$options",{value:a[i.name].$options}))}(n[i]);return N.default&&((0,N.default)(a,"$options",{value:r.buildOpt()}),(0,N.default)(e,"$options",{value:a.$options}),(0,N.default)(a,"$type",{value:r}),(0,N.default)(e,"$type",{value:r})),a}(m,this)},o.Service=b;var M=function(e,t,n,i){h.call(this,e,t,n),this.className="Service.Method",this.options=i||{}},T=M.prototype=(0,L.default)(h.prototype);T.buildOpt=t.buildOpt,o.Service.Method=M;var E=function(e,t,n,i,r,a,o,s){M.call(this,e,t,n,s),this.className="Service.RPCMethod",this.requestName=i,this.responseName=r,this.requestStream=a,this.responseStream=o,this.resolvedRequestType=null,this.resolvedResponseType=null};return E.prototype=(0,L.default)(M.prototype),o.Service.RPCMethod=E,o}(ne),ne.Builder=(X=ne,Z=ne.Lang,J=ne.Reflect,K=function(e){this.ns=new J.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},Q=K.prototype,K.isMessage=function(e){return"string"==typeof e.name&&void 0===e.values&&void 0===e.rpc},K.isMessageField=function(e){return"string"==typeof e.rule&&"string"==typeof e.name&&"string"==typeof e.type&&void 0!==e.id},K.isEnum=function(e){return"string"==typeof e.name&&!(void 0===e.values||!(0,I.default)(e.values)||0===e.values.length)},K.isService=function(e){return!("string"!=typeof e.name||"object"!==(0,k.default)(e.rpc)||!e.rpc)},K.isExtend=function(e){return"string"==typeof e.ref},Q.reset=function(){return this.ptr=this.ns,this},Q.define=function(e){if("string"!=typeof e||!Z.TYPEREF.test(e))throw Error("illegal namespace: "+e);return e.split(".").forEach(function(e){var t=this.ptr.getChild(e);null===t&&this.ptr.addChild(t=new J.Namespace(this,this.ptr,e)),this.ptr=t},this),this},Q.create=function(e){if(!e)return this;if((0,I.default)(e)){if(0===e.length)return this;e=e.slice()}else e=[e];for(var t=[e];0<t.length;){if(e=t.pop(),!(0,I.default)(e))throw Error("not a valid namespace: "+(0,S.default)(e));for(;0<e.length;){var n=e.shift();if(K.isMessage(n)){var a=new J.Message(this,this.ptr,n.name,n.options,n.isGroup,n.syntax),i={};n.oneofs&&(0,A.default)(n.oneofs).forEach(function(e){a.addChild(i[e]=new J.Message.OneOf(this,a,e))},this),n.fields&&n.fields.forEach(function(e){if(null!==a.getChild(0|e.id))throw Error("duplicate or invalid field id in "+a.name+": "+e.id);if(e.options&&"object"!==(0,k.default)(e.options))throw Error("illegal field options in "+a.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=i[e.oneof]))throw Error("illegal oneof in "+a.name+"#"+e.name+": "+e.oneof);e=new J.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,n.syntax),t&&t.fields.push(e),a.addChild(e)},this);var r=[];if(n.enums&&n.enums.forEach(function(e){r.push(e)}),n.messages&&n.messages.forEach(function(e){r.push(e)}),n.services&&n.services.forEach(function(e){r.push(e)}),n.extensions&&("number"==typeof n.extensions[0]?a.extensions=[n.extensions]:a.extensions=n.extensions),this.ptr.addChild(a),0<r.length){t.push(e),e=r,r=null,this.ptr=a,a=null;continue}r=null}else if(K.isEnum(n))a=new J.Enum(this,this.ptr,n.name,n.options,n.syntax),n.values.forEach(function(e){a.addChild(new J.Enum.Value(this,a,e.name,e.id))},this),this.ptr.addChild(a);else if(K.isService(n))a=new J.Service(this,this.ptr,n.name,n.options),(0,A.default)(n.rpc).forEach(function(e){var t=n.rpc[e];a.addChild(new J.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))},this),this.ptr.addChild(a);else{if(!K.isExtend(n))throw Error("not a valid definition: "+(0,S.default)(n));if(a=this.ptr.resolve(n.ref,!0),a)n.fields.forEach(function(t){if(null!==a.getChild(0|t.id))throw Error("duplicate extended field id in "+a.name+": "+t.id);if(a.extensions){var n=!1;if(a.extensions.forEach(function(e){t.id>=e[0]&&t.id<=e[1]&&(n=!0)}),!n)throw Error("illegal extended field id in "+a.name+": "+t.id+" (not within valid ranges)")}var e=t.name;this.options.convertFieldsToCamelCase&&(e=X.Util.toCamelCase(e));var i=new J.Message.ExtensionField(this,a,t.rule,t.type,this.ptr.fqn()+"."+e,t.id,t.options),r=new J.Extension(this,this.ptr,t.name,i);i.extension=r,this.ptr.addChild(r),a.addChild(i)},this);else if(!/\.?google\.protobuf\./.test(n.ref))throw Error("extended message "+n.ref+" is not defined")}n=null,a=null}e=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},Q.import=function(t,e){var n="/";if("string"==typeof e){if(X.Util.IS_NODE&&(e=oe(224).resolve(e)),!0===this.files[e])return this.reset();this.files[e]=!0}else if("object"===(0,k.default)(e)){var i=e.root;X.Util.IS_NODE&&(i=oe(224).resolve(i)),(0<=i.indexOf("\\")||0<=e.file.indexOf("\\"))&&(n="\\");var r=i+n+e.file;if(!0===this.files[r])return this.reset();this.files[r]=!0}if(t.imports&&0<t.imports.length){var a,o=!1;"object"===(0,k.default)(e)?(this.importRoot=e.root,o=!0,a=this.importRoot,e=e.file,(0<=a.indexOf("\\")||0<=e.indexOf("\\"))&&(n="\\")):"string"==typeof e?this.importRoot?a=this.importRoot:0<=e.indexOf("/")?(a=e.replace(/\/[^\/]*$/,""),""===a&&(a="/")):0<=e.indexOf("\\")?(a=e.replace(/\\[^\\]*$/,""),n="\\"):a=".":a=null;for(var s=0;s<t.imports.length;s++)if("string"==typeof t.imports[s]){if(!a)throw Error("cannot determine import root");var l=t.imports[s];if("google/protobuf/descriptor.proto"===l)continue;if(l=a+n+l,!0===this.files[l])continue;/\.proto$/i.test(l)&&!X.DotProto&&(l=l.replace(/\.proto$/,".json"));var u=X.Util.fetch(l);if(null===u)throw Error("failed to import '"+l+"' in '"+e+"': file not found");/\.json$/i.test(l)?this.import(JSON.parse(u+""),l):this.import(X.DotProto.Parser.parse(u),l)}else e?/\.(\w+)$/.test(e)?this.import(t.imports[s],e.replace(/^(.+)\.(\w+)$/,function(e,t,n){return t+"_import"+s+"."+n})):this.import(t.imports[s],e+"_import"+s):this.import(t.imports[s]);o&&(this.importRoot=null)}t.package&&this.define(t.package),t.syntax&&ie(t);var h=this.ptr;return t.options&&(0,A.default)(t.options).forEach(function(e){h.options[e]=t.options[e]}),t.messages&&(this.create(t.messages),this.ptr=h),t.enums&&(this.create(t.enums),this.ptr=h),t.services&&(this.create(t.services),this.ptr=h),t.extends&&this.create(t.extends),this.reset()},Q.resolveAll=function(){var e;if(null==this.ptr||"object"===(0,k.default)(this.ptr.type))return this;if(this.ptr instanceof J.Namespace)this.ptr.children.forEach(function(e){this.ptr=e,this.resolveAll()},this);else if(this.ptr instanceof J.Message.Field){if(Z.TYPE.test(this.ptr.type))this.ptr.type=X.TYPES[this.ptr.type];else{if(!Z.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(e=(this.ptr instanceof J.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 J.Enum){if(this.ptr.type=X.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==e.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(e instanceof J.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=e.isGroup?X.TYPES.group:X.TYPES.message}}if(this.ptr.map){if(!Z.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=X.TYPES[this.ptr.keyType]}}else if(this.ptr instanceof X.Reflect.Service.Method){if(!(this.ptr instanceof X.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 X.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 X.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=e}else if(!(this.ptr instanceof X.Reflect.Message.OneOf||this.ptr instanceof X.Reflect.Extension||this.ptr instanceof X.Reflect.Enum.Value))throw Error("illegal object in namespace: "+(0,k.default)(this.ptr)+": "+this.ptr);return this.reset()},Q.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,i=0;i<t.length;i++){if(!n[t[i]]){n=null;break}n=n[t[i]]}return n},Q.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},Q.toString=function(){return"Builder"},K.Message=function(){},K.Enum=function(){},K.Service=function(){},K),ne.Map=($=ne.Reflect,ee=function(e,t){if(!e.map)throw Error("field is not a map");if(this.field=e,this.keyElem=new $.Element(e.keyType,null,!0,e.syntax),this.valueElem=new $.Element(e.type,e.resolvedType,!1,e.syntax),this.map={},(0,N.default)(this,"size",{get:function(){return(0,A.default)(this.map).length}}),t)for(var n=(0,A.default)(t),i=0;i<n.length;i++){var r=this.keyElem.valueFromString(n[i]),a=this.valueElem.verifyValue(t[n[i]]);this.map[this.keyElem.valueToString(r)]={key:r,value:a}}},te=ee.prototype,te.clear=function(){this.map={}},te.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),n=t in this.map;return delete this.map[t],n},te.entries=function(){for(var e,t=[],n=(0,A.default)(this.map),i=0;i<n.length;i++)t.push([(e=this.map[n[i]]).key,e.value]);return re(t)},te.keys=function(){for(var e=[],t=(0,A.default)(this.map),n=0;n<t.length;n++)e.push(this.map[t[n]].key);return re(e)},te.values=function(){for(var e=[],t=(0,A.default)(this.map),n=0;n<t.length;n++)e.push(this.map[t[n]].value);return re(e)},te.forEach=function(e,t){for(var n,i=(0,A.default)(this.map),r=0;r<i.length;r++)e.call(t,(n=this.map[i[r]]).value,n.key,this)},te.set=function(e,t){var n=this.keyElem.verifyValue(e),i=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(n)]={key:n,value:i},this},te.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));if(t in this.map)return this.map[t].value},te.has=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));return t in this.map},ee),ne.loadProto=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=void 0),ne.loadJson(ne.DotProto.Parser.parse(e),t,n)},ne.protoFromString=ne.loadProto,ne.loadProtoFile=function(t,n,i){if(n&&"object"===(0,k.default)(n)?(i=n,n=null):n&&"function"==typeof n||(n=null),n)return ne.Util.fetch("string"==typeof t?t:t.root+"/"+t.file,function(e){if(null!==e)try{n(null,ne.loadProto(e,i,t))}catch(e){n(e)}else n(Error("Failed to fetch file"))});var e=ne.Util.fetch("object"===(0,k.default)(t)?t.root+"/"+t.file:t);return null===e?null:ne.loadProto(e,i,t)},ne.protoFromFile=ne.loadProtoFile,ne.newBuilder=function(e){return e=e||{},void 0===e.convertFieldsToCamelCase&&(e.convertFieldsToCamelCase=ne.convertFieldsToCamelCase),void 0===e.populateAccessors&&(e.populateAccessors=ne.populateAccessors),new ne.Builder(e)},ne.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,k.default)(t)||(t=ne.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),t.import(e,n),t.resolveAll(),t},ne.loadJsonFile=function(t,n,i){if(n&&"object"===(0,k.default)(n)?(i=n,n=null):n&&"function"==typeof n||(n=null),n)return ne.Util.fetch("string"==typeof t?t:t.root+"/"+t.file,function(e){if(null!==e)try{n(null,ne.loadJson(JSON.parse(e),i,t))}catch(e){n(e)}else n(Error("Failed to fetch file"))});var e=ne.Util.fetch("object"===(0,k.default)(t)?t.root+"/"+t.file:t);return null===e?null:ne.loadJson(JSON.parse(e),i,t)}}).call(this,oe(65))},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var s=i(n(19)),l=i(n(12)),u=i(n(18)),h=i(n(17)),a=i(n(15));n(5),n(4);var o=i(n(29));n(34),n(22),n(10);var c=i(n(28)),d=i(n(2)),f=i(n(3)),p=i(n(66)),m=i(n(234));function _(e){if(void 0===h.default||null==e[u.default]){if((0,l.default)(e)||(e=v(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}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 i,r,a=!0,o=!1;return{s:function(){i=(0,s.default)(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw r}}}}function v(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var y=function(){function i(e,t,n){(0,d.default)(this,i),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(-1/0,-1/0),min:new fm.Vector2(1/0,1/0)},this._bboxTh={max:new fm.Vector2(-1/0,-1/0),min:new fm.Vector2(1/0,1/0)},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,c.default)(t.scene.layerGroups[0].height)}return(0,f.default)(i,[{key:"getNeedLoadGroup",value:function(e,t){var n,i=[],r=_(this.layerGroups);try{for(r.s();!(n=r.n()).done;){var a=n.value,o=-1<e.indexOf(a.gid);t&&(o=!o),!a.loaded&&o&&i.push({gid:a.gid,url:this.getGroupLoadUrl(a.gname,a.gid),layerData:a})}}catch(e){r.e(e)}finally{r.f()}return i}},{key:"getGroupLoadUrl",value:function(e){return"floor."+e}},{key:"getLastAndNextName",value:function(e,t){var n,i,r,a=""+e,o=_(this.layerGroups);try{for(o.s();!(r=o.n()).done;){var s=r.value;s.gid===t-1&&(n="_"+s.gname),s.gid===t+1&&(i="_"+s.gname)}}catch(e){o.e(e)}finally{o.f()}return n=n||"_no",i=i||"_no",a+=n+i,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){this._groupIds.push(e);var i=new m.default(e,t,n);i.hideWithFree=this.parent.map.MapOptions.autoDispose,i.parent=this;var r=(0,c.default)(e);i.height=this._space*r,-1<this.parent.map.visibleGroupIDs.indexOf(e)?i.visible=!0:i.visible=!1,this.groups[e+""]=i}},{key:"changeTheme",value:function(i){var r=this;this._theme=i;var a,e=["extent","model","label","facility"],t=function(n){r.groups[n].traverseByAlias(e,function(e,t){switch(t){case"extent":a=i;break;case"model":a=r.parent.map.MapOptions.useStoreApply?i.getStoreApplyTheme(e.bdata.fid):void 0,a=a||i.getModelTheme(e.bdata);break;case"label":a=i.getLabelTheme(e.bdata.type);break;case"facility":a=i.getPoiTheme(e.bdata.type)}e.renderNodeInited&&(e.setByTheme(a),r.parent.checkMaterialAlpha(e.renderNode,(0,c.default)(n)),"model"==t&&r.parent.checkMaterialAlpha(e.line,(0,c.default)(n)))})};for(var n in this.groups)t(n)}},{key:"getAllGroupLayerByAlias",value:function(e,t){for(var n in this.groups){var i,r=this.groups[n].layers[e],a=_(r);try{for(a.s();!(i=a.n()).done;){var o=i.value;t(o)}}catch(e){a.e(e)}finally{a.f()}}}},{key:"getFacilityByFilter",value:function(e,t){var n,i=[],r=_(e);try{for(r.s();!(n=r.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=_(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])||i.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])||i.push(v[g])}}}catch(e){r.e(e)}finally{r.f()}return i}},{key:"getSpriteInfo",value:function(e,t,n,i){e.updateMatrixWorld(!0);var r,a=(new fm.Vector3).setFromMatrixPosition(e.matrixWorld),o=a.applyMatrix4(n.matrixWorldInverse),s=o.applyMatrix4(n.projectionMatrix),l=e.mapNode.size/i*2;if(t){var u=this.parent._map.labelLanguage==p.default.ZH?e.mapNode.name:e.mapNode.ename;if(u){var h=u.split("%rn%").length;l*=h}r=l/e.material.userData.scaleRatio}else r=l;"PerspectiveCamera"==n.type&&(s.x*=n.aspect);var c={x:s.x-r/2,y:s.y+l/2},d={x:s.x+r/2,y:s.y-l/2};return{target:e,z:e.mapNode.eid,position:s,leftTop:c,rightDown:d}}},{key:"getMarkers",value:function(e,t,n){var i=[],r=this.groups[e];if(!r)return i;var a,o=r.getLayers("facility"),s=_(o);try{for(s.s();!(a=s.n()).done;)for(var l=a.value,u=0;u<l.scene.children.length;u++){var h=l.scene.children[u];if(l.needAvoid&&h.mapNode.needAvoid&&h.mapNode.show){var c=this.getSpriteInfo(h,!1,t,n);i.push(c)}}}catch(e){s.e(e)}finally{s.f()}var d,f=r.getLayers("label"),p=_(f);try{for(p.s();!(d=p.n()).done;)for(var m=d.value,v=0;v<m.scene.children.length;v++){var g=m.scene.children[v];if(m.needAvoid&&g.mapNode.needAvoid&&g.mapNode.show){var y=this.getSpriteInfo(g,!0,t,n);i.push(y)}}}catch(e){p.e(e)}finally{p.f()}return i.sort(function(e,t){return e.z-t.z}),i}},{key:"getAllImageMarker",value:function(e){var t=[],n=this.groups[e];if(!n)return t;for(var i=n.layers.imageMarker,r=0;r<i.length;r++)for(var a=0;a<i[r].scene.children.length;a++){var o=i[r].scene.children[a];t.push(o)}return t}},{key:"getUserMarkers",value:function(e,t,n){var i=[],r=this.groups[e];if(!r)return i;for(var a=r.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=a[o].scene.children[l];if(u.mapNode.needAvoid&&u.mapNode.show){var h=this.getSpriteInfo(u,!1,t,n);s.push(h)}}i.push(s)}}for(var c=r.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=c[d].scene.children[p];if(m.mapNode.needAvoid&&m.mapNode.show){var v=this.getSpriteInfo(m,!0,t,n);f.push(v)}}i.push(f)}}return i}},{key:"getNodesExceptFacility",value:function(e,n){var t,i=[],r=_(e);try{for(r.s();!(t=r.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])||i.push(e.children[t])})}}catch(e){r.e(e)}finally{r.f()}return i}},{key:"getDynnodes",value:function(n,e){var t,i=[],r=_(e);try{for(r.s();!(t=r.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])||i.push(e.children[t])})}}catch(e){r.e(e)}finally{r.f()}return i}},{key:"getGroupsModels",value:function(e){var t,n=[],i=_(e);try{for(i.s();!(t=i.n()).done;){var r=t.value,a=this.groups[r];if(a){var o,s=a.getLayers("model"),l=_(s);try{for(l.s();!(o=l.n()).done;){var u=o.value;u.checkSceneNode(),n=n.concat(u.scene.children)}}catch(e){l.e(e)}finally{l.f()}}}}catch(e){i.e(e)}finally{i.f()}return n}},{key:"getGroupsExternalModels",value:function(e){var t,n=[],i=_(e);try{for(i.s();!(t=i.n()).done;){var r=t.value,a=this.groups[r];if(a){var o,s=a.getLayers("externalModel"),l=_(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){i.e(e)}finally{i.f()}return n}},{key:"getGroupsNodelsByFilter",value:function(e,t,n){var i,r=[],a=_(e);try{for(a.s();!(i=a.n()).done;){var o=i.value,s=this.groups[o];for(var l in s.layers)if(t===l){var u,h=s.layers[l],c=_(h);try{for(c.s();!(u=c.n()).done;){var d=u.value;d.traverse(function(e){n(e)&&r.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 r}},{key:"getNodesExpectExtent",value:function(e){var t,n=[],i=_(e);try{for(i.s();!(t=i.n()).done;){var r=t.value,a=this.groups[r];a.everyLayers(["extent"],function(e){n.push.apply(n,(0,o.default)(e.children))})}}catch(e){i.e(e)}finally{i.f()}return n}},{key:"getRenderGroup",value:function(){var e=[];for(var t in this.groups)this.groups[t].visible&&e.push(this.groups[t]);return e.sort(function(e,t){return e.getHeight()-t.getHeight()})}},{key:"getLastRenderArray",value:function(){var e=[];for(var t in this.groups)e.push.apply(e,(0,o.default)(this.groups[t].alwaysShowMarkers));return e}},{key:"getHeight",value:function(e){var t;return t=this.groups[""+e]?this.groups[""+e].getHeight():this._space*e,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,c.default)(t);this.groups[t].height=e*n}}}]),i}(),x=y;t.default=x},function(e,t,n){"use strict";var r=n(60);function i(e){var n,i;this.promise=new e(function(e,t){if(void 0!==n||void 0!==i)throw TypeError("Bad Promise constructor");n=e,i=t}),this.resolve=r(n),this.reject=r(i)}e.exports.f=function(e){return new i(e)}},function(e,t,n){"use strict";n(121)("anchor",function(t){return function(e){return t(this,"a","name",e)}})},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(2)),o=i(n(3)),s=function(){function e(){(0,a.default)(this,e)}return(0,o.default)(e,[{key:"addEventListener",value:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}},{key:"hasEventListener",value:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}},{key:"removeEventListener",value:function(e,t){if(void 0!==this._listeners){var n=this._listeners,i=n[e];if(void 0!==i){var r=i.indexOf(t);-1!==r&&i.splice(r,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 i=n.slice(0),r=0,a=i.length;r<a;r++)i[r].call(this,e)}}}]),e}(),l=s;t.default=l},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(22);var a=i(n(2)),o=i(n(3)),l=i(n(166)),s=i(n(227)),u=i(n(228)),h=function(){function t(e){(0,a.default)(this,t),this._options=e,this._staticNaviScene=null,this._wktReader=new s.default,this._scene=null}return(0,o.default)(t,[{key:"setScene",value:function(e){this._scene=e}},{key:"queryScene",value:function(e,n){var t,i=this;this._options.useStatic?(t=this._options.naviServerURL+"/"+e+".fmap",new l.default(t,function(e){var t=i._convertStatic1(e);n(t.scene_data)},!0)):(t=this._options.naviServerURL+"/"+e,new l.default(t,function(e){var t=i._convertSite1(e);n(t.scene_data)},!0))}},{key:"queryNaviData",value:function(e,n,i){var r=this;if(this._options.useStatic){var t=r._convertStatic2(n);i(t)}else{var a=null,o=null,s=null;r=this,new l.default(this._options.naviServerURL+"/group_v2/"+e+"/"+n+"/geo",function(e){if(a=e,null!=a&&null!=o&&null!=s){var t=r._convertSite2(n,a,o,s);i(t)}},!0),new l.default(this._options.naviServerURL+"/group_v2/"+e+"/"+n+"/biz",function(e){if(o=e,null!=a&&null!=o&&null!=s){var t=r._convertSite2(n,a,o,s);i(t)}},!0),new l.default(this._options.naviServerURL+"/group_v2/"+e+"/"+n+"/navi",function(e){if(s=e,null!=a&&null!=o&&null!=s){var t=r._convertSite2(n,a,o,s);i(t)}},!0)}}},{key:"convertToGroup",value:function(e,t,n,i){return this._convertToGroup(e,t,n,i)}},{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);return e={scene_data:t},e}},{key:"_convertSite2",value:function(e,t,n,i){var r=fmFloorGeoDecode(t),a=fmFloorBizDecode(n),o=fmFloorNaviDecode(i);return this._convertToGroup(e,r,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 u.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 i in n)i%2==0&&(n[i]=-n[i]);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,i=[];return 0<=n.indexOf("|")||0<=n.indexOf("-")||0<=n.indexOf(",")?(i=n.split(/[|,-]/),t.push.apply(t,i)):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 i=t[n];if(i.gid==e)return this._convertToGroup(e,i.geo[0],i.biz[0],i.navi[0])}return null}},{key:"_convertToGroup",value:function(e,t,n,i){for(var r={},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++)r[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],b={};b.fid=x.fid,b.eid=_.eid,b.pass=x.pass,b.center=1===h?this._convertGeo2Geometry(r[_.eid].geo).points[0]:this._convertArray2Geometry(r[_.eid].idxs,r[_.eid].pts).points[0];var w=null;w=1===h?this._convertGeo2Geometry(_.geo):this._convertArray2Geometry(_.idxs,_.pts),b.geoArr=w.points,b.holes=w.holes,a.push(b)}for(var M=0,T=i.naviNodes.length;M<T;M++){var E=i.naviNodes[M];E.geoArr=1===h?this._convertGeo2Geometry(E.geo).points[0]:this._convertArray2Geometry(E.idxs,E.pts).points[0],E.linkSegArr=this._convertStringToArray(E.linkSeg),E.liftFloorArr=this._convertStringToArray(E.liftFloor),s.push(E)}for(var S=0,A=i.naviSegments.length;S<A;S++){var L=i.naviSegments[S];L.geoArr=1===h?this._convertGeo2Geometry(L.geo).points:this._convertArray2Geometry(L.idxs,L.pts).points,L.m_Id=i.mid,l.push(L)}if(i.naviZones){var I=0;for(A=i.naviZones.length;I<A;I++){var k=i.naviZones[I],R=null;R=1===h?this._convertGeo2Geometry(k.geo):this._convertArray2Geometry(k.idxs,k.pts),k.geoArr=R.points,k.holes=R.holes,k.m_Id=i.mid,u.push(k)}}var N={gid:e,extentLayer:o,modelLayer:a,naviSegments:l,naviNodes:s,naviZones:u};return N}}]),t}(),c=h;t.default=c},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(2)),o=i(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 i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(45);var a=i(n(2)),o=i(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 i=n(0);i(t,"__esModule",{value:!0}),t._Math=void 0,n(5),n(4);var r={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,i=4294967295*Math.random()|0,r=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&i]+a[i>>8&255]+a[i>>16&255]+a[i>>24&255];return r.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,i,r){return i+(e-t)*(r-i)/(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*r.DEG2RAD},radToDeg:function(e){return e*r.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=r},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 i=Number.isNaN||function(e){return e!=e};function r(){r.init.call(this)}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.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?r.defaultMaxListeners:e._maxListeners}function o(e,t,n,i){var r,a,o;if(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;else if("function"==typeof o?o=a[t]=i?[n,o]:[o,n]:i?o.unshift(n):o.push(n),r=c(e),0<r&&o.length>r&&!o.warned){o.warned=!0;var 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)}return 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 i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=s.bind(i);return r.listener=n,i.wrapFn=r,r}function f(e,t,n){var i=e._events;if(void 0===i)return[];var r=i[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?g(r):m(r,r.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),i=0;i<t;++i)n[i]=e[i];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}Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),r.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},r.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(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},r.prototype.getMaxListeners=function(){return c(this)},r.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,r=this._events;if(void 0!==r)i=i&&void 0===r.error;else if(!i)return!1;if(i){var a;if(0<t.length&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var s=r[e];if(void 0===s)return!1;if("function"==typeof s)h(s,this,t);else{var l=s.length,u=m(s,l);for(n=0;n<l;++n)h(u[n],this,t)}return!0},r.prototype.addListener=function(e,t){return o(this,e,t,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(e,t){return o(this,e,t,!0)},r.prototype.once=function(e,t){return u(t),this.on(e,d(this,e,t)),this},r.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,d(this,e,t)),this},r.prototype.removeListener=function(e,t){var n,i,r,a,o;if(u(t),i=this._events,void 0===i)return this;if(n=i[e],void 0===n)return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(r=-1,a=n.length-1;0<=a;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,r=a;break}if(r<0)return this;0===r?n.shift():v(n,r),1===n.length&&(i[e]=n[0]),void 0!==i.removeListener&&this.emit("removeListener",e,o||t)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(e){var t,n,i;if(n=this._events,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){var r,a=Object.keys(n);for(i=0;i<a.length;++i)r=a[i],"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(i=t.length-1;0<=i;i--)this.removeListener(e,t[i]);return this},r.prototype.listeners=function(e){return f(this,e,!0)},r.prototype.rawListeners=function(e){return f(this,e,!1)},r.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},r.prototype.listenerCount=p,r.prototype.eventNames=function(){return 0<this._eventsCount?t(this._events):[]}},function(e,t,n){t=e.exports=n(272),t.Stream=t,t.Readable=t,t.Writable=n(178),t.Duplex=n(68),t.Transform=n(278),t.PassThrough=n(486)},function(O,e,F){"use strict";(function(e,t,n){var o=F(127);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 i=Object.create(F(99));i.inherits=F(84);var r={deprecate:F(485)},a=F(274),u=F(128).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(276);function v(){}function g(e,t){s=s||F(68),e=e||{};var n=t instanceof s;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,r=e.writableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(r||0===r)?r: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){S(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(68),!(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,i){var r=!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(i,a),r=!1),r}function b(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=u.from(t,n)),t}function w(e,t,n,i,r,a){if(!n){var o=b(t,i,r);i!==o&&(n=!0,r="buffer",i=o)}var s=t.objectMode?1:i.length;t.length+=s;var l=t.length<t.highWaterMark;if(l||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:r,isBuf:n,callback:a,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else M(e,t,!1,s,i,r,a);return l}function M(e,t,n,i,r,a,o){t.writelen=i,t.writecb=o,t.writing=!0,t.sync=!0,n?e._writev(r,t.onwrite):e._write(r,a,t.onwrite),t.sync=!1}function T(e,t,n,i,r){--t.pendingcb,n?(o.nextTick(r,i),o.nextTick(P,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(r(i),e._writableState.errorEmitted=!0,e.emit("error",i),P(e,t))}function E(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function S(e,t){var n=e._writableState,i=n.sync,r=n.writecb;if(E(n),t)T(e,n,i,t,r);else{var a=k(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||I(e,n),i?l(A,e,n,a,r):A(e,n,a,r)}}function A(e,t,n,i){n||L(e,t),t.pendingcb--,i(),P(e,t)}function L(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function I(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var i=t.bufferedRequestCount,r=new Array(i),a=t.corkedRequestsFree;a.entry=n;for(var o=0,s=!0;n;)r[o]=n,n.isBuf||(s=!1),n=n.next,o+=1;r.allBuffers=s,M(e,t,!0,t.length,r,"",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 k(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function R(t,n){t._final(function(e){n.pendingcb--,e&&t.emit("error",e),n.prefinished=!0,t.emit("prefinish"),P(t,n)})}function N(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(R,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function P(e,t){var n=k(t);return n&&(N(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 i=e.entry;for(e.entry=null;i;){var r=i.callback;t.pendingcb--,r(n),i=i.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}i.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:r.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 i=this._writableState,r=!1,a=!i.objectMode&&f(e);return a&&!u.isBuffer(e)&&(e=c(e)),"function"==typeof t&&(n=t,t=null),t=a?"buffer":t||i.defaultEncoding,"function"!=typeof n&&(n=v),i.ended?_(this,n):(a||x(this,i,e,n))&&(i.pendingcb++,r=w(this,i,a,e,t,n)),r},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||I(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 i=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||C(this,i,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(483).setImmediate,F(56))},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(2)),o=i(n(3)),s=function(){function r(e,t,n,i){(0,a.default)(this,r),this._groupId=e,this._length=t,this._pointList=n||[],this._nodeList=i||[]}return(0,o.default)(r,[{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()}}]),r}(),l=s;t.default=l},function(e,t,n){"use strict";var i=n(27),r=n(213)(5),a="find",o=!0;a in[]&&Array(1)[a](function(){o=!1}),i(i.P+i.F*o,"Array",{find:function(e,t){return r(this,e,1<arguments.length?t:void 0)}}),n(147)(a)},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(34),n(63),n(50),n(4);var a=i(n(2)),o=i(n(3)),s=function(){function e(){(0,a.default)(this,e),this.keys=[],this.data={}}return(0,o.default)(e,[{key:"clear",value:function(){this.keys=[],this.data={}}},{key:"put",value:function(e,t){null==this.data[e]&&this.keys.push(e),this.data[e]=t}},{key:"get",value:function(e){return this.data[e]}},{key:"remove",value:function(e){var t=this.keys.indexOf(e);-1!=t&&(this.keys.splice(t,1),this.data[e]=null)}},{key:"each",value:function(e){if("function"==typeof e)for(var t=this.keys.length,n=0;n<t;n++){var i=this.keys[n];e(i,this.data[i],n)}}},{key:"entrys",value:function(){for(var e=this.keys.length,t=new Array(e),n=0;n<e;n++)t[n]={key:this.keys[n],value:this.data[n]};return t}},{key:"isEmpty",value:function(){return 0==this.keys.length}},{key:"size",value:function(){return this.keys.length}},{key:"toString",value:function(){for(var e="{",t=0;t<this.keys.length;t++,e+=","){var n=this.keys[t];e+=n+"="+this.data[n]}return e+="}",e}},{key:"sort",value:function(){this.keys.sort(function(e,t){return e-t})}}]),e}(),l=s;t.default=l},function(e,t,n){e.exports=!n(36)&&!n(47)(function(){return 7!=Object.defineProperty(n(129)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var a=n(48),o=n(289).set;e.exports=function(e,t,n){var i,r=t.constructor;return r!==n&&"function"==typeof r&&(i=r.prototype)!==n.prototype&&a(i)&&o&&o(e,i),e}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){e.exports=!n(31)&&!n(25)(function(){return 7!=Object.defineProperty(n(186)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var i=n(48),r=n(33).document,a=i(r)&&i(r.createElement);e.exports=function(e){return a?r.createElement(e):{}}},function(e,t,n){var o=n(61),s=n(103),l=n(188)(!1),u=n(134)("IE_PROTO");e.exports=function(e,t){var n,i=s(e),r=0,a=[];for(n in i)n!=u&&o(i,n)&&a.push(n);for(;t.length>r;)o(i,n=t[r++])&&(~l(a,n)||a.push(n));return a}},function(e,t,n){var l=n(103),u=n(41),h=n(105);e.exports=function(s){return function(e,t,n){var i,r=l(e),a=u(r.length),o=h(n,a);if(s&&t!=t){for(;o<a;)if(i=r[o++],i!=i)return!0}else for(;o<a;o++)if((s||o in r)&&r[o]===t)return s||o||0;return!s&&-1}}},function(e,t,n){"use strict";var i=n(33),r=n(42),a=n(31),o=n(21)("species");e.exports=function(e){var t=i[e];a&&t&&!t[o]&&r.f(t,o,{configurable:!0,get:function(){return this}})}},function(e,t,n){var o=n(39),s=n(35),l=n(91);e.exports=n(36)?Object.defineProperties:function(e,t){s(e);for(var n,i=l(t),r=i.length,a=0;a<r;)o.f(e,n=i[a++],t[n]);return e}},function(e,t,n){var o=n(55),s=n(71),l=n(294)(!1),u=n(142)("IE_PROTO");e.exports=function(e,t){var n,i=s(e),r=0,a=[];for(n in i)n!=u&&o(i,n)&&a.push(n);for(;t.length>r;)o(i,n=t[r++])&&(~l(a,n)||a.push(n));return a}},function(e,t,n){var i=n(20).document;e.exports=i&&i.documentElement},function(e,t,n){var i=n(55),r=n(62),a=n(142)("IE_PROTO"),o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=r(e),i(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},function(e,t,n){var a=n(35);e.exports=function(t,e,n,i){try{return i?e(a(n)[0],n[1]):e(n)}catch(e){var r=t.return;throw void 0!==r&&a(r.call(t)),e}}},function(e,t,n){var i=n(70),r=n(26)("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||a[r]===e)}},function(e,t,n){var a=n(26)("iterator"),o=!1;try{var i=[7][a]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i=[7],r=i[a]();r.next=function(){return{done:n=!0}},i[a]=function(){return r},e(i)}catch(e){}return n}},function(e,t,n){"use strict";var l=n(40),u=n(298),h=n(113);n(115)("search",1,function(i,r,o,s){return[function(e){var t=i(this),n=null==e?void 0:e[r];return void 0!==n?n.call(e,t):new RegExp(e)[r](String(t))},function(e){var t=s(o,e,this);if(t.done)return t.value;var n=l(e),i=String(this),r=n.lastIndex;u(r,0)||(n.lastIndex=0);var a=h(n,i);return u(n.lastIndex,r)||(n.lastIndex=r),null===a?-1:a.index}]})},function(e,t,n){"use strict";var _=n(107),x=n(27),b=n(49),w=n(43),M=n(72),T=n(301),E=n(150),S=n(199),A=n(21)("iterator"),L=!([].keys&&"next"in[].keys()),I="@@iterator",k="keys",R="values",N=function(){return this};e.exports=function(e,t,n,i,r,a,o){T(n,t,i);var s,l,u,h=function(e){if(!L&&e in p)return p[e];switch(e){case k:case R:return function(){return new n(this,e)}}return function(){return new n(this,e)}},c=t+" Iterator",d=r==R,f=!1,p=e.prototype,m=p[A]||p[I]||r&&p[r],v=m||h(r),g=r?d?h("entries"):v:void 0,y="Array"==t&&p.entries||m;if(y&&(u=S(y.call(new e)),u!==Object.prototype&&u.next&&(E(u,c,!0),_||"function"==typeof u[A]||w(u,A,N))),d&&m&&m.name!==R&&(f=!0,v=function(){return m.call(this)}),_&&!o||!L&&!f&&p[A]||w(p,A,v),M[t]=v,M[c]=N,r)if(s={values:d?v:h(R),keys:a?v:h(k),entries:g},o)for(l in s)l in p||b(p,l,s[l]);else x(x.P+x.F*(L||f),t,s);return s}},function(e,t,n){var i=n(61),r=n(51),a=n(134)("IE_PROTO"),o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=r(e),i(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},function(e){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var i=n(191),r=n(144).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return i(e,r)}},function(e,t,n){var i=n(116),r=n(85),a=n(71),o=n(130),s=n(55),l=n(182),u=Object.getOwnPropertyDescriptor;t.f=n(36)?u:function(e,t){if(e=a(e),t=o(t,!0),l)try{return u(e,t)}catch(e){}if(s(e,t))return r(!i.f.call(e,t),e[t])}},function(e,t,n){var l=n(58),u=n(57);e.exports=function(s){return function(e,t){var n,i,r=String(u(e)),a=l(t),o=r.length;return a<0||o<=a?s?"":void 0:(n=r.charCodeAt(a),n<55296||56319<n||a+1===o||(i=r.charCodeAt(a+1))<56320||57343<i?s?r.charAt(a):n:s?r.slice(a,a+2):i-56320+(n-55296<<10)+65536)}}},function(e,t,n){var r=n(40),a=n(131),o=n(21)("species");e.exports=function(e,t){var n,i=r(e).constructor;return void 0===i||null==(n=r(i)[o])?t:a(n)}},function(e,t,n){"use strict";var c=n(36),d=n(91),f=n(154),p=n(116),m=n(62),v=n(141),r=Object.assign;e.exports=!r||n(47)(function(){var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach(function(e){t[e]=e}),7!=r({},e)[n]||Object.keys(r({},t)).join("")!=i})?function(e){for(var t=m(e),n=arguments.length,i=1,r=f.f,a=p.f;i<n;)for(var o,s=v(arguments[i++]),l=r?d(s).concat(r(s)):d(s),u=l.length,h=0;h<u;)o=l[h++],c&&!a.call(s,o)||(t[o]=s[o]);return t}:r},function(e,t,n){"use strict";var c=n(20),d=n(14),f=n(73),p=n(47),m=n(54),v=n(118),g=n(76),y=n(119),_=n(23),x=n(93),b=n(39).f,w=n(157)(0),M=n(36);e.exports=function(n,e,t,i,r,a){var o=c[n],s=o,l=r?"set":"add",u=s&&s.prototype,h={};return M&&"function"==typeof s&&(a||u.forEach&&!p(function(){(new s).entries().next()}))?(s=e(function(e,t){y(e,s,n,"_c"),e._c=new o,null!=t&&g(t,r,e[l],e)}),w("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(i){var r="add"==i||"set"==i;i in u&&(!a||"clear"!=i)&&m(s.prototype,i,function(e,t){if(y(this,s,i),!r&&a&&!_(e))return"get"==i&&void 0;var n=this._c[i](0===e?0:e,t);return r?this:n})}),a||b(s.prototype,"size",{get:function(){return this._c.size}})):(s=i.getConstructor(e,n,r,l),v(s.prototype,t),f.NEED=!0),x(s,n),h[n]=s,d(d.G+d.W+d.F,h),a||i.setStrong(s,n,r),s}},function(e,t,n){"use strict";var i=n(14);e.exports=function(e){i(i.S,e,{of:function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];return new this(t)}})}},function(e,t,n){"use strict";var i=n(14),l=n(60),u=n(46),h=n(76);e.exports=function(e){i(i.S,e,{from:function(e,t,n){var i,r,a,o,s=t;return l(this),i=void 0!==s,i&&l(s),null==e?new this:(r=[],i?(a=0,o=u(s,n,2),h(e,!1,function(e){r.push(o(e,a++))})):h(e,!1,r.push,r),new this(r))}})}},function(e,t,n){for(var i,r=n(33),a=n(43),o=n(88),s=o("typed_array"),l=o("view"),u=!(!r.ArrayBuffer||!r.DataView),h=u,c=0,d=9,f="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");c<d;)(i=r[f[c++]])?(a(i.prototype,s,!0),a(i.prototype,l,!0)):h=!1;e.exports={ABV:u,CONSTR:h,TYPED:s,VIEW:l}},function(e,t,n){var r=n(49);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},function(e){e.exports=function(e,t,n,i){if(!(e instanceof t)||void 0!==i&&i in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var i=n(58),r=n(41);e.exports=function(e){if(void 0===e)return 0;var t=i(e),n=r(t);if(t!==n)throw RangeError("Wrong length!");return n}},function(e,t,n){var _=n(101),x=n(133),b=n(51),w=n(41),i=n(334);e.exports=function(c,e){var d=1==c,f=2==c,p=3==c,m=4==c,v=6==c,g=5==c||v,y=e||i;return function(e,t,n){for(var i,r,a=b(e),o=x(a),s=_(t,n,3),l=w(o.length),u=0,h=d?y(e,l):f?y(e,0):void 0;u<l;u++)if((g||u in o)&&(i=o[u],r=s(i,u,a),c))if(d)h[u]=r;else if(r)switch(c){case 3:return!0;case 5:return i;case 6:return u;case 2:h.push(i)}else if(m)return!1;return v?-1:p||m?m:h}}},function(e,t,n){n(52)("Uint32",4,function(i){return function(e,t,n){return i(this,e,t,n)}})},function(e,t,n){n(52)("Int16",2,function(i){return function(e,t,n){return i(this,e,t,n)}})},function(e,t,n){var o=n(14),i=n(109),s=n(47),l=n(162),r="["+l+"]",u="​…",a=RegExp("^"+r+r+"*"),h=RegExp(r+r+"*$"),c=function(e,t,n){var i={},r=s(function(){return!!l[e]()||u[e]()!=u}),a=i[e]=r?t(d):l[e];n&&(i[n]=a),o(o.P+o.F*r,"String",i)},d=c.trim=function(e,t){return e=String(i(e)),1&t&&(e=e.replace(a,"")),2&t&&(e=e.replace(h,"")),e};e.exports=c},function(e,t,n){"use strict";var c=n(40),d=n(41),f=n(156),p=n(113);n(115)("match",1,function(i,r,u,h){return[function(e){var t=i(this),n=null==e?void 0:e[r];return void 0!==n?n.call(e,t):new RegExp(e)[r](String(t))},function(e){var t=h(u,e,this);if(t.done)return t.value;var n=c(e),i=String(this);if(!n.global)return p(n,i);var r=n.unicode;n.lastIndex=0;for(var a,o=[],s=0;null!==(a=p(n,i));){var l=String(a[0]);o[s]=l,""===l&&(n.lastIndex=f(i,d(n.lastIndex),r)),s++}return 0===s?null:o}]})},function(e,t,n){e.exports=n(373)},function(e){e.exports=function(e,t,n){var i=void 0===n;switch(t.length){case 0:return i?e():e.call(n);case 1:return i?e(t[0]):e.call(n,t[0]);case 2:return i?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return i?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return i?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e){function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}e.exports=t},function(e,t,n){e.exports=n(394)},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(2)),o=i(n(3)),h=i(n(166)),s=function(){function e(){(0,a.default)(this,e)}return(0,o.default)(e,[{key:"getScene",value:function(e,t,n,i,r,a,o){var s;s=n?t+".scene":t;var l=e+"/"+s+".fmap",u=new h.default;i&&(n||(l=e),u.setRequestHeader({"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"})),u.requestMethod=r||"GET",u.sendData=i,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,i,r,a){var o=new h.default;"fengmap"==e&&(e="https://www.fengmap.com/FMCloud/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){r(n,t,e,i)},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,i,r,a){var o=new h.default;o.requestMethod=i||"GET",o.sendData=r,o.setRequestHeader(a),o.getFile(e,function(e){e=JSON.parse(e),t(e)},function(e){n(e)})}}]),e}(),l=s;t.default=l},function(e,t,n){"use strict";var i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var r={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=r;t.default=a},function(e,u,t){(function(r){function a(e,t){for(var n=0,i=e.length-1;0<=i;i--){var r=e[i];"."===r?e.splice(i,1):".."===r?(e.splice(i,1),n++):n&&(e.splice(i,1),n--)}if(t)for(;n--;)e.unshift("..");return e}function i(e){"string"!=typeof e&&(e+="");var t,n=0,i=-1,r=!0;for(t=e.length-1;0<=t;--t)if(47===e.charCodeAt(t)){if(!r){n=t+1;break}}else-1===i&&(r=!1,i=t+1);return-1===i?"":e.slice(n,i)}function o(e,t){if(e.filter)return e.filter(t);for(var n=[],i=0;i<e.length;i++)t(e[i],i,e)&&n.push(e[i]);return n}u.resolve=function(){for(var e="",t=!1,n=arguments.length-1;-1<=n&&!t;n--){var i=0<=n?arguments[n]:r.cwd();if("string"!=typeof i)throw new TypeError("Arguments to path.resolve must be strings");i&&(e=i+"/"+e,t="/"===i.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 i=n(e.split("/")),r=n(t.split("/")),a=Math.min(i.length,r.length),o=a,s=0;s<a;s++)if(i[s]!==r[s]){o=s;break}var l=[];for(s=o;s<i.length;s++)l.push("..");return l=l.concat(r.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,i=-1,r=!0,a=e.length-1;1<=a;--a)if(t=e.charCodeAt(a),47===t){if(!r){i=a;break}}else r=!1;return-1===i?n?"/":".":n&&1===i?"/":e.slice(0,i)},u.basename=function(e,t){var n=i(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,i=-1,r=!0,a=0,o=e.length-1;0<=o;--o){var s=e.charCodeAt(o);if(47===s){if(r)continue;n=o+1;break}-1===i&&(r=!1,i=o+1),46===s?-1===t?t=o:1!==a&&(a=1):-1!==t&&(a=-1)}return-1===t||-1===i||0===a||1===a&&t===i-1&&t===n+1?"":e.slice(t,i)};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 i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var l=i(n(120)),a=i(n(226)),o=i(n(404)),s=i(n(222)),u="https://www.fengmap.com/FMCloud",h={check:u+"/sdk/check",onlineCheck:u+"/sdk/auth/web",fmFileServer:u+"/sdk/auth/downMaps"},c="026685bf295f587b5dffc1f18d5dc27c",d=function(e,t,n){if(!e||"string"!=typeof t||32!=t.length)return!1;if(null==e||""==e)return!0;var i=a.default.decryption(t,c),r=o.default.encryption(n);return i=a.default.decryption(i,r),i==e},f=function(e,t,n){n=n||"fengmap.localhost:";var i=o.default.encryption(n+t),r=a.default.decryption(e,i);return r},p=function(){var e=new Date,t=(e.getFullYear(),e.getMonth()+1),n=(e=e.getDate(),e%2==0?1:-1),i=Math.max(Math.pow(e%10+ +n,2)+n*t,0),r=Math.abs(2*e+n*t);return""+i+r},m=(p(),function(e,t,n){f(e,t);var i=window.location.host,r=i.indexOf(":");-1<r&&(i=i.slice(0,r));var a=i||"0.0.0.0";return{webURL:a,appKey:e,mapId:n,appName:t}}),v=new s.default,g={checkOffLine:function(e,t,n,i){n=n||i;var r=f(e,t);return n==r},checkIsOnLine:function(e,t){v.getData(h.check,function(){e&&e()},function(){t&&t()})},checkOnLine:function(e,t,n,i,r,a){var o=h.onlineCheck,s=m(e,t,n);s=(0,l.default)(s),v.getData(o,function(e){e?e.success?i&&i(e):r&&r(e):r&&r()},function(e){e?(e=JSON.parse(e),r&&r(e)):r&&r()},a,s,{"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"})},checkLicense:d,getCerityData:m,ls:0},y=g;t.default=y},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a,o,p,m,v,g,y,_,x,b,w,s=i(n(28)),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){var n=0,i=0,r=0;for(i=0;i<8;i++)1&t&&(n^=e),r=128&e,e<<=1,r&&(e^=27),t>>=1;return n},y=function(e,t,n){var i;for(i=0;i<4;i++)e[0+i]^=t[16*n+4*i],e[4+i]^=t[16*n+4*i+1],e[8+i]^=t[16*n+4*i+2],e[12+i]^=t[16*n+4*i+3]},_=function(e){var t,n,i,r;for(t=1;t<4;t++)for(i=0;i<t;){for(r=e[4*t+4-1],n=3;0<n;n--)e[4*t+n]=e[4*t+n-1];e[4*t+0]=r,i++}},x=function(e){var t,n,i,r;for(t=0;t<4;t++)for(n=0;n<4;n++)i=(240&e[4*t+n])>>4,r=15&e[4*t+n],e[4*t+n]=o[16*i+r]},b=function(e){var t;for(t=0;t<4;t++)e[t]=a[16*((240&e[t])>>4)+(15&e[t])]},w=function(e){return(0,s.default)(e,16)},{decryption:function(e,t){var n,i=Array(16);for(n=0;n<16;n++)i[n]=16*w(t.substr(2*n,1))+w(t.substr(2*n+1,1));var r=Array(16);for(n=0;n<16;n++)r[n]=16*w(e.substr(2*n,1))+w(e.substr(2*n+1,1));var a=Array(16);switch(n=[],i.length){default:case 16:p=4,m=10;break;case 24:p=6,m=12;break;case 32:p=8,m=14}var o,s=n=Array(16*(m+1)),l=Array(4),u=4*(m+1);for(o=0;o<p;o++)s[4*o+0]=i[4*o+0],s[4*o+1]=i[4*o+1],s[4*o+2]=i[4*o+2],s[4*o+3]=i[4*o+3];for(o=p;o<u;o++){if(l[0]=s[4*(o-1)+0],l[1]=s[4*(o-1)+1],l[2]=s[4*(o-1)+2],l[3]=s[4*(o-1)+3],0==o%p){i=l;var h=void 0,c=void 0;for(h=i[0],c=0;c<3;c++)i[c]=i[c+1];if(i[3]=h,b(l),i=o/p,1==i)v[0]=1;else if(1<i)for(v[0]=2,i--;0<i-1;)v[0]=g(v[0],2),i--;i=l,h=v,c=l,c[0]=i[0]^h[0],c[1]=i[1]^h[1],c[2]=i[2]^h[2],c[3]=i[3]^h[3]}else 6<p&&4==o%p&&b(l);s[4*o+0]=s[4*(o-p)+0]^l[0],s[4*o+1]=s[4*(o-p)+1]^l[1],s[4*o+2]=s[4*(o-p)+2]^l[2],s[4*o+3]=s[4*(o-p)+3]^l[3]}for(s=Array(16),l=0;l<4;l++)for(o=0;o<4;o++)s[4*l+o]=r[l+4*o];for(y(s,n,m),r=m-1;1<=r;r--)for(_(s),x(s),y(s,n,r),l=s,o=[14,9,13,11],u=c=void 0,i=Array(4),h=Array(4),u=0;u<4;u++){for(c=0;c<4;c++)i[c]=l[4*c+u];c=o;var d=i,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++)l[4*c+u]=h[c]}for(_(s),x(s),y(s,n,0),l=0;l<4;l++)for(o=0;o<4;o++)a[l+4*o]=s[4*l+o];for(r="",n=0;n<16;++n)s=a[n].toString(16),s.length<2&&(s="0"+s),r+=s;return r}}),u=l;t.default=u},function(e,n,i){"use strict";var r=i(1),a=i(0);a(n,"__esModule",{value:!0}),n.default=void 0;var s=r(i(24));i(22);var o=r(i(2)),l=r(i(3)),u=u||{};u.GLEN1="MULTIPOLYGON(((".length,u.GLEN2="POINT(".length,u.GLEN3="MULTILINESTRING((".length;var h=function(){function e(){(0,o.default)(this,e),this._points,this._holes}return(0,l.default)(e,[{key:"parse",value:function(e){if(this._points=[],this._holes=[],0==e.indexOf("MULTIPOLYGON((("))for(var t=e.substring(u.GLEN1,e.length-3).split(/\),\(/),n=0;n<t.length;n++){var i=t[n].split(/,/);if(0==n)for(var r=0;r<i.length;r++){var a=i[r].split(" ");this._points.push({x:(0,s.default)(a[0]),y:(0,s.default)(a[1])})}else{var o=[];for(r=0;r<i.length;r++)a=i[r].split(" "),o.push({x:(0,s.default)(a[0]),y:(0,s.default)(a[1])});this._holes.push(o)}}else if(0==e.indexOf("POINT("))a=e.substring(u.GLEN2,e.length-1).split(" "),this._points.push({x:(0,s.default)(a[0]),y:(0,s.default)(a[1])});else if(0==e.indexOf("MULTILINESTRING(("))for(i=e.substring(u.GLEN3,e.length-2).split(","),r=0;r<i.length;r++)a=i[r].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==e.indexOf("MULTIPOLYGON((("))for(var t=e.substring(u.GLEN1,e.length-3).split(","),n=0;n<t.length;n++){var i=t[n].split(" ");this._points.push({x:(0,s.default)(i[0]),y:(0,s.default)(i[1])})}else if(0==e.indexOf("POINT("))i=e.substring(u.GLEN2,e.length-1).split(" "),this._points.push({x:(0,s.default)(i[0]),y:(0,s.default)(i[1])});else if(0==e.indexOf("MULTILINESTRING(("))for(t=e.substring(u.GLEN3,e.length-2).split(","),n=0;n<t.length;n++)i=t[n].split(" "),this._points.push({x:(0,s.default)(i[0]),y:(0,s.default)(i[1])});return this}},{key:"toPntStrip",value:function(e){var t=[],n=this._points.length;if(!0===e){if(1<=n)for(var i=0;i<n-1;i++){var r=this._points[i];t.push(r.x,r.y)}}else for(i=0;i<n;i++)r=this._points[i],t.push(r.x,r.y);return t}},{key:"mergePnts",value:function(e){for(var t=[],n=e.length,i=0;i<n;i++){for(var r=e[i],a={x:this.toFixed(r.x),y:this.toFixed(r.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=[],i=this._points.length;if(i<=0)return n;for(var r=this._points.splice(i-1,1)[0],a=this.mergePnts(this._points),o=a.length,s=0;s<o;s++){var l=a[s];n.push(l.x,l.y)}return!0===e||(t={x:this.toFixed(r.x),y:this.toFixed(r.y)},n.push(t.x,t.y),this._points.push(r)),n}},{key:"hasHoles",value:function(){return null!=this._holes&&0<this._holes.length}},{key:"toStripHoles",value:function(e){for(var n=[],i=0;i<this._holes.length;i++){for(var r=this._holes[i],a=[],o=r.length,s=r.splice(o-1,1)[0],l=this.mergePnts(r),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}(),c=h;n.default=c},function(e,n,i){"use strict";var r=i(1),a=i(0);a(n,"__esModule",{value:!0}),n.default=void 0;var o=r(i(2)),s=r(i(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,i=0;i<e.length;i++){var r=e[i].idxs;if(r=r||e[i],"number"==typeof r)for(;n<r;)this._points.push({x:t[n],y:t[n+1]}),n+=2;else for(var a=0;a<r.length;a++)for(var o=r[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,i=0;i<e.length;i++){var r=e[i].idxs;if(r=r||e[i],"number"==typeof r)for(;n<r;)this._points.push({x:t[n],y:t[n+1]}),n+=2;else for(var a=0;a<r.length;a++)if(0===a)for(var o=r[a];n<o;)this._points.push({x:t[n],y:t[n+1]}),n+=2;else{for(var s=[],l=r[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,i=0;i<n;i++){for(var r=e[i],a={x:this.toFixed(r.x),y:this.toFixed(r.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=[],i=this._points.length;if(i<=0)return n;for(var r=this._points.splice(i-1,1)[0],a=this._points,o=a.length,s=0;s<o;s++){var l=a[s];n.push(l.x,l.y)}return!0===e||(t={x:this.toFixed(r.x),y:this.toFixed(r.y)},n.push(t.x,t.y),this._points.push(r)),n}},{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=[],i=0;i<this._holes.length;i++){for(var r=this._holes[i],a=[],o=r.length,s=r.splice(o-1,1)[0],l=this.mergePnts(r),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 i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var s=i(n(19)),l=i(n(12)),u=i(n(18)),h=i(n(17)),a=i(n(15));n(10),n(5),n(4),n(75);var o=i(n(28));n(34);var c=i(n(2)),d=i(n(3)),f=n(230),p=i(n(235)),m=i(n(438)),v=i(n(95));function g(e){if(void 0===h.default||null==e[u.default]){if((0,l.default)(e)||(e=y(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}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 i,r,a=!0,o=!1;return{s:function(){i=(0,s.default)(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw r}}}}function y(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function x(e,t){if(v.default.d){var n=v.default.d();n.minFilter=fm.LinearFilter,n.generateMipmaps=!1;var i=.4,r=new fm.Vector2(i,.12*i/.5),a=new m.default;a.transparent=!0,a.uniforms.scale={value:r};var o=-1*(.5*r.x/e-1),s=-1*(1-.5*r.y);a.uniforms.offset={value:new fm.Vector2(o,s)},a.uniforms.mmap={value:n},a.needsUpdate=!0;var l=new p.default,u=new fm.Mesh(l,a);u.frustumCulled=!1,v.default[t.uuid].f=u}}var b=function(){function n(e,t){(0,c.default)(this,n),this.container=e.container,this.renderer=null,this._map=t,this._clearColor=16777215,this._clearAlpha=1,this._viewMode=t._viewMode,this._w=this.container.clientWidth,this._h=this.container.clientHeight,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,x(this._w/this._h,t)}return(0,d.default)(n,[{key:"getFrustumByViewMode",value:function(e){var t="3d"==e?this.perspectiveCamera:this.orthographicCamera;return t.updateMatrixWorld(!0),(new fm.Frustum).setFromMatrix((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){var t=(new fm.TextureLoader).load(e);this.background.background=t}},{key:"resetCompass",value:function(){if(this.compassNode){var e=this.getAspect(),t=this.getScaleByPixels(1,this._map.MapOptions.compassSize),n=-this.getScaleByPixels(1,this._map.MapOptions.compassOffset[1]),i=this.getScaleByPixels(1,this._map.MapOptions.compassOffset[0])/e,r=this.getCompassOffset(this._map.MapOptions.compassPosition,t,e,i,n);this.compassNode.material.uniforms.scale={value:t},this.compassNode.material.uniforms.offset={value:new fm.Vector2(r.ox,r.oy)},this.compassNode.userData.coord={x:r.ox,y:r.oy},this.compassNode.userData.width=.5*t}}},{key:"getCompassOffset",value:function(e,t,n,i,r){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+i,oy:l+r}}},{key:"resetLocationsSize",value:function(){var e,t=this.renderList,n=g(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;if("location"==i.userData.type){var r,a=g(i.children);try{for(a.s();!(r=a.n()).done;){var o=r.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){if("3d"==this._viewMode){var n=new fm.Matrix4;n.multiplyMatrices(this.perspectiveCamera.matrixWorldInverse,e.matrixWorld);var i=(new fm.Vector3).applyMatrix4(n),r=t/(this.container.clientHeight/(2*Math.tan(this.perspectiveCamera.fov*fm.Math.DEG2RAD/2)))*Math.abs(i.z);e.scale.set(r,r,r)}else{var a=t*Math.abs(this.orthographicCamera.top-this.orthographicCamera.bottom)/this.orthographicCamera.zoom/this.container.clientHeight;e.scale.set(a,a,a)}}},{key:"setLabelSize",value:function(e,t){if("3d"==this._viewMode){var n=t/(this.container.clientHeight/(2*Math.tan(this.perspectiveCamera.fov*fm.Math.DEG2RAD/2)));e.scale.set(n,n,n),e.scale.multiplyScalar(e.material.userData.mspriteScale),e.scale.setX(e.scale.x/e.material.userData.scaleRatio)}else{var i=t*Math.abs(this.orthographicCamera.top-this.orthographicCamera.bottom)/this.orthographicCamera.zoom/this.container.clientHeight;e.scale.set(i,i,i),e.scale.multiplyScalar(e.material.userData.mspriteScale),e.scale.setX(e.scale.x/e.material.userData.scaleRatio)}}},{key:"setFacilitySize",value:function(e,t){if("3d"==this._viewMode){var n=t/(this.container.clientHeight/(2*Math.tan(this.perspectiveCamera.fov*fm.Math.DEG2RAD/2)));e.scale.set(n,n,n)}else{var i=t*Math.abs(this.orthographicCamera.top-this.orthographicCamera.bottom)/this.orthographicCamera.zoom/this.container.clientHeight;e.scale.set(i,i,i)}}},{key:"setImageMarkerSize",value:function(e){if("3d"==this._viewMode){var t=e.material.userData.size/(this.container.clientHeight/(2*Math.tan(this.perspectiveCamera.fov*fm.Math.DEG2RAD/2)));e.scale.set(t,t,t)}else{var n=e.material.userData.size*Math.abs(this.orthographicCamera.top-this.orthographicCamera.bottom)/this.orthographicCamera.zoom/this.container.clientHeight;e.scale.set(n,n,n)}}},{key:"parseGroup",value:function(e){var t=[],n=e._getLayers(!1);this.getShadowScene();var i=this.shadowscene.children;for(var r in n){var a=n[r];if(!this.needshadow||"model"!==r&&"extent"!==r){var o,s=g(a);try{for(s.s();!(o=s.n()).done;){var l=o.value;l.renderOrder=f.LayerOrder[r],t.push(l)}}catch(e){s.e(e)}finally{s.f()}}else{var u,h=g(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=f.LayerOrder.model,t.push(this.shadowscene)),e.locationScene.renderOrder=f.LayerOrder.location,t.push(e.locationScene),e.lineScene.renderOrder=f.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*window.devicePixelRatio,n.shadow.mapSize.height=610*window.devicePixelRatio;var i=new fm.DirectionalLight(3355443);i.position.set(-.5,1,-1).normalize(),i.target=t,this.shadowscene.add(n),this.shadowscene.add(e),this.shadowscene.add(i),this.shadowscene.add(t)}},{key:"parseList",value:function(e){var t=[];if(e){var n,i=g(e);try{for(i.s();!(n=i.n()).done;){var r,a=n.value,o=g(a);try{for(o.s();!(r=o.n()).done;){var s=r.value,l=this.parseGroup(s);l.sort(function(e,t){return e.renderOrder-t.renderOrder}),t=t.concat(l)}}catch(e){o.e(e)}finally{o.f()}}}catch(e){i.e(e)}finally{i.f()}}return t}},{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.container.clientWidth,t=this.container.clientHeight;return this.renderer.setSize(e,t),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.shadowMap.enabled=!0,this.renderer.shadowMap.type=fm.PCFSoftShadowMap,this.renderer.autoClear=!1,this.canvas=this._map.canvas,this.container.appendChild(this.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=g(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;if("facility"==i.userData.type){var r,a=g(i.children);try{for(a.s();!(r=a.n()).done;){var o=r.value;this.setFacilitySize(o,o.mapNode.size)}}catch(e){a.e(e)}finally{a.f()}}else if("label"==i.userData.type){var s,l=g(i.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"==i.userData.type){var h,c=g(i.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"==i.userData.type){var f,p=g(i.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){if(v.default[this._map.uuid].f){var t=.4,n=new fm.Vector2(t,.12*t/.5);v.default[this._map.uuid].f.material.uniforms.scale={value:n},isNaN(e);var i=-1*(.5*n.x/e-1),r=-1*(1-.5*n.y);v.default[this._map.uuid].f.material.uniforms.offset={value:new fm.Vector2(i,r)}}}},{key:"resizeLine",value:function(){var e,t=this.renderList,n=g(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;if("line"==i.userData.type){var r,a=g(i.children);try{for(a.s();!(r=a.n()).done;){var o=r.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(){this._fristRender||(this._map.dispatchEvent({type:"fristRender"}),this._fristRender=!0),(5<Math.abs(this._w-this.container.clientWidth)||5<Math.abs(this._h-this.container.clientHeight))&&(this._w=this.container.clientWidth,this._h=this.container.clientHeight,this.resize(),this.resetSpriteSize(),this.resetLocationsSize(),this._map.updatePopsPosition(),this.resizeLine(),this.resetCompass());var e="3d"==this._viewMode?this.perspectiveCamera:this.orthographicCamera,t=this.renderList;if(t&&this.renderer){if(this.renderer.clear(),this.renderer.clearDepth(),this._envMap&&this.renderer.render(this._envMap,e),this.lightEffects)this.bloomRender(e);else{void 0!==this.background.background&&this.renderer.render(this.background,e);var n,i=g(t);try{for(i.s();!(n=i.n()).done;){var r=n.value;this.renderer.render(r,e)}}catch(e){i.e(e)}finally{i.f()}e.layers.set(0),this._showCompass&&this._compassNode&&this.renderer.render(this._compassNode,e)}v.default[this._map.uuid].f&&this.renderer.render(v.default[this._map.uuid].f,e)}}},{key:"setSceneNodeLayers",value:function(e,t){var n,i=g(e.children);try{for(i.s();!(n=i.n()).done;){var r=n.value;r.mapNode&&!r.mapNode.picLoading&&r.layers.set(t)}}catch(e){i.e(e)}finally{i.f()}}},{key:"setClearColor",value:function(e,t){"string"==typeof e&&0<=e.indexOf("#")?this._clearColor=(0,o.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){if(e&&e.path&&e.format){var t=e.path,n=e.format,i=(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=i}}},{key:"dispose",value:function(){this._envMap&&(this._envMap=void 0);var e=this.renderList;if(e){var t,n=g(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i){for(var r=i.children.length-1;-1<r;r--)i.remove(i.children[r]);i.children.length=0,i=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.container.removeChild(this.canvas),this.canvas=void 0,this.renderer=void 0,this.container=void 0}},{key:"renderList",set:function(e){this._renderList=this.parseList(e)},get:function(){return this._renderList}},{key:"domElementHeight",get:function(){return this.container.clientHeight}},{key:"domElementWidth",get:function(){return this.container.clientWidth}},{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}(),w=b;t.default=w},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.LayerOrder=t.Prop2Alias=t.AliasLayerMap=t.LayerAlias=void 0;var a=i(n(405)),o=i(n(232)),s=i(n(415)),l=i(n(432)),u=i(n(243)),h=i(n(245)),c=i(n(247)),d=i(n(248)),f=i(n(249)),p=i(n(435)),m=i(n(250)),v=i(n(437)),g=i(n(252)),y=i(n(253)),_=["extent","model","label","facility","line","locationMarker","text","textMarker","polygonMarker","imageMarker","stair","externalModel","heatmap","dynmodel","symbol","domMarker"];t.LayerAlias=_;var x=new a.default;t.AliasLayerMap=x,x.set("extent",o.default),x.set("externalModel",s.default),x.set("model",l.default),x.set("label",u.default),x.set("facility",h.default),x.set("imageMarker",c.default),x.set("polygonMarker",d.default),x.set("textMarker",f.default),x.set("stair",p.default),x.set("heatmap",m.default),x.set("symbol",v.default),x.set("domMarker",g.default),x.set("dynmodel",y.default);var b={extentLayer:"extent",externalModelLayer:"externalModel",labelLayer:"label",modelLayer:"model",poiLayer:"facility",stairLayer:"stair"};t.Prop2Alias=b;var w={extent:0,line:2,model:1,externalModel:.5,heatmap:3,polygonMarker:3,location:4,facility:4,label:4,imageMarker:4,textMarker:4,domMarker:4,dynmodel:.5};t.LayerOrder=w},function(e,t,n){"use strict";var i=n(20),r=n(11),a=n(39),o=n(36),s=n(26)("species");e.exports=function(e){var t="function"==typeof r[e]?r[e]:i[e];o&&t&&!t[s]&&a.f(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6));n(10);var o=i(n(2)),s=i(n(3)),l=i(n(7)),u=i(n(8)),h=i(n(9)),c=i(n(13)),d=i(n(414));function f(i){return function(){var e,t=(0,u.default)(i);if(p()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}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,h.default)(r,e);var i=f(r);function r(e,t){var n;return(0,o.default)(this,r),n=i.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,s.default)(r,[{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 d.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=[];for(var t in this._extents)this._extents[t].renderNode&&e.push(this._extents[t].renderNode);return e}},{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&&this.parent.parent.parent.map.setRenderList()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}}]),r}(c.default),v=m;t.default=v},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var s=i(n(19)),l=i(n(18)),u=i(n(17)),a=i(n(15));n(5),n(4);var o=i(n(6)),h=i(n(28));n(22);var c=i(n(12));n(10);var d=i(n(2)),f=i(n(3)),p=i(n(7)),m=i(n(8)),v=i(n(9)),g=i(n(13)),y=i(n(37)),_=i(n(32));function x(e){if(void 0===u.default||null==e[l.default]){if((0,c.default)(e)||(e=b(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}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 i,r,a=!0,o=!1;return{s:function(){i=(0,s.default)(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw r}}}}function b(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function M(i){return function(){var e,t=(0,m.default)(i);if(T()){var n=(0,m.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,p.default)(this,e)}}function T(){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}}var E=function(e){(0,v.default)(r,e);var i=M(r);function r(e,t){var n;return(0,d.default)(this,r),n=i.call(this,t.eid,y.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,f.default)(r,[{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,c.default)(t)){var i,r=x(t);try{for(r.s();!(i=r.n()).done;){var a=i.value;a.color=new fm.Color(_.default.toColor(e.color)),a.userData.opacity=t.opacity}}catch(e){r.e(e)}finally{r.f()}}else t.color=new fm.Color(_.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,h.default)(o[0]),(0,h.default)(o[1]),(0,h.default)(o[2])),n.rotation.set((0,h.default)(s[0])*fm.Math.DEG2RAD,(0,h.default)(s[2])*fm.Math.DEG2RAD,(0,h.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,i){var r=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++)r._preColor=e.material[t].color,e.material[t].color=new fm.Color(_.default.toRgba(n)),r._preOpacity=e.material[t].opacity,"number"==typeof i&&(e.material[t].opacity=i),e.material[t].needsUpdate=!0;else r._preColor=e.material.color,e.material.color=new fm.Color(_.default.toRgba(n)),r._preOpacity=e.material.opacity,"number"==typeof i&&(e.material.opacity=i),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 t=this;if(this._renderNode){this._renderNode.material.userData.color=this._renderNode.material.color;var e=this.findParent(NodeManager),n=e.map,i=n.modelSelectColor;animater=new Animater({r:i.r/2,g:i.g/2,b:i.b/2,a:i.a/2},i,500,function(){n.removeAnimater(animater),animater=void 0},function(e){t._renderNode.material.color=new fm.Color(e.r,e.g,e.b),t._renderNode.material.alpha=e.a,t._renderNode.material.update=!0}).start(),n.addAnimater(animater)}}},{key:"clearGradient",value:function(){if(this._renderNode){var e=this.findParent(NodeManager),t=e.map;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,c.default)(this._renderNode.material)){var t,n=x(this._renderNode.material);try{for(n.s();!(t=n.n()).done;){var i=t.value;i.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){e?this.parent.scene.children.indexOf(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.parent&&(this._renderNode=e,this._renderNode.mapNode=this,this.parent.scene.children.indexOf(this._renderNode)<0&&this._renderNode&&this.parent.scene.add(this._renderNode))}},{key:"bdata",get:function(){return this._bdata},set:function(e){this._bdata=e}}]),r}(g.default),S=E;t.default=S},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var s=i(n(19)),l=i(n(12)),u=i(n(18)),h=i(n(17)),a=i(n(15));n(10),n(5),n(4);var o=i(n(6));n(45);var c=i(n(77)),d=i(n(29)),f=i(n(2)),p=i(n(3)),m=i(n(7)),v=i(n(8)),g=i(n(9)),y=i(n(13)),_=n(230),x=(i(n(416)),i(n(30))),b=i(n(59));function w(e){if(void 0===h.default||null==e[u.default]){if((0,l.default)(e)||(e=M(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}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 i,r,a=!0,o=!1;return{s:function(){i=(0,s.default)(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw r}}}}function M(e,t){if(e){if("string"==typeof e)return T(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T(e,t):void 0}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function E(i){return function(){var e,t=(0,v.default)(i);if(S()){var n=(0,v.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,m.default)(this,e)}}function S(){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}}var A=function(e){(0,g.default)(a,e);var r=E(a);function a(e,t,n){var i;return(0,f.default)(this,a),i=r.call(this,e),i._layers={},i.initLayers(),i.initLayersByData(t),i._visible=!0,i._groupMessage=n,i._locations=[],i._height=n.height,i._locationScene=new fm.Scene,i._locationScene.userData.type="location",i._locationScene.position.setY(i._height),i._locationScene.updateMatrix(),i._locationScene.updateWorldMatrix(),i._offsetHeight=0,i._lineScene=new fm.Scene,i._lineScene.userData.type="line",i.externalModels={},i.isGroup=!0,i.alwaysShowMarkers=[],i._groupAlias=n.alias,i._groupDesc=n.desc,i._groupName=n.gname,i._hideWithFree=!1,i.modelShadow={},i._group=new fm.Scene,i._mainLight=null,i.initScene(),i}return(0,p.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=_.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),this.parent.parent.map.setRenderList(),this._layers[e][0]}},{key:"getLayers",value:function(e){var t=[],n=this._layers[e];return t.push.apply(t,(0,d.default)(n)),t}},{key:"getDynmodel",value:function(e){for(var t=this._layers.dynmodel,n=0;n<t.length;n++){var i=t[n].scene;i&&e(i)}}},{key:"everyLayers",value:function(e,t){if(this._layers)for(var n in this._layers)if(!(-1<e.indexOf(n)))for(var i=this._layers[n],r=0;r<i.length;r++){var a=i[r].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,i=e.renderNode.boundingBox.max,r=t.renderNode.boundingBox.min,a=t.renderNode.boundingBox.max;return x.default.isRectCross(new vector2(n.x,n.z),new vector2(i.x,i.z),new vector2(r.x,r.z),new vector2(a.x,a.z))}},{key:"mergeModels",value:function(e){var t=this._layers.model[0],n=[];for(var i in t._models)t._models[i].FID in e&&n.push(t._models[i]);var r,a=this.checkModelsNearly(n),o=w(a.l);try{for(o.s();!(r=o.n()).done;){var s=r.value;t.removeNode(s)}}catch(e){o.e(e)}finally{o.f()}}},{key:"mergeModel",value:function(e,t){var n=new ThreeBSP(e.renderNode.geometry),i=new ThreeBSP(t.renderNode.geometry),r=n.union(i.tree),a=r.toMesh(e.material);return e._renderNode=a}},{key:"couldMerge",value:function(e,t){var n=new ThreeBSP(e.renderNode.geometry),i=new ThreeBSP(t.renderNode.geometry),r=n.intersect(i.tree);return 0<r.tree.polygons.length}},{key:"checkModelsNearly",value:function(e){for(var t=[],n=0;n<e.length;n++){for(var i=0,r=0;r<e.length;r++)this.bcross(e[n],e[r])&&i++;i||t.push(n)}for(var a=t.length-1;-1<a;a--){var o=e.indexOf(e[t[a]]);-1<o&&e.splice(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]),e.splice(l,1),e.splice(s,1),e.push(c),s=0,l=1}else{if(l!==e.length-1)return l++,{e:u,l:h};var d=e.splice(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],i=0;i<n.length;i++)e(n[i])}},{key:"traverseByAlias",value:function(i,r,a){var o=this;if(this._layers){var e=function(t){if(-1<i.indexOf(t))for(var e=o._layers[t],n=0;n<e.length;n++)a?r(e[n],t):e[n].traverse(function(e){r(e,t)})};for(var t in this._layers)e(t)}}},{key:"setExtentImage",value:function(e){var t,n=this.parent.parent.materialManager.loadTexture(e,function(){}),i=this.getLayers("extent"),r=w(i);try{for(r.s();!(t=r.n()).done;){var a=t.value;for(var o in a.extents){var s=a.extents[o];s.renderNode.material.map&&s.renderNode.material.map.dispose(),s.renderNode.material.map=n,s.renderNode.material.needsUpdate=!0}}}catch(e){r.e(e)}finally{r.f()}}},{key:"clearExtentImage",value:function(){var e,t=this.getLayers("extent"),n=w(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;for(var r in i.extents){var a=i.extents[r];a.renderNode.material.map.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={};for(var n in this._layers){for(var i=this._layers[n],r=[],a=0;a<i.length;a++){e&&i[a].checkSceneNode();var o=i[a].scene;i[a].visible&&o&&r.push(o)}t[n]=r}return t}}},{key:"initLayers",value:function(){var e,t=w(_.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],i=e.biz[0],r=(0,c.default)(n),a=w(r);try{for(a.s();!(t=a.n()).done;){var o=t.value;if(n[o]&&0<n[o].length&&_.Prop2Alias[o]){var s=_.AliasLayerMap.get(_.Prop2Alias[o]),l=new s(n[o],i[o]);l.scene.position.setY(this._height),l.scene.updateMatrix(),l.scene.updateWorldMatrix(),l.parent=this,this._layers[_.Prop2Alias[o]].push(l)}}}catch(e){a.e(e)}finally{a.f()}}},{key:"removeAlwaysShowMarker",value:function(e){var t=this.alwaysShowMarkers.indexOf(e);-1<t&&this.alwaysShowMarkers.splice(t,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 i=this._locationScene.children.length-1;-1<i;i--)this._locationScene.remove(this._locationScene.children[i]);var r,a=w(this._locations);try{for(a.s();!(r=a.n()).done;){var o=r.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),this.parent.parent.map.setRenderList(),(e.prepareInited||0<e.prepareInitObjects.length)&&e.initPrepare()}},{key:"removeLayer",value:function(e){e.removeAll&&e.removeAll(),e.parent=void 0;var t=this._layers[e.alias].indexOf(e);-1<t&&this._layers[e.alias].splice(t,1),this.parent.parent.map.setRenderList()}},{key:"getLayer",value:function(e){var t=this._layers[e];if(1<t.length){var n=[];return n.push.apply(n,(0,d.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=this._locations.indexOf(e);e.isAlwaysShow&&this.removeAlwaysShowMarker(e),e.parent=void 0,-1<t&&this._locations.splice(t,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=w(this._layers.model);try{for(n.s();!(e=n.n()).done;){var i=e.value;t.push.apply(t,(0,d.default)(i.getAllMesh()))}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"getExtentMeshs",value:function(){var e,t=[],n=w(this._layers.extent);try{for(n.s();!(e=n.n()).done;){var i=e.value;t.push.apply(t,(0,d.default)(i.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 i=t[n],r=i._extents;for(var a in r)for(var o=r[a],s=o.gdata.geo,l=b.default.convertGeo2Geometry(s).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}(y.default),L=A;t.default=L},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6));n(53);var o=i(n(2)),s=i(n(7)),l=i(n(8)),u=i(n(9));function h(i){return function(){var e,t=(0,l.default)(i);if(c()){var n=(0,l.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,s.default)(this,e)}}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,u.default)(r,e);var i=h(r);function r(){var e;(0,o.default)(this,r),e=i.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.addAttribute("position",new fm.InterleavedBufferAttribute(n,3,0,!1)),e.addAttribute("uv",new fm.InterleavedBufferAttribute(n,2,3,!1)),e}return r}(fm.BufferGeometry),f=d;t.default=f},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var p=i(n(77));n(34);var a=i(n(16)),o=i(n(64));n(53),n(214),n(159),n(215),n(161);var s=i(n(78));n(75),n(163),n(63),n(50),n(4),n(423);var m=i(n(12)),g=i(n(424));function l(e){this.manager=void 0!==e?e:fm.DefaultLoadingManager,this.dracoLoader=null,this.ddsLoader=null}function u(){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={}}}}n(10),n(160),l.prototype={constructor:l,crossOrigin:"anonymous",load:function(n,i,e,t){var r,a=this;r=void 0!==this.resourcePath?this.resourcePath:void 0!==this.path?this.path:fm.LoaderUtils.extractUrlBase(n),a.manager.itemStart(n);var o=function(e){t?t(e):console.error(e),a.manager.itemError(n),a.manager.itemEnd(n)},s=new fm.FileLoader(a.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),"use-credentials"===a.crossOrigin&&s.setWithCredentials(!0),s.load(n,function(t){try{a.parse(t,r,function(e){i(e,t),a.manager.itemEnd(n)},o)}catch(e){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,i){var r,a={};if("string"==typeof e)r=e;else{var o=fm.LoaderUtils.decodeText(new Uint8Array(e,0,4));if(o===_){try{a[v.KHR_BINARY_GLTF]=new x(e)}catch(e){return void(i&&i(e))}r=a[v.KHR_BINARY_GLTF].content}else r=fm.LoaderUtils.decodeText(new Uint8Array(e))}var s=JSON.parse(r);if(void 0===s.asset||s.asset.version[0]<2)i&&i(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 v.KHR_LIGHTS_PUNCTUAL:a[u]=new f(s);break;case v.KHR_MATERIALS_UNLIT:a[u]=new y;break;case v.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:a[u]=new M;break;case v.KHR_DRACO_MESH_COMPRESSION:a[u]=new b(s,this.dracoLoader);break;case v.MSFT_TEXTURE_DDS:a[v.MSFT_TEXTURE_DDS]=new d(this.ddsLoader);break;case v.KHR_TEXTURE_TRANSFORM:a[v.KHR_TEXTURE_TRANSFORM]=new w;break;default:0<=h.indexOf(u)&&console.warn('fm.GLTFLoader: Unknown extension "'+u+'".')}}var c=new W(s,a,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager});c.parse(n,i)}}};var v={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 d(e){if(!e)throw new Error("fm.GLTFLoader: Attempting to load .dds texture without importing fm.DDSLoader");this.name=v.MSFT_TEXTURE_DDS,this.ddsLoader=e}function f(e){this.name=v.KHR_LIGHTS_PUNCTUAL;var t=e.extensions&&e.extensions[v.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function y(){this.name=v.KHR_MATERIALS_UNLIT}f.prototype.loadLight=function(e){var t,n=this.lightDefs[e],i=new fm.Color(16777215);void 0!==n.color&&i.fromArray(n.color);var r=void 0!==n.range?n.range:0;switch(n.type){case"directional":t=new fm.DirectionalLight(i),t.target.position.set(0,0,-1),t.add(t.target);break;case"point":t=new fm.PointLight(i),t.distance=r;break;case"spot":t=new fm.SpotLight(i),t.distance=r,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)},y.prototype.getMaterialType=function(){return fm.MeshBasicMaterial},y.prototype.extendParams=function(e,t,n){var i=[];e.color=new fm.Color(1,1,1),e.opacity=1;var r=t.pbrMetallicRoughness;if(r){if((0,m.default)(r.baseColorFactor)){var a=r.baseColorFactor;e.color.fromArray(a),e.opacity=a[3]}void 0!==r.baseColorTexture&&i.push(n.assignTexture(e,"map",r.baseColorTexture))}return g.default.all(i)};var _="glTF",h=12,c={JSON:1313821514,BIN:5130562};function x(e){this.name=v.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,h);if(this.header={magic:fm.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==_)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,h),i=0;i<n.byteLength;){var r=n.getUint32(i,!0);i+=4;var a=n.getUint32(i,!0);if(i+=4,a===c.JSON){var o=new Uint8Array(e,h+i,r);this.content=fm.LoaderUtils.decodeText(o)}else if(a===c.BIN){var s=h+i;this.body=e.slice(s,s+r)}i+=r}if(null===this.content)throw new Error("fm.GLTFLoader: JSON content not found.")}function b(e,t){if(!t)throw new Error("fm.GLTFLoader: No DRACOLoader instance provided.");this.name=v.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t}function w(){this.name=v.KHR_TEXTURE_TRANSFORM}function M(){return{name:v.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 i=t.extensions[this.name],r=fm.ShaderLib.standard,a=fm.UniformsUtils.clone(r.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=r.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=r.vertexShader,e.fragmentShader=c,e.uniforms=a,e.defines={STANDARD:""},e.color=new fm.Color(1,1,1),e.opacity=1;var d=[];if((0,m.default)(i.diffuseFactor)){var f=i.diffuseFactor;e.color.fromArray(f),e.opacity=f[3]}if(void 0!==i.diffuseTexture&&d.push(n.assignTexture(e,"map",i.diffuseTexture)),e.emissive=new fm.Color(0,0,0),e.glossiness=void 0!==i.glossinessFactor?i.glossinessFactor:1,e.specular=new fm.Color(1,1,1),(0,m.default)(i.specularFactor)&&e.specular.fromArray(i.specularFactor),void 0!==i.specularGlossinessTexture){var p=i.specularGlossinessTexture;d.push(n.assignTexture(e,"glossinessMap",p)),d.push(n.assignTexture(e,"specularMap",p))}return g.default.all(d)},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===e.map?null:e.map,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,i=0,r=n.length;i<r;i++){var a=e[n[i]];t[n[i]]=a&&a.isColor?a.clone():a}return t},refreshUniforms:function(e,t,n,i,r){if(!0===r.isGLTFSpecularGlossinessMaterial){var a,o=r.uniforms,s=r.defines;o.opacity.value=r.opacity,o.diffuse.value.copy(r.color),o.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),o.map.value=r.map,o.specularMap.value=r.specularMap,o.alphaMap.value=r.alphaMap,o.lightMap.value=r.lightMap,o.lightMapIntensity.value=r.lightMapIntensity,o.aoMap.value=r.aoMap,o.aoMapIntensity.value=r.aoMapIntensity,r.map?a=r.map:r.specularMap?a=r.specularMap:r.displacementMap?a=r.displacementMap:r.normalMap?a=r.normalMap:r.bumpMap?a=r.bumpMap:r.glossinessMap?a=r.glossinessMap:r.alphaMap?a=r.alphaMap:r.emissiveMap&&(a=r.emissiveMap),void 0!==a&&(a.isWebGLRenderTarget&&(a=a.texture),!0===a.matrixAutoUpdate&&a.updateMatrix(),o.uvTransform.value.copy(a.matrix)),r.envMap&&(o.envMap.value=r.envMap,o.envMapIntensity.value=r.envMapIntensity,o.flipEnvMap.value=r.envMap.isCubeTexture?-1:1,o.reflectivity.value=r.reflectivity,o.refractionRatio.value=r.refractionRatio,o.maxMipLevel.value=e.properties.get(r.envMap).__maxMipLevel),o.specular.value.copy(r.specular),o.glossiness.value=r.glossiness,o.glossinessMap.value=r.glossinessMap,o.emissiveMap.value=r.emissiveMap,o.bumpMap.value=r.bumpMap,o.normalMap.value=r.normalMap,o.displacementMap.value=r.displacementMap,o.displacementScale.value=r.displacementScale,o.displacementBias.value=r.displacementBias,null!==o.glossinessMap.value&&void 0===s.USE_GLOSSINESSMAP&&(s.USE_GLOSSINESSMAP="",s.USE_ROUGHNESSMAP=""),null===o.glossinessMap.value&&void 0!==s.USE_GLOSSINESSMAP&&(delete s.USE_GLOSSINESSMAP,delete s.USE_ROUGHNESSMAP)}}}}function A(e,t,n,i){fm.Interpolant.call(this,e,t,n,i)}b.prototype.decodePrimitive=function(e,t){var n=this.json,i=this.dracoLoader,r=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},s={},l={};for(var u in a){var h=R[u]||u.toLowerCase();o[h]=a[u]}for(u in e.attributes)if(h=R[u]||u.toLowerCase(),void 0!==a[u]){var c=n.accessors[e.attributes[u]],d=S[c.componentType];l[h]=d,s[h]=!0===c.normalized}return t.getDependency("bufferView",r).then(function(e){return new g.default(function(r){i.decodeDracoFile(e,function(e){for(var t in e.attributes){var n=e.attributes[t],i=s[t];void 0!==i&&(n.normalized=i)}r(e)},o,l)})})},w.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&&e.repeat.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},A.prototype=(0,s.default)(fm.Interpolant.prototype),A.prototype.constructor=A,A.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i*3+i,a=0;a!==i;a++)t[a]=n[r+a];return t},A.prototype.beforeStart_=A.prototype.copySampleValue_,A.prototype.afterEnd_=A.prototype.copySampleValue_,A.prototype.interpolate_=function(e,t,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=2*o,l=3*o,u=i-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],b=a[p+_+s]*u,w=a[f+_+o],M=a[f+_]*u;r[_]=g*x+y*b+m*w+v*M}return r};var T,E={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},S={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},L={9728:fm.NearestFilter,9729:fm.LinearFilter,9984:fm.NearestMipmapNearestFilter,9985:fm.LinearMipmapNearestFilter,9986:fm.NearestMipmapLinearFilter,9987:fm.LinearMipmapLinearFilter},I={33071:fm.ClampToEdgeWrapping,33648:fm.MirroredRepeatWrapping,10497:fm.RepeatWrapping},k={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},R={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},N={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},P={CUBICSPLINE:void 0,LINEAR:fm.InterpolateLinear,STEP:fm.InterpolateDiscrete},C={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},D={"image/png":fm.RGBAFormat,"image/jpeg":fm.RGBFormat};function O(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}function F(){return T=T||new fm.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:fm.FrontSide}),T}function B(e,t,n){for(var i in n.extensions)void 0===e[i]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[i]=n.extensions[i])}function G(e,t){void 0!==t.extras&&("object"===(0,o.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 i=p[t];if(void 0!==i.POSITION&&(m=!0),void 0!==i.NORMAL&&(v=!0),m&&v)break}if(!m&&!v)return g.default.resolve(f);var r=[],a=[];for(t=0,n=p.length;t<n;t++){if(i=p[t],m){var o=void 0!==i.POSITION?e.getDependency("accessor",i.POSITION):f.attributes.position;r.push(o)}v&&(o=void 0!==i.NORMAL?e.getDependency("accessor",i.NORMAL):f.attributes.normal,a.push(o))}return g.default.all([g.default.all(r),g.default.all(a)]).then(function(e){for(var t=e[0],n=e[1],i=0,r=t.length;i<r;i++)f.attributes.position!==t[i]&&(t[i]=j(t[i]));for(i=0,r=n.length;i<r;i++)f.attributes.normal!==n[i]&&(n[i]=j(n[i]));for(i=0,r=p.length;i<r;i++){var a=p[i],o="morphTarget"+i;if(m&&void 0!==a.POSITION){var s=t[i];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[i];c.name=o;var d=f.attributes.normal;for(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 U(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var n=0,i=t.weights.length;n<i;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&(0,m.default)(t.extras.targetNames)){var r=t.extras.targetNames;if(e.morphTargetInfluences.length===r.length)for(e.morphTargetDictionary={},n=0,i=r.length;n<i;n++)e.morphTargetDictionary[r[n]]=n;else console.warn("fm.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function V(e){var t,n=e.extensions&&e.extensions[v.KHR_DRACO_MESH_COMPRESSION];return t=n?"draco:"+n.bufferView+":"+n.indices+":"+H(n.attributes):e.indices+":"+H(e.attributes)+":"+e.mode,t}function H(e){for(var t="",n=(0,p.default)(e).sort(),i=0,r=n.length;i<r;i++)t+=n[i]+":"+e[n[i]]+";";return t}function j(e){if(e.isInterleavedBufferAttribute){for(var t=e.count,n=e.itemSize,i=e.array.slice(0,t*n),r=0,a=0;r<t;++r)i[a++]=e.getX(r),2<=n&&(i[a++]=e.getY(r)),3<=n&&(i[a++]=e.getZ(r)),4<=n&&(i[a++]=e.getW(r));return new fm.BufferAttribute(i,n,e.normalized)}return e.clone()}function W(e,t,n){this.json=e||{},this.extensions=t||{},this.options=n||{},this.cache=new u,this.primitiveCache={},this.textureLoader=new fm.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new fm.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}function Y(n,e,i){var t=e.attributes,r=[];function a(e,t){return i.getDependency("accessor",e).then(function(e){n.addAttribute(t,e)})}for(var o in t){var s=R[o]||o.toLowerCase();s in n.attributes||r.push(a(t[o],s))}if(void 0!==e.indices&&!n.index){var l=i.getDependency("accessor",e.indices).then(function(e){n.setIndex(e)});r.push(l)}return G(n,e),g.default.all(r).then(function(){return void 0!==e.targets?z(n,e.targets,i):n})}function q(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,i=l.joints.length;n<i;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=[],i=0,r=s.length;i<r;i++){var a=s[i];if(a){t.push(a);var o=new fm.Matrix4;void 0!==l.inverseBindMatrices&&o.fromArray(l.inverseBindMatrices.array,16*i),n.push(o)}else console.warn('fm.GLTFLoader: Joint "%s" could not be found.',l.joints[i])}e.bind(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,i=0,r=n.length;i<r;i++){var a=n[i];t.push(q(a,e,s,u))}return g.default.all(t)})}W.prototype.parse=function(n,e){var i=this,r=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][r.scene||0],scenes:e[0],animations:e[1],cameras:e[2],asset:r.asset,parser:i,userData:{}};B(a,t,r),G(t,r),n(t)}).catch(e)},W.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[],i={},r={},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===i[d.mesh]&&(i[d.mesh]=r[d.mesh]=0),i[d.mesh]++,void 0!==d.skin&&(n[d.mesh].isSkinnedMesh=!0))}this.json.meshReferences=i,this.json.meshUses=r},W.prototype.getDependency=function(e,t){var n=e+":"+t,i=this.cache.get(n);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this.loadNode(t);break;case"mesh":i=this.loadMesh(t);break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this.loadBufferView(t);break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this.loadMaterial(t);break;case"texture":i=this.loadTexture(t);break;case"skin":i=this.loadSkin(t);break;case"animation":i=this.loadAnimation(t);break;case"camera":i=this.loadCamera(t);break;case"light":i=this.extensions[v.KHR_LIGHTS_PUNCTUAL].loadLight(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(n,i)}return i},W.prototype.getDependencies=function(n){var e=this.cache.get(n);if(!e){var i=this,t=this.json[n+("mesh"===n?"es":"s")]||[];e=g.default.all(t.map(function(e,t){return i.getDependency(n,t)})),this.cache.add(n,e)}return e},W.prototype.loadBuffer=function(e){var n=this.json.buffers[e],i=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[v.KHR_BINARY_GLTF].body);var r=this.options;return new g.default(function(e,t){i.load(O(n.uri,r.path),e,void 0,function(){t(new Error('fm.GLTFLoader: Failed to load buffer "'+n.uri+'".'))})})},W.prototype.loadBufferView=function(e){var i=this.json.bufferViews[e];return this.getDependency("buffer",i.buffer).then(function(e){var t=i.byteLength||0,n=i.byteOffset||0;return e.slice(n,n+t)})},W.prototype.loadAccessor=function(e){var M=this,T=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",E.sparse.values.bufferView))),g.default.all(t).then(function(e){var t,n,i=e[0],r=k[E.type],a=S[E.componentType],o=a.BYTES_PER_ELEMENT,s=o*r,l=E.byteOffset||0,u=void 0!==E.bufferView?T.bufferViews[E.bufferView].byteStride:void 0,h=!0===E.normalized;if(u&&u!==s){var c=Math.floor(l/u),d="InterleavedBuffer:"+E.bufferView+":"+E.componentType+":"+c+":"+E.count,f=M.cache.get(d);f||(t=new a(i,c*u,E.count*u/o),f=new fm.InterleavedBuffer(t,u/o),M.cache.add(d,f)),n=new fm.InterleavedBufferAttribute(f,r,l%u/o,h)}else t=null===i?new a(E.count*r):new a(i,l,E.count*r),n=new fm.BufferAttribute(t,r,h);if(void 0!==E.sparse){var p=k.SCALAR,m=S[E.sparse.indices.componentType],v=E.sparse.indices.byteOffset||0,g=E.sparse.values.byteOffset||0,y=new m(e[1],v,E.sparse.count*p),_=new a(e[2],g,E.sparse.count*r);null!==i&&n.setArray(n.array.slice());for(var x=0,b=y.length;x<b;x++){var w=y[x];if(n.setX(w,_[x*r]),2<=r&&n.setY(w,_[x*r+1]),3<=r&&n.setZ(w,_[x*r+2]),4<=r&&n.setW(w,_[x*r+3]),5<=r)throw new Error("fm.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return n})},W.prototype.loadTexture=function(e){var i,t=this,r=this.json,a=this.options,o=this.textureLoader,s=window.URL||window.webkitURL,l=r.textures[e],u=l.extensions||{};i=u[v.MSFT_TEXTURE_DDS]?r.images[u[v.MSFT_TEXTURE_DDS].source]:r.images[l.source];var h=i.uri,c=!1;return void 0!==i.bufferView&&(h=t.getDependency("bufferView",i.bufferView).then(function(e){c=!0;var t=new Blob([e],{type:i.mimeType});return h=s.createObjectURL(t),h})),g.default.resolve(h).then(function(n){var i=fm.Loader.Handlers.get(n);return i=i||(u[v.MSFT_TEXTURE_DDS]?t.extensions[v.MSFT_TEXTURE_DDS].ddsLoader:o),new g.default(function(e,t){i.load(O(n,a.path),e,void 0,t)})}).then(function(e){!0===c&&s.revokeObjectURL(h),e.flipY=!1,void 0!==l.name&&(e.name=l.name),i.mimeType in D&&(e.format=D[i.mimeType]);var t=r.samplers||{},n=t[l.sampler]||{};return e.magFilter=L[n.magFilter]||fm.LinearFilter,e.minFilter=L[n.minFilter]||fm.LinearMipmapLinearFilter,e.wrapS=I[n.wrapS]||fm.RepeatWrapping,e.wrapT=I[n.wrapT]||fm.RepeatWrapping,e})},W.prototype.assignTexture=function(n,i,r){var a=this;return this.getDependency("texture",r.index).then(function(e){if(!e.isCompressedTexture)switch(i){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":e.format=fm.RGBFormat}if(a.extensions[v.KHR_TEXTURE_TRANSFORM]){var t=void 0!==r.extensions?r.extensions[v.KHR_TEXTURE_TRANSFORM]:void 0;t&&(e=a.extensions[v.KHR_TEXTURE_TRANSFORM].extendTexture(e,t))}n[i]=e})},W.prototype.assignFinalMaterial=function(e){var t=e.geometry,n=e.material,i=this.extensions,r=void 0!==t.attributes.tangent,a=void 0!==t.attributes.color,o=void 0===t.attributes.normal,s=!0===e.isSkinnedMesh,l=0<(0,p.default)(t.morphAttributes).length,u=l&&void 0!==t.morphAttributes.normal;if(e.isPoints){var h="PointsMaterial:"+n.uuid,c=this.cache.get(h);c||(c=new fm.PointsMaterial,fm.Material.prototype.copy.call(c,n),c.color.copy(n.color),c.map=n.map,c.lights=!1,this.cache.add(h,c)),n=c}else if(e.isLine){h="LineBasicMaterial:"+n.uuid;var d=this.cache.get(h);d||(d=new fm.LineBasicMaterial,fm.Material.prototype.copy.call(d,n),d.color.copy(n.color),d.lights=!1,this.cache.add(h,d)),n=d}if(r||a||o||s||l){h="ClonedMaterial:"+n.uuid+":",n.isGLTFSpecularGlossinessMaterial&&(h+="specular-glossiness:"),s&&(h+="skinning:"),r&&(h+="vertex-tangents:"),a&&(h+="vertex-colors:"),o&&(h+="flat-shading:"),l&&(h+="morph-targets:"),u&&(h+="morph-normals:");var f=this.cache.get(h);f||(f=n.isGLTFSpecularGlossinessMaterial?i[v.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].cloneMaterial(n):n.clone(),s&&(f.skinning=!0),r&&(f.vertexTangents=!0),a&&(f.vertexColors=fm.VertexColors),o&&(f.flatShading=!0),l&&(f.morphTargets=!0),u&&(f.morphNormals=!0),this.cache.add(h,f)),n=f}n.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.addAttribute("uv2",new fm.BufferAttribute(t.attributes.uv.array,2)),n.isGLTFSpecularGlossinessMaterial&&(e.onBeforeRender=i[v.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].refreshUniforms),e.material=n},W.prototype.loadMaterial=function(e){var t,n=this,i=this.json,r=this.extensions,a=i.materials[e],o={},s=a.extensions||{},l=[];if(s[v.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var u=r[v.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=u.getMaterialType(),l.push(u.extendParams(o,a,n))}else if(s[v.KHR_MATERIALS_UNLIT]){var h=r[v.KHR_MATERIALS_UNLIT];t=h.getMaterialType(),l.push(h.extendParams(o,a,n))}else{t=fm.MeshStandardMaterial;var c=a.pbrMetallicRoughness||{};if(o.color=new fm.Color(1,1,1),o.opacity=1,(0,m.default)(c.baseColorFactor)){var d=c.baseColorFactor;o.color.fromArray(d),o.opacity=d[3]}void 0!==c.baseColorTexture&&l.push(n.assignTexture(o,"map",c.baseColorTexture)),o.metalness=void 0!==c.metallicFactor?c.metallicFactor:1,o.roughness=void 0!==c.roughnessFactor?c.roughnessFactor:1,void 0!==c.metallicRoughnessTexture&&(l.push(n.assignTexture(o,"metalnessMap",c.metallicRoughnessTexture)),l.push(n.assignTexture(o,"roughnessMap",c.metallicRoughnessTexture)))}!0===a.doubleSided&&(o.side=fm.DoubleSide);var f=a.alphaMode||C.OPAQUE;return f===C.BLEND?o.transparent=!0:(o.transparent=!1,f===C.MASK&&(o.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&t!==fm.MeshBasicMaterial&&(l.push(n.assignTexture(o,"normalMap",a.normalTexture)),o.normalScale=new fm.Vector2(1,1),void 0!==a.normalTexture.scale&&o.normalScale.set(a.normalTexture.scale,a.normalTexture.scale)),void 0!==a.occlusionTexture&&t!==fm.MeshBasicMaterial&&(l.push(n.assignTexture(o,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(o.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&t!==fm.MeshBasicMaterial&&(o.emissive=(new fm.Color).fromArray(a.emissiveFactor)),void 0!==a.emissiveTexture&&t!==fm.MeshBasicMaterial&&l.push(n.assignTexture(o,"emissiveMap",a.emissiveTexture)),g.default.all(l).then(function(){var e;return e=t===fm.ShaderMaterial?r[v.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(o):new t(o),void 0!==a.name&&(e.name=a.name),e.map&&(e.map.encoding=fm.sRGBEncoding),e.emissiveMap&&(e.emissiveMap.encoding=fm.sRGBEncoding),e.specularMap&&(e.specularMap.encoding=fm.sRGBEncoding),G(e,a),a.extensions&&B(r,e,a),e})},W.prototype.loadGeometries=function(e){var n=this,i=this.extensions,t=this.primitiveCache;function r(t){return i[v.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(t,n).then(function(e){return Y(e,t,n)})}for(var a=[],o=0,s=e.length;o<s;o++){var l,u=e[o],h=V(u),c=t[h];c?a.push(c.promise):(l=u.extensions&&u.extensions[v.KHR_DRACO_MESH_COMPRESSION]?r(u):Y(new fm.BufferGeometry,u,n),t[h]={primitive:u,promise:l},a.push(l))}return g.default.all(a)},W.prototype.loadMesh=function(h){for(var c=this,e=this.json,d=e.meshes[h],f=d.primitives,t=[],n=0,i=f.length;n<i;n++){var r=void 0===f[n].material?F():this.getDependency("material",f[n].material);t.push(r)}return g.default.all(t).then(function(u){return c.loadGeometries(f).then(function(e){for(var t=[],n=0,i=e.length;n<i;n++){var r,a=e[n],o=f[n],s=u[n];if(o.mode===E.TRIANGLES||o.mode===E.TRIANGLE_STRIP||o.mode===E.TRIANGLE_FAN||void 0===o.mode)r=!0===d.isSkinnedMesh?new fm.SkinnedMesh(a,s):new fm.Mesh(a,s),!0!==r.isSkinnedMesh||r.geometry.attributes.skinWeight.normalized||r.normalizeSkinWeights(),o.mode===E.TRIANGLE_STRIP?r.drawMode=fm.TriangleStripDrawMode:o.mode===E.TRIANGLE_FAN&&(r.drawMode=fm.TriangleFanDrawMode);else if(o.mode===E.LINES)r=new fm.LineSegments(a,s);else if(o.mode===E.LINE_STRIP)r=new fm.Line(a,s);else if(o.mode===E.LINE_LOOP)r=new fm.LineLoop(a,s);else{if(o.mode!==E.POINTS)throw new Error("fm.GLTFLoader: Primitive mode unsupported: "+o.mode);r=new fm.Points(a,s)}0<(0,p.default)(r.geometry.morphAttributes).length&&U(r,d),r.name=d.name||"mesh_"+h,1<e.length&&(r.name+="_"+n),G(r,d),c.assignFinalMaterial(r),t.push(r)}if(1===t.length)return t[0];var l=new fm.Group;for(n=0,i=t.length;n<i;n++)l.add(t[n]);return l})})},W.prototype.loadCamera=function(e){var t,n=this.json.cameras[e],i=n[n.type];if(i)return"perspective"===n.type?t=new fm.PerspectiveCamera(fm.Math.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):"orthographic"===n.type&&(t=new fm.OrthographicCamera(i.xmag/-2,i.xmag/2,i.ymag/2,i.ymag/-2,i.znear,i.zfar)),void 0!==n.name&&(t.name=n.name),G(t,n),g.default.resolve(t);console.warn("fm.GLTFLoader: Missing camera parameters.")},W.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})},W.prototype.loadAnimation=function(E){for(var e=this.json,S=e.animations[E],t=[],n=[],i=[],r=[],a=[],o=0,s=S.channels.length;o<s;o++){var l=S.channels[o],u=S.samplers[l.sampler],h=l.target,c=void 0!==h.node?h.node:h.id,d=void 0!==S.parameters?S.parameters[u.input]:u.input,f=void 0!==S.parameters?S.parameters[u.output]:u.output;t.push(this.getDependency("node",c)),n.push(this.getDependency("accessor",d)),i.push(this.getDependency("accessor",f)),r.push(u),a.push(h)}return g.default.all([g.default.all(t),g.default.all(n),g.default.all(i),g.default.all(r),g.default.all(a)]).then(function(e){for(var t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=[],s=0,l=t.length;s<l;s++){var u=t[s],h=n[s],c=i[s],d=r[s],f=a[s];if(void 0!==u){var p;switch(u.updateMatrix(),u.matrixAutoUpdate=!0,N[f.path]){case N.weights:p=fm.NumberKeyframeTrack;break;case N.rotation:p=fm.QuaternionKeyframeTrack;break;case N.position:case N.scale:default:p=fm.VectorKeyframeTrack}var m=u.name?u.name:u.uuid,v=void 0!==d.interpolation?P[d.interpolation]:fm.InterpolateLinear,g=[];N[f.path]===N.weights?u.traverse(function(e){!0===e.isMesh&&e.morphTargetInfluences&&g.push(e.name?e.name:e.uuid)}):g.push(m);var y=c.array;if(c.normalized){var _;if(y.constructor===Int8Array)_=1/127;else if(y.constructor===Uint8Array)_=1/255;else if(y.constructor==Int16Array)_=1/32767;else{if(y.constructor!==Uint16Array)throw new Error("fm.GLTFLoader: Unsupported output accessor component type.");_=1/65535}for(var x=new Float32Array(y.length),b=0,w=y.length;b<w;b++)x[b]=y[b]*_;y=x}for(b=0,w=g.length;b<w;b++){var M=new p(g[b]+"."+N[f.path],h.array,y,v);"CUBICSPLINE"===d.interpolation&&(M.createInterpolant=function(e){return new A(this.times,this.values,this.getValueSize()/3,e)},M.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),o.push(M)}}}var T=void 0!==S.name?S.name:"animation_"+E;return new fm.AnimationClip(T,void 0,o)})},W.prototype.loadNode=function(e){var t,n=this.json,a=this.extensions,i=this,o=n.meshReferences,s=n.meshUses,l=n.nodes[e];return t=[],void 0!==l.mesh&&t.push(i.getDependency("mesh",l.mesh).then(function(e){var t;if(1<o[l.mesh]){var n=s[l.mesh]++;t=e.clone(),t.name+="_instance_"+n,t.onBeforeRender=e.onBeforeRender;for(var i=0,r=t.children.length;i<r;i++)t.children[i].name+="_instance_"+n,t.children[i].onBeforeRender=e.children[i].onBeforeRender}else t=e;return void 0!==l.weights&&t.traverse(function(e){if(e.isMesh)for(var t=0,n=l.weights.length;t<n;t++)e.morphTargetInfluences[t]=l.weights[t]}),t})),void 0!==l.camera&&t.push(i.getDependency("camera",l.camera)),l.extensions&&l.extensions[v.KHR_LIGHTS_PUNCTUAL]&&void 0!==l.extensions[v.KHR_LIGHTS_PUNCTUAL].light&&t.push(i.getDependency("light",l.extensions[v.KHR_LIGHTS_PUNCTUAL].light)),g.default.all(t).then(function(e){var t;if(t=!0===l.isBone?new fm.Bone:1<e.length?new fm.Group:1===e.length?e[0]:new fm.Object3D,t!==e[0])for(var n=0,i=e.length;n<i;n++)t.add(e[n]);if(void 0!==l.name&&(t.userData.name=l.name,t.name=fm.PropertyBinding.sanitizeNodeName(l.name)),G(t,l),l.extensions&&B(a,t,l),void 0!==l.matrix){var r=new fm.Matrix4;r.fromArray(l.matrix),t.applyMatrix(r)}else void 0!==l.translation&&t.position.fromArray(l.translation),void 0!==l.rotation&&t.quaternion.fromArray(l.rotation),void 0!==l.scale&&t.scale.fromArray(l.scale);return t})},W.prototype.loadScene=function(e){var t=this.json,n=this.extensions,i=this.json.scenes[e],r=this,a=new fm.Scene;void 0!==i.name&&(a.name=i.name),G(a,i),i.extensions&&B(n,a,i);for(var o=i.nodes||[],s=[],l=0,u=o.length;l<u;l++)s.push(q(o[l],a,t,r));return g.default.all(s).then(function(){return a})};var X=l;t.default=X},function(e,t,n){var r=n(35),a=n(60),o=n(26)("species");e.exports=function(e,t){var n,i=r(e).constructor;return void 0===i||null==(n=r(i)[o])?t:a(n)}},function(e,t,n){var i,r,a,o=n(46),s=n(219),l=n(192),u=n(129),h=n(20),c=h.process,d=h.setImmediate,f=h.clearImmediate,p=h.MessageChannel,m=h.Dispatch,v=0,g={},y="onreadystatechange",_=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},x=function(e){_.call(e.data)};d&&f||(d=function(e){for(var t=[],n=1;n<arguments.length;)t.push(arguments[n++]);return g[++v]=function(){s("function"==typeof e?e:Function(e),t)},i(v),v},f=function(e){delete g[e]},"process"==n(92)(c)?i=function(e){c.nextTick(o(_,e,1))}:m&&m.now?i=function(e){m.now(o(_,e,1))}:p?(r=new p,a=r.port2,r.port1.onmessage=x,i=o(a.postMessage,a,1)):h.addEventListener&&"function"==typeof postMessage&&!h.importScripts?(i=function(e){h.postMessage(e+"","*")},h.addEventListener("message",x,!1)):i=y in u("script")?function(e){l.appendChild(u("script"))[y]=function(){l.removeChild(this),_.call(e)}}:function(e){setTimeout(o(_,e,1),0)}),e.exports={set:d,clear:f}},function(e){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(35),a=n(23),o=n(169);e.exports=function(e,t){if(r(e),a(t)&&t.constructor===e)return t;var n=o.f(e),i=n.resolve;return i(t),n.promise}},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),o=i(n(242)),l=i(n(16));n(10);var s,u,h=i(n(2)),c=i(n(3)),d=i(n(7)),f=i(n(8)),p=i(n(9)),m=i(n(13)),v=i(n(37)),g=i(n(38)),y=i(n(80)),_=i(n(59)),x=i(n(30));function b(i){return function(){var e,t=(0,f.default)(i);if(w()){var n=(0,f.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,d.default)(this,e)}}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 M=function(e){(0,p.default)(r,e);var i=b(r);function r(e,t){var n;return(0,h.default)(this,r),n=i.call(this,t.eid,v.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,c.default)(r,[{key:"initMesh",value:function(e,t){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.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=[],i=this._renderNode.geometry.vertices,r=0;r<i.length;r++){var a={};if(a.vertex=i[r],a.distance=Math.abs(Math.sqrt(Math.pow(i[r].x-t.x,2)+Math.pow(i[r].y-t.y,2))),n.length<2)n.push(a);else if(2===n.length){if(n[0].distance>n[1].distance){var o=null;o=n.shift(),n.push(o)}}else if(a.distance<n[1].distance)if(a.distance<n[0].distance){var s=null;n.pop(),s=n.shift(),n.push(a),n.push(s)}else n.pop(),n.push(a)}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)));return e=n[0].distance<u?n[0].distance:u,e}},{key:"setByTheme",value:function(e){if(this._renderNode){var t=this.findParent(g.default),n=t.materialManager.createNormalMaterial(e),i=t.materialManager.createLineMaterial(e);this._lineColor=i.color,this._lineAlpha=i.opacity,this._modelColor=n.color,this._modeAlpha=n.opacity,this._renderNode.material=n,this._line&&(this._line.material=i)}}},{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 i=[],r=n.vertices.length,a=0;a<r;a++)0==a||a==r-1?i.push(n.vertices[a]):i.push(n.vertices[a],n.vertices[a]);n.vertices=i;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=this.findParent(g.default),n=this.parent.parent.parent,i=n.mapcenter,r=e.mapCoord?e.mapCoord:this.mapCoord;if(this._renderNode&&e.image){e=(0,l.default)({size:[5,5],height:.1,angle:0,offset:[0,0]},e),this._card.top&&this.removeStoreImage();var a=new fm.PlaneBufferGeometry(1,1,1,1),o=new fm.MeshLambertMaterial({transparent:!0,depthWrite:!1});t.materialManager.loadTexture(e.image,function(e){e.anisotropy=4,e.minFilter=fm.LinearFilter,o.map=e,o.needsUpdate=!0});var s=new fm.Mesh(a,o);s.scale.set(e.size[0],e.size[1],-1),s.position.set(e.offset[0]+r.x-i.x,e.offset[1]+r.y-i.y,-e.height),s.rotation.z=-e.angle*fm.Math.DEG2RAD,s.renderOrder=10,this._renderNode.add(s),this._card.top=s}}},{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(),this._card.top.material.map&&this._card.top.material.map.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 t=this;if(this._renderNode){this._renderNode.material.userData.color=this._renderNode.material.color;var e=this.findParent(g.default),n=e.map,i=n.modelSelectColor,r={r:i.r/2,g:i.g/2,b:i.b/2,a:i.a/2};s=function(){var e=(Math.sin((new Date).getTime()/180)+1)/2;t._renderNode.material.color=new fm.Color(r.r*(1+e),r.g*(1+e),r.b*(1+e))},n.on("frameLoop",s)}}},{key:"stopFlash",value:function(){this._renderNode&&(map.off("frameLoop",s),this._renderNode.material.color=this._renderNode.material.userData.color)}},{key:"gradientColor",value:function(){var t=this;if(this._renderNode){this._renderNode.material.userData.color=this._renderNode.material.color;var e=this.findParent(g.default),n=e.map,i=n.modelSelectColor;u=new y.default({r:i.r/2,g:i.g/2,b:i.b/2,a:i.a/2},i,500,function(){n.removeAnimater(u),u=void 0},function(e){t._renderNode.material.color=new fm.Color(e.r,e.g,e.b),t._renderNode.material.alpha=e.a,t._renderNode.material.update=!0}).start(),n.addAnimater(u)}}},{key:"clearGradient",value:function(){if(this._renderNode){var e=this.findParent(g.default),t=e.map;u&&t.removeAnimater(u),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=x.default.isInPolygon(e,t);if(n)return 0;for(var i=o.default,r=0;r<t.length-1;r++){var a=x.default.pointDistanceToLine(e,t[r],t[r+1],new fm.Vector2);a<i&&(i=a)}return i}},{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){e?this.parent.scene.children.indexOf(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=this.parent.parent.parent.parent.map.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;return n=1===e?_.default.convertGeo2Points(t.gdata.geo):_.default.convertArrayPoints(t.gdata.idxs,t.gdata.pts),{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}}]),r}(m.default),T=M;t.default=T},function(e,t,n){e.exports=n(433)},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),o=i(n(2)),s=i(n(3)),l=i(n(7)),u=i(n(8)),h=i(n(9)),c=i(n(13)),d=i(n(244));function f(i){return function(){var e,t=(0,u.default)(i);if(p()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}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,h.default)(r,e);var i=f(r);function r(e,t){var n;return(0,o.default)(this,r),n=i.call(this),n._scene=new fm.Scene,n._scene.userData.type="label",n.alias="label",n._labels={},n.initNode(e,t),n.needAvoid=!0,n._visible=!0,n}return(0,s.default)(r,[{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){if(e._renderNode&&(n+=e._renderNode.geometry.attributes.position.array.byteLength,n+=e._renderNode.geometry.attributes.uv.array.byteLength,e._renderNode.material.map)){var t=null;t=e._renderNode.material.map.image.width*e._renderNode.material.map.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 d.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&&this.parent.parent.parent.map.rushRenderNode()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}},{key:"labels",get:function(){return this._labels}}]),r}(c.default),v=m;t.default=v},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6));n(79),n(10);var o=i(n(2)),s=i(n(3)),l=i(n(7)),u=i(n(8)),h=i(n(9)),c=i(n(13)),d=i(n(37)),f=i(n(38)),p=i(n(124)),m=i(n(66)),v=i(n(59));function g(i){return function(){var e,t=(0,u.default)(i);if(y()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}function y(){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 _=function(e){(0,h.default)(r,e);var i=g(r);function r(e,t){var n;return(0,o.default)(this,r),n=i.call(this,t.eid,d.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,s.default)(r,[{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 p.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)}},{key:"setText",value:function(e){if(this._renderNode&&this._theme){var t=this.findParent(f.default);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;if(t=e===m.default.EN?this.bdata.ename:this.bdata.name,!t)return this.visible=!1,void this.dispose();if(this._renderNode)this.setText(t);else if(this.tryInit){var n=this.findParent(f.default),i=this.parent.parent.parent.theme.getLabelTheme(this.bdata.type);this._theme=i;var r=n.materialManager.createLabelMaterial(t,i);this.initSprite(r,this.pos),this.setSize()}this.visible=!0}},{key:"setByTheme",value:function(e){var t=this.findParent(f.default);this._theme=e,this._size=1.4*e.fontsize,this._renderNode&&(this._renderNode.material=t.materialManager.createLabelMaterial(this._text,this._theme)),this.setSize()}},{key:"setSize",value:function(){var e=this.findParent(f.default);e.map.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)}},{key:"mapCoord",get:function(){var e=this.parent.parent.parent.parent.map.dataManager.file_ver,t=this;if(t){if(t.renderNodeInited)return{x:t.x,y:t.y,z:this.height};var n=null;return n=1===e?v.default.convertGeo2Points(t.gdata.geo):v.default.convertArrayPoints(t.gdata.idxs,t.gdata.pts),{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){this._renderNode&&(e?this.parent.scene.children.indexOf(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}},{key:"theme",set:function(e){this._theme=e}}]),r}(c.default),x=_;t.default=x},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),o=i(n(2)),s=i(n(3)),l=i(n(7)),u=i(n(8)),h=i(n(9)),c=i(n(13)),d=i(n(246));function f(i){return function(){var e,t=(0,u.default)(i);if(p()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}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,h.default)(r,e);var i=f(r);function r(e,t){var n;return(0,o.default)(this,r),n=i.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,s.default)(r,[{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 d.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){if(e._renderNode&&(n+=e._renderNode.geometry.attributes.position.array.byteLength,n+=e._renderNode.geometry.attributes.uv.array.byteLength,e._renderNode.material.map)){var t=null;t=e._renderNode.material.map.image.width*e._renderNode.material.map.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&&this.parent.parent.parent.map.setRenderList()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}}]),r}(c.default),v=m;t.default=v},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6));n(10);var o=i(n(2)),s=i(n(3)),l=i(n(7)),u=i(n(8)),h=i(n(9)),c=i(n(13)),d=i(n(37)),f=i(n(38)),p=i(n(124)),m=i(n(59));function v(i){return function(){var e,t=(0,u.default)(i);if(g()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}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,h.default)(r,e);var i=v(r);function r(e,t){var n;return(0,o.default)(this,r),n=i.call(this,t.eid,d.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,s.default)(r,[{key:"checkByFrustum",value:function(e){var t=!0;this._renderNode&&(this._renderNode.updateMatrixWorld(!0),t=e.intersectsObject(this._renderNode)),this.visible=t}},{key:"initSprite",value:function(e,t){this._renderNode=new p.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}},{key:"releaseGpuMemory",value:function(){this.renderNode&&(this.renderNodeInited=!1,this.renderNode.parent.remove(this.renderNode),this.dispose())}},{key:"setByTheme",value:function(e){if(this._renderNode){var t=this.findParent(f.default),n=t.materialManager.createPoiMaterial(e);this._renderNode.material=n}}},{key:"setSize",value:function(){var e=this.findParent(f.default);e.map.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){e?this.parent.scene.children.indexOf(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=e}},{key:"mapCoord",get:function(){var e=this.parent.parent.parent.parent.map.dataManager.file_ver,t=this;if(t){if(t.renderNodeInited)return{x:t.x,y:t.y,z:this.height};var n=null;return n=1===e?m.default.convertGeo2Points(t.gdata.geo):m.default.convertArrayPoints(t.gdata.idxs,t.gdata.pts),{x:n.vertices[0].x,y:n.vertices[0].y,z:this.height}}return{x:null,y:null,z:null}}}]),r}(c.default),_=y,x=_;t.default=x},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var s=i(n(19)),l=i(n(12)),u=i(n(18)),h=i(n(17)),a=i(n(15));n(10),n(5),n(4);var o=i(n(6)),c=i(n(29)),d=i(n(2)),f=i(n(3)),p=i(n(7)),m=i(n(8)),v=i(n(9)),g=i(n(13));function y(e){if(void 0===h.default||null==e[u.default]){if((0,l.default)(e)||(e=_(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}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 i,r,a=!0,o=!1;return{s:function(){i=(0,s.default)(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw r}}}}function _(e,t){if(e){if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function b(i){return function(){var e,t=(0,m.default)(i);if(w()){var n=(0,m.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,p.default)(this,e)}}function w(){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}}var M=function(e){(0,v.default)(n,e);var t=b(n);function n(){var e;return(0,d.default)(this,n),e=t.call(this),e._scene=new fm.Scene,e._scene.userData.type="imageMarker",e.alias="imageMarker",e.imageMarkers=[],e._visible=!0,e.needAvoid=!0,e.prepareInitObjects=[],e}return(0,f.default)(n,[{key:"addMarker",value:function(e){e.parent=this,e.isInitSprite||e.initSprite()?this.pushImageMarker(e):this.prepareInitObjects.push(e)}},{key:"initPrepare",value:function(){var e,t=y(this.prepareInitObjects);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n.initSprite()){var i=this.prepareInitObjects.indexOf(n);-1<i&&this.prepareInitObjects.splice(i,1),this.pushImageMarker(n)}}}catch(e){t.e(e)}finally{t.f()}}},{key:"pushImageMarker",value:function(e){this.imageMarkers.push(e),e.renderNode&&this._scene.add(e.renderNode)}},{key:"removeAll",value:function(){var e,t=y(this.imageMarkers);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.imageMarkers.length=0}},{key:"untiedMarker",value:function(e){e.parent=void 0,this._scene.remove(e.renderNode)}},{key:"removeNode",value:function(e,t){if(e.parent=void 0,this._scene.remove(e.renderNode),e.isAlwaysShow&&(this.parent.removeAlwaysShowMarker(e.renderNode),e.show=!1),e.dispose(),!t){var n=this.imageMarkers.indexOf(e);-1<n&&this.imageMarkers.splice(n,1)}}},{key:"removeMarker",value:function(e){this.removeNode(e)}},{key:"checkSceneNode",value:function(){this._scene.children.length=0;var e,t=y(this.imageMarkers);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:"traverse",value:function(e){var t,n=y(this.imageMarkers);try{for(n.s();!(t=n.n()).done;){var i=t.value;e&&e(i)}}catch(e){n.e(e)}finally{n.f()}}},{key:"dispose",value:function(){var e,t=y(this.imageMarkers);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.imageMarkers.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&&this.parent.parent.parent.map.setRenderList()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}},{key:"markers",get:function(){var e=[];return e.push.apply(e,(0,c.default)(this.imageMarkers)),e}}]),n}(g.default),T=M;t.default=T},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var s=i(n(19)),l=i(n(12)),u=i(n(18)),h=i(n(17)),a=i(n(15));n(10),n(5),n(4);var o=i(n(6)),c=i(n(2)),d=i(n(3)),f=i(n(7)),p=i(n(8)),m=i(n(9)),v=i(n(13));function g(e){if(void 0===h.default||null==e[u.default]){if((0,l.default)(e)||(e=y(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}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 i,r,a=!0,o=!1;return{s:function(){i=(0,s.default)(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw r}}}}function y(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function x(i){return function(){var e,t=(0,p.default)(i);if(b()){var n=(0,p.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,f.default)(this,e)}}function b(){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}}var w=function(e){(0,m.default)(n,e);var t=x(n);function n(){var e;return(0,c.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,d.default)(n,[{key:"addMarker",value:function(e){e.parent=this,e.isInitPolygon||e.initPolygon()?this.pushPolygonMarker(e):this.prepareInitObjects.push(e)}},{key:"traverse",value:function(e){var t,n=g(this.polygonMarkers);try{for(n.s();!(t=n.n()).done;){var i=t.value;e&&e(i)}}catch(e){n.e(e)}finally{n.f()}}},{key:"initPrepare",value:function(){var e,t=g(this.prepareInitObjects);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n.initPolygon()){var i=this.prepareInitObjects.indexOf(n);-1<i&&this.prepareInitObjects.splice(i,1),this.pushPolygonMarker(n)}}}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=g(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){e.parent=void 0,this._scene.remove(e.renderNode),e.dispose();var t=this.polygonMarkers.indexOf(e);-1<t&&this.polygonMarkers.splice(t,1)}},{key:"removeMarker",value:function(e){this.removeNode(e)}},{key:"checkSceneNode",value:function(){this._scene.children.length=0;var e,t=g(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=g(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&&this.parent.parent.parent.map.setRenderList()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}}]),n}(v.default),M=w;t.default=M},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var s=i(n(19)),l=i(n(12)),u=i(n(18)),h=i(n(17)),a=i(n(15));n(10),n(5),n(4);var o=i(n(6)),c=i(n(2)),d=i(n(3)),f=i(n(7)),p=i(n(8)),m=i(n(9)),v=i(n(13));function g(e){if(void 0===h.default||null==e[u.default]){if((0,l.default)(e)||(e=y(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}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 i,r,a=!0,o=!1;return{s:function(){i=(0,s.default)(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw r}}}}function y(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function x(i){return function(){var e,t=(0,p.default)(i);if(b()){var n=(0,p.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,f.default)(this,e)}}function b(){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}}var w=function(e){(0,m.default)(n,e);var t=x(n);function n(){var e;return(0,c.default)(this,n),e=t.call(this),e._scene=new fm.Scene,e._scene.userData.type="textMarker",e.alias="textMarker",e.textMarkers=[],e._visible=!0,e.prepareInitObjects=[],e}return(0,d.default)(n,[{key:"addMarker",value:function(e){e.parent=this,e.isInitSprite||e.initSprite()?this.pushImageMarker(e):this.prepareInitObjects.push(e)}},{key:"traverse",value:function(e){var t,n=g(this.textMarkers);try{for(n.s();!(t=n.n()).done;){var i=t.value;e&&e(i)}}catch(e){n.e(e)}finally{n.f()}}},{key:"initPrepare",value:function(){var e,t=g(this.prepareInitObjects);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n.initSprite()){var i=this.prepareInitObjects.indexOf(n);-1<i&&this.prepareInitObjects.splice(i,1),this.pushImageMarker(n)}}}catch(e){t.e(e)}finally{t.f()}}},{key:"pushImageMarker",value:function(e){this.textMarkers.push(e),e.renderNode&&this._scene.add(e.renderNode)}},{key:"removeAll",value:function(){var e,t=g(this.textMarkers);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.textMarkers.length=0}},{key:"untiedMarker",value:function(e){e.parent=void 0,this._scene.remove(e.renderNode)}},{key:"removeNode",value:function(e,t){if(e.parent=void 0,this._scene.remove(e.renderNode),e.isAlwaysShow&&(this.parent.removeAlwaysShowMarker(e.renderNode),e.show=!1),e.dispose(),!t){var n=this.textMarkers.indexOf(e);-1<n&&this.textMarkers.splice(n,1)}}},{key:"removeMarker",value:function(e){this.removeNode(e)}},{key:"checkSceneNode",value:function(){this._scene.children.length=0;var e,t=g(this.textMarkers);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=g(this.textMarkers);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.textMarkers.length=0,this._scene=void 0}},{key:"markers",get:function(){return this.textMarkers}},{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&&this.parent.parent.parent.map.setRenderList()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}}]),n}(v.default),M=w;t.default=M},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var s=i(n(19)),l=i(n(12)),u=i(n(18)),h=i(n(17)),a=i(n(15));n(10),n(5),n(4);var o=i(n(6)),c=i(n(2)),d=i(n(3)),f=i(n(7)),p=i(n(8)),m=i(n(9)),v=i(n(13)),g=i(n(38)),y=i(n(436));function _(e){if(void 0===h.default||null==e[u.default]){if((0,l.default)(e)||(e=x(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}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 i,r,a=!0,o=!1;return{s:function(){i=(0,s.default)(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw r}}}}function x(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function w(i){return function(){var e,t=(0,p.default)(i);if(M()){var n=(0,p.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,f.default)(this,e)}}function M(){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}}var T=function(e){(0,m.default)(i,e);var n=w(i);function i(e){var t;return(0,c.default)(this,i),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,d.default)(i,[{key:"init",value:function(){var e=this.findParent(g.default);if(e&&this._points){var t=this.parent.parent,n=this.parent.getHeight(),i=t.center,r=e.materialManager,a=r.getHeatMapGradient(this._gradient),o=new y.default({},{},a);o.material.opacity=this._opacity;var s,l=_(this._points);try{for(l.s();!(s=l.n()).done;){var u=s.value,h=o.clone();h.position.set(u.x,i.y+3+n,u.y-i.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(),n.material.map.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(g.default);if(!n)return this._prepareInited=!0,this._randomInited=!1,void(this._randomNum=e);for(var i=this.parent.parent,r=i.bbox,a=r.max.x-r.min.x,o=r.max.y-r.min.y,s=[],l=0;l<e;l++)s.push({x:Math.random()*a+r.min.x,y:Math.random()*o+r.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}}]),i}(v.default),E=T;t.default=E},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(44),n(159),n(53);var a=i(n(2)),o=i(n(3)),s=(i(n(226)),function(){function e(){(0,a.default)(this,e)}return(0,o.default)(e,[{key:"createGeometry",value:function(e,t,n,i){for(var r=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/i)/Math.sqrt(i),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;r[p]=f,r[p+1]=u,r[p+2]=d;var m=s*n*2+2*h;if(a[m]=h/n,a[m+1]=s/t,s<t){var v=void 0,g=void 0,y=void 0,_=void 0,x=s*n*6+6*h;v=s*n+h,g=h+1===n?s*n:v+1,y=v+n,_=g+n,o[x]=v,o[x+1]=g,o[x+2]=y,o[x+3]=g,o[x+4]=_,o[x+5]=y}}return{index:o,uv:a,vertice:r}}},{key:"computerArcLineByPoints",value:function(e,t,n,i,r){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=[];i<a&&(s=(new fm.Vector3).copy(t).add((new fm.Vector3).copy(e).sub(t).normalize().multiplyScalar(i)),u.push(s)),i<o&&(l=(new fm.Vector3).copy(t).add((new fm.Vector3).copy(n).sub(t).normalize().multiplyScalar(i)));for(var h=new fm.QuadraticBezierCurve3(s,t,l),c=0;c<r-1;c++){var d=(c+1)/r,f=h.getPoint(d);u.push(f)}return i<o&&u.push(l),u}}]),e}()),l=s;t.default=l},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var s=i(n(19)),l=i(n(12)),u=i(n(18)),h=i(n(17)),a=i(n(15));n(10),n(5),n(4);var o=i(n(6));n(170);var c=i(n(2)),d=i(n(3)),f=i(n(7)),p=i(n(8)),m=i(n(9)),v=i(n(13)),g=i(n(38));function y(e){if(void 0===h.default||null==e[u.default]){if((0,l.default)(e)||(e=_(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}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 i,r,a=!0,o=!1;return{s:function(){i=(0,s.default)(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw r}}}}function _(e,t){if(e){if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function b(i){return function(){var e,t=(0,p.default)(i);if(w()){var n=(0,p.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,f.default)(this,e)}}function w(){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}}var M=function(e){(0,m.default)(n,e);var t=b(n);function n(){var e;return(0,c.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}return(0,d.default)(n,[{key:"addMarker",value:function(e){e.parent=this,this.domMarkers.push(e);var t=new Date,n=t.getTime(),i=Math.random();e._param.id="domMarker"+n+i,e.initDom(e._param);var r=this.findParent(g.default);r&&r._map.on("update",this._moveMarker.bind(this))}},{key:"_moveMarker",value:function(){var e=this.findParent(g.default);if(e){var t,n=y(this.domMarkers);try{for(n.s();!(t=n.n()).done;){var i=t.value,r=document.getElementById(i._param.id);if(r){var a=null;a=i.height?i.height+this.height:this.height;var o=e._map.coordMapToScreen(i.x,i.y,a);r.style.left=this._anchor(i,o).left,r.style.top=this._anchor(i,o).top}}}catch(e){n.e(e)}finally{n.f()}}}},{key:"_anchor",value:function(e,t){var n=null,i=null;switch(e.anchor){case 9:n=t.x-e.domWidth/2+"px",i=t.y-e.domHeight/2+"px";break;case 5:n=t.x-e.domWidth+"px",i=t.y-e.domHeight+"px";break;case 6:n=t.x+"px",i=t.y-e.domHeight+"px";break;case 7:n=t.x-e.domWidth+"px",i=t.y+"px";break;case 8:n=t.x+"px",i=t.y+"px";break;case 1:n=t.x-e.domWidth+"px",i=t.y-e.domHeight/2+"px";break;case 2:n=t.x+"px",i=t.y-e.domHeight/2+"px";break;case 3:n=t.x-e.domWidth/2+"px",i=t.y-e.domHeight+"px";break;case 4:n=t.x-e.domWidth/2+"px",i=t.y+"px";break;default:n=t.x-e.domWidth/2+"px",i=t.y-e.domHeight/2+"px"}return{left:n,top:i}}},{key:"removeMarker",value:function(e){if(void 0!==e){e.parent=null;var 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}(v.default),T=M;t.default=T},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),o=i(n(2)),s=i(n(3)),l=i(n(7)),u=i(n(8)),h=i(n(9)),c=i(n(13));function d(i){return function(){var e,t=(0,u.default)(i);if(f()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}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)(n,e);var t=d(n);function n(){var e;return(0,o.default)(this,n),e=t.call(this,"dynmodel"),e._scene=new fm.Scene,e._scene.userData.type="dynmodel",e.alias="dynmodel",e._models={},e.prepareInitObjects=[],e._visible=!0,e.initLight(),e.putLight(),e}return(0,s.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 i=this;n.renderNode.traverse(function(e){if(e instanceof fm.Mesh)if(e.material.transparent=!0,n.fadeOut)var t=setInterval(function(){.05<e.material.opacity?e.material.opacity-=.05:(clearInterval(t),i._scene.remove(n.renderNode))},200);else i._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=[];for(var t in this._models)this._models[t].renderNode&&e.push(this._models[t].renderNode);return e}},{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&&this.parent.parent.parent.map.setRenderList()}},{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 i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var r={VERSION:"2.5.0",BUILD:39},a=r;t.default=a},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var s=i(n(19)),l=i(n(12)),u=i(n(18)),h=i(n(17)),a=i(n(15));n(5),n(4);var o=i(n(6));n(34);var c=i(n(77));n(10);var d=i(n(2)),f=i(n(3)),p=i(n(7)),m=i(n(8)),v=i(n(9)),g=i(n(13)),y=i(n(38)),_=i(n(80)),x=i(n(37));function b(e){if(void 0===h.default||null==e[u.default]){if((0,l.default)(e)||(e=w(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}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 i,r,a=!0,o=!1;return{s:function(){i=(0,s.default)(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw r}}}}function w(e,t){if(e){if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(e,t):void 0}}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function T(i){return function(){var e,t=(0,m.default)(i);if(E()){var n=(0,m.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,p.default)(this,e)}}function E(){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}}var S=function(e){(0,v.default)(r,e);var i=T(r);function r(e,t){var n;return(0,d.default)(this,r),n=i.call(this,t.id?t.id:fm.Math.generateUUID(),x.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._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,f.default)(r,[{key:"init",value:function(a,o,s){var l=this;this._loader?(this._height="number"==typeof o.z?o.z:5,this._loader.load(this._url,function(e){l.fadeIn&&l.fadeIn(e.scene),l._gltf=e,l._renderNode=e.scene,l._getMeshes(l._renderNode,l._meshes),l._color&&l.setColor(l._color),l._scale&&l.setScale(l._scale),l._renderNode.scale.z*=-1,l._renderNode.mapNode=l,l._mixer=new fm.AnimationMixer(l._renderNode),a.addAnimationMixer(l._mixer);var t,n=b(e.animations);try{for(n.s();!(t=n.n()).done;){var i=t.value,r=l._mixer.clipAction(i);l._actions[i.name]=r}}catch(e){n.e(e)}finally{n.f()}l.setPosition(o.x,o.y,0,l._height),l.renderNodeInited=!0,l.visible=!0,s&&s(l)})):console.error("外部模型加载器缺失")}},{key:"lookAt",value:function(e){if(this.parent&&this.parent.parent){var t=this._map.center,n=this.parent.parent.height,i=new fm.Vector3(e.x-t.x,n+e.z,-e.y+t.y);this._renderNode.lookAt(i)}else console.warn("请将模型加载进入地图!")}},{key:"setPosition",value:function(e,t,n,i){var r=this._mapCenter;this._height=i,this._x=e,this._y=t,this._renderNode.position.set(this._x-r.x,this._height,r.y-this._y)}},{key:"rotateTo",value:function(t){var n=this,e=this._renderNode.rotation.y,i=t.to%360*fm.Math.DEG2RAD;this.rotateAnimater&&(this.rotateAnimater.stop(),this._map.removeAnimater(this.rotateAnimater));var r=new _.default({angle:e},{angle:i},t.duration?1e3*t.duration:500,function(){n._map.removeAnimater(r),n.rotateAnimater=null,t.callback&&t.callback()},function(e){n._renderNode.rotation.y=e.angle,t.update&&t.update()}).start();this._map.addAnimater(r),this.rotateAnimater=r}},{key:"setRotate",value:function(e){var t=e%360*fm.Math.DEG2RAD;this._renderNode.rotation.y=t}},{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,i=0;i<n.length;i++){var r=n[i];r.material.color.r=t.r,r.material.color.g=t.g,r.material.color.b=t.b}}},{key:"fadeIn",value:function(e){e.traverse(function(e){if(e instanceof fm.Mesh){e.material.transparent=!0,e.material.opacity=0;var t=setInterval(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 i=1<arguments.length&&void 0!==t?arguments[1]:.2,r=2<arguments.length?n:void 0,a=this._actions[e];a&&(r&&(a.clampWhenFinished=!0,a.loop=fm.LoopOnce),a.reset().setEffectiveTimeScale(1).setEffectiveWeight(1).fadeIn(i).play())}},{key:"stopAction",value:function(e,t){var n=1<arguments.length&&void 0!==t?arguments[1]:.2,i=this._actions[e];i&&i.fadeOut(n)}},{key:"getActionList",value:function(){return(0,c.default)(this._actions)}},{key:"moveTo",value:function(t){var n=this;if(!this._isMoving){var e=this.findParent(y.default),i=t.x,r=t.y;t.time||(t.time=.5);var a=new _.default({x:this.x,y:this.y},{x:i,y:r},1e3*t.time,function(){e.map.removeAnimater(a),n._moveAnimater=null,n._isMoving=!1,t.callback&&t.callback()},function(e){n.setPosition(e.x,e.y,0,n._height),t.update&&t.update(e)}).start();this._isMoving=!0,e.map.addAnimater(a),this._moveAnimater=a}}},{key:"stopMoveTo",value:function(){var e=this.findParent(y.default);this._moveAnimater&&this._moveAnimater.stop(),e.map.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 t.sort(function(){return.5-Math.random()}),t[Math.floor(Math.random()*e)]}},{key:"dispose",value:function(){this._renderNode.mapNode=null}},{key:"visible",set:function(e){e?this.parent&&this.parent.scene.children.indexOf(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,this._renderNode.mapNode=this,this.parent.scene.children.indexOf(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("请将模型加载进入地图!")}}]),r}(g.default),A=S;t.default=A},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(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 i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(2)),o=i(n(3)),s=i(n(443)),g=(i(n(164)),i(n(172))),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 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"}],r=1,a=[];for(var o in n){var s=n[o].gid;if(null!=s){var l=n[o].geo[0],u=n[o].biz[0],h=n[o].navi[0],c=new g.default({}),d=c.convertToGroup(s,l,u,h);for(var f in d.naviSegments){var p=d.naviSegments[f],m=new fengmap.FMLineMarker,v=new fengmap.FMSegment;v.groupId=s,v.points=p.geoArr,v.points.forEach(function(e){e.z=r}),m.addSegment(v),e.drawLineMark(m,i[p.entry]),a.push(m)}}}return a}}}}}]),e}();(0,s.default)(l,"getLayerByAlias",function(e,t,n,i){var r=e.getFMGroup(t);if(r&&r.layers){n=[].concat(n);for(var a=[],o=0;o<r.layers.length;o++){var s=r.layers[o];if(s._type_)-1<n.indexOf(s._type_)&&(i&&i(s,s._type_)&&o--,a.push(s));else for(var l=0;l<n.length;l++){var u=n[l];fengmap.Map.layerAlias[u]&&s instanceof fengmap.Map.layerAlias[u]&&(i&&i(s,u)&&o--,a.push(s))}}return 0==a.length?null:1==a.length?a[0]:a}});var u=l;t.default=u},function(e,t,n){"use strict";var i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var r={MODE_2D:"top",MODE_3D:"3d"},a=r;t.default=a},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),s=i(n(16));n(10),n(170);var o=i(n(2)),l=i(n(3)),u=i(n(7)),h=i(n(8)),c=i(n(9)),d=i(n(13)),f=i(n(38)),p=i(n(168)),m=i(n(80)),v=i(n(37)),g=i(n(124)),y=i(n(260)),_=n(81);function x(i){return function(){var e,t=(0,h.default)(i);if(b()){var n=(0,h.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,u.default)(this,e)}}function b(){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,c.default)(i,e);var n=x(i);function i(e){var t;return(0,o.default)(this,i),t=n.call(this,0,v.default.IMAGE_MARKER),t.isInitSprite=!1,t._url=e.url,t._size=e.size,t._height=0,t._offsetHeight=e.height?e.height:0,t._renderNode=null,t._visible=!0,t._opx=e.x||0,t._opy=e.y||0,t._callBack=e.callback,t._moveAnimater=null,t._isMoving=!1,t._depth=e.depth,t._isJumping=!1,t._origonY=0,t.center=t.getCenterByAnchor(e.anchor),t.picLoading=!1,t.needAvoid=!0,t.markername=e.name,t}return(0,l.default)(i,[{key:"initSprite",value:function(){var e=this,t=this.findParent(f.default);if(!t)return!1;var n=!0,i=t.materialManager.createPoiMaterial({imageUrl:this._url,imageSrc:this._url,alpha:1},function(){e._renderNode?(e.picLoading=!1,e._renderNode.layers.set(0),e._renderNode.frustumCulled=!1):n=!1},this._depth,this._priority);i.userData.size=this._size,this._renderNode=new g.default(i),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),t.map.renderer.setImageMarkerSize(this._renderNode),this._renderNode.visible=this.show,this.isInitSprite=!0;var r=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,r,this._offsetHeight),this._callBack&&this._callBack(this),!0}},{key:"setPosition",value:function(e,t,n,i){var r=this.findParent(p.default);if(r){"number"==typeof n&&0<n&&this.moveToGroup(n);var a=r.center,o=r.mapcenter;this._height=i,this._x=e,this._y=t,this._renderNode.position.set(this._x-o.x,a.y+this._height,a.y-this._y+o.y)}else 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 n=this;if(!this._isMoving){var e=this.findParent(f.default),i=t.x,r=t.y,a=null;a=t.height?t.height:this._height;var o=new m.default({x:this.x,y:this.y,height:this._height},{x:i,y:r,height:a},1e3*t.time,function(){e.map.removeAnimater(o),n._moveAnimater=null,n._isMoving=!1,t.callback()},function(e){n.setPosition(e.x,e.y,0,e.height),t.update(e)}).start();this._isMoving=!0,e.map.addAnimater(o),this._moveAnimater=o}}},{key:"moveToGroup",value:function(e){var t=this.findParent(f.default),n=this.parent.parent.groupID;if(n!==e)if(this.parent.parent.parent.groups[""+e]){this._groupId=e;var i=this.parent.parent.parent.groups[""+e].getOrCreateLayer("imageMarker");this.parent.untiedMarker(this),i.addMarker(this),t.map.renderer.setImageMarkerSize(this._renderNode)}else console.warn(_.tileMessage.noGroup)}},{key:"stopMoveTo",value:function(){var e=this.findParent(f.default);this._moveAnimater&&this._moveAnimater.stop(),e.map.removeAnimater(this._moveAnimater),this._isMoving=!1,this._moveAnimater=null}},{key:"jump",value:function(e){var n=this;if(this._renderNode&&!this._isJumping){this._isJumping=!0;var i=(0,s.default)({height:8,times:0,duration:1,delay:0},e);if("number"==typeof i.height&&"number"==typeof i.times&&"number"==typeof i.duration&&"number"==typeof i.delay){i.duration*=1e3,i.delay*=1e3,i.all=i.duration+i.delay,i.halfDuration=i.duration/2;var r=i.height-this._height;this._origonY=this._renderNode.position.y;var a=(new Date).getTime(),t=this.findParent(f.default),o=t.map;this.jumpEvent=function(){if(n._renderNode){var e=(new Date).getTime()-a;if(0!=i.times&&e/i.all>i.times)n.stopJump();else if(e%=i.all,e>i.duration)n._renderNode.position.y!=n._origonY&&(n._renderNode.position.y=n._origonY);else{var t=e/i.halfDuration-1;t=1-t*t,n._renderNode.position.y=n._origonY+r*t}}else o.off("frameLoop",n.jumpEvent)},o.on("frameLoop",this.jumpEvent)}}}},{key:"stopJump",value:function(){if(this._renderNode&&this.jumpEvent){this._renderNode.position.y=this._origonY,this._isJumping=!1;var e=this.findParent(f.default),t=e.map;t.off("frameLoop",this.jumpEvent)}}},{key:"setSize",value:function(){var e=this.findParent(f.default);e.map.renderer.setFacilitySize(this._renderNode,this._size)}},{key:"dispose",value:function(){this.parent&&this.parent.removeMarker(this),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:"getCenterByAnchor",value:function(e){var t=new fm.Vector2(.5,.5);switch(e){case y.default.LEFT:t.setX(0);break;case y.default.RIGHT:t.setX(1);break;case y.default.TOP:t.setY(1);break;case y.default.BOTTOM:t.setY(0);break;case y.default.LEFT_TOP:t.set(0,1);break;case y.default.RIGHT_TOP:t.set(1,1);break;case y.default.LEFT_BOTTOM:t.set(0,0);break;case y.default.RIGHT_BOTTOM:t.set(1,0)}return t}},{key:"url",set:function(e){var t=this.findParent(f.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:"renderNode",get:function(){return this._renderNode}},{key:"visible",set:function(e){e?this.parent.scene.children.indexOf(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},set:function(e){this._size=e}}]),i}(d.default),M=w;t.default=M},function(e,t,n){"use strict";var i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var r={RIGHT:1,LEFT:2,BOTTOM:3,TOP:4,RIGHT_BOTTOM:5,LEFT_BOTTOM:6,RIGHT_TOP:7,LEFT_TOP:8,CENTER:9},a=r;t.default=a},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),o=i(n(2)),s=i(n(3)),l=i(n(7)),u=i(n(8)),h=i(n(9)),c=i(n(13)),d=i(n(452)),f=i(n(37)),p=i(n(80)),m=n(81);function v(i){return function(){var e,t=(0,u.default)(i);if(g()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}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,h.default)(i,e);var n=v(i);function i(e){var t;return(0,o.default)(this,i),t=n.call(this,0,f.default.LOCATION_MARKER),t._size=e.size||20,t._url=e.url,t._groupId=e.groupID||1,t._x=e.x||t._x,t._y=e.y||t._y,t._dheight=e.height||2.1,t._gid=e.groupID||1,t._scene=null,t._renderNode=null,t._map=null,t._callBack=e.callback,t.rotateAnimater=null,t}return(0,s.default)(i,[{key:"initSprite",value:function(e){var t=this,n=new d.default,i=new fm.MeshBasicMaterial,r=!0;e.materialManager.loadTexture(this._url,function(e){e.minFilter=fm.LinearFilter,e.generateMipmaps=!1,e.flipY=!1,i.map=e,i.needsUpdate=!0,t._renderNode?(t.picLoading=!1,t._renderNode.layers.set(0)):r=!1}),i.side=2,i.transparent=!0,this._renderNode=new fm.Mesh(n,i),this._renderNode.mapNode=this,r&&(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,i=this._scene.groups[e.groupID];if(!i)return void console.warn(m.tileMessage.noGroup);n.removeLocation(this),i.addLocation(this),t=i,this.isAlwaysShow&&this.alwaysShow(),this._gid=e.groupID,this._groupId=this._gid}var r=this._scene.mapcenter;this._x=e.x,this._y=e.y,this._renderNode.position.set(this._x-r.x,this._dheight,-this._y+r.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,i=t.to%360*fm.Math.DEG2RAD,r=i,a=0;i-e!=0&&(a=Math.sin(i-e)/Math.abs(Math.sin(i-e))*Math.acos(Math.cos(i-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=r,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 n=this;if(!this._isRuning){var e=t.x,i=t.y,r=new p.default({x:this._x,y:this._y},{x:e,y:i},t.time?1e3*t.time:500,function(){n._map.removeAnimater(r),n._isRuning=!1,t.callback&&t.callback()},function(e){n.setPosition({x:e.x,y:e.y,groupID:0,height:n._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 i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var r={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=r;t.default=a},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(78)),o=i(n(122));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)}},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\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\tdiffuseColor = texture2D( mmap, vUv2 * repeat + offset );\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 i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6));n(53);var o=i(n(2)),s=i(n(3)),l=i(n(7)),u=i(n(8)),h=i(n(9)),c=i(n(265));function d(i){return function(){var e,t=(0,u.default)(i);if(f()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}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)(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),i=0;i<t;i+=3)n[2*i]=e[i],n[2*i+1]=e[i+1],n[2*i+2]=e[i+2],n[2*i+3]=e[i+3],n[2*i+4]=e[i+4],n[2*i+5]=e[i+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),i=0;i<t;i+=3)n[2*i]=e[i],n[2*i+1]=e[i+1],n[2*i+2]=e[i+2],n[2*i+3]=e[i+3],n[2*i+4]=e[i+4],n[2*i+5]=e[i+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 i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),s=i(n(12));n(53);var l=i(n(2)),u=i(n(3)),o=i(n(7)),h=i(n(8)),c=i(n(9));function d(i){return function(){var e,t=(0,h.default)(i);if(f()){var n=(0,h.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,o.default)(this,e)}}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,c.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],i=[0,0,1,0,0,1/3,1,1/3,0,2/3,1,2/3,0,1,1,1],r=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];return e.isLineSegmentsGeometry=!0,e.setIndex(r),e.addAttribute("position",new fm.Float32BufferAttribute(t,3)),e.addAttribute("uv",new fm.Float32BufferAttribute(n,2)),e.addAttribute("uv2",new fm.Float32BufferAttribute(i,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.addAttribute("instanceStart",new fm.InterleavedBufferAttribute(n,3,0)),this.addAttribute("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 i=this.boundingSphere.center;this.boundingBox.getCenter(i);for(var r=0,a=0,o=t.count;a<o;a++)e.fromBufferAttribute(t,a),r=Math.max(r,i.distanceToSquared(e)),e.fromBufferAttribute(n,a),r=Math.max(r,i.distanceToSquared(e));this.boundingSphere.radius=Math.sqrt(r),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 i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(10);var a=i(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.pathPoins,this.bufferRadius},s=o;t.default=s},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var z=i(n(24));n(22),n(5),n(4);var U=i(n(12)),V=i(n(28));n(10);var a=i(n(2)),o=i(n(3)),s=function(){function t(e){(0,a.default)(this,t),this._data=e,this.Graphics=new fengmap.inner.Graphics}return(0,o.default)(t,[{key:"check2",value:function(e,t,n,i,r,a,o){var s,l,u="",h="",c="";n.name&&(u=n.name),n.eName&&(h=n.eName),n.keyword&&(c=n.keyword),n.circle&&(s=n.circle),n.polygon&&(l=2<n.polygon.length?new SearchPolygon(n.polygon,!0):null);var d,f,p=e.name,m=e.ename,v=e.type;d=void 0===n.typeID||!(!n.typeID||!v)&&(f="number"==typeof n.typeID?[n.typeID]:n.typeID,-1<f.indexOf((0,V.default)(v)));var g,y,_=!1;if(m&&h&&-1<m.toLowerCase().indexOf(h.toLowerCase())&&(_=!0),m&&c&&-1<m.toLowerCase().indexOf(c.toLowerCase())&&(_=!0),p&&c&&-1<p.toLowerCase().indexOf(c.toLowerCase())&&(_=!0),p&&u&&-1<p.toLowerCase().indexOf(u.toLowerCase())&&(_=!0),c||h||u||(_=!0),void 0!==n.FID)if(e.fid&&n.FID){var x=n.FID;x=(0,U.default)(x)?x.map(function(e){return e.toString()}):[x.toString()],g=-1<x.indexOf(e.fid.toString())}else g=!1;else g=!0;if(void 0!==n.ID)if(e.eid&&n.ID){var b=n.ID;(0,U.default)(b)?fids=fids.map(function(e){return e.toString()}):b=[b.toString()],y=-1<b.indexOf(e.eid.toString())}else y=!1;else y=!0;var w=_&&d&&g&&y;if(w){if(s){var M=t.geo;"model"===i&&r&&(M=r);var T=M.substring(6,M.length-1).split(" "),E=(0,z.default)(T[0]),S=(0,z.default)(T[1]),A=s.center,L=Math.sqrt((E-A.x)*(E-A.x)+(S-A.y)*(S-A.y));if(L<s.radius)return o&&(o.distance=L),!0;if("model"==i){var I=0,k=null,R=this._map.getFMGroup(a).getNodeByLayerId("model",e.eid);o.target=R,R&&R._data&&(k=R._data.vertices),null==k&&(k=DataManager.convertGeo2Geometry(t.geo).vertices);for(var N=k.length/2,P=0;P<N-1;P++){var C=2*P;if(I=Graphics.pointDistanceToLine(A,{x:k[C],y:k[C+1]},{x:k[C+2],y:k[C+3]},{}),I<s.radius)return o&&(o.distance=L),!0}if(Graphics.pointInPolygonVector2d(k,A,k.length))return o.distance=L,!0}return!1}if(!l)return!0;var D=t.geo;"model"===i&&r&&(D=r);var O=D.substring(6,D.length-1).split(" "),F={x:(0,z.default)(O[0]),y:(0,z.default)(O[1])};if(l.contain(F))return o.distance=l.distanceToPoint(F),!0;if("model"==i){var B=null,G=this._map.getFMGroup(a).getNodeByLayerId("model",e.eid);if(o.target=G,G&&G._data&&(B=G._data.vertices),null==B&&(B=DataManager.convertGeo2Geometry(t.geo).vertices),l.containXYArray(B))return o.distance=l.distanceToPoint(F),!0}}return!1}},{key:"check",value:function(e,t,n,i,r,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;if(void 0!==n.keyword)if(e.name&&e.ename){if(e.name.toLowerCase().indexOf(n.keyword.toLowerCase())<0&&e.ename&&e.ename.toLowerCase().indexOf(n.keyword.toLowerCase())<0)return!1}else if(e.name&&!e.ename){if(e.name.toLowerCase().indexOf(n.keyword.toLowerCase())<0)return!1}else if(!e.name&&e.ename){if(e.ename.toLowerCase().indexOf(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,i=0;i<n;i++)t(e.biz[0].modelLayer[i],e.geo[0].modelLayer[i],"model",e.geo[0].labelLayer[i])}},{key:"everyExternalModel",value:function(e,t){for(var n=e.biz[0].externalModelLayer.length,i=0;i<n;i++)e.gid,t(e.biz[0].externalModelLayer[i],e.geo[0].externalModelLayer[i],"externalModel",e.geo[0].labelLayer[i])}},{key:"everyFacility",value:function(e,t){for(var n=e.biz[0].poiLayer.length,i=0;i<n;i++)t(e.biz[0].poiLayer[i],e.geo[0].poiLayer[i],"poi")}},{key:"everyLabel",value:function(e,t){for(var n=e.biz[0].labelLayer.length,i=0;i<n;i++)t(e.biz[0].labelLayer[i],e.geo[0].labelLayer[i],"label")}}]),t}(),l=s;t.default=l},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(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 i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),o=i(n(2)),s=i(n(7)),l=i(n(8)),u=i(n(9)),h=i(n(268));function c(i){return function(){var e,t=(0,l.default)(i);if(d()){var n=(0,l.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,s.default)(this,e)}}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,u.default)(r,e);var i=c(r);function r(e,t){var n;return(0,o.default)(this,r),n=i.call(this,e),n._map=t,n.Graphics=fengmap.inner.Graphics,n}return r}(h.default),p=f;t.default=p},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.Vector3=d,n(44);var a,o,s,l,u=i(n(16)),h=n(175),c=n(271);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,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this},applyMatrix4:function(e){var t=this.x,n=this.y,i=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*a,this},applyQuaternion:function(e){var t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,o=e.z,s=e.w,l=s*t+a*i-o*n,u=s*n+o*t-r*i,h=s*i+r*n-a*t,c=-r*t-a*n-o*i;return this.x=l*s+c*-r+u*-o-h*-a,this.y=u*s+c*-a+h*-r-l*-o,this.z=h*s+c*-o+l*-a-u*-r,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,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,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,i=e.y,r=e.z,a=t.x,o=t.y,s=t.z;return this.x=i*s-r*o,this.y=r*a-n*s,this.z=n*o-i*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,i=this.z-e.z;return t*t+n*n+i*i},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 i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*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(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,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,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.Quaternion=l;var a=i(n(122)),M=i(n(218)),o=i(n(16)),s=n(175);function l(e,t,n,i){this._x=e||0,this._y=t||0,this._z=n||0,this._w=void 0!==i?i:1}(0,o.default)(l,{slerp:function(e,t,n,i){return n.copy(e).slerp(t,i)},slerpFlat:function(e,t,n,i,r,a,o){var s=n[i+0],l=n[i+1],u=n[i+2],h=n[i+3],c=r[a+0],d=r[a+1],f=r[a+2],p=r[a+3];if(h!==p||s!==c||l!==d||u!==f){var m=1-o,v=s*c+l*d+u*f+h*p,g=0<=v?1:-1,y=1-v*v;if(y>M.default){var _=Math.sqrt(y),x=Math.atan2(_,v*g);m=Math.sin(m*x)/_,o=Math.sin(o*x)/_}var b=o*g;if(s=s*m+c*b,l=l*m+d*b,u=u*m+f*b,h=h*m+p*b,m===1-o){var w=1/Math.sqrt(s*s+l*l+u*u+h*h);s*=w,l*=w,u*=w,h*=w}}e[t]=s,e[t+1]=l,e[t+2]=u,e[t+3]=h}}),(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,i){return this._x=e,this._y=t,this._z=n,this._w=i,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,i=e._y,r=e._z,a=e.order,o=Math.cos,s=Math.sin,l=o(n/2),u=o(i/2),h=o(r/2),c=s(n/2),d=s(i/2),f=s(r/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,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(e){var t,n=e.elements,i=n[0],r=n[4],a=n[8],o=n[1],s=n[5],l=n[9],u=n[2],h=n[6],c=n[10],d=i+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-r)*t):s<i&&c<i?(t=2*Math.sqrt(1+i-s-c),this._w=(h-l)/t,this._x=.25*t,this._y=(r+o)/t,this._z=(a+u)/t):c<s?(t=2*Math.sqrt(1+s-i-c),this._w=(a-u)/t,this._x=(r+o)/t,this._y=.25*t,this._z=(l+h)/t):(t=2*Math.sqrt(1+c-i-s),this._w=(o-r)/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,i=e.dot(t)+1;return i<n?(i=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=i,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 i=Math.min(1,t/n);return this.slerp(e,i),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,i=e._y,r=e._z,a=e._w,o=t._x,s=t._y,l=t._z,u=t._w;return this._x=n*u+a*o+i*l-r*s,this._y=i*u+a*s+r*o-n*l,this._z=r*u+a*l+n*s-i*o,this._w=a*u-n*o-i*s-r*l,this._onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,i=this._y,r=this._z,a=this._w,o=a*e._w+n*e._x+i*e._y+r*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=i,this._z=r,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*i+t*this._y,this._z=l*r+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=i*c+this._y*d,this._z=r*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(127);W.exports=m;var o,i=Y(273);m.ReadableState=p,Y(176).EventEmitter;var _=function(e,t){return e.listeners(t).length},r=Y(274),s=Y(128).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(99));n.inherits=Y(84);var u=Y(480),x=void 0;x=u&&u.debuglog?u.debuglog("stream"):function(){};var h,c=Y(481),d=Y(276);n.inherits(m,r);var f=["error","close","destroy","pause","resume"];function b(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?i(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(68),e=e||{};var n=t instanceof o;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,r=e.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(r||0===r)?r: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&&(h=h||Y(277).StringDecoder,this.decoder=new h(e.encoding),this.encoding=e.encoding)}function m(e){if(o=o||Y(68),!(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)),r.call(this)}function v(e,t,n,i,r){var a,o=e._readableState;return null===t?(o.reading=!1,L(e,o)):(r||(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)),i?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):w(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?w(e,o,t,!1):R(e,o)):w(e,o,t,!1))):i||(o.reading=!1)),T(o)}function w(e,t,n,i){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&I(e)),R(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,i=this._readableState;return i.objectMode?n=!0:"string"==typeof e&&(t=t||i.defaultEncoding,t!==i.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 h=h||Y(277).StringDecoder,this._readableState.decoder=new h(e),this._readableState.encoding=e,this};var E=8388608;function S(e){return E<=e?e=E:(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=S(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function L(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,I(e)}}function I(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(x("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?y.nextTick(k,e):k(e))}function k(e){x("emit readable"),e.emit("readable"),F(e)}function R(e,t){t.readingMore||(t.readingMore=!0,y.nextTick(N,e,t))}function N(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=G(e,t.buffer,t.decoder),n);var n}function G(e,t,n){var i;return e<t.head.data.length?(i=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):i=e===t.head.data.length?t.shift():(n?z:U)(e,t),i}function z(e,t){var n=t.head,i=1,r=n.data;for(e-=r.length;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(o===a.length?r+=a:r+=a.slice(0,e),e-=o,0===e){o===a.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++i}return t.length-=i,r}function U(e,t){var n=s.allocUnsafe(e),i=t.head,r=1;for(i.data.copy(n),e-=i.data.length;i=i.next;){var a=i.data,o=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,o),e-=o,0===e){o===a.length?(++r,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=a.slice(o));break}++r}return t.length-=r,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,i=e.length;n<i;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:I)(this),null;if(e=A(e,t),0===e&&t.ended)return 0===t.length&&V(this),null;var i,r=t.needReadable;return x("need readable",r),(0===t.length||t.length-e<t.highWaterMark)&&(r=!0,x("length less than watermark",r)),t.ended||t.reading?(r=!1,x("reading or ended",r)):r&&(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))),i=0<e?B(e,t):null,null===i?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&V(this)),null!==i&&this.emit("data",i),i},m.prototype._read=function(){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(n,e){var i=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=n;break;case 1:r.pipes=[r.pipes,n];break;default:r.pipes.push(n)}r.pipesCount+=1,x("pipe count=%d opts=%j",r.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===i&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,h())}function s(){x("onend"),n.end()}r.endEmitted?y.nextTick(a):i.once("end",a),n.on("unpipe",o);var l=P(i);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),i.removeListener("end",s),i.removeListener("end",v),i.removeListener("data",d),u=!0,!r.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===r.pipesCount&&r.pipes===n||1<r.pipesCount&&-1!==j(r.pipes,n))&&!u&&(x("false write response, pause",i._readableState.awaitDrain),i._readableState.awaitDrain++,c=!0),i.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"),i.unpipe(n)}return i.on("data",d),b(n,"error",f),n.once("close",p),n.once("finish",m),n.emit("pipe",i),r.flowing||(x("pipe resume"),i.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 i=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<r;a++)i[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.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var i=this._readableState;i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.emittedReadable=!1,i.reading?i.length&&I(this):y.nextTick(C,this))}return n},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 i=this,r=this._readableState,a=!1;for(var e in n.on("end",function(){if(x("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&i.push(e)}i.push(null)}),n.on("data",function(e){if(x("wrapped data"),r.decoder&&(e=r.decoder.write(e)),(!r.objectMode||null!=e)&&(r.objectMode||e&&e.length)){var t=i.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(56),Y(65))},function(e){var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},function(e,t,n){e.exports=n(176).EventEmitter},function(e,ee,te){"use strict";(function(e){var i=te(478),a=te(479),o=te(273);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 r(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 r(e,t,n,i){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,i):"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,i){return l(t),t<=0||void 0===n?s(e,t):"string"==typeof i?s(e,t).fill(n,i):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 i=0|y(t,n);e=s(e,i);var r=e.write(t,n);return r!==i&&(e=e.slice(0,r)),e}function f(e,t){var n=t.length<0?0:0|v(t.length);e=s(e,n);for(var i=0;i<n;i+=1)e[i]=255&t[i];return e}function p(e,t,n,i){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(i||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,n):new Uint8Array(t,n,i),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 i=!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(i)return X(e).length;t=(""+t).toLowerCase(),i=!0}}function _(e,t,n){var i=!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 k(this,t,n);case"ascii":return P(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function x(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function b(e,t,n,i,r){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):2147483647<n?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:w(e,t,n,i,r);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):w(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function w(e,t,n,i,r){var a,o=1,s=e.length,l=t.length;if(void 0!==i&&(i=String(i).toLowerCase(),"ucs2"===i||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,n/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(r){var h=-1;for(a=n;a<s;a++)if(u(e,a)===u(t,-1===h?0:a-h)){if(-1===h&&(h=a),a-h+1===l)return h*o}else-1!==h&&(a-=a-h),h=-1}else for(s<n+l&&(n=s-l),a=n;0<=a;a--){for(var c=!0,d=0;d<l;d++)if(u(e,a+d)!==u(t,d)){c=!1;break}if(c)return a}return-1}function M(e,t,n,i){n=Number(n)||0;var r=e.length-n;i?(i=Number(i),r<i&&(i=r)):i=r;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");a/2<i&&(i=a/2);for(var o=0;o<i;++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,i){return Q(X(t,e.length-n),e,n,i)}function E(e,t,n,i){return Q(Z(t),e,n,i)}function S(e,t,n,i){return E(e,t,n,i)}function A(e,t,n,i){return Q(K(t),e,n,i)}function L(e,t,n,i){return Q(J(t,e.length-n),e,n,i)}function I(e,t,n){return 0===t&&n===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,n))}function k(e,t,n){n=Math.min(e.length,n);for(var i=[],r=t;r<n;){var a,o,s,l,u=e[r],h=null,c=239<u?4:223<u?3:191<u?2:1;if(r+c<=n)switch(c){case 1:u<128&&(h=u);break;case 2:a=e[r+1],128==(192&a)&&(l=(31&u)<<6|63&a,127<l&&(h=l));break;case 3:a=e[r+1],o=e[r+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[r+1],o=e[r+2],s=e[r+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,i.push(h>>>10&1023|55296),h=56320|1023&h),i.push(h),r+=c}return N(i)}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 r(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,i=t.length,r=0,a=Math.min(n,i);r<a;++r)if(e[r]!==t[r]){n=e[r],i=t[r];break}return n<i?-1:i<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);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=c.allocUnsafe(t),r=0;for(n=0;n<e.length;++n){var a=e[n];if(!c.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,r),r+=a.length}return i},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?k(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,i,r){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===i&&(i=0),void 0===r&&(r=this.length),t<0||n>e.length||i<0||r>this.length)throw new RangeError("out of range index");if(r<=i&&n<=t)return 0;if(r<=i)return-1;if(n<=t)return 1;if(t>>>=0,n>>>=0,i>>>=0,r>>>=0,this===e)return 0;for(var a=r-i,o=n-t,s=Math.min(a,o),l=this.slice(i,r),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 b(this,e,t,n,!0)},c.prototype.lastIndexOf=function(e,t,n){return b(this,e,t,n,!1)},c.prototype.write=function(e,t,n,i){if(void 0===t)i="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)i=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===i&&(i="utf8")):(i=n,n=void 0)}var r=this.length-t;if((void 0===n||r<n)&&(n=r),0<e.length&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var a=!1;;)switch(i){case"hex":return M(this,e,t,n);case"utf8":case"utf-8":return T(this,e,t,n);case"ascii":return E(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return A(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;function N(e){var t=e.length;if(t<=R)return String.fromCharCode.apply(String,e);for(var n="",i=0;i<t;)n+=String.fromCharCode.apply(String,e.slice(i,i+=R));return n}function P(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r)i+=String.fromCharCode(127&e[r]);return i}function C(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r)i+=String.fromCharCode(e[r]);return i}function D(e,t,n){var i=e.length;(!t||t<0)&&(t=0),(!n||n<0||i<n)&&(n=i);for(var r="",a=t;a<n;++a)r+=q(e[a]);return r}function O(e,t,n){for(var i=e.slice(t,n),r="",a=0;a<i.length;a+=2)r+=String.fromCharCode(i[a]+256*i[a+1]);return r}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,i,r,a){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r<t||t<a)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}function G(e,t,n,i){t<0&&(t=65535+t+1);for(var r=0,a=Math.min(e.length-n,2);r<a;++r)e[n+r]=(t&255<<8*(i?r:1-r))>>>8*(i?r:1-r)}function z(e,t,n,i){t<0&&(t=4294967295+t+1);for(var r=0,a=Math.min(e.length-n,4);r<a;++r)e[n+r]=t>>>8*(i?r:3-r)&255}function U(e,t,n,i){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function V(e,t,n,i,r){return r||U(e,t,n,4,34028234663852886e22,-34028234663852886e22),a.write(e,t,n,i,23,4),n+4}function H(e,t,n,i,r){return r||U(e,t,n,8,17976931348623157e292,-17976931348623157e292),a.write(e,t,n,i,52,8),n+8}c.prototype.slice=function(e,t){var n,i=this.length;if(e=~~e,t=void 0===t?i:~~t,e<0?(e+=i,e<0&&(e=0)):i<e&&(e=i),t<0?(t+=i,t<0&&(t=0)):i<t&&(t=i),t<e&&(t=e),c.TYPED_ARRAY_SUPPORT)n=this.subarray(e,t),n.__proto__=c.prototype;else{var r=t-e;n=new c(r,void 0);for(var a=0;a<r;++a)n[a]=this[a+e]}return n},c.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||F(e,t,this.length);for(var i=this[e],r=1,a=0;++a<t&&(r*=256);)i+=this[e+a]*r;return i},c.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||F(e,t,this.length);for(var i=this[e+--t],r=1;0<t&&(r*=256);)i+=this[e+--t]*r;return i},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 i=this[e],r=1,a=0;++a<t&&(r*=256);)i+=this[e+a]*r;return r*=128,r<=i&&(i-=Math.pow(2,8*t)),i},c.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||F(e,t,this.length);for(var i=t,r=1,a=this[e+--i];0<i&&(r*=256);)a+=this[e+--i]*r;return r*=128,r<=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,i){if(e=+e,t|=0,n|=0,!i){var r=Math.pow(2,8*n)-1;B(this,e,t,n,r,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,i){if(e=+e,t|=0,n|=0,!i){var r=Math.pow(2,8*n)-1;B(this,e,t,n,r,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):G(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):G(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,i){if(e=+e,t|=0,!i){var r=Math.pow(2,8*n-1);B(this,e,t,n,r-1,-r)}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,i){if(e=+e,t|=0,!i){var r=Math.pow(2,8*n-1);B(this,e,t,n,r-1,-r)}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):G(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):G(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,i){if(n=n||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0<i&&i<n&&(i=n),i===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(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var r,a=i-n;if(this===e&&n<t&&t<i)for(r=a-1;0<=r;--r)e[r+t]=this[r+n];else if(a<1e3||!c.TYPED_ARRAY_SUPPORT)for(r=0;r<a;++r)e[r+t]=this[r+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},c.prototype.fill=function(e,t,n,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),1===e.length){var r=e.charCodeAt(0);r<256&&(e=r)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!c.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}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;var a;if(t>>>=0,n=void 0===n?this.length:n>>>0,e=e||0,"number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var o=c.isBuffer(e)?e:X(new c(e,i).toString()),s=o.length;for(a=0;a<n-t;++a)this[a+t]=o[a%s]}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||1/0;for(var i=e.length,r=null,a=[],o=0;o<i;++o){if(n=e.charCodeAt(o),55295<n&&n<57344){if(!r){if(56319<n){-1<(t-=3)&&a.push(239,191,189);continue}if(o+1===i){-1<(t-=3)&&a.push(239,191,189);continue}r=n;continue}if(n<56320){-1<(t-=3)&&a.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&-1<(t-=3)&&a.push(239,191,189);if(r=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,i,r,a=[],o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),i=n>>8,r=n%256,a.push(r),a.push(i);return a}function K(e){return i.toByteArray(W(e))}function Q(e,t,n,i){for(var r=0;r<i&&!(r+n>=t.length||r>=e.length);++r)t[r+n]=e[r];return r}function $(e){return e!=e}}).call(this,te(56))},function(e,t,n){"use strict";var a=n(127);function i(e,t){var n=this,i=this._readableState&&this._readableState.destroyed,r=this._writableState&&this._writableState.destroyed;return i||r?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 r(){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:i,undestroy:r}},function(e,t,n){"use strict";var i=n(128).Buffer,r=i.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&&(i.isEncoding===r||!r(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=i.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 i=t.length-1;if(i<n)return 0;var r=l(t[i]);return 0<=r?(0<r&&(e.lastNeed=r-1),r):--i<n||-2===r?0:(r=l(t[i]),0<=r?(0<r&&(e.lastNeed=r-2),r):--i<n||-2===r?0:(r=l(t[i]),0<=r?(0<r&&(2===r?r=0:e.lastNeed=r-3),r):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 i=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)}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 i=n.charCodeAt(n.length-1);if(55296<=i&&i<=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 i=n(68),r=Object.create(n(99));function a(e,t){var n=this._transformState;n.transforming=!1;var i=n.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),i(e);var r=this._readableState;r.reading=!1,(r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);i.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)}r.inherits=n(84),r.inherits(o,i),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,i.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 i=this._transformState;if(i.writecb=n,i.writechunk=e,i.writeencoding=t,!i.transforming){var 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;i.prototype._destroy.call(this,e,function(e){t(e),n.emit("close")})}},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(16)),o=i(n(2)),s=i(n(3)),l=i(n(30)),u=(i(n(173)),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 i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(2)),o=i(n(3)),s=i(n(30)),l=i(n(174)),u=function(){function r(e,t,n,i){(0,a.default)(this,r),this.Id=e,this.groupId=t,this._type=n,this.points=i,this.pointCount=i&&i.length?i.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)(r,[{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={},i=0;i<this.pointCount;i++){var r=this.points[i],a=this.points[(i+1)%this.pointCount];if(1==s.default.calcCrossPoint(r,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}}]),r}(),h=u;t.default=h},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.NodeDistance=t.default=void 0,n(180);var a=i(n(29));n(63),n(50),n(4);var c=i(n(24));n(34);var o=i(n(3));n(45);var s=i(n(2)),p=i(n(30)),m=i(n(100)),v=i(n(67)),l=i(n(181)),d=function e(){(0,s.default)(this,e),this.distance=Number.MAX_VALUE,this.node=null};t.NodeDistance=d;var u=function(){function r(e,t,n,i){(0,s.default)(this,r),this.groupId=0,this._type=i,this.nodeVector=e,this.roadVector=t,this.obstructModels=[],this.obstructExtents=[],this.obstructLines=[],this.zones=[],this.zoneIDMap=new l.default,this.vertexLen=[],this.adjList=new l.default,this.nextFloorMap=new l.default,this._needVertex=n,this._roadDiffusion=[],this._nodeMap=new l.default,this._roadMap=new l.default,this._maxNodeId=0,this._maxRoadId=0,this.simplify(),this._init()}return(0,o.default)(r,[{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=Number.MAX_VALUE,n=0;n<this.roadVector.length;n++)if(0!=this.needVertex){var i=this.roadVector[n];1==e?t=i.length:2==e&&(t=i.length*i.roadRank);var r=i.roadEntry;r!=v.default.NaviRoadEntry_BOTH&&r!=v.default.NaviRoadEntry_FORWARD||(this.vertexLen[i.startId][i.endId]=t),r!=v.default.NaviRoadEntry_BOTH&&r!=v.default.NaviRoadEntry_BACK||(this.vertexLen[i.endId][i.startId]=t)}}},{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 i=0;i<t;i++)void 0!==this.vertexLen[n]&&void 0!==this.vertexLen[n][i]&&(this.vertexLen[n][i]=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 i=0;i<this.obstructModels.length;i++){var r=this.obstructExtents[i],a=r.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 i=[],r=0,a=this.nodeVector.length;r<a;r++){var o=this.nodeVector[r],s=o.entranceType;if(s==t||s==v.default.NaviEntranceType_ACCESS){var l=new d;l.node=o,l.distance=p.default.distanceOfTwoPoints(e,o.point),i.push(l)}}return 0==i.length||(i=i.sort(this._nodeDistanceFunc),n=i[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,i=this.nodeVector.length;n<i;n++){var r=this.nodeVector[n],a=r.entranceType;a!=e&&a!=v.default.NaviEntranceType_ACCESS||t.push(r.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 i=null,r=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(i=this.roadVector[l],r=i.roadEntry,i.startId==n[s]&&(r==v.default.NaviRoadEntry_BOTH||r==v.default.NaviRoadEntry_FORWARD)){if(i.endId==t.Id)return!0;n.push(i.endId),this._roadDiffusion[l]=!0}if(i.endId==n[s]&&(r==v.default.NaviRoadEntry_BOTH||r==v.default.NaviRoadEntry_BACK)){if(i.startId==t.Id)return!0;n.push(i.startId),this._roadDiffusion[l]=!0}}}return!1}},{key:"querySameExtentLiftNodesByGeoPoint",value:function(e,t,n,i){if(this.nodeVector.length<=0||this.roadVector.length<=0)return[];var r=this.queryContainExtentId(e);if(0==r)return!1;for(var a=[],o=0;o<this.nodeVector.length;o++){var s=this.nodeVector[o],l=this.queryContainExtentId(s.point);if(s.contansFloor(t)&&(l==r||0==r)){var u=new d;u.node=s,u.distance=p.default.distanceOfTwoPoints(e,s.point),u.distance=(0,c.default)(u.distance).toFixed(4),a.push(u)}}if(!a||0==a.length)return[];a=a.sort(this._nodeDistanceFunc);for(var h=0;h<a.length;h++)n[h]=new m.default,n[h].setNode(a[h].node),i[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 i=this.nodeVector[n];if(i.nodeType==v.default.NaviNodeType_FLOOR){var r=i.liftFlag;if(r==e)return t.setNode(i),!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 i=this.nodeVector[n];i.liftType==e&&(t[n]=i)}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 i=this.obstructExtents[t];if(i.contain(e))return i.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,i){var r=Number.MAX_VALUE,a={};if(new m.default,this.nodeVector.length<=0||this.roadVector.length<=0)return!1;var o,s=this.queryContainExtentId(e);if(0==s)return!1;for(var l=0,u=this.roadVector.length;l<u;l++){var h=this.roadVector[l];if(h&&s==this.queryContainExtentId(h.startPoint)){var c=p.default.pointDistanceToLine(e,h.startPoint,h.endPoint,a);this.isLineObstruct(a,e)||c<r&&(r=c,t.setRoad(h),i.x=a.x,i.y=a.y)}}if(!t||t.roadEntry==v.default.NaviRoadEntry_FORBID)return!1;o=t.roadEntry==v.default.NaviRoadEntry_BACK||t.roadEntry!=v.default.NaviRoadEntry_FORWARD&&p.default.distanceOfTwoPoints(t.startPoint,i)<=p.default.distanceOfTwoPoints(t.endPoint,i)?t.startId:t.endId;for(var d=0;d<this.nodeVector.length;d++){var f=this.nodeVector[d];if(f.Id==o){n.setNode(f);break}}return!0}},{key:"queryNearestSameExtentElementByGeoPointProcessForbid",value:function(e,t,n,i){var r=Number.MAX_VALUE,a={};if(new m.default,this.nodeVector.length<=0||this.roadVector.length<=0)return!1;var o,s=this.queryContainExtentId(e);if(0==s)return!1;for(var l=0;l<this.roadVector.length;l++){var u=this.roadVector[l];if(v.default.NaviRoadEntry_BOTH==u.roadEntry&&(s==this.queryContainExtentId(u.startPoint)||0==s)){var h=p.default.pointDistanceToLine(e,u.startPoint,u.endPoint,a);this.isLineObstruct(a,e)||h<r&&(r=h,t.setRoad(u),i.x=a.x,i.y=a.y)}}if(-1==t.Id)return!1;o=p.default.distanceOfTwoPoints(t.startPoint,i)<=p.default.distanceOfTwoPoints(t.endPoint,i)?t.startId:t.endId;for(var c=0;c<this.nodeVector.length;c++){var d=this.nodeVector[c];if(d.Id==o){n.setNode(d);break}}return-1!=n.Id}},{key:"simplify",value:function(){this._maxNodeId=0,this._maxRoadId=0;for(var e=0;e<this.roadVector.length;)null==this.roadVector[e]?this.roadVector.splice(e,1):(this.roadVector[e].Id>this._maxRoadId&&(this._maxRoadId=this.roadVector[e].Id),e++);for(var t=0;t<this.nodeVector.length;)null==this.nodeVector[t]?this.nodeVector.splice(t,1):(this.nodeVector[t].Id>this._maxNodeId&&(this._maxNodeId=this.nodeVector[t].Id),t++)}},{key:"consoleAdjList",value:function(e){if(e){var t=this.adjList,n=(this.nodeVector,this),i=(naviMap.size(),"********* ADJLIST ************\n");for(var r in t.keys)for(var a=t.keys[r],o=a,s=t.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),n.nodeVector[c]),f=n.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,a.default)(this.nodeVector)),t.sort(function(e,t){return e.Id-t.Id});for(var n=0;n<t.length;n++)for(var i=t[n],r=(i.Id,0);r<i.segLinks.length;r++)i.segLinks[r]}}},{key:"consoleNodePres",value:function(e){if(e)for(var t=0;t<this.nodeVector.length;t++)for(var n=this.nodeVector[t],i=(n.Id,0);i<n._vPre.length;i++)n._vPre[i]}},{key:"consoleRoadInfos",value:function(e){if(e){var t=[];t.push.apply(t,(0,a.default)(this.roadVector)),t.sort(function(e,t){return e.Id-t.Id});for(var n=0;n<t.length;n++){var i=t[n];i.Id,i.startId,i.endId}}}},{key:"consoleAdjInfos",value:function(e){e&&(this.adjList.sort(),this.adjList.each(function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.nodeId,i.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,i=0;i<this.obstructExtents.length;++i){var r=this.obstructExtents[i],a=r.contain(e);a&&r.area<t&&(t=cur_area,n=r)}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,i=0;i<this.obstructModels.length;++i){var r=this.obstructModels[i],a=r.contain(e);a&&r.area<t&&(t=r.area,n=r)}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 i=this;this._nodeMap.each(function(e,t){var n=i.nodeVector[t];n._vPre=[]})}},{key:"makeUpAdjList",value:function(){var s=this;this.adjList.clear();for(var e=function(e){var t=s.roadVector[e];if(null==t)return"continue";var n=t.roadEntry;if(v.default.NaviRoadEntry_BOTH==n||v.default.NaviRoadEntry_FORWARD==n){var i=t.startId,r=s.adjList.get(i);r||(r=[],s.adjList.put(i,r)),l=r.find(function(e){return e.nodeId==t.endId}),null==l&&r.push({nodeId:t.endId,length:t.length})}if(v.default.NaviRoadEntry_BOTH==n||v.default.NaviRoadEntry_BACK==n){var a=t.endId,o=s.adjList.get(a);o||(o=[],s.adjList.put(a,o)),l=o.find(function(e){return e.nodeId==t.startId}),null==l&&o.push({nodeId:t.startId,length:t.length})}},t=0;t<this.roadVector.length;t++){var l;e(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)}}]),r}(),h=u;t.default=h},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(34),n(45);var a=i(n(2)),o=i(n(3)),s=i(n(82)),l=i(n(83)),u=function(){function t(e){(0,a.default)(this,t),this._naviGraph=e,this._startNode=null,this._endNode=null,this._startNodeID=-1,this._endNodeID=-1,this._mode=s.default.MODULE_SHORTEST,this._naviGraph.createNodeMap(),this._naviGraph.createRoadMap(),this._naviGraph.makeUpAdjList(),this._kEPSILON_VALUE=5e-4}return(0,o.default)(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 i=this._naviGraph.getIndexByNodeID(this._startNodeID);if(-1==i)return l.default.ROUTE_FAILED_CANNOT_CALCULATE;var r=this._naviGraph.getIndexByNodeID(t.Id);if(-1==r)return l.default.ROUTE_FAILED_CANNOT_CALCULATE;var a=[];a.push(r);var o=this._dijkstraAssist_1vN(this._naviGraph,i,a);return this._naviGraph.consoleNodePres(),o?l.default.ROUTE_SUCCESS:l.default.ROUTE_FAILED_CANNOT_ARRIVE}},{key:"getRouteCalculateResult",value:function(){var e=[],t=this._naviGraph.getIndexByNodeID(this._endNodeID),n=[];n.push(t);var i=[],r=[];return this._multiPathNodeVector(n,this._naviGraph.nodeVector,i,r),e.push.apply(e,i),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){if(null==e)return!1;var i=e.nodeVector.length;if(t<0||i<=t)return!1;this._removeArrayAll(n,t);for(var r=0;r<i;++r)e.nodeVector[r]._dist=Number.MAX_VALUE,e.nodeVector[r]._visited=!1,e.nodeVector[r]._vPre=[];e.nodeVector[t]._dist=0;var a=n.length,o=0,s=[];s.push(e.nodeVector[t]);for(var l=this._nodeDistCompareFunc.bind(this);0<s.length;){var u=s[0].Id;s.splice(0,1);var h=e.getIndexByNodeID(u);if(null!=h){var c=e.nodeVector[h];if(!c._visited){c._visited=!0;var d=n.indexOf(h);if(-1!=d&&(++o,o==a))return!0;if(0!=e.adjList.size()){var f=e.adjList.get(u);if(f)for(var p=0;p<f.length;p++){var m=f[p],v=m.nodeId,g=e.getIndexByNodeID(v);if(null!=g){var y=m.length,_=e.nodeVector[g];_._visited||(_._dist>y+c._dist?(_._dist=y+c._dist,_._vPre=[],_._vPre.push(h),s.push(e.nodeVector[g]),s.sort(l)):Math.abs(_._dist-(y+c._dist))<1e-12&&-1!=_._vPre.indexOf(h)&&_._vPre.push(h))}}}}}}return!(o<a)}},{key:"_nodeDistCompareFunc",value:function(e,t){return e._dist-(t._dist+this._kEPSILON_VALUE)}},{key:"_removeArrayAll",value:function(e,t){for(var n=e.indexOf(t);-1!=n;)e.splice(n,1),n=e.indexOf(t)}},{key:"_switchToMode",value:function(e){this._mode!=e&&(s.default.MODULE_SHORTEST==e?this._naviGraph.roadVector.forEach(function(e){e.length=e.length/e.roadRank}):s.default.MODULE_BEST==e&&this._naviGraph.roadVector.forEach(function(e){e.length=e.length*e.roadRank}),this._mode=e)}},{key:"_pathNodeVector",value:function(e,t,n,i){if(0!=t[e]._vPre.length){var r=t[e]._vPre[0];n.push(t[r]),i.count++,this._pathNodeVector(r,t,n,i)}}},{key:"_multiPathNodeVector",value:function(e,t,n,i){for(var r=0;r<e.length;r++){var a=e[r];n.push(t[a]);var o={count:1};this._pathNodeVector(a,t,n,o),i.push(o.count)}}}]),t}(),h=u;t.default=h},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(286),n(375),n(377),n(378);var a=i(n(164)),o=i(n(257)),s=i(n(232)),l=i(n(96)),u=i(n(446)),h=i(n(97)),c=i(n(447)),d=i(n(448)),f=i(n(449)),p=i(n(37)),m=i(n(259)),v=i(n(247)),g=i(n(243)),y=i(n(245)),_=i(n(450)),x=i(n(451)),b=i(n(261)),w=i(n(262)),M=i(n(125)),T=i(n(126)),E=i(n(455)),S=i(n(248)),A=i(n(255)),L=i(n(253)),I=i(n(250)),k=i(n(249)),R=i(n(252)),N=i(n(456)),P=i(n(457)),C=i(n(458)),D=i(n(266)),O=i(n(82)),F=i(n(467)),B=i(n(98)),G=i(n(258)),z=i(n(66)),U=i(n(223)),V=i(n(83)),H=i(n(173)),j=i(n(244)),W=i(n(241)),Y=i(n(246)),q=i(n(233)),X=i(n(234)),Z=i(n(13)),J=i(n(468)),K=i(n(256)),Q=i(n(469)),$=i(n(254)),ee=i(n(260)),te=i(n(229)),ne=i(n(30)),ie=i(n(171)),re=i(n(59)),ae=i(n(32)),oe=i(n(125)),se=i(n(67)),le=i(n(172)),ue=i(n(174)),he=n(270),ce=n(175),de=n(470),fe=n(271),pe=i(n(471)),me=i(n(492));n(500);var ve={VERSION:$.default.VERSION,BUILD:$.default.BUILD,Map:a.default,FMMap:a.default,MapUtil:o.default,controlOptions:l.default,FMControlOptions:l.default,zoomControl:u.default,FMZoomControl:u.default,controlPositon:h.default,FMControlPosition:h.default,scrollGroupsControl:c.default,FMScrollGroupsControl:c.default,buttonGroupsControl:d.default,FMButtonGroupsControl:d.default,FMViewMode:G.default,FMDynamicModel:A.default,FMDynamicModelLayer:L.default,FMLanguageType:z.default,toolControl:f.default,FMToolControl:f.default,FMNodeType:p.default,FMImageMarker:m.default,FMPopInfoWindow:_.default,FMTextMarker:x.default,FMLocationMarker:b.default,FMLineMarker:M.default,FMExtentLayer:s.default,FMSegment:T.default,FMPolygonMarker:E.default,FMPolygonMarkerLayer:S.default,FMImageMarkerLayer:v.default,FMLabelLayer:g.default,FMFacilityLayer:y.default,FMHeatMapLayer:I.default,FMHeatMap:P.default,FMSearchRequest:D.default,FMSearchAnalyser:C.default,FMLineType:w.default,FMNaviModule:O.default,FMNaviMode:O.default,FMTextAlign:F.default,FMNaviPriority:B.default,FMRouteCalcuResult:V.default,FMMapCoord:H.default,FMGroup:X.default,FMLabel:j.default,FMStoreModel:W.default,FMElement:q.default,FMExternalModel:q.default,FMFacility:Y.default,FMNode:Z.default,FMDirection:U.default,FMScreenCoord:J.default,FMMapGestureEnableController:K.default,FMTextMarkerLayer:k.default,FMDomMarkerLayer:R.default,FMDomMarker:N.default,FMMapCoordTransformer:Q.default,MapCoordTransform:Q.default,FMMarkerAnchor:ee.default,FMRenderer:te.default,inner:{Graphics:ne.default,FMSegment:T.default,FMNaviMode:O.default,FMNaviPriority:B.default,FMRouteCalcuResult:V.default,EventDispatcher:ie.default,DataManager:re.default,FMUtil:ae.default,FMImageMarker:m.default,FMLineMarker:oe.default,FMLocationMarker:b.default,FMLanguageType:z.default,NaviDataType:se.default,NaviService:le.default,FMMapCoord:H.default,BoundingBox:ue.default}};window.fm=fm,window.fengmap=ve,window.Geo=window.Geo||{Vector3:he.Vector3,_Math:ce._Math,Matrix4:de.Matrix4,Quaternion:fe.Quaternion};var ge={FMNaviAnalyser:me.default,FMNaviMode:O.default,FMNaviPriority:B.default};for(var ye in ge)ge.hasOwnProperty(ye)&&(ve[ye]=ge[ye]);var _e={FMNavigation:pe.default};for(var ye in _e)_e.hasOwnProperty(ye)&&(ve[ye]=_e[ye]);var xe=ve;t.default=xe},function(e,t,n){n(285);var i=n(11).Object;e.exports=function(e,t,n){return i.defineProperty(e,t,n)}},function(e,t,n){var i=n(14);i(i.S+i.F*!n(36),"Object",{defineProperty:n(39).f})},function(t,e,n){(function(e){t.exports=e.fm=n(287)}).call(this,n(56))},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.AmbientLight=lp,t.AmbientLightProbe=nm,t.AnimationClip=uf,t.AnimationLoader=gf,t.AnimationMixer=$m,t.AnimationObjectGroup=Km,t.ArcCurve=Ef,t.ArrayCamera=vh,t.ArrowHelper=Lv,t.Audio=om,t.AudioAnalyser=lm,t.AudioListener=am,t.AudioLoader=Qp,t.AxesHelper=Iv,t.AxisHelper=ng,t.BinaryTextureLoader=sg,t.Bone=sc,t.BooleanKeyframeTrack=tf,t.BoundingBoxHelper=ig,t.Box2=sv,t.Box3=vr,t.Box3Helper=Sv,t.BoxBufferGeometry=Oa,t.CubeGeometry=t.BoxGeometry=Da,t.BoxHelper=Ev,t.BufferAttribute=Cr,t.BufferGeometry=wa,t.BufferGeometryLoader=pp,t.Camera=Ha,t.CameraHelper=Mv,t.CanvasRenderer=ug,t.CanvasTexture=vc,t.CatmullRomCurve3=Rf,t.CircleBufferGeometry=Od,t.CircleGeometry=Dd,t.Clock=rm,t.ClosedSplineCurve3=$v,t.Color=Sr,t.ColorKeyframeTrack=nf,t.CompressedTexture=mc,t.CompressedTextureLoader=yf,t.ConeBufferGeometry=Cd,t.ConeGeometry=Pd,t.CubeCamera=to,t.CubeTexture=Ol,t.CubeTextureLoader=bf,t.CubicBezierCurve=Vf,t.CubicBezierCurve3=Hf,t.CubicInterpolant=Kd,t.Curve=Mf,t.CurvePath=Jf,t.CylinderBufferGeometry=Nd,t.CylinderGeometry=Rd,t.Cylindrical=ov,t.DataTexture=io,t.DataTexture2DArray=Fl,t.DataTexture3D=Bl,t.DataTextureLoader=_f,t.DepthTexture=gc,t.DirectionalLight=sp,t.DirectionalLightHelper=wv,t.DirectionalLightShadow=op,t.DiscreteInterpolant=$d,t.DodecahedronBufferGeometry=kc,t.DodecahedronGeometry=Ic,t.DynamicBufferAttribute=Hv,t.EdgesGeometry=kd,t.EdgesHelper=rg,t.EllipseCurve=Tf,t.Euler=$n,t.EventDispatcher=h,t.ExtrudeBufferGeometry=vd,t.ExtrudeGeometry=md,t.Face3=kr,t.Face4=kv,t.FaceNormalsHelper=bv,t.FileLoader=vf,t.Float32Attribute=Kv,t.Float32BufferAttribute=Vr,t.Float64Attribute=Qv,t.Float64BufferAttribute=Hr,t.Fog=Qh,t.FogExp2=Kh,t.Font=Ap,t.FontLoader=kp,t.Frustum=ao,t.Geometry=Ca,t.GridHelper=yv,t.Group=mh,t.HemisphereLight=ep,t.HemisphereLightHelper=vv,t.HemisphereLightProbe=tm,t.IcosahedronBufferGeometry=Lc,t.IcosahedronGeometry=Ac,t.ImageBitmapLoader=Ep,t.ImageLoader=xf,t.ImmediateRenderObject=uv,t.InstancedBufferAttribute=fp,t.InstancedBufferGeometry=dp,t.InstancedInterleavedBuffer=tv,t.Int16Attribute=qv,t.Int16BufferAttribute=Br,t.Int32Attribute=Zv,t.Int32BufferAttribute=zr,t.Int8Attribute=jv,t.Int8BufferAttribute=Dr,t.InterleavedBuffer=$h,t.InterleavedBufferAttribute=ec,t.Interpolant=Jd,t.JSONLoader=hg,t.KeyframeTrack=ef,t.LOD=rc,t.LatheBufferGeometry=Sd,t.LatheGeometry=Ed,t.Layers=ei,t.LensFlare=dg,t.Light=$f,t.LightProbe=em,t.LightProbeHelper=gv,t.LightShadow=tp,t.Line=uc,t.Line3=lv,t.LineBasicMaterial=lc,t.LineCurve=jf,t.LineCurve3=Wf,t.LineDashedMaterial=qd,t.LineLoop=cc,t.LineSegments=hc,t.LinearInterpolant=Qd,t.Loader=Rp,t.LoadingManager=ff,t.Material=Nr,t.MaterialLoader=hp,t.Matrix3=Cn,t.Matrix4=Qn,t.Mesh=Ma,t.MeshBasicMaterial=Pr,t.MeshDepthMaterial=uh,t.MeshDistanceMaterial=hh,t.MeshFaceMaterial=Cv,t.MeshLambertMaterial=Wd,t.MeshMatcapMaterial=Yd,t.MeshNormalMaterial=jd,t.MeshPhongMaterial=Vd,t.MeshPhysicalMaterial=Ud,t.MeshStandardMaterial=zd,t.MeshToonMaterial=Hd,t.MultiMaterial=Dv,t.NumberKeyframeTrack=rf,t.Object3D=pr,t.ObjectLoader=vp,t.OctahedronBufferGeometry=Sc,t.OctahedronGeometry=Ec,t.OrthographicCamera=ap,t.ParametricBufferGeometry=xc,t.ParametricGeometry=_c,t.Particle=Fv,t.ParticleBasicMaterial=zv,t.ParticleSystem=Bv,t.ParticleSystemMaterial=Uv,t.Path=Kf,t.PerspectiveCamera=ja,t.Plane=ro,t.PlaneBufferGeometry=Tl,t.PlaneGeometry=Ml,t.PlaneHelper=Av,t.PointCloud=Ov,t.PointCloudMaterial=Gv,t.PointLight=rp,t.PointLightHelper=pv,t.Points=fc,t.PointsMaterial=dc,t.PolarGridHelper=_v,t.PolyhedronBufferGeometry=wc,t.PolyhedronGeometry=bc,t.PositionalAudio=sm,t.PositionalAudioHelper=xv,t.PropertyBinding=Jm,t.PropertyMixer=um,t.QuadraticBezierCurve=Yf,t.QuadraticBezierCurve3=qf,t.Quaternion=Nn,t.QuaternionKeyframeTrack=of,t.QuaternionLinearInterpolant=af,t.RawShaderMaterial=Gd,t.Ray=xr,t.Raycaster=nv,t.RectAreaLight=up,t.RectAreaLightHelper=mv,t.RingBufferGeometry=Td,t.RingGeometry=Md,t.Scene=mr,t.ShaderMaterial=Va,t.ShadowMaterial=Bd,t.Shape=Qf,t.ShapeBufferGeometry=Ld,t.ShapeGeometry=Ad,t.ShapePath=Sp,t.Skeleton=oc,t.SkeletonHelper=fv,t.SkinnedMesh=ac,t.Sphere=_r,t.SphereBufferGeometry=wd,t.SphereGeometry=bd,t.Spherical=av,t.SphericalHarmonics3=$p,t.Spline=tg,t.SplineCurve=Xf,t.SplineCurve3=eg,t.SpotLight=ip,t.SpotLightHelper=cv,t.SpotLightShadow=np,t.Sprite=nc,t.SpriteMaterial=tc,t.StereoCamera=im,t.StringKeyframeTrack=sf,t.TetrahedronBufferGeometry=Tc,t.TetrahedronGeometry=Mc,t.TextBufferGeometry=xd,t.TextGeometry=_d,t.Texture=Xn,t.TextureLoader=wf,t.TorusBufferGeometry=Oc,t.TorusGeometry=Dc,t.TorusKnotBufferGeometry=Cc,t.TorusKnotGeometry=Pc,t.Triangle=br,t.TubeBufferGeometry=Nc,t.TubeGeometry=Rc,t.Uint16Attribute=Xv,t.Uint16BufferAttribute=Gr,t.Uint32Attribute=Jv,t.Uint32BufferAttribute=Ur,t.Uint8Attribute=Wv,t.Uint8BufferAttribute=Or,t.Uint8ClampedAttribute=Yv,t.Uint8ClampedBufferAttribute=Fr,t.Uniform=ev,t.Vector2=Rn,t.Vector3=Pn,t.Vector4=Zn,t.VectorKeyframeTrack=lf,t.Vertex=Vv,t.VertexNormalsHelper=hv,t.VideoTexture=pc,t.WebGLMultisampleRenderTarget=Kn,t.WebGLRenderTarget=Jn,t.WebGLRenderTargetCube=no,t.WebGLRenderer=Jh,t.WebGLUtils=ph,t.WireframeGeometry=yc,t.WireframeHelper=ag,t.XHRLoader=og,t.NotEqualStencilFunc=t.NotEqualDepth=t.NormalBlending=t.NoToneMapping=t.NoColors=t.NoBlending=t.NeverStencilFunc=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.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.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.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.sRGBEncoding=t.ZeroStencilOp=t.ZeroSlopeEnding=t.ZeroFactor=t.ZeroCurvatureEnding=t.WrapAroundEnding=t.VertexColors=t.UnsignedShortType=t.UnsignedShort565Type=t.UnsignedShort5551Type=t.UnsignedShort4444Type=t.UnsignedIntType=t.UnsignedInt248Type=t.UnsignedByteType=t.UniformsUtils=t.UniformsLib=t.Uncharted2ToneMapping=t.UVMapping=t.TrianglesDrawMode=t.TriangleStripDrawMode=t.TriangleFanDrawMode=t.TangentSpaceNormalMap=t.TOUCH=t.SubtractiveBlending=t.SubtractEquation=t.SrcColorFactor=t.SrcAlphaSaturateFactor=t.SrcAlphaFactor=t.SphericalReflectionMapping=t.SmoothShading=t.ShortType=t.ShapeUtils=t.ShaderLib=t.ShaderChunk=t.SceneUtils=t.ReverseSubtractEquation=t.ReplaceStencilOp=t.RepeatWrapping=t.ReinhardToneMapping=t.RedFormat=t.RGB_S3TC_DXT1_Format=t.RGB_PVRTC_4BPPV1_Format=t.RGB_PVRTC_2BPPV1_Format=t.RGB_ETC1_Format=t.RGBM7Encoding=t.RGBM16Encoding=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_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.RGBAFormat=t.RGBADepthPacking=t.REVISION=t.PCFSoftShadowMap=t.PCFShadowMap=t.OneMinusSrcColorFactor=t.OneMinusSrcAlphaFactor=t.OneMinusDstColorFactor=t.OneMinusDstAlphaFactor=t.OneFactor=t.ObjectSpaceNormalMap=void 0,n(288);var d=i(n(15));n(197),n(63),n(50);var a=i(n(304)),o=i(n(64));n(316),n(75),n(22);var s=i(n(319));n(34);var m=i(n(77));n(330),n(53),n(214),n(339),n(159),n(215),n(340),n(160),n(161);var c=i(n(28)),he=i(n(24));n(347);var v=i(n(120)),Ge=i(n(12)),l=i(n(78));n(163),n(10),n(44);var u=i(n(122));n(356);var p=i(n(16));n(5),n(4),n(217);var g=i(n(0));n(362),n(364);var y=i(n(366));n(45),n(372);var re=i(n(218));function h(){}void 0===re.default&&(Number.EPSILON=Math.pow(2,-52)),void 0===y.default&&(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:0<e?1:+e}),"name"in Function.prototype==0&&(0,g.default)(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===p.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 i=arguments[n];if(null!=i)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}),(0,p.default)(h.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var n=this._listeners,i=n[e];if(void 0!==i){var r=i.indexOf(t);-1!==r&&i.splice(r,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 i=n.slice(0),r=0,a=i.length;r<a;r++)i[r].call(this,e)}}}});var f="107";t.REVISION=f;var _={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2};t.MOUSE=_;var x={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3};t.TOUCH=x;var ce=0;t.CullFaceNone=ce;var de=1;t.CullFaceBack=de;var fe=2;t.CullFaceFront=fe;var b=3;t.CullFaceFrontBack=b;var w=0;t.FrontFaceDirectionCW=w;var M=1;t.FrontFaceDirectionCCW=M;var T=0;t.BasicShadowMap=T;var O=1;t.PCFShadowMap=O;var F=2;t.PCFSoftShadowMap=F;var B=0;t.FrontSide=B;var ze=1;t.BackSide=ze;var pe=2;t.DoubleSide=pe;var E=1;t.FlatShading=E;var S=2;t.SmoothShading=S;var A=0;t.NoColors=A;var L=1;t.FaceColors=L;var I=2;t.VertexColors=I;var me=0;t.NoBlending=me;var ve=1;t.NormalBlending=ve;var ge=2;t.AdditiveBlending=ge;var ye=3;t.SubtractiveBlending=ye;var _e=4;t.MultiplyBlending=_e;var xe=5;t.CustomBlending=xe;var be=100;t.AddEquation=be;var k=101;t.SubtractEquation=k;var R=102;t.ReverseSubtractEquation=R;var N=103;t.MinEquation=N;var P=104;t.MaxEquation=P;var C=200;t.ZeroFactor=C;var D=201;t.OneFactor=D;var G=202;t.SrcColorFactor=G;var z=203;t.OneMinusSrcColorFactor=z;var U=204;t.SrcAlphaFactor=U;var V=205;t.OneMinusSrcAlphaFactor=V;var H=206;t.DstAlphaFactor=H;var j=207;t.OneMinusDstAlphaFactor=j;var W=208;t.DstColorFactor=W;var Y=209;t.OneMinusDstColorFactor=Y;var q=210;t.SrcAlphaSaturateFactor=q;var we=0;t.NeverDepth=we;var Me=1;t.AlwaysDepth=Me;var Te=2;t.LessDepth=Te;var Ee=3;t.LessEqualDepth=Ee;var Se=4;t.EqualDepth=Se;var Ae=5;t.GreaterEqualDepth=Ae;var Le=6;t.GreaterDepth=Le;var Ie=7;t.NotEqualDepth=Ie;var X=0;t.MultiplyOperation=X;var Z=1;t.MixOperation=Z;var J=2;t.AddOperation=J;var K=0;t.NoToneMapping=K;var Ue=1;t.LinearToneMapping=Ue;var Q=2;t.ReinhardToneMapping=Q;var $=3;t.Uncharted2ToneMapping=$;var ee=4;t.CineonToneMapping=ee;var te=5;t.ACESFilmicToneMapping=te;var ne=300;t.UVMapping=ne;var ie=301;t.CubeReflectionMapping=ie;var ae=302;t.CubeRefractionMapping=ae;var oe=303;t.EquirectangularReflectionMapping=oe;var se=304;t.EquirectangularRefractionMapping=se;var le=305;t.SphericalReflectionMapping=le;var ue=306;t.CubeUVReflectionMapping=ue;var ke=307;t.CubeUVRefractionMapping=ke;var Re=1e3;t.RepeatWrapping=Re;var Ne=1001;t.ClampToEdgeWrapping=Ne;var Pe=1002;t.MirroredRepeatWrapping=Pe;var Ce=1003;t.NearestFilter=Ce;var De=1004;t.NearestMipmapNearestFilter=De;var Oe=1004;t.NearestMipMapNearestFilter=Oe;var Fe=1005;t.NearestMipmapLinearFilter=Fe;var Be=1005;t.NearestMipMapLinearFilter=Be;var Ve=1006;t.LinearFilter=Ve;var He=1007;t.LinearMipmapNearestFilter=He;var je=1007;t.LinearMipMapNearestFilter=je;var We=1008;t.LinearMipmapLinearFilter=We;var Ye=1008;t.LinearMipMapLinearFilter=Ye;var qe=1009;t.UnsignedByteType=qe;var Xe=1010;t.ByteType=Xe;var Ze=1011;t.ShortType=Ze;var Je=1012;t.UnsignedShortType=Je;var Ke=1013;t.IntType=Ke;var Qe=1014;t.UnsignedIntType=Qe;var $e=1015;t.FloatType=$e;var et=1016;t.HalfFloatType=et;var tt=1017;t.UnsignedShort4444Type=tt;var nt=1018;t.UnsignedShort5551Type=nt;var it=1019;t.UnsignedShort565Type=it;var rt=1020;t.UnsignedInt248Type=rt;var at=1021;t.AlphaFormat=at;var ot=1022;t.RGBFormat=ot;var st=1023;t.RGBAFormat=st;var lt=1024;t.LuminanceFormat=lt;var ut=1025;t.LuminanceAlphaFormat=ut;var ht=st;t.RGBEFormat=ht;var ct=1026;t.DepthFormat=ct;var dt=1027;t.DepthStencilFormat=dt;var ft=1028;t.RedFormat=ft;var pt=33776;t.RGB_S3TC_DXT1_Format=pt;var mt=33777;t.RGBA_S3TC_DXT1_Format=mt;var vt=33778;t.RGBA_S3TC_DXT3_Format=vt;var gt=33779;t.RGBA_S3TC_DXT5_Format=gt;var yt=35840;t.RGB_PVRTC_4BPPV1_Format=yt;var _t=35841;t.RGB_PVRTC_2BPPV1_Format=_t;var xt=35842;t.RGBA_PVRTC_4BPPV1_Format=xt;var bt=35843;t.RGBA_PVRTC_2BPPV1_Format=bt;var wt=36196;t.RGB_ETC1_Format=wt;var Mt=37808;t.RGBA_ASTC_4x4_Format=Mt;var Tt=37809;t.RGBA_ASTC_5x4_Format=Tt;var Et=37810;t.RGBA_ASTC_5x5_Format=Et;var St=37811;t.RGBA_ASTC_6x5_Format=St;var At=37812;t.RGBA_ASTC_6x6_Format=At;var Lt=37813;t.RGBA_ASTC_8x5_Format=Lt;var It=37814;t.RGBA_ASTC_8x6_Format=It;var kt=37815;t.RGBA_ASTC_8x8_Format=kt;var Rt=37816;t.RGBA_ASTC_10x5_Format=Rt;var Nt=37817;t.RGBA_ASTC_10x6_Format=Nt;var Pt=37818;t.RGBA_ASTC_10x8_Format=Pt;var Ct=37819;t.RGBA_ASTC_10x10_Format=Ct;var Dt=37820;t.RGBA_ASTC_12x10_Format=Dt;var Ot=37821;t.RGBA_ASTC_12x12_Format=Ot;var Ft=2200;t.LoopOnce=Ft;var Bt=2201;t.LoopRepeat=Bt;var Gt=2202;t.LoopPingPong=Gt;var zt=2300;t.InterpolateDiscrete=zt;var Ut=2301;t.InterpolateLinear=Ut;var Vt=2302;t.InterpolateSmooth=Vt;var Ht=2400;t.ZeroCurvatureEnding=Ht;var jt=2401;t.ZeroSlopeEnding=jt;var Wt=2402;t.WrapAroundEnding=Wt;var Yt=0;t.TrianglesDrawMode=Yt;var qt=1;t.TriangleStripDrawMode=qt;var Xt=2;t.TriangleFanDrawMode=Xt;var Zt=3e3;t.LinearEncoding=Zt;var Jt=3001;t.sRGBEncoding=Jt;var Kt=3007;t.GammaEncoding=Kt;var Qt=3002;t.RGBEEncoding=Qt;var $t=3003;t.LogLuvEncoding=$t;var en=3004;t.RGBM7Encoding=en;var tn=3005;t.RGBM16Encoding=tn;var nn=3006;t.RGBDEncoding=nn;var rn=3200;t.BasicDepthPacking=rn;var an=3201;t.RGBADepthPacking=an;var on=0;t.TangentSpaceNormalMap=on;var sn=1;t.ObjectSpaceNormalMap=sn;var ln=0;t.ZeroStencilOp=ln;var un=7680;t.KeepStencilOp=un;var hn=7681;t.ReplaceStencilOp=hn;var cn=7682;t.IncrementStencilOp=cn;var dn=7683;t.DecrementStencilOp=dn;var fn=34055;t.IncrementWrapStencilOp=fn;var pn=34056;t.DecrementWrapStencilOp=pn;var mn=5386;t.InvertStencilOp=mn;var vn=512;t.NeverStencilFunc=vn;var gn=513;t.LessStencilFunc=gn;var yn=514;t.EqualStencilFunc=yn;var _n=515;t.LessEqualStencilFunc=_n;var xn=516;t.GreaterStencilFunc=xn;var bn=517;t.NotEqualStencilFunc=bn;var wn=518;t.GreaterEqualStencilFunc=wn;var Mn=519;t.AlwaysStencilFunc=Mn;var Tn,En,Sn,An,Ln,In,kn={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,i=4294967295*Math.random()|0,r=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&i]+a[i>>8&255]+a[i>>16&255]+a[i>>24&255];return r.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,i,r){return i+(e-t)*(r-i)/(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*kn.DEG2RAD},radToDeg:function(e){return e*kn.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))}};function Rn(e,t){this.x=e||0,this.y=t||0}function Nn(e,t,n,i){this._x=e||0,this._y=t||0,this._z=n||0,this._w=void 0!==i?i:1}function Pn(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}function Cn(){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.Math=kn,(0,u.default)(Rn.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,p.default)(Rn.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,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[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);return e<0&&(e+=2*Math.PI),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),i=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*i+e.x,this.y=r*i+a*n+e.y,this}}),(0,p.default)(Nn,{slerp:function(e,t,n,i){return n.copy(e).slerp(t,i)},slerpFlat:function(e,t,n,i,r,a,o){var s=n[i+0],l=n[i+1],u=n[i+2],h=n[i+3],c=r[a+0],d=r[a+1],f=r[a+2],p=r[a+3];if(h!==p||s!==c||l!==d||u!==f){var m=1-o,v=s*c+l*d+u*f+h*p,g=0<=v?1:-1,y=1-v*v;if(y>re.default){var _=Math.sqrt(y),x=Math.atan2(_,v*g);m=Math.sin(m*x)/_,o=Math.sin(o*x)/_}var b=o*g;if(s=s*m+c*b,l=l*m+d*b,u=u*m+f*b,h=h*m+p*b,m===1-o){var w=1/Math.sqrt(s*s+l*l+u*u+h*h);s*=w,l*=w,u*=w,h*=w}}e[t]=s,e[t+1]=l,e[t+2]=u,e[t+3]=h}}),(0,u.default)(Nn.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,p.default)(Nn.prototype,{isQuaternion:!0,set:function(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,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,i=e._y,r=e._z,a=e.order,o=Math.cos,s=Math.sin,l=o(n/2),u=o(i/2),h=o(r/2),c=s(n/2),d=s(i/2),f=s(r/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,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(e){var t,n=e.elements,i=n[0],r=n[4],a=n[8],o=n[1],s=n[5],l=n[9],u=n[2],h=n[6],c=n[10],d=i+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-r)*t):s<i&&c<i?(t=2*Math.sqrt(1+i-s-c),this._w=(h-l)/t,this._x=.25*t,this._y=(r+o)/t,this._z=(a+u)/t):c<s?(t=2*Math.sqrt(1+s-i-c),this._w=(a-u)/t,this._x=(r+o)/t,this._y=.25*t,this._z=(l+h)/t):(t=2*Math.sqrt(1+c-i-s),this._w=(o-r)/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,i=e.dot(t)+1;return i<n?(i=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=i,this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs(kn.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,t){var n=this.angleTo(e);if(0===n)return this;var i=Math.min(1,t/n);return this.slerp(e,i),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,i=e._y,r=e._z,a=e._w,o=t._x,s=t._y,l=t._z,u=t._w;return this._x=n*u+a*o+i*l-r*s,this._y=i*u+a*s+r*o-n*l,this._z=r*u+a*l+n*s-i*o,this._w=a*u-n*o-i*s-r*l,this._onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,i=this._y,r=this._z,a=this._w,o=a*e._w+n*e._x+i*e._y+r*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=i,this._z=r,this;var s=1-o*o;if(s<=re.default){var l=1-t;return this._w=l*a+t*this._w,this._x=l*n+t*this._x,this._y=l*i+t*this._y,this._z=l*r+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=i*c+this._y*d,this._z=r*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(){}}),(0,p.default)(Pn.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:(An=new Nn,function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(An.setFromEuler(e))}),applyAxisAngle:(Sn=new Nn,function(e,t){return this.applyQuaternion(Sn.setFromAxisAngle(e,t))}),applyMatrix3:function(e){var t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this},applyMatrix4:function(e){var t=this.x,n=this.y,i=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*a,this},applyQuaternion:function(e){var t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,o=e.z,s=e.w,l=s*t+a*i-o*n,u=s*n+o*t-r*i,h=s*i+r*n-a*t,c=-r*t-a*n-o*i;return this.x=l*s+c*-r+u*-o-h*-a,this.y=u*s+c*-a+h*-r-l*-o,this.z=h*s+c*-o+l*-a-u*-r,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,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,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,i=e.y,r=e.z,a=t.x,o=t.y,s=t.z;return this.x=i*s-r*o,this.y=r*a-n*s,this.z=n*o-i*a,this},projectOnVector:function(e){var t=e.dot(this)/e.lengthSq();return this.copy(e).multiplyScalar(t)},projectOnPlane:(En=new Pn,function(e){return En.copy(this).projectOnVector(e),this.sub(En)}),reflect:(Tn=new Pn,function(e){return this.sub(Tn.copy(e).multiplyScalar(2*this.dot(e)))}),angleTo:function(e){var t=this.dot(e)/Math.sqrt(this.lengthSq()*e.lengthSq());return Math.acos(kn.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,i=this.z-e.z;return t*t+n*n+i*i},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 i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*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(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,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}}),(0,p.default)(Cn.prototype,{isMatrix3:!0,set:function(e,t,n,i,r,a,o,s,l){var u=this.elements;return u[0]=e,u[1]=i,u[2]=o,u[3]=t,u[4]=r,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},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},applyToBufferAttribute:function(e){void 0===Ln&&(Ln=new Pn);for(var t=0,n=e.count;t<n;t++)Ln.x=e.getX(t),Ln.y=e.getY(t),Ln.z=e.getZ(t),Ln.applyMatrix3(this),e.setXYZ(t,Ln.x,Ln.y,Ln.z);return e},multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,i=t.elements,r=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=i[0],m=i[3],v=i[6],g=i[1],y=i[4],_=i[7],x=i[2],b=i[5],w=i[8];return r[0]=a*p+o*g+s*x,r[3]=a*m+o*y+s*b,r[6]=a*v+o*_+s*w,r[1]=l*p+u*g+h*x,r[4]=l*m+u*y+h*b,r[7]=l*v+u*_+h*w,r[2]=c*p+d*g+f*x,r[5]=c*m+d*y+f*b,r[8]=c*v+d*_+f*w,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],i=e[2],r=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*r*u+n*o*s+i*r*l-i*a*s},getInverse:function(e,t){e&&e.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=e.elements,i=this.elements,r=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=r*f+a*p+o*m;if(0===v){var g="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(g);return console.warn(g),this.identity()}var y=1/v;return i[0]=f*y,i[1]=(o*c-d*a)*y,i[2]=(u*a-o*l)*y,i[3]=p*y,i[4]=(d*r-o*h)*y,i[5]=(o*s-u*r)*y,i[6]=m*y,i[7]=(a*h-c*r)*y,i[8]=(l*r-a*s)*y,this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,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,i,r,a,o){var s=Math.cos(r),l=Math.sin(r);this.set(n*s,n*l,-n*(s*a+l*o)+a+e,-i*l,i*s,-i*(-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),i=this.elements,r=i[0],a=i[3],o=i[6],s=i[1],l=i[4],u=i[7];return i[0]=t*r+n*s,i[3]=t*a+n*l,i[6]=t*o+n*u,i[1]=-n*r+t*s,i[4]=-n*a+t*l,i[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,i=0;i<9;i++)if(t[i]!==n[i])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 Dn={getDataURL:function(e){var t;if("undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)t=e;else{void 0===In&&(In=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),In.width=e.width,In.height=e.height;var n=In.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=In}return 2048<t.width||2048<t.height?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}};t.ImageUtils=Dn;var On,Fn,Bn,Gn,zn,Un,Vn,Hn,jn,Wn,Yn,qn=0;function Xn(e,t,n,i,r,a,o,s,l,u){(0,g.default)(this,"id",{value:qn++}),this.uuid=kn.generateUUID(),this.name="",this.image=void 0!==e?e:Xn.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:Xn.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:Ne,this.wrapT=void 0!==i?i:Ne,this.magFilter=void 0!==r?r:Ve,this.minFilter=void 0!==a?a:We,this.anisotropy=void 0!==l?l:1,this.format=void 0!==o?o:st,this.type=void 0!==s?s:qe,this.offset=new Rn(0,0),this.repeat=new Rn(1,1),this.center=new Rn(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Cn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==u?u:Zt,this.version=0,this.onUpdate=null}function Zn(e,t,n,i){this.x=e||0,this.y=t||0,this.z=n||0,this.w=void 0!==i?i:1}function Jn(e,t,n){this.width=e,this.height=t,this.scissor=new Zn(0,0,e,t),this.scissorTest=!1,this.viewport=new Zn(0,0,e,t),n=n||{},this.texture=new Xn(void 0,void 0,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:Ve,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 Kn(e,t,n){Jn.call(this,e,t,n),this.samples=4}function Qn(){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.")}function $n(e,t,n,i){this._x=e||0,this._y=t||0,this._z=n||0,this._order=i||$n.DefaultOrder}function ei(){this.mask=1}Xn.DEFAULT_IMAGE=void 0,Xn.DEFAULT_MAPPING=ne,Xn.prototype=(0,p.default)((0,l.default)(h.prototype),{constructor:Xn,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(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.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),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:[this.repeat.x,this.repeat.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 i=this.image;if(void 0===i.uuid&&(i.uuid=kn.generateUUID()),!t&&void 0===e.images[i.uuid]){var r;if((0,Ge.default)(i)){r=[];for(var a=0,o=i.length;a<o;a++)r.push(Dn.getDataURL(i[a]))}else r=Dn.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!==ne)return e;if(e.applyMatrix3(this.matrix),e.x<0||1<e.x)switch(this.wrapS){case Re:e.x=e.x-Math.floor(e.x);break;case Ne:e.x=e.x<0?0:1;break;case Pe: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 Re:e.y=e.y-Math.floor(e.y);break;case Ne:e.y=e.y<0?0:1;break;case Pe: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,g.default)(Xn.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),(0,u.default)(Zn.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,p.default)(Zn.prototype,{isVector4:!0,set:function(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,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,i=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*r,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,i,r,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,b=(h+p)/4,w=(f+m)/4;return y<g&&_<g?r=g<a?(n=0,i=.707106781,.707106781):(n=Math.sqrt(g),i=x/n,b/n):_<y?r=y<a?(n=.707106781,i=0,.707106781):(i=Math.sqrt(y),n=x/i,w/i):_<a?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(_),n=b/r,i=w/r),this.set(n,i,r,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}}),Jn.prototype=(0,p.default)((0,l.default)(h.prototype),{constructor:Jn,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"})}}),Kn.prototype=(0,p.default)((0,l.default)(Jn.prototype),{constructor:Kn,isWebGLMultisampleRenderTarget:!0,copy:function(e){return Jn.prototype.copy.call(this,e),this.samples=e.samples,this}}),(0,p.default)(Qn.prototype,{isMatrix4:!0,set:function(e,t,n,i,r,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]=i,v[1]=r,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 Qn).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:(jn=new Pn,function(e){var t=this.elements,n=e.elements,i=1/jn.setFromMatrixColumn(e,0).length(),r=1/jn.setFromMatrixColumn(e,1).length(),a=1/jn.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,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=this.elements,n=e.x,i=e.y,r=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(i),l=Math.sin(i),u=Math.cos(r),h=Math.sin(r);if("XYZ"===e.order){var c=a*u,d=a*h,f=o*u,p=o*h;t[0]=s*u,t[4]=-s*h,t[8]=l,t[1]=d+f*l,t[5]=c-p*l,t[9]=-o*s,t[2]=p-c*l,t[6]=f+d*l,t[10]=a*s}else if("YXZ"===e.order){var m=s*u,v=s*h,g=l*u,y=l*h;t[0]=m+y*o,t[4]=g*o-v,t[8]=a*l,t[1]=a*h,t[5]=a*u,t[9]=-o,t[2]=v*o-g,t[6]=y+m*o,t[10]=a*s}else if("ZXY"===e.order)m=s*u,v=s*h,g=l*u,y=l*h,t[0]=m-y*o,t[4]=-a*h,t[8]=g+v*o,t[1]=v+g*o,t[5]=a*u,t[9]=y-m*o,t[2]=-a*l,t[6]=o,t[10]=a*s;else if("ZYX"===e.order)c=a*u,d=a*h,f=o*u,p=o*h,t[0]=s*u,t[4]=f*l-d,t[8]=c*l+p,t[1]=s*h,t[5]=p*l+c,t[9]=d*l-f,t[2]=-l,t[6]=o*s,t[10]=a*s;else if("YZX"===e.order){var _=a*s,x=a*l,b=o*s,w=o*l;t[0]=s*u,t[4]=w-_*h,t[8]=b*h+x,t[1]=h,t[5]=a*u,t[9]=-o*u,t[2]=-l*u,t[6]=x*h+b,t[10]=_-w*h}else"XZY"===e.order&&(_=a*s,x=a*l,b=o*s,w=o*l,t[0]=s*u,t[4]=-h,t[8]=l*u,t[1]=_*h+w,t[5]=a*u,t[9]=x*h-b,t[2]=b*h-x,t[6]=o*u,t[10]=w*h+_);return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:(Vn=new Pn(0,0,0),Hn=new Pn(1,1,1),function(e){return this.compose(Vn,e,Hn)}),lookAt:(Gn=new Pn,zn=new Pn,Un=new Pn,function(e,t,n){var i=this.elements;return Un.subVectors(e,t),0===Un.lengthSq()&&(Un.z=1),Un.normalize(),Gn.crossVectors(n,Un),0===Gn.lengthSq()&&(1===Math.abs(n.z)?Un.x+=1e-4:Un.z+=1e-4,Un.normalize(),Gn.crossVectors(n,Un)),Gn.normalize(),zn.crossVectors(Un,Gn),i[0]=Gn.x,i[4]=zn.x,i[8]=Un.x,i[1]=Gn.y,i[5]=zn.y,i[9]=Un.y,i[2]=Gn.z,i[6]=zn.z,i[10]=Un.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,i=t.elements,r=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],b=i[0],w=i[4],M=i[8],T=i[12],E=i[1],S=i[5],A=i[9],L=i[13],I=i[2],k=i[6],R=i[10],N=i[14],P=i[3],C=i[7],D=i[11],O=i[15];return r[0]=a*b+o*E+s*I+l*P,r[4]=a*w+o*S+s*k+l*C,r[8]=a*M+o*A+s*R+l*D,r[12]=a*T+o*L+s*N+l*O,r[1]=u*b+h*E+c*I+d*P,r[5]=u*w+h*S+c*k+d*C,r[9]=u*M+h*A+c*R+d*D,r[13]=u*T+h*L+c*N+d*O,r[2]=f*b+p*E+m*I+v*P,r[6]=f*w+p*S+m*k+v*C,r[10]=f*M+p*A+m*R+v*D,r[14]=f*T+p*L+m*N+v*O,r[3]=g*b+y*E+_*I+x*P,r[7]=g*w+y*S+_*k+x*C,r[11]=g*M+y*A+_*R+x*D,r[15]=g*T+y*L+_*N+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:(Bn=new Pn,function(e){for(var t=0,n=e.count;t<n;t++)Bn.x=e.getX(t),Bn.y=e.getY(t),Bn.z=e.getZ(t),Bn.applyMatrix4(this),e.setXYZ(t,Bn.x,Bn.y,Bn.z);return e}),determinant:function(){var e=this.elements,t=e[0],n=e[4],i=e[8],r=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*(r*s*h-i*l*h-r*o*c+n*l*c+i*o*d-n*s*d)+p*(t*s*d-t*l*c+r*a*c-i*a*d+i*l*u-r*s*u)+m*(t*l*h-t*o*d-r*a*h+n*a*d+r*o*u-n*l*u)+v*(-i*o*u-t*s*h+t*o*c+i*a*h-n*a*c+n*s*u)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(e,t,n){var i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this},getInverse:function(e,t){var n=this.elements,i=e.elements,r=i[0],a=i[1],o=i[2],s=i[3],l=i[4],u=i[5],h=i[6],c=i[7],d=i[8],f=i[9],p=i[10],m=i[11],v=i[12],g=i[13],y=i[14],_=i[15],x=f*y*c-g*p*c+g*h*m-u*y*m-f*h*_+u*p*_,b=v*p*c-d*y*c-v*h*m+l*y*m+d*h*_-l*p*_,w=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=r*x+a*b+o*w+s*M;if(0===T){var E="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(E);return console.warn(E),this.identity()}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]=b*S,n[5]=(d*y*s-v*p*s+v*o*m-r*y*m-d*o*_+r*p*_)*S,n[6]=(v*h*s-l*y*s-v*o*c+r*y*c+l*o*_-r*h*_)*S,n[7]=(l*p*s-d*h*s+d*o*c-r*p*c-l*o*m+r*h*m)*S,n[8]=w*S,n[9]=(v*f*s-d*g*s-v*a*m+r*g*m+d*a*_-r*f*_)*S,n[10]=(l*g*s-v*u*s+v*a*c-r*g*c-l*a*_+r*u*_)*S,n[11]=(d*u*s-l*f*s-d*a*c+r*f*c+l*a*m-r*u*m)*S,n[12]=M*S,n[13]=(d*g*o-v*f*o+v*a*p-r*g*p-d*a*y+r*f*y)*S,n[14]=(v*u*o-l*g*o-v*a*h+r*g*h+l*a*y-r*u*y)*S,n[15]=(l*f*o-d*u*o+d*a*h-r*f*h-l*a*p+r*u*p)*S,this},scale:function(e){var t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,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],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))},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),i=Math.sin(t),r=1-n,a=e.x,o=e.y,s=e.z,l=r*a,u=r*o;return this.set(l*a+n,l*o-i*s,l*s+i*o,0,l*o+i*s,u*o+n,u*s-i*a,0,l*s-i*o,u*s+i*a,r*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 i=this.elements,r=t._x,a=t._y,o=t._z,s=t._w,l=r+r,u=a+a,h=o+o,c=r*l,d=r*u,f=r*h,p=a*u,m=a*h,v=o*h,g=s*l,y=s*u,_=s*h,x=n.x,b=n.y,w=n.z;return i[0]=(1-(p+v))*x,i[1]=(d+_)*x,i[2]=(f-y)*x,i[3]=0,i[4]=(d-_)*b,i[5]=(1-(c+v))*b,i[6]=(m+g)*b,i[7]=0,i[8]=(f+y)*w,i[9]=(m-g)*w,i[10]=(1-(c+p))*w,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},decompose:(On=new Pn,Fn=new Qn,function(e,t,n){var i=this.elements,r=On.set(i[0],i[1],i[2]).length(),a=On.set(i[4],i[5],i[6]).length(),o=On.set(i[8],i[9],i[10]).length(),s=this.determinant();s<0&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],Fn.copy(this);var l=1/r,u=1/a,h=1/o;return Fn.elements[0]*=l,Fn.elements[1]*=l,Fn.elements[2]*=l,Fn.elements[4]*=u,Fn.elements[5]*=u,Fn.elements[6]*=u,Fn.elements[8]*=h,Fn.elements[9]*=h,Fn.elements[10]*=h,t.setFromRotationMatrix(Fn),n.x=r,n.y=a,n.z=o,this}),makePerspective:function(e,t,n,i,r,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*r/(t-e),l=2*r/(n-i),u=(t+e)/(t-e),h=(n+i)/(n-i),c=-(a+r)/(a-r),d=-2*a*r/(a-r);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,i,r,a){var o=this.elements,s=1/(t-e),l=1/(n-i),u=1/(a-r),h=(t+e)*s,c=(n+i)*l,d=(a+r)*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,i=0;i<16;i++)if(t[i]!==n[i])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}}),$n.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],$n.DefaultOrder="XYZ",(0,u.default)($n.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,p.default)($n.prototype,{isEuler:!0,set:function(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._order=i||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 i=kn.clamp,r=e.elements,a=r[0],o=r[4],s=r[8],l=r[1],u=r[5],h=r[9],c=r[2],d=r[6],f=r[10];return t=t||this._order,"XYZ"===t?(this._y=Math.asin(i(s,-1,1)),Math.abs(s)<.99999?(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(-i(h,-1,1)),Math.abs(h)<.99999?(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(i(d,-1,1)),Math.abs(d)<.99999?(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(-i(c,-1,1)),Math.abs(c)<.99999?(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(i(l,-1,1)),Math.abs(l)<.99999?(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(-i(o,-1,1)),Math.abs(o)<.99999?(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 void 0===Wn&&(Wn=new Qn),Wn.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Wn,t,n)},setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(e){return void 0===Yn&&(Yn=new Nn),Yn.setFromEuler(this),this.setFromQuaternion(Yn,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 Pn(this._x,this._y,this._z)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}}),(0,p.default)(ei.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask|=1<<e|0},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},test:function(e){return 0!=(this.mask&e.mask)}});var ti,ni,ii,ri,ai,oi,si,li,ui,hi,ci,di,fi,pi,mi,vi,gi,yi,_i,xi,bi,wi,Mi,Ti,Ei,Si,Ai,Li,Ii,ki,Ri,Ni,Pi,Ci,Di,Oi,Fi,Bi,Gi,zi,Ui,Vi,Hi,ji,Wi,Yi,qi,Xi,Zi,Ji,Ki,Qi,$i,er,tr,nr,ir,rr,ar,or,sr,lr,ur,hr,cr,dr,fr=0;function pr(){(0,g.default)(this,"id",{value:fr++}),this.uuid=kn.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=pr.DefaultUp.clone();var e=new Pn,t=new $n,n=new Nn,i=new Pn(1,1,1);function r(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(r),n._onChange(a),(0,u.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:i},modelViewMatrix:{value:new Qn},normalMatrix:{value:new Cn}}),this.matrix=new Qn,this.matrixWorld=new Qn,this.matrixAutoUpdate=pr.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new ei,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function mr(){pr.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function vr(e,t){this.min=void 0!==e?e:new Pn(1/0,1/0,1/0),this.max=void 0!==t?t:new Pn(-1/0,-1/0,-1/0)}function gr(e){var t,n;for(t=0,n=e.length-3;t<=n;t+=3){Ii.fromArray(e,t);var i=Ri.x*Math.abs(Ii.x)+Ri.y*Math.abs(Ii.y)+Ri.z*Math.abs(Ii.z),r=Mi.dot(Ii),a=Ti.dot(Ii),o=Ei.dot(Ii);if(Math.max(-Math.max(r,a,o),Math.min(r,a,o))>i)return!1}return!0}function yr(e){var t=e.geometry;if(void 0!==t)if(t.isGeometry){var n=t.vertices;for(Di=0,Oi=n.length;Di<Oi;Di++)Fi.copy(n[Di]),Fi.applyMatrix4(e.matrixWorld),Ci.expandByPoint(Fi)}else if(t.isBufferGeometry){var i=t.attributes.position;if(void 0!==i)for(Di=0,Oi=i.count;Di<Oi;Di++)Fi.fromBufferAttribute(i,Di).applyMatrix4(e.matrixWorld),Ci.expandByPoint(Fi)}}function _r(e,t){this.center=void 0!==e?e:new Pn,this.radius=void 0!==t?t:0}function xr(e,t){this.origin=void 0!==e?e:new Pn,this.direction=void 0!==t?t:new Pn}function br(e,t,n){this.a=void 0!==e?e:new Pn,this.b=void 0!==t?t:new Pn,this.c=void 0!==n?n:new Pn}pr.DefaultUp=new Pn(0,1,0),pr.DefaultMatrixAutoUpdate=!0,pr.prototype=(0,p.default)((0,l.default)(h.prototype),{constructor:pr,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix: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:(_i=new Nn,function(e,t){return _i.setFromAxisAngle(e,t),this.quaternion.multiply(_i),this}),rotateOnWorldAxis:(yi=new Nn,function(e,t){return yi.setFromAxisAngle(e,t),this.quaternion.premultiply(yi),this}),rotateX:(gi=new Pn(1,0,0),function(e){return this.rotateOnAxis(gi,e)}),rotateY:(vi=new Pn(0,1,0),function(e){return this.rotateOnAxis(vi,e)}),rotateZ:(mi=new Pn(0,0,1),function(e){return this.rotateOnAxis(mi,e)}),translateOnAxis:(pi=new Pn,function(e,t){return pi.copy(e).applyQuaternion(this.quaternion),this.position.add(pi.multiplyScalar(t)),this}),translateX:(fi=new Pn(1,0,0),function(e){return this.translateOnAxis(fi,e)}),translateY:(di=new Pn(0,1,0),function(e){return this.translateOnAxis(di,e)}),translateZ:(ci=new Pn(0,0,1),function(e){return this.translateOnAxis(ci,e)}),localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:(hi=new Qn,function(e){return e.applyMatrix4(hi.getInverse(this.matrixWorld))}),lookAt:(oi=new Nn,si=new Qn,li=new Pn,ui=new Pn,function(e,t,n){e.isVector3?li.copy(e):li.set(e,t,n);var i=this.parent;this.updateWorldMatrix(!0,!1),ui.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?si.lookAt(ui,li,this.up):si.lookAt(li,ui,this.up),this.quaternion.setFromRotationMatrix(si),i&&(si.extractRotation(i.matrixWorld),oi.setFromRotationMatrix(si),this.quaternion.premultiply(oi.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({type:"added"})):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this},remove:function(e){if(1<arguments.length){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var n=this.children.indexOf(e);return-1!==n&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent({type:"removed"})),this},attach:(ai=new Qn,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.applyMatrix(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,i=this.children.length;n<i;n++){var r=this.children[n],a=r.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 Pn),this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:(ii=new Pn,ri=new Pn,function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),e=new Nn),this.updateMatrixWorld(!0),this.matrixWorld.decompose(ii,e,ri),e}),getWorldScale:(ti=new Pn,ni=new Nn,function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),e=new Pn),this.updateMatrixWorld(!0),this.matrixWorld.decompose(ti,ni,e),e}),getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),e=new Pn),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,i=t.length;n<i;n++)t[n].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=this.children,n=0,i=t.length;n<i;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,i=t.length;n<i;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 i=this.children,r=0,a=i.length;r<a;r++)i[r].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 i={};function r(e,t){return void 0===e[t.uuid]&&(e[t.uuid]=t.toJSON(n)),t.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),"{}"!==(0,v.default)(this.userData)&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isMesh&&this.drawMode!==Yt&&(i.drawMode=this.drawMode),this.isMesh||this.isLine||this.isPoints){i.geometry=r(n.geometries,this.geometry);var a=this.geometry.parameters;if(void 0!==a&&void 0!==a.shapes){var o=a.shapes;if((0,Ge.default)(o))for(var s=0,l=o.length;s<l;s++){var u=o[s];r(n.shapes,u)}else r(n.shapes,o)}}if(void 0!==this.material)if((0,Ge.default)(this.material)){var h=[];for(s=0,l=this.material.length;s<l;s++)h.push(r(n.materials,this.material[s]));i.material=h}else i.material=r(n.materials,this.material);if(0<this.children.length)for(i.children=[],s=0;s<this.children.length;s++)i.children.push(this.children[s].toJSON(n).object);if(e){var c=m(n.geometries),d=m(n.materials),f=m(n.textures),p=m(n.images);o=m(n.shapes),0<c.length&&(t.geometries=c),0<d.length&&(t.materials=d),0<f.length&&(t.textures=f),0<p.length&&(t.images=p),0<o.length&&(t.shapes=o)}return t.object=i,t;function m(e){var t=[];for(var n in e){var i=e[n];delete i.metadata,t.push(i)}return t}},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,v.default)(e.userData)),!0===t)for(var n=0;n<e.children.length;n++){var i=e.children[n];this.add(i.clone())}return this}}),mr.prototype=(0,p.default)((0,l.default)(pr.prototype),{constructor:mr,isScene:!0,copy:function(e,t){return pr.prototype.copy.call(this,e,t),null!==e.background&&(this.background=e.background.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=pr.prototype.toJSON.call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t},dispose:function(){this.dispatchEvent({type:"dispose"})}}),(0,p.default)(vr.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,o=-1/0,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<i&&(i=c),r<u&&(r=u),a<h&&(a=h),o<c&&(o=c)}return this.min.set(t,n,i),this.max.set(r,a,o),this},setFromBufferAttribute:function(e){for(var t=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,o=-1/0,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<i&&(i=c),r<u&&(r=u),a<h&&(a=h),o<c&&(o=c)}return this.min.set(t,n,i),this.max.set(r,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:(Bi=new Pn,function(e,t){var n=Bi.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=1/0,this.max.x=this.max.y=this.max.z=-1/0,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 Pn),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 Pn),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:(Fi=new Pn,function(e){return Ci=this,e.updateMatrixWorld(!0),e.traverse(yr),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 Pn),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:(Pi=new Pn,function(e){return this.clampPoint(e.center,Pi),Pi.distanceToSquared(e.center)<=e.radius*e.radius}),intersectsPlane:function(e){var t,n;return 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),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:(Mi=new Pn,Ti=new Pn,Ei=new Pn,Si=new Pn,Ai=new Pn,Li=new Pn,Ii=new Pn,ki=new Pn,Ri=new Pn,Ni=new Pn,function(e){if(this.isEmpty())return!1;this.getCenter(ki),Ri.subVectors(this.max,ki),Mi.subVectors(e.a,ki),Ti.subVectors(e.b,ki),Ei.subVectors(e.c,ki),Si.subVectors(Ti,Mi),Ai.subVectors(Ei,Ti),Li.subVectors(Mi,Ei);var t=[0,-Si.z,Si.y,0,-Ai.z,Ai.y,0,-Li.z,Li.y,Si.z,0,-Si.x,Ai.z,0,-Ai.x,Li.z,0,-Li.x,-Si.y,Si.x,0,-Ai.y,Ai.x,0,-Li.y,Li.x,0];return!!gr(t)&&(t=[1,0,0,0,1,0,0,0,1],!!gr(t)&&(Ni.crossVectors(Si,Ai),t=[Ni.x,Ni.y,Ni.z],gr(t)))}),clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new Pn),t.copy(e).clamp(this.min,this.max)},distanceToPoint:(wi=new Pn,function(e){var t=wi.copy(e).clamp(this.min,this.max);return t.sub(e).length()}),getBoundingSphere:(bi=new Pn,function(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(bi).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:(xi=[new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn],function(e){return this.isEmpty()||(xi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),xi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),xi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),xi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),xi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),xi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),xi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),xi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(xi)),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)}}),(0,p.default)(_r.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(e,t){void 0===Gi&&(Gi=new vr);var n=this.center;void 0!==t?n.copy(t):Gi.setFromPoints(e).getCenter(n);for(var i=0,r=0,a=e.length;r<a;r++)i=Math.max(i,n.distanceToSquared(e[r]));return this.radius=Math.sqrt(i),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 Pn),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 vr),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}}),(0,p.default)(xr.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 Pn),t.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:(Ji=new Pn,function(e){return this.origin.copy(this.at(e,Ji)),this}),closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new Pn),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:(Zi=new Pn,function(e){var t=Zi.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Zi.copy(this.direction).multiplyScalar(t).add(this.origin),Zi.distanceToSquared(e))}),distanceSqToSegment:(Yi=new Pn,qi=new Pn,Xi=new Pn,function(e,t,n,i){Yi.copy(e).add(t).multiplyScalar(.5),qi.copy(t).sub(e).normalize(),Xi.copy(this.origin).sub(Yi);var r,a,o,s,l=.5*e.distanceTo(t),u=-this.direction.dot(qi),h=Xi.dot(this.direction),c=-Xi.dot(qi),d=Xi.lengthSq(),f=Math.abs(1-u*u);if(0<f)if(r=u*c-h,a=u*h-c,s=l*f,0<=r)if(-s<=a)if(a<=s){var p=1/f;r*=p,a*=p,o=r*(r+u*a+2*h)+a*(u*r+a+2*c)+d}else a=l,r=Math.max(0,-(u*a+h)),o=-r*r+a*(a+2*c)+d;else a=-l,r=Math.max(0,-(u*a+h)),o=-r*r+a*(a+2*c)+d;else o=a<=-s?(r=Math.max(0,-(-u*l+h)),a=0<r?-l:Math.min(Math.max(-l,-c),l),-r*r+a*(a+2*c)+d):a<=s?(r=0,a=Math.min(Math.max(-l,-c),l),a*(a+2*c)+d):(r=Math.max(0,-(u*l+h)),a=0<r?l:Math.min(Math.max(-l,-c),l),-r*r+a*(a+2*c)+d);else a=0<u?-l:l,r=Math.max(0,-(u*a+h)),o=-r*r+a*(a+2*c)+d;return n&&n.copy(this.direction).multiplyScalar(r).add(this.origin),i&&i.copy(qi).multiplyScalar(a).add(Yi),o}),intersectSphere:(Wi=new Pn,function(e,t){Wi.subVectors(e.center,this.origin);var n=Wi.dot(this.direction),i=Wi.dot(Wi)-n*n,r=e.radius*e.radius;if(r<i)return null;var a=Math.sqrt(r-i),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,i,r,a,o,s,l=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,c=this.origin;return i=0<=l?(n=(e.min.x-c.x)*l,(e.max.x-c.x)*l):(n=(e.max.x-c.x)*l,(e.min.x-c.x)*l),a=0<=u?(r=(e.min.y-c.y)*u,(e.max.y-c.y)*u):(r=(e.max.y-c.y)*u,(e.min.y-c.y)*u),a<n||i<r?null:((n<r||n!=n)&&(n=r),(a<i||i!=i)&&(i=a),s=0<=h?(o=(e.min.z-c.z)*h,(e.max.z-c.z)*h):(o=(e.max.z-c.z)*h,(e.min.z-c.z)*h),s<n||i<o?null:((n<o||n!=n)&&(n=o),(s<i||i!=i)&&(i=s),i<0?null:this.at(0<=n?n:i,t)))},intersectsBox:(ji=new Pn,function(e){return null!==this.intersectBox(e,ji)}),intersectTriangle:(zi=new Pn,Ui=new Pn,Vi=new Pn,Hi=new Pn,function(e,t,n,i,r){Ui.subVectors(t,e),Vi.subVectors(n,e),Hi.crossVectors(Ui,Vi);var a,o=this.direction.dot(Hi);if(0<o){if(i)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}zi.subVectors(this.origin,e);var s=a*this.direction.dot(Vi.crossVectors(zi,Vi));if(s<0)return null;var l=a*this.direction.dot(Ui.cross(zi));if(l<0)return null;if(o<s+l)return null;var u=-a*zi.dot(Hi);return u<0?null:this.at(u/o,r)}),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)}}),(0,p.default)(br,{getNormal:(rr=new Pn,function(e,t,n,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new Pn),i.subVectors(n,t),rr.subVectors(e,t),i.cross(rr);var r=i.lengthSq();return 0<r?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}),getBarycoord:(tr=new Pn,nr=new Pn,ir=new Pn,function(e,t,n,i,r){tr.subVectors(i,t),nr.subVectors(n,t),ir.subVectors(e,t);var a=tr.dot(tr),o=tr.dot(nr),s=tr.dot(ir),l=nr.dot(nr),u=nr.dot(ir),h=a*l-o*o;if(void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new Pn),0===h)return r.set(-2,-1,-1);var c=1/h,d=(l*s-o*u)*c,f=(a*u-o*s)*c;return r.set(1-d-f,f,d)}),containsPoint:(er=new Pn,function(e,t,n,i){return br.getBarycoord(e,t,n,i,er),0<=er.x&&0<=er.y&&er.x+er.y<=1}),getUV:($i=new Pn,function(e,t,n,i,r,a,o,s){return this.getBarycoord(e,t,n,i,$i),s.set(0,0),s.addScaledVector(r,$i.x),s.addScaledVector(a,$i.y),s.addScaledVector(o,$i.z),s}),isFrontFacing:(Ki=new Pn,Qi=new Pn,function(e,t,n,i){return Ki.subVectors(n,t),Qi.subVectors(e,t),Ki.cross(Qi).dot(i)<0})}),(0,p.default)(br.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,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),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:(cr=new Pn,dr=new Pn,function(){return cr.subVectors(this.c,this.b),dr.subVectors(this.a,this.b),.5*cr.cross(dr).length()}),getMidpoint:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new Pn),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return br.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 Pn),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,t){return br.getBarycoord(e,this.a,this.b,this.c,t)},getUV:function(e,t,n,i,r){return br.getUV(e,this.a,this.b,this.c,t,n,i,r)},containsPoint:function(e){return br.containsPoint(e,this.a,this.b,this.c)},isFrontFacing:function(e){return br.isFrontFacing(this.a,this.b,this.c,e)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:(ar=new Pn,or=new Pn,sr=new Pn,lr=new Pn,ur=new Pn,hr=new Pn,function(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new Pn);var n,i,r=this.a,a=this.b,o=this.c;ar.subVectors(a,r),or.subVectors(o,r),lr.subVectors(e,r);var s=ar.dot(lr),l=or.dot(lr);if(s<=0&&l<=0)return t.copy(r);ur.subVectors(e,a);var u=ar.dot(ur),h=or.dot(ur);if(0<=u&&h<=u)return t.copy(a);var c=s*h-u*l;if(c<=0&&0<=s&&u<=0)return n=s/(s-u),t.copy(r).addScaledVector(ar,n);hr.subVectors(e,o);var d=ar.dot(hr),f=or.dot(hr);if(0<=f&&d<=f)return t.copy(o);var p=d*l-s*f;if(p<=0&&0<=l&&f<=0)return i=l/(l-f),t.copy(r).addScaledVector(or,i);var m=u*f-d*h;if(m<=0&&0<=h-u&&0<=d-f)return sr.subVectors(o,a),i=(h-u)/(h-u+(d-f)),t.copy(a).addScaledVector(sr,i);var v=1/(m+p+c);return n=p*v,i=c*v,t.copy(r).addScaledVector(ar,n).addScaledVector(or,i)}),equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}});var wr,Mr,Tr,Er={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};function Sr(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}function Ar(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 Lr(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Ir(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}function kr(e,t,n,i,r,a){this.a=e,this.b=t,this.c=n,this.normal=i&&i.isVector3?i:new Pn,this.vertexNormals=(0,Ge.default)(i)?i:[],this.color=r&&r.isColor?r:new Sr,this.vertexColors=(0,Ge.default)(r)?r:[],this.materialIndex=void 0!==a?a:0}(0,p.default)(Sr.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){if(e=kn.euclideanModulo(e,1),t=kn.clamp(t,0,1),n=kn.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{var i=n<=.5?n*(1+t):n+t-n*t,r=2*n-i;this.r=Ar(r,i,e+1/3),this.g=Ar(r,i,e),this.b=Ar(r,i,e-1/3)}return this},setStyle:function(t){function e(e){void 0!==e&&(0,he.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 i,r=n[1],a=n[2];switch(r){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,(0,c.default)(i[1],10))/255,this.g=Math.min(255,(0,c.default)(i[2],10))/255,this.b=Math.min(255,(0,c.default)(i[3],10))/255,e(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,(0,c.default)(i[1],10))/100,this.g=Math.min(100,(0,c.default)(i[2],10))/100,this.b=Math.min(100,(0,c.default)(i[3],10))/100,e(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=(0,he.default)(i[1])/360,s=(0,c.default)(i[2],10)/100,l=(0,c.default)(i[3],10)/100;return e(i[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,c.default)(u.charAt(0)+u.charAt(0),16)/255,this.g=(0,c.default)(u.charAt(1)+u.charAt(1),16)/255,this.b=(0,c.default)(u.charAt(2)+u.charAt(2),16)/255,this;if(6===h)return this.r=(0,c.default)(u.charAt(0)+u.charAt(1),16)/255,this.g=(0,c.default)(u.charAt(2)+u.charAt(3),16)/255,this.b=(0,c.default)(u.charAt(4)+u.charAt(5),16)/255,this}return t&&0<t.length&&(u=Er[t],void 0!==u?this.setHex(u):console.warn("THREE.Color: Unknown color "+t)),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=Lr(e.r),this.g=Lr(e.g),this.b=Lr(e.b),this},copyLinearToSRGB:function(e){return this.r=Ir(e.r),this.g=Ir(e.g),this.b=Ir(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(){return("000000"+this.getHex().toString(16)).slice(-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,i=this.r,r=this.g,a=this.b,o=Math.max(i,r,a),s=Math.min(i,r,a),l=(s+o)/2;if(s===o)t=0,n=0;else{var u=o-s;switch(n=l<=.5?u/(o+s):u/(2-o-s),o){case i:t=(r-a)/u+(r<a?6:0);break;case r:t=(a-i)/u+2;break;case a:t=(i-r)/u+4}t/=6}return e.h=t,e.s=n,e.l=l,e},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:(Tr={},function(e,t,n){return this.getHSL(Tr),Tr.h+=e,Tr.s+=t,Tr.l+=n,this.setHSL(Tr.h,Tr.s,Tr.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:(wr={h:0,s:0,l:0},Mr={h:0,s:0,l:0},function(e,t){this.getHSL(wr),e.getHSL(Mr);var n=kn.lerp(wr.h,Mr.h,t),i=kn.lerp(wr.s,Mr.s,t),r=kn.lerp(wr.l,Mr.l,t);return this.setHSL(n,i,r),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()}}),(0,p.default)(kr.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 Rr=0;function Nr(){(0,g.default)(this,"id",{value:Rr++}),this.uuid=kn.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=ve,this.side=B,this.flatShading=!1,this.vertexTangents=!1,this.vertexColors=A,this.opacity=1,this.transparent=!1,this.blendSrc=U,this.blendDst=V,this.blendEquation=be,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Ee,this.depthTest=!0,this.depthWrite=!0,this.stencilFunc=Mn,this.stencilRef=0,this.stencilMask=255,this.stencilFail=un,this.stencilZFail=un,this.stencilZPass=un,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.userData={},this.needsUpdate=!0}function Pr(e){Nr.call(this),this.type="MeshBasicMaterial",this.color=new Sr(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=X,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.lights=!1,this.setValues(e)}function Cr(e,t,n){if((0,Ge.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.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function Dr(e,t,n){Cr.call(this,new Int8Array(e),t,n)}function Or(e,t,n){Cr.call(this,new Uint8Array(e),t,n)}function Fr(e,t,n){Cr.call(this,new Uint8ClampedArray(e),t,n)}function Br(e,t,n){Cr.call(this,new Int16Array(e),t,n)}function Gr(e,t,n){Cr.call(this,new Uint16Array(e),t,n)}function zr(e,t,n){Cr.call(this,new Int32Array(e),t,n)}function Ur(e,t,n){Cr.call(this,new Uint32Array(e),t,n)}function Vr(e,t,n){Cr.call(this,new Float32Array(e),t,n)}function Hr(e,t,n){Cr.call(this,new Float64Array(e),t,n)}function jr(){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 Wr(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,i=e.length;n<i;++n)e[n]>t&&(t=e[n]);return t}Nr.prototype=(0,p.default)((0,l.default)(h.prototype),{constructor:Nr,isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n)if("shading"!==t){var i=this[t];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===E;else 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={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function i(e){var t=[];for(var n in e){var i=e[n];delete i.metadata,t.push(i)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearCoat&&(n.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(n.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,n.reflectivity=this.reflectivity,n.refractionRatio=this.refractionRatio,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==ve&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),this.side!==B&&(n.side=this.side),this.vertexColors!==A&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.stencilWrite=this.stencilWrite,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilMask=this.stencilMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),0<this.alphaTest&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),1<this.wireframeLinewidth&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),"{}"!==(0,v.default)(this.userData)&&(n.userData=this.userData),t){var r=i(e.textures),a=i(e.images);0<r.length&&(n.textures=r),0<a.length&&(n.images=a)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.lights=e.lights,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.stencilWrite=e.stencilWrite,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilMask=e.stencilMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,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.userData=JSON.parse((0,v.default)(e.userData)),this.clipShadows=e.clipShadows,this.clipIntersection=e.clipIntersection;var t=e.clippingPlanes,n=null;if(null!==t){var i=t.length;n=new Array(i);for(var r=0;r!==i;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.shadowSide=e.shadowSide,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Pr.prototype=(0,l.default)(Nr.prototype),Pr.prototype.constructor=Pr,Pr.prototype.isMeshBasicMaterial=!0,Pr.prototype.copy=function(e){return Nr.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,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},(0,g.default)(Cr.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),(0,p.default)(Cr.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setArray:function(e){if((0,Ge.default)(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==e?e.length/this.itemSize:0,this.array=e,this},setDynamic:function(e){return this.dynamic=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.dynamic=e.dynamic,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var a=e[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),a=new Sr),t[n++]=a.r,t[n++]=a.g,t[n++]=a.b}return this},copyVector2sArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var a=e[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),a=new Rn),t[n++]=a.x,t[n++]=a.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var a=e[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),a=new Pn),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var a=e[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),a=new Zn),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n++]=a.w}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,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this},setXYZW:function(e,t,n,i,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,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:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),Dr.prototype=(0,l.default)(Cr.prototype),Dr.prototype.constructor=Dr,Or.prototype=(0,l.default)(Cr.prototype),Or.prototype.constructor=Or,Fr.prototype=(0,l.default)(Cr.prototype),Fr.prototype.constructor=Fr,Br.prototype=(0,l.default)(Cr.prototype),Br.prototype.constructor=Br,Gr.prototype=(0,l.default)(Cr.prototype),Gr.prototype.constructor=Gr,zr.prototype=(0,l.default)(Cr.prototype),zr.prototype.constructor=zr,Ur.prototype=(0,l.default)(Cr.prototype),Ur.prototype.constructor=Ur,Vr.prototype=(0,l.default)(Cr.prototype),Vr.prototype.constructor=Vr,Hr.prototype=(0,l.default)(Cr.prototype),Hr.prototype.constructor=Hr,(0,p.default)(jr.prototype,{computeGroups:function(e){for(var t,n=[],i=void 0,r=e.faces,a=0;a<r.length;a++){var o=r[a];o.materialIndex!==i&&(i=o.materialIndex,void 0!==t&&(t.count=3*a-t.start,n.push(t)),t={start:3*a,materialIndex:i})}void 0!==t&&(t.count=3*a-t.start,n.push(t)),this.groups=n},fromGeometry:function(e){var t,n=e.faces,i=e.vertices,r=e.faceVertexUvs,a=r[0]&&0<r[0].length,o=r[1]&&0<r[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===i.length,v=p.length===i.length;for(0<i.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(i[g.a],i[g.b],i[g.c]);var y=g.vertexNormals;if(3===y.length)this.normals.push(y[0],y[1],y[2]);else{var _=g.normal;this.normals.push(_,_,_)}var x=g.vertexColors;if(3===x.length)this.colors.push(x[0],x[1],x[2]);else{var b=g.color;this.colors.push(b,b,b)}if(!0===a){var w=r[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 Rn,new Rn,new Rn))}!0===o&&(w=r[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 Rn,new Rn,new Rn)));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 E=c[M].vertexNormals[u];h[M].data.push(E.a,E.b,E.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 Yr,qr,Xr,Zr,Jr,Kr,Qr,$r,ea,ta,na,ia,ra,aa,oa,sa,la,ua,ha,ca,da,fa,pa,ma,va,ga,ya,_a,xa,ba=1;function wa(){(0,g.default)(this,"id",{value:ba+=2}),this.uuid=kn.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}function Ma(e,t){pr.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new wa,this.material=void 0!==t?t:new Pr({color:16777215*Math.random()}),this.drawMode=Yt,this.updateMorphTargets()}function Ta(e,t,n,i,r,a,o,s){var l;if(l=t.side===ze?i.intersectTriangle(o,a,r,!0,s):i.intersectTriangle(r,a,o,t.side!==pe,s),null===l)return null;xa.copy(s),xa.applyMatrix4(e.matrixWorld);var u=n.ray.origin.distanceTo(xa);return u<n.near||u>n.far?null:{distance:u,point:xa.clone(),object:e}}function Ea(e,t,n,i,r,a,o,s,l,u,h){sa.fromBufferAttribute(r,l),la.fromBufferAttribute(r,u),ua.fromBufferAttribute(r,h);var c=e.morphTargetInfluences;if(t.morphTargets&&a&&c){fa.set(0,0,0),pa.set(0,0,0),ma.set(0,0,0);for(var d=0,f=a.length;d<f;d++){var p=c[d],m=a[d];0!==p&&(ha.fromBufferAttribute(m,l),ca.fromBufferAttribute(m,u),da.fromBufferAttribute(m,h),fa.addScaledVector(ha.sub(sa),p),pa.addScaledVector(ca.sub(la),p),ma.addScaledVector(da.sub(ua),p))}sa.add(fa),la.add(pa),ua.add(ma)}var v=Ta(e,t,n,i,sa,la,ua,_a);if(v){o&&(va.fromBufferAttribute(o,l),ga.fromBufferAttribute(o,u),ya.fromBufferAttribute(o,h),v.uv=br.getUV(_a,sa,la,ua,va,ga,ya,new Rn)),s&&(va.fromBufferAttribute(s,l),ga.fromBufferAttribute(s,u),ya.fromBufferAttribute(s,h),v.uv2=br.getUV(_a,sa,la,ua,va,ga,ya,new Rn));var g=new kr(l,u,h);br.getNormal(sa,la,ua,g.normal),v.face=g}return v}wa.prototype=(0,p.default)((0,l.default)(h.prototype),{constructor:wa,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){(0,Ge.default)(e)?this.index=new(65535<Wr(e)?Ur:Gr)(e,1):this.index=e},addAttribute:function(e,t,n){return t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?("index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t)):this.attributes[e]=t,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(e,new Cr(arguments[1],n)))},getAttribute:function(e){return this.attributes[e]},removeAttribute: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},applyMatrix:function(e){var t=this.attributes.position;void 0!==t&&(e.applyToBufferAttribute(t),t.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var i=(new Cn).getNormalMatrix(e);i.applyToBufferAttribute(n),n.needsUpdate=!0}var r=this.attributes.tangent;return void 0!==r&&(i=(new Cn).getNormalMatrix(e),i.applyToBufferAttribute(r),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:(ia=new Qn,function(e){return ia.makeRotationX(e),this.applyMatrix(ia),this}),rotateY:(na=new Qn,function(e){return na.makeRotationY(e),this.applyMatrix(na),this}),rotateZ:(ta=new Qn,function(e){return ta.makeRotationZ(e),this.applyMatrix(ta),this}),translate:(ea=new Qn,function(e,t,n){return ea.makeTranslation(e,t,n),this.applyMatrix(ea),this}),scale:($r=new Qn,function(e,t,n){return $r.makeScale(e,t,n),this.applyMatrix($r),this}),lookAt:(Qr=new pr,function(e){Qr.lookAt(e),Qr.updateMatrix(),this.applyMatrix(Qr.matrix)}),center:(Kr=new Pn,function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Kr).negate(),this.translate(Kr.x,Kr.y,Kr.z),this}),setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new Vr(3*t.vertices.length,3),i=new Vr(3*t.colors.length,3);if(this.addAttribute("position",n.copyVector3sArray(t.vertices)),this.addAttribute("color",i.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var r=new Vr(t.lineDistances.length,1);this.addAttribute("lineDistance",r.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,i=e.length;n<i;n++){var r=e[n];t.push(r.x,r.y,r.z||0)}return this.addAttribute("position",new Vr(t,3)),this},updateFromObject:function(e){var t,n=e.geometry;if(e.isMesh){var i=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(i=void 0,n.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(n);i.verticesNeedUpdate=n.verticesNeedUpdate,i.normalsNeedUpdate=n.normalsNeedUpdate,i.colorsNeedUpdate=n.colorsNeedUpdate,i.uvsNeedUpdate=n.uvsNeedUpdate,i.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=i}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 jr).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.addAttribute("position",new Cr(t,3).copyVector3sArray(e.vertices)),0<e.normals.length){var n=new Float32Array(3*e.normals.length);this.addAttribute("normal",new Cr(n,3).copyVector3sArray(e.normals))}if(0<e.colors.length){var i=new Float32Array(3*e.colors.length);this.addAttribute("color",new Cr(i,3).copyColorsArray(e.colors))}if(0<e.uvs.length){var r=new Float32Array(2*e.uvs.length);this.addAttribute("uv",new Cr(r,2).copyVector2sArray(e.uvs))}if(0<e.uvs2.length){var a=new Float32Array(2*e.uvs2.length);this.addAttribute("uv2",new Cr(a,2).copyVector2sArray(e.uvs2))}for(var o in this.groups=e.groups,e.morphTargets){for(var s=[],l=e.morphTargets[o],u=0,h=l.length;u<h;u++){var c=l[u],d=new Vr(3*c.data.length,3);d.name=c.name,s.push(d.copyVector3sArray(c.data))}this.morphAttributes[o]=s}if(0<e.skinIndices.length){var f=new Vr(4*e.skinIndices.length,4);this.addAttribute("skinIndex",f.copyVector4sArray(e.skinIndices))}if(0<e.skinWeights.length){var p=new Vr(4*e.skinWeights.length,4);this.addAttribute("skinWeight",p.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:(Jr=new vr,function(){null===this.boundingBox&&(this.boundingBox=new vr);var e=this.attributes.position,t=this.morphAttributes.position;if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(var n=0,i=t.length;n<i;n++){var r=t[n];Jr.setFromBufferAttribute(r),this.boundingBox.expandByPoint(Jr.min),this.boundingBox.expandByPoint(Jr.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:(qr=new vr,Xr=new vr,Zr=new Pn,function(){null===this.boundingSphere&&(this.boundingSphere=new _r);var e=this.attributes.position,t=this.morphAttributes.position;if(e){var n=this.boundingSphere.center;if(qr.setFromBufferAttribute(e),t)for(var i=0,r=t.length;i<r;i++){var a=t[i];Xr.setFromBufferAttribute(a),qr.expandByPoint(Xr.min),qr.expandByPoint(Xr.max)}qr.getCenter(n);var o=0;for(i=0,r=e.count;i<r;i++)Zr.fromBufferAttribute(e,i),o=Math.max(o,n.distanceToSquared(Zr));if(t)for(i=0,r=t.length;i<r;i++){a=t[i];for(var s=0,l=a.count;s<l;s++)Zr.fromBufferAttribute(a,s),o=Math.max(o,n.distanceToSquared(Zr))}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.addAttribute("normal",new Cr(new Float32Array(n.length),3));else for(var i=t.normal.array,r=0,a=i.length;r<a;r++)i[r]=0;var o,s,l,u=t.normal.array,h=new Pn,c=new Pn,d=new Pn,f=new Pn,p=new Pn;if(e){var m=e.array;for(r=0,a=e.count;r<a;r+=3)o=3*m[r+0],s=3*m[r+1],l=3*m[r+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(r=0,a=n.length;r<a;r+=9)h.fromArray(n,r),c.fromArray(n,r+3),d.fromArray(n,r+6),f.subVectors(d,c),p.subVectors(h,c),f.cross(p),u[r]=f.x,u[r+1]=f.y,u[r+2]=f.z,u[r+3]=f.x,u[r+4]=f.y,u[r+5]=f.z,u[r+6]=f.x,u[r+7]=f.y,u[r+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=this.attributes;for(var i in n)if(void 0!==e.attributes[i])for(var r=n[i],a=r.array,o=e.attributes[i],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:(Yr=new Pn,function(){for(var e=this.attributes.normal,t=0,n=e.count;t<n;t++)Yr.x=e.getX(t),Yr.y=e.getY(t),Yr.z=e.getZ(t),Yr.normalize(),e.setXYZ(t,Yr.x,Yr.y,Yr.z)}),toNonIndexed:function(){function e(e,t){for(var n=e.array,i=e.itemSize,r=new n.constructor(t.length*i),a=0,o=0,s=0,l=t.length;s<l;s++){a=t[s]*i;for(var u=0;u<i;u++)r[o++]=n[a++]}return new Cr(r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new wa,n=this.index.array,i=this.attributes;for(var r in i){var a=i[r],o=e(a,n);t.addAttribute(r,o)}var s=this.morphAttributes;for(r in s){for(var l=[],u=s[r],h=0,c=u.length;h<c;h++)a=u[h],o=e(a,n),l.push(o);t.morphAttributes[r]=l}for(var d=this.groups,f=(h=0,d.length);h<f;h++){var p=d[h];t.addGroup(p.start,p.count,p.materialIndex)}return t},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,m.default)(this.userData).length&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var i=this.index;null!==i&&(e.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});var r=this.attributes;for(var n in r){var a=r[n],o=a.toJSON();""!==a.name&&(o.name=a.name),e.data.attributes[n]=o}var s={},l=!1;for(var n in this.morphAttributes){for(var u=this.morphAttributes[n],h=[],c=0,d=u.length;c<d;c++)a=u[c],o=a.toJSON(),""!==a.name&&(o.name=a.name),h.push(o);0<h.length&&(s[n]=h,l=!0)}l&&(e.data.morphAttributes=s);var f=this.groups;0<f.length&&(e.data.groups=JSON.parse((0,v.default)(f)));var p=this.boundingSphere;return null!==p&&(e.data.boundingSphere={center:p.center.toArray(),radius:p.radius}),e},clone:function(){return(new wa).copy(this)},copy:function(e){var t,n,i;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var r=e.index;null!==r&&this.setIndex(r.clone());var a=e.attributes;for(t in a){var o=a[t];this.addAttribute(t,o.clone())}var s=e.morphAttributes;for(t in s){var l=[],u=s[t];for(n=0,i=u.length;n<i;n++)l.push(u[n].clone());this.morphAttributes[t]=l}var h=e.groups;for(n=0,i=h.length;n<i;n++){var c=h[n];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"})}}),Ma.prototype=(0,p.default)((0,l.default)(pr.prototype),{constructor:Ma,isMesh:!0,setDrawMode:function(e){this.drawMode=e},copy:function(e){return pr.prototype.copy.call(this,e),this.drawMode=e.drawMode,void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=(0,p.default)({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e,t,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,a=(0,m.default)(r);if(0<a.length){var o=r[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=i.morphTargets;void 0!==s&&0<s.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:(ra=new Qn,aa=new xr,oa=new _r,sa=new Pn,la=new Pn,ua=new Pn,ha=new Pn,ca=new Pn,da=new Pn,fa=new Pn,pa=new Pn,ma=new Pn,va=new Rn,ga=new Rn,ya=new Rn,_a=new Pn,xa=new Pn,function(e,t){var n,i=this.geometry,r=this.material,a=this.matrixWorld;if(void 0!==r&&(null===i.boundingSphere&&i.computeBoundingSphere(),oa.copy(i.boundingSphere),oa.applyMatrix4(a),!1!==e.ray.intersectsSphere(oa)&&(ra.getInverse(a),aa.copy(e.ray).applyMatrix4(ra),null===i.boundingBox||!1!==aa.intersectsBox(i.boundingBox))))if(i.isBufferGeometry){var o,s,l,u,h,c,d,f,p,m,v,g=i.index,y=i.attributes.position,_=i.morphAttributes.position,x=i.attributes.uv,b=i.attributes.uv2,w=i.groups,M=i.drawRange;if(null!==g)if((0,Ge.default)(r))for(u=0,c=w.length;u<c;u++)for(f=w[u],p=r[f.materialIndex],m=Math.max(f.start,M.start),v=Math.min(f.start+f.count,M.start+M.count),h=m,d=v;h<d;h+=3)o=g.getX(h),s=g.getX(h+1),l=g.getX(h+2),n=Ea(this,p,e,aa,y,_,x,b,o,s,l),n&&(n.faceIndex=Math.floor(h/3),n.face.materialIndex=f.materialIndex,t.push(n));else for(m=Math.max(0,M.start),v=Math.min(g.count,M.start+M.count),u=m,c=v;u<c;u+=3)o=g.getX(u),s=g.getX(u+1),l=g.getX(u+2),n=Ea(this,r,e,aa,y,_,x,b,o,s,l),n&&(n.faceIndex=Math.floor(u/3),t.push(n));else if(void 0!==y)if((0,Ge.default)(r))for(u=0,c=w.length;u<c;u++)for(f=w[u],p=r[f.materialIndex],m=Math.max(f.start,M.start),v=Math.min(f.start+f.count,M.start+M.count),h=m,d=v;h<d;h+=3)o=h,s=h+1,l=h+2,n=Ea(this,p,e,aa,y,_,x,b,o,s,l),n&&(n.faceIndex=Math.floor(h/3),n.face.materialIndex=f.materialIndex,t.push(n));else for(m=Math.max(0,M.start),v=Math.min(y.count,M.start+M.count),u=m,c=v;u<c;u+=3)o=u,s=u+1,l=u+2,n=Ea(this,r,e,aa,y,_,x,b,o,s,l),n&&(n.faceIndex=Math.floor(u/3),t.push(n))}else if(i.isGeometry){var T,E,S,A,L=(0,Ge.default)(r),I=i.vertices,k=i.faces,R=i.faceVertexUvs[0];0<R.length&&(A=R);for(var N=0,P=k.length;N<P;N++){var C=k[N],D=L?r[C.materialIndex]:r;if(void 0!==D&&(T=I[C.a],E=I[C.b],S=I[C.c],n=Ta(this,D,e,aa,T,E,S,_a),n)){if(A&&A[N]){var O=A[N];va.copy(O[0]),ga.copy(O[1]),ya.copy(O[2]),n.uv=br.getUV(_a,T,E,S,va,ga,ya,new Rn)}n.face=C,n.faceIndex=N,t.push(n)}}}}),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Sa,Aa,La,Ia,ka,Ra,Na,Pa=0;function Ca(){(0,g.default)(this,"id",{value:Pa+=2}),this.uuid=kn.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}function Da(e,t,n,i,r,a){Ca.call(this),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:r,depthSegments:a},this.fromBufferGeometry(new Oa(e,t,n,i,r,a)),this.mergeVertices()}function Oa(e,t,n,i,r,a){wa.call(this),this.type="BoxBufferGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:r,depthSegments:a};var I=this;e=e||1,t=t||1,n=n||1,i=Math.floor(i)||1,r=Math.floor(r)||1,a=Math.floor(a)||1;var k=[],R=[],N=[],P=[],C=0,D=0;function o(e,t,n,i,r,a,o,s,l,u,h){var c,d,f=a/l,p=o/u,m=a/2,v=o/2,g=s/2,y=l+1,_=u+1,x=0,b=0,w=new Pn;for(d=0;d<_;d++){var M=d*p-v;for(c=0;c<y;c++){var T=c*f-m;w[e]=T*i,w[t]=M*r,w[n]=g,R.push(w.x,w.y,w.z),w[e]=0,w[t]=0,w[n]=0<s?1:-1,N.push(w.x,w.y,w.z),P.push(c/l),P.push(1-d/u),x+=1}}for(d=0;d<u;d++)for(c=0;c<l;c++){var E=C+c+y*d,S=C+c+y*(d+1),A=C+(c+1)+y*(d+1),L=C+(c+1)+y*d;k.push(E,S,L),k.push(S,A,L),b+=6}I.addGroup(D,b,h),D+=b,C+=x}o("z","y","x",-1,-1,n,t,e,a,r,0),o("z","y","x",1,-1,n,t,-e,a,r,1),o("x","z","y",1,1,e,n,t,i,a,2),o("x","z","y",1,-1,e,n,-t,i,a,3),o("x","y","z",1,-1,e,t,n,i,r,4),o("x","y","z",-1,-1,e,t,-n,i,r,5),this.setIndex(k),this.addAttribute("position",new Vr(R,3)),this.addAttribute("normal",new Vr(N,3)),this.addAttribute("uv",new Vr(P,2))}function Fa(e){var t={};for(var n in e)for(var i in t[n]={},e[n]){var r=e[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?t[n][i]=r.clone():(0,Ge.default)(r)?t[n][i]=r.slice():t[n][i]=r}return t}function Ba(e){for(var t={},n=0;n<e.length;n++){var i=Fa(e[n]);for(var r in i)t[r]=i[r]}return t}Ca.prototype=(0,p.default)((0,l.default)(h.prototype),{constructor:Ca,isGeometry:!0,applyMatrix:function(e){for(var t=(new Cn).getNormalMatrix(e),n=0,i=this.vertices.length;n<i;n++){var r=this.vertices[n];r.applyMatrix4(e)}for(n=0,i=this.faces.length;n<i;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:(Na=new Qn,function(e){return Na.makeRotationX(e),this.applyMatrix(Na),this}),rotateY:(Ra=new Qn,function(e){return Ra.makeRotationY(e),this.applyMatrix(Ra),this}),rotateZ:(ka=new Qn,function(e){return ka.makeRotationZ(e),this.applyMatrix(ka),this}),translate:(Ia=new Qn,function(e,t,n){return Ia.makeTranslation(e,t,n),this.applyMatrix(Ia),this}),scale:(La=new Qn,function(e,t,n){return La.makeScale(e,t,n),this.applyMatrix(La),this}),lookAt:(Aa=new pr,function(e){Aa.lookAt(e),Aa.updateMatrix(),this.applyMatrix(Aa.matrix)}),fromBufferGeometry:function(e){var s=this,t=null!==e.index?e.index.array:void 0,n=e.attributes,i=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 r=0;r<i.length;r+=3)s.vertices.push((new Pn).fromArray(i,r)),void 0!==u&&s.colors.push((new Sr).fromArray(u,r));function a(e,t,n,i){var r=void 0===u?[]:[s.colors[e].clone(),s.colors[t].clone(),s.colors[n].clone()],a=void 0===l?[]:[(new Pn).fromArray(l,3*e),(new Pn).fromArray(l,3*t),(new Pn).fromArray(l,3*n)],o=new kr(e,t,n,a,r,i);s.faces.push(o),void 0!==h&&s.faceVertexUvs[0].push([(new Rn).fromArray(h,2*e),(new Rn).fromArray(h,2*t),(new Rn).fromArray(h,2*n)]),void 0!==c&&s.faceVertexUvs[1].push([(new Rn).fromArray(c,2*e),(new Rn).fromArray(c,2*t),(new Rn).fromArray(c,2*n)])}var o=e.groups;if(0<o.length)for(r=0;r<o.length;r++)for(var d=o[r],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(r=0;r<t.length;r+=3)a(t[r],t[r+1],t[r+2]);else for(r=0;r<i.length/3;r+=3)a(r,r+1,r+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:(Sa=new Pn,function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Sa).negate(),this.translate(Sa.x,Sa.y,Sa.z),this}),normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=0===t?1:1/t,i=new Qn;return i.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix(i),this},computeFaceNormals:function(){for(var e=new Pn,t=new Pn,n=0,i=this.faces.length;n<i;n++){var r=this.faces[n],a=this.vertices[r.a],o=this.vertices[r.b],s=this.vertices[r.c];e.subVectors(s,o),t.subVectors(a,o),e.cross(t),e.normalize(),r.normal.copy(e)}},computeVertexNormals:function(e){var t,n,i,r,a,o;for(void 0===e&&(e=!0),o=new Array(this.vertices.length),t=0,n=this.vertices.length;t<n;t++)o[t]=new Pn;if(e){var s,l,u,h=new Pn,c=new Pn;for(i=0,r=this.faces.length;i<r;i++)a=this.faces[i],s=this.vertices[a.a],l=this.vertices[a.b],u=this.vertices[a.c],h.subVectors(u,l),c.subVectors(s,l),h.cross(c),o[a.a].add(h),o[a.b].add(h),o[a.c].add(h)}else for(this.computeFaceNormals(),i=0,r=this.faces.length;i<r;i++)a=this.faces[i],o[a.a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(t=0,n=this.vertices.length;t<n;t++)o[t].normalize();for(i=0,r=this.faces.length;i<r;i++){a=this.faces[i];var d=a.vertexNormals;3===d.length?(d[0].copy(o[a.a]),d[1].copy(o[a.b]),d[2].copy(o[a.c])):(d[0]=o[a.a].clone(),d[1]=o[a.b].clone(),d[2]=o[a.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 i=n.vertexNormals;3===i.length?(i[0].copy(n.normal),i[1].copy(n.normal),i[2].copy(n.normal)):(i[0]=n.normal.clone(),i[1]=n.normal.clone(),i[2]=n.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,n,i,r;for(n=0,i=this.faces.length;n<i;n++)for(r=this.faces[n],r.__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),e=0,t=r.vertexNormals.length;e<t;e++)r.__originalVertexNormals[e]?r.__originalVertexNormals[e].copy(r.vertexNormals[e]):r.__originalVertexNormals[e]=r.vertexNormals[e].clone();var a=new Ca;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=[];var o=this.morphNormals[e].faceNormals,s=this.morphNormals[e].vertexNormals;for(n=0,i=this.faces.length;n<i;n++)l=new Pn,u={a:new Pn,b:new Pn,c:new Pn},o.push(l),s.push(u)}var l,u,h=this.morphNormals[e];for(a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals(),n=0,i=this.faces.length;n<i;n++)r=this.faces[n],l=h.faceNormals[n],u=h.vertexNormals[n],l.copy(r.normal),u.a.copy(r.vertexNormals[0]),u.b.copy(r.vertexNormals[1]),u.c.copy(r.vertexNormals[2])}for(n=0,i=this.faces.length;n<i;n++)r=this.faces[n],r.normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new vr),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new _r),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(e&&e.isGeometry){var i,r=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&&(i=(new Cn).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,y=l[c],_=y.vertexNormals,x=y.vertexColors;m=new kr(y.a+r,y.b+r,y.c+r),m.normal.copy(y.normal),void 0!==i&&m.normal.applyMatrix3(i).normalize();for(var b=0,w=_.length;b<w;b++)v=_[b].clone(),void 0!==i&&v.applyMatrix3(i).normalize(),m.vertexNormals.push(v);for(m.color.copy(y.color),b=0,w=x.length;b<w;b++)g=x[b],m.vertexColors.push(g.clone());m.materialIndex=y.materialIndex+n,s.push(m)}for(c=0,d=e.faceVertexUvs.length;c<d;c++){var M=e.faceVertexUvs[c];for(void 0===this.faceVertexUvs[c]&&(this.faceVertexUvs[c]=[]),b=0,w=M.length;b<w;b++){for(var T=M[b],E=[],S=0,A=T.length;S<A;S++)E.push(T[S].clone());this.faceVertexUvs[c].push(E)}}}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(){var e,t,n,i,r,a,o,s,l={},u=[],h=[],c=4,d=Math.pow(10,c);for(n=0,i=this.vertices.length;n<i;n++)e=this.vertices[n],t=Math.round(e.x*d)+"_"+Math.round(e.y*d)+"_"+Math.round(e.z*d),void 0===l[t]?(l[t]=n,u.push(this.vertices[n]),h[n]=u.length-1):h[n]=h[l[t]];var f=[];for(n=0,i=this.faces.length;n<i;n++){r=this.faces[n],r.a=h[r.a],r.b=h[r.b],r.c=h[r.c],a=[r.a,r.b,r.c];for(var p=0;p<3;p++)if(a[p]===a[(p+1)%3]){f.push(n);break}}for(n=f.length-1;0<=n;n--){var m=f[n];for(this.faces.splice(m,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(m,1)}var v=this.vertices.length-u.length;return this.vertices=u,v},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var i=e[t];this.vertices.push(new Pn(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,n=0;n<t;n++)e[n]._id=n;function i(e,t){return e.materialIndex-t.materialIndex}e.sort(i);var r,a,o=this.faceVertexUvs[0],s=this.faceVertexUvs[1];for(o&&o.length===t&&(r=[]),s&&s.length===t&&(a=[]),n=0;n<t;n++){var l=e[n]._id;r&&r.push(o[l]),a&&a.push(s[l])}r&&(this.faceVertexUvs[0]=r),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=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}for(var i=[],r=0;r<this.vertices.length;r++){var a=this.vertices[r];i.push(a.x,a.y,a.z)}var o=[],s=[],l={},u=[],h={},c=[],d={};for(r=0;r<this.faces.length;r++){var f=this.faces[r],p=!0,m=!1,v=void 0!==this.faceVertexUvs[0][r],g=0<f.normal.length(),y=0<f.vertexNormals.length,_=1!==f.color.r||1!==f.color.g||1!==f.color.b,x=0<f.vertexColors.length,b=0;if(b=E(b,0,0),b=E(b,1,p),b=E(b,2,m),b=E(b,3,v),b=E(b,4,g),b=E(b,5,y),b=E(b,6,_),b=E(b,7,x),o.push(b),o.push(f.a,f.b,f.c),o.push(f.materialIndex),v){var w=this.faceVertexUvs[0][r];o.push(L(w[0]),L(w[1]),L(w[2]))}if(g&&o.push(S(f.normal)),y){var M=f.vertexNormals;o.push(S(M[0]),S(M[1]),S(M[2]))}if(_&&o.push(A(f.color)),x){var T=f.vertexColors;o.push(A(T[0]),A(T[1]),A(T[2]))}}function E(e,t,n){return n?e|1<<t:e&~(1<<t)}function S(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 L(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=i,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 Ca).copy(this)},copy:function(e){var t,n,i,r,a,o;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;var s=e.vertices;for(t=0,n=s.length;t<n;t++)this.vertices.push(s[t].clone());var l=e.colors;for(t=0,n=l.length;t<n;t++)this.colors.push(l[t].clone());var u=e.faces;for(t=0,n=u.length;t<n;t++)this.faces.push(u[t].clone());for(t=0,n=e.faceVertexUvs.length;t<n;t++){var h=e.faceVertexUvs[t];for(void 0===this.faceVertexUvs[t]&&(this.faceVertexUvs[t]=[]),i=0,r=h.length;i<r;i++){var c=h[i],d=[];for(a=0,o=c.length;a<o;a++){var f=c[a];d.push(f.clone())}this.faceVertexUvs[t].push(d)}}var p=e.morphTargets;for(t=0,n=p.length;t<n;t++){var m={};if(m.name=p[t].name,void 0!==p[t].vertices)for(m.vertices=[],i=0,r=p[t].vertices.length;i<r;i++)m.vertices.push(p[t].vertices[i].clone());if(void 0!==p[t].normals)for(m.normals=[],i=0,r=p[t].normals.length;i<r;i++)m.normals.push(p[t].normals[i].clone());this.morphTargets.push(m)}var v=e.morphNormals;for(t=0,n=v.length;t<n;t++){var g={};if(void 0!==v[t].vertexNormals)for(g.vertexNormals=[],i=0,r=v[t].vertexNormals.length;i<r;i++){var y=v[t].vertexNormals[i],_={};_.a=y.a.clone(),_.b=y.b.clone(),_.c=y.c.clone(),g.vertexNormals.push(_)}if(void 0!==v[t].faceNormals)for(g.faceNormals=[],i=0,r=v[t].faceNormals.length;i<r;i++)g.faceNormals.push(v[t].faceNormals[i].clone());this.morphNormals.push(g)}var x=e.skinWeights;for(t=0,n=x.length;t<n;t++)this.skinWeights.push(x[t].clone());var b=e.skinIndices;for(t=0,n=b.length;t<n;t++)this.skinIndices.push(b[t].clone());var w=e.lineDistances;for(t=0,n=w.length;t<n;t++)this.lineDistances.push(w[t]);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"})}}),Da.prototype=(0,l.default)(Ca.prototype),Da.prototype.constructor=Da,Oa.prototype=(0,l.default)(wa.prototype),Oa.prototype.constructor=Oa;var Ga={clone:Fa,merge:Ba};t.UniformsUtils=Ga;var za="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",Ua="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";function Va(e){Nr.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=za,this.fragmentShader=Ua,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 Ha(){pr.call(this),this.type="Camera",this.matrixWorldInverse=new Qn,this.projectionMatrix=new Qn,this.projectionMatrixInverse=new Qn}function ja(e,t,n,i){Ha.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!==i?i:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}Va.prototype=(0,l.default)(Nr.prototype),Va.prototype.constructor=Va,Va.prototype.isShaderMaterial=!0,Va.prototype.copy=function(e){return Nr.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Fa(e.uniforms),this.defines=(0,p.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},Va.prototype.toJSON=function(e){var t=Nr.prototype.toJSON.call(this,e);for(var n in t.uniforms={},this.uniforms){var i=this.uniforms[n],r=i.value;r&&r.isTexture?t.uniforms[n]={type:"t",value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:"m4",value:r.toArray()}:t.uniforms[n]={value:r}}0<(0,m.default)(this.defines).length&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var a={};for(var o in this.extensions)!0===this.extensions[o]&&(a[o]=!0);return 0<(0,m.default)(a).length&&(t.extensions=a),t},Ha.prototype=(0,p.default)((0,l.default)(pr.prototype),{constructor:Ha,isCamera:!0,copy:function(e,t){return pr.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 Pn),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){pr.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),ja.prototype=(0,p.default)((0,l.default)(Ha.prototype),{constructor:ja,isPerspectiveCamera:!0,copy:function(e,t){return Ha.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,p.default)({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*kn.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*kn.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*kn.RAD2DEG*Math.atan(Math.tan(.5*kn.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,i,r,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=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*kn.DEG2RAD*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;r+=a.offsetX*i/o,t-=a.offsetY*n/s,i*=a.width/o,n*=a.height/s}var l=this.filmOffset;0!==l&&(r+=e*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,e,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=pr.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,p.default)({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}});var Wa,Ya,qa,Xa,Za,Ja,Ka,Qa,$a=90,eo=1;function to(e,t,n,i){pr.call(this),this.type="CubeCamera";var a=new ja($a,eo,e,t);a.up.set(0,-1,0),a.lookAt(new Pn(1,0,0)),this.add(a);var o=new ja($a,eo,e,t);o.up.set(0,-1,0),o.lookAt(new Pn(-1,0,0)),this.add(o);var s=new ja($a,eo,e,t);s.up.set(0,0,1),s.lookAt(new Pn(0,1,0)),this.add(s);var l=new ja($a,eo,e,t);l.up.set(0,0,-1),l.lookAt(new Pn(0,-1,0)),this.add(l);var u=new ja($a,eo,e,t);u.up.set(0,-1,0),u.lookAt(new Pn(0,0,1)),this.add(u);var h=new ja($a,eo,e,t);h.up.set(0,-1,0),h.lookAt(new Pn(0,0,-1)),this.add(h),i=i||{format:ot,magFilter:Ve,minFilter:Ve},this.renderTarget=new no(n,n,i),this.renderTarget.texture.name="CubeCamera",this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var n=e.getRenderTarget(),i=this.renderTarget,r=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,a),e.setRenderTarget(i,1),e.render(t,o),e.setRenderTarget(i,2),e.render(t,s),e.setRenderTarget(i,3),e.render(t,l),e.setRenderTarget(i,4),e.render(t,u),i.texture.generateMipmaps=r,e.setRenderTarget(i,5),e.render(t,h),e.setRenderTarget(n)},this.clear=function(e,t,n,i){for(var r=e.getRenderTarget(),a=this.renderTarget,o=0;o<6;o++)e.setRenderTarget(a,o),e.clear(t,n,i);e.setRenderTarget(r)}}function no(e,t,n){Jn.call(this,e,t,n)}function io(e,t,n,i,r,a,o,s,l,u,h,c){Xn.call(this,null,a,o,s,l,u,i,r,h,c),this.image={data:e,width:t,height:n},this.magFilter=void 0!==l?l:Ce,this.minFilter=void 0!==u?u:Ce,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function ro(e,t){this.normal=void 0!==e?e:new Pn(1,0,0),this.constant=void 0!==t?t:0}function ao(e,t,n,i,r,a){this.planes=[void 0!==e?e:new ro,void 0!==t?t:new ro,void 0!==n?n:new ro,void 0!==i?i:new ro,void 0!==r?r:new ro,void 0!==a?a:new ro]}to.prototype=(0,l.default)(pr.prototype),to.prototype.constructor=to,no.prototype=(0,l.default)(Jn.prototype),no.prototype.constructor=no,no.prototype.isWebGLRenderTargetCube=!0,no.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=t.format,this.texture.encoding=t.encoding;var n=new mr,i={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")},r=new Va({type:"CubemapFromEquirect",uniforms:Fa(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:ze,blending:me});r.uniforms.tEquirect.value=t;var a=new Ma(new Oa(5,5,5),r);n.add(a);var o=new to(1,10,1);return o.renderTarget=this,o.renderTarget.texture.name="CubeCameraTexture",o.update(e,n),a.geometry.dispose(),a.material.dispose(),this},io.prototype=(0,l.default)(Xn.prototype),io.prototype.constructor=io,io.prototype.isDataTexture=!0,(0,p.default)(ro.prototype,{isPlane:!0,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:(Xa=new Pn,Za=new Pn,function(e,t,n){var i=Xa.subVectors(n,t).cross(Za.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,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 Pn),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:(qa=new Pn,function(e,t){void 0===t&&(console.warn("THREE.Plane: .intersectLine() target is now required"),t=new Pn);var n=e.delta(qa),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(e.start)?t.copy(e.start):void 0;var r=-(e.start.dot(this.normal)+this.constant)/i;return r<0||1<r?void 0:t.copy(n).multiplyScalar(r).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 Pn),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:(Wa=new Pn,Ya=new Cn,function(e,t){var n=t||Ya.getNormalMatrix(e),i=this.coplanarPoint(Wa).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),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}}),(0,p.default)(ao.prototype,{set:function(e,t,n,i,r,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(i),o[4].copy(r),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},setFromMatrix:function(e){var t=this.planes,n=e.elements,i=n[0],r=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-i,h-s,p-c,y-m).normalize(),t[1].setComponents(o+i,h+s,p+c,y+m).normalize(),t[2].setComponents(o+r,h+l,p+d,y+v).normalize(),t[3].setComponents(o-r,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:(Qa=new _r,function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Qa.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Qa)}),intersectsSprite:(Ka=new _r,function(e){return Ka.center.set(0,0,0),Ka.radius=.7071067811865476,Ka.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ka)}),intersectsSphere:function(e){for(var t=this.planes,n=e.center,i=-e.radius,r=0;r<6;r++){var a=t[r].distanceToPoint(n);if(a<i)return!1}return!0},intersectsBox:(Ja=new Pn,function(e){for(var t=this.planes,n=0;n<6;n++){var i=t[n];if(Ja.x=0<i.normal.x?e.max.x:e.min.x,Ja.y=0<i.normal.y?e.max.y:e.min.y,Ja.z=0<i.normal.z?e.max.z:e.min.z,i.distanceToPoint(Ja)<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 oo="#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",so="#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",lo="#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",uo="#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( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",ho="#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",co="vec3 transformed = vec3( position );",fo="vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",po="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 GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, 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_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 GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.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}",mo="#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",vo="#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",go="#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",yo="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",_o="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",xo="#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",bo="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",wo="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",Mo="#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",To="#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#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(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}\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};\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}",Eo="#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV( sampler2D envMap, vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif",So="vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = normalMatrix * objectTangent;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",Ao="#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",Lo="#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif",Io="#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",ko="#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",Ro="gl_FragColor = linearToOutputTexel( gl_FragColor );",No="\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 = min( floor( D ) / 255.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}",Po="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, 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_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\tenvColor = envMapTexelToLinear( envColor );\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",Co="#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",Do="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",Oo="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\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",Fo="#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",Bo="#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",Go="#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\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",zo="#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",Uo="#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif",Vo="#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif",Ho="#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",jo="vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = 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\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#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\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#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\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#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\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#endif",Wo="uniform 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\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\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\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\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\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\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",Yo="#if defined( USE_ENVMAP ) && defined( PHYSICAL )\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\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryVec, 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 blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, 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\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent ));\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",qo="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",Xo="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\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\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)",Zo="PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif",Jo="struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#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#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#endif\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#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\tfloat clearCoatInv = 1.0 - clearCoatDHR;\n\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec3 singleScattering = vec3( 0.0 );\n\t\tvec3 multiScattering = vec3( 0.0 );\n\t\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\t\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\t\treflectedLight.indirectSpecular += clearCoatInv * radiance * singleScattering;\n\t\treflectedLight.indirectDiffuse += multiScattering * cosineWeightedIrradiance;\n\t\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n\t#else\n\t\treflectedLight.indirectSpecular += clearCoatInv * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#endif\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\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\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\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}",Ko="\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\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#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearCoatRadiance = vec3( 0.0 );\n#endif",Qo="#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * 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( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), maxMipLevel );\n\t#ifndef STANDARD\n\t\tclearCoatRadiance += getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), maxMipLevel );\n\t#endif\n#endif",$o="#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, irradiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif",es="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",ts="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n#endif",ns="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",is="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\tgl_Position.z *= gl_Position.w;\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",as="#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",os="#ifdef USE_MAP\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif",ss="#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\n#endif",ls="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",us="#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",hs="#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif",cs="#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",ds="#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",fs="#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#endif\n#endif",ps="#ifdef USE_NORMALMAP\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t#ifdef FLIP_SIDED\n\t\t\tnormal = - normal;\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\tnormal = normalize( normalMatrix * normal );\n\t#else\n\t\t#ifdef USE_TANGENT\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy = normalScale * mapN.xy;\n\t\t\tnormal = normalize( vTBN * mapN );\n\t\t#else\n\t\t\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\t\t#endif\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",ms="#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tuniform mat3 normalMatrix;\n\t#else\n\t\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\t\tvec2 st0 = dFdx( vUv.st );\n\t\t\tvec2 st1 = dFdy( vUv.st );\n\t\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\t\tvec3 N = normalize( surf_norm );\n\t\t\tmat3 tsn = mat3( S, T, N );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy *= normalScale;\n\t\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\treturn normalize( tsn * mapN );\n\t\t}\n\t#endif\n#endif",vs="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}\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}",gs="#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",ys="vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;",_s="#if defined( DITHERING )\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",xs="#if defined( 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",bs="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",ws="#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",Ms="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\t float result=0.0;\n\t if(step( compare,unpackRGBAToDepth( texture2D( depths, uv ) )) >=1.0){\n\t result=1.0;\n\t}else{\n\t result = 0.8-unpackRGBAToDepth( texture2D( depths, uv ) );\n\t}\n\t return result;\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\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\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( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, 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( 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 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\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\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\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 )\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",Ts="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif",Es="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif",Ss="float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}",As="#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",Ls="#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",Is="#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",ks="#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",Rs="float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",Ns="#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",Ps="#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",Cs="#ifndef saturate\n\t#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}",Ds="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",Os="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif",Fs="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",Bs="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",Gs="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",zs="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",Us="#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif",Vs="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}",Hs="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}",js="uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",Ws="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}",Ys="#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>\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\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}",qs="#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 <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}",Xs="#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}",Zs="#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}",Js="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}",Ks="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",Qs="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 <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",$s="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\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",el="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_pars_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\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * 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 <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",tl="#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_pars_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}",il="#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}",rl="#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 <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 <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 <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",al="#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 <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 <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}",ol="#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_pars_fragment>\n#include <gradientmap_pars_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\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}",sl="#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}",ll="#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\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_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 <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 <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\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}",ul="#define PHYSICAL\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}",hl="#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_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}",cl="#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_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 <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( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",dl="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 <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",fl="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 = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\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}",pl="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 <fog_fragment>\n}",ml="#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}",vl="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_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 <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}",gl="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 = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\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}",yl={alphamap_fragment:oo,alphamap_pars_fragment:so,alphatest_fragment:lo,aomap_fragment:uo,aomap_pars_fragment:ho,begin_vertex:co,beginnormal_vertex:fo,bsdfs:po,bumpmap_pars_fragment:mo,clipping_planes_fragment:vo,clipping_planes_pars_fragment:go,clipping_planes_pars_vertex:yo,clipping_planes_vertex:_o,color_fragment:xo,color_pars_fragment:bo,color_pars_vertex:wo,color_vertex:Mo,common:To,cube_uv_reflection_fragment:Eo,defaultnormal_vertex:So,displacementmap_pars_vertex:Ao,displacementmap_vertex:Lo,emissivemap_fragment:Io,emissivemap_pars_fragment:ko,encodings_fragment:Ro,encodings_pars_fragment:No,envmap_fragment:Po,envmap_pars_fragment:Co,envmap_pars_vertex:Do,envmap_physical_pars_fragment:Yo,envmap_vertex:Oo,fog_vertex:Fo,fog_pars_vertex:Bo,fog_fragment:Go,fog_pars_fragment:zo,gradientmap_pars_fragment:Uo,lightmap_fragment:Vo,lightmap_pars_fragment:Ho,lights_lambert_vertex:jo,lights_pars_begin:Wo,lights_phong_fragment:qo,lights_phong_pars_fragment:Xo,lights_physical_fragment:Zo,lights_physical_pars_fragment:Jo,lights_fragment_begin:Ko,lights_fragment_maps:Qo,lights_fragment_end:$o,logdepthbuf_fragment:es,logdepthbuf_pars_fragment:ts,logdepthbuf_pars_vertex:ns,logdepthbuf_vertex:is,map_fragment:rs,map_pars_fragment:as,map_particle_fragment:os,map_particle_pars_fragment:ss,metalnessmap_fragment:ls,metalnessmap_pars_fragment:us,morphnormal_vertex:hs,morphtarget_pars_vertex:cs,morphtarget_vertex:ds,normal_fragment_begin:fs,normal_fragment_maps:ps,normalmap_pars_fragment:ms,packing:vs,premultiplied_alpha_fragment:gs,project_vertex:ys,dithering_fragment:_s,dithering_pars_fragment:xs,roughnessmap_fragment:bs,roughnessmap_pars_fragment:ws,shadowmap_pars_fragment:Ms,shadowmap_pars_vertex:Ts,shadowmap_vertex:Es,shadowmask_pars_fragment:Ss,skinbase_vertex:As,skinning_pars_vertex:Ls,skinning_vertex:Is,skinnormal_vertex:ks,specularmap_fragment:Rs,specularmap_pars_fragment:Ns,tonemapping_fragment:Ps,tonemapping_pars_fragment:Cs,uv_pars_fragment:Ds,uv_pars_vertex:Os,uv_vertex:Fs,uv2_pars_fragment:Bs,uv2_pars_vertex:Gs,uv2_vertex:zs,worldpos_vertex:Us,background_frag:Vs,background_vert:Hs,cube_frag:js,cube_vert:Ws,depth_frag:Ys,depth_vert:qs,distanceRGBA_frag:Xs,distanceRGBA_vert:Zs,equirect_frag:Js,equirect_vert:Ks,linedashed_frag:Qs,linedashed_vert:$s,meshbasic_frag:el,meshbasic_vert:tl,meshlambert_frag:nl,meshlambert_vert:il,meshmatcap_frag:rl,meshmatcap_vert:al,meshphong_frag:ol,meshphong_vert:sl,meshphysical_frag:ll,meshphysical_vert:ul,normal_frag:hl,normal_vert:cl,points_frag:dl,points_vert:fl,shadow_frag:pl,shadow_vert:ml,sprite_frag:vl,sprite_vert:gl};t.ShaderChunk=yl;var _l={common:{diffuse:{value:new Sr(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Cn},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 Rn(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 Sr(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},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 Sr(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new Cn}},sprite:{diffuse:{value:new Sr(15658734)},opacity:{value:1},center:{value:new Rn(.5,.5)},rotation:{value:0},map:{value:null},uvTransform:{value:new Cn}}};t.UniformsLib=_l;var xl={basic:{uniforms:Ba([_l.common,_l.specularmap,_l.envmap,_l.aomap,_l.lightmap,_l.fog]),vertexShader:yl.meshbasic_vert,fragmentShader:yl.meshbasic_frag},lambert:{uniforms:Ba([_l.common,_l.specularmap,_l.envmap,_l.aomap,_l.lightmap,_l.emissivemap,_l.fog,_l.lights,{emissive:{value:new Sr(0)}}]),vertexShader:yl.meshlambert_vert,fragmentShader:yl.meshlambert_frag},phong:{uniforms:Ba([_l.common,_l.specularmap,_l.envmap,_l.aomap,_l.lightmap,_l.emissivemap,_l.bumpmap,_l.normalmap,_l.displacementmap,_l.gradientmap,_l.fog,_l.lights,{emissive:{value:new Sr(0)},specular:{value:new Sr(1118481)},shininess:{value:30}}]),vertexShader:yl.meshphong_vert,fragmentShader:yl.meshphong_frag},standard:{uniforms:Ba([_l.common,_l.envmap,_l.aomap,_l.lightmap,_l.emissivemap,_l.bumpmap,_l.normalmap,_l.displacementmap,_l.roughnessmap,_l.metalnessmap,_l.fog,_l.lights,{emissive:{value:new Sr(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:yl.meshphysical_vert,fragmentShader:yl.meshphysical_frag},matcap:{uniforms:Ba([_l.common,_l.bumpmap,_l.normalmap,_l.displacementmap,_l.fog,{matcap:{value:null}}]),vertexShader:yl.meshmatcap_vert,fragmentShader:yl.meshmatcap_frag},points:{uniforms:Ba([_l.points,_l.fog]),vertexShader:yl.points_vert,fragmentShader:yl.points_frag},dashed:{uniforms:Ba([_l.common,_l.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:yl.linedashed_vert,fragmentShader:yl.linedashed_frag},depth:{uniforms:Ba([_l.common,_l.displacementmap]),vertexShader:yl.depth_vert,fragmentShader:yl.depth_frag},normal:{uniforms:Ba([_l.common,_l.bumpmap,_l.normalmap,_l.displacementmap,{opacity:{value:1}}]),vertexShader:yl.normal_vert,fragmentShader:yl.normal_frag},sprite:{uniforms:Ba([_l.sprite,_l.fog]),vertexShader:yl.sprite_vert,fragmentShader:yl.sprite_frag},background:{uniforms:{uvTransform:{value:new Cn},t2D:{value:null}},vertexShader:yl.background_vert,fragmentShader:yl.background_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:yl.cube_vert,fragmentShader:yl.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:yl.equirect_vert,fragmentShader:yl.equirect_frag},distanceRGBA:{uniforms:Ba([_l.common,_l.displacementmap,{referencePosition:{value:new Pn},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:yl.distanceRGBA_vert,fragmentShader:yl.distanceRGBA_frag},shadow:{uniforms:Ba([_l.lights,_l.fog,{color:{value:new Sr(0)},opacity:{value:1}}]),vertexShader:yl.shadow_vert,fragmentShader:yl.shadow_frag}};function bl(){var n=null,i=!1,r=null;function a(e,t){!1!==i&&(r(e,t),n.requestAnimationFrame(a))}return{start:function(){!0!==i&&null!==r&&(n.requestAnimationFrame(a),i=!0)},stop:function(){i=!1},setAnimationLoop:function(e){r=e},setContext:function(e){n=e}}}function wl(o){var i=new s.default;function r(e,t){var n=e.array,i=e.dynamic?35048:35044,r=o.createBuffer();o.bindBuffer(t,r),o.bufferData(t,n,i),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:r,type:a,bytesPerElement:n.BYTES_PER_ELEMENT,version:e.version}}function a(e,t,n){var i=t.array,r=t.updateRange;o.bindBuffer(n,e),!1===t.dynamic?o.bufferData(n,i,35044):-1===r.count?o.bufferSubData(n,0,i):0===r.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(o.bufferSubData(n,r.offset*i.BYTES_PER_ELEMENT,i.subarray(r.offset,r.offset+r.count)),r.count=-1)}function e(e){return e.isInterleavedBufferAttribute&&(e=e.data),i.get(e)}function t(e){e.isInterleavedBufferAttribute&&(e=e.data);var t=i.get(e);t&&(o.deleteBuffer(t.buffer),i.delete(e))}function n(e,t){e.isInterleavedBufferAttribute&&(e=e.data);var n=i.get(e);void 0===n?i.set(e,r(e,t)):n.version<e.version&&(a(n.buffer,e,t),n.version=e.version)}return{get:e,remove:t,update:n}}function Ml(e,t,n,i){Ca.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i},this.fromBufferGeometry(new Tl(e,t,n,i)),this.mergeVertices()}function Tl(e,t,n,i){wa.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i},e=e||1,t=t||1;var r,a,o=e/2,s=t/2,l=Math.floor(n)||1,u=Math.floor(i)||1,h=l+1,c=u+1,d=e/l,f=t/u,p=[],m=[],v=[],g=[];for(a=0;a<c;a++){var y=a*f-s;for(r=0;r<h;r++){var _=r*d-o;m.push(_,-y,0),v.push(0,0,1),g.push(r/l),g.push(1-a/u)}}for(a=0;a<u;a++)for(r=0;r<l;r++){var x=r+h*a,b=r+h*(a+1),w=r+1+h*(a+1),M=r+1+h*a;p.push(x,b,M),p.push(b,w,M)}this.setIndex(p),this.addAttribute("position",new Vr(m,3)),this.addAttribute("normal",new Vr(v,3)),this.addAttribute("uv",new Vr(g,2))}function El(l,n,u,i){var h,c,d=new Sr(0),f=0,p=null,m=0;function e(e,t,n,i){var r=t.background,a=l.vr,o=a.getSession&&a.getSession();if(o&&"additive"===o.environmentBlendMode&&(r=null),null===r?(v(d,f),p=null,m=0):r&&r.isColor&&(v(r,1),i=!0,p=null,m=0),(l.autoClear||i)&&l.clear(l.autoClearColor,l.autoClearDepth,l.autoClearStencil),r&&(r.isCubeTexture||r.isWebGLRenderTargetCube)){void 0===c&&(c=new Ma(new Oa(1,1,1),new Va({type:"BackgroundCubeMaterial",uniforms:Fa(xl.cube.uniforms),vertexShader:xl.cube.vertexShader,fragmentShader:xl.cube.fragmentShader,side:ze,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.removeAttribute("normal"),c.geometry.removeAttribute("uv"),c.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},(0,g.default)(c.material,"map",{get:function(){return this.uniforms.tCube.value}}),u.update(c));var s=r.isWebGLRenderTargetCube?r.texture:r;c.material.uniforms.tCube.value=s,c.material.uniforms.tFlip.value=r.isWebGLRenderTargetCube?1:-1,p===r&&m===s.version||(c.material.needsUpdate=!0,p=r,m=s.version),e.unshift(c,c.geometry,c.material,0,0,null)}else r&&r.isTexture&&(void 0===h&&(h=new Ma(new Tl(2,2),new Va({type:"BackgroundMaterial",uniforms:Fa(xl.background.uniforms),vertexShader:xl.background.vertexShader,fragmentShader:xl.background.fragmentShader,side:B,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.removeAttribute("normal"),(0,g.default)(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),u.update(h)),h.material.uniforms.t2D.value=r,!0===r.matrixAutoUpdate&&r.updateMatrix(),h.material.uniforms.uvTransform.value.copy(r.matrix),p===r&&m===r.version||(h.material.needsUpdate=!0,p=r,m=r.version),e.unshift(h,h.geometry,h.material,0,0,null))}function v(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,i)}return{getClearColor:function(){return d},setClearColor:function(e,t){d.set(e),f=void 0!==t?t:1,v(d,f)},getClearAlpha:function(){return f},setClearAlpha:function(e){f=e,v(d,f)},render:e}}function Sl(r,a,o,s){var l;function e(e){l=e}function t(e,t){r.drawArrays(l,e,t),o.update(t,l)}function n(e,t,n){var i;if(s.isWebGL2)i=r;else if(i=a.get("ANGLE_instanced_arrays"),null===i)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");i[s.isWebGL2?"drawArraysInstanced":"drawArraysInstancedANGLE"](l,t,n,e.maxInstancedCount),o.update(n,l,e.maxInstancedCount)}this.setMode=e,this.render=t,this.renderInstances=n}function Al(t,n,e){var i;function r(){if(void 0!==i)return i;var e=n.get("EXT_texture_filter_anisotropic");return i=null!==e?t.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,i}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,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&&_,b=o?t.getParameter(36183):0;return{isWebGL2:o,getMaxAnisotropy:r,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:b}}function Ll(){var h=this,c=null,d=0,f=!1,p=!1,m=new ro,v=new Cn,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,i){var r=null!==e?e.length:0,a=null;if(0!==r){if(a=g.value,!0!==i||null===a){var o=n+4*r,s=t.matrixWorldInverse;v.getNormalMatrix(s),(null===a||a.length<o)&&(a=new Float32Array(o));for(var l=0,u=n;l!==r;++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=r,a}this.uniform=g,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t,n){var i=0!==e.length||t||0!==d||f;return f=t,c=_(e,n,0),d=e.length,i},this.beginShadows=function(){p=!0,_(null)},this.endShadows=function(){p=!1,y()},this.setState=function(e,t,n,i,r,a){if(!f||null===e||0===e.length||p&&!n)p?_(null):y();else{var o=p?0:d,s=4*o,l=r.clippingState||null;g.value=l,l=_(e,i,s,a);for(var u=0;u!==s;++u)l[u]=c[u];r.clippingState=l,this.numIntersection=t?this.numPlanes:0,this.numPlanes+=o}}}function Il(n){var i={};return{get:function(e){if(void 0!==i[e])return i[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."),i[e]=t,t}}}function kl(e,f,a){var o={},p={};function s(e){var t=e.target,n=o[t.id];for(var i in null!==n.index&&f.remove(n.index),n.attributes)f.remove(n.attributes[i]);t.removeEventListener("dispose",s),delete o[t.id];var r=p[n.id];r&&(f.remove(r),delete p[n.id]),a.memory.geometries--}function t(e,t){var n=o[t.id];return n||(t.addEventListener("dispose",s),t.isBufferGeometry?n=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new wa).setFromObject(e)),n=t._bufferGeometry),o[t.id]=n,a.memory.geometries++,n)}function n(e){var t=e.index,n=e.attributes;for(var i in null!==t&&f.update(t,34963),n)f.update(n[i],34962);var r=e.morphAttributes;for(var i in r)for(var a=r[i],o=0,s=a.length;o<s;o++)f.update(a[o],34962)}function i(e){var t=[],n=e.index,i=e.attributes.position,r=0;if(null!==n){var a=n.array;r=n.version;for(var 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=i.array,r=i.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<Wr(t)?Ur:Gr)(t,1);c.version=r,f.update(c,34963);var d=p[e.id];d&&f.remove(d),p[e.id]=c}function r(e){var t=p[e.id];if(t){var n=e.index;null!==n&&t.version<n.version&&i(e)}else i(e);return p[e.id]}return{get:t,update:n,getWireframeAttribute:r}}function Rl(r,a,o,s){var l,u,h;function e(e){l=e}function t(e){u=e.type,h=e.bytesPerElement}function n(e,t){r.drawElements(l,t,u,e*h),o.update(t,l)}function i(e,t,n){if(s.isWebGL2)i=r;else{var i=a.get("ANGLE_instanced_arrays");if(null===i)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")}i[s.isWebGL2?"drawElementsInstanced":"drawElementsInstancedANGLE"](l,n,u,t*h,e.maxInstancedCount),o.update(n,l,e.maxInstancedCount)}this.setMode=e,this.setIndex=t,this.render=n,this.renderInstances=i}function Nl(){var e={geometries:0,textures:0},i={frame:0,calls:0,triangles:0,points:0,lines:0};function t(e,t,n){switch(n=n||1,i.calls++,t){case 4:i.triangles+=n*(e/3);break;case 5:case 6:i.triangles+=n*(e-2);break;case 1:i.lines+=n*(e/2);break;case 3:i.lines+=n*(e-1);break;case 2:i.lines+=n*e;break;case 0:i.points+=n*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",t)}}function n(){i.frame++,i.calls=0,i.triangles=0,i.points=0,i.lines=0}return{memory:e,render:i,programs:null,autoReset:!0,reset:n,update:t}}function Pl(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Cl(f){var p={},m=new Float32Array(8);function e(e,t,n,i){var r=e.morphTargetInfluences,a=r.length,o=p[t.id];if(void 0===o){o=[];for(var s=0;s<a;s++)o[s]=[s,0];p[t.id]=o}var l=n.morphTargets&&t.morphAttributes.position,u=n.morphNormals&&t.morphAttributes.normal;for(s=0;s<a;s++){var h=o[s];0!==h[1]&&(l&&t.removeAttribute("morphTarget"+s),u&&t.removeAttribute("morphNormal"+s))}for(s=0;s<a;s++)h=o[s],h[0]=s,h[1]=r[s];for(o.sort(Pl),s=0;s<8;s++){if(h=o[s],h){var c=h[0],d=h[1];if(d){l&&t.addAttribute("morphTarget"+s,l[c]),u&&t.addAttribute("morphNormal"+s,u[c]),m[s]=d;continue}}m[s]=0}i.getUniforms().setValue(f,"morphTargetInfluences",m)}return{update:e}}function Dl(r,a){var o={};function e(e){var t=a.render.frame,n=e.geometry,i=r.get(e,n);return o[i.id]!==t&&(n.isGeometry&&i.updateFromObject(e),r.update(i),o[i.id]=t),i}function t(){o={}}return{update:e,dispose:t}}function Ol(e,t,n,i,r,a,o,s,l,u){e=void 0!==e?e:[],t=void 0!==t?t:ie,o=void 0!==o?o:ot,Xn.call(this,e,t,n,i,r,a,o,s,l,u),this.flipY=!1}function Fl(e,t,n,i){Xn.call(this,null),this.image={data:e,width:t,height:n,depth:i},this.magFilter=Ce,this.minFilter=Ce,this.wrapR=Ne,this.generateMipmaps=!1,this.flipY=!1}function Bl(e,t,n,i){Xn.call(this,null),this.image={data:e,width:t,height:n,depth:i},this.magFilter=Ce,this.minFilter=Ce,this.wrapR=Ne,this.generateMipmaps=!1,this.flipY=!1}t.ShaderLib=xl,xl.physical={uniforms:Ba([xl.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:yl.meshphysical_vert,fragmentShader:yl.meshphysical_frag},Ml.prototype=(0,l.default)(Ca.prototype),Ml.prototype.constructor=Ml,Tl.prototype=(0,l.default)(wa.prototype),Tl.prototype.constructor=Tl,Ol.prototype=(0,l.default)(Xn.prototype),Ol.prototype.constructor=Ol,Ol.prototype.isCubeTexture=!0,(0,g.default)(Ol.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}}),Fl.prototype=(0,l.default)(Xn.prototype),Fl.prototype.constructor=Fl,Fl.prototype.isDataTexture2DArray=!0,Bl.prototype=(0,l.default)(Xn.prototype),Bl.prototype.constructor=Bl,Bl.prototype.isDataTexture3D=!0;var Gl=new Xn,zl=new Fl,Ul=new Bl,Vl=new Ol,Hl=[],jl=[],Wl=new Float32Array(16),Yl=new Float32Array(9),ql=new Float32Array(4);function Xl(e,t,n){var i=e[0];if(i<=0||0<i)return e;var r=t*n,a=Hl[r];if(void 0===a&&(a=new Float32Array(r),Hl[r]=a),0!==t){i.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=n,e[o].toArray(a,s)}return a}function Zl(e,t){if(e.length!==t.length)return!1;for(var n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0}function Jl(e,t){for(var n=0,i=t.length;n<i;n++)e[n]=t[n]}function Kl(e,t){var n=jl[t];void 0===n&&(n=new Int32Array(t),jl[t]=n);for(var i=0;i!==t;++i)n[i]=e.allocateTextureUnit();return n}function Ql(e,t){var n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function $l(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(Zl(n,t))return;e.uniform2fv(this.addr,t),Jl(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(Zl(n,t))return;e.uniform3fv(this.addr,t),Jl(n,t)}}function tu(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(Zl(n,t))return;e.uniform4fv(this.addr,t),Jl(n,t)}}function nu(e,t){var n=this.cache,i=t.elements;if(void 0===i){if(Zl(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),Jl(n,t)}else{if(Zl(n,i))return;ql.set(i),e.uniformMatrix2fv(this.addr,!1,ql),Jl(n,i)}}function iu(e,t){var n=this.cache,i=t.elements;if(void 0===i){if(Zl(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),Jl(n,t)}else{if(Zl(n,i))return;Yl.set(i),e.uniformMatrix3fv(this.addr,!1,Yl),Jl(n,i)}}function ru(e,t){var n=this.cache,i=t.elements;if(void 0===i){if(Zl(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),Jl(n,t)}else{if(Zl(n,i))return;Wl.set(i),e.uniformMatrix4fv(this.addr,!1,Wl),Jl(n,i)}}function au(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.safeSetTexture2D(t||Gl,r)}function ou(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(t||zl,r)}function su(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(t||Ul,r)}function lu(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.safeSetTextureCube(t||Vl,r)}function uu(e,t){var n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function hu(e,t){var n=this.cache;Zl(n,t)||(e.uniform2iv(this.addr,t),Jl(n,t))}function cu(e,t){var n=this.cache;Zl(n,t)||(e.uniform3iv(this.addr,t),Jl(n,t))}function du(e,t){var n=this.cache;Zl(n,t)||(e.uniform4iv(this.addr,t),Jl(n,t))}function fu(e){switch(e){case 5126:return Ql;case 35664:return $l;case 35665:return eu;case 35666:return tu;case 35674:return nu;case 35675:return iu;case 35676:return ru;case 35678:case 36198:return au;case 35679:return su;case 35680:return lu;case 36289:return ou;case 5124:case 35670:return uu;case 35667:case 35671:return hu;case 35668:case 35672:return cu;case 35669:case 35673:return du}}function pu(e,t){e.uniform1fv(this.addr,t)}function mu(e,t){e.uniform1iv(this.addr,t)}function vu(e,t){e.uniform2iv(this.addr,t)}function gu(e,t){e.uniform3iv(this.addr,t)}function yu(e,t){e.uniform4iv(this.addr,t)}function _u(e,t){var n=Xl(t,this.size,2);e.uniform2fv(this.addr,n)}function xu(e,t){var n=Xl(t,this.size,3);e.uniform3fv(this.addr,n)}function bu(e,t){var n=Xl(t,this.size,4);e.uniform4fv(this.addr,n)}function wu(e,t){var n=Xl(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function Mu(e,t){var n=Xl(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function Tu(e,t){var n=Xl(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function Eu(e,t,n){var i=t.length,r=Kl(n,i);e.uniform1iv(this.addr,r);for(var a=0;a!==i;++a)n.safeSetTexture2D(t[a]||Gl,r[a])}function Su(e,t,n){var i=t.length,r=Kl(n,i);e.uniform1iv(this.addr,r);for(var a=0;a!==i;++a)n.safeSetTextureCube(t[a]||Vl,r[a])}function Au(e){switch(e){case 5126:return pu;case 35664:return _u;case 35665:return xu;case 35666:return bu;case 35674:return wu;case 35675:return Mu;case 35676:return Tu;case 35678:return Eu;case 35680:return Su;case 5124:case 35670:return mu;case 35667:case 35671:return vu;case 35668:case 35672:return gu;case 35669:case 35673:return yu}}function Lu(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=fu(t.type)}function Iu(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=Au(t.type)}function ku(e){this.id=e,this.seq=[],this.map={}}Iu.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),Jl(t,e)},ku.prototype.setValue=function(e,t,n){for(var i=this.seq,r=0,a=i.length;r!==a;++r){var o=i[r];o.setValue(e,t[o.id],n)}};var Ru=/([\w\d_]+)(\])?(\[|\.)?/g;function Nu(e,t){e.seq.push(t),e.map[t.id]=t}function Pu(e,t,n){var i=e.name,r=i.length;for(Ru.lastIndex=0;;){var a=Ru.exec(i),o=Ru.lastIndex,s=a[1],l="]"===a[2],u=a[3];if(l&&(s|=0),void 0===u||"["===u&&o+2===r){Nu(n,new(void 0===u?Lu:Iu)(s,e,t));break}var h=n.map,c=h[s];void 0===c&&(c=new ku(s),Nu(n,c)),n=c}}function Cu(e,t){this.seq=[],this.map={};for(var n=e.getProgramParameter(t,35718),i=0;i<n;++i){var r=e.getActiveUniform(t,i),a=e.getUniformLocation(t,r.name);Pu(r,a,this)}}function Du(e,t,n){var i=e.createShader(t);return e.shaderSource(i,n),e.compileShader(i),i}Cu.prototype.setValue=function(e,t,n,i){var r=this.map[t];void 0!==r&&r.setValue(e,n,i)},Cu.prototype.setOptional=function(e,t,n){var i=t[n];void 0!==i&&this.setValue(e,n,i)},Cu.upload=function(e,t,n,i){for(var r=0,a=t.length;r!==a;++r){var o=t[r],s=n[o.id];!1!==s.needsUpdate&&o.setValue(e,s.value,i)}},Cu.seqWithValue=function(e,t){for(var n=[],i=0,r=e.length;i!==r;++i){var a=e[i];a.id in t&&n.push(a)}return n};var Ou=0;function Fu(e){for(var t=e.split("\n"),n=0;n<t.length;n++)t[n]=n+1+": "+t[n];return t.join("\n")}function Bu(e){switch(e){case Zt:return["Linear","( value )"];case Jt:return["sRGB","( value )"];case Qt:return["RGBE","( value )"];case en:return["RGBM","( value, 7.0 )"];case tn:return["RGBM","( value, 16.0 )"];case nn:return["RGBD","( value, 256.0 )"];case Kt:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+e)}}function Gu(e,t,n){var i=e.getShaderParameter(t,35713),r=e.getShaderInfoLog(t).trim();if(i&&""===r)return"";var a=e.getShaderSource(t);return"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+r+Fu(a)}function zu(e,t){var n=Bu(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function Uu(e,t){var n=Bu(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function Vu(e,t){var n;switch(t){case Ue:n="Linear";break;case Q:n="Reinhard";break;case $:n="Uncharted2";break;case ee:n="OptimizedCineon";break;case te:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Hu(e,t,n){e=e||{};var i=[e.derivatives||t.envMapCubeUV||t.bumpMap||t.normalMap&&!t.objectSpaceNormalMap||t.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(e.fragDepth||t.logarithmicDepthBuffer)&&n.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",e.drawBuffers&&n.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(e.shaderTextureLOD||t.envMap)&&n.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""];return i.filter(Yu).join("\n")}function ju(e){var t=[];for(var n in e){var i=e[n];!1!==i&&t.push("#define "+n+" "+i)}return t.join("\n")}function Wu(e,t){for(var n={},i=e.getProgramParameter(t,35721),r=0;r<i;r++){var a=e.getActiveAttrib(t,r),o=a.name;n[o]=e.getAttribLocation(t,o)}return n}function Yu(e){return""!==e}function qu(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)}function Xu(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}function Zu(e){var t=/^[ \t]*#include +<([\w\d./]+)>/gm;function n(e,t){var n=yl[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Zu(n)}return e.replace(t,n)}function Ju(e){var t=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;function n(e,t,n,i){for(var r="",a=(0,c.default)(t);a<(0,c.default)(n);a++)r+=i.replace(/\[ i \]/g,"[ "+a+" ]");return r}return e.replace(t,n)}function Ku(e,t,n,i,r,a,o){var s=e.getContext(),l=i.defines,u=r.vertexShader,h=r.fragmentShader,c="SHADOWMAP_TYPE_BASIC";a.shadowMapType===O?c="SHADOWMAP_TYPE_PCF":a.shadowMapType===F&&(c="SHADOWMAP_TYPE_PCF_SOFT");var d="ENVMAP_TYPE_CUBE",f="ENVMAP_MODE_REFLECTION",p="ENVMAP_BLENDING_MULTIPLY";if(a.envMap){switch(i.envMap.mapping){case ie:case ae:d="ENVMAP_TYPE_CUBE";break;case ue:case ke:d="ENVMAP_TYPE_CUBE_UV";break;case oe:case se:d="ENVMAP_TYPE_EQUIREC";break;case le:d="ENVMAP_TYPE_SPHERE"}switch(i.envMap.mapping){case ae:case se:f="ENVMAP_MODE_REFRACTION"}switch(i.combine){case X:p="ENVMAP_BLENDING_MULTIPLY";break;case Z:p="ENVMAP_BLENDING_MIX";break;case J:p="ENVMAP_BLENDING_ADD"}}var m,v,g=0<e.gammaFactor?e.gammaFactor:1,y=o.isWebGL2?"":Hu(i.extensions,a,t),_=ju(l),x=s.createProgram();if(i.isRawShaderMaterial?(m=[_].filter(Yu).join("\n"),0<m.length&&(m+="\n"),v=[y,_].filter(Yu).join("\n"),0<v.length&&(v+="\n")):(m=["precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+r.name,_,a.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+g,"#define MAX_BONES "+a.maxBones,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.mapMixColor?"#define USE_MAP_MIXCOLOR":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+f:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.normalMap&&a.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",a.displacementMap&&a.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.vertexTangents?"#define USE_TANGENT":"",a.vertexColors?"#define USE_COLOR":"",a.flatShading?"#define FLAT_SHADED":"",a.skinning?"#define USE_SKINNING":"",a.useVertexTexture?"#define BONE_TEXTURE":"",a.morphTargets?"#define USE_MORPHTARGETS":"",a.morphNormals&&!1===a.flatShading?"#define USE_MORPHNORMALS":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+c:"",a.sizeAttenuation?"#define USE_SIZEATTENUATION":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&(o.isWebGL2||t.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","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"].filter(Yu).join("\n"),v=[y,"precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+r.name,_,a.alphaTest?"#define ALPHATEST "+a.alphaTest+(a.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+g,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.mapMixColor?"#define USE_MAP_MIXCOLOR":"",a.matcap?"#define USE_MATCAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+d:"",a.envMap?"#define "+f:"",a.envMap?"#define "+p:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.normalMap&&a.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.vertexTangents?"#define USE_TANGENT":"",a.vertexColors?"#define USE_COLOR":"",a.gradientMap?"#define USE_GRADIENTMAP":"",a.flatShading?"#define FLAT_SHADED":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+c:"",a.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",a.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&(o.isWebGL2||t.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",a.envMap&&(o.isWebGL2||t.get("EXT_shader_texture_lod"))?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",a.toneMapping!==K?"#define TONE_MAPPING":"",a.toneMapping!==K?yl.tonemapping_pars_fragment:"",a.toneMapping!==K?Vu("toneMapping",a.toneMapping):"",a.dithering?"#define DITHERING":"",a.outputEncoding||a.mapEncoding||a.matcapEncoding||a.envMapEncoding||a.emissiveMapEncoding?yl.encodings_pars_fragment:"",a.mapEncoding?zu("mapTexelToLinear",a.mapEncoding):"",a.matcapEncoding?zu("matcapTexelToLinear",a.matcapEncoding):"",a.envMapEncoding?zu("envMapTexelToLinear",a.envMapEncoding):"",a.emissiveMapEncoding?zu("emissiveMapTexelToLinear",a.emissiveMapEncoding):"",a.outputEncoding?Uu("linearToOutputTexel",a.outputEncoding):"",a.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(Yu).join("\n")),u=Zu(u),u=qu(u,a),u=Xu(u,a),h=Zu(h),h=qu(h,a),h=Xu(h,a),u=Ju(u),h=Ju(h),o.isWebGL2&&!i.isRawShaderMaterial){var b=!1,w=/^\s*#version\s+300\s+es\s*\n/;i.isShaderMaterial&&null!==u.match(w)&&null!==h.match(w)&&(b=!0,u=u.replace(w,""),h=h.replace(w,"")),m=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+m,v=["#version 300 es\n","#define varying in",b?"":"out highp vec4 pc_fragColor;",b?"":"#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"+v}var M,T,E=m+u,S=v+h,A=Du(s,35633,E),L=Du(s,35632,S);if(s.attachShader(x,A),s.attachShader(x,L),void 0!==i.index0AttributeName?s.bindAttribLocation(x,0,i.index0AttributeName):!0===a.morphTargets&&s.bindAttribLocation(x,0,"position"),s.linkProgram(x),e.debug.checkShaderErrors){var I=s.getProgramInfoLog(x).trim(),k=s.getShaderInfoLog(A).trim(),R=s.getShaderInfoLog(L).trim(),N=!0,P=!0;if(!1===s.getProgramParameter(x,35714)){N=!1;var C=Gu(s,A,"vertex"),D=Gu(s,L,"fragment");console.error("THREE.WebGLProgram: shader error: ",s.getError(),"35715",s.getProgramParameter(x,35715),"gl.getProgramInfoLog",I,C,D)}else""!==I?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",I):""!==k&&""!==R||(P=!1);P&&(this.diagnostics={runnable:N,material:i,programLog:I,vertexShader:{log:k,prefix:m},fragmentShader:{log:R,prefix:v}})}return s.deleteShader(A),s.deleteShader(L),this.getUniforms=function(){return void 0===M&&(M=new Cu(s,x)),M},this.getAttributes=function(){return void 0===T&&(T=Wu(s,x)),T},this.destroy=function(){s.deleteProgram(x),this.program=void 0},this.name=r.name,this.id=Ou++,this.code=n,this.usedTimes=1,this.program=x,this.vertexShader=A,this.fragmentShader=L,this}function Qu(d,l,f){var u=[],p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},a=["precision","supportsVertexTextures","map","mapMixColor","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];function m(e){var t=e.skeleton,n=t.bones;if(f.floatVertexTextures)return 1024;var i=f.maxVertexUniforms,r=Math.floor((i-20)/4),a=Math.min(r,n.length);return a<n.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+n.length+" bones. This GPU supports "+a+"."),0):a}function v(e,t){var n;return e?e.isTexture?n=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=e.texture.encoding):n=Zt,n===Zt&&t&&(n=Kt),n}this.getParameters=function(e,t,n,i,r,a,o){var s=p[e.type],l=o.isSkinnedMesh?m(o):0,u=f.precision;null!==e.precision&&(u=f.getMaxPrecision(e.precision),u!==e.precision&&console.warn("THREE.WebGLProgram.getParameters:",e.precision,"not supported, using",u,"instead."));var h=d.getRenderTarget(),c={shaderID:s,precision:u,supportsVertexTextures:f.vertexTextures,outputEncoding:v(h?h.texture:null,d.gammaOutput),map:!!e.map,mapMixColor:!!e.mapMixColor,mapEncoding:v(e.map,d.gammaInput),matcap:!!e.matcap,matcapEncoding:v(e.matcap,d.gammaInput),envMap:!!e.envMap,envMapMode:e.envMap&&e.envMap.mapping,envMapEncoding:v(e.envMap,d.gammaInput),envMapCubeUV:!!e.envMap&&(e.envMap.mapping===ue||e.envMap.mapping===ke),lightMap:!!e.lightMap,aoMap:!!e.aoMap,emissiveMap:!!e.emissiveMap,emissiveMapEncoding:v(e.emissiveMap,d.gammaInput),bumpMap:!!e.bumpMap,normalMap:!!e.normalMap,objectSpaceNormalMap:e.normalMapType===sn,displacementMap:!!e.displacementMap,roughnessMap:!!e.roughnessMap,metalnessMap:!!e.metalnessMap,specularMap:!!e.specularMap,alphaMap:!!e.alphaMap,gradientMap:!!e.gradientMap,combine:e.combine,vertexTangents:e.normalMap&&e.vertexTangents,vertexColors:e.vertexColors,fog:!!i,useFog:e.fog,fogExp:i&&i.isFogExp2,flatShading:e.flatShading,sizeAttenuation:e.sizeAttenuation,logarithmicDepthBuffer:f.logarithmicDepthBuffer,skinning:e.skinning&&0<l,maxBones:l,useVertexTexture:f.floatVertexTextures,morphTargets:e.morphTargets,morphNormals:e.morphNormals,maxMorphTargets:d.maxMorphTargets,maxMorphNormals:d.maxMorphNormals,numDirLights:t.directional.length,numPointLights:t.point.length,numSpotLights:t.spot.length,numRectAreaLights:t.rectArea.length,numHemiLights:t.hemi.length,numClippingPlanes:r,numClipIntersection:a,dithering:e.dithering,shadowMapEnabled:d.shadowMap.enabled&&o.receiveShadow&&0<n.length,shadowMapType:d.shadowMap.type,toneMapping:d.toneMapping,physicallyCorrectLights:d.physicallyCorrectLights,premultipliedAlpha:e.premultipliedAlpha,alphaTest:e.alphaTest,doubleSided:e.side===pe,flipSided:e.side===ze,depthPacking:void 0!==e.depthPacking&&e.depthPacking};return c},this.getProgramCode=function(e,t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(var i in e.defines)n.push(i),n.push(e.defines[i]);for(var r=0;r<a.length;r++)n.push(t[a[r]]);return n.push(e.onBeforeCompile.toString()),n.push(d.gammaOutput),n.push(d.gammaFactor),n.join()},this.acquireProgram=function(e,t,n,i){for(var r,a=0,o=u.length;a<o;a++){var s=u[a];if(s.code===i){r=s,++r.usedTimes;break}}return void 0===r&&(r=new Ku(d,l,i,e,t,n,f),u.push(r)),r},this.releaseProgram=function(e){if(0==--e.usedTimes){var t=u.indexOf(e);u[t]=u[u.length-1],u.pop(),e.destroy()}},this.programs=u}function $u(){var i=new s.default;function e(e){var t=i.get(e);return void 0===t&&(t={},i.set(e,t)),t}function t(e){i.delete(e)}function n(e,t,n){i.get(e)[t]=n}function r(){i=new s.default}return{get:e,remove:t,update:n,dispose:r}}function eh(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 th(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 nh(){var s=[],l=0,u=[],h=[],c={id:-1};function e(){l=0,u.length=0,h.length=0}function d(e,t,n,i,r,a){var o=s[l];return void 0===o?(o={id:e.id,object:e,geometry:t,material:n,program:n.program||c,groupOrder:i,renderOrder:e.renderOrder,z:r,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=i,o.renderOrder=e.renderOrder,o.z=r,o.group=a),l++,o}function t(e,t,n,i,r,a){var o=d(e,t,n,i,r,a);(!0===n.transparent?h:u).push(o)}function n(e,t,n,i,r,a){var o=d(e,t,n,i,r,a);(!0===n.transparent?h:u).unshift(o)}function i(){1<u.length&&u.sort(eh),1<h.length&&h.sort(th)}return{opaque:u,transparent:h,init:e,push:t,unshift:n,sort:i}}function ih(){var r={};function a(e){var t=e.target;t.removeEventListener("dispose",a),delete r[t.id]}function e(e,t){var n,i=r[e.id];return void 0===i?(n=new nh,r[e.id]={},r[e.id][t.id]=n,e.addEventListener("dispose",a)):(n=i[t.id],void 0===n&&(n=new nh,i[t.id]=n)),n}function t(){r={}}return{get:e,dispose:t}}function rh(){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 Pn,color:new Sr,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Rn};break;case"SpotLight":t={position:new Pn,direction:new Pn,color:new Sr,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Rn};break;case"PointLight":t={position:new Pn,color:new Sr,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Rn,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":t={direction:new Pn,skyColor:new Sr,groundColor:new Sr};break;case"RectAreaLight":t={color:new Sr,position:new Pn,halfWidth:new Pn,halfHeight:new Pn}}return n[e.id]=t,t}}}var ah=0;function oh(){for(var M=new rh,T={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,shadowsLength:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},e=0;e<9;e++)T.probe.push(new Pn);var E=new Pn,S=new Qn,A=new Qn;function t(e,t,n){for(var i=0,r=0,a=0,o=0;o<9;o++)T.probe[o].set(0,0,0);for(var s=0,l=0,u=0,h=0,c=0,d=n.matrixWorldInverse,f=(o=0,e.length);o<f;o++){var p=e[o],m=p.color,v=p.intensity,g=p.distance,y=p.shadow&&p.shadow.map?p.shadow.map.texture:null;if(p.isAmbientLight)i+=m.r*v,r+=m.g*v,a+=m.b*v;else if(p.isLightProbe)for(var _=0;_<9;_++)T.probe[_].addScaledVector(p.sh.coefficients[_],v);else if(p.isDirectionalLight){var x=M.get(p);if(x.color.copy(p.color).multiplyScalar(p.intensity),x.direction.setFromMatrixPosition(p.matrixWorld),E.setFromMatrixPosition(p.target.matrixWorld),x.direction.sub(E),x.direction.transformDirection(d),x.shadow=p.castShadow,p.castShadow){var b=p.shadow;x.shadowBias=b.bias,x.shadowRadius=b.radius,x.shadowMapSize=b.mapSize}T.directionalShadowMap[s]=y,T.directionalShadowMatrix[s]=p.shadow.matrix,T.directional[s]=x,s++}else p.isSpotLight?(x=M.get(p),x.position.setFromMatrixPosition(p.matrixWorld),x.position.applyMatrix4(d),x.color.copy(m).multiplyScalar(v),x.distance=g,x.direction.setFromMatrixPosition(p.matrixWorld),E.setFromMatrixPosition(p.target.matrixWorld),x.direction.sub(E),x.direction.transformDirection(d),x.coneCos=Math.cos(p.angle),x.penumbraCos=Math.cos(p.angle*(1-p.penumbra)),x.decay=p.decay,x.shadow=p.castShadow,p.castShadow&&(b=p.shadow,x.shadowBias=b.bias,x.shadowRadius=b.radius,x.shadowMapSize=b.mapSize),T.spotShadowMap[u]=y,T.spotShadowMatrix[u]=p.shadow.matrix,T.spot[u]=x,u++):p.isRectAreaLight?(x=M.get(p),x.color.copy(m).multiplyScalar(v),x.position.setFromMatrixPosition(p.matrixWorld),x.position.applyMatrix4(d),A.identity(),S.copy(p.matrixWorld),S.premultiply(d),A.extractRotation(S),x.halfWidth.set(.5*p.width,0,0),x.halfHeight.set(0,.5*p.height,0),x.halfWidth.applyMatrix4(A),x.halfHeight.applyMatrix4(A),T.rectArea[h]=x,h++):p.isPointLight?(x=M.get(p),x.position.setFromMatrixPosition(p.matrixWorld),x.position.applyMatrix4(d),x.color.copy(p.color).multiplyScalar(p.intensity),x.distance=p.distance,x.decay=p.decay,x.shadow=p.castShadow,p.castShadow&&(b=p.shadow,x.shadowBias=b.bias,x.shadowRadius=b.radius,x.shadowMapSize=b.mapSize,x.shadowCameraNear=b.camera.near,x.shadowCameraFar=b.camera.far),T.pointShadowMap[l]=y,T.pointShadowMatrix[l]=p.shadow.matrix,T.point[l]=x,l++):p.isHemisphereLight&&(x=M.get(p),x.direction.setFromMatrixPosition(p.matrixWorld),x.direction.transformDirection(d),x.direction.normalize(),x.skyColor.copy(p.color).multiplyScalar(v),x.groundColor.copy(p.groundColor).multiplyScalar(v),T.hemi[c]=x,c++)}T.ambient[0]=i,T.ambient[1]=r,T.ambient[2]=a;var w=T.hash;w.directionalLength===s&&w.pointLength===l&&w.spotLength===u&&w.rectAreaLength===h&&w.hemiLength===c&&w.shadowsLength===t.length||(T.directional.length=s,T.spot.length=u,T.rectArea.length=h,T.point.length=l,T.hemi.length=c,w.directionalLength=s,w.pointLength=l,w.spotLength=u,w.rectAreaLength=h,w.hemiLength=c,w.shadowsLength=t.length,T.version=ah++)}return{setup:t,state:T}}function sh(){var t=new oh,n=[],i=[];function e(){n.length=0,i.length=0}function r(e){n.push(e)}function a(e){i.push(e)}function o(e){t.setup(n,i,e)}var s={lightsArray:n,shadowsArray:i,lights:t};return{init:e,state:s,setupLights:o,pushLight:r,pushShadow:a}}function lh(){var i={};function r(e){var t=e.target;t.removeEventListener("dispose",r),delete i[t.id]}function e(e,t){var n;return void 0===i[e.id]?(n=new sh,i[e.id]={},i[e.id][t.id]=n,e.addEventListener("dispose",r)):void 0===i[e.id][t.id]?(n=new sh,i[e.id][t.id]=n):n=i[e.id][t.id],n}function t(){i={}}return{get:e,dispose:t}}function uh(e){Nr.call(this),this.type="MeshDepthMaterial",this.depthPacking=rn,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.lights=!1,this.setValues(e)}function hh(e){Nr.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Pn,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.lights=!1,this.setValues(e)}function ch(b,v,e){for(var w=new ao,M=new Qn,T=new Rn,E=new Rn(e,e),S=new Pn,A=new Pn,g=1,y=2,t=1+(g|y),_=new Array(t),x=new Array(t),L={},I={0:ze,1:B,2:pe},k=[new Pn(1,0,0),new Pn(-1,0,0),new Pn(0,0,1),new Pn(0,0,-1),new Pn(0,1,0),new Pn(0,-1,0)],R=[new Pn(0,1,0),new Pn(0,1,0),new Pn(0,1,0),new Pn(0,1,0),new Pn(0,0,1),new Pn(0,0,-1)],N=[new Zn,new Zn,new Zn,new Zn,new Zn,new Zn],n=0;n!==t;++n){var i=0!=(n&g),r=0!=(n&y),a=new uh({depthPacking:an,morphTargets:i,skinning:r});_[n]=a;var o=new hh({morphTargets:i,skinning:r});x[n]=o}var P=this;function C(e,t,n,i,r,a){var o=e.geometry,s=null,l=_,u=e.customDepthMaterial;if(n&&(l=x,u=e.customDistanceMaterial),u)s=u;else{var h=!1;t.morphTargets&&(o&&o.isBufferGeometry?h=o.morphAttributes&&o.morphAttributes.position&&0<o.morphAttributes.position.length:o&&o.isGeometry&&(h=o.morphTargets&&0<o.morphTargets.length)),e.isSkinnedMesh&&!1===t.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e);var c=e.isSkinnedMesh&&t.skinning,d=0;h&&(d|=g),c&&(d|=y),s=l[d]}if(b.localClippingEnabled&&!0===t.clipShadows&&0!==t.clippingPlanes.length){var f=s.uuid,p=t.uuid,m=L[f];void 0===m&&(m={},L[f]=m);var v=m[p];void 0===v&&(v=s.clone(),m[p]=v),s=v}return s.visible=t.visible,s.wireframe=t.wireframe,s.side=null!=t.shadowSide?t.shadowSide:I[t.side],s.clipShadows=t.clipShadows,s.clippingPlanes=t.clippingPlanes,s.clipIntersection=t.clipIntersection,s.wireframeLinewidth=t.wireframeLinewidth,s.linewidth=t.linewidth,n&&s.isMeshDistanceMaterial&&(s.referencePosition.copy(i),s.nearDistance=r,s.farDistance=a),s}function D(e,t,n,i){if(!1!==e.visible){var r=e.layers.test(t.layers);if(r&&(e.isMesh||e.isLine||e.isPoints)&&e.castShadow&&(!e.frustumCulled||w.intersectsObject(e))){e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld);var a=v.update(e),o=e.material;if((0,Ge.default)(o))for(var s=a.groups,l=0,u=s.length;l<u;l++){var h=s[l],c=o[h.materialIndex];if(c&&c.visible){var d=C(e,c,i,A,n.near,n.far);b.renderBufferDirect(n,null,a,d,e,h)}}else o.visible&&(d=C(e,o,i,A,n.near,n.far),b.renderBufferDirect(n,null,a,d,e,null))}for(var f=e.children,p=0,m=f.length;p<m;p++)D(f[p],t,n,i)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=O,this.render=function(e,t,n){if(!1!==P.enabled&&(!1!==P.autoUpdate||!1!==P.needsUpdate)&&0!==e.length){var i,r=b.getRenderTarget(),a=b.getActiveCubeFace(),o=b.getActiveMipmapLevel(),s=b.state;s.setBlending(me),s.buffers.color.setClear(1,1,1,1),s.buffers.depth.setTest(!0),s.setScissorTest(!1);for(var l=0,u=e.length;l<u;l++){var h=e[l],c=h.shadow,d=h&&h.isPointLight;if(void 0!==c){var f=c.camera;if(T.copy(c.mapSize),T.min(E),d){var p=T.x,m=T.y;N[0].set(2*p,m,p,m),N[1].set(0,m,p,m),N[2].set(3*p,m,p,m),N[3].set(p,m,p,m),N[4].set(3*p,0,p,m),N[5].set(p,0,p,m),T.x*=4,T.y*=2}if(null===c.map){var v={minFilter:Ce,magFilter:Ce,format:st};c.map=new Jn(T.x,T.y,v),c.map.texture.name=h.name+".shadowMap",f.updateProjectionMatrix()}c.isSpotLightShadow&&c.update(h);var g=c.map,y=c.matrix;A.setFromMatrixPosition(h.matrixWorld),f.position.copy(A),d?(i=6,y.makeTranslation(-A.x,-A.y,-A.z)):(i=1,S.setFromMatrixPosition(h.target.matrixWorld),f.lookAt(S),f.updateMatrixWorld(),y.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),y.multiply(f.projectionMatrix),y.multiply(f.matrixWorldInverse)),b.setRenderTarget(g),b.clear();for(var _=0;_<i;_++){if(d){S.copy(f.position),S.add(k[_]),f.up.copy(R[_]),f.lookAt(S),f.updateMatrixWorld();var x=N[_];s.viewport(x)}M.multiplyMatrices(f.projectionMatrix,f.matrixWorldInverse),w.setFromMatrix(M),D(t,n,f,d)}}else console.warn("THREE.WebGLShadowMap:",h,"has no shadow.")}P.needsUpdate=!1,b.setRenderTarget(r,a,o)}}}function dh(h,i,l,r){function e(){var t=!1,a=new Zn,n=null,o=new Zn(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,i,r){!0===r&&(e*=i,t*=i,n*=i),a.set(e,t,n,i),!1===o.equals(a)&&(h.clearColor(e,t,n,i),o.copy(a))},reset:function(){t=!1,n=null,o.set(-1,0,0,0)}}}function t(){var t=!1,n=null,i=null,r=null;return{setTest:function(e){(e?W:Y)(2929)},setMask:function(e){n===e||t||(h.depthMask(e),n=e)},setFunc:function(e){if(i!==e){if(e)switch(e){case we:h.depthFunc(512);break;case Me:h.depthFunc(519);break;case Te:h.depthFunc(513);break;case Ee:h.depthFunc(515);break;case Se:h.depthFunc(514);break;case Ae:h.depthFunc(518);break;case Le:h.depthFunc(516);break;case Ie:h.depthFunc(517);break;default:h.depthFunc(515)}else h.depthFunc(515);i=e}},setLocked:function(e){t=e},setClear:function(e){r!==e&&(h.clearDepth(e),r=e)},reset:function(){t=!1,n=null,i=null,r=null}}}function n(){var t=!1,n=null,i=null,r=null,a=null,o=null,s=null,l=null,u=null;return{setTest:function(e){(e?W:Y)(2960)},setMask:function(e){n===e||t||(h.stencilMask(e),n=e)},setFunc:function(e,t,n){i===e&&r===t&&a===n||(h.stencilFunc(e,t,n),i=e,r=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,i=null,r=null,a=null,o=null,s=null,l=null,u=null}}}var a=new e,o=new t,s=new n,u=h.getParameter(34921),c=new Uint8Array(u),d=new Uint8Array(u),f=new Uint8Array(u),p={},m=null,v=null,g=null,y=null,_=null,x=null,b=null,w=null,M=null,T=null,E=!1,S=null,A=null,L=null,I=null,k=null,R=h.getParameter(35661),N=!1,P=0,C=h.getParameter(7938);-1!==C.indexOf("WebGL")?(P=(0,he.default)(/^WebGL\ ([0-9])/.exec(C)[1]),N=1<=P):-1!==C.indexOf("OpenGL ES")&&(P=(0,he.default)(/^OpenGL\ ES\ ([0-9])/.exec(C)[1]),N=2<=P);var D=null,O={},F=new Zn,B=new Zn;function G(e,t,n){var i=new Uint8Array(4),r=h.createTexture();h.bindTexture(e,r),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,i);return r}var z={};function U(){for(var e=0,t=c.length;e<t;e++)c[e]=0}function V(e){H(e,0)}function H(e,t){if(c[e]=1,0===d[e]&&(h.enableVertexAttribArray(e),d[e]=1),f[e]!==t){var n=r.isWebGL2?h:i.get("ANGLE_instanced_arrays");n[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](e,t),f[e]=t}}function j(){for(var e=0,t=d.length;e!==t;++e)d[e]!==c[e]&&(h.disableVertexAttribArray(e),d[e]=0)}function W(e){!0!==p[e]&&(h.enable(e),p[e]=!0)}function Y(e){!1!==p[e]&&(h.disable(e),p[e]=!1)}function q(){if(null===m&&(m=[],i.get("WEBGL_compressed_texture_pvrtc")||i.get("WEBGL_compressed_texture_s3tc")||i.get("WEBGL_compressed_texture_etc1")||i.get("WEBGL_compressed_texture_astc")))for(var e=h.getParameter(34467),t=0;t<e.length;t++)m.push(e[t]);return m}function X(e){return v!==e&&(h.useProgram(e),v=e,!0)}function Z(e,t,n,i,r,a,o,s){if(e!==me){if(g||(W(3042),g=!0),e===xe)r=r||t,a=a||n,o=o||i,t===_&&r===w||(h.blendEquationSeparate(l.convert(t),l.convert(r)),_=t,w=r),n===x&&i===b&&a===M&&o===T||(h.blendFuncSeparate(l.convert(n),l.convert(i),l.convert(a),l.convert(o)),x=n,b=i,M=a,T=o),y=e,E=null;else if(e!==y||s!==E){if(_===be&&w===be||(h.blendEquation(32774),_=be,w=be),s)switch(e){case ve:h.blendFuncSeparate(1,771,1,771);break;case ge:h.blendFunc(1,1);break;case ye:h.blendFuncSeparate(0,0,769,771);break;case _e:h.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case ve:h.blendFuncSeparate(770,771,1,771);break;case ge:h.blendFunc(770,1);break;case ye:h.blendFunc(0,769);break;case _e:h.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}x=null,b=null,M=null,T=null,y=e,E=s}}else g&&(Y(3042),g=!1)}function J(e,t){(e.side===pe?Y:W)(2884);var n=e.side===ze;t&&(n=!n),K(n),e.blending===ve&&!1===e.transparent?Z(me):Z(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),o.setFunc(e.depthFunc),o.setTest(e.depthTest),o.setMask(e.depthWrite),a.setMask(e.colorWrite);var i=e.stencilWrite;s.setTest(i),i&&(s.setFunc(e.stencilFunc,e.stencilRef,e.stencilMask),s.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),ee(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)}function K(e){S!==e&&(e?h.frontFace(2304):h.frontFace(2305),S=e)}function Q(e){e!==ce?(W(2884),e!==A&&(e===de?h.cullFace(1029):e===fe?h.cullFace(1028):h.cullFace(1032))):Y(2884),A=e}function $(e){e!==L&&(N&&h.lineWidth(e),L=e)}function ee(e,t,n){e?(W(32823),I===t&&k===n||(h.polygonOffset(t,n),I=t,k=n)):Y(32823)}function te(e){(e?W:Y)(3089)}function ne(e){void 0===e&&(e=33984+R-1),D!==e&&(h.activeTexture(e),D=e)}function ie(e,t){null===D&&ne();var n=O[D];void 0===n&&(n={type:void 0,texture:void 0},O[D]=n),n.type===e&&n.texture===t||(h.bindTexture(e,t||z[e]),n.type=e,n.texture=t)}function re(){try{h.compressedTexImage2D.apply(h,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function ae(){try{h.texImage2D.apply(h,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function oe(){try{h.texImage3D.apply(h,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function se(e){!1===F.equals(e)&&(h.scissor(e.x,e.y,e.z,e.w),F.copy(e))}function le(e){!1===B.equals(e)&&(h.viewport(e.x,e.y,e.z,e.w),B.copy(e))}function ue(){for(var e=0;e<d.length;e++)1===d[e]&&(h.disableVertexAttribArray(e),d[e]=0);p={},m=null,D=null,O={},v=null,y=null,S=null,A=null,a.reset(),o.reset(),s.reset()}return z[3553]=G(3553,3553,1),z[34067]=G(34067,34069,6),a.setClear(0,0,0,1),o.setClear(1),s.setClear(0),W(2929),o.setFunc(Ee),K(!1),Q(de),W(2884),Z(me),{buffers:{color:a,depth:o,stencil:s},initAttributes:U,enableAttribute:V,enableAttributeAndDivisor:H,disableUnusedAttributes:j,enable:W,disable:Y,getCompressedTextureFormats:q,useProgram:X,setBlending:Z,setMaterial:J,setFlipSided:K,setCullFace:Q,setLineWidth:$,setPolygonOffset:ee,setScissorTest:te,activeTexture:ne,bindTexture:ie,compressedTexImage2D:re,texImage2D:ae,texImage3D:oe,scissor:se,viewport:le,reset:ue}}function fh(v,r,g,y,_,x,c){var h,i={},n="undefined"!=typeof OffscreenCanvas;function d(e,t){return n?new OffscreenCanvas(e,t):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function b(e,t,n,i){var r=1;if((e.width>i||e.height>i)&&(r=i/Math.max(e.width,e.height)),r<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){var a=t?kn.floorPowerOfTwo:Math.floor,o=a(r*e.width),s=a(r*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+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function w(e){return kn.isPowerOfTwo(e.width)&&kn.isPowerOfTwo(e.height)}function p(e){return!_.isWebGL2&&(e.wrapS!==Ne||e.wrapT!==Ne||e.minFilter!==Ce&&e.minFilter!==Ve)}function M(e,t){return e.generateMipmaps&&t&&e.minFilter!==Ce&&e.minFilter!==Ve}function T(e,t,n,i){v.generateMipmap(e);var r=y.get(t);r.__maxMipLevel=Math.log(Math.max(n,i))*Math.LOG2E}function E(e,t){if(!_.isWebGL2)return e;var n=e;return 6403===e&&(5126===t&&(n=33326),5131===t&&(n=33325),5121===t&&(n=33321)),6407===e&&(5126===t&&(n=34837),5131===t&&(n=34843),5121===t&&(n=32849)),6408===e&&(5126===t&&(n=34836),5131===t&&(n=34842),5121===t&&(n=32856)),33325===n||33326===n||34842===n||34836===n?r.get("EXT_color_buffer_float"):34843!==n&&34837!==n||console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),n}function a(e){return e===Ce||e===De||e===Fe?9728:9729}function o(e){var t=e.target;t.removeEventListener("dispose",o),s(t),t.isVideoTexture&&delete i[t.id],c.memory.textures--}function f(e){var t=e.target;t.removeEventListener("dispose",f),l(t),c.memory.textures--}function s(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.isWebGLRenderTargetCube)for(var i=0;i<6;i++)v.deleteFramebuffer(t.__webglFramebuffer[i]),t.__webglDepthbuffer&&v.deleteRenderbuffer(t.__webglDepthbuffer[i]);else v.deleteFramebuffer(t.__webglFramebuffer),t.__webglDepthbuffer&&v.deleteRenderbuffer(t.__webglDepthbuffer);y.remove(e.texture),y.remove(e)}}var t=0;function e(){t=0}function u(){var e=t;return e>=_.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+_.maxTextures),t+=1,e}function m(e,t){var n=y.get(e);if(e.isVideoTexture&&U(e),0<e.version&&n.__version!==e.version){var i=e.image;if(void 0===i)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(!1!==i.complete)return void N(n,e,t)}g.activeTexture(33984+t),g.bindTexture(3553,n.__webglTexture)}function S(e,t){var n=y.get(e);0<e.version&&n.__version!==e.version?N(n,e,t):(g.activeTexture(33984+t),g.bindTexture(35866,n.__webglTexture))}function A(e,t){var n=y.get(e);0<e.version&&n.__version!==e.version?N(n,e,t):(g.activeTexture(33984+t),g.bindTexture(32879,n.__webglTexture))}function L(e,t){var n=y.get(e);if(6===e.image.length)if(0<e.version&&n.__version!==e.version){R(n,e),g.activeTexture(33984+t),g.bindTexture(34067,n.__webglTexture),v.pixelStorei(37440,e.flipY);for(var i=e&&e.isCompressedTexture,r=e.image[0]&&e.image[0].isDataTexture,a=[],o=0;o<6;o++)a[o]=i||r?r?e.image[o].image:e.image[o]:b(e.image[o],!1,!0,_.maxCubemapSize);var s=a[0],l=w(s)||_.isWebGL2,u=x.convert(e.format),h=x.convert(e.type),c=E(u,h);for(k(34067,e,l),o=0;o<6;o++)if(i)for(var d,f=a[o].mipmaps,p=0,m=f.length;p<m;p++)d=f[p],e.format!==st&&e.format!==ot?-1<g.getCompressedTextureFormats().indexOf(u)?g.compressedTexImage2D(34069+o,p,c,d.width,d.height,0,d.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):g.texImage2D(34069+o,p,c,d.width,d.height,0,u,h,d.data);else r?g.texImage2D(34069+o,0,c,a[o].width,a[o].height,0,u,h,a[o].data):g.texImage2D(34069+o,0,c,u,h,a[o]);n.__maxMipLevel=i?f.length-1:0,M(e,l)&&T(34067,e,s.width,s.height),n.__version=e.version,e.onUpdate&&e.onUpdate(e)}else g.activeTexture(33984+t),g.bindTexture(34067,n.__webglTexture)}function I(e,t){g.activeTexture(33984+t),g.bindTexture(34067,y.get(e).__webglTexture)}function k(e,t,n){var i;if(n?(v.texParameteri(e,10242,x.convert(t.wrapS)),v.texParameteri(e,10243,x.convert(t.wrapT)),32879!==e&&35866!==e||v.texParameteri(e,32882,x.convert(t.wrapR)),v.texParameteri(e,10240,x.convert(t.magFilter)),v.texParameteri(e,10241,x.convert(t.minFilter))):(v.texParameteri(e,10242,33071),v.texParameteri(e,10243,33071),32879!==e&&35866!==e||v.texParameteri(e,32882,33071),t.wrapS===Ne&&t.wrapT===Ne||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,a(t.magFilter)),v.texParameteri(e,10241,a(t.minFilter)),t.minFilter!==Ce&&t.minFilter!==Ve&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),i=r.get("EXT_texture_filter_anisotropic"),i){if(t.type===$e&&null===r.get("OES_texture_float_linear"))return;if(t.type===et&&null===(_.isWebGL2||r.get("OES_texture_half_float_linear")))return;(1<t.anisotropy||y.get(t).__currentAnisotropy)&&(v.texParameterf(e,i.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,_.getMaxAnisotropy())),y.get(t).__currentAnisotropy=t.anisotropy)}}function R(e,t){void 0===e.__webglInit&&(e.__webglInit=!0,t.addEventListener("dispose",o),e.__webglTexture=v.createTexture(),c.memory.textures++)}function N(e,t,n){var i=3553;t.isDataTexture2DArray&&(i=35866),t.isDataTexture3D&&(i=32879),R(e,t),g.activeTexture(33984+n),g.bindTexture(i,e.__webglTexture),v.pixelStorei(37440,t.flipY),v.pixelStorei(37441,t.premultiplyAlpha),v.pixelStorei(3317,t.unpackAlignment);var r=p(t)&&!1===w(t.image),a=b(t.image,r,!1,_.maxTextureSize),o=w(a)||_.isWebGL2,s=x.convert(t.format),l=x.convert(t.type),u=E(s,l);k(i,t,o);var h,c=t.mipmaps;if(t.isDepthTexture){if(u=6402,t.type===$e){if(!_.isWebGL2)throw new Error("Float Depth Texture only supported in WebGL2.0");u=36012}else _.isWebGL2&&(u=33189);t.format===ct&&6402===u&&t.type!==Je&&t.type!==Qe&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),t.type=Je,l=x.convert(t.type)),t.format===dt&&(u=34041,t.type!==rt&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),t.type=rt,l=x.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!==st&&t.format!==ot?-1<g.getCompressedTextureFormats().indexOf(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;M(t,o)&&T(3553,t,a.width,a.height),e.__version=t.version,t.onUpdate&&t.onUpdate(t)}function P(e,t,n,i){var r=x.convert(t.texture.format),a=x.convert(t.texture.type),o=E(r,a);g.texImage2D(i,0,o,t.width,t.height,0,r,a,null),v.bindFramebuffer(36160,e),v.framebufferTexture2D(36160,n,i,y.get(t.texture).__webglTexture,0),v.bindFramebuffer(36160,null)}function C(e,t,n){if(v.bindRenderbuffer(36161,e),t.depthBuffer&&!t.stencilBuffer){if(n){var i=z(t);v.renderbufferStorageMultisample(36161,i,33189,t.width,t.height)}else v.renderbufferStorage(36161,33189,t.width,t.height);v.framebufferRenderbuffer(36160,36096,36161,e)}else if(t.depthBuffer&&t.stencilBuffer)n?(i=z(t),v.renderbufferStorageMultisample(36161,i,35056,t.width,t.height)):v.renderbufferStorage(36161,34041,t.width,t.height),v.framebufferRenderbuffer(36160,33306,36161,e);else{var r=x.convert(t.texture.format),a=x.convert(t.texture.type),o=E(r,a);n?(i=z(t),v.renderbufferStorageMultisample(36161,i,o,t.width,t.height)):v.renderbufferStorage(36161,o,t.width,t.height)}v.bindRenderbuffer(36161,null)}function D(e,t){var n=t&&t.isWebGLRenderTargetCube;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),m(t.depthTexture,0);var i=y.get(t.depthTexture).__webglTexture;if(t.depthTexture.format===ct)v.framebufferTexture2D(36160,36096,3553,i,0);else{if(t.depthTexture.format!==dt)throw new Error("Unknown depthTexture format");v.framebufferTexture2D(36160,33306,3553,i,0)}}function O(e){var t=y.get(e),n=!0===e.isWebGLRenderTargetCube;if(e.depthTexture){if(n)throw new Error("target.depthTexture not supported in Cube render targets");D(t.__webglFramebuffer,e)}else if(n){t.__webglDepthbuffer=[];for(var i=0;i<6;i++)v.bindFramebuffer(36160,t.__webglFramebuffer[i]),t.__webglDepthbuffer[i]=v.createRenderbuffer(),C(t.__webglDepthbuffer[i],e)}else v.bindFramebuffer(36160,t.__webglFramebuffer),t.__webglDepthbuffer=v.createRenderbuffer(),C(t.__webglDepthbuffer,e);v.bindFramebuffer(36160,null)}function F(e){var t=y.get(e),n=y.get(e.texture);e.addEventListener("dispose",f),n.__webglTexture=v.createTexture(),c.memory.textures++;var i=!0===e.isWebGLRenderTargetCube,r=!0===e.isWebGLMultisampleRenderTarget,a=w(e)||_.isWebGL2;if(i){t.__webglFramebuffer=[];for(var o=0;o<6;o++)t.__webglFramebuffer[o]=v.createFramebuffer()}else if(t.__webglFramebuffer=v.createFramebuffer(),r)if(_.isWebGL2){t.__webglMultisampledFramebuffer=v.createFramebuffer(),t.__webglColorRenderbuffer=v.createRenderbuffer(),v.bindRenderbuffer(36161,t.__webglColorRenderbuffer);var s=x.convert(e.texture.format),l=x.convert(e.texture.type),u=E(s,l),h=z(e);v.renderbufferStorageMultisample(36161,h,u,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(),C(t.__webglDepthRenderbuffer,e,!0)),v.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(i){for(g.bindTexture(34067,n.__webglTexture),k(34067,e.texture,a),o=0;o<6;o++)P(t.__webglFramebuffer[o],e,36064,34069+o);M(e.texture,a)&&T(34067,e.texture,e.width,e.height),g.bindTexture(34067,null)}else g.bindTexture(3553,n.__webglTexture),k(3553,e.texture,a),P(t.__webglFramebuffer,e,36064,3553),M(e.texture,a)&&T(3553,e.texture,e.width,e.height),g.bindTexture(3553,null);e.depthBuffer&&O(e)}function B(e){var t=e.texture,n=w(e)||_.isWebGL2;if(M(t,n)){var i=e.isWebGLRenderTargetCube?34067:3553,r=y.get(t).__webglTexture;g.bindTexture(i,r),T(i,t,e.width,e.height),g.bindTexture(i,null)}}function G(e){if(e.isWebGLMultisampleRenderTarget)if(_.isWebGL2){var t=y.get(e);v.bindFramebuffer(36008,t.__webglMultisampledFramebuffer),v.bindFramebuffer(36009,t.__webglFramebuffer);var n=e.width,i=e.height,r=16384;e.depthBuffer&&(r|=256),e.stencilBuffer&&(r|=1024),v.blitFramebuffer(0,0,n,i,0,0,n,i,r,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")}function z(e){return _.isWebGL2&&e.isWebGLMultisampleRenderTarget?Math.min(_.maxSamples,e.samples):0}function U(e){var t=e.id,n=c.render.frame;i[t]!==n&&(i[t]=n,e.update())}var V=!1,H=!1;function j(e,t){e&&e.isWebGLRenderTarget&&(!1===V&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),V=!0),e=e.texture),m(e,t)}function W(e,t){e&&e.isWebGLRenderTargetCube&&(!1===H&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),H=!0),e=e.texture),(e&&e.isCubeTexture||(0,Ge.default)(e.image)&&6===e.image.length?L:I)(e,t)}this.allocateTextureUnit=u,this.resetTextureUnits=e,this.setTexture2D=m,this.setTexture2DArray=S,this.setTexture3D=A,this.setTextureCube=L,this.setTextureCubeDynamic=I,this.setupRenderTarget=F,this.updateRenderTargetMipmap=B,this.updateMultisampleRenderTarget=G,this.safeSetTexture2D=j,this.safeSetTextureCube=W}function ph(e,n,i){function t(e){var t;if(e===Re)return 10497;if(e===Ne)return 33071;if(e===Pe)return 33648;if(e===Ce)return 9728;if(e===De)return 9984;if(e===Fe)return 9986;if(e===Ve)return 9729;if(e===He)return 9985;if(e===We)return 9987;if(e===qe)return 5121;if(e===tt)return 32819;if(e===nt)return 32820;if(e===it)return 33635;if(e===Xe)return 5120;if(e===Ze)return 5122;if(e===Je)return 5123;if(e===Ke)return 5124;if(e===Qe)return 5125;if(e===$e)return 5126;if(e===et){if(i.isWebGL2)return 5131;if(t=n.get("OES_texture_half_float"),null!==t)return t.HALF_FLOAT_OES}if(e===at)return 6406;if(e===ot)return 6407;if(e===st)return 6408;if(e===lt)return 6409;if(e===ut)return 6410;if(e===ct)return 6402;if(e===dt)return 34041;if(e===ft)return 6403;if(e===be)return 32774;if(e===k)return 32778;if(e===R)return 32779;if(e===C)return 0;if(e===D)return 1;if(e===G)return 768;if(e===z)return 769;if(e===U)return 770;if(e===V)return 771;if(e===H)return 772;if(e===j)return 773;if(e===W)return 774;if(e===Y)return 775;if(e===q)return 776;if((e===pt||e===mt||e===vt||e===gt)&&(t=n.get("WEBGL_compressed_texture_s3tc"),null!==t)){if(e===pt)return t.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===mt)return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===vt)return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===gt)return t.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((e===yt||e===_t||e===xt||e===bt)&&(t=n.get("WEBGL_compressed_texture_pvrtc"),null!==t)){if(e===yt)return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===_t)return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===xt)return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===bt)return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e===wt&&(t=n.get("WEBGL_compressed_texture_etc1"),null!==t))return t.COMPRESSED_RGB_ETC1_WEBGL;if((e===Mt||e===Tt||e===Et||e===St||e===At||e===Lt||e===It||e===kt||e===Rt||e===Nt||e===Pt||e===Ct||e===Dt||e===Ot)&&(t=n.get("WEBGL_compressed_texture_astc"),null!==t))return e;if(e===N||e===P){if(i.isWebGL2){if(e===N)return 32775;if(e===P)return 32776}if(t=n.get("EXT_blend_minmax"),null!==t){if(e===N)return t.MIN_EXT;if(e===P)return t.MAX_EXT}}if(e===rt){if(i.isWebGL2)return 34042;if(t=n.get("WEBGL_depth_texture"),null!==t)return t.UNSIGNED_INT_24_8_WEBGL}return 0}return{convert:t}}function mh(){pr.call(this),this.type="Group"}function vh(e){ja.call(this),this.cameras=e||[]}uh.prototype=(0,l.default)(Nr.prototype),uh.prototype.constructor=uh,uh.prototype.isMeshDepthMaterial=!0,uh.prototype.copy=function(e){return Nr.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,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},hh.prototype=(0,l.default)(Nr.prototype),hh.prototype.constructor=hh,hh.prototype.isMeshDistanceMaterial=!0,hh.prototype.copy=function(e){return Nr.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=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this},mh.prototype=(0,p.default)((0,l.default)(pr.prototype),{constructor:mh,isGroup:!0}),vh.prototype=(0,p.default)((0,l.default)(ja.prototype),{constructor:vh,isArrayCamera:!0});var gh,yh,_h,xh,bh,wh,Mh,Th,Eh,Sh,Ah,Lh,Ih,kh,Rh,Nh,Ph,Ch,Dh,Oh,Fh,Bh,Gh,zh,Uh,Vh,Hh,jh,Wh=new Pn,Yh=new Pn;function qh(e,t,n){Wh.setFromMatrixPosition(t.matrixWorld),Yh.setFromMatrixPosition(n.matrixWorld);var i=Wh.distanceTo(Yh),r=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=r[14]/(r[10]-1),s=r[14]/(r[10]+1),l=(r[9]+1)/r[5],u=(r[9]-1)/r[5],h=(r[8]-1)/r[0],c=(a[8]+1)/a[0],d=o*h,f=o*c,p=i/(-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+(i-m),x=l*s/g*v,b=u*s/g*v;e.projectionMatrix.makePerspective(y,_,x,b,v,g)}function Xh(t){var n,i,r=this,l=null,u=null,h=null,a=[],c=new Qn,d=new Qn,o=1,f="local-floor";"undefined"!=typeof window&&"VRFrameData"in window&&(u=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",e,!1));var p=new Qn,m=new Nn,v=new Pn,g=new ja;g.viewport=new Zn,g.layers.enable(1);var y=new ja;y.viewport=new Zn,y.layers.enable(2);var _=new vh([g,y]);function x(){return null!==l&&!0===l.isPresenting}_.layers.enable(1),_.layers.enable(2);var s,b=new Rn;function e(){if(x()){var e=l.getEyeParameters("left");n=2*e.renderWidth*o,i=e.renderHeight*o,s=t.getPixelRatio(),t.getSize(b),t.setDrawingBufferSize(n,i,1),g.viewport.set(0,0,n/2,i),y.viewport.set(n/2,0,n/2,i),S.start(),r.dispatchEvent({type:"sessionstart"})}else r.enabled&&t.setDrawingBufferSize(b.width,b.height,s),S.stop(),r.dispatchEvent({type:"sessionend"})}var w=[];function M(e){for(var t=navigator.getGamepads&&navigator.getGamepads(),n=0,i=0,r=t.length;n<r;n++){var a=t[n];if(a&&("Daydream Controller"===a.id||"Gear VR Controller"===a.id||"Oculus Go Controller"===a.id||"OpenVR Gamepad"===a.id||a.id.startsWith("Oculus Touch")||a.id.startsWith("HTC Vive Focus")||a.id.startsWith("Spatial Controller"))){if(i===e)return a;i++}}}function T(){for(var e=0;e<a.length;e++){var t=a[e],n=M(e);if(void 0!==n&&void 0!==n.pose){if(null===n.pose)return;var i=n.pose;!1===i.hasPosition&&t.position.set(.2,-.6,-.05),null!==i.position&&t.position.fromArray(i.position),null!==i.orientation&&t.quaternion.fromArray(i.orientation),t.matrix.compose(t.position,t.quaternion,t.scale),t.matrix.premultiply(c),t.matrix.decompose(t.position,t.quaternion,t.scale),t.matrixWorldNeedsUpdate=!0,t.visible=!0;var r="Daydream Controller"===n.id?0:1;void 0===w[e]&&(w[e]=!1),w[e]!==n.buttons[r].pressed&&(w[e]=n.buttons[r].pressed,!0===w[e]?t.dispatchEvent({type:"selectstart"}):(t.dispatchEvent({type:"selectend"}),t.dispatchEvent({type:"select"})))}else t.visible=!1}}function E(e,t){null!==t&&4===t.length&&e.set(t[0]*n,t[1]*i,t[2]*n,t[3]*i)}this.enabled=!1,this.getController=function(e){var t=a[e];return void 0===t&&(t=new mh,t.matrixAutoUpdate=!1,t.visible=!1,a[e]=t),t},this.getDevice=function(){return l},this.setDevice=function(e){void 0!==e&&(l=e),S.setContext(e)},this.setFramebufferScaleFactor=function(e){o=e},this.setReferenceSpaceType=function(e){f=e},this.setPoseTarget=function(e){void 0!==e&&(h=e)},this.getCamera=function(e){var t="local-floor"===f?1.6:0;if(!1===x())return e.position.set(0,t,0),e.rotation.set(0,0,0),e;if(l.depthNear=e.near,l.depthFar=e.far,l.getFrameData(u),"local-floor"===f){var n=l.stageParameters;n?c.fromArray(n.sittingToStandingTransform):c.makeTranslation(0,t,0)}var i=u.pose,r=null!==h?h:e;r.matrix.copy(c),r.matrix.decompose(r.position,r.quaternion,r.scale),null!==i.orientation&&(m.fromArray(i.orientation),r.quaternion.multiply(m)),null!==i.position&&(m.setFromRotationMatrix(c),v.fromArray(i.position),v.applyQuaternion(m),r.position.add(v)),r.updateMatrixWorld(),g.near=e.near,y.near=e.near,g.far=e.far,y.far=e.far,g.matrixWorldInverse.fromArray(u.leftViewMatrix),y.matrixWorldInverse.fromArray(u.rightViewMatrix),d.getInverse(c),"local-floor"===f&&(g.matrixWorldInverse.multiply(d),y.matrixWorldInverse.multiply(d));var a=r.parent;null!==a&&(p.getInverse(a.matrixWorld),g.matrixWorldInverse.multiply(p),y.matrixWorldInverse.multiply(p)),g.matrixWorld.getInverse(g.matrixWorldInverse),y.matrixWorld.getInverse(y.matrixWorldInverse),g.projectionMatrix.fromArray(u.leftProjectionMatrix),y.projectionMatrix.fromArray(u.rightProjectionMatrix),qh(_,g,y);var o=l.getLayers();if(o.length){var s=o[0];E(g.viewport,s.leftBounds),E(y.viewport,s.rightBounds)}return T(),_},this.getStandingMatrix=function(){return c},this.isPresenting=x;var S=new bl;this.setAnimationLoop=function(e){S.setAnimationLoop(e),x()&&S.start()},this.submitFrame=function(){x()&&l.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",e)},this.setFrameOfReferenceType=function(){console.warn("THREE.WebVRManager: setFrameOfReferenceType() has been deprecated.")}}function Zh(d,t){var n=this,f=null,p=null,i="local-floor",m=null,v=[],g=[];function o(){return null!==f&&null!==p}var s=new ja;s.layers.enable(1),s.viewport=new Zn;var l=new ja;l.layers.enable(2),l.viewport=new Zn;var y=new vh([s,l]);function r(e){for(var t=0;t<v.length;t++)g[t]===e.inputSource&&v[t].dispatchEvent({type:e.type})}function a(){d.setFramebuffer(null),d.setRenderTarget(d.getRenderTarget()),c.stop(),n.dispatchEvent({type:"sessionend"})}function u(e){p=e,c.setContext(f),c.start(),n.dispatchEvent({type:"sessionstart"})}function h(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.getInverse(e.matrixWorld)}y.layers.enable(1),y.layers.enable(2),this.enabled=!1,this.getController=function(e){var t=v[e];return void 0===t&&(t=new mh,t.matrixAutoUpdate=!1,t.visible=!1,v[e]=t),t},this.setFramebufferScaleFactor=function(){},this.setReferenceSpaceType=function(e){i=e},this.getSession=function(){return f},this.setSession=function(e){f=e,null!==f&&(f.addEventListener("select",r),f.addEventListener("selectstart",r),f.addEventListener("selectend",r),f.addEventListener("end",a),f.updateRenderState({baseLayer:new XRWebGLLayer(f,t)}),f.requestReferenceSpace(i).then(u),g=f.inputSources,f.addEventListener("inputsourceschange",function(){g=f.inputSources;for(var e=0;e<v.length;e++){var t=v[e];t.userData.inputSource=g[e]}}))},this.getCamera=function(e){if(o()){var t=e.parent,n=y.cameras;h(y,t);for(var i=0;i<n.length;i++)h(n[i],t);e.matrixWorld.copy(y.matrixWorld);for(var r=e.children,a=(i=0,r.length);i<a;i++)r[i].updateMatrixWorld(!0);return qh(y,s,l),y}return e},this.isPresenting=o;var _=null;function e(e,t){if(m=t.getViewerPose(p),null!==m){var n=m.views,i=f.renderState.baseLayer;d.setFramebuffer(i.framebuffer);for(var r=0;r<n.length;r++){var a=n[r],o=i.getViewport(a),s=a.transform.inverse.matrix,l=y.cameras[r];l.matrix.fromArray(s).getInverse(l.matrix),l.projectionMatrix.fromArray(a.projectionMatrix),l.viewport.set(o.x,o.y,o.width,o.height),0===r&&y.matrix.copy(l.matrix)}}for(r=0;r<v.length;r++){var u=v[r],h=g[r];if(h){var c=t.getPose(h.targetRaySpace,p);if(null!==c){u.matrix.fromArray(c.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.visible=!0;continue}}u.visible=!1}_&&_(e)}var c=new bl;c.setAnimationLoop(e),this.setAnimationLoop=function(e){_=e},this.dispose=function(){},this.getStandingMatrix=function(){return console.warn("THREE.WebXRManager: getStandingMatrix() is no longer needed."),new Qn},this.getDevice=function(){console.warn("THREE.WebXRManager: getDevice() has been deprecated.")},this.setDevice=function(){console.warn("THREE.WebXRManager: setDevice() has been deprecated.")},this.setFrameOfReferenceType=function(){console.warn("THREE.WebXRManager: setFrameOfReferenceType() has been deprecated.")},this.submitFrame=function(){}}function Jh(e){e=e||{};var i=void 0!==e.canvas?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),t=void 0!==e.context?e.context:null,n=void 0!==e.alpha&&e.alpha,r=void 0===e.depth||e.depth,a=void 0===e.stencil||e.stencil,o=void 0!==e.antialias&&e.antialias,s=void 0===e.premultipliedAlpha||e.premultipliedAlpha,l=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,u=void 0!==e.powerPreference?e.powerPreference:"default",h=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat,f=null,_=null;this.domElement=i,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.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=Ue,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var M,x,b,T,c,w,E,S,A,p,g,d,m,v,L,I,k,y,R=this,N=!1,P=null,C=0,D=0,O=null,F=null,B=-1,G={geometry:null,program:null,wireframe:!1},z=null,U=null,V=new Zn,H=new Zn,j=null,W=i.width,Y=i.height,q=1,X=new Zn(0,0,W,Y),Z=new Zn(0,0,W,Y),J=!1,K=new ao,Q=new Ll,$=!1,ee=!1,te=new Qn,ne=new Pn;function ie(){return null===O?q:1}try{var re={alpha:n,depth:r,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:l,powerPreference:u,failIfMajorPerformanceCaveat:h,xrCompatible:!0};if(i.addEventListener("webglcontextlost",le,!1),i.addEventListener("webglcontextrestored",ue,!1),M=t||i.getContext("webgl",re)||i.getContext("experimental-webgl",re),null===M)throw null!==i.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 ae(){x=new Il(M),b=new Al(M,x,e),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"),y=new ph(M,x,b),T=new dh(M,x,y,b),T.scissor(H.copy(Z).multiplyScalar(q).floor()),T.viewport(V.copy(X).multiplyScalar(q).floor()),c=new Nl(M),w=new $u,E=new fh(M,x,T,w,b,y,c),S=new wl(M),A=new kl(M,S,c),p=new Dl(A,c),L=new Cl(M),g=new Qu(R,x,b),d=new ih,m=new lh,v=new El(R,T,p,s),I=new Sl(M,x,c,b),k=new Rl(M,x,c,b),c.programs=g.programs,R.capabilities=b,R.extensions=x,R.properties=w,R.renderLists=d,R.state=T,R.info=c}ae();var oe="undefined"!=typeof navigator&&"xr"in navigator&&"supportsSession"in navigator.xr?new Zh(R,M):new Xh(R);this.vr=oe;var se=new ch(R,p,b.maxTextureSize);function le(e){e.preventDefault(),N=!0}function ue(){N=!1,ae()}function he(e){var t=e.target;t.removeEventListener("dispose",he),ce(t)}function ce(e){de(e),w.remove(e)}function de(e){var t=w.get(e).program;e.program=void 0,void 0!==t&&g.releaseProgram(t)}function fe(e,t){e.render(function(e){R.renderBufferImmediate(e,t)})}function pe(e,t,n){if(n&&n.isInstancedBufferGeometry&&!b.isWebGL2&&null===x.get("ANGLE_instanced_arrays"))console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{T.initAttributes();var i=n.attributes,r=t.getAttributes(),a=e.defaultAttributeValues;for(var o in r){var s=r[o];if(0<=s){var l=i[o];if(void 0!==l){var u=l.normalized,h=l.itemSize,c=S.get(l);if(void 0===c)continue;var d=c.buffer,f=c.type,p=c.bytesPerElement;if(l.isInterleavedBufferAttribute){var m=l.data,v=m.stride,g=l.offset;m&&m.isInstancedInterleavedBuffer?(T.enableAttributeAndDivisor(s,m.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=m.meshPerAttribute*m.count)):T.enableAttribute(s),M.bindBuffer(34962,d),M.vertexAttribPointer(s,h,f,u,v*p,g*p)}else l.isInstancedBufferAttribute?(T.enableAttributeAndDivisor(s,l.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=l.meshPerAttribute*l.count)):T.enableAttribute(s),M.bindBuffer(34962,d),M.vertexAttribPointer(s,h,f,u,0,0)}else if(void 0!==a){var y=a[o];if(void 0!==y)switch(y.length){case 2:M.vertexAttrib2fv(s,y);break;case 3:M.vertexAttrib3fv(s,y);break;case 4:M.vertexAttrib4fv(s,y);break;default:M.vertexAttrib1fv(s,y)}}}}T.disableUnusedAttributes()}}this.shadowMap=se,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 q},this.setPixelRatio=function(e){void 0!==e&&(q=e,this.setSize(W,Y,!1))},this.getSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),e=new Rn),e.set(W,Y)},this.setSize=function(e,t,n){oe.isPresenting()?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(W=e,Y=t,i.width=Math.floor(e*q),i.height=Math.floor(t*q),!1!==n&&(i.style.width=e+"px",i.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 Rn),e.set(W*q,Y*q).floor()},this.setDrawingBufferSize=function(e,t,n){W=e,Y=t,q=n,i.width=Math.floor(e*n),i.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 Zn),e.copy(V)},this.getViewport=function(e){return e.copy(X)},this.setViewport=function(e,t,n,i){e.isVector4?X.set(e.x,e.y,e.z,e.w):X.set(e,t,n,i),T.viewport(V.copy(X).multiplyScalar(q).floor())},this.getScissor=function(e){return e.copy(Z)},this.setScissor=function(e,t,n,i){e.isVector4?Z.set(e.x,e.y,e.z,e.w):Z.set(e,t,n,i),T.scissor(H.copy(Z).multiplyScalar(q).floor())},this.getScissorTest=function(){return J},this.setScissorTest=function(e){T.setScissorTest(J=e)},this.getClearColor=function(){return v.getClearColor()},this.setClearColor=function(){v.setClearColor.apply(v,arguments)},this.getClearAlpha=function(){return v.getClearAlpha()},this.setClearAlpha=function(){v.setClearAlpha.apply(v,arguments)},this.clear=function(e,t,n){var i=0;void 0!==e&&!e||(i|=16384),void 0!==t&&!t||(i|=256),void 0!==n&&!n||(i|=1024),M.clear(i)},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(){i.removeEventListener("webglcontextlost",le,!1),i.removeEventListener("webglcontextrestored",ue,!1),d.dispose(),m.dispose(),w.dispose(),p.dispose(),oe.dispose(),ge.stop()},this.renderBufferImmediate=function(e,t){T.initAttributes();var n=w.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 i=t.getAttributes();e.hasPositions&&(M.bindBuffer(34962,n.position),M.bufferData(34962,e.positionArray,35048),T.enableAttribute(i.position),M.vertexAttribPointer(i.position,3,5126,!1,0,0)),e.hasNormals&&(M.bindBuffer(34962,n.normal),M.bufferData(34962,e.normalArray,35048),T.enableAttribute(i.normal),M.vertexAttribPointer(i.normal,3,5126,!1,0,0)),e.hasUvs&&(M.bindBuffer(34962,n.uv),M.bufferData(34962,e.uvArray,35048),T.enableAttribute(i.uv),M.vertexAttribPointer(i.uv,2,5126,!1,0,0)),e.hasColors&&(M.bindBuffer(34962,n.color),M.bufferData(34962,e.colorArray,35048),T.enableAttribute(i.color),M.vertexAttribPointer(i.color,3,5126,!1,0,0)),T.disableUnusedAttributes(),M.drawArrays(4,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,n,i,r,a){var o=r.isMesh&&r.matrixWorld.determinant()<0;T.setMaterial(i,o);var s=we(e,t,i,r),l=!1;G.geometry===n.id&&G.program===s.id&&G.wireframe===(!0===i.wireframe)||(G.geometry=n.id,G.program=s.id,G.wireframe=!0===i.wireframe,l=!0),r.morphTargetInfluences&&(L.update(r,n,i,s),l=!0);var u,h=n.index,c=n.attributes.position,d=1;!0===i.wireframe&&(h=A.getWireframeAttribute(n),d=2);var f=I;null!==h&&(u=S.get(h),f=k,f.setIndex(u)),l&&(pe(i,s,n),null!==h&&M.bindBuffer(34963,u.buffer));var p=1/0;null!==h?p=h.count:void 0!==c&&(p=c.count);var m=n.drawRange.start*d,v=n.drawRange.count*d,g=null!==a?a.start*d:0,y=null!==a?a.count*d:1/0,_=Math.max(m,g),x=Math.min(p,m+v,g+y)-1,b=Math.max(0,x-_+1);if(0!==b){if(r.isMesh)if(!0===i.wireframe)T.setLineWidth(i.wireframeLinewidth*ie()),f.setMode(1);else switch(r.drawMode){case Yt:f.setMode(4);break;case qt:f.setMode(5);break;case Xt:f.setMode(6)}else if(r.isLine){var w=i.linewidth;void 0===w&&(w=1),T.setLineWidth(w*ie()),r.isLineSegments?f.setMode(1):r.isLineLoop?f.setMode(2):f.setMode(3)}else r.isPoints?f.setMode(0):r.isSprite&&f.setMode(4);n&&n.isInstancedBufferGeometry?0<n.maxInstancedCount&&f.renderInstances(n,_,b):f.render(_,b)}},this.compile=function(n,e){_=m.get(n,e),_.init(),n.traverse(function(e){e.isLight&&(_.pushLight(e),e.castShadow&&_.pushShadow(e))}),_.setupLights(e),n.traverse(function(e){if(e.material)if((0,Ge.default)(e.material))for(var t=0;t<e.material.length;t++)be(e.material[t],n.fog,e);else be(e.material,n.fog,e)})};var me=null;function ve(e){oe.isPresenting()||me&&me(e)}var ge=new bl;function ye(e,t,n,i){if(!1!==e.visible){var r=e.layers.test(t.layers);if(r)if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)_.pushLight(e),e.castShadow&&_.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||K.intersectsSprite(e)){i&&ne.setFromMatrixPosition(e.matrixWorld).applyMatrix4(te);var a=p.update(e),o=e.material;o.visible&&f.push(e,a,o,n,ne.z,null)}}else if(e.isImmediateRenderObject)i&&ne.setFromMatrixPosition(e.matrixWorld).applyMatrix4(te),f.push(e,null,e.material,n,ne.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.update(),!e.frustumCulled||K.intersectsObject(e)))if(i&&ne.setFromMatrixPosition(e.matrixWorld).applyMatrix4(te),a=p.update(e),o=e.material,(0,Ge.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,ne.z,h)}else o.visible&&f.push(e,a,o,n,ne.z,null);var d=e.children;for(l=0,u=d.length;l<u;l++)ye(d[l],t,n,i)}}function _e(e,t,n,i){for(var r=0,a=e.length;r<a;r++){var o=e[r],s=o.object,l=o.geometry,u=void 0===i?o.material:i,h=o.group;if(n.isArrayCamera){U=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(V.copy(p.viewport)),_.setupLights(p),xe(s,t,p,l,u,h))}}else U=null,xe(s,t,n,l,u,h)}}function xe(e,t,n,i,r,a){if(e.onBeforeRender(R,t,n,i,r,a),_=m.get(t,U||n),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){T.setMaterial(r);var o=we(n,t.fog,r,e);G.geometry=null,G.program=null,G.wireframe=!1,fe(e,o)}else R.renderBufferDirect(n,t.fog,i,r,e,a);e.onAfterRender(R,t,n,i,r,a),_=m.get(t,U||n)}function be(e,t,n){var i=w.get(e),r=_.state.lights,a=_.state.shadowsArray,o=r.state.version,s=g.getParameters(e,r.state,a,t,Q.numPlanes,Q.numIntersection,n),l=g.getProgramCode(e,s),u=i.program,h=!0;if(void 0===u)e.addEventListener("dispose",he);else if(u.code!==l)de(e);else if(i.lightsStateVersion!==o)i.lightsStateVersion=o,h=!1;else{if(void 0!==s.shaderID)return;h=!1}if(h){if(s.shaderID){var c=xl[s.shaderID];i.shader={name:e.type,uniforms:Fa(c.uniforms),vertexShader:c.vertexShader,fragmentShader:c.fragmentShader}}else i.shader={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};e.onBeforeCompile(i.shader,R),l=g.getProgramCode(e,s),u=g.acquireProgram(e,i.shader,s,l),i.program=u,e.program=u}var d=u.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var f=0;f<R.maxMorphTargets;f++)0<=d["morphTarget"+f]&&e.numSupportedMorphTargets++}if(e.morphNormals)for(e.numSupportedMorphNormals=0,f=0;f<R.maxMorphNormals;f++)0<=d["morphNormal"+f]&&e.numSupportedMorphNormals++;var p=i.shader.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(i.numClippingPlanes=Q.numPlanes,i.numIntersection=Q.numIntersection,p.clippingPlanes=Q.uniform),i.fog=t,i.lightsStateVersion=o,e.lights&&(p.ambientLightColor.value=r.state.ambient,p.lightProbe.value=r.state.probe,p.directionalLights.value=r.state.directional,p.spotLights.value=r.state.spot,p.rectAreaLights.value=r.state.rectArea,p.pointLights.value=r.state.point,p.hemisphereLights.value=r.state.hemi,p.directionalShadowMap.value=r.state.directionalShadowMap,p.directionalShadowMatrix.value=r.state.directionalShadowMatrix,p.spotShadowMap.value=r.state.spotShadowMap,p.spotShadowMatrix.value=r.state.spotShadowMatrix,p.pointShadowMap.value=r.state.pointShadowMap,p.pointShadowMatrix.value=r.state.pointShadowMatrix);var m=i.program.getUniforms(),v=Cu.seqWithValue(m.seq,p);i.uniformsList=v}function we(e,t,n,i){E.resetTextureUnits();var r=w.get(n),a=_.state.lights;if($&&(ee||e!==z)){var o=e===z&&n.id===B;Q.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,e,r,o)}!1===n.needsUpdate&&(void 0===r.program||n.fog&&r.fog!==t||n.lights&&r.lightsStateVersion!==a.state.version||void 0!==r.numClippingPlanes&&(r.numClippingPlanes!==Q.numPlanes||r.numIntersection!==Q.numIntersection))&&(n.needsUpdate=!0),n.needsUpdate&&(be(n,t,i),n.needsUpdate=!1);var s=!1,l=!1,u=!1,h=r.program,c=h.getUniforms(),d=r.shader.uniforms;if(T.useProgram(h.program)&&(s=!0,l=!0,u=!0),n.id!==B&&(B=n.id,l=!0),s||z!==e){if(c.setValue(M,"projectionMatrix",e.projectionMatrix),b.logarithmicDepthBuffer&&c.setValue(M,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),z!==e&&(z=e,l=!0,u=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.envMap){var f=c.map.cameraPosition;void 0!==f&&f.setValue(M,ne.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&c.setValue(M,"viewMatrix",e.matrixWorldInverse)}if(n.skinning){c.setOptional(M,i,"bindMatrix"),c.setOptional(M,i,"bindMatrixInverse");var p=i.skeleton;if(p){var m=p.bones;if(b.floatVertexTextures){if(void 0===p.boneTexture){var v=Math.sqrt(4*m.length);v=kn.ceilPowerOfTwo(v),v=Math.max(v,4);var g=new Float32Array(v*v*4);g.set(p.boneMatrices);var y=new io(g,v,v,st,$e);y.needsUpdate=!0,p.boneMatrices=g,p.boneTexture=y,p.boneTextureSize=v}c.setValue(M,"boneTexture",p.boneTexture,E),c.setValue(M,"boneTextureSize",p.boneTextureSize)}else c.setOptional(M,p,"boneMatrices")}}return l&&(c.setValue(M,"toneMappingExposure",R.toneMappingExposure),c.setValue(M,"toneMappingWhitePoint",R.toneMappingWhitePoint),n.lights&&Be(d,u),t&&n.fog&&Le(d,t),n.isMeshBasicMaterial?Me(d,n):n.isMeshLambertMaterial?(Me(d,n),Ie(d,n)):n.isMeshPhongMaterial?(Me(d,n),(n.isMeshToonMaterial?Re:ke)(d,n)):n.isMeshStandardMaterial?(Me(d,n),(n.isMeshPhysicalMaterial?Pe:Ne)(d,n)):n.isMeshMatcapMaterial?(Me(d,n),Ce(d,n)):n.isMeshDepthMaterial?(Me(d,n),De(d,n)):n.isMeshDistanceMaterial?(Me(d,n),Oe(d,n)):n.isMeshNormalMaterial?(Me(d,n),Fe(d,n)):n.isLineBasicMaterial?(Te(d,n),n.isLineDashedMaterial&&Ee(d,n)):n.isPointsMaterial?Se(d,n):n.isSpriteMaterial?Ae(d,n):n.isShadowMaterial&&(d.color.value.copy(n.color),d.opacity.value=n.opacity),void 0!==d.ltc_1&&(d.ltc_1.value=_l.LTC_1),void 0!==d.ltc_2&&(d.ltc_2.value=_l.LTC_2),Cu.upload(M,r.uniformsList,d,E)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(Cu.upload(M,r.uniformsList,d,E),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&c.setValue(M,"center",i.center),c.setValue(M,"modelViewMatrix",i.modelViewMatrix),c.setValue(M,"normalMatrix",i.normalMatrix),c.setValue(M,"modelMatrix",i.matrixWorld),h}function Me(e,t){var n;e.opacity.value=t.opacity,t.color&&e.diffuse.value.copy(t.color),t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.specularMap&&(e.specularMap.value=t.specularMap),t.envMap&&(e.envMap.value=t.envMap,e.flipEnvMap.value=t.envMap.isCubeTexture?-1:1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio,e.maxMipLevel.value=w.get(t.envMap).__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),t.map?n=t.map:t.specularMap?n=t.specularMap:t.displacementMap?n=t.displacementMap:t.normalMap?n=t.normalMap:t.bumpMap?n=t.bumpMap:t.roughnessMap?n=t.roughnessMap:t.metalnessMap?n=t.metalnessMap:t.alphaMap?n=t.alphaMap:t.emissiveMap&&(n=t.emissiveMap),void 0!==n&&(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}function Te(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}function Ee(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function Se(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*q,e.scale.value=.5*Y,e.map.value=t.map,null!==t.map&&(!0===t.map.matrixAutoUpdate&&t.map.updateMatrix(),e.uvTransform.value.copy(t.map.matrix))}function Ae(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,e.map.value=t.map,null!==t.map&&(!0===t.map.matrixAutoUpdate&&t.map.updateMatrix(),e.uvTransform.value.copy(t.map.matrix))}function Le(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 Ie(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}function ke(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===ze&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===ze&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function Re(e,t){ke(e,t),t.gradientMap&&(e.gradientMap.value=t.gradientMap)}function Ne(e,t){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===ze&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===ze&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}function Pe(e,t){Ne(e,t),e.reflectivity.value=t.reflectivity,e.clearCoat.value=t.clearCoat,e.clearCoatRoughness.value=t.clearCoatRoughness}function Ce(e,t){t.matcap&&(e.matcap.value=t.matcap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===ze&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===ze&&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){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function Oe(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 Fe(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===ze&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===ze&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function Be(e,t){e.ambientLightColor.needsUpdate=t,e.lightProbe.needsUpdate=t,e.directionalLights.needsUpdate=t,e.pointLights.needsUpdate=t,e.spotLights.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}ge.setAnimationLoop(ve),"undefined"!=typeof window&&ge.setContext(window),this.setAnimationLoop=function(e){me=e,oe.setAnimationLoop(e),ge.start()},this.render=function(e,t,n,i){var r,a;if(void 0!==n&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),r=arguments[2]),void 0!==i&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),a=arguments[3]),t&&t.isCamera){if(!N){G.geometry=null,G.program=null,G.wireframe=!1,B=-1,z=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),oe.enabled&&(t=oe.getCamera(t)),_=m.get(e,t),_.init(),e.onBeforeRender(R,e,t,r||O),te.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),K.setFromMatrix(te),ee=this.localClippingEnabled,$=Q.init(this.clippingPlanes,ee,t),f=d.get(e,t),f.init(),ye(e,t,0,R.sortObjects),!0===R.sortObjects&&f.sort(),$&&Q.beginShadows();var o=_.state.shadowsArray;se.render(o,e,t),_.setupLights(t),$&&Q.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==r&&this.setRenderTarget(r),v.render(f,e,t,a);var s=f.opaque,l=f.transparent;if(e.overrideMaterial){var u=e.overrideMaterial;s.length&&_e(s,e,t,u),l.length&&_e(l,e,t,u)}else s.length&&_e(s,e,t),l.length&&_e(l,e,t);e.onAfterRender(R,e,t),null!==O&&(E.updateRenderTargetMipmap(O),E.updateMultisampleRenderTarget(O)),T.buffers.depth.setTest(!0),T.buffers.depth.setMask(!0),T.buffers.color.setMask(!0),T.setPolygonOffset(!1),oe.enabled&&oe.submitFrame(),f=null,_=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(e){P!==e&&M.bindFramebuffer(36160,e),P=e},this.getActiveCubeFace=function(){return C},this.getActiveMipmapLevel=function(){return D},this.getRenderTarget=function(){return O},this.setRenderTarget=function(e,t,n){O=e,C=t,D=n,e&&void 0===w.get(e).__webglFramebuffer&&E.setupRenderTarget(e);var i=P,r=!1;if(e){var a=w.get(e).__webglFramebuffer;e.isWebGLRenderTargetCube?(i=a[t||0],r=!0):i=e.isWebGLMultisampleRenderTarget?w.get(e).__webglMultisampledFramebuffer:a,V.copy(e.viewport),H.copy(e.scissor),j=e.scissorTest}else V.copy(X).multiplyScalar(q).floor(),H.copy(Z).multiplyScalar(q).floor(),j=J;if(F!==i&&(M.bindFramebuffer(36160,i),F=i),T.viewport(V),T.scissor(H),T.setScissorTest(j),r){var o=w.get(e.texture);M.framebufferTexture2D(36160,36064,34069+(t||0),o.__webglTexture,n||0)}},this.readRenderTargetPixels=function(e,t,n,i,r,a,o){if(e&&e.isWebGLRenderTarget){var s=w.get(e).__webglFramebuffer;if(e.isWebGLRenderTargetCube&&void 0!==o&&(s=s[o]),s){var l=!1;s!==F&&(M.bindFramebuffer(36160,s),l=!0);try{var u=e.texture,h=u.format,c=u.type;if(h!==st&&y.convert(h)!==M.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(c===qe||y.convert(c)===M.getParameter(35738)||c===$e&&(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-i&&0<=n&&n<=e.height-r&&M.readPixels(t,n,i,r,y.convert(h),y.convert(c),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{l&&M.bindFramebuffer(36160,F)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,n){var i=t.image.width,r=t.image.height,a=y.convert(t.format);E.setTexture2D(t,0),M.copyTexImage2D(3553,n||0,a,e.x,e.y,i,r,0)},this.copyTextureToTexture=function(e,t,n,i){var r=t.image.width,a=t.image.height,o=y.convert(n.format),s=y.convert(n.type);E.setTexture2D(n,0),t.isDataTexture?M.texSubImage2D(3553,i||0,e.x,e.y,r,a,o,s,t.image.data):M.texSubImage2D(3553,i||0,e.x,e.y,o,s,t.image)},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Kh(e,t){this.name="",this.color=new Sr(e),this.density=void 0!==t?t:25e-5}function Qh(e,t,n){this.name="",this.color=new Sr(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}function $h(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function ec(e,t,n,i){this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===i}function tc(e){Nr.call(this),this.type="SpriteMaterial",this.color=new Sr(16777215),this.map=null,this.rotation=0,this.sizeAttenuation=!0,this.lights=!1,this.transparent=!0,this.setValues(e)}function nc(e){if(pr.call(this),this.type="Sprite",void 0===gh){gh=new wa;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 $h(t,5);gh.setIndex([0,1,2,0,2,3]),gh.addAttribute("position",new ec(n,3,0,!1)),gh.addAttribute("uv",new ec(n,2,3,!1))}this.geometry=gh,this.material=void 0!==e?e:new tc,this.center=new Rn(.5,.5)}function ic(e,t,n,i,r,a){bh.subVectors(e,n).addScalar(.5).multiply(i),void 0!==r?(wh.x=a*bh.x-r*bh.y,wh.y=r*bh.x+a*bh.y):wh.copy(bh),e.copy(t),e.x+=wh.x,e.y+=wh.y,e.applyMatrix4(Mh)}function rc(){pr.call(this),this.type="LOD",(0,u.default)(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function ac(e,t){e&&e.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),Ma.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Qn,this.bindMatrixInverse=new Qn}function oc(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new Qn)}}function sc(){pr.call(this),this.type="Bone"}function lc(e){Nr.call(this),this.type="LineBasicMaterial",this.color=new Sr(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(e)}function uc(e,t,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),pr.call(this),this.type="Line",this.geometry=void 0!==e?e:new wa,this.material=void 0!==t?t:new lc({color:16777215*Math.random()})}function hc(e,t){uc.call(this,e,t),this.type="LineSegments"}function cc(e,t){uc.call(this,e,t),this.type="LineLoop"}function dc(e){Nr.call(this),this.type="PointsMaterial",this.color=new Sr(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.lights=!1,this.setValues(e)}function fc(e,t){pr.call(this),this.type="Points",this.geometry=void 0!==e?e:new wa,this.material=void 0!==t?t:new dc({color:16777215*Math.random()}),this.updateMorphTargets()}function pc(e,t,n,i,r,a,o,s,l){Xn.call(this,e,t,n,i,r,a,o,s,l),this.format=void 0!==o?o:ot,this.minFilter=void 0!==a?a:Ve,this.magFilter=void 0!==r?r:Ve,this.generateMipmaps=!1}function mc(e,t,n,i,r,a,o,s,l,u,h,c){Xn.call(this,null,a,o,s,l,u,i,r,h,c),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function vc(e,t,n,i,r,a,o,s,l){Xn.call(this,e,t,n,i,r,a,o,s,l),this.needsUpdate=!0}function gc(e,t,n,i,r,a,o,s,l,u){if(u=void 0!==u?u:ct,u!==ct&&u!==dt)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&u===ct&&(n=Je),void 0===n&&u===dt&&(n=rt),Xn.call(this,null,i,r,a,o,s,u,n,l),this.image={width:e,height:t},this.magFilter=void 0!==o?o:Ce,this.minFilter=void 0!==s?s:Ce,this.flipY=!1,this.generateMipmaps=!1}function yc(e){wa.call(this),this.type="WireframeGeometry";var t,n,i,r,a,o,s,l,u,h,c=[],d=[0,0],f={},p=["a","b","c"];if(e&&e.isGeometry){var m=e.faces;for(t=0,i=m.length;t<i;t++){var v=m[t];for(n=0;n<3;n++)s=v[p[n]],l=v[p[(n+1)%3]],d[0]=Math.min(s,l),d[1]=Math.max(s,l),u=d[0]+","+d[1],void 0===f[u]&&(f[u]={index1:d[0],index2:d[1]})}for(u in f)o=f[u],h=e.vertices[o.index1],c.push(h.x,h.y,h.z),h=e.vertices[o.index2],c.push(h.x,h.y,h.z)}else if(e&&e.isBufferGeometry){var g,y,_,x,b,w,M,T;if(h=new Pn,null!==e.index){for(g=e.attributes.position,y=e.index,_=e.groups,0===_.length&&(_=[{start:0,count:y.count,materialIndex:0}]),r=0,a=_.length;r<a;++r)for(x=_[r],b=x.start,w=x.count,t=b,i=b+w;t<i;t+=3)for(n=0;n<3;n++)s=y.getX(t+n),l=y.getX(t+(n+1)%3),d[0]=Math.min(s,l),d[1]=Math.max(s,l),u=d[0]+","+d[1],void 0===f[u]&&(f[u]={index1:d[0],index2:d[1]});for(u in f)o=f[u],h.fromBufferAttribute(g,o.index1),c.push(h.x,h.y,h.z),h.fromBufferAttribute(g,o.index2),c.push(h.x,h.y,h.z)}else for(g=e.attributes.position,t=0,i=g.count/3;t<i;t++)for(n=0;n<3;n++)M=3*t+n,h.fromBufferAttribute(g,M),c.push(h.x,h.y,h.z),T=3*t+(n+1)%3,h.fromBufferAttribute(g,T),c.push(h.x,h.y,h.z)}this.addAttribute("position",new Vr(c,3))}function _c(e,t,n){Ca.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new xc(e,t,n)),this.mergeVertices()}function xc(e,t,n){wa.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};var i,r,a=[],o=[],s=[],l=[],u=1e-5,h=new Pn,c=new Pn,d=new Pn,f=new Pn,p=new Pn;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var m=t+1;for(i=0;i<=n;i++){var v=i/n;for(r=0;r<=t;r++){var g=r/t;e(g,v,c),o.push(c.x,c.y,c.z),0<=g-u?(e(g-u,v,d),f.subVectors(c,d)):(e(g+u,v,d),f.subVectors(d,c)),0<=v-u?(e(g,v-u,d),p.subVectors(c,d)):(e(g,v+u,d),p.subVectors(d,c)),h.crossVectors(f,p).normalize(),s.push(h.x,h.y,h.z),l.push(g,v)}}for(i=0;i<n;i++)for(r=0;r<t;r++){var y=i*m+r,_=i*m+r+1,x=(i+1)*m+r+1,b=(i+1)*m+r;a.push(y,_,b),a.push(_,x,b)}this.setIndex(a),this.addAttribute("position",new Vr(o,3)),this.addAttribute("normal",new Vr(s,3)),this.addAttribute("uv",new Vr(l,2))}function bc(e,t,n,i){Ca.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i},this.fromBufferGeometry(new wc(e,t,n,i)),this.mergeVertices()}function wc(i,a,e,t){wa.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:i,indices:a,radius:e,detail:t},e=e||1,t=t||0;var h=[],c=[];function n(e){for(var t=new Pn,n=new Pn,i=new Pn,r=0;r<a.length;r+=3)u(a[r+0],t),u(a[r+1],n),u(a[r+2],i),o(t,n,i,e)}function o(e,t,n,i){var r,a,o=Math.pow(2,i),s=[];for(r=0;r<=o;r++){s[r]=[];var l=e.clone().lerp(n,r/o),u=t.clone().lerp(n,r/o),h=o-r;for(a=0;a<=h;a++)s[r][a]=0===a&&r===o?l:l.clone().lerp(u,a/h)}for(r=0;r<o;r++)for(a=0;a<2*(o-r)-1;a++){var c=Math.floor(a/2);a%2==0?(d(s[r][c+1]),d(s[r+1][c]),d(s[r][c])):(d(s[r][c+1]),d(s[r+1][c+1]),d(s[r+1][c]))}}function r(e){for(var t=new Pn,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 Pn,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,i=v(e)/Math.PI+.5;c.push(n,1-i)}f(),l()}function l(){for(var e=0;e<c.length;e+=6){var t=c[e+0],n=c[e+2],i=c[e+4],r=Math.max(t,n,i),a=Math.min(t,n,i);.9<r&&a<.1&&(t<.2&&(c[e+0]+=1),n<.2&&(c[e+2]+=1),i<.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=i[n+0],t.y=i[n+1],t.z=i[n+2]}function f(){for(var e=new Pn,t=new Pn,n=new Pn,i=new Pn,r=new Rn,a=new Rn,o=new Rn,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]),r.set(c[l+0],c[l+1]),a.set(c[l+2],c[l+3]),o.set(c[l+4],c[l+5]),i.copy(e).add(t).add(n).divideScalar(3);var u=m(i);p(r,l+0,e,u),p(a,l+2,t,u),p(o,l+4,n,u)}}function p(e,t,n,i){i<0&&1===e.x&&(c[t]=e.x-1),0===n.x&&0===n.z&&(c[t]=i/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),r(e),s(),this.addAttribute("position",new Vr(h,3)),this.addAttribute("normal",new Vr(h.slice(),3)),this.addAttribute("uv",new Vr(c,2)),0===t?this.computeVertexNormals():this.normalizeNormals()}function Mc(e,t){Ca.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Tc(e,t)),this.mergeVertices()}function Tc(e,t){var n=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],i=[2,1,0,0,3,2,1,3,0,2,3,1];wc.call(this,n,i,e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Ec(e,t){Ca.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Sc(e,t)),this.mergeVertices()}function Sc(e,t){var n=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],i=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];wc.call(this,n,i,e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Ac(e,t){Ca.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Lc(e,t)),this.mergeVertices()}function Lc(e,t){var n=(1+Math.sqrt(5))/2,i=[-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],r=[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];wc.call(this,i,r,e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Ic(e,t){Ca.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new kc(e,t)),this.mergeVertices()}function kc(e,t){var n=(1+Math.sqrt(5))/2,i=1/n,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,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],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];wc.call(this,r,a,e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Rc(e,t,n,i,r,a){Ca.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:r},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new Nc(e,t,n,i,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function Nc(o,s,l,u,e){wa.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 r,c,d=new Pn,f=new Pn,t=new Rn,p=new Pn,m=[],v=[],n=[],a=[];function i(){for(r=0;r<s;r++)g(r);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 i=c/u*Math.PI*2,r=Math.sin(i),a=-Math.cos(i);f.x=a*t.x+r*n.x,f.y=a*t.y+r*n.y,f.z=a*t.z+r*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(r=1;r<=u;r++){var e=(u+1)*(c-1)+(r-1),t=(u+1)*c+(r-1),n=(u+1)*c+r,i=(u+1)*(c-1)+r;a.push(e,t,i),a.push(t,n,i)}}function _(){for(r=0;r<=s;r++)for(c=0;c<=u;c++)t.x=r/s,t.y=c/u,n.push(t.x,t.y)}i(),this.setIndex(a),this.addAttribute("position",new Vr(m,3)),this.addAttribute("normal",new Vr(v,3)),this.addAttribute("uv",new Vr(n,2))}function Pc(e,t,n,i,r,a,o){Ca.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:r,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Cc(e,t,n,i,r,a)),this.mergeVertices()}function Cc(e,t,n,i,r,a){wa.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:r,q:a},e=e||1,t=t||.4,n=Math.floor(n)||64,i=Math.floor(i)||8,r=r||2,a=a||3;var o,s,l=[],u=[],h=[],c=[],d=new Pn,f=new Pn,p=new Pn,m=new Pn,v=new Pn,g=new Pn,y=new Pn;for(o=0;o<=n;++o){var _=o/n*r*Math.PI*2;for(A(_,r,a,e,p),A(_+.01,r,a,e,m),g.subVectors(m,p),y.addVectors(m,p),v.crossVectors(g,y),y.crossVectors(v,g),v.normalize(),y.normalize(),s=0;s<=i;++s){var x=s/i*Math.PI*2,b=-t*Math.cos(x),w=t*Math.sin(x);d.x=p.x+(b*y.x+w*v.x),d.y=p.y+(b*y.y+w*v.y),d.z=p.z+(b*y.z+w*v.z),u.push(d.x,d.y,d.z),f.subVectors(d,p).normalize(),h.push(f.x,f.y,f.z),c.push(o/n),c.push(s/i)}}for(s=1;s<=n;s++)for(o=1;o<=i;o++){var M=(i+1)*(s-1)+(o-1),T=(i+1)*s+(o-1),E=(i+1)*s+o,S=(i+1)*(s-1)+o;l.push(M,T,S),l.push(T,E,S)}function A(e,t,n,i,r){var a=Math.cos(e),o=Math.sin(e),s=n/t*e,l=Math.cos(s);r.x=i*(2+l)*.5*a,r.y=i*(2+l)*o*.5,r.z=i*Math.sin(s)*.5}this.setIndex(l),this.addAttribute("position",new Vr(u,3)),this.addAttribute("normal",new Vr(h,3)),this.addAttribute("uv",new Vr(c,2))}function Dc(e,t,n,i,r){Ca.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:r},this.fromBufferGeometry(new Oc(e,t,n,i,r)),this.mergeVertices()}function Oc(e,t,n,i,r){wa.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:r},e=e||1,t=t||.4,n=Math.floor(n)||8,i=Math.floor(i)||6,r=r||2*Math.PI;var a,o,s=[],l=[],u=[],h=[],c=new Pn,d=new Pn,f=new Pn;for(a=0;a<=n;a++)for(o=0;o<=i;o++){var p=o/i*r,m=a/n*Math.PI*2;d.x=(e+t*Math.cos(m))*Math.cos(p),d.y=(e+t*Math.cos(m))*Math.sin(p),d.z=t*Math.sin(m),l.push(d.x,d.y,d.z),c.x=e*Math.cos(p),c.y=e*Math.sin(p),f.subVectors(d,c).normalize(),u.push(f.x,f.y,f.z),h.push(o/i),h.push(a/n)}for(a=1;a<=n;a++)for(o=1;o<=i;o++){var v=(i+1)*a+o-1,g=(i+1)*(a-1)+o-1,y=(i+1)*(a-1)+o,_=(i+1)*a+o;s.push(v,g,_),s.push(g,y,_)}this.setIndex(s),this.addAttribute("position",new Vr(l,3)),this.addAttribute("normal",new Vr(u,3)),this.addAttribute("uv",new Vr(h,2))}(0,p.default)(Xh.prototype,h.prototype),(0,p.default)(Zh.prototype,h.prototype),(0,p.default)(Kh.prototype,{isFogExp2:!0,clone:function(){return new Kh(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),(0,p.default)(Qh.prototype,{isFog:!0,clone:function(){return new Qh(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),(0,g.default)($h.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),(0,p.default)($h.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setArray:function(e){if((0,Ge.default)(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==e?e.length/this.stride:0,this.array=e,this},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.dynamic=e.dynamic,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(var i=0,r=this.stride;i<r;i++)this.array[e+i]=t.array[n+i];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}}),(0,u.default)(ec.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),(0,p.default)(ec.prototype,{isInterleavedBufferAttribute:!0,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,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]=i,this},setXYZW:function(e,t,n,i,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]=i,this.data.array[e+3]=r,this}}),tc.prototype=(0,l.default)(Nr.prototype),tc.prototype.constructor=tc,tc.prototype.isSpriteMaterial=!0,tc.prototype.copy=function(e){return Nr.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this},nc.prototype=(0,p.default)((0,l.default)(pr.prototype),{constructor:nc,isSprite:!0,raycast:(yh=new Pn,_h=new Pn,xh=new Pn,bh=new Rn,wh=new Rn,Mh=new Qn,Th=new Pn,Eh=new Pn,Sh=new Pn,Ah=new Rn,Lh=new Rn,Ih=new Rn,function(e,t){_h.setFromMatrixScale(this.matrixWorld),Mh.copy(e._camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e._camera.matrixWorldInverse,this.matrixWorld),xh.setFromMatrixPosition(this.modelViewMatrix),e._camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&_h.multiplyScalar(-xh.z);var n,i,r=this.material.rotation;0!==r&&(i=Math.cos(r),n=Math.sin(r));var a=this.center;ic(Th.set(-.5,-.5,0),xh,a,_h,n,i),ic(Eh.set(.5,-.5,0),xh,a,_h,n,i),ic(Sh.set(.5,.5,0),xh,a,_h,n,i),Ah.set(0,0),Lh.set(1,0),Ih.set(1,1);var o=e.ray.intersectTriangle(Th,Eh,Sh,!1,yh);if(null!==o||(ic(Eh.set(-.5,.5,0),xh,a,_h,n,i),Lh.set(0,1),o=e.ray.intersectTriangle(Th,Sh,Eh,!1,yh),null!==o)){var s=e.ray.origin.distanceTo(yh);s<e.near||s>e.far||t.push({distance:s,point:yh.clone(),uv:br.getUV(yh,Th,Eh,Sh,Ah,Lh,Ih,new Rn),face:null,object:this})}}),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return pr.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this}}),rc.prototype=(0,p.default)((0,l.default)(pr.prototype),{constructor:rc,isLOD:!0,copy:function(e){pr.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,i=t.length;n<i;n++){var r=t[n];this.addLevel(r.object.clone(),r.distance)}return this},addLevel:function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var n=this.levels,i=0;i<n.length&&!(t<n[i].distance);i++);return n.splice(i,0,{distance:t,object:e}),this.add(e),this},getObjectForDistance:function(e){for(var t=this.levels,n=1,i=t.length;n<i&&!(e<t[n].distance);n++);return t[n-1].object},raycast:(Nh=new Pn,function(e,t){Nh.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(Nh);this.getObjectForDistance(n).raycast(e,t)}),update:(kh=new Pn,Rh=new Pn,function(e){var t=this.levels;if(1<t.length){kh.setFromMatrixPosition(e.matrixWorld),Rh.setFromMatrixPosition(this.matrixWorld);var n=kh.distanceTo(Rh);t[0].object.visible=!0;for(var i=1,r=t.length;i<r&&n>=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(;i<r;i++)t[i].object.visible=!1}}),toJSON:function(e){var t=pr.prototype.toJSON.call(this,e);t.object.levels=[];for(var n=this.levels,i=0,r=n.length;i<r;i++){var a=n[i];t.object.levels.push({object:a.object.uuid,distance:a.distance})}return t}}),ac.prototype=(0,p.default)((0,l.default)(Ma.prototype),{constructor:ac,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 Zn,t=this.geometry.attributes.skinWeight,n=0,i=t.count;n<i;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(n);var r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}},updateMatrixWorld:function(e){Ma.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)}}),(0,p.default)(oc.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new Qn;this.bones[e]&&n.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(n)}},pose:function(){var e,t,n;for(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:(Ph=new Qn,Ch=new Qn,function(){for(var e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture,r=0,a=e.length;r<a;r++){var o=e[r]?e[r].matrixWorld:Ch;Ph.multiplyMatrices(o,t[r]),Ph.toArray(n,16*r)}void 0!==i&&(i.needsUpdate=!0)}),clone:function(){return new oc(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,n=this.bones.length;t<n;t++){var i=this.bones[t];if(i.name===e)return i}}}),sc.prototype=(0,p.default)((0,l.default)(pr.prototype),{constructor:sc,isBone:!0}),lc.prototype=(0,l.default)(Nr.prototype),lc.prototype.constructor=lc,lc.prototype.isLineBasicMaterial=!0,lc.prototype.copy=function(e){return Nr.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this},uc.prototype=(0,p.default)((0,l.default)(pr.prototype),{constructor:uc,isLine:!0,computeLineDistances:(Bh=new Pn,Gh=new Pn,function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],i=1,r=t.count;i<r;i++)Bh.fromBufferAttribute(t,i-1),Gh.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=Bh.distanceTo(Gh);e.addAttribute("lineDistance",new Vr(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices;for(n=e.lineDistances,n[0]=0,i=1,r=a.length;i<r;i++)n[i]=n[i-1],n[i]+=a[i-1].distanceTo(a[i])}return this}),raycast:(Dh=new Qn,Oh=new xr,Fh=new _r,function(e,t){var n=e.linePrecision,i=this.geometry,r=this.matrixWorld;if(null===i.boundingSphere&&i.computeBoundingSphere(),Fh.copy(i.boundingSphere),Fh.applyMatrix4(r),Fh.radius+=n,!1!==e.ray.intersectsSphere(Fh)){Dh.getInverse(r),Oh.copy(e.ray).applyMatrix4(Dh);var a=n/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,s=new Pn,l=new Pn,u=new Pn,h=new Pn,c=this&&this.isLineSegments?2:1;if(i.isBufferGeometry){var d=i.index,f=i.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=Oh.distanceSqToSegment(s,l,h,u);if(!(o<x)){h.applyMatrix4(this.matrixWorld);var b=e.ray.origin.distanceTo(h);b<e.near||b>e.far||t.push({distance:b,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=Oh.distanceSqToSegment(s,l,h,u),o<x||(h.applyMatrix4(this.matrixWorld),b=e.ray.origin.distanceTo(h),b<e.near||b>e.far||t.push({distance:b,point:u.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}))}else if(i.isGeometry){var w=i.vertices,M=w.length;for(v=0;v<M-1;v+=c)x=Oh.distanceSqToSegment(w[v],w[v+1],h,u),o<x||(h.applyMatrix4(this.matrixWorld),b=e.ray.origin.distanceTo(h),b<e.near||b>e.far||t.push({distance:b,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)}}),hc.prototype=(0,p.default)((0,l.default)(uc.prototype),{constructor:hc,isLineSegments:!0,computeLineDistances:(zh=new Pn,Uh=new Pn,function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[],i=0,r=t.count;i<r;i+=2)zh.fromBufferAttribute(t,i),Uh.fromBufferAttribute(t,i+1),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+zh.distanceTo(Uh);e.addAttribute("lineDistance",new Vr(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices;for(n=e.lineDistances,i=0,r=a.length;i<r;i+=2)zh.copy(a[i]),Uh.copy(a[i+1]),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+zh.distanceTo(Uh)}return this})}),cc.prototype=(0,p.default)((0,l.default)(uc.prototype),{constructor:cc,isLineLoop:!0}),dc.prototype=(0,l.default)(Nr.prototype),dc.prototype.constructor=dc,dc.prototype.isPointsMaterial=!0,dc.prototype.copy=function(e){return Nr.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this},fc.prototype=(0,p.default)((0,l.default)(pr.prototype),{constructor:fc,isPoints:!0,raycast:(Vh=new Qn,Hh=new xr,jh=new _r,function(r,a){var o=this,e=this.geometry,s=this.matrixWorld,t=r.params.Points.threshold;if(null===e.boundingSphere&&e.computeBoundingSphere(),jh.copy(e.boundingSphere),jh.applyMatrix4(s),jh.radius+=t,!1!==r.ray.intersectsSphere(jh)){Vh.getInverse(s),Hh.copy(r.ray).applyMatrix4(Vh);var n=t/((this.scale.x+this.scale.y+this.scale.z)/3),l=n*n,i=new Pn,u=new Pn;if(e.isBufferGeometry){var h=e.index,c=e.attributes,d=c.position.array;if(null!==h)for(var f=h.array,p=0,m=f.length;p<m;p++){var v=f[p];i.fromArray(d,3*v),_(i,v)}else{p=0;for(var g=d.length/3;p<g;p++)i.fromArray(d,3*p),_(i,p)}}else{var y=e.vertices;for(p=0,g=y.length;p<g;p++)_(y[p],p)}}function _(e,t){var n=Hh.distanceSqToPoint(e);if(n<l){Hh.closestPointToPoint(e,u),u.applyMatrix4(s);var i=r.ray.origin.distanceTo(u);if(i<r.near||i>r.far)return;a.push({distance:i,distanceToRay:Math.sqrt(n),point:u.clone(),index:t,face:null,object:o})}}}),updateMorphTargets:function(){var e,t,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,a=(0,m.default)(r);if(0<a.length){var o=r[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=i.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)}}),pc.prototype=(0,p.default)((0,l.default)(Xn.prototype),{constructor:pc,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),mc.prototype=(0,l.default)(Xn.prototype),mc.prototype.constructor=mc,mc.prototype.isCompressedTexture=!0,vc.prototype=(0,l.default)(Xn.prototype),vc.prototype.constructor=vc,vc.prototype.isCanvasTexture=!0,gc.prototype=(0,l.default)(Xn.prototype),gc.prototype.constructor=gc,gc.prototype.isDepthTexture=!0,yc.prototype=(0,l.default)(wa.prototype),yc.prototype.constructor=yc,_c.prototype=(0,l.default)(Ca.prototype),_c.prototype.constructor=_c,xc.prototype=(0,l.default)(wa.prototype),xc.prototype.constructor=xc,bc.prototype=(0,l.default)(Ca.prototype),bc.prototype.constructor=bc,wc.prototype=(0,l.default)(wa.prototype),wc.prototype.constructor=wc,Mc.prototype=(0,l.default)(Ca.prototype),Mc.prototype.constructor=Mc,Tc.prototype=(0,l.default)(wc.prototype),Tc.prototype.constructor=Tc,Ec.prototype=(0,l.default)(Ca.prototype),Ec.prototype.constructor=Ec,Sc.prototype=(0,l.default)(wc.prototype),Sc.prototype.constructor=Sc,Ac.prototype=(0,l.default)(Ca.prototype),Ac.prototype.constructor=Ac,Lc.prototype=(0,l.default)(wc.prototype),Lc.prototype.constructor=Lc,Ic.prototype=(0,l.default)(Ca.prototype),Ic.prototype.constructor=Ic,kc.prototype=(0,l.default)(wc.prototype),kc.prototype.constructor=kc,Rc.prototype=(0,l.default)(Ca.prototype),Rc.prototype.constructor=Rc,Nc.prototype=(0,l.default)(wa.prototype),Nc.prototype.constructor=Nc,Nc.prototype.toJSON=function(){var e=wa.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e},Pc.prototype=(0,l.default)(Ca.prototype),Pc.prototype.constructor=Pc,Cc.prototype=(0,l.default)(wa.prototype),Cc.prototype.constructor=Cc,Dc.prototype=(0,l.default)(Ca.prototype),Dc.prototype.constructor=Dc,Oc.prototype=(0,l.default)(wa.prototype),Oc.prototype.constructor=Oc;var Fc={triangulate:function(e,t,n){n=n||2;var i,r,a,o,s,l,u,h=t&&t.length,c=h?t[0]*n:e.length,d=Bc(e,0,c,n,!0),f=[];if(!d||d.next===d.prev)return f;if(h&&(d=Wc(e,t,d,n)),e.length>80*n){i=a=e[0],r=o=e[1];for(var p=n;p<c;p+=n)s=e[p],l=e[p+1],s<i&&(i=s),l<r&&(r=l),a<s&&(a=s),o<l&&(o=l);u=Math.max(a-i,o-r),u=0!==u?1/u:0}return zc(d,f,n,i,r,u),f}};function Bc(e,t,n,i,r){var a,o;if(r===0<cd(e,t,n,i))for(a=t;a<n;a+=i)o=ld(a,e[a],e[a+1],o);else for(a=n-i;t<=a;a-=i)o=ld(a,e[a],e[a+1],o);return o&&nd(o,o.next)&&(ud(o),o=o.next),o}function Gc(e,t){if(!e)return e;t=t||e;var n,i=e;do{if(n=!1,i.steiner||!nd(i,i.next)&&0!==td(i.prev,i,i.next))i=i.next;else{if(ud(i),i=t=i.prev,i===i.next)break;n=!0}}while(n||i!==t);return t}function zc(e,t,n,i,r,a,o){if(e){!o&&a&&Zc(e,i,r,a);for(var s,l,u=e;e.prev!==e.next;)if(s=e.prev,l=e.next,a?Vc(e,i,r,a):Uc(e))t.push(s.i/n),t.push(e.i/n),t.push(l.i/n),ud(e),e=l.next,u=l.next;else if(e=l,e===u){o?1===o?(e=Hc(e,t,n),zc(e,t,n,i,r,a,2)):2===o&&jc(e,t,n,i,r,a):zc(Gc(e),t,n,i,r,a,1);break}}}function Uc(e){var t=e.prev,n=e,i=e.next;if(0<=td(t,n,i))return!1;for(var r=e.next.next;r!==e.prev;){if($c(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&0<=td(r.prev,r,r.next))return!1;r=r.next}return!0}function Vc(e,t,n,i){var r=e.prev,a=e,o=e.next;if(0<=td(r,a,o))return!1;for(var s=r.x<a.x?r.x<o.x?r.x:o.x:a.x<o.x?a.x:o.x,l=r.y<a.y?r.y<o.y?r.y:o.y:a.y<o.y?a.y:o.y,u=r.x>a.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,h=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,c=Kc(s,l,t,n,i),d=Kc(u,h,t,n,i),f=e.prevZ,p=e.nextZ;f&&f.z>=c&&p&&p.z<=d;){if(f!==e.prev&&f!==e.next&&$c(r.x,r.y,a.x,a.y,o.x,o.y,f.x,f.y)&&0<=td(f.prev,f,f.next))return!1;if(f=f.prevZ,p!==e.prev&&p!==e.next&&$c(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=td(p.prev,p,p.next))return!1;p=p.nextZ}for(;f&&f.z>=c;){if(f!==e.prev&&f!==e.next&&$c(r.x,r.y,a.x,a.y,o.x,o.y,f.x,f.y)&&0<=td(f.prev,f,f.next))return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&$c(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=td(p.prev,p,p.next))return!1;p=p.nextZ}return!0}function Hc(e,t,n){var i=e;do{var r=i.prev,a=i.next.next;!nd(r,a)&&id(r,i,i.next,a)&&ad(r,a)&&ad(a,r)&&(t.push(r.i/n),t.push(i.i/n),t.push(a.i/n),ud(i),ud(i.next),i=e=a),i=i.next}while(i!==e);return i}function jc(e,t,n,i,r,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&ed(o,s)){var l=sd(o,s);return o=Gc(o,o.next),l=Gc(l,l.next),zc(o,t,n,i,r,a),void zc(l,t,n,i,r,a)}s=s.next}o=o.next}while(o!==e)}function Wc(e,t,n,i){var r,a,o,s,l,u=[];for(r=0,a=t.length;r<a;r++)o=t[r]*i,s=r<a-1?t[r+1]*i:e.length,l=Bc(e,o,s,i,!1),l===l.next&&(l.steiner=!0),u.push(Qc(l));for(u.sort(Yc),r=0;r<u.length;r++)qc(u[r],n),n=Gc(n,n.next);return n}function Yc(e,t){return e.x-t.x}function qc(e,t){if(t=Xc(e,t),t){var n=sd(t,e);Gc(n,n.next)}}function Xc(e,t){var n,i=t,r=e.x,a=e.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&o<s){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==t);if(!n)return null;if(r===o)return n.prev;var l,u=n,h=n.x,c=n.y,d=1/0;for(i=n.next;i!==u;)r>=i.x&&i.x>=h&&r!==i.x&&$c(a<c?r:o,a,h,c,a<c?o:r,a,i.x,i.y)&&(l=Math.abs(a-i.y)/(r-i.x),(l<d||l===d&&i.x>n.x)&&ad(i,e)&&(n=i,d=l)),i=i.next;return n}function Zc(e,t,n,i){for(var r=e;null===r.z&&(r.z=Kc(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next,r!==e;);r.prevZ.nextZ=null,r.prevZ=null,Jc(r)}function Jc(e){var t,n,i,r,a,o,s,l,u=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,i=n,s=0,t=0;t<u&&(s++,i=i.nextZ,i);t++);for(l=u;0<s||0<l&&i;)0!==s&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,l--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;n=i}a.nextZ=null,u*=2}while(1<o);return e}function Kc(e,t,n,i,r){return e=32767*(e-n)*r,t=32767*(t-i)*r,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 Qc(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 $c(e,t,n,i,r,a,o,s){return 0<=(r-o)*(t-s)-(e-o)*(a-s)&&0<=(e-o)*(i-s)-(n-o)*(t-s)&&0<=(n-o)*(a-s)-(r-o)*(i-s)}function ed(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!rd(e,t)&&ad(e,t)&&ad(t,e)&&od(e,t)}function td(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function nd(e,t){return e.x===t.x&&e.y===t.y}function id(e,t,n,i){return!!(nd(e,n)&&nd(t,i)||nd(e,i)&&nd(n,t))||0<td(e,t,n)!=0<td(e,t,i)&&0<td(n,i,e)!=0<td(n,i,t)}function rd(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&&id(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function ad(e,t){return td(e.prev,e,e.next)<0?0<=td(e,t,e.next)&&0<=td(e,e.prev,t):td(e,t,e.prev)<0||td(e,e.next,t)<0}function od(e,t){for(var n=e,i=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next,n!==e;);return i}function sd(e,t){var n=new hd(e.i,e.x,e.y),i=new hd(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function ld(e,t,n,i){var r=new hd(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function ud(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 hd(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 cd(e,t,n,i){for(var r=0,a=t,o=n-i;a<n;a+=i)r+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return r}var dd={area:function(e){for(var t=e.length,n=0,i=t-1,r=0;r<t;i=r++)n+=e[i].x*e[r].y-e[r].x*e[i].y;return.5*n},isClockWise:function(e){return dd.area(e)<0},triangulateShape:function(e,t){var n=[],i=[],r=[];fd(e),pd(n,e);var a=e.length;t.forEach(fd);for(var o=0;o<t.length;o++)i.push(a),a+=t[o].length,pd(n,t[o]);var s=Fc.triangulate(n,i);for(o=0;o<s.length;o+=3)r.push(s.slice(o,o+3));return r}};function fd(e){var t=e.length;2<t&&e[t-1].equals(e[0])&&e.pop()}function pd(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}function md(e,t){Ca.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new vd(e,t)),this.mergeVertices()}function vd(e,ee){wa.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:e,options:ee},e=(0,Ge.default)(e)?e:[e];for(var te=this,ne=[],ie=[],t=0,n=e.length;t<n;t++){var i=e[t];r(i)}function r(e){var i=[],t=void 0!==ee.curveSegments?ee.curveSegments:12,d=void 0!==ee.steps?ee.steps:1,n=void 0!==ee.depth?ee.depth:100,r=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:gd;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,_,x=!1;l&&(h=l.getSpacedPoints(d),x=!0,r=!1,c=l.computeFrenetFrames(d,!1),p=new Pn,m=new Pn,v=new Pn),r||(f=0,a=0,o=0,s=0);var b=e.extractPoints(t),w=b.shape,M=b.holes,T=!dd.isClockWise(w);if(T)for(w=w.reverse(),y=0,_=M.length;y<_;y++)g=M[y],dd.isClockWise(g)&&(M[y]=g.reverse());var E=dd.triangulateShape(w,M),S=w;for(y=0,_=M.length;y<_;y++)g=M[y],w=w.concat(g);function A(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}var L,I,k,R,N,P,C=w.length,D=E.length;function O(e,t,n){var i,r,a,o=e.x-t.x,s=e.y-t.y,l=n.x-e.x,u=n.y-e.y,h=o*o+s*s,c=o*u-s*l;if(Math.abs(c)>re.default){var d=Math.sqrt(h),f=Math.sqrt(l*l+u*u),p=t.x-s/d,m=t.y+o/d,v=n.x-u/f,g=n.y+l/f,y=((v-p)*u-(g-m)*l)/(o*u-s*l);i=p+o*y-e.x,r=m+s*y-e.y;var _=i*i+r*r;if(_<=2)return new Rn(i,r);a=Math.sqrt(_/2)}else{var x=!1;o>re.default?l>re.default&&(x=!0):o<-re.default?l<-re.default&&(x=!0):Math.sign(s)===Math.sign(u)&&(x=!0),a=x?(i=-s,r=o,Math.sqrt(h)):(i=o,r=s,Math.sqrt(h/2))}return new Rn(i/a,r/a)}for(var F=[],B=0,G=S.length,z=G-1,U=B+1;B<G;B++,z++,U++)z===G&&(z=0),U===G&&(U=0),F[B]=O(S[B],S[z],S[U]);var V,H,j=[],W=F.concat();for(y=0,_=M.length;y<_;y++){for(g=M[y],V=[],B=0,G=g.length,z=G-1,U=B+1;B<G;B++,z++,U++)z===G&&(z=0),U===G&&(U=0),V[B]=O(g[B],g[z],g[U]);j.push(V),W=W.concat(V)}for(L=0;L<f;L++){for(k=L/f,R=a*Math.cos(k*Math.PI/2),I=o*Math.sin(k*Math.PI/2)+s,B=0,G=S.length;B<G;B++)N=A(S[B],F[B],I),Z(N.x,N.y,-R);for(y=0,_=M.length;y<_;y++)for(g=M[y],V=j[y],B=0,G=g.length;B<G;B++)N=A(g[B],V[B],I),Z(N.x,N.y,-R)}for(I=o+s,B=0;B<C;B++)N=r?A(w[B],W[B],I):w[B],x?(m.copy(c.normals[0]).multiplyScalar(N.x),p.copy(c.binormals[0]).multiplyScalar(N.y),v.copy(h[0]).add(m).add(p),Z(v.x,v.y,v.z)):Z(N.x,N.y,0);for(H=1;H<=d;H++)for(B=0;B<C;B++)N=r?A(w[B],W[B],I):w[B],x?(m.copy(c.normals[H]).multiplyScalar(N.x),p.copy(c.binormals[H]).multiplyScalar(N.y),v.copy(h[H]).add(m).add(p),Z(v.x,v.y,v.z)):Z(N.x,N.y,n/d*H);for(L=f-1;0<=L;L--){for(k=L/f,R=a*Math.cos(k*Math.PI/2),I=o*Math.sin(k*Math.PI/2)+s,B=0,G=S.length;B<G;B++)N=A(S[B],F[B],I),Z(N.x,N.y,n+R);for(y=0,_=M.length;y<_;y++)for(g=M[y],V=j[y],B=0,G=g.length;B<G;B++)N=A(g[B],V[B],I),x?Z(N.x,N.y+h[d-1].y,h[d-1].x+R):Z(N.x,N.y,n+R)}function Y(){var e=ne.length/3;if(r){var t=0,n=C*t;for(B=0;B<D;B++)P=E[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=E[B],J(P[0]+n,P[1]+n,P[2]+n)}else{for(B=0;B<D;B++)P=E[B],J(P[2],P[1],P[0]);for(B=0;B<D;B++)P=E[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(S,t),t+=S.length,y=0,_=M.length;y<_;y++)g=M[y],X(g,t),t+=g.length;te.addGroup(e,ne.length/3-e,1)}function X(e,t){var n,i;for(B=e.length;0<=--B;){n=B,i=B-1,i<0&&(i=e.length-1);var r=0,a=d+2*f;for(r=0;r<a;r++){var o=C*r,s=C*(r+1),l=t+n+o,u=t+i+o,h=t+i+s,c=t+n+s;K(l,u,h,c)}}}function Z(e,t,n){i.push(e),i.push(t),i.push(n)}function J(e,t,n){Q(e),Q(t),Q(n);var i=ne.length/3,r=u.generateTopUV(te,ne,i-3,i-2,i-1);$(r[0]),$(r[1]),$(r[2])}function K(e,t,n,i){Q(e),Q(t),Q(i),Q(t),Q(n),Q(i);var r=ne.length/3,a=u.generateSideWallUV(te,ne,r-6,r-3,r-2,r-1);$(a[0]),$(a[1]),$(a[3]),$(a[1]),$(a[2]),$(a[3])}function Q(e){ne.push(i[3*e+0]),ne.push(i[3*e+1]),ne.push(i[3*e+2])}function $(e){ie.push(e.x),ie.push(e.y)}Y(),q()}this.addAttribute("position",new Vr(ne,3)),this.addAttribute("uv",new Vr(ie,2)),this.computeVertexNormals()}t.ShapeUtils=dd,md.prototype=(0,l.default)(Ca.prototype),md.prototype.constructor=md,md.prototype.toJSON=function(){var e=Ca.prototype.toJSON.call(this),t=this.parameters.shapes,n=this.parameters.options;return yd(t,n,e)},vd.prototype=(0,l.default)(wa.prototype),vd.prototype.constructor=vd,vd.prototype.toJSON=function(){var e=wa.prototype.toJSON.call(this),t=this.parameters.shapes,n=this.parameters.options;return yd(t,n,e)};var gd={generateTopUV:function(e,t,n,i,r){var a=t[3*n],o=t[3*n+1],s=t[3*i],l=t[3*i+1],u=t[3*r],h=t[3*r+1];return[new Rn(a,o),new Rn(s,l),new Rn(u,h)]},generateSideWallUV:function(e,t,n,i,r,a){var o=t[3*n],s=t[3*n+1],l=t[3*n+2],u=t[3*i],h=t[3*i+1],c=t[3*i+2],d=t[3*r],f=t[3*r+1],p=t[3*r+2],m=t[3*a],v=t[3*a+1],g=t[3*a+2];return Math.abs(s-h)<.01?[new Rn(o,1-l),new Rn(u,1-c),new Rn(d,1-p),new Rn(m,1-g)]:[new Rn(s,1-l),new Rn(h,1-c),new Rn(f,1-p),new Rn(v,1-g)]}};function yd(e,t,n){if(n.shapes=[],(0,Ge.default)(e))for(var i=0,r=e.length;i<r;i++){var a=e[i];n.shapes.push(a.uuid)}else n.shapes.push(e.uuid);return void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON()),n}function _d(e,t){Ca.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new xd(e,t)),this.mergeVertices()}function xd(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 Ca;var i=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),vd.call(this,i,t),this.type="TextBufferGeometry"}function bd(e,t,n,i,r,a,o){Ca.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new wd(e,t,n,i,r,a,o)),this.mergeVertices()}function wd(e,t,n,i,r,a,o){wa.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},e=e||1,t=Math.max(3,Math.floor(t)||8),n=Math.max(2,Math.floor(n)||6),i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI,a=void 0!==a?a:0,o=void 0!==o?o:Math.PI;var s,l,u=Math.min(a+o,Math.PI),h=0,c=[],d=new Pn,f=new Pn,p=[],m=[],v=[],g=[];for(l=0;l<=n;l++){var y=[],_=l/n,x=0;for(0==l&&0==a?x=.5/t:l==n&&u==Math.PI&&(x=-.5/t),s=0;s<=t;s++){var b=s/t;d.x=-e*Math.cos(i+b*r)*Math.sin(a+_*o),d.y=e*Math.cos(a+_*o),d.z=e*Math.sin(i+b*r)*Math.sin(a+_*o),m.push(d.x,d.y,d.z),f.copy(d).normalize(),v.push(f.x,f.y,f.z),g.push(b+x,1-_),y.push(h++)}c.push(y)}for(l=0;l<n;l++)for(s=0;s<t;s++){var w=c[l][s+1],M=c[l][s],T=c[l+1][s],E=c[l+1][s+1];(0!==l||0<a)&&p.push(w,M,E),(l!==n-1||u<Math.PI)&&p.push(M,T,E)}this.setIndex(p),this.addAttribute("position",new Vr(m,3)),this.addAttribute("normal",new Vr(v,3)),this.addAttribute("uv",new Vr(g,2))}function Md(e,t,n,i,r,a){Ca.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:a},this.fromBufferGeometry(new Td(e,t,n,i,r,a)),this.mergeVertices()}function Td(e,t,n,i,r,a){wa.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:a},e=e||.5,t=t||1,r=void 0!==r?r:0,a=void 0!==a?a:2*Math.PI,n=void 0!==n?Math.max(3,n):8,i=void 0!==i?Math.max(1,i):1;var o,s,l,u=[],h=[],c=[],d=[],f=e,p=(t-e)/i,m=new Pn,v=new Rn;for(s=0;s<=i;s++){for(l=0;l<=n;l++)o=r+l/n*a,m.x=f*Math.cos(o),m.y=f*Math.sin(o),h.push(m.x,m.y,m.z),c.push(0,0,1),v.x=(m.x/t+1)/2,v.y=(m.y/t+1)/2,d.push(v.x,v.y);f+=p}for(s=0;s<i;s++){var g=s*(n+1);for(l=0;l<n;l++){o=l+g;var y=o,_=o+n+1,x=o+n+2,b=o+1;u.push(y,_,b),u.push(_,x,b)}}this.setIndex(u),this.addAttribute("position",new Vr(h,3)),this.addAttribute("normal",new Vr(c,3)),this.addAttribute("uv",new Vr(d,2))}function Ed(e,t,n,i){Ca.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},this.fromBufferGeometry(new Sd(e,t,n,i)),this.mergeVertices()}function Sd(e,t,n,i){wa.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t)||12,n=n||0,i=i||2*Math.PI,i=kn.clamp(i,0,2*Math.PI);var r,a,o,s=[],l=[],u=[],h=1/t,c=new Pn,d=new Rn;for(a=0;a<=t;a++){var f=n+a*h*i,p=Math.sin(f),m=Math.cos(f);for(o=0;o<=e.length-1;o++)c.x=e[o].x*p,c.y=e[o].y,c.z=e[o].x*m,l.push(c.x,c.y,c.z),d.x=a/t,d.y=o/(e.length-1),u.push(d.x,d.y)}for(a=0;a<t;a++)for(o=0;o<e.length-1;o++){r=o+a*e.length;var v=r,g=r+e.length,y=r+e.length+1,_=r+1;s.push(v,g,_),s.push(g,y,_)}if(this.setIndex(s),this.addAttribute("position",new Vr(l,3)),this.addAttribute("uv",new Vr(u,2)),this.computeVertexNormals(),i===2*Math.PI){var x=this.attributes.normal.array,b=new Pn,w=new Pn,M=new Pn;for(r=t*e.length*3,a=0,o=0;a<e.length;a++,o+=3)b.x=x[o+0],b.y=x[o+1],b.z=x[o+2],w.x=x[r+o+0],w.y=x[r+o+1],w.z=x[r+o+2],M.addVectors(b,w).normalize(),x[o+0]=x[r+o+0]=M.x,x[o+1]=x[r+o+1]=M.y,x[o+2]=x[r+o+2]=M.z}}function Ad(e,t){Ca.call(this),this.type="ShapeGeometry","object"===(0,o.default)(t)&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new Ld(e,t)),this.mergeVertices()}function Ld(e,p){wa.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,Ge.default)(e))i(e);else for(var n=0;n<e.length;n++)i(e[n]),this.addGroup(t,_,n),t+=_,_=0;function i(e){var t,n,i,r=v.length/3,a=e.extractPoints(p),o=a.shape,s=a.holes;for(!1===dd.isClockWise(o)&&(o=o.reverse()),t=0,n=s.length;t<n;t++)i=s[t],!0===dd.isClockWise(i)&&(s[t]=i.reverse());var l=dd.triangulateShape(o,s);for(t=0,n=s.length;t<n;t++)i=s[t],o=o.concat(i);for(t=0,n=o.length;t<n;t++){var u=o[t];v.push(u.x,u.y,0),g.push(0,0,1),y.push(u.x,u.y)}for(t=0,n=l.length;t<n;t++){var h=l[t],c=h[0]+r,d=h[1]+r,f=h[2]+r;m.push(c,d,f),_+=3}}this.setIndex(m),this.addAttribute("position",new Vr(v,3)),this.addAttribute("normal",new Vr(g,3)),this.addAttribute("uv",new Vr(y,2))}function Id(e,t){if(t.shapes=[],(0,Ge.default)(e))for(var n=0,i=e.length;n<i;n++){var r=e[n];t.shapes.push(r.uuid)}else t.shapes.push(e.uuid);return t}function kd(e,t){wa.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=void 0!==t?t:1;var n,i,r,a,o=[],s=Math.cos(kn.DEG2RAD*t),l=[0,0],u={},h=["a","b","c"];e.isBufferGeometry?(a=new Ca,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]],i=m[h[(v+1)%3]],l[0]=Math.min(n,i),l[1]=Math.max(n,i),r=l[0]+","+l[1],void 0===u[r]?u[r]={index1:l[0],index2:l[1],face1:f,face2:void 0}:u[r].face2=f;for(r in u){var g=u[r];if(void 0===g.face2||d[g.face1].normal.dot(d[g.face2].normal)<=s){var y=c[g.index1];o.push(y.x,y.y,y.z),y=c[g.index2],o.push(y.x,y.y,y.z)}}this.addAttribute("position",new Vr(o,3))}function Rd(e,t,n,i,r,a,o,s){Ca.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new Nd(e,t,n,i,r,a,o,s)),this.mergeVertices()}function Nd(g,y,_,x,b,e,w,M){wa.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:g,radiusBottom:y,height:_,radialSegments:x,heightSegments:b,openEnded:e,thetaStart:w,thetaLength:M};var T=this;g=void 0!==g?g:1,y=void 0!==y?y:1,_=_||1,x=Math.floor(x)||8,b=Math.floor(b)||1,e=void 0!==e&&e,w=void 0!==w?w:0,M=void 0!==M?M:2*Math.PI;var E=[],S=[],A=[],L=[],I=0,k=[],R=_/2,N=0;function t(){var e,t,n=new Pn,i=new Pn,r=0,a=(y-g)/_;for(t=0;t<=b;t++){var o=[],s=t/b,l=s*(y-g)+g;for(e=0;e<=x;e++){var u=e/x,h=u*M+w,c=Math.sin(h),d=Math.cos(h);i.x=l*c,i.y=-s*_+R,i.z=l*d,S.push(i.x,i.y,i.z),n.set(c,a,d).normalize(),A.push(n.x,n.y,n.z),L.push(u,1-s),o.push(I++)}k.push(o)}for(e=0;e<x;e++)for(t=0;t<b;t++){var f=k[t][e],p=k[t+1][e],m=k[t+1][e+1],v=k[t][e+1];E.push(f,p,v),E.push(p,m,v),r+=6}T.addGroup(N,r,0),N+=r}function n(e){var t,n,i,r=new Rn,a=new Pn,o=0,s=!0===e?g:y,l=!0===e?1:-1;for(n=I,t=1;t<=x;t++)S.push(0,R*l,0),A.push(0,l,0),L.push(.5,.5),I++;for(i=I,t=0;t<=x;t++){var u=t/x,h=u*M+w,c=Math.cos(h),d=Math.sin(h);a.x=s*d,a.y=R*l,a.z=s*c,S.push(a.x,a.y,a.z),A.push(0,l,0),r.x=.5*c+.5,r.y=.5*d*l+.5,L.push(r.x,r.y),I++}for(t=0;t<x;t++){var f=n+t,p=i+t;!0===e?E.push(p,p+1,f):E.push(p+1,p,f),o+=3}T.addGroup(N,o,!0===e?1:2),N+=o}t(),!1===e&&(0<g&&n(!0),0<y&&n(!1)),this.setIndex(E),this.addAttribute("position",new Vr(S,3)),this.addAttribute("normal",new Vr(A,3)),this.addAttribute("uv",new Vr(L,2))}function Pd(e,t,n,i,r,a,o){Rd.call(this,0,e,t,n,i,r,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:a,thetaLength:o}}function Cd(e,t,n,i,r,a,o){Nd.call(this,0,e,t,n,i,r,a,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:a,thetaLength:o}}function Dd(e,t,n,i){Ca.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},this.fromBufferGeometry(new Od(e,t,n,i)),this.mergeVertices()}function Od(e,t,n,i){wa.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},e=e||1,t=void 0!==t?Math.max(3,t):8,n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI;var r,a,o=[],s=[],l=[],u=[],h=new Pn,c=new Rn;for(s.push(0,0,0),l.push(0,0,1),u.push(.5,.5),a=0,r=3;a<=t;a++,r+=3){var d=n+a/t*i;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[r]/e+1)/2,c.y=(s[r+1]/e+1)/2,u.push(c.x,c.y)}for(r=1;r<=t;r++)o.push(r,r+1,0);this.setIndex(o),this.addAttribute("position",new Vr(s,3)),this.addAttribute("normal",new Vr(l,3)),this.addAttribute("uv",new Vr(u,2))}_d.prototype=(0,l.default)(Ca.prototype),_d.prototype.constructor=_d,xd.prototype=(0,l.default)(vd.prototype),xd.prototype.constructor=xd,bd.prototype=(0,l.default)(Ca.prototype),bd.prototype.constructor=bd,wd.prototype=(0,l.default)(wa.prototype),wd.prototype.constructor=wd,Md.prototype=(0,l.default)(Ca.prototype),Md.prototype.constructor=Md,Td.prototype=(0,l.default)(wa.prototype),Td.prototype.constructor=Td,Ed.prototype=(0,l.default)(Ca.prototype),Ed.prototype.constructor=Ed,Sd.prototype=(0,l.default)(wa.prototype),Sd.prototype.constructor=Sd,Ad.prototype=(0,l.default)(Ca.prototype),Ad.prototype.constructor=Ad,Ad.prototype.toJSON=function(){var e=Ca.prototype.toJSON.call(this),t=this.parameters.shapes;return Id(t,e)},Ld.prototype=(0,l.default)(wa.prototype),Ld.prototype.constructor=Ld,Ld.prototype.toJSON=function(){var e=wa.prototype.toJSON.call(this),t=this.parameters.shapes;return Id(t,e)},kd.prototype=(0,l.default)(wa.prototype),kd.prototype.constructor=kd,Rd.prototype=(0,l.default)(Ca.prototype),Rd.prototype.constructor=Rd,Nd.prototype=(0,l.default)(wa.prototype),Nd.prototype.constructor=Nd,Pd.prototype=(0,l.default)(Rd.prototype),Pd.prototype.constructor=Pd,Cd.prototype=(0,l.default)(Nd.prototype),Cd.prototype.constructor=Cd,Dd.prototype=(0,l.default)(Ca.prototype),Dd.prototype.constructor=Dd,Od.prototype=(0,l.default)(wa.prototype),Od.prototype.constructor=Od;var Fd=(0,a.default)({WireframeGeometry:yc,ParametricGeometry:_c,ParametricBufferGeometry:xc,TetrahedronGeometry:Mc,TetrahedronBufferGeometry:Tc,OctahedronGeometry:Ec,OctahedronBufferGeometry:Sc,IcosahedronGeometry:Ac,IcosahedronBufferGeometry:Lc,DodecahedronGeometry:Ic,DodecahedronBufferGeometry:kc,PolyhedronGeometry:bc,PolyhedronBufferGeometry:wc,TubeGeometry:Rc,TubeBufferGeometry:Nc,TorusKnotGeometry:Pc,TorusKnotBufferGeometry:Cc,TorusGeometry:Dc,TorusBufferGeometry:Oc,TextGeometry:_d,TextBufferGeometry:xd,SphereGeometry:bd,SphereBufferGeometry:wd,RingGeometry:Md,RingBufferGeometry:Td,PlaneGeometry:Ml,PlaneBufferGeometry:Tl,LatheGeometry:Ed,LatheBufferGeometry:Sd,ShapeGeometry:Ad,ShapeBufferGeometry:Ld,ExtrudeGeometry:md,ExtrudeBufferGeometry:vd,EdgesGeometry:kd,ConeGeometry:Pd,ConeBufferGeometry:Cd,CylinderGeometry:Rd,CylinderBufferGeometry:Nd,CircleGeometry:Dd,CircleBufferGeometry:Od,BoxGeometry:Da,BoxBufferGeometry:Oa});function Bd(e){Nr.call(this),this.type="ShadowMaterial",this.color=new Sr(0),this.transparent=!0,this.setValues(e)}function Gd(e){Va.call(this,e),this.type="RawShaderMaterial"}function zd(e){Nr.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Sr(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Sr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=on,this.normalScale=new Rn(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.setValues(e)}function Ud(e){zd.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(e)}function Vd(e){Nr.call(this),this.type="MeshPhongMaterial",this.color=new Sr(16777215),this.specular=new Sr(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Sr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=on,this.normalScale=new Rn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=X,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 Hd(e){Vd.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(e)}function jd(e){Nr.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=on,this.normalScale=new Rn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Wd(e){Nr.call(this),this.type="MeshLambertMaterial",this.color=new Sr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Sr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=X,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 Yd(e){Nr.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Sr(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=on,this.normalScale=new Rn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.lights=!1,this.setValues(e)}function qd(e){lc.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}Bd.prototype=(0,l.default)(Nr.prototype),Bd.prototype.constructor=Bd,Bd.prototype.isShadowMaterial=!0,Bd.prototype.copy=function(e){return Nr.prototype.copy.call(this,e),this.color.copy(e.color),this},Gd.prototype=(0,l.default)(Va.prototype),Gd.prototype.constructor=Gd,Gd.prototype.isRawShaderMaterial=!0,zd.prototype=(0,l.default)(Nr.prototype),zd.prototype.constructor=zd,zd.prototype.isMeshStandardMaterial=!0,zd.prototype.copy=function(e){return Nr.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,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},Ud.prototype=(0,l.default)(zd.prototype),Ud.prototype.constructor=Ud,Ud.prototype.isMeshPhysicalMaterial=!0,Ud.prototype.copy=function(e){return zd.prototype.copy.call(this,e),this.defines={PHYSICAL:""},this.reflectivity=e.reflectivity,this.clearCoat=e.clearCoat,this.clearCoatRoughness=e.clearCoatRoughness,this},Vd.prototype=(0,l.default)(Nr.prototype),Vd.prototype.constructor=Vd,Vd.prototype.isMeshPhongMaterial=!0,Vd.prototype.copy=function(e){return Nr.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,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},Hd.prototype=(0,l.default)(Vd.prototype),Hd.prototype.constructor=Hd,Hd.prototype.isMeshToonMaterial=!0,Hd.prototype.copy=function(e){return Vd.prototype.copy.call(this,e),this.gradientMap=e.gradientMap,this},jd.prototype=(0,l.default)(Nr.prototype),jd.prototype.constructor=jd,jd.prototype.isMeshNormalMaterial=!0,jd.prototype.copy=function(e){return Nr.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},Wd.prototype=(0,l.default)(Nr.prototype),Wd.prototype.constructor=Wd,Wd.prototype.isMeshLambertMaterial=!0,Wd.prototype.copy=function(e){return Nr.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,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},Yd.prototype=(0,l.default)(Nr.prototype),Yd.prototype.constructor=Yd,Yd.prototype.isMeshMatcapMaterial=!0,Yd.prototype.copy=function(e){return Nr.prototype.copy.call(this,e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,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},qd.prototype=(0,l.default)(lc.prototype),qd.prototype.constructor=qd,qd.prototype.isLineDashedMaterial=!0,qd.prototype.copy=function(e){return lc.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var Xd=(0,a.default)({ShadowMaterial:Bd,SpriteMaterial:tc,RawShaderMaterial:Gd,ShaderMaterial:Va,PointsMaterial:dc,MeshPhysicalMaterial:Ud,MeshStandardMaterial:zd,MeshPhongMaterial:Vd,MeshToonMaterial:Hd,MeshNormalMaterial:jd,MeshLambertMaterial:Wd,MeshDepthMaterial:uh,MeshDistanceMaterial:hh,MeshBasicMaterial:Pr,MeshMatcapMaterial:Yd,LineDashedMaterial:qd,LineBasicMaterial:lc,Material:Nr}),Zd={arraySlice:function(e,t,n){return Zd.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.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,i=new Array(t),r=0;r!==t;++r)i[r]=r;return i.sort(e),i},sortedArray:function(e,t,n){for(var i=e.length,r=new e.constructor(i),a=0,o=0;o!==i;++a)for(var s=n[a]*t,l=0;l!==t;++l)r[o++]=e[s+l];return r},flattenJSON:function(e,t,n,i){for(var r=1,a=e[0];void 0!==a&&void 0===a[i];)a=e[r++];if(void 0!==a){var o=a[i];if(void 0!==o)if((0,Ge.default)(o))for(;o=a[i],void 0!==o&&(t.push(a.time),n.push.apply(n,o)),a=e[r++],void 0!==a;);else if(void 0!==o.toArray)for(;o=a[i],void 0!==o&&(t.push(a.time),o.toArray(n,n.length)),a=e[r++],void 0!==a;);else for(;o=a[i],void 0!==o&&(t.push(a.time),n.push(o)),a=e[r++],void 0!==a;);}}};function Jd(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n}function Kd(e,t,n,i){Jd.call(this,e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function Qd(e,t,n,i){Jd.call(this,e,t,n,i)}function $d(e,t,n,i){Jd.call(this,e,t,n,i)}function ef(e,t,n,i){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=Zd.convertArray(t,this.TimeBufferType),this.values=Zd.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}function tf(e,t,n){ef.call(this,e,t,n)}function nf(e,t,n,i){ef.call(this,e,t,n,i)}function rf(e,t,n,i){ef.call(this,e,t,n,i)}function af(e,t,n,i){Jd.call(this,e,t,n,i)}function of(e,t,n,i){ef.call(this,e,t,n,i)}function sf(e,t,n,i){ef.call(this,e,t,n,i)}function lf(e,t,n,i){ef.call(this,e,t,n,i)}function uf(e,t,n){this.name=e,this.tracks=n,this.duration=void 0!==t?t:-1,this.uuid=kn.generateUUID(),this.duration<0&&this.resetDuration()}function hf(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return rf;case"vector":case"vector2":case"vector3":case"vector4":return lf;case"color":return nf;case"quaternion":return of;case"bool":case"boolean":return tf;case"string":return sf}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}function cf(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var t=hf(e.type);if(void 0===e.times){var n=[],i=[];Zd.flattenJSON(e.keys,n,i,"value"),e.times=n,e.values=i}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}t.AnimationUtils=Zd,(0,p.default)(Jd.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,i=t[n],r=t[n-1];e:{t:{var a;n:{i:if(!(e<i)){for(var o=n+2;;){if(void 0===i){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,r)}if(n===o)break;if(r=i,i=t[++n],e<i)break t}a=t.length;break n}if(r<=e)break e;var s=t[1];for(e<s&&(n=2,r=s),o=n-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(n===o)break;if(i=r,r=t[--n-1],r<=e)break t}a=n,n=0}for(;n<a;){var l=n+a>>>1;e<t[l]?a=l:n=l+1}if(i=t[n],r=t[n-1],void 0===r)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(void 0===i)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,r,e)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,e,i)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i,a=0;a!==i;++a)t[a]=n[r+a];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),(0,p.default)(Jd.prototype,{beforeStart_:Jd.prototype.copySampleValue_,afterEnd_:Jd.prototype.copySampleValue_}),Kd.prototype=(0,p.default)((0,l.default)(Jd.prototype),{constructor:Kd,DefaultSettings_:{endingStart:Ht,endingEnd:Ht},intervalChanged_:function(e,t,n){var i=this.parameterPositions,r=e-2,a=e+1,o=i[r],s=i[a];if(void 0===o)switch(this.getSettings_().endingStart){case jt:r=e,o=2*t-n;break;case Wt:r=i.length-2,o=t+i[r]-i[r+1];break;default:r=e,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case jt:a=e,s=2*n-t;break;case Wt:a=1,s=n+i[1]-i[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=r*u,this._offsetNext=a*u},interpolate_:function(e,t,n,i){for(var r=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)/(i-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)r[x]=v*a[u+x]+g*a[l+x]+y*a[s+x]+_*a[h+x];return r}}),Qd.prototype=(0,p.default)((0,l.default)(Jd.prototype),{constructor:Qd,interpolate_:function(e,t,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,u=(n-t)/(i-t),h=1-u,c=0;c!==o;++c)r[c]=a[l+c]*h+a[s+c]*u;return r}}),$d.prototype=(0,p.default)((0,l.default)(Jd.prototype),{constructor:$d,interpolate_:function(e){return this.copySampleValue_(e-1)}}),(0,p.default)(ef,{toJSON:function(e){var t,n=e.constructor;if(void 0!==n.toJSON)t=n.toJSON(e);else{t={name:e.name,times:Zd.convertArray(e.times,Array),values:Zd.convertArray(e.values,Array)};var i=e.getInterpolation();i!==e.DefaultInterpolation&&(t.interpolation=i)}return t.type=e.ValueTypeName,t}}),(0,p.default)(ef.prototype,{constructor:ef,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:Ut,InterpolantFactoryMethodDiscrete:function(e){return new $d(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new Qd(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new Kd(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case zt:t=this.InterpolantFactoryMethodDiscrete;break;case Ut:t=this.InterpolantFactoryMethodLinear;break;case Vt: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 zt;case this.InterpolantFactoryMethodLinear:return Ut;case this.InterpolantFactoryMethodSmooth:return Vt}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,n=0,i=t.length;n!==i;++n)t[n]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,n=0,i=t.length;n!==i;++n)t[n]*=e;return this},trim:function(e,t){for(var n=this.times,i=n.length,r=0,a=i-1;r!==i&&n[r]<e;)++r;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==r||a!==i){a<=r&&(a=Math.max(a,1),r=a-1);var o=this.getValueSize();this.times=Zd.arraySlice(n,r,a),this.values=Zd.arraySlice(this.values,r*o,a*o)}return 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,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var a=null,o=0;o!==r;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!==i&&Zd.isTypedArray(i)){o=0;for(var l=i.length;o!==l;++o){var u=i[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=this.times,t=this.values,n=this.getValueSize(),i=this.getInterpolation()===Vt,r=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(i)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!==r){e[r]=e[o];var m=o*n,v=r*n;for(f=0;f!==n;++f)t[v+f]=t[m+f]}++r}}if(0<a){for(e[r]=e[a],m=a*n,v=r*n,f=0;f!==n;++f)t[v+f]=t[m+f];++r}return r!==e.length&&(this.times=Zd.arraySlice(e,0,r),this.values=Zd.arraySlice(t,0,r*n)),this},clone:function(){var e=Zd.arraySlice(this.times,0),t=Zd.arraySlice(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}),tf.prototype=(0,p.default)((0,l.default)(ef.prototype),{constructor:tf,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:zt,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),nf.prototype=(0,p.default)((0,l.default)(ef.prototype),{constructor:nf,ValueTypeName:"color"}),rf.prototype=(0,p.default)((0,l.default)(ef.prototype),{constructor:rf,ValueTypeName:"number"}),af.prototype=(0,p.default)((0,l.default)(Jd.prototype),{constructor:af,interpolate_:function(e,t,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=(n-t)/(i-t),u=s+o;s!==u;s+=4)Nn.slerpFlat(r,0,a,s-o,a,s,l);return r}}),of.prototype=(0,p.default)((0,l.default)(ef.prototype),{constructor:of,ValueTypeName:"quaternion",DefaultInterpolation:Ut,InterpolantFactoryMethodLinear:function(e){return new af(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),sf.prototype=(0,p.default)((0,l.default)(ef.prototype),{constructor:sf,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:zt,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),lf.prototype=(0,p.default)((0,l.default)(ef.prototype),{constructor:lf,ValueTypeName:"vector"}),(0,p.default)(uf,{parse:function(e){for(var t=[],n=e.tracks,i=1/(e.fps||1),r=0,a=n.length;r!==a;++r)t.push(cf(n[r]).scale(i));return new uf(e.name,e.duration,t)},toJSON:function(e){for(var t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid},r=0,a=n.length;r!==a;++r)t.push(ef.toJSON(n[r]));return i},CreateFromMorphTargetSequence:function(e,t,n,i){for(var r=t.length,a=[],o=0;o<r;o++){var s=[],l=[];s.push((o+r-1)%r,o,(o+1)%r),l.push(0,1,0);var u=Zd.getKeyframeOrder(s);s=Zd.sortedArray(s,1,u),l=Zd.sortedArray(l,1,u),i||0!==s[0]||(s.push(r),l.push(l[0])),a.push(new rf(".morphTargetInfluences["+t[o].name+"]",s,l).scale(1/n))}return new uf(e,-1,a)},findByName:function(e,t){var n=e;if(!(0,Ge.default)(e)){var i=e;n=i.geometry&&i.geometry.animations||i.animations}for(var r=0;r<n.length;r++)if(n[r].name===t)return n[r];return null},CreateClipsFromMorphTargetSequences:function(e,t,n){for(var i={},r=/^([\w-]*?)([\d]+)$/,a=0,o=e.length;a<o;a++){var s=e[a],l=s.name.match(r);if(l&&1<l.length){var u=l[1],h=i[u];h||(i[u]=h=[]),h.push(s)}}var c=[];for(var u in i)c.push(uf.CreateFromMorphTargetSequence(u,i[u],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,i,r){if(0!==n.length){var a=[],o=[];Zd.flattenJSON(n,a,o,i),0!==a.length&&r.push(new e(t,a,o))}},i=[],r=e.name||"default",a=e.length||-1,o=e.fps||30,s=e.hierarchy||[],l=0;l<s.length;l++){var u=s[l].keys;if(u&&0!==u.length)if(u[0].morphTargets){for(var h={},c=0;c<u.length;c++)if(u[c].morphTargets)for(var d=0;d<u[c].morphTargets.length;d++)h[u[c].morphTargets[d]]=-1;for(var f in h){var p=[],m=[];for(d=0;d!==u[c].morphTargets.length;++d){var v=u[c];p.push(v.time),m.push(v.morphTarget===f?1:0)}i.push(new rf(".morphTargetInfluence["+f+"]",p,m))}a=h.length*(o||1)}else{var g=".bones["+t[l].name+"]";n(lf,g+".position",u,"pos",i),n(of,g+".quaternion",u,"rot",i),n(lf,g+".scale",u,"scl",i)}}if(0===i.length)return null;var y=new uf(r,a,i);return y}}),(0,p.default)(uf.prototype,{resetDuration:function(){for(var e=this.tracks,t=0,n=0,i=e.length;n!==i;++n){var r=this.tracks[n];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(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 uf(this.name,this.duration,e)}});var df={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 ff(e,t,n){var i=this,r=!1,a=0,o=0,s=void 0;this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===r&&void 0!==i.onStart&&i.onStart(e,a,o),r=!0},this.itemEnd=function(e){a++,void 0!==i.onProgress&&i.onProgress(e,a,o),a===o&&(r=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(e){void 0!==i.onError&&i.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this}}t.Cache=df;var pf=new ff;t.DefaultLoadingManager=pf;var mf={};function vf(e){this.manager=void 0!==e?e:pf}function gf(e){this.manager=void 0!==e?e:pf}function yf(e){this.manager=void 0!==e?e:pf,this._parser=null}function _f(e){this.manager=void 0!==e?e:pf,this._parser=null}function xf(e){this.manager=void 0!==e?e:pf}function bf(e){this.manager=void 0!==e?e:pf}function wf(e){this.manager=void 0!==e?e:pf}function Mf(){this.type="Curve",this.arcLengthDivisions=200}function Tf(e,t,n,i,r,a,o,s){Mf.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=n||1,this.yRadius=i||1,this.aStartAngle=r||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function Ef(e,t,n,i,r,a){Tf.call(this,e,t,n,n,i,r,a),this.type="ArcCurve"}function Sf(){var r=0,a=0,o=0,s=0;function u(e,t,n,i){r=e,a=n,o=-3*e+3*t-2*n-i,s=2*e-2*t+n+i}return{initCatmullRom:function(e,t,n,i,r){u(t,n,r*(n-e),r*(i-t))},initNonuniformCatmullRom:function(e,t,n,i,r,a,o){var s=(t-e)/r-(n-e)/(r+a)+(n-t)/a,l=(n-t)/a-(i-t)/(a+o)+(i-n)/o;s*=a,l*=a,u(t,n,s,l)},calc:function(e){var t=e*e,n=t*e;return r+a*e+o*t+s*n}}}(0,p.default)(vf.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,i=df.get(o);if(void 0!==i)return s.manager.itemStart(o),setTimeout(function(){e&&e(i),s.manager.itemEnd(o)},0),i;if(void 0===mf[o]){var r=/^data:(.*?)(;base64)?,(.*)$/,a=o.match(r);if(a){var l=a[1],u=!!a[2],h=a[3];h=decodeURIComponent(h),u&&(h=atob(h));try{var c,d=(this.responseType||"").toLowerCase();switch(d){case"arraybuffer":case"blob":for(var f=new Uint8Array(h.length),p=0;p<h.length;p++)f[p]=h.charCodeAt(p);c="blob"===d?new Blob([f.buffer],{type:l}):f.buffer;break;case"document":var m=new DOMParser;c=m.parseFromString(h,l);break;case"json":c=JSON.parse(h);break;default:c=h}setTimeout(function(){e&&e(c),s.manager.itemEnd(o)},0)}catch(e){setTimeout(function(){n&&n(e),s.manager.itemError(o),s.manager.itemEnd(o)},0)}}else{mf[o]=[],mf[o].push({onLoad:e,onProgress:t,onError:n});var v=new XMLHttpRequest;for(var g in v.open("GET",o,!0),v.addEventListener("load",function(e){var t=this.response;df.add(o,t);var n=mf[o];if(delete mf[o],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received.");for(var i=0,r=n.length;i<r;i++){var a=n[i];a.onLoad&&a.onLoad(t)}s.manager.itemEnd(o)}else{for(i=0,r=n.length;i<r;i++)a=n[i],a.onError&&a.onError(e);s.manager.itemError(o),s.manager.itemEnd(o)}},!1),v.addEventListener("progress",function(e){for(var t=mf[o],n=0,i=t.length;n<i;n++){var r=t[n];r.onProgress&&r.onProgress(e)}},!1),v.addEventListener("error",function(e){var t=mf[o];delete mf[o];for(var n=0,i=t.length;n<i;n++){var r=t[n];r.onError&&r.onError(e)}s.manager.itemError(o),s.manager.itemEnd(o)},!1),v.addEventListener("abort",function(e){var t=mf[o];delete mf[o];for(var n=0,i=t.length;n<i;n++){var r=t[n];r.onError&&r.onError(e)}s.manager.itemError(o),s.manager.itemEnd(o)},!1),void 0!==this.responseType&&(v.responseType=this.responseType),void 0!==this.withCredentials&&(v.withCredentials=this.withCredentials),v.overrideMimeType&&v.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)v.setRequestHeader(g,this.requestHeader[g]);v.send(null)}return s.manager.itemStart(o),v}mf[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}}),(0,p.default)(gf.prototype,{load:function(e,t,n,i){var r=this,a=new vf(r.manager);a.setPath(r.path),a.load(e,function(e){t(r.parse(JSON.parse(e)))},n,i)},parse:function(e){for(var t=[],n=0;n<e.length;n++){var i=uf.parse(e[n]);t.push(i)}return t},setPath:function(e){return this.path=e,this}}),(0,p.default)(yf.prototype,{load:function(e,a,t,i){var o=this,s=[],l=new mc;l.image=s;var r=new vf(this.manager);function n(n){r.load(e[n],function(e){var t=o._parser(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=Ve),l.format=t.format,l.needsUpdate=!0,a&&a(l))},t,i)}if(r.setPath(this.path),r.setResponseType("arraybuffer"),(0,Ge.default)(e))for(var u=0,h=0,c=e.length;h<c;++h)n(h);else r.load(e,function(e){var t=o._parser(e,!0);if(t.isCubemap)for(var n=t.mipmaps.length/t.mipmapCount,i=0;i<n;i++){s[i]={mipmaps:[]};for(var r=0;r<t.mipmapCount;r++)s[i].mipmaps.push(t.mipmaps[i*t.mipmapCount+r]),s[i].format=t.format,s[i].width=t.width,s[i].height=t.height}else l.image.width=t.width,l.image.height=t.height,l.mipmaps=t.mipmaps;1===t.mipmapCount&&(l.minFilter=Ve),l.format=t.format,l.needsUpdate=!0,a&&a(l)},t,i);return l},setPath:function(e){return this.path=e,this}}),(0,p.default)(_f.prototype,{load:function(e,n,t,i){var r=this,a=new io,o=new vf(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(e,function(e){var t=r._parser(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:Ne,a.wrapT=void 0!==t.wrapT?t.wrapT:Ne,a.magFilter=void 0!==t.magFilter?t.magFilter:Ve,a.minFilter=void 0!==t.minFilter?t.minFilter:We,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),1===t.mipmapCount&&(a.minFilter=Ve),a.needsUpdate=!0,n&&n(a,t))},t,i),a},setPath:function(e){return this.path=e,this}}),(0,p.default)(xf.prototype,{crossOrigin:"anonymous",load:function(t,e,n,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,a=df.get(t);if(void 0!==a)return r.manager.itemStart(t),setTimeout(function(){e&&e(a),r.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),df.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1),i&&i(e),r.manager.itemError(t),r.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),r.manager.itemStart(t),o.src=t,o},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),(0,p.default)(bf.prototype,{crossOrigin:"anonymous",load:function(e,n,t,i){var r=new Ol,a=new xf(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(t){a.load(e[t],function(e){r.images[t]=e,o++,6===o&&(r.needsUpdate=!0,n&&n(r))},void 0,i)}for(var l=0;l<e.length;++l)s(l);return r},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),(0,p.default)(wf.prototype,{crossOrigin:"anonymous",load:function(n,i,e,t){var r=new Xn,a=new xf(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(n,function(e){r.image=e;var t=0<n.search(/\.jpe?g($|\?)/i)||0===n.search(/^data\:image\/jpeg/);r.format=t?ot:st,r.needsUpdate=!0,void 0!==i&&i(r)},e,t),r},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),(0,p.default)(Mf.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,i=[],r=this.getPoint(0),a=0;for(i.push(0),n=1;n<=e;n++)t=this.getPoint(n/e),a+=t.distanceTo(r),i.push(a),r=t;return this.cacheArcLengths=i,i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,i=this.getLengths(),r=0,a=i.length;n=t||e*i[a-1];for(var o,s=0,l=a-1;s<=l;)if(r=Math.floor(s+(l-s)/2),o=i[r]-n,o<0)s=r+1;else{if(!(0<o)){l=r;break}l=r-1}if(r=l,i[r]===n)return r/(a-1);var u=i[r],h=i[r+1],c=h-u,d=(n-u)/c,f=(r+d)/(a-1);return f},getTangent:function(e){var t=1e-4,n=e-t,i=e+t;n<0&&(n=0),1<i&&(i=1);var r=this.getPoint(n),a=this.getPoint(i),o=a.clone().sub(r);return o.normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){var n,i,r,a=new Pn,o=[],s=[],l=[],u=new Pn,h=new Qn;for(n=0;n<=e;n++)i=n/e,o[n]=this.getTangentAt(i),o[n].normalize();s[0]=new Pn,l[0]=new Pn;var c=Number.MAX_VALUE,d=Math.abs(o[0].x),f=Math.abs(o[0].y),p=Math.abs(o[0].z);for(d<=c&&(c=d,a.set(1,0,0)),f<=c&&(c=f,a.set(0,1,0)),p<=c&&a.set(0,0,1),u.crossVectors(o[0],a).normalize(),s[0].crossVectors(o[0],u),l[0].crossVectors(o[0],s[0]),n=1;n<=e;n++)s[n]=s[n-1].clone(),l[n]=l[n-1].clone(),u.crossVectors(o[n-1],o[n]),u.length()>re.default&&(u.normalize(),r=Math.acos(kn.clamp(o[n-1].dot(o[n]),-1,1)),s[n].applyMatrix4(h.makeRotationAxis(u,r))),l[n].crossVectors(o[n],s[n]);if(!0===t)for(r=Math.acos(kn.clamp(s[0].dot(s[e]),-1,1)),r/=e,0<o[0].dot(u.crossVectors(s[0],s[e]))&&(r=-r),n=1;n<=e;n++)s[n].applyMatrix4(h.makeRotationAxis(o[n],r*n)),l[n].crossVectors(o[n],s[n]);return{tangents:o,normals:s,binormals:l}},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}}),Tf.prototype=(0,l.default)(Mf.prototype),Tf.prototype.constructor=Tf,Tf.prototype.isEllipseCurve=!0,Tf.prototype.getPoint=function(e,t){for(var n=t||new Rn,i=2*Math.PI,r=this.aEndAngle-this.aStartAngle,a=Math.abs(r)<re.default;r<0;)r+=i;for(;i<r;)r-=i;r<re.default&&(r=a?0:i),!0!==this.aClockwise||a||(r===i?r=-i:r-=i);var o=this.aStartAngle+e*r,s=this.aX+this.xRadius*Math.cos(o),l=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){var u=Math.cos(this.aRotation),h=Math.sin(this.aRotation),c=s-this.aX,d=l-this.aY;s=c*u-d*h+this.aX,l=c*h+d*u+this.aY}return n.set(s,l)},Tf.prototype.copy=function(e){return Mf.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},Tf.prototype.toJSON=function(){var e=Mf.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},Tf.prototype.fromJSON=function(e){return Mf.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},Ef.prototype=(0,l.default)(Tf.prototype),Ef.prototype.constructor=Ef,Ef.prototype.isArcCurve=!0;var Af=new Pn,Lf=new Sf,If=new Sf,kf=new Sf;function Rf(e,t,n,i){Mf.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=i||.5}function Nf(e,t,n,i,r){var a=.5*(i-t),o=.5*(r-n),s=e*e,l=e*s;return(2*n-2*i+a+o)*l+(-3*n+3*i-2*a-o)*s+a*e+n}function Pf(e,t){var n=1-e;return n*n*t}function Cf(e,t){return 2*(1-e)*e*t}function Df(e,t){return e*e*t}function Of(e,t,n,i){return Pf(e,t)+Cf(e,n)+Df(e,i)}function Ff(e,t){var n=1-e;return n*n*n*t}function Bf(e,t){var n=1-e;return 3*n*n*e*t}function Gf(e,t){return 3*(1-e)*e*e*t}function zf(e,t){return e*e*e*t}function Uf(e,t,n,i,r){return Ff(e,t)+Bf(e,n)+Gf(e,i)+zf(e,r)}function Vf(e,t,n,i){Mf.call(this),this.type="CubicBezierCurve",this.v0=e||new Rn,this.v1=t||new Rn,this.v2=n||new Rn,this.v3=i||new Rn}function Hf(e,t,n,i){Mf.call(this),this.type="CubicBezierCurve3",this.v0=e||new Pn,this.v1=t||new Pn,this.v2=n||new Pn,this.v3=i||new Pn}function jf(e,t){Mf.call(this),this.type="LineCurve",this.v1=e||new Rn,this.v2=t||new Rn}function Wf(e,t){Mf.call(this),this.type="LineCurve3",this.v1=e||new Pn,this.v2=t||new Pn}function Yf(e,t,n){Mf.call(this),this.type="QuadraticBezierCurve",this.v0=e||new Rn,this.v1=t||new Rn,this.v2=n||new Rn}function qf(e,t,n){Mf.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new Pn,this.v1=t||new Pn,this.v2=n||new Pn}function Xf(e){Mf.call(this),this.type="SplineCurve",this.points=e||[]}Rf.prototype=(0,l.default)(Mf.prototype),Rf.prototype.constructor=Rf,Rf.prototype.isCatmullRomCurve3=!0,Rf.prototype.getPoint=function(e,t){var n,i,r,a,o=t||new Pn,s=this.points,l=s.length,u=(l-(this.closed?0:1))*e,h=Math.floor(u),c=u-h;if(this.closed?h+=0<h?0:(Math.floor(Math.abs(h)/l)+1)*l:0===c&&h===l-1&&(h=l-2,c=1),n=this.closed||0<h?s[(h-1)%l]:(Af.subVectors(s[0],s[1]).add(s[0]),Af),i=s[h%l],r=s[(h+1)%l],a=this.closed||h+2<l?s[(h+2)%l]:(Af.subVectors(s[l-1],s[l-2]).add(s[l-1]),Af),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,f=Math.pow(n.distanceToSquared(i),d),p=Math.pow(i.distanceToSquared(r),d),m=Math.pow(r.distanceToSquared(a),d);p<1e-4&&(p=1),f<1e-4&&(f=p),m<1e-4&&(m=p),Lf.initNonuniformCatmullRom(n.x,i.x,r.x,a.x,f,p,m),If.initNonuniformCatmullRom(n.y,i.y,r.y,a.y,f,p,m),kf.initNonuniformCatmullRom(n.z,i.z,r.z,a.z,f,p,m)}else"catmullrom"===this.curveType&&(Lf.initCatmullRom(n.x,i.x,r.x,a.x,this.tension),If.initCatmullRom(n.y,i.y,r.y,a.y,this.tension),kf.initCatmullRom(n.z,i.z,r.z,a.z,this.tension));return o.set(Lf.calc(c),If.calc(c),kf.calc(c)),o},Rf.prototype.copy=function(e){Mf.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},Rf.prototype.toJSON=function(){var e=Mf.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},Rf.prototype.fromJSON=function(e){Mf.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push((new Pn).fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},Vf.prototype=(0,l.default)(Mf.prototype),Vf.prototype.constructor=Vf,Vf.prototype.isCubicBezierCurve=!0,Vf.prototype.getPoint=function(e,t){var n=t||new Rn,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(Uf(e,i.x,r.x,a.x,o.x),Uf(e,i.y,r.y,a.y,o.y)),n},Vf.prototype.copy=function(e){return Mf.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},Vf.prototype.toJSON=function(){var e=Mf.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},Vf.prototype.fromJSON=function(e){return Mf.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},Hf.prototype=(0,l.default)(Mf.prototype),Hf.prototype.constructor=Hf,Hf.prototype.isCubicBezierCurve3=!0,Hf.prototype.getPoint=function(e,t){var n=t||new Pn,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(Uf(e,i.x,r.x,a.x,o.x),Uf(e,i.y,r.y,a.y,o.y),Uf(e,i.z,r.z,a.z,o.z)),n},Hf.prototype.copy=function(e){return Mf.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},Hf.prototype.toJSON=function(){var e=Mf.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},Hf.prototype.fromJSON=function(e){return Mf.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},jf.prototype=(0,l.default)(Mf.prototype),jf.prototype.constructor=jf,jf.prototype.isLineCurve=!0,jf.prototype.getPoint=function(e,t){var n=t||new Rn;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},jf.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},jf.prototype.getTangent=function(){var e=this.v2.clone().sub(this.v1);return e.normalize()},jf.prototype.copy=function(e){return Mf.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},jf.prototype.toJSON=function(){var e=Mf.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},jf.prototype.fromJSON=function(e){return Mf.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Wf.prototype=(0,l.default)(Mf.prototype),Wf.prototype.constructor=Wf,Wf.prototype.isLineCurve3=!0,Wf.prototype.getPoint=function(e,t){var n=t||new Pn;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Wf.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Wf.prototype.copy=function(e){return Mf.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Wf.prototype.toJSON=function(){var e=Mf.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Wf.prototype.fromJSON=function(e){return Mf.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Yf.prototype=(0,l.default)(Mf.prototype),Yf.prototype.constructor=Yf,Yf.prototype.isQuadraticBezierCurve=!0,Yf.prototype.getPoint=function(e,t){var n=t||new Rn,i=this.v0,r=this.v1,a=this.v2;return n.set(Of(e,i.x,r.x,a.x),Of(e,i.y,r.y,a.y)),n},Yf.prototype.copy=function(e){return Mf.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Yf.prototype.toJSON=function(){var e=Mf.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Yf.prototype.fromJSON=function(e){return Mf.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},qf.prototype=(0,l.default)(Mf.prototype),qf.prototype.constructor=qf,qf.prototype.isQuadraticBezierCurve3=!0,qf.prototype.getPoint=function(e,t){var n=t||new Pn,i=this.v0,r=this.v1,a=this.v2;return n.set(Of(e,i.x,r.x,a.x),Of(e,i.y,r.y,a.y),Of(e,i.z,r.z,a.z)),n},qf.prototype.copy=function(e){return Mf.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},qf.prototype.toJSON=function(){var e=Mf.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},qf.prototype.fromJSON=function(e){return Mf.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Xf.prototype=(0,l.default)(Mf.prototype),Xf.prototype.constructor=Xf,Xf.prototype.isSplineCurve=!0,Xf.prototype.getPoint=function(e,t){var n=t||new Rn,i=this.points,r=(i.length-1)*e,a=Math.floor(r),o=r-a,s=i[0===a?a:a-1],l=i[a],u=i[a>i.length-2?i.length-1:a+1],h=i[a>i.length-3?i.length-1:a+2];return n.set(Nf(o,s.x,l.x,u.x,h.x),Nf(o,s.y,l.y,u.y,h.y)),n},Xf.prototype.copy=function(e){Mf.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push(i.clone())}return this},Xf.prototype.toJSON=function(){var e=Mf.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var i=this.points[t];e.points.push(i.toArray())}return e},Xf.prototype.fromJSON=function(e){Mf.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push((new Rn).fromArray(i))}return this};var Zf=(0,a.default)({ArcCurve:Ef,CatmullRomCurve3:Rf,CubicBezierCurve:Vf,CubicBezierCurve3:Hf,EllipseCurve:Tf,LineCurve:jf,LineCurve3:Wf,QuadraticBezierCurve:Yf,QuadraticBezierCurve3:qf,SplineCurve:Xf});function Jf(){Mf.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Kf(e){Jf.call(this),this.type="Path",this.currentPoint=new Rn,e&&this.setFromPoints(e)}function Qf(e){Kf.call(this,e),this.uuid=kn.generateUUID(),this.type="Shape",this.holes=[]}function $f(e,t){pr.call(this),this.type="Light",this.color=new Sr(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function ep(e,t,n){$f.call(this,e,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(pr.DefaultUp),this.updateMatrix(),this.groundColor=new Sr(t)}function tp(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new Rn(512,512),this.map=null,this.matrix=new Qn}function np(){tp.call(this,new ja(50,1,.5,500))}function ip(e,t,n,i,r,a){$f.call(this,e,t),this.type="SpotLight",this.position.copy(pr.DefaultUp),this.updateMatrix(),this.target=new pr,(0,g.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!==i?i:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==a?a:1,this.shadow=new np}function rp(e,t,n,i){$f.call(this,e,t),this.type="PointLight",(0,g.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!==i?i:1,this.shadow=new tp(new ja(90,1,.5,500))}function ap(e,t,n,i,r,a){Ha.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!==i?i:-1,this.near=void 0!==r?r:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function op(){tp.call(this,new ap(-5,5,5,-5,.5,500))}function sp(e,t){$f.call(this,e,t),this.type="DirectionalLight",this.position.copy(pr.DefaultUp),this.updateMatrix(),this.target=new pr,this.shadow=new op}function lp(e,t){$f.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function up(e,t,n,i){$f.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==i?i:10}function hp(e){this.manager=void 0!==e?e:pf,this.textures={}}Jf.prototype=(0,p.default)((0,l.default)(Mf.prototype),{constructor:Jf,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 jf(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),i=0;i<n.length;){if(n[i]>=t){var r=n[i]-t,a=this.curves[i],o=a.getLength(),s=0===o?0:1-r/o;return a.getPointAt(s)}i++}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,i=this.curves.length;n<i;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=[],i=0,r=this.curves;i<r.length;i++)for(var a=r[i],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){Mf.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=Mf.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var i=this.curves[t];e.curves.push(i.toJSON())}return e},fromJSON:function(e){Mf.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var i=e.curves[t];this.curves.push((new Zf[i.type]).fromJSON(i))}return this}}),Kf.prototype=(0,p.default)((0,l.default)(Jf.prototype),{constructor:Kf,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)},moveTo:function(e,t){this.currentPoint.set(e,t)},lineTo:function(e,t){var n=new jf(this.currentPoint.clone(),new Rn(e,t));this.curves.push(n),this.currentPoint.set(e,t)},quadraticCurveTo:function(e,t,n,i){var r=new Yf(this.currentPoint.clone(),new Rn(e,t),new Rn(n,i));this.curves.push(r),this.currentPoint.set(n,i)},bezierCurveTo:function(e,t,n,i,r,a){var o=new Vf(this.currentPoint.clone(),new Rn(e,t),new Rn(n,i),new Rn(r,a));this.curves.push(o),this.currentPoint.set(r,a)},splineThru:function(e){var t=[this.currentPoint.clone()].concat(e),n=new Xf(t);this.curves.push(n),this.currentPoint.copy(e[e.length-1])},arc:function(e,t,n,i,r,a){var o=this.currentPoint.x,s=this.currentPoint.y;this.absarc(e+o,t+s,n,i,r,a)},absarc:function(e,t,n,i,r,a){this.absellipse(e,t,n,n,i,r,a)},ellipse:function(e,t,n,i,r,a,o,s){var l=this.currentPoint.x,u=this.currentPoint.y;this.absellipse(e+l,t+u,n,i,r,a,o,s)},absellipse:function(e,t,n,i,r,a,o,s){var l=new Tf(e,t,n,i,r,a,o,s);if(0<this.curves.length){var u=l.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(l);var h=l.getPoint(1);this.currentPoint.copy(h)},copy:function(e){return Jf.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=Jf.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return Jf.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),Qf.prototype=(0,p.default)((0,l.default)(Kf.prototype),{constructor:Qf,getPointsHoles:function(e){for(var t=[],n=0,i=this.holes.length;n<i;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){Kf.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var i=e.holes[t];this.holes.push(i.clone())}return this},toJSON:function(){var e=Kf.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var i=this.holes[t];e.holes.push(i.toJSON())}return e},fromJSON:function(e){Kf.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var i=e.holes[t];this.holes.push((new Kf).fromJSON(i))}return this}}),$f.prototype=(0,p.default)((0,l.default)(pr.prototype),{constructor:$f,isLight:!0,copy:function(e){return pr.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=pr.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}}),ep.prototype=(0,p.default)((0,l.default)($f.prototype),{constructor:ep,isHemisphereLight:!0,copy:function(e){return $f.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),(0,p.default)(tp.prototype,{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}}),np.prototype=(0,p.default)((0,l.default)(tp.prototype),{constructor:np,isSpotLightShadow:!0,update:function(e){var t=this.camera,n=2*kn.RAD2DEG*e.angle,i=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;n===t.fov&&i===t.aspect&&r===t.far||(t.fov=n,t.aspect=i,t.far=r,t.updateProjectionMatrix())}}),ip.prototype=(0,p.default)((0,l.default)($f.prototype),{constructor:ip,isSpotLight:!0,copy:function(e){return $f.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}}),rp.prototype=(0,p.default)((0,l.default)($f.prototype),{constructor:rp,isPointLight:!0,copy:function(e){return $f.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),ap.prototype=(0,p.default)((0,l.default)(Ha.prototype),{constructor:ap,isOrthographicCamera:!0,copy:function(e,t){return Ha.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,p.default)({},e.view),this},setViewOffset:function(e,t,n,i,r,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=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,r=n-e,a=n+e,o=i+t,s=i-t;if(null!==this.view&&this.view.enabled){var l=this.zoom/(this.view.width/this.view.fullWidth),u=this.zoom/(this.view.height/this.view.fullHeight),h=(this.right-this.left)/this.view.width,c=(this.top-this.bottom)/this.view.height;r+=h*(this.view.offsetX/l),a=r+h*(this.view.width/l),o-=c*(this.view.offsetY/u),s=o-c*(this.view.height/u)}this.projectionMatrix.makeOrthographic(r,a,o,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=pr.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,p.default)({},this.view)),t}}),op.prototype=(0,p.default)((0,l.default)(tp.prototype),{constructor:op}),sp.prototype=(0,p.default)((0,l.default)($f.prototype),{constructor:sp,isDirectionalLight:!0,copy:function(e){return $f.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),lp.prototype=(0,p.default)((0,l.default)($f.prototype),{constructor:lp,isAmbientLight:!0}),up.prototype=(0,p.default)((0,l.default)($f.prototype),{constructor:up,isRectAreaLight:!0,copy:function(e){return $f.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=$f.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}),(0,p.default)(hp.prototype,{load:function(e,t,n,i){var r=this,a=new vf(r.manager);a.setPath(r.path),a.load(e,function(e){t(r.parse(JSON.parse(e)))},n,i)},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 i=new Xd[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.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.vertexColors&&(i.vertexColors=e.vertexColors),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.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.visible&&(i.visible=e.visible),void 0!==e.userData&&(i.userData=e.userData),void 0!==e.uniforms)for(var r in e.uniforms){var a=e.uniforms[r];switch(i.uniforms[r]={},a.type){case"t":i.uniforms[r].value=n(a.value);break;case"c":i.uniforms[r].value=(new Sr).setHex(a.value);break;case"v2":i.uniforms[r].value=(new Rn).fromArray(a.value);break;case"v3":i.uniforms[r].value=(new Pn).fromArray(a.value);break;case"v4":i.uniforms[r].value=(new Zn).fromArray(a.value);break;case"m3":i.uniforms[r].value=(new Cn).fromArray(a.value);case"m4":i.uniforms[r].value=(new Qn).fromArray(a.value);break;default:i.uniforms[r].value=a.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 o in e.extensions)i.extensions[o]=e.extensions[o];if(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!==e.map&&(i.map=n(e.map)),void 0!==e.matcap&&(i.matcap=n(e.matcap)),void 0!==e.alphaMap&&(i.alphaMap=n(e.alphaMap),i.transparent=!0),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){var s=e.normalScale;!1===(0,Ge.default)(s)&&(s=[s,s]),i.normalScale=(new Rn).fromArray(s)}return 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)),i},setPath:function(e){return this.path=e,this},setTextures:function(e){return this.textures=e,this}});var cp={decodeText:function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}},extractUrlBase:function(e){var t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)}};function dp(){wa.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function fp(e,t,n,i){"number"==typeof n&&(i=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),Cr.call(this,e,t,n),this.meshPerAttribute=i||1}function pp(e){this.manager=void 0!==e?e:pf}t.LoaderUtils=cp,dp.prototype=(0,p.default)((0,l.default)(wa.prototype),{constructor:dp,isInstancedBufferGeometry:!0,copy:function(e){return wa.prototype.copy.call(this,e),this.maxInstancedCount=e.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e=wa.prototype.toJSON.call(this);return e.maxInstancedCount=this.maxInstancedCount,e.isInstancedBufferGeometry=!0,e}}),fp.prototype=(0,p.default)((0,l.default)(Cr.prototype),{constructor:fp,isInstancedBufferAttribute:!0,copy:function(e){return Cr.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},toJSON:function(){var e=Cr.prototype.toJSON.call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}),(0,p.default)(pp.prototype,{load:function(e,t,n,i){var r=this,a=new vf(r.manager);a.setPath(r.path),a.load(e,function(e){t(r.parse(JSON.parse(e)))},n,i)},parse:function(e){var t=new(e.isInstancedBufferGeometry?dp:wa),n=e.data.index;if(void 0!==n){var i=new mp[n.type](n.array);t.setIndex(new Cr(i,1))}var r=e.data.attributes;for(var a in r){var o=r[a],s=(i=new mp[o.type](o.array),o.isInstancedBufferAttribute?fp:Cr),l=new s(i,o.itemSize,o.normalized);void 0!==o.name&&(l.name=o.name),t.addAttribute(a,l)}var u=e.data.morphAttributes;if(u)for(var a in u){for(var h=u[a],c=[],d=0,f=h.length;d<f;d++)o=h[d],i=new mp[o.type](o.array),l=new Cr(i,o.itemSize,o.normalized),void 0!==o.name&&(l.name=o.name),c.push(l);t.morphAttributes[a]=c}var p=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==p){d=0;for(var m=p.length;d!==m;++d){var v=p[d];t.addGroup(v.start,v.count,v.materialIndex)}}var g=e.data.boundingSphere;if(void 0!==g){var y=new Pn;void 0!==g.center&&y.fromArray(g.center),t.boundingSphere=new _r(y,g.radius)}return e.name&&(t.name=e.name),e.userData&&(t.userData=e.userData),t},setPath:function(e){return this.path=e,this}});var mp={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function vp(e){this.manager=void 0!==e?e:pf,this.resourcePath=""}(0,p.default)(vp.prototype,{crossOrigin:"anonymous",load:function(i,r,e,a){var o=this,t=void 0===this.path?cp.extractUrlBase(i):this.path;this.resourcePath=this.resourcePath||t;var n=new vf(o.manager);n.setPath(this.path),n.load(i,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 "+i+".",e.message)}var n=t.metadata;void 0!==n&&void 0!==n.type&&"geometry"!==n.type.toLowerCase()?o.parse(t,r):console.error("THREE.ObjectLoader: Can't load "+i)},e,a)},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){var n=this.parseShape(e.shapes),i=this.parseGeometries(e.geometries,n),r=this.parseImages(e.images,function(){void 0!==t&&t(s)}),a=this.parseTextures(e.textures,r),o=this.parseMaterials(e.materials,a),s=this.parseObject(e.object,i,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,i=e.length;n<i;n++){var r=(new Qf).fromJSON(e[n]);t[r.uuid]=r}return t},parseGeometries:function(e,t){var n={};if(void 0!==e)for(var i=new pp,r=0,a=e.length;r<a;r++){var o,s=e[r];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new Fd[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new Fd[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new Fd[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new Fd[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 Fd[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new Fd[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 Fd[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new Fd[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new Fd[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new Fd[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":o=new Fd[s.type]((new Zf[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":o=new Fd[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new Fd[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 Fd[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 Zf[d.type]).fromJSON(d)),o=new Fd[s.type](l,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":o=i.parse(s);break;case"Geometry":if("THREE"in window&&"LegacyJSONLoader"in THREE){var f=new THREE.LegacyJSONLoader;o=f.parse(s,this.resourcePath).geometry}else console.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".');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={},i={};if(void 0!==e){var r=new hp;r.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]=r.parse(h)),l.push(n[h.uuid])}i[s.uuid]=l}else void 0===n[s.uuid]&&(n[s.uuid]=r.parse(s)),i[s.uuid]=n[s.uuid]}}return i},parseAnimations:function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n],r=uf.parse(i);void 0!==i.uuid&&(r.uuid=i.uuid),t.push(r)}return t},parseImages:function(e,t){var n=this,i={};function r(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 ff(t),o=new xf(a);o.setCrossOrigin(this.crossOrigin);for(var s=0,l=e.length;s<l;s++){var u=e[s],h=u.url;if((0,Ge.default)(h)){i[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;i[u.uuid].push(r(p))}}else p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(u.url)?u.url:n.resourcePath+u.url,i[u.uuid]=r(p)}}return i},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 i={};if(void 0!==e)for(var r=0,a=e.length;r<a;r++){var o,s=e[r];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,Ge.default)(t[s.image])?Ol:Xn)(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,wp)),void 0!==s.offset&&o.offset.fromArray(s.offset),void 0!==s.repeat&&o.repeat.fromArray(s.repeat),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],Mp),o.wrapT=n(s.wrap[1],Mp)),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,Tp)),void 0!==s.magFilter&&(o.magFilter=n(s.magFilter,Tp)),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),i[s.uuid]=o}return i},parseObject:function(e,t,a){var n;function i(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function r(e){if(void 0!==e){if((0,Ge.default)(e)){for(var t=[],n=0,i=e.length;n<i;n++){var r=e[n];void 0===a[r]&&console.warn("THREE.ObjectLoader: Undefined material",r),t.push(a[r])}return t}return void 0===a[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),a[e]}}switch(e.type){case"Scene":n=new mr,void 0!==e.background&&(0,y.default)(e.background)&&(n.background=new Sr(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?n.fog=new Qh(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(n.fog=new Kh(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":n=new ja(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(n.focus=e.focus),void 0!==e.zoom&&(n.zoom=e.zoom),void 0!==e.filmGauge&&(n.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(n.filmOffset=e.filmOffset),void 0!==e.view&&(n.view=(0,p.default)({},e.view));break;case"OrthographicCamera":n=new ap(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(n.zoom=e.zoom),void 0!==e.view&&(n.view=(0,p.default)({},e.view));break;case"AmbientLight":n=new lp(e.color,e.intensity);break;case"DirectionalLight":n=new sp(e.color,e.intensity);break;case"PointLight":n=new rp(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":n=new up(e.color,e.intensity,e.width,e.height);break;case"SpotLight":n=new ip(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":n=new ep(e.color,e.groundColor,e.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var o=i(e.geometry),s=r(e.material);n=new(o.bones&&0<o.bones.length?ac:Ma)(o,s),void 0!==e.drawMode&&n.setDrawMode(e.drawMode);break;case"LOD":n=new rc;break;case"Line":n=new uc(i(e.geometry),r(e.material),e.mode);break;case"LineLoop":n=new cc(i(e.geometry),r(e.material));break;case"LineSegments":n=new hc(i(e.geometry),r(e.material));break;case"PointCloud":case"Points":n=new fc(i(e.geometry),r(e.material));break;case"Sprite":n=new nc(r(e.material));break;case"Group":n=new mh;break;default:n=new pr}if(n.uuid=e.uuid,void 0!==e.name&&(n.name=e.name),void 0!==e.matrix?(n.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(n.matrixAutoUpdate=e.matrixAutoUpdate),n.matrixAutoUpdate&&n.matrix.decompose(n.position,n.quaternion,n.scale)):(void 0!==e.position&&n.position.fromArray(e.position),void 0!==e.rotation&&n.rotation.fromArray(e.rotation),void 0!==e.quaternion&&n.quaternion.fromArray(e.quaternion),void 0!==e.scale&&n.scale.fromArray(e.scale)),void 0!==e.castShadow&&(n.castShadow=e.castShadow),void 0!==e.receiveShadow&&(n.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(n.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(n.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&n.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(n.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(n.visible=e.visible),void 0!==e.frustumCulled&&(n.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(n.renderOrder=e.renderOrder),void 0!==e.userData&&(n.userData=e.userData),void 0!==e.layers&&(n.layers.mask=e.layers),void 0!==e.children)for(var l=e.children,u=0;u<l.length;u++)n.add(this.parseObject(l[u],t,a));if("LOD"===e.type)for(var h=e.levels,c=0;c<h.length;c++){var d=h[c],f=n.getObjectByProperty("uuid",d.object);void 0!==f&&n.addLevel(f,d.distance)}return n}});var gp,yp,_p,xp,bp,wp={UVMapping:ne,CubeReflectionMapping:ie,CubeRefractionMapping:ae,EquirectangularReflectionMapping:oe,EquirectangularRefractionMapping:se,SphericalReflectionMapping:le,CubeUVReflectionMapping:ue,CubeUVRefractionMapping:ke},Mp={RepeatWrapping:Re,ClampToEdgeWrapping:Ne,MirroredRepeatWrapping:Pe},Tp={NearestFilter:Ce,NearestMipmapNearestFilter:De,NearestMipmapLinearFilter:Fe,LinearFilter:Ve,LinearMipmapNearestFilter:He,LinearMipmapLinearFilter:We};function Ep(e){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.manager=void 0!==e?e:pf,this.options=void 0}function Sp(){this.type="ShapePath",this.color=new Sr,this.subPaths=[],this.currentPath=null}function Ap(e){this.type="Font",this.data=e}function Lp(e,t,n){for(var i=d.default?(0,d.default)(e):String(e).split(""),r=t/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*r,o=[],s=0,l=0,u=0;u<i.length;u++){var h=i[u];if("\n"===h)s=0,l-=a;else{var c=Ip(h,r,s,l,n);s+=c.offsetX,o.push(c.path)}}return o}function Ip(e,t,n,i,r){var a=r.glyphs[e]||r.glyphs["?"];if(a){var o,s,l,u,h,c,d,f,p=new Sp;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+i,p.moveTo(o,s);break;case"l":o=m[v++]*t+n,s=m[v++]*t+i,p.lineTo(o,s);break;case"q":l=m[v++]*t+n,u=m[v++]*t+i,h=m[v++]*t+n,c=m[v++]*t+i,p.quadraticCurveTo(h,c,l,u);break;case"b":l=m[v++]*t+n,u=m[v++]*t+i,h=m[v++]*t+n,c=m[v++]*t+i,d=m[v++]*t+n,f=m[v++]*t+i,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 '+r.familyName+".")}function kp(e){this.manager=void 0!==e?e:pf}function Rp(){}Ep.prototype={constructor:Ep,setOptions:function(e){return this.options=e,this},load:function(t,n,e,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,a=df.get(t);if(void 0!==a)return r.manager.itemStart(t),setTimeout(function(){n&&n(a),r.manager.itemEnd(t)},0),a;fetch(t).then(function(e){return e.blob()}).then(function(e){return void 0===r.options?createImageBitmap(e):createImageBitmap(e,r.options)}).then(function(e){df.add(t,e),n&&n(e),r.manager.itemEnd(t)}).catch(function(e){i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)}),r.manager.itemStart(t)},setCrossOrigin:function(){return this},setPath:function(e){return this.path=e,this}},(0,p.default)(Sp.prototype,{moveTo:function(e,t){this.currentPath=new Kf,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t)},lineTo:function(e,t){this.currentPath.lineTo(e,t)},quadraticCurveTo:function(e,t,n,i){this.currentPath.quadraticCurveTo(e,t,n,i)},bezierCurveTo:function(e,t,n,i,r,a){this.currentPath.bezierCurveTo(e,t,n,i,r,a)},splineThru:function(e){this.currentPath.splineThru(e)},toShapes:function(e,t){function n(e){for(var t=[],n=0,i=e.length;n<i;n++){var r=e[n],a=new Qf;a.curves=r.curves,t.push(a)}return t}function i(e,t){for(var n=t.length,i=!1,r=n-1,a=0;a<n;r=a++){var o=t[r],s=t[a],l=s.x-o.x,u=s.y-o.y;if(Math.abs(u)>re.default){if(u<0&&(o=t[a],l=-l,s=t[r],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;i=!i}}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 i}var r=dd.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 Qf,l.curves=s.curves,u.push(l),u;var h=!r(a[0].getPoints());h=e?!h:h;var c,d,f=[],p=[],m=[],v=0;p[v]=void 0,m[v]=[];for(var g=0,y=a.length;g<y;g++)s=a[g],c=s.getPoints(),o=r(c),o=e?!o:o,o?(!h&&p[v]&&v++,p[v]={s:new Qf,p:c},p[v].s.curves=s.curves,h&&v++,m[v]=[]):m[v].push({h:s,p:c[0]});if(!p[0])return n(a);if(1<p.length){for(var _=!1,x=[],b=0,w=p.length;b<w;b++)f[b]=[];for(b=0,w=p.length;b<w;b++)for(var M=m[b],T=0;T<M.length;T++){for(var E=M[T],S=!0,A=0;A<p.length;A++)i(E.p,p[A].p)&&(b!==A&&x.push({froms:b,tos:A,hole:T}),S?(S=!1,f[A].push(E)):_=!0);S&&f[b].push(E)}0<x.length&&(_||(m=f))}g=0;for(var L=p.length;g<L;g++){l=p[g].s,u.push(l),d=m[g];for(var I=0,k=d.length;I<k;I++)l.holes.push(d[I].h)}return u}}),(0,p.default)(Ap.prototype,{isFont:!0,generateShapes:function(e,t){void 0===t&&(t=100);for(var n=[],i=Lp(e,t,this.data),r=0,a=i.length;r<a;r++)Array.prototype.push.apply(n,i[r].toShapes());return n}}),(0,p.default)(kp.prototype,{load:function(e,i,t,n){var r=this,a=new vf(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=r.parse(n);i&&i(e)},t,n)},parse:function(e){return new Ap(e)},setPath:function(e){return this.path=e,this}}),Rp.Handlers={handlers:[],add:function(e,t){this.handlers.push(e,t)},get:function(e){for(var t=this.handlers,n=0,i=t.length;n<i;n+=2){var r=t[n],a=t[n+1];if(r.test(e))return a}return null}},(0,p.default)(Rp.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(e,t,n){for(var i=[],r=0;r<e.length;++r)i[r]=this.createMaterial(e[r],t,n);return i},createMaterial:(gp={NoBlending:me,NormalBlending:ve,AdditiveBlending:ge,SubtractiveBlending:ye,MultiplyBlending:_e,CustomBlending:xe},yp=new Sr,_p=new wf,xp=new hp,function(e,u,h){var c={};function t(e,t,n,i,r){var a,o=u+e,s=Rp.Handlers.get(o);a=null!==s?s.load(o):(_p.setCrossOrigin(h),_p.load(o)),void 0!==t&&(a.repeat.fromArray(t),1!==t[0]&&(a.wrapS=Re),1!==t[1]&&(a.wrapT=Re)),void 0!==n&&a.offset.fromArray(n),void 0!==i&&("repeat"===i[0]&&(a.wrapS=Re),"mirror"===i[0]&&(a.wrapS=Pe),"repeat"===i[1]&&(a.wrapT=Re),"mirror"===i[1]&&(a.wrapT=Pe)),void 0!==r&&(a.anisotropy=r);var l=kn.generateUUID();return c[l]=a,l}var n={uuid:kn.generateUUID(),type:"MeshLambertMaterial"};for(var i in e){var r=e[i];switch(i){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":n.name=r;break;case"blending":n.blending=gp[r];break;case"colorAmbient":case"mapAmbient":break;case"colorDiffuse":n.color=yp.fromArray(r).getHex();break;case"colorSpecular":n.specular=yp.fromArray(r).getHex();break;case"colorEmissive":n.emissive=yp.fromArray(r).getHex();break;case"specularCoef":n.shininess=r;break;case"shading":"basic"===r.toLowerCase()&&(n.type="MeshBasicMaterial"),"phong"===r.toLowerCase()&&(n.type="MeshPhongMaterial"),"standard"===r.toLowerCase()&&(n.type="MeshStandardMaterial");break;case"mapDiffuse":n.map=t(r,e.mapDiffuseRepeat,e.mapDiffuseOffset,e.mapDiffuseWrap,e.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":n.emissiveMap=t(r,e.mapEmissiveRepeat,e.mapEmissiveOffset,e.mapEmissiveWrap,e.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":n.lightMap=t(r,e.mapLightRepeat,e.mapLightOffset,e.mapLightWrap,e.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":n.aoMap=t(r,e.mapAORepeat,e.mapAOOffset,e.mapAOWrap,e.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":n.bumpMap=t(r,e.mapBumpRepeat,e.mapBumpOffset,e.mapBumpWrap,e.mapBumpAnisotropy);break;case"mapBumpScale":n.bumpScale=r;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":n.normalMap=t(r,e.mapNormalRepeat,e.mapNormalOffset,e.mapNormalWrap,e.mapNormalAnisotropy);break;case"mapNormalFactor":n.normalScale=r;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":n.specularMap=t(r,e.mapSpecularRepeat,e.mapSpecularOffset,e.mapSpecularWrap,e.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":n.metalnessMap=t(r,e.mapMetalnessRepeat,e.mapMetalnessOffset,e.mapMetalnessWrap,e.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":n.roughnessMap=t(r,e.mapRoughnessRepeat,e.mapRoughnessOffset,e.mapRoughnessWrap,e.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":n.alphaMap=t(r,e.mapAlphaRepeat,e.mapAlphaOffset,e.mapAlphaWrap,e.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":n.side=ze;break;case"doubleSided":n.side=pe;break;case"transparency":n.opacity=r;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":n[i]=r;break;case"vertexColors":!0===r&&(n.vertexColors=I),"face"===r&&(n.vertexColors=L)}}return"MeshBasicMaterial"===n.type&&delete n.emissive,"MeshPhongMaterial"!==n.type&&delete n.specular,n.opacity<1&&(n.transparent=!0),xp.setTextures(c),xp.parse(n)})});var Np,Pp,Cp,Dp,Op,Fp,Bp,Gp,zp,Up,Vp,Hp,jp,Wp,Yp,qp,Xp,Zp,Jp,Kp={getContext:function(){return void 0===bp&&(bp=new(window.AudioContext||window.webkitAudioContext)),bp},setContext:function(e){bp=e}};function Qp(e){this.manager=void 0!==e?e:pf}function $p(){this.coefficients=[];for(var e=0;e<9;e++)this.coefficients.push(new Pn)}function em(e,t){$f.call(this,void 0,t),this.sh=void 0!==e?e:new $p}function tm(e,t,n){em.call(this,void 0,n);var i=(new Sr).set(e),r=(new Sr).set(t),a=new Pn(i.r,i.g,i.b),o=new Pn(r.r,r.g,r.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 nm(e,t){em.call(this,void 0,t);var n=(new Sr).set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}function im(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new ja,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ja,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function rm(e){this.autoStart=void 0===e||e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function am(){pr.call(this),this.type="AudioListener",this.context=Kp.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0}function om(e){pr.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.startTime=0,this.offset=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function sm(e){om.call(this,e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function lm(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 um(e,t,n){this.binding=e,this.valueSize=n;var i,r=Float64Array;switch(t){case"quaternion":i=this._slerp;break;case"string":case"bool":r=Array,i=this._select;break;default:i=this._lerp}this.buffer=new r(4*n),this._mixBufferRegion=i,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}t.AudioContext=Kp,(0,p.default)(Qp.prototype,{load:function(e,i,t,n){var r=new vf(this.manager);r.setResponseType("arraybuffer"),r.setPath(this.path),r.load(e,function(e){var t=e.slice(0),n=Kp.getContext();n.decodeAudioData(t,function(e){i(e)})},t,n)},setPath:function(e){return this.path=e,this}}),(0,p.default)($p.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,i=e.y,r=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScale(a[1],.488603*i),t.addScale(a[2],.488603*r),t.addScale(a[3],.488603*n),t.addScale(a[4],n*i*1.092548),t.addScale(a[5],i*r*1.092548),t.addScale(a[6],.315392*(3*r*r-1)),t.addScale(a[7],n*r*1.092548),t.addScale(a[8],.546274*(n*n-i*i)),t},getIrradianceAt:function(e,t){var n=e.x,i=e.y,r=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScale(a[1],1.023328*i),t.addScale(a[2],1.023328*r),t.addScale(a[3],1.023328*n),t.addScale(a[4],.858086*n*i),t.addScale(a[5],.858086*i*r),t.addScale(a[6],.743125*r*r-.247708),t.addScale(a[7],.858086*n*r),t.addScale(a[8],.429043*(n*n-i*i)),t},add:function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[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){for(var t=this.coefficients,n=0;n<9;n++)t[n].fromArray(e,3*n);return this},toArray:function(){for(var e=[],t=this.coefficients,n=0;n<9;n++)t[n].toArray(e,3*n);return e}}),(0,p.default)($p,{getBasisAt:function(e,t){var n=e.x,i=e.y,r=e.z;t[0]=.282095,t[1]=.488603*i,t[2]=.488603*r,t[3]=.488603*n,t[4]=1.092548*n*i,t[5]=1.092548*i*r,t[6]=.315392*(3*r*r-1),t[7]=1.092548*n*r,t[8]=.546274*(n*n-i*i)}}),em.prototype=(0,p.default)((0,l.default)($f.prototype),{constructor:em,isLightProbe:!0,copy:function(e){return $f.prototype.copy.call(this,e),this.sh.copy(e.sh),this.intensity=e.intensity,this},toJSON:function(e){var t=$f.prototype.toJSON.call(this,e);return t}}),tm.prototype=(0,p.default)((0,l.default)(em.prototype),{constructor:tm,isHemisphereLightProbe:!0,copy:function(e){return em.prototype.copy.call(this,e),this},toJSON:function(e){var t=em.prototype.toJSON.call(this,e);return t}}),nm.prototype=(0,p.default)((0,l.default)(em.prototype),{constructor:nm,isAmbientLightProbe:!0,copy:function(e){return em.prototype.copy.call(this,e),this},toJSON:function(e){var t=em.prototype.toJSON.call(this,e);return t}}),(0,p.default)(im.prototype,{update:(zp=new Qn,Up=new Qn,function(e){var t=Np!==this||Pp!==e.focus||Cp!==e.fov||Dp!==e.aspect*this.aspect||Op!==e.near||Fp!==e.far||Bp!==e.zoom||Gp!==this.eyeSep;if(t){Np=this,Pp=e.focus,Cp=e.fov,Dp=e.aspect*this.aspect,Op=e.near,Fp=e.far,Bp=e.zoom;var n=e.projectionMatrix.clone();Gp=this.eyeSep/2;var i,r,a=Gp*Op/Pp,o=Op*Math.tan(kn.DEG2RAD*Cp*.5)/Bp;Up.elements[12]=-Gp,zp.elements[12]=Gp,i=-o*Dp+a,r=o*Dp+a,n.elements[0]=2*Op/(r-i),n.elements[8]=(r+i)/(r-i),this.cameraL.projectionMatrix.copy(n),i=-o*Dp-a,r=o*Dp-a,n.elements[0]=2*Op/(r-i),n.elements[8]=(r+i)/(r-i),this.cameraR.projectionMatrix.copy(n)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Up),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(zp)})}),(0,p.default)(rm.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=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=("undefined"==typeof performance?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}),am.prototype=(0,p.default)((0,l.default)(pr.prototype),{constructor:am,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.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:(Vp=new Pn,Hp=new Nn,jp=new Pn,Wp=new Pn,Yp=new rm,function(e){pr.prototype.updateMatrixWorld.call(this,e);var t=this.context.listener,n=this.up;if(this.timeDelta=Yp.getDelta(),this.matrixWorld.decompose(Vp,Hp,jp),Wp.set(0,0,-1).applyQuaternion(Hp),t.positionX){var i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Vp.x,i),t.positionY.linearRampToValueAtTime(Vp.y,i),t.positionZ.linearRampToValueAtTime(Vp.z,i),t.forwardX.linearRampToValueAtTime(Wp.x,i),t.forwardY.linearRampToValueAtTime(Wp.y,i),t.forwardZ.linearRampToValueAtTime(Wp.z,i),t.upX.linearRampToValueAtTime(n.x,i),t.upY.linearRampToValueAtTime(n.y,i),t.upZ.linearRampToValueAtTime(n.z,i)}else t.setPosition(Vp.x,Vp.y,Vp.z),t.setOrientation(Wp.x,Wp.y,Wp.z,n.x,n.y,n.z)})}),om.prototype=(0,p.default)((0,l.default)(pr.prototype),{constructor:om,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},setBuffer:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){var e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.onended=this.onEnded.bind(this),this.startTime=this.context.currentTime,e.start(this.startTime,this.offset),this.isPlaying=!0,this.source=e,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.source.stop(),this.source.onended=null,this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this.source.stop(),this.source.onended=null,this.offset=0,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.")},getVolume:function(){return this.gain.gain.value},setVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}),sm.prototype=(0,p.default)((0,l.default)(om.prototype),{constructor:sm,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:(qp=new Pn,Xp=new Nn,Zp=new Pn,Jp=new Pn,function(e){if(pr.prototype.updateMatrixWorld.call(this,e),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(qp,Xp,Zp),Jp.set(0,0,1).applyQuaternion(Xp);var t=this.panner;if(t.positionX){var n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(qp.x,n),t.positionY.linearRampToValueAtTime(qp.y,n),t.positionZ.linearRampToValueAtTime(qp.z,n),t.orientationX.linearRampToValueAtTime(Jp.x,n),t.orientationY.linearRampToValueAtTime(Jp.y,n),t.orientationZ.linearRampToValueAtTime(Jp.z,n)}else t.setPosition(qp.x,qp.y,qp.z),t.setOrientation(Jp.x,Jp.y,Jp.z)}})}),(0,p.default)(lm.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,p.default)(um.prototype,{accumulate:function(e,t){var n=this.buffer,i=this.valueSize,r=e*i+i,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==i;++o)n[r+o]=n[o];a=t}else{a+=t;var s=t/a;this._mixBufferRegion(n,r,0,s,i)}this.cumulativeWeight=a},apply:function(e){var t=this.valueSize,n=this.buffer,i=e*t+t,r=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,r<1){var o=3*t;this._mixBufferRegion(n,i,o,1-r,t)}for(var s=t,l=t+t;s!==l;++s)if(n[s]!==n[s+t]){a.setValue(n,i);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,i=3*n;e.getValue(t,i);for(var r=n,a=i;r!==a;++r)t[r]=t[i+r%n];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,t,n,i,r){if(.5<=i)for(var a=0;a!==r;++a)e[t+a]=e[n+a]},_slerp:function(e,t,n,i){Nn.slerpFlat(e,t,e,t,e,n,i)},_lerp:function(e,t,n,i,r){for(var a=1-i,o=0;o!==r;++o){var s=t+o;e[s]=e[s]*a+e[n+o]*i}}});var hm,cm,dm,fm,pm,mm,vm,gm,ym,_m,xm,bm,wm,Mm,Tm,Em,Sm,Am,Lm,Im,km,Rm,Nm,Pm,Cm,Dm,Om,Fm,Bm,Gm,zm,Um,Vm,Hm,jm,Wm,Ym,qm,Xm="\\[\\]\\.:\\/";function Zm(e,t,n){var i=n||Jm.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}function Jm(e,t,n){this.path=t,this.parsedPath=n||Jm.parseTrackName(t),this.node=Jm.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function Km(){this.uuid=kn.generateUUID(),this._objects=Array.prototype.slice.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 i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}function Qm(e,t,n){this._mixer=e,this._clip=t,this._localRoot=n||null;for(var i=t.tracks,r=i.length,a=new Array(r),o={endingStart:Ht,endingEnd:Ht},s=0;s!==r;++s){var l=i[s].createInterpolant(null);a[s]=l,l.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Bt,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function $m(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function ev(e,t){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=t),this.value=e}function tv(e,t,n){$h.call(this,e,t),this.meshPerAttribute=n||1}function nv(e,t,n,i){this.ray=new xr(e,t),this.near=n||0,this.far=i||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},(0,u.default)(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function iv(e,t){return e.distance-t.distance}function rv(e,t,n,i){if(!1!==e.visible&&(e.raycast(t,n),!0===i))for(var r=e.children,a=0,o=r.length;a<o;a++)rv(r[a],t,n,!0)}function av(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 ov(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}function sv(e,t){this.min=void 0!==e?e:new Rn(1/0,1/0),this.max=void 0!==t?t:new Rn(-1/0,-1/0)}function lv(e,t){this.start=void 0!==e?e:new Pn,this.end=void 0!==t?t:new Pn}function uv(e){pr.call(this),this.material=e,this.render=function(){}}function hv(e,t,n,i){this.object=e,this.size=void 0!==t?t:1;var r=void 0!==n?n:16711680,a=void 0!==i?i:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=3*s.faces.length:s&&s.isBufferGeometry&&(o=s.attributes.normal.count);var l=new wa,u=new Vr(2*o*3,3);l.addAttribute("position",u),hc.call(this,l,new lc({color:r,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function cv(e,t){pr.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var n=new wa,i=[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],r=0,a=1,o=32;r<o;r++,a++){var s=r/o*Math.PI*2,l=a/o*Math.PI*2;i.push(Math.cos(s),Math.sin(s),1,Math.cos(l),Math.sin(l),1)}n.addAttribute("position",new Vr(i,3));var u=new lc({fog:!1});this.cone=new hc(n,u),this.add(this.cone),this.update()}function dv(e){var t=[];e&&e.isBone&&t.push(e);for(var n=0;n<e.children.length;n++)t.push.apply(t,dv(e.children[n]));return t}function fv(e){for(var t=dv(e),n=new wa,i=[],r=[],a=new Sr(0,0,1),o=new Sr(0,1,0),s=0;s<t.length;s++){var l=t[s];l.parent&&l.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(a.r,a.g,a.b),r.push(o.r,o.g,o.b))}n.addAttribute("position",new Vr(i,3)),n.addAttribute("color",new Vr(r,3));var u=new lc({vertexColors:I,depthTest:!1,depthWrite:!1,transparent:!0});hc.call(this,n,u),this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}function pv(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n;var i=new wd(t,4,2),r=new Pr({wireframe:!0,fog:!1});Ma.call(this,i,r),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function mv(e,t){this.type="RectAreaLightHelper",this.light=e,this.color=t;var n=[1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],i=new wa;i.addAttribute("position",new Vr(n,3)),i.computeBoundingSphere();var r=new lc({fog:!1});uc.call(this,i,r);var a=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],o=new wa;o.addAttribute("position",new Vr(a,3)),o.computeBoundingSphere(),this.add(new Ma(o,new Pr({side:ze,fog:!1}))),this.update()}function vv(e,t,n){pr.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var i=new Sc(t);i.rotateY(.5*Math.PI),this.material=new Pr({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=I);var r=i.getAttribute("position"),a=new Float32Array(3*r.count);i.addAttribute("color",new Cr(a,3)),this.add(new Ma(i,this.material)),this.update()}function gv(e,t){this.lightProbe=e,this.size=t;var n={GAMMA_OUTPUT:""},i=new Va({defines:n,uniforms:{sh:{value:this.lightProbe.sh.coefficients},intensity:{value:this.lightProbe.intensity}},vertexShader:["varying vec3 vNormal;","void main() {","\tvNormal = normalize( normalMatrix * normal );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define RECIPROCAL_PI 0.318309886","vec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {","\t// matrix is assumed to be orthogonal","\treturn normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );","}","vec3 linearToOutput( in vec3 a ) {","\t#ifdef GAMMA_OUTPUT","\t\treturn pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );","\t#else","\t\treturn a;","\t#endif","}","// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf","vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {","\t// normal is assumed to have unit length","\tfloat x = normal.x, y = normal.y, z = normal.z;","\t// band 0","\tvec3 result = shCoefficients[ 0 ] * 0.886227;","\t// band 1","\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;","\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;","\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;","\t// band 2","\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;","\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;","\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );","\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;","\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );","\treturn result;","}","uniform vec3 sh[ 9 ]; // sh coefficients","uniform float intensity; // light probe intensity","varying vec3 vNormal;","void main() {","\tvec3 normal = normalize( vNormal );","\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );","\tvec3 irradiance = shGetIrradianceAt( worldNormal, sh );","\tvec3 outgoingLight = RECIPROCAL_PI * irradiance * intensity;","\toutgoingLight = linearToOutput( outgoingLight );","\tgl_FragColor = vec4( outgoingLight, 1.0 );","}"].join("\n")}),r=new wd(1,32,16);Ma.call(this,r,i),this.onBeforeRender()}function yv(e,t,n,i){e=e||10,t=t||10,n=new Sr(void 0!==n?n:4473924),i=new Sr(void 0!==i?i:8947848);for(var r=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===r?n:i;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 wa;f.addAttribute("position",new Vr(s,3)),f.addAttribute("color",new Vr(l,3));var p=new lc({vertexColors:I});hc.call(this,f,p)}function _v(e,t,n,i,r,a){e=e||10,t=t||16,n=n||8,i=i||64,r=new Sr(void 0!==r?r:4473924),a=new Sr(void 0!==a?a:8947848);var o,s,l,u,h,c,d,f=[],p=[];for(u=0;u<=t;u++)l=u/t*(2*Math.PI),o=Math.sin(l)*e,s=Math.cos(l)*e,f.push(0,0,0),f.push(o,0,s),d=1&u?r:a,p.push(d.r,d.g,d.b),p.push(d.r,d.g,d.b);for(u=0;u<=n;u++)for(d=1&u?r:a,c=e-e/n*u,h=0;h<i;h++)l=h/i*(2*Math.PI),o=Math.sin(l)*c,s=Math.cos(l)*c,f.push(o,0,s),p.push(d.r,d.g,d.b),l=(h+1)/i*(2*Math.PI),o=Math.sin(l)*c,s=Math.cos(l)*c,f.push(o,0,s),p.push(d.r,d.g,d.b);var m=new wa;m.addAttribute("position",new Vr(f,3)),m.addAttribute("color",new Vr(p,3));var v=new lc({vertexColors:I});hc.call(this,m,v)}function xv(e,t,n,i){this.audio=e,this.range=t||1,this.divisionsInnerAngle=n||16,this.divisionsOuterAngle=i||2;var r=new wa,a=this.divisionsInnerAngle+2*this.divisionsOuterAngle,o=new Float32Array(3*(3*a+3));r.addAttribute("position",new Cr(o,3));var s=new lc({color:65280}),l=new lc({color:16776960});uc.call(this,r,[l,s]),this.update()}function bv(e,t,n,i){this.object=e,this.size=void 0!==t?t:1;var r=void 0!==n?n:16776960,a=void 0!==i?i:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var l=new wa,u=new Vr(2*o*3,3);l.addAttribute("position",u),hc.call(this,l,new lc({color:r,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function wv(e,t,n){pr.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===t&&(t=1);var i=new wa;i.addAttribute("position",new Vr([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var r=new lc({fog:!1});this.lightPlane=new uc(i,r),this.add(this.lightPlane),i=new wa,i.addAttribute("position",new Vr([0,0,0,0,0,1],3)),this.targetLine=new uc(i,r),this.add(this.targetLine),this.update()}function Mv(e){var t=new wa,n=new lc({color:16777215,vertexColors:L}),i=[],r=[],a={},o=new Sr(16755200),s=new Sr(16711680),l=new Sr(43775),u=new Sr(16777215),h=new Sr(3355443);function c(e,t,n){d(e,n),d(t,n)}function d(e,t){i.push(0,0,0),r.push(t.r,t.g,t.b),void 0===a[e]&&(a[e]=[]),a[e].push(i.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.addAttribute("position",new Vr(i,3)),t.addAttribute("color",new Vr(r,3)),hc.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 Tv(e,t,n,i){Um.set(t,n,i).unproject(Vm);var r=zm[e];if(void 0!==r)for(var a=Gm.getAttribute("position"),o=0,s=r.length;o<s;o++)a.setXYZ(r[o],Um.x,Um.y,Um.z)}function Ev(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]),i=new Float32Array(24),r=new wa;r.setIndex(new Cr(n,1)),r.addAttribute("position",new Cr(i,3)),hc.call(this,r,new lc({color:t})),this.matrixAutoUpdate=!1,this.update()}function Sv(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]),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],r=new wa;r.setIndex(new Cr(n,1)),r.addAttribute("position",new Vr(i,3)),hc.call(this,r,new lc({color:t})),this.geometry.computeBoundingSphere()}function Av(e,t,n){this.type="PlaneHelper",this.plane=e,this.size=void 0===t?1:t;var i=void 0!==n?n:16776960,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,0,0,1,0,0,0],a=new wa;a.addAttribute("position",new Vr(r,3)),a.computeBoundingSphere(),uc.call(this,a,new lc({color:i}));var o=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],s=new wa;s.addAttribute("position",new Vr(o,3)),s.computeBoundingSphere(),this.add(new Ma(s,new Pr({color:i,opacity:.2,transparent:!0,depthWrite:!1})))}function Lv(e,t,n,i,r,a){pr.call(this),void 0===e&&(e=new Pn(0,0,1)),void 0===t&&(t=new Pn(0,0,0)),void 0===n&&(n=1),void 0===i&&(i=16776960),void 0===r&&(r=.2*n),void 0===a&&(a=.2*r),void 0===jm&&(jm=new wa,jm.addAttribute("position",new Vr([0,0,0,0,1,0],3)),Wm=new Nd(0,.5,1,5,1),Wm.translate(0,-.5,0)),this.position.copy(t),this.line=new uc(jm,new lc({color:i})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Ma(Wm,new Pr({color:i})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,r,a)}function Iv(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],i=new wa;i.addAttribute("position",new Vr(t,3)),i.addAttribute("color",new Vr(n,3));var r=new lc({vertexColors:I});hc.call(this,i,r)}function kv(e,t,n,i,r,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new kr(e,t,n,r,a,o)}(0,p.default)(Zm.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),(0,p.default)(Jm,{Composite:Zm,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new Jm.Composite(e,t,n):new Jm(e,t,n)},sanitizeNodeName:(ym=new RegExp("["+Xm+"]","g"),function(e){return e.replace(/\s/g,"_").replace(ym,"")}),parseTrackName:(hm="[^"+Xm+"]",cm="[^"+Xm.replace("\\.","")+"]",dm=/((?:WC+[\/:])*)/.source.replace("WC",hm),fm=/(WCOD+)?/.source.replace("WCOD",cm),pm=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",hm),mm=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",hm),vm=new RegExp("^"+dm+fm+pm+mm+"$"),gm=["material","materials","bones"],function(e){var t=vm.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){var r=n.nodeName.substring(i+1);-1!==gm.indexOf(r)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=r)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}),findNode:function(e,a){if(!a||""===a||"root"===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 i=t[n];if(i.name===a||i.uuid===a)return i;var r=e(i.children);if(r)return r}return null},i=n(e.children);if(i)return i}return null}}),(0,p.default)(Jm.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,i=0,r=n.length;i!==r;++i)e[t++]=n[i]},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,i=0,r=n.length;i!==r;++i)n[i]=e[t++]},function(e,t){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=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){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,i=t.propertyName,r=t.propertyIndex;if(e||(e=Jm.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[i];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!==r){if("morphTargetInfluences"===i){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===r){r=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===r){r=o;break}}}u=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(u=this.BindingType.HasFromToArray,this.resolvedProperty=s):(0,Ge.default)(s)?(u=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=i;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+"."+i+" 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,p.default)(Jm.prototype,{_getValue_unbound:Jm.prototype.getValue,_setValue_unbound:Jm.prototype.setValue}),(0,p.default)(Km.prototype,{isAnimationObjectGroup:!0,add:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=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=i[d];if(void 0===f){f=t++,i[d]=f,e.push(c);for(var p=0,m=s;p!==m;++p)o[p].push(new Jm(c,r[p],a[p]))}else if(f<n){l=e[f];var v=--n,g=e[v];for(i[g.uuid]=f,e[f]=g,i[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 Jm(c,r[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,i=this._bindings,r=i.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=r;d!==f;++d){var p=i[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_,i=this._indicesByUUID,r=this._bindings,a=r.length,o=0,s=arguments.length;o!==s;++o){var l=arguments[o],u=l.uuid,h=i[u];if(void 0!==h)if(delete i[u],h<n){var c=--n,d=e[c],f=--t,p=e[f];i[d.uuid]=h,e[h]=d,i[p.uuid]=c,e[c]=p,e.pop();for(var m=0,v=a;m!==v;++m){var g=r[m],y=g[c],_=g[f];g[h]=y,g[c]=_,g.pop()}}else for(f=--t,p=e[f],i[p.uuid]=h,e[h]=p,e.pop(),m=0,v=a;m!==v;++m)g=r[m],g[h]=g[f],g.pop()}this.nCachedObjects_=n},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,i=n[e],r=this._bindings;if(void 0!==i)return r[i];var a=this._paths,o=this._parsedPaths,s=this._objects,l=s.length,u=this.nCachedObjects_,h=new Array(l);i=r.length,n[e]=i,a.push(e),o.push(t),r.push(h);for(var c=u,d=s.length;c!==d;++c){var f=s[c];h[c]=new Jm(f,e,t)}return h},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){var i=this._paths,r=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o],l=e[o];t[l]=n,a[n]=s,a.pop(),r[n]=r[o],r.pop(),i[n]=i[o],i.pop()}}}),(0,p.default)(Qm.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){if(e.fadeOut(t),this.fadeIn(t),n){var i=this._clip.duration,r=e._clip.duration,a=r/i,o=i/r;e.warp(1,a,t),this.warp(o,1,t)}return 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 i=this._mixer,r=i.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,l=a.sampleValues;return s[0]=r,s[1]=r+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,i){if(this.enabled){var r=this._startTime;if(null!==r){var a=(e-r)*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(i,s)}else this._updateWeight(e)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n){var i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e,n=this._clip.duration,i=this.loop,r=this._loopCount,a=i===Gt;if(0===e)return-1!==r&&a&&1==(1&r)?n-t:t;if(i===Ft){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n<=t)t=n;else{if(!(t<0)){this.time=t;break e}t=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===r&&(0<=e?(r=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),n<=t||t<0){var o=Math.floor(t/n);t-=n*o,r+=Math.abs(o);var s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=0<e?n:0,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<e?1:-1});else{if(1===s){var l=e<0;this._setEndings(l,!l,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this.time=t,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=t;if(a&&1==(1&r))return n-t}return t},_setEndings:function(e,t,n){var i=this._interpolantSettings;n?(i.endingStart=jt,i.endingEnd=jt):(i.endingStart=e?this.zeroSlopeAtStart?jt:Ht:Wt,i.endingEnd=t?this.zeroSlopeAtEnd?jt:Ht:Wt)},_scheduleFading:function(e,t,n){var i=this._mixer,r=i.time,a=this._weightInterpolant;null===a&&(a=i._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=r,s[0]=t,o[1]=r+e,s[1]=n,this}}),$m.prototype=(0,p.default)((0,l.default)(h.prototype),{constructor:$m,_bindAction:function(e,t){var n=e._localRoot||this._root,i=e._clip.tracks,r=i.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!==r;++h){var c=i[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 um(Jm.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)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,i=this._actionsByClip[n];this._bindAction(e,i&&i.knownActions[0]),this._addInactiveAction(e,n,t)}for(var r=e._propertyBindings,a=0,o=r.length;a!==o;++a){var s=r[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,i=t.length;n!==i;++n){var r=t[n];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}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 i=this._actions,r=this._actionsByClip,a=r[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,r[t]=a;else{var o=a.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=i.length,i.push(e),a.actionByRoot[n]=e},_removeInactiveAction:function(e){var t=this._actions,n=t[t.length-1],i=e._cacheIndex;n._cacheIndex=i,t[i]=n,t.pop(),e._cacheIndex=null;var r=e._clip.uuid,a=this._actionsByClip,o=a[r],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[r],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,n=0,i=t.length;n!==i;++n){var r=t[n];0==--r.referenceCount&&this._removeInactiveBinding(r)}},_lendAction:function(e){var t=this._actions,n=e._cacheIndex,i=this._nActiveActions++,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_takeBackAction:function(e){var t=this._actions,n=e._cacheIndex,i=--this._nActiveActions,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_addInactiveBinding:function(e,t,n){var i=this._bindingsByRootAndName,r=i[t],a=this._bindings;void 0===r&&(r={},i[t]=r),r[n]=e,e._cacheIndex=a.length,a.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,n=e.binding,i=n.rootNode.uuid,r=n.path,a=this._bindingsByRootAndName,o=a[i],s=t[t.length-1],l=e._cacheIndex;s._cacheIndex=l,t[l]=s,t.pop(),delete o[r],0===(0,m.default)(o).length&&delete a[i]},_lendBinding:function(e){var t=this._bindings,n=e._cacheIndex,i=this._nActiveBindings++,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_takeBackBinding:function(e){var t=this._bindings,n=e._cacheIndex,i=--this._nActiveBindings,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return void 0===n&&(n=new Qd(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,i=--this._nActiveControlInterpolants,r=t[i];e.__cacheIndex=i,t[i]=e,r.__cacheIndex=n,t[n]=r},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t){var n=t||this._root,i=n.uuid,r="string"==typeof e?uf.findByName(n,e):e,a=null!==r?r.uuid:e,o=this._actionsByClip[a],s=null;if(void 0!==o){var l=o.actionByRoot[i];if(void 0!==l)return l;s=o.knownActions[0],null===r&&(r=s._clip)}if(null===r)return null;var u=new Qm(this,r,t);return this._bindAction(u,s),this._addInactiveAction(u,a,i),u},existingAction:function(e,t){var n=t||this._root,i=n.uuid,r="string"==typeof e?uf.findByName(n,e):e,a=r?r.uuid:e,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[i]||null},stopAllAction:function(){var e=this._actions,t=this._nActiveActions,n=this._bindings,i=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var r=0;r!==t;++r)e[r].reset();for(r=0;r!==i;++r)n[r].useCount=0;return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,i=this.time+=e,r=Math.sign(e),a=this._accuIndex^=1,o=0;o!==n;++o){var s=t[o];s._update(i,e,r,a)}var l=this._bindings,u=this._nActiveBindings;for(o=0;o!==u;++o)l[o].apply(a);return this},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,n=e.uuid,i=this._actionsByClip,r=i[n];if(void 0!==r){for(var a=r.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 i[n]}},uncacheRoot:function(e){var t=e.uuid,n=this._actionsByClip;for(var i in n){var r=n[i].actionByRoot,a=r[t];void 0!==a&&(this._deactivateAction(a),this._removeInactiveAction(a))}var o=this._bindingsByRootAndName,s=o[t];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))}}),ev.prototype.clone=function(){return new ev(void 0===this.value.clone?this.value:this.value.clone())},tv.prototype=(0,p.default)((0,l.default)($h.prototype),{constructor:tv,isInstancedInterleavedBuffer:!0,copy:function(e){return $h.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),(0,p.default)(nv.prototype,{linePrecision:1,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 i=n||[];return rv(e,this,i,t),i.sort(iv),i},intersectObjects:function(e,t,n){var i=n||[];if(!1===(0,Ge.default)(e))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var r=0,a=e.length;r<a;r++)rv(e[r],this,i,t);return i.sort(iv),i}}),(0,p.default)(av.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(kn.clamp(t/this.radius,-1,1))),this}}),(0,p.default)(ov.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}}),(0,p.default)(sv.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:(xm=new Rn,function(e,t){var n=xm.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=1/0,this.max.x=this.max.y=-1/0,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 Rn),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 Rn),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 Rn),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 Rn),t.copy(e).clamp(this.min,this.max)},distanceToPoint:(_m=new Rn,function(e){var t=_m.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)}}),(0,p.default)(lv.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 Pn),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 Pn),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 Pn),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(e,t){void 0===bm&&(bm=new Pn,wm=new Pn),bm.subVectors(e,this.start),wm.subVectors(this.end,this.start);var n=wm.dot(wm),i=wm.dot(bm),r=i/n;return t&&(r=kn.clamp(r,0,1)),r},closestPointToPoint:function(e,t,n){var i=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Pn),this.delta(n).multiplyScalar(i).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)}}),uv.prototype=(0,l.default)(pr.prototype),uv.prototype.constructor=uv,uv.prototype.isImmediateRenderObject=!0,hv.prototype=(0,l.default)(hc.prototype),hv.prototype.constructor=hv,hv.prototype.update=(Mm=new Pn,Tm=new Pn,Em=new Cn,function(){var e=["a","b","c"];this.object.updateMatrixWorld(!0),Em.getNormalMatrix(this.object.matrixWorld);var t=this.object.matrixWorld,n=this.geometry.attributes.position,i=this.object.geometry;if(i&&i.isGeometry)for(var r=i.vertices,a=i.faces,o=0,s=0,l=a.length;s<l;s++)for(var u=a[s],h=0,c=u.vertexNormals.length;h<c;h++){var d=r[u[e[h]]],f=u.vertexNormals[h];Mm.copy(d).applyMatrix4(t),Tm.copy(f).applyMatrix3(Em).normalize().multiplyScalar(this.size).add(Mm),n.setXYZ(o,Mm.x,Mm.y,Mm.z),o+=1,n.setXYZ(o,Tm.x,Tm.y,Tm.z),o+=1}else if(i&&i.isBufferGeometry){var p=i.attributes.position,m=i.attributes.normal;for(o=0,h=0,c=p.count;h<c;h++)Mm.set(p.getX(h),p.getY(h),p.getZ(h)).applyMatrix4(t),Tm.set(m.getX(h),m.getY(h),m.getZ(h)),Tm.applyMatrix3(Em).normalize().multiplyScalar(this.size).add(Mm),n.setXYZ(o,Mm.x,Mm.y,Mm.z),o+=1,n.setXYZ(o,Tm.x,Tm.y,Tm.z),o+=1}n.needsUpdate=!0}),cv.prototype=(0,l.default)(pr.prototype),cv.prototype.constructor=cv,cv.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},cv.prototype.update=(Sm=new Pn,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),Sm.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Sm),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}),fv.prototype=(0,l.default)(hc.prototype),fv.prototype.constructor=fv,fv.prototype.updateMatrixWorld=(Am=new Pn,Lm=new Qn,Im=new Qn,function(e){var t=this.bones,n=this.geometry,i=n.getAttribute("position");Im.getInverse(this.root.matrixWorld);for(var r=0,a=0;r<t.length;r++){var o=t[r];o.parent&&o.parent.isBone&&(Lm.multiplyMatrices(Im,o.matrixWorld),Am.setFromMatrixPosition(Lm),i.setXYZ(a,Am.x,Am.y,Am.z),Lm.multiplyMatrices(Im,o.parent.matrixWorld),Am.setFromMatrixPosition(Lm),i.setXYZ(a+1,Am.x,Am.y,Am.z),a+=2)}n.getAttribute("position").needsUpdate=!0,pr.prototype.updateMatrixWorld.call(this,e)}),pv.prototype=(0,l.default)(Ma.prototype),pv.prototype.constructor=pv,pv.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},pv.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},mv.prototype=(0,l.default)(uc.prototype),mv.prototype.constructor=mv,mv.prototype.update=function(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),void 0!==this.color)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);var e=this.material.color,t=Math.max(e.r,e.g,e.b);1<t&&e.multiplyScalar(1/t),this.children[0].material.color.copy(this.material.color)}},mv.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()},vv.prototype=(0,l.default)(pr.prototype),vv.prototype.constructor=vv,vv.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},vv.prototype.update=(km=new Pn,Rm=new Sr,Nm=new Sr,function(){var e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var t=e.geometry.getAttribute("color");Rm.copy(this.light.color),Nm.copy(this.light.groundColor);for(var n=0,i=t.count;n<i;n++){var r=n<i/2?Rm:Nm;t.setXYZ(n,r.r,r.g,r.b)}t.needsUpdate=!0}e.lookAt(km.setFromMatrixPosition(this.light.matrixWorld).negate())}),gv.prototype=(0,l.default)(Ma.prototype),gv.prototype.constructor=gv,gv.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},gv.prototype.onBeforeRender=function(){this.position.copy(this.lightProbe.position),this.scale.set(1,1,1).multiplyScalar(this.size),this.material.uniforms.intensity.value=this.lightProbe.intensity},yv.prototype=(0,p.default)((0,l.default)(hc.prototype),{constructor:yv,copy:function(e){return hc.prototype.copy.call(this,e),this.geometry.copy(e.geometry),this.material.copy(e.material),this},clone:function(){return(new this.constructor).copy(this)}}),_v.prototype=(0,l.default)(hc.prototype),_v.prototype.constructor=_v,xv.prototype=(0,l.default)(uc.prototype),xv.prototype.constructor=xv,xv.prototype.update=function(){var a,o,e=this.audio,s=this.range,t=this.divisionsInnerAngle,n=this.divisionsOuterAngle,i=kn.degToRad(e.panner.coneInnerAngle),r=kn.degToRad(e.panner.coneOuterAngle),l=i/2,u=r/2,h=0,c=0,d=this.geometry,f=d.attributes.position;function p(e,t,n,i){var r=(t-e)/n;for(f.setXYZ(h,0,0,0),c++,a=e;a<t;a+=r)o=h+c,f.setXYZ(o,Math.sin(a)*s,0,Math.cos(a)*s),f.setXYZ(o+1,Math.sin(Math.min(a+r,t))*s,0,Math.cos(Math.min(a+r,t))*s),f.setXYZ(o+2,0,0,0),c+=3;d.addGroup(h,c,i),h+=c,c=0}d.clearGroups(),p(-u,-l,n,0),p(-l,l,t,1),p(l,u,n,0),f.needsUpdate=!0,i===r&&(this.material[0].visible=!1)},xv.prototype.dispose=function(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()},bv.prototype=(0,l.default)(hc.prototype),bv.prototype.constructor=bv,bv.prototype.update=(Pm=new Pn,Cm=new Pn,Dm=new Cn,function(){this.object.updateMatrixWorld(!0),Dm.getNormalMatrix(this.object.matrixWorld);for(var e=this.object.matrixWorld,t=this.geometry.attributes.position,n=this.object.geometry,i=n.vertices,r=n.faces,a=0,o=0,s=r.length;o<s;o++){var l=r[o],u=l.normal;Pm.copy(i[l.a]).add(i[l.b]).add(i[l.c]).divideScalar(3).applyMatrix4(e),Cm.copy(u).applyMatrix3(Dm).normalize().multiplyScalar(this.size).add(Pm),t.setXYZ(a,Pm.x,Pm.y,Pm.z),a+=1,t.setXYZ(a,Cm.x,Cm.y,Cm.z),a+=1}t.needsUpdate=!0}),wv.prototype=(0,l.default)(pr.prototype),wv.prototype.constructor=wv,wv.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},wv.prototype.update=(Om=new Pn,Fm=new Pn,Bm=new Pn,function(){Om.setFromMatrixPosition(this.light.matrixWorld),Fm.setFromMatrixPosition(this.light.target.matrixWorld),Bm.subVectors(Fm,Om),this.lightPlane.lookAt(Fm),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(Fm),this.targetLine.scale.z=Bm.length()}),Mv.prototype=(0,l.default)(hc.prototype),Mv.prototype.constructor=Mv,Mv.prototype.update=(Um=new Pn,Vm=new Ha,function(){Gm=this.geometry,zm=this.pointMap;var e=1,t=1;Vm.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Tv("c",0,0,-1),Tv("t",0,0,1),Tv("n1",-e,-t,-1),Tv("n2",e,-t,-1),Tv("n3",-e,t,-1),Tv("n4",e,t,-1),Tv("f1",-e,-t,1),Tv("f2",e,-t,1),Tv("f3",-e,t,1),Tv("f4",e,t,1),Tv("u1",.7*e,1.1*t,-1),Tv("u2",.7*-e,1.1*t,-1),Tv("u3",0,2*t,-1),Tv("cf1",-e,0,1),Tv("cf2",e,0,1),Tv("cf3",0,-t,1),Tv("cf4",0,t,1),Tv("cn1",-e,0,-1),Tv("cn2",e,0,-1),Tv("cn3",0,-t,-1),Tv("cn4",0,t,-1),Gm.getAttribute("position").needsUpdate=!0}),Ev.prototype=(0,l.default)(hc.prototype),Ev.prototype.constructor=Ev,Ev.prototype.update=(Hm=new vr,function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Hm.setFromObject(this.object),!Hm.isEmpty()){var t=Hm.min,n=Hm.max,i=this.geometry.attributes.position,r=i.array;r[0]=n.x,r[1]=n.y,r[2]=n.z,r[3]=t.x,r[4]=n.y,r[5]=n.z,r[6]=t.x,r[7]=t.y,r[8]=n.z,r[9]=n.x,r[10]=t.y,r[11]=n.z,r[12]=n.x,r[13]=n.y,r[14]=t.z,r[15]=t.x,r[16]=n.y,r[17]=t.z,r[18]=t.x,r[19]=t.y,r[20]=t.z,r[21]=n.x,r[22]=t.y,r[23]=t.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}}),Ev.prototype.setFromObject=function(e){return this.object=e,this.update(),this},Ev.prototype.copy=function(e){return hc.prototype.copy.call(this,e),this.object=e.object,this},Ev.prototype.clone=function(){return(new this.constructor).copy(this)},Sv.prototype=(0,l.default)(hc.prototype),Sv.prototype.constructor=Sv,Sv.prototype.updateMatrixWorld=function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),pr.prototype.updateMatrixWorld.call(this,e))},Av.prototype=(0,l.default)(uc.prototype),Av.prototype.constructor=Av,Av.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?ze:B,this.lookAt(this.plane.normal),pr.prototype.updateMatrixWorld.call(this,e)},Lv.prototype=(0,l.default)(pr.prototype),Lv.prototype.constructor=Lv,Lv.prototype.setDirection=(qm=new Pn,function(e){.99999<e.y?this.quaternion.set(0,0,0,1):e.y<-.99999?this.quaternion.set(1,0,0,0):(qm.set(e.z,0,-e.x).normalize(),Ym=Math.acos(e.y),this.quaternion.setFromAxisAngle(qm,Ym))}),Lv.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(0,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},Lv.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},Lv.prototype.copy=function(e){return pr.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},Lv.prototype.clone=function(){return(new this.constructor).copy(this)},Iv.prototype=(0,l.default)(hc.prototype),Iv.prototype.constructor=Iv;var Rv=0;t.LineStrip=Rv;var Nv,Pv=1;function Cv(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e}function Dv(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 e.slice()},e}function Ov(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new fc(e,t)}function Fv(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new nc(e)}function Bv(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new fc(e,t)}function Gv(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new dc(e)}function zv(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new dc(e)}function Uv(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new dc(e)}function Vv(e,t,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new Pn(e,t,n)}function Hv(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new Cr(e,t).setDynamic(!0)}function jv(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new Dr(e,t)}function Wv(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new Or(e,t)}function Yv(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new Fr(e,t)}function qv(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new Br(e,t)}function Xv(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Gr(e,t)}function Zv(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new zr(e,t)}function Jv(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Ur(e,t)}function Kv(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Vr(e,t)}function Qv(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Hr(e,t)}function $v(e){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Rf.call(this,e),this.type="catmullrom",this.closed=!0}function eg(e){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Rf.call(this,e),this.type="catmullrom"}function tg(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Rf.call(this,e),this.type="catmullrom"}function ng(e){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Iv(e)}function ig(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Ev(e,t)}function rg(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new hc(new kd(e.geometry),new lc({color:void 0!==t?t:16777215}))}function ag(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new hc(new yc(e.geometry),new lc({color:void 0!==t?t:16777215}))}function og(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new vf(e)}function sg(e){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new _f(e)}t.LinePieces=Pv,Mf.create=function(e,t){return e.prototype=(0,l.default)(Mf.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},(0,p.default)(Jf.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 Ca,n=0,i=e.length;n<i;n++){var r=e[n];t.vertices.push(new Pn(r.x,r.y,r.z||0))}return t}}),(0,p.default)(Kf.prototype,{fromPoints:function(e){console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),$v.prototype=(0,l.default)(Rf.prototype),eg.prototype=(0,l.default)(Rf.prototype),tg.prototype=(0,l.default)(Rf.prototype),(0,p.default)(tg.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.")}}),yv.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},fv.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},(0,p.default)(Rp.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),cp.extractUrlBase(e)}}),(0,p.default)(vp.prototype,{setTexturePath:function(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}),(0,p.default)(sv.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,p.default)(vr.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)}}),lv.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},(0,p.default)(kn,{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()."),kn.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),kn.ceilPowerOfTwo(e)}}),(0,p.default)(Cn.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.")},applyToBuffer:function(e){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(e)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),(0,p.default)(Qn.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 void 0===Nv&&(Nv=new Pn),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),Nv.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.")},applyToBuffer:function(e){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(e)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,i,r,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,i,n,r,a)}}),ro.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},Nn.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},(0,p.default)(xr.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,p.default)(br.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,p.default)(br,{barycoordFromPoint:function(e,t,n,i,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),br.getBarycoord(e,t,n,i,r)},normal:function(e,t,n,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),br.getNormal(e,t,n,i)}}),(0,p.default)(Qf.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 md(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Ad(this,e)}}),(0,p.default)(Rn.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,p.default)(Pn.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,p.default)(Zn.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,p.default)(Ca.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.")}}),(0,p.default)(pr.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.")}}),(0,u.default)(pr.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,u.default)(rc.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),(0,g.default)(oc.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),ac.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},(0,g.default)(Mf.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}}),ja.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,u.default)($f.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,u.default)(Cr.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")}}),(0,p.default)(wa.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},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.")}}),(0,u.default)(wa.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,p.default)(vd.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,u.default)(ev.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,u.default)(Nr.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 Sr}},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===E}}}),(0,u.default)(Vd.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,u.default)(Va.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,p.default)(Jh.prototype,{clearTarget:function(e,t,n,i){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,i)},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,u.default)(Jh.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()}}}),(0,u.default)(ch.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,u.default)(no.prototype,{activeCubeFace:{set:function(){console.warn("THREE.WebGLRenderTargetCube: .activeCubeFace has been removed. It is now the second parameter of WebGLRenderer.setRenderTarget().")}},activeMipMapLevel:{set:function(){console.warn("THREE.WebGLRenderTargetCube: .activeMipMapLevel has been removed. It is now the third parameter of WebGLRenderer.setRenderTarget().")}}}),(0,u.default)(Jn.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."),this.texture.repeat},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,u.default)(Xh.prototype,{standing:{set:function(){console.warn("THREE.WebVRManager: .standing has been removed.")}},userHeight:{set:function(){console.warn("THREE.WebVRManager: .userHeight has been removed.")}}}),om.prototype.load=function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this,n=new Qp;return n.load(e,function(e){t.setBuffer(e)}),this},lm.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},to.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)};var lg={merge:function(e,t,n){var i;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),t.isMesh&&(t.matrixAutoUpdate&&t.updateMatrix(),i=t.matrix,t=t.geometry),e.merge(t,i,n)},center:function(e){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),e.center()}};function ug(){console.error("THREE.CanvasRenderer has been removed")}function hg(){console.error("THREE.JSONLoader has been removed.")}t.GeometryUtils=lg,Dn.crossOrigin=void 0,Dn.loadTexture=function(e,t,n,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var r=new wf;r.setCrossOrigin(this.crossOrigin);var a=r.load(e,n,void 0,i);return t&&(a.mapping=t),a},Dn.loadTextureCube=function(e,t,n,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var r=new bf;r.setCrossOrigin(this.crossOrigin);var a=r.load(e,n,void 0,i);return t&&(a.mapping=t),a},Dn.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Dn.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var cg={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")}};function dg(){console.error("THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js")}t.SceneUtils=cg},function(e,t,n){var i=n(33),a=n(183),r=n(42).f,o=n(104).f,s=n(137),l=n(108),u=i.RegExp,h=u,c=u.prototype,d=/a/g,f=/a/g,p=new u(d)!==d;if(n(31)&&(!p||n(25)(function(){return f[n(21)("match")]=!1,u(d)!=d||u(f)==f||"/a/i"!=u(d,"i")}))){u=function(e,t){var n=this instanceof u,i=s(e),r=void 0===t;return!n&&i&&e.constructor===u&&r?e:a(p?new h(i&&!r?e.source:e,t):h((i=e instanceof u)?e.source:e,i&&r?l.call(e):t),n?this:c,u)};for(var m=function(t){t in u||r(u,t,{configurable:!0,get:function(){return h[t]},set:function(e){h[t]=e}})},v=o(h),g=0;v.length>g;)m(v[g++]);c.constructor=u,u.prototype=c,n(49)(i,"RegExp",u)}n(189)("RegExp")},function(e,t,r){var n=r(48),i=r(40),a=function(e,t){if(i(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,n,i){try{i=r(101)(Function.call,r(132).f(Object.prototype,"__proto__").set,2),i(e,[]),n=!(e instanceof Array)}catch(e){n=!0}return function(e,t){return a(e,t),n?e.__proto__=t:i(e,t),e}}({},!1):void 0),check:a}},function(e,t,n){e.exports=n(135)("native-function-to-string",Function.toString)},function(e,t,n){n(69),n(296),e.exports=n(11).Array.from},function(e,t,n){var l=n(138),u=n(109);e.exports=function(s){return function(e,t){var n,i,r=String(u(e)),a=l(t),o=r.length;return a<0||o<=a?s?"":void 0:(n=r.charCodeAt(a),n<55296||56319<n||a+1===o||(i=r.charCodeAt(a+1))<56320||57343<i?s?r.charAt(a):n:s?r.slice(a,a+2):i-56320+(n-55296<<10)+65536)}}},function(e,t,n){"use strict";var i=n(90),r=n(85),a=n(93),o={};n(54)(o,n(26)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=i(o,{next:r(1,n)}),a(e,t+" Iterator")}},function(e,t,n){var l=n(71),u=n(110),h=n(295);e.exports=function(s){return function(e,t,n){var i,r=l(e),a=u(r.length),o=h(n,a);if(s&&t!=t){for(;o<a;)if(i=r[o++],i!=i)return!0}else for(;o<a;o++)if((s||o in r)&&r[o]===t)return s||o||0;return!s&&-1}}},function(e,t,n){var i=n(138),r=Math.max,a=Math.min;e.exports=function(e,t){return e=i(e),e<0?r(e+t,0):a(e,t)}},function(e,t,n){"use strict";var p=n(46),i=n(14),m=n(62),v=n(194),g=n(195),y=n(110),_=n(297),x=n(145);i(i.S+i.F*!n(196)(function(e){Array.from(e)}),"Array",{from:function(e,t,n){var i,r,a,o,s=m(e),l="function"==typeof this?this:Array,u=arguments.length,h=1<u?t:void 0,c=void 0!==h,d=0,f=x(s);if(c&&(h=p(h,2<u?n:void 0,2)),null==f||l==Array&&g(f))for(i=y(s.length),r=new l(i);d<i;d++)_(r,d,c?h(s[d],d):s[d]);else for(o=f.call(s),r=new l;!(a=o.next()).done;d++)_(r,d,c?v(o,h,[a.value,d],!0):a.value);return r.length=d,r}})},function(e,t,n){"use strict";var i=n(39),r=n(85);e.exports=function(e,t,n){t in e?i.f(e,t,r(0,n)):e[t]=n}},function(e){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},function(e,t,n){"use strict";var i=n(146);n(27)({target:"RegExp",proto:!0,forced:i!==/./.exec},{exec:i})},function(e){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){"use strict";var i=n(148),r=n(102),a=n(150),o={};n(43)(o,n(21)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=i(o,{next:r(1,n)}),a(e,t+" Iterator")}},function(e,t,n){var o=n(42),s=n(40),l=n(149);e.exports=n(31)?Object.defineProperties:function(e,t){s(e);for(var n,i=l(t),r=i.length,a=0;a<r;)o.f(e,n=i[a++],t[n]);return e}},function(e,t,n){var i=n(33).document;e.exports=i&&i.documentElement},function(e,t,n){e.exports=n(305)},function(e,t,n){n(306),e.exports=n(11).Object.freeze},function(e,t,n){var i=n(23),r=n(73).onFreeze;n(151)("freeze",function(t){return function(e){return t&&i(e)?t(r(e)):e}})},function(e,t,n){n(69),n(74),e.exports=n(152).f("iterator")},function(e,t,n){"use strict";var i=n(309),r=n(200),a=n(70),o=n(71);e.exports=n(139)(Array,"Array",function(e,t){this._t=o(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,r(1)):r(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),a.Arguments=a.Array,i("keys"),i("values"),i("entries")},function(e){e.exports=function(){}},function(e,t,n){n(311),n(117),n(314),n(315),e.exports=n(11).Symbol},function(e,t,n){"use strict";var i=n(20),o=n(55),r=n(36),a=n(14),s=n(140),l=n(73).KEY,u=n(47),h=n(143),c=n(93),d=n(111),f=n(26),p=n(152),m=n(153),v=n(312),g=n(155),y=n(35),_=n(23),x=n(62),b=n(71),w=n(130),M=n(85),T=n(90),E=n(313),S=n(202),A=n(154),L=n(39),I=n(91),k=S.f,R=L.f,N=E.f,P=i.Symbol,C=i.JSON,D=C&&C.stringify,O="prototype",F=f("_hidden"),B=f("toPrimitive"),G={}.propertyIsEnumerable,z=h("symbol-registry"),U=h("symbols"),V=h("op-symbols"),H=Object[O],j="function"==typeof P&&!!A.f,W=i.QObject,Y=!W||!W[O]||!W[O].findChild,q=r&&u(function(){return 7!=T(R({},"a",{get:function(){return R(this,"a",{value:7}).a}})).a})?function(e,t,n){var i=k(H,t);i&&delete H[t],R(e,t,n),i&&e!==H&&R(H,t,i)}:R,X=function(e){var t=U[e]=T(P[O]);return t._k=e,t},Z=j&&"symbol"==typeof P.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof P},J=function(e,t,n){return e===H&&J(V,t,n),y(e),t=w(t,!0),y(n),o(U,t)?(n.enumerable?(o(e,F)&&e[F][t]&&(e[F][t]=!1),n=T(n,{enumerable:M(0,!1)})):(o(e,F)||R(e,F,M(1,{})),e[F][t]=!0),q(e,t,n)):R(e,t,n)},K=function(e,t){y(e);for(var n,i=v(t=b(t)),r=0,a=i.length;r<a;)J(e,n=i[r++],t[n]);return e},Q=function(e,t){return void 0===t?T(e):K(T(e),t)},$=function(e){var t=G.call(this,e=w(e,!0));return!(this===H&&o(U,e)&&!o(V,e))&&(!(t||!o(this,e)||!o(U,e)||o(this,F)&&this[F][e])||t)},ee=function(e,t){if(e=b(e),t=w(t,!0),e!==H||!o(U,t)||o(V,t)){var n=k(e,t);return!n||!o(U,t)||o(e,F)&&e[F][t]||(n.enumerable=!0),n}},te=function(e){for(var t,n=N(b(e)),i=[],r=0;n.length>r;)o(U,t=n[r++])||t==F||t==l||i.push(t);return i},ne=function(e){for(var t,n=e===H,i=N(n?V:b(e)),r=[],a=0;i.length>a;)!o(U,t=i[a++])||n&&!o(H,t)||r.push(U[t]);return r};j||(P=function(e){if(this instanceof P)throw TypeError("Symbol is not a constructor!");var t=d(0<arguments.length?e:void 0),n=function(e){this===H&&n.call(V,e),o(this,F)&&o(this[F],t)&&(this[F][t]=!1),q(this,t,M(1,e))};return r&&Y&&q(H,t,{configurable:!0,set:n}),X(t)},s(P[O],"toString",function(){return this._k}),S.f=ee,L.f=J,n(201).f=E.f=te,n(116).f=$,A.f=ne,r&&!n(89)&&s(H,"propertyIsEnumerable",$,!0),p.f=function(e){return X(f(e))}),a(a.G+a.W+a.F*!j,{Symbol:P});for(var ie="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),re=0;ie.length>re;)f(ie[re++]);for(var ae=I(f.store),oe=0;ae.length>oe;)m(ae[oe++]);a(a.S+a.F*!j,"Symbol",{for:function(e){return o(z,e+="")?z[e]:z[e]=P(e)},keyFor:function(e){if(!Z(e))throw TypeError(e+" is not a symbol!");for(var t in z)if(z[t]===e)return t},useSetter:function(){Y=!0},useSimple:function(){Y=!1}}),a(a.S+a.F*!j,"Object",{create:Q,defineProperty:J,defineProperties:K,getOwnPropertyDescriptor:ee,getOwnPropertyNames:te,getOwnPropertySymbols:ne});var se=u(function(){A.f(1)});a(a.S+a.F*se,"Object",{getOwnPropertySymbols:function(e){return A.f(x(e))}}),C&&a(a.S+a.F*(!j||u(function(){var e=P();return"[null]"!=D([e])||"{}"!=D({a:e})||"{}"!=D(Object(e))})),"JSON",{stringify:function(e){for(var t,n,i=[e],r=1;r<arguments.length;)i.push(arguments[r++]);if(n=t=i[1],(_(t)||void 0!==e)&&!Z(e))return g(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!Z(t))return t}),i[1]=t,D.apply(C,i)}}),P[O][B]||n(54)(P[O],B,P[O].valueOf),c(P,"Symbol"),c(Math,"Math",!0),c(i.JSON,"JSON",!0)},function(e,t,n){var s=n(91),l=n(154),u=n(116);e.exports=function(e){var t=s(e),n=l.f;if(n)for(var i,r=n(e),a=u.f,o=0;r.length>o;)a.call(e,i=r[o++])&&t.push(i);return t}},function(e,t,n){var i=n(71),r=n(201).f,a={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return r(e)}catch(e){return o.slice()}};e.exports.f=function(e){return o&&"[object Window]"==a.call(e)?s(e):r(i(e))}},function(e,t,n){n(153)("asyncIterator")},function(e,t,n){n(153)("observable")},function(e,t,n){"use strict";var i=n(27),a=n(41),o=n(317),s="startsWith",l=""[s];i(i.P+i.F*n(318)(s),"String",{startsWith:function(e,t){var n=o(this,e,s),i=a(Math.min(1<arguments.length?t:void 0,n.length)),r=String(e);return l?l.call(n,r,i):n.slice(i,i+r.length)===r}})},function(e,t,n){var i=n(137),r=n(57);e.exports=function(e,t,n){if(i(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(r(e))}},function(e,t,n){var i=n(21)("match");e.exports=function(t){var n=/./;try{"/./"[t](n)}catch(e){try{return n[i]=!1,!"/./"[t](n)}catch(e){}}return!0}},function(e,t,n){e.exports=n(320)},function(e,t,n){n(117),n(74),n(321),n(325),n(326),e.exports=n(11).WeakMap},function(e,t,n){"use strict";var a,i=n(20),r=n(157)(0),o=n(140),s=n(73),l=n(205),u=n(324),h=n(23),c=n(94),d=n(94),f=!i.ActiveXObject&&"ActiveXObject"in i,p="WeakMap",m=s.getWeak,v=Object.isExtensible,g=u.ufstore,y=function(t){return function(e){return t(this,0<arguments.length?e:void 0)}},_={get:function(e){if(h(e)){var t=m(e);return!0===t?g(c(this,p)).get(e):t?t[this._i]:void 0}},set:function(e,t){return u.def(c(this,p),e,t)}},x=e.exports=n(206)(p,y,_,u,!0,!0);d&&f&&(a=u.getConstructor(y,p),l(a.prototype,_),s.NEED=!0,r(["delete","has","get","set"],function(i){var e=x.prototype,r=e[i];o(e,i,function(e,t){if(!h(e)||v(e))return r.call(this,e,t);this._f||(this._f=new a);var n=this._f[i](e,t);return"set"==i?this:n})}))},function(e,t,n){var i=n(323);e.exports=function(e,t){return new(i(e))(t)}},function(e,t,n){var i=n(23),r=n(155),a=n(26)("species");e.exports=function(e){var t;return r(e)&&(t=e.constructor,"function"!=typeof t||t!==Array&&!r(t.prototype)||(t=void 0),i(t)&&(t=t[a],null===t&&(t=void 0))),void 0===t?Array:t}},function(e,t,n){"use strict";var o=n(118),s=n(73).getWeak,r=n(35),l=n(23),u=n(119),h=n(76),i=n(157),c=n(55),d=n(94),a=i(5),f=i(6),p=0,m=function(e){return e._l||(e._l=new v)},v=function(){this.a=[]},g=function(e,t){return a(e.a,function(e){return e[0]===t})};v.prototype={get:function(e){var t=g(this,e);if(t)return t[1]},has:function(e){return!!g(this,e)},set:function(e,t){var n=g(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(t){var e=f(this.a,function(e){return e[0]===t});return~e&&this.a.splice(e,1),!!~e}},e.exports={getConstructor:function(e,n,i,r){var a=e(function(e,t){u(e,a,n,"_i"),e._t=n,e._i=p++,e._l=void 0,null!=t&&h(t,i,e[r],e)});return o(a.prototype,{delete:function(e){if(!l(e))return!1;var t=s(e);return!0===t?m(d(this,n)).delete(e):t&&c(t,this._i)&&delete t[this._i]},has:function(e){if(!l(e))return!1;var t=s(e);return!0===t?m(d(this,n)).has(e):t&&c(t,this._i)}}),a},def:function(e,t,n){var i=s(r(t),!0);return!0===i?m(e).set(t,n):i[e._i]=n,e},ufstore:m}},function(e,t,n){n(207)("WeakMap")},function(e,t,n){n(208)("WeakMap")},function(e,t,n){"use strict";var i=n(25);e.exports=function(e,t){return!!e&&i(function(){t?e.call(null,function(){},1):e.call(null)})}},function(e,t,n){n(329),e.exports=n(11).Object.keys},function(e,t,n){var i=n(62),r=n(91);n(151)("keys",function(){return function(e){return r(i(e))}})},function(e,t,n){n(52)("Float64",8,function(i){return function(e,t,n){return i(this,e,t,n)}})},function(e,t,n){"use strict";var i=n(33),r=n(31),a=n(107),o=n(209),s=n(43),l=n(210),u=n(25),h=n(211),c=n(58),d=n(41),f=n(212),p=n(104).f,m=n(42).f,v=n(158),g=n(150),y="ArrayBuffer",_="DataView",x="prototype",b="Wrong length!",w="Wrong index!",M=i[y],T=i[_],E=i.Math,S=i.RangeError,A=i.Infinity,L=M,I=E.abs,k=E.pow,R=E.floor,N=E.log,P=E.LN2,C="buffer",D="byteLength",O="byteOffset",F=r?"_b":C,B=r?"_l":D,G=r?"_o":O;function z(e,t,n){var i,r,a,o=new Array(n),s=8*n-t-1,l=(1<<s)-1,u=l>>1,h=23===t?k(2,-24)-k(2,-77):0,c=0,d=e<0||0===e&&1/e<0?1:0;for(e=I(e),e!=e||e===A?(r=e!=e?1:0,i=l):(i=R(N(e)/P),e*(a=k(2,-i))<1&&(i--,a*=2),e+=1<=i+u?h/a:h*k(2,1-u),2<=e*a&&(i++,a/=2),l<=i+u?(r=0,i=l):1<=i+u?(r=(e*a-1)*k(2,t),i+=u):(r=e*k(2,u-1)*k(2,t),i=0));8<=t;o[c++]=255&r,r/=256,t-=8);for(i=i<<t|r,s+=t;0<s;o[c++]=255&i,i/=256,s-=8);return o[--c]|=128*d,o}function U(e,t,n){var i,r=8*n-t-1,a=(1<<r)-1,o=a>>1,s=r-7,l=n-1,u=e[l--],h=127&u;for(u>>=7;0<s;h=256*h+e[l],l--,s-=8);for(i=h&(1<<-s)-1,h>>=-s,s+=t;0<s;i=256*i+e[l],l--,s-=8);if(0===h)h=1-o;else{if(h===a)return i?NaN:u?-A:A;i+=k(2,t),h-=o}return(u?-1:1)*i*k(2,h-t)}function V(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function H(e){return[255&e]}function j(e){return[255&e,e>>8&255]}function W(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function Y(e){return z(e,52,8)}function q(e){return z(e,23,4)}function X(e,t,n){m(e[x],t,{get:function(){return this[n]}})}function Z(e,t,n,i){var r=+n,a=f(r);if(a+t>e[B])throw S(w);var o=e[F]._b,s=a+e[G],l=o.slice(s,s+t);return i?l:l.reverse()}function J(e,t,n,i,r,a){var o=+n,s=f(o);if(s+t>e[B])throw S(w);for(var l=e[F]._b,u=s+e[G],h=i(+r),c=0;c<t;c++)l[u+c]=h[a?c:t-c-1]}if(o.ABV){if(!u(function(){M(1)})||!u(function(){new M(-1)})||u(function(){return new M,new M(1.5),new M(NaN),M.name!=y})){M=function(e){return h(this,M),new L(f(e))};for(var K,Q=M[x]=L[x],$=p(L),ee=0;$.length>ee;)(K=$[ee++])in M||s(M,K,L[K]);a||(Q.constructor=M)}var te=new T(new M(2)),ne=T[x].setInt8;te.setInt8(0,2147483648),te.setInt8(1,2147483649),!te.getInt8(0)&&te.getInt8(1)||l(T[x],{setInt8:function(e,t){ne.call(this,e,t<<24>>24)},setUint8:function(e,t){ne.call(this,e,t<<24>>24)}},!0)}else M=function(e){h(this,M,y);var t=f(e);this._b=v.call(new Array(t),0),this[B]=t},T=function(e,t,n){h(this,T,_),h(e,M,_);var i=e[B],r=c(t);if(r<0||i<r)throw S("Wrong offset!");if(n=void 0===n?i-r:d(n),i<r+n)throw S(b);this[F]=e,this[G]=r,this[B]=n},r&&(X(M,D,"_l"),X(T,C,"_b"),X(T,D,"_l"),X(T,O,"_o")),l(T[x],{getInt8:function(e){return Z(this,1,e)[0]<<24>>24},getUint8:function(e){return Z(this,1,e)[0]},getInt16:function(e,t){var n=Z(this,2,e,t);return(n[1]<<8|n[0])<<16>>16},getUint16:function(e,t){var n=Z(this,2,e,t);return n[1]<<8|n[0]},getInt32:function(e,t){return V(Z(this,4,e,t))},getUint32:function(e,t){return V(Z(this,4,e,t))>>>0},getFloat32:function(e,t){return U(Z(this,4,e,t),23,4)},getFloat64:function(e,t){return U(Z(this,8,e,t),52,8)},setInt8:function(e,t){J(this,1,e,H,t)},setUint8:function(e,t){J(this,1,e,H,t)},setInt16:function(e,t,n){J(this,2,e,j,t,n)},setUint16:function(e,t,n){J(this,2,e,j,t,n)},setInt32:function(e,t,n){J(this,4,e,W,t,n)},setUint32:function(e,t,n){J(this,4,e,W,t,n)},setFloat32:function(e,t,n){J(this,4,e,q,t,n)},setFloat64:function(e,t,n){J(this,8,e,Y,t,n)}});g(M,y),g(T,_),s(T[x],o.VIEW,!0),t[y]=M,t[_]=T},function(e,t,n){var i=n(72),r=n(21)("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||a[r]===e)}},function(e,t,n){var i=n(114),r=n(21)("iterator"),a=n(72);e.exports=n(106).getIteratorMethod=function(e){if(null!=e)return e[r]||e["@@iterator"]||a[i(e)]}},function(e,t,n){var i=n(335);e.exports=function(e,t){return new(i(e))(t)}},function(e,t,n){var i=n(48),r=n(336),a=n(21)("species");e.exports=function(e){var t;return r(e)&&(t=e.constructor,"function"!=typeof t||t!==Array&&!r(t.prototype)||(t=void 0),i(t)&&(t=t[a],null===t&&(t=void 0))),void 0===t?Array:t}},function(e,t,n){var i=n(86);e.exports=Array.isArray||function(e){return"Array"==i(e)}},function(e,t,n){var a=n(21)("iterator"),o=!1;try{var i=[7][a]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i=[7],r=i[a]();r.next=function(){return{done:n=!0}},i[a]=function(){return r},e(i)}catch(e){}return n}},function(e,t,n){"use strict";var h=n(51),c=n(105),d=n(41);e.exports=[].copyWithin||function(e,t,n){var i=h(this),r=d(i.length),a=c(e,r),o=c(t,r),s=2<arguments.length?n:void 0,l=Math.min((void 0===s?r:c(s,r))-o,r-a),u=1;for(o<a&&a<o+l&&(u=-1,o+=l-1,a+=l-1);0<l--;)o in i?i[a]=i[o]:delete i[a],a+=u,o+=u;return i}},function(e,t,n){n(52)("Int32",4,function(i){return function(e,t,n){return i(this,e,t,n)}})},function(e,t,n){n(52)("Uint8",1,function(i){return function(e,t,n){return i(this,e,t,n)}},!0)},function(e,t,n){n(342),e.exports=n(11).parseInt},function(e,t,n){var i=n(14),r=n(343);i(i.G+i.F*(parseInt!=r),{parseInt:r})},function(e,t,n){var i=n(20).parseInt,r=n(216).trim,a=n(162),o=/^[-+]?0[xX]/;e.exports=8!==i(a+"08")||22!==i(a+"0x16")?function(e,t){var n=r(String(e),3);return i(n,t>>>0||(o.test(n)?16:10))}:i},function(e,t,n){n(345),e.exports=n(11).parseFloat},function(e,t,n){var i=n(14),r=n(346);i(i.G+i.F*(parseFloat!=r),{parseFloat:r})},function(e,t,n){var i=n(20).parseFloat,r=n(216).trim;e.exports=1/i(n(162)+"-0")!=-1/0?function(e){var t=r(String(e),3),n=i(t);return 0===n&&"-"==t.charAt(0)?-0:n}:i},function(e,t,n){"use strict";var i=n(27),r=n(51),a=n(87);i(i.P+i.F*n(25)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function(){var e=r(this),t=a(e);return"number"!=typeof t||isFinite(t)?e.toISOString():null}})},function(e,t,n){var i=n(11),r=i.JSON||(i.JSON={stringify:JSON.stringify});e.exports=function(e){return r.stringify.apply(r,arguments)}},function(e,t,n){n(350),e.exports=n(11).Array.isArray},function(e,t,n){var i=n(14);i(i.S,"Array",{isArray:n(155)})},function(e,t,n){n(352);var i=n(11).Object;e.exports=function(e,t){return i.create(e,t)}},function(e,t,n){var i=n(14);i(i.S,"Object",{create:n(90)})},function(e,t,n){"use strict";var r=n(58),a=n(57);e.exports=function(e){var t=String(a(this)),n="",i=r(e);if(i<0||i==1/0)throw RangeError("Count can't be negative");for(;0<i;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n}},function(e,t,n){n(355);var i=n(11).Object;e.exports=function(e,t){return i.defineProperties(e,t)}},function(e,t,n){var i=n(14);i(i.S+i.F*!n(36),"Object",{defineProperties:n(190)})},function(e,t,n){var i=n(27);i(i.S+i.F,"Object",{assign:n(357)})},function(e,t,n){"use strict";var c=n(31),d=n(149),f=n(358),p=n(184),m=n(51),v=n(133),r=Object.assign;e.exports=!r||n(25)(function(){var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach(function(e){t[e]=e}),7!=r({},e)[n]||Object.keys(r({},t)).join("")!=i})?function(e){for(var t=m(e),n=arguments.length,i=1,r=f.f,a=p.f;i<n;)for(var o,s=v(arguments[i++]),l=r?d(s).concat(r(s)):d(s),u=l.length,h=0;h<u;)o=l[h++],c&&!a.call(s,o)||(t[o]=s[o]);return t}:r},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){n(360),e.exports=n(11).Object.assign},function(e,t,n){var i=n(14);i(i.S+i.F,"Object",{assign:n(205)})},function(e,t,n){n(31)&&"g"!=/./g.flags&&n(42).f(RegExp.prototype,"flags",{configurable:!0,get:n(108)})},function(e,t,n){var i=n(27);i(i.S,"Math",{sign:n(363)})},function(e){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},function(e,t,n){var i=n(27);i(i.S,"Number",{isInteger:n(365)})},function(e,t,n){var i=n(48),r=Math.floor;e.exports=function(e){return!i(e)&&isFinite(e)&&r(e)===e}},function(e,t,n){e.exports=n(367)},function(e,t,n){n(368),e.exports=n(11).Number.isInteger},function(e,t,n){var i=n(14);i(i.S,"Number",{isInteger:n(369)})},function(e,t,n){var i=n(23),r=Math.floor;e.exports=function(e){return!i(e)&&isFinite(e)&&r(e)===e}},function(e,t,n){var o=n(27),i=n(57),s=n(25),l=n(371),r="["+l+"]",u="​…",a=RegExp("^"+r+r+"*"),h=RegExp(r+r+"*$"),c=function(e,t,n){var i={},r=s(function(){return!!l[e]()||u[e]()!=u}),a=i[e]=r?t(d):l[e];n&&(i[n]=a),o(o.P+o.F*r,"String",i)},d=c.trim=function(e,t){return e=String(i(e)),1&t&&(e=e.replace(a,"")),2&t&&(e=e.replace(h,"")),e};e.exports=c},function(e){e.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(e,t,n){var i=n(27);i(i.S,"Number",{EPSILON:Math.pow(2,-52)})},function(e,t,n){n(374),e.exports=Math.pow(2,-52)},function(e,t,n){var i=n(14);i(i.S,"Number",{EPSILON:Math.pow(2,-52)})},function(t,e,n){(function(e){t.exports=e.TWEEN=n(376)}).call(this,n(56))},function(a,o,e){(function(t){var e,n,i=function(){this._tweens={},this._tweensAddedDuringUpdate={}};i.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 i=0;i<n.length;i++){var r=this._tweens[n[i]];r&&!1===r.update(e)&&(r._isPlaying=!1,t||delete this._tweens[n[i]])}n=Object.keys(this._tweensAddedDuringUpdate)}return!0}};var r,s=new i;s.Group=i,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}: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(1/0),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,i;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,i=this._easingFunction(n),this._valuesEnd)if(void 0!==this._valuesStart[t]){var r=this._valuesStart[t]||0,a=this._valuesEnd[t];a instanceof Array?this._object[t]=this._interpolationFunction(a,i):("string"==typeof a&&(a="+"===a.charAt(0)||"-"===a.charAt(0)?r+parseFloat(a):parseFloat(a)),"number"==typeof a&&(this._object[t]=r+(a-r)*i))}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){if("string"==typeof this._valuesEnd[t]&&(this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(this._valuesEnd[t])),this._yoyo){var 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,i=n*t,r=Math.floor(i),a=s.Interpolation.Utils.Linear;return t<0?a(e[0],e[1],i):1<t?a(e[n],e[n-1],n-i):a(e[r],e[n<r+1?n:r+1],i-r)},Bezier:function(e,t){for(var n=0,i=e.length-1,r=Math.pow,a=s.Interpolation.Utils.Bernstein,o=0;o<=i;o++)n+=r(1-t,i-o)*r(t,o)*e[o]*a(i,o);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),a=s.Interpolation.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(r=Math.floor(i=n*(1+t))),a(e[(r-1+n)%n],e[r],e[(r+1)%n],e[(r+2)%n],i-r)):t<0?e[0]-(a(e[0],e[0],e[1],e[1],-i)-e[0]):1<t?e[n]-(a(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):a(e[r?r-1:0],e[r],e[n<r+1?n:r+1],e[n<r+2?n:r+2],i-r)},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:(r=[1],function(e){var t=1;if(r[e])return r[e];for(var n=e;1<n;n--)t*=n;return r[e]=t,t}),CatmullRom:function(e,t,n,i,r){var a=.5*(n-e),o=.5*(i-t),s=r*r,l=r*s;return(2*t-2*n+a+o)*l+(-3*t+3*n-2*a-o)*s+a*r+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 i=n(1),r=i(n(122)),a=i(n(78));n(44),n(63),n(50),n(4),i(n(2)),i(n(3)),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:document,this.enabled=!0,this.target=new fm.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,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=!0,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(b),x.update(),M=w.NONE},this.setUpdate=function(e,t,n,i,r){h=e,c=t,d=n,f=i,p=r},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=E.theta;if(E.setFromVector3(m),E.theta=t,x.autoRotate&&M===w.NONE&&V(U()),E.theta+=S.theta,E.phi+=S.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*=A,E.radius=Math.max(x.minDistance,Math.min(x.maxDistance,E.radius)),this.useRange){var n=(new fm.Vector3).setFromMatrixPosition(x.object.matrixWorld);n.add(L);var i=(new fm.Matrix4).copy(x.object.matrixWorld).setPosition(n),r=(new fm.Matrix4).getInverse(i),a=(new fm.Frustum).setFromMatrix((new fm.Matrix4).multiplyMatrices(x.object.projectionMatrix,r));a.intersectsBox(x.viewBox)&&x.target.add(L)}else x.target.add(L);if(m.setFromSpherical(E),m.applyQuaternion(g),d&&m.add(d),this.useRange){var o=(new fm.Vector3).setFromMatrixPosition(x.object.matrixWorld);o.add(m);var s=(new fm.Matrix4).copy(x.object.matrixWorld).setPosition(o),l=(new fm.Matrix4).getInverse(s),u=(new fm.Frustum).setFromMatrix((new fm.Matrix4).multiplyMatrices(x.object.projectionMatrix,l));u.intersectsBox(x.viewBox)&&e.copy(x.target).add(m)}else e.copy(x.target).add(m);return x.object.lookAt(x.target),!0===x.enableDamping?(S.theta*=1-x.dampingFactor,S.phi*=1-x.dampingFactor,L.multiplyScalar(1-x.dampingFactor)):(S.set(0,0,0),L.set(0,0,0)),h=void 0,c=void 0,d=void 0,f=void 0,p=void 0,A=1,!!(I||y.distanceToSquared(x.object.position)>T||8*(1-_.dot(x.object.quaternion))>T)&&(x.dispatchEvent(b),y.copy(x.object.position),_.copy(x.object.quaternion),I=!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),window.PointerEvent&&!window.TouchEvent&&(x.domElement.removeEventListener("pointerdown",ye,!1),x.domElement.removeEventListener("pointermove",_e,!1),x.domElement.removeEventListener("pointerup",xe,!1)),document.removeEventListener("mousemove",oe,!1),document.removeEventListener("mouseup",ue,!1),window.removeEventListener("keydown",ce,!1),this.enterCtrl=void 0,this.domElement=void 0,this.object=void 0};var x=this,b={type:"change"},l={type:"start"},i={type:"end"},w={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY_PAN:4,TOUCH_PAN:5,TOUCH_DOLLY_ROTATE:6},M=w.NONE,T=1e-6,E=new fm.Spherical,S=new fm.Spherical,A=1,L=new fm.Vector3,I=!1,k=new fm.Vector2,R=new fm.Vector2,N=new fm.Vector2,P=new fm.Vector2,C=new fm.Vector2,D=(new fm.Vector2,new fm.Vector2),O=new fm.Vector2,F=new fm.Vector2,B=new fm.Vector2,G=new fm.Vector2,z=new fm.Vector2,u=new fm.Vector2;function U(){return 2*Math.PI/60/60*x.autoRotateSpeed}function r(){return Math.pow(.95,x.zoomSpeed)}function V(e){x.enterCtrl&&!x.enterCtrl.enableMapRotate||(S.theta-=e)}function H(e){x.enterCtrl&&!x.enterCtrl.enableMapIncline||(S.phi-=e)}this.rotateLeft=function(e){V(e)};var a,o,s=(a=new fm.Vector3,function(e,t){a.setFromMatrixColumn(t,0),a.multiplyScalar(-e),L.add(a)}),j=(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 W,Y=(W=new fm.Vector3,function(e,t){if(!x.enterCtrl||x.enterCtrl.enableMapPan){var n=x.domElement===document?x.domElement.body:x.domElement;if(x.object.isPerspectiveCamera){var i=x.object.position;W.copy(i).sub(x.target);var r=W.length();r*=Math.tan(x.object.fov/2*Math.PI/180),s(2*e*r/n.clientHeight,x.object.matrix),j(2*t*r/n.clientHeight,x.object.matrix)}else x.object.isOrthographicCamera?(s(e*(x.object.right-x.object.left)/x.object.zoom/n.clientWidth,x.object.matrix),j(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?A/=e:x.object.isOrthographicCamera?(x.object.zoom=Math.max(x.minZoom,Math.min(x.maxZoom,x.object.zoom*e)),x.object.updateProjectionMatrix(),A/=e,I=!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?A*=e:x.object.isOrthographicCamera?(x.object.zoom=Math.max(x.minZoom,Math.min(x.maxZoom,x.object.zoom/e)),x.object.updateProjectionMatrix(),I=!0,A*=e):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),x.enableZoom=!1))}function Z(e){k.set(e.clientX,e.clientY)}function J(e){B.set(e.clientX,e.clientY)}function K(e){D.set(e.clientX,e.clientY)}function Q(e){R.set(e.clientX,e.clientY),N.subVectors(R,k).multiplyScalar(x.rotateSpeed);var t=x.domElement===document?x.domElement.body:x.domElement;V(2*Math.PI*N.x/t.clientHeight),H(2*Math.PI*N.y/t.clientHeight),k.copy(R)}function $(e){G.set(e.clientX,e.clientY),z.subVectors(G,B),0<z.y?q(r()):z.y<0&&X(r()),B.copy(G)}function ee(e){O.set(e.clientX,e.clientY),F.subVectors(O,D).multiplyScalar(x.panSpeed),Y(F.x,F.y),D.copy(O)}function te(){}function ne(e){e.deltaY<0?X(r()):0<e.deltaY&&q(r())}function ie(e){switch(e.keyCode){case x.keys.UP:Y(0,x.keyPanSpeed),x.update();break;case x.keys.BOTTOM:Y(0,-x.keyPanSpeed),x.update();break;case x.keys.LEFT:Y(x.keyPanSpeed,0),x.update();break;case x.keys.RIGHT:Y(-x.keyPanSpeed,0),x.update()}}function re(){}function ae(e){if(u.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),M=w.PAN;break;case x.mouseButtons.MIDDLE:if(!1===x.enableZoom)return;J(e),M=w.DOLLY;break;case x.mouseButtons.RIGHT:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===x.enablePan)return;K(e),M=w.PAN}else{if(!1===x.enableRotate)return;Z(e),M=w.ROTATE}}M!==w.NONE&&(document.addEventListener("mousemove",oe,!1),document.addEventListener("mouseup",ue,!1),x.dispatchEvent(l))}}function oe(e){if(!1!==x.enabled)switch(e.preventDefault(),M){case w.ROTATE:if(!1===x.enableRotate)return;Q(e);break;case w.DOLLY:if(!1===x.enableZoom)return;$(e);break;case w.PAN:if(!1===x.enablePan)return;ee(e)}}function se(e){var t=u.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),document.removeEventListener("mousemove",oe,!1),document.removeEventListener("mouseup",ue,!1),x.dispatchEvent(i),M=w.NONE)}function he(e){!1===x.enabled||!1===x.enableZoom||M!==w.NONE&&M!==w.ROTATE||(e.preventDefault(),e.stopPropagation(),x.dispatchEvent(l),ne(e),x.dispatchEvent(i))}function ce(e){!1!==x.enabled&&!1!==x.enableKeys&&!1!==x.enablePan&&ie(e)}function de(e){if(!1!==x.enabled){switch(e.preventDefault(),x.map&&x.map.eventTransform&&(e=x.map.eventTransform(e)),u.set(e.changedTouches[0].pageX,e.changedTouches[0].pageY),e.touches.length){case 1:if(x.enablePan){var t=e.touches[0].pageX,n=e.touches[0].pageY;D.set(t,n)}M=w.TOUCH_PAN;break;case 2:if(!1===x.enableZoom&&!1===x.enableRotate)return;if(M=w.TOUCH_DOLLY_ROTATE,x.enableZoom){var i=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(i*i+r*r);B.set(0,a)}if(x.enableRotate){t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY),k.set(t,n);var o=e.touches[0].pageX-e.touches[1].pageX,s=e.touches[0].pageY-e.touches[1].pageY;P.set(o,s)}break;default:M=w.NONE}M!==w.NONE&&x.dispatchEvent(l)}}function fe(e){if(!1!==x.enabled)switch(e.preventDefault(),e.stopPropagation(),x.map&&x.map.eventTransform&&(e=x.map.eventTransform(e)),e.touches.length){case 1:if(M!==w.TOUCH_PAN)return;if(x.enablePan){var t=e.touches[0].pageX,n=e.touches[0].pageY;O.set(t,n),F.subVectors(O,D).multiplyScalar(x.panSpeed),Y(F.x,F.y),D.copy(O)}break;case 2:if(!1===x.enableRotate&&!1===x.enableZoom)return;if(M!==w.TOUCH_DOLLY_ROTATE)return;if(x.enableZoom){var i=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(i*i+r*r);G.set(0,a),z.set(0,Math.pow(G.y/B.y,x.zoomSpeed)),q(z.y),B.copy(G)}if(x.enableRotate){var o=e.touches[0].pageX-e.touches[1].pageX,s=e.touches[0].pageY-e.touches[1].pageY;C.set(o,s);var l=P.angle(),u=C.angle();R.set(.5*(e.touches[0].pageX+e.touches[1].pageX),.5*(e.touches[0].pageY+e.touches[1].pageY)),N.subVectors(R,k).multiplyScalar(x.rotateSpeed);var h=x.domElement===document?x.domElement.body:x.domElement;V((-u+l)*x.rotateSpeed),H(2*Math.PI*N.y/h.clientHeight),k.copy(R),P.copy(C)}break;default:M=w.NONE}}function pe(e){if(!1!==x.enabled){x.map&&x.map.eventTransform&&(e=x.map.eventTransform(e));var t=u.distanceTo(new fm.Vector2(e.changedTouches[0].pageX,e.changedTouches[0].pageY)),n=x.domElement.getBoundingClientRect();t<5&&x.dispatchEvent({type:"mouseup",mousePoint:{x:e.changedTouches[0].pageX-n.left,y:e.changedTouches[0].pageY-n.top,w:x.domElement.clientWidth,h:x.domElement.clientHeight},event:e,mouseButton:fm.MOUSE.LEFT}),re(e),x.dispatchEvent(i),M=w.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)),M=w.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)),M=w.TOUCH_DOLLY_ROTATE;break;default:M=w.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=ve.touches.length-1;-1<t;t--)ve.touches[t].pointerId==e.pointerId&&(ve.touches.splice(t,1),ve.changedTouches.splice(t,1))}else ve={touches:[],changedTouches:[],preventDefault:function(){},stopPropagation:function(){}}}window.PointerEvent&&!window.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),window.addEventListener("keydown",ce,!1),this.update()},fm.OrbitControls.prototype=(0,a.default)(fm.EventDispatcher.prototype),fm.OrbitControls.prototype.constructor=fm.OrbitControls,(0,r.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(){"use strict";fm.Evento={convert:function(r,a){return a=a||{},r.on=function(e,t){return(a[e]=a[e]||[]).push(t),r},r.getHandlers=function(e){return a[e]},r.once=function(e,t){function n(){t.apply(r.off(e,n),arguments)}return n.h=t,r.on(e,n)},r.off=function(e,t){for(var n=a[e],i=0;t&&n&&n[i];i++)n[i]!=t&&n[i].h!=t||n.splice(i--,1);return t||delete a[e],r},r.emit=function(e){for(var t=a[e],n=0;t&&t[n];)t[n++].apply(r,t.slice.call(arguments,1));return r},r.offAll=function(){for(var e in a)a[e]=[],delete a[e];a=void 0},r}}},function(e,t,n){n(74),n(69),e.exports=n(380)},function(e,t,n){var i=n(35),r=n(145);e.exports=n(11).getIterator=function(e){var t=r(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return i(t.call(e))}},function(e,t,n){n(382),e.exports=n(11).Reflect.construct},function(e,t,n){var i=n(14),l=n(90),u=n(60),h=n(35),c=n(23),r=n(47),d=n(383),f=(n(20).Reflect||{}).construct,p=r(function(){function e(){}return!(f(function(){},[],e)instanceof e)}),m=!r(function(){f(function(){})});i(i.S+i.F*(p||m),"Reflect",{construct:function(e,t,n){u(e),h(t);var i=arguments.length<3?e:u(n);if(m&&!p)return f(e,t,i);if(e==i){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 r=[null];return r.push.apply(r,t),new(d.apply(e,r))}var a=i.prototype,o=l(c(a)?a:Object.prototype),s=Function.apply.call(e,o,t);return c(s)?s:o}})},function(e,t,n){"use strict";var a=n(60),o=n(23),s=n(219),l=[].slice,u={},h=function(e,t,n){if(!(t in u)){for(var i=[],r=0;r<t;r++)i[r]="a["+r+"]";u[t]=Function("F,a","return new F("+i.join(",")+")")}return u[t](e,n)};e.exports=Function.bind||function(t){var n=a(this),i=l.call(arguments,1),r=function(){var e=i.concat(l.call(arguments));return this instanceof r?h(n,e.length,e):s(n,e,t)};return o(n.prototype)&&(r.prototype=n.prototype),r}},function(e,t,n){var i=n(12),r=n(220);function a(e){if(i(e))return r(e)}e.exports=a},function(e,t,n){var i=n(15),r=n(386),a=n(17);function o(e){if(void 0!==a&&r(Object(e)))return i(e)}e.exports=o},function(e,t,n){e.exports=n(387)},function(e,t,n){n(74),n(69),e.exports=n(388)},function(e,t,n){var i=n(112),r=n(26)("iterator"),a=n(70);e.exports=n(11).isIterable=function(e){var t=Object(e);return void 0!==t[r]||"@@iterator"in t||a.hasOwnProperty(i(t))}},function(e,t,n){var i=n(15),r=n(220);function a(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?i(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}e.exports=a},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){e.exports=n(392)},function(e,t,n){n(393),e.exports=n(11).Object.getPrototypeOf},function(e,t,n){var i=n(62),r=n(193);n(151)("getPrototypeOf",function(){return function(e){return r(i(e))}})},function(e,t,n){n(395),e.exports=n(11).Object.setPrototypeOf},function(e,t,n){var i=n(14);i(i.S,"Object",{setPrototypeOf:n(396).set})},function(e,t,r){var n=r(23),i=r(35),a=function(e,t){if(i(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,n,i){try{i=r(46)(Function.call,r(202).f(Object.prototype,"__proto__").set,2),i(e,[]),n=!(e instanceof Array)}catch(e){n=!0}return function(e,t){return a(e,t),n?e.__proto__=t:i(e,t),e}}({},!1):void 0),check:a}},function(n,e,t){var i=t(221);function r(e,t){return n.exports=r=i||function(e,t){return e.__proto__=t,e},r(e,t)}n.exports=r},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(16)),o=i(n(2)),s=i(n(3)),l=i(n(66)),u=i(n(223)),h=function(){function i(e){(0,o.default)(this,i);var t="https:"===window.location.protocol?"https://":"http://",n=t+"source.fengmap.com/webtheme";this._key=null,this._appName=null,this._mapServerURL="fengmap",this._mapThemeURL=n,this._container=document.body,this._compassOffset=[28,20],this._compassSize=50,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=0,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=l.default.ZH,this.font={family:'"Microsoft Yahei","微软雅黑",Tahoma,Arial'},(0,a.default)(this,e)}return(0,s.default)(i,[{key:"computePoseToAngle",value:function(){if("number"==typeof this.defaultControlsPose)return this.defaultControlsPose;if(this.defaultControlsPose){var e=u.default[this.defaultControlsPose];return e||-15}}},{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}},{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}},{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}}]),i}(),c=h;t.default=c},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var s=i(n(19)),l=i(n(12)),u=i(n(18)),h=i(n(17)),a=i(n(15));n(10),n(5),n(4);var o=i(n(2)),c=i(n(3)),x=i(n(400)),b=i(n(402)),w=i(n(403)),M=i(n(225));function d(e){if(void 0===h.default||null==e[u.default]){if((0,l.default)(e)||(e=f(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}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 i,r,a=!0,o=!1;return{s:function(){i=(0,s.default)(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw r}}}}function f(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var m=function(){function e(){(0,o.default)(this,e)}return(0,c.default)(e,[{key:"mapDecode",value:function(e,t,n){var i=x.default.build("Map").decode(e),r="%E8%AF%B7%E8%BE%93%E5%85%A5%E6%AD%A3%E7%A1%AE%E7%9A%84license.";if(M.default.ls&&!M.default.checkLicense(i.key,t,n))return console.warn(decodeURIComponent(r)),null;for(var a={scene:null,floors:[]},o=0,s=i.buffers.length;o<s;o++){var l=i.buffers[o],u=l.len,h=l.data.offset,c=l.data.offset+u.low,d=l.data.buffer;if(1==l.btype){var f=w.default.build("Scene").decode(d.slice(h,c));a.scene=f}else{var p=l.gid,m=this.containsFloor(p,a.floors),v=m.floor;if(m.index<0&&(v.gid=p,v.biz=[],v.navi=[],v.geo=[]),2==l.btype){var g=b.default.build("FloorGeo").decode(d.slice(h,c));v.geo.push(g)}if(3==l.btype){var y=b.default.build("FloorBiz").decode(d.slice(h,c));v.biz.push(y)}if(4==l.btype){var _=b.default.build("FloorNavi").decode(d.slice(h,c));v.navi.push(_)}m.index<0?a.floors.push(v):a.floors[m.index]=v}}return a}},{key:"containsFloor",value:function(e,t){for(var n=0,i=t.length;n<i;n++)if(t[n].gid==e)return{index:n,floor:t[n]};return{index:-1,floor:{}}}},{key:"sceneDecode",value:function(e,t,n){var i=w.default.build("Scene").decode(e),r="%E8%AF%B7%E8%BE%93%E5%85%A5%E6%AD%A3%E7%A1%AE%E7%9A%84license.";return M.default.ls&&!M.default.checkLicense(i.key,t,n)?(console.warn(decodeURIComponent(r)),null):i}},{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,i=d(n.children);try{for(i.s();!(t=i.n()).done;){var r=t.value;r.builder=void 0,r.parent=void 0,r.children.length=0,r._fields.length=0,r._fieldsById=void 0,r._fieldsByName=void 0}}catch(e){i.e(e)}finally{i.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 i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var r=n(167),a=r.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(){},function(e,t,n){"use strict";var i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var r=n(167),a=r.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 i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var r=n(167),a=r.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 i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var r,a=(r=function(e){return T(e)},{encryption:function(e){return r(e)}});function c(e,t){var n=(65535&e)+(65535&t),i=(e>>16)+(t>>16)+(n>>16);return i<<16|65535&n}function o(e,t){return e<<t|e>>>32-t}function s(e,t,n,i,r,a){return c(o(c(c(t,e),c(i,a)),r),n)}function d(e,t,n,i,r,a,o){return s(t&n|~t&i,e,t,r,a,o)}function f(e,t,n,i,r,a,o){return s(t&i|n&~i,e,t,r,a,o)}function p(e,t,n,i,r,a,o){return s(t^n^i,e,t,r,a,o)}function m(e,t,n,i,r,a,o){return s(n^(t|~i),e,t,r,a,o)}function l(e,t){var n,i,r,a,o;e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;var s=1732584193,l=-271733879,u=-1732584194,h=271733878;for(n=0;n<e.length;n+=16)i=s,r=l,a=u,o=h,s=d(s,l,u,h,e[n],7,-680876936),h=d(h,s,l,u,e[n+1],12,-389564586),u=d(u,h,s,l,e[n+2],17,606105819),l=d(l,u,h,s,e[n+3],22,-1044525330),s=d(s,l,u,h,e[n+4],7,-176418897),h=d(h,s,l,u,e[n+5],12,1200080426),u=d(u,h,s,l,e[n+6],17,-1473231341),l=d(l,u,h,s,e[n+7],22,-45705983),s=d(s,l,u,h,e[n+8],7,1770035416),h=d(h,s,l,u,e[n+9],12,-1958414417),u=d(u,h,s,l,e[n+10],17,-42063),l=d(l,u,h,s,e[n+11],22,-1990404162),s=d(s,l,u,h,e[n+12],7,1804603682),h=d(h,s,l,u,e[n+13],12,-40341101),u=d(u,h,s,l,e[n+14],17,-1502002290),l=d(l,u,h,s,e[n+15],22,1236535329),s=f(s,l,u,h,e[n+1],5,-165796510),h=f(h,s,l,u,e[n+6],9,-1069501632),u=f(u,h,s,l,e[n+11],14,643717713),l=f(l,u,h,s,e[n],20,-373897302),s=f(s,l,u,h,e[n+5],5,-701558691),h=f(h,s,l,u,e[n+10],9,38016083),u=f(u,h,s,l,e[n+15],14,-660478335),l=f(l,u,h,s,e[n+4],20,-405537848),s=f(s,l,u,h,e[n+9],5,568446438),h=f(h,s,l,u,e[n+14],9,-1019803690),u=f(u,h,s,l,e[n+3],14,-187363961),l=f(l,u,h,s,e[n+8],20,1163531501),s=f(s,l,u,h,e[n+13],5,-1444681467),h=f(h,s,l,u,e[n+2],9,-51403784),u=f(u,h,s,l,e[n+7],14,1735328473),l=f(l,u,h,s,e[n+12],20,-1926607734),s=p(s,l,u,h,e[n+5],4,-378558),h=p(h,s,l,u,e[n+8],11,-2022574463),u=p(u,h,s,l,e[n+11],16,1839030562),l=p(l,u,h,s,e[n+14],23,-35309556),s=p(s,l,u,h,e[n+1],4,-1530992060),h=p(h,s,l,u,e[n+4],11,1272893353),u=p(u,h,s,l,e[n+7],16,-155497632),l=p(l,u,h,s,e[n+10],23,-1094730640),s=p(s,l,u,h,e[n+13],4,681279174),h=p(h,s,l,u,e[n],11,-358537222),u=p(u,h,s,l,e[n+3],16,-722521979),l=p(l,u,h,s,e[n+6],23,76029189),s=p(s,l,u,h,e[n+9],4,-640364487),h=p(h,s,l,u,e[n+12],11,-421815835),u=p(u,h,s,l,e[n+15],16,530742520),l=p(l,u,h,s,e[n+2],23,-995338651),s=m(s,l,u,h,e[n],6,-198630844),h=m(h,s,l,u,e[n+7],10,1126891415),u=m(u,h,s,l,e[n+14],15,-1416354905),l=m(l,u,h,s,e[n+5],21,-57434055),s=m(s,l,u,h,e[n+12],6,1700485571),h=m(h,s,l,u,e[n+3],10,-1894986606),u=m(u,h,s,l,e[n+10],15,-1051523),l=m(l,u,h,s,e[n+1],21,-2054922799),s=m(s,l,u,h,e[n+8],6,1873313359),h=m(h,s,l,u,e[n+15],10,-30611744),u=m(u,h,s,l,e[n+6],15,-1560198380),l=m(l,u,h,s,e[n+13],21,1309151649),s=m(s,l,u,h,e[n+4],6,-145523070),h=m(h,s,l,u,e[n+11],10,-1120210379),u=m(u,h,s,l,e[n+2],15,718787259),l=m(l,u,h,s,e[n+9],21,-343485551),s=c(s,i),l=c(l,r),u=c(u,a),h=c(h,o);return[s,l,u,h]}function u(e){var t,n="",i=32*e.length;for(t=0;t<i;t+=8)n+=String.fromCharCode(e[t>>5]>>>t%32&255);return n}function h(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t<n.length;t+=1)n[t]=0;var i=8*e.length;for(t=0;t<i;t+=8)n[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return n}function v(e){return u(l(h(e),8*e.length))}function g(e,t){var n,i,r=h(e),a=[],o=[];for(a[15]=o[15]=void 0,16<r.length&&(r=l(r,8*e.length)),n=0;n<16;n+=1)a[n]=909522486^r[n],o[n]=1549556828^r[n];return i=l(a.concat(h(t)),512+8*t.length),u(l(o.concat(i),640))}function y(e){var t,n,i="0123456789abcdef",r="";for(n=0;n<e.length;n+=1)t=e.charCodeAt(n),r+=i.charAt(t>>>4&15)+i.charAt(15&t);return r}function _(e){return unescape(encodeURIComponent(e))}function x(e){return v(_(e))}function b(e){return y(x(e))}function w(e,t){return g(_(e),_(t))}function M(e,t){return y(w(e,t))}function T(e,t,n){return t?(n?w:M)(t,e):(n?x:b)(e)}var E=a;t.default=E},function(e,t,n){e.exports=n(406)},function(e,t,n){n(117),n(69),n(74),n(407),n(409),n(412),n(413),e.exports=n(11).Map},function(e,t,n){"use strict";var i=n(408),r=n(94),a="Map";e.exports=n(206)(a,function(t){return function(e){return t(this,0<arguments.length?e:void 0)}},{get:function(e){var t=i.getEntry(r(this,a),e);return t&&t.v},set:function(e,t){return i.def(r(this,a),0===e?0:e,t)}},i,!0)},function(e,t,n){"use strict";var o=n(39).f,s=n(90),l=n(118),u=n(46),h=n(119),c=n(76),i=n(139),r=n(200),a=n(231),d=n(36),f=n(73).fastKey,p=n(94),m=d?"_s":"size",v=function(e,t){var n,i=f(t);if("F"!==i)return e._i[i];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,a,n,i){var r=e(function(e,t){h(e,r,a,"_i"),e._t=a,e._i=s(null),e._f=void 0,e._l=void 0,e[m]=0,null!=t&&c(t,n,e[i],e)});return l(r.prototype,{clear:function(){for(var e=p(this,a),t=e._i,n=e._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete t[n.i];e._f=e._l=void 0,e[m]=0},delete:function(e){var t=p(this,a),n=v(t,e);if(n){var i=n.n,r=n.p;delete t._i[n.i],n.r=!0,r&&(r.n=i),i&&(i.p=r),t._f==n&&(t._f=i),t._l==n&&(t._l=r),t[m]--}return!!n},forEach:function(e,t){p(this,a);for(var n,i=u(e,1<arguments.length?t:void 0,3);n=n?n.n:this._f;)for(i(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!v(p(this,a),e)}}),d&&o(r.prototype,"size",{get:function(){return p(this,a)[m]}}),r},def:function(e,t,n){var i,r,a=v(e,t);return a?a.v=n:(e._l=a={i:r=f(t,!0),k:t,v:n,p:i=e._l,n:void 0,r:!1},e._f||(e._f=a),i&&(i.n=a),e[m]++,"F"!==r&&(e._i[r]=a)),e},getEntry:v,setStrong:function(e,n,t){i(e,n,function(e,t){this._t=p(e,n),this._k=t,this._l=void 0},function(){for(var e=this,t=e._k,n=e._l;n&&n.r;)n=n.p;return e._t&&(e._l=n=n?n.n:e._t._f)?r(0,"keys"==t?n.k:"values"==t?n.v:[n.k,n.v]):(e._t=void 0,r(1))},t?"entries":"values",!t,!0),a(n)}}},function(e,t,n){var i=n(14);i(i.P+i.R,"Map",{toJSON:n(410)("Map")})},function(e,t,n){var i=n(112),r=n(411);e.exports=function(e){return function(){if(i(this)!=e)throw TypeError(e+"#toJSON isn't generic");return r(this)}}},function(e,t,n){var i=n(76);e.exports=function(e,t){var n=[];return i(e,!1,n.push,n,t),n}},function(e,t,n){n(207)("Map")},function(e,t,n){n(208)("Map")},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),o=i(n(24)),s=i(n(2)),l=i(n(3)),u=i(n(7)),h=i(n(8)),c=i(n(9)),d=i(n(13)),f=i(n(37));function p(i){return function(){var e,t=(0,h.default)(i);if(m()){var n=(0,h.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,u.default)(this,e)}}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,c.default)(r,e);var i=p(r);function r(e,t){var n;return(0,s.default)(this,r),n=i.call(this,t.eid,f.default.FLOOR),n._parseData=null,n._isInitMesh=!0,n._visible=!0,n._renderNode=null,n._geometry=void 0,n.bdata=t,n.gdata=e,n}return(0,l.default)(r,[{key:"initMesh",value:function(e,t,n,i){this._geometry&&(this._renderNode=new fm.Mesh(this._geometry.geometry,e),this._renderNode.mapNode=this,e.color=new fm.Color(n),i=(0,o.default)(i),e.opacity=i,e.userData.opacity=i,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){e?this.parent.scene.children.indexOf(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}}]),r}(d.default),g=v;t.default=g},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),o=i(n(2)),s=i(n(3)),l=i(n(7)),u=i(n(8)),h=i(n(9)),c=i(n(13)),d=i(n(233)),f=i(n(95));function p(i){return function(){var e,t=(0,u.default)(i);if(m()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}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}}i(n(38));var v=function(e){(0,h.default)(r,e);var i=p(r);function r(e,t){var n;return(0,o.default)(this,r),n=i.call(this,"externalModelLayer"),n._scene=new fm.Scene,n._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,s.default)(r,[{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 d.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(){f.default.light?this._ambientLight=new fm.AmbientLight(4210752):(this._ambientLight=new fm.AmbientLight(7631988),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&&this.parent.parent.parent.map.setRenderList()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}}]),r}(c.default),g=v;t.default=g},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(44);var h=i(n(64)),c=i(n(2)),o=i(n(3)),a=1e-5,y=0,_=1,x=2,b=3,s=function(){function u(e){(0,c.default)(this,u);var t,n,i,r,a,o,s,l=[];if(this.Polygon=d,this.Vertex=f,this.Node=p,e instanceof fm.Geometry)this.matrix=new fm.Matrix4;else{if(!(e instanceof fm.Mesh)){if(e instanceof p)return this.tree=e,this.matrix=new fm.Matrix4,this;throw"ThreeBSP: Given geometry is unsupported"}e.updateMatrix(),this.matrix=e.matrix.clone(),e=e.geometry}for(t=0,n=e.faces.length;t<n;t++){if(i=e.faces[t],a=e.faceVertexUvs[0][t],s=new d,i instanceof fm.Face3)r=e.vertices[i.a],o=a?new fm.Vector2(a[0].x,a[0].y):null,r=new f(r.x,r.y,r.z,i.vertexNormals[0],o),r.applyMatrix4(this.matrix),s.vertices.push(r),r=e.vertices[i.b],o=a?new fm.Vector2(a[1].x,a[1].y):null,r=new f(r.x,r.y,r.z,i.vertexNormals[1],o),r.applyMatrix4(this.matrix),s.vertices.push(r),r=e.vertices[i.c],o=a?new fm.Vector2(a[2].x,a[2].y):null,r=new f(r.x,r.y,r.z,i.vertexNormals[2],o),r.applyMatrix4(this.matrix),s.vertices.push(r);else{if(!(0,h.default)(fm.Face4))throw"Invalid face type at index "+t;r=e.vertices[i.a],o=a?new fm.Vector2(a[0].x,a[0].y):null,r=new f(r.x,r.y,r.z,i.vertexNormals[0],o),r.applyMatrix4(this.matrix),s.vertices.push(r),r=e.vertices[i.b],o=a?new fm.Vector2(a[1].x,a[1].y):null,r=new f(r.x,r.y,r.z,i.vertexNormals[1],o),r.applyMatrix4(this.matrix),s.vertices.push(r),r=e.vertices[i.c],o=a?new fm.Vector2(a[2].x,a[2].y):null,r=new f(r.x,r.y,r.z,i.vertexNormals[2],o),r.applyMatrix4(this.matrix),s.vertices.push(r),r=e.vertices[i.d],o=a?new fm.Vector2(a[3].x,a[3].y):null,r=new f(r.x,r.y,r.z,i.vertexNormals[3],o),r.applyMatrix4(this.matrix),s.vertices.push(r)}s.calculateProperties(),l.push(s)}this.tree=new p(l)}return(0,o.default)(u,[{key:"subtract",value:function(e){var t=this.tree.clone(),n=e.tree.clone();return t.invert(),t.clipTo(n),n.clipTo(t),n.invert(),n.clipTo(t),n.invert(),t.build(n.allPolygons()),t.invert(),t=new u(t),t.matrix=this.matrix,t}},{key:"union",value:function(e){var t=this.tree.clone(),n=e.tree.clone();return t.clipTo(n),n.clipTo(t),n.invert(),n.clipTo(t),n.invert(),t.build(n.allPolygons()),t=new u(t),t.matrix=this.matrix,t}},{key:"intersect",value:function(e){var t=this.tree.clone(),n=e.tree.clone();return t.invert(),n.clipTo(t),n.invert(),t.clipTo(n),n.clipTo(t),t.build(n.allPolygons()),t.invert(),t=new u(t),t.matrix=this.matrix,t}},{key:"toGeometry",value:function(){var e,t,n,i,r,a,o,s,l,u,h=(new fm.Matrix4).getInverse(this.matrix),c=new fm.Geometry,d=this.tree.allPolygons(),f=d.length,p={};for(e=0;e<f;e++)for(n=d[e],i=n.vertices.length,t=2;t<i;t++)u=[],s=n.vertices[0],u.push(new fm.Vector2(s.uv.x,s.uv.y)),s=new fm.Vector3(s.x,s.y,s.z),s.applyMatrix4(h),r=void 0!==p[s.x+","+s.y+","+s.z]?p[s.x+","+s.y+","+s.z]:(c.vertices.push(s),p[s.x+","+s.y+","+s.z]=c.vertices.length-1),s=n.vertices[t-1],u.push(new fm.Vector2(s.uv.x,s.uv.y)),s=new fm.Vector3(s.x,s.y,s.z),s.applyMatrix4(h),a=void 0!==p[s.x+","+s.y+","+s.z]?p[s.x+","+s.y+","+s.z]:(c.vertices.push(s),p[s.x+","+s.y+","+s.z]=c.vertices.length-1),s=n.vertices[t],u.push(new fm.Vector2(s.uv.x,s.uv.y)),s=new fm.Vector3(s.x,s.y,s.z),s.applyMatrix4(h),o=void 0!==p[s.x+","+s.y+","+s.z]?p[s.x+","+s.y+","+s.z]:(c.vertices.push(s),p[s.x+","+s.y+","+s.z]=c.vertices.length-1),l=new fm.Face3(r,a,o,new fm.Vector3(n.normal.x,n.normal.y,n.normal.z)),c.faces.push(l),c.faceVertexUvs[0].push(u);return c}},{key:"toMesh",value:function(e){var t=this.toGeometry(),n=new fm.Mesh(t,e);return n.position.setFromMatrixPosition(this.matrix),n.rotation.setFromRotationMatrix(this.matrix),n}}]),u}();t.default=s;var d=function(){function g(e){(0,c.default)(this,g),e instanceof Array||(e=[]),this.vertices=e,0<e.length?this.calculateProperties():this.normal=this.w=void 0}return(0,o.default)(g,[{key:"calculateProperties",value:function(){var e=this.vertices[0],t=this.vertices[1],n=this.vertices[2];return this.normal=t.clone().subtract(e).cross(n.clone().subtract(e)).normalize(),this.w=this.normal.clone().dot(e),this}},{key:"clone",value:function(){var e,t,n=new g;for(e=0,t=this.vertices.length;e<t;e++)n.vertices.push(this.vertices[e].clone());return n.calculateProperties(),n}},{key:"flip",value:function(){var e,t=[];for(this.normal.multiplyScalar(-1),this.w*=-1,e=this.vertices.length-1;0<=e;e--)t.push(this.vertices[e]);return this.vertices=t,this}},{key:"classifyVertex",value:function(e){var t=this.normal.dot(e)-this.w;return t<-a?x:a<t?_:y}},{key:"classifySide",value:function(e){var t,n,i,r=0,a=0,o=e.vertices.length;for(t=0;t<o;t++)n=e.vertices[t],i=this.classifyVertex(n),i===_?r++:i===x&&a++;return r===o&&0===a?_:0===r&&a===o?x:0<r&&0<a?b:y}},{key:"splitPolygon",value:function(e,t,n,i,r){var a=this.classifySide(e);if(a===y)(0<this.normal.dot(e.normal)?t:n).push(e);else if(a===_)i.push(e);else if(a===x)r.push(e);else{var o,s,l,u,h,c,d,f,p,m=[],v=[];for(s=0,o=e.vertices.length;s<o;s++)l=(s+1)%o,c=e.vertices[s],d=e.vertices[l],u=this.classifyVertex(c),h=this.classifyVertex(d),u!=x&&m.push(c),u!=_&&v.push(c),(u|h)===b&&(f=(this.w-this.normal.dot(c))/this.normal.dot(d.clone().subtract(c)),p=c.interpolate(d,f),m.push(p),v.push(p));3<=m.length&&i.push(new g(m).calculateProperties()),3<=v.length&&r.push(new g(v).calculateProperties())}}}]),g}(),f=function(){function a(e,t,n,i,r){(0,c.default)(this,a),this.x=e,this.y=t,this.z=n,this.normal=i||new fm.Vector3,this.uv=r||new fm.Vector2}return(0,o.default)(a,[{key:"clone",value:function(){return new a(this.x,this.y,this.z,this.normal.clone(),this.uv.clone())}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}},{key:"subtract",value:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this}},{key:"cross",value:function(e){var t=this.x,n=this.y,i=this.z;return this.x=n*e.z-i*e.y,this.y=i*e.x-t*e.z,this.z=t*e.y-n*e.x,this}},{key:"normalize",value:function(){var e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);return this.x/=e,this.y/=e,this.z/=e,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z}},{key:"lerp",value:function(e,t){return this.add(e.clone().subtract(this).multiplyScalar(t)),this.normal.add(e.normal.clone().sub(this.normal).multiplyScalar(t)),this.uv.add(e.uv.clone().sub(this.uv).multiplyScalar(t)),this}},{key:"interpolate",value:function(e,t){return this.clone().lerp(e,t)}},{key:"applyMatrix4",value:function(e){var t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i+r[12],this.y=r[1]*t+r[5]*n+r[9]*i+r[13],this.z=r[2]*t+r[6]*n+r[10]*i+r[14],this}}]),a}(),p=function(){function a(e){(0,c.default)(this,a);var t,n,i=[],r=[];if(this.polygons=[],this.front=this.back=void 0,e instanceof Array&&0!==e.length){for(this.divider=e[0].clone(),t=0,n=e.length;t<n;t++)this.divider.splitPolygon(e[t],this.polygons,this.polygons,i,r);0<i.length&&(this.front=new a(i)),0<r.length&&(this.back=new a(r))}}return(0,o.default)(a,[{key:"isConvex",value:function(e){var t,n;for(t=0;t<e.length;t++)for(n=0;n<e.length;n++)if(t!==n&&e[t].classifySide(e[n])!==x)return!1;return!0}},{key:"build",value:function(e){var t,n,i=[],r=[];for(this.divider||(this.divider=e[0].clone()),t=0,n=e.length;t<n;t++)this.divider.splitPolygon(e[t],this.polygons,this.polygons,i,r);0<i.length&&(this.front||(this.front=new a),this.front.build(i)),0<r.length&&(this.back||(this.back=new a),this.back.build(r))}},{key:"allPolygons",value:function(){var e=this.polygons.slice();return this.front&&(e=e.concat(this.front.allPolygons())),this.back&&(e=e.concat(this.back.allPolygons())),e}},{key:"clone",value:function(){var e=new a;return e.divider=this.divider.clone(),e.polygons=this.polygons.map(function(e){return e.clone()}),e.front=this.front&&this.front.clone(),e.back=this.back&&this.back.clone(),e}},{key:"invert",value:function(){var e,t,n;for(e=0,t=this.polygons.length;e<t;e++)this.polygons[e].flip();return this.divider.flip(),this.front&&this.front.invert(),this.back&&this.back.invert(),n=this.front,this.front=this.back,this.back=n,this}},{key:"clipPolygons",value:function(e){var t,n,i,r;if(!this.divider)return e.slice();for(i=[],r=[],t=0,n=e.length;t<n;t++)this.divider.splitPolygon(e[t],i,r,i,r);return this.front&&(i=this.front.clipPolygons(i)),r=this.back?this.back.clipPolygons(r):[],i.concat(r)}},{key:"clipTo",value:function(e){this.polygons=e.clipPolygons(this.polygons),this.front&&this.front.clipTo(e),this.back&&this.back.clipTo(e)}}]),a}()},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var s=i(n(19)),l=i(n(12)),u=i(n(18)),h=i(n(17)),a=i(n(15));n(10),n(5),n(4),n(418),n(79),n(217),n(123);var z=i(n(28));n(22);var U=i(n(24)),o=i(n(2)),c=i(n(3)),V=i(n(32));function H(e){if(void 0===h.default||null==e[u.default]){if((0,l.default)(e)||(e=d(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}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 i,r,a=!0,o=!1;return{s:function(){i=(0,s.default)(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw r}}}}function d(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}i(n(166));var p=function(){function t(e){(0,o.default)(this,t),this._data={},this._textureData={},this._textureArray=[],this.font=e,this._textData={}}return(0,c.default)(t,[{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,U.default)(e.alpha),t.userData.opacity=(0,U.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,U.default)(e.alpha),t.userData.opacity=(0,U.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,U.default)(e.alpha),t.userData.opacity=(0,U.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,U.default)(e.alpha),t.userData.opacity=(0,U.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});0===e.strokeColor&&(e.strokeColor="#000000");var t={color:e.strokeColor?e.strokeColor:"#ff0000",linewidth:1,transparent:!0,opacity:(0,U.default)(e.alpha)},n=new fm.LineBasicMaterial(t);return n.userData.opacity=(0,U.default)(e.alpha),n}},{key:"createPoiMaterial",value:function(t,n,e,i){var r=this,a=new fm.SpriteMaterial;if(a.sizeAttenuation=!1,a.opacity=1,a.userData.opacity=1,a.depthTest=!!e,a.depthWrite=!!e,a.transparent=!0,a.side=2,a.priority=i,this._textureData[t.imageUrl]){var o=this._textureData[t.imageUrl];o.minFilter=fm.LinearFilter,o.generateMipmaps=!1,o.needsUpdate=!0,a.map=o,a.needsUpdate=!0,n&&n()}else{var s=new Image;s.crossOrigin="Anonymous";var l=navigator.userAgent,u=/(msie\s|trident.*rv:)([\w.]+)/,h=u.exec(l.toLowerCase());s.onload=null!==h?new function(){var e=new fm.Texture(s);e.minFilter=fm.LinearFilter,e.generateMipmaps=!1,e.needsUpdate=!0,a.map=e,a.needsUpdate=!0,r._textureData[t.imageUrl]=e,r._textureArray.push(e),n&&n()}:function(){var e=new fm.Texture(s);e.minFilter=fm.LinearFilter,e.generateMipmaps=!1,e.needsUpdate=!0,a.map=e,a.needsUpdate=!0,r._textureData[t.imageUrl]=e,r._textureArray.push(e),n&&n()},s.src=t.imageSrc}return a}},{key:"createLabelMaterial",value:function(t,n,e){var i=this,r=new fm.SpriteMaterial;if(r.sizeAttenuation=!1,r.opacity=(0,U.default)(n.alpha),r.userData.opacity=(0,U.default)(n.alpha),r.depthTest=!!e,r.depthWrite=!!e,r.transparent=!0,r.side=2,r.opacity=1,n.imageSrc)if(this._data[n.imageUrl]){var a=this._data[n.imageUrl],o=this.excuteLabelTexture(t,a,n);r.map=o,this._textureArray.push(o),r.userData.scaleRatio=r.map.scaleRatio,r.userData.mspriteScale=r.map.mspriteScale,r.needsUpdate=!0}else{var s=new Image,l=i.excuteLabelTexture(t,!0,n,!0);s.crossOrigin="Anonymous",r.userData.scaleRatio=l.scaleRatio,r.userData.mspriteScale=l.mspriteScale;var u=navigator.userAgent,h=/(msie\s|trident.*rv:)([\w.]+)/,c=h.exec(u.toLowerCase());s.onload=null!==c?new function(){var e=i.excuteLabelTexture(t,s,n);r.map=e,i._textureArray.push(e),r.needsUpdate=!0,i._data[n.imageUrl]=s}:function(){var e=i.excuteLabelTexture(t,s,n);r.map=e,i._textureArray.push(e),r.needsUpdate=!0,i._data[n.imageUrl]=s},s.src=n.imageSrc}else{var d=this.excuteLabelTexture(t,!1,n);r.map=d,this._textureArray.push(d),r.userData.scaleRatio=r.map.scaleRatio,r.userData.mspriteScale=r.map.mspriteScale,r.needsUpdate=!0}return r}},{key:"excuteSDFLabelTexture",value:function(e,t,n,i){var r=1,a=1.5*r,o=12*r,s=2*r;t||(o=0,s=0);var l=2*r,u=3*r,h=3*r,c=14*r,d=1,f=2*r,p=document.createElement("canvas"),m=p.getContext("2d"),v=this.font.family;m.font=c+"px "+v;var g,y,_,x=-1<e.indexOf("%rn%");if(x){_=e.split("%rn%");var b,w=0,M=0,T=H(_);try{for(T.s();!(b=T.n()).done;){var E=b.value;w=Math.max(m.measureText(E).width,w),M+=c}}catch(e){T.e(e)}finally{T.f()}M+=(_.length-1)*l,d=_.length,g=w+s+o+2*h,y=Math.max(M,o)+2*u}else{var S=m.measureText(e).width;g=S+s+o+2*h,y=Math.max(c,o)+2*u}if(i)return{scaleRatio:y/g,mspriteScale:d};if(p.width=g,p.height=y,p.style.width=g+"px",p.style.height=y+"px",n.platecolor||n.platestrokecolor){var A=n.platecolor.split(",");if(n.platecolor&&(m.fillStyle="rgb(".concat((0,z.default)(A[0]),",").concat((0,z.default)(A[1]),",").concat((0,z.default)(A[2]),")")),m.lineWidth=r,this.drawRadiuRect(m,g,y,5*r,{x:0,y:0}),n.platecolor&&m.fill(),n.platestrokecolor){var L=n.platestrokecolor.split(",");m.strokeStyle="rgb(".concat((0,z.default)(L[0]),",").concat((0,z.default)(L[1]),",").concat((0,z.default)(L[2]),")"),m.stroke()}m.beginPath()}var I=o+s,k=(y-o)/2,R=(y-c)/2;m.font=c+"px "+v,m.textBaseline="top",m.strokeStyle=V.default.toRgba(n.strokecolor),m.lineWidth=f;var N=0,P=!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),C=navigator.vendor&&-1<navigator.vendor.indexOf("Apple")&&navigator.userAgent&&-1==navigator.userAgent.indexOf("CriOS")&&-1==navigator.userAgent.indexOf("FxiOS");if((-1<navigator.userAgent.indexOf("Edge")||P||C)&&(N=-4),N*=r,x)for(var D=u,O=0;O<_.length;O++)O&&(D+=c+l),m.strokeText(_[O],I,D);else m.strokeText(e,I,R+a+N);if(m.fillStyle=V.default.toRgba(n.fillcolor),x)for(var F=u,B=0;B<_.length;B++)B&&(F+=c+l),m.fillText(_[B],I,F);else m.fillText(e,I,R+a+N);t&&m.drawImage(t,0,k,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(e,t,n,i){var r=2,a=1.5*r,o=1.2*n.fontsize*r,s=2*r;t||(o=0,s=5*r);var l=2*r,u=3*r,h=3*r,c=n.fontsize*r*1.2,d=1,f=2*r,p=document.createElement("canvas"),m=p.getContext("2d"),v=this.font.family;m.font=c+"px "+v;var g,y,_,x=-1<e.indexOf("%rn%");if(x){_=e.split("%rn%");var b,w=0,M=0,T=H(_);try{for(T.s();!(b=T.n()).done;){var E=b.value;w=Math.max(m.measureText(E).width,w),M+=c}}catch(e){T.e(e)}finally{T.f()}M+=(_.length-1)*l,d=_.length,g=w+s+o+2*h,y=Math.max(M,o)+2*u}else{var S=m.measureText(e).width;g=S+s+o+2*h,y=Math.max(c,o)+2*u}if(i)return{scaleRatio:y/g,mspriteScale:d};p.width=g,p.height=y,p.style.width=g+"px",p.style.height=y+"px",(n.platecolor||n.platestrokecolor)&&(n.platecolor&&(m.fillStyle=V.default.toRgba(n.platecolor)),m.lineWidth=r,this.drawRadiuRect(m,g-o,y,5*r,{x:0+o,y:0}),n.platecolor&&m.fill(),n.platestrokecolor&&(m.strokeStyle=V.default.toRgba(n.platestrokecolor),m.stroke()),m.beginPath());var A=o+s,L=(y-o)/2,I=(y-c)/2;m.font=c+"px "+v,m.textBaseline="top",m.lineWidth=f*(n.strokewidth?n.strokewidth:1);var k=1;n.strokewidth&&(k=(0,U.default)(n.strokewidth));var R=0,N=!1,P=navigator.mimeTypes;for(var C in P)"application/vnd.chromium.remoting-viewer"==P[C].type&&(N=!0);N&&(R=-4-(c-28)/6);var D=!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),O=navigator.vendor&&-1<navigator.vendor.indexOf("Apple")&&navigator.userAgent&&-1==navigator.userAgent.indexOf("CriOS")&&-1==navigator.userAgent.indexOf("FxiOS");if((-1<navigator.userAgent.indexOf("Edge")||D||O)&&(R=-4-(c-28)/6),(-1<navigator.userAgent.indexOf("QQBrowser")||D||O)&&(R=-4-(c-28)/6),(-1<navigator.userAgent.indexOf(".NET4.0C")||D||O)&&(R=-4-(c-28)/6),R*=r,n.strokecolor&&0!==k)if(m.strokeStyle=V.default.toRgba(n.strokecolor),x)for(var F=0;F<_.length;F++)t?m.strokeText(_[F],A,(y-c*_.length)/2+c*F):"left"==n.textAlign?(m.textAlign="left",m.strokeText(_[F],0,(y-c*_.length)/2+c*F)):"right"==n.textAlign?(m.textAlign="right",m.strokeText(_[F],g,(y-c*_.length)/2+c*F)):(m.textAlign="center",m.strokeText(_[F],g/2,(y-c*_.length)/2+c*F));else t?m.strokeText(e,A,I+a+R):"left"==n.textAlign?m.strokeText(e,0,I+a+R):"right"==n.textAlign?(m.textAlign="right",m.strokeText(e,g,I+a+R)):(m.textAlign="center",m.strokeText(e,g/2,I+a+R));if(m.fillStyle=V.default.toRgba(n.fillcolor),x)for(var B=0;B<_.length;B++)t?m.fillText(_[B],A,(y-c*_.length)/2+c*B):"left"==n.textAlign?(m.textAlign="left",m.fillText(_[B],0,(y-c*_.length)/2+c*B)):"right"==n.textAlign?(m.textAlign="right",m.fillText(_[B],g,(y-c*_.length)/2+c*B)):(m.textAlign="center",m.fillText(_[B],g/2,(y-c*_.length)/2+c*B));else t?m.fillText(e,A,I+a+R):"left"==n.textAlign?(m.textAlign="left",m.fillText(e,0,I+a+R)):"right"==n.textAlign?(m.textAlign="right",m.fillText(e,g,I+a+R)):(m.textAlign="center",m.fillText(e,g/2,I+a+R));t&&m.drawImage(t,0,L,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:"createTextMaterial",value:function(e,t){var n=new fm.SpriteMaterial;n.sizeAttenuation=!1,n.opacity=(0,U.default)(1),n.userData.opacity=(0,U.default)(1),n.depthTest=!1,n.depthWrite=!1,n.transparent=!0,n.side=2;var i=this.executeTexTexture(e,t);return n.map=i,n.size=i.size,n.userData.scaleRatio=n.map.scaleRatio,n.userData.mspriteScale=n.map.mspriteScale,n.needsUpdate=!0,n}},{key:"executeTexTexture",value:function(e,t,n,i){this.parent;var r=2,a=12*r,o=2*r;n||(a=0,o=0);var s,l,u,h=2*r,c=3*r,d=3*r,f=1,p=2*r,m=document.createElement("canvas"),v=m.getContext("2d"),g=this.font.family,y=0,_=0,x=H(e);try{for(x.s();!(u=x.n()).done;){var b=u.value,w=b.fontsize*r;v.font=w+"px "+g,y=Math.max(v.measureText(b.text).width,y),_+=w}}catch(e){x.e(e)}finally{x.f()}if(_+=(e.length-1)*h,f=e.length,s=y+o+a+2*d,l=Math.max(_,a)+2*c,i)return{scaleRatio:l/s,mspriteScale:f};m.width=s,m.height=l,m.style.width=s+"px",m.style.height=l+"px",t.platecolor&&(v.fillStyle=V.default.toRgba(t.platecolor),v.lineWidth=r,this.drawRadiuRect(v,s,l,5*r,{x:0,y:0}),v.fill(),t.platestrokecolor&&(v.strokeStyle=V.default.toRgba(t.platestrokecolor),v.stroke()),v.beginPath());var M=4,T=!1,E=navigator.mimeTypes;for(var S in E)"application/vnd.chromium.remoting-viewer"==E[S].type&&(T=!0);var A=-6;A+=8*(e.length-1),T&&(M=A-(_-28)/6);var L=!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),I=navigator.vendor&&-1<navigator.vendor.indexOf("Apple")&&navigator.userAgent&&-1==navigator.userAgent.indexOf("CriOS")&&-1==navigator.userAgent.indexOf("FxiOS");(-1<navigator.userAgent.indexOf("Edge")||L||I)&&(M=A-(_-28)/6),(-1<navigator.userAgent.indexOf("QQBrowser")||L||I)&&(M=A-(_-28)/6),(-1<navigator.userAgent.indexOf(".NET4.0C")||L||I)&&(M=A-(_-28)/6),v.textBaseline="top";for(var k=c,R=0;R<e.length;R++)if(e[R].strokecolor){v.lineWidth=p;var N=e[R].fontsize*r;v.font=N+"px "+g,v.strokeStyle=V.default.toRgba(e[R].strokecolor),R&&(k+=e[R-1].fontsize*r+h),0==t.textAlign?(v.textAlign="left",v.strokeText(e[R].text,0,k+M)):2==t.textAlign?(v.textAlign="right",v.strokeText(e[R].text,s,k+M)):(v.textAlign="center",v.strokeText(e[R].text,s/2,k+M))}k=c;for(var P=0;P<e.length;P++){var C=e[P].fontsize*r;v.font=C+"px "+g,v.fillStyle=V.default.toRgba(e[P].fontcolor),P&&(k+=e[P-1].fontsize*r+h),0==t.textAlign?(v.textAlign="left",v.fillText(e[P].text,0,k+M)):2==t.textAlign?(v.textAlign="right",v.fillText(e[P].text,s,k+M)):(v.textAlign="center",v.fillText(e[P].text,s/2,k+M))}var D=new fm.CanvasTexture(m);D.minFilter=fm.LinearFilter,D.generateMipmaps=!1,D.scaleRatio=m.height/m.width,D.mspriteScale=f;for(var O=0,F=null,B=0;B<e.length;B++)O+=e[B].fontsize;return F=1<e.length?(O+h*(e.length-1)+c)/e.length:O+c,D.size=F,D}},{key:"drawRadiuRect",value:function(e,t,n,i,r){var a=r,o={x:r.x+t,y:r.y},s={x:r.x,y:r.y+n},l={x:r.x+t,y:r.y+n},u={x:a.x+i,y:a.y},h={x:o.x-i,y:o.y},c={x:o.x,y:o.y+i},d={x:l.x,y:l.y-i},f={x:l.x-i,y:l.y},p={x:s.x+i,y:s.y},m={x:s.x,y:s.y-i},v={x:a.x,y:a.y+i};e.beginPath(),e.moveTo(u.x,u.y),e.lineTo(h.x,h.y),e.arcTo(o.x,o.y,c.x,c.y,i),e.lineTo(d.x,d.y),e.arcTo(l.x,l.y,f.x,f.y,i),e.lineTo(p.x,p.y),e.arcTo(s.x,s.y,m.x,m.y,i),e.lineTo(v.x,v.y),e.arcTo(a.x,a.y,u.x,u.y,i),e.closePath()}},{key:"measureText",value:function(e,t,n){var i=document.createElement("div");i.style.fontSize=n+"px",i.style.position="absolute",i.style.fontStyle=e,i.style.whiteSpace="nowrap",i.innerHTML=t;var r={width:i.clientWidth,height:i.clientHeight};return document.body.removeChild(i),r}},{key:"loadTexture",value:function(e,t){var n=this,i=new fm.Texture;if("string"!=typeof e)return i.image=e,i.needsUpdate=!0,t(i),i;"data"!==e.substring(0,4)&&this._textureData[e]&&t(this._textureData[e]);var r=new Image;return r.crossOrigin="Anonymous",this._textureArray.push(i),r.onload=function(){i.image=r,"data"!==e.substring(0,4)&&(n._textureData[e]=i),i.needsUpdate=!0,t(i)},r.src=e,i}},{key:"getHeatMapGradient",value:function(e){var t=document.createElement("canvas"),n=t.getContext("2d"),i=8,r=128;t.width=i,t.height=r,t.style.width=i+"px",t.style.height=r+"px";var a=n.createLinearGradient(0,0,8,128);for(var o in e)a.addColorStop(o,e[o]);n.fillStyle=a,n.fillRect(0,0,8,128);var s=new fm.CanvasTexture(t);return this._textureArray.push(s),s}},{key:"createNormalLineTexture",value:function(n){var e=document.createElement("canvas"),i=e.getContext("2d"),t=n.width,r=n.height;e.width=t,e.height=r,e.style.width=t+"px",e.style.height=r+"px";var a=0,o=n.dashArray,s=o.reduce(function(e,t){return e+t}),l=new fm.Matrix3;l.set(Math.cos(Math.PI/2),-Math.sin(Math.PI/2),t/2,Math.sin(Math.PI/2),Math.cos(Math.PI/2),r/2,0,0,1);var u=new fm.Matrix3;u.set(1,0,-t/2,0,1,-r/2,0,0,1),l.multiply(u);var h=l.elements;i.transform(h[0],h[3],h[1],h[4],h[2],h[6]),o.forEach(function(e,t){t%2==0&&(i.fillStyle=n.color,i.fillRect(a/s*n.width,0,e/s*n.width,n.height)),a+=e});var c=new fm.CanvasTexture(e);return c}},{key:"createArrowLineTexture",value:function(e){var t=e,n=document.createElement("canvas"),i=n.getContext("2d"),r=e.width,a=e.height;n.width=r,n.height=a,n.style.width=r+"px",n.style.height=a+"px";var o=(1-t.arrowHeightPercent)*t.height/2,s=t.height*t.arrowHeightPercent,l=new fm.Matrix3;l.set(Math.cos(Math.PI/2),-Math.sin(Math.PI/2),r/2,Math.sin(Math.PI/2),Math.cos(Math.PI/2),a/2,0,0,1);var u=new fm.Matrix3;u.set(1,0,-r/2,0,1,-a/2,0,0,1),l.multiply(u);var h=l.elements;i.transform(h[0],h[3],h[1],h[4],h[2],h[6]),i.beginPath(),i.moveTo(0,o);var c=t.width*(t.arrowWidthPercent-t.arrowPercent);i.lineTo(c,o),i.lineTo(t.width*t.arrowWidthPercent,o+s/2),i.lineTo(c,o+s),i.lineTo(0,o+s),i.lineTo(t.width*t.arrowPercent,o+s/2),i.closePath(),i.fillStyle=t.color,i.fill();var d=new fm.CanvasTexture(n);return d}},{key:"createArrowWidthBackTexture",value:function(e){var t=e,n=document.createElement("canvas"),i=n.getContext("2d"),r=e.width,a=e.height;n.width=r,n.height=a,n.style.width=r+"px",n.style.height=a+"px",i.fillStyle=t.godEdgeColor,i.fillRect(0,0,t.width,t.height);var o=t.width*(1-t.godEdgePercent);i.fillStyle=t.godColor,i.fillRect((t.width-o)/2,0,o,t.height),i.fillStyle="#ffffff",i.shadowOffsetX=-2,i.shadowOffsetY=2,i.shadowBlur=4,i.shadowColor="rgba(0,0,0,0.5)";var s={x:t.width/2,y:t.height/2},l=t.height*t.godArrowPercent,u=o*t.godArrowWidthPercent,h=t.arrawWidth||10,c=s.x-u/2,d=s.y+l/2;i.beginPath(),i.moveTo(c,d),i.lineTo(c,d+h),i.lineTo(c+u/2,d-l+h),i.lineTo(c+u,d+h),i.lineTo(c+u,d),i.lineTo(c+u/2,d-l),i.closePath(),i.fillStyle=t.godArrowColor,i.fill();var f=new fm.CanvasTexture(n);return f}},{key:"rotateCanvas",value:function(e,t,n,i){var r=document.createElement("canvas"),a=r.getContext("2d");r.width=n,r.height=i,r.style.width=n+"px",r.style.height=i+"px",a.drawImage(e,0,0,n,i)}},{key:"dispose",value:function(){var e,t=H(this._textureArray);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.dispose()}}catch(e){t.e(e)}finally{t.f()}for(var i in this._textureArray.length=0,this._textureData)this._textureData[i]=void 0;for(var r in this.data)this._data[r]=void 0}},{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}}]),t}(),m=p;t.default=m},function(e,t,n){"use strict";n(121)("fontcolor",function(t){return function(e){return t(this,"font","color",e)}})},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),o=i(n(2)),s=i(n(7)),l=i(n(8)),u=i(n(9)),h=i(n(420));function c(i){return function(){var e,t=(0,l.default)(i);if(d()){var n=(0,l.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,s.default)(this,e)}}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,u.default)(i,e);var n=c(i);function i(e){var t;return(0,o.default)(this,i),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 i}(fm.ShaderMaterial),p=f;t.default=p},function(e,t,n){"use strict";var i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var r={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=r;t.default=a},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var s=i(n(19)),l=i(n(12)),u=i(n(18)),h=i(n(17)),a=i(n(15));n(10),n(5),n(4),n(22);var o=i(n(2)),c=i(n(3)),d=i(n(422)),f=i(n(236));function p(e){if(void 0===h.default||null==e[u.default]){if((0,l.default)(e)||(e=m(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}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 i,r,a=!0,o=!1;return{s:function(){i=(0,s.default)(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw r}}}}function m(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var g=function(){function i(e,t,n){(0,o.default)(this,i),this.preLoadModels={},this.waitingBacks={},this.waitingNodes=[],this._path=e,this.isRemote=t,this.key=n,this.externalLoadingCount=0}return(0,c.default)(i,[{key:"load",value:function(r){var e,t,n,a=this;this.externalLoadingCount++,n=this.isRemote?"https://www.fengmap.com/FMCloud/webmodel/":this._path;var o=this.preLoadModels[r].modelUrl.split(".");t="js"===o[1]?(e=new d.default,o[0]+".js?keyValue="+this.key):(e=new f.default,o[0]+".glb?keyValue="+this.key),this.isRemote&&(t=o[0]+"/"+t),e.setPath(n),this.preLoadModels[r].isLoading=!0,e.load(t,function(e,t){for(var n in a.waitingBacks[r]){var i=a.waitingBacks[r][n];i(e,t,o[1])}a.externalLoadingCount--,a.externalLoadingCount<1&&a.loaded&&a.loaded(),a.preLoadModels[r].isGltf="js"!==o[1],a.preLoadModels[r].geometry=e,a.preLoadModels[r].material=t,a.waitingBacks[r].length=0,a.preLoadModels[r].isLoading=!1,a.preLoadModels[r].loaded=!0},function(){},function(){a.externalLoadingCount--,a.externalLoadingCount<1&&a.loaded&&a.loaded(),a.preLoadModels[r].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=p(this.waitingNodes);try{for(t.s();!(e=t.n()).done;)e.value}catch(e){t.e(e)}finally{t.f()}}}]),i}(),y=g;t.default=y},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(10);var a=i(n(16));function o(e){"boolean"==typeof e&&(console.warn("fm.JSONLoader: showStatus parameter has been removed from constructor."),e=void 0),this.manager=void 0!==e?e:fm.DefaultLoadingManager,this.withCredentials=!1}function s(e,t){function n(e,t){return e&1<<t}var i,r,a,o,s,l,u,h,c,d,f,p,m,v,g,y,_,x,b,w,M,T,E,S,A,L,I,k=e.faces,R=e.vertices,N=e.normals,P=e.colors,C=e.scale,D=0;if(void 0!==e.uvs){for(i=0;i<e.uvs.length;i++)e.uvs[i].length&&D++;for(i=0;i<D;i++)t.faceVertexUvs[i]=[]}for(o=0,s=R.length;o<s;)x=new fm.Vector3,x.x=R[o++]*C,x.y=R[o++]*C,x.z=R[o++]*C,t.vertices.push(x);for(o=0,s=k.length;o<s;)if(d=k[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(w=new fm.Face3,w.a=k[o],w.b=k[o+1],w.c=k[o+3],M=new fm.Face3,M.a=k[o+1],M.b=k[o+2],M.c=k[o+3],o+=4,p&&(c=k[o++],w.materialIndex=c,M.materialIndex=c),a=t.faces.length,m)for(i=0;i<D;i++)for(S=e.uvs[i],t.faceVertexUvs[i][a]=[],t.faceVertexUvs[i][a+1]=[],r=0;r<4;r++)h=k[o++],L=S[2*h],I=S[2*h+1],A=new fm.Vector2(L,I),2!==r&&t.faceVertexUvs[i][a].push(A),0!==r&&t.faceVertexUvs[i][a+1].push(A);if(v&&(u=3*k[o++],w.normal.set(N[u++],N[u++],N[u]),M.normal.copy(w.normal)),g)for(i=0;i<4;i++)u=3*k[o++],E=new fm.Vector3(N[u++],N[u++],N[u]),2!==i&&w.vertexNormals.push(E),0!==i&&M.vertexNormals.push(E);if(y&&(l=k[o++],T=P[l],w.color.setHex(T),M.color.setHex(T)),_)for(i=0;i<4;i++)l=k[o++],T=P[l],2!==i&&w.vertexColors.push(new fm.Color(T)),0!==i&&M.vertexColors.push(new fm.Color(T));t.faces.push(w),t.faces.push(M)}else{if(b=new fm.Face3,b.a=k[o++],b.b=k[o++],b.c=k[o++],p&&(c=k[o++],b.materialIndex=c),a=t.faces.length,m)for(i=0;i<D;i++)for(S=e.uvs[i],t.faceVertexUvs[i][a]=[],r=0;r<3;r++)h=k[o++],L=S[2*h],I=S[2*h+1],A=new fm.Vector2(L,I),t.faceVertexUvs[i][a].push(A);if(v&&(u=3*k[o++],b.normal.set(N[u++],N[u++],N[u])),g)for(i=0;i<3;i++)u=3*k[o++],E=new fm.Vector3(N[u++],N[u++],N[u]),b.vertexNormals.push(E);if(y&&(l=k[o++],b.color.setHex(P[l])),_)for(i=0;i<3;i++)l=k[o++],b.vertexColors.push(new fm.Color(P[l]));t.faces.push(b)}}function l(e,t){var n=void 0!==e.influencesPerVertex?e.influencesPerVertex:2;if(e.skinWeights)for(var i=0,r=e.skinWeights.length;i<r;i+=n){var a=e.skinWeights[i],o=1<n?e.skinWeights[i+1]:0,s=2<n?e.skinWeights[i+2]:0,l=3<n?e.skinWeights[i+3]:0;t.skinWeights.push(new fm.Vector4(a,o,s,l))}if(e.skinIndices)for(i=0,r=e.skinIndices.length;i<r;i+=n){var u=e.skinIndices[i],h=1<n?e.skinIndices[i+1]:0,c=2<n?e.skinIndices[i+2]:0,d=3<n?e.skinIndices[i+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 u(e,t){var n=e.scale;if(void 0!==e.morphTargets)for(var i=0,r=e.morphTargets.length;i<r;i++){t.morphTargets[i]={},t.morphTargets[i].name=e.morphTargets[i].name,t.morphTargets[i].vertices=[];for(var a=t.morphTargets[i].vertices,o=e.morphTargets[i].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.');var h=t.faces,c=e.morphColors[0].colors;for(i=0,r=h.length;i<r;i++)h[i].color.fromArray(c,3*i)}}function h(e,t){var n=[],i=[];void 0!==e.animation&&i.push(e.animation),void 0!==e.animations&&(e.animations.length?i=i.concat(e.animations):i.push(e.animations));for(var r=0;r<i.length;r++){var a=fm.AnimationClip.parseAnimation(i[r],t.bones);a&&n.push(a)}if(t.morphTargets){var o=fm.AnimationClip.CreateClipsFromMorphTargetSequences(t.morphTargets,10);n=n.concat(o)}0<n.length&&(t.animations=n)}(0,a.default)(o.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 fm.FileLoader(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 i=n.type;if(void 0!==i&&"object"===i.toLowerCase())return void console.error("fm.JSONLoader: "+a+" should be loaded with fm.ObjectLoader instead.")}var r=s.parse(t,l);o(r.geometry,r.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(s(e,n),l(e,n),u(e,n),h(e,n),n.computeFaceNormals(),n.computeBoundingSphere(),void 0===e.materials||0===e.materials.length)return{geometry:n};var i=fm.Loader.prototype.initMaterials(e.materials,this.resourcePath||t,this.crossOrigin);return{geometry:n,materials:i}}});var c=o;t.default=c},function(e,t,n){"use strict";var i=n(203)(!0);n(198)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=i(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){e.exports=n(425)},function(e,t,n){n(117),n(69),n(74),n(426),n(429),n(430),e.exports=n(11).Promise},function(e,t,n){"use strict";var i,r,a,o,s=n(89),l=n(20),u=n(46),h=n(112),c=n(14),d=n(23),f=n(60),p=n(119),m=n(76),v=n(237),g=n(238).set,y=n(427)(),_=n(169),x=n(239),b=n(428),w=n(240),M="Promise",T=l.TypeError,E=l.process,S=E&&E.versions,A=S&&S.v8||"",L=l[M],I="process"==h(E),k=function(){},R=r=_.f,N=!!function(){try{var e=L.resolve(1),t=(e.constructor={})[n(26)("species")]=function(e){e(k,k)};return(I||"function"==typeof PromiseRejectionEvent)&&e.then(k)instanceof t&&0!==A.indexOf("6.6")&&-1===b.indexOf("Chrome/66")}catch(e){}}(),P=function(e){var t;return!(!d(e)||"function"!=typeof(t=e.then))&&t},C=function(h,n){if(!h._n){h._n=!0;var i=h._c;y(function(){for(var l=h._v,u=1==h._s,e=0,t=function(e){var t,n,i,r=u?e.ok:e.fail,a=e.resolve,o=e.reject,s=e.domain;try{r?(u||(2==h._h&&F(h),h._h=1),!0===r?t=l:(s&&s.enter(),t=r(l),s&&(s.exit(),i=!0)),t===e.promise?o(T("Promise-chain cycle")):(n=P(t))?n.call(t,a,o):a(t)):o(l)}catch(e){s&&!i&&s.exit(),o(e)}};i.length>e;)t(i[e++]);h._c=[],h._n=!1,n&&!h._h&&D(h)})}},D=function(a){g.call(l,function(){var e,t,n,i=a._v,r=O(a);if(r&&(e=x(function(){I?E.emit("unhandledRejection",i,a):(t=l.onunhandledrejection)?t({promise:a,reason:i}):(n=l.console)&&n.error&&n.error("Unhandled promise rejection",i)}),a._h=I||O(a)?2:1),a._a=void 0,r&&e.e)throw e.v})},O=function(e){return 1!==e._h&&0===(e._a||e._c).length},F=function(t){g.call(l,function(){var e;I?E.emit("rejectionHandled",t):(e=l.onrejectionhandled)&&e({promise:t,reason:t._v})})},B=function(e){var t=this;t._d||(t._d=!0,t=t._w||t,t._v=e,t._s=2,t._a||(t._a=t._c.slice()),C(t,!0))},G=function(e){var n,i=this;if(!i._d){i._d=!0,i=i._w||i;try{if(i===e)throw T("Promise can't be resolved itself");(n=P(e))?y(function(){var t={_w:i,_d:!1};try{n.call(e,u(G,t,1),u(B,t,1))}catch(e){B.call(t,e)}}):(i._v=e,i._s=1,C(i,!1))}catch(e){B.call({_w:i,_d:!1},e)}}};N||(L=function(e){p(this,L,M,"_h"),f(e),i.call(this);try{e(u(G,this,1),u(B,this,1))}catch(e){B.call(this,e)}},i=function(){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},i.prototype=n(118)(L.prototype,{then:function(e,t){var n=R(v(this,L));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=I?E.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&C(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),a=function(){var e=new i;this.promise=e,this.resolve=u(G,e,1),this.reject=u(B,e,1)},_.f=R=function(e){return e===L||e===o?new a(e):r(e)}),c(c.G+c.W+c.F*!N,{Promise:L}),n(93)(L,M),n(231)(M),o=n(11)[M],c(c.S+c.F*!N,M,{reject:function(e){var t=R(this),n=t.reject;return n(e),t.promise}}),c(c.S+c.F*(s||!N),M,{resolve:function(e){return w(s&&this===o?L:this,e)}}),c(c.S+c.F*!(N&&n(196)(function(e){L.all(e).catch(k)})),M,{all:function(e){var o=this,t=R(o),s=t.resolve,l=t.reject,n=x(function(){var i=[],r=0,a=1;m(e,!1,function(e){var t=r++,n=!1;i.push(void 0),a++,o.resolve(e).then(function(e){n||(n=!0,i[t]=e,--a||s(i))},l)}),--a||s(i)});return n.e&&l(n.v),t.promise},race:function(e){var t=this,n=R(t),i=n.reject,r=x(function(){m(e,!1,function(e){t.resolve(e).then(n.resolve,i)})});return r.e&&i(r.v),n.promise}})},function(e,t,n){var s=n(20),l=n(238).set,u=s.MutationObserver||s.WebKitMutationObserver,h=s.process,c=s.Promise,d="process"==n(92)(h);e.exports=function(){var n,i,r,e=function(){var e,t;for(d&&(e=h.domain)&&e.exit();n;){t=n.fn,n=n.next;try{t()}catch(e){throw n?r():i=void 0,e}}i=void 0,e&&e.enter()};if(d)r=function(){h.nextTick(e)};else if(!u||s.navigator&&s.navigator.standalone)if(c&&c.resolve){var t=c.resolve(void 0);r=function(){t.then(e)}}else r=function(){l.call(s,e)};else{var a=!0,o=document.createTextNode("");new u(e).observe(o,{characterData:!0}),r=function(){o.data=a=!a}}return function(e){var t={fn:e,next:void 0};i&&(i.next=t),n||(n=t,r()),i=t}}},function(e,t,n){var i=n(20),r=i.navigator;e.exports=r&&r.userAgent||""},function(e,t,n){"use strict";var i=n(14),r=n(11),a=n(20),o=n(237),s=n(240);i(i.P+i.R,"Promise",{finally:function(t){var n=o(this,r.Promise||a.Promise),e="function"==typeof t;return this.then(e?function(e){return s(n,t()).then(function(){return e})}:t,e?function(e){return s(n,t()).then(function(){throw e})}:t)}})},function(e,t,n){"use strict";var i=n(14),r=n(169),a=n(239);i(i.S,"Promise",{try:function(e){var t=r.f(this),n=a(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(2)),o=i(n(3)),s=i(n(236)),l=function(){function e(){(0,a.default)(this,e),this.dynamicModel={},this.loader=new s.default}return(0,o.default)(e,[{key:"load",value:function(r,t,e){var a=this;this.dynamicModel[r]?0==this.dynamicModel[r].loadComplete?(this.dynamicModel[r].scbs.push(t),this.dynamicModel[r].fcbs.push(e)):this.dynamicModel[r].error?e&&e(this.dynamicModel[r].error):t&&this.loader.parse(this.dynamicModel[r].data,fm.LoaderUtils.extractUrlBase(r),function(e){t(e)},function(){}):(this.dynamicModel[r]={gltf:null,loadComplete:!1,error:null,scbs:[],fcbs:[]},this.dynamicModel[r].scbs.push(t),this.dynamicModel[r].fcbs.push(e),this.loader.load(r,function(e,t){a.dynamicModel[r].gltf=e,a.dynamicModel[r].data=t,a.dynamicModel[r].loadComplete=!0;for(var n=a.dynamicModel[r].scbs,i=0;i<n.length;i++)n[i]&&n[i](e)},void 0,function(e){a.dynamicModel[r].error=e,a.dynamicModel[r].loadComplete=!0;for(var t=a.dynamicModel[r].fcbs,n=0;n<t.length;n++)t[n]&&t[n](e)}))}},{key:"dispose",value:function(){this.dynamicModel={},this.loader=null}}]),e}(),u=l;t.default=u},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6));n(10);var o=i(n(2)),s=i(n(3)),l=i(n(7)),u=i(n(8)),h=i(n(9)),c=i(n(13)),d=i(n(241));function f(i){return function(){var e,t=(0,u.default)(i);if(p()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}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,h.default)(r,e);var i=f(r);function r(e,t){var n;return(0,o.default)(this,r),n=i.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,s.default)(r,[{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 d.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=[];for(var t in this._models)this._models[t].renderNode&&e.push(this._models[t].renderNode);return e}},{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&&this.parent.parent.parent.map.setRenderList()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}}]),r}(c.default),v=m;t.default=v},function(e,t,n){n(434),e.exports=9007199254740991},function(e,t,n){var i=n(14);i(i.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),o=i(n(2)),s=i(n(3)),l=i(n(7)),u=i(n(8)),h=i(n(9)),c=i(n(13));function d(i){return function(){var e,t=(0,u.default)(i);if(f()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}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)(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 i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),u=i(n(2)),o=i(n(7)),s=i(n(8)),h=i(n(9)),c=i(n(251));function d(i){return function(){var e,t=(0,s.default)(i);if(l()){var n=(0,s.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,o.default)(this,e)}}function l(){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,h.default)(l,e);var s=d(l);function l(e,t,n){var i;if((0,u.default)(this,l),i=s.call(this,e,t),n){var r=new c.default,a=r.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)),i.geometry=o,i.material=new fm.MeshBasicMaterial({map:n,depthTest:!1}),i.material.side=2,i.material.transparent=!0}return i}return l}(fm.Mesh),p=f;t.default=p},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),o=i(n(2)),s=i(n(7)),l=i(n(8)),u=i(n(9)),h=i(n(13));function c(i){return function(){var e,t=(0,l.default)(i);if(d()){var n=(0,l.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,s.default)(this,e)}}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,u.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 i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),o=i(n(2)),s=i(n(7)),l=i(n(8)),u=i(n(9)),h=i(n(439));function c(i){return function(){var e,t=(0,l.default)(i);if(d()){var n=(0,l.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,s.default)(this,e)}}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,u.default)(i,e);var n=c(i);function i(e){var t;return(0,o.default)(this,i),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 i}(fm.ShaderMaterial),p=f;t.default=p},function(e,t,n){"use strict";var i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var r={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=r;t.default=a},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var s=i(n(19)),l=i(n(12)),u=i(n(18)),h=i(n(17)),a=i(n(15));n(5),n(4),n(79),n(10);var c=i(n(24)),d=i(n(16));n(22);var o=i(n(2)),f=i(n(3)),p=i(n(32));function m(e){if(void 0===h.default||null==e[u.default]){if((0,l.default)(e)||(e=v(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}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 i,r,a=!0,o=!1;return{s:function(){i=(0,s.default)(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw r}}}}function v(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}i(n(441));var y=function(){function n(e,t){(0,o.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,f.default)(n,[{key:"initExteralModelTheme",value:function(){if(this._data.externalmodelapply){var e,t=m(this._data.externalmodelapply);try{for(t.s();!(e=t.n()).done;){var n,i=e.value,r=i.fids.split(","),a=m(r);try{for(a.s();!(n=a.n()).done;){var o,s=n.value,l=void 0,u=m(this._data.externalmodeltheme);try{for(u.s();!(o=u.n()).done;){var h=o.value;if(h.id===i.normalid){l=h;break}}}catch(e){u.e(e)}finally{u.f()}this._externalModelTheme[s]=(0,d.default)({color:l.color,model:l.model},i),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=p.default.toColor(n.color),n.strokeColor=p.default.toColor(n.strokecolor),n.strokeWidth=n.strokewidth,n.alpha=n.alpha,e[n.id]=n}var i=this._data.floorapply;for(var t in i){var r=i[t];if(r.typeapply)for(var a in r.typeapply){var o=r.typeapply[a];if(o.normalid){n=e[o.normalid];var s=e[o.selectedid];s&&(this._selectedColor=p.default.toColor(s.color));var l=o.type.split(",");for(var u in l)this._type2theme[l[u]]=n}}}var h=this._data.extenttheme;this._floorColor=p.default.toColor(h[0].color),this._floorOpacity=(0,c.default)(h[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 i=n[t].typeapply;if("0"==n[t].floorid)for(var r=0;r<i.length;r++)for(var a=i[r],o=a.type.split(","),s=0;s<o.length;s++)this.storeLabelTypeDic[o[s]]=a}}}},{key:"initPoiTheme",value:function(){this._poiimagetheme={};var e=this._data.poiimagetheme,t={};for(var n in this.storePoiThemes=t,e){var i=e[n];i.imagename&&(t[i.id]=i)}var r=this.data.floorpoiimageapply;for(var a in r){var o=r[a];if(o.typeapply)for(var s in o.typeapply){var l=o.typeapply[s];if(l.normalid){var u=t[l.normalid],h=l.type.split(",");for(var c in h)this._poiimagetheme[h[c]]=u}}}}},{key:"getStoreApplyTheme",value:function(e){var t,n,i=m(this._data.storeapply);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(r.fids===e){var a,o=m(this._data.storetheme);try{for(o.s();!(a=o.n()).done;){var s=a.value;if(s.id==r.normalid)return t=(0,d.default)({},s),t.sizes=r.sizes,t}}catch(e){o.e(e)}finally{o.f()}}}}catch(e){i.e(e)}finally{i.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,c.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=(0,d.default)(this._poiimagetheme[e]||this._poiimagetheme[0],{});return"rtheme"==this.fileType?t.imageSrc=this.getRThemeTexture(t.imagename):t.imageSrc=this._themeUrl+"/"+this.themeName+"/"+t.imagename,t.imageUrl=this._themeUrl+"/"+this.themeName+"/"+t.imagename,t.imagehead=this._themeUrl+"/"+this.themeName+"/",t}},{key:"getLabelTheme",value:function(e){var t,n=this.storeLabelTypeDic[e];if(t=n&&this.storeLabelThemeDic[n.normalid]?this.storeLabelThemeDic[n.normalid]:this._labelStyle,t=t||this._labelDefaultTheme,!t.fillcolor||!t.alpha||!t.fontsize){var i={fillcolor:"0,0,0",alpha:"1.0",fontsize:"12.0"};t=(0,d.default)(t,i)}return t.image?("rtheme"==this.fileType?t.imageSrc=this.getRThemeTexture(t.image):t.imageSrc=this._themeUrl+"/"+this.themeName+"/"+t.image,t.imageUrl=this._themeUrl+"/"+this.themeName+"/"+t.image):t.imageSrc=!1,t}},{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=p.default.toColor(this._data.viewtheme.clearcolor),this.clearAlpha=(0,c.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 i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var s=i(n(19)),l=i(n(12)),u=i(n(18)),h=i(n(17)),a=i(n(15));n(10),n(5),n(4);var o=i(n(16)),c=i(n(2)),d=i(n(3));function f(e){if(void 0===h.default||null==e[u.default]){if((0,l.default)(e)||(e=p(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}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 i,r,a=!0,o=!1;return{s:function(){i=(0,s.default)(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw r}}}}function p(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var v=function(){function t(e){(0,c.default)(this,t),this._data=e,this._Nodes=[]}return(0,d.default)(t,[{key:"updateNodes",value:function(){var e,t=f(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=this._Nodes.indexOf(e);-1<t&&this._Nodes.splice(t,1)}},{key:"changeData",value:function(e){(0,o.default)(this._data,e)}}]),t}(),g=v;t.default=g},function(e,t,n){"use strict";var i,r,a,o=n(1),s=o(n(64));a=function(){var e=function e(){var n=0,i=document.createElement("div");function t(e){return i.appendChild(e.dom),e}function r(e){for(var t=0;t<i.children.length;t++)i.children[t].style.display=t===e?"block":"none";n=e}i.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",i.addEventListener("click",function(e){e.preventDefault(),r(++n%i.children.length)},!1);var a=(performance||Date).now(),o=a,s=0,l=t(new e.Panel("FPS","#0ff","#002")),u=t(new e.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var h=t(new e.Panel("MB","#f08","#201"));return r(0),{REVISION:16,dom:i,addPanel:t,showPanel:r,begin:function(){a=(performance||Date).now()},end:function(){s++;var e=(performance||Date).now();if(u.update(e-a,200),o+1e3<=e&&(l.update(1e3*s/(e-o),100),o=e,s=0,h)){var t=performance.memory;h.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:i,setMode:r}};return e.Panel=function(n,i,r){var a=1/0,o=0,s=Math.round,l=s(window.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=r,g.fillRect(0,0,u,e),g.fillStyle=i,g.fillText(n,h,c),g.fillRect(d,f,p,m),g.fillStyle=r,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=r,g.globalAlpha=1,g.fillRect(0,0,u,f),g.fillStyle=i,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=r,g.globalAlpha=.9,g.fillRect(d+p-l,f,l,s((1-e/t)*m))}}},e},"object"===(0,s.default)(t)&&void 0!==e?e.exports=a():(i=a,r="function"==typeof i?i.call(t,n,t,e):i,void 0===r||(e.exports=r))},function(e,t,n){var i=n(0);function r(e,t,n){return t in e?i(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}e.exports=r},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(2)),o=i(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=this._map.nodeManager._scenes[""+e].groups;for(var n in t)this.videoMemoryAmount+=t[""+n].layers.facility[0].getVideoMemoryAmount(),this.videoMemoryAmount+=t[""+n].layers.model[0].getVideoMemoryAmount(),this.videoMemoryAmount+=t[""+n].layers.extent[0].getVideoMemoryAmount(),this.videoMemoryAmount+=t[""+n].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 i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var r={FMMap_CONTROL_SMALL:"small",FMMap_CONTROL_NORMAL:"normal"},a=r;t.default=a},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(2)),o=i(n(3)),s=i(n(32)),l=i(n(97)),u=i(n(96)),h=function(){function n(e,t){(0,a.default)(this,n),this._map=e,this._ctrlOpts=new u.default(t),this._ctrlOpts.offset||(this._ctrlOpts.offset={x:0,y:0}),this._dom=null,this._imgUrl=t.imgURL||"resource/style/wedgets/img/",this.init()}return(0,o.default)(n,[{key:"init",value:function(){var e=this,t=this.createPanel();this._dom=t;var n=this;this.checkPosition(this._ctrlOpts.position,this._ctrlOpts.offset,t),s.default.bindEvent(t,"img","mouseover",function(){this.src=this.dataset.on}),s.default.bindEvent(t,"img","mouseout",function(){this.src=this.dataset.leave}),s.default.bindEvent(t,"div","click",function(){"in"===this.dataset.type?n._map.dollyIn():n._map.dollyOut()}),this._map.on("dispose",function(){e._map.getContainer().removeChild(t)})}},{key:"showZoom",value:function(e){this._dom.style.display=e?"block":"none"}},{key:"createPanel",value:function(){var e=document.createElement("div");return e.setAttribute("class","fm-control-zoom"),e.style.zIndex=10,e.style.position="absolute",e.style.backgroundColor="white",e.style.boxShadow="2px 2px 3px rgba(0,0,0, 0.3)",e.style.borderRadius="2px",e.style.left=0,e.style.top=0,this._map.getContainer().appendChild(e),e.innerHTML=this.createInnerHtml(this._imgUrl+"zoomout.png",this._imgUrl+"zoomout_on.png",this._imgUrl+"zoomin.png",this._imgUrl+"zoomin_on.png"),e}},{key:"createInnerHtml",value:function(e,t,n,i){var r='\n \n <div data-type="in" style="padding: 14px; cursor: pointer;">\n <img src='.concat(n," data-leave=").concat(n," data-on=").concat(i,' style="width: 14px; height: 14px;"/>\n </div>\n <hr style="height: 1px; border-top: 1px solid rgba(153, 153, 153, 0.45); border-right: none; border-bottom: none; border-left: none; border-image: initial; width: 60%; margin: 0px 20%;">\n <div data-type="out" style="padding: 14px; cursor: pointer;">\n <img src=').concat(e," data-leave=").concat(e," data-on=").concat(t,' style="width: 14px; height: 14px;"/>\n </div>\n ');return r}},{key:"checkPosition",value:function(e,t,n){switch(n.style.left="",n.style.right="",n.style.top="",n.style.bottom="",e){case l.default.LEFT_TOP:n.style.left=t.x+"px",n.style.top=t.y+"px";break;case l.default.RIGHT_TOP:n.style.right=-t.x+"px",n.style.top=t.y+"px";break;case l.default.LEFT_BOTTOM:n.style.left=t.x+"px",n.style.bottom=-t.y+"px";break;case l.default.RIGHT_BOTTOM:n.style.right=-t.x+"px",n.style.bottom=-t.y+"px"}}}]),n}(),c=h;t.default=c},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(29)),o=i(n(28));n(75);var s,l=i(n(2)),u=i(n(3)),h=i(n(32)),c=i(n(97)),d=i(n(96)),f=function(){function n(e,t){(0,l.default)(this,n),this._map=e,this._ctlOpt=new d.default(t),this._btnWidth=42,this._showBtnCount=this._ctlOpt.showBtnCount||5,this._foucusId=this._map.currentFocusGroup,this._scrollSpeed=10,this._btnPanel=null,this._mainPanel=null,this._ctlOpt.offset||(this._ctlOpt.offset={x:0,y:0}),this._ctlOpt.needAllLayerBtn=null==this._ctlOpt.needAllLayerBtn||this._ctlOpt.needAllLayerBtn,this._allLayer=!!this._ctlOpt.allLayer&&this._ctlOpt.allLayer,this._allLayer&&this._map.showSingerOrMultiGroup(this._allLayer),this.uuid=null,this.init(),this.scrollTopAn_=new h.default.scrollTopAnFun}return(0,u.default)(n,[{key:"init",value:function(){var n=this,e=new Date,t=e.getFullYear(),i=e.getMonth(),r=e.getDate(),a=e.getHours(),o=e.getMinutes(),s=e.getSeconds();a<10&&(a="0"+a),o<10&&(o="0"+o),s<10&&(s="0"+s);var l=t+"/"+i+"/"+r+"/"+a+":"+o+":"+s;this.uuid=String(5*Math.random()).replace(/^(.*\..{4}).*$/,"$1")+l;var u=this.createPanel(this._btnWidth);this._mainPanel=u,this.checkPosition(this._ctlOpt.position,this._ctlOpt.offset,u),this._map.getContainer().appendChild(u);var h=this._map.listGroups.map(function(e){return e.gid}),c=h.length,d=this._showBtnCount,f=!0;c<=this._showBtnCount&&(d=c,f=!1);var p=this.createMultiSwitchButton(this._ctlOpt.imgURL+(this._ctlOpt.allLayer?"layers.png":"layer.png"));this._ctlOpt.needAllLayerBtn&&u.appendChild(p),this._switchBtn=p,f&&u.appendChild(this.createScrollButton(this._ctlOpt.imgURL+"arrow1.png","top"));var m=this.createGroupBtnPanel(d*this._btnWidth+2*(d-1));u.appendChild(m),this._btnPanel=m;for(var v=this._map.listGroups,g=v.length-1;-1<g;g--)m.appendChild(this.createGroupButton(v[g],this._btnWidth)),0<g&&m.appendChild(this.createHr());f&&u.appendChild(this.createScrollButton(this._ctlOpt.imgURL+"arrow2.png","buttom")),m.scrollTop=this.getCenterScrolltopById(this._foucusId,h.length),document.getElementById("gid_"+this._foucusId+this.uuid).style.color="rgb(30, 130, 250)",this.eventBtnPanelInit(m),this.eventPanelInit(u,m,h),this.eventSwitchBtn(p);var y=function(e){var t=n._map.listGroups.map(function(e){return e.gid});e.gid<t[0]||e.gid>t[t.length-1]||(m.scrollTop=n.getCenterScrolltopById(e.gid,t.length),n.setFocusStaus(e.gid))},_=function(e){1<e.gids.length?n.setLayerStatus(!0):n.setLayerStatus(!1)};this._map.on("focusGroupIDChanged",y),this._map.on("visibleGroupIDsChanged",_),this._map.on("dispose",function(){n._map.off("focusGroupIDChanged",y),n._map.off("visibleGroupIDsChanged",_),n._map.getContainer().removeChild(u)}),this._$=function(e){return n.map?n.map.mapView.container_.querySelector(e):document.querySelector(e)}}},{key:"eventSwitchBtn",value:function(e){var t=this;e.addEventListener("click",function(){t._allLayer=!t._allLayer,t._allLayer?e.firstElementChild.src=t._ctlOpt.imgURL+"layers.png":e.firstElementChild.src=t._ctlOpt.imgURL+"layer.png",t._map.showSingerOrMultiGroup(t._allLayer)})}},{key:"eventBtnPanelInit",value:function(n){var i=this,r=this;r.changeScrollBtnPic(),h.default.bindEvent(n,"label","click",function(){r.foucusId=(0,o.default)(this.dataset.gid),r.setFocusStaus(this.dataset.gid)});var e=function(e){r.changeScrollBtnPic();var t=0;e.wheelDelta?t+=-e.wheelDelta:e.detail&&(t+=e.detail),i.scrollTopAn_({el:n,to:n.scrollTop,form:n.scrollTop+t})};n.addEventListener("mousewheel",e,{passive:!0}),n.addEventListener("MozMousePixelScroll",e,!1),n.addEventListener("touchstart",this.touchstart.bind(this),!1),n.addEventListener("touchmove",this.touchmove.bind(this),!1),n.addEventListener("touchend",this.touchend.bind(this),!0)}},{key:"touchstart",value:function(e){e.preventDefault(),this.touchStartPointY=e.touches[0].pageY,this.touchPointX=e.touches[0].pageX,this.touchPointY=e.touches[0].pageY}},{key:"touchmove",value:function(e){e.preventDefault(),this.touchEndPointX=e.touches[0].pageX,this.touchEndPointY=e.touches[0].pageY,this.handleTouchEnd(e)}},{key:"handleTouchEnd",value:function(e){e=e||window.event;var t=this,n=null,i=0;0<e.changedTouches.length&&(t.touchEndPointX=e.changedTouches[0].pageX,t.touchEndPointY=e.changedTouches[0].pageY),n=e.target,n instanceof HTMLSpanElement==1&&(n=n.parentElement);var r=t.touchEndPointY-t.touchPointY;if(i=-r,0!=i){t.touchPointX=t.touchEndPointX,t.touchPointY=t.touchEndPointY;var a=t._$(".fm-layer-list");this.scrollTopAn_({el:a,to:a.scrollTop,form:a.scrollTop+i})}}},{key:"touchend",value:function(e){e=e||window.event;var t=this,n=null;0<e.changedTouches.length&&(t.touchEndPointX=e.changedTouches[0].pageX,t.touchEndPointY=e.changedTouches[0].pageY),n=e.target,n instanceof HTMLSpanElement==1&&(n=n.parentElement);var i=Math.abs(t.touchEndPointY-t.touchStartPointY);if(i<5&&0<=i&&n){var r=(0,o.default)(n.dataset.gid);isNaN(r)||(t.foucusId=r,t.setFocusStaus(r))}}},{key:"eventPanelInit",value:function(e,o,s){var l=this;e.onselectstart=function(){return!1},e.style.MozUserSelect="none",h.default.bindEvent(e,".scroll","click",function(){var e=s.length-Math.floor(o.scrollTop/44)-(l._showBtnCount-1),t=o.scrollTop%44,n=e+l._showBtnCount-1+(0<t?1:0),i=0;if(this.id==="scroll_top"+l.uuid){var r=l._foucusId+1;if(r=Math.min(s[s.length-1],r),l.foucusId==r)return;l.foucusId=r,r<e?i-=0<t?44-t:0:r<=n+1&&r===n+1&&(i-=44+(0<t?44-t:0))}else{var a=l._foucusId-1;if(a=Math.max(s[0],a),l.foucusId==a)return;l.foucusId=a,n<a?i+=0<t?t:0:e-1<=a&&a===e-1&&(i+=44+(0<t?t:0))}0!=i&&l.scrollTopAn_({el:o,to:o.scrollTop,form:o.scrollTop+i})})}},{key:"getCenterScrolltopById",value:function(e,t){var n=t-e-Math.floor(this._showBtnCount/2);return n*(this._btnWidth+2)}},{key:"createPanel",value:function(){var e=document.createElement("div"),t='\n <div class="fm-control-groups" style ="width: 42px; position: absolute; background-color: white; box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 3px; border-radius: 2px; top: 30px; right: 30px;"></div>\n ';return e.innerHTML=t.trim(),e.firstChild}},{key:"createGroupBtnPanel",value:function(e){var t=document.createElement("div"),n='\n <div style = "overflow: hidden; height: '.concat(e,'px;" class="fm-layer-list"> </div\n ');return t.innerHTML=n.trim(),t.firstChild}},{key:"createMultiSwitchButton",value:function(e){var t=document.createElement("div"),n='\n <div class="fm-control-groups-layer fm-btn-layer" style="padding: 10px; cursor: pointer;">\n <img src="'.concat(e,'" style="width: 22px; height: 22px;">\n </div>\n ');return t.innerHTML=n.trim(),t.firstChild}},{key:"createHr",value:function(){var e=document.createElement("div"),t='\n <hr style="height: 1px; border-top: 1px solid rgba(153, 153, 153, 0.45); border-right: none; border-bottom: none; border-left: none; border-image: initial; width: 60%; margin: 0px 20%;">\n ';return e.innerHTML=t.trim(),e.firstChild}},{key:"createScrollButton",value:function(e,t){var n=document.createElement("div"),i='\n <div class="scroll" id="scroll_'.concat(t+this.uuid,'" style="height: 18px; background: url(&quot;').concat(e,'&quot;) 50% 50% no-repeat; cursor: pointer;"></div>\n ');return n.innerHTML=i.trim(),n.firstChild}},{key:"createGroupButton",value:function(e,t){var n=document.createElement("div"),i="<label data-gid=".concat(e.gid,' id="gid_').concat(e.gid+this.uuid,'" style="display: inline-block; text-align: center; width: ').concat(t,"px; height: ").concat(t,"px; line-height: ").concat(t,'px; margin: 0px; cursor: pointer; font-size: 0.8em; font-weight: bold; color: rgb(102, 102, 102);">\n <span>').concat(e.alias&&e.alias.toUpperCase()||e.gname.toUpperCase(),"</span>\n </label>");return n.innerHTML=i.trim(),n.firstChild}},{key:"changeScrollBtnPic",value:function(){var e=this._foucusId,t=this._map.listGroups.map(function(e){return e.gid}),n=document.getElementById("scroll_buttom"+this.uuid),i=document.getElementById("scroll_top"+this.uuid);e==t[0]?n&&(n.style.backgroundImage="url("+this._ctlOpt.imgURL+"arrow4.png)"):n&&(n.style.backgroundImage="url("+this._ctlOpt.imgURL+"arrow2.png)"),e==t[t.length-1]?i&&(i.style.backgroundImage="url("+this._ctlOpt.imgURL+"arrow3.png)"):i&&(i.style.backgroundImage="url("+this._ctlOpt.imgURL+"arrow1.png)")}},{key:"changeFocusGroup",value:function(e){this.foucusId=e}},{key:"changeGroupsSelect",value:function(e){this.setLayerStatus(e),this._map.showSingerOrMultiGroup(e)}},{key:"setLayerStatus",value:function(e){this._allLayer=e,this._allLayer?this._switchBtn.firstElementChild.src=this._ctlOpt.imgURL+"layers.png":this._switchBtn.firstElementChild.src=this._ctlOpt.imgURL+"layer.png"}},{key:"checkPosition",value:function(e,t,n){switch(n.style.left="",n.style.right="",n.style.top="",n.style.bottom="",e){case c.default.LEFT_TOP:n.style.left=t.x+"px",n.style.top=t.y+"px";break;case c.default.RIGHT_TOP:n.style.right=-t.x+"px",n.style.top=t.y+"px";break;case c.default.LEFT_BOTTOM:n.style.left=t.x+"px",n.style.bottom=-t.y+"px";break;case c.default.RIGHT_BOTTOM:n.style.right=-t.x+"px",n.style.bottom=-t.y+"px";break;default:n.style.left=t.x+"px",n.style.top=t.y+"px"}}},{key:"onChange",value:function(e){s=e}},{key:"setFocusStaus",value:function(e){document.getElementById("gid_"+this._foucusId+this.uuid).style.color="rgb(102, 102, 102)",this._foucusId=(0,o.default)(e),document.getElementById("gid_"+this._foucusId+this.uuid).style.color="rgb(30, 130, 250)",this.changeScrollBtnPic()}},{key:"foucusId",set:function(e){var t=[];t.push.apply(t,(0,a.default)(this._map.visibleGroupIDs)),1==t.length?this._map.visibleGroupIDs=[e]:-1<this._map.visibleGroupIDs.indexOf(e)||(t.push(e),this._map.visibleGroupIDs=t),this._map.changeFocusToGroup({gid:e}),s&&s([e],1<this._map.visibleGroupIDs.length)},get:function(){return this._map.currentFocusGroup}},{key:"allLayer",get:function(){return this._map.showAllGroup}}]),n}(),p=f;t.default=p},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a,o=i(n(29)),s=i(n(28)),l=i(n(2)),u=i(n(3)),h=i(n(32)),c=i(n(97)),d=i(n(96)),f=function(){function n(e,t){(0,l.default)(this,n),this._map=e,this._ctlOpt=new d.default(t),this._ctlOpt.offset||(this._ctlOpt.offset={x:0,y:0}),this._btnWidth=42,this._showBtnCount=this._ctlOpt.showBtnCount||5,this._foucusId=this._map.currentFocusGroup||1,this._scrollSpeed=10,this._btnPanel=null,this._mainPanel=null,this._enableExpand=!0,this._disMainPanel=30+this._btnWidth,this._btnPanelVsible=!1,this._allLayer=!!t.allLayer&&t.allLayer,this._allLayer&&this._map.showSingerOrMultiGroup(this._allLayer),this.scrollTopAn_=new h.default.scrollTopAnFun,this.init()}return(0,u.default)(n,[{key:"init",value:function(){var n=this,e=this._map.getFMGroup(this._foucusId),t=this.createPanel(this._btnWidth,e.groupName);this._mainPanel=t,this._map.getContainer().appendChild(t);var i=this._map.listGroups.map(function(e){return e.gid}),r=i.length,a=this._showBtnCount;r<=this._showBtnCount&&(a=r);var o=this.createGroupBtnPanel(a*this._btnWidth+2*(a-1));this._map.getContainer().appendChild(o),this._btnPanel=o;for(var s=this._map.listGroups,l=s.length-1;-1<l;l--)o.appendChild(this.createGroupButton(s[l],this._btnWidth)),0<l&&o.appendChild(this.createHr());this.checkPosition(this._ctlOpt.position,this._ctlOpt.offset,t,o),document.getElementById("gid_"+this._foucusId).style.color="rgb(30, 130, 250)",this.eventBtnPanelInit(o),this.eventPanelInit(t,i);var u=function(e){var t=n._map.listGroups.map(function(e){return e.gid});e.gid<t[0]||e.gid>t[t.length-1]||(o.scrollTop=n.getCenterScrolltopById(e.gid,t.length),n.setFocusStaus(e.gid))};this._map.on("focusGroupIDChanged",u),this._map.on("dispose",function(){n._map.off("focusGroupIDChanged",u),n._map.getContainer().removeChild(o),n._map.getContainer().removeChild(t)}),this._$=function(e){return n.map?n.map.mapView.container_.querySelector(e):document.querySelector(e)}}},{key:"eventBtnPanelInit",value:function(n){var i=this,e=this;n.onselectstart=function(){return!1},n.style.MozUserSelect="none",h.default.bindEvent(n,"label","click",function(){e.foucusId=(0,s.default)(this.dataset.gid)});var t=function(e){var t=n.scrollTop;e.wheelDelta?t+=-e.wheelDelta:e.detail&&(t+=e.detail),i.scrollTopAn_({el:n,to:n.scrollTop,form:n.scrollTop+t})};n.addEventListener("mousewheel",t),n.addEventListener("MozMousePixelScroll",t,!1),n.addEventListener("touchstart",this.touchstart.bind(this),!1),n.addEventListener("touchmove",this.touchmove.bind(this),!1),n.addEventListener("touchend",this.touchend.bind(this),!0)}},{key:"touchstart",value:function(e){e.preventDefault(),this.touchPointX=e.touches[0].pageX,this.touchPointY=e.touches[0].pageY,this.touchStartPointY=e.touches[0].pageY}},{key:"touchmove",value:function(e){e.preventDefault(),this.touchEndPointX=e.touches[0].pageX,this.touchEndPointY=e.touches[0].pageY,this.handleTouchEnd(e)}},{key:"handleTouchEnd",value:function(e){e=e||window.event;var t=this,n=null,i=0;0<e.changedTouches.length&&(t.touchEndPointX=e.changedTouches[0].pageX,t.touchEndPointY=e.changedTouches[0].pageY),n=e.target,n instanceof HTMLSpanElement==1&&(n=n.parentElement);var r=t.touchEndPointY-t.touchPointY;if(i=-r,0!=i){t.touchPointX=t.touchEndPointX,t.touchPointY=t.touchEndPointY;var a=t._$(".fm-layer-list");this.scrollTopAn_({el:a,to:a.scrollTop,form:a.scrollTop+i})}}},{key:"touchend",value:function(e){e=e||window.event;var t=this,n=null;0<e.changedTouches.length&&(t.touchEndPointX=e.changedTouches[0].pageX,t.touchEndPointY=e.changedTouches[0].pageY),n=e.target,n instanceof HTMLSpanElement==1&&(n=n.parentElement);var i=Math.abs(t.touchEndPointY-t.touchStartPointY);if(i<5&&0<=i&&n){var r=(0,s.default)(n.dataset.gid);isNaN(r)||(t.foucusId=r,t.setFocusStaus(r))}}},{key:"eventPanelInit",value:function(e,t){var n=this;e.onselectstart=function(){return!1},e.style.MozUserSelect="none",e.addEventListener("click",function(){n._enableExpand&&(n._btnPanelVsible?n._btnPanel.style.display="none":n._btnPanel.style.display="block",n._btnPanel.scrollTop=n.getCenterScrolltopById(n._foucusId,t.length),n._btnPanelVsible=!n._btnPanelVsible)})}},{key:"getCenterScrolltopById",value:function(e,t){var n=t-e-Math.floor(this._showBtnCount/2);return n*(this._btnWidth+2)}},{key:"createGroupBtnPanel",value:function(e){var t=document.createElement("div"),n='\n <div style = "position: absolute; background-color: white; box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 3px; border-radius: 2px; display: none; overflow: hidden;height: '.concat(e,'px;" class="fm-layer-list"> </div\n ');return t.innerHTML=n.trim(),t.firstChild}},{key:"createPanel",value:function(e,t){var n='<div class="fm-control-groups-btn" style="width: '.concat(e,'px; height: 42px; position: absolute; background-color: white; box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 3px; border-radius: 2px; text-align: center; cursor: pointer; font-size: 0.8em; font-weight: bold; text-transform: uppercase; line-height: 42px; color: rgb(30, 130, 250);">').concat(t.toUpperCase(),"</div>"),i=document.createElement("div");return i.innerHTML=n.trim(),i.firstChild}},{key:"createHr",value:function(){var e=document.createElement("div"),t='\n <hr style="height: 1px; border-top: 1px solid rgba(153, 153, 153, 0.45); border-right: none; border-bottom: none; border-left: none; border-image: initial; width: 60%; margin: 0px 20%;">\n ';return e.innerHTML=t.trim(),e.firstChild}},{key:"createGroupButton",value:function(e,t){var n=document.createElement("div"),i="<label data-gid=".concat(e.gid,' id="gid_').concat(e.gid,'" style="display: inline-block; text-align: center; width: ').concat(t,"px; height: ").concat(t,"px; line-height: ").concat(t,'px; margin: 0px; cursor: pointer; font-size: 0.8em; font-weight: bold; color: rgb(102, 102, 102);">\n <span>').concat(e.alias&&e.alias.toUpperCase()||e.gname.toUpperCase(),"</span>\n </label>");return n.innerHTML=i.trim(),n.firstChild}},{key:"checkPosition",value:function(e,t,n,i){switch(n.style.left="",n.style.right="",n.style.top="",n.style.bottom="",i.style.left="",i.style.right="",i.style.top="",i.style.bottom="",e){case c.default.LEFT_TOP:n.style.left=t.x+"px",n.style.top=t.y+"px",i.style.left=t.x+"px",i.style.top=t.y+this._disMainPanel+"px";break;case c.default.RIGHT_TOP:n.style.right=-t.x+"px",n.style.top=t.y+"px",i.style.right=-t.x+"px",i.style.top=t.y+this._disMainPanel+"px";break;case c.default.LEFT_BOTTOM:n.style.left=t.x+"px",n.style.bottom=-t.y+"px",i.style.left=t.x+"px",i.style.bottom=-t.y+this._disMainPanel+"px";break;case c.default.RIGHT_BOTTOM:n.style.right=-t.x+"px",n.style.bottom=-t.y+"px",i.style.right=-t.x+"px",i.style.bottom=-t.y+this._disMainPanel+"px";break;default:n.style.left=t.x+"px",n.style.top=t.y+"px",i.style.left=t.x+"px",i.style.top=t.y+this._disMainPanel+"px"}}},{key:"onChange",value:function(e){a=e}},{key:"changeFocusGroup",value:function(e,t){this._map.showSingerOrMultiGroup(t),this.foucusId=e}},{key:"getGroupNameByGid",value:function(e){for(var t=this._map.listGroups,n=0,i=t.length;n<i;n++){var r=t[n];if(r.gid==e)return r.gname.toUpperCase()}return""}},{key:"setFocusStaus",value:function(e){this._mainPanel.innerHTML="".concat(this.getGroupNameByGid(e)),document.getElementById("gid_"+this._foucusId).style.color="rgb(102, 102, 102)",this._foucusId=e,document.getElementById("gid_"+this._foucusId).style.color="rgb(30, 130, 250)"}},{key:"foucusId",set:function(e){var t=[];t.push.apply(t,(0,o.default)(this._map.visibleGroupIDs)),1==t.length?this._map.visibleGroupIDs=[e]:-1<this._map.visibleGroupIDs.indexOf(e)||(t.push(e),this._map.visibleGroupIDs=t),this._map.changeFocusToGroup({gid:e}),a&&a([e],this._map.showAllGroup)}},{key:"allLayer",get:function(){return this._map.showAllGroup}},{key:"enableExpand",set:function(e){this._enableExpand=e},get:function(){return this._enableExpand}},{key:"expand",get:function(){return this._btnPanelVsible},set:function(e){if(this._enableExpand){this._btnPanel.style.display=e?"block":"none";var t=this._map.listGroups.map(function(e){return e.gid});this._btnPanel.scrollTop=this.getCenterScrolltopById(this._foucusId,t.length),this._btnPanelVsible=e}}}]),n}(),p=f;t.default=p},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(2)),o=i(n(3)),s=i(n(258)),l=i(n(96)),u=i(n(97)),h=function(){function n(e,t){(0,a.default)(this,n),this._map=e,this._ctlOpt=new l.default(t),this._mainPanel=null,this._viewModeButton=null,this._groupChange=null,this._viewModeButtonNeeded=void 0===t.viewModeButtonNeeded||t.viewModeButtonNeeded,this._groupsButtonNeeded=void 0===t.groupsButtonNeeded||t.groupsButtonNeeded,this._init2D=void 0!==t.init2D&&t.init2D,this._initGroups=void 0!==t.initGroups&&t.initGroups,this._init2D&&(this._map.viewMode="top"),this._initGroups&&this._map.showSingerOrMultiGroup(!0),this._isOpenedControl=!1,this._showAllGroup=this._initGroups,this._direct=t.position||u.default.RIGHT_TOP,this._offset={x:0,y:0},t.offset&&(this._offset=t.offset),this.init()}return(0,o.default)(n,[{key:"init",value:function(){var t=this;this._mainPanel=this.createPanel(this._ctlOpt.imgURL+"more.png"),this._viewModeButton=this.createTopAnd3DButton(this._ctlOpt.imgURL+(this._init2D?"2D.png":"3D.png")),this._groupChange=this.createMultiAndSingerButton(this._ctlOpt.imgURL+(this._showAllGroup?"groups.png":"group.png")),(this._viewModeButtonNeeded||this._groupsButtonNeeded)&&this._map.getContainer().appendChild(this._mainPanel),this._viewModeButtonNeeded&&this._map.getContainer().appendChild(this._viewModeButton),this._groupsButtonNeeded&&this._map.getContainer().appendChild(this._groupChange);var e=this._offset;this._viewModeButtonNeeded&&this._groupsButtonNeeded?(this._mainPanel.style.display="block",this.checkPosition(this._direct,e,this._mainPanel),this.checkPosition(this._direct,e,this._viewModeButton,!0,1),this.checkPosition(this._direct,e,this._groupChange,!0,2)):this._viewModeButtonNeeded?(this._viewModeButton.style.display="block",this.checkPosition(this._direct,e,this._viewModeButton,!0,1)):this._groupsButtonNeeded&&(this._groupChange.style.display="block",this.checkPosition(this._direct,e,this._groupChange,!0,1)),this.initMainPanelEvent(this._mainPanel),this.initMultiGroupPanelEvent(this._groupChange),this.initViewModePanelEvent(this._viewModeButton);var n=function(){t.setViewModeButtonPic()};this._map.on("viewModeChange",n);var i=function(e){t.setSingleMultiStatus(1<e.gids.length)};this._map.on("visibleGroupIDsChanged",i),this._map.on("dispose",function(){t._map.off("visibleGroupIDsChanged",i),t._map.off("viewModeChange",n),t._map.getContainer().contains(t._mainPanel)&&t._map.getContainer().removeChild(t._mainPanel),t._map.getContainer().contains(t._viewModeButton)&&t._map.getContainer().removeChild(t._viewModeButton),t._map.getContainer().contains(t._groupChange)&&t._map.getContainer().removeChild(t._groupChange)})}},{key:"isAllGroups",value:function(){return this._map.showAllGroup}},{key:"initMainPanelEvent",value:function(e){var t=this;e.addEventListener("click",function(){t._isOpenedControl?(t._groupChange.style.display="none",t._viewModeButton.style.display="none",this.style.backgroundImage="url("+t._ctlOpt.imgURL+"more.png)"):(t._groupChange.style.display="block",t._viewModeButton.style.display="block",this.style.backgroundImage="url("+t._ctlOpt.imgURL+"less.png)"),t._isOpenedControl=!t._isOpenedControl})}},{key:"initViewModePanelEvent",value:function(e){var t=this;e.addEventListener("click",function(){t._map.viewMode===s.default.MODE_3D?(t._map.viewMode=s.default.MODE_2D,this.style.backgroundImage="url("+t._ctlOpt.imgURL+"2D.png)"):(t._map.viewMode=s.default.MODE_3D,this.style.backgroundImage="url("+t._ctlOpt.imgURL+"3D.png)")})}},{key:"setViewModeButtonPic",value:function(){this._map.viewMode===s.default.MODE_3D?this._viewModeButton.style.backgroundImage="url("+this._ctlOpt.imgURL+"3D.png)":this._viewModeButton.style.backgroundImage="url("+this._ctlOpt.imgURL+"2D.png)"}},{key:"initMultiGroupPanelEvent",value:function(e){var t=this;e.addEventListener("click",function(){t._showAllGroup?(t._map.showSingerOrMultiGroup(!1),this.style.backgroundImage="url("+t._ctlOpt.imgURL+"group.png)"):(t._map.showSingerOrMultiGroup(!0),this.style.backgroundImage="url("+t._ctlOpt.imgURL+"groups.png)"),t._showAllGroup=!t._showAllGroup})}},{key:"setSingleMultiStatus",value:function(e){this._groupChange.style.backgroundImage=e?"url("+this._ctlOpt.imgURL+"group.png)":"url("+this._ctlOpt.imgURL+"groups.png)"}},{key:"createPanel",value:function(e){var t=document.createElement("div"),n='<div class="fm-control-tool" style="z-index: 10; display: none;position: absolute; height: 42px; width: 42px; cursor: pointer; background: url(&quot;'.concat(e,'&quot;) 50% 50% no-repeat white; box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 3px; border-radius: 2px; "></div>');return t.innerHTML=n.trim(),t.firstChild}},{key:"createTopAnd3DButton",value:function(e){var t=document.createElement("div"),n='<div class="fm-control-tool-3d" style="position: absolute; display: none;height: 42px; width: 42px; padding: 0px; cursor: pointer; box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 3px; border-radius: 2px; background: url(&quot;'.concat(e,'&quot;) 50% 50% no-repeat white;"></div>');return t.innerHTML=n.trim(),t.firstChild}},{key:"createMultiAndSingerButton",value:function(e){var t=document.createElement("div"),n='<div class="fm-control-tool-group" style="position: absolute; display: none;height: 42px; width: 42px; padding: 0px; margin-top: 10px; cursor: pointer; box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 3px; border-radius: 2px; background: url(&quot;'.concat(e,'&quot;) 50% 50% no-repeat white;"></div>');return t.innerHTML=n.trim(),t.firstChild}},{key:"checkPosition",value:function(e,t,n,i,r){n.style.left="",n.style.right="",n.style.top="",n.style.bottom="";var a=0;switch(e){case u.default.LEFT_TOP:1==i?(a=1==r?62:124,n.style.left=t.x+"px",n.style.top=t.y+a+"px"):(n.style.left=t.x+"px",n.style.top=t.y+"px");break;case u.default.RIGHT_TOP:1==i?(a=1==r?62:124,n.style.right=-t.x+"px",n.style.top=t.y+a+"px"):(n.style.right=-t.x+"px",n.style.top=t.y+"px");break;case u.default.LEFT_BOTTOM:1==i?(a=1==r?-62:-124,n.style.left=t.x+"px",n.style.bottom=-t.y-a+"px"):(n.style.left=t.x+"px",n.style.bottom=-t.y+"px");break;case u.default.RIGHT_BOTTOM:1==i?(a=1==r?-62:-124,n.style.right=-t.x+"px",n.style.bottom=-t.y-a+"px"):(n.style.right=-t.x+"px",n.style.bottom=-t.y+"px");break;default:n.style.left=t.x+"px",n.style.top=t.y+"px"}}}]),n}(),c=h;t.default=c},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(2)),o=i(n(3)),s=i(n(32)),l=function(){function i(e,t,n){(0,a.default)(this,i),this._map=e,this._opt=t,this._coord=t.mapCoord,this._threeCoord=t.threeCoord,this._window=null,this.marker=n,this._content=t.content||"<span>我是气泡</span>",this._width=t.width||200,this._height=t.height||100,this._padding=t._padding||10,this.init(),this.dispose}return(0,o.default)(i,[{key:"bindMarker",value:function(e){e&&e instanceof fengmap.FMImageMarker&&(this.marker=e)}},{key:"init",value:function(){var e=this;this._window=this.createWindow(this._content,this._width,this._height,this._padding,this._opt.margintop),this._window.style.left="0px",this._window.style.top="0px",this._map.getContainer().appendChild(this._window),this._map.registeredPop(this),s.default.bindEvent(this._window,".fm-control-popmarker-closebtn","click",function(){e.close()}),this._map.updatePopPosition(this),this.dispose=function(){e._map.logoutPop(e),e._map.getContainer().removeChild(e._window)},this._map.on("dispose",this.dispose)}},{key:"close",value:function(){this._map.off("dispose",this.dispose),this._map.getContainer().removeChild(this._window),this._map.logoutPop(this),this._opt.closeCallBack&&this._opt.closeCallBack(this)}},{key:"updateCoord",value:function(e,t){var n=0;this._coord&&this._coord.height&&(n=this._coord.height),-1<navigator.userAgent.indexOf("Edge")||-1<navigator.userAgent.indexOf(".NET4.0C")?this._window.style.transform="translate(".concat(e-this._width/2,"px, ").concat(t-this._height-20-n,"px)"):this._window.style.webkitTransform="translate(".concat(e-this._width/2,"px, ").concat(t-this._height-20-n,"px)")}},{key:"createWindow",value:function(e,t,n,i,r){var a=document.createElement("div"),o='<div class="fm-control-popmarker" style="box-sizing: border-box;width: '.concat(t,"px; height: ").concat(n,"px; padding: ").concat(i,'px; background-color: rgb(255, 255, 255); border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 6px; position: absolute;">\n <input type="button" class="fm-control-popmarker-closebtn" value="✖" style="border-radius: 50%; position: absolute; right: 10px; top: 8px; background: 0px 0px rgb(238, 238, 238); width: 24px; height: 24px; border: 0px; -webkit-appearance: none;">\n <span class="fm-control-popmarker-bot" style="width: 0px; height: 0px; font-size: 0px; overflow: hidden; position: absolute; border-width: 20px; border-style: solid dashed dashed; border-color: rgba(0, 0, 0, 0.2) transparent transparent; left: ').concat(t/2-20,'px; bottom: -40px;"></span>\n <span class="fm-control-popmarker-top" style="width: 0px; height: 0px; font-size: 0px; overflow: auto; position: absolute; border-style: solid dashed dashed; border-width: 20px; border-color: rgb(255, 255, 255) transparent transparent; left: ').concat(t/2-20,'px; bottom: -39px;"></span>\n <div style="overflow:auto;height:').concat(n-2*i,"px;margin-top:").concat(r||0,'px">\n ').concat(e,"\n </div></div>");return a.innerHTML=o.trim(),a.firstChild}},{key:"coord",get:function(){return this._coord}},{key:"threeCoord",get:function(){return this._threeCoord}}]),i}(),u=l;t.default=u},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),l=i(n(16));n(22),n(79),n(10);var u=i(n(2)),h=i(n(3)),o=i(n(7)),s=i(n(8)),c=i(n(9)),d=i(n(13)),f=i(n(38)),p=i(n(124)),m=i(n(168)),v=i(n(80)),g=i(n(37)),y=n(81);function _(i){return function(){var e,t=(0,s.default)(i);if(x()){var n=(0,s.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,o.default)(this,e)}}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 b=function(e){(0,c.default)(s,e);var o=_(s);function s(e,t){var n;if((0,u.default)(this,s),n=o.call(this,0,g.default.TEXT_MARKER),n._text=e.name,n._param=e,n.isInitSprite=!1,n._opx=e.x||0,n._opy=e.y||0,n._height=e.height||0,n._renderNode=null,n._visible=!0,n._isRuning=!1,n._size=1.4*e.fontsize,n._callBack=e.callback,n._fillcolor=e.fillcolor,n._platecolor=e.platecolor,n._platestrokecolor=e.platestrokecolor,n._fontsize=e.fontsize,n._strokecolor=e.strokecolor,n._content=e.content,n.needAvoid=!1,!n._content){n.needAvoid=!0;for(var i=n._text.split("%rn%"),r=[],a=0;a<i.length;a++)r.push({text:i[a],fontsize:n._fontsize,fontcolor:n._fillcolor,strokecolor:n._strokecolor});n._content=r}return n._scale=e.scale,n._target=t,n._moveAnimater,n.picLoading=!1,n}return(0,h.default)(s,[{key:"initSprite",value:function(){var e=this.findParent(f.default);if(!e)return!1;var t=e.materialManager.createTextMaterial(this._content,(0,l.default)({alpha:1},this._param),this._param.depth);this._size=t.size,t.userData.size=t.size,this._renderNode=new p.default(t),this._renderNode.mapNode=this,this._renderNode.frustumCulled=!1,this._target?this.setTsize():e.map.renderer.setLabelSize(this._renderNode,t.size),this.isInitSprite=!0;var n=this.parent.parent.parent.mapcenter;if(this._target){var i=this._target.mapCoord;this._x=i.x,this._y=i.y}else this._opx&&this._opy?(this._x=this._opx,this._y=this._opy):(this._x=n.x,this._y=n.y);return this._height,this.setPosition(this.x,this.y,0,this._height),this._callBack&&this._callBack(),this._renderNode.visible=this.show,!0}},{key:"redraw",value:function(){var e=this.findParent(f.default);if(!e)return!1;if(this.renderNode){var t=e.materialManager.createTextMaterial(this._content,(0,l.default)({alpha:1},this._param));this.renderNode.material.map.dispose(),this.renderNode.material.dispose(),this.renderNode.material=t}}},{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(f.default);this._size=e,t.map.renderer.setLabelSize(this._renderNode,e||this._size,!!e)}},{key:"setPosition",value:function(e,t,n,i){var r=this.findParent(m.default);if(r){"number"==typeof n&&0<n&&this.moveToGroup(n);var a=r.mapcenter;this._height=i,this._x=e,this._y=t,this._renderNode.position.set(this._x-a.x,this._height,-this._y+a.y)}else 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 n=this;if(!this._isRuning){var e=this.findParent(f.default),i=t.x,r=t.y,a=new v.default({x:this.x,y:this.y},{x:i,y:r},1e3*t.time,function(){e.map.removeAnimater(a),n._moveAnimater=null,n._isRuning=!1,t.callback()},function(e){n.setPosition(e.x,e.y,0,0),t.update(e)}).start();this._isRuning=!0,e.map.addAnimater(a),this._moveAnimater=a}}},{key:"moveToGroup",value:function(e){var t=this.findParent(f.default),n=this.parent.parent.groupID;if(n!==e)if(this.parent.parent.parent.groups[""+e]){var i=this.parent.parent.parent.groups[""+e].getOrCreateLayer("textMarker");this._groupId=e,this.parent.untiedMarker(this),i.addMarker(this),t.map.renderer.setLabelSize(this._renderNode)}else console.warn(y.tileMessage.noGroup)}},{key:"stopMoveTo",value:function(){var e=this.findParent(f.default);this._moveAnimater&&this._moveAnimater.stop(),e.map.removeAnimater(this._moveAnimater)}},{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._renderNode.mapNode=void 0,this._renderNode=void 0)}},{key:"reDraw",value:function(){var e=this.findParent(f.default);if(!e)return!1;var t=e.materialManager.createLabelMaterial(this._text,(0,l.default)({alpha:1},this._param));t.userData.size=this._size,this._renderNode.material.dispose(),this._renderNode.material=void 0,this._renderNode.material=t,e.map.renderer.setLabelSize(this._renderNode,this._size)}},{key:"name",set:function(e){this._text=e,this.reDraw()},get:function(){return this._text}},{key:"renderNode",get:function(){return this._renderNode}},{key:"visible",set:function(e){e?this.parent.scene.children.indexOf(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}}]),s}(d.default),w=b;t.default=w},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6));n(53);var o=i(n(2)),s=i(n(7)),l=i(n(8)),u=i(n(9));function h(i){return function(){var e,t=(0,l.default)(i);if(c()){var n=(0,l.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,s.default)(this,e)}}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,u.default)(r,e);var i=h(r);function r(){var e;(0,o.default)(this,r),e=i.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 r}(fm.BufferGeometry),f=d;t.default=f},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),o=i(n(2)),s=i(n(3)),l=i(n(7)),u=i(n(8)),h=i(n(9)),c=i(n(454));function d(i){return function(){var e,t=(0,u.default)(i);if(f()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}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}}i(n(264)),i(n(263));var p=function(e){(0,h.default)(r,e);var i=d(r);function r(e,t){var n;return(0,o.default)(this,r),n=i.call(this,e,t),n.type="Line2",n.isLine2=!0,n}return(0,s.default)(r,[{key:"copy",value:function(){}}]),r}(c.default),m=p;t.default=m},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6));n(53);var o=i(n(2)),s=i(n(3)),l=i(n(7)),u=i(n(8)),h=i(n(9));function c(i){return function(){var e,t=(0,u.default)(i);if(d()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}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}}i(n(265));var f=function(e){(0,h.default)(r,e);var i=c(r);function r(e,t){var n;return(0,o.default)(this,r),n=i.call(this,e,t),n.type="LineSegments2",n.isLineSegments2=!0,n}return(0,s.default)(r,[{key:"computeLineDistances",value:function(){for(var e=new fm.Vector3,t=new fm.Vector3,n=this.geometry,i=n.attributes.instanceStart,r=n.attributes.instanceEnd,a=new Float32Array(2*i.data.count),o=0,s=0,l=i.data.count;o<l;o++,s+=2)e.fromBufferAttribute(i,o),t.fromBufferAttribute(r,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.addAttribute("instanceDistanceStart",new fm.InterleavedBufferAttribute(u,1,0)),n.addAttribute("instanceDistanceEnd",new fm.InterleavedBufferAttribute(u,1,1)),this}},{key:"copy",value:function(){return this}}]),r}(fm.Mesh),p=f;t.default=p},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6));n(53);var o=i(n(2)),s=i(n(3)),l=i(n(7)),u=i(n(8)),h=i(n(9)),c=i(n(13)),d=i(n(37)),m=i(n(38)),v=i(n(125)),f=i(n(30));function p(i){return function(){var e,t=(0,u.default)(i);if(g()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}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,h.default)(i,e);var n=p(i);function i(e){var t;return(0,o.default)(this,i),t=n.call(this,0,d.default.POLYGON_MARKER),t._visible=!0,t._isInitPolygon=!1,t._color=e.color||"#FF0000",t._alpha="number"==typeof e.alpha?e.alpha:1,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._dheight=e.height||0,t._lineWidth="number"==typeof e.lineWidth?e.lineWidth:2,t._points=e.points,t._renderNode,t._line,t}return(0,s.default)(i,[{key:"initPolygon",value:function(){if(!this._points)return!1;if(!this.parent)return!1;if(!this.parent.parent)return!1;var e=this.findParent(m.default);if(!e)return!1;var t={};t.resolution=new fm.Vector2(e.map.renderer.container.clientWidth,e.map.renderer.container.clientHeight);var n=e.map.renderer.getCameraByViewMode(e.map._viewMode);t.near=n.near,t.far=n.far,t.color=this._color,t.alpha=1,t.lineWidth=this._lineWidth;var i=this.parent.parent,r=new fm.MeshBasicMaterial;r.transparent=!0,r.opacity=this._alpha,r.color=new fm.Color(this._color),r.side=2,r.depthTest=!1,i.getCenterPosition();var a,o,s=i.parent.mapcenter,l=new v.default;switch(this._line=l,this._x||(this._x=s.x),this._y||(this._y=s.y),this._dheight?this._height=this._dheight:this._height=0,this._points.type){case"circle":a=this.createCircleGeometry(this._points.radius,this._points.segments),o=new Float32Array(a.attributes.position.array.length-3);for(var u=0;u<a.attributes.position.array.length;u++)2<u&&(o[u-3]=a.attributes.position.array[u]);break;case"rectangle":a=this.createReactGeometry(this._points.width,this._points.height);var h=a.attributes.position.array.length,c=a.attributes.position.array;o=new Float32Array(h+3);for(var d=0;d<h;d++)o[d]=a.attributes.position.array[d];o[h-6]=c[h-3],o[h-5]=c[h-2],o[h-4]=c[h-1],o[h-3]=c[h-6],o[h-2]=c[h-5],o[h-1]=c[h-4],o[h]=c[0],o[h+1]=c[1],o[h+2]=c[2];break;default:a=this.createPolygonGeometry(this._points,s);var f=a.attributes.position.array.length;o=new Float32Array(f+3);for(var p=0;p<f;p++)o[p]=a.attributes.position.array[p];o[f]=a.attributes.position.array[0],o[f+1]=a.attributes.position.array[1],o[f+2]=a.attributes.position.array[2]}return l.initLinePoints(o,t),this._renderNode=new fm.Mesh(a,r),this._renderNode.mapNode=this,this._renderNode.add(l.renderNode),this._renderNode.rotation.set(Math.PI/2,0,0,"XYZ"),this._renderNode.position.set(this._x-s.x,this._height,-this._y+s.y),!0}},{key:"contain",value:function(e){if(!this._points)return!1;if(!this.parent)return!1;if(!this.parent.parent)return!1;var t=this.parent.parent;switch(t.getCenterPosition(),t.parent.center,this._points.type){case"circle":var n=Math.sqrt((e.x-this._x)*(e.x-this._x)+(e.y-this._y)*(e.y-this._y));if(n<this._points.r)return!0;break;case"rectangle":if(Math.abs(e.x-this._x)<this._points.width/2&&Math.abs(e.y-this._y)<this._points.height/2)return!0;break;default:return f.default.pointInPolygon2d(this._points,e,this._points.length)}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,i=0;i<e.length;i++)0==i?n.moveTo(e[i].x-t.x,-e[i].y+t.y):n.lineTo(e[i].x-t.x,-e[i].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:"setLineWidth",value:function(e){this._renderNode.children[0].material.linewidth=e}},{key:"setAlpha",value:function(e){this._renderNode.material.opacity=e}},{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:"isInitPolygon",get:function(){return this._isInitPolygon}},{key:"renderNode",get:function(){return this._renderNode}},{key:"visible",get:function(){return this._visible}}]),i}(c.default),_=y;t.default=_},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6));n(10),n(170),n(79);var o=i(n(2)),s=i(n(3)),l=i(n(7)),u=i(n(8)),h=i(n(9)),c=i(n(13)),d=i(n(38));function f(i){return function(){var e,t=(0,u.default)(i);if(p()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}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,h.default)(i,e);var n=f(i);function i(e){var t;return(0,o.default)(this,i),t=n.call(this,e),t._visible=!0,t.x=e.x,t.y=e.y,t.domContent=e.domContent,t.fontSize=e.fontsize,t._id=null,t.anchor=e.anchor,t.domWidth=e.domWidth,t.domHeight=e.domHeight,t.height=e.height,t._param=e,t.alpha=e.alpha,t}return(0,s.default)(i,[{key:"initDom",value:function(e){var t=this.findParent(d.default);if(t){var n=document.createElement("div"),i=t._map.renderer.renderer.domElement.parentNode;i.style.position="absolute",i.appendChild(n);var r=null;r=e.height?e.height+this.parent.height:this.parent.height;var a=t._map.coordMapToScreen(e.x,e.y,r);n.name="domMarker",n.id=e.id,n.setAttribute("class","domMarker"),this._id=e.id,n.style.fontSize=e.fontSize,n.innerHTML=e.domContent,n.style.width=e.domWidth+"px",n.style.height=e.domHeight+"px",n.style.left=this._anchor(e,a).left,n.style.top=this._anchor(e,a).top,n.style.position="absolute"}}},{key:"_anchor",value:function(e,t){var n=null,i=null;switch(e.anchor){case 9:n=t.x-e.domWidth/2+"px",i=t.y-e.domHeight/2+"px";break;case 5:n=t.x+"px",i=t.y+"px";break;case 6:n=t.x-e.domWidth+"px",i=t.y+"px";break;case 7:n=t.x+"px",i=t.y-e.domHeight+"px";break;case 8:n=t.x-e.domWidth+"px",i=t.y-e.domHeight+"px";break;case 1:n=t.x+"px",i=t.y-e.domHeight/2+"px";break;case 2:n=t.x-e.domWidth+"px",i=t.y-e.domHeight/2+"px";break;case 3:n=t.x-e.domWidth/2+"px",i=t.y+"px";break;case 4:n=t.x-e.domWidth/2+"px",i=t.y-e.domHeight+"px";break;default:n=t.x-e.domWidth/2+"px",i=t.y-e.domHeight/2+"px"}return{left:n,top:i}}},{key:"show",get:function(){return this.show},set:function(e){this._visible=e;var t=document.getElementById(this._id);t&&(t.style.display=e?"block":"none")}}]),i}(c.default),v=m;t.default=v},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(10),n(123);var l=i(n(24)),s=i(n(28));function a(e,t){this.map_=e,this.texture_=null,this.config(t)}a.create=function(e,t){return new a(e,t)},a.prototype={getDeviceDPI:function(){var e=new Array;if(null!=window.screen.deviceXDPI)e[0]=window.screen.deviceXDPI,e[1]=window.screen.deviceYDPI;else{var t=document.createElement("DIV");t.style.cssText="width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden",document.body.appendChild(t),e[0]=(0,s.default)(t.offsetWidth),e[1]=(0,s.default)(t.offsetHeight),t.parentNode.removeChild(t)}return e},getDeviceWH:function(e){e=e||{};var t=this.map_.maxX-this.map_.minX,n=this.map_.maxY-this.map_.minY,i={w:Math.round(t),h:Math.round(n)},r=this.getDeviceDPI();i.w=(0,s.default)(i.w*r[0]/25.4),i.h=(0,s.default)(i.h*r[1]/25.4);var a=1,o=e.maxSize||2048;return(i.w>=o||i.h>=o)&&(i.w>=i.h?(a=i.h/i.w,i.w=o,i.h=(0,s.default)(o*a)):(a=i.w/i.h,i.h=o,i.w=(0,s.default)(o*a))),i},getPixXY:function(e,t){var n=(e-this.map_.minX)/(this.map_.maxX-this.map_.minX),i=(this.map_.maxY-t)/(this.map_.maxY-this.map_.minY),r={x:n,y:i};return r.x=r.x*this.options.width,r.y=r.y*this.options.height,r},config:function(e){var t=this,n=t.getDeviceWH(e),i=n.w,r=n.h;t.options={width:i,height:r,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};var a=document.createElement("canvas"),o=a.getContext("2d");a.width=i,a.height=r,t.options.ctx=o,t.options.canvas=a},renderShadow:function(e,t,n,i){var r=this,a=r.options.ctx,o=(r.options.radius,r.options.boundVal),s=(0,l.default)(n/r.options.points.max,10);a.shadowColor="rgba(0, 0, 0, "+s+")",a.shadowOffsetX=o,a.shadowOffsetY=o,a.shadowBlur=r.options.shadowBlur,a.beginPath(),a.arc(e-o,t-o,r.options.radius,0,2*Math.PI,!0),a.closePath(),a.fill(),i||r.cachePoint(e,t,n)},colorize:function(){for(var e=this,t=e.options.width,n=e.options.height,i=e.options.ctx,r=i.getImageData(0,0,t,n),a=r.data,o=a.length,s=e.getPalette(),l=e.options.opacity,u=3;u<o;u+=4){var h=a[u],c=4*h;if(c){c=Math.floor(c);var d=l<h?l:h;d<.8&&(d=.8),a[u-3]=s[c],a[u-2]=s[c+1],a[u-1]=s[c+2],a[u]=d}}i.putImageData(r,0,0)},renderToMap:function(e){var t=this,n=t.options.canvas,i=new fm.Texture(n);this.setTexture(e,i)},disposeHeatMap:function(e){if(e){var t=this.map_.getFMGroup(e).getExtentMeshs()[0];if(t._hasHeatMap)if(t._hasHeatMap=!1,t.material.map&&t.material.map.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"));else{var n=this.map_.getFMGroup(e).getModelMeshs();this.map_.getFMGroup(e)._layers.model[0]._scene.traverse(function(e){"heatmap"==e.name&&e.parent.remove(e)}),n.forEach(function(e){if("MultiMaterial"==e.material.type)for(var t=e.material.materials.length,n=0,i=3;n<t;){var r=e.material.materials[n];r.map=null,r.mapMixColor=!1,r.transparent=!0,r.needsUpdate=!0,i=0==n?3:2,n+=i}else r=e.material,r.map=null,r.mapMixColor=!1,r.transparent=!0,r.needsUpdate=!0})}}},getPalette:function(){var e=document.createElement("canvas"),t=e.getContext("2d");e.width=1,e.height=256;var n=this,i=n.options.gradient,r=t.createLinearGradient(0,0,1,256);for(var a in i)r.addColorStop(a,i[a]);return t.fillStyle=r,t.fillRect(0,0,1,256),t.getImageData(0,0,1,256).data}},a.prototype.cachePoint=function(e,t,n){var i=this,r=i.options.points,a=r.data;n>r.max&&(r.max=n),a.push([e,t,n])},a.prototype.clearPoints=function(){this.options.points.data=[],this.clear()},a.prototype.addPoint=function(e,t,n){if(e&&t&&n){var i=this.getPixXY(e,t);if(i){var r=this;r.clear();for(var a=r.options.points.data,o=a.length,s=0;s<o;s++)r.renderShadow(a[s][0],a[s][1],a[s][2],!0);r.renderShadow(i.x,i.y,n,!1),r.colorize()}}},a.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)},a.prototype.setTexture=function(e,l){var t=this.map_.getFMGroup(e).getExtentMeshs()[0];t._hasHeatMap&&this.disposeHeatMap(e);var n=t.material.color;if(this.options.isHeatPlan){t._hasHeatMap=!0,t.material.map=l,t.material.map.needsUpdate=!0,t.material.needsUpdate=!0;var i=t.clone();i.name="heatMap",i.material.transparent=!0,i.material.color=new fm.Color(16777215),i.material.depthTest=!1,i.renderOrder=12,i.material.needsUpdate=!0,i.scale.z=.001,this.options.heatHeight?i.position.y+=this.options.heatHeight:i.position.y+=4,t.material=new fm.MeshLambertMaterial({color:n}),this.map_.getFMGroup(e)._layers.model[0]._scene.getObjectByName("directionalLight").add(i)}else{t._hasHeatMap=!0,t.material.mapMixColor=!0,t.material.map=l,t.material.map.needsUpdate=!0,t.material.needsUpdate=!0;var 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!==e.children[t].material.map&&void 0!==e.children[t].material.map){var n=e.geometry,i=e.material;i.opacity=.8,i.needsUpdate=!0;var r=new fm.MeshLambertMaterial({map:l,transparent:!0,blending:fm.CustomBlending,blendEquation:fm.AddEquation,blendSrc:fm.SrcAlphaFactor,blendDst:fm.OneMinusSrcAlphaFactor});r.opacity=.9;var a=[i,r],o=new fm.Group;for(t=0;t<a.length;t++)o.add(new fm.Mesh(n,a[t]));var s=new fm.Mesh(n,r);s.name="heatmap",s.renderOrder=11,s.material.depthTest=!1,s.material.depthWrite=!1,e.add(s)}}),r.forEach(function(e){if("MultiMaterial"==e.material.type)for(var t=e.material.materials.length,n=0,i=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),e.material.materials[n].map.needsUpdate=!0,e.material.materials[n].needsUpdate=!0,i=0==n?3:2,n+=i;else e.material.mapMixColor=!0,e.material.map=l,e.material._color=e.material.color.clone(),1===e.material.opacity&&(e.material.transparent=!1),e.material.map.needsUpdate=!0,e.material.needsUpdate=!0})}},a.prototype.setModelMeshTexture=function(e){if(e&&texture_)if("MultiMaterial"==e.material.type)for(var t=e.material.materials.length,n=0,i=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,e.material.materials[n].map.needsUpdate=!0,e.material.materials[n].needsUpdate=!0,i=0==n?3:2,n+=i;else e.material.map=texture_,e.material._color=e.material.color.clone(),e.material.color=new fm.Color(16777215),e.material.transparent=!1,e.material.map.needsUpdate=!0,e.material.needsUpdate=!0},a.prototype.clear=function(){var e=this.options.ctx;e.clearRect(0,0,this.options.width,this.options.height)},a.prototype.addPoints=function(e){var t=this;t.clear();for(var n=t.options.points.data,i=n.length,r=0;r<i;r++)t.renderShadow(n[r][0],n[r][1],n[r][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()},a.prototype.randomPoints=function(e){var t=this,n=t.options.width,i=t.options.height,r=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()*i+1),l=Math.floor(Math.random()*r+1);t.renderShadow(o,s,l)}t.colorize()};var o=a;t.default=o},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(2)),o=i(n(3)),s=(i(n(266)),i(n(459))),l=i(n(460)),u=i(n(461)),h=i(n(463)),c=i(n(464)),d=function(){function n(e,t){(0,a.default)(this,n),this._data=t||e.getCurrDecodeData(),this._map=e,this.Graphics=fengmap.Graphics,this.DataManager=new fengmap.inner.DataManager,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;return n=e.queryTypes?this.getQueryResult(e,e.queryTypes,this._map):e.circle?this.getQueryResult(e,["SINGLE","CIRCLE"],this._map):this.getQueryResult(e,["SINGLE"],this._map),t(n),n}},{key:"getQueryResult",value:function(e,t,n){for(var i=[],r=null,a=0;a<t.length;a++)switch(t[a]){case"SINGLE":i.push(this.singleAttrQuery.query(e));break;case"MULTI":i.push(this.multiAttrQuery.query(e));break;case"BUFFER":i.push(this.bufferQuery.query(e,n));break;case"CIRCLE":r=this.circleQuery.query(i,e,n),i=[],i.push(r);break;case"POLYGON":r=this.polygonQuery.query(i,e,n),i=[],i.push(r);break;default:i.push(this.singleAttrQuery.query(e))}var o=this.duplicateCheck(i);return o}},{key:"duplicateCheck",value:function(e){return e[0]}}]),n}(),f=d;t.default=f},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var s=i(n(19)),l=i(n(12)),u=i(n(18)),h=i(n(17)),a=i(n(15));n(5),n(4);var o=i(n(6));n(10);var p=i(n(24));n(22);var c=i(n(29)),d=i(n(2)),f=i(n(3)),m=i(n(7)),v=i(n(8)),g=i(n(9)),y=i(n(267));function _(e){if(void 0===h.default||null==e[u.default]){if((0,l.default)(e)||(e=x(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}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 i,r,a=!0,o=!1;return{s:function(){i=(0,s.default)(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw r}}}}function x(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function w(i){return function(){var e,t=(0,v.default)(i);if(M()){var n=(0,v.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,m.default)(this,e)}}function M(){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}}var T=function(e){(0,g.default)(r,e);var i=w(r);function r(e,t){var n;return(0,d.default)(this,r),n=i.call(this,e),n._map=t,n}return(0,f.default)(r,[{key:"query",value:function(e){var t=[],n=e.groupID;n&&"number"==typeof n&&(n=[n]);var i,r=_(this._data.floors);try{for(r.s();!(i=r.n()).done;){var a=i.value;(!n||-1<n.indexOf(a.gid))&&t.push.apply(t,(0,c.default)(this.queryGroup(a,e)))}}catch(e){r.e(e)}finally{r.f()}return t}},{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,i){var r=null,a=.1,o=.1;o=1===d?(r=i.geo.substring(6,i.geo.length-1).split(" "),a=(0,p.default)(r[0]),(0,p.default)(r[1])):(r=i.pts,a=r[0],r[1]);var s=t.height,l={};u.gid,c.check(e,t,h,n,i.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,gdata:t,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,i){var r=null,a=0,o=0;o=1===d?(r=i.geo.substring(6,i.geo.length-1).split(" "),a=(0,p.default)(r[0]),(0,p.default)(r[1])):(r=i.pts,a=r[0],r[1]);var s=t.height,l={};c.check(e,t,h,n,i.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,gdata:t,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 i=null,r=0,a=0;a=1===d?(i=t.geo.substring(6,t.geo.length-1).split(" "),r=(0,p.default)(i[0]),(0,p.default)(i[1])):(i=t.pts,r=i[0],i[1]);var 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:fengmap.FMNodeType.FACILITY,gdata:t,target:c._map.getFMGroup(u.gid).getNodeByLayerId("facility",e.eid),mapCoord:{x:r,y:a,z:o}})}),e!==fengmap.FMNodeType.LABEL&&e!==fengmap.FMNodeType.ALL||this.everyLabel(u,function(e,t,n){var i=null,r=0,a=0;a=1===d?(i=t.geo.substring(6,t.geo.length-1).split(" "),r=(0,p.default)(i[0]),(0,p.default)(i[1])):(i=t.pts,r=i[0],i[1]);var 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:fengmap.FMNodeType.LABEL,gdata:t,target:c._map.getFMGroup(u.gid).getNodeByLayerId("label",e.eid),mapCoord:{x:r,y:a,z:o}})}),f}}]),r}(y.default),E=T;t.default=E},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var s=i(n(19)),l=i(n(12)),u=i(n(18)),h=i(n(17)),a=i(n(15));n(5),n(4);var o=i(n(6));n(34),n(10);var p=i(n(24));n(22);var c=i(n(29)),d=i(n(2)),f=i(n(3)),m=i(n(7)),v=i(n(8)),g=i(n(9)),y=i(n(267));function _(e){if(void 0===h.default||null==e[u.default]){if((0,l.default)(e)||(e=x(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}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 i,r,a=!0,o=!1;return{s:function(){i=(0,s.default)(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw r}}}}function x(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function w(i){return function(){var e,t=(0,v.default)(i);if(M()){var n=(0,v.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,m.default)(this,e)}}function M(){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}}var T=function(e){(0,g.default)(r,e);var i=w(r);function r(e,t){var n;return(0,d.default)(this,r),n=i.call(this,e),n._map=t,n}return(0,f.default)(r,[{key:"query",value:function(e){if(e.pathPoints){var t=this.distanceSorting(e.groupID,e.pathPoints,e.startPoint,e.bufferRadius);return t}var n=[],i=e.groupID;i&&"number"==typeof i&&(i=[i]),this._data;var r,a=_(this._data.floors);try{for(a.s();!(r=a.n()).done;){var o=r.value;(!i||-1<i.indexOf(o.gid))&&n.push.apply(n,(0,c.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,i){var r=null,a=.1,o=.1;o=1===d?(r=i.geo.substring(6,i.geo.length-1).split(" "),a=(0,p.default)(r[0]),(0,p.default)(r[1])):(r=i.pts,a=r[0],r[1]);var s=t.height,l={};c.check(e,t,h,n,i.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,i){var r=null,a=0,o=0;o=1===d?(r=i.geo.substring(6,i.geo.length-1).split(" "),a=(0,p.default)(r[0]),(0,p.default)(r[1])):(r=i.pts,a=r[0],r[1]);var s=t.height,l={};c.check(e,t,h,n,i.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 i=null,r=0,a=0;a=1===d?(i=t.geo.substring(6,t.geo.length-1).split(" "),r=(0,p.default)(i[0]),(0,p.default)(i[1])):(i=t.pts,r=i[0],i[1]);var 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:r,y:a,z:o}})}),e!==fengmap.FMNodeType.LABEL&&e!==fengmap.FMNodeType.ALL||this.everyLabel(u,function(e,t,n){var i=null,r=0,a=0;a=1===d?(i=t.geo.substring(6,t.geo.length-1).split(" "),r=(0,p.default)(i[0]),(0,p.default)(i[1])):(i=t.pts,r=i[0],i[1]);var 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:r,y:a,z:o}})}),(h.circle||h.polygon)&&f.sort(function(e,t){return"number"==typeof e.distance&&"number"==typeof t.distance?e.distance-t.distance:0}),f}}]),r}(y.default),E=T;t.default=E},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),o=i(n(2)),s=i(n(3)),l=i(n(7)),u=i(n(8)),h=i(n(9)),c=i(n(462));function d(i){return function(){var e,t=(0,u.default)(i);if(f()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}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)(i,e);var n=d(i);function i(e){var t;return(0,o.default)(this,i),t=n.call(this,e),t._map=null,t}return(0,s.default)(i,[{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 i=[];i.push(e[n].x),i.push(e[n].y),e.splice(n,1,i)}var r=geotool.straightenPoints(e),a=geotool.polylineSegBuffers(r,t);return a}},{key:"_BMIntersect",value:function(e,t,n){for(var i=0;i<n.length;i++){var r=[];r.push(n[i].x+e.x),r.push(n[i].y+e.y),n.splice(i,1,r)}var a=geotool.isSegBuffersIntersecots(t,n);return a}},{key:"_BFIntersect",value:function(e,t,n){var i=[n.x+e.x,n.y+e.y],r=geotool.isSegBuffersIntersecots(t,i);return r}},{key:"distanceSorting",value:function(e,t,n,i){var r=map.getFMGroup(e).mapCoord,a=[],o=[],s=[],l=[],u=[],h=[],c=this._map.nodeManager.getGroupAllModel(this._map._currentSceneId,e),d=this._map.nodeManager.getGroupAllFacility(this._map._currentSceneId,e),f=this._calcBuffer(t,i);for(var p in c){var m=c[p]._renderNode.children[0].geometry.vertices.concat(),v=this._BMIntersect(r,f,m);if(v){s.push(c[p]);var g={model:m,fid:c[p].FID,target:s[s.length-1]};a.push(g)}}for(var y in d){var _=d[y]._renderNode.position.clone(),x=this._BFIntersect(r,f,_);if(x){l.push(c[y]);var b={facility:_,fid:d[y].FID,target:l[l.length-1]};o.push(b)}}for(var w=0;w<a.length;w++){var M=a[w].model,T=geotool.distPointToPolygon([n.x,n.y],M),E={distance:T,fid:a[w].fid,target:s[w]};u.push(E)}for(var S=0;S<o.length;S++){var A=o[S].facility,L=Math.sqrt(Math.pow(n.x-A.x,2)+Math.pow(n.y-A.y,2)),I={distance:L,fid:o[S].fid,target:l[S]};h.push(I)}return this._quickSort(u,0,u.length-1),this._quickSort(h,0,h.length-1),a=null,o=null,s=null,l=null,{model:u,facility:h}}},{key:"_quickSort",value:function(e,t,n){for(var i=[[t,n]];0<i.length;){var r=i.pop();if(!(r[0]>=r[1])){for(var a=r[0],o=r[1],s=r[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}i.push([r[0],s-1]),i.push([s+1,r[1]])}}}}]),i}(c.default),m=p;t.default=m},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),o=i(n(2)),s=i(n(7)),l=i(n(8)),u=i(n(9)),h=i(n(268));function c(i){return function(){var e,t=(0,l.default)(i);if(d()){var n=(0,l.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,s.default)(this,e)}}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,u.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 i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),x=i(n(24));n(22);var o=i(n(2)),s=i(n(3)),l=i(n(7)),u=i(n(8)),h=i(n(9)),c=i(n(269));function d(i){return function(){var e,t=(0,u.default)(i);if(f()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}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)(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 i=t.circle,r=[],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=null,u=0,h=0;if(1===a){var c=s.geo;l=c.substring(6,c.length-1).split(" "),u=(0,x.default)(l[0]),h=(0,x.default)(l[1])}else l=s.pts,u=l[0],h=l[1];var d=i.center,f=Math.sqrt((u-d.x)*(u-d.x)+(h-d.y)*(h-d.y));if(f<i.radius)e[0][o].distance=f,r.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;if(p=this.Graphics.pointDistanceToLine(d,{x:m[_],y:m[_+1]},{x:m[_+2],y:m[_+3]},{}),p<i.radius){e[0][o].distance=f,r.push(e[0][o]);continue e}}if(this.Graphics.pointInPolygonVector2d(m,d,m.length)){e[0][o].distance=f,r.push(e[0][o]);continue}}}return r}}]),n}(c.default),m=p;t.default=m},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),f=i(n(24));n(22);var o=i(n(2)),s=i(n(3)),l=i(n(7)),u=i(n(8)),h=i(n(9)),p=i(n(465)),c=i(n(269));function d(i){return function(){var e,t=(0,u.default)(i);if(m()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}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=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 i=this._data.scene.file_ver,r=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=null,u=null;if(1===i){var h=s.geo;l=h.substring(6,h.length-1).split(" "),u={x:(0,f.default)(l[0]),y:(0,f.default)(l[1])}}else l=s.pts,u={x:(0,f.default)(l[0]),y:(0,f.default)(l[1])};if(r.contain(u))e[0][o].distance=r.distanceToPoint(u),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),r.containXYArray(c)){e[0][o].distance=r.distanceToPoint(u),a.push(e[0][o]);continue}}}return a}}]),n}(c.default),g=v;t.default=g},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(2)),o=i(n(3)),s=i(n(466)),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=[],i=!1,r=0;r<t;r++){var a=2*r,o={x:e[a],y:e[a+1]};if(this.contain(o)){i=!0;break}n.push(o)}if(i)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])){i=!0;break}return!!i}},{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 i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(45);var a=i(n(2)),o=i(n(3)),s=function(){function i(e){if((0,a.default)(this,i),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)(i,[{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)}}]),i}(),l=s;t.default=l},function(e,t,n){"use strict";var i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var r={Left:0,Center:1,Right:2},a=r;t.default=a},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(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 i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(2)),o=i(n(3)),s=function(){function i(e,t,n){(0,a.default)(this,i),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)(i,[{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},i={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 i}},{key:"_getVectorLen",value:function(e){return Math.sqrt(e.x*e.x+e.y*e.y)}}]),i}(),l=s;t.default=l},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.Matrix4=v;var c,d,a,o,s,l,u,h,f,p=i(n(16)),m=n(270);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,i,r,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]=i,v[1]=r,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,i=1/f.setFromMatrixColumn(e,0).length(),r=1/f.setFromMatrixColumn(e,1).length(),a=1/f.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,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=this.elements,n=e.x,i=e.y,r=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(i),l=Math.sin(i),u=Math.cos(r),h=Math.sin(r);if("XYZ"===e.order){var c=a*u,d=a*h,f=o*u,p=o*h;t[0]=s*u,t[4]=-s*h,t[8]=l,t[1]=d+f*l,t[5]=c-p*l,t[9]=-o*s,t[2]=p-c*l,t[6]=f+d*l,t[10]=a*s}else if("YXZ"===e.order){var m=s*u,v=s*h,g=l*u,y=l*h;t[0]=m+y*o,t[4]=g*o-v,t[8]=a*l,t[1]=a*h,t[5]=a*u,t[9]=-o,t[2]=v*o-g,t[6]=y+m*o,t[10]=a*s}else if("ZXY"===e.order)m=s*u,v=s*h,g=l*u,y=l*h,t[0]=m-y*o,t[4]=-a*h,t[8]=g+v*o,t[1]=v+g*o,t[5]=a*u,t[9]=y-m*o,t[2]=-a*l,t[6]=o,t[10]=a*s;else if("ZYX"===e.order)c=a*u,d=a*h,f=o*u,p=o*h,t[0]=s*u,t[4]=f*l-d,t[8]=c*l+p,t[1]=s*h,t[5]=p*l+c,t[9]=d*l-f,t[2]=-l,t[6]=o*s,t[10]=a*s;else if("YZX"===e.order){var _=a*s,x=a*l,b=o*s,w=o*l;t[0]=s*u,t[4]=w-_*h,t[8]=b*h+x,t[1]=h,t[5]=a*u,t[9]=-o*u,t[2]=-l*u,t[6]=x*h+b,t[10]=_-w*h}else"XZY"===e.order&&(_=a*s,x=a*l,b=o*s,w=o*l,t[0]=s*u,t[4]=-h,t[8]=l*u,t[1]=_*h+w,t[5]=a*u,t[9]=x*h-b,t[2]=b*h-x,t[6]=o*u,t[10]=w*h+_);return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[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 i=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),i[0]=o.x,i[4]=s.x,i[8]=l.x,i[1]=o.y,i[5]=s.y,i[9]=l.y,i[2]=o.z,i[6]=s.z,i[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,i=t.elements,r=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],b=i[0],w=i[4],M=i[8],T=i[12],E=i[1],S=i[5],A=i[9],L=i[13],I=i[2],k=i[6],R=i[10],N=i[14],P=i[3],C=i[7],D=i[11],O=i[15];return r[0]=a*b+o*E+s*I+l*P,r[4]=a*w+o*S+s*k+l*C,r[8]=a*M+o*A+s*R+l*D,r[12]=a*T+o*L+s*N+l*O,r[1]=u*b+h*E+c*I+d*P,r[5]=u*w+h*S+c*k+d*C,r[9]=u*M+h*A+c*R+d*D,r[13]=u*T+h*L+c*N+d*O,r[2]=f*b+p*E+m*I+v*P,r[6]=f*w+p*S+m*k+v*C,r[10]=f*M+p*A+m*R+v*D,r[14]=f*T+p*L+m*N+v*O,r[3]=g*b+y*E+_*I+x*P,r[7]=g*w+y*S+_*k+x*C,r[11]=g*M+y*A+_*R+x*D,r[15]=g*T+y*L+_*N+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],i=e[8],r=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*(r*s*h-i*l*h-r*o*c+n*l*c+i*o*d-n*s*d)+p*(t*s*d-t*l*c+r*a*c-i*a*d+i*l*u-r*s*u)+m*(t*l*h-t*o*d-r*a*h+n*a*d+r*o*u-n*l*u)+v*(-i*o*u-t*s*h+t*o*c+i*a*h-n*a*c+n*s*u)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(e,t,n){var i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this},getInverse:function(e,t){var n=this.elements,i=e.elements,r=i[0],a=i[1],o=i[2],s=i[3],l=i[4],u=i[5],h=i[6],c=i[7],d=i[8],f=i[9],p=i[10],m=i[11],v=i[12],g=i[13],y=i[14],_=i[15],x=f*y*c-g*p*c+g*h*m-u*y*m-f*h*_+u*p*_,b=v*p*c-d*y*c-v*h*m+l*y*m+d*h*_-l*p*_,w=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=r*x+a*b+o*w+s*M;if(0===T){var E="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(E);return console.warn(E),this.identity()}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]=b*S,n[5]=(d*y*s-v*p*s+v*o*m-r*y*m-d*o*_+r*p*_)*S,n[6]=(v*h*s-l*y*s-v*o*c+r*y*c+l*o*_-r*h*_)*S,n[7]=(l*p*s-d*h*s+d*o*c-r*p*c-l*o*m+r*h*m)*S,n[8]=w*S,n[9]=(v*f*s-d*g*s-v*a*m+r*g*m+d*a*_-r*f*_)*S,n[10]=(l*g*s-v*u*s+v*a*c-r*g*c-l*a*_+r*u*_)*S,n[11]=(d*u*s-l*f*s-d*a*c+r*f*c+l*a*m-r*u*m)*S,n[12]=M*S,n[13]=(d*g*o-v*f*o+v*a*p-r*g*p-d*a*y+r*f*y)*S,n[14]=(v*u*o-l*g*o-v*a*h+r*g*h+l*a*y-r*u*y)*S,n[15]=(l*f*o-d*u*o+d*a*h-r*f*h-l*a*p+r*u*p)*S,this},scale:function(e){var t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,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],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))},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),i=Math.sin(t),r=1-n,a=e.x,o=e.y,s=e.z,l=r*a,u=r*o;return this.set(l*a+n,l*o-i*s,l*s+i*o,0,l*o+i*s,u*o+n,u*s-i*a,0,l*s-i*o,u*s+i*a,r*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 i=this.elements,r=t._x,a=t._y,o=t._z,s=t._w,l=r+r,u=a+a,h=o+o,c=r*l,d=r*u,f=r*h,p=a*u,m=a*h,v=o*h,g=s*l,y=s*u,_=s*h,x=n.x,b=n.y,w=n.z;return i[0]=(1-(p+v))*x,i[1]=(d+_)*x,i[2]=(f-y)*x,i[3]=0,i[4]=(d-_)*b,i[5]=(1-(c+v))*b,i[6]=(m+g)*b,i[7]=0,i[8]=(f+y)*w,i[9]=(m-g)*w,i[10]=(1-(c+p))*w,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},decompose:(c=new m.Vector3,d=new v,function(e,t,n){var i=this.elements,r=c.set(i[0],i[1],i[2]).length(),a=c.set(i[4],i[5],i[6]).length(),o=c.set(i[8],i[9],i[10]).length(),s=this.determinant();s<0&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],d.copy(this);var l=1/r,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=r,n.y=a,n.z=o,this}),makePerspective:function(e,t,n,i,r,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*r/(t-e),l=2*r/(n-i),u=(t+e)/(t-e),h=(n+i)/(n-i),c=-(a+r)/(a-r),d=-2*a*r/(a-r);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,i,r,a){var o=this.elements,s=1/(t-e),l=1/(n-i),u=1/(a-r),h=(t+e)*s,c=(n+i)*l,d=(a+r)*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,i=0;i<16;i++)if(t[i]!==n[i])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 i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6));n(44);var u=i(n(472));n(45);var g=i(n(16)),o=i(n(2)),s=i(n(3)),l=i(n(165)),h=i(n(7)),c=i(n(8)),d=i(n(9)),f=i(n(475));n(477),n(491);var C=i(n(30)),p=i(n(126)),m=i(n(82)),v=i(n(98)),y=i(n(83)),_=i(n(171)),D=i(n(59)),x=i(n(32)),b=i(n(259)),w=i(n(125)),M=i(n(261)),T=i(n(66));function E(i){return function(){var e,t=(0,c.default)(i);if(S()){var n=(0,c.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,h.default)(this,e)}}function S(){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 A=function(e){(0,d.default)(i,e);var n=E(i);function i(e){var t;return(0,o.default)(this,i),t=n.call(this),e.map&&e.scaleLevel&&!e.scale&&(e.scale=e.map.mapScaleLevels[e.scaleLevel]),e.map&&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=T.default.ZH,t.naviMode=m.default.MODULE_SHORTEST,t.naviPriority=v.default.PRIORITY_DEFAULT,t.autoRoute=!0,t.autoClearNaviLine=!0,t.lineStyle={lineWidth:10,radius:.5,dash:{size:4,gap:2}},(0,g.default)((0,l.default)(t),e),t._init(),t}return(0,s.default)(i,[{key:"_init",value:function(){this.map&&(this._analyser=new fengmap.FMNaviAnalyser,this._analyser.init(this.map),this._naviDescriptionsCalculator=new f.default({map:this.map,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}},{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 i=(0,g.default)({},t);i.map||(i.map=this._map,i.analyser=this);var r=new f.default(i),a=r.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=e.toLowerCase();if(t!=T.default.ZH&&t!=T.default.EN)return!1;if(this.naviLanguage!=t&&(this.naviLanguage=t,this._naviDescriptionsCalculator&&(this._naviDescriptionsCalculator.naviLanguage=t),0<this._naviResults.length)){var n=this._naviDescriptionsCalculator.calculate(this._naviResults);this._naviDescriptions=n[0],this._naviDescriptionsData=n[1]}return!0}},{key:"setStartPoint",value:function(e,t){this._startData=(0,g.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){this._endData=(0,g.default)({},this._endData,e,{x:e.x,y:e.y,groupID:e.groupID});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){if(this._startData&&this._endData){var t={index:-1,coord:{groupID:e.groupID},angle:null,distance:Number.MAX_VALUE,distanceToNext:Number.MAX_VALUE,remain:this._naviDistance},n=this._analyse().map(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 r=i.queryContainExtentId(e),a={},o=1;o<n.length;o++){var s=n[o-1],l=n[o];if(s.groupID===e.groupID&&l.groupID===e.groupID&&r==i.queryContainExtentId(s)){var u=C.default.pointDistanceToLine(e,s,l,a);u<t.distance&&(t.distance=u,(0,g.default)(t.coord,a),t.angle=this._getRouteAngle(s,l),t.index=s.index,t.distanceToNext=C.default.distanceOfTwoPoints(a,l))}}if(-1==t.index)for(var h=0;h<n.length;h++){var c=n[h];if(c.groupID==e.groupID&&r==i.queryContainExtentId(c)){var d=C.default.distanceOfTwoPoints(e,c);d<t.distance&&(t.distance=d,(0,g.default)(t.coord,c),t.index=c.index,t.distanceToNext=0,n[h+1]&&n[h+1].groupID==e.groupID&&(t.distanceToNext=C.default.distanceOfTwoPoints(e,n[h+1])))}}if(-1!=t.index){for(var f=0,p=n.length-1;p>t.index;p--)if(p-1>t.index){var m=n[p],v=n[p-1];m.groupID==v.groupID&&(f+=C.default.distanceOfTwoPoints(m,v))}n[t.index+1]&&n[t.index+1].groupID==t.coord.groupID&&(f+=C.default.distanceOfTwoPoints(n[t.index+1],t.coord)),t.remain=f}return t}}}},{key:"pathConstraint",value:function(e){return this._analyser?this._analyser.pathConstraint(e):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:"locateWalking",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&&(n.coord.height=this.locationMarkerHeight,this._locationMarker.setPosition(n.coord),t?this._locationMarker.rotate(t):this._locationMarker.rotate(n.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&&(this.map.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.clearNaviLine(),this._naviLineMarker=this._drawLines(this._naviResults),this._naviLineMarker}},{key:"clearNaviLine",value:function(){this._naviLineMarker&&(this.map.removeLineMarker(this._naviLineMarker),this._naviLineMarker=null)}},{key:"clearNaviLines",value:function(){this.clearNaviLine()}},{key:"focusNaviLineSegment",value:function(e,t){var n,i,r=this,a=null,o=null,s=null;if(this._naviDescriptionsData&&e<this._naviDescriptionsData.length){var l=this._naviDescriptionsData[e];o=l.startPoint,s=l.endPoint,s=s||o,n=l.startGID,i=l.endGID,o.z=this.map.getFMGroup(n).height,s.z=this.map.getFMGroup(i).height,a={x:(o.x+s.x)/2,y:(o.y+s.y)/2,z:s.z}}a&&(t=t||{},t.rawLevel=!0,this._moveTo({x:a.x,y:a.y,groupID:i},this._getValueOrDefault(t,"time","duration",this.inTime),null,function(){if(o&&s){var e=r.map.getScaleValueByVectics(o,s);!(0,u.default)(e)&&0<e&&(e*=t.extendScale||r.extendScale,r._scaleTo(e,r._getValueOrDefault(t,"time","duration",r.inTime),null,t.callback))}}))}},{key:"clearAll",value:function(){this.clearMarkers(),this.clearNaviLine(),this.clearLocationMarker()}},{key:"simulate",value:function(e){var t=this;if(this._startData&&this._endData&&0!=this._naviResults.length){var n=e||{};this._simulateParams=(0,g.default)({},n);var i=n.inTime||this.inTime;n.scale=n.scale||this.scale||0,this._locationMarker||this._initLocationMarker(),this._locationMarkerToStartPoint(),this._needDrawLines&&this.drawNaviLine(),this.followPosition?this._focusGroupToAnimater=this._focusGroupTo(this._startData.groupID,i,null,function(){t._moveToAnimater=t._moveTo(t._startData,i,null,function(){var e=n.scale<t.minScale?t.minScale:n.scale;t.changeTiltAngle?t._tiltToAnimater=t._tiltTo(t.tiltAngle,i,null,function(){t._scaleToAnimater=t._scaleTo(e,i,null,function(){t._works()})}):t._scaleToAnimater=t._scaleTo(e,i,null,function(){t._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&&(this.map.removeAnimater(this._tiltToAnimater),this._tiltToAnimater=null),this._scaleToAnimater&&(this.map.removeAnimater(this._scaleToAnimater),this._scaleToAnimater=null),this._moveToAnimater&&(this.map.removeAnimater(this._moveToAnimater),this._moveToAnimater=null),this._focusGroupToAnimater&&(this.map.removeAnimater(this._focusGroupToAnimater),this._focusGroupToAnimater=null),this._animateFun&&this.map.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 M.default({id:"location",map:this.map,url:this.locationMarkerUrl||"",size:this.locationMarkerSize}),this.map.addLocationMarker(this._locationMarker))}},{key:"_getValueOrDefault",value:function(e){for(var t,n=arguments.length<=1?0:arguments.length-1,i=0;i<n;i++){var r=i+1<1||arguments.length<=i+1?void 0:arguments[i+1];if(e[r])return e[r]}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",i=t?this._startMarkerLayer:this._endMarkerLayer,r=t?this._startMarker:this._endMarker,a="number"==typeof e.height?e.height:this.imageMarkerHeight;return i&&r&&i.removeMarker(r),i&&i.groupID==e.groupID||(i=this.map.getFMGroup(e.groupID).getOrCreateLayer("imageMarker")),r=new b.default({x:e.x,y:e.y,map:this.map,url:n,height:a,size:e.size||64,callback:function(){e.callback&&e.callback(r)}}),i.addMarker(r),t?(this._startMarker=r,this._startMarkerLayer=i):(this._endMarker=r,this._endMarkerLayer=i),r}}},{key:"_getGroupsPoints",value:function(){for(var e=this._naviResults,t=[],n=null,i=null,r=0;r<e.length;r++){var a=e[r],o=n==a.groupId;0==a.length&&0!=r&&r!=e.length-1||(o||(n=a.groupId,i&&t.push(i),i={groupId:a.groupId,pointList:[]}),i.pointList=i.pointList.concat(a.pointList))}return i&&t.push(i),this._groupsPoints=t,t}},{key:"_addZeroResult",value:function(e){for(var t=0;t<e.length-1;t++){var n=e[t];if(n.length){var i=n.pointList[n.pointList.length-1],r=e[t+1].pointList[0];.2<C.default.distanceOfTwoPoints(i,r)&&n.pointList.push((0,g.default)({},r))}}}},{key:"_getNaviResult",value:function(e,t){if(this._startData&&this._endData){this._naviResults=this._caculateLines(this._startData,this._endData,this._startData.groupID,this._endData.groupID,e,t),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],this._naviEntracesDistance[1]=this._calcEntraceDistance(this._naviResults,this._endData,!0)}}},{key:"_calcEntraceDistance",value:function(e,t,n){if(!this.map||!e||!t.groupID)return null;if(!this.map.getCurrDecodeData().floors[t.groupID])return null;var i=this.map.getCurrDecodeData().floors[t.groupID].geo[0].modelLayer,r=this.map.getFMGroup(t.groupID).getLayer("model")._models,a=null;for(var o in r){var s=r[o];if(s&&s._data&&(a=s._data.vertices),null==a){var l=i[o-1];l.geo&&(a=D.default.convertGeo2Geometry(l.geo).vertices)}if(C.default.pointInPolygonVector2d(a,t,a.length))break}if(!a)return null;for(var u=[],h=[Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE],c=0;c<a.length/2;c++){var d=2*c,f=a[d],p=a[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 _=0;_<m.length;_++)m[_].reverse();m.reverse()}for(var x=null,b=null,w=null,M=0;M<m.length;M++){for(var T=m[M],E=!1,S=0;S<T.length-1;S++){var A=T[S],L=T[S+1],I=C.default.calcLinePolygonCrossPoints2d(A,L,u,h);if(I){b=T,w=S,x=I.crossPoints[S],E=!0;break}}if(E)break}if(!b)return null;for(var k=0,R=0;R<=w;R++){var N=b[R],P=b[R+1];k+=R!=w?C.default.distanceOfTwoPoints(N,P):C.default.distanceOfTwoPoints(N,x)}return k}},{key:"_drawLines",value:function(o){var s=this;if(0==o.length)return null;for(var l=new w.default,e=function(e){var t=o[e],n=t.getPointList();if(0==n.length)return"continue";var i=t.groupId,r=[];n.forEach(function(e){r.push({x:e.x,y:e.y,z:s.lineMarkerHeight})}),n.length<2&&r.push({x:n[0].x,y:n[0].y,z:s.lineMarkerHeight});var a=new p.default;a.groupId=i,a.points=r,l.addSegment(a)},t=0;t<o.length;t++)e(t);return this.map.drawLineMark(l,this.lineStyle),this._naviLineMarkers.push(l),l}},{key:"_caculateLines",value:function(e,t,n,i,r,a){if(this._analyser.analyzeNavi(n,e,i,t,r||this.naviMode,a||this.naviPriority)!=y.default.ROUTE_SUCCESS)return[];var o=this._analyser.getNaviResults();return 0==o.length?[]:o}},{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,i){return this.map._moveTo({x:e.x,y:e.y,time:"number"==typeof t?t:0,groupID:e.groupID,update:n,callback:i},!0)}},{key:"_tiltTo",value:function(e,t,n,i){return this.map.tiltTo({to:e,duration:"number"==typeof t?t:0,update:n,callback:i})}},{key:"_rotateTo",value:function(e,t,n,i){return this.map.rotateTo({to:e,duration:"number"==typeof t?t:0,update:n,callback:i})}},{key:"_scaleTo",value:function(e,t,n,i){return this.map.scaleTo({scale:e,duration:"number"==typeof t?t:0,update:n,callback:i},!0)}},{key:"_focusGroupTo",value:function(e,t,n,i){return this.map.visibleGroupIDs=[e],n&&n(),this.map.focusGroupID==e?(i&&i(),null):this.map.changeFocusToGroup({gid:e,duration:"number"==typeof t?t:0,update:n,callback:function(){i&&i()}})}},{key:"_getRouteAngle",value:function(e,t){var n=new Geo.Vector3(0,1,0),i=new Geo.Vector3(e.x,e.y,0),r=new Geo.Vector3(t.x,t.y,0),a=r.clone().sub(i).normalize(),o=a.angleTo(n)*Geo._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,i,r,a=0,o=0,s=e[0],l=1;l<e.length;l++)if(n=e[l],n.gid==s.gid){if(i=n.clone().sub(s),r=i.length(),a+=r,t<=a){i.normalize();var u=s.clone().add(i.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(){if(!this._startData||!this._endData||!this._naviDescriptionsData||0==this._naviDescriptionsData.length)return[];var i=-1,e=this._naviDescriptionsData.map(function(e,t){var n=new Geo.Vector3(e.startPoint.x,0,e.startPoint.y);return n.gid=e.startGID,n._index=t,i=t,n}),t=this._naviDescriptionsData[this._naviDescriptionsData.length-1],n=new Geo.Vector3(t.endPoint.x,0,t.endPoint.y);return n.gid=t.endGID,n._index=i+1,e.push(n),e}},{key:"_follow",value:function(e,t){var n=this,i=this._simulateParams,r=i.inTime||this.inTime;i.scale=i.scale||this.scale||0;var a=i.scale<this.minScale?this.minScale:i.scale;if(!this.isMultiGroups){var o={x:this._locationMarker.x,y:this._locationMarker.y,height:this._locationMarker.height,groupID:e.gid},s=this._groupsPoints[this._groupPointsIndex];s&&s.pointList&&0<s.pointList.length&&(o=(0,g.default)(o,s.pointList[0])),this._locationMarker.setPosition(o),this._locationMarker._renderNode.visible=!0}this.changeTiltAngle&&(this._tiltToAnimater=this._tiltTo(this.tiltAngle,r,null,null)),this._moveToAnimater=this._moveTo(t,r,null,function(){n._scaleToAnimater=n._scaleTo(a,r,null,function(){n._changeGrouping=!1})})}},{key:"_gpsAnimate",value:function(e){var t=this;if(this._gpsStop||requestAnimationFrame(this._gpsAnimate.bind(this,e)),!this._isEnd&&(e.cnt++,e.cnt==e.step)){e.cnt=0;var n=this._timer.getDelta();if(!this._changeGrouping&&!this._pause&&(this._allLen+=this.speed*n,0!=this._allLen)){var i=(0,g.default)({},this._getTransformByLength(e.ps,this._allLen)),r=this._naviDistance-this._allLen,a=i.y;if(i.y=i.z,i.z=a,i.groupID=i.gid,this._gpsData={distance:0,remain:r,walk:this._allLen,point:i,groupID:i.gid,index:i.index-1},this._toPos=(0,g.default)({},i),!i||r<=this._naviDescriptionsCalculator.tailLen)this._isEnd=!0;else if(this._preGid||(this._preGid=e.ps[0].gid),this._isSimulating){if(this._preGid!=i.gid){this._preGid=i.gid,this._groupPointsIndex++;var o={x:i.x,y:i.y,groupID:i.gid};if(this.followPosition){var s=this._simulateParams,l=s.inTime||this.inTime;s.scale=s.scale||this.scale||0;var 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(){t._scaleToAnimater=t._scaleTo(u,l,null,function(){t._locationMarker._renderNode.visible=!1,t.locationMarker.setPosition({x:o.x,y:o.y,height:t.locationMarkerHeight,groupID:o.groupID}),t._moveTo(o,l,null,function(){t.changeTiltAngle?t._tiltToAnimater=t._tiltTo(t.tiltAngle,l,null,function(){t._follow(i,o)}):t._follow(i,o)})})})}this.dispatchEvent({type:"crossGroup",groupId:i.gid})}var h=x.default.toSceneCoord(this.map,this._toPos);h.y=0;var c=this._locationMarker._renderNode.position.clone();c.y=0;var d=new Geo.Matrix4;d.lookAt(c,h,this._locationMarker._renderNode.up),this._toRot=this.locationMarkerFollowAngle?(new Geo.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 Geo.Vector3(this._locationMarker.x,this._locationMarker.y,0),t=e.lerp(this._toPos,this.followSpeed);t.groupID=this._toPos.gid;var n=C.default.distanceOfTwoPoints(t,this._toPos);this._locationMarker.setPosition({x:t.x,y:t.y,height:this.locationMarkerHeight,groupID:t.groupID});var i=this.naviConstraint(t);if(this.dispatchEvent((0,g.default)({},this._gpsData,{type:"walking",distance:i.distance,remain:i.remain,walk:this._naviDistance-i.remain,distanceToNext:i.distanceToNext,angle:i.angle,point:i.coord,groupID:t.groupID,index:i.index,isReal:!1})),this.followPosition?(t.groupID=t.gid,this._moveToAnimater=this._moveTo(t)):this.map.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 r=new Geo.Vector3(1,0,0),a=r.clone(),o=this._locationMarker._renderNode.matrix.clone();o.setPosition(new Geo.Vector3),a.applyMatrix4(o);var s=a.clone().cross(r);s=s.y<0?-1:1;var l=r.angleTo(a),u=Math.PI-l*s;u+=Math.PI,this.map.controls.setUpdate(null,null,null,u)}}}},{key:"_works",value:function(){this._gps(),this._animateFun=this._animate.bind(this),this.map.on("update",this._animateFun)}},{key:"locationMarker",set:function(e){e instanceof M.default&&(this._locationMarker=e,this.map.addLocationMarker(this._locationMarker))},get:function(){return this._locationMarker||(this._locationMarker=new M.default({id:"location",map:this.map,url:this.locationMarkerUrl||"",size:this.locationMarkerSize}),this.map.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}}]),i}(_.default),L=A;t.default=L},function(e,t,n){e.exports=n(473)},function(e,t,n){n(474),e.exports=n(11).Number.isNaN},function(e,t,n){var i=n(14);i(i.S,"Number",{isNaN:function(e){return e!=e}})},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var s=i(n(242));n(44);var o=i(n(28)),a=i(n(16)),l=i(n(2)),u=i(n(3)),h=i(n(476)),c=i(n(66)),d=i(n(32)),f=function(){function t(e){(0,l.default)(this,t),this.directionAssert=10,this.combineAsset=5,this.naviLanguage=c.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,u.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=t.concat(e[n]._nodeList);return t}},{key:"_getField",value:function(e,t){var n=Math.PI/4,i=e/n,r=(0,o.default)(i),a=i%1*n;return r%2==0?t<a&&(r+=1):n-t<=a&&(r+=1),r}},{key:"_getAngle",value:function(e,t){var n=t.angleTo(e),i=new Geo.Vector3(t.x,t.z,t.y).cross(new Geo.Vector3(e.x,e.z,e.y));return i.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 Geo.Vector3(0,0,1),i=n;0!=t&&(i=e[t].clone().sub(e[t-1]).normalize(),i.y=0,i.z*=-1);var r=e[t+1].clone().sub(e[t]);r.y=0;var a=r.length(),o=r.normalize();o.z*=-1;var s=this._getField(this._getAngle(n,o),22.5*Geo._Math.DEG2RAD),l=this._getAngle(i,o),u=this._getField(l,this.directionAssert*Geo._Math.DEG2RAD);return{relField:u,relDesc:this._getDescribeWord(this.dirArr2[u]),relAngle:l*Geo._Math.RAD2DEG,absField:s,absDesc:this._getDescribeWord(this.dirArr[s]),distance:a,index:e[t].index}}},{key:"_regularPoints",value:function(e,t){for(var i=this,n=e.map(function(e,t){var n;return n=i.map?d.default.toSceneCoord(i.map,e):d.default.toSceneCoord({center:{x:i.analyser.sceneData.scene.x,y:i.analyser.sceneData.scene.y}},e),n.index=t,n}),r=[],a=0;a<n.length;a++){var o=this._getDirection(n,a);o.point=e[a],o.groupID=t,r.push(o)}for(var s=[r[0]],l=1;l<r.length;l++)r[l].relAngle<=this.combineAsset||360-r[l].relAngle<=this.combineAsset?s[s.length-1].distance+=r[l].distance:s.push(r[l]);return s}},{key:"_getGroupDes",value:function(e){var t="";if(null!=this.map.getFMGroup(e)){var n=this.map.getFMGroup(e);t=this.naviLanguage==c.default.ZH?n._groupMessage.desc:n._groupMessage.gname.toUpperCase()}return t}},{key:"_getDesc",value:function(e,t,n,i,r){var a=e[t],o=e[t+1],s=this._getDescribeWord(this.dirArr3[o.relField]);if(this._boo=t==e.length-3&&o.distance<this.completeDistance,!s||this._boo)if(i){if(this._boo=!1,!s){var l=this._getLadderType(e[t+1].point,n,r),u=n<i?this._getDescribeWord("up_to"):this._getDescribeWord("down_to"),h=this._getGroupDes(i);s=this._getDescribeWord("take")+l+" "+u+" "+h}}else this._boo&&(this._tailLen=o.distance),s=this._getDescribeWord("arrived");return 0==t?2==e.length?this._getDescribeWord("face_to")+" "+a.absDesc+" "+this._getDescribeWord("straight")+" "+Math.ceil(a.distance)+" "+this._getDescribeWord("meter")+" "+s:this._getDescribeWord("face_to")+" "+a.absDesc+" "+this._getDescribeWord("straight")+" "+Math.ceil(a.distance)+" "+this._getDescribeWord("meter")+" "+this._getDescribeWord(this.dirArr3[e[t+1].relField]):this._getDescribeWord("straight")+" "+Math.ceil(a.distance+(this._boo&&!i?o.distance:0))+" "+this._getDescribeWord("meter")+" "+s}},{key:"_getDescData",value:function(e,t,n,i){var r=e[t],a=e[t+1],o=this._getDescribeWord(this.dirArr3[e[t+1].relField]);if(!o||this._boo)if(i){var s=n<i?this._getDescribeWord("up"):this._getDescribeWord("down");this._getGroupDes(i),a.relDesc=s}else a.relDesc="终";return{startPoint:r.point,startGID:r.groupID,startIndex:r.index,endPoint:a.point,endGID:a.groupID,endIndex:a.index,startDirection:r.absDesc,endDirection:a.relDesc,distance:r.distance+(this._boo&&!i?a.distance:0)}}},{key:"_getLadderType",value:function(e,t,n){e.z=this.map.getFMGroup(t).height;for(var i=s.default,r=-1,a=0;a<n.length;a++)if(n[a]){var o=Math.pow(n[a].point.x-e.x,2)+Math.pow(n[a].point.y-e.y,2);o<i&&(i=o,r=n[a].liftType)}if(-1!=r)switch(r){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=h.default[this.naviLanguage][e];return t||""}},{key:"_calculate",value:function(e){this.combinePoints=[];for(var t=[],n=[],i=null,r=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],i=a.groupId,r=null,f<e.length-1)for(var p=f;p<e.length;p++)if(e[p].groupId!=i){r=e[p].groupId;break}o=a.pointList;var m=this._regularPoints(o,i);if(1<m.length&&(this.combinePoints=this.combinePoints.concat(m)),1==m.length){if(r||u){if(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=i);else if(h==i||null==h){var v=i<r?this._getDescribeWord("up_to"):this._getDescribeWord("down_to"),g=this._getGroupDes(r);c=this._getDescribeWord("take_stair")+" "+v+" "+g,t.push(c),n.push({startPoint:o[0],startDirection:i<r?this._getDescribeWord("up"):this._getDescribeWord("down"),startGID:i})}u=!u}}else{h=i;for(var y=0;y<m.length-1&&!this._boo;y++)t.push(this._getDesc(m,y,i,r,d)),n.push(this._getDescData(m,y,i,r))}if(1<m.length){var _=m.reduce(function(e,t){return e+(t.distance||0)},0);l.push({groupID:i,distance:_}),s+=_}}return[t,n,s,l]}},{key:"tailLen",get:function(){return this._tailLen}}]),t}(),p=f;t.default=p},function(e,t,n){"use strict";var i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var r={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=r},function(e,t,n){e.exports=r;var h=n(176).EventEmitter,i=n(84);function r(){h.call(this)}i(r,h),r.Readable=n(177),r.Writable=n(487),r.Duplex=n(488),r.Transform=n(489),r.PassThrough=n(490),r.Stream=r,r.prototype.pipe=function(t,e){var n=this;function i(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function r(){n.readable&&n.resume&&n.resume()}n.on("data",i),t.on("drain",r),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",i),t.removeListener("drain",r),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,t){"use strict";t.byteLength=a,t.toByteArray=o,t.fromByteArray=p;for(var l=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,r=n.length;i<r;++i)l[i]=n[i],u[n.charCodeAt(i)]=i;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 i=n===t?0:4-n%4;return[n,i]}function a(e){var t=c(e),n=t[0],i=t[1];return 3*(n+i)/4-i}function d(e,t,n){return 3*(t+n)/4-n}function o(e){var t,n,i=c(e),r=i[0],a=i[1],o=new h(d(e,r,a)),s=0,l=0<a?r-4:r;for(n=0;n<l;n+=4)t=u[e.charCodeAt(n)]<<18|u[e.charCodeAt(n+1)]<<12|u[e.charCodeAt(n+2)]<<6|u[e.charCodeAt(n+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=255&t;return 2===a&&(t=u[e.charCodeAt(n)]<<2|u[e.charCodeAt(n+1)]>>4,o[s++]=255&t),1===a&&(t=u[e.charCodeAt(n)]<<10|u[e.charCodeAt(n+1)]<<4|u[e.charCodeAt(n+2)]>>2,o[s++]=t>>8&255,o[s++]=255&t),o}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 i,r=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),r.push(s(i));return r.join("")}function p(e){for(var t,n=e.length,i=n%3,r=[],a=16383,o=0,s=n-i;o<s;o+=a)r.push(f(e,o,s<o+a?s:o+a));return 1===i?(t=e[n-1],r.push(l[t>>2]+l[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],r.push(l[t>>10]+l[t>>4&63]+l[t<<2&63]+"=")),r.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,i,r){var a,o,s=8*r-i-1,l=(1<<s)-1,u=l>>1,h=-7,c=n?r-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+=i;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:1/0*(f?-1:1);o+=Math.pow(2,i),a-=u}return(f?-1:1)*o*Math.pow(2,a-i)},t.write=function(e,t,n,i,r,a){var o,s,l,u=8*a-r-1,h=(1<<u)-1,c=h>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:a-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(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,r),o+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,r),o=0));8<=r;e[n+f]=255&s,f+=p,s/=256,r-=8);for(o=o<<r|s,u+=r;0<u;e[n+f]=255&o,f+=p,o/=256,u-=8);e[n+f-p]|=128*m}},function(){},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=n(128).Buffer,a=n(482);function o(e,t,n){e.copy(t,n)}function s(){i(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 r.alloc(0);if(1===this.length)return this.head.data;for(var t=r.allocUnsafe(e>>>0),n=this.head,i=0;n;)o(n.data,t,i),i+=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,r,a){(function(e){var t=void 0!==e&&e||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}r.setTimeout=function(){return new i(n.call(setTimeout,t,arguments),clearTimeout)},r.setInterval=function(){return new i(n.call(setInterval,t,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(t,this._id)},r.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},r.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},a(484),r.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,r.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,a(56))},function(e,t,n){(function(e,y){!function(n,i){"use strict";if(!n.setImmediate){var r,a=1,o={},s=!1,l=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:l&&"onreadystatechange"in l.createElement("script")?v:g)(),e.setImmediate=t,e.clearImmediate=u}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 i={callback:e,args:t};return o[a]=i,r(a),a++}function u(e){delete o[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(i,n)}}function c(e){if(s)setTimeout(c,0,e);else{var t=o[e];if(t){s=!0;try{h(t)}finally{u(e),s=!1}}}}function d(){r=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),r=function(e){n.postMessage(t+e,"*")}}function m(){var t=new MessageChannel;t.port1.onmessage=function(e){var t=e.data;c(t)},r=function(e){t.port2.postMessage(e)}}function v(){var n=l.documentElement;r=function(e){var t=l.createElement("script");t.onreadystatechange=function(){c(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}}function g(){r=function(e){setTimeout(c,0,e)}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(56),n(65))},function(t,e,n){(function(n){function e(e,t){if(r("noDeprecation"))return e;var n=!1;function i(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}return i}function r(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(56))},function(e,t,n){"use strict";e.exports=a;var i=n(278),r=Object.create(n(99));function a(e){if(!(this instanceof a))return new a(e);i.call(this,e)}r.inherits=n(84),r.inherits(a,i),a.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){e.exports=n(178)},function(e,t,n){e.exports=n(68)},function(e,t,n){e.exports=n(177).Transform},function(e,t,n){e.exports=n(177).PassThrough},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(16));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=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=("undefined"==typeof performance?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}});var s=o;t.default=s},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(12)),u=i(n(16)),o=i(n(29)),s=i(n(2)),l=i(n(3)),h=i(n(30)),c=i(n(164)),d=i(n(126)),f=i(n(82)),p=i(n(98)),m=i(n(179)),v=i(n(83)),g=i(n(493));n(32);var y=function(){function t(e){(0,s.default)(this,t),this._options={},this._navi=null,this._naviResults=[],"function"==typeof c.default&&e instanceof c.default&&(this._map=null,this.init(e))}return(0,l.default)(t,[{key:"analyzeNavi",value:function(e,t,n,i,r,a){var o=function(e,t,n,i,r,a){var o=this._navi.route(e,t,n,i,r||f.default.MODULE_SHORTEST,a||p.default.PRIORITY_DEFAULT);return o==v.default.ROUTE_SUCCESS?this._naviResults=this._navi.getRouteResult():this._naviResults=[],o};return o.call(this,e,t,n,i,r,a)}},{key:"init",value:function(e){this._map=e,this._navi=new g.default({}),this._navi.initByMap(e)}},{key:"initByScene",value:function(e){this._navi=new g.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:"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=[];for(var i in t)t[i].getPointList&&n.push.apply(n,(0,o.default)(t[i].getPointList()));return n}},{key:"getRouteLineSegments",value:function(e){var t=e||this._naviResults;if(!this._isNaviResultsValide(t))return[];for(var n=[],i=0;i<t.length;i++){var r=t[i],a=r.groupId,o=r.pointList,s=new d.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 i=0,r=0;r<n.length-1;r++)i+=h.default.distanceOfTwoPoints(n[r],n[r+1]);return i}},{key:"getRouteGroupIds",value:function(e){var t=e||this._naviResults;if(!this._isNaviResultsValide(t))return[];var n=[];for(var i in t)!t[i].groupId||0!=i&&n[n.length-1]==t[i].groupId||n.push(t[i].groupId);return n}},{key:"getRouteGroupPoints",value:function(e,t){var n=t||this._naviResults;if(!this._isNaviResultsValide(n))return[];var i=[];for(var r in n)n[r].groupId&&n[r].groupId==e&&(i=i.concat(n[r].getPointList()));return i}},{key:"pathConstraint",value:function(e){return this._navi?this._navi.pathConstraint(e):null}},{key:"_getNaviResults",value:function(e){for(var t=[],n=0;n<e.length;n++)if(null!=e[n].groupId){var i=new m.default(e[n].groupId,e[n].length,e[n].pointVector,e[n].nodeVector);t.push(i)}return t}},{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 m.default)return!1;return!0}},{key:"navi",get:function(){this._navi}}]),t}(),_=y;t.default=_},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(180);var o=i(n(28));n(44);var u=i(n(16));n(45);var M=i(n(29));n(34);var a=i(n(2)),s=i(n(3)),g=i(n(30)),l=i(n(82)),T=i(n(98)),S=i(n(83)),c=i(n(179)),h=i(n(494)),d=i(n(172)),v=i(n(181)),E=i(n(67)),f=i(n(100)),p=i(n(495)),m=i(n(279)),y=i(n(280)),_=i(n(496)),x=i(n(281)),b=i(n(497)),w=i(n(282)),A=i(n(498)),L=i(n(32)),I=function(){function t(e){(0,a.default)(this,t),this._options=new h.default(e),this._naviService=new d.default(this._options),this._startPoint=null,this._startGroupId=null,this._endPoint=null,this._endGroupId=null,this._startZone=null,this._mode=l.default.MODULE_SHORTEST,this._priority=T.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=10,this._escalatorGreaterWightGain=10,this._escalatorWeightGain=1,this._escalatorLessWightGain=.1,this._stairGreaterWeightGain=10,this._stairWeightGain=1,this._stairLessWeightGain=.1,this._scene=null}return(0,s.default)(t,[{key:"initByMap",value:function(e){if(e&&e._currentSceneId&&e.dataManager){var t=e.dataManager._sceneDecodeData[e._currentSceneId];if(t){this._naviService.setScene(t),this._scene=t;var n=t.floors;0!=n.length&&(this._initNaviGraphs(n),this._processLiftFloors(),this._initDijkstras())}}}},{key:"initByScene",value:function(e){if(e){this._scene=e;var t=e.floors;0!=t.length&&(this._initNaviGraphs(t),this._processLiftFloors(),this._initDijkstras())}}},{key:"initByNaviGraphs",value:function(e){e&&(this._initNaviGraphs(e),this._processLiftFloors(),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:"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 t.sort(function(e,t){return e.dist-t.dist}),t}},{key:"route",value:function(e,g,t,y,_,n){var x=this;this.reset();var i=this._multiFloorDijkstraMap.get(e);if(!i)return S.default.ROUTE_FAILED_NO_DATA_START;var r=i._calcPointReachable(g);if(!r)return S.default.ROUTE_FAILED_NO_DATA_START;var a=this._multiFloorDijkstraMap.get(t);if(!a)return S.default.ROUTE_FAILED_NO_DATA_END;var o=a._calcPointReachable(y);if(!o)return S.default.ROUTE_FAILED_NO_DATA_END;this._result=[],this._startGroupId=e,this._startPoint=g,this._endGroupId=t,this._endPoint=y;var s=r.extentId,l=o.extentId,b=r.model,w=o.model;if(0==s||0==l)return S.default.ROUTE_FAILED_CANNOT_ARRIVE;var M=null;this._mode=_,this._switchToPriority(n);var u=function(){for(var e=[],t=[x._startPoint],n=0;n<x._predictExtentNodes.length-1;n++){var i=[],r=[];if(!x._calcPredictLiftNodes(x._predictExtentNodes[n],x._predictExtentNodes[n+1],t[t.length-1],i,r))return S.default.ROUTE_FAILED_CANNOT_ARRIVE;for(var a=!1,o=0;o<i.length;o++){var s=i[o]._wrappedNode,l=r[o]._wrappedNode,u=i[o].groupId,h=r[o].groupId;if(0==n){var c=x._multiFloorDijkstraMap.get(u);c._startModel=b,M=c.routeCalculate(g,s,_)}else{var d=x._multiFloorDijkstraMap.get(u);M=d.routeCalculate(e[e.length-1],s,_)}if(S.default.ROUTE_SUCCESS==M){var f=x._multiFloorDijkstraMap.get(u),p=f.getRouteCalculateResult();if(x._result.push({groupId:u,result:p}),e.push(l),t.push(l.point),a=!0,x._predictExtentNodes.length-2==n){var m=x._multiFloorDijkstraMap.get(h);if(m._endModel=w,M=m.routeCalculate(l,y,_),S.default.ROUTE_SUCCESS!=M){x._result.splice(x._result.length-1,1),a=!1,t.splice(t.length-1,1),e.splice(e.length-1,1);continue}var v=m.getRouteCalculateResult();x._result.push({groupId:h,result:v})}if(S.default.ROUTE_SUCCESS==M)break}}if(!a)return S.default.ROUTE_FAILED_CANNOT_ARRIVE}return S.default.ROUTE_SUCCESS};if(e==t&&s==l){var h=this._multiFloorDijkstraMap.get(e);if(h._startModel=b,h._endModel=w,M=h.routeCalculate(g,y,_),M!=S.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 S.default.ROUTE_FAILED_OUTLINE;var p=this.calc_sort_outlines_dist(f);for(d=0;d<p.length;d++){this._predictExtentNodes=p[d].seq;var m=u();if(m==S.default.ROUTE_SUCCESS)return m}return S.default.ROUTE_FAILED_CANNOT_ARRIVE}var v=h.getRouteCalculateResult();this._result.push({groupId:e,result:v})}else{var T=this._calcPredictExtentNodes(e,s,t,l);if(T!=S.default.ROUTE_SUCCESS)return S.default.ROUTE_FAILED_OUTLINE;this._predictExtentNodes.reverse();var E=u();if(S.default.ROUTE_SUCCESS!=T)return E}return S.default.ROUTE_SUCCESS}},{key:"getRouteResult",value:function(){for(var e=[],t=0;t<this._result.length;t++){this._simplifyRouteResult(this._result[t]);for(var n=this._result[t],i=n.groupId,r=n.result,a=[],o=0,s=0;s<r.length;s++)a.push(r[s].point),s!=r.length-1&&(o+=g.default.distanceOfTwoPoints(r[s].point,r[s+1].point));var l=new c.default;if(l._groupId=i,l._nodeList=r,l._pointList=a,l._length=o,e.push(l),t!=this._result.length-1){var u=this._getBeginTransitionRoute(this._result[t]),h=this._getEndTransitionRoute(this._result[t+1]);e.push(u),e.push(h)}}return e}},{key:"_simplifyRouteResult",value:function(e){if(e&&e.result){var t=e.result,n=t.length;if(n&&!(n<2)){var i=[];i.push(t[0]);var r=t[0],a=t[n-1];g.default.distanceOfTwoPoints(r.point,a.point),g.default.epsilon();for(var o=1;o<n-1;o++){var s=t[o];null!=r&&g.default.distanceOfTwoPoints(r.point,s.point)<g.default.epsilon()||null!=a&&g.default.distanceOfTwoPoints(a.point,s.point)<g.default.epsilon()||i.push(s)}i.push(a),n=i.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=i[h],d=h-1;0!=l[d];)d--;var f=i[d],p=i[h+1];g.default.isPointOnSegment(c.point,f.point,p.point)&&(l[h]=1)}for(var m=[],v=0;v<n;v++)0==l[v]&&m.push(i[v]);e.result=m}}}},{key:"reset",value:function(){this._predictExtentNodes=[],this._predictLiftNodes=[],this._multiFloorDijkstraMap.each(function(e,t){t.reset()})}},{key:"pathConstraint",value:function(n){var i=this;if(this._multiFloorDijkstraMap.size()<=0)return null;var e=this._multiFloorDijkstraMap.get(n.groupID);if(!e)return null;var t=e._naviGraph;if(!t)return null;var r=[];r.push.apply(r,(0,M.default)(t.roadVector)),e._zoneIdGraph.each(function(e,t){r.push.apply(r,(0,M.default)(t.roadVector))});var a={},o=t.queryContainExtentId(n),s={distance:Number.MAX_VALUE,road:null,coord:{groupID:n.groupID}},l=null;return r.length&&(r.forEach(function(e){if(e.roadEntry!=E.default.NaviRoadEntry_FORBID&&o==e.extentId){var t=g.default.pointDistanceToLine(n,e.startPoint,e.endPoint,a);t<s.distance&&(s.distance=t,s.road=e,s.angle=i._getRouteAngle(e.startPoint,e.endPoint),(0,u.default)(s.coord,a))}}),l=s),l}},{key:"_getRouteAngle",value:function(e,t){var n=new Geo.Vector3(0,0,1),i=new Geo.Vector3(e.x,0,e.y),r=new Geo.Vector3(t.x,0,t.y),a=r.clone().sub(i).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 i=e[t].geo[0],r=e[t].biz[0],a=e[t].navi[0],o=this._naviService.convertToGroup(n,i,r,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 x.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(i,r){var a=[],e=function(e){var t=i.naviNodes[e];if(null==t.nodeId)return"continue";var n=new f.default;n.Id=t.nodeId,n.point=t.geoArr,n.nodeType=t.nodeType,n.liftType=t.liftType,n.liftFlag=t.liftFlag,n.liftEntry=t.liftEntry,t.linkSegArr.forEach(function(e){n.segLinks.push((0,o.default)(e))}),t.liftFloorArr.forEach(function(e){n.liftFloors.push((0,o.default)(e))}),a.push(n),r.put(t.nodeId,e)};for(var t in i.naviNodes)e(t);return a}},{key:"_initNaviRoads",value:function(e){var t=[];for(var n in e.naviSegments){var i=e.naviSegments[n],r=i.geoArr;if(r){var a=new m.default;a.Id=i.segmentId,a.startId=i.snode,a.startPoint=r[0],a.endId=i.enode,a.endPoint=r[1],a.length=i.length,a.roadEntry=i.entry,a.roadRank=i.rank,t.push(a)}}return t}},{key:"_initNaviObstructExtents",value:function(e){for(var t=[],n=0,i=e.extentLayer.length;n<i;n++){var r=e.extentLayer[n],a=r.geoArr;a=a||[];var o=new _.default(r.eid,e.gid,0,a,r.center,r.holes);o.fid=r.fid,t.push(o)}return t}},{key:"_initNaviObstructModels",value:function(e){for(var t=[],n=0,i=e.modelLayer.length;n<i;n++){var r=e.modelLayer[n],a=r.geoArr;a=a||[];var o=new _.default(r.eid,e.gid,0,a,r.center,r.holes);o.fid=r.fid,o.pass=r.pass,t.push(o)}return t}},{key:"_initNaviZones",value:function(e){for(var t=[],n=0,i=e.naviZones.length;n<i;n++){var r=e.naviZones[n],a=new y.default(r.id,e.gid,r.type,r.geoArr);t.push(a)}return t}},{key:"_processNaviObstructModels",value:function(e,t,n,i){for(var r=new v.default,a=0;a<e.length;a++){var o=e[a];r.put(o.Id,a)}for(var s=0;s<n.naviModels.length;s++)for(var l=n.naviModels[s],u=l.id,h=e[r.get(u)],c=0;c<l.doorids.length;c++){var d=l.doorids[c],f=t[i.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(){if(!(this._graphs.size()<=0)){var o={};this._graphs.each(function(e,t){var n=[];for(var i in t.queryLiftNodesByType(E.default.NaviLiftType_Escalator,n),n){var r=n[i];if(r.liftFlag){var a=r.liftFlag;o[a]?o[a]=o[a].concat(r.liftFloors):o[a]=r.liftFloors}}}),this._graphs.each(function(e,t){var n=[];for(var i in t.queryLiftNodesByType(E.default.NaviLiftType_Escalator,n),n){var r=n[i];if(r.liftFlag){var a=r.liftFlag;o[a]&&(r.liftFloors=o[a])}}})}}},{key:"_initDijkstras",value:function(){var n=this;if(this._graphs&&!(!this._graphs instanceof v.default)){this._initExtentNodes(),this._initExtentRoads();var e=new x.default(this._extentNodes,this._extentRoads);this._outlineAnalyzeDijkstra=new w.default(e),this._graphs.each(function(e,t){n._multiFloorDijkstraMap.put(e,new A.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,i=0;i<n.length;i++){var r=n[i],a=new b.default;a.Id=c++,a.groupId=e,a.extentId=r.Id,a.extent=r;for(var o=0;o<t.nodeVector.length;o++){var s=t.nodeVector[o];if(s.liftType!=E.default.NaviLiftType_NULL&&g.default.pointInPolygon2d(r.points,s.point,r.pointCount)){var l=new p.default,u=t.queryZoneByPoint(s.point);l.zone=u,l.setNode(s),l.groupId=e,l._wrappedNode=s,l._liftType=s.liftType,a.liftNodes.push(l)}}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 i=this._extentNodes[n];if(e!=n){var r=this._checkConnection(t,i);if(null!=r){var a=new m.default;a.startId=t.Id,a.endId=i.Id,a.entryType=E.default.NaviRoadEntry_FORWARD,a.length=r,this._extentRoads.push(a)}}}}},{key:"_checkConnection",value:function(e,t){for(var n=Number.MAX_VALUE,i=!1,r=(e.groupId,t.groupId),a=0;a<e.liftNodes.length;a++){var o=e.liftNodes[a],s=o.liftType;if(T.default.PRIORITY_LIFTONLY==this._priority){if(E.default.NaviLiftType_Lift!=s)continue}else if(T.default.PRIORITY_ESCALATORONLY==this._priority){if(E.default.NaviLiftType_Escalator!=s)continue}else if(T.default.PRIORITY_STAIRONLY==this._priority){if(E.default.NaviLiftType_Stair!=s)continue}else if(T.default.PRIORITY_ACCESSIBLEONLY==this._priority&&E.default.NaviLiftType_Accessible!=s)continue;if(s==E.default.NaviLiftType_Stair||-1!=o.liftFloors.indexOf(r))for(var l=0;l<t.liftNodes.length;l++){var u=t.liftNodes[l];if(null!=u&&o.liftFlag==u.liftFlag)if(T.default.PRIORITY_LIFTFIRST==this._priority||T.default.PRIORITY_DEFAULT==this._priority){if(E.default.NaviLiftType_Lift==s||E.default.NaviLiftType_Accessible==s){var h=this._liftLessWeightGain;return h}if(E.default.NaviLiftType_Escalator==s){var c=this._escalatorWeightGain;c<n&&(n=c),i=!0;break}if(E.default.NaviLiftType_Stair==s){var d=this._stairGreaterWeightGain;d<n&&(n=d),i=!0;break}}else if(T.default.PRIORITY_ESCALATORFIRST==this._priority){if(E.default.NaviLiftType_Lift==s||E.default.NaviLiftType_Accessible==s){var f=this._liftWeightGain;f<n&&(n=f),i=!0;break}if(E.default.NaviLiftType_Escalator==s){var p=this._escalatorLessWightGain;return p}if(E.default.NaviLiftType_Stair==s){var m=this._stairGreaterWeightGain;m<n&&(n=m),i=!0;break}}else if(T.default.PRIORITY_STAIRFIRST==this._priority){if(E.default.NaviLiftType_Lift==s){var v=this._liftWeightGain;v<n&&(n=v),i=!0;break}if(E.default.NaviLiftType_Escalator==s||E.default.NaviLiftType_Accessible==s){var g=this._escalatorGreaterWeightGain;g<n&&(n=g),i=!0;break}if(E.default.NaviLiftType_Stair==s){var y=this._stairLessWeightGain;return y}}else if(T.default.PRIORITY_LIFTONLY==this._priority||T.default.PRIORITY_ESCALATORONLY==this._priority||T.default.PRIORITY_STAIRONLY==this._priority||T.default.PRIORITY_ACCESSIBLEONLY==this._priority)return this._weightBias}}return i?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){if(this._priority!=e||!this._outlineAnalyseDijkstra){this._priority=e,this._initExtentRoads();var t=new x.default(this._extentNodes,this._extentRoads);this._outlineAnalyseDijkstra=new w.default(t)}}},{key:"_getEndTransitionRoute",value:function(e){var t=e.result,n=new c.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 c.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,i){var r=this._getExtentNode(e,t),a=this._getExtentNode(n,i),o=this._outlineAnalyseDijkstra.routeCalculate(r,a);if(o!=S.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==E.default.NaviLiftType_Lift&&t.liftType==E.default.NaviLiftType_Lift?e._dist-t._dist:e.liftType==E.default.NaviLiftType_Lift?-1:t.liftType==E.default.NaviLiftType_Lift?1:e._dist-t._dist}},{key:"_compareEscalatorFirstFunc",value:function(e,t){return e.liftType==E.default.NaviLiftType_Escalator&&t.liftType==E.default.NaviLiftType_Escalator?e._dist-t._dist:e.liftType==E.default.NaviLiftType_Escalator?-1:t.liftType==E.default.NaviLiftType_Escalator?1:e._dist-t._dist}},{key:"_compareStairFirstFunc",value:function(e,t){return e.liftType==E.default.NaviLiftType_Stair&&t.liftType==E.default.NaviLiftType_Stair?e._dist-t._dist:e.liftType==E.default.NaviLiftType_Stair?-1:t.liftType==E.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 i=this._outlineAnalyseDijkstra._naviGraph.adjList;if(0==i.size())return[];var r=e.length-1,a=i.get(e[r].Id);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=a[s];if(!this._has_extent_node(e,l)&&l.nodeId!=t.Id){var u=e.concat(),h=this._outlineAnalyseDijkstra._naviGraph.getIndexByNodeID(l.nodeId);u.push(this._outlineAnalyseDijkstra._naviGraph.nodeVector[h]);var c=this._enlarge_connected_nodes_num(u,t,n-1);0!=c.length&&o.push(c)}}return o}},{key:"_calcPredictConnectedLift",value:function(e,t,n){for(var i=e.liftNodes,r=n.liftNodes,a=0;a<i.length;a++){var o=i[a];o._dist=g.default.distanceOfTwoPoints(o.point,t)}T.default.PRIORITY_DEFAULT==this._priority||T.default.PRIORITY_LIFTONLY==this._priority||T.default.PRIORITY_LIFTONLY==this._priority?i.sort(this._compareLiftFirstFunc):T.default.PRIORITY_ESCALATORFIRST==this._priority||T.default.PRIORITY_ESCALATORONLY==this._priority?i.sort(this._compareEscalatorFirstFunc):T.default.PRIORITY_STAIRFIRST!=this._priority&&T.default.PRIORITY_STAIRONLY!=this._priority||i.sort(this._compareLiftFirstFunc);for(var s=null,l=null,u=!1,h=0;h<i.length;h++){for(var c=i[h],d=c.liftFlag,f=(c.liftFloors,0);f<r.length;f++)if(r[f].liftFlag==d){s=c,l=r[f],u=!0;break}if(u)break}return null==s||null==l?null:{startLiftNodes:s,endLiftNodes:l}}},{key:"_calcPredictLiftNodesBak",value:function(e,t,n,i,r){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(E.default.NaviLiftType_Stair!=s.liftType){var l=s.liftFloors;if(-1==l.indexOf(t.groupId))continue}for(var u=0;u<t.liftNodes.length;u++){var h=t.liftNodes[u];if(s.liftFlag==h.liftFlag){i.push(s),r.push(h);break}}}return 0==i.length}},{key:"_calcPredictLiftNodes",value:function(r,t,e,n,i){this._startZone=this._multiFloorDijkstraMap.get(r.groupId)._naviGraph.queryZoneByPoint(e);var a=[];function o(e,t){var n,i=r.queryLifts(e,t);(n=a).push.apply(n,(0,M.default)(i))}for(var s=r.liftNodes,l=0;l<s.length;l++){var u=s[l],h=L.default.toVector(u.point),c=L.default.toVector(this._endPoint),d=L.default.toVector(e);u._dist=c.sub(h).length()+h.sub(d).length()}var f=r.extent.bb,p=f.maxX-f.minX+(f.maxY-f.minY);if(T.default.PRIORITY_LIFTONLY==this._priority||T.default.PRIORITY_ESCALATORONLY==this._priority||T.default.PRIORITY_STAIRONLY==this._priority||T.default.PRIORITY_ACCESSIBLEONLY==this._priority){var m=null;T.default.PRIORITY_LIFTONLY==this._priority&&(m=E.default.NaviLiftType_Lift),T.default.PRIORITY_ESCALATORONLY==this._priority&&(m=E.default.NaviLiftType_Escalator),T.default.PRIORITY_STAIRONLY==this._priority&&(m=E.default.NaviLiftType_Stair),T.default.PRIORITY_ACCESSIBLEONLY==this._priority&&(m=E.default.NaviLiftType_Accessible),a=r.queryLifts(m)}T.default.PRIORITY_LIFTFIRST!=this._priority&&T.default.PRIORITY_ESCALATORFIRST!=this._priority&&T.default.PRIORITY_STAIRFIRST!=this._priority&&T.default.PRIORITY_DEFAULT!=this._priority||(T.default.PRIORITY_LIFTFIRST!=this._priority&&T.default.PRIORITY_DEFAULT!=this._priority||(o(E.default.NaviLiftType_Lift,-15),o(E.default.NaviLiftType_Escalator,-8),o(E.default.NaviLiftType_Stair,0)),T.default.PRIORITY_ESCALATORFIRST==this._priority&&(o(E.default.NaviLiftType_Lift,-8),o(E.default.NaviLiftType_Escalator,-15),o(E.default.NaviLiftType_Stair,0)),T.default.PRIORITY_STAIRFIRST==this._priority&&(o(E.default.NaviLiftType_Lift,-8),o(E.default.NaviLiftType_Escalator,0),o(E.default.NaviLiftType_Stair,-15))),T.default.PRIORITY_LIFTFIRST1!=this._priority&&T.default.PRIORITY_ESCALATORFIRST1!=this._priority&&T.default.PRIORITY_STAIRFIRST1!=this._priority||(T.default.PRIORITY_LIFTFIRST1==this._priority&&(o(E.default.NaviLiftType_Lift,-p),o(E.default.NaviLiftType_Escalator,0),o(E.default.NaviLiftType_Stair,0)),T.default.PRIORITY_ESCALATORFIRST1==this._priority&&(o(E.default.NaviLiftType_Lift,0),o(E.default.NaviLiftType_Escalator,-p),o(E.default.NaviLiftType_Stair,0)),T.default.PRIORITY_STAIRFIRST1==this._priority&&(o(E.default.NaviLiftType_Lift,0),o(E.default.NaviLiftType_Escalator,0),o(E.default.NaviLiftType_Stair,-p)));var v=this;a.sort(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(E.default.NaviLiftType_Stair!=y._liftType){var _=y._wrappedNode.liftFloors,x=_.find(function(e){return e==t.groupId});if(null==x)continue}for(var b=0;b<t.liftNodes.length;b++){var w=t.liftNodes[b];if(y.liftFlag==w.liftFlag){n.push(y),i.push(w);break}}}return 0!=n.length}}]),t}(),k=I;t.default=k},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(2)),o=i(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 i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6)),o=i(n(2)),s=i(n(7)),l=i(n(8)),u=i(n(9)),h=i(n(100));function c(i){return function(){var e,t=(0,l.default)(i);if(d()){var n=(0,l.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,s.default)(this,e)}}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,u.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 i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var s=i(n(2)),a=i(n(3)),l=i(n(174)),u=i(n(30)),h=i(n(280)),o=function(){function o(e,t,n,i,r,a){(0,s.default)(this,o),this.Id=e,this.fid="",this.points=i,this.pointCount=i&&i.length?i.length:0,this.center=r,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 i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=i(n(6));n(34);var s=i(n(29)),o=i(n(2)),l=i(n(3)),u=i(n(7)),h=i(n(8)),c=i(n(9)),d=i(n(100)),f=i(n(67)),p=i(n(98)),m=i(n(30));function v(i){return function(){var e,t=(0,h.default)(i);if(g()){var n=(0,h.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,u.default)(this,e)}}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,c.default)(n,e);var t=v(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){for(var t=e,n=[],i=0;i<this.liftNodes.length;i++)t==this.liftNodes[i]._liftType&&n.push(this.liftNodes[i]);return n}},{key:"queryLiftNodes",value:function(e,t,n,i){this._zone=e;var r=[];r.push.apply(r,(0,s.default)(this.liftNodes));for(var a=0;a<r.length;a++){var o=r[a];o._dist=m.default.distanceOfTwoPoints(n,o.point)+m.default.distanceOfTwoPoints(o.point,t)}return this._liftNodeSort(r,i)}},{key:"_liftNodeSort",value:function(e,t){if(t==p.default.PRIORITY_LIFTFIRST1){var n=this._sortLiftFirst.bind(this);e.sort(n)}else if(t==p.default.PRIORITY_ESCALATORFIRST1){var i=this._sortEscalatorFirst.bind(this);e.sort(i)}else if(t!=p.default.PRIORITY_STAIRFIRST1){var r=this._sortStairFirst.bind(this);e.sort(r)}else{var a;this._modifyDistance(e,t);for(var o=[],s=0;s<e.length;s++)e[s]._dist&&o.push(e[s]);e=[],(a=e).push.apply(a,o);var l=this._sortDistFunc.bind(this);e.sort(l)}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!=f.default.NaviLiftType_Lift&&e.liftType!=f.default.NaviLiftType_Accessible||t.liftType!=f.default.NaviLiftType_Lift&&t.liftType!=f.default.NaviLiftType_Accessible?e.liftType==f.default.NaviLiftType_Lift||e.liftType==f.default.NaviLiftType_Accessible?-1:t.liftType==f.default.NaviLiftType_Lift||t.liftType==f.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==f.default.NaviLiftType_Escalator&&t.liftType==f.default.NaviLiftType_Escalator?e._dist<t._dist:e.liftType==f.default.NaviLiftType_Escalator?-1:t.liftType==f.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==f.default.NaviLiftType_Stair&&t.liftType==f.default.NaviLiftType_Stair?e._dist<t._dist:e.liftType==f.default.NaviLiftType_Stair?-1:t.liftType==f.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==p.default.PRIORITY_DEFAULT)for(var n=0;n<e.length;n++)e[n].liftType==f.default.NaviLiftType_Escalator?e[n]._dist-=this._firstPriorityOffset:e[n].liftType!=f.default.NaviLiftType_Lift&&e[n].liftType!=f.default.NaviLiftType_Accessible||(e[n]._dist-=this._secondPriorityOffset);else if(t==p.default.PRIORITY_STAIRFIRST)for(var i=0;i<e.length;i++)e[i].liftType==f.default.NaviLiftType_Stair?e[i]._dist-=this._firstPriorityOffset:e[i].liftType==f.default.NaviLiftType_Escalator&&(e[i]._dist-=this._secondPriorityOffset);else if(t==p.default.PRIORITY_ESCALATORFIRST)for(var r=0;r<e.length;r++)e[r].liftType==f.default.NaviLiftType_Escalator?e[r]._dist-=this._firstPriorityOffset:e[r].liftType!=f.default.NaviLiftType_Lift&&e[r].liftType!=f.default.NaviLiftType_Accessible||(e[r]._dist-=this._secondPriorityOffset);else if(t==p.default.PRIORITY_LIFTFIRST)for(var a=0;a<e.length;a++)e[a].liftType==f.default.NaviLiftType_Lift||e[a].liftType==f.default.NaviLiftType_Accessible?e[a]._dist-=this._firstPriorityOffset:e[a].liftType==f.default.NaviLiftType_Escalator&&(e[a]._dist-=this._secondPriorityOffset);else if(t==p.default.PRIORITY_STAIRONLY)for(var o=0;o<e.length;o++)e[o].liftType!=f.default.NaviLiftType_Stair&&(e[o]._dist=null);else if(t==p.default.PRIORITY_ESCALATORONLY)for(var s=0;s<e.length;s++)e[s].liftType!=f.default.NaviLiftType_Escalator&&(e[s]._dist=null);else if(t==p.default.PRIORITY_LIFTONLY)for(var l=0;l<e.length;l++)e[l].liftType!=f.default.NaviLiftType_Lift&&e[l].liftType!=f.default.NaviLiftType_Accessible&&(e[l]._dist=null);else if(t==p.default.PRIORITY_ACCESSIBLEONLY)for(var u=0;u<e.length;u++)e[u].liftType!=f.default.NaviLiftType_Accessible&&(e[u]._dist=null)}}]),n}(d.default),_=y;t.default=_},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0,n(34),n(63),n(50),n(4),n(180);var H=i(n(16));n(161);var C=i(n(29));n(45);var a=i(n(2)),o=i(n(3)),D=i(n(30)),j=i(n(67)),s=i(n(82)),u=i(n(499)),W=i(n(100)),Y=i(n(279)),h=i(n(181)),l=i(n(282)),q=i(n(281)),O=i(n(83)),c=(i(n(179)),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._tmp_adj_node_ids=[],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 W.default?this._calcZoneIdByCoord(e.point):this._calcZoneIdByCoord(e),this._endZoneId=t instanceof W.default?this._calcZoneIdByCoord(t.point):this._calcZoneIdByCoord(t),n&&(this._mode=n),this._naviGraph.consoleNodeInfos(),this._naviGraph.consoleRoadInfos(),e instanceof W.default)this._startNode=e;else if(O.default.ROUTE_FAILED_NO_DATA_START==this._processStartPoint(e,e))return O.default.ROUTE_FAILED_NO_DATA_START;if(this._naviGraph.consoleNodeInfos(),this._naviGraph.consoleRoadInfos(),t instanceof W.default)this._endNode=t;else if(O.default.ROUTE_FAILED_NO_DATA_END==this._processEndPoint(t,e instanceof W.default?e.point:e))return O.default.ROUTE_FAILED_NO_DATA_END;return this._naviGraph.consoleNodeInfos(),this._naviGraph.consoleRoadInfos(),null==this._startNode?O.default.ROUTE_FAILED_NO_DATA_START:null==this._endNode?O.default.ROUTE_FAILED_NO_DATA_END:(this._naviGraph.consoleNodeInfos(),this._naviGraph.consoleRoadInfos(),this._naviGraph.consoleAdjInfos(),this._routeCalculate())}},{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._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,j.default.NaviRoadHinderType_HINDER_HIGH)}this._variableModelPairs=[],this._unattachedTempRoads=[],this._attachedTempRoads=[],this._unattachedTempRoadTrees=[]}},{key:"_calcPointReachable",value:function(e){var t=this._naviGraph.queryContainExtentId(e);if(-1==t)return null;var n=this._calcZoneIdByCoord(e),i=-0,r=this._zoneIdGraph.get(n).findModel(e,i);if(null==r)return{extentId:t,model:null};if(r.pass==j.default.NaviModelPassType_PASS_THROUGH||r.pass==j.default.NaviModelPassType_PASS_NOT_THROUGH){if(0<r.doors.length)return{extentId:t,model:r};for(var a={},o=[],s=[],l=this._zoneIdGraph.get(n),u=l.roadVector,h=!0,c=r.points.length,d=0;d<c-1;d++)for(var f=r.points[d],p=r.points[d+1],m=0;m<u.length;m++){var v=u[m];if(1==D.default.calcCrossPoint(f,p,v.startPoint,v.endPoint,a)){if(h=!1,j.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:r};if(0==o.length)return null;r.doors=[],r.doorEntrys=[],r.doorTypes=[];for(var y=0;y<o.length;y++){var _=o[y],x=s[y],b=this._insertNodeToRoad(n,_,x);b.nodeType=j.default.NaviNodeType_COMMON,x.roadEntry==j.default.NaviRoadEntry_BOTH?b.entranceType=j.default.NaviEntranceType_ACCESS:D.default.pointInPolygon2d(r.points,x.startPoint,r.points.length-1)?(x.roadEntry==j.default.NaviRoadEntry_FORWARD&&(b.entranceType=j.default.NaviEntranceType_EXIT),x.roadEntry==j.default.NaviRoadEntry_BACK&&(b.entranceType=j.default.NaviEntranceType_ENTRANCE)):(x.roadEntry==j.default.NaviRoadEntry_FORWARD&&(b.entranceType=j.default.NaviEntranceType_ENTRANCE),x.roadEntry==j.default.NaviRoadEntry_BACK&&(b.entranceType=j.default.NaviEntranceType_EXIT)),r.doors.push(b),r.doorEntrys.push(b.entranceType),r.doorTypes.push(b.nodeType)}}return r.pass!=j.default.NaviModelPassType_NOT_PASS?{extentId:t,model:r}:null}},{key:"_processStartPoint",value:function(a,e){var o=this;this._startNode=this._insertTmpIsolatedNode(this._startZoneId,a);var t=null,i=!0;if(t=null!=this._startModel&&this._startModel.pass==j.default.NaviModelPassType_PASS_THROUGH&&0==this._startModel.doors.length?this._seekNearRoads(this._startZoneId,a,e,30,this._startModel):this._seekNearRoads(this._startZoneId,a,e),null==this._startModel&&(i=!1),0<t.size()){i=!1,t.each(function(e,t,n){for(n=0;n<t.length;n++)0!=t[n].road.roadEntry&&(i=!0)});var s=0,l=!1,u=[];if(t.each(function(e,t){var n=t[0].road,i=o._exploreUprightLikelyJoints(o._startZoneId,a,n,t,o._startModel);if(0==i.length)s++;else if(Math.abs(i[0].rotateAngle)>D.default.epsilon())u.push.apply(u,(0,C.default)(i));else{l=!0;var r=o._insertTempNodeToRoad(o._startZoneId,i[0].cross,i[0].road);o._joinTwoNodes(o._startZoneId,o._startNode,r)}}),l||u.forEach(function(e){var t=o._insertTempNodeToRoad(o._startZoneId,e.cross,e.road);o._joinTwoNodes(o._startZoneId,o._startNode,t)}),s==t.size())return O.default.ROUTE_FAILED_NO_DATA_START}if(i){for(var n=null,r=!1,h=0;h<this._startModel.doors.length;h++){n=this._startModel.doors[h];var c=this._startModel.doorEntrys[h];c!=j.default.NaviEntranceType_EXIT&&c!=j.default.NaviEntranceType_ACCESS||(this._joinTwoNodes(this._startZoneId,this._startNode,n),r=!0)}if(!r)return O.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,i=!0;if(t=null!=this._endModel&&this._endModel.pass==j.default.NaviModelPassType_PASS_THROUGH&&0==this._endModel.doors.length?this._seekNearRoads(this._endZoneId,a,e,30,this._endModel):this._seekNearRoads(this._endZoneId,a,e),null==this._endModel&&(i=!1),0<t.size()){i=!1,t.each(function(e,t,n){for(n=0;n<t.length;n++)0!=t[n].road.roadEntry&&(i=!0)});var s=0,l=!1,u=[];if(t.each(function(e,t){var n=t[0].road,i=o._exploreUprightLikelyJoints(o._endZoneId,a,n,t,o._endModel);if(0==i.length)s++;else if(Math.abs(i[0].rotateAngle)>D.default.epsilon())u.push.apply(u,(0,C.default)(i));else{l=!0;var r=o._insertTempNodeToRoad(o._endZoneId,i[0].cross,i[0].road);o._joinTwoNodes(o._endZoneId,o._endNode,r)}}),l||u.forEach(function(e){var t=o._insertTempNodeToRoad(o._endZoneId,e.cross,e.road);o._joinTwoNodes(o._endZoneId,o._endNode,t)}),s==t.size())return O.default.ROUTE_FAILED_NO_DATA_END}if(i){for(var n=null,r=!1,h=0;h<this._endModel.doors.length;h++){n=this._endModel.doors[h];var c=this._endModel.doorEntrys[h];c!=j.default.NaviEntranceType_EXIT&&c!=j.default.NaviEntranceType_ACCESS||(this._joinTwoNodes(this._endZoneId,this._endNode,n),r=!0)}if(!r)return O.default.ROUTE_FAILED_NO_DATA_END}}},{key:"_routeCalculate",value:function(){var e=this._isPointInPNTModel(this._startNode.point);e&&(this._switchVariableHinderTo(this._startZoneId,e,j.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,j.default.NaviRoadHinderType_HINDER_GENERAL),this._variableModelPairs.push({zoneId:this._endZoneId,model:t})),this._resultVector=[],this._startZoneId==this._endZoneId){var n,i=this._zoneIdSimpleDijkstraMap.get(this._startZoneId),r=i.routeCalculate(this._startNode,this._endNode,this._mode);if(r!=O.default.ROUTE_SUCCESS)return r;var a=i.getRouteCalculateResult();this._resultVector=[],a.reverse(),(n=this._resultVector).push.apply(n,(0,C.default)(a))}else{if(-1!=this._startZoneId&&-1==this._endZoneId){var o,s,l=this._findNearZoneDoor(this._startNode.point,this._startZoneId,j.default.NaviEntranceType_EXIT),u=this._zoneIdSimpleDijkstraMap.get(this._startZoneId),h=u.routeCalculate(this._startNode,l,this._mode);if(h!=O.default.ROUTE_SUCCESS)return h;var c=u.getRouteCalculateResult(c),d=this._zoneIdSimpleDijkstraMap.get(-1);if(h=d.routeCalculate(l,this._endNode,this._mode),h!=O.default.ROUTE_SUCCESS)return h;var f=d.getRouteCalculateResult();c.reverse(),f.reverse(),(o=this._resultVector).push.apply(o,(0,C.default)(c)),(s=this._resultVector).push.apply(s,(0,C.default)(f))}if(-1==this._startZoneId&&-1!=this._endZoneId){var p,m,v=this._findNearZoneDoor(this._endNode.point,this._endZoneId,j.default.NaviEntranceType_ENTRANCE),g=this._zoneIdSimpleDijkstraMap.get(this._endZoneId),y=g.routeCalculate(v,this._endNode,this._mode);if(y!=O.default.ROUTE_SUCCESS)return y;var _=g.getRouteCalculateResult(),x=this._zoneIdSimpleDijkstraMap.get(-1);if(y=x.routeCalculate(this._startNode,v,this._mode),y!=O.default.ROUTE_SUCCESS)return y;var b=x.getRouteCalculateResult();b.reverse(),_.reverse(),(p=this._resultVector).push.apply(p,(0,C.default)(b)),(m=this._resultVector).push.apply(m,(0,C.default)(_))}if(-1!=this._startZoneId&&-1!=this._endZoneId){var w,M,T,E=this._findNearZoneDoor(this._startNode.point,this._startZoneId,j.default.NaviEntranceType_EXIT),S=this._zoneIdSimpleDijkstraMap.get(this._startZoneId),A=S.routeCalculate(this._startNode,E,this._mode);if(A!=O.default.ROUTE_SUCCESS)return A;var L=S.getRouteCalculateResult(L),I=this._findNearZoneDoor(this._endNode.point,this._endZoneId,j.default.NaviEntranceType_ENTRANCE),k=this._zoneIdSimpleDijkstraMap.get(this._endZoneId);if(A=k.routeCalculate(I,this._endNode,this._mode),A!=O.default.ROUTE_SUCCESS)return A;var R=k.getRouteCalculateResult(R),N=this._zoneIdSimpleDijkstraMap.get(-1);if(A=N.routeCalculate(E,I,this._mode),A!=O.default.ROUTE_SUCCESS)return A;var P=N.getRouteCalculateResult();L.reverse(),P.reverse(),R.reverse(),(w=this._resultVector).push.apply(w,(0,C.default)(L)),(M=this._resultVector).push.apply(M,(0,C.default)(P)),(T=this._resultVector).push.apply(T,(0,C.default)(R))}}return O.default.ROUTE_SUCCESS}},{key:"_getIndexFormID",value:function(e,t,n){for(var i=0;i<t;i++)if(null!=e[i]&&e[i].Id==n)return i;return-1}},{key:"_calcZoneIdByCoord",value:function(e){for(var t=this._naviGraph.zones,n=0;n<t.length;n++){var i=t[n];if(i.contain(e))return i.Id}return-1}},{key:"_segmentByZones",value:function(){for(var n=this,e=this._naviGraph.zones,t=0;t<e.length;t++){var i=e[t],r=this._sliceGraph(this._naviGraph,i);this._zoneIdGraph.put(i.Id,r)}this._zoneIdGraph.put(-1,this._naviGraph),this._zoneIdGraph.each(function(e,t){t.simplify(),n._zoneIdSimpleDijkstraMap.put(e,new l.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 i=0,r=0,a=e.roadVector.length,o=e.nodeVector.length,s=e.roadVector,l=e.nodeVector,u=0,h=new Int8Array(a),c=0;c<a;c++)if(s[c]&&s[c].roadEntry!=j.default.NaviRoadEntry_FORBID){var d=s[c];i=t.contain(d.startPoint),r=t.contain(d.endPoint),0==i&&0==r||(u=!0),1==i&&1==r&&(h[c]=1),1==i&&0==r&&(h[c]=2),0==i&&1==r&&(h[c]=3),0==i&&0==r&&(h[c]=4),2==i&&0==r&&(h[c]=6),2==i&&1==r&&(h[c]=7),0==i&&2==r&&(h[c]=8),1==i&&2==r&&(h[c]=9)}if(0==u)return null;for(var f=new Array(o),p=new Array(a),m=0,v=new Int8Array(o),g=h.length,y=0,_=g;y<_;y++)if(0!=h[y]&&6!=h[y]&&8!=h[y]&&1!=h[y]&&s[y]){var x=s[y],b=x.roadEntry,w=[x.Id];if(2==h[y]||9==h[y]){var M=null;M=2==h[y]?t.calcCrossPoint(x.startPoint,x.endPoint):(0,H.default)({},x.endPoint);var T=new W.default;T.Id=this._naviGraph.generateNodeId(),T.nodeType=j.default.NaviNodeType_COMMON,T.liftType=j.default.NaviLiftType_NULL,T.entranceType=j.default.NaviEntranceType_ACCESS,T.point=(0,H.default)({},M);var E=new Y.default;E.setRoad(x),E.Id=this._naviGraph.generateRoadId(),w.push(E.Id),T.segLinks=w;var S=new W.default;S.setNode(T),b==j.default.NaviRoadEntry_FORWARD?S.entranceType=j.default.NaviEntranceType_EXIT:b==j.default.NaviRoadEntry_BACK&&(S.entranceType=j.default.NaviEntranceType_ENTRANCE),t._linkAccessNodes.push(S),m=this._getIndexFormID(l,o,E.endId),E.endPoint=(0,H.default)({},S.point),E.pointVector[1]=(0,H.default)({},S.point),E.endId=S.Id,E.calcLength(),p[y]=E,f[m]=S,m=this._getIndexFormID(l,o,E.startId),f[m]=l[m],f[m].segLinks.splice(f[m].segLinks.indexOf(x.Id),1,E.Id);var A=new W.default;A.setNode(T),x.startId=A.Id,x.startPoint=(0,H.default)({},A.point),x.pointVector[0]=(0,H.default)({},A.point),x.calcLength(),l[m].segLinks.splice(l[m].segLinks.indexOf(x.Id),1),l.push(A),v[m]=2}else if(3==h[y]||7==h[y]){var L=null;L=3==h[y]?t.calcCrossPoint(x.startPoint,x.endPoint):(0,H.default)({},x.startPoint);var I=new W.default;I.Id=this._naviGraph.generateNodeId(),I.nodeType=j.default.NaviNodeType_COMMON,I.liftType=j.default.NaviLiftType_NULL,I.entranceType=j.default.NaviEntranceType_ACCESS,I.point=(0,H.default)({},L);var k=new Y.default;k.setRoad(x),k.Id=this._naviGraph.generateRoadId(),w.push(k.Id),I.segLinks=w;var R=new W.default;R.setNode(I),b==j.default.NaviRoadEntry_FORWARD?R.entranceType=j.default.NaviEntranceType_ENTRANCE:b==j.default.NaviRoadEntry_BACK&&(R.entranceType=j.default.NaviEntranceType_EXIT),t._linkAccessNodes.push(R),m=this._getIndexFormID(l,o,k.startId),k.startPoint=(0,H.default)({},R.point),k.pointVector[0]=(0,H.default)({},R.point),k.startId=R.Id,k.calcLength(),p[y]=k,f[m]=R,m=this._getIndexFormID(l,o,k.endId),f[m]=l[m],f[m].segLinks.splice(f[m].segLinks.indexOf(x.Id),1,k.Id);var N=new W.default;N.setNode(I),x.endId=N.Id,x.endPoint=(0,H.default)({},N.point),x.pointVector[1]=(0,H.default)({},N.point),x.calcLength(),l[m].segLinks.splice(l[m].segLinks.indexOf(x.Id),1),l.push(N),v[m]=2}}for(var P=0,C=g;P<C;P++)if(1==h[P]){var D=s[P];D&&(p[P]=D,m=this._getIndexFormID(l,o,D.startId),2!=v[m]&&(f[m]=l[m],v[m]=1),m=this._getIndexFormID(l,o,D.endId),2!=v[m]&&(f[m]=l[m],v[m]=1),s[P]=null)}for(var O=0;O<o;O++)1==v[O]&&(l[O]=null);for(var F=new q.default(f,p,!0,1),B=[],G=e.obstructModels,z=0;z<G.length;z++){var U=G[z];if(U){var V=this._modelInZone(U,t);V&&B.push(U)}}return(n=F.obstructModels).push.apply(n,B),F}}},{key:"_assemblePassNotThroughModels",value:function(){var o=this;this._zoneIdGraph.each(function(e,t){for(var n=t.obstructModels,i=0;i<n.length;i++){var r=n[i];if(j.default.NaviModelPassType_PASS_NOT_THROUGH==r.pass){var a=o._zonePNTModelsMap.get(e);a||(a=[],o._zonePNTModelsMap.put(e,a)),a.push(r)}}}),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,i=0;i<n.length;i++){var r=n[i];if(j.default.NaviModelPassType_NOT_PASS==r.pass){var a=o._zoneNPModelsMap.get(e);a||(a=[],o._zoneNPModelsMap.put(e,a)),a.push(r)}}}),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,i=0;i<t.length;i++){for(var r=t[i],a=0;a<n.length;a++){var o=n[a].calcMiddlePoint();if(D.default.pointInPolygon2d(r.points,o,r.pointCount)){n[a].length=n[a].length*l._kScaleVariable;var s=l._modelIdRoadsMap.get(r.Id);s||(s=[],l._modelIdRoadsMap.put(r.Id,s)),s.push(n[a])}}l._switchVariableHinderTo(e,r,j.default.NaviRoadHinderType_HINDER_HIGH)}})}},{key:"_adjustNPModelRoads",value:function(){var p=this;this._zoneNPModelsMap.each(function(e,t){for(var n=p._zoneIdGraph.get(e),i=n.roadVector,r=0;r<t.length;r++)for(var a=t[r],o=0;o<i.length;o++){var s=i[o],l=s.roadEntry,u=s.calcMiddlePoint();if(D.default.pointInPolygon2d(a.points,u,a.pointCount-1)){if(s.length=Number.MAX_VALUE,l==j.default.NaviRoadEntry_BOTH||l==j.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==j.default.NaviRoadEntry_BOTH||s.roadEntry==j.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 i=this._modelIdRoadsMap.get(t.Id);if(i){if(j.default.NaviRoadHinderType_HINDER_HIGH==n)for(var r=0;r<i.length;r++){var a=i[r];if(a.calcLength(),a.length=i.length*this._kScaleVariable,a.roadEntry==j.default.NaviRoadEntry_BOTH||a.roadEntry==j.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==j.default.NaviRoadEntry_BOTH||a.roadEntry==j.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(j.default.NaviRoadHinderType_HINDER_GENERAL==n)for(var h=0;h<i.length;h++){var c=i[h];if(c.calcLength(),c.roadEntry==j.default.NaviRoadEntry_BOTH||c.roadEntry==j.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==j.default.NaviRoadEntry_BOTH||c.roadEntry==j.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 i=this._naviGraph.getZone(t);if(null==i)return null;for(var r=this._zoneIdGraph.get(t).findModel(e,a),a=r.area,o=Number.MAX_VALUE,s=null,l=0;l<i._linkAccessNodes.length;l++){var u=i._linkAccessNodes[l],h=D.default.distanceOfTwoPoints(u.point,e);if((u.entranceType==j.default.NaviEntranceType_ACCESS||u.entranceType==n)&&h<o){var c=this._findMinAreaNearestObstructModel(t,u.point);if(c!=r){if(c.pass==j.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,i=null,r=this._zoneIdGraph.get(e),a=Number.MAX_VALUE,o=Number.MAX_VALUE,s=null,l=r.obstructModels,u=0;u<l.length;u++){var h=l[u];if(n=D.default.pointToPolygon2d(h.points,t,h.points.length-1),n<o&&(o=n,s=h),this._kDoorToler>n){var c=h.area;c<a&&(a=c,i=h)}}return null==i?s:i}},{key:"_modelInZone",value:function(e,t){if(e.bb.isSeparate(t.bb))return!1;var n=e.center;return!!D.default.pointInPolygon2d(t.points,n,t.pointCount)}},{key:"_insertTempNodeToRoad",value:function(e,t,n){var i=this._tmp_adj_node_ids.find(function(e){return e==n.startId}),r=this._tmp_adj_node_ids.find(function(e){return e==n.endId});null==i&&this._tmp_adj_node_ids.push(n.startId),null==r&&this._tmp_adj_node_ids.push(n.endId);for(var a=this._unattachedTempRoadTrees,o=null,s=0;s<a.length;s++)if(a[s]._wrappedRoad==n){o=a[s];break}if(null==o)o={},o._wrappedRoad=n,a.push(o);else for(;null!=o._fromChild;){var l=o._fromChild._wrappedRoad;o=D.default.pointIsInRect1(t,l.startPoint,l.endPoint)?o._fromChild:o._toChild}n=o._wrappedRoad;var u=new W.default;u.Id=this._newTmpId(),u.point=t;var h=new Y.default;h.Id=this._newTmpId(),h.startId=n.startId,h.startPoint=n.startPoint,h.endId=u.Id,h.endPoint=u.point,h.pointVector=[n.startPoint,u.point];var c=new Y.default;c.Id=this._newTmpId(),c.startId=u.Id,c.startPoint=u.point,c.endId=n.endId,c.endPoint=n.endPoint,c.pointVector=[u.point,n.endPoint],this._unattachedTempRoads.push(h),this._unattachedTempRoads.push(c);var d={};d._wrappedRoad=h;var f={};f._wrappedRoad=c,o._fromChild=d,o._toChild=f,u.tempType=1,h.tempType=1,c.tempType=1,h.calcLength(),c.calcLength(),h.roadEntry=0,c.roadEntry=0;var p=this._zoneIdGraph.get(e);p.nodeVector.push(u),p.roadVector.push(h),p.roadVector.push(c);var m=this._zoneIdSimpleDijkstraMap.get(e)._naviGraph;if(m._nodeMap.put(u.Id,p.nodeVector.length-1),n.roadEntry==j.default.NaviRoadEntry_BOTH){var v=[];v.push({nodeId:n.startId,length:h.length}),v.push({nodeId:n.endId,length:c.length}),m.adjList.put(u.Id,v),v=m.adjList.get(n.startId),v||(v=[],m.adjList.put(n.startId,v)),v.push({nodeId:u.Id,length:h.length}),v=m.adjList.get(n.endId),v||(v=[],m.adjList.put(n.endId,v)),v.push({nodeId:u.Id,length:c.length})}if(n.roadEntry==j.default.NaviRoadEntry_FORWARD){var g=[];g.push({nodeId:n.endId,length:c.length}),m.adjList.put(u.Id,g),g=m.adjList.get(n.startId),g||(g=[],m.adjList.put(n.startId,g)),g.push({nodeId:u.Id,length:h.length})}if(n.roadEntry==j.default.NaviRoadEntry_BACK){var y=[];y.push({nodeId:n.startId,length:h.length}),m.adjList.put(u.Id,y),y=m.adjList.get(n.endId),y||(y=[],m.adjList.put(n.endId,y)),y.push({nodeId:u.Id,length:c.length})}return u}},{key:"_insertItemToVector",value:function(e,t){for(var n=t.length-1;0<=n;n--)if(t[n].Id&&0<t[n].Id)return t.splice(n+1,0,e),n+1;return-1}},{key:"_insertNodeToRoad",value:function(e,t,n,i){if(i)return this._insertTempNodeToRoad(e,t,n);var r=this._zoneIdGraph.get(e),a=new W.default;a.Id=r.generateNodeId(),a.point=t;var o=new Y.default;o.Id=r.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 Y.default;s.Id=r.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=r.nodeVector,h=r.roadVector,c=this._insertItemToVector(a,u);if(this._insertItemToVector(o,h),this._insertItemToVector(s,h),r._nodeMap.put(a.Id,c),n.roadEntry==j.default.NaviRoadEntry_BOTH){var d=[];d.push({nodeId:n.startId,length:o.length}),d.push({nodeId:n.endId,length:s.length}),r.adjList.put(a.Id,d),d=r.adjList.get(n.startId),d||(d=[],r.adjList.put(n.startId,d)),d.push({nodeId:a.Id,length:o.length}),d=r.adjList.get(n.endId),d||(d=[],r.adjList.put(n.endId,d)),d.push({nodeId:a.Id,length:s.length})}if(n.roadEntry==j.default.NaviRoadEntry_FORWARD){var f=[];f.push({nodeId:n.endId,length:s.length}),r.adjList.put(a.Id,f),f=r.adjList.get(n.startId),f||(f=[],r.adjList.put(n.startId,f)),f.push({nodeId:a.Id,length:o.length})}if(n.roadEntry==j.default.NaviRoadEntry_BACK){var p=[];p.push({nodeId:n.startId,length:o.length}),r.adjList.put(a.Id,p),p=r.adjList.get(n.endId),p||(p=[],r.adjList.put(n.endId,p)),p.push({nodeId:a.Id,length:s.length})}return 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 i=t.nodeVector[n];if(null==i||0<=i.Id)break;t.nodeVector.splice(n,1)}for(var r=t.roadVector.length-1;0<=r;r--){var a=t.roadVector[r];if(null==a||0<=a.Id)break;t.roadVector.splice(r,1)}}}},{key:"_deleteTmpConnectionEntirely",value:function(e,t){var n=e.get(t);if(n)for(var i=0;i<n.length;i++)n[i].nodeId<0&&(n.splice(i,1),i--)}},{key:"_removeConnection",value:function(e,t){for(var n=e.get(t),i=0;i<n.length;i++)this._deleteTmpConnectionEntirely(e,n[i].nodeId);e.remove(t)}},{key:"_calcNearestAdherence",value:function(e,t,n,i,r,a){r.toDistance=Number.MAX_VALUE,r.stickToRoad=!1,r.rotateAngle=0;for(var o=Number.MAX_VALUE,s={},l=this._zoneIdGraph.get(e),u=0;u<l.roadVector.length;u++){var h=l.roadVector[u];if(null!=h){var c=D.default.quickRayIntersect(t,n,h.startPoint,h.endPoint,s);if(c){var d=D.default.distanceOfTwoPoints(t,s);d<o&&(o=d,r.cross=(0,H.default)({},s),r.distance=o,r.road=h,r.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&&j.default.NaviModelPassType_DECORATE!=m.pass&&(null==a||!D.default.pointInPolygon2d(m.points,a.center,m.points.length-1)))for(var v=m.points.length,g=0;g<v-1;g++){var y=D.default.quickRayIntersect(t,n,m.points[g],m.points[g+1],f);if(y){var _=D.default.distanceOfTwoPoints(t,f);if(_<o)return o=_,r.model=m,r.distance=Number.MAX_VALUE,r.stickToRoad=!1,r.obstructType=j.default.NaviObstructType_MODEL,!1}}}for(var x={},b=l.obstructExtents,w=0;w<b.length;w++){for(var M=b[w],T=b[w].holes,E=0;E<T.length;E++)for(var S=T[E],A=0;A<S.length-1;A++){var L=D.default.quickRayIntersect(t,n,S[A],S[A+1],x);if(L){var I=D.default.distanceOfTwoPoints(t,x);if(I<o)return o=I,r.model=M,r.distance=Number.MAX_VALUE,r.stickToRoad=!1,r.obstructType=j.default.NaviObstructType_EXTENT,!1}}for(var k=b[w].points,R=0;R<k.length-1;R++){var N=D.default.quickRayIntersect(t,n,k[R],k[R+1],x);if(N){var P=D.default.distanceOfTwoPoints(t,x);if(P<o)return o=P,r.model=M,r.distance=Number.MAX_VALUE,r.stickToRoad=!1,r.obstructType=j.default.NaviObstructType_EXTENT,!1}}}return r.toDistance=D.default.distanceOfTwoPoints(r.cross,i),!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,i=n.length-1;0<=i;i--){var r=n[i];if(null==r||0<=r.Id)break;n.splice(i,1)}for(var a=t.roadVector,o=a.length-1;0<=o;o--){var s=a[o];if(null==s||0<=s.Id)break;a.splice(o,1)}}}},{key:"_clearTempAdjList",value:function(){var s=this;this._zoneIdSimpleDijkstraMap.each(function(e,t){for(var n=[],i=t._naviGraph.adjList,r=0;r<i.keys.length;r++)i.keys[r]<0&&n.push(i.keys[r]);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(i,s._tmp_adj_node_ids[o])})}},{key:"_exploreUprightLikelyJoints",value:function(e,t,n,i,r){for(var a=[],o=0;o<i.length;o++)if(i[o].distance<D.default.epsilon())return a.push(i[o]),a;var s={x:0,y:0},l=D.default.calcFootOfUpright(t,n.startPoint,n.endPoint,s),u={};if(l&&this._isTwoPointsConnectedDirectly(t,s,u,r)){var h={};return h.cross=s,h.stickToRoad=!0,h.road=n,h.rotateAngle=0,h.dist=D.default.distanceOfTwoPoints(t,s),a.push(h),a}for(var c={x:s.x-t.x,y:s.y-t.y},d=0;d<i.length;d++){var f=i[d],p={x:f.cross.x-t.x,y:f.cross.y-t.y},m=D.default.calcRotateAngle(p,c);m=270<m?m-360:m,f.rotateAngle=m}i.sort(this._adherenceAngleCompare);var v=null,g=null;if(i[i.length-1].rotateAngle<0)return v=i[i.length-1],a.push(v),a;for(var y=0;y<i.length;y++)if(0<i[y].rotateAngle)return v=i[y],0==y?a.push(v):(g=i[y-1],D.default.distanceOfTwoPoints(v.cross,n.startPoint)>D.default.distanceOfTwoPoints(g.cross,n.startPoint)?(a.push(g),a.push(v)):(a.push(v),a.push(g))),a;return a}},{key:"_calcExpectedAdherance",value:function(e,t,n,i,r,a){for(var o=r||30,s=0;s<360;s+=o){var l=new u.default;this._calcNearestAdherence(e,t,s,n,l,a),1==l.stickToRoad&&i.push(l)}i.sort(this._adherenceCompare)}},{key:"_seekNearRoads",value:function(e,t,n,i,r){var a=new h.default,o=[];for(this._calcExpectedAdherance(e,t,n,o,i,r);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)),o.splice(0,1)}return a}},{key:"_insertTmpIsolatedNode",value:function(e,t){var n=new W.default;n.Id=this._newTmpId(),n.point=(0,H.default)({},t);var i=this._zoneIdGraph.get(e);i.nodeVector.push(n);var r=this._zoneIdSimpleDijkstraMap.get(e);return r._naviGraph._nodeMap.put(n.Id,i.nodeVector.length-1),n}},{key:"_insertIsolatedNode",value:function(e,t,n){if(n)return this._insertTmpIsolatedNode(e,t);var i=new W.default;i.Id=this._naviGraph.generateNodeId(),i.point=(0,H.default)({},t);var r=this.zoneIdGraph.get(e),a=r.nodeVector,o=this._insertItemToVector(i,a);return r._nodeMap.put(i.Id,o),i}},{key:"_isTwoPointsConnectedDirectly",value:function(e,t,n,i){for(var r=this._zoneIdGraph.get(-1),a=null,o=0;o<r.obstructModels.length;o++)if(a=r.obstructModels[o],null!=a&&a!=i&&j.default.NaviModelPassType_DECORATE!=a.pass)for(var s=a.points,l=0;l<s.length-1;l++)if(D.default.calcCrossPoint(e,t,s[l],s[l+1],n)){var u=D.default.distanceOfTwoPoints(e,n),h=D.default.distanceOfTwoPoints(t,n);if(!(u<=D.default.epsilon()||h<=D.default.epsilon()))return!1}for(var c=r.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(D.default.calcCrossPoint(e,t,v[g],v[g+1],n))return!1;for(var y=f.points,_=0;_<y.length-1;_++)if(D.default.calcCrossPoint(e,t,y[_],y[_+1],n))return!1}return!0}},{key:"_joinTwoNodes",value:function(e,t,n,i,r,a){for(var o=0;o<this._attachedTempRoads.length;o++){var s=this._attachedTempRoads[o],l={};if(1==D.default.calcCrossPoint(s.startPoint,s.endPoint,t.point,n.point,l)&&D.default.distanceOfTwoPoints(t.point,l)>D.default.epsilon())return null}void 0===i&&(i=j.default.NaviRoadEntry_BOTH),void 0===r&&(r=!0),void 0===a&&(a=!0);var u=new Y.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=r?this._newTmpId():this._naviGraph.generateRoadId(),u.roadEntry=i,u.calcLength(),a&&this._attachedTempRoads.push(u);var h=this._zoneIdGraph.get(e);h.roadVector.push(u);var c=this._zoneIdSimpleDijkstraMap.get(e);if(j.default.NaviRoadEntry_BOTH==i){var d={nodeId:n.Id,length:u.length},f=c._naviGraph.adjList.get(t.Id);f?f.push(d):(f=[],f.push(d),c._naviGraph.adjList.put(t.Id,f)),d={nodeId:t.Id,length:u.length},f=c._naviGraph.adjList.get(n.Id),f?f.push(d):(f=[],f.push(d),c._naviGraph.adjList.put(n.Id,f))}if(j.default.NaviRoadEntry_FORWARD==i){var p={nodeId:n.Id,length:u.length},m=c._naviGraph.adjList.get(t.Id);m?m.push(p):(m=[],m.push(p),c._naviGraph.adjList(t.Id,m))}if(j.default.NaviRoadEntry_BACK==i){var v={nodeId:t.Id,length:u.length};m=c._naviGraph.adjList.get(n.Id),m?m.push(v):(m=[],m.push(v),c._naviGraph.adjList.put(n.Id,m))}return u}},{key:"_isPointInPNTModel",value:function(e){var t=this._calcZoneIdByCoord(e),n=this._zonePNTModelsMap.get(t);if(n)for(var i=0;i<n.length;i++){var r=n[i];if(D.default.pointInPolygon2d(r.points,e,r.points.length))return r}return null}},{key:"_newTmpId",value:function(){return this._tmpId--}}]),t}()),d=c;t.default=d},function(e,t,n){"use strict";var i=n(1),r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(2)),o=i(n(67)),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 i=n(1);n(123);var p=i(n(24)),r=i(n(95));function m(e,t,n,i,r,a){var o=(e+n)/2,s=(t+i)/2,l=((e-n)*(e-n)+(t-i)*(t-i))/4,u=Math.sqrt(l),h=Math.sqrt(r*r-l),c=u/h,d=u*c,f=Math.PI/2,p=1,m=(n-e)/(t-i),v=-1,g=(e-n)/(t-i),y=Math.sqrt(p*p+m*m),_=Math.sqrt(v*v+g*g),x=p/y,b=m/y,w=v/_,M=g/_,T={x:o+d*x,y:s+d*b,theta:f},E={x:o+d*w,y:s+d*M,theta:f};return 0<(n-e)*(T.y-t)-(i-t)*(T.x-e)?0===a?T:E:0===a?E:T}function s(e,t,n,i){for(var r=0;r<e.length;r++)switch(e[r]){case"m":t.moveTo(i.x+(0,p.default)(e[r+1]),i.y+(0,p.default)(e[r+2])),n.x=i.x+(0,p.default)(e[r+1]),n.y=i.y+(0,p.default)(e[r+2]),i.x=n.x,i.y=n.y,r+=2;break;case"M":t.moveTo((0,p.default)(e[r+1]),(0,p.default)(e[r+2])),n.x=(0,p.default)(e[r+1]),n.y=(0,p.default)(e[r+2]),i.x=n.x,i.y=n.y,r+=2;break;case"l":t.lineTo(n.x+(0,p.default)(e[r+1]),n.y+(0,p.default)(e[r+2])),n.x=n.x+(0,p.default)(e[r+1]),n.y=n.y+(0,p.default)(e[r+2]),r+=2;break;case"L":t.lineTo((0,p.default)(e[r+1]),(0,p.default)(e[r+2])),n.x=(0,p.default)(e[r+1]),n.y=(0,p.default)(e[r+2]),r+=2;break;case"A":var a=(0,p.default)(e[r+1]),o=(0,p.default)(e[r+2]),s=((0,p.default)(e[r+3]),Math.PI,(0,p.default)(e[r+4]),(0,p.default)(e[r+5])),l=n.x,u=n.y,h=(0,p.default)(e[r+6]),c=(0,p.default)(e[r+7]);if(a===o){var d=m(l,u,h,c,a,s);t.arcTo(d.x,d.y,h,c,d.theta),n.x=h,n.y=c}r+=7;break;case"a":if(a=(0,p.default)(e[r+1]),o=(0,p.default)(e[r+2]),(0,p.default)(e[r+3]),Math.PI,(0,p.default)(e[r+4]),s=(0,p.default)(e[r+5]),l=n.x,u=n.y,h=l+(0,p.default)(e[r+6]),c=u+(0,p.default)(e[r+7]),a===o){var f=m(l,u,h,c,a,s);t.arcTo(f.x,f.y,h,c,f.theta),n.x=h,n.y=c}r+=7;break;case"h":t.lineTo(n.x+(0,p.default)(e[r+1]),n.y),n.x=n.x+(0,p.default)(e[r+1]),r+=1;break;case"H":t.lineTo((0,p.default)(e[r+1]),n.y),n.x=(0,p.default)(e[r+1]),r+=1;break;case"z":case"Z":t.lineTo(i.x,i.y)}}var l=["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"],u=["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"],h=["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"],c=["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"],d=["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"],f=["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"],v=["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(){var e=document.createElement("canvas"),t=e.getContext("2d");e.width=500,e.height=120,e.style.width="500px",e.style.height="120px";var n={x:0,y:0},i={x:0,y:0};t.transform(5,0,0,5,10,10);var r=t.createLinearGradient(5.9,15.07,5.9,0);r.addColorStop(0,"#232323"),r.addColorStop(1,"#585858"),t.fillStyle=r,t.beginPath(),s(l,t,i,n),t.closePath(),t.fill(),t.beginPath(),s(u,t,i,n),t.closePath(),t.fill(),t.beginPath(),s(h,t,i,n),t.closePath(),t.fill(),t.beginPath(),s(c,t,i,n),t.closePath(),t.fill();var a=t.createLinearGradient(57.68,15.07,57.68,0);a.addColorStop(0,"#77bf00"),a.addColorStop(1,"#addc0c"),t.fillStyle=a,t.beginPath(),s(d,t,i,n),t.closePath(),t.fill(),t.beginPath(),s(f,t,i,n),t.closePath(),t.fill(),t.beginPath(),s(v,t,i,n),t.closePath(),t.fill();var o=new fm.CanvasTexture(e);return o}r.default.f=l,r.default.e=u,r.default.n=h,r.default.g=c,r.default.m=d,r.default.a=f,r.default.p=v,r.default.d=a}],i={},r.m=n,r.c=i,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=283).default;function r(e){if(i[e])return i[e].exports;var t=i[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}var n,i});