cesium_dev_kit 1.0.63 → 1.0.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -2,4 +2,4 @@ import e from"libgif";import*as i from"@turf/turf";import{GUI as n}from"dat.gui"
2
2
  color.r = color.r * ${i.filterRGB[0]}.0/255.0;
3
3
  color.g = color.g * ${i.filterRGB[1]}.0/255.0;
4
4
  color.b = color.b * ${i.filterRGB[2]}.0/255.0;
5
- `),-1!==a.indexOf(r)&&(n[e]=n[e].replace(r,t))}}getCurCenterlonLat(t){t=t.camera.pickEllipsoid(new o.Cartesian2(t.canvas.clientWidth/2,t.canvas.clientHeight/2)),t=o.Ellipsoid.WGS84.cartesianToCartographic(t);return{lon:180*t.longitude/Math.PI,lat:180*t.latitude/Math.PI}}}let l=null;function c(t,e,i){t&&(l=e,this._graphicsLayer=new l.CustomDataSource("graphicsLayer"),t)&&t.dataSources.add(this._graphicsLayer)}c.prototype={getPointGraphics:function(t){if(t=t||{})return new l.PointGraphics({color:t.color||l.Color.GREEN,pixelSize:t.pixelSize||5,outlineColor:t.outlineColor||l.Color.WHITE,outlineWidth:t.outlineWidth||1})},getLineGraphics:function(t){if((t=t||{})&&t.positions)return new l.PolylineGraphics({show:!0,positions:t.positions,material:t.material||l.Color.YELLOW,width:t.width||1,clampToGround:t.clampToGround||!1})},getPolygonGraphics:function(t){if((t=t||{})&&t.positions)return new l.PolygonGraphics({hierarchy:{positions:t.positions},material:t.material||l.Color.RED.withAlpha(.2),clampToGround:t.clampToGround||!1})},getLabelGraphics:function(t){if((t=t||{})&&t.l_text)return new l.LabelGraphics({text:t.l_text,font:t.l_font||"14px sans-serif",fillColor:t.l_fillColor||l.Color.GOLD,style:t.l_style||l.LabelStyle.FILL_AND_OUTLINE,outlineWidth:t.l_outlineWidth||2,showBackground:t.l_showBackground||!1,backgroundColor:t.l_backgroundColor||new l.Color(.165,.165,.165,.8),verticalOrigin:t.l_verticalOrigin||l.VerticalOrigin.BOTTOM,pixelOffset:t.l_pixelOffset||new l.Cartesian2(0,-30)})},getBillboardGraphics:function(t){if((t=t||{})&&t.b_img)return new l.BillboardGraphics({image:t.b_img,width:t.b_width||35,height:t.b_height||35,clampToGround:t.b_clampToGround||!0,scale:t.b_scale||1,pixelOffset:t.b_pixelOffset||new l.Cartesian2(0,-20),scaleByDistance:t.b_scaleByDistance||void 0})},getPathGraphics:function(t){if(t=t||{})return new l.PathGraphics({resolution:t.resolution||1,material:new l.PolylineGlowMaterialProperty({glowPower:t.glowPower||.1,color:t.color||l.Color.YELLOW}),width:t.width||30})},getModelGraphics:function(t){if(t=t||{})return new l.ModelGraphics({uri:t.m_url,scale:t.m_scale||28,minimumPixelSize:t.m_minimumPixelSize||30,color:t.m_color||l.Color.WHITE})},getEllipseGraphics:function(t){if(t=t||{})return new l.EllipseGraphics({semiMajorAxis:t.e_semiMinorAxis||1e6,semiMinorAxis:t.e_semiMinorAxis||1e6,metarial:t.e_metarial||l.Color.RED.withAlpha(.5),outline:t.e_outline||!0})},getEllipsoidGraphics:function(t){var e;if(t=t||{})return e=t.radii||1e6,new l.EllipsoidGraphics({radii:new l.Cartesian3(e,e,e),maximumCone:t.maximumCone||l.Math.PI_OVER_TWO,stackPartitions:t.stackPartitions||56,slicePartitions:t.slicePartitions||56,outlineWidth:t.outlineWidth||2,outlineColor:t.outlineColor||l.Color.YELLOW,outline:t.outline||!0,fill:t.fill||!0,material:t.material||l.Color.RED.withAlpha(.1)})},getBoxGraphics:function(t){if(t=t||{show:!0,outline:!1,fill:!0})return new l.BoxGraphics({show:t.show,fill:t.fill,dimensions:t.dimensions||new l.Cartesian3(0,0,0),material:t.material,outline:t.outline,outlineColor:t.outlineColor||l.Color.BLACK,distanceDisplayCondition:t.distanceDisplayCondition||void 0})},getPlaneGraphics:function(t){if(t=t||{})return new l.PlaneGraphics({plane:t.plane||new l.Plane(l.Cartesian3.UNIT_Y,0),dimensions:t.dimensions||new l.Cartesian2(170,130),material:t.material||l.Color.BLUE})},getCylinderGraphics:function(t){if(t=t||{})return new l.CylinderGraphics({HeightReference:l.HeightReference.RELATIVE_TO_GROUND,length:t.length||250,topRadius:t.topRadius||0,bottomRadius:t.bottomRadius||0,material:t.material||new l.Color(0,1,1,.4),slices:t.slices||128})},createPointsGraphics:function(t){if(t&&t.positions){var e,i=[];for(e in t.positions){var n=t.positions[e],a=this.createGraphics();a.name=t.name||"",a.oid=t.oid||"point",a.position=n,t.point&&(a.point=this.getPointGraphics()),t.billboard&&(a.billboard=this.getBillboardGraphics(t.billboard)),t.label&&(a.label=this.getLabelGraphics(t.label)),i.push(this._graphicsLayer.entities.add(a))}return i}},createLineGraphics:function(t){var e;if(t&&t.positions)return(e=this.createGraphics()).name=t.name||"",e.oid=t.oid||"line",e.position=t.positions,e.polyline=this.getLineGraphics(t),this._graphicsLayer.entities.add(e)},createPolygonGraphics:function(t){var e;if(t=t||{})return(e=this.createGraphics()).polygon=this.getPolygonGraphics(t),e.clampToS3M=t.clampToS3M||!1,this._graphicsLayer.entities.add(e)},createBoxGraphics:function(t){var e;if(t=t||{})return(e=this.createGraphics()).position=t.position,e.name=t.name||"box_graphic",e.box=this.getBoxGraphics(t.box),this._graphicsLayer.entities.add(e)},createModelGraphics:function(t){var e;if(t&&t.position)return(e=this.createGraphics()).model=this.getModelGraphics(t),e.position=t.position,this._graphicsLayer.entities.add(e)},craeteCorridorGraphics:function(t){var e;if(t&&t.positions)return(e=this.createGraphics()).corridor={positions:t.positions,height:t.height||6,width:t.width||15,material:t.material||new l.Scene.WarnLinkMaterialProperty({freely:"cross",color:l.Color.YELLOW,duration:1e3,count:1,direction:"+"})},this._graphicsLayer.entities.add(e)},craeteDynamicPolyLineGraphics:function(t){var e;if(t&&t.positions)return(e=this.createGraphics()).polyline={show:!0,positions:[],material:t.material||l.Color.CHARTREUSE,width:t.width||5,clampToGround:t.clampToGround||!1},e.polyline.positions=new l.CallbackProperty(function(){return t.positions},!1),this._graphicsLayer.entities.add(e)},craeteDynamicCylinderGraphics:function(t){var i,n,e={};if(t&&t.cylinder)return i=t.entity,t=t.cylinder,e.cylinder=(n=this).getCylinderGraphics(t),e.position=new l.CallbackProperty(function(){var t=i.position.getValue(n._viewer.clock.currentTime),t=n._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),e=l.Math.toDegrees(t.latitude),t=l.Math.toDegrees(t.longitude);return l.Cartesian3.fromDegrees(t,e,0)},!1),e.cylinder.length=new l.CallbackProperty(function(){var t=i.position.getValue(n._viewer.clock.currentTime);return 2*n._viewer.scene.globe.ellipsoid.cartesianToCartographic(t).height},!1),e},createFadeCylinderGraphics:function(t){var e;if((t=t||{})&&t.position)return(e=this.createGraphics()).position=t.position,t.material=new l.Scene.CircleFadeMaterialProperty({color:t.color||l.Color.fromCssColorString("#02ff00"),duration:t.duration||2e3}),e.cylinder=this.getCylinderGraphics(t),this._drawLayer.entities.add(e)},craeteRotateCylinderGraphics:function(t){var e;if(t&&t.position)return(e=this.createGraphics()).cylinder={HeightReference:l.HeightReference.RELATIVE_TO_GROUND,length:t.length||500,topRadius:t.topRadius||500,bottomRadius:t.bottomRadius||500,material:t.material||new l.ImageMaterialProperty({image:t.img||this.getDfSt(["graphic","craeteRotateCylinderGraphics"])||"static/data/images/file/cc2.png",transparent:!0,repeat:{x:1,y:-1}}),slices:t.slices||128},e.position=t.position,this.setGraphicsRotate({entity:e,position:this.transformCartesianToWGS84(t.position),rotateAmount:4}),this._graphicsLayer.entities.add(e)},craeteDynamicBlinkCircleGraphics:function(t){var e,i,n;if(t&&t.position)return e=this.createGraphics(),i=t.alp||1,n=t.flog||!0,e.position=t.position,e.ellipse={semiMinorAxis:t.semiMinorAxis||2e3,semiMajorAxis:t.semiMajorAxis||2e3,height:t.height||10,material:new l.ColorMaterialProperty(new l.CallbackProperty(function(){return n?(i-=.05)<=0&&(n=!1):1<=(i+=.05)&&(n=!0),l.Color.RED.withAlpha(i)},!1))},this._graphicsLayer.entities.add(e)},craeteDynamicCricleGraphics:function(i){if(i&&i.center){var n=this.createGraphics(),a=this,r=i.center,o=i.radius||800,s=i.rotateAmount||.05,c=0,h=i.height||1,d=i.scale||null,x=i.scale2||null,i=i.material||new l.ImageMaterialProperty({image:i.imge||this.getDfSt(["graphic","craeteDynamicCricleGraphics"])||"static/data/images/Textures/circle_bg.png",transparent:!0});n.position=new l.CallbackProperty(function(){return a.transformWGS84ToCartesian(r)},!1),n.orientation=new l.CallbackProperty(function(){return l.Transforms.headingPitchRollQuaternion(a.transformWGS84ToCartesian(r),new l.HeadingPitchRoll(l.Math.toRadians(0),l.Math.toRadians(0),l.Math.toRadians(0)))},!1);let t=o,e=!1;return n.ellipse={material:i,height:h,semiMajorAxis:new l.CallbackProperty(function(){return o},!1),semiMinorAxis:new l.CallbackProperty(function(){return o},!1),stRotation:new l.CallbackProperty(function(){return 0<s&&360<=(c+=s)&&(c=0),d&&((e=d<=o||o<=t?!e:e)?o+=2:o-=2),x&&(o<=x?o+=2:o=t),c},!1)},this._graphicsLayer.entities.add(n)}},craeteDynamicShadeWallGraphics:function(t){var e,i,n,a,r;if(t&&t.positions)return e=t.alp||1,i=t.num||20,n=t.color||l.Color.RED,a=t.speed||.003,(r=this.createGraphics()).wall={positions:t.positions,material:new l.ImageMaterialProperty({image:t.img||this.getDfSt(["graphic","craeteDynamicShadeWallGraphics"])||"static/data/images/Textures/fence.png",transparent:!0,color:new l.CallbackProperty(function(){return i%2==0?e-=a:e+=a,(e<=.1||1<=e)&&i++,n.withAlpha(e)},!1)})},this._graphicsLayer.entities.add(r)},createCustomDefBillboardGraphics:function(e){if(e&&e.position){var i=this,n=document.createElement("img");n.src=e.img||this.getDfSt(["graphic","createCustomDefBillboardGraphics"])||"static/data/images/file/div1.png";n.onload=function(){e.image=n;var t=i._graphicsLayer.entities.add({position:e.position,billboard:{image:function(t){var e,i;if(t.image)return(e=document.createElement("canvas")).width=t.width||150,e.height=t.height||80,(i=e.getContext("2d")).drawImage(t.image,0,0),t=t.text,i.font="15px bold 宋体",i.fillStyle="#f4fff0",i.fillText(t,55,36),e}(e),scaleByDistance:new l.NearFarScalar(150,.7,15e6,.5),verticalOrigin:l.VerticalOrigin.BOTTOM,pixelOffset:e.b_pixelOffset||new l.Cartesian2(80,-35),width:140,height:100,scale:e.b_scale||1.5,disableDepthTestDistance:Number.POSITIVE_INFINITY,imageSubRegion:{x:0,y:0,width:200,height:150}}});"function"==typeof e.callback&&e.callback(t)}}},craeteRotatePlaneGraphics:function(t){var e,i,n,a;if(t&&t.center&&t.positions)return e=this.createGraphics(),i=0,n=t.positions,a=n[0],e.position=new l.CallbackProperty(function(){return 0==i?(a=n[0],i+=1):i<n.length-1?(a=n[i],i+=1):i==n.length-1&&(a=n[i],i=0),a},!1),e.plane={plane:new l.Plane(l.Cartesian3.UNIT_Y,0),dimensions:t.dimensions||new l.Cartesian2(200,150),material:new l.ImageMaterialProperty({image:t.image})},this._graphicsLayer.entities.add(e)},createVideoPlaneGraphics:function(t){var e;if(t&&t.position)return(e=this.createGraphics()).position=t.position,e.plane={plane:new l.Plane(t.normal||l.Cartesian3.UNIT_Y,0),dimensions:t.dimensions||new l.Cartesian2(200,150),material:new l.ImageMaterialProperty({image:t.videoElement})},this._graphicsLayer.entities.add(e)},createGifBillboardGraphics:function(t){var i,n,a,r,o,s,c;if(e&&t&&t.position)return n=t.url,a=0,r=n,o=i=[],(s=document.createElement("img")).src=r,s.setAttribute("rel:animated_src",r),s.setAttribute("rel:auto_play","0"),document.body.appendChild(s),c=new e({gif:s}),new Promise(t=>{c.load(()=>{for(let t=1;t<=c.get_length();t++)c.move_to(t),o.push(c.get_canvas().toDataURL());t(o)})}),this._graphicsLayer.entities.add({position:t.position,billboard:{verticalOrigin:l.VerticalOrigin.BASELINE,image:new l.CallbackProperty(function(){return i.length?(a<6*(i.length-1)?a++:a=0,i[Math.floor(a/6)]):n},!1),scale:.2}})},setGraphicsRotate:function(t){var e,i,n,a;t&&t.entity&&t.rotateAmount&&(e=t.entity,i=t.rotateAmount,n=t.position,a=this,n.heading=0,n.pitch=0,n.roll=0,e.position=new l.CallbackProperty(function(){return a.transformWGS84ToCartesian(n)},!1),e.orientation=new l.CallbackProperty(function(){return 0<i&&(n.heading+=i,360===n.heading)&&(n.heading=0),l.Transforms.headingPitchRollQuaternion(a.transformWGS84ToCartesian(n),new l.HeadingPitchRoll(l.Math.toRadians(n.heading),l.Math.toRadians(n.pitch),l.Math.toRadians(n.roll)))},!1))},setGraphicsFloat:function(t){if(t&&t.entity&&t.maxHeiht)try{var e=t.entity,n=t.minHeiht||5,a=t.maxHeiht||100,r=t.cartesians,o=t.speed||.06,s=this,c=n,h=!1;r.length?e.positions=new l.CallbackProperty(function(){var t,e=s.transformCartesianArrayToWGS84Array(r);for(t in e){var i=e[t];(h=a<=n||n<=c?!h:h)?n+=o:n-=o,i.alt=n}return s.transformWGS84ArrayToCartesianArray(e)},!1):e.position=new l.CallbackProperty(function(){var t=s.transformCartesianToWGS84(r);return(h=a<=n||n<=c?!h:h)?n+=o:n-=o,t.alt=n,s.transformWGS84ToCartesian(t)},!1)}catch(t){console.log(t)}},createCanvasGraphics:function(a){a&&a.positions&&(this._graphicsLayer.entities.add({rectangle:{coordinates:a.positions,material:new l.ImageMaterialProperty({image:new l.CallbackProperty(function(){var t=0,e=document.createElement("canvas"),i=e.getContext("2d"),n=new Image;if(n.src=a.img||"../../images/ysCesium/logo.png",i.clearRect(0,0,a.cwidth,a.cheight),!(t<=a.cwidth))return t=0,t+=3,e;i.drawImage(n,t,0)},!1),transparent:!0})}}),"function"==typeof a.callback)&&a.callback()}};let x=null;function d(t,e,i){t&&(x=e,this._installMaterial())}function u(){}d.prototype={addMaterialLineGraphics:function(t){var e;if(this._viewer&&t&&t.image)return this._initPolylineCustomMaterialProperty(t),(e=this.createGraphics()).polyline={positions:t.positions,material:new x.PolylineCustomMaterialProperty({color:t.color||x.Color.RED,duration:t.duration||500}),width:t.width},this._viewer.entities.add(e)},getCustomMaterialLine:function(t){if(this._viewer&&t&&t.image)return this._initPolylineCustomMaterialProperty(t)},_initPolylineCustomMaterialProperty(i){if(i){var t=x.Color,e=x.defaultValue,n=x.defined,a=Object.defineProperties,r=x.Event,o=x.createPropertyDescriptor,s=x.Property,l=x.Material,c=t.WHITE,h=i.MaterialType||"wallType"+parseInt(1e3*Math.random());const d=function(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=t.color||x.Color.BLUE,this.duration=t.duration||1e3,this._time=void 0};return a(d.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color")}),d.prototype.getType=function(){return h},d.prototype.getValue=function(t,e){return(e=n(e)?e:{}).color=s.getValueOrClonedDefault(this._color,t,c,e.color),e.image=i.image,void 0===this._time&&(this._time=t.secondsOfDay),e.time=1e3*(t.secondsOfDay-this._time)/this.duration,e},d.prototype.equals=function(t){return this===t||t instanceof d&&s.equals(this._color,t._color)},l._materialCache.addMaterial(h,{fabric:{type:h,uniforms:{color:i.color||new x.Color(1,0,0,.5),image:i.image,time:i.color.time||0},source:this._getDynamicLineShader({get:!0})},translucent:function(){return!0}}),new d(i)}},addMaterialWallGraphics:function(t){var e;if(this._viewer&&t&&t.image)return this._initWallCustomMaterialProperty(t),(e=this.createGraphics()).wall={positions:t.positions,material:new x.Scene.WallLinkCustomMaterialProperty({color:t.color||x.Color.RED,duration:t.duration||500}),width:t.width},this._viewer.entities.add(e)},getCustomMaterialWall:function(t){if(this._viewer&&t&&t.image)return this._initWallCustomMaterialProperty(t)},_initWallCustomMaterialProperty(i){var n=x.Color,e=x.defaultValue,a=x.defined,t=Object.defineProperties,r=x.Event,o=x.createPropertyDescriptor,s=x.Property,l=x.Material,c=i.MaterialType||"wallType"+parseInt(1e3*Math.random());function h(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=t.color||n.BLUE,this.duration=t.duration||3e3,this._time=(new Date).getTime()}return t(h.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color")}),h.prototype.getType=function(){return c},h.prototype.getValue=function(t,e){return(e=a(e)?e:{}).color=s.getValueOrClonedDefault(this._color,t,n.WHITE,e.color),e.image=i.image,e.time=((new Date).getTime()-this._time)%this.duration/this.duration,e},h.prototype.equals=function(t){return this===t||t instanceof h&&s.equals(this._color,t._color)},l._materialCache.addMaterial(c,{fabric:{type:c,uniforms:{color:new n(1,0,0,.5),image:i.image,time:0},source:this._getDirectionWallShader({get:!0,count:i.count,freely:i.freely,direction:i.direction})},translucent:function(){return!0}}),new(x.Scene.WallLinkCustomMaterialProperty=h)(i)},_installMaterial:function(){this._installWaveCircleMaterial(),this._installCircleFadeMaterial(),this._installCityLineMaterial(),this._installWarnMaterial(),this._installFlowMaterial()},_installWaveCircleMaterial:function(){var e=x.Color,i=x.defaultValue,t=Object.defineProperties,n=x.Event,a=x.Property,r=x.Material;function o(t){t=t||{},this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._duration=void 0,this._durationSubscription=void 0,this.color=i(t.color,e.fromBytes(0,255,255,255)),this.duration=i(t.duration,45),this.count=Math.max(i(t.count,2),1),this.gradient=i(t.gradient,.1),this.gradient<0?this.gradient=0:1<this.gradient&&(this.gradient=1)}t(o.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),o.prototype.getType=function(){return r.CircleWaveType},o.prototype.getValue=function(t,e){return(e=e||{}).color=a.getValueOrUndefined(this._color,t),e.duration=this._duration,e.count=this.count,e.gradient=this.gradient,e},o.prototype.equals=function(t){return this===t||t instanceof o&&x.Property.equals(this._color,t._color)},t(o.prototype,{color:x.createPropertyDescriptor("color"),duration:x.createPropertyDescriptor("duration")}),x.Scene.CircleWaveMaterialProperty=o,r.CircleWaveType="CircleWave",r._materialCache.addMaterial(r.CircleWaveType,{fabric:{type:r.CircleWaveType,uniforms:{color:new e(1,0,0,.7),duration:45,count:1,gradient:.1},source:this._getDynamicCircleShader({get:!0})},translucent:function(){return!0}})},_installCircleFadeMaterial:function(){var t=x.Color,e=x.defaultValue,i=Object.defineProperties,n=x.Event,a=x.Property,r=x.Material,o=new t(0,0,0,0);function s(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this.color=e(t.color,o),this._duration=t.duration||1e3,this._time=void 0}i(s.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),s.prototype.getType=function(){return r.CircleFadeMaterialType},s.prototype.getValue=function(t,e){return(e=e||{}).color=a.getValueOrClonedDefault(this._color,t,o,e.color),void 0===this._time&&(this._time=(new Date).getTime()),e.time=((new Date).getTime()-this._time)/this._duration,e},s.prototype.equals=function(t){return this===t||t instanceof s&&x.Property.equals(this._color,t._color)},i(s.prototype,{color:x.createPropertyDescriptor("color")}),x.Scene.CircleFadeMaterialProperty=s,r.CircleFadeMaterialType="CircleFadeMaterial",r._materialCache.addMaterial(r.CircleFadeMaterialType,{fabric:{type:r.CircleFadeMaterialType,uniforms:{color:new t(1,0,0,1),time:1},source:this._getCircleFadeShader({get:!0})},translucent:function(){return!0}})},_installCityLineMaterial:function(){var t=x.Color,e=x.defaultValue,i=x.defined,n=Object.defineProperties,a=x.Event,r=x.createPropertyDescriptor,o=x.Property,s=x.Material,l=t.WHITE;function c(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new a,this._color=void 0,this._colorSubscription=void 0,this.color=t.color||x.Color.BLUE,this.duration=t.duration||1e3,this._time=void 0,this._img=t.imgUrl||s.PolylineCityLinkImage}n(c.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:r("color")}),c.prototype.getType=function(){return s.PolylineCityLinkType},c.prototype.getValue=function(t,e){return(e=i(e)?e:{}).color=o.getValueOrClonedDefault(this._color,t,l,e.color),e.image=this._img,void 0===this._time&&(this._time=t.secondsOfDay),e.time=1e3*(t.secondsOfDay-this._time)/this.duration,e},c.prototype.equals=function(t){return this===t||t instanceof c&&o.equals(this._color,t._color)},x.Scene.PolylineCityLinkMaterialProperty=c,s.PolylineCityLinkType="PolylineCityLink",s.PolylineCityLinkImage=this.getDfSt(["material","PolylineCityLinkMaterialProperty"])||"static/data/images/Textures/meteor_01.png",s._materialCache.addMaterial(s.PolylineCityLinkType,{fabric:{type:s.PolylineCityLinkType,uniforms:{color:new t(1,0,0,1),image:s.PolylineCityLinkImage,time:0},source:this._getDynamicLightLineShader({get:!0})},translucent:function(){return!0}})},_installWarnMaterial:function(){var i=x.Color,e=x.defaultValue,n=x.defined,t=Object.defineProperties,a=x.Event,r=x.createPropertyDescriptor,o=x.Property,s=x.Material;function l(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new a,this._color=void 0,this._colorSubscription=void 0,this.color=t.color||i.BLUE,this.duration=t.duration||3e3,this._time=(new Date).getTime()}t(l.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),l.prototype.getType=function(){return s.WarnLinkType},l.prototype.getValue=function(t,e){return(e=n(e)?e:{}).color=o.getValueOrClonedDefault(this._color,t,i.WHITE,e.color),e.image=s.WarnLinkImage,e.time=((new Date).getTime()-this._time)%this.duration/this.duration,e},l.prototype.equals=function(t){return this===t||t instanceof l&&o.equals(this._color,t._color)},t(l.prototype,{color:r("color")}),x.Scene.WarnLinkMaterialProperty=l,s.WarnLinkType="WarnWallLinkType",s.WarnLinkImage=this.getDfSt(["material","WarnLinkMaterialProperty"])||"static/data/images/Textures/jsx2.png",s._materialCache.addMaterial(s.WarnLinkType,{fabric:{type:s.WarnLinkType,uniforms:{color:new i(1,0,0,.5),image:s.WarnLinkImage,time:0},source:this._getDirectionWallShader({get:!0,count:10,freely:"cross",direction:"-"})},translucent:function(){return!0}})},_installFlowMaterial:function(){var e=x.Color,i=x.defaultValue,t=Object.defineProperties,n=x.Event,a=x.createPropertyDescriptor,r=x.Property,o=x.Material;function s(t){t=i(t,i.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this.color=t.color||e.fromBytes(0,255,255,255),this._duration=void 0,this._durationSubscription=void 0,this.duration=i(t.duration,45)}t(s.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),s.prototype.getType=function(){return o.PolylineFlowType},s.prototype.getValue=function(t,e){return(e=e||{}).color=r.getValueOrClonedDefault(this._color,t,x.Color.WHITE,e.color),e.duration=this._duration,e},s.prototype.equals=function(t){return this===t||t instanceof s&&r.equals(this._color,t._color)},t(s.prototype,{color:a("color"),duration:a("duration")}),x.Scene.PolylineFlowMaterialProperty=s,o.PolylineFlowType="PolylineFlow",o._materialCache.addMaterial(o.PolylineFlowType,{fabric:{type:o.PolylineFlowType,uniforms:{color:new e(1,1,2,.7),duration:45},source:this._getFlowLineShader({get:!0})},translucent:function(){return!0}})}},u.prototype={_getFlowLineShader:function(){return"uniform vec4 color;\n uniform float duration;\n \n czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n float t =fract(czm_frameNumber / duration);\n t *= 1.03;\n float alpha = smoothstep(t- 0.03, t, st.s) * step(-t, -st.s);\n alpha += 0.1;\n vec4 fragColor;\n fragColor.rgb = (color.rgb) / 0.5;\n fragColor = czm_gammaCorrect(fragColor);\n material.diffuse = fragColor.rgb;\n material.alpha = alpha;\n material.emission = fragColor.rgb;\n return material;\n }\n "},_getDynamicLineShader:function(t){if(t&&t.get)return"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n \n if(texture(image, vec2(0.0, 0.0)).a == 1.0){\n discard;\n }else{\n material.alpha = texture(image, vec2(1.0 - fract(time - st.s), st.t)).a * color.a;\n }\n \n material.diffuse = max(color.rgb * material.alpha * 3.0, color.rgb);\n \n return material;\n }\n "},_getDynamicLightLineShader:function(t){if(t&&t.get)return"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n \n vec4 colorImage = texture(image, vec2(fract(1.0 *st.s - time), fract(st.t)));\n \n vec4 fragColor;\n fragColor.rgb = (colorImage.rgb+color.rgb) / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.diffuse = colorImage.rgb;\n material.alpha = colorImage.a;\n material.emission = fragColor.rgb;\n \n return material;\n }\n "},_getDirectionWallShader:function(t){var e;if(t&&t.get)return e="czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n \n ","vertical"==t.freely?e+="vec4 colorImage = texture(image, vec2(fract(float("+t.count+")*st.t "+t.direction+" time), fract(st.s)));\n ":e+="vec4 colorImage = texture(image, vec2(fract(float("+t.count+")*st.s "+t.direction+" time), fract(st.t)));\n ",e+"vec4 fragColor;\n fragColor.rgb = (colorImage.rgb+color.rgb) / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.diffuse = colorImage.rgb;\n material.alpha = colorImage.a;\n material.emission = fragColor.rgb;\n \n return material;\n }\n "},_getCircleFadeShader:function(t){if(t&&t.get)return"czm_material czm_getMaterial(czm_materialInput materialInput)\n \n {\n \n czm_material material = czm_getDefaultMaterial(materialInput);\n \n material.diffuse = 1.5 * color.rgb;\n \n vec2 st = materialInput.st;\n \n float dis = distance(st, vec2(0.5, 0.5));\n \n float per = fract(time);\n \n if(dis > per * 0.5){\n \n //material.alpha = 0.0;\n \n discard;\n \n }else {\n \n material.alpha = color.a * dis / per / 2.0;\n \n }\n \n return material;\n \n }"},_getDynamicCircleShader:function(t){if(t&&t.get)return"uniform vec4 color;\n uniform float duration;\n uniform float count;\n uniform float gradient;\n \n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = 1.5 * color.rgb;\n vec2 st = materialInput.st;\n vec3 str = materialInput.str;\n float dis = distance(st, vec2(0.5, 0.5));\n float per = fract(czm_frameNumber / duration);\n if(abs(str.z) > 0.001){\n discard;\n }\n if(dis > 0.5){\n discard;\n } else {\n float perDis = 0.5 / count;\n float disNum;\n float bl = .0;\n for (int i = 0; i <= 10; i++) {\n if (float(i) <= count) {\n disNum = perDis * float(i) - dis + per / count;\n if (disNum > 0.0) {\n if (disNum < perDis) {\n bl = 1.0 - disNum / perDis;\n } else if (disNum - perDis < perDis) {\n bl = 1.0 - abs(1.0 - disNum / perDis);\n }\n material.alpha = pow(bl, gradient);\n }\n }\n }\n }\n return material;\n }\n "},_getRadarScanShader:function(t){if(t&&t.get)return"uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n in vec2 v_textureCoordinates;\n uniform vec4 u_scanCenterEC;\n uniform vec3 u_scanPlaneNormalEC;\n uniform vec3 u_scanLineNormalEC;\n out vec4 myOutputColor;\n uniform float u_radius;\n uniform vec4 u_scanColor;\n \n vec4 toEye(in vec2 uv, in float depth){\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\n \n bool isPointOnLineRight(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt){\n vec3 v01 = testPt - ptOnLine;\n normalize(v01);\n vec3 temp = cross(v01, lineNormal);\n float d = dot(temp, u_scanPlaneNormalEC);\n return d > 0.5;\n }\n \n vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point){\n vec3 v01 = point -planeOrigin;\n float d = dot(planeNormal, v01) ;\n return (point - planeNormal * d);\n }\n \n float distancePointToLine(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt){\n vec3 tempPt = pointProjectOnPlane(lineNormal, ptOnLine, testPt);\n return length(tempPt - ptOnLine);\n }\n \n float getDepth(in vec4 depth){\n float z_window = czm_unpackDepth(depth);\n z_window = czm_reverseLogDepth(z_window);\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n }\n \n void main(){\n myOutputColor = texture(colorTexture, v_textureCoordinates);\n float depth = getDepth( texture(depthTexture, v_textureCoordinates));\n vec4 viewPos = toEye(v_textureCoordinates, depth);\n vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\n float dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\n float twou_radius = u_radius * 2.0;\n if(dis < u_radius){\n float f0 = 1.0 -abs(u_radius - dis) / u_radius;\n f0 = pow(f0, 64.0);\n vec3 lineEndPt = vec3(u_scanCenterEC.xyz) + u_scanLineNormalEC * u_radius;\n float f = 0.0;\n if(isPointOnLineRight(u_scanCenterEC.xyz, u_scanLineNormalEC.xyz, prjOnPlane.xyz)){\n float dis1= length(prjOnPlane.xyz - lineEndPt);\n f = abs(twou_radius -dis1) / twou_radius;\n f = pow(f, float("+t.width+"));\n }\n if(float("+t.border+") > 0.0){\n myOutputColor = mix(myOutputColor, u_scanColor, f + f0);\n } else {\n myOutputColor = mix(myOutputColor, u_scanColor, f);\n }\n }\n }\n "},_getCircleScanShader:function(t){if(t&&t.get)return"uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n in vec2 v_textureCoordinates;\n uniform vec4 u_scanCenterEC;\n uniform vec3 u_scanPlaneNormalEC;\n uniform float u_radius;\n out vec4 myOutputColor;\n uniform vec4 u_scanColor;\n \n vec4 toEye(in vec2 uv, in float depth){\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\n \n vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point){\n vec3 v01 = point - planeOrigin;\n float d = dot(planeNormal, v01) ;\n return (point - planeNormal * d);\n }\n \n float getDepth(in vec4 depth){\n float z_window = czm_unpackDepth(depth);\n z_window = czm_reverseLogDepth(z_window);\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n }\n \n void main(){\n myOutputColor = texture(colorTexture, v_textureCoordinates);\n float depth = getDepth(texture(depthTexture, v_textureCoordinates));\n vec4 viewPos = toEye(v_textureCoordinates, depth);\n vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\n float dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\n if(dis < u_radius){\n float f = 1.0 - abs(u_radius - dis) / u_radius;\n f = pow(f, float("+t.border+"));\n myOutputColor = mix(myOutputColor, u_scanColor, f);\n }\n }\n "}};let p={},g=void 0;function m(t,e,i){t&&(this._viewer=t,p=e,g=i,p.Ion.defaultAccessToken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmYzkwZWEwYy1mMmIwLTQwYjctOWJlOC00OWU4ZWU1YTZhOTkiLCJpZCI6MTIxODIsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJpYXQiOjE1NjA0OTUyNDN9.wagvw7GxUjxvHXO6m2jjX5Jh9lN0UyTJhNGEcSm2pgE",this._drawLayer=new p.CustomDataSource("drawLayer"),t&&t.dataSources.add(this._drawLayer),this.myname="BASE",this._installBaiduImageryProvider(),this._installGooGleImageryProvider(),this._installAmapImageryProvider(),this._installTencentImageryProvider(),this._installTdtImageryProvider(),this._installGroundSkyBox())}m.prototype={createGraphics:function(){return new p.Entity},getDfSt(t){if(g)return t=t.reduce((t,e)=>(t||g)[e],void 0),g.baseService+t},setOneSkyBox:function(){return new p.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","one","positiveX"])||"static/data/images/SkyBox/00h+00.jpg",negativeX:this.getDfSt(["skyBox","one","negativeX"])||"static/data/images/SkyBox/12h+00.jpg",positiveY:this.getDfSt(["skyBox","one","positiveY"])||"static/data/images/SkyBox/06h+00.jpg",negativeY:this.getDfSt(["skyBox","one","negativeY"])||"static/data/images/SkyBox/18h+00.jpg",positiveZ:this.getDfSt(["skyBox","one","positiveZ"])||"static/data/images/SkyBox/06h+90.jpg",negativeZ:this.getDfSt(["skyBox","one","negativeZ"])||"static/data/images/SkyBox/06h-90.jpg"}})},setTwoSkyBox:function(){return new p.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","two","negativeZ"])||"static/data/images/SkyBox/Version2_dark_px.jpg",negativeX:this.getDfSt(["skyBox","two","negativeX"])||"static/data/images/SkyBox/Version2_dark_mx.jpg",positiveY:this.getDfSt(["skyBox","two","positiveY"])||"static/data/images/SkyBox/Version2_dark_py.jpg",negativeY:this.getDfSt(["skyBox","two","negativeY"])||"static/data/images/SkyBox/Version2_dark_my.jpg",positiveZ:this.getDfSt(["skyBox","two","positiveZ"])||"static/data/images/SkyBox/Version2_dark_pz.jpg",negativeZ:this.getDfSt(["skyBox","two","negativeZ"])||"static/data/images/SkyBox/Version2_dark_mz.jpg"}})},setThreeSkyBox:function(){return new p.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","three","negativeZ"])||"static/data/images/SkyBox/tycho2t3_80_pxs.jpg",negativeX:this.getDfSt(["skyBox","three","negativeX"])||"static/data/images/SkyBox/tycho2t3_80_mxs.jpg",positiveY:this.getDfSt(["skyBox","three","positiveY"])||"static/data/images/SkyBox/tycho2t3_80_pys.jpg",negativeY:this.getDfSt(["skyBox","three","negativeY"])||"static/data/images/SkyBox/tycho2t3_80_mys.jpg",positiveZ:this.getDfSt(["skyBox","three","positiveZ"])||"static/data/images/SkyBox/tycho2t3_80_pzs.jpg",negativeZ:this.getDfSt(["skyBox","three","negativeZ"])||"static/data/images/SkyBox/tycho2t3_80_mzs.jpg"}})},setOneGroundSkyBox:function(){return new p.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearOne","positiveX"])||"static/data/images/SkyBox/rightav9.jpg",negativeX:this.getDfSt(["skyBox","nearOne","negativeX"])||"static/data/images/SkyBox/leftav9.jpg",positiveY:this.getDfSt(["skyBox","nearOne","positiveY"])||"static/data/images/SkyBox/frontav9.jpg",negativeY:this.getDfSt(["skyBox","nearOne","negativeY"])||"static/data/images/SkyBox/backav9.jpg",positiveZ:this.getDfSt(["skyBox","nearOne","positiveZ"])||"static/data/images/SkyBox/topav9.jpg",negativeZ:this.getDfSt(["skyBox","nearOne","negativeZ"])||"static/data/images/SkyBox/bottomav9.jpg"}})},setTwoGroundSkyBox:function(){return new p.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearTwo","positiveX"])||"static/data/images/SkyBox/SunSetRight.png",negativeX:this.getDfSt(["skyBox","nearTwo","negativeX"])||"static/data/images/SkyBox/SunSetLeft.png",positiveY:this.getDfSt(["skyBox","nearTwo","positiveY"])||"static/data/images/SkyBox/SunSetFront.png",negativeY:this.getDfSt(["skyBox","nearTwo","negativeY"])||"static/data/images/SkyBox/SunSetBack.png",positiveZ:this.getDfSt(["skyBox","nearTwo","positiveZ"])||"static/data/images/SkyBox/SunSetUp.png",negativeZ:this.getDfSt(["skyBox","nearTwo","negativeZ"])||"static/data/images/SkyBox/SunSetDown.png"}})},setThreeGroundSkyBox:function(){return new p.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearThree","positiveX"])||"static/data/images/SkyBox/Right.jpg",negativeX:this.getDfSt(["skyBox","nearThree","negativeX"])||"static/data/images/SkyBox/Left.jpg",positiveY:this.getDfSt(["skyBox","nearThree","positiveY"])||"static/data/images/SkyBox/Front.jpg",negativeY:this.getDfSt(["skyBox","nearThree","negativeY"])||"static/data/images/SkyBox/Back.jpg",positiveZ:this.getDfSt(["skyBox","nearThree","positiveZ"])||"static/data/images/SkyBox/Up.jpg",negativeZ:this.getDfSt(["skyBox","nearThree","negativeZ"])||"static/data/images/SkyBox/Down.jpg"}})},setDarkEffect:function(t){return t=t||{},this._viewer.scene.postProcessStages.add(new p.PostProcessStage({name:"darkEffect",fragmentShader:"uniform sampler2D colorTexture;\nin vec2 v_textureCoordinates;\nuniform float scale;\nuniform vec3 offset;\nvoid main() {\n vec4 color = texture(colorTexture, v_textureCoordinates);\n out_FragColor = vec4(color.r*0.2,color.g * 0.4,color.b*0.6, 1.0);\n}\n",uniforms:{scale:1,offset:function(){return t.offset||new p.Cartesian3(.1,.2,.3)}}}))},setBlurBloom:function(t){if(this._viewer&&t)return this._viewer.scene.postProcessStages.add(new p.PostProcessStage({name:"blur_x_direction",fragmentShader:"uniform float height;\nuniform float width;\nuniform sampler2D colorTexture1;\n\nin vec2 v_textureCoordinates;\n\nconst int SAMPLES = 9;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nfloat wr = float(1.0 / width);\nfloat hr = float(1.0 / height);\nvec4 result = vec4(0.0);\nint count = 0;\nfor(int i = -SAMPLES; i <= SAMPLES; ++i){\nfor(int j = -SAMPLES; j <= SAMPLES; ++j){\nvec2 offset = vec2(float(i) * wr, float(j) * hr);\nresult += texture(colorTexture1, st + offset);\n}\n}\nresult = result / float(count);\nout_FragColor = result;\n}\n",uniforms:{width:t.width,height:t.height,colorTexture1:"Bright"}}))},setRainEffect:function(){if(this._viewer)return this._viewer.scene.postProcessStages.add(new p.PostProcessStage({name:"rainEffect",fragmentShader:"uniform sampler2D colorTexture;\n in vec2 v_textureCoordinates;\n \n float hash(float x){\n return fract(sin(x*23.3)*13.13);\n }\n \n void main(){\n float time = czm_frameNumber / 60.0;\n vec2 resolution = czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 c=vec3(.6,.7,.8);\n float a=-.4;\n float si=sin(a),co=cos(a);\n uv*=mat2(co,-si,si,co);\n uv*=length(uv+vec2(0,4.9))*.3+1.;\n float v=1.-sin(hash(floor(uv.x*100.))*2.);\n float b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*20.;\n c*=v*b;\n out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c, 1), 0.2);\n }\n "}))},setSnowEffect:function(){if(this._viewer)return this._viewer.scene.postProcessStages.add(new p.PostProcessStage({name:"snowEffect",fragmentShader:"uniform sampler2D colorTexture;\n in vec2 v_textureCoordinates;\n float snow(vec2 uv,float scale){\n float time = czm_frameNumber / 60.0;\n float w=smoothstep(1.,0.,-uv.y*(scale/10.));\n if(w<.1)return 0.;\n uv+=time/scale;\n uv.y+=time*2./scale;\n uv.x+=sin(uv.y+time*.5)/scale;\n uv*=scale;\n vec2 s=floor(uv),f=fract(uv),p;\n float k=3.,d;\n p=.5+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;\n d=length(p);\n k=min(d,k);\n k=smoothstep(0.,k,sin(f.x+f.y)*0.01);\n return k*w;\n }\n \n void main(){\n vec2 resolution = czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 finalColor=vec3(0);\n float c = 0.0;\n c+=snow(uv,30.)*.0;\n c+=snow(uv,20.)*.0;\n c+=snow(uv,15.)*.0;\n c+=snow(uv,10.);\n c+=snow(uv,8.);\n c+=snow(uv,6.);\n c+=snow(uv,5.);\n finalColor=(vec3(c));\n out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.3);\n \n }\n "}))},setFogEffect:function(){if(this._viewer)return this._viewer.scene.postProcessStages.add(new p.PostProcessStage({fragmentShader:"float getDistance(sampler2D depthTexture, vec2 texCoords) \n{ \n float depth = czm_unpackDepth(texture(depthTexture, texCoords)); \n if (depth == 0.0) { \n return czm_infinity; \n } \n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth); \n return -eyeCoordinate.z / eyeCoordinate.w; \n} \nfloat interpolateByDistance(vec4 nearFarScalar, float distance) \n{ \n float startDistance = nearFarScalar.x; \n float startValue = nearFarScalar.y; \n float endDistance = nearFarScalar.z; \n float endValue = nearFarScalar.w; \n float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); \n return mix(startValue, endValue, t); \n} \nvec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) \n{ \n return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); \n} \nuniform sampler2D colorTexture; \nuniform sampler2D depthTexture; \nuniform vec4 fogByDistance; \nuniform vec4 fogColor; \nin vec2 v_textureCoordinates; \nvoid main(void) \n{ \n float distance = getDistance(depthTexture, v_textureCoordinates); \n vec4 sceneColor = texture(colorTexture, v_textureCoordinates); \n float blendAmount = interpolateByDistance(fogByDistance, distance); \n vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount); \n out_FragColor = alphaBlend(finalFogColor, sceneColor); \n} \n",uniforms:{fogByDistance:new p.Cartesian4(10,0,200,.3),fogColor:p.Color.AZURE}}))},setDefSceneConfig:function(){this._viewer&&(this._viewer.scene.sun.show=!1,this._viewer.scene.moon.show=!1,this._viewer.scene.fxaa=!0,this._viewer.scene.globe.depthTestAgainstTerrain=!0,this._viewer.scene.undergroundMode=!1,this._viewer.scene.terrainProvider.isCreateSkirt=!1,this._viewer.scene.skyAtmosphere.show=!1,this._viewer.scene.globe.showGroundAtmosphere=!1,this._viewer.scene.globe.enableLighting=!0,this._viewer.scene.fog.enabled=!1,this._viewer.cesiumWidget.creditContainer.style.display="none")},setBloomLightScene:function(){this._viewer&&(this._viewer.scene.postProcessStages.bloom.enabled=!0,this._viewer.scene.postProcessStages.bloom.uniforms.contrast=119,this._viewer.scene.postProcessStages.bloom.uniforms.brightness=-.4,this._viewer.scene.postProcessStages.bloom.uniforms.glowOnly=!1,this._viewer.scene.postProcessStages.bloom.uniforms.delta=.9,this._viewer.scene.postProcessStages.bloom.uniforms.sigma=3.78,this._viewer.scene.postProcessStages.bloom.uniforms.stepSize=5,this._viewer.scene.postProcessStages.bloom.uniforms.isSelected=!1)},removePostProcessStage:function(t){t&&(Array.isArray(t)?t.forEach(t=>{this._viewer.scene.postProcessStages.contains(t)&&this._viewer.scene.postProcessStages.remove(t)}):this._viewer.scene.postProcessStages.contains(t)&&this._viewer.scene.postProcessStages.remove(t))},setView:function(t){var e;this._viewer&&t&&t.position&&(t.distance&&(e=new p.Cartesian3(0,t.distance,window.opt.distance),t.position=p.Cartesian3.add(t.position,e,new p.Cartesian3)),this._viewer.scene.camera.setView({destination:t.position,orientation:t.orientation||{heading:p.Math.toRadians(90),pitch:p.Math.toRadians(90),roll:p.Math.toRadians(0)}}))},flyTo:function(t){var e;this._viewer&&t&&t.position&&(t.distance&&(e=new p.Cartesian3(0,t.distance,t.distance),t.position=p.Cartesian3.add(t.position,e,new p.Cartesian3)),this._viewer.scene.camera.flyTo({destination:t.position,orientation:t.orientation||{heading:p.Math.toRadians(90),pitch:p.Math.toRadians(90),roll:p.Math.toRadians(0)},easingFunction:t.easingFunction||p.EasingFunction.LINEAR_NONE,duration:t.duration||3,complete:t.callback}))},transformCartesianToWGS84:function(t){if(this._viewer&&t)return t=p.Ellipsoid.WGS84.cartesianToCartographic(t),{lng:p.Math.toDegrees(t.longitude),lat:p.Math.toDegrees(t.latitude),alt:t.height}},transformWGS84ArrayToCartesianArray:function(t,e){var i;if(this._viewer&&t)return i=this,t?t.map(function(t){return i.transformWGS84ToCartesian(t,e)}):[]},transformWGS84ToCartesian:function(t,e){if(this._viewer)return t?p.Cartesian3.fromDegrees(t.lng||t.lon,t.lat,t.alt=e||t.alt,p.Ellipsoid.WGS84):p.Cartesian3.ZERO},transformCartesianArrayToWGS84Array:function(t){var e;if(this._viewer)return e=this,t?t.map(function(t){return e.transformCartesianToWGS84(t)}):[]},setCameraEotateHeading(l){if(l){let e=this._viewer,i=p.Cartesian3.fromDegrees(l.lng,l.lat,l.height),n=p.Math.toRadians(-30),a=12,r=5e3,t=p.JulianDate.fromDate(new Date),o=(e.clock.startTime=t.clone(),e.clock.currentTime=t.clone(),e.clock.clockRange=p.ClockRange.CLAMPED,e.clock.clockStep=p.ClockStep.SYSTEM_CLOCK,e.camera.heading),s=function(){var t=p.JulianDate.secondsDifference(e.clock.currentTime,e.clock.startTime),t=p.Math.toRadians(t*a)+o;e.scene.camera.setView({destination:i,orientation:{heading:t,pitch:n}}),e.scene.camera.moveBackward(r),0<=p.JulianDate.compare(e.clock.currentTime,e.clock.stopTime)&&e.clock.onTick.removeEventListener(s)};e.clock.onTick.addEventListener(s)}},transformWGS84ToCartographic:function(t){return t?p.Cartographic.fromDegrees(t.lng||t.lon,t.lat,t.alt):p.Cartographic.ZERO},getCatesian3FromPX:function(t){if(this._viewer&&t){var e,i,n=this._viewer.scene.pick(t),a=null,r=!1,o=!1;if((r=n instanceof p.Cesium3DTileFeature?!0:r)&&(a=this._viewer.scene.pickPosition(t))&&((e=p.Cartographic.fromCartesian(a)).height<0&&(e.height=0),s=p.Math.toDegrees(e.longitude),i=p.Math.toDegrees(e.latitude),e=e.height,a=this.transformWGS84ToCartesian({lng:s,lat:i,alt:e})),!n){var s=this._viewer.scene.camera.getPickRay(t);if(!s)return null;a=this._viewer.scene.globe.pick(s,this._viewer.scene),o=!0}return(a=r||o?a:this._viewer.scene.camera.pickEllipsoid(t,this._viewer.scene.globe.ellipsoid))?(i=this.transformCartesianToWGS84(a)).alt<0?this.transformWGS84ToCartesian(i,.1):a:!1}},getCameraPosition:function(){if(this._viewer){var t,e,i,n,a,r,o,s,l,c,h,d=this._viewer.scene.camera.pickEllipsoid(new p.Cartesian2(this._viewer.canvas.clientWidth/2,this._viewer.canvas.clientHeight/2));if(d)return t=180*(d=p.Ellipsoid.WGS84.cartesianToCartographic(d)).longitude/Math.PI,d=180*d.latitude/Math.PI,n=this._viewer.camera._direction,e=p.Math.toDegrees(n.x),i=p.Math.toDegrees(n.y),n=p.Math.toDegrees(n.z),a=this._viewer.camera.positionCartographic.height,r=p.Math.toDegrees(this._viewer.camera.heading),o=p.Math.toDegrees(this._viewer.camera.pitch),s=p.Math.toDegrees(this._viewer.camera.roll),c=(l=this._viewer.camera.computeViewRectangle()).west/Math.PI*180,h=l.north/Math.PI*180,c=(c+l.east/Math.PI*180)/2,h=(h+l.south/Math.PI*180)/2,{lon:t,lat:d,height:a,heading:r,pitch:o,roll:s,position:this._viewer.camera.position,cameraHeading:this._viewer.camera.heading,cameraPitch:this._viewer.camera.pitch,cameraRoll:this._viewer.camera.roll,center:{x:c,y:h},direction:new p.Cartesian3(e,i,n)}}},updateCameraState:function(t){this._viewer.scene._screenSpaceCameraController.enableRotate=t,this._viewer.scene._screenSpaceCameraController.enableTranslate=t,this._viewer.scene._screenSpaceCameraController.enableZoom=t,this._viewer.scene._screenSpaceCameraController.enableTilt=t,this._viewer.scene._screenSpaceCameraController.enableLook=t},bindHandelEvent:function({leftClick:e,mouseMove:i,doubleClick:n,leftDown:a,mouseWheel:r,leftUp:o}){var s;this._viewer&&(s=new p.ScreenSpaceEventHandler(this._viewer.canvas),e&&s.setInputAction(function(t){e(t,s)},p.ScreenSpaceEventType.LEFT_CLICK),i&&s.setInputAction(function(t){i(t,s)},p.ScreenSpaceEventType.MOUSE_MOVE),n&&s.setInputAction(function(t){n(t,s)},p.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),a&&s.setInputAction(function(t){a(t,s)},p.ScreenSpaceEventType.LEFT_DOWN),r&&s.setInputAction(function(t){r(t,s)},p.ScreenSpaceEventType.WHEEL),o)&&s.setInputAction(function(t){o(t,s)},p.ScreenSpaceEventType.LEFT_UP)},getHandelPosition:function(e){var i,n;this._viewer&&(i=new p.ScreenSpaceEventHandler(this._viewer.scene.canvas),n=this,i.setInputAction(function(t){t=n._viewer.scene.camera.pickEllipsoid(t.endPosition,n._viewer.scene.globe.ellipsoid);"function"==typeof e&&e(n.transformCartesianToWGS84(t),i)},p.ScreenSpaceEventType.MOUSE_MOVE))},saveSceneImages:function(){var t,e;this._viewer&&(e=this._viewer.scene.canvas.toDataURL("image/png").replace("image/png","image/octet-stream"),t=document.createElement("a"),e=function(t){for(var t=t.split(","),e=t[0].match(/:(.*?);/)[1],i=atob(t[1]),n=i.length,a=new Uint8Array(n);n--;)a[n]=i.charCodeAt(n);return new Blob([a],{type:e})}(e),e=URL.createObjectURL(e),t.download="scene.png",t.href=e,t.click())},_installAmapImageryProvider:function(){p.Scene.AmapImageryProvider=function(t){return t.url="img"===t.style?"https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}":"http://webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}",t.subdomains||(t.subdomains=["01","02","03","04"]),new p.UrlTemplateImageryProvider(t)}},_installTdtImageryProvider:function(){p.Scene.TdtImageryProvider=function(t){return new p.UrlTemplateImageryProvider({url:"http://t{s}.tianditu.gov.cn/{layer}_c/wmts?service=WMTS&version=1.0.0&request=GetTile&tilematrix={TileMatrix}&layer={layer}&style={style}&tilerow={TileRow}&tilecol={TileCol}&tilematrixset={TileMatrixSet}&format=tiles&tk={key}".replace(/\{layer\}/g,t.style||"vec").replace(/\{key\}/g,t.key||""),style:"default",format:"tiles",tileMatrixSetID:"c",matrixSet:"c",wrapX:!0,crossOrigin:"anonymous",subdomains:[...Array(6).keys()].map(t=>(t+1).toString()),tileMatrixLabels:[...Array(18).keys()].map(t=>(t+1).toString()),tilingScheme:new p.GeographicTilingScheme,maximumLevel:18})}},_installTencentImageryProvider:function(){p.Scene.TencentImageryProvider=function(t){return t.layer="img",t.url="https://p2.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=229",t.subdomains||(t.subdomains=["0","1","2"]),t.customTags={sx:function(t,e,i,n){return e>>4},sy:function(t,e,i,n){return(1<<n)-i>>4}},new p.UrlTemplateImageryProvider(t)}},_installGooGleImageryProvider:function(){p.Scene.GoogleImageryProvider=function(t){return t.url="img"===t.style?"http://mt{s}.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}&s=Gali":"ter"===t.style?"http://mt{s}.google.cn/vt/lyrs=t@131,r@227000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galile":"http://mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile",t.subdomains||(t.subdomains=["1","2","3","4","5"]),new p.UrlTemplateImageryProvider(t)}},_installBaiduImageryProvider:function(){var e="http://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}";function t(t){e=t.temp_url||e,this._url=e,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._minimumLevel=1,this._tilingScheme=new p.WebMercatorTilingScheme({rectangleSouthwestInMeters:new p.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new p.Cartesian2(33554054,33746824)}),this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._style=t.style||"normal"}Object.defineProperties(t.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},tileWidth:{get:function(){if(this.ready)return this._tileWidth;throw new p.DeveloperError("tileWidth must not be called before the imagery provider is ready.")}},tileHeight:{get:function(){if(this.ready)return this._tileHeight;throw new p.DeveloperError("tileHeight must not be called before the imagery provider is ready.")}},maximumLevel:{get:function(){if(this.ready)return this._tileHeight;throw new p.DeveloperError("tileHeight must not be called before the imagery provider is ready.")}},minimumLevel:{get:function(){if(this.ready)return 0;throw new p.DeveloperError("minimumLevel must not be called before the imagery provider is ready.")}},tilingScheme:{get:function(){if(this.ready)return this._tilingScheme;throw new p.DeveloperError("tilingScheme must not be called before the imagery provider is ready.")}},rectangle:{get:function(){if(this.ready)return this._rectangle;throw new p.DeveloperError("rectangle must not be called before the imagery provider is ready.")}},ready:{get:function(){return!!this._url}},credit:{get:function(){return this._credit}}}),t.prototype.requestImage=function(t,e,i){var n,a;if(this.ready)return n=this._tilingScheme.getNumberOfXTilesAtLevel(i),a=this._tilingScheme.getNumberOfYTilesAtLevel(i),t=this._url.replace("{x}",t-n/2).replace("{y}",a/2-e-1).replace("{z}",i).replace("{s}",1).replace("{style}",this._style),p.ImageryProvider.loadImage(this,t);throw new p.DeveloperError("requestImage must not be called before the imagery provider is ready.")},p.Scene.BaiduImageryProvider=t},_installGroundSkyBox:function(){var o=p.BoxGeometry,s=p.Cartesian3,e=p.defaultValue,l=p.defined,i=p.destroyObject,c=p.DeveloperError,h=p.GeometryPipeline,t=p.Matrix3,d=p.Matrix4,x=p.Transforms,u=p.VertexFormat,S=p.BufferUsage,g=p.CubeMap,n=p.DrawCommand,m=p.loadCubeMap,f=p.RenderState,v=p.VertexArray,b=p.BlendingState,y=p.SceneMode,C=p.ShaderProgram,w=p.ShaderSource;function a(t){this.sources=t.sources,this._sources=void 0,this.show=e(t.show,!0),this._command=new n({modelMatrix:d.clone(d.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}l(d.getRotation)||(d.getRotation=d.getMatrix3);var I=new t;a.prototype.update=function(t,e){var i=this;if(this.show&&(t.mode===y.SCENE3D||t.mode===y.MORPHING)&&t.passes.render){var n=t.context;if(this._sources!==this.sources){this._sources=this.sources;var a=this.sources;if(!(l(a.positiveX)&&l(a.negativeX)&&l(a.positiveY)&&l(a.negativeY)&&l(a.positiveZ)&&l(a.negativeZ)))throw new c("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof a.positiveX!=typeof a.negativeX||typeof a.positiveX!=typeof a.positiveY||typeof a.positiveX!=typeof a.negativeY||typeof a.positiveX!=typeof a.positiveZ||typeof a.positiveX!=typeof a.negativeZ)throw new c("this.sources properties must all be the same type.");"string"==typeof a.positiveX?m(n,this._sources).then(function(t){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=t}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new g({context:n,source:a}))}var r=this._command;if(r.modelMatrix=x.eastNorthUpToFixedFrame(t.camera._positionWC),l(r.vertexArray)||(r.uniformMap={u_cubeMap:function(){return i._cubeMap},u_rotateMatrix:function(){return d.getRotation(r.modelMatrix,I)}},a=o.createGeometry(o.fromDimensions({dimensions:new s(2,2,2),vertexFormat:u.POSITION_ONLY})),t=this._attributeLocations=h.createAttributeLocations(a),r.vertexArray=v.fromGeometry({context:n,geometry:a,attributeLocations:t,bufferUsage:S._DRAW}),r.renderState=f.fromCache({blending:b.ALPHA_BLEND})),l(r.shaderProgram)&&this._useHdr===e||(a=new w({defines:[e?"HDR":""],sources:["uniform samplerCube u_cubeMap;\n in vec3 v_texCoord;\n void main()\n {\n vec4 color = texture(u_cubeMap, normalize(v_texCoord));\n out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n }\n "]}),r.shaderProgram=C.fromCache({context:n,vertexShaderSource:"in vec3 position;\n out vec3 v_texCoord;\n uniform mat3 u_rotateMatrix;\n void main()\n {\n vec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\n gl_Position = czm_projection * vec4(p, 1.0);\n v_texCoord = position.xyz;\n }\n ",fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=e),l(this._cubeMap))return r}},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){var t=this._command;return t.vertexArray=t.vertexArray&&t.vertexArray.destroy(),t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),i(this)},p.Scene.GroundSkyBox=a},removeHandlerByName(t=[]){t.forEach(t=>{this._viewer.screenSpaceEventHandler.removeInputAction(p.ScreenSpaceEventType[t])})}};let v={};function y(t,e){t&&(this._viewer=t,v=e)}y.prototype={splitCartesians3:function(t){for(var e=[],i=0;i<t.length;i+=3){var n=new v.Cartesian3(t[i],t[i+1],t[i+2]);e.push(n)}return e.push(e[0]),e},getLinkedPointList:function(t,e,i,n){if(this._viewer){var a=[],r=v.Cartographic.fromCartesian(t),o=v.Cartographic.fromCartesian(e),s=180*r.longitude/Math.PI,r=180*r.latitude/Math.PI,l=180*o.longitude/Math.PI,o=180*o.latitude/Math.PI,c=Math.sqrt((s-l)*(s-l)+(r-o)*(r-o))*i,h=v.Cartesian3.clone(t),d=v.Cartesian3.clone(e),x=v.Cartesian3.distance(h,v.Cartesian3.ZERO),u=v.Cartesian3.distance(d,v.Cartesian3.ZERO);if(v.Cartesian3.normalize(h,h),v.Cartesian3.normalize(d,d),0!=v.Cartesian3.distance(h,d)){var S=v.Cartesian3.angleBetween(h,d);a.push(t);for(var p=1;p<n-1;p++){var g=+p/(n-1),m=1-g,f=Math.sin(m*S)/Math.sin(S),b=Math.sin(g*S)/Math.sin(S),f=v.Cartesian3.multiplyByScalar(h,f,new v.Cartesian3),b=v.Cartesian3.multiplyByScalar(d,b,new v.Cartesian3),f=v.Cartesian3.add(f,b,new v.Cartesian3),b=g*Math.PI,m=x*m+u*g+Math.sin(b)*c,f=v.Cartesian3.multiplyByScalar(f,m,f);a.push(f)}a.push(e)}return a}},getPositionsAngle:function(t){var e,i,n,a;if(t)return i=t.position1,a=t.position2,n=v.Transforms.eastNorthUpToFixedFrame(i),n=v.Matrix4.inverse(n,new v.Matrix4),i=v.Matrix4.multiplyByPoint(n,i,new v.Cartesian3),n=v.Matrix4.multiplyByPoint(n,a,new v.Cartesian3),"pitch"===t.type?e=Math.atan2(n.z-i.z,n.x-i.x):"heading "===t.type&&(e=Math.atan2(n.y-i.y,n.x-i.x)),(a=e*(180/Math.PI))<0&&(a+=360),a},getPositionsArea:function(n){let t=0;if(n){let e=0,i=v.Ellipsoid.WGS84;n.push(n[0]);for(let t=1;t<n.length;t++){var a=i.cartographicToCartesian(this.transformWGS84ToCartographic(n[t-1])),r=i.cartographicToCartesian(this.transformWGS84ToCartographic(n[t]));e+=a.x*r.y-r.x*a.y}t=Math.abs(e).toFixed(2)}return t},getPolygonArea:function(t){if(this._viewer){function e(t,e){var i=t.lat*radiansPerDegree,t=t.lon*radiansPerDegree,n=e.lat*radiansPerDegree,e=e.lon*radiansPerDegree,i=-Math.atan2(Math.sin(t-e)*Math.cos(n),Math.cos(i)*Math.sin(n)-Math.sin(i)*Math.cos(n)*Math.cos(t-e));return i<0&&(i+=2*Math.PI),i*degreesPerRadian}for(var i=0,n=0;n<t.length-2;n++){var a=(n+1)%t.length,r=(n+2)%t.length,o=(o=t[n],s=t[a],l=t[r],c=void 0,(c=e(s,o)-e(s,l))<0&&(c+=360),c);i+=this.getPositionsDistance(positions[n],positions[a])*this.getPositionsDistance(positions[a],positions[r])*Math.abs(Math.sin(o))}return(i/1e6).toFixed(4)}var o,s,l,c},getPointDistance:function(t,e){var i;if(this._viewer)return t=v.Cartographic.fromCartesian(t),e=v.Cartographic.fromCartesian(e),(i=new v.EllipsoidGeodesic).setEndPoints(t,e),i=i.surfaceDistance,Math.sqrt(Math.pow(i,2)+Math.pow(e.height-t.height,2))},getPositionDistance:function(e){let i=0;for(let t=0;t<e.length-1;t++){var n=this.transformWGS84ToCartographic(e[t]),a=this.transformWGS84ToCartographic(e[t+1]),r=new v.EllipsoidGeodesic,r=(r.setEndPoints(n,a),r.surfaceDistance),r=Math.sqrt(Math.pow(r,2)+Math.pow(a.height-n.height,2));i+=r}return i.toFixed(3)},getIntersectObj:function(t,e,i=[],n=!1){if(this._viewer)return e=v.Cartesian3.normalize(v.Cartesian3.subtract(e,t,new v.Cartesian3),new v.Cartesian3),t=new v.Ray(t,e),e=[],n?e=this._viewer.scene.drillPickFromRay(t,10,i):(n=this._viewer.scene.pickFromRay(t,i),v.defined(n)&&(e=[n])),e},getPointOnEllipsoid:function(t,e,i,n,a,r,o,s,l,c){var h,d,x,u;if(this._viewer)return h=new v.Cartesian3,d=new v.Cartesian3,x=new v.Quaternion,u=new v.Matrix3,e=t+e,v.Cartesian3.multiplyByScalar(n,Math.cos(e),h),v.Cartesian3.multiplyByScalar(i,Math.sin(e),d),v.Cartesian3.add(h,d,h),n=Math.cos(t),n*=n,i=Math.sin(t),i*=i,e=r/Math.sqrt(o*n+a*i)/s,v.Quaternion.fromAxisAngle(h,e,x),v.Matrix3.fromQuaternion(x,u),v.Matrix3.multiplyByVector(u,l,c),v.Cartesian3.normalize(c,c),v.Cartesian3.multiplyByScalar(c,s,c),c},raisePositionsToHeight:function(t,e,i){if(this._viewer){for(var n=new v.Cartesian3,a=new v.Cartesian3,r=new v.Cartesian3,o=new v.Cartesian3,s=e.ellipsoid,l=e.height,c=e.extrudedHeight,e=i?t.length/3*2:t.length/3,h=new Float64Array(3*e),d=t.length,x=i?d:0,u=0;u<d;u+=3){var S=u+1,p=u+2,g=v.Cartesian3.fromArray(t,u,n),m=(s.scaleToGeodeticSurface(g,g),v.Cartesian3.clone(g,a)),f=s.geodeticSurfaceNormal(g,o),b=v.Cartesian3.multiplyByScalar(f,l,r);v.Cartesian3.add(g,b,g),i&&(v.Cartesian3.multiplyByScalar(f,c,b),v.Cartesian3.add(m,b,m),h[u+x]=m.x,h[S+x]=m.y,h[p+x]=m.z),h[u]=g.x,h[S]=g.y,h[p]=g.z}return h}},computeEllipseEdgePositions:function(t){if(this._viewer){for(var e=new v.Cartesian3,i=new v.Cartesian3,n=new v.Cartesian3,a=new v.Cartesian3,r=t.semiMinorAxis,o=t.semiMajorAxis,s=t.rotation,l=t.center,t=t.granularity&&"number"==typeof t.granularity?t.granularity:Math.PI/180,c=((t=t>Math.PI/12?Math.PI/12:t)<Math.PI/180&&(t=Math.PI/180),r*r),h=o*o,d=o*r,x=v.Cartesian3.magnitude(l),u=v.Cartesian3.normalize(l,e),S=v.Cartesian3.cross(v.Cartesian3.UNIT_Z,l,i),S=v.Cartesian3.normalize(S,S),p=v.Cartesian3.cross(u,S,n),g=Math.ceil(2*v.Math.PI/t),m=t,f=a,b=0,y=[],C=0;C<g;C++)f=this.getPointOnEllipsoid(C*m,s,p,S,c,d,h,x,u,f),y[b++]=f.x,y[b++]=f.y,y[b++]=f.z;o={};return o.numPts=g,o.outerPositions=y,o}},computeSectorEdgePositions:function(t){if(this._viewer){for(var e=new v.Cartesian3,i=new v.Cartesian3,n=new v.Cartesian3,a=new v.Cartesian3,r=t.semiMinorAxis,o=t.semiMajorAxis,s=t.rotation,l=t.angle||2*Math.PI,c=t.center,t=t.granularity&&"number"==typeof t.granularity?t.granularity:Math.PI/180,h=((t=t>Math.PI/12?Math.PI/12:t)<Math.PI/180&&(t=Math.PI/180),r*r),d=o*o,x=o*r,u=v.Cartesian3.magnitude(c),S=v.Cartesian3.normalize(c,e),p=v.Cartesian3.cross(v.Cartesian3.UNIT_Z,c,i),p=v.Cartesian3.normalize(p,p),g=v.Cartesian3.cross(S,p,n),m=Math.ceil(l/t),f=t,b=a,y=0,C=[],w=0;w<m;w++)b=this.getPointOnEllipsoid(w*f,s,g,p,h,x,d,u,S,b),C[y++]=b.x,C[y++]=b.y,C[y++]=b.z;o={};return o.numPts=m,o.outerPositions=C,o}},computeLonlatPointsTerrainData:function(t,e){if(this._viewer){for(var i=[],n=0;n<t.length;n++)i.push(v.Cartographic.fromDegrees(t[n].lon,t[n].lat));this._viewer.scene.clampToHeightMostDetailed(i).then(function(t){e(t)})}},computeCartographicPointsTerrainData:function(t,a){if(this._viewer&&!(t.length<=0)){for(var e=[],i=0;i<t.length;i++)e.push(v.Cartesian3.fromRadians(t[i].longitude,t[i].latitude,t[i].height));var n=this._viewer.scene.clampToHeightMostDetailed(e),r=this;n.then(function(t){for(var e=[],i=r._viewer.scene.globe.ellipsoid,n=0;n<t.length;n++)e.push(i.cartesianToCartographic(t[n]));a(e)}).catch(function(t){console.log(t)})}},_checkLonDegree:function(t){return!(180<t||t<-180)},_checkLatDegree:function(t){return!(90<t||t<-90)},computeInterpolateLineLonlat:function(t,e){if(!t||!e)return null;if(t.lon||!t.lat||!e.lon||!e.lat)return null;if(!(this._checkLonDegree(t.lon)&&this._checkLonDegree(e.lon)&&this._checkLatDegree(t.lat)&&this._checkLatDegree(e.lat)))return null;var i=[],n=(i.push([t.lon,t.lat]),Math.sqrt(Math.pow(e.lon-t.lon,2)+Math.pow(e.lat-t.lat,2)));if(n<=1e-5)i.push([e.lon,e.lat]);else for(var a=n/1e-5,r=(e.lon-t.lon)/a,o=(e.lat-t.lat)/a,s=0;s<a;s++){var l=t.lon+(s+1)*r,c=t.lat+(s+1)*o;i.push([l,c])}return i},computeInterpolateLineCartographic:function(t,e,i){if(!t||!e)return null;if(!(t.longitude&&t.latitude&&e.longitude&&e.latitude))return null;var n=[],a=(n.push(new v.Cartographic(t.longitude,t.latitude)),Math.sqrt(Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2))),i=i&&"number"==typeof i?i:1e-5*Math.PI/180;if(a<=i)n.push(new v.Cartographic(e.longitude,e.latitude));else{for(var r=a/i,o=(e.longitude-t.longitude)/r,s=(e.latitude-t.latitude)/r,l=0;l<r;l++){var c=t.longitude+(l+1)*o,h=t.latitude+(l+1)*s;n.push(new v.Cartographic(c,h))}n.push(new v.Cartographic(e.longitude,e.latitude,e.height))}return n},computeInterpolateLineHeightCartographic:function(t,e){if(!t||!e)return null;if(!(t.longitude&&t.latitude&&e.longitude&&e.latitude))return null;var i=[],n=(i.push(new v.Cartographic(t.longitude,t.latitude,t.height)),Math.sqrt(Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2)));if(!(n<=1e-5*Math.PI/180))for(var a=n/1e-5*Math.PI/180,r=(e.longitude-t.longitude)/a,o=(e.latitude-t.latitude)/a,s=(e.height-t.height)/a,l=0;l<a;l++){var c=t.longitude+(l+1)*r,h=t.latitude+(l+1)*o,d=t.height+(l+1)*s;i.push(new v.Cartographic(c,h,d))}return i.push(new v.Cartographic(e.longitude,e.latitude,e.height)),i},computeInterpolate2IndexLineHeightCartographic:function(t,e,i,n){if(!t||!e)return null;if(!(t.longitude&&t.latitude&&e.longitude&&e.latitude))return null;var a=[];a.push(new v.Cartographic(t.longitude,t.latitude,t.height));for(var r=(e.longitude-t.longitude)/i,o=(e.latitude-t.latitude)/i,s=(e.height-t.height)/i,l=0;l<n;l++){var c=t.longitude+(l+1)*r,h=t.latitude+(l+1)*o,d=t.height+(l+1)*s;a.push(new v.Cartographic(c,h,d))}return a},computeInterpolateIndexLineHeightCartographic:function(t,e,i,n){var a,r;return t&&e&&t.longitude&&t.latitude&&e.longitude&&e.latitude?(a=(e.longitude-t.longitude)/i,r=(e.latitude-t.latitude)/i,e=(e.height-t.height)/i,i=t.longitude+n*a,a=t.latitude+n*r,r=t.height+n*e,new v.Cartographic(i,a,r)):null}};let b=null;function C(t,e,i){t&&(this._viewer=t,b=e,this._installPrimitives())}C.prototype={_installPrimitives:function(){this._installProbingPrimitive(),this._installTexturePrimitive(),this._installWaterPrimitive(),this._installPointsPrimitive(),this._installShadowPrimitive(),this._installArrowPolylinePrimitive(),this._installXyzAxisPrimitive(),this._installTetrahedronPrimitive(),this._installCustomPrimitive()},_installCustomPrimitive:function(){},_installTetrahedronPrimitive:function(){try{function t(t){this.show=!0,this._command=void 0,this._enuMatrix=void 0,this._scaleMatrix=void 0,this._localPosition=t.position,this._createCommand=G,this._angle=0,this._distance=I(t.distance,1),this._setInterval=void 0,this._viewer=_,this._speed=I(t.speed,1),this._color=I(t.color,new e(1,1,0,.8)),this._scale=I(t.scale,new i(10,10,15)),this._texture=void 0,this._imageUrl=A,this._modelMatrix=R(this),this._height=B(this),V(this)}var i=b.Cartesian3,n=b.ComponentDatatype,o=b.PrimitiveType,a=b.BoundingSphere,r=b.GeometryAttribute,s=b.GeometryPipeline,l=b.Geometry,c=b.defined,h=b.RenderState,d=b.ShaderSource,x=b.ShaderProgram,u=b.DrawCommand,S=b.Pass,p=b.Appearance,g=b.BufferUsage,e=b.Color,m=b.VertexArray,f=(b.buildModuleUrl,b.Matrix4),v=b.Matrix3,y=b.Texture,C=b.Resource,w=b.Transforms,I=b.defaultValue,_=this._viewer,A=this.getDfSt(["primitive","TetrahedronPrimitive"])||"static/data/images/Textures/fence.png";t.prototype.update=function(t){this.show&&(c(this._command)||(this._command=this._createCommand(t.context,this)),c(this._command))&&t.commandList.push(this._command)},t.prototype.isDestroyed=function(){return!1},t.prototype.destroy=function(){return c(this._command)&&(this._command.shaderProgram=this._command.shaderProgram&&this._command.shaderProgram.destroy()),destroyObject(this)},t.prototype.startAnimate=function(){let e=this;this._setInterval=setInterval(function(){e._angle=e._angle+.01,0<Math.sin(e._angle)?e._height=.01:e._height=-.01;var t=new b.Cartesian3(0,0,e._height),t=(f.multiplyByTranslation(e._modelMatrix,t,e._modelMatrix),f.fromRotationTranslation(v.fromRotationZ(b.Math.toRadians(e._speed))));f.multiply(e._modelMatrix,t,e._modelMatrix)},5)},t.prototype.closeAnimate=function(){clearInterval(this._setInterval)};const G=function(t,e){var i=M(),n=Z(),a=p.getDefaultRenderState(!1,!0,void 0),a=h.fromCache(a),i=new d({sources:[i]}),n=new d({sources:[n]}),r={color:function(){return e._color},myImage:function(){return c(e._texture)?e._texture:e._viewer.scene.context.defaultTexture}},i=x.fromCache({context:t,vertexShaderSource:i,fragmentShaderSource:n,attributeLocations:{position:0,textureCoordinates:1}});return new u({vertexArray:P(t),primitiveType:o.TRIANGLES,renderState:a,shaderProgram:i,uniformMap:r,owner:this,pass:S.TRANSLUCENT,modelMatrix:e._modelMatrix})},P=function(t){var e=W(),e=new l({attributes:{position:new r({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:e.positions}),textureCoordinates:new r({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:e.sts})},indices:e.indices,primitiveType:o.TRIANGLES,boundingSphere:a.fromVertices(e.positions)}),e=s.computeNormal(e);return m.fromGeometry({context:t,geometry:e,attributeLocations:{position:0,textureCoordinates:1},bufferUsage:g.STATIC_DRAW})},W=function(){var t=new Float64Array(15),e=(t[0]=0,t[1]=1,t[2]=0,t[3]=-1,t[4]=0,t[5]=0,t[6]=0,t[7]=-1,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=-1,new Uint16Array(18));return e[0]=4,e[1]=2,e[2]=3,e[3]=4,e[4]=3,e[5]=0,e[6]=4,e[7]=0,e[8]=1,e[9]=4,e[10]=1,e[11]=2,e[12]=1,e[13]=2,e[14]=3,e[15]=1,e[16]=3,e[17]=0,{indices:e,positions:t,sts:new Float32Array([0,0,1,0,1,1,0,1,.5,.5])}},M=function(){return"#version 300 es\n in vec3 position;\n in vec3 normal;\n in vec2 st;\n in float batchId;\n out vec3 v_positionEC;\n out vec3 v_normalEC;\n out vec2 v_st;\n out vec4 v_pickColor;\n void main()\n {\n v_positionEC = (czm_modelView * vec4(position, 1.0)).xyz;\n v_normalEC = czm_normal * normal;\n v_st = st;\n // v_pickColor = czm_batchTable_pickColor(batchId);\n gl_Position = czm_modelViewProjection * vec4(position, 1.0);\n }\n "},Z=function(){return"#version 300 es\n precision mediump float;\n in vec3 v_positionEC;\n in vec3 v_normalEC;\n in vec2 v_st;\n uniform vec4 color;\n in vec4 v_pickColor;\n uniform sampler2D myImage;\n void main()\n {\n vec3 positionToEyeEC = -v_positionEC;\n vec3 normalEC = normalize(v_normalEC);\n #ifdef FACE_FORWARD\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n #endif\n czm_materialInput materialInput;\n materialInput.normalEC = normalEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n materialInput.st = v_st;\n vec2 st = materialInput.st;\n czm_material material = czm_getDefaultMaterial(materialInput);\n float dt_a11 = fract(czm_frameNumber / 100.0) * 3.14159265 * 2.0;\n float dt_a12 = sin(dt_a11);\n float vst=smoothstep(0.7, 1.0, dt_a12)+0.4;\n vec4 colorImage = texture(myImage, vec2(fract(st.s- czm_frameNumber*0.003), st.t));\n material.alpha =mix(0.1,1.0,clamp((1.0-st.t) * color.a,0.0,1.0)) +(1.0-sign(st.t-czm_frameNumber*0.001))*0.2*(1.0-colorImage.r)+0.4;\n material.diffuse =(1.0-colorImage.a)*vec3(1.0,2.0,1.0)+colorImage.rgb*vec3(1.0,2.0,1.0);\n #ifdef FLAT\n out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n #else\n out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n #endif\n }\n "},V=function(i){C.createIfNeeded(i._imageUrl).fetchImage().then(function(t){var e=i._viewer.scene.context,e=c(t.internalFormat)?new y({context:e,pixelFormat:t.internalFormat,width:t.naturalWidth,height:t.naturalHeight,source:{arrayBufferView:t.bufferView}}):new y({context:e,source:t});i._texture=e})},R=function(t){var e=w.eastNorthUpToFixedFrame(t._localPosition),i=f.fromScale(t._scale),n=f.multiply(e,i,new f);return t._scaleMatrix=i,t._enuMatrix=e,n},B=function(t){var e=i.fromElements(0,0,t._distance,new b.Cartesian3),e=b.Matrix4.multiplyByPoint(t._enuMatrix,e,new i),e=f.multiplyByPoint(t._viewer.scene.camera._viewMatrix,e,new i),t=f.multiplyByPoint(t._viewer.scene.camera.frustum.projectionMatrix,e,new i);return i.normalize(t,new i).z};b.Scene.TetrahedronPrimitive=t}catch(i){console.log(i)}},_installXyzAxisPrimitive:function(){function t(t){this._viewer=t.viewer,this._model=t.model,this._matrix=t.matrix,this._radius=void 0,this._layer=new b.CustomDataSource("xyz-axis"),this._viewer.dataSources.add(this._layer),this._handler=new b.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._xyzState=!1,this._xyzPid=void 0,this._builds()}t.prototype={_builds(){this._createAxisXYZ(),this._bindHandler()},remove(){this._layer._primitives.removeAll(),this._handler.distory()},_createAxisXYZ:function(){this._model.readyPromise.then(t=>{var e=b.Matrix4.getTranslation(t.modelMatrix,new b.Cartesian3),t=t.boundingSphere,i=t.radius,n=new b.ArrowPolylinePrimitive({id:"axisZ",color:b.Color.RED,position:e,width:3,headWidth:5,length:2*i+50,headLength:10}),a=new b.ArrowPolylinePrimitive({id:"axisX",color:b.Color.GREEN,position:e,width:3,headWidth:5,length:2*i+50,headLength:10}),e=new b.ArrowPolylinePrimitive({id:"axisY",color:b.Color.BLUE,position:e,width:3,headWidth:5,length:2*i+50,headLength:10}),i=b.Matrix3.fromRotationY(b.Math.toRadians(90)),i=(this._rotationX=b.Matrix4.fromRotationTranslation(i),b.Matrix4.multiply(a.geometryInstances[0].modelMatrix,this._rotationX,a.geometryInstances[0].modelMatrix),b.Matrix4.multiply(a.geometryInstances[1].modelMatrix,this._rotationX,a.geometryInstances[1].modelMatrix),b.Matrix3.fromRotationX(b.Math.toRadians(90)));this._rotationY=b.Matrix4.fromRotationTranslation(i),b.Matrix4.multiply(e.geometryInstances[0].modelMatrix,this._rotationY,e.geometryInstances[0].modelMatrix),b.Matrix4.multiply(e.geometryInstances[1].modelMatrix,this._rotationY,e.geometryInstances[1].modelMatrix),this._layer._primitives.add(n),this._layer._primitives.add(a),this._layer._primitives.add(e),this._radius=t.radius,this._createAxisSphere()})},_createAxisSphere:function(){var e=[];for(let t=0;t<=360;t+=3){const i=Math.sin(b.Math.toRadians(t)),n=Math.cos(b.Math.toRadians(t)),a=this._radius*n,r=this._radius*i;e.push(new b.Cartesian3(a,r,0))}var t=this._createAxisSpheres("axisSphereZ",e,this._matrix,b.Color.RED);this._layer._primitives.add(t);const i=this._createAxisSpheres("axisSphereY",e,this._matrix,b.Color.GREEN),n=(this._layer._primitives.add(i),b.Matrix4.multiply(i.geometryInstances.modelMatrix,this._rotationY,i.geometryInstances.modelMatrix),this._createAxisSpheres("axisSphereX",e,this._matrix,b.Color.BLUE));this._layer._primitives.add(n),b.Matrix4.multiply(n.geometryInstances.modelMatrix,this._rotationX,n.geometryInstances.modelMatrix)},_createAxisSpheres:function(t,e,i,n){e=new b.PolylineGeometry({positions:e,width:10}),e=new b.GeometryInstance({geometry:e,id:t,attributes:{color:b.ColorGeometryInstanceAttribute.fromColor(n)}});return new b.Primitive({geometryInstances:e,appearance:new b.PolylineColorAppearance({translucent:!1}),modelMatrix:i})},_updateAxis(i){if(this._layer){var n=this._layer._primitives._primitives;for(let t=1,e=n.length;t<e;t++){var a=n[t],r=b.Matrix4.fromTranslation(new b.Cartesian3(i.x,i.y,i.z));b.Matrix4.multiply(a.modelMatrix,r,a.modelMatrix)}}var t=b.Matrix4.fromTranslation(new b.Cartesian3(i.x,i.y,i.z));b.Matrix4.multiply(this._model.modelMatrix,t,this._model.modelMatrix)},_updateAxisSphere(i){if(this._layer){var n=this._layer._primitives._primitives;for(let t=1,e=n.length;t<e;t++){var a=n[t],r=b.Matrix4.fromRotationTranslation(i);b.Matrix4.multiply(a.modelMatrix,r,a.modelMatrix)}}var t=b.Matrix4.fromRotationTranslation(i);b.Matrix4.multiply(this._model.modelMatrix,t,this._model.modelMatrix)},_bindHandler(){this._handler.setInputAction(t=>{if(this._xyzState&&this._xyzPid)switch(this._xyzPid){case"axisX-line":this._updateAxis({x:-1,y:0,z:0});break;case"axisY-line":this._updateAxis({x:0,y:-1,z:0});break;case"axisZ-line":this._updateAxis({x:0,y:0,z:-1});break;case"axisX-arrow":this._updateAxis({x:1,y:0,z:0});break;case"axisY-arrow":this._updateAxis({x:0,y:1,z:0});break;case"axisZ-arrow":this._updateAxis({x:0,y:0,z:1});break;case"axisSphereX":this._updateAxisSphere(b.Matrix3.fromRotationX(b.Math.toRadians(1)));break;case"axisSphereY":this._updateAxisSphere(b.Matrix3.fromRotationY(b.Math.toRadians(1)));break;case"axisSphereZ":this._updateAxisSphere(b.Matrix3.fromRotationZ(b.Math.toRadians(1)))}},b.ScreenSpaceEventType.MOUSE_MOVE),this._handler.setInputAction(t=>{t=viewer.scene.pick(t.position);t&&t.id&&(this._xyzPid=t.id,this._xyzState=!0)},b.ScreenSpaceEventType.LEFT_DOWN),this._handler.setInputAction(()=>{this._xyzState=!1,this._xyzPid=void 0},b.ScreenSpaceEventType.LEFT_UP)}},b.Scene.XyzAxisPrimitive=t},_installArrowPolylinePrimitive:function(){b.Scene.ArrowPolylinePrimitive=function(t={}){this._color=t.color||b.Color.RED,this._width=t.width||3,this._headWidth=t.headWidth||2*this._width,this._length=t.length||300,this._headLength=t.headLength||10,this._inverse=t.inverse||!1,this.position=t.position;var t=t.id,e=b.CylinderGeometry.createGeometry(new b.CylinderGeometry({length:this._length,topRadius:this._width,bottomRadius:this._width})),i=b.CylinderGeometry.createGeometry(new b.CylinderGeometry({length:this._headLength,topRadius:0,bottomRadius:this._headWidth}));let n=(this._length+this._headLength)/2;this._inverse&&(n=-n);var a=i,r=[0,0,n],o=new b.Cartesian3;r.length?(o.x=r[0],o.y=r[1],o.z=r[2]):b.Cartesian3.clone(r,o);for(let t=0;t<a.attributes.position.values.length;t+=3)a.attributes.position.values[t]+=o.x,a.attributes.position.values[t+1]+=o.y,a.attributes.position.values[t+2]+=o.z;return new b.Primitive({modelMatrix:b.Transforms.eastNorthUpToFixedFrame(this.position),geometryInstances:[new b.GeometryInstance({id:t+"-line",geometry:e}),new b.GeometryInstance({id:t+"-arrow",geometry:i})],appearance:new b.MaterialAppearance({material:b.Material.fromType("Color",{color:this._color})})})}},_installShadowPrimitive:function(){function t(t){var e=(t=b.defaultValue(t,b.defaultValue.EMPTY_OBJECT)).scene;if(!b.defined(e))throw new b.DeveloperError("scene is required.");var i=(this._scene=e)._context;if(!b.defined(i))throw new b.DeveloperError("context is required.");if(!b.defined(t.viewerPosition))throw new b.DeveloperError("this view position is required.");this._viewerPosition=t.viewerPosition,this._positions=void 0,this._indices=void 0,this._drawLineCommand=void 0,this._depthCamera=new b.Camera(e),this._depthCamera.position=this._viewerPosition,this._direction=0,this._pitch=0,this._horizontalFov=b.defaultValue(t.horizontalFov,60),this._verticalFov=b.defaultValue(t.verticalFov,45),this._cameraUpdated=!1,this._targetPoint=this._viewerPosition.clone();e=new b.Cartesian3(0,0,100),t=b.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);b.Matrix4.multiplyByPoint(t,e,this._targetPoint),this._distance=100,this._cameraUpdated=!1,this._modelMatrix=new b.Matrix4,this._shadowMap=new b.ShadowMap({context:i,enabled:!0,lightCamera:this._depthCamera,cascadesEnabled:!1}),this.show=!0,this._invisiblyColor=b.Color.RED,this._visiblyColor=b.Color.GREEN,this._shadowMap.useCustomColor=!0,this.shadowMap._customColor={invisibly:b.Color.RED,visibly:b.Color.GREEN},this._initialize=function(){this._positions=new Float32Array(633),this._indices=new Uint16Array(408);var t=this._indices,e=0;t[e++]=0,t[e++]=1,t[e++]=0,t[e++]=21,t[e++]=0,t[e++]=85,t[e++]=0,t[e++]=105;for(var i=0,n=0;n<5;++n){i++;for(var a=0;a<20;++a)t[e++]=i++,t[e++]=i}i++;for(var r=0;r<20;++r)for(var o=0;o<5;++o)t[e++]=i,t[e++]=5+i++;this._initialized=!0},this._debugLightFrustum=void 0,this._debugShow=!0}Object.defineProperties(t.prototype,{shadowMap:{get:function(){return this._shadowMap}},debugLightFrustum:{get:function(){return this._debugLightFrustum}},debugShow:{get:function(){return this._debugShow},set:function(t){this.shadowMap.debugShow=t,this._debugShow=t}},invisiblyColor:{get:function(){return this._invisiblyColor},set:function(t){this._invisiblyColor=t,this.shadowMap._customColor.invisibly=t}},visiblyColor:{get:function(){return this._visiblyColor},set:function(t){this._visiblyColor=t,this.shadowMap._customColor.visibly=t}},viewerPosition:{get:function(){return this._viewerPosition},set:function(t){this._viewerPosition=t,this._cameraUpdated=!1}},direction:{get:function(){return this._direction},set:function(t){this._direction=t,this._cameraUpdated=!1}},pitch:{get:function(){return this._pitch},set:function(t){this._pitch=t,this._cameraUpdated=!1}},horizontalFov:{get:function(){return this._horizontalFov},set:function(t){this._horizontalFov=t,this._cameraUpdated=!1,this._hintLineUpdated=!1}},verticalFov:{get:function(){return this._verticalFov},set:function(t){this._verticalFov=t,this._cameraUpdated=!1,this._hintLineUpdated=!1}},distance:{get:function(){return this._distance},set:function(t){this._distance=t,this._cameraUpdated=!1}}}),t.prototype.setDebugFrustumEffect=function(e,i){var t,n;this.debugShow&&(t=this.debugLightFrustum._planesPrimitives,n=this.debugLightFrustum._outlinePrimitives,t.forEach(function(t){t.show=e}),n.forEach(function(t){t.show=i}))},t.prototype.update=function(t){var e;this.show&&(this._cameraUpdated||(this._updateCamera(),this.debugShow&&!b.defined(this.debugLightFrustum)&&(this._debugLightFrustum=new b.DebugCameraPrimitive({camera:this._depthCamera,color:b.Color.YELLOW,updateOnChange:!0}),this.setDebugFrustumEffect(!1,!0))),e=t.frustumSplits[1],t.frustumSplits[1]=this._distance,this._debugLightFrustum.update(t),t.frustumSplits[1]=e,t.shadowMaps.push(this.shadowMap))},t.prototype._updateCamera=function(){this._depthCamera.frustum.near=.001*this._distance,this._depthCamera.frustum.far=this._distance,this._depthCamera.frustum.fov=b.Math.toRadians(Math.max(this._horizontalFov,this._verticalFov)),this._depthCamera.frustum.aspectRatio=this._horizontalFov/this._verticalFov,this._depthCamera.setView({destination:this._viewerPosition,orientation:{heading:b.Math.toRadians(this._direction),pitch:b.Math.toRadians(this._pitch)}}),this._modelMatrix=this._depthCamera.inverseViewMatrix,this._cameraUpdated=!0},t.prototype.setPoseByTargetPoint=function(t){this.distance=b.Cartesian3.distance(this._viewerPosition,t);var e=new b.Cartesian3,i=b.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);b.Matrix4.inverse(i,i),b.Matrix4.multiplyByPoint(i,t,e),b.Cartesian3.normalize(e,e),this.direction=b.Math.toDegrees(Math.atan2(e.x,e.y)),this.pitch=b.Math.toDegrees(Math.asin(e.z))},t.prototype._updateHintLine=function(t){var e,i=this._positions,n=b.Math.toRadians(this._horizontalFov),a=b.Math.toRadians(this._verticalFov),r=Math.tan(.5*n),a=Math.tan(.5*a),o=-(r=this._distance*r),a=-(e=this._distance*a),o=new b.Cartesian3(o,a,-this._distance),a=new b.Cartesian3(r,e,0),r=(b.Matrix4.multiplyByPoint(this._modelMatrix,o,o),b.Matrix4.multiplyByPoint(this._modelMatrix,a,a),b.BoundingSphere.fromCornerPoints(o,a));if(t.cullingVolume.computeVisibility(r)!==Intersect.OUTSIDE){this._valid=!0;var s=0;i[s++]=0,i[s++]=0,i[s++]=0;for(var l,c=Math.PI-.5*n,h=n/4,d=0;d<5;++d)for(var x=c+d*h,u=e/(this._distance/Math.cos(x)),S=-(f=Math.atan(u)),p=f/10,g=0;g<21;++g)l=S+g*p,i[s++]=this._distance*Math.cos(l)*Math.sin(x),i[s++]=this._distance*Math.sin(l),i[s++]=this._distance*Math.cos(l)*Math.cos(x);for(var h=n/20,m=0;m<21;++m){x=c+m*h;for(var f,u=e/(this._distance/Math.cos(x)),S=-(f=Math.atan(u)),p=f/2,v=0;v<5;++v)l=S+v*p,i[s++]=this._distance*Math.cos(l)*Math.sin(x),i[s++]=this._distance*Math.sin(l),i[s++]=this._distance*Math.cos(l)*Math.cos(x)}var y,C=t.context,o=b.Buffer.createIndexBuffer({context:C,typedArray:new Uint32Array(this._indices),usage:b.BufferUsage.STATIC_DRAW,indexDatatype:IndexDatatype.UNSIGNED_INT}),a=b.Buffer.createVertexBuffer({context:C,typedArray:b.ComponentDatatype.createTypedArray(b.ComponentDatatype.FLOAT,this._positions),usage:b.BufferUsage.STATIC_DRAW}),n=[],t=(n.push({index:0,vertexBuffer:a,componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1}),new b.VertexArray({context:C,attributes:n,indexBuffer:o}));b.defined(this._drawLineCommand)?(this._drawLineCommand.vertexArray.destroy(),this._drawLineCommand.vertexArray=t,this._drawLineCommand.modelMatrix=this._modelMatrix,this._drawLineCommand.boundingVolume=r):(a=b.ShaderProgram.fromCache({context:C,vertexShaderSource:"ttribute vec3 position;\n uniform mat4 u_modelViewMatrix;\n void main()\n {\n gl_Position = czm_projection* u_modelViewMatrix* vec4(position.xyz,1.0);\n }\n ",fragmentShaderSource:"uniform vec4 u_bgColor;\n void main()\n {\n out_FragColor = u_bgColor;\n }\n "}),n=b.RenderState.fromCache({depthTest:{enabled:!0}}),o={u_bgColor:function(){return y._lineColor},u_modelViewMatrix:function(){return C.uniformState.modelView}},(y=this)._drawLineCommand=new b.DrawCommand({boundingVolume:r,modelMatrix:y._modelMatrix,primitiveType:b.PrimitiveType.LINES,vertexArray:t,shaderProgram:a,castShadows:!1,receiveShadows:!1,uniformMap:o,renderState:n,pass:b.Pass.OPAQUE})),this._hintLineUpdated=!0}else this._valid=!1},b.Scene.ShadowPrimitive=t},_installPointsPrimitive:function(){function t(t){t&&t.viewer&&t.Cartesians&&(this._vertexShader=this.getVSPolylie(),this._fragmentShader=this.getFSPolyline(),this._geometry=null,this._appearance=null,this._viewer=t.viewer,this.build(t))}t.prototype={build:function(t){if(t.Cartesians&&2<=t.Cartesians.length){var e=[],i=[],n=[];if(t.Colors&&t.Colors.length===4*t.Cartesians.length){for(var a=0;a<t.Cartesians.length;a++)e.push(t.Cartesians[a].x),e.push(t.Cartesians[a].y),e.push(t.Cartesians[a].z);i=t.Colors}else for(var r=0;r<t.Cartesians.length;r++)e.push(t.Cartesians[r].x),e.push(t.Cartesians[r].y),e.push(t.Cartesians[r].z),i.push(0),i.push(0),i.push(1),i.push(1);for(var o=0;o<t.Cartesians.length;o++)n.push(o);this.positionArr=new Float64Array(e),this.colorArr=new Float32Array(i),this.indiceArr=new Uint16Array(n)}else{var s=b.Cartesian3.fromDegrees(0,0,-10),l=b.Cartesian3.fromDegrees(0,.001,-10);this.positionArr=new Float64Array([s.x,s.y,s.z,l.x,l.y,l.z]),this.colorArr=new Float32Array([0,0,1,1,0,0,1,1]),this.indiceArr=new Uint16Array([0,1])}this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),this._appearance=this.createAppearence(this._fragmentShader,this._vertexShader),this.primitive=this._viewer.scene.primitives.add(new b.Primitive({geometryInstances:new b.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))},getVSPolylie:function(){return"in vec3 position3DHigh; in vec3 position3DLow; in vec4 color; out vec4 v_color; in float batchId; void main() { vec4 p = czm_computePosition(); v_color =color; p = czm_modelViewProjectionRelativeToEye * p; gl_Position = p; gl_PointSize=4.0; } "},getFSPolyline:function(){return"in vec4 v_color; void main() { float d = distance(gl_PointCoord, vec2(0.5,0.5)); if(d < 0.5){ out_FragColor = v_color; }else{ discard; } } "},createAppearence:function(t,e){return new b.Appearance({renderState:{blending:b.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,depthTest:{enabled:!0},depthMask:!0},fragmentShaderSource:t,vertexShaderSource:e})},createGeometry:function(t,e,i){return new b.Geometry({attributes:{position:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t}),color:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:4,values:e})},indices:i,primitiveType:b.PrimitiveType.POINTS,boundingSphere:b.BoundingSphere.fromVertices(t)})},remove:function(){null!=this.primitive&&(this._viewer.scene.primitives.remove(this.primitive),this.primitive=null)},updateCartesianPosition:function(t){if(null!=this.primitive&&(this._viewer.scene.primitives.remove(this.primitive),!(t&&t.length<2))){if(t.length===this.positionArr.length/3){var e=t[0],i=t[1];this.positionArr=new Float64Array([e.x,e.y,e.z,i.x,i.y,i.z]),this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr)}else{for(var n=[],a=[],r=[],o=0;o<t.length;o++)n.push(t[o].x),n.push(t[o].y),n.push(t[o].z),a.push(0),a.push(0),a.push(1),a.push(1);for(var s=0;s<t.length;s++)r.push(s);this.positionArr=new Float64Array(n),this.colorArr=new Float32Array(a),this.indiceArr=new Uint16Array(r),geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),appearance=this.createAppearence(this._fragmentShader,this._vertexShader)}this.primitive=this._viewer.scene.primitives.add(new b.Primitive({geometryInstances:new b.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))}},updateCartesianPositionColor:function(t,e){if(e.length===4*t.length&&null!=this.primitive&&(viewer.scene.primitives.remove(this.primitive),!(t&&t.length<2))){if(t.length===this.positionArr.length/3){var i=t[0],n=t[1];this.positionArr=new Float64Array([i.x,i.y,i.z,n.x,n.y,n.z]),this.colorArr=new Float32Array(e),geometry=CreateGeometry(this.positionArr,this.colorArr,this.indiceArr)}else{for(var a=[],r=[],o=0;o<t.length;o++)a.push(t[o].x),a.push(t[o].y),a.push(t[o].z);for(o=0;o<t.length;o++)r.push(o);this.positionArr=new Float64Array(a),this.colorArr=new Float32Array(e),this.indiceArr=new Uint16Array(r),this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),this._appearance=this.createAppearence(this._fragmentShader,this._vertexShader)}this.primitive=viewer.scene.primitives.add(new b.Primitive({geometryInstances:new b.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))}}},b.Scene.PointsPrimitive=t},_installWaterPrimitive:function(){function t(t){this._positions=t.positions,this._url=t.img||this.getDfSt(["primitive","WaterPrimitive"])||"static/data/images/Textures/waterNormals.jpg",this._frequency=t.frequency||1e3,this._animationSpeed=t.animationSpeed||.01,this._amplitude=t.amplitude||10,this._extrudedHeight=t.extrudedHeight||0,this._fs=this.getFS()}t.prototype.build=function(){this._geometry=this._createGeometry(),this._appearance=this._createAppearence(),this.primitive=this._viewer.scene.primitives.add(new b.Primitive({allowPicking:!1,geometryInstances:new b.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))},t.prototype._createAppearence=function(){return new b.EllipsoidSurfaceAppearance({material:new b.Material({fabric:{type:"Water",uniforms:{normalMap:this._url,frequency:this._frequency,animationSpeed:this._animationSpeed,amplitude:this._amplitude}}}),fragmentShaderSource:this._fs})},t.prototype._createGeometry=function(){return new b.PolygonGeometry({polygonHierarchy:new b.PolygonHierarchy(b.Cartesian3.fromDegreesArrayHeights(this._positions)),extrudedHeight:this._extrudedHeight,perPositionHeight:!0})},t.prototype.getFS=function(){return"in vec3 v_positionMC;\n in vec3 v_positionEC;\n in vec2 v_st;\n \n void main()\n {\n czm_materialInput materialInput;\n vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n #ifdef FACE_FORWARD\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n #endif\n materialInput.s = v_st.s;\n materialInput.st = v_st;\n materialInput.str = vec3(v_st, 0.0);\n materialInput.normalEC = normalEC;\n materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\n vec3 positionToEyeEC = -v_positionEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n czm_material material = czm_getMaterial(materialInput);\n #ifdef FLAT\n out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n #else\n out_FragColor = czm_phong(normalize(positionToEyeEC), material);\n out_FragColor.a = 0.5;\n #endif\n }\n "},C.prototype.updateDegreesPosition=function(t,e){null==this.primitive||(this._viewer.scene.primitives.remove(this.primitive),t&&t.length<3)||(t=this._createGeometry(t,e||0),this.primitive=this._viewer.scene.primitives.add(new b.Primitive({allowPicking:!1,geometryInstances:new b.GeometryInstance({geometry:t}),appearance:this._appearance,asynchronous:!1})))},b.Scene.WaterPrimitive=t},_installTexturePrimitive:function(){function t(t){this._vertexShader=this.getVS(),this._fragmentShader=this.getFS(),this._materialShader=this.getMS(),this._url=t.url,this._cartesians=t.cartesians,this._id=t.id||""}t.prototype.build=function(){for(var t=[],e=0;e<this._cartesians.length;e++)t.push(this._cartesians[e].x),t.push(this._cartesians[e].y),t.push(this._cartesians[e].z);this._positionArr=new Float32Array(t),this._sts=new Uint8Array([0,0,1,0,1,1,0,1]),this._indiceArr=new Uint16Array([0,1,2,0,2,3]),this._geometry=this._createGeometry(),this._appearance=this._createAppearence(),this.primitive=this._viewer.scene.primitives.add(new b.Primitive({geometryInstances:new b.GeometryInstance({geometry:this._geometry,id:this._id}),appearance:this._appearance,asynchronous:!1}))},t.prototype._createGeometry=function(){var t=new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:this._sts});return new b.Geometry({attributes:{position:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:this._positions}),st:t},indices:this._indices,primitiveType:b.PrimitiveType.TRIANGLES,boundingSphere:b.BoundingSphere.fromVertices(positions)})},t.prototype._createAppearence=function(){return new b.Appearance({material:new b.Material({fabric:{uniforms:{image:this._url},source:this._materialShader}}),aboveGround:!0,faceForward:!0,flat:!0,translucent:!1,renderState:{blending:b.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,depthTest:{enabled:!0},depthMask:!0},fragmentShaderSource:this._fragmentShader,vertexShaderSource:this._vertexShader})},t.prototype.getVS=function(){return"in vec3 position3DHigh; in vec3 position3DLow; in vec2 st; in float batchId; out vec2 v_st; void main() { vec4 p = czm_computePosition(); v_st=st; p = czm_modelViewProjectionRelativeToEye * p; gl_Position = p; } "},t.prototype.getFS=function(){return"in vec2 v_st; void main() { czm_materialInput materialInput; czm_material material=czm_getMaterial(materialInput,v_st); vec4 color=vec4(material.diffuse + material.emission,material.alpha); if(color.x==1.0&&color.y==1.0&&color.z==1.0&&color.w==1.0) color=vec4(vec3(0.0,0.0,0.0),0.0); out_FragColor =color; } "},t.prototype.getMS=function(){return"czm_material czm_getMaterial(czm_materialInput materialInput,vec2 v_st) { vec4 color = texture(image, v_st); czm_material material = czm_getDefaultMaterial(materialInput); material.diffuse= color.rgb; material.alpha=color.a; return material; } "},b.Scene.TexturePrimitive=t},_installProbingPrimitive:function(){var e={color:new b.Color(1,0,1,.8),repeat:30,offset:0,thickness:.3,center:b.Cartesian3.fromDegrees(116.39,39.9),length:4e5,bottom:1e3,top:0},i=this._viewer;function t(t){this._viewer=i,this._length=t.length||e.length,this._center=t.center||e.center,this._color=t.color||e.color,this._repeat=t.repeat||e.repeat,this._offset=t.offset||e.offset,this._thickness=t.thickness||e.thickness,this._bottom=t.bottom||e.bottom,this._top=t.top||e.top,this._radar=void 0,this.build()}t.prototype.build=function(){var t=new b.CylinderGeometry({length:this._length,topRadius:this._top,bottomRadius:this._bottom,vertexFormat:b.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat}),t=new b.GeometryInstance({geometry:t,modelMatrix:this.getModelMatrix()}),e=new b.MaterialAppearance({material:this.getMaterial(),faceForward:!1,closed:!0}),i=this;this._radar=this._viewer.scene.primitives.add(new b.Primitive({geometryInstances:[t],appearance:e})),this._viewer.scene.preUpdate.addEventListener(function(){var t=i._radar.appearance.material.uniforms.offset;1<(t-=.001)&&(t=0),i._radar.appearance.material.uniforms.offset=t})},t.prototype.getModelMatrix=function(){return b.Matrix4.multiplyByTranslation(b.Transforms.eastNorthUpToFixedFrame(this._center),new b.Cartesian3(0,0,.5*this._length),new b.Matrix4)},t.prototype.updateModelMatrix=function(){},t.prototype.getMaterial=function(){return new b.Material({fabric:{type:"radarPrimitive",uniforms:{color:this._color,repeat:this._repeat,offset:this._offset,thickness:this._thickness},source:"uniform vec4 color; \n uniform float repeat; \n uniform float offset; \n uniform float thickness;\n\n czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n float sp = 1.0/repeat;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5));\n float m = mod(dis + offset, sp);\n float a = step(sp*(1.0-thickness), m); \n\n material.diffuse = color.rgb;\n material.alpha = a * color.a;\n return material;\n }"},translucent:!1})},t.prototype.remove=function(){this._radar&&this._viewer.scene.primitives.remove(this._radar)},b.Scene.ProbingPrimitive=t}};let w=null;function I(t,e,i){t&&(w=e,this._drawLayer=new w.CustomDataSource("drawLayer"),this.$graphics=new c(t,e),t)&&t.dataSources.add(this._drawLayer)}I.prototype={drawPointGraphics:function(e){var i,n,t,a,r,o;(e=e||{}).style=e.style||{image:this.getDfSt(["drawPointGraphics"])||"static/data/images/file/location4.png",width:35,height:40,clampToGround:!0,scale:1,pixelOffset:new w.Cartesian2(0,-20)},this._viewer&&e&&(t=new w.Entity,a=[],r=this,(o=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas)).setInputAction(function(t){t=r._viewer.scene.camera.pickEllipsoid(t.position,r._viewer.scene.globe.ellipsoid);t&&t.x&&(i=t,a.push(t))},w.ScreenSpaceEventType.LEFT_CLICK),o.setInputAction(function(t){o.destroy(),o=null,"function"==typeof e.callback&&e.callback(r.transformCartesianArrayToWGS84Array(a),n)},w.ScreenSpaceEventType.RIGHT_CLICK),t.billboard=e.style,t.position=new w.CallbackProperty(function(){return i},!1),n=this._drawLayer.entities.add(t))},drawLineGraphics:function(e){if(e=e||{},this._viewer&&e){var i,n=[],t=new w.Entity,a=this,r=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);r.setInputAction(function(t){t=a.getCatesian3FromPX(t.position);t&&t.x&&(0==n.length&&n.push(t.clone()),e.measure&&o(t),2==n.length&&"straightLine"===e.type&&(r.destroy(),r=null,"function"==typeof e.callback)&&e.callback(a.transformCartesianArrayToWGS84Array(n),i),n.push(t))},w.ScreenSpaceEventType.LEFT_CLICK),r.setInputAction(function(t){t=a.getCatesian3FromPX(t.endPosition);2<=n.length&&t&&t.x&&(n.pop(),n.push(t))},w.ScreenSpaceEventType.MOUSE_MOVE),r.setInputAction(function(t){r.destroy(),r=null;t=a.getCatesian3FromPX(t.position);e.measure&&o(t),"function"==typeof e.callback&&e.callback(a.transformCartesianArrayToWGS84Array(n),i)},w.ScreenSpaceEventType.RIGHT_CLICK),t.polyline={width:e.width||5,material:e.material||w.Color.BLUE.withAlpha(.8),clampToGround:e.clampToGround||!1,clampToS3M:e.clampToS3M||!1},t.polyline.positions=new w.CallbackProperty(function(){return n},!1),i=this._drawLayer.entities.add(t);const o=function(t){var e=new w.Entity;e.position=t,e.point={pixelSize:10,outlineColor:w.Color.BLUE,outlineWidth:5},e.label={text:(a.getPositionDistance(a.transformCartesianArrayToWGS84Array(n))/1e3).toFixed(4)+"公里",show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(-20,-80)},a._drawLayer.entities.add(e)}}},drawPolygonGraphics:function(i){if((i=i||{}).style=i.style||{width:3,material:w.Color.BLUE.withAlpha(.8),clampToGround:!0},this._viewer&&i){var n=[],e=new w.PolygonHierarchy,a=new w.Entity,r=this,o=null,s=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);s.setInputAction(function(t){t=r.getCatesian3FromPX(t.position);t&&t.x&&(0==n.length&&(e.positions.push(t.clone()),n.push(t.clone())),n.push(t.clone()),e.positions.push(t.clone()),o||(a.polyline=i.style,a.polyline.positions=new w.CallbackProperty(function(){return n},!1),a.polygon={hierarchy:new w.CallbackProperty(function(){return e},!1),material:w.Color.WHITE.withAlpha(.1),clampToGround:i.clampToGround||!1},a.clampToS3M=!0,o=r._drawLayer.entities.add(a)))},w.ScreenSpaceEventType.LEFT_CLICK),s.setInputAction(function(t){t=r.getCatesian3FromPX(t.endPosition);2<=n.length&&t&&t.x&&(n.pop(),n.push(t),e.positions.pop(),e.positions.push(t))},w.ScreenSpaceEventType.MOUSE_MOVE),s.setInputAction(function(){var t,e;s.destroy(),n.push(n[0]),i.height&&(a.polygon.extrudedHeight=i.height,a.polygon.material=w.Color.BLUE.withAlpha(.5)),i.measure&&(t=n[0],(e=new w.Entity).position=t,e.point={pixelSize:10,outlineColor:w.Color.BLUE,outlineWidth:5},e.label={text:(r.getPositionsArea(r.transformCartesianArrayToWGS84Array(n))/1e6).toFixed(4)+"平方公里",show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(-20,-50)},r._drawLayer.entities.add(e)),"function"==typeof i.callback&&i.callback(r.transformCartesianArrayToWGS84Array(n),o)},w.ScreenSpaceEventType.RIGHT_CLICK)}},drawRectangleGraphics:function(e){var i,n,t,a,r,o;(e=e||{}).style=e.style||{width:3,material:w.Color.BLUE.withAlpha(.5),clampToGround:!0},this._viewer&&e&&(n=[],t=new w.Entity,a=new w.Rectangle,r=this,(o=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas)).setInputAction(function(t){t=r.getCatesian3FromPX(t.position);t&&t.x&&(0==n.length?n.push(t.clone()):(o.destroy(),n.push(t.clone()),a=w.Rectangle.fromCartesianArray([...n,t],w.Ellipsoid.WGS84),"function"==typeof e.callback&&e.callback(r.transformCartesianArrayToWGS84Array(n),i)))},w.ScreenSpaceEventType.LEFT_CLICK),o.setInputAction(function(t){t=r.getCatesian3FromPX(t.endPosition);t&&(a=w.Rectangle.fromCartesianArray([...n,t],w.Ellipsoid.WGS84))},w.ScreenSpaceEventType.MOUSE_MOVE),t.rectangle=e.style,e.height&&(t.rectangle.extrudedHeight=e.height),t.rectangle.coordinates=new w.CallbackProperty(function(){return a},!1),i=this._drawLayer.entities.add(t))},drawCircleGraphics:function(e){if((e=e||{}).style=e.style||{width:3,material:w.Color.BLUE.withAlpha(.5),clampToGround:!0},this._viewer&&e){var i,n=void 0,a=new w.Entity,r=this,o=1,s=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);const l=function(t,e){var t=w.Cartographic.fromCartesian(t),e=w.Cartographic.fromCartesian(e),i=new w.EllipsoidGeodesic,i=(i.setEndPoints(t,e),i.surfaceDistance);o=Math.sqrt(Math.pow(i,2)+Math.pow(e.height-t.height,2))};s.setInputAction(function(t){t=r.getCatesian3FromPX(t.position);t&&t.x&&(n?(l(n,t),s.destroy(),"function"==typeof e.callback&&e.callback({center:n,radius:o},i)):(n=t,a.ellipse=e.style,a.ellipse.semiMajorAxis=new w.CallbackProperty(function(){return o},!1),a.ellipse.semiMinorAxis=new w.CallbackProperty(function(){return o},!1),a.position=new w.CallbackProperty(function(){return n},!1),a.point={pixelSize:5,outlineColor:w.Color.RED,outlineWidth:3},e.height&&(a.ellipse.extrudedHeight=e.height),i=r._drawLayer.entities.add(a)))},w.ScreenSpaceEventType.LEFT_CLICK),s.setInputAction(function(t){t=r._viewer.scene.camera.pickEllipsoid(t.endPosition,r._viewer.scene.globe.ellipsoid);n&&t&&t.x&&l(n,t)},w.ScreenSpaceEventType.MOUSE_MOVE)}},drawTrianglesGraphics:function(e){if((e=e||{}).style=e.style||{width:3,material:w.Color.BLUE.withAlpha(.5)},this._viewer&&e){var i=new w.Entity,n=new w.Entity,a=new w.Entity,r=[],o=[],s=[],l=this,c=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);c.setInputAction(function(t){t=l.getCatesian3FromPX(t.position);if(!t)return!1;0==r.length?(r.push(t.clone()),r.push(t.clone()),o.push(t.clone()),o.push(t.clone())):(c.destroy(),"function"==typeof e.callback&&e.callback({e:i,e2:n,e3:a}))},w.ScreenSpaceEventType.LEFT_CLICK),c.setInputAction(function(t){var e,i,t=l.getCatesian3FromPX(t.endPosition);t&&0<r.length&&(r.pop(),r.push(t.clone()),e=r,i=w.Cartographic.fromCartesian(e[0]),e=w.Cartographic.fromCartesian(e[1]),i=w.Cartesian3.fromDegrees(w.Math.toDegrees(i.longitude),w.Math.toDegrees(i.latitude),e.height),o.pop(),o.push(i.clone()),s.pop(),s.pop(),s.push(t.clone()),s.push(i.clone()))},w.ScreenSpaceEventType.MOUSE_MOVE),i.polyline={positions:new w.CallbackProperty(function(){return r},!1),...e.style},i.position=new w.CallbackProperty(function(){return r[0]},!1),i.point={pixelSize:5,outlineColor:w.Color.BLUE,outlineWidth:5},i.label={text:new w.CallbackProperty(function(){return"直线:"+l.getPositionDistance(l.transformCartesianArrayToWGS84Array(r))+"米"},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(50,-100)},n.polyline={positions:new w.CallbackProperty(function(){return o},!1),...e.style},n.position=new w.CallbackProperty(function(){return s[1]},!1),n.point={pixelSize:5,outlineColor:w.Color.BLUE,outlineWidth:5},n.label={text:new w.CallbackProperty(function(){return"高度:"+(e=o[1],!(t=o[0])&&!e||w.Cartesian3.equals(t,e)?0:(t=w.Cartographic.fromCartesian(t),(w.Cartographic.fromCartesian(e).height-t.height).toFixed(2)))+"米";var t,e},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(-20,100)},a.polyline={positions:new w.CallbackProperty(function(){return s},!1),...e.style},a.position=new w.CallbackProperty(function(){return r[1]},!1),a.point={pixelSize:5,outlineColor:w.Color.BLUE,outlineWidth:5},a.label={text:new w.CallbackProperty(function(){return"水平距离:"+l.getPositionDistance(l.transformCartesianArrayToWGS84Array(s))+"米"},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(-150,-20)},this._drawLayer.entities.add(a),this._drawLayer.entities.add(n),this._drawLayer.entities.add(i)}},drawWallGraphics:function(n){var a;(n=n||{}).style=n.style||{material:w.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:w.Color.WHITE},this._viewer&&n&&(a=this).drawPolygonGraphics({callback:function(t,e){var i=a._drawLayer.entities.add({wall:{positions:a.transformWGS84ArrayToCartesianArray(t),...n.style}});"function"==typeof n.callback&&n.callback(t,i)}})},drawEllipsoidGraphics:function(n){var a;(n=n||{}).style=n.style||{},this._viewer&&n&&(a=this).drawCircleGraphics({callback:function(t,e){var i=a.createGraphics(),e=(i.ellipsoid=a.$graphics.getEllipsoidGraphics({radii:t.radius}),i.position=t.center,a._drawLayer.entities.remove(e),a._drawLayer.entities.add(i));"function"==typeof n.callback&&n.callback({center:t.center,radius:t.radius},e)}})},drawCylinderGraphics:function(n){var a;(n=n||{}).style=n.style||{},this._viewer&&n&&(a=this).drawCircleGraphics({callback:function(t,e){var i=a._drawLayer.entities.add({position:t.center,cylinder:{length:2*t.radius||n.length,topRadius:n.topRadius||t.radius,bottomRadius:n.bottomRadius||t.radius,material:w.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:w.Color.WHITE}});a._drawLayer.entities.remove(e),"function"==typeof n.callback&&n.callback({center:t.center,radius:t.radius},i)}})},drawCorridorGraphics:function(n){var a;(n=n||{}).style=n.style||{},this._viewer&&n&&(a=this).drawLineGraphics({callback:function(t,e){var i=a.createGraphics(),e=(i.corridor={positions:a.transformWGS84ArrayToCartesianArray(t),height:n.height||1,width:n.width||100,cornerType:w.CornerType.BEVELED,extrudedHeight:n.extrudedHeight||1,material:w.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:w.Color.WHITE},a._drawLayer.entities.remove(e),a._drawLayer.entities.add(i));"function"==typeof n.callback&&n.callback(t,e)}})},drawPolylineVolumeGraphics:function(a){(a=a||{}).style=a.style||{};const r=a.circleRadius||20,o=a.arms||7,s=a.rOuter||150,l=a.rInner||75;var c;this._viewer&&a&&(c=this).drawLineGraphics({callback:function(t,e){var i=c.createGraphics(),n="fivePoint"===a.shape?c.computeStar2d(o,s,l):c.computeCircleShap(r),n=(i.polylineVolume={positions:c.transformWGS84ArrayToCartesianArray(t),shape:n,cornerType:w.CornerType.MITERED,material:a.color||w.Color.RED},c._drawLayer.entities.remove(e),c._drawLayer.entities.add(i));"function"==typeof a.callback&&a.callback(t,n)}})}};let _={};function A(t,e){t&&(this._viewer=t,_=e)}A.prototype={mathDistance2d:function(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))},getCirclePoints2d:function(t,e,i,n){for(var a=[],r=Math.PI/180*Math.round(360/n),o=0;o<n;o++){var s=e+t*Math.sin(r*o),l=i+t*Math.cos(r*o);a.unshift({x:s,y:l})}return a},wholeDistance2d:function(i){let n=0;return i&&Array.isArray(i)&&0<i.length&&i.forEach((t,e)=>{e<i.length-1&&(n+=this.mathDistance2d(t,i[e+1]))}),n},getBaseLength2d:function(t){return Math.pow(this.wholeDistance2d(t),.99)},computeStar2d(t,e,i){for(var n=Math.PI/t,a=2*t,r=new Array(a),o=0;o<a;o++){var s=o%2==0?e:i;r[o]=new _.Cartesian2(Math.cos(o*n)*s,Math.sin(o*n)*s)}return r},computeCircleShap(e){var i=[];for(let t=0;t<360;t++){var n=_.Math.toRadians(t);i.push(new _.Cartesian2(e*Math.cos(n),e*Math.sin(n)))}return i},mid2d:function(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]},getCircleCenterOfThreePoints2d:function(t,e,i){var n=[(t[0]+e[0])/2,(t[1]+e[1])/2],e=[n[0]-t[1]+e[1],n[1]+t[0]-e[0]],a=[(t[0]+i[0])/2,(t[1]+i[1])/2],t=[a[0]-t[1]+i[1],a[1]+t[0]-i[0]];return this.getIntersectPoint2d(n,e,a,t)},getIntersectPoint2d:function(t,e,i,n){return t[1]===e[1]?[(n[0]-i[0])/(n[1]-i[1])*(t[1]-i[1])+i[0],t[1]]:i[1]===n[1]?[(e[0]-t[0])/(e[1]-t[1])*(i[1]-t[1])+t[0],i[1]]:(e=(e[0]-t[0])/(e[1]-t[1]),n=(n[0]-i[0])/(n[1]-i[1]),[e*(i=(e*t[1]-t[0]-n*i[1]+i[0])/(e-n))-e*t[1]+t[0],i])},getAzimuth2d:function(t,e){let i,n=Math.asin(Math.abs(e[1]-t[1])/this.mathDistance2d(t,e));return e[1]>=t[1]&&e[0]>=t[0]?i=n+Math.PI:e[1]>=t[1]&&e[0]<t[0]?i=2*Math.PI-n:e[1]<t[1]&&e[0]<t[0]?i=n:e[1]<t[1]&&e[0]>=t[0]&&(i=Math.PI-n),i},getAngleOfThreePoints2d:function(t,e,i){t=this.getAzimuth2d(e,t)-this.getAzimuth2d(e,i);return t<0?t+2*Math.PI:t},isClockWise2d:function(t,e,i){return(i[1]-t[1])*(e[0]-t[0])>(e[1]-t[1])*(i[0]-t[0])},getPointOnLine2d:function(t,e,i){return[e[0]+t*(i[0]-e[0]),e[1]+t*(i[1]-e[1])]},getCubicValue2d:function(t,e,i,n,a){var[r,o]=[1-(t=Math.max(Math.min(t,1),0)),t*t],s=o*t,l=r*r,c=l*r;return[c*e[0]+3*l*t*i[0]+3*r*o*n[0]+s*a[0],c*e[1]+3*l*t*i[1]+3*r*o*n[1]+s*a[1]]},getThirdPoint2d:function(t,e,i,n,a){t=this.getAzimuth2d(t,e),a=a?t+i:t-i,t=n*Math.cos(a),i=n*Math.sin(a);return[e[0]+t,e[1]+i]},inherits2d:function(t,a){function e(){}e.prototype=a.prototype,t.superClass_=a.prototype,t.prototype=new e,(t.prototype.constructor=t).base=function(t,e,i){var n=Array.prototype.slice.call(arguments,2);return a.prototype[e].apply(t,n)}},getArcPoints2d:function(e,i,n,t){var[a,r,o,s]=[null,null,[],t-n],s=s<0?s+2*Math.PI:s;for(let t=0;t<=100;t++){var l=n+s*t/100,a=e[0]+i*Math.cos(l),r=e[1]+i*Math.sin(l);o.push([a,r])}return o},getBisectorNormals2d:function(t,e,i,n){let a=this.getNormal2d(e,i,n),[r,o,s,l,c]=[null,null,null,null,null],h=Math.sqrt(a[0]*a[0]+a[1]*a[1]),d=a[0]/h,x=a[1]/h,u=this.mathDistance2d(e,i),S=this.mathDistance2d(i,n);return o=(c=1e-4<h?this.isClockWise(e,i,n)?(s=t*u,l=i[0]-s*x,c=i[1]+s*d,r=[l,c],s=t*S,l=i[0]+s*x,i[1]-s*d):(s=t*u,l=i[0]+s*x,c=i[1]-s*d,r=[l,c],s=t*S,l=i[0]-s*x,i[1]+s*d):(l=i[0]+t*(e[0]-i[0]),c=i[1]+t*(e[1]-i[1]),r=[l,c],l=i[0]+t*(n[0]-i[0]),i[1]+t*(n[1]-i[1])),[l,c]),[r,o]},getNormal2d:function(t,e,i){var n=t[0]-e[0],t=t[1]-e[1],a=Math.sqrt(n*n+t*t),a=(n/=a,t/=a,i[0]-e[0]),i=i[1]-e[1],e=Math.sqrt(a*a+i*i);return[n+(a/=e),t+(i/=e)]},getLeftMostControlPoint2d:function(t,e){let[i,n,a,r,o]=[t[0],t[1],t[2],null,null],s=this.getBisectorNormals2d(0,i,n,a)[0],l=this.getNormal2d(i,n,a);var c,h,d,x,u;return o=1e-4<Math.sqrt(l[0]*l[0]+l[1]*l[1])?(t=this.mid2d(i,n),d=i[0]-t[0],c=i[1]-t[1],d=2*(c=-(h=2/this.mathDistance2d(i,n))*c)*(h=h*d),x=s[0]-t[0],u=s[1]-t[1],r=t[0]+(c*c-h*h)*x+d*u,t[1]+d*x+(h*h-c*c)*u):(r=i[0]+e*(n[0]-i[0]),i[1]+e*(n[1]-i[1])),[r,o]},getRightMostControlPoint2d:function(t,e){let i=t.length,n=t[i-3],a=t[i-2],r=t[i-1],o=this.getBisectorNormals2d(0,n,a,r)[1],s=this.getNormal2d(n,a,r),l=Math.sqrt(s[0]*s[0]+s[1]*s[1]),[c,h]=[null,null];var d,x,u,S,p;return h=1e-4<l?(t=this.mid2d(a,r),u=r[0]-t[0],d=r[1]-t[1],u=2*(d=-(x=2/this.mathDistance2d(a,r))*d)*(x=x*u),S=o[0]-t[0],p=o[1]-t[1],c=t[0]+(d*d-x*x)*S+u*p,t[1]+u*S+(x*x-d*d)*p):(c=r[0]+e*(a[0]-r[0]),r[1]+e*(a[1]-r[1])),[c,h]},getCurvePoints2d:function(e,i){let t=this.getLeftMostControlPoint2d(i,e),[n,a,r,o,s]=[null,null,null,[t],[]];for(let t=0;t<i.length-2;t++){[n,a,r]=[i[t],i[t+1],i[t+2]];var l=this.getBisectorNormals2d(e,n,a,r);o=o.concat(l)}var c=this.getRightMostControlPoint2d(i,e);c&&o.push(c);for(let e=0;e<i.length-1;e++){n=i[e],a=i[e+1],s.push(n);for(let t=0;t<100;t++){var h=this.getCubicValue2d(t/100,n,o[2*e],o[2*e+1],a);s.push(h)}s.push(a)}return s},getBezierPoints2d:function(a){if(a.length<=2)return a;var t=[],r=a.length-1;for(let n=0;n<=1;n+=.01){let[e,i]=[0,0];for(let t=0;t<=r;t++){var o=this.getBinomialFactor2d(r,t),s=Math.pow(n,t),l=Math.pow(1-n,r-t);e+=o*s*l*a[t][0],i+=o*s*l*a[t][1]}t.push([e,i])}return t.push(a[r]),t},getFactorial2d:function(e){let i=1;switch(e){case e<=1:i=1;break;case 2===e:i=2;break;case 3===e:i=6;break;case 24===e:i=24;break;case 5===e:i=120;break;default:for(let t=1;t<=e;t++)i*=t}return i},getBinomialFactor2d:function(t,e){return this.getFactorial2d(t)/(this.getFactorial2d(e)*this.getFactorial2d(t-e))},getQBSplinePoints2d:function(r){if(r.length<=2)return r;var[o,t]=[2,[]],e=r.length-o-1;t.push(r[0]);for(let a=0;a<=e;a++)for(let n=0;n<=1;n+=.05){let[e,i]=[0,0];for(let t=0;t<=o;t++){var s=this.getQuadricBSplineFactor2d(t,n);e+=s*r[a+t][0],i+=s*r[a+t][1]}t.push([e,i])}return t.push(r[r.length-1]),t},getQuadricBSplineFactor2d:function(t,e){let i=0;return 0===t?i=Math.pow(e-1,2)/2:1===t?i=(-2*Math.pow(e,2)+2*e+1)/2:2===t&&(i=Math.pow(e,2)/2),i}};let G=null;function P(t,e){t&&(this._viewer=t,G=e)}P.prototype={setCircleScanEffect:function(t){var e,i,n,a,r,o,s,l,c,h,d;if(t&&t.position)return e=t.id||"CircleScan"+parseInt(1e3*Math.random()),l=t.position,i=t.radius,n=t.color||G.Color.RED,a=t.duration||1500,r=this,o=t.circleMode||"CircleScan",t=t.border||4,d=l,s=new G.Cartesian4(d.x,d.y,d.z,1),d=this.transformCartesianToWGS84(l),l=this.transformWGS84ToCartesian({lng:d.lng,lat:d.lat,alt:d.alt+500}),c=new G.Cartesian4(l.x,l.y,l.z,1),h=(new Date).getTime(),d=new G.PostProcessStage({name:e,fragmentShader:this._getCircleScanShader({get:!0,border:t}),uniforms:{u_scanCenterEC:function(){return G.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,new G.Cartesian4)},u_scanPlaneNormalEC:function(){var t=G.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,new G.Cartesian4),e=G.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,c,new G.Cartesian4),i=new G.Cartesian3;return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,G.Cartesian3.normalize(i,i),i},u_radius:function(){return"CircleScan"==o?i*(((new Date).getTime()-h)%a)/a:i},u_scanColor:n}}),this._viewer.scene.postProcessStages.add(d),d},setRadarScanEffect:function(t){var e,i,n,a,r,o,s,l,c,h,d,x,u,S,p,g,m,f,v;if(t&&t.position)return e=t.id||"radarScan"+parseInt(1e3*Math.random()),c=t.position,i=t.radius,n=t.color||G.Color.RED,a=t.duration||1500,r=this,o=t.border||1,t=t.width||3,v=c,s=new G.Cartesian4(v.x,v.y,v.z,1),v=this.transformCartesianToWGS84(c),c=this.transformWGS84ToCartesian({lng:v.lng,lat:v.lat,alt:v.alt+500}),l=new G.Cartesian4(c.x,c.y,c.z,1),c=this.transformWGS84ToCartesian({lng:v.lng+.001,lat:v.lat,alt:v.alt}),h=new G.Cartesian4(c.x,c.y,c.z,1),d=(new Date).getTime(),x=new G.Quaternion,u=new G.Matrix3,S=new G.Cartesian4,p=new G.Cartesian4,g=new G.Cartesian4,m=new G.Cartesian3,f=new G.Cartesian3,v=new G.PostProcessStage({name:e,fragmentShader:this._getRadarScanShader({border:o,width:t,get:!0}),uniforms:{u_scanCenterEC:function(){return G.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,S)},u_scanPlaneNormalEC:function(){var t=G.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,S),e=G.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,l,p);return m.x=e.x-t.x,m.y=e.y-t.y,m.z=e.z-t.z,G.Cartesian3.normalize(m,m),m},u_scanLineNormalEC:function(){var t=G.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,S),e=G.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,l,p),i=G.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,h,g),e=(m.x=e.x-t.x,m.y=e.y-t.y,m.z=e.z-t.z,G.Cartesian3.normalize(m,m),f.x=i.x-t.x,f.y=i.y-t.y,f.z=i.z-t.z,((new Date).getTime()-d)%a/a);return G.Quaternion.fromAxisAngle(m,e*G.Math.PI*2,x),G.Matrix3.fromQuaternion(x,u),G.Matrix3.multiplyByVector(u,f,f),G.Cartesian3.normalize(f,f),f},u_radius:i,u_scanColor:n}}),this._viewer.scene.postProcessStages.add(v),v},lighitCentrumScanEffect:function(e){var i=this.createLightScan_getCirclePoints(e.circle[0],e.circle[1],e.circle[2],e.circle[3]),n=this.createLightScan_entityCList(this._viewer,i,e);for(let t=0;t<n.length;t++)t!==n.length-1?this.createLightScan_changeOnePosition(e,n[t],[i[t].x,i[t].y,i[t+1].x,i[t+1].y]):this.createLightScan_changeOnePosition(e,n[t],[i[t].x,i[t].y,i[0].x,i[0].y]);return n},createLightScan_getCirclePoints:function(t,e,i,n){let a=[],r=Math.PI/180*Math.round(360/n),o=0;for(;o<n;o++){var s=e+t*Math.sin(r*o),l=i+t*Math.cos(r*o);a.unshift({x:s,y:l})}return a},createLightScan_changeOnePosition:function(e,t,i){const n=e.positionList;let a,r,o,s,l,c,h=0,d=0;function x(t){a=n[t+1][0]-n[t][0],r=n[t+1][1]-n[t][1],o=a/e.number,s=r/e.number,d=0}x(h),t.polygon.hierarchy=new G.CallbackProperty(function(){return Math.abs(l)>=Math.abs(a)&&Math.abs(c)>=Math.abs(r)&&((h+=1)===n.length-1&&(h=0),i[0]=i[0]+l,i[1]=i[1]+c,i[2]=i[2]+l,i[3]=i[3]+c,x(h)),l=d*o,c=d*s,d++,new G.PolygonHierarchy(G.Cartesian3.fromDegreesArrayHeights([e.observer[0],e.observer[1],e.observer[2],i[0]+l,i[1]+c,0,i[2]+l,i[3]+c,0]))},!1)},createLightScan_entityCList:function(e,i,n){var a=n.observer[0],r=n.observer[1],o=n.observer[2],s=[];for(let t=0;t<i.length;t++){var l=t===i.length-1?new G.PolygonHierarchy(G.Cartesian3.fromDegreesArrayHeights([a,r,o,i[t].x,i[t].y,0,i[0].x,i[0].y,0])):new G.PolygonHierarchy(G.Cartesian3.fromDegreesArrayHeights([a,r,o,i[t].x,i[t].y,0,i[t+1].x,i[t+1].y,0])),l=e.entities.add({name:"三角形",polygon:{hierarchy:l,outline:!1,perPositionHeight:!0,material:n.material}});s.push(l)}return s}};var Z=["RGVwdG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vczsKfQ==","VFJBTlNMVUNFTlQ=","TElORV9TVFJJUA==","UmVjdGFuZ3VsYXJTZW5zb3JQcmltaXRpdmU=","b2JqZWN0","ZXhwb3J0cw==","YW1k","Q2VzaXVtR2VvbWV0cnk=","Y2FsbA==","ZGVmYXVsdA==","Y29tYmluZQ==","ZGVzdHJveU9iamVjdA==","RGV2ZWxvcGVyRXJyb3I=","QnVmZmVy","U2hhZGVyU291cmNl","TWF0ZXJpYWw=","VmVydGV4Rm9ybWF0","SnVsaWFuRGF0ZQ==","Qm94R2VvbWV0cnk=","RWxsaXBzb2lkR2VvbWV0cnk=","YXRhbg==","YXNpbg==","RU1QVFlfT0JKRUNU","c2xpY2U=","bW9kZWxNYXRyaXg=","X2NvbXB1dGVkTW9kZWxNYXRyaXg=","X2NvbXB1dGVkU2NhblBsYW5lTW9kZWxNYXRyaXg=","UE9TSVRJVkVfSU5GSU5JVFk=","eEhhbGZBbmdsZQ==","X3hIYWxmQW5nbGU=","eUhhbGZBbmdsZQ==","X3lIYWxmQW5nbGU=","V0hJVEU=","c2hvd1NlY3RvckxpbmVz","c2hvd1NlY3RvclNlZ21lbnRMaW5lcw==","c2hvd0xhdGVyYWxTdXJmYWNlcw==","bWF0ZXJpYWw=","ZnJvbVR5cGU=","Q29sb3JUeXBl","X21hdGVyaWFs","X3RyYW5zbHVjZW50","bGF0ZXJhbFN1cmZhY2VNYXRlcmlhbA==","X2xhdGVyYWxTdXJmYWNlTWF0ZXJpYWw=","X2xhdGVyYWxTdXJmYWNlVHJhbnNsdWNlbnQ=","c2hvd0RvbWVTdXJmYWNlcw==","ZG9tZVN1cmZhY2VNYXRlcmlhbA==","X2RvbWVTdXJmYWNlTWF0ZXJpYWw=","c2hvd0RvbWVMaW5lcw==","c2hvd0ludGVyc2VjdGlvbg==","aW50ZXJzZWN0aW9uQ29sb3I=","aW50ZXJzZWN0aW9uV2lkdGg=","c2hvd1Rocm91Z2hFbGxpcHNvaWQ=","X3Nob3dUaHJvdWdoRWxsaXBzb2lk","c2hvd1NjYW5QbGFuZQ==","c2NhblBsYW5lQ29sb3I=","c2NhblBsYW5lTW9kZQ==","aG9yaXpvbnRhbA==","c2NhblBsYW5lUmF0ZQ==","X3NjYW5lUGxhbmVYSGFsZkFuZ2xl","X3NjYW5lUGxhbmVZSGFsZkFuZ2xl","X3RpbWU=","bm93","X2JvdW5kaW5nU3BoZXJl","X2JvdW5kaW5nU3BoZXJlV0M=","X3NlY3RvckZyb250Q29tbWFuZA==","X3NlY3RvckJhY2tDb21tYW5k","X3NlY3RvclZB","X3NlY3RvckxpbmVDb21tYW5k","X3NlY3RvckxpbmVWQQ==","X3NlY3RvclNlZ21lbnRMaW5lQ29tbWFuZA==","X3NlY3RvclNlZ21lbnRMaW5lVkE=","X2RvbWVGcm9udENvbW1hbmQ=","X2RvbWVCYWNrQ29tbWFuZA==","X2RvbWVWQQ==","X2RvbWVMaW5lQ29tbWFuZA==","X2RvbWVMaW5lVkE=","X3NjYW5QbGFuZUZyb250Q29tbWFuZA==","X3NjYW5QbGFuZUJhY2tDb21tYW5k","X3NjYW5SYWRpYWxDb21tYW5k","X2NvbG9yQ29tbWFuZHM=","X2Zyb250RmFjZVJT","X2JhY2tGYWNlUlM=","X3Nw","X3VuaWZvcm1z","X3NjYW5Vbmlmb3Jtcw==","aGFsZkFuZ2xlIG11c3QgYmUgZ3JlYXRlciB0aGFuIG9yIGVxdWFsIHRvIHplcm8u","dGhpcy5yYWRpdXMgbXVzdCBiZSBncmVhdGVyIHRoYW4gb3IgZXF1YWwgdG8gemVyby4=","bXVsdGlwbHlCeVVuaWZvcm1TY2FsZQ==","dHJhbnNmb3Jt","aXNUcmFuc2x1Y2VudA==","c2Vjb25kc0RpZmZlcmVuY2U=","bWF4","ZnJvbVJvdGF0aW9uWA==","ZnJvbVJvdGF0aW9uWQ==","bXVsdGlwbHlCeU1hdHJpeDM=","cGFzc2Vz","cmVuZGVy","em95","em94","bWFw","bXVsdGlwbHlCeVZlY3Rvcg==","cmV2ZXJzZQ==","Y29uY2F0","YXBwbHk=","Y3JlYXRlVmVydGV4QnVmZmVy","QllURVNfUEVSX0VMRU1FTlQ=","UE9TSVRJT05fT05MWQ==","RWxsaXBzb2lkT3V0bGluZUdlb21ldHJ5","UElfT1ZFUl9UV08=","X3NjYW5QbGFuZVZB","c2hhZGVyU291cmNl","dW5pZm9ybQ==","X3BpY2tTUA==","X3NjYW5lUGxhbmVTUA==","RlJPTlQ=","X3BpY2tSUw==","dV9ub3JtYWxEaXJlY3Rpb24=","cGFzcw==","dV90eXBl","Q2hlY2s=","R2VvbWV0cnlBdHRyaWJ1dGVz","SW5kZXhEYXRhdHlwZQ==","cm91bmQ=","c3RhY2tQYXJ0aXRpb25z","c2xpY2VQYXJ0aXRpb25z","dHlwZU9m","bnVtYmVy","dmVydGV4Rm9ybWF0","REVGQVVMVA==","X3N0YWNrUGFydGl0aW9ucw==","X3NsaWNlUGFydGl0aW9ucw==","X3ZlcnRleEZvcm1hdA==","ZnJvbURpbWVuc2lvbnM=","Z3JlYXRlclRoYW5PckVxdWFscw==","Y3JlYXRlVHlwZWRBcnJheQ==","VFdPX1BJ","dGltZUVuZA==","Q29uaWNBcmNTZW5zb3JHZW9tZXRyeQ==","c3ViZGl2aXNpb25z","b3B0aW9ucy5zdGFja1BhcnRpdGlvbnMgY2Fubm90IGJlIGxlc3MgdGhhbiAx","b3B0aW9ucy5zbGljZVBhcnRpdGlvbnMgY2Fubm90IGJlIGxlc3MgdGhhbiAw","b3B0aW9ucy5zdWJkaXZpc2lvbnMgbXVzdCBiZSBncmVhdGVyIHRoYW4gb3IgZXF1YWwgdG8gemVyby4=","X3N1YmRpdmlzaW9ucw==","Q29uaWNBcmNTZW5zb3JPdXRsaW5lR2VvbWV0cnk=","RXZlbnQ=","Y3JlYXRlTWF0ZXJpYWxQcm9wZXJ0eURlc2NyaXB0b3I=","Y3JlYXRlUHJvcGVydHlEZXNjcmlwdG9y","X2FuZ2xlU3Vic2NyaXB0aW9u","X3JhZGl1c1N1YnNjcmlwdGlvbg==","X3N0YWNr","X3N0YWNrU3Vic2NyaXB0aW9u","X3NsaWNl","X3NsaWNlU3Vic2NyaXB0aW9u","X2NvbG9y","X2NvbG9yU3Vic2NyaXB0aW9u","X3Nob3dTdWJzY3JpcHRpb24=","X2ZpbGw=","X2ZpbGxTdWJzY3JpcHRpb24=","X21hdGVyaWFsU3Vic2NyaXB0aW9u","X291dGxpbmVTdWJzY3JpcHRpb24=","X291dGxpbmVDb2xvcg==","X291dGxpbmVDb2xvclN1YnNjcmlwdGlvbg==","X291dGxpbmVXaWR0aA==","X291dGxpbmVXaWR0aFN1YnNjcmlwdGlvbg==","X3NoYWRvd3M=","X3NoYWRvd3NTdWJzY3JpcHRpb24=","X2Rpc3RhbmNlRGlzcGxheUNvbmRpdGlvbg==","X2Rpc3RhbmNlRGlzcGxheUNvbmRpdGlvblN1YnNjcmlwdGlvbg==","X2RlZmluaXRpb25DaGFuZ2Vk","X2dhemU=","X2dhemVTdWJzY3JpcHRpb24=","bWVyZ2U=","c3RhY2s=","ZmlsbA==","b3V0bGluZUNvbG9y","b3V0bGluZVdpZHRo","c2hhZG93cw==","ZGlzdGFuY2VEaXNwbGF5Q29uZGl0aW9u","Z2F6ZQ==","c291cmNlIGlzIHJlcXVpcmVkLg==","Q29uaWNBcmNTZW5zb3JHcmFwaGljcw==","a2V5cw==","UmVjdGFuZ3VsYXJTZW5zb3JHcmFwaGljcw==","UmVjdGFuZ3VsYXJTZW5zb3JWaXN1YWxpemVy","Q29uaWNBcmNTZW5zb3JDb2xsZWN0aW9u","RGF0YVNvdXJjZURpc3BsYXk=","ZGVmYXVsdFZpc3VhbGl6ZXJzQ2FsbGJhY2s=","YXR0cmlidXRlIHZlYzQgcG9zaXRpb247DQphdHRyaWJ1dGUgdmVjMyBub3JtYWw7DQoNCnZhcnlpbmcgdmVjMyB2X3Bvc2l0aW9uOw0KdmFyeWluZyB2ZWMzIHZfcG9zaXRpb25XQzsNCnZhcnlpb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Vmlld2Vy","Q29sb3JHZW9tZXRyeUluc3RhbmNlQXR0cmlidXRl","UHJpbWl0aXZl","UGVySW5zdGFuY2VDb2xvckFwcGVhcmFuY2U=","RGlzdGFuY2VEaXNwbGF5Q29uZGl0aW9u","RGlzdGFuY2VEaXNwbGF5Q29uZGl0aW9uR2VvbWV0cnlJbnN0YW5jZUF0dHJpYnV0ZQ==","dmlld2VyIGlzIHJlcXVpcmVkLg==","X3ZpZXdlcg==","Y2xvY2s=","X2Nsb2Nr","X3ByaW1pdGl2ZQ==","X291dGxpbmVQcmltaXRpdmU=","X2NvbmljQXJjU2Vuc29yQ29sbGVjdGlvbg==","b25UaWNr","Q29uaWNBcmNTZW5zb3I=","aW5kZXhPZg==","cmVtb3ZlQWxs","Y3VycmVudFRpbWU=","cmVtb3ZlQW5kRGVzdHJveQ==","X2NvbmljQXJjU2Vuc29y","bXVsdGlwbHlCeVNjYWxhcg==","UE9TSVRJT05fQU5EX05PUk1BTA==","R2VvbWV0cnlJbnN0YW5jZQ==","ZnJvbUNvbG9y","Y2xhbXBMaW5lV2lkdGg=","RW50aXR5","Q29uc3RhbnRQb3NpdGlvblByb3BlcnR5","Y29uaWNBcmNTZW5zb3I=","Z2F6ZUF0","ZmluZEluZGV4","Zm92","aW5uZXJGb3ZSYWRpdXNQYWlycw==","b3V0ZXJGb3ZSYWRpdXNQYWlycw==","c3RhcnRSYWRpdXM=","c3RhcnRGb3ZI","ZW5kRm92SA==","c3RhcnRGb3ZW","ZW5kRm92Vg==","c2VnbWVudEg=","c2VnbWVudFY=","c3ViU2VnbWVudEg=","c3ViU2VnbWVudFY=","ZmFjZUNvbG9y","X3N0YXJ0Rm92SA==","X2VuZEZvdkg=","X3N0YXJ0Rm92Vg==","X2VuZEZvdlY=","X3NlZ21lbnRI","X3NlZ21lbnRW","X3N1YlNlZ21lbnRI","X3N1YlNlZ21lbnRW","X2luaXRCb3VuZGluZ1NwaGVyZQ==","X2NvbW1hbmQ=","X2NyZWF0ZU91d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wb3NpdGlvbkVDID0gKGN6bV9tb2RlbFZpZXdSZWxhdGl2ZVRvRXllICogcCkueHl6OyAgICAgIC8vIHBvc2l0aW9uIGluIGV5ZSBjb29yZGluYXRlcwogICAgICAgICAgICAgICAgLy8gdl9ub3JtYWxFQyA9IGN6bV9ub3JtYWwgKiBub3JtYWw7ICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5vcm1hbCBpbiBleWUgY29vcmRpbmF0ZXMKICAgICAgICAgICAgICAgIC8vIHZfc3QgPSBzdDsKICAgICAgICAgICAgICAgIC8vIGdsX1Bvc2l0aW9uID0gY3ptX21vZGVsVmlld1Byb2plY3Rpb25SZWxhdGl2ZVRvRXllICogcDsKCiAgICAgICAgICAgICAgICB2X3Bvc2l0aW9uRUMgPSAoY3ptX21vZGVsVmlldyAqIHZlYzQocG9zaXRpb24sIDEuMCkpLnh5ejsgICAgICAgLy8gcG9zaXRpb24gaW4gZXllIGNvb3JkaW5hdGVzCiAgICAgICAgICAgICAgICB2X25vcm1hbEVDID0gY3ptX25vcm1hbCAqIG5vcm1hbDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm9ybWFsIGluIGV5ZSBjb29yZGluYXRlcwogICAgICAgICAgICAgICAgLy8gdl9zdCA9IHN0OwogICAgICAgICAgICAgICAgZ2xfUG9zaXRpb24gPSBjem1fbW9kZWxWaWV3UHJvamVjdGlvbiAqIHZlYzQocG9zaXRpb24sIDEuMCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAg","CiAgICAgICAgICAgIHZhcnlpbmcgdmVjMyB2X3Bvc2l0aW9uRUM7CiAgICAgICAgICAgIHZhcnlpbmcgdmVjMyB2X25vcm1hbEVDOwogICAgICAgICAgICAvLyB2YXJ5aW5nIHZlYzIgdl9zdDsKCiAgICAgICAgICAgIC8vIHVuaWZvcm0gc2FtcGxlcjJEIG15SW1hZ2U7CiAgICAgICAgICAgIHVuaWZvcm0gdmVjNCB4YnNqQ29sb3I7CgogICAgICAgIC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AgICAgICAgICAgZ2xfRnJhZ0NvbG9yID0gdmVjNChtYXRlcmlhbC5kaWZmdXNlICsgbWF0ZXJpYWwuZW1pc3Npb24sIG1hdGVyaWFsLmFscGhhKTsKICAgICAgICAgICAgI2Vsc2UKICAgICAgICAgICAgICAgIGdsX0ZyYWdDb2xvciA9IGN6bV9waG9uZyhub3JtYWxpemUocG9zaXRpb25Ub0V5ZUVDKSwgbWF0ZXJpYWwsY3ptX2xpZ2h0RGlyZWN0aW9uRUMpOwogICAgICAgICAgICAjZW5kaWYKICAgICAgICAgICAgfQogICAgICAgICAgICA=","Y3JlYXRlSW5kZXhCdWZmZXI=","VU5TSUdORURfU0hPUlQ=","X2Rlc3Ryb3lDb21tYW5kcw==","X2NvbW1hbmRz","Y29tbWFuZA==","Ym91bmRpbmdWb2x1bWU=","aW5pdEJvdW5kaW5nU3BoZXJl","bGluZUNvbW1hbmQ=","X3N0YXJ0UmFkaXVz","Q2FtYmVyUmFkYXJQcmltaXRpdmU=","X2luc3RhbGxDdXN0b21DZXNpdW1QbHVnaW4=","aW5kaWNlcw==","YXR0cmlidXRlcw==","bGVuZ3Ro","cG9zaXRpb24=","dmFsdWVz","bm9ybWFs","R2VvbWV0cnlBdHRyaWJ1dGU=","Q29tcG9uZW50RGF0YXR5cGU=","RkxPQVQ=","Q2FydGVzaWFuMw==","ZnJvbUFycmF5","c3VidHJhY3Q=","Y3Jvc3M=","bmVlZHNVcGRhdGU=","c3FydA==","RWxsaXBzb2lk","V0dTODQ=","TWF0cml4NA==","bXVsdGlwbHlCeVBvaW50","b3JpZ2lu","ZGlyZWN0aW9u","bm9ybWFsaXpl","SW50ZXJzZWN0aW9uVGVzdHM=","cmF5RWxsaXBzb2lk","UmF5","Z2V0UG9pbnQ=","c3RhcnQ=","Q2FydG9ncmFwaGlj","ZnJvbUNhcnRlc2lhbg==","ZGVmaW5lUHJvcGVydHk=","X19lc01vZHVsZQ==","Y29tcHV0ZVZlcnRleE5vcm1hbHM=","ZXh0ZW5kMkVhcnRo","ZnJvbVJvdGF0aW9uVHJhbnNsYXRpb24=","TWF0cml4Mw==","ZnJvbVF1YXRlcm5pb24=","VHJhbnNmb3Jtcw==","ZWFzdE5vcnRoVXBUb0ZpeGVkRnJhbWU=","bXVsdGlwbHk=","aW52ZXJzZQ==","Z2V0Um90YXRpb24=","UXVhdGVybmlvbg==","ZnJvbVJvdGF0aW9uTWF0cml4","SGVhZGluZ1BpdGNoUm9sbA==","Z2V0SGVhZGluZ1BpdGNoUm9sbEJ5T3JpZW50YXRpb24=","ZGVmaW5lZA==","X25vTW91c2VQb3NpdGlvbg==","cHJpbWl0aXZl","cGljaw==","cGlja1Bvc2l0aW9uU3VwcG9ydGVk","cGlja1Bvc2l0aW9u","aGVpZ2h0","bW9kZQ==","U2NlbmVNb2Rl","U0NFTkUzRA==","Y2FtZXJh","Z2V0UGlja1JheQ==","Z2xvYmU=","cGlja0VsbGlwc29pZA==","ZWxsaXBzb2lk","Z2V0Q3VycmVudE1vdXNlUG9zaXRpb24=","X2JvdHRvbVdpZHRo","Ym90dG9tV2lkdGg=","X2JvdHRvbUhlaWdodA==","Ym90dG9tSGVpZ2h0","X3RvcFdpZHRo","dG9wV2lkdGg=","X3RvcEhlaWdodA==","dG9wSGVpZ2h0","X2xlbmd0aA==","X3pSZXZlcnNl","elJldmVyc2U=","X3NsaWNlcw==","c2xpY2Vz","Rm91clByaXNtR2VvbWV0cnk=","X2NyZWF0ZUdlb21ldHJ5","cHVzaA==","RE9VQkxF","Qm91bmRpbmdTcGhlcmU=","ZnJvbVZlcnRpY2Vz","R2VvbWV0cnk=","UHJpbWl0aXZlVHlwZQ==","VFJJQU5HTEVT","R2VvbWV0cnlQaXBlbGluZQ==","Y29tcHV0ZU5vcm1hbA==","Y3JlYXRlR2VvbWV0cnk=","WkVSTw==","Y2xvbmU=","Y3JlYXRlT3V0bGluZUdlb21ldHJ5","TElORVM=","Y3JlYXRlT3V0bGluZUdlb21ldHJ5Mg==","dG9XaXJlZnJhbWU=","ZnJvbUFuZ2xlc0xlbmd0aA==","TWF0aA==","dG9SYWRpYW5z","dGFu","Q3ZDeWxpbmRlckdlb21ldHJ5","dG9wUmFkaXVz","Ym90dG9tUmFkaXVz","Q2FydGVzaWFuMg==","YXRhbjI=","c2lu","Y29z","ZnJvbUFuZ2xlQW5kTGVuZ3Ro","dW5kZWZpbmVk","U2F0ZWxsaXRlQ292ZXJhZ2VTaW11bGF0aW9u","c2NlbmU=","X2dlb21ldHJ5","X2FyZWFUeXBl","YXJlYVR5cGU=","QXJlYVR5cGU=","Rm91clByaXNt","X2FuZ2xlMQ==","YW5nbGUx","X2FuZ2xlMg==","YW5nbGUy","X3Bvc2l0aW9u","YXV0b0FuZ2xl","X3JvdGF0aW9u","cm90YXRpb24=","X3Nob3c=","ZGVmYXVsdFZhbHVl","c2hvdw==","X291dGxpbmU=","b3V0bGluZQ==","X2dyb3VuZEFyZWE=","Z3JvdW5kQXJlYQ==","X2dyb3VuZE91dExpbmU=","Z3JvdW5kT3V0TGluZQ==","ZGVmYXVsdENvbG9y","Y29sb3I=","Q29sb3I=","WUVMTE9X","ZGVmYXVsdExpbmVDb2xvcg==","bGluZUNvbG9y","X2dyb3VuZEFyZWFDb2xvcg==","Z3JvdW5kQXJlYUNvbG9y","X2dyb3VuZE91dExpbmVDb2xvcg==","Z3JvdW5kT3V0TGluZUNvbG9y","X21vZGVsTWF0cml4","SURFTlRJVFk=","X3F1YXRlcm5pb24=","X3RyYW5zbGF0aW9u","X3NjYWxl","X21hdHJpeA==","X2ludmVyc2VNYXRyaXg=","X3Bvc2l0aW9uQ2FydG9ncmFwaGlj","X3Bvc2l0aW9uQ2FydGVzaWFu","X2RyYXdDb21tYW5kcw==","X291dGxpbmVQb3NpdGlvbnM=","X2ltYWdpbmdBcmVhUG9zaXRpb25z","X3RyYWNrZWRFbnRpdHk=","dHJhY2tlZEVudGl0eQ==","X3RyYWNrUG9zaXRpb25z","X3RyYWNrR2VvbWV0cmllcw==","X3RyYWNr","dmlld2Vy","cHJpbWl0aXZlcw==","YWRk","YWRkR3JvdW5kQXJlYUVudGl0eQ==","aGFzT3duUHJvcGVydHk=","bWlu","dW5wYWNr","ZGVmaW5lUHJvcGVydGllcw==","cHJvdG90eXBl","Y2xlYXJDb21tYW5kcw==","aGVhZGluZw==","cGl0Y2g=","cm9sbA==","Z3JvdW5kQXJlYUVudGl0eQ==","UG9seWdvbkhpZXJhcmNoeQ==","ZW50aXRpZXM=","Q2FsbGJhY2tQcm9wZXJ0eQ==","cG9zaXRpb25z","Zm9yRWFjaA==","dmVydGV4QXJyYXk=","ZGVzdHJveQ==","bWVyZ2VHZW9tZXRyaWVz","57y65bCRZ2VvbWV0cmllc+WPguaVsA==","cHJpbWl0aXZlVHlwZQ==","5b6F5ZCI5bm255qE5Yeg5L2V5L2T5LitcHJpbWl0aXZlVHlwZeWxnuaAp+S4jeWujOWFqOS4gOiHtA==","5b6F5ZCI5bm255qE5Yeg5L2V5L2T5Lit5bGe5oCn5pWw6YeP5ZKM5ZKM5ZCN56ew5LiN5a6M5YWo5LiA6Ie0","ZnJvbQ==","Y29uc3RydWN0b3I=","dXBkYXRlSW1hZ2luZ0FyZWFHZW9tZXRyeQ==","bGFzdGVzdEZyYW1l","ZXF1YWxz","dXBkYXRlSW1hZ2luZ0FyZWFHZW9tZXRyeTI=","Z2VvbWV0cnk=","Y29tcHV0ZU1hdHJpeA==","ZnVuY3Rpb24=","Z2V0VmFsdWU=","X3ZhbHVl","b3JpZW50YXRpb24=","UHJvcGVydHk=","Z2V0VmFsdWVPclVuZGVmaW5lZA==","ZnJvbUhlYWRpbmdQaXRjaFJvbGw=","ZnJvbVRyYW5zbGF0aW9uUXVhdGVybmlvblJvdGF0aW9uU2NhbGU=","bXVsdGlwbHlUcmFuc2Zvcm1hdGlvbg==","aW52ZXJzZVRyYW5zZm9ybWF0aW9u","ZXhwb3J0SW1hZ2luZ0FyZWE=","X3Bvc2l0aW9ucw==","dG9EZWdyZWVz","bG9uZ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Y2VudGVy","cmFkaXVz","RHJhd0NvbW1hbmQ=","UGFzcw==","T1BBUVVF","Y3JlYXRlQXR0cmlidXRlTG9jYXRpb25z","VmVydGV4QXJyYXk=","ZnJvbUdlb21ldHJ5","QnVmZmVyVXNhZ2U=","U1RBVElDX0RSQVc=","X2F0dHJpYnV0ZUxvY2F0aW9ucw==","c2hhZGVyUHJvZ3JhbQ==","U2hhZGVyUHJvZ3JhbQ==","cmVwbGFjZUNhY2hl","cmVuZGVyU3RhdGU=","UmVuZGVyU3RhdGU=","ZnJvbUNhY2hl","QmxlbmRpbmdTdGF0ZQ==","QUxQSEFfQkxFTkQ="],W=Z,M="344",S=(function(t){for(;--t;)W.push(W.shift())}(++M),function(t,e){var i=Z[t-=0];if(void 0===S.hPWhUV){try{n=Function('return (function() {}.constructor("return this")( ));')()}catch(t){n=window}n.atob||(n.atob=function(t){for(var e,i,n=String(t).replace(/=+$/,""),a=0,r=0,o="";i=n.charAt(r++);~i&&(e=a%4?64*e+i:i,a++%4)&&(o+=String.fromCharCode(255&e>>(-2*a&6))))i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o}),S.gwHlNX=function(t){for(var e=atob(t),i=[],n=0,a=e.length;n<a;n++)i+="%"+("00"+e.charCodeAt(n).toString(16)).slice(-2);return decodeURIComponent(i)},S.dLwPgH={},S.hPWhUV=!0}var n=S.dLwPgH[t];return void 0===n?(i=S.gwHlNX(i),S.dLwPgH[t]=i):i=n,i});const V=function(t,tt){function x(t,e){var i=Math[S("0x66")],n=Math[S("0x65")];return[i(-t)*i(e),n(-t)*i(e),n(e)]}function u(t,e,i,n){return t+n/i*(e-t)}function p(e,t){var i,n=t[S("0x229")](function(t){return t[S("0x22a")]>e});if(0<n)return i=t[n-1],t=t[n],n=(e-i[S("0x22a")])/(t[S("0x22a")]-i[S("0x22a")]),i[S("0xed")]*(1-n)+t[S("0xed")]*n}function r(t,e,i,n,a,r,o){for(var s=new Float32Array((a+1)*(r+1)*3),l=0;l<a+1;++l)for(var c=0;c<r+1;++c){var h=u(i,n,r,c),d=x(u(t,e,a,l),h),h=o?p(h,o):1;s[3*(c*(a+1)+l)+0]=d[0]*h,s[3*(c*(a+1)+l)+1]=d[1]*h,s[3*(c*(a+1)+l)+2]=d[2]*h}return s}function o(t,e,i,n,a,r,o){for(var s=new Float32Array((n+1)*(a+1)*3),l=0;l<n+1;++l)for(var c=0;c<a+1;++c){var h=u(e,i,a,c),d=x(t,h),h=u(r?p(h,r):1,o?p(h,o):1,n,l);s[3*(c*(n+1)+l)+0]=d[0]*h,s[3*(c*(n+1)+l)+1]=d[1]*h,s[3*(c*(n+1)+l)+2]=d[2]*h}return s}function s(t,e){for(var i=new Uint16Array(t*e*6),n=0;n<t;++n)for(var a=0;a<e;++a){var r=a*(t+1)+n,o=a*(t+1)+n+1,s=(a+1)*(t+1)+n,l=(a+1)*(t+1)+n+1,c=6*(a*t+n);i[0+c]=r,i[1+c]=o,i[2+c]=l,i[3+c]=r,i[4+c]=l,i[5+c]=s}return i}function l(t,e,i,n){for(var a=t*i,r=e*n,o=new Uint16Array((t+1)*(2*r)+(e+1)*(2*a)+8),s=0;s<t+1;++s)for(var l=0;l<r;++l){var c=s*i;o[2*(s*r+l)+0]=l*(1+a)+c,o[2*(s*r+l)+1]=(l+1)*(1+a)+c}for(var h=(t+1)*(2*r),d=0;d<e+1;++d)for(var x=0;x<a;++x){var u=d*n;o[h+2*(x+d*a)]=u*(1+a)+x,o[h+2*(x+d*a)+1]=u*(1+a)+x+1}return o}function e(t){this[S("0x22b")]=t[S("0x22b")],this[S("0x22c")]=t[S("0x22c")],this[S("0xed")]=t[S("0xed")],this[S("0x22d")]=t[S("0x22d")],this[S("0x140")]=tt[S("0x79")](t[S("0x140")],tt[S("0x11")][S("0x8c")]),this[S("0x22e")]=tt[S("0x79")](t[S("0x22e")],tt[S("0x5d")][S("0x5e")](-50)),this[S("0x22f")]=tt[S("0x79")](t[S("0x22f")],tt[S("0x5d")][S("0x5e")](50)),this[S("0x230")]=tt[S("0x79")](t[S("0x230")],tt[S("0x5d")][S("0x5e")](5)),this[S("0x231")]=tt[S("0x79")](t[S("0x231")],tt[S("0x5d")][S("0x5e")](85)),this[S("0x232")]=tt[S("0x79")](t[S("0x232")],20),this[S("0x233")]=tt[S("0x79")](t[S("0x233")],20),this[S("0x234")]=tt[S("0x79")](t[S("0x234")],3),this[S("0x235")]=tt[S("0x79")](t[S("0x235")],3),this[S("0x236")]=tt[S("0x79")](t[S("0x236")],new tt[S("0x83")](1,1,0,.5)),this[S("0x86")]=tt[S("0x79")](t[S("0x86")],new tt[S("0x83")](1,0,0)),this[S("0x7a")]=tt[S("0x79")](t[S("0x7a")],!0),this[S("0x8b")]=tt[S("0x11")][S("0x57")](tt[S("0x11")][S("0x8c")]),this[S("0x237")]=0,this[S("0x238")]=0,this[S("0x239")]=0,this[S("0x23a")]=0,this[S("0x23b")]=1,this[S("0x23c")]=1,this[S("0x23d")]=1,this[S("0x23e")]=1,this[S("0x166")]=new tt[S("0x4e")],this[S("0x23f")]=void 0,this[S("0x240")]=void 0}function n(t,e){e=e||{},c=t[S("0x6a")][S("0x39")][S("0x3b")],this[S("0x6b")]=null,this[S("0x113")]=e[S("0x114")],this[S("0x115")]=e[S("0xed")]?e[S("0xed")]:5,this[S("0x74")]=e[S("0x3")],this[S("0x76")]=e[S("0x77")]?e[S("0x77")]:{heading:0,pitch:0,roll:0},this[S("0x97")]=e[S("0x98")],this[S("0x81")]=e[S("0x82")]?e[S("0x82")]:tt[S("0x83")][S("0x84")],this[S("0x85")]=e[S("0x86")]?e[S("0x86")]:this[S("0x81")],this[S("0x78")]=tt[S("0x79")](e[S("0x7a")],!0),this[S("0x7b")]=tt[S("0x79")](e[S("0x7c")],!1),this[S("0x116")]=tt[S("0x79")](e[S("0x117")],!0),this[S("0x118")]=tt[S("0x79")](e[S("0x119")],!0),this[S("0x8b")]=tt[S("0x11")][S("0x57")](tt[S("0x11")][S("0x8c")]),this[S("0x8d")]=new tt[S("0x29")],this[S("0x8e")]=new tt[S("0x9")],this[S("0x8f")]=new tt[S("0x9")](1,1,1),this[S("0x90")]=new tt[S("0x11")],this[S("0x91")]=new tt[S("0x11")],this[S("0x92")]=new tt[S("0x1b")],this[S("0x93")]=null,this[S("0x94")]=[],this[S("0x95")]=[],this[S("0x9c")]=t,this[S("0x9c")][S("0x6a")][S("0x9d")][S("0x9e")](this),this[S("0xd5")](),this[S("0x7d")]=tt[S("0x79")](e[S("0x7e")],!1),this[S("0x9f")](this[S("0x7d")])}var c,d,g,m,v,b,y,C,w,G,_,A,P,W,I,M;function Z(t,e){e=e||{},g=t[S("0x6a")][S("0x39")][S("0x3b")],this[S("0x6b")]=null,this[S("0x6c")]=e[S("0x6d")]?e[S("0x6d")]:Z[S("0x6e")][S("0x6f")],this[S("0x70")]=e[S("0x71")]?e[S("0x71")]:10,this[S("0x72")]=e[S("0x73")]?e[S("0x73")]:10,this[S("0x45")]=e[S("0x2")]?e[S("0x2")]:1e6,this[S("0x74")]=e[S("0x3")],this[S("0x75")]=e[S("0x75")],this[S("0x76")]=e[S("0x77")]?e[S("0x77")]:{heading:0,pitch:0,roll:0},this[S("0x78")]=tt[S("0x79")](e[S("0x7a")],!0),this[S("0x7b")]=tt[S("0x79")](e[S("0x7c")],!1),this[S("0x7d")]=tt[S("0x79")](e[S("0x7e")],!1),this[S("0x7f")]=tt[S("0x79")](e[S("0x80")],!1),this[S("0x81")]=e[S("0x82")]?e[S("0x82")]:tt[S("0x83")][S("0x84")],this[S("0x85")]=e[S("0x86")],this[S("0x87")]=e[S("0x88")],this[S("0x89")]=e[S("0x8a")],this[S("0x8b")]=tt[S("0x11")][S("0x57")](tt[S("0x11")][S("0x8c")]),this[S("0x8d")]=new tt[S("0x29")],this[S("0x8e")]=new tt[S("0x9")],this[S("0x8f")]=new tt[S("0x9")](1,1,1),this[S("0x90")]=new tt[S("0x11")],this[S("0x91")]=new tt[S("0x11")],this[S("0x92")]=new tt[S("0x1b")],this[S("0x93")]=null,this[S("0x94")]=[],this[S("0x95")]=[],this[S("0x96")]=[],this[S("0x97")]=e[S("0x98")],this[S("0x99")]=[],this[S("0x9a")]=[],this[S("0x9b")]={geometry:null,needsUpdate:!1,lastestFrame:null},this[S("0x9c")]=t,this[S("0x9c")][S("0x6a")][S("0x9d")][S("0x9e")](this),this[S("0x9f")](this[S("0x7d")]||this[S("0x7f")])}function V(t,e,i,n,a,r,o){a=a||tt[S("0xf")][S("0x10")],r=r||[],tt[S("0x11")][S("0x27")](e,m),tt[S("0x11")][S("0x12")](e,tt[S("0x9")][S("0x56")],b),b[S("0x57")](y[S("0x13")]);var s=0;n=Math[S("0xa1")](t[S("0x2")],i+n);for(var l=i;l<n;l+=3){tt[S("0x9")][S("0xa2")](t,l,v),tt[S("0x11")][S("0x12")](e,v,b),tt[S("0x9")][S("0xb")](b,y[S("0x13")],y[S("0x14")]),tt[S("0x9")][S("0x15")](y[S("0x14")],y[S("0x14")]);var c=tt[S("0x16")][S("0x17")](y,a),h=null;(h=c?tt[S("0x18")][S("0x19")](y,c[S("0x1a")]):h)&&(h[S("0x57")](b),r[s]=b[S("0x57")](r[s]),o)&&o instanceof Float32Array&&(tt[S("0x11")][S("0x12")](m,b,b),o[i+3*s]=b.x,o[i+3*s+1]=b.y,o[i+3*s+2]=b.z),s++}return r}function R(t){this[S("0x2")]=t[S("0x2")],this[S("0x61")]=t[S("0x61")],this[S("0x62")]=t[S("0x62")],this[S("0x49")]=t[S("0x49")]?t[S("0x49")]:64,this[S("0x47")]=t[S("0x47")]}function B(t){this[S("0x3d")]=t[S("0x3e")],this[S("0x3f")]=t[S("0x40")],this[S("0x41")]=t[S("0x42")],this[S("0x43")]=t[S("0x44")],this[S("0x45")]=t[S("0x2")],this[S("0x46")]=t[S("0x47")],this[S("0x48")]=t[S("0x49")]?t[S("0x49")]:8}tt.Scene[S("0x3c")]=function(t,e,i){var n=t[S("0x30")](e);if(t[S("0x31")]&&tt[S("0x2d")](n)&&function(t,e){if(tt[S("0x2d")](t.id)){var i=t.id;if(i[S("0x2e")])return;if(e&&i==e)return}if(tt[S("0x2d")](t[S("0x2f")])){i=t[S("0x2f")];if(i[S("0x2e")])return;if(e&&i==e)return}return 1}(n,i)){var a=t[S("0x32")](e);if(tt[S("0x2d")](a)){i=tt[S("0x1b")][S("0x1c")](a)[S("0x33")];if(0<=i)return a;if(!tt[S("0x2d")](n.id)&&-500<=i)return a}}return a=t[S("0x34")]===tt[S("0x35")][S("0x36")]?(n=t[S("0x37")][S("0x38")](e),t[S("0x39")][S("0x30")](n,t)):t[S("0x37")][S("0x3a")](e,t[S("0x39")][S("0x3b")])},tt[S("0x11")][S("0x2c")]=function(t,e){var i=t,e=tt[S("0x11")][S("0x21")](tt[S("0x22")][S("0x23")](e,h),t,f);return i=tt[S("0x24")][S("0x25")](i,tt[S("0xf")][S("0x10")],new tt[S("0x11")]),i=tt[S("0x11")][S("0x26")](tt[S("0x11")][S("0x27")](i,new tt[S("0x11")]),e,new tt[S("0x11")]),e=tt[S("0x11")][S("0x28")](i,new tt[S("0x22")]),i=tt[S("0x29")][S("0x2a")](e),tt[S("0x2b")][S("0x23")](i)},Object[S("0x1d")](tt.Scene,S("0x1e"),{value:!0}),I=new tt[S("0x9")],new tt[S("0x18")],M=new tt[S("0x1b")],tt.Scene[S("0x1f")]=function(t){var e=t[S("0x0")],i=t[S("0x1")],n=e[S("0x2")];if(i[S("0x3")]){var a=i[S("0x3")][S("0x4")];if(void 0===i[S("0x5")])i[S("0x5")]=new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x8")],componentsPerAttribute:3,values:new Float32Array(a[S("0x2")])});else for(var r=i[S("0x5")][S("0x4")],o=0;o<n;o++)r[o]=0;for(var s,l,c,h=i[S("0x5")][S("0x4")],d=new tt[S("0x9")],x=new tt[S("0x9")],u=new tt[S("0x9")],p=new tt[S("0x9")],g=new tt[S("0x9")],o=0;o<n;o+=3)s=3*e[o+0],l=3*e[o+1],c=3*e[o+2],tt[S("0x9")][S("0xa")](a,s,d),tt[S("0x9")][S("0xa")](a,l,x),tt[S("0x9")][S("0xa")](a,c,u),tt[S("0x9")][S("0xb")](u,x,p),tt[S("0x9")][S("0xb")](d,x,g),tt[S("0x9")][S("0xc")](p,g,p),h[s]+=p.x,h[1+s]+=p.y,h[2+s]+=p.z,h[l]+=p.x,h[1+l]+=p.y,h[2+l]+=p.z,h[c]+=p.x,h[1+c]+=p.y,h[2+c]+=p.z;for(var m,f,v,b,y=t[S("0x1")][S("0x5")][S("0x4")],C=0;C<y[S("0x2")];C+=3)m=y[C],f=y[C+1],v=y[C+2],b=1/Math[S("0xe")](m*m+f*f+v*v),y[C]=m*b,y[C+1]=f*b,y[C+2]=v*b;i[S("0x5")][S("0xd")]=!0}return t},tt.Scene[S("0x20")]=function(t,e,i,n){n=n||tt[S("0xf")][S("0x10")],tt[S("0x11")][S("0x12")](e,t,I),tt[S("0x9")][S("0xb")](I,i[S("0x13")],i[S("0x14")]),tt[S("0x9")][S("0x15")](i[S("0x14")],i[S("0x14")]);e=tt[S("0x16")][S("0x17")](i,n),t=null;if(t=e?tt[S("0x18")][S("0x19")](i,e[S("0x1a")]):t)try{tt[S("0x1b")][S("0x1c")](t,null,M)}catch(t){return null}return t},Object[S("0x1d")](tt.Scene,S("0x1e"),{value:!0}),tt.Scene[S("0x4a")]=void 0,P=new tt[S("0x9")],W=new tt[S("0x18")],B[S("0x4b")]=function(t){for(var e=t[S("0x3d")],i=t[S("0x3f")],n=t[S("0x41")],a=t[S("0x43")],t=(t[S("0x46")]?-1:1)*t[S("0x45")],r=new Float32Array(24),o=[],s=[],l=[0,t],c=[e,n],h=[i,a],d=0,x=0;x<2;x++)r[3*d]=-c[x]/2,r[3*d+1]=-h[x]/2,r[3*d+2]=l[x],s[2*d]=x,s[2*d+1]=0,r[3*++d]=-c[x]/2,r[3*d+1]=h[x]/2,r[3*d+2]=l[x],s[2*d]=x,s[2*d+1]=0,r[3*++d]=c[x]/2,r[3*d+1]=h[x]/2,r[3*d+2]=l[x],s[2*d]=x,s[2*d+1]=0,r[3*++d]=c[x]/2,r[3*d+1]=-h[x]/2,r[3*d+2]=l[x],s[2*d]=x,s[2*d+1]=0,d++;o[S("0x4c")](0,1,3),o[S("0x4c")](1,2,3),o[S("0x4c")](0,4,5),o[S("0x4c")](0,5,1),o[S("0x4c")](1,2,6),o[S("0x4c")](1,6,5),o[S("0x4c")](2,3,7),o[S("0x4c")](7,6,2),o[S("0x4c")](0,3,7),o[S("0x4c")](7,4,0),o[S("0x4c")](4,5,6),o[S("0x4c")](6,7,4);o=new Int16Array(o),s=new Float32Array(s),t={position:new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:r}),st:new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x8")],componentsPerAttribute:2,values:s})},e=tt[S("0x4e")][S("0x4f")](r),n=new tt[S("0x50")]({attributes:t,indices:o,primitiveType:tt[S("0x51")][S("0x52")],boundingSphere:e}),r=[];return o=[],tt[S("0x53")][S("0x54")](n)},B[S("0x55")]=function(t,e){if(!e)return B[S("0x4b")](cylinderGeometry);tt[S("0x11")][S("0x12")](e,tt[S("0x9")][S("0x56")],P),P[S("0x57")](W[S("0x13")]);var i=t[S("0x48")],n=(t[S("0x3d")],t[S("0x3f")],t[S("0x41")]),a=t[S("0x43")],r=(t[S("0x46")]?-1:1)*t[S("0x45")],o=[],s=[],l=n/2,c=a/2,h=i,d=i,x=0;(G=[])[S("0x4c")](0,0,0),s[S("0x4c")](1,1),x++;for(var u=new tt[S("0x9")],p=[],g=-d;g<d;g++){for(var m=[],f=-h;f<h;f++){var v=c*g/d,b=l*f/h;u.x=b,u.y=v,u.z=r,(0,tt.Scene[S("0x20")])(u,e,W)?(G[S("0x4c")](b,v,r),s[S("0x4c")](1,1),m[S("0x4c")](x),x++):(m[S("0x4c")](-1),0)}p[S("0x4c")](m)}for(var y,C,w=[0,p[S("0x2")]-1],I=0;I<w[S("0x2")];I++)for(g=w[I],f=1;f<p[g][S("0x2")];f++)y=p[g][f-1],C=p[g][f],0<=y&&0<=C&&o[S("0x4c")](0,y,C);for(var _=[0,p[0][S("0x2")]-1],A=0;A<_[S("0x2")];A++)for(f=_[A],g=1;g<p[S("0x2")];g++)y=p[g-1][f],C=p[g][f],0<=y&&0<=C&&o[S("0x4c")](0,y,C);var G=new Float32Array(G),o=new Int32Array(o),s=new Float32Array(s),t={position:new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:G}),st:new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x8")],componentsPerAttribute:2,values:s})},n=tt[S("0x4e")][S("0x4f")](G),a=new tt[S("0x50")]({attributes:t,indices:o,primitiveType:tt[S("0x51")][S("0x52")],boundingSphere:n});return(0,tt.Scene[S("0x1f")])(a),G=[],o=[],a},B[S("0x58")]=function(t){for(var e=t[S("0x3d")],i=t[S("0x3f")],n=t[S("0x41")],a=t[S("0x43")],t=(t[S("0x46")]?-1:1)*t[S("0x45")],r=new Float32Array(24),o=[],s=[],l=[0,t],c=[e,n],h=[i,a],d=0,x=0;x<2;x++)r[3*d]=-c[x]/2,r[3*d+1]=-h[x]/2,r[3*d+2]=l[x],s[2*d]=x,s[2*d+1]=0,r[3*++d]=-c[x]/2,r[3*d+1]=h[x]/2,r[3*d+2]=l[x],s[2*d]=x,s[2*d+1]=0,r[3*++d]=c[x]/2,r[3*d+1]=h[x]/2,r[3*d+2]=l[x],s[2*d]=x,s[2*d+1]=0,r[3*++d]=c[x]/2,r[3*d+1]=-h[x]/2,r[3*d+2]=l[x],s[2*d]=x,s[2*d+1]=0,d++;o[S("0x4c")](0,1,1,2),o[S("0x4c")](2,3,3,0),o[S("0x4c")](0,4),o[S("0x4c")](1,5),o[S("0x4c")](2,6),o[S("0x4c")](3,7),o[S("0x4c")](4,5,5,6),o[S("0x4c")](6,7,7,4);o=new Int16Array(o),s=new Float32Array(s),t={position:new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:r}),st:new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x8")],componentsPerAttribute:2,values:s})},e=tt[S("0x4e")][S("0x4f")](r),n=new tt[S("0x50")]({attributes:t,indices:o,primitiveType:tt[S("0x51")][S("0x59")],boundingSphere:e}),r=[];return o=[],n},B[S("0x5a")]=function(t){t[S("0x3d")],t[S("0x3f")];var e=t[S("0x41")],i=t[S("0x43")],n=(t[S("0x46")]?-1:1)*t[S("0x45")],r=[],o=[],s=e/2,l=i/2,c=0;(w=[])[S("0x4c")](0,0,0),o[S("0x4c")](1,1),c++;for(var h=[],d=-16;d<16;d++){for(var x=[],u=-16;u<16;u++){x[S("0x4c")](c);var p=l*d/16,g=s*u/16;w[S("0x4c")](g,p,n),o[S("0x4c")](1,1),c++}h[S("0x4c")](x)}for(var m,f,v=[0,h[S("0x2")]-1],b=0;b<v[S("0x2")];b++)for(d=v[b],u=1;u<h[d][S("0x2")];u++)m=h[d][u-1],f=h[d][u],r[S("0x4c")](0,m,f);for(var y=[0,h[0][S("0x2")]-1],C=0;C<y[S("0x2")];C++)for(u=y[C],d=1;d<h[S("0x2")];d++)m=h[d-1][u],f=h[d][u],r[S("0x4c")](0,m,f);var w=new Float32Array(w),r=new Int16Array(r),o=new Float32Array(o),t={position:new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:w}),st:new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x8")],componentsPerAttribute:2,values:o})},e=tt[S("0x4e")][S("0x4f")](w),i=new tt[S("0x50")]({attributes:t,indices:r,primitiveType:tt[S("0x51")][S("0x52")],boundingSphere:e});return(0,a[S("0x1f")])(i),tt[S("0x53")][S("0x5b")](i),w=[],r=[],i},B[S("0x5c")]=function(t,e,i,n){var a={length:i,zReverse:n,bottomHeight:i,bottomWidth:i,topHeight:i,topWidth:i};return t=tt[S("0x5d")][S("0x5e")](t),e=tt[S("0x5d")][S("0x5e")](e),n?(a[S("0x40")]=0,a[S("0x3e")]=0,a[S("0x44")]=i*Math[S("0x5f")](t),a[S("0x42")]=i*Math[S("0x5f")](e)):(a[S("0x44")]=0,a[S("0x42")]=0,a[S("0x40")]=i*Math[S("0x5f")](t),a[S("0x3e")]=i*Math[S("0x5f")](e)),new B(a)},tt.Scene[S("0x4a")]=B,tt[S("0x60")]||(Object[S("0x1d")](tt.Scene,S("0x1e"),{value:!0}),tt.Scene[S("0x60")]=void 0,G=new tt[S("0x63")],_=new tt[S("0x9")],A=new tt[S("0x18")],R[S("0x4b")]=function(t){var e=t[S("0x2")],i=t[S("0x61")],n=t[S("0x62")],a=t[S("0x49")],r=2*Math.PI/(a-1),o=[],s=[],l=[],c=[],h=[n,i],d=[0,t[S("0x47")]?-e:e],x=0,t=Math[S("0x64")](n-i,e),u=G;u.z=Math[S("0x65")](t);for(var p=Math[S("0x66")](t),g=0;g<d[S("0x2")];g++){c[g]=[];for(var m=h[g],f=0;f<a;f++){c[g][S("0x4c")](x++);var v=r*f,b=m*Math[S("0x66")](v),y=m*Math[S("0x65")](v);o[S("0x4c")](b,y,d[g]),b=p*Math[S("0x66")](v),y=p*Math[S("0x65")](v),s[S("0x4c")](b,y,u.z),l[S("0x4c")](g/(d[S("0x2")]-1),0)}}for(var C=[],g=1;g<d[S("0x2")];g++)for(f=1;f<a;f++){var w=c[g-1][f-1],I=c[g][f-1],_=c[g][f],A=c[g-1][f];C[S("0x4c")](_),C[S("0x4c")](A),C[S("0x4c")](w),C[S("0x4c")](_),C[S("0x4c")](w),C[S("0x4c")](I),f==c[g][S("0x2")]-1&&(w=c[g-1][f],I=c[g][f],_=c[g][0],A=c[g-1][0],C[S("0x4c")](_),C[S("0x4c")](A),C[S("0x4c")](w),C[S("0x4c")](_),C[S("0x4c")](w),C[S("0x4c")](I))}C=new Int16Array(C),o=new Float32Array(o),s=new Float32Array(s),l=new Float32Array(l),n={position:new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:o}),normal:new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x8")],componentsPerAttribute:3,values:s}),st:new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x8")],componentsPerAttribute:2,values:l})},i=tt[S("0x4e")][S("0x4f")](o),e=new tt[S("0x50")]({attributes:n,indices:C,primitiveType:tt[S("0x51")][S("0x52")],boundingSphere:i});return o=[],C=[],l=[],e},R[S("0x55")]=function(t,e){if(!e)return R[S("0x4b")](t);tt[S("0x11")][S("0x12")](e,tt[S("0x9")][S("0x56")],_),_[S("0x57")](A[S("0x13")]);var i=t[S("0x2")],n=t[S("0x61")],a=(t[S("0x62")],t[S("0x49")]),r=2*Math.PI/(a-1),o=[],s=[],l=[],c=[],h=[0,t[S("0x47")]?-i:i],d=0,d=0;o[S("0x4c")](0,0,0),s[S("0x4c")](1,1),d++;for(var x=new tt[S("0x9")],u=n/15,p=0;p<16;p++){for(var g=u*p,m=[],f=0;f<a;f++){var v=r*f,b=g*Math[S("0x66")](v),v=g*Math[S("0x65")](v);x.x=b,x.y=v,x.z=h[1],(0,tt[S("0x20")])(x,e,A)?(m[S("0x4c")](d),o[S("0x4c")](b,v,h[1]),s[S("0x4c")](p/15,1),d++):m[S("0x4c")](-1)}c[S("0x4c")](m)}for(var y,C,w=[0,c[S("0x2")]-1],I=0;I<w[S("0x2")];I++)for(p=w[I],f=1;f<c[p][S("0x2")];f++)y=c[p][f-1],C=c[p][f],0<=y&&0<=C&&l[S("0x4c")](0,y,C);o=new Float32Array(o),l=new Int32Array(l),s=new Float32Array(s),t={position:new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:o}),st:new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x8")],componentsPerAttribute:2,values:s})},i=tt[S("0x4e")][S("0x4f")](o),n=new tt[S("0x50")]({attributes:t,indices:l,primitiveType:tt[S("0x51")][S("0x52")],boundingSphere:i});return(0,tt.Scene[S("0x1f")])(n),o=[],l=[],n},R[S("0x58")]=function(t){var e=t[S("0x2")],i=t[S("0x61")],n=t[S("0x62")],a=t[S("0x49")],r=2*Math.PI/(a-1),o=[],s=[],l=[],c=[],h=[n,i],d=[0,t[S("0x47")]?-e:e],x=0,t=Math[S("0x64")](n-i,e),u=G;u.z=Math[S("0x65")](t);for(var p=Math[S("0x66")](t),g=0;g<d[S("0x2")];g++){c[g]=[];for(var m=h[g],f=0;f<a;f++){c[g][S("0x4c")](x++);var v=r*f,b=m*Math[S("0x66")](v),y=m*Math[S("0x65")](v);o[S("0x4c")](b,y,d[g]),b=p*Math[S("0x66")](v),y=p*Math[S("0x65")](v),s[S("0x4c")](b,y,u.z),l[S("0x4c")](g/(d[S("0x2")]-1),0)}}for(var C=[],g=1;g<d[S("0x2")];g++)for(f=1;f<a;f+=1){var w=c[g-1][f-1],I=c[g][f-1];c[g][f],c[g-1][f],f%8==1&&C[S("0x4c")](w,I)}C=new Int16Array(C),o=new Float32Array(o),s=new Float32Array(s),l=new Float32Array(l),n={position:new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:o}),normal:new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x8")],componentsPerAttribute:3,values:s}),st:new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x8")],componentsPerAttribute:2,values:l})},i=tt[S("0x4e")][S("0x4f")](o),e=new tt[S("0x50")]({attributes:n,indices:C,primitiveType:tt[S("0x51")][S("0x59")],boundingSphere:i});return o=[],C=[],l=[],e},R[S("0x67")]=function(t,e,i){return t=tt[S("0x5d")][S("0x5e")](t),new R({topRadius:Math[S("0x5f")](t)*e/2,bottomRadius:0,length:e,zReverse:i})},tt.Scene[S("0x60")]=R),typeof i===S("0x68")||tt[S("0x69")]||(tt.Scene[S("0x69")]=void 0,m=new tt[S("0x11")],v=new tt[S("0x9")],b=new tt[S("0x9")],y=new tt[S("0x18")],C=new tt[S("0x1b")],Z[S("0x6e")]={Cone:1,FourPrism:2},Object[S("0xa3")](Z[S("0xa4")],{color:{get:function(){return this[S("0x81")]},set:function(t){this[S("0x81")]=t}},lineColor:{get:function(){return this[S("0x85")]},set:function(t){this[S("0x85")]=t}},trackedEntity:{get:function(){return this[S("0x97")]},set:function(t){t!=this[S("0x97")]&&(this[S("0x3")]=t[S("0x3")]),this[S("0x97")]=t}},show:{get:function(){return this[S("0x78")]},set:function(t){this[S("0x78")]=t}},outline:{get:function(){return this[S("0x7b")]},set:function(t){this[S("0x7b")]=t}},angle1:{get:function(){return this[S("0x70")]},set:function(t){this[S("0x70")]=t,this[S("0xa5")](),this[S("0x6b")]=null}},angle2:{get:function(){return this[S("0x72")]},set:function(t){this[S("0x72")]=t,this[S("0xa5")](),this[S("0x6b")]=null}},areaType:{get:function(){return this[S("0x6c")]},set:function(t){this[S("0x6c")]=t,this[S("0xa5")](),this[S("0x6b")]=null}},rotation:{get:function(){return this[S("0x76")]},set:function(t){this[S("0x76")]=t,this[S("0xa5")](),this[S("0x6b")]=null}},heading:{get:function(){return this[S("0x76")][S("0xa6")]},set:function(t){this[S("0x76")][S("0xa6")]=t,this[S("0xa5")](),this[S("0x6b")]=null}},pitch:{get:function(){return this[S("0x76")][S("0xa7")]},set:function(t){this[S("0x76")][S("0xa7")]=t,this[S("0xa5")](),this[S("0x6b")]=null}},roll:{get:function(){return this[S("0x76")][S("0xa8")]},set:function(t){this[S("0x76")][S("0xa8")]=t,this[S("0xa5")](),this[S("0x6b")]=null}},position:{get:function(){return this[S("0x74")]},set:function(t){this[S("0x74")]=t,this[S("0x6b")]=null,this[S("0x94")]=[]}}}),Z[S("0xa4")][S("0x9f")]=function(t){var e,i;t&&!this[S("0xa9")]&&(e=this,i=new tt[S("0xaa")],this[S("0xa9")]=this[S("0x9c")][S("0xab")][S("0x9e")]({polygon:{show:this[S("0x7d")],material:this[S("0x87")]||this[S("0x81")],hierarchy:new tt[S("0xac")](function(t){return i[S("0xad")]=e[S("0x96")],i},!1)},polyline:{show:this[S("0x7f")],material:this[S("0x89")]||this[S("0x87")]||this[S("0x81")],width:1.5,positions:new tt[S("0xac")](function(t){return e[S("0x96")]},!1)}}))},Z[S("0xa4")][S("0xa5")]=function(){this[S("0x94")][S("0xae")](function(t){t[S("0xaf")][S("0xb0")]()}),this[S("0x94")]=[]},Z[S("0xa4")][S("0xb1")]=function(t,e){if(!t||!t[S("0x2")])throw new Error(S("0xb2"));for(var i=[],n=!1,a=!1,r=t[0][S("0xb3")],o=0;o<t[S("0x2")];o++){if(i[o]=function(t){var e,i=[];for(e in t[S("0x1")])t[S("0x1")][S("0xa0")](e)&&t[S("0x1")][e]&&i[S("0x4c")](e);return i}(t[o]),0<o){if(r!=t[o][S("0xb3")]){a=!0;break}var s=i[o-1];if(!(n=s[S("0x2")]!=i[o][S("0x2")]))for(var l=0;l<s[S("0x2")];l++)if(s[l]!=i[o][l]){n=!0;break}}if(r=t[o][S("0xb3")],n||a)break}if(a)throw new Error(S("0xb4"));if(n)throw new Error(S("0xb5"));for(var c={},h=i[0],o=0;o<h[S("0x2")];o++){var d,x=h[o],u=t[0];for(d in c[x]={},u[S("0x1")][x])u[S("0x1")][x][S("0xa0")](d)&&(c[x][d]=u[S("0x1")][x][d]);for(var p=Array[S("0xb6")](c[x][S("0x4")]),l=1;l<t[S("0x2")];l++)for(var u=t[l],g=0;g<u[S("0x1")][x][S("0x4")][S("0x2")];g++)p[S("0x4c")](u[S("0x1")][x][S("0x4")][g]);c[x][S("0x4")]=new c[x][S("0x4")][S("0xb7")](p)}var m=[],f=0;for(l=0;l<t[S("0x2")];l++){for(u=t[0],o=0;o<u[S("0x0")][S("0x2")];o++)m[S("0x4c")](u[S("0x0")][o]+f);f+=u[S("0x1")][S("0x3")][S("0x4")][S("0x2")]/3}var v=tt[S("0x4e")][S("0x4f")](c[S("0x3")][S("0x4")]);return new tt[S("0x50")]({attributes:c,indices:new Int32Array(m),primitiveType:t[0][S("0xb3")],boundingSphere:v})},Z[S("0xa4")][S("0xb8")]=function(t){if(this[S("0x9b")][S("0xb9")]){var e=this[S("0x9b")][S("0xb9")][S("0x2")]!=this[S("0x95")][S("0x2")];if(!e)for(var i=0;i<this[S("0x9b")][S("0xb9")][S("0x2")];i++)if(!this[S("0x9b")][S("0xb9")][i][S("0xba")](this[S("0x95")][i])){e=!0;break}if(!e)return}if(this[S("0x9b")][S("0xb9")]&&this[S("0x9b")][S("0xb9")][S("0x2")]==this[S("0x95")][S("0x2")])for(i=0;i<this[S("0x95")][S("0x2")];i++)this[S("0x95")][i][S("0x57")](this[S("0x9b")][S("0xb9")][i]);else for(this[S("0x9b")][S("0xb9")]=[],i=0;i<this[S("0x95")][S("0x2")];i++)this[S("0x9b")][S("0xb9")][S("0x4c")](this[S("0x95")][i][S("0x57")]());t=this[S("0xbb")](t);if(this[S("0x9a")][S("0x4c")](t),this[S("0x9b")][S("0xbc")]){var n=this[S("0x9b")][S("0xbc")][S("0x1")];for(i in n)n[S("0xa0")](i)&&delete n[i];for(i in this[S("0x9b")][S("0xbc")])this[S("0x9b")][S("0xbc")][S("0xa0")](i)&&delete this[S("0x9b")][S("0xbc")][i]}this[S("0x9b")][S("0xbc")]=this[S("0xb1")](this[S("0x9a")]),this[S("0x9b")][S("0xd")]=!0},w=new tt[S("0x29")],Z[S("0xa4")][S("0xbd")]=function(t,e){return this[S("0x93")]||(this[S("0x93")]=new tt[S("0x9")]),this[S("0x3")]instanceof tt[S("0x9")]?this[S("0x93")]=this[S("0x3")]:S("0xbe")==typeof this[S("0x3")][S("0xbf")]?this[S("0x93")]=this[S("0x3")][S("0xbf")](t):this[S("0x3")][S("0xc0")]&&this[S("0x3")][S("0xc0")]instanceof tt[S("0x9")]&&(this[S("0x93")]=this[S("0x3")][S("0xc0")]),this[S("0x93")]&&(this[S("0x8b")]=tt[S("0x24")][S("0x25")](this[S("0x93")],g,this[S("0x8b")]),this[S("0x92")]=tt[S("0x1b")][S("0x1c")](this[S("0x93")],g,this[S("0x92")]),tt[S("0x24")][S("0x25")](this[S("0x93")],g,this[S("0x8b")]),this[S("0x75")]&&this[S("0x97")]&&this[S("0x97")][S("0xc1")]&&(t=tt[S("0xc2")][S("0xc3")](this[S("0x97")][S("0xc1")],t,w),t=tt[S("0x11")][S("0x2c")](this[S("0x93")],t),this[S("0x76")][S("0xa6")]=t[S("0xa6")]),tt[S("0x29")][S("0xc4")](this[S("0x76")],this[S("0x8d")]),this[S("0x90")]=tt[S("0x11")][S("0xc5")](this[S("0x8e")],this[S("0x8d")],this[S("0x8f")],this[S("0x90")]),tt[S("0x11")][S("0xc6")](this[S("0x8b")],this[S("0x90")],this[S("0x90")]),tt[S("0x11")][S("0xc7")](this[S("0x90")],this[S("0x91")])),this[S("0x90")]},Z[S("0xa4")][S("0xc8")]=function(t,e){var n=this[S("0x95")];if(e){if(this[S("0xbd")](e),!this[S("0x93")])return;n=V(this[S("0xc9")],this[S("0x90")],3,this[S("0xc9")][S("0x2")]-3,g,null,this[S("0x6b")][S("0x1")][S("0x3")][S("0x4")])}for(var a=[],r=0;r<n[S("0x2")];r++){var o=n[r],o=(tt[S("0x1b")][S("0x1c")](o,void 0,C),[tt[S("0x5d")][S("0xca")](C[S("0xcb")]),tt[S("0x5d")][S("0xca")](C[S("0xcc")])]);t&&(o[0]=parseFloat(o[0][S("0xcd")](t)),o[1]=parseFloat(o[1][S("0xcd")](t))),a[S("0x4c")](i[S("0xce")](o))}var s,e=[];return e=0<a[S("0x2")]&&(a=i[S("0xcf")](a),s=i[S("0xd0")](a))&&(s=i[S("0xd1")](s))&&0<s[S("0x2")]?s[0]:e},Z[S("0xa4")][S("0xbb")]=function(t){for(var e=[],i=[],n=0,a=0;a<this[S("0x95")][S("0x2")];a+=2){var r=this[S("0x95")][0];e[S("0x4c")](r.x,r.y,r.z),i[S("0x4c")](n++)}return e=new Float32Array(e),i=new Int32Array(i),new tt[S("0x50")]({attributes:{position:new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:e})},primitiveType:tt[S("0x51")][S("0x59")],indices:i,boundingSphere:tt[S("0x4e")][S("0x4f")](e)})},Z[S("0xa4")][S("0xd2")]=function(){this[S("0x9c")][S("0x6a")][S("0x9d")][S("0xd2")](this),this[S("0xa9")]&&this[S("0x9c")][S("0xab")][S("0xd2")](this[S("0xa9")])},Z[S("0xa4")][S("0xb0")]=function(t){if(t){for(var e in this[S("0x9c")][S("0x6a")][S("0x9d")][S("0xd2")](this),this[S("0xa9")]&&this[S("0x9c")][S("0xab")][S("0xd2")](this[S("0xa9")]),this[S("0x94")][S("0xae")](function(t){t[S("0xaf")]=t[S("0xaf")]&&t[S("0xaf")][S("0xb0")]()}),this[S("0x94")]=[],this[S("0xd3")][S("0x1")])this[S("0xd3")][S("0x1")][S("0xa0")](e)&&delete this[S("0xd3")][S("0x1")][e];for(var e in this[S("0x6b")][S("0x1")])this[S("0x6b")][S("0x1")][S("0xa0")](e)&&delete this[S("0x6b")][S("0x1")][e];delete this[S("0xd3")],delete this[S("0x6b")],delete this[S("0x93")],delete this[S("0x74")],this[S("0x95")]=[]}},Z[S("0xa4")][S("0xd4")]=function(){this[S("0x9c")][S("0x6a")][S("0x9d")][S("0x9e")](this),this[S("0xa9")]&&this[S("0x9c")][S("0xab")][S("0x9e")](this[S("0xa9")])},Z[S("0xa4")][S("0xd5")]=function(){this[S("0x6c")]==Z[S("0x6e")][S("0xd6")]?(this[S("0x6b")]=tt[S("0xd7")][S("0x55")](tt[S("0xd7")][S("0x67")](this[S("0x70")],this[S("0x45")],!0),this[S("0x90")]),this[S("0xd3")]=tt[S("0xd7")][S("0x58")](tt[S("0xd7")][S("0x67")](this[S("0x70")],this[S("0x45")],!0))):(this[S("0x6b")]=tt.Scene[S("0x4a")][S("0x55")](tt.Scene[S("0x4a")][S("0x5c")](this[S("0x70")],this[S("0x72")],this[S("0x45")],!0),this[S("0x90")]),this[S("0xd3")]=tt.Scene[S("0x4a")][S("0x58")](tt.Scene[S("0x4a")][S("0x5c")](this[S("0x70")],this[S("0x72")],this[S("0x45")],!0))),this[S("0xc9")]=new Float32Array(this[S("0x6b")][S("0x1")][S("0x3")][S("0x4")][S("0x2")]);for(var t=0;t<this[S("0xc9")][S("0x2")];t++)this[S("0xc9")][t]=this[S("0x6b")][S("0x1")][S("0x3")][S("0x4")][t];this[S("0x95")]=[]},Z[S("0xa4")][S("0xd8")]=function(){var t=1+this[S("0x96")][S("0x2")],e=new Float32Array(3+3*this[S("0x96")][S("0x2")]),i=0;e[i++]=this[S("0x93")].x,e[i++]=this[S("0x93")].y,e[i++]=this[S("0x93")].z;for(var n=0;n<this[S("0x96")][S("0x2")];n++)e[i++]=this[S("0x96")][n].x,e[i++]=this[S("0x96")][n].y,e[i++]=this[S("0x96")][n].z;for(var a=[],r=[],n=1;n<t-1;n++)a[S("0x4c")](0,n,n+1),r[S("0x4c")](0,n);var a=new(65535<=t?Uint32Array:Uint16Array)(a),o={position:new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:e})},s=tt[S("0x4e")][S("0x4f")](e),l=new tt[S("0x50")]({attributes:o,indices:a,primitiveType:tt[S("0x51")][S("0x52")],boundingSphere:s}),o=new tt[S("0x50")]({attributes:o,indices:new Uint32Array(r),primitiveType:tt[S("0x51")][S("0x59")],boundingSphere:s});(0,tt.Scene[S("0x1f")])(l),this[S("0xd9")]=l,this[S("0xda")]=o},Z[S("0xa4")][S("0xdb")]=function(t){if(this[S("0x78")]&&(this[S("0xbd")](t[S("0xdc")]),this[S("0x93")])){this[S("0x6b")]||this[S("0xd5")](),this[S("0x95")]=V(this[S("0xc9")],this[S("0x90")],3,this[S("0xc9")][S("0x2")]-3,g,this[S("0x95")],this[S("0x6b")][S("0x1")][S("0x3")][S("0x4")]),this[S("0x96")][S("0xdd")](0,this[S("0x96")][S("0x2")]);var e=this[S("0xc8")]();if(e&&e[S("0x2")]){for(var i=0;i<e[S("0x2")];i++){var n=e[i];this[S("0x96")][S("0x4c")](tt[S("0x9")][S("0xde")](n[0],n[1]))}t[S("0x34")]===tt[S("0x35")][S("0x36")]?(this[S("0xd8")](),this[S("0xd9")]&&(this[S("0xdf")]&&(this[S("0xdf")][S("0xaf")]=this[S("0xdf")][S("0xaf")]&&this[S("0xdf")][S("0xaf")][S("0xb0")](),this[S("0xdf")]=null),this[S("0xdf")]=this[S("0xe0")](this[S("0xd9")],t,tt[S("0x11")][S("0x8c")][S("0x57")]()),t[S("0xe1")][S("0x4c")](this[S("0xdf")]),this[S("0x7b")])&&(this[S("0xe2")]&&(this[S("0xe2")][S("0xaf")]=this[S("0xe2")][S("0xaf")]&&this[S("0xe2")][S("0xaf")][S("0xb0")](),this[S("0xe2")]=null),this[S("0xe2")]=this[S("0xe0")](this[S("0xda")],t,tt[S("0x11")][S("0x8c")][S("0x57")]()),t[S("0xe1")][S("0x4c")](this[S("0xe2")])),this[S("0xa9")]&&(this[S("0xa9")][S("0xe3")][S("0x7a")]=this[S("0x7d")]&&this[S("0x78")],this[S("0xa9")][S("0xe4")][S("0x7a")]=this[S("0x7f")]&&this[S("0x78")])):(this[S("0xa9")]||this[S("0x9f")](!0),this[S("0xa9")][S("0xe3")][S("0x7a")]=!0)}else this[S("0x7b")]&&(this[S("0xd3")][S("0xe5")]||(this[S("0xd3")][S("0xe5")]=this[S("0xe0")](this[S("0xd3")],t)),t[S("0xe1")][S("0x4c")](this[S("0xd3")][S("0xe5")])),this[S("0xa9")]&&(this[S("0xa9")][S("0xe3")][S("0x7a")]=!1,this[S("0xa9")][S("0xe4")][S("0x7a")]=!1)}},Z[S("0xa4")][S("0xe6")]=function(t){return S("0xe7")},Z[S("0xa4")][S("0xe8")]=function(t){return S("0xe9")},Z[S("0xa4")][S("0xe0")]=function(t,e,i){var n=e[S("0xea")],a=new tt[S("0x9")],a=(tt[S("0x11")][S("0x12")](this[S("0x90")],t[S("0xeb")][S("0xec")],a),new tt[S("0x4e")](a,t[S("0xeb")][S("0xed")]),new tt[S("0xee")]({modelMatrix:i||this[S("0x90")],owner:this,primitiveType:t[S("0xb3")],pass:tt[S("0xef")][S("0xf0")]})),r=this,i=tt[S("0x53")][S("0xf1")](t);return a[S("0xaf")]=tt[S("0xf2")][S("0xf3")]({context:n,geometry:t,attributeLocations:i,bufferUsage:tt[S("0xf4")][S("0xf5")]}),a[S("0xaf")][S("0xf6")]=i,a[S("0xf7")]=tt[S("0xf8")][S("0xf9")]({context:n,vertexShaderSource:this[S("0xe8")](t),fragmentShaderSource:this[S("0xe6")](t),attributeLocations:i}),a[S("0xfa")]=tt[S("0xfb")][S("0xfc")]({blending:tt[S("0xfd")][S("0xfe")],depthTest:{enabled:!0,func:tt[S("0xff")][S("0x100")]},cull:{enabled:!1,face:tt[S("0x101")][S("0x102")]},depthMask:!1}),a[S("0x103")]={},a[S("0x103")][S("0x104")]=function(){return e[S("0xea")][S("0x105")][S("0x106")]},a[S("0x103")][S("0x107")]=function(){return e[S("0xea")][S("0x105")][S("0x108")]},a[S("0x103")][S("0x109")]=function(){return r[S("0x109")]||(r[S("0x109")]=0),r[S("0x109")]},a[S("0x103")][S("0x10a")]=function(){return r[S("0x10a")]||(r[S("0x10a")]=new tt[S("0x9")](.2,.2,.2)),r[S("0x10a")]},a[S("0x103")][S("0x10b")]=function(){return r[S("0x10b")]||(r[S("0x10b")]=0),r[S("0x10b")]},a[S("0x103")][S("0x10c")]=function(){return t[S("0xb3")]==tt[S("0x51")][S("0x59")]},a[S("0x103")][S("0x81")]=function(){return t[S("0x82")]?t[S("0x82")]:t[S("0xb3")]==tt[S("0x51")][S("0x59")]?r[S("0x85")]||r[S("0x81")]||new tt[S("0x83")](1,1,0,.5):r[S("0x81")]||new tt[S("0x83")](1,0,0,1)},a[S("0x103")][S("0x10d")]=function(){return r[S("0x10d")]||(r[S("0x10d")]=0),r[S("0x10d")]},a[S("0x103")][S("0x10e")]=function(){return r[S("0x10e")]||(r[S("0x10e")]=new tt[S("0x83")](1,1,0,1)),r[S("0x10e")]},a[S("0x103")][S("0x10f")]=function(){return e[S("0xea")][S("0x105")][S("0x5")]},a[S("0x103")][S("0x110")]=function(){return.25},a},tt.Scene[S("0x111")]=V,tt.Scene[S("0x69")]=Z),tt[S("0x112")]||(tt.Scene[S("0x112")]=void 0,Object[S("0xa3")](n[S("0xa4")],{trackedEntity:{get:function(){return this[S("0x97")]},set:function(t){this[S("0x97")]=t}},color:{get:function(){return this[S("0x81")]},set:function(t){this[S("0x81")]=t}},lineColor:{get:function(){return this[S("0x85")]},set:function(t){this[S("0x85")]=t}},show:{get:function(){return this[S("0x78")]},set:function(t){this[S("0x78")]=t}},outline:{get:function(){return this[S("0x7b")]},set:function(t){this[S("0x7b")]=t,this[S("0xd5")]()}},top:{get:function(){return this[S("0x116")]},set:function(t){this[S("0x116")]=t,this[S("0xd5")]()}},topOutline:{get:function(){return this[S("0x118")]},set:function(t){this[S("0x118")]=t,this[S("0xd5")]()}},groundArea:{get:function(){return this[S("0x7d")]},set:function(t){this[S("0x7d")]=t,this[S("0x9f")](this[S("0x7d")])}},angle:{get:function(){return this[S("0x113")]},set:function(t){this[S("0x113")]=t,this[S("0x11a")](),this[S("0xd5")]()}},radius:{get:function(){return this[S("0x115")]},set:function(t){this[S("0x115")]=t,this[S("0x11a")](),this[S("0xd5")]()}},heading:{get:function(){return this[S("0x76")][S("0xa6")]},set:function(t){this[S("0x76")][S("0xa6")]=t}},pitch:{get:function(){return this[S("0x76")][S("0xa7")]},set:function(t){this[S("0x76")][S("0xa7")]=t}},roll:{get:function(){return this[S("0x76")][S("0xa8")]},set:function(t){this[S("0x76")][S("0xa8")]=t}},position:{get:function(){return this[S("0x74")]},set:function(t){this[S("0x74")]=t}}}),n[S("0xa4")][S("0x11a")]=function(){this[S("0x11b")]=this[S("0x115")]*Math[S("0x66")](tt[S("0x5d")][S("0x5e")](this[S("0x113")]))},n[S("0xa4")][S("0x9f")]=function(t){var e;t&&!this[S("0xa9")]&&((e=this)[S("0x11a")](),this[S("0xa9")]=viewer[S("0xab")][S("0x9e")]({position:this[S("0x74")],ellipse:{show:0===this[S("0x76")][S("0xa7")]&&0===this[S("0x76")][S("0xa8")],semiMinorAxis:new tt[S("0xac")](function(t){return e[S("0x11b")]},!1),semiMajorAxis:new tt[S("0xac")](function(t){return e[S("0x11b")]},!1),material:this[S("0x81")]},polyline:{show:this[S("0x11c")]&&(0!==this[S("0x76")][S("0xa7")]||0!==this[S("0x76")][S("0xa8")]),positions:new tt[S("0xac")](function(t){return!e[S("0x11c")]||tt[S("0x9")][S("0x11d")](e[S("0x74")],e[S("0x11c")])>e[S("0x115")]?[]:[e[S("0x74")],e[S("0x11c")]]},!1),followSurface:!1,material:new tt[S("0x11e")]({color:tt[S("0x83")][S("0x11f")]}),width:1}}))},d=new tt[S("0x9")],n[S("0xa4")][S("0xbd")]=function(t,e){var i;return this[S("0x93")]||(this[S("0x93")]=new tt[S("0x9")]),this[S("0x3")]instanceof tt[S("0x9")]?this[S("0x93")]=this[S("0x3")]:S("0xbe")==typeof this[S("0x3")][S("0xbf")]?this[S("0x93")]=this[S("0x3")][S("0xbf")](t):this[S("0x3")][S("0xc0")]&&this[S("0x3")][S("0xc0")]instanceof tt[S("0x9")]&&(this[S("0x93")]=this[S("0x3")][S("0xc0")]),this[S("0x97")]&&this[S("0x97")][S("0x3")]&&(i=this[S("0x93")],t=tt[S("0xc2")][S("0xc3")](this[S("0x97")][S("0x3")],t,d))&&(this[S("0x11c")]=t,i=mars3d[S("0x120")][S("0x121")](i,t,c),this[S("0x76")][S("0xa6")]=i[S("0xa6")],this[S("0x76")][S("0xa7")]=i[S("0xa7")],this[S("0x76")][S("0xa8")]=i[S("0xa8")]),this[S("0x8b")]=tt[S("0x24")][S("0x25")](this[S("0x93")],c,this[S("0x8b")]),this[S("0x92")]=tt[S("0x1b")][S("0x1c")](this[S("0x93")],c,this[S("0x92")]),tt[S("0x24")][S("0x25")](this[S("0x93")],c,this[S("0x8b")]),tt[S("0x29")][S("0xc4")](this[S("0x76")],this[S("0x8d")]),this[S("0x90")]=tt[S("0x11")][S("0xc5")](this[S("0x8e")],this[S("0x8d")],this[S("0x8f")],this[S("0x90")]),tt[S("0x11")][S("0xc6")](this[S("0x8b")],this[S("0x90")],this[S("0x90")]),tt[S("0x11")][S("0xc7")](this[S("0x90")],this[S("0x91")]),this[S("0x90")]},n[S("0xa4")][S("0x122")]=function(){for(var t=this[S("0xed")],e=[],i=[],n=[],a=[],r=90-parseInt(this[S("0x114")]),o=r<1?r/8:1,s=2*Math.PI/127,l=0,c=this[S("0x114")];c<91;c+=o){for(var h=tt[S("0x5d")][S("0x5e")](c<90?c:90),h=Math[S("0x66")](h)*t,d=[],x=0;x<128;x++){var u=s*x,p=h*Math[S("0x66")](u),u=h*Math[S("0x65")](u),g=Math[S("0xe")](t*t-p*p-u*u);e[S("0x4c")](p,u,g),i[S("0x4c")](1,1),d[S("0x4c")](l++)}a[S("0x4c")](d)}for(c=1;c<a[S("0x2")];c++)for(x=1;x<a[c][S("0x2")];x++){var m=a[c-1][x-1],f=a[c][x-1],v=a[c][x],b=a[c-1][x];n[S("0x4c")](m,f,v),n[S("0x4c")](m,v,b)}var e=new Float32Array(e),n=new Int32Array(n),i=new Float32Array(i),r={position:new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:e}),st:new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x8")],componentsPerAttribute:2,values:i})},y=tt[S("0x4e")][S("0x4f")](e),r=new tt[S("0x50")]({attributes:r,indices:n,primitiveType:tt[S("0x51")][S("0x52")],boundingSphere:y});return(0,tt.Scene[S("0x1f")])(r),r},n[S("0xa4")][S("0x123")]=function(){for(var t=this[S("0xed")],e=[],i=[],n=[],a=[],r=90-parseInt(this[S("0x114")]),o=r<1?r/8:1,s=2*Math.PI/127,l=0,c=this[S("0x114")];c<91;c+=o){for(var h=tt[S("0x5d")][S("0x5e")](c<90?c:90),h=Math[S("0x66")](h)*t,d=[],x=0;x<128;x++){var u=s*x,p=h*Math[S("0x66")](u),u=h*Math[S("0x65")](u),g=Math[S("0xe")](t*t-p*p-u*u);e[S("0x4c")](p,u,g),i[S("0x4c")](1,1),d[S("0x4c")](l++)}a[S("0x4c")](d)}for(c=1;c<a[S("0x2")];c++)for(x=1;x<a[c][S("0x2")];x++){var m=a[c-1][x-1],f=a[c][x-1],v=a[c][x];a[c-1][x],x%8==1&&n[S("0x4c")](m,f),c%8==1&&n[S("0x4c")](f,v)}var e=new Float32Array(e),n=new Int32Array(n),i=new Float32Array(i),r={position:new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:e}),st:new tt[S("0x6")]({componentDatatype:tt[S("0x7")][S("0x8")],componentsPerAttribute:2,values:i})},b=tt[S("0x4e")][S("0x4f")](e),r=new tt[S("0x50")]({attributes:r,indices:n,primitiveType:tt[S("0x51")][S("0x59")],boundingSphere:b});return(0,tt.Scene[S("0x1f")])(r),r},n[S("0xa4")][S("0xd5")]=function(){this[S("0x6b")]=tt.Scene[S("0x60")][S("0x55")](new tt.Scene[S("0x60")]({topRadius:this[S("0x115")]*Math[S("0x66")](tt[S("0x5d")][S("0x5e")](this[S("0x114")])),bottomRadius:0,length:this[S("0x115")]*Math[S("0x65")](tt[S("0x5d")][S("0x5e")](this[S("0x114")]))})),this[S("0x124")]=this[S("0x122")](),this[S("0x125")]=this[S("0x123")](),this[S("0xd3")]=tt.Scene[S("0x60")][S("0x58")](new tt.Scene[S("0x60")]({topRadius:this[S("0x115")]*Math[S("0x66")](tt[S("0x5d")][S("0x5e")](this[S("0x114")])),bottomRadius:0,slices:128,length:this[S("0x115")]*Math[S("0x65")](tt[S("0x5d")][S("0x5e")](this[S("0x114")]))})),this[S("0xc9")]=new Float32Array(this[S("0x6b")][S("0x1")][S("0x3")][S("0x4")][S("0x2")]);for(var t=0;t<this[S("0xc9")][S("0x2")];t++)this[S("0xc9")][t]=this[S("0x6b")][S("0x1")][S("0x3")][S("0x4")][t];this[S("0x94")]&&this[S("0x94")][S("0x2")]&&(this[S("0x94")][S("0xae")](function(t){t[S("0xaf")]=t[S("0xaf")]&&t[S("0xaf")][S("0xb0")]()}),this[S("0x94")][S("0xdd")](0,this[S("0x94")][S("0x2")]))},n[S("0xa4")][S("0xdb")]=function(e){this[S("0x78")]&&(this[S("0xbd")](e[S("0xdc")]),e[S("0x34")]===tt[S("0x35")][S("0x36")]?(this[S("0x6b")][S("0xeb")]=tt[S("0x4e")][S("0x4f")](this[S("0x6b")][S("0x1")][S("0x3")][S("0x4")]),this[S("0x94")]&&this[S("0x94")][S("0x2")]||(this[S("0x94")][S("0x4c")](this[S("0xe0")](this[S("0x6b")],e)),this[S("0x7b")]&&this[S("0x94")][S("0x4c")](this[S("0xe0")](this[S("0xd3")],e)),this[S("0x116")]&&(this[S("0x94")][S("0x4c")](this[S("0xe0")](this[S("0x124")],e)),this[S("0x118")])&&this[S("0x94")][S("0x4c")](this[S("0xe0")](this[S("0x125")],e))),this[S("0x94")][S("0xae")](function(t){e[S("0xe1")][S("0x4c")](t)}),this[S("0xa9")]&&(this[S("0xa9")][S("0x126")][S("0x7a")]=this[S("0x7d")]&&0===this[S("0x76")][S("0xa7")]&&0===this[S("0x76")][S("0xa8")],this[S("0xa9")][S("0xe4")][S("0x7a")]=!1)):(this[S("0xa9")]||this[S("0x9f")](!0),this[S("0xa9")][S("0x126")][S("0x7a")]=0===this[S("0x76")][S("0xa7")]&&0===this[S("0x76")][S("0xa8")],this[S("0xa9")][S("0xe4")][S("0x7a")]=this[S("0x11c")]&&(0!==this[S("0x76")][S("0xa7")]||0!==this[S("0x76")][S("0xa8")])))},n[S("0xa4")][S("0xe6")]=function(t){return S("0x127")},n[S("0xa4")][S("0xe8")]=function(t){return S("0x128")},n[S("0xa4")][S("0xe0")]=function(t,e,i){var n=e[S("0xea")],a=new tt[S("0x9")],a=(tt[S("0x11")][S("0x12")](this[S("0x90")],t[S("0xeb")][S("0xec")],a),new tt[S("0x4e")](a,t[S("0xeb")][S("0xed")])),i=new tt[S("0xee")]({modelMatrix:i||this[S("0x90")],owner:this,primitiveType:t[S("0xb3")],pass:tt[S("0xef")][S("0x129")],boundingVolume:a}),r=this,a=tt[S("0x53")][S("0xf1")](t);return i[S("0xaf")]=tt[S("0xf2")][S("0xf3")]({context:n,geometry:t,attributeLocations:a,bufferUsage:tt[S("0xf4")][S("0xf5")]}),i[S("0xaf")][S("0xf6")]=a,i[S("0xf7")]=tt[S("0xf8")][S("0xf9")]({context:n,vertexShaderSource:this[S("0xe8")](t),fragmentShaderSource:this[S("0xe6")](t),attributeLocations:a}),i[S("0xfa")]=tt[S("0xfb")][S("0xfc")]({blending:tt[S("0xfd")][S("0xfe")],depthTest:{enabled:!0,func:tt[S("0xff")][S("0x100")]},cull:{enabled:!1,face:tt[S("0x101")][S("0x102")]}}),i[S("0x103")]={},i[S("0x103")][S("0x104")]=function(){return e[S("0xea")][S("0x105")][S("0x106")]},i[S("0x103")][S("0x107")]=function(){return e[S("0xea")][S("0x105")][S("0x108")]},i[S("0x103")][S("0x109")]=function(){return r[S("0x109")]||(r[S("0x109")]=0),r[S("0x109")]},i[S("0x103")][S("0x10a")]=function(){return r[S("0x10a")]||(r[S("0x10a")]=new tt[S("0x9")](.2,.2,.2)),r[S("0x10a")]},i[S("0x103")][S("0x10b")]=function(){return r[S("0x10b")]||(r[S("0x10b")]=0),r[S("0x10b")]},i[S("0x103")][S("0x10c")]=function(){return t[S("0xb3")]==tt[S("0x51")][S("0x59")]||t[S("0xb3")]==tt[S("0x51")][S("0x12a")]},i[S("0x103")][S("0x81")]=function(){return t[S("0xb3")]==tt[S("0x51")][S("0x59")]||t[S("0xb3")]==tt[S("0x51")][S("0x12a")]?(r[S("0x85")]||(r[S("0x85")]=new tt[S("0x83")](1,1,0,1)),r[S("0x85")]):(r[S("0x81")]||(r[S("0x81")]=new tt[S("0x83")](1,0,0,1)),r[S("0x81")])},i[S("0x103")][S("0x10d")]=function(){return r[S("0x10d")]||(r[S("0x10d")]=0),r[S("0x10d")]},i[S("0x103")][S("0x10e")]=function(){return r[S("0x10e")]||(r[S("0x10e")]=new tt[S("0x83")](1,1,0,1)),r[S("0x10e")]},i[S("0x103")][S("0x10f")]=function(){return e[S("0xea")][S("0x105")][S("0x5")]},i[S("0x103")][S("0x110")]=function(){return.25},i},n[S("0xa4")][S("0xd2")]=function(){this[S("0x9c")][S("0x6a")][S("0x9d")][S("0xd2")](this),this[S("0xa9")]&&this[S("0x9c")][S("0xab")][S("0xd2")](this[S("0xa9")])},n[S("0xa4")][S("0xd4")]=function(){this[S("0x9c")][S("0x6a")][S("0x9d")][S("0x9e")](this),this[S("0xa9")]&&this[S("0x9c")][S("0xab")][S("0x9e")](this[S("0xa9")])},n[S("0xa4")][S("0xb0")]=function(t){t&&(this[S("0x9c")][S("0x6a")][S("0x9d")][S("0xd2")](this),this[S("0xa9")]&&this[S("0x9c")][S("0xab")][S("0xd2")](this[S("0xa9")]),this[S("0x94")][S("0xae")](function(t){t[S("0xaf")]=t[S("0xaf")]&&t[S("0xaf")][S("0xb0")]()}),this[S("0x94")]=[])},tt.Scene[S("0x112")]=n),e[S("0xa4")][S("0x241")]=function(t){var e=this[S("0x23d")]*this[S("0x23b")],i=this[S("0x23e")]*this[S("0x23c")],n=r(this[S("0x237")],this[S("0x238")],this[S("0x239")],this[S("0x23a")],e,i,this[S("0x242")]),a=r(this[S("0x237")],this[S("0x238")],this[S("0x239")],this[S("0x23a")],e,i,this[S("0x242")]),e=s(e,i),i=l(this[S("0x23b")],this[S("0x23c")],this[S("0x23d")],this[S("0x23e")]);return this[S("0x243")](t,n,a,e,i)},e[S("0xa4")][S("0x244")]=function(t){var e=this[S("0x23d")]*this[S("0x23b")],i=this[S("0x23e")]*this[S("0x23c")],n=r(this[S("0x237")],this[S("0x238")],this[S("0x239")],this[S("0x23a")],e,i,this[S("0x245")]),a=r(this[S("0x237")],this[S("0x238")],this[S("0x239")],this[S("0x23a")],e,i,this[S("0x245")]),e=s(e,i),i=l(this[S("0x23b")],this[S("0x23c")],this[S("0x23d")],this[S("0x23e")]);return this[S("0x243")](t,n,a,e,i)},e[S("0xa4")][S("0x246")]=function(t){var e=this[S("0x23e")]*this[S("0x23c")],i=o(this[S("0x237")],this[S("0x239")],this[S("0x23a")],10,e,this[S("0x245")],this[S("0x242")]),n=o(this[S("0x237")],this[S("0x239")],this[S("0x23a")],10,e,this[S("0x245")],this[S("0x242")]),e=s(10,e),a=l(10,this[S("0x23c")],1,this[S("0x23e")]);return this[S("0x243")](t,i,n,e,a)},e[S("0xa4")][S("0x247")]=function(t){var e=this[S("0x23e")]*this[S("0x23c")],i=o(this[S("0x238")],this[S("0x239")],this[S("0x23a")],10,e,this[S("0x245")],this[S("0x242")]),n=o(this[S("0x238")],this[S("0x239")],this[S("0x23a")],10,e,this[S("0x245")],this[S("0x242")]),e=s(10,e),a=l(10,this[S("0x23c")],1,this[S("0x23e")]);return this[S("0x243")](t,i,n,e,a)},e[S("0xa4")][S("0x243")]=function(t,e,i,n,a){var r=this,o=tt[S("0x248")][S("0x249")](!0,!1,void 0),o=tt[S("0xfb")][S("0xfc")](o),s=new tt[S("0x136")]({sources:[S("0x24a")]}),l=new tt[S("0x136")]({sources:[S("0x24b")]}),c={xbsjColor:function(){return r[S("0x236")]}},h={xbsjColor:function(){return r[S("0x86")]}},s=tt[S("0xf8")][S("0xfc")]({context:t,vertexShaderSource:s,fragmentShaderSource:l,attributeLocations:{position:0,normal:1}}),l=tt[S("0x135")][S("0x190")]({context:t,typedArray:e,usage:tt[S("0xf4")][S("0xf5")]}),i=tt[S("0x135")][S("0x190")]({context:t,typedArray:i,usage:tt[S("0xf4")][S("0xf5")]}),n=tt[S("0x135")][S("0x24c")]({context:t,typedArray:n,usage:tt[S("0xf4")][S("0xf5")],indexDatatype:tt[S("0x1a1")][S("0x24d")]}),a=tt[S("0x135")][S("0x24c")]({context:t,typedArray:a,usage:tt[S("0xf4")][S("0xf5")],indexDatatype:tt[S("0x1a1")][S("0x24d")]}),n=new tt[S("0xf2")]({context:t,attributes:[{index:0,vertexBuffer:l,componentsPerAttribute:3,componentDatatype:tt[S("0x7")][S("0x8")]},{index:1,vertexBuffer:i,componentsPerAttribute:3,componentDatatype:tt[S("0x7")][S("0x8")]}],indexBuffer:n}),t=new tt[S("0xf2")]({context:t,attributes:[{index:0,vertexBuffer:l,componentsPerAttribute:3,componentDatatype:tt[S("0x7")][S("0x8")]},{index:1,vertexBuffer:i,componentsPerAttribute:3,componentDatatype:tt[S("0x7")][S("0x8")]}],indexBuffer:a}),l=tt[S("0x4e")][S("0x4f")](e);return{command:new tt[S("0xee")]({vertexArray:n,primitiveType:tt[S("0x51")][S("0x52")],renderState:o,shaderProgram:s,uniformMap:c,owner:this,pass:tt[S("0xef")][S("0x129")],modelMatrix:new tt[S("0x11")],boundingVolume:new tt[S("0x4e")],cull:!0}),lineCommand:new tt[S("0xee")]({vertexArray:t,primitiveType:tt[S("0x51")][S("0x59")],renderState:o,shaderProgram:s,uniformMap:h,owner:this,pass:tt[S("0xef")][S("0x129")],modelMatrix:new tt[S("0x11")],boundingVolume:new tt[S("0x4e")],cull:!0}),initBoundingSphere:l}},e[S("0xa4")][S("0xdb")]=function(e){var i=this;this[S("0x7a")]&&(this[S("0x22b")]===this[S("0x245")]&&this[S("0x22c")]===this[S("0x242")]&&this[S("0x22e")]===this[S("0x237")]&&this[S("0x22f")]===this[S("0x238")]&&this[S("0x230")]===this[S("0x239")]&&this[S("0x231")]===this[S("0x23a")]&&this[S("0x232")]===this[S("0x23b")]&&this[S("0x233")]===this[S("0x23c")]&&this[S("0x234")]===this[S("0x23d")]&&this[S("0x235")]===this[S("0x23e")]||(this[S("0x245")]=this[S("0x22b")],this[S("0x242")]=this[S("0x22c")],this[S("0x237")]=this[S("0x22e")],this[S("0x238")]=this[S("0x22f")],this[S("0x239")]=this[S("0x230")],this[S("0x23a")]=this[S("0x231")],this[S("0x23b")]=this[S("0x232")],this[S("0x23c")]=this[S("0x233")],this[S("0x23d")]=this[S("0x234")],this[S("0x23e")]=this[S("0x235")],this[S("0x8b")]=tt[S("0x57")](tt[S("0x11")][S("0x8c")]),this[S("0x24e")]()),tt[S("0x2d")](this[S("0x24f")])&&0!==this[S("0x24f")][S("0x2")]||(this[S("0x24f")]||(this[S("0x24f")]=[]),this[S("0x24f")][S("0x4c")](this[S("0x241")](e[S("0xea")])),this[S("0x24f")][S("0x4c")](this[S("0x246")](e[S("0xea")])),this[S("0x24f")][S("0x4c")](this[S("0x247")](e[S("0xea")])),this[S("0x24f")][S("0x4c")](this[S("0x244")](e[S("0xea")]))),tt[S("0x11")][S("0xba")](this[S("0x140")],this[S("0x8b")])||(tt[S("0x11")][S("0x57")](this[S("0x140")],this[S("0x8b")]),this[S("0x24f")][S("0xae")](function(t){t[S("0x250")][S("0x140")]=tt[S("0x11")][S("0x8c")],t[S("0x250")][S("0x140")]=i[S("0x8b")],t[S("0x250")][S("0x251")]=tt[S("0x4e")][S("0x180")](t[S("0x252")],i[S("0x8b")],i[S("0x166")]),t[S("0x253")][S("0x140")]=tt[S("0x11")][S("0x8c")],t[S("0x253")][S("0x140")]=i[S("0x8b")],t[S("0x253")][S("0x251")]=tt[S("0x4e")][S("0x180")](t[S("0x252")],i[S("0x8b")],i[S("0x166")])})),this[S("0x24f")][S("0xae")](function(t){t[S("0x250")]&&e[S("0xe1")][S("0x4c")](t[S("0x250")]),t[S("0x253")]&&e[S("0xe1")][S("0x4c")](t[S("0x253")])}))},e[S("0xa4")][S("0x1f7")]=function(){return!1},e[S("0xa4")][S("0x24e")]=function(){this[S("0x24f")]&&this[S("0x24f")][S("0xae")](function(t){tt[S("0x2d")](t[S("0x250")])&&(t[S("0x250")][S("0xf7")]=t[S("0x250")][S("0xf7")]&&t[S("0x250")][S("0xf7")][S("0xb0")](),t[S("0x250")][S("0xaf")]=t[S("0x250")][S("0xaf")]&&t[S("0x250")][S("0xaf")][S("0xb0")](),t[S("0x250")]=void 0),tt[S("0x2d")](t[S("0x253")])&&(t[S("0x253")][S("0xf7")]=t[S("0x253")][S("0xf7")]&&t[S("0x253")][S("0xf7")][S("0xb0")](),t[S("0x253")][S("0xaf")]=t[S("0x253")][S("0xaf")]&&t[S("0x253")][S("0xaf")][S("0xb0")](),t[S("0x253")]=void 0)}),this[S("0x24f")]&&(this[S("0x24f")][S("0x2")]=0)},e[S("0xa4")][S("0xb0")]=function(){return this[S("0x24e")](),tt[S("0x133")](this)},Object[S("0xa3")](e[S("0xa4")],{startRadius:{get:function(){return this[S("0x254")]},set:function(t){this[S("0x254")]=t,this[S("0x22b")]=[{fov:tt[S("0x5d")][S("0x5e")](0),radius:t},{fov:tt[S("0x5d")][S("0x5e")](10),radius:.9*t},{fov:tt[S("0x5d")][S("0x5e")](20),radius:.8*t},{fov:tt[S("0x5d")][S("0x5e")](30),radius:.7*t},{fov:tt[S("0x5d")][S("0x5e")](40),radius:.6*t},{fov:tt[S("0x5d")][S("0x5e")](50),radius:.5*t},{fov:tt[S("0x5d")][S("0x5e")](60),radius:.4*t},{fov:tt[S("0x5d")][S("0x5e")](70),radius:.3*t},{fov:tt[S("0x5d")][S("0x5e")](80),radius:.1*t},{fov:tt[S("0x5d")][S("0x5e")](90),radius:.01*t}]}},radius:{get:function(){return this[S("0x115")]},set:function(t){this[S("0x115")]=t,this[S("0x22c")]=[{fov:tt[S("0x5d")][S("0x5e")](0),radius:t},{fov:tt[S("0x5d")][S("0x5e")](10),radius:.9*t},{fov:tt[S("0x5d")][S("0x5e")](20),radius:.8*t},{fov:tt[S("0x5d")][S("0x5e")](30),radius:.7*t},{fov:tt[S("0x5d")][S("0x5e")](40),radius:.6*t},{fov:tt[S("0x5d")][S("0x5e")](50),radius:.5*t},{fov:tt[S("0x5d")][S("0x5e")](60),radius:.4*t},{fov:tt[S("0x5d")][S("0x5e")](70),radius:.3*t},{fov:tt[S("0x5d")][S("0x5e")](80),radius:.1*t},{fov:tt[S("0x5d")][S("0x5e")](90),radius:.01*t}]}}}),tt.Scene[S("0x255")]=e,function(){var t,e;tt[S("0x12b")]||(t=typeof self!==S("0x68")?self:this,e=function(){return i=[function(c,t,e){Object[S("0x1d")](t,S("0x1e"),{value:!0}),t[S("0x12b")]=void 0;var C=i(e(6)),w=i(e(7)),I=i(e(8)),Q=i(e(9));function i(t){return t&&t[S("0x1e")]?t:{default:t}}var _=tt[S("0x4e")],A=tt[S("0x9")],n=tt[S("0x83")],x=tt[S("0x132")],G=tt[S("0x7")],a=tt[S("0x79")],r=tt[S("0x2d")],P=(Object[S("0xa3")],tt[S("0x133")],tt[S("0x134")]),W=tt[S("0x11")],o=tt[S("0x51")],M=tt[S("0x135")],Z=tt[S("0xf4")],s=tt[S("0xee")],V=tt[S("0xef")],R=tt[S("0xfb")],B=tt[S("0xf8")],X=tt[S("0x136")],F=tt[S("0xf2")],T=tt[S("0xfd")],E=tt[S("0x101")],l=tt[S("0x137")],J=tt[S("0x35")],O=tt[S("0x138")],K=tt[S("0x5d")],D=tt[S("0x22")],k=(W=tt[S("0x11")],tt[S("0x139")]),d=(tt[S("0x13a")],tt[S("0x13b")],Math[S("0x65")]),N=Math[S("0x66")],L=Math[S("0x5f")],Y=Math[S("0x13c")],z=(Math[S("0x13d")],{position:0,normal:1});function h(t){var e=this;t=a(t,a[S("0x13e")]),this[S("0x7a")]=a(t[S("0x7a")],!0),this[S("0x13f")]=a(t[S("0x13f")],32),this[S("0x140")]=W[S("0x57")](t[S("0x140")],new W),this[S("0x8b")]=new W,this[S("0x141")]=new W,this[S("0x142")]=new W,this[S("0xed")]=a(t[S("0xed")],Number[S("0x143")]),this[S("0x115")]=void 0,this[S("0x144")]=a(t[S("0x144")],0),this[S("0x145")]=void 0,this[S("0x146")]=a(t[S("0x146")],0),this[S("0x147")]=void 0,this[S("0x86")]=a(t[S("0x86")],n[S("0x148")]),this[S("0x149")]=a(t[S("0x149")],!0),this[S("0x14a")]=a(t[S("0x14a")],!0),this[S("0x14b")]=a(t[S("0x14b")],!0),this[S("0x14c")]=r(t[S("0x14c")])?t[S("0x14c")]:l[S("0x14d")](l[S("0x14e")]),this[S("0x14f")]=void 0,this[S("0x150")]=void 0,this[S("0x151")]=r(t[S("0x151")])?t[S("0x151")]:l[S("0x14d")](l[S("0x14e")]),this[S("0x152")]=void 0,this[S("0x153")]=void 0,this[S("0x154")]=a(t[S("0x154")],!0),this[S("0x155")]=r(t[S("0x155")])?t[S("0x155")]:l[S("0x14d")](l[S("0x14e")]),this[S("0x156")]=void 0,this[S("0x157")]=a(t[S("0x157")],!0),this[S("0x158")]=a(t[S("0x158")],!0),this[S("0x159")]=a(t[S("0x159")],n[S("0x148")]),this[S("0x15a")]=a(t[S("0x15a")],5),this[S("0x15b")]=a(t[S("0x15b")],!1),this[S("0x15c")]=void 0,this[S("0x15d")]=a(t[S("0x15d")],!0),this[S("0x15e")]=a(t[S("0x15e")],n[S("0x148")]),this[S("0x15f")]=a(t[S("0x15f")],S("0x160")),this[S("0x161")]=a(t[S("0x161")],10),this[S("0x162")]=0,this[S("0x163")]=0,this[S("0x164")]=k[S("0x165")](),this[S("0x166")]=new _,this[S("0x167")]=new _,this[S("0x168")]=new s({owner:this,primitiveType:o[S("0x52")],boundingVolume:this[S("0x167")]}),this[S("0x169")]=new s({owner:this,primitiveType:o[S("0x52")],boundingVolume:this[S("0x167")]}),this[S("0x16a")]=void 0,this[S("0x16b")]=new s({owner:this,primitiveType:o[S("0x59")],boundingVolume:this[S("0x167")]}),this[S("0x16c")]=void 0,this[S("0x16d")]=new s({owner:this,primitiveType:o[S("0x59")],boundingVolume:this[S("0x167")]}),this[S("0x16e")]=void 0,this[S("0x16f")]=new s({owner:this,primitiveType:o[S("0x52")],boundingVolume:this[S("0x167")]}),this[S("0x170")]=new s({owner:this,primitiveType:o[S("0x52")],boundingVolume:this[S("0x167")]}),this[S("0x171")]=void 0,this[S("0x172")]=new s({owner:this,primitiveType:o[S("0x59")],boundingVolume:this[S("0x167")]}),this[S("0x173")]=void 0,this[S("0x174")]=new s({owner:this,primitiveType:o[S("0x52")],boundingVolume:this[S("0x167")]}),this[S("0x175")]=new s({owner:this,primitiveType:o[S("0x52")],boundingVolume:this[S("0x167")]}),this[S("0x176")]=void 0,this[S("0x177")]=[],this[S("0x178")]=void 0,this[S("0x179")]=void 0,this[S("0x17a")]=void 0,this[S("0x17b")]={u_type:function(){return 0},u_xHalfAngle:function(){return e[S("0x144")]},u_yHalfAngle:function(){return e[S("0x146")]},u_radius:function(){return e[S("0xed")]},u_showThroughEllipsoid:function(){return e[S("0x15b")]},u_showIntersection:function(){return e[S("0x158")]},u_intersectionColor:function(){return e[S("0x159")]},u_intersectionWidth:function(){return e[S("0x15a")]},u_normalDirection:function(){return 1},u_lineColor:function(){return e[S("0x86")]}},this[S("0x17c")]={u_xHalfAngle:function(){return e[S("0x162")]},u_yHalfAngle:function(){return e[S("0x163")]},u_radius:function(){return e[S("0xed")]},u_color:function(){return e[S("0x15e")]},u_showThroughEllipsoid:function(){return e[S("0x15b")]},u_showIntersection:function(){return e[S("0x158")]},u_intersectionColor:function(){return e[S("0x159")]},u_intersectionWidth:function(){return e[S("0x15a")]},u_normalDirection:function(){return 1},u_lineColor:function(){return e[S("0x86")]}}}h[S("0xa4")][S("0xdb")]=function(t){var e,i,n=t[S("0x34")];if(this[S("0x7a")]&&n===J[S("0x36")]){var n=!1,a=!1,r=!1,o=this[S("0x144")],s=this[S("0x146")];if(o<0||s<0)throw new P(S("0x17d"));if(0!=o&&0!=s){this[S("0x145")]===o&&this[S("0x147")]===s||(this[S("0x145")]=o,this[S("0x147")]=s,n=!0);var l=this[S("0xed")];if(l<0)throw new P(S("0x17e"));var c=!1,l=(this[S("0x115")]!==l&&(c=!0,this[S("0x115")]=l,this[S("0x166")]=new _(A[S("0x56")],this[S("0xed")])),W[S("0xba")](this[S("0x140")],this[S("0x8b")])&&!c||(W[S("0x57")](this[S("0x140")],this[S("0x8b")]),W[S("0x17f")](this[S("0x140")],this[S("0xed")],this[S("0x141")]),_[S("0x180")](this[S("0x166")],this[S("0x140")],this[S("0x167")])),this[S("0x15b")]),c=(this[S("0x15c")]!==this[S("0x15b")]&&(this[S("0x15c")]=l,a=!0),this[S("0x14c")]);this[S("0x14f")]!==c&&(this[S("0x14f")]=c,r=a=!0);var h,d,x,u,p,g=c[S("0x181")](),m=(this[S("0x150")]!==g&&(this[S("0x150")]=g,a=!0),this[S("0x15d")]&&(p=t[S("0xdc")],(u=k[S("0x182")](p,this[S("0x164")]))<0&&(this[S("0x164")]=k[S("0x57")](p,this[S("0x164")])),p=Math[S("0x183")](u%this[S("0x161")]/this[S("0x161")],0),this[S("0x15f")]==S("0x160")?(u=N(d=2*s*p-s),x=L(o),u=Y(u*x),this[S("0x162")]=u,this[S("0x163")]=d,tt[S("0x22")][S("0x184")](this[S("0x163")],U)):(d=2*o*p-o,x=L(s),u=N(d),p=Y(u*x),this[S("0x162")]=d,this[S("0x163")]=p,tt[S("0x22")][S("0x185")](this[S("0x162")],U)),tt[S("0x11")][S("0x186")](this[S("0x140")],U,this[S("0x142")]),W[S("0x17f")](this[S("0x142")],this[S("0xed")],this[S("0x142")])),n&&(o=this,s=t[S("0xea")],u=H(o,o[S("0x144")],o[S("0x146")]),d=(x=o)[S("0x144")],x=x[S("0x146")],p=u[S("0x189")],u=u[S("0x18a")],n=[],i=D[S("0x185")](d,U),n[S("0x4c")](p[S("0x18b")](function(t){return D[S("0x18c")](i,t,new tt[S("0x9")])})),i=D[S("0x184")](-x,U),n[S("0x4c")](u[S("0x18b")](function(t){return D[S("0x18c")](i,t,new tt[S("0x9")])})[S("0x18d")]()),i=D[S("0x185")](-d,U),n[S("0x4c")](p[S("0x18b")](function(t){return D[S("0x18c")](i,t,new tt[S("0x9")])})[S("0x18d")]()),i=D[S("0x184")](x,U),n[S("0x4c")](u[S("0x18b")](function(t){return D[S("0x18c")](i,t,new tt[S("0x9")])})),d=n,o[S("0x14b")]&&(o[S("0x16a")]=function(t,e){for(var i=Array[S("0xa4")][S("0x18e")][S("0x18f")]([],e)[S("0x2")]-e[S("0x2")],n=new Float32Array(18*i),a=0,r=0,o=e[S("0x2")];r<o;r++)for(var s=e[r],l=A[S("0x15")](A[S("0xc")](s[0],s[s[S("0x2")]-1],q),q),c=0,i=s[S("0x2")]-1;c<i;c++)n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=-l.x,n[a++]=-l.y,n[a++]=-l.z,n[a++]=s[c].x,n[a++]=s[c].y,n[a++]=s[c].z,n[a++]=-l.x,n[a++]=-l.y,n[a++]=-l.z,n[a++]=s[c+1].x,n[a++]=s[c+1].y,n[a++]=s[c+1].z,n[a++]=-l.x,n[a++]=-l.y,n[a++]=-l.z;var h=M[S("0x190")]({context:t,typedArray:n,usage:Z[S("0xf5")]}),d=6*Float32Array[S("0x191")],h=[{index:z[S("0x3")],vertexBuffer:h,componentsPerAttribute:3,componentDatatype:G[S("0x8")],offsetInBytes:0,strideInBytes:d},{index:z[S("0x5")],vertexBuffer:h,componentsPerAttribute:3,componentDatatype:G[S("0x8")],offsetInBytes:3*Float32Array[S("0x191")],strideInBytes:d}];return new F({context:t,attributes:h})}(s,d)),o[S("0x149")]&&(o[S("0x16c")]=function(t,e){for(var i=e[S("0x2")],n=new Float32Array(9*i),a=0,r=0,o=e[S("0x2")];r<o;r++){var s=e[r];n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=s[0].x,n[a++]=s[0].y,n[a++]=s[0].z}var i=M[S("0x190")]({context:t,typedArray:n,usage:Z[S("0xf5")]}),l=3*Float32Array[S("0x191")],i=[{index:z[S("0x3")],vertexBuffer:i,componentsPerAttribute:3,componentDatatype:G[S("0x8")],offsetInBytes:0,strideInBytes:l}];return new F({context:t,attributes:i})}(s,d)),o[S("0x14a")]&&(o[S("0x16e")]=function(t,e){for(var i=Array[S("0xa4")][S("0x18e")][S("0x18f")]([],e)[S("0x2")]-e[S("0x2")],n=new Float32Array(9*i),a=0,r=0,o=e[S("0x2")];r<o;r++)for(var s=e[r],l=0,i=s[S("0x2")]-1;l<i;l++)n[a++]=s[l].x,n[a++]=s[l].y,n[a++]=s[l].z,n[a++]=s[l+1].x,n[a++]=s[l+1].y,n[a++]=s[l+1].z;var c=M[S("0x190")]({context:t,typedArray:n,usage:Z[S("0xf5")]}),h=3*Float32Array[S("0x191")],c=[{index:z[S("0x3")],vertexBuffer:c,componentsPerAttribute:3,componentDatatype:G[S("0x8")],offsetInBytes:0,strideInBytes:h}];return new F({context:t,attributes:c})}(s,d)),o[S("0x154")]&&(o[S("0x171")]=(p=s,x=tt[S("0x13b")][S("0x55")](new tt[S("0x13b")]({vertexFormat:O[S("0x192")],stackPartitions:32,slicePartitions:32})),F[S("0xf3")]({context:p,geometry:x,attributeLocations:z,bufferUsage:Z[S("0xf5")],interleave:!1}))),o[S("0x157")]&&(o[S("0x173")]=(u=s,n=tt[S("0x193")][S("0x55")](new tt[S("0x193")]({vertexFormat:O[S("0x192")],stackPartitions:32,slicePartitions:32})),F[S("0xf3")]({context:u,geometry:n,attributeLocations:z,bufferUsage:Z[S("0xf5")],interleave:!1}))),o[S("0x15d")])&&(o[S("0x15f")]==S("0x160")?(h=H(o,K[S("0x194")],0),o[S("0x195")]=$(s,h[S("0x18a")])):(h=H(o,0,K[S("0x194")]),o[S("0x195")]=$(s,h[S("0x189")]))),a&&(n=this,o=l,g?(n[S("0x178")]=R[S("0xfc")]({depthTest:{enabled:!o},depthMask:!1,blending:T[S("0xfe")],cull:{enabled:!0,face:E[S("0x102")]}}),n[S("0x179")]=R[S("0xfc")]({depthTest:{enabled:!o},depthMask:!1,blending:T[S("0xfe")],cull:{enabled:!0,face:E[S("0x19a")]}}),n[S("0x19b")]=R[S("0xfc")]({depthTest:{enabled:!o},depthMask:!1,blending:T[S("0xfe")]})):(n[S("0x178")]=R[S("0xfc")]({depthTest:{enabled:!o},depthMask:!0}),n[S("0x19b")]=R[S("0xfc")]({depthTest:{enabled:!0},depthMask:!0}))),r&&(s=this,l=h=c,n=(o=t)[S("0xea")],c=C[S("0x131")],e=new X({sources:[I[S("0x131")],l[S("0x196")],w[S("0x131")]]}),s[S("0x17a")]=B[S("0xf9")]({context:n,shaderProgram:s[S("0x17a")],vertexShaderSource:c,fragmentShaderSource:e,attributeLocations:z}),e=new X({sources:[I[S("0x131")],l[S("0x196")],w[S("0x131")]],pickColorQualifier:S("0x197")}),s[S("0x198")]=B[S("0xf9")]({context:n,shaderProgram:s[S("0x198")],vertexShaderSource:c,fragmentShaderSource:e,attributeLocations:z}),this[S("0x15d")])&&(l=h,n=o[S("0xea")],s=C[S("0x131")],c=new X({sources:[I[S("0x131")],l[S("0x196")],Q[S("0x131")]]}),this[S("0x199")]=B[S("0xf9")]({context:n,shaderProgram:this[S("0x199")],vertexShaderSource:s,fragmentShaderSource:c,attributeLocations:z})),(a||r)&&(e=g,(o=this)[S("0x177")][S("0x2")]=0,l=e?V[S("0x129")]:V[S("0xf0")],o[S("0x14b")]&&j(o,o[S("0x168")],o[S("0x169")],o[S("0x178")],o[S("0x179")],o[S("0x17a")],o[S("0x16a")],o[S("0x17b")],o[S("0x141")],e,l),o[S("0x149")]&&j(o,o[S("0x16b")],void 0,o[S("0x178")],o[S("0x179")],o[S("0x17a")],o[S("0x16c")],o[S("0x17b")],o[S("0x141")],e,l,!0),o[S("0x14a")]&&j(o,o[S("0x16d")],void 0,o[S("0x178")],o[S("0x179")],o[S("0x17a")],o[S("0x16e")],o[S("0x17b")],o[S("0x141")],e,l,!0),o[S("0x154")]&&j(o,o[S("0x16f")],o[S("0x170")],o[S("0x178")],o[S("0x179")],o[S("0x17a")],o[S("0x171")],o[S("0x17b")],o[S("0x141")],e,l),o[S("0x157")]&&j(o,o[S("0x172")],void 0,o[S("0x178")],o[S("0x179")],o[S("0x17a")],o[S("0x173")],o[S("0x17b")],o[S("0x141")],e,l,!0),o[S("0x15d")])&&j(o,o[S("0x174")],o[S("0x175")],o[S("0x178")],o[S("0x179")],o[S("0x199")],o[S("0x195")],o[S("0x17c")],o[S("0x142")],e,l),t[S("0xe1")]),n=t[S("0x187")],f=this[S("0x177")];if(n[S("0x188")])for(var v=0,b=f[S("0x2")];v<b;v++){var y=f[v];m[S("0x4c")](y)}}}};var U=new D,q=new A;function H(t,e,i){for(var n=t[S("0x13f")],t=N(i),i=L(i),a=N(e),e=L(e),r=Y(a*i),o=Y(t*e),s=[],l=0;l<n;l++){var c=2*r*l/(n-1)-r;s[S("0x4c")](new A(0,d(c),N(c)))}for(var h=[],l=0;l<n;l++)c=2*o*l/(n-1)-o,h[S("0x4c")](new A(d(c),0,N(c)));return{zoy:s,zox:h}}function $(t,e){for(var i=e[S("0x2")]-1,n=new Float32Array(9*i),a=0,r=0;r<i;r++)n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=e[r].x,n[a++]=e[r].y,n[a++]=e[r].z,n[a++]=e[r+1].x,n[a++]=e[r+1].y,n[a++]=e[r+1].z;var o=M[S("0x190")]({context:t,typedArray:n,usage:Z[S("0xf5")]}),s=3*Float32Array[S("0x191")],o=[{index:z[S("0x3")],vertexBuffer:o,componentsPerAttribute:3,componentDatatype:G[S("0x8")],offsetInBytes:0,strideInBytes:s}];return new F({context:t,attributes:o})}function j(t,e,i,n,a,r,o,s,l,c,h,d){c&&i&&(i[S("0xaf")]=o,i[S("0xfa")]=a,i[S("0xf7")]=r,i[S("0x103")]=x(s,t[S("0x14f")][S("0x17b")]),i[S("0x103")][S("0x19c")]=function(){return-1},i[S("0x19d")]=h,i[S("0x140")]=l,t[S("0x177")][S("0x4c")](i)),e[S("0xaf")]=o,e[S("0xfa")]=n,e[S("0xf7")]=r,e[S("0x103")]=x(s,t[S("0x14f")][S("0x17b")]),d&&(e[S("0x103")][S("0x19e")]=function(){return 1}),e[S("0x19d")]=h,e[S("0x140")]=l,t[S("0x177")][S("0x4c")](e)}t[S("0x12b")]=h},function(t,e,i){Object[S("0x1d")](e,S("0x1e"),{value:!0});var G=tt[S("0x4e")],P=tt[S("0x9")],r=tt[S("0x19f")],W=tt[S("0x7")],o=tt[S("0x79")],M=(tt[S("0x2d")],tt[S("0x50")]),Z=tt[S("0x6")],V=tt[S("0x1a0")],R=tt[S("0x51")],s=tt[S("0x138")],B=tt[S("0x5d")],X=tt[S("0x53")],F=tt[S("0x1a1")],T=(tt[S("0xf")],Math[S("0x66")]),E=Math[S("0x65")];function l(t){var e=(t=o(t,o[S("0x13e")]))[S("0x114")],i=t[S("0xed")],n=Math[S("0x1a2")](o(t[S("0x1a3")],12)),a=Math[S("0x1a2")](o(t[S("0x1a4")],64)),t=(r[S("0x1a5")][S("0x1a6")](S("0x114"),e),r[S("0x1a5")][S("0x1a6")](S("0xed"),i),o(t[S("0x1a7")],s[S("0x1a8")]));this[S("0x113")]=e,this[S("0x115")]=i,this[S("0x1a9")]=n,this[S("0x1aa")]=a,this[S("0x1ab")]=t}l[S("0x1ac")]=function(t){var e=(t=o(t,o[S("0x13e")]))[S("0x114")],i=t[S("0xed")],n=t[S("0x1a3")],a=t[S("0x1a4")];return r[S("0x1a5")][S("0x1a6")](S("0x114"),e),r[S("0x1a5")][S("0x1a6")](S("0xed"),i),r[S("0x1a5")][S("0x1a6")][S("0x1ad")](S("0x114"),e,0),r[S("0x1a5")][S("0x1a6")][S("0x1ad")](S("0x33"),height,0),new l({angle:e,radius:i,stackPartitions:n,slicePartitions:a,vertexFormat:t[S("0x1a7")]})},l[S("0x55")]=function(t){console[S("0xdc")](S("0x55"));var e,i=t[S("0x113")],n=t[S("0x115")],a=t[S("0x1a9")]+1,r=t[S("0x1aa")]+1,t=t[S("0x1ab")],o=new V,s=3*(r-1)+6*(r-1)*(a-2)+3*(r-1),l=a*r,c=F[S("0x1ae")](l,s),h=new Float64Array(3*l+3*(r-1)*3);if(t[S("0x3")]){for(var d=0,x=new Array(r),u=new Array(r),p=0;p<r;p++){var g=B[S("0x1af")]*p/(r-1);x[p]=T(g),u[p]=E(g),h[d++]=0,h[d++]=0,h[d++]=-n}for(p=1;p<a;p++)for(var m=i*p/(a-1),f=E(m),v=n*f,b=n*f,y=n*T(m),C=0;C<r;C++)h[d++]=x[C]*v,h[d++]=u[C]*b,h[d++]=-y;for(e=d,p=0;p<r-1;p++)h[d++]=0,h[d++]=0,h[d++]=0,h[d++]=h[e-3*(r-p-1)],h[d++]=h[e-3*(r-p-1)+1],h[d++]=h[e-3*(r-p-1)+2],h[d++]=h[e-3*(r-p)],h[d++]=h[e-3*(r-p)+1],h[d++]=h[e-3*(r-p)+2];o[S("0x3")]=new Z({componentDatatype:W[S("0x4d")],componentsPerAttribute:3,values:h})}for(var w,I,_=0,C=0;C<r-1;C++)c[_++]=r+C,c[_++]=r+C+1,c[_++]=C+1;for(p=1;p<a-1;p++)for(w=p*r,I=(p+1)*r,C=0;C<r-1;C++)c[_++]=I+C,c[_++]=I+C+1,c[_++]=w+C+1,c[_++]=I+C,c[_++]=w+C+1,c[_++]=w+C;for(var p=0,A=3*(r-1);p<A;p++)c[_++]=p+e/3;s=new M({attributes:o,indices:c,primitiveType:R[S("0x52")],boundingSphere:new G(P[S("0x56")],n)}),s=X[S("0x54")](s);return console[S("0x1b0")](S("0x55")),s},e[S("0x1b1")]=l},function(t,e,i){Object[S("0x1d")](e,S("0x1e"),{value:!0});var w=tt[S("0x4e")],I=tt[S("0x9")],_=tt[S("0x7")],r=tt[S("0x79")],o=(tt[S("0x2d")],tt[S("0x134")]),A=(tt[S("0xf")],tt[S("0x50")]),G=tt[S("0x6")],P=tt[S("0x1a0")],W=tt[S("0x1a1")],M=tt[S("0x5d")],Z=tt[S("0x51")],V=(new I(1,1,1),Math[S("0x66")]),R=Math[S("0x65")];function n(t){var e=(t=r(t,r[S("0x13e")]))[S("0x114")],i=t[S("0xed")],n=Math[S("0x1a2")](r(t[S("0x1a3")],10)),a=Math[S("0x1a2")](r(t[S("0x1a4")],8)),t=Math[S("0x1a2")](r(t[S("0x1b2")],128));if(n<1)throw new o(S("0x1b3"));if(a<0)throw new o(S("0x1b4"));if(t<0)throw new o(S("0x1b5"));this[S("0x113")]=e,this[S("0x115")]=i,this[S("0x1a9")]=n,this[S("0x1aa")]=a,this[S("0x1b6")]=t}n[S("0x55")]=function(t){var e=t[S("0x113")],i=t[S("0x115")];if(!(i<=0||e<=0)){for(var n,a,r,o,s=t[S("0x1a9")],l=t[S("0x1aa")],c=t[S("0x1b6")],t=c*(s+l-1),h=t-l+2,d=new Float64Array(3*h),x=W[S("0x1ae")](h,2*t),u=0,p=new Array(c),g=new Array(c),m=0;m<c;m++)n=M[S("0x1af")]*m/c,p[m]=V(n),g[m]=R(n);for(m=1;m<s;m++)for(r=V(a=e*m/(s-1)),o=R(a),v=0;v<c;v++)d[u++]=i*p[v]*o,d[u++]=i*g[v]*o,d[u++]=-i*r;for(p[S("0x2")]=l,g[S("0x2")]=l,m=0;m<l;m++)n=M[S("0x1af")]*m/l,p[m]=V(n),g[m]=R(n);for(d[u++]=0,d[u++]=0,d[u++]=-i,m=1;m<c;m++)for(r=V(a=e*m/c),o=R(a),v=0;v<l;v++)d[u++]=i*p[v]*o,d[u++]=i*g[v]*o,d[u++]=-i*r;for(m=u=0;m<s-1;++m){for(var f=m*c,v=0;v<c-1;++v)x[u++]=f+v,x[u++]=f+v+1;x[u++]=f+c-1,x[u++]=f}var b=c*(s-1);for(v=1;v<l+1;++v)x[u++]=b,x[u++]=b+v;for(m=0;m<c-2;++m){var y=m*l+1+b,C=(m+1)*l+1+b;for(v=0;v<l-1;++v)x[u++]=C+v,x[u++]=y+v;x[u++]=C+l-1,x[u++]=y+l-1}h=new P({position:new G({componentDatatype:_[S("0x4d")],componentsPerAttribute:3,values:d})});return new A({attributes:h,indices:x,primitiveType:Z[S("0x59")],boundingSphere:new w(I[S("0x56")],i)})}},e[S("0x1b7")]=n},function(t,e,i){Object[S("0x1d")](e,S("0x1e"),{value:!0});var n=tt[S("0x79")],a=tt[S("0x2d")],r=Object[S("0xa3")],o=tt[S("0x134")],s=tt[S("0x1b8")],l=tt[S("0x1b9")],c=tt[S("0x1ba")];function h(t){this[S("0x113")]=void 0,this[S("0x1bb")]=void 0,this[S("0x115")]=void 0,this[S("0x1bc")]=void 0,this[S("0x1bd")]=void 0,this[S("0x1be")]=void 0,this[S("0x1bf")]=void 0,this[S("0x1c0")]=void 0,this[S("0x1c1")]=void 0,this[S("0x1c2")]=void 0,this[S("0x78")]=void 0,this[S("0x1c3")]=void 0,this[S("0x1c4")]=void 0,this[S("0x1c5")]=void 0,this[S("0x1c1")]=void 0,this[S("0x1c2")]=void 0,this[S("0x14f")]=void 0,this[S("0x1c6")]=void 0,this[S("0x7b")]=void 0,this[S("0x1c7")]=void 0,this[S("0x1c8")]=void 0,this[S("0x1c9")]=void 0,this[S("0x1ca")]=void 0,this[S("0x1cb")]=void 0,this[S("0x1cc")]=void 0,this[S("0x1cd")]=void 0,this[S("0x1ce")]=void 0,this[S("0x1cf")]=void 0,this[S("0x1d0")]=new s,this[S("0x1d1")]=void 0,this[S("0x1d2")]=void 0,this[S("0x1d3")](n(t,n[S("0x13e")]))}r(h[S("0xa4")],{definitionChanged:{get:function(){return this[S("0x1d0")]}},show:c(S("0x7a")),angle:c(S("0x114")),radius:c(S("0xed")),stack:c(S("0x1d4")),slice:c(S("0x13f")),color:c(S("0x82")),material:l(S("0x14c")),fill:c(S("0x1d5")),outline:c(S("0x7c")),outlineColor:c(S("0x1d6")),outlineWidth:c(S("0x1d7")),shadows:c(S("0x1d8")),distanceDisplayCondition:c(S("0x1d9"))}),h[S("0xa4")][S("0x57")]=function(t){return a(t)?(t[S("0x114")]=this[S("0x114")],t[S("0xed")]=this[S("0xed")],t[S("0x1d4")]=this[S("0x1d4")],t[S("0x13f")]=this[S("0x13f")],t[S("0x7a")]=this[S("0x7a")],t[S("0x14c")]=this[S("0x14c")],t[S("0x82")]=this[S("0x82")],t[S("0x1d5")]=this[S("0x1d5")],t[S("0x7c")]=this[S("0x7c")],t[S("0x1d6")]=this[S("0x1d6")],t[S("0x1d7")]=this[S("0x1d7")],t[S("0x1d8")]=this[S("0x1d8")],t[S("0x1d9")]=this[S("0x1d9")],t[S("0x1da")]=this[S("0x1da")],t):new h(this)},h[S("0xa4")][S("0x1d3")]=function(t){if(!a(t))throw new o(S("0x1db"));this[S("0x114")]=n(this[S("0x114")],t[S("0x114")]),this[S("0xed")]=n(this[S("0xed")],t[S("0xed")]),this[S("0x1d4")]=n(this[S("0x1d4")],t[S("0x1d4")]),this[S("0x13f")]=n(this[S("0x13f")],t[S("0x13f")]),this[S("0x7a")]=n(this[S("0x7a")],t[S("0x7a")]),this[S("0x82")]=n(this[S("0x82")],t[S("0x82")]),this[S("0x14c")]=n(this[S("0x14c")],t[S("0x14c")]),this[S("0x1d5")]=n(this[S("0x1d5")],t[S("0x1d5")]),this[S("0x7c")]=n(this[S("0x7c")],t[S("0x7c")]),this[S("0x1d6")]=n(this[S("0x1d6")],t[S("0x1d6")]),this[S("0x1d7")]=n(this[S("0x1d7")],t[S("0x1d7")]),this[S("0x1d8")]=n(this[S("0x1d8")],t[S("0x1d8")]),this[S("0x1d9")]=n(this[S("0x1d9")],t[S("0x1d9")]),this[S("0x1da")]=n(this[S("0x1da")],t[S("0x1da")])},e[S("0x1dc")]=h},function(t,e,i){Object[S("0x1d")](e,S("0x1e"),{value:!0});var n=i(5);Object[S("0x1dd")](n)[S("0xae")](function(t){t!==S("0x131")&&t!==S("0x1e")&&Object[S("0x1d")](e,t,{enumerable:!0,get:function(){return n[t]}})})},function(t,e,i){var n=i(0),a=i(10),r=i(11),o=i(1),s=i(2),l=i(3),i=i(12),n=(tt.Scene[S("0x12b")]=n[S("0x12b")],tt.Scene[S("0x1de")]=a[S("0x1de")],tt.Scene[S("0x1df")]=r[S("0x1df")],tt.Scene[S("0x1b1")]=o[S("0x1b1")],tt.Scene[S("0x1b7")]=s[S("0x1b7")],tt.Scene[S("0x1dc")]=l[S("0x1dc")],tt.Scene[S("0x1e0")]=i[S("0x1e0")],tt[S("0x1e1")]),c=n[S("0x1e2")];n[S("0x1e2")]=function(t,e,i){var n=i[S("0xab")];return c(t,e,i)[S("0x18e")]([new r[S("0x1df")](t,n)])}},function(t,e){t[S("0x12d")]=S("0x1e3")},function(t,e){t[S("0x12d")]=S("0x1e4")},function(t,e){t[S("0x12d")]=S("0x1e5")},function(t,e){t[S("0x12d")]=S("0x1e6")},function(t,e,i){Object[S("0x1d")](e,S("0x1e"),{value:!0});var n=tt[S("0x79")],a=tt[S("0x2d")],r=Object[S("0xa3")],o=tt[S("0x134")],s=tt[S("0x1b8")],l=tt[S("0x1b9")],c=tt[S("0x1ba")];function h(t){this[S("0x78")]=void 0,this[S("0x115")]=void 0,this[S("0x145")]=void 0,this[S("0x147")]=void 0,this[S("0x1e7")]=void 0,this[S("0x1e8")]=void 0,this[S("0x1e9")]=void 0,this[S("0x1ea")]=void 0,this[S("0x14f")]=void 0,this[S("0x1eb")]=void 0,this[S("0x1ec")]=void 0,this[S("0x1ed")]=void 0,this[S("0x1ee")]=void 0,this[S("0x1ef")]=void 0,this[S("0x15c")]=void 0,this[S("0x1d1")]=void 0,this[S("0x1f0")]=void 0,this[S("0x1f1")]=void 0,this[S("0x1f2")]=void 0,this[S("0x1f3")]=void 0,this[S("0x1d0")]=new s,this[S("0x1d3")](n(t,n[S("0x13e")]))}r(h[S("0xa4")],{definitionChanged:{get:function(){return this[S("0x1d0")]}},show:c(S("0x7a")),radius:c(S("0xed")),xHalfAngle:c(S("0x144")),yHalfAngle:c(S("0x146")),lineColor:c(S("0x86")),showSectorLines:c(S("0x149")),showSectorSegmentLines:c(S("0x14a")),showLateralSurfaces:c(S("0x14b")),material:l(S("0x14c")),showDomeSurfaces:c(S("0x154")),showDomeLines:c(S("0x1f4")),showIntersection:c(S("0x158")),intersectionColor:c(S("0x159")),intersectionWidth:c(S("0x15a")),showThroughEllipsoid:c(S("0x15b")),gaze:c(S("0x1da")),showScanPlane:c(S("0x15d")),scanPlaneColor:c(S("0x15e")),scanPlaneMode:c(S("0x15f")),scanPlaneRate:c(S("0x161"))}),h[S("0xa4")][S("0x57")]=function(t){return(t=a(t)?t:new h)[S("0x7a")]=this[S("0x7a")],t[S("0xed")]=this[S("0xed")],t[S("0x144")]=this[S("0x144")],t[S("0x146")]=this[S("0x146")],t[S("0x86")]=this[S("0x86")],t[S("0x149")]=this[S("0x149")],t[S("0x14a")]=this[S("0x14a")],t[S("0x14b")]=this[S("0x14b")],t[S("0x14c")]=this[S("0x14c")],t[S("0x154")]=this[S("0x154")],t[S("0x157")]=this[S("0x157")],t[S("0x158")]=this[S("0x158")],t[S("0x159")]=this[S("0x159")],t[S("0x15a")]=this[S("0x15a")],t[S("0x15b")]=this[S("0x15b")],t[S("0x1da")]=this[S("0x1da")],t[S("0x15d")]=this[S("0x15d")],t[S("0x15e")]=this[S("0x15e")],t[S("0x15f")]=this[S("0x15f")],t[S("0x161")]=this[S("0x161")],t},h[S("0xa4")][S("0x1d3")]=function(t){if(!a(t))throw new o(S("0x1db"));this[S("0x7a")]=n(this[S("0x7a")],t[S("0x7a")]),this[S("0xed")]=n(this[S("0xed")],t[S("0xed")]),this[S("0x144")]=n(this[S("0x144")],t[S("0x144")]),this[S("0x146")]=n(this[S("0x146")],t[S("0x146")]),this[S("0x86")]=n(this[S("0x86")],t[S("0x86")]),this[S("0x149")]=n(this[S("0x149")],t[S("0x149")]),this[S("0x14a")]=n(this[S("0x14a")],t[S("0x14a")]),this[S("0x14b")]=n(this[S("0x14b")],t[S("0x14b")]),this[S("0x14c")]=n(this[S("0x14c")],t[S("0x14c")]),this[S("0x154")]=n(this[S("0x154")],t[S("0x154")]),this[S("0x157")]=n(this[S("0x157")],t[S("0x157")]),this[S("0x158")]=n(this[S("0x158")],t[S("0x158")]),this[S("0x159")]=n(this[S("0x159")],t[S("0x159")]),this[S("0x15a")]=n(this[S("0x15a")],t[S("0x15a")]),this[S("0x15b")]=n(this[S("0x15b")],t[S("0x15b")]),this[S("0x1da")]=n(this[S("0x1da")],t[S("0x1da")]),this[S("0x15d")]=n(this[S("0x15d")],t[S("0x15d")]),this[S("0x15e")]=n(this[S("0x15e")],t[S("0x15e")]),this[S("0x15f")]=n(this[S("0x15f")],t[S("0x15f")]),this[S("0x161")]=n(this[S("0x161")],t[S("0x161")])},e[S("0x1de")]=h},function(t,e,i){Object[S("0x1d")](e,S("0x1e"),{value:!0}),e[S("0x1df")]=void 0;var v=i(0),n=tt[S("0x1f5")],b=tt[S("0x9")],y=tt[S("0x83")],C=tt[S("0x2d")],a=tt[S("0x133")],w=tt[S("0x134")],I=tt[S("0x22")],_=tt[S("0x11")],A=tt[S("0x29")],G=tt[S("0x1f6")],P=tt[S("0xc2")],W=new I,M=(new _,new b),Z=new b,V=new A,R=new b,B=new A;function c(t,e,i){var n=e[t.id];C(n)&&(n=n[S("0x2f")],i[S("0xd2")](n),n[S("0x1f7")]()||n[S("0xb0")](),delete e[t.id])}function r(t,e){if(!C(t))throw new w(S("0x1f8"));if(!C(e))throw new w(S("0x1f9"));e[S("0x1fa")][S("0x1fb")](r[S("0xa4")][S("0x1fc")],this),this[S("0x1fd")]=t,this[S("0x1fe")]=t[S("0x9d")],this[S("0x1ff")]=e,this[S("0x200")]={},this[S("0x201")]=new n,this[S("0x1fc")](e,e[S("0x4")],[],[])}r[S("0xa4")][S("0xdb")]=function(t){if(!C(t))throw new w(S("0x202"));for(var e=this[S("0x201")][S("0x4")],i=this[S("0x200")],n=this[S("0x1fe")],a=0,r=e[S("0x2")];a<r;a++){var o,s,l,c=e[a],h=c[S("0x203")],d=i[c.id],x=c[S("0x204")]&&c[S("0x205")](t)&&P[S("0x206")](h[S("0x78")],t,!0);if(x&&(o=P[S("0xc3")](c[S("0x74")],t,M),m=P[S("0xc3")](c[S("0x207")],t,V),f=P[S("0xc3")](h[S("0x115")],t),s=P[S("0xc3")](h[S("0x145")],t),l=P[S("0xc3")](h[S("0x147")],t),x=C(o)&&C(s)&&C(l)),x){x=C(d)?d[S("0x2f")]:void 0,c=(C(x)||((x=new v[S("0x12b")]).id=c,n[S("0x9e")](x),i[c.id]=d={primitive:x,position:void 0,orientation:void 0}),P[S("0xc3")](h[S("0x1d1")],t));if(C(c)){var u=P[S("0xc3")](c[S("0x74")],t,Z);if(!C(o)||!C(u))continue;var p=b[S("0xb")](o,u,R),g=b[S("0x208")](tt[S("0x9")][S("0x209")],p),p=b[S("0xc")](tt[S("0x9")][S("0x209")],p,R),m=A[S("0x20a")](p,g-Math.PI,B),f=b[S("0x11d")](o,u);x[S("0x140")]=_[S("0x21")](I[S("0x23")](m,W),o,x[S("0x140")])}else b[S("0xba")](o,d[S("0x3")])&&A[S("0xba")](m,d[S("0xc1")])||(C(m)?(x[S("0x140")]=_[S("0x21")](I[S("0x23")](m,W),o,x[S("0x140")]),d[S("0x3")]=b[S("0x57")](o,d[S("0x3")]),d[S("0xc1")]=A[S("0x57")](m,d[S("0xc1")])):(x[S("0x140")]=tt[S("0x24")][S("0x25")](o),d[S("0x3")]=b[S("0x57")](o,d[S("0x3")])));x[S("0x7a")]=!0,x[S("0x1da")]=c,x[S("0xed")]=f,x[S("0x144")]=s,x[S("0x146")]=l,x[S("0x86")]=P[S("0x206")](h[S("0x1e7")],t,y[S("0x148")]),x[S("0x149")]=P[S("0x206")](h[S("0x1e8")],t,!0),x[S("0x14a")]=P[S("0x206")](h[S("0x1e9")],t,!0),x[S("0x14b")]=P[S("0x206")](h[S("0x1ea")],t,!0),x[S("0x14c")]=G[S("0xbf")](t,h[S("0x14f")],x[S("0x14c")]),x[S("0x154")]=P[S("0x206")](h[S("0x1eb")],t,!0),x[S("0x157")]=P[S("0x206")](h[S("0x1ec")],t,!0),x[S("0x158")]=P[S("0x206")](h[S("0x1ed")],t,!0),x[S("0x159")]=P[S("0x206")](h[S("0x1ee")],t,y[S("0x148")]),x[S("0x15a")]=P[S("0x206")](h[S("0x1ef")],t,1),x[S("0x15b")]=P[S("0x206")](h[S("0x15c")],t,!0),x[S("0x15f")]=P[S("0x206")](h[S("0x1f2")],t),x[S("0x15e")]=P[S("0x206")](h[S("0x1f1")],t,y[S("0x148")]),x[S("0x15d")]=P[S("0x206")](h[S("0x1f0")],t,!0),x[S("0x161")]=P[S("0x206")](h[S("0x1f3")],t,1)}else C(d)&&(d[S("0x2f")][S("0x7a")]=!1)}return!0},r[S("0xa4")][S("0x1f7")]=function(){return!1},r[S("0xa4")][S("0xb0")]=function(){for(var t=this[S("0x201")][S("0x4")],e=this[S("0x200")],i=this[S("0x1fe")],n=t[S("0x2")]-1;-1<n;n--)c(t[n],e,i);return a(this)},r[S("0xa4")][S("0x1fc")]=function(t,e,i,n){for(var a,r=this[S("0x201")],o=this[S("0x200")],s=this[S("0x1fe")],l=e[S("0x2")]-1;-1<l;l--)a=e[l],C(a[S("0x203")])&&C(a[S("0x74")])&&r[S("0x20b")](a.id,a);for(l=n[S("0x2")]-1;-1<l;l--)a=n[l],C(a[S("0x203")])&&C(a[S("0x74")])?r[S("0x20b")](a.id,a):(c(a,o,s),r[S("0xd2")](a.id));for(l=i[S("0x2")]-1;-1<l;l--)c(a=i[l],o,s),r[S("0xd2")](a.id)},e[S("0x1df")]=r},function(t,e,i){Object[S("0x1d")](e,S("0x1e"),{value:!0}),e[S("0x1e0")]=void 0;var y=i(1),C=i(2),n=i(13),w=(tt[S("0x79")],tt[S("0x2d")]),I=(tt[S("0x20c")],tt[S("0x24")]),a=tt[S("0x134")],_=(tt[S("0x20d")],tt[S("0x83")]),A=tt[S("0x20e")],G=tt[S("0x20f")],P=tt[S("0x9")],W=(tt[S("0x138")],tt[S("0x29")]),M=tt[S("0x22")],Z=tt[S("0x11")],V=tt[S("0xc2")];function r(t){var e=this;if(!w(t))throw new a(S("0x212"));var i=(this[S("0x213")]=t)[S("0x6a")],t=(this[S("0x1fd")]=i,t[S("0x214")]);this[S("0x215")]=t,this[S("0x1fe")]=i[S("0x9d")],this[S("0x216")]=void 0,this[S("0x217")]=void 0,this[S("0x218")]=[],t[S("0x219")][S("0x1fb")](function(){e[S("0xdb")]()})}tt[S("0x1b8")],tt[S("0x210")],tt[S("0x211")];var R=new M,B=new Z,X=new P,F=new P,T=new P,E=new W;r[S("0xa4")][S("0x9e")]=function(t){return t instanceof n[S("0x21a")]||(t=new n[S("0x21a")](t)),this[S("0x218")][S("0x4c")](t),t},r[S("0xa4")][S("0xd2")]=function(t){t=this[S("0x218")][S("0x21b")](t);-1!==t&&this[S("0x218")][S("0xdd")](t,1)},r[S("0xa4")][S("0x21c")]=function(){this[S("0x218")][S("0x2")]=0},r[S("0xa4")][S("0xdb")]=function(){var t=this[S("0x215")][S("0x21d")],e=this[S("0x218")],i=this[S("0x1fe")],n=this[S("0x216")],a=this[S("0x217")],r=[],o=[];w(n)&&i[S("0x21e")](n),w(a)&&i[S("0x21e")](a);for(var s=0,l=e[S("0x2")];s<l;s++){var c=e[s],h=c[S("0x21f")];if(V[S("0x206")](h[S("0x7a")],t,!0)){var d=h[S("0x114")],x=h[S("0xed")],u=h[S("0x1d4")],p=h[S("0x13f")];if(w(d)&&V[S("0x206")](c[S("0x7a")],t,!0)){var g=V[S("0xc3")](c[S("0x3")],t,X);if(w(g)){var m,f=h[S("0x1da")];if(w(f)){var f=V[S("0xc3")](f[S("0x3")],t,F);if(!w(g)||!w(f))continue;var v=P[S("0xb")](g,f,T),b=P[S("0x208")](tt[S("0x9")][S("0x209")],v),v=P[S("0xc")](tt[S("0x9")][S("0x209")],v,T),v=W[S("0x20a")](v,b,E),b=P[S("0x11d")](g,f),x=1,b=Z[S("0x21")](tt[S("0x22")][S("0x220")](M[S("0x23")](v,R),b,R),g,B)}else v=V[S("0xc3")](c[S("0xc1")],t,E),b=w(v)?Z[S("0x21")](M[S("0x23")](v,R),g,B):I[S("0x25")](g,void 0,B);w(b)&&(f=c[S("0x6b")],w(f)||(g=new y[S("0x1b1")]({vertexFormat:tt[S("0x138")][S("0x221")],angle:d,radius:x,stackPartitions:u,slicePartitions:p}),c[S("0x6b")]=y[S("0x1b1")][S("0x55")](g),f=c[S("0x6b")]),u=h[S("0x82")],p=h[S("0x7c")],m=h[S("0x1d7")],w(m)||(m=1),g=h[S("0x1d6")],w(g)||(g=_[S("0x148")]),h=new tt[S("0x222")]({geometry:f,modelMatrix:b,attributes:{color:tt[S("0x20d")][S("0x223")](u)}}),r[S("0x4c")](h),p)&&(f=c[S("0xd3")],w(f)||(u=new C[S("0x1b7")]({vertexFormat:tt[S("0x138")][S("0x192")],angle:d,radius:x}),c[S("0xd3")]=C[S("0x1b7")][S("0x55")](u),f=c[S("0xd3")]),h=new tt[S("0x222")]({geometry:f,modelMatrix:b,attributes:{color:tt[S("0x20d")][S("0x223")](g)}}),o[S("0x4c")](h))}}}}0<r[S("0x2")]&&(this[S("0x216")]=this[S("0x1fe")][S("0x9e")](new A({asynchronous:!1,geometryInstances:r,appearance:new G({flat:!1,translucent:!0,closed:!0})}))),0<o[S("0x2")]&&(this[S("0x217")]=this[S("0x1fe")][S("0x9e")](new A({asynchronous:!1,geometryInstances:o,appearance:new G({flat:!0,translucent:!0,renderState:{lineWidth:this[S("0x1fd")][S("0x224")](m)}})})))},e[S("0x1e0")]=r},function(t,e,i){Object[S("0x1d")](e,S("0x1e"),{value:!0}),e[S("0x21a")]=void 0;var n=i(3),a=tt[S("0x225")],r=tt[S("0x1b8")],o=tt[S("0x226")],i=tt[S("0x1ba")],s=tt[S("0x210")];function l(t){t=t||{},this[S("0x74")]=void 0,this[S("0x207")]=void 0,this[S("0x78")]=void 0;var e=t[S("0x227")];e instanceof n[S("0x1dc")]||(e=new n[S("0x1dc")](e)),this[S("0x21f")]=e,this[S("0x1ce")]=new s,this[S("0x6b")]=void 0,this[S("0xd3")]=void 0,this[S("0x1d0")]=new r,this[S("0x1d3")](t)}tt[S("0x211")],Object[S("0xa3")](l[S("0xa4")],{position:i(S("0x3"),void 0,function(t){return new o(t)}),orientation:i(S("0xc1")),show:i(S("0x7a"))}),l[S("0xa4")][S("0x1d3")]=function(t){this[S("0x3")]=t[S("0x3")],this[S("0xc1")]=t[S("0xc1")],this[S("0x7a")]=t[S("0x7a")]},l[S("0xa4")][S("0x228")]=function(t){t instanceof a&&(this[S("0x21f")][S("0x1da")]=t)},e[S("0x21a")]=l}],a={},n.m=i,n.c=a,n.d=function(t,e,i){n.o(t,e)||Object[S("0x1d")](t,e,{configurable:!1,enumerable:!0,get:i})},n.n=function(t){var e=t&&t[S("0x1e")]?function(){return t[S("0x131")]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object[S("0xa4")][S("0xa0")][S("0x130")](t,e)},n.p="",n(n.s=4);function n(t){var e;return(a[t]||(e=a[t]={i:t,l:!1,exports:{}},i[t][S("0x130")](e[S("0x12d")],e,e[S("0x12d")],n),e.l=!0,e))[S("0x12d")]}var i,a},typeof exports===S("0x12c")&&typeof module===S("0x12c")?module[S("0x12d")]=e():typeof define===S("0xbe")&&define[S("0x12e")]?define([],e):typeof exports===S("0x12c")?exports[S("0x12f")]=e():t[S("0x12f")]=e())}(),t[S("0x256")]=!0};let R=null;function X(t,e){t&&(this._viewer=t,R=e,new V(Window,R),this._customPluginLayer=new R.CustomDataSource("_customPluginLayer"),t)&&t.dataSources.add(this._customPluginLayer)}X.prototype={createRectangularSensorGraphics:function(t){var e,i;if(this._customPluginLayer&&t)return e=new R.HeadingPitchRoll(R.Math.toRadians(t.heading||90),R.Math.toRadians(t.pitch||0),R.Math.toRadians(t.roll||0)),i=t.position,this._customPluginLayer.entities.add({position:i,orientation:R.Transforms.headingPitchRollQuaternion(i,e),rectangularSensor:new R.Scene.RectangularSensorGraphics({radius:t.radius||1e5,xHalfAngle:R.Math.toRadians(t.xHalfAngle||45),yHalfAngle:R.Math.toRadians(t.yHalfAngle||45),material:t.material||new R.Color(1,0,1,.4),lineColor:t.lineColor||new R.Color(1,0,1,1),showScanPlane:t.showScanPlane||!0,scanPlaneColor:t.scanPlaneColor||new R.Color(1,0,1,1),scanPlaneMode:t.scanPlaneMode||"vertical",scanPlaneRate:t.scanPlaneRate||3,showThroughEllipsoid:t.showThroughEllipsoid||!1,show:!0})})},createSatelliteCoverageSimulationGraphics:function(t){if(t)return new R.Scene.SatelliteCoverageSimulation(this._viewer,{position:t.position,angle1:t.angle1||30,angle2:t.angle2||45,areaType:t.areaType||2,rotation:{heading:R.Math.toRadians(t.heading||0),pitch:R.Math.toRadians(t.pitch||0),roll:R.Math.toRadians(t.roll||0)},color:t.color||{red:.43137254901960786,green:.9607843137254902,blue:0,alpha:.8}})},createRadarPrimitive:function(t){if(t)return new R.Scene.RadarPrimitiveRight(this._viewer,{position:t.position,angle:t.angle||80,radius:t.radius||7e5,rotation:{heading:R.Math.toRadians(t.heading||0),pitch:R.Math.toRadians(t.pitch||40),roll:R.Math.toRadians(t.roll||0)},color:t.color||{red:1,green:0,blue:0,alpha:.4},lineColor:t.lineColor||{red:1,green:1,blue:1,alpha:.9}})}};let F,T,B=null,D={},k="move",N=null;function Y(t,e){t&&(this._viewer=t,N=t,B=e,this._installFileDragDropHandler())}Y.prototype={_installFileDragDropHandler(){function i(t,e){var i=document.createElement("div");i.id="fileDragDrop",i.classList.add("filedragdrop"),i.innerHTML="请将Json文件拖拽到此区域",this._dragBox=i,this._viewer=e,(this._parentDiv=t).appendChild(i),this.fileDragDropCallBack=void 0,this.callBackParms=void 0}i.prototype.startuploadfile=function(){var i=this,t=i._dragBox,e=null;document.ondragover=function(){clearTimeout(e),e=setTimeout(function(){t.innerHTML="请将文件拖拽到此区域"},200)},t.ondragenter=function(){t.innerHTML="请释放鼠标"},t.ondragover=function(){return!1},t.ondragleave=function(){t.innerHTML="请将文件拖拽到此区域"},t.ondrop=function(t){t.preventDefault();var t=t.dataTransfer.files[0],e=new FileReader;return e.readAsText(t,"UTF-8"),e.onload=function(){var t=JSON.parse(this.result);i.fileDragDropCallBack&&i.fileDragDropCallBack(i.callBackParms,t,i._viewer)},e.onloadstart=function(){},e.onloadend=function(){},e.onabort=function(){alert("读取数据中断")},!(e.onerror=function(){alert("读取数据失败")})}},B.Scene.FileDragDropMixin=function(t){var e=new i(document.querySelector(".cesium-viewer"),t);Object.defineProperties(t,{fileDragDropMixin:{get:function(){return e}}})}},showLoadDataToScenePanel(t){if(t=t||{}){let t=new n,a=this._viewer,e=t.addFolder("加载数据文件"),i=t=>{let e=document.createElement("input");e.type="file",e.className="datgui_upload",e.onchange=function(){"function"==typeof t&&e.files.length&&t(URL.createObjectURL(e.files[0]))},document.getElementsByTagName("body")&&document.getElementsByTagName("body")[0].appendChild(e),e.click()},r={point:()=>{i(t=>{B.GeoJsonDataSource.load(t).then(function(t){a.dataSources.add(t);for(var e=t.entities.values,i=0;i<e.length;i++){var n=e[i];n.nameID=i,n.point={color:B.Color.BLUE}}a.flyTo(t)})})},polyline:()=>{i(t=>{B.GeoJsonDataSource.load(t).then(function(t){a.dataSources.add(t);for(var e=t.entities.values,i=0;i<e.length;i++){var n=e[i];n.nameID=i,n.polyline.width=5,n.polyline.material=new B.PolylineGlowMaterialProperty({glowPower:.1,color:B.Color.ORANGERED.withAlpha(.9)})}a.flyTo(t)})})},polygon:()=>{i(t=>{B.GeoJsonDataSource.load(t).then(function(t){a.dataSources.add(t);for(var e=t.entities.values,i=0;i<e.length;i++){var n=e[i];n.nameID=i,n.polygon.width=10,n.polygon.material=B.Color.BLUE.withAlpha(.9)}a.flyTo(t)})})},model:()=>{i(t=>{a.flyTo(d3kit.createModelGraphics({position:B.Cartesian3.fromDegrees(120.38105869,31.10115627),m_url:t}))})},czml:()=>{i(t=>{a.flyTo(a.dataSources.add(B.CzmlDataSource.load(t)))})},"3dtilset":()=>{i(t=>{a.flyTo(a.scene.primitives.add(new B.Cesium3DTileset({url:t})))})}};e.add(r,"point"),e.add(r,"polyline"),e.add(r,"polygon"),e.add(r,"model"),e.add(r,"czml"),e.add(r,"3dtilset"),e.open()}},showPostProcessStagesPanel(t){t=t||{};let e=null,i=new function(){this.blackAndWhiteShow=!1,this.blackAndWhiteGradations=5,this.brightnessShow=!1,this.brightnessValue=.5,this.nightVisionShow=!1,this.silhouette=!1},a=(t&&t.elementId?(e=new n({autoPlace:!1}),document.getElementById(t.elementId).appendChild(e.domElement)):e=new n,this._viewer.scene.postProcessStages),r=a.add(B.PostProcessStageLibrary.createSilhouetteStage()),o=a.add(B.PostProcessStageLibrary.createBlackAndWhiteStage()),s=a.add(B.PostProcessStageLibrary.createBrightnessStage()),l=a.add(B.PostProcessStageLibrary.createNightVisionStage());r.uniforms.color=t.silhouetteColor||B.Color.YELLOW,r.enabled=!1,o.enabled=!1,o.uniforms.gradations=5,s.enabled=!1,s.uniforms.brightness=.5,l.enabled=!1,e.add(i,"blackAndWhiteShow").name("blackAndWhiteShow").onChange(function(t){o.enabled=t}),e.add(i,"blackAndWhiteGradations",0,10,.1).name("blackAndWhiteGradations").onChange(function(t){o.uniforms.gradations=t}),e.add(i,"brightnessShow").name("brightnessShow").onChange(function(t){s.enabled=t}),e.add(i,"brightnessValue",0,10,.1).name("brightnessValue").onChange(function(t){s.uniforms.brightness=t}),e.add(i,"nightVisionShow").name("nightVisionShow").onChange(function(t){l.enabled=t}),e.add(i,"silhouette").name("silhouette").onChange(function(t){r.enabled=t})},showSceneBloomPanel(t){let e=null,i=new function(){this.contrast=128,this.brightness=-.3,this.delta=1,this.gamma=3.5,this.enabled=!1,this.highDynamicRange=!1,this.shadows=!1,this.glowOnly=!1,this.sigma=1,this.stepSize=5},a=(t&&t.elementId?(e=new n({autoPlace:!1}),document.getElementById(t.elementId).appendChild(e.domElement)):e=new n,this._viewer),r=(e.__closeButton.innerHTML="收缩面板",a.scene.postProcessStages.bloom);e.add(i,"enabled").name("bloom").onChange(function(t){r.enabled=t}),e.add(i,"glowOnly").name("发光").onChange(function(t){r.uniforms.glowOnly=t}),e.add(i,"enabled").name("启用模糊").onChange(function(t){r.enabled=t}),e.add(i,"contrast",-255,255,.01).name("对比度").onChange(function(t){r.uniforms.contrast=t}),e.add(i,"brightness",-1,1,.01).name("光泽亮度").onChange(function(t){r.uniforms.brightness=t}),e.add(i,"delta",1,5,.01).name("因子").onChange(function(t){r.uniforms.delta=t}),e.add(i,"sigma",1,10,.01).name("sigma").onChange(function(t){r.uniforms.sigma=t}),e.add(i,"stepSize",.1,10).name("stepSize").onChange(function(t){r.uniforms.stepSize=t}),e.add(i,"shadows").name("启用阴影").onChange(function(t){a.shadows=t}),e.add(i,"highDynamicRange").name("高动态范围").onChange(function(t){a.scene.highDynamicRange=t}),e.add(i,"gamma",1,10,.01).name("伽马亮度").onChange(function(t){a.scene.gamma=t})},showPrimitiveMatrixPanel(e){let i=e.primitives._delegate||e.primitives,a=e.primitives,t=(this._viewer,null);e&&e.elementId?(t=new n({autoPlace:!1}),document.getElementById(e.elementId).appendChild(t.domElement)):t=new n;var r=t.addFolder("离地高度"),r=(r.add({height:100},"height",0,1e3,1).onChange(function(t){var e=a.boundingSphere,e=B.Cartographic.fromCartesian(e.center),i=B.Cartesian3.fromRadians(e.longitude,e.latitude,0),e=B.Cartesian3.fromRadians(e.longitude,e.latitude,t),t=B.Cartesian3.subtract(e,i,new B.Cartesian3);a.modelMatrix=B.Matrix4.fromTranslation(t)}),r.open(),t.addFolder("缩放大小")),o={"m+Scale":()=>{i.readyPromise.then(t=>{var e=t.root.transform;B.Matrix4.multiplyByUniformScale(e,1.2,e),t.root.transform=e})},"m-Scale":()=>{i.readyPromise.then(t=>{var e=t.root.transform;B.Matrix4.multiplyByUniformScale(e,.8,e),t.root.transform=e})}},o=(r.add(o,"m+Scale"),r.add(o,"m-Scale"),r.open(),{"x+Axis":()=>{var t=B.Matrix4.fromTranslation(new B.Cartesian3(20,0,0));B.Matrix4.multiply(i.modelMatrix,t,i.modelMatrix)},"x-Axis":()=>{var t=B.Matrix4.fromTranslation(new B.Cartesian3(-20,0,0));B.Matrix4.multiply(i.modelMatrix,t,i.modelMatrix)},"y+Axis":()=>{var t=B.Matrix4.fromTranslation(new B.Cartesian3(0,20,0));B.Matrix4.multiply(i.modelMatrix,t,i.modelMatrix)},"y-Axis":()=>{var t=B.Matrix4.fromTranslation(new B.Cartesian3(0,-20,0));B.Matrix4.multiply(i.modelMatrix,t,i.modelMatrix)},"z+Axis":()=>{var t=B.Matrix4.fromTranslation(new B.Cartesian3(0,0,20));B.Matrix4.multiply(i.modelMatrix,t,i.modelMatrix)},"z-Axis":()=>{var t=B.Matrix4.fromTranslation(new B.Cartesian3(0,0,-20));B.Matrix4.multiply(i.modelMatrix,t,i.modelMatrix)}}),r=t.addFolder("矩阵平移");r.add(o,"x+Axis"),r.add(o,"x-Axis"),r.add(o,"y+Axis"),r.add(o,"y-Axis"),r.add(o,"z+Axis"),r.add(o,"z-Axis"),r.open();let s={x:0,y:0,z:0},l={"x+Axis":()=>{s.x+=15,i.readyPromise.then(t=>{var e=B.Matrix3.fromRotationX(B.Math.toRadians(s.x)),e=B.Matrix4.fromRotationTranslation(e),i=B.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);B.Matrix4.multiply(i,e,i),t._root.transform=i})},"x-Axis":()=>{s.x-=15,i.readyPromise.then(t=>{var e=B.Matrix3.fromRotationX(B.Math.toRadians(s.x)),e=B.Matrix4.fromRotationTranslation(e),i=B.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);B.Matrix4.multiply(i,e,i),t._root.transform=i})},"y+Axis":()=>{s.y+=15,i.readyPromise.then(t=>{var e=B.Matrix3.fromRotationY(B.Math.toRadians(s.y)),e=B.Matrix4.fromRotationTranslation(e),i=B.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);B.Matrix4.multiply(i,e,i),t._root.transform=i})},"y-Axis":()=>{s.y-=15,i.readyPromise.then(t=>{var e=B.Matrix3.fromRotationY(B.Math.toRadians(s.y)),e=B.Matrix4.fromRotationTranslation(e),i=B.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);B.Matrix4.multiply(i,e,i),t._root.transform=i})},"z+Axis":()=>{s.z+=15,i.readyPromise.then(t=>{var e=B.Matrix3.fromRotationZ(B.Math.toRadians(s.z)),e=B.Matrix4.fromRotationTranslation(e),i=B.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);B.Matrix4.multiply(i,e,i),t._root.transform=i})},"z-Axis":()=>{s.z-=15,i.readyPromise.then(t=>{var e=B.Matrix3.fromRotationZ(B.Math.toRadians(s.z)),e=B.Matrix4.fromRotationTranslation(e),i=B.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);B.Matrix4.multiply(i,e,i),t._root.transform=i})}},c=t.addFolder("旋转矩阵");c.add(l,"x+Axis"),c.add(l,"x-Axis"),c.add(l,"y+Axis"),c.add(l,"y-Axis"),c.add(l,"z+Axis"),c.add(l,"z-Axis"),c.open(),e.cb&&((o=t.addFolder("获取调整后的模型矩阵")).add({getModelMaterix:()=>{i.readyPromise.then(t=>{t=t.root.transform;e.cb({modelTransformMatrix:t,modelMatrix:a.modelMatrix})})}},"getModelMaterix").name("获取模型矩阵"),o.open()),t.__closeButton.innerHTML="收缩面板"},showLayerParamPanel:function(e,i){if(e){let t=null;i&&i.elementId?(t=new n({autoPlace:!1}),document.getElementById(i.elementId).appendChild(t.domElement)):t=new n;var i=new function(){this.alpha=e.alpha,this.brightness=e.brightness,this.contrast=e.contrast,this.gamma=e.gamma,this.hue=e.hue,this.dayAlpha=e.dayAlpha,this.nightAlpha=e.nightAlpha,this.saturation=e.saturation},a=t.addFolder("图层调整");a.add(i,"alpha",0,1,.05).name("透明度").onChange(function(t){e.alpha=t}),a.add(i,"brightness",0,5,.05).name("亮度").onChange(function(t){e.brightness=t}),a.add(i,"contrast",0,5,.05).name("对比").onChange(function(t){e.contrast=t}),a.add(i,"gamma",0,5,.05).name("伽马").onChange(function(t){e.gamma=t}),a.add(i,"hue",0,5,.05).name("色调").onChange(function(t){e.hue=t}),a.add(i,"dayAlpha",0,1,.05).name("白天透明").onChange(function(t){e.dayAlpha=t}),a.add(i,"nightAlpha",0,1,.05).name("夜晚透明").onChange(function(t){e.nightAlpha=t}),a.add(i,"saturation",0,5,.05).name("饱和").onChange(function(t){e.saturation=t}),a.open()}},showLayerSwitchPanel:function(e,i){if(e&&e.length){let t=null;i&&i.elementId?(t=new n({autoPlace:!1}),document.getElementById(i.elementId).appendChild(t.domElement)):t=new n;var a=new function(){e.forEach(t=>{this[t.id]=t.show})},r=t.addFolder("图层切换"),o=(e.forEach(e=>{r.add(a,e.id).name(e.name).onChange(function(t){e.show=t})}),new function(){e.forEach(t=>{this[t.id]=t.alpha})}),s=t.addFolder("透明度");e.forEach(e=>{s.add(o,e.id,0,1,.05).name(e.name).onChange(function(t){e.alpha=t})}),r.open(),s.open()}},showSceneEffectEditPanel:function(t){var e,i,a;t=t||{},n&&this._viewer.scene.colorCorrection&&(a=new n,(e=this._viewer).scene.lightSource.ambientLightColor=t.ambientLightColor||new B.Color(.3,.3,.3,1),e.scene.colorCorrection.show=t.colorCorrection||!1,e.scene.colorCorrection.saturation=t.saturation||3.1,e.scene.colorCorrection.brightness=t.brightness||1.8,e.scene.colorCorrection.contrast=t.contrast||1.2,e.scene.colorCorrection.hue=t.hue||0,e.scene.bloomEffect.show=t.bloomEffect||!1,e.scene.hdrEnabled=t.hdrEnabled||!0,e.scene.bloomEffect.threshold=t.threshold||1,e.scene.bloomEffect.bloomIntensity=t.bloomIntensity||2,i=new function(){this.bloomEffectShow=t.bloomEffect||!1,this.bloomThreshold=t.threshold||1,this.bloomIntensity=t.bloomIntensity||2,this.ambientLightColor=t.ambientLightColor||.3,this.hdrEnabled=t.hdrEnabled||!0,this.colorCorrectionShow=!1,this.colorCorrectionSaturation=t.saturation||3.1,this.colorCorrectionBrightness=t.brightness||1.8,this.colorCorrectionContrast=t.contrast||1.2,this.colorCorrectionHue=t.hue||0},a=a.addFolder("场景效果"),console.log("sceneEffect:",i),a.add(i,"bloomEffectShow").name("泛光开关").onChange(function(t){e.scene.bloomEffect.show=t,e.scene.bloomEffect.threshold=i.bloomThreshold,e.scene.bloomEffect.bloomIntensity=i.bloomIntensity}),a.add(i,"bloomThreshold",0,1,.1).name("泛光阈值").onChange(function(t){e.scene.bloomEffect.threshold=t}),a.add(i,"bloomIntensity",0,10,.1).name("泛光强度").onChange(function(t){e.scene.bloomEffect.bloomIntensity=t}),a.add(i,"hdrEnabled").name("HDR开关").onChange(function(t){e.scene.hdrEnabled=t}),a.add(i,"colorCorrectionShow").name("颜色校正").onChange(function(t){e.scene.colorCorrection.show=t}),a.add(i,"colorCorrectionSaturation",0,5,.1).name("饱和度").onChange(function(t){e.scene.colorCorrection.saturation=t}),a.add(i,"colorCorrectionBrightness",0,5,.1).name("亮度").onChange(function(t){e.scene.colorCorrection.brightness=t}),a.add(i,"colorCorrectionContrast",0,5,.1).name("对比度").onChange(function(t){e.scene.colorCorrection.contrast=t}),a.add(i,"colorCorrectionHue",0,5,.1).name("色调").onChange(function(t){e.scene.hdrEnabled=t}),a.add(i,"colorCorrectionHue",0,1,.1).name("环境光").onChange(function(t){e.scene.lightSource.ambientLightColor=new B.Color(t,t,t,1)}),a.open())},showEntityOrientationEditPanel:function(i={}){if(i.entity){let e=i.entity;var t=new n,a=(i&&i.elementId?(t=new n({autoPlace:!1}),document.getElementById(i.elementId).appendChild(t.domElement)):t=new n,new function(){this.heading=360,this.pitch=1,this.roll=1}),t=t.addFolder("实体姿态调整"),r=this;t.add(a,"heading",0,360,1).name("角度").onChange(function(t){a.heading=t;t=B.Transforms.headingPitchRollQuaternion(e.position.getValue(r._viewer.clock.currentTime),new B.HeadingPitchRoll(B.Math.toRadians(a.heading),B.Math.toRadians(a.pitch),B.Math.toRadians(a.roll)));e.orientation=t,i.cb&&i.cb({orientation:t})}),t.add(a,"pitch",0,360,1).name("航向").onChange(function(t){a.pitch=t;t=B.Transforms.headingPitchRollQuaternion(e.position.getValue(r._viewer.clock.currentTime),new B.HeadingPitchRoll(B.Math.toRadians(a.heading),B.Math.toRadians(a.pitch),B.Math.toRadians(a.roll)));e.orientation=t,i.cb&&i.cb({orientation:t})}),t.add(a,"roll",0,360,1).name("翻转").onChange(function(t){a.roll=t;t=B.Transforms.headingPitchRollQuaternion(e.position.getValue(r._viewer.clock.currentTime),new B.HeadingPitchRoll(B.Math.toRadians(a.heading),B.Math.toRadians(a.pitch),B.Math.toRadians(a.roll)));e.orientation=t,i.cb&&i.cb({orientation:t})}),t.open()}},definedMouseEvent({targetEntity:t,ctrlFlag:e}){T=t,D=e,this.bindHandelEvent({leftDown:this.defLeftDown,mouseMove:this.defMouseMove,mouseWheel:this.defMouseWheel,leftUp:this.defLeftUp})},defMouseMove(e){if(D.leftDown&&F){let t=N.camera.getPickRay(e.endPosition),a=N.scene.globe.pick(t,N.scene);if(document.body.style.cursor="pointer",F&&F.id&&"move"===k){let t=B.JulianDate.fromDate(new Date),e=T.position.getValue(t),i=B.Cartographic.fromCartesian(e),n=Number(i.height.toFixed(3));T.position=new B.CallbackProperty(()=>{var t=N.scene.globe.ellipsoid.cartesianToCartographic(a),e=B.Math.toDegrees(t.longitude),t=B.Math.toDegrees(t.latitude);return B.Cartesian3.fromDegrees(e,t,n)},!1)}else{var i,n,r;F&&F.id&&"rotate"===k&&(n=B.JulianDate.fromDate(new Date),n=T.position.getValue(n),r=N.scene.camera.pickEllipsoid(e.startPosition),e=N.scene.camera.pickEllipsoid(e.endPosition),i=B.Cartesian3.subtract(n,e,new B.Cartesian3),i=B.Cartesian3.normalize(i,new B.Cartesian3),r=B.Cartesian3.subtract(r,n,new B.Cartesian3),e=B.Cartesian3.subtract(e,n,new B.Cartesian3),n=B.Cartesian3.angleBetween(r,e),r=B.Quaternion.fromAxisAngle(i,100*n),T.orientation=r)}}},defLeftDown(t){F=N.scene.pick(t.position),B.defined(F)&&k?(D.selected=!0,D.leftDown=!0):D.selected=!1},defMouseWheel(n){if(F&&F.id&&"scale"===k){let t=B.JulianDate.fromDate(new Date),e=T.box.dimensions.getValue(t),i=0<n?2:.5;T.box.dimensions=new B.CallbackProperty(()=>B.Cartesian3.multiplyByScalar(e,i,new B.Cartesian3),!1)}},defLeftUp(t){D.leftDown=!1,document.body.style.cursor="default"},manualMoveModel:function(t){k=t,this._viewer.scene.screenSpaceCameraController.enableRotate=!1,this._viewer.scene.screenSpaceCameraController.enableZoom=!0},manualRotateModel:function(t){k=t,this._viewer.scene.screenSpaceCameraController.enableRotate=!1,this._viewer.scene.screenSpaceCameraController.enableZoom=!0},manualScaleModel:function(t){k=t,this._viewer.scene.screenSpaceCameraController.enableZoom=!1}};let E=null;function z(t,e,i){t&&(this._viewer=t,E=e,this._pluginLayer=new E.CustomDataSource("pluginLayer"),t&&t.dataSources.add(this._pluginLayer),this._installPlugin())}z.prototype={_installPlugin:function(){this._installCss3Renderer(),this._installGroundSkyBox(),this._installTerrainClipPlan()},_installTerrainClipPlan:function(){function t(t,e){this.viewer=t,this.options=e||{},this._positions=e.positions,this._height=this.options.height||0,this.bottomImg=e.bottomImg,this.wallImg=e.wallImg,this.splitNum=E.defaultValue(e.splitNum,50),this._positions&&0<this._positions.length&&this.updateData(this._positions)}Object.defineProperties(t.prototype,{show:{get:function(){return this._show},set:function(t){this._show=t,this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=t),this._switchExcavate(t)}},height:{get:function(){return this._height},set:function(t){this._height=t,this._updateExcavateDepth(t)}}}),t.prototype.updateData=function(t){var e=[],i=t.length-1,n=new E.Cartesian3,a=0<E.Cartesian3.subtract(t[0],t[1],n).x;this.excavateMinHeight=9999;for(var r=0;r<i;r++){var o=(r+1)%i,s=E.Cartesian3.midpoint(t[r],t[o],new E.Cartesian3),l=E.Cartographic.fromCartesian(t[r]),l=this.viewer.scene.globe.getHeight(l)||l.height;l<this.excavateMinHeight&&(this.excavateMinHeight=l);l=E.Cartesian3.normalize(s,new E.Cartesian3),o=a?E.Cartesian3.subtract(t[r],s,new E.Cartesian3):E.Cartesian3.subtract(t[o],s,new E.Cartesian3),o=(o=E.Cartesian3.normalize(o,o),E.Cartesian3.cross(o,l,new E.Cartesian3)),o=E.Cartesian3.normalize(o,o),l=new E.Plane(o,0),l=E.Plane.getPointDistance(l,s);e.push(new E.ClippingPlane(o,l))}this.viewer.scene.globe.clippingPlanes=new E.ClippingPlaneCollection({planes:e,edgeWidth:1,edgeColor:E.Color.WHITE,enabled:!0}),this._prepareWell(t),this._createWell(this.wellData)},t.prototype.clear=function(){this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=!1,this.viewer.scene.globe.clippingPlanes.removeAll(),this.viewer.scene.globe.clippingPlanes.isDestroyed()||this.viewer.scene.globe.clippingPlanes.destroy()),this.viewer.scene.globe.clippingPlanes=void 0,this.bottomSurface&&this.viewer.scene.primitives.remove(this.bottomSurface),this.wellWall&&this.viewer.scene.primitives.remove(this.wellWall),delete this.bottomSurface,delete this.wellWall,this.viewer.scene.render()},t.prototype._prepareWell=function(t){var e=this.splitNum,i=t.length;if(0!=i){for(var n=this.excavateMinHeight-this.height,a=[],r=[],o=[],s=0;s<i;s++){var l=s==i-1?0:s+1,c=E.Cartographic.fromCartesian(t[s]),l=E.Cartographic.fromCartesian(t[l]),h=[c.longitude,c.latitude],d=[l.longitude,l.latitude];0==s&&(o.push(new E.Cartographic(h[0],h[1])),r.push(E.Cartesian3.fromRadians(h[0],h[1],n)),a.push(E.Cartesian3.fromRadians(h[0],h[1],0)));for(var x=1;x<=e;x++){var u=E.Math.lerp(h[0],d[0],x/e),S=E.Math.lerp(h[1],d[1],x/e);s==i-1&&x==e||(o.push(new E.Cartographic(u,S)),r.push(E.Cartesian3.fromRadians(u,S,n)),a.push(E.Cartesian3.fromRadians(u,S,0)))}}this.wellData={lerp_pos:o,bottom_pos:r,no_height_top:a}}},t.prototype._createWell=function(r){var o,t;this.viewer.terrainProvider._layers?((o=this)._createBottomSurface(r.bottom_pos),t=E.sampleTerrainMostDetailed(this.viewer.terrainProvider,r.lerp_pos),E.when(t,function(t){for(var e=t.length,i=[],n=0;n<e;n++){var a=E.Cartesian3.fromRadians(t[n].longitude,t[n].latitude,t[n].height);i.push(a)}o._createWellWall(r.bottom_pos,i)})):(this._createBottomSurface(r.bottom_pos),this._createWellWall(r.bottom_pos,r.no_height_top))},t.prototype._getMinHeight=function(e){let i=5e6,n=null;for(let t=0;t<e.length;t++){var a=e[t].z;a<i&&(i=a,n=this._ellipsoidToLonLat(e[t]))}return n.altitude},t.prototype._ellipsoidToLonLat=function(t){var e=this.viewer.scene.globe.ellipsoid,t=new E.Cartesian3(t.x,t.y,t.z),e=e.cartesianToCartographic(t),t=E.Math.toDegrees(e.latitude);return{longitude:E.Math.toDegrees(e.longitude),latitude:t,altitude:e.height}},t.prototype._createBottomSurface=function(e){if(e.length){var i=this._getMinHeight(e),n=[];for(let t=0;t<e.length;t++){var a=this._ellipsoidToLonLat(e[t]);n.push(a.longitude),n.push(a.latitude),n.push(i)}var t=new E.PolygonGeometry({polygonHierarchy:new E.PolygonHierarchy(E.Cartesian3.fromDegreesArrayHeights(n)),perPositionHeight:!0}),t=E.PolygonGeometry.createGeometry(t),r=new E.Material({fabric:{type:"Image",uniforms:{image:this.bottomImg}}}),r=new E.MaterialAppearance({translucent:!1,flat:!0,material:r});this.bottomSurface=new E.Primitive({geometryInstances:new E.GeometryInstance({geometry:t}),appearance:r,asynchronous:!1}),this.viewer.scene.primitives.add(this.bottomSurface)}},t.prototype._createWellWall=function(t,e){var i=this._getMinHeight(t),n=[],a=[];for(let t=0;t<e.length;t++)n.push(this._ellipsoidToLonLat(e[t]).altitude),a.push(i);var t=new E.WallGeometry({positions:e,maximumHeights:n,minimumHeights:a}),t=E.WallGeometry.createGeometry(t),r=new E.Material({fabric:{type:"Image",uniforms:{image:this.wallImg}}}),r=new E.MaterialAppearance({translucent:!1,flat:!0,material:r});this.wellWall=new E.Primitive({geometryInstances:new E.GeometryInstance({geometry:t,attributes:{color:E.ColorGeometryInstanceAttribute.fromColor(E.Color.GREY)},id:"PitWall"}),appearance:r,asynchronous:!1}),this.viewer.scene.primitives.add(this.wellWall)},t.prototype._switchExcavate=function(t){t?(this.viewer.scene.globe.material=E.Material.fromType("WaJue"),this.wellWall.show=!0,this.bottomSurface.show=!0):(this.viewer.scene.globe.material=null,this.wellWall.show=!1,this.bottomSurface.show=!1)},t.prototype._updateExcavateDepth=function(t){this.bottomSurface&&this.viewer.scene.primitives.remove(this.bottomSurface),this.wellWall&&this.viewer.scene.primitives.remove(this.wellWall);for(var e=this.wellData.lerp_pos,i=[],n=e.length,a=0;a<n;a++)i.push(E.Cartesian3.fromRadians(e[a].longitude,e[a].latitude,this.excavateMinHeight-t));this.wellData.bottom_pos=i,this._createWell(this.wellData),this.viewer.scene.primitives.add(this.bottomSurface),this.viewer.scene.primitives.add(this.wellWall)},E.Scene.TerrainClipPlan=t},buildLightScanGraphics:function(t){if(this._viewer&&t){function e(e,t,i){var n,a,r,o,s,l,c=e.positionList,h=0,d=0;function x(t){n=c[t+1][0]-c[t][0],a=c[t+1][1]-c[t][1],r=n/e.number,o=a/e.number,d=0}x(h),t.polygon.hierarchy=new E.CallbackProperty(function(){return Math.abs(s)>=Math.abs(n)&&Math.abs(l)>=Math.abs(a)&&((h+=1)===c.length-1&&(h=0),i[0]=i[0]+s,i[1]=i[1]+l,i[2]=i[2]+s,i[3]=i[3]+l,x(h)),s=d*r,l=d*o,d++,new E.PolygonHierarchy(E.Cartesian3.fromDegreesArrayHeights([e.observer[0],e.observer[1],e.observer[2],i[0]+s,i[1]+l,0,i[2]+s,i[3]+l,0]))},!1)}for(var l=this,i=l._getCirclePoints(t.circle[0],t.circle[1],t.circle[2],t.circle[3]),n=function(t,e){for(var i=e.observer[0],n=e.observer[1],a=e.observer[2],r=[],o=0;o<t.length;o++){var s=o===t.length-1?new E.PolygonHierarchy(E.Cartesian3.fromDegreesArrayHeights([i,n,a,t[o].x,t[o].y,0,t[0].x,t[0].y,0])):new E.PolygonHierarchy(E.Cartesian3.fromDegreesArrayHeights([i,n,a,t[o].x,t[o].y,0,t[o+1].x,t[o+1].y,0])),s=l._pluginLayer.entities.add({name:"三角形",polygon:{hierarchy:s,outline:!1,perPositionHeight:!0,material:e.material}});r.push(s)}return r}(i,t),a=0;a<n.length;a++)a!==n.length-1?e(t,n[a],[i[a].x,i[a].y,i[a+1].x,i[a+1].y]):e(t,n[a],[i[a].x,i[a].y,i[0].x,i[0].y]);return n}},buildPathRoaming:function(t){if(this._viewer&&t&&t.paths){var e=t.paths,i=new E.SampledPositionProperty,n=this.createGraphics(),a=new E.JulianDate,r=E.JulianDate.addSeconds(a,e[e.length-1].time,new E.JulianDate),o=t.startTime||a,a=t.stopTime||r;this._viewer.clock.startTime=o.clone(),this._viewer.clock.currentTime=o.clone(),this._viewer.clock.stopTime=a.clone(),this._viewer.clock.multiplier=t.multiplier||10,this._viewer.clock.clockRange=t.clockRange||E.ClockRange.CLAMPED;for(var s=0;s<e.length;s++){var l=E.Cartesian3.fromDegrees(e[s].lon,e[s].lat,e[s].alt),c=E.JulianDate.addSeconds(o,e[s].time,new E.JulianDate);i.addSample(c,l)}n.name=t.name||"路径漫游",n.availability=new E.TimeIntervalCollection([new E.TimeInterval({start:o,stop:a})]),n.position=i,n.orientation=new E.VelocityOrientationProperty(i);var h=[];return t.polyline&&(n.polyline={positions:new E.CallbackProperty(function(){return h},!1),width:10,material:new E.PolylineGlowMaterialProperty({glowPower:1,color:E.Color.RED}),clampToGround:!0}),t.model&&(n.model=this.getModelGraphics(t)),t.label&&(n.label=this.getLabelGraphics(t)),t.billboard&&(n.billboard=this.getBillboardGraphics(t)),this._viewer.entities.add(n)}},_installCss3Renderer:function(){function t(t,e){this._scratch=new E.Cartesian2,this._viewer=i,this._scene=i.scene,this._camera=i.camera,this._container=null,this._elements=t,this._isBackHide=e,this.init()}var i;this._viewer&&(i=this._viewer,t.prototype.init=function(){var a=document.createElement("div"),r=(a.className="ys-css3-container",document.getElementById("info-warp").appendChild(a),this._container=a,this._elements.forEach(function(t){a.insertAdjacentHTML("beforeend",t.element)}),this);this._scene.preRender.addEventListener(function(){for(var t=0;t<a.children.length;t++){var e,i=E.Cartesian3.fromDegrees(r._elements[t].position[0],r._elements[t].position[1],r._elements[t].position[2]||0),n=r._scene.cartesianToCanvasCoordinates(i,r._scratch);E.defined(n)&&(a.children[t].style.left=parseFloat(n.x)+parseFloat(r._elements[t].offset[0])+"px",a.children[t].style.top=parseFloat(n.y)+parseFloat(r._elements[t].offset[1])+"px",r._isBackHide)&&(n=r._camera.position,e=r._scene.globe.ellipsoid.cartesianToCartographic(n).height,e+=+r._scene.globe.ellipsoid.maximumRadius,E.Cartesian3.distance(n,i)>e?a.children[t].style.display="none":a.children[t].style.display="block")}})},t.prototype.remove=function(t){this._elements=this._elements.filter(function(t){t.id}),this._container.removeChild(document.getElementById(t))},t.prototype.append=function(t){this._elements.push(t),this._container.insertAdjacentHTML("beforeend",t.element)},t.prototype.removeEntityLayer=function(t){this._viewer.entities.removeById(t+"_1"),this._viewer.entities.removeById(t+"_2"),this._viewer.entities.removeById(t+"_3"),this.remove(t)},t.prototype.addEntityLayer=function(t){var e=t.position[0],i=t.position[1],n=this,a=(setTimeout(function(t){},300),E.Math.toRadians(30)),r=E.Math.toRadians(30),o=t.boxHeight||300,s=t.boxHeightMax||400,l=t.boxHeightDif||10,c=!0;t.boxShow?this._viewer.entities.add({id:t.id+"_1",name:"立方体盒子",position:new E.CallbackProperty(function(){return(o+=l)>=s&&(o=s),E.Cartesian3.fromDegrees(e,i,o/2)},!1),box:{dimensions:new E.CallbackProperty(function(){return(o+=l)>=s&&(o=s,c)&&(c=!1,n.append(t,!0)),new E.Cartesian3(t.boxSide||100,t.boxSide||100,o)},!1),material:t.boxMaterial||E.Color.DEEPSKYBLUE.withAlpha(.5)}}):setTimeout(function(){n.append(t,!0)},100),t.circleShow&&(t.circleSize=t.circleSize||120,this._viewer.entities.add({id:t.id+"_2",name:"椭圆",position:E.Cartesian3.fromDegrees(e,i),ellipse:{semiMinorAxis:new E.CallbackProperty(function(){return.001},!1),semiMajorAxis:new E.CallbackProperty(function(){return.001},!1),material:this.getDfSt(["plugin","Css3Renderer_one"])||"static/data/images/Textures/circle2.png",rotation:new E.CallbackProperty(function(){return a+=.05},!1),stRotation:new E.CallbackProperty(function(){return a+=.05},!1),zIndex:2}}),this._viewer.entities.add({id:t.id+"_3",name:"椭圆",position:E.Cartesian3.fromDegrees(e,i),ellipse:{semiMinorAxis:new E.CallbackProperty(function(){return.001},!1),semiMajorAxis:new E.CallbackProperty(function(){return.001},!1),material:this.getDfSt(["plugin","Css3Renderer_two"])||"static/data/images/Textures/circle1.png",rotation:new E.CallbackProperty(function(){return r-=.03},!1),stRotation:new E.CallbackProperty(function(){return r-=.03},!1),zIndex:3}}))},E.Scene.Css3Renderer=t)},_installGroundSkyBox:function(){var o=E.BoxGeometry,s=E.Cartesian3,e=E.defaultValue,l=E.defined,i=E.destroyObject,c=E.DeveloperError,h=E.GeometryPipeline,t=E.Matrix3,d=E.Matrix4,x=E.Transforms,u=E.VertexFormat,S=E.BufferUsage,p=E.CubeMap,n=E.DrawCommand,g=E.loadCubeMap,m=E.RenderState,f=E.VertexArray,v=E.BlendingState,b=E.SceneMode,y=E.ShaderProgram,C=E.ShaderSource;function a(t){this.sources=t.sources,this._sources=void 0,this.show=e(t.show,!0),this._command=new n({modelMatrix:d.clone(d.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}l(d.getRotation)||(d.getRotation=d.getMatrix3);var w=new t;a.prototype.update=function(t,e){var i=this;if(this.show&&(t.mode===b.SCENE3D||t.mode===b.MORPHING)&&t.passes.render){var n=t.context;if(this._sources!==this.sources){this._sources=this.sources;var a=this.sources;if(!(l(a.positiveX)&&l(a.negativeX)&&l(a.positiveY)&&l(a.negativeY)&&l(a.positiveZ)&&l(a.negativeZ)))throw new c("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof a.positiveX!=typeof a.negativeX||typeof a.positiveX!=typeof a.positiveY||typeof a.positiveX!=typeof a.negativeY||typeof a.positiveX!=typeof a.positiveZ||typeof a.positiveX!=typeof a.negativeZ)throw new c("this.sources properties must all be the same type.");"string"==typeof a.positiveX?g(n,this._sources).then(function(t){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=t}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new p({context:n,source:a}))}var r=this._command;if(r.modelMatrix=x.eastNorthUpToFixedFrame(t.camera._positionWC),l(r.vertexArray)||(r.uniformMap={u_cubeMap:function(){return i._cubeMap},u_rotateMatrix:function(){return d.getRotation(r.modelMatrix,w)}},a=o.createGeometry(o.fromDimensions({dimensions:new s(2,2,2),vertexFormat:u.POSITION_ONLY})),t=this._attributeLocations=h.createAttributeLocations(a),r.vertexArray=f.fromGeometry({context:n,geometry:a,attributeLocations:t,bufferUsage:S._DRAW}),r.renderState=m.fromCache({blending:v.ALPHA_BLEND})),l(r.shaderProgram)&&this._useHdr===e||(a=new C({defines:[e?"HDR":""],sources:["uniform samplerCube u_cubeMap;\n in vec3 v_texCoord;\n void main()\n {\n vec4 color = texture(u_cubeMap, normalize(v_texCoord));\n out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n }\n "]}),r.shaderProgram=y.fromCache({context:n,vertexShaderSource:"in vec3 position;\n out vec3 v_texCoord;\n uniform mat3 u_rotateMatrix;\n void main()\n {\n vec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\n gl_Position = czm_projection * vec4(p, 1.0);\n v_texCoord = position.xyz;\n }\n ",fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=e),l(this._cubeMap))return r}},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){var t=this._command;return t.vertexArray=t.vertexArray&&t.vertexArray.destroy(),t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),i(this)},E.Scene.GroundSkyBox=a}};let L=null;function U(t,e,i){t&&(L=e,this._analysisLayer=new L.CustomDataSource("analysisLayer"),this.$math3d=new y(t,e),this.$graphics=new c(t,e),t)&&t.dataSources.add(this._analysisLayer)}function H(t){if(t&&t.positions){var e=t.positions,i=t.that,n=[],t=[],a=[],r=i.transformWGS84ToCartesian(e[0]),e=i.transformWGS84ToCartesian(e[1]),n=i.$graphics.createPointsGraphics({point:!0,positions:[r,e]}),o=i.$math3d.getIntersectObj(r,e,n,!0);if(0===o.length)return alert("没有取到相交点 , 请检查是否开启深度检测。"),!1;for(let t=o.length-1;0<=t;t--){const l=o[t];L.defined(l.position)||o.splice(t,1)}if(!L.defined(o[0].position))throw new L.DeveloperError("position is undefined");var s=o[0].position,l=L.Cartesian3.distance(s,e)<5,s=[r,o[0].position],s=i._analysisLayer.entities.add({polyline:{positions:s,width:10,arcType:L.ArcType.NONE,material:new L.PolylineArrowMaterialProperty(L.Color.GREEN)}});t.push(s),l||(s=[o[0].position,e],s=i._analysisLayer.entities.add({polyline:{positions:s,width:10,arcType:L.ArcType.NONE,material:new L.PolylineArrowMaterialProperty(L.Color.RED)}}),t.push(s));for(let t=0;t<o.length;++t){var c,h=o[t].object;h&&(h instanceof L.Cesium3DTileFeature?(a.push(h),h.oldColor=h.color.clone(),h.color=L.Color.fromAlpha(L.Color.YELLOW,h.color.alpha)):h.id instanceof L.Entity&&(c=(h=h.id).polygon||h.polyline,a.push(h),h=c.material.color.getValue(),c.oldColor=h.clone(),c.material=L.Color.fromAlpha(L.Color.YELLOW,h.alpha))),n.push(i._analysisLayer.entities.add({position:o[t].position,ellipsoid:{radii:new L.Cartesian3(.8,.8,.8),material:L.Color.RED}}))}var s=L.Cartographic.fromCartesian(r),t=L.Cartographic.fromCartesian(e),s={longitude:s.longitude/Math.PI*180,latitude:s.latitude/Math.PI*180,height:s.height},t={longitude:t.longitude/Math.PI*180,latitude:t.latitude/Math.PI*180,height:t.height},r=Math.sqrt(Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2)+Math.pow(r.z-e.z,2)),e=Math.abs(t.height-s.height),d=Math.sqrt(Math.pow(r,2)+Math.pow(e,2)),l=l?"是":"否",s="起点坐标: ("+s.longitude.toFixed(6)+"°,"+s.latitude.toFixed(6)+"°,"+s.height.toFixed(2)+")\n终点坐标: ("+t.longitude.toFixed(6)+"°,"+t.latitude.toFixed(6)+"°,"+t.height.toFixed(2)+")\n垂直距离: "+e.toFixed(2)+"m\n水平距离: "+r.toFixed(2)+"m\n空间距离: "+d.toFixed(2)+"m\n是否可视: "+l;n&&n[0]&&(n[0].label={text:s,showBackground:!0,font:"14px monospace",fillColor:L.Color.YELLOW,pixelOffset:{x:0,y:-20},verticalOrigin:L.VerticalOrigin.BOTTOM,horizontalOrigin:L.HorizontalOrigin.LEFT})}H.prototype.remove=function(){}}function Q(t){if(!t&&!t.center&&!t.radius&&t.that)return alert("没有获取到分析参数"),!1;var l=t.that,e=this;if(!l._viewer.scene.globe.depthTestAgainstTerrain)return alert("请开启深度检测"),!1;var c=t.viewHeight||10,i=L.Cartographic.fromCartesian(t.center);try{var n=t.radius,a={},r=(a.semiMinorAxis=n,a.semiMajorAxis=n,a.rotation=0,a.center=t.center,a.granularity=Math.PI/45,l.computeEllipseEdgePositions(a));for(let t=0;t<r.outerPositions.length;t+=3){var o=new L.Cartesian3(r.outerPositions[t],r.outerPositions[t+1],r.outerPositions[t+2]),s=L.Cartographic.fromCartesian(o),h=5e-5*Math.PI/180,d=l.computeInterpolateLineCartographic(i,s,h);l.computeCartographicPointsTerrainData(d,function(r){if(0<r.length){let i=!0,n=[],a=[];for(let t=1;t<r.length;t++){let e=!0;if(1<t){var o=new L.Cartographic(r[0].longitude,r[0].latitude,r[0].height+c);if(i)e=l.computeInterpolateIndexLineHeightCartographic(o,r[t],t,t-1).height>=r[t-1].height?i=!0:i=!1;else{var s=l.computeInterpolateIndexLineHeightCartographic(o,r[t],t,t-1);for(let t=0;t<s.length;t++){if(!(s[t].height>=r[t].height)){i=!1,e=!1;break}i=!0,e=!0}}}o=L.Cartesian3.fromRadians(r[t].longitude,r[t].latitude,r[t].height+1);n.push(o),e?(a.push(0),a.push(0),a.push(1)):(a.push(1),a.push(0),a.push(0)),a.push(1)}e._pointsKSYResult=new L.Scene.PointsPrimitive({viewer:l._viewer,Cartesians:n,Colors:a})}else alert("高程异常!")})}}catch(t){console.log(t)}Q.prototype.remove=function(){}}function J(t){if(t&&t.positions){for(var e=t.positions,i=t.that,n=i.transformWGS84ToCartesian(e[0]),a=i.transformWGS84ToCartesian(e[1]),o=[L.Cartographic.fromCartesian(n)],s=new L.Cartesian3,l=[0],c=[0],h=1;h<=10;h++){L.Cartesian3.lerp(n,a,h/10,s);var d=L.Cartographic.fromCartesian(s),x=i._viewer.scene.globe.getHeight(d),x=(d.height=x,o.push(d),o[h-1]),u=L.Cartesian3.distance(L.Cartographic.toCartesian(x),L.Cartographic.toCartesian(d));c.push(c[h-1]+u),d=Math.asin((d.height-x.height)/u),l.push(100*Math.tan(d))}t=document.createElement("div"),e=(t.className="echart-viewer",i._viewer.container.appendChild(t,"dark",{renderer:"canvas",width:640,height:480}),t.style.position="absolute",t.style.left="20px",t.style.bottom="20px",t.style.height="300px",t.style.width="640px",t.style.overflow="hidden",t.style.zIndex="9999",{title:{text:"剖面示意图",left:"center",subtext:"",textStyle:{color:"white",fontSize:15}},tooltip:{trigger:"axis"},legend:{data:[""]},toolbox:{show:!(t.style.opacity=.9),feature:{mark:{show:!0},dataView:{show:!0,readOnly:!1},magicType:{show:!0,type:["line","bar"]},restore:{show:!0},saveAsImage:{show:!0}}},calculable:!0,xAxis:[{type:"category",name:"长度(米)",boundaryGap:!1,data:c,axisLabel:{textStyle:{color:"white"}},axisLine:{lineStyle:{color:"white"}}}],yAxis:[{type:"value",name:"坡度(%)",axisLabel:{formatter:function(t){return t.toFixed(2)+"%"},textStyle:{color:"white"}},axisLine:{lineStyle:{color:"white"}}}],series:[{name:"坡度",type:"line",areaStyle:{},smooth:!0,data:l,markPoint:{data:[{type:"max",name:"最大值"},{type:"min",name:"最小值"}]},markLine:{data:[{type:"average",name:"平均值"}]}}]});r.init(t).setOption(e)}}function O(t){if(t&&t.positions&&t.that){var e=t.that,i=t.positions,t=this,n=e._viewer.terrainProvider.availability;if(n){for(var a=15e3,r=0;r<i.length;r++){var o=L.Cartographic.fromCartesian(i[r]),s=e._viewer.scene.globe.getHeight(o);s<a&&(a=s),n.computeMaximumLevelAtPosition(o)}var l=Math.PI/Math.pow(2,11);l/=64;for(var c,h,d,x,u,S,p,g,l=new L.PolygonGeometry.fromPositions({positions:i,vertexFormat:L.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:l}),m=new L.PolygonGeometry.createGeometry(l),f=0,v=0,b=new L.Cartesian3,r=0;r<m.indices.length;r+=3){c=m.indices[r],h=m.indices[r+1],u=m.indices[r+2],S=m.attributes.position.values,b.x=S[3*c],b.y=S[3*c+1],b.z=S[3*c+2],o=L.Cartographic.fromCartesian(b),c=e._viewer.scene.globe.getHeight(o),d=L.Cartesian3.fromRadians(o.longitude,o.latitude,c),p=L.Cartesian3.fromRadians(o.longitude,o.latitude,0),v<c&&(v=c),b.x=S[3*h],b.y=S[3*h+1],b.z=S[3*h+2],o=L.Cartographic.fromCartesian(b),h=e._viewer.scene.globe.getHeight(o),x=L.Cartesian3.fromRadians(o.longitude,o.latitude,h),C=L.Cartesian3.fromRadians(o.longitude,o.latitude,0),v<h&&(v=h),b.x=S[3*u],b.y=S[3*u+1],b.z=S[3*u+2],o=L.Cartographic.fromCartesian(b),S=e._viewer.scene.globe.getHeight(o),u=L.Cartesian3.fromRadians(o.longitude,o.latitude,S),v<S&&(v=S),f+=(p=p,C=C,g=L.Cartesian3.fromRadians(o.longitude,o.latitude,0),y=void 0,y=L.Cartesian3.distance(p,C),C=L.Cartesian3.distance(C,g),g=L.Cartesian3.distance(g,p),p=(y+C+g)/2,Math.sqrt(p*(p-y)*(p-C)*(p-g))*(c-a+h-a+S-a)/3);var y=[],C=(y.push(d),y.push(x),y.push(u),{polygon:{hierarchy:{positions:y},extrudedHeight:0,perPositionHeight:!0,material:L.Color.fromRandom().withAlpha(.5),outline:!0,closeTop:!0,closeBottom:!0,outlineColor:L.Color.WHITE,outlineWidth:2}});e._analysisLayer.entities.add(C)}l=function(t){for(var e=[],i=[],n=0;n<t.length;n++){var a=L.Cartographic.fromCartesian(t[n]);e.push(a.longitude),i.push(a.latitude)}for(var r,o,s,l=0,c=0,h=0,d=0,x=0,n=0;n<t.length;n++)h+=s=(r=e[n])*(c=n==t.length-1?(l=e[0],i[0]):(l=e[n+1],i[n+1]))-l*(o=i[n]),d+=(r+l)*s,x+=(o+c)*s;return d/=6*(h*=.5),x/=6*h,new L.Cartographic(d,x)}(i),t._volumeLabel=e._analysisLayer.entities.add({position:L.Cartesian3.fromRadians(l.longitude,l.latitude,v+1e3),label:{text:"Cut Volume "+f.toString()+"m3"}})}else alert("未获取到地形")}}U.prototype={createVisibilityAnalysis:function(i){i=i||{};var n=this;n.drawLineGraphics({type:"straightLine",clampToGround:!1,callback:function(t,e){t=new H({positions:t,that:n});n._graphicsLayer&&n._graphicsLayer.entities.remove(e),"function"==typeof i.callback&&i.callback(t)}})},createLookAroundAnalysis:function(i){var n;i=i||{},this._viewer&&i&&(n=this).drawCircleGraphics({callback:function(t,e){n._drawLayer.entities.remove(e);e=new Q({that:n,radius:t.radius,center:t.center});"function"==typeof i.callback&&i.callback(e)}})},createVisualFieldAnalysis:function(t){var i,n;t=t||{},this._viewer&&t&&(n=null,(i=this).bindHandelEvent({leftClick:function(t,e){t=i._viewer.scene.pickPosition(t.position);if(!t)return!1;L.defined(n)?e.destroy():(n=new L.Scene.ShadowPrimitive({scene:i._viewer.scene,viewerPosition:t}),i._analysisLayer._primitives.add(n))},mouseMove:function(t){t=i._viewer.scene.pickPosition(t.endPosition);if(!t)return!1;n&&n.setPoseByTargetPoint(t)}}))},createClipPlanAnalysis:function(i){var n,a,r,o,s;i=i||{},this._viewer&&i&&(n=this,a=i.height||30,r=i.splitNum||50,o=i.wallImg||this.getDfSt(["amalysis","createClipPlanAnalysis_wallImg"])||"static/data/images/file/excavate_side_min.jpg",s=i.bottomImg||this.getDfSt(["amalysis","createClipPlanAnalysis_bottomImg"])||"static/data/images/file/excavate_bottom_min.jpg",n.drawPolygonGraphics({callback:function(t,e){n._drawLayer.entities.remove(e);e=new L.Scene.TerrainClipPlan(n._viewer,{height:a,splitNum:r,wallImg:o,bottomImg:s}),t=n.transformWGS84ArrayToCartesianArray(t);e.updateData(t),"function"==typeof i.callback&&i.callback(e)}}))},createSubmergedAnalysis:function(t){var e,n,a,r,o;t=t||{},this._viewer&&t&&(n=t.maxH||15,a=t.speed||1,r=t.interval||10,o=(e=this).getDfSt(["amalysis","createSubmergedAnalysis"])||"static/data/images/file/water.png",e.drawPolygonGraphics({height:1,callback:function(t,i){if(!e._viewer.scene.globe.depthTestAgainstTerrain)return alert("请开启深度检测"),!1;i&&setTimeout(()=>{i.polygon.heightReference="CLAMP_TO_GROUND",i.polygon.material=o;var t=0,e=(i.polygon.extrudedHeight=t,setInterval(function(){(t+=a)>=n&&(t=n,clearTimeout(e)),i.polygon.extrudedHeight=t},r))},2e3)}}))},createSlopeAnalysis:function(i){if(i=i||{},!r)return alert("需要引入echarts库"),!1;var n=this;this._viewer&&i&&n.drawLineGraphics({type:"straightLine",clampToGround:!1,callback:function(t,e){t=new J({positions:t,that:n});n._graphicsLayer&&n._graphicsLayer.entities.remove(e),"function"==typeof i.callback&&i.callback(t)}})},createCutVolumeAnalysis:function(e){var i;e=e||{},this._viewer&&e&&(i=this).drawWallGraphics({callback:function(t){t=new O({positions:i.transformWGS84ArrayToCartesianArray(t,100),that:i});"function"==typeof e.callback&&e.callback(t)}})}};var j={version:"1.0.0",PlotUtils:{}},K=(j.PlotUtils.distance=function(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))},j.PlotUtils.wholeDistance=function(t){for(var e=0,i=0;i<t.length-1;i++)e+=j.PlotUtils.distance(t[i],t[i+1]);return e},j.PlotUtils.getBaseLength=function(t){return Math.pow(j.PlotUtils.wholeDistance(t),.99)},j.PlotUtils.mid=function(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]},j.PlotUtils.getCircleCenterOfThreePoints=function(t,e,i){var n=[(t[0]+e[0])/2,(t[1]+e[1])/2],e=[n[0]-t[1]+e[1],n[1]+t[0]-e[0]],a=[(t[0]+i[0])/2,(t[1]+i[1])/2],t=[a[0]-t[1]+i[1],a[1]+t[0]-i[0]];return j.PlotUtils.getIntersectPoint(n,e,a,t)},j.PlotUtils.getIntersectPoint=function(t,e,i,n){var a,r,o;return t[1]==e[1]?[(a=(n[0]-i[0])/(n[1]-i[1]))*(t[1]-i[1])+i[0],r=t[1]]:i[1]==n[1]?[(o=(e[0]-t[0])/(e[1]-t[1]))*(i[1]-t[1])+t[0],r=i[1]]:(o=(e[0]-t[0])/(e[1]-t[1]),a=(n[0]-i[0])/(n[1]-i[1]),[o*(r=(o*t[1]-t[0]-a*i[1]+i[0])/(o-a))-o*t[1]+t[0],r])},j.PlotUtils.getAzimuth=function(t,e){var i,n=Math.asin(Math.abs(e[1]-t[1])/j.PlotUtils.distance(t,e));return e[1]>=t[1]&&e[0]>=t[0]?i=n+Math.PI:e[1]>=t[1]&&e[0]<t[0]?i=j.Constants.TWO_PI-n:e[1]<t[1]&&e[0]<t[0]?i=n:e[1]<t[1]&&e[0]>=t[0]&&(i=Math.PI-n),i},j.PlotUtils.getAngleOfThreePoints=function(t,e,i){t=j.PlotUtils.getAzimuth(e,t)-j.PlotUtils.getAzimuth(e,i);return t<0?t+j.Constants.TWO_PI:t},j.PlotUtils.isClockWise=function(t,e,i){return(i[1]-t[1])*(e[0]-t[0])>(e[1]-t[1])*(i[0]-t[0])},j.PlotUtils.getPointOnLine=function(t,e,i){return[e[0]+t*(i[0]-e[0]),e[1]+t*(i[1]-e[1])]},j.PlotUtils.getCubicValue=function(t,e,i,n,a){var r=1-(t=Math.max(Math.min(t,1),0)),o=t*t,s=o*t,l=r*r,c=l*r;return[c*e[0]+3*l*t*i[0]+3*r*o*n[0]+s*a[0],c*e[1]+3*l*t*i[1]+3*r*o*n[1]+s*a[1]]},j.PlotUtils.getThirdPoint=function(t,e,i,n,a){t=j.PlotUtils.getAzimuth(t,e),a=a?t+i:t-i,t=n*Math.cos(a),i=n*Math.sin(a);return[e[0]+t,e[1]+i]},j.PlotUtils.getArcPoints=function(t,e,i,n){for(var a=[],r=(r=n-i)<0?r+j.Constants.TWO_PI:r,o=0;o<=j.Constants.FITTING_COUNT;o++){var s=i+r*o/j.Constants.FITTING_COUNT,l=t[0]+e*Math.cos(s),s=t[1]+e*Math.sin(s);a.push([l,s])}return a},j.PlotUtils.getBisectorNormals=function(t,e,i,n){var a,r,o=j.PlotUtils.getNormal(e,i,n),s=Math.sqrt(o[0]*o[0]+o[1]*o[1]),l=o[0]/s,o=o[1]/s,c=j.PlotUtils.distance(e,i),h=j.PlotUtils.distance(i,n),s=s>j.Constants.ZERO_TOLERANCE?j.PlotUtils.isClockWise(e,i,n)?(a=[i[0]-(r=t*c)*o,i[1]+r*l],[i[0]+(r=t*h)*o,i[1]-r*l]):(a=[i[0]+(r=t*c)*o,i[1]-r*l],[i[0]-(r=t*h)*o,i[1]+r*l]):(a=[i[0]+t*(e[0]-i[0]),i[1]+t*(e[1]-i[1])],[i[0]+t*(n[0]-i[0]),i[1]+t*(n[1]-i[1])]);return[a,s]},j.PlotUtils.getNormal=function(t,e,i){var n=t[0]-e[0],t=t[1]-e[1],a=Math.sqrt(n*n+t*t),a=(n/=a,t/=a,i[0]-e[0]),i=i[1]-e[1],e=Math.sqrt(a*a+i*i);return[n+(a/=e),t+(i/=e)]},j.PlotUtils.getCurvePoints=function(t,e){for(var i=[j.PlotUtils.getLeftMostControlPoint(e)],n=0;n<e.length-2;n++)var a=e[n],r=e[n+1],o=e[n+2],o=j.PlotUtils.getBisectorNormals(t,a,r,o),i=i.concat(o);for(var s=j.PlotUtils.getRightMostControlPoint(e),l=(i.push(s),[]),n=0;n<e.length-1;n++){for(a=e[n],r=e[n+1],l.push(a),t=0;t<j.Constants.FITTING_COUNT;t++){var c=j.PlotUtils.getCubicValue(t/j.Constants.FITTING_COUNT,a,i[2*n],i[2*n+1],r);l.push(c)}l.push(r)}return l},j.PlotUtils.getLeftMostControlPoint=function(e){var i,n,a,r,o,s=e[0],l=e[1],e=e[2],c=j.PlotUtils.getBisectorNormals(0,s,l,e)[0],e=j.PlotUtils.getNormal(s,l,e),e=Math.sqrt(e[0]*e[0]+e[1]*e[1])>j.Constants.ZERO_TOLERANCE?(e=j.PlotUtils.mid(s,l),a=s[0]-e[0],i=s[1]-e[1],n=2/j.PlotUtils.distance(s,l),r=c[0]-e[0],c=c[1]-e[1],o=e[0]+((i=-n*i)*i-(n=n*a)*n)*r+(a=2*i*n)*c,e[1]+a*r+(n*n-i*i)*c):(o=s[0]+t*(l[0]-s[0]),s[1]+t*(l[1]-s[1]));return[o,e]},j.PlotUtils.getRightMostControlPoint=function(e){var i,n,a,r,o,s=e.length,l=e[s-3],c=e[s-2],e=e[s-1],s=j.PlotUtils.getBisectorNormals(0,l,c,e)[1],l=j.PlotUtils.getNormal(l,c,e),l=Math.sqrt(l[0]*l[0]+l[1]*l[1])>j.Constants.ZERO_TOLERANCE?(l=j.PlotUtils.mid(c,e),a=e[0]-l[0],i=e[1]-l[1],n=2/j.PlotUtils.distance(c,e),r=s[0]-l[0],s=s[1]-l[1],o=l[0]+((i=-n*i)*i-(n=n*a)*n)*r+(a=2*i*n)*s,l[1]+a*r+(n*n-i*i)*s):(o=e[0]+t*(c[0]-e[0]),e[1]+t*(c[1]-e[1]));return[o,l]},j.PlotUtils.getBezierPoints=function(t){if(t.length<=2)return t;for(var e=[],i=t.length-1,n=0;n<=1;n+=.01){for(var a=0,r=0,o=0;o<=i;o++){var s=j.PlotUtils.getBinomialFactor(i,o),l=Math.pow(n,o),c=Math.pow(1-n,i-o);a+=s*l*c*t[o][0],r+=s*l*c*t[o][1]}e.push([a,r])}return e.push(t[i]),e},j.PlotUtils.getBinomialFactor=function(t,e){return j.PlotUtils.getFactorial(t)/(j.PlotUtils.getFactorial(e)*j.PlotUtils.getFactorial(t-e))},j.PlotUtils.getFactorial=function(t){if(t<=1)return 1;if(2==t)return 2;if(3==t)return 6;if(4==t)return 24;if(5==t)return 120;for(var e=1,i=1;i<=t;i++)e*=i;return e},j.PlotUtils.getQBSplinePoints=function(t){if(t.length<=2)return t;var e=[],i=t.length-2-1;e.push(t[0]);for(var n=0;n<=i;n++)for(var a=0;a<=1;a+=.05){for(var r=0,o=0,s=0;s<=2;s++){var l=j.PlotUtils.getQuadricBSplineFactor(s,a);r+=l*t[n+s][0],o+=l*t[n+s][1]}e.push([r,o])}return e.push(t[t.length-1]),e},j.PlotUtils.getQuadricBSplineFactor=function(t,e){return 0==t?Math.pow(e-1,2)/2:1==t?(-2*Math.pow(e,2)+2*e+1)/2:2==t?Math.pow(e,2)/2:0},j.Constants={TWO_PI:2*Math.PI,HALF_PI:Math.PI/2,FITTING_COUNT:100,ZERO_TOLERANCE:1e-4},{version:"1.0.0",createTime:"2018.6.19",author:"xupinhui"}),q="doublearrow",$={headHeightFactor:.18,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15,tailWidthFactor:.1,headTailFactor:.8,swallowTailFactor:1},tt={tailWidthFactor:.15,neckWidthFactor:.2,headWidthFactor:.25,headAngle:Math.PI/8.5,neckAngle:Math.PI/13};K.algorithm={},K.algorithm.doubleArrow=function(t,e){this.connPoint=null;var i={controlPoint:this.tempPoint4=null,polygonalPoint:null};if(!((o=(this.points=t).length)<2)){if(2==o)return t;var n=this.points[0],a=this.points[1],r=this.points[2],o=t.length,o=(this.tempPoint4=3==o?K.algorithm.getTempPoint4(n,a,r):this.points[3],this.connPoint=3==o||4==o?j.PlotUtils.mid(n,a):this.points[4],t=j.PlotUtils.isClockWise(n,a,r)?(h=K.algorithm.getArrowPoints(n,this.connPoint,this.tempPoint4,!1),K.algorithm.getArrowPoints(this.connPoint,a,r,!0)):(h=K.algorithm.getArrowPoints(a,this.connPoint,r,!1),K.algorithm.getArrowPoints(this.connPoint,n,this.tempPoint4,!0)),h.length),s=(o-5)/2,l=h.slice(0,s),c=h.slice(s,5+s),h=h.slice(5+s,o),d=t.slice(0,s),x=t.slice(s,5+s),t=t.slice(5+s,o),d=j.PlotUtils.getBezierPoints(d),s=j.PlotUtils.getBezierPoints(t.concat(l.slice(1))),h=j.PlotUtils.getBezierPoints(h),o=d.concat(x,s,c,h),t=K.algorithm.array2Dto1D(o);i.controlPoint=[n,a,r,this.tempPoint4,this.connPoint],i.polygonalPoint=e.Cartesian3.fromDegreesArray(t)}return i},K.algorithm.threeArrow=function(t){this.connPoint=null,this.tempPoint4=null;var e={controlPoint:this.tempPoint5=null,polygonalPoint:null};if(2<=(r=(this.points=t).length)){if(2==r)return t;var i=this.points[0],n=this.points[1],a=this.points[2],r=(3==(r=t.length)?(this.tempPoint4=K.algorithm.getTempPoint4(i,n,a),this.tempPoint5=j.PlotUtils.mid(a,this.tempPoint4)):(this.tempPoint4=this.points[3],this.tempPoint5=this.points[4]),this.connPoint=r<6?j.PlotUtils.mid(i,n):this.points[5],t=j.PlotUtils.isClockWise(i,n,a)?(c=K.algorithm.getArrowPoints(i,this.connPoint,this.tempPoint4,!1),K.algorithm.getArrowPoints(this.connPoint,n,a,!0)):(c=K.algorithm.getArrowPoints(n,this.connPoint,a,!1),K.algorithm.getArrowPoints(this.connPoint,i,this.tempPoint4,!0)),c.length),o=(r-5)/2,s=c.slice(0,o),l=c.slice(o,5+o),c=c.slice(5+o,r),h=t.slice(0,o),d=t.slice(o,5+o),t=t.slice(5+o,r),h=j.PlotUtils.getBezierPoints(h),o=j.PlotUtils.getBezierPoints(t.concat(s.slice(1))),c=j.PlotUtils.getBezierPoints(c),r=h.concat(d,o,l,c),t=K.algorithm.array2Dto1D(r);e.controlPoint=[i,n,a,this.tempPoint4,this.tempPoint5,this.connPoint],e.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(t)}return e},K.algorithm.array2Dto1D=function(t){var e=[];return t.forEach(function(t){e.push(t[0]),e.push(t[1])}),e},K.algorithm.getArrowPoints=function(t,e,i,n){this.type=q,this.headHeightFactor=.25,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15;var a=j.PlotUtils.mid(t,e),r=j.PlotUtils.distance(a,i),o=j.PlotUtils.getThirdPoint(i,a,0,.3*r,!0),s=j.PlotUtils.getThirdPoint(i,a,0,.5*r,!0),o=[a,j.PlotUtils.getThirdPoint(a,o,j.Constants.HALF_PI,r/5,n),j.PlotUtils.getThirdPoint(a,s,j.Constants.HALF_PI,r/4,n),i],a=K.algorithm.getArrowHeadPoints(o,this.headHeightFactor,this.headWidthFactor,this.neckHeightFactor,this.neckWidthFactor),s=a[0],r=a[4],n=j.PlotUtils.distance(t,e)/j.PlotUtils.getBaseLength(o)/2,i=K.algorithm.getArrowBodyPoints(o,s,r,n),o=i.length,n=i.slice(0,o/2),i=i.slice(o/2,o);return n.push(s),i.push(r),(n=n.reverse()).push(e),(i=i.reverse()).push(t),n.reverse().concat(a,i)},K.algorithm.getArrowHeadPoints=function(t,e,i){this.type=q,this.headHeightFactor=.25,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15;var n=j.PlotUtils.getBaseLength(t)*this.headHeightFactor,a=t[t.length-1],e=(j.PlotUtils.distance(e,i),n*this.headWidthFactor),i=n*this.neckWidthFactor,r=n*this.neckHeightFactor,n=j.PlotUtils.getThirdPoint(t[t.length-2],a,0,n,!0),t=j.PlotUtils.getThirdPoint(t[t.length-2],a,0,r,!0),r=j.PlotUtils.getThirdPoint(a,n,j.Constants.HALF_PI,e,!1),n=j.PlotUtils.getThirdPoint(a,n,j.Constants.HALF_PI,e,!0);return[j.PlotUtils.getThirdPoint(a,t,j.Constants.HALF_PI,i,!1),r,a,n,j.PlotUtils.getThirdPoint(a,t,j.Constants.HALF_PI,i,!0)]},K.algorithm.getArrowBodyPoints=function(t,e,i,n){for(var a=j.PlotUtils.wholeDistance(t),r=j.PlotUtils.getBaseLength(t)*n,o=(r-j.PlotUtils.distance(e,i))/2,s=0,l=[],c=[],h=1;h<t.length-1;h++){var d=j.PlotUtils.getAngleOfThreePoints(t[h-1],t[h],t[h+1])/2,x=(r/2-(s+=j.PlotUtils.distance(t[h-1],t[h]))/a*o)/Math.sin(d),u=j.PlotUtils.getThirdPoint(t[h-1],t[h],Math.PI-d,x,!0),d=j.PlotUtils.getThirdPoint(t[h-1],t[h],d,x,!1);l.push(u),c.push(d)}return l.concat(c)},K.algorithm.getTempPoint4=function(t,e,i){var n,a,r,e=j.PlotUtils.mid(t,e),o=j.PlotUtils.distance(e,i),i=j.PlotUtils.getAngleOfThreePoints(t,e,i),o=i<j.Constants.HALF_PI?(n=o*Math.sin(i),a=o*Math.cos(i),r=j.PlotUtils.getThirdPoint(t,e,j.Constants.HALF_PI,n,!1),j.PlotUtils.getThirdPoint(e,r,j.Constants.HALF_PI,a,!0)):i>=j.Constants.HALF_PI&&i<Math.PI?(n=o*Math.sin(Math.PI-i),a=o*Math.cos(Math.PI-i),r=j.PlotUtils.getThirdPoint(t,e,j.Constants.HALF_PI,n,!1),j.PlotUtils.getThirdPoint(e,r,j.Constants.HALF_PI,a,!1)):i>=Math.PI&&i<1.5*Math.PI?(n=o*Math.sin(i-Math.PI),a=o*Math.cos(i-Math.PI),r=j.PlotUtils.getThirdPoint(t,e,j.Constants.HALF_PI,n,!0),j.PlotUtils.getThirdPoint(e,r,j.Constants.HALF_PI,a,!0)):(n=o*Math.sin(2*Math.PI-i),a=o*Math.cos(2*Math.PI-i),r=j.PlotUtils.getThirdPoint(t,e,j.Constants.HALF_PI,n,!0),j.PlotUtils.getThirdPoint(e,r,j.Constants.HALF_PI,a,!1));return o},K.algorithm.tailedAttackArrow=function(t,e){t=K.algorithm.dereplication(t),this.tailWidthFactor=$.tailWidthFactor,this.swallowTailFactor=$.swallowTailFactor,this.swallowTailPnt=$.swallowTailPnt;var i={controlPoint:null,polygonalPoint:null};if(!((i.controlPoint=t).length<2)){if(2==t.length)return i.polygonalPoint=t,i;var n=t[0],a=t[1],t=(j.PlotUtils.isClockWise(t[0],t[1],t[2])&&(n=t[1],a=t[0]),[j.PlotUtils.mid(n,a)].concat(t.slice(2))),r=K.algorithm.getAttackArrowHeadPoints(t,n,a,$),o=r[0],s=r[4],l=j.PlotUtils.distance(n,a),c=j.PlotUtils.getBaseLength(t),h=c*this.tailWidthFactor*this.swallowTailFactor;this.swallowTailPnt=j.PlotUtils.getThirdPoint(t[1],t[0],0,h,!0);h=K.algorithm.getAttackArrowBodyPoints(t,o,s,l/c),t=h.length,l=[n].concat(h.slice(0,t/2));l.push(o);c=[a].concat(h.slice(t/2,t));c.push(s),l=j.PlotUtils.getQBSplinePoints(l),c=j.PlotUtils.getQBSplinePoints(c),n=K.algorithm.array2Dto1D(l.concat(r,c.reverse(),[this.swallowTailPnt,l[0]])),i.polygonalPoint=e.Cartesian3.fromDegreesArray(n)}return i},K.algorithm.getAttackArrowHeadPoints=function(t,e,i,n){this.headHeightFactor=n.headHeightFactor,this.headTailFactor=n.headTailFactor,this.headWidthFactor=n.headWidthFactor,this.neckWidthFactor=n.neckWidthFactor,this.neckHeightFactor=n.neckHeightFactor;var n=j.PlotUtils.getBaseLength(t)*this.headHeightFactor,a=t[t.length-1],r=j.PlotUtils.distance(a,t[t.length-2]),e=j.PlotUtils.distance(e,i),i=(n=n>e*this.headTailFactor?e*this.headTailFactor:n)*this.headWidthFactor,e=n*this.neckWidthFactor,r=(n=r<n?r:n)*this.neckHeightFactor,n=j.PlotUtils.getThirdPoint(t[t.length-2],a,0,n,!0),t=j.PlotUtils.getThirdPoint(t[t.length-2],a,0,r,!0),r=j.PlotUtils.getThirdPoint(a,n,j.Constants.HALF_PI,i,!1),n=j.PlotUtils.getThirdPoint(a,n,j.Constants.HALF_PI,i,!0);return[j.PlotUtils.getThirdPoint(a,t,j.Constants.HALF_PI,e,!1),r,a,n,j.PlotUtils.getThirdPoint(a,t,j.Constants.HALF_PI,e,!0)]},K.algorithm.getAttackArrowBodyPoints=function(t,e,i,n){for(var a=j.PlotUtils.wholeDistance(t),r=j.PlotUtils.getBaseLength(t)*n,o=(r-j.PlotUtils.distance(e,i))/2,s=0,l=[],c=[],h=1;h<t.length-1;h++){var d=j.PlotUtils.getAngleOfThreePoints(t[h-1],t[h],t[h+1])/2,x=(r/2-(s+=j.PlotUtils.distance(t[h-1],t[h]))/a*o)/Math.sin(d),u=j.PlotUtils.getThirdPoint(t[h-1],t[h],Math.PI-d,x,!0),d=j.PlotUtils.getThirdPoint(t[h-1],t[h],d,x,!1);l.push(u),c.push(d)}return l.concat(c)},K.algorithm.dereplication=function(t){var e=t[t.length-1],i=!1,n=[],n=t.filter(function(t){if(t[0]!=e[0]&&t[1]!=e[1])return t;i=!0});return i&&n.push(e),n},K.algorithm.fineArrow=function(t,e,i){var n,a,r,o,s,l,c;if(!(t.length<2||e.length<2))return n=tt.tailWidthFactor,c=tt.neckWidthFactor,s=tt.headWidthFactor,o=tt.headAngle,l=tt.neckAngle,(a=[])[0]=t,a[1]=e,t=a[0],e=a[1],c=(a=j.PlotUtils.getBaseLength(a))*c,s=a*s,n=j.PlotUtils.getThirdPoint(e,t,j.Constants.HALF_PI,a=a*n,!0),a=j.PlotUtils.getThirdPoint(e,t,j.Constants.HALF_PI,a,!1),r=j.PlotUtils.getThirdPoint(t,e,o,s,!1),o=j.PlotUtils.getThirdPoint(t,e,o,s,!0),s=j.PlotUtils.getThirdPoint(t,e,l,c,!1),l=j.PlotUtils.getThirdPoint(t,e,l,c,!0),(c=[]).push(n[0],n[1],s[0],s[1],r[0],r[1],e[0],e[1],o[0],o[1],l[0],l[1],a[0],a[1],t[0],t[1]),c.some(t=>isNaN(t))?"":i.Cartesian3.fromDegreesArray(c)};let et=null;function it(t,e){this.viewer=t,et=e,this.handler=new et.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.fillMaterial=et.Color.RED.withAlpha(.5),this.positions=[],this.state=-1,this.floatPoint=null,this.arrowEntity=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null,this.xp=K}it.prototype.clear=function(){this.state=0,this.firstPoint&&this.viewer.entities.remove(this.firstPoint),this.floatPoint&&this.viewer.entities.remove(this.floatPoint),this.arrowEntity&&this.viewer.entities.remove(this.arrowEntity),this.state=-1},it.prototype.disableHandler=function(){this.handler&&(this.handler.destroy(),this.handler=new et.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)};let nt=null;var at=function(t,e){it.call(this,t,e),nt=e,this.type="AttackArrow",this.fillMaterial=nt.Color.RED.withAlpha(.5)};function rt(t,e){t=e.camera.getPickRay(t);return t?e.scene.globe.pick(t,e.scene):null}at.prototype={disable:function(){this.positions=[],this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new nt.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null);for(var t=0;t<this.pointArr.length;t++)this.pointArr[t]&&this.viewer.entities.remove(this.pointArr[t]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},startDraw:function(e){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var i=this;this.state=1,this.handler||(this.handler=new nt.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(t){(t=rt(t.position,i.viewer))&&(0==i.positions.length&&(i.floatPoint=i.creatPoint(t),i.floatPoint.wz=-1),i.positions.push(t),t=i.creatPoint(t),2<i.positions.length?t.wz=i.positions.length-1:t.wz=i.positions.length,i.pointArr.push(t))},nt.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(t){!i.floatPoint||i.positions.length<2||(t=rt(t.endPosition,i.viewer))&&(i.floatPoint.position.setValue(t),2<=i.positions.length)&&(nt.defined(i.arrowEntity)?(i.positions.pop(),i.positions.push(t)):(i.positions.push(t),i.arrowEntity=i.showArrowOnMap(i.positions),i.arrowEntity.objId=i.objId,e&&e(i.objId)))},nt.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(t){if(t=rt(t.position,i.viewer)){for(var e=0;e<i.pointArr.length;e++)i.pointArr[e].show=!1;i.floatPoint.show=!1,i.viewer.entities.remove(i.floatPoint),i.floatPoint=null;t=i.creatPoint(t);t.show=!1,t.wz=i.positions.length,i.pointArr.push(t),i.positions=[],i.pointArr=[],i.arrowEntity=null}},nt.ScreenSpaceEventType.RIGHT_CLICK)},createByData:function(t){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;for(var e=[],i=0;i<t.length;i++){var n=nt.Cartesian3.fromDegrees(t[i][0],t[i][1]);e.push(n)}for(this.positions=e,i=0;i<this.positions.length;i++){var a=this.creatPoint(this.positions[i]);a.show=!1,a.wz=i+1,this.pointArr.push(a)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},startModify:function(){this.state=2;for(var n=this,t=0;t<n.pointArr.length;t++)n.pointArr[t].show=!0;this.modifyHandler||(this.modifyHandler=new nt.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(t){var e=n.viewer.scene.pick(t.position);if(nt.defined(e)&&e.id)n.clickStep++,e.id.objId||(n.selectPoint=e.id);else{for(var i=0;i<n.pointArr.length;i++)n.pointArr[i].show=!1;n.floatPoint&&(n.floatPoint.show=!1),n.state=-1,n.modifyHandler.destroy(),n.modifyHandler=null}2==n.clickStep&&(n.clickStep=0,e=rt(t.position,n.viewer))&&n.selectPoint&&(n.selectPoint.position.setValue(e),n.selectPoint=null)},nt.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(t){(t=rt(t.endPosition,n.viewer))&&n.selectPoint&&(n.selectPoint.position.setValue(t),n.positions[n.selectPoint.wz-1]=t)},nt.ScreenSpaceEventType.MOUSE_MOVE)},getLnglats:function(){for(var t=[],e=0;e<this.positions.length;e++){var i=this.cartesianToLatlng(this.positions[e]);t.push(i)}return t},getPositions:function(){return this.positions},creatPoint:function(t){t=this.viewer.entities.add({position:t,point:{pixelSize:10,color:nt.Color.YELLOW}});return t.attr="editPoint",t},showArrowOnMap:function(r){var o=this;return this.viewer.entities.add({id:o.objId,polygon:new nt.PolygonGraphics({hierarchy:new nt.CallbackProperty(function(){if(r.length<3)return null;for(var t=[],e=0;e<r.length;e++){var i=o.cartesianToLatlng(r[e]);t.push(i)}var n=o.xp.algorithm.tailedAttackArrow(t,nt),a=[];return-1==JSON.stringify(n.polygonalPoint).indexOf("null")&&(a=n.polygonalPoint),new nt.PolygonHierarchy(a)},!1),show:!0,fill:!0,material:o.fillMaterial})})},cartesianToLatlng:function(t){var t=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(t),e=nt.Math.toDegrees(t.latitude);return[nt.Math.toDegrees(t.longitude),e]}},(at.prototype=Object.create(Object.assign({},at.prototype,it.prototype))).constructor=at;let ot=null;var st=function(t,e){it.call(this,t,e),ot=e,this.type="StraightArrow",this.fillMaterial=ot.Color.fromCssColorString("#0000FF").withAlpha(.8)};function lt(t,e){t=e.camera.getPickRay(t);return t?e.scene.globe.pick(t,e.scene):null}st.prototype={disable:function(){this.positions=[],this.firstPoint&&(this.viewer.entities.remove(this.firstPoint),this.firstPoint=null),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new ot.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},startDraw:function(e){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var i=this;this.state=1,this.handler.setInputAction(function(t){(t=lt(t.position,i.viewer))&&(0==i.positions.length&&(i.firstPoint=i.creatPoint(t),i.firstPoint.type="firstPoint",i.floatPoint=i.creatPoint(t),i.floatPoint.type="floatPoint",i.positions.push(t)),i.firstPoint.position.setValue(t),i.firstPoint.show=!0,i.positions&&3==i.positions.length&&(i.firstPoint.show=!1,i.positions=[],i.pointArr=[],i.arrowEntity=null),i.positions.push(t.clone()))},ot.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(t){i.positions.length<1||(t=lt(t.endPosition,i.viewer))&&(i.floatPoint.position.setValue(t),2<=i.positions.length)&&(ot.defined(i.arrowEntity)?(i.positions.pop(),i.positions.push(t)):(i.positions.push(t),i.arrowEntity=i.showArrowOnMap(i.positions),e&&e(i.objId)))},ot.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(t){(t=lt(t.position,i.viewer))&&(i.firstPoint.show=!1,i.positions=[],i.pointArr=[],i.arrowEntity=null,i.positions.push(t.clone()))},ot.ScreenSpaceEventType.RIGHT_CLICK)},startModify:function(){this.state=2,this.firstPoint.show=!0,this.floatPoint.show=!0;var i=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new ot.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(t){var e=i.viewer.scene.pick(t.position);ot.defined(e)&&e.id?(i.clickStep++,e.id.objId||(i.selectPoint=e.id)):(i.modifyHandler.destroy(),i.modifyHandler=null,i.firstPoint.show=!1,i.floatPoint.show=!1,i.state=-1),2==i.clickStep&&(i.clickStep=0,e=lt(t.position,i.viewer))&&i.selectPoint&&(i.selectPoint.position.setValue(e),i.selectPoint=null)},ot.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(t){i.selectPoint&&(t=lt(t.endPosition,i.viewer))&&(i.selectPoint.position.setValue(t),"firstPoint"==i.selectPoint.type&&(i.positions[1]=t),"floatPoint"==i.selectPoint.type)&&(i.positions[2]=t)},ot.ScreenSpaceEventType.MOUSE_MOVE)},createByData:function(t){this.state=-1,this.positions=[];for(var e=[],i=0;i<t.length;i++){var n=ot.Cartesian3.fromDegrees(t[i][0],t[i][1]);e.push(n)}this.positions=e,this.firstPoint=this.creatPoint(this.positions[1]),this.firstPoint.type="firstPoint",this.floatPoint=this.creatPoint(this.positions[2]),this.floatPoint.type="floatPoint",this.arrowEntity=this.showArrowOnMap(this.positions),this.firstPoint.show=!1,this.floatPoint.show=!1,this.arrowEntity.objId=this.objId},getLnglats:function(){for(var t=[],e=0;e<this.positions.length;e++){var i=this.cartesianToLatlng(this.positions[e]);t.push(i)}return t},getPositions:function(){return this.positions},creatPoint:function(t){t=this.viewer.entities.add({position:t,point:{pixelSize:10,color:ot.Color.YELLOW}});return t.attr="editPoint",t},showArrowOnMap:function(o){var s=this;return this.viewer.entities.add({id:s.objId,polygon:new ot.PolygonGraphics({hierarchy:new ot.CallbackProperty(function(){if(o.length<2)return null;var t=o[1],e=o[2],t=s.cartesianToLatlng(t),e=s.cartesianToLatlng(e),i=[],n=s.xp.algorithm.fineArrow([t[0],t[1]],[e[0],e[1]],ot);if(-1!=JSON.stringify(n).indexOf("null"))return[];for(var a=0;a<n.length;a++){var r=new ot.Cartesian3(n[a].x,n[a].y,n[a].z);i.push(r)}return new ot.PolygonHierarchy(i)},!1),show:!0,fill:!0,material:s.fillMaterial})})},cartesianToLatlng:function(t){var t=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(t),e=ot.Math.toDegrees(t.latitude);return[ot.Math.toDegrees(t.longitude),e]}},(st.prototype=Object.create(Object.assign({},st.prototype,it.prototype))).constructor=st;let ct=null;var ht=function(t,e){it.call(this,t,e),ct=e,this.type="PincerArrow",this.fillMaterial=ct.Color.YELLOW.withAlpha(.8)};function xt(t,e){t=e.camera.getPickRay(t);return t?e.scene.globe.pick(t,e.scene):null}ht.prototype={disable:function(){this.positions=[],this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new ct.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null);for(var t=0;t<this.pointArr.length;t++)this.pointArr[t]&&this.viewer.entities.remove(this.pointArr[t]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},startDraw:function(e){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var n=this;this.state=1,this.handler.setInputAction(function(t){if(t=xt(t.position,n.viewer))if(0==n.positions.length&&(n.floatPoint=n.creatPoint(t)),4<n.positions.length){(i=n.creatPoint(t)).wz=n.positions.length,n.pointArr.push(i);for(var e=0;e<n.pointArr.length;e++)n.pointArr[e].show=!1;n.floatPoint&&(n.floatPoint.show=!1,n.viewer.entities.remove(n.floatPoint),n.floatPoint=null),n.positions=[],n.pointArr=[],n.arrowEntity=null}else{n.positions.push(t);var i=n.creatPoint(t);2<n.positions.length?i.wz=n.positions.length-1:i.wz=n.positions.length,n.pointArr.push(i)}},ct.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(t){!n.floatPoint||n.positions.length<2||(t=xt(t.endPosition,n.viewer))&&(n.floatPoint.position.setValue(t),2<=n.positions.length)&&(ct.defined(n.arrowEntity)?(n.positions.pop(),n.positions.push(t)):(n.positions.push(t),n.arrowEntity=n.showArrowOnMap(n.positions),n.arrowEntity.objId=n.objId,e&&e(n.objId)))},ct.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(t){if(4<=n.positions.length&&(t=xt(t.position,n.viewer))){for(var e=0;e<n.pointArr.length;e++)n.pointArr[e].show=!1;n.floatPoint.show=!1,n.viewer.entities.remove(n.floatPoint),n.floatPoint=null;t=n.creatPoint(t);t.show=!1,t.wz=n.positions.length,n.pointArr.push(t),n.positions=[],n.pointArr=[],n.arrowEntity=null}},ct.ScreenSpaceEventType.RIGHT_CLICK)},createByData:function(t){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;for(var e=[],i=0;i<t.length;i++){var n=ct.Cartesian3.fromDegrees(t[i][0],t[i][1]);e.push(n)}for(this.positions=e,i=0;i<this.positions.length;i++){var a=this.creatPoint(this.positions[i]);a.show=!1,a.wz=i+1,this.pointArr.push(a)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},startModify:function(){this.state=2;for(var n=this,t=0;t<n.pointArr.length;t++)n.pointArr[t].show=!0;this.modifyHandler||(this.modifyHandler=new ct.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(t){var e=n.viewer.scene.pick(t.position);if(ct.defined(e)&&e.id)n.clickStep++,e.id.objId||(n.selectPoint=e.id);else{for(var i=0;i<n.pointArr.length;i++)n.pointArr[i].show=!1;n.state=-1,n.modifyHandler.destroy(),n.modifyHandler=null}2==n.clickStep&&(n.clickStep=0,e=xt(t.position,n.viewer))&&n.selectPoint&&(n.selectPoint.position.setValue(e),n.selectPoint=null)},ct.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(t){(t=xt(t.endPosition,n.viewer))&&n.selectPoint&&(n.selectPoint.position.setValue(t),n.positions[n.selectPoint.wz-1]=t)},ct.ScreenSpaceEventType.MOUSE_MOVE)},getLnglats:function(){for(var t=[],e=0;e<this.positions.length;e++){var i=this.cartesianToLatlng(this.positions[e]);t.push(i)}return t},getPositions:function(){return this.positions},creatPoint:function(t){return this.viewer.entities.add({position:t,point:{pixelSize:10,color:ct.Color.YELLOW}})},showArrowOnMap:function(r){var o=this;return this.viewer.entities.add({id:o.objId,polygon:new ct.PolygonGraphics({hierarchy:new ct.CallbackProperty(function(){if(r.length<3)return null;for(var t=[],e=0;e<r.length;e++){var i=o.cartesianToLatlng(r[e]);t.push(i)}var n=o.xp.algorithm.doubleArrow(t,ct),a=[];return-1==JSON.stringify(n.polygonalPoint).indexOf("null")&&(a=n.polygonalPoint),new ct.PolygonHierarchy(a)},!1),show:!0,fill:!0,material:o.fillMaterial})})},cartesianToLatlng:function(t){var t=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(t),e=ct.Math.toDegrees(t.latitude);return[ct.Math.toDegrees(t.longitude),e]}},(ht.prototype=Object.create(Object.assign({},ht.prototype,it.prototype))).constructor=ht;let dt=null;function ut(t,e,i){t&&(this._viewer=t,dt=e,this._installPlugin())}function pt({cesiumGlobal:t,containerId:e,viewerConfig:i={},extraConfig:n={},MapImageryList:a=[],defaultStatic:r}){if(!t)throw"Missing cesiumGlobal parameter, please check the calling function initCesium.";var o,l,h,x,S,p,g,f,v,b,w,_,G,W;if(e)return e=new s(t).init({containerId:e,viewerConfig:i,extraConfig:n,MapImageryList:a}),_=e,G=t,W=r,n=(i=function(t,a){var e=null;function i(t){for(var e=Object.keys(t.prototype),i=0,n=e.length;i<n;i++)a.prototype[e[i]]=t.prototype[e[i]]}return Array.isArray(t)?(t.forEach(t=>{i(t)}),e=new a(_,G,W),t.forEach(t=>{t.call(e,_,G,W)})):(i(t),e=new a(_,G,W),t.call(e,_,G,W)),e})([m,u],d),a=i(m,c),o=i(m,y),l=i(m,C),h=i([m,y,A],I),x=i([m,u],P),S=i(m,X),p=i(m,Y),g=i(m,z),f=new m(e,t),i=i([m,I,z],U),v=new at(e,t),b=new st(e,t),w=new ht(e,t),new ut(e,t,r),{viewer:e,material:n,graphics:a,math3d:o,primitive:l,draw:h,passEffect:x,customCesiumPlugin:S,control:p,plugin:g,base:f,analysis:i,attackArrowObj:v,straightArrowObj:b,pincerArrowObj:w};throw"Missing containerId parameter, please check the calling function initCesium."}ut.prototype={_installPlugin:function(){this._installCounputeVertex(),this._installCylinderGeometry(),this._installRadarPrimitive()},_installCylinderGeometry:function(){function I(t){this.length=t.length,this.topRadius=t.topRadius,this.bottomRadius=t.bottomRadius,this.slices=t.slices||64,this.zReverse=t.zReverse}var A=new dt.Cartesian2,_=new dt.Cartesian3,G=new dt.Ray;I._createGeometry=function(t){var e=t.length,i=t.topRadius,n=t.bottomRadius,a=t.slices,r=2*Math.PI/(a-1),o=[],s=[],l=[],c=[],h=[n,i],d=[0,t.zReverse?-e:e],x=0,t=Math.atan2(n-i,e),u=A;u.z=Math.sin(t);for(var S=Math.cos(t),p=0;p<d.length;p++){c[p]=[];for(var g=h[p],m=0;m<a;m++){c[p].push(x++);var f=r*m,v=g*Math.cos(f),b=g*Math.sin(f);o.push(v,b,d[p]),v=S*Math.cos(f),b=S*Math.sin(f),s.push(v,b,u.z),l.push(p/(d.length-1),0)}}for(var y=[],p=1;p<d.length;p++)for(m=1;m<a;m++){var C=c[p-1][m-1],w=c[p][m-1],I=c[p][m],_=c[p-1][m];y.push(I),y.push(_),y.push(C),y.push(I),y.push(C),y.push(w),m==c[p].length-1&&(C=c[p-1][m],w=c[p][m],I=c[p][0],_=c[p-1][0],y.push(I),y.push(_),y.push(C),y.push(I),y.push(C),y.push(w))}y=new Int16Array(y),o=new Float32Array(o),s=new Float32Array(s),l=new Float32Array(l),n={position:new dt.GeometryAttribute({componentDatatype:dt.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:o}),normal:new dt.GeometryAttribute({componentDatatype:dt.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:s}),st:new dt.GeometryAttribute({componentDatatype:dt.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:l})},i=dt.BoundingSphere.fromVertices(o),e=new dt.Geometry({attributes:n,indices:y,primitiveType:dt.PrimitiveType.TRIANGLES,boundingSphere:i});return o=[],y=[],l=[],e},I.createGeometry=function(t,e){if(!e)return I._createGeometry(t);dt.Matrix4.multiplyByPoint(e,dt.Cartesian3.ZERO,_),_.clone(G.origin);var i=t.length,n=t.topRadius,a=(t.bottomRadius,t.slices),r=2*Math.PI/(a-1),o=[],s=[],l=[],c=[],h=[0,t.zReverse?-i:i],d=0,d=0;o.push(0,0,0),s.push(1,1),d++;for(var x=new dt.Cartesian3,u=n/15,S=0;S<16;S++){for(var p=u*S,g=[],m=0;m<a;m++){var f=r*m,v=p*Math.cos(f),f=p*Math.sin(f);x.x=v,x.y=f,x.z=h[1],(0,dt.Scene.extend2Earth)(x,e,G)?(g.push(d),o.push(v,f,h[1]),s.push(S/15,1),d++):g.push(-1)}c.push(g)}for(var b,y,C=[0,c.length-1],w=0;w<C.length;w++)for(S=C[w],m=1;m<c[S].length;m++)b=c[S][m-1],y=c[S][m],0<=b&&0<=y&&l.push(0,b,y);o=new Float32Array(o),l=new Int32Array(l),s=new Float32Array(s),t={position:new dt.GeometryAttribute({componentDatatype:dt.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:o}),st:new dt.GeometryAttribute({componentDatatype:dt.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:s})},i=dt.BoundingSphere.fromVertices(o),n=new dt.Geometry({attributes:t,indices:l,primitiveType:dt.PrimitiveType.TRIANGLES,boundingSphere:i});return(0,dt.Scene.computeVertexNormals)(n),o=[],l=[],n},I.createOutlineGeometry=function(t){var e=t.length,i=t.topRadius,n=t.bottomRadius,a=t.slices,r=2*Math.PI/(a-1),o=[],s=[],l=[],c=[],h=[n,i],d=[0,t.zReverse?-e:e],x=0,t=Math.atan2(n-i,e),u=A;u.z=Math.sin(t);for(var S=Math.cos(t),p=0;p<d.length;p++){c[p]=[];for(var g=h[p],m=0;m<a;m++){c[p].push(x++);var f=r*m,v=g*Math.cos(f),b=g*Math.sin(f);o.push(v,b,d[p]),v=S*Math.cos(f),b=S*Math.sin(f),s.push(v,b,u.z),l.push(p/(d.length-1),0)}}for(var y=[],p=1;p<d.length;p++)for(m=1;m<a;m+=1){var C=c[p-1][m-1],w=c[p][m-1];c[p][m],c[p-1][m],m%8==1&&y.push(C,w)}y=new Int16Array(y),o=new Float32Array(o),s=new Float32Array(s),l=new Float32Array(l),n={position:new dt.GeometryAttribute({componentDatatype:dt.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:o}),normal:new dt.GeometryAttribute({componentDatatype:dt.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:s}),st:new dt.GeometryAttribute({componentDatatype:dt.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:l})},i=dt.BoundingSphere.fromVertices(o),e=new dt.Geometry({attributes:n,indices:y,primitiveType:dt.PrimitiveType.LINES,boundingSphere:i});return o=[],y=[],l=[],e},I.fromAngleAndLength=function(t,e,i){return t=dt.Math.toRadians(t),new I({topRadius:Math.tan(t)*e/2,bottomRadius:0,length:e,zReverse:i})},dt.Scene.CylinderGeometry=I},_installRadarPrimitive:function(){var i;function t(t,e){e=e||{},i=t.scene.globe.ellipsoid,this._geometry=null,this._angle=e.angle,this._radius=e.radius||5,this._position=e.position,this._rotation=e.rotation||{heading:0,pitch:0,roll:0},this._trackedEntity=e.trackedEntity,this.defaultColor=e.color||dt.Color.YELLOW,this.defaultLineColor=e.lineColor||this.defaultColor,this._show=dt.defaultValue(e.show,!0),this._outline=dt.defaultValue(e.outline,!1),this._topShow=dt.defaultValue(e.top,!0),this._topOutline=dt.defaultValue(e.topOutline,!0),this._modelMatrix=dt.Matrix4.clone(dt.Matrix4.IDENTITY),this._quaternion=new dt.Quaternion,this._translation=new dt.Cartesian3,this._scale=new dt.Cartesian3(1,1,1),this._matrix=new dt.Matrix4,this._inverseMatrix=new dt.Matrix4,this._positionCartographic=new dt.Cartographic,this._positionCartesian=null,this._drawCommands=[],this._outlinePositions=[],this.viewer=t,this.viewer.scene.primitives.add(this),this.updateGeometry(),this._groundArea=dt.defaultValue(e.groundArea,!1),this.addGroundAreaEntity(this._groundArea)}Object.defineProperties(t.prototype,{trackedEntity:{get:function(){return this._trackedEntity},set:function(t){this._trackedEntity=t}},color:{get:function(){return this.defaultColor},set:function(t){this.defaultColor=t}},lineColor:{get:function(){return this.defaultLineColor},set:function(t){this.defaultLineColor=t}},show:{get:function(){return this._show},set:function(t){this._show=t}},outline:{get:function(){return this._outline},set:function(t){this._outline=t,this.updateGeometry()}},top:{get:function(){return this._topShow},set:function(t){this._topShow=t,this.updateGeometry()}},topOutline:{get:function(){return this._topOutline},set:function(t){this._topOutline=t,this.updateGeometry()}},groundArea:{get:function(){return this._groundArea},set:function(t){this._groundArea=t,this.addGroundAreaEntity(this._groundArea)}},angle:{get:function(){return this._angle},set:function(t){this._angle=t,this.updateGroundCircleRadius(),this.updateGeometry()}},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this.updateGroundCircleRadius(),this.updateGeometry()}},heading:{get:function(){return this._rotation.heading},set:function(t){this._rotation.heading=t}},pitch:{get:function(){return this._rotation.pitch},set:function(t){this._rotation.pitch=t}},roll:{get:function(){return this._rotation.roll},set:function(t){this._rotation.roll=t}},position:{get:function(){return this._position},set:function(t){this._position=t}}}),t.prototype.updateGroundCircleRadius=function(){this._ground_radius=this._radius*Math.cos(dt.Math.toRadians(this._angle))},t.prototype.addGroundAreaEntity=function(t){var e;t&&!this.groundAreaEntity&&((e=this).updateGroundCircleRadius(),this.groundAreaEntity=viewer.entities.add({position:this._position,ellipse:{show:0===this._rotation.pitch&&0===this._rotation.roll,semiMinorAxis:new dt.CallbackProperty(function(t){return e._ground_radius},!1),semiMajorAxis:new dt.CallbackProperty(function(t){return e._ground_radius},!1),material:this.defaultColor},polyline:{show:this._trackedEntityPosition&&(0!==this._rotation.pitch||0!==this._rotation.roll),positions:new dt.CallbackProperty(function(t){return!e._trackedEntityPosition||dt.Cartesian3.distance(e._position,e._trackedEntityPosition)>e._radius?[]:[e._position,e._trackedEntityPosition]},!1),followSurface:!1,material:new dt.PolylineDashMaterialProperty({color:dt.Color.CYAN}),width:1}}))};var n=new dt.Cartesian3;t.prototype.computeMatrix=function(t,e){return this._positionCartesian||(this._positionCartesian=new dt.Cartesian3),this.position instanceof dt.Cartesian3?this._positionCartesian=this.position:"function"==typeof this.position.getValue?this._positionCartesian=this.position.getValue(t):this.position._value&&this.position._value instanceof dt.Cartesian3&&(this._positionCartesian=this.position._value),this._trackedEntity&&this._trackedEntity.position&&(this._positionCartesian,t=dt.Property.getValueOrUndefined(this._trackedEntity.position,t,n))&&(this._trackedEntityPosition=t,this._rotation.heading=0,this._rotation.pitch=40,this._rotation.roll=0),this._modelMatrix=dt.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,i,this._modelMatrix),this._positionCartographic=dt.Cartographic.fromCartesian(this._positionCartesian,i,this._positionCartographic),dt.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,i,this._modelMatrix),dt.Quaternion.fromHeadingPitchRoll(this._rotation,this._quaternion),this._matrix=dt.Matrix4.fromTranslationQuaternionRotationScale(this._translation,this._quaternion,this._scale,this._matrix),dt.Matrix4.multiplyTransformation(this._modelMatrix,this._matrix,this._matrix),dt.Matrix4.inverseTransformation(this._matrix,this._inverseMatrix),this._matrix},t.prototype.getTopGeometry=function(){for(var t=this.radius,e=[],i=[],n=[],a=[],r=90-parseInt(this.angle),o=r<1?r/8:1,s=2*Math.PI/127,l=0,c=this.angle;c<91;c+=o){for(var h=dt.Math.toRadians(c<90?c:90),h=Math.cos(h)*t,d=[],x=0;x<128;x++){var u=s*x,S=h*Math.cos(u),u=h*Math.sin(u),p=Math.sqrt(t*t-S*S-u*u);e.push(S,u,p),i.push(1,1),d.push(l++)}a.push(d)}for(c=1;c<a.length;c++)for(x=1;x<a[c].length;x++){var g=a[c-1][x-1],m=a[c][x-1],f=a[c][x],v=a[c-1][x];n.push(g,m,f),n.push(g,f,v)}var e=new Float32Array(e),n=new Int32Array(n),i=new Float32Array(i),r={position:new dt.GeometryAttribute({componentDatatype:dt.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new dt.GeometryAttribute({componentDatatype:dt.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i})},b=dt.BoundingSphere.fromVertices(e),r=new dt.Geometry({attributes:r,indices:n,primitiveType:dt.PrimitiveType.TRIANGLES,boundingSphere:b});return(0,dt.Scene.computeVertexNormals)(r),r},t.prototype.getTopOutlineGeometry=function(){for(var t=this.radius,e=[],i=[],n=[],a=[],r=90-parseInt(this.angle),o=r<1?r/8:1,s=2*Math.PI/127,l=0,c=this.angle;c<91;c+=o){for(var h=dt.Math.toRadians(c<90?c:90),h=Math.cos(h)*t,d=[],x=0;x<128;x++){var u=s*x,S=h*Math.cos(u),u=h*Math.sin(u),p=Math.sqrt(t*t-S*S-u*u);e.push(S,u,p),i.push(1,1),d.push(l++)}a.push(d)}for(c=1;c<a.length;c++)for(x=1;x<a[c].length;x++){var g=a[c-1][x-1],m=a[c][x-1],f=a[c][x];a[c-1][x],x%8==1&&n.push(g,m),c%8==1&&n.push(m,f)}var e=new Float32Array(e),n=new Int32Array(n),i=new Float32Array(i),r={position:new dt.GeometryAttribute({componentDatatype:dt.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new dt.GeometryAttribute({componentDatatype:dt.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i})},v=dt.BoundingSphere.fromVertices(e),r=new dt.Geometry({attributes:r,indices:n,primitiveType:dt.PrimitiveType.LINES,boundingSphere:v});return(0,dt.Scene.computeVertexNormals)(r),r},t.prototype.updateGeometry=function(){this._geometry=dt.Scene.CylinderGeometry.createGeometry(new dt.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(dt.Math.toRadians(this.angle)),bottomRadius:0,length:this._radius*Math.sin(dt.Math.toRadians(this.angle))})),this._topGeometry=this.getTopGeometry(),this._topOutlineGeometry=this.getTopOutlineGeometry(),this._outlineGeometry=dt.Scene.CylinderGeometry.createOutlineGeometry(new dt.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(dt.Math.toRadians(this.angle)),bottomRadius:0,slices:128,length:this._radius*Math.sin(dt.Math.toRadians(this.angle))})),this._positions=new Float32Array(this._geometry.attributes.position.values.length);for(var t=0;t<this._positions.length;t++)this._positions[t]=this._geometry.attributes.position.values[t];this._drawCommands&&this._drawCommands.length&&(this._drawCommands.forEach(function(t){t.vertexArray=t.vertexArray&&t.vertexArray.destroy()}),this._drawCommands.splice(0,this._drawCommands.length))},t.prototype.update=function(e){this._show&&(this.computeMatrix(e.time),e.mode===dt.SceneMode.SCENE3D?(this._geometry.boundingSphere=dt.BoundingSphere.fromVertices(this._geometry.attributes.position.values),this._drawCommands&&this._drawCommands.length||(this._drawCommands.push(this.createDrawCommand(this._geometry,e)),this._outline&&this._drawCommands.push(this.createDrawCommand(this._outlineGeometry,e)),this._topShow&&(this._drawCommands.push(this.createDrawCommand(this._topGeometry,e)),this._topOutline)&&this._drawCommands.push(this.createDrawCommand(this._topOutlineGeometry,e))),this._drawCommands.forEach(function(t){e.commandList.push(t)}),this.groundAreaEntity&&(this.groundAreaEntity.ellipse.show=this._groundArea&&0===this._rotation.pitch&&0===this._rotation.roll,this.groundAreaEntity.polyline.show=!1)):(this.groundAreaEntity||this.addGroundAreaEntity(!0),this.groundAreaEntity.ellipse.show=0===this._rotation.pitch&&0===this._rotation.roll,this.groundAreaEntity.polyline.show=this._trackedEntityPosition&&(0!==this._rotation.pitch||0!==this._rotation.roll)))},t.prototype.getFragmentShaderSource=function(t){return"#version 300 es\n in vec3 v_position;\n in vec3 v_normal; \n uniform float picked; \n uniform vec4 pickedColor; \n uniform vec4 defaultColor; \n uniform float specular; \n uniform float shininess; \n uniform vec3 emission; \n in vec2 v_st; \n uniform bool isLine; \n uniform float glowPower; \n void main() { \n vec3 positionToEyeEC = -v_position; \n vec3 normalEC = normalize(v_normal); \n vec4 color = defaultColor; \n if (picked != 0.0) { \n color = pickedColor; \n } \n czm_material material; \n material.specular = specular; \n material.shininess = shininess; \n material.normal = normalEC; \n material.emission = emission;//vec3(0.2,0.2,0.2);\n material.diffuse = color.rgb ;\n if(isLine){\n material.alpha = 1.0; \n }\n else{ \n material.alpha = color.a; \n }\n if(v_st.x==0.0){ \n out_FragColor =color ;\n }else { \n out_FragColor = czm_phong(normalize(positionToEyeEC), material,czm_lightDirectionEC) ; \n } \n }"},t.prototype.getVertexShaderSource=function(t){return"#version 300 es\n #ifdef GL_ES\n precision highp float;\n #endif\n\n in vec3 position;\n in vec2 st;\n in vec3 normal;\n uniform mat4 modelViewMatrix;\n uniform mat3 normalMatrix;\n uniform mat4 projectionMatrix;\n out vec3 v_position;\n out vec3 v_normal;\n out vec2 v_st;\n\n out vec3 v_light0Direction;\n\n void main(void) \n {\n vec4 pos = modelViewMatrix * vec4( position,1.0);\n v_normal = normalMatrix * normal;\n v_st = st;\n v_position = pos.xyz;\n v_light0Direction = mat3( modelViewMatrix) * vec3(1.0,1.0,1.0);\n gl_Position = projectionMatrix * pos;\n }"},t.prototype.createDrawCommand=function(t,e,i){var n=e.context,a=new dt.Cartesian3,a=(dt.Matrix4.multiplyByPoint(this._matrix,t.boundingSphere.center,a),new dt.BoundingSphere(a,t.boundingSphere.radius)),i=new dt.DrawCommand({modelMatrix:i||this._matrix,owner:this,primitiveType:t.primitiveType,pass:dt.Pass.TRANSLUCENT,boundingVolume:a}),r=this,a=dt.GeometryPipeline.createAttributeLocations(t);return i.vertexArray=dt.VertexArray.fromGeometry({context:n,geometry:t,attributeLocations:a,bufferUsage:dt.BufferUsage.STATIC_DRAW}),i.vertexArray._attributeLocations=a,i.shaderProgram=dt.ShaderProgram.replaceCache({context:n,vertexShaderSource:this.getVertexShaderSource(t),fragmentShaderSource:this.getFragmentShaderSource(t),attributeLocations:a}),i.renderState=dt.RenderState.fromCache({blending:dt.BlendingState.ALPHA_BLEND,depthTest:{enabled:!0,func:dt.DepthFunction.LESS},cull:{enabled:!1,face:dt.CullFace.BACK}}),i.uniformMap={},i.uniformMap.projectionMatrix=function(){return e.context.uniformState.projection},i.uniformMap.modelViewMatrix=function(){return e.context.uniformState.modelView},i.uniformMap.shininess=function(){return r.shininess||(r.shininess=0),r.shininess},i.uniformMap.emission=function(){return r.emission||(r.emission=new dt.Cartesian3(.2,.2,.2)),r.emission},i.uniformMap.specular=function(){return r.specular||(r.specular=0),r.specular},i.uniformMap.isLine=function(){return t.primitiveType==dt.PrimitiveType.LINES||t.primitiveType==dt.PrimitiveType.LINE_STRIP},i.uniformMap.defaultColor=function(){return t.primitiveType==dt.PrimitiveType.LINES||t.primitiveType==dt.PrimitiveType.LINE_STRIP?(r.defaultLineColor||(r.defaultLineColor=new dt.Color(1,1,0,1)),r.defaultLineColor):(r.defaultColor||(r.defaultColor=new dt.Color(1,0,0,1)),r.defaultColor)},i.uniformMap.picked=function(){return r.picked||(r.picked=0),r.picked},i.uniformMap.pickedColor=function(){return r.pickedColor||(r.pickedColor=new dt.Color(1,1,0,1)),r.pickedColor},i.uniformMap.normalMatrix=function(){return e.context.uniformState.normal},i.uniformMap.glowPower=function(){return.25},i},t.prototype.remove=function(){this.viewer.scene.primitives.remove(this),this.groundAreaEntity&&this.viewer.entities.remove(this.groundAreaEntity)},t.prototype.addToScene=function(){this.viewer.scene.primitives.add(this),this.groundAreaEntity&&this.viewer.entities.add(this.groundAreaEntity)},t.prototype.destroy=function(t){t&&(this.viewer.scene.primitives.remove(this),this.groundAreaEntity&&this.viewer.entities.remove(this.groundAreaEntity),this._drawCommands.forEach(function(t){t.vertexArray=t.vertexArray&&t.vertexArray.destroy()}),this._drawCommands=[])},dt.Scene.RadarPrimitiveRight=t},_installCounputeVertex:function(){var a=new dt.Cartesian3,r=(new dt.Ray,new dt.Cartographic);dt.Scene.computeVertexNormals=function(t){var e=t.indices,i=t.attributes,n=e.length;if(i.position){var a=i.position.values;if(void 0===i.normal)i.normal=new dt.GeometryAttribute({componentDatatype:dt.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(a.length)});else for(var r=i.normal.values,o=0;o<n;o++)r[o]=0;for(var s,l,c,h=i.normal.values,d=new dt.Cartesian3,x=new dt.Cartesian3,u=new dt.Cartesian3,S=new dt.Cartesian3,p=new dt.Cartesian3,o=0;o<n;o+=3)s=3*e[o+0],l=3*e[o+1],c=3*e[o+2],dt.Cartesian3.fromArray(a,s,d),dt.Cartesian3.fromArray(a,l,x),dt.Cartesian3.fromArray(a,c,u),dt.Cartesian3.subtract(u,x,S),dt.Cartesian3.subtract(d,x,p),dt.Cartesian3.cross(S,p,S),h[s]+=S.x,h[1+s]+=S.y,h[2+s]+=S.z,h[l]+=S.x,h[1+l]+=S.y,h[2+l]+=S.z,h[c]+=S.x,h[1+c]+=S.y,h[2+c]+=S.z;for(var g,m,f,v,b=t.attributes.normal.values,y=0;y<b.length;y+=3)g=b[y],m=b[y+1],f=b[y+2],v=1/Math.sqrt(g*g+m*m+f*f),b[y]=g*v,b[y+1]=m*v,b[y+2]=f*v;i.normal.needsUpdate=!0}return t},dt.Scene.extend2Earth=function(t,e,i,n){n=n||dt.Ellipsoid.WGS84,dt.Matrix4.multiplyByPoint(e,t,a),dt.Cartesian3.subtract(a,i.origin,i.direction),dt.Cartesian3.normalize(i.direction,i.direction);e=dt.IntersectionTests.rayEllipsoid(i,n),n=null;if(n=e?dt.Ray.getPoint(i,e.start):n)try{dt.Cartographic.fromCartesian(n,null,r)}catch(t){return null}return n}}};export{pt as initCesium};
5
+ `),-1!==a.indexOf(r)&&(n[e]=n[e].replace(r,t))}}getCurCenterlonLat(t){t=t.camera.pickEllipsoid(new o.Cartesian2(t.canvas.clientWidth/2,t.canvas.clientHeight/2)),t=o.Ellipsoid.WGS84.cartesianToCartographic(t);return{lon:180*t.longitude/Math.PI,lat:180*t.latitude/Math.PI}}}let l=null;function c(t,e,i){t&&(l=e,this._graphicsLayer=new l.CustomDataSource("graphicsLayer"),t)&&t.dataSources.add(this._graphicsLayer)}c.prototype={getPointGraphics:function(t){if(t=t||{})return new l.PointGraphics({color:t.color||l.Color.GREEN,pixelSize:t.pixelSize||5,outlineColor:t.outlineColor||l.Color.WHITE,outlineWidth:t.outlineWidth||1})},getLineGraphics:function(t){if((t=t||{})&&t.positions)return new l.PolylineGraphics({show:!0,positions:t.positions,material:t.material||l.Color.YELLOW,width:t.width||1,clampToGround:t.clampToGround||!1})},getPolygonGraphics:function(t){if((t=t||{})&&t.positions)return new l.PolygonGraphics({hierarchy:{positions:t.positions},material:t.material||l.Color.RED.withAlpha(.2),clampToGround:t.clampToGround||!1})},getLabelGraphics:function(t){if((t=t||{})&&t.l_text)return new l.LabelGraphics({text:t.l_text,font:t.l_font||"14px sans-serif",fillColor:t.l_fillColor||l.Color.GOLD,style:t.l_style||l.LabelStyle.FILL_AND_OUTLINE,outlineWidth:t.l_outlineWidth||2,showBackground:t.l_showBackground||!1,backgroundColor:t.l_backgroundColor||new l.Color(.165,.165,.165,.8),verticalOrigin:t.l_verticalOrigin||l.VerticalOrigin.BOTTOM,pixelOffset:t.l_pixelOffset||new l.Cartesian2(0,-30)})},getBillboardGraphics:function(t){if((t=t||{})&&t.b_img)return new l.BillboardGraphics({image:t.b_img,width:t.b_width||35,height:t.b_height||35,clampToGround:t.b_clampToGround||!0,scale:t.b_scale||1,pixelOffset:t.b_pixelOffset||new l.Cartesian2(0,-20),scaleByDistance:t.b_scaleByDistance||void 0})},getPathGraphics:function(t){if(t=t||{})return new l.PathGraphics({resolution:t.resolution||1,material:new l.PolylineGlowMaterialProperty({glowPower:t.glowPower||.1,color:t.color||l.Color.YELLOW}),width:t.width||30})},getModelGraphics:function(t){if(t=t||{})return new l.ModelGraphics({uri:t.m_url,scale:t.m_scale||28,minimumPixelSize:t.m_minimumPixelSize||30,color:t.m_color||l.Color.WHITE})},getEllipseGraphics:function(t){if(t=t||{})return new l.EllipseGraphics({semiMajorAxis:t.e_semiMinorAxis||1e6,semiMinorAxis:t.e_semiMinorAxis||1e6,metarial:t.e_metarial||l.Color.RED.withAlpha(.5),outline:t.e_outline||!0})},getEllipsoidGraphics:function(t){var e;if(t=t||{})return e=t.radii||1e6,new l.EllipsoidGraphics({radii:new l.Cartesian3(e,e,e),maximumCone:t.maximumCone||l.Math.PI_OVER_TWO,stackPartitions:t.stackPartitions||56,slicePartitions:t.slicePartitions||56,outlineWidth:t.outlineWidth||2,outlineColor:t.outlineColor||l.Color.YELLOW,outline:t.outline||!0,fill:t.fill||!0,material:t.material||l.Color.RED.withAlpha(.1)})},getBoxGraphics:function(t){if(t=t||{show:!0,outline:!1,fill:!0})return new l.BoxGraphics({show:t.show,fill:t.fill,dimensions:t.dimensions||new l.Cartesian3(0,0,0),material:t.material,outline:t.outline,outlineColor:t.outlineColor||l.Color.BLACK,distanceDisplayCondition:t.distanceDisplayCondition||void 0})},getPlaneGraphics:function(t){if(t=t||{})return new l.PlaneGraphics({plane:t.plane||new l.Plane(l.Cartesian3.UNIT_Y,0),dimensions:t.dimensions||new l.Cartesian2(170,130),material:t.material||l.Color.BLUE})},getCylinderGraphics:function(t){if(t=t||{})return new l.CylinderGraphics({HeightReference:l.HeightReference.RELATIVE_TO_GROUND,length:t.length||250,topRadius:t.topRadius||0,bottomRadius:t.bottomRadius||0,material:t.material||new l.Color(0,1,1,.4),slices:t.slices||128})},createPointsGraphics:function(t){if(t&&t.positions){var e,i=[];for(e in t.positions){var n=t.positions[e],a=this.createGraphics();a.name=t.name||"",a.oid=t.oid||"point",a.position=n,t.point&&(a.point=this.getPointGraphics()),t.billboard&&(a.billboard=this.getBillboardGraphics(t.billboard)),t.label&&(a.label=this.getLabelGraphics(t.label)),i.push(this._graphicsLayer.entities.add(a))}return i}},createLineGraphics:function(t){var e;if(t&&t.positions)return(e=this.createGraphics()).name=t.name||"",e.oid=t.oid||"line",e.position=t.positions,e.polyline=this.getLineGraphics(t),this._graphicsLayer.entities.add(e)},createPolygonGraphics:function(t){var e;if(t=t||{})return(e=this.createGraphics()).polygon=this.getPolygonGraphics(t),e.clampToS3M=t.clampToS3M||!1,this._graphicsLayer.entities.add(e)},createBoxGraphics:function(t){var e;if(t=t||{})return(e=this.createGraphics()).position=t.position,e.name=t.name||"box_graphic",e.box=this.getBoxGraphics(t.box),this._graphicsLayer.entities.add(e)},createModelGraphics:function(t){var e;if(t&&t.position)return(e=this.createGraphics()).model=this.getModelGraphics(t),e.position=t.position,this._graphicsLayer.entities.add(e)},craeteCorridorGraphics:function(t){var e;if(t&&t.positions)return(e=this.createGraphics()).corridor={positions:t.positions,height:t.height||6,width:t.width||15,material:t.material||new l.Scene.WarnLinkMaterialProperty({freely:"cross",color:l.Color.YELLOW,duration:1e3,count:1,direction:"+"})},this._graphicsLayer.entities.add(e)},craeteDynamicPolyLineGraphics:function(t){var e;if(t&&t.positions)return(e=this.createGraphics()).polyline={show:!0,positions:[],material:t.material||l.Color.CHARTREUSE,width:t.width||5,clampToGround:t.clampToGround||!1},e.polyline.positions=new l.CallbackProperty(function(){return t.positions},!1),this._graphicsLayer.entities.add(e)},craeteDynamicCylinderGraphics:function(t){var i,n,e={};if(t&&t.cylinder)return i=t.entity,t=t.cylinder,e.cylinder=(n=this).getCylinderGraphics(t),e.position=new l.CallbackProperty(function(){var t=i.position.getValue(n._viewer.clock.currentTime),t=n._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),e=l.Math.toDegrees(t.latitude),t=l.Math.toDegrees(t.longitude);return l.Cartesian3.fromDegrees(t,e,0)},!1),e.cylinder.length=new l.CallbackProperty(function(){var t=i.position.getValue(n._viewer.clock.currentTime);return 2*n._viewer.scene.globe.ellipsoid.cartesianToCartographic(t).height},!1),e},createFadeCylinderGraphics:function(t){var e;if((t=t||{})&&t.position)return(e=this.createGraphics()).position=t.position,t.material=new l.Scene.CircleFadeMaterialProperty({color:t.color||l.Color.fromCssColorString("#02ff00"),duration:t.duration||2e3}),e.cylinder=this.getCylinderGraphics(t),this._drawLayer.entities.add(e)},craeteRotateCylinderGraphics:function(t){var e;if(t&&t.position)return(e=this.createGraphics()).cylinder={HeightReference:l.HeightReference.RELATIVE_TO_GROUND,length:t.length||500,topRadius:t.topRadius||500,bottomRadius:t.bottomRadius||500,material:t.material||new l.ImageMaterialProperty({image:t.img||this.getDfSt(["graphic","craeteRotateCylinderGraphics"])||"static/data/images/file/cc2.png",transparent:!0,repeat:{x:1,y:-1}}),slices:t.slices||128},e.position=t.position,this.setGraphicsRotate({entity:e,position:this.transformCartesianToWGS84(t.position),rotateAmount:4}),this._graphicsLayer.entities.add(e)},craeteDynamicBlinkCircleGraphics:function(t){var e,i,n;if(t&&t.position)return e=this.createGraphics(),i=t.alp||1,n=t.flog||!0,e.position=t.position,e.ellipse={semiMinorAxis:t.semiMinorAxis||2e3,semiMajorAxis:t.semiMajorAxis||2e3,height:t.height||10,material:new l.ColorMaterialProperty(new l.CallbackProperty(function(){return n?(i-=.05)<=0&&(n=!1):1<=(i+=.05)&&(n=!0),l.Color.RED.withAlpha(i)},!1))},this._graphicsLayer.entities.add(e)},craeteDynamicCricleGraphics:function(i){if(i&&i.center){var n=this.createGraphics(),a=this,r=i.center,o=i.radius||800,s=i.rotateAmount||.05,c=0,h=i.height||1,u=i.scale||null,x=i.scale2||null,i=i.material||new l.ImageMaterialProperty({image:i.imge||this.getDfSt(["graphic","craeteDynamicCricleGraphics"])||"static/data/images/Textures/circle_bg.png",transparent:!0});n.position=new l.CallbackProperty(function(){return a.transformWGS84ToCartesian(r)},!1),n.orientation=new l.CallbackProperty(function(){return l.Transforms.headingPitchRollQuaternion(a.transformWGS84ToCartesian(r),new l.HeadingPitchRoll(l.Math.toRadians(0),l.Math.toRadians(0),l.Math.toRadians(0)))},!1);let t=o,e=!1;return n.ellipse={material:i,height:h,semiMajorAxis:new l.CallbackProperty(function(){return o},!1),semiMinorAxis:new l.CallbackProperty(function(){return o},!1),stRotation:new l.CallbackProperty(function(){return 0<s&&360<=(c+=s)&&(c=0),u&&((e=u<=o||o<=t?!e:e)?o+=2:o-=2),x&&(o<=x?o+=2:o=t),c},!1)},this._graphicsLayer.entities.add(n)}},craeteDynamicShadeWallGraphics:function(t){var e,i,n,a,r;if(t&&t.positions)return e=t.alp||1,i=t.num||20,n=t.color||l.Color.RED,a=t.speed||.003,(r=this.createGraphics()).wall={positions:t.positions,material:new l.ImageMaterialProperty({image:t.img||this.getDfSt(["graphic","craeteDynamicShadeWallGraphics"])||"static/data/images/Textures/fence.png",transparent:!0,color:new l.CallbackProperty(function(){return i%2==0?e-=a:e+=a,(e<=.1||1<=e)&&i++,n.withAlpha(e)},!1)})},this._graphicsLayer.entities.add(r)},createCustomDefBillboardGraphics:function(e){if(e&&e.position){var i=this,n=document.createElement("img");n.src=e.img||this.getDfSt(["graphic","createCustomDefBillboardGraphics"])||"static/data/images/file/div1.png";n.onload=function(){e.image=n;var t=i._graphicsLayer.entities.add({position:e.position,billboard:{image:function(t){var e,i;if(t.image)return(e=document.createElement("canvas")).width=t.width||150,e.height=t.height||80,(i=e.getContext("2d")).drawImage(t.image,0,0),t=t.text,i.font="15px bold 宋体",i.fillStyle="#f4fff0",i.fillText(t,55,36),e}(e),scaleByDistance:new l.NearFarScalar(150,.7,15e6,.5),verticalOrigin:l.VerticalOrigin.BOTTOM,pixelOffset:e.b_pixelOffset||new l.Cartesian2(80,-35),width:140,height:100,scale:e.b_scale||1.5,disableDepthTestDistance:Number.POSITIVE_INFINITY,imageSubRegion:{x:0,y:0,width:200,height:150}}});"function"==typeof e.callback&&e.callback(t)}}},craeteRotatePlaneGraphics:function(t){var e,i,n,a;if(t&&t.center&&t.positions)return e=this.createGraphics(),i=0,n=t.positions,a=n[0],e.position=new l.CallbackProperty(function(){return 0==i?(a=n[0],i+=1):i<n.length-1?(a=n[i],i+=1):i==n.length-1&&(a=n[i],i=0),a},!1),e.plane={plane:new l.Plane(l.Cartesian3.UNIT_Y,0),dimensions:t.dimensions||new l.Cartesian2(200,150),material:new l.ImageMaterialProperty({image:t.image})},this._graphicsLayer.entities.add(e)},createVideoPlaneGraphics:function(t){var e;if(t&&t.position)return(e=this.createGraphics()).position=t.position,e.plane={plane:new l.Plane(t.normal||l.Cartesian3.UNIT_Y,0),dimensions:t.dimensions||new l.Cartesian2(200,150),material:new l.ImageMaterialProperty({image:t.videoElement})},this._graphicsLayer.entities.add(e)},createGifBillboardGraphics:function(t){var i,n,a,r,o,s,c;if(e&&t&&t.position)return n=t.url,a=0,r=n,o=i=[],(s=document.createElement("img")).src=r,s.setAttribute("rel:animated_src",r),s.setAttribute("rel:auto_play","0"),document.body.appendChild(s),c=new e({gif:s}),new Promise(t=>{c.load(()=>{for(let t=1;t<=c.get_length();t++)c.move_to(t),o.push(c.get_canvas().toDataURL());t(o)})}),this._graphicsLayer.entities.add({position:t.position,billboard:{verticalOrigin:l.VerticalOrigin.BASELINE,image:new l.CallbackProperty(function(){return i.length?(a<6*(i.length-1)?a++:a=0,i[Math.floor(a/6)]):n},!1),scale:.2}})},setGraphicsRotate:function(t){var e,i,n,a;t&&t.entity&&t.rotateAmount&&(e=t.entity,i=t.rotateAmount,n=t.position,a=this,n.heading=0,n.pitch=0,n.roll=0,e.position=new l.CallbackProperty(function(){return a.transformWGS84ToCartesian(n)},!1),e.orientation=new l.CallbackProperty(function(){return 0<i&&(n.heading+=i,360===n.heading)&&(n.heading=0),l.Transforms.headingPitchRollQuaternion(a.transformWGS84ToCartesian(n),new l.HeadingPitchRoll(l.Math.toRadians(n.heading),l.Math.toRadians(n.pitch),l.Math.toRadians(n.roll)))},!1))},setGraphicsFloat:function(t){if(t&&t.entity&&t.maxHeiht)try{var e=t.entity,n=t.minHeiht||5,a=t.maxHeiht||100,r=t.cartesians,o=t.speed||.06,s=this,c=n,h=!1;r.length?e.positions=new l.CallbackProperty(function(){var t,e=s.transformCartesianArrayToWGS84Array(r);for(t in e){var i=e[t];(h=a<=n||n<=c?!h:h)?n+=o:n-=o,i.alt=n}return s.transformWGS84ArrayToCartesianArray(e)},!1):e.position=new l.CallbackProperty(function(){var t=s.transformCartesianToWGS84(r);return(h=a<=n||n<=c?!h:h)?n+=o:n-=o,t.alt=n,s.transformWGS84ToCartesian(t)},!1)}catch(t){console.log(t)}},createCanvasGraphics:function(a){a&&a.positions&&(this._graphicsLayer.entities.add({rectangle:{coordinates:a.positions,material:new l.ImageMaterialProperty({image:new l.CallbackProperty(function(){var t=0,e=document.createElement("canvas"),i=e.getContext("2d"),n=new Image;if(n.src=a.img||"../../images/ysCesium/logo.png",i.clearRect(0,0,a.cwidth,a.cheight),!(t<=a.cwidth))return t=0,t+=3,e;i.drawImage(n,t,0)},!1),transparent:!0})}}),"function"==typeof a.callback)&&a.callback()}};let x=null;function u(t,e,i){t&&(x=e,this._installMaterial())}function d(){}u.prototype={addMaterialLineGraphics:function(t){var e;if(this._viewer&&t&&t.image)return this._initPolylineCustomMaterialProperty(t),(e=this.createGraphics()).polyline={positions:t.positions,material:new x.PolylineCustomMaterialProperty({color:t.color||x.Color.RED,duration:t.duration||500}),width:t.width},this._viewer.entities.add(e)},getCustomMaterialLine:function(t){if(this._viewer&&t&&t.image)return this._initPolylineCustomMaterialProperty(t)},_initPolylineCustomMaterialProperty(i){if(i){var t=x.Color,e=x.defaultValue,n=x.defined,a=Object.defineProperties,r=x.Event,o=x.createPropertyDescriptor,s=x.Property,l=x.Material,c=t.WHITE,h=i.MaterialType||"wallType"+parseInt(1e3*Math.random());const u=function(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=t.color||x.Color.BLUE,this.duration=t.duration||1e3,this._time=void 0};return a(u.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color")}),u.prototype.getType=function(){return h},u.prototype.getValue=function(t,e){return(e=n(e)?e:{}).color=s.getValueOrClonedDefault(this._color,t,c,e.color),e.image=i.image,void 0===this._time&&(this._time=t.secondsOfDay),e.time=1e3*(t.secondsOfDay-this._time)/this.duration,e},u.prototype.equals=function(t){return this===t||t instanceof u&&s.equals(this._color,t._color)},l._materialCache.addMaterial(h,{fabric:{type:h,uniforms:{color:i.color||new x.Color(1,0,0,.5),image:i.image,time:i.color.time||0},source:this._getDynamicLineShader({get:!0})},translucent:function(){return!0}}),new u(i)}},addMaterialWallGraphics:function(t){var e;if(this._viewer&&t&&t.image)return this._initWallCustomMaterialProperty(t),(e=this.createGraphics()).wall={positions:t.positions,material:new x.Scene.WallLinkCustomMaterialProperty({color:t.color||x.Color.RED,duration:t.duration||500}),width:t.width},this._viewer.entities.add(e)},getCustomMaterialWall:function(t){if(this._viewer&&t&&t.image)return this._initWallCustomMaterialProperty(t)},_initWallCustomMaterialProperty(i){var n=x.Color,e=x.defaultValue,a=x.defined,t=Object.defineProperties,r=x.Event,o=x.createPropertyDescriptor,s=x.Property,l=x.Material,c=i.MaterialType||"wallType"+parseInt(1e3*Math.random());function h(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=t.color||n.BLUE,this.duration=t.duration||3e3,this._time=(new Date).getTime()}return t(h.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color")}),h.prototype.getType=function(){return c},h.prototype.getValue=function(t,e){return(e=a(e)?e:{}).color=s.getValueOrClonedDefault(this._color,t,n.WHITE,e.color),e.image=i.image,e.time=((new Date).getTime()-this._time)%this.duration/this.duration,e},h.prototype.equals=function(t){return this===t||t instanceof h&&s.equals(this._color,t._color)},l._materialCache.addMaterial(c,{fabric:{type:c,uniforms:{color:new n(1,0,0,.5),image:i.image,time:0},source:this._getDirectionWallShader({get:!0,count:i.count,freely:i.freely,direction:i.direction})},translucent:function(){return!0}}),new(x.Scene.WallLinkCustomMaterialProperty=h)(i)},_installMaterial:function(){this._installWaveCircleMaterial(),this._installCircleFadeMaterial(),this._installCityLineMaterial(),this._installWarnMaterial(),this._installFlowMaterial()},_installWaveCircleMaterial:function(){var e=x.Color,i=x.defaultValue,t=Object.defineProperties,n=x.Event,a=x.Property,r=x.Material;function o(t){t=t||{},this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._duration=void 0,this._durationSubscription=void 0,this.color=i(t.color,e.fromBytes(0,255,255,255)),this.duration=i(t.duration,45),this.count=Math.max(i(t.count,2),1),this.gradient=i(t.gradient,.1),this.gradient<0?this.gradient=0:1<this.gradient&&(this.gradient=1)}t(o.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),o.prototype.getType=function(){return r.CircleWaveType},o.prototype.getValue=function(t,e){return(e=e||{}).color=a.getValueOrUndefined(this._color,t),e.duration=this._duration,e.count=this.count,e.gradient=this.gradient,e},o.prototype.equals=function(t){return this===t||t instanceof o&&x.Property.equals(this._color,t._color)},t(o.prototype,{color:x.createPropertyDescriptor("color"),duration:x.createPropertyDescriptor("duration")}),x.Scene.CircleWaveMaterialProperty=o,r.CircleWaveType="CircleWave",r._materialCache.addMaterial(r.CircleWaveType,{fabric:{type:r.CircleWaveType,uniforms:{color:new e(1,0,0,.7),duration:45,count:1,gradient:.1},source:this._getDynamicCircleShader({get:!0})},translucent:function(){return!0}})},_installCircleFadeMaterial:function(){var t=x.Color,e=x.defaultValue,i=Object.defineProperties,n=x.Event,a=x.Property,r=x.Material,o=new t(0,0,0,0);function s(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this.color=e(t.color,o),this._duration=t.duration||1e3,this._time=void 0}i(s.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),s.prototype.getType=function(){return r.CircleFadeMaterialType},s.prototype.getValue=function(t,e){return(e=e||{}).color=a.getValueOrClonedDefault(this._color,t,o,e.color),void 0===this._time&&(this._time=(new Date).getTime()),e.time=((new Date).getTime()-this._time)/this._duration,e},s.prototype.equals=function(t){return this===t||t instanceof s&&x.Property.equals(this._color,t._color)},i(s.prototype,{color:x.createPropertyDescriptor("color")}),x.Scene.CircleFadeMaterialProperty=s,r.CircleFadeMaterialType="CircleFadeMaterial",r._materialCache.addMaterial(r.CircleFadeMaterialType,{fabric:{type:r.CircleFadeMaterialType,uniforms:{color:new t(1,0,0,1),time:1},source:this._getCircleFadeShader({get:!0})},translucent:function(){return!0}})},_installCityLineMaterial:function(){var t=x.Color,e=x.defaultValue,i=x.defined,n=Object.defineProperties,a=x.Event,r=x.createPropertyDescriptor,o=x.Property,s=x.Material,l=t.WHITE;function c(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new a,this._color=void 0,this._colorSubscription=void 0,this.color=t.color||x.Color.BLUE,this.duration=t.duration||1e3,this._time=void 0,this._img=t.imgUrl||s.PolylineCityLinkImage}n(c.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:r("color")}),c.prototype.getType=function(){return s.PolylineCityLinkType},c.prototype.getValue=function(t,e){return(e=i(e)?e:{}).color=o.getValueOrClonedDefault(this._color,t,l,e.color),e.image=this._img,void 0===this._time&&(this._time=t.secondsOfDay),e.time=1e3*(t.secondsOfDay-this._time)/this.duration,e},c.prototype.equals=function(t){return this===t||t instanceof c&&o.equals(this._color,t._color)},x.Scene.PolylineCityLinkMaterialProperty=c,s.PolylineCityLinkType="PolylineCityLink",s.PolylineCityLinkImage=this.getDfSt(["material","PolylineCityLinkMaterialProperty"])||"static/data/images/Textures/meteor_01.png",s._materialCache.addMaterial(s.PolylineCityLinkType,{fabric:{type:s.PolylineCityLinkType,uniforms:{color:new t(1,0,0,1),image:s.PolylineCityLinkImage,time:0},source:this._getDynamicLightLineShader({get:!0})},translucent:function(){return!0}})},_installWarnMaterial:function(){var i=x.Color,e=x.defaultValue,n=x.defined,t=Object.defineProperties,a=x.Event,r=x.createPropertyDescriptor,o=x.Property,s=x.Material;function l(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new a,this._color=void 0,this._colorSubscription=void 0,this.color=t.color||i.BLUE,this.duration=t.duration||3e3,this._time=(new Date).getTime()}t(l.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),l.prototype.getType=function(){return s.WarnLinkType},l.prototype.getValue=function(t,e){return(e=n(e)?e:{}).color=o.getValueOrClonedDefault(this._color,t,i.WHITE,e.color),e.image=s.WarnLinkImage,e.time=((new Date).getTime()-this._time)%this.duration/this.duration,e},l.prototype.equals=function(t){return this===t||t instanceof l&&o.equals(this._color,t._color)},t(l.prototype,{color:r("color")}),x.Scene.WarnLinkMaterialProperty=l,s.WarnLinkType="WarnWallLinkType",s.WarnLinkImage=this.getDfSt(["material","WarnLinkMaterialProperty"])||"static/data/images/Textures/jsx2.png",s._materialCache.addMaterial(s.WarnLinkType,{fabric:{type:s.WarnLinkType,uniforms:{color:new i(1,0,0,.5),image:s.WarnLinkImage,time:0},source:this._getDirectionWallShader({get:!0,count:10,freely:"cross",direction:"-"})},translucent:function(){return!0}})},_installFlowMaterial:function(){var e=x.Color,i=x.defaultValue,t=Object.defineProperties,n=x.Event,a=x.createPropertyDescriptor,r=x.Property,o=x.Material;function s(t){t=i(t,i.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this.color=t.color||e.fromBytes(0,255,255,255),this._duration=void 0,this._durationSubscription=void 0,this.duration=i(t.duration,45)}t(s.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),s.prototype.getType=function(){return o.PolylineFlowType},s.prototype.getValue=function(t,e){return(e=e||{}).color=r.getValueOrClonedDefault(this._color,t,x.Color.WHITE,e.color),e.duration=this._duration,e},s.prototype.equals=function(t){return this===t||t instanceof s&&r.equals(this._color,t._color)},t(s.prototype,{color:a("color"),duration:a("duration")}),x.Scene.PolylineFlowMaterialProperty=s,o.PolylineFlowType="PolylineFlow",o._materialCache.addMaterial(o.PolylineFlowType,{fabric:{type:o.PolylineFlowType,uniforms:{color:new e(1,1,2,.7),duration:45},source:this._getFlowLineShader({get:!0})},translucent:function(){return!0}})}},d.prototype={_getFlowLineShader:function(){return"uniform vec4 color;\n uniform float duration;\n \n czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n float t =fract(czm_frameNumber / duration);\n t *= 1.03;\n float alpha = smoothstep(t- 0.03, t, st.s) * step(-t, -st.s);\n alpha += 0.1;\n vec4 fragColor;\n fragColor.rgb = (color.rgb) / 0.5;\n fragColor = czm_gammaCorrect(fragColor);\n material.diffuse = fragColor.rgb;\n material.alpha = alpha;\n material.emission = fragColor.rgb;\n return material;\n }\n "},_getDynamicLineShader:function(t){if(t&&t.get)return"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n \n if(texture(image, vec2(0.0, 0.0)).a == 1.0){\n discard;\n }else{\n material.alpha = texture(image, vec2(1.0 - fract(time - st.s), st.t)).a * color.a;\n }\n \n material.diffuse = max(color.rgb * material.alpha * 3.0, color.rgb);\n \n return material;\n }\n "},_getDynamicLightLineShader:function(t){if(t&&t.get)return"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n \n vec4 colorImage = texture(image, vec2(fract(1.0 *st.s - time), fract(st.t)));\n \n vec4 fragColor;\n fragColor.rgb = (colorImage.rgb+color.rgb) / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.diffuse = colorImage.rgb;\n material.alpha = colorImage.a;\n material.emission = fragColor.rgb;\n \n return material;\n }\n "},_getDirectionWallShader:function(t){var e;if(t&&t.get)return e="czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n \n ","vertical"==t.freely?e+="vec4 colorImage = texture(image, vec2(fract(float("+t.count+")*st.t "+t.direction+" time), fract(st.s)));\n ":e+="vec4 colorImage = texture(image, vec2(fract(float("+t.count+")*st.s "+t.direction+" time), fract(st.t)));\n ",e+"vec4 fragColor;\n fragColor.rgb = (colorImage.rgb+color.rgb) / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.diffuse = colorImage.rgb;\n material.alpha = colorImage.a;\n material.emission = fragColor.rgb;\n \n return material;\n }\n "},_getCircleFadeShader:function(t){if(t&&t.get)return"czm_material czm_getMaterial(czm_materialInput materialInput)\n \n {\n \n czm_material material = czm_getDefaultMaterial(materialInput);\n \n material.diffuse = 1.5 * color.rgb;\n \n vec2 st = materialInput.st;\n \n float dis = distance(st, vec2(0.5, 0.5));\n \n float per = fract(time);\n \n if(dis > per * 0.5){\n \n //material.alpha = 0.0;\n \n discard;\n \n }else {\n \n material.alpha = color.a * dis / per / 2.0;\n \n }\n \n return material;\n \n }"},_getDynamicCircleShader:function(t){if(t&&t.get)return"uniform vec4 color;\n uniform float duration;\n uniform float count;\n uniform float gradient;\n \n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = 1.5 * color.rgb;\n vec2 st = materialInput.st;\n vec3 str = materialInput.str;\n float dis = distance(st, vec2(0.5, 0.5));\n float per = fract(czm_frameNumber / duration);\n if(abs(str.z) > 0.001){\n discard;\n }\n if(dis > 0.5){\n discard;\n } else {\n float perDis = 0.5 / count;\n float disNum;\n float bl = .0;\n for (int i = 0; i <= 10; i++) {\n if (float(i) <= count) {\n disNum = perDis * float(i) - dis + per / count;\n if (disNum > 0.0) {\n if (disNum < perDis) {\n bl = 1.0 - disNum / perDis;\n } else if (disNum - perDis < perDis) {\n bl = 1.0 - abs(1.0 - disNum / perDis);\n }\n material.alpha = pow(bl, gradient);\n }\n }\n }\n }\n return material;\n }\n "},_getRadarScanShader:function(t){if(t&&t.get)return"uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n in vec2 v_textureCoordinates;\n uniform vec4 u_scanCenterEC;\n uniform vec3 u_scanPlaneNormalEC;\n uniform vec3 u_scanLineNormalEC;\n out vec4 myOutputColor;\n uniform float u_radius;\n uniform vec4 u_scanColor;\n \n vec4 toEye(in vec2 uv, in float depth){\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\n \n bool isPointOnLineRight(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt){\n vec3 v01 = testPt - ptOnLine;\n normalize(v01);\n vec3 temp = cross(v01, lineNormal);\n float d = dot(temp, u_scanPlaneNormalEC);\n return d > 0.5;\n }\n \n vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point){\n vec3 v01 = point -planeOrigin;\n float d = dot(planeNormal, v01) ;\n return (point - planeNormal * d);\n }\n \n float distancePointToLine(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt){\n vec3 tempPt = pointProjectOnPlane(lineNormal, ptOnLine, testPt);\n return length(tempPt - ptOnLine);\n }\n \n float getDepth(in vec4 depth){\n float z_window = czm_unpackDepth(depth);\n z_window = czm_reverseLogDepth(z_window);\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n }\n \n void main(){\n myOutputColor = texture(colorTexture, v_textureCoordinates);\n float depth = getDepth( texture(depthTexture, v_textureCoordinates));\n vec4 viewPos = toEye(v_textureCoordinates, depth);\n vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\n float dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\n float twou_radius = u_radius * 2.0;\n if(dis < u_radius){\n float f0 = 1.0 -abs(u_radius - dis) / u_radius;\n f0 = pow(f0, 64.0);\n vec3 lineEndPt = vec3(u_scanCenterEC.xyz) + u_scanLineNormalEC * u_radius;\n float f = 0.0;\n if(isPointOnLineRight(u_scanCenterEC.xyz, u_scanLineNormalEC.xyz, prjOnPlane.xyz)){\n float dis1= length(prjOnPlane.xyz - lineEndPt);\n f = abs(twou_radius -dis1) / twou_radius;\n f = pow(f, float("+t.width+"));\n }\n if(float("+t.border+") > 0.0){\n myOutputColor = mix(myOutputColor, u_scanColor, f + f0);\n } else {\n myOutputColor = mix(myOutputColor, u_scanColor, f);\n }\n }\n }\n "},_getCircleScanShader:function(t){if(t&&t.get)return"uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n in vec2 v_textureCoordinates;\n uniform vec4 u_scanCenterEC;\n uniform vec3 u_scanPlaneNormalEC;\n uniform float u_radius;\n out vec4 myOutputColor;\n uniform vec4 u_scanColor;\n \n vec4 toEye(in vec2 uv, in float depth){\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\n \n vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point){\n vec3 v01 = point - planeOrigin;\n float d = dot(planeNormal, v01) ;\n return (point - planeNormal * d);\n }\n \n float getDepth(in vec4 depth){\n float z_window = czm_unpackDepth(depth);\n z_window = czm_reverseLogDepth(z_window);\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n }\n \n void main(){\n myOutputColor = texture(colorTexture, v_textureCoordinates);\n float depth = getDepth(texture(depthTexture, v_textureCoordinates));\n vec4 viewPos = toEye(v_textureCoordinates, depth);\n vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\n float dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\n if(dis < u_radius){\n float f = 1.0 - abs(u_radius - dis) / u_radius;\n f = pow(f, float("+t.border+"));\n myOutputColor = mix(myOutputColor, u_scanColor, f);\n }\n }\n "}};let p={},g=void 0;function m(t,e,i){t&&(this._viewer=t,p=e,g=i,p.Ion.defaultAccessToken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmYzkwZWEwYy1mMmIwLTQwYjctOWJlOC00OWU4ZWU1YTZhOTkiLCJpZCI6MTIxODIsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJpYXQiOjE1NjA0OTUyNDN9.wagvw7GxUjxvHXO6m2jjX5Jh9lN0UyTJhNGEcSm2pgE",this._drawLayer=new p.CustomDataSource("drawLayer"),t&&t.dataSources.add(this._drawLayer),this.myname="BASE",this._installBaiduImageryProvider(),this._installGooGleImageryProvider(),this._installAmapImageryProvider(),this._installTencentImageryProvider(),this._installTdtImageryProvider(),this._installGroundSkyBox())}m.prototype={createGraphics:function(){return new p.Entity},getDfSt(t){if(g)return t=t.reduce((t,e)=>(t||g)[e],void 0),g.baseService+t},setOneSkyBox:function(){return new p.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","one","positiveX"])||"static/data/images/SkyBox/00h+00.jpg",negativeX:this.getDfSt(["skyBox","one","negativeX"])||"static/data/images/SkyBox/12h+00.jpg",positiveY:this.getDfSt(["skyBox","one","positiveY"])||"static/data/images/SkyBox/06h+00.jpg",negativeY:this.getDfSt(["skyBox","one","negativeY"])||"static/data/images/SkyBox/18h+00.jpg",positiveZ:this.getDfSt(["skyBox","one","positiveZ"])||"static/data/images/SkyBox/06h+90.jpg",negativeZ:this.getDfSt(["skyBox","one","negativeZ"])||"static/data/images/SkyBox/06h-90.jpg"}})},setTwoSkyBox:function(){return new p.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","two","negativeZ"])||"static/data/images/SkyBox/Version2_dark_px.jpg",negativeX:this.getDfSt(["skyBox","two","negativeX"])||"static/data/images/SkyBox/Version2_dark_mx.jpg",positiveY:this.getDfSt(["skyBox","two","positiveY"])||"static/data/images/SkyBox/Version2_dark_py.jpg",negativeY:this.getDfSt(["skyBox","two","negativeY"])||"static/data/images/SkyBox/Version2_dark_my.jpg",positiveZ:this.getDfSt(["skyBox","two","positiveZ"])||"static/data/images/SkyBox/Version2_dark_pz.jpg",negativeZ:this.getDfSt(["skyBox","two","negativeZ"])||"static/data/images/SkyBox/Version2_dark_mz.jpg"}})},setThreeSkyBox:function(){return new p.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","three","negativeZ"])||"static/data/images/SkyBox/tycho2t3_80_pxs.jpg",negativeX:this.getDfSt(["skyBox","three","negativeX"])||"static/data/images/SkyBox/tycho2t3_80_mxs.jpg",positiveY:this.getDfSt(["skyBox","three","positiveY"])||"static/data/images/SkyBox/tycho2t3_80_pys.jpg",negativeY:this.getDfSt(["skyBox","three","negativeY"])||"static/data/images/SkyBox/tycho2t3_80_mys.jpg",positiveZ:this.getDfSt(["skyBox","three","positiveZ"])||"static/data/images/SkyBox/tycho2t3_80_pzs.jpg",negativeZ:this.getDfSt(["skyBox","three","negativeZ"])||"static/data/images/SkyBox/tycho2t3_80_mzs.jpg"}})},setOneGroundSkyBox:function(){return new p.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearOne","positiveX"])||"static/data/images/SkyBox/rightav9.jpg",negativeX:this.getDfSt(["skyBox","nearOne","negativeX"])||"static/data/images/SkyBox/leftav9.jpg",positiveY:this.getDfSt(["skyBox","nearOne","positiveY"])||"static/data/images/SkyBox/frontav9.jpg",negativeY:this.getDfSt(["skyBox","nearOne","negativeY"])||"static/data/images/SkyBox/backav9.jpg",positiveZ:this.getDfSt(["skyBox","nearOne","positiveZ"])||"static/data/images/SkyBox/topav9.jpg",negativeZ:this.getDfSt(["skyBox","nearOne","negativeZ"])||"static/data/images/SkyBox/bottomav9.jpg"}})},setTwoGroundSkyBox:function(){return new p.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearTwo","positiveX"])||"static/data/images/SkyBox/SunSetRight.png",negativeX:this.getDfSt(["skyBox","nearTwo","negativeX"])||"static/data/images/SkyBox/SunSetLeft.png",positiveY:this.getDfSt(["skyBox","nearTwo","positiveY"])||"static/data/images/SkyBox/SunSetFront.png",negativeY:this.getDfSt(["skyBox","nearTwo","negativeY"])||"static/data/images/SkyBox/SunSetBack.png",positiveZ:this.getDfSt(["skyBox","nearTwo","positiveZ"])||"static/data/images/SkyBox/SunSetUp.png",negativeZ:this.getDfSt(["skyBox","nearTwo","negativeZ"])||"static/data/images/SkyBox/SunSetDown.png"}})},setThreeGroundSkyBox:function(){return new p.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearThree","positiveX"])||"static/data/images/SkyBox/Right.jpg",negativeX:this.getDfSt(["skyBox","nearThree","negativeX"])||"static/data/images/SkyBox/Left.jpg",positiveY:this.getDfSt(["skyBox","nearThree","positiveY"])||"static/data/images/SkyBox/Front.jpg",negativeY:this.getDfSt(["skyBox","nearThree","negativeY"])||"static/data/images/SkyBox/Back.jpg",positiveZ:this.getDfSt(["skyBox","nearThree","positiveZ"])||"static/data/images/SkyBox/Up.jpg",negativeZ:this.getDfSt(["skyBox","nearThree","negativeZ"])||"static/data/images/SkyBox/Down.jpg"}})},setDarkEffect:function(t){return t=t||{},this._viewer.scene.postProcessStages.add(new p.PostProcessStage({name:"darkEffect",fragmentShader:"uniform sampler2D colorTexture;\nin vec2 v_textureCoordinates;\nuniform float scale;\nuniform vec3 offset;\nvoid main() {\n vec4 color = texture(colorTexture, v_textureCoordinates);\n out_FragColor = vec4(color.r*0.2,color.g * 0.4,color.b*0.6, 1.0);\n}\n",uniforms:{scale:1,offset:function(){return t.offset||new p.Cartesian3(.1,.2,.3)}}}))},setBlurBloom:function(t){if(this._viewer&&t)return this._viewer.scene.postProcessStages.add(new p.PostProcessStage({name:"blur_x_direction",fragmentShader:"uniform float height;\nuniform float width;\nuniform sampler2D colorTexture1;\n\nin vec2 v_textureCoordinates;\n\nconst int SAMPLES = 9;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nfloat wr = float(1.0 / width);\nfloat hr = float(1.0 / height);\nvec4 result = vec4(0.0);\nint count = 0;\nfor(int i = -SAMPLES; i <= SAMPLES; ++i){\nfor(int j = -SAMPLES; j <= SAMPLES; ++j){\nvec2 offset = vec2(float(i) * wr, float(j) * hr);\nresult += texture(colorTexture1, st + offset);\n}\n}\nresult = result / float(count);\nout_FragColor = result;\n}\n",uniforms:{width:t.width,height:t.height,colorTexture1:"Bright"}}))},setRainEffect:function(){if(this._viewer)return this._viewer.scene.postProcessStages.add(new p.PostProcessStage({name:"rainEffect",fragmentShader:"uniform sampler2D colorTexture;\n in vec2 v_textureCoordinates;\n \n float hash(float x){\n return fract(sin(x*23.3)*13.13);\n }\n \n void main(){\n float time = czm_frameNumber / 60.0;\n vec2 resolution = czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 c=vec3(.6,.7,.8);\n float a=-.4;\n float si=sin(a),co=cos(a);\n uv*=mat2(co,-si,si,co);\n uv*=length(uv+vec2(0,4.9))*.3+1.;\n float v=1.-sin(hash(floor(uv.x*100.))*2.);\n float b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*20.;\n c*=v*b;\n out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c, 1), 0.2);\n }\n "}))},setSnowEffect:function(){if(this._viewer)return this._viewer.scene.postProcessStages.add(new p.PostProcessStage({name:"snowEffect",fragmentShader:"uniform sampler2D colorTexture;\n in vec2 v_textureCoordinates;\n float snow(vec2 uv,float scale){\n float time = czm_frameNumber / 60.0;\n float w=smoothstep(1.,0.,-uv.y*(scale/10.));\n if(w<.1)return 0.;\n uv+=time/scale;\n uv.y+=time*2./scale;\n uv.x+=sin(uv.y+time*.5)/scale;\n uv*=scale;\n vec2 s=floor(uv),f=fract(uv),p;\n float k=3.,d;\n p=.5+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;\n d=length(p);\n k=min(d,k);\n k=smoothstep(0.,k,sin(f.x+f.y)*0.01);\n return k*w;\n }\n \n void main(){\n vec2 resolution = czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 finalColor=vec3(0);\n float c = 0.0;\n c+=snow(uv,30.)*.0;\n c+=snow(uv,20.)*.0;\n c+=snow(uv,15.)*.0;\n c+=snow(uv,10.);\n c+=snow(uv,8.);\n c+=snow(uv,6.);\n c+=snow(uv,5.);\n finalColor=(vec3(c));\n out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.3);\n \n }\n "}))},setFogEffect:function(){if(this._viewer)return this._viewer.scene.postProcessStages.add(new p.PostProcessStage({fragmentShader:"float getDistance(sampler2D depthTexture, vec2 texCoords) \n{ \n float depth = czm_unpackDepth(texture(depthTexture, texCoords)); \n if (depth == 0.0) { \n return czm_infinity; \n } \n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth); \n return -eyeCoordinate.z / eyeCoordinate.w; \n} \nfloat interpolateByDistance(vec4 nearFarScalar, float distance) \n{ \n float startDistance = nearFarScalar.x; \n float startValue = nearFarScalar.y; \n float endDistance = nearFarScalar.z; \n float endValue = nearFarScalar.w; \n float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); \n return mix(startValue, endValue, t); \n} \nvec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) \n{ \n return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); \n} \nuniform sampler2D colorTexture; \nuniform sampler2D depthTexture; \nuniform vec4 fogByDistance; \nuniform vec4 fogColor; \nin vec2 v_textureCoordinates; \nvoid main(void) \n{ \n float distance = getDistance(depthTexture, v_textureCoordinates); \n vec4 sceneColor = texture(colorTexture, v_textureCoordinates); \n float blendAmount = interpolateByDistance(fogByDistance, distance); \n vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount); \n out_FragColor = alphaBlend(finalFogColor, sceneColor); \n} \n",uniforms:{fogByDistance:new p.Cartesian4(10,0,200,.3),fogColor:p.Color.AZURE}}))},setDefSceneConfig:function(){this._viewer&&(this._viewer.scene.sun.show=!1,this._viewer.scene.moon.show=!1,this._viewer.scene.fxaa=!0,this._viewer.scene.globe.depthTestAgainstTerrain=!0,this._viewer.scene.undergroundMode=!1,this._viewer.scene.terrainProvider.isCreateSkirt=!1,this._viewer.scene.skyAtmosphere.show=!1,this._viewer.scene.globe.showGroundAtmosphere=!1,this._viewer.scene.globe.enableLighting=!0,this._viewer.scene.fog.enabled=!1,this._viewer.cesiumWidget.creditContainer.style.display="none")},setBloomLightScene:function(){this._viewer&&(this._viewer.scene.postProcessStages.bloom.enabled=!0,this._viewer.scene.postProcessStages.bloom.uniforms.contrast=119,this._viewer.scene.postProcessStages.bloom.uniforms.brightness=-.4,this._viewer.scene.postProcessStages.bloom.uniforms.glowOnly=!1,this._viewer.scene.postProcessStages.bloom.uniforms.delta=.9,this._viewer.scene.postProcessStages.bloom.uniforms.sigma=3.78,this._viewer.scene.postProcessStages.bloom.uniforms.stepSize=5,this._viewer.scene.postProcessStages.bloom.uniforms.isSelected=!1)},removePostProcessStage:function(t){t&&(Array.isArray(t)?t.forEach(t=>{this._viewer.scene.postProcessStages.contains(t)&&this._viewer.scene.postProcessStages.remove(t)}):this._viewer.scene.postProcessStages.contains(t)&&this._viewer.scene.postProcessStages.remove(t))},setView:function(t){var e;this._viewer&&t&&t.position&&(t.distance&&(e=new p.Cartesian3(0,t.distance,window.opt.distance),t.position=p.Cartesian3.add(t.position,e,new p.Cartesian3)),this._viewer.scene.camera.setView({destination:t.position,orientation:t.orientation||{heading:p.Math.toRadians(90),pitch:p.Math.toRadians(90),roll:p.Math.toRadians(0)}}))},flyTo:function(t){var e;this._viewer&&t&&t.position&&(t.distance&&(e=new p.Cartesian3(0,t.distance,t.distance),t.position=p.Cartesian3.add(t.position,e,new p.Cartesian3)),this._viewer.scene.camera.flyTo({destination:t.position,orientation:t.orientation||{heading:p.Math.toRadians(90),pitch:p.Math.toRadians(90),roll:p.Math.toRadians(0)},easingFunction:t.easingFunction||p.EasingFunction.LINEAR_NONE,duration:t.duration||3,complete:t.callback}))},transformCartesianToWGS84:function(t){if(this._viewer&&t)return t=p.Ellipsoid.WGS84.cartesianToCartographic(t),{lng:p.Math.toDegrees(t.longitude),lat:p.Math.toDegrees(t.latitude),alt:t.height}},transformWGS84ArrayToCartesianArray:function(t,e){var i;if(this._viewer&&t)return i=this,t?t.map(function(t){return i.transformWGS84ToCartesian(t,e)}):[]},transformWGS84ToCartesian:function(t,e){if(this._viewer)return t?p.Cartesian3.fromDegrees(t.lng||t.lon,t.lat,t.alt=e||t.alt,p.Ellipsoid.WGS84):p.Cartesian3.ZERO},transformCartesianArrayToWGS84Array:function(t){var e;if(this._viewer)return e=this,t?t.map(function(t){return e.transformCartesianToWGS84(t)}):[]},setCameraEotateHeading(l){if(l){let e=this._viewer,i=p.Cartesian3.fromDegrees(l.lng,l.lat,l.height),n=p.Math.toRadians(-30),a=12,r=5e3,t=p.JulianDate.fromDate(new Date),o=(e.clock.startTime=t.clone(),e.clock.currentTime=t.clone(),e.clock.clockRange=p.ClockRange.CLAMPED,e.clock.clockStep=p.ClockStep.SYSTEM_CLOCK,e.camera.heading),s=function(){var t=p.JulianDate.secondsDifference(e.clock.currentTime,e.clock.startTime),t=p.Math.toRadians(t*a)+o;e.scene.camera.setView({destination:i,orientation:{heading:t,pitch:n}}),e.scene.camera.moveBackward(r),0<=p.JulianDate.compare(e.clock.currentTime,e.clock.stopTime)&&e.clock.onTick.removeEventListener(s)};e.clock.onTick.addEventListener(s)}},transformWGS84ToCartographic:function(t){return t?p.Cartographic.fromDegrees(t.lng||t.lon,t.lat,t.alt):p.Cartographic.ZERO},getCatesian3FromPX:function(t){if(this._viewer&&t){var e,i,n=this._viewer.scene.pick(t),a=null,r=!1,o=!1;if((r=n instanceof p.Cesium3DTileFeature?!0:r)&&(a=this._viewer.scene.pickPosition(t))&&((e=p.Cartographic.fromCartesian(a)).height<0&&(e.height=0),s=p.Math.toDegrees(e.longitude),i=p.Math.toDegrees(e.latitude),e=e.height,a=this.transformWGS84ToCartesian({lng:s,lat:i,alt:e})),!n){var s=this._viewer.scene.camera.getPickRay(t);if(!s)return null;a=this._viewer.scene.globe.pick(s,this._viewer.scene),o=!0}return(a=r||o?a:this._viewer.scene.camera.pickEllipsoid(t,this._viewer.scene.globe.ellipsoid))?(i=this.transformCartesianToWGS84(a)).alt<0?this.transformWGS84ToCartesian(i,.1):a:!1}},getCameraPosition:function(){if(this._viewer){var t,e,i,n,a,r,o,s,l,c,h,u=this._viewer.scene.camera.pickEllipsoid(new p.Cartesian2(this._viewer.canvas.clientWidth/2,this._viewer.canvas.clientHeight/2));if(u)return t=180*(u=p.Ellipsoid.WGS84.cartesianToCartographic(u)).longitude/Math.PI,u=180*u.latitude/Math.PI,n=this._viewer.camera._direction,e=p.Math.toDegrees(n.x),i=p.Math.toDegrees(n.y),n=p.Math.toDegrees(n.z),a=this._viewer.camera.positionCartographic.height,r=p.Math.toDegrees(this._viewer.camera.heading),o=p.Math.toDegrees(this._viewer.camera.pitch),s=p.Math.toDegrees(this._viewer.camera.roll),c=(l=this._viewer.camera.computeViewRectangle()).west/Math.PI*180,h=l.north/Math.PI*180,c=(c+l.east/Math.PI*180)/2,h=(h+l.south/Math.PI*180)/2,{lon:t,lat:u,height:a,heading:r,pitch:o,roll:s,position:this._viewer.camera.position,cameraHeading:this._viewer.camera.heading,cameraPitch:this._viewer.camera.pitch,cameraRoll:this._viewer.camera.roll,center:{x:c,y:h},direction:new p.Cartesian3(e,i,n)}}},updateCameraState:function(t){this._viewer.scene._screenSpaceCameraController.enableRotate=t,this._viewer.scene._screenSpaceCameraController.enableTranslate=t,this._viewer.scene._screenSpaceCameraController.enableZoom=t,this._viewer.scene._screenSpaceCameraController.enableTilt=t,this._viewer.scene._screenSpaceCameraController.enableLook=t},bindHandelEvent:function({leftClick:e,mouseMove:i,doubleClick:n,leftDown:a,mouseWheel:r,leftUp:o}){var s;this._viewer&&(s=new p.ScreenSpaceEventHandler(this._viewer.canvas),e&&s.setInputAction(function(t){e(t,s)},p.ScreenSpaceEventType.LEFT_CLICK),i&&s.setInputAction(function(t){i(t,s)},p.ScreenSpaceEventType.MOUSE_MOVE),n&&s.setInputAction(function(t){n(t,s)},p.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),a&&s.setInputAction(function(t){a(t,s)},p.ScreenSpaceEventType.LEFT_DOWN),r&&s.setInputAction(function(t){r(t,s)},p.ScreenSpaceEventType.WHEEL),o)&&s.setInputAction(function(t){o(t,s)},p.ScreenSpaceEventType.LEFT_UP)},getHandelPosition:function(e){var i,n;this._viewer&&(i=new p.ScreenSpaceEventHandler(this._viewer.scene.canvas),n=this,i.setInputAction(function(t){t=n._viewer.scene.camera.pickEllipsoid(t.endPosition,n._viewer.scene.globe.ellipsoid);"function"==typeof e&&e(n.transformCartesianToWGS84(t),i)},p.ScreenSpaceEventType.MOUSE_MOVE))},saveSceneImages:function(){var t,e;this._viewer&&(e=this._viewer.scene.canvas.toDataURL("image/png").replace("image/png","image/octet-stream"),t=document.createElement("a"),e=function(t){for(var t=t.split(","),e=t[0].match(/:(.*?);/)[1],i=atob(t[1]),n=i.length,a=new Uint8Array(n);n--;)a[n]=i.charCodeAt(n);return new Blob([a],{type:e})}(e),e=URL.createObjectURL(e),t.download="scene.png",t.href=e,t.click())},_installAmapImageryProvider:function(){p.Scene.AmapImageryProvider=function(t){return t.url="img"===t.style?"https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}":"http://webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}",t.subdomains||(t.subdomains=["01","02","03","04"]),new p.UrlTemplateImageryProvider(t)}},_installTdtImageryProvider:function(){p.Scene.TdtImageryProvider=function(t){return new p.UrlTemplateImageryProvider({url:"http://t{s}.tianditu.gov.cn/{layer}_c/wmts?service=WMTS&version=1.0.0&request=GetTile&tilematrix={TileMatrix}&layer={layer}&style={style}&tilerow={TileRow}&tilecol={TileCol}&tilematrixset={TileMatrixSet}&format=tiles&tk={key}".replace(/\{layer\}/g,t.style||"vec").replace(/\{key\}/g,t.key||""),style:"default",format:"tiles",tileMatrixSetID:"c",matrixSet:"c",wrapX:!0,crossOrigin:"anonymous",subdomains:[...Array(6).keys()].map(t=>(t+1).toString()),tileMatrixLabels:[...Array(18).keys()].map(t=>(t+1).toString()),tilingScheme:new p.GeographicTilingScheme,maximumLevel:18})}},_installTencentImageryProvider:function(){p.Scene.TencentImageryProvider=function(t){return t.layer="img",t.url="https://p2.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=229",t.subdomains||(t.subdomains=["0","1","2"]),t.customTags={sx:function(t,e,i,n){return e>>4},sy:function(t,e,i,n){return(1<<n)-i>>4}},new p.UrlTemplateImageryProvider(t)}},_installGooGleImageryProvider:function(){p.Scene.GoogleImageryProvider=function(t){return t.url="img"===t.style?"http://mt{s}.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}&s=Gali":"ter"===t.style?"http://mt{s}.google.cn/vt/lyrs=t@131,r@227000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galile":"http://mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile",t.subdomains||(t.subdomains=["1","2","3","4","5"]),new p.UrlTemplateImageryProvider(t)}},_installBaiduImageryProvider:function(){var e="http://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}";function t(t){e=t.temp_url||e,this._url=e,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._minimumLevel=1,this._tilingScheme=new p.WebMercatorTilingScheme({rectangleSouthwestInMeters:new p.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new p.Cartesian2(33554054,33746824)}),this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._style=t.style||"normal"}Object.defineProperties(t.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},tileWidth:{get:function(){if(this.ready)return this._tileWidth;throw new p.DeveloperError("tileWidth must not be called before the imagery provider is ready.")}},tileHeight:{get:function(){if(this.ready)return this._tileHeight;throw new p.DeveloperError("tileHeight must not be called before the imagery provider is ready.")}},maximumLevel:{get:function(){if(this.ready)return this._tileHeight;throw new p.DeveloperError("tileHeight must not be called before the imagery provider is ready.")}},minimumLevel:{get:function(){if(this.ready)return 0;throw new p.DeveloperError("minimumLevel must not be called before the imagery provider is ready.")}},tilingScheme:{get:function(){if(this.ready)return this._tilingScheme;throw new p.DeveloperError("tilingScheme must not be called before the imagery provider is ready.")}},rectangle:{get:function(){if(this.ready)return this._rectangle;throw new p.DeveloperError("rectangle must not be called before the imagery provider is ready.")}},ready:{get:function(){return!!this._url}},credit:{get:function(){return this._credit}}}),t.prototype.requestImage=function(t,e,i){var n,a;if(this.ready)return n=this._tilingScheme.getNumberOfXTilesAtLevel(i),a=this._tilingScheme.getNumberOfYTilesAtLevel(i),t=this._url.replace("{x}",t-n/2).replace("{y}",a/2-e-1).replace("{z}",i).replace("{s}",1).replace("{style}",this._style),p.ImageryProvider.loadImage(this,t);throw new p.DeveloperError("requestImage must not be called before the imagery provider is ready.")},p.Scene.BaiduImageryProvider=t},_installGroundSkyBox:function(){var o=p.BoxGeometry,s=p.Cartesian3,e=p.defaultValue,l=p.defined,i=p.destroyObject,c=p.DeveloperError,h=p.GeometryPipeline,t=p.Matrix3,u=p.Matrix4,x=p.Transforms,d=p.VertexFormat,Z=p.BufferUsage,g=p.CubeMap,n=p.DrawCommand,m=p.loadCubeMap,f=p.RenderState,v=p.VertexArray,b=p.BlendingState,y=p.SceneMode,C=p.ShaderProgram,w=p.ShaderSource;function a(t){this.sources=t.sources,this._sources=void 0,this.show=e(t.show,!0),this._command=new n({modelMatrix:u.clone(u.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}l(u.getRotation)||(u.getRotation=u.getMatrix3);var I=new t;a.prototype.update=function(t,e){var i=this;if(this.show&&(t.mode===y.SCENE3D||t.mode===y.MORPHING)&&t.passes.render){var n=t.context;if(this._sources!==this.sources){this._sources=this.sources;var a=this.sources;if(!(l(a.positiveX)&&l(a.negativeX)&&l(a.positiveY)&&l(a.negativeY)&&l(a.positiveZ)&&l(a.negativeZ)))throw new c("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof a.positiveX!=typeof a.negativeX||typeof a.positiveX!=typeof a.positiveY||typeof a.positiveX!=typeof a.negativeY||typeof a.positiveX!=typeof a.positiveZ||typeof a.positiveX!=typeof a.negativeZ)throw new c("this.sources properties must all be the same type.");"string"==typeof a.positiveX?m(n,this._sources).then(function(t){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=t}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new g({context:n,source:a}))}var r=this._command;if(r.modelMatrix=x.eastNorthUpToFixedFrame(t.camera._positionWC),l(r.vertexArray)||(r.uniformMap={u_cubeMap:function(){return i._cubeMap},u_rotateMatrix:function(){return u.getRotation(r.modelMatrix,I)}},a=o.createGeometry(o.fromDimensions({dimensions:new s(2,2,2),vertexFormat:d.POSITION_ONLY})),t=this._attributeLocations=h.createAttributeLocations(a),r.vertexArray=v.fromGeometry({context:n,geometry:a,attributeLocations:t,bufferUsage:Z._DRAW}),r.renderState=f.fromCache({blending:b.ALPHA_BLEND})),l(r.shaderProgram)&&this._useHdr===e||(a=new w({defines:[e?"HDR":""],sources:["uniform samplerCube u_cubeMap;\n in vec3 v_texCoord;\n void main()\n {\n vec4 color = texture(u_cubeMap, normalize(v_texCoord));\n out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n }\n "]}),r.shaderProgram=C.fromCache({context:n,vertexShaderSource:"in vec3 position;\n out vec3 v_texCoord;\n uniform mat3 u_rotateMatrix;\n void main()\n {\n vec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\n gl_Position = czm_projection * vec4(p, 1.0);\n v_texCoord = position.xyz;\n }\n ",fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=e),l(this._cubeMap))return r}},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){var t=this._command;return t.vertexArray=t.vertexArray&&t.vertexArray.destroy(),t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),i(this)},p.Scene.GroundSkyBox=a},removeHandlerByName(t=[]){t.forEach(t=>{this._viewer.screenSpaceEventHandler.removeInputAction(p.ScreenSpaceEventType[t])})}};let v={};function y(t,e){t&&(this._viewer=t,v=e)}y.prototype={splitCartesians3:function(t){for(var e=[],i=0;i<t.length;i+=3){var n=new v.Cartesian3(t[i],t[i+1],t[i+2]);e.push(n)}return e.push(e[0]),e},getLinkedPointList:function(t,e,i,n){if(this._viewer){var a=[],r=v.Cartographic.fromCartesian(t),o=v.Cartographic.fromCartesian(e),s=180*r.longitude/Math.PI,r=180*r.latitude/Math.PI,l=180*o.longitude/Math.PI,o=180*o.latitude/Math.PI,c=Math.sqrt((s-l)*(s-l)+(r-o)*(r-o))*i,h=v.Cartesian3.clone(t),u=v.Cartesian3.clone(e),x=v.Cartesian3.distance(h,v.Cartesian3.ZERO),d=v.Cartesian3.distance(u,v.Cartesian3.ZERO);if(v.Cartesian3.normalize(h,h),v.Cartesian3.normalize(u,u),0!=v.Cartesian3.distance(h,u)){var Z=v.Cartesian3.angleBetween(h,u);a.push(t);for(var p=1;p<n-1;p++){var g=+p/(n-1),m=1-g,f=Math.sin(m*Z)/Math.sin(Z),b=Math.sin(g*Z)/Math.sin(Z),f=v.Cartesian3.multiplyByScalar(h,f,new v.Cartesian3),b=v.Cartesian3.multiplyByScalar(u,b,new v.Cartesian3),f=v.Cartesian3.add(f,b,new v.Cartesian3),b=g*Math.PI,m=x*m+d*g+Math.sin(b)*c,f=v.Cartesian3.multiplyByScalar(f,m,f);a.push(f)}a.push(e)}return a}},getPositionsAngle:function(t){var e,i,n,a;if(t)return i=t.position1,a=t.position2,n=v.Transforms.eastNorthUpToFixedFrame(i),n=v.Matrix4.inverse(n,new v.Matrix4),i=v.Matrix4.multiplyByPoint(n,i,new v.Cartesian3),n=v.Matrix4.multiplyByPoint(n,a,new v.Cartesian3),"pitch"===t.type?e=Math.atan2(n.z-i.z,n.x-i.x):"heading "===t.type&&(e=Math.atan2(n.y-i.y,n.x-i.x)),(a=e*(180/Math.PI))<0&&(a+=360),a},getPositionsArea:function(n){let t=0;if(n){let e=0,i=v.Ellipsoid.WGS84;n.push(n[0]);for(let t=1;t<n.length;t++){var a=i.cartographicToCartesian(this.transformWGS84ToCartographic(n[t-1])),r=i.cartographicToCartesian(this.transformWGS84ToCartographic(n[t]));e+=a.x*r.y-r.x*a.y}t=Math.abs(e).toFixed(2)}return t},getPolygonArea:function(t){if(this._viewer){function e(t,e){var i=t.lat*radiansPerDegree,t=t.lon*radiansPerDegree,n=e.lat*radiansPerDegree,e=e.lon*radiansPerDegree,i=-Math.atan2(Math.sin(t-e)*Math.cos(n),Math.cos(i)*Math.sin(n)-Math.sin(i)*Math.cos(n)*Math.cos(t-e));return i<0&&(i+=2*Math.PI),i*degreesPerRadian}for(var i=0,n=0;n<t.length-2;n++){var a=(n+1)%t.length,r=(n+2)%t.length,o=(o=t[n],s=t[a],l=t[r],c=void 0,(c=e(s,o)-e(s,l))<0&&(c+=360),c);i+=this.getPositionsDistance(positions[n],positions[a])*this.getPositionsDistance(positions[a],positions[r])*Math.abs(Math.sin(o))}return(i/1e6).toFixed(4)}var o,s,l,c},getPointDistance:function(t,e){var i;if(this._viewer)return t=v.Cartographic.fromCartesian(t),e=v.Cartographic.fromCartesian(e),(i=new v.EllipsoidGeodesic).setEndPoints(t,e),i=i.surfaceDistance,Math.sqrt(Math.pow(i,2)+Math.pow(e.height-t.height,2))},getPositionDistance:function(e){let i=0;for(let t=0;t<e.length-1;t++){var n=this.transformWGS84ToCartographic(e[t]),a=this.transformWGS84ToCartographic(e[t+1]),r=new v.EllipsoidGeodesic,r=(r.setEndPoints(n,a),r.surfaceDistance),r=Math.sqrt(Math.pow(r,2)+Math.pow(a.height-n.height,2));i+=r}return i.toFixed(3)},getIntersectObj:function(t,e,i=[],n=!1){if(this._viewer)return e=v.Cartesian3.normalize(v.Cartesian3.subtract(e,t,new v.Cartesian3),new v.Cartesian3),t=new v.Ray(t,e),e=[],n?e=this._viewer.scene.drillPickFromRay(t,10,i):(n=this._viewer.scene.pickFromRay(t,i),v.defined(n)&&(e=[n])),e},getPointOnEllipsoid:function(t,e,i,n,a,r,o,s,l,c){var h,u,x,d;if(this._viewer)return h=new v.Cartesian3,u=new v.Cartesian3,x=new v.Quaternion,d=new v.Matrix3,e=t+e,v.Cartesian3.multiplyByScalar(n,Math.cos(e),h),v.Cartesian3.multiplyByScalar(i,Math.sin(e),u),v.Cartesian3.add(h,u,h),n=Math.cos(t),n*=n,i=Math.sin(t),i*=i,e=r/Math.sqrt(o*n+a*i)/s,v.Quaternion.fromAxisAngle(h,e,x),v.Matrix3.fromQuaternion(x,d),v.Matrix3.multiplyByVector(d,l,c),v.Cartesian3.normalize(c,c),v.Cartesian3.multiplyByScalar(c,s,c),c},raisePositionsToHeight:function(t,e,i){if(this._viewer){for(var n=new v.Cartesian3,a=new v.Cartesian3,r=new v.Cartesian3,o=new v.Cartesian3,s=e.ellipsoid,l=e.height,c=e.extrudedHeight,e=i?t.length/3*2:t.length/3,h=new Float64Array(3*e),u=t.length,x=i?u:0,d=0;d<u;d+=3){var Z=d+1,p=d+2,g=v.Cartesian3.fromArray(t,d,n),m=(s.scaleToGeodeticSurface(g,g),v.Cartesian3.clone(g,a)),f=s.geodeticSurfaceNormal(g,o),b=v.Cartesian3.multiplyByScalar(f,l,r);v.Cartesian3.add(g,b,g),i&&(v.Cartesian3.multiplyByScalar(f,c,b),v.Cartesian3.add(m,b,m),h[d+x]=m.x,h[Z+x]=m.y,h[p+x]=m.z),h[d]=g.x,h[Z]=g.y,h[p]=g.z}return h}},computeEllipseEdgePositions:function(t){if(this._viewer){for(var e=new v.Cartesian3,i=new v.Cartesian3,n=new v.Cartesian3,a=new v.Cartesian3,r=t.semiMinorAxis,o=t.semiMajorAxis,s=t.rotation,l=t.center,t=t.granularity&&"number"==typeof t.granularity?t.granularity:Math.PI/180,c=((t=t>Math.PI/12?Math.PI/12:t)<Math.PI/180&&(t=Math.PI/180),r*r),h=o*o,u=o*r,x=v.Cartesian3.magnitude(l),d=v.Cartesian3.normalize(l,e),Z=v.Cartesian3.cross(v.Cartesian3.UNIT_Z,l,i),Z=v.Cartesian3.normalize(Z,Z),p=v.Cartesian3.cross(d,Z,n),g=Math.ceil(2*v.Math.PI/t),m=t,f=a,b=0,y=[],C=0;C<g;C++)f=this.getPointOnEllipsoid(C*m,s,p,Z,c,u,h,x,d,f),y[b++]=f.x,y[b++]=f.y,y[b++]=f.z;o={};return o.numPts=g,o.outerPositions=y,o}},computeSectorEdgePositions:function(t){if(this._viewer){for(var e=new v.Cartesian3,i=new v.Cartesian3,n=new v.Cartesian3,a=new v.Cartesian3,r=t.semiMinorAxis,o=t.semiMajorAxis,s=t.rotation,l=t.angle||2*Math.PI,c=t.center,t=t.granularity&&"number"==typeof t.granularity?t.granularity:Math.PI/180,h=((t=t>Math.PI/12?Math.PI/12:t)<Math.PI/180&&(t=Math.PI/180),r*r),u=o*o,x=o*r,d=v.Cartesian3.magnitude(c),Z=v.Cartesian3.normalize(c,e),p=v.Cartesian3.cross(v.Cartesian3.UNIT_Z,c,i),p=v.Cartesian3.normalize(p,p),g=v.Cartesian3.cross(Z,p,n),m=Math.ceil(l/t),f=t,b=a,y=0,C=[],w=0;w<m;w++)b=this.getPointOnEllipsoid(w*f,s,g,p,h,x,u,d,Z,b),C[y++]=b.x,C[y++]=b.y,C[y++]=b.z;o={};return o.numPts=m,o.outerPositions=C,o}},computeLonlatPointsTerrainData:function(t,e){if(this._viewer){for(var i=[],n=0;n<t.length;n++)i.push(v.Cartographic.fromDegrees(t[n].lon,t[n].lat));this._viewer.scene.clampToHeightMostDetailed(i).then(function(t){e(t)})}},computeCartographicPointsTerrainData:function(t,a){if(this._viewer&&!(t.length<=0)){for(var e=[],i=0;i<t.length;i++)e.push(v.Cartesian3.fromRadians(t[i].longitude,t[i].latitude,t[i].height));var n=this._viewer.scene.clampToHeightMostDetailed(e),r=this;n.then(function(t){for(var e=[],i=r._viewer.scene.globe.ellipsoid,n=0;n<t.length;n++)e.push(i.cartesianToCartographic(t[n]));a(e)}).catch(function(t){console.log(t)})}},_checkLonDegree:function(t){return!(180<t||t<-180)},_checkLatDegree:function(t){return!(90<t||t<-90)},computeInterpolateLineLonlat:function(t,e){if(!t||!e)return null;if(t.lon||!t.lat||!e.lon||!e.lat)return null;if(!(this._checkLonDegree(t.lon)&&this._checkLonDegree(e.lon)&&this._checkLatDegree(t.lat)&&this._checkLatDegree(e.lat)))return null;var i=[],n=(i.push([t.lon,t.lat]),Math.sqrt(Math.pow(e.lon-t.lon,2)+Math.pow(e.lat-t.lat,2)));if(n<=1e-5)i.push([e.lon,e.lat]);else for(var a=n/1e-5,r=(e.lon-t.lon)/a,o=(e.lat-t.lat)/a,s=0;s<a;s++){var l=t.lon+(s+1)*r,c=t.lat+(s+1)*o;i.push([l,c])}return i},computeInterpolateLineCartographic:function(t,e,i){if(!t||!e)return null;if(!(t.longitude&&t.latitude&&e.longitude&&e.latitude))return null;var n=[],a=(n.push(new v.Cartographic(t.longitude,t.latitude)),Math.sqrt(Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2))),i=i&&"number"==typeof i?i:1e-5*Math.PI/180;if(a<=i)n.push(new v.Cartographic(e.longitude,e.latitude));else{for(var r=a/i,o=(e.longitude-t.longitude)/r,s=(e.latitude-t.latitude)/r,l=0;l<r;l++){var c=t.longitude+(l+1)*o,h=t.latitude+(l+1)*s;n.push(new v.Cartographic(c,h))}n.push(new v.Cartographic(e.longitude,e.latitude,e.height))}return n},computeInterpolateLineHeightCartographic:function(t,e){if(!t||!e)return null;if(!(t.longitude&&t.latitude&&e.longitude&&e.latitude))return null;var i=[],n=(i.push(new v.Cartographic(t.longitude,t.latitude,t.height)),Math.sqrt(Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2)));if(!(n<=1e-5*Math.PI/180))for(var a=n/1e-5*Math.PI/180,r=(e.longitude-t.longitude)/a,o=(e.latitude-t.latitude)/a,s=(e.height-t.height)/a,l=0;l<a;l++){var c=t.longitude+(l+1)*r,h=t.latitude+(l+1)*o,u=t.height+(l+1)*s;i.push(new v.Cartographic(c,h,u))}return i.push(new v.Cartographic(e.longitude,e.latitude,e.height)),i},computeInterpolate2IndexLineHeightCartographic:function(t,e,i,n){if(!t||!e)return null;if(!(t.longitude&&t.latitude&&e.longitude&&e.latitude))return null;var a=[];a.push(new v.Cartographic(t.longitude,t.latitude,t.height));for(var r=(e.longitude-t.longitude)/i,o=(e.latitude-t.latitude)/i,s=(e.height-t.height)/i,l=0;l<n;l++){var c=t.longitude+(l+1)*r,h=t.latitude+(l+1)*o,u=t.height+(l+1)*s;a.push(new v.Cartographic(c,h,u))}return a},computeInterpolateIndexLineHeightCartographic:function(t,e,i,n){var a,r;return t&&e&&t.longitude&&t.latitude&&e.longitude&&e.latitude?(a=(e.longitude-t.longitude)/i,r=(e.latitude-t.latitude)/i,e=(e.height-t.height)/i,i=t.longitude+n*a,a=t.latitude+n*r,r=t.height+n*e,new v.Cartographic(i,a,r)):null}};let b=null;function C(t,e,i){t&&(this._viewer=t,b=e,this._installPrimitives())}C.prototype={_installPrimitives:function(){this._installProbingPrimitive(),this._installTexturePrimitive(),this._installWaterPrimitive(),this._installPointsPrimitive(),this._installShadowPrimitive(),this._installArrowPolylinePrimitive(),this._installXyzAxisPrimitive(),this._installTetrahedronPrimitive(),this._installCustomPrimitive()},_installCustomPrimitive:function(){},_installTetrahedronPrimitive:function(){try{function t(t){this.show=!0,this._command=void 0,this._enuMatrix=void 0,this._scaleMatrix=void 0,this._localPosition=t.position,this._createCommand=G,this._angle=0,this._distance=I(t.distance,1),this._setInterval=void 0,this._viewer=_,this._speed=I(t.speed,1),this._color=I(t.color,new e(1,1,0,.8)),this._scale=I(t.scale,new i(10,10,15)),this._texture=void 0,this._imageUrl=A,this._modelMatrix=R(this),this._height=B(this),V(this)}var i=b.Cartesian3,n=b.ComponentDatatype,o=b.PrimitiveType,a=b.BoundingSphere,r=b.GeometryAttribute,s=b.GeometryPipeline,l=b.Geometry,c=b.defined,h=b.RenderState,u=b.ShaderSource,x=b.ShaderProgram,d=b.DrawCommand,Z=b.Pass,p=b.Appearance,g=b.BufferUsage,e=b.Color,m=b.VertexArray,f=(b.buildModuleUrl,b.Matrix4),v=b.Matrix3,y=b.Texture,C=b.Resource,w=b.Transforms,I=b.defaultValue,_=this._viewer,A=this.getDfSt(["primitive","TetrahedronPrimitive"])||"static/data/images/Textures/fence.png";t.prototype.update=function(t){this.show&&(c(this._command)||(this._command=this._createCommand(t.context,this)),c(this._command))&&t.commandList.push(this._command)},t.prototype.isDestroyed=function(){return!1},t.prototype.destroy=function(){return c(this._command)&&(this._command.shaderProgram=this._command.shaderProgram&&this._command.shaderProgram.destroy()),destroyObject(this)},t.prototype.startAnimate=function(){let e=this;this._setInterval=setInterval(function(){e._angle=e._angle+.01,0<Math.sin(e._angle)?e._height=.01:e._height=-.01;var t=new b.Cartesian3(0,0,e._height),t=(f.multiplyByTranslation(e._modelMatrix,t,e._modelMatrix),f.fromRotationTranslation(v.fromRotationZ(b.Math.toRadians(e._speed))));f.multiply(e._modelMatrix,t,e._modelMatrix)},5)},t.prototype.closeAnimate=function(){clearInterval(this._setInterval)};const G=function(t,e){var i=M(),n=S(),a=p.getDefaultRenderState(!1,!0,void 0),a=h.fromCache(a),i=new u({sources:[i]}),n=new u({sources:[n]}),r={color:function(){return e._color},myImage:function(){return c(e._texture)?e._texture:e._viewer.scene.context.defaultTexture}},i=x.fromCache({context:t,vertexShaderSource:i,fragmentShaderSource:n,attributeLocations:{position:0,textureCoordinates:1}});return new d({vertexArray:P(t),primitiveType:o.TRIANGLES,renderState:a,shaderProgram:i,uniformMap:r,owner:this,pass:Z.TRANSLUCENT,modelMatrix:e._modelMatrix})},P=function(t){var e=W(),e=new l({attributes:{position:new r({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:e.positions}),textureCoordinates:new r({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:e.sts})},indices:e.indices,primitiveType:o.TRIANGLES,boundingSphere:a.fromVertices(e.positions)}),e=s.computeNormal(e);return m.fromGeometry({context:t,geometry:e,attributeLocations:{position:0,textureCoordinates:1},bufferUsage:g.STATIC_DRAW})},W=function(){var t=new Float64Array(15),e=(t[0]=0,t[1]=1,t[2]=0,t[3]=-1,t[4]=0,t[5]=0,t[6]=0,t[7]=-1,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=-1,new Uint16Array(18));return e[0]=4,e[1]=2,e[2]=3,e[3]=4,e[4]=3,e[5]=0,e[6]=4,e[7]=0,e[8]=1,e[9]=4,e[10]=1,e[11]=2,e[12]=1,e[13]=2,e[14]=3,e[15]=1,e[16]=3,e[17]=0,{indices:e,positions:t,sts:new Float32Array([0,0,1,0,1,1,0,1,.5,.5])}},M=function(){return"#version 300 es\n in vec3 position;\n in vec3 normal;\n in vec2 st;\n in float batchId;\n out vec3 v_positionEC;\n out vec3 v_normalEC;\n out vec2 v_st;\n out vec4 v_pickColor;\n void main()\n {\n v_positionEC = (czm_modelView * vec4(position, 1.0)).xyz;\n v_normalEC = czm_normal * normal;\n v_st = st;\n // v_pickColor = czm_batchTable_pickColor(batchId);\n gl_Position = czm_modelViewProjection * vec4(position, 1.0);\n }\n "},S=function(){return"#version 300 es\n precision mediump float;\n in vec3 v_positionEC;\n in vec3 v_normalEC;\n in vec2 v_st;\n uniform vec4 color;\n in vec4 v_pickColor;\n uniform sampler2D myImage;\n void main()\n {\n vec3 positionToEyeEC = -v_positionEC;\n vec3 normalEC = normalize(v_normalEC);\n #ifdef FACE_FORWARD\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n #endif\n czm_materialInput materialInput;\n materialInput.normalEC = normalEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n materialInput.st = v_st;\n vec2 st = materialInput.st;\n czm_material material = czm_getDefaultMaterial(materialInput);\n float dt_a11 = fract(czm_frameNumber / 100.0) * 3.14159265 * 2.0;\n float dt_a12 = sin(dt_a11);\n float vst=smoothstep(0.7, 1.0, dt_a12)+0.4;\n vec4 colorImage = texture(myImage, vec2(fract(st.s- czm_frameNumber*0.003), st.t));\n material.alpha =mix(0.1,1.0,clamp((1.0-st.t) * color.a,0.0,1.0)) +(1.0-sign(st.t-czm_frameNumber*0.001))*0.2*(1.0-colorImage.r)+0.4;\n material.diffuse =(1.0-colorImage.a)*vec3(1.0,2.0,1.0)+colorImage.rgb*vec3(1.0,2.0,1.0);\n #ifdef FLAT\n out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n #else\n out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n #endif\n }\n "},V=function(i){C.createIfNeeded(i._imageUrl).fetchImage().then(function(t){var e=i._viewer.scene.context,e=c(t.internalFormat)?new y({context:e,pixelFormat:t.internalFormat,width:t.naturalWidth,height:t.naturalHeight,source:{arrayBufferView:t.bufferView}}):new y({context:e,source:t});i._texture=e})},R=function(t){var e=w.eastNorthUpToFixedFrame(t._localPosition),i=f.fromScale(t._scale),n=f.multiply(e,i,new f);return t._scaleMatrix=i,t._enuMatrix=e,n},B=function(t){var e=i.fromElements(0,0,t._distance,new b.Cartesian3),e=b.Matrix4.multiplyByPoint(t._enuMatrix,e,new i),e=f.multiplyByPoint(t._viewer.scene.camera._viewMatrix,e,new i),t=f.multiplyByPoint(t._viewer.scene.camera.frustum.projectionMatrix,e,new i);return i.normalize(t,new i).z};b.Scene.TetrahedronPrimitive=t}catch(i){console.log(i)}},_installXyzAxisPrimitive:function(){function t(t){this._viewer=t.viewer,this._model=t.model,this._matrix=t.matrix,this._radius=void 0,this._layer=new b.CustomDataSource("xyz-axis"),this._viewer.dataSources.add(this._layer),this._handler=new b.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._xyzState=!1,this._xyzPid=void 0,this._builds()}t.prototype={_builds(){this._createAxisXYZ(),this._bindHandler()},remove(){this._layer._primitives.removeAll(),this._handler.distory()},_createAxisXYZ:function(){this._model.readyPromise.then(t=>{var e=b.Matrix4.getTranslation(t.modelMatrix,new b.Cartesian3),t=t.boundingSphere,i=t.radius,n=new b.ArrowPolylinePrimitive({id:"axisZ",color:b.Color.RED,position:e,width:3,headWidth:5,length:2*i+50,headLength:10}),a=new b.ArrowPolylinePrimitive({id:"axisX",color:b.Color.GREEN,position:e,width:3,headWidth:5,length:2*i+50,headLength:10}),e=new b.ArrowPolylinePrimitive({id:"axisY",color:b.Color.BLUE,position:e,width:3,headWidth:5,length:2*i+50,headLength:10}),i=b.Matrix3.fromRotationY(b.Math.toRadians(90)),i=(this._rotationX=b.Matrix4.fromRotationTranslation(i),b.Matrix4.multiply(a.geometryInstances[0].modelMatrix,this._rotationX,a.geometryInstances[0].modelMatrix),b.Matrix4.multiply(a.geometryInstances[1].modelMatrix,this._rotationX,a.geometryInstances[1].modelMatrix),b.Matrix3.fromRotationX(b.Math.toRadians(90)));this._rotationY=b.Matrix4.fromRotationTranslation(i),b.Matrix4.multiply(e.geometryInstances[0].modelMatrix,this._rotationY,e.geometryInstances[0].modelMatrix),b.Matrix4.multiply(e.geometryInstances[1].modelMatrix,this._rotationY,e.geometryInstances[1].modelMatrix),this._layer._primitives.add(n),this._layer._primitives.add(a),this._layer._primitives.add(e),this._radius=t.radius,this._createAxisSphere()})},_createAxisSphere:function(){var e=[];for(let t=0;t<=360;t+=3){const i=Math.sin(b.Math.toRadians(t)),n=Math.cos(b.Math.toRadians(t)),a=this._radius*n,r=this._radius*i;e.push(new b.Cartesian3(a,r,0))}var t=this._createAxisSpheres("axisSphereZ",e,this._matrix,b.Color.RED);this._layer._primitives.add(t);const i=this._createAxisSpheres("axisSphereY",e,this._matrix,b.Color.GREEN),n=(this._layer._primitives.add(i),b.Matrix4.multiply(i.geometryInstances.modelMatrix,this._rotationY,i.geometryInstances.modelMatrix),this._createAxisSpheres("axisSphereX",e,this._matrix,b.Color.BLUE));this._layer._primitives.add(n),b.Matrix4.multiply(n.geometryInstances.modelMatrix,this._rotationX,n.geometryInstances.modelMatrix)},_createAxisSpheres:function(t,e,i,n){e=new b.PolylineGeometry({positions:e,width:10}),e=new b.GeometryInstance({geometry:e,id:t,attributes:{color:b.ColorGeometryInstanceAttribute.fromColor(n)}});return new b.Primitive({geometryInstances:e,appearance:new b.PolylineColorAppearance({translucent:!1}),modelMatrix:i})},_updateAxis(i){if(this._layer){var n=this._layer._primitives._primitives;for(let t=1,e=n.length;t<e;t++){var a=n[t],r=b.Matrix4.fromTranslation(new b.Cartesian3(i.x,i.y,i.z));b.Matrix4.multiply(a.modelMatrix,r,a.modelMatrix)}}var t=b.Matrix4.fromTranslation(new b.Cartesian3(i.x,i.y,i.z));b.Matrix4.multiply(this._model.modelMatrix,t,this._model.modelMatrix)},_updateAxisSphere(i){if(this._layer){var n=this._layer._primitives._primitives;for(let t=1,e=n.length;t<e;t++){var a=n[t],r=b.Matrix4.fromRotationTranslation(i);b.Matrix4.multiply(a.modelMatrix,r,a.modelMatrix)}}var t=b.Matrix4.fromRotationTranslation(i);b.Matrix4.multiply(this._model.modelMatrix,t,this._model.modelMatrix)},_bindHandler(){this._handler.setInputAction(t=>{if(this._xyzState&&this._xyzPid)switch(this._xyzPid){case"axisX-line":this._updateAxis({x:-1,y:0,z:0});break;case"axisY-line":this._updateAxis({x:0,y:-1,z:0});break;case"axisZ-line":this._updateAxis({x:0,y:0,z:-1});break;case"axisX-arrow":this._updateAxis({x:1,y:0,z:0});break;case"axisY-arrow":this._updateAxis({x:0,y:1,z:0});break;case"axisZ-arrow":this._updateAxis({x:0,y:0,z:1});break;case"axisSphereX":this._updateAxisSphere(b.Matrix3.fromRotationX(b.Math.toRadians(1)));break;case"axisSphereY":this._updateAxisSphere(b.Matrix3.fromRotationY(b.Math.toRadians(1)));break;case"axisSphereZ":this._updateAxisSphere(b.Matrix3.fromRotationZ(b.Math.toRadians(1)))}},b.ScreenSpaceEventType.MOUSE_MOVE),this._handler.setInputAction(t=>{t=viewer.scene.pick(t.position);t&&t.id&&(this._xyzPid=t.id,this._xyzState=!0)},b.ScreenSpaceEventType.LEFT_DOWN),this._handler.setInputAction(()=>{this._xyzState=!1,this._xyzPid=void 0},b.ScreenSpaceEventType.LEFT_UP)}},b.Scene.XyzAxisPrimitive=t},_installArrowPolylinePrimitive:function(){b.Scene.ArrowPolylinePrimitive=function(t={}){this._color=t.color||b.Color.RED,this._width=t.width||3,this._headWidth=t.headWidth||2*this._width,this._length=t.length||300,this._headLength=t.headLength||10,this._inverse=t.inverse||!1,this.position=t.position;var t=t.id,e=b.CylinderGeometry.createGeometry(new b.CylinderGeometry({length:this._length,topRadius:this._width,bottomRadius:this._width})),i=b.CylinderGeometry.createGeometry(new b.CylinderGeometry({length:this._headLength,topRadius:0,bottomRadius:this._headWidth}));let n=(this._length+this._headLength)/2;this._inverse&&(n=-n);var a=i,r=[0,0,n],o=new b.Cartesian3;r.length?(o.x=r[0],o.y=r[1],o.z=r[2]):b.Cartesian3.clone(r,o);for(let t=0;t<a.attributes.position.values.length;t+=3)a.attributes.position.values[t]+=o.x,a.attributes.position.values[t+1]+=o.y,a.attributes.position.values[t+2]+=o.z;return new b.Primitive({modelMatrix:b.Transforms.eastNorthUpToFixedFrame(this.position),geometryInstances:[new b.GeometryInstance({id:t+"-line",geometry:e}),new b.GeometryInstance({id:t+"-arrow",geometry:i})],appearance:new b.MaterialAppearance({material:b.Material.fromType("Color",{color:this._color})})})}},_installShadowPrimitive:function(){function t(t){var e=(t=b.defaultValue(t,b.defaultValue.EMPTY_OBJECT)).scene;if(!b.defined(e))throw new b.DeveloperError("scene is required.");var i=(this._scene=e)._context;if(!b.defined(i))throw new b.DeveloperError("context is required.");if(!b.defined(t.viewerPosition))throw new b.DeveloperError("this view position is required.");this._viewerPosition=t.viewerPosition,this._positions=void 0,this._indices=void 0,this._drawLineCommand=void 0,this._depthCamera=new b.Camera(e),this._depthCamera.position=this._viewerPosition,this._direction=0,this._pitch=0,this._horizontalFov=b.defaultValue(t.horizontalFov,60),this._verticalFov=b.defaultValue(t.verticalFov,45),this._cameraUpdated=!1,this._targetPoint=this._viewerPosition.clone();e=new b.Cartesian3(0,0,100),t=b.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);b.Matrix4.multiplyByPoint(t,e,this._targetPoint),this._distance=100,this._cameraUpdated=!1,this._modelMatrix=new b.Matrix4,this._shadowMap=new b.ShadowMap({context:i,enabled:!0,lightCamera:this._depthCamera,cascadesEnabled:!1}),this.show=!0,this._invisiblyColor=b.Color.RED,this._visiblyColor=b.Color.GREEN,this._shadowMap.useCustomColor=!0,this.shadowMap._customColor={invisibly:b.Color.RED,visibly:b.Color.GREEN},this._initialize=function(){this._positions=new Float32Array(633),this._indices=new Uint16Array(408);var t=this._indices,e=0;t[e++]=0,t[e++]=1,t[e++]=0,t[e++]=21,t[e++]=0,t[e++]=85,t[e++]=0,t[e++]=105;for(var i=0,n=0;n<5;++n){i++;for(var a=0;a<20;++a)t[e++]=i++,t[e++]=i}i++;for(var r=0;r<20;++r)for(var o=0;o<5;++o)t[e++]=i,t[e++]=5+i++;this._initialized=!0},this._debugLightFrustum=void 0,this._debugShow=!0}Object.defineProperties(t.prototype,{shadowMap:{get:function(){return this._shadowMap}},debugLightFrustum:{get:function(){return this._debugLightFrustum}},debugShow:{get:function(){return this._debugShow},set:function(t){this.shadowMap.debugShow=t,this._debugShow=t}},invisiblyColor:{get:function(){return this._invisiblyColor},set:function(t){this._invisiblyColor=t,this.shadowMap._customColor.invisibly=t}},visiblyColor:{get:function(){return this._visiblyColor},set:function(t){this._visiblyColor=t,this.shadowMap._customColor.visibly=t}},viewerPosition:{get:function(){return this._viewerPosition},set:function(t){this._viewerPosition=t,this._cameraUpdated=!1}},direction:{get:function(){return this._direction},set:function(t){this._direction=t,this._cameraUpdated=!1}},pitch:{get:function(){return this._pitch},set:function(t){this._pitch=t,this._cameraUpdated=!1}},horizontalFov:{get:function(){return this._horizontalFov},set:function(t){this._horizontalFov=t,this._cameraUpdated=!1,this._hintLineUpdated=!1}},verticalFov:{get:function(){return this._verticalFov},set:function(t){this._verticalFov=t,this._cameraUpdated=!1,this._hintLineUpdated=!1}},distance:{get:function(){return this._distance},set:function(t){this._distance=t,this._cameraUpdated=!1}}}),t.prototype.setDebugFrustumEffect=function(e,i){var t,n;this.debugShow&&(t=this.debugLightFrustum._planesPrimitives,n=this.debugLightFrustum._outlinePrimitives,t.forEach(function(t){t.show=e}),n.forEach(function(t){t.show=i}))},t.prototype.update=function(t){var e;this.show&&(this._cameraUpdated||(this._updateCamera(),this.debugShow&&!b.defined(this.debugLightFrustum)&&(this._debugLightFrustum=new b.DebugCameraPrimitive({camera:this._depthCamera,color:b.Color.YELLOW,updateOnChange:!0}),this.setDebugFrustumEffect(!1,!0))),e=t.frustumSplits[1],t.frustumSplits[1]=this._distance,this._debugLightFrustum.update(t),t.frustumSplits[1]=e,t.shadowMaps.push(this.shadowMap))},t.prototype._updateCamera=function(){this._depthCamera.frustum.near=.001*this._distance,this._depthCamera.frustum.far=this._distance,this._depthCamera.frustum.fov=b.Math.toRadians(Math.max(this._horizontalFov,this._verticalFov)),this._depthCamera.frustum.aspectRatio=this._horizontalFov/this._verticalFov,this._depthCamera.setView({destination:this._viewerPosition,orientation:{heading:b.Math.toRadians(this._direction),pitch:b.Math.toRadians(this._pitch)}}),this._modelMatrix=this._depthCamera.inverseViewMatrix,this._cameraUpdated=!0},t.prototype.setPoseByTargetPoint=function(t){this.distance=b.Cartesian3.distance(this._viewerPosition,t);var e=new b.Cartesian3,i=b.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);b.Matrix4.inverse(i,i),b.Matrix4.multiplyByPoint(i,t,e),b.Cartesian3.normalize(e,e),this.direction=b.Math.toDegrees(Math.atan2(e.x,e.y)),this.pitch=b.Math.toDegrees(Math.asin(e.z))},t.prototype._updateHintLine=function(t){var e,i=this._positions,n=b.Math.toRadians(this._horizontalFov),a=b.Math.toRadians(this._verticalFov),r=Math.tan(.5*n),a=Math.tan(.5*a),o=-(r=this._distance*r),a=-(e=this._distance*a),o=new b.Cartesian3(o,a,-this._distance),a=new b.Cartesian3(r,e,0),r=(b.Matrix4.multiplyByPoint(this._modelMatrix,o,o),b.Matrix4.multiplyByPoint(this._modelMatrix,a,a),b.BoundingSphere.fromCornerPoints(o,a));if(t.cullingVolume.computeVisibility(r)!==Intersect.OUTSIDE){this._valid=!0;var s=0;i[s++]=0,i[s++]=0,i[s++]=0;for(var l,c=Math.PI-.5*n,h=n/4,u=0;u<5;++u)for(var x=c+u*h,d=e/(this._distance/Math.cos(x)),Z=-(f=Math.atan(d)),p=f/10,g=0;g<21;++g)l=Z+g*p,i[s++]=this._distance*Math.cos(l)*Math.sin(x),i[s++]=this._distance*Math.sin(l),i[s++]=this._distance*Math.cos(l)*Math.cos(x);for(var h=n/20,m=0;m<21;++m){x=c+m*h;for(var f,d=e/(this._distance/Math.cos(x)),Z=-(f=Math.atan(d)),p=f/2,v=0;v<5;++v)l=Z+v*p,i[s++]=this._distance*Math.cos(l)*Math.sin(x),i[s++]=this._distance*Math.sin(l),i[s++]=this._distance*Math.cos(l)*Math.cos(x)}var y,C=t.context,o=b.Buffer.createIndexBuffer({context:C,typedArray:new Uint32Array(this._indices),usage:b.BufferUsage.STATIC_DRAW,indexDatatype:IndexDatatype.UNSIGNED_INT}),a=b.Buffer.createVertexBuffer({context:C,typedArray:b.ComponentDatatype.createTypedArray(b.ComponentDatatype.FLOAT,this._positions),usage:b.BufferUsage.STATIC_DRAW}),n=[],t=(n.push({index:0,vertexBuffer:a,componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1}),new b.VertexArray({context:C,attributes:n,indexBuffer:o}));b.defined(this._drawLineCommand)?(this._drawLineCommand.vertexArray.destroy(),this._drawLineCommand.vertexArray=t,this._drawLineCommand.modelMatrix=this._modelMatrix,this._drawLineCommand.boundingVolume=r):(a=b.ShaderProgram.fromCache({context:C,vertexShaderSource:"ttribute vec3 position;\n uniform mat4 u_modelViewMatrix;\n void main()\n {\n gl_Position = czm_projection* u_modelViewMatrix* vec4(position.xyz,1.0);\n }\n ",fragmentShaderSource:"uniform vec4 u_bgColor;\n void main()\n {\n out_FragColor = u_bgColor;\n }\n "}),n=b.RenderState.fromCache({depthTest:{enabled:!0}}),o={u_bgColor:function(){return y._lineColor},u_modelViewMatrix:function(){return C.uniformState.modelView}},(y=this)._drawLineCommand=new b.DrawCommand({boundingVolume:r,modelMatrix:y._modelMatrix,primitiveType:b.PrimitiveType.LINES,vertexArray:t,shaderProgram:a,castShadows:!1,receiveShadows:!1,uniformMap:o,renderState:n,pass:b.Pass.OPAQUE})),this._hintLineUpdated=!0}else this._valid=!1},b.Scene.ShadowPrimitive=t},_installPointsPrimitive:function(){function t(t){t&&t.viewer&&t.Cartesians&&(this._vertexShader=this.getVSPolylie(),this._fragmentShader=this.getFSPolyline(),this._geometry=null,this._appearance=null,this._viewer=t.viewer,this.build(t))}t.prototype={build:function(t){if(t.Cartesians&&2<=t.Cartesians.length){var e=[],i=[],n=[];if(t.Colors&&t.Colors.length===4*t.Cartesians.length){for(var a=0;a<t.Cartesians.length;a++)e.push(t.Cartesians[a].x),e.push(t.Cartesians[a].y),e.push(t.Cartesians[a].z);i=t.Colors}else for(var r=0;r<t.Cartesians.length;r++)e.push(t.Cartesians[r].x),e.push(t.Cartesians[r].y),e.push(t.Cartesians[r].z),i.push(0),i.push(0),i.push(1),i.push(1);for(var o=0;o<t.Cartesians.length;o++)n.push(o);this.positionArr=new Float64Array(e),this.colorArr=new Float32Array(i),this.indiceArr=new Uint16Array(n)}else{var s=b.Cartesian3.fromDegrees(0,0,-10),l=b.Cartesian3.fromDegrees(0,.001,-10);this.positionArr=new Float64Array([s.x,s.y,s.z,l.x,l.y,l.z]),this.colorArr=new Float32Array([0,0,1,1,0,0,1,1]),this.indiceArr=new Uint16Array([0,1])}this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),this._appearance=this.createAppearence(this._fragmentShader,this._vertexShader),this.primitive=this._viewer.scene.primitives.add(new b.Primitive({geometryInstances:new b.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))},getVSPolylie:function(){return"in vec3 position3DHigh; in vec3 position3DLow; in vec4 color; out vec4 v_color; in float batchId; void main() { vec4 p = czm_computePosition(); v_color =color; p = czm_modelViewProjectionRelativeToEye * p; gl_Position = p; gl_PointSize=4.0; } "},getFSPolyline:function(){return"in vec4 v_color; void main() { float d = distance(gl_PointCoord, vec2(0.5,0.5)); if(d < 0.5){ out_FragColor = v_color; }else{ discard; } } "},createAppearence:function(t,e){return new b.Appearance({renderState:{blending:b.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,depthTest:{enabled:!0},depthMask:!0},fragmentShaderSource:t,vertexShaderSource:e})},createGeometry:function(t,e,i){return new b.Geometry({attributes:{position:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t}),color:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:4,values:e})},indices:i,primitiveType:b.PrimitiveType.POINTS,boundingSphere:b.BoundingSphere.fromVertices(t)})},remove:function(){null!=this.primitive&&(this._viewer.scene.primitives.remove(this.primitive),this.primitive=null)},updateCartesianPosition:function(t){if(null!=this.primitive&&(this._viewer.scene.primitives.remove(this.primitive),!(t&&t.length<2))){if(t.length===this.positionArr.length/3){var e=t[0],i=t[1];this.positionArr=new Float64Array([e.x,e.y,e.z,i.x,i.y,i.z]),this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr)}else{for(var n=[],a=[],r=[],o=0;o<t.length;o++)n.push(t[o].x),n.push(t[o].y),n.push(t[o].z),a.push(0),a.push(0),a.push(1),a.push(1);for(var s=0;s<t.length;s++)r.push(s);this.positionArr=new Float64Array(n),this.colorArr=new Float32Array(a),this.indiceArr=new Uint16Array(r),geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),appearance=this.createAppearence(this._fragmentShader,this._vertexShader)}this.primitive=this._viewer.scene.primitives.add(new b.Primitive({geometryInstances:new b.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))}},updateCartesianPositionColor:function(t,e){if(e.length===4*t.length&&null!=this.primitive&&(viewer.scene.primitives.remove(this.primitive),!(t&&t.length<2))){if(t.length===this.positionArr.length/3){var i=t[0],n=t[1];this.positionArr=new Float64Array([i.x,i.y,i.z,n.x,n.y,n.z]),this.colorArr=new Float32Array(e),geometry=CreateGeometry(this.positionArr,this.colorArr,this.indiceArr)}else{for(var a=[],r=[],o=0;o<t.length;o++)a.push(t[o].x),a.push(t[o].y),a.push(t[o].z);for(o=0;o<t.length;o++)r.push(o);this.positionArr=new Float64Array(a),this.colorArr=new Float32Array(e),this.indiceArr=new Uint16Array(r),this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),this._appearance=this.createAppearence(this._fragmentShader,this._vertexShader)}this.primitive=viewer.scene.primitives.add(new b.Primitive({geometryInstances:new b.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))}}},b.Scene.PointsPrimitive=t},_installWaterPrimitive:function(){function t(t){this._positions=t.positions,this._url=t.img||this.getDfSt(["primitive","WaterPrimitive"])||"static/data/images/Textures/waterNormals.jpg",this._frequency=t.frequency||1e3,this._animationSpeed=t.animationSpeed||.01,this._amplitude=t.amplitude||10,this._extrudedHeight=t.extrudedHeight||0,this._fs=this.getFS()}t.prototype.build=function(){this._geometry=this._createGeometry(),this._appearance=this._createAppearence(),this.primitive=this._viewer.scene.primitives.add(new b.Primitive({allowPicking:!1,geometryInstances:new b.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))},t.prototype._createAppearence=function(){return new b.EllipsoidSurfaceAppearance({material:new b.Material({fabric:{type:"Water",uniforms:{normalMap:this._url,frequency:this._frequency,animationSpeed:this._animationSpeed,amplitude:this._amplitude}}}),fragmentShaderSource:this._fs})},t.prototype._createGeometry=function(){return new b.PolygonGeometry({polygonHierarchy:new b.PolygonHierarchy(b.Cartesian3.fromDegreesArrayHeights(this._positions)),extrudedHeight:this._extrudedHeight,perPositionHeight:!0})},t.prototype.getFS=function(){return"in vec3 v_positionMC;\n in vec3 v_positionEC;\n in vec2 v_st;\n \n void main()\n {\n czm_materialInput materialInput;\n vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n #ifdef FACE_FORWARD\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n #endif\n materialInput.s = v_st.s;\n materialInput.st = v_st;\n materialInput.str = vec3(v_st, 0.0);\n materialInput.normalEC = normalEC;\n materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\n vec3 positionToEyeEC = -v_positionEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n czm_material material = czm_getMaterial(materialInput);\n #ifdef FLAT\n out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n #else\n out_FragColor = czm_phong(normalize(positionToEyeEC), material);\n out_FragColor.a = 0.5;\n #endif\n }\n "},C.prototype.updateDegreesPosition=function(t,e){null==this.primitive||(this._viewer.scene.primitives.remove(this.primitive),t&&t.length<3)||(t=this._createGeometry(t,e||0),this.primitive=this._viewer.scene.primitives.add(new b.Primitive({allowPicking:!1,geometryInstances:new b.GeometryInstance({geometry:t}),appearance:this._appearance,asynchronous:!1})))},b.Scene.WaterPrimitive=t},_installTexturePrimitive:function(){function t(t){this._vertexShader=this.getVS(),this._fragmentShader=this.getFS(),this._materialShader=this.getMS(),this._url=t.url,this._cartesians=t.cartesians,this._id=t.id||""}t.prototype.build=function(){for(var t=[],e=0;e<this._cartesians.length;e++)t.push(this._cartesians[e].x),t.push(this._cartesians[e].y),t.push(this._cartesians[e].z);this._positionArr=new Float32Array(t),this._sts=new Uint8Array([0,0,1,0,1,1,0,1]),this._indiceArr=new Uint16Array([0,1,2,0,2,3]),this._geometry=this._createGeometry(),this._appearance=this._createAppearence(),this.primitive=this._viewer.scene.primitives.add(new b.Primitive({geometryInstances:new b.GeometryInstance({geometry:this._geometry,id:this._id}),appearance:this._appearance,asynchronous:!1}))},t.prototype._createGeometry=function(){var t=new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:this._sts});return new b.Geometry({attributes:{position:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:this._positions}),st:t},indices:this._indices,primitiveType:b.PrimitiveType.TRIANGLES,boundingSphere:b.BoundingSphere.fromVertices(positions)})},t.prototype._createAppearence=function(){return new b.Appearance({material:new b.Material({fabric:{uniforms:{image:this._url},source:this._materialShader}}),aboveGround:!0,faceForward:!0,flat:!0,translucent:!1,renderState:{blending:b.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,depthTest:{enabled:!0},depthMask:!0},fragmentShaderSource:this._fragmentShader,vertexShaderSource:this._vertexShader})},t.prototype.getVS=function(){return"in vec3 position3DHigh; in vec3 position3DLow; in vec2 st; in float batchId; out vec2 v_st; void main() { vec4 p = czm_computePosition(); v_st=st; p = czm_modelViewProjectionRelativeToEye * p; gl_Position = p; } "},t.prototype.getFS=function(){return"in vec2 v_st; void main() { czm_materialInput materialInput; czm_material material=czm_getMaterial(materialInput,v_st); vec4 color=vec4(material.diffuse + material.emission,material.alpha); if(color.x==1.0&&color.y==1.0&&color.z==1.0&&color.w==1.0) color=vec4(vec3(0.0,0.0,0.0),0.0); out_FragColor =color; } "},t.prototype.getMS=function(){return"czm_material czm_getMaterial(czm_materialInput materialInput,vec2 v_st) { vec4 color = texture(image, v_st); czm_material material = czm_getDefaultMaterial(materialInput); material.diffuse= color.rgb; material.alpha=color.a; return material; } "},b.Scene.TexturePrimitive=t},_installProbingPrimitive:function(){var e={color:new b.Color(1,0,1,.8),repeat:30,offset:0,thickness:.3,center:b.Cartesian3.fromDegrees(116.39,39.9),length:4e5,bottom:1e3,top:0},i=this._viewer;function t(t){this._viewer=i,this._length=t.length||e.length,this._center=t.center||e.center,this._color=t.color||e.color,this._repeat=t.repeat||e.repeat,this._offset=t.offset||e.offset,this._thickness=t.thickness||e.thickness,this._bottom=t.bottom||e.bottom,this._top=t.top||e.top,this._radar=void 0,this.build()}t.prototype.build=function(){var t=new b.CylinderGeometry({length:this._length,topRadius:this._top,bottomRadius:this._bottom,vertexFormat:b.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat}),t=new b.GeometryInstance({geometry:t,modelMatrix:this.getModelMatrix()}),e=new b.MaterialAppearance({material:this.getMaterial(),faceForward:!1,closed:!0}),i=this;this._radar=this._viewer.scene.primitives.add(new b.Primitive({geometryInstances:[t],appearance:e})),this._viewer.scene.preUpdate.addEventListener(function(){var t=i._radar.appearance.material.uniforms.offset;1<(t-=.001)&&(t=0),i._radar.appearance.material.uniforms.offset=t})},t.prototype.getModelMatrix=function(){return b.Matrix4.multiplyByTranslation(b.Transforms.eastNorthUpToFixedFrame(this._center),new b.Cartesian3(0,0,.5*this._length),new b.Matrix4)},t.prototype.updateModelMatrix=function(){},t.prototype.getMaterial=function(){return new b.Material({fabric:{type:"radarPrimitive",uniforms:{color:this._color,repeat:this._repeat,offset:this._offset,thickness:this._thickness},source:"uniform vec4 color; \n uniform float repeat; \n uniform float offset; \n uniform float thickness;\n\n czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n float sp = 1.0/repeat;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5));\n float m = mod(dis + offset, sp);\n float a = step(sp*(1.0-thickness), m); \n\n material.diffuse = color.rgb;\n material.alpha = a * color.a;\n return material;\n }"},translucent:!1})},t.prototype.remove=function(){this._radar&&this._viewer.scene.primitives.remove(this._radar)},b.Scene.ProbingPrimitive=t}};let w=null;function I(t,e,i){t&&(w=e,this._drawLayer=new w.CustomDataSource("drawLayer"),this.$graphics=new c(t,e),t)&&t.dataSources.add(this._drawLayer)}I.prototype={drawPointGraphics:function(e){var i,n,t,a,r,o;(e=e||{}).style=e.style||{image:this.getDfSt(["drawPointGraphics"])||"static/data/images/file/location4.png",width:35,height:40,clampToGround:!0,scale:1,pixelOffset:new w.Cartesian2(0,-20)},this._viewer&&e&&(t=new w.Entity,a=[],r=this,(o=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas)).setInputAction(function(t){t=r._viewer.scene.camera.pickEllipsoid(t.position,r._viewer.scene.globe.ellipsoid);t&&t.x&&(i=t,a.push(t))},w.ScreenSpaceEventType.LEFT_CLICK),o.setInputAction(function(t){o.destroy(),o=null,"function"==typeof e.callback&&e.callback(r.transformCartesianArrayToWGS84Array(a),n)},w.ScreenSpaceEventType.RIGHT_CLICK),t.billboard=e.style,t.position=new w.CallbackProperty(function(){return i},!1),n=this._drawLayer.entities.add(t))},drawLineGraphics:function(e){if(e=e||{},this._viewer&&e){var i,n=[],t=new w.Entity,a=this,r=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);r.setInputAction(function(t){t=a.getCatesian3FromPX(t.position);t&&t.x&&(0==n.length&&n.push(t.clone()),e.measure&&o(t),2==n.length&&"straightLine"===e.type&&(r.destroy(),r=null,"function"==typeof e.callback)&&e.callback(a.transformCartesianArrayToWGS84Array(n),i),n.push(t))},w.ScreenSpaceEventType.LEFT_CLICK),r.setInputAction(function(t){t=a.getCatesian3FromPX(t.endPosition);2<=n.length&&t&&t.x&&(n.pop(),n.push(t))},w.ScreenSpaceEventType.MOUSE_MOVE),r.setInputAction(function(t){r.destroy(),r=null;t=a.getCatesian3FromPX(t.position);e.measure&&o(t),"function"==typeof e.callback&&e.callback(a.transformCartesianArrayToWGS84Array(n),i)},w.ScreenSpaceEventType.RIGHT_CLICK),t.polyline={width:e.width||5,material:e.material||w.Color.BLUE.withAlpha(.8),clampToGround:e.clampToGround||!1,clampToS3M:e.clampToS3M||!1},t.polyline.positions=new w.CallbackProperty(function(){return n},!1),i=this._drawLayer.entities.add(t);const o=function(t){var e=new w.Entity;e.position=t,e.point={pixelSize:10,outlineColor:w.Color.BLUE,outlineWidth:5},e.label={text:(a.getPositionDistance(a.transformCartesianArrayToWGS84Array(n))/1e3).toFixed(4)+"公里",show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(-20,-80)},a._drawLayer.entities.add(e)}}},drawPolygonGraphics:function(i){if((i=i||{}).style=i.style||{width:3,material:w.Color.BLUE.withAlpha(.8),clampToGround:!0},this._viewer&&i){var n=[],e=new w.PolygonHierarchy,a=new w.Entity,r=this,o=null,s=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);s.setInputAction(function(t){t=r.getCatesian3FromPX(t.position);t&&t.x&&(0==n.length&&(e.positions.push(t.clone()),n.push(t.clone())),n.push(t.clone()),e.positions.push(t.clone()),o||(a.polyline=i.style,a.polyline.positions=new w.CallbackProperty(function(){return n},!1),a.polygon={hierarchy:new w.CallbackProperty(function(){return e},!1),material:w.Color.WHITE.withAlpha(.1),clampToGround:i.clampToGround||!1},a.clampToS3M=!0,o=r._drawLayer.entities.add(a)))},w.ScreenSpaceEventType.LEFT_CLICK),s.setInputAction(function(t){t=r.getCatesian3FromPX(t.endPosition);2<=n.length&&t&&t.x&&(n.pop(),n.push(t),e.positions.pop(),e.positions.push(t))},w.ScreenSpaceEventType.MOUSE_MOVE),s.setInputAction(function(){var t,e;s.destroy(),n.push(n[0]),i.height&&(a.polygon.extrudedHeight=i.height,a.polygon.material=w.Color.BLUE.withAlpha(.5)),i.measure&&(t=n[0],(e=new w.Entity).position=t,e.point={pixelSize:10,outlineColor:w.Color.BLUE,outlineWidth:5},e.label={text:(r.getPositionsArea(r.transformCartesianArrayToWGS84Array(n))/1e6).toFixed(4)+"平方公里",show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(-20,-50)},r._drawLayer.entities.add(e)),"function"==typeof i.callback&&i.callback(r.transformCartesianArrayToWGS84Array(n),o)},w.ScreenSpaceEventType.RIGHT_CLICK)}},drawRectangleGraphics:function(e){var i,n,t,a,r,o;(e=e||{}).style=e.style||{width:3,material:w.Color.BLUE.withAlpha(.5),clampToGround:!0},this._viewer&&e&&(n=[],t=new w.Entity,a=new w.Rectangle,r=this,(o=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas)).setInputAction(function(t){t=r.getCatesian3FromPX(t.position);t&&t.x&&(0==n.length?n.push(t.clone()):(o.destroy(),n.push(t.clone()),a=w.Rectangle.fromCartesianArray([...n,t],w.Ellipsoid.WGS84),"function"==typeof e.callback&&e.callback(r.transformCartesianArrayToWGS84Array(n),i)))},w.ScreenSpaceEventType.LEFT_CLICK),o.setInputAction(function(t){t=r.getCatesian3FromPX(t.endPosition);t&&(a=w.Rectangle.fromCartesianArray([...n,t],w.Ellipsoid.WGS84))},w.ScreenSpaceEventType.MOUSE_MOVE),t.rectangle=e.style,e.height&&(t.rectangle.extrudedHeight=e.height),t.rectangle.coordinates=new w.CallbackProperty(function(){return a},!1),i=this._drawLayer.entities.add(t))},drawCircleGraphics:function(e){if((e=e||{}).style=e.style||{width:3,material:w.Color.BLUE.withAlpha(.5),clampToGround:!0},this._viewer&&e){var i,n=void 0,a=new w.Entity,r=this,o=1,s=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);const l=function(t,e){var t=w.Cartographic.fromCartesian(t),e=w.Cartographic.fromCartesian(e),i=new w.EllipsoidGeodesic,i=(i.setEndPoints(t,e),i.surfaceDistance);o=Math.sqrt(Math.pow(i,2)+Math.pow(e.height-t.height,2))};s.setInputAction(function(t){t=r.getCatesian3FromPX(t.position);t&&t.x&&(n?(l(n,t),s.destroy(),"function"==typeof e.callback&&e.callback({center:n,radius:o},i)):(n=t,a.ellipse=e.style,a.ellipse.semiMajorAxis=new w.CallbackProperty(function(){return o},!1),a.ellipse.semiMinorAxis=new w.CallbackProperty(function(){return o},!1),a.position=new w.CallbackProperty(function(){return n},!1),a.point={pixelSize:5,outlineColor:w.Color.RED,outlineWidth:3},e.height&&(a.ellipse.extrudedHeight=e.height),i=r._drawLayer.entities.add(a)))},w.ScreenSpaceEventType.LEFT_CLICK),s.setInputAction(function(t){t=r._viewer.scene.camera.pickEllipsoid(t.endPosition,r._viewer.scene.globe.ellipsoid);n&&t&&t.x&&l(n,t)},w.ScreenSpaceEventType.MOUSE_MOVE)}},drawTrianglesGraphics:function(e){if((e=e||{}).style=e.style||{width:3,material:w.Color.BLUE.withAlpha(.5)},this._viewer&&e){var i=new w.Entity,n=new w.Entity,a=new w.Entity,r=[],o=[],s=[],l=this,c=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);c.setInputAction(function(t){t=l.getCatesian3FromPX(t.position);if(!t)return!1;0==r.length?(r.push(t.clone()),r.push(t.clone()),o.push(t.clone()),o.push(t.clone())):(c.destroy(),"function"==typeof e.callback&&e.callback({e:i,e2:n,e3:a}))},w.ScreenSpaceEventType.LEFT_CLICK),c.setInputAction(function(t){var e,i,t=l.getCatesian3FromPX(t.endPosition);t&&0<r.length&&(r.pop(),r.push(t.clone()),e=r,i=w.Cartographic.fromCartesian(e[0]),e=w.Cartographic.fromCartesian(e[1]),i=w.Cartesian3.fromDegrees(w.Math.toDegrees(i.longitude),w.Math.toDegrees(i.latitude),e.height),o.pop(),o.push(i.clone()),s.pop(),s.pop(),s.push(t.clone()),s.push(i.clone()))},w.ScreenSpaceEventType.MOUSE_MOVE),i.polyline={positions:new w.CallbackProperty(function(){return r},!1),...e.style},i.position=new w.CallbackProperty(function(){return r[0]},!1),i.point={pixelSize:5,outlineColor:w.Color.BLUE,outlineWidth:5},i.label={text:new w.CallbackProperty(function(){return"直线:"+l.getPositionDistance(l.transformCartesianArrayToWGS84Array(r))+"米"},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(50,-100)},n.polyline={positions:new w.CallbackProperty(function(){return o},!1),...e.style},n.position=new w.CallbackProperty(function(){return s[1]},!1),n.point={pixelSize:5,outlineColor:w.Color.BLUE,outlineWidth:5},n.label={text:new w.CallbackProperty(function(){return"高度:"+(e=o[1],!(t=o[0])&&!e||w.Cartesian3.equals(t,e)?0:(t=w.Cartographic.fromCartesian(t),(w.Cartographic.fromCartesian(e).height-t.height).toFixed(2)))+"米";var t,e},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(-20,100)},a.polyline={positions:new w.CallbackProperty(function(){return s},!1),...e.style},a.position=new w.CallbackProperty(function(){return r[1]},!1),a.point={pixelSize:5,outlineColor:w.Color.BLUE,outlineWidth:5},a.label={text:new w.CallbackProperty(function(){return"水平距离:"+l.getPositionDistance(l.transformCartesianArrayToWGS84Array(s))+"米"},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(-150,-20)},this._drawLayer.entities.add(a),this._drawLayer.entities.add(n),this._drawLayer.entities.add(i)}},drawWallGraphics:function(n){var a;(n=n||{}).style=n.style||{material:w.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:w.Color.WHITE},this._viewer&&n&&(a=this).drawPolygonGraphics({callback:function(t,e){var i=a._drawLayer.entities.add({wall:{positions:a.transformWGS84ArrayToCartesianArray(t),...n.style}});"function"==typeof n.callback&&n.callback(t,i)}})},drawEllipsoidGraphics:function(n){var a;(n=n||{}).style=n.style||{},this._viewer&&n&&(a=this).drawCircleGraphics({callback:function(t,e){var i=a.createGraphics(),e=(i.ellipsoid=a.$graphics.getEllipsoidGraphics({radii:t.radius}),i.position=t.center,a._drawLayer.entities.remove(e),a._drawLayer.entities.add(i));"function"==typeof n.callback&&n.callback({center:t.center,radius:t.radius},e)}})},drawCylinderGraphics:function(n){var a;(n=n||{}).style=n.style||{},this._viewer&&n&&(a=this).drawCircleGraphics({callback:function(t,e){var i=a._drawLayer.entities.add({position:t.center,cylinder:{length:2*t.radius||n.length,topRadius:n.topRadius||t.radius,bottomRadius:n.bottomRadius||t.radius,material:w.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:w.Color.WHITE}});a._drawLayer.entities.remove(e),"function"==typeof n.callback&&n.callback({center:t.center,radius:t.radius},i)}})},drawCorridorGraphics:function(n){var a;(n=n||{}).style=n.style||{},this._viewer&&n&&(a=this).drawLineGraphics({callback:function(t,e){var i=a.createGraphics(),e=(i.corridor={positions:a.transformWGS84ArrayToCartesianArray(t),height:n.height||1,width:n.width||100,cornerType:w.CornerType.BEVELED,extrudedHeight:n.extrudedHeight||1,material:w.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:w.Color.WHITE},a._drawLayer.entities.remove(e),a._drawLayer.entities.add(i));"function"==typeof n.callback&&n.callback(t,e)}})},drawPolylineVolumeGraphics:function(a){(a=a||{}).style=a.style||{};const r=a.circleRadius||20,o=a.arms||7,s=a.rOuter||150,l=a.rInner||75;var c;this._viewer&&a&&(c=this).drawLineGraphics({callback:function(t,e){var i=c.createGraphics(),n="fivePoint"===a.shape?c.computeStar2d(o,s,l):c.computeCircleShap(r),n=(i.polylineVolume={positions:c.transformWGS84ArrayToCartesianArray(t),shape:n,cornerType:w.CornerType.MITERED,material:a.color||w.Color.RED},c._drawLayer.entities.remove(e),c._drawLayer.entities.add(i));"function"==typeof a.callback&&a.callback(t,n)}})}};let _={};function A(t,e){t&&(this._viewer=t,_=e)}A.prototype={mathDistance2d:function(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))},getCirclePoints2d:function(t,e,i,n){for(var a=[],r=Math.PI/180*Math.round(360/n),o=0;o<n;o++){var s=e+t*Math.sin(r*o),l=i+t*Math.cos(r*o);a.unshift({x:s,y:l})}return a},wholeDistance2d:function(i){let n=0;return i&&Array.isArray(i)&&0<i.length&&i.forEach((t,e)=>{e<i.length-1&&(n+=this.mathDistance2d(t,i[e+1]))}),n},getBaseLength2d:function(t){return Math.pow(this.wholeDistance2d(t),.99)},computeStar2d(t,e,i){for(var n=Math.PI/t,a=2*t,r=new Array(a),o=0;o<a;o++){var s=o%2==0?e:i;r[o]=new _.Cartesian2(Math.cos(o*n)*s,Math.sin(o*n)*s)}return r},computeCircleShap(e){var i=[];for(let t=0;t<360;t++){var n=_.Math.toRadians(t);i.push(new _.Cartesian2(e*Math.cos(n),e*Math.sin(n)))}return i},mid2d:function(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]},getCircleCenterOfThreePoints2d:function(t,e,i){var n=[(t[0]+e[0])/2,(t[1]+e[1])/2],e=[n[0]-t[1]+e[1],n[1]+t[0]-e[0]],a=[(t[0]+i[0])/2,(t[1]+i[1])/2],t=[a[0]-t[1]+i[1],a[1]+t[0]-i[0]];return this.getIntersectPoint2d(n,e,a,t)},getIntersectPoint2d:function(t,e,i,n){return t[1]===e[1]?[(n[0]-i[0])/(n[1]-i[1])*(t[1]-i[1])+i[0],t[1]]:i[1]===n[1]?[(e[0]-t[0])/(e[1]-t[1])*(i[1]-t[1])+t[0],i[1]]:(e=(e[0]-t[0])/(e[1]-t[1]),n=(n[0]-i[0])/(n[1]-i[1]),[e*(i=(e*t[1]-t[0]-n*i[1]+i[0])/(e-n))-e*t[1]+t[0],i])},getAzimuth2d:function(t,e){let i,n=Math.asin(Math.abs(e[1]-t[1])/this.mathDistance2d(t,e));return e[1]>=t[1]&&e[0]>=t[0]?i=n+Math.PI:e[1]>=t[1]&&e[0]<t[0]?i=2*Math.PI-n:e[1]<t[1]&&e[0]<t[0]?i=n:e[1]<t[1]&&e[0]>=t[0]&&(i=Math.PI-n),i},getAngleOfThreePoints2d:function(t,e,i){t=this.getAzimuth2d(e,t)-this.getAzimuth2d(e,i);return t<0?t+2*Math.PI:t},isClockWise2d:function(t,e,i){return(i[1]-t[1])*(e[0]-t[0])>(e[1]-t[1])*(i[0]-t[0])},getPointOnLine2d:function(t,e,i){return[e[0]+t*(i[0]-e[0]),e[1]+t*(i[1]-e[1])]},getCubicValue2d:function(t,e,i,n,a){var[r,o]=[1-(t=Math.max(Math.min(t,1),0)),t*t],s=o*t,l=r*r,c=l*r;return[c*e[0]+3*l*t*i[0]+3*r*o*n[0]+s*a[0],c*e[1]+3*l*t*i[1]+3*r*o*n[1]+s*a[1]]},getThirdPoint2d:function(t,e,i,n,a){t=this.getAzimuth2d(t,e),a=a?t+i:t-i,t=n*Math.cos(a),i=n*Math.sin(a);return[e[0]+t,e[1]+i]},inherits2d:function(t,a){function e(){}e.prototype=a.prototype,t.superClass_=a.prototype,t.prototype=new e,(t.prototype.constructor=t).base=function(t,e,i){var n=Array.prototype.slice.call(arguments,2);return a.prototype[e].apply(t,n)}},getArcPoints2d:function(e,i,n,t){var[a,r,o,s]=[null,null,[],t-n],s=s<0?s+2*Math.PI:s;for(let t=0;t<=100;t++){var l=n+s*t/100,a=e[0]+i*Math.cos(l),r=e[1]+i*Math.sin(l);o.push([a,r])}return o},getBisectorNormals2d:function(t,e,i,n){let a=this.getNormal2d(e,i,n),[r,o,s,l,c]=[null,null,null,null,null],h=Math.sqrt(a[0]*a[0]+a[1]*a[1]),u=a[0]/h,x=a[1]/h,d=this.mathDistance2d(e,i),Z=this.mathDistance2d(i,n);return o=(c=1e-4<h?this.isClockWise(e,i,n)?(s=t*d,l=i[0]-s*x,c=i[1]+s*u,r=[l,c],s=t*Z,l=i[0]+s*x,i[1]-s*u):(s=t*d,l=i[0]+s*x,c=i[1]-s*u,r=[l,c],s=t*Z,l=i[0]-s*x,i[1]+s*u):(l=i[0]+t*(e[0]-i[0]),c=i[1]+t*(e[1]-i[1]),r=[l,c],l=i[0]+t*(n[0]-i[0]),i[1]+t*(n[1]-i[1])),[l,c]),[r,o]},getNormal2d:function(t,e,i){var n=t[0]-e[0],t=t[1]-e[1],a=Math.sqrt(n*n+t*t),a=(n/=a,t/=a,i[0]-e[0]),i=i[1]-e[1],e=Math.sqrt(a*a+i*i);return[n+(a/=e),t+(i/=e)]},getLeftMostControlPoint2d:function(t,e){let[i,n,a,r,o]=[t[0],t[1],t[2],null,null],s=this.getBisectorNormals2d(0,i,n,a)[0],l=this.getNormal2d(i,n,a);var c,h,u,x,d;return o=1e-4<Math.sqrt(l[0]*l[0]+l[1]*l[1])?(t=this.mid2d(i,n),u=i[0]-t[0],c=i[1]-t[1],u=2*(c=-(h=2/this.mathDistance2d(i,n))*c)*(h=h*u),x=s[0]-t[0],d=s[1]-t[1],r=t[0]+(c*c-h*h)*x+u*d,t[1]+u*x+(h*h-c*c)*d):(r=i[0]+e*(n[0]-i[0]),i[1]+e*(n[1]-i[1])),[r,o]},getRightMostControlPoint2d:function(t,e){let i=t.length,n=t[i-3],a=t[i-2],r=t[i-1],o=this.getBisectorNormals2d(0,n,a,r)[1],s=this.getNormal2d(n,a,r),l=Math.sqrt(s[0]*s[0]+s[1]*s[1]),[c,h]=[null,null];var u,x,d,Z,p;return h=1e-4<l?(t=this.mid2d(a,r),d=r[0]-t[0],u=r[1]-t[1],d=2*(u=-(x=2/this.mathDistance2d(a,r))*u)*(x=x*d),Z=o[0]-t[0],p=o[1]-t[1],c=t[0]+(u*u-x*x)*Z+d*p,t[1]+d*Z+(x*x-u*u)*p):(c=r[0]+e*(a[0]-r[0]),r[1]+e*(a[1]-r[1])),[c,h]},getCurvePoints2d:function(e,i){let t=this.getLeftMostControlPoint2d(i,e),[n,a,r,o,s]=[null,null,null,[t],[]];for(let t=0;t<i.length-2;t++){[n,a,r]=[i[t],i[t+1],i[t+2]];var l=this.getBisectorNormals2d(e,n,a,r);o=o.concat(l)}var c=this.getRightMostControlPoint2d(i,e);c&&o.push(c);for(let e=0;e<i.length-1;e++){n=i[e],a=i[e+1],s.push(n);for(let t=0;t<100;t++){var h=this.getCubicValue2d(t/100,n,o[2*e],o[2*e+1],a);s.push(h)}s.push(a)}return s},getBezierPoints2d:function(a){if(a.length<=2)return a;var t=[],r=a.length-1;for(let n=0;n<=1;n+=.01){let[e,i]=[0,0];for(let t=0;t<=r;t++){var o=this.getBinomialFactor2d(r,t),s=Math.pow(n,t),l=Math.pow(1-n,r-t);e+=o*s*l*a[t][0],i+=o*s*l*a[t][1]}t.push([e,i])}return t.push(a[r]),t},getFactorial2d:function(e){let i=1;switch(e){case e<=1:i=1;break;case 2===e:i=2;break;case 3===e:i=6;break;case 24===e:i=24;break;case 5===e:i=120;break;default:for(let t=1;t<=e;t++)i*=t}return i},getBinomialFactor2d:function(t,e){return this.getFactorial2d(t)/(this.getFactorial2d(e)*this.getFactorial2d(t-e))},getQBSplinePoints2d:function(r){if(r.length<=2)return r;var[o,t]=[2,[]],e=r.length-o-1;t.push(r[0]);for(let a=0;a<=e;a++)for(let n=0;n<=1;n+=.05){let[e,i]=[0,0];for(let t=0;t<=o;t++){var s=this.getQuadricBSplineFactor2d(t,n);e+=s*r[a+t][0],i+=s*r[a+t][1]}t.push([e,i])}return t.push(r[r.length-1]),t},getQuadricBSplineFactor2d:function(t,e){let i=0;return 0===t?i=Math.pow(e-1,2)/2:1===t?i=(-2*Math.pow(e,2)+2*e+1)/2:2===t&&(i=Math.pow(e,2)/2),i}};let G=null;function P(t,e){t&&(this._viewer=t,G=e)}P.prototype={setCircleScanEffect:function(t){var e,i,n,a,r,o,s,l,c,h,u;if(t&&t.position)return e=t.id||"CircleScan"+parseInt(1e3*Math.random()),l=t.position,i=t.radius,n=t.color||G.Color.RED,a=t.duration||1500,r=this,o=t.circleMode||"CircleScan",t=t.border||4,u=l,s=new G.Cartesian4(u.x,u.y,u.z,1),u=this.transformCartesianToWGS84(l),l=this.transformWGS84ToCartesian({lng:u.lng,lat:u.lat,alt:u.alt+500}),c=new G.Cartesian4(l.x,l.y,l.z,1),h=(new Date).getTime(),u=new G.PostProcessStage({name:e,fragmentShader:this._getCircleScanShader({get:!0,border:t}),uniforms:{u_scanCenterEC:function(){return G.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,new G.Cartesian4)},u_scanPlaneNormalEC:function(){var t=G.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,new G.Cartesian4),e=G.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,c,new G.Cartesian4),i=new G.Cartesian3;return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,G.Cartesian3.normalize(i,i),i},u_radius:function(){return"CircleScan"==o?i*(((new Date).getTime()-h)%a)/a:i},u_scanColor:n}}),this._viewer.scene.postProcessStages.add(u),u},setRadarScanEffect:function(t){var e,i,n,a,r,o,s,l,c,h,u,x,d,Z,p,g,m,f,v;if(t&&t.position)return e=t.id||"radarScan"+parseInt(1e3*Math.random()),c=t.position,i=t.radius,n=t.color||G.Color.RED,a=t.duration||1500,r=this,o=t.border||1,t=t.width||3,v=c,s=new G.Cartesian4(v.x,v.y,v.z,1),v=this.transformCartesianToWGS84(c),c=this.transformWGS84ToCartesian({lng:v.lng,lat:v.lat,alt:v.alt+500}),l=new G.Cartesian4(c.x,c.y,c.z,1),c=this.transformWGS84ToCartesian({lng:v.lng+.001,lat:v.lat,alt:v.alt}),h=new G.Cartesian4(c.x,c.y,c.z,1),u=(new Date).getTime(),x=new G.Quaternion,d=new G.Matrix3,Z=new G.Cartesian4,p=new G.Cartesian4,g=new G.Cartesian4,m=new G.Cartesian3,f=new G.Cartesian3,v=new G.PostProcessStage({name:e,fragmentShader:this._getRadarScanShader({border:o,width:t,get:!0}),uniforms:{u_scanCenterEC:function(){return G.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,Z)},u_scanPlaneNormalEC:function(){var t=G.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,Z),e=G.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,l,p);return m.x=e.x-t.x,m.y=e.y-t.y,m.z=e.z-t.z,G.Cartesian3.normalize(m,m),m},u_scanLineNormalEC:function(){var t=G.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,Z),e=G.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,l,p),i=G.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,h,g),e=(m.x=e.x-t.x,m.y=e.y-t.y,m.z=e.z-t.z,G.Cartesian3.normalize(m,m),f.x=i.x-t.x,f.y=i.y-t.y,f.z=i.z-t.z,((new Date).getTime()-u)%a/a);return G.Quaternion.fromAxisAngle(m,e*G.Math.PI*2,x),G.Matrix3.fromQuaternion(x,d),G.Matrix3.multiplyByVector(d,f,f),G.Cartesian3.normalize(f,f),f},u_radius:i,u_scanColor:n}}),this._viewer.scene.postProcessStages.add(v),v},lighitCentrumScanEffect:function(e){var i=this.createLightScan_getCirclePoints(e.circle[0],e.circle[1],e.circle[2],e.circle[3]),n=this.createLightScan_entityCList(this._viewer,i,e);for(let t=0;t<n.length;t++)t!==n.length-1?this.createLightScan_changeOnePosition(e,n[t],[i[t].x,i[t].y,i[t+1].x,i[t+1].y]):this.createLightScan_changeOnePosition(e,n[t],[i[t].x,i[t].y,i[0].x,i[0].y]);return n},createLightScan_getCirclePoints:function(t,e,i,n){let a=[],r=Math.PI/180*Math.round(360/n),o=0;for(;o<n;o++){var s=e+t*Math.sin(r*o),l=i+t*Math.cos(r*o);a.unshift({x:s,y:l})}return a},createLightScan_changeOnePosition:function(e,t,i){const n=e.positionList;let a,r,o,s,l,c,h=0,u=0;function x(t){a=n[t+1][0]-n[t][0],r=n[t+1][1]-n[t][1],o=a/e.number,s=r/e.number,u=0}x(h),t.polygon.hierarchy=new G.CallbackProperty(function(){return Math.abs(l)>=Math.abs(a)&&Math.abs(c)>=Math.abs(r)&&((h+=1)===n.length-1&&(h=0),i[0]=i[0]+l,i[1]=i[1]+c,i[2]=i[2]+l,i[3]=i[3]+c,x(h)),l=u*o,c=u*s,u++,new G.PolygonHierarchy(G.Cartesian3.fromDegreesArrayHeights([e.observer[0],e.observer[1],e.observer[2],i[0]+l,i[1]+c,0,i[2]+l,i[3]+c,0]))},!1)},createLightScan_entityCList:function(e,i,n){var a=n.observer[0],r=n.observer[1],o=n.observer[2],s=[];for(let t=0;t<i.length;t++){var l=t===i.length-1?new G.PolygonHierarchy(G.Cartesian3.fromDegreesArrayHeights([a,r,o,i[t].x,i[t].y,0,i[0].x,i[0].y,0])):new G.PolygonHierarchy(G.Cartesian3.fromDegreesArrayHeights([a,r,o,i[t].x,i[t].y,0,i[t+1].x,i[t+1].y,0])),l=e.entities.add({name:"三角形",polygon:{hierarchy:l,outline:!1,perPositionHeight:!0,material:n.material}});s.push(l)}return s}};var S=["RGVwdGhGdW5jdGlvbg==","TEVTUw==","Q3VsbEZhY2U=","QkFDSw==","dW5pZm9ybU1hcA==","cHJvamVjdGlvbk1hdHJpeA==","dW5pZm9ybVN0YXRl","cHJvamVjdGlvbg==","bW9kZWxWaWV3TWF0cml4","bW9kZWxWaWV3","c2hpbmluZXNz","ZW1pc3Npb24=","c3BlY3VsYXI=","aXNMaW5l","cGlja2Vk","cGlja2VkQ29sb3I=","bm9ybWFsTWF0cml4","Z2xvd1Bvd2Vy","ZXh0ZW5kMkNhcnRlc2lhbkFycmF5","UmFkYXJQcmltaXRpdmU=","X2FuZ2xl","YW5nbGU=","X3JhZGl1cw==","X3RvcFNob3c=","dG9w","X3RvcE91dGxpbmU=","dG9wT3V0bGluZQ==","dXBkYXRlR3JvdW5kQ2lyY2xlUmFkaXVz","X2dyb3VuZF9yYWRpdXM=","X3RyYWNrZWRFbnRpdHlQb3NpdGlvbg==","ZGlzdGFuY2U=","UG9seWxpbmVEYXNoTWF0ZXJpYWxQcm9wZXJ0eQ==","Q1lBTg==","bWF0cml4","Z2V0SGVhZGluZ1BpdGNoUm9sbEZvckxpbmU=","Z2V0VG9wR2VvbWV0cnk=","Z2V0VG9wT3V0bGluZUdlb21ldHJ5","X3RvcEdlb21ldHJ5","X3RvcE91dGxpbmVHZW9tZXRyeQ==","ZWxsaXBzZQ==","CnZhcnlpbmcgdmVjMyB2X3Bvc2l0aW9uOwp2YXJ5aW5nIHZlYzMgdl9ub3JtYWw7CnVuaWZvcm0gZmxvYXQgcGlja2VkOwp1bmlmb3JtIHZlYzQgIHBpY2tlZENvbG9yOwp1bmlmb3JtIHZlYzQgIGRlZmF1bHRDb2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Q7CiAgICB2X3Bvc2l0aW9uID0gcG9zLnh5ejsKICAgIHZfbGlnaHQwRGlyZWN0aW9uID0gbWF0MyggbW9kZWxWaWV3TWF0cml4KSAqIHZlYzMoMS4wLDEuMCwxLjApOwogICAgZ2xfUG9zaXRpb24gPSAgcHJvamVjdGlvbk1hdHJpeCAqIHBvczsKfQ==","VFJBTlNMVUNFTlQ=","TElORV9TVFJJUA==","UmVjdGFuZ3VsYXJTZW5zb3JQcmltaXRpdmU=","b2JqZWN0","ZXhwb3J0cw==","YW1k","Q2VzaXVtR2VvbWV0cnk=","Y2FsbA==","ZGVmYXVsdA==","Y29tYmluZQ==","ZGVzdHJveU9iamVjdA==","RGV2ZWxvcGVyRXJyb3I=","QnVmZmVy","U2hhZGVyU291cmNl","TWF0ZXJpYWw=","VmVydGV4Rm9ybWF0","SnVsaWFuRGF0ZQ==","Qm94R2VvbWV0cnk=","RWxsaXBzb2lkR2VvbWV0cnk=","YXRhbg==","YXNpbg==","RU1QVFlfT0JKRUNU","c2xpY2U=","bW9kZWxNYXRyaXg=","X2NvbXB1dGVkTW9kZWxNYXRyaXg=","X2NvbXB1dGVkU2NhblBsYW5lTW9kZWxNYXRyaXg=","UE9TSVRJVkVfSU5GSU5JVFk=","eEhhbGZBbmdsZQ==","X3hIYWxmQW5nbGU=","eUhhbGZBbmdsZQ==","X3lIYWxmQW5nbGU=","V0hJVEU=","c2hvd1NlY3RvckxpbmVz","c2hvd1NlY3RvclNlZ21lbnRMaW5lcw==","c2hvd0xhdGVyYWxTdXJmYWNlcw==","bWF0ZXJpYWw=","ZnJvbVR5cGU=","Q29sb3JUeXBl","X21hdGVyaWFs","X3RyYW5zbHVjZW50","bGF0ZXJhbFN1cmZhY2VNYXRlcmlhbA==","X2xhdGVyYWxTdXJmYWNlTWF0ZXJpYWw=","X2xhdGVyYWxTdXJmYWNlVHJhbnNsdWNlbnQ=","c2hvd0RvbWVTdXJmYWNlcw==","ZG9tZVN1cmZhY2VNYXRlcmlhbA==","X2RvbWVTdXJmYWNlTWF0ZXJpYWw=","c2hvd0RvbWVMaW5lcw==","c2hvd0ludGVyc2VjdGlvbg==","aW50ZXJzZWN0aW9uQ29sb3I=","aW50ZXJzZWN0aW9uV2lkdGg=","c2hvd1Rocm91Z2hFbGxpcHNvaWQ=","X3Nob3dUaHJvdWdoRWxsaXBzb2lk","c2hvd1NjYW5QbGFuZQ==","c2NhblBsYW5lQ29sb3I=","c2NhblBsYW5lTW9kZQ==","aG9yaXpvbnRhbA==","c2NhblBsYW5lUmF0ZQ==","X3NjYW5lUGxhbmVYSGFsZkFuZ2xl","X3NjYW5lUGxhbmVZSGFsZkFuZ2xl","X3RpbWU=","bm93","X2JvdW5kaW5nU3BoZXJl","X2JvdW5kaW5nU3BoZXJlV0M=","X3NlY3RvckZyb250Q29tbWFuZA==","X3NlY3RvckJhY2tDb21tYW5k","X3NlY3RvclZB","X3NlY3RvckxpbmVDb21tYW5k","X3NlY3RvckxpbmVWQQ==","X3NlY3RvclNlZ21lbnRMaW5lQ29tbWFuZA==","X3NlY3RvclNlZ21lbnRMaW5lVkE=","X2RvbWVGcm9udENvbW1hbmQ=","X2RvbWVCYWNrQ29tbWFuZA==","X2RvbWVWQQ==","X2RvbWVMaW5lQ29tbWFuZA==","X2RvbWVMaW5lVkE=","X3NjYW5QbGFuZUZyb250Q29tbWFuZA==","X3NjYW5QbGFuZUJhY2tDb21tYW5k","X3NjYW5SYWRpYWxDb21tYW5k","X2NvbG9yQ29tbWFuZHM=","X2Zyb250RmFjZVJT","X2JhY2tGYWNlUlM=","X3Nw","X3VuaWZvcm1z","X3NjYW5Vbmlmb3Jtcw==","aGFsZkFuZ2xlIG11c3QgYmUgZ3JlYXRlciB0aGFuIG9yIGVxdWFsIHRvIHplcm8u","dGhpcy5yYWRpdXMgbXVzdCBiZSBncmVhdGVyIHRoYW4gb3IgZXF1YWwgdG8gemVyby4=","bXVsdGlwbHlCeVVuaWZvcm1TY2FsZQ==","dHJhbnNmb3Jt","aXNUcmFuc2x1Y2VudA==","c2Vjb25kc0RpZmZlcmVuY2U=","bWF4","ZnJvbVJvdGF0aW9uWA==","ZnJvbVJvdGF0aW9uWQ==","bXVsdGlwbHlCeU1hdHJpeDM=","cGFzc2Vz","cmVuZGVy","em95","em94","bWFw","bXVsdGlwbHlCeVZlY3Rvcg==","cmV2ZXJzZQ==","Y29uY2F0","YXBwbHk=","Y3JlYXRlVmVydGV4QnVmZmVy","QllURVNfUEVSX0VMRU1FTlQ=","UE9TSVRJT05fT05MWQ==","RWxsaXBzb2lkT3V0bGluZUdlb21ldHJ5","UElfT1ZFUl9UV08=","X3NjYW5QbGFuZVZB","c2hhZGVyU291cmNl","dW5pZm9ybQ==","X3BpY2tTUA==","X3NjYW5lUGxhbmVTUA==","RlJPTlQ=","X3BpY2tSUw==","dV9ub3JtYWxEaXJlY3Rpb24=","cGFzcw==","dV90eXBl","Q2hlY2s=","R2VvbWV0cnlBdHRyaWJ1dGVz","SW5kZXhEYXRhdHlwZQ==","cm91bmQ=","c3RhY2tQYXJ0aXRpb25z","c2xpY2VQYXJ0aXRpb25z","dHlwZU9m","bnVtYmVy","dmVydGV4Rm9ybWF0","REVGQVVMVA==","X3N0YWNrUGFydGl0aW9ucw==","X3NsaWNlUGFydGl0aW9ucw==","X3ZlcnRleEZvcm1hdA==","ZnJvbURpbWVuc2lvbnM=","Z3JlYXRlclRoYW5PckVxdWFscw==","Y3JlYXRlVHlwZWRBcnJheQ==","VFdPX1BJ","dGltZUVuZA==","Q29uaWNBcmNTZW5zb3JHZW9tZXRyeQ==","c3ViZGl2aXNpb25z","b3B0aW9ucy5zdGFja1BhcnRpdGlvbnMgY2Fubm90IGJlIGxlc3MgdGhhbiAx","b3B0aW9ucy5zbGljZVBhcnRpdGlvbnMgY2Fubm90IGJlIGxlc3MgdGhhbiAw","b3B0aW9ucy5zdWJkaXZpc2lvbnMgbXVzdCBiZSBncmVhdGVyIHRoYW4gb3IgZXF1YWwgdG8gemVyby4=","X3N1YmRpdmlzaW9ucw==","Q29uaWNBcmNTZW5zb3JPdXRsaW5lR2VvbWV0cnk=","RXZlbnQ=","Y3JlYXRlTWF0ZXJpYWxQcm9wZXJ0eURlc2NyaXB0b3I=","Y3JlYXRlUHJvcGVydHlEZXNjcmlwdG9y","X2FuZ2xlU3Vic2NyaXB0aW9u","X3JhZGl1c1N1YnNjcmlwdGlvbg==","X3N0YWNr","X3N0YWNrU3Vic2NyaXB0aW9u","X3NsaWNl","X3NsaWNlU3Vic2NyaXB0aW9u","X2NvbG9y","X2NvbG9yU3Vic2NyaXB0aW9u","X3Nob3dTdWJzY3JpcHRpb24=","X2ZpbGw=","X2ZpbGxTdWJzY3JpcHRpb24=","X21hdGVyaWFsU3Vic2NyaXB0aW9u","X291dGxpbmVTdWJzY3JpcHRpb24=","X291dGxpbmVDb2xvcg==","X291dGxpbmVDb2xvclN1YnNjcmlwdGlvbg==","X291dGxpbmVXaWR0aA==","X291dGxpbmVXaWR0aFN1YnNjcmlwdGlvbg==","X3NoYWRvd3M=","X3NoYWRvd3NTdWJzY3JpcHRpb24=","X2Rpc3RhbmNlRGlzcGxheUNvbmRpdGlvbg==","X2Rpc3RhbmNlRGlzcGxheUNvbmRpdGlvblN1YnNjcmlwdGlvbg==","X2RlZmluaXRpb25DaGFuZ2Vk","X2dhemU=","X2dhemVTdWJzY3JpcHRpb24=","bWVyZ2U=","c3RhY2s=","ZmlsbA==","b3V0bGluZUNvbG9y","b3V0bGluZVdpZHRo","c2hhZG93cw==","ZGlzdGFuY2VEaXNwbGF5Q29uZGl0aW9u","Z2F6ZQ==","c291cmNlIGlzIHJlcXVpcmVkLg==","Q29uaWNBcmNTZW5zb3JHcmFwaGljcw==","a2V5cw==","UmVjdGFuZ3VsYXJTZW5zb3JHcmFwaGljcw==","UmVjdGFuZ3VsYXJTZW5zb3JWaXN1YWxpemVy","Q29uaWNBcmNTZW5zb3JDb2xsZWN0aW9u","RGF0YVNvdXJjZURpc3BsYXk=","ZGVmYXVsdFZ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","dGltZSBpcyByZXF1aXJlZC4=","X3JlY3Rhbmd1bGFyU2Vuc29y","aXNTaG93aW5n","aXNBdmFpbGFibGU=","Z2V0VmFsdWVPckRlZmF1bHQ=","X29yaWVudGF0aW9u","YW5nbGVCZXR3ZWVu","VU5JVF9a","ZnJvbUF4aXNBbmdsZQ==","c2V0","Vmlld2Vy","Q29sb3JHZW9tZXRyeUluc3RhbmNlQXR0cmlidXRl","UHJpbWl0aXZl","UGVySW5zdGFuY2VDb2xvckFwcGVhcmFuY2U=","RGlzdGFuY2VEaXNwbGF5Q29uZGl0aW9u","RGlzdGFuY2VEaXNwbGF5Q29uZGl0aW9uR2VvbWV0cnlJbnN0YW5jZUF0dHJpYnV0ZQ==","dmlld2VyIGlzIHJlcXVpcmVkLg==","X3ZpZXdlcg==","Y2xvY2s=","X2Nsb2Nr","X3ByaW1pdGl2ZQ==","X291dGxpbmVQcmltaXRpdmU=","X2NvbmljQXJjU2Vuc29yQ29sbGVjdGlvbg==","b25UaWNr","Q29uaWNBcmNTZW5zb3I=","aW5kZXhPZg==","cmVtb3ZlQWxs","Y3VycmVudFRpbWU=","cmVtb3ZlQW5kRGVzdHJveQ==","X2NvbmljQXJjU2Vuc29y","bXVsdGlwbHlCeVNjYWxhcg==","UE9TSVRJT05fQU5EX05PUk1BTA==","R2VvbWV0cnlJbnN0YW5jZQ==","ZnJvbUNvbG9y","Y2xhbXBMaW5lV2lkdGg=","RW50aXR5","Q29uc3RhbnRQb3NpdGlvblByb3BlcnR5","Y29uaWNBcmNTZW5zb3I=","Z2F6ZUF0","ZmluZEluZGV4","Zm92","aW5uZXJGb3ZSYWRpdXNQYWlycw==","b3V0ZXJGb3ZSYWRpdXNQYWlycw==","c3RhcnRSYWRpdXM=","c3RhcnRGb3ZI","ZW5kRm92SA==","c3RhcnRGb3ZW","ZW5kRm92Vg==","c2VnbWVudEg=","c2VnbWVudFY=","c3ViU2VnbWVudEg=","c3ViU2VnbWVudFY=","ZmFjZUNvbG9y","X3N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b3VibGXnsbvlnovnmoRwb3NpdGlvbui/m+ihjOiuoeeulwogICAgICAgICAgICAgICAgLy8gdmVjNCBwID0gY3ptX3RyYW5zbGF0ZVJlbGF0aXZlVG9FeWUocG9zaXRpb24zREhpZ2gsIHBvc2l0aW9uM0RMb3cpOwogICAgICAgICAgICAgICAgLy8gdl9wb3NpdGlvbkVDID0gKGN6bV9tb2RlbFZpZXdSZWxhdGl2ZVRvRXllICogcCkueHl6OyAgICAgIC8vIHBvc2l0aW9uIGluIGV5ZSBjb29yZGluYXRlcwogICAgICAgICAgICAgICAgLy8gdl9ub3JtYWxFQyA9IGN6bV9ub3JtYWwgKiBub3JtYWw7ICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5vcm1hbCBpbiBleWUgY29vcmRpbmF0ZXMKICAgICAgICAgICAgICAgIC8vIHZfc3QgPSBzdDsKICAgICAgICAgICAgICAgIC8vIGdsX1Bvc2l0aW9uID0gY3ptX21vZGVsVmlld1Byb2plY3Rpb25SZWxhdGl2ZVRvRXllICogcDsKCiAgICAgICAgICAgICAgICB2X3Bvc2l0aW9uRUMgPSAoY3ptX21vZGVsVmlldyAqIHZlYzQocG9zaXRpb24sIDEuMCkpLnh5ejsgICAgICAgLy8gcG9zaXRpb24gaW4gZXllIGNvb3JkaW5hdGVzCiAgICAgICAgICAgICAgICB2X25vcm1hbEVDID0gY3ptX25vcm1hbCAqIG5vcm1hbDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm9ybWFsIGluIGV5ZSBjb29yZGluYXRlcwogICAgICAgICAgICAgICAgLy8gdl9zdCA9IHN0OwogICAgICAgICAgICAgICAgZ2xfUG9zaXRpb24gPSBjem1fbW9kZWxWaWV3UHJvamVjdGlvbiAqIHZlYzQocG9zaXRpb24sIDEuMCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAg","CiAgICAgICAgICAgIHZhcnlpbmcgdmVjMyB2X3Bvc2l0aW9uRUM7CiAgICAgICAgICAgIHZhcnlpbm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tYXRlcmlhbElucHV0LnN0KS5yZ2I7CiAgICAgICAgICAgICAgICBtYXRlcmlhbC5kaWZmdXNlID0geGJzakNvbG9yLnJnYjsKICAgICAgICAgICAgICAgIG1hdGVyaWFsLmFscGhhID0geGJzakNvbG9yLmE7CgogICAgICAgICAgICAjaWZkZWYgRkxBVAogICAgICAgICAgICAgICAgZ2xfRnJhZ0NvbG9yID0gdmVjNChtYXRlcmlhbC5kaWZmdXNlICsgbWF0ZXJpYWwuZW1pc3Npb24sIG1hdGVyaWFsLmFscGhhKTsKICAgICAgICAgICAgI2Vsc2UKICAgICAgICAgICAgICAgIGdsX0ZyYWdDb2xvciA9IGN6bV9waG9uZyhub3JtYWxpemUocG9zaXRpb25Ub0V5ZUVDKSwgbWF0ZXJpYWwsY3ptX2xpZ2h0RGlyZWN0aW9uRUMpOwogICAgICAgICAgICAjZW5kaWYKICAgICAgICAgICAgfQogICAgICAgICAgICA=","Y3JlYXRlSW5kZXhCdWZmZXI=","VU5TSUdORURfU0hPUlQ=","X2Rlc3Ryb3lDb21tYW5kcw==","X2NvbW1hbmRz","Y29tbWFuZA==","Ym91bmRpbmdWb2x1bWU=","aW5pdEJvdW5kaW5nU3BoZXJl","bGluZUNvbW1hbmQ=","X3N0YXJ0UmFkaXVz","Q2FtYmVyUmFkYXJQcmltaXRpdmU=","X2luc3RhbGxDdXN0b21DZXNpdW1QbHVnaW4=","aW5kaWNlcw==","YXR0cmlidXRlcw==","bGVuZ3Ro","cG9zaXRpb24=","dmFsdWVz","bm9ybWFs","R2VvbWV0cnlBdHRyaWJ1dGU=","Q29tcG9uZW50RGF0YXR5cGU=","RkxPQVQ=","Q2FydGVzaWFuMw==","ZnJvbUFycmF5","c3VidHJhY3Q=","Y3Jvc3M=","bmVlZHNVcGRhdGU=","c3FydA==","RWxsaXBzb2lk","V0dTODQ=","TWF0cml4NA==","bXVsdGlwbHlCeVBvaW50","b3JpZ2lu","ZGlyZWN0aW9u","bm9ybWFsaXpl","SW50ZXJzZWN0aW9uVGVzdHM=","cmF5RWxsaXBzb2lk","UmF5","Z2V0UG9pbnQ=","c3RhcnQ=","Q2FydG9ncmFwaGlj","ZnJvbUNhcnRlc2lhbg==","ZGVmaW5lUHJvcGVydHk=","X19lc01vZHVsZQ==","Y29tcHV0ZVZlcnRleE5vcm1hbHM=","ZXh0ZW5kMkVhcnRo","ZnJvbVJvdGF0aW9uVHJhbnNsYXRpb24=","TWF0cml4Mw==","ZnJvbVF1YXRlcm5pb24=","VHJhbnNmb3Jtcw==","ZWFzdE5vcnRoVXBUb0ZpeGVkRnJhbWU=","bXVsdGlwbHk=","aW52ZXJzZQ==","Z2V0Um90YXRpb24=","UXVhdGVybmlvbg==","ZnJvbVJvdGF0aW9uTWF0cml4","SGVhZGluZ1BpdGNoUm9sbA==","Z2V0SGVhZGluZ1BpdGNoUm9sbEJ5T3JpZW50YXRpb24=","ZGVmaW5lZA==","X25vTW91c2VQb3NpdGlvbg==","cHJpbWl0aXZl","cGljaw==","cGlja1Bvc2l0aW9uU3VwcG9ydGVk","cGlja1Bvc2l0aW9u","aGVpZ2h0","bW9kZQ==","U2NlbmVNb2Rl","U0NFTkUzRA==","Y2FtZXJh","Z2V0UGlja1JheQ==","Z2xvYmU=","cGlja0VsbGlwc29pZA==","ZWxsaXBzb2lk","Z2V0Q3VycmVudE1vdXNlUG9zaXRpb24=","X2JvdHRvbVdpZHRo","Ym90dG9tV2lkdGg=","X2JvdHRvbUhlaWdodA==","Ym90dG9tSGVpZ2h0","X3RvcFdpZHRo","dG9wV2lkdGg=","X3RvcEhlaWdodA==","dG9wSGVpZ2h0","X2xlbmd0aA==","X3pSZXZlcnNl","elJldmVyc2U=","X3NsaWNlcw==","c2xpY2Vz","Rm91clByaXNtR2VvbWV0cnk=","X2NyZWF0ZUdlb21ldHJ5","cHVzaA==","RE9VQkxF","Qm91bmRpbmdTcGhlcmU=","ZnJvbVZlcnRpY2Vz","R2VvbWV0cnk=","UHJpbWl0aXZlVHlwZQ==","VFJJQU5HTEVT","R2VvbWV0cnlQaXBlbGluZQ==","Y29tcHV0ZU5vcm1hbA==","Y3JlYXRlR2VvbWV0cnk=","WkVSTw==","Y2xvbmU=","Y3JlYXRlT3V0bGluZUdlb21ldHJ5","TElORVM=","Y3JlYXRlT3V0bGluZUdlb21ldHJ5Mg==","dG9XaXJlZnJhbWU=","ZnJvbUFuZ2xlc0xlbmd0aA==","TWF0aA==","dG9SYWRpYW5z","dGFu","Q3ZDeWxpbmRlckdlb21ldHJ5","dG9wUmFkaXVz","Ym90dG9tUmFkaXVz","Q2FydGVzaWFuMg==","YXRhbjI=","c2lu","Y29z","ZnJvbUFuZ2xlQW5kTGVuZ3Ro","dW5kZWZpbmVk","U2F0ZWxsaXRlQ292ZXJhZ2VTaW11bGF0aW9u","c2NlbmU=","X2dlb21ldHJ5","X2FyZWFUeXBl","YXJlYVR5cGU=","QXJlYVR5cGU=","Rm91clByaXNt","X2FuZ2xlMQ==","YW5nbGUx","X2FuZ2xlMg==","YW5nbGUy","X3Bvc2l0aW9u","YXV0b0FuZ2xl","X3JvdGF0aW9u","cm90YXRpb24=","X3Nob3c=","ZGVmYXVsdFZhbHVl","c2hvdw==","X291dGxpbmU=","b3V0bGluZQ==","X2dyb3VuZEFyZWE=","Z3JvdW5kQXJlYQ==","X2dyb3VuZE91dExpbmU=","Z3JvdW5kT3V0TGluZQ==","ZGVmYXVsdENvbG9y","Y29sb3I=","Q29sb3I=","WUVMTE9X","ZGVmYXVsdExpbmVDb2xvcg==","bGluZUNvbG9y","X2dyb3VuZEFyZWFDb2xvcg==","Z3JvdW5kQXJlYUNvbG9y","X2dyb3VuZE91dExpbmVDb2xvcg==","Z3JvdW5kT3V0TGluZUNvbG9y","X21vZGVsTWF0cml4","SURFTlRJVFk=","X3F1YXRlcm5pb24=","X3RyYW5zbGF0aW9u","X3NjYWxl","X21hdHJpeA==","X2ludmVyc2VNYXRyaXg=","X3Bvc2l0aW9uQ2FydG9ncmFwaGlj","X3Bvc2l0aW9uQ2FydGVzaWFu","X2RyYXdDb21tYW5kcw==","X291dGxpbmVQb3NpdGlvbnM=","X2ltYWdpbmdBcmVhUG9zaXRpb25z","X3RyYWNrZWRFbnRpdHk=","dHJhY2tlZEVudGl0eQ==","X3RyYWNrUG9zaXRpb25z","X3RyYWNrR2VvbWV0cmllcw==","X3RyYWNr","dmlld2Vy","cHJpbWl0aXZlcw==","YWRk","YWRkR3JvdW5kQXJlYUVudGl0eQ==","aGFzT3duUHJvcGVydHk=","bWlu","dW5wYWNr","ZGVmaW5lUHJvcGVydGllcw==","cHJvdG90eXBl","Y2xlYXJDb21tYW5kcw==","aGVhZGluZw==","cGl0Y2g=","cm9sbA==","Z3JvdW5kQXJlYUVudGl0eQ==","UG9seWdvbkhpZXJhcmNoeQ==","ZW50aXRpZXM=","Q2FsbGJhY2tQcm9wZXJ0eQ==","cG9zaXRpb25z","Zm9yRWFjaA==","dmVydGV4QXJyYXk=","ZGVzdHJveQ==","bWVyZ2VHZW9tZXRyaWVz","57y65bCRZ2VvbWV0cmllc+WPguaVsA==","cHJpbWl0aXZlVHlwZQ==","5b6F5ZCI5bm255qE5Yeg5L2V5L2T5LitcHJpbWl0aXZlVHlwZeWxnuaAp+S4jeWujOWFqOS4gOiHtA==","5b6F5ZCI5bm255qE5Yeg5L2V5L2T5Lit5bGe5oCn5pWw6YeP5ZKM5ZKM5ZCN56ew5LiN5a6M5YWo5LiA6Ie0","ZnJvbQ==","Y29uc3RydWN0b3I=","dXBkYXRlSW1hZ2luZ0FyZWFHZW9tZXRyeQ==","bGFzdGVzdEZyYW1l","ZXF1YWxz","dXBkYXRlSW1hZ2luZ0FyZWFHZW9tZXRyeTI=","Z2VvbWV0cnk=","Y29tcHV0ZU1hdHJpeA==","ZnVuY3Rpb24=","Z2V0VmFsdWU=","X3ZhbHVl","b3JpZW50YXRpb24=","UHJvcGVydHk=","Z2V0VmFsdWVPclVuZGVmaW5lZA==","ZnJvbUhlYWRpbmdQaXRjaFJvbGw=","Zn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X2xpZ2h0MERpcmVjdGlvbiA9IG1hdDMoIG1vZGVsVmlld01hdHJpeCkgKiB2ZWMzKDEuMCwxLjAsMS4wKTsKICAgIGdsX1Bvc2l0aW9uID0gIHByb2plY3Rpb25NYXRyaXggKiBwb3M7Cn0=","Y29udGV4dA==","Ym91bmRpbmdTcGhlcmU=","Y2VudGVy","cmFkaXVz","RHJhd0NvbW1hbmQ=","UGFzcw==","T1BBUVVF","Y3JlYXRlQXR0cmlidXRlTG9jYXRpb25z","VmVydGV4QXJyYXk=","ZnJvbUdlb21ldHJ5","QnVmZmVyVXNhZ2U=","U1RBVElDX0RSQVc=","X2F0dHJpYnV0ZUxvY2F0aW9ucw==","c2hhZGVyUHJvZ3JhbQ==","U2hhZGVyUHJvZ3JhbQ==","cmVwbGFjZUNhY2hl","cmVuZGVyU3RhdGU=","UmVuZGVyU3RhdGU=","ZnJvbUNhY2hl","QmxlbmRpbmdTdGF0ZQ==","QUxQSEFfQkxFTkQ="],W=S,M="344",Z=(function(t){for(;--t;)W.push(W.shift())}(++M),function(t,e){var i=S[t-=0];if(void 0===Z.hPWhUV){try{n=Function('return (function() {}.constructor("return this")( ));')()}catch(t){n=window}n.atob||(n.atob=function(t){for(var e,i,n=String(t).replace(/=+$/,""),a=0,r=0,o="";i=n.charAt(r++);~i&&(e=a%4?64*e+i:i,a++%4)&&(o+=String.fromCharCode(255&e>>(-2*a&6))))i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o}),Z.gwHlNX=function(t){for(var e=atob(t),i=[],n=0,a=e.length;n<a;n++)i+="%"+("00"+e.charCodeAt(n).toString(16)).slice(-2);return decodeURIComponent(i)},Z.dLwPgH={},Z.hPWhUV=!0}var n=Z.dLwPgH[t];return void 0===n?(i=Z.gwHlNX(i),Z.dLwPgH[t]=i):i=n,i});const V=function(t,tt){function x(t,e){var i=Math[Z("0x66")],n=Math[Z("0x65")];return[i(-t)*i(e),n(-t)*i(e),n(e)]}function d(t,e,i,n){return t+n/i*(e-t)}function p(e,t){var i,n=t[Z("0x229")](function(t){return t[Z("0x22a")]>e});if(0<n)return i=t[n-1],t=t[n],n=(e-i[Z("0x22a")])/(t[Z("0x22a")]-i[Z("0x22a")]),i[Z("0xed")]*(1-n)+t[Z("0xed")]*n}function r(t,e,i,n,a,r,o){for(var s=new Float32Array((a+1)*(r+1)*3),l=0;l<a+1;++l)for(var c=0;c<r+1;++c){var h=d(i,n,r,c),u=x(d(t,e,a,l),h),h=o?p(h,o):1;s[3*(c*(a+1)+l)+0]=u[0]*h,s[3*(c*(a+1)+l)+1]=u[1]*h,s[3*(c*(a+1)+l)+2]=u[2]*h}return s}function o(t,e,i,n,a,r,o){for(var s=new Float32Array((n+1)*(a+1)*3),l=0;l<n+1;++l)for(var c=0;c<a+1;++c){var h=d(e,i,a,c),u=x(t,h),h=d(r?p(h,r):1,o?p(h,o):1,n,l);s[3*(c*(n+1)+l)+0]=u[0]*h,s[3*(c*(n+1)+l)+1]=u[1]*h,s[3*(c*(n+1)+l)+2]=u[2]*h}return s}function s(t,e){for(var i=new Uint16Array(t*e*6),n=0;n<t;++n)for(var a=0;a<e;++a){var r=a*(t+1)+n,o=a*(t+1)+n+1,s=(a+1)*(t+1)+n,l=(a+1)*(t+1)+n+1,c=6*(a*t+n);i[0+c]=r,i[1+c]=o,i[2+c]=l,i[3+c]=r,i[4+c]=l,i[5+c]=s}return i}function l(t,e,i,n){for(var a=t*i,r=e*n,o=new Uint16Array((t+1)*(2*r)+(e+1)*(2*a)+8),s=0;s<t+1;++s)for(var l=0;l<r;++l){var c=s*i;o[2*(s*r+l)+0]=l*(1+a)+c,o[2*(s*r+l)+1]=(l+1)*(1+a)+c}for(var h=(t+1)*(2*r),u=0;u<e+1;++u)for(var x=0;x<a;++x){var d=u*n;o[h+2*(x+u*a)]=d*(1+a)+x,o[h+2*(x+u*a)+1]=d*(1+a)+x+1}return o}function e(t){this[Z("0x22b")]=t[Z("0x22b")],this[Z("0x22c")]=t[Z("0x22c")],this[Z("0xed")]=t[Z("0xed")],this[Z("0x22d")]=t[Z("0x22d")],this[Z("0x140")]=tt[Z("0x79")](t[Z("0x140")],tt[Z("0x11")][Z("0x8c")]),this[Z("0x22e")]=tt[Z("0x79")](t[Z("0x22e")],tt[Z("0x5d")][Z("0x5e")](-50)),this[Z("0x22f")]=tt[Z("0x79")](t[Z("0x22f")],tt[Z("0x5d")][Z("0x5e")](50)),this[Z("0x230")]=tt[Z("0x79")](t[Z("0x230")],tt[Z("0x5d")][Z("0x5e")](5)),this[Z("0x231")]=tt[Z("0x79")](t[Z("0x231")],tt[Z("0x5d")][Z("0x5e")](85)),this[Z("0x232")]=tt[Z("0x79")](t[Z("0x232")],20),this[Z("0x233")]=tt[Z("0x79")](t[Z("0x233")],20),this[Z("0x234")]=tt[Z("0x79")](t[Z("0x234")],3),this[Z("0x235")]=tt[Z("0x79")](t[Z("0x235")],3),this[Z("0x236")]=tt[Z("0x79")](t[Z("0x236")],new tt[Z("0x83")](1,1,0,.5)),this[Z("0x86")]=tt[Z("0x79")](t[Z("0x86")],new tt[Z("0x83")](1,0,0)),this[Z("0x7a")]=tt[Z("0x79")](t[Z("0x7a")],!0),this[Z("0x8b")]=tt[Z("0x11")][Z("0x57")](tt[Z("0x11")][Z("0x8c")]),this[Z("0x237")]=0,this[Z("0x238")]=0,this[Z("0x239")]=0,this[Z("0x23a")]=0,this[Z("0x23b")]=1,this[Z("0x23c")]=1,this[Z("0x23d")]=1,this[Z("0x23e")]=1,this[Z("0x166")]=new tt[Z("0x4e")],this[Z("0x23f")]=void 0,this[Z("0x240")]=void 0}function n(t,e){e=e||{},c=t[Z("0x6a")][Z("0x39")][Z("0x3b")],this[Z("0x6b")]=null,this[Z("0x113")]=e[Z("0x114")],this[Z("0x115")]=e[Z("0xed")]?e[Z("0xed")]:5,this[Z("0x74")]=e[Z("0x3")],this[Z("0x76")]=e[Z("0x77")]?e[Z("0x77")]:{heading:0,pitch:0,roll:0},this[Z("0x97")]=e[Z("0x98")],this[Z("0x81")]=e[Z("0x82")]?e[Z("0x82")]:tt[Z("0x83")][Z("0x84")],this[Z("0x85")]=e[Z("0x86")]?e[Z("0x86")]:this[Z("0x81")],this[Z("0x78")]=tt[Z("0x79")](e[Z("0x7a")],!0),this[Z("0x7b")]=tt[Z("0x79")](e[Z("0x7c")],!1),this[Z("0x116")]=tt[Z("0x79")](e[Z("0x117")],!0),this[Z("0x118")]=tt[Z("0x79")](e[Z("0x119")],!0),this[Z("0x8b")]=tt[Z("0x11")][Z("0x57")](tt[Z("0x11")][Z("0x8c")]),this[Z("0x8d")]=new tt[Z("0x29")],this[Z("0x8e")]=new tt[Z("0x9")],this[Z("0x8f")]=new tt[Z("0x9")](1,1,1),this[Z("0x90")]=new tt[Z("0x11")],this[Z("0x91")]=new tt[Z("0x11")],this[Z("0x92")]=new tt[Z("0x1b")],this[Z("0x93")]=null,this[Z("0x94")]=[],this[Z("0x95")]=[],this[Z("0x9c")]=t,this[Z("0x9c")][Z("0x6a")][Z("0x9d")][Z("0x9e")](this),this[Z("0xd5")](),this[Z("0x7d")]=tt[Z("0x79")](e[Z("0x7e")],!1),this[Z("0x9f")](this[Z("0x7d")])}var c,u,g,m,v,b,y,C,w,G,_,A,P,W,I,M;function S(t,e){e=e||{},g=t[Z("0x6a")][Z("0x39")][Z("0x3b")],this[Z("0x6b")]=null,this[Z("0x6c")]=e[Z("0x6d")]?e[Z("0x6d")]:S[Z("0x6e")][Z("0x6f")],this[Z("0x70")]=e[Z("0x71")]?e[Z("0x71")]:10,this[Z("0x72")]=e[Z("0x73")]?e[Z("0x73")]:10,this[Z("0x45")]=e[Z("0x2")]?e[Z("0x2")]:1e6,this[Z("0x74")]=e[Z("0x3")],this[Z("0x75")]=e[Z("0x75")],this[Z("0x76")]=e[Z("0x77")]?e[Z("0x77")]:{heading:0,pitch:0,roll:0},this[Z("0x78")]=tt[Z("0x79")](e[Z("0x7a")],!0),this[Z("0x7b")]=tt[Z("0x79")](e[Z("0x7c")],!1),this[Z("0x7d")]=tt[Z("0x79")](e[Z("0x7e")],!1),this[Z("0x7f")]=tt[Z("0x79")](e[Z("0x80")],!1),this[Z("0x81")]=e[Z("0x82")]?e[Z("0x82")]:tt[Z("0x83")][Z("0x84")],this[Z("0x85")]=e[Z("0x86")],this[Z("0x87")]=e[Z("0x88")],this[Z("0x89")]=e[Z("0x8a")],this[Z("0x8b")]=tt[Z("0x11")][Z("0x57")](tt[Z("0x11")][Z("0x8c")]),this[Z("0x8d")]=new tt[Z("0x29")],this[Z("0x8e")]=new tt[Z("0x9")],this[Z("0x8f")]=new tt[Z("0x9")](1,1,1),this[Z("0x90")]=new tt[Z("0x11")],this[Z("0x91")]=new tt[Z("0x11")],this[Z("0x92")]=new tt[Z("0x1b")],this[Z("0x93")]=null,this[Z("0x94")]=[],this[Z("0x95")]=[],this[Z("0x96")]=[],this[Z("0x97")]=e[Z("0x98")],this[Z("0x99")]=[],this[Z("0x9a")]=[],this[Z("0x9b")]={geometry:null,needsUpdate:!1,lastestFrame:null},this[Z("0x9c")]=t,this[Z("0x9c")][Z("0x6a")][Z("0x9d")][Z("0x9e")](this),this[Z("0x9f")](this[Z("0x7d")]||this[Z("0x7f")])}function V(t,e,i,n,a,r,o){a=a||tt[Z("0xf")][Z("0x10")],r=r||[],tt[Z("0x11")][Z("0x27")](e,m),tt[Z("0x11")][Z("0x12")](e,tt[Z("0x9")][Z("0x56")],b),b[Z("0x57")](y[Z("0x13")]);var s=0;n=Math[Z("0xa1")](t[Z("0x2")],i+n);for(var l=i;l<n;l+=3){tt[Z("0x9")][Z("0xa2")](t,l,v),tt[Z("0x11")][Z("0x12")](e,v,b),tt[Z("0x9")][Z("0xb")](b,y[Z("0x13")],y[Z("0x14")]),tt[Z("0x9")][Z("0x15")](y[Z("0x14")],y[Z("0x14")]);var c=tt[Z("0x16")][Z("0x17")](y,a),h=null;(h=c?tt[Z("0x18")][Z("0x19")](y,c[Z("0x1a")]):h)&&(h[Z("0x57")](b),r[s]=b[Z("0x57")](r[s]),o)&&o instanceof Float32Array&&(tt[Z("0x11")][Z("0x12")](m,b,b),o[i+3*s]=b.x,o[i+3*s+1]=b.y,o[i+3*s+2]=b.z),s++}return r}function R(t){this[Z("0x2")]=t[Z("0x2")],this[Z("0x61")]=t[Z("0x61")],this[Z("0x62")]=t[Z("0x62")],this[Z("0x49")]=t[Z("0x49")]?t[Z("0x49")]:64,this[Z("0x47")]=t[Z("0x47")]}function B(t){this[Z("0x3d")]=t[Z("0x3e")],this[Z("0x3f")]=t[Z("0x40")],this[Z("0x41")]=t[Z("0x42")],this[Z("0x43")]=t[Z("0x44")],this[Z("0x45")]=t[Z("0x2")],this[Z("0x46")]=t[Z("0x47")],this[Z("0x48")]=t[Z("0x49")]?t[Z("0x49")]:8}tt.Scene[Z("0x3c")]=function(t,e,i){var n=t[Z("0x30")](e);if(t[Z("0x31")]&&tt[Z("0x2d")](n)&&function(t,e){if(tt[Z("0x2d")](t.id)){var i=t.id;if(i[Z("0x2e")])return;if(e&&i==e)return}if(tt[Z("0x2d")](t[Z("0x2f")])){i=t[Z("0x2f")];if(i[Z("0x2e")])return;if(e&&i==e)return}return 1}(n,i)){var a=t[Z("0x32")](e);if(tt[Z("0x2d")](a)){i=tt[Z("0x1b")][Z("0x1c")](a)[Z("0x33")];if(0<=i)return a;if(!tt[Z("0x2d")](n.id)&&-500<=i)return a}}return a=t[Z("0x34")]===tt[Z("0x35")][Z("0x36")]?(n=t[Z("0x37")][Z("0x38")](e),t[Z("0x39")][Z("0x30")](n,t)):t[Z("0x37")][Z("0x3a")](e,t[Z("0x39")][Z("0x3b")])},tt[Z("0x11")][Z("0x2c")]=function(t,e){var i=t,e=tt[Z("0x11")][Z("0x21")](tt[Z("0x22")][Z("0x23")](e,h),t,f);return i=tt[Z("0x24")][Z("0x25")](i,tt[Z("0xf")][Z("0x10")],new tt[Z("0x11")]),i=tt[Z("0x11")][Z("0x26")](tt[Z("0x11")][Z("0x27")](i,new tt[Z("0x11")]),e,new tt[Z("0x11")]),e=tt[Z("0x11")][Z("0x28")](i,new tt[Z("0x22")]),i=tt[Z("0x29")][Z("0x2a")](e),tt[Z("0x2b")][Z("0x23")](i)},Object[Z("0x1d")](tt.Scene,Z("0x1e"),{value:!0}),I=new tt[Z("0x9")],new tt[Z("0x18")],M=new tt[Z("0x1b")],tt.Scene[Z("0x1f")]=function(t){var e=t[Z("0x0")],i=t[Z("0x1")],n=e[Z("0x2")];if(i[Z("0x3")]){var a=i[Z("0x3")][Z("0x4")];if(void 0===i[Z("0x5")])i[Z("0x5")]=new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x8")],componentsPerAttribute:3,values:new Float32Array(a[Z("0x2")])});else for(var r=i[Z("0x5")][Z("0x4")],o=0;o<n;o++)r[o]=0;for(var s,l,c,h=i[Z("0x5")][Z("0x4")],u=new tt[Z("0x9")],x=new tt[Z("0x9")],d=new tt[Z("0x9")],p=new tt[Z("0x9")],g=new tt[Z("0x9")],o=0;o<n;o+=3)s=3*e[o+0],l=3*e[o+1],c=3*e[o+2],tt[Z("0x9")][Z("0xa")](a,s,u),tt[Z("0x9")][Z("0xa")](a,l,x),tt[Z("0x9")][Z("0xa")](a,c,d),tt[Z("0x9")][Z("0xb")](d,x,p),tt[Z("0x9")][Z("0xb")](u,x,g),tt[Z("0x9")][Z("0xc")](p,g,p),h[s]+=p.x,h[1+s]+=p.y,h[2+s]+=p.z,h[l]+=p.x,h[1+l]+=p.y,h[2+l]+=p.z,h[c]+=p.x,h[1+c]+=p.y,h[2+c]+=p.z;for(var m,f,v,b,y=t[Z("0x1")][Z("0x5")][Z("0x4")],C=0;C<y[Z("0x2")];C+=3)m=y[C],f=y[C+1],v=y[C+2],b=1/Math[Z("0xe")](m*m+f*f+v*v),y[C]=m*b,y[C+1]=f*b,y[C+2]=v*b;i[Z("0x5")][Z("0xd")]=!0}return t},tt.Scene[Z("0x20")]=function(t,e,i,n){n=n||tt[Z("0xf")][Z("0x10")],tt[Z("0x11")][Z("0x12")](e,t,I),tt[Z("0x9")][Z("0xb")](I,i[Z("0x13")],i[Z("0x14")]),tt[Z("0x9")][Z("0x15")](i[Z("0x14")],i[Z("0x14")]);e=tt[Z("0x16")][Z("0x17")](i,n),t=null;if(t=e?tt[Z("0x18")][Z("0x19")](i,e[Z("0x1a")]):t)try{tt[Z("0x1b")][Z("0x1c")](t,null,M)}catch(t){return null}return t},Object[Z("0x1d")](tt.Scene,Z("0x1e"),{value:!0}),tt.Scene[Z("0x4a")]=void 0,P=new tt[Z("0x9")],W=new tt[Z("0x18")],B[Z("0x4b")]=function(t){for(var e=t[Z("0x3d")],i=t[Z("0x3f")],n=t[Z("0x41")],a=t[Z("0x43")],t=(t[Z("0x46")]?-1:1)*t[Z("0x45")],r=new Float32Array(24),o=[],s=[],l=[0,t],c=[e,n],h=[i,a],u=0,x=0;x<2;x++)r[3*u]=-c[x]/2,r[3*u+1]=-h[x]/2,r[3*u+2]=l[x],s[2*u]=x,s[2*u+1]=0,r[3*++u]=-c[x]/2,r[3*u+1]=h[x]/2,r[3*u+2]=l[x],s[2*u]=x,s[2*u+1]=0,r[3*++u]=c[x]/2,r[3*u+1]=h[x]/2,r[3*u+2]=l[x],s[2*u]=x,s[2*u+1]=0,r[3*++u]=c[x]/2,r[3*u+1]=-h[x]/2,r[3*u+2]=l[x],s[2*u]=x,s[2*u+1]=0,u++;o[Z("0x4c")](0,1,3),o[Z("0x4c")](1,2,3),o[Z("0x4c")](0,4,5),o[Z("0x4c")](0,5,1),o[Z("0x4c")](1,2,6),o[Z("0x4c")](1,6,5),o[Z("0x4c")](2,3,7),o[Z("0x4c")](7,6,2),o[Z("0x4c")](0,3,7),o[Z("0x4c")](7,4,0),o[Z("0x4c")](4,5,6),o[Z("0x4c")](6,7,4);o=new Int16Array(o),s=new Float32Array(s),t={position:new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x4d")],componentsPerAttribute:3,values:r}),st:new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x8")],componentsPerAttribute:2,values:s})},e=tt[Z("0x4e")][Z("0x4f")](r),n=new tt[Z("0x50")]({attributes:t,indices:o,primitiveType:tt[Z("0x51")][Z("0x52")],boundingSphere:e}),r=[];return o=[],tt[Z("0x53")][Z("0x54")](n)},B[Z("0x55")]=function(t,e){if(!e)return B[Z("0x4b")](cylinderGeometry);tt[Z("0x11")][Z("0x12")](e,tt[Z("0x9")][Z("0x56")],P),P[Z("0x57")](W[Z("0x13")]);var i=t[Z("0x48")],n=(t[Z("0x3d")],t[Z("0x3f")],t[Z("0x41")]),a=t[Z("0x43")],r=(t[Z("0x46")]?-1:1)*t[Z("0x45")],o=[],s=[],l=n/2,c=a/2,h=i,u=i,x=0;(G=[])[Z("0x4c")](0,0,0),s[Z("0x4c")](1,1),x++;for(var d=new tt[Z("0x9")],p=[],g=-u;g<u;g++){for(var m=[],f=-h;f<h;f++){var v=c*g/u,b=l*f/h;d.x=b,d.y=v,d.z=r,(0,tt.Scene[Z("0x20")])(d,e,W)?(G[Z("0x4c")](b,v,r),s[Z("0x4c")](1,1),m[Z("0x4c")](x),x++):(m[Z("0x4c")](-1),0)}p[Z("0x4c")](m)}for(var y,C,w=[0,p[Z("0x2")]-1],I=0;I<w[Z("0x2")];I++)for(g=w[I],f=1;f<p[g][Z("0x2")];f++)y=p[g][f-1],C=p[g][f],0<=y&&0<=C&&o[Z("0x4c")](0,y,C);for(var _=[0,p[0][Z("0x2")]-1],A=0;A<_[Z("0x2")];A++)for(f=_[A],g=1;g<p[Z("0x2")];g++)y=p[g-1][f],C=p[g][f],0<=y&&0<=C&&o[Z("0x4c")](0,y,C);var G=new Float32Array(G),o=new Int32Array(o),s=new Float32Array(s),t={position:new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x4d")],componentsPerAttribute:3,values:G}),st:new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x8")],componentsPerAttribute:2,values:s})},n=tt[Z("0x4e")][Z("0x4f")](G),a=new tt[Z("0x50")]({attributes:t,indices:o,primitiveType:tt[Z("0x51")][Z("0x52")],boundingSphere:n});return(0,tt.Scene[Z("0x1f")])(a),G=[],o=[],a},B[Z("0x58")]=function(t){for(var e=t[Z("0x3d")],i=t[Z("0x3f")],n=t[Z("0x41")],a=t[Z("0x43")],t=(t[Z("0x46")]?-1:1)*t[Z("0x45")],r=new Float32Array(24),o=[],s=[],l=[0,t],c=[e,n],h=[i,a],u=0,x=0;x<2;x++)r[3*u]=-c[x]/2,r[3*u+1]=-h[x]/2,r[3*u+2]=l[x],s[2*u]=x,s[2*u+1]=0,r[3*++u]=-c[x]/2,r[3*u+1]=h[x]/2,r[3*u+2]=l[x],s[2*u]=x,s[2*u+1]=0,r[3*++u]=c[x]/2,r[3*u+1]=h[x]/2,r[3*u+2]=l[x],s[2*u]=x,s[2*u+1]=0,r[3*++u]=c[x]/2,r[3*u+1]=-h[x]/2,r[3*u+2]=l[x],s[2*u]=x,s[2*u+1]=0,u++;o[Z("0x4c")](0,1,1,2),o[Z("0x4c")](2,3,3,0),o[Z("0x4c")](0,4),o[Z("0x4c")](1,5),o[Z("0x4c")](2,6),o[Z("0x4c")](3,7),o[Z("0x4c")](4,5,5,6),o[Z("0x4c")](6,7,7,4);o=new Int16Array(o),s=new Float32Array(s),t={position:new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x4d")],componentsPerAttribute:3,values:r}),st:new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x8")],componentsPerAttribute:2,values:s})},e=tt[Z("0x4e")][Z("0x4f")](r),n=new tt[Z("0x50")]({attributes:t,indices:o,primitiveType:tt[Z("0x51")][Z("0x59")],boundingSphere:e}),r=[];return o=[],n},B[Z("0x5a")]=function(t){t[Z("0x3d")],t[Z("0x3f")];var e=t[Z("0x41")],i=t[Z("0x43")],n=(t[Z("0x46")]?-1:1)*t[Z("0x45")],r=[],o=[],s=e/2,l=i/2,c=0;(w=[])[Z("0x4c")](0,0,0),o[Z("0x4c")](1,1),c++;for(var h=[],u=-16;u<16;u++){for(var x=[],d=-16;d<16;d++){x[Z("0x4c")](c);var p=l*u/16,g=s*d/16;w[Z("0x4c")](g,p,n),o[Z("0x4c")](1,1),c++}h[Z("0x4c")](x)}for(var m,f,v=[0,h[Z("0x2")]-1],b=0;b<v[Z("0x2")];b++)for(u=v[b],d=1;d<h[u][Z("0x2")];d++)m=h[u][d-1],f=h[u][d],r[Z("0x4c")](0,m,f);for(var y=[0,h[0][Z("0x2")]-1],C=0;C<y[Z("0x2")];C++)for(d=y[C],u=1;u<h[Z("0x2")];u++)m=h[u-1][d],f=h[u][d],r[Z("0x4c")](0,m,f);var w=new Float32Array(w),r=new Int16Array(r),o=new Float32Array(o),t={position:new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x4d")],componentsPerAttribute:3,values:w}),st:new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x8")],componentsPerAttribute:2,values:o})},e=tt[Z("0x4e")][Z("0x4f")](w),i=new tt[Z("0x50")]({attributes:t,indices:r,primitiveType:tt[Z("0x51")][Z("0x52")],boundingSphere:e});return(0,a[Z("0x1f")])(i),tt[Z("0x53")][Z("0x5b")](i),w=[],r=[],i},B[Z("0x5c")]=function(t,e,i,n){var a={length:i,zReverse:n,bottomHeight:i,bottomWidth:i,topHeight:i,topWidth:i};return t=tt[Z("0x5d")][Z("0x5e")](t),e=tt[Z("0x5d")][Z("0x5e")](e),n?(a[Z("0x40")]=0,a[Z("0x3e")]=0,a[Z("0x44")]=i*Math[Z("0x5f")](t),a[Z("0x42")]=i*Math[Z("0x5f")](e)):(a[Z("0x44")]=0,a[Z("0x42")]=0,a[Z("0x40")]=i*Math[Z("0x5f")](t),a[Z("0x3e")]=i*Math[Z("0x5f")](e)),new B(a)},tt.Scene[Z("0x4a")]=B,tt[Z("0x60")]||(Object[Z("0x1d")](tt.Scene,Z("0x1e"),{value:!0}),tt.Scene[Z("0x60")]=void 0,G=new tt[Z("0x63")],_=new tt[Z("0x9")],A=new tt[Z("0x18")],R[Z("0x4b")]=function(t){var e=t[Z("0x2")],i=t[Z("0x61")],n=t[Z("0x62")],a=t[Z("0x49")],r=2*Math.PI/(a-1),o=[],s=[],l=[],c=[],h=[n,i],u=[0,t[Z("0x47")]?-e:e],x=0,t=Math[Z("0x64")](n-i,e),d=G;d.z=Math[Z("0x65")](t);for(var p=Math[Z("0x66")](t),g=0;g<u[Z("0x2")];g++){c[g]=[];for(var m=h[g],f=0;f<a;f++){c[g][Z("0x4c")](x++);var v=r*f,b=m*Math[Z("0x66")](v),y=m*Math[Z("0x65")](v);o[Z("0x4c")](b,y,u[g]),b=p*Math[Z("0x66")](v),y=p*Math[Z("0x65")](v),s[Z("0x4c")](b,y,d.z),l[Z("0x4c")](g/(u[Z("0x2")]-1),0)}}for(var C=[],g=1;g<u[Z("0x2")];g++)for(f=1;f<a;f++){var w=c[g-1][f-1],I=c[g][f-1],_=c[g][f],A=c[g-1][f];C[Z("0x4c")](_),C[Z("0x4c")](A),C[Z("0x4c")](w),C[Z("0x4c")](_),C[Z("0x4c")](w),C[Z("0x4c")](I),f==c[g][Z("0x2")]-1&&(w=c[g-1][f],I=c[g][f],_=c[g][0],A=c[g-1][0],C[Z("0x4c")](_),C[Z("0x4c")](A),C[Z("0x4c")](w),C[Z("0x4c")](_),C[Z("0x4c")](w),C[Z("0x4c")](I))}C=new Int16Array(C),o=new Float32Array(o),s=new Float32Array(s),l=new Float32Array(l),n={position:new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x4d")],componentsPerAttribute:3,values:o}),normal:new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x8")],componentsPerAttribute:3,values:s}),st:new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x8")],componentsPerAttribute:2,values:l})},i=tt[Z("0x4e")][Z("0x4f")](o),e=new tt[Z("0x50")]({attributes:n,indices:C,primitiveType:tt[Z("0x51")][Z("0x52")],boundingSphere:i});return o=[],C=[],l=[],e},R[Z("0x55")]=function(t,e){if(!e)return R[Z("0x4b")](t);tt[Z("0x11")][Z("0x12")](e,tt[Z("0x9")][Z("0x56")],_),_[Z("0x57")](A[Z("0x13")]);var i=t[Z("0x2")],n=t[Z("0x61")],a=(t[Z("0x62")],t[Z("0x49")]),r=2*Math.PI/(a-1),o=[],s=[],l=[],c=[],h=[0,t[Z("0x47")]?-i:i],u=0,u=0;o[Z("0x4c")](0,0,0),s[Z("0x4c")](1,1),u++;for(var x=new tt[Z("0x9")],d=n/15,p=0;p<16;p++){for(var g=d*p,m=[],f=0;f<a;f++){var v=r*f,b=g*Math[Z("0x66")](v),v=g*Math[Z("0x65")](v);x.x=b,x.y=v,x.z=h[1],(0,tt[Z("0x20")])(x,e,A)?(m[Z("0x4c")](u),o[Z("0x4c")](b,v,h[1]),s[Z("0x4c")](p/15,1),u++):m[Z("0x4c")](-1)}c[Z("0x4c")](m)}for(var y,C,w=[0,c[Z("0x2")]-1],I=0;I<w[Z("0x2")];I++)for(p=w[I],f=1;f<c[p][Z("0x2")];f++)y=c[p][f-1],C=c[p][f],0<=y&&0<=C&&l[Z("0x4c")](0,y,C);o=new Float32Array(o),l=new Int32Array(l),s=new Float32Array(s),t={position:new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x4d")],componentsPerAttribute:3,values:o}),st:new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x8")],componentsPerAttribute:2,values:s})},i=tt[Z("0x4e")][Z("0x4f")](o),n=new tt[Z("0x50")]({attributes:t,indices:l,primitiveType:tt[Z("0x51")][Z("0x52")],boundingSphere:i});return(0,tt.Scene[Z("0x1f")])(n),o=[],l=[],n},R[Z("0x58")]=function(t){var e=t[Z("0x2")],i=t[Z("0x61")],n=t[Z("0x62")],a=t[Z("0x49")],r=2*Math.PI/(a-1),o=[],s=[],l=[],c=[],h=[n,i],u=[0,t[Z("0x47")]?-e:e],x=0,t=Math[Z("0x64")](n-i,e),d=G;d.z=Math[Z("0x65")](t);for(var p=Math[Z("0x66")](t),g=0;g<u[Z("0x2")];g++){c[g]=[];for(var m=h[g],f=0;f<a;f++){c[g][Z("0x4c")](x++);var v=r*f,b=m*Math[Z("0x66")](v),y=m*Math[Z("0x65")](v);o[Z("0x4c")](b,y,u[g]),b=p*Math[Z("0x66")](v),y=p*Math[Z("0x65")](v),s[Z("0x4c")](b,y,d.z),l[Z("0x4c")](g/(u[Z("0x2")]-1),0)}}for(var C=[],g=1;g<u[Z("0x2")];g++)for(f=1;f<a;f+=1){var w=c[g-1][f-1],I=c[g][f-1];c[g][f],c[g-1][f],f%8==1&&C[Z("0x4c")](w,I)}C=new Int16Array(C),o=new Float32Array(o),s=new Float32Array(s),l=new Float32Array(l),n={position:new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x4d")],componentsPerAttribute:3,values:o}),normal:new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x8")],componentsPerAttribute:3,values:s}),st:new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x8")],componentsPerAttribute:2,values:l})},i=tt[Z("0x4e")][Z("0x4f")](o),e=new tt[Z("0x50")]({attributes:n,indices:C,primitiveType:tt[Z("0x51")][Z("0x59")],boundingSphere:i});return o=[],C=[],l=[],e},R[Z("0x67")]=function(t,e,i){return t=tt[Z("0x5d")][Z("0x5e")](t),new R({topRadius:Math[Z("0x5f")](t)*e/2,bottomRadius:0,length:e,zReverse:i})},tt.Scene[Z("0x60")]=R),typeof i===Z("0x68")||tt[Z("0x69")]||(tt.Scene[Z("0x69")]=void 0,m=new tt[Z("0x11")],v=new tt[Z("0x9")],b=new tt[Z("0x9")],y=new tt[Z("0x18")],C=new tt[Z("0x1b")],S[Z("0x6e")]={Cone:1,FourPrism:2},Object[Z("0xa3")](S[Z("0xa4")],{color:{get:function(){return this[Z("0x81")]},set:function(t){this[Z("0x81")]=t}},lineColor:{get:function(){return this[Z("0x85")]},set:function(t){this[Z("0x85")]=t}},trackedEntity:{get:function(){return this[Z("0x97")]},set:function(t){t!=this[Z("0x97")]&&(this[Z("0x3")]=t[Z("0x3")]),this[Z("0x97")]=t}},show:{get:function(){return this[Z("0x78")]},set:function(t){this[Z("0x78")]=t}},outline:{get:function(){return this[Z("0x7b")]},set:function(t){this[Z("0x7b")]=t}},angle1:{get:function(){return this[Z("0x70")]},set:function(t){this[Z("0x70")]=t,this[Z("0xa5")](),this[Z("0x6b")]=null}},angle2:{get:function(){return this[Z("0x72")]},set:function(t){this[Z("0x72")]=t,this[Z("0xa5")](),this[Z("0x6b")]=null}},areaType:{get:function(){return this[Z("0x6c")]},set:function(t){this[Z("0x6c")]=t,this[Z("0xa5")](),this[Z("0x6b")]=null}},rotation:{get:function(){return this[Z("0x76")]},set:function(t){this[Z("0x76")]=t,this[Z("0xa5")](),this[Z("0x6b")]=null}},heading:{get:function(){return this[Z("0x76")][Z("0xa6")]},set:function(t){this[Z("0x76")][Z("0xa6")]=t,this[Z("0xa5")](),this[Z("0x6b")]=null}},pitch:{get:function(){return this[Z("0x76")][Z("0xa7")]},set:function(t){this[Z("0x76")][Z("0xa7")]=t,this[Z("0xa5")](),this[Z("0x6b")]=null}},roll:{get:function(){return this[Z("0x76")][Z("0xa8")]},set:function(t){this[Z("0x76")][Z("0xa8")]=t,this[Z("0xa5")](),this[Z("0x6b")]=null}},position:{get:function(){return this[Z("0x74")]},set:function(t){this[Z("0x74")]=t,this[Z("0x6b")]=null,this[Z("0x94")]=[]}}}),S[Z("0xa4")][Z("0x9f")]=function(t){var e,i;t&&!this[Z("0xa9")]&&(e=this,i=new tt[Z("0xaa")],this[Z("0xa9")]=this[Z("0x9c")][Z("0xab")][Z("0x9e")]({polygon:{show:this[Z("0x7d")],material:this[Z("0x87")]||this[Z("0x81")],hierarchy:new tt[Z("0xac")](function(t){return i[Z("0xad")]=e[Z("0x96")],i},!1)},polyline:{show:this[Z("0x7f")],material:this[Z("0x89")]||this[Z("0x87")]||this[Z("0x81")],width:1.5,positions:new tt[Z("0xac")](function(t){return e[Z("0x96")]},!1)}}))},S[Z("0xa4")][Z("0xa5")]=function(){this[Z("0x94")][Z("0xae")](function(t){t[Z("0xaf")][Z("0xb0")]()}),this[Z("0x94")]=[]},S[Z("0xa4")][Z("0xb1")]=function(t,e){if(!t||!t[Z("0x2")])throw new Error(Z("0xb2"));for(var i=[],n=!1,a=!1,r=t[0][Z("0xb3")],o=0;o<t[Z("0x2")];o++){if(i[o]=function(t){var e,i=[];for(e in t[Z("0x1")])t[Z("0x1")][Z("0xa0")](e)&&t[Z("0x1")][e]&&i[Z("0x4c")](e);return i}(t[o]),0<o){if(r!=t[o][Z("0xb3")]){a=!0;break}var s=i[o-1];if(!(n=s[Z("0x2")]!=i[o][Z("0x2")]))for(var l=0;l<s[Z("0x2")];l++)if(s[l]!=i[o][l]){n=!0;break}}if(r=t[o][Z("0xb3")],n||a)break}if(a)throw new Error(Z("0xb4"));if(n)throw new Error(Z("0xb5"));for(var c={},h=i[0],o=0;o<h[Z("0x2")];o++){var u,x=h[o],d=t[0];for(u in c[x]={},d[Z("0x1")][x])d[Z("0x1")][x][Z("0xa0")](u)&&(c[x][u]=d[Z("0x1")][x][u]);for(var p=Array[Z("0xb6")](c[x][Z("0x4")]),l=1;l<t[Z("0x2")];l++)for(var d=t[l],g=0;g<d[Z("0x1")][x][Z("0x4")][Z("0x2")];g++)p[Z("0x4c")](d[Z("0x1")][x][Z("0x4")][g]);c[x][Z("0x4")]=new c[x][Z("0x4")][Z("0xb7")](p)}var m=[],f=0;for(l=0;l<t[Z("0x2")];l++){for(d=t[0],o=0;o<d[Z("0x0")][Z("0x2")];o++)m[Z("0x4c")](d[Z("0x0")][o]+f);f+=d[Z("0x1")][Z("0x3")][Z("0x4")][Z("0x2")]/3}var v=tt[Z("0x4e")][Z("0x4f")](c[Z("0x3")][Z("0x4")]);return new tt[Z("0x50")]({attributes:c,indices:new Int32Array(m),primitiveType:t[0][Z("0xb3")],boundingSphere:v})},S[Z("0xa4")][Z("0xb8")]=function(t){if(this[Z("0x9b")][Z("0xb9")]){var e=this[Z("0x9b")][Z("0xb9")][Z("0x2")]!=this[Z("0x95")][Z("0x2")];if(!e)for(var i=0;i<this[Z("0x9b")][Z("0xb9")][Z("0x2")];i++)if(!this[Z("0x9b")][Z("0xb9")][i][Z("0xba")](this[Z("0x95")][i])){e=!0;break}if(!e)return}if(this[Z("0x9b")][Z("0xb9")]&&this[Z("0x9b")][Z("0xb9")][Z("0x2")]==this[Z("0x95")][Z("0x2")])for(i=0;i<this[Z("0x95")][Z("0x2")];i++)this[Z("0x95")][i][Z("0x57")](this[Z("0x9b")][Z("0xb9")][i]);else for(this[Z("0x9b")][Z("0xb9")]=[],i=0;i<this[Z("0x95")][Z("0x2")];i++)this[Z("0x9b")][Z("0xb9")][Z("0x4c")](this[Z("0x95")][i][Z("0x57")]());t=this[Z("0xbb")](t);if(this[Z("0x9a")][Z("0x4c")](t),this[Z("0x9b")][Z("0xbc")]){var n=this[Z("0x9b")][Z("0xbc")][Z("0x1")];for(i in n)n[Z("0xa0")](i)&&delete n[i];for(i in this[Z("0x9b")][Z("0xbc")])this[Z("0x9b")][Z("0xbc")][Z("0xa0")](i)&&delete this[Z("0x9b")][Z("0xbc")][i]}this[Z("0x9b")][Z("0xbc")]=this[Z("0xb1")](this[Z("0x9a")]),this[Z("0x9b")][Z("0xd")]=!0},w=new tt[Z("0x29")],S[Z("0xa4")][Z("0xbd")]=function(t,e){return this[Z("0x93")]||(this[Z("0x93")]=new tt[Z("0x9")]),this[Z("0x3")]instanceof tt[Z("0x9")]?this[Z("0x93")]=this[Z("0x3")]:Z("0xbe")==typeof this[Z("0x3")][Z("0xbf")]?this[Z("0x93")]=this[Z("0x3")][Z("0xbf")](t):this[Z("0x3")][Z("0xc0")]&&this[Z("0x3")][Z("0xc0")]instanceof tt[Z("0x9")]&&(this[Z("0x93")]=this[Z("0x3")][Z("0xc0")]),this[Z("0x93")]&&(this[Z("0x8b")]=tt[Z("0x24")][Z("0x25")](this[Z("0x93")],g,this[Z("0x8b")]),this[Z("0x92")]=tt[Z("0x1b")][Z("0x1c")](this[Z("0x93")],g,this[Z("0x92")]),tt[Z("0x24")][Z("0x25")](this[Z("0x93")],g,this[Z("0x8b")]),this[Z("0x75")]&&this[Z("0x97")]&&this[Z("0x97")][Z("0xc1")]&&(t=tt[Z("0xc2")][Z("0xc3")](this[Z("0x97")][Z("0xc1")],t,w),t=tt[Z("0x11")][Z("0x2c")](this[Z("0x93")],t),this[Z("0x76")][Z("0xa6")]=t[Z("0xa6")]),tt[Z("0x29")][Z("0xc4")](this[Z("0x76")],this[Z("0x8d")]),this[Z("0x90")]=tt[Z("0x11")][Z("0xc5")](this[Z("0x8e")],this[Z("0x8d")],this[Z("0x8f")],this[Z("0x90")]),tt[Z("0x11")][Z("0xc6")](this[Z("0x8b")],this[Z("0x90")],this[Z("0x90")]),tt[Z("0x11")][Z("0xc7")](this[Z("0x90")],this[Z("0x91")])),this[Z("0x90")]},S[Z("0xa4")][Z("0xc8")]=function(t,e){var n=this[Z("0x95")];if(e){if(this[Z("0xbd")](e),!this[Z("0x93")])return;n=V(this[Z("0xc9")],this[Z("0x90")],3,this[Z("0xc9")][Z("0x2")]-3,g,null,this[Z("0x6b")][Z("0x1")][Z("0x3")][Z("0x4")])}for(var a=[],r=0;r<n[Z("0x2")];r++){var o=n[r],o=(tt[Z("0x1b")][Z("0x1c")](o,void 0,C),[tt[Z("0x5d")][Z("0xca")](C[Z("0xcb")]),tt[Z("0x5d")][Z("0xca")](C[Z("0xcc")])]);t&&(o[0]=parseFloat(o[0][Z("0xcd")](t)),o[1]=parseFloat(o[1][Z("0xcd")](t))),a[Z("0x4c")](i[Z("0xce")](o))}var s,e=[];return e=0<a[Z("0x2")]&&(a=i[Z("0xcf")](a),s=i[Z("0xd0")](a))&&(s=i[Z("0xd1")](s))&&0<s[Z("0x2")]?s[0]:e},S[Z("0xa4")][Z("0xbb")]=function(t){for(var e=[],i=[],n=0,a=0;a<this[Z("0x95")][Z("0x2")];a+=2){var r=this[Z("0x95")][0];e[Z("0x4c")](r.x,r.y,r.z),i[Z("0x4c")](n++)}return e=new Float32Array(e),i=new Int32Array(i),new tt[Z("0x50")]({attributes:{position:new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x4d")],componentsPerAttribute:3,values:e})},primitiveType:tt[Z("0x51")][Z("0x59")],indices:i,boundingSphere:tt[Z("0x4e")][Z("0x4f")](e)})},S[Z("0xa4")][Z("0xd2")]=function(){this[Z("0x9c")][Z("0x6a")][Z("0x9d")][Z("0xd2")](this),this[Z("0xa9")]&&this[Z("0x9c")][Z("0xab")][Z("0xd2")](this[Z("0xa9")])},S[Z("0xa4")][Z("0xb0")]=function(t){if(t){for(var e in this[Z("0x9c")][Z("0x6a")][Z("0x9d")][Z("0xd2")](this),this[Z("0xa9")]&&this[Z("0x9c")][Z("0xab")][Z("0xd2")](this[Z("0xa9")]),this[Z("0x94")][Z("0xae")](function(t){t[Z("0xaf")]=t[Z("0xaf")]&&t[Z("0xaf")][Z("0xb0")]()}),this[Z("0x94")]=[],this[Z("0xd3")][Z("0x1")])this[Z("0xd3")][Z("0x1")][Z("0xa0")](e)&&delete this[Z("0xd3")][Z("0x1")][e];for(var e in this[Z("0x6b")][Z("0x1")])this[Z("0x6b")][Z("0x1")][Z("0xa0")](e)&&delete this[Z("0x6b")][Z("0x1")][e];delete this[Z("0xd3")],delete this[Z("0x6b")],delete this[Z("0x93")],delete this[Z("0x74")],this[Z("0x95")]=[]}},S[Z("0xa4")][Z("0xd4")]=function(){this[Z("0x9c")][Z("0x6a")][Z("0x9d")][Z("0x9e")](this),this[Z("0xa9")]&&this[Z("0x9c")][Z("0xab")][Z("0x9e")](this[Z("0xa9")])},S[Z("0xa4")][Z("0xd5")]=function(){this[Z("0x6c")]==S[Z("0x6e")][Z("0xd6")]?(this[Z("0x6b")]=tt[Z("0xd7")][Z("0x55")](tt[Z("0xd7")][Z("0x67")](this[Z("0x70")],this[Z("0x45")],!0),this[Z("0x90")]),this[Z("0xd3")]=tt[Z("0xd7")][Z("0x58")](tt[Z("0xd7")][Z("0x67")](this[Z("0x70")],this[Z("0x45")],!0))):(this[Z("0x6b")]=tt.Scene[Z("0x4a")][Z("0x55")](tt.Scene[Z("0x4a")][Z("0x5c")](this[Z("0x70")],this[Z("0x72")],this[Z("0x45")],!0),this[Z("0x90")]),this[Z("0xd3")]=tt.Scene[Z("0x4a")][Z("0x58")](tt.Scene[Z("0x4a")][Z("0x5c")](this[Z("0x70")],this[Z("0x72")],this[Z("0x45")],!0))),this[Z("0xc9")]=new Float32Array(this[Z("0x6b")][Z("0x1")][Z("0x3")][Z("0x4")][Z("0x2")]);for(var t=0;t<this[Z("0xc9")][Z("0x2")];t++)this[Z("0xc9")][t]=this[Z("0x6b")][Z("0x1")][Z("0x3")][Z("0x4")][t];this[Z("0x95")]=[]},S[Z("0xa4")][Z("0xd8")]=function(){var t=1+this[Z("0x96")][Z("0x2")],e=new Float32Array(3+3*this[Z("0x96")][Z("0x2")]),i=0;e[i++]=this[Z("0x93")].x,e[i++]=this[Z("0x93")].y,e[i++]=this[Z("0x93")].z;for(var n=0;n<this[Z("0x96")][Z("0x2")];n++)e[i++]=this[Z("0x96")][n].x,e[i++]=this[Z("0x96")][n].y,e[i++]=this[Z("0x96")][n].z;for(var a=[],r=[],n=1;n<t-1;n++)a[Z("0x4c")](0,n,n+1),r[Z("0x4c")](0,n);var a=new(65535<=t?Uint32Array:Uint16Array)(a),o={position:new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x4d")],componentsPerAttribute:3,values:e})},s=tt[Z("0x4e")][Z("0x4f")](e),l=new tt[Z("0x50")]({attributes:o,indices:a,primitiveType:tt[Z("0x51")][Z("0x52")],boundingSphere:s}),o=new tt[Z("0x50")]({attributes:o,indices:new Uint32Array(r),primitiveType:tt[Z("0x51")][Z("0x59")],boundingSphere:s});(0,tt.Scene[Z("0x1f")])(l),this[Z("0xd9")]=l,this[Z("0xda")]=o},S[Z("0xa4")][Z("0xdb")]=function(t){if(this[Z("0x78")]&&(this[Z("0xbd")](t[Z("0xdc")]),this[Z("0x93")])){this[Z("0x6b")]||this[Z("0xd5")](),this[Z("0x95")]=V(this[Z("0xc9")],this[Z("0x90")],3,this[Z("0xc9")][Z("0x2")]-3,g,this[Z("0x95")],this[Z("0x6b")][Z("0x1")][Z("0x3")][Z("0x4")]),this[Z("0x96")][Z("0xdd")](0,this[Z("0x96")][Z("0x2")]);var e=this[Z("0xc8")]();if(e&&e[Z("0x2")]){for(var i=0;i<e[Z("0x2")];i++){var n=e[i];this[Z("0x96")][Z("0x4c")](tt[Z("0x9")][Z("0xde")](n[0],n[1]))}t[Z("0x34")]===tt[Z("0x35")][Z("0x36")]?(this[Z("0xd8")](),this[Z("0xd9")]&&(this[Z("0xdf")]&&(this[Z("0xdf")][Z("0xaf")]=this[Z("0xdf")][Z("0xaf")]&&this[Z("0xdf")][Z("0xaf")][Z("0xb0")](),this[Z("0xdf")]=null),this[Z("0xdf")]=this[Z("0xe0")](this[Z("0xd9")],t,tt[Z("0x11")][Z("0x8c")][Z("0x57")]()),t[Z("0xe1")][Z("0x4c")](this[Z("0xdf")]),this[Z("0x7b")])&&(this[Z("0xe2")]&&(this[Z("0xe2")][Z("0xaf")]=this[Z("0xe2")][Z("0xaf")]&&this[Z("0xe2")][Z("0xaf")][Z("0xb0")](),this[Z("0xe2")]=null),this[Z("0xe2")]=this[Z("0xe0")](this[Z("0xda")],t,tt[Z("0x11")][Z("0x8c")][Z("0x57")]()),t[Z("0xe1")][Z("0x4c")](this[Z("0xe2")])),this[Z("0xa9")]&&(this[Z("0xa9")][Z("0xe3")][Z("0x7a")]=this[Z("0x7d")]&&this[Z("0x78")],this[Z("0xa9")][Z("0xe4")][Z("0x7a")]=this[Z("0x7f")]&&this[Z("0x78")])):(this[Z("0xa9")]||this[Z("0x9f")](!0),this[Z("0xa9")][Z("0xe3")][Z("0x7a")]=!0)}else this[Z("0x7b")]&&(this[Z("0xd3")][Z("0xe5")]||(this[Z("0xd3")][Z("0xe5")]=this[Z("0xe0")](this[Z("0xd3")],t)),t[Z("0xe1")][Z("0x4c")](this[Z("0xd3")][Z("0xe5")])),this[Z("0xa9")]&&(this[Z("0xa9")][Z("0xe3")][Z("0x7a")]=!1,this[Z("0xa9")][Z("0xe4")][Z("0x7a")]=!1)}},S[Z("0xa4")][Z("0xe6")]=function(t){return Z("0xe7")},S[Z("0xa4")][Z("0xe8")]=function(t){return Z("0xe9")},S[Z("0xa4")][Z("0xe0")]=function(t,e,i){var n=e[Z("0xea")],a=new tt[Z("0x9")],a=(tt[Z("0x11")][Z("0x12")](this[Z("0x90")],t[Z("0xeb")][Z("0xec")],a),new tt[Z("0x4e")](a,t[Z("0xeb")][Z("0xed")]),new tt[Z("0xee")]({modelMatrix:i||this[Z("0x90")],owner:this,primitiveType:t[Z("0xb3")],pass:tt[Z("0xef")][Z("0xf0")]})),r=this,i=tt[Z("0x53")][Z("0xf1")](t);return a[Z("0xaf")]=tt[Z("0xf2")][Z("0xf3")]({context:n,geometry:t,attributeLocations:i,bufferUsage:tt[Z("0xf4")][Z("0xf5")]}),a[Z("0xaf")][Z("0xf6")]=i,a[Z("0xf7")]=tt[Z("0xf8")][Z("0xf9")]({context:n,vertexShaderSource:this[Z("0xe8")](t),fragmentShaderSource:this[Z("0xe6")](t),attributeLocations:i}),a[Z("0xfa")]=tt[Z("0xfb")][Z("0xfc")]({blending:tt[Z("0xfd")][Z("0xfe")],depthTest:{enabled:!0,func:tt[Z("0xff")][Z("0x100")]},cull:{enabled:!1,face:tt[Z("0x101")][Z("0x102")]},depthMask:!1}),a[Z("0x103")]={},a[Z("0x103")][Z("0x104")]=function(){return e[Z("0xea")][Z("0x105")][Z("0x106")]},a[Z("0x103")][Z("0x107")]=function(){return e[Z("0xea")][Z("0x105")][Z("0x108")]},a[Z("0x103")][Z("0x109")]=function(){return r[Z("0x109")]||(r[Z("0x109")]=0),r[Z("0x109")]},a[Z("0x103")][Z("0x10a")]=function(){return r[Z("0x10a")]||(r[Z("0x10a")]=new tt[Z("0x9")](.2,.2,.2)),r[Z("0x10a")]},a[Z("0x103")][Z("0x10b")]=function(){return r[Z("0x10b")]||(r[Z("0x10b")]=0),r[Z("0x10b")]},a[Z("0x103")][Z("0x10c")]=function(){return t[Z("0xb3")]==tt[Z("0x51")][Z("0x59")]},a[Z("0x103")][Z("0x81")]=function(){return t[Z("0x82")]?t[Z("0x82")]:t[Z("0xb3")]==tt[Z("0x51")][Z("0x59")]?r[Z("0x85")]||r[Z("0x81")]||new tt[Z("0x83")](1,1,0,.5):r[Z("0x81")]||new tt[Z("0x83")](1,0,0,1)},a[Z("0x103")][Z("0x10d")]=function(){return r[Z("0x10d")]||(r[Z("0x10d")]=0),r[Z("0x10d")]},a[Z("0x103")][Z("0x10e")]=function(){return r[Z("0x10e")]||(r[Z("0x10e")]=new tt[Z("0x83")](1,1,0,1)),r[Z("0x10e")]},a[Z("0x103")][Z("0x10f")]=function(){return e[Z("0xea")][Z("0x105")][Z("0x5")]},a[Z("0x103")][Z("0x110")]=function(){return.25},a},tt.Scene[Z("0x111")]=V,tt.Scene[Z("0x69")]=S),tt[Z("0x112")]||(tt.Scene[Z("0x112")]=void 0,Object[Z("0xa3")](n[Z("0xa4")],{trackedEntity:{get:function(){return this[Z("0x97")]},set:function(t){this[Z("0x97")]=t}},color:{get:function(){return this[Z("0x81")]},set:function(t){this[Z("0x81")]=t}},lineColor:{get:function(){return this[Z("0x85")]},set:function(t){this[Z("0x85")]=t}},show:{get:function(){return this[Z("0x78")]},set:function(t){this[Z("0x78")]=t}},outline:{get:function(){return this[Z("0x7b")]},set:function(t){this[Z("0x7b")]=t,this[Z("0xd5")]()}},top:{get:function(){return this[Z("0x116")]},set:function(t){this[Z("0x116")]=t,this[Z("0xd5")]()}},topOutline:{get:function(){return this[Z("0x118")]},set:function(t){this[Z("0x118")]=t,this[Z("0xd5")]()}},groundArea:{get:function(){return this[Z("0x7d")]},set:function(t){this[Z("0x7d")]=t,this[Z("0x9f")](this[Z("0x7d")])}},angle:{get:function(){return this[Z("0x113")]},set:function(t){this[Z("0x113")]=t,this[Z("0x11a")](),this[Z("0xd5")]()}},radius:{get:function(){return this[Z("0x115")]},set:function(t){this[Z("0x115")]=t,this[Z("0x11a")](),this[Z("0xd5")]()}},heading:{get:function(){return this[Z("0x76")][Z("0xa6")]},set:function(t){this[Z("0x76")][Z("0xa6")]=t}},pitch:{get:function(){return this[Z("0x76")][Z("0xa7")]},set:function(t){this[Z("0x76")][Z("0xa7")]=t}},roll:{get:function(){return this[Z("0x76")][Z("0xa8")]},set:function(t){this[Z("0x76")][Z("0xa8")]=t}},position:{get:function(){return this[Z("0x74")]},set:function(t){this[Z("0x74")]=t}}}),n[Z("0xa4")][Z("0x11a")]=function(){this[Z("0x11b")]=this[Z("0x115")]*Math[Z("0x66")](tt[Z("0x5d")][Z("0x5e")](this[Z("0x113")]))},n[Z("0xa4")][Z("0x9f")]=function(t){var e;t&&!this[Z("0xa9")]&&((e=this)[Z("0x11a")](),this[Z("0xa9")]=viewer[Z("0xab")][Z("0x9e")]({position:this[Z("0x74")],ellipse:{show:0===this[Z("0x76")][Z("0xa7")]&&0===this[Z("0x76")][Z("0xa8")],semiMinorAxis:new tt[Z("0xac")](function(t){return e[Z("0x11b")]},!1),semiMajorAxis:new tt[Z("0xac")](function(t){return e[Z("0x11b")]},!1),material:this[Z("0x81")]},polyline:{show:this[Z("0x11c")]&&(0!==this[Z("0x76")][Z("0xa7")]||0!==this[Z("0x76")][Z("0xa8")]),positions:new tt[Z("0xac")](function(t){return!e[Z("0x11c")]||tt[Z("0x9")][Z("0x11d")](e[Z("0x74")],e[Z("0x11c")])>e[Z("0x115")]?[]:[e[Z("0x74")],e[Z("0x11c")]]},!1),followSurface:!1,material:new tt[Z("0x11e")]({color:tt[Z("0x83")][Z("0x11f")]}),width:1}}))},u=new tt[Z("0x9")],n[Z("0xa4")][Z("0xbd")]=function(t,e){var i;return this[Z("0x93")]||(this[Z("0x93")]=new tt[Z("0x9")]),this[Z("0x3")]instanceof tt[Z("0x9")]?this[Z("0x93")]=this[Z("0x3")]:Z("0xbe")==typeof this[Z("0x3")][Z("0xbf")]?this[Z("0x93")]=this[Z("0x3")][Z("0xbf")](t):this[Z("0x3")][Z("0xc0")]&&this[Z("0x3")][Z("0xc0")]instanceof tt[Z("0x9")]&&(this[Z("0x93")]=this[Z("0x3")][Z("0xc0")]),this[Z("0x97")]&&this[Z("0x97")][Z("0x3")]&&(i=this[Z("0x93")],t=tt[Z("0xc2")][Z("0xc3")](this[Z("0x97")][Z("0x3")],t,u))&&(this[Z("0x11c")]=t,i=mars3d[Z("0x120")][Z("0x121")](i,t,c),this[Z("0x76")][Z("0xa6")]=i[Z("0xa6")],this[Z("0x76")][Z("0xa7")]=i[Z("0xa7")],this[Z("0x76")][Z("0xa8")]=i[Z("0xa8")]),this[Z("0x8b")]=tt[Z("0x24")][Z("0x25")](this[Z("0x93")],c,this[Z("0x8b")]),this[Z("0x92")]=tt[Z("0x1b")][Z("0x1c")](this[Z("0x93")],c,this[Z("0x92")]),tt[Z("0x24")][Z("0x25")](this[Z("0x93")],c,this[Z("0x8b")]),tt[Z("0x29")][Z("0xc4")](this[Z("0x76")],this[Z("0x8d")]),this[Z("0x90")]=tt[Z("0x11")][Z("0xc5")](this[Z("0x8e")],this[Z("0x8d")],this[Z("0x8f")],this[Z("0x90")]),tt[Z("0x11")][Z("0xc6")](this[Z("0x8b")],this[Z("0x90")],this[Z("0x90")]),tt[Z("0x11")][Z("0xc7")](this[Z("0x90")],this[Z("0x91")]),this[Z("0x90")]},n[Z("0xa4")][Z("0x122")]=function(){for(var t=this[Z("0xed")],e=[],i=[],n=[],a=[],r=90-parseInt(this[Z("0x114")]),o=r<1?r/8:1,s=2*Math.PI/127,l=0,c=this[Z("0x114")];c<91;c+=o){for(var h=tt[Z("0x5d")][Z("0x5e")](c<90?c:90),h=Math[Z("0x66")](h)*t,u=[],x=0;x<128;x++){var d=s*x,p=h*Math[Z("0x66")](d),d=h*Math[Z("0x65")](d),g=Math[Z("0xe")](t*t-p*p-d*d);e[Z("0x4c")](p,d,g),i[Z("0x4c")](1,1),u[Z("0x4c")](l++)}a[Z("0x4c")](u)}for(c=1;c<a[Z("0x2")];c++)for(x=1;x<a[c][Z("0x2")];x++){var m=a[c-1][x-1],f=a[c][x-1],v=a[c][x],b=a[c-1][x];n[Z("0x4c")](m,f,v),n[Z("0x4c")](m,v,b)}var e=new Float32Array(e),n=new Int32Array(n),i=new Float32Array(i),r={position:new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x4d")],componentsPerAttribute:3,values:e}),st:new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x8")],componentsPerAttribute:2,values:i})},y=tt[Z("0x4e")][Z("0x4f")](e),r=new tt[Z("0x50")]({attributes:r,indices:n,primitiveType:tt[Z("0x51")][Z("0x52")],boundingSphere:y});return(0,tt.Scene[Z("0x1f")])(r),r},n[Z("0xa4")][Z("0x123")]=function(){for(var t=this[Z("0xed")],e=[],i=[],n=[],a=[],r=90-parseInt(this[Z("0x114")]),o=r<1?r/8:1,s=2*Math.PI/127,l=0,c=this[Z("0x114")];c<91;c+=o){for(var h=tt[Z("0x5d")][Z("0x5e")](c<90?c:90),h=Math[Z("0x66")](h)*t,u=[],x=0;x<128;x++){var d=s*x,p=h*Math[Z("0x66")](d),d=h*Math[Z("0x65")](d),g=Math[Z("0xe")](t*t-p*p-d*d);e[Z("0x4c")](p,d,g),i[Z("0x4c")](1,1),u[Z("0x4c")](l++)}a[Z("0x4c")](u)}for(c=1;c<a[Z("0x2")];c++)for(x=1;x<a[c][Z("0x2")];x++){var m=a[c-1][x-1],f=a[c][x-1],v=a[c][x];a[c-1][x],x%8==1&&n[Z("0x4c")](m,f),c%8==1&&n[Z("0x4c")](f,v)}var e=new Float32Array(e),n=new Int32Array(n),i=new Float32Array(i),r={position:new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x4d")],componentsPerAttribute:3,values:e}),st:new tt[Z("0x6")]({componentDatatype:tt[Z("0x7")][Z("0x8")],componentsPerAttribute:2,values:i})},b=tt[Z("0x4e")][Z("0x4f")](e),r=new tt[Z("0x50")]({attributes:r,indices:n,primitiveType:tt[Z("0x51")][Z("0x59")],boundingSphere:b});return(0,tt.Scene[Z("0x1f")])(r),r},n[Z("0xa4")][Z("0xd5")]=function(){this[Z("0x6b")]=tt.Scene[Z("0x60")][Z("0x55")](new tt.Scene[Z("0x60")]({topRadius:this[Z("0x115")]*Math[Z("0x66")](tt[Z("0x5d")][Z("0x5e")](this[Z("0x114")])),bottomRadius:0,length:this[Z("0x115")]*Math[Z("0x65")](tt[Z("0x5d")][Z("0x5e")](this[Z("0x114")]))})),this[Z("0x124")]=this[Z("0x122")](),this[Z("0x125")]=this[Z("0x123")](),this[Z("0xd3")]=tt.Scene[Z("0x60")][Z("0x58")](new tt.Scene[Z("0x60")]({topRadius:this[Z("0x115")]*Math[Z("0x66")](tt[Z("0x5d")][Z("0x5e")](this[Z("0x114")])),bottomRadius:0,slices:128,length:this[Z("0x115")]*Math[Z("0x65")](tt[Z("0x5d")][Z("0x5e")](this[Z("0x114")]))})),this[Z("0xc9")]=new Float32Array(this[Z("0x6b")][Z("0x1")][Z("0x3")][Z("0x4")][Z("0x2")]);for(var t=0;t<this[Z("0xc9")][Z("0x2")];t++)this[Z("0xc9")][t]=this[Z("0x6b")][Z("0x1")][Z("0x3")][Z("0x4")][t];this[Z("0x94")]&&this[Z("0x94")][Z("0x2")]&&(this[Z("0x94")][Z("0xae")](function(t){t[Z("0xaf")]=t[Z("0xaf")]&&t[Z("0xaf")][Z("0xb0")]()}),this[Z("0x94")][Z("0xdd")](0,this[Z("0x94")][Z("0x2")]))},n[Z("0xa4")][Z("0xdb")]=function(e){this[Z("0x78")]&&(this[Z("0xbd")](e[Z("0xdc")]),e[Z("0x34")]===tt[Z("0x35")][Z("0x36")]?(this[Z("0x6b")][Z("0xeb")]=tt[Z("0x4e")][Z("0x4f")](this[Z("0x6b")][Z("0x1")][Z("0x3")][Z("0x4")]),this[Z("0x94")]&&this[Z("0x94")][Z("0x2")]||(this[Z("0x94")][Z("0x4c")](this[Z("0xe0")](this[Z("0x6b")],e)),this[Z("0x7b")]&&this[Z("0x94")][Z("0x4c")](this[Z("0xe0")](this[Z("0xd3")],e)),this[Z("0x116")]&&(this[Z("0x94")][Z("0x4c")](this[Z("0xe0")](this[Z("0x124")],e)),this[Z("0x118")])&&this[Z("0x94")][Z("0x4c")](this[Z("0xe0")](this[Z("0x125")],e))),this[Z("0x94")][Z("0xae")](function(t){e[Z("0xe1")][Z("0x4c")](t)}),this[Z("0xa9")]&&(this[Z("0xa9")][Z("0x126")][Z("0x7a")]=this[Z("0x7d")]&&0===this[Z("0x76")][Z("0xa7")]&&0===this[Z("0x76")][Z("0xa8")],this[Z("0xa9")][Z("0xe4")][Z("0x7a")]=!1)):(this[Z("0xa9")]||this[Z("0x9f")](!0),this[Z("0xa9")][Z("0x126")][Z("0x7a")]=0===this[Z("0x76")][Z("0xa7")]&&0===this[Z("0x76")][Z("0xa8")],this[Z("0xa9")][Z("0xe4")][Z("0x7a")]=this[Z("0x11c")]&&(0!==this[Z("0x76")][Z("0xa7")]||0!==this[Z("0x76")][Z("0xa8")])))},n[Z("0xa4")][Z("0xe6")]=function(t){return Z("0x127")},n[Z("0xa4")][Z("0xe8")]=function(t){return Z("0x128")},n[Z("0xa4")][Z("0xe0")]=function(t,e,i){var n=e[Z("0xea")],a=new tt[Z("0x9")],a=(tt[Z("0x11")][Z("0x12")](this[Z("0x90")],t[Z("0xeb")][Z("0xec")],a),new tt[Z("0x4e")](a,t[Z("0xeb")][Z("0xed")])),i=new tt[Z("0xee")]({modelMatrix:i||this[Z("0x90")],owner:this,primitiveType:t[Z("0xb3")],pass:tt[Z("0xef")][Z("0x129")],boundingVolume:a}),r=this,a=tt[Z("0x53")][Z("0xf1")](t);return i[Z("0xaf")]=tt[Z("0xf2")][Z("0xf3")]({context:n,geometry:t,attributeLocations:a,bufferUsage:tt[Z("0xf4")][Z("0xf5")]}),i[Z("0xaf")][Z("0xf6")]=a,i[Z("0xf7")]=tt[Z("0xf8")][Z("0xf9")]({context:n,vertexShaderSource:this[Z("0xe8")](t),fragmentShaderSource:this[Z("0xe6")](t),attributeLocations:a}),i[Z("0xfa")]=tt[Z("0xfb")][Z("0xfc")]({blending:tt[Z("0xfd")][Z("0xfe")],depthTest:{enabled:!0,func:tt[Z("0xff")][Z("0x100")]},cull:{enabled:!1,face:tt[Z("0x101")][Z("0x102")]}}),i[Z("0x103")]={},i[Z("0x103")][Z("0x104")]=function(){return e[Z("0xea")][Z("0x105")][Z("0x106")]},i[Z("0x103")][Z("0x107")]=function(){return e[Z("0xea")][Z("0x105")][Z("0x108")]},i[Z("0x103")][Z("0x109")]=function(){return r[Z("0x109")]||(r[Z("0x109")]=0),r[Z("0x109")]},i[Z("0x103")][Z("0x10a")]=function(){return r[Z("0x10a")]||(r[Z("0x10a")]=new tt[Z("0x9")](.2,.2,.2)),r[Z("0x10a")]},i[Z("0x103")][Z("0x10b")]=function(){return r[Z("0x10b")]||(r[Z("0x10b")]=0),r[Z("0x10b")]},i[Z("0x103")][Z("0x10c")]=function(){return t[Z("0xb3")]==tt[Z("0x51")][Z("0x59")]||t[Z("0xb3")]==tt[Z("0x51")][Z("0x12a")]},i[Z("0x103")][Z("0x81")]=function(){return t[Z("0xb3")]==tt[Z("0x51")][Z("0x59")]||t[Z("0xb3")]==tt[Z("0x51")][Z("0x12a")]?(r[Z("0x85")]||(r[Z("0x85")]=new tt[Z("0x83")](1,1,0,1)),r[Z("0x85")]):(r[Z("0x81")]||(r[Z("0x81")]=new tt[Z("0x83")](1,0,0,1)),r[Z("0x81")])},i[Z("0x103")][Z("0x10d")]=function(){return r[Z("0x10d")]||(r[Z("0x10d")]=0),r[Z("0x10d")]},i[Z("0x103")][Z("0x10e")]=function(){return r[Z("0x10e")]||(r[Z("0x10e")]=new tt[Z("0x83")](1,1,0,1)),r[Z("0x10e")]},i[Z("0x103")][Z("0x10f")]=function(){return e[Z("0xea")][Z("0x105")][Z("0x5")]},i[Z("0x103")][Z("0x110")]=function(){return.25},i},n[Z("0xa4")][Z("0xd2")]=function(){this[Z("0x9c")][Z("0x6a")][Z("0x9d")][Z("0xd2")](this),this[Z("0xa9")]&&this[Z("0x9c")][Z("0xab")][Z("0xd2")](this[Z("0xa9")])},n[Z("0xa4")][Z("0xd4")]=function(){this[Z("0x9c")][Z("0x6a")][Z("0x9d")][Z("0x9e")](this),this[Z("0xa9")]&&this[Z("0x9c")][Z("0xab")][Z("0x9e")](this[Z("0xa9")])},n[Z("0xa4")][Z("0xb0")]=function(t){t&&(this[Z("0x9c")][Z("0x6a")][Z("0x9d")][Z("0xd2")](this),this[Z("0xa9")]&&this[Z("0x9c")][Z("0xab")][Z("0xd2")](this[Z("0xa9")]),this[Z("0x94")][Z("0xae")](function(t){t[Z("0xaf")]=t[Z("0xaf")]&&t[Z("0xaf")][Z("0xb0")]()}),this[Z("0x94")]=[])},tt.Scene[Z("0x112")]=n),e[Z("0xa4")][Z("0x241")]=function(t){var e=this[Z("0x23d")]*this[Z("0x23b")],i=this[Z("0x23e")]*this[Z("0x23c")],n=r(this[Z("0x237")],this[Z("0x238")],this[Z("0x239")],this[Z("0x23a")],e,i,this[Z("0x242")]),a=r(this[Z("0x237")],this[Z("0x238")],this[Z("0x239")],this[Z("0x23a")],e,i,this[Z("0x242")]),e=s(e,i),i=l(this[Z("0x23b")],this[Z("0x23c")],this[Z("0x23d")],this[Z("0x23e")]);return this[Z("0x243")](t,n,a,e,i)},e[Z("0xa4")][Z("0x244")]=function(t){var e=this[Z("0x23d")]*this[Z("0x23b")],i=this[Z("0x23e")]*this[Z("0x23c")],n=r(this[Z("0x237")],this[Z("0x238")],this[Z("0x239")],this[Z("0x23a")],e,i,this[Z("0x245")]),a=r(this[Z("0x237")],this[Z("0x238")],this[Z("0x239")],this[Z("0x23a")],e,i,this[Z("0x245")]),e=s(e,i),i=l(this[Z("0x23b")],this[Z("0x23c")],this[Z("0x23d")],this[Z("0x23e")]);return this[Z("0x243")](t,n,a,e,i)},e[Z("0xa4")][Z("0x246")]=function(t){var e=this[Z("0x23e")]*this[Z("0x23c")],i=o(this[Z("0x237")],this[Z("0x239")],this[Z("0x23a")],10,e,this[Z("0x245")],this[Z("0x242")]),n=o(this[Z("0x237")],this[Z("0x239")],this[Z("0x23a")],10,e,this[Z("0x245")],this[Z("0x242")]),e=s(10,e),a=l(10,this[Z("0x23c")],1,this[Z("0x23e")]);return this[Z("0x243")](t,i,n,e,a)},e[Z("0xa4")][Z("0x247")]=function(t){var e=this[Z("0x23e")]*this[Z("0x23c")],i=o(this[Z("0x238")],this[Z("0x239")],this[Z("0x23a")],10,e,this[Z("0x245")],this[Z("0x242")]),n=o(this[Z("0x238")],this[Z("0x239")],this[Z("0x23a")],10,e,this[Z("0x245")],this[Z("0x242")]),e=s(10,e),a=l(10,this[Z("0x23c")],1,this[Z("0x23e")]);return this[Z("0x243")](t,i,n,e,a)},e[Z("0xa4")][Z("0x243")]=function(t,e,i,n,a){var r=this,o=tt[Z("0x248")][Z("0x249")](!0,!1,void 0),o=tt[Z("0xfb")][Z("0xfc")](o),s=new tt[Z("0x136")]({sources:[Z("0x24a")]}),l=new tt[Z("0x136")]({sources:[Z("0x24b")]}),c={xbsjColor:function(){return r[Z("0x236")]}},h={xbsjColor:function(){return r[Z("0x86")]}},s=tt[Z("0xf8")][Z("0xfc")]({context:t,vertexShaderSource:s,fragmentShaderSource:l,attributeLocations:{position:0,normal:1}}),l=tt[Z("0x135")][Z("0x190")]({context:t,typedArray:e,usage:tt[Z("0xf4")][Z("0xf5")]}),i=tt[Z("0x135")][Z("0x190")]({context:t,typedArray:i,usage:tt[Z("0xf4")][Z("0xf5")]}),n=tt[Z("0x135")][Z("0x24c")]({context:t,typedArray:n,usage:tt[Z("0xf4")][Z("0xf5")],indexDatatype:tt[Z("0x1a1")][Z("0x24d")]}),a=tt[Z("0x135")][Z("0x24c")]({context:t,typedArray:a,usage:tt[Z("0xf4")][Z("0xf5")],indexDatatype:tt[Z("0x1a1")][Z("0x24d")]}),n=new tt[Z("0xf2")]({context:t,attributes:[{index:0,vertexBuffer:l,componentsPerAttribute:3,componentDatatype:tt[Z("0x7")][Z("0x8")]},{index:1,vertexBuffer:i,componentsPerAttribute:3,componentDatatype:tt[Z("0x7")][Z("0x8")]}],indexBuffer:n}),t=new tt[Z("0xf2")]({context:t,attributes:[{index:0,vertexBuffer:l,componentsPerAttribute:3,componentDatatype:tt[Z("0x7")][Z("0x8")]},{index:1,vertexBuffer:i,componentsPerAttribute:3,componentDatatype:tt[Z("0x7")][Z("0x8")]}],indexBuffer:a}),l=tt[Z("0x4e")][Z("0x4f")](e);return{command:new tt[Z("0xee")]({vertexArray:n,primitiveType:tt[Z("0x51")][Z("0x52")],renderState:o,shaderProgram:s,uniformMap:c,owner:this,pass:tt[Z("0xef")][Z("0x129")],modelMatrix:new tt[Z("0x11")],boundingVolume:new tt[Z("0x4e")],cull:!0}),lineCommand:new tt[Z("0xee")]({vertexArray:t,primitiveType:tt[Z("0x51")][Z("0x59")],renderState:o,shaderProgram:s,uniformMap:h,owner:this,pass:tt[Z("0xef")][Z("0x129")],modelMatrix:new tt[Z("0x11")],boundingVolume:new tt[Z("0x4e")],cull:!0}),initBoundingSphere:l}},e[Z("0xa4")][Z("0xdb")]=function(e){var i=this;this[Z("0x7a")]&&(this[Z("0x22b")]===this[Z("0x245")]&&this[Z("0x22c")]===this[Z("0x242")]&&this[Z("0x22e")]===this[Z("0x237")]&&this[Z("0x22f")]===this[Z("0x238")]&&this[Z("0x230")]===this[Z("0x239")]&&this[Z("0x231")]===this[Z("0x23a")]&&this[Z("0x232")]===this[Z("0x23b")]&&this[Z("0x233")]===this[Z("0x23c")]&&this[Z("0x234")]===this[Z("0x23d")]&&this[Z("0x235")]===this[Z("0x23e")]||(this[Z("0x245")]=this[Z("0x22b")],this[Z("0x242")]=this[Z("0x22c")],this[Z("0x237")]=this[Z("0x22e")],this[Z("0x238")]=this[Z("0x22f")],this[Z("0x239")]=this[Z("0x230")],this[Z("0x23a")]=this[Z("0x231")],this[Z("0x23b")]=this[Z("0x232")],this[Z("0x23c")]=this[Z("0x233")],this[Z("0x23d")]=this[Z("0x234")],this[Z("0x23e")]=this[Z("0x235")],this[Z("0x8b")]=tt[Z("0x57")](tt[Z("0x11")][Z("0x8c")]),this[Z("0x24e")]()),tt[Z("0x2d")](this[Z("0x24f")])&&0!==this[Z("0x24f")][Z("0x2")]||(this[Z("0x24f")]||(this[Z("0x24f")]=[]),this[Z("0x24f")][Z("0x4c")](this[Z("0x241")](e[Z("0xea")])),this[Z("0x24f")][Z("0x4c")](this[Z("0x246")](e[Z("0xea")])),this[Z("0x24f")][Z("0x4c")](this[Z("0x247")](e[Z("0xea")])),this[Z("0x24f")][Z("0x4c")](this[Z("0x244")](e[Z("0xea")]))),tt[Z("0x11")][Z("0xba")](this[Z("0x140")],this[Z("0x8b")])||(tt[Z("0x11")][Z("0x57")](this[Z("0x140")],this[Z("0x8b")]),this[Z("0x24f")][Z("0xae")](function(t){t[Z("0x250")][Z("0x140")]=tt[Z("0x11")][Z("0x8c")],t[Z("0x250")][Z("0x140")]=i[Z("0x8b")],t[Z("0x250")][Z("0x251")]=tt[Z("0x4e")][Z("0x180")](t[Z("0x252")],i[Z("0x8b")],i[Z("0x166")]),t[Z("0x253")][Z("0x140")]=tt[Z("0x11")][Z("0x8c")],t[Z("0x253")][Z("0x140")]=i[Z("0x8b")],t[Z("0x253")][Z("0x251")]=tt[Z("0x4e")][Z("0x180")](t[Z("0x252")],i[Z("0x8b")],i[Z("0x166")])})),this[Z("0x24f")][Z("0xae")](function(t){t[Z("0x250")]&&e[Z("0xe1")][Z("0x4c")](t[Z("0x250")]),t[Z("0x253")]&&e[Z("0xe1")][Z("0x4c")](t[Z("0x253")])}))},e[Z("0xa4")][Z("0x1f7")]=function(){return!1},e[Z("0xa4")][Z("0x24e")]=function(){this[Z("0x24f")]&&this[Z("0x24f")][Z("0xae")](function(t){tt[Z("0x2d")](t[Z("0x250")])&&(t[Z("0x250")][Z("0xf7")]=t[Z("0x250")][Z("0xf7")]&&t[Z("0x250")][Z("0xf7")][Z("0xb0")](),t[Z("0x250")][Z("0xaf")]=t[Z("0x250")][Z("0xaf")]&&t[Z("0x250")][Z("0xaf")][Z("0xb0")](),t[Z("0x250")]=void 0),tt[Z("0x2d")](t[Z("0x253")])&&(t[Z("0x253")][Z("0xf7")]=t[Z("0x253")][Z("0xf7")]&&t[Z("0x253")][Z("0xf7")][Z("0xb0")](),t[Z("0x253")][Z("0xaf")]=t[Z("0x253")][Z("0xaf")]&&t[Z("0x253")][Z("0xaf")][Z("0xb0")](),t[Z("0x253")]=void 0)}),this[Z("0x24f")]&&(this[Z("0x24f")][Z("0x2")]=0)},e[Z("0xa4")][Z("0xb0")]=function(){return this[Z("0x24e")](),tt[Z("0x133")](this)},Object[Z("0xa3")](e[Z("0xa4")],{startRadius:{get:function(){return this[Z("0x254")]},set:function(t){this[Z("0x254")]=t,this[Z("0x22b")]=[{fov:tt[Z("0x5d")][Z("0x5e")](0),radius:t},{fov:tt[Z("0x5d")][Z("0x5e")](10),radius:.9*t},{fov:tt[Z("0x5d")][Z("0x5e")](20),radius:.8*t},{fov:tt[Z("0x5d")][Z("0x5e")](30),radius:.7*t},{fov:tt[Z("0x5d")][Z("0x5e")](40),radius:.6*t},{fov:tt[Z("0x5d")][Z("0x5e")](50),radius:.5*t},{fov:tt[Z("0x5d")][Z("0x5e")](60),radius:.4*t},{fov:tt[Z("0x5d")][Z("0x5e")](70),radius:.3*t},{fov:tt[Z("0x5d")][Z("0x5e")](80),radius:.1*t},{fov:tt[Z("0x5d")][Z("0x5e")](90),radius:.01*t}]}},radius:{get:function(){return this[Z("0x115")]},set:function(t){this[Z("0x115")]=t,this[Z("0x22c")]=[{fov:tt[Z("0x5d")][Z("0x5e")](0),radius:t},{fov:tt[Z("0x5d")][Z("0x5e")](10),radius:.9*t},{fov:tt[Z("0x5d")][Z("0x5e")](20),radius:.8*t},{fov:tt[Z("0x5d")][Z("0x5e")](30),radius:.7*t},{fov:tt[Z("0x5d")][Z("0x5e")](40),radius:.6*t},{fov:tt[Z("0x5d")][Z("0x5e")](50),radius:.5*t},{fov:tt[Z("0x5d")][Z("0x5e")](60),radius:.4*t},{fov:tt[Z("0x5d")][Z("0x5e")](70),radius:.3*t},{fov:tt[Z("0x5d")][Z("0x5e")](80),radius:.1*t},{fov:tt[Z("0x5d")][Z("0x5e")](90),radius:.01*t}]}}}),tt.Scene[Z("0x255")]=e,function(){var t,e;tt[Z("0x12b")]||(t=typeof self!==Z("0x68")?self:this,e=function(){return i=[function(c,t,e){Object[Z("0x1d")](t,Z("0x1e"),{value:!0}),t[Z("0x12b")]=void 0;var C=i(e(6)),w=i(e(7)),I=i(e(8)),Q=i(e(9));function i(t){return t&&t[Z("0x1e")]?t:{default:t}}var _=tt[Z("0x4e")],A=tt[Z("0x9")],n=tt[Z("0x83")],x=tt[Z("0x132")],G=tt[Z("0x7")],a=tt[Z("0x79")],r=tt[Z("0x2d")],P=(Object[Z("0xa3")],tt[Z("0x133")],tt[Z("0x134")]),W=tt[Z("0x11")],o=tt[Z("0x51")],M=tt[Z("0x135")],S=tt[Z("0xf4")],s=tt[Z("0xee")],V=tt[Z("0xef")],R=tt[Z("0xfb")],B=tt[Z("0xf8")],X=tt[Z("0x136")],F=tt[Z("0xf2")],T=tt[Z("0xfd")],Y=tt[Z("0x101")],l=tt[Z("0x137")],J=tt[Z("0x35")],O=tt[Z("0x138")],K=tt[Z("0x5d")],D=tt[Z("0x22")],k=(W=tt[Z("0x11")],tt[Z("0x139")]),u=(tt[Z("0x13a")],tt[Z("0x13b")],Math[Z("0x65")]),N=Math[Z("0x66")],L=Math[Z("0x5f")],E=Math[Z("0x13c")],z=(Math[Z("0x13d")],{position:0,normal:1});function h(t){var e=this;t=a(t,a[Z("0x13e")]),this[Z("0x7a")]=a(t[Z("0x7a")],!0),this[Z("0x13f")]=a(t[Z("0x13f")],32),this[Z("0x140")]=W[Z("0x57")](t[Z("0x140")],new W),this[Z("0x8b")]=new W,this[Z("0x141")]=new W,this[Z("0x142")]=new W,this[Z("0xed")]=a(t[Z("0xed")],Number[Z("0x143")]),this[Z("0x115")]=void 0,this[Z("0x144")]=a(t[Z("0x144")],0),this[Z("0x145")]=void 0,this[Z("0x146")]=a(t[Z("0x146")],0),this[Z("0x147")]=void 0,this[Z("0x86")]=a(t[Z("0x86")],n[Z("0x148")]),this[Z("0x149")]=a(t[Z("0x149")],!0),this[Z("0x14a")]=a(t[Z("0x14a")],!0),this[Z("0x14b")]=a(t[Z("0x14b")],!0),this[Z("0x14c")]=r(t[Z("0x14c")])?t[Z("0x14c")]:l[Z("0x14d")](l[Z("0x14e")]),this[Z("0x14f")]=void 0,this[Z("0x150")]=void 0,this[Z("0x151")]=r(t[Z("0x151")])?t[Z("0x151")]:l[Z("0x14d")](l[Z("0x14e")]),this[Z("0x152")]=void 0,this[Z("0x153")]=void 0,this[Z("0x154")]=a(t[Z("0x154")],!0),this[Z("0x155")]=r(t[Z("0x155")])?t[Z("0x155")]:l[Z("0x14d")](l[Z("0x14e")]),this[Z("0x156")]=void 0,this[Z("0x157")]=a(t[Z("0x157")],!0),this[Z("0x158")]=a(t[Z("0x158")],!0),this[Z("0x159")]=a(t[Z("0x159")],n[Z("0x148")]),this[Z("0x15a")]=a(t[Z("0x15a")],5),this[Z("0x15b")]=a(t[Z("0x15b")],!1),this[Z("0x15c")]=void 0,this[Z("0x15d")]=a(t[Z("0x15d")],!0),this[Z("0x15e")]=a(t[Z("0x15e")],n[Z("0x148")]),this[Z("0x15f")]=a(t[Z("0x15f")],Z("0x160")),this[Z("0x161")]=a(t[Z("0x161")],10),this[Z("0x162")]=0,this[Z("0x163")]=0,this[Z("0x164")]=k[Z("0x165")](),this[Z("0x166")]=new _,this[Z("0x167")]=new _,this[Z("0x168")]=new s({owner:this,primitiveType:o[Z("0x52")],boundingVolume:this[Z("0x167")]}),this[Z("0x169")]=new s({owner:this,primitiveType:o[Z("0x52")],boundingVolume:this[Z("0x167")]}),this[Z("0x16a")]=void 0,this[Z("0x16b")]=new s({owner:this,primitiveType:o[Z("0x59")],boundingVolume:this[Z("0x167")]}),this[Z("0x16c")]=void 0,this[Z("0x16d")]=new s({owner:this,primitiveType:o[Z("0x59")],boundingVolume:this[Z("0x167")]}),this[Z("0x16e")]=void 0,this[Z("0x16f")]=new s({owner:this,primitiveType:o[Z("0x52")],boundingVolume:this[Z("0x167")]}),this[Z("0x170")]=new s({owner:this,primitiveType:o[Z("0x52")],boundingVolume:this[Z("0x167")]}),this[Z("0x171")]=void 0,this[Z("0x172")]=new s({owner:this,primitiveType:o[Z("0x59")],boundingVolume:this[Z("0x167")]}),this[Z("0x173")]=void 0,this[Z("0x174")]=new s({owner:this,primitiveType:o[Z("0x52")],boundingVolume:this[Z("0x167")]}),this[Z("0x175")]=new s({owner:this,primitiveType:o[Z("0x52")],boundingVolume:this[Z("0x167")]}),this[Z("0x176")]=void 0,this[Z("0x177")]=[],this[Z("0x178")]=void 0,this[Z("0x179")]=void 0,this[Z("0x17a")]=void 0,this[Z("0x17b")]={u_type:function(){return 0},u_xHalfAngle:function(){return e[Z("0x144")]},u_yHalfAngle:function(){return e[Z("0x146")]},u_radius:function(){return e[Z("0xed")]},u_showThroughEllipsoid:function(){return e[Z("0x15b")]},u_showIntersection:function(){return e[Z("0x158")]},u_intersectionColor:function(){return e[Z("0x159")]},u_intersectionWidth:function(){return e[Z("0x15a")]},u_normalDirection:function(){return 1},u_lineColor:function(){return e[Z("0x86")]}},this[Z("0x17c")]={u_xHalfAngle:function(){return e[Z("0x162")]},u_yHalfAngle:function(){return e[Z("0x163")]},u_radius:function(){return e[Z("0xed")]},u_color:function(){return e[Z("0x15e")]},u_showThroughEllipsoid:function(){return e[Z("0x15b")]},u_showIntersection:function(){return e[Z("0x158")]},u_intersectionColor:function(){return e[Z("0x159")]},u_intersectionWidth:function(){return e[Z("0x15a")]},u_normalDirection:function(){return 1},u_lineColor:function(){return e[Z("0x86")]}}}h[Z("0xa4")][Z("0xdb")]=function(t){var e,i,n=t[Z("0x34")];if(this[Z("0x7a")]&&n===J[Z("0x36")]){var n=!1,a=!1,r=!1,o=this[Z("0x144")],s=this[Z("0x146")];if(o<0||s<0)throw new P(Z("0x17d"));if(0!=o&&0!=s){this[Z("0x145")]===o&&this[Z("0x147")]===s||(this[Z("0x145")]=o,this[Z("0x147")]=s,n=!0);var l=this[Z("0xed")];if(l<0)throw new P(Z("0x17e"));var c=!1,l=(this[Z("0x115")]!==l&&(c=!0,this[Z("0x115")]=l,this[Z("0x166")]=new _(A[Z("0x56")],this[Z("0xed")])),W[Z("0xba")](this[Z("0x140")],this[Z("0x8b")])&&!c||(W[Z("0x57")](this[Z("0x140")],this[Z("0x8b")]),W[Z("0x17f")](this[Z("0x140")],this[Z("0xed")],this[Z("0x141")]),_[Z("0x180")](this[Z("0x166")],this[Z("0x140")],this[Z("0x167")])),this[Z("0x15b")]),c=(this[Z("0x15c")]!==this[Z("0x15b")]&&(this[Z("0x15c")]=l,a=!0),this[Z("0x14c")]);this[Z("0x14f")]!==c&&(this[Z("0x14f")]=c,r=a=!0);var h,u,x,d,p,g=c[Z("0x181")](),m=(this[Z("0x150")]!==g&&(this[Z("0x150")]=g,a=!0),this[Z("0x15d")]&&(p=t[Z("0xdc")],(d=k[Z("0x182")](p,this[Z("0x164")]))<0&&(this[Z("0x164")]=k[Z("0x57")](p,this[Z("0x164")])),p=Math[Z("0x183")](d%this[Z("0x161")]/this[Z("0x161")],0),this[Z("0x15f")]==Z("0x160")?(d=N(u=2*s*p-s),x=L(o),d=E(d*x),this[Z("0x162")]=d,this[Z("0x163")]=u,tt[Z("0x22")][Z("0x184")](this[Z("0x163")],U)):(u=2*o*p-o,x=L(s),d=N(u),p=E(d*x),this[Z("0x162")]=u,this[Z("0x163")]=p,tt[Z("0x22")][Z("0x185")](this[Z("0x162")],U)),tt[Z("0x11")][Z("0x186")](this[Z("0x140")],U,this[Z("0x142")]),W[Z("0x17f")](this[Z("0x142")],this[Z("0xed")],this[Z("0x142")])),n&&(o=this,s=t[Z("0xea")],d=H(o,o[Z("0x144")],o[Z("0x146")]),u=(x=o)[Z("0x144")],x=x[Z("0x146")],p=d[Z("0x189")],d=d[Z("0x18a")],n=[],i=D[Z("0x185")](u,U),n[Z("0x4c")](p[Z("0x18b")](function(t){return D[Z("0x18c")](i,t,new tt[Z("0x9")])})),i=D[Z("0x184")](-x,U),n[Z("0x4c")](d[Z("0x18b")](function(t){return D[Z("0x18c")](i,t,new tt[Z("0x9")])})[Z("0x18d")]()),i=D[Z("0x185")](-u,U),n[Z("0x4c")](p[Z("0x18b")](function(t){return D[Z("0x18c")](i,t,new tt[Z("0x9")])})[Z("0x18d")]()),i=D[Z("0x184")](x,U),n[Z("0x4c")](d[Z("0x18b")](function(t){return D[Z("0x18c")](i,t,new tt[Z("0x9")])})),u=n,o[Z("0x14b")]&&(o[Z("0x16a")]=function(t,e){for(var i=Array[Z("0xa4")][Z("0x18e")][Z("0x18f")]([],e)[Z("0x2")]-e[Z("0x2")],n=new Float32Array(18*i),a=0,r=0,o=e[Z("0x2")];r<o;r++)for(var s=e[r],l=A[Z("0x15")](A[Z("0xc")](s[0],s[s[Z("0x2")]-1],q),q),c=0,i=s[Z("0x2")]-1;c<i;c++)n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=-l.x,n[a++]=-l.y,n[a++]=-l.z,n[a++]=s[c].x,n[a++]=s[c].y,n[a++]=s[c].z,n[a++]=-l.x,n[a++]=-l.y,n[a++]=-l.z,n[a++]=s[c+1].x,n[a++]=s[c+1].y,n[a++]=s[c+1].z,n[a++]=-l.x,n[a++]=-l.y,n[a++]=-l.z;var h=M[Z("0x190")]({context:t,typedArray:n,usage:S[Z("0xf5")]}),u=6*Float32Array[Z("0x191")],h=[{index:z[Z("0x3")],vertexBuffer:h,componentsPerAttribute:3,componentDatatype:G[Z("0x8")],offsetInBytes:0,strideInBytes:u},{index:z[Z("0x5")],vertexBuffer:h,componentsPerAttribute:3,componentDatatype:G[Z("0x8")],offsetInBytes:3*Float32Array[Z("0x191")],strideInBytes:u}];return new F({context:t,attributes:h})}(s,u)),o[Z("0x149")]&&(o[Z("0x16c")]=function(t,e){for(var i=e[Z("0x2")],n=new Float32Array(9*i),a=0,r=0,o=e[Z("0x2")];r<o;r++){var s=e[r];n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=s[0].x,n[a++]=s[0].y,n[a++]=s[0].z}var i=M[Z("0x190")]({context:t,typedArray:n,usage:S[Z("0xf5")]}),l=3*Float32Array[Z("0x191")],i=[{index:z[Z("0x3")],vertexBuffer:i,componentsPerAttribute:3,componentDatatype:G[Z("0x8")],offsetInBytes:0,strideInBytes:l}];return new F({context:t,attributes:i})}(s,u)),o[Z("0x14a")]&&(o[Z("0x16e")]=function(t,e){for(var i=Array[Z("0xa4")][Z("0x18e")][Z("0x18f")]([],e)[Z("0x2")]-e[Z("0x2")],n=new Float32Array(9*i),a=0,r=0,o=e[Z("0x2")];r<o;r++)for(var s=e[r],l=0,i=s[Z("0x2")]-1;l<i;l++)n[a++]=s[l].x,n[a++]=s[l].y,n[a++]=s[l].z,n[a++]=s[l+1].x,n[a++]=s[l+1].y,n[a++]=s[l+1].z;var c=M[Z("0x190")]({context:t,typedArray:n,usage:S[Z("0xf5")]}),h=3*Float32Array[Z("0x191")],c=[{index:z[Z("0x3")],vertexBuffer:c,componentsPerAttribute:3,componentDatatype:G[Z("0x8")],offsetInBytes:0,strideInBytes:h}];return new F({context:t,attributes:c})}(s,u)),o[Z("0x154")]&&(o[Z("0x171")]=(p=s,x=tt[Z("0x13b")][Z("0x55")](new tt[Z("0x13b")]({vertexFormat:O[Z("0x192")],stackPartitions:32,slicePartitions:32})),F[Z("0xf3")]({context:p,geometry:x,attributeLocations:z,bufferUsage:S[Z("0xf5")],interleave:!1}))),o[Z("0x157")]&&(o[Z("0x173")]=(d=s,n=tt[Z("0x193")][Z("0x55")](new tt[Z("0x193")]({vertexFormat:O[Z("0x192")],stackPartitions:32,slicePartitions:32})),F[Z("0xf3")]({context:d,geometry:n,attributeLocations:z,bufferUsage:S[Z("0xf5")],interleave:!1}))),o[Z("0x15d")])&&(o[Z("0x15f")]==Z("0x160")?(h=H(o,K[Z("0x194")],0),o[Z("0x195")]=$(s,h[Z("0x18a")])):(h=H(o,0,K[Z("0x194")]),o[Z("0x195")]=$(s,h[Z("0x189")]))),a&&(n=this,o=l,g?(n[Z("0x178")]=R[Z("0xfc")]({depthTest:{enabled:!o},depthMask:!1,blending:T[Z("0xfe")],cull:{enabled:!0,face:Y[Z("0x102")]}}),n[Z("0x179")]=R[Z("0xfc")]({depthTest:{enabled:!o},depthMask:!1,blending:T[Z("0xfe")],cull:{enabled:!0,face:Y[Z("0x19a")]}}),n[Z("0x19b")]=R[Z("0xfc")]({depthTest:{enabled:!o},depthMask:!1,blending:T[Z("0xfe")]})):(n[Z("0x178")]=R[Z("0xfc")]({depthTest:{enabled:!o},depthMask:!0}),n[Z("0x19b")]=R[Z("0xfc")]({depthTest:{enabled:!0},depthMask:!0}))),r&&(s=this,l=h=c,n=(o=t)[Z("0xea")],c=C[Z("0x131")],e=new X({sources:[I[Z("0x131")],l[Z("0x196")],w[Z("0x131")]]}),s[Z("0x17a")]=B[Z("0xf9")]({context:n,shaderProgram:s[Z("0x17a")],vertexShaderSource:c,fragmentShaderSource:e,attributeLocations:z}),e=new X({sources:[I[Z("0x131")],l[Z("0x196")],w[Z("0x131")]],pickColorQualifier:Z("0x197")}),s[Z("0x198")]=B[Z("0xf9")]({context:n,shaderProgram:s[Z("0x198")],vertexShaderSource:c,fragmentShaderSource:e,attributeLocations:z}),this[Z("0x15d")])&&(l=h,n=o[Z("0xea")],s=C[Z("0x131")],c=new X({sources:[I[Z("0x131")],l[Z("0x196")],Q[Z("0x131")]]}),this[Z("0x199")]=B[Z("0xf9")]({context:n,shaderProgram:this[Z("0x199")],vertexShaderSource:s,fragmentShaderSource:c,attributeLocations:z})),(a||r)&&(e=g,(o=this)[Z("0x177")][Z("0x2")]=0,l=e?V[Z("0x129")]:V[Z("0xf0")],o[Z("0x14b")]&&j(o,o[Z("0x168")],o[Z("0x169")],o[Z("0x178")],o[Z("0x179")],o[Z("0x17a")],o[Z("0x16a")],o[Z("0x17b")],o[Z("0x141")],e,l),o[Z("0x149")]&&j(o,o[Z("0x16b")],void 0,o[Z("0x178")],o[Z("0x179")],o[Z("0x17a")],o[Z("0x16c")],o[Z("0x17b")],o[Z("0x141")],e,l,!0),o[Z("0x14a")]&&j(o,o[Z("0x16d")],void 0,o[Z("0x178")],o[Z("0x179")],o[Z("0x17a")],o[Z("0x16e")],o[Z("0x17b")],o[Z("0x141")],e,l,!0),o[Z("0x154")]&&j(o,o[Z("0x16f")],o[Z("0x170")],o[Z("0x178")],o[Z("0x179")],o[Z("0x17a")],o[Z("0x171")],o[Z("0x17b")],o[Z("0x141")],e,l),o[Z("0x157")]&&j(o,o[Z("0x172")],void 0,o[Z("0x178")],o[Z("0x179")],o[Z("0x17a")],o[Z("0x173")],o[Z("0x17b")],o[Z("0x141")],e,l,!0),o[Z("0x15d")])&&j(o,o[Z("0x174")],o[Z("0x175")],o[Z("0x178")],o[Z("0x179")],o[Z("0x199")],o[Z("0x195")],o[Z("0x17c")],o[Z("0x142")],e,l),t[Z("0xe1")]),n=t[Z("0x187")],f=this[Z("0x177")];if(n[Z("0x188")])for(var v=0,b=f[Z("0x2")];v<b;v++){var y=f[v];m[Z("0x4c")](y)}}}};var U=new D,q=new A;function H(t,e,i){for(var n=t[Z("0x13f")],t=N(i),i=L(i),a=N(e),e=L(e),r=E(a*i),o=E(t*e),s=[],l=0;l<n;l++){var c=2*r*l/(n-1)-r;s[Z("0x4c")](new A(0,u(c),N(c)))}for(var h=[],l=0;l<n;l++)c=2*o*l/(n-1)-o,h[Z("0x4c")](new A(u(c),0,N(c)));return{zoy:s,zox:h}}function $(t,e){for(var i=e[Z("0x2")]-1,n=new Float32Array(9*i),a=0,r=0;r<i;r++)n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=e[r].x,n[a++]=e[r].y,n[a++]=e[r].z,n[a++]=e[r+1].x,n[a++]=e[r+1].y,n[a++]=e[r+1].z;var o=M[Z("0x190")]({context:t,typedArray:n,usage:S[Z("0xf5")]}),s=3*Float32Array[Z("0x191")],o=[{index:z[Z("0x3")],vertexBuffer:o,componentsPerAttribute:3,componentDatatype:G[Z("0x8")],offsetInBytes:0,strideInBytes:s}];return new F({context:t,attributes:o})}function j(t,e,i,n,a,r,o,s,l,c,h,u){c&&i&&(i[Z("0xaf")]=o,i[Z("0xfa")]=a,i[Z("0xf7")]=r,i[Z("0x103")]=x(s,t[Z("0x14f")][Z("0x17b")]),i[Z("0x103")][Z("0x19c")]=function(){return-1},i[Z("0x19d")]=h,i[Z("0x140")]=l,t[Z("0x177")][Z("0x4c")](i)),e[Z("0xaf")]=o,e[Z("0xfa")]=n,e[Z("0xf7")]=r,e[Z("0x103")]=x(s,t[Z("0x14f")][Z("0x17b")]),u&&(e[Z("0x103")][Z("0x19e")]=function(){return 1}),e[Z("0x19d")]=h,e[Z("0x140")]=l,t[Z("0x177")][Z("0x4c")](e)}t[Z("0x12b")]=h},function(t,e,i){Object[Z("0x1d")](e,Z("0x1e"),{value:!0});var G=tt[Z("0x4e")],P=tt[Z("0x9")],r=tt[Z("0x19f")],W=tt[Z("0x7")],o=tt[Z("0x79")],M=(tt[Z("0x2d")],tt[Z("0x50")]),S=tt[Z("0x6")],V=tt[Z("0x1a0")],R=tt[Z("0x51")],s=tt[Z("0x138")],B=tt[Z("0x5d")],X=tt[Z("0x53")],F=tt[Z("0x1a1")],T=(tt[Z("0xf")],Math[Z("0x66")]),Y=Math[Z("0x65")];function l(t){var e=(t=o(t,o[Z("0x13e")]))[Z("0x114")],i=t[Z("0xed")],n=Math[Z("0x1a2")](o(t[Z("0x1a3")],12)),a=Math[Z("0x1a2")](o(t[Z("0x1a4")],64)),t=(r[Z("0x1a5")][Z("0x1a6")](Z("0x114"),e),r[Z("0x1a5")][Z("0x1a6")](Z("0xed"),i),o(t[Z("0x1a7")],s[Z("0x1a8")]));this[Z("0x113")]=e,this[Z("0x115")]=i,this[Z("0x1a9")]=n,this[Z("0x1aa")]=a,this[Z("0x1ab")]=t}l[Z("0x1ac")]=function(t){var e=(t=o(t,o[Z("0x13e")]))[Z("0x114")],i=t[Z("0xed")],n=t[Z("0x1a3")],a=t[Z("0x1a4")];return r[Z("0x1a5")][Z("0x1a6")](Z("0x114"),e),r[Z("0x1a5")][Z("0x1a6")](Z("0xed"),i),r[Z("0x1a5")][Z("0x1a6")][Z("0x1ad")](Z("0x114"),e,0),r[Z("0x1a5")][Z("0x1a6")][Z("0x1ad")](Z("0x33"),height,0),new l({angle:e,radius:i,stackPartitions:n,slicePartitions:a,vertexFormat:t[Z("0x1a7")]})},l[Z("0x55")]=function(t){console[Z("0xdc")](Z("0x55"));var e,i=t[Z("0x113")],n=t[Z("0x115")],a=t[Z("0x1a9")]+1,r=t[Z("0x1aa")]+1,t=t[Z("0x1ab")],o=new V,s=3*(r-1)+6*(r-1)*(a-2)+3*(r-1),l=a*r,c=F[Z("0x1ae")](l,s),h=new Float64Array(3*l+3*(r-1)*3);if(t[Z("0x3")]){for(var u=0,x=new Array(r),d=new Array(r),p=0;p<r;p++){var g=B[Z("0x1af")]*p/(r-1);x[p]=T(g),d[p]=Y(g),h[u++]=0,h[u++]=0,h[u++]=-n}for(p=1;p<a;p++)for(var m=i*p/(a-1),f=Y(m),v=n*f,b=n*f,y=n*T(m),C=0;C<r;C++)h[u++]=x[C]*v,h[u++]=d[C]*b,h[u++]=-y;for(e=u,p=0;p<r-1;p++)h[u++]=0,h[u++]=0,h[u++]=0,h[u++]=h[e-3*(r-p-1)],h[u++]=h[e-3*(r-p-1)+1],h[u++]=h[e-3*(r-p-1)+2],h[u++]=h[e-3*(r-p)],h[u++]=h[e-3*(r-p)+1],h[u++]=h[e-3*(r-p)+2];o[Z("0x3")]=new S({componentDatatype:W[Z("0x4d")],componentsPerAttribute:3,values:h})}for(var w,I,_=0,C=0;C<r-1;C++)c[_++]=r+C,c[_++]=r+C+1,c[_++]=C+1;for(p=1;p<a-1;p++)for(w=p*r,I=(p+1)*r,C=0;C<r-1;C++)c[_++]=I+C,c[_++]=I+C+1,c[_++]=w+C+1,c[_++]=I+C,c[_++]=w+C+1,c[_++]=w+C;for(var p=0,A=3*(r-1);p<A;p++)c[_++]=p+e/3;s=new M({attributes:o,indices:c,primitiveType:R[Z("0x52")],boundingSphere:new G(P[Z("0x56")],n)}),s=X[Z("0x54")](s);return console[Z("0x1b0")](Z("0x55")),s},e[Z("0x1b1")]=l},function(t,e,i){Object[Z("0x1d")](e,Z("0x1e"),{value:!0});var w=tt[Z("0x4e")],I=tt[Z("0x9")],_=tt[Z("0x7")],r=tt[Z("0x79")],o=(tt[Z("0x2d")],tt[Z("0x134")]),A=(tt[Z("0xf")],tt[Z("0x50")]),G=tt[Z("0x6")],P=tt[Z("0x1a0")],W=tt[Z("0x1a1")],M=tt[Z("0x5d")],S=tt[Z("0x51")],V=(new I(1,1,1),Math[Z("0x66")]),R=Math[Z("0x65")];function n(t){var e=(t=r(t,r[Z("0x13e")]))[Z("0x114")],i=t[Z("0xed")],n=Math[Z("0x1a2")](r(t[Z("0x1a3")],10)),a=Math[Z("0x1a2")](r(t[Z("0x1a4")],8)),t=Math[Z("0x1a2")](r(t[Z("0x1b2")],128));if(n<1)throw new o(Z("0x1b3"));if(a<0)throw new o(Z("0x1b4"));if(t<0)throw new o(Z("0x1b5"));this[Z("0x113")]=e,this[Z("0x115")]=i,this[Z("0x1a9")]=n,this[Z("0x1aa")]=a,this[Z("0x1b6")]=t}n[Z("0x55")]=function(t){var e=t[Z("0x113")],i=t[Z("0x115")];if(!(i<=0||e<=0)){for(var n,a,r,o,s=t[Z("0x1a9")],l=t[Z("0x1aa")],c=t[Z("0x1b6")],t=c*(s+l-1),h=t-l+2,u=new Float64Array(3*h),x=W[Z("0x1ae")](h,2*t),d=0,p=new Array(c),g=new Array(c),m=0;m<c;m++)n=M[Z("0x1af")]*m/c,p[m]=V(n),g[m]=R(n);for(m=1;m<s;m++)for(r=V(a=e*m/(s-1)),o=R(a),v=0;v<c;v++)u[d++]=i*p[v]*o,u[d++]=i*g[v]*o,u[d++]=-i*r;for(p[Z("0x2")]=l,g[Z("0x2")]=l,m=0;m<l;m++)n=M[Z("0x1af")]*m/l,p[m]=V(n),g[m]=R(n);for(u[d++]=0,u[d++]=0,u[d++]=-i,m=1;m<c;m++)for(r=V(a=e*m/c),o=R(a),v=0;v<l;v++)u[d++]=i*p[v]*o,u[d++]=i*g[v]*o,u[d++]=-i*r;for(m=d=0;m<s-1;++m){for(var f=m*c,v=0;v<c-1;++v)x[d++]=f+v,x[d++]=f+v+1;x[d++]=f+c-1,x[d++]=f}var b=c*(s-1);for(v=1;v<l+1;++v)x[d++]=b,x[d++]=b+v;for(m=0;m<c-2;++m){var y=m*l+1+b,C=(m+1)*l+1+b;for(v=0;v<l-1;++v)x[d++]=C+v,x[d++]=y+v;x[d++]=C+l-1,x[d++]=y+l-1}h=new P({position:new G({componentDatatype:_[Z("0x4d")],componentsPerAttribute:3,values:u})});return new A({attributes:h,indices:x,primitiveType:S[Z("0x59")],boundingSphere:new w(I[Z("0x56")],i)})}},e[Z("0x1b7")]=n},function(t,e,i){Object[Z("0x1d")](e,Z("0x1e"),{value:!0});var n=tt[Z("0x79")],a=tt[Z("0x2d")],r=Object[Z("0xa3")],o=tt[Z("0x134")],s=tt[Z("0x1b8")],l=tt[Z("0x1b9")],c=tt[Z("0x1ba")];function h(t){this[Z("0x113")]=void 0,this[Z("0x1bb")]=void 0,this[Z("0x115")]=void 0,this[Z("0x1bc")]=void 0,this[Z("0x1bd")]=void 0,this[Z("0x1be")]=void 0,this[Z("0x1bf")]=void 0,this[Z("0x1c0")]=void 0,this[Z("0x1c1")]=void 0,this[Z("0x1c2")]=void 0,this[Z("0x78")]=void 0,this[Z("0x1c3")]=void 0,this[Z("0x1c4")]=void 0,this[Z("0x1c5")]=void 0,this[Z("0x1c1")]=void 0,this[Z("0x1c2")]=void 0,this[Z("0x14f")]=void 0,this[Z("0x1c6")]=void 0,this[Z("0x7b")]=void 0,this[Z("0x1c7")]=void 0,this[Z("0x1c8")]=void 0,this[Z("0x1c9")]=void 0,this[Z("0x1ca")]=void 0,this[Z("0x1cb")]=void 0,this[Z("0x1cc")]=void 0,this[Z("0x1cd")]=void 0,this[Z("0x1ce")]=void 0,this[Z("0x1cf")]=void 0,this[Z("0x1d0")]=new s,this[Z("0x1d1")]=void 0,this[Z("0x1d2")]=void 0,this[Z("0x1d3")](n(t,n[Z("0x13e")]))}r(h[Z("0xa4")],{definitionChanged:{get:function(){return this[Z("0x1d0")]}},show:c(Z("0x7a")),angle:c(Z("0x114")),radius:c(Z("0xed")),stack:c(Z("0x1d4")),slice:c(Z("0x13f")),color:c(Z("0x82")),material:l(Z("0x14c")),fill:c(Z("0x1d5")),outline:c(Z("0x7c")),outlineColor:c(Z("0x1d6")),outlineWidth:c(Z("0x1d7")),shadows:c(Z("0x1d8")),distanceDisplayCondition:c(Z("0x1d9"))}),h[Z("0xa4")][Z("0x57")]=function(t){return a(t)?(t[Z("0x114")]=this[Z("0x114")],t[Z("0xed")]=this[Z("0xed")],t[Z("0x1d4")]=this[Z("0x1d4")],t[Z("0x13f")]=this[Z("0x13f")],t[Z("0x7a")]=this[Z("0x7a")],t[Z("0x14c")]=this[Z("0x14c")],t[Z("0x82")]=this[Z("0x82")],t[Z("0x1d5")]=this[Z("0x1d5")],t[Z("0x7c")]=this[Z("0x7c")],t[Z("0x1d6")]=this[Z("0x1d6")],t[Z("0x1d7")]=this[Z("0x1d7")],t[Z("0x1d8")]=this[Z("0x1d8")],t[Z("0x1d9")]=this[Z("0x1d9")],t[Z("0x1da")]=this[Z("0x1da")],t):new h(this)},h[Z("0xa4")][Z("0x1d3")]=function(t){if(!a(t))throw new o(Z("0x1db"));this[Z("0x114")]=n(this[Z("0x114")],t[Z("0x114")]),this[Z("0xed")]=n(this[Z("0xed")],t[Z("0xed")]),this[Z("0x1d4")]=n(this[Z("0x1d4")],t[Z("0x1d4")]),this[Z("0x13f")]=n(this[Z("0x13f")],t[Z("0x13f")]),this[Z("0x7a")]=n(this[Z("0x7a")],t[Z("0x7a")]),this[Z("0x82")]=n(this[Z("0x82")],t[Z("0x82")]),this[Z("0x14c")]=n(this[Z("0x14c")],t[Z("0x14c")]),this[Z("0x1d5")]=n(this[Z("0x1d5")],t[Z("0x1d5")]),this[Z("0x7c")]=n(this[Z("0x7c")],t[Z("0x7c")]),this[Z("0x1d6")]=n(this[Z("0x1d6")],t[Z("0x1d6")]),this[Z("0x1d7")]=n(this[Z("0x1d7")],t[Z("0x1d7")]),this[Z("0x1d8")]=n(this[Z("0x1d8")],t[Z("0x1d8")]),this[Z("0x1d9")]=n(this[Z("0x1d9")],t[Z("0x1d9")]),this[Z("0x1da")]=n(this[Z("0x1da")],t[Z("0x1da")])},e[Z("0x1dc")]=h},function(t,e,i){Object[Z("0x1d")](e,Z("0x1e"),{value:!0});var n=i(5);Object[Z("0x1dd")](n)[Z("0xae")](function(t){t!==Z("0x131")&&t!==Z("0x1e")&&Object[Z("0x1d")](e,t,{enumerable:!0,get:function(){return n[t]}})})},function(t,e,i){var n=i(0),a=i(10),r=i(11),o=i(1),s=i(2),l=i(3),i=i(12),n=(tt.Scene[Z("0x12b")]=n[Z("0x12b")],tt.Scene[Z("0x1de")]=a[Z("0x1de")],tt.Scene[Z("0x1df")]=r[Z("0x1df")],tt.Scene[Z("0x1b1")]=o[Z("0x1b1")],tt.Scene[Z("0x1b7")]=s[Z("0x1b7")],tt.Scene[Z("0x1dc")]=l[Z("0x1dc")],tt.Scene[Z("0x1e0")]=i[Z("0x1e0")],tt[Z("0x1e1")]),c=n[Z("0x1e2")];n[Z("0x1e2")]=function(t,e,i){var n=i[Z("0xab")];return c(t,e,i)[Z("0x18e")]([new r[Z("0x1df")](t,n)])}},function(t,e){t[Z("0x12d")]=Z("0x1e3")},function(t,e){t[Z("0x12d")]=Z("0x1e4")},function(t,e){t[Z("0x12d")]=Z("0x1e5")},function(t,e){t[Z("0x12d")]=Z("0x1e6")},function(t,e,i){Object[Z("0x1d")](e,Z("0x1e"),{value:!0});var n=tt[Z("0x79")],a=tt[Z("0x2d")],r=Object[Z("0xa3")],o=tt[Z("0x134")],s=tt[Z("0x1b8")],l=tt[Z("0x1b9")],c=tt[Z("0x1ba")];function h(t){this[Z("0x78")]=void 0,this[Z("0x115")]=void 0,this[Z("0x145")]=void 0,this[Z("0x147")]=void 0,this[Z("0x1e7")]=void 0,this[Z("0x1e8")]=void 0,this[Z("0x1e9")]=void 0,this[Z("0x1ea")]=void 0,this[Z("0x14f")]=void 0,this[Z("0x1eb")]=void 0,this[Z("0x1ec")]=void 0,this[Z("0x1ed")]=void 0,this[Z("0x1ee")]=void 0,this[Z("0x1ef")]=void 0,this[Z("0x15c")]=void 0,this[Z("0x1d1")]=void 0,this[Z("0x1f0")]=void 0,this[Z("0x1f1")]=void 0,this[Z("0x1f2")]=void 0,this[Z("0x1f3")]=void 0,this[Z("0x1d0")]=new s,this[Z("0x1d3")](n(t,n[Z("0x13e")]))}r(h[Z("0xa4")],{definitionChanged:{get:function(){return this[Z("0x1d0")]}},show:c(Z("0x7a")),radius:c(Z("0xed")),xHalfAngle:c(Z("0x144")),yHalfAngle:c(Z("0x146")),lineColor:c(Z("0x86")),showSectorLines:c(Z("0x149")),showSectorSegmentLines:c(Z("0x14a")),showLateralSurfaces:c(Z("0x14b")),material:l(Z("0x14c")),showDomeSurfaces:c(Z("0x154")),showDomeLines:c(Z("0x1f4")),showIntersection:c(Z("0x158")),intersectionColor:c(Z("0x159")),intersectionWidth:c(Z("0x15a")),showThroughEllipsoid:c(Z("0x15b")),gaze:c(Z("0x1da")),showScanPlane:c(Z("0x15d")),scanPlaneColor:c(Z("0x15e")),scanPlaneMode:c(Z("0x15f")),scanPlaneRate:c(Z("0x161"))}),h[Z("0xa4")][Z("0x57")]=function(t){return(t=a(t)?t:new h)[Z("0x7a")]=this[Z("0x7a")],t[Z("0xed")]=this[Z("0xed")],t[Z("0x144")]=this[Z("0x144")],t[Z("0x146")]=this[Z("0x146")],t[Z("0x86")]=this[Z("0x86")],t[Z("0x149")]=this[Z("0x149")],t[Z("0x14a")]=this[Z("0x14a")],t[Z("0x14b")]=this[Z("0x14b")],t[Z("0x14c")]=this[Z("0x14c")],t[Z("0x154")]=this[Z("0x154")],t[Z("0x157")]=this[Z("0x157")],t[Z("0x158")]=this[Z("0x158")],t[Z("0x159")]=this[Z("0x159")],t[Z("0x15a")]=this[Z("0x15a")],t[Z("0x15b")]=this[Z("0x15b")],t[Z("0x1da")]=this[Z("0x1da")],t[Z("0x15d")]=this[Z("0x15d")],t[Z("0x15e")]=this[Z("0x15e")],t[Z("0x15f")]=this[Z("0x15f")],t[Z("0x161")]=this[Z("0x161")],t},h[Z("0xa4")][Z("0x1d3")]=function(t){if(!a(t))throw new o(Z("0x1db"));this[Z("0x7a")]=n(this[Z("0x7a")],t[Z("0x7a")]),this[Z("0xed")]=n(this[Z("0xed")],t[Z("0xed")]),this[Z("0x144")]=n(this[Z("0x144")],t[Z("0x144")]),this[Z("0x146")]=n(this[Z("0x146")],t[Z("0x146")]),this[Z("0x86")]=n(this[Z("0x86")],t[Z("0x86")]),this[Z("0x149")]=n(this[Z("0x149")],t[Z("0x149")]),this[Z("0x14a")]=n(this[Z("0x14a")],t[Z("0x14a")]),this[Z("0x14b")]=n(this[Z("0x14b")],t[Z("0x14b")]),this[Z("0x14c")]=n(this[Z("0x14c")],t[Z("0x14c")]),this[Z("0x154")]=n(this[Z("0x154")],t[Z("0x154")]),this[Z("0x157")]=n(this[Z("0x157")],t[Z("0x157")]),this[Z("0x158")]=n(this[Z("0x158")],t[Z("0x158")]),this[Z("0x159")]=n(this[Z("0x159")],t[Z("0x159")]),this[Z("0x15a")]=n(this[Z("0x15a")],t[Z("0x15a")]),this[Z("0x15b")]=n(this[Z("0x15b")],t[Z("0x15b")]),this[Z("0x1da")]=n(this[Z("0x1da")],t[Z("0x1da")]),this[Z("0x15d")]=n(this[Z("0x15d")],t[Z("0x15d")]),this[Z("0x15e")]=n(this[Z("0x15e")],t[Z("0x15e")]),this[Z("0x15f")]=n(this[Z("0x15f")],t[Z("0x15f")]),this[Z("0x161")]=n(this[Z("0x161")],t[Z("0x161")])},e[Z("0x1de")]=h},function(t,e,i){Object[Z("0x1d")](e,Z("0x1e"),{value:!0}),e[Z("0x1df")]=void 0;var v=i(0),n=tt[Z("0x1f5")],b=tt[Z("0x9")],y=tt[Z("0x83")],C=tt[Z("0x2d")],a=tt[Z("0x133")],w=tt[Z("0x134")],I=tt[Z("0x22")],_=tt[Z("0x11")],A=tt[Z("0x29")],G=tt[Z("0x1f6")],P=tt[Z("0xc2")],W=new I,M=(new _,new b),S=new b,V=new A,R=new b,B=new A;function c(t,e,i){var n=e[t.id];C(n)&&(n=n[Z("0x2f")],i[Z("0xd2")](n),n[Z("0x1f7")]()||n[Z("0xb0")](),delete e[t.id])}function r(t,e){if(!C(t))throw new w(Z("0x1f8"));if(!C(e))throw new w(Z("0x1f9"));e[Z("0x1fa")][Z("0x1fb")](r[Z("0xa4")][Z("0x1fc")],this),this[Z("0x1fd")]=t,this[Z("0x1fe")]=t[Z("0x9d")],this[Z("0x1ff")]=e,this[Z("0x200")]={},this[Z("0x201")]=new n,this[Z("0x1fc")](e,e[Z("0x4")],[],[])}r[Z("0xa4")][Z("0xdb")]=function(t){if(!C(t))throw new w(Z("0x202"));for(var e=this[Z("0x201")][Z("0x4")],i=this[Z("0x200")],n=this[Z("0x1fe")],a=0,r=e[Z("0x2")];a<r;a++){var o,s,l,c=e[a],h=c[Z("0x203")],u=i[c.id],x=c[Z("0x204")]&&c[Z("0x205")](t)&&P[Z("0x206")](h[Z("0x78")],t,!0);if(x&&(o=P[Z("0xc3")](c[Z("0x74")],t,M),m=P[Z("0xc3")](c[Z("0x207")],t,V),f=P[Z("0xc3")](h[Z("0x115")],t),s=P[Z("0xc3")](h[Z("0x145")],t),l=P[Z("0xc3")](h[Z("0x147")],t),x=C(o)&&C(s)&&C(l)),x){x=C(u)?u[Z("0x2f")]:void 0,c=(C(x)||((x=new v[Z("0x12b")]).id=c,n[Z("0x9e")](x),i[c.id]=u={primitive:x,position:void 0,orientation:void 0}),P[Z("0xc3")](h[Z("0x1d1")],t));if(C(c)){var d=P[Z("0xc3")](c[Z("0x74")],t,S);if(!C(o)||!C(d))continue;var p=b[Z("0xb")](o,d,R),g=b[Z("0x208")](tt[Z("0x9")][Z("0x209")],p),p=b[Z("0xc")](tt[Z("0x9")][Z("0x209")],p,R),m=A[Z("0x20a")](p,g-Math.PI,B),f=b[Z("0x11d")](o,d);x[Z("0x140")]=_[Z("0x21")](I[Z("0x23")](m,W),o,x[Z("0x140")])}else b[Z("0xba")](o,u[Z("0x3")])&&A[Z("0xba")](m,u[Z("0xc1")])||(C(m)?(x[Z("0x140")]=_[Z("0x21")](I[Z("0x23")](m,W),o,x[Z("0x140")]),u[Z("0x3")]=b[Z("0x57")](o,u[Z("0x3")]),u[Z("0xc1")]=A[Z("0x57")](m,u[Z("0xc1")])):(x[Z("0x140")]=tt[Z("0x24")][Z("0x25")](o),u[Z("0x3")]=b[Z("0x57")](o,u[Z("0x3")])));x[Z("0x7a")]=!0,x[Z("0x1da")]=c,x[Z("0xed")]=f,x[Z("0x144")]=s,x[Z("0x146")]=l,x[Z("0x86")]=P[Z("0x206")](h[Z("0x1e7")],t,y[Z("0x148")]),x[Z("0x149")]=P[Z("0x206")](h[Z("0x1e8")],t,!0),x[Z("0x14a")]=P[Z("0x206")](h[Z("0x1e9")],t,!0),x[Z("0x14b")]=P[Z("0x206")](h[Z("0x1ea")],t,!0),x[Z("0x14c")]=G[Z("0xbf")](t,h[Z("0x14f")],x[Z("0x14c")]),x[Z("0x154")]=P[Z("0x206")](h[Z("0x1eb")],t,!0),x[Z("0x157")]=P[Z("0x206")](h[Z("0x1ec")],t,!0),x[Z("0x158")]=P[Z("0x206")](h[Z("0x1ed")],t,!0),x[Z("0x159")]=P[Z("0x206")](h[Z("0x1ee")],t,y[Z("0x148")]),x[Z("0x15a")]=P[Z("0x206")](h[Z("0x1ef")],t,1),x[Z("0x15b")]=P[Z("0x206")](h[Z("0x15c")],t,!0),x[Z("0x15f")]=P[Z("0x206")](h[Z("0x1f2")],t),x[Z("0x15e")]=P[Z("0x206")](h[Z("0x1f1")],t,y[Z("0x148")]),x[Z("0x15d")]=P[Z("0x206")](h[Z("0x1f0")],t,!0),x[Z("0x161")]=P[Z("0x206")](h[Z("0x1f3")],t,1)}else C(u)&&(u[Z("0x2f")][Z("0x7a")]=!1)}return!0},r[Z("0xa4")][Z("0x1f7")]=function(){return!1},r[Z("0xa4")][Z("0xb0")]=function(){for(var t=this[Z("0x201")][Z("0x4")],e=this[Z("0x200")],i=this[Z("0x1fe")],n=t[Z("0x2")]-1;-1<n;n--)c(t[n],e,i);return a(this)},r[Z("0xa4")][Z("0x1fc")]=function(t,e,i,n){for(var a,r=this[Z("0x201")],o=this[Z("0x200")],s=this[Z("0x1fe")],l=e[Z("0x2")]-1;-1<l;l--)a=e[l],C(a[Z("0x203")])&&C(a[Z("0x74")])&&r[Z("0x20b")](a.id,a);for(l=n[Z("0x2")]-1;-1<l;l--)a=n[l],C(a[Z("0x203")])&&C(a[Z("0x74")])?r[Z("0x20b")](a.id,a):(c(a,o,s),r[Z("0xd2")](a.id));for(l=i[Z("0x2")]-1;-1<l;l--)c(a=i[l],o,s),r[Z("0xd2")](a.id)},e[Z("0x1df")]=r},function(t,e,i){Object[Z("0x1d")](e,Z("0x1e"),{value:!0}),e[Z("0x1e0")]=void 0;var y=i(1),C=i(2),n=i(13),w=(tt[Z("0x79")],tt[Z("0x2d")]),I=(tt[Z("0x20c")],tt[Z("0x24")]),a=tt[Z("0x134")],_=(tt[Z("0x20d")],tt[Z("0x83")]),A=tt[Z("0x20e")],G=tt[Z("0x20f")],P=tt[Z("0x9")],W=(tt[Z("0x138")],tt[Z("0x29")]),M=tt[Z("0x22")],S=tt[Z("0x11")],V=tt[Z("0xc2")];function r(t){var e=this;if(!w(t))throw new a(Z("0x212"));var i=(this[Z("0x213")]=t)[Z("0x6a")],t=(this[Z("0x1fd")]=i,t[Z("0x214")]);this[Z("0x215")]=t,this[Z("0x1fe")]=i[Z("0x9d")],this[Z("0x216")]=void 0,this[Z("0x217")]=void 0,this[Z("0x218")]=[],t[Z("0x219")][Z("0x1fb")](function(){e[Z("0xdb")]()})}tt[Z("0x1b8")],tt[Z("0x210")],tt[Z("0x211")];var R=new M,B=new S,X=new P,F=new P,T=new P,Y=new W;r[Z("0xa4")][Z("0x9e")]=function(t){return t instanceof n[Z("0x21a")]||(t=new n[Z("0x21a")](t)),this[Z("0x218")][Z("0x4c")](t),t},r[Z("0xa4")][Z("0xd2")]=function(t){t=this[Z("0x218")][Z("0x21b")](t);-1!==t&&this[Z("0x218")][Z("0xdd")](t,1)},r[Z("0xa4")][Z("0x21c")]=function(){this[Z("0x218")][Z("0x2")]=0},r[Z("0xa4")][Z("0xdb")]=function(){var t=this[Z("0x215")][Z("0x21d")],e=this[Z("0x218")],i=this[Z("0x1fe")],n=this[Z("0x216")],a=this[Z("0x217")],r=[],o=[];w(n)&&i[Z("0x21e")](n),w(a)&&i[Z("0x21e")](a);for(var s=0,l=e[Z("0x2")];s<l;s++){var c=e[s],h=c[Z("0x21f")];if(V[Z("0x206")](h[Z("0x7a")],t,!0)){var u=h[Z("0x114")],x=h[Z("0xed")],d=h[Z("0x1d4")],p=h[Z("0x13f")];if(w(u)&&V[Z("0x206")](c[Z("0x7a")],t,!0)){var g=V[Z("0xc3")](c[Z("0x3")],t,X);if(w(g)){var m,f=h[Z("0x1da")];if(w(f)){var f=V[Z("0xc3")](f[Z("0x3")],t,F);if(!w(g)||!w(f))continue;var v=P[Z("0xb")](g,f,T),b=P[Z("0x208")](tt[Z("0x9")][Z("0x209")],v),v=P[Z("0xc")](tt[Z("0x9")][Z("0x209")],v,T),v=W[Z("0x20a")](v,b,Y),b=P[Z("0x11d")](g,f),x=1,b=S[Z("0x21")](tt[Z("0x22")][Z("0x220")](M[Z("0x23")](v,R),b,R),g,B)}else v=V[Z("0xc3")](c[Z("0xc1")],t,Y),b=w(v)?S[Z("0x21")](M[Z("0x23")](v,R),g,B):I[Z("0x25")](g,void 0,B);w(b)&&(f=c[Z("0x6b")],w(f)||(g=new y[Z("0x1b1")]({vertexFormat:tt[Z("0x138")][Z("0x221")],angle:u,radius:x,stackPartitions:d,slicePartitions:p}),c[Z("0x6b")]=y[Z("0x1b1")][Z("0x55")](g),f=c[Z("0x6b")]),d=h[Z("0x82")],p=h[Z("0x7c")],m=h[Z("0x1d7")],w(m)||(m=1),g=h[Z("0x1d6")],w(g)||(g=_[Z("0x148")]),h=new tt[Z("0x222")]({geometry:f,modelMatrix:b,attributes:{color:tt[Z("0x20d")][Z("0x223")](d)}}),r[Z("0x4c")](h),p)&&(f=c[Z("0xd3")],w(f)||(d=new C[Z("0x1b7")]({vertexFormat:tt[Z("0x138")][Z("0x192")],angle:u,radius:x}),c[Z("0xd3")]=C[Z("0x1b7")][Z("0x55")](d),f=c[Z("0xd3")]),h=new tt[Z("0x222")]({geometry:f,modelMatrix:b,attributes:{color:tt[Z("0x20d")][Z("0x223")](g)}}),o[Z("0x4c")](h))}}}}0<r[Z("0x2")]&&(this[Z("0x216")]=this[Z("0x1fe")][Z("0x9e")](new A({asynchronous:!1,geometryInstances:r,appearance:new G({flat:!1,translucent:!0,closed:!0})}))),0<o[Z("0x2")]&&(this[Z("0x217")]=this[Z("0x1fe")][Z("0x9e")](new A({asynchronous:!1,geometryInstances:o,appearance:new G({flat:!0,translucent:!0,renderState:{lineWidth:this[Z("0x1fd")][Z("0x224")](m)}})})))},e[Z("0x1e0")]=r},function(t,e,i){Object[Z("0x1d")](e,Z("0x1e"),{value:!0}),e[Z("0x21a")]=void 0;var n=i(3),a=tt[Z("0x225")],r=tt[Z("0x1b8")],o=tt[Z("0x226")],i=tt[Z("0x1ba")],s=tt[Z("0x210")];function l(t){t=t||{},this[Z("0x74")]=void 0,this[Z("0x207")]=void 0,this[Z("0x78")]=void 0;var e=t[Z("0x227")];e instanceof n[Z("0x1dc")]||(e=new n[Z("0x1dc")](e)),this[Z("0x21f")]=e,this[Z("0x1ce")]=new s,this[Z("0x6b")]=void 0,this[Z("0xd3")]=void 0,this[Z("0x1d0")]=new r,this[Z("0x1d3")](t)}tt[Z("0x211")],Object[Z("0xa3")](l[Z("0xa4")],{position:i(Z("0x3"),void 0,function(t){return new o(t)}),orientation:i(Z("0xc1")),show:i(Z("0x7a"))}),l[Z("0xa4")][Z("0x1d3")]=function(t){this[Z("0x3")]=t[Z("0x3")],this[Z("0xc1")]=t[Z("0xc1")],this[Z("0x7a")]=t[Z("0x7a")]},l[Z("0xa4")][Z("0x228")]=function(t){t instanceof a&&(this[Z("0x21f")][Z("0x1da")]=t)},e[Z("0x21a")]=l}],a={},n.m=i,n.c=a,n.d=function(t,e,i){n.o(t,e)||Object[Z("0x1d")](t,e,{configurable:!1,enumerable:!0,get:i})},n.n=function(t){var e=t&&t[Z("0x1e")]?function(){return t[Z("0x131")]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object[Z("0xa4")][Z("0xa0")][Z("0x130")](t,e)},n.p="",n(n.s=4);function n(t){var e;return(a[t]||(e=a[t]={i:t,l:!1,exports:{}},i[t][Z("0x130")](e[Z("0x12d")],e,e[Z("0x12d")],n),e.l=!0,e))[Z("0x12d")]}var i,a},typeof exports===Z("0x12c")&&typeof module===Z("0x12c")?module[Z("0x12d")]=e():typeof define===Z("0xbe")&&define[Z("0x12e")]?define([],e):typeof exports===Z("0x12c")?exports[Z("0x12f")]=e():t[Z("0x12f")]=e())}(),t[Z("0x256")]=!0};let R=null;function X(t,e){t&&(this._viewer=t,R=e,new V(Window,R),this._customPluginLayer=new R.CustomDataSource("_customPluginLayer"),t)&&t.dataSources.add(this._customPluginLayer)}X.prototype={createRectangularSensorGraphics:function(t){var e,i;if(this._customPluginLayer&&t)return e=new R.HeadingPitchRoll(R.Math.toRadians(t.heading||90),R.Math.toRadians(t.pitch||0),R.Math.toRadians(t.roll||0)),i=t.position,this._customPluginLayer.entities.add({position:i,orientation:R.Transforms.headingPitchRollQuaternion(i,e),rectangularSensor:new R.Scene.RectangularSensorGraphics({radius:t.radius||1e5,xHalfAngle:R.Math.toRadians(t.xHalfAngle||45),yHalfAngle:R.Math.toRadians(t.yHalfAngle||45),material:t.material||new R.Color(1,0,1,.4),lineColor:t.lineColor||new R.Color(1,0,1,1),showScanPlane:t.showScanPlane||!0,scanPlaneColor:t.scanPlaneColor||new R.Color(1,0,1,1),scanPlaneMode:t.scanPlaneMode||"vertical",scanPlaneRate:t.scanPlaneRate||3,showThroughEllipsoid:t.showThroughEllipsoid||!1,show:!0})})},createSatelliteCoverageSimulationGraphics:function(t){if(t)return new R.Scene.SatelliteCoverageSimulation(this._viewer,{position:t.position,angle1:t.angle1||30,angle2:t.angle2||45,areaType:t.areaType||2,rotation:{heading:R.Math.toRadians(t.heading||0),pitch:R.Math.toRadians(t.pitch||0),roll:R.Math.toRadians(t.roll||0)},color:t.color||{red:.43137254901960786,green:.9607843137254902,blue:0,alpha:.8}})},createRadarPrimitive:function(t){if(t)return new R.Scene.RadarPrimitiveRight(this._viewer,{position:t.position,angle:t.angle||80,radius:t.radius||7e5,rotation:{heading:R.Math.toRadians(t.heading||0),pitch:R.Math.toRadians(t.pitch||40),roll:R.Math.toRadians(t.roll||0)},color:t.color||{red:1,green:0,blue:0,alpha:.4},lineColor:t.lineColor||{red:1,green:1,blue:1,alpha:.9}})}};let F,T,B=null,D={},N="move",k=null;function E(t,e){t&&(this._viewer=t,k=t,B=e,this._installFileDragDropHandler())}E.prototype={_installFileDragDropHandler(){function i(t,e){var i=document.createElement("div");i.id="fileDragDrop",i.classList.add("filedragdrop"),i.innerHTML="请将Json文件拖拽到此区域",this._dragBox=i,this._viewer=e,(this._parentDiv=t).appendChild(i),this.fileDragDropCallBack=void 0,this.callBackParms=void 0}i.prototype.startuploadfile=function(){var i=this,t=i._dragBox,e=null;document.ondragover=function(){clearTimeout(e),e=setTimeout(function(){t.innerHTML="请将文件拖拽到此区域"},200)},t.ondragenter=function(){t.innerHTML="请释放鼠标"},t.ondragover=function(){return!1},t.ondragleave=function(){t.innerHTML="请将文件拖拽到此区域"},t.ondrop=function(t){t.preventDefault();var t=t.dataTransfer.files[0],e=new FileReader;return e.readAsText(t,"UTF-8"),e.onload=function(){var t=JSON.parse(this.result);i.fileDragDropCallBack&&i.fileDragDropCallBack(i.callBackParms,t,i._viewer)},e.onloadstart=function(){},e.onloadend=function(){},e.onabort=function(){alert("读取数据中断")},!(e.onerror=function(){alert("读取数据失败")})}},B.Scene.FileDragDropMixin=function(t){var e=new i(document.querySelector(".cesium-viewer"),t);Object.defineProperties(t,{fileDragDropMixin:{get:function(){return e}}})}},showLoadDataToScenePanel(t){if(t=t||{}){let t=new n,a=this._viewer,e=t.addFolder("加载数据文件"),i=t=>{let e=document.createElement("input");e.type="file",e.className="datgui_upload",e.onchange=function(){"function"==typeof t&&e.files.length&&t(URL.createObjectURL(e.files[0]))},document.getElementsByTagName("body")&&document.getElementsByTagName("body")[0].appendChild(e),e.click()},r={point:()=>{i(t=>{B.GeoJsonDataSource.load(t).then(function(t){a.dataSources.add(t);for(var e=t.entities.values,i=0;i<e.length;i++){var n=e[i];n.nameID=i,n.point={color:B.Color.BLUE}}a.flyTo(t)})})},polyline:()=>{i(t=>{B.GeoJsonDataSource.load(t).then(function(t){a.dataSources.add(t);for(var e=t.entities.values,i=0;i<e.length;i++){var n=e[i];n.nameID=i,n.polyline.width=5,n.polyline.material=new B.PolylineGlowMaterialProperty({glowPower:.1,color:B.Color.ORANGERED.withAlpha(.9)})}a.flyTo(t)})})},polygon:()=>{i(t=>{B.GeoJsonDataSource.load(t).then(function(t){a.dataSources.add(t);for(var e=t.entities.values,i=0;i<e.length;i++){var n=e[i];n.nameID=i,n.polygon.width=10,n.polygon.material=B.Color.BLUE.withAlpha(.9)}a.flyTo(t)})})},model:()=>{i(t=>{a.flyTo(d3kit.createModelGraphics({position:B.Cartesian3.fromDegrees(120.38105869,31.10115627),m_url:t}))})},czml:()=>{i(t=>{a.flyTo(a.dataSources.add(B.CzmlDataSource.load(t)))})},"3dtilset":()=>{i(t=>{a.flyTo(a.scene.primitives.add(new B.Cesium3DTileset({url:t})))})}};e.add(r,"point"),e.add(r,"polyline"),e.add(r,"polygon"),e.add(r,"model"),e.add(r,"czml"),e.add(r,"3dtilset"),e.open()}},showPostProcessStagesPanel(t){t=t||{};let e=null,i=new function(){this.blackAndWhiteShow=!1,this.blackAndWhiteGradations=5,this.brightnessShow=!1,this.brightnessValue=.5,this.nightVisionShow=!1,this.silhouette=!1},a=(t&&t.elementId?(e=new n({autoPlace:!1}),document.getElementById(t.elementId).appendChild(e.domElement)):e=new n,this._viewer.scene.postProcessStages),r=a.add(B.PostProcessStageLibrary.createSilhouetteStage()),o=a.add(B.PostProcessStageLibrary.createBlackAndWhiteStage()),s=a.add(B.PostProcessStageLibrary.createBrightnessStage()),l=a.add(B.PostProcessStageLibrary.createNightVisionStage());r.uniforms.color=t.silhouetteColor||B.Color.YELLOW,r.enabled=!1,o.enabled=!1,o.uniforms.gradations=5,s.enabled=!1,s.uniforms.brightness=.5,l.enabled=!1,e.add(i,"blackAndWhiteShow").name("blackAndWhiteShow").onChange(function(t){o.enabled=t}),e.add(i,"blackAndWhiteGradations",0,10,.1).name("blackAndWhiteGradations").onChange(function(t){o.uniforms.gradations=t}),e.add(i,"brightnessShow").name("brightnessShow").onChange(function(t){s.enabled=t}),e.add(i,"brightnessValue",0,10,.1).name("brightnessValue").onChange(function(t){s.uniforms.brightness=t}),e.add(i,"nightVisionShow").name("nightVisionShow").onChange(function(t){l.enabled=t}),e.add(i,"silhouette").name("silhouette").onChange(function(t){r.enabled=t})},showSceneBloomPanel(t){let e=null,i=new function(){this.contrast=128,this.brightness=-.3,this.delta=1,this.gamma=3.5,this.enabled=!1,this.highDynamicRange=!1,this.shadows=!1,this.glowOnly=!1,this.sigma=1,this.stepSize=5},a=(t&&t.elementId?(e=new n({autoPlace:!1}),document.getElementById(t.elementId).appendChild(e.domElement)):e=new n,this._viewer),r=(e.__closeButton.innerHTML="收缩面板",a.scene.postProcessStages.bloom);e.add(i,"enabled").name("bloom").onChange(function(t){r.enabled=t}),e.add(i,"glowOnly").name("发光").onChange(function(t){r.uniforms.glowOnly=t}),e.add(i,"enabled").name("启用模糊").onChange(function(t){r.enabled=t}),e.add(i,"contrast",-255,255,.01).name("对比度").onChange(function(t){r.uniforms.contrast=t}),e.add(i,"brightness",-1,1,.01).name("光泽亮度").onChange(function(t){r.uniforms.brightness=t}),e.add(i,"delta",1,5,.01).name("因子").onChange(function(t){r.uniforms.delta=t}),e.add(i,"sigma",1,10,.01).name("sigma").onChange(function(t){r.uniforms.sigma=t}),e.add(i,"stepSize",.1,10).name("stepSize").onChange(function(t){r.uniforms.stepSize=t}),e.add(i,"shadows").name("启用阴影").onChange(function(t){a.shadows=t}),e.add(i,"highDynamicRange").name("高动态范围").onChange(function(t){a.scene.highDynamicRange=t}),e.add(i,"gamma",1,10,.01).name("伽马亮度").onChange(function(t){a.scene.gamma=t})},showPrimitiveMatrixPanel(e){let i=e.primitives._delegate||e.primitives,a=e.primitives,t=(this._viewer,null);e&&e.elementId?(t=new n({autoPlace:!1}),document.getElementById(e.elementId).appendChild(t.domElement)):t=new n;var r=t.addFolder("离地高度"),r=(r.add({height:100},"height",0,1e3,1).onChange(function(t){var e=a.boundingSphere,e=B.Cartographic.fromCartesian(e.center),i=B.Cartesian3.fromRadians(e.longitude,e.latitude,0),e=B.Cartesian3.fromRadians(e.longitude,e.latitude,t),t=B.Cartesian3.subtract(e,i,new B.Cartesian3);a.modelMatrix=B.Matrix4.fromTranslation(t)}),r.open(),t.addFolder("缩放大小")),o={"m+Scale":()=>{i.readyPromise.then(t=>{var e=t.root.transform;B.Matrix4.multiplyByUniformScale(e,1.2,e),t.root.transform=e})},"m-Scale":()=>{i.readyPromise.then(t=>{var e=t.root.transform;B.Matrix4.multiplyByUniformScale(e,.8,e),t.root.transform=e})}},o=(r.add(o,"m+Scale"),r.add(o,"m-Scale"),r.open(),{"x+Axis":()=>{var t=B.Matrix4.fromTranslation(new B.Cartesian3(20,0,0));B.Matrix4.multiply(i.modelMatrix,t,i.modelMatrix)},"x-Axis":()=>{var t=B.Matrix4.fromTranslation(new B.Cartesian3(-20,0,0));B.Matrix4.multiply(i.modelMatrix,t,i.modelMatrix)},"y+Axis":()=>{var t=B.Matrix4.fromTranslation(new B.Cartesian3(0,20,0));B.Matrix4.multiply(i.modelMatrix,t,i.modelMatrix)},"y-Axis":()=>{var t=B.Matrix4.fromTranslation(new B.Cartesian3(0,-20,0));B.Matrix4.multiply(i.modelMatrix,t,i.modelMatrix)},"z+Axis":()=>{var t=B.Matrix4.fromTranslation(new B.Cartesian3(0,0,20));B.Matrix4.multiply(i.modelMatrix,t,i.modelMatrix)},"z-Axis":()=>{var t=B.Matrix4.fromTranslation(new B.Cartesian3(0,0,-20));B.Matrix4.multiply(i.modelMatrix,t,i.modelMatrix)}}),r=t.addFolder("矩阵平移");r.add(o,"x+Axis"),r.add(o,"x-Axis"),r.add(o,"y+Axis"),r.add(o,"y-Axis"),r.add(o,"z+Axis"),r.add(o,"z-Axis"),r.open();let s={x:0,y:0,z:0},l={"x+Axis":()=>{s.x+=15,i.readyPromise.then(t=>{var e=B.Matrix3.fromRotationX(B.Math.toRadians(s.x)),e=B.Matrix4.fromRotationTranslation(e),i=B.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);B.Matrix4.multiply(i,e,i),t._root.transform=i})},"x-Axis":()=>{s.x-=15,i.readyPromise.then(t=>{var e=B.Matrix3.fromRotationX(B.Math.toRadians(s.x)),e=B.Matrix4.fromRotationTranslation(e),i=B.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);B.Matrix4.multiply(i,e,i),t._root.transform=i})},"y+Axis":()=>{s.y+=15,i.readyPromise.then(t=>{var e=B.Matrix3.fromRotationY(B.Math.toRadians(s.y)),e=B.Matrix4.fromRotationTranslation(e),i=B.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);B.Matrix4.multiply(i,e,i),t._root.transform=i})},"y-Axis":()=>{s.y-=15,i.readyPromise.then(t=>{var e=B.Matrix3.fromRotationY(B.Math.toRadians(s.y)),e=B.Matrix4.fromRotationTranslation(e),i=B.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);B.Matrix4.multiply(i,e,i),t._root.transform=i})},"z+Axis":()=>{s.z+=15,i.readyPromise.then(t=>{var e=B.Matrix3.fromRotationZ(B.Math.toRadians(s.z)),e=B.Matrix4.fromRotationTranslation(e),i=B.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);B.Matrix4.multiply(i,e,i),t._root.transform=i})},"z-Axis":()=>{s.z-=15,i.readyPromise.then(t=>{var e=B.Matrix3.fromRotationZ(B.Math.toRadians(s.z)),e=B.Matrix4.fromRotationTranslation(e),i=B.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);B.Matrix4.multiply(i,e,i),t._root.transform=i})}},c=t.addFolder("旋转矩阵");c.add(l,"x+Axis"),c.add(l,"x-Axis"),c.add(l,"y+Axis"),c.add(l,"y-Axis"),c.add(l,"z+Axis"),c.add(l,"z-Axis"),c.open(),e.cb&&((o=t.addFolder("获取调整后的模型矩阵")).add({getModelMaterix:()=>{i.readyPromise.then(t=>{t=t.root.transform;e.cb({modelTransformMatrix:t,modelMatrix:a.modelMatrix})})}},"getModelMaterix").name("获取模型矩阵"),o.open()),t.__closeButton.innerHTML="收缩面板"},showLayerParamPanel:function(e,i){if(e){let t=null;i&&i.elementId?(t=new n({autoPlace:!1}),document.getElementById(i.elementId).appendChild(t.domElement)):t=new n;var i=new function(){this.alpha=e.alpha,this.brightness=e.brightness,this.contrast=e.contrast,this.gamma=e.gamma,this.hue=e.hue,this.dayAlpha=e.dayAlpha,this.nightAlpha=e.nightAlpha,this.saturation=e.saturation},a=t.addFolder("图层调整");a.add(i,"alpha",0,1,.05).name("透明度").onChange(function(t){e.alpha=t}),a.add(i,"brightness",0,5,.05).name("亮度").onChange(function(t){e.brightness=t}),a.add(i,"contrast",0,5,.05).name("对比").onChange(function(t){e.contrast=t}),a.add(i,"gamma",0,5,.05).name("伽马").onChange(function(t){e.gamma=t}),a.add(i,"hue",0,5,.05).name("色调").onChange(function(t){e.hue=t}),a.add(i,"dayAlpha",0,1,.05).name("白天透明").onChange(function(t){e.dayAlpha=t}),a.add(i,"nightAlpha",0,1,.05).name("夜晚透明").onChange(function(t){e.nightAlpha=t}),a.add(i,"saturation",0,5,.05).name("饱和").onChange(function(t){e.saturation=t}),a.open()}},showLayerSwitchPanel:function(e,i){if(e&&e.length){let t=null;i&&i.elementId?(t=new n({autoPlace:!1}),document.getElementById(i.elementId).appendChild(t.domElement)):t=new n;var a=new function(){e.forEach(t=>{this[t.id]=t.show})},r=t.addFolder("图层切换"),o=(e.forEach(e=>{r.add(a,e.id).name(e.name).onChange(function(t){e.show=t})}),new function(){e.forEach(t=>{this[t.id]=t.alpha})}),s=t.addFolder("透明度");e.forEach(e=>{s.add(o,e.id,0,1,.05).name(e.name).onChange(function(t){e.alpha=t})}),r.open(),s.open()}},showSceneEffectEditPanel:function(t){var e,i,a;t=t||{},n&&this._viewer.scene.colorCorrection&&(a=new n,(e=this._viewer).scene.lightSource.ambientLightColor=t.ambientLightColor||new B.Color(.3,.3,.3,1),e.scene.colorCorrection.show=t.colorCorrection||!1,e.scene.colorCorrection.saturation=t.saturation||3.1,e.scene.colorCorrection.brightness=t.brightness||1.8,e.scene.colorCorrection.contrast=t.contrast||1.2,e.scene.colorCorrection.hue=t.hue||0,e.scene.bloomEffect.show=t.bloomEffect||!1,e.scene.hdrEnabled=t.hdrEnabled||!0,e.scene.bloomEffect.threshold=t.threshold||1,e.scene.bloomEffect.bloomIntensity=t.bloomIntensity||2,i=new function(){this.bloomEffectShow=t.bloomEffect||!1,this.bloomThreshold=t.threshold||1,this.bloomIntensity=t.bloomIntensity||2,this.ambientLightColor=t.ambientLightColor||.3,this.hdrEnabled=t.hdrEnabled||!0,this.colorCorrectionShow=!1,this.colorCorrectionSaturation=t.saturation||3.1,this.colorCorrectionBrightness=t.brightness||1.8,this.colorCorrectionContrast=t.contrast||1.2,this.colorCorrectionHue=t.hue||0},a=a.addFolder("场景效果"),console.log("sceneEffect:",i),a.add(i,"bloomEffectShow").name("泛光开关").onChange(function(t){e.scene.bloomEffect.show=t,e.scene.bloomEffect.threshold=i.bloomThreshold,e.scene.bloomEffect.bloomIntensity=i.bloomIntensity}),a.add(i,"bloomThreshold",0,1,.1).name("泛光阈值").onChange(function(t){e.scene.bloomEffect.threshold=t}),a.add(i,"bloomIntensity",0,10,.1).name("泛光强度").onChange(function(t){e.scene.bloomEffect.bloomIntensity=t}),a.add(i,"hdrEnabled").name("HDR开关").onChange(function(t){e.scene.hdrEnabled=t}),a.add(i,"colorCorrectionShow").name("颜色校正").onChange(function(t){e.scene.colorCorrection.show=t}),a.add(i,"colorCorrectionSaturation",0,5,.1).name("饱和度").onChange(function(t){e.scene.colorCorrection.saturation=t}),a.add(i,"colorCorrectionBrightness",0,5,.1).name("亮度").onChange(function(t){e.scene.colorCorrection.brightness=t}),a.add(i,"colorCorrectionContrast",0,5,.1).name("对比度").onChange(function(t){e.scene.colorCorrection.contrast=t}),a.add(i,"colorCorrectionHue",0,5,.1).name("色调").onChange(function(t){e.scene.hdrEnabled=t}),a.add(i,"colorCorrectionHue",0,1,.1).name("环境光").onChange(function(t){e.scene.lightSource.ambientLightColor=new B.Color(t,t,t,1)}),a.open())},showEntityOrientationEditPanel:function(i={}){if(i.entity){let e=i.entity;var t=new n,a=(i&&i.elementId?(t=new n({autoPlace:!1}),document.getElementById(i.elementId).appendChild(t.domElement)):t=new n,new function(){this.heading=360,this.pitch=1,this.roll=1}),t=t.addFolder("实体姿态调整"),r=this;t.add(a,"heading",0,360,1).name("角度").onChange(function(t){a.heading=t;t=B.Transforms.headingPitchRollQuaternion(e.position.getValue(r._viewer.clock.currentTime),new B.HeadingPitchRoll(B.Math.toRadians(a.heading),B.Math.toRadians(a.pitch),B.Math.toRadians(a.roll)));e.orientation=t,i.cb&&i.cb({orientation:t})}),t.add(a,"pitch",0,360,1).name("航向").onChange(function(t){a.pitch=t;t=B.Transforms.headingPitchRollQuaternion(e.position.getValue(r._viewer.clock.currentTime),new B.HeadingPitchRoll(B.Math.toRadians(a.heading),B.Math.toRadians(a.pitch),B.Math.toRadians(a.roll)));e.orientation=t,i.cb&&i.cb({orientation:t})}),t.add(a,"roll",0,360,1).name("翻转").onChange(function(t){a.roll=t;t=B.Transforms.headingPitchRollQuaternion(e.position.getValue(r._viewer.clock.currentTime),new B.HeadingPitchRoll(B.Math.toRadians(a.heading),B.Math.toRadians(a.pitch),B.Math.toRadians(a.roll)));e.orientation=t,i.cb&&i.cb({orientation:t})}),t.open()}},definedMouseEvent({targetEntity:t,ctrlFlag:e}){T=t,D=e,this.bindHandelEvent({leftDown:this.defLeftDown,mouseMove:this.defMouseMove,mouseWheel:this.defMouseWheel,leftUp:this.defLeftUp})},defMouseMove(e){if(D.leftDown&&F){let t=k.camera.getPickRay(e.endPosition),a=k.scene.globe.pick(t,k.scene);if(document.body.style.cursor="pointer",F&&F.id&&"move"===N){let t=B.JulianDate.fromDate(new Date),e=T.position.getValue(t),i=B.Cartographic.fromCartesian(e),n=Number(i.height.toFixed(3));T.position=new B.CallbackProperty(()=>{var t=k.scene.globe.ellipsoid.cartesianToCartographic(a),e=B.Math.toDegrees(t.longitude),t=B.Math.toDegrees(t.latitude);return B.Cartesian3.fromDegrees(e,t,n)},!1)}else{var i,n,r;F&&F.id&&"rotate"===N&&(n=B.JulianDate.fromDate(new Date),n=T.position.getValue(n),r=k.scene.camera.pickEllipsoid(e.startPosition),e=k.scene.camera.pickEllipsoid(e.endPosition),i=B.Cartesian3.subtract(n,e,new B.Cartesian3),i=B.Cartesian3.normalize(i,new B.Cartesian3),r=B.Cartesian3.subtract(r,n,new B.Cartesian3),e=B.Cartesian3.subtract(e,n,new B.Cartesian3),n=B.Cartesian3.angleBetween(r,e),r=B.Quaternion.fromAxisAngle(i,100*n),T.orientation=r)}}},defLeftDown(t){F=k.scene.pick(t.position),B.defined(F)&&N?(D.selected=!0,D.leftDown=!0):D.selected=!1},defMouseWheel(n){if(F&&F.id&&"scale"===N){let t=B.JulianDate.fromDate(new Date),e=T.box.dimensions.getValue(t),i=0<n?2:.5;T.box.dimensions=new B.CallbackProperty(()=>B.Cartesian3.multiplyByScalar(e,i,new B.Cartesian3),!1)}},defLeftUp(t){D.leftDown=!1,document.body.style.cursor="default"},manualMoveModel:function(t){N=t,this._viewer.scene.screenSpaceCameraController.enableRotate=!1,this._viewer.scene.screenSpaceCameraController.enableZoom=!0},manualRotateModel:function(t){N=t,this._viewer.scene.screenSpaceCameraController.enableRotate=!1,this._viewer.scene.screenSpaceCameraController.enableZoom=!0},manualScaleModel:function(t){N=t,this._viewer.scene.screenSpaceCameraController.enableZoom=!1}};let Y=null;function z(t,e,i){t&&(this._viewer=t,Y=e,this._pluginLayer=new Y.CustomDataSource("pluginLayer"),t&&t.dataSources.add(this._pluginLayer),this._installPlugin())}z.prototype={_installPlugin:function(){this._installCss3Renderer(),this._installGroundSkyBox(),this._installTerrainClipPlan()},_installTerrainClipPlan:function(){function t(t,e){this.viewer=t,this.options=e||{},this._positions=e.positions,this._height=this.options.height||0,this.bottomImg=e.bottomImg,this.wallImg=e.wallImg,this.splitNum=Y.defaultValue(e.splitNum,50),this._positions&&0<this._positions.length&&this.updateData(this._positions)}Object.defineProperties(t.prototype,{show:{get:function(){return this._show},set:function(t){this._show=t,this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=t),this._switchExcavate(t)}},height:{get:function(){return this._height},set:function(t){this._height=t,this._updateExcavateDepth(t)}}}),t.prototype.updateData=function(t){var e=[],i=t.length-1,n=new Y.Cartesian3,a=0<Y.Cartesian3.subtract(t[0],t[1],n).x;this.excavateMinHeight=9999;for(var r=0;r<i;r++){var o=(r+1)%i,s=Y.Cartesian3.midpoint(t[r],t[o],new Y.Cartesian3),l=Y.Cartographic.fromCartesian(t[r]),l=this.viewer.scene.globe.getHeight(l)||l.height;l<this.excavateMinHeight&&(this.excavateMinHeight=l);l=Y.Cartesian3.normalize(s,new Y.Cartesian3),o=a?Y.Cartesian3.subtract(t[r],s,new Y.Cartesian3):Y.Cartesian3.subtract(t[o],s,new Y.Cartesian3),o=(o=Y.Cartesian3.normalize(o,o),Y.Cartesian3.cross(o,l,new Y.Cartesian3)),o=Y.Cartesian3.normalize(o,o),l=new Y.Plane(o,0),l=Y.Plane.getPointDistance(l,s);e.push(new Y.ClippingPlane(o,l))}this.viewer.scene.globe.clippingPlanes=new Y.ClippingPlaneCollection({planes:e,edgeWidth:1,edgeColor:Y.Color.WHITE,enabled:!0}),this._prepareWell(t),this._createWell(this.wellData)},t.prototype.clear=function(){this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=!1,this.viewer.scene.globe.clippingPlanes.removeAll(),this.viewer.scene.globe.clippingPlanes.isDestroyed()||this.viewer.scene.globe.clippingPlanes.destroy()),this.viewer.scene.globe.clippingPlanes=void 0,this.bottomSurface&&this.viewer.scene.primitives.remove(this.bottomSurface),this.wellWall&&this.viewer.scene.primitives.remove(this.wellWall),delete this.bottomSurface,delete this.wellWall,this.viewer.scene.render()},t.prototype._prepareWell=function(t){var e=this.splitNum,i=t.length;if(0!=i){for(var n=this.excavateMinHeight-this.height,a=[],r=[],o=[],s=0;s<i;s++){var l=s==i-1?0:s+1,c=Y.Cartographic.fromCartesian(t[s]),l=Y.Cartographic.fromCartesian(t[l]),h=[c.longitude,c.latitude],u=[l.longitude,l.latitude];0==s&&(o.push(new Y.Cartographic(h[0],h[1])),r.push(Y.Cartesian3.fromRadians(h[0],h[1],n)),a.push(Y.Cartesian3.fromRadians(h[0],h[1],0)));for(var x=1;x<=e;x++){var d=Y.Math.lerp(h[0],u[0],x/e),Z=Y.Math.lerp(h[1],u[1],x/e);s==i-1&&x==e||(o.push(new Y.Cartographic(d,Z)),r.push(Y.Cartesian3.fromRadians(d,Z,n)),a.push(Y.Cartesian3.fromRadians(d,Z,0)))}}this.wellData={lerp_pos:o,bottom_pos:r,no_height_top:a}}},t.prototype._createWell=function(r){var o,t;this.viewer.terrainProvider._layers?((o=this)._createBottomSurface(r.bottom_pos),t=Y.sampleTerrainMostDetailed(this.viewer.terrainProvider,r.lerp_pos),Y.when(t,function(t){for(var e=t.length,i=[],n=0;n<e;n++){var a=Y.Cartesian3.fromRadians(t[n].longitude,t[n].latitude,t[n].height);i.push(a)}o._createWellWall(r.bottom_pos,i)})):(this._createBottomSurface(r.bottom_pos),this._createWellWall(r.bottom_pos,r.no_height_top))},t.prototype._getMinHeight=function(e){let i=5e6,n=null;for(let t=0;t<e.length;t++){var a=e[t].z;a<i&&(i=a,n=this._ellipsoidToLonLat(e[t]))}return n.altitude},t.prototype._ellipsoidToLonLat=function(t){var e=this.viewer.scene.globe.ellipsoid,t=new Y.Cartesian3(t.x,t.y,t.z),e=e.cartesianToCartographic(t),t=Y.Math.toDegrees(e.latitude);return{longitude:Y.Math.toDegrees(e.longitude),latitude:t,altitude:e.height}},t.prototype._createBottomSurface=function(e){if(e.length){var i=this._getMinHeight(e),n=[];for(let t=0;t<e.length;t++){var a=this._ellipsoidToLonLat(e[t]);n.push(a.longitude),n.push(a.latitude),n.push(i)}var t=new Y.PolygonGeometry({polygonHierarchy:new Y.PolygonHierarchy(Y.Cartesian3.fromDegreesArrayHeights(n)),perPositionHeight:!0}),t=Y.PolygonGeometry.createGeometry(t),r=new Y.Material({fabric:{type:"Image",uniforms:{image:this.bottomImg}}}),r=new Y.MaterialAppearance({translucent:!1,flat:!0,material:r});this.bottomSurface=new Y.Primitive({geometryInstances:new Y.GeometryInstance({geometry:t}),appearance:r,asynchronous:!1}),this.viewer.scene.primitives.add(this.bottomSurface)}},t.prototype._createWellWall=function(t,e){var i=this._getMinHeight(t),n=[],a=[];for(let t=0;t<e.length;t++)n.push(this._ellipsoidToLonLat(e[t]).altitude),a.push(i);var t=new Y.WallGeometry({positions:e,maximumHeights:n,minimumHeights:a}),t=Y.WallGeometry.createGeometry(t),r=new Y.Material({fabric:{type:"Image",uniforms:{image:this.wallImg}}}),r=new Y.MaterialAppearance({translucent:!1,flat:!0,material:r});this.wellWall=new Y.Primitive({geometryInstances:new Y.GeometryInstance({geometry:t,attributes:{color:Y.ColorGeometryInstanceAttribute.fromColor(Y.Color.GREY)},id:"PitWall"}),appearance:r,asynchronous:!1}),this.viewer.scene.primitives.add(this.wellWall)},t.prototype._switchExcavate=function(t){t?(this.viewer.scene.globe.material=Y.Material.fromType("WaJue"),this.wellWall.show=!0,this.bottomSurface.show=!0):(this.viewer.scene.globe.material=null,this.wellWall.show=!1,this.bottomSurface.show=!1)},t.prototype._updateExcavateDepth=function(t){this.bottomSurface&&this.viewer.scene.primitives.remove(this.bottomSurface),this.wellWall&&this.viewer.scene.primitives.remove(this.wellWall);for(var e=this.wellData.lerp_pos,i=[],n=e.length,a=0;a<n;a++)i.push(Y.Cartesian3.fromRadians(e[a].longitude,e[a].latitude,this.excavateMinHeight-t));this.wellData.bottom_pos=i,this._createWell(this.wellData),this.viewer.scene.primitives.add(this.bottomSurface),this.viewer.scene.primitives.add(this.wellWall)},Y.Scene.TerrainClipPlan=t},buildLightScanGraphics:function(t){if(this._viewer&&t){function e(e,t,i){var n,a,r,o,s,l,c=e.positionList,h=0,u=0;function x(t){n=c[t+1][0]-c[t][0],a=c[t+1][1]-c[t][1],r=n/e.number,o=a/e.number,u=0}x(h),t.polygon.hierarchy=new Y.CallbackProperty(function(){return Math.abs(s)>=Math.abs(n)&&Math.abs(l)>=Math.abs(a)&&((h+=1)===c.length-1&&(h=0),i[0]=i[0]+s,i[1]=i[1]+l,i[2]=i[2]+s,i[3]=i[3]+l,x(h)),s=u*r,l=u*o,u++,new Y.PolygonHierarchy(Y.Cartesian3.fromDegreesArrayHeights([e.observer[0],e.observer[1],e.observer[2],i[0]+s,i[1]+l,0,i[2]+s,i[3]+l,0]))},!1)}for(var l=this,i=l._getCirclePoints(t.circle[0],t.circle[1],t.circle[2],t.circle[3]),n=function(t,e){for(var i=e.observer[0],n=e.observer[1],a=e.observer[2],r=[],o=0;o<t.length;o++){var s=o===t.length-1?new Y.PolygonHierarchy(Y.Cartesian3.fromDegreesArrayHeights([i,n,a,t[o].x,t[o].y,0,t[0].x,t[0].y,0])):new Y.PolygonHierarchy(Y.Cartesian3.fromDegreesArrayHeights([i,n,a,t[o].x,t[o].y,0,t[o+1].x,t[o+1].y,0])),s=l._pluginLayer.entities.add({name:"三角形",polygon:{hierarchy:s,outline:!1,perPositionHeight:!0,material:e.material}});r.push(s)}return r}(i,t),a=0;a<n.length;a++)a!==n.length-1?e(t,n[a],[i[a].x,i[a].y,i[a+1].x,i[a+1].y]):e(t,n[a],[i[a].x,i[a].y,i[0].x,i[0].y]);return n}},buildPathRoaming:function(t){if(this._viewer&&t&&t.paths){var e=t.paths,i=new Y.SampledPositionProperty,n=this.createGraphics(),a=new Y.JulianDate,r=Y.JulianDate.addSeconds(a,e[e.length-1].time,new Y.JulianDate),o=t.startTime||a,a=t.stopTime||r;this._viewer.clock.startTime=o.clone(),this._viewer.clock.currentTime=o.clone(),this._viewer.clock.stopTime=a.clone(),this._viewer.clock.multiplier=t.multiplier||10,this._viewer.clock.clockRange=t.clockRange||Y.ClockRange.CLAMPED;for(var s=0;s<e.length;s++){var l=Y.Cartesian3.fromDegrees(e[s].lon,e[s].lat,e[s].alt),c=Y.JulianDate.addSeconds(o,e[s].time,new Y.JulianDate);i.addSample(c,l)}n.name=t.name||"路径漫游",n.availability=new Y.TimeIntervalCollection([new Y.TimeInterval({start:o,stop:a})]),n.position=i,n.orientation=new Y.VelocityOrientationProperty(i);var h=[];return t.polyline&&(n.polyline={positions:new Y.CallbackProperty(function(){return h},!1),width:10,material:new Y.PolylineGlowMaterialProperty({glowPower:1,color:Y.Color.RED}),clampToGround:!0}),t.model&&(n.model=this.getModelGraphics(t)),t.label&&(n.label=this.getLabelGraphics(t)),t.billboard&&(n.billboard=this.getBillboardGraphics(t)),this._viewer.entities.add(n)}},_installCss3Renderer:function(){function t(t,e){this._scratch=new Y.Cartesian2,this._viewer=i,this._scene=i.scene,this._camera=i.camera,this._container=null,this._elements=t,this._isBackHide=e,this.init()}var i;this._viewer&&(i=this._viewer,t.prototype.init=function(){var a=document.createElement("div"),r=(a.className="ys-css3-container",document.getElementById("info-warp").appendChild(a),this._container=a,this._elements.forEach(function(t){a.insertAdjacentHTML("beforeend",t.element)}),this);this._scene.preRender.addEventListener(function(){for(var t=0;t<a.children.length;t++){var e,i=Y.Cartesian3.fromDegrees(r._elements[t].position[0],r._elements[t].position[1],r._elements[t].position[2]||0),n=r._scene.cartesianToCanvasCoordinates(i,r._scratch);Y.defined(n)&&(a.children[t].style.left=parseFloat(n.x)+parseFloat(r._elements[t].offset[0])+"px",a.children[t].style.top=parseFloat(n.y)+parseFloat(r._elements[t].offset[1])+"px",r._isBackHide)&&(n=r._camera.position,e=r._scene.globe.ellipsoid.cartesianToCartographic(n).height,e+=+r._scene.globe.ellipsoid.maximumRadius,Y.Cartesian3.distance(n,i)>e?a.children[t].style.display="none":a.children[t].style.display="block")}})},t.prototype.remove=function(t){this._elements=this._elements.filter(function(t){t.id}),this._container.removeChild(document.getElementById(t))},t.prototype.append=function(t){this._elements.push(t),this._container.insertAdjacentHTML("beforeend",t.element)},t.prototype.removeEntityLayer=function(t){this._viewer.entities.removeById(t+"_1"),this._viewer.entities.removeById(t+"_2"),this._viewer.entities.removeById(t+"_3"),this.remove(t)},t.prototype.addEntityLayer=function(t){var e=t.position[0],i=t.position[1],n=this,a=(setTimeout(function(t){},300),Y.Math.toRadians(30)),r=Y.Math.toRadians(30),o=t.boxHeight||300,s=t.boxHeightMax||400,l=t.boxHeightDif||10,c=!0;t.boxShow?this._viewer.entities.add({id:t.id+"_1",name:"立方体盒子",position:new Y.CallbackProperty(function(){return(o+=l)>=s&&(o=s),Y.Cartesian3.fromDegrees(e,i,o/2)},!1),box:{dimensions:new Y.CallbackProperty(function(){return(o+=l)>=s&&(o=s,c)&&(c=!1,n.append(t,!0)),new Y.Cartesian3(t.boxSide||100,t.boxSide||100,o)},!1),material:t.boxMaterial||Y.Color.DEEPSKYBLUE.withAlpha(.5)}}):setTimeout(function(){n.append(t,!0)},100),t.circleShow&&(t.circleSize=t.circleSize||120,this._viewer.entities.add({id:t.id+"_2",name:"椭圆",position:Y.Cartesian3.fromDegrees(e,i),ellipse:{semiMinorAxis:new Y.CallbackProperty(function(){return.001},!1),semiMajorAxis:new Y.CallbackProperty(function(){return.001},!1),material:this.getDfSt(["plugin","Css3Renderer_one"])||"static/data/images/Textures/circle2.png",rotation:new Y.CallbackProperty(function(){return a+=.05},!1),stRotation:new Y.CallbackProperty(function(){return a+=.05},!1),zIndex:2}}),this._viewer.entities.add({id:t.id+"_3",name:"椭圆",position:Y.Cartesian3.fromDegrees(e,i),ellipse:{semiMinorAxis:new Y.CallbackProperty(function(){return.001},!1),semiMajorAxis:new Y.CallbackProperty(function(){return.001},!1),material:this.getDfSt(["plugin","Css3Renderer_two"])||"static/data/images/Textures/circle1.png",rotation:new Y.CallbackProperty(function(){return r-=.03},!1),stRotation:new Y.CallbackProperty(function(){return r-=.03},!1),zIndex:3}}))},Y.Scene.Css3Renderer=t)},_installGroundSkyBox:function(){var o=Y.BoxGeometry,s=Y.Cartesian3,e=Y.defaultValue,l=Y.defined,i=Y.destroyObject,c=Y.DeveloperError,h=Y.GeometryPipeline,t=Y.Matrix3,u=Y.Matrix4,x=Y.Transforms,d=Y.VertexFormat,Z=Y.BufferUsage,p=Y.CubeMap,n=Y.DrawCommand,g=Y.loadCubeMap,m=Y.RenderState,f=Y.VertexArray,v=Y.BlendingState,b=Y.SceneMode,y=Y.ShaderProgram,C=Y.ShaderSource;function a(t){this.sources=t.sources,this._sources=void 0,this.show=e(t.show,!0),this._command=new n({modelMatrix:u.clone(u.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}l(u.getRotation)||(u.getRotation=u.getMatrix3);var w=new t;a.prototype.update=function(t,e){var i=this;if(this.show&&(t.mode===b.SCENE3D||t.mode===b.MORPHING)&&t.passes.render){var n=t.context;if(this._sources!==this.sources){this._sources=this.sources;var a=this.sources;if(!(l(a.positiveX)&&l(a.negativeX)&&l(a.positiveY)&&l(a.negativeY)&&l(a.positiveZ)&&l(a.negativeZ)))throw new c("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof a.positiveX!=typeof a.negativeX||typeof a.positiveX!=typeof a.positiveY||typeof a.positiveX!=typeof a.negativeY||typeof a.positiveX!=typeof a.positiveZ||typeof a.positiveX!=typeof a.negativeZ)throw new c("this.sources properties must all be the same type.");"string"==typeof a.positiveX?g(n,this._sources).then(function(t){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=t}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new p({context:n,source:a}))}var r=this._command;if(r.modelMatrix=x.eastNorthUpToFixedFrame(t.camera._positionWC),l(r.vertexArray)||(r.uniformMap={u_cubeMap:function(){return i._cubeMap},u_rotateMatrix:function(){return u.getRotation(r.modelMatrix,w)}},a=o.createGeometry(o.fromDimensions({dimensions:new s(2,2,2),vertexFormat:d.POSITION_ONLY})),t=this._attributeLocations=h.createAttributeLocations(a),r.vertexArray=f.fromGeometry({context:n,geometry:a,attributeLocations:t,bufferUsage:Z._DRAW}),r.renderState=m.fromCache({blending:v.ALPHA_BLEND})),l(r.shaderProgram)&&this._useHdr===e||(a=new C({defines:[e?"HDR":""],sources:["uniform samplerCube u_cubeMap;\n in vec3 v_texCoord;\n void main()\n {\n vec4 color = texture(u_cubeMap, normalize(v_texCoord));\n out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n }\n "]}),r.shaderProgram=y.fromCache({context:n,vertexShaderSource:"in vec3 position;\n out vec3 v_texCoord;\n uniform mat3 u_rotateMatrix;\n void main()\n {\n vec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\n gl_Position = czm_projection * vec4(p, 1.0);\n v_texCoord = position.xyz;\n }\n ",fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=e),l(this._cubeMap))return r}},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){var t=this._command;return t.vertexArray=t.vertexArray&&t.vertexArray.destroy(),t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),i(this)},Y.Scene.GroundSkyBox=a}};let L=null;function U(t,e,i){t&&(L=e,this._analysisLayer=new L.CustomDataSource("analysisLayer"),this.$math3d=new y(t,e),this.$graphics=new c(t,e),t)&&t.dataSources.add(this._analysisLayer)}function H(t){if(t&&t.positions){var e=t.positions,i=t.that,n=[],t=[],a=[],r=i.transformWGS84ToCartesian(e[0]),e=i.transformWGS84ToCartesian(e[1]),n=i.$graphics.createPointsGraphics({point:!0,positions:[r,e]}),o=i.$math3d.getIntersectObj(r,e,n,!0);if(0===o.length)return alert("没有取到相交点 , 请检查是否开启深度检测。"),!1;for(let t=o.length-1;0<=t;t--){const l=o[t];L.defined(l.position)||o.splice(t,1)}if(!L.defined(o[0].position))throw new L.DeveloperError("position is undefined");var s=o[0].position,l=L.Cartesian3.distance(s,e)<5,s=[r,o[0].position],s=i._analysisLayer.entities.add({polyline:{positions:s,width:10,arcType:L.ArcType.NONE,material:new L.PolylineArrowMaterialProperty(L.Color.GREEN)}});t.push(s),l||(s=[o[0].position,e],s=i._analysisLayer.entities.add({polyline:{positions:s,width:10,arcType:L.ArcType.NONE,material:new L.PolylineArrowMaterialProperty(L.Color.RED)}}),t.push(s));for(let t=0;t<o.length;++t){var c,h=o[t].object;h&&(h instanceof L.Cesium3DTileFeature?(a.push(h),h.oldColor=h.color.clone(),h.color=L.Color.fromAlpha(L.Color.YELLOW,h.color.alpha)):h.id instanceof L.Entity&&(c=(h=h.id).polygon||h.polyline,a.push(h),h=c.material.color.getValue(),c.oldColor=h.clone(),c.material=L.Color.fromAlpha(L.Color.YELLOW,h.alpha))),n.push(i._analysisLayer.entities.add({position:o[t].position,ellipsoid:{radii:new L.Cartesian3(.8,.8,.8),material:L.Color.RED}}))}var s=L.Cartographic.fromCartesian(r),t=L.Cartographic.fromCartesian(e),s={longitude:s.longitude/Math.PI*180,latitude:s.latitude/Math.PI*180,height:s.height},t={longitude:t.longitude/Math.PI*180,latitude:t.latitude/Math.PI*180,height:t.height},r=Math.sqrt(Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2)+Math.pow(r.z-e.z,2)),e=Math.abs(t.height-s.height),u=Math.sqrt(Math.pow(r,2)+Math.pow(e,2)),l=l?"是":"否",s="起点坐标: ("+s.longitude.toFixed(6)+"°,"+s.latitude.toFixed(6)+"°,"+s.height.toFixed(2)+")\n终点坐标: ("+t.longitude.toFixed(6)+"°,"+t.latitude.toFixed(6)+"°,"+t.height.toFixed(2)+")\n垂直距离: "+e.toFixed(2)+"m\n水平距离: "+r.toFixed(2)+"m\n空间距离: "+u.toFixed(2)+"m\n是否可视: "+l;n&&n[0]&&(n[0].label={text:s,showBackground:!0,font:"14px monospace",fillColor:L.Color.YELLOW,pixelOffset:{x:0,y:-20},verticalOrigin:L.VerticalOrigin.BOTTOM,horizontalOrigin:L.HorizontalOrigin.LEFT})}H.prototype.remove=function(){}}function Q(t){if(!t&&!t.center&&!t.radius&&t.that)return alert("没有获取到分析参数"),!1;var l=t.that,e=this;if(!l._viewer.scene.globe.depthTestAgainstTerrain)return alert("请开启深度检测"),!1;var c=t.viewHeight||10,i=L.Cartographic.fromCartesian(t.center);try{var n=t.radius,a={},r=(a.semiMinorAxis=n,a.semiMajorAxis=n,a.rotation=0,a.center=t.center,a.granularity=Math.PI/45,l.computeEllipseEdgePositions(a));for(let t=0;t<r.outerPositions.length;t+=3){var o=new L.Cartesian3(r.outerPositions[t],r.outerPositions[t+1],r.outerPositions[t+2]),s=L.Cartographic.fromCartesian(o),h=5e-5*Math.PI/180,u=l.computeInterpolateLineCartographic(i,s,h);l.computeCartographicPointsTerrainData(u,function(r){if(0<r.length){let i=!0,n=[],a=[];for(let t=1;t<r.length;t++){let e=!0;if(1<t){var o=new L.Cartographic(r[0].longitude,r[0].latitude,r[0].height+c);if(i)e=l.computeInterpolateIndexLineHeightCartographic(o,r[t],t,t-1).height>=r[t-1].height?i=!0:i=!1;else{var s=l.computeInterpolateIndexLineHeightCartographic(o,r[t],t,t-1);for(let t=0;t<s.length;t++){if(!(s[t].height>=r[t].height)){i=!1,e=!1;break}i=!0,e=!0}}}o=L.Cartesian3.fromRadians(r[t].longitude,r[t].latitude,r[t].height+1);n.push(o),e?(a.push(0),a.push(0),a.push(1)):(a.push(1),a.push(0),a.push(0)),a.push(1)}e._pointsKSYResult=new L.Scene.PointsPrimitive({viewer:l._viewer,Cartesians:n,Colors:a})}else alert("高程异常!")})}}catch(t){console.log(t)}Q.prototype.remove=function(){}}function J(t){if(t&&t.positions){for(var e=t.positions,i=t.that,n=i.transformWGS84ToCartesian(e[0]),a=i.transformWGS84ToCartesian(e[1]),o=[L.Cartographic.fromCartesian(n)],s=new L.Cartesian3,l=[0],c=[0],h=1;h<=10;h++){L.Cartesian3.lerp(n,a,h/10,s);var u=L.Cartographic.fromCartesian(s),x=i._viewer.scene.globe.getHeight(u),x=(u.height=x,o.push(u),o[h-1]),d=L.Cartesian3.distance(L.Cartographic.toCartesian(x),L.Cartographic.toCartesian(u));c.push(c[h-1]+d),u=Math.asin((u.height-x.height)/d),l.push(100*Math.tan(u))}t=document.createElement("div"),e=(t.className="echart-viewer",i._viewer.container.appendChild(t,"dark",{renderer:"canvas",width:640,height:480}),t.style.position="absolute",t.style.left="20px",t.style.bottom="20px",t.style.height="300px",t.style.width="640px",t.style.overflow="hidden",t.style.zIndex="9999",{title:{text:"剖面示意图",left:"center",subtext:"",textStyle:{color:"white",fontSize:15}},tooltip:{trigger:"axis"},legend:{data:[""]},toolbox:{show:!(t.style.opacity=.9),feature:{mark:{show:!0},dataView:{show:!0,readOnly:!1},magicType:{show:!0,type:["line","bar"]},restore:{show:!0},saveAsImage:{show:!0}}},calculable:!0,xAxis:[{type:"category",name:"长度(米)",boundaryGap:!1,data:c,axisLabel:{textStyle:{color:"white"}},axisLine:{lineStyle:{color:"white"}}}],yAxis:[{type:"value",name:"坡度(%)",axisLabel:{formatter:function(t){return t.toFixed(2)+"%"},textStyle:{color:"white"}},axisLine:{lineStyle:{color:"white"}}}],series:[{name:"坡度",type:"line",areaStyle:{},smooth:!0,data:l,markPoint:{data:[{type:"max",name:"最大值"},{type:"min",name:"最小值"}]},markLine:{data:[{type:"average",name:"平均值"}]}}]});r.init(t).setOption(e)}}function O(t){if(t&&t.positions&&t.that){var e=t.that,i=t.positions,t=this,n=e._viewer.terrainProvider.availability;if(n){for(var a=15e3,r=0;r<i.length;r++){var o=L.Cartographic.fromCartesian(i[r]),s=e._viewer.scene.globe.getHeight(o);s<a&&(a=s),n.computeMaximumLevelAtPosition(o)}var l=Math.PI/Math.pow(2,11);l/=64;for(var c,h,u,x,d,Z,p,g,l=new L.PolygonGeometry.fromPositions({positions:i,vertexFormat:L.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:l}),m=new L.PolygonGeometry.createGeometry(l),f=0,v=0,b=new L.Cartesian3,r=0;r<m.indices.length;r+=3){c=m.indices[r],h=m.indices[r+1],d=m.indices[r+2],Z=m.attributes.position.values,b.x=Z[3*c],b.y=Z[3*c+1],b.z=Z[3*c+2],o=L.Cartographic.fromCartesian(b),c=e._viewer.scene.globe.getHeight(o),u=L.Cartesian3.fromRadians(o.longitude,o.latitude,c),p=L.Cartesian3.fromRadians(o.longitude,o.latitude,0),v<c&&(v=c),b.x=Z[3*h],b.y=Z[3*h+1],b.z=Z[3*h+2],o=L.Cartographic.fromCartesian(b),h=e._viewer.scene.globe.getHeight(o),x=L.Cartesian3.fromRadians(o.longitude,o.latitude,h),C=L.Cartesian3.fromRadians(o.longitude,o.latitude,0),v<h&&(v=h),b.x=Z[3*d],b.y=Z[3*d+1],b.z=Z[3*d+2],o=L.Cartographic.fromCartesian(b),Z=e._viewer.scene.globe.getHeight(o),d=L.Cartesian3.fromRadians(o.longitude,o.latitude,Z),v<Z&&(v=Z),f+=(p=p,C=C,g=L.Cartesian3.fromRadians(o.longitude,o.latitude,0),y=void 0,y=L.Cartesian3.distance(p,C),C=L.Cartesian3.distance(C,g),g=L.Cartesian3.distance(g,p),p=(y+C+g)/2,Math.sqrt(p*(p-y)*(p-C)*(p-g))*(c-a+h-a+Z-a)/3);var y=[],C=(y.push(u),y.push(x),y.push(d),{polygon:{hierarchy:{positions:y},extrudedHeight:0,perPositionHeight:!0,material:L.Color.fromRandom().withAlpha(.5),outline:!0,closeTop:!0,closeBottom:!0,outlineColor:L.Color.WHITE,outlineWidth:2}});e._analysisLayer.entities.add(C)}l=function(t){for(var e=[],i=[],n=0;n<t.length;n++){var a=L.Cartographic.fromCartesian(t[n]);e.push(a.longitude),i.push(a.latitude)}for(var r,o,s,l=0,c=0,h=0,u=0,x=0,n=0;n<t.length;n++)h+=s=(r=e[n])*(c=n==t.length-1?(l=e[0],i[0]):(l=e[n+1],i[n+1]))-l*(o=i[n]),u+=(r+l)*s,x+=(o+c)*s;return u/=6*(h*=.5),x/=6*h,new L.Cartographic(u,x)}(i),t._volumeLabel=e._analysisLayer.entities.add({position:L.Cartesian3.fromRadians(l.longitude,l.latitude,v+1e3),label:{text:"Cut Volume "+f.toString()+"m3"}})}else alert("未获取到地形")}}U.prototype={createVisibilityAnalysis:function(i){i=i||{};var n=this;n.drawLineGraphics({type:"straightLine",clampToGround:!1,callback:function(t,e){t=new H({positions:t,that:n});n._graphicsLayer&&n._graphicsLayer.entities.remove(e),"function"==typeof i.callback&&i.callback(t)}})},createLookAroundAnalysis:function(i){var n;i=i||{},this._viewer&&i&&(n=this).drawCircleGraphics({callback:function(t,e){n._drawLayer.entities.remove(e);e=new Q({that:n,radius:t.radius,center:t.center});"function"==typeof i.callback&&i.callback(e)}})},createVisualFieldAnalysis:function(t){var i,n;t=t||{},this._viewer&&t&&(n=null,(i=this).bindHandelEvent({leftClick:function(t,e){t=i._viewer.scene.pickPosition(t.position);if(!t)return!1;L.defined(n)?e.destroy():(n=new L.Scene.ShadowPrimitive({scene:i._viewer.scene,viewerPosition:t}),i._analysisLayer._primitives.add(n))},mouseMove:function(t){t=i._viewer.scene.pickPosition(t.endPosition);if(!t)return!1;n&&n.setPoseByTargetPoint(t)}}))},createClipPlanAnalysis:function(i){var n,a,r,o,s;i=i||{},this._viewer&&i&&(n=this,a=i.height||30,r=i.splitNum||50,o=i.wallImg||this.getDfSt(["amalysis","createClipPlanAnalysis_wallImg"])||"static/data/images/file/excavate_side_min.jpg",s=i.bottomImg||this.getDfSt(["amalysis","createClipPlanAnalysis_bottomImg"])||"static/data/images/file/excavate_bottom_min.jpg",n.drawPolygonGraphics({callback:function(t,e){n._drawLayer.entities.remove(e);e=new L.Scene.TerrainClipPlan(n._viewer,{height:a,splitNum:r,wallImg:o,bottomImg:s}),t=n.transformWGS84ArrayToCartesianArray(t);e.updateData(t),"function"==typeof i.callback&&i.callback(e)}}))},createSubmergedAnalysis:function(t){var e,n,a,r,o;t=t||{},this._viewer&&t&&(n=t.maxH||15,a=t.speed||1,r=t.interval||10,o=(e=this).getDfSt(["amalysis","createSubmergedAnalysis"])||"static/data/images/file/water.png",e.drawPolygonGraphics({height:1,callback:function(t,i){if(!e._viewer.scene.globe.depthTestAgainstTerrain)return alert("请开启深度检测"),!1;i&&setTimeout(()=>{i.polygon.heightReference="CLAMP_TO_GROUND",i.polygon.material=o;var t=0,e=(i.polygon.extrudedHeight=t,setInterval(function(){(t+=a)>=n&&(t=n,clearTimeout(e)),i.polygon.extrudedHeight=t},r))},2e3)}}))},createSlopeAnalysis:function(i){if(i=i||{},!r)return alert("需要引入echarts库"),!1;var n=this;this._viewer&&i&&n.drawLineGraphics({type:"straightLine",clampToGround:!1,callback:function(t,e){t=new J({positions:t,that:n});n._graphicsLayer&&n._graphicsLayer.entities.remove(e),"function"==typeof i.callback&&i.callback(t)}})},createCutVolumeAnalysis:function(e){var i;e=e||{},this._viewer&&e&&(i=this).drawWallGraphics({callback:function(t){t=new O({positions:i.transformWGS84ArrayToCartesianArray(t,100),that:i});"function"==typeof e.callback&&e.callback(t)}})}};var j={version:"1.0.0",PlotUtils:{}},K=(j.PlotUtils.distance=function(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))},j.PlotUtils.wholeDistance=function(t){for(var e=0,i=0;i<t.length-1;i++)e+=j.PlotUtils.distance(t[i],t[i+1]);return e},j.PlotUtils.getBaseLength=function(t){return Math.pow(j.PlotUtils.wholeDistance(t),.99)},j.PlotUtils.mid=function(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]},j.PlotUtils.getCircleCenterOfThreePoints=function(t,e,i){var n=[(t[0]+e[0])/2,(t[1]+e[1])/2],e=[n[0]-t[1]+e[1],n[1]+t[0]-e[0]],a=[(t[0]+i[0])/2,(t[1]+i[1])/2],t=[a[0]-t[1]+i[1],a[1]+t[0]-i[0]];return j.PlotUtils.getIntersectPoint(n,e,a,t)},j.PlotUtils.getIntersectPoint=function(t,e,i,n){var a,r,o;return t[1]==e[1]?[(a=(n[0]-i[0])/(n[1]-i[1]))*(t[1]-i[1])+i[0],r=t[1]]:i[1]==n[1]?[(o=(e[0]-t[0])/(e[1]-t[1]))*(i[1]-t[1])+t[0],r=i[1]]:(o=(e[0]-t[0])/(e[1]-t[1]),a=(n[0]-i[0])/(n[1]-i[1]),[o*(r=(o*t[1]-t[0]-a*i[1]+i[0])/(o-a))-o*t[1]+t[0],r])},j.PlotUtils.getAzimuth=function(t,e){var i,n=Math.asin(Math.abs(e[1]-t[1])/j.PlotUtils.distance(t,e));return e[1]>=t[1]&&e[0]>=t[0]?i=n+Math.PI:e[1]>=t[1]&&e[0]<t[0]?i=j.Constants.TWO_PI-n:e[1]<t[1]&&e[0]<t[0]?i=n:e[1]<t[1]&&e[0]>=t[0]&&(i=Math.PI-n),i},j.PlotUtils.getAngleOfThreePoints=function(t,e,i){t=j.PlotUtils.getAzimuth(e,t)-j.PlotUtils.getAzimuth(e,i);return t<0?t+j.Constants.TWO_PI:t},j.PlotUtils.isClockWise=function(t,e,i){return(i[1]-t[1])*(e[0]-t[0])>(e[1]-t[1])*(i[0]-t[0])},j.PlotUtils.getPointOnLine=function(t,e,i){return[e[0]+t*(i[0]-e[0]),e[1]+t*(i[1]-e[1])]},j.PlotUtils.getCubicValue=function(t,e,i,n,a){var r=1-(t=Math.max(Math.min(t,1),0)),o=t*t,s=o*t,l=r*r,c=l*r;return[c*e[0]+3*l*t*i[0]+3*r*o*n[0]+s*a[0],c*e[1]+3*l*t*i[1]+3*r*o*n[1]+s*a[1]]},j.PlotUtils.getThirdPoint=function(t,e,i,n,a){t=j.PlotUtils.getAzimuth(t,e),a=a?t+i:t-i,t=n*Math.cos(a),i=n*Math.sin(a);return[e[0]+t,e[1]+i]},j.PlotUtils.getArcPoints=function(t,e,i,n){for(var a=[],r=(r=n-i)<0?r+j.Constants.TWO_PI:r,o=0;o<=j.Constants.FITTING_COUNT;o++){var s=i+r*o/j.Constants.FITTING_COUNT,l=t[0]+e*Math.cos(s),s=t[1]+e*Math.sin(s);a.push([l,s])}return a},j.PlotUtils.getBisectorNormals=function(t,e,i,n){var a,r,o=j.PlotUtils.getNormal(e,i,n),s=Math.sqrt(o[0]*o[0]+o[1]*o[1]),l=o[0]/s,o=o[1]/s,c=j.PlotUtils.distance(e,i),h=j.PlotUtils.distance(i,n),s=s>j.Constants.ZERO_TOLERANCE?j.PlotUtils.isClockWise(e,i,n)?(a=[i[0]-(r=t*c)*o,i[1]+r*l],[i[0]+(r=t*h)*o,i[1]-r*l]):(a=[i[0]+(r=t*c)*o,i[1]-r*l],[i[0]-(r=t*h)*o,i[1]+r*l]):(a=[i[0]+t*(e[0]-i[0]),i[1]+t*(e[1]-i[1])],[i[0]+t*(n[0]-i[0]),i[1]+t*(n[1]-i[1])]);return[a,s]},j.PlotUtils.getNormal=function(t,e,i){var n=t[0]-e[0],t=t[1]-e[1],a=Math.sqrt(n*n+t*t),a=(n/=a,t/=a,i[0]-e[0]),i=i[1]-e[1],e=Math.sqrt(a*a+i*i);return[n+(a/=e),t+(i/=e)]},j.PlotUtils.getCurvePoints=function(t,e){for(var i=[j.PlotUtils.getLeftMostControlPoint(e)],n=0;n<e.length-2;n++)var a=e[n],r=e[n+1],o=e[n+2],o=j.PlotUtils.getBisectorNormals(t,a,r,o),i=i.concat(o);for(var s=j.PlotUtils.getRightMostControlPoint(e),l=(i.push(s),[]),n=0;n<e.length-1;n++){for(a=e[n],r=e[n+1],l.push(a),t=0;t<j.Constants.FITTING_COUNT;t++){var c=j.PlotUtils.getCubicValue(t/j.Constants.FITTING_COUNT,a,i[2*n],i[2*n+1],r);l.push(c)}l.push(r)}return l},j.PlotUtils.getLeftMostControlPoint=function(e){var i,n,a,r,o,s=e[0],l=e[1],e=e[2],c=j.PlotUtils.getBisectorNormals(0,s,l,e)[0],e=j.PlotUtils.getNormal(s,l,e),e=Math.sqrt(e[0]*e[0]+e[1]*e[1])>j.Constants.ZERO_TOLERANCE?(e=j.PlotUtils.mid(s,l),a=s[0]-e[0],i=s[1]-e[1],n=2/j.PlotUtils.distance(s,l),r=c[0]-e[0],c=c[1]-e[1],o=e[0]+((i=-n*i)*i-(n=n*a)*n)*r+(a=2*i*n)*c,e[1]+a*r+(n*n-i*i)*c):(o=s[0]+t*(l[0]-s[0]),s[1]+t*(l[1]-s[1]));return[o,e]},j.PlotUtils.getRightMostControlPoint=function(e){var i,n,a,r,o,s=e.length,l=e[s-3],c=e[s-2],e=e[s-1],s=j.PlotUtils.getBisectorNormals(0,l,c,e)[1],l=j.PlotUtils.getNormal(l,c,e),l=Math.sqrt(l[0]*l[0]+l[1]*l[1])>j.Constants.ZERO_TOLERANCE?(l=j.PlotUtils.mid(c,e),a=e[0]-l[0],i=e[1]-l[1],n=2/j.PlotUtils.distance(c,e),r=s[0]-l[0],s=s[1]-l[1],o=l[0]+((i=-n*i)*i-(n=n*a)*n)*r+(a=2*i*n)*s,l[1]+a*r+(n*n-i*i)*s):(o=e[0]+t*(c[0]-e[0]),e[1]+t*(c[1]-e[1]));return[o,l]},j.PlotUtils.getBezierPoints=function(t){if(t.length<=2)return t;for(var e=[],i=t.length-1,n=0;n<=1;n+=.01){for(var a=0,r=0,o=0;o<=i;o++){var s=j.PlotUtils.getBinomialFactor(i,o),l=Math.pow(n,o),c=Math.pow(1-n,i-o);a+=s*l*c*t[o][0],r+=s*l*c*t[o][1]}e.push([a,r])}return e.push(t[i]),e},j.PlotUtils.getBinomialFactor=function(t,e){return j.PlotUtils.getFactorial(t)/(j.PlotUtils.getFactorial(e)*j.PlotUtils.getFactorial(t-e))},j.PlotUtils.getFactorial=function(t){if(t<=1)return 1;if(2==t)return 2;if(3==t)return 6;if(4==t)return 24;if(5==t)return 120;for(var e=1,i=1;i<=t;i++)e*=i;return e},j.PlotUtils.getQBSplinePoints=function(t){if(t.length<=2)return t;var e=[],i=t.length-2-1;e.push(t[0]);for(var n=0;n<=i;n++)for(var a=0;a<=1;a+=.05){for(var r=0,o=0,s=0;s<=2;s++){var l=j.PlotUtils.getQuadricBSplineFactor(s,a);r+=l*t[n+s][0],o+=l*t[n+s][1]}e.push([r,o])}return e.push(t[t.length-1]),e},j.PlotUtils.getQuadricBSplineFactor=function(t,e){return 0==t?Math.pow(e-1,2)/2:1==t?(-2*Math.pow(e,2)+2*e+1)/2:2==t?Math.pow(e,2)/2:0},j.Constants={TWO_PI:2*Math.PI,HALF_PI:Math.PI/2,FITTING_COUNT:100,ZERO_TOLERANCE:1e-4},{version:"1.0.0",createTime:"2018.6.19",author:"xupinhui"}),q="doublearrow",$={headHeightFactor:.18,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15,tailWidthFactor:.1,headTailFactor:.8,swallowTailFactor:1},tt={tailWidthFactor:.15,neckWidthFactor:.2,headWidthFactor:.25,headAngle:Math.PI/8.5,neckAngle:Math.PI/13};K.algorithm={},K.algorithm.doubleArrow=function(t,e){this.connPoint=null;var i={controlPoint:this.tempPoint4=null,polygonalPoint:null};if(!((o=(this.points=t).length)<2)){if(2==o)return t;var n=this.points[0],a=this.points[1],r=this.points[2],o=t.length,o=(this.tempPoint4=3==o?K.algorithm.getTempPoint4(n,a,r):this.points[3],this.connPoint=3==o||4==o?j.PlotUtils.mid(n,a):this.points[4],t=j.PlotUtils.isClockWise(n,a,r)?(h=K.algorithm.getArrowPoints(n,this.connPoint,this.tempPoint4,!1),K.algorithm.getArrowPoints(this.connPoint,a,r,!0)):(h=K.algorithm.getArrowPoints(a,this.connPoint,r,!1),K.algorithm.getArrowPoints(this.connPoint,n,this.tempPoint4,!0)),h.length),s=(o-5)/2,l=h.slice(0,s),c=h.slice(s,5+s),h=h.slice(5+s,o),u=t.slice(0,s),x=t.slice(s,5+s),t=t.slice(5+s,o),u=j.PlotUtils.getBezierPoints(u),s=j.PlotUtils.getBezierPoints(t.concat(l.slice(1))),h=j.PlotUtils.getBezierPoints(h),o=u.concat(x,s,c,h),t=K.algorithm.array2Dto1D(o);i.controlPoint=[n,a,r,this.tempPoint4,this.connPoint],i.polygonalPoint=e.Cartesian3.fromDegreesArray(t)}return i},K.algorithm.threeArrow=function(t){this.connPoint=null,this.tempPoint4=null;var e={controlPoint:this.tempPoint5=null,polygonalPoint:null};if(2<=(r=(this.points=t).length)){if(2==r)return t;var i=this.points[0],n=this.points[1],a=this.points[2],r=(3==(r=t.length)?(this.tempPoint4=K.algorithm.getTempPoint4(i,n,a),this.tempPoint5=j.PlotUtils.mid(a,this.tempPoint4)):(this.tempPoint4=this.points[3],this.tempPoint5=this.points[4]),this.connPoint=r<6?j.PlotUtils.mid(i,n):this.points[5],t=j.PlotUtils.isClockWise(i,n,a)?(c=K.algorithm.getArrowPoints(i,this.connPoint,this.tempPoint4,!1),K.algorithm.getArrowPoints(this.connPoint,n,a,!0)):(c=K.algorithm.getArrowPoints(n,this.connPoint,a,!1),K.algorithm.getArrowPoints(this.connPoint,i,this.tempPoint4,!0)),c.length),o=(r-5)/2,s=c.slice(0,o),l=c.slice(o,5+o),c=c.slice(5+o,r),h=t.slice(0,o),u=t.slice(o,5+o),t=t.slice(5+o,r),h=j.PlotUtils.getBezierPoints(h),o=j.PlotUtils.getBezierPoints(t.concat(s.slice(1))),c=j.PlotUtils.getBezierPoints(c),r=h.concat(u,o,l,c),t=K.algorithm.array2Dto1D(r);e.controlPoint=[i,n,a,this.tempPoint4,this.tempPoint5,this.connPoint],e.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(t)}return e},K.algorithm.array2Dto1D=function(t){var e=[];return t.forEach(function(t){e.push(t[0]),e.push(t[1])}),e},K.algorithm.getArrowPoints=function(t,e,i,n){this.type=q,this.headHeightFactor=.25,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15;var a=j.PlotUtils.mid(t,e),r=j.PlotUtils.distance(a,i),o=j.PlotUtils.getThirdPoint(i,a,0,.3*r,!0),s=j.PlotUtils.getThirdPoint(i,a,0,.5*r,!0),o=[a,j.PlotUtils.getThirdPoint(a,o,j.Constants.HALF_PI,r/5,n),j.PlotUtils.getThirdPoint(a,s,j.Constants.HALF_PI,r/4,n),i],a=K.algorithm.getArrowHeadPoints(o,this.headHeightFactor,this.headWidthFactor,this.neckHeightFactor,this.neckWidthFactor),s=a[0],r=a[4],n=j.PlotUtils.distance(t,e)/j.PlotUtils.getBaseLength(o)/2,i=K.algorithm.getArrowBodyPoints(o,s,r,n),o=i.length,n=i.slice(0,o/2),i=i.slice(o/2,o);return n.push(s),i.push(r),(n=n.reverse()).push(e),(i=i.reverse()).push(t),n.reverse().concat(a,i)},K.algorithm.getArrowHeadPoints=function(t,e,i){this.type=q,this.headHeightFactor=.25,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15;var n=j.PlotUtils.getBaseLength(t)*this.headHeightFactor,a=t[t.length-1],e=(j.PlotUtils.distance(e,i),n*this.headWidthFactor),i=n*this.neckWidthFactor,r=n*this.neckHeightFactor,n=j.PlotUtils.getThirdPoint(t[t.length-2],a,0,n,!0),t=j.PlotUtils.getThirdPoint(t[t.length-2],a,0,r,!0),r=j.PlotUtils.getThirdPoint(a,n,j.Constants.HALF_PI,e,!1),n=j.PlotUtils.getThirdPoint(a,n,j.Constants.HALF_PI,e,!0);return[j.PlotUtils.getThirdPoint(a,t,j.Constants.HALF_PI,i,!1),r,a,n,j.PlotUtils.getThirdPoint(a,t,j.Constants.HALF_PI,i,!0)]},K.algorithm.getArrowBodyPoints=function(t,e,i,n){for(var a=j.PlotUtils.wholeDistance(t),r=j.PlotUtils.getBaseLength(t)*n,o=(r-j.PlotUtils.distance(e,i))/2,s=0,l=[],c=[],h=1;h<t.length-1;h++){var u=j.PlotUtils.getAngleOfThreePoints(t[h-1],t[h],t[h+1])/2,x=(r/2-(s+=j.PlotUtils.distance(t[h-1],t[h]))/a*o)/Math.sin(u),d=j.PlotUtils.getThirdPoint(t[h-1],t[h],Math.PI-u,x,!0),u=j.PlotUtils.getThirdPoint(t[h-1],t[h],u,x,!1);l.push(d),c.push(u)}return l.concat(c)},K.algorithm.getTempPoint4=function(t,e,i){var n,a,r,e=j.PlotUtils.mid(t,e),o=j.PlotUtils.distance(e,i),i=j.PlotUtils.getAngleOfThreePoints(t,e,i),o=i<j.Constants.HALF_PI?(n=o*Math.sin(i),a=o*Math.cos(i),r=j.PlotUtils.getThirdPoint(t,e,j.Constants.HALF_PI,n,!1),j.PlotUtils.getThirdPoint(e,r,j.Constants.HALF_PI,a,!0)):i>=j.Constants.HALF_PI&&i<Math.PI?(n=o*Math.sin(Math.PI-i),a=o*Math.cos(Math.PI-i),r=j.PlotUtils.getThirdPoint(t,e,j.Constants.HALF_PI,n,!1),j.PlotUtils.getThirdPoint(e,r,j.Constants.HALF_PI,a,!1)):i>=Math.PI&&i<1.5*Math.PI?(n=o*Math.sin(i-Math.PI),a=o*Math.cos(i-Math.PI),r=j.PlotUtils.getThirdPoint(t,e,j.Constants.HALF_PI,n,!0),j.PlotUtils.getThirdPoint(e,r,j.Constants.HALF_PI,a,!0)):(n=o*Math.sin(2*Math.PI-i),a=o*Math.cos(2*Math.PI-i),r=j.PlotUtils.getThirdPoint(t,e,j.Constants.HALF_PI,n,!0),j.PlotUtils.getThirdPoint(e,r,j.Constants.HALF_PI,a,!1));return o},K.algorithm.tailedAttackArrow=function(t,e){t=K.algorithm.dereplication(t),this.tailWidthFactor=$.tailWidthFactor,this.swallowTailFactor=$.swallowTailFactor,this.swallowTailPnt=$.swallowTailPnt;var i={controlPoint:null,polygonalPoint:null};if(!((i.controlPoint=t).length<2)){if(2==t.length)return i.polygonalPoint=t,i;var n=t[0],a=t[1],t=(j.PlotUtils.isClockWise(t[0],t[1],t[2])&&(n=t[1],a=t[0]),[j.PlotUtils.mid(n,a)].concat(t.slice(2))),r=K.algorithm.getAttackArrowHeadPoints(t,n,a,$),o=r[0],s=r[4],l=j.PlotUtils.distance(n,a),c=j.PlotUtils.getBaseLength(t),h=c*this.tailWidthFactor*this.swallowTailFactor;this.swallowTailPnt=j.PlotUtils.getThirdPoint(t[1],t[0],0,h,!0);h=K.algorithm.getAttackArrowBodyPoints(t,o,s,l/c),t=h.length,l=[n].concat(h.slice(0,t/2));l.push(o);c=[a].concat(h.slice(t/2,t));c.push(s),l=j.PlotUtils.getQBSplinePoints(l),c=j.PlotUtils.getQBSplinePoints(c),n=K.algorithm.array2Dto1D(l.concat(r,c.reverse(),[this.swallowTailPnt,l[0]])),i.polygonalPoint=e.Cartesian3.fromDegreesArray(n)}return i},K.algorithm.getAttackArrowHeadPoints=function(t,e,i,n){this.headHeightFactor=n.headHeightFactor,this.headTailFactor=n.headTailFactor,this.headWidthFactor=n.headWidthFactor,this.neckWidthFactor=n.neckWidthFactor,this.neckHeightFactor=n.neckHeightFactor;var n=j.PlotUtils.getBaseLength(t)*this.headHeightFactor,a=t[t.length-1],r=j.PlotUtils.distance(a,t[t.length-2]),e=j.PlotUtils.distance(e,i),i=(n=n>e*this.headTailFactor?e*this.headTailFactor:n)*this.headWidthFactor,e=n*this.neckWidthFactor,r=(n=r<n?r:n)*this.neckHeightFactor,n=j.PlotUtils.getThirdPoint(t[t.length-2],a,0,n,!0),t=j.PlotUtils.getThirdPoint(t[t.length-2],a,0,r,!0),r=j.PlotUtils.getThirdPoint(a,n,j.Constants.HALF_PI,i,!1),n=j.PlotUtils.getThirdPoint(a,n,j.Constants.HALF_PI,i,!0);return[j.PlotUtils.getThirdPoint(a,t,j.Constants.HALF_PI,e,!1),r,a,n,j.PlotUtils.getThirdPoint(a,t,j.Constants.HALF_PI,e,!0)]},K.algorithm.getAttackArrowBodyPoints=function(t,e,i,n){for(var a=j.PlotUtils.wholeDistance(t),r=j.PlotUtils.getBaseLength(t)*n,o=(r-j.PlotUtils.distance(e,i))/2,s=0,l=[],c=[],h=1;h<t.length-1;h++){var u=j.PlotUtils.getAngleOfThreePoints(t[h-1],t[h],t[h+1])/2,x=(r/2-(s+=j.PlotUtils.distance(t[h-1],t[h]))/a*o)/Math.sin(u),d=j.PlotUtils.getThirdPoint(t[h-1],t[h],Math.PI-u,x,!0),u=j.PlotUtils.getThirdPoint(t[h-1],t[h],u,x,!1);l.push(d),c.push(u)}return l.concat(c)},K.algorithm.dereplication=function(t){var e=t[t.length-1],i=!1,n=[],n=t.filter(function(t){if(t[0]!=e[0]&&t[1]!=e[1])return t;i=!0});return i&&n.push(e),n},K.algorithm.fineArrow=function(t,e,i){var n,a,r,o,s,l,c;if(!(t.length<2||e.length<2))return n=tt.tailWidthFactor,c=tt.neckWidthFactor,s=tt.headWidthFactor,o=tt.headAngle,l=tt.neckAngle,(a=[])[0]=t,a[1]=e,t=a[0],e=a[1],c=(a=j.PlotUtils.getBaseLength(a))*c,s=a*s,n=j.PlotUtils.getThirdPoint(e,t,j.Constants.HALF_PI,a=a*n,!0),a=j.PlotUtils.getThirdPoint(e,t,j.Constants.HALF_PI,a,!1),r=j.PlotUtils.getThirdPoint(t,e,o,s,!1),o=j.PlotUtils.getThirdPoint(t,e,o,s,!0),s=j.PlotUtils.getThirdPoint(t,e,l,c,!1),l=j.PlotUtils.getThirdPoint(t,e,l,c,!0),(c=[]).push(n[0],n[1],s[0],s[1],r[0],r[1],e[0],e[1],o[0],o[1],l[0],l[1],a[0],a[1],t[0],t[1]),c.some(t=>isNaN(t))?"":i.Cartesian3.fromDegreesArray(c)};let et=null;function it(t,e){this.viewer=t,et=e,this.handler=new et.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.fillMaterial=et.Color.RED.withAlpha(.5),this.positions=[],this.state=-1,this.floatPoint=null,this.arrowEntity=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null,this.xp=K}it.prototype.clear=function(){this.state=0,this.firstPoint&&this.viewer.entities.remove(this.firstPoint),this.floatPoint&&this.viewer.entities.remove(this.floatPoint),this.arrowEntity&&this.viewer.entities.remove(this.arrowEntity),this.state=-1},it.prototype.disableHandler=function(){this.handler&&(this.handler.destroy(),this.handler=new et.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)};let nt=null;var at=function(t,e){it.call(this,t,e),nt=e,this.type="AttackArrow",this.fillMaterial=nt.Color.RED.withAlpha(.5)};function rt(t,e){t=e.camera.getPickRay(t);return t?e.scene.globe.pick(t,e.scene):null}at.prototype={disable:function(){this.positions=[],this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new nt.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null);for(var t=0;t<this.pointArr.length;t++)this.pointArr[t]&&this.viewer.entities.remove(this.pointArr[t]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},startDraw:function(e){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var i=this;this.state=1,this.handler||(this.handler=new nt.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(t){(t=rt(t.position,i.viewer))&&(0==i.positions.length&&(i.floatPoint=i.creatPoint(t),i.floatPoint.wz=-1),i.positions.push(t),t=i.creatPoint(t),2<i.positions.length?t.wz=i.positions.length-1:t.wz=i.positions.length,i.pointArr.push(t))},nt.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(t){!i.floatPoint||i.positions.length<2||(t=rt(t.endPosition,i.viewer))&&(i.floatPoint.position.setValue(t),2<=i.positions.length)&&(nt.defined(i.arrowEntity)?(i.positions.pop(),i.positions.push(t)):(i.positions.push(t),i.arrowEntity=i.showArrowOnMap(i.positions),i.arrowEntity.objId=i.objId,e&&e(i.objId)))},nt.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(t){if(t=rt(t.position,i.viewer)){for(var e=0;e<i.pointArr.length;e++)i.pointArr[e].show=!1;i.floatPoint.show=!1,i.viewer.entities.remove(i.floatPoint),i.floatPoint=null;t=i.creatPoint(t);t.show=!1,t.wz=i.positions.length,i.pointArr.push(t),i.positions=[],i.pointArr=[],i.arrowEntity=null}},nt.ScreenSpaceEventType.RIGHT_CLICK)},createByData:function(t){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;for(var e=[],i=0;i<t.length;i++){var n=nt.Cartesian3.fromDegrees(t[i][0],t[i][1]);e.push(n)}for(this.positions=e,i=0;i<this.positions.length;i++){var a=this.creatPoint(this.positions[i]);a.show=!1,a.wz=i+1,this.pointArr.push(a)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},startModify:function(){this.state=2;for(var n=this,t=0;t<n.pointArr.length;t++)n.pointArr[t].show=!0;this.modifyHandler||(this.modifyHandler=new nt.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(t){var e=n.viewer.scene.pick(t.position);if(nt.defined(e)&&e.id)n.clickStep++,e.id.objId||(n.selectPoint=e.id);else{for(var i=0;i<n.pointArr.length;i++)n.pointArr[i].show=!1;n.floatPoint&&(n.floatPoint.show=!1),n.state=-1,n.modifyHandler.destroy(),n.modifyHandler=null}2==n.clickStep&&(n.clickStep=0,e=rt(t.position,n.viewer))&&n.selectPoint&&(n.selectPoint.position.setValue(e),n.selectPoint=null)},nt.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(t){(t=rt(t.endPosition,n.viewer))&&n.selectPoint&&(n.selectPoint.position.setValue(t),n.positions[n.selectPoint.wz-1]=t)},nt.ScreenSpaceEventType.MOUSE_MOVE)},getLnglats:function(){for(var t=[],e=0;e<this.positions.length;e++){var i=this.cartesianToLatlng(this.positions[e]);t.push(i)}return t},getPositions:function(){return this.positions},creatPoint:function(t){t=this.viewer.entities.add({position:t,point:{pixelSize:10,color:nt.Color.YELLOW}});return t.attr="editPoint",t},showArrowOnMap:function(r){var o=this;return this.viewer.entities.add({id:o.objId,polygon:new nt.PolygonGraphics({hierarchy:new nt.CallbackProperty(function(){if(r.length<3)return null;for(var t=[],e=0;e<r.length;e++){var i=o.cartesianToLatlng(r[e]);t.push(i)}var n=o.xp.algorithm.tailedAttackArrow(t,nt),a=[];return-1==JSON.stringify(n.polygonalPoint).indexOf("null")&&(a=n.polygonalPoint),new nt.PolygonHierarchy(a)},!1),show:!0,fill:!0,material:o.fillMaterial})})},cartesianToLatlng:function(t){var t=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(t),e=nt.Math.toDegrees(t.latitude);return[nt.Math.toDegrees(t.longitude),e]}},(at.prototype=Object.create(Object.assign({},at.prototype,it.prototype))).constructor=at;let ot=null;var st=function(t,e){it.call(this,t,e),ot=e,this.type="StraightArrow",this.fillMaterial=ot.Color.fromCssColorString("#0000FF").withAlpha(.8)};function lt(t,e){t=e.camera.getPickRay(t);return t?e.scene.globe.pick(t,e.scene):null}st.prototype={disable:function(){this.positions=[],this.firstPoint&&(this.viewer.entities.remove(this.firstPoint),this.firstPoint=null),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new ot.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},startDraw:function(e){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var i=this;this.state=1,this.handler.setInputAction(function(t){(t=lt(t.position,i.viewer))&&(0==i.positions.length&&(i.firstPoint=i.creatPoint(t),i.firstPoint.type="firstPoint",i.floatPoint=i.creatPoint(t),i.floatPoint.type="floatPoint",i.positions.push(t)),i.firstPoint.position.setValue(t),i.firstPoint.show=!0,i.positions&&3==i.positions.length&&(i.firstPoint.show=!1,i.positions=[],i.pointArr=[],i.arrowEntity=null),i.positions.push(t.clone()))},ot.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(t){i.positions.length<1||(t=lt(t.endPosition,i.viewer))&&(i.floatPoint.position.setValue(t),2<=i.positions.length)&&(ot.defined(i.arrowEntity)?(i.positions.pop(),i.positions.push(t)):(i.positions.push(t),i.arrowEntity=i.showArrowOnMap(i.positions),e&&e(i.objId)))},ot.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(t){(t=lt(t.position,i.viewer))&&(i.firstPoint.show=!1,i.positions=[],i.pointArr=[],i.arrowEntity=null,i.positions.push(t.clone()))},ot.ScreenSpaceEventType.RIGHT_CLICK)},startModify:function(){this.state=2,this.firstPoint.show=!0,this.floatPoint.show=!0;var i=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new ot.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(t){var e=i.viewer.scene.pick(t.position);ot.defined(e)&&e.id?(i.clickStep++,e.id.objId||(i.selectPoint=e.id)):(i.modifyHandler.destroy(),i.modifyHandler=null,i.firstPoint.show=!1,i.floatPoint.show=!1,i.state=-1),2==i.clickStep&&(i.clickStep=0,e=lt(t.position,i.viewer))&&i.selectPoint&&(i.selectPoint.position.setValue(e),i.selectPoint=null)},ot.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(t){i.selectPoint&&(t=lt(t.endPosition,i.viewer))&&(i.selectPoint.position.setValue(t),"firstPoint"==i.selectPoint.type&&(i.positions[1]=t),"floatPoint"==i.selectPoint.type)&&(i.positions[2]=t)},ot.ScreenSpaceEventType.MOUSE_MOVE)},createByData:function(t){this.state=-1,this.positions=[];for(var e=[],i=0;i<t.length;i++){var n=ot.Cartesian3.fromDegrees(t[i][0],t[i][1]);e.push(n)}this.positions=e,this.firstPoint=this.creatPoint(this.positions[1]),this.firstPoint.type="firstPoint",this.floatPoint=this.creatPoint(this.positions[2]),this.floatPoint.type="floatPoint",this.arrowEntity=this.showArrowOnMap(this.positions),this.firstPoint.show=!1,this.floatPoint.show=!1,this.arrowEntity.objId=this.objId},getLnglats:function(){for(var t=[],e=0;e<this.positions.length;e++){var i=this.cartesianToLatlng(this.positions[e]);t.push(i)}return t},getPositions:function(){return this.positions},creatPoint:function(t){t=this.viewer.entities.add({position:t,point:{pixelSize:10,color:ot.Color.YELLOW}});return t.attr="editPoint",t},showArrowOnMap:function(o){var s=this;return this.viewer.entities.add({id:s.objId,polygon:new ot.PolygonGraphics({hierarchy:new ot.CallbackProperty(function(){if(o.length<2)return null;var t=o[1],e=o[2],t=s.cartesianToLatlng(t),e=s.cartesianToLatlng(e),i=[],n=s.xp.algorithm.fineArrow([t[0],t[1]],[e[0],e[1]],ot);if(-1!=JSON.stringify(n).indexOf("null"))return[];for(var a=0;a<n.length;a++){var r=new ot.Cartesian3(n[a].x,n[a].y,n[a].z);i.push(r)}return new ot.PolygonHierarchy(i)},!1),show:!0,fill:!0,material:s.fillMaterial})})},cartesianToLatlng:function(t){var t=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(t),e=ot.Math.toDegrees(t.latitude);return[ot.Math.toDegrees(t.longitude),e]}},(st.prototype=Object.create(Object.assign({},st.prototype,it.prototype))).constructor=st;let ct=null;var ht=function(t,e){it.call(this,t,e),ct=e,this.type="PincerArrow",this.fillMaterial=ct.Color.YELLOW.withAlpha(.8)};function xt(t,e){t=e.camera.getPickRay(t);return t?e.scene.globe.pick(t,e.scene):null}ht.prototype={disable:function(){this.positions=[],this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new ct.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null);for(var t=0;t<this.pointArr.length;t++)this.pointArr[t]&&this.viewer.entities.remove(this.pointArr[t]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},startDraw:function(e){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var n=this;this.state=1,this.handler.setInputAction(function(t){if(t=xt(t.position,n.viewer))if(0==n.positions.length&&(n.floatPoint=n.creatPoint(t)),4<n.positions.length){(i=n.creatPoint(t)).wz=n.positions.length,n.pointArr.push(i);for(var e=0;e<n.pointArr.length;e++)n.pointArr[e].show=!1;n.floatPoint&&(n.floatPoint.show=!1,n.viewer.entities.remove(n.floatPoint),n.floatPoint=null),n.positions=[],n.pointArr=[],n.arrowEntity=null}else{n.positions.push(t);var i=n.creatPoint(t);2<n.positions.length?i.wz=n.positions.length-1:i.wz=n.positions.length,n.pointArr.push(i)}},ct.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(t){!n.floatPoint||n.positions.length<2||(t=xt(t.endPosition,n.viewer))&&(n.floatPoint.position.setValue(t),2<=n.positions.length)&&(ct.defined(n.arrowEntity)?(n.positions.pop(),n.positions.push(t)):(n.positions.push(t),n.arrowEntity=n.showArrowOnMap(n.positions),n.arrowEntity.objId=n.objId,e&&e(n.objId)))},ct.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(t){if(4<=n.positions.length&&(t=xt(t.position,n.viewer))){for(var e=0;e<n.pointArr.length;e++)n.pointArr[e].show=!1;n.floatPoint.show=!1,n.viewer.entities.remove(n.floatPoint),n.floatPoint=null;t=n.creatPoint(t);t.show=!1,t.wz=n.positions.length,n.pointArr.push(t),n.positions=[],n.pointArr=[],n.arrowEntity=null}},ct.ScreenSpaceEventType.RIGHT_CLICK)},createByData:function(t){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;for(var e=[],i=0;i<t.length;i++){var n=ct.Cartesian3.fromDegrees(t[i][0],t[i][1]);e.push(n)}for(this.positions=e,i=0;i<this.positions.length;i++){var a=this.creatPoint(this.positions[i]);a.show=!1,a.wz=i+1,this.pointArr.push(a)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},startModify:function(){this.state=2;for(var n=this,t=0;t<n.pointArr.length;t++)n.pointArr[t].show=!0;this.modifyHandler||(this.modifyHandler=new ct.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(t){var e=n.viewer.scene.pick(t.position);if(ct.defined(e)&&e.id)n.clickStep++,e.id.objId||(n.selectPoint=e.id);else{for(var i=0;i<n.pointArr.length;i++)n.pointArr[i].show=!1;n.state=-1,n.modifyHandler.destroy(),n.modifyHandler=null}2==n.clickStep&&(n.clickStep=0,e=xt(t.position,n.viewer))&&n.selectPoint&&(n.selectPoint.position.setValue(e),n.selectPoint=null)},ct.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(t){(t=xt(t.endPosition,n.viewer))&&n.selectPoint&&(n.selectPoint.position.setValue(t),n.positions[n.selectPoint.wz-1]=t)},ct.ScreenSpaceEventType.MOUSE_MOVE)},getLnglats:function(){for(var t=[],e=0;e<this.positions.length;e++){var i=this.cartesianToLatlng(this.positions[e]);t.push(i)}return t},getPositions:function(){return this.positions},creatPoint:function(t){return this.viewer.entities.add({position:t,point:{pixelSize:10,color:ct.Color.YELLOW}})},showArrowOnMap:function(r){var o=this;return this.viewer.entities.add({id:o.objId,polygon:new ct.PolygonGraphics({hierarchy:new ct.CallbackProperty(function(){if(r.length<3)return null;for(var t=[],e=0;e<r.length;e++){var i=o.cartesianToLatlng(r[e]);t.push(i)}var n=o.xp.algorithm.doubleArrow(t,ct),a=[];return-1==JSON.stringify(n.polygonalPoint).indexOf("null")&&(a=n.polygonalPoint),new ct.PolygonHierarchy(a)},!1),show:!0,fill:!0,material:o.fillMaterial})})},cartesianToLatlng:function(t){var t=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(t),e=ct.Math.toDegrees(t.latitude);return[ct.Math.toDegrees(t.longitude),e]}},(ht.prototype=Object.create(Object.assign({},ht.prototype,it.prototype))).constructor=ht;let ut=null;function dt(t,e,i){t&&(this._viewer=t,ut=e,this._installPlugin())}function pt({cesiumGlobal:t,containerId:e,viewerConfig:i={},extraConfig:n={},MapImageryList:a=[],defaultStatic:r}){if(!t)throw"Missing cesiumGlobal parameter, please check the calling function initCesium.";var o,l,h,x,Z,p,g,f,v,b,w,_,G,W;if(e)return e=new s(t).init({containerId:e,viewerConfig:i,extraConfig:n,MapImageryList:a}),_=e,G=t,W=r,n=(i=function(t,a){var e=null;function i(t){for(var e=Object.keys(t.prototype),i=0,n=e.length;i<n;i++)a.prototype[e[i]]=t.prototype[e[i]]}return Array.isArray(t)?(t.forEach(t=>{i(t)}),e=new a(_,G,W),t.forEach(t=>{t.call(e,_,G,W)})):(i(t),e=new a(_,G,W),t.call(e,_,G,W)),e})([m,d],u),a=i(m,c),o=i(m,y),l=i(m,C),h=i([m,y,A],I),x=i([m,d],P),Z=i(m,X),p=i(m,E),g=i(m,z),f=new m(e,t),i=i([m,I,z],U),v=new at(e,t),b=new st(e,t),w=new ht(e,t),new dt(e,t,r),{viewer:e,material:n,graphics:a,math3d:o,primitive:l,draw:h,passEffect:x,customCesiumPlugin:Z,control:p,plugin:g,base:f,analysis:i,attackArrowObj:v,straightArrowObj:b,pincerArrowObj:w};throw"Missing containerId parameter, please check the calling function initCesium."}dt.prototype={_installPlugin:function(){this._installCounputeVertex(),this._installCylinderGeometry(),this._installRadarPrimitive()},_installCylinderGeometry:function(){function I(t){this.length=t.length,this.topRadius=t.topRadius,this.bottomRadius=t.bottomRadius,this.slices=t.slices||64,this.zReverse=t.zReverse}var A=new ut.Cartesian2,_=new ut.Cartesian3,G=new ut.Ray;I._createGeometry=function(t){var e=t.length,i=t.topRadius,n=t.bottomRadius,a=t.slices,r=2*Math.PI/(a-1),o=[],s=[],l=[],c=[],h=[n,i],u=[0,t.zReverse?-e:e],x=0,t=Math.atan2(n-i,e),d=A;d.z=Math.sin(t);for(var Z=Math.cos(t),p=0;p<u.length;p++){c[p]=[];for(var g=h[p],m=0;m<a;m++){c[p].push(x++);var f=r*m,v=g*Math.cos(f),b=g*Math.sin(f);o.push(v,b,u[p]),v=Z*Math.cos(f),b=Z*Math.sin(f),s.push(v,b,d.z),l.push(p/(u.length-1),0)}}for(var y=[],p=1;p<u.length;p++)for(m=1;m<a;m++){var C=c[p-1][m-1],w=c[p][m-1],I=c[p][m],_=c[p-1][m];y.push(I),y.push(_),y.push(C),y.push(I),y.push(C),y.push(w),m==c[p].length-1&&(C=c[p-1][m],w=c[p][m],I=c[p][0],_=c[p-1][0],y.push(I),y.push(_),y.push(C),y.push(I),y.push(C),y.push(w))}y=new Int16Array(y),o=new Float32Array(o),s=new Float32Array(s),l=new Float32Array(l),n={position:new ut.GeometryAttribute({componentDatatype:ut.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:o}),normal:new ut.GeometryAttribute({componentDatatype:ut.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:s}),st:new ut.GeometryAttribute({componentDatatype:ut.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:l})},i=ut.BoundingSphere.fromVertices(o),e=new ut.Geometry({attributes:n,indices:y,primitiveType:ut.PrimitiveType.TRIANGLES,boundingSphere:i});return o=[],y=[],l=[],e},I.createGeometry=function(t,e){if(!e)return I._createGeometry(t);ut.Matrix4.multiplyByPoint(e,ut.Cartesian3.ZERO,_),_.clone(G.origin);var i=t.length,n=t.topRadius,a=(t.bottomRadius,t.slices),r=2*Math.PI/(a-1),o=[],s=[],l=[],c=[],h=[0,t.zReverse?-i:i],u=0,u=0;o.push(0,0,0),s.push(1,1),u++;for(var x=new ut.Cartesian3,d=n/15,Z=0;Z<16;Z++){for(var p=d*Z,g=[],m=0;m<a;m++){var f=r*m,v=p*Math.cos(f),f=p*Math.sin(f);x.x=v,x.y=f,x.z=h[1],(0,ut.Scene.extend2Earth)(x,e,G)?(g.push(u),o.push(v,f,h[1]),s.push(Z/15,1),u++):g.push(-1)}c.push(g)}for(var b,y,C=[0,c.length-1],w=0;w<C.length;w++)for(Z=C[w],m=1;m<c[Z].length;m++)b=c[Z][m-1],y=c[Z][m],0<=b&&0<=y&&l.push(0,b,y);o=new Float32Array(o),l=new Int32Array(l),s=new Float32Array(s),t={position:new ut.GeometryAttribute({componentDatatype:ut.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:o}),st:new ut.GeometryAttribute({componentDatatype:ut.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:s})},i=ut.BoundingSphere.fromVertices(o),n=new ut.Geometry({attributes:t,indices:l,primitiveType:ut.PrimitiveType.TRIANGLES,boundingSphere:i});return(0,ut.Scene.computeVertexNormals)(n),o=[],l=[],n},I.createOutlineGeometry=function(t){var e=t.length,i=t.topRadius,n=t.bottomRadius,a=t.slices,r=2*Math.PI/(a-1),o=[],s=[],l=[],c=[],h=[n,i],u=[0,t.zReverse?-e:e],x=0,t=Math.atan2(n-i,e),d=A;d.z=Math.sin(t);for(var Z=Math.cos(t),p=0;p<u.length;p++){c[p]=[];for(var g=h[p],m=0;m<a;m++){c[p].push(x++);var f=r*m,v=g*Math.cos(f),b=g*Math.sin(f);o.push(v,b,u[p]),v=Z*Math.cos(f),b=Z*Math.sin(f),s.push(v,b,d.z),l.push(p/(u.length-1),0)}}for(var y=[],p=1;p<u.length;p++)for(m=1;m<a;m+=1){var C=c[p-1][m-1],w=c[p][m-1];c[p][m],c[p-1][m],m%8==1&&y.push(C,w)}y=new Int16Array(y),o=new Float32Array(o),s=new Float32Array(s),l=new Float32Array(l),n={position:new ut.GeometryAttribute({componentDatatype:ut.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:o}),normal:new ut.GeometryAttribute({componentDatatype:ut.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:s}),st:new ut.GeometryAttribute({componentDatatype:ut.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:l})},i=ut.BoundingSphere.fromVertices(o),e=new ut.Geometry({attributes:n,indices:y,primitiveType:ut.PrimitiveType.LINES,boundingSphere:i});return o=[],y=[],l=[],e},I.fromAngleAndLength=function(t,e,i){return t=ut.Math.toRadians(t),new I({topRadius:Math.tan(t)*e/2,bottomRadius:0,length:e,zReverse:i})},ut.Scene.CylinderGeometry=I},_installRadarPrimitive:function(){var i;function t(t,e){e=e||{},i=t.scene.globe.ellipsoid,this._geometry=null,this._angle=e.angle,this._radius=e.radius||5,this._position=e.position,this._rotation=e.rotation||{heading:0,pitch:0,roll:0},this._trackedEntity=e.trackedEntity,this.defaultColor=e.color||ut.Color.YELLOW,this.defaultLineColor=e.lineColor||this.defaultColor,this._show=ut.defaultValue(e.show,!0),this._outline=ut.defaultValue(e.outline,!1),this._topShow=ut.defaultValue(e.top,!0),this._topOutline=ut.defaultValue(e.topOutline,!0),this._modelMatrix=ut.Matrix4.clone(ut.Matrix4.IDENTITY),this._quaternion=new ut.Quaternion,this._translation=new ut.Cartesian3,this._scale=new ut.Cartesian3(1,1,1),this._matrix=new ut.Matrix4,this._inverseMatrix=new ut.Matrix4,this._positionCartographic=new ut.Cartographic,this._positionCartesian=null,this._drawCommands=[],this._outlinePositions=[],this.viewer=t,this.viewer.scene.primitives.add(this),this.updateGeometry(),this._groundArea=ut.defaultValue(e.groundArea,!1),this.addGroundAreaEntity(this._groundArea)}Object.defineProperties(t.prototype,{trackedEntity:{get:function(){return this._trackedEntity},set:function(t){this._trackedEntity=t}},color:{get:function(){return this.defaultColor},set:function(t){this.defaultColor=t}},lineColor:{get:function(){return this.defaultLineColor},set:function(t){this.defaultLineColor=t}},show:{get:function(){return this._show},set:function(t){this._show=t}},outline:{get:function(){return this._outline},set:function(t){this._outline=t,this.updateGeometry()}},top:{get:function(){return this._topShow},set:function(t){this._topShow=t,this.updateGeometry()}},topOutline:{get:function(){return this._topOutline},set:function(t){this._topOutline=t,this.updateGeometry()}},groundArea:{get:function(){return this._groundArea},set:function(t){this._groundArea=t,this.addGroundAreaEntity(this._groundArea)}},angle:{get:function(){return this._angle},set:function(t){this._angle=t,this.updateGroundCircleRadius(),this.updateGeometry()}},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this.updateGroundCircleRadius(),this.updateGeometry()}},heading:{get:function(){return this._rotation.heading},set:function(t){this._rotation.heading=t}},pitch:{get:function(){return this._rotation.pitch},set:function(t){this._rotation.pitch=t}},roll:{get:function(){return this._rotation.roll},set:function(t){this._rotation.roll=t}},position:{get:function(){return this._position},set:function(t){this._position=t}}}),t.prototype.updateGroundCircleRadius=function(){this._ground_radius=this._radius*Math.cos(ut.Math.toRadians(this._angle))},t.prototype.addGroundAreaEntity=function(t){var e;t&&!this.groundAreaEntity&&((e=this).updateGroundCircleRadius(),this.groundAreaEntity=viewer.entities.add({position:this._position,ellipse:{show:0===this._rotation.pitch&&0===this._rotation.roll,semiMinorAxis:new ut.CallbackProperty(function(t){return e._ground_radius},!1),semiMajorAxis:new ut.CallbackProperty(function(t){return e._ground_radius},!1),material:this.defaultColor},polyline:{show:this._trackedEntityPosition&&(0!==this._rotation.pitch||0!==this._rotation.roll),positions:new ut.CallbackProperty(function(t){return!e._trackedEntityPosition||ut.Cartesian3.distance(e._position,e._trackedEntityPosition)>e._radius?[]:[e._position,e._trackedEntityPosition]},!1),followSurface:!1,material:new ut.PolylineDashMaterialProperty({color:ut.Color.CYAN}),width:1}}))};var n=new ut.Cartesian3;t.prototype.computeMatrix=function(t,e){return this._positionCartesian||(this._positionCartesian=new ut.Cartesian3),this.position instanceof ut.Cartesian3?this._positionCartesian=this.position:"function"==typeof this.position.getValue?this._positionCartesian=this.position.getValue(t):this.position._value&&this.position._value instanceof ut.Cartesian3&&(this._positionCartesian=this.position._value),this._trackedEntity&&this._trackedEntity.position&&(this._positionCartesian,t=ut.Property.getValueOrUndefined(this._trackedEntity.position,t,n))&&(this._trackedEntityPosition=t,this._rotation.heading=0,this._rotation.pitch=40,this._rotation.roll=0),this._modelMatrix=ut.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,i,this._modelMatrix),this._positionCartographic=ut.Cartographic.fromCartesian(this._positionCartesian,i,this._positionCartographic),ut.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,i,this._modelMatrix),ut.Quaternion.fromHeadingPitchRoll(this._rotation,this._quaternion),this._matrix=ut.Matrix4.fromTranslationQuaternionRotationScale(this._translation,this._quaternion,this._scale,this._matrix),ut.Matrix4.multiplyTransformation(this._modelMatrix,this._matrix,this._matrix),ut.Matrix4.inverseTransformation(this._matrix,this._inverseMatrix),this._matrix},t.prototype.getTopGeometry=function(){for(var t=this.radius,e=[],i=[],n=[],a=[],r=90-parseInt(this.angle),o=r<1?r/8:1,s=2*Math.PI/127,l=0,c=this.angle;c<91;c+=o){for(var h=ut.Math.toRadians(c<90?c:90),h=Math.cos(h)*t,u=[],x=0;x<128;x++){var d=s*x,Z=h*Math.cos(d),d=h*Math.sin(d),p=Math.sqrt(t*t-Z*Z-d*d);e.push(Z,d,p),i.push(1,1),u.push(l++)}a.push(u)}for(c=1;c<a.length;c++)for(x=1;x<a[c].length;x++){var g=a[c-1][x-1],m=a[c][x-1],f=a[c][x],v=a[c-1][x];n.push(g,m,f),n.push(g,f,v)}var e=new Float32Array(e),n=new Int32Array(n),i=new Float32Array(i),r={position:new ut.GeometryAttribute({componentDatatype:ut.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new ut.GeometryAttribute({componentDatatype:ut.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i})},b=ut.BoundingSphere.fromVertices(e),r=new ut.Geometry({attributes:r,indices:n,primitiveType:ut.PrimitiveType.TRIANGLES,boundingSphere:b});return(0,ut.Scene.computeVertexNormals)(r),r},t.prototype.getTopOutlineGeometry=function(){for(var t=this.radius,e=[],i=[],n=[],a=[],r=90-parseInt(this.angle),o=r<1?r/8:1,s=2*Math.PI/127,l=0,c=this.angle;c<91;c+=o){for(var h=ut.Math.toRadians(c<90?c:90),h=Math.cos(h)*t,u=[],x=0;x<128;x++){var d=s*x,Z=h*Math.cos(d),d=h*Math.sin(d),p=Math.sqrt(t*t-Z*Z-d*d);e.push(Z,d,p),i.push(1,1),u.push(l++)}a.push(u)}for(c=1;c<a.length;c++)for(x=1;x<a[c].length;x++){var g=a[c-1][x-1],m=a[c][x-1],f=a[c][x];a[c-1][x],x%8==1&&n.push(g,m),c%8==1&&n.push(m,f)}var e=new Float32Array(e),n=new Int32Array(n),i=new Float32Array(i),r={position:new ut.GeometryAttribute({componentDatatype:ut.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new ut.GeometryAttribute({componentDatatype:ut.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i})},v=ut.BoundingSphere.fromVertices(e),r=new ut.Geometry({attributes:r,indices:n,primitiveType:ut.PrimitiveType.LINES,boundingSphere:v});return(0,ut.Scene.computeVertexNormals)(r),r},t.prototype.updateGeometry=function(){this._geometry=ut.Scene.CylinderGeometry.createGeometry(new ut.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(ut.Math.toRadians(this.angle)),bottomRadius:0,length:this._radius*Math.sin(ut.Math.toRadians(this.angle))})),this._topGeometry=this.getTopGeometry(),this._topOutlineGeometry=this.getTopOutlineGeometry(),this._outlineGeometry=ut.Scene.CylinderGeometry.createOutlineGeometry(new ut.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(ut.Math.toRadians(this.angle)),bottomRadius:0,slices:128,length:this._radius*Math.sin(ut.Math.toRadians(this.angle))})),this._positions=new Float32Array(this._geometry.attributes.position.values.length);for(var t=0;t<this._positions.length;t++)this._positions[t]=this._geometry.attributes.position.values[t];this._drawCommands&&this._drawCommands.length&&(this._drawCommands.forEach(function(t){t.vertexArray=t.vertexArray&&t.vertexArray.destroy()}),this._drawCommands.splice(0,this._drawCommands.length))},t.prototype.update=function(e){this._show&&(this.computeMatrix(e.time),e.mode===ut.SceneMode.SCENE3D?(this._geometry.boundingSphere=ut.BoundingSphere.fromVertices(this._geometry.attributes.position.values),this._drawCommands&&this._drawCommands.length||(this._drawCommands.push(this.createDrawCommand(this._geometry,e)),this._outline&&this._drawCommands.push(this.createDrawCommand(this._outlineGeometry,e)),this._topShow&&(this._drawCommands.push(this.createDrawCommand(this._topGeometry,e)),this._topOutline)&&this._drawCommands.push(this.createDrawCommand(this._topOutlineGeometry,e))),this._drawCommands.forEach(function(t){e.commandList.push(t)}),this.groundAreaEntity&&(this.groundAreaEntity.ellipse.show=this._groundArea&&0===this._rotation.pitch&&0===this._rotation.roll,this.groundAreaEntity.polyline.show=!1)):(this.groundAreaEntity||this.addGroundAreaEntity(!0),this.groundAreaEntity.ellipse.show=0===this._rotation.pitch&&0===this._rotation.roll,this.groundAreaEntity.polyline.show=this._trackedEntityPosition&&(0!==this._rotation.pitch||0!==this._rotation.roll)))},t.prototype.getFragmentShaderSource=function(t){return"#version 300 es\n in vec3 v_position;\n in vec3 v_normal; \n uniform float picked; \n uniform vec4 pickedColor; \n uniform vec4 defaultColor; \n uniform float specular; \n uniform float shininess; \n uniform vec3 emission; \n in vec2 v_st; \n uniform bool isLine; \n uniform float glowPower; \n void main() { \n vec3 positionToEyeEC = -v_position; \n vec3 normalEC = normalize(v_normal); \n vec4 color = defaultColor; \n if (picked != 0.0) { \n color = pickedColor; \n } \n czm_material material; \n material.specular = specular; \n material.shininess = shininess; \n material.normal = normalEC; \n material.emission = emission;//vec3(0.2,0.2,0.2);\n material.diffuse = color.rgb ;\n if(isLine){\n material.alpha = 1.0; \n }\n else{ \n material.alpha = color.a; \n }\n if(v_st.x==0.0){ \n out_FragColor =color ;\n }else { \n out_FragColor = czm_phong(normalize(positionToEyeEC), material,czm_lightDirectionEC) ; \n } \n }"},t.prototype.getVertexShaderSource=function(t){return"#version 300 es\n #ifdef GL_ES\n precision highp float;\n #endif\n\n in vec3 position;\n in vec2 st;\n in vec3 normal;\n uniform mat4 modelViewMatrix;\n uniform mat3 normalMatrix;\n uniform mat4 projectionMatrix;\n out vec3 v_position;\n out vec3 v_normal;\n out vec2 v_st;\n\n out vec3 v_light0Direction;\n\n void main(void) \n {\n vec4 pos = modelViewMatrix * vec4( position,1.0);\n v_normal = normalMatrix * normal;\n v_st = st;\n v_position = pos.xyz;\n v_light0Direction = mat3( modelViewMatrix) * vec3(1.0,1.0,1.0);\n gl_Position = projectionMatrix * pos;\n }"},t.prototype.createDrawCommand=function(t,e,i){var n=e.context,a=new ut.Cartesian3,a=(ut.Matrix4.multiplyByPoint(this._matrix,t.boundingSphere.center,a),new ut.BoundingSphere(a,t.boundingSphere.radius)),i=new ut.DrawCommand({modelMatrix:i||this._matrix,owner:this,primitiveType:t.primitiveType,pass:ut.Pass.TRANSLUCENT,boundingVolume:a}),r=this,a=ut.GeometryPipeline.createAttributeLocations(t);return i.vertexArray=ut.VertexArray.fromGeometry({context:n,geometry:t,attributeLocations:a,bufferUsage:ut.BufferUsage.STATIC_DRAW}),i.vertexArray._attributeLocations=a,i.shaderProgram=ut.ShaderProgram.replaceCache({context:n,vertexShaderSource:this.getVertexShaderSource(t),fragmentShaderSource:this.getFragmentShaderSource(t),attributeLocations:a}),i.renderState=ut.RenderState.fromCache({blending:ut.BlendingState.ALPHA_BLEND,depthTest:{enabled:!0,func:ut.DepthFunction.LESS},cull:{enabled:!1,face:ut.CullFace.BACK}}),i.uniformMap={},i.uniformMap.projectionMatrix=function(){return e.context.uniformState.projection},i.uniformMap.modelViewMatrix=function(){return e.context.uniformState.modelView},i.uniformMap.shininess=function(){return r.shininess||(r.shininess=0),r.shininess},i.uniformMap.emission=function(){return r.emission||(r.emission=new ut.Cartesian3(.2,.2,.2)),r.emission},i.uniformMap.specular=function(){return r.specular||(r.specular=0),r.specular},i.uniformMap.isLine=function(){return t.primitiveType==ut.PrimitiveType.LINES||t.primitiveType==ut.PrimitiveType.LINE_STRIP},i.uniformMap.defaultColor=function(){return t.primitiveType==ut.PrimitiveType.LINES||t.primitiveType==ut.PrimitiveType.LINE_STRIP?(r.defaultLineColor||(r.defaultLineColor=new ut.Color(1,1,0,1)),r.defaultLineColor):(r.defaultColor||(r.defaultColor=new ut.Color(1,0,0,1)),r.defaultColor)},i.uniformMap.picked=function(){return r.picked||(r.picked=0),r.picked},i.uniformMap.pickedColor=function(){return r.pickedColor||(r.pickedColor=new ut.Color(1,1,0,1)),r.pickedColor},i.uniformMap.normalMatrix=function(){return e.context.uniformState.normal},i.uniformMap.glowPower=function(){return.25},i},t.prototype.remove=function(){this.viewer.scene.primitives.remove(this),this.groundAreaEntity&&this.viewer.entities.remove(this.groundAreaEntity)},t.prototype.addToScene=function(){this.viewer.scene.primitives.add(this),this.groundAreaEntity&&this.viewer.entities.add(this.groundAreaEntity)},t.prototype.destroy=function(t){t&&(this.viewer.scene.primitives.remove(this),this.groundAreaEntity&&this.viewer.entities.remove(this.groundAreaEntity),this._drawCommands.forEach(function(t){t.vertexArray=t.vertexArray&&t.vertexArray.destroy()}),this._drawCommands=[])},ut.Scene.RadarPrimitiveRight=t},_installCounputeVertex:function(){var a=new ut.Cartesian3,r=(new ut.Ray,new ut.Cartographic);ut.Scene.computeVertexNormals=function(t){var e=t.indices,i=t.attributes,n=e.length;if(i.position){var a=i.position.values;if(void 0===i.normal)i.normal=new ut.GeometryAttribute({componentDatatype:ut.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(a.length)});else for(var r=i.normal.values,o=0;o<n;o++)r[o]=0;for(var s,l,c,h=i.normal.values,u=new ut.Cartesian3,x=new ut.Cartesian3,d=new ut.Cartesian3,Z=new ut.Cartesian3,p=new ut.Cartesian3,o=0;o<n;o+=3)s=3*e[o+0],l=3*e[o+1],c=3*e[o+2],ut.Cartesian3.fromArray(a,s,u),ut.Cartesian3.fromArray(a,l,x),ut.Cartesian3.fromArray(a,c,d),ut.Cartesian3.subtract(d,x,Z),ut.Cartesian3.subtract(u,x,p),ut.Cartesian3.cross(Z,p,Z),h[s]+=Z.x,h[1+s]+=Z.y,h[2+s]+=Z.z,h[l]+=Z.x,h[1+l]+=Z.y,h[2+l]+=Z.z,h[c]+=Z.x,h[1+c]+=Z.y,h[2+c]+=Z.z;for(var g,m,f,v,b=t.attributes.normal.values,y=0;y<b.length;y+=3)g=b[y],m=b[y+1],f=b[y+2],v=1/Math.sqrt(g*g+m*m+f*f),b[y]=g*v,b[y+1]=m*v,b[y+2]=f*v;i.normal.needsUpdate=!0}return t},ut.Scene.extend2Earth=function(t,e,i,n){n=n||ut.Ellipsoid.WGS84,ut.Matrix4.multiplyByPoint(e,t,a),ut.Cartesian3.subtract(a,i.origin,i.direction),ut.Cartesian3.normalize(i.direction,i.direction);e=ut.IntersectionTests.rayEllipsoid(i,n),n=null;if(n=e?ut.Ray.getPoint(i,e.start):n)try{ut.Cartographic.fromCartesian(n,null,r)}catch(t){return null}return n}}};class gt{constructor(t){return this.init(t)}init({cesiumGlobal:t,containerId:e,viewerConfig:i={},extraConfig:n={},MapImageryList:a=[],defaultStatic:r,baseExtendsCom:o=[],extendsCom:l,extendsComName:c}){if(!t)throw"Missing cesiumGlobal parameter, please check the calling function initCesium.";if(e)return{viewer:e=new s(t).init({containerId:e,viewerConfig:i,extraConfig:n,MapImageryList:a}),[c]:this.prototypeExtends(e,t,r)(o,l)};throw"Missing containerId parameter, please check the calling function initCesium."}prototypeExtends(n,r,o){return function(t,a){var e=null;function i(t){for(var e=Object.keys(t.prototype),i=0,n=e.length;i<n;i++)a.prototype[e[i]]=t.prototype[e[i]]}return Array.isArray(t)?(t.forEach(t=>{i(t)}),e=new a(n,r,o),t.forEach(t=>{t.call(e,n,r,o)})):(i(t),e=new a(n,r,o),t.call(e,n,r,o)),e}}}class mt extends gt{constructor(t){return super({...t,baseExtendsCom:m,extendsCom:c,extendsComName:"graphics"})}}class ft extends gt{constructor(t){return super({...t,baseExtendsCom:[m,d],extendsCom:u,extendsComName:"material"})}}class vt extends gt{constructor(t){return super({...t,baseExtendsCom:m,extendsCom:C,extendsComName:"primitive"})}}class yt extends gt{constructor(t){return super({...t,baseExtendsCom:[m,y,A],extendsCom:I,extendsComName:"draw"})}}class bt{constructor(t){var e=new yt(t);return this._initCurrMeasure(t,e)}_initCurrMeasure(t,e){var i=new at(e.viewer,t.cesiumGlobal),n=new st(e.viewer,t.cesiumGlobal),t=new ht(e.viewer,t.cesiumGlobal);return{...e,attackArrowObj:i,straightArrowObj:n,pincerArrowObj:t}}}class Ct extends gt{constructor(t){return super({...t,baseExtendsCom:[m,I,z],extendsCom:U,extendsComName:"analysis"})}}class wt extends gt{constructor(t){return super({...t,baseExtendsCom:m,extendsCom:X,extendsComName:"customCesiumPlugin"})}}class It{constructor(t){var e=new wt(t);return this._initInter(e,t)}_initInter(t,e){return new dt(t.viewer,e.cesiumGlobal,e.defaultStatic),t}}class _t extends gt{constructor(t){return super({...t,baseExtendsCom:[m,d],extendsCom:P,extendsComName:"passEffect"})}}class At extends gt{constructor(t){return super({...t,baseExtendsCom:m,extendsCom:z,extendsComName:"plugin"})}}export{Ct as Analysis,It as CustomCesiumPlugin,bt as Draw,mt as Graphics,ft as Material,_t as PassEffect,At as Plugin,vt as Primitive,pt as initCesium};