cesium_dev_kit 1.0.53 → 1.0.55
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/README.md +28 -90
- package/dist/index.js +52 -52
- package/dist/index.min.js +1 -1
- package/package.json +2 -2
package/dist/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"libgif";import*as i from"@turf/turf";import{GUI as n}from"dat.gui";import r from"echarts";let o=null;class s{constructor(t){o=t,this.init_data()}init_data(){this.viewer=null}init({containerId:t,viewerConfig:e,extreaConfig:i,MapImageryList:n}){const a=t;let r=new o.SingleTileImageryProvider({url:"https://mapv-data.oss-cn-hangzhou.aliyuncs.com/Cesium-1.82-hawk/background.png"});0!==n.length&&(r=this.setOneimageryProvider(n[0]));let s={imageryProvider:r,contextOptions:{webgl:{alpha:!1}},animation:!1,timeline:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,selectionIndicator:!1,shadow:!0,sceneMode:o.SceneMode.SCENE3D,infoBox:!1,sceneModePicker:!1,navigationHelpButton:!1,projectionPicker:!1,baseLayerPicker:!1,shouldAnimate:!0,navigation:!1,showRenderLoopErrors:!0};s=Object.assign(s,e);const l=new o.Viewer(a,s);if(!i.logo){l.cesiumWidget.creditContainer.style.display="none"}return i.depthTest&&(l.scene.globe.depthTestAgainstTerrain=!0),this.setConfigMapList(l,n),this.removeJagged(l),this.viewer=l,l}setOneimageryProvider(t){var e;return t.classConfig.customTags&&(t.classConfig.customTags=(e="("+t.classConfig.customTags+")",new Function("return "+e)())),new o[t.type](t.classConfig)}setConfigMapList(t,e){const i=t.imageryLayers;e.some((t,e)=>{if(0===e)return!1;i.addImageryProvider(this.setOneimageryProvider(t))}),e.some((e,i)=>{const n=t.imageryLayers.get(i);e.interfaceConfig&&Object.getOwnPropertyNames(e.interfaceConfig).forEach((function(t){n[t]=e.interfaceConfig[t]})),n.invertColor=e.invertswitch,n.filterRGB=[255,255,255],"#000000"!==e.filterRGB&&"#ffffff"!==e.filterRGB&&(n.filterRGB=function(t){let e=t.toLowerCase();if(/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(e)){if(4===e.length){let t="#";for(let i=1;i<4;i+=1)t+=e.slice(i,i+1).concat(e.slice(i,i+1));e=t}const t=[];for(let i=1;i<7;i+=2)t.push(parseInt("0x"+e.slice(i,i+2)));return t}return[]}(e.filterRGB));const a=e.offset.split(",");if(2===a.length)try{const t=[parseFloat(a[0]),parseFloat(a[1])];n._imageryProvider._tilingScheme._rectangleNortheastInMeters.x+=t[0],n._imageryProvider._tilingScheme._rectangleNortheastInMeters.y+=t[1]}catch(t){console.log(t)}this.changeImageryProviderColors(t,n)})}removeJagged(t){t.scene.postProcessStages.fxaa.enabled=!1,t.scene.fxaa=!1;if(t.cesiumWidget._supportsImageRenderingPixelated){let e=window.devicePixelRatio;for(;e>=2;)e/=2;t.resolutionScale=e}}changeImageryProviderColors(t,e){const i=t.scene.globe._surfaceShaderSet.baseFragmentShaderSource.sources;for(let t=0;t<i.length;t++){const n=i[t],a="color = czm_saturation(color, textureSaturation);\n#endif\n";let r="color = czm_saturation(color, textureSaturation);\n#endif\n";e.invertColor&&(r+="\n color.r = 1.0 - color.r;\n color.g = 1.0 - color.g;\n color.b = 1.0 - color.b;\n ",r+=`\n color.r = color.r * ${e.filterRGB[0]}.0/255.0;\n color.g = color.g * ${e.filterRGB[1]}.0/255.0;\n color.b = color.b * ${e.filterRGB[2]}.0/255.0;\n `),-1!==n.indexOf(a)&&(i[t]=i[t].replace(a,r))}}getCurCenterlonLat(t){let e=t.camera.pickEllipsoid(new o.Cartesian2(t.canvas.clientWidth/2,t.canvas.clientHeight/2)),i=o.Ellipsoid.WGS84.cartesianToCartographic(e);return{lon:180*i.longitude/Math.PI,lat:180*i.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){if(t=t||{}){var e=t.radii||1e6;return 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){let e=[];for(let i in t.positions){let n=t.positions[i],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)),e.push(this._graphicsLayer.entities.add(a))}return e}},createLineGraphics:function(t){if(t&&t.positions){var e=this.createGraphics();return e.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){if(t=t||{}){var e=this.createGraphics();return e.polygon=this.getPolygonGraphics(t),e.clampToS3M=t.clampToS3M||!1,this._graphicsLayer.entities.add(e)}},createBoxGraphics:function(t){if(t=t||{}){var e=this.createGraphics();return e.position=t.position,e.name=t.name||"box_graphic",e.box=this.getBoxGraphics(t.box),this._graphicsLayer.entities.add(e)}},createModelGraphics:function(t){if(t&&t.position){var e=this.createGraphics();return e.model=this.getModelGraphics(t),e.position=t.position,this._graphicsLayer.entities.add(e)}},craeteCorridorGraphics:function(t){if(t&&t.positions){var e=this.createGraphics();return e.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){if(t&&t.positions){var e=this.createGraphics();return e.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 e={};if(t&&t.cylinder){var i=t.entity,n=t.cylinder,a=this;return e.cylinder=this.getCylinderGraphics(n),e.position=new l.CallbackProperty((function(){var t=i.position.getValue(a._viewer.clock.currentTime),e=a._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),n=l.Math.toDegrees(e.latitude),r=l.Math.toDegrees(e.longitude);return l.Cartesian3.fromDegrees(r,n,0)}),!1),e.cylinder.length=new l.CallbackProperty((function(){var t=i.position.getValue(a._viewer.clock.currentTime);return 2*a._viewer.scene.globe.ellipsoid.cartesianToCartographic(t).height}),!1),e}},createFadeCylinderGraphics:function(t){if((t=t||{})&&t.position){let e=this.createGraphics();return e.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){if(t&&t.position){var e=this.createGraphics();return e.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){if(t&&t.position){var e=this.createGraphics(),i=t.alp||1,n=t.flog||!0;return 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):(i+=.05)>=1&&(n=!0),l.Color.RED.withAlpha(i)}),!1))},this._graphicsLayer.entities.add(e)}},craeteDynamicCricleGraphics:function(t){if(t&&t.center){var e=this.createGraphics(),i=this,n=t.center,a=t.radius||800,r=t.rotateAmount||.05,o=0,s=t.height||1,c=t.scale||null,h=t.scale2||null,x=t.material||new l.ImageMaterialProperty({image:t.imge||this.getDfSt(["graphic","craeteDynamicCricleGraphics"])||"static/data/images/Textures/circle_bg.png",transparent:!0});e.position=new l.CallbackProperty((function(){return i.transformWGS84ToCartesian(n)}),!1),e.orientation=new l.CallbackProperty((function(){return l.Transforms.headingPitchRollQuaternion(i.transformWGS84ToCartesian(n),new l.HeadingPitchRoll(l.Math.toRadians(0),l.Math.toRadians(0),l.Math.toRadians(0)))}),!1);let d=a,u=!1;return e.ellipse={material:x,height:s,semiMajorAxis:new l.CallbackProperty((function(){return a}),!1),semiMinorAxis:new l.CallbackProperty((function(){return a}),!1),stRotation:new l.CallbackProperty((function(){return r>0&&(o+=r)>=360&&(o=0),c&&((a>=c||a<=d)&&(u=!u),u?a+=2:a-=2),h&&(h>=a?a+=2:a=d),o}),!1)},this._graphicsLayer.entities.add(e)}},craeteDynamicShadeWallGraphics:function(t){if(t&&t.positions){var e=t.alp||1,i=t.num||20,n=t.color||l.Color.RED,a=t.speed||.003,r=this.createGraphics();return r.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||e>=1)&&i++,n.withAlpha(e)}),!1)})},this._graphicsLayer.entities.add(r)}},createCustomDefBillboardGraphics:function(t){if(t&&t.position){var e=this,i=document.createElement("img");i.src=t.img||this.getDfSt(["graphic","createCustomDefBillboardGraphics"])||"static/data/images/file/div1.png";const n=function(t){if(t.image){var e=document.createElement("canvas");e.width=t.width||150,e.height=t.height||80;var i=e.getContext("2d");i.drawImage(t.image,0,0);var n=t.text;return i.font="15px bold 宋体",i.fillStyle="#f4fff0",i.fillText(n,55,36),e}};i.onload=function(){t.image=i;var a=e._graphicsLayer.entities.add({position:t.position,billboard:{image:n(t),scaleByDistance:new l.NearFarScalar(150,.7,15e6,.5),verticalOrigin:l.VerticalOrigin.BOTTOM,pixelOffset:t.b_pixelOffset||new l.Cartesian2(80,-35),width:140,height:100,scale:t.b_scale||1.5,disableDepthTestDistance:Number.POSITIVE_INFINITY,imageSubRegion:{x:0,y:0,width:200,height:150}}});"function"==typeof t.callback&&t.callback(a)}}},craeteRotatePlaneGraphics:function(t){if(t&&t.center&&t.positions){var e=this.createGraphics(),i=0,n=t.positions,a=n[0];return 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){if(t&&t.position){var e=this.createGraphics();return e.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){if(e&&t&&t.position){var i=[],n=t.url,a=0;return function(t,i){var n=document.createElement("img");n.src=t,n.setAttribute("rel:animated_src",t),n.setAttribute("rel:auto_play","0"),document.body.appendChild(n);var a=new e({gif:n});return new Promise(t=>{a.load(()=>{for(let t=1;t<=a.get_length();t++)a.move_to(t),i.push(a.get_canvas().toDataURL());t(i)})})}(n,i),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){if(t&&t.entity&&t.rotateAmount){var 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 i>0&&(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,i=t.minHeiht||5,n=t.maxHeiht||100,a=t.cartesians,r=t.speed||.06,o=this,s=i,c=!1;a.length?e.positions=new l.CallbackProperty((function(){var t=o.transformCartesianArrayToWGS84Array(a);for(var e in t){var l=t[e];(i>=n||i<=s)&&(c=!c),c?i+=r:i-=r,l.alt=i}return o.transformWGS84ArrayToCartesianArray(t)}),!1):e.position=new l.CallbackProperty((function(){var t=o.transformCartesianToWGS84(a);return(i>=n||i<=s)&&(c=!c),c?i+=r:i-=r,t.alt=i,o.transformWGS84ToCartesian(t)}),!1)}catch(t){console.log(t)}},createCanvasGraphics:function(t){if(t&&t.positions){const e=function(){var e=0,i=document.createElement("canvas"),n=i.getContext("2d"),a=new Image;if(a.src=t.img||"../../images/ysCesium/logo.png",n.clearRect(0,0,t.cwidth,t.cheight),!(e<=t.cwidth))return e=0,e+=3,i;n.drawImage(a,e,0)};this._graphicsLayer.entities.add({rectangle:{coordinates:t.positions,material:new l.ImageMaterialProperty({image:new l.CallbackProperty(e,!1),transparent:!0})}}),"function"==typeof t.callback&&t.callback()}}};let x=null;function d(t,e,i){t&&(x=e,this._installMaterial())}function u(){}d.prototype={addMaterialLineGraphics:function(t){if(this._viewer&&t&&t.image){this._initPolylineCustomMaterialProperty(t);var e=this.createGraphics();return e.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(t){if(t){var e=x.Color,i=x.defaultValue,n=x.defined,a=Object.defineProperties,r=x.Event,o=x.createPropertyDescriptor,s=x.Property,l=x.Material,c=e.WHITE,h=t.MaterialType||"wallType"+parseInt(1e3*Math.random());const d=function(t){t=i(t,i.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(e,i){return n(i)||(i={}),i.color=s.getValueOrClonedDefault(this._color,e,c,i.color),i.image=t.image,void 0===this._time&&(this._time=e.secondsOfDay),i.time=1e3*(e.secondsOfDay-this._time)/this.duration,i},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:t.color||new x.Color(1,0,0,.5),image:t.image,time:t.color.time||0},source:this._getDynamicLineShader({get:!0})},translucent:function(){return!0}}),new d(t)}},addMaterialWallGraphics:function(t){if(this._viewer&&t&&t.image){this._initWallCustomMaterialProperty(t);var e=this.createGraphics();return e.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(t){var e=x.Color,i=x.defaultValue,n=x.defined,a=Object.defineProperties,r=x.Event,o=x.createPropertyDescriptor,s=x.Property,l=x.Material,c=t.MaterialType||"wallType"+parseInt(1e3*Math.random());const h=function(t){t=i(t,i.EMPTY_OBJECT),this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=t.color||e.BLUE,this.duration=t.duration||3e3,this._time=(new Date).getTime()};return a(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(i,a){return n(a)||(a={}),a.color=s.getValueOrClonedDefault(this._color,i,e.WHITE,a.color),a.image=t.image,a.time=((new Date).getTime()-this._time)%this.duration/this.duration,a},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 e(1,0,0,.5),image:t.image,time:0},source:this._getDirectionWallShader({get:!0,count:t.count,freely:t.freely,direction:t.direction})},translucent:function(){return!0}}),x.Scene.WallLinkCustomMaterialProperty=h,new h(t)},_installMaterial:function(){this._installWaveCircleMaterial(),this._installCircleFadeMaterial(),this._installCityLineMaterial(),this._installWarnMaterial(),this._installFlowMaterial()},_installWaveCircleMaterial:function(){var t=x.Color,e=x.defaultValue,i=Object.defineProperties,n=x.Event,a=x.Property,r=x.Material;function o(i){i=i||{},this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._duration=void 0,this._durationSubscription=void 0,this.color=e(i.color,t.fromBytes(0,255,255,255)),this.duration=e(i.duration,45),this.count=Math.max(e(i.count,2),1),this.gradient=e(i.gradient,.1),this.gradient<0?this.gradient=0:this.gradient>1&&(this.gradient=1)}i(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={}),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)},i(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 t(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={}),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 i(e)||(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 t=x.Color,e=x.defaultValue,i=x.defined,n=Object.defineProperties,a=x.Event,r=x.createPropertyDescriptor,o=x.Property,s=x.Material;function l(i){i=e(i,e.EMPTY_OBJECT),this._definitionChanged=new a,this._color=void 0,this._colorSubscription=void 0,this.color=i.color||t.BLUE,this.duration=i.duration||3e3,this._time=(new Date).getTime()}n(l.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),l.prototype.getType=function(){return s.WarnLinkType},l.prototype.getValue=function(e,n){return i(n)||(n={}),n.color=o.getValueOrClonedDefault(this._color,e,t.WHITE,n.color),n.image=s.WarnLinkImage,n.time=((new Date).getTime()-this._time)%this.duration/this.duration,n},l.prototype.equals=function(t){return this===t||t instanceof l&&o.equals(this._color,t._color)},n(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 t(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 t=x.Color,e=x.defaultValue,i=Object.defineProperties,n=x.Event,a=x.createPropertyDescriptor,r=x.Property,o=x.Material;function s(i){i=e(i,e.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this.color=i.color||t.fromBytes(0,255,255,255),this._duration=void 0,this._durationSubscription=void 0,this.duration=e(i.duration,45)}i(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={}),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)},i(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 t(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(texture2D(image, vec2(0.0, 0.0)).a == 1.0){\n discard;\n }else{\n material.alpha = texture2D(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 = texture2D(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){if(t&&t.get){var e="czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n \n ";return"vertical"==t.freely?e+="vec4 colorImage = texture2D(image, vec2(fract(float("+t.count+")*st.t "+t.direction+" time), fract(st.s)));\n ":e+="vec4 colorImage = texture2D(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 ",e+=" 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 varying vec2 v_textureCoordinates;\n uniform vec4 u_scanCenterEC;\n uniform vec3 u_scanPlaneNormalEC;\n uniform vec3 u_scanLineNormalEC;\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 gl_FragColor = texture2D(colorTexture, v_textureCoordinates);\n float depth = getDepth( texture2D(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 gl_FragColor = mix(gl_FragColor, u_scanColor, f + f0);\n } else {\n gl_FragColor = mix(gl_FragColor, u_scanColor, f);\n }\n }\n }\n "},_getCircleScanShader:function(t){if(t&&t.get)return"uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n varying vec2 v_textureCoordinates;\n uniform vec4 u_scanCenterEC;\n uniform vec3 u_scanPlaneNormalEC;\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 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 gl_FragColor = texture2D(colorTexture, v_textureCoordinates);\n float depth = getDepth(texture2D(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 gl_FragColor = mix(gl_FragColor, 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){const e=t.reduce((t,e)=>t?t[e]:g[e],void 0);return g.baseService+e}},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){t=t||{};return this._viewer.scene.postProcessStages.add(new p.PostProcessStage({name:"darkEffect",fragmentShader:"uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nuniform float scale;\nuniform vec3 offset;\nvoid main() {\n // vec4 color = texture2D(colorTexture, v_textureCoordinates);\n vec4 color = texture2D(colorTexture, v_textureCoordinates);\n // float gray = 0.2989*color.r+0.5870*color.g+0.1140*color.b;\n // gl_FragColor = vec4(gray,gray,2.0*(gray+1.0), 1.0);\n gl_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\nvarying 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 += texture2D(colorTexture1, st + offset);\n}\n}\nresult = result / float(count);\ngl_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 varying 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 gl_FragColor = mix(texture2D(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 varying vec2 v_textureCoordinates;\n \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 gl_FragColor = mix(texture2D(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(texture2D(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; \nvarying vec2 v_textureCoordinates; \nvoid main(void) \n{ \n float distance = getDistance(depthTexture, v_textureCoordinates); \n vec4 sceneColor = texture2D(colorTexture, v_textureCoordinates); \n float blendAmount = interpolateByDistance(fogByDistance, distance); \n vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount); \n gl_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){if(this._viewer&&t&&t.position){if(t.distance){var 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){if(this._viewer&&t&&t.position){if(t.distance){var 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){var e=p.Ellipsoid.WGS84.cartesianToCartographic(t);return{lng:p.Math.toDegrees(e.longitude),lat:p.Math.toDegrees(e.latitude),alt:e.height}}},transformWGS84ArrayToCartesianArray:function(t,e){if(this._viewer&&t){var i=this;return 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){if(this._viewer){var e=this;return t?t.map((function(t){return e.transformCartesianToWGS84(t)})):[]}},setCameraEotateHeading(t){if(t){let e=this._viewer,i=p.Cartesian3.fromDegrees(t.lng,t.lat,t.height),n=p.Math.toRadians(-30),a=12,r=5e3,o=p.JulianDate.fromDate(new Date);e.clock.startTime=o.clone(),e.clock.currentTime=o.clone(),e.clock.clockRange=p.ClockRange.CLAMPED,e.clock.clockStep=p.ClockStep.SYSTEM_CLOCK;let s=e.camera.heading,l=function(){let t=p.JulianDate.secondsDifference(e.clock.currentTime,e.clock.startTime),o=p.Math.toRadians(t*a)+s;e.scene.camera.setView({destination:i,orientation:{heading:o,pitch:n}}),e.scene.camera.moveBackward(r),p.JulianDate.compare(e.clock.currentTime,e.clock.stopTime)>=0&&e.clock.onTick.removeEventListener(l)};e.clock.onTick.addEventListener(l)}},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=this._viewer.scene.pick(t),i=null,n=!1,a=!1;if(e instanceof p.Cesium3DTileFeature&&(n=!0),n&&(i=this._viewer.scene.pickPosition(t))){let t=p.Cartographic.fromCartesian(i);t.height<0&&(t.height=0);let e=p.Math.toDegrees(t.longitude),n=p.Math.toDegrees(t.latitude),a=t.height;i=this.transformWGS84ToCartesian({lng:e,lat:n,alt:a})}if(!e){var r=this._viewer.scene.camera.getPickRay(t);if(!r)return null;i=this._viewer.scene.globe.pick(r,this._viewer.scene),a=!0}if(n||a||(i=this._viewer.scene.camera.pickEllipsoid(t,this._viewer.scene.globe.ellipsoid)),i){let t=this.transformCartesianToWGS84(i);return t.alt<0&&(i=this.transformWGS84ToCartesian(t,.1)),i}return!1}},getCameraPosition:function(){if(this._viewer){var t=this._viewer.scene.camera.pickEllipsoid(new p.Cartesian2(this._viewer.canvas.clientWidth/2,this._viewer.canvas.clientHeight/2));if(t){var e=p.Ellipsoid.WGS84.cartesianToCartographic(t),i=180*e.longitude/Math.PI,n=180*e.latitude/Math.PI,a=this._viewer.camera._direction,r=p.Math.toDegrees(a.x),o=p.Math.toDegrees(a.y),s=p.Math.toDegrees(a.z),l=this._viewer.camera.positionCartographic.height,c=p.Math.toDegrees(this._viewer.camera.heading),h=p.Math.toDegrees(this._viewer.camera.pitch),x=p.Math.toDegrees(this._viewer.camera.roll),d=this._viewer.camera.computeViewRectangle(),u=d.west/Math.PI*180,g=d.north/Math.PI*180,m=(u+d.east/Math.PI*180)/2,f=(g+d.south/Math.PI*180)/2;return{lon:i,lat:n,height:l,heading:c,pitch:h,roll:x,position:this._viewer.camera.position,cameraHeading:this._viewer.camera.heading,cameraPitch:this._viewer.camera.pitch,cameraRoll:this._viewer.camera.roll,center:{x:m,y:f},direction:new p.Cartesian3(r,o,s)}}}},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:t,mouseMove:e,doubleClick:i,leftDown:n,mouseWheel:a,leftUp:r}){if(this._viewer){var o=new p.ScreenSpaceEventHandler(this._viewer.canvas);t&&o.setInputAction((function(e){t(e,o)}),p.ScreenSpaceEventType.LEFT_CLICK),e&&o.setInputAction((function(t){e(t,o)}),p.ScreenSpaceEventType.MOUSE_MOVE),i&&o.setInputAction((function(t){i(t,o)}),p.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),n&&o.setInputAction((function(t){n(t,o)}),p.ScreenSpaceEventType.LEFT_DOWN),a&&o.setInputAction((function(t){a(t,o)}),p.ScreenSpaceEventType.WHEEL),r&&o.setInputAction((function(t){r(t,o)}),p.ScreenSpaceEventType.LEFT_UP)}},getHandelPosition:function(t){if(this._viewer){var e=new p.ScreenSpaceEventHandler(this._viewer.scene.canvas),i=this;e.setInputAction((function(n){var a=i._viewer.scene.camera.pickEllipsoid(n.endPosition,i._viewer.scene.globe.ellipsoid);"function"==typeof t&&t(i.transformCartesianToWGS84(a),e)}),p.ScreenSpaceEventType.MOUSE_MOVE)}},saveSceneImages:function(){if(this._viewer){const a=function(t){for(var e=t.split(","),i=e[0].match(/:(.*?);/)[1],n=atob(e[1]),a=n.length,r=new Uint8Array(a);a--;)r[a]=n.charCodeAt(a);return new Blob([r],{type:i})};var t=this._viewer.scene.canvas.toDataURL("image/png").replace("image/png","image/octet-stream"),e=document.createElement("a"),i=a(t),n=URL.createObjectURL(i);e.download="scene.png",e.href=n,e.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}}):t.url="https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",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 t="http://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}";function e(e){t=e.temp_url||t,this._url=t,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=e.style||"normal"}Object.defineProperties(e.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},tileWidth:{get:function(){if(!this.ready)throw new p.DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this.ready)throw new p.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this.ready)throw new p.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},minimumLevel:{get:function(){if(!this.ready)throw new p.DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get:function(){if(!this.ready)throw new p.DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this.ready)throw new p.DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},ready:{get:function(){return!!this._url}},credit:{get:function(){return this._credit}}}),e.prototype.requestImage=function(t,e,i){if(!this.ready)throw new p.DeveloperError("requestImage must not be called before the imagery provider is ready.");var n=this._tilingScheme.getNumberOfXTilesAtLevel(i),a=this._tilingScheme.getNumberOfYTilesAtLevel(i),r=this._url.replace("{x}",t-n/2).replace("{y}",a/2-e-1).replace("{z}",i).replace("{s}",1).replace("{style}",this._style);return p.ImageryProvider.loadImage(this,r)},p.Scene.BaiduImageryProvider=e},_installGroundSkyBox:function(){var t=p.BoxGeometry,e=p.Cartesian3,i=p.defaultValue,n=p.defined,a=p.destroyObject,r=p.DeveloperError,o=p.GeometryPipeline,s=p.Matrix3,l=p.Matrix4,c=p.Transforms,h=p.VertexFormat,x=p.BufferUsage,d=p.CubeMap,u=p.DrawCommand,g=p.loadCubeMap,m=p.RenderState,f=p.VertexArray,v=p.BlendingState,y=p.SceneMode,b=p.ShaderProgram,C=p.ShaderSource;function w(t){this.sources=t.sources,this._sources=void 0,this.show=i(t.show,!0),this._command=new u({modelMatrix:l.clone(l.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}n(l.getRotation)||(l.getRotation=l.getMatrix3);var I=new s;w.prototype.update=function(i,a){var s=this;if(this.show&&(i.mode===y.SCENE3D||i.mode===y.MORPHING)&&i.passes.render){var u=i.context;if(this._sources!==this.sources){this._sources=this.sources;var p=this.sources;if(!(n(p.positiveX)&&n(p.negativeX)&&n(p.positiveY)&&n(p.negativeY)&&n(p.positiveZ)&&n(p.negativeZ)))throw new r("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof p.positiveX!=typeof p.negativeX||typeof p.positiveX!=typeof p.positiveY||typeof p.positiveX!=typeof p.negativeY||typeof p.positiveX!=typeof p.positiveZ||typeof p.positiveX!=typeof p.negativeZ)throw new r("this.sources properties must all be the same type.");"string"==typeof p.positiveX?g(u,this._sources).then((function(t){s._cubeMap=s._cubeMap&&s._cubeMap.destroy(),s._cubeMap=t})):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new d({context:u,source:p}))}var w=this._command;if(w.modelMatrix=c.eastNorthUpToFixedFrame(i.camera._positionWC),!n(w.vertexArray)){w.uniformMap={u_cubeMap:function(){return s._cubeMap},u_rotateMatrix:function(){return l.getRotation(w.modelMatrix,I)}};var A=t.createGeometry(t.fromDimensions({dimensions:new e(2,2,2),vertexFormat:h.POSITION_ONLY})),_=this._attributeLocations=o.createAttributeLocations(A);w.vertexArray=f.fromGeometry({context:u,geometry:A,attributeLocations:_,bufferUsage:x._DRAW}),w.renderState=m.fromCache({blending:v.ALPHA_BLEND})}if(!n(w.shaderProgram)||this._useHdr!==a){var G=new C({defines:[a?"HDR":""],sources:["uniform samplerCube u_cubeMap;\n varying vec3 v_texCoord;\n void main()\n {\n vec4 color = textureCube(u_cubeMap, normalize(v_texCoord));\n gl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n }\n "]});w.shaderProgram=b.fromCache({context:u,vertexShaderSource:"attribute vec3 position;\n varying 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:G,attributeLocations:this._attributeLocations}),this._useHdr=a}if(n(this._cubeMap))return w}},w.prototype.isDestroyed=function(){return!1},w.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(),a(this)},p.Scene.GroundSkyBox=w},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,l=180*r.latitude/Math.PI,c=180*o.longitude/Math.PI,h=180*o.latitude/Math.PI,x=Math.sqrt((s-c)*(s-c)+(l-h)*(l-h))*i,d=v.Cartesian3.clone(t),u=v.Cartesian3.clone(e),p=v.Cartesian3.distance(d,v.Cartesian3.ZERO),g=v.Cartesian3.distance(u,v.Cartesian3.ZERO);if(v.Cartesian3.normalize(d,d),v.Cartesian3.normalize(u,u),0==v.Cartesian3.distance(d,u))return a;var m=v.Cartesian3.angleBetween(d,u);a.push(t);for(var f=1;f<n-1;f++){var y=1*f/(n-1),b=1-y,C=Math.sin(b*m)/Math.sin(m),w=Math.sin(y*m)/Math.sin(m),I=v.Cartesian3.multiplyByScalar(d,C,new v.Cartesian3),A=v.Cartesian3.multiplyByScalar(u,w,new v.Cartesian3),_=v.Cartesian3.add(I,A,new v.Cartesian3),G=y*Math.PI,W=p*b+g*y+Math.sin(G)*x;_=v.Cartesian3.multiplyByScalar(_,W,_),a.push(_)}return a.push(e),a}},getPositionsAngle:function(t){if(t){var e,i=t.position1,n=t.position2,a=v.Transforms.eastNorthUpToFixedFrame(i),r=v.Matrix4.inverse(a,new v.Matrix4),o=v.Matrix4.multiplyByPoint(r,i,new v.Cartesian3),s=v.Matrix4.multiplyByPoint(r,n,new v.Cartesian3);"pitch"===t.type?e=Math.atan2(s.z-o.z,s.x-o.x):"heading "===t.type&&(e=Math.atan2(s.y-o.y,s.x-o.x));var l=e*(180/Math.PI);return l<0&&(l+=360),l}},getPositionsArea:function(t){let e=0;if(t){let i=0,n=v.Ellipsoid.WGS84;t.push(t[0]);for(let e=1;e<t.length;e++){let a=n.cartographicToCartesian(this.transformWGS84ToCartographic(t[e-1])),r=n.cartographicToCartesian(this.transformWGS84ToCartographic(t[e]));i+=a.x*r.y-r.x*a.y}e=Math.abs(i).toFixed(2)}return e},getPolygonArea:function(t){if(this._viewer){for(var e=function(t,e){var i=t.lat*radiansPerDegree,n=t.lon*radiansPerDegree,a=e.lat*radiansPerDegree,r=e.lon*radiansPerDegree,o=-Math.atan2(Math.sin(n-r)*Math.cos(a),Math.cos(i)*Math.sin(a)-Math.sin(i)*Math.cos(a)*Math.cos(n-r));return o<0&&(o+=2*Math.PI),o*=degreesPerRadian},i=0,n=0;n<t.length-2;n++){var a=(n+1)%t.length,r=(n+2)%t.length,o=(s=t[n],l=t[a],c=t[r],h=void 0,(h=e(l,s)-e(l,c))<0&&(h+=360),h);i+=this.getPositionsDistance(positions[n],positions[a])*this.getPositionsDistance(positions[a],positions[r])*Math.abs(Math.sin(o))}return(i/1e6).toFixed(4)}var s,l,c,h},getPointDistance:function(t,e){if(this._viewer){var i=v.Cartographic.fromCartesian(t),n=v.Cartographic.fromCartesian(e),a=new v.EllipsoidGeodesic;a.setEndPoints(i,n);var r=a.surfaceDistance;return r=Math.sqrt(Math.pow(r,2)+Math.pow(n.height-i.height,2))}},getPositionDistance:function(t){let e=0;for(let i=0;i<t.length-1;i++){let n=this.transformWGS84ToCartographic(t[i]),a=this.transformWGS84ToCartographic(t[i+1]),r=new v.EllipsoidGeodesic;r.setEndPoints(n,a);let o=r.surfaceDistance;o=Math.sqrt(Math.pow(o,2)+Math.pow(a.height-n.height,2)),e+=o}return e.toFixed(3)},getIntersectObj:function(t,e,i=[],n=!1){if(this._viewer){var a=v.Cartesian3.normalize(v.Cartesian3.subtract(e,t,new v.Cartesian3),new v.Cartesian3),r=new v.Ray(t,a),o=[];if(n)o=this._viewer.scene.drillPickFromRay(r,10,i);else{var s=this._viewer.scene.pickFromRay(r,i);v.defined(s)&&(o=[s])}return o}},getPointOnEllipsoid:function(t,e,i,n,a,r,o,s,l,c){if(this._viewer){var h=new v.Cartesian3,x=new v.Cartesian3,d=new v.Quaternion,u=new v.Matrix3,p=t+e;v.Cartesian3.multiplyByScalar(n,Math.cos(p),h),v.Cartesian3.multiplyByScalar(i,Math.sin(p),x),v.Cartesian3.add(h,x,h);var g=Math.cos(t);g*=g;var m=Math.sin(t);m*=m;var f=r/Math.sqrt(o*g+a*m)/s;return v.Quaternion.fromAxisAngle(h,f,d),v.Matrix3.fromQuaternion(d,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,h=i?t.length/3*2:t.length/3,x=new Float64Array(3*h),d=t.length,u=i?d:0,p=0;p<d;p+=3){var g=p+1,m=p+2,f=v.Cartesian3.fromArray(t,p,n);s.scaleToGeodeticSurface(f,f);var y=v.Cartesian3.clone(f,a),b=s.geodeticSurfaceNormal(f,o),C=v.Cartesian3.multiplyByScalar(b,l,r);v.Cartesian3.add(f,C,f),i&&(v.Cartesian3.multiplyByScalar(b,c,C),v.Cartesian3.add(y,C,y),x[p+u]=y.x,x[g+u]=y.y,x[m+u]=y.z),x[p]=f.x,x[g]=f.y,x[m]=f.z}return x}},computeEllipseEdgePositions:function(t){if(this._viewer){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,c=t.granularity&&"number"==typeof t.granularity?t.granularity:Math.PI/180;c>Math.PI/12&&(c=Math.PI/12),c<Math.PI/180&&(c=Math.PI/180);var h=r*r,x=o*o,d=o*r,u=v.Cartesian3.magnitude(l),p=v.Cartesian3.normalize(l,e),g=v.Cartesian3.cross(v.Cartesian3.UNIT_Z,l,i);g=v.Cartesian3.normalize(g,g);var m,f=v.Cartesian3.cross(p,g,n),y=Math.ceil(2*v.Math.PI/c),b=c,C=0,w=a,I=0,A=[];for(m=0;m<y;m++)C=m*b,w=this.getPointOnEllipsoid(C,s,f,g,h,d,x,u,p,w),A[I++]=w.x,A[I++]=w.y,A[I++]=w.z;var _={};return _.numPts=y,_.outerPositions=A,_}},computeSectorEdgePositions:function(t){if(this._viewer){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?t.angle:2*Math.PI,c=t.center,h=t.granularity&&"number"==typeof t.granularity?t.granularity:Math.PI/180;h>Math.PI/12&&(h=Math.PI/12),h<Math.PI/180&&(h=Math.PI/180);var x=r*r,d=o*o,u=o*r,p=v.Cartesian3.magnitude(c),g=v.Cartesian3.normalize(c,e),m=v.Cartesian3.cross(v.Cartesian3.UNIT_Z,c,i);m=v.Cartesian3.normalize(m,m);var f,y=v.Cartesian3.cross(g,m,n),b=Math.ceil(l/h),C=h,w=0,I=a,A=0,_=[];for(f=0;f<b;f++)w=f*C,I=this.getPointOnEllipsoid(w,s,y,m,x,u,d,p,g,I),_[A++]=I.x,_[A++]=I.y,_[A++]=I.z;var G={};return G.numPts=b,G.outerPositions=_,G}},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,e){if(this._viewer){if(t.length<=0)return;for(var i=[],n=0;n<t.length;n++)i.push(v.Cartesian3.fromRadians(t[n].longitude,t[n].latitude,t[n].height));var a=this._viewer.scene.clampToHeightMostDetailed(i),r=this;a.then((function(t){for(var i=[],n=r._viewer.scene.globe.ellipsoid,a=0;a<t.length;a++)i.push(n.cartesianToCartographic(t[a]));e(i)})).otherwise((function(t){console.log(t)}))}},_checkLonDegree:function(t){return!(t>180||t<-180)},_checkLatDegree:function(t){return!(t>90||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=[];i.push([t.lon,t.lat]);var n=Math.sqrt(Math.pow(e.lon-t.lon,2)+Math.pow(e.lat-t.lat,2));if(n<=1e-5)return i.push([e.lon,e.lat]),i;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=[];n.push(new v.Cartographic(t.longitude,t.latitude));var a=Math.sqrt(Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2)),r=i&&"number"==typeof i?i:1e-5*Math.PI/180;if(a<=r)return n.push(new v.Cartographic(e.longitude,e.latitude)),n;for(var o=a/r,s=(e.longitude-t.longitude)/o,l=(e.latitude-t.latitude)/o,c=0;c<o;c++){var h=t.longitude+(c+1)*s,x=t.latitude+(c+1)*l;n.push(new v.Cartographic(h,x))}return n.push(new v.Cartographic(e.longitude,e.latitude,e.height)),n},computeInterpolateLineHeightCartographic:function(t,e){if(!t||!e)return null;if(!(t.longitude&&t.latitude&&e.longitude&&e.latitude))return null;var i=[];i.push(new v.Cartographic(t.longitude,t.latitude,t.height));var n=Math.sqrt(Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2));if(n<=1e-5*Math.PI/180)return i.push(new v.Cartographic(e.longitude,e.latitude,e.height)),i;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,x=t.height+(l+1)*s;i.push(new v.Cartographic(c,h,x))}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,x=t.height+(l+1)*s;a.push(new v.Cartographic(c,h,x))}return a},computeInterpolateIndexLineHeightCartographic:function(t,e,i,n){if(!t||!e)return null;if(!(t.longitude&&t.latitude&&e.longitude&&e.latitude))return null;var a=(e.longitude-t.longitude)/i,r=(e.latitude-t.latitude)/i,o=(e.height-t.height)/i,s=t.longitude+n*a,l=t.latitude+n*r,c=t.height+n*o;return new v.Cartographic(s,l,c)}};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{var t=b.Cartesian3,e=b.ComponentDatatype,i=b.PrimitiveType,n=b.BoundingSphere,a=b.GeometryAttribute,r=b.GeometryPipeline,o=b.Geometry,s=b.defined,l=b.RenderState,c=b.ShaderSource,h=b.ShaderProgram,x=b.DrawCommand,d=b.Pass,u=b.Appearance,p=b.BufferUsage,g=b.Color,m=b.VertexArray,f=b.buildModuleUrl,v=b.Matrix4,y=b.Matrix3,C=b.Texture,w=b.Resource,I=b.Transforms,A=b.defaultValue,_=this._viewer,G=this.getDfSt(["primitive","TetrahedronPrimitive"])||"static/data/images/Textures/fence.png";const W=function(e){this.show=!0,this._command=void 0,this._enuMatrix=void 0,this._scaleMatrix=void 0,this._localPosition=e.position,this._createCommand=P,this._angle=0,this._distance=A(e.distance,1),this._setInterval=void 0,this._viewer=_,this._speed=A(e.speed,1),this._color=A(e.color,new g(1,1,0,.8)),this._scale=A(e.scale,new t(10,10,15)),this._texture=void 0,this._imageUrl=f(G),this._modelMatrix=R(this),this._height=F(this),X(this)};W.prototype.update=function(t){this.show&&(s(this._command)||(this._command=this._createCommand(t.context,this),this._command.pickId="v_pickColor"),s(this._command)&&t.commandList.push(this._command))},W.prototype.isDestroyed=function(){return!1},W.prototype.destroy=function(){return s(this._command)&&(this._command.shaderProgram=this._command.shaderProgram&&this._command.shaderProgram.destroy()),destroyObject(this)},W.prototype.startAnimate=function(){let t=this;this._setInterval=setInterval((function(){t._angle=t._angle+.01,Math.sin(t._angle)>0?t._height=.01:t._height=-.01;let e=new b.Cartesian3(0,0,t._height);v.multiplyByTranslation(t._modelMatrix,e,t._modelMatrix);let i=v.fromRotationTranslation(y.fromRotationZ(b.Math.toRadians(t._speed)));v.multiply(t._modelMatrix,i,t._modelMatrix)}),5)},W.prototype.closeAnimate=function(){clearInterval(this._setInterval)};const P=function(t,e){var n=S(),a=V(),r=u.getDefaultRenderState(!1,!0,void 0),o=l.fromCache(r),p=new c({sources:[n]}),g=new c({sources:[a]}),m={color:function(){return e._color},myImage:function(){return s(e._texture)?e._texture:e._viewer.scene.context.defaultTexture}};var f=h.fromCache({context:t,vertexShaderSource:p,fragmentShaderSource:g,attributeLocations:{position:0,textureCoordinates:1}});return new x({vertexArray:Z(t),primitiveType:i.TRIANGLES,renderState:o,shaderProgram:f,uniformMap:m,owner:this,pass:d.TRANSLUCENT,modelMatrix:e._modelMatrix})},Z=function(t){var s=M(),l=new o({attributes:{position:new a({componentDatatype:e.FLOAT,componentsPerAttribute:3,values:s.positions}),textureCoordinates:new a({componentDatatype:e.FLOAT,componentsPerAttribute:2,values:s.sts})},indices:s.indices,primitiveType:i.TRIANGLES,boundingSphere:n.fromVertices(s.positions)}),c=r.computeNormal(l);return m.fromGeometry({context:t,geometry:c,attributeLocations:{position:0,textureCoordinates:1},bufferUsage:p.STATIC_DRAW})},M=function(){var t=new Float64Array(15);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;var e=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])}},S=function(){return"\n attribute vec3 position;\n attribute vec3 normal;\n attribute vec2 st;\n attribute float batchId;\n varying vec3 v_positionEC;\n varying vec3 v_normalEC;\n varying vec2 v_st;\n varying vec4 v_pickColor;\n void main()\n {\n v_positionEC = (czm_modelView * vec4(position, 1.0)).xyz; // position in eye coordinates\n v_normalEC = czm_normal * normal; // normal in eye coordinates\n v_st = st;\n //v_pickColor = czm_batchTable_pickColor(batchId);\n gl_Position = czm_modelViewProjection * vec4(position, 1.0);\n }\n "},V=function(){return"\n varying vec3 v_positionEC;\n varying vec3 v_normalEC;\n varying vec2 v_st;\n uniform vec4 color;\n varying 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 = texture2D(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 gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n #else\n gl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n #endif\n }\n "},X=function(t){w.createIfNeeded(t._imageUrl).fetchImage().then((function(e){var i,n=t._viewer.scene.context;i=s(e.internalFormat)?new C({context:n,pixelFormat:e.internalFormat,width:e.naturalWidth,height:e.naturalHeight,source:{arrayBufferView:e.bufferView}}):new C({context:n,source:e}),t._texture=i}))},R=function(t){let e=I.eastNorthUpToFixedFrame(t._localPosition),i=v.fromScale(t._scale),n=v.multiply(e,i,new v);return t._scaleMatrix=i,t._enuMatrix=e,n},F=function(e){let i=t.fromElements(0,0,e._distance,new b.Cartesian3),n=b.Matrix4.multiplyByPoint(e._enuMatrix,i,new t),a=v.multiplyByPoint(e._viewer.scene.camera._viewMatrix,n,new t),r=v.multiplyByPoint(e._viewer.scene.camera.frustum.projectionMatrix,a,new t);return t.normalize(r,new t).z};b.Scene.TetrahedronPrimitive=W}catch(t){console.log(t)}},_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._build()}t.prototype={_build(){this._createAxisXYZ(),this._bindHandler()},remove(){this._layer._primitives.removeAll(),this._handler.distory()},_createAxisXYZ:function(){this._model.readyPromise.then(t=>{const e=b.Matrix4.getTranslation(t.modelMatrix,new b.Cartesian3),i=t.boundingSphere,n=i.radius,a=new b.ArrowPolylinePrimitive({id:"axisZ",color:b.Color.RED,position:e,width:3,headWidth:5,length:2*n+50,headLength:10}),r=new b.ArrowPolylinePrimitive({id:"axisX",color:b.Color.GREEN,position:e,width:3,headWidth:5,length:2*n+50,headLength:10}),o=new b.ArrowPolylinePrimitive({id:"axisY",color:b.Color.BLUE,position:e,width:3,headWidth:5,length:2*n+50,headLength:10}),s=b.Matrix3.fromRotationY(b.Math.toRadians(90));this._rotationX=b.Matrix4.fromRotationTranslation(s),b.Matrix4.multiply(r.geometryInstances[0].modelMatrix,this._rotationX,r.geometryInstances[0].modelMatrix),b.Matrix4.multiply(r.geometryInstances[1].modelMatrix,this._rotationX,r.geometryInstances[1].modelMatrix);const l=b.Matrix3.fromRotationX(b.Math.toRadians(90));this._rotationY=b.Matrix4.fromRotationTranslation(l),b.Matrix4.multiply(o.geometryInstances[0].modelMatrix,this._rotationY,o.geometryInstances[0].modelMatrix),b.Matrix4.multiply(o.geometryInstances[1].modelMatrix,this._rotationY,o.geometryInstances[1].modelMatrix),this._layer._primitives.add(a),this._layer._primitives.add(r),this._layer._primitives.add(o),this._radius=i.radius,this._createAxisSphere()})},_createAxisSphere:function(){const t=[];for(let e=0;e<=360;e+=3){const i=Math.sin(b.Math.toRadians(e)),n=Math.cos(b.Math.toRadians(e)),a=this._radius*n,r=this._radius*i;t.push(new b.Cartesian3(a,r,0))}const e=this._createAxisSpheres("axisSphereZ",t,this._matrix,b.Color.RED);this._layer._primitives.add(e);const i=this._createAxisSpheres("axisSphereY",t,this._matrix,b.Color.GREEN);this._layer._primitives.add(i),b.Matrix4.multiply(i.geometryInstances.modelMatrix,this._rotationY,i.geometryInstances.modelMatrix);const n=this._createAxisSpheres("axisSphereX",t,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){const a=new b.PolylineGeometry({positions:e,width:10}),r=new b.GeometryInstance({geometry:a,id:t,attributes:{color:b.ColorGeometryInstanceAttribute.fromColor(n)}});return new b.Primitive({geometryInstances:r,appearance:new b.PolylineColorAppearance({translucent:!1}),modelMatrix:i})},_updateAxis(t){if(this._layer){let e=this._layer._primitives._primitives;for(let i=1,n=e.length;i<n;i++){let n=e[i];const a=b.Matrix4.fromTranslation(new b.Cartesian3(t.x,t.y,t.z));b.Matrix4.multiply(n.modelMatrix,a,n.modelMatrix)}}const e=b.Matrix4.fromTranslation(new b.Cartesian3(t.x,t.y,t.z));b.Matrix4.multiply(this._model.modelMatrix,e,this._model.modelMatrix)},_updateAxisSphere(t){if(this._layer){let e=this._layer._primitives._primitives;for(let i=1,n=e.length;i<n;i++){let n=e[i];const a=b.Matrix4.fromRotationTranslation(t);b.Matrix4.multiply(n.modelMatrix,a,n.modelMatrix)}}const e=b.Matrix4.fromRotationTranslation(t);b.Matrix4.multiply(this._model.modelMatrix,e,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=>{let e=viewer.scene.pick(t.position);e&&e.id&&(this._xyzPid=e.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(){let t=function(t,e){const i=new b.Cartesian3;e.length?(i.x=e[0],i.y=e[1],i.z=e[2]):b.Cartesian3.clone(e,i);for(let e=0;e<t.attributes.position.values.length;e+=3)t.attributes.position.values[e]+=i.x,t.attributes.position.values[e+1]+=i.y,t.attributes.position.values[e+2]+=i.z};b.Scene.ArrowPolylinePrimitive=function(e={}){this._color=e.color||b.Color.RED,this._width=e.width||3,this._headWidth=e.headWidth||2*this._width,this._length=e.length||300,this._headLength=e.headLength||10,this._inverse=e.inverse||!1,this.position=e.position;const i=e.id,n=b.CylinderGeometry.createGeometry(new b.CylinderGeometry({length:this._length,topRadius:this._width,bottomRadius:this._width})),a=b.CylinderGeometry.createGeometry(new b.CylinderGeometry({length:this._headLength,topRadius:0,bottomRadius:this._headWidth}));let r=(this._length+this._headLength)/2;return this._inverse&&(r=-r),t(a,[0,0,r]),new b.Primitive({modelMatrix:b.Transforms.eastNorthUpToFixedFrame(this.position),geometryInstances:[new b.GeometryInstance({id:i+"-line",geometry:n}),new b.GeometryInstance({id:i+"-arrow",geometry:a})],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.");this._scene=e;var i=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();var n=new b.Cartesian3(0,0,100),a=b.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);b.Matrix4.multiplyByPoint(a,n,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(t,e){if(this.debugShow){var i=this.debugLightFrustum._planesPrimitives,n=this.debugLightFrustum._outlinePrimitives;i.forEach((function(e){e.show=t})),n.forEach((function(t){t.show=e}))}},t.prototype.update=function(t){if(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))));var 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,n,a,r=this._positions,o=b.Math.toRadians(this._horizontalFov),s=b.Math.toRadians(this._verticalFov),l=Math.tan(.5*o),c=Math.tan(.5*s);e=-(i=this._distance*l),n=-(a=this._distance*c);var h=new b.Cartesian3(e,n,-this._distance),x=new b.Cartesian3(i,a,0);b.Matrix4.multiplyByPoint(this._modelMatrix,h,h),b.Matrix4.multiplyByPoint(this._modelMatrix,x,x);var d=b.BoundingSphere.fromCornerPoints(h,x);if(t.cullingVolume.computeVisibility(d)!==Intersect.OUTSIDE){this._valid=!0;var u=0;r[u++]=0,r[u++]=0,r[u++]=0;for(var p,g,m=Math.PI-.5*o,f=o/4,v=0;v<5;++v){p=m+v*f;for(var y=a/(this._distance/Math.cos(p)),C=-(_=Math.atan(y)),w=_/10,I=0;I<21;++I)g=C+I*w,r[u++]=this._distance*Math.cos(g)*Math.sin(p),r[u++]=this._distance*Math.sin(g),r[u++]=this._distance*Math.cos(g)*Math.cos(p)}f=o/20;for(var A=0;A<21;++A){p=m+A*f;y=a/(this._distance/Math.cos(p)),C=-(_=Math.atan(y)),w=_/2;for(var _,G=0;G<5;++G)g=C+G*w,r[u++]=this._distance*Math.cos(g)*Math.sin(p),r[u++]=this._distance*Math.sin(g),r[u++]=this._distance*Math.cos(g)*Math.cos(p)}var W=t.context,P=b.Buffer.createIndexBuffer({context:W,typedArray:new Uint32Array(this._indices),usage:b.BufferUsage.STATIC_DRAW,indexDatatype:IndexDatatype.UNSIGNED_INT}),Z=b.Buffer.createVertexBuffer({context:W,typedArray:b.ComponentDatatype.createTypedArray(b.ComponentDatatype.FLOAT,this._positions),usage:b.BufferUsage.STATIC_DRAW}),M=[];M.push({index:0,vertexBuffer:Z,componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1});var S=new b.VertexArray({context:W,attributes:M,indexBuffer:P});if(b.defined(this._drawLineCommand))this._drawLineCommand.vertexArray.destroy(),this._drawLineCommand.vertexArray=S,this._drawLineCommand.modelMatrix=this._modelMatrix,this._drawLineCommand.boundingVolume=d;else{var V=b.ShaderProgram.fromCache({context:W,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 gl_FragColor = u_bgColor;\n }\n "}),X=b.RenderState.fromCache({depthTest:{enabled:!0}}),R=this,F={u_bgColor:function(){return R._lineColor},u_modelViewMatrix:function(){return W.uniformState.modelView}};this._drawLineCommand=new b.DrawCommand({boundingVolume:d,modelMatrix:R._modelMatrix,primitiveType:b.PrimitiveType.LINES,vertexArray:S,shaderProgram:V,castShadows:!1,receiveShadows:!1,uniformMap:F,renderState:X,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&&t.Cartesians.length>=2){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"attribute vec3 position3DHigh; attribute vec3 position3DLow; attribute vec4 color; varying vec4 v_color; attribute 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"varying vec4 v_color; void main() { float d = distance(gl_PointCoord, vec2(0.5,0.5)); if(d < 0.5){ gl_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(){const t=function(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"varying vec3 v_positionMC;\n varying vec3 v_positionEC;\n varying 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 gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n #else\n gl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n gl_FragColor.a = 0.5;\n #endif\n }\n "},C.prototype.updateDegreesPosition=function(t,e){if(null!=this.primitive&&(this._viewer.scene.primitives.remove(this.primitive),!(t&&t.length<3))){var i=this._createGeometry(t,e||0);this.primitive=this._viewer.scene.primitives.add(new b.Primitive({allowPicking:!1,geometryInstances:new b.GeometryInstance({geometry:i}),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"attribute vec3 position3DHigh; attribute vec3 position3DLow; attribute vec2 st; attribute float batchId; varying vec2 v_st; void main() { vec4 p = czm_computePosition(); v_st=st; p = czm_modelViewProjectionRelativeToEye * p; gl_Position = p; } "},t.prototype.getFS=function(){return"varying 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); gl_FragColor =color; } "},t.prototype.getMS=function(){return"czm_material czm_getMaterial(czm_materialInput materialInput,vec2 v_st) { vec4 color = texture2D(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 t={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},e=this._viewer;function i(i){this._viewer=e,this._length=i.length||t.length,this._center=i.center||t.center,this._color=i.color||t.color,this._repeat=i.repeat||t.repeat,this._offset=i.offset||t.offset,this._thickness=i.thickness||t.thickness,this._bottom=i.bottom||t.bottom,this._top=i.top||t.top,this._radar=void 0,this.build()}i.prototype.build=function(){var t=new b.CylinderGeometry({length:this._length,topRadius:this._top,bottomRadius:this._bottom,vertexFormat:b.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat}),e=new b.GeometryInstance({geometry:t,modelMatrix:this.getModelMatrix()}),i=new b.MaterialAppearance({material:this.getMaterial(),faceForward:!1,closed:!0}),n=this;this._radar=this._viewer.scene.primitives.add(new b.Primitive({geometryInstances:[e],appearance:i})),this._viewer.scene.preUpdate.addEventListener((function(){var t=n._radar.appearance.material.uniforms.offset;(t-=.001)>1&&(t=0),n._radar.appearance.material.uniforms.offset=t}))},i.prototype.getModelMatrix=function(){return b.Matrix4.multiplyByTranslation(b.Transforms.eastNorthUpToFixedFrame(this._center),new b.Cartesian3(0,0,.5*this._length),new b.Matrix4)},i.prototype.updateModelMatrix=function(){},i.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})},i.prototype.remove=function(){this._radar&&this._viewer.scene.primitives.remove(this._radar)},b.Scene.ProbingPrimitive=i}};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(t){if((t=t||{}).style=t.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&&t){var e,i,n=new w.Entity,a=[],r=this,o=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);o.setInputAction((function(t){var i=r._viewer.scene.camera.pickEllipsoid(t.position,r._viewer.scene.globe.ellipsoid);i&&i.x&&(e=i,a.push(i))}),w.ScreenSpaceEventType.LEFT_CLICK),o.setInputAction((function(e){o.destroy(),o=null,"function"==typeof t.callback&&t.callback(r.transformCartesianArrayToWGS84Array(a),i)}),w.ScreenSpaceEventType.RIGHT_CLICK),n.billboard=t.style,n.position=new w.CallbackProperty((function(){return e}),!1),i=this._drawLayer.entities.add(n)}},drawLineGraphics:function(t){if(t=t||{},this._viewer&&t){var e,i=[],n=new w.Entity,a=this,r=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);r.setInputAction((function(n){var s=a.getCatesian3FromPX(n.position);s&&s.x&&(0==i.length&&i.push(s.clone()),t.measure&&o(s),2==i.length&&"straightLine"===t.type&&(r.destroy(),r=null,"function"==typeof t.callback&&t.callback(a.transformCartesianArrayToWGS84Array(i),e)),i.push(s))}),w.ScreenSpaceEventType.LEFT_CLICK),r.setInputAction((function(t){var e=a.getCatesian3FromPX(t.endPosition);i.length>=2&&e&&e.x&&(i.pop(),i.push(e))}),w.ScreenSpaceEventType.MOUSE_MOVE),r.setInputAction((function(n){r.destroy(),r=null;var s=a.getCatesian3FromPX(n.position);t.measure&&o(s),"function"==typeof t.callback&&t.callback(a.transformCartesianArrayToWGS84Array(i),e)}),w.ScreenSpaceEventType.RIGHT_CLICK),n.polyline={width:t.width||5,material:t.material||w.Color.BLUE.withAlpha(.8),clampToGround:t.clampToGround||!1,clampToS3M:t.clampToS3M||!1},n.polyline.positions=new w.CallbackProperty((function(){return i}),!1),e=this._drawLayer.entities.add(n);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(i))/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(t){if((t=t||{}).style=t.style||{width:3,material:w.Color.BLUE.withAlpha(.8),clampToGround:!0},this._viewer&&t){var e=[],i=new w.PolygonHierarchy,n=new w.Entity,a=this,r=null,o=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);const s=function(){n.polyline=t.style,n.polyline.positions=new w.CallbackProperty((function(){return e}),!1),n.polygon={hierarchy:new w.CallbackProperty((function(){return i}),!1),material:w.Color.WHITE.withAlpha(.1),clampToGround:t.clampToGround||!1},n.clampToS3M=!0,r=a._drawLayer.entities.add(n)},l=function(t){var i=new w.Entity;i.position=t,i.point={pixelSize:10,outlineColor:w.Color.BLUE,outlineWidth:5},i.label={text:(a.getPositionsArea(a.transformCartesianArrayToWGS84Array(e))/1e6).toFixed(4)+"平方公里",show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(-20,-50)},a._drawLayer.entities.add(i)};o.setInputAction((function(t){var n=a.getCatesian3FromPX(t.position);n&&n.x&&(0==e.length&&(i.positions.push(n.clone()),e.push(n.clone())),e.push(n.clone()),i.positions.push(n.clone()),r||s())}),w.ScreenSpaceEventType.LEFT_CLICK),o.setInputAction((function(t){var n=a.getCatesian3FromPX(t.endPosition);e.length>=2&&n&&n.x&&(e.pop(),e.push(n),i.positions.pop(),i.positions.push(n))}),w.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction((function(){o.destroy(),e.push(e[0]),t.height&&(n.polygon.extrudedHeight=t.height,n.polygon.material=w.Color.BLUE.withAlpha(.5)),t.measure&&l(e[0]),"function"==typeof t.callback&&t.callback(a.transformCartesianArrayToWGS84Array(e),r)}),w.ScreenSpaceEventType.RIGHT_CLICK)}},drawRectangleGraphics:function(t){if((t=t||{}).style=t.style||{width:3,material:w.Color.BLUE.withAlpha(.5),clampToGround:!0},this._viewer&&t){var e,i=[],n=new w.Entity,a=new w.Rectangle,r=this,o=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);o.setInputAction((function(n){var s=r.getCatesian3FromPX(n.position);s&&s.x&&(0==i.length?i.push(s.clone()):(o.destroy(),i.push(s.clone()),a=w.Rectangle.fromCartesianArray([...i,s],w.Ellipsoid.WGS84),"function"==typeof t.callback&&t.callback(r.transformCartesianArrayToWGS84Array(i),e)))}),w.ScreenSpaceEventType.LEFT_CLICK),o.setInputAction((function(t){var e=r.getCatesian3FromPX(t.endPosition);e&&(a=w.Rectangle.fromCartesianArray([...i,e],w.Ellipsoid.WGS84))}),w.ScreenSpaceEventType.MOUSE_MOVE),n.rectangle=t.style,t.height&&(n.rectangle.extrudedHeight=t.height),n.rectangle.coordinates=new w.CallbackProperty((function(){return a}),!1),e=this._drawLayer.entities.add(n)}},drawCircleGraphics:function(t){if((t=t||{}).style=t.style||{width:3,material:w.Color.BLUE.withAlpha(.5),clampToGround:!0},this._viewer&&t){var e,i=void 0,n=new w.Entity,a=this,r=1,o=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);const s=function(t,e){let i=w.Cartographic.fromCartesian(t),n=w.Cartographic.fromCartesian(e),a=new w.EllipsoidGeodesic;a.setEndPoints(i,n);let o=a.surfaceDistance;r=Math.sqrt(Math.pow(o,2)+Math.pow(n.height-i.height,2))},l=function(){n.ellipse=t.style,n.ellipse.semiMajorAxis=new w.CallbackProperty((function(){return r}),!1),n.ellipse.semiMinorAxis=new w.CallbackProperty((function(){return r}),!1),n.position=new w.CallbackProperty((function(){return i}),!1),n.point={pixelSize:5,outlineColor:w.Color.RED,outlineWidth:3},t.height&&(n.ellipse.extrudedHeight=t.height),e=a._drawLayer.entities.add(n)};o.setInputAction((function(n){var c=a.getCatesian3FromPX(n.position);c&&c.x&&(i?(s(i,c),o.destroy(),"function"==typeof t.callback&&t.callback({center:i,radius:r},e)):(i=c,l()))}),w.ScreenSpaceEventType.LEFT_CLICK),o.setInputAction((function(t){var e=a._viewer.scene.camera.pickEllipsoid(t.endPosition,a._viewer.scene.globe.ellipsoid);i&&e&&e.x&&s(i,e)}),w.ScreenSpaceEventType.MOUSE_MOVE)}},drawTrianglesGraphics:function(t){if((t=t||{}).style=t.style||{width:3,material:w.Color.BLUE.withAlpha(.5)},this._viewer&&t){var e=new w.Entity,i=new w.Entity,n=new w.Entity,a=[],r=[],o=[],s=this,l=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);const c=function(t,e){if(!t&&!e)return 0;if(w.Cartesian3.equals(t,e))return 0;let i=w.Cartographic.fromCartesian(t);return(w.Cartographic.fromCartesian(e).height-i.height).toFixed(2)},h=function(t){let e=w.Cartographic.fromCartesian(t[0]),i=w.Cartographic.fromCartesian(t[1]);return w.Cartesian3.fromDegrees(w.Math.toDegrees(e.longitude),w.Math.toDegrees(e.latitude),i.height)};l.setInputAction((function(o){var c=s.getCatesian3FromPX(o.position);if(!c)return!1;0==a.length?(a.push(c.clone()),a.push(c.clone()),r.push(c.clone()),r.push(c.clone())):(l.destroy(),"function"==typeof t.callback&&t.callback({e,e2:i,e3:n}))}),w.ScreenSpaceEventType.LEFT_CLICK),l.setInputAction((function(t){var e=s.getCatesian3FromPX(t.endPosition);if(e&&a.length>0){a.pop(),a.push(e.clone());let t=h(a);r.pop(),r.push(t.clone()),o.pop(),o.pop(),o.push(e.clone()),o.push(t.clone())}}),w.ScreenSpaceEventType.MOUSE_MOVE),e.polyline={positions:new w.CallbackProperty((function(){return a}),!1),...t.style},e.position=new w.CallbackProperty((function(){return a[0]}),!1),e.point={pixelSize:5,outlineColor:w.Color.BLUE,outlineWidth:5},e.label={text:new w.CallbackProperty((function(){return"直线:"+s.getPositionDistance(s.transformCartesianArrayToWGS84Array(a))+"米"}),!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(50,-100)},i.polyline={positions:new w.CallbackProperty((function(){return r}),!1),...t.style},i.position=new w.CallbackProperty((function(){return o[1]}),!1),i.point={pixelSize:5,outlineColor:w.Color.BLUE,outlineWidth:5},i.label={text:new w.CallbackProperty((function(){return"高度:"+c(r[0],r[1])+"米"}),!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(-20,100)},n.polyline={positions:new w.CallbackProperty((function(){return o}),!1),...t.style},n.position=new w.CallbackProperty((function(){return a[1]}),!1),n.point={pixelSize:5,outlineColor:w.Color.BLUE,outlineWidth:5},n.label={text:new w.CallbackProperty((function(){return"水平距离:"+s.getPositionDistance(s.transformCartesianArrayToWGS84Array(o))+"米"}),!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(n),this._drawLayer.entities.add(i),this._drawLayer.entities.add(e)}},drawWallGraphics:function(t){if((t=t||{}).style=t.style||{material:w.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:w.Color.WHITE},this._viewer&&t){var e=this;this.drawPolygonGraphics({callback:function(i,n){var a=e._drawLayer.entities.add({wall:{positions:e.transformWGS84ArrayToCartesianArray(i),...t.style}});"function"==typeof t.callback&&t.callback(i,a)}})}},drawEllipsoidGraphics:function(t){if((t=t||{}).style=t.style||{},this._viewer&&t){var e=this;this.drawCircleGraphics({callback:function(i,n){var a=e.createGraphics();a.ellipsoid=e.$graphics.getEllipsoidGraphics({radii:i.radius}),a.position=i.center,e._drawLayer.entities.remove(n);var r=e._drawLayer.entities.add(a);"function"==typeof t.callback&&t.callback({center:i.center,radius:i.radius},r)}})}},drawCylinderGraphics:function(t){if((t=t||{}).style=t.style||{},this._viewer&&t){var e=this;this.drawCircleGraphics({callback:function(i,n){var a=e._drawLayer.entities.add({position:i.center,cylinder:{length:2*i.radius||t.length,topRadius:t.topRadius||i.radius,bottomRadius:t.bottomRadius||i.radius,material:w.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:w.Color.WHITE}});e._drawLayer.entities.remove(n),"function"==typeof t.callback&&t.callback({center:i.center,radius:i.radius},a)}})}},drawCorridorGraphics:function(t){if((t=t||{}).style=t.style||{},this._viewer&&t){var e=this;e.drawLineGraphics({callback:function(i,n){var a=e.createGraphics();a.corridor={positions:e.transformWGS84ArrayToCartesianArray(i),height:t.height||1,width:t.width||100,cornerType:w.CornerType.BEVELED,extrudedHeight:t.extrudedHeight||1,material:w.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:w.Color.WHITE},e._drawLayer.entities.remove(n);var r=e._drawLayer.entities.add(a);"function"==typeof t.callback&&t.callback(i,r)}})}},drawPolylineVolumeGraphics:function(t){(t=t||{}).style=t.style||{};const e=t.circleRadius||20,i=t.arms||7,n=t.rOuter||150,a=t.rInner||75;if(this._viewer&&t){var r=this;r.drawLineGraphics({callback:function(o,s){var l=r.createGraphics();let c="fivePoint"===t.shape?r.computeStar2d(i,n,a):r.computeCircleShap(e);l.polylineVolume={positions:r.transformWGS84ArrayToCartesianArray(o),shape:c,cornerType:w.CornerType.MITERED,material:t.color||w.Color.RED},r._drawLayer.entities.remove(s);var h=r._drawLayer.entities.add(l);"function"==typeof t.callback&&t.callback(o,h)}})}}};let A={};function _(t,e){t&&(this._viewer=t,A=e)}_.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(t){let e=0;return t&&Array.isArray(t)&&t.length>0&&t.forEach((i,n)=>{n<t.length-1&&(e+=this.mathDistance2d(i,t[n+1]))}),e},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 A.Cartesian2(Math.cos(o*n)*s,Math.sin(o*n)*s)}return r},computeCircleShap(t){let e=[];for(let i=0;i<360;i++){let n=A.Math.toRadians(i);e.push(new A.Cartesian2(t*Math.cos(n),t*Math.sin(n)))}return e},mid2d:function(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]},getCircleCenterOfThreePoints2d:function(t,e,i){let n=[(t[0]+e[0])/2,(t[1]+e[1])/2],a=[n[0]-t[1]+e[1],n[1]+t[0]-e[0]],r=[(t[0]+i[0])/2,(t[1]+i[1])/2],o=[r[0]-t[1]+i[1],r[1]+t[0]-i[0]];return this.getIntersectPoint2d(n,a,r,o)},getIntersectPoint2d:function(t,e,i,n){if(t[1]===e[1]){return[(n[0]-i[0])/(n[1]-i[1])*(t[1]-i[1])+i[0],t[1]]}if(i[1]===n[1]){return[(e[0]-t[0])/(e[1]-t[1])*(i[1]-t[1])+t[0],i[1]]}let a=(e[0]-t[0])/(e[1]-t[1]),r=(n[0]-i[0])/(n[1]-i[1]),o=(a*t[1]-t[0]-r*i[1]+i[0])/(a-r);return[a*o-a*t[1]+t[0],o]},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){let n=this.getAzimuth2d(e,t)-this.getAzimuth2d(e,i);return n<0?n+2*Math.PI:n},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){t=Math.max(Math.min(t,1),0);let[r,o]=[1-t,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){let r=this.getAzimuth2d(t,e),o=a?r+i:r-i,s=n*Math.cos(o),l=n*Math.sin(o);return[e[0]+s,e[1]+l]},inherits2d:function(t,e){function i(){}i.prototype=e.prototype,t.superClass_=e.prototype,t.prototype=new i,t.prototype.constructor=t,t.base=function(t,i,n){let a=Array.prototype.slice.call(arguments,2);return e.prototype[i].apply(t,a)}},getArcPoints2d:function(t,e,i,n){let[a,r,o,s]=[null,null,[],n-i];s=s<0?s+2*Math.PI:s;for(let n=0;n<=100;n++){let l=i+s*n/100;a=t[0]+e*Math.cos(l),r=t[1]+e*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]),x=a[0]/h,d=a[1]/h,u=this.mathDistance2d(e,i),p=this.mathDistance2d(i,n);return h>1e-4?this.isClockWise(e,i,n)?(s=t*u,l=i[0]-s*d,c=i[1]+s*x,r=[l,c],s=t*p,l=i[0]+s*d,c=i[1]-s*x,o=[l,c]):(s=t*u,l=i[0]+s*d,c=i[1]-s*x,r=[l,c],s=t*p,l=i[0]-s*d,c=i[1]+s*x,o=[l,c]):(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]),c=i[1]+t*(n[1]-i[1]),o=[l,c]),[r,o]},getNormal2d:function(t,e,i){let n=t[0]-e[0],a=t[1]-e[1],r=Math.sqrt(n*n+a*a);n/=r,a/=r;let o=i[0]-e[0],s=i[1]-e[1],l=Math.sqrt(o*o+s*s);return o/=l,s/=l,[n+o,a+s]},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);if(Math.sqrt(l[0]*l[0]+l[1]*l[1])>1e-4){let t=this.mid2d(i,n),e=i[0]-t[0],a=i[1]-t[1],l=2/this.mathDistance2d(i,n),c=-l*a,h=l*e,x=c*c-h*h,d=2*c*h,u=h*h-c*c,p=s[0]-t[0],g=s[1]-t[1];r=t[0]+x*p+d*g,o=t[1]+d*p+u*g}else r=i[0]+e*(n[0]-i[0]),o=i[1]+e*(n[1]-i[1]);return[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];if(l>1e-4){let t=this.mid2d(a,r),e=r[0]-t[0],i=r[1]-t[1],n=2/this.mathDistance2d(a,r),s=-n*i,l=n*e,x=s*s-l*l,d=2*s*l,u=l*l-s*s,p=o[0]-t[0],g=o[1]-t[1];c=t[0]+x*p+d*g,h=t[1]+d*p+u*g}else c=r[0]+e*(a[0]-r[0]),h=r[1]+e*(a[1]-r[1]);return[c,h]},getCurvePoints2d:function(t,e){let i=this.getLeftMostControlPoint2d(e,t),[n,a,r,o,s]=[null,null,null,[i],[]];for(let i=0;i<e.length-2;i++){[n,a,r]=[e[i],e[i+1],e[i+2]];let s=this.getBisectorNormals2d(t,n,a,r);o=o.concat(s)}let l=this.getRightMostControlPoint2d(e,t);l&&o.push(l);for(let t=0;t<e.length-1;t++){n=e[t],a=e[t+1],s.push(n);for(let e=0;e<100;e++){let i=this.getCubicValue2d(e/100,n,o[2*t],o[2*t+1],a);s.push(i)}s.push(a)}return s},getBezierPoints2d:function(t){if(t.length<=2)return t;{let e=[],i=t.length-1;for(let n=0;n<=1;n+=.01){let[a,r]=[0,0];for(let e=0;e<=i;e++){let o=this.getBinomialFactor2d(i,e),s=Math.pow(n,e),l=Math.pow(1-n,i-e);a+=o*s*l*t[e][0],r+=o*s*l*t[e][1]}e.push([a,r])}return e.push(t[i]),e}},getFactorial2d:function(t){let e=1;switch(t){case t<=1:e=1;break;case 2===t:e=2;break;case 3===t:e=6;break;case 24===t:e=24;break;case 5===t:e=120;break;default:for(let i=1;i<=t;i++)e*=i}return e},getBinomialFactor2d:function(t,e){return this.getFactorial2d(t)/(this.getFactorial2d(e)*this.getFactorial2d(t-e))},getQBSplinePoints2d:function(t){if(t.length<=2)return t;{let[e,i]=[2,[]],n=t.length-e-1;i.push(t[0]);for(let a=0;a<=n;a++)for(let n=0;n<=1;n+=.05){let[r,o]=[0,0];for(let i=0;i<=e;i++){let e=this.getQuadricBSplineFactor2d(i,n);r+=e*t[a+i][0],o+=e*t[a+i][1]}i.push([r,o])}return i.push(t[t.length-1]),i}},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 W(t,e){t&&(this._viewer=t,G=e)}W.prototype={setCircleScanEffect:function(t){if(t&&t.position){var e=t.id||"CircleScan"+parseInt(1e3*Math.random()),i=t.position,n=t.radius,a=t.color||G.Color.RED,r=t.duration||1500,o=this,s=t.circleMode||"CircleScan",l=t.border||4,c=i,h=new G.Cartesian4(c.x,c.y,c.z,1),x=this.transformCartesianToWGS84(i),d=this.transformWGS84ToCartesian({lng:x.lng,lat:x.lat,alt:x.alt+500}),u=new G.Cartesian4(d.x,d.y,d.z,1),p=(new Date).getTime(),g=new G.PostProcessStage({name:e,fragmentShader:this._getCircleScanShader({get:!0,border:l}),uniforms:{u_scanCenterEC:function(){return G.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,h,new G.Cartesian4)},u_scanPlaneNormalEC:function(){var t=G.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,h,new G.Cartesian4),e=G.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,u,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"==s?n*(((new Date).getTime()-p)%r)/r:n},u_scanColor:a}});return this._viewer.scene.postProcessStages.add(g),g}},setRadarScanEffect:function(t){if(t&&t.position){var e=t.id||"radarScan"+parseInt(1e3*Math.random()),i=t.position,n=t.radius,a=t.color||G.Color.RED,r=t.duration||1500,o=this,s=t.border||1,l=t.width||3,c=i,h=new G.Cartesian4(c.x,c.y,c.z,1),x=this.transformCartesianToWGS84(i),d=this.transformWGS84ToCartesian({lng:x.lng,lat:x.lat,alt:x.alt+500}),u=new G.Cartesian4(d.x,d.y,d.z,1),p=this.transformWGS84ToCartesian({lng:x.lng+.001,lat:x.lat,alt:x.alt}),g=new G.Cartesian4(p.x,p.y,p.z,1),m=(new Date).getTime(),f=new G.Quaternion,v=new G.Matrix3,y=new G.Cartesian4,b=new G.Cartesian4,C=new G.Cartesian4,w=new G.Cartesian3,I=new G.Cartesian3,A=new G.PostProcessStage({name:e,fragmentShader:this._getRadarScanShader({border:s,width:l,get:!0}),uniforms:{u_scanCenterEC:function(){return G.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,h,y)},u_scanPlaneNormalEC:function(){var t=G.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,h,y),e=G.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,u,b);return w.x=e.x-t.x,w.y=e.y-t.y,w.z=e.z-t.z,G.Cartesian3.normalize(w,w),w},u_scanLineNormalEC:function(){var t=G.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,h,y),e=G.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,u,b),i=G.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,g,C);w.x=e.x-t.x,w.y=e.y-t.y,w.z=e.z-t.z,G.Cartesian3.normalize(w,w),I.x=i.x-t.x,I.y=i.y-t.y,I.z=i.z-t.z;var n=((new Date).getTime()-m)%r/r;return G.Quaternion.fromAxisAngle(w,n*G.Math.PI*2,f),G.Matrix3.fromQuaternion(f,v),G.Matrix3.multiplyByVector(v,I,I),G.Cartesian3.normalize(I,I),I},u_radius:n,u_scanColor:a}});return this._viewer.scene.postProcessStages.add(A),A}}};var P,Z,M=["RGVwdGhGdW5jdGlvbg==","TEVTUw==","Q3VsbEZhY2U=","QkFDSw==","dW5pZm9ybU1hcA==","cHJvamVjdGlvbk1hdHJpeA==","dW5pZm9ybVN0YXRl","cHJvamVjd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VzaXVtR2VvbWV0cnk=","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","X2Nvb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QgPSBpc09uQm91bmRhcnkoZWxsaXBzb2lkVmFsdWUsIGN6bV9lcHNpbG9uMyk7DQogICAgZ2xfRnJhZ0NvbG9yID0gc2hhZGUoaXNPbkVsbGlwc29pZCk7DQoNCn0=","X2xpbmVDb2xvcg==","X3Nob3dTZWN0b3JMaW5lcw==","X3Nob3dTZWN0b3JTZWdtZW50TGluZXM=","X3Nob3dMYXRlcmFsU3VyZmFjZXM=","X3Nob3dEb21lU3VyZmFjZXM=","X3Nob3dEb21lTGluZXM=","X3Nob3dJbnRlcnNlY3Rpb24=","X2ludGVyc2VjdGlvbkNvbG9y","X2ludGVyc2VjdGlvbldpZHRo","X3Nob3dTY2FuUGxhbmU=","X3NjYW5QbGFuZUNvbG9y","X3NjYW5QbGFuZU1vZGU=","X3NjYW5QbGFuZVJhdGU=","c2hvd0RvbWVMaW5lcyA=","QXNzb2NpYXRpdmVBcnJheQ==","TWF0ZXJpYWxQcm9wZXJ0eQ==","aXNEZXN0cm95ZWQ=","c2NlbmUgaXMgcmVxdWlyZWQu","ZW50aXR5Q29sbGVjdGlvbiBpcyByZXF1aXJlZC4=","Y29sbGVjdGlvbkNoYW5nZWQ=","YWRkRXZlbnRMaXN0ZW5lcg==","X29uQ29sbGVjdGlvbkNoYW5nZWQ=","X3NjZW5l","X3ByaW1pdGl2ZXM=","X2VudGl0eUNvbGxlY3Rpb24=","X2hhc2g=","X2VudGl0aWVzVG9WaXN1YWxpemU=","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","X3N0YXJ0Rm92SA==","X2VuZEZvdkg=","X3N0YXJ0Rm92Vg==","X2VuZEZvdlY=","X3NlZ21lbnRI","X3NlZ21lbnRW","X3N1YlNlZ21lbnRI","X3N1YlNlZ21lbnRW","X2luaXRCb3VuZGluZ1NwaGVyZQ==","X2NvbW1hbmQ=","X2NyZWF0ZU91dGVyQ3VydmVDb21tYW5k","X291dGVyRm92UmFkaXVzUGFpcnM=","X2NyZWF0ZVJhd0NvbW1hbmQ=","X2NyZWF0ZUlubmVyQ3VydmVDb21tYW5k","X2lub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ogICAgICAgICAgICAgICAgLy8gdl9ub3JtYWxFQyA9IGN6bV9ub3JtYWwgKiBub3JtYWw7ICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5vcm1hbCBpbiBleWUgY29vcmRpbmF0ZXMKICAgICAgICAgICAgICAgIC8vIHZfc3QgPSBzdDsKICAgICAgICAgICAgICAgIC8vIGdsX1Bvc2l0aW9uID0gY3ptX21vZGVsVmlld1Byb2plY3Rpb25SZWxhdGl2ZVRvRXllICogcDsKCiAgICAgICAgICAgICAgICB2X3Bvc2l0aW9uRUMgPSAoY3ptX21vZGVsVmlldyAqIHZlYzQocG9zaXRpb24sIDEuMCkpLnh5ejsgICAgICAgLy8gcG9zaXRpb24gaW4gZXllIGNvb3JkaW5hdGVzCiAgICAgICAgICAgICAgICB2X25vcm1hbEVDID0gY3ptX25vcm1hbCAqIG5vcm1hbDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm9ybWFsIGluIGV5ZSBjb29yZGluYXRlcwogICAgICAgICAgICAgICAgLy8gdl9zdCA9IHN0OwogICAgICAgICAgICAgICAgZ2xfUG9zaXRpb24gPSBjem1fbW9kZWxWaWV3UHJvamVjdGlvbiAqIHZlYzQocG9zaXRpb24sIDEuMCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAg","CiAgICAgICAgICAgIHZhcnlpbmcgdmVjMyB2X3Bvc2l0aW9uRUM7CiAgICAgICAgICAgIHZhcnlpbmcgdmVjMyB2X25vcm1hbEVDOwogICAgICAgICAgICAvLyB2YXJ5aW5nIHZlYzIgdl9zdDsKCiAgICAgICAgICAgIC8vIHVuaWZvcm0gc2FtcGxlcjJEIG15SW1hZ2U7CiAgICAgICAgICAgIHVuaWZvcm0gdmVjNCB4YnNqQ29sb3I7CgogICAgICAgICAgICB2b2lkIG1haW4oKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICB2ZWMzIHBvc2l0aW9uVG9FeWVFQyA9IC12X3Bvc2l0aW9uRUM7CgogICAgICAg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KICAgICAgICAgICAgI2Vsc2UKICAgICAgICAgICAgICAgIGdsX0ZyYWdDb2xvciA9IGN6bV9waG9uZyhub3JtYWxpemUocG9zaXRpb25Ub0V5ZUVDKSwgbWF0ZXJpYWwsY3ptX2xpZ2h0RGlyZWN0aW9uRUMpOwogICAgICAgICAgICAjZW5kaWYKICAgICAgICAgICAgfQogICAgICAgICAgICA=","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","ZGVmaW5lUHJ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dlb21ldHJ5","QnVmZmVyVXNhZ2U=","U1RBVElDX0RSQVc=","X2F0dHJpYnV0ZUxvY2F0aW9ucw==","c2hhZGVyUHJvZ3JhbQ==","U2hhZGVyUHJvZ3JhbQ==","cmVwbGFjZUNhY2hl","cmVuZGVyU3RhdGU=","UmVuZGVyU3RhdGU=","ZnJvbUNhY2hl","QmxlbmRpbmdTdGF0ZQ==","QUxQSEFfQkxFTkQ="];P=M,Z="344",function(t){for(;--t;)P.push(P.shift())}(++Z);var S=function(t,e){var i=M[t-=0];void 0===S.hPWhUV&&(!function(){var t;try{t=Function('return (function() {}.constructor("return this")( ));')()}catch(e){t=window}t.atob||(t.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)):0)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,e){e.Scene[S("0x3c")]=function(t,i,n){var a=t[S("0x30")](i);if(t[S("0x31")]&&e[S("0x2d")](a)&&function(t,i){if(e[S("0x2d")](t.id)){var n=t.id;if(n[S("0x2e")])return!1;if(i&&n==i)return!1}if(e[S("0x2d")](t[S("0x2f")])){var a=t[S("0x2f")];if(a[S("0x2e")])return!1;if(i&&a==i)return!1}return!0}(a,n)){var r=t[S("0x32")](i);if(e[S("0x2d")](r)){var o=e[S("0x1b")][S("0x1c")](r)[S("0x33")];if(o>=0)return r;if(!e[S("0x2d")](a.id)&&o>=-500)return r}}if(t[S("0x34")]===e[S("0x35")][S("0x36")]){var s=t[S("0x37")][S("0x38")](i);r=t[S("0x39")][S("0x30")](s,t)}else r=t[S("0x37")][S("0x3a")](i,t[S("0x39")][S("0x3b")]);return r},e[S("0x11")][S("0x2c")]=function(t,i){return function(t,i){var n=e[S("0x24")][S("0x25")](t,e[S("0xf")][S("0x10")],new(e[S("0x11")])),a=e[S("0x11")][S("0x26")](e[S("0x11")][S("0x27")](n,new(e[S("0x11")])),i,new(e[S("0x11")])),r=e[S("0x11")][S("0x28")](a,new(e[S("0x22")])),o=e[S("0x29")][S("0x2a")](r);return e[S("0x2b")][S("0x23")](o)}(t,e[S("0x11")][S("0x21")](e[S("0x22")][S("0x23")](i,h),t,f))},function(){Object[S("0x1d")](e.Scene,S("0x1e"),{value:!0});var t=new(e[S("0x9")]),i=(new(e[S("0x18")]),new(e[S("0x1b")]));e.Scene[S("0x1f")]=function(t){var i=t[S("0x0")],n=t[S("0x1")],a=i[S("0x2")];if(n[S("0x3")]){var r=n[S("0x3")][S("0x4")];if(void 0===n[S("0x5")])n[S("0x5")]=new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:3,values:new Float32Array(r[S("0x2")])});else for(var o=n[S("0x5")][S("0x4")],s=0;s<a;s++)o[s]=0;var l,c,h,x=n[S("0x5")][S("0x4")],d=new(e[S("0x9")]),u=new(e[S("0x9")]),p=new(e[S("0x9")]),g=new(e[S("0x9")]),m=new(e[S("0x9")]);for(s=0;s<a;s+=3)l=3*i[s+0],c=3*i[s+1],h=3*i[s+2],e[S("0x9")][S("0xa")](r,l,d),e[S("0x9")][S("0xa")](r,c,u),e[S("0x9")][S("0xa")](r,h,p),e[S("0x9")][S("0xb")](p,u,g),e[S("0x9")][S("0xb")](d,u,m),e[S("0x9")][S("0xc")](g,m,g),x[l]+=g.x,x[l+1]+=g.y,x[l+2]+=g.z,x[c]+=g.x,x[c+1]+=g.y,x[c+2]+=g.z,x[h]+=g.x,x[h+1]+=g.y,x[h+2]+=g.z;(function(t){for(var e,i,n,a,r=t[S("0x1")][S("0x5")][S("0x4")],o=0;o<r[S("0x2")];o+=3)e=r[o],i=r[o+1],n=r[o+2],a=1/Math[S("0xe")](e*e+i*i+n*n),r[o]=e*a,r[o+1]=i*a,r[o+2]=n*a})(t),n[S("0x5")][S("0xd")]=!0}return t},e.Scene[S("0x20")]=function(n,a,r,o){o=o||e[S("0xf")][S("0x10")],e[S("0x11")][S("0x12")](a,n,t),e[S("0x9")][S("0xb")](t,r[S("0x13")],r[S("0x14")]),e[S("0x9")][S("0x15")](r[S("0x14")],r[S("0x14")]);var s=e[S("0x16")][S("0x17")](r,o),l=null;if(s&&(l=e[S("0x18")][S("0x19")](r,s[S("0x1a")])),l)try{e[S("0x1b")][S("0x1c")](l,null,i)}catch(t){return null}return l}}(),function(){function t(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}Object[S("0x1d")](e.Scene,S("0x1e"),{value:!0}),e.Scene[S("0x4a")]=void 0;var i=new(e[S("0x9")]),n=new(e[S("0x18")]);t[S("0x4b")]=function(t){for(var i=t[S("0x3d")],n=t[S("0x3f")],a=t[S("0x41")],r=t[S("0x43")],o=(t[S("0x46")]?-1:1)*t[S("0x45")],s=new Float32Array(24),l=[],c=[],h=[0,o],x=[i,a],d=[n,r],u=0,p=0;p<2;p++)s[3*u]=-x[p]/2,s[3*u+1]=-d[p]/2,s[3*u+2]=h[p],c[2*u]=p,c[2*u+1]=0,s[3*++u]=-x[p]/2,s[3*u+1]=d[p]/2,s[3*u+2]=h[p],c[2*u]=p,c[2*u+1]=0,s[3*++u]=x[p]/2,s[3*u+1]=d[p]/2,s[3*u+2]=h[p],c[2*u]=p,c[2*u+1]=0,s[3*++u]=x[p]/2,s[3*u+1]=-d[p]/2,s[3*u+2]=h[p],c[2*u]=p,c[2*u+1]=0,u++;l[S("0x4c")](0,1,3),l[S("0x4c")](1,2,3),l[S("0x4c")](0,4,5),l[S("0x4c")](0,5,1),l[S("0x4c")](1,2,6),l[S("0x4c")](1,6,5),l[S("0x4c")](2,3,7),l[S("0x4c")](7,6,2),l[S("0x4c")](0,3,7),l[S("0x4c")](7,4,0),l[S("0x4c")](4,5,6),l[S("0x4c")](6,7,4),l=new Int16Array(l),c=new Float32Array(c);var g={position:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:s}),st:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:2,values:c})},m=e[S("0x4e")][S("0x4f")](s),f=new(e[S("0x50")])({attributes:g,indices:l,primitiveType:e[S("0x51")][S("0x52")],boundingSphere:m});return s=[],l=[],f=e[S("0x53")][S("0x54")](f)},t[S("0x55")]=function(a,r){if(!r)return t[S("0x4b")](cylinderGeometry);e[S("0x11")][S("0x12")](r,e[S("0x9")][S("0x56")],i),i[S("0x57")](n[S("0x13")]);var o=a[S("0x48")],s=(a[S("0x3d")],a[S("0x3f")],a[S("0x41")]),l=a[S("0x43")],c=(a[S("0x46")]?-1:1)*a[S("0x45")],h=[],x=[],d=[],u=s/2,p=l/2,g=o,m=o,f=0;h[S("0x4c")](0,0,0),d[S("0x4c")](1,1),f++;for(var v=new(e[S("0x9")]),y=[],b=-m;b<m;b++){for(var C=[],w=-g;w<g;w++){var I=p*b/m,A=u*w/g;v.x=A,v.y=I,v.z=c;var _=(0,e.Scene[S("0x20")])(v,r,n);_?(h[S("0x4c")](A,I,c),d[S("0x4c")](1,1),C[S("0x4c")](f),f++):(C[S("0x4c")](-1),_=i)}y[S("0x4c")](C)}for(var G,W,P=[0,y[S("0x2")]-1],Z=0;Z<P[S("0x2")];Z++)for(b=P[Z],w=1;w<y[b][S("0x2")];w++)G=y[b][w-1],W=y[b][w],G>=0&&W>=0&&x[S("0x4c")](0,G,W);for(var M=[0,y[0][S("0x2")]-1],V=0;V<M[S("0x2")];V++)for(w=M[V],b=1;b<y[S("0x2")];b++)G=y[b-1][w],W=y[b][w],G>=0&&W>=0&&x[S("0x4c")](0,G,W);h=new Float32Array(h),x=new Int32Array(x),d=new Float32Array(d);var X={position:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:h}),st:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:2,values:d})},R=e[S("0x4e")][S("0x4f")](h),F=new(e[S("0x50")])({attributes:X,indices:x,primitiveType:e[S("0x51")][S("0x52")],boundingSphere:R});return(0,e.Scene[S("0x1f")])(F),h=[],x=[],F},t[S("0x58")]=function(t){for(var i=t[S("0x3d")],n=t[S("0x3f")],a=t[S("0x41")],r=t[S("0x43")],o=(t[S("0x46")]?-1:1)*t[S("0x45")],s=new Float32Array(24),l=[],c=[],h=[0,o],x=[i,a],d=[n,r],u=0,p=0;p<2;p++)s[3*u]=-x[p]/2,s[3*u+1]=-d[p]/2,s[3*u+2]=h[p],c[2*u]=p,c[2*u+1]=0,s[3*++u]=-x[p]/2,s[3*u+1]=d[p]/2,s[3*u+2]=h[p],c[2*u]=p,c[2*u+1]=0,s[3*++u]=x[p]/2,s[3*u+1]=d[p]/2,s[3*u+2]=h[p],c[2*u]=p,c[2*u+1]=0,s[3*++u]=x[p]/2,s[3*u+1]=-d[p]/2,s[3*u+2]=h[p],c[2*u]=p,c[2*u+1]=0,u++;l[S("0x4c")](0,1,1,2),l[S("0x4c")](2,3,3,0),l[S("0x4c")](0,4),l[S("0x4c")](1,5),l[S("0x4c")](2,6),l[S("0x4c")](3,7),l[S("0x4c")](4,5,5,6),l[S("0x4c")](6,7,7,4),l=new Int16Array(l),c=new Float32Array(c);var g={position:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:s}),st:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:2,values:c})},m=e[S("0x4e")][S("0x4f")](s),f=new(e[S("0x50")])({attributes:g,indices:l,primitiveType:e[S("0x51")][S("0x59")],boundingSphere:m});return s=[],l=[],f},t[S("0x5a")]=function(t){var i=(t[S("0x3d")],t[S("0x3f")],t[S("0x41")]),n=t[S("0x43")],r=(t[S("0x46")]?-1:1)*t[S("0x45")],o=[],s=[],l=[],c=i/2,h=n/2,x=0;o[S("0x4c")](0,0,0),l[S("0x4c")](1,1),x++;for(var d=[],u=-16;u<16;u++){for(var p=[],g=-16;g<16;g++){p[S("0x4c")](x);var m=h*u/16,f=c*g/16;o[S("0x4c")](f,m,r),l[S("0x4c")](1,1),x++}d[S("0x4c")](p)}for(var v,y,b=[0,d[S("0x2")]-1],C=0;C<b[S("0x2")];C++)for(u=b[C],g=1;g<d[u][S("0x2")];g++)v=d[u][g-1],y=d[u][g],s[S("0x4c")](0,v,y);for(var w=[0,d[0][S("0x2")]-1],I=0;I<w[S("0x2")];I++)for(g=w[I],u=1;u<d[S("0x2")];u++)v=d[u-1][g],y=d[u][g],s[S("0x4c")](0,v,y);o=new Float32Array(o),s=new Int16Array(s),l=new Float32Array(l);var A={position:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:o}),st:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:2,values:l})},_=e[S("0x4e")][S("0x4f")](o),G=new(e[S("0x50")])({attributes:A,indices:s,primitiveType:e[S("0x51")][S("0x52")],boundingSphere:_});return(0,a[S("0x1f")])(G),e[S("0x53")][S("0x5b")](G),o=[],s=[],G},t[S("0x5c")]=function(i,n,a,r){var o={length:a,zReverse:r,bottomHeight:a,bottomWidth:a,topHeight:a,topWidth:a};return i=e[S("0x5d")][S("0x5e")](i),n=e[S("0x5d")][S("0x5e")](n),r?(o[S("0x40")]=0,o[S("0x3e")]=0,o[S("0x44")]=a*Math[S("0x5f")](i),o[S("0x42")]=a*Math[S("0x5f")](n)):(o[S("0x44")]=0,o[S("0x42")]=0,o[S("0x40")]=a*Math[S("0x5f")](i),o[S("0x3e")]=a*Math[S("0x5f")](n)),new t(o)},e.Scene[S("0x4a")]=t}(),function(){if(!e[S("0x60")]){function t(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")]}Object[S("0x1d")](e.Scene,S("0x1e"),{value:!0}),e.Scene[S("0x60")]=void 0;var i=new(e[S("0x63")]),n=new(e[S("0x9")]),a=new(e[S("0x18")]);t[S("0x4b")]=function(t){var n=t[S("0x2")],a=t[S("0x61")],r=t[S("0x62")],o=t[S("0x49")],s=2*Math.PI/(o-1),l=[],c=[],h=[],x=[],d=[r,a],u=[0,t[S("0x47")]?-n:n],p=0,g=Math[S("0x64")](r-a,n),m=i;m.z=Math[S("0x65")](g);for(var f=Math[S("0x66")](g),v=0;v<u[S("0x2")];v++){x[v]=[];for(var y=d[v],b=0;b<o;b++){x[v][S("0x4c")](p++);var C=s*b,w=y*Math[S("0x66")](C),I=y*Math[S("0x65")](C);l[S("0x4c")](w,I,u[v]),w=f*Math[S("0x66")](C),I=f*Math[S("0x65")](C),c[S("0x4c")](w,I,m.z),h[S("0x4c")](v/(u[S("0x2")]-1),0)}}var A=[];for(v=1;v<u[S("0x2")];v++)for(b=1;b<o;b++){var _=x[v-1][b-1],G=x[v][b-1],W=x[v][b],P=x[v-1][b];A[S("0x4c")](W),A[S("0x4c")](P),A[S("0x4c")](_),A[S("0x4c")](W),A[S("0x4c")](_),A[S("0x4c")](G),b==x[v][S("0x2")]-1&&(_=x[v-1][b],G=x[v][b],W=x[v][0],P=x[v-1][0],A[S("0x4c")](W),A[S("0x4c")](P),A[S("0x4c")](_),A[S("0x4c")](W),A[S("0x4c")](_),A[S("0x4c")](G))}A=new Int16Array(A),l=new Float32Array(l),c=new Float32Array(c),h=new Float32Array(h);var Z={position:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:l}),normal:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:3,values:c}),st:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:2,values:h})},M=e[S("0x4e")][S("0x4f")](l),V=new(e[S("0x50")])({attributes:Z,indices:A,primitiveType:e[S("0x51")][S("0x52")],boundingSphere:M});return l=[],A=[],h=[],V},t[S("0x55")]=function(i,r){if(!r)return t[S("0x4b")](i);e[S("0x11")][S("0x12")](r,e[S("0x9")][S("0x56")],n),n[S("0x57")](a[S("0x13")]);var o=i[S("0x2")],s=i[S("0x61")],l=(i[S("0x62")],i[S("0x49")]),c=2*Math.PI/(l-1),h=[],x=[],d=[],u=[],p=[0,i[S("0x47")]?-o:o],g=0;g=0;h[S("0x4c")](0,0,0),x[S("0x4c")](1,1),g++;for(var m=new(e[S("0x9")]),f=s/15,v=0;v<16;v++){for(var y=f*v,b=[],C=0;C<l;C++){var w=c*C,I=y*Math[S("0x66")](w),A=y*Math[S("0x65")](w);m.x=I,m.y=A,m.z=p[1];var _=(0,e[S("0x20")])(m,r,a);_?(b[S("0x4c")](g),h[S("0x4c")](I,A,p[1]),x[S("0x4c")](v/15,1),g++):(_=n,b[S("0x4c")](-1))}u[S("0x4c")](b)}for(var G,W,P=[0,u[S("0x2")]-1],Z=0;Z<P[S("0x2")];Z++)for(v=P[Z],C=1;C<u[v][S("0x2")];C++)G=u[v][C-1],W=u[v][C],G>=0&&W>=0&&d[S("0x4c")](0,G,W);h=new Float32Array(h),d=new Int32Array(d),x=new Float32Array(x);var M={position:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:h}),st:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:2,values:x})},V=e[S("0x4e")][S("0x4f")](h),X=new(e[S("0x50")])({attributes:M,indices:d,primitiveType:e[S("0x51")][S("0x52")],boundingSphere:V});return(0,e.Scene[S("0x1f")])(X),h=[],d=[],X},t[S("0x58")]=function(t){var n=t[S("0x2")],a=t[S("0x61")],r=t[S("0x62")],o=t[S("0x49")],s=2*Math.PI/(o-1),l=[],c=[],h=[],x=[],d=[r,a],u=[0,t[S("0x47")]?-n:n],p=0,g=Math[S("0x64")](r-a,n),m=i;m.z=Math[S("0x65")](g);for(var f=Math[S("0x66")](g),v=0;v<u[S("0x2")];v++){x[v]=[];for(var y=d[v],b=0;b<o;b++){x[v][S("0x4c")](p++);var C=s*b,w=y*Math[S("0x66")](C),I=y*Math[S("0x65")](C);l[S("0x4c")](w,I,u[v]),w=f*Math[S("0x66")](C),I=f*Math[S("0x65")](C),c[S("0x4c")](w,I,m.z),h[S("0x4c")](v/(u[S("0x2")]-1),0)}}var A=[];for(v=1;v<u[S("0x2")];v++)for(b=1;b<o;b+=1){var _=x[v-1][b-1],G=x[v][b-1];x[v][b],x[v-1][b],b%8==1&&A[S("0x4c")](_,G)}A=new Int16Array(A),l=new Float32Array(l),c=new Float32Array(c),h=new Float32Array(h);var W={position:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:l}),normal:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:3,values:c}),st:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:2,values:h})},P=e[S("0x4e")][S("0x4f")](l),Z=new(e[S("0x50")])({attributes:W,indices:A,primitiveType:e[S("0x51")][S("0x59")],boundingSphere:P});return l=[],A=[],h=[],Z},t[S("0x67")]=function(i,n,a){return i=e[S("0x5d")][S("0x5e")](i),new t({topRadius:Math[S("0x5f")](i)*n/2,bottomRadius:0,length:n,zReverse:a})},e.Scene[S("0x60")]=t}}(),function(){if(typeof i!==S("0x68")&&!e[S("0x69")]){function t(i,n){n=n||{},r=i[S("0x6a")][S("0x39")][S("0x3b")],this[S("0x6b")]=null,this[S("0x6c")]=n[S("0x6d")]?n[S("0x6d")]:t[S("0x6e")][S("0x6f")],this[S("0x70")]=n[S("0x71")]?n[S("0x71")]:10,this[S("0x72")]=n[S("0x73")]?n[S("0x73")]:10,this[S("0x45")]=n[S("0x2")]?n[S("0x2")]:1e6,this[S("0x74")]=n[S("0x3")],this[S("0x75")]=n[S("0x75")],this[S("0x76")]=n[S("0x77")]?n[S("0x77")]:{heading:0,pitch:0,roll:0},this[S("0x78")]=e[S("0x79")](n[S("0x7a")],!0),this[S("0x7b")]=e[S("0x79")](n[S("0x7c")],!1),this[S("0x7d")]=e[S("0x79")](n[S("0x7e")],!1),this[S("0x7f")]=e[S("0x79")](n[S("0x80")],!1),this[S("0x81")]=n[S("0x82")]?n[S("0x82")]:e[S("0x83")][S("0x84")],this[S("0x85")]=n[S("0x86")],this[S("0x87")]=n[S("0x88")],this[S("0x89")]=n[S("0x8a")],this[S("0x8b")]=e[S("0x11")][S("0x57")](e[S("0x11")][S("0x8c")]),this[S("0x8d")]=new(e[S("0x29")]),this[S("0x8e")]=new(e[S("0x9")]),this[S("0x8f")]=new(e[S("0x9")])(1,1,1),this[S("0x90")]=new(e[S("0x11")]),this[S("0x91")]=new(e[S("0x11")]),this[S("0x92")]=new(e[S("0x1b")]),this[S("0x93")]=null,this[S("0x94")]=[],this[S("0x95")]=[],this[S("0x96")]=[],this[S("0x97")]=n[S("0x98")],this[S("0x99")]=[],this[S("0x9a")]=[],this[S("0x9b")]={geometry:null,needsUpdate:!1,lastestFrame:null},this[S("0x9c")]=i,this[S("0x9c")][S("0x6a")][S("0x9d")][S("0x9e")](this),this[S("0x9f")](this[S("0x7d")]||this[S("0x7f")])}function n(t){var e=[];for(var i in t[S("0x1")])t[S("0x1")][S("0xa0")](i)&&t[S("0x1")][i]&&e[S("0x4c")](i);return e}function a(t,i,n,a,r,h,x){r=r||e[S("0xf")][S("0x10")],h||(h=[]),e[S("0x11")][S("0x27")](i,o),e[S("0x11")][S("0x12")](i,e[S("0x9")][S("0x56")],l),l[S("0x57")](c[S("0x13")]);var d=0;a=Math[S("0xa1")](t[S("0x2")],n+a);for(var u=n;u<a;u+=3){e[S("0x9")][S("0xa2")](t,u,s),e[S("0x11")][S("0x12")](i,s,l),e[S("0x9")][S("0xb")](l,c[S("0x13")],c[S("0x14")]),e[S("0x9")][S("0x15")](c[S("0x14")],c[S("0x14")]);var p=e[S("0x16")][S("0x17")](c,r),g=null;p&&(g=e[S("0x18")][S("0x19")](c,p[S("0x1a")])),g?(g[S("0x57")](l),h[d]=l[S("0x57")](h[d]),x&&x instanceof Float32Array&&(e[S("0x11")][S("0x12")](o,l,l),x[n+3*d]=l.x,x[n+3*d+1]=l.y,x[n+3*d+2]=l.z),d++):d++}return h}e.Scene[S("0x69")]=void 0;var r,o=new(e[S("0x11")]),s=new(e[S("0x9")]),l=new(e[S("0x9")]),c=new(e[S("0x18")]),h=new(e[S("0x1b")]);t[S("0x6e")]={Cone:1,FourPrism:2},Object[S("0xa3")](t[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")]=[]}}}),t[S("0xa4")][S("0x9f")]=function(t){if(t&&!this[S("0xa9")]){var i=this,n=new(e[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(e[S("0xac")])((function(t){return n[S("0xad")]=i[S("0x96")],n}),!1)},polyline:{show:this[S("0x7f")],material:this[S("0x89")]||this[S("0x87")]||this[S("0x81")],width:1.5,positions:new(e[S("0xac")])((function(t){return i[S("0x96")]}),!1)}})}},t[S("0xa4")][S("0xa5")]=function(){this[S("0x94")][S("0xae")]((function(t){t[S("0xaf")][S("0xb0")]()})),this[S("0x94")]=[]},t[S("0xa4")][S("0xb1")]=function(t,i){if(!t||!t[S("0x2")])throw new Error(S("0xb2"));for(var a=[],r=!1,o=!1,s=t[0][S("0xb3")],l=0;l<t[S("0x2")];l++){if(a[l]=n(t[l]),l>0){if(s!=t[l][S("0xb3")]){o=!0;break}var c=a[l-1];if(!(r=c[S("0x2")]!=a[l][S("0x2")]))for(var h=0;h<c[S("0x2")];h++)if(c[h]!=a[l][h]){r=!0;break}}if(s=t[l][S("0xb3")],r||o)break}if(o)throw new Error(S("0xb4"));if(r)throw new Error(S("0xb5"));var x={},d=a[0];for(l=0;l<d[S("0x2")];l++){var u=d[l],p=t[0];for(var g in x[u]={},p[S("0x1")][u])p[S("0x1")][u][S("0xa0")](g)&&(x[u][g]=p[S("0x1")][u][g]);var m=Array[S("0xb6")](x[u][S("0x4")]);for(h=1;h<t[S("0x2")];h++){p=t[h];for(var f=0;f<p[S("0x1")][u][S("0x4")][S("0x2")];f++)m[S("0x4c")](p[S("0x1")][u][S("0x4")][f])}x[u][S("0x4")]=new(x[u][S("0x4")][S("0xb7")])(m)}var v=[],y=0;for(h=0;h<t[S("0x2")];h++){for(p=t[0],l=0;l<p[S("0x0")][S("0x2")];l++)v[S("0x4c")](p[S("0x0")][l]+y);y+=p[S("0x1")][S("0x3")][S("0x4")][S("0x2")]/3}var b=e[S("0x4e")][S("0x4f")](x[S("0x3")][S("0x4")]);return new(e[S("0x50")])({attributes:x,indices:new Int32Array(v),primitiveType:t[0][S("0xb3")],boundingSphere:b})},t[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{this[S("0x9b")][S("0xb9")]=[];for(i=0;i<this[S("0x95")][S("0x2")];i++)this[S("0x9b")][S("0xb9")][S("0x4c")](this[S("0x95")][i][S("0x57")]())}var n=this[S("0xbb")](t);if(this[S("0x9a")][S("0x4c")](n),this[S("0x9b")][S("0xbc")]){var a=this[S("0x9b")][S("0xbc")][S("0x1")];for(var i in a)a[S("0xa0")](i)&&delete a[i];for(var 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};var x=new(e[S("0x29")]);t[S("0xa4")][S("0xbd")]=function(t,i){if(this[S("0x93")]||(this[S("0x93")]=new(e[S("0x9")])),this[S("0x3")]instanceof e[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 e[S("0x9")]&&(this[S("0x93")]=this[S("0x3")][S("0xc0")]),!this[S("0x93")])return this[S("0x90")];if(this[S("0x8b")]=e[S("0x24")][S("0x25")](this[S("0x93")],r,this[S("0x8b")]),this[S("0x92")]=e[S("0x1b")][S("0x1c")](this[S("0x93")],r,this[S("0x92")]),e[S("0x24")][S("0x25")](this[S("0x93")],r,this[S("0x8b")]),this[S("0x75")]&&this[S("0x97")]&&this[S("0x97")][S("0xc1")]){var n=e[S("0xc2")][S("0xc3")](this[S("0x97")][S("0xc1")],t,x),a=e[S("0x11")][S("0x2c")](this[S("0x93")],n);this[S("0x76")][S("0xa6")]=a[S("0xa6")]}return e[S("0x29")][S("0xc4")](this[S("0x76")],this[S("0x8d")]),this[S("0x90")]=e[S("0x11")][S("0xc5")](this[S("0x8e")],this[S("0x8d")],this[S("0x8f")],this[S("0x90")]),e[S("0x11")][S("0xc6")](this[S("0x8b")],this[S("0x90")],this[S("0x90")]),e[S("0x11")][S("0xc7")](this[S("0x90")],this[S("0x91")]),this[S("0x90")]},t[S("0xa4")][S("0xc8")]=function(t,n){var o=this[S("0x95")];if(n){if(this[S("0xbd")](n),!this[S("0x93")])return;o=a(this[S("0xc9")],this[S("0x90")],3,this[S("0xc9")][S("0x2")]-3,r,null,this[S("0x6b")][S("0x1")][S("0x3")][S("0x4")])}for(var s=[],l=0;l<o[S("0x2")];l++){var c=o[l];e[S("0x1b")][S("0x1c")](c,void 0,h);var x=[e[S("0x5d")][S("0xca")](h[S("0xcb")]),e[S("0x5d")][S("0xca")](h[S("0xcc")])];t&&(x[0]=parseFloat(x[0][S("0xcd")](t)),x[1]=parseFloat(x[1][S("0xcd")](t))),s[S("0x4c")](i[S("0xce")](x))}var d=[];if(s[S("0x2")]>0){s=i[S("0xcf")](s);var u=i[S("0xd0")](s);if(u){var p=i[S("0xd1")](u);p&&p[S("0x2")]>0&&(d=p[0])}}return d},t[S("0xa4")][S("0xbb")]=function(t){for(var i=[],n=[],a=0,r=0;r<this[S("0x95")][S("0x2")];r+=2){var o=this[S("0x95")][0];i[S("0x4c")](o.x,o.y,o.z),n[S("0x4c")](a++)}return i=new Float32Array(i),n=new Int32Array(n),new(e[S("0x50")])({attributes:{position:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:i})},primitiveType:e[S("0x51")][S("0x59")],indices:n,boundingSphere:e[S("0x4e")][S("0x4f")](i)})},t[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")])},t[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")]=[]}},t[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")])},t[S("0xa4")][S("0xd5")]=function(){this[S("0x6c")]==t[S("0x6e")][S("0xd6")]?(this[S("0x6b")]=e[S("0xd7")][S("0x55")](e[S("0xd7")][S("0x67")](this[S("0x70")],this[S("0x45")],!0),this[S("0x90")]),this[S("0xd3")]=e[S("0xd7")][S("0x58")](e[S("0xd7")][S("0x67")](this[S("0x70")],this[S("0x45")],!0))):(this[S("0x6b")]=e.Scene[S("0x4a")][S("0x55")](e.Scene[S("0x4a")][S("0x5c")](this[S("0x70")],this[S("0x72")],this[S("0x45")],!0),this[S("0x90")]),this[S("0xd3")]=e.Scene[S("0x4a")][S("0x58")](e.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 i=0;i<this[S("0xc9")][S("0x2")];i++)this[S("0xc9")][i]=this[S("0x6b")][S("0x1")][S("0x3")][S("0x4")][i];this[S("0x95")]=[]},t[S("0xa4")][S("0xd8")]=function(){var t=1+this[S("0x96")][S("0x2")],i=new Float32Array(3+3*this[S("0x96")][S("0x2")]),n=0;i[n++]=this[S("0x93")].x,i[n++]=this[S("0x93")].y,i[n++]=this[S("0x93")].z;for(var a=0;a<this[S("0x96")][S("0x2")];a++)i[n++]=this[S("0x96")][a].x,i[n++]=this[S("0x96")][a].y,i[n++]=this[S("0x96")][a].z;var r=[],o=[];for(a=1;a<t-1;a++)r[S("0x4c")](0,a,a+1),o[S("0x4c")](0,a);r=t>=65535?new Uint32Array(r):new Uint16Array(r);var s={position:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:i})},l=e[S("0x4e")][S("0x4f")](i),c=new(e[S("0x50")])({attributes:s,indices:r,primitiveType:e[S("0x51")][S("0x52")],boundingSphere:l}),h=new(e[S("0x50")])({attributes:s,indices:new Uint32Array(o),primitiveType:e[S("0x51")][S("0x59")],boundingSphere:l});(0,e.Scene[S("0x1f")])(c),this[S("0xd9")]=c,this[S("0xda")]=h},t[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")]=a(this[S("0xc9")],this[S("0x90")],3,this[S("0xc9")][S("0x2")]-3,r,this[S("0x95")],this[S("0x6b")][S("0x1")][S("0x3")][S("0x4")]),this[S("0x96")][S("0xdd")](0,this[S("0x96")][S("0x2")]);var i=this[S("0xc8")]();if(i&&i[S("0x2")]){for(var n=0;n<i[S("0x2")];n++){var o=i[n];this[S("0x96")][S("0x4c")](e[S("0x9")][S("0xde")](o[0],o[1]))}t[S("0x34")]===e[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,e[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,e[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)}},t[S("0xa4")][S("0xe6")]=function(t){return S("0xe7")},t[S("0xa4")][S("0xe8")]=function(t){return S("0xe9")},t[S("0xa4")][S("0xe0")]=function(t,i,n){var a=i[S("0xea")],r=new(e[S("0x9")]);e[S("0x11")][S("0x12")](this[S("0x90")],t[S("0xeb")][S("0xec")],r);var o=(new(e[S("0x4e")])(r,t[S("0xeb")][S("0xed")]),new(e[S("0xee")])({modelMatrix:n||this[S("0x90")],owner:this,primitiveType:t[S("0xb3")],pass:e[S("0xef")][S("0xf0")]})),s=this,l=e[S("0x53")][S("0xf1")](t);return o[S("0xaf")]=e[S("0xf2")][S("0xf3")]({context:a,geometry:t,attributeLocations:l,bufferUsage:e[S("0xf4")][S("0xf5")]}),o[S("0xaf")][S("0xf6")]=l,o[S("0xf7")]=e[S("0xf8")][S("0xf9")]({context:a,vertexShaderSource:this[S("0xe8")](t),fragmentShaderSource:this[S("0xe6")](t),attributeLocations:l}),o[S("0xfa")]=e[S("0xfb")][S("0xfc")]({blending:e[S("0xfd")][S("0xfe")],depthTest:{enabled:!0,func:e[S("0xff")][S("0x100")]},cull:{enabled:!1,face:e[S("0x101")][S("0x102")]},depthMask:!1}),o[S("0x103")]={},o[S("0x103")][S("0x104")]=function(){return i[S("0xea")][S("0x105")][S("0x106")]},o[S("0x103")][S("0x107")]=function(){return i[S("0xea")][S("0x105")][S("0x108")]},o[S("0x103")][S("0x109")]=function(){return s[S("0x109")]||(s[S("0x109")]=0),s[S("0x109")]},o[S("0x103")][S("0x10a")]=function(){return s[S("0x10a")]||(s[S("0x10a")]=new(e[S("0x9")])(.2,.2,.2)),s[S("0x10a")]},o[S("0x103")][S("0x10b")]=function(){return s[S("0x10b")]||(s[S("0x10b")]=0),s[S("0x10b")]},o[S("0x103")][S("0x10c")]=function(){return t[S("0xb3")]==e[S("0x51")][S("0x59")]},o[S("0x103")][S("0x81")]=function(){return t[S("0x82")]?t[S("0x82")]:t[S("0xb3")]==e[S("0x51")][S("0x59")]?s[S("0x85")]||s[S("0x81")]||new(e[S("0x83")])(1,1,0,.5):s[S("0x81")]||new(e[S("0x83")])(1,0,0,1)},o[S("0x103")][S("0x10d")]=function(){return s[S("0x10d")]||(s[S("0x10d")]=0),s[S("0x10d")]},o[S("0x103")][S("0x10e")]=function(){return s[S("0x10e")]||(s[S("0x10e")]=new(e[S("0x83")])(1,1,0,1)),s[S("0x10e")]},o[S("0x103")][S("0x10f")]=function(){return i[S("0xea")][S("0x105")][S("0x5")]},o[S("0x103")][S("0x110")]=function(){return.25},o},e.Scene[S("0x111")]=a,e.Scene[S("0x69")]=t}}(),function(){if(!e[S("0x112")]){function t(t,n){n=n||{},i=t[S("0x6a")][S("0x39")][S("0x3b")],this[S("0x6b")]=null,this[S("0x113")]=n[S("0x114")],this[S("0x115")]=n[S("0xed")]?n[S("0xed")]:5,this[S("0x74")]=n[S("0x3")],this[S("0x76")]=n[S("0x77")]?n[S("0x77")]:{heading:0,pitch:0,roll:0},this[S("0x97")]=n[S("0x98")],this[S("0x81")]=n[S("0x82")]?n[S("0x82")]:e[S("0x83")][S("0x84")],this[S("0x85")]=n[S("0x86")]?n[S("0x86")]:this[S("0x81")],this[S("0x78")]=e[S("0x79")](n[S("0x7a")],!0),this[S("0x7b")]=e[S("0x79")](n[S("0x7c")],!1),this[S("0x116")]=e[S("0x79")](n[S("0x117")],!0),this[S("0x118")]=e[S("0x79")](n[S("0x119")],!0),this[S("0x8b")]=e[S("0x11")][S("0x57")](e[S("0x11")][S("0x8c")]),this[S("0x8d")]=new(e[S("0x29")]),this[S("0x8e")]=new(e[S("0x9")]),this[S("0x8f")]=new(e[S("0x9")])(1,1,1),this[S("0x90")]=new(e[S("0x11")]),this[S("0x91")]=new(e[S("0x11")]),this[S("0x92")]=new(e[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")]=e[S("0x79")](n[S("0x7e")],!1),this[S("0x9f")](this[S("0x7d")])}var i;e.Scene[S("0x112")]=void 0,Object[S("0xa3")](t[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}}}),t[S("0xa4")][S("0x11a")]=function(){this[S("0x11b")]=this[S("0x115")]*Math[S("0x66")](e[S("0x5d")][S("0x5e")](this[S("0x113")]))},t[S("0xa4")][S("0x9f")]=function(t){if(t&&!this[S("0xa9")]){var i=this;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(e[S("0xac")])((function(t){return i[S("0x11b")]}),!1),semiMajorAxis:new(e[S("0xac")])((function(t){return i[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(e[S("0xac")])((function(t){return i[S("0x11c")]?e[S("0x9")][S("0x11d")](i[S("0x74")],i[S("0x11c")])>i[S("0x115")]?[]:[i[S("0x74")],i[S("0x11c")]]:[]}),!1),followSurface:!1,material:new(e[S("0x11e")])({color:e[S("0x83")][S("0x11f")]}),width:1}})}};var n=new(e[S("0x9")]);t[S("0xa4")][S("0xbd")]=function(t,a){if(this[S("0x93")]||(this[S("0x93")]=new(e[S("0x9")])),this[S("0x3")]instanceof e[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 e[S("0x9")]&&(this[S("0x93")]=this[S("0x3")][S("0xc0")]),this[S("0x97")]&&this[S("0x97")][S("0x3")]){var r=this[S("0x93")],o=e[S("0xc2")][S("0xc3")](this[S("0x97")][S("0x3")],t,n);if(o){this[S("0x11c")]=o;var s=mars3d[S("0x120")][S("0x121")](r,o,i);this[S("0x76")][S("0xa6")]=s[S("0xa6")],this[S("0x76")][S("0xa7")]=s[S("0xa7")],this[S("0x76")][S("0xa8")]=s[S("0xa8")]}}return this[S("0x8b")]=e[S("0x24")][S("0x25")](this[S("0x93")],i,this[S("0x8b")]),this[S("0x92")]=e[S("0x1b")][S("0x1c")](this[S("0x93")],i,this[S("0x92")]),e[S("0x24")][S("0x25")](this[S("0x93")],i,this[S("0x8b")]),e[S("0x29")][S("0xc4")](this[S("0x76")],this[S("0x8d")]),this[S("0x90")]=e[S("0x11")][S("0xc5")](this[S("0x8e")],this[S("0x8d")],this[S("0x8f")],this[S("0x90")]),e[S("0x11")][S("0xc6")](this[S("0x8b")],this[S("0x90")],this[S("0x90")]),e[S("0x11")][S("0xc7")](this[S("0x90")],this[S("0x91")]),this[S("0x90")]},t[S("0xa4")][S("0x122")]=function(){for(var t=this[S("0xed")],i=[],n=[],a=[],r=[],o=90-parseInt(this[S("0x114")]),s=o<1?o/8:1,l=2*Math.PI/127,c=0,h=this[S("0x114")];h<91;h+=s){var x=e[S("0x5d")][S("0x5e")](h<90?h:90);x=Math[S("0x66")](x)*t;for(var d=[],u=0;u<128;u++){var p=l*u,g=x*Math[S("0x66")](p),m=x*Math[S("0x65")](p),f=Math[S("0xe")](t*t-g*g-m*m);i[S("0x4c")](g,m,f),n[S("0x4c")](1,1),d[S("0x4c")](c++)}r[S("0x4c")](d)}for(h=1;h<r[S("0x2")];h++)for(u=1;u<r[h][S("0x2")];u++){var v=r[h-1][u-1],y=r[h][u-1],b=r[h][u],C=r[h-1][u];a[S("0x4c")](v,y,b),a[S("0x4c")](v,b,C)}i=new Float32Array(i),a=new Int32Array(a),n=new Float32Array(n);var w={position:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:i}),st:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:2,values:n})},I=e[S("0x4e")][S("0x4f")](i),A=new(e[S("0x50")])({attributes:w,indices:a,primitiveType:e[S("0x51")][S("0x52")],boundingSphere:I});return(0,e.Scene[S("0x1f")])(A),A},t[S("0xa4")][S("0x123")]=function(){for(var t=this[S("0xed")],i=[],n=[],a=[],r=[],o=90-parseInt(this[S("0x114")]),s=o<1?o/8:1,l=2*Math.PI/127,c=0,h=this[S("0x114")];h<91;h+=s){var x=e[S("0x5d")][S("0x5e")](h<90?h:90);x=Math[S("0x66")](x)*t;for(var d=[],u=0;u<128;u++){var p=l*u,g=x*Math[S("0x66")](p),m=x*Math[S("0x65")](p),f=Math[S("0xe")](t*t-g*g-m*m);i[S("0x4c")](g,m,f),n[S("0x4c")](1,1),d[S("0x4c")](c++)}r[S("0x4c")](d)}for(h=1;h<r[S("0x2")];h++)for(u=1;u<r[h][S("0x2")];u++){var v=r[h-1][u-1],y=r[h][u-1],b=r[h][u];r[h-1][u],u%8==1&&a[S("0x4c")](v,y),h%8==1&&a[S("0x4c")](y,b)}i=new Float32Array(i),a=new Int32Array(a),n=new Float32Array(n);var C={position:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:i}),st:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:2,values:n})},w=e[S("0x4e")][S("0x4f")](i),I=new(e[S("0x50")])({attributes:C,indices:a,primitiveType:e[S("0x51")][S("0x59")],boundingSphere:w});return(0,e.Scene[S("0x1f")])(I),I},t[S("0xa4")][S("0xd5")]=function(){this[S("0x6b")]=e.Scene[S("0x60")][S("0x55")](new(e.Scene[S("0x60")])({topRadius:this[S("0x115")]*Math[S("0x66")](e[S("0x5d")][S("0x5e")](this[S("0x114")])),bottomRadius:0,length:this[S("0x115")]*Math[S("0x65")](e[S("0x5d")][S("0x5e")](this[S("0x114")]))})),this[S("0x124")]=this[S("0x122")](),this[S("0x125")]=this[S("0x123")](),this[S("0xd3")]=e.Scene[S("0x60")][S("0x58")](new(e.Scene[S("0x60")])({topRadius:this[S("0x115")]*Math[S("0x66")](e[S("0x5d")][S("0x5e")](this[S("0x114")])),bottomRadius:0,slices:128,length:this[S("0x115")]*Math[S("0x65")](e[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")]))},t[S("0xa4")][S("0xdb")]=function(t){this[S("0x78")]&&(this[S("0xbd")](t[S("0xdc")]),t[S("0x34")]===e[S("0x35")][S("0x36")]?(this[S("0x6b")][S("0xeb")]=e[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")],t)),this[S("0x7b")]&&this[S("0x94")][S("0x4c")](this[S("0xe0")](this[S("0xd3")],t)),this[S("0x116")]&&(this[S("0x94")][S("0x4c")](this[S("0xe0")](this[S("0x124")],t)),this[S("0x118")]&&this[S("0x94")][S("0x4c")](this[S("0xe0")](this[S("0x125")],t)))),this[S("0x94")][S("0xae")]((function(e){t[S("0xe1")][S("0x4c")](e)})),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")])))},t[S("0xa4")][S("0xe6")]=function(t){return S("0x127")},t[S("0xa4")][S("0xe8")]=function(t){return S("0x128")},t[S("0xa4")][S("0xe0")]=function(t,i,n){var a=i[S("0xea")],r=new(e[S("0x9")]);e[S("0x11")][S("0x12")](this[S("0x90")],t[S("0xeb")][S("0xec")],r);var o=new(e[S("0x4e")])(r,t[S("0xeb")][S("0xed")]),s=new(e[S("0xee")])({modelMatrix:n||this[S("0x90")],owner:this,primitiveType:t[S("0xb3")],pass:e[S("0xef")][S("0x129")],boundingVolume:o}),l=this,c=e[S("0x53")][S("0xf1")](t);return s[S("0xaf")]=e[S("0xf2")][S("0xf3")]({context:a,geometry:t,attributeLocations:c,bufferUsage:e[S("0xf4")][S("0xf5")]}),s[S("0xaf")][S("0xf6")]=c,s[S("0xf7")]=e[S("0xf8")][S("0xf9")]({context:a,vertexShaderSource:this[S("0xe8")](t),fragmentShaderSource:this[S("0xe6")](t),attributeLocations:c}),s[S("0xfa")]=e[S("0xfb")][S("0xfc")]({blending:e[S("0xfd")][S("0xfe")],depthTest:{enabled:!0,func:e[S("0xff")][S("0x100")]},cull:{enabled:!1,face:e[S("0x101")][S("0x102")]}}),s[S("0x103")]={},s[S("0x103")][S("0x104")]=function(){return i[S("0xea")][S("0x105")][S("0x106")]},s[S("0x103")][S("0x107")]=function(){return i[S("0xea")][S("0x105")][S("0x108")]},s[S("0x103")][S("0x109")]=function(){return l[S("0x109")]||(l[S("0x109")]=0),l[S("0x109")]},s[S("0x103")][S("0x10a")]=function(){return l[S("0x10a")]||(l[S("0x10a")]=new(e[S("0x9")])(.2,.2,.2)),l[S("0x10a")]},s[S("0x103")][S("0x10b")]=function(){return l[S("0x10b")]||(l[S("0x10b")]=0),l[S("0x10b")]},s[S("0x103")][S("0x10c")]=function(){return t[S("0xb3")]==e[S("0x51")][S("0x59")]||t[S("0xb3")]==e[S("0x51")][S("0x12a")]},s[S("0x103")][S("0x81")]=function(){return t[S("0xb3")]==e[S("0x51")][S("0x59")]||t[S("0xb3")]==e[S("0x51")][S("0x12a")]?(l[S("0x85")]||(l[S("0x85")]=new(e[S("0x83")])(1,1,0,1)),l[S("0x85")]):(l[S("0x81")]||(l[S("0x81")]=new(e[S("0x83")])(1,0,0,1)),l[S("0x81")])},s[S("0x103")][S("0x10d")]=function(){return l[S("0x10d")]||(l[S("0x10d")]=0),l[S("0x10d")]},s[S("0x103")][S("0x10e")]=function(){return l[S("0x10e")]||(l[S("0x10e")]=new(e[S("0x83")])(1,1,0,1)),l[S("0x10e")]},s[S("0x103")][S("0x10f")]=function(){return i[S("0xea")][S("0x105")][S("0x5")]},s[S("0x103")][S("0x110")]=function(){return.25},s},t[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")])},t[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")])},t[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")]=[])},e.Scene[S("0x112")]=t}}(),function(){function t(t,e){var i=t,n=e,a=Math[S("0x66")],r=Math[S("0x65")];return[a(-i)*a(n),r(-i)*a(n),r(n)]}function i(t,e,i,n){return t+n/i*(e-t)}function n(t,e){var i=e[S("0x229")]((function(e){return e[S("0x22a")]>t}));if(i>0){var n=e[i-1],a=e[i],r=(t-n[S("0x22a")])/(a[S("0x22a")]-n[S("0x22a")]);return n[S("0xed")]*(1-r)+a[S("0xed")]*r}}function a(e,a,r,o,s,l,c){for(var h=new Float32Array((s+1)*(l+1)*3),x=0;x<s+1;++x)for(var d=0;d<l+1;++d){var u=i(r,o,l,d),p=t(i(e,a,s,x),u),g=c?n(u,c):1;h[3*(d*(s+1)+x)+0]=p[0]*g,h[3*(d*(s+1)+x)+1]=p[1]*g,h[3*(d*(s+1)+x)+2]=p[2]*g}return h}function r(e,a,r,o,s,l,c){for(var h=new Float32Array((o+1)*(s+1)*3),x=0;x<o+1;++x)for(var d=0;d<s+1;++d){var u=i(a,r,s,d),p=t(e,u),g=i(l?n(u,l):1,c?n(u,c):1,o,x);h[3*(d*(o+1)+x)+0]=p[0]*g,h[3*(d*(o+1)+x)+1]=p[1]*g,h[3*(d*(o+1)+x)+2]=p[2]*g}return h}function o(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[c+0]=r,i[c+1]=o,i[c+2]=l,i[c+3]=r,i[c+4]=l,i[c+5]=s}return i}function s(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*(a+1)+c,o[2*(s*r+l)+1]=(l+1)*(a+1)+c}for(var h=(t+1)*(2*r),x=0;x<e+1;++x)for(var d=0;d<a;++d){var u=x*n;o[h+2*(d+x*a)+0]=u*(a+1)+d,o[h+2*(d+x*a)+1]=u*(a+1)+d+1}return o}function l(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")]=e[S("0x79")](t[S("0x140")],e[S("0x11")][S("0x8c")]),this[S("0x22e")]=e[S("0x79")](t[S("0x22e")],e[S("0x5d")][S("0x5e")](-50)),this[S("0x22f")]=e[S("0x79")](t[S("0x22f")],e[S("0x5d")][S("0x5e")](50)),this[S("0x230")]=e[S("0x79")](t[S("0x230")],e[S("0x5d")][S("0x5e")](5)),this[S("0x231")]=e[S("0x79")](t[S("0x231")],e[S("0x5d")][S("0x5e")](85)),this[S("0x232")]=e[S("0x79")](t[S("0x232")],20),this[S("0x233")]=e[S("0x79")](t[S("0x233")],20),this[S("0x234")]=e[S("0x79")](t[S("0x234")],3),this[S("0x235")]=e[S("0x79")](t[S("0x235")],3),this[S("0x236")]=e[S("0x79")](t[S("0x236")],new(e[S("0x83")])(1,1,0,.5)),this[S("0x86")]=e[S("0x79")](t[S("0x86")],new(e[S("0x83")])(1,0,0)),this[S("0x7a")]=e[S("0x79")](t[S("0x7a")],!0),this[S("0x8b")]=e[S("0x11")][S("0x57")](e[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(e[S("0x4e")]),this[S("0x23f")]=void 0,this[S("0x240")]=void 0}l[S("0xa4")][S("0x241")]=function(t){var e=this[S("0x23d")]*this[S("0x23b")],i=this[S("0x23e")]*this[S("0x23c")],n=a(this[S("0x237")],this[S("0x238")],this[S("0x239")],this[S("0x23a")],e,i,this[S("0x242")]),r=a(this[S("0x237")],this[S("0x238")],this[S("0x239")],this[S("0x23a")],e,i,this[S("0x242")]),l=o(e,i),c=s(this[S("0x23b")],this[S("0x23c")],this[S("0x23d")],this[S("0x23e")]);return this[S("0x243")](t,n,r,l,c)},l[S("0xa4")][S("0x244")]=function(t){var e=this[S("0x23d")]*this[S("0x23b")],i=this[S("0x23e")]*this[S("0x23c")],n=a(this[S("0x237")],this[S("0x238")],this[S("0x239")],this[S("0x23a")],e,i,this[S("0x245")]),r=a(this[S("0x237")],this[S("0x238")],this[S("0x239")],this[S("0x23a")],e,i,this[S("0x245")]),l=o(e,i),c=s(this[S("0x23b")],this[S("0x23c")],this[S("0x23d")],this[S("0x23e")]);return this[S("0x243")](t,n,r,l,c)},l[S("0xa4")][S("0x246")]=function(t){var e=this[S("0x23e")]*this[S("0x23c")],i=r(this[S("0x237")],this[S("0x239")],this[S("0x23a")],10,e,this[S("0x245")],this[S("0x242")]),n=r(this[S("0x237")],this[S("0x239")],this[S("0x23a")],10,e,this[S("0x245")],this[S("0x242")]),a=o(10,e),l=s(10,this[S("0x23c")],1,this[S("0x23e")]);return this[S("0x243")](t,i,n,a,l)},l[S("0xa4")][S("0x247")]=function(t){var e=this[S("0x23e")]*this[S("0x23c")],i=r(this[S("0x238")],this[S("0x239")],this[S("0x23a")],10,e,this[S("0x245")],this[S("0x242")]),n=r(this[S("0x238")],this[S("0x239")],this[S("0x23a")],10,e,this[S("0x245")],this[S("0x242")]),a=o(10,e),l=s(10,this[S("0x23c")],1,this[S("0x23e")]);return this[S("0x243")](t,i,n,a,l)},l[S("0xa4")][S("0x243")]=function(t,i,n,a,r){var o=this,s=e[S("0x248")][S("0x249")](!0,!1,void 0),l=e[S("0xfb")][S("0xfc")](s),c=new(e[S("0x136")])({sources:[S("0x24a")]}),h=new(e[S("0x136")])({sources:[S("0x24b")]}),x={xbsjColor:function(){return o[S("0x236")]}},d={xbsjColor:function(){return o[S("0x86")]}},u=e[S("0xf8")][S("0xfc")]({context:t,vertexShaderSource:c,fragmentShaderSource:h,attributeLocations:{position:0,normal:1}}),p=e[S("0x135")][S("0x190")]({context:t,typedArray:i,usage:e[S("0xf4")][S("0xf5")]}),g=e[S("0x135")][S("0x190")]({context:t,typedArray:n,usage:e[S("0xf4")][S("0xf5")]}),m=e[S("0x135")][S("0x24c")]({context:t,typedArray:a,usage:e[S("0xf4")][S("0xf5")],indexDatatype:e[S("0x1a1")][S("0x24d")]}),f=e[S("0x135")][S("0x24c")]({context:t,typedArray:r,usage:e[S("0xf4")][S("0xf5")],indexDatatype:e[S("0x1a1")][S("0x24d")]}),v=new(e[S("0xf2")])({context:t,attributes:[{index:0,vertexBuffer:p,componentsPerAttribute:3,componentDatatype:e[S("0x7")][S("0x8")]},{index:1,vertexBuffer:g,componentsPerAttribute:3,componentDatatype:e[S("0x7")][S("0x8")]}],indexBuffer:m}),y=new(e[S("0xf2")])({context:t,attributes:[{index:0,vertexBuffer:p,componentsPerAttribute:3,componentDatatype:e[S("0x7")][S("0x8")]},{index:1,vertexBuffer:g,componentsPerAttribute:3,componentDatatype:e[S("0x7")][S("0x8")]}],indexBuffer:f}),b=e[S("0x4e")][S("0x4f")](i);return{command:new(e[S("0xee")])({vertexArray:v,primitiveType:e[S("0x51")][S("0x52")],renderState:l,shaderProgram:u,uniformMap:x,owner:this,pass:e[S("0xef")][S("0x129")],modelMatrix:new(e[S("0x11")]),boundingVolume:new(e[S("0x4e")]),cull:!0}),lineCommand:new(e[S("0xee")])({vertexArray:y,primitiveType:e[S("0x51")][S("0x59")],renderState:l,shaderProgram:u,uniformMap:d,owner:this,pass:e[S("0xef")][S("0x129")],modelMatrix:new(e[S("0x11")]),boundingVolume:new(e[S("0x4e")]),cull:!0}),initBoundingSphere:b}},l[S("0xa4")][S("0xdb")]=function(t){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")]=e[S("0x57")](e[S("0x11")][S("0x8c")]),this[S("0x24e")]()),e[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")](t[S("0xea")])),this[S("0x24f")][S("0x4c")](this[S("0x246")](t[S("0xea")])),this[S("0x24f")][S("0x4c")](this[S("0x247")](t[S("0xea")])),this[S("0x24f")][S("0x4c")](this[S("0x244")](t[S("0xea")]))),e[S("0x11")][S("0xba")](this[S("0x140")],this[S("0x8b")])||(e[S("0x11")][S("0x57")](this[S("0x140")],this[S("0x8b")]),this[S("0x24f")][S("0xae")]((function(t){t[S("0x250")][S("0x140")]=e[S("0x11")][S("0x8c")],t[S("0x250")][S("0x140")]=i[S("0x8b")],t[S("0x250")][S("0x251")]=e[S("0x4e")][S("0x180")](t[S("0x252")],i[S("0x8b")],i[S("0x166")]),t[S("0x253")][S("0x140")]=e[S("0x11")][S("0x8c")],t[S("0x253")][S("0x140")]=i[S("0x8b")],t[S("0x253")][S("0x251")]=e[S("0x4e")][S("0x180")](t[S("0x252")],i[S("0x8b")],i[S("0x166")])}))),this[S("0x24f")][S("0xae")]((function(e){e[S("0x250")]&&t[S("0xe1")][S("0x4c")](e[S("0x250")]),e[S("0x253")]&&t[S("0xe1")][S("0x4c")](e[S("0x253")])})))},l[S("0xa4")][S("0x1f7")]=function(){return!1},l[S("0xa4")][S("0x24e")]=function(){this[S("0x24f")]&&this[S("0x24f")][S("0xae")]((function(t){e[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),e[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)},l[S("0xa4")][S("0xb0")]=function(){return this[S("0x24e")](),e[S("0x133")](this)},Object[S("0xa3")](l[S("0xa4")],{startRadius:{get:function(){return this[S("0x254")]},set:function(t){this[S("0x254")]=t,this[S("0x22b")]=[{fov:e[S("0x5d")][S("0x5e")](0),radius:t},{fov:e[S("0x5d")][S("0x5e")](10),radius:.9*t},{fov:e[S("0x5d")][S("0x5e")](20),radius:.8*t},{fov:e[S("0x5d")][S("0x5e")](30),radius:.7*t},{fov:e[S("0x5d")][S("0x5e")](40),radius:.6*t},{fov:e[S("0x5d")][S("0x5e")](50),radius:.5*t},{fov:e[S("0x5d")][S("0x5e")](60),radius:.4*t},{fov:e[S("0x5d")][S("0x5e")](70),radius:.3*t},{fov:e[S("0x5d")][S("0x5e")](80),radius:.1*t},{fov:e[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:e[S("0x5d")][S("0x5e")](0),radius:t},{fov:e[S("0x5d")][S("0x5e")](10),radius:.9*t},{fov:e[S("0x5d")][S("0x5e")](20),radius:.8*t},{fov:e[S("0x5d")][S("0x5e")](30),radius:.7*t},{fov:e[S("0x5d")][S("0x5e")](40),radius:.6*t},{fov:e[S("0x5d")][S("0x5e")](50),radius:.5*t},{fov:e[S("0x5d")][S("0x5e")](60),radius:.4*t},{fov:e[S("0x5d")][S("0x5e")](70),radius:.3*t},{fov:e[S("0x5d")][S("0x5e")](80),radius:.1*t},{fov:e[S("0x5d")][S("0x5e")](90),radius:.01*t}]}}}),e.Scene[S("0x255")]=l}(),function(){var t,i;e[S("0x12b")]||(t=typeof self!==S("0x68")?self:this,i=function(){return function(t){var e={};function i(n){if(e[n])return e[n][S("0x12d")];var a=e[n]={i:n,l:!1,exports:{}};return t[n][S("0x130")](a[S("0x12d")],a,a[S("0x12d")],i),a.l=!0,a[S("0x12d")]}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object[S("0x1d")](t,e,{configurable:!1,enumerable:!0,get:n})},i.n=function(t){var e=t&&t[S("0x1e")]?function(){return t[S("0x131")]}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object[S("0xa4")][S("0xa0")][S("0x130")](t,e)},i.p="",i(i.s=4)}([function(t,i,n){Object[S("0x1d")](i,S("0x1e"),{value:!0}),i[S("0x12b")]=void 0;var a=l(n(6)),r=l(n(7)),o=l(n(8)),s=l(n(9));function l(t){return t&&t[S("0x1e")]?t:{default:t}}var c=e[S("0x4e")],h=e[S("0x9")],x=e[S("0x83")],d=e[S("0x132")],u=e[S("0x7")],p=e[S("0x79")],g=e[S("0x2d")],m=(Object[S("0xa3")],e[S("0x133")],e[S("0x134")]),f=e[S("0x11")],v=e[S("0x51")],y=e[S("0x135")],b=e[S("0xf4")],C=e[S("0xee")],w=e[S("0xef")],I=e[S("0xfb")],A=e[S("0xf8")],_=e[S("0x136")],G=e[S("0xf2")],W=e[S("0xfd")],P=e[S("0x101")],Z=e[S("0x137")],M=e[S("0x35")],V=e[S("0x138")],X=e[S("0x5d")],R=e[S("0x22")],F=(f=e[S("0x11")],e[S("0x139")]),B=(e[S("0x13a")],e[S("0x13b")],Math[S("0x65")]),T=Math[S("0x66")],D=Math[S("0x5f")],N=Math[S("0x13c")],k=(Math[S("0x13d")],{position:0,normal:1});function Y(t){var e=this;t=p(t,p[S("0x13e")]),this[S("0x7a")]=p(t[S("0x7a")],!0),this[S("0x13f")]=p(t[S("0x13f")],32),this[S("0x140")]=f[S("0x57")](t[S("0x140")],new f),this[S("0x8b")]=new f,this[S("0x141")]=new f,this[S("0x142")]=new f,this[S("0xed")]=p(t[S("0xed")],Number[S("0x143")]),this[S("0x115")]=void 0,this[S("0x144")]=p(t[S("0x144")],0),this[S("0x145")]=void 0,this[S("0x146")]=p(t[S("0x146")],0),this[S("0x147")]=void 0,this[S("0x86")]=p(t[S("0x86")],x[S("0x148")]),this[S("0x149")]=p(t[S("0x149")],!0),this[S("0x14a")]=p(t[S("0x14a")],!0),this[S("0x14b")]=p(t[S("0x14b")],!0),this[S("0x14c")]=g(t[S("0x14c")])?t[S("0x14c")]:Z[S("0x14d")](Z[S("0x14e")]),this[S("0x14f")]=void 0,this[S("0x150")]=void 0,this[S("0x151")]=g(t[S("0x151")])?t[S("0x151")]:Z[S("0x14d")](Z[S("0x14e")]),this[S("0x152")]=void 0,this[S("0x153")]=void 0,this[S("0x154")]=p(t[S("0x154")],!0),this[S("0x155")]=g(t[S("0x155")])?t[S("0x155")]:Z[S("0x14d")](Z[S("0x14e")]),this[S("0x156")]=void 0,this[S("0x157")]=p(t[S("0x157")],!0),this[S("0x158")]=p(t[S("0x158")],!0),this[S("0x159")]=p(t[S("0x159")],x[S("0x148")]),this[S("0x15a")]=p(t[S("0x15a")],5),this[S("0x15b")]=p(t[S("0x15b")],!1),this[S("0x15c")]=void 0,this[S("0x15d")]=p(t[S("0x15d")],!0),this[S("0x15e")]=p(t[S("0x15e")],x[S("0x148")]),this[S("0x15f")]=p(t[S("0x15f")],S("0x160")),this[S("0x161")]=p(t[S("0x161")],10),this[S("0x162")]=0,this[S("0x163")]=0,this[S("0x164")]=F[S("0x165")](),this[S("0x166")]=new c,this[S("0x167")]=new c,this[S("0x168")]=new C({owner:this,primitiveType:v[S("0x52")],boundingVolume:this[S("0x167")]}),this[S("0x169")]=new C({owner:this,primitiveType:v[S("0x52")],boundingVolume:this[S("0x167")]}),this[S("0x16a")]=void 0,this[S("0x16b")]=new C({owner:this,primitiveType:v[S("0x59")],boundingVolume:this[S("0x167")]}),this[S("0x16c")]=void 0,this[S("0x16d")]=new C({owner:this,primitiveType:v[S("0x59")],boundingVolume:this[S("0x167")]}),this[S("0x16e")]=void 0,this[S("0x16f")]=new C({owner:this,primitiveType:v[S("0x52")],boundingVolume:this[S("0x167")]}),this[S("0x170")]=new C({owner:this,primitiveType:v[S("0x52")],boundingVolume:this[S("0x167")]}),this[S("0x171")]=void 0,this[S("0x172")]=new C({owner:this,primitiveType:v[S("0x59")],boundingVolume:this[S("0x167")]}),this[S("0x173")]=void 0,this[S("0x174")]=new C({owner:this,primitiveType:v[S("0x52")],boundingVolume:this[S("0x167")]}),this[S("0x175")]=new C({owner:this,primitiveType:v[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")]}}}Y[S("0xa4")][S("0xdb")]=function(t){var i=t[S("0x34")];if(this[S("0x7a")]&&i===M[S("0x36")]){var n=!1,l=!1,x=!1,d=this[S("0x144")],p=this[S("0x146")];if(d<0||p<0)throw new m(S("0x17d"));if(0!=d&&0!=p){this[S("0x145")]===d&&this[S("0x147")]===p||(this[S("0x145")]=d,this[S("0x147")]=p,n=!0);var g=this[S("0xed")];if(g<0)throw new m(S("0x17e"));var v=!1;this[S("0x115")]!==g&&(v=!0,this[S("0x115")]=g,this[S("0x166")]=new c(h[S("0x56")],this[S("0xed")])),(!f[S("0xba")](this[S("0x140")],this[S("0x8b")])||v)&&(f[S("0x57")](this[S("0x140")],this[S("0x8b")]),f[S("0x17f")](this[S("0x140")],this[S("0xed")],this[S("0x141")]),c[S("0x180")](this[S("0x166")],this[S("0x140")],this[S("0x167")]));var C=this[S("0x15b")];this[S("0x15c")]!==this[S("0x15b")]&&(this[S("0x15c")]=C,l=!0);var Z=this[S("0x14c")];this[S("0x14f")]!==Z&&(this[S("0x14f")]=Z,l=!0,x=!0);var B,Y,Q,J,O,j,K,q,$,tt,et=Z[S("0x181")]();if(this[S("0x150")]!==et&&(this[S("0x150")]=et,l=!0),this[S("0x15d")]){var it=t[S("0xdc")],nt=F[S("0x182")](it,this[S("0x164")]);nt<0&&(this[S("0x164")]=F[S("0x57")](it,this[S("0x164")]));var at,rt=Math[S("0x183")](nt%this[S("0x161")]/this[S("0x161")],0);if(this[S("0x15f")]==S("0x160")){var ot=T(at=2*p*rt-p),st=D(d),lt=N(ot*st);this[S("0x162")]=lt,this[S("0x163")]=at,e[S("0x22")][S("0x184")](this[S("0x163")],z)}else{at=2*d*rt-d;var ct=D(p),ht=T(at),xt=N(ht*ct);this[S("0x162")]=at,this[S("0x163")]=xt,e[S("0x22")][S("0x185")](this[S("0x162")],z)}e[S("0x11")][S("0x186")](this[S("0x140")],z,this[S("0x142")]),f[S("0x17f")](this[S("0x142")],this[S("0xed")],this[S("0x142")])}n&&function(t,i){var n,a,r,o,s,l,c,x,d,p,g,m,f=i[S("0xea")],v=L(t,t[S("0x144")],t[S("0x146")]),C=(a=v,r=(n=t)[S("0x144")],o=n[S("0x146")],s=a[S("0x189")],l=a[S("0x18a")],c=[],x=R[S("0x185")](r,z),c[S("0x4c")](s[S("0x18b")]((function(t){return R[S("0x18c")](x,t,new(e[S("0x9")]))}))),x=R[S("0x184")](-o,z),c[S("0x4c")](l[S("0x18b")]((function(t){return R[S("0x18c")](x,t,new(e[S("0x9")]))}))[S("0x18d")]()),x=R[S("0x185")](-r,z),c[S("0x4c")](s[S("0x18b")]((function(t){return R[S("0x18c")](x,t,new(e[S("0x9")]))}))[S("0x18d")]()),x=R[S("0x184")](o,z),c[S("0x4c")](l[S("0x18b")]((function(t){return R[S("0x18c")](x,t,new(e[S("0x9")]))}))),c);if(t[S("0x14b")]&&(t[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++){var s=e[r],l=h[S("0x15")](h[S("0xc")](s[0],s[s[S("0x2")]-1],E),E),c=0;for(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 x=y[S("0x190")]({context:t,typedArray:n,usage:b[S("0xf5")]}),d=6*Float32Array[S("0x191")],p=[{index:k[S("0x3")],vertexBuffer:x,componentsPerAttribute:3,componentDatatype:u[S("0x8")],offsetInBytes:0,strideInBytes:d},{index:k[S("0x5")],vertexBuffer:x,componentsPerAttribute:3,componentDatatype:u[S("0x8")],offsetInBytes:3*Float32Array[S("0x191")],strideInBytes:d}];return new G({context:t,attributes:p})}(f,C)),t[S("0x149")]&&(t[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 l=y[S("0x190")]({context:t,typedArray:n,usage:b[S("0xf5")]}),c=3*Float32Array[S("0x191")],h=[{index:k[S("0x3")],vertexBuffer:l,componentsPerAttribute:3,componentDatatype:u[S("0x8")],offsetInBytes:0,strideInBytes:c}];return new G({context:t,attributes:h})}(f,C)),t[S("0x14a")]&&(t[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++){var s=e[r],l=0;for(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=y[S("0x190")]({context:t,typedArray:n,usage:b[S("0xf5")]}),h=3*Float32Array[S("0x191")],x=[{index:k[S("0x3")],vertexBuffer:c,componentsPerAttribute:3,componentDatatype:u[S("0x8")],offsetInBytes:0,strideInBytes:h}];return new G({context:t,attributes:x})}(f,C)),t[S("0x154")]&&(t[S("0x171")]=(d=f,p=e[S("0x13b")][S("0x55")](new(e[S("0x13b")])({vertexFormat:V[S("0x192")],stackPartitions:32,slicePartitions:32})),G[S("0xf3")]({context:d,geometry:p,attributeLocations:k,bufferUsage:b[S("0xf5")],interleave:!1}))),t[S("0x157")]&&(t[S("0x173")]=(g=f,m=e[S("0x193")][S("0x55")](new(e[S("0x193")])({vertexFormat:V[S("0x192")],stackPartitions:32,slicePartitions:32})),G[S("0xf3")]({context:g,geometry:m,attributeLocations:k,bufferUsage:b[S("0xf5")],interleave:!1}))),t[S("0x15d")])if(t[S("0x15f")]==S("0x160")){var w=L(t,X[S("0x194")],0);t[S("0x195")]=U(f,w[S("0x18a")])}else w=L(t,0,X[S("0x194")]),t[S("0x195")]=U(f,w[S("0x189")])}(this,t),l&&(B=this,Y=C,et?(B[S("0x178")]=I[S("0xfc")]({depthTest:{enabled:!Y},depthMask:!1,blending:W[S("0xfe")],cull:{enabled:!0,face:P[S("0x102")]}}),B[S("0x179")]=I[S("0xfc")]({depthTest:{enabled:!Y},depthMask:!1,blending:W[S("0xfe")],cull:{enabled:!0,face:P[S("0x19a")]}}),B[S("0x19b")]=I[S("0xfc")]({depthTest:{enabled:!Y},depthMask:!1,blending:W[S("0xfe")]})):(B[S("0x178")]=I[S("0xfc")]({depthTest:{enabled:!Y},depthMask:!0}),B[S("0x19b")]=I[S("0xfc")]({depthTest:{enabled:!0},depthMask:!0}))),x&&(function(t,e,i){var n=e[S("0xea")],s=a[S("0x131")],l=new _({sources:[o[S("0x131")],i[S("0x196")],r[S("0x131")]]});t[S("0x17a")]=A[S("0xf9")]({context:n,shaderProgram:t[S("0x17a")],vertexShaderSource:s,fragmentShaderSource:l,attributeLocations:k});var c=new _({sources:[o[S("0x131")],i[S("0x196")],r[S("0x131")]],pickColorQualifier:S("0x197")});t[S("0x198")]=A[S("0xf9")]({context:n,shaderProgram:t[S("0x198")],vertexShaderSource:s,fragmentShaderSource:c,attributeLocations:k})}(Q=this,J=t,O=Z),Q[S("0x15d")]&&(j=Q,K=O,q=J[S("0xea")],$=a[S("0x131")],tt=new _({sources:[o[S("0x131")],K[S("0x196")],s[S("0x131")]]}),j[S("0x199")]=A[S("0xf9")]({context:q,shaderProgram:j[S("0x199")],vertexShaderSource:$,fragmentShaderSource:tt,attributeLocations:k}))),(l||x)&&function(t,e){t[S("0x177")][S("0x2")]=0;var i=e?w[S("0x129")]:w[S("0xf0")];t[S("0x14b")]&&H(t,t[S("0x168")],t[S("0x169")],t[S("0x178")],t[S("0x179")],t[S("0x17a")],t[S("0x16a")],t[S("0x17b")],t[S("0x141")],e,i),t[S("0x149")]&&H(t,t[S("0x16b")],void 0,t[S("0x178")],t[S("0x179")],t[S("0x17a")],t[S("0x16c")],t[S("0x17b")],t[S("0x141")],e,i,!0),t[S("0x14a")]&&H(t,t[S("0x16d")],void 0,t[S("0x178")],t[S("0x179")],t[S("0x17a")],t[S("0x16e")],t[S("0x17b")],t[S("0x141")],e,i,!0),t[S("0x154")]&&H(t,t[S("0x16f")],t[S("0x170")],t[S("0x178")],t[S("0x179")],t[S("0x17a")],t[S("0x171")],t[S("0x17b")],t[S("0x141")],e,i),t[S("0x157")]&&H(t,t[S("0x172")],void 0,t[S("0x178")],t[S("0x179")],t[S("0x17a")],t[S("0x173")],t[S("0x17b")],t[S("0x141")],e,i,!0),t[S("0x15d")]&&H(t,t[S("0x174")],t[S("0x175")],t[S("0x178")],t[S("0x179")],t[S("0x199")],t[S("0x195")],t[S("0x17c")],t[S("0x142")],e,i)}(this,et);var dt=t[S("0xe1")],ut=t[S("0x187")],pt=this[S("0x177")];if(ut[S("0x188")])for(var gt=0,mt=pt[S("0x2")];gt<mt;gt++){var ft=pt[gt];dt[S("0x4c")](ft)}}}};var z=new R,E=new h;function L(t,e,i){for(var n=t[S("0x13f")],a=T(i),r=D(i),o=T(e),s=D(e),l=N(o*r),c=N(a*s),x=[],d=0;d<n;d++){var u=2*l*d/(n-1)-l;x[S("0x4c")](new h(0,B(u),T(u)))}var p=[];for(d=0;d<n;d++)u=2*c*d/(n-1)-c,p[S("0x4c")](new h(B(u),0,T(u)));return{zoy:x,zox:p}}function U(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=y[S("0x190")]({context:t,typedArray:n,usage:b[S("0xf5")]}),s=3*Float32Array[S("0x191")],l=[{index:k[S("0x3")],vertexBuffer:o,componentsPerAttribute:3,componentDatatype:u[S("0x8")],offsetInBytes:0,strideInBytes:s}];return new G({context:t,attributes:l})}function H(t,e,i,n,a,r,o,s,l,c,h,x){c&&i&&(i[S("0xaf")]=o,i[S("0xfa")]=a,i[S("0xf7")]=r,i[S("0x103")]=d(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")]=d(s,t[S("0x14f")][S("0x17b")]),x&&(e[S("0x103")][S("0x19e")]=function(){return 1}),e[S("0x19d")]=h,e[S("0x140")]=l,t[S("0x177")][S("0x4c")](e)}i[S("0x12b")]=Y},function(t,i,n){Object[S("0x1d")](i,S("0x1e"),{value:!0});var a=e[S("0x4e")],r=e[S("0x9")],o=e[S("0x19f")],s=e[S("0x7")],l=e[S("0x79")],c=(e[S("0x2d")],e[S("0x50")]),h=e[S("0x6")],x=e[S("0x1a0")],d=e[S("0x51")],u=e[S("0x138")],p=e[S("0x5d")],g=e[S("0x53")],m=e[S("0x1a1")],f=(e[S("0xf")],Math[S("0x66")]),v=Math[S("0x65")];function y(t){var e=(t=l(t,l[S("0x13e")]))[S("0x114")],i=t[S("0xed")],n=Math[S("0x1a2")](l(t[S("0x1a3")],12)),a=Math[S("0x1a2")](l(t[S("0x1a4")],64));o[S("0x1a5")][S("0x1a6")](S("0x114"),e),o[S("0x1a5")][S("0x1a6")](S("0xed"),i);var r=l(t[S("0x1a7")],u[S("0x1a8")]);this[S("0x113")]=e,this[S("0x115")]=i,this[S("0x1a9")]=n,this[S("0x1aa")]=a,this[S("0x1ab")]=r}y[S("0x1ac")]=function(t){var e=(t=l(t,l[S("0x13e")]))[S("0x114")],i=t[S("0xed")],n=t[S("0x1a3")],a=t[S("0x1a4")];return o[S("0x1a5")][S("0x1a6")](S("0x114"),e),o[S("0x1a5")][S("0x1a6")](S("0xed"),i),o[S("0x1a5")][S("0x1a6")][S("0x1ad")](S("0x114"),e,0),o[S("0x1a5")][S("0x1a6")][S("0x1ad")](S("0x33"),height,0),new y({angle:e,radius:i,stackPartitions:n,slicePartitions:a,vertexFormat:t[S("0x1a7")]})},y[S("0x55")]=function(t){console[S("0xdc")](S("0x55"));var e,i=t[S("0x113")],n=t[S("0x115")],o=t[S("0x1a9")]+1,l=t[S("0x1aa")]+1,u=t[S("0x1ab")],y=new x,b=3*(l-1)+6*(l-1)*(o-2)+1*(l-1)*3,C=o*l,w=m[S("0x1ae")](C,b),I=new Float64Array(3*C+3*(l-1)*3);if(u[S("0x3")]){for(var A=0,_=new Array(l),G=new Array(l),W=0;W<l;W++){var P=p[S("0x1af")]*W/(l-1);_[W]=f(P),G[W]=v(P),I[A++]=0,I[A++]=0,I[A++]=-n}for(W=1;W<o;W++)for(var Z=i*W/(o-1),M=v(Z),V=n*M,X=n*M,R=n*f(Z),F=0;F<l;F++)I[A++]=_[F]*V,I[A++]=G[F]*X,I[A++]=-R;for(e=A,W=0;W<l-1;W++)I[A++]=0,I[A++]=0,I[A++]=0,I[A++]=I[e-3*(l-W-1)],I[A++]=I[e-3*(l-W-1)+1],I[A++]=I[e-3*(l-W-1)+2],I[A++]=I[e-3*(l-W)],I[A++]=I[e-3*(l-W)+1],I[A++]=I[e-3*(l-W)+2];y[S("0x3")]=new h({componentDatatype:s[S("0x4d")],componentsPerAttribute:3,values:I})}var B,T,D=0;for(F=0;F<l-1;F++)w[D++]=l+F,w[D++]=l+F+1,w[D++]=F+1;for(W=1;W<o-1;W++)for(B=W*l,T=(W+1)*l,F=0;F<l-1;F++)w[D++]=T+F,w[D++]=T+F+1,w[D++]=B+F+1,w[D++]=T+F,w[D++]=B+F+1,w[D++]=B+F;W=0;for(var N=3*(l-1);W<N;W++)w[D++]=W+e/3;var k=new c({attributes:y,indices:w,primitiveType:d[S("0x52")],boundingSphere:new a(r[S("0x56")],n)});return k=g[S("0x54")](k),console[S("0x1b0")](S("0x55")),k},i[S("0x1b1")]=y},function(t,i,n){Object[S("0x1d")](i,S("0x1e"),{value:!0});var a=e[S("0x4e")],r=e[S("0x9")],o=e[S("0x7")],s=e[S("0x79")],l=(e[S("0x2d")],e[S("0x134")]),c=(e[S("0xf")],e[S("0x50")]),h=e[S("0x6")],x=e[S("0x1a0")],d=e[S("0x1a1")],u=e[S("0x5d")],p=e[S("0x51")],g=(new r(1,1,1),Math[S("0x66")]),m=Math[S("0x65")];function f(t){var e=(t=s(t,s[S("0x13e")]))[S("0x114")],i=t[S("0xed")],n=Math[S("0x1a2")](s(t[S("0x1a3")],10)),a=Math[S("0x1a2")](s(t[S("0x1a4")],8)),r=Math[S("0x1a2")](s(t[S("0x1b2")],128));if(n<1)throw new l(S("0x1b3"));if(a<0)throw new l(S("0x1b4"));if(r<0)throw new l(S("0x1b5"));this[S("0x113")]=e,this[S("0x115")]=i,this[S("0x1a9")]=n,this[S("0x1aa")]=a,this[S("0x1b6")]=r}f[S("0x55")]=function(t){var e=t[S("0x113")],i=t[S("0x115")];if(!(i<=0||e<=0)){var n,s,l,f,v,y,b=t[S("0x1a9")],C=t[S("0x1aa")],w=t[S("0x1b6")],I=w*(b+C-1),A=I-C+2,_=new Float64Array(3*A),G=d[S("0x1ae")](A,2*I),W=0,P=new Array(w),Z=new Array(w);for(n=0;n<w;n++)l=u[S("0x1af")]*n/w,P[n]=g(l),Z[n]=m(l);for(n=1;n<b;n++)for(v=g(f=e*n/(b-1)),y=m(f),s=0;s<w;s++)_[W++]=i*P[s]*y,_[W++]=i*Z[s]*y,_[W++]=-i*v;for(P[S("0x2")]=C,Z[S("0x2")]=C,n=0;n<C;n++)l=u[S("0x1af")]*n/C,P[n]=g(l),Z[n]=m(l);for(_[W++]=0,_[W++]=0,_[W++]=-i,n=1;n<w;n++)for(v=g(f=e*n/w),y=m(f),s=0;s<C;s++)_[W++]=i*P[s]*y,_[W++]=i*Z[s]*y,_[W++]=-i*v;for(W=0,n=0;n<b-1;++n){var M=n*w;for(s=0;s<w-1;++s)G[W++]=M+s,G[W++]=M+s+1;G[W++]=M+w-1,G[W++]=M}var V=w*(b-1);for(s=1;s<C+1;++s)G[W++]=V,G[W++]=V+s;for(n=0;n<w-2;++n){var X=n*C+1+V,R=(n+1)*C+1+V;for(s=0;s<C-1;++s)G[W++]=R+s,G[W++]=X+s;G[W++]=R+C-1,G[W++]=X+C-1}var F=new x({position:new h({componentDatatype:o[S("0x4d")],componentsPerAttribute:3,values:_})});return new c({attributes:F,indices:G,primitiveType:p[S("0x59")],boundingSphere:new a(r[S("0x56")],i)})}},i[S("0x1b7")]=f},function(t,i,n){Object[S("0x1d")](i,S("0x1e"),{value:!0});var a=e[S("0x79")],r=e[S("0x2d")],o=Object[S("0xa3")],s=e[S("0x134")],l=e[S("0x1b8")],c=e[S("0x1b9")],h=e[S("0x1ba")];function x(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 l,this[S("0x1d1")]=void 0,this[S("0x1d2")]=void 0,this[S("0x1d3")](a(t,a[S("0x13e")]))}o(x[S("0xa4")],{definitionChanged:{get:function(){return this[S("0x1d0")]}},show:h(S("0x7a")),angle:h(S("0x114")),radius:h(S("0xed")),stack:h(S("0x1d4")),slice:h(S("0x13f")),color:h(S("0x82")),material:c(S("0x14c")),fill:h(S("0x1d5")),outline:h(S("0x7c")),outlineColor:h(S("0x1d6")),outlineWidth:h(S("0x1d7")),shadows:h(S("0x1d8")),distanceDisplayCondition:h(S("0x1d9"))}),x[S("0xa4")][S("0x57")]=function(t){return r(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 x(this)},x[S("0xa4")][S("0x1d3")]=function(t){if(!r(t))throw new s(S("0x1db"));this[S("0x114")]=a(this[S("0x114")],t[S("0x114")]),this[S("0xed")]=a(this[S("0xed")],t[S("0xed")]),this[S("0x1d4")]=a(this[S("0x1d4")],t[S("0x1d4")]),this[S("0x13f")]=a(this[S("0x13f")],t[S("0x13f")]),this[S("0x7a")]=a(this[S("0x7a")],t[S("0x7a")]),this[S("0x82")]=a(this[S("0x82")],t[S("0x82")]),this[S("0x14c")]=a(this[S("0x14c")],t[S("0x14c")]),this[S("0x1d5")]=a(this[S("0x1d5")],t[S("0x1d5")]),this[S("0x7c")]=a(this[S("0x7c")],t[S("0x7c")]),this[S("0x1d6")]=a(this[S("0x1d6")],t[S("0x1d6")]),this[S("0x1d7")]=a(this[S("0x1d7")],t[S("0x1d7")]),this[S("0x1d8")]=a(this[S("0x1d8")],t[S("0x1d8")]),this[S("0x1d9")]=a(this[S("0x1d9")],t[S("0x1d9")]),this[S("0x1da")]=a(this[S("0x1da")],t[S("0x1da")])},i[S("0x1dc")]=x},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,i,n){var a=n(0),r=n(10),o=n(11),s=n(1),l=n(2),c=n(3),h=n(12);e.Scene[S("0x12b")]=a[S("0x12b")],e.Scene[S("0x1de")]=r[S("0x1de")],e.Scene[S("0x1df")]=o[S("0x1df")],e.Scene[S("0x1b1")]=s[S("0x1b1")],e.Scene[S("0x1b7")]=l[S("0x1b7")],e.Scene[S("0x1dc")]=c[S("0x1dc")],e.Scene[S("0x1e0")]=h[S("0x1e0")];var x=e[S("0x1e1")],d=x[S("0x1e2")];x[S("0x1e2")]=function(t,e,i){var n=i[S("0xab")];return d(t,e,i)[S("0x18e")]([new(o[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,i,n){Object[S("0x1d")](i,S("0x1e"),{value:!0});var a=e[S("0x79")],r=e[S("0x2d")],o=Object[S("0xa3")],s=e[S("0x134")],l=e[S("0x1b8")],c=e[S("0x1b9")],h=e[S("0x1ba")];function x(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 l,this[S("0x1d3")](a(t,a[S("0x13e")]))}o(x[S("0xa4")],{definitionChanged:{get:function(){return this[S("0x1d0")]}},show:h(S("0x7a")),radius:h(S("0xed")),xHalfAngle:h(S("0x144")),yHalfAngle:h(S("0x146")),lineColor:h(S("0x86")),showSectorLines:h(S("0x149")),showSectorSegmentLines:h(S("0x14a")),showLateralSurfaces:h(S("0x14b")),material:c(S("0x14c")),showDomeSurfaces:h(S("0x154")),showDomeLines:h(S("0x1f4")),showIntersection:h(S("0x158")),intersectionColor:h(S("0x159")),intersectionWidth:h(S("0x15a")),showThroughEllipsoid:h(S("0x15b")),gaze:h(S("0x1da")),showScanPlane:h(S("0x15d")),scanPlaneColor:h(S("0x15e")),scanPlaneMode:h(S("0x15f")),scanPlaneRate:h(S("0x161"))}),x[S("0xa4")][S("0x57")]=function(t){return r(t)||(t=new x),t[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},x[S("0xa4")][S("0x1d3")]=function(t){if(!r(t))throw new s(S("0x1db"));this[S("0x7a")]=a(this[S("0x7a")],t[S("0x7a")]),this[S("0xed")]=a(this[S("0xed")],t[S("0xed")]),this[S("0x144")]=a(this[S("0x144")],t[S("0x144")]),this[S("0x146")]=a(this[S("0x146")],t[S("0x146")]),this[S("0x86")]=a(this[S("0x86")],t[S("0x86")]),this[S("0x149")]=a(this[S("0x149")],t[S("0x149")]),this[S("0x14a")]=a(this[S("0x14a")],t[S("0x14a")]),this[S("0x14b")]=a(this[S("0x14b")],t[S("0x14b")]),this[S("0x14c")]=a(this[S("0x14c")],t[S("0x14c")]),this[S("0x154")]=a(this[S("0x154")],t[S("0x154")]),this[S("0x157")]=a(this[S("0x157")],t[S("0x157")]),this[S("0x158")]=a(this[S("0x158")],t[S("0x158")]),this[S("0x159")]=a(this[S("0x159")],t[S("0x159")]),this[S("0x15a")]=a(this[S("0x15a")],t[S("0x15a")]),this[S("0x15b")]=a(this[S("0x15b")],t[S("0x15b")]),this[S("0x1da")]=a(this[S("0x1da")],t[S("0x1da")]),this[S("0x15d")]=a(this[S("0x15d")],t[S("0x15d")]),this[S("0x15e")]=a(this[S("0x15e")],t[S("0x15e")]),this[S("0x15f")]=a(this[S("0x15f")],t[S("0x15f")]),this[S("0x161")]=a(this[S("0x161")],t[S("0x161")])},i[S("0x1de")]=x},function(t,i,n){Object[S("0x1d")](i,S("0x1e"),{value:!0}),i[S("0x1df")]=void 0;var a=n(0),r=e[S("0x1f5")],o=e[S("0x9")],s=e[S("0x83")],l=e[S("0x2d")],c=e[S("0x133")],h=e[S("0x134")],x=e[S("0x22")],d=e[S("0x11")],u=e[S("0x29")],p=e[S("0x1f6")],g=e[S("0xc2")],m=new x,f=(new d,new o),v=new o,y=new u,b=new o,C=new u;function w(t,e,i){var n=e[t.id];if(l(n)){var a=n[S("0x2f")];i[S("0xd2")](a),a[S("0x1f7")]()||a[S("0xb0")](),delete e[t.id]}}var I=function t(e,i){if(!l(e))throw new h(S("0x1f8"));if(!l(i))throw new h(S("0x1f9"));i[S("0x1fa")][S("0x1fb")](t[S("0xa4")][S("0x1fc")],this),this[S("0x1fd")]=e,this[S("0x1fe")]=e[S("0x9d")],this[S("0x1ff")]=i,this[S("0x200")]={},this[S("0x201")]=new r,this[S("0x1fc")](i,i[S("0x4")],[],[])};I[S("0xa4")][S("0xdb")]=function(t){if(!l(t))throw new h(S("0x202"));for(var i=this[S("0x201")][S("0x4")],n=this[S("0x200")],r=this[S("0x1fe")],c=0,w=i[S("0x2")];c<w;c++){var I,A,_,G,W=i[c],P=W[S("0x203")],Z=n[W.id],M=W[S("0x204")]&&W[S("0x205")](t)&&g[S("0x206")](P[S("0x78")],t,!0);if(M&&(I=g[S("0xc3")](W[S("0x74")],t,f),D=g[S("0xc3")](W[S("0x207")],t,y),A=g[S("0xc3")](P[S("0x115")],t),_=g[S("0xc3")](P[S("0x145")],t),G=g[S("0xc3")](P[S("0x147")],t),M=l(I)&&l(_)&&l(G)),M){var V=l(Z)?Z[S("0x2f")]:void 0;l(V)||((V=new(a[S("0x12b")])).id=W,r[S("0x9e")](V),Z={primitive:V,position:void 0,orientation:void 0},n[W.id]=Z);var X=g[S("0xc3")](P[S("0x1d1")],t);if(l(X)){var R=g[S("0xc3")](X[S("0x74")],t,v);if(!l(I)||!l(R))continue;var F=o[S("0xb")](I,R,b),B=o[S("0x208")](e[S("0x9")][S("0x209")],F),T=o[S("0xc")](e[S("0x9")][S("0x209")],F,b),D=u[S("0x20a")](T,B-Math.PI,C);A=o[S("0x11d")](I,R),V[S("0x140")]=d[S("0x21")](x[S("0x23")](D,m),I,V[S("0x140")])}else o[S("0xba")](I,Z[S("0x3")])&&u[S("0xba")](D,Z[S("0xc1")])||(l(D)?(V[S("0x140")]=d[S("0x21")](x[S("0x23")](D,m),I,V[S("0x140")]),Z[S("0x3")]=o[S("0x57")](I,Z[S("0x3")]),Z[S("0xc1")]=u[S("0x57")](D,Z[S("0xc1")])):(V[S("0x140")]=e[S("0x24")][S("0x25")](I),Z[S("0x3")]=o[S("0x57")](I,Z[S("0x3")])));V[S("0x7a")]=!0,V[S("0x1da")]=X,V[S("0xed")]=A,V[S("0x144")]=_,V[S("0x146")]=G,V[S("0x86")]=g[S("0x206")](P[S("0x1e7")],t,s[S("0x148")]),V[S("0x149")]=g[S("0x206")](P[S("0x1e8")],t,!0),V[S("0x14a")]=g[S("0x206")](P[S("0x1e9")],t,!0),V[S("0x14b")]=g[S("0x206")](P[S("0x1ea")],t,!0),V[S("0x14c")]=p[S("0xbf")](t,P[S("0x14f")],V[S("0x14c")]),V[S("0x154")]=g[S("0x206")](P[S("0x1eb")],t,!0),V[S("0x157")]=g[S("0x206")](P[S("0x1ec")],t,!0),V[S("0x158")]=g[S("0x206")](P[S("0x1ed")],t,!0),V[S("0x159")]=g[S("0x206")](P[S("0x1ee")],t,s[S("0x148")]),V[S("0x15a")]=g[S("0x206")](P[S("0x1ef")],t,1),V[S("0x15b")]=g[S("0x206")](P[S("0x15c")],t,!0),V[S("0x15f")]=g[S("0x206")](P[S("0x1f2")],t),V[S("0x15e")]=g[S("0x206")](P[S("0x1f1")],t,s[S("0x148")]),V[S("0x15d")]=g[S("0x206")](P[S("0x1f0")],t,!0),V[S("0x161")]=g[S("0x206")](P[S("0x1f3")],t,1)}else l(Z)&&(Z[S("0x2f")][S("0x7a")]=!1)}return!0},I[S("0xa4")][S("0x1f7")]=function(){return!1},I[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;n>-1;n--)w(t[n],e,i);return c(this)},I[S("0xa4")][S("0x1fc")]=function(t,e,i,n){var a,r,o=this[S("0x201")],s=this[S("0x200")],c=this[S("0x1fe")];for(a=e[S("0x2")]-1;a>-1;a--)r=e[a],l(r[S("0x203")])&&l(r[S("0x74")])&&o[S("0x20b")](r.id,r);for(a=n[S("0x2")]-1;a>-1;a--)r=n[a],l(r[S("0x203")])&&l(r[S("0x74")])?o[S("0x20b")](r.id,r):(w(r,s,c),o[S("0xd2")](r.id));for(a=i[S("0x2")]-1;a>-1;a--)w(r=i[a],s,c),o[S("0xd2")](r.id)},i[S("0x1df")]=I},function(t,i,n){Object[S("0x1d")](i,S("0x1e"),{value:!0}),i[S("0x1e0")]=void 0;var a=n(1),r=n(2),o=n(13),s=(e[S("0x79")],e[S("0x2d")]),l=(e[S("0x20c")],e[S("0x24")]),c=e[S("0x134")],h=(e[S("0x20d")],e[S("0x83")]),x=e[S("0x20e")],d=e[S("0x20f")],u=e[S("0x9")],p=(e[S("0x138")],e[S("0x29")]),g=e[S("0x22")],m=e[S("0x11")],f=e[S("0xc2")];function v(t){var e=this;if(!s(t))throw new c(S("0x212"));this[S("0x213")]=t;var i=t[S("0x6a")];this[S("0x1fd")]=i;var n=t[S("0x214")];this[S("0x215")]=n,this[S("0x1fe")]=i[S("0x9d")],this[S("0x216")]=void 0,this[S("0x217")]=void 0,this[S("0x218")]=[],n[S("0x219")][S("0x1fb")]((function(){e[S("0xdb")]()}))}e[S("0x1b8")],e[S("0x210")],e[S("0x211")];var y=new g,b=new m,C=new u,w=new u,I=new u,A=new p;v[S("0xa4")][S("0x9e")]=function(t){return t instanceof o[S("0x21a")]||(t=new(o[S("0x21a")])(t)),this[S("0x218")][S("0x4c")](t),t},v[S("0xa4")][S("0xd2")]=function(t){var e=this[S("0x218")][S("0x21b")](t);-1!==e&&this[S("0x218")][S("0xdd")](e,1)},v[S("0xa4")][S("0x21c")]=function(){this[S("0x218")][S("0x2")]=0},v[S("0xa4")][S("0xdb")]=function(){var t=this[S("0x215")][S("0x21d")],i=this[S("0x218")],n=this[S("0x1fe")],o=this[S("0x216")],c=this[S("0x217")],v=[],_=[];s(o)&&n[S("0x21e")](o),s(c)&&n[S("0x21e")](c);for(var G=0,W=i[S("0x2")];G<W;G++){var P=i[G],Z=P[S("0x21f")];if(f[S("0x206")](Z[S("0x7a")],t,!0)){var M=Z[S("0x114")],V=Z[S("0xed")],X=Z[S("0x1d4")],R=Z[S("0x13f")];if(s(M)&&f[S("0x206")](P[S("0x7a")],t,!0)){var F=f[S("0xc3")](P[S("0x3")],t,C);if(s(F)){var B,T=Z[S("0x1da")];if(s(T)){var D=f[S("0xc3")](T[S("0x3")],t,w);if(!s(F)||!s(D))continue;var N=u[S("0xb")](F,D,I),k=u[S("0x208")](e[S("0x9")][S("0x209")],N),Y=u[S("0xc")](e[S("0x9")][S("0x209")],N,I),z=p[S("0x20a")](Y,k,A),E=u[S("0x11d")](F,D);V=1,B=m[S("0x21")](e[S("0x22")][S("0x220")](g[S("0x23")](z,y),E,y),F,b)}else z=f[S("0xc3")](P[S("0xc1")],t,A),B=s(z)?m[S("0x21")](g[S("0x23")](z,y),F,b):l[S("0x25")](F,void 0,b);if(s(B)){var L,U=P[S("0x6b")];s(U)||(L=new(a[S("0x1b1")])({vertexFormat:e[S("0x138")][S("0x221")],angle:M,radius:V,stackPartitions:X,slicePartitions:R}),P[S("0x6b")]=a[S("0x1b1")][S("0x55")](L),U=P[S("0x6b")]);var H=Z[S("0x82")],Q=Z[S("0x7c")],J=Z[S("0x1d7")];s(J)||(J=1);var O=Z[S("0x1d6")];s(O)||(O=h[S("0x148")]);var j=new(e[S("0x222")])({geometry:U,modelMatrix:B,attributes:{color:e[S("0x20d")][S("0x223")](H)}});if(v[S("0x4c")](j),Q){var K,q=P[S("0xd3")];s(q)||(K=new(r[S("0x1b7")])({vertexFormat:e[S("0x138")][S("0x192")],angle:M,radius:V}),P[S("0xd3")]=r[S("0x1b7")][S("0x55")](K),q=P[S("0xd3")]),j=new(e[S("0x222")])({geometry:q,modelMatrix:B,attributes:{color:e[S("0x20d")][S("0x223")](O)}}),_[S("0x4c")](j)}}}}}}v[S("0x2")]>0&&(this[S("0x216")]=this[S("0x1fe")][S("0x9e")](new x({asynchronous:!1,geometryInstances:v,appearance:new d({flat:!1,translucent:!0,closed:!0})}))),_[S("0x2")]>0&&(this[S("0x217")]=this[S("0x1fe")][S("0x9e")](new x({asynchronous:!1,geometryInstances:_,appearance:new d({flat:!0,translucent:!0,renderState:{lineWidth:this[S("0x1fd")][S("0x224")](J)}})})))},i[S("0x1e0")]=v},function(t,i,n){Object[S("0x1d")](i,S("0x1e"),{value:!0}),i[S("0x21a")]=void 0;var a,r=n(3),o=e[S("0x225")],s=e[S("0x1b8")],l=e[S("0x226")],c=e[S("0x1ba")],h=e[S("0x210")];function x(t){return new l(t)}function d(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 r[S("0x1dc")]||(e=new(r[S("0x1dc")])(e)),this[S("0x21f")]=e,this[S("0x1ce")]=new h,this[S("0x6b")]=void 0,this[S("0xd3")]=void 0,this[S("0x1d0")]=new s,this[S("0x1d3")](t)}e[S("0x211")],Object[S("0xa3")](d[S("0xa4")],{position:(a=S("0x3"),c(a,void 0,x)),orientation:c(S("0xc1")),show:c(S("0x7a"))}),d[S("0xa4")][S("0x1d3")]=function(t){this[S("0x3")]=t[S("0x3")],this[S("0xc1")]=t[S("0xc1")],this[S("0x7a")]=t[S("0x7a")]},d[S("0xa4")][S("0x228")]=function(t){t instanceof o&&(this[S("0x21f")][S("0x1da")]=t)},i[S("0x21a")]=d}])},typeof exports===S("0x12c")&&typeof module===S("0x12c")?module[S("0x12d")]=i():typeof define===S("0xbe")&&define[S("0x12e")]?define([],i):typeof exports===S("0x12c")?exports[S("0x12f")]=i():t[S("0x12f")]=i())}(),t[S("0x256")]=!0};let X=null;function R(t,e){t&&(this._viewer=t,X=e,new V(Window,X),this._customPluginLayer=new X.CustomDataSource("_customPluginLayer"),t&&t.dataSources.add(this._customPluginLayer))}R.prototype={createRectangularSensorGraphics:function(t){if(this._customPluginLayer&&t){let e=new X.HeadingPitchRoll(X.Math.toRadians(t.heading||90),X.Math.toRadians(t.pitch||0),X.Math.toRadians(t.roll||0)),i=t.position;return this._customPluginLayer.entities.add({position:i,orientation:X.Transforms.headingPitchRollQuaternion(i,e),rectangularSensor:new X.Scene.RectangularSensorGraphics({radius:t.radius||1e5,xHalfAngle:X.Math.toRadians(t.xHalfAngle||45),yHalfAngle:X.Math.toRadians(t.yHalfAngle||45),material:t.material||new X.Color(1,0,1,.4),lineColor:t.lineColor||new X.Color(1,0,1,1),showScanPlane:t.showScanPlane||!0,scanPlaneColor:t.scanPlaneColor||new X.Color(1,0,1,1),scanPlaneMode:t.scanPlaneMode||"vertical",scanPlaneRate:t.scanPlaneRate||3,showThroughEllipsoid:t.showThroughEllipsoid||!1})})}},createSatelliteCoverageSimulationGraphics:function(t){if(t)return new X.Scene.SatelliteCoverageSimulation(this._viewer,{position:t.position,angle1:t.angle1||30,angle2:t.angle2||45,areaType:t.areaType||2,rotation:{heading:X.Math.toRadians(t.heading||0),pitch:X.Math.toRadians(t.pitch||0),roll:X.Math.toRadians(t.roll||0)},color:t.color||{red:.43137254901960786,green:.9607843137254902,blue:0,alpha:.8}})},createRadarPrimitive:function(t){if(t)return new X.Scene.RadarPrimitive(this._viewer,{position:t.position,angle:t.angle||80,radius:t.radius||7e5,rotation:{heading:X.Math.toRadians(t.heading||0),pitch:X.Math.toRadians(t.pitch||40),roll:X.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,B,T=null,D={},N="move",k=null;function Y(t,e){t&&(this._viewer=t,k=t,T=e,this._installFileDragDropHandler())}Y.prototype={_installFileDragDropHandler(){function t(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,t.appendChild(i),this.fileDragDropCallBack=void 0,this.callBackParms=void 0}t.prototype.startuploadfile=function(){var t=this,e=t._dragBox,i=null;document.ondragover=function(){clearTimeout(i),i=setTimeout((function(){e.innerHTML="请将文件拖拽到此区域"}),200)},e.ondragenter=function(){e.innerHTML="请释放鼠标"},e.ondragover=function(){return!1},e.ondragleave=function(){e.innerHTML="请将文件拖拽到此区域"},e.ondrop=function(e){e.preventDefault();var i=e.dataTransfer.files[0],n=new FileReader;return n.readAsText(i,"UTF-8"),n.onload=function(){var e=JSON.parse(this.result);t.fileDragDropCallBack&&t.fileDragDropCallBack(t.callBackParms,e,t._viewer)},n.onloadstart=function(){},n.onloadend=function(){},n.onabort=function(){alert("读取数据中断")},n.onerror=function(){alert("读取数据失败")},!1}},T.Scene.FileDragDropMixin=function(e){var i=new t(document.querySelector(".cesium-viewer"),e);Object.defineProperties(e,{fileDragDropMixin:{get:function(){return i}}})}},showLoadDataToScenePanel(t){if(t=t||{}){let t=new n,e=this._viewer,i=t.addFolder("加载数据文件"),a=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:()=>{a(t=>{T.GeoJsonDataSource.load(t).then((function(t){e.dataSources.add(t);for(var i=t.entities.values,n=0;n<i.length;n++){var a=i[n];a.nameID=n,a.point={color:T.Color.BLUE}}e.flyTo(t)}))})},polyline:()=>{a(t=>{T.GeoJsonDataSource.load(t).then((function(t){e.dataSources.add(t);for(var i=t.entities.values,n=0;n<i.length;n++){var a=i[n];a.nameID=n,a.polyline.width=5,a.polyline.material=new T.PolylineGlowMaterialProperty({glowPower:.1,color:T.Color.ORANGERED.withAlpha(.9)})}e.flyTo(t)}))})},polygon:()=>{a(t=>{T.GeoJsonDataSource.load(t).then((function(t){e.dataSources.add(t);for(var i=t.entities.values,n=0;n<i.length;n++){var a=i[n];a.nameID=n,a.polygon.width=10,a.polygon.material=T.Color.BLUE.withAlpha(.9)}e.flyTo(t)}))})},model:()=>{a(t=>{e.flyTo(d3kit.createModelGraphics({position:T.Cartesian3.fromDegrees(120.38105869,31.10115627),m_url:t}))})},czml:()=>{a(t=>{e.flyTo(e.dataSources.add(T.CzmlDataSource.load(t)))})},"3dtilset":()=>{a(t=>{e.flyTo(e.scene.primitives.add(new T.Cesium3DTileset({url:t})))})}};i.add(r,"point"),i.add(r,"polyline"),i.add(r,"polygon"),i.add(r,"model"),i.add(r,"czml"),i.add(r,"3dtilset"),i.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};t&&t.elementId?(e=new n({autoPlace:!1}),document.getElementById(t.elementId).appendChild(e.domElement)):e=new n;let a=this._viewer.scene.postProcessStages,r=a.add(T.PostProcessStageLibrary.createSilhouetteStage()),o=a.add(T.PostProcessStageLibrary.createBlackAndWhiteStage()),s=a.add(T.PostProcessStageLibrary.createBrightnessStage()),l=a.add(T.PostProcessStageLibrary.createNightVisionStage());r.uniforms.color=t.silhouetteColor||T.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};t&&t.elementId?(e=new n({autoPlace:!1}),document.getElementById(t.elementId).appendChild(e.domElement)):e=new n;let a=this._viewer;e.__closeButton.innerHTML="收缩面板";let r=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(t){let e=t.primitives._delegate||t.primitives,i=t.primitives,a=(this._viewer,null);t&&t.elementId?(a=new n({autoPlace:!1}),document.getElementById(t.elementId).appendChild(a.domElement)):a=new n;let r=a.addFolder("离地高度");r.add({height:100},"height",0,1e3,1).onChange((function(t){var e=i.boundingSphere,n=T.Cartographic.fromCartesian(e.center),a=T.Cartesian3.fromRadians(n.longitude,n.latitude,0),r=T.Cartesian3.fromRadians(n.longitude,n.latitude,t),o=T.Cartesian3.subtract(r,a,new T.Cartesian3);i.modelMatrix=T.Matrix4.fromTranslation(o)})),r.open();let o=a.addFolder("缩放大小"),s={"m+Scale":()=>{e.readyPromise.then(t=>{let e=t.root.transform;T.Matrix4.multiplyByUniformScale(e,1.2,e),t.root.transform=e})},"m-Scale":()=>{e.readyPromise.then(t=>{let e=t.root.transform;T.Matrix4.multiplyByUniformScale(e,.8,e),t.root.transform=e})}};o.add(s,"m+Scale"),o.add(s,"m-Scale"),o.open();let l={"x+Axis":()=>{const t=T.Matrix4.fromTranslation(new T.Cartesian3(20,0,0));T.Matrix4.multiply(e.modelMatrix,t,e.modelMatrix)},"x-Axis":()=>{const t=T.Matrix4.fromTranslation(new T.Cartesian3(-20,0,0));T.Matrix4.multiply(e.modelMatrix,t,e.modelMatrix)},"y+Axis":()=>{const t=T.Matrix4.fromTranslation(new T.Cartesian3(0,20,0));T.Matrix4.multiply(e.modelMatrix,t,e.modelMatrix)},"y-Axis":()=>{const t=T.Matrix4.fromTranslation(new T.Cartesian3(0,-20,0));T.Matrix4.multiply(e.modelMatrix,t,e.modelMatrix)},"z+Axis":()=>{const t=T.Matrix4.fromTranslation(new T.Cartesian3(0,0,20));T.Matrix4.multiply(e.modelMatrix,t,e.modelMatrix)},"z-Axis":()=>{const t=T.Matrix4.fromTranslation(new T.Cartesian3(0,0,-20));T.Matrix4.multiply(e.modelMatrix,t,e.modelMatrix)}},c=a.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();let h={x:0,y:0,z:0},x={"x+Axis":()=>{h.x+=15,e.readyPromise.then(t=>{const e=T.Matrix3.fromRotationX(T.Math.toRadians(h.x)),i=T.Matrix4.fromRotationTranslation(e),n=T.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);T.Matrix4.multiply(n,i,n),t._root.transform=n})},"x-Axis":()=>{h.x-=15,e.readyPromise.then(t=>{const e=T.Matrix3.fromRotationX(T.Math.toRadians(h.x)),i=T.Matrix4.fromRotationTranslation(e),n=T.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);T.Matrix4.multiply(n,i,n),t._root.transform=n})},"y+Axis":()=>{h.y+=15,e.readyPromise.then(t=>{const e=T.Matrix3.fromRotationY(T.Math.toRadians(h.y)),i=T.Matrix4.fromRotationTranslation(e),n=T.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);T.Matrix4.multiply(n,i,n),t._root.transform=n})},"y-Axis":()=>{h.y-=15,e.readyPromise.then(t=>{const e=T.Matrix3.fromRotationY(T.Math.toRadians(h.y)),i=T.Matrix4.fromRotationTranslation(e),n=T.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);T.Matrix4.multiply(n,i,n),t._root.transform=n})},"z+Axis":()=>{h.z+=15,e.readyPromise.then(t=>{const e=T.Matrix3.fromRotationZ(T.Math.toRadians(h.z)),i=T.Matrix4.fromRotationTranslation(e),n=T.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);T.Matrix4.multiply(n,i,n),t._root.transform=n})},"z-Axis":()=>{h.z-=15,e.readyPromise.then(t=>{const e=T.Matrix3.fromRotationZ(T.Math.toRadians(h.z)),i=T.Matrix4.fromRotationTranslation(e),n=T.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);T.Matrix4.multiply(n,i,n),t._root.transform=n})}},d=a.addFolder("旋转矩阵");if(d.add(x,"x+Axis"),d.add(x,"x-Axis"),d.add(x,"y+Axis"),d.add(x,"y-Axis"),d.add(x,"z+Axis"),d.add(x,"z-Axis"),d.open(),t.cb){let n=a.addFolder("获取调整后的模型矩阵");n.add({getModelMaterix:()=>{e.readyPromise.then(e=>{let n=e.root.transform;t.cb({modelTransformMatrix:n,modelMatrix:i.modelMatrix})})}},"getModelMaterix").name("获取模型矩阵"),n.open()}a.__closeButton.innerHTML="收缩面板"},showLayerParamPanel:function(t,e){if(t){let r=null;if(e&&e.elementId)r=new n({autoPlace:!1}),document.getElementById(e.elementId).appendChild(r.domElement);else r=new n;var i=new function(){this.alpha=t.alpha,this.brightness=t.brightness,this.contrast=t.contrast,this.gamma=t.gamma,this.hue=t.hue,this.dayAlpha=t.dayAlpha,this.nightAlpha=t.nightAlpha,this.saturation=t.saturation},a=r.addFolder("图层调整");a.add(i,"alpha",0,1,.05).name("透明度").onChange((function(e){t.alpha=e})),a.add(i,"brightness",0,5,.05).name("亮度").onChange((function(e){t.brightness=e})),a.add(i,"contrast",0,5,.05).name("对比").onChange((function(e){t.contrast=e})),a.add(i,"gamma",0,5,.05).name("伽马").onChange((function(e){t.gamma=e})),a.add(i,"hue",0,5,.05).name("色调").onChange((function(e){t.hue=e})),a.add(i,"dayAlpha",0,1,.05).name("白天透明").onChange((function(e){t.dayAlpha=e})),a.add(i,"nightAlpha",0,1,.05).name("夜晚透明").onChange((function(e){t.nightAlpha=e})),a.add(i,"saturation",0,5,.05).name("饱和").onChange((function(e){t.saturation=e})),a.open()}},showLayerSwitchPanel:function(t,e){if(t&&t.length){let s=null;if(e&&e.elementId)s=new n({autoPlace:!1}),document.getElementById(e.elementId).appendChild(s.domElement);else s=new n;var i=new function(){t.forEach(t=>{this[t.id]=t.show})},a=s.addFolder("图层切换");t.forEach(t=>{a.add(i,t.id).name(t.name).onChange((function(e){t.show=e}))});var r=new function(){t.forEach(t=>{this[t.id]=t.alpha})},o=s.addFolder("透明度");t.forEach(t=>{o.add(r,t.id,0,1,.05).name(t.name).onChange((function(e){t.alpha=e}))}),a.open(),o.open()}},showSceneEffectEditPanel:function(t){if(t=t||{},n&&this._viewer.scene.colorCorrection){var e=new n,i=this._viewer;i.scene.lightSource.ambientLightColor=t.ambientLightColor||new T.Color(.3,.3,.3,1),i.scene.colorCorrection.show=t.colorCorrection||!1,i.scene.colorCorrection.saturation=t.saturation||3.1,i.scene.colorCorrection.brightness=t.brightness||1.8,i.scene.colorCorrection.contrast=t.contrast||1.2,i.scene.colorCorrection.hue=t.hue||0,i.scene.bloomEffect.show=t.bloomEffect||!1,i.scene.hdrEnabled=t.hdrEnabled||!0,i.scene.bloomEffect.threshold=t.threshold||1,i.scene.bloomEffect.bloomIntensity=t.bloomIntensity||2;var a=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},r=e.addFolder("场景效果");console.log("sceneEffect:",a),r.add(a,"bloomEffectShow").name("泛光开关").onChange((function(t){i.scene.bloomEffect.show=t,i.scene.bloomEffect.threshold=a.bloomThreshold,i.scene.bloomEffect.bloomIntensity=a.bloomIntensity})),r.add(a,"bloomThreshold",0,1,.1).name("泛光阈值").onChange((function(t){i.scene.bloomEffect.threshold=t})),r.add(a,"bloomIntensity",0,10,.1).name("泛光强度").onChange((function(t){i.scene.bloomEffect.bloomIntensity=t})),r.add(a,"hdrEnabled").name("HDR开关").onChange((function(t){i.scene.hdrEnabled=t})),r.add(a,"colorCorrectionShow").name("颜色校正").onChange((function(t){i.scene.colorCorrection.show=t})),r.add(a,"colorCorrectionSaturation",0,5,.1).name("饱和度").onChange((function(t){i.scene.colorCorrection.saturation=t})),r.add(a,"colorCorrectionBrightness",0,5,.1).name("亮度").onChange((function(t){i.scene.colorCorrection.brightness=t})),r.add(a,"colorCorrectionContrast",0,5,.1).name("对比度").onChange((function(t){i.scene.colorCorrection.contrast=t})),r.add(a,"colorCorrectionHue",0,5,.1).name("色调").onChange((function(t){i.scene.hdrEnabled=t})),r.add(a,"colorCorrectionHue",0,1,.1).name("环境光").onChange((function(t){i.scene.lightSource.ambientLightColor=new T.Color(t,t,t,1)})),r.open()}},showEntityOrientationEditPanel:function(t={}){if(t.entity){let o=t.entity;var e=new n;if(t&&t.elementId)e=new n({autoPlace:!1}),document.getElementById(t.elementId).appendChild(e.domElement);else e=new n;var i=new function(){this.heading=360,this.pitch=1,this.roll=1},a=e.addFolder("实体姿态调整"),r=this;a.add(i,"heading",0,360,1).name("角度").onChange((function(e){i.heading=e;let n=T.Transforms.headingPitchRollQuaternion(o.position.getValue(r._viewer.clock.currentTime),new T.HeadingPitchRoll(T.Math.toRadians(i.heading),T.Math.toRadians(i.pitch),T.Math.toRadians(i.roll)));o.orientation=n,t.cb&&t.cb({orientation:n})})),a.add(i,"pitch",0,360,1).name("航向").onChange((function(e){i.pitch=e;let n=T.Transforms.headingPitchRollQuaternion(o.position.getValue(r._viewer.clock.currentTime),new T.HeadingPitchRoll(T.Math.toRadians(i.heading),T.Math.toRadians(i.pitch),T.Math.toRadians(i.roll)));o.orientation=n,t.cb&&t.cb({orientation:n})})),a.add(i,"roll",0,360,1).name("翻转").onChange((function(e){i.roll=e;let n=T.Transforms.headingPitchRollQuaternion(o.position.getValue(r._viewer.clock.currentTime),new T.HeadingPitchRoll(T.Math.toRadians(i.heading),T.Math.toRadians(i.pitch),T.Math.toRadians(i.roll)));o.orientation=n,t.cb&&t.cb({orientation:n})})),a.open()}},definedMouseEvent({targetEntity:t,ctrlFlag:e}){B=t,D=e,this.bindHandelEvent({leftDown:this.defLeftDown,mouseMove:this.defMouseMove,mouseWheel:this.defMouseWheel,leftUp:this.defLeftUp})},defMouseMove(t){if(D.leftDown&&F){let e=k.camera.getPickRay(t.endPosition),i=k.scene.globe.pick(e,k.scene);if(document.body.style.cursor="pointer",F&&F.id&&"move"===N){let t=T.JulianDate.fromDate(new Date),e=B.position.getValue(t),n=T.Cartographic.fromCartesian(e),a=Number(n.height.toFixed(3));B.position=new T.CallbackProperty(()=>{let t=k.scene.globe.ellipsoid.cartesianToCartographic(i),e=T.Math.toDegrees(t.longitude),n=T.Math.toDegrees(t.latitude);return T.Cartesian3.fromDegrees(e,n,a)},!1)}else if(F&&F.id&&"rotate"===N){let e=T.JulianDate.fromDate(new Date),i=B.position.getValue(e),n=k.scene.camera.pickEllipsoid(t.startPosition),a=k.scene.camera.pickEllipsoid(t.endPosition);const r=T.Cartesian3.subtract(i,a,new T.Cartesian3),o=T.Cartesian3.normalize(r,new T.Cartesian3);let s=T.Cartesian3.subtract(n,i,new T.Cartesian3),l=T.Cartesian3.subtract(a,i,new T.Cartesian3),c=T.Cartesian3.angleBetween(s,l);const h=100,x=T.Quaternion.fromAxisAngle(o,c*h);B.orientation=x}}},defLeftDown(t){F=k.scene.pick(t.position),T.defined(F)&&N?(D.selected=!0,D.leftDown=!0):D.selected=!1},defMouseWheel(t){if(F&&F.id&&"scale"===N){let e=T.JulianDate.fromDate(new Date),i=B.box.dimensions.getValue(e),n=t>0?2:.5;B.box.dimensions=new T.CallbackProperty(()=>T.Cartesian3.multiplyByScalar(i,n,new T.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 z=null;function E(t,e,i){t&&(this._viewer=t,z=e,this._pluginLayer=new z.CustomDataSource("pluginLayer"),t&&t.dataSources.add(this._pluginLayer),this._installPlugin())}E.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=z.defaultValue(e.splitNum,50),this._positions&&this._positions.length>0&&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 z.Cartesian3,a=z.Cartesian3.subtract(t[0],t[1],n);a=a.x>0,this.excavateMinHeight=9999;for(var r=0;r<i;r++){var o=(r+1)%i,s=z.Cartesian3.midpoint(t[r],t[o],new z.Cartesian3),l=z.Cartographic.fromCartesian(t[r]),c=this.viewer.scene.globe.getHeight(l)||l.height;c<this.excavateMinHeight&&(this.excavateMinHeight=c);var h,x=z.Cartesian3.normalize(s,new z.Cartesian3);h=a?z.Cartesian3.subtract(t[r],s,new z.Cartesian3):z.Cartesian3.subtract(t[o],s,new z.Cartesian3),h=z.Cartesian3.normalize(h,h);var d=z.Cartesian3.cross(h,x,new z.Cartesian3);d=z.Cartesian3.normalize(d,d);var u=new z.Plane(d,0),p=z.Plane.getPointDistance(u,s);e.push(new z.ClippingPlane(d,p))}this.viewer.scene.globe.clippingPlanes=new z.ClippingPlaneCollection({planes:e,edgeWidth:1,edgeColor:z.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=z.Cartographic.fromCartesian(t[s]),h=z.Cartographic.fromCartesian(t[l]),x=[c.longitude,c.latitude],d=[h.longitude,h.latitude];0==s&&(o.push(new z.Cartographic(x[0],x[1])),r.push(z.Cartesian3.fromRadians(x[0],x[1],n)),a.push(z.Cartesian3.fromRadians(x[0],x[1],0)));for(var u=1;u<=e;u++){var p=z.Math.lerp(x[0],d[0],u/e),g=z.Math.lerp(x[1],d[1],u/e);s==i-1&&u==e||(o.push(new z.Cartographic(p,g)),r.push(z.Cartesian3.fromRadians(p,g,n)),a.push(z.Cartesian3.fromRadians(p,g,0)))}}this.wellData={lerp_pos:o,bottom_pos:r,no_height_top:a}}},t.prototype._createWell=function(t){if(this.viewer.terrainProvider._layers){var e=this;this._createBottomSurface(t.bottom_pos);var i=z.sampleTerrainMostDetailed(this.viewer.terrainProvider,t.lerp_pos);z.when(i,(function(i){for(var n=i.length,a=[],r=0;r<n;r++){var o=z.Cartesian3.fromRadians(i[r].longitude,i[r].latitude,i[r].height);a.push(o)}e._createWellWall(t.bottom_pos,a)}))}else this._createBottomSurface(t.bottom_pos),this._createWellWall(t.bottom_pos,t.no_height_top)},t.prototype._getMinHeight=function(t){let e=5e6,i=null;for(let n=0;n<t.length;n++){let a=t[n].z;a<e&&(e=a,i=this._ellipsoidToLonLat(t[n]))}return i.altitude},t.prototype._ellipsoidToLonLat=function(t){let e=this.viewer.scene.globe.ellipsoid,i=new z.Cartesian3(t.x,t.y,t.z),n=e.cartesianToCartographic(i),a=z.Math.toDegrees(n.latitude);return{longitude:z.Math.toDegrees(n.longitude),latitude:a,altitude:n.height}},t.prototype._createBottomSurface=function(t){if(t.length){let n=this._getMinHeight(t),a=[];for(let e=0;e<t.length;e++){let i=this._ellipsoidToLonLat(t[e]);a.push(i.longitude),a.push(i.latitude),a.push(n)}let r=new z.PolygonGeometry({polygonHierarchy:new z.PolygonHierarchy(z.Cartesian3.fromDegreesArrayHeights(a)),perPositionHeight:!0}),o=z.PolygonGeometry.createGeometry(r);var e=new z.Material({fabric:{type:"Image",uniforms:{image:this.bottomImg}}}),i=new z.MaterialAppearance({translucent:!1,flat:!0,material:e});this.bottomSurface=new z.Primitive({geometryInstances:new z.GeometryInstance({geometry:o}),appearance:i,asynchronous:!1}),this.viewer.scene.primitives.add(this.bottomSurface)}},t.prototype._createWellWall=function(t,e){let i=this._getMinHeight(t),n=[],a=[];for(let t=0;t<e.length;t++)n.push(this._ellipsoidToLonLat(e[t]).altitude),a.push(i);let r=new z.WallGeometry({positions:e,maximumHeights:n,minimumHeights:a}),o=z.WallGeometry.createGeometry(r);var s=new z.Material({fabric:{type:"Image",uniforms:{image:this.wallImg}}}),l=new z.MaterialAppearance({translucent:!1,flat:!0,material:s});this.wellWall=new z.Primitive({geometryInstances:new z.GeometryInstance({geometry:o,attributes:{color:z.ColorGeometryInstanceAttribute.fromColor(z.Color.GREY)},id:"PitWall"}),appearance:l,asynchronous:!1}),this.viewer.scene.primitives.add(this.wellWall)},t.prototype._switchExcavate=function(t){t?(this.viewer.scene.globe.material=z.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(z.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)},z.Scene.TerrainClipPlan=t},buildLightScanGraphics:function(t){if(this._viewer&&t){for(var e=this,i=function(t,e,i){var n,a,r,o,s,l,c=t.positionList,h=0,x=0;function d(e){n=c[e+1][0]-c[e][0],a=c[e+1][1]-c[e][1],r=n/t.number,o=a/t.number,x=0}d(h),e.polygon.hierarchy=new z.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,d(h)),s=x*r,l=x*o,x++,new z.PolygonHierarchy(z.Cartesian3.fromDegreesArrayHeights([t.observer[0],t.observer[1],t.observer[2],i[0]+s,i[1]+l,0,i[2]+s,i[3]+l,0]))}),!1)},n=e._getCirclePoints(t.circle[0],t.circle[1],t.circle[2],t.circle[3]),a=function(t,i){for(var n=i.observer[0],a=i.observer[1],r=i.observer[2],o=[],s=0;s<t.length;s++){var l;l=s===t.length-1?new z.PolygonHierarchy(z.Cartesian3.fromDegreesArrayHeights([n,a,r,t[s].x,t[s].y,0,t[0].x,t[0].y,0])):new z.PolygonHierarchy(z.Cartesian3.fromDegreesArrayHeights([n,a,r,t[s].x,t[s].y,0,t[s+1].x,t[s+1].y,0]));var c=e._pluginLayer.entities.add({name:"三角形",polygon:{hierarchy:l,outline:!1,perPositionHeight:!0,material:i.material}});o.push(c)}return o}(n,t),r=0;r<a.length;r++)r!==a.length-1?i(t,a[r],[n[r].x,n[r].y,n[r+1].x,n[r+1].y]):i(t,a[r],[n[r].x,n[r].y,n[0].x,n[0].y]);return a}},buildPathRoaming:function(t){if(this._viewer&&t&&t.paths){var e=t.paths,i=new z.SampledPositionProperty,n=this.createGraphics(),a=new z.JulianDate,r=z.JulianDate.addSeconds(a,e[e.length-1].time,new z.JulianDate),o=t.startTime||a,s=t.stopTime||r;this._viewer.clock.startTime=o.clone(),this._viewer.clock.currentTime=o.clone(),this._viewer.clock.stopTime=s.clone(),this._viewer.clock.multiplier=t.multiplier||10,this._viewer.clock.clockRange=t.clockRange||z.ClockRange.CLAMPED;for(var l=0;l<e.length;l++){var c=z.Cartesian3.fromDegrees(e[l].lon,e[l].lat,e[l].alt),h=z.JulianDate.addSeconds(o,e[l].time,new z.JulianDate);i.addSample(h,c)}n.name=t.name||"路径漫游",n.availability=new z.TimeIntervalCollection([new z.TimeInterval({start:o,stop:s})]),n.position=i,n.orientation=new z.VelocityOrientationProperty(i);var x=[];return t.polyline&&(n.polyline={positions:new z.CallbackProperty((function(){return x}),!1),width:10,material:new z.PolylineGlowMaterialProperty({glowPower:1,color:z.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(){if(this._viewer){var t=this._viewer;function e(e,i){this._scratch=new z.Cartesian2,this._viewer=t,this._scene=t.scene,this._camera=t.camera,this._container=null,this._elements=e,this._isBackHide=i,this.init()}e.prototype.init=function(){var t=document.createElement("div");t.className="ys-css3-container",document.getElementById("info-warp").appendChild(t),this._container=t,this._elements.forEach((function(e){t.insertAdjacentHTML("beforeend",e.element)}));var e=this;this._scene.preRender.addEventListener((function(){for(var i=0;i<t.children.length;i++){var n=z.Cartesian3.fromDegrees(e._elements[i].position[0],e._elements[i].position[1],e._elements[i].position[2]||0),a=e._scene.cartesianToCanvasCoordinates(n,e._scratch);if(z.defined(a)&&(t.children[i].style.left=parseFloat(a.x)+parseFloat(e._elements[i].offset[0])+"px",t.children[i].style.top=parseFloat(a.y)+parseFloat(e._elements[i].offset[1])+"px",e._isBackHide)){var r=e._camera.position,o=e._scene.globe.ellipsoid.cartesianToCartographic(r).height;o+=1*e._scene.globe.ellipsoid.maximumRadius,z.Cartesian3.distance(r,n)>o?t.children[i].style.display="none":t.children[i].style.display="block"}}}))},e.prototype.remove=function(t){this._elements=this._elements.filter((function(t){t.id})),this._container.removeChild(document.getElementById(t))},e.prototype.append=function(t){this._elements.push(t),this._container.insertAdjacentHTML("beforeend",t.element)},e.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)},e.prototype.addEntityLayer=function(t){var e=t.position[0],i=t.position[1],n=this,a=.001;setTimeout((function(t){}),300);var r=z.Math.toRadians(30),o=z.Math.toRadians(30),s=t.boxHeight||300,l=t.boxHeightMax||400,c=t.boxHeightDif||10,h=!0;t.boxShow?this._viewer.entities.add({id:t.id+"_1",name:"立方体盒子",position:new z.CallbackProperty((function(){return(s+=c)>=l&&(s=l),z.Cartesian3.fromDegrees(e,i,s/2)}),!1),box:{dimensions:new z.CallbackProperty((function(){return(s+=c)>=l&&(s=l,h&&(h=!1,n.append(t,!0))),new z.Cartesian3(t.boxSide||100,t.boxSide||100,s)}),!1),material:t.boxMaterial||z.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:z.Cartesian3.fromDegrees(e,i),ellipse:{semiMinorAxis:new z.CallbackProperty((function(){return a}),!1),semiMajorAxis:new z.CallbackProperty((function(){return.001}),!1),material:this.getDfSt(["plugin","Css3Renderer_one"])||"static/data/images/Textures/circle2.png",rotation:new z.CallbackProperty((function(){return r+=.05}),!1),stRotation:new z.CallbackProperty((function(){return r+=.05}),!1),zIndex:2}}),this._viewer.entities.add({id:t.id+"_3",name:"椭圆",position:z.Cartesian3.fromDegrees(e,i),ellipse:{semiMinorAxis:new z.CallbackProperty((function(){return.001}),!1),semiMajorAxis:new z.CallbackProperty((function(){return.001}),!1),material:this.getDfSt(["plugin","Css3Renderer_two"])||"static/data/images/Textures/circle1.png",rotation:new z.CallbackProperty((function(){return o-=.03}),!1),stRotation:new z.CallbackProperty((function(){return o-=.03}),!1),zIndex:3}}))},z.Scene.Css3Renderer=e}},_installGroundSkyBox:function(){var t=z.BoxGeometry,e=z.Cartesian3,i=z.defaultValue,n=z.defined,a=z.destroyObject,r=z.DeveloperError,o=z.GeometryPipeline,s=z.Matrix3,l=z.Matrix4,c=z.Transforms,h=z.VertexFormat,x=z.BufferUsage,d=z.CubeMap,u=z.DrawCommand,p=z.loadCubeMap,g=z.RenderState,m=z.VertexArray,f=z.BlendingState,v=z.SceneMode,y=z.ShaderProgram,b=z.ShaderSource;function C(t){this.sources=t.sources,this._sources=void 0,this.show=i(t.show,!0),this._command=new u({modelMatrix:l.clone(l.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}n(l.getRotation)||(l.getRotation=l.getMatrix3);var w=new s;C.prototype.update=function(i,a){var s=this;if(this.show&&(i.mode===v.SCENE3D||i.mode===v.MORPHING)&&i.passes.render){var u=i.context;if(this._sources!==this.sources){this._sources=this.sources;var C=this.sources;if(!(n(C.positiveX)&&n(C.negativeX)&&n(C.positiveY)&&n(C.negativeY)&&n(C.positiveZ)&&n(C.negativeZ)))throw new r("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof C.positiveX!=typeof C.negativeX||typeof C.positiveX!=typeof C.positiveY||typeof C.positiveX!=typeof C.negativeY||typeof C.positiveX!=typeof C.positiveZ||typeof C.positiveX!=typeof C.negativeZ)throw new r("this.sources properties must all be the same type.");"string"==typeof C.positiveX?p(u,this._sources).then((function(t){s._cubeMap=s._cubeMap&&s._cubeMap.destroy(),s._cubeMap=t})):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new d({context:u,source:C}))}var I=this._command;if(I.modelMatrix=c.eastNorthUpToFixedFrame(i.camera._positionWC),!n(I.vertexArray)){I.uniformMap={u_cubeMap:function(){return s._cubeMap},u_rotateMatrix:function(){return l.getRotation(I.modelMatrix,w)}};var A=t.createGeometry(t.fromDimensions({dimensions:new e(2,2,2),vertexFormat:h.POSITION_ONLY})),_=this._attributeLocations=o.createAttributeLocations(A);I.vertexArray=m.fromGeometry({context:u,geometry:A,attributeLocations:_,bufferUsage:x._DRAW}),I.renderState=g.fromCache({blending:f.ALPHA_BLEND})}if(!n(I.shaderProgram)||this._useHdr!==a){var G=new b({defines:[a?"HDR":""],sources:["uniform samplerCube u_cubeMap;\n varying vec3 v_texCoord;\n void main()\n {\n vec4 color = textureCube(u_cubeMap, normalize(v_texCoord));\n gl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n }\n "]});I.shaderProgram=y.fromCache({context:u,vertexShaderSource:"attribute vec3 position;\n varying 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:G,attributeLocations:this._attributeLocations}),this._useHdr=a}if(n(this._cubeMap))return I}},C.prototype.isDestroyed=function(){return!1},C.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(),a(this)},z.Scene.GroundSkyBox=C}};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=[],a=[],r=[],o=i.transformWGS84ToCartesian(e[0]),s=i.transformWGS84ToCartesian(e[1]);n=i.$graphics.createPointsGraphics({point:!0,positions:[o,s]});var l=i.$math3d.getIntersectObj(o,s,n,!0);if(0===l.length)return alert("没有取到相交点 , 请检查是否开启深度检测。"),!1;!function(){for(let t=l.length-1;t>=0;t--){const e=l[t];L.defined(e.position)||l.splice(t,1)}if(!L.defined(l[0].position))throw new L.DeveloperError("position is undefined");var t=l[0].position,e=L.Cartesian3.distance(t,s)<5,c=[o,l[0].position],h=i._analysisLayer.entities.add({polyline:{positions:c,width:10,arcType:L.ArcType.NONE,material:new L.PolylineArrowMaterialProperty(L.Color.GREEN)}});if(a.push(h),!e){var x=[l[0].position,s],d=i._analysisLayer.entities.add({polyline:{positions:x,width:10,arcType:L.ArcType.NONE,material:new L.PolylineArrowMaterialProperty(L.Color.RED)}});a.push(d)}!function(){for(let s=0;s<l.length;++s){var t=l[s].object;if(t)if(t instanceof L.Cesium3DTileFeature)r.push(t),t.oldColor=t.color.clone(),t.color=L.Color.fromAlpha(L.Color.YELLOW,t.color.alpha);else if(t.id instanceof L.Entity){var e=t.id,a=e.polygon||e.polyline;r.push(e);var o=a.material.color.getValue();a.oldColor=o.clone(),a.material=L.Color.fromAlpha(L.Color.YELLOW,o.alpha)}n.push(i._analysisLayer.entities.add({position:l[s].position,ellipsoid:{radii:new L.Cartesian3(.8,.8,.8),material:L.Color.RED}}))}}();var u=L.Cartographic.fromCartesian(o),p=L.Cartographic.fromCartesian(s),g={longitude:u.longitude/Math.PI*180,latitude:u.latitude/Math.PI*180,height:u.height},m={longitude:p.longitude/Math.PI*180,latitude:p.latitude/Math.PI*180,height:p.height},f=Math.sqrt(Math.pow(o.x-s.x,2)+Math.pow(o.y-s.y,2)+Math.pow(o.z-s.z,2)),v=Math.abs(m.height-g.height),y=Math.sqrt(Math.pow(f,2)+Math.pow(v,2)),b=e?"是":"否",C="起点坐标: ("+g.longitude.toFixed(6)+"°,"+g.latitude.toFixed(6)+"°,"+g.height.toFixed(2)+")\n终点坐标: ("+m.longitude.toFixed(6)+"°,"+m.latitude.toFixed(6)+"°,"+m.height.toFixed(2)+")\n垂直距离: "+v.toFixed(2)+"m\n水平距离: "+f.toFixed(2)+"m\n空间距离: "+y.toFixed(2)+"m\n是否可视: "+b;n&&n[0]&&(n[0].label={text:C,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 e=t.that,i=this;if(!e._viewer.scene.globe.depthTestAgainstTerrain)return alert("请开启深度检测"),!1;var n=t.viewHeight||10,a=L.Cartographic.fromCartesian(t.center);try{var r=t.radius,o={};o.semiMinorAxis=r,o.semiMajorAxis=r,o.rotation=0,o.center=t.center,o.granularity=Math.PI/45;let s=e.computeEllipseEdgePositions(o);for(let t=0;t<s.outerPositions.length;t+=3){let r=new L.Cartesian3(s.outerPositions[t],s.outerPositions[t+1],s.outerPositions[t+2]),o=L.Cartographic.fromCartesian(r),l=5e-5*Math.PI/180,c=e.computeInterpolateLineCartographic(a,o,l);e.computeCartographicPointsTerrainData(c,(function(t){if(t.length>0){let a=!0,r=[],o=[];for(let i=1;i<t.length;i++){let s=!0;if(i>1){let r=new L.Cartographic(t[0].longitude,t[0].latitude,t[0].height+n);if(a){e.computeInterpolateIndexLineHeightCartographic(r,t[i],i,i-1).height>=t[i-1].height?(a=!0,s=!0):(a=!1,s=!1)}else{let n=e.computeInterpolateIndexLineHeightCartographic(r,t[i],i,i-1);for(let e=0;e<n.length;e++){if(!(n[e].height>=t[e].height)){a=!1,s=!1;break}a=!0,s=!0}}}let l=L.Cartesian3.fromRadians(t[i].longitude,t[i].latitude,t[i].height+1);r.push(l),s?(o.push(0),o.push(0),o.push(1),o.push(1)):(o.push(1),o.push(0),o.push(0),o.push(1))}i._pointsKSYResult=new L.Scene.PointsPrimitive({viewer:e._viewer,Cartesians:r,Colors:o})}else alert("高程异常!")}))}}catch(t){console.log(t)}Q.prototype.remove=function(){}}function J(t){if(t&&t.positions){var e=t.positions,i=t.that;!function(t,e){for(var n=[L.Cartographic.fromCartesian(t)],a=new L.Cartesian3,o=[0],s=[0],l=0,c=1;c<=10;c++){L.Cartesian3.lerp(t,e,c/10,a);var h=L.Cartographic.fromCartesian(a),x=i._viewer.scene.globe.getHeight(h);h.height=x,n.push(h);var d=n[c-1],u=L.Cartesian3.distance(L.Cartographic.toCartesian(d),L.Cartographic.toCartesian(h));s.push(s[c-1]+u),l=Math.asin((h.height-d.height)/u),o.push(100*Math.tan(l))}var p=document.createElement("div");p.className="echart-viewer",i._viewer.container.appendChild(p,"dark",{renderer:"canvas",width:640,height:480}),p.style.position="absolute",p.style.left="20px",p.style.bottom="20px",p.style.height="300px",p.style.width="640px",p.style.overflow="hidden",p.style.zIndex="9999",p.style.opacity=.9;var g=r.init(p),m={title:{text:"剖面示意图",left:"center",subtext:"",textStyle:{color:"white",fontSize:15}},tooltip:{trigger:"axis"},legend:{data:[""]},toolbox:{show:!1,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:s,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:o,markPoint:{data:[{type:"max",name:"最大值"},{type:"min",name:"最小值"}]},markLine:{data:[{type:"average",name:"平均值"}]}}]};g.setOption(m)}(i.transformWGS84ToCartesian(e[0]),i.transformWGS84ToCartesian(e[1]))}}function O(t){if(t&&t.positions&&t.that){var e=t.that,i=t.positions,n=!0,a=this;!function(){var t=e._viewer.terrainProvider.availability;if(!t)return alert("未获取到地形"),!1;for(var o=15e3,s=0;s<i.length;s++){var l=L.Cartographic.fromCartesian(i[s]),c=e._viewer.scene.globe.getHeight(l);o>c&&(o=c);t.computeMaximumLevelAtPosition(l)}var h=Math.PI/Math.pow(2,11);h/=64;var x,d,u,p,g,m,f,v,y,b,C,w,I,A,_=new L.PolygonGeometry.fromPositions({positions:i,vertexFormat:L.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:h}),G=new L.PolygonGeometry.createGeometry(_),W=0,P=0,Z=new L.Cartesian3;for(s=0;s<G.indices.length;s+=3)if(x=G.indices[s],d=G.indices[s+1],u=G.indices[s+2],A=G.attributes.position.values,Z.x=A[3*x],Z.y=A[3*x+1],Z.z=A[3*x+2],l=L.Cartographic.fromCartesian(Z),p=e._viewer.scene.globe.getHeight(l),f=L.Cartesian3.fromRadians(l.longitude,l.latitude,p),b=L.Cartesian3.fromRadians(l.longitude,l.latitude,0),P<p&&(P=p),Z.x=A[3*d],Z.y=A[3*d+1],Z.z=A[3*d+2],l=L.Cartographic.fromCartesian(Z),g=e._viewer.scene.globe.getHeight(l),v=L.Cartesian3.fromRadians(l.longitude,l.latitude,g),C=L.Cartesian3.fromRadians(l.longitude,l.latitude,0),P<g&&(P=g),Z.x=A[3*u],Z.y=A[3*u+1],Z.z=A[3*u+2],l=L.Cartographic.fromCartesian(Z),m=e._viewer.scene.globe.getHeight(l),y=L.Cartesian3.fromRadians(l.longitude,l.latitude,m),w=L.Cartesian3.fromRadians(l.longitude,l.latitude,0),P<m&&(P=m),I=r(b,C,w),W+=I*(p-o+g-o+m-o)/3,n){var M=[];M.push(f),M.push(v),M.push(y);var S={polygon:{hierarchy:{positions:M},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(S)}var V=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)}var r=0,o=0,s=0,l=0,c=0,h=0,x=0,d=0;for(n=0;n<t.length;n++)r=e[n],o=i[n],n==t.length-1?(s=e[0],l=i[0]):(s=e[n+1],l=i[n+1]),c+=h=r*l-s*o,x+=(r+s)*h,d+=(o+l)*h;return x/=6*(c*=.5),d/=6*c,new L.Cartographic(x,d)}(i);a._volumeLabel=e._analysisLayer.entities.add({position:L.Cartesian3.fromRadians(V.longitude,V.latitude,P+1e3),label:{text:"Cut Volume "+W.toString()+"m3"}})}()}function r(t,e,i){var n=L.Cartesian3.distance(t,e),a=L.Cartesian3.distance(e,i),r=L.Cartesian3.distance(i,t),o=(n+a+r)/2;return Math.sqrt(o*(o-n)*(o-a)*(o-r))}}U.prototype={createVisibilityAnalysis:function(t){t=t||{};var e=this;e.drawLineGraphics({type:"straightLine",clampToGround:!1,callback:function(i,n){var a=new H({positions:i,that:e});e._graphicsLayer&&e._graphicsLayer.entities.remove(n),"function"==typeof t.callback&&t.callback(a)}})},createLookAroundAnalysis:function(t){if(t=t||{},this._viewer&&t){var e=this;e.drawCircleGraphics({callback:function(i,n){e._drawLayer.entities.remove(n);let a=new Q({that:e,radius:i.radius,center:i.center});"function"==typeof t.callback&&t.callback(a)}})}},createVisualFieldAnalysis:function(t){if(t=t||{},this._viewer&&t){var e=this,i=null;e.bindHandelEvent({leftClick:function(t,n){var a=e._viewer.scene.pickPosition(t.position);if(!a)return!1;L.defined(i)?(n.destroy(),n=null):(i=new L.Scene.ShadowPrimitive({scene:e._viewer.scene,viewerPosition:a}),e._analysisLayer._primitives.add(i))},mouseMove:function(t){var n=e._viewer.scene.pickPosition(t.endPosition);if(!n)return!1;i&&i.setPoseByTargetPoint(n)}})}},createClipPlanAnalysis:function(t){if(t=t||{},this._viewer&&t){var e=this,i=t.height||30,n=t.splitNum||50,a=t.wallImg||this.getDfSt(["amalysis","createClipPlanAnalysis_wallImg"])||"static/data/images/file/excavate_side_min.jpg",r=t.bottomImg||this.getDfSt(["amalysis","createClipPlanAnalysis_bottomImg"])||"static/data/images/file/excavate_bottom_min.jpg";e.drawPolygonGraphics({callback:function(o,s){e._drawLayer.entities.remove(s);let l=new L.Scene.TerrainClipPlan(e._viewer,{height:i,splitNum:n,wallImg:a,bottomImg:r});const c=e.transformWGS84ArrayToCartesianArray(o);l.updateData(c),"function"==typeof t.callback&&t.callback(l)}})}},createSubmergedAnalysis:function(t){if(t=t||{},this._viewer&&t){var e=this,i=t.maxH||15,n=t.speed||1,a=t.interval||10,r=this.getDfSt(["amalysis","createSubmergedAnalysis"])||"static/data/images/file/water.png";e.drawPolygonGraphics({height:1,callback:function(t,o){if(!e._viewer.scene.globe.depthTestAgainstTerrain)return alert("请开启深度检测"),!1;o&&setTimeout(()=>{o.polygon.heightReference="CLAMP_TO_GROUND",o.polygon.material=r;var t=0;o.polygon.extrudedHeight=t;var e=setInterval((function(){(t+=n)>=i&&(t=i,clearTimeout(e)),o.polygon.extrudedHeight=t}),a)},2e3)}})}},createSlopeAnalysis:function(t){if(t=t||{},!r)return alert("需要引入echarts库"),!1;var e=this;this._viewer&&t&&e.drawLineGraphics({type:"straightLine",clampToGround:!1,callback:function(i,n){var a=new J({positions:i,that:e});e._graphicsLayer&&e._graphicsLayer.entities.remove(n),"function"==typeof t.callback&&t.callback(a)}})},createCutVolumeAnalysis:function(t){if(t=t||{},this._viewer&&t){var e=this;e.drawWallGraphics({callback:function(i){var n=new O({positions:e.transformWGS84ArrayToCartesianArray(i,100),that:e});"function"==typeof t.callback&&t.callback(n)}})}}};var j={version:"1.0.0",PlotUtils:{}};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],a=[n[0]-t[1]+e[1],n[1]+t[0]-e[0]],r=[(t[0]+i[0])/2,(t[1]+i[1])/2],o=[r[0]-t[1]+i[1],r[1]+t[0]-i[0]];return j.PlotUtils.getIntersectPoint(n,a,r,o)},j.PlotUtils.getIntersectPoint=function(t,e,i,n){if(t[1]==e[1]){var a=(n[0]-i[0])/(n[1]-i[1]),r=a*(t[1]-i[1])+i[0],o=t[1];return[r,o]}if(i[1]==n[1]){var s=(e[0]-t[0])/(e[1]-t[1]);return[r=s*(i[1]-t[1])+t[0],o=i[1]]}return s=(e[0]-t[0])/(e[1]-t[1]),a=(n[0]-i[0])/(n[1]-i[1]),[r=s*(o=(s*t[1]-t[0]-a*i[1]+i[0])/(s-a))-s*t[1]+t[0],o]},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){var n=j.PlotUtils.getAzimuth(e,t)-j.PlotUtils.getAzimuth(e,i);return 0>n?n+j.Constants.TWO_PI:n},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){var r=j.PlotUtils.getAzimuth(t,e),o=a?r+i:r-i,s=n*Math.cos(o),l=n*Math.sin(o);return[e[0]+s,e[1]+l]},j.PlotUtils.getArcPoints=function(t,e,i,n){var a,r,o=[],s=n-i;s=0>s?s+j.Constants.TWO_PI:s;for(var l=0;l<=j.Constants.FITTING_COUNT;l++){var c=i+s*l/j.Constants.FITTING_COUNT;a=t[0]+e*Math.cos(c),r=t[1]+e*Math.sin(c),o.push([a,r])}return o},j.PlotUtils.getBisectorNormals=function(t,e,i,n){var a=j.PlotUtils.getNormal(e,i,n),r=Math.sqrt(a[0]*a[0]+a[1]*a[1]),o=a[0]/r,s=a[1]/r,l=j.PlotUtils.distance(e,i),c=j.PlotUtils.distance(i,n);if(r>j.Constants.ZERO_TOLERANCE)if(j.PlotUtils.isClockWise(e,i,n)){var h=t*l,x=i[0]-h*s,d=i[1]+h*o,u=[x,d];h=t*c;var p=[x=i[0]+h*s,d=i[1]-h*o]}else h=t*l,u=[x=i[0]+h*s,d=i[1]-h*o],h=t*c,p=[x=i[0]-h*s,d=i[1]+h*o];else u=[x=i[0]+t*(e[0]-i[0]),d=i[1]+t*(e[1]-i[1])],p=[x=i[0]+t*(n[0]-i[0]),d=i[1]+t*(n[1]-i[1])];return[u,p]},j.PlotUtils.getNormal=function(t,e,i){var n=t[0]-e[0],a=t[1]-e[1],r=Math.sqrt(n*n+a*a);n/=r,a/=r;var o=i[0]-e[0],s=i[1]-e[1],l=Math.sqrt(o*o+s*s);return[n+(o/=l),a+(s/=l)]},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],s=j.PlotUtils.getBisectorNormals(t,a,r,o);i=i.concat(s)}var l=j.PlotUtils.getRightMostControlPoint(e);i.push(l);var c=[];for(n=0;n<e.length-1;n++){a=e[n],r=e[n+1],c.push(a);for(t=0;t<j.Constants.FITTING_COUNT;t++){var h=j.PlotUtils.getCubicValue(t/j.Constants.FITTING_COUNT,a,i[2*n],i[2*n+1],r);c.push(h)}c.push(r)}return c},j.PlotUtils.getLeftMostControlPoint=function(e){var i=e[0],n=e[1],a=e[2],r=j.PlotUtils.getBisectorNormals(0,i,n,a)[0],o=j.PlotUtils.getNormal(i,n,a);if(Math.sqrt(o[0]*o[0]+o[1]*o[1])>j.Constants.ZERO_TOLERANCE)var s=j.PlotUtils.mid(i,n),l=i[0]-s[0],c=i[1]-s[1],h=2/j.PlotUtils.distance(i,n),x=-h*c,d=h*l,u=x*x-d*d,p=2*x*d,g=d*d-x*x,m=r[0]-s[0],f=r[1]-s[1],v=s[0]+u*m+p*f,y=s[1]+p*m+g*f;else v=i[0]+t*(n[0]-i[0]),y=i[1]+t*(n[1]-i[1]);return[v,y]},j.PlotUtils.getRightMostControlPoint=function(e){var i=e.length,n=e[i-3],a=e[i-2],r=e[i-1],o=j.PlotUtils.getBisectorNormals(0,n,a,r)[1],s=j.PlotUtils.getNormal(n,a,r);if(Math.sqrt(s[0]*s[0]+s[1]*s[1])>j.Constants.ZERO_TOLERANCE)var l=j.PlotUtils.mid(a,r),c=r[0]-l[0],h=r[1]-l[1],x=2/j.PlotUtils.distance(a,r),d=-x*h,u=x*c,p=d*d-u*u,g=2*d*u,m=u*u-d*d,f=o[0]-l[0],v=o[1]-l[1],y=l[0]+p*f+g*v,b=l[1]+g*f+m*v;else y=r[0]+t*(a[0]-r[0]),b=r[1]+t*(a[1]-r[1]);return[y,b]},j.PlotUtils.getBezierPoints=function(t){if(t.length<=2)return t;for(var e=[],i=t.length-1,n=0;1>=n;n+=.01){for(var a=0,r=0,o=0;i>=o;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(1>=t)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;t>=i;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;i>=n;n++)for(var a=0;1>=a;a+=.05){for(var r=0,o=0,s=0;2>=s;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};var K={version:"1.0.0",createTime:"2018.6.19",author:"xupinhui"},q="doublearrow",$=.25,tt=.3,et=.85,it=.15,nt={headHeightFactor:.18,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15,tailWidthFactor:.1,headTailFactor:.8,swallowTailFactor:1},at={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,this.tempPoint4=null,this.points=t;var i={controlPoint:null,polygonalPoint:null};if(!(2>(l=t.length))){if(2==l)return t;var n,a,r=this.points[0],o=this.points[1],s=this.points[2],l=t.length;this.tempPoint4=3==l?K.algorithm.getTempPoint4(r,o,s):this.points[3],this.connPoint=3==l||4==l?j.PlotUtils.mid(r,o):this.points[4],j.PlotUtils.isClockWise(r,o,s)?(n=K.algorithm.getArrowPoints(r,this.connPoint,this.tempPoint4,!1),a=K.algorithm.getArrowPoints(this.connPoint,o,s,!0)):(n=K.algorithm.getArrowPoints(o,this.connPoint,s,!1),a=K.algorithm.getArrowPoints(this.connPoint,r,this.tempPoint4,!0));var c=n.length,h=(c-5)/2,x=n.slice(0,h),d=n.slice(h,h+5),u=n.slice(h+5,c),p=a.slice(0,h),g=a.slice(h,h+5),m=a.slice(h+5,c);p=j.PlotUtils.getBezierPoints(p);var f=j.PlotUtils.getBezierPoints(m.concat(x.slice(1)));u=j.PlotUtils.getBezierPoints(u);var v=p.concat(g,f,d,u),y=K.algorithm.array2Dto1D(v);i.controlPoint=[r,o,s,this.tempPoint4,this.connPoint],i.polygonalPoint=e.Cartesian3.fromDegreesArray(y)}return i},K.algorithm.threeArrow=function(t){this.connPoint=null,this.tempPoint4=null,this.tempPoint5=null,this.points=t;var e={controlPoint:null,polygonalPoint:null};if((i=t.length)>=2){if(2==i)return t;var i,n,a,r=this.points[0],o=this.points[1],s=this.points[2];3==(i=t.length)?(this.tempPoint4=K.algorithm.getTempPoint4(r,o,s),this.tempPoint5=j.PlotUtils.mid(s,this.tempPoint4)):(this.tempPoint4=this.points[3],this.tempPoint5=this.points[4]),this.connPoint=i<6?j.PlotUtils.mid(r,o):this.points[5],j.PlotUtils.isClockWise(r,o,s)?(n=K.algorithm.getArrowPoints(r,this.connPoint,this.tempPoint4,!1),a=K.algorithm.getArrowPoints(this.connPoint,o,s,!0)):(n=K.algorithm.getArrowPoints(o,this.connPoint,s,!1),a=K.algorithm.getArrowPoints(this.connPoint,r,this.tempPoint4,!0));var l=n.length,c=(l-5)/2,h=n.slice(0,c),x=n.slice(c,c+5),d=n.slice(c+5,l),u=a.slice(0,c),p=a.slice(c,c+5),g=a.slice(c+5,l);u=j.PlotUtils.getBezierPoints(u);var m=j.PlotUtils.getBezierPoints(g.concat(h.slice(1)));d=j.PlotUtils.getBezierPoints(d);var f=u.concat(p,m,x,d),v=K.algorithm.array2Dto1D(f);e.controlPoint=[r,o,s,this.tempPoint4,this.tempPoint5,this.connPoint],e.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(v)}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=$,this.headWidthFactor=tt,this.neckHeightFactor=et,this.neckWidthFactor=it;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),l=[a,o=j.PlotUtils.getThirdPoint(a,o,j.Constants.HALF_PI,r/5,n),s=j.PlotUtils.getThirdPoint(a,s,j.Constants.HALF_PI,r/4,n),i],c=K.algorithm.getArrowHeadPoints(l,this.headHeightFactor,this.headWidthFactor,this.neckHeightFactor,this.neckWidthFactor),h=c[0],x=c[4],d=j.PlotUtils.distance(t,e)/j.PlotUtils.getBaseLength(l)/2,u=K.algorithm.getArrowBodyPoints(l,h,x,d),p=u.length,g=u.slice(0,p/2),m=u.slice(p/2,p);return g.push(h),m.push(x),(g=g.reverse()).push(e),(m=m.reverse()).push(t),g.reverse().concat(c,m)},K.algorithm.getArrowHeadPoints=function(t,e,i){this.type=q,this.headHeightFactor=$,this.headWidthFactor=tt,this.neckHeightFactor=et,this.neckWidthFactor=it;var n=j.PlotUtils.getBaseLength(t)*this.headHeightFactor,a=t[t.length-1],r=(j.PlotUtils.distance(e,i),n*this.headWidthFactor),o=n*this.neckWidthFactor,s=n*this.neckHeightFactor,l=j.PlotUtils.getThirdPoint(t[t.length-2],a,0,n,!0),c=j.PlotUtils.getThirdPoint(t[t.length-2],a,0,s,!0),h=j.PlotUtils.getThirdPoint(a,l,j.Constants.HALF_PI,r,!1),x=j.PlotUtils.getThirdPoint(a,l,j.Constants.HALF_PI,r,!0);return[j.PlotUtils.getThirdPoint(a,c,j.Constants.HALF_PI,o,!1),h,a,x,j.PlotUtils.getThirdPoint(a,c,j.Constants.HALF_PI,o,!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 x=j.PlotUtils.getAngleOfThreePoints(t[h-1],t[h],t[h+1])/2,d=(r/2-(s+=j.PlotUtils.distance(t[h-1],t[h]))/a*o)/Math.sin(x),u=j.PlotUtils.getThirdPoint(t[h-1],t[h],Math.PI-x,d,!0),p=j.PlotUtils.getThirdPoint(t[h-1],t[h],x,d,!1);l.push(u),c.push(p)}return l.concat(c)},K.algorithm.getTempPoint4=function(t,e,i){var n,a,r,o,s=j.PlotUtils.mid(t,e),l=j.PlotUtils.distance(s,i),c=j.PlotUtils.getAngleOfThreePoints(t,s,i);return c<j.Constants.HALF_PI?(a=l*Math.sin(c),r=l*Math.cos(c),o=j.PlotUtils.getThirdPoint(t,s,j.Constants.HALF_PI,a,!1),n=j.PlotUtils.getThirdPoint(s,o,j.Constants.HALF_PI,r,!0)):c>=j.Constants.HALF_PI&&c<Math.PI?(a=l*Math.sin(Math.PI-c),r=l*Math.cos(Math.PI-c),o=j.PlotUtils.getThirdPoint(t,s,j.Constants.HALF_PI,a,!1),n=j.PlotUtils.getThirdPoint(s,o,j.Constants.HALF_PI,r,!1)):c>=Math.PI&&c<1.5*Math.PI?(a=l*Math.sin(c-Math.PI),r=l*Math.cos(c-Math.PI),o=j.PlotUtils.getThirdPoint(t,s,j.Constants.HALF_PI,a,!0),n=j.PlotUtils.getThirdPoint(s,o,j.Constants.HALF_PI,r,!0)):(a=l*Math.sin(2*Math.PI-c),r=l*Math.cos(2*Math.PI-c),o=j.PlotUtils.getThirdPoint(t,s,j.Constants.HALF_PI,a,!0),n=j.PlotUtils.getThirdPoint(s,o,j.Constants.HALF_PI,r,!1)),n},K.algorithm.tailedAttackArrow=function(t,e){t=K.algorithm.dereplication(t),this.tailWidthFactor=nt.tailWidthFactor,this.swallowTailFactor=nt.swallowTailFactor,this.swallowTailPnt=nt.swallowTailPnt;var i={controlPoint:null,polygonalPoint:null};if(i.controlPoint=t,!(2>(g=t.length))){if(2==t.length)return i.polygonalPoint=t,i;var n=t,a=n[0],r=n[1];j.PlotUtils.isClockWise(n[0],n[1],n[2])&&(a=n[1],r=n[0]);var o=[j.PlotUtils.mid(a,r)].concat(n.slice(2)),s=K.algorithm.getAttackArrowHeadPoints(o,a,r,nt),l=s[0],c=s[4],h=j.PlotUtils.distance(a,r),x=j.PlotUtils.getBaseLength(o),d=x*this.tailWidthFactor*this.swallowTailFactor;this.swallowTailPnt=j.PlotUtils.getThirdPoint(o[1],o[0],0,d,!0);var u=h/x,p=K.algorithm.getAttackArrowBodyPoints(o,l,c,u),g=p.length,m=[a].concat(p.slice(0,g/2));m.push(l);var f,v=[r].concat(p.slice(g/2,g));v.push(c),m=j.PlotUtils.getQBSplinePoints(m),v=j.PlotUtils.getQBSplinePoints(v),f=K.algorithm.array2Dto1D(m.concat(s,v.reverse(),[this.swallowTailPnt,m[0]])),i.polygonalPoint=e.Cartesian3.fromDegreesArray(f)}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 a=j.PlotUtils.getBaseLength(t),r=a*this.headHeightFactor,o=t[t.length-1];a=j.PlotUtils.distance(o,t[t.length-2]);var s=j.PlotUtils.distance(e,i);r>s*this.headTailFactor&&(r=s*this.headTailFactor);var l=r*this.headWidthFactor,c=r*this.neckWidthFactor,h=(r=r>a?a:r)*this.neckHeightFactor,x=j.PlotUtils.getThirdPoint(t[t.length-2],o,0,r,!0),d=j.PlotUtils.getThirdPoint(t[t.length-2],o,0,h,!0),u=j.PlotUtils.getThirdPoint(o,x,j.Constants.HALF_PI,l,!1),p=j.PlotUtils.getThirdPoint(o,x,j.Constants.HALF_PI,l,!0);return[j.PlotUtils.getThirdPoint(o,d,j.Constants.HALF_PI,c,!1),u,o,p,j.PlotUtils.getThirdPoint(o,d,j.Constants.HALF_PI,c,!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 x=j.PlotUtils.getAngleOfThreePoints(t[h-1],t[h],t[h+1])/2,d=(r/2-(s+=j.PlotUtils.distance(t[h-1],t[h]))/a*o)/Math.sin(x),u=j.PlotUtils.getThirdPoint(t[h-1],t[h],Math.PI-x,d,!0),p=j.PlotUtils.getThirdPoint(t[h-1],t[h],x,d,!1);l.push(u),c.push(p)}return l.concat(c)},K.algorithm.dereplication=function(t){var e=t[t.length-1],i=!1,n=[];return n=t.filter((function(t){if(t[0]!=e[0]&&t[1]!=e[1])return t;i=!0})),i&&n.push(e),n},K.algorithm.fineArrow=function(t,e,i){if(t.length<2||e.length<2)return;let n=at.tailWidthFactor,a=at.neckWidthFactor,r=at.headWidthFactor,o=at.headAngle,s=at.neckAngle;var l=[];l[0]=t,l[1]=e;var c=l[0],h=l[1],x=j.PlotUtils.getBaseLength(l),d=x*n,u=x*a,p=x*r,g=j.PlotUtils.getThirdPoint(h,c,j.Constants.HALF_PI,d,!0),m=j.PlotUtils.getThirdPoint(h,c,j.Constants.HALF_PI,d,!1),f=j.PlotUtils.getThirdPoint(c,h,o,p,!1),v=j.PlotUtils.getThirdPoint(c,h,o,p,!0),y=j.PlotUtils.getThirdPoint(c,h,s,u,!1),b=j.PlotUtils.getThirdPoint(c,h,s,u,!0),C=[];C.push(g[0],g[1],y[0],y[1],f[0],f[1],h[0],h[1],v[0],v[1],b[0],b[1],m[0],m[1],c[0],c[1]);return C.some(t=>isNaN(t))?"":i.Cartesian3.fromDegreesArray(C)};let rt=null;function ot(t,e){this.viewer=t,rt=e,this.handler=new rt.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.fillMaterial=rt.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}ot.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},ot.prototype.disableHandler=function(){this.handler&&(this.handler.destroy(),this.handler=new rt.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)};let st=null;var lt=function(t,e){ot.call(this,t,e),st=e,this.type="AttackArrow",this.fillMaterial=st.Color.RED.withAlpha(.5)};function ct(t,e){var i=e.camera.getPickRay(t);return i?e.scene.globe.pick(i,e.scene):null}lt.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 st.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(t){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var e=this;this.state=1,this.handler||(this.handler=new st.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction((function(t){var i;if(i=ct(t.position,e.viewer)){0==e.positions.length&&(e.floatPoint=e.creatPoint(i),e.floatPoint.wz=-1),e.positions.push(i);var n=e.creatPoint(i);e.positions.length>2?n.wz=e.positions.length-1:n.wz=e.positions.length,e.pointArr.push(n)}}),st.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction((function(i){var n;!e.floatPoint||e.positions.length<2||(n=ct(i.endPosition,e.viewer))&&(e.floatPoint.position.setValue(n),e.positions.length>=2&&(st.defined(e.arrowEntity)?(e.positions.pop(),e.positions.push(n)):(e.positions.push(n),e.arrowEntity=e.showArrowOnMap(e.positions),e.arrowEntity.objId=e.objId,t&&t(e.objId))))}),st.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction((function(t){var i;if(i=ct(t.position,e.viewer)){for(var n=0;n<e.pointArr.length;n++)e.pointArr[n].show=!1;e.floatPoint.show=!1,e.viewer.entities.remove(e.floatPoint),e.floatPoint=null;var a=e.creatPoint(i);a.show=!1,a.wz=e.positions.length,e.pointArr.push(a),e.positions=[],e.pointArr=[],e.arrowEntity=null}}),st.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=st.Cartesian3.fromDegrees(t[i][0],t[i][1]);e.push(n)}this.positions=e;for(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 t=this,e=0;e<t.pointArr.length;e++)t.pointArr[e].show=!0;this.modifyHandler||(this.modifyHandler=new st.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction((function(e){var i=t.viewer.scene.pick(e.position);if(st.defined(i)&&i.id)t.clickStep++,i.id.objId||(t.selectPoint=i.id);else{for(var n=0;n<t.pointArr.length;n++)t.pointArr[n].show=!1;t.floatPoint&&(t.floatPoint.show=!1),t.state=-1,t.modifyHandler.destroy(),t.modifyHandler=null}if(2==t.clickStep){var a;if(t.clickStep=0,!(a=ct(e.position,t.viewer)))return;t.selectPoint&&(t.selectPoint.position.setValue(a),t.selectPoint=null)}}),st.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction((function(e){var i;(i=ct(e.endPosition,t.viewer))&&t.selectPoint&&(t.selectPoint.position.setValue(i),t.positions[t.selectPoint.wz-1]=i)}),st.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){var e=this.viewer.entities.add({position:t,point:{pixelSize:10,color:st.Color.YELLOW}});return e.attr="editPoint",e},showArrowOnMap:function(t){var e=this;return this.viewer.entities.add({id:e.objId,polygon:new st.PolygonGraphics({hierarchy:new st.CallbackProperty((function(){if(t.length<3)return null;for(var i=[],n=0;n<t.length;n++){var a=e.cartesianToLatlng(t[n]);i.push(a)}var r=e.xp.algorithm.tailedAttackArrow(i,st),o=[];return-1==JSON.stringify(r.polygonalPoint).indexOf("null")&&(o=r.polygonalPoint),new st.PolygonHierarchy(o)}),!1),show:!0,fill:!0,material:e.fillMaterial})})},cartesianToLatlng:function(t){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(t),i=st.Math.toDegrees(e.latitude);return[st.Math.toDegrees(e.longitude),i]}},(lt.prototype=Object.create(Object.assign({},lt.prototype,ot.prototype))).constructor=lt;let ht=null;var xt=function(t,e){ot.call(this,t,e),ht=e,this.type="StraightArrow",this.fillMaterial=ht.Color.fromCssColorString("#0000FF").withAlpha(.8)};function dt(t,e){var i=e.camera.getPickRay(t);return i?e.scene.globe.pick(i,e.scene):null}xt.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 ht.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(t){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var e=this;this.state=1,this.handler.setInputAction((function(t){var i;(i=dt(t.position,e.viewer))&&(0==e.positions.length&&(e.firstPoint=e.creatPoint(i),e.firstPoint.type="firstPoint",e.floatPoint=e.creatPoint(i),e.floatPoint.type="floatPoint",e.positions.push(i)),e.firstPoint.position.setValue(i),e.firstPoint.show=!0,e.positions&&3==e.positions.length&&(e.firstPoint.show=!1,e.positions=[],e.pointArr=[],e.arrowEntity=null),e.positions.push(i.clone()))}),ht.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction((function(i){var n;e.positions.length<1||(n=dt(i.endPosition,e.viewer))&&(e.floatPoint.position.setValue(n),e.positions.length>=2&&(ht.defined(e.arrowEntity)?(e.positions.pop(),e.positions.push(n)):(e.positions.push(n),e.arrowEntity=e.showArrowOnMap(e.positions),t&&t(e.objId))))}),ht.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction((function(t){var i;(i=dt(t.position,e.viewer))&&(e.firstPoint.show=!1,e.positions=[],e.pointArr=[],e.arrowEntity=null,e.positions.push(i.clone()))}),ht.ScreenSpaceEventType.RIGHT_CLICK)},startModify:function(){this.state=2,this.firstPoint.show=!0,this.floatPoint.show=!0;var t=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new ht.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction((function(e){var i=t.viewer.scene.pick(e.position);if(ht.defined(i)&&i.id?(t.clickStep++,i.id.objId||(t.selectPoint=i.id)):(t.modifyHandler.destroy(),t.modifyHandler=null,t.firstPoint.show=!1,t.floatPoint.show=!1,t.state=-1),2==t.clickStep){var n;if(t.clickStep=0,!(n=dt(e.position,t.viewer)))return;t.selectPoint&&(t.selectPoint.position.setValue(n),t.selectPoint=null)}}),ht.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction((function(e){var i;t.selectPoint&&((i=dt(e.endPosition,t.viewer))&&(t.selectPoint.position.setValue(i),"firstPoint"==t.selectPoint.type&&(t.positions[1]=i),"floatPoint"==t.selectPoint.type&&(t.positions[2]=i)))}),ht.ScreenSpaceEventType.MOUSE_MOVE)},createByData:function(t){this.state=-1,this.positions=[];for(var e=[],i=0;i<t.length;i++){var n=ht.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){var e=this.viewer.entities.add({position:t,point:{pixelSize:10,color:ht.Color.YELLOW}});return e.attr="editPoint",e},showArrowOnMap:function(t){var e=this;return this.viewer.entities.add({id:e.objId,polygon:new ht.PolygonGraphics({hierarchy:new ht.CallbackProperty((function(){if(t.length<2)return null;var i=t[1],n=t[2],a=e.cartesianToLatlng(i),r=e.cartesianToLatlng(n),o=[],s=e.xp.algorithm.fineArrow([a[0],a[1]],[r[0],r[1]],ht);if(-1!=JSON.stringify(s).indexOf("null"))return[];for(var l=0;l<s.length;l++){var c=new ht.Cartesian3(s[l].x,s[l].y,s[l].z);o.push(c)}return new ht.PolygonHierarchy(o)}),!1),show:!0,fill:!0,material:e.fillMaterial})})},cartesianToLatlng:function(t){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(t),i=ht.Math.toDegrees(e.latitude);return[ht.Math.toDegrees(e.longitude),i]}},(xt.prototype=Object.create(Object.assign({},xt.prototype,ot.prototype))).constructor=xt;let ut=null;var pt=function(t,e){ot.call(this,t,e),ut=e,this.type="PincerArrow",this.fillMaterial=ut.Color.YELLOW.withAlpha(.8)};function gt(t,e){var i=e.camera.getPickRay(t);return i?e.scene.globe.pick(i,e.scene):null}pt.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 ut.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(t){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var e=this;this.state=1,this.handler.setInputAction((function(t){var i;if(i=gt(t.position,e.viewer))if(0==e.positions.length&&(e.floatPoint=e.creatPoint(i)),e.positions.length>4){(a=e.creatPoint(i)).wz=e.positions.length,e.pointArr.push(a);for(var n=0;n<e.pointArr.length;n++)e.pointArr[n].show=!1;e.floatPoint&&(e.floatPoint.show=!1,e.viewer.entities.remove(e.floatPoint),e.floatPoint=null),e.positions=[],e.pointArr=[],e.arrowEntity=null}else{e.positions.push(i);var a=e.creatPoint(i);e.positions.length>2?a.wz=e.positions.length-1:a.wz=e.positions.length,e.pointArr.push(a)}}),ut.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction((function(i){var n;!e.floatPoint||e.positions.length<2||(n=gt(i.endPosition,e.viewer))&&(e.floatPoint.position.setValue(n),e.positions.length>=2&&(ut.defined(e.arrowEntity)?(e.positions.pop(),e.positions.push(n)):(e.positions.push(n),e.arrowEntity=e.showArrowOnMap(e.positions),e.arrowEntity.objId=e.objId,t&&t(e.objId))))}),ut.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction((function(t){if(e.positions.length>=4){var i;if(!(i=gt(t.position,e.viewer)))return;for(var n=0;n<e.pointArr.length;n++)e.pointArr[n].show=!1;e.floatPoint.show=!1,e.viewer.entities.remove(e.floatPoint),e.floatPoint=null;var a=e.creatPoint(i);a.show=!1,a.wz=e.positions.length,e.pointArr.push(a),e.positions=[],e.pointArr=[],e.arrowEntity=null}}),ut.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=ut.Cartesian3.fromDegrees(t[i][0],t[i][1]);e.push(n)}this.positions=e;for(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 t=this,e=0;e<t.pointArr.length;e++)t.pointArr[e].show=!0;this.modifyHandler||(this.modifyHandler=new ut.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction((function(e){var i=t.viewer.scene.pick(e.position);if(ut.defined(i)&&i.id)t.clickStep++,i.id.objId||(t.selectPoint=i.id);else{for(var n=0;n<t.pointArr.length;n++)t.pointArr[n].show=!1;t.state=-1,t.modifyHandler.destroy(),t.modifyHandler=null}if(2==t.clickStep){var a;if(t.clickStep=0,!(a=gt(e.position,t.viewer)))return;t.selectPoint&&(t.selectPoint.position.setValue(a),t.selectPoint=null)}}),ut.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction((function(e){var i;(i=gt(e.endPosition,t.viewer))&&t.selectPoint&&(t.selectPoint.position.setValue(i),t.positions[t.selectPoint.wz-1]=i)}),ut.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:ut.Color.YELLOW}})},showArrowOnMap:function(t){var e=this;return this.viewer.entities.add({id:e.objId,polygon:new ut.PolygonGraphics({hierarchy:new ut.CallbackProperty((function(){if(t.length<3)return null;for(var i=[],n=0;n<t.length;n++){var a=e.cartesianToLatlng(t[n]);i.push(a)}var r=e.xp.algorithm.doubleArrow(i,ut),o=[];return-1==JSON.stringify(r.polygonalPoint).indexOf("null")&&(o=r.polygonalPoint),new ut.PolygonHierarchy(o)}),!1),show:!0,fill:!0,material:e.fillMaterial})})},cartesianToLatlng:function(t){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(t),i=ut.Math.toDegrees(e.latitude);return[ut.Math.toDegrees(e.longitude),i]}},(pt.prototype=Object.create(Object.assign({},pt.prototype,ot.prototype))).constructor=pt;function mt({cesiumGlobal:t,containerId:e,viewerConfig:i={},extreaConfig:n={},MapImageryList:a=[],defaultStatic:r}){const o=new s(t).init({containerId:e,viewerConfig:i,extreaConfig:n,MapImageryList:a}),l=function(t,e,i){return function(n,a){var r=null;function o(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(n)?(n.forEach(t=>{o(t)}),r=new a(t,e,i),n.forEach(n=>{n.call(r,t,e,i)})):(o(n),r=new a(t,e,i),n.call(r,t,e,i)),r}}(o,t,r);return{viewer:o,material:l([m,u],d),graphics:l(m,c),math3d:l(m,y),primitive:l(m,C),draw:l([m,y,_],I),passEffect:l([m,u],W),customCesiumPlugin:l(m,R),control:l(m,Y),plugin:l(m,E),base:new m(o,t),analysis:l([m,I,E],U),attackArrowObj:new lt(o,t),straightArrowObj:new xt(o,t),pincerArrowObj:new pt(o,t)}}export{mt as initCesium};
|
|
1
|
+
import e from"libgif";import*as i from"@turf/turf";import{GUI as n}from"dat.gui";import r from"echarts";let o=null;class s{constructor(t){o=t,this.init_data()}init_data(){this.viewer=null}init({containerId:t,viewerConfig:e,extreaConfig:i,MapImageryList:n}){const a=t;let r=new o.SingleTileImageryProvider({url:"https://mapv-data.oss-cn-hangzhou.aliyuncs.com/Cesium-1.82-hawk/background.png"});0!==n.length&&(r=this.setOneimageryProvider(n[0]));let s={imageryProvider:r,contextOptions:{webgl:{alpha:!1}},animation:!1,timeline:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,selectionIndicator:!1,shadow:!0,sceneMode:o.SceneMode.SCENE3D,infoBox:!1,sceneModePicker:!1,navigationHelpButton:!1,projectionPicker:!1,baseLayerPicker:!1,shouldAnimate:!0,navigation:!1,showRenderLoopErrors:!0};s=Object.assign(s,e);const l=new o.Viewer(a,s);if(!i.logo){l.cesiumWidget.creditContainer.style.display="none"}return i.depthTest&&(l.scene.globe.depthTestAgainstTerrain=!0),this.setConfigMapList(l,n),this.removeJagged(l),this.viewer=l,l}setOneimageryProvider(t){var e;return t.classConfig.customTags&&(t.classConfig.customTags=(e="("+t.classConfig.customTags+")",new Function("return "+e)())),new o[t.type](t.classConfig)}setConfigMapList(t,e){const i=t.imageryLayers;e.some((t,e)=>{if(0===e)return!1;i.addImageryProvider(this.setOneimageryProvider(t))}),e.some((e,i)=>{const n=t.imageryLayers.get(i);e.interfaceConfig&&Object.getOwnPropertyNames(e.interfaceConfig).forEach((function(t){n[t]=e.interfaceConfig[t]})),n.invertColor=e.invertswitch,n.filterRGB=[255,255,255],"#000000"!==e.filterRGB&&"#ffffff"!==e.filterRGB&&(n.filterRGB=function(t){let e=t.toLowerCase();if(/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(e)){if(4===e.length){let t="#";for(let i=1;i<4;i+=1)t+=e.slice(i,i+1).concat(e.slice(i,i+1));e=t}const t=[];for(let i=1;i<7;i+=2)t.push(parseInt("0x"+e.slice(i,i+2)));return t}return[]}(e.filterRGB));const a=e.offset.split(",");if(2===a.length)try{const t=[parseFloat(a[0]),parseFloat(a[1])];n._imageryProvider._tilingScheme._rectangleNortheastInMeters.x+=t[0],n._imageryProvider._tilingScheme._rectangleNortheastInMeters.y+=t[1]}catch(t){console.log(t)}this.changeImageryProviderColors(t,n)})}removeJagged(t){t.scene.postProcessStages.fxaa.enabled=!1,t.scene.fxaa=!1;if(t.cesiumWidget._supportsImageRenderingPixelated){let e=window.devicePixelRatio;for(;e>=2;)e/=2;t.resolutionScale=e}}changeImageryProviderColors(t,e){const i=t.scene.globe._surfaceShaderSet.baseFragmentShaderSource.sources;for(let t=0;t<i.length;t++){const n=i[t],a="color = czm_saturation(color, textureSaturation);\n#endif\n";let r="color = czm_saturation(color, textureSaturation);\n#endif\n";e.invertColor&&(r+="\n color.r = 1.0 - color.r;\n color.g = 1.0 - color.g;\n color.b = 1.0 - color.b;\n ",r+=`\n color.r = color.r * ${e.filterRGB[0]}.0/255.0;\n color.g = color.g * ${e.filterRGB[1]}.0/255.0;\n color.b = color.b * ${e.filterRGB[2]}.0/255.0;\n `),-1!==n.indexOf(a)&&(i[t]=i[t].replace(a,r))}}getCurCenterlonLat(t){let e=t.camera.pickEllipsoid(new o.Cartesian2(t.canvas.clientWidth/2,t.canvas.clientHeight/2)),i=o.Ellipsoid.WGS84.cartesianToCartographic(e);return{lon:180*i.longitude/Math.PI,lat:180*i.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){if(t=t||{}){var e=t.radii||1e6;return 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){let e=[];for(let i in t.positions){let n=t.positions[i],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)),e.push(this._graphicsLayer.entities.add(a))}return e}},createLineGraphics:function(t){if(t&&t.positions){var e=this.createGraphics();return e.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){if(t=t||{}){var e=this.createGraphics();return e.polygon=this.getPolygonGraphics(t),e.clampToS3M=t.clampToS3M||!1,this._graphicsLayer.entities.add(e)}},createBoxGraphics:function(t){if(t=t||{}){var e=this.createGraphics();return e.position=t.position,e.name=t.name||"box_graphic",e.box=this.getBoxGraphics(t.box),this._graphicsLayer.entities.add(e)}},createModelGraphics:function(t){if(t&&t.position){var e=this.createGraphics();return e.model=this.getModelGraphics(t),e.position=t.position,this._graphicsLayer.entities.add(e)}},craeteCorridorGraphics:function(t){if(t&&t.positions){var e=this.createGraphics();return e.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){if(t&&t.positions){var e=this.createGraphics();return e.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 e={};if(t&&t.cylinder){var i=t.entity,n=t.cylinder,a=this;return e.cylinder=this.getCylinderGraphics(n),e.position=new l.CallbackProperty((function(){var t=i.position.getValue(a._viewer.clock.currentTime),e=a._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),n=l.Math.toDegrees(e.latitude),r=l.Math.toDegrees(e.longitude);return l.Cartesian3.fromDegrees(r,n,0)}),!1),e.cylinder.length=new l.CallbackProperty((function(){var t=i.position.getValue(a._viewer.clock.currentTime);return 2*a._viewer.scene.globe.ellipsoid.cartesianToCartographic(t).height}),!1),e}},createFadeCylinderGraphics:function(t){if((t=t||{})&&t.position){let e=this.createGraphics();return e.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){if(t&&t.position){var e=this.createGraphics();return e.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){if(t&&t.position){var e=this.createGraphics(),i=t.alp||1,n=t.flog||!0;return 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):(i+=.05)>=1&&(n=!0),l.Color.RED.withAlpha(i)}),!1))},this._graphicsLayer.entities.add(e)}},craeteDynamicCricleGraphics:function(t){if(t&&t.center){var e=this.createGraphics(),i=this,n=t.center,a=t.radius||800,r=t.rotateAmount||.05,o=0,s=t.height||1,c=t.scale||null,h=t.scale2||null,x=t.material||new l.ImageMaterialProperty({image:t.imge||this.getDfSt(["graphic","craeteDynamicCricleGraphics"])||"static/data/images/Textures/circle_bg.png",transparent:!0});e.position=new l.CallbackProperty((function(){return i.transformWGS84ToCartesian(n)}),!1),e.orientation=new l.CallbackProperty((function(){return l.Transforms.headingPitchRollQuaternion(i.transformWGS84ToCartesian(n),new l.HeadingPitchRoll(l.Math.toRadians(0),l.Math.toRadians(0),l.Math.toRadians(0)))}),!1);let d=a,u=!1;return e.ellipse={material:x,height:s,semiMajorAxis:new l.CallbackProperty((function(){return a}),!1),semiMinorAxis:new l.CallbackProperty((function(){return a}),!1),stRotation:new l.CallbackProperty((function(){return r>0&&(o+=r)>=360&&(o=0),c&&((a>=c||a<=d)&&(u=!u),u?a+=2:a-=2),h&&(h>=a?a+=2:a=d),o}),!1)},this._graphicsLayer.entities.add(e)}},craeteDynamicShadeWallGraphics:function(t){if(t&&t.positions){var e=t.alp||1,i=t.num||20,n=t.color||l.Color.RED,a=t.speed||.003,r=this.createGraphics();return r.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||e>=1)&&i++,n.withAlpha(e)}),!1)})},this._graphicsLayer.entities.add(r)}},createCustomDefBillboardGraphics:function(t){if(t&&t.position){var e=this,i=document.createElement("img");i.src=t.img||this.getDfSt(["graphic","createCustomDefBillboardGraphics"])||"static/data/images/file/div1.png";const n=function(t){if(t.image){var e=document.createElement("canvas");e.width=t.width||150,e.height=t.height||80;var i=e.getContext("2d");i.drawImage(t.image,0,0);var n=t.text;return i.font="15px bold 宋体",i.fillStyle="#f4fff0",i.fillText(n,55,36),e}};i.onload=function(){t.image=i;var a=e._graphicsLayer.entities.add({position:t.position,billboard:{image:n(t),scaleByDistance:new l.NearFarScalar(150,.7,15e6,.5),verticalOrigin:l.VerticalOrigin.BOTTOM,pixelOffset:t.b_pixelOffset||new l.Cartesian2(80,-35),width:140,height:100,scale:t.b_scale||1.5,disableDepthTestDistance:Number.POSITIVE_INFINITY,imageSubRegion:{x:0,y:0,width:200,height:150}}});"function"==typeof t.callback&&t.callback(a)}}},craeteRotatePlaneGraphics:function(t){if(t&&t.center&&t.positions){var e=this.createGraphics(),i=0,n=t.positions,a=n[0];return 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){if(t&&t.position){var e=this.createGraphics();return e.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){if(e&&t&&t.position){var i=[],n=t.url,a=0;return function(t,i){var n=document.createElement("img");n.src=t,n.setAttribute("rel:animated_src",t),n.setAttribute("rel:auto_play","0"),document.body.appendChild(n);var a=new e({gif:n});return new Promise(t=>{a.load(()=>{for(let t=1;t<=a.get_length();t++)a.move_to(t),i.push(a.get_canvas().toDataURL());t(i)})})}(n,i),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){if(t&&t.entity&&t.rotateAmount){var 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 i>0&&(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,i=t.minHeiht||5,n=t.maxHeiht||100,a=t.cartesians,r=t.speed||.06,o=this,s=i,c=!1;a.length?e.positions=new l.CallbackProperty((function(){var t=o.transformCartesianArrayToWGS84Array(a);for(var e in t){var l=t[e];(i>=n||i<=s)&&(c=!c),c?i+=r:i-=r,l.alt=i}return o.transformWGS84ArrayToCartesianArray(t)}),!1):e.position=new l.CallbackProperty((function(){var t=o.transformCartesianToWGS84(a);return(i>=n||i<=s)&&(c=!c),c?i+=r:i-=r,t.alt=i,o.transformWGS84ToCartesian(t)}),!1)}catch(t){console.log(t)}},createCanvasGraphics:function(t){if(t&&t.positions){const e=function(){var e=0,i=document.createElement("canvas"),n=i.getContext("2d"),a=new Image;if(a.src=t.img||"../../images/ysCesium/logo.png",n.clearRect(0,0,t.cwidth,t.cheight),!(e<=t.cwidth))return e=0,e+=3,i;n.drawImage(a,e,0)};this._graphicsLayer.entities.add({rectangle:{coordinates:t.positions,material:new l.ImageMaterialProperty({image:new l.CallbackProperty(e,!1),transparent:!0})}}),"function"==typeof t.callback&&t.callback()}}};let x=null;function d(t,e,i){t&&(x=e,this._installMaterial())}function u(){}d.prototype={addMaterialLineGraphics:function(t){if(this._viewer&&t&&t.image){this._initPolylineCustomMaterialProperty(t);var e=this.createGraphics();return e.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(t){if(t){var e=x.Color,i=x.defaultValue,n=x.defined,a=Object.defineProperties,r=x.Event,o=x.createPropertyDescriptor,s=x.Property,l=x.Material,c=e.WHITE,h=t.MaterialType||"wallType"+parseInt(1e3*Math.random());const d=function(t){t=i(t,i.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(e,i){return n(i)||(i={}),i.color=s.getValueOrClonedDefault(this._color,e,c,i.color),i.image=t.image,void 0===this._time&&(this._time=e.secondsOfDay),i.time=1e3*(e.secondsOfDay-this._time)/this.duration,i},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:t.color||new x.Color(1,0,0,.5),image:t.image,time:t.color.time||0},source:this._getDynamicLineShader({get:!0})},translucent:function(){return!0}}),new d(t)}},addMaterialWallGraphics:function(t){if(this._viewer&&t&&t.image){this._initWallCustomMaterialProperty(t);var e=this.createGraphics();return e.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(t){var e=x.Color,i=x.defaultValue,n=x.defined,a=Object.defineProperties,r=x.Event,o=x.createPropertyDescriptor,s=x.Property,l=x.Material,c=t.MaterialType||"wallType"+parseInt(1e3*Math.random());const h=function(t){t=i(t,i.EMPTY_OBJECT),this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=t.color||e.BLUE,this.duration=t.duration||3e3,this._time=(new Date).getTime()};return a(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(i,a){return n(a)||(a={}),a.color=s.getValueOrClonedDefault(this._color,i,e.WHITE,a.color),a.image=t.image,a.time=((new Date).getTime()-this._time)%this.duration/this.duration,a},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 e(1,0,0,.5),image:t.image,time:0},source:this._getDirectionWallShader({get:!0,count:t.count,freely:t.freely,direction:t.direction})},translucent:function(){return!0}}),x.Scene.WallLinkCustomMaterialProperty=h,new h(t)},_installMaterial:function(){this._installWaveCircleMaterial(),this._installCircleFadeMaterial(),this._installCityLineMaterial(),this._installWarnMaterial(),this._installFlowMaterial()},_installWaveCircleMaterial:function(){var t=x.Color,e=x.defaultValue,i=Object.defineProperties,n=x.Event,a=x.Property,r=x.Material;function o(i){i=i||{},this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._duration=void 0,this._durationSubscription=void 0,this.color=e(i.color,t.fromBytes(0,255,255,255)),this.duration=e(i.duration,45),this.count=Math.max(e(i.count,2),1),this.gradient=e(i.gradient,.1),this.gradient<0?this.gradient=0:this.gradient>1&&(this.gradient=1)}i(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={}),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)},i(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 t(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={}),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 i(e)||(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 t=x.Color,e=x.defaultValue,i=x.defined,n=Object.defineProperties,a=x.Event,r=x.createPropertyDescriptor,o=x.Property,s=x.Material;function l(i){i=e(i,e.EMPTY_OBJECT),this._definitionChanged=new a,this._color=void 0,this._colorSubscription=void 0,this.color=i.color||t.BLUE,this.duration=i.duration||3e3,this._time=(new Date).getTime()}n(l.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),l.prototype.getType=function(){return s.WarnLinkType},l.prototype.getValue=function(e,n){return i(n)||(n={}),n.color=o.getValueOrClonedDefault(this._color,e,t.WHITE,n.color),n.image=s.WarnLinkImage,n.time=((new Date).getTime()-this._time)%this.duration/this.duration,n},l.prototype.equals=function(t){return this===t||t instanceof l&&o.equals(this._color,t._color)},n(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 t(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 t=x.Color,e=x.defaultValue,i=Object.defineProperties,n=x.Event,a=x.createPropertyDescriptor,r=x.Property,o=x.Material;function s(i){i=e(i,e.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this.color=i.color||t.fromBytes(0,255,255,255),this._duration=void 0,this._durationSubscription=void 0,this.duration=e(i.duration,45)}i(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={}),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)},i(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 t(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){if(t&&t.get){var e="czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n \n ";return"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 ",e+=" 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 out vec2 v_textureCoordinates;\n uniform vec4 u_scanCenterEC;\n uniform vec3 u_scanPlaneNormalEC;\n uniform vec3 u_scanLineNormalEC;\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 gl_FragColor = 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 gl_FragColor = mix(gl_FragColor, u_scanColor, f + f0);\n } else {\n gl_FragColor = mix(gl_FragColor, u_scanColor, f);\n }\n }\n }\n "},_getCircleScanShader:function(t){if(t&&t.get)return"uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n out vec2 v_textureCoordinates;\n uniform vec4 u_scanCenterEC;\n uniform vec3 u_scanPlaneNormalEC;\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 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 gl_FragColor = 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 gl_FragColor = mix(gl_FragColor, 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){const e=t.reduce((t,e)=>t?t[e]:g[e],void 0);return g.baseService+e}},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){t=t||{};return this._viewer.scene.postProcessStages.add(new p.PostProcessStage({name:"darkEffect",fragmentShader:"uniform sampler2D colorTexture;\nout vec2 v_textureCoordinates;\nuniform float scale;\nuniform vec3 offset;\nvoid main() {\n // vec4 color = texture(colorTexture, v_textureCoordinates);\n vec4 color = texture(colorTexture, v_textureCoordinates);\n // float gray = 0.2989*color.r+0.5870*color.g+0.1140*color.b;\n // gl_FragColor = vec4(gray,gray,2.0*(gray+1.0), 1.0);\n gl_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\nout 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);\ngl_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 out 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 gl_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 out vec2 v_textureCoordinates;\n \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 gl_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; \nout 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 gl_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){if(this._viewer&&t&&t.position){if(t.distance){var 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){if(this._viewer&&t&&t.position){if(t.distance){var 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){var e=p.Ellipsoid.WGS84.cartesianToCartographic(t);return{lng:p.Math.toDegrees(e.longitude),lat:p.Math.toDegrees(e.latitude),alt:e.height}}},transformWGS84ArrayToCartesianArray:function(t,e){if(this._viewer&&t){var i=this;return 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){if(this._viewer){var e=this;return t?t.map((function(t){return e.transformCartesianToWGS84(t)})):[]}},setCameraEotateHeading(t){if(t){let e=this._viewer,i=p.Cartesian3.fromDegrees(t.lng,t.lat,t.height),n=p.Math.toRadians(-30),a=12,r=5e3,o=p.JulianDate.fromDate(new Date);e.clock.startTime=o.clone(),e.clock.currentTime=o.clone(),e.clock.clockRange=p.ClockRange.CLAMPED,e.clock.clockStep=p.ClockStep.SYSTEM_CLOCK;let s=e.camera.heading,l=function(){let t=p.JulianDate.secondsDifference(e.clock.currentTime,e.clock.startTime),o=p.Math.toRadians(t*a)+s;e.scene.camera.setView({destination:i,orientation:{heading:o,pitch:n}}),e.scene.camera.moveBackward(r),p.JulianDate.compare(e.clock.currentTime,e.clock.stopTime)>=0&&e.clock.onTick.removeEventListener(l)};e.clock.onTick.addEventListener(l)}},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=this._viewer.scene.pick(t),i=null,n=!1,a=!1;if(e instanceof p.Cesium3DTileFeature&&(n=!0),n&&(i=this._viewer.scene.pickPosition(t))){let t=p.Cartographic.fromCartesian(i);t.height<0&&(t.height=0);let e=p.Math.toDegrees(t.longitude),n=p.Math.toDegrees(t.latitude),a=t.height;i=this.transformWGS84ToCartesian({lng:e,lat:n,alt:a})}if(!e){var r=this._viewer.scene.camera.getPickRay(t);if(!r)return null;i=this._viewer.scene.globe.pick(r,this._viewer.scene),a=!0}if(n||a||(i=this._viewer.scene.camera.pickEllipsoid(t,this._viewer.scene.globe.ellipsoid)),i){let t=this.transformCartesianToWGS84(i);return t.alt<0&&(i=this.transformWGS84ToCartesian(t,.1)),i}return!1}},getCameraPosition:function(){if(this._viewer){var t=this._viewer.scene.camera.pickEllipsoid(new p.Cartesian2(this._viewer.canvas.clientWidth/2,this._viewer.canvas.clientHeight/2));if(t){var e=p.Ellipsoid.WGS84.cartesianToCartographic(t),i=180*e.longitude/Math.PI,n=180*e.latitude/Math.PI,a=this._viewer.camera._direction,r=p.Math.toDegrees(a.x),o=p.Math.toDegrees(a.y),s=p.Math.toDegrees(a.z),l=this._viewer.camera.positionCartographic.height,c=p.Math.toDegrees(this._viewer.camera.heading),h=p.Math.toDegrees(this._viewer.camera.pitch),x=p.Math.toDegrees(this._viewer.camera.roll),d=this._viewer.camera.computeViewRectangle(),u=d.west/Math.PI*180,g=d.north/Math.PI*180,m=(u+d.east/Math.PI*180)/2,f=(g+d.south/Math.PI*180)/2;return{lon:i,lat:n,height:l,heading:c,pitch:h,roll:x,position:this._viewer.camera.position,cameraHeading:this._viewer.camera.heading,cameraPitch:this._viewer.camera.pitch,cameraRoll:this._viewer.camera.roll,center:{x:m,y:f},direction:new p.Cartesian3(r,o,s)}}}},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:t,mouseMove:e,doubleClick:i,leftDown:n,mouseWheel:a,leftUp:r}){if(this._viewer){var o=new p.ScreenSpaceEventHandler(this._viewer.canvas);t&&o.setInputAction((function(e){t(e,o)}),p.ScreenSpaceEventType.LEFT_CLICK),e&&o.setInputAction((function(t){e(t,o)}),p.ScreenSpaceEventType.MOUSE_MOVE),i&&o.setInputAction((function(t){i(t,o)}),p.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),n&&o.setInputAction((function(t){n(t,o)}),p.ScreenSpaceEventType.LEFT_DOWN),a&&o.setInputAction((function(t){a(t,o)}),p.ScreenSpaceEventType.WHEEL),r&&o.setInputAction((function(t){r(t,o)}),p.ScreenSpaceEventType.LEFT_UP)}},getHandelPosition:function(t){if(this._viewer){var e=new p.ScreenSpaceEventHandler(this._viewer.scene.canvas),i=this;e.setInputAction((function(n){var a=i._viewer.scene.camera.pickEllipsoid(n.endPosition,i._viewer.scene.globe.ellipsoid);"function"==typeof t&&t(i.transformCartesianToWGS84(a),e)}),p.ScreenSpaceEventType.MOUSE_MOVE)}},saveSceneImages:function(){if(this._viewer){const a=function(t){for(var e=t.split(","),i=e[0].match(/:(.*?);/)[1],n=atob(e[1]),a=n.length,r=new Uint8Array(a);a--;)r[a]=n.charCodeAt(a);return new Blob([r],{type:i})};var t=this._viewer.scene.canvas.toDataURL("image/png").replace("image/png","image/octet-stream"),e=document.createElement("a"),i=a(t),n=URL.createObjectURL(i);e.download="scene.png",e.href=n,e.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}}):t.url="https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",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 t="http://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}";function e(e){t=e.temp_url||t,this._url=t,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=e.style||"normal"}Object.defineProperties(e.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},tileWidth:{get:function(){if(!this.ready)throw new p.DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this.ready)throw new p.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this.ready)throw new p.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},minimumLevel:{get:function(){if(!this.ready)throw new p.DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get:function(){if(!this.ready)throw new p.DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this.ready)throw new p.DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},ready:{get:function(){return!!this._url}},credit:{get:function(){return this._credit}}}),e.prototype.requestImage=function(t,e,i){if(!this.ready)throw new p.DeveloperError("requestImage must not be called before the imagery provider is ready.");var n=this._tilingScheme.getNumberOfXTilesAtLevel(i),a=this._tilingScheme.getNumberOfYTilesAtLevel(i),r=this._url.replace("{x}",t-n/2).replace("{y}",a/2-e-1).replace("{z}",i).replace("{s}",1).replace("{style}",this._style);return p.ImageryProvider.loadImage(this,r)},p.Scene.BaiduImageryProvider=e},_installGroundSkyBox:function(){var t=p.BoxGeometry,e=p.Cartesian3,i=p.defaultValue,n=p.defined,a=p.destroyObject,r=p.DeveloperError,o=p.GeometryPipeline,s=p.Matrix3,l=p.Matrix4,c=p.Transforms,h=p.VertexFormat,x=p.BufferUsage,d=p.CubeMap,u=p.DrawCommand,g=p.loadCubeMap,m=p.RenderState,f=p.VertexArray,v=p.BlendingState,y=p.SceneMode,b=p.ShaderProgram,C=p.ShaderSource;function w(t){this.sources=t.sources,this._sources=void 0,this.show=i(t.show,!0),this._command=new u({modelMatrix:l.clone(l.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}n(l.getRotation)||(l.getRotation=l.getMatrix3);var I=new s;w.prototype.update=function(i,a){var s=this;if(this.show&&(i.mode===y.SCENE3D||i.mode===y.MORPHING)&&i.passes.render){var u=i.context;if(this._sources!==this.sources){this._sources=this.sources;var p=this.sources;if(!(n(p.positiveX)&&n(p.negativeX)&&n(p.positiveY)&&n(p.negativeY)&&n(p.positiveZ)&&n(p.negativeZ)))throw new r("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof p.positiveX!=typeof p.negativeX||typeof p.positiveX!=typeof p.positiveY||typeof p.positiveX!=typeof p.negativeY||typeof p.positiveX!=typeof p.positiveZ||typeof p.positiveX!=typeof p.negativeZ)throw new r("this.sources properties must all be the same type.");"string"==typeof p.positiveX?g(u,this._sources).then((function(t){s._cubeMap=s._cubeMap&&s._cubeMap.destroy(),s._cubeMap=t})):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new d({context:u,source:p}))}var w=this._command;if(w.modelMatrix=c.eastNorthUpToFixedFrame(i.camera._positionWC),!n(w.vertexArray)){w.uniformMap={u_cubeMap:function(){return s._cubeMap},u_rotateMatrix:function(){return l.getRotation(w.modelMatrix,I)}};var A=t.createGeometry(t.fromDimensions({dimensions:new e(2,2,2),vertexFormat:h.POSITION_ONLY})),_=this._attributeLocations=o.createAttributeLocations(A);w.vertexArray=f.fromGeometry({context:u,geometry:A,attributeLocations:_,bufferUsage:x._DRAW}),w.renderState=m.fromCache({blending:v.ALPHA_BLEND})}if(!n(w.shaderProgram)||this._useHdr!==a){var G=new C({defines:[a?"HDR":""],sources:["uniform samplerCube u_cubeMap;\n out vec3 v_texCoord;\n void main()\n {\n vec4 color = textureCube(u_cubeMap, normalize(v_texCoord));\n gl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n }\n "]});w.shaderProgram=b.fromCache({context:u,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:G,attributeLocations:this._attributeLocations}),this._useHdr=a}if(n(this._cubeMap))return w}},w.prototype.isDestroyed=function(){return!1},w.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(),a(this)},p.Scene.GroundSkyBox=w},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,l=180*r.latitude/Math.PI,c=180*o.longitude/Math.PI,h=180*o.latitude/Math.PI,x=Math.sqrt((s-c)*(s-c)+(l-h)*(l-h))*i,d=v.Cartesian3.clone(t),u=v.Cartesian3.clone(e),p=v.Cartesian3.distance(d,v.Cartesian3.ZERO),g=v.Cartesian3.distance(u,v.Cartesian3.ZERO);if(v.Cartesian3.normalize(d,d),v.Cartesian3.normalize(u,u),0==v.Cartesian3.distance(d,u))return a;var m=v.Cartesian3.angleBetween(d,u);a.push(t);for(var f=1;f<n-1;f++){var y=1*f/(n-1),b=1-y,C=Math.sin(b*m)/Math.sin(m),w=Math.sin(y*m)/Math.sin(m),I=v.Cartesian3.multiplyByScalar(d,C,new v.Cartesian3),A=v.Cartesian3.multiplyByScalar(u,w,new v.Cartesian3),_=v.Cartesian3.add(I,A,new v.Cartesian3),G=y*Math.PI,W=p*b+g*y+Math.sin(G)*x;_=v.Cartesian3.multiplyByScalar(_,W,_),a.push(_)}return a.push(e),a}},getPositionsAngle:function(t){if(t){var e,i=t.position1,n=t.position2,a=v.Transforms.eastNorthUpToFixedFrame(i),r=v.Matrix4.inverse(a,new v.Matrix4),o=v.Matrix4.multiplyByPoint(r,i,new v.Cartesian3),s=v.Matrix4.multiplyByPoint(r,n,new v.Cartesian3);"pitch"===t.type?e=Math.atan2(s.z-o.z,s.x-o.x):"heading "===t.type&&(e=Math.atan2(s.y-o.y,s.x-o.x));var l=e*(180/Math.PI);return l<0&&(l+=360),l}},getPositionsArea:function(t){let e=0;if(t){let i=0,n=v.Ellipsoid.WGS84;t.push(t[0]);for(let e=1;e<t.length;e++){let a=n.cartographicToCartesian(this.transformWGS84ToCartographic(t[e-1])),r=n.cartographicToCartesian(this.transformWGS84ToCartographic(t[e]));i+=a.x*r.y-r.x*a.y}e=Math.abs(i).toFixed(2)}return e},getPolygonArea:function(t){if(this._viewer){for(var e=function(t,e){var i=t.lat*radiansPerDegree,n=t.lon*radiansPerDegree,a=e.lat*radiansPerDegree,r=e.lon*radiansPerDegree,o=-Math.atan2(Math.sin(n-r)*Math.cos(a),Math.cos(i)*Math.sin(a)-Math.sin(i)*Math.cos(a)*Math.cos(n-r));return o<0&&(o+=2*Math.PI),o*=degreesPerRadian},i=0,n=0;n<t.length-2;n++){var a=(n+1)%t.length,r=(n+2)%t.length,o=(s=t[n],l=t[a],c=t[r],h=void 0,(h=e(l,s)-e(l,c))<0&&(h+=360),h);i+=this.getPositionsDistance(positions[n],positions[a])*this.getPositionsDistance(positions[a],positions[r])*Math.abs(Math.sin(o))}return(i/1e6).toFixed(4)}var s,l,c,h},getPointDistance:function(t,e){if(this._viewer){var i=v.Cartographic.fromCartesian(t),n=v.Cartographic.fromCartesian(e),a=new v.EllipsoidGeodesic;a.setEndPoints(i,n);var r=a.surfaceDistance;return r=Math.sqrt(Math.pow(r,2)+Math.pow(n.height-i.height,2))}},getPositionDistance:function(t){let e=0;for(let i=0;i<t.length-1;i++){let n=this.transformWGS84ToCartographic(t[i]),a=this.transformWGS84ToCartographic(t[i+1]),r=new v.EllipsoidGeodesic;r.setEndPoints(n,a);let o=r.surfaceDistance;o=Math.sqrt(Math.pow(o,2)+Math.pow(a.height-n.height,2)),e+=o}return e.toFixed(3)},getIntersectObj:function(t,e,i=[],n=!1){if(this._viewer){var a=v.Cartesian3.normalize(v.Cartesian3.subtract(e,t,new v.Cartesian3),new v.Cartesian3),r=new v.Ray(t,a),o=[];if(n)o=this._viewer.scene.drillPickFromRay(r,10,i);else{var s=this._viewer.scene.pickFromRay(r,i);v.defined(s)&&(o=[s])}return o}},getPointOnEllipsoid:function(t,e,i,n,a,r,o,s,l,c){if(this._viewer){var h=new v.Cartesian3,x=new v.Cartesian3,d=new v.Quaternion,u=new v.Matrix3,p=t+e;v.Cartesian3.multiplyByScalar(n,Math.cos(p),h),v.Cartesian3.multiplyByScalar(i,Math.sin(p),x),v.Cartesian3.add(h,x,h);var g=Math.cos(t);g*=g;var m=Math.sin(t);m*=m;var f=r/Math.sqrt(o*g+a*m)/s;return v.Quaternion.fromAxisAngle(h,f,d),v.Matrix3.fromQuaternion(d,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,h=i?t.length/3*2:t.length/3,x=new Float64Array(3*h),d=t.length,u=i?d:0,p=0;p<d;p+=3){var g=p+1,m=p+2,f=v.Cartesian3.fromArray(t,p,n);s.scaleToGeodeticSurface(f,f);var y=v.Cartesian3.clone(f,a),b=s.geodeticSurfaceNormal(f,o),C=v.Cartesian3.multiplyByScalar(b,l,r);v.Cartesian3.add(f,C,f),i&&(v.Cartesian3.multiplyByScalar(b,c,C),v.Cartesian3.add(y,C,y),x[p+u]=y.x,x[g+u]=y.y,x[m+u]=y.z),x[p]=f.x,x[g]=f.y,x[m]=f.z}return x}},computeEllipseEdgePositions:function(t){if(this._viewer){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,c=t.granularity&&"number"==typeof t.granularity?t.granularity:Math.PI/180;c>Math.PI/12&&(c=Math.PI/12),c<Math.PI/180&&(c=Math.PI/180);var h=r*r,x=o*o,d=o*r,u=v.Cartesian3.magnitude(l),p=v.Cartesian3.normalize(l,e),g=v.Cartesian3.cross(v.Cartesian3.UNIT_Z,l,i);g=v.Cartesian3.normalize(g,g);var m,f=v.Cartesian3.cross(p,g,n),y=Math.ceil(2*v.Math.PI/c),b=c,C=0,w=a,I=0,A=[];for(m=0;m<y;m++)C=m*b,w=this.getPointOnEllipsoid(C,s,f,g,h,d,x,u,p,w),A[I++]=w.x,A[I++]=w.y,A[I++]=w.z;var _={};return _.numPts=y,_.outerPositions=A,_}},computeSectorEdgePositions:function(t){if(this._viewer){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?t.angle:2*Math.PI,c=t.center,h=t.granularity&&"number"==typeof t.granularity?t.granularity:Math.PI/180;h>Math.PI/12&&(h=Math.PI/12),h<Math.PI/180&&(h=Math.PI/180);var x=r*r,d=o*o,u=o*r,p=v.Cartesian3.magnitude(c),g=v.Cartesian3.normalize(c,e),m=v.Cartesian3.cross(v.Cartesian3.UNIT_Z,c,i);m=v.Cartesian3.normalize(m,m);var f,y=v.Cartesian3.cross(g,m,n),b=Math.ceil(l/h),C=h,w=0,I=a,A=0,_=[];for(f=0;f<b;f++)w=f*C,I=this.getPointOnEllipsoid(w,s,y,m,x,u,d,p,g,I),_[A++]=I.x,_[A++]=I.y,_[A++]=I.z;var G={};return G.numPts=b,G.outerPositions=_,G}},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,e){if(this._viewer){if(t.length<=0)return;for(var i=[],n=0;n<t.length;n++)i.push(v.Cartesian3.fromRadians(t[n].longitude,t[n].latitude,t[n].height));var a=this._viewer.scene.clampToHeightMostDetailed(i),r=this;a.then((function(t){for(var i=[],n=r._viewer.scene.globe.ellipsoid,a=0;a<t.length;a++)i.push(n.cartesianToCartographic(t[a]));e(i)})).otherwise((function(t){console.log(t)}))}},_checkLonDegree:function(t){return!(t>180||t<-180)},_checkLatDegree:function(t){return!(t>90||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=[];i.push([t.lon,t.lat]);var n=Math.sqrt(Math.pow(e.lon-t.lon,2)+Math.pow(e.lat-t.lat,2));if(n<=1e-5)return i.push([e.lon,e.lat]),i;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=[];n.push(new v.Cartographic(t.longitude,t.latitude));var a=Math.sqrt(Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2)),r=i&&"number"==typeof i?i:1e-5*Math.PI/180;if(a<=r)return n.push(new v.Cartographic(e.longitude,e.latitude)),n;for(var o=a/r,s=(e.longitude-t.longitude)/o,l=(e.latitude-t.latitude)/o,c=0;c<o;c++){var h=t.longitude+(c+1)*s,x=t.latitude+(c+1)*l;n.push(new v.Cartographic(h,x))}return n.push(new v.Cartographic(e.longitude,e.latitude,e.height)),n},computeInterpolateLineHeightCartographic:function(t,e){if(!t||!e)return null;if(!(t.longitude&&t.latitude&&e.longitude&&e.latitude))return null;var i=[];i.push(new v.Cartographic(t.longitude,t.latitude,t.height));var n=Math.sqrt(Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2));if(n<=1e-5*Math.PI/180)return i.push(new v.Cartographic(e.longitude,e.latitude,e.height)),i;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,x=t.height+(l+1)*s;i.push(new v.Cartographic(c,h,x))}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,x=t.height+(l+1)*s;a.push(new v.Cartographic(c,h,x))}return a},computeInterpolateIndexLineHeightCartographic:function(t,e,i,n){if(!t||!e)return null;if(!(t.longitude&&t.latitude&&e.longitude&&e.latitude))return null;var a=(e.longitude-t.longitude)/i,r=(e.latitude-t.latitude)/i,o=(e.height-t.height)/i,s=t.longitude+n*a,l=t.latitude+n*r,c=t.height+n*o;return new v.Cartographic(s,l,c)}};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{var t=b.Cartesian3,e=b.ComponentDatatype,i=b.PrimitiveType,n=b.BoundingSphere,a=(b.GeometryAttribute,b.GeometryPipeline),r=b.Geometry,o=b.defined,s=b.RenderState,l=b.ShaderSource,c=b.ShaderProgram,h=b.DrawCommand,x=b.Pass,d=b.Appearance,u=b.BufferUsage,p=b.Color,g=b.VertexArray,m=b.buildModuleUrl,f=b.Matrix4,v=b.Matrix3,y=b.Texture,C=b.Resource,w=b.Transforms,I=b.defaultValue,A=this._viewer,_=this.getDfSt(["primitive","TetrahedronPrimitive"])||"static/data/images/Textures/fence.png";const G=function(e){this.show=!0,this._command=void 0,this._enuMatrix=void 0,this._scaleMatrix=void 0,this._localPosition=e.position,this._createCommand=W,this._angle=0,this._distance=I(e.distance,1),this._setInterval=void 0,this._viewer=A,this._speed=I(e.speed,1),this._color=I(e.color,new p(1,1,0,.8)),this._scale=I(e.scale,new t(10,10,15)),this._texture=void 0,this._imageUrl=m(_),this._modelMatrix=X(this),this._height=R(this),V(this)};G.prototype.update=function(t){this.show&&(o(this._command)||(this._command=this._createCommand(t.context,this),this._command.pickId="v_pickColor"),o(this._command)&&t.commandList.push(this._command))},G.prototype.isDestroyed=function(){return!1},G.prototype.destroy=function(){return o(this._command)&&(this._command.shaderProgram=this._command.shaderProgram&&this._command.shaderProgram.destroy()),destroyObject(this)},G.prototype.startAnimate=function(){let t=this;this._setInterval=setInterval((function(){t._angle=t._angle+.01,Math.sin(t._angle)>0?t._height=.01:t._height=-.01;let e=new b.Cartesian3(0,0,t._height);f.multiplyByTranslation(t._modelMatrix,e,t._modelMatrix);let i=f.fromRotationTranslation(v.fromRotationZ(b.Math.toRadians(t._speed)));f.multiply(t._modelMatrix,i,t._modelMatrix)}),5)},G.prototype.closeAnimate=function(){clearInterval(this._setInterval)};const W=function(t,e){var n=M(),a=S(),r=d.getDefaultRenderState(!1,!0,void 0),u=s.fromCache(r),p=new l({sources:[n]}),g=new l({sources:[a]}),m={color:function(){return e._color},myImage:function(){return o(e._texture)?e._texture:e._viewer.scene.context.defaultTexture}};var f=c.fromCache({context:t,vertexShaderSource:p,fragmentShaderSource:g,attributeLocations:{position:0,textureCoordinates:1}});return new h({vertexArray:P(t),primitiveType:i.TRIANGLES,renderState:u,shaderProgram:f,uniformMap:m,owner:this,pass:x.TRANSLUCENT,modelMatrix:e._modelMatrix})},P=function(t){var o=Z(),s=new r({attributes:{position:new GeometryAttribute({componentDatatype:e.FLOAT,componentsPerAttribute:3,values:o.positions}),textureCoordinates:new GeometryAttribute({componentDatatype:e.FLOAT,componentsPerAttribute:2,values:o.sts})},indices:o.indices,primitiveType:i.TRIANGLES,boundingSphere:n.fromVertices(o.positions)}),l=a.computeNormal(s);return g.fromGeometry({context:t,geometry:l,attributeLocations:{position:0,textureCoordinates:1},bufferUsage:u.STATIC_DRAW})},Z=function(){var t=new Float64Array(15);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;var e=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"\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; // position in eye coordinates\n v_normalEC = czm_normal * normal; // normal in eye coordinates\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"\n out vec3 v_positionEC;\n out vec3 v_normalEC;\n out vec2 v_st;\n uniform vec4 color;\n out 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 gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n #else\n gl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n #endif\n }\n "},V=function(t){C.createIfNeeded(t._imageUrl).fetchImage().then((function(e){var i,n=t._viewer.scene.context;i=o(e.internalFormat)?new y({context:n,pixelFormat:e.internalFormat,width:e.naturalWidth,height:e.naturalHeight,source:{arrayBufferView:e.bufferView}}):new y({context:n,source:e}),t._texture=i}))},X=function(t){let 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},R=function(e){let i=t.fromElements(0,0,e._distance,new b.Cartesian3),n=b.Matrix4.multiplyByPoint(e._enuMatrix,i,new t),a=f.multiplyByPoint(e._viewer.scene.camera._viewMatrix,n,new t),r=f.multiplyByPoint(e._viewer.scene.camera.frustum.projectionMatrix,a,new t);return t.normalize(r,new t).z};b.Scene.TetrahedronPrimitive=G}catch(t){console.log(t)}},_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._build()}t.prototype={_build(){this._createAxisXYZ(),this._bindHandler()},remove(){this._layer._primitives.removeAll(),this._handler.distory()},_createAxisXYZ:function(){this._model.readyPromise.then(t=>{const e=b.Matrix4.getTranslation(t.modelMatrix,new b.Cartesian3),i=t.boundingSphere,n=i.radius,a=new b.ArrowPolylinePrimitive({id:"axisZ",color:b.Color.RED,position:e,width:3,headWidth:5,length:2*n+50,headLength:10}),r=new b.ArrowPolylinePrimitive({id:"axisX",color:b.Color.GREEN,position:e,width:3,headWidth:5,length:2*n+50,headLength:10}),o=new b.ArrowPolylinePrimitive({id:"axisY",color:b.Color.BLUE,position:e,width:3,headWidth:5,length:2*n+50,headLength:10}),s=b.Matrix3.fromRotationY(b.Math.toRadians(90));this._rotationX=b.Matrix4.fromRotationTranslation(s),b.Matrix4.multiply(r.geometryInstances[0].modelMatrix,this._rotationX,r.geometryInstances[0].modelMatrix),b.Matrix4.multiply(r.geometryInstances[1].modelMatrix,this._rotationX,r.geometryInstances[1].modelMatrix);const l=b.Matrix3.fromRotationX(b.Math.toRadians(90));this._rotationY=b.Matrix4.fromRotationTranslation(l),b.Matrix4.multiply(o.geometryInstances[0].modelMatrix,this._rotationY,o.geometryInstances[0].modelMatrix),b.Matrix4.multiply(o.geometryInstances[1].modelMatrix,this._rotationY,o.geometryInstances[1].modelMatrix),this._layer._primitives.add(a),this._layer._primitives.add(r),this._layer._primitives.add(o),this._radius=i.radius,this._createAxisSphere()})},_createAxisSphere:function(){const t=[];for(let e=0;e<=360;e+=3){const i=Math.sin(b.Math.toRadians(e)),n=Math.cos(b.Math.toRadians(e)),a=this._radius*n,r=this._radius*i;t.push(new b.Cartesian3(a,r,0))}const e=this._createAxisSpheres("axisSphereZ",t,this._matrix,b.Color.RED);this._layer._primitives.add(e);const i=this._createAxisSpheres("axisSphereY",t,this._matrix,b.Color.GREEN);this._layer._primitives.add(i),b.Matrix4.multiply(i.geometryInstances.modelMatrix,this._rotationY,i.geometryInstances.modelMatrix);const n=this._createAxisSpheres("axisSphereX",t,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){const a=new b.PolylineGeometry({positions:e,width:10}),r=new b.GeometryInstance({geometry:a,id:t,attributes:{color:b.ColorGeometryInstanceAttribute.fromColor(n)}});return new b.Primitive({geometryInstances:r,appearance:new b.PolylineColorAppearance({translucent:!1}),modelMatrix:i})},_updateAxis(t){if(this._layer){let e=this._layer._primitives._primitives;for(let i=1,n=e.length;i<n;i++){let n=e[i];const a=b.Matrix4.fromTranslation(new b.Cartesian3(t.x,t.y,t.z));b.Matrix4.multiply(n.modelMatrix,a,n.modelMatrix)}}const e=b.Matrix4.fromTranslation(new b.Cartesian3(t.x,t.y,t.z));b.Matrix4.multiply(this._model.modelMatrix,e,this._model.modelMatrix)},_updateAxisSphere(t){if(this._layer){let e=this._layer._primitives._primitives;for(let i=1,n=e.length;i<n;i++){let n=e[i];const a=b.Matrix4.fromRotationTranslation(t);b.Matrix4.multiply(n.modelMatrix,a,n.modelMatrix)}}const e=b.Matrix4.fromRotationTranslation(t);b.Matrix4.multiply(this._model.modelMatrix,e,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=>{let e=viewer.scene.pick(t.position);e&&e.id&&(this._xyzPid=e.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(){let t=function(t,e){const i=new b.Cartesian3;e.length?(i.x=e[0],i.y=e[1],i.z=e[2]):b.Cartesian3.clone(e,i);for(let e=0;e<t.attributes.position.values.length;e+=3)t.attributes.position.values[e]+=i.x,t.attributes.position.values[e+1]+=i.y,t.attributes.position.values[e+2]+=i.z};b.Scene.ArrowPolylinePrimitive=function(e={}){this._color=e.color||b.Color.RED,this._width=e.width||3,this._headWidth=e.headWidth||2*this._width,this._length=e.length||300,this._headLength=e.headLength||10,this._inverse=e.inverse||!1,this.position=e.position;const i=e.id,n=b.CylinderGeometry.createGeometry(new b.CylinderGeometry({length:this._length,topRadius:this._width,bottomRadius:this._width})),a=b.CylinderGeometry.createGeometry(new b.CylinderGeometry({length:this._headLength,topRadius:0,bottomRadius:this._headWidth}));let r=(this._length+this._headLength)/2;return this._inverse&&(r=-r),t(a,[0,0,r]),new b.Primitive({modelMatrix:b.Transforms.eastNorthUpToFixedFrame(this.position),geometryInstances:[new b.GeometryInstance({id:i+"-line",geometry:n}),new b.GeometryInstance({id:i+"-arrow",geometry:a})],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.");this._scene=e;var i=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();var n=new b.Cartesian3(0,0,100),a=b.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);b.Matrix4.multiplyByPoint(a,n,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(t,e){if(this.debugShow){var i=this.debugLightFrustum._planesPrimitives,n=this.debugLightFrustum._outlinePrimitives;i.forEach((function(e){e.show=t})),n.forEach((function(t){t.show=e}))}},t.prototype.update=function(t){if(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))));var 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,n,a,r=this._positions,o=b.Math.toRadians(this._horizontalFov),s=b.Math.toRadians(this._verticalFov),l=Math.tan(.5*o),c=Math.tan(.5*s);e=-(i=this._distance*l),n=-(a=this._distance*c);var h=new b.Cartesian3(e,n,-this._distance),x=new b.Cartesian3(i,a,0);b.Matrix4.multiplyByPoint(this._modelMatrix,h,h),b.Matrix4.multiplyByPoint(this._modelMatrix,x,x);var d=b.BoundingSphere.fromCornerPoints(h,x);if(t.cullingVolume.computeVisibility(d)!==Intersect.OUTSIDE){this._valid=!0;var u=0;r[u++]=0,r[u++]=0,r[u++]=0;for(var p,g,m=Math.PI-.5*o,f=o/4,v=0;v<5;++v){p=m+v*f;for(var y=a/(this._distance/Math.cos(p)),C=-(_=Math.atan(y)),w=_/10,I=0;I<21;++I)g=C+I*w,r[u++]=this._distance*Math.cos(g)*Math.sin(p),r[u++]=this._distance*Math.sin(g),r[u++]=this._distance*Math.cos(g)*Math.cos(p)}f=o/20;for(var A=0;A<21;++A){p=m+A*f;y=a/(this._distance/Math.cos(p)),C=-(_=Math.atan(y)),w=_/2;for(var _,G=0;G<5;++G)g=C+G*w,r[u++]=this._distance*Math.cos(g)*Math.sin(p),r[u++]=this._distance*Math.sin(g),r[u++]=this._distance*Math.cos(g)*Math.cos(p)}var W=t.context,P=b.Buffer.createIndexBuffer({context:W,typedArray:new Uint32Array(this._indices),usage:b.BufferUsage.STATIC_DRAW,indexDatatype:IndexDatatype.UNSIGNED_INT}),Z=b.Buffer.createVertexBuffer({context:W,typedArray:b.ComponentDatatype.createTypedArray(b.ComponentDatatype.FLOAT,this._positions),usage:b.BufferUsage.STATIC_DRAW}),M=[];M.push({index:0,vertexBuffer:Z,componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1});var S=new b.VertexArray({context:W,attributes:M,indexBuffer:P});if(b.defined(this._drawLineCommand))this._drawLineCommand.vertexArray.destroy(),this._drawLineCommand.vertexArray=S,this._drawLineCommand.modelMatrix=this._modelMatrix,this._drawLineCommand.boundingVolume=d;else{var V=b.ShaderProgram.fromCache({context:W,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 gl_FragColor = u_bgColor;\n }\n "}),X=b.RenderState.fromCache({depthTest:{enabled:!0}}),R=this,F={u_bgColor:function(){return R._lineColor},u_modelViewMatrix:function(){return W.uniformState.modelView}};this._drawLineCommand=new b.DrawCommand({boundingVolume:d,modelMatrix:R._modelMatrix,primitiveType:b.PrimitiveType.LINES,vertexArray:S,shaderProgram:V,castShadows:!1,receiveShadows:!1,uniformMap:F,renderState:X,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&&t.Cartesians.length>=2){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"out vec4 v_color; void main() { float d = distance(gl_PointCoord, vec2(0.5,0.5)); if(d < 0.5){ gl_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(){const t=function(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"out vec3 v_positionMC;\n out vec3 v_positionEC;\n out 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 gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n #else\n gl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n gl_FragColor.a = 0.5;\n #endif\n }\n "},C.prototype.updateDegreesPosition=function(t,e){if(null!=this.primitive&&(this._viewer.scene.primitives.remove(this.primitive),!(t&&t.length<3))){var i=this._createGeometry(t,e||0);this.primitive=this._viewer.scene.primitives.add(new b.Primitive({allowPicking:!1,geometryInstances:new b.GeometryInstance({geometry:i}),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"out 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); gl_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 t={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},e=this._viewer;function i(i){this._viewer=e,this._length=i.length||t.length,this._center=i.center||t.center,this._color=i.color||t.color,this._repeat=i.repeat||t.repeat,this._offset=i.offset||t.offset,this._thickness=i.thickness||t.thickness,this._bottom=i.bottom||t.bottom,this._top=i.top||t.top,this._radar=void 0,this.build()}i.prototype.build=function(){var t=new b.CylinderGeometry({length:this._length,topRadius:this._top,bottomRadius:this._bottom,vertexFormat:b.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat}),e=new b.GeometryInstance({geometry:t,modelMatrix:this.getModelMatrix()}),i=new b.MaterialAppearance({material:this.getMaterial(),faceForward:!1,closed:!0}),n=this;this._radar=this._viewer.scene.primitives.add(new b.Primitive({geometryInstances:[e],appearance:i})),this._viewer.scene.preUpdate.addEventListener((function(){var t=n._radar.appearance.material.uniforms.offset;(t-=.001)>1&&(t=0),n._radar.appearance.material.uniforms.offset=t}))},i.prototype.getModelMatrix=function(){return b.Matrix4.multiplyByTranslation(b.Transforms.eastNorthUpToFixedFrame(this._center),new b.Cartesian3(0,0,.5*this._length),new b.Matrix4)},i.prototype.updateModelMatrix=function(){},i.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})},i.prototype.remove=function(){this._radar&&this._viewer.scene.primitives.remove(this._radar)},b.Scene.ProbingPrimitive=i}};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(t){if((t=t||{}).style=t.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&&t){var e,i,n=new w.Entity,a=[],r=this,o=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);o.setInputAction((function(t){var i=r._viewer.scene.camera.pickEllipsoid(t.position,r._viewer.scene.globe.ellipsoid);i&&i.x&&(e=i,a.push(i))}),w.ScreenSpaceEventType.LEFT_CLICK),o.setInputAction((function(e){o.destroy(),o=null,"function"==typeof t.callback&&t.callback(r.transformCartesianArrayToWGS84Array(a),i)}),w.ScreenSpaceEventType.RIGHT_CLICK),n.billboard=t.style,n.position=new w.CallbackProperty((function(){return e}),!1),i=this._drawLayer.entities.add(n)}},drawLineGraphics:function(t){if(t=t||{},this._viewer&&t){var e,i=[],n=new w.Entity,a=this,r=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);r.setInputAction((function(n){var s=a.getCatesian3FromPX(n.position);s&&s.x&&(0==i.length&&i.push(s.clone()),t.measure&&o(s),2==i.length&&"straightLine"===t.type&&(r.destroy(),r=null,"function"==typeof t.callback&&t.callback(a.transformCartesianArrayToWGS84Array(i),e)),i.push(s))}),w.ScreenSpaceEventType.LEFT_CLICK),r.setInputAction((function(t){var e=a.getCatesian3FromPX(t.endPosition);i.length>=2&&e&&e.x&&(i.pop(),i.push(e))}),w.ScreenSpaceEventType.MOUSE_MOVE),r.setInputAction((function(n){r.destroy(),r=null;var s=a.getCatesian3FromPX(n.position);t.measure&&o(s),"function"==typeof t.callback&&t.callback(a.transformCartesianArrayToWGS84Array(i),e)}),w.ScreenSpaceEventType.RIGHT_CLICK),n.polyline={width:t.width||5,material:t.material||w.Color.BLUE.withAlpha(.8),clampToGround:t.clampToGround||!1,clampToS3M:t.clampToS3M||!1},n.polyline.positions=new w.CallbackProperty((function(){return i}),!1),e=this._drawLayer.entities.add(n);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(i))/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(t){if((t=t||{}).style=t.style||{width:3,material:w.Color.BLUE.withAlpha(.8),clampToGround:!0},this._viewer&&t){var e=[],i=new w.PolygonHierarchy,n=new w.Entity,a=this,r=null,o=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);const s=function(){n.polyline=t.style,n.polyline.positions=new w.CallbackProperty((function(){return e}),!1),n.polygon={hierarchy:new w.CallbackProperty((function(){return i}),!1),material:w.Color.WHITE.withAlpha(.1),clampToGround:t.clampToGround||!1},n.clampToS3M=!0,r=a._drawLayer.entities.add(n)},l=function(t){var i=new w.Entity;i.position=t,i.point={pixelSize:10,outlineColor:w.Color.BLUE,outlineWidth:5},i.label={text:(a.getPositionsArea(a.transformCartesianArrayToWGS84Array(e))/1e6).toFixed(4)+"平方公里",show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(-20,-50)},a._drawLayer.entities.add(i)};o.setInputAction((function(t){var n=a.getCatesian3FromPX(t.position);n&&n.x&&(0==e.length&&(i.positions.push(n.clone()),e.push(n.clone())),e.push(n.clone()),i.positions.push(n.clone()),r||s())}),w.ScreenSpaceEventType.LEFT_CLICK),o.setInputAction((function(t){var n=a.getCatesian3FromPX(t.endPosition);e.length>=2&&n&&n.x&&(e.pop(),e.push(n),i.positions.pop(),i.positions.push(n))}),w.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction((function(){o.destroy(),e.push(e[0]),t.height&&(n.polygon.extrudedHeight=t.height,n.polygon.material=w.Color.BLUE.withAlpha(.5)),t.measure&&l(e[0]),"function"==typeof t.callback&&t.callback(a.transformCartesianArrayToWGS84Array(e),r)}),w.ScreenSpaceEventType.RIGHT_CLICK)}},drawRectangleGraphics:function(t){if((t=t||{}).style=t.style||{width:3,material:w.Color.BLUE.withAlpha(.5),clampToGround:!0},this._viewer&&t){var e,i=[],n=new w.Entity,a=new w.Rectangle,r=this,o=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);o.setInputAction((function(n){var s=r.getCatesian3FromPX(n.position);s&&s.x&&(0==i.length?i.push(s.clone()):(o.destroy(),i.push(s.clone()),a=w.Rectangle.fromCartesianArray([...i,s],w.Ellipsoid.WGS84),"function"==typeof t.callback&&t.callback(r.transformCartesianArrayToWGS84Array(i),e)))}),w.ScreenSpaceEventType.LEFT_CLICK),o.setInputAction((function(t){var e=r.getCatesian3FromPX(t.endPosition);e&&(a=w.Rectangle.fromCartesianArray([...i,e],w.Ellipsoid.WGS84))}),w.ScreenSpaceEventType.MOUSE_MOVE),n.rectangle=t.style,t.height&&(n.rectangle.extrudedHeight=t.height),n.rectangle.coordinates=new w.CallbackProperty((function(){return a}),!1),e=this._drawLayer.entities.add(n)}},drawCircleGraphics:function(t){if((t=t||{}).style=t.style||{width:3,material:w.Color.BLUE.withAlpha(.5),clampToGround:!0},this._viewer&&t){var e,i=void 0,n=new w.Entity,a=this,r=1,o=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);const s=function(t,e){let i=w.Cartographic.fromCartesian(t),n=w.Cartographic.fromCartesian(e),a=new w.EllipsoidGeodesic;a.setEndPoints(i,n);let o=a.surfaceDistance;r=Math.sqrt(Math.pow(o,2)+Math.pow(n.height-i.height,2))},l=function(){n.ellipse=t.style,n.ellipse.semiMajorAxis=new w.CallbackProperty((function(){return r}),!1),n.ellipse.semiMinorAxis=new w.CallbackProperty((function(){return r}),!1),n.position=new w.CallbackProperty((function(){return i}),!1),n.point={pixelSize:5,outlineColor:w.Color.RED,outlineWidth:3},t.height&&(n.ellipse.extrudedHeight=t.height),e=a._drawLayer.entities.add(n)};o.setInputAction((function(n){var c=a.getCatesian3FromPX(n.position);c&&c.x&&(i?(s(i,c),o.destroy(),"function"==typeof t.callback&&t.callback({center:i,radius:r},e)):(i=c,l()))}),w.ScreenSpaceEventType.LEFT_CLICK),o.setInputAction((function(t){var e=a._viewer.scene.camera.pickEllipsoid(t.endPosition,a._viewer.scene.globe.ellipsoid);i&&e&&e.x&&s(i,e)}),w.ScreenSpaceEventType.MOUSE_MOVE)}},drawTrianglesGraphics:function(t){if((t=t||{}).style=t.style||{width:3,material:w.Color.BLUE.withAlpha(.5)},this._viewer&&t){var e=new w.Entity,i=new w.Entity,n=new w.Entity,a=[],r=[],o=[],s=this,l=new w.ScreenSpaceEventHandler(this._viewer.scene.canvas);const c=function(t,e){if(!t&&!e)return 0;if(w.Cartesian3.equals(t,e))return 0;let i=w.Cartographic.fromCartesian(t);return(w.Cartographic.fromCartesian(e).height-i.height).toFixed(2)},h=function(t){let e=w.Cartographic.fromCartesian(t[0]),i=w.Cartographic.fromCartesian(t[1]);return w.Cartesian3.fromDegrees(w.Math.toDegrees(e.longitude),w.Math.toDegrees(e.latitude),i.height)};l.setInputAction((function(o){var c=s.getCatesian3FromPX(o.position);if(!c)return!1;0==a.length?(a.push(c.clone()),a.push(c.clone()),r.push(c.clone()),r.push(c.clone())):(l.destroy(),"function"==typeof t.callback&&t.callback({e,e2:i,e3:n}))}),w.ScreenSpaceEventType.LEFT_CLICK),l.setInputAction((function(t){var e=s.getCatesian3FromPX(t.endPosition);if(e&&a.length>0){a.pop(),a.push(e.clone());let t=h(a);r.pop(),r.push(t.clone()),o.pop(),o.pop(),o.push(e.clone()),o.push(t.clone())}}),w.ScreenSpaceEventType.MOUSE_MOVE),e.polyline={positions:new w.CallbackProperty((function(){return a}),!1),...t.style},e.position=new w.CallbackProperty((function(){return a[0]}),!1),e.point={pixelSize:5,outlineColor:w.Color.BLUE,outlineWidth:5},e.label={text:new w.CallbackProperty((function(){return"直线:"+s.getPositionDistance(s.transformCartesianArrayToWGS84Array(a))+"米"}),!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(50,-100)},i.polyline={positions:new w.CallbackProperty((function(){return r}),!1),...t.style},i.position=new w.CallbackProperty((function(){return o[1]}),!1),i.point={pixelSize:5,outlineColor:w.Color.BLUE,outlineWidth:5},i.label={text:new w.CallbackProperty((function(){return"高度:"+c(r[0],r[1])+"米"}),!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.BOTTOM,pixelOffset:new w.Cartesian2(-20,100)},n.polyline={positions:new w.CallbackProperty((function(){return o}),!1),...t.style},n.position=new w.CallbackProperty((function(){return a[1]}),!1),n.point={pixelSize:5,outlineColor:w.Color.BLUE,outlineWidth:5},n.label={text:new w.CallbackProperty((function(){return"水平距离:"+s.getPositionDistance(s.transformCartesianArrayToWGS84Array(o))+"米"}),!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(n),this._drawLayer.entities.add(i),this._drawLayer.entities.add(e)}},drawWallGraphics:function(t){if((t=t||{}).style=t.style||{material:w.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:w.Color.WHITE},this._viewer&&t){var e=this;this.drawPolygonGraphics({callback:function(i,n){var a=e._drawLayer.entities.add({wall:{positions:e.transformWGS84ArrayToCartesianArray(i),...t.style}});"function"==typeof t.callback&&t.callback(i,a)}})}},drawEllipsoidGraphics:function(t){if((t=t||{}).style=t.style||{},this._viewer&&t){var e=this;this.drawCircleGraphics({callback:function(i,n){var a=e.createGraphics();a.ellipsoid=e.$graphics.getEllipsoidGraphics({radii:i.radius}),a.position=i.center,e._drawLayer.entities.remove(n);var r=e._drawLayer.entities.add(a);"function"==typeof t.callback&&t.callback({center:i.center,radius:i.radius},r)}})}},drawCylinderGraphics:function(t){if((t=t||{}).style=t.style||{},this._viewer&&t){var e=this;this.drawCircleGraphics({callback:function(i,n){var a=e._drawLayer.entities.add({position:i.center,cylinder:{length:2*i.radius||t.length,topRadius:t.topRadius||i.radius,bottomRadius:t.bottomRadius||i.radius,material:w.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:w.Color.WHITE}});e._drawLayer.entities.remove(n),"function"==typeof t.callback&&t.callback({center:i.center,radius:i.radius},a)}})}},drawCorridorGraphics:function(t){if((t=t||{}).style=t.style||{},this._viewer&&t){var e=this;e.drawLineGraphics({callback:function(i,n){var a=e.createGraphics();a.corridor={positions:e.transformWGS84ArrayToCartesianArray(i),height:t.height||1,width:t.width||100,cornerType:w.CornerType.BEVELED,extrudedHeight:t.extrudedHeight||1,material:w.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:w.Color.WHITE},e._drawLayer.entities.remove(n);var r=e._drawLayer.entities.add(a);"function"==typeof t.callback&&t.callback(i,r)}})}},drawPolylineVolumeGraphics:function(t){(t=t||{}).style=t.style||{};const e=t.circleRadius||20,i=t.arms||7,n=t.rOuter||150,a=t.rInner||75;if(this._viewer&&t){var r=this;r.drawLineGraphics({callback:function(o,s){var l=r.createGraphics();let c="fivePoint"===t.shape?r.computeStar2d(i,n,a):r.computeCircleShap(e);l.polylineVolume={positions:r.transformWGS84ArrayToCartesianArray(o),shape:c,cornerType:w.CornerType.MITERED,material:t.color||w.Color.RED},r._drawLayer.entities.remove(s);var h=r._drawLayer.entities.add(l);"function"==typeof t.callback&&t.callback(o,h)}})}}};let A={};function _(t,e){t&&(this._viewer=t,A=e)}_.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(t){let e=0;return t&&Array.isArray(t)&&t.length>0&&t.forEach((i,n)=>{n<t.length-1&&(e+=this.mathDistance2d(i,t[n+1]))}),e},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 A.Cartesian2(Math.cos(o*n)*s,Math.sin(o*n)*s)}return r},computeCircleShap(t){let e=[];for(let i=0;i<360;i++){let n=A.Math.toRadians(i);e.push(new A.Cartesian2(t*Math.cos(n),t*Math.sin(n)))}return e},mid2d:function(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]},getCircleCenterOfThreePoints2d:function(t,e,i){let n=[(t[0]+e[0])/2,(t[1]+e[1])/2],a=[n[0]-t[1]+e[1],n[1]+t[0]-e[0]],r=[(t[0]+i[0])/2,(t[1]+i[1])/2],o=[r[0]-t[1]+i[1],r[1]+t[0]-i[0]];return this.getIntersectPoint2d(n,a,r,o)},getIntersectPoint2d:function(t,e,i,n){if(t[1]===e[1]){return[(n[0]-i[0])/(n[1]-i[1])*(t[1]-i[1])+i[0],t[1]]}if(i[1]===n[1]){return[(e[0]-t[0])/(e[1]-t[1])*(i[1]-t[1])+t[0],i[1]]}let a=(e[0]-t[0])/(e[1]-t[1]),r=(n[0]-i[0])/(n[1]-i[1]),o=(a*t[1]-t[0]-r*i[1]+i[0])/(a-r);return[a*o-a*t[1]+t[0],o]},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){let n=this.getAzimuth2d(e,t)-this.getAzimuth2d(e,i);return n<0?n+2*Math.PI:n},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){t=Math.max(Math.min(t,1),0);let[r,o]=[1-t,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){let r=this.getAzimuth2d(t,e),o=a?r+i:r-i,s=n*Math.cos(o),l=n*Math.sin(o);return[e[0]+s,e[1]+l]},inherits2d:function(t,e){function i(){}i.prototype=e.prototype,t.superClass_=e.prototype,t.prototype=new i,t.prototype.constructor=t,t.base=function(t,i,n){let a=Array.prototype.slice.call(arguments,2);return e.prototype[i].apply(t,a)}},getArcPoints2d:function(t,e,i,n){let[a,r,o,s]=[null,null,[],n-i];s=s<0?s+2*Math.PI:s;for(let n=0;n<=100;n++){let l=i+s*n/100;a=t[0]+e*Math.cos(l),r=t[1]+e*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]),x=a[0]/h,d=a[1]/h,u=this.mathDistance2d(e,i),p=this.mathDistance2d(i,n);return h>1e-4?this.isClockWise(e,i,n)?(s=t*u,l=i[0]-s*d,c=i[1]+s*x,r=[l,c],s=t*p,l=i[0]+s*d,c=i[1]-s*x,o=[l,c]):(s=t*u,l=i[0]+s*d,c=i[1]-s*x,r=[l,c],s=t*p,l=i[0]-s*d,c=i[1]+s*x,o=[l,c]):(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]),c=i[1]+t*(n[1]-i[1]),o=[l,c]),[r,o]},getNormal2d:function(t,e,i){let n=t[0]-e[0],a=t[1]-e[1],r=Math.sqrt(n*n+a*a);n/=r,a/=r;let o=i[0]-e[0],s=i[1]-e[1],l=Math.sqrt(o*o+s*s);return o/=l,s/=l,[n+o,a+s]},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);if(Math.sqrt(l[0]*l[0]+l[1]*l[1])>1e-4){let t=this.mid2d(i,n),e=i[0]-t[0],a=i[1]-t[1],l=2/this.mathDistance2d(i,n),c=-l*a,h=l*e,x=c*c-h*h,d=2*c*h,u=h*h-c*c,p=s[0]-t[0],g=s[1]-t[1];r=t[0]+x*p+d*g,o=t[1]+d*p+u*g}else r=i[0]+e*(n[0]-i[0]),o=i[1]+e*(n[1]-i[1]);return[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];if(l>1e-4){let t=this.mid2d(a,r),e=r[0]-t[0],i=r[1]-t[1],n=2/this.mathDistance2d(a,r),s=-n*i,l=n*e,x=s*s-l*l,d=2*s*l,u=l*l-s*s,p=o[0]-t[0],g=o[1]-t[1];c=t[0]+x*p+d*g,h=t[1]+d*p+u*g}else c=r[0]+e*(a[0]-r[0]),h=r[1]+e*(a[1]-r[1]);return[c,h]},getCurvePoints2d:function(t,e){let i=this.getLeftMostControlPoint2d(e,t),[n,a,r,o,s]=[null,null,null,[i],[]];for(let i=0;i<e.length-2;i++){[n,a,r]=[e[i],e[i+1],e[i+2]];let s=this.getBisectorNormals2d(t,n,a,r);o=o.concat(s)}let l=this.getRightMostControlPoint2d(e,t);l&&o.push(l);for(let t=0;t<e.length-1;t++){n=e[t],a=e[t+1],s.push(n);for(let e=0;e<100;e++){let i=this.getCubicValue2d(e/100,n,o[2*t],o[2*t+1],a);s.push(i)}s.push(a)}return s},getBezierPoints2d:function(t){if(t.length<=2)return t;{let e=[],i=t.length-1;for(let n=0;n<=1;n+=.01){let[a,r]=[0,0];for(let e=0;e<=i;e++){let o=this.getBinomialFactor2d(i,e),s=Math.pow(n,e),l=Math.pow(1-n,i-e);a+=o*s*l*t[e][0],r+=o*s*l*t[e][1]}e.push([a,r])}return e.push(t[i]),e}},getFactorial2d:function(t){let e=1;switch(t){case t<=1:e=1;break;case 2===t:e=2;break;case 3===t:e=6;break;case 24===t:e=24;break;case 5===t:e=120;break;default:for(let i=1;i<=t;i++)e*=i}return e},getBinomialFactor2d:function(t,e){return this.getFactorial2d(t)/(this.getFactorial2d(e)*this.getFactorial2d(t-e))},getQBSplinePoints2d:function(t){if(t.length<=2)return t;{let[e,i]=[2,[]],n=t.length-e-1;i.push(t[0]);for(let a=0;a<=n;a++)for(let n=0;n<=1;n+=.05){let[r,o]=[0,0];for(let i=0;i<=e;i++){let e=this.getQuadricBSplineFactor2d(i,n);r+=e*t[a+i][0],o+=e*t[a+i][1]}i.push([r,o])}return i.push(t[t.length-1]),i}},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 W(t,e){t&&(this._viewer=t,G=e)}W.prototype={setCircleScanEffect:function(t){if(t&&t.position){var e=t.id||"CircleScan"+parseInt(1e3*Math.random()),i=t.position,n=t.radius,a=t.color||G.Color.RED,r=t.duration||1500,o=this,s=t.circleMode||"CircleScan",l=t.border||4,c=i,h=new G.Cartesian4(c.x,c.y,c.z,1),x=this.transformCartesianToWGS84(i),d=this.transformWGS84ToCartesian({lng:x.lng,lat:x.lat,alt:x.alt+500}),u=new G.Cartesian4(d.x,d.y,d.z,1),p=(new Date).getTime(),g=new G.PostProcessStage({name:e,fragmentShader:this._getCircleScanShader({get:!0,border:l}),uniforms:{u_scanCenterEC:function(){return G.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,h,new G.Cartesian4)},u_scanPlaneNormalEC:function(){var t=G.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,h,new G.Cartesian4),e=G.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,u,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"==s?n*(((new Date).getTime()-p)%r)/r:n},u_scanColor:a}});return this._viewer.scene.postProcessStages.add(g),g}},setRadarScanEffect:function(t){if(t&&t.position){var e=t.id||"radarScan"+parseInt(1e3*Math.random()),i=t.position,n=t.radius,a=t.color||G.Color.RED,r=t.duration||1500,o=this,s=t.border||1,l=t.width||3,c=i,h=new G.Cartesian4(c.x,c.y,c.z,1),x=this.transformCartesianToWGS84(i),d=this.transformWGS84ToCartesian({lng:x.lng,lat:x.lat,alt:x.alt+500}),u=new G.Cartesian4(d.x,d.y,d.z,1),p=this.transformWGS84ToCartesian({lng:x.lng+.001,lat:x.lat,alt:x.alt}),g=new G.Cartesian4(p.x,p.y,p.z,1),m=(new Date).getTime(),f=new G.Quaternion,v=new G.Matrix3,y=new G.Cartesian4,b=new G.Cartesian4,C=new G.Cartesian4,w=new G.Cartesian3,I=new G.Cartesian3,A=new G.PostProcessStage({name:e,fragmentShader:this._getRadarScanShader({border:s,width:l,get:!0}),uniforms:{u_scanCenterEC:function(){return G.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,h,y)},u_scanPlaneNormalEC:function(){var t=G.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,h,y),e=G.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,u,b);return w.x=e.x-t.x,w.y=e.y-t.y,w.z=e.z-t.z,G.Cartesian3.normalize(w,w),w},u_scanLineNormalEC:function(){var t=G.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,h,y),e=G.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,u,b),i=G.Matrix4.multiplyByVector(o._viewer.camera._viewMatrix,g,C);w.x=e.x-t.x,w.y=e.y-t.y,w.z=e.z-t.z,G.Cartesian3.normalize(w,w),I.x=i.x-t.x,I.y=i.y-t.y,I.z=i.z-t.z;var n=((new Date).getTime()-m)%r/r;return G.Quaternion.fromAxisAngle(w,n*G.Math.PI*2,f),G.Matrix3.fromQuaternion(f,v),G.Matrix3.multiplyByVector(v,I,I),G.Cartesian3.normalize(I,I),I},u_radius:n,u_scanColor:a}});return this._viewer.scene.postProcessStages.add(A),A}}};var P,Z,M=["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","Z2V0SGVhZGluZ1BpdGNoUm9sbEZ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vd1NlY3RvclNlZ21lbnRMaW5lcw==","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==","b3V0bGluZUNvbG9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heQ==","TWF0ZXJpYWxQcm9wZXJ0eQ==","aXNEZXN0cm95ZWQ=","c2NlbmUgaXMgcmVxdWlyZWQu","ZW50aXR5Q29sbGVjdGlvbiBpcyByZXF1aXJlZC4=","Y29sbGVjdGlvbkNoYW5nZWQ=","YWRkRXZlbnRMaXN0ZW5lcg==","X29uQ29sbGVjdGlvbkNoYW5nZWQ=","X3NjZW5l","X3ByaW1pdGl2ZXM=","X2VudGl0eUNvbGxlY3Rpb24=","X2hhc2g=","X2VudGl0aWVzVG9WaXN1YWxpemU=","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","X3N0YXJ0Rm92SA==","X2VuZEZvdkg=","X3N0YXJ0Rm92Vg==","X2VuZEZvdlY=","X3NlZ21lbnRI","X3NlZ21lbnRW","X3N1YlNlZ21lbnRI","X3N1YlNlZ21lbnRW","X2luaXRCb3VuZGluZ1NwaGVyZQ==","X2NvbW1hbmQ=","X2NyZWF0ZU91dGVyQ3VydmVDb21tYW5k","X291dGVyRm92UmFkaXVzUGFpcnM=","X2NyZWF0ZVJhd0NvbW1hbmQ=","X2NyZWF0ZUlubmVyQ3VydmVDb21tYW5k","X2lubmVyRm92UmFkaXVzUGFpcnM=","X2NyZWF0ZUxlZnRDcm9zc1NlY3Rpb25Db21tYW5k","X2NyZWF0ZVJpZ2h0Q3Jvc3NTZWN0aW9uQ29tbWFuZA==","QXBwZWFyYW5jZQ==","Z2V0RGVmYXVsdFJlbmRlclN0YXRl","CiAgICAgICAgICAgIC8vIG11eWFvIOS9v+eUqGRvdWJsZeexu+Wei+eahHBvc2l0aW9u6L+b6KGM6K6h566XCiAgICAgICAgICAgIC8vIGF0dHJpYnV0ZSB2ZWMzIHBvc2l0aW9uM0RIaWdoOwogICAgICAgICAgICAvLyBhdHRyaWJ1dGUgdmVjMyBwb3NpdGlvbjNETG93OwogICAgICAgICAgICBhdHRyaWJ1dGUgdmVjMyBwb3NpdGlvbjsKICAgICAgICAgICAgYXR0cmlidXRlIHZlYzMgbm9ybWFsOwogICAgICAgICAgICAvLyBhdHRyaWJ1dGUgdmVjMiBzdDsKICAgICAgICAgICAgLy8gYXR0cmlidXRlIGZsb2F0IGJhdGNoSWQ7CgogICAgICAgICAgICB2YXJ5aW5nIHZlYzMgdl9wb3NpdGlvbkVDOwogICAgICAgICAgICB2YXJ5aW5nIHZlYzMgdl9ub3JtYWxFQzsKICAgICAgICAgICAgLy8gdmFyeWluZyB2ZWMyIHZfc3Q7CgogICAgICAgICAgICB2b2lkIG1haW4oKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAvLyBtdXlhbyDkvb/nlKhkb3VibGXnsbvlnovnmoRwb3NpdGlvbui/m+ihjOiuoeeulwogICAgICAgICAgICAgICAgLy8gdmVjNCBwID0gY3ptX3RyYW5zbGF0ZVJlbGF0aXZlVG9FeWUocG9zaXRpb24zREhpZ2gsIHBvc2l0aW9uM0RMb3cpOwogICAgICAgICAgICAgICAgLy8gdl9wb3NpdGlvbkVDID0gKGN6bV9tb2RlbFZpZXdSZWxhdGl2ZVRvRXllICogcCkueHl6OyAgICAgIC8vIHBvc2l0aW9uIGluIGV5ZSBjb29yZGluYXRlcwogICAgICAgICAgICAgICAgLy8gdl9ub3JtYWxFQyA9IGN6bV9ub3JtYWwgKiBub3JtYWw7ICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5vcm1hbCBpbiBleWUgY29vcmRpbmF0ZXMKICAgICAgICAgICAgICAgIC8vIHZfc3QgPSBzdDsKICAgICAgICAgICAgICAgIC8vIGdsX1Bvc2l0aW9uID0gY3ptX21vZGVsVmlld1Byb2plY3Rpb25SZWxhdGl2ZVRvRXllICogcDsKCiAgICAgICAgICAgICAgICB2X3Bvc2l0aW9uRUMgPSAoY3ptX21vZGVsVmlldyAqIHZlYzQocG9zaXRpb24sIDEuMCkpLnh5ejsgICAgICAgLy8gcG9zaXRpb24gaW4gZXllIGNvb3JkaW5hdGVzCiAgICAgICAgICAgICAgICB2X25vcm1hbEVDID0gY3ptX25vcm1hbCAqIG5vcm1hbDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm9ybWFsIGluIGV5ZSBjb29yZGluYXRlcwogICAgICAgICAgICAgICAgLy8gdl9zdCA9IHN0OwogICAgICAgICAgICAgICAgZ2xfUG9zaXRpb24gPSBjem1fbW9kZWxWaWV3UHJvamVjdGlvbiAqIHZlYzQocG9zaXRpb24sIDEuMCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAg","CiAgICAgICAgICAgIHZhcnlpbmcgdmVjMyB2X3Bvc2l0aW9uRUM7CiAgICAgICAgICAgIHZhcnlpbmcgdmVjMyB2X25vcm1hbEVDOwogICAgICAgICAgICAvLyB2YXJ5aW5nIHZlYzIgdl9zdDsKCiAgICAgICAgICAgIC8vIHVuaWZvcm0gc2FtcGxlcjJEIG15SW1hZ2U7CiAgICAgICAgICAgIHVuaWZvcm0gdmVjNCB4YnNqQ29sb3I7CgogICAgICAgICAgICB2b2lkIG1haW4oKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICB2ZWMzIHBvc2l0aW9uVG9FeWVFQyA9IC12X3Bvc2l0aW9uRUM7CgogICAgICAgICAgICAgICAgdmVjMyBub3JtYWxFQyA9IG5vcm1hbGl6ZSh2X25vcm1hbEVDKTsKICAgICAgICAgICAgI2lmZGVmIEZBQ0VfRk9SV0FSRAogICAgICAgICAgICAgICAgbm9ybWFsRUMgPSBmYWNlZm9yd2FyZChub3JtYWxFQywgdmVjMygwLjAsIDAuMCwgMS4wKSwgLW5vcm1hbEVDKTsKICAgICAgICAgICAgI2VuZGlmCgogICAgICAgICAgICAgICAgY3ptX21hdGVyaWFsSW5wdXQgbWF0ZXJpYWxJbnB1dDsKICAgICAgICAgICAgICAgIG1hdGVyaWFsSW5wdXQubm9ybWFsRUMgPSBub3JtYWxFQzsKICAgICAgICAgICAgICAgIG1hdGVyaWFsSW5wdXQucG9zaXRpb25Ub0V5ZUVDID0gcG9zaXRpb25Ub0V5ZUVDOwogICAgICAgICAgICAgICAgLy8gbWF0ZXJpYWxJbnB1dC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lcw==","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==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2X25vcm1hbDsKdmFyeWluZyB2ZWMyIHZfc3Q7Cgp2YXJ5aW5nIHZlYzMgdl9saWdodDBEaXJlY3Rpb247Cgp2b2lkIG1haW4odm9pZCkgCnsKICAgIHZlYzQgcG9zID0gIG1vZGVsVmlld01hdHJpeCAqIHZlYzQoIHBvc2l0aW9uLDEuMCk7CiAgICB2X25vcm1hbCA9ICBub3JtYWxNYXRyaXggKiAgbm9ybWFsOwogICAgdl9zdCA9IHN0OwogICAgdl9wb3NpdGlvbiA9IHBvcy54eXo7CiAgICB2X2xpZ2h0MERpcmVjdGlvbiA9IG1hdDMoIG1vZGVsVmlld01hdHJpeCkgKiB2ZWMzKDEuMCwxLjAsMS4wKTsKICAgIGdsX1Bvc2l0aW9uID0gIHByb2plY3Rpb25NYXRyaXggKiBwb3M7Cn0=","Y29udGV4dA==","Ym91bmRpbmdTcGhlcmU=","Y2VudGVy","cmFkaXVz","RHJhd0NvbW1hbmQ=","UGFzcw==","T1BBUVVF","Y3JlYXRlQXR0cmlidXRlTG9jYXRpb25z","VmVydGV4QXJyYXk=","ZnJvbUdlb21ldHJ5","QnVmZmVyVXNhZ2U=","U1RBVElDX0RSQVc=","X2F0dHJpYnV0ZUxvY2F0aW9ucw==","c2hhZGVyUHJvZ3JhbQ==","U2hhZGVyUHJvZ3JhbQ==","cmVwbGFjZUNhY2hl","cmVuZGVyU3RhdGU=","UmVuZGVyU3RhdGU=","ZnJvbUNhY2hl","QmxlbmRpbmdTdGF0ZQ==","QUxQSEFfQkxFTkQ="];P=M,Z="344",function(t){for(;--t;)P.push(P.shift())}(++Z);var S=function(t,e){var i=M[t-=0];void 0===S.hPWhUV&&(!function(){var t;try{t=Function('return (function() {}.constructor("return this")( ));')()}catch(e){t=window}t.atob||(t.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)):0)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,e){e.Scene[S("0x3c")]=function(t,i,n){var a=t[S("0x30")](i);if(t[S("0x31")]&&e[S("0x2d")](a)&&function(t,i){if(e[S("0x2d")](t.id)){var n=t.id;if(n[S("0x2e")])return!1;if(i&&n==i)return!1}if(e[S("0x2d")](t[S("0x2f")])){var a=t[S("0x2f")];if(a[S("0x2e")])return!1;if(i&&a==i)return!1}return!0}(a,n)){var r=t[S("0x32")](i);if(e[S("0x2d")](r)){var o=e[S("0x1b")][S("0x1c")](r)[S("0x33")];if(o>=0)return r;if(!e[S("0x2d")](a.id)&&o>=-500)return r}}if(t[S("0x34")]===e[S("0x35")][S("0x36")]){var s=t[S("0x37")][S("0x38")](i);r=t[S("0x39")][S("0x30")](s,t)}else r=t[S("0x37")][S("0x3a")](i,t[S("0x39")][S("0x3b")]);return r},e[S("0x11")][S("0x2c")]=function(t,i){return function(t,i){var n=e[S("0x24")][S("0x25")](t,e[S("0xf")][S("0x10")],new(e[S("0x11")])),a=e[S("0x11")][S("0x26")](e[S("0x11")][S("0x27")](n,new(e[S("0x11")])),i,new(e[S("0x11")])),r=e[S("0x11")][S("0x28")](a,new(e[S("0x22")])),o=e[S("0x29")][S("0x2a")](r);return e[S("0x2b")][S("0x23")](o)}(t,e[S("0x11")][S("0x21")](e[S("0x22")][S("0x23")](i,h),t,f))},function(){Object[S("0x1d")](e.Scene,S("0x1e"),{value:!0});var t=new(e[S("0x9")]),i=(new(e[S("0x18")]),new(e[S("0x1b")]));e.Scene[S("0x1f")]=function(t){var i=t[S("0x0")],n=t[S("0x1")],a=i[S("0x2")];if(n[S("0x3")]){var r=n[S("0x3")][S("0x4")];if(void 0===n[S("0x5")])n[S("0x5")]=new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:3,values:new Float32Array(r[S("0x2")])});else for(var o=n[S("0x5")][S("0x4")],s=0;s<a;s++)o[s]=0;var l,c,h,x=n[S("0x5")][S("0x4")],d=new(e[S("0x9")]),u=new(e[S("0x9")]),p=new(e[S("0x9")]),g=new(e[S("0x9")]),m=new(e[S("0x9")]);for(s=0;s<a;s+=3)l=3*i[s+0],c=3*i[s+1],h=3*i[s+2],e[S("0x9")][S("0xa")](r,l,d),e[S("0x9")][S("0xa")](r,c,u),e[S("0x9")][S("0xa")](r,h,p),e[S("0x9")][S("0xb")](p,u,g),e[S("0x9")][S("0xb")](d,u,m),e[S("0x9")][S("0xc")](g,m,g),x[l]+=g.x,x[l+1]+=g.y,x[l+2]+=g.z,x[c]+=g.x,x[c+1]+=g.y,x[c+2]+=g.z,x[h]+=g.x,x[h+1]+=g.y,x[h+2]+=g.z;(function(t){for(var e,i,n,a,r=t[S("0x1")][S("0x5")][S("0x4")],o=0;o<r[S("0x2")];o+=3)e=r[o],i=r[o+1],n=r[o+2],a=1/Math[S("0xe")](e*e+i*i+n*n),r[o]=e*a,r[o+1]=i*a,r[o+2]=n*a})(t),n[S("0x5")][S("0xd")]=!0}return t},e.Scene[S("0x20")]=function(n,a,r,o){o=o||e[S("0xf")][S("0x10")],e[S("0x11")][S("0x12")](a,n,t),e[S("0x9")][S("0xb")](t,r[S("0x13")],r[S("0x14")]),e[S("0x9")][S("0x15")](r[S("0x14")],r[S("0x14")]);var s=e[S("0x16")][S("0x17")](r,o),l=null;if(s&&(l=e[S("0x18")][S("0x19")](r,s[S("0x1a")])),l)try{e[S("0x1b")][S("0x1c")](l,null,i)}catch(t){return null}return l}}(),function(){function t(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}Object[S("0x1d")](e.Scene,S("0x1e"),{value:!0}),e.Scene[S("0x4a")]=void 0;var i=new(e[S("0x9")]),n=new(e[S("0x18")]);t[S("0x4b")]=function(t){for(var i=t[S("0x3d")],n=t[S("0x3f")],a=t[S("0x41")],r=t[S("0x43")],o=(t[S("0x46")]?-1:1)*t[S("0x45")],s=new Float32Array(24),l=[],c=[],h=[0,o],x=[i,a],d=[n,r],u=0,p=0;p<2;p++)s[3*u]=-x[p]/2,s[3*u+1]=-d[p]/2,s[3*u+2]=h[p],c[2*u]=p,c[2*u+1]=0,s[3*++u]=-x[p]/2,s[3*u+1]=d[p]/2,s[3*u+2]=h[p],c[2*u]=p,c[2*u+1]=0,s[3*++u]=x[p]/2,s[3*u+1]=d[p]/2,s[3*u+2]=h[p],c[2*u]=p,c[2*u+1]=0,s[3*++u]=x[p]/2,s[3*u+1]=-d[p]/2,s[3*u+2]=h[p],c[2*u]=p,c[2*u+1]=0,u++;l[S("0x4c")](0,1,3),l[S("0x4c")](1,2,3),l[S("0x4c")](0,4,5),l[S("0x4c")](0,5,1),l[S("0x4c")](1,2,6),l[S("0x4c")](1,6,5),l[S("0x4c")](2,3,7),l[S("0x4c")](7,6,2),l[S("0x4c")](0,3,7),l[S("0x4c")](7,4,0),l[S("0x4c")](4,5,6),l[S("0x4c")](6,7,4),l=new Int16Array(l),c=new Float32Array(c);var g={position:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:s}),st:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:2,values:c})},m=e[S("0x4e")][S("0x4f")](s),f=new(e[S("0x50")])({attributes:g,indices:l,primitiveType:e[S("0x51")][S("0x52")],boundingSphere:m});return s=[],l=[],f=e[S("0x53")][S("0x54")](f)},t[S("0x55")]=function(a,r){if(!r)return t[S("0x4b")](cylinderGeometry);e[S("0x11")][S("0x12")](r,e[S("0x9")][S("0x56")],i),i[S("0x57")](n[S("0x13")]);var o=a[S("0x48")],s=(a[S("0x3d")],a[S("0x3f")],a[S("0x41")]),l=a[S("0x43")],c=(a[S("0x46")]?-1:1)*a[S("0x45")],h=[],x=[],d=[],u=s/2,p=l/2,g=o,m=o,f=0;h[S("0x4c")](0,0,0),d[S("0x4c")](1,1),f++;for(var v=new(e[S("0x9")]),y=[],b=-m;b<m;b++){for(var C=[],w=-g;w<g;w++){var I=p*b/m,A=u*w/g;v.x=A,v.y=I,v.z=c;var _=(0,e.Scene[S("0x20")])(v,r,n);_?(h[S("0x4c")](A,I,c),d[S("0x4c")](1,1),C[S("0x4c")](f),f++):(C[S("0x4c")](-1),_=i)}y[S("0x4c")](C)}for(var G,W,P=[0,y[S("0x2")]-1],Z=0;Z<P[S("0x2")];Z++)for(b=P[Z],w=1;w<y[b][S("0x2")];w++)G=y[b][w-1],W=y[b][w],G>=0&&W>=0&&x[S("0x4c")](0,G,W);for(var M=[0,y[0][S("0x2")]-1],V=0;V<M[S("0x2")];V++)for(w=M[V],b=1;b<y[S("0x2")];b++)G=y[b-1][w],W=y[b][w],G>=0&&W>=0&&x[S("0x4c")](0,G,W);h=new Float32Array(h),x=new Int32Array(x),d=new Float32Array(d);var X={position:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:h}),st:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:2,values:d})},R=e[S("0x4e")][S("0x4f")](h),F=new(e[S("0x50")])({attributes:X,indices:x,primitiveType:e[S("0x51")][S("0x52")],boundingSphere:R});return(0,e.Scene[S("0x1f")])(F),h=[],x=[],F},t[S("0x58")]=function(t){for(var i=t[S("0x3d")],n=t[S("0x3f")],a=t[S("0x41")],r=t[S("0x43")],o=(t[S("0x46")]?-1:1)*t[S("0x45")],s=new Float32Array(24),l=[],c=[],h=[0,o],x=[i,a],d=[n,r],u=0,p=0;p<2;p++)s[3*u]=-x[p]/2,s[3*u+1]=-d[p]/2,s[3*u+2]=h[p],c[2*u]=p,c[2*u+1]=0,s[3*++u]=-x[p]/2,s[3*u+1]=d[p]/2,s[3*u+2]=h[p],c[2*u]=p,c[2*u+1]=0,s[3*++u]=x[p]/2,s[3*u+1]=d[p]/2,s[3*u+2]=h[p],c[2*u]=p,c[2*u+1]=0,s[3*++u]=x[p]/2,s[3*u+1]=-d[p]/2,s[3*u+2]=h[p],c[2*u]=p,c[2*u+1]=0,u++;l[S("0x4c")](0,1,1,2),l[S("0x4c")](2,3,3,0),l[S("0x4c")](0,4),l[S("0x4c")](1,5),l[S("0x4c")](2,6),l[S("0x4c")](3,7),l[S("0x4c")](4,5,5,6),l[S("0x4c")](6,7,7,4),l=new Int16Array(l),c=new Float32Array(c);var g={position:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:s}),st:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:2,values:c})},m=e[S("0x4e")][S("0x4f")](s),f=new(e[S("0x50")])({attributes:g,indices:l,primitiveType:e[S("0x51")][S("0x59")],boundingSphere:m});return s=[],l=[],f},t[S("0x5a")]=function(t){var i=(t[S("0x3d")],t[S("0x3f")],t[S("0x41")]),n=t[S("0x43")],r=(t[S("0x46")]?-1:1)*t[S("0x45")],o=[],s=[],l=[],c=i/2,h=n/2,x=0;o[S("0x4c")](0,0,0),l[S("0x4c")](1,1),x++;for(var d=[],u=-16;u<16;u++){for(var p=[],g=-16;g<16;g++){p[S("0x4c")](x);var m=h*u/16,f=c*g/16;o[S("0x4c")](f,m,r),l[S("0x4c")](1,1),x++}d[S("0x4c")](p)}for(var v,y,b=[0,d[S("0x2")]-1],C=0;C<b[S("0x2")];C++)for(u=b[C],g=1;g<d[u][S("0x2")];g++)v=d[u][g-1],y=d[u][g],s[S("0x4c")](0,v,y);for(var w=[0,d[0][S("0x2")]-1],I=0;I<w[S("0x2")];I++)for(g=w[I],u=1;u<d[S("0x2")];u++)v=d[u-1][g],y=d[u][g],s[S("0x4c")](0,v,y);o=new Float32Array(o),s=new Int16Array(s),l=new Float32Array(l);var A={position:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:o}),st:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:2,values:l})},_=e[S("0x4e")][S("0x4f")](o),G=new(e[S("0x50")])({attributes:A,indices:s,primitiveType:e[S("0x51")][S("0x52")],boundingSphere:_});return(0,a[S("0x1f")])(G),e[S("0x53")][S("0x5b")](G),o=[],s=[],G},t[S("0x5c")]=function(i,n,a,r){var o={length:a,zReverse:r,bottomHeight:a,bottomWidth:a,topHeight:a,topWidth:a};return i=e[S("0x5d")][S("0x5e")](i),n=e[S("0x5d")][S("0x5e")](n),r?(o[S("0x40")]=0,o[S("0x3e")]=0,o[S("0x44")]=a*Math[S("0x5f")](i),o[S("0x42")]=a*Math[S("0x5f")](n)):(o[S("0x44")]=0,o[S("0x42")]=0,o[S("0x40")]=a*Math[S("0x5f")](i),o[S("0x3e")]=a*Math[S("0x5f")](n)),new t(o)},e.Scene[S("0x4a")]=t}(),function(){if(!e[S("0x60")]){function t(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")]}Object[S("0x1d")](e.Scene,S("0x1e"),{value:!0}),e.Scene[S("0x60")]=void 0;var i=new(e[S("0x63")]),n=new(e[S("0x9")]),a=new(e[S("0x18")]);t[S("0x4b")]=function(t){var n=t[S("0x2")],a=t[S("0x61")],r=t[S("0x62")],o=t[S("0x49")],s=2*Math.PI/(o-1),l=[],c=[],h=[],x=[],d=[r,a],u=[0,t[S("0x47")]?-n:n],p=0,g=Math[S("0x64")](r-a,n),m=i;m.z=Math[S("0x65")](g);for(var f=Math[S("0x66")](g),v=0;v<u[S("0x2")];v++){x[v]=[];for(var y=d[v],b=0;b<o;b++){x[v][S("0x4c")](p++);var C=s*b,w=y*Math[S("0x66")](C),I=y*Math[S("0x65")](C);l[S("0x4c")](w,I,u[v]),w=f*Math[S("0x66")](C),I=f*Math[S("0x65")](C),c[S("0x4c")](w,I,m.z),h[S("0x4c")](v/(u[S("0x2")]-1),0)}}var A=[];for(v=1;v<u[S("0x2")];v++)for(b=1;b<o;b++){var _=x[v-1][b-1],G=x[v][b-1],W=x[v][b],P=x[v-1][b];A[S("0x4c")](W),A[S("0x4c")](P),A[S("0x4c")](_),A[S("0x4c")](W),A[S("0x4c")](_),A[S("0x4c")](G),b==x[v][S("0x2")]-1&&(_=x[v-1][b],G=x[v][b],W=x[v][0],P=x[v-1][0],A[S("0x4c")](W),A[S("0x4c")](P),A[S("0x4c")](_),A[S("0x4c")](W),A[S("0x4c")](_),A[S("0x4c")](G))}A=new Int16Array(A),l=new Float32Array(l),c=new Float32Array(c),h=new Float32Array(h);var Z={position:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:l}),normal:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:3,values:c}),st:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:2,values:h})},M=e[S("0x4e")][S("0x4f")](l),V=new(e[S("0x50")])({attributes:Z,indices:A,primitiveType:e[S("0x51")][S("0x52")],boundingSphere:M});return l=[],A=[],h=[],V},t[S("0x55")]=function(i,r){if(!r)return t[S("0x4b")](i);e[S("0x11")][S("0x12")](r,e[S("0x9")][S("0x56")],n),n[S("0x57")](a[S("0x13")]);var o=i[S("0x2")],s=i[S("0x61")],l=(i[S("0x62")],i[S("0x49")]),c=2*Math.PI/(l-1),h=[],x=[],d=[],u=[],p=[0,i[S("0x47")]?-o:o],g=0;g=0;h[S("0x4c")](0,0,0),x[S("0x4c")](1,1),g++;for(var m=new(e[S("0x9")]),f=s/15,v=0;v<16;v++){for(var y=f*v,b=[],C=0;C<l;C++){var w=c*C,I=y*Math[S("0x66")](w),A=y*Math[S("0x65")](w);m.x=I,m.y=A,m.z=p[1];var _=(0,e[S("0x20")])(m,r,a);_?(b[S("0x4c")](g),h[S("0x4c")](I,A,p[1]),x[S("0x4c")](v/15,1),g++):(_=n,b[S("0x4c")](-1))}u[S("0x4c")](b)}for(var G,W,P=[0,u[S("0x2")]-1],Z=0;Z<P[S("0x2")];Z++)for(v=P[Z],C=1;C<u[v][S("0x2")];C++)G=u[v][C-1],W=u[v][C],G>=0&&W>=0&&d[S("0x4c")](0,G,W);h=new Float32Array(h),d=new Int32Array(d),x=new Float32Array(x);var M={position:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:h}),st:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:2,values:x})},V=e[S("0x4e")][S("0x4f")](h),X=new(e[S("0x50")])({attributes:M,indices:d,primitiveType:e[S("0x51")][S("0x52")],boundingSphere:V});return(0,e.Scene[S("0x1f")])(X),h=[],d=[],X},t[S("0x58")]=function(t){var n=t[S("0x2")],a=t[S("0x61")],r=t[S("0x62")],o=t[S("0x49")],s=2*Math.PI/(o-1),l=[],c=[],h=[],x=[],d=[r,a],u=[0,t[S("0x47")]?-n:n],p=0,g=Math[S("0x64")](r-a,n),m=i;m.z=Math[S("0x65")](g);for(var f=Math[S("0x66")](g),v=0;v<u[S("0x2")];v++){x[v]=[];for(var y=d[v],b=0;b<o;b++){x[v][S("0x4c")](p++);var C=s*b,w=y*Math[S("0x66")](C),I=y*Math[S("0x65")](C);l[S("0x4c")](w,I,u[v]),w=f*Math[S("0x66")](C),I=f*Math[S("0x65")](C),c[S("0x4c")](w,I,m.z),h[S("0x4c")](v/(u[S("0x2")]-1),0)}}var A=[];for(v=1;v<u[S("0x2")];v++)for(b=1;b<o;b+=1){var _=x[v-1][b-1],G=x[v][b-1];x[v][b],x[v-1][b],b%8==1&&A[S("0x4c")](_,G)}A=new Int16Array(A),l=new Float32Array(l),c=new Float32Array(c),h=new Float32Array(h);var W={position:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:l}),normal:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:3,values:c}),st:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:2,values:h})},P=e[S("0x4e")][S("0x4f")](l),Z=new(e[S("0x50")])({attributes:W,indices:A,primitiveType:e[S("0x51")][S("0x59")],boundingSphere:P});return l=[],A=[],h=[],Z},t[S("0x67")]=function(i,n,a){return i=e[S("0x5d")][S("0x5e")](i),new t({topRadius:Math[S("0x5f")](i)*n/2,bottomRadius:0,length:n,zReverse:a})},e.Scene[S("0x60")]=t}}(),function(){if(typeof i!==S("0x68")&&!e[S("0x69")]){function t(i,n){n=n||{},r=i[S("0x6a")][S("0x39")][S("0x3b")],this[S("0x6b")]=null,this[S("0x6c")]=n[S("0x6d")]?n[S("0x6d")]:t[S("0x6e")][S("0x6f")],this[S("0x70")]=n[S("0x71")]?n[S("0x71")]:10,this[S("0x72")]=n[S("0x73")]?n[S("0x73")]:10,this[S("0x45")]=n[S("0x2")]?n[S("0x2")]:1e6,this[S("0x74")]=n[S("0x3")],this[S("0x75")]=n[S("0x75")],this[S("0x76")]=n[S("0x77")]?n[S("0x77")]:{heading:0,pitch:0,roll:0},this[S("0x78")]=e[S("0x79")](n[S("0x7a")],!0),this[S("0x7b")]=e[S("0x79")](n[S("0x7c")],!1),this[S("0x7d")]=e[S("0x79")](n[S("0x7e")],!1),this[S("0x7f")]=e[S("0x79")](n[S("0x80")],!1),this[S("0x81")]=n[S("0x82")]?n[S("0x82")]:e[S("0x83")][S("0x84")],this[S("0x85")]=n[S("0x86")],this[S("0x87")]=n[S("0x88")],this[S("0x89")]=n[S("0x8a")],this[S("0x8b")]=e[S("0x11")][S("0x57")](e[S("0x11")][S("0x8c")]),this[S("0x8d")]=new(e[S("0x29")]),this[S("0x8e")]=new(e[S("0x9")]),this[S("0x8f")]=new(e[S("0x9")])(1,1,1),this[S("0x90")]=new(e[S("0x11")]),this[S("0x91")]=new(e[S("0x11")]),this[S("0x92")]=new(e[S("0x1b")]),this[S("0x93")]=null,this[S("0x94")]=[],this[S("0x95")]=[],this[S("0x96")]=[],this[S("0x97")]=n[S("0x98")],this[S("0x99")]=[],this[S("0x9a")]=[],this[S("0x9b")]={geometry:null,needsUpdate:!1,lastestFrame:null},this[S("0x9c")]=i,this[S("0x9c")][S("0x6a")][S("0x9d")][S("0x9e")](this),this[S("0x9f")](this[S("0x7d")]||this[S("0x7f")])}function n(t){var e=[];for(var i in t[S("0x1")])t[S("0x1")][S("0xa0")](i)&&t[S("0x1")][i]&&e[S("0x4c")](i);return e}function a(t,i,n,a,r,h,x){r=r||e[S("0xf")][S("0x10")],h||(h=[]),e[S("0x11")][S("0x27")](i,o),e[S("0x11")][S("0x12")](i,e[S("0x9")][S("0x56")],l),l[S("0x57")](c[S("0x13")]);var d=0;a=Math[S("0xa1")](t[S("0x2")],n+a);for(var u=n;u<a;u+=3){e[S("0x9")][S("0xa2")](t,u,s),e[S("0x11")][S("0x12")](i,s,l),e[S("0x9")][S("0xb")](l,c[S("0x13")],c[S("0x14")]),e[S("0x9")][S("0x15")](c[S("0x14")],c[S("0x14")]);var p=e[S("0x16")][S("0x17")](c,r),g=null;p&&(g=e[S("0x18")][S("0x19")](c,p[S("0x1a")])),g?(g[S("0x57")](l),h[d]=l[S("0x57")](h[d]),x&&x instanceof Float32Array&&(e[S("0x11")][S("0x12")](o,l,l),x[n+3*d]=l.x,x[n+3*d+1]=l.y,x[n+3*d+2]=l.z),d++):d++}return h}e.Scene[S("0x69")]=void 0;var r,o=new(e[S("0x11")]),s=new(e[S("0x9")]),l=new(e[S("0x9")]),c=new(e[S("0x18")]),h=new(e[S("0x1b")]);t[S("0x6e")]={Cone:1,FourPrism:2},Object[S("0xa3")](t[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")]=[]}}}),t[S("0xa4")][S("0x9f")]=function(t){if(t&&!this[S("0xa9")]){var i=this,n=new(e[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(e[S("0xac")])((function(t){return n[S("0xad")]=i[S("0x96")],n}),!1)},polyline:{show:this[S("0x7f")],material:this[S("0x89")]||this[S("0x87")]||this[S("0x81")],width:1.5,positions:new(e[S("0xac")])((function(t){return i[S("0x96")]}),!1)}})}},t[S("0xa4")][S("0xa5")]=function(){this[S("0x94")][S("0xae")]((function(t){t[S("0xaf")][S("0xb0")]()})),this[S("0x94")]=[]},t[S("0xa4")][S("0xb1")]=function(t,i){if(!t||!t[S("0x2")])throw new Error(S("0xb2"));for(var a=[],r=!1,o=!1,s=t[0][S("0xb3")],l=0;l<t[S("0x2")];l++){if(a[l]=n(t[l]),l>0){if(s!=t[l][S("0xb3")]){o=!0;break}var c=a[l-1];if(!(r=c[S("0x2")]!=a[l][S("0x2")]))for(var h=0;h<c[S("0x2")];h++)if(c[h]!=a[l][h]){r=!0;break}}if(s=t[l][S("0xb3")],r||o)break}if(o)throw new Error(S("0xb4"));if(r)throw new Error(S("0xb5"));var x={},d=a[0];for(l=0;l<d[S("0x2")];l++){var u=d[l],p=t[0];for(var g in x[u]={},p[S("0x1")][u])p[S("0x1")][u][S("0xa0")](g)&&(x[u][g]=p[S("0x1")][u][g]);var m=Array[S("0xb6")](x[u][S("0x4")]);for(h=1;h<t[S("0x2")];h++){p=t[h];for(var f=0;f<p[S("0x1")][u][S("0x4")][S("0x2")];f++)m[S("0x4c")](p[S("0x1")][u][S("0x4")][f])}x[u][S("0x4")]=new(x[u][S("0x4")][S("0xb7")])(m)}var v=[],y=0;for(h=0;h<t[S("0x2")];h++){for(p=t[0],l=0;l<p[S("0x0")][S("0x2")];l++)v[S("0x4c")](p[S("0x0")][l]+y);y+=p[S("0x1")][S("0x3")][S("0x4")][S("0x2")]/3}var b=e[S("0x4e")][S("0x4f")](x[S("0x3")][S("0x4")]);return new(e[S("0x50")])({attributes:x,indices:new Int32Array(v),primitiveType:t[0][S("0xb3")],boundingSphere:b})},t[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{this[S("0x9b")][S("0xb9")]=[];for(i=0;i<this[S("0x95")][S("0x2")];i++)this[S("0x9b")][S("0xb9")][S("0x4c")](this[S("0x95")][i][S("0x57")]())}var n=this[S("0xbb")](t);if(this[S("0x9a")][S("0x4c")](n),this[S("0x9b")][S("0xbc")]){var a=this[S("0x9b")][S("0xbc")][S("0x1")];for(var i in a)a[S("0xa0")](i)&&delete a[i];for(var 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};var x=new(e[S("0x29")]);t[S("0xa4")][S("0xbd")]=function(t,i){if(this[S("0x93")]||(this[S("0x93")]=new(e[S("0x9")])),this[S("0x3")]instanceof e[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 e[S("0x9")]&&(this[S("0x93")]=this[S("0x3")][S("0xc0")]),!this[S("0x93")])return this[S("0x90")];if(this[S("0x8b")]=e[S("0x24")][S("0x25")](this[S("0x93")],r,this[S("0x8b")]),this[S("0x92")]=e[S("0x1b")][S("0x1c")](this[S("0x93")],r,this[S("0x92")]),e[S("0x24")][S("0x25")](this[S("0x93")],r,this[S("0x8b")]),this[S("0x75")]&&this[S("0x97")]&&this[S("0x97")][S("0xc1")]){var n=e[S("0xc2")][S("0xc3")](this[S("0x97")][S("0xc1")],t,x),a=e[S("0x11")][S("0x2c")](this[S("0x93")],n);this[S("0x76")][S("0xa6")]=a[S("0xa6")]}return e[S("0x29")][S("0xc4")](this[S("0x76")],this[S("0x8d")]),this[S("0x90")]=e[S("0x11")][S("0xc5")](this[S("0x8e")],this[S("0x8d")],this[S("0x8f")],this[S("0x90")]),e[S("0x11")][S("0xc6")](this[S("0x8b")],this[S("0x90")],this[S("0x90")]),e[S("0x11")][S("0xc7")](this[S("0x90")],this[S("0x91")]),this[S("0x90")]},t[S("0xa4")][S("0xc8")]=function(t,n){var o=this[S("0x95")];if(n){if(this[S("0xbd")](n),!this[S("0x93")])return;o=a(this[S("0xc9")],this[S("0x90")],3,this[S("0xc9")][S("0x2")]-3,r,null,this[S("0x6b")][S("0x1")][S("0x3")][S("0x4")])}for(var s=[],l=0;l<o[S("0x2")];l++){var c=o[l];e[S("0x1b")][S("0x1c")](c,void 0,h);var x=[e[S("0x5d")][S("0xca")](h[S("0xcb")]),e[S("0x5d")][S("0xca")](h[S("0xcc")])];t&&(x[0]=parseFloat(x[0][S("0xcd")](t)),x[1]=parseFloat(x[1][S("0xcd")](t))),s[S("0x4c")](i[S("0xce")](x))}var d=[];if(s[S("0x2")]>0){s=i[S("0xcf")](s);var u=i[S("0xd0")](s);if(u){var p=i[S("0xd1")](u);p&&p[S("0x2")]>0&&(d=p[0])}}return d},t[S("0xa4")][S("0xbb")]=function(t){for(var i=[],n=[],a=0,r=0;r<this[S("0x95")][S("0x2")];r+=2){var o=this[S("0x95")][0];i[S("0x4c")](o.x,o.y,o.z),n[S("0x4c")](a++)}return i=new Float32Array(i),n=new Int32Array(n),new(e[S("0x50")])({attributes:{position:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:i})},primitiveType:e[S("0x51")][S("0x59")],indices:n,boundingSphere:e[S("0x4e")][S("0x4f")](i)})},t[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")])},t[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")]=[]}},t[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")])},t[S("0xa4")][S("0xd5")]=function(){this[S("0x6c")]==t[S("0x6e")][S("0xd6")]?(this[S("0x6b")]=e[S("0xd7")][S("0x55")](e[S("0xd7")][S("0x67")](this[S("0x70")],this[S("0x45")],!0),this[S("0x90")]),this[S("0xd3")]=e[S("0xd7")][S("0x58")](e[S("0xd7")][S("0x67")](this[S("0x70")],this[S("0x45")],!0))):(this[S("0x6b")]=e.Scene[S("0x4a")][S("0x55")](e.Scene[S("0x4a")][S("0x5c")](this[S("0x70")],this[S("0x72")],this[S("0x45")],!0),this[S("0x90")]),this[S("0xd3")]=e.Scene[S("0x4a")][S("0x58")](e.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 i=0;i<this[S("0xc9")][S("0x2")];i++)this[S("0xc9")][i]=this[S("0x6b")][S("0x1")][S("0x3")][S("0x4")][i];this[S("0x95")]=[]},t[S("0xa4")][S("0xd8")]=function(){var t=1+this[S("0x96")][S("0x2")],i=new Float32Array(3+3*this[S("0x96")][S("0x2")]),n=0;i[n++]=this[S("0x93")].x,i[n++]=this[S("0x93")].y,i[n++]=this[S("0x93")].z;for(var a=0;a<this[S("0x96")][S("0x2")];a++)i[n++]=this[S("0x96")][a].x,i[n++]=this[S("0x96")][a].y,i[n++]=this[S("0x96")][a].z;var r=[],o=[];for(a=1;a<t-1;a++)r[S("0x4c")](0,a,a+1),o[S("0x4c")](0,a);r=t>=65535?new Uint32Array(r):new Uint16Array(r);var s={position:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:i})},l=e[S("0x4e")][S("0x4f")](i),c=new(e[S("0x50")])({attributes:s,indices:r,primitiveType:e[S("0x51")][S("0x52")],boundingSphere:l}),h=new(e[S("0x50")])({attributes:s,indices:new Uint32Array(o),primitiveType:e[S("0x51")][S("0x59")],boundingSphere:l});(0,e.Scene[S("0x1f")])(c),this[S("0xd9")]=c,this[S("0xda")]=h},t[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")]=a(this[S("0xc9")],this[S("0x90")],3,this[S("0xc9")][S("0x2")]-3,r,this[S("0x95")],this[S("0x6b")][S("0x1")][S("0x3")][S("0x4")]),this[S("0x96")][S("0xdd")](0,this[S("0x96")][S("0x2")]);var i=this[S("0xc8")]();if(i&&i[S("0x2")]){for(var n=0;n<i[S("0x2")];n++){var o=i[n];this[S("0x96")][S("0x4c")](e[S("0x9")][S("0xde")](o[0],o[1]))}t[S("0x34")]===e[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,e[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,e[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)}},t[S("0xa4")][S("0xe6")]=function(t){return S("0xe7")},t[S("0xa4")][S("0xe8")]=function(t){return S("0xe9")},t[S("0xa4")][S("0xe0")]=function(t,i,n){var a=i[S("0xea")],r=new(e[S("0x9")]);e[S("0x11")][S("0x12")](this[S("0x90")],t[S("0xeb")][S("0xec")],r);var o=(new(e[S("0x4e")])(r,t[S("0xeb")][S("0xed")]),new(e[S("0xee")])({modelMatrix:n||this[S("0x90")],owner:this,primitiveType:t[S("0xb3")],pass:e[S("0xef")][S("0xf0")]})),s=this,l=e[S("0x53")][S("0xf1")](t);return o[S("0xaf")]=e[S("0xf2")][S("0xf3")]({context:a,geometry:t,attributeLocations:l,bufferUsage:e[S("0xf4")][S("0xf5")]}),o[S("0xaf")][S("0xf6")]=l,o[S("0xf7")]=e[S("0xf8")][S("0xf9")]({context:a,vertexShaderSource:this[S("0xe8")](t),fragmentShaderSource:this[S("0xe6")](t),attributeLocations:l}),o[S("0xfa")]=e[S("0xfb")][S("0xfc")]({blending:e[S("0xfd")][S("0xfe")],depthTest:{enabled:!0,func:e[S("0xff")][S("0x100")]},cull:{enabled:!1,face:e[S("0x101")][S("0x102")]},depthMask:!1}),o[S("0x103")]={},o[S("0x103")][S("0x104")]=function(){return i[S("0xea")][S("0x105")][S("0x106")]},o[S("0x103")][S("0x107")]=function(){return i[S("0xea")][S("0x105")][S("0x108")]},o[S("0x103")][S("0x109")]=function(){return s[S("0x109")]||(s[S("0x109")]=0),s[S("0x109")]},o[S("0x103")][S("0x10a")]=function(){return s[S("0x10a")]||(s[S("0x10a")]=new(e[S("0x9")])(.2,.2,.2)),s[S("0x10a")]},o[S("0x103")][S("0x10b")]=function(){return s[S("0x10b")]||(s[S("0x10b")]=0),s[S("0x10b")]},o[S("0x103")][S("0x10c")]=function(){return t[S("0xb3")]==e[S("0x51")][S("0x59")]},o[S("0x103")][S("0x81")]=function(){return t[S("0x82")]?t[S("0x82")]:t[S("0xb3")]==e[S("0x51")][S("0x59")]?s[S("0x85")]||s[S("0x81")]||new(e[S("0x83")])(1,1,0,.5):s[S("0x81")]||new(e[S("0x83")])(1,0,0,1)},o[S("0x103")][S("0x10d")]=function(){return s[S("0x10d")]||(s[S("0x10d")]=0),s[S("0x10d")]},o[S("0x103")][S("0x10e")]=function(){return s[S("0x10e")]||(s[S("0x10e")]=new(e[S("0x83")])(1,1,0,1)),s[S("0x10e")]},o[S("0x103")][S("0x10f")]=function(){return i[S("0xea")][S("0x105")][S("0x5")]},o[S("0x103")][S("0x110")]=function(){return.25},o},e.Scene[S("0x111")]=a,e.Scene[S("0x69")]=t}}(),function(){if(!e[S("0x112")]){function t(t,n){n=n||{},i=t[S("0x6a")][S("0x39")][S("0x3b")],this[S("0x6b")]=null,this[S("0x113")]=n[S("0x114")],this[S("0x115")]=n[S("0xed")]?n[S("0xed")]:5,this[S("0x74")]=n[S("0x3")],this[S("0x76")]=n[S("0x77")]?n[S("0x77")]:{heading:0,pitch:0,roll:0},this[S("0x97")]=n[S("0x98")],this[S("0x81")]=n[S("0x82")]?n[S("0x82")]:e[S("0x83")][S("0x84")],this[S("0x85")]=n[S("0x86")]?n[S("0x86")]:this[S("0x81")],this[S("0x78")]=e[S("0x79")](n[S("0x7a")],!0),this[S("0x7b")]=e[S("0x79")](n[S("0x7c")],!1),this[S("0x116")]=e[S("0x79")](n[S("0x117")],!0),this[S("0x118")]=e[S("0x79")](n[S("0x119")],!0),this[S("0x8b")]=e[S("0x11")][S("0x57")](e[S("0x11")][S("0x8c")]),this[S("0x8d")]=new(e[S("0x29")]),this[S("0x8e")]=new(e[S("0x9")]),this[S("0x8f")]=new(e[S("0x9")])(1,1,1),this[S("0x90")]=new(e[S("0x11")]),this[S("0x91")]=new(e[S("0x11")]),this[S("0x92")]=new(e[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")]=e[S("0x79")](n[S("0x7e")],!1),this[S("0x9f")](this[S("0x7d")])}var i;e.Scene[S("0x112")]=void 0,Object[S("0xa3")](t[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}}}),t[S("0xa4")][S("0x11a")]=function(){this[S("0x11b")]=this[S("0x115")]*Math[S("0x66")](e[S("0x5d")][S("0x5e")](this[S("0x113")]))},t[S("0xa4")][S("0x9f")]=function(t){if(t&&!this[S("0xa9")]){var i=this;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(e[S("0xac")])((function(t){return i[S("0x11b")]}),!1),semiMajorAxis:new(e[S("0xac")])((function(t){return i[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(e[S("0xac")])((function(t){return i[S("0x11c")]?e[S("0x9")][S("0x11d")](i[S("0x74")],i[S("0x11c")])>i[S("0x115")]?[]:[i[S("0x74")],i[S("0x11c")]]:[]}),!1),followSurface:!1,material:new(e[S("0x11e")])({color:e[S("0x83")][S("0x11f")]}),width:1}})}};var n=new(e[S("0x9")]);t[S("0xa4")][S("0xbd")]=function(t,a){if(this[S("0x93")]||(this[S("0x93")]=new(e[S("0x9")])),this[S("0x3")]instanceof e[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 e[S("0x9")]&&(this[S("0x93")]=this[S("0x3")][S("0xc0")]),this[S("0x97")]&&this[S("0x97")][S("0x3")]){var r=this[S("0x93")],o=e[S("0xc2")][S("0xc3")](this[S("0x97")][S("0x3")],t,n);if(o){this[S("0x11c")]=o;var s=mars3d[S("0x120")][S("0x121")](r,o,i);this[S("0x76")][S("0xa6")]=s[S("0xa6")],this[S("0x76")][S("0xa7")]=s[S("0xa7")],this[S("0x76")][S("0xa8")]=s[S("0xa8")]}}return this[S("0x8b")]=e[S("0x24")][S("0x25")](this[S("0x93")],i,this[S("0x8b")]),this[S("0x92")]=e[S("0x1b")][S("0x1c")](this[S("0x93")],i,this[S("0x92")]),e[S("0x24")][S("0x25")](this[S("0x93")],i,this[S("0x8b")]),e[S("0x29")][S("0xc4")](this[S("0x76")],this[S("0x8d")]),this[S("0x90")]=e[S("0x11")][S("0xc5")](this[S("0x8e")],this[S("0x8d")],this[S("0x8f")],this[S("0x90")]),e[S("0x11")][S("0xc6")](this[S("0x8b")],this[S("0x90")],this[S("0x90")]),e[S("0x11")][S("0xc7")](this[S("0x90")],this[S("0x91")]),this[S("0x90")]},t[S("0xa4")][S("0x122")]=function(){for(var t=this[S("0xed")],i=[],n=[],a=[],r=[],o=90-parseInt(this[S("0x114")]),s=o<1?o/8:1,l=2*Math.PI/127,c=0,h=this[S("0x114")];h<91;h+=s){var x=e[S("0x5d")][S("0x5e")](h<90?h:90);x=Math[S("0x66")](x)*t;for(var d=[],u=0;u<128;u++){var p=l*u,g=x*Math[S("0x66")](p),m=x*Math[S("0x65")](p),f=Math[S("0xe")](t*t-g*g-m*m);i[S("0x4c")](g,m,f),n[S("0x4c")](1,1),d[S("0x4c")](c++)}r[S("0x4c")](d)}for(h=1;h<r[S("0x2")];h++)for(u=1;u<r[h][S("0x2")];u++){var v=r[h-1][u-1],y=r[h][u-1],b=r[h][u],C=r[h-1][u];a[S("0x4c")](v,y,b),a[S("0x4c")](v,b,C)}i=new Float32Array(i),a=new Int32Array(a),n=new Float32Array(n);var w={position:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:i}),st:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:2,values:n})},I=e[S("0x4e")][S("0x4f")](i),A=new(e[S("0x50")])({attributes:w,indices:a,primitiveType:e[S("0x51")][S("0x52")],boundingSphere:I});return(0,e.Scene[S("0x1f")])(A),A},t[S("0xa4")][S("0x123")]=function(){for(var t=this[S("0xed")],i=[],n=[],a=[],r=[],o=90-parseInt(this[S("0x114")]),s=o<1?o/8:1,l=2*Math.PI/127,c=0,h=this[S("0x114")];h<91;h+=s){var x=e[S("0x5d")][S("0x5e")](h<90?h:90);x=Math[S("0x66")](x)*t;for(var d=[],u=0;u<128;u++){var p=l*u,g=x*Math[S("0x66")](p),m=x*Math[S("0x65")](p),f=Math[S("0xe")](t*t-g*g-m*m);i[S("0x4c")](g,m,f),n[S("0x4c")](1,1),d[S("0x4c")](c++)}r[S("0x4c")](d)}for(h=1;h<r[S("0x2")];h++)for(u=1;u<r[h][S("0x2")];u++){var v=r[h-1][u-1],y=r[h][u-1],b=r[h][u];r[h-1][u],u%8==1&&a[S("0x4c")](v,y),h%8==1&&a[S("0x4c")](y,b)}i=new Float32Array(i),a=new Int32Array(a),n=new Float32Array(n);var C={position:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x4d")],componentsPerAttribute:3,values:i}),st:new(e[S("0x6")])({componentDatatype:e[S("0x7")][S("0x8")],componentsPerAttribute:2,values:n})},w=e[S("0x4e")][S("0x4f")](i),I=new(e[S("0x50")])({attributes:C,indices:a,primitiveType:e[S("0x51")][S("0x59")],boundingSphere:w});return(0,e.Scene[S("0x1f")])(I),I},t[S("0xa4")][S("0xd5")]=function(){this[S("0x6b")]=e.Scene[S("0x60")][S("0x55")](new(e.Scene[S("0x60")])({topRadius:this[S("0x115")]*Math[S("0x66")](e[S("0x5d")][S("0x5e")](this[S("0x114")])),bottomRadius:0,length:this[S("0x115")]*Math[S("0x65")](e[S("0x5d")][S("0x5e")](this[S("0x114")]))})),this[S("0x124")]=this[S("0x122")](),this[S("0x125")]=this[S("0x123")](),this[S("0xd3")]=e.Scene[S("0x60")][S("0x58")](new(e.Scene[S("0x60")])({topRadius:this[S("0x115")]*Math[S("0x66")](e[S("0x5d")][S("0x5e")](this[S("0x114")])),bottomRadius:0,slices:128,length:this[S("0x115")]*Math[S("0x65")](e[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")]))},t[S("0xa4")][S("0xdb")]=function(t){this[S("0x78")]&&(this[S("0xbd")](t[S("0xdc")]),t[S("0x34")]===e[S("0x35")][S("0x36")]?(this[S("0x6b")][S("0xeb")]=e[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")],t)),this[S("0x7b")]&&this[S("0x94")][S("0x4c")](this[S("0xe0")](this[S("0xd3")],t)),this[S("0x116")]&&(this[S("0x94")][S("0x4c")](this[S("0xe0")](this[S("0x124")],t)),this[S("0x118")]&&this[S("0x94")][S("0x4c")](this[S("0xe0")](this[S("0x125")],t)))),this[S("0x94")][S("0xae")]((function(e){t[S("0xe1")][S("0x4c")](e)})),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")])))},t[S("0xa4")][S("0xe6")]=function(t){return S("0x127")},t[S("0xa4")][S("0xe8")]=function(t){return S("0x128")},t[S("0xa4")][S("0xe0")]=function(t,i,n){var a=i[S("0xea")],r=new(e[S("0x9")]);e[S("0x11")][S("0x12")](this[S("0x90")],t[S("0xeb")][S("0xec")],r);var o=new(e[S("0x4e")])(r,t[S("0xeb")][S("0xed")]),s=new(e[S("0xee")])({modelMatrix:n||this[S("0x90")],owner:this,primitiveType:t[S("0xb3")],pass:e[S("0xef")][S("0x129")],boundingVolume:o}),l=this,c=e[S("0x53")][S("0xf1")](t);return s[S("0xaf")]=e[S("0xf2")][S("0xf3")]({context:a,geometry:t,attributeLocations:c,bufferUsage:e[S("0xf4")][S("0xf5")]}),s[S("0xaf")][S("0xf6")]=c,s[S("0xf7")]=e[S("0xf8")][S("0xf9")]({context:a,vertexShaderSource:this[S("0xe8")](t),fragmentShaderSource:this[S("0xe6")](t),attributeLocations:c}),s[S("0xfa")]=e[S("0xfb")][S("0xfc")]({blending:e[S("0xfd")][S("0xfe")],depthTest:{enabled:!0,func:e[S("0xff")][S("0x100")]},cull:{enabled:!1,face:e[S("0x101")][S("0x102")]}}),s[S("0x103")]={},s[S("0x103")][S("0x104")]=function(){return i[S("0xea")][S("0x105")][S("0x106")]},s[S("0x103")][S("0x107")]=function(){return i[S("0xea")][S("0x105")][S("0x108")]},s[S("0x103")][S("0x109")]=function(){return l[S("0x109")]||(l[S("0x109")]=0),l[S("0x109")]},s[S("0x103")][S("0x10a")]=function(){return l[S("0x10a")]||(l[S("0x10a")]=new(e[S("0x9")])(.2,.2,.2)),l[S("0x10a")]},s[S("0x103")][S("0x10b")]=function(){return l[S("0x10b")]||(l[S("0x10b")]=0),l[S("0x10b")]},s[S("0x103")][S("0x10c")]=function(){return t[S("0xb3")]==e[S("0x51")][S("0x59")]||t[S("0xb3")]==e[S("0x51")][S("0x12a")]},s[S("0x103")][S("0x81")]=function(){return t[S("0xb3")]==e[S("0x51")][S("0x59")]||t[S("0xb3")]==e[S("0x51")][S("0x12a")]?(l[S("0x85")]||(l[S("0x85")]=new(e[S("0x83")])(1,1,0,1)),l[S("0x85")]):(l[S("0x81")]||(l[S("0x81")]=new(e[S("0x83")])(1,0,0,1)),l[S("0x81")])},s[S("0x103")][S("0x10d")]=function(){return l[S("0x10d")]||(l[S("0x10d")]=0),l[S("0x10d")]},s[S("0x103")][S("0x10e")]=function(){return l[S("0x10e")]||(l[S("0x10e")]=new(e[S("0x83")])(1,1,0,1)),l[S("0x10e")]},s[S("0x103")][S("0x10f")]=function(){return i[S("0xea")][S("0x105")][S("0x5")]},s[S("0x103")][S("0x110")]=function(){return.25},s},t[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")])},t[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")])},t[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")]=[])},e.Scene[S("0x112")]=t}}(),function(){function t(t,e){var i=t,n=e,a=Math[S("0x66")],r=Math[S("0x65")];return[a(-i)*a(n),r(-i)*a(n),r(n)]}function i(t,e,i,n){return t+n/i*(e-t)}function n(t,e){var i=e[S("0x229")]((function(e){return e[S("0x22a")]>t}));if(i>0){var n=e[i-1],a=e[i],r=(t-n[S("0x22a")])/(a[S("0x22a")]-n[S("0x22a")]);return n[S("0xed")]*(1-r)+a[S("0xed")]*r}}function a(e,a,r,o,s,l,c){for(var h=new Float32Array((s+1)*(l+1)*3),x=0;x<s+1;++x)for(var d=0;d<l+1;++d){var u=i(r,o,l,d),p=t(i(e,a,s,x),u),g=c?n(u,c):1;h[3*(d*(s+1)+x)+0]=p[0]*g,h[3*(d*(s+1)+x)+1]=p[1]*g,h[3*(d*(s+1)+x)+2]=p[2]*g}return h}function r(e,a,r,o,s,l,c){for(var h=new Float32Array((o+1)*(s+1)*3),x=0;x<o+1;++x)for(var d=0;d<s+1;++d){var u=i(a,r,s,d),p=t(e,u),g=i(l?n(u,l):1,c?n(u,c):1,o,x);h[3*(d*(o+1)+x)+0]=p[0]*g,h[3*(d*(o+1)+x)+1]=p[1]*g,h[3*(d*(o+1)+x)+2]=p[2]*g}return h}function o(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[c+0]=r,i[c+1]=o,i[c+2]=l,i[c+3]=r,i[c+4]=l,i[c+5]=s}return i}function s(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*(a+1)+c,o[2*(s*r+l)+1]=(l+1)*(a+1)+c}for(var h=(t+1)*(2*r),x=0;x<e+1;++x)for(var d=0;d<a;++d){var u=x*n;o[h+2*(d+x*a)+0]=u*(a+1)+d,o[h+2*(d+x*a)+1]=u*(a+1)+d+1}return o}function l(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")]=e[S("0x79")](t[S("0x140")],e[S("0x11")][S("0x8c")]),this[S("0x22e")]=e[S("0x79")](t[S("0x22e")],e[S("0x5d")][S("0x5e")](-50)),this[S("0x22f")]=e[S("0x79")](t[S("0x22f")],e[S("0x5d")][S("0x5e")](50)),this[S("0x230")]=e[S("0x79")](t[S("0x230")],e[S("0x5d")][S("0x5e")](5)),this[S("0x231")]=e[S("0x79")](t[S("0x231")],e[S("0x5d")][S("0x5e")](85)),this[S("0x232")]=e[S("0x79")](t[S("0x232")],20),this[S("0x233")]=e[S("0x79")](t[S("0x233")],20),this[S("0x234")]=e[S("0x79")](t[S("0x234")],3),this[S("0x235")]=e[S("0x79")](t[S("0x235")],3),this[S("0x236")]=e[S("0x79")](t[S("0x236")],new(e[S("0x83")])(1,1,0,.5)),this[S("0x86")]=e[S("0x79")](t[S("0x86")],new(e[S("0x83")])(1,0,0)),this[S("0x7a")]=e[S("0x79")](t[S("0x7a")],!0),this[S("0x8b")]=e[S("0x11")][S("0x57")](e[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(e[S("0x4e")]),this[S("0x23f")]=void 0,this[S("0x240")]=void 0}l[S("0xa4")][S("0x241")]=function(t){var e=this[S("0x23d")]*this[S("0x23b")],i=this[S("0x23e")]*this[S("0x23c")],n=a(this[S("0x237")],this[S("0x238")],this[S("0x239")],this[S("0x23a")],e,i,this[S("0x242")]),r=a(this[S("0x237")],this[S("0x238")],this[S("0x239")],this[S("0x23a")],e,i,this[S("0x242")]),l=o(e,i),c=s(this[S("0x23b")],this[S("0x23c")],this[S("0x23d")],this[S("0x23e")]);return this[S("0x243")](t,n,r,l,c)},l[S("0xa4")][S("0x244")]=function(t){var e=this[S("0x23d")]*this[S("0x23b")],i=this[S("0x23e")]*this[S("0x23c")],n=a(this[S("0x237")],this[S("0x238")],this[S("0x239")],this[S("0x23a")],e,i,this[S("0x245")]),r=a(this[S("0x237")],this[S("0x238")],this[S("0x239")],this[S("0x23a")],e,i,this[S("0x245")]),l=o(e,i),c=s(this[S("0x23b")],this[S("0x23c")],this[S("0x23d")],this[S("0x23e")]);return this[S("0x243")](t,n,r,l,c)},l[S("0xa4")][S("0x246")]=function(t){var e=this[S("0x23e")]*this[S("0x23c")],i=r(this[S("0x237")],this[S("0x239")],this[S("0x23a")],10,e,this[S("0x245")],this[S("0x242")]),n=r(this[S("0x237")],this[S("0x239")],this[S("0x23a")],10,e,this[S("0x245")],this[S("0x242")]),a=o(10,e),l=s(10,this[S("0x23c")],1,this[S("0x23e")]);return this[S("0x243")](t,i,n,a,l)},l[S("0xa4")][S("0x247")]=function(t){var e=this[S("0x23e")]*this[S("0x23c")],i=r(this[S("0x238")],this[S("0x239")],this[S("0x23a")],10,e,this[S("0x245")],this[S("0x242")]),n=r(this[S("0x238")],this[S("0x239")],this[S("0x23a")],10,e,this[S("0x245")],this[S("0x242")]),a=o(10,e),l=s(10,this[S("0x23c")],1,this[S("0x23e")]);return this[S("0x243")](t,i,n,a,l)},l[S("0xa4")][S("0x243")]=function(t,i,n,a,r){var o=this,s=e[S("0x248")][S("0x249")](!0,!1,void 0),l=e[S("0xfb")][S("0xfc")](s),c=new(e[S("0x136")])({sources:[S("0x24a")]}),h=new(e[S("0x136")])({sources:[S("0x24b")]}),x={xbsjColor:function(){return o[S("0x236")]}},d={xbsjColor:function(){return o[S("0x86")]}},u=e[S("0xf8")][S("0xfc")]({context:t,vertexShaderSource:c,fragmentShaderSource:h,attributeLocations:{position:0,normal:1}}),p=e[S("0x135")][S("0x190")]({context:t,typedArray:i,usage:e[S("0xf4")][S("0xf5")]}),g=e[S("0x135")][S("0x190")]({context:t,typedArray:n,usage:e[S("0xf4")][S("0xf5")]}),m=e[S("0x135")][S("0x24c")]({context:t,typedArray:a,usage:e[S("0xf4")][S("0xf5")],indexDatatype:e[S("0x1a1")][S("0x24d")]}),f=e[S("0x135")][S("0x24c")]({context:t,typedArray:r,usage:e[S("0xf4")][S("0xf5")],indexDatatype:e[S("0x1a1")][S("0x24d")]}),v=new(e[S("0xf2")])({context:t,attributes:[{index:0,vertexBuffer:p,componentsPerAttribute:3,componentDatatype:e[S("0x7")][S("0x8")]},{index:1,vertexBuffer:g,componentsPerAttribute:3,componentDatatype:e[S("0x7")][S("0x8")]}],indexBuffer:m}),y=new(e[S("0xf2")])({context:t,attributes:[{index:0,vertexBuffer:p,componentsPerAttribute:3,componentDatatype:e[S("0x7")][S("0x8")]},{index:1,vertexBuffer:g,componentsPerAttribute:3,componentDatatype:e[S("0x7")][S("0x8")]}],indexBuffer:f}),b=e[S("0x4e")][S("0x4f")](i);return{command:new(e[S("0xee")])({vertexArray:v,primitiveType:e[S("0x51")][S("0x52")],renderState:l,shaderProgram:u,uniformMap:x,owner:this,pass:e[S("0xef")][S("0x129")],modelMatrix:new(e[S("0x11")]),boundingVolume:new(e[S("0x4e")]),cull:!0}),lineCommand:new(e[S("0xee")])({vertexArray:y,primitiveType:e[S("0x51")][S("0x59")],renderState:l,shaderProgram:u,uniformMap:d,owner:this,pass:e[S("0xef")][S("0x129")],modelMatrix:new(e[S("0x11")]),boundingVolume:new(e[S("0x4e")]),cull:!0}),initBoundingSphere:b}},l[S("0xa4")][S("0xdb")]=function(t){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")]=e[S("0x57")](e[S("0x11")][S("0x8c")]),this[S("0x24e")]()),e[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")](t[S("0xea")])),this[S("0x24f")][S("0x4c")](this[S("0x246")](t[S("0xea")])),this[S("0x24f")][S("0x4c")](this[S("0x247")](t[S("0xea")])),this[S("0x24f")][S("0x4c")](this[S("0x244")](t[S("0xea")]))),e[S("0x11")][S("0xba")](this[S("0x140")],this[S("0x8b")])||(e[S("0x11")][S("0x57")](this[S("0x140")],this[S("0x8b")]),this[S("0x24f")][S("0xae")]((function(t){t[S("0x250")][S("0x140")]=e[S("0x11")][S("0x8c")],t[S("0x250")][S("0x140")]=i[S("0x8b")],t[S("0x250")][S("0x251")]=e[S("0x4e")][S("0x180")](t[S("0x252")],i[S("0x8b")],i[S("0x166")]),t[S("0x253")][S("0x140")]=e[S("0x11")][S("0x8c")],t[S("0x253")][S("0x140")]=i[S("0x8b")],t[S("0x253")][S("0x251")]=e[S("0x4e")][S("0x180")](t[S("0x252")],i[S("0x8b")],i[S("0x166")])}))),this[S("0x24f")][S("0xae")]((function(e){e[S("0x250")]&&t[S("0xe1")][S("0x4c")](e[S("0x250")]),e[S("0x253")]&&t[S("0xe1")][S("0x4c")](e[S("0x253")])})))},l[S("0xa4")][S("0x1f7")]=function(){return!1},l[S("0xa4")][S("0x24e")]=function(){this[S("0x24f")]&&this[S("0x24f")][S("0xae")]((function(t){e[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),e[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)},l[S("0xa4")][S("0xb0")]=function(){return this[S("0x24e")](),e[S("0x133")](this)},Object[S("0xa3")](l[S("0xa4")],{startRadius:{get:function(){return this[S("0x254")]},set:function(t){this[S("0x254")]=t,this[S("0x22b")]=[{fov:e[S("0x5d")][S("0x5e")](0),radius:t},{fov:e[S("0x5d")][S("0x5e")](10),radius:.9*t},{fov:e[S("0x5d")][S("0x5e")](20),radius:.8*t},{fov:e[S("0x5d")][S("0x5e")](30),radius:.7*t},{fov:e[S("0x5d")][S("0x5e")](40),radius:.6*t},{fov:e[S("0x5d")][S("0x5e")](50),radius:.5*t},{fov:e[S("0x5d")][S("0x5e")](60),radius:.4*t},{fov:e[S("0x5d")][S("0x5e")](70),radius:.3*t},{fov:e[S("0x5d")][S("0x5e")](80),radius:.1*t},{fov:e[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:e[S("0x5d")][S("0x5e")](0),radius:t},{fov:e[S("0x5d")][S("0x5e")](10),radius:.9*t},{fov:e[S("0x5d")][S("0x5e")](20),radius:.8*t},{fov:e[S("0x5d")][S("0x5e")](30),radius:.7*t},{fov:e[S("0x5d")][S("0x5e")](40),radius:.6*t},{fov:e[S("0x5d")][S("0x5e")](50),radius:.5*t},{fov:e[S("0x5d")][S("0x5e")](60),radius:.4*t},{fov:e[S("0x5d")][S("0x5e")](70),radius:.3*t},{fov:e[S("0x5d")][S("0x5e")](80),radius:.1*t},{fov:e[S("0x5d")][S("0x5e")](90),radius:.01*t}]}}}),e.Scene[S("0x255")]=l}(),function(){var t,i;e[S("0x12b")]||(t=typeof self!==S("0x68")?self:this,i=function(){return function(t){var e={};function i(n){if(e[n])return e[n][S("0x12d")];var a=e[n]={i:n,l:!1,exports:{}};return t[n][S("0x130")](a[S("0x12d")],a,a[S("0x12d")],i),a.l=!0,a[S("0x12d")]}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object[S("0x1d")](t,e,{configurable:!1,enumerable:!0,get:n})},i.n=function(t){var e=t&&t[S("0x1e")]?function(){return t[S("0x131")]}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object[S("0xa4")][S("0xa0")][S("0x130")](t,e)},i.p="",i(i.s=4)}([function(t,i,n){Object[S("0x1d")](i,S("0x1e"),{value:!0}),i[S("0x12b")]=void 0;var a=l(n(6)),r=l(n(7)),o=l(n(8)),s=l(n(9));function l(t){return t&&t[S("0x1e")]?t:{default:t}}var c=e[S("0x4e")],h=e[S("0x9")],x=e[S("0x83")],d=e[S("0x132")],u=e[S("0x7")],p=e[S("0x79")],g=e[S("0x2d")],m=(Object[S("0xa3")],e[S("0x133")],e[S("0x134")]),f=e[S("0x11")],v=e[S("0x51")],y=e[S("0x135")],b=e[S("0xf4")],C=e[S("0xee")],w=e[S("0xef")],I=e[S("0xfb")],A=e[S("0xf8")],_=e[S("0x136")],G=e[S("0xf2")],W=e[S("0xfd")],P=e[S("0x101")],Z=e[S("0x137")],M=e[S("0x35")],V=e[S("0x138")],X=e[S("0x5d")],R=e[S("0x22")],F=(f=e[S("0x11")],e[S("0x139")]),B=(e[S("0x13a")],e[S("0x13b")],Math[S("0x65")]),T=Math[S("0x66")],N=Math[S("0x5f")],k=Math[S("0x13c")],D=(Math[S("0x13d")],{position:0,normal:1});function Y(t){var e=this;t=p(t,p[S("0x13e")]),this[S("0x7a")]=p(t[S("0x7a")],!0),this[S("0x13f")]=p(t[S("0x13f")],32),this[S("0x140")]=f[S("0x57")](t[S("0x140")],new f),this[S("0x8b")]=new f,this[S("0x141")]=new f,this[S("0x142")]=new f,this[S("0xed")]=p(t[S("0xed")],Number[S("0x143")]),this[S("0x115")]=void 0,this[S("0x144")]=p(t[S("0x144")],0),this[S("0x145")]=void 0,this[S("0x146")]=p(t[S("0x146")],0),this[S("0x147")]=void 0,this[S("0x86")]=p(t[S("0x86")],x[S("0x148")]),this[S("0x149")]=p(t[S("0x149")],!0),this[S("0x14a")]=p(t[S("0x14a")],!0),this[S("0x14b")]=p(t[S("0x14b")],!0),this[S("0x14c")]=g(t[S("0x14c")])?t[S("0x14c")]:Z[S("0x14d")](Z[S("0x14e")]),this[S("0x14f")]=void 0,this[S("0x150")]=void 0,this[S("0x151")]=g(t[S("0x151")])?t[S("0x151")]:Z[S("0x14d")](Z[S("0x14e")]),this[S("0x152")]=void 0,this[S("0x153")]=void 0,this[S("0x154")]=p(t[S("0x154")],!0),this[S("0x155")]=g(t[S("0x155")])?t[S("0x155")]:Z[S("0x14d")](Z[S("0x14e")]),this[S("0x156")]=void 0,this[S("0x157")]=p(t[S("0x157")],!0),this[S("0x158")]=p(t[S("0x158")],!0),this[S("0x159")]=p(t[S("0x159")],x[S("0x148")]),this[S("0x15a")]=p(t[S("0x15a")],5),this[S("0x15b")]=p(t[S("0x15b")],!1),this[S("0x15c")]=void 0,this[S("0x15d")]=p(t[S("0x15d")],!0),this[S("0x15e")]=p(t[S("0x15e")],x[S("0x148")]),this[S("0x15f")]=p(t[S("0x15f")],S("0x160")),this[S("0x161")]=p(t[S("0x161")],10),this[S("0x162")]=0,this[S("0x163")]=0,this[S("0x164")]=F[S("0x165")](),this[S("0x166")]=new c,this[S("0x167")]=new c,this[S("0x168")]=new C({owner:this,primitiveType:v[S("0x52")],boundingVolume:this[S("0x167")]}),this[S("0x169")]=new C({owner:this,primitiveType:v[S("0x52")],boundingVolume:this[S("0x167")]}),this[S("0x16a")]=void 0,this[S("0x16b")]=new C({owner:this,primitiveType:v[S("0x59")],boundingVolume:this[S("0x167")]}),this[S("0x16c")]=void 0,this[S("0x16d")]=new C({owner:this,primitiveType:v[S("0x59")],boundingVolume:this[S("0x167")]}),this[S("0x16e")]=void 0,this[S("0x16f")]=new C({owner:this,primitiveType:v[S("0x52")],boundingVolume:this[S("0x167")]}),this[S("0x170")]=new C({owner:this,primitiveType:v[S("0x52")],boundingVolume:this[S("0x167")]}),this[S("0x171")]=void 0,this[S("0x172")]=new C({owner:this,primitiveType:v[S("0x59")],boundingVolume:this[S("0x167")]}),this[S("0x173")]=void 0,this[S("0x174")]=new C({owner:this,primitiveType:v[S("0x52")],boundingVolume:this[S("0x167")]}),this[S("0x175")]=new C({owner:this,primitiveType:v[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")]}}}Y[S("0xa4")][S("0xdb")]=function(t){var i=t[S("0x34")];if(this[S("0x7a")]&&i===M[S("0x36")]){var n=!1,l=!1,x=!1,d=this[S("0x144")],p=this[S("0x146")];if(d<0||p<0)throw new m(S("0x17d"));if(0!=d&&0!=p){this[S("0x145")]===d&&this[S("0x147")]===p||(this[S("0x145")]=d,this[S("0x147")]=p,n=!0);var g=this[S("0xed")];if(g<0)throw new m(S("0x17e"));var v=!1;this[S("0x115")]!==g&&(v=!0,this[S("0x115")]=g,this[S("0x166")]=new c(h[S("0x56")],this[S("0xed")])),(!f[S("0xba")](this[S("0x140")],this[S("0x8b")])||v)&&(f[S("0x57")](this[S("0x140")],this[S("0x8b")]),f[S("0x17f")](this[S("0x140")],this[S("0xed")],this[S("0x141")]),c[S("0x180")](this[S("0x166")],this[S("0x140")],this[S("0x167")]));var C=this[S("0x15b")];this[S("0x15c")]!==this[S("0x15b")]&&(this[S("0x15c")]=C,l=!0);var Z=this[S("0x14c")];this[S("0x14f")]!==Z&&(this[S("0x14f")]=Z,l=!0,x=!0);var B,Y,Q,J,O,j,K,q,$,tt,et=Z[S("0x181")]();if(this[S("0x150")]!==et&&(this[S("0x150")]=et,l=!0),this[S("0x15d")]){var it=t[S("0xdc")],nt=F[S("0x182")](it,this[S("0x164")]);nt<0&&(this[S("0x164")]=F[S("0x57")](it,this[S("0x164")]));var at,rt=Math[S("0x183")](nt%this[S("0x161")]/this[S("0x161")],0);if(this[S("0x15f")]==S("0x160")){var ot=T(at=2*p*rt-p),st=N(d),lt=k(ot*st);this[S("0x162")]=lt,this[S("0x163")]=at,e[S("0x22")][S("0x184")](this[S("0x163")],z)}else{at=2*d*rt-d;var ct=N(p),ht=T(at),xt=k(ht*ct);this[S("0x162")]=at,this[S("0x163")]=xt,e[S("0x22")][S("0x185")](this[S("0x162")],z)}e[S("0x11")][S("0x186")](this[S("0x140")],z,this[S("0x142")]),f[S("0x17f")](this[S("0x142")],this[S("0xed")],this[S("0x142")])}n&&function(t,i){var n,a,r,o,s,l,c,x,d,p,g,m,f=i[S("0xea")],v=L(t,t[S("0x144")],t[S("0x146")]),C=(a=v,r=(n=t)[S("0x144")],o=n[S("0x146")],s=a[S("0x189")],l=a[S("0x18a")],c=[],x=R[S("0x185")](r,z),c[S("0x4c")](s[S("0x18b")]((function(t){return R[S("0x18c")](x,t,new(e[S("0x9")]))}))),x=R[S("0x184")](-o,z),c[S("0x4c")](l[S("0x18b")]((function(t){return R[S("0x18c")](x,t,new(e[S("0x9")]))}))[S("0x18d")]()),x=R[S("0x185")](-r,z),c[S("0x4c")](s[S("0x18b")]((function(t){return R[S("0x18c")](x,t,new(e[S("0x9")]))}))[S("0x18d")]()),x=R[S("0x184")](o,z),c[S("0x4c")](l[S("0x18b")]((function(t){return R[S("0x18c")](x,t,new(e[S("0x9")]))}))),c);if(t[S("0x14b")]&&(t[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++){var s=e[r],l=h[S("0x15")](h[S("0xc")](s[0],s[s[S("0x2")]-1],E),E),c=0;for(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 x=y[S("0x190")]({context:t,typedArray:n,usage:b[S("0xf5")]}),d=6*Float32Array[S("0x191")],p=[{index:D[S("0x3")],vertexBuffer:x,componentsPerAttribute:3,componentDatatype:u[S("0x8")],offsetInBytes:0,strideInBytes:d},{index:D[S("0x5")],vertexBuffer:x,componentsPerAttribute:3,componentDatatype:u[S("0x8")],offsetInBytes:3*Float32Array[S("0x191")],strideInBytes:d}];return new G({context:t,attributes:p})}(f,C)),t[S("0x149")]&&(t[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 l=y[S("0x190")]({context:t,typedArray:n,usage:b[S("0xf5")]}),c=3*Float32Array[S("0x191")],h=[{index:D[S("0x3")],vertexBuffer:l,componentsPerAttribute:3,componentDatatype:u[S("0x8")],offsetInBytes:0,strideInBytes:c}];return new G({context:t,attributes:h})}(f,C)),t[S("0x14a")]&&(t[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++){var s=e[r],l=0;for(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=y[S("0x190")]({context:t,typedArray:n,usage:b[S("0xf5")]}),h=3*Float32Array[S("0x191")],x=[{index:D[S("0x3")],vertexBuffer:c,componentsPerAttribute:3,componentDatatype:u[S("0x8")],offsetInBytes:0,strideInBytes:h}];return new G({context:t,attributes:x})}(f,C)),t[S("0x154")]&&(t[S("0x171")]=(d=f,p=e[S("0x13b")][S("0x55")](new(e[S("0x13b")])({vertexFormat:V[S("0x192")],stackPartitions:32,slicePartitions:32})),G[S("0xf3")]({context:d,geometry:p,attributeLocations:D,bufferUsage:b[S("0xf5")],interleave:!1}))),t[S("0x157")]&&(t[S("0x173")]=(g=f,m=e[S("0x193")][S("0x55")](new(e[S("0x193")])({vertexFormat:V[S("0x192")],stackPartitions:32,slicePartitions:32})),G[S("0xf3")]({context:g,geometry:m,attributeLocations:D,bufferUsage:b[S("0xf5")],interleave:!1}))),t[S("0x15d")])if(t[S("0x15f")]==S("0x160")){var w=L(t,X[S("0x194")],0);t[S("0x195")]=U(f,w[S("0x18a")])}else w=L(t,0,X[S("0x194")]),t[S("0x195")]=U(f,w[S("0x189")])}(this,t),l&&(B=this,Y=C,et?(B[S("0x178")]=I[S("0xfc")]({depthTest:{enabled:!Y},depthMask:!1,blending:W[S("0xfe")],cull:{enabled:!0,face:P[S("0x102")]}}),B[S("0x179")]=I[S("0xfc")]({depthTest:{enabled:!Y},depthMask:!1,blending:W[S("0xfe")],cull:{enabled:!0,face:P[S("0x19a")]}}),B[S("0x19b")]=I[S("0xfc")]({depthTest:{enabled:!Y},depthMask:!1,blending:W[S("0xfe")]})):(B[S("0x178")]=I[S("0xfc")]({depthTest:{enabled:!Y},depthMask:!0}),B[S("0x19b")]=I[S("0xfc")]({depthTest:{enabled:!0},depthMask:!0}))),x&&(function(t,e,i){var n=e[S("0xea")],s=a[S("0x131")],l=new _({sources:[o[S("0x131")],i[S("0x196")],r[S("0x131")]]});t[S("0x17a")]=A[S("0xf9")]({context:n,shaderProgram:t[S("0x17a")],vertexShaderSource:s,fragmentShaderSource:l,attributeLocations:D});var c=new _({sources:[o[S("0x131")],i[S("0x196")],r[S("0x131")]],pickColorQualifier:S("0x197")});t[S("0x198")]=A[S("0xf9")]({context:n,shaderProgram:t[S("0x198")],vertexShaderSource:s,fragmentShaderSource:c,attributeLocations:D})}(Q=this,J=t,O=Z),Q[S("0x15d")]&&(j=Q,K=O,q=J[S("0xea")],$=a[S("0x131")],tt=new _({sources:[o[S("0x131")],K[S("0x196")],s[S("0x131")]]}),j[S("0x199")]=A[S("0xf9")]({context:q,shaderProgram:j[S("0x199")],vertexShaderSource:$,fragmentShaderSource:tt,attributeLocations:D}))),(l||x)&&function(t,e){t[S("0x177")][S("0x2")]=0;var i=e?w[S("0x129")]:w[S("0xf0")];t[S("0x14b")]&&H(t,t[S("0x168")],t[S("0x169")],t[S("0x178")],t[S("0x179")],t[S("0x17a")],t[S("0x16a")],t[S("0x17b")],t[S("0x141")],e,i),t[S("0x149")]&&H(t,t[S("0x16b")],void 0,t[S("0x178")],t[S("0x179")],t[S("0x17a")],t[S("0x16c")],t[S("0x17b")],t[S("0x141")],e,i,!0),t[S("0x14a")]&&H(t,t[S("0x16d")],void 0,t[S("0x178")],t[S("0x179")],t[S("0x17a")],t[S("0x16e")],t[S("0x17b")],t[S("0x141")],e,i,!0),t[S("0x154")]&&H(t,t[S("0x16f")],t[S("0x170")],t[S("0x178")],t[S("0x179")],t[S("0x17a")],t[S("0x171")],t[S("0x17b")],t[S("0x141")],e,i),t[S("0x157")]&&H(t,t[S("0x172")],void 0,t[S("0x178")],t[S("0x179")],t[S("0x17a")],t[S("0x173")],t[S("0x17b")],t[S("0x141")],e,i,!0),t[S("0x15d")]&&H(t,t[S("0x174")],t[S("0x175")],t[S("0x178")],t[S("0x179")],t[S("0x199")],t[S("0x195")],t[S("0x17c")],t[S("0x142")],e,i)}(this,et);var dt=t[S("0xe1")],ut=t[S("0x187")],pt=this[S("0x177")];if(ut[S("0x188")])for(var gt=0,mt=pt[S("0x2")];gt<mt;gt++){var ft=pt[gt];dt[S("0x4c")](ft)}}}};var z=new R,E=new h;function L(t,e,i){for(var n=t[S("0x13f")],a=T(i),r=N(i),o=T(e),s=N(e),l=k(o*r),c=k(a*s),x=[],d=0;d<n;d++){var u=2*l*d/(n-1)-l;x[S("0x4c")](new h(0,B(u),T(u)))}var p=[];for(d=0;d<n;d++)u=2*c*d/(n-1)-c,p[S("0x4c")](new h(B(u),0,T(u)));return{zoy:x,zox:p}}function U(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=y[S("0x190")]({context:t,typedArray:n,usage:b[S("0xf5")]}),s=3*Float32Array[S("0x191")],l=[{index:D[S("0x3")],vertexBuffer:o,componentsPerAttribute:3,componentDatatype:u[S("0x8")],offsetInBytes:0,strideInBytes:s}];return new G({context:t,attributes:l})}function H(t,e,i,n,a,r,o,s,l,c,h,x){c&&i&&(i[S("0xaf")]=o,i[S("0xfa")]=a,i[S("0xf7")]=r,i[S("0x103")]=d(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")]=d(s,t[S("0x14f")][S("0x17b")]),x&&(e[S("0x103")][S("0x19e")]=function(){return 1}),e[S("0x19d")]=h,e[S("0x140")]=l,t[S("0x177")][S("0x4c")](e)}i[S("0x12b")]=Y},function(t,i,n){Object[S("0x1d")](i,S("0x1e"),{value:!0});var a=e[S("0x4e")],r=e[S("0x9")],o=e[S("0x19f")],s=e[S("0x7")],l=e[S("0x79")],c=(e[S("0x2d")],e[S("0x50")]),h=e[S("0x6")],x=e[S("0x1a0")],d=e[S("0x51")],u=e[S("0x138")],p=e[S("0x5d")],g=e[S("0x53")],m=e[S("0x1a1")],f=(e[S("0xf")],Math[S("0x66")]),v=Math[S("0x65")];function y(t){var e=(t=l(t,l[S("0x13e")]))[S("0x114")],i=t[S("0xed")],n=Math[S("0x1a2")](l(t[S("0x1a3")],12)),a=Math[S("0x1a2")](l(t[S("0x1a4")],64));o[S("0x1a5")][S("0x1a6")](S("0x114"),e),o[S("0x1a5")][S("0x1a6")](S("0xed"),i);var r=l(t[S("0x1a7")],u[S("0x1a8")]);this[S("0x113")]=e,this[S("0x115")]=i,this[S("0x1a9")]=n,this[S("0x1aa")]=a,this[S("0x1ab")]=r}y[S("0x1ac")]=function(t){var e=(t=l(t,l[S("0x13e")]))[S("0x114")],i=t[S("0xed")],n=t[S("0x1a3")],a=t[S("0x1a4")];return o[S("0x1a5")][S("0x1a6")](S("0x114"),e),o[S("0x1a5")][S("0x1a6")](S("0xed"),i),o[S("0x1a5")][S("0x1a6")][S("0x1ad")](S("0x114"),e,0),o[S("0x1a5")][S("0x1a6")][S("0x1ad")](S("0x33"),height,0),new y({angle:e,radius:i,stackPartitions:n,slicePartitions:a,vertexFormat:t[S("0x1a7")]})},y[S("0x55")]=function(t){console[S("0xdc")](S("0x55"));var e,i=t[S("0x113")],n=t[S("0x115")],o=t[S("0x1a9")]+1,l=t[S("0x1aa")]+1,u=t[S("0x1ab")],y=new x,b=3*(l-1)+6*(l-1)*(o-2)+1*(l-1)*3,C=o*l,w=m[S("0x1ae")](C,b),I=new Float64Array(3*C+3*(l-1)*3);if(u[S("0x3")]){for(var A=0,_=new Array(l),G=new Array(l),W=0;W<l;W++){var P=p[S("0x1af")]*W/(l-1);_[W]=f(P),G[W]=v(P),I[A++]=0,I[A++]=0,I[A++]=-n}for(W=1;W<o;W++)for(var Z=i*W/(o-1),M=v(Z),V=n*M,X=n*M,R=n*f(Z),F=0;F<l;F++)I[A++]=_[F]*V,I[A++]=G[F]*X,I[A++]=-R;for(e=A,W=0;W<l-1;W++)I[A++]=0,I[A++]=0,I[A++]=0,I[A++]=I[e-3*(l-W-1)],I[A++]=I[e-3*(l-W-1)+1],I[A++]=I[e-3*(l-W-1)+2],I[A++]=I[e-3*(l-W)],I[A++]=I[e-3*(l-W)+1],I[A++]=I[e-3*(l-W)+2];y[S("0x3")]=new h({componentDatatype:s[S("0x4d")],componentsPerAttribute:3,values:I})}var B,T,N=0;for(F=0;F<l-1;F++)w[N++]=l+F,w[N++]=l+F+1,w[N++]=F+1;for(W=1;W<o-1;W++)for(B=W*l,T=(W+1)*l,F=0;F<l-1;F++)w[N++]=T+F,w[N++]=T+F+1,w[N++]=B+F+1,w[N++]=T+F,w[N++]=B+F+1,w[N++]=B+F;W=0;for(var k=3*(l-1);W<k;W++)w[N++]=W+e/3;var D=new c({attributes:y,indices:w,primitiveType:d[S("0x52")],boundingSphere:new a(r[S("0x56")],n)});return D=g[S("0x54")](D),console[S("0x1b0")](S("0x55")),D},i[S("0x1b1")]=y},function(t,i,n){Object[S("0x1d")](i,S("0x1e"),{value:!0});var a=e[S("0x4e")],r=e[S("0x9")],o=e[S("0x7")],s=e[S("0x79")],l=(e[S("0x2d")],e[S("0x134")]),c=(e[S("0xf")],e[S("0x50")]),h=e[S("0x6")],x=e[S("0x1a0")],d=e[S("0x1a1")],u=e[S("0x5d")],p=e[S("0x51")],g=(new r(1,1,1),Math[S("0x66")]),m=Math[S("0x65")];function f(t){var e=(t=s(t,s[S("0x13e")]))[S("0x114")],i=t[S("0xed")],n=Math[S("0x1a2")](s(t[S("0x1a3")],10)),a=Math[S("0x1a2")](s(t[S("0x1a4")],8)),r=Math[S("0x1a2")](s(t[S("0x1b2")],128));if(n<1)throw new l(S("0x1b3"));if(a<0)throw new l(S("0x1b4"));if(r<0)throw new l(S("0x1b5"));this[S("0x113")]=e,this[S("0x115")]=i,this[S("0x1a9")]=n,this[S("0x1aa")]=a,this[S("0x1b6")]=r}f[S("0x55")]=function(t){var e=t[S("0x113")],i=t[S("0x115")];if(!(i<=0||e<=0)){var n,s,l,f,v,y,b=t[S("0x1a9")],C=t[S("0x1aa")],w=t[S("0x1b6")],I=w*(b+C-1),A=I-C+2,_=new Float64Array(3*A),G=d[S("0x1ae")](A,2*I),W=0,P=new Array(w),Z=new Array(w);for(n=0;n<w;n++)l=u[S("0x1af")]*n/w,P[n]=g(l),Z[n]=m(l);for(n=1;n<b;n++)for(v=g(f=e*n/(b-1)),y=m(f),s=0;s<w;s++)_[W++]=i*P[s]*y,_[W++]=i*Z[s]*y,_[W++]=-i*v;for(P[S("0x2")]=C,Z[S("0x2")]=C,n=0;n<C;n++)l=u[S("0x1af")]*n/C,P[n]=g(l),Z[n]=m(l);for(_[W++]=0,_[W++]=0,_[W++]=-i,n=1;n<w;n++)for(v=g(f=e*n/w),y=m(f),s=0;s<C;s++)_[W++]=i*P[s]*y,_[W++]=i*Z[s]*y,_[W++]=-i*v;for(W=0,n=0;n<b-1;++n){var M=n*w;for(s=0;s<w-1;++s)G[W++]=M+s,G[W++]=M+s+1;G[W++]=M+w-1,G[W++]=M}var V=w*(b-1);for(s=1;s<C+1;++s)G[W++]=V,G[W++]=V+s;for(n=0;n<w-2;++n){var X=n*C+1+V,R=(n+1)*C+1+V;for(s=0;s<C-1;++s)G[W++]=R+s,G[W++]=X+s;G[W++]=R+C-1,G[W++]=X+C-1}var F=new x({position:new h({componentDatatype:o[S("0x4d")],componentsPerAttribute:3,values:_})});return new c({attributes:F,indices:G,primitiveType:p[S("0x59")],boundingSphere:new a(r[S("0x56")],i)})}},i[S("0x1b7")]=f},function(t,i,n){Object[S("0x1d")](i,S("0x1e"),{value:!0});var a=e[S("0x79")],r=e[S("0x2d")],o=Object[S("0xa3")],s=e[S("0x134")],l=e[S("0x1b8")],c=e[S("0x1b9")],h=e[S("0x1ba")];function x(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 l,this[S("0x1d1")]=void 0,this[S("0x1d2")]=void 0,this[S("0x1d3")](a(t,a[S("0x13e")]))}o(x[S("0xa4")],{definitionChanged:{get:function(){return this[S("0x1d0")]}},show:h(S("0x7a")),angle:h(S("0x114")),radius:h(S("0xed")),stack:h(S("0x1d4")),slice:h(S("0x13f")),color:h(S("0x82")),material:c(S("0x14c")),fill:h(S("0x1d5")),outline:h(S("0x7c")),outlineColor:h(S("0x1d6")),outlineWidth:h(S("0x1d7")),shadows:h(S("0x1d8")),distanceDisplayCondition:h(S("0x1d9"))}),x[S("0xa4")][S("0x57")]=function(t){return r(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 x(this)},x[S("0xa4")][S("0x1d3")]=function(t){if(!r(t))throw new s(S("0x1db"));this[S("0x114")]=a(this[S("0x114")],t[S("0x114")]),this[S("0xed")]=a(this[S("0xed")],t[S("0xed")]),this[S("0x1d4")]=a(this[S("0x1d4")],t[S("0x1d4")]),this[S("0x13f")]=a(this[S("0x13f")],t[S("0x13f")]),this[S("0x7a")]=a(this[S("0x7a")],t[S("0x7a")]),this[S("0x82")]=a(this[S("0x82")],t[S("0x82")]),this[S("0x14c")]=a(this[S("0x14c")],t[S("0x14c")]),this[S("0x1d5")]=a(this[S("0x1d5")],t[S("0x1d5")]),this[S("0x7c")]=a(this[S("0x7c")],t[S("0x7c")]),this[S("0x1d6")]=a(this[S("0x1d6")],t[S("0x1d6")]),this[S("0x1d7")]=a(this[S("0x1d7")],t[S("0x1d7")]),this[S("0x1d8")]=a(this[S("0x1d8")],t[S("0x1d8")]),this[S("0x1d9")]=a(this[S("0x1d9")],t[S("0x1d9")]),this[S("0x1da")]=a(this[S("0x1da")],t[S("0x1da")])},i[S("0x1dc")]=x},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,i,n){var a=n(0),r=n(10),o=n(11),s=n(1),l=n(2),c=n(3),h=n(12);e.Scene[S("0x12b")]=a[S("0x12b")],e.Scene[S("0x1de")]=r[S("0x1de")],e.Scene[S("0x1df")]=o[S("0x1df")],e.Scene[S("0x1b1")]=s[S("0x1b1")],e.Scene[S("0x1b7")]=l[S("0x1b7")],e.Scene[S("0x1dc")]=c[S("0x1dc")],e.Scene[S("0x1e0")]=h[S("0x1e0")];var x=e[S("0x1e1")],d=x[S("0x1e2")];x[S("0x1e2")]=function(t,e,i){var n=i[S("0xab")];return d(t,e,i)[S("0x18e")]([new(o[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,i,n){Object[S("0x1d")](i,S("0x1e"),{value:!0});var a=e[S("0x79")],r=e[S("0x2d")],o=Object[S("0xa3")],s=e[S("0x134")],l=e[S("0x1b8")],c=e[S("0x1b9")],h=e[S("0x1ba")];function x(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 l,this[S("0x1d3")](a(t,a[S("0x13e")]))}o(x[S("0xa4")],{definitionChanged:{get:function(){return this[S("0x1d0")]}},show:h(S("0x7a")),radius:h(S("0xed")),xHalfAngle:h(S("0x144")),yHalfAngle:h(S("0x146")),lineColor:h(S("0x86")),showSectorLines:h(S("0x149")),showSectorSegmentLines:h(S("0x14a")),showLateralSurfaces:h(S("0x14b")),material:c(S("0x14c")),showDomeSurfaces:h(S("0x154")),showDomeLines:h(S("0x1f4")),showIntersection:h(S("0x158")),intersectionColor:h(S("0x159")),intersectionWidth:h(S("0x15a")),showThroughEllipsoid:h(S("0x15b")),gaze:h(S("0x1da")),showScanPlane:h(S("0x15d")),scanPlaneColor:h(S("0x15e")),scanPlaneMode:h(S("0x15f")),scanPlaneRate:h(S("0x161"))}),x[S("0xa4")][S("0x57")]=function(t){return r(t)||(t=new x),t[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},x[S("0xa4")][S("0x1d3")]=function(t){if(!r(t))throw new s(S("0x1db"));this[S("0x7a")]=a(this[S("0x7a")],t[S("0x7a")]),this[S("0xed")]=a(this[S("0xed")],t[S("0xed")]),this[S("0x144")]=a(this[S("0x144")],t[S("0x144")]),this[S("0x146")]=a(this[S("0x146")],t[S("0x146")]),this[S("0x86")]=a(this[S("0x86")],t[S("0x86")]),this[S("0x149")]=a(this[S("0x149")],t[S("0x149")]),this[S("0x14a")]=a(this[S("0x14a")],t[S("0x14a")]),this[S("0x14b")]=a(this[S("0x14b")],t[S("0x14b")]),this[S("0x14c")]=a(this[S("0x14c")],t[S("0x14c")]),this[S("0x154")]=a(this[S("0x154")],t[S("0x154")]),this[S("0x157")]=a(this[S("0x157")],t[S("0x157")]),this[S("0x158")]=a(this[S("0x158")],t[S("0x158")]),this[S("0x159")]=a(this[S("0x159")],t[S("0x159")]),this[S("0x15a")]=a(this[S("0x15a")],t[S("0x15a")]),this[S("0x15b")]=a(this[S("0x15b")],t[S("0x15b")]),this[S("0x1da")]=a(this[S("0x1da")],t[S("0x1da")]),this[S("0x15d")]=a(this[S("0x15d")],t[S("0x15d")]),this[S("0x15e")]=a(this[S("0x15e")],t[S("0x15e")]),this[S("0x15f")]=a(this[S("0x15f")],t[S("0x15f")]),this[S("0x161")]=a(this[S("0x161")],t[S("0x161")])},i[S("0x1de")]=x},function(t,i,n){Object[S("0x1d")](i,S("0x1e"),{value:!0}),i[S("0x1df")]=void 0;var a=n(0),r=e[S("0x1f5")],o=e[S("0x9")],s=e[S("0x83")],l=e[S("0x2d")],c=e[S("0x133")],h=e[S("0x134")],x=e[S("0x22")],d=e[S("0x11")],u=e[S("0x29")],p=e[S("0x1f6")],g=e[S("0xc2")],m=new x,f=(new d,new o),v=new o,y=new u,b=new o,C=new u;function w(t,e,i){var n=e[t.id];if(l(n)){var a=n[S("0x2f")];i[S("0xd2")](a),a[S("0x1f7")]()||a[S("0xb0")](),delete e[t.id]}}var I=function t(e,i){if(!l(e))throw new h(S("0x1f8"));if(!l(i))throw new h(S("0x1f9"));i[S("0x1fa")][S("0x1fb")](t[S("0xa4")][S("0x1fc")],this),this[S("0x1fd")]=e,this[S("0x1fe")]=e[S("0x9d")],this[S("0x1ff")]=i,this[S("0x200")]={},this[S("0x201")]=new r,this[S("0x1fc")](i,i[S("0x4")],[],[])};I[S("0xa4")][S("0xdb")]=function(t){if(!l(t))throw new h(S("0x202"));for(var i=this[S("0x201")][S("0x4")],n=this[S("0x200")],r=this[S("0x1fe")],c=0,w=i[S("0x2")];c<w;c++){var I,A,_,G,W=i[c],P=W[S("0x203")],Z=n[W.id],M=W[S("0x204")]&&W[S("0x205")](t)&&g[S("0x206")](P[S("0x78")],t,!0);if(M&&(I=g[S("0xc3")](W[S("0x74")],t,f),N=g[S("0xc3")](W[S("0x207")],t,y),A=g[S("0xc3")](P[S("0x115")],t),_=g[S("0xc3")](P[S("0x145")],t),G=g[S("0xc3")](P[S("0x147")],t),M=l(I)&&l(_)&&l(G)),M){var V=l(Z)?Z[S("0x2f")]:void 0;l(V)||((V=new(a[S("0x12b")])).id=W,r[S("0x9e")](V),Z={primitive:V,position:void 0,orientation:void 0},n[W.id]=Z);var X=g[S("0xc3")](P[S("0x1d1")],t);if(l(X)){var R=g[S("0xc3")](X[S("0x74")],t,v);if(!l(I)||!l(R))continue;var F=o[S("0xb")](I,R,b),B=o[S("0x208")](e[S("0x9")][S("0x209")],F),T=o[S("0xc")](e[S("0x9")][S("0x209")],F,b),N=u[S("0x20a")](T,B-Math.PI,C);A=o[S("0x11d")](I,R),V[S("0x140")]=d[S("0x21")](x[S("0x23")](N,m),I,V[S("0x140")])}else o[S("0xba")](I,Z[S("0x3")])&&u[S("0xba")](N,Z[S("0xc1")])||(l(N)?(V[S("0x140")]=d[S("0x21")](x[S("0x23")](N,m),I,V[S("0x140")]),Z[S("0x3")]=o[S("0x57")](I,Z[S("0x3")]),Z[S("0xc1")]=u[S("0x57")](N,Z[S("0xc1")])):(V[S("0x140")]=e[S("0x24")][S("0x25")](I),Z[S("0x3")]=o[S("0x57")](I,Z[S("0x3")])));V[S("0x7a")]=!0,V[S("0x1da")]=X,V[S("0xed")]=A,V[S("0x144")]=_,V[S("0x146")]=G,V[S("0x86")]=g[S("0x206")](P[S("0x1e7")],t,s[S("0x148")]),V[S("0x149")]=g[S("0x206")](P[S("0x1e8")],t,!0),V[S("0x14a")]=g[S("0x206")](P[S("0x1e9")],t,!0),V[S("0x14b")]=g[S("0x206")](P[S("0x1ea")],t,!0),V[S("0x14c")]=p[S("0xbf")](t,P[S("0x14f")],V[S("0x14c")]),V[S("0x154")]=g[S("0x206")](P[S("0x1eb")],t,!0),V[S("0x157")]=g[S("0x206")](P[S("0x1ec")],t,!0),V[S("0x158")]=g[S("0x206")](P[S("0x1ed")],t,!0),V[S("0x159")]=g[S("0x206")](P[S("0x1ee")],t,s[S("0x148")]),V[S("0x15a")]=g[S("0x206")](P[S("0x1ef")],t,1),V[S("0x15b")]=g[S("0x206")](P[S("0x15c")],t,!0),V[S("0x15f")]=g[S("0x206")](P[S("0x1f2")],t),V[S("0x15e")]=g[S("0x206")](P[S("0x1f1")],t,s[S("0x148")]),V[S("0x15d")]=g[S("0x206")](P[S("0x1f0")],t,!0),V[S("0x161")]=g[S("0x206")](P[S("0x1f3")],t,1)}else l(Z)&&(Z[S("0x2f")][S("0x7a")]=!1)}return!0},I[S("0xa4")][S("0x1f7")]=function(){return!1},I[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;n>-1;n--)w(t[n],e,i);return c(this)},I[S("0xa4")][S("0x1fc")]=function(t,e,i,n){var a,r,o=this[S("0x201")],s=this[S("0x200")],c=this[S("0x1fe")];for(a=e[S("0x2")]-1;a>-1;a--)r=e[a],l(r[S("0x203")])&&l(r[S("0x74")])&&o[S("0x20b")](r.id,r);for(a=n[S("0x2")]-1;a>-1;a--)r=n[a],l(r[S("0x203")])&&l(r[S("0x74")])?o[S("0x20b")](r.id,r):(w(r,s,c),o[S("0xd2")](r.id));for(a=i[S("0x2")]-1;a>-1;a--)w(r=i[a],s,c),o[S("0xd2")](r.id)},i[S("0x1df")]=I},function(t,i,n){Object[S("0x1d")](i,S("0x1e"),{value:!0}),i[S("0x1e0")]=void 0;var a=n(1),r=n(2),o=n(13),s=(e[S("0x79")],e[S("0x2d")]),l=(e[S("0x20c")],e[S("0x24")]),c=e[S("0x134")],h=(e[S("0x20d")],e[S("0x83")]),x=e[S("0x20e")],d=e[S("0x20f")],u=e[S("0x9")],p=(e[S("0x138")],e[S("0x29")]),g=e[S("0x22")],m=e[S("0x11")],f=e[S("0xc2")];function v(t){var e=this;if(!s(t))throw new c(S("0x212"));this[S("0x213")]=t;var i=t[S("0x6a")];this[S("0x1fd")]=i;var n=t[S("0x214")];this[S("0x215")]=n,this[S("0x1fe")]=i[S("0x9d")],this[S("0x216")]=void 0,this[S("0x217")]=void 0,this[S("0x218")]=[],n[S("0x219")][S("0x1fb")]((function(){e[S("0xdb")]()}))}e[S("0x1b8")],e[S("0x210")],e[S("0x211")];var y=new g,b=new m,C=new u,w=new u,I=new u,A=new p;v[S("0xa4")][S("0x9e")]=function(t){return t instanceof o[S("0x21a")]||(t=new(o[S("0x21a")])(t)),this[S("0x218")][S("0x4c")](t),t},v[S("0xa4")][S("0xd2")]=function(t){var e=this[S("0x218")][S("0x21b")](t);-1!==e&&this[S("0x218")][S("0xdd")](e,1)},v[S("0xa4")][S("0x21c")]=function(){this[S("0x218")][S("0x2")]=0},v[S("0xa4")][S("0xdb")]=function(){var t=this[S("0x215")][S("0x21d")],i=this[S("0x218")],n=this[S("0x1fe")],o=this[S("0x216")],c=this[S("0x217")],v=[],_=[];s(o)&&n[S("0x21e")](o),s(c)&&n[S("0x21e")](c);for(var G=0,W=i[S("0x2")];G<W;G++){var P=i[G],Z=P[S("0x21f")];if(f[S("0x206")](Z[S("0x7a")],t,!0)){var M=Z[S("0x114")],V=Z[S("0xed")],X=Z[S("0x1d4")],R=Z[S("0x13f")];if(s(M)&&f[S("0x206")](P[S("0x7a")],t,!0)){var F=f[S("0xc3")](P[S("0x3")],t,C);if(s(F)){var B,T=Z[S("0x1da")];if(s(T)){var N=f[S("0xc3")](T[S("0x3")],t,w);if(!s(F)||!s(N))continue;var k=u[S("0xb")](F,N,I),D=u[S("0x208")](e[S("0x9")][S("0x209")],k),Y=u[S("0xc")](e[S("0x9")][S("0x209")],k,I),z=p[S("0x20a")](Y,D,A),E=u[S("0x11d")](F,N);V=1,B=m[S("0x21")](e[S("0x22")][S("0x220")](g[S("0x23")](z,y),E,y),F,b)}else z=f[S("0xc3")](P[S("0xc1")],t,A),B=s(z)?m[S("0x21")](g[S("0x23")](z,y),F,b):l[S("0x25")](F,void 0,b);if(s(B)){var L,U=P[S("0x6b")];s(U)||(L=new(a[S("0x1b1")])({vertexFormat:e[S("0x138")][S("0x221")],angle:M,radius:V,stackPartitions:X,slicePartitions:R}),P[S("0x6b")]=a[S("0x1b1")][S("0x55")](L),U=P[S("0x6b")]);var H=Z[S("0x82")],Q=Z[S("0x7c")],J=Z[S("0x1d7")];s(J)||(J=1);var O=Z[S("0x1d6")];s(O)||(O=h[S("0x148")]);var j=new(e[S("0x222")])({geometry:U,modelMatrix:B,attributes:{color:e[S("0x20d")][S("0x223")](H)}});if(v[S("0x4c")](j),Q){var K,q=P[S("0xd3")];s(q)||(K=new(r[S("0x1b7")])({vertexFormat:e[S("0x138")][S("0x192")],angle:M,radius:V}),P[S("0xd3")]=r[S("0x1b7")][S("0x55")](K),q=P[S("0xd3")]),j=new(e[S("0x222")])({geometry:q,modelMatrix:B,attributes:{color:e[S("0x20d")][S("0x223")](O)}}),_[S("0x4c")](j)}}}}}}v[S("0x2")]>0&&(this[S("0x216")]=this[S("0x1fe")][S("0x9e")](new x({asynchronous:!1,geometryInstances:v,appearance:new d({flat:!1,translucent:!0,closed:!0})}))),_[S("0x2")]>0&&(this[S("0x217")]=this[S("0x1fe")][S("0x9e")](new x({asynchronous:!1,geometryInstances:_,appearance:new d({flat:!0,translucent:!0,renderState:{lineWidth:this[S("0x1fd")][S("0x224")](J)}})})))},i[S("0x1e0")]=v},function(t,i,n){Object[S("0x1d")](i,S("0x1e"),{value:!0}),i[S("0x21a")]=void 0;var a,r=n(3),o=e[S("0x225")],s=e[S("0x1b8")],l=e[S("0x226")],c=e[S("0x1ba")],h=e[S("0x210")];function x(t){return new l(t)}function d(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 r[S("0x1dc")]||(e=new(r[S("0x1dc")])(e)),this[S("0x21f")]=e,this[S("0x1ce")]=new h,this[S("0x6b")]=void 0,this[S("0xd3")]=void 0,this[S("0x1d0")]=new s,this[S("0x1d3")](t)}e[S("0x211")],Object[S("0xa3")](d[S("0xa4")],{position:(a=S("0x3"),c(a,void 0,x)),orientation:c(S("0xc1")),show:c(S("0x7a"))}),d[S("0xa4")][S("0x1d3")]=function(t){this[S("0x3")]=t[S("0x3")],this[S("0xc1")]=t[S("0xc1")],this[S("0x7a")]=t[S("0x7a")]},d[S("0xa4")][S("0x228")]=function(t){t instanceof o&&(this[S("0x21f")][S("0x1da")]=t)},i[S("0x21a")]=d}])},typeof exports===S("0x12c")&&typeof module===S("0x12c")?module[S("0x12d")]=i():typeof define===S("0xbe")&&define[S("0x12e")]?define([],i):typeof exports===S("0x12c")?exports[S("0x12f")]=i():t[S("0x12f")]=i())}(),t[S("0x256")]=!0};let X=null;function R(t,e){t&&(this._viewer=t,X=e,new V(Window,X),this._customPluginLayer=new X.CustomDataSource("_customPluginLayer"),t&&t.dataSources.add(this._customPluginLayer))}R.prototype={createRectangularSensorGraphics:function(t){if(this._customPluginLayer&&t){let e=new X.HeadingPitchRoll(X.Math.toRadians(t.heading||90),X.Math.toRadians(t.pitch||0),X.Math.toRadians(t.roll||0)),i=t.position;return this._customPluginLayer.entities.add({position:i,orientation:X.Transforms.headingPitchRollQuaternion(i,e),rectangularSensor:new X.Scene.RectangularSensorGraphics({radius:t.radius||1e5,xHalfAngle:X.Math.toRadians(t.xHalfAngle||45),yHalfAngle:X.Math.toRadians(t.yHalfAngle||45),material:t.material||new X.Color(1,0,1,.4),lineColor:t.lineColor||new X.Color(1,0,1,1),showScanPlane:t.showScanPlane||!0,scanPlaneColor:t.scanPlaneColor||new X.Color(1,0,1,1),scanPlaneMode:t.scanPlaneMode||"vertical",scanPlaneRate:t.scanPlaneRate||3,showThroughEllipsoid:t.showThroughEllipsoid||!1})})}},createSatelliteCoverageSimulationGraphics:function(t){if(t)return new X.Scene.SatelliteCoverageSimulation(this._viewer,{position:t.position,angle1:t.angle1||30,angle2:t.angle2||45,areaType:t.areaType||2,rotation:{heading:X.Math.toRadians(t.heading||0),pitch:X.Math.toRadians(t.pitch||0),roll:X.Math.toRadians(t.roll||0)},color:t.color||{red:.43137254901960786,green:.9607843137254902,blue:0,alpha:.8}})},createRadarPrimitive:function(t){if(t)return new X.Scene.RadarPrimitive(this._viewer,{position:t.position,angle:t.angle||80,radius:t.radius||7e5,rotation:{heading:X.Math.toRadians(t.heading||0),pitch:X.Math.toRadians(t.pitch||40),roll:X.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,B,T=null,N={},k="move",D=null;function Y(t,e){t&&(this._viewer=t,D=t,T=e,this._installFileDragDropHandler())}Y.prototype={_installFileDragDropHandler(){function t(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,t.appendChild(i),this.fileDragDropCallBack=void 0,this.callBackParms=void 0}t.prototype.startuploadfile=function(){var t=this,e=t._dragBox,i=null;document.ondragover=function(){clearTimeout(i),i=setTimeout((function(){e.innerHTML="请将文件拖拽到此区域"}),200)},e.ondragenter=function(){e.innerHTML="请释放鼠标"},e.ondragover=function(){return!1},e.ondragleave=function(){e.innerHTML="请将文件拖拽到此区域"},e.ondrop=function(e){e.preventDefault();var i=e.dataTransfer.files[0],n=new FileReader;return n.readAsText(i,"UTF-8"),n.onload=function(){var e=JSON.parse(this.result);t.fileDragDropCallBack&&t.fileDragDropCallBack(t.callBackParms,e,t._viewer)},n.onloadstart=function(){},n.onloadend=function(){},n.onabort=function(){alert("读取数据中断")},n.onerror=function(){alert("读取数据失败")},!1}},T.Scene.FileDragDropMixin=function(e){var i=new t(document.querySelector(".cesium-viewer"),e);Object.defineProperties(e,{fileDragDropMixin:{get:function(){return i}}})}},showLoadDataToScenePanel(t){if(t=t||{}){let t=new n,e=this._viewer,i=t.addFolder("加载数据文件"),a=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:()=>{a(t=>{T.GeoJsonDataSource.load(t).then((function(t){e.dataSources.add(t);for(var i=t.entities.values,n=0;n<i.length;n++){var a=i[n];a.nameID=n,a.point={color:T.Color.BLUE}}e.flyTo(t)}))})},polyline:()=>{a(t=>{T.GeoJsonDataSource.load(t).then((function(t){e.dataSources.add(t);for(var i=t.entities.values,n=0;n<i.length;n++){var a=i[n];a.nameID=n,a.polyline.width=5,a.polyline.material=new T.PolylineGlowMaterialProperty({glowPower:.1,color:T.Color.ORANGERED.withAlpha(.9)})}e.flyTo(t)}))})},polygon:()=>{a(t=>{T.GeoJsonDataSource.load(t).then((function(t){e.dataSources.add(t);for(var i=t.entities.values,n=0;n<i.length;n++){var a=i[n];a.nameID=n,a.polygon.width=10,a.polygon.material=T.Color.BLUE.withAlpha(.9)}e.flyTo(t)}))})},model:()=>{a(t=>{e.flyTo(d3kit.createModelGraphics({position:T.Cartesian3.fromDegrees(120.38105869,31.10115627),m_url:t}))})},czml:()=>{a(t=>{e.flyTo(e.dataSources.add(T.CzmlDataSource.load(t)))})},"3dtilset":()=>{a(t=>{e.flyTo(e.scene.primitives.add(new T.Cesium3DTileset({url:t})))})}};i.add(r,"point"),i.add(r,"polyline"),i.add(r,"polygon"),i.add(r,"model"),i.add(r,"czml"),i.add(r,"3dtilset"),i.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};t&&t.elementId?(e=new n({autoPlace:!1}),document.getElementById(t.elementId).appendChild(e.domElement)):e=new n;let a=this._viewer.scene.postProcessStages,r=a.add(T.PostProcessStageLibrary.createSilhouetteStage()),o=a.add(T.PostProcessStageLibrary.createBlackAndWhiteStage()),s=a.add(T.PostProcessStageLibrary.createBrightnessStage()),l=a.add(T.PostProcessStageLibrary.createNightVisionStage());r.uniforms.color=t.silhouetteColor||T.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};t&&t.elementId?(e=new n({autoPlace:!1}),document.getElementById(t.elementId).appendChild(e.domElement)):e=new n;let a=this._viewer;e.__closeButton.innerHTML="收缩面板";let r=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(t){let e=t.primitives._delegate||t.primitives,i=t.primitives,a=(this._viewer,null);t&&t.elementId?(a=new n({autoPlace:!1}),document.getElementById(t.elementId).appendChild(a.domElement)):a=new n;let r=a.addFolder("离地高度");r.add({height:100},"height",0,1e3,1).onChange((function(t){var e=i.boundingSphere,n=T.Cartographic.fromCartesian(e.center),a=T.Cartesian3.fromRadians(n.longitude,n.latitude,0),r=T.Cartesian3.fromRadians(n.longitude,n.latitude,t),o=T.Cartesian3.subtract(r,a,new T.Cartesian3);i.modelMatrix=T.Matrix4.fromTranslation(o)})),r.open();let o=a.addFolder("缩放大小"),s={"m+Scale":()=>{e.readyPromise.then(t=>{let e=t.root.transform;T.Matrix4.multiplyByUniformScale(e,1.2,e),t.root.transform=e})},"m-Scale":()=>{e.readyPromise.then(t=>{let e=t.root.transform;T.Matrix4.multiplyByUniformScale(e,.8,e),t.root.transform=e})}};o.add(s,"m+Scale"),o.add(s,"m-Scale"),o.open();let l={"x+Axis":()=>{const t=T.Matrix4.fromTranslation(new T.Cartesian3(20,0,0));T.Matrix4.multiply(e.modelMatrix,t,e.modelMatrix)},"x-Axis":()=>{const t=T.Matrix4.fromTranslation(new T.Cartesian3(-20,0,0));T.Matrix4.multiply(e.modelMatrix,t,e.modelMatrix)},"y+Axis":()=>{const t=T.Matrix4.fromTranslation(new T.Cartesian3(0,20,0));T.Matrix4.multiply(e.modelMatrix,t,e.modelMatrix)},"y-Axis":()=>{const t=T.Matrix4.fromTranslation(new T.Cartesian3(0,-20,0));T.Matrix4.multiply(e.modelMatrix,t,e.modelMatrix)},"z+Axis":()=>{const t=T.Matrix4.fromTranslation(new T.Cartesian3(0,0,20));T.Matrix4.multiply(e.modelMatrix,t,e.modelMatrix)},"z-Axis":()=>{const t=T.Matrix4.fromTranslation(new T.Cartesian3(0,0,-20));T.Matrix4.multiply(e.modelMatrix,t,e.modelMatrix)}},c=a.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();let h={x:0,y:0,z:0},x={"x+Axis":()=>{h.x+=15,e.readyPromise.then(t=>{const e=T.Matrix3.fromRotationX(T.Math.toRadians(h.x)),i=T.Matrix4.fromRotationTranslation(e),n=T.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);T.Matrix4.multiply(n,i,n),t._root.transform=n})},"x-Axis":()=>{h.x-=15,e.readyPromise.then(t=>{const e=T.Matrix3.fromRotationX(T.Math.toRadians(h.x)),i=T.Matrix4.fromRotationTranslation(e),n=T.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);T.Matrix4.multiply(n,i,n),t._root.transform=n})},"y+Axis":()=>{h.y+=15,e.readyPromise.then(t=>{const e=T.Matrix3.fromRotationY(T.Math.toRadians(h.y)),i=T.Matrix4.fromRotationTranslation(e),n=T.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);T.Matrix4.multiply(n,i,n),t._root.transform=n})},"y-Axis":()=>{h.y-=15,e.readyPromise.then(t=>{const e=T.Matrix3.fromRotationY(T.Math.toRadians(h.y)),i=T.Matrix4.fromRotationTranslation(e),n=T.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);T.Matrix4.multiply(n,i,n),t._root.transform=n})},"z+Axis":()=>{h.z+=15,e.readyPromise.then(t=>{const e=T.Matrix3.fromRotationZ(T.Math.toRadians(h.z)),i=T.Matrix4.fromRotationTranslation(e),n=T.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);T.Matrix4.multiply(n,i,n),t._root.transform=n})},"z-Axis":()=>{h.z-=15,e.readyPromise.then(t=>{const e=T.Matrix3.fromRotationZ(T.Math.toRadians(h.z)),i=T.Matrix4.fromRotationTranslation(e),n=T.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);T.Matrix4.multiply(n,i,n),t._root.transform=n})}},d=a.addFolder("旋转矩阵");if(d.add(x,"x+Axis"),d.add(x,"x-Axis"),d.add(x,"y+Axis"),d.add(x,"y-Axis"),d.add(x,"z+Axis"),d.add(x,"z-Axis"),d.open(),t.cb){let n=a.addFolder("获取调整后的模型矩阵");n.add({getModelMaterix:()=>{e.readyPromise.then(e=>{let n=e.root.transform;t.cb({modelTransformMatrix:n,modelMatrix:i.modelMatrix})})}},"getModelMaterix").name("获取模型矩阵"),n.open()}a.__closeButton.innerHTML="收缩面板"},showLayerParamPanel:function(t,e){if(t){let r=null;if(e&&e.elementId)r=new n({autoPlace:!1}),document.getElementById(e.elementId).appendChild(r.domElement);else r=new n;var i=new function(){this.alpha=t.alpha,this.brightness=t.brightness,this.contrast=t.contrast,this.gamma=t.gamma,this.hue=t.hue,this.dayAlpha=t.dayAlpha,this.nightAlpha=t.nightAlpha,this.saturation=t.saturation},a=r.addFolder("图层调整");a.add(i,"alpha",0,1,.05).name("透明度").onChange((function(e){t.alpha=e})),a.add(i,"brightness",0,5,.05).name("亮度").onChange((function(e){t.brightness=e})),a.add(i,"contrast",0,5,.05).name("对比").onChange((function(e){t.contrast=e})),a.add(i,"gamma",0,5,.05).name("伽马").onChange((function(e){t.gamma=e})),a.add(i,"hue",0,5,.05).name("色调").onChange((function(e){t.hue=e})),a.add(i,"dayAlpha",0,1,.05).name("白天透明").onChange((function(e){t.dayAlpha=e})),a.add(i,"nightAlpha",0,1,.05).name("夜晚透明").onChange((function(e){t.nightAlpha=e})),a.add(i,"saturation",0,5,.05).name("饱和").onChange((function(e){t.saturation=e})),a.open()}},showLayerSwitchPanel:function(t,e){if(t&&t.length){let s=null;if(e&&e.elementId)s=new n({autoPlace:!1}),document.getElementById(e.elementId).appendChild(s.domElement);else s=new n;var i=new function(){t.forEach(t=>{this[t.id]=t.show})},a=s.addFolder("图层切换");t.forEach(t=>{a.add(i,t.id).name(t.name).onChange((function(e){t.show=e}))});var r=new function(){t.forEach(t=>{this[t.id]=t.alpha})},o=s.addFolder("透明度");t.forEach(t=>{o.add(r,t.id,0,1,.05).name(t.name).onChange((function(e){t.alpha=e}))}),a.open(),o.open()}},showSceneEffectEditPanel:function(t){if(t=t||{},n&&this._viewer.scene.colorCorrection){var e=new n,i=this._viewer;i.scene.lightSource.ambientLightColor=t.ambientLightColor||new T.Color(.3,.3,.3,1),i.scene.colorCorrection.show=t.colorCorrection||!1,i.scene.colorCorrection.saturation=t.saturation||3.1,i.scene.colorCorrection.brightness=t.brightness||1.8,i.scene.colorCorrection.contrast=t.contrast||1.2,i.scene.colorCorrection.hue=t.hue||0,i.scene.bloomEffect.show=t.bloomEffect||!1,i.scene.hdrEnabled=t.hdrEnabled||!0,i.scene.bloomEffect.threshold=t.threshold||1,i.scene.bloomEffect.bloomIntensity=t.bloomIntensity||2;var a=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},r=e.addFolder("场景效果");console.log("sceneEffect:",a),r.add(a,"bloomEffectShow").name("泛光开关").onChange((function(t){i.scene.bloomEffect.show=t,i.scene.bloomEffect.threshold=a.bloomThreshold,i.scene.bloomEffect.bloomIntensity=a.bloomIntensity})),r.add(a,"bloomThreshold",0,1,.1).name("泛光阈值").onChange((function(t){i.scene.bloomEffect.threshold=t})),r.add(a,"bloomIntensity",0,10,.1).name("泛光强度").onChange((function(t){i.scene.bloomEffect.bloomIntensity=t})),r.add(a,"hdrEnabled").name("HDR开关").onChange((function(t){i.scene.hdrEnabled=t})),r.add(a,"colorCorrectionShow").name("颜色校正").onChange((function(t){i.scene.colorCorrection.show=t})),r.add(a,"colorCorrectionSaturation",0,5,.1).name("饱和度").onChange((function(t){i.scene.colorCorrection.saturation=t})),r.add(a,"colorCorrectionBrightness",0,5,.1).name("亮度").onChange((function(t){i.scene.colorCorrection.brightness=t})),r.add(a,"colorCorrectionContrast",0,5,.1).name("对比度").onChange((function(t){i.scene.colorCorrection.contrast=t})),r.add(a,"colorCorrectionHue",0,5,.1).name("色调").onChange((function(t){i.scene.hdrEnabled=t})),r.add(a,"colorCorrectionHue",0,1,.1).name("环境光").onChange((function(t){i.scene.lightSource.ambientLightColor=new T.Color(t,t,t,1)})),r.open()}},showEntityOrientationEditPanel:function(t={}){if(t.entity){let o=t.entity;var e=new n;if(t&&t.elementId)e=new n({autoPlace:!1}),document.getElementById(t.elementId).appendChild(e.domElement);else e=new n;var i=new function(){this.heading=360,this.pitch=1,this.roll=1},a=e.addFolder("实体姿态调整"),r=this;a.add(i,"heading",0,360,1).name("角度").onChange((function(e){i.heading=e;let n=T.Transforms.headingPitchRollQuaternion(o.position.getValue(r._viewer.clock.currentTime),new T.HeadingPitchRoll(T.Math.toRadians(i.heading),T.Math.toRadians(i.pitch),T.Math.toRadians(i.roll)));o.orientation=n,t.cb&&t.cb({orientation:n})})),a.add(i,"pitch",0,360,1).name("航向").onChange((function(e){i.pitch=e;let n=T.Transforms.headingPitchRollQuaternion(o.position.getValue(r._viewer.clock.currentTime),new T.HeadingPitchRoll(T.Math.toRadians(i.heading),T.Math.toRadians(i.pitch),T.Math.toRadians(i.roll)));o.orientation=n,t.cb&&t.cb({orientation:n})})),a.add(i,"roll",0,360,1).name("翻转").onChange((function(e){i.roll=e;let n=T.Transforms.headingPitchRollQuaternion(o.position.getValue(r._viewer.clock.currentTime),new T.HeadingPitchRoll(T.Math.toRadians(i.heading),T.Math.toRadians(i.pitch),T.Math.toRadians(i.roll)));o.orientation=n,t.cb&&t.cb({orientation:n})})),a.open()}},definedMouseEvent({targetEntity:t,ctrlFlag:e}){B=t,N=e,this.bindHandelEvent({leftDown:this.defLeftDown,mouseMove:this.defMouseMove,mouseWheel:this.defMouseWheel,leftUp:this.defLeftUp})},defMouseMove(t){if(N.leftDown&&F){let e=D.camera.getPickRay(t.endPosition),i=D.scene.globe.pick(e,D.scene);if(document.body.style.cursor="pointer",F&&F.id&&"move"===k){let t=T.JulianDate.fromDate(new Date),e=B.position.getValue(t),n=T.Cartographic.fromCartesian(e),a=Number(n.height.toFixed(3));B.position=new T.CallbackProperty(()=>{let t=D.scene.globe.ellipsoid.cartesianToCartographic(i),e=T.Math.toDegrees(t.longitude),n=T.Math.toDegrees(t.latitude);return T.Cartesian3.fromDegrees(e,n,a)},!1)}else if(F&&F.id&&"rotate"===k){let e=T.JulianDate.fromDate(new Date),i=B.position.getValue(e),n=D.scene.camera.pickEllipsoid(t.startPosition),a=D.scene.camera.pickEllipsoid(t.endPosition);const r=T.Cartesian3.subtract(i,a,new T.Cartesian3),o=T.Cartesian3.normalize(r,new T.Cartesian3);let s=T.Cartesian3.subtract(n,i,new T.Cartesian3),l=T.Cartesian3.subtract(a,i,new T.Cartesian3),c=T.Cartesian3.angleBetween(s,l);const h=100,x=T.Quaternion.fromAxisAngle(o,c*h);B.orientation=x}}},defLeftDown(t){F=D.scene.pick(t.position),T.defined(F)&&k?(N.selected=!0,N.leftDown=!0):N.selected=!1},defMouseWheel(t){if(F&&F.id&&"scale"===k){let e=T.JulianDate.fromDate(new Date),i=B.box.dimensions.getValue(e),n=t>0?2:.5;B.box.dimensions=new T.CallbackProperty(()=>T.Cartesian3.multiplyByScalar(i,n,new T.Cartesian3),!1)}},defLeftUp(t){N.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 z=null;function E(t,e,i){t&&(this._viewer=t,z=e,this._pluginLayer=new z.CustomDataSource("pluginLayer"),t&&t.dataSources.add(this._pluginLayer),this._installPlugin())}E.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=z.defaultValue(e.splitNum,50),this._positions&&this._positions.length>0&&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 z.Cartesian3,a=z.Cartesian3.subtract(t[0],t[1],n);a=a.x>0,this.excavateMinHeight=9999;for(var r=0;r<i;r++){var o=(r+1)%i,s=z.Cartesian3.midpoint(t[r],t[o],new z.Cartesian3),l=z.Cartographic.fromCartesian(t[r]),c=this.viewer.scene.globe.getHeight(l)||l.height;c<this.excavateMinHeight&&(this.excavateMinHeight=c);var h,x=z.Cartesian3.normalize(s,new z.Cartesian3);h=a?z.Cartesian3.subtract(t[r],s,new z.Cartesian3):z.Cartesian3.subtract(t[o],s,new z.Cartesian3),h=z.Cartesian3.normalize(h,h);var d=z.Cartesian3.cross(h,x,new z.Cartesian3);d=z.Cartesian3.normalize(d,d);var u=new z.Plane(d,0),p=z.Plane.getPointDistance(u,s);e.push(new z.ClippingPlane(d,p))}this.viewer.scene.globe.clippingPlanes=new z.ClippingPlaneCollection({planes:e,edgeWidth:1,edgeColor:z.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=z.Cartographic.fromCartesian(t[s]),h=z.Cartographic.fromCartesian(t[l]),x=[c.longitude,c.latitude],d=[h.longitude,h.latitude];0==s&&(o.push(new z.Cartographic(x[0],x[1])),r.push(z.Cartesian3.fromRadians(x[0],x[1],n)),a.push(z.Cartesian3.fromRadians(x[0],x[1],0)));for(var u=1;u<=e;u++){var p=z.Math.lerp(x[0],d[0],u/e),g=z.Math.lerp(x[1],d[1],u/e);s==i-1&&u==e||(o.push(new z.Cartographic(p,g)),r.push(z.Cartesian3.fromRadians(p,g,n)),a.push(z.Cartesian3.fromRadians(p,g,0)))}}this.wellData={lerp_pos:o,bottom_pos:r,no_height_top:a}}},t.prototype._createWell=function(t){if(this.viewer.terrainProvider._layers){var e=this;this._createBottomSurface(t.bottom_pos);var i=z.sampleTerrainMostDetailed(this.viewer.terrainProvider,t.lerp_pos);z.when(i,(function(i){for(var n=i.length,a=[],r=0;r<n;r++){var o=z.Cartesian3.fromRadians(i[r].longitude,i[r].latitude,i[r].height);a.push(o)}e._createWellWall(t.bottom_pos,a)}))}else this._createBottomSurface(t.bottom_pos),this._createWellWall(t.bottom_pos,t.no_height_top)},t.prototype._getMinHeight=function(t){let e=5e6,i=null;for(let n=0;n<t.length;n++){let a=t[n].z;a<e&&(e=a,i=this._ellipsoidToLonLat(t[n]))}return i.altitude},t.prototype._ellipsoidToLonLat=function(t){let e=this.viewer.scene.globe.ellipsoid,i=new z.Cartesian3(t.x,t.y,t.z),n=e.cartesianToCartographic(i),a=z.Math.toDegrees(n.latitude);return{longitude:z.Math.toDegrees(n.longitude),latitude:a,altitude:n.height}},t.prototype._createBottomSurface=function(t){if(t.length){let n=this._getMinHeight(t),a=[];for(let e=0;e<t.length;e++){let i=this._ellipsoidToLonLat(t[e]);a.push(i.longitude),a.push(i.latitude),a.push(n)}let r=new z.PolygonGeometry({polygonHierarchy:new z.PolygonHierarchy(z.Cartesian3.fromDegreesArrayHeights(a)),perPositionHeight:!0}),o=z.PolygonGeometry.createGeometry(r);var e=new z.Material({fabric:{type:"Image",uniforms:{image:this.bottomImg}}}),i=new z.MaterialAppearance({translucent:!1,flat:!0,material:e});this.bottomSurface=new z.Primitive({geometryInstances:new z.GeometryInstance({geometry:o}),appearance:i,asynchronous:!1}),this.viewer.scene.primitives.add(this.bottomSurface)}},t.prototype._createWellWall=function(t,e){let i=this._getMinHeight(t),n=[],a=[];for(let t=0;t<e.length;t++)n.push(this._ellipsoidToLonLat(e[t]).altitude),a.push(i);let r=new z.WallGeometry({positions:e,maximumHeights:n,minimumHeights:a}),o=z.WallGeometry.createGeometry(r);var s=new z.Material({fabric:{type:"Image",uniforms:{image:this.wallImg}}}),l=new z.MaterialAppearance({translucent:!1,flat:!0,material:s});this.wellWall=new z.Primitive({geometryInstances:new z.GeometryInstance({geometry:o,attributes:{color:z.ColorGeometryInstanceAttribute.fromColor(z.Color.GREY)},id:"PitWall"}),appearance:l,asynchronous:!1}),this.viewer.scene.primitives.add(this.wellWall)},t.prototype._switchExcavate=function(t){t?(this.viewer.scene.globe.material=z.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(z.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)},z.Scene.TerrainClipPlan=t},buildLightScanGraphics:function(t){if(this._viewer&&t){for(var e=this,i=function(t,e,i){var n,a,r,o,s,l,c=t.positionList,h=0,x=0;function d(e){n=c[e+1][0]-c[e][0],a=c[e+1][1]-c[e][1],r=n/t.number,o=a/t.number,x=0}d(h),e.polygon.hierarchy=new z.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,d(h)),s=x*r,l=x*o,x++,new z.PolygonHierarchy(z.Cartesian3.fromDegreesArrayHeights([t.observer[0],t.observer[1],t.observer[2],i[0]+s,i[1]+l,0,i[2]+s,i[3]+l,0]))}),!1)},n=e._getCirclePoints(t.circle[0],t.circle[1],t.circle[2],t.circle[3]),a=function(t,i){for(var n=i.observer[0],a=i.observer[1],r=i.observer[2],o=[],s=0;s<t.length;s++){var l;l=s===t.length-1?new z.PolygonHierarchy(z.Cartesian3.fromDegreesArrayHeights([n,a,r,t[s].x,t[s].y,0,t[0].x,t[0].y,0])):new z.PolygonHierarchy(z.Cartesian3.fromDegreesArrayHeights([n,a,r,t[s].x,t[s].y,0,t[s+1].x,t[s+1].y,0]));var c=e._pluginLayer.entities.add({name:"三角形",polygon:{hierarchy:l,outline:!1,perPositionHeight:!0,material:i.material}});o.push(c)}return o}(n,t),r=0;r<a.length;r++)r!==a.length-1?i(t,a[r],[n[r].x,n[r].y,n[r+1].x,n[r+1].y]):i(t,a[r],[n[r].x,n[r].y,n[0].x,n[0].y]);return a}},buildPathRoaming:function(t){if(this._viewer&&t&&t.paths){var e=t.paths,i=new z.SampledPositionProperty,n=this.createGraphics(),a=new z.JulianDate,r=z.JulianDate.addSeconds(a,e[e.length-1].time,new z.JulianDate),o=t.startTime||a,s=t.stopTime||r;this._viewer.clock.startTime=o.clone(),this._viewer.clock.currentTime=o.clone(),this._viewer.clock.stopTime=s.clone(),this._viewer.clock.multiplier=t.multiplier||10,this._viewer.clock.clockRange=t.clockRange||z.ClockRange.CLAMPED;for(var l=0;l<e.length;l++){var c=z.Cartesian3.fromDegrees(e[l].lon,e[l].lat,e[l].alt),h=z.JulianDate.addSeconds(o,e[l].time,new z.JulianDate);i.addSample(h,c)}n.name=t.name||"路径漫游",n.availability=new z.TimeIntervalCollection([new z.TimeInterval({start:o,stop:s})]),n.position=i,n.orientation=new z.VelocityOrientationProperty(i);var x=[];return t.polyline&&(n.polyline={positions:new z.CallbackProperty((function(){return x}),!1),width:10,material:new z.PolylineGlowMaterialProperty({glowPower:1,color:z.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(){if(this._viewer){var t=this._viewer;function e(e,i){this._scratch=new z.Cartesian2,this._viewer=t,this._scene=t.scene,this._camera=t.camera,this._container=null,this._elements=e,this._isBackHide=i,this.init()}e.prototype.init=function(){var t=document.createElement("div");t.className="ys-css3-container",document.getElementById("info-warp").appendChild(t),this._container=t,this._elements.forEach((function(e){t.insertAdjacentHTML("beforeend",e.element)}));var e=this;this._scene.preRender.addEventListener((function(){for(var i=0;i<t.children.length;i++){var n=z.Cartesian3.fromDegrees(e._elements[i].position[0],e._elements[i].position[1],e._elements[i].position[2]||0),a=e._scene.cartesianToCanvasCoordinates(n,e._scratch);if(z.defined(a)&&(t.children[i].style.left=parseFloat(a.x)+parseFloat(e._elements[i].offset[0])+"px",t.children[i].style.top=parseFloat(a.y)+parseFloat(e._elements[i].offset[1])+"px",e._isBackHide)){var r=e._camera.position,o=e._scene.globe.ellipsoid.cartesianToCartographic(r).height;o+=1*e._scene.globe.ellipsoid.maximumRadius,z.Cartesian3.distance(r,n)>o?t.children[i].style.display="none":t.children[i].style.display="block"}}}))},e.prototype.remove=function(t){this._elements=this._elements.filter((function(t){t.id})),this._container.removeChild(document.getElementById(t))},e.prototype.append=function(t){this._elements.push(t),this._container.insertAdjacentHTML("beforeend",t.element)},e.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)},e.prototype.addEntityLayer=function(t){var e=t.position[0],i=t.position[1],n=this,a=.001;setTimeout((function(t){}),300);var r=z.Math.toRadians(30),o=z.Math.toRadians(30),s=t.boxHeight||300,l=t.boxHeightMax||400,c=t.boxHeightDif||10,h=!0;t.boxShow?this._viewer.entities.add({id:t.id+"_1",name:"立方体盒子",position:new z.CallbackProperty((function(){return(s+=c)>=l&&(s=l),z.Cartesian3.fromDegrees(e,i,s/2)}),!1),box:{dimensions:new z.CallbackProperty((function(){return(s+=c)>=l&&(s=l,h&&(h=!1,n.append(t,!0))),new z.Cartesian3(t.boxSide||100,t.boxSide||100,s)}),!1),material:t.boxMaterial||z.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:z.Cartesian3.fromDegrees(e,i),ellipse:{semiMinorAxis:new z.CallbackProperty((function(){return a}),!1),semiMajorAxis:new z.CallbackProperty((function(){return.001}),!1),material:this.getDfSt(["plugin","Css3Renderer_one"])||"static/data/images/Textures/circle2.png",rotation:new z.CallbackProperty((function(){return r+=.05}),!1),stRotation:new z.CallbackProperty((function(){return r+=.05}),!1),zIndex:2}}),this._viewer.entities.add({id:t.id+"_3",name:"椭圆",position:z.Cartesian3.fromDegrees(e,i),ellipse:{semiMinorAxis:new z.CallbackProperty((function(){return.001}),!1),semiMajorAxis:new z.CallbackProperty((function(){return.001}),!1),material:this.getDfSt(["plugin","Css3Renderer_two"])||"static/data/images/Textures/circle1.png",rotation:new z.CallbackProperty((function(){return o-=.03}),!1),stRotation:new z.CallbackProperty((function(){return o-=.03}),!1),zIndex:3}}))},z.Scene.Css3Renderer=e}},_installGroundSkyBox:function(){var t=z.BoxGeometry,e=z.Cartesian3,i=z.defaultValue,n=z.defined,a=z.destroyObject,r=z.DeveloperError,o=z.GeometryPipeline,s=z.Matrix3,l=z.Matrix4,c=z.Transforms,h=z.VertexFormat,x=z.BufferUsage,d=z.CubeMap,u=z.DrawCommand,p=z.loadCubeMap,g=z.RenderState,m=z.VertexArray,f=z.BlendingState,v=z.SceneMode,y=z.ShaderProgram,b=z.ShaderSource;function C(t){this.sources=t.sources,this._sources=void 0,this.show=i(t.show,!0),this._command=new u({modelMatrix:l.clone(l.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}n(l.getRotation)||(l.getRotation=l.getMatrix3);var w=new s;C.prototype.update=function(i,a){var s=this;if(this.show&&(i.mode===v.SCENE3D||i.mode===v.MORPHING)&&i.passes.render){var u=i.context;if(this._sources!==this.sources){this._sources=this.sources;var C=this.sources;if(!(n(C.positiveX)&&n(C.negativeX)&&n(C.positiveY)&&n(C.negativeY)&&n(C.positiveZ)&&n(C.negativeZ)))throw new r("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof C.positiveX!=typeof C.negativeX||typeof C.positiveX!=typeof C.positiveY||typeof C.positiveX!=typeof C.negativeY||typeof C.positiveX!=typeof C.positiveZ||typeof C.positiveX!=typeof C.negativeZ)throw new r("this.sources properties must all be the same type.");"string"==typeof C.positiveX?p(u,this._sources).then((function(t){s._cubeMap=s._cubeMap&&s._cubeMap.destroy(),s._cubeMap=t})):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new d({context:u,source:C}))}var I=this._command;if(I.modelMatrix=c.eastNorthUpToFixedFrame(i.camera._positionWC),!n(I.vertexArray)){I.uniformMap={u_cubeMap:function(){return s._cubeMap},u_rotateMatrix:function(){return l.getRotation(I.modelMatrix,w)}};var A=t.createGeometry(t.fromDimensions({dimensions:new e(2,2,2),vertexFormat:h.POSITION_ONLY})),_=this._attributeLocations=o.createAttributeLocations(A);I.vertexArray=m.fromGeometry({context:u,geometry:A,attributeLocations:_,bufferUsage:x._DRAW}),I.renderState=g.fromCache({blending:f.ALPHA_BLEND})}if(!n(I.shaderProgram)||this._useHdr!==a){var G=new b({defines:[a?"HDR":""],sources:["uniform samplerCube u_cubeMap;\n varying vec3 v_texCoord;\n void main()\n {\n vec4 color = textureCube(u_cubeMap, normalize(v_texCoord));\n gl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n }\n "]});I.shaderProgram=y.fromCache({context:u,vertexShaderSource:"attribute vec3 position;\n varying 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:G,attributeLocations:this._attributeLocations}),this._useHdr=a}if(n(this._cubeMap))return I}},C.prototype.isDestroyed=function(){return!1},C.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(),a(this)},z.Scene.GroundSkyBox=C}};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=[],a=[],r=[],o=i.transformWGS84ToCartesian(e[0]),s=i.transformWGS84ToCartesian(e[1]);n=i.$graphics.createPointsGraphics({point:!0,positions:[o,s]});var l=i.$math3d.getIntersectObj(o,s,n,!0);if(0===l.length)return alert("没有取到相交点 , 请检查是否开启深度检测。"),!1;!function(){for(let t=l.length-1;t>=0;t--){const e=l[t];L.defined(e.position)||l.splice(t,1)}if(!L.defined(l[0].position))throw new L.DeveloperError("position is undefined");var t=l[0].position,e=L.Cartesian3.distance(t,s)<5,c=[o,l[0].position],h=i._analysisLayer.entities.add({polyline:{positions:c,width:10,arcType:L.ArcType.NONE,material:new L.PolylineArrowMaterialProperty(L.Color.GREEN)}});if(a.push(h),!e){var x=[l[0].position,s],d=i._analysisLayer.entities.add({polyline:{positions:x,width:10,arcType:L.ArcType.NONE,material:new L.PolylineArrowMaterialProperty(L.Color.RED)}});a.push(d)}!function(){for(let s=0;s<l.length;++s){var t=l[s].object;if(t)if(t instanceof L.Cesium3DTileFeature)r.push(t),t.oldColor=t.color.clone(),t.color=L.Color.fromAlpha(L.Color.YELLOW,t.color.alpha);else if(t.id instanceof L.Entity){var e=t.id,a=e.polygon||e.polyline;r.push(e);var o=a.material.color.getValue();a.oldColor=o.clone(),a.material=L.Color.fromAlpha(L.Color.YELLOW,o.alpha)}n.push(i._analysisLayer.entities.add({position:l[s].position,ellipsoid:{radii:new L.Cartesian3(.8,.8,.8),material:L.Color.RED}}))}}();var u=L.Cartographic.fromCartesian(o),p=L.Cartographic.fromCartesian(s),g={longitude:u.longitude/Math.PI*180,latitude:u.latitude/Math.PI*180,height:u.height},m={longitude:p.longitude/Math.PI*180,latitude:p.latitude/Math.PI*180,height:p.height},f=Math.sqrt(Math.pow(o.x-s.x,2)+Math.pow(o.y-s.y,2)+Math.pow(o.z-s.z,2)),v=Math.abs(m.height-g.height),y=Math.sqrt(Math.pow(f,2)+Math.pow(v,2)),b=e?"是":"否",C="起点坐标: ("+g.longitude.toFixed(6)+"°,"+g.latitude.toFixed(6)+"°,"+g.height.toFixed(2)+")\n终点坐标: ("+m.longitude.toFixed(6)+"°,"+m.latitude.toFixed(6)+"°,"+m.height.toFixed(2)+")\n垂直距离: "+v.toFixed(2)+"m\n水平距离: "+f.toFixed(2)+"m\n空间距离: "+y.toFixed(2)+"m\n是否可视: "+b;n&&n[0]&&(n[0].label={text:C,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 e=t.that,i=this;if(!e._viewer.scene.globe.depthTestAgainstTerrain)return alert("请开启深度检测"),!1;var n=t.viewHeight||10,a=L.Cartographic.fromCartesian(t.center);try{var r=t.radius,o={};o.semiMinorAxis=r,o.semiMajorAxis=r,o.rotation=0,o.center=t.center,o.granularity=Math.PI/45;let s=e.computeEllipseEdgePositions(o);for(let t=0;t<s.outerPositions.length;t+=3){let r=new L.Cartesian3(s.outerPositions[t],s.outerPositions[t+1],s.outerPositions[t+2]),o=L.Cartographic.fromCartesian(r),l=5e-5*Math.PI/180,c=e.computeInterpolateLineCartographic(a,o,l);e.computeCartographicPointsTerrainData(c,(function(t){if(t.length>0){let a=!0,r=[],o=[];for(let i=1;i<t.length;i++){let s=!0;if(i>1){let r=new L.Cartographic(t[0].longitude,t[0].latitude,t[0].height+n);if(a){e.computeInterpolateIndexLineHeightCartographic(r,t[i],i,i-1).height>=t[i-1].height?(a=!0,s=!0):(a=!1,s=!1)}else{let n=e.computeInterpolateIndexLineHeightCartographic(r,t[i],i,i-1);for(let e=0;e<n.length;e++){if(!(n[e].height>=t[e].height)){a=!1,s=!1;break}a=!0,s=!0}}}let l=L.Cartesian3.fromRadians(t[i].longitude,t[i].latitude,t[i].height+1);r.push(l),s?(o.push(0),o.push(0),o.push(1),o.push(1)):(o.push(1),o.push(0),o.push(0),o.push(1))}i._pointsKSYResult=new L.Scene.PointsPrimitive({viewer:e._viewer,Cartesians:r,Colors:o})}else alert("高程异常!")}))}}catch(t){console.log(t)}Q.prototype.remove=function(){}}function J(t){if(t&&t.positions){var e=t.positions,i=t.that;!function(t,e){for(var n=[L.Cartographic.fromCartesian(t)],a=new L.Cartesian3,o=[0],s=[0],l=0,c=1;c<=10;c++){L.Cartesian3.lerp(t,e,c/10,a);var h=L.Cartographic.fromCartesian(a),x=i._viewer.scene.globe.getHeight(h);h.height=x,n.push(h);var d=n[c-1],u=L.Cartesian3.distance(L.Cartographic.toCartesian(d),L.Cartographic.toCartesian(h));s.push(s[c-1]+u),l=Math.asin((h.height-d.height)/u),o.push(100*Math.tan(l))}var p=document.createElement("div");p.className="echart-viewer",i._viewer.container.appendChild(p,"dark",{renderer:"canvas",width:640,height:480}),p.style.position="absolute",p.style.left="20px",p.style.bottom="20px",p.style.height="300px",p.style.width="640px",p.style.overflow="hidden",p.style.zIndex="9999",p.style.opacity=.9;var g=r.init(p),m={title:{text:"剖面示意图",left:"center",subtext:"",textStyle:{color:"white",fontSize:15}},tooltip:{trigger:"axis"},legend:{data:[""]},toolbox:{show:!1,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:s,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:o,markPoint:{data:[{type:"max",name:"最大值"},{type:"min",name:"最小值"}]},markLine:{data:[{type:"average",name:"平均值"}]}}]};g.setOption(m)}(i.transformWGS84ToCartesian(e[0]),i.transformWGS84ToCartesian(e[1]))}}function O(t){if(t&&t.positions&&t.that){var e=t.that,i=t.positions,n=!0,a=this;!function(){var t=e._viewer.terrainProvider.availability;if(!t)return alert("未获取到地形"),!1;for(var o=15e3,s=0;s<i.length;s++){var l=L.Cartographic.fromCartesian(i[s]),c=e._viewer.scene.globe.getHeight(l);o>c&&(o=c);t.computeMaximumLevelAtPosition(l)}var h=Math.PI/Math.pow(2,11);h/=64;var x,d,u,p,g,m,f,v,y,b,C,w,I,A,_=new L.PolygonGeometry.fromPositions({positions:i,vertexFormat:L.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:h}),G=new L.PolygonGeometry.createGeometry(_),W=0,P=0,Z=new L.Cartesian3;for(s=0;s<G.indices.length;s+=3)if(x=G.indices[s],d=G.indices[s+1],u=G.indices[s+2],A=G.attributes.position.values,Z.x=A[3*x],Z.y=A[3*x+1],Z.z=A[3*x+2],l=L.Cartographic.fromCartesian(Z),p=e._viewer.scene.globe.getHeight(l),f=L.Cartesian3.fromRadians(l.longitude,l.latitude,p),b=L.Cartesian3.fromRadians(l.longitude,l.latitude,0),P<p&&(P=p),Z.x=A[3*d],Z.y=A[3*d+1],Z.z=A[3*d+2],l=L.Cartographic.fromCartesian(Z),g=e._viewer.scene.globe.getHeight(l),v=L.Cartesian3.fromRadians(l.longitude,l.latitude,g),C=L.Cartesian3.fromRadians(l.longitude,l.latitude,0),P<g&&(P=g),Z.x=A[3*u],Z.y=A[3*u+1],Z.z=A[3*u+2],l=L.Cartographic.fromCartesian(Z),m=e._viewer.scene.globe.getHeight(l),y=L.Cartesian3.fromRadians(l.longitude,l.latitude,m),w=L.Cartesian3.fromRadians(l.longitude,l.latitude,0),P<m&&(P=m),I=r(b,C,w),W+=I*(p-o+g-o+m-o)/3,n){var M=[];M.push(f),M.push(v),M.push(y);var S={polygon:{hierarchy:{positions:M},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(S)}var V=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)}var r=0,o=0,s=0,l=0,c=0,h=0,x=0,d=0;for(n=0;n<t.length;n++)r=e[n],o=i[n],n==t.length-1?(s=e[0],l=i[0]):(s=e[n+1],l=i[n+1]),c+=h=r*l-s*o,x+=(r+s)*h,d+=(o+l)*h;return x/=6*(c*=.5),d/=6*c,new L.Cartographic(x,d)}(i);a._volumeLabel=e._analysisLayer.entities.add({position:L.Cartesian3.fromRadians(V.longitude,V.latitude,P+1e3),label:{text:"Cut Volume "+W.toString()+"m3"}})}()}function r(t,e,i){var n=L.Cartesian3.distance(t,e),a=L.Cartesian3.distance(e,i),r=L.Cartesian3.distance(i,t),o=(n+a+r)/2;return Math.sqrt(o*(o-n)*(o-a)*(o-r))}}U.prototype={createVisibilityAnalysis:function(t){t=t||{};var e=this;e.drawLineGraphics({type:"straightLine",clampToGround:!1,callback:function(i,n){var a=new H({positions:i,that:e});e._graphicsLayer&&e._graphicsLayer.entities.remove(n),"function"==typeof t.callback&&t.callback(a)}})},createLookAroundAnalysis:function(t){if(t=t||{},this._viewer&&t){var e=this;e.drawCircleGraphics({callback:function(i,n){e._drawLayer.entities.remove(n);let a=new Q({that:e,radius:i.radius,center:i.center});"function"==typeof t.callback&&t.callback(a)}})}},createVisualFieldAnalysis:function(t){if(t=t||{},this._viewer&&t){var e=this,i=null;e.bindHandelEvent({leftClick:function(t,n){var a=e._viewer.scene.pickPosition(t.position);if(!a)return!1;L.defined(i)?(n.destroy(),n=null):(i=new L.Scene.ShadowPrimitive({scene:e._viewer.scene,viewerPosition:a}),e._analysisLayer._primitives.add(i))},mouseMove:function(t){var n=e._viewer.scene.pickPosition(t.endPosition);if(!n)return!1;i&&i.setPoseByTargetPoint(n)}})}},createClipPlanAnalysis:function(t){if(t=t||{},this._viewer&&t){var e=this,i=t.height||30,n=t.splitNum||50,a=t.wallImg||this.getDfSt(["amalysis","createClipPlanAnalysis_wallImg"])||"static/data/images/file/excavate_side_min.jpg",r=t.bottomImg||this.getDfSt(["amalysis","createClipPlanAnalysis_bottomImg"])||"static/data/images/file/excavate_bottom_min.jpg";e.drawPolygonGraphics({callback:function(o,s){e._drawLayer.entities.remove(s);let l=new L.Scene.TerrainClipPlan(e._viewer,{height:i,splitNum:n,wallImg:a,bottomImg:r});const c=e.transformWGS84ArrayToCartesianArray(o);l.updateData(c),"function"==typeof t.callback&&t.callback(l)}})}},createSubmergedAnalysis:function(t){if(t=t||{},this._viewer&&t){var e=this,i=t.maxH||15,n=t.speed||1,a=t.interval||10,r=this.getDfSt(["amalysis","createSubmergedAnalysis"])||"static/data/images/file/water.png";e.drawPolygonGraphics({height:1,callback:function(t,o){if(!e._viewer.scene.globe.depthTestAgainstTerrain)return alert("请开启深度检测"),!1;o&&setTimeout(()=>{o.polygon.heightReference="CLAMP_TO_GROUND",o.polygon.material=r;var t=0;o.polygon.extrudedHeight=t;var e=setInterval((function(){(t+=n)>=i&&(t=i,clearTimeout(e)),o.polygon.extrudedHeight=t}),a)},2e3)}})}},createSlopeAnalysis:function(t){if(t=t||{},!r)return alert("需要引入echarts库"),!1;var e=this;this._viewer&&t&&e.drawLineGraphics({type:"straightLine",clampToGround:!1,callback:function(i,n){var a=new J({positions:i,that:e});e._graphicsLayer&&e._graphicsLayer.entities.remove(n),"function"==typeof t.callback&&t.callback(a)}})},createCutVolumeAnalysis:function(t){if(t=t||{},this._viewer&&t){var e=this;e.drawWallGraphics({callback:function(i){var n=new O({positions:e.transformWGS84ArrayToCartesianArray(i,100),that:e});"function"==typeof t.callback&&t.callback(n)}})}}};var j={version:"1.0.0",PlotUtils:{}};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],a=[n[0]-t[1]+e[1],n[1]+t[0]-e[0]],r=[(t[0]+i[0])/2,(t[1]+i[1])/2],o=[r[0]-t[1]+i[1],r[1]+t[0]-i[0]];return j.PlotUtils.getIntersectPoint(n,a,r,o)},j.PlotUtils.getIntersectPoint=function(t,e,i,n){if(t[1]==e[1]){var a=(n[0]-i[0])/(n[1]-i[1]),r=a*(t[1]-i[1])+i[0],o=t[1];return[r,o]}if(i[1]==n[1]){var s=(e[0]-t[0])/(e[1]-t[1]);return[r=s*(i[1]-t[1])+t[0],o=i[1]]}return s=(e[0]-t[0])/(e[1]-t[1]),a=(n[0]-i[0])/(n[1]-i[1]),[r=s*(o=(s*t[1]-t[0]-a*i[1]+i[0])/(s-a))-s*t[1]+t[0],o]},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){var n=j.PlotUtils.getAzimuth(e,t)-j.PlotUtils.getAzimuth(e,i);return 0>n?n+j.Constants.TWO_PI:n},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){var r=j.PlotUtils.getAzimuth(t,e),o=a?r+i:r-i,s=n*Math.cos(o),l=n*Math.sin(o);return[e[0]+s,e[1]+l]},j.PlotUtils.getArcPoints=function(t,e,i,n){var a,r,o=[],s=n-i;s=0>s?s+j.Constants.TWO_PI:s;for(var l=0;l<=j.Constants.FITTING_COUNT;l++){var c=i+s*l/j.Constants.FITTING_COUNT;a=t[0]+e*Math.cos(c),r=t[1]+e*Math.sin(c),o.push([a,r])}return o},j.PlotUtils.getBisectorNormals=function(t,e,i,n){var a=j.PlotUtils.getNormal(e,i,n),r=Math.sqrt(a[0]*a[0]+a[1]*a[1]),o=a[0]/r,s=a[1]/r,l=j.PlotUtils.distance(e,i),c=j.PlotUtils.distance(i,n);if(r>j.Constants.ZERO_TOLERANCE)if(j.PlotUtils.isClockWise(e,i,n)){var h=t*l,x=i[0]-h*s,d=i[1]+h*o,u=[x,d];h=t*c;var p=[x=i[0]+h*s,d=i[1]-h*o]}else h=t*l,u=[x=i[0]+h*s,d=i[1]-h*o],h=t*c,p=[x=i[0]-h*s,d=i[1]+h*o];else u=[x=i[0]+t*(e[0]-i[0]),d=i[1]+t*(e[1]-i[1])],p=[x=i[0]+t*(n[0]-i[0]),d=i[1]+t*(n[1]-i[1])];return[u,p]},j.PlotUtils.getNormal=function(t,e,i){var n=t[0]-e[0],a=t[1]-e[1],r=Math.sqrt(n*n+a*a);n/=r,a/=r;var o=i[0]-e[0],s=i[1]-e[1],l=Math.sqrt(o*o+s*s);return[n+(o/=l),a+(s/=l)]},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],s=j.PlotUtils.getBisectorNormals(t,a,r,o);i=i.concat(s)}var l=j.PlotUtils.getRightMostControlPoint(e);i.push(l);var c=[];for(n=0;n<e.length-1;n++){a=e[n],r=e[n+1],c.push(a);for(t=0;t<j.Constants.FITTING_COUNT;t++){var h=j.PlotUtils.getCubicValue(t/j.Constants.FITTING_COUNT,a,i[2*n],i[2*n+1],r);c.push(h)}c.push(r)}return c},j.PlotUtils.getLeftMostControlPoint=function(e){var i=e[0],n=e[1],a=e[2],r=j.PlotUtils.getBisectorNormals(0,i,n,a)[0],o=j.PlotUtils.getNormal(i,n,a);if(Math.sqrt(o[0]*o[0]+o[1]*o[1])>j.Constants.ZERO_TOLERANCE)var s=j.PlotUtils.mid(i,n),l=i[0]-s[0],c=i[1]-s[1],h=2/j.PlotUtils.distance(i,n),x=-h*c,d=h*l,u=x*x-d*d,p=2*x*d,g=d*d-x*x,m=r[0]-s[0],f=r[1]-s[1],v=s[0]+u*m+p*f,y=s[1]+p*m+g*f;else v=i[0]+t*(n[0]-i[0]),y=i[1]+t*(n[1]-i[1]);return[v,y]},j.PlotUtils.getRightMostControlPoint=function(e){var i=e.length,n=e[i-3],a=e[i-2],r=e[i-1],o=j.PlotUtils.getBisectorNormals(0,n,a,r)[1],s=j.PlotUtils.getNormal(n,a,r);if(Math.sqrt(s[0]*s[0]+s[1]*s[1])>j.Constants.ZERO_TOLERANCE)var l=j.PlotUtils.mid(a,r),c=r[0]-l[0],h=r[1]-l[1],x=2/j.PlotUtils.distance(a,r),d=-x*h,u=x*c,p=d*d-u*u,g=2*d*u,m=u*u-d*d,f=o[0]-l[0],v=o[1]-l[1],y=l[0]+p*f+g*v,b=l[1]+g*f+m*v;else y=r[0]+t*(a[0]-r[0]),b=r[1]+t*(a[1]-r[1]);return[y,b]},j.PlotUtils.getBezierPoints=function(t){if(t.length<=2)return t;for(var e=[],i=t.length-1,n=0;1>=n;n+=.01){for(var a=0,r=0,o=0;i>=o;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(1>=t)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;t>=i;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;i>=n;n++)for(var a=0;1>=a;a+=.05){for(var r=0,o=0,s=0;2>=s;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};var K={version:"1.0.0",createTime:"2018.6.19",author:"xupinhui"},q="doublearrow",$=.25,tt=.3,et=.85,it=.15,nt={headHeightFactor:.18,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15,tailWidthFactor:.1,headTailFactor:.8,swallowTailFactor:1},at={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,this.tempPoint4=null,this.points=t;var i={controlPoint:null,polygonalPoint:null};if(!(2>(l=t.length))){if(2==l)return t;var n,a,r=this.points[0],o=this.points[1],s=this.points[2],l=t.length;this.tempPoint4=3==l?K.algorithm.getTempPoint4(r,o,s):this.points[3],this.connPoint=3==l||4==l?j.PlotUtils.mid(r,o):this.points[4],j.PlotUtils.isClockWise(r,o,s)?(n=K.algorithm.getArrowPoints(r,this.connPoint,this.tempPoint4,!1),a=K.algorithm.getArrowPoints(this.connPoint,o,s,!0)):(n=K.algorithm.getArrowPoints(o,this.connPoint,s,!1),a=K.algorithm.getArrowPoints(this.connPoint,r,this.tempPoint4,!0));var c=n.length,h=(c-5)/2,x=n.slice(0,h),d=n.slice(h,h+5),u=n.slice(h+5,c),p=a.slice(0,h),g=a.slice(h,h+5),m=a.slice(h+5,c);p=j.PlotUtils.getBezierPoints(p);var f=j.PlotUtils.getBezierPoints(m.concat(x.slice(1)));u=j.PlotUtils.getBezierPoints(u);var v=p.concat(g,f,d,u),y=K.algorithm.array2Dto1D(v);i.controlPoint=[r,o,s,this.tempPoint4,this.connPoint],i.polygonalPoint=e.Cartesian3.fromDegreesArray(y)}return i},K.algorithm.threeArrow=function(t){this.connPoint=null,this.tempPoint4=null,this.tempPoint5=null,this.points=t;var e={controlPoint:null,polygonalPoint:null};if((i=t.length)>=2){if(2==i)return t;var i,n,a,r=this.points[0],o=this.points[1],s=this.points[2];3==(i=t.length)?(this.tempPoint4=K.algorithm.getTempPoint4(r,o,s),this.tempPoint5=j.PlotUtils.mid(s,this.tempPoint4)):(this.tempPoint4=this.points[3],this.tempPoint5=this.points[4]),this.connPoint=i<6?j.PlotUtils.mid(r,o):this.points[5],j.PlotUtils.isClockWise(r,o,s)?(n=K.algorithm.getArrowPoints(r,this.connPoint,this.tempPoint4,!1),a=K.algorithm.getArrowPoints(this.connPoint,o,s,!0)):(n=K.algorithm.getArrowPoints(o,this.connPoint,s,!1),a=K.algorithm.getArrowPoints(this.connPoint,r,this.tempPoint4,!0));var l=n.length,c=(l-5)/2,h=n.slice(0,c),x=n.slice(c,c+5),d=n.slice(c+5,l),u=a.slice(0,c),p=a.slice(c,c+5),g=a.slice(c+5,l);u=j.PlotUtils.getBezierPoints(u);var m=j.PlotUtils.getBezierPoints(g.concat(h.slice(1)));d=j.PlotUtils.getBezierPoints(d);var f=u.concat(p,m,x,d),v=K.algorithm.array2Dto1D(f);e.controlPoint=[r,o,s,this.tempPoint4,this.tempPoint5,this.connPoint],e.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(v)}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=$,this.headWidthFactor=tt,this.neckHeightFactor=et,this.neckWidthFactor=it;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),l=[a,o=j.PlotUtils.getThirdPoint(a,o,j.Constants.HALF_PI,r/5,n),s=j.PlotUtils.getThirdPoint(a,s,j.Constants.HALF_PI,r/4,n),i],c=K.algorithm.getArrowHeadPoints(l,this.headHeightFactor,this.headWidthFactor,this.neckHeightFactor,this.neckWidthFactor),h=c[0],x=c[4],d=j.PlotUtils.distance(t,e)/j.PlotUtils.getBaseLength(l)/2,u=K.algorithm.getArrowBodyPoints(l,h,x,d),p=u.length,g=u.slice(0,p/2),m=u.slice(p/2,p);return g.push(h),m.push(x),(g=g.reverse()).push(e),(m=m.reverse()).push(t),g.reverse().concat(c,m)},K.algorithm.getArrowHeadPoints=function(t,e,i){this.type=q,this.headHeightFactor=$,this.headWidthFactor=tt,this.neckHeightFactor=et,this.neckWidthFactor=it;var n=j.PlotUtils.getBaseLength(t)*this.headHeightFactor,a=t[t.length-1],r=(j.PlotUtils.distance(e,i),n*this.headWidthFactor),o=n*this.neckWidthFactor,s=n*this.neckHeightFactor,l=j.PlotUtils.getThirdPoint(t[t.length-2],a,0,n,!0),c=j.PlotUtils.getThirdPoint(t[t.length-2],a,0,s,!0),h=j.PlotUtils.getThirdPoint(a,l,j.Constants.HALF_PI,r,!1),x=j.PlotUtils.getThirdPoint(a,l,j.Constants.HALF_PI,r,!0);return[j.PlotUtils.getThirdPoint(a,c,j.Constants.HALF_PI,o,!1),h,a,x,j.PlotUtils.getThirdPoint(a,c,j.Constants.HALF_PI,o,!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 x=j.PlotUtils.getAngleOfThreePoints(t[h-1],t[h],t[h+1])/2,d=(r/2-(s+=j.PlotUtils.distance(t[h-1],t[h]))/a*o)/Math.sin(x),u=j.PlotUtils.getThirdPoint(t[h-1],t[h],Math.PI-x,d,!0),p=j.PlotUtils.getThirdPoint(t[h-1],t[h],x,d,!1);l.push(u),c.push(p)}return l.concat(c)},K.algorithm.getTempPoint4=function(t,e,i){var n,a,r,o,s=j.PlotUtils.mid(t,e),l=j.PlotUtils.distance(s,i),c=j.PlotUtils.getAngleOfThreePoints(t,s,i);return c<j.Constants.HALF_PI?(a=l*Math.sin(c),r=l*Math.cos(c),o=j.PlotUtils.getThirdPoint(t,s,j.Constants.HALF_PI,a,!1),n=j.PlotUtils.getThirdPoint(s,o,j.Constants.HALF_PI,r,!0)):c>=j.Constants.HALF_PI&&c<Math.PI?(a=l*Math.sin(Math.PI-c),r=l*Math.cos(Math.PI-c),o=j.PlotUtils.getThirdPoint(t,s,j.Constants.HALF_PI,a,!1),n=j.PlotUtils.getThirdPoint(s,o,j.Constants.HALF_PI,r,!1)):c>=Math.PI&&c<1.5*Math.PI?(a=l*Math.sin(c-Math.PI),r=l*Math.cos(c-Math.PI),o=j.PlotUtils.getThirdPoint(t,s,j.Constants.HALF_PI,a,!0),n=j.PlotUtils.getThirdPoint(s,o,j.Constants.HALF_PI,r,!0)):(a=l*Math.sin(2*Math.PI-c),r=l*Math.cos(2*Math.PI-c),o=j.PlotUtils.getThirdPoint(t,s,j.Constants.HALF_PI,a,!0),n=j.PlotUtils.getThirdPoint(s,o,j.Constants.HALF_PI,r,!1)),n},K.algorithm.tailedAttackArrow=function(t,e){t=K.algorithm.dereplication(t),this.tailWidthFactor=nt.tailWidthFactor,this.swallowTailFactor=nt.swallowTailFactor,this.swallowTailPnt=nt.swallowTailPnt;var i={controlPoint:null,polygonalPoint:null};if(i.controlPoint=t,!(2>(g=t.length))){if(2==t.length)return i.polygonalPoint=t,i;var n=t,a=n[0],r=n[1];j.PlotUtils.isClockWise(n[0],n[1],n[2])&&(a=n[1],r=n[0]);var o=[j.PlotUtils.mid(a,r)].concat(n.slice(2)),s=K.algorithm.getAttackArrowHeadPoints(o,a,r,nt),l=s[0],c=s[4],h=j.PlotUtils.distance(a,r),x=j.PlotUtils.getBaseLength(o),d=x*this.tailWidthFactor*this.swallowTailFactor;this.swallowTailPnt=j.PlotUtils.getThirdPoint(o[1],o[0],0,d,!0);var u=h/x,p=K.algorithm.getAttackArrowBodyPoints(o,l,c,u),g=p.length,m=[a].concat(p.slice(0,g/2));m.push(l);var f,v=[r].concat(p.slice(g/2,g));v.push(c),m=j.PlotUtils.getQBSplinePoints(m),v=j.PlotUtils.getQBSplinePoints(v),f=K.algorithm.array2Dto1D(m.concat(s,v.reverse(),[this.swallowTailPnt,m[0]])),i.polygonalPoint=e.Cartesian3.fromDegreesArray(f)}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 a=j.PlotUtils.getBaseLength(t),r=a*this.headHeightFactor,o=t[t.length-1];a=j.PlotUtils.distance(o,t[t.length-2]);var s=j.PlotUtils.distance(e,i);r>s*this.headTailFactor&&(r=s*this.headTailFactor);var l=r*this.headWidthFactor,c=r*this.neckWidthFactor,h=(r=r>a?a:r)*this.neckHeightFactor,x=j.PlotUtils.getThirdPoint(t[t.length-2],o,0,r,!0),d=j.PlotUtils.getThirdPoint(t[t.length-2],o,0,h,!0),u=j.PlotUtils.getThirdPoint(o,x,j.Constants.HALF_PI,l,!1),p=j.PlotUtils.getThirdPoint(o,x,j.Constants.HALF_PI,l,!0);return[j.PlotUtils.getThirdPoint(o,d,j.Constants.HALF_PI,c,!1),u,o,p,j.PlotUtils.getThirdPoint(o,d,j.Constants.HALF_PI,c,!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 x=j.PlotUtils.getAngleOfThreePoints(t[h-1],t[h],t[h+1])/2,d=(r/2-(s+=j.PlotUtils.distance(t[h-1],t[h]))/a*o)/Math.sin(x),u=j.PlotUtils.getThirdPoint(t[h-1],t[h],Math.PI-x,d,!0),p=j.PlotUtils.getThirdPoint(t[h-1],t[h],x,d,!1);l.push(u),c.push(p)}return l.concat(c)},K.algorithm.dereplication=function(t){var e=t[t.length-1],i=!1,n=[];return n=t.filter((function(t){if(t[0]!=e[0]&&t[1]!=e[1])return t;i=!0})),i&&n.push(e),n},K.algorithm.fineArrow=function(t,e,i){if(t.length<2||e.length<2)return;let n=at.tailWidthFactor,a=at.neckWidthFactor,r=at.headWidthFactor,o=at.headAngle,s=at.neckAngle;var l=[];l[0]=t,l[1]=e;var c=l[0],h=l[1],x=j.PlotUtils.getBaseLength(l),d=x*n,u=x*a,p=x*r,g=j.PlotUtils.getThirdPoint(h,c,j.Constants.HALF_PI,d,!0),m=j.PlotUtils.getThirdPoint(h,c,j.Constants.HALF_PI,d,!1),f=j.PlotUtils.getThirdPoint(c,h,o,p,!1),v=j.PlotUtils.getThirdPoint(c,h,o,p,!0),y=j.PlotUtils.getThirdPoint(c,h,s,u,!1),b=j.PlotUtils.getThirdPoint(c,h,s,u,!0),C=[];C.push(g[0],g[1],y[0],y[1],f[0],f[1],h[0],h[1],v[0],v[1],b[0],b[1],m[0],m[1],c[0],c[1]);return C.some(t=>isNaN(t))?"":i.Cartesian3.fromDegreesArray(C)};let rt=null;function ot(t,e){this.viewer=t,rt=e,this.handler=new rt.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.fillMaterial=rt.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}ot.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},ot.prototype.disableHandler=function(){this.handler&&(this.handler.destroy(),this.handler=new rt.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)};let st=null;var lt=function(t,e){ot.call(this,t,e),st=e,this.type="AttackArrow",this.fillMaterial=st.Color.RED.withAlpha(.5)};function ct(t,e){var i=e.camera.getPickRay(t);return i?e.scene.globe.pick(i,e.scene):null}lt.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 st.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(t){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var e=this;this.state=1,this.handler||(this.handler=new st.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction((function(t){var i;if(i=ct(t.position,e.viewer)){0==e.positions.length&&(e.floatPoint=e.creatPoint(i),e.floatPoint.wz=-1),e.positions.push(i);var n=e.creatPoint(i);e.positions.length>2?n.wz=e.positions.length-1:n.wz=e.positions.length,e.pointArr.push(n)}}),st.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction((function(i){var n;!e.floatPoint||e.positions.length<2||(n=ct(i.endPosition,e.viewer))&&(e.floatPoint.position.setValue(n),e.positions.length>=2&&(st.defined(e.arrowEntity)?(e.positions.pop(),e.positions.push(n)):(e.positions.push(n),e.arrowEntity=e.showArrowOnMap(e.positions),e.arrowEntity.objId=e.objId,t&&t(e.objId))))}),st.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction((function(t){var i;if(i=ct(t.position,e.viewer)){for(var n=0;n<e.pointArr.length;n++)e.pointArr[n].show=!1;e.floatPoint.show=!1,e.viewer.entities.remove(e.floatPoint),e.floatPoint=null;var a=e.creatPoint(i);a.show=!1,a.wz=e.positions.length,e.pointArr.push(a),e.positions=[],e.pointArr=[],e.arrowEntity=null}}),st.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=st.Cartesian3.fromDegrees(t[i][0],t[i][1]);e.push(n)}this.positions=e;for(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 t=this,e=0;e<t.pointArr.length;e++)t.pointArr[e].show=!0;this.modifyHandler||(this.modifyHandler=new st.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction((function(e){var i=t.viewer.scene.pick(e.position);if(st.defined(i)&&i.id)t.clickStep++,i.id.objId||(t.selectPoint=i.id);else{for(var n=0;n<t.pointArr.length;n++)t.pointArr[n].show=!1;t.floatPoint&&(t.floatPoint.show=!1),t.state=-1,t.modifyHandler.destroy(),t.modifyHandler=null}if(2==t.clickStep){var a;if(t.clickStep=0,!(a=ct(e.position,t.viewer)))return;t.selectPoint&&(t.selectPoint.position.setValue(a),t.selectPoint=null)}}),st.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction((function(e){var i;(i=ct(e.endPosition,t.viewer))&&t.selectPoint&&(t.selectPoint.position.setValue(i),t.positions[t.selectPoint.wz-1]=i)}),st.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){var e=this.viewer.entities.add({position:t,point:{pixelSize:10,color:st.Color.YELLOW}});return e.attr="editPoint",e},showArrowOnMap:function(t){var e=this;return this.viewer.entities.add({id:e.objId,polygon:new st.PolygonGraphics({hierarchy:new st.CallbackProperty((function(){if(t.length<3)return null;for(var i=[],n=0;n<t.length;n++){var a=e.cartesianToLatlng(t[n]);i.push(a)}var r=e.xp.algorithm.tailedAttackArrow(i,st),o=[];return-1==JSON.stringify(r.polygonalPoint).indexOf("null")&&(o=r.polygonalPoint),new st.PolygonHierarchy(o)}),!1),show:!0,fill:!0,material:e.fillMaterial})})},cartesianToLatlng:function(t){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(t),i=st.Math.toDegrees(e.latitude);return[st.Math.toDegrees(e.longitude),i]}},(lt.prototype=Object.create(Object.assign({},lt.prototype,ot.prototype))).constructor=lt;let ht=null;var xt=function(t,e){ot.call(this,t,e),ht=e,this.type="StraightArrow",this.fillMaterial=ht.Color.fromCssColorString("#0000FF").withAlpha(.8)};function dt(t,e){var i=e.camera.getPickRay(t);return i?e.scene.globe.pick(i,e.scene):null}xt.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 ht.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(t){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var e=this;this.state=1,this.handler.setInputAction((function(t){var i;(i=dt(t.position,e.viewer))&&(0==e.positions.length&&(e.firstPoint=e.creatPoint(i),e.firstPoint.type="firstPoint",e.floatPoint=e.creatPoint(i),e.floatPoint.type="floatPoint",e.positions.push(i)),e.firstPoint.position.setValue(i),e.firstPoint.show=!0,e.positions&&3==e.positions.length&&(e.firstPoint.show=!1,e.positions=[],e.pointArr=[],e.arrowEntity=null),e.positions.push(i.clone()))}),ht.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction((function(i){var n;e.positions.length<1||(n=dt(i.endPosition,e.viewer))&&(e.floatPoint.position.setValue(n),e.positions.length>=2&&(ht.defined(e.arrowEntity)?(e.positions.pop(),e.positions.push(n)):(e.positions.push(n),e.arrowEntity=e.showArrowOnMap(e.positions),t&&t(e.objId))))}),ht.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction((function(t){var i;(i=dt(t.position,e.viewer))&&(e.firstPoint.show=!1,e.positions=[],e.pointArr=[],e.arrowEntity=null,e.positions.push(i.clone()))}),ht.ScreenSpaceEventType.RIGHT_CLICK)},startModify:function(){this.state=2,this.firstPoint.show=!0,this.floatPoint.show=!0;var t=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new ht.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction((function(e){var i=t.viewer.scene.pick(e.position);if(ht.defined(i)&&i.id?(t.clickStep++,i.id.objId||(t.selectPoint=i.id)):(t.modifyHandler.destroy(),t.modifyHandler=null,t.firstPoint.show=!1,t.floatPoint.show=!1,t.state=-1),2==t.clickStep){var n;if(t.clickStep=0,!(n=dt(e.position,t.viewer)))return;t.selectPoint&&(t.selectPoint.position.setValue(n),t.selectPoint=null)}}),ht.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction((function(e){var i;t.selectPoint&&((i=dt(e.endPosition,t.viewer))&&(t.selectPoint.position.setValue(i),"firstPoint"==t.selectPoint.type&&(t.positions[1]=i),"floatPoint"==t.selectPoint.type&&(t.positions[2]=i)))}),ht.ScreenSpaceEventType.MOUSE_MOVE)},createByData:function(t){this.state=-1,this.positions=[];for(var e=[],i=0;i<t.length;i++){var n=ht.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){var e=this.viewer.entities.add({position:t,point:{pixelSize:10,color:ht.Color.YELLOW}});return e.attr="editPoint",e},showArrowOnMap:function(t){var e=this;return this.viewer.entities.add({id:e.objId,polygon:new ht.PolygonGraphics({hierarchy:new ht.CallbackProperty((function(){if(t.length<2)return null;var i=t[1],n=t[2],a=e.cartesianToLatlng(i),r=e.cartesianToLatlng(n),o=[],s=e.xp.algorithm.fineArrow([a[0],a[1]],[r[0],r[1]],ht);if(-1!=JSON.stringify(s).indexOf("null"))return[];for(var l=0;l<s.length;l++){var c=new ht.Cartesian3(s[l].x,s[l].y,s[l].z);o.push(c)}return new ht.PolygonHierarchy(o)}),!1),show:!0,fill:!0,material:e.fillMaterial})})},cartesianToLatlng:function(t){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(t),i=ht.Math.toDegrees(e.latitude);return[ht.Math.toDegrees(e.longitude),i]}},(xt.prototype=Object.create(Object.assign({},xt.prototype,ot.prototype))).constructor=xt;let ut=null;var pt=function(t,e){ot.call(this,t,e),ut=e,this.type="PincerArrow",this.fillMaterial=ut.Color.YELLOW.withAlpha(.8)};function gt(t,e){var i=e.camera.getPickRay(t);return i?e.scene.globe.pick(i,e.scene):null}pt.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 ut.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(t){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var e=this;this.state=1,this.handler.setInputAction((function(t){var i;if(i=gt(t.position,e.viewer))if(0==e.positions.length&&(e.floatPoint=e.creatPoint(i)),e.positions.length>4){(a=e.creatPoint(i)).wz=e.positions.length,e.pointArr.push(a);for(var n=0;n<e.pointArr.length;n++)e.pointArr[n].show=!1;e.floatPoint&&(e.floatPoint.show=!1,e.viewer.entities.remove(e.floatPoint),e.floatPoint=null),e.positions=[],e.pointArr=[],e.arrowEntity=null}else{e.positions.push(i);var a=e.creatPoint(i);e.positions.length>2?a.wz=e.positions.length-1:a.wz=e.positions.length,e.pointArr.push(a)}}),ut.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction((function(i){var n;!e.floatPoint||e.positions.length<2||(n=gt(i.endPosition,e.viewer))&&(e.floatPoint.position.setValue(n),e.positions.length>=2&&(ut.defined(e.arrowEntity)?(e.positions.pop(),e.positions.push(n)):(e.positions.push(n),e.arrowEntity=e.showArrowOnMap(e.positions),e.arrowEntity.objId=e.objId,t&&t(e.objId))))}),ut.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction((function(t){if(e.positions.length>=4){var i;if(!(i=gt(t.position,e.viewer)))return;for(var n=0;n<e.pointArr.length;n++)e.pointArr[n].show=!1;e.floatPoint.show=!1,e.viewer.entities.remove(e.floatPoint),e.floatPoint=null;var a=e.creatPoint(i);a.show=!1,a.wz=e.positions.length,e.pointArr.push(a),e.positions=[],e.pointArr=[],e.arrowEntity=null}}),ut.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=ut.Cartesian3.fromDegrees(t[i][0],t[i][1]);e.push(n)}this.positions=e;for(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 t=this,e=0;e<t.pointArr.length;e++)t.pointArr[e].show=!0;this.modifyHandler||(this.modifyHandler=new ut.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction((function(e){var i=t.viewer.scene.pick(e.position);if(ut.defined(i)&&i.id)t.clickStep++,i.id.objId||(t.selectPoint=i.id);else{for(var n=0;n<t.pointArr.length;n++)t.pointArr[n].show=!1;t.state=-1,t.modifyHandler.destroy(),t.modifyHandler=null}if(2==t.clickStep){var a;if(t.clickStep=0,!(a=gt(e.position,t.viewer)))return;t.selectPoint&&(t.selectPoint.position.setValue(a),t.selectPoint=null)}}),ut.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction((function(e){var i;(i=gt(e.endPosition,t.viewer))&&t.selectPoint&&(t.selectPoint.position.setValue(i),t.positions[t.selectPoint.wz-1]=i)}),ut.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:ut.Color.YELLOW}})},showArrowOnMap:function(t){var e=this;return this.viewer.entities.add({id:e.objId,polygon:new ut.PolygonGraphics({hierarchy:new ut.CallbackProperty((function(){if(t.length<3)return null;for(var i=[],n=0;n<t.length;n++){var a=e.cartesianToLatlng(t[n]);i.push(a)}var r=e.xp.algorithm.doubleArrow(i,ut),o=[];return-1==JSON.stringify(r.polygonalPoint).indexOf("null")&&(o=r.polygonalPoint),new ut.PolygonHierarchy(o)}),!1),show:!0,fill:!0,material:e.fillMaterial})})},cartesianToLatlng:function(t){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(t),i=ut.Math.toDegrees(e.latitude);return[ut.Math.toDegrees(e.longitude),i]}},(pt.prototype=Object.create(Object.assign({},pt.prototype,ot.prototype))).constructor=pt;function mt({cesiumGlobal:t,containerId:e,viewerConfig:i={},extreaConfig:n={},MapImageryList:a=[],defaultStatic:r}){const o=new s(t).init({containerId:e,viewerConfig:i,extreaConfig:n,MapImageryList:a}),l=function(t,e,i){return function(n,a){var r=null;function o(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(n)?(n.forEach(t=>{o(t)}),r=new a(t,e,i),n.forEach(n=>{n.call(r,t,e,i)})):(o(n),r=new a(t,e,i),n.call(r,t,e,i)),r}}(o,t,r);return{viewer:o,material:l([m,u],d),graphics:l(m,c),math3d:l(m,y),primitive:l(m,C),draw:l([m,y,_],I),passEffect:l([m,u],W),customCesiumPlugin:l(m,R),control:l(m,Y),plugin:l(m,E),base:new m(o,t),analysis:l([m,I,E],U),attackArrowObj:new lt(o,t),straightArrowObj:new xt(o,t),pincerArrowObj:new pt(o,t)}}export{mt as initCesium};
|