@stampgis/webrtc 1.0.0
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 +240 -0
- package/assets/config/stamp_core_config.js +39 -0
- package/assets/core/EmergencyPlotting.symlib +0 -0
- package/assets/core/default.symlib +0 -0
- package/assets/core/gbk.js +201 -0
- package/assets/core/pixelstreaming.js +18 -0
- package/assets/core/playerControl.js +561 -0
- package/assets/core/shapefile.js +509 -0
- package/assets/core/spark-md5.min.js +1 -0
- package/assets/core/widgetConfig.js +307 -0
- package/assets/core/worker.js +24 -0
- package/assets/core/workerEx.js +24 -0
- package/dist/index.cjs +17025 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +4839 -0
- package/dist/index.d.ts +4839 -0
- package/dist/index.js +16983 -0
- package/dist/index.js.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).StampPixelStreaming={})}(this,function(e){"use strict";function t(e){this.handlers=new Map,this.g_data=[],this.g_data_length=0,this.LibAx=e,this.init_handlers(),e.earth=e.earth||[],e.earth.push(this)}function a(){this.is_double=!0,this.is_int=!0,this.is_wide=!0}function Q(e,t,n){null!=e?(n=new ArrayBuffer(2048),this._buf=new Uint8Array(n),this._dv=new DataView(n),this.size=this._buf.length,this._cursor=0,this.isBigEndian=!1,this.PackDataAssist=new a,Q.get_base_size(),this._cursor=Q.pack_base(this._dv,e,t,this._cursor)):null!=n&&(this._buf=new Uint8Array(n),this._dv=new DataView(n),this._cursor=0,this.size=this._buf.length,this.isBigEndian=!1)}function O(){}function x(){}function U(){}function G(){}function A(){}function W(){}function V(){}function H(){}function z(){}function N(){}function j(){}function K(){}function Y(){}function q(){}function X(){}function J(){}function $(){}function Z(){}function ee(){}function te(){}function ne(){}function ae(){}function ie(){}function re(){}function oe(){}function se(){}function ce(){}function le(){}function me(){}function de(){}function ue(){}function ge(){}function he(){}function _e(){}function pe(){}function fe(){}function Se(){}function Ce(){}function ye(){}function we(){}function Te(){}function n(){this.focus={focus_none:0,focus_left:1,focus_right:2,focus_left_finished:3,focus_right_finished:4},this.double_screen=!1,this.StampPixelStreamingHandleType={StampType_GlobalControlInterface:0,StampType_Frame:1,StampType_ShapeCreatorInterface:2,StampType_GeometryAlgorithmInterface:3,StampType_PolygonAlgorithmInterface:4,StampType_ParticleSystem:5,StampType_GlobeObserverInterface:6,StampType_QueryInterface:7,StampType_Element:8,StampType_Environment:9,StampType_Light:10,StampType_ExponentialHeightFog:11,StampType_SkyLight:12,StampType_VolumetricCloud:13,StampType_DynamicSystemInterface:14,StampType_TrackInterface:15,StampType_RoamInterface:16,StampType_GPSInterface:17,StampType_TerrainManager:18,StampType_LayerManager:19,StampType_Analysis:20,StampType_Measure:21,StampType_GeologyInterface:22,StampType_Gb28181CameraManager:23,StampType_Camera:24,StampType_VectorTileLayer:25,StampType_MsSymbolLibrary:26,StampType_MsClassObj:27,StampType_TileBlockStyle:28,StampType_PowerLineControl:29,StampType_Weather:30,StampType_VideoRecorderInterface:31,StampType_MassControl:32,StampType_PostProcessing:33,StampType_UeGlobalParams:34,StampType_WebUI:35,StampType_Oceanology:36,StampType_Beidou:37,StampType_ImageGeneratorInterface:38,StampType_Panorama720ShotInterface:39,StampType_EditDataInterface:1e4},this.StampPixelStreamingRespondDataType={RespondType_String:0,RespondType_Byte:1,RespondType_Json:2,RespondType_Xml:3};this.Cursor={enable_globe_cursor:!0,normal:"default",edit:"crosshair",select:"default",none:"none",parent:this,update:function(){if(this.enable_globe_cursor&&this.parent.earth)for(var e=0,t=this.parent.earth.length;e<t;++e)this.parent.earth[e].player&&(this.parent.earth[e].player.webRtcController.videoPlayer.videoElement.style.cursor=this.normal)},reset:function(){if(this.parent.earth)for(var e=0,t=this.parent.earth.length;e<t;++e)this.parent.earth[e].player&&(this.parent.earth[e].player.webRtcController.videoPlayer.videoElement.style.cursor=this.normal);this.enable_globe_cursor=!0},set_edit:function(){if(this.parent.earth)for(var e=0,t=this.parent.earth.length;e<t;++e)this.parent.earth[e].player&&(this.parent.earth[e].player.webRtcController.videoPlayer.videoElement.style.cursor=this.edit);this.enable_globe_cursor=!1},set_select:function(){if(this.parent.earth)for(var e=0,t=this.parent.earth.length;e<t;++e)this.parent.earth[e].player&&(this.parent.earth[e].player.webRtcController.videoPlayer.videoElement.style.cursor=this.select);this.enable_globe_cursor=!1},set_none:function(){if(this.parent.earth)for(var e=0,t=this.parent.earth.length;e<t;++e)this.parent.earth[e].player&&(this.parent.earth[e].player.webRtcController.videoPlayer.videoElement.style.cursor=this.none);this.enable_globe_cursor=!1}}}t.prototype.init_handlers=function(){for(var e in this.LibAx.StampPixelStreamingHandleType)this.create_handler(this.LibAx.StampPixelStreamingHandleType[e]).register();this.LibAx.analysis_interface(this),this.LibAx.camera_interface(this),this.LibAx.directional_light_interface(this),this.LibAx.dynamic_system_interface(this),this.LibAx.element_interface(this),this.LibAx.environment_interface(this),this.LibAx.gb28181_camera_manager_interface(this),this.LibAx.geology_interface(this),this.LibAx.geometry_algorithm_interface(this),this.LibAx.global_control_interface(this),this.LibAx.globe_observer_interface(this),this.LibAx.gps_interface(this),this.LibAx.exponential_height_fog_interface(this),this.LibAx.layer_manager_interface(this),this.LibAx.measure_interface(this),this.LibAx.ms_class_obj_interface(this),this.LibAx.ms_symbol_library_interface(this),this.LibAx.particle_system_interface(this),this.LibAx.polygon_algorithm_interface(this),this.LibAx.query_interface(this),this.LibAx.roam_interface(this),this.LibAx.shape_creator_interface(this),this.LibAx.sky_light_interface(this),this.LibAx.stamp_frame(this),this.LibAx.terrain_manager_interface(this),this.LibAx.tile_block_style_interface(this),this.LibAx.track_interface(this),this.LibAx.vector_tile_layer_interface(this),this.LibAx.volumetric_cloud_interface(this),this.LibAx.powerline_interface(this),this.LibAx.weather_interface(this),this.LibAx.webui_interface(this),this.LibAx.oceanology_interface(this),this.LibAx.beidou_grid_interface(this),this.LibAx.image_generator_control(this),this.LibAx.panorama_720_shot_interface(this),this.LibAx.edit_data_interface(this)},t.prototype.create_handler=function(i){var r=this;return{handler:function(e,t,n){this.sub_handlers.get(e)(t,n)},sub_handlers:new Map,create_custom_command:function(e,t,n){var a=r.player,t=(a.webRtcController.sendMessageController.PackData=t,[i,e]);void 0!==n&&(n instanceof Array?t.push.apply(t,n):t.push(n)),a.webRtcController.streamMessageController.toStreamerHandlers.get("LibAx")(t)},create_sub_handler:function(e,t){this.sub_handlers.set(e,t)},register:function(){r.handlers.set(i,this)},interface:{},CommandType:{},RespondType:{},handler_type:i}},t.prototype.response=function(e){var t=new Uint8Array(e),n=(t[0],t[1]),t=t[6],a=new Uint32Array(e.slice(2,6))[0],i=void 0;switch(t){case this.LibAx.StampPixelStreamingRespondDataType.RespondType_String:i=new TextDecoder("utf-16").decode(e.slice(7));break;case this.LibAx.StampPixelStreamingRespondDataType.RespondType_Json:var r=new TextDecoder("utf-16").decode(e.slice(7)),i=JSON.parse(r);break;case this.LibAx.StampPixelStreamingRespondDataType.RespondType_Xml:i=new TextDecoder("utf-16").decode(e.slice(7))}this.handlers.get(n).handler(a,i)},t.prototype.receive_all_data=function(e,t){var n=this.g_data.length,e=(this.g_data.length=n+1,this.g_data[n]=new Uint8Array(e.slice(5)),new Int32Array(e.slice(1,5))),e=e[0];if(this.g_data_length+=this.g_data[n].length,this.g_data_length>=e){var a=0;t.result=new Uint8Array(this.g_data_length);for(var i=0;i<=n;++i)t.result.set(this.g_data[i],a),a+=this.g_data[i].length;return!0}return!1},t.prototype.response_byte=function(e){var t,n={};this.receive_all_data(e,n)&&(e=n.result[0],t=new Uint32Array(n.result.slice(1,5))[0],n=n.result.slice(5),this.handlers.get(e).handler(t,n),this.g_data.length=0,this.g_data_length=0)},a.prototype.calc_float_length=function(){return this.is_double?8:4},a.prototype.write_float_memory=function(e,t,n,a){return null==a&&(a=!0),this.is_double?(e.setFloat64(t,n,a),t+=8):(e.setFloat32(t,n,a),t+=4),t},a.prototype.calc_integer_length=function(){return this.is_int?4:2},a.prototype.write_integer_memory=function(e,t,n,a){return null==a&&(a=!0),this.is_int?(e.setUint32(t,n,a),t+=4):(e.setUint16(t,n,a),t+=2),t},a.prototype.calc_point_length=function(e){return 3*this.calc_float_length()},a.prototype.write_point_memory=function(e,t,n,a){return t=this.write_float_memory(e,t,n.x,a),t=this.write_float_memory(e,t,n.y,a),t=this.write_float_memory(e,t,n.z,a)},a.prototype.calc_line_length=function(e){e=e.length;return this.calc_integer_length()+this.calc_point_length()*e},a.prototype.write_line_memory=function(e,t,n,a){var i=n.length;t=this.write_integer_memory(e,t,i,a);for(var r=0;r<i;++r)t=this.write_point_memory(e,t,n[r],a);return t},a.prototype.calc_poly_length=function(e){for(var t=0,n=e.length,a=0;a<n;++a)t+=this.calc_line_length(e[a]);return t+=this.calc_integer_length()},a.prototype.write_poly_memory=function(e,t,n,a){var i=n.length;t=this.write_integer_memory(e,t,i,a);for(var r=0;r<i;++r)t=this.write_line_memory(e,t,n[r],a);return t},a.prototype.calc_string_length=function(e){e=e.length+1;return 2+(this.is_wide?2*e:e)},a.prototype.write_string_memory=function(t,n,a,i){var r=a.length;if(t.setUint16(n,r+1,i),n+=2,this.is_wide){for(let e=0;e<r;e++)t.setUint16(n,a.charCodeAt(e),i),n+=2;t.setUint16(n,"\0",i),n+=2}else{for(let e=0;e<r;e++)t.setUint8(n,a.charCodeAt(e),i),n+=1;t.setUint8(n,"\0",i),n+=1}return n},Q.pack_base=function(e,t,n,a){return e.setUint8(a,n),e.setUint32(++a,0,!0),e.setUint32(a+=4,t[0],!0),e.setUint32(a+=4,t[1],!0),a+=4},Q.get_base_size=function(){return 9},Q.prototype.writeInt8=function(e){this.checkCapacity(1),this._dv.setInt8(this._cursor,e,!this.isBigEndian),this._cursor+=1},Q.prototype.writeUint8=function(e){this.checkCapacity(1),this._dv.setUint8(this._cursor,e,!this.isBigEndian),this._cursor+=1},Q.prototype.writeInt16=function(e){this.checkCapacity(2),this._dv.setInt16(this._cursor,e,!this.isBigEndian),this._cursor+=2},Q.prototype.writeUint16=function(e){this.checkCapacity(2),this._dv.setUint16(this._cursor,e,!this.isBigEndian),this._cursor+=2},Q.prototype.writeInt32=function(e){this.checkCapacity(4),this._dv.setInt32(this._cursor,e,!this.isBigEndian),this._cursor+=4},Q.prototype.writeUint32=function(e){this.checkCapacity(4),this._dv.setUint32(this._cursor,e,!this.isBigEndian),this._cursor+=4},Q.prototype.writeInt64=function(e){this.checkCapacity(8),this._dv.setBigInt64(this._cursor,e,!this.isBigEndian),this._cursor+=8},Q.prototype.writeUint64=function(e){this.checkCapacity(8),this._dv.setBigUint64(this._cursor,e,!this.isBigEndian),this._cursor+=8},Q.prototype.writeFloat32=function(e){this.checkCapacity(4),this._dv.setFloat32(this._cursor,e,!this.isBigEndian),this._cursor+=4},Q.prototype.writeFloat64=function(e){this.checkCapacity(8),this._dv.setFloat64(this._cursor,e,!this.isBigEndian),this._cursor+=8},Q.prototype.writeString=function(e){var t=this.PackDataAssist.is_wide,n=(this.PackDataAssist.is_wide=!1,this.PackDataAssist.calc_string_length(e));this.checkCapacity(n),this._cursor=this.PackDataAssist.write_string_memory(this._dv,this._cursor,e,!this.isBigEndian),this.PackDataAssist.is_wide=t},Q.prototype.writeWString=function(e){var t=this.PackDataAssist.is_wide,n=(this.PackDataAssist.is_wide=!0,this.PackDataAssist.calc_string_length(e));this.checkCapacity(n),this._cursor=this.PackDataAssist.write_string_memory(this._dv,this._cursor,e,!this.isBigEndian),this.PackDataAssist.is_wide=t},Q.prototype.writePoint=function(e){var t=this.PackDataAssist.calc_point_length(e);this.checkCapacity(t),this._cursor=this.PackDataAssist.write_point_memory(this._dv,this._cursor,e,!this.isBigEndian)},Q.prototype.writeLine=function(e){var t=this.PackDataAssist.calc_line_length(e);this.checkCapacity(t),this._cursor=this.PackDataAssist.write_line_memory(this._dv,this._cursor,e,!this.isBigEndian)},Q.prototype.writePoly=function(e){var t=this.PackDataAssist.calc_poly_length(e);this.checkCapacity(t),this._cursor=this.PackDataAssist.write_poly_memory(this._dv,this._cursor,e,!this.isBigEndian)},Q.prototype.writeBuf=function(e){this.checkCapacity(e.length);for(var t=0;t<e.length;++t)this._dv.setUint8(this._cursor,e[t],!this.isBigEndian),this._cursor+=1},Q.prototype.checkCapacity=function(e){this._cursor+e>this.size&&this.Resize(this._cursor+e)},Q.prototype.Resize=function(e){var e=Math.ceil(e/this.size),e=new ArrayBuffer(this.size*e),t=new Uint8Array(e);t.set(this._buf),this._buf=t,this._dv=new DataView(e),this.size=this._buf.length},Q.prototype.ValidData=function(){var e=this._buf.buffer.slice(0,this._cursor);return new DataView(e)},Q.prototype.seek_to=function(e){this._cursor=e},Q.prototype.get_cursor=function(){return this._cursor},Q.prototype.is_end=function(){return this._cursor>=this._buf.length},Q.prototype.readInt8=function(){var e=this._dv.getInt8(this._cursor,!this.isBigEndian);return this._cursor+=1,e},Q.prototype.readUint8=function(){var e=this._dv.getUint8(this._cursor,!this.isBigEndian);return this._cursor+=1,e},Q.prototype.readInt16=function(){var e=this._dv.getInt16(this._cursor,!this.isBigEndian);return this._cursor+=2,e},Q.prototype.readUint16=function(){var e=this._dv.getUint16(this._cursor,!this.isBigEndian);return this._cursor+=2,e},Q.prototype.readInt32=function(){var e=this._dv.getInt32(this._cursor,!this.isBigEndian);return this._cursor+=4,e},Q.prototype.readUint32=function(){var e=this._dv.getUint32(this._cursor,!this.isBigEndian);return this._cursor+=4,e},Q.prototype.readFloat32=function(){var e=this._dv.getFloat32(this._cursor,!this.isBigEndian);return this._cursor+=4,e},Q.prototype.readFloat64=function(){var e=this._dv.getFloat64(this._cursor,!this.isBigEndian);return this._cursor+=8,e},Q.prototype.readUint64=function(){var e=this._dv.getUint32(this._cursor,!this.isBigEndian),t=(this._cursor+=4,e<<8>>>8),n=this._dv.getUint32(this._cursor,!this.isBigEndian),a=(this._cursor+=4,n>>>16),n=n<<16>>>8|e>>>24,e=a.toString(16),i=n.toString(16),r=t.toString(16),e=0===a?0===n?r:i+"000000".substring(0,6-r.length)+r:e+"000000".substring(0,6-i.length)+i+"000000".substring(0,6-r.length)+r;return{level:a,lonIndex:n,latIndex:t,indexStr:e}},Q.prototype.readWString=function(){for(var e,t="";!this.is_end()&&(e=this._dv.getUint16(this._cursor,!this.isBigEndian),this._cursor+=2,0!=e);)t+=String.fromCharCode(e);return t},Q.prototype.readString=function(){for(var e,t="";!this.is_end()&&(e=this._dv.getUint8(this._cursor,!this.isBigEndian),this._cursor+=1,0!=e);)t+=String.fromCharCode(e);return t},Q.prototype.readStringGbk=function(){for(var e,t=0,n="";!this.is_end()&&(t=this._dv.getUint8(this._cursor,!this.isBigEndian),this._cursor+=1,t<=128||(e=t,t=this._dv.getUint8(this._cursor,!this.isBigEndian),this._cursor+=1,t|=e<<8,t=Gbk2UniArray.get_array()[t]),0!=t);)n+=String.fromCharCode(t);return n},Q.prototype.readBuf=function(e){var t=new Uint8Array(this._buf.subarray(this.get_cursor(),e+this.get_cursor()));return this._cursor+=e,t},Q.prototype.readChars=function(e){for(var t,n=!1,a=[],i=0;i<e;++i)t=this._dv.getUint8(this._cursor,!this.isBigEndian),this._cursor+=1,n||0==t?n=!0:a.push(t);var r=new Uint8Array(a);return new TextDecoder("utf-8").decode(r)},O.analysis_interface=function(e,t){if(null!=e.analysis_interface)return e.analysis_interface;var o=e.handlers.get(t.StampPixelStreamingHandleType.StampType_Analysis);function n(e,t){var n=new Q(e,t);if(n.writeFloat32(e[2]),n.writeFloat32(e[3]),n.writeUint8(e[4]),n.writeString(e[5]),null!=e[6]&&e[6]instanceof Array){var a=e[6].length;n.writeUint16(a);for(var i=0;i<a;++i)n.writeFloat64(e[6][i])}else n.writeUint16(0);return n.ValidData()}function a(e,t){t=new Q(e,t);return t.writeFloat32(e[2]),t.writeFloat32(e[3]),t.writeUint32(e[4]),t.writeUint32(e[5]),t.writeUint8(e[6]?1:0),t.writeFloat64(e[7]),t.writeFloat64(e[8]),t.writeFloat64(e[9]),t.writeFloat64(e[10]),t.writeFloat64(e[11]),t.writeFloat64(e[12]),t.writeFloat64(e[13]),t.ValidData()}function i(e,t){var n=new Q(e,t);n.writeUint8(e[2]),n.writeString(e[3]),n.writeUint16(e[4]);for(var a=5;a<e.length;++a)n.writeUint8(e[a]);return n.ValidData()}function r(e,t){for(var n=new Q(e,t),a=2,i=a+3;a<i;++a)n.writeFloat32(e[a]);n.writeUint8(e[a]);var r=void 0,t=void 0,o=0;0<e.length-(a+=1)&&null!=e[a]&&(null!=e[a].coordinates&&(o=(r=e[a].coordinates).length),t=e[a].color),n.writeUint32(o);for(var s=0;s<o;++s)n.writeFloat64(r[s]);return n.writeUint8(null==t?0:1),null!=t&&(n.writeUint8(t.r),n.writeUint8(t.g),n.writeUint8(t.b)),n.ValidData()}function s(e,t){t=new Q(e,t);return t.writeWString(e[2]),t.ValidData()}function c(e,t){t=new Q(e,t);return t.writeUint32(e[2]),t.writeFloat32(e[3]),t.ValidData()}function l(e,t){var n=new Q(e,t);n.writeString(e[2]);for(var a=3;a<11;++a)6==a||7==a?n.writeUint32(e[a]):n.writeFloat32(e[a]);return n.writeUint8(e[11]?1:0),n.writeUint8(e[12]?1:0),n.writeUint8(e[13]?1:0),n.ValidData()}function m(e,t){var n=new Q(e,t),a=(n.writeFloat32(e[2]),n.writeUint32(e[3]),n.writeUint8(e[4]),n.writeUint8(e[5]),void 0),i=0;6<e.length&&null!=e[6]&&(i=(a=e[6]).length),n.writeUint32(i);for(var r=0;r<i;++r)n.writeFloat64(a[r]);return n.ValidData()}function d(e,t){var n=new Q(e,t),a=(n.writeFloat32(e[2]),n.writeFloat32(e[3]),n.writeUint32(e[4]),n.writeUint32(e[5]),void 0),i=0;6<e.length&&null!=e[6]&&(i=(a=e[6]).length),n.writeUint32(i);for(var r=0;r<i;++r)n.writeFloat64(a[r]);return n.ValidData()}function u(e,t){var n=new Q(e,t),a=(n.writeWString(e[2]),n.writeWString(e[3]),n.writeFloat32(e[4]),n.writeFloat32(e[5]),n.writeUint32(e[6]),n.writeUint32(e[7]),void 0),i=0;8<e.length&&null!=e[8]&&(i=(a=e[8]).length),n.writeUint32(i);for(var r=0;r<i;++r)n.writeFloat64(a[r]);return n.ValidData()}function g(e,t){t=new Q(e,t);return t.writeUint8(e[2]),t.writeUint8(e[3]),t.ValidData()}function h(e,t){var n=new Q(e,t),a=(n.writeUint8(e[2]?1:0),n.writeFloat64(e[3]),n.writeFloat64(e[4]),n.writeUint8(e[5]?1:0),n.writeWString(e[6]),e[7].length);n.writeUint32(a);for(var i=0;i<a;++i)n.writeFloat64(e[7][i]);return n.ValidData()}function _(e,t){t=new Q(e,t);return t.writeWString(e[2]),t.ValidData()}function p(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=e[6],s=e[7],e=new Q(e,t);return e.writeFloat64(n),e.writeFloat64(a),e.writeFloat64(i),e.writeFloat64(r),e.writeLine(o),e.writeWString(s),e.ValidData()}o.CommandType={AnalysisCommand_LineSight:0,AnalysisCommand_ViewShed:1,AnalysisCommand_Shinning:2,AnalysisCommand_VerticalFace:3,AnalysisCommand_VerticalFaceExportImage:4,AnalysisCommand_Skyline:5,AnalysisCommand_DynamicViewShed:6,AnalysisCommand_DynamicViewShedPlay:7,AnalysisCommand_DynamicViewShedPause:8,AnalysisCommand_DynamicViewShedResume:9,AnalysisCommand_DynamicViewShedStop:10,AnalysisCommand_RedLine:11,AnalysisCommand_HeightLimit:12,AnalysisCommand_SurfaceArea:13,AnalysisCommand_LineSightHeightLimit:14,AnalysisCommand_SubMerging:15,AnalysisCommand_DynamicSubMerging:16,AnalysisCommand_HeatMapPolygon:17,AnalysisCommand_BestPath:18,AnalysisCommand_ViewDome:19,AnalysisCommand_ContourPolygon:20,AnalysisCommand_SlopePolygon:21,AnalysisCommand_SlopeDirectionPolygon:22,AnalysisCommand_FixedPointObserve:23,AnalysisCommand_HeightLimitByModel:24,AnalysisCommand_NextGridWall:25,AnalysisCommand_Clear:26,AnalysisCommand_Invalid:27},o.interface.analysisLineSight=function(e){o.create_custom_command(o.CommandType.AnalysisCommand_LineSight,n,e),t.Cursor.set_edit()},o.interface.analysisViewShed=function(e){o.create_custom_command(o.CommandType.AnalysisCommand_ViewShed,a,e),t.Cursor.set_edit()},o.interface.analysisShinning=function(e){o.create_custom_command(o.CommandType.AnalysisCommand_Shinning,i,e),t.Cursor.set_edit()},o.interface.analysisVerticalFace=function(e){o.create_custom_command(o.CommandType.AnalysisCommand_VerticalFace,r,e),t.Cursor.set_edit()},o.interface.analysisVerticalFaceExportImage=function(e){o.create_custom_command(o.CommandType.AnalysisCommand_VerticalFaceExportImage,s,e)},o.interface.analysisSkyline=function(e){o.create_custom_command(o.CommandType.AnalysisCommand_Skyline,c,e)},o.interface.analysisDynamicViewShed=function(e){o.create_custom_command(o.CommandType.AnalysisCommand_DynamicViewShed,l,e),t.Cursor.set_edit()},o.interface.analysisDynamicViewShedPlay=function(){o.create_custom_command(o.CommandType.AnalysisCommand_DynamicViewShedPlay,t.GetNoParamCommandPackData)},o.interface.analysisDynamicViewShedPause=function(){o.create_custom_command(o.CommandType.AnalysisCommand_DynamicViewShedPause,t.GetNoParamCommandPackData)},o.interface.analysisDynamicViewShedResume=function(){o.create_custom_command(o.CommandType.AnalysisCommand_DynamicViewShedResume,t.GetNoParamCommandPackData)},o.interface.analysisDynamicViewShedStop=function(){o.create_custom_command(o.CommandType.AnalysisCommand_DynamicViewShedStop,t.GetNoParamCommandPackData)},o.interface.analysisRedLine=function(e){o.create_custom_command(o.CommandType.AnalysisCommand_RedLine,m,e),t.Cursor.set_edit()},o.interface.analysisHeightLimit=function(e){o.create_custom_command(o.CommandType.AnalysisCommand_HeightLimit,d,e),t.Cursor.set_edit()},o.interface.analysisHeightLimitByModel=function(e){o.create_custom_command(o.CommandType.AnalysisCommand_HeightLimitByModel,u,e),t.Cursor.set_edit()},o.interface.analysisSurfaceArea=function(e){o.create_custom_command(o.CommandType.AnalysisCommand_SurfaceArea,g,e),t.Cursor.set_edit()},o.interface.analysisSubmerging=function(e){o.create_custom_command(o.CommandType.AnalysisCommand_SubMerging,h,e)},o.interface.analysisDynamicSubmerging=function(e){o.create_custom_command(o.CommandType.AnalysisCommand_DynamicSubMerging,_,e)},o.interface.createLineSightHeightLimit=function(){o.create_custom_command(o.CommandType.AnalysisCommand_LineSightHeightLimit,t.GetNoParamCommandPackData),t.Cursor.set_edit()};function f(e,t){return(t=new Q(e,t)).writeUint8(e[2]?1:0),t.ValidData()}function S(e,t){var t=new Q(e,t),n=2;return t.writeInt8(e[n++]),t.writeFloat64(e[n++]),t.writeFloat64(e[n++]),t.writeFloat64(e[n++]),t.writeFloat32(e[n++]),t.writeFloat32(e[n++]),t.writeUint32(e[n++]),t.writeUint32(e[n++]),t.writeUint8(e[n++]),t.writeUint8(e[+n]),t.writeUint8(e[12]),t.ValidData()}function C(e,t){var n=e[2],e=new Q(e,t);return e.writeLine(n),e.ValidData()}function y(e,t){for(var n=new Q(e,t),a=2;a<e.length;++a)n.writeFloat64(e[a]);return n.ValidData()}o.interface.createHeatMapPolygon=function(e){o.create_custom_command(o.CommandType.AnalysisCommand_HeatMapPolygon,f,[null!=e&&e])},o.interface.best_path=function(e,t,n,a,i,r){o.create_custom_command(o.CommandType.AnalysisCommand_BestPath,p,[e,t,n,a,i,r])},o.interface.analysisViewDome=function(e){o.create_custom_command(o.CommandType.AnalysisCommand_ViewDome,S,e),e[0]&&t.Cursor.set_edit()},o.interface.createContourPolygon=function(e){o.create_custom_command(o.CommandType.AnalysisCommand_ContourPolygon,C,[e]),0==e.length&&t.Cursor.set_edit()},o.interface.createSlopePolygon=function(e){o.create_custom_command(o.CommandType.AnalysisCommand_SlopePolygon,C,[e]),0==e.length&&t.Cursor.set_edit()},o.interface.createSlopeDirectionPolygon=function(e){o.create_custom_command(o.CommandType.AnalysisCommand_SlopeDirectionPolygon,C,[e]),0==e.length&&t.Cursor.set_edit()},o.interface.analysisFixedPointObserve=function(e){o.create_custom_command(o.CommandType.AnalysisCommand_FixedPointObserve,y,e),t.Cursor.set_none()};function w(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.writeInt32(e[3]),t.ValidData()}o.interface.next_grid_wall=function(e,t){o.create_custom_command(o.CommandType.AnalysisCommand_NextGridWall,w,[e,t])},o.interface.clear=function(){o.create_custom_command(o.CommandType.AnalysisCommand_Clear,t.GetNoParamCommandPackData)};return o.RespondType={AnalysisRespond_AnalysisFinished:0,AnalysisRespond_VerticalFaceImageSuccess:1,AnalysisRespond_SurfaceAreaResult:2,AnalysisRespond_LineSightResult:3,AnalysisRespond_SubMergingResult:4,AnalysisRespond_DynamicSubMergingResult:5,AnalysisRespond_HeatMapPolygon:6,AnalysisRespond_BestPath:7,AnalysisRespond_ContourPolygon:8,AnalysisRespond_SlopePolygon:9,AnalysisRespond_SlopeDirectionPolygon:10,AnalysisRespond_OnContourProcessFinish:11,AnalysisRespond_CreateViewShedFinish:12,AnalysisRespond_NextGridWall:13,AnalysisRespond_Fail:14},o.create_sub_handler(o.RespondType.AnalysisRespond_AnalysisFinished,function(e){t.Cursor.reset(),null!=o.interface.OnAnalysisFinished&&o.interface.OnAnalysisFinished(e)}),o.create_sub_handler(o.RespondType.AnalysisRespond_VerticalFaceImageSuccess,function(e){null!=o.interface.OnVerticalFaceImageSuccess&&o.interface.OnVerticalFaceImageSuccess(e)}),o.create_sub_handler(o.RespondType.AnalysisRespond_SurfaceAreaResult,function(e){null!=o.interface.OnPixelStreamingSurfaceArea&&o.interface.OnPixelStreamingSurfaceArea(e)}),o.create_sub_handler(o.RespondType.AnalysisRespond_LineSightResult,function(e){null!=o.interface.OnPixelStreamingLineSight&&o.interface.OnPixelStreamingLineSight(e)}),o.create_sub_handler(o.RespondType.AnalysisRespond_Fail,function(e){t.Cursor.reset(),null!=o.interface.OnFaild&&o.interface.OnFaild(e)}),o.create_sub_handler(o.RespondType.AnalysisRespond_SubMergingResult,function(e){null!=o.interface.OnSubMergingResult&&o.interface.OnSubMergingResult(e)}),o.create_sub_handler(o.RespondType.AnalysisRespond_DynamicSubMergingResult,function(e){null!=o.interface.OnDynamicSubMergingResult&&o.interface.OnDynamicSubMergingResult(e)}),o.create_sub_handler(o.RespondType.AnalysisRespond_HeatMapPolygon,function(e){null!=o.interface.OnCreateHeatMapPolygon&&o.interface.OnCreateHeatMapPolygon(e)}),o.create_sub_handler(o.RespondType.AnalysisRespond_BestPath,function(e){null!=o.interface.OnBestPath&&o.interface.OnBestPath(e)}),o.create_sub_handler(o.RespondType.AnalysisRespond_ContourPolygon,function(e){null!=o.interface.OnCreateContourPolygon&&o.interface.OnCreateContourPolygon(e)}),o.create_sub_handler(o.RespondType.AnalysisRespond_SlopePolygon,function(e){null!=o.interface.OnCreateSlopePolygon&&o.interface.OnCreateSlopePolygon(e)}),o.create_sub_handler(o.RespondType.AnalysisRespond_SlopeDirectionPolygon,function(e){null!=o.interface.OnCreateSlopeDirectionPolygon&&o.interface.OnCreateSlopeDirectionPolygon(e)}),o.create_sub_handler(o.RespondType.AnalysisRespond_OnContourProcessFinish,function(e){null!=o.interface.OnContourProcessFinish&&o.interface.OnContourProcessFinish(e)}),o.create_sub_handler(o.RespondType.AnalysisRespond_CreateViewShedFinish,function(e){null!=o.interface.OnCreateViewShedFinish&&o.interface.OnCreateViewShedFinish(e)}),o.create_sub_handler(o.RespondType.AnalysisRespond_NextGridWall,function(e){null!=o.interface.OnNextGridWall&&o.interface.OnNextGridWall(e)}),o.interface.AnalysisRespond_LineSightResult=void 0,o.interface.OnPixelStreamingSurfaceArea=void 0,o.interface.OnVerticalFaceImageSuccess=void 0,o.interface.OnFaild=void 0,o.interface.OnAnalysisFinished=void 0,o.interface.OnSubMergingResult=void 0,o.interface.OnDynamicSubMergingResult=void 0,o.interface.OnCreateHeatMapPolygon=void 0,o.interface.OnBestPath=void 0,o.interface.OnCreateContourPolygon=void 0,o.interface.OnCreateSlopePolygon=void 0,o.interface.OnCreateSlopeDirectionPolygon=void 0,o.interface.OnContourProcessFinish=void 0,o.interface.OnCreateViewShedFinish=void 0,o.interface.OnNextGridWall=void 0,e.analysis_interface=o.interface,o.interface},x.camera_interface=function(e,t){var n,a,i,r,o,s,c;return null!=e.camera_interface?e.camera_interface:((n=e.handlers.get(t.StampPixelStreamingHandleType.StampType_Camera)).CommandType={CameraCommand_Create:0,CameraCommand_Update:1,CameraCommand_RTSPConnectOrStop:2,CameraCommand_SetPlayBackFlag:3,CameraCommand_SetPlayBackTime:4,CameraCommand_SendSessionPause:5,CameraCommand_SendSessionResume:6,CameraCommand_SendSessionRange:7,CameraCommand_GB28181CameraPtzControl:8,CameraCommand_GB28181CameraPtzControlEx:9,CameraCommand_EnableFrustumVisible:10,CameraCommand_GetCamera:11,CameraCommand_DestroyCamera:12,CameraCommand_DestroyAll:13,CameraCommand_UpdateWindowPos:14,CameraCommand_WindowScreenShot:15,CameraCommand_EnableSceneMediaStream:16,CameraCommand_WindowVisible:17},a=function(e,t){for(var n=new Q(e,t),a=10,i=2;i<a;++i)n.writeWString(e[i]);return n.writeUint8(e[a]),n.writeUint32(e[++a]),n.writeUint8(e[++a]),n.writeUint8(e[++a]),n.writeUint8(e[++a]),n.writeUint8(e[++a]),n.writePoint(e[++a]),n.writeFloat64(e[++a]),n.writeFloat64(e[++a]),n.writeFloat64(e[++a]),n.writePoint(e[++a]),n.writePoint(e[++a]),n.writePoint(e[++a]),n.writeUint8(e[++a]),n.writeUint8(e[++a]),n.writeUint32(e[++a]),n.writeUint32(e[++a]),n.writeUint32(e[++a]),n.writeUint32(e[++a]),n.writeUint32(e[++a]?e[a]:1442840320),n.writeUint32(e[++a]?e[a]:1442775040),n.writeUint32(e[++a]?e[a]:419495680),n.writeUint32(e[++a]?e[a]:808648498),n.ValidData()},i=function(e,t){for(var n=new Q(e,t),a=2;a<7;++a)n.writeWString(e[a]);return n.writePoint(e[7]),n.ValidData()},r=function(e,t){var n=new Q(e,t);n.writeWString(e[2]);for(var a=3;a<e.length;++a)n.writeUint8(e[a]);return n.ValidData()},o=function(e,t){var n=new Q(e,t);n.writeWString(e[2]);for(var a=3;a<e.length;++a)n.writeFloat64(e[a]);return n.ValidData()},s=function(e,t){var n=new Q(e,t);n.writeWString(e[2]);for(var a=3;a<e.length;++a)n.writeInt32(e[a]);return n.ValidData()},c=function(e,t){for(var n=new Q(e,t),a=2;a<e.length;++a)n.writeWString(e[a]);return n.ValidData()},n.interface.create=function(e){n.create_custom_command(n.CommandType.CameraCommand_Create,a,e)},n.interface.update=function(e){n.create_custom_command(n.CommandType.CameraCommand_Update,i,e)},n.interface.rtsp_connect_or_stop=function(e){n.create_custom_command(n.CommandType.CameraCommand_RTSPConnectOrStop,r,e)},n.interface.set_use_tcp=function(e){n.create_custom_command(n.CommandType.CameraCommand_SetUseTcp,r,e)},n.interface.set_fov=function(e){n.create_custom_command(n.CommandType.CameraCommand_SetFov,o,e)},n.interface.set_aspect=function(e){n.create_custom_command(n.CommandType.CameraCommand_SetAspect,o,e)},n.interface.set_range=function(e){n.create_custom_command(n.CommandType.CameraCommand_SetRange,o,e)},n.interface.set_play_back_flag=function(e){n.create_custom_command(n.CommandType.CameraCommand_SetPlayBackFlag,r,e)},n.interface.set_play_back_time=function(e){n.create_custom_command(n.CommandType.CameraCommand_SetPlayBackTime,c,e)},n.interface.send_session_pause=function(e){n.create_custom_command(n.CommandType.CameraCommand_SendSessionPause,c,e)},n.interface.send_session_resume=function(e){n.create_custom_command(n.CommandType.CameraCommand_SendSessionResume,c,e)},n.interface.send_session_range=function(e){n.create_custom_command(n.CommandType.CameraCommand_SendSessionRange,c,e)},n.interface.gb28181_camera_ptz_control=function(e){n.create_custom_command(n.CommandType.CameraCommand_GB28181CameraPtzControl,o,e)},n.interface.gb28181_camera_ptz_control_ex=function(e){n.create_custom_command(n.CommandType.CameraCommand_GB28181CameraPtzControlEx,o,e)},n.interface.get_camera=function(e){n.create_custom_command(n.CommandType.CameraCommand_GetCamera,c,e)},n.interface.enable_frustum_visible=function(e){n.create_custom_command(n.CommandType.CameraCommand_EnableFrustumVisible,r,e)},n.interface.destroy_camera=function(e){n.create_custom_command(n.CommandType.CameraCommand_DestroyCamera,c,e)},n.interface.destroy_all=function(e){n.create_custom_command(n.CommandType.CameraCommand_DestroyAll,c,e)},n.interface.element_camera_update_window=function(e){n.create_custom_command(n.CommandType.CameraCommand_UpdateWindowPos,s,e)},n.interface.element_camera_window_screen_shot=function(e){n.create_custom_command(n.CommandType.CameraCommand_WindowScreenShot,c,e)},n.interface.enable_scene_media_stream=function(e){n.create_custom_command(n.CommandType.CameraCommand_EnableSceneMediaStream,r,e)},n.interface.element_camera_window_visible=function(e){n.create_custom_command(n.CommandType.CameraCommand_WindowVisible,r,e)},n.RespondType={CameraRespond_OnCameraCreatedOrUpdate:0,CameraRespond_OnCameraWindowScreenShot:1},n.create_sub_handler(n.RespondType.CameraRespond_OnCameraCreatedOrUpdate,function(e){n.interface.OnCameraCreatedOrUpdate&&n.interface.OnCameraCreatedOrUpdate(e)}),n.create_sub_handler(n.RespondType.CameraRespond_OnCameraWindowScreenShot,function(e){n.interface.OnCameraWindowScreenShot&&n.interface.OnCameraWindowScreenShot(e)}),n.interface.OnCameraCreatedOrUpdate=void 0,n.interface.OnCameraWindowScreenShot=void 0,e.camera_interface=n.interface,n.interface)},U.directional_light_interface=function(e,t){if(null!=e.directional_light_interface)return e.directional_light_interface;function n(e,t){var n,t=new Q(e,t),e=e[2],a=(a=e,n=BigInt(0),null!=a&&(null!=a.intensity&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_SetIntensity)),null!=a.lightColor&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_SetLightColor)),null!=a.affectsWorld&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_SetAffectsWorld)),null!=a.castShadows&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_SetCastShadows)),null!=a.indirectLightingIntensity&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_SetIndirectLightingIntensity)),null!=a.volumetricScatteringIntensity&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_SetVolumetricScatteringIntensity)),null!=a.visibility&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_SetVisibility)),null!=a.castStaticShadows&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_CastStaticShadows)),null!=a.castDynamicShadows&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_CastDynamicShadows)),null!=a.affectTranslucentLighting&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_AffectTranslucentLighting)),null!=a.transmission&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_Transmission)),null!=a.castVolumetricShadow&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_CastVolumetricShadow)),null!=a.castDeepShadow&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_CastDeepShadow)),null!=a.castRaytracedShadow&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_CastRaytracedShadow)),null!=a.affectReflection&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_AffectReflection)),null!=a.affectGlobalIllumination&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_AffectGlobalIllumination)),null!=a.deepShadowLayerDistribution&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_DeepShadowLayerDistribution)),null!=a.samplesPerPixel&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_SamplesPerPixel)),null!=a.useTemperature&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_SetUseTemperature)),null!=a.temperature&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_SetTemperature)),null!=a.speculaScale&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_SetSpecularScale)),null!=a.maxDrawDistance&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_MaxDrawDistance)),null!=a.maxDistanceFadeRange&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_MaxDistanceFadeRange)),null!=a.previewShadowMapChannel&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_PreviewShadowMapChannel)),null!=a.shadowResolutionScale&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_ShadowResolutionScale)),null!=a.shadowBias&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_ShadowBias)),null!=a.shadowSlopeBias&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_ShadowSlopeBias)),null!=a.shadowSharpen&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_ShadowSharpen)),null!=a.contactShadowLength&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_ContactShadowLength)),null!=a.contactShadowLengthInWS&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_ContactShadowLengthInWS)),null!=a.castTranslucentShadows&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_CastTranslucentShadows)),null!=a.castShadowsFromCinematicObjectsOnly&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_CastShadowsFromCinematicObjectsOnly)),null!=a.affectDynamicIndirectLighting&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_AffectDynamicIndirectLighting)),null!=a.forceCachedShadowsForMovablePrimitives&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_ForceCachedShadowsForMovablePrimitives)),null!=a.channel0&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_Channel0)),null!=a.channel1&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_Channel1)),null!=a.channel2&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_Channel2)),null!=a.lightFunctionScale&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_LightFunctionScale)),null!=a.useIESBrightness&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_UseIESBrightness)),null!=a.iESBrightnessScale&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_IESBrightnessScale)),null!=a.lightFunctionFadeDistance&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_LightFunctionFadeDistance)),null!=a.disabledBrightness&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_DisabledBrightness)),null!=a.enableLightShaftBloom&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_EnableLightShaftBloom)),null!=a.bloomScale&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_BloomScale)),null!=a.bloomThreshold&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_BloomThreshold)),null!=a.bloomMaxBrightness&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_BloomMaxBrightness)),null!=a.bloomTint&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_BloomTint)),null!=a.useRayTracedDistanceFieldShadows&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_UseRayTracedDistanceFieldShadows)),null!=a.rayStartOffsetDepthScale)&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampLightDataType.LightCommand_RayStartOffsetDepthScale)),n),i=(t.writeUint64(n),n=t,null!=(i=e)&&(null!=i.intensity&&n.writeFloat32(i.intensity),null!=i.lightColor&&n.writeUint32(i.lightColor),null!=i.affectsWorld&&n.writeUint8(i.affectsWorld?1:0),null!=i.castShadows&&n.writeUint8(i.castShadows?1:0),null!=i.indirectLightingIntensity&&n.writeFloat32(i.indirectLightingIntensity),null!=i.volumetricScatteringIntensity&&n.writeFloat32(i.volumetricScatteringIntensity),null!=i.visibility&&n.writeUint8(i.visibility?1:0),null!=i.castStaticShadows&&n.writeUint8(i.castStaticShadows?1:0),null!=i.castDynamicShadows&&n.writeUint8(i.castDynamicShadows?1:0),null!=i.affectTranslucentLighting&&n.writeUint8(i.affectTranslucentLighting?1:0),null!=i.transmission&&n.writeUint8(i.transmission?1:0),null!=i.castVolumetricShadow&&n.writeUint8(i.castVolumetricShadow?1:0),null!=i.castDeepShadow&&n.writeUint8(i.castDeepShadow?1:0),null!=i.castRaytracedShadow&&n.writeInt32(i.castRaytracedShadow),null!=i.affectReflection&&n.writeUint8(i.affectReflection?1:0),null!=i.affectGlobalIllumination&&n.writeUint8(i.affectGlobalIllumination?1:0),null!=i.deepShadowLayerDistribution&&n.writeFloat32(i.deepShadowLayerDistribution),null!=i.samplesPerPixel&&n.writeInt32(i.samplesPerPixel),null!=i.useTemperature&&n.writeUint8(i.useTemperature?1:0),null!=i.temperature&&n.writeFloat32(i.temperature),null!=i.speculaScale&&n.writeFloat32(i.speculaScale),null!=i.maxDrawDistance&&n.writeFloat32(i.maxDrawDistance),null!=i.maxDistanceFadeRange&&n.writeFloat32(i.maxDistanceFadeRange),null!=i.previewShadowMapChannel&&n.writeInt32(i.previewShadowMapChannel),null!=i.shadowResolutionScale&&n.writeFloat32(i.shadowResolutionScale),null!=i.shadowBias&&n.writeFloat32(i.shadowBias),null!=i.shadowSlopeBias&&n.writeFloat32(i.shadowSlopeBias),null!=i.shadowSharpen&&n.writeFloat32(i.shadowSharpen),null!=i.contactShadowLength&&n.writeFloat32(i.contactShadowLength),null!=i.contactShadowLengthInWS&&n.writeUint8(i.contactShadowLengthInWS?1:0),null!=i.castTranslucentShadows&&n.writeUint8(i.castTranslucentShadows?1:0),null!=i.castShadowsFromCinematicObjectsOnly&&n.writeUint8(i.castShadowsFromCinematicObjectsOnly?1:0),null!=i.affectDynamicIndirectLighting&&n.writeUint8(i.affectDynamicIndirectLighting?1:0),null!=i.forceCachedShadowsForMovablePrimitives&&n.writeUint8(i.forceCachedShadowsForMovablePrimitives?1:0),null!=i.channel0&&n.writeUint8(i.channel0?1:0),null!=i.channel1&&n.writeUint8(i.channel1?1:0),null!=i.channel2&&n.writeUint8(i.channel2?1:0),null!=i.lightFunctionScale&&(n.writeFloat64(i.lightFunctionScale.x),n.writeFloat64(i.lightFunctionScale.y),n.writeFloat64(i.lightFunctionScale.z)),null!=i.useIESBrightness&&n.writeUint8(i.useIESBrightness?1:0),null!=i.iESBrightnessScale&&n.writeFloat32(i.iESBrightnessScale),null!=i.lightFunctionFadeDistance&&n.writeFloat32(i.lightFunctionFadeDistance),null!=i.disabledBrightness&&n.writeFloat32(i.disabledBrightness),null!=i.enableLightShaftBloom&&n.writeUint8(i.enableLightShaftBloom?1:0),null!=i.bloomScale&&n.writeFloat32(i.bloomScale),null!=i.bloomThreshold&&n.writeFloat32(i.bloomThreshold),null!=i.bloomMaxBrightness&&n.writeFloat32(i.bloomMaxBrightness),null!=i.bloomTint&&(n.writeInt32(i.bloomTint.x),n.writeInt32(i.bloomTint.y),n.writeInt32(i.bloomTint.z),n.writeInt32(i.bloomTint.w)),null!=i.useRayTracedDistanceFieldShadows&&n.writeUint8(i.useRayTracedDistanceFieldShadows?1:0),null!=i.rayStartOffsetDepthScale)&&n.writeFloat32(i.rayStartOffsetDepthScale),n.ValidData(),i=e,n=BigInt(0),null!=i&&(null!=i.lightSourceAngle&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_SetLightSourceAngle)),null!=i.lightSourceSoftAngle&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_SetLightSourceSoftAngle)),null!=i.atmosphereSunlight&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_SetAtmosphereSunLight)),null!=i.castShadowsOnClouds&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_SetCastShadowsOnClouds)),null!=i.castShadowsOnAtmosphere&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_SetCastShadowsOnAtmosphere)),null!=i.castCloudShadows&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_SetCastCloudShadows)),null!=i.cloudScatteredLuminanceScale&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_SetCloudScatteredLuminanceScale)),null!=i.shadowAmount&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_SetShadowAmount)),null!=i.shadowCascadeBiasDistribution&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_ShadowCascadeBiasDistribution)),null!=i.enableLightShaftOcclusion&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_EnableLightShaftOcclusion)),null!=i.occlusionMaskDarkness&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_OcclusionMaskDarkness)),null!=i.occlusionDepthRange&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_OcclusionDepthRange)),null!=i.lightShaftOverrideDirection&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_LightShaftOverrideDirection)),null!=i.dynamicShadowDistanceMovableLight&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_DynamicShadowDistanceMovableLight)),null!=i.dynamicShadowDistanceStationaryLight&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_DynamicShadowDistanceStationaryLight)),null!=i.dynamicShadowCascades&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_DynamicShadowCascades)),null!=i.cascadeDistributionExponent&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_CascadeDistributionExponent)),null!=i.cascadeTransitionFraction&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_CascadeTransitionFraction)),null!=i.shadowDistanceFadeoutFraction&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_ShadowDistanceFadeoutFraction)),null!=i.useInsetShadowsForMovableObjects&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_UseInsetShadowsForMovableObjects)),null!=i.farShadowCascadeCount&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_FarShadowCascadeCount)),null!=i.farShadowDistance&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_FarShadowDistance)),null!=i.distanceFieldShadowDistance&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_DistanceFieldShadowDistance)),null!=i.forwardShadingPriority&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_ForwardShadingPriority)),null!=i.shadowSourceAngleFactor&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_ShadowSourceAngleFactor)),null!=i.traceDistance&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_TraceDistance)),null!=i.atmosphereSunLightIndex&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_AtmosphereSunLightIndex)),null!=i.atmosphereSunDiskColorScale&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_AtmosphereSunDiskColorScale)),null!=i.perPixelAtmosphereTransmittance&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_PerPixelAtmosphereTransmittance)),null!=i.cloudShadowStrength&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_CloudShadowStrength)),null!=i.cloudShadowOnAtmosphereStrength&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_CloudShadowOnAtmosphereStrength)),null!=i.cloudShadowOnSurfaceStrength&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_CloudShadowOnSurfaceStrength)),null!=i.cloudShadowDepthBias&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_CloudShadowDepthBias)),null!=i.cloudShadowExtent&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_CloudShadowExtent)),null!=i.cloudShadowMapResolutionScale&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_CloudShadowMapResolutionScale)),null!=i.cloudShadowRaySampleCountScale&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_CloudShadowRaySampleCountScale)),null!=i.settingsLightSourceAngle&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_SettingsLightSourceAngle)),null!=i.settingsIndirectLightingSaturation&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_SettingsIndirectLightingSaturation)),null!=i.settingsShadowExponent&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_SettingsShadowExponent)),null!=i.settingsUseAreaShadowsForStationaryLight&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_SettingsUseAreaShadowsForStationaryLight)),null!=i.castModulatedShadows&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_bCastModulatedShadows)),null!=i.modulatedShadowColor)&&(n+=BigInt(1)<<BigInt(r.PixelStreaminStampDirectionalLightDataType.DirectionalLightCommand_ModulatedShadowColor)),a=n,t.writeUint64(a),null!=e?e.isSun:void 0);return t.writeUint8((i=null==i?!0:i)?1:0),null!=e&&(null!=e.lightSourceAngle&&t.writeFloat32(e.lightSourceAngle),null!=e.lightSourceSoftAngle&&t.writeFloat32(e.lightSourceSoftAngle),null!=e.atmosphereSunlight&&t.writeUint8(e.atmosphereSunlight?1:0),null!=e.castShadowsOnClouds&&t.writeUint8(e.castShadowsOnClouds?1:0),null!=e.castShadowsOnAtmosphere&&t.writeUint8(e.castShadowsOnAtmosphere?1:0),null!=e.castCloudShadows&&t.writeUint8(e.castCloudShadows?1:0),null!=e.cloudScatteredLuminanceScale&&t.writeUint32(e.cloudScatteredLuminanceScale),null!=e.shadowAmount&&t.writeFloat32(e.shadowAmount),null!=e.shadowCascadeBiasDistribution&&t.writeFloat32(e.shadowCascadeBiasDistribution),null!=e.enableLightShaftOcclusion&&t.writeUint8(e.enableLightShaftOcclusion?1:0),null!=e.occlusionMaskDarkness&&t.writeFloat32(e.occlusionMaskDarkness),null!=e.occlusionDepthRange&&t.writeFloat32(e.occlusionDepthRange),null!=e.lightShaftOverrideDirection&&(t.writeFloat64(e.lightShaftOverrideDirection.x),t.writeFloat64(e.lightShaftOverrideDirection.y),t.writeFloat64(e.lightShaftOverrideDirection.z)),null!=e.dynamicShadowDistanceMovableLight&&t.writeFloat32(e.dynamicShadowDistanceMovableLight),null!=e.dynamicShadowDistanceStationaryLight&&t.writeFloat32(e.dynamicShadowDistanceStationaryLight),null!=e.dynamicShadowCascades&&t.writeInt32(e.dynamicShadowCascades),null!=e.cascadeDistributionExponent&&t.writeFloat32(e.cascadeDistributionExponent),null!=e.cascadeTransitionFraction&&t.writeFloat32(e.cascadeTransitionFraction),null!=e.shadowDistanceFadeoutFraction&&t.writeFloat32(e.shadowDistanceFadeoutFraction),null!=e.useInsetShadowsForMovableObjects&&t.writeUint8(e.useInsetShadowsForMovableObjects?1:0),null!=e.farShadowCascadeCount&&t.writeInt32(e.farShadowCascadeCount),null!=e.farShadowDistance&&t.writeFloat32(e.farShadowDistance),null!=e.distanceFieldShadowDistance&&t.writeFloat32(e.distanceFieldShadowDistance),null!=e.forwardShadingPriority&&t.writeInt32(e.forwardShadingPriority),null!=e.shadowSourceAngleFactor&&t.writeFloat32(e.shadowSourceAngleFactor),null!=e.traceDistance&&t.writeFloat32(e.traceDistance),null!=e.atmosphereSunLightIndex&&t.writeInt32(e.atmosphereSunLightIndex),null!=e.atmosphereSunDiskColorScale&&(n=t,a=e.atmosphereSunDiskColorScale,n.writeFloat64(null!=a.r?a.r:a.x),n.writeFloat64(null!=a.g?a.g:a.y),n.writeFloat64(null!=a.b?a.b:a.z),n.writeFloat64(null!=a.a?a.a:a.w)),null!=e.perPixelAtmosphereTransmittance&&t.writeUint8(e.perPixelAtmosphereTransmittance?1:0),null!=e.cloudShadowStrength&&t.writeFloat32(e.cloudShadowStrength),null!=e.cloudShadowOnAtmosphereStrength&&t.writeFloat32(e.cloudShadowOnAtmosphereStrength),null!=e.cloudShadowOnSurfaceStrength&&t.writeFloat32(e.cloudShadowOnSurfaceStrength),null!=e.cloudShadowDepthBias&&t.writeFloat32(e.cloudShadowDepthBias),null!=e.cloudShadowExtent&&t.writeFloat32(e.cloudShadowExtent),null!=e.cloudShadowMapResolutionScale&&t.writeFloat32(e.cloudShadowMapResolutionScale),null!=e.cloudShadowRaySampleCountScale&&t.writeFloat32(e.cloudShadowRaySampleCountScale),null!=e.settingsLightSourceAngle&&t.writeFloat32(e.settingsLightSourceAngle),null!=e.settingsIndirectLightingSaturation&&t.writeFloat32(e.settingsIndirectLightingSaturation),null!=e.settingsShadowExponent&&t.writeFloat32(e.settingsShadowExponent),null!=e.settingsUseAreaShadowsForStationaryLight&&t.writeUint8(e.settingsUseAreaShadowsForStationaryLight?1:0),null!=e.castModulatedShadows&&t.writeUint8(e.castModulatedShadows?1:0),null!=e.modulatedShadowColor)&&(i=t,n=e.modulatedShadowColor,i.writeInt32(null!=n.r?n.r:n.x),i.writeInt32(null!=n.g?n.g:n.y),i.writeInt32(null!=n.b?n.b:n.z),i.writeInt32(null!=n.a?n.a:n.w)),t.ValidData()}var r=e.handlers.get(t.StampPixelStreamingHandleType.StampType_Light),t=0,t=(r.PixelStreaminStampLightDataType={LightCommand_SetIntensity:t++,LightCommand_SetLightColor:t++,LightCommand_SetAffectsWorld:t++,LightCommand_SetCastShadows:t++,LightCommand_SetIndirectLightingIntensity:t++,LightCommand_SetVolumetricScatteringIntensity:t++,LightCommand_SetVisibility:t++,LightCommand_CastStaticShadows:t++,LightCommand_CastDynamicShadows:t++,LightCommand_AffectTranslucentLighting:t++,LightCommand_Transmission:t++,LightCommand_CastVolumetricShadow:t++,LightCommand_CastDeepShadow:t++,LightCommand_CastRaytracedShadow:t++,LightCommand_AffectReflection:t++,LightCommand_AffectGlobalIllumination:t++,LightCommand_DeepShadowLayerDistribution:t++,LightCommand_SamplesPerPixel:t++,LightCommand_SetUseTemperature:t++,LightCommand_SetTemperature:t++,LightCommand_SetSpecularScale:t++,LightCommand_MaxDrawDistance:t++,LightCommand_MaxDistanceFadeRange:t++,LightCommand_PreviewShadowMapChannel:t++,LightCommand_ShadowResolutionScale:t++,LightCommand_ShadowBias:t++,LightCommand_ShadowSlopeBias:t++,LightCommand_ShadowSharpen:t++,LightCommand_ContactShadowLength:t++,LightCommand_ContactShadowLengthInWS:t++,LightCommand_CastTranslucentShadows:t++,LightCommand_CastShadowsFromCinematicObjectsOnly:t++,LightCommand_AffectDynamicIndirectLighting:t++,LightCommand_ForceCachedShadowsForMovablePrimitives:t++,LightCommand_Channel0:t++,LightCommand_Channel1:t++,LightCommand_Channel2:t++,LightCommand_LightFunctionScale:t++,LightCommand_UseIESBrightness:t++,LightCommand_IESBrightnessScale:t++,LightCommand_LightFunctionFadeDistance:t++,LightCommand_DisabledBrightness:t++,LightCommand_EnableLightShaftBloom:t++,LightCommand_BloomScale:t++,LightCommand_BloomThreshold:t++,LightCommand_BloomMaxBrightness:t++,LightCommand_BloomTint:t++,LightCommand_UseRayTracedDistanceFieldShadows:+t,LightCommand_RayStartOffsetDepthScale:48},0);r.PixelStreaminStampDirectionalLightDataType={DirectionalLightCommand_SetLightSourceAngle:t++,DirectionalLightCommand_SetLightSourceSoftAngle:t++,DirectionalLightCommand_SetAtmosphereSunLight:t++,DirectionalLightCommand_SetCastShadowsOnClouds:t++,DirectionalLightCommand_SetCastShadowsOnAtmosphere:t++,DirectionalLightCommand_SetCastCloudShadows:t++,DirectionalLightCommand_SetCloudScatteredLuminanceScale:t++,DirectionalLightCommand_SetShadowAmount:t++,DirectionalLightCommand_ShadowCascadeBiasDistribution:t++,DirectionalLightCommand_EnableLightShaftOcclusion:t++,DirectionalLightCommand_OcclusionMaskDarkness:t++,DirectionalLightCommand_OcclusionDepthRange:t++,DirectionalLightCommand_LightShaftOverrideDirection:t++,DirectionalLightCommand_DynamicShadowDistanceMovableLight:t++,DirectionalLightCommand_DynamicShadowDistanceStationaryLight:t++,DirectionalLightCommand_DynamicShadowCascades:t++,DirectionalLightCommand_CascadeDistributionExponent:t++,DirectionalLightCommand_CascadeTransitionFraction:t++,DirectionalLightCommand_ShadowDistanceFadeoutFraction:t++,DirectionalLightCommand_UseInsetShadowsForMovableObjects:t++,DirectionalLightCommand_FarShadowCascadeCount:t++,DirectionalLightCommand_FarShadowDistance:t++,DirectionalLightCommand_DistanceFieldShadowDistance:t++,DirectionalLightCommand_ForwardShadingPriority:t++,DirectionalLightCommand_ShadowSourceAngleFactor:t++,DirectionalLightCommand_TraceDistance:t++,DirectionalLightCommand_AtmosphereSunLightIndex:t++,DirectionalLightCommand_AtmosphereSunDiskColorScale:t++,DirectionalLightCommand_PerPixelAtmosphereTransmittance:t++,DirectionalLightCommand_CloudShadowStrength:t++,DirectionalLightCommand_CloudShadowOnAtmosphereStrength:t++,DirectionalLightCommand_CloudShadowOnSurfaceStrength:t++,DirectionalLightCommand_CloudShadowDepthBias:t++,DirectionalLightCommand_CloudShadowExtent:t++,DirectionalLightCommand_CloudShadowMapResolutionScale:t++,DirectionalLightCommand_CloudShadowRaySampleCountScale:t++,DirectionalLightCommand_SettingsLightSourceAngle:t++,DirectionalLightCommand_SettingsIndirectLightingSaturation:t++,DirectionalLightCommand_SettingsShadowExponent:t++,DirectionalLightCommand_SettingsUseAreaShadowsForStationaryLight:t++,DirectionalLightCommand_bCastModulatedShadows:+t,DirectionalLightCommand_ModulatedShadowColor:41},r.CommandType={DirectionalLightCommand_SetData:0,DirectionalLightCommand_GetDirectionalLight:1};function a(e){var t={};return t.intensity=e.intensity,t.lightColor=e.lightColor,t.isSun=e.isSun,t.shadowAmount=e.shadowAmount,t.atmosphereSunDiskColorScale=e.atmosphereSunDiskColorScale,t}r.interface.set_directional_light_data=function(e){e=a(e);r.create_custom_command(r.CommandType.DirectionalLightCommand_SetData,n,e)},r.interface.set_directional_light_data_for_test=function(e){r.create_custom_command(r.CommandType.DirectionalLightCommand_SetData,n,e)};function i(e,t){return t=new Q(e,t),e=e[2],t.writeUint8(e?1:0),t.ValidData()}r.interface.get_directional_light=function(e){r.create_custom_command(r.CommandType.DirectionalLightCommand_GetDirectionalLight,i,e)};return r.RespondType={DirectionalLightRespond_DirectionalLightGet:0},r.create_sub_handler(r.RespondType.DirectionalLightRespond_DirectionalLightGet,function(e){r.interface.OnDirectionalLightGet&&(e=a(e),r.interface.OnDirectionalLightGet(e))}),r.interface.OnDirectionalLightGet=void 0,e.directional_light_interface=r.interface,r.interface},G.dynamic_system_interface=function(e,t){var i,n,r,a,o,s;return null!=e.dynamic_system_interface?e.dynamic_system_interface:((i=e.handlers.get(t.StampPixelStreamingHandleType.StampType_DynamicSystemInterface)).CommandType={Interface_ApplyDynamicList:0,Interface_LoadDynamicObject:1,Interface_UnLoadDynamicObject:2,Interface_UnLoadDynamicObjectBatch:3,Interface_AttachSubObject:4,Interface_DetachSubObject:5,Interface_AttachSubObjectBatch:6,Interface_DetachSubObjectBatch:7},i.interface.apply_dynamic_list=function(){i.create_custom_command(i.CommandType.Interface_ApplyDynamicList,t.GetNoParamCommandPackData)},i.interface.load_dynamic_object=function(e){i.create_custom_command(i.CommandType.Interface_LoadDynamicObject,t.GetGuidCommandPackData,[e])},i.interface.unload_dynamic_object=function(e){i.create_custom_command(i.CommandType.Interface_UnLoadDynamicObject,t.GetGuidCommandPackData,[e])},n=function(e,t){var n=e[2],a=new Q(e,t),i=n.length;a.writeUint16(i);for(var r=0;r<i;++r){var o=n[r];a.writeWString(o)}return a.ValidData()},i.interface.unload_dynamic_object_batch=function(e){i.create_custom_command(i.CommandType.Interface_UnLoadDynamicObjectBatch,n,[e])},r=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.writePoint(i),e.writePoint(r),e.ValidData()},i.interface.attach_sub_object=function(e,t,n,a){i.create_custom_command(i.CommandType.Interface_AttachSubObject,r,[e,t,n,a])},a=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.ValidData()},i.interface.detach_sub_object=function(e,t){i.create_custom_command(i.CommandType.Interface_DetachSubObject,a,[e,t])},o=function(e,t){var n=e[2],a=new Q(e,t),i=n.length;a.writeUint16(i);for(var r=0;r<i;++r){var o=n[r].model_guid,s=(a.writeWString(o),n[r].children.length);a.writeUint16(s);for(var c=0;c<s;++c){var l=n[r].children[c].sub_guid,m=n[r].children[c].pos_offset,d=n[r].children[c].rot_offset;a.writeWString(l),a.writePoint(m),a.writePoint(d)}}return a.ValidData()},i.interface.attach_sub_object_batch=function(e){i.create_custom_command(i.CommandType.Interface_AttachSubObjectBatch,o,e)},s=function(e,t){var n=e[2],a=new Q(e,t),i=n.length;a.writeUint16(i);for(var r=0;r<i;++r){var o=n[r].model_guid,s=(a.writeWString(o),n[r].children.length);a.writeUint16(s);for(var c=0;c<s;++c){var l=n[r].children[c];a.writeWString(l)}}return a.ValidData()},i.interface.detach_sub_object_batch=function(e){i.create_custom_command(i.CommandType.Interface_DetachSubObjectBatch,s,e)},i.RespondType={InterfaceRespond_OnDynamicListLoaded:0,InterfaceRespond_OnLoadDynamicObject:1,InterfaceRespond_OnFinishedAnimation:2},i.create_sub_handler(i.RespondType.InterfaceRespond_OnDynamicListLoaded,function(e){for(var t in i.interface.dynamic_list=i.interface.dynamic_list||{},e.DynamicList)i.interface.dynamic_list[e.DynamicList[t].guid]=e.DynamicList[t];i.interface.OnDynamicListLoaded&&i.interface.OnDynamicListLoaded(e.DynamicList)}),i.create_sub_handler(i.RespondType.InterfaceRespond_OnLoadDynamicObject,function(e){i.interface.OnLoadDynamicObject&&i.interface.OnLoadDynamicObject(e)}),i.create_sub_handler(i.RespondType.InterfaceRespond_OnFinishedAnimation,function(e){i.interface.OnFinishedAnimation&&i.interface.OnFinishedAnimation(e)}),i.interface.OnDynamicListLoaded=void 0,i.interface.OnLoadDynamicObject=void 0,i.interface.OnFinishedAnimation=void 0,e.dynamic_system_interface=i.interface,i.interface)},A.element_interface=function(e,o){var s;return null!=e.element_interface?e.element_interface:((s=e.handlers.get(o.StampPixelStreamingHandleType.StampType_Element)).CommandType={ElementCommand_Create:0,ElementCommand_Modify:1,ElementCommand_Delete:2,ElementCommand_Visibility:3,ElementCommand_FlyTo:4,ElementCommand_HighLight:5,ElementCommand_Pick:6,ElementCommand_Move:7,ElementCommand_Rotate:8,ElementCommand_Scale:9,ElementCommand_SelectByGuid:10,ElementCommand_ClampTerrain:11,ElementCommand_Clone:12,ElementCommand_MovePoint:13,ElementCommand_AddPoint:14,ElementCommand_DeletePoint:15,ElementCommand_CreateByParams:16,ElementCommand_TransformOffsetByValue:17,ElementCommand_SetPositionParams:18,ElementCommand_GetSelectSet:19,ElementCommand_Browser:20,ElementCommand_VisibleRange:21,ElementCommand_CreateByParamsBatch:22,ElementCommand_TransformOffsetByValueAndGuid:23,ElementCommand_IconFlash:24,ElementCommand_Invalid:25},s.interface.create_element=function(e){s.create_custom_command(s.CommandType.ElementCommand_Create,t,e),o.Cursor.set_edit()},s.interface.modify_element=function(e){s.create_custom_command(s.CommandType.ElementCommand_Modify,t,e)},s.interface.ObjectEdit=function(e){e!=s.CommandType.ElementCommand_GetSelectSet&&o.Cursor.reset(),s.create_custom_command(e,o.GetNoParamCommandPackData),e>=s.CommandType.ElementCommand_Pick&&e<=s.CommandType.ElementCommand_ClampTerrain&&o.Cursor.set_select(),e>=s.CommandType.ElementCommand_MovePoint&&e<=s.CommandType.ElementCommand_DeletePoint&&o.Cursor.set_select()},s.interface.SelectByGuid=function(e){s.create_custom_command(s.CommandType.ElementCommand_SelectByGuid,o.GetGuidCommandPackData,e)},s.interface.FlyToByGuidCommand=function(e){s.create_custom_command(s.CommandType.ElementCommand_FlyTo,n,e)},s.interface.delete_element=function(e){s.create_custom_command(s.CommandType.ElementCommand_Delete,n,e)},s.interface.highlight_element=function(e){s.create_custom_command(s.CommandType.ElementCommand_HighLight,a,e)},s.interface.visible_element=function(e){s.create_custom_command(s.CommandType.ElementCommand_Visibility,a,e)},s.interface.clone_element=function(e){s.create_custom_command(s.CommandType.ElementCommand_Clone,n,e)},s.interface.visible_range_element=function(e){s.create_custom_command(s.CommandType.ElementCommand_VisibleRange,i,e)},s.interface.create_polygon_params=function(e){s.create_custom_command(s.CommandType.ElementCommand_CreateByParams,c,e)},s.interface.create_box_params=function(e){s.create_custom_command(s.CommandType.ElementCommand_CreateByParams,d,e)},s.interface.create_advertising_board_params=function(e){s.create_custom_command(s.CommandType.ElementCommand_CreateByParams,d,e)},s.interface.create_icon_params=function(e){s.create_custom_command(s.CommandType.ElementCommand_CreateByParams,d,e)},s.interface.create_alarm_ring_params=function(e){s.create_custom_command(s.CommandType.ElementCommand_CreateByParams,d,e)},s.interface.create_dynamic_scan_params=function(e){s.create_custom_command(s.CommandType.ElementCommand_CreateByParams,d,e)},s.interface.create_dynamic_spread_params=function(e){s.create_custom_command(s.CommandType.ElementCommand_CreateByParams,d,e)},s.interface.create_photo_electric_wall_params=function(e){s.create_custom_command(s.CommandType.ElementCommand_CreateByParams,m,e)},s.interface.create_dynamic_wall_params=function(e){s.create_custom_command(s.CommandType.ElementCommand_CreateByParams,m,e)},s.interface.create_halo_wall_params=function(e){s.create_custom_command(s.CommandType.ElementCommand_CreateByParams,m,e)},s.interface.create_arrow_flow_line_params=function(e){s.create_custom_command(s.CommandType.ElementCommand_CreateByParams,m,e)},s.interface.create_blueprint_params=function(e){s.create_custom_command(s.CommandType.ElementCommand_CreateByParams,r,e)},s.interface.create_batch=function(e){s.create_custom_command(s.CommandType.ElementCommand_CreateByParamsBatch,u,e)},s.interface.create_heatmap_params=function(e){s.create_custom_command(s.CommandType.ElementCommand_CreateByParams,d,e)},s.interface.create_ue_poi_params=function(e){s.create_custom_command(s.CommandType.ElementCommand_CreateByParams,d,e)},s.interface.create_ue_spline_actor_params=function(e){s.create_custom_command(s.CommandType.ElementCommand_CreateByParams,m,e)},s.interface.create_traffic_flow_line_params=function(e){s.create_custom_command(s.CommandType.ElementCommand_CreateByParams,m,e)},s.interface.create_field_grid_params=function(e){s.create_custom_command(s.CommandType.ElementCommand_CreateByParams,m,e)},s.interface.create_ocean_current_params=function(e){s.create_custom_command(s.CommandType.ElementCommand_CreateByParams,m,e)},s.interface.transform_offset=function(e){s.create_custom_command(s.CommandType.ElementCommand_TransformOffsetByValue,g,e)},s.interface.modify_position=function(e){s.create_custom_command(s.CommandType.ElementCommand_SetPositionParams,h,e)},s.interface.transform_offset_by_guid=function(e){s.create_custom_command(s.CommandType.ElementCommand_TransformOffsetByValueAndGuid,_,e)},s.interface.icon_flash=function(e){s.create_custom_command(s.CommandType.ElementCommand_IconFlash,p,e)},s.RespondType={ELementRespond_OnCreateFinished:0,ELementRespond_Failed:1,ELementRespond_OnCloneFinished:2,ELementRespond_OnPositionChanged:3,ELementRespond_OnPickFinshed:4,ElementRespond_OnGetSelectSet:5,ElementRespond_OnResponseStatus:6,ELementRespond_OnCreateBatchFinished:7},s.create_sub_handler(s.RespondType.ELementRespond_OnCreateFinished,function(e){var e=new TextDecoder("utf-16").decode(e),t=JSON.parse(e),n=(o.Cursor.reset(),s.interface.getObjByID(t.guid));if(null!=n){switch(null!=t.rings&&(n.rings=t.rings),n.type){case 202:n.longValue=t.length,n.widthValue=t.width,n.heightValue=t.height,f(t,n);break;case 203:n.bottomRadius=t.radius,n.heightValue=t.height,f(t,n);break;case 204:n.bottomRadius=t.bottomRadius,n.topRadius=t.topRadius,n.heightValue=t.height,f(t,n);break;case 205:n.bottomRadius=t.radius,n.heightValue=t.height,n.sides=t.sides,f(t,n);break;case 206:n.bottomRadius=t.bottomRadius,n.topRadius=t.topRadius,n.heightValue=t.height,n.sides=t.sides,f(t,n);break;case 207:n.heightValue=t.heightValue;break;case 209:case 237:f(t,n);break;case 216:n.radius=t.radius,f(t,n);break;case 222:f(t,n);break;case 211:case 250:case 251:case 252:case 253:case 254:case 255:case 256:case 257:case 258:case 259:case 260:n.perimeter=t.perimeter,n.area=t.area,n.rings=t.rings;break;case 227:n.radius=t.radius,n.perimeter=t.perimeter,n.area=t.area,f(t,n);break;case 220:case 229:n.length=t.length,n.rings=t.rings}s.interface.OnAdded&&s.interface.OnAdded(n)}}),s.create_sub_handler(s.RespondType.ELementRespond_Failed,function(e){s.interface.OnCreateFailed&&s.interface.OnCreateFailed(e)}),s.create_sub_handler(s.RespondType.ELementRespond_OnCloneFinished,function(e){var t=s.interface.getObjByID(e.guid);if(null!=t){var n,a={};for(n in t)a[n]=t[n];a.guid=e.cloneGuid,a.action="add",s.interface.OnAdded&&s.interface.OnAdded(a)}}),s.create_sub_handler(s.RespondType.ELementRespond_OnPositionChanged,function(e){null!=s.interface.OnPositionChanged&&(e=new TextDecoder("utf-16").decode(e),e=JSON.parse(e),s.interface.OnPositionChanged(e))}),s.create_sub_handler(s.RespondType.ELementRespond_OnPickFinshed,function(e){o.Cursor.reset(),null!=s.interface.OnPickFinshed&&s.interface.OnPickFinshed()}),s.create_sub_handler(s.RespondType.ElementRespond_OnGetSelectSet,function(e){e=new TextDecoder("utf-16").decode(e),e=JSON.parse(e),null!=s.interface.OnGetSelectSet&&s.interface.OnGetSelectSet(e)}),s.create_sub_handler(s.RespondType.ElementRespond_OnResponseStatus,function(e){null!=s.interface.OnStatus&&s.interface.OnStatus(e)}),s.create_sub_handler(s.RespondType.ELementRespond_OnCreateBatchFinished,function(e){var e=new TextDecoder("utf-16").decode(e),t=JSON.parse(e);o.Cursor.reset();for(var n=0,a=null==t.Results?0:t.Results.length;n<a;++n){var i=t.Results[n],r=s.interface.getObjByID(i.guid);if(null!=r){switch(null!=i.rings&&(r.rings=i.rings),r.type){case 202:r.longValue=i.length,r.widthValue=i.width,r.heightValue=i.height,f(i,r);break;case 203:r.bottomRadius=i.radius,r.heightValue=i.height,f(i,r);break;case 204:r.bottomRadius=i.bottomRadius,r.topRadius=i.topRadius,r.heightValue=i.height,f(i,r);break;case 205:r.bottomRadius=i.radius,r.heightValue=i.height,r.sides=i.sides,f(i,r);break;case 206:r.bottomRadius=i.bottomRadius,r.topRadius=i.topRadius,r.heightValue=i.height,r.sides=i.sides,f(i,r);break;case 207:r.heightValue=i.heightValue;break;case 209:case 237:f(i,r);break;case 216:r.radius=i.radius,f(i,r);break;case 222:f(i,r);break;case 211:case 250:case 251:case 252:case 253:case 254:case 255:case 256:case 257:case 258:case 259:case 260:r.perimeter=i.perimeter,r.area=i.area,r.rings=i.rings;break;case 227:r.radius=i.radius,r.perimeter=i.perimeter,r.area=i.area,f(i,r);break;case 220:case 229:r.length=i.length,r.rings=i.rings}s.interface.OnAdded&&s.interface.OnAdded(r)}}}),s.interface.userdataArr=[],s.interface.getObjByID=function(e){var t=null;if(null==s.interface.userdataArr)return null;for(var n=0;n<s.interface.userdataArr.length;n++){var a=s.interface.userdataArr[n];if(a&&a.guid==e)return t=a}return t},s.interface.OnAdded=void 0,s.interface.OnCreateFailed=void 0,s.interface.OnGetSelectSet=void 0,s.interface.OnPositionChanged=void 0,s.interface.OnPickFinshed=void 0,s.interface.OnStatus=void 0,e.element_interface=s.interface,s.interface);function E(e,t){e=parseInt("0x"+e.toString().substring(1).toLowerCase());t.writeUint32(e)}function B(e,t){var n=(e=null==e?[]:e).length;if(n<3)for(var a=3-n,i=0;i<a;++i)e.push("");for(i=0;i<3;++i)t.writeWString(e[i])}function l(e,t,n,a){var i,r,o,s,c,l,m=null==n?new Q(e,t):n,d=null==a?e[2]:a[0],t=(d.intersectable=null==d.intersectable||d.intersectable,m.writeUint16(d.type),m.writeString(d.guid),m.writeWString(d.name),m.writeUint8(d.selectable?1:0),m.writeUint8(d.intersectable?1:0),m.writeUint8(d.editable?1:0),null==d.visible||d.visible?1:0),n=(m.writeUint8(t),null!=d.underground&&d.underground?1:0);m.writeUint8(n);switch(m.writeUint8(0),d.type){case 202:E(d.fillcolor,m),B(d.texturePath,m),"modify"===d.action&&(m.writeFloat32(d.longValue),m.writeFloat32(d.widthValue),m.writeFloat32(d.heightValue));break;case 203:E(d.fillcolor,m),B(d.texturePath,m),"modify"===d.action&&(m.writeFloat32(d.bottomRadius),m.writeFloat32(d.heightValue));break;case 204:E(d.fillcolor,m),B(d.texturePath,m),m.writeUint8(null==d.showUnderground||d.showUnderground?1:0),m.writeUint8(null!=d.noCombile&&d.noCombile?1:0),"modify"===d.action&&(m.writeFloat32(d.bottomRadius),m.writeFloat32(d.topRadius),m.writeFloat32(d.heightValue));break;case 205:E(d.fillcolor,m),B(d.texturePath,m),m.writeUint32(d.sides),"modify"===d.action&&(m.writeFloat32(d.bottomRadius),m.writeFloat32(d.heightValue));break;case 206:E(d.fillcolor,m),B(d.texturePath,m),m.writeUint32(d.sides),m.writeUint8(null==d.showUnderground||d.showUnderground?1:0),m.writeUint8(null!=d.noCombile&&d.noCombile?1:0),"modify"===d.action&&(m.writeFloat32(d.bottomRadius),m.writeFloat32(d.topRadius),m.writeFloat32(d.heightValue));break;case 207:E(d.fillcolor,m),B(d.texturePath,m),m.writeUint32(null!=d.Wrapu?d.Wrapu:1),m.writeUint32(null!=d.Wrapv?d.Wrapv:1),m.writeUint8(null!=d.TextureBySingleFace?d.TextureBySingleFace:0);var u=null==d.canvasDatas?0:d.canvasDatas.length;m.writeUint8(u);for(var g=0;g<u;++g){var h=d.canvasDatas[g];m.writeUint8(h.faceIndex),m.writeUint32(h.width),m.writeUint32(h.height),m.writeBuf(h.brga)}null==d.linecolor||"string"==typeof d.linecolor?E(null==d.linecolor?"#ccffffff":d.linecolor,m):m.writeUint32(null==d.linecolor?3439329279:d.linecolor),m.writeFloat32(null==d.linewidth?0:d.linewidth),m.writeUint8(null==d.is_bottom_flat||d.is_bottom_flat?1:0),"modify"===d.action&&m.writeFloat32(d.heightValue);break;case 209:s=d,(c=m).writeWString(s.NormalUrl),c.writeWString(s.HighlightUrl),c.writeWString(s.Text),c.writeUint8(s.RenderMode),c.writeUint32(s.TextFormat),c.writeUint8(s.ShowHandle?1:0),c.writeFloat32(s.HandleHeight),c.writeUint8(s.HandleType),c.writeUint32(s.HandleColor),c.writeUint32(s.TextColor),c.writeFloat32(s.TextHorizontalScale),c.writeFloat32(s.TextVerticalScale),c.writeUint8(s.ShowBackground?1:0),c.writeUint8(s.ShowFrame?1:0),c.writeUint32(s.BackgroundColor),c.writeUint32(s.FrameColor),c.writeUint32(s.LineSize),c.writeWString(s.Separator),c.writeWString(null!=s.FontStyle?s.FontStyle:"Regular"),c.writeUint32(null!=s.FontSize?s.FontSize:10),c.writeUint8(s.FontIsTop?1:0),c.writeUint8(null==s.IsOcclusionTest||s.IsOcclusionTest?1:0),c.writeUint8(s.CanvasTexture?1:0),s.CanvasTexture&&(c.writeUint32(s.CanvasWidth),c.writeUint32(s.CanvasHeight),c.writeBuf(s.CanvasTexture)),l=null!=s.IsCluster&&s.IsCluster?1:0,c.writeUint8(l),l&&c.writeWString(null!=s.ClusterImage?s.ClusterImage:""),c.writeUint32(s.IconWidth||0),c.writeUint32(s.IconHeight||0);break;case 216:E(d.fillcolor,m),B(d.texturePath,m),"modify"===d.action&&m.writeFloat32(d.radius);break;case 211:case 250:case 251:case 252:case 253:case 254:case 255:case 256:case 257:case 258:case 259:case 260:E(d.fillcolor,m),E(d.linecolor,m),m.writeFloat32(d.linewidth),m.writeUint8(parseInt(d.shadow)),m.writeUint16(parseInt(d.drawOrder));break;case 227:E(d.fillcolor,m),E(d.linecolor,m),m.writeFloat32(d.linewidth),m.writeUint8(parseInt(d.shadow)),m.writeUint16(parseInt(d.drawOrder)),"modify"===d.action&&m.writeFloat32(d.radius);break;case 220:case 229:E(d.linecolor,m),m.writeFloat32(d.linewidth),m.writeUint8(parseInt(d.shadow)),m.writeUint16(parseInt(d.drawOrder)),m.writeUint16(parseInt(d.arrow));break;case 222:m.writeWString(d.meshLink),m.writeUint16(parseInt(d.typeMesh));break;case 226:m.writeFloat32(d.waterWave),m.writeFloat32(d.waterSpeedX),m.writeFloat32(d.waterSpeedY),m.writeFloat32(d.waterSpeedZ),E(d.fillcolor,m);break;case 234:m.writeFloat32(d.radius),m.writeFloat32(d.split),m.writeFloat32(d.speed),m.writeWString(d.texturePath);break;case 237:m.writeWString(d.params);break;case 239:m.writeUint8(d.scanType),m.writeFloat64(d.size[0]),m.writeFloat64(d.size[1]),m.writeFloat64(d.size[2]),m.writeFloat32(d.speed),E(d.color,m),m.writeUint8(d.reverse);break;case 240:m.writeFloat64(d.size[0]),m.writeFloat64(d.size[1]),m.writeFloat64(d.size[2]),m.writeFloat32(d.speed),E(d.color[0],m),E(d.color[1],m),E(d.color[2],m);break;case 241:m.writeFloat32(d.radius),m.writeFloat32(d.speed),m.writeFloat32(d.ringCountFactor),E(d.color,m);break;case 244:m.writeWString(d.dataPath),m.writeUint32(d.minLevel),m.writeUint32(d.maxLevel),m.writeFloat64(d.altitude),m.writeFloat64(d.altitudeScale),m.writeWString(d.loadTableName),m.writeUint16(d.loadLayerIndex),m.writeUint8(d.use_clip_rect?1:0),m.writeUint8(null==d.show_top||d.show_top?1:0),m.writeUint8(null==d.wall_loop||d.wall_loop?1:0),m.writeFloat32(null==d.customMinValue?1:d.customMinValue),m.writeFloat32(null==d.customMaxValue?-1:d.customMaxValue);break;case 284:var _=m,p=d;_.writeUint32(p.Transparent),_.writeUint16(p.Grade.length);for(var f=0,S=p.Grade.length;f<S;++f)_.writeFloat64(p.Grade[f].grade),_.writeUint32(p.Grade[f].color);p.withDirection=null!=p.withDirection&&p.withDirection,_.writeUint8(p.withDirection?1:0),p.withDirection&&(E(p.fillcolor,_),E(p.linecolor,_),_.writeFloat32(p.linewidth),E(p.arrowcolor,_));break;case 308:m.writeWString(d.dataPath),m.writeUint32(d.minLevel),m.writeUint32(d.maxLevel),m.writeFloat64(d.altitude),m.writeFloat64(d.altitudeScale),m.writeUint32(d.particleSize),m.writeUint32(d.particlePixel),m.writeFloat32(d.speedFactor),m.writeUint8(d.is_2d?1:0),m.writeWString(d.loadTableName),d.is_2d?m.writeUint16(d.loadLayerIndex):(m.writeUint16(d.loadLayerStart),m.writeUint16(d.loadLayerEnd)),m.writeFloat32(d.customMinValue),m.writeFloat32(d.customMaxValue),m.writeUint8(d.use_clip_rect?1:0),m.writeUint16(d.use_depth_mode?1:0);break;case 324:m.writeFloat32(d.columnRadius),m.writeFloat32(d.columnHeight),m.writeFloat32(d.bannerWidth),m.writeFloat32(d.bannerHeight),m.writeWString(d.poleTexturePath),m.writeWString(d.bannerTexturePath);break;case 325:m.writeFloat32(d.radius),m.writeFloat32(d.speed),E(d.color,m),m.writeUint8(d.reverse),m.writeFloat32(d.visibleHeight),m.writeUint8(d.displayType),m.writeFloat32(d.backgroundAlpha),m.writeFloat32(d.lightningAlpha),m.writeUint8(d.shadow||0);break;case 327:l=d,(c=m).writeUint8(l.displayType),c.writeFloat32(l.radius),E(l.color,c),c.writeFloat32(l.speed),0==l.displayType?(c.writeFloat32(l.sliderCount),c.writeFloat32(l.sliderSizeFactor),c.writeUint8(l.reverse),c.writeFloat32(l.alpha)):2==l.displayType&&(c.writeFloat32(l.sliderCount),c.writeFloat32(l.alpha),E(l.backgroundColor,c));break;case 328:m.writeFloat32(d.radius),E(d.color,m),m.writeFloat32(d.factor),m.writeUint8(d.shadow);break;case 329:m.writeFloat32(d.radius),m.writeFloat32(d.farRadius),E(d.backgroundColor,m),E(d.farColor,m),m.writeFloat32(d.switchHeight),m.writeFloat32(d.uwrap),m.writeFloat32(d.vwrap),m.writeFloat32(d.xspeed),m.writeFloat32(d.yspeed),m.writeFloat32(d.brightness),m.writeFloat32(d.Alpha),m.writeUint8(d.shadow||0);break;case 330:var C=m,y=d;C.writeWString(y.widgetBlueprintName),C.writeFloat32(y.widgetPrivot[0]),C.writeFloat32(y.widgetPrivot[1]),C.writeFloat32(y.widgetSize[0]),C.writeFloat32(y.widgetSize[1]),C.writeUint8(y.widgetSpace);for(var w=y.poi_texts?y.poi_texts[0]:0,T=(C.writeUint32(w),0),P=0;P<w;++P)C.writeWString(y.poi_texts[1+T]),C.writeWString(y.poi_texts[2+T]),C.writeWString(y.poi_texts[3+T]),C.writeInt32(y.poi_texts[4+T]),C.writeInt32(y.poi_texts[5+T]),C.writeFloat32(y.poi_texts[6+T]),C.writeInt32(y.poi_texts[7+T]),E(y.poi_texts[8+T],C),E(y.poi_texts[9+T],C),C.writeFloat32(y.poi_texts[10+T][0]),C.writeFloat32(y.poi_texts[10+T][1]),E(y.poi_texts[11+T],C),C.writeFloat32(y.poi_texts[12+T]),T+=12;for(w=y.poi_images?y.poi_images[0]:0,C.writeUint32(w),P=T=0;P<w;++P)C.writeWString(y.poi_images[1+T]),C.writeWString(y.poi_images[2+T]),E(y.poi_images[3+T],C),T+=3;break;case 331:m.writeWString(d.niagara_asset_path);var D=d.float_params?d.float_params.length/2:0;m.writeUint32(D);for(g=0;g<D;++g)m.writeWString(d.float_params[2*g]),m.writeFloat32(d.float_params[2*g+1]);m.writeUint8(d.supports_large_world_coordinates||0);break;case 332:m.writeFloat64(d.WeightValue),m.writeFloat64(d.TopTextRotX),m.writeFloat64(d.TopTextRotY),m.writeFloat64(d.TopTextRotZ),m.writeFloat64(d.BottomTextRotX),m.writeFloat64(d.BottomTextRotY),m.writeFloat64(d.BottomTextRotZ),m.writeWString(d.TopText),m.writeWString(d.BottomText),E(d.AlarmCircleColor,m),E(d.TopTextColor,m),E(d.BottomTextColor,m),m.writeUint8(d.IsCuboid,m),m.writeFloat64(d.Alpha,m);break;case 333:m.writeFloat32(d.Radius),m.writeFloat32(d.SpeedX),m.writeFloat32(d.SpeedY),m.writeUint8(d.shadow||0);break;case 334:m.writeUint8(d.DrawType),m.writeFloat64(d.Curvature),E(d.Color,m),m.writeFloat64(d.Speed),m.writeFloat64(d.LineScale),m.writeFloat64(d.BaseOpacity),m.writeUint8(d.DrawSpline);break;case 335:m.writeUint8(d.Style),m.writeUint8(d.SplineType),m.writeUint8(d.MeshDirection),m.writeFloat64(d.Width),m.writeFloat64(d.Tilling),m.writeFloat64(d.Speed),m.writeUint8(d.Loop),m.writeUint8(d.DrawSpline);break;case 336:m.writeUint8(d.DrawType),m.writeFloat64(d.Curvature),E(d.Color,m),m.writeFloat64(d.Speed),m.writeFloat64(d.LineScale),m.writeFloat64(d.BaseOpacity),m.writeFloat64(d.CircleScale),m.writeUint8(d.CircleAHide),m.writeUint8(d.CircleBHide),m.writeUint8(d.DrawSpline);break;case 337:m.writeWString(d.rootPath),m.writeWString(d.blueprintLink),m.writeUint32(d.ParamArray.length);for(var v=0,I=d.ParamArray.length;v<I;++v)m.writeWString(d.ParamArray[v][0]),m.writeWString(d.ParamArray[v][1]);break;case 412:s=d,(o=m).writeFloat64(s.Stride),o.writeUint32(s.Color),o.writeFloat32(s.lableBaseHeight),o.writeFloat32(s.lableDes),o.writeUint32(s.InfoColor),o.writeFloat32(s.fontWidth),o.writeFloat32(s.fontHeight);break;case 309:case 413:var b=m,F=d;b.writeFloat32(F.Radius),b.writeInt32(F.Density),b.writeFloat64(F.Altitude),b.writeFloat64(F.Weight),b.writeUint8(F.AltitudeType),b.writeWString(F.DataPath),b.writeUint16(F.PtData.length);for(var L=0,R=F.PtData.length;L<R;++L)b.writeFloat64(F.PtData[L]);for(b.writeUint16(F.Grade.length),L=0,R=F.Grade.length;L<R;++L)b.writeFloat64(F.Grade[L].grade),b.writeUint32(F.Grade[L].color);break;case 415:o=m,E((r=d).fillcolor,o),o.writeUint8(r.ShowSide?1:0),o.writeUint32(r.Wave),o.writeFloat32(r.BottomHeight),o.writeFloat32(r.TopHeight),o.writeUint32(r.Time),E(null==r.watercolor?4279242768:r.watercolor,o);break;case 568:r=m,E((i=d).fillcolor,r),E(i.linecolor,r),r.writeFloat32(i.linewidth),E(i.arrowcolor,r);break;case 320:m.writeUint16(d.geomRtti),m.writeWString(d.symbolId),E(d.fillcolor,m),E(d.linecolor,m),m.writeFloat32(d.linewidth),m.writeUint8(parseInt(d.shadow)),m.writeUint16(parseInt(null!=d.drawOrder?d.drawOrder:0)),m.writeWString(null==d.texturePath||d.texturePath instanceof Array?"":d.texturePath)}return m.writeFloat32(null==d.ShapeToolLineWidth?2:d.ShapeToolLineWidth),E(null==d.ShapeToolLineColor?"#ffff0000":d.ShapeToolLineColor,m),E(null==d.ShapeToolFillColor?"#44009900":d.ShapeToolFillColor,m),m}function t(e,t){return l(e,t).ValidData()}function n(e,t){var n=e[2],e=new Q(e,t);return e.writeString(n),e.ValidData()}function a(e,t){t=new Q(e,t);return t.writeString(e[2]),t.writeUint8(e[3]||0),t.writeUint32(e[4]||0),t.ValidData()}function i(e,t){t=new Q(e,t);return t.writeString(e[2]),t.writeFloat64(e[3]),t.writeFloat64(e[4]),t.ValidData()}function c(e,t,n,a){if(null==a&&!(e[e.length-1]instanceof Array)||null!=a&&!(a[a.length-1]instanceof Array))return m(e,t,n,a);var i=l(e,t,n,a);if(null==a)for(var r=e[e.length-1],o=(i.writeUint32(r[0]),3),s=1;s<r.length;++s){i.writeUint32(r[s]/3);for(var c=0;c<r[s];++c)i.writeFloat64(e[o++])}else for(r=a[a.length-1],o=(i.writeUint32(r[0]),1),s=1;s<r.length;++s){i.writeUint32(r[s]/3);for(c=0;c<r[s];++c)i.writeFloat64(e[o++])}return i.ValidData()}function m(e,t,n,a){var i=l(e,t,n,a);if(i.writeUint32(1),null==a){i.writeUint32((e.length-3)/3);for(var r=3;r<e.length;++r)i.writeFloat64(e[r])}else{i.writeUint32((a.length-1)/3);for(r=1;r<a.length;++r)i.writeFloat64(a[r])}return i.ValidData()}function d(e,t,n,a){for(var i=l(e,t,n,a),r=null==a?e:a,o=null==a?3:1,s=o+3;o<s;++o)i.writeFloat64(r[o]);for(;o<r.length;++o)i.writeFloat32(r[o]);return i.ValidData()}function r(e,t,n,a){for(var i=l(e,t,n,a),r=null==a?e:a,o=(s=null==a?3:1)+3;s<o;++s)i.writeFloat64(r[s]);for(o=s+6;s<o;++s)i.writeFloat32(r[s]);if(i.writeUint32(1),null==a){i.writeUint32((e.length-s)/3);for(var s=3;s<e.length;++s)i.writeFloat64(e[s])}else{i.writeUint32((a.length-s)/3);for(s=1;s<a.length;++s)i.writeFloat64(a[s])}return i.ValidData()}function u(e,t){for(var n=new Q(e,t),a=0,i=2,r=e.length;i<r;++i)209!=e[i][0].type&&227!=e[i][0].type&&241!=e[i][0].type&&331!=e[i][0].type&&220!=e[i][0].type&&211!=e[i][0].type||a++;n.writeUint32(a);for(i=2,r=e.length;i<r;++i)209==e[i][0].type||227==e[i][0].type||241==e[i][0].type||331==e[i][0].type?d(e,t,n,e[i]):220==e[i][0].type?m(e,t,n,e[i]):211==e[i][0].type&&c(e,t,n,e[i]);return n.ValidData()}function g(e,t){for(var n=new Q(e,t),a=2,i=a+3;a<i;++a)n.writeFloat64(e[a]);for(;a<e.length;++a)n.writeFloat32(e[a]);return n.ValidData()}function h(e,t){var n=new Q(e,t),a=(n.writeString(e[2]),n.writeUint8(e[3]),4);if(0==e[3]){for(var i=a+3;a<i;++a)n.writeFloat64(e[a]);for(;a<e.length;++a)n.writeFloat32(e[a])}else for(n.writeUint32(1),n.writeUint32((e.length-a)/3);a<e.length;++a)n.writeFloat64(e[a]);return n.ValidData()}function _(e,t){for(var n=new Q(e,t),a=(n.writeWString(e[2]),3),i=a+3;a<i;++a)n.writeFloat64(e[a]);for(;a<e.length;++a)n.writeFloat32(e[a]);return n.ValidData()}function p(e,t){t=new Q(e,t);return t.writeWString(e[2]),t.writeUint8(e[3]),t.writeFloat64(null==e[4]?10:e[4]),E(null==e[5]?"#FFFFFFFF":e[5],t),t.ValidData()}function f(e,t){t.location=e.location,t.rotaion=e.rotaion,t.scale=e.scale}},W.environment_interface=function(e,t){var r,n,a,i,o,s,c,l,m,d,u,g,h,_,p,f,S,C;return null!=e.environment_interface?e.environment_interface:((r=e.handlers.get(t.StampPixelStreamingHandleType.StampType_Environment)).CommandType={EnvironmentCommand_GetRootPath:0,EnvironmentCommand_GetTerrainTransparency:1,EnvironmentCommand_SetTerrainTransparency:2,EnvironmentCommand_GetEnableObserver:3,EnvironmentCommand_SetEnableObserver:4,EnvironmentCommand_SetSunDataTime:5,EnvironmentCommand_GetDayDuration:6,EnvironmentCommand_SetDayDuration:7,EnvironmentCommand_GetSceneControllersValid:8,EnvironmentCommand_SetHighlightColor:9,EnvironmentCommand_SetGlobalTerrainProject:10,EnvironmentCommand_SetGlobalTerrainProjectType:11,EnvironmentCommand_SetGlobalContourParam:12,EnvironmentCommand_SetGlobalSlopeParam:13,EnvironmentCommand_SetGlobalSlopeDirectionParam:14,EnvironmentCommand_GetSetKeyMovingVolocity:15,EnvironmentCommand_EnableLighting:16,EnvironmentCommand_GetSunDataTime:17,EnvironmentCommand_DraftEffect:18,EnvironmentCommand_NightVision:19,EnvironmentCommand_BlackAndWhite:20,EnvironmentCommand_OutlineEffect:21,EnvironmentCommand_CastShadow:22,EnvironmentCommand_GetRosyDawnAndEveningGlowTime:23,EnvironmentCommand_SetInfoPositionColorSize:24,EnvironmentCommand_GetEncoderQP:25,EnvironmentCommand_SetEncoderQP:26,EnvironmentCommand_GetTonmapGamma:27,EnvironmentCommand_SetTonmapGamma:28,EnvironmentCommand_SetNavigatorWindowVisibility:29,EnvironmentCommand_SetRollDomLayers:30,EnvironmentCommand_SetRollDomSplitPos:31,EnvironmentCommand_MaskEffect:32,EnvironmentCommand_RightButtonClick:33,EnvironmentCommand_TouchScale:34},n=function(t,e){var n=new Q(t,e);for(let e=2;e<t.length;++e)n.writeUint32(t[e]);return n.ValidData()},a=function(t,e){var n=new Q(t,e);for(let e=2;e<t.length;++e)n.writeUint8(t[e]?1:0);return n.ValidData()},i=function(e,t){t=new Q(e,t);return t.writeUint32(e[2]),t.writeUint32(e[3]),t.writeFloat64(e[4]),t.writeFloat64(e[5]),t.ValidData()},o=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeFloat64(n),e.writeUint32(a),e.ValidData()},s=function(e,t){var n=e[2],a=e[3],i=e[4],r=new Q(e,t),o=(r.writeUint32(n),a.length);r.writeUint16(o);for(var s=0;s<o;++s)r.writeFloat64(a[s].grade),r.writeUint32(a[s].color);return r.writeUint8(i?1:0),r.ValidData()},r.interface.get_root_path=function(){r.create_custom_command(r.CommandType.EnvironmentCommand_GetRootPath,t.GetNoParamCommandPackData)},r.interface.get_terrain_pransparency=function(){r.create_custom_command(r.CommandType.EnvironmentCommand_GetTerrainTransparency,t.GetNoParamCommandPackData)},r.interface.set_terrain_pransparency=function(e){r.create_custom_command(r.CommandType.EnvironmentCommand_SetTerrainTransparency,n,e)},r.interface.get_enable_observer=function(){r.create_custom_command(r.CommandType.EnvironmentCommand_GetEnableObserver,t.GetNoParamCommandPackData)},r.interface.set_enable_observer=function(e){r.create_custom_command(r.CommandType.EnvironmentCommand_SetEnableObserver,a,e)},c=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=e[6],s=e[7],c=null!=e[8]&&e[8],e=new Q(e,t);return e.writeUint32(n),e.writeUint32(a),e.writeUint32(i),e.writeUint32(r),e.writeUint32(o),e.writeUint32(s),e.writeUint8(c?1:0),e.ValidData()},r.interface.set_sun_data_time=function(e){r.create_custom_command(r.CommandType.EnvironmentCommand_SetSunDataTime,c,e)},r.interface.get_day_duration=function(){r.create_custom_command(r.CommandType.EnvironmentCommand_GetDayDuration,t.GetNoParamCommandPackData)},r.interface.set_day_duration=function(e){r.create_custom_command(r.CommandType.EnvironmentCommand_SetDayDuration,n,e)},r.interface.get_scene_controllers_valid=function(){r.create_custom_command(r.CommandType.EnvironmentCommand_GetSceneControllersValid,t.GetNoParamCommandPackData)},r.interface.set_highlight_color=function(e,t,n,a){r.create_custom_command(r.CommandType.EnvironmentCommand_SetHighlightColor,i,[e=null==e?2164195328:e,t=null==t?4288217088:t,n=null==n?10:n,a=null==a?.5:a])},r.interface.set_global_terrain_project=function(e){r.create_custom_command(r.CommandType.EnvironmentCommand_SetGlobalTerrainProject,a,[e])},r.interface.set_global_terrain_project_type=function(e){r.create_custom_command(r.CommandType.EnvironmentCommand_SetGlobalTerrainProjectType,n,[e])},r.interface.set_global_contour_param=function(e,t){r.create_custom_command(r.CommandType.EnvironmentCommand_SetGlobalContourParam,o,[e,t])},r.interface.set_global_slope_param=function(e,t,n){r.create_custom_command(r.CommandType.EnvironmentCommand_SetGlobalSlopeParam,s,[e,t,null!=n])},r.interface.set_global_slope_direction_param=function(e){r.create_custom_command(r.CommandType.EnvironmentCommand_SetGlobalSlopeDirectionParam,n,[e])},r.interface.enable_lighting=function(e){r.create_custom_command(r.CommandType.EnvironmentCommand_EnableLighting,a,[e])},r.interface.draft_effect=function(e,t,n){r.create_custom_command(r.CommandType.EnvironmentCommand_DraftEffect,a,[e,t,n])},r.interface.night_vision=function(e){r.create_custom_command(r.CommandType.EnvironmentCommand_NightVision,a,[e])},l=function(e,t){t=new Q(e,t);return t.writeUint8(e[2]?1:0),t.writeFloat32(e[3]),t.ValidData()},r.interface.black_and_white=function(e,t){r.create_custom_command(r.CommandType.EnvironmentCommand_BlackAndWhite,l,[e,t])},m=function(e,t){t=new Q(e,t);return t.writeUint8(e[2]?1:0),t.writeUint32(e[3]),t.writeFloat32(e[4]),t.ValidData()},r.interface.outline=function(e,t,n){r.create_custom_command(r.CommandType.EnvironmentCommand_OutlineEffect,m,[e,t,n])},d=function(e,t){t=new Q(e,t);return t.writeUint8(e[2]?1:0),t.writeWString(e[3]),t.writeInt32(e[4]),t.writeInt32(e[5]),t.writeFloat32(e[6]),t.ValidData()},r.interface.mask=function(e,t,n,a,i){r.create_custom_command(r.CommandType.EnvironmentCommand_MaskEffect,d,[e,t,n,a,i])},u=function(e,t){var t=new Q(e,t),n=e[2]?1:0;return t.writeUint8(n),e[2]&&t.writeFloat64(e[3]),t.ValidData()},r.interface.set_key_moving_volocity=function(e){r.create_custom_command(r.CommandType.EnvironmentCommand_GetSetKeyMovingVolocity,u,e)},r.interface.get_sun_data_time=function(){r.create_custom_command(r.CommandType.EnvironmentCommand_GetSunDataTime,t.GetNoParamCommandPackData)},g=function(e,t){t=new Q(e,t);return t.writeUint8(e[2]?1:0),e[2]&&t.writeUint8(e[3]?1:0),t.ValidData()},r.interface.cast_shadow=function(e){r.create_custom_command(r.CommandType.EnvironmentCommand_CastShadow,g,e)},r.interface.get_rosy_dawn_and_evening_glow_time=function(){r.create_custom_command(r.CommandType.EnvironmentCommand_GetRosyDawnAndEveningGlowTime,t.GetNoParamCommandPackData)},h=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=e[6],e=new Q(e,t);return e.writeFloat32(n),e.writeFloat32(a),e.writeUint32(r),e.writeUint32(o),e.writeUint32(i),e.ValidData()},r.interface.set_info_position_color_size=function(e,t,n,a,i){r.create_custom_command(r.CommandType.EnvironmentCommand_SetInfoPositionColorSize,h,[e,t,n,a,i])},r.interface.get_encoder_qp=function(){r.create_custom_command(r.CommandType.EnvironmentCommand_GetEncoderQP,t.GetNoParamCommandPackData)},_=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeInt32(n),e.writeInt32(a),e.ValidData()},r.interface.set_encoder_qp=function(e,t){r.create_custom_command(r.CommandType.EnvironmentCommand_SetEncoderQP,_,[e,t])},r.interface.get_tonemap_gamma=function(){r.create_custom_command(r.CommandType.EnvironmentCommand_GetTonmapGamma,t.GetNoParamCommandPackData)},p=function(e,t){var n=e[2],e=new Q(e,t);return e.writeInt8(n?1:0),e.ValidData()},r.interface.set_tonemap_gamma=function(e){r.create_custom_command(r.CommandType.EnvironmentCommand_SetTonmapGamma,p,[e])},f=function(e,t){var n=e[2],e=new Q(e,t);return e.writeInt8(n?1:0),e.ValidData()},r.interface.set_navigator_window_visibility=function(e){r.create_custom_command(r.CommandType.EnvironmentCommand_SetNavigatorWindowVisibility,f,[e])},S=function(e,t){var n=new Q(e,t),a=e[2];n.writeInt32(a);for(var i=0;i<a;++i)n.writeWString(e[3+2*i]),n.writeInt32(e[4+2*i]);return n.ValidData()},r.interface.set_roll_dom_layers=function(e){r.create_custom_command(r.CommandType.EnvironmentCommand_SetRollDomLayers,S,e)},C=function(e,t){t=new Q(e,t);return t.writeFloat32(e[2]),t.ValidData()},r.interface.set_roll_dom_split_pos=function(e){r.create_custom_command(r.CommandType.EnvironmentCommand_SetRollDomSplitPos,C,[e])},r.interface.right_button_click=function(){r.create_custom_command(r.CommandType.EnvironmentCommand_RightButtonClick,t.GetNoParamCommandPackData)},r.interface.touch_screen_scale=function(e){r.create_custom_command(r.CommandType.EnvironmentCommand_TouchScale,C,[e=e||1])},r.RespondType={EnvironmentRespond_EnvironmentGet:0},r.create_sub_handler(r.RespondType.EnvironmentRespond_EnvironmentGet,function(e){r.interface.OnEnvironmentGet&&r.interface.OnEnvironmentGet(e)}),r.interface.OnEnvironmentGet=void 0,e.environment_interface=r.interface,r.interface)},V.gb28181_camera_manager_interface=function(e,t){var n,a;return null!=e.gb28181_camera_manager_interface?e.gb28181_camera_manager_interface:((n=e.handlers.get(t.StampPixelStreamingHandleType.StampType_Gb28181CameraManager)).CommandType={Gb28181Command_QueryGB28181DeviceInfo:0,Gb28181Command_SetCameraAngleAndPosition:1,Gb28181Command_SetCustomName:2,Gb28181Command_SetCivilCode:3,Gb28181Command_SetDisFlag:4,Gb28181Command_GetCameraAngleAndPosition:5,Gb28181Command_UpdateFieldData:6,Gb28181Command_QueryFieldData:7},a=function(e,t){t=new Q(e,t);return t.writeWString(e[2]),t.writeWString(e[3]),t.writeInt32(e[4]),t.writeInt32(e[5]),t.ValidData()},n.interface.query_gb28181_device_info=function(e){n.create_custom_command(n.CommandType.Gb28181Command_QueryGB28181DeviceInfo,a,e)},n.interface.set_camera_angle_and_position=function(e){n.create_custom_command(n.CommandType.Gb28181Command_SetCameraAngleAndPosition,a,e)},n.interface.set_custom_name=function(e){n.create_custom_command(n.CommandType.Gb28181Command_SetCustomName,a,e)},n.interface.set_civil_code=function(e){n.create_custom_command(n.CommandType.Gb28181Command_SetCivilCode,a,e)},n.interface.set_dis_flag=function(e){n.create_custom_command(n.CommandType.Gb28181Command_SetDisFlag,a,e)},n.interface.get_camera_angle_and_position=function(e){n.create_custom_command(n.CommandType.Gb28181Command_GetCameraAngleAndPosition,a,e)},n.interface.update_field_data=function(e){n.create_custom_command(n.CommandType.Gb28181Command_UpdateFieldData,a,e)},n.interface.query_field_data=function(e){n.create_custom_command(n.CommandType.Gb28181Command_QueryFieldData,a,e)},n.RespondType={Gb28181Respond_OnGB28181DeviceInfo:0},n.create_sub_handler(n.RespondType.Gb28181Respond_OnGB28181DeviceInfo,function(e){n.interface.OnGB28181DeviceInfo&&n.interface.OnGB28181DeviceInfo(e)}),n.interface.OnGB28181DeviceInfo=void 0,e.gb28181_camera_manager_interface=n.interface,n.interface)},H.geology_interface=function(e,t){if(null!=e.geology_interface)return e.geology_interface;var s=e.handlers.get(t.StampPixelStreamingHandleType.StampType_GeologyInterface);function a(e,t){var n=e[2],a=e[3],i=e[4],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.writeInt32(i),e.ValidData()}function n(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.ValidData()}function o(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=e[6],s=e[7],e=new Q(e,t);return e.writeWString(n),e.writeFloat64(a),e.writeFloat64(i),e.writeFloat64(r),e.writeFloat64(o),e.writeUint8(s?1:0),e.ValidData()}function c(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=e[6],s=e[7],c=e[8],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.writeFloat64(i),e.writeFloat64(r),e.writeFloat64(o),e.writeFloat64(s),e.writeUint8(c?1:0),e.ValidData()}function i(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.writeWString(i),e.writeUint8(r?1:0),e.ValidData()}function r(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeFloat64(a),e.ValidData()}function l(e,t){var n=e[2],a=e[3],i=e[4],e=new Q(e,t);return e.writeWString(n),e.writeUint8(a?1:0),e.writeFloat64(i),e.ValidData()}function m(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeUint8(a?1:0),e.ValidData()}function d(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeUint32(a),e.ValidData()}function u(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.writeWString(i),e.writeFloat64(r),e.ValidData()}s.CommandType={Interface_LoadDrillsByProject:0,Interface_UnLoadDrillsByProject:1,Interface_CreateSoilLayerByCustom:2,Interface_CreateSoilLayerByProject:3,Interface_GetSoilLayers:4,Interface_RemoveGeologicalbody:5,Interface_ClampDrillByBH:6,Interface_SetDrillVisible:7,Interface_SeparateSoilLayer:8,Interface_HorizontalCutSoilLayer:9,Interface_VerticalCutSoilLayer:10,Interface_GetLayerProfile:11,Interface_GetDrillsProfile:12,Interface_GetTableNames:13,Interface_HasData:14,Interface_GetGeologicalbodyList:15,Interface_GetSoilInfos:16,Interface_GetHolesDemHeightByBH:17,Interface_ResetGeomodelVisible:18,Interface_SetHoleRatio:19,Interface_CreateDrillsProfile:20,Interface_GetMainLayerLines:21,Interface_SetSoilLayerTransparency:22},s.interface.load_drills_by_project=function(e,t,n){s.create_custom_command(s.CommandType.Interface_LoadDrillsByProject,a,[e,t,n])},s.interface.unload_drills_by_project=function(e,t){s.create_custom_command(s.CommandType.Interface_UnLoadDrillsByProject,n,[e,t])},s.interface.create_soil_layer_by_custom=function(e,t,n,a,i,r){s.create_custom_command(s.CommandType.Interface_CreateSoilLayerByCustom,o,[e,t,n,a,i,r])},s.interface.create_soil_layer_by_project=function(e,t,n,a,i,r,o){s.create_custom_command(s.CommandType.Interface_CreateSoilLayerByProject,c,[e,t,n,a,i,r,o])},s.interface.get_soil_layers=function(e,t){s.create_custom_command(s.CommandType.Interface_GetSoilLayers,n,[e,t])},s.interface.remove_geological_body=function(e,t){s.create_custom_command(s.CommandType.Interface_RemoveGeologicalbody,n,[e,t])},s.interface.clamp_drill_by_BH=function(e,t){s.create_custom_command(s.CommandType.Interface_ClampDrillByBH,n,[e,t])},s.interface.set_drill_visible=function(e,t,n,a){s.create_custom_command(s.CommandType.Interface_SetDrillVisible,i,[e,t,n,a])},s.interface.separate_soil_layer=function(e,t){s.create_custom_command(s.CommandType.Interface_SeparateSoilLayer,r,[e,t])},s.interface.horizontal_cut_soil_layer=function(e,t,n){s.create_custom_command(s.CommandType.Interface_HorizontalCutSoilLayer,l,[e,t,n])},s.interface.vertical_cut_soil_layer=function(e,t){s.create_custom_command(s.CommandType.Interface_VerticalCutSoilLayer,m,[e,t])},s.interface.get_layer_profile=function(e){s.create_custom_command(s.CommandType.Interface_GetLayerProfile,t.GetGuidCommandPackData,[e])},s.interface.get_drills_profile=function(e,t){s.create_custom_command(s.CommandType.Interface_GetDrillsProfile,n,[e,t])},s.interface.get_table_names=function(e){s.create_custom_command(s.CommandType.Interface_GetTableNames,t.GetGuidCommandPackData,[e])},s.interface.has_data=function(e){s.create_custom_command(s.CommandType.Interface_HasData,t.GetGuidCommandPackData,[e])},s.interface.get_geologicalbody_list=function(e){s.create_custom_command(s.CommandType.Interface_GetGeologicalbodyList,t.GetGuidCommandPackData,[e])},s.interface.get_soil_infos=function(e,t){s.create_custom_command(s.CommandType.Interface_GetSoilInfos,n,[e,t])},s.interface.get_holes_dem_height_by_bh=function(e,t){s.create_custom_command(s.CommandType.Interface_GetHolesDemHeightByBH,n,[e,t])},s.interface.reset_geomodel_visible=function(e){s.create_custom_command(s.CommandType.Interface_ResetGeomodelVisible,t.GetGuidCommandPackData,[e])},s.interface.set_hole_ratio=function(e,t){s.create_custom_command(s.CommandType.Interface_SetHoleRatio,r,[e,t])},s.interface.create_drills_profile=function(e,t){s.create_custom_command(s.CommandType.Interface_CreateDrillsProfile,n,[e,t])},s.interface.get_main_layer_lines=function(e,t){s.create_custom_command(s.CommandType.Interface_GetMainLayerLines,d,[e,t])},s.interface.set_soil_layer_transparency=function(e,t,n,a){s.create_custom_command(s.CommandType.Interface_SetSoilLayerTransparency,u,[e,t,n,a])},s.RespondType={InterfaceRespond_LoadDrillsFinished:0,InterfaceRespond_CreateSoilLayerFinished:1,InterfaceRespond_GetSoilLayers:2,InterfaceRespond_CutSoilLayerFinished:3,InterfaceRespond_GetProfile:4,InterfaceRespond_GetTableNames:5,InterfaceRespond_HasData:6,InterfaceRespond_GetGeologicalbodyList:7,InterfaceRespond_GetSoilInfos:8,InterfaceRespond_GetHolesDemHeightByBH:9};return s.create_sub_handler(s.RespondType.InterfaceRespond_LoadDrillsFinished,function(e){s.interface.OnLoadDrillsFinished&&s.interface.OnLoadDrillsFinished(e)}),s.create_sub_handler(s.RespondType.InterfaceRespond_CreateSoilLayerFinished,function(e){s.interface.OnCreateSoilLayerFinished&&s.interface.OnCreateSoilLayerFinished(e)}),s.create_sub_handler(s.RespondType.InterfaceRespond_GetSoilLayers,function(e){s.interface.OnGetSoilLayers&&s.interface.OnGetSoilLayers(e)}),s.create_sub_handler(s.RespondType.InterfaceRespond_CutSoilLayerFinished,function(e){s.interface.OnCutSoilLayerFinished&&s.interface.OnCutSoilLayerFinished(e)}),s.create_sub_handler(s.RespondType.InterfaceRespond_GetProfile,function(e){e=new TextDecoder("utf-16").decode(e),e=JSON.parse(e);s.interface.OnGetProfile&&s.interface.OnGetProfile(e)}),s.create_sub_handler(s.RespondType.InterfaceRespond_GetTableNames,function(e){s.interface.OnGetTableNames&&s.interface.OnGetTableNames(e)}),s.create_sub_handler(s.RespondType.InterfaceRespond_HasData,function(e){s.interface.OnHasData&&s.interface.OnHasData(e)}),s.create_sub_handler(s.RespondType.InterfaceRespond_GetGeologicalbodyList,function(e){s.interface.OnGetGeologicalbodyList&&s.interface.OnGetGeologicalbodyList(e)}),s.create_sub_handler(s.RespondType.InterfaceRespond_GetSoilInfos,function(e){s.interface.OnGetSoilInfos&&s.interface.OnGetSoilInfos(e)}),s.create_sub_handler(s.RespondType.InterfaceRespond_GetHolesDemHeightByBH,function(e){s.interface.OnGetHolesDemHeightByBH&&s.interface.OnGetHolesDemHeightByBH(e)}),s.interface.OnLoadDrillsFinished=void 0,s.interface.OnCreateSoilLayerFinished=void 0,s.interface.OnGetSoilLayers=void 0,s.interface.OnCutSoilLayerFinished=void 0,s.interface.OnGetProfile=void 0,s.interface.OnGetTableNames=void 0,s.interface.OnHasData=void 0,s.interface.OnGetGeologicalbodyList=void 0,s.interface.OnGetSoilInfos=void 0,s.interface.OnGetHolesDemHeightByBH=void 0,e.geology_interface=s.interface,s.interface},z.geometry_algorithm_interface=function(e,t){var l,o,i,r,a,s,c,m,d,u,n,g,h,_,p,f,S,C,y,w;return null!=e.geometry_algorithm_interface?e.geometry_algorithm_interface:((l=e.handlers.get(t.StampPixelStreamingHandleType.StampType_GeometryAlgorithmInterface)).CommandType={Interface_CreatePolygonBufferFromPolyline:0,Interface_CreatePolygonBufferFromPolygon:1,Interface_CreatePolygonFromPolylineAndWidth:2,Interface_CreatePolygonFromPolylineAndWidthWithHead:3,Interface_CreateParallelLine:4,Interface_CreateParallelPolygon:5,Interface_DistancePointLine:6,Interface_DistancePointSegment:7,Interface_CalculatePolygonDistance:8,Interface_CalculatePointPolygonDistance:9,Interface_CalculateLinePolygonDistance:10,Interface_CalculateLineLineDistance:11,Interface_CalculateLineLineSpaceDistance:12,Interface_CalculatePointPolylineDistance:13,Interface_CalculatePointPolylineSpaceDistance:14,Interface_CalculateSunElevationAndAzimuthAngle:15,Interface_CalculateSunriseAndSunset:16,Interface_CreatePolygonFromCircle:17,Interface_DouglasPeuckerSimplification:18,Interface_ReviseCurvePlote:19,Interface_FilletPolyline:20,Interface_CalcPose:21,Interface_CalculatePolylineAddInterpolation:22,Interface_SetPose:23,Interface_TransformSphrericalToCartesion:24,Interface_TransformCartesionToSphrerical:25,Interface_CalcHeading:26,Interface_CalculatePolygonArea:27,Interface_CalculatePolygonAreaSphr:28,Interface_GetPolygonPointSetRelationship:29,Interface_CalculateModelContour:30},o=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=e[6],s=e[7],e=new Q(e,t);return e.writeUint8(n?1:0),n?e.writeWString(a):e.writeLine(a),e.writeFloat64(i),e.writeUint32(r),e.writeUint32(o),e.writeUint32(s),e.ValidData()},i=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],e=new Q(e,t);return e.writeUint8(n?1:0),n?e.writeWString(a):e.writeLine(a),e.writeFloat64(i),e.writeFloat64(r),e.ValidData()},r=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],e=new Q(e,t);return e.writeUint8(n?1:0),n?e.writeWString(a):(e.writeLine(a),e.writeInt32(r)),e.writeFloat64(i),e.ValidData()},a=function(e,t){var n=e[2],a=e[3],i=e[4],e=new Q(e,t);return e.writePoint(n),e.writePoint(a),e.writePoint(i),e.ValidData()},s=function(e,t){var n=e[2],a=e[3],i=e[4],e=new Q(e,t);return e.writeUint8(n?1:0),n?(e.writeWString(a),e.writeWString(i)):(e.writeLine(a),e.writeLine(i)),e.ValidData()},c=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],e=new Q(e,t);return e.writeUint8(n?1:0),n?(e.writeWString(a),e.writeWString(i)):(e.writeLine(a),e.writeLine(i)),e.writeUint8(r?1:0),e.ValidData()},m=function(e,t){var n=e[2],a=e[3],i=e[4],e=new Q(e,t);return e.writeUint8(n?1:0),n?e.writeWString(a):e.writeLine(a),e.writePoint(i),e.ValidData()},d=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=e[6],s=e[7],c=e[8],l=e[9],m=e[10],e=new Q(e,t);return e.writeInt32(n),e.writeInt32(a),e.writeInt32(i),e.writeInt32(r),e.writeInt32(o),e.writeInt32(s),e.writeInt32(c),e.writeFloat64(l),e.writeFloat64(m),e.ValidData()},u=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=e[6],e=new Q(e,t);return e.writeInt32(n),e.writeInt32(a),e.writeInt32(i),e.writeFloat64(r),e.writeFloat64(o),e.ValidData()},l.interface.create_polygon_buffer_from_polyline=function(e,t,n,a,i,r){l.create_custom_command(l.CommandType.Interface_CreatePolygonBufferFromPolyline,o,[e,t,n,a,i,r])},l.interface.create_polygon_buffer_from_polygon=function(e,t,n,a,i){l.create_custom_command(l.CommandType.Interface_CreatePolygonBufferFromPolygon,o,[e,t,n,0,a,i])},l.interface.create_polygon_from_polyline_and_width=function(e,t,n,a){l.create_custom_command(l.CommandType.Interface_CreatePolygonFromPolylineAndWidth,i,[e,t,n,a])},l.interface.create_polygon_from_polyline_and_width_with_head=function(e,t,n,a){l.create_custom_command(l.CommandType.Interface_CreatePolygonFromPolylineAndWidthWithHead,i,[e,t,n,a])},l.interface.create_parallel_line=function(e,t,n,a){l.create_custom_command(l.CommandType.Interface_CreateParallelLine,r,[e,t,n,a])},l.interface.create_parallel_polygon=function(e,t,n,a){l.create_custom_command(l.CommandType.Interface_CreateParallelPolygon,r,[e,t,n,a])},l.interface.distance_point_line=function(e,t,n){l.create_custom_command(l.CommandType.Interface_DistancePointLine,a,[e,t,n])},l.interface.distance_point_segment=function(e,t,n){l.create_custom_command(l.CommandType.Interface_DistancePointSegment,a,[e,t,n])},l.interface.calculate_polygon_distance=function(e,t,n){l.create_custom_command(l.CommandType.Interface_CalculatePolygonDistance,s,[e,t,n])},l.interface.calculate_point_polygon_distance=function(e,t,n){l.create_custom_command(l.CommandType.Interface_CalculatePointPolygonDistance,m,[e,t,n])},l.interface.calculate_line_polygon_distance=function(e,t,n){l.create_custom_command(l.CommandType.Interface_CalculateLinePolygonDistance,s,[e,t,n])},l.interface.calculate_line_line_distance=function(e,t,n,a){l.create_custom_command(l.CommandType.Interface_CalculateLineLineDistance,c,[e,t,n,null!=a&&a])},l.interface.calculate_line_line_space_distance=function(e,t,n){l.create_custom_command(l.CommandType.Interface_CalculateLineLineSpaceDistance,s,[e,t,n])},l.interface.calculate_point_polyline_distance=function(e,t,n){l.create_custom_command(l.CommandType.Interface_CalculatePointPolylineDistance,m,[e,t,n])},l.interface.calculate_point_polyline_space_distance=function(e,t,n){l.create_custom_command(l.CommandType.Interface_CalculatePointPolylineSpaceDistance,m,[e,t,n])},l.interface.calculate_sun_elevation_and_azimuth_angle=function(e,t,n,a,i,r,o,s,c){l.create_custom_command(l.CommandType.Interface_CalculateSunElevationAndAzimuthAngle,d,[e,t,n,a,i,r,o,s,c])},l.interface.calculate_sunrise_and_sunset=function(e,t,n,a,i){l.create_custom_command(l.CommandType.Interface_CalculateSunriseAndSunset,u,[e,t,n,a,i])},n=function(e,t){t=new Q(e,t);return t.writeUint8(e[2]),t.writeInt32(e[3]),t.writeFloat64(e[4]),t.writeFloat64(e[5]),t.writeFloat64(e[6]),t.writeFloat64(e[7]),t.ValidData()},l.interface.create_polygon_from_circle=function(e){l.create_custom_command(l.CommandType.Interface_CreatePolygonFromCircle,n,e)},g=function(e,t){var n=new Q(e,t),a=(n.writeFloat64(e[2]),e[3]);n.writeUint32(a.length/3);for(var i=0;i<a.length;++i)n.writeFloat64(a[i]);return n.ValidData()},h=function(e,t){var n=new Q(e,t),a=(n.writeFloat64(e[2]),n.writeFloat64(e[3]),e[4]);n.writeUint32(a.length/3);for(var i=0;i<a.length;++i)n.writeFloat64(a[i]);return n.ValidData()},l.interface.douglas_peucker_simplification=function(e){l.create_custom_command(l.CommandType.Interface_DouglasPeuckerSimplification,g,e)},_=function(e,t){t=new Q(e,t);return t.writeLine(e[2]),t.writeUint8(e[3]?1:0),t.ValidData()},l.interface.revise_curve_plote=function(e){l.create_custom_command(l.CommandType.Interface_ReviseCurvePlote,_,e)},p=function(e,t){t=new Q(e,t);return t.writeLine(e[2]),t.writeFloat64(e[3]),t.writeFloat64(e[4]),t.writeUint8(e[5]?1:0),t.ValidData()},l.interface.fillet_polyline=function(e){l.create_custom_command(l.CommandType.Interface_FilletPolyline,p,e)},l.interface.calc_pose=function(e){l.create_custom_command(l.CommandType.Interface_CalcPose,_,e)},l.interface.calculate_polyline_add_interpolation=function(e){l.create_custom_command(l.CommandType.Interface_CalculatePolylineAddInterpolation,h,e)},f=function(e,t){for(var n=new Q(e,t),a=2,i=e.length;a<i;++a)n.writeFloat64(e[a]);return n.ValidData()},l.interface.set_pose=function(e,t,n,a,i,r,o,s,c){l.create_custom_command(l.CommandType.Interface_SetPose,f,[e,t,n,a,i,r,o,s,c])},S=function(e,t){t=new Q(e,t);return t.writeLine(e[2]),t.ValidData()},l.interface.transform_sphrerical_to_cartesion=function(e){l.create_custom_command(l.CommandType.Interface_TransformSphrericalToCartesion,S,[e])},l.interface.transform_cartesion_to_sphrerical=function(e){l.create_custom_command(l.CommandType.Interface_TransformCartesionToSphrerical,S,[e])},C=function(e,t){t=new Q(e,t);return t.writePoint(e[2]),t.writePoint(e[3]),t.ValidData()},l.interface.calc_heading=function(e,t){l.create_custom_command(l.CommandType.Interface_CalcHeading,C,[e,t])},l.interface.calc_polygon_area=function(e){l.create_custom_command(l.CommandType.Interface_CalculatePolygonArea,S,[e])},l.interface.calc_polygon_area_sphr=function(e){l.create_custom_command(l.CommandType.Interface_CalculatePolygonAreaSphr,S,[e])},y=function(e,t){t=new Q(e,t);return t.writeLine(e[2]),t.writeFloat64(e[3]),t.writeLine(e[4]),t.ValidData()},l.interface.get_polygon_point_set_relationship=function(e,t,n){l.create_custom_command(l.CommandType.Interface_GetPolygonPointSetRelationship,y,[e,t,n])},w=function(e,t){t=new Q(e,t);return t.writeWString(e[2]),t.writeUint8(e[3]?1:0),t.ValidData()},l.interface.calculate_model_contour=function(e,t){l.create_custom_command(l.CommandType.Interface_CalculateModelContour,w,[e,t])},l.RespondType={InterfaceRespond_OnGeometryAlgorithmFinished:0},l.create_sub_handler(l.RespondType.InterfaceRespond_OnGeometryAlgorithmFinished,function(e){e=new TextDecoder("utf-16").decode(e),e=JSON.parse(e);l.interface.OnGeometryAlgorithmFinished&&l.interface.OnGeometryAlgorithmFinished(e)}),l.interface.OnGeometryAlgorithmFinished=void 0,e.geometry_algorithm_interface=l.interface,l.interface)},N.global_control_interface=function(e,t){var c,l,n,a,i,r;return null!=e.global_control_interface?e.global_control_interface:(c=e.handlers.get(t.StampPixelStreamingHandleType.StampType_GlobalControlInterface),l=function(t,e){var n=new Q(t,e);for(let e=2;e<t.length;e++)n.writeFloat64(t[e]);return n.ValidData()},n=function(t,e){var n=new Q(t,e);for(let e=2;e<t.length;e++)n.writeUint8(t[e]?1:0);return n.ValidData()},a=function(t,e){var n=new Q(t,e);for(let e=2;e<5;e++)n.writeFloat64(t[e]);return n.writeInt32(t[5]),n.writeFloat64(t[6]),n.ValidData()},i=function(t,e){var n=new Q(t,e);for(let e=2;e<7;e++)n.writeFloat64(t[e]);return n.writeInt32(t[7]),n.writeFloat64(t[8]),n.ValidData()},c.CommandType={Interface_FlyToLookAtCommand:0,Interface_ForwardCommand:1,Interface_BackwardCommand:2,Interface_MoveLeftCommand:3,Interface_MoveRightCommand:4,Interface_TurnLeftCommand:5,Interface_TurnRightCommand:6,Interface_LookUpCommand:7,Interface_LookDownCommand:8,Interface_FlytoPoseCommand:9,Interface_FlytoLonLatRectCommand:10,Interface_GotoLookatCommand:11,Interface_GotoPoseCommand:12,Interface_GotoLonLatRectCommand:13,Interface_ZoomInCommand:14,Interface_ZoomOutCommand:15,Interface_ResumeCommand:16,Interface_NorthViewCommand:17,Interface_TopViewCommand:18,Interface_NorthTopViewCommand:19,Interface_StopCommand:20,Interface_UndergroundModeCommand:21,Interface_IntersectModeCommand:22,Interface_AutoRotateControlCommand:23,Interface_SurroundControlCommand:24,Interface_SurroundControlExCommand:25,Interface_TunnelModeCommand:26,Interface_EnableControlCommand:27,Interface_DoubleScreenSyncCommand:28,Interface_LookDownMinTiltCommand:29,Interface_GetLookDownMinTiltComman:30},c.interface.fly_to_lookat=function(e,t,n,a,i,r,o,s){c.create_custom_command(c.CommandType.Interface_FlyToLookAtCommand,l,[e,t,n,a,i,r,o,s])},c.interface.forward=function(){c.create_custom_command(c.CommandType.Interface_ForwardCommand,t.GetNoParamCommandPackData)},c.interface.backward=function(){c.create_custom_command(c.CommandType.Interface_BackwardCommand,t.GetNoParamCommandPackData)},c.interface.move_left=function(){c.create_custom_command(c.CommandType.Interface_MoveLeftCommand,t.GetNoParamCommandPackData)},c.interface.move_right=function(){c.create_custom_command(c.CommandType.Interface_MoveRightCommand,t.GetNoParamCommandPackData)},c.interface.turn_left=function(){c.create_custom_command(c.CommandType.Interface_TurnLeftCommand,t.GetNoParamCommandPackData)},c.interface.turn_right=function(){c.create_custom_command(c.CommandType.Interface_TurnRightCommand,t.GetNoParamCommandPackData)},c.interface.look_up=function(){c.create_custom_command(c.CommandType.Interface_LookUpCommand,t.GetNoParamCommandPackData)},c.interface.look_down=function(){c.create_custom_command(c.CommandType.Interface_LookDownCommand,t.GetNoParamCommandPackData)},c.interface.get_look_down_min_tilt=function(){c.create_custom_command(c.CommandType.Interface_GetLookDownMinTiltComman,t.GetNoParamCommandPackData)},c.interface.set_look_down_min_tilt=function(e){c.create_custom_command(c.CommandType.Interface_LookDownMinTiltCommand,l,e)},c.interface.fly_to_pose=function(e){c.create_custom_command(c.CommandType.Interface_FlytoPoseCommand,l,e)},c.interface.fly_to_lon_lat_rect=function(e){c.create_custom_command(c.CommandType.Interface_FlytoLonLatRectCommand,l,e)},c.interface.go_to_lookat=function(e){c.create_custom_command(c.CommandType.Interface_GotoLookatCommand,l,e)},c.interface.go_to_pose=function(e){c.create_custom_command(c.CommandType.Interface_GotoPoseCommand,l,e)},c.interface.go_to_lon_lat_rect=function(e){c.create_custom_command(c.CommandType.Interface_GotoLonLatRectCommand,l,e)},c.interface.zoom_in=function(){c.create_custom_command(c.CommandType.Interface_ZoomInCommand,t.GetNoParamCommandPackData)},c.interface.zoom_out=function(){c.create_custom_command(c.CommandType.Interface_ZoomOutCommand,t.GetNoParamCommandPackData)},c.interface.resume=function(){c.create_custom_command(c.CommandType.Interface_ResumeCommand,t.GetNoParamCommandPackData)},c.interface.north_view=function(){c.create_custom_command(c.CommandType.Interface_NorthViewCommand,t.GetNoParamCommandPackData)},c.interface.top_view=function(){c.create_custom_command(c.CommandType.Interface_TopViewCommand,t.GetNoParamCommandPackData)},c.interface.north_top_view=function(){c.create_custom_command(c.CommandType.Interface_NorthTopViewCommand,t.GetNoParamCommandPackData)},c.interface.stop=function(){c.create_custom_command(c.CommandType.Interface_StopCommand,t.GetNoParamCommandPackData)},c.interface.underground_mode=function(e){c.create_custom_command(c.CommandType.Interface_UndergroundModeCommand,n,e)},c.interface.intersect_mode=function(e){c.create_custom_command(c.CommandType.Interface_IntersectModeCommand,n,e)},c.interface.auto_rotate_control=function(e){c.create_custom_command(c.CommandType.Interface_AutoRotateControlCommand,a,e)},c.interface.surround_control=function(e){c.create_custom_command(c.CommandType.Interface_SurroundControlCommand,i,e)},c.interface.surround_control_ex=function(e){c.create_custom_command(c.CommandType.Interface_SurroundControlExCommand,l,e)},c.interface.tunnel_mode=function(e){c.create_custom_command(c.CommandType.Interface_TunnelModeCommand,n,e)},r=function(e,t){t=new Q(e,t);return t.writeUint8(e[2]),t.ValidData()},c.interface.double_screen_sync=function(e){c.create_custom_command(c.CommandType.Interface_DoubleScreenSyncCommand,r,e)},c.RespondType={InterfaceRespond_FlytoFinished:0,InterfaceRespond_ObserverChanged:1,InterfaceRespond_GotoLookAtFinished:2,InterfaceRespond_LookDownMinTilt:3,InterfaceRespond_ByteExample:4,InterfaceRespond_JsonExample:5,InterfaceRespond_XmlExample:5},c.create_sub_handler(c.RespondType.InterfaceRespond_FlytoFinished,function(e){c.interface.OnFlytoFinished&&c.interface.OnFlytoFinished(e,c.interface)}),c.create_sub_handler(c.RespondType.InterfaceRespond_ObserverChanged,function(e){c.interface.OnObserverChanged&&c.interface.OnObserverChanged(e,c.interface)}),c.create_sub_handler(c.RespondType.InterfaceRespond_GotoLookAtFinished,function(e){c.interface.OnGotoLookAtFinished&&c.interface.OnGotoLookAtFinished(e,c.interface)}),c.create_sub_handler(c.RespondType.InterfaceRespond_LookDownMinTilt,function(e){c.interface.OnLookDownMinTilt&&c.interface.OnLookDownMinTilt(e,c.interface)}),c.create_sub_handler(c.RespondType.InterfaceRespond_ByteExample,function(e,t){var e=new Float64Array(e),n=e[0],a=e[1],e=e[2];alert("byte x:"+n+" y:"+a+" z:"+e)}),c.create_sub_handler(c.RespondType.InterfaceRespond_JsonExample,function(e){alert("json "+e)}),c.create_sub_handler(c.RespondType.InterfaceRespond_XmlExample,function(e){alert("xml "+e)}),c.interface.OnFlytoFinished=void 0,c.interface.OnObserverChanged=void 0,c.interface.OnGotoLookAtFinished=void 0,c.interface.OnLookDownMinTilt=void 0,e.global_control_interface=c.interface,c.interface)},j.globe_observer_interface=function(e,t){var i,a,n;return null!=e.globe_observer_interface?e.globe_observer_interface:((i=e.handlers.get(t.StampPixelStreamingHandleType.StampType_GlobeObserverInterface)).CommandType={Interface_PickCommand:0,Interface_GetDEMHeightCommand:1,Interface_GetPoseCommand:2,Interface_GetTargetPoseCommand:3,Interface_GetOriginPoseCommand:4,Interface_ToScreenPosCommand:5},a=function(e,t){var n=e[2],a=e[3],i=e[4],e=new Q(e,t);return e.writeFloat64(n),e.writeFloat64(a),e.writeInt32(i),e.ValidData()},i.interface.pick=function(e,t,n){i.create_custom_command(i.CommandType.Interface_PickCommand,a,[e,t,n])},i.interface.get_dem_height=function(){i.create_custom_command(i.CommandType.Interface_GetDEMHeightCommand,t.GetNoParamCommandPackData)},i.interface.get_pose=function(){i.create_custom_command(i.CommandType.Interface_GetPoseCommand,t.GetNoParamCommandPackData)},i.interface.get_target_pose=function(){i.create_custom_command(i.CommandType.Interface_GetTargetPoseCommand,t.GetNoParamCommandPackData)},i.interface.get_origin_pose=function(){i.create_custom_command(i.CommandType.Interface_GetOriginPoseCommand,t.GetNoParamCommandPackData)},i.ToScreenPosOperator={ToScreenOnlyOnce:0,ToScreenChangedWithObserver:1,ToScreenStopWithObserver:2,ToScreenDeleteAllPoints:3},n=function(e,t){var n,t=new Q(e,t),a=e[2];return t.writeUint8(a),a!=i.ToScreenPosOperator.ToScreenDeleteAllPoints&&(n=e[3],t.writeWString(n)),a<i.ToScreenPosOperator.ToScreenStopWithObserver&&(n=e[4],a=e[5],e=e[6],t.writeFloat64(n),t.writeFloat64(a),t.writeFloat64(e)),t.ValidData()},i.interface.get_screen_pose=function(e){i.create_custom_command(i.CommandType.Interface_ToScreenPosCommand,n,e)},i.RespondType={InterfaceRespond_PickFinished:0,InterfaceRespond_DEMHeight:1,InterfaceRespond_Pose:2,InterfaceRespond_TargetPose:3,InterfaceRespond_OriginPose:4,InterfaceRespond_ToScreenPos:5},i.create_sub_handler(i.RespondType.InterfaceRespond_PickFinished,function(e){i.interface.OnPickFinished&&i.interface.OnPickFinished(e)}),i.create_sub_handler(i.RespondType.InterfaceRespond_DEMHeight,function(e){i.interface.OnPickFinished&&i.interface.OnPickFinished(e.alt)}),i.create_sub_handler(i.RespondType.InterfaceRespond_Pose,function(e){i.interface.OnGetPoseFinished&&i.interface.OnGetPoseFinished(e,i.interface)}),i.create_sub_handler(i.RespondType.InterfaceRespond_TargetPose,function(e){i.interface.OnGetTargetPoseFinished&&i.interface.OnGetTargetPoseFinished(e)}),i.create_sub_handler(i.RespondType.InterfaceRespond_OriginPose,function(e){i.interface.OnGetOriginPoseFinished&&i.interface.OnGetOriginPoseFinished(e)}),i.create_sub_handler(i.RespondType.InterfaceRespond_ToScreenPos,function(e){i.interface.OnToScreen&&i.interface.OnToScreen(e)}),i.interface.OnPickFinished=void 0,i.interface.OnGetPoseFinished=void 0,i.interface.OnGetTargetPoseFinished=void 0,i.interface.OnGetOriginPoseFinished=void 0,i.interface.OnToScreen=void 0,e.globe_observer_interface=i.interface,i.interface)},K.gps_interface=function(e,t){var p,i,n,a,r,o,s,c,u,l,m,d,f,g,h,_,S,C,y;return null!=e.gps_interface?e.gps_interface:((p=e.handlers.get(t.StampPixelStreamingHandleType.StampType_GPSInterface)).CommandType={Interface_GetNmeaList:0,Interface_CreateGPSTrackFromFile:1,Interface_CreateGPSTrackRealTime:2,Interface_DeleteGPSTrack:3,Interface_PickGPSTrack:4,Interface_SetMainGPSTrack:5,Interface_PlayGPSTrack:6,Interface_StopGPSTrack:7,Interface_PauseGPSTrack:8,Interface_ResumeGPSTrack:9,Interface_InitGPSFirstPersonTrack:10,Interface_InitGPSFollowTrack:11,Interface_SetGPSTrackType:12,Interface_AddPreGPS:13,Interface_SetStackSize:14,Interface_SetHeightType:15,Interface_SetSelected:16,Interface_SetTrackInfo:17,Interface_PlayGPSTrackRealTime:18,Interface_PlayGPSTrackRealTimeBatch:19,Interface_AddPreGPSBatch:20,Interface_StopGPSTrackBatch:21,Interface_DeleteGPSTrackBatch:22,Interface_StopGPSTrackRealTimeBatch:23,Interface_SetCustomData:24},i=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.writeFloat64(i),e.writeInt32(null==r?2:r),e.ValidData()},n=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeFloat64(a),e.ValidData()},a=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeInt32(n),e.writeInt32(a),e.ValidData()},r=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeInt32(a),e.ValidData()},o=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.writeInt32(i),e.writeUint8(r?1:0),e.ValidData()},s=function(e,t){var n=e[2],a=e[3],i=e[4],e=new Q(e,t);return e.writeWString(n),e.writeFloat64(a),e.writeFloat64(i),e.ValidData()},c=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=e[6],s=e[7],e=new Q(e,t);return e.writeWString(n),e.writeFloat64(a),e.writeFloat64(i),e.writeFloat64(r),e.writeFloat64(o),e.writeUint8(null!=s&&s?1:0),e.ValidData()},u=function(e,t){var n=2,a=e[n++],i=new Q(e,t),t=(i.writeWString(a),e[n++]),r=e[n++];if(i.writeUint8(r?1:0),t){var o=e[n++],s=e[n++],c=e[n++],l=r?9:7,m=Math.round(o.length/l);i.writeUint16(m);for(var d=0;d<m;++d){var u=0;i.writeFloat64(o[d*l+u++]),i.writeFloat64(o[d*l+u++]),i.writeFloat64(o[d*l+u++]),i.writeFloat64(r?o[d*l+u++]:0),i.writeFloat64(o[d*l+u++]),i.writeFloat64(o[d*l+u++]),i.writeFloat64(o[d*l+u++]),i.writeFloat64(r?o[d*l+u++]:0),i.writeUint32(o[d*l+u++])}}else{var a=e[n++],t=e[n++],g=e[n++],h=r?e[n++]:0,_=e[n++],p=e[n++],f=e[n++],S=r?e[n++]:0,C=e[n++],s=e[n++],c=e[n++];i.writeUint16(1),i.writeFloat64(a),i.writeFloat64(t),i.writeFloat64(g),i.writeFloat64(h),i.writeFloat64(_),i.writeFloat64(p),i.writeFloat64(f),i.writeFloat64(S),i.writeUint32(C)}return i.writeUint8(null==s||s?1:0),i.writeUint8(null!=c&&c?1:0),i.ValidData()},l=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeUint32(a),e.ValidData()},m=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeUint8(a),e.ValidData()},d=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=e[6],s=e[7],c=e[8],l=e[9],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.writeUint8(i?1:0),e.writeUint8(r?1:0),e.writeUint8(o?1:0),e.writeUint32(s),e.writeUint32(c),e.writeUint32(l),e.ValidData()},f=function(e,t){var n=2,a=e[n++],i=e[n++],r=e[n++],o=e[n++],s=e[n++],c=e[n++],l=e[n++],m=e[n++],d=e[n++],u=e[n++],g=e[n++],h=e[n++],_=e[n++],p=e[n++],n=e[+n],f=e[17],e=new Q(e,t);return e.writeWString(a),e.writeWString(i),e.writeWString(r),e.writeInt32(o),e.writeFloat64(s),e.writeInt32(c),e.writeUint32(l),e.writeWString(m),e.writeUint8(d?1:0),e.writeUint8(u?1:0),e.writeUint8(g?1:0),e.writeUint32(h),e.writeUint32(_),e.writeUint32(p),e.writeUint8(n?1:0),e.writeWString(f),e.ValidData()},g=function(e,t){for(var n=e[2],a=e[3],i="string"==typeof n[15],r=i?Math.round(n.length/14):Math.round(n.length/(a?16:15)),o=new Q(e,t),s=(o.writeUint16(r),0),c=0;c<r;++c){var l=n[s++],m=n[s++],d=n[s++],u=n[s++],g=n[s++],h=n[s++],_=n[s++],p=n[s++],f=n[s++],S=n[s++],C=n[s++],y=n[s++],w=n[s++],T=n[s++],P=!i&&n[s++],D=a?n[s++]:"";o.writeWString(l),o.writeWString(m),o.writeWString(d),o.writeInt32(u),o.writeFloat64(g),o.writeInt32(h),o.writeUint32(_),o.writeWString(p),o.writeUint8(f?1:0),o.writeUint8(S?1:0),o.writeUint8(C?1:0),o.writeUint32(y),o.writeUint32(w),o.writeUint32(T),o.writeUint8(P?1:0),o.writeWString(D)}return o.ValidData()},p.interface.get_nmea_list=function(){p.create_custom_command(p.CommandType.Interface_GetNmeaList,t.GetNoParamCommandPackData)},p.interface.create_gps_track_from_file=function(e,t,n,a){p.create_custom_command(p.CommandType.Interface_CreateGPSTrackFromFile,i,[e,t,n,a])},p.interface.create_gps_track_real_time=function(e,t){p.create_custom_command(p.CommandType.Interface_CreateGPSTrackRealTime,n,[e,t])},p.interface.delete_track=function(e){p.create_custom_command(p.CommandType.Interface_DeleteGPSTrack,t.GetGuidCommandPackData,[e])},p.interface.pick_track=function(e,t){p.create_custom_command(p.CommandType.Interface_PickGPSTrack,a,[e,t])},p.interface.set_main_track=function(e,t){p.create_custom_command(p.CommandType.Interface_SetMainGPSTrack,r,[e,t])},p.interface.play_track=function(e,t,n,a){p.create_custom_command(p.CommandType.Interface_PlayGPSTrack,o,[e,t,n,null!=a&&a])},p.interface.stop_track=function(e){p.create_custom_command(p.CommandType.Interface_StopGPSTrack,t.GetGuidCommandPackData,[e])},p.interface.pause_track=function(e){p.create_custom_command(p.CommandType.Interface_PauseGPSTrack,t.GetGuidCommandPackData,[e])},p.interface.resume_track=function(e){p.create_custom_command(p.CommandType.Interface_ResumeGPSTrack,t.GetGuidCommandPackData,[e])},p.interface.init_first_person_track=function(e,t,n){p.create_custom_command(p.CommandType.Interface_InitGPSFirstPersonTrack,s,[e,t,n])},p.interface.init_follow_track=function(e,t,n,a,i,r){p.create_custom_command(p.CommandType.Interface_InitGPSFollowTrack,c,[e,t,n,a,i,r])},p.interface.set_track_type=function(e,t){p.create_custom_command(p.CommandType.Interface_SetGPSTrackType,r,[e,t])},p.interface.add_pre_gps=function(e,t,n,a,i,r,o,s,c,l){p.create_custom_command(p.CommandType.Interface_AddPreGPS,u,[e,!1,!1,t,n,a,i,r,o,s,c,l])},p.interface.add_pre_gps_pt_batch=function(e,t,n,a){p.create_custom_command(p.CommandType.Interface_AddPreGPS,u,[e,!0,!1,t,n,a])},p.interface.add_pre_gps_with_heading=function(e,t,n,a,i,r,o,s,c,l,m,d){p.create_custom_command(p.CommandType.Interface_AddPreGPS,u,[e,!1,!0,t,n,a,i,r,o,s,c,l,m,d])},p.interface.add_pre_gps_pt_batch_with_heading=function(e,t,n,a){p.create_custom_command(p.CommandType.Interface_AddPreGPS,u,[e,!0,!0,t,n,a])},p.interface.set_stack_size=function(e,t){p.create_custom_command(p.CommandType.Interface_SetStackSize,l,[e,t])},h=function(e,t){var n=e[2],a=e[3],i=e[4],r=new Q(e,t),o=(r.writeWString(n),r.writeWString(null!=i?i:""),r.writeInt32(a),e[5]?e[5].length:0);r.writeUint32(o);for(var s=0;s<o;++s)r.writeWString(e[5][s]);return r.ValidData()},p.interface.set_height_type=function(e,t,n,a){p.create_custom_command(p.CommandType.Interface_SetHeightType,h,[e,t,n,a])},p.interface.set_track_selected=function(e,t){p.create_custom_command(p.CommandType.Interface_SetSelected,m,[e,t])},p.interface.set_track_info=function(e,t,n,a,i,r,o,s){p.create_custom_command(p.CommandType.Interface_SetTrackInfo,d,[e,t,n,a,i,r,o,s])},p.interface.play_gps_track_real_time=function(e,t,n,a,i,r,o,s,c,l,m,d,u,g,h,_){p.create_custom_command(p.CommandType.Interface_PlayGPSTrackRealTime,f,[e,t,n,a,i,r,o,s,c,l,m,d,u,g,null!=h&&h,null!=_?_:""])},p.interface.play_gps_track_real_time_batch=function(e,t){p.create_custom_command(p.CommandType.Interface_PlayGPSTrackRealTimeBatch,g,[e,t])},_=function(e,t){var n=e[2],a=new Q(e,t),i=n.length;a.writeUint16(i);for(var r=0;r<i;++r){var o=n[r];a.writeWString(o)}return a.ValidData()},p.interface.stop_track_batch=function(e){p.create_custom_command(p.CommandType.Interface_StopGPSTrackBatch,_,[e])},p.interface.delete_track_batch=function(e){p.create_custom_command(p.CommandType.Interface_DeleteGPSTrackBatch,_,[e])},S=function(e,t){var n=e[2],a=e[3],i=e[4],r=new Q(e,t),o=n.length;r.writeUint16(o);for(var s=0;s<o;++s){var c=n[s];r.writeWString(c)}return r.writeUint8(null!=a&&a?1:0),r.writeUint8(null!=i&&i?1:0),r.ValidData()},p.interface.stop_gps_track_real_time_batch=function(e,t,n){p.create_custom_command(p.CommandType.Interface_StopGPSTrackRealTimeBatch,S,[e,t,n])},C=function(e,t){var n=2,a=e[n++],i=e[n++],n=e[+n],r=e[5],o=new Q(e,t),s=i.length;o.writeUint16(s),o.writeUint8(a?1:0);for(var c=0;c<s;++c){var l=i[c][0],m=(o.writeWString(l),i[c][1]),d=a?9:7,u=Math.round(m.length/d);o.writeUint16(u);for(var g=0;g<u;++g){var h=0;o.writeFloat64(m[g*d+h++]),o.writeFloat64(m[g*d+h++]),o.writeFloat64(m[g*d+h++]),o.writeFloat64(a?m[g*d+h++]:0),o.writeFloat64(m[g*d+h++]),o.writeFloat64(m[g*d+h++]),o.writeFloat64(m[g*d+h++]),o.writeFloat64(a?m[g*d+h++]:0),o.writeUint32(m[g*d+h++])}}return o.writeUint8(null==n||n?1:0),o.writeUint8(null!=r&&r?1:0),o.ValidData()},p.interface.add_pre_gps_batch=function(e,t,n){p.create_custom_command(p.CommandType.Interface_AddPreGPSBatch,C,[!1,e,t,n])},p.interface.add_pre_gps_batch_with_heading=function(e,t,n){p.create_custom_command(p.CommandType.Interface_AddPreGPSBatch,C,[!0,e,t,n])},y=function(e,t){t=new Q(e,t);return t.writeWString(e[2]),t.writeFloat64(e[3]),t.writeFloat64(e[4]),t.writeFloat64(e[5]),t.ValidData()},p.interface.set_custom_data=function(e,t,n,a){p.create_custom_command(p.CommandType.Interface_SetCustomData,y,[e,t,n,a])},p.RespondType={InterfaceRespond_OnGPSTrackLoaded:0,InterfaceRespond_OnGPSTrackPicked:1,InterfaceRespond_OnGPSTrackFinished:2,InterfaceRespond_OnGetNmeaList:3,InterfaceRespond_OnGPSTrackStart:4,InterfaceRespond_ToSetCustomData:5},p.create_sub_handler(p.RespondType.InterfaceRespond_OnGPSTrackLoaded,function(e){e=new TextDecoder("utf-16").decode(e),e=JSON.parse(e);p.interface.OnGPSTrackLoaded&&p.interface.OnGPSTrackLoaded(e)}),p.create_sub_handler(p.RespondType.InterfaceRespond_OnGPSTrackPicked,function(e){p.interface.OnGPSTrackPicked&&p.interface.OnGPSTrackPicked(e)}),p.create_sub_handler(p.RespondType.InterfaceRespond_OnGPSTrackFinished,function(e){e=new TextDecoder("utf-16").decode(e),e=JSON.parse(e);p.interface.OnGPSTrackFinished&&p.interface.OnGPSTrackFinished(e)}),p.create_sub_handler(p.RespondType.InterfaceRespond_OnGetNmeaList,function(e){for(var t in p.interface.nmea_list=p.interface.nmea_list||{},e.nmeas){t=e.nmeas[t];t.guid in p.interface.nmea_list||(p.interface.nmea_list[t.guid]=t)}p.interface.OnGetNmeaList&&p.interface.OnGetNmeaList(e.nmeas)}),p.create_sub_handler(p.RespondType.InterfaceRespond_OnGPSTrackStart,function(e){e=new TextDecoder("utf-16").decode(e),e=JSON.parse(e);p.interface.OnGPSTrackStart&&p.interface.OnGPSTrackStart(e)}),p.create_sub_handler(p.RespondType.InterfaceRespond_ToSetCustomData,function(e){p.interface.ToSetCustomData&&p.interface.ToSetCustomData(e)}),p.interface.OnGPSTrackLoaded=void 0,p.interface.OnGPSTrackPicked=void 0,p.interface.OnGPSTrackFinished=void 0,p.interface.OnGetNmeaList=void 0,p.interface.OnGPSTrackStart=void 0,p.interface.ToSetCustomData=void 0,e.gps_interface=p.interface,p.interface)},Y.exponential_height_fog_interface=function(e,t){if(null!=e.exponential_height_fog_interface)return e.exponential_height_fog_interface;function i(e,t){e.writeFloat64(null!=t.r?t.r:t.x),e.writeFloat64(null!=t.g?t.g:t.y),e.writeFloat64(null!=t.b?t.b:t.z),e.writeFloat64(null!=t.a?t.a:t.w)}function n(e,t){var n,a,t=new Q(e,t),e=e[2];return n=e,a=BigInt(0),null!=n&&(null!=n.fogDensity&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_FogDensity)),null!=n.fogHeightFalloff&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_FogHeightFalloff)),null!=n.secondFogDensity&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_SecondFogDensity)),null!=n.secondFogHeightFallOff&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_SecondFogHeightFallOff)),null!=n.secondFogHeightOffset&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_SecondFogHeightOffset)),null!=n.fogMaxOpacity&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_FogMaxOpacity)),null!=n.fogInscatteringLuminance&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_FogInscatteringLuminance)),null!=n.directionalInscatteringLuminance&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_DirectionalInscatteringLuminance)),null!=n.startDistance&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_StartDistance)),null!=n.volumetricFogScatteringDistribution&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_VolumetricFogScatteringDistribution)),null!=n.volumetricFogAlbedo&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_VolumetricFogAlbedo)),null!=n.volumetricFogExtinctionScale&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_VolumetricFogExtinctionScale)),null!=n.volumetricFogDistance&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_VolumetricFogDistance)),null!=n.enableVolumetricFog&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_EnableVolumetricFog)),null!=n.overrideLightColorsWithFogInscatteringColors&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_OverrideLightColorsWithFogInscatteringColors)),null!=n.directionalInscatteringExponent&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_DirectionalInscatteringExponent)),null!=n.directinalInscatteringStartDistance&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_DirectionalInscatteringStartDistance)),null!=n.fogCuttoffDistance&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_FogCuttoffDistance)),null!=n.volumetricFogEmissive&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_VolumetricFogEmissive)),null!=n.volumetricFogStartDistance&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_VolumetricFogStartDistance)),null!=n.volumetricFogNearFadeInDistance&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_VolumetricFogNearFadeInDistance)),null!=n.volumetricFogStaticLightingScatteringIntensity&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_VolumetricFogStaticLightingScatteringIntensity)),null!=n.visibility&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_SetVisibility)),null!=n.useDefault&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_SetUseDefault)),null!=n.visibleHeight)&&(a+=BigInt(1)<<BigInt(r.PixelStreaminStampExponentialHeightFogSetDataType.FogCommandSetData_VisibleHeight)),t.writeUint64(a),null!=e&&(null!=e.fogDensity&&t.writeFloat32(e.fogDensity),null!=e.fogHeightFalloff&&t.writeFloat32(e.fogHeightFalloff),null!=e.secondFogDensity&&t.writeFloat32(e.secondFogDensity),null!=e.secondFogHeightFallOff&&t.writeFloat32(e.secondFogHeightFallOff),null!=e.secondFogHeightOffset&&t.writeFloat32(e.secondFogHeightOffset),null!=e.fogMaxOpacity&&t.writeFloat32(e.fogMaxOpacity),null!=e.fogInscatteringLuminance&&i(t,e.fogInscatteringLuminance),null!=e.directionalInscatteringLuminance&&i(t,e.directionalInscatteringLuminance),null!=e.startDistance&&t.writeFloat32(e.startDistance),null!=e.volumetricFogScatteringDistribution&&t.writeFloat32(e.volumetricFogScatteringDistribution),null!=e.volumetricFogAlbedo&&t.writeUint32(e.volumetricFogAlbedo),null!=e.volumetricFogExtinctionScale&&t.writeFloat32(e.volumetricFogExtinctionScale),null!=e.volumetricFogDistance&&t.writeFloat32(e.volumetricFogDistance),null!=e.enableVolumetricFog&&t.writeUint8(e.enableVolumetricFog?1:0),null!=e.overrideLightColorsWithFogInscatteringColors&&t.writeUint8(e.overrideLightColorsWithFogInscatteringColors?1:0),null!=e.directionalInscatteringExponent&&t.writeFloat32(e.directionalInscatteringExponent),null!=e.directinalInscatteringStartDistance&&t.writeFloat32(e.directinalInscatteringStartDistance),null!=e.fogCuttoffDistance&&t.writeFloat32(e.fogCuttoffDistance),null!=e.volumetricFogEmissive&&i(t,e.volumetricFogEmissive),null!=e.volumetricFogStartDistance&&t.writeFloat32(e.volumetricFogStartDistance),null!=e.volumetricFogNearFadeInDistance&&t.writeFloat32(e.volumetricFogNearFadeInDistance),null!=e.volumetricFogStaticLightingScatteringIntensity&&t.writeFloat32(e.volumetricFogStaticLightingScatteringIntensity),null!=e.visibility&&t.writeUint8(e.visibility?1:0),null!=e.useDefault&&t.writeUint8(e.useDefault?1:0),null!=e.visibleHeight)&&t.writeFloat64(e.visibleHeight),t.ValidData()}var r=e.handlers.get(t.StampPixelStreamingHandleType.StampType_ExponentialHeightFog),a=0;r.PixelStreaminStampExponentialHeightFogSetDataType={FogCommandSetData_FogDensity:a++,FogCommandSetData_FogHeightFalloff:a++,FogCommandSetData_SecondFogDensity:a++,FogCommandSetData_SecondFogHeightFallOff:a++,FogCommandSetData_SecondFogHeightOffset:a++,FogCommandSetData_FogMaxOpacity:a++,FogCommandSetData_FogInscatteringLuminance:a++,FogCommandSetData_DirectionalInscatteringLuminance:a++,FogCommandSetData_StartDistance:a++,FogCommandSetData_VolumetricFogScatteringDistribution:a++,FogCommandSetData_VolumetricFogAlbedo:a++,FogCommandSetData_VolumetricFogExtinctionScale:a++,FogCommandSetData_VolumetricFogDistance:a++,FogCommandSetData_EnableVolumetricFog:a++,FogCommandSetData_OverrideLightColorsWithFogInscatteringColors:a++,FogCommandSetData_DirectionalInscatteringExponent:a++,FogCommandSetData_DirectionalInscatteringStartDistance:a++,FogCommandSetData_FogCuttoffDistance:a++,FogCommandSetData_VolumetricFogEmissive:a++,FogCommandSetData_VolumetricFogStartDistance:a++,FogCommandSetData_VolumetricFogNearFadeInDistance:a++,FogCommandSetData_VolumetricFogStaticLightingScatteringIntensity:a++,FogCommandSetData_SetVisibility:a++,FogCommandSetData_SetUseDefault:+a,FogCommandSetData_VisibleHeight:24},r.CommandType={ExponentialHeightFogCommand_SetData:0,ExponentialHeightFogCommand_GetExponentialHeightFog:1};function o(e){var t={};return t.fogDensity=e.fogDensity,t.fogHeightFalloff=e.fogHeightFalloff,t.visibility=e.visibility,t.useDefault=e.useDefault,t.fogMaxOpacity=e.fogMaxOpacity,t}r.interface.set_fog_data=function(e){e=o(e);r.create_custom_command(r.CommandType.ExponentialHeightFogCommand_SetData,n,e)},r.interface.set_fog_data_for_test=function(e){r.create_custom_command(r.CommandType.ExponentialHeightFogCommand_SetData,n,e)},r.interface.get_exponential_height_fog=function(){r.create_custom_command(r.CommandType.ExponentialHeightFogCommand_GetExponentialHeightFog,t.GetNoParamCommandPackData)};return r.RespondType={ExponentialHeightFogRespond_ExponentialHeightFogGet:0},r.create_sub_handler(r.RespondType.ExponentialHeightFogRespond_ExponentialHeightFogGet,function(e){r.interface.OnExponentialHeightFogGet&&(e=o(e),r.interface.OnExponentialHeightFogGet(e))}),r.interface.OnExponentialHeightFogGet=void 0,e.exponential_height_fog_interface=r.interface,r.interface},q.layer_manager_interface=function(e,t){var h,n,a,i,r,o,s,c,l,m,d,u,g,_,p,f,S,C,y;return null!=e.layer_manager_interface?e.layer_manager_interface:((h=e.handlers.get(t.StampPixelStreamingHandleType.StampType_LayerManager)).CommandType={LayerManagerCommand_SetLayerTransparency:0,LayerManagerCommand_FlattenLayerByRegionAndHeightWithGUID:1,LayerManagerCommand_FlattenLayerByPolygonAndHeightWithGUID:2,LayerManagerCommand_ClearEffect:3,LayerManagerCommand_ShowHighlightBySearch:4,LayerManagerCommand_ClearHighlight:5,LayerManagerCommand_CreateLayer:6,LayerManagerCommand_LayerRefresh:7,LayerManagerCommand_BlockFlowTexture:8,LayerManagerCommand_BIMLockState:9,LayerManagerCommand_BIMVisible:10,LayerManagerCommand_BIMCustomColor:11,LayerManagerCommand_BIMEnableCustomColor:12,LayerManagerCommand_BIMHighLight:13,LayerManagerCommand_BIMReset:14,LayerManagerCommand_BIMCustomColorBlendType:15,LayerManagerCommand_GetLayerTransparency:16,LayerManagerCommand_CreateWMTSLayer:17,LayerManagerCommand_CreateWMSLayer:18,LayerManagerCommand_CreateArcgisMapserverLayer:19,LayerManagerCommand_GetLayerIsCastShadow:20,LayerManagerCommand_SetLayerIsCastShadow:21,LayerManagerCommand_DeleteLayer:22,LayerManagerCommand_SetBlueprintPlayState:23,LayerManagerCommand_SetLayerGroundState:24,LayerManagerCommand_GetLayerPriority:25,LayerManagerCommand_SetLayerPriority:26,LayerManagerCommand_UseDefaultTexture:27,LayerManagerCommand_LiftAnimation:28},n=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeFloat64(a),e.ValidData()},a=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],e=new Q(e,t);return e.writePoly(n),e.writeWString(a),e.writeFloat64(i),e.writeUint8(null==r||1==r?1:0),e.ValidData()},i=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.writeFloat64(i),e.writeUint8(null==r||1==r?1:0),e.ValidData()},r=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=e[6],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.writeUint32(i),e.writeUint8(r?1:0),e.writeUint8(o?1:0),e.ValidData()},h.interface.set_layer_transparency=function(e){h.create_custom_command(h.CommandType.LayerManagerCommand_SetLayerTransparency,n,e)},h.interface.flatten_layer_by_region_and_height_with_guid=function(e){h.create_custom_command(h.CommandType.LayerManagerCommand_FlattenLayerByRegionAndHeightWithGUID,a,e)},h.interface.flatten_layer_by_polygon_and_height_with_guid=function(e){h.create_custom_command(h.CommandType.LayerManagerCommand_FlattenLayerByPolygonAndHeightWithGUID,i,e)},h.interface.clear_effect=function(e){h.create_custom_command(h.CommandType.LayerManagerCommand_ClearEffect,t.GetGuidCommandPackData,[e=e||""])},h.interface.show_highlight_by_search=function(e,t,n,a,i){h.create_custom_command(h.CommandType.LayerManagerCommand_ShowHighlightBySearch,r,[e,t,n,a,i=null==i?!0:i])},h.interface.clear_highlight=function(e){h.create_custom_command(h.CommandType.LayerManagerCommand_ClearHighlight,t.GetGuidCommandPackData,[e])},h.interface.LayerType={SE_RTTI_DEM_LAYER:101,SE_RTTI_DOM_LAYER:102,SE_RTTI_BUILDING_LAYER:103,SE_RTTI_BLOCK_LAYER:104,SE_RTTI_BILLBOARD_LAYER:105,SE_RTTI_MATCH_MODEL_LAYER:106,SE_RTTI_OBLIQUE_PHOTO_LAYER:111,SE_RTTI_EDIT_GEOLOGY_LAYER:127,SE_RTTI_VECTOR_TILE_LAYER:128,SE_RTTI_MODEL_LOD_LAYER:130,SE_RTTI_TILE_BLOCK_LAYER:131,SE_RTTI_WIND_FOLIAGE_LAYER:137,SE_RTTI_LIGHT_LAYER:138,SE_RTTI_UE_MODEL_LAYER:139,SE_RTTI_PARTICLE_LAYER:140,SE_RTTI_3DTILE_SET_LAYER:142,SE_RTTI_XYZ_TILE_LAYER:148,SE_RTTI_SCENE_CONTROLLER:573},o=function(e,t){var n,a,i,r,o,s,c,l,m=new Q(e,t),d=e[2];switch(t=d,(e=m).writeWString(t.guid),e.writeWString(t.name),e.writeWString(t.httpLink),e.writeInt32(t.rtti),e.writeFloat64(t.north||-90),e.writeFloat64(t.south||90),e.writeFloat64(t.east||-180),e.writeFloat64(t.west||180),e.writeFloat64(t.min||0),e.writeFloat64(t.max||0),e=d,t=m,h.interface.LayerType.SE_RTTI_BILLBOARD_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_MATCH_MODEL_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_MODEL_LOD_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_BUILDING_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_BLOCK_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_OBLIQUE_PHOTO_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_EDIT_GEOLOGY_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_TILE_BLOCK_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_VECTOR_TILE_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_UE_MODEL_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_WIND_FOLIAGE_LAYER!=e.rtti||t.writeWString(e.gisLink),t=d,e=m,h.interface.LayerType.SE_RTTI_BILLBOARD_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_MATCH_MODEL_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_TILE_BLOCK_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_MODEL_LOD_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_BUILDING_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_BLOCK_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_OBLIQUE_PHOTO_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_UE_MODEL_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_PARTICLE_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_WIND_FOLIAGE_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_3DTILE_SET_LAYER!=t.rtti||(t=t.isUnderground?1:0,e.writeUint8(t)),e=d,t=m,h.interface.LayerType.SE_RTTI_EDIT_GEOLOGY_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_BILLBOARD_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_MODEL_LOD_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_BUILDING_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_BLOCK_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_MATCH_MODEL_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_TILE_BLOCK_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_OBLIQUE_PHOTO_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_UE_MODEL_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_PARTICLE_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_WIND_FOLIAGE_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_LIGHT_LAYER!=e.rtti||(t.writeFloat64(e.minHeight),t.writeFloat64(e.maxHeight)),t=d,e=m,h.interface.LayerType.SE_RTTI_MODEL_LOD_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_OBLIQUE_PHOTO_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_DOM_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_DEM_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_TILE_BLOCK_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_VECTOR_TILE_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_UE_MODEL_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_PARTICLE_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_WIND_FOLIAGE_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_XYZ_TILE_LAYER!=t.rtti||(e.writeInt32(t.minLevel||0),e.writeInt32(t.maxLevel||24)),e=d,t=m,h.interface.LayerType.SE_RTTI_DOM_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_DEM_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_VECTOR_TILE_LAYER!=e.rtti&&h.interface.LayerType.SE_RTTI_XYZ_TILE_LAYER!=e.rtti||t.writeInt32(e.priority),t=d,e=m,h.interface.LayerType.SE_RTTI_BILLBOARD_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_MATCH_MODEL_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_WIND_FOLIAGE_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_MODEL_LOD_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_BUILDING_LAYER!=t.rtti&&h.interface.LayerType.SE_RTTI_BLOCK_LAYER!=t.rtti||(null==t.visibleRange&&(t.visibleRange=-1),e.writeFloat64(t.visibleRange)),d.rtti){case h.interface.LayerType.SE_RTTI_DEM_LAYER:m.writeWString(d.demType);break;case h.interface.LayerType.SE_RTTI_MATCH_MODEL_LAYER:l=m,(c=d).is_wind_tree&&(l.writeUint8(c.is_wind_tree?1:0),l.writeInt32(c.minLevel),l.writeInt32(c.maxLevel));break;case h.interface.LayerType.SE_RTTI_OBLIQUE_PHOTO_LAYER:case h.interface.LayerType.SE_RTTI_MODEL_LOD_LAYER:case h.interface.LayerType.SE_RTTI_BUILDING_LAYER:case h.interface.LayerType.SE_RTTI_BLOCK_LAYER:l=d,c=m,h.interface.LayerType.SE_RTTI_MODEL_LOD_LAYER!=l.rtti&&h.interface.LayerType.SE_RTTI_BUILDING_LAYER!=l.rtti&&h.interface.LayerType.SE_RTTI_OBLIQUE_PHOTO_LAYER!=l.rtti&&h.interface.LayerType.SE_RTTI_BLOCK_LAYER!=l.rtti||(c.writeWString(l.dataType),c.writeFloat64(l.altitudeOffset),h.interface.LayerType.SE_RTTI_MODEL_LOD_LAYER==l.rtti&&c.writeInt32(l.origin),h.interface.LayerType.SE_RTTI_BLOCK_LAYER!=l.rtti&&c.writeUint32(null==l.dataVersion?1:l.dataVersion));break;case h.interface.LayerType.SE_RTTI_TILE_BLOCK_LAYER:o=d,(s=m).writeFloat64(o.visibleRange),s.writeInt32(o.heightType),0<o.heightType?(s.writeWString(o.floorField),s.writeFloat64(o.floorHeight)):s.writeWString(o.buildingHeightField),s.writeInt32(o.altitudeMode),0<o.altitudeMode&&s.writeWString(o.altitudeField),s.writeFloat64(o.altitudeOffset),s.writeWString(o.mapfile),s.writeWString(o.outFormat);break;case h.interface.LayerType.SE_RTTI_VECTOR_TILE_LAYER:s=d,(o=m).writeWString(s.outFormat),o.writeWString(s.mapfile),o.writeWString(s.geometryType),o.writeWString(s.ShadowType);break;case h.interface.LayerType.SE_RTTI_UE_MODEL_LAYER:i=d,(r=m).writeUint8(i.has_tranparency_shader?1:0),r.writeUint8(i.is_night?1:0),r.writeUint8(i.is_day?1:0),r.writeInt32(i.shader_num),r.writeWString(i.dataType);break;case h.interface.LayerType.SE_RTTI_PARTICLE_LAYER:r=d,(i=m).writeFloat64(r.visibleRange),i.writeInt32(r.shader_num);break;case h.interface.LayerType.SE_RTTI_SCENE_CONTROLLER:m.writeWString(d.mapfile);break;case h.interface.LayerType.SE_RTTI_EDIT_GEOLOGY_LAYER:n=d,(a=m).writeWString(n.spatital_file),a.writeWString(n.parentProject),a.writeWString(n.hole_name),a.writeWString(n.hole_soil_name),a.writeWString(n.project_name),a.writeWString(n.water_name),a.writeWString(n.quyang_name),a.writeWString(n.pouxian_name),a.writeWString(n.kelifenxi_name),a.writeWString(n.gujie_name),a.writeWString(n.sanzhou_name),a.writeWString(n.biaozhunguanru_name),a.writeWString(n.shiziban_name),a.writeWString(n.jinglichutan_name),a.writeWString(n.donglichutan_name),a.writeWString(n.bosushiyan_name),a.writeWString(n.ys_hole_soil_name),a.writeWString(n.quake_name),a.writeWString(n.test_result_name),a.writeWString(n.water2_name);break;case h.interface.LayerType.SE_RTTI_3DTILE_SET_LAYER:a=d,(n=m).writeFloat64(a.maximumScreenSpaceError),n.writeUint8(a.skipLevelOfDetail?1:0),n.writeWString(null==a.dataType?"Building":a.dataType),n.writeFloat64(null==a.altitudeOffset?0:a.altitudeOffset);break;case h.interface.LayerType.SE_RTTI_LIGHT_LAYER:var u=d,g=m;u=null==u.is_night||u.is_night,g.writeUint8(u?1:0);break;case h.interface.LayerType.SE_RTTI_XYZ_TILE_LAYER:g=d,(u=m).writeWString(g.shadowType),u.writeWString(g.metadata),u.writeUint8(g.isWebmercator?1:0),u.writeUint8(g.isReversed?1:0),u.writeUint8(g.isZYX?1:0)}return m.ValidData()},h.interface.create_layer=function(e){h.create_custom_command(h.CommandType.LayerManagerCommand_CreateLayer,o,[e])},h.interface.refresh_layer=function(e){h.create_custom_command(h.CommandType.LayerManagerCommand_LayerRefresh,t.GetGuidCommandPackData,[e])},h.interface.delete_layer=function(e){h.create_custom_command(h.CommandType.LayerManagerCommand_DeleteLayer,t.GetGuidCommandPackData,[e])},s=function(e,t){var t=new Q(e,t),e=e[2],n=(t.writeWString(e.guid),e.enableFlow?1:0);return t.writeUint8(n),e.enableFlow&&t.writeWString(e.textureUrl),t.ValidData()},h.interface.change_block_flow=function(e){h.create_custom_command(h.CommandType.LayerManagerCommand_BlockFlowTexture,s,[e])},c=function(e,t){var t=new Q(e,t),n=e[2],e=e[3];return t.writeWString(n),t.writeUint8(e?1:0),t.ValidData()},l=function(e,t){var t=new Q(e,t),n=e[2],a=e[3],e=e[4];return t.writeWString(n),t.writeWString(a),t.writeUint8(e?1:0),t.ValidData()},m=function(e,t){var t=new Q(e,t),n=e[2],a=e[3],e=e[4];return t.writeWString(n),t.writeWString(a),t.writeUint32(e),t.ValidData()},d=function(e,t){var t=new Q(e,t),n=e[2],a=e[3],i=e[4];return t.writeWString(n),t.writeWString(a),t.writeUint8(i?1:0),i&&(n=e[5],a=e[6],t.writeUint32(n),t.writeUint8(a?1:0)),t.ValidData()},u=function(e,t){var t=new Q(e,t),n=e[2],e=e[3];return t.writeWString(n),t.writeWString(e),t.ValidData()},h.interface.set_bim_lock=function(e,t){h.create_custom_command(h.CommandType.LayerManagerCommand_BIMLockState,c,[e,t])},h.interface.set_bim_visible=function(e,t,n){h.create_custom_command(h.CommandType.LayerManagerCommand_BIMVisible,l,[e,t,n])},h.interface.set_bim_custom_color=function(e,t,n){h.create_custom_command(h.CommandType.LayerManagerCommand_BIMCustomColor,m,[e,t,n])},h.interface.set_bim_use_custom_color=function(e,t,n){h.create_custom_command(h.CommandType.LayerManagerCommand_BIMEnableCustomColor,l,[e,t,n])},h.interface.set_bim_highlight=function(e,t,n,a,i){h.create_custom_command(h.CommandType.LayerManagerCommand_BIMHighLight,d,[e,t,n,a=null==a?0:a,i])},h.interface.set_bim_reset=function(e,t){h.create_custom_command(h.CommandType.LayerManagerCommand_BIMReset,u,[e,t])},h.interface.set_bim_custom_color_blend_type=function(e,t,n){h.create_custom_command(h.CommandType.LayerManagerCommand_BIMCustomColorBlendType,l,[e,t,1!=n])},h.interface.get_layer_transparency=function(e){h.create_custom_command(h.CommandType.LayerManagerCommand_GetLayerTransparency,t.GetGuidCommandPackData,[e])},g=function(e,t){var t=new Q(e,t),e=e[2],n=(t.writeWString(e.name),t.writeWString(e.guid),t.writeWString(e.url),t.writeUint32(e.order),t.writeUint32(e.visibleMaxLevel),t.writeUint8(e.visible?1:0),t.writeWString(e.shadowType),void 0!==e.spatialFile&&null!==e.spatialFile),n=(t.writeUint8(n?1:0),n&&t.writeWString(e.spatialFile),null!=e.rect&&null!=e.rect),n=(t.writeUint8(n?1:0),n&&(t.writeFloat64(e.rect.north),t.writeFloat64(e.rect.south),t.writeFloat64(e.rect.east),t.writeFloat64(e.rect.west)),null!=e.levels&&null!=e.levels),n=(t.writeUint8(n?1:0),n&&(t.writeUint32(e.levels.minLevel),t.writeUint32(e.levels.maxLevel)),null!=e.layerGroup&&null!=e.layerGroup),n=(t.writeUint8(n?1:0),n&&(t.writeWString(e.layerGroup.layer),t.writeWString(e.layerGroup.tileMatrixSet),t.writeWString(e.layerGroup.style)),null!=e.dpi&&null!=e.dpi),n=(t.writeUint8(n?1:0),n&&t.writeFloat32(e.dpi),null!=e.imgExt&&null!=e.imgExt),n=(t.writeUint8(n?1:0),n&&t.writeWString(e.imgExt),null!=e.subDomains&&null!=e.subDomains);return t.writeUint8(n?1:0),n&&t.writeWString(e.subDomains),t.ValidData()},h.interface.create_wmts_layer=function(e){h.create_custom_command(h.CommandType.LayerManagerCommand_CreateWMTSLayer,g,[e])},_=function(e,t){var t=new Q(e,t),e=e[2],n=(t.writeWString(e.name),t.writeWString(e.guid),t.writeWString(e.url),t.writeUint32(e.order),t.writeUint8(e.visible?1:0),t.writeFloat64(e.rect.north),t.writeFloat64(e.rect.south),t.writeFloat64(e.rect.east),t.writeFloat64(e.rect.west),t.writeWString(e.version),t.writeWString(e.layers),t.writeWString(e.styles),t.writeWString(e.transparent),t.writeUint32(e.width),t.writeUint32(e.height),t.writeWString(e.shadowType),null!=e.subDomains&&null!=e.subDomains),n=(t.writeUint8(n?1:0),n&&t.writeWString(e.subDomains),t.writeUint8(e.isWebmercator?1:0),null!=e.srsCrs&&null!=e.srsCrs);return t.writeUint8(n?1:0),n&&t.writeWString(e.srsCrs),t.ValidData()},h.interface.create_wms_layer=function(e){h.create_custom_command(h.CommandType.LayerManagerCommand_CreateWMSLayer,_,[e])},p=function(e,t){var t=new Q(e,t),e=e[2],n=(t.writeWString(e.name),t.writeWString(e.guid),t.writeWString(e.url),t.writeUint32(e.order),t.writeUint32(e.visibleMaxLevel),t.writeUint8(e.visible?1:0),t.writeUint32(e.width),t.writeUint32(e.height),t.writeWString(e.shadowType),t.writeUint8(e.useTiles?1:0),t.writeUint16(e.alpha),void 0!==e.spatialFile&&null!==e.spatialFile),n=(t.writeUint8(n?1:0),n&&t.writeWString(e.spatialFile),null!=e.rect&&null!=e.rect),n=(t.writeUint8(n?1:0),n&&(t.writeFloat64(e.rect.north),t.writeFloat64(e.rect.south),t.writeFloat64(e.rect.east),t.writeFloat64(e.rect.west)),null!=e.levels&&null!=e.levels),n=(t.writeUint8(n?1:0),n&&(t.writeUint32(e.levels.minLevel),t.writeUint32(e.levels.maxLevel)),null!=e.layers&&null!=e.layers),n=(t.writeUint8(n?1:0),n&&t.writeWString(e.layers),null!=e.token&&null!=e.token),n=(t.writeUint8(n?1:0),n&&t.writeWString(e.token),null!=e.subDomains&&null!=e.subDomains);return t.writeUint8(n?1:0),n&&t.writeWString(e.subDomains),t.ValidData()},h.interface.create_arcgis_mapserver_layer=function(e){h.create_custom_command(h.CommandType.LayerManagerCommand_CreateArcgisMapserverLayer,p,[e])},f=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeUint8(a?1:0),e.ValidData()},h.interface.set_layer_is_cast_shadow=function(e){h.create_custom_command(h.CommandType.LayerManagerCommand_SetLayerIsCastShadow,f,e)},h.interface.get_layer_is_cast_shadow=function(e){h.create_custom_command(h.CommandType.LayerManagerCommand_GetLayerIsCastShadow,t.GetGuidCommandPackData,[e])},h.interface.set_blueprint_play_state=function(e){h.create_custom_command(h.CommandType.LayerManagerCommand_SetBlueprintPlayState,f,e)},h.interface.set_play_is_ground=function(e){h.create_custom_command(h.CommandType.LayerManagerCommand_SetLayerGroundState,f,e)},S=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeInt32(a),e.ValidData()},h.interface.set_layer_priority=function(e){h.create_custom_command(h.CommandType.LayerManagerCommand_SetLayerPriority,S,e)},h.interface.get_layer_priority=function(e){h.create_custom_command(h.CommandType.LayerManagerCommand_GetLayerPriority,t.GetGuidCommandPackData,[e])},C=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeUint8(a?1:0),e.ValidData()},h.interface.set_use_default_texture=function(e){h.create_custom_command(h.CommandType.LayerManagerCommand_UseDefaultTexture,C,e)},y=function(e,t){t=new Q(e,t);return t.writeWString(e[2]),t.writeFloat64(e[3]),t.writeFloat64(e[4]),t.writeFloat64(e[5]),t.writeFloat64(e[6]),t.ValidData()},h.interface.set_lift_animation_param=function(e,t,n,a,i){h.create_custom_command(h.CommandType.LayerManagerCommand_LiftAnimation,y,[e,t,n,a,i])},h.RespondType={PixelStreaminStampLayerManagerOnCreateLayerFinished:0,PixelStreaminStampLayerManagerOnBIMLoaded:1,PixelStreaminStampLayerManagerOnGetLayerTransparency:2,PixelStreaminStampLayerManagerOnEffectFinish:3,PixelStreaminStampLayerManagerOnGetLayerIsCastShadow:4,PixelStreaminStampLayerManagerOnDeleteLayerFinished:5,PixelStreaminStampLayerManagerOnGetLayerPriority:6},h.create_sub_handler(h.RespondType.PixelStreaminStampLayerManagerOnCreateLayerFinished,function(e){null!=h.interface.OnCreateFinished&&h.interface.OnCreateFinished(e)}),h.create_sub_handler(h.RespondType.PixelStreaminStampLayerManagerOnBIMLoaded,function(e){null!=h.interface.OnBIMLoaded&&h.interface.OnBIMLoaded(e)}),h.create_sub_handler(h.RespondType.PixelStreaminStampLayerManagerOnGetLayerTransparency,function(e){null!=h.interface.OnGetLayerTransparency&&h.interface.OnGetLayerTransparency(e)}),h.create_sub_handler(h.RespondType.PixelStreaminStampLayerManagerOnEffectFinish,function(e){null!=h.interface.OnEffectFinish&&h.interface.OnEffectFinish(e)}),h.create_sub_handler(h.RespondType.PixelStreaminStampLayerManagerOnGetLayerIsCastShadow,function(e){null!=h.interface.OnGetLayerIsCastShadow&&h.interface.OnGetLayerIsCastShadow(e)}),h.create_sub_handler(h.RespondType.PixelStreaminStampLayerManagerOnDeleteLayerFinished,function(e){null!=h.interface.OnDeleteLayerFinished&&h.interface.OnDeleteLayerFinished(e)}),h.create_sub_handler(h.RespondType.PixelStreaminStampLayerManagerOnGetLayerPriority,function(e){null!=h.interface.OnGetLayerPriority&&h.interface.OnGetLayerPriority(e)}),h.interface.OnCreateFinished=void 0,h.interface.OnBIMLoaded=void 0,h.interface.OnGetLayerTransparency=void 0,h.interface.OnEffectFinish=void 0,h.interface.OnGetLayerIsCastShadow=void 0,h.interface.OnDeleteLayerFinished=void 0,h.interface.OnGetLayerPriority=void 0,e.layer_manager_interface=h.interface,h.interface)},X.measure_interface=function(e,o){if(null!=e.measure_interface)return e.measure_interface;var s=e.handlers.get(o.StampPixelStreamingHandleType.StampType_Measure);function n(e,t){t=new Q(e,t);return t.writeUint8(e[2]),t.writeUint8(e[3]),t.writeUint32(null==e[4]?4294967295:e[4]),t.writeFloat32(null==e[5]?2:e[5]),t.writeUint32(null==e[6]?4294901760:e[6]),t.writeUint32(null==e[7]?1140889856:e[7]),t.ValidData()}s.CommandType={MeasureCommand_HorizontalDist:0,MeasureCommand_VerticalDist:1,MeasureCommand_SurfaceDist:2,MeasureCommand_SpaceDist:3,MeasureCommand_HorizontalProjectionArea:4,MeasureCommand_SpaceArea:5,MeasureCommand_VerticalArea:6,MeasureCommand_PlaneAngle:7,MeasureCommand_LineOfSight:8,MeasureCommand_Insolation:9,MeasureCommand_GetBatchAltitue:10,MeasureCommand_ClipScene:11,MeasureCommand_FixedClipScene:12,MeasureCommand_GetTerrainAltitue:13,MeasureCommand_GetClipScenePose:14,MeasureCommand_SpatialRightAngle:15,MeasureCommand_Clear:16},s.interface.measure=function(e,t){s.create_custom_command(e,n,t),o.Cursor.set_edit()},s.interface.clear=function(){s.create_custom_command(s.CommandType.MeasureCommand_Clear,o.GetNoParamCommandPackData),o.Cursor.reset()};function t(e,t){var n=new Q(e,t),a=(n.writeWString(e[2]),e[3]),i=a.length;n.writeUint32(i);for(var r=0;r<i;++r)n.writeFloat64(a[r].x),n.writeFloat64(a[r].y);return n.ValidData()}function c(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=e[6],s=e[7];return(e=new Q(e,t)).writeUint8(n?1:0),e.writeUint32(a),null!=i?(e.writeUint8(1),e.writeLine(i)):e.writeUint8(0),null!=r?(e.writeUint8(1),e.writeFloat64(r.x),e.writeFloat64(r.y),e.writeFloat64(r.z),e.writeFloat64(null==o?0:o),e.writeInt32(null==s?0:s)):e.writeUint8(0),e.ValidData()}function r(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=e[6];return(e=new Q(e,t)).writeUint8(n?1:0),e.writeUint32(a),e.writeFloat64(i),e.writeLine(r),null!=o?(e.writeUint8(1),e.writeLine(o)):e.writeUint8(0),e.ValidData()}function a(e,t){return(t=new Q(e,t)).writeFloat64(e[2]),t.writeFloat64(e[3]),t.ValidData()}function i(e,t){var n=new Q(e,t);if(n.writeUint8(e[2]),n.writeUint8(e[3]),n.writeUint32(e[4]),n.writeFloat32(e[5]),n.writeUint32(e[6]),n.writeUint32(e[7]),n.writeUint32(e[8]),n.writeUint32(e[9]),n.writeUint32(e[10]),n.writeUint32(e[11]),n.writeUint8(e[12]?1:0),n.writeUint32(e[13]),n.writeUint8(e[14]?1:0),n.writeUint32(e[15]),n.writeUint32(e[16]),null!=e[17]&&e[17]instanceof Array){var a=e[17].length;n.writeUint16(a);for(var i=0;i<a;++i)n.writeFloat64(e[17][i])}else n.writeUint16(0);return n.ValidData()}s.interface.getBatchAltitude=function(e){s.create_custom_command(s.CommandType.MeasureCommand_GetBatchAltitue,t,e)},s.interface.clipScene=function(e,t,n,a,i,r){s.create_custom_command(s.CommandType.MeasureCommand_ClipScene,c,[e,t,n,a,i,r]),o.Cursor.set_edit()},s.interface.fixedClipScene=function(e,t,n,a,i){s.create_custom_command(s.CommandType.MeasureCommand_FixedClipScene,r,[e,t,n,a,i]),o.Cursor.set_edit()},s.interface.MeasureTerrainAltitude=function(e,t){s.create_custom_command(s.CommandType.MeasureCommand_GetTerrainAltitue,a,[e,t])},s.interface.MeasureGetClipScenePose=function(){s.create_custom_command(s.CommandType.MeasureCommand_GetClipScenePose,o.GetNoParamCommandPackData)},s.interface.insolation=function(e){s.create_custom_command(s.CommandType.MeasureCommand_Insolation,i,e),o.Cursor.set_edit()},s.MeasureUnitType={MeasureUnitType_Meter:0,MeasureUnitType_Kilometer:1,MeasureUnitType_SquareMeter:2,MeasureUnitType_SquareKilometer:3,MeasureUnitType_Minute:4,MeasureUnitType_Degree:5};return s.RespondType={ELementRespond_OnMeasureFinished:0},s.create_sub_handler(s.RespondType.ELementRespond_OnMeasureFinished,function(e){e=new TextDecoder("utf-16").decode(e),e=JSON.parse(e);o.Cursor.reset(),s.interface.OnMeasureFinished&&s.interface.OnMeasureFinished(e)}),s.interface.OnMeasureFinished=void 0,e.measure_interface=s.interface,s.interface},J.ms_class_obj_interface=function(e,t){var n,a,i,r,o,s,c;return null!=e.ms_class_obj_interface?e.ms_class_obj_interface:((n=e.handlers.get(t.StampPixelStreamingHandleType.StampType_MsClassObj)).CommandType={MsClassObjCommand_SetName:0,MsClassObjCommand_GetName:1,MsClassObjCommand_SetStyle:2,MsClassObjCommand_GetStyle:3,MsClassObjCommand_AddLabel:4,MsClassObjCommand_GetLabelNums:5,MsClassObjCommand_GetLabel:6,MsClassObjCommand_UpdateLabel:7,MsClassObjCommand_RemoveLabel:8,MsClassObjCommand_SetExpression:9,MsClassObjCommand_GetExpression:10,MsClassObjCommand_BatchSetClassesAndRefresh:11,MsClassObjCommand_Refresh:12},a=function(e,t){var n=new Q(e,t);n.writeWString(e[2]);for(var a=3;a<e.length;++a)n.writeUint32(e[a]);return n.ValidData()},i=function(e,t){t=new Q(e,t);return t.writeWString(e[2]),t.writeUint32(e[3]),t.writeWString(e[4]),t.writeWString(e[5]),t.writeUint8(e[6]),t.writeUint8(e[7]),t.writeUint8(e[8]),t.writeUint8(e[9]),t.writeUint8(e[10]),t.writeUint8(e[11]),t.writeUint8(e[12]),t.writeUint8(e[13]),t.writeFloat64(e[14]),t.writeFloat64(e[15]),t.writeFloat64(e[16]),t.writeWString(e[17]),t.ValidData()},r=function(e,t){for(var n=new Q(e,t),a=(n.writeWString(e[2]),n.writeUint32(e[3]),n.writeWString(e[4]),n.writeWString(e[5]),n.writeWString(e[6]),n.writeWString(e[7]),n.writeFloat64(e[8]),n.writeUint8(e[9]),n.writeUint8(e[10]),n.writeUint8(e[11]),n.writeUint8(e[12]),n.writeUint8(e[13]),n.writeUint8(e[14]),n.writeUint8(e[15]),n.writeUint32(e[16]),n.writeUint32(e[17]),n.writeUint8(e[18]),n.writeUint32(e[19]),n.writeUint8(e[20]),n.writeUint32(e[21]),n.writeUint32(e[22]),n.writeUint32(e[23]),n.writeUint32(e[24]),n.writeUint8(e[25]),n.writeUint8(e[26]),n.writeUint8(e[27]),n.writeUint8(e[28]),e[29]),i=(n.writeUint32(a),30),r=0;r<a;++r)n.writeUint32(e[i]),++i;a=e[i],n.writeUint32(a),++i;for(r=0;r<a;++r)n.writeUint32(e[i]),++i;a=e[i],n.writeUint32(a),++i;for(r=0;r<a;++r)n.writeUint32(e[i]),++i;a=e[i],n.writeUint32(a),++i;for(r=0;r<a;++r)n.writeFloat64(e[i]),++i;return n.writeFloat64(e[i]),n.writeFloat64(e[++i]),n.writeWString(e[++i]),n.writeWString(e[++i]),n.ValidData()},o=function(e,t){for(var n=new Q(e,t),a=(n.writeWString(e[2]),n.writeUint32(e[3]),n.writeUint32(e[4]),n.writeWString(e[5]),n.writeWString(e[6]),n.writeWString(e[7]),n.writeWString(e[8]),n.writeFloat64(e[9]),n.writeUint8(e[10]),n.writeUint8(e[11]),n.writeUint8(e[12]),n.writeUint8(e[13]),n.writeUint8(e[14]),n.writeUint8(e[15]),n.writeUint8(e[16]),n.writeUint32(e[17]),n.writeUint32(e[18]),n.writeUint8(e[19]),n.writeUint32(e[20]),n.writeUint8(e[21]),n.writeUint32(e[22]),n.writeUint32(e[23]),n.writeUint32(e[24]),n.writeUint32(e[25]),n.writeUint8(e[26]),n.writeUint8(e[27]),n.writeUint8(e[28]),n.writeUint8(e[29]),e[30]),i=(n.writeUint32(a),31),r=0;r<a;++r)n.writeUint32(e[i]),++i;a=e[i],n.writeUint32(a),++i;for(r=0;r<a;++r)n.writeUint32(e[i]),++i;a=e[i],n.writeUint32(a),++i;for(r=0;r<a;++r)n.writeUint32(e[i]),++i;a=e[i],n.writeUint32(a),++i;for(r=0;r<a;++r)n.writeFloat64(e[i]),++i;return n.writeFloat64(e[i]),n.writeFloat64(e[++i]),n.writeWString(e[++i]),n.writeWString(e[++i]),n.ValidData()},s=function(e,t){t=new Q(e,t);return t.writeWString(e[2]),t.writeUint32(e[3]),t.writeWString(e[4]),t.ValidData()},c=function(e,t){var n=new Q(e,t),a=2;n.writeWString(e[a++]),n.writeUint32(e[a++]);for(var i=0;i<e[3];i++)n.writeUint32(e[a++]),n.writeWString(e[a++]),n.writeUint8(e[a++]?1:0),n.writeWString(e[a++]),n.writeWString(e[a++]),n.writeUint8(e[a++]),n.writeUint8(e[a++]),n.writeUint8(e[a++]),n.writeUint8(e[a++]),n.writeUint8(e[a++]),n.writeUint8(e[a++]),n.writeUint8(e[a++]),n.writeUint8(e[a++]),n.writeFloat64(e[a++]),n.writeFloat64(e[a++]),n.writeFloat64(e[a++]),n.writeWString(e[a++]);var r,o=e[a];n.writeUint32(e[a++]);for(var s=0;s<o;s++)if(n.writeUint32(e[a++]),r=e[a],n.writeUint32(e[a++]),!(r<=0)){n.writeUint32(e[a++]);for(var c=0;c<r;c++){n.writeWString(e[a++]),n.writeWString(e[a++]),n.writeWString(e[a++]),n.writeWString(e[a++]),n.writeFloat64(e[a++]),n.writeUint8(e[a++]),n.writeUint8(e[a++]),n.writeUint8(e[a++]),n.writeUint8(e[a++]),n.writeUint8(e[a++]),n.writeUint8(e[a++]),n.writeUint8(e[a++]),n.writeUint32(e[a++]),n.writeUint32(e[a++]),n.writeUint8(e[a++]),n.writeUint32(e[a++]),n.writeUint8(e[a++]),n.writeUint32(e[a++]),n.writeUint32(e[a++]),n.writeUint32(e[a++]),n.writeUint32(e[a++]),n.writeUint8(e[a++]),n.writeUint8(e[a++]),n.writeUint8(e[a++]),n.writeUint8(e[a++]);var l=e[a++];n.writeUint32(l);for(var m=0;m<l;++m)n.writeUint32(e[a++]);l=e[a++],n.writeUint32(l);for(m=0;m<l;++m)n.writeUint32(e[a++]);l=e[a++],n.writeUint32(l);for(m=0;m<l;++m)n.writeUint32(e[a++]);l=e[a++],n.writeUint32(l);for(m=0;m<l;++m)n.writeFloat64(e[a++]);n.writeFloat64(e[a++]),n.writeFloat64(e[a++]),n.writeWString(e[a++]),n.writeWString(e[a++])}}return n.ValidData()},n.interface.set_name=function(e){n.create_custom_command(n.CommandType.MsClassObjCommand_SetName,s,e)},n.interface.get_name=function(e){n.create_custom_command(n.CommandType.MsClassObjCommand_GetName,a,e)},n.interface.set_style=function(e){n.create_custom_command(n.CommandType.MsClassObjCommand_SetStyle,i,e)},n.interface.get_style=function(e){n.create_custom_command(n.CommandType.MsClassObjCommand_GetStyle,a,e)},n.interface.add_label=function(e){n.create_custom_command(n.CommandType.MsClassObjCommand_AddLabel,r,e)},n.interface.get_label_nums=function(e){n.create_custom_command(n.CommandType.MsClassObjCommand_GetLabelNums,a,e)},n.interface.get_label=function(e){n.create_custom_command(n.CommandType.MsClassObjCommand_GetLabel,a,e)},n.interface.update_label=function(e){n.create_custom_command(n.CommandType.MsClassObjCommand_UpdateLabel,o,e)},n.interface.remove_label=function(e){n.create_custom_command(n.CommandType.MsClassObjCommand_RemoveLabel,a,e)},n.interface.set_expression=function(e){n.create_custom_command(n.CommandType.MsClassObjCommand_SetExpression,SetExpressionCommandPackData,e)},n.interface.get_expression=function(e){n.create_custom_command(n.CommandType.MsClassObjCommand_GetExpression,a,e)},n.interface.batch_set_classes_and_refresh=function(e){n.create_custom_command(n.CommandType.MsClassObjCommand_BatchSetClassesAndRefresh,c,e)},n.interface.refresh=function(e){n.create_custom_command(n.CommandType.MsClassObjCommand_Refresh,a,e)},n.RespondType={MsClassObjRespond_RespondGet:0},n.create_sub_handler(n.RespondType.MsClassObjRespond_RespondGet,function(e){n.interface.OnRespondGet&&n.interface.OnRespondGet(e)}),n.interface.OnRespondGet=void 0,e.ms_class_obj_interface=n.interface,n.interface)},$.ms_symbol_library_interface=function(e,t){var n,a,i,r;return null!=e.ms_symbol_library_interface?e.ms_symbol_library_interface:((n=e.handlers.get(t.StampPixelStreamingHandleType.StampType_MsSymbolLibrary)).CommandType={MsSymbolLibraryCommand_GetMarkerSymbols:0,MsSymbolLibraryCommand_GetLineSymbols:1,MsSymbolLibraryCommand_GetFillSymbols:2,MsSymbolLibraryCommand_GetLabelSymbols:3,MsSymbolLibraryCommand_GetSymbolById:4,MsSymbolLibraryCommand_GetSymbolPreviewById:5,MsSymbolLibraryCommand_GetSymbolPreviewByIdAndStyle:6},a=function(e,t){for(var n=new Q(e,t),a=2;a<e.length;++a)n.writeWString(e[a]);return n.ValidData()},n.interface.get_marker_symbols=function(e){n.create_custom_command(n.CommandType.MsSymbolLibraryCommand_GetMarkerSymbols,a,e)},n.interface.get_line_symbols=function(e){n.create_custom_command(n.CommandType.MsSymbolLibraryCommand_GetLineSymbols,a,e)},n.interface.get_fill_symbols=function(e){n.create_custom_command(n.CommandType.MsSymbolLibraryCommand_GetFillSymbols,a,e)},n.interface.get_label_symbols=function(e){n.create_custom_command(n.CommandType.MsSymbolLibraryCommand_GetLabelSymbols,a,e)},n.interface.get_symbol_by_id=function(e){n.create_custom_command(n.CommandType.MsSymbolLibraryCommand_GetSymbolById,a,e)},i=function(e,t){for(var n=new Q(e,t),a=2;a<4;++a)n.writeWString(e[a]);return n.writeInt32(e[4]),n.writeInt32(e[5]),n.writeFloat32(e[6]),n.writeUint8(1==e[7]?1:0),n.ValidData()},n.interface.get_symbol_preview_by_id=function(e){n.create_custom_command(n.CommandType.MsSymbolLibraryCommand_GetSymbolPreviewById,i,e)},r=function(e,t){for(var n=new Q(e,t),a=2;a<4;++a)n.writeWString(e[a]);return n.writeInt32(e[4]),n.writeInt32(e[5]),n.writeFloat32(e[6]),n.writeUint8(1==e[7]?1:0),n.writeUint32(e[8]),n.writeFloat32(e[9]),n.writeUint32(e[10]),n.writeUint32(e[11]),n.writeWString(e[12]),n.writeUint8(1==e[13]?1:0),n.writeUint8(1==e[14]?1:0),n.writeFloat32(e[15]),n.ValidData()},n.interface.get_symbol_preview_by_id_and_style=function(e){n.create_custom_command(n.CommandType.MsSymbolLibraryCommand_GetSymbolPreviewByIdAndStyle,r,e)},n.RespondType={MsSymbolLibraryRespond_RespondGet:0,MsSymbolLibraryRespond_RespondPreview:1},n.create_sub_handler(n.RespondType.MsSymbolLibraryRespond_RespondGet,function(e){n.interface.OnRespondGet&&n.interface.OnRespondGet(e)}),n.create_sub_handler(n.RespondType.MsSymbolLibraryRespond_RespondPreview,function(e){n.interface.OnRespondPreview&&n.interface.OnRespondPreview(e)}),n.interface.OnRespondGet=void 0,n.interface.OnRespondPreview=void 0,e.ms_symbol_library_interface=n.interface,n.interface)},Z.particle_system_interface=function(e,t){var n,a,i,r;return null!=e.particle_system_interface?e.particle_system_interface:((n=e.handlers.get(t.StampPixelStreamingHandleType.StampType_ParticleSystem)).CommandType={ParticleCommand_CreateParticle:0,ParticleCommand_ScaleParticle:1,ParticleCommand_DestroyParticle:2},a=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=e[6],s=null==e[7]?"":e[7],c=null==e[8]?500:100*e[8],e=new Q(e,t);return e.writeFloat64(n),e.writeFloat64(a),e.writeFloat64(i),e.writeUint8(r),e.writeWString(o),e.writeWString(s),e.writeFloat64(c),e.ValidData()},i=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],e=new Q(e,t);return e.writeFloat32(n),e.writeFloat32(a),e.writeFloat32(i),e.writeWString(r),e.ValidData()},r=function(e,t){var n=e[2],e=new Q(e,t);return e.writeWString(n),e.ValidData()},n.interface.create=function(e){n.create_custom_command(n.CommandType.ParticleCommand_CreateParticle,a,e)},n.interface.scale=function(e){n.create_custom_command(n.CommandType.ParticleCommand_ScaleParticle,i,e)},n.interface.destroy=function(e){n.create_custom_command(n.CommandType.ParticleCommand_DestroyParticle,r,e)},n.RespondType={ParticleRespond_OnParticleCreated:0},n.create_sub_handler(n.RespondType.ParticleRespond_OnParticleCreated,function(e){n.interface.OnParticleCreated&&n.interface.OnParticleCreated(e)}),n.interface.OnParticleCreated=void 0,e.particle_system_interface=n.interface,n.interface)},ee.polygon_algorithm_interface=function(e,t){var i,a,r,o,s,c,n;return null!=e.polygon_algorithm_interface?e.polygon_algorithm_interface:((i=e.handlers.get(t.StampPixelStreamingHandleType.StampType_PolygonAlgorithmInterface)).CommandType={Interface_PolysRelationship:0,Interface_PolysBoolOperation:1,Interface_PointPolyRelationship:2,Interface_LinePolyRelationship:3,Interface_LineVolumeRelationship:4,Interface_PolygonSelfIntersected:5},a=function(e,t){var n=e[2],a=n?1:0,i=e[3],r=e[4],e=new Q(e,t);return e.writeUint8(a),n?(e.writeWString(i),e.writeWString(r)):(e.writePoly(i),e.writePoly(r)),e.ValidData()},r=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],e=new Q(e,t);return e.writeUint8(n),n?(e.writeWString(a),e.writeWString(i)):(e.writePoly(a),e.writePoly(i)),e.writeUint8(r),e.ValidData()},o=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],e=new Q(e,t);return e.writePoint(a),n?e.writeWString(i):e.writePoly(i),e.writeFloat64(r),e.ValidData()},s=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],e=new Q(e,t);return n?(e.writeWString(a),e.writeWString(i)):(e.writeLine(a),e.writePoly(i)),e.writeFloat64(r),e.ValidData()},c=function(e,t){var n=e[2],a=e[3],i=e[4],e=new Q(e,t);return e.writePoint(n),e.writePoint(a),e.writeWString(i),e.ValidData()},n=function(e,t){var n=e[2],e=new Q(e,t);return e.writeLine(n),e.ValidData()},i.interface.calc_polys_relationship=function(e,t,n){i.create_custom_command(i.CommandType.Interface_PolysRelationship,a,[e,t,n])},i.interface.calc_polys_bool_operation=function(e,t,n,a){i.create_custom_command(i.CommandType.Interface_PolysBoolOperation,r,[e,t,n,a])},i.interface.calc_point_poly_relationship=function(e,t,n,a){i.create_custom_command(i.CommandType.Interface_PointPolyRelationship,o,[e,t,n,a])},i.interface.calc_line_poly_relationship=function(e,t,n,a){i.create_custom_command(i.CommandType.Interface_LinePolyRelationship,s,[e,t,n,a])},i.interface.calc_line_volume_relationship=function(e,t,n){i.create_custom_command(i.CommandType.Interface_LineVolumeRelationship,c,[e,t,n])},i.interface.check_polygon_self_intersected=function(e){i.create_custom_command(i.CommandType.Interface_PolygonSelfIntersected,n,[e])},i.RespondType={InterfaceRespond_OnPolygonAlgorithmFinished:0},i.create_sub_handler(i.RespondType.InterfaceRespond_OnPolygonAlgorithmFinished,function(e){i.interface.OnPolygonAlgorithmFinished&&i.interface.OnPolygonAlgorithmFinished(e)}),i.interface.OnPolygonAlgorithmFinished=void 0,e.polygon_algorithm_interface=i.interface,i.interface)},te.query_interface=function(e,n){var i,a,r,o,t,s,c,l,m;return null!=e.query_interface?e.query_interface:((i=e.handlers.get(n.StampPixelStreamingHandleType.StampType_QueryInterface)).CommandType={Interface_PickObjectCommand:0,Interface_PickObjectExCommand:1,Interface_FinishPickCommand:2,Interface_PickSubObjectCommand:3,Interface_InitDatumCommand:4,Interface_GetXYCommand:5,Interface_GetSphrCommand:6,Interface_SetLayerSearchReturnTypeCommand:7,Interface_GetSearchPageRecord:8,Interface_PickSubObjectExCommand:9,Interface_SetLayerSearchReturnTypeBatchCommand:10,Interface_GetMeshVertices:11},a=function(e,t){var n=e[2],a=e[3],i=e[4],e=new Q(e,t);return e.writeUint32(n),e.writeUint32(a),e.writeInt32(i),e.ValidData()},r=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeUint32(n),e.writeUint32(a),e.ValidData()},o=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeInt32(n),e.writeUint8(null==a||a?1:0),e.ValidData()},t=function(e,t){var n=new Q(e,t),t=parseInt((e.length-2)/3);n.writeUint32(t);for(var a=2;a<e.length;++a)n.writeFloat64(e[a]);return n.ValidData()},i.interface.pick_object=function(e,t,n){i.create_custom_command(i.CommandType.Interface_PickObjectCommand,a,[e,t,n])},i.interface.pick_object_ex=function(e,t){i.create_custom_command(i.CommandType.Interface_PickObjectExCommand,o,[e,t]),n.Cursor.set_select()},i.interface.pick_sub_object=function(e,t){i.create_custom_command(i.CommandType.Interface_PickSubObjectCommand,r,[e,t])},i.interface.finish_pick=function(){i.create_custom_command(i.CommandType.Interface_FinishPickCommand,n.GetNoParamCommandPackData),n.Cursor.reset()},i.interface.init_datum=function(e){i.create_custom_command(i.CommandType.Interface_InitDatumCommand,n.GetGuidCommandPackData,[e])},i.interface.trans_to_XY=function(e){i.create_custom_command(i.CommandType.Interface_GetXYCommand,t,e)},i.interface.trans_to_sphr=function(e){i.create_custom_command(i.CommandType.Interface_GetSphrCommand,t,e)},s=function(e,t){for(var n=new Q(e,t),a=2;a<e.length;++a)n.writeWString(e[a]);return n.ValidData()},i.interface.search_by_filter=function(e,t,n,a){i.create_custom_command(i.CommandType.Interface_GetSearchPageRecord,s,[e,t,n,a])},i.interface.pick_sub_object_ex=function(){i.create_custom_command(i.CommandType.Interface_PickSubObjectExCommand,n.GetNoParamCommandPackData),n.Cursor.set_select()},c=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeUint16(a),e.writeWString(n),e.ValidData()},i.interface.SetParamReturnType=function(e,t){i.create_custom_command(i.CommandType.Interface_SetLayerSearchReturnTypeCommand,c,[e,t])},l=function(e,t){var n=new Q(e,t),a=(e.length-2)/2;n.writeUint16(a);for(var i=0;i<a;++i){var r=e[2*i+2],o=e[2*i+3];n.writeUint16(o),n.writeWString(r)}return n.ValidData()},i.interface.SetParamReturnTypeBatch=function(e){i.create_custom_command(i.CommandType.Interface_SetLayerSearchReturnTypeBatchCommand,l,e)},m=function(e,t){t=new Q(e,t);return t.writeWString(e[2]),t.writeWString(e[3]),t.ValidData()},i.interface.GetMeshVertices=function(e){i.create_custom_command(i.CommandType.Interface_GetMeshVertices,m,e)},i.RespondType={InterfaceRespond_OnPickObject:0,InterfaceRespond_OnPickObjectEx:1,InterfaceRespond_OnTransFinished:2,InterfaceRespond_OnSetSuccess:3},i.create_sub_handler(i.RespondType.InterfaceRespond_OnPickObject,function(e){i.interface.OnPickObject&&i.interface.OnPickObject(e)}),i.create_sub_handler(i.RespondType.InterfaceRespond_OnPickObjectEx,function(e){e=new TextDecoder("utf-16").decode(e),e=JSON.parse(e);i.interface.OnPickObjectEx&&i.interface.OnPickObjectEx(e.HLObjects)}),i.create_sub_handler(i.RespondType.InterfaceRespond_OnTransFinished,function(e){e=new TextDecoder("utf-16").decode(e),e=JSON.parse(e);i.interface.OnTransFinished&&i.interface.OnTransFinished(e)}),i.create_sub_handler(i.RespondType.InterfaceRespond_OnSetSuccess,function(e){i.interface.OnSetSuccess&&i.interface.OnSetSuccess(e)}),i.interface.OnPickObject=void 0,i.interface.OnPickObjectEx=void 0,i.interface.OnTransFinished=void 0,i.interface.OnSetSuccess=void 0,e.query_interface=i.interface,i.interface)},ne.roam_interface=function(e,n){var a,i,r,t,o,s,c;return null!=e.roam_interface?e.roam_interface:((a=e.handlers.get(n.StampPixelStreamingHandleType.StampType_RoamInterface)).CommandType={Interface_AddRole:0,Interface_InitThirdTrack:1,Interface_StartTracking:2,Interface_StopTracking:3,Interface_ChangeThirdTrackHeading:4,Interface_SetVelocity:5,Interface_SetRotationVelocity:6,Interface_PlayAnimation:7,Interface_StopAnimation:8,Interface_RemoveRole:9},i=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeFloat64(n),e.writeFloat64(a),e.ValidData()},r=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeInt32(a),e.ValidData()},t=function(e,t){var n=e[2],e=new Q(e,t);return e.writeUint8(n?1:0),e.ValidData()},o=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeFloat64(a),e.ValidData()},s=function(e,t){for(var n=new Q(e,t),a=2,i=e.length;a<i;++a)n.writeFloat64(e[a]);return n.ValidData()},c=function(e,t){var n=e[2],a=e[3],i=new Q(e,t);if(i.writeWString(n),null!=a){i.writeUint32(a.length);for(var r=0,o=a.length;r<o;++r)i.writeFloat64(a[r])}else i.writeUint32(0);return i.ValidData()},a.interface.add_role=function(e,t){a.create_custom_command(a.CommandType.Interface_AddRole,c,[e,t]),n.Cursor.set_edit()},a.interface.remove_role=function(e){a.create_custom_command(a.CommandType.Interface_RemoveRole,n.GetGuidCommandPackData,[e])},a.interface.init_third_track=function(e,t){a.create_custom_command(a.CommandType.Interface_InitThirdTrack,i,[e,t])},a.interface.start_tracking=function(e,t){a.create_custom_command(a.CommandType.Interface_StartTracking,r,[e,t])},a.interface.stop_tracking=function(e){a.create_custom_command(a.CommandType.Interface_StopTracking,t,[e=null==e?!1:e])},a.interface.change_third_track_heading=function(e,t){a.create_custom_command(a.CommandType.Interface_ChangeThirdTrackHeading,o,[t,e])},a.interface.set_velocity=function(e,t,n){a.create_custom_command(a.CommandType.Interface_SetVelocity,s,[e,t,n])},a.interface.set_rotation_velocity=function(e){a.create_custom_command(a.CommandType.Interface_SetRotationVelocity,s,[e])},a.interface.play_animation=function(e){a.create_custom_command(a.CommandType.Interface_PlayAnimation,n.GetGuidCommandPackData,[e])},a.interface.stop_animation=function(e){a.create_custom_command(a.CommandType.Interface_StopAnimation,n.GetGuidCommandPackData,[e])},a.RespondType={InterfaceRespond_OnRoleLoaded:0},a.create_sub_handler(a.RespondType.InterfaceRespond_OnRoleLoaded,function(e){n.Cursor.reset(),a.interface.OnRoleLoaded&&a.interface.OnRoleLoaded(e)}),a.interface.OnRoleLoaded=void 0,e.roam_interface=a.interface,a.interface)},ae.shape_creator_interface=function(e,i){var r,n,o,a,t,s,c,l;return null!=e.shape_creator_interface?e.shape_creator_interface:((r=e.handlers.get(i.StampPixelStreamingHandleType.StampType_ShapeCreatorInterface)).CommandType={Interface_CreateLine:0,Interface_CreateLineWithFirstPoint:1,Interface_CreatePolyline:2,Interface_CreatePolylineWithFirstPoint:3,Interface_CreatePolygon:4,Interface_CreateCircle:5,Interface_CreateEllipse:6,Interface_CreateCurve:7,Interface_CreateCurveClose:8,Interface_CreateRectangle:9,Interface_CreateSector:10,Interface_CreateSphere:11,Interface_CreateBox:12,Interface_CreateCylinder:13,Interface_CreateCone:14,Interface_CreatePrism:15,Interface_CreatePyramid:16,Interface_CreateVolume:17,Interface_CreatePose:18,Interface_CreatePoseEx:19,Interface_CreatePoint:20,Interface_HeightLimit:21,Interface_CreatePlotSArrow:22,Interface_CreatePlotXArrow:23,Interface_CreatePlotEqualSArrow:24,Interface_CreatePlotTailSArrow:25,Interface_CreatePlotDoubleArrow:26,Interface_CreatePlotCustomArrow:27,Interface_CreatePlotCustomTailArrow:28,Interface_CreatePlotTriangleFlag:29,Interface_CreatePlotRectFlag:30,Interface_CreatePlotCurveFlag:31,Interface_CreatePlotAssemblyArea:32,Interface_CreatePlotEqualSArrow3D:33,Interface_CreatePlotEqualSArrowClose:34,Interface_ShapeCreatorClear:35,Interface_CreatePointEx:36},n=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeFloat64(n),e.writeUint32(a),e.ValidData()},o=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],e=new Q(e,t);return e.writeFloat64(n),e.writeUint32(a),e.writeUint32(i),e.writeUint32(r),e.ValidData()},a=function(e,t){var n=e[2],a=e[3],i=e[4],e=new Q(e,t);return e.writeFloat64(n),e.writeUint32(a),e.writeUint32(i),e.ValidData()},t=function(e,t){for(var n=new Q(e,t),a=2;a<e.length;++a)n.writeFloat32(e[a]);return n.ValidData()},s=function(e,t){var n=new Q(e,t),t=e[2];n.writeUint32(t);for(var a=3;a<e.length;++a)n.writeFloat64(e[a]);return n.ValidData()},c=function(e,t){t=new Q(e,t),e=e[2];return t.writeUint32(e),t.ValidData()},r.interface.create_line=function(e,t){r.create_custom_command(r.CommandType.Interface_CreateLine,n,[e=null==e?1:e,t=null==t?3439263744:t]),i.Cursor.set_edit()},r.interface.create_polyline=function(e,t){r.create_custom_command(r.CommandType.Interface_CreatePolyline,n,[e,t]),i.Cursor.set_edit()},r.interface.create_polygon=function(e,t,n,a){r.create_custom_command(r.CommandType.Interface_CreatePolygon,o,[a=null==a?1:a,e,t,n]),i.Cursor.set_edit()},r.interface.create_circle=function(e,t,n){r.create_custom_command(r.CommandType.Interface_CreateCircle,a,[n=null==n?1:n,e,t]),i.Cursor.set_edit()},r.interface.create_rectangle=function(e,t,n){r.create_custom_command(r.CommandType.Interface_CreateRectangle,a,[n=n||1,e=e||4291611852,t=t||3439263744]),i.Cursor.set_edit()},r.interface.create_sector=function(e){r.create_custom_command(r.CommandType.Interface_CreateSector,t,[e]),i.Cursor.set_edit()},r.interface.create_point=function(){r.create_custom_command(r.CommandType.Interface_CreatePoint,i.GetNoParamCommandPackData),i.Cursor.set_edit()},r.interface.create_point_ex=function(e){r.create_custom_command(r.CommandType.Interface_CreatePointEx,c,[e]),i.Cursor.set_edit()},r.interface.create_height_limit=function(e){r.create_custom_command(r.CommandType.Interface_HeightLimit,s,e),i.Cursor.set_edit()},l=function(e,t){t=new Q(e,t);return t.writeFloat64(e[2]),t.ValidData()},r.interface.create_pose=function(e){r.create_custom_command(r.CommandType.Interface_CreatePose,l,e),i.Cursor.set_edit()},r.interface.clear=function(){r.create_custom_command(r.CommandType.Interface_ShapeCreatorClear,i.GetNoParamCommandPackData),i.Cursor.reset()},r.RespondType={InterfaceRespond_OnShapeCreated:0},r.create_sub_handler(r.RespondType.InterfaceRespond_OnShapeCreated,function(e){r.interface.OnShapeCreated&&r.interface.OnShapeCreated(e)}),r.interface.OnShapeCreated=void 0,e.shape_creator_interface=r.interface,r.interface)},ie.sky_light_interface=function(e,t){if(null!=e.sky_light_interface)return e.sky_light_interface;function i(e,t){e.writeFloat64(null!=t.r?t.r:t.x),e.writeFloat64(null!=t.g?t.g:t.y),e.writeFloat64(null!=t.b?t.b:t.z),e.writeFloat64(null!=t.a?t.a:t.w)}function n(e,t){var n,a,t=new Q(e,t),e=e[2];return n=e,a=BigInt(0),null!=n&&(null!=n.isRealTimeCapture&&(a+=BigInt(1)<<BigInt(o.SkyLightCommandSetDataType.SkyLightCommandSetData_RealTimeCapture)),null!=n.sourceType&&(a+=BigInt(1)<<BigInt(o.SkyLightCommandSetDataType.SkyLightCommandSetData_SourceType)),null!=n.intensity&&(a+=BigInt(1)<<BigInt(o.SkyLightCommandSetDataType.SkyLightCommandSetData_Intensity)),null!=n.lightColor&&(a+=BigInt(1)<<BigInt(o.SkyLightCommandSetDataType.SkyLightCommandSetData_LightColor)),null!=n.affectWorld&&(a+=BigInt(1)<<BigInt(o.SkyLightCommandSetDataType.SkyLightCommandSetData_AffectsWorld)),null!=n.castShadows&&(a+=BigInt(1)<<BigInt(o.SkyLightCommandSetDataType.SkyLightCommandSetData_CastShadows)),null!=n.indirectLightIntensity&&(a+=BigInt(1)<<BigInt(o.SkyLightCommandSetDataType.SkyLightCommandSetData_IndirectLightingIntensity)),null!=n.volumetricScatteringIntensity&&(a+=BigInt(1)<<BigInt(o.SkyLightCommandSetDataType.SkyLightCommandSetData_VolumetricScatteringIntensity)),null!=n.lowerHemisphereIsBlack&&(a+=BigInt(1)<<BigInt(o.SkyLightCommandSetDataType.SkyLightCommandSetData_LowerHemisphereIsBlack)),null!=n.lowerHemisphereColor&&(a+=BigInt(1)<<BigInt(o.SkyLightCommandSetDataType.SkyLightCommandSetData_LowerHemisphereColor)),null!=n.useDefault)&&(a+=BigInt(1)<<BigInt(o.SkyLightCommandSetDataType.SkyLightCommandSetData_SetUseDefault)),t.writeUint64(a),null!=e&&(null!=e.isRealTimeCapture&&t.writeUint8(e.isRealTimeCapture?1:0),null!=e.sourceType&&t.writeUint32(e.sourceType),null!=e.intensity&&t.writeFloat64(e.intensity),null!=e.lightColor&&t.writeUint32(e.lightColor),null!=e.affectWorld&&t.writeUint8(e.affectWorld?1:0),null!=e.castShadows&&t.writeUint8(e.castShadows?1:0),null!=e.indirectLightIntensity&&t.writeFloat64(e.indirectLightIntensity),null!=e.volumetricScatteringIntensity&&t.writeFloat64(e.volumetricScatteringIntensity),null!=e.lowerHemisphereIsBlack&&t.writeUint8(e.lowerHemisphereIsBlack?1:0),null!=e.lowerHemisphereColor&&i(t,e.lowerHemisphereColor),null!=e.useDefault)&&t.writeUint8(e.useDefault?1:0),t.ValidData()}function a(e,t){var n,a,t=new Q(e,t),e=e[2];return n=e,a=BigInt(0),null!=n&&(null!=n.visibility&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_Visibility)),null!=n.atmosphereHeight&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_AtmosphereHeight)),null!=n.multiScatteringFactor&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_MultiScatteringFactor)),null!=n.bottomRadius&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_BottomRadius)),null!=n.groundAlbedo&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_GroundAlbedo)),null!=n.raceSampleCountScale&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_RaceSampleCountScale)),null!=n.rayleighScatteringScale&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_RayleighScatteringScale)),null!=n.rayleighScattering&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_RayleighScattering)),null!=n.rayleighExponentialDistribution&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_RayleighExponentialDistribution)),null!=n.mieScatteringScale&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_MieScatteringScale)),null!=n.mieScattering&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_MieScattering)),null!=n.mieAbsorptionScale&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_MieAbsorptionScale)),null!=n.mieAbsorption&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_MieAbsorption)),null!=n.mieAnisotropy&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_MieAnisotropy)),null!=n.mieExponentialDistribution&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_MieExponentialDistribution)),null!=n.otherAbsorptionScale&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_OtherAbsorptionScale)),null!=n.otherAbsoption&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_OtherAbsoption)),null!=n.otherTentDistribution&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_OtherTentDistribution)),null!=n.skyLuminanceFactor&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_SkyLuminanceFactor)),null!=n.aerialPerspectiveViewDistanceScale&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_AerialPerspectiveViewDistanceScale)),null!=n.heightFogContribution&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_HeightFogContribution)),null!=n.transmittanceMinLightElevationAngle&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_TransmittanceMinLightElevationAngle)),null!=n.aerialPerspectiveStartDepth&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_AerialPerspectiveStartDepth)),null!=n.useDefault)&&(a+=BigInt(1)<<BigInt(o.SkyAtmosphereCommandSetDataType.SkyAtmosphereCommandSetData_SetUseDefault)),t.writeUint64(a),null!=e&&(null!=e.visibility&&t.writeUint8(e.visibility?1:0),null!=e.atmosphereHeight&&t.writeFloat32(e.atmosphereHeight),null!=e.multiScatteringFactor&&t.writeFloat32(e.multiScatteringFactor),null!=e.bottomRadius&&t.writeFloat32(e.bottomRadius),null!=e.groundAlbedo&&t.writeUint32(e.groundAlbedo),null!=e.raceSampleCountScale&&t.writeFloat32(e.raceSampleCountScale),null!=e.rayleighScatteringScale&&t.writeFloat32(e.rayleighScatteringScale),null!=e.rayleighScattering&&i(t,e.rayleighScattering),null!=e.rayleighExponentialDistribution&&t.writeFloat32(e.rayleighExponentialDistribution),null!=e.mieScatteringScale&&t.writeFloat32(e.mieScatteringScale),null!=e.mieScattering&&i(t,e.mieScattering),null!=e.mieAbsorptionScale&&t.writeFloat32(e.mieAbsorptionScale),null!=e.mieAbsorption&&i(t,e.mieAbsorption),null!=e.mieAnisotropy&&t.writeFloat32(e.mieAnisotropy),null!=e.mieExponentialDistribution&&t.writeFloat32(e.mieExponentialDistribution),null!=e.otherAbsorptionScale&&t.writeFloat32(e.otherAbsorptionScale),null!=e.otherAbsoption&&i(t,e.otherAbsoption),null!=e.otherTentDistribution&&(t.writeFloat64(null!=e.otherTentDistribution.tipAltitude?e.otherTentDistribution.tipAltitude:e.otherTentDistribution.x),t.writeFloat64(null!=e.otherTentDistribution.tipValue?e.otherTentDistribution.tipValue:e.otherTentDistribution.y),t.writeFloat64(null!=e.otherTentDistribution.width?e.otherTentDistribution.width:e.otherTentDistribution.z)),null!=e.skyLuminanceFactor&&i(t,e.skyLuminanceFactor),null!=e.aerialPerspectiveViewDistanceScale&&t.writeFloat32(e.aerialPerspectiveViewDistanceScale),null!=e.heightFogContribution&&t.writeFloat32(e.heightFogContribution),null!=e.transmittanceMinLightElevationAngle&&t.writeFloat32(e.transmittanceMinLightElevationAngle),null!=e.aerialPerspectiveStartDepth&&t.writeFloat32(e.aerialPerspectiveStartDepth),null!=e.useDefault)&&t.writeUint8(e.useDefault?1:0),t.ValidData()}function r(e,t){var n,a,t=new Q(e,t),e=e[2];return n=e,a=BigInt(0),null!=n&&(null!=n.visibility&&(a+=BigInt(1)<<BigInt(o.WindDirectionalSourceCommandSetDataType.WindDirectionalSourceCommandSetData_Visibility)),null!=n.visibleHeight&&(a+=BigInt(1)<<BigInt(o.WindDirectionalSourceCommandSetDataType.WindDirectionalSourceCommandSetData_VisibleHeight)),null!=n.strength&&(a+=BigInt(1)<<BigInt(o.WindDirectionalSourceCommandSetDataType.WindDirectionalSourceCommandSetData_Strength)),null!=n.speed&&(a+=BigInt(1)<<BigInt(o.WindDirectionalSourceCommandSetDataType.WindDirectionalSourceCommandSetData_Speed)),null!=n.minGustAmount&&(a+=BigInt(1)<<BigInt(o.WindDirectionalSourceCommandSetDataType.WindDirectionalSourceCommandSetData_MinGustAmount)),null!=n.maxGustAmount&&(a+=BigInt(1)<<BigInt(o.WindDirectionalSourceCommandSetDataType.WindDirectionalSourceCommandSetData_MaxGustAmount)),null!=n.radius&&(a+=BigInt(1)<<BigInt(o.WindDirectionalSourceCommandSetDataType.WindDirectionalSourceCommandSetData_Radius)),null!=n.isPoint&&(a+=BigInt(1)<<BigInt(o.WindDirectionalSourceCommandSetDataType.WindDirectionalSourceCommandSetData_IsPoint)),null!=n.direction)&&(a+=BigInt(1)<<BigInt(o.WindDirectionalSourceCommandSetDataType.WindDirectionalSourceCommandSetData_Direction)),t.writeUint64(a),null!=e&&(null!=e.visibility&&t.writeUint8(e.visibility?1:0),null!=e.visibleHeight&&t.writeFloat32(e.visibleHeight),null!=e.strength&&t.writeFloat32(e.strength),null!=e.speed&&t.writeFloat32(e.speed),null!=e.minGustAmount&&t.writeFloat32(e.minGustAmount),null!=e.maxGustAmount&&t.writeFloat32(e.maxGustAmount),null!=e.radius&&t.writeFloat32(e.radius),null!=e.isPoint&&t.writeUint8(e.isPoint?1:0),null!=e.direction)&&(t.writeFloat64(e.direction.x),t.writeFloat64(e.direction.y),t.writeFloat64(e.direction.z)),t.ValidData()}var o=e.handlers.get(t.StampPixelStreamingHandleType.StampType_SkyLight),s=0,s=(o.SkyLightCommandSetDataType={SkyLightCommandSetData_RealTimeCapture:s++,SkyLightCommandSetData_SourceType:s++,SkyLightCommandSetData_Intensity:s++,SkyLightCommandSetData_LightColor:s++,SkyLightCommandSetData_AffectsWorld:s++,SkyLightCommandSetData_CastShadows:s++,SkyLightCommandSetData_IndirectLightingIntensity:s++,SkyLightCommandSetData_VolumetricScatteringIntensity:s++,SkyLightCommandSetData_LowerHemisphereIsBlack:s++,SkyLightCommandSetData_LowerHemisphereColor:+s,SkyLightCommandSetData_SetUseDefault:10},o.CommandType={SkyLightCommand_SetData:0,SkyLightCommand_GetSkyLight:1,SkyLightCommand_SetAtmosphereData:2,SkyLightCommand_GetAtmosphereData:3,SkyLightCommand_SetWindDirectionalSource:4,SkyLightCommand_GetWindDirectionalSource:5},0);o.SkyAtmosphereCommandSetDataType={SkyAtmosphereCommandSetData_Visibility:s++,SkyAtmosphereCommandSetData_AtmosphereHeight:s++,SkyAtmosphereCommandSetData_MultiScatteringFactor:s++,SkyAtmosphereCommandSetData_BottomRadius:s++,SkyAtmosphereCommandSetData_GroundAlbedo:s++,SkyAtmosphereCommandSetData_RaceSampleCountScale:s++,SkyAtmosphereCommandSetData_RayleighScatteringScale:s++,SkyAtmosphereCommandSetData_RayleighScattering:s++,SkyAtmosphereCommandSetData_RayleighExponentialDistribution:s++,SkyAtmosphereCommandSetData_MieScatteringScale:s++,SkyAtmosphereCommandSetData_MieScattering:s++,SkyAtmosphereCommandSetData_MieAbsorptionScale:s++,SkyAtmosphereCommandSetData_MieAbsorption:s++,SkyAtmosphereCommandSetData_MieAnisotropy:s++,SkyAtmosphereCommandSetData_MieExponentialDistribution:s++,SkyAtmosphereCommandSetData_OtherAbsorptionScale:s++,SkyAtmosphereCommandSetData_OtherAbsoption:s++,SkyAtmosphereCommandSetData_OtherTentDistribution:s++,SkyAtmosphereCommandSetData_SkyLuminanceFactor:s++,SkyAtmosphereCommandSetData_AerialPerspectiveViewDistanceScale:s++,SkyAtmosphereCommandSetData_HeightFogContribution:s++,SkyAtmosphereCommandSetData_TransmittanceMinLightElevationAngle:s++,SkyAtmosphereCommandSetData_AerialPerspectiveStartDepth:+s,SkyAtmosphereCommandSetData_SetUseDefault:23},o.WindDirectionalSourceCommandSetDataType={WindDirectionalSourceCommandSetData_Visibility:0,WindDirectionalSourceCommandSetData_VisibleHeight:1,WindDirectionalSourceCommandSetData_Strength:2,WindDirectionalSourceCommandSetData_Speed:3,WindDirectionalSourceCommandSetData_MinGustAmount:4,WindDirectionalSourceCommandSetData_MaxGustAmount:5,WindDirectionalSourceCommandSetData_Radius:6,WindDirectionalSourceCommandSetData_IsPoint:7,WindDirectionalSourceCommandSetData_Direction:8};function c(e){var t={};return t.intensity=e.intensity,t.lightColor=e.lightColor,t.useDefault=e.useDefault,t}function l(e){var t={};return t.visibility=e.visibility,t.rayleighScattering=e.rayleighScattering,t.rayleighScatteringScale=e.rayleighScatteringScale,t.mieScattering=e.mieScattering,t.mieScatteringScale=e.mieScatteringScale,t.useDefault=e.useDefault,t}o.interface.set_sky_light_data=function(e){e=c(e);o.create_custom_command(o.CommandType.SkyLightCommand_SetData,n,e)},o.interface.set_sky_light_data_for_test=function(e){o.create_custom_command(o.CommandType.SkyLightCommand_SetData,n,e)},o.interface.get_sky_light=function(){o.create_custom_command(o.CommandType.SkyLightCommand_GetSkyLight,t.GetNoParamCommandPackData)},o.interface.set_sky_atmosphere_data=function(e){e=l(e);o.create_custom_command(o.CommandType.SkyLightCommand_SetAtmosphereData,a,e)},o.interface.set_sky_atmosphere_data_for_test=function(e){o.create_custom_command(o.CommandType.SkyLightCommand_SetAtmosphereData,a,e)},o.interface.get_sky_atmosphere=function(){o.create_custom_command(o.CommandType.SkyLightCommand_GetAtmosphereData,t.GetNoParamCommandPackData)},o.interface.set_wind_directional_source=function(e){o.create_custom_command(o.CommandType.SkyLightCommand_SetWindDirectionalSource,r,e)},o.interface.get_wind_directional_source=function(){o.create_custom_command(o.CommandType.SkyLightCommand_GetWindDirectionalSource,t.GetNoParamCommandPackData)};return o.RespondType={SkyLightRespond_SkyLightGet:0,SkyLightRespond_SkyAtmosphereGet:1,SkyLightRespond_WindDirectionalSourceGet:2},o.create_sub_handler(o.RespondType.SkyLightRespond_SkyLightGet,function(e){o.interface.OnSkyLightGet&&(e=c(e),o.interface.OnSkyLightGet(e))}),o.create_sub_handler(o.RespondType.SkyLightRespond_SkyAtmosphereGet,function(e){o.interface.OnSkyAtmosphereGet&&(e=l(e),o.interface.OnSkyAtmosphereGet(e))}),o.create_sub_handler(o.RespondType.SkyLightRespond_WindDirectionalSourceGet,function(e){o.interface.OnWindDirectionalSourceGet&&o.interface.OnWindDirectionalSourceGet(e)}),o.interface.OnSkyLightGet=void 0,o.interface.OnSkyAtmosphereGet=void 0,o.interface.OnWindDirectionalSourceGet=void 0,e.sky_light_interface=o.interface,o.interface},re.stamp_frame=function(e,t){var n,a,i;return null!=e.stamp_frame?e.stamp_frame:(n=e.handlers.get(t.StampPixelStreamingHandleType.StampType_Frame),a=function(e,t){var n=e[2],a=e[3]?1:0,e=new Q(e,t);return e.writeUint8(a),e.writeWString(n),e.ValidData()},n.CommandType={FrameCommand_GetLayers:0,FrameCommand_FlyToByLayerGuid:1,FrameCommand_SetCurrentLayer:2,FrameCommand_ChangeVisibilityByGuid:3,FrameCommand_GetProjectProperty:4,FrameCommand_GetPipelineLayerProperty:5,FrameCommand_GetBlockLayerSymbol:6,FrameCommand_GetBimSDB:7,FrameCommand_CastShadow:8,FrameCommand_SetCurrentProject:9},n.interface.GetLayersCommand=function(){n.create_custom_command(n.CommandType.FrameCommand_GetLayers,t.GetNoParamCommandPackData)},n.interface.FlyToByLayerGuidCommand=function(e){n.create_custom_command(n.CommandType.FrameCommand_FlyToByLayerGuid,t.GetGuidCommandPackData,e)},n.interface.SetCurrentLayerCommand=function(e){n.create_custom_command(n.CommandType.FrameCommand_SetCurrentLayer,t.GetGuidCommandPackData,e)},n.interface.ChangeVisibilityByGuidCommand=function(e,t){n.create_custom_command(n.CommandType.FrameCommand_ChangeVisibilityByGuid,a,[e,t])},n.interface.GetProjectPropertyCommand=function(e){n.create_custom_command(n.CommandType.FrameCommand_GetProjectProperty,t.GetGuidCommandPackData,[e])},n.interface.GetPipelineLayerPropertyCommand=function(e){n.create_custom_command(n.CommandType.FrameCommand_GetPipelineLayerProperty,t.GetGuidCommandPackData,[e])},n.interface.GetBlockLayerSymbolCommand=function(e){n.create_custom_command(n.CommandType.FrameCommand_GetBlockLayerSymbol,t.GetGuidCommandPackData,[e])},n.interface.GetBimSDBCommand=function(e){n.create_custom_command(n.CommandType.FrameCommand_GetBimSDB,t.GetGuidCommandPackData,[e])},i=function(e,t){t=new Q(e,t);return t.writeWString(e[2]),t.writeUint8(e[3]?1:0),e[3]&&t.writeUint8(e[4]?1:0),t.ValidData()},n.interface.cast_shadow=function(e){n.create_custom_command(n.CommandType.FrameCommand_CastShadow,i,e)},n.interface.set_current_project=function(e){n.create_custom_command(n.CommandType.FrameCommand_SetCurrentProject,t.GetGuidCommandPackData,[e])},n.RespondType={FrameRespond_OnDocumentChanged:0,FrameRespond_OnGetProjectProperty:1,FrameRespond_OnGetPipelineLayerProperty:2,FrameRespond_OnGetBlockLayerSymbol:3,FrameRespond_OnGetBimSDB:4,FrameRespond_OnDownloadFinished:5,FrameRespond_OnPOIHover:6,FrameRespond_OnPOILeave:7,FrameRespond_OnCastShadow:8},n.create_sub_handler(n.RespondType.FrameRespond_OnDocumentChanged,function(e){e=new TextDecoder("utf-16").decode(e),e=JSON.parse(e);null!=n.interface.init_layer_control&&n.interface.init_layer_control(e)}),n.create_sub_handler(n.RespondType.FrameRespond_OnGetProjectProperty,function(e){null!=n.interface.OnGetProjectProperty&&n.interface.OnGetProjectProperty(e)}),n.create_sub_handler(n.RespondType.FrameRespond_OnGetPipelineLayerProperty,function(e){null!=n.interface.OnGetPipelineLayerProperty&&n.interface.OnGetPipelineLayerProperty(e)}),n.create_sub_handler(n.RespondType.FrameRespond_OnGetBlockLayerSymbol,function(e){null!=n.interface.OnGetBlockLayerSymbol&&n.interface.OnGetBlockLayerSymbol(e)}),n.create_sub_handler(n.RespondType.FrameRespond_OnGetBimSDB,function(e){null!=n.interface.OnGetBimSDB&&n.interface.OnGetBimSDB(e)}),n.create_sub_handler(n.RespondType.FrameRespond_OnDownloadFinished,function(e){null!=n.interface.OnDownloadFinished&&n.interface.OnDownloadFinished(e)}),n.create_sub_handler(n.RespondType.FrameRespond_OnPOIHover,function(e){null!=n.interface.OnPOIHover&&n.interface.OnPOIHover(e)}),n.create_sub_handler(n.RespondType.FrameRespond_OnPOILeave,function(e){null!=n.interface.OnPOILeave&&n.interface.OnPOILeave(e)}),n.create_sub_handler(n.RespondType.FrameRespond_OnCastShadow,function(e){null!=n.interface.OnCastShadow&&n.interface.OnCastShadow(e)}),n.interface.init_layer_control=void 0,n.interface.OnGetProjectProperty=void 0,n.interface.OnGetPipelineLayerProperty=void 0,n.interface.OnGetBlockLayerSymbol=void 0,n.interface.OnGetBimSDB=void 0,n.interface.OnDownloadFinished=void 0,n.interface.OnPOIHover=void 0,n.interface.OnPOILeave=void 0,n.interface.OnCastShadow=void 0,e.stamp_frame=n.interface,n.interface)},oe.terrain_manager_interface=function(e,t){var c,o,s,a,l,n,i,r,m;return null!=e.terrain_manager_interface?e.terrain_manager_interface:((c=e.handlers.get(t.StampPixelStreamingHandleType.StampType_TerrainManager)).CommandType={TerrainManagerCommand_ClipTerrainByPolygon:0,TerrainManagerCommand_GetTerrainByPolygon:1,TerrainManagerCommand_GenerateSampledCoordinates:2,TerrainManagerCommand_GenerateClipModel:3,TerrainManagerCommand_GenerateTunnel:4,TerrainManagerCommand_GenerateRoundTunnel:5,TerrainManagerCommand_GenerateArchTunnel:6,TerrainManagerCommand_Clear:7,TerrainManagerCommand_SetTerrainAltitudeScale:8,TerrainManagerCommand_MaskTerrainByPolygon:9},o=function(e,t){var n,a,i=e[2],t=new Q(e,t),i=(t.writeLine(i),e[3]);return t.writeUint8(i?1:0),i&&(i=e[4],n=e[5],a=e[6],e=e[7],t.writeWString(i),t.writeWString(n),t.writeFloat64(a),t.writeUint8(e?1:0)),t.ValidData()},s=function(e,t){var n=e[2],a=new Q(e,t),t=(a.writePoly(n),e[3]);if(a.writeUint8(t?1:0),t){var n=e[4],t=e[5],i=e[6],e=e[7];if(a.writeWString(n),a.writeWString(t),i instanceof Array){var r=i.length;a.writeUint16(r);for(var o=0;o<r;++o)a.writeFloat64(i[o])}else a.writeFloat64(i);a.writeUint8(e?1:0)}return a.ValidData()},a=function(e,t){var n=e[2],a=e[3],i=e[4],e=new Q(e,t);return e.writeLine(n),e.writeFloat64(a),e.writeUint32(i),e.ValidData()},l=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=e[6],s=e[7],c=e[8],l=e[9],e=new Q(e,t);return e.writeLine(n),e.writeWString(a),e.writeWString(i),e.writeWString(r),e.writeFloat64(o),e.writeUint32(s),e.writeUint8(c?1:0),e.writeUint8(l?1:0),e.ValidData()},n=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=e[6],s=e[7],c=e[8],l=e[9],m=e[10],d=e[11],e=new Q(e,t);return e.writeLine(n),e.writeWString(a),null==c||c?(e.writeUint8(1),e.writeWString(i)):(e.writeUint8(0),e.writeUint32(i),e.writeUint32(null==l?0:l),e.writeFloat32(null==m?1:m)),e.writeFloat64(r),e.writeFloat64(o),e.writeUint8(s),e.writeUint8(d?1:0),e.ValidData()},i=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=e[6],s=e[7],c=e[8],l=e[9],m=e[10],d=e[11],e=new Q(e,t);return e.writeLine(n),e.writeWString(a),null==c||c?(e.writeUint8(1),e.writeWString(i)):(e.writeUint8(0),e.writeUint32(i),e.writeUint32(null==l?0:l),e.writeFloat32(null==m?1:m)),e.writeFloat64(r),e.writeUint32(o),e.writeUint8(s),e.writeUint8(d?1:0),e.ValidData()},c.interface.clip_terrain_by_polygon=function(e,t,n,a,i,r){i instanceof Array||(i=[i]),t?c.create_custom_command(c.CommandType.TerrainManagerCommand_ClipTerrainByPolygon,s,[e,t,n,a,i,r]):c.create_custom_command(c.CommandType.TerrainManagerCommand_ClipTerrainByPolygon,s,[e,!1])},c.interface.get_terrain_by_polygon=function(e,t,n,a,i,r){t?c.create_custom_command(c.CommandType.TerrainManagerCommand_GetTerrainByPolygon,o,[e,t,n,a,i,r]):c.create_custom_command(c.CommandType.TerrainManagerCommand_GetTerrainByPolygon,o,[e,!1])},r=function(e,t){var n=e[2],a=null==e[3]?.618:e[3],e=new Q(e,t);return e.writePoly(n),e.writeFloat32(a),e.ValidData()},c.interface.mask_screen_by_polygon=function(e,t){c.create_custom_command(c.CommandType.TerrainManagerCommand_MaskTerrainByPolygon,r,[e,t])},c.interface.generate_sampled_coordinates=function(e,t,n){c.create_custom_command(c.CommandType.TerrainManagerCommand_GenerateSampledCoordinates,a,[e,t,n])},c.interface.generate_clip_model=function(e,t,n,a,i,r,o,s){c.create_custom_command(c.CommandType.TerrainManagerCommand_GenerateClipModel,l,[e,t,n,a,i,r,o,s])},c.interface.generate_tunnel=function(e){c.create_custom_command(c.CommandType.TerrainManagerCommand_GenerateTunnel,n,e)},c.interface.generate_round_tunnel=function(e){c.create_custom_command(c.CommandType.TerrainManagerCommand_GenerateRoundTunnel,i,e)},c.interface.generate_arch_tunnel=function(e){c.create_custom_command(c.CommandType.TerrainManagerCommand_GenerateArchTunnel,n,e)},c.interface.clear=function(){c.create_custom_command(c.CommandType.TerrainManagerCommand_Clear,t.GetNoParamCommandPackData)},m=function(e,t){var n=e[2],e=new Q(e,t);return e.writeFloat64(n),e.ValidData()},c.interface.set_terrain_altitude_scale=function(e){c.create_custom_command(c.CommandType.TerrainManagerCommand_SetTerrainAltitudeScale,m,[e])},c.RespondType={TerrainManagerRespond_OnTerrainManagerResult:0},c.create_sub_handler(c.RespondType.TerrainManagerRespond_OnTerrainManagerResult,function(e){c.interface.OnTerrainManagerResult&&c.interface.OnTerrainManagerResult(e)}),c.interface.OnTerrainManagerResult=void 0,e.terrain_manager_interface=c.interface,c.interface)},se.tile_block_style_interface=function(e,t){var n,a,i,r;return null!=e.tile_block_style_interface?e.tile_block_style_interface:((n=e.handlers.get(t.StampPixelStreamingHandleType.StampType_TileBlockStyle)).CommandType={TileBlockStyleCommand_GetTileblockStyle:0,TileBlockStyleCommand_SetTileblockStyle:1,TileBlockStyleCommand_ClearFieldValueProperty:2,TileBlockStyleCommand_SaveStyle:3,TileBlockStyleCommand_Refresh:4},a=function(e,t){for(var n=new Q(e,t),a=2;a<e.length;++a)n.writeWString(e[a]);return n.ValidData()},i=function(e,t){var n=new Q(e,t);if(n.writeWString(e[2]),n.writeUint8(e[3]),n.writeUint8(e[4]),n.writeWString(e[5]),n.writeUint8(e[6]),n.writeWString(e[7]),n.writeFloat64(e[8]),n.writeUint8(e[9]),n.writeFloat64(e[10]),n.writeWString(e[11]),n.writeWString(e[12]),n.writeUint8(e[13]),n.writeUint32(e[14]),0<e[14])for(var a=e[15],i=0;i<a.length;++i)n.writeWString(a[i]);if(n.writeUint32(e[16]),0<e[16])for(a=e[17],i=0;i<a.length;++i)n.writeWString(a[i]);n.writeUint8(null==e[18]?0:e[18]);t=null==e[19]?0:e[19];if(n.writeUint32(t),0<t)for(a=e[20],i=0;i<a.length;++i)n.writeWString(a[i]);if(t=null==e[21]?0:e[21],n.writeUint32(t),0<t)for(a=e[22],i=0;i<a.length;++i)n.writeWString(a[i]);return n.ValidData()},r=function(e,t){t=new Q(e,t);return t.writeWString(e[2]),t.writeWString(e[3]),t.writeUint8(null==e[4]?1:e[4]),t.ValidData()},n.interface.get_tileblock_style=function(e){n.create_custom_command(n.CommandType.TileBlockStyleCommand_GetTileblockStyle,a,e)},n.interface.set_tileblock_style=function(e){n.create_custom_command(n.CommandType.TileBlockStyleCommand_SetTileblockStyle,i,e)},n.interface.clear_field_value_property=function(e){n.create_custom_command(n.CommandType.TileBlockStyleCommand_ClearFieldValueProperty,a,e)},n.interface.save_style=function(e){n.create_custom_command(n.CommandType.TileBlockStyleCommand_SaveStyle,r,e)},n.interface.refresh_style=function(e){n.create_custom_command(n.CommandType.TileBlockStyleCommand_Refresh,a,e)},n.RespondType={TileBlockStyleRespond_RespondGet:0},n.create_sub_handler(n.RespondType.TileBlockStyleRespond_RespondGet,function(e){n.interface.OnRespondGet&&n.interface.OnRespondGet(e)}),n.interface.OnRespondGet=void 0,e.tile_block_style_interface=n.interface,n.interface)},ce.track_interface=function(e,t){var c,n,a,i,r,o,s,l,m,d;return null!=e.track_interface?e.track_interface:((c=e.handlers.get(t.StampPixelStreamingHandleType.StampType_TrackInterface)).CommandType={Interface_ApplyTrackList:0,Interface_LoadTrack:1,Interface_UnLoadTrack:2,Interface_CreateTrack:3,Interface_DeleteTrack:4,Interface_CommitChangesTrack:5,Interface_SetMainTrack:6,Interface_PlayTrack:7,Interface_StopTrack:8,Interface_PauseTrack:9,Interface_ResumeTrack:10,Interface_InitFirstPersonTrack:11,Interface_InitFollowTrack:12,Interface_SetTrackType:13,Interface_EditRoute:14,Interface_EditPass:15,Interface_SetTrackVisible:16},n=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.ValidData()},a=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeUint8(a?1:0),e.ValidData()},i=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeInt32(a),e.ValidData()},r=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.writeInt32(i),e.writeUint8(r?1:0),e.ValidData()},o=function(e,t){var n=e[2],a=e[3],i=e[4],e=new Q(e,t);return e.writeWString(n),e.writeFloat64(a),e.writeFloat64(i),e.ValidData()},s=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=e[6],e=new Q(e,t);return e.writeWString(n),e.writeFloat64(a),e.writeFloat64(i),e.writeFloat64(r),e.writeFloat64(o),e.ValidData()},l=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=e[6],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.writeFloat64(i),e.writeFloat64(r),e.writeFloat64(o),e.ValidData()},m=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=e[6],s=e[7],c=e[8],l=e[9],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.writeFloat64(i),e.writeFloat64(r),e.writeFloat64(o),e.writeFloat64(s),e.writeFloat64(c),e.writeFloat64(l),e.ValidData()},d=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeUint8(a?1:0),e.ValidData()},c.interface.apply_track_list=function(){c.create_custom_command(c.CommandType.Interface_ApplyTrackList,t.GetNoParamCommandPackData)},c.interface.load_track=function(e,t){c.create_custom_command(c.CommandType.Interface_LoadTrack,n,[e,t=t||""])},c.interface.unload_track=function(e){c.create_custom_command(c.CommandType.Interface_UnLoadTrack,t.GetGuidCommandPackData,[e])},c.interface.create_track=function(e){c.create_custom_command(c.CommandType.Interface_CreateTrack,t.GetGuidCommandPackData,[e]),t.Cursor.set_edit()},c.interface.delete_track=function(e){c.create_custom_command(c.CommandType.Interface_DeleteTrack,t.GetGuidCommandPackData,[e])},c.interface.commit_changes_track=function(e,t){c.create_custom_command(c.CommandType.Interface_CommitChangesTrack,a,[e,t])},c.interface.set_main_track=function(e,t){c.create_custom_command(c.CommandType.Interface_SetMainTrack,i,[e,t])},c.interface.play_track=function(e,t,n,a){c.create_custom_command(c.CommandType.Interface_PlayTrack,r,[e,t,n,a])},c.interface.stop_track=function(e){c.create_custom_command(c.CommandType.Interface_StopTrack,t.GetGuidCommandPackData,[e])},c.interface.pause_track=function(e){c.create_custom_command(c.CommandType.Interface_PauseTrack,t.GetGuidCommandPackData,[e])},c.interface.resume_track=function(e){c.create_custom_command(c.CommandType.Interface_ResumeTrack,t.GetGuidCommandPackData,[e])},c.interface.init_first_person_track=function(e,t,n){c.create_custom_command(c.CommandType.Interface_InitFirstPersonTrack,o,[e,t,n])},c.interface.init_follow_track=function(e,t,n,a,i){c.create_custom_command(c.CommandType.Interface_InitFollowTrack,s,[e,t,n,a,i])},c.interface.set_track_type=function(e,t){c.create_custom_command(c.CommandType.Interface_SetTrackType,i,[e,t])},c.interface.edit_route=function(e,t,n,a,i){c.create_custom_command(c.CommandType.Interface_EditRoute,l,[e,t,n,a,i])},c.interface.edit_pass=function(e,t,n,a,i,r,o,s){c.create_custom_command(c.CommandType.Interface_EditPass,m,[e,t,n,a,i,r,o,s])},c.interface.set_track_visible=function(e,t){c.create_custom_command(c.CommandType.Interface_SetTrackVisible,d,[e,t])},c.RespondType={InterfaceRespond_OnTrackListLoaded:0,InterfaceRespond_OnTrackLoaded:1,InterfaceRespond_OnTrackFinished:2},c.create_sub_handler(c.RespondType.InterfaceRespond_OnTrackListLoaded,function(e){for(var t in c.interface.track_list=c.interface.track_list||{},e.tracks){t=e.tracks[t];t.guid in c.interface.track_list||(c.interface.track_list[t.guid]=t)}c.interface.OnTrackListLoaded&&c.interface.OnTrackListLoaded(e.tracks)}),c.create_sub_handler(c.RespondType.InterfaceRespond_OnTrackLoaded,function(e){c.interface.track_list=c.interface.track_list||{},c.interface.track_list[e.guid]=e,c.interface.OnTrackLoaded&&c.interface.OnTrackLoaded(e),t.Cursor.reset()}),c.create_sub_handler(c.RespondType.InterfaceRespond_OnTrackFinished,function(e){c.interface.OnTrackFinished&&c.interface.OnTrackFinished(e)}),c.interface.OnTrackListLoaded=void 0,c.interface.OnTrackLoaded=void 0,c.interface.OnTrackFinished=void 0,e.track_interface=c.interface,c.interface)},le.vector_tile_layer_interface=function(e,t){if(null!=e.vector_tile_layer_interface)return e.vector_tile_layer_interface;var n=e.handlers.get(t.StampPixelStreamingHandleType.StampType_VectorTileLayer);function c(e,t){e=parseInt("0x"+e.toString().substring(1).toLowerCase());t.writeUint32(e)}n.CommandType={VectorTileLayerCommand_GetSubLayerVisible:0,VectorTileLayerCommand_SetSubLayerVisible:1,VectorTileLayerCommand_GetClassNums:2,VectorTileLayerCommand_InsertClass:3,VectorTileLayerCommand_RemoveClass:4,VectorTileLayerCommand_SaveMap:5,VectorTileLayerCommand_GetMapFile:6,VectorTileLayerCommand_GetDataType:7,VectorTileLayerCommand_SetAlpha:8,VectorTileLayerCommand_GetAlpha:9,VectorTileLayerCommand_GetUMGStyleNum:10,VectorTileLayerCommand_AddOrUpdateUMGStyle:11,VectorTileLayerCommand_GetUMGStyle:12,VectorTileLayerCommand_RemoveUMGStyle:13,VectorTileLayerCommand_SaveUMGStyle:14,VectorTileLayerCommand_GetAllUmgResources:15,VectorTileLayerCommand_GetWidgetConfig:16,VectorTileLayerCommand_SetUseUmgStyle:17,VectorTileLayerCommand_GetUseUmgStyle:18,VectorTileLayerCommand_GetMsUploadFile:19};function a(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.writeUint8(e[3]),t.ValidData()}function i(e,t){for(var n=new Q(e,t),a=2;a<e.length;++a)n.writeWString(e[a]);return n.ValidData()}function r(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.writeWString(e[3]),t.writeUint8(null==e[4]?1:e[4]),t.ValidData()}function o(e,t){var n=new Q(e,t);n.writeWString(e[2]);for(var a=3;a<e.length;++a)n.writeUint32(e[a]);return n.ValidData()}function s(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.writeUint32(e[3]),t.writeUint8(e[4]?1:0),t.ValidData()}function l(e,t){for(var n=new Q(e,t),a=(n.writeWString(e[2]),n.writeUint32(e[3]),4),i=0;i<e[3];++i){n.writeWString(e[a]),a+=1,n.writeWString(e[a]),a+=1,n.writeUint32(e[a]),a+=1,n.writeUint32(e[a]),a+=1,n.writeFloat32(e[a][0]),n.writeFloat32(e[a][1]),a+=1,n.writeUint8(e[a]);var r=e[a+=1];a+=1,n.writeUint32(r);for(var o=0;o<r;++o)n.writeWString(e[a]),a+=1,n.writeWString(e[a]),a+=1,n.writeWString(e[a]),a+=1,n.writeUint32(e[a]),a+=1,n.writeUint32(e[a]),a+=1,n.writeFloat32(e[a]),a+=1,n.writeUint32(e[a]),c(e[a+=1],n),c(e[a+=1],n),a+=1,n.writeFloat32(e[a][0]),n.writeFloat32(e[a][1]),c(e[a+=1],n),a+=1,n.writeFloat32(e[a]),a+=1,n.writeWString(e[a]),a+=1;var s=e[a];a+=1,n.writeUint32(s);for(o=0;o<s;++o)n.writeWString(e[a]),a+=1,n.writeWString(e[a]),c(e[a+=1],n),a+=1,n.writeUint8(e[a]),a+=1}return n.ValidData()}function m(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.writeWString(e[3]),t.ValidData()}function d(e,t){var n=new Q(e,t);n.writeWString(e[2]),n.writeUint32(e[3]);for(var a=0;a<e[3];++a)n.writeWString(e[4+a]);return n.ValidData()}function u(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.writeWString(e[3]),t.writeUint8(null==e[4]?1:e[4]),t.ValidData()}function g(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.ValidData()}n.interface.get_sub_layer_visible=function(e){n.create_custom_command(n.CommandType.VectorTileLayerCommand_GetSubLayerVisible,i,e)},n.interface.set_sub_layer_visible=function(e){n.create_custom_command(n.CommandType.VectorTileLayerCommand_SetSubLayerVisible,s,e)},n.interface.get_class_nums=function(e){n.create_custom_command(n.CommandType.VectorTileLayerCommand_GetClassNums,o,e)},n.interface.insert_class=function(e){n.create_custom_command(n.CommandType.VectorTileLayerCommand_InsertClass,o,e)},n.interface.remove_class=function(e){n.create_custom_command(n.CommandType.VectorTileLayerCommand_RemoveClass,o,e)},n.interface.save_map=function(e){n.create_custom_command(n.CommandType.VectorTileLayerCommand_SaveMap,r,e)},n.interface.get_map_file=function(e){n.create_custom_command(n.CommandType.VectorTileLayerCommand_GetMapFile,i,e)},n.interface.get_data_type=function(e){n.create_custom_command(n.CommandType.VectorTileLayerCommand_GetDataType,i,e)},n.interface.set_alpha=function(e){n.create_custom_command(n.CommandType.VectorTileLayerCommand_SetAlpha,o,e)},n.interface.get_alpha=function(e){n.create_custom_command(n.CommandType.VectorTileLayerCommand_GetAlpha,t.GetGuidCommandPackData,[e])},n.interface.get_umg_style_num=function(e){n.create_custom_command(n.CommandType.VectorTileLayerCommand_GetUMGStyleNum,t.GetGuidCommandPackData,[e])},n.interface.add_or_update_umg_style=function(e){n.create_custom_command(n.CommandType.VectorTileLayerCommand_AddOrUpdateUMGStyle,l,e)},n.interface.get_umg_style=function(e){n.create_custom_command(n.CommandType.VectorTileLayerCommand_GetUMGStyle,m,e)},n.interface.remove_umg_style=function(e){n.create_custom_command(n.CommandType.VectorTileLayerCommand_RemoveUMGStyle,d,e)},n.interface.save_umg_style=function(e){n.create_custom_command(n.CommandType.VectorTileLayerCommand_SaveUMGStyle,u,e)},n.interface.get_umg_resources=function(e){n.create_custom_command(n.CommandType.VectorTileLayerCommand_GetAllUmgResources,t.GetGuidCommandPackData,[e])},n.interface.get_widget_config=function(){n.create_custom_command(n.CommandType.VectorTileLayerCommand_GetWidgetConfig,t.GetNoParamCommandPackData)},n.interface.set_use_umg_style=function(e){n.create_custom_command(n.CommandType.VectorTileLayerCommand_SetUseUmgStyle,a,e)},n.interface.get_use_umg_style=function(e){n.create_custom_command(n.CommandType.VectorTileLayerCommand_GetUseUmgStyle,t.GetGuidCommandPackData,[e])},n.interface.get_ms_upload_file=function(e){n.create_custom_command(n.CommandType.VectorTileLayerCommand_GetMsUploadFile,g,[e])};return n.RespondType={VectorTileLayerRespond_RespondGet:0},n.create_sub_handler(n.RespondType.VectorTileLayerRespond_RespondGet,function(e){n.interface.OnRespondGet&&n.interface.OnRespondGet(e)}),n.interface.OnRespondGet=void 0,e.vector_tile_layer_interface=n.interface,n.interface},me.volumetric_cloud_interface=function(e,t){var i,n;return null!=e.volumetric_cloud_interface?e.volumetric_cloud_interface:((i=e.handlers.get(t.StampPixelStreamingHandleType.StampType_VolumetricCloud)).PixelStreaminStampVolumetricCloudDataType={VolumetricCloudCommand_SetLayerBottomAltitude:0,VolumetricCloudCommand_SetLayerHeight:1,VolumetricCloudCommand_SetTracingMaxDistance:2,VolumetricCloudCommand_SetVisibility:3,VolumetricCloudCommand_SetVisibleHeight:4},i.CommandType={VolumetricCloudCommand_SetData:0,VolumetricCloudCommand_GetVolumetricCloud:1},n=function(e,t){var n,a,t=new Q(e,t),e=e[2];return n=e,a=BigInt(0),null!=n&&(null!=n.layerBottomAltitude&&(a+=BigInt(1)<<BigInt(i.PixelStreaminStampVolumetricCloudDataType.VolumetricCloudCommand_SetLayerBottomAltitude)),null!=n.layerHeight&&(a+=BigInt(1)<<BigInt(i.PixelStreaminStampVolumetricCloudDataType.VolumetricCloudCommand_SetLayerHeight)),null!=n.tracingMaxDistance&&(a+=BigInt(1)<<BigInt(i.PixelStreaminStampVolumetricCloudDataType.VolumetricCloudCommand_SetTracingMaxDistance)),null!=n.visibility&&(a+=BigInt(1)<<BigInt(i.PixelStreaminStampVolumetricCloudDataType.VolumetricCloudCommand_SetVisibility)),null!=n.visibleHeight)&&(a+=BigInt(1)<<BigInt(i.PixelStreaminStampVolumetricCloudDataType.VolumetricCloudCommand_SetVisibleHeight)),t.writeUint64(a),null!=e&&(null!=e.layerBottomAltitude&&t.writeFloat32(e.layerBottomAltitude),null!=e.layerHeight&&t.writeFloat32(e.layerHeight),null!=e.tracingMaxDistance&&t.writeFloat32(e.tracingMaxDistance),null!=e.visibility&&t.writeUint8(e.visibility?1:0),null!=e.visibleHeight)&&t.writeFloat64(e.visibleHeight),t.ValidData()},i.interface.set_cloud_data=function(e){i.create_custom_command(i.CommandType.VolumetricCloudCommand_SetData,n,e)},i.interface.get_volumetric_cloud=function(){i.create_custom_command(i.CommandType.VolumetricCloudCommand_GetVolumetricCloud,t.GetNoParamCommandPackData)},i.RespondType={VolumetricCloudRespond_VolumetricCloudGet:0},i.create_sub_handler(i.RespondType.VolumetricCloudRespond_VolumetricCloudGet,function(e){i.interface.OnVolumetricCloudGet&&i.interface.OnVolumetricCloudGet(e)}),i.interface.OnVolumetricCloudGet=void 0,e.volumetric_cloud_interface=i.interface,i.interface)},de.powerline_interface=function(e,t){var c,i,n,o,a,r,s,l,m,d,u,g;return null!=e.powerline_interface?e.powerline_interface:((c=e.handlers.get(t.StampPixelStreamingHandleType.StampType_PowerLineControl)).CommandType={Interface_GetPowerLineLayerList:0,Interface_AddPowerLineLayer:1,Interface_SavePowerLineLayer:2,Interface_LoadPowerLineLayer:3,Interface_UnloadPowerLineLayer:4,Interface_LockPowerLineLayer:5,Interface_UnlockPowerLineLayer:6,Interface_DeletePowerLineLayer:7,Interface_AddLineToLayer:8,Interface_RemoveLineToLayer:9,Interface_PublishPowerLineLayer:10,Interface_SaveAll:11,Interface_GotoLine:12,Interface_GotoTower:13,Interface_NeedClamp:14,Interface_UseColor:15,Interface_UsePhase:16,Interface_ShowHighlightLine:17,Interface_StopHighlightLine:18,Interface_ShowHighlightLinePhase:19,Interface_StopHighlightLinePhase:20,Interface_ShowHighlightComponent:21,Interface_StopHighlightComponent:22,Interface_ExportPowerLineLayer:23,Interface_SetMountPointEditObject:24,Interface_GenerateMountPoint:25,Interface_GetMountPointCode:26,Interface_RecodeMountPoint:27,Interface_DeleteMountPoint:28,Interface_SaveMountPoint:29,Interface_ExportMountPoint:30,Interface_ResetMountPoint:31,Interface_SelectComponent:32,Interface_MoveDevice:33,Interface_RotateDevice:34,Interface_AlignGroundDevice:35,Interface_ReplaceMeshLink:36,Interface_DeleteTower:37,Interface_DeleteLineSegment:38,Interface_LinkTowers:39,Interface_GetDevicePosition:40,Interface_SetDevicePosition:41},i=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.writeWString(i),e.writeWString(r),e.ValidData()},n=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.ValidData()},o=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=e[6],s=e[7],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.writeUint8(i?1:0),e.writeUint8(r?1:0),e.writeUint8(o?1:0),e.writeUint8(s?1:0),e.ValidData()},a=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.ValidData()},r=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeUint8(a?1:0),e.ValidData()},s=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.writeUint8(i?1:0),e.writeUint8(r?1:0),e.ValidData()},l=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.ValidData()},m=function(e,t){var n=e[2],a=e[3],i=e[4],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.writeInt32(i),e.ValidData()},d=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeUint32(a),e.ValidData()},u=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.writeWString(i),e.writeUint8(r?1:0),e.ValidData()},g=function(e,t){var n=e[2],a=e[3],i=e[4],r=new Q(e,t);r.writeUint16(n.length);for(var o=0,s=n.length;o<s;++o)r.writeWString(n[o].guid),r.writeFloat64(n[o].position.x),r.writeFloat64(n[o].position.y),r.writeFloat64(n[o].position.z),r.writeFloat64(n[o].heading);return r.writeUint8(a?1:0),r.writeUint8(i?1:0),r.ValidData()},c.interface.get_powerline_layer_list=function(){c.create_custom_command(c.CommandType.Interface_GetPowerLineLayerList,t.GetNoParamCommandPackData)},c.interface.add_powerline_layer=function(e){c.create_custom_command(c.CommandType.Interface_AddPowerLineLayer,t.GetGuidCommandPackData,[e])},c.interface.save_powerline_layer=function(e){c.create_custom_command(c.CommandType.Interface_SavePowerLineLayer,t.GetGuidCommandPackData,[e])},c.interface.load_powerline_layer=function(e){c.create_custom_command(c.CommandType.Interface_LoadPowerLineLayer,t.GetGuidCommandPackData,[e])},c.interface.unload_powerline_layer=function(e){c.create_custom_command(c.CommandType.Interface_UnloadPowerLineLayer,t.GetGuidCommandPackData,[e])},c.interface.lock_powerline_layer=function(e){c.create_custom_command(c.CommandType.Interface_LockPowerLineLayer,t.GetGuidCommandPackData,[e])},c.interface.unlock_powerline_layer=function(e){c.create_custom_command(c.CommandType.Interface_UnlockPowerLineLayer,t.GetGuidCommandPackData,[e])},c.interface.delete_powerline_layer=function(e){c.create_custom_command(c.CommandType.Interface_DeletePowerLineLayer,t.GetGuidCommandPackData,[e])},c.interface.add_line_to_layer=function(e,t,n,a){c.create_custom_command(c.CommandType.Interface_AddLineToLayer,i,[e,t,n=n||"",a=a||""])},c.interface.remove_line_to_layer=function(e,t){c.create_custom_command(c.CommandType.Interface_RemoveLineToLayer,n,[e,t])},c.interface.publish_powerline_layer=function(e,t,n,a,i,r){c.create_custom_command(c.CommandType.Interface_PublishPowerLineLayer,o,[e,t=t||"",n=null==n?!1:n,a=null==a?!0:a,i=null==i?!0:i,r=null==r?!1:r])},c.interface.save_all_layers=function(){c.create_custom_command(c.CommandType.Interface_SaveAll,t.GetNoParamCommandPackData)},c.interface.goto_line=function(e,t){c.create_custom_command(c.CommandType.Interface_GotoLine,n,[e,t])},c.interface.goto_tower=function(e,t){c.create_custom_command(c.CommandType.Interface_GotoTower,n,[e,t])},c.interface.set_layer_clamp=function(e,t){c.create_custom_command(c.CommandType.Interface_NeedClamp,r,[e,t])},c.interface.set_layer_use_color=function(e,t){c.create_custom_command(c.CommandType.Interface_UseColor,r,[e,t])},c.interface.set_layer_use_phase=function(e,t){c.create_custom_command(c.CommandType.Interface_UsePhase,r,[e,t])},c.interface.layer_show_highlight_line=function(e,t,n,a){c.create_custom_command(c.CommandType.Interface_ShowHighlightLine,s,[e,t,n,a])},c.interface.layer_stop_highlight_line=function(e,t){c.create_custom_command(c.CommandType.Interface_StopHighlightLine,l,[e,t])},c.interface.layer_show_highlight_line_phase=function(e,t,n){c.create_custom_command(c.CommandType.Interface_ShowHighlightLinePhase,m,[e,t,n])},c.interface.layer_stop_highlight_line_phase=function(e,t,n){c.create_custom_command(c.CommandType.Interface_StopHighlightLinePhase,m,[e,t,n])},c.interface.layer_show_highlight_component=function(e){c.create_custom_command(c.CommandType.Interface_ShowHighlightComponent,t.GetGuidCommandPackData,[e])},c.interface.layer_stop_highlight_component=function(e){c.create_custom_command(c.CommandType.Interface_StopHighlightComponent,t.GetGuidCommandPackData,[e])},c.interface.export_layer_data=function(e,t){c.create_custom_command(c.CommandType.Interface_ExportPowerLineLayer,a,[e,t=t||""])},c.interface.set_edit_object_for_mount_point=function(e,t){c.create_custom_command(c.CommandType.Interface_SetMountPointEditObject,d,[e,t])},c.interface.generate_mount_point=function(){c.create_custom_command(c.CommandType.Interface_GenerateMountPoint,t.GetNoParamCommandPackData)},c.interface.get_mount_point_code=function(e){c.create_custom_command(c.CommandType.Interface_GetMountPointCode,t.GetGuidCommandPackData,[e])},c.interface.recode_mount_point=function(e,t){c.create_custom_command(c.CommandType.Interface_RecodeMountPoint,d,[e,t])},c.interface.delete_mount_point=function(e){c.create_custom_command(c.CommandType.Interface_DeleteMountPoint,t.GetGuidCommandPackData,[e])},c.interface.save_mount_point=function(e){c.create_custom_command(c.CommandType.Interface_SaveMountPoint,t.GetGuidCommandPackData,[e])},c.interface.export_mount_point=function(){c.create_custom_command(c.CommandType.Interface_ExportMountPoint,t.GetNoParamCommandPackData)},c.interface.reset_mount_point=function(){c.create_custom_command(c.CommandType.Interface_ResetMountPoint,t.GetNoParamCommandPackData)},c.interface.select_component=function(){c.create_custom_command(c.CommandType.Interface_SelectComponent,t.GetNoParamCommandPackData),t.Cursor.set_edit()},c.interface.move_device=function(e){c.create_custom_command(c.CommandType.Interface_MoveDevice,t.GetGuidCommandPackData,[e]),""==e&&t.Cursor.set_edit()},c.interface.rotate_device=function(e){c.create_custom_command(c.CommandType.Interface_RotateDevice,t.GetGuidCommandPackData,[e]),""==e&&t.Cursor.set_edit()},c.interface.align_ground_device=function(e){c.create_custom_command(c.CommandType.Interface_AlignGroundDevice,t.GetGuidCommandPackData,[e]),""==e&&t.Cursor.set_edit()},c.interface.replace_mesh_link=function(e,t){c.create_custom_command(c.CommandType.Interface_ReplaceMeshLink,n,[e,t])},c.interface.delete_tower=function(e){c.create_custom_command(c.CommandType.Interface_DeleteTower,t.GetGuidCommandPackData,[e])},c.interface.delete_line_segment=function(e,t){c.create_custom_command(c.CommandType.Interface_DeleteLineSegment,n,[e,t])},c.interface.link_towers=function(e,t,n,a){c.create_custom_command(c.CommandType.Interface_LinkTowers,u,[e,t,n,a])},c.interface.get_tower_position=function(e){c.create_custom_command(c.CommandType.Interface_GetDevicePosition,t.GetGuidCommandPackData,[e])},c.interface.set_tower_position=function(e,t,n){c.create_custom_command(c.CommandType.Interface_SetDevicePosition,g,[e,t,n])},c.RespondType={InterfaceRespond_OnGetLayerList:0,InterfaceRespond_OnAddLayer:1,InterfaceRespond_OnConductPowerLine:2,InterfaceRespond_OnGetCurrMountPointCode:3,InterfaceRespond_OnExportMountPoint:4,InterfaceRespond_OnGetComponentInfo:5,InterfaceRespond_OnGetDevicePosition:6},c.interface.layer_list=void 0,c.interface.OnGetLayerList=void 0,c.interface.OnAddLayer=void 0,c.interface.OnConductPowerLine=void 0,c.interface.OnGetCurrMountPointCode=void 0,c.interface.OnExportMountPoint=void 0,c.interface.OnGetComponentInfo=void 0,c.interface.OnGetDevicePosition=void 0,c.create_sub_handler(c.RespondType.InterfaceRespond_OnGetLayerList,function(e){for(var t in c.interface.layer_list=c.interface.layer_list||{},e.edit_powerline_layers){var n=e.edit_powerline_layers[t],t=(c.interface.layer_list[n.guid]=n).range;if(c.interface.layer_list[n.guid].range={},null!=t)for(var a,i,r=t.split(" "),o=0,s=r.length;o<s;++o)""!=r[o]&&2==(a=r[o].split(":")).length&&""!=a[0]&&(c.interface.layer_list[n.guid].range[a[0]]={start:"",end:""},2==(i=a[1].split(",")).length)&&null!=i[0]&&null!=i[1]&&(c.interface.layer_list[n.guid].range[a[0]].start=i[0],c.interface.layer_list[n.guid].range[a[0]].end=i[1])}c.interface.OnGetLayerList&&c.interface.OnGetLayerList(e.edit_powerline_layers)}),c.create_sub_handler(c.RespondType.InterfaceRespond_OnAddLayer,function(e){c.interface.layer_list=c.interface.layer_list||{},c.interface.layer_list[e.guid]=e,c.interface.layer_list[e.guid].range={},c.interface.OnAddLayer&&c.interface.OnAddLayer(e)}),c.create_sub_handler(c.RespondType.InterfaceRespond_OnConductPowerLine,function(e){null!=c.interface.layer_list&&e.guid in c.interface.layer_list&&"successful"==e.result&&("del"==e.type?delete c.interface.layer_list[e.guid]:"lock"==e.type?c.interface.layer_list[e.guid].is_lock=!0:"unlock"==e.type?c.interface.layer_list[e.guid].is_lock=!1:"add_line"==e.type?(c.interface.layer_list[e.guid].range=c.interface.layer_list[e.guid].range||{},c.interface.layer_list[e.guid].range[e.line]={start:"",end:""}):"remove_line"==e.type&&(c.interface.layer_list[e.guid].range=c.interface.layer_list[e.guid].range||{},e.line in c.interface.layer_list[e.guid].range)&&delete c.interface.layer_list[e.guid].range[e.line]),c.interface.OnConductPowerLine&&c.interface.OnConductPowerLine(e)}),c.create_sub_handler(c.RespondType.InterfaceRespond_OnGetCurrMountPointCode,function(e){c.interface.OnGetCurrMountPointCode&&c.interface.OnGetCurrMountPointCode(e)}),c.create_sub_handler(c.RespondType.InterfaceRespond_OnExportMountPoint,function(e){c.interface.OnExportMountPoint&&c.interface.OnExportMountPoint(e)}),c.create_sub_handler(c.RespondType.InterfaceRespond_OnGetComponentInfo,function(e){c.interface.OnGetComponentInfo&&c.interface.OnGetComponentInfo(e)}),c.create_sub_handler(c.RespondType.InterfaceRespond_OnGetDevicePosition,function(e){c.interface.OnGetDevicePosition&&c.interface.OnGetDevicePosition(e)}),e.powerline_interface=c.interface,c.interface)},ue.weather_interface=function(e,t){var n,a;return null!=e.weather_interface?e.weather_interface:((n=e.handlers.get(t.StampPixelStreamingHandleType.StampType_Weather)).CommandType={WeatherCommand_StartWeather:0,WeatherCommand_StopWeather:1,WeatherCommand_SetEffectByValue:2},a=function(t,e){var n=new Q(t,e);for(let e=2;e<t.length;++e)n.writeUint32(t[e]);return n.ValidData()},n.interface.start_weather=function(e){n.create_custom_command(n.CommandType.WeatherCommand_StartWeather,a,e)},n.interface.stop_weather=function(){n.create_custom_command(n.CommandType.WeatherCommand_StopWeather,t.GetNoParamCommandPackData)},n.interface.set_effect_value=function(e){n.create_custom_command(n.CommandType.WeatherCommand_SetEffectByValue,a,e)},e.weather_interface=n.interface,n.interface)},ge.video_recorder_control=function(e,t){var o,s,n;return null!=e.video_recorder_control?e.video_recorder_control:((o=e.handlers.get(t.StampPixelStreamingHandleType.StampType_VideoRecorderInterface)).CommandType={Interface_BeginCapture:0,Interface_CaptureFrame:1,Interface_EndCapture:2},s=function(e,t){t=new Q(e,t);return t.writeWString(e[2]),t.writeWString(e[3]),t.writeInt32(e[4]),t.writeInt32(e[5]),t.writeFloat64(e[6]),t.writeUint8(e[7]?1:0),t.ValidData()},o.interface.begin_capture=function(e,t,n,a,i,r){o.create_custom_command(o.CommandType.Interface_BeginCapture,s,[e,t,n,a,i,r])},n=function(e,t){t=new Q(e,t);return t.writeFloat64(e[2]),t.ValidData()},o.interface.capture_frame=function(e){o.create_custom_command(o.CommandType.Interface_CaptureFrame,n,[e])},o.interface.end_capture=function(){o.create_custom_command(o.CommandType.Interface_EndCapture,t.GetNoParamCommandPackData)},o.RespondType={InterfaceRespond_OnBeginCaptureFinished:0,InterfaceRespond_OnEndCaptureFinished:1},o.create_sub_handler(o.RespondType.InterfaceRespond_OnBeginCaptureFinished,function(e){o.interface.OnBeginCaptureFinished&&o.interface.OnBeginCaptureFinished(e)}),o.create_sub_handler(o.RespondType.InterfaceRespond_OnEndCaptureFinished,function(e){o.interface.OnEndCaptureFinished&&o.interface.OnEndCaptureFinished(e)}),o.interface.OnBeginCaptureFinished=void 0,o.interface.OnEndCaptureFinished=void 0,e.video_recorder_control=o.interface,o.interface)},he.mass_interface=function(e,s){var c,l,n,i;return null!=e.mass_interface?e.mass_interface:((c=e.handlers.get(s.StampPixelStreamingHandleType.StampType_MassControl)).CommandType={Interface_CreateTrackEx:0,Interface_LoadTrackEx:1,Interface_UnLoadTrackEx:2,Interface_PlayTrackEx:3,Interface_StopTrackEx:4,Interface_AddScheme:5,Interface_RemoveScheme:6},l=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=e[6],s=e[7],c=e[8],e=new Q(e,t);return e.writeWString(n),e.writeFloat64(a),e.writeFloat64(i),e.writeUint8(0<r?1:0),e.writeFloat64(r),e.writeUint8(o?1:0),e.writeFloat64(s),e.writeFloat64(c),e.ValidData()},n=function(e,t){var n=e[2],a=e[3],e=new Q(e,t);return e.writeWString(n),e.writeWString(a),e.ValidData()},i=function(e,t){var n=e[2],a=e[3],i=e[4],r=e[5],o=new Q(e,t);o.writeWString(n),o.writeUint32(a),o.writeInt32(i),o.writeUint32(r.length);for(var s=0,c=r.length;s<c;++s)o.writeWString(r[s].path),o.writeFloat64(r[s].rate),o.writeUint32(r[s].weight);return o.ValidData()},c.interface.create_track=function(e,t,n,a,i,r,o){c.create_custom_command(c.CommandType.Interface_CreateTrackEx,l,[e,t,n,a,i,r,o]),s.Cursor.set_edit()},c.interface.load_track=function(e,t){c.create_custom_command(c.CommandType.Interface_LoadTrackEx,n,[e,t=t||""])},c.interface.unload_track=function(e){c.create_custom_command(c.CommandType.Interface_UnLoadTrackEx,s.GetGuidCommandPackData,[e])},c.interface.play_mass=function(){c.create_custom_command(c.CommandType.Interface_PlayTrackEx,s.GetNoParamCommandPackData)},c.interface.stop_mass=function(){c.create_custom_command(c.CommandType.Interface_StopTrackEx,s.GetNoParamCommandPackData)},c.interface.add_scheme=function(e,t,n,a){c.create_custom_command(c.CommandType.Interface_AddScheme,i,[e,t,n,a])},c.interface.remove_scheme=function(e){c.create_custom_command(c.CommandType.Interface_RemoveScheme,s.GetGuidCommandPackData,[e])},c.RespondType={InterfaceRespond_OnMassLoaded:0,InterfaceRespond_OnMassFinished:1,InterfaceRespond_OnMassSchemeChanged:2},c.create_sub_handler(c.RespondType.InterfaceRespond_OnMassLoaded,function(e){e=new TextDecoder("utf-16").decode(e),e=JSON.parse(e);c.interface.mass_list=c.interface.mass_list||{},c.interface.mass_list[e.guid]=e,c.interface.OnMassLoaded&&c.interface.OnMassLoaded(e),s.Cursor.reset()}),c.create_sub_handler(c.RespondType.InterfaceRespond_OnMassFinished,function(e){c.interface.OnMassFinished&&c.interface.OnMassFinished(e)}),c.create_sub_handler(c.RespondType.InterfaceRespond_OnMassSchemeChanged,function(e){c.interface.OnMassSchemeChanged&&c.interface.OnMassSchemeChanged(e)}),c.interface.OnMassLoaded=void 0,c.interface.OnMassFinished=void 0,c.interface.OnMassSchemeChanged=void 0,e.mass_interface=c.interface,c.interface)},_e.postprocessing_interface=function(e,t){if(null!=e.postprocessing_interface)return e.postprocessing_interface;function n(e,t){var n,a,t=new Q(e,t),e=e[2],i=(i=e,a=BigInt(0),null!=i&&(null!=i.autoExposure&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_AutoExposure)),null!=i.autoExposureBias&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_AutoExposureBias)),null!=i.autoExposureMethod&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_AutoExposureMethod)),null!=i.autoExposureExtendDefaultLuminanceRange&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_AutoExposureExtendDefaultLuminanceRange)),null!=i.autoExposureLowPercent&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_AutoExposureLowPercent)),null!=i.autoExposureHightPercent&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_AutoExposureHighPercent)),null!=i.autoExposureMinBrightness&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_AutoExposureMinBrightness)),null!=i.autoExposureMaxBrightness&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_AutoExposureMaxBrightness)),null!=i.autoExposureSpeedDown&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_AutoExposureSpeedDown)),null!=i.autoExposureSpeedUp&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_AutoExposureSpeedUp)),null!=i.exposureApplyPhysicalCameraExposure&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ExposureApplyPhysicalCameraExposure)),null!=i.histogramLogMin&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_HistogramLogMin)),null!=i.histogramLogMax&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_HistogramLogMax)),null!=i.whiteTemp&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_WhiteTemp)),null!=i.whiteTint&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_WhiteTint)),null!=i.contrast&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_Contrast)),null!=i.saturation&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_Saturation)),null!=i.colorGamma&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ColorGamma)),null!=i.colorGain&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ColorGain)),null!=i.colorOffset&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ColorOffset)),null!=i.colorSaturationShadows&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ColorSaturationShadows)),null!=i.colorContrastShadows&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ColorContrastShadows)),null!=i.colorGammaShadows&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ColorGammaShadows)),null!=i.colorGainShadows&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ColorGainShadows)),null!=i.colorOffsetShadows&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ColorOffsetShadows)),null!=i.colorSaturationMidtones&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ColorSaturationMidtones)),null!=i.colorContrastMidtones&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ColorContrastMidtones)),null!=i.colorGammaMidtones&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ColorGammaMsidtones)),null!=i.colorGainMidtones&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ColorGainMidtones)),null!=i.colorOffsetMidtones&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ColorOffsetMidtones)),null!=i.colorSaturationHighlights&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ColorSaturationHighlights)),null!=i.colorContrastHighlights&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ColorContrastHighlights)),null!=i.colorGammaHighlights&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ColorGammaHighlights)),null!=i.colorGainHighlights&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ColorGainHighlights)),null!=i.colorOffsetHighlights&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ColorOffsetHighlights)),null!=i.colorCorrectionHighlightsMin&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ColorCorrectionHighlightsMin)),null!=i.colorCorrectionHighlightsMax&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ColorCorrectionHighlightsMax)),null!=i.colorCorrectionShadowsMax&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ColorCorrectionShadowsMax)),null!=i.blueCorrection&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_BlueCorrection)),null!=i.expandGamut&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ExpandGamut)),null!=i.toneCurveAmount&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ToneCurveAmount)),null!=i.filmSlope&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_FilmSlope)),null!=i.filmToe&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_FilmToe)),null!=i.filmShoulder&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_FilmShoulder)),null!=i.filmBlackClip&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_FilmBlackClip)),null!=i.filmWhiteClip&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_FilmWhiteClip)),null!=i.sharpen&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_Sharpen)),null!=i.filmGrainIntensity&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_FilmGrainIntensity)),null!=i.filmGrainIntensityShadows&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_FilmGrainIntensityShadows)),null!=i.filmGrainIntensityMidtones&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_FilmGrainIntensityMidtones)),null!=i.filmGrainIntensityHighlights&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_FilmGrainIntensityHighlights)),null!=i.filmGrainShadowsMax&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_FilmGrainShadowsMax)),null!=i.filmGrainHighlightsMin&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_FilmGrainHighlightsMin)),null!=i.filmGrainHighlightsMax&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_FilmGrainHighlightsMax)),null!=i.filmGrainTexelSize&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_FilmGrainTexelSize)),null!=i.depthOfFieldSqueezeFactor&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_DepthOfFieldSqueezeFactor)),null!=i.sceneColorTine&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_SceneColorTine)),null!=i.sceneFringeIntensity&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_SceneFringeIntensity)),null!=i.chromaticAberrationStartOffset)&&(a+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType.PostProcessingCommandSetData_ChromaticAberrationStartOffset)),a);return t.writeUint64(a),a=e,n=BigInt(0),null!=a&&(null!=a.bloomMethod&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_BloomMethod)),null!=a.bloomIntensity&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_BloomIntensity)),null!=a.bloomThreshold&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_BloomThreshold)),null!=a.bloomSizeScale&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_BloomSizeScale)),null!=a.bloom1Size&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_Bloom1Size)),null!=a.bloom2Size&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_Bloom2Size)),null!=a.bloom3Size&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_Bloom3Size)),null!=a.bloom4Size&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_Bloom4Size)),null!=a.bloom5Size&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_Bloom5Size)),null!=a.bloom6Size&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_Bloom6Size)),null!=a.bloom1Tint&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_BloomTint)),null!=a.bloom2Tint&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_Bloom2Tint)),null!=a.bloom3Tint&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_Bloom3Tint)),null!=a.bloom4Tint&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_Bloom4Tint)),null!=a.bloom5Tint&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_Bloom5Tint)),null!=a.bloom6Tint&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_Bloom6Tint)),null!=a.bloomConvolutionSize&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_BloomConvolutionSize)),null!=a.bloomConvolutionCenterUV&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_BloomConvolutionCenterUv)),null!=a.bloomConvolutionPreFilterMin&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_BloomConvolutionPreFilterMin)),null!=a.bloomConvolutionPreFilterMax&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_BloomConvolutionPreFilterMax)),null!=a.bloomConvolutionPreFilterMult&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_BloomConvolutionPreFilterMult)),null!=a.bloomConvolutionBufferScale&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_BloomConvolutionBufferScale)),null!=a.bloomDirtMaskIntensity&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_BloomDirtMaskIntensity)),null!=a.bloomDirtMaskTint&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_BloomDirtMaskTint)),null!=a.dynamicGlobalIlluminantionMethod&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_DynamicGlobalIilluminantionMethod)),null!=a.indirectLightingColor&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_IndirectLightingColor)),null!=a.indirectLightingIntensity&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_IndirectLightingIntensity)),null!=a.lumenFinalGatherQuality&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_LumenFinalGatherQuality)),null!=a.rayTracingGlobalIlluminationType&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_RayTracingGlobalIlluminationType)),null!=a.rayTracingGiMaxBounces&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_RayTracingGiMaxBounces)),null!=a.rayTracingGiSamplePerPixel&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_RayTracingGiSamplePerPixel)),null!=a.reflectionMethod&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_ReflectionMethod)),null!=a.lumenReflectionQuality&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_LumenReflectionQuality)),null!=a.screenSpaceReflectionIntensity&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_ScreenSpaceReflectionIntensity)),null!=a.screenSpaceReflectionQuality&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_ScreenSpaceReflectionQuality)),null!=a.screenSpaceReflectionMaxRoughness&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_ScreenSpaceReflectionMaxRoughness)),null!=a.rayTracingReflectionsMaxRoughness&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_RayTracingReflectionsMaxRoughness)),null!=a.rayTracingReflectionMaxBounces&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_RayTracingReflectionMaxBounces)),null!=a.rayTracingReflectionSamplesPerPixel&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_RayTracingReflectionSamplesPerPixel)),null!=a.reflectionAndRefractedRayTracedShadows&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_ReflectionAndRefractedRayTracedShadows)),null!=a.rayTracingReflectionTranslucency&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_RayTracingReflectionTranslucency)),null!=a.ambientCubemapTint&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_AmbientCubemapTint)),null!=a.ambientCubemapIntensity&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_AmbientCubemapIntensity)),null!=a.cameraShutterSpeed&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_CameraShutterSpeed)),null!=a.cameraIso&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_CameraIso)),null!=a.depthOfFieldFstop&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_DepthOfFieldFstop)),null!=a.depthOfFieldMinFstop&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_DepthOfFieldMinFstop)),null!=a.depthOfFieldBladeCount)&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType1.PostProcessingCommandSetData_DepthOfFieldBladeCount)),i=n,t.writeUint64(i),a=e,n=BigInt(0),null!=a&&(null!=a.lensFlareIntensity&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_LensFlare_intensity)),null!=a.lensFlareTint&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_LensFlareTint)),null!=a.lensFlareBokehSize&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_LensFlare_bokehSize)),null!=a.lensFlareThreshold&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_LensFlareThreshold)),null!=a.lensFlareTints&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_LensFlareTints)),null!=a.lensFlareTints1&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_LensFlareTints1)),null!=a.lensFlareTints2&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_LensFlareTints2)),null!=a.lensFlareTints3&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_LensFlareTints3)),null!=a.lensFlareTints4&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_LensFlareTints4)),null!=a.lensFlareTints5&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_LensFlareTints5)),null!=a.lensFlareTints6&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_LensFlareTints6)),null!=a.lensFlareTints7&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_LensFlareTints7)),null!=a.vignetteIntensity&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_VignetteIntensity)),null!=a.ambientOcclusionIntensity&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_AmbientOcclusionIntensity)),null!=a.ambientOcclusionRadius&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_AmbientOcclusionRadius)),null!=a.ambientOcclusionFadeDistance&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_AmbientOcclusionFadeDistance)),null!=a.ambientOcclusionStaticFraction&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_OcclusionStaticFraction)),null!=a.ambientOcclusionRadiusInWS&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_AmbientOcclusionRadiusInWs)),null!=a.ambientOcclusionFadeRadius&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_AmbientOcclusionFadeRadius)),null!=a.ambientOcclusionPower&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_AmbientOcclusionPower)),null!=a.ambientOcclusionBias&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_AmbientOcclusionBias)),null!=a.ambientOcclusionQuality&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_AmbientOcclusionQuality)),null!=a.ambientOcclusionMipBlend&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_AmbientOcclusionMipBlend)),null!=a.ambientOcclusionMipScale&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_AmbientOcclusionMipScale)),null!=a.ambientOcclusionMipThreshold&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_AmbientOcclusionMipThreshold)),null!=a.ambientOcclusionTemporalBlendWeight&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_AmbientOcclusionTemporalBlendWeight)),null!=a.rayTracingAO&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_TracingAo)),null!=a.rayTracingAOSamplesPerPixel&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_TracingAoSamplesPerPixel)),null!=a.rayTracingAOIntensity&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_RracingAoIntensity)),null!=a.rayTracingAORadius&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_RayTracingAoRadius)),null!=a.colorGradingIntensity&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_ColorGgradingIntensity)),null!=a.depthOfFieldSensorWidth&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_DepthOfFieldSensorWidth)),null!=a.depthOfFieldFocalDistance&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_DepthOfFieldFocalDistance)),null!=a.depthOfFieldDepthBlurAmount&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_DepthOfFieldDepthBlurAmount)),null!=a.depthOfFieldDepthBlurRadius&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_DepthOfFieldDepthBlurRadius)),null!=a.depthOfFieldFocalRegion&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_DepthOfFieldFocalRegion)),null!=a.depthOfFieldNearTransitionRegion&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_DepthOfFieldNearTransitionRegion)),null!=a.depthOfFieldFarTransitionRegion&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_DepthOfFieldFarTransitionRegion)),null!=a.depthOfFieldScale&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_DepthOfFieldScale)),null!=a.depthOfFieldNearBlurSize&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_DepthOfFieldNearBlurSize)),null!=a.depthOfFieldFarBlurSize&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_DepthOfFieldFarBlurSize)),null!=a.depthOfFieldOcclusion&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_DepthOfFieldOcclusion)),null!=a.depthOfFieldSkyFocusDistance&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_DepthOfFieldSkyFocusDistance)),null!=a.depthOfFieldVignetteSize&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_DepthOfFieldVignetteSize)),null!=a.motionBlurAmount&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_MotionBlurAmount)),null!=a.motionBlurMax&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_MotionBlurMax)),null!=a.motionBlurTargetFPS&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_MotionBlurTargetFps)),null!=a.motionBlurPerObjectSize&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_MotionBlurPerObjectSize)),null!=a.translucencyType&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_TranslucencyType)),null!=a.rayTracingTranslucencyMaxRoughness&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_RayTrancingTranslucencyMaxRoughness)),null!=a.rayTracingTranslucencyRefractionRays&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_RayTracingTranslucencyRefractionRays)),null!=a.rayTracingTranslucencySamplesPerPixel&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_TracingTranslucencySamplesPerPixel)),null!=a.rayTracingTranslucencyShadows&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_TracingTranslucencyShadows)),null!=a.rayTracingTranslucencyRefraction&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_TracingTranslucencyRefraction)),null!=a.pathTracingMaxBounces&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_PathTracingMaxBounces)),null!=a.pathTracingSamplesPerPixel)&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType2.PostProcessingCommandSetData_PathTracingSamplesPerPixel)),i=n,t.writeUint64(i),a=e,n=BigInt(0),null!=a&&(null!=a.temperatureType&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_TemperatureType)),null!=a.bloomConvolutionScatterDispersion&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_BloomConvolutionScatterDispersion)),null!=a.localExposure&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_LocalExposure)),null!=a.localExposureHighlightContrastScale&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_LocalExposureHighlightContrastScale)),null!=a.localExposureShadowContrastScale&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_LocalExposureShadowContrastScale)),null!=a.localExposureDetailStrength&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_LocalExposureDetailStrength)),null!=a.localExposureBlurredLuminanceBlend&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_LocalExposureBlurredLuminanceBlend)),null!=a.localExposureBlurredLuminanceKernelSizePercent&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_LocalExposureBlurredLuminanceKernelSizePercent)),null!=a.localExposureMiddleGreyBias&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_LocalExposureMiddleGreyBias)),null!=a.lumenSceneLightingQuality&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_LumenSceneLightingQuality)),null!=a.lumenSceneDetail&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_LumenSceneDetail)),null!=a.lumenSceneViewDistance&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_LumenSceneViewDistance)),null!=a.lumenSceneLightingUpdateSpeed&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_LumenSceneLightingUpdateSpeed)),null!=a.lumenFinalGatherLightingUpdateSpeed&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_LumenFinalGatherLightingUpdateSpeed)),null!=a.lumenMaxTraceDistance&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_LumenMaxTraceDistance)),null!=a.lumenDiffuseColorBoost&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_LumenDiffuseColorBoost)),null!=a.lumenSkylightLeaking&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_LumenSkylightLeaking)),null!=a.lumenFullSkylightLeakingDistance&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_LumenFullSkylightLeakingDistance)),null!=a.lumenRayLightingMode&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_LumenRayLightingMode)),null!=a.lumenFrontLayerTranslucencyReflections&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_LumenFrontLayerTranslucencyReflections)),null!=a.lumenMaxReflectionBounces&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_LumenMaxReflectionBounces)),null!=a.lumenSurfaceCacheResolution&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_LumenSurfaceCacheResolution)),null!=a.pathTracingMaxPathExposure&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_PathTracingMaxPathExposure)),null!=a.pathTracingEnableReferenceDOF&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_PathTracingEnableReferenceDOF)),null!=a.pathTracingEnableReferenceAtmosphere&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_PathTracingEnableReferenceAtmosphere)),null!=a.pathTracingEnableDenoiser&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_PathTracingEnableDenoiser)),null!=a.pathTracingIncludeEmissive&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_PathTracingIncludeEmissive)),null!=a.pathTracingIncludeIndirectEmissive&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_PathTracingIncludeIndirectEmissive)),null!=a.pathTracingIncludeDiffuse&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData__PathTracingIncludeDiffuse)),null!=a.pathTracingIncludeIndirectDiffuse&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_PathTracingIncludeIndirectDiffuse)),null!=a.pathTracingIncludeSpecular&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_PathTracingIncludeSpecular)),null!=a.pathTracingIncludeIndirectSpecular&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_PathTracingIncludeIndirectSpecular)),null!=a.pathTracingIncludeVolume&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_PathTracingIncludeVolume)),null!=a.pathTracingIncludeIndirectVolume)&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataType3.PostProcessingCommandSetData_PathTracingIncludeIndirectVolume)),i=n,t.writeUint64(i),a=e,n=BigInt(0),null!=a&&(null!=a.useDefault&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataGlobal.PostProcessingCommandSetData_SetUseDefault)),null!=a.eyeAdaptationQuality&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataGlobal.PostProcessingCommandSetData_EyeAdaptationQuality)),null!=a.motionBlur&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataGlobal.PostProcessingCommandSetData_MotionBlur)),null!=a.shadowVirtualEnable&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataGlobal.PostProcessingCommandSetData_ShadowVirtualEnable)),null!=a.shadowDistanceScale&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataGlobal.PostProcessingCommandSetData_ShadowDistanceScale)),null!=a.skylightIntensityMultiplier)&&(n+=BigInt(1)<<BigInt(r.PostProcessingCommandSetDataGlobal.PostProcessingCommandSetData_SkylightIntensityMultiplier)),i=n,t.writeUint64(i),a=t,null!=(n=e)&&(null!=n.autoExposure&&a.writeUint8(n.autoExposure?1:0),null!=n.autoExposureBias&&a.writeFloat32(n.autoExposureBias),null!=n.autoExposureMethod&&a.writeInt32(n.autoExposureMethod),null!=n.autoExposureExtendDefaultLuminanceRange&&a.writeInt32(n.autoExposureExtendDefaultLuminanceRange),null!=n.autoExposureLowPercent&&a.writeFloat32(n.autoExposureLowPercent),null!=n.autoExposureHightPercent&&a.writeFloat32(n.autoExposureHightPercent),null!=n.autoExposureMinBrightness&&a.writeFloat32(n.autoExposureMinBrightness),null!=n.autoExposureMaxBrightness&&a.writeFloat32(n.autoExposureMaxBrightness),null!=n.autoExposureSpeedDown&&a.writeFloat32(n.autoExposureSpeedDown),null!=n.autoExposureSpeedUp&&a.writeFloat32(n.autoExposureSpeedUp),null!=n.exposureApplyPhysicalCameraExposure&&a.writeUint32(n.exposureApplyPhysicalCameraExposure),null!=n.histogramLogMin&&a.writeFloat32(n.histogramLogMin),null!=n.histogramLogMax&&a.writeFloat32(n.histogramLogMax),null!=n.whiteTemp&&a.writeFloat32(n.whiteTemp),null!=n.whiteTint&&a.writeFloat32(n.whiteTint),null!=n.contrast&&o(a,n.contrast),null!=n.saturation&&o(a,n.saturation),null!=n.colorGamma&&o(a,n.colorGamma),null!=n.colorGain&&o(a,n.colorGain),null!=n.colorOffset&&o(a,n.colorOffset),null!=n.colorSaturationShadows&&o(a,n.colorSaturationShadows),null!=n.colorContrastShadows&&o(a,n.colorContrastShadows),null!=n.colorGammaShadows&&o(a,n.colorGammaShadows),null!=n.colorGainShadows&&o(a,n.colorGainShadows),null!=n.colorOffsetShadows&&o(a,n.colorOffsetShadows),null!=n.colorSaturationMidtones&&o(a,n.colorSaturationMidtones),null!=n.colorContrastMidtones&&o(a,n.colorContrastMidtones),null!=n.colorGammaMidtones&&o(a,n.colorGammaMidtones),null!=n.colorGainMidtones&&o(a,n.colorGainMidtones),null!=n.colorOffsetMidtones&&o(a,n.colorOffsetMidtones),null!=n.colorSaturationHighlights&&o(a,n.colorSaturationHighlights),null!=n.colorContrastHighlights&&o(a,n.colorContrastHighlights),null!=n.colorGammaHighlights&&o(a,n.colorGammaHighlights),null!=n.colorGainHighlights&&o(a,n.colorGainHighlights),null!=n.colorOffsetHighlights&&o(a,n.colorOffsetHighlights),null!=n.colorCorrectionHighlightsMin&&a.writeFloat32(n.colorCorrectionHighlightsMin),null!=n.colorCorrectionHighlightsMax&&a.writeFloat32(n.colorCorrectionHighlightsMax),null!=n.colorCorrectionShadowsMax&&a.writeFloat32(n.colorCorrectionShadowsMax),null!=n.blueCorrection&&a.writeFloat32(n.blueCorrection),null!=n.expandGamut&&a.writeFloat32(n.expandGamut),null!=n.toneCurveAmount&&a.writeFloat32(n.toneCurveAmount),null!=n.filmSlope&&a.writeFloat32(n.filmSlope),null!=n.filmToe&&a.writeFloat32(n.filmToe),null!=n.filmShoulder&&a.writeFloat32(n.filmShoulder),null!=n.filmBlackClip&&a.writeFloat32(n.filmBlackClip),null!=n.filmWhiteClip&&a.writeFloat32(n.filmWhiteClip),null!=n.sharpen&&a.writeFloat32(n.sharpen),null!=n.filmGrainIntensity&&a.writeFloat32(n.filmGrainIntensity),null!=n.filmGrainIntensityShadows&&a.writeFloat32(n.filmGrainIntensityShadows),null!=n.filmGrainIntensityMidtones&&a.writeFloat32(n.filmGrainIntensityMidtones),null!=n.filmGrainIntensityHighlights&&a.writeFloat32(n.filmGrainIntensityHighlights),null!=n.filmGrainShadowsMax&&a.writeFloat32(n.filmGrainShadowsMax),null!=n.filmGrainHighlightsMin&&a.writeFloat32(n.filmGrainHighlightsMin),null!=n.filmGrainHighlightsMax&&a.writeFloat32(n.filmGrainHighlightsMax),null!=n.filmGrainTexelSize&&a.writeFloat32(n.filmGrainTexelSize),null!=n.depthOfFieldSqueezeFactor&&a.writeFloat32(n.depthOfFieldSqueezeFactor),null!=n.sceneColorTine&&o(a,n.sceneColorTine),null!=n.sceneFringeIntensity&&a.writeFloat32(n.sceneFringeIntensity),null!=n.chromaticAberrationStartOffset)&&a.writeFloat32(n.chromaticAberrationStartOffset),i=t,null!=(a=e)&&(null!=a.bloomMethod&&i.writeInt32(a.bloomMethod),null!=a.bloomIntensity&&i.writeFloat32(a.bloomIntensity),null!=a.bloomThreshold&&i.writeFloat32(a.bloomThreshold),null!=a.bloomSizeScale&&i.writeFloat32(a.bloomSizeScale),null!=a.bloom1Size&&i.writeFloat32(a.bloom1Size),null!=a.bloom2Size&&i.writeFloat32(a.bloom2Size),null!=a.bloom3Size&&i.writeFloat32(a.bloom3Size),null!=a.bloom4Size&&i.writeFloat32(a.bloom4Size),null!=a.bloom5Size&&i.writeFloat32(a.bloom5Size),null!=a.bloom6Size&&i.writeFloat32(a.bloom6Size),null!=a.bloom1Tint&&o(i,a.bloom1Tint),null!=a.bloom2Tint&&o(i,a.bloom2Tint),null!=a.bloom3Tint&&o(i,a.bloom3Tint),null!=a.bloom4Tint&&o(i,a.bloom4Tint),null!=a.bloom5Tint&&o(i,a.bloom5Tint),null!=a.bloom6Tint&&o(i,a.bloom6Tint),null!=a.bloomConvolutionSize&&i.writeFloat32(a.bloomConvolutionSize),null!=a.bloomConvolutionCenterUV&&(i.writeFloat64(a.bloomConvolutionCenterUV.x),i.writeFloat64(a.bloomConvolutionCenterUV.y)),null!=a.bloomConvolutionPreFilterMin&&i.writeFloat32(a.bloomConvolutionPreFilterMin),null!=a.bloomConvolutionPreFilterMax&&i.writeFloat32(a.bloomConvolutionPreFilterMax),null!=a.bloomConvolutionPreFilterMult&&i.writeFloat32(a.bloomConvolutionPreFilterMult),null!=a.bloomConvolutionBufferScale&&i.writeFloat32(a.bloomConvolutionBufferScale),null!=a.bloomDirtMaskIntensity&&i.writeFloat32(a.bloomDirtMaskIntensity),null!=a.bloomDirtMaskTint&&o(i,a.bloomDirtMaskTint),null!=a.dynamicGlobalIlluminantionMethod&&i.writeInt32(a.dynamicGlobalIlluminantionMethod),null!=a.indirectLightingColor&&o(i,a.indirectLightingColor),null!=a.indirectLightingIntensity&&i.writeFloat32(a.indirectLightingIntensity),null!=a.lumenFinalGatherQuality&&i.writeFloat32(a.lumenFinalGatherQuality),null!=a.rayTracingGlobalIlluminationType&&i.writeInt32(a.rayTracingGlobalIlluminationType),null!=a.rayTracingGiMaxBounces&&i.writeInt32(a.rayTracingGiMaxBounces),null!=a.rayTracingGiSamplePerPixel&&i.writeInt32(a.rayTracingGiSamplePerPixel),null!=a.reflectionMethod&&i.writeInt32(a.reflectionMethod),null!=a.lumenReflectionQuality&&i.writeFloat32(a.lumenReflectionQuality),null!=a.screenSpaceReflectionIntensity&&i.writeFloat32(a.screenSpaceReflectionIntensity),null!=a.screenSpaceReflectionQuality&&i.writeFloat32(a.screenSpaceReflectionQuality),null!=a.screenSpaceReflectionMaxRoughness&&i.writeFloat32(a.screenSpaceReflectionMaxRoughness),null!=a.rayTracingReflectionsMaxRoughness&&i.writeFloat32(a.rayTracingReflectionsMaxRoughness),null!=a.rayTracingReflectionMaxBounces&&i.writeInt32(a.rayTracingReflectionMaxBounces),null!=a.rayTracingReflectionSamplesPerPixel&&i.writeInt32(a.rayTracingReflectionSamplesPerPixel),null!=a.reflectionAndRefractedRayTracedShadows&&i.writeInt32(a.reflectionAndRefractedRayTracedShadows),null!=a.rayTracingReflectionTranslucency&&i.writeUint8(a.rayTracingReflectionTranslucency?1:0),null!=a.ambientCubemapTint&&o(i,a.ambientCubemapTint),null!=a.ambientCubemapIntensity&&i.writeFloat32(a.ambientCubemapIntensity),null!=a.cameraShutterSpeed&&i.writeFloat32(a.cameraShutterSpeed),null!=a.cameraIso&&i.writeFloat32(a.cameraIso),null!=a.depthOfFieldFstop&&i.writeFloat32(a.depthOfFieldFstop),null!=a.depthOfFieldMinFstop&&i.writeFloat32(a.depthOfFieldMinFstop),null!=a.depthOfFieldBladeCount)&&i.writeInt32(a.depthOfFieldBladeCount),n=t,null!=(i=e)&&(null!=i.lensFlareIntensity&&n.writeFloat32(i.lensFlareIntensity),null!=i.lensFlareTint&&o(n,i.lensFlareTint),null!=i.lensFlareBokehSize&&n.writeFloat32(i.lensFlareBokehSize),null!=i.lensFlareThreshold&&n.writeFloat32(i.lensFlareThreshold),null!=i.lensFlareTints&&o(n,i.lensFlareTints),null!=i.lensFlareTints1&&o(n,i.lensFlareTints1),null!=i.lensFlareTints2&&o(n,i.lensFlareTints2),null!=i.lensFlareTints3&&o(n,i.lensFlareTints3),null!=i.lensFlareTints4&&o(n,i.lensFlareTints4),null!=i.lensFlareTints5&&o(n,i.lensFlareTints5),null!=i.lensFlareTints6&&o(n,i.lensFlareTints6),null!=i.lensFlareTints7&&o(n,i.lensFlareTints7),null!=i.vignetteIntensity&&n.writeFloat32(i.vignetteIntensity),null!=i.ambientOcclusionIntensity&&n.writeFloat32(i.ambientOcclusionIntensity),null!=i.ambientOcclusionRadius&&n.writeFloat32(i.ambientOcclusionRadius),null!=i.ambientOcclusionFadeDistance&&n.writeFloat32(i.ambientOcclusionFadeDistance),null!=i.ambientOcclusionStaticFraction&&n.writeFloat32(i.ambientOcclusionStaticFraction),null!=i.ambientOcclusionRadiusInWS&&n.writeUint32(i.ambientOcclusionRadiusInWS),null!=i.ambientOcclusionFadeRadius&&n.writeFloat32(i.ambientOcclusionFadeRadius),null!=i.ambientOcclusionPower&&n.writeFloat32(i.ambientOcclusionPower),null!=i.ambientOcclusionBias&&n.writeFloat32(i.ambientOcclusionBias),null!=i.ambientOcclusionQuality&&n.writeFloat32(i.ambientOcclusionQuality),null!=i.ambientOcclusionMipBlend&&n.writeFloat32(i.ambientOcclusionMipBlend),null!=i.ambientOcclusionMipScale&&n.writeFloat32(i.ambientOcclusionMipScale),null!=i.ambientOcclusionMipThreshold&&n.writeFloat32(i.ambientOcclusionMipThreshold),null!=i.ambientOcclusionTemporalBlendWeight&&n.writeFloat32(i.ambientOcclusionTemporalBlendWeight),null!=i.rayTracingAO&&n.writeUint32(i.rayTracingAO),null!=i.rayTracingAOSamplesPerPixel&&n.writeInt32(i.rayTracingAOSamplesPerPixel),null!=i.rayTracingAOIntensity&&n.writeFloat32(i.rayTracingAOIntensity),null!=i.rayTracingAORadius&&n.writeFloat32(i.rayTracingAORadius),null!=i.colorGradingIntensity&&n.writeFloat32(i.colorGradingIntensity),null!=i.depthOfFieldSensorWidth&&n.writeFloat32(i.depthOfFieldSensorWidth),null!=i.depthOfFieldFocalDistance&&n.writeFloat32(i.depthOfFieldFocalDistance),null!=i.depthOfFieldDepthBlurAmount&&n.writeFloat32(i.depthOfFieldDepthBlurAmount),null!=i.depthOfFieldDepthBlurRadius&&n.writeFloat32(i.depthOfFieldDepthBlurRadius),null!=i.depthOfFieldFocalRegion&&n.writeFloat32(i.depthOfFieldFocalRegion),null!=i.depthOfFieldNearTransitionRegion&&n.writeFloat32(i.depthOfFieldNearTransitionRegion),null!=i.depthOfFieldFarTransitionRegion&&n.writeFloat32(i.depthOfFieldFarTransitionRegion),null!=i.depthOfFieldScale&&n.writeFloat32(i.depthOfFieldScale),null!=i.depthOfFieldNearBlurSize&&n.writeFloat32(i.depthOfFieldNearBlurSize),null!=i.depthOfFieldFarBlurSize&&n.writeFloat32(i.depthOfFieldFarBlurSize),null!=i.depthOfFieldOcclusion&&n.writeFloat32(i.depthOfFieldOcclusion),null!=i.depthOfFieldSkyFocusDistance&&n.writeFloat32(i.depthOfFieldSkyFocusDistance),null!=i.depthOfFieldVignetteSize&&n.writeFloat32(i.depthOfFieldVignetteSize),null!=i.motionBlurAmount&&n.writeFloat32(i.motionBlurAmount),null!=i.motionBlurMax&&n.writeFloat32(i.motionBlurMax),null!=i.motionBlurTargetFPS&&n.writeInt32(i.motionBlurTargetFPS),null!=i.motionBlurPerObjectSize&&n.writeFloat32(i.motionBlurPerObjectSize),null!=i.translucencyType&&n.writeInt32(i.translucencyType),null!=i.rayTracingTranslucencyMaxRoughness&&n.writeFloat32(i.rayTracingTranslucencyMaxRoughness),null!=i.rayTracingTranslucencyRefractionRays&&n.writeInt32(i.rayTracingTranslucencyRefractionRays),null!=i.rayTracingTranslucencySamplesPerPixel&&n.writeInt32(i.rayTracingTranslucencySamplesPerPixel),null!=i.rayTracingTranslucencyShadows&&n.writeInt32(i.rayTracingTranslucencyShadows),null!=i.rayTracingTranslucencyRefraction&&n.writeUint8(i.rayTracingTranslucencyRefraction?1:0),null!=i.pathTracingMaxBounces&&n.writeInt32(i.pathTracingMaxBounces),null!=i.pathTracingSamplesPerPixel)&&n.writeInt32(i.pathTracingSamplesPerPixel),a=t,null!=(n=e)&&(null!=n.temperatureType&&a.writeInt32(n.temperatureType),null!=n.bloomConvolutionScatterDispersion&&a.writeFloat32(n.bloomConvolutionScatterDispersion),null!=n.localExposure&&a.writeUint8(n.localExposure?1:0),null!=n.localExposureHighlightContrastScale&&a.writeFloat32(n.localExposureHighlightContrastScale),null!=n.localExposureShadowContrastScale&&a.writeFloat32(n.localExposureShadowContrastScale),null!=n.localExposureDetailStrength&&a.writeFloat32(n.localExposureDetailStrength),null!=n.localExposureBlurredLuminanceBlend&&a.writeFloat32(n.localExposureBlurredLuminanceBlend),null!=n.localExposureBlurredLuminanceKernelSizePercent&&a.writeFloat32(n.localExposureBlurredLuminanceKernelSizePercent),null!=n.localExposureMiddleGreyBias&&a.writeFloat32(n.localExposureMiddleGreyBias),null!=n.lumenSceneLightingQuality&&a.writeFloat32(n.lumenSceneLightingQuality),null!=n.lumenSceneDetail&&a.writeFloat32(n.lumenSceneDetail),null!=n.lumenSceneViewDistance&&a.writeFloat32(n.lumenSceneViewDistance),null!=n.lumenSceneLightingUpdateSpeed&&a.writeFloat32(n.lumenSceneLightingUpdateSpeed),null!=n.lumenFinalGatherLightingUpdateSpeed&&a.writeFloat32(n.lumenFinalGatherLightingUpdateSpeed),null!=n.lumenMaxTraceDistance&&a.writeFloat32(n.lumenMaxTraceDistance),null!=n.lumenDiffuseColorBoost&&a.writeFloat32(n.lumenDiffuseColorBoost),null!=n.lumenSkylightLeaking&&a.writeFloat32(n.lumenSkylightLeaking),null!=n.lumenFullSkylightLeakingDistance&&a.writeFloat32(n.lumenFullSkylightLeakingDistance),null!=n.lumenRayLightingMode&&a.writeInt32(n.lumenRayLightingMode),null!=n.lumenFrontLayerTranslucencyReflections&&a.writeInt32(n.lumenFrontLayerTranslucencyReflections),null!=n.lumenMaxReflectionBounces&&a.writeInt32(n.lumenMaxReflectionBounces),null!=n.lumenSurfaceCacheResolution&&a.writeFloat32(n.lumenSurfaceCacheResolution),null!=n.pathTracingMaxPathExposure&&a.writeFloat32(n.pathTracingMaxPathExposure),null!=n.pathTracingEnableReferenceDOF&&a.writeUint32(n.pathTracingEnableReferenceDOF),null!=n.pathTracingEnableReferenceAtmosphere&&a.writeUint32(n.pathTracingEnableReferenceAtmosphere),null!=n.pathTracingEnableDenoiser&&a.writeUint32(n.pathTracingEnableDenoiser),null!=n.pathTracingIncludeEmissive&&a.writeUint32(n.pathTracingIncludeEmissive),null!=n.pathTracingIncludeIndirectEmissive&&a.writeUint32(n.pathTracingIncludeIndirectEmissive),null!=n.pathTracingIncludeDiffuse&&a.writeUint32(n.pathTracingIncludeDiffuse),null!=n.pathTracingIncludeIndirectDiffuse&&a.writeUint32(n.pathTracingIncludeIndirectDiffuse),null!=n.pathTracingIncludeSpecular&&a.writeUint32(n.pathTracingIncludeSpecular),null!=n.pathTracingIncludeIndirectSpecular&&a.writeUint32(n.pathTracingIncludeIndirectSpecular),null!=n.pathTracingIncludeVolume&&a.writeUint32(n.pathTracingIncludeVolume),null!=n.pathTracingIncludeIndirectVolume)&&a.writeUint32(n.pathTracingIncludeIndirectVolume),i=t,null!=(a=e)&&(null!=a.useDefault&&i.writeUint8(a.useDefault?1:0),null!=a.eyeAdaptationQuality&&i.writeInt32(a.eyeAdaptationQuality),null!=a.motionBlur&&i.writeUint8(a.motionBlur?1:0),null!=a.shadowVirtualEnable&&i.writeUint8(a.shadowVirtualEnable?1:0),null!=a.shadowDistanceScale&&i.writeFloat32(a.shadowDistanceScale),null!=a.skylightIntensityMultiplier)&&i.writeFloat32(a.skylightIntensityMultiplier),t.ValidData()}var r=e.handlers.get(t.StampPixelStreamingHandleType.StampType_PostProcessing),a=0,a=(r.PostProcessingCommandSetDataType={PostProcessingCommandSetData_AutoExposure:a++,PostProcessingCommandSetData_AutoExposureBias:a++,PostProcessingCommandSetData_AutoExposureMethod:a++,PostProcessingCommandSetData_AutoExposureExtendDefaultLuminanceRange:a++,PostProcessingCommandSetData_AutoExposureLowPercent:a++,PostProcessingCommandSetData_AutoExposureHighPercent:a++,PostProcessingCommandSetData_AutoExposureMinBrightness:a++,PostProcessingCommandSetData_AutoExposureMaxBrightness:a++,PostProcessingCommandSetData_AutoExposureSpeedDown:a++,PostProcessingCommandSetData_AutoExposureSpeedUp:a++,PostProcessingCommandSetData_ExposureApplyPhysicalCameraExposure:a++,PostProcessingCommandSetData_HistogramLogMin:a++,PostProcessingCommandSetData_HistogramLogMax:a++,PostProcessingCommandSetData_WhiteTemp:a++,PostProcessingCommandSetData_WhiteTint:a++,PostProcessingCommandSetData_Contrast:a++,PostProcessingCommandSetData_Saturation:a++,PostProcessingCommandSetData_ColorGamma:a++,PostProcessingCommandSetData_ColorGain:a++,PostProcessingCommandSetData_ColorOffset:a++,PostProcessingCommandSetData_ColorSaturationShadows:a++,PostProcessingCommandSetData_ColorContrastShadows:a++,PostProcessingCommandSetData_ColorGammaShadows:a++,PostProcessingCommandSetData_ColorGainShadows:a++,PostProcessingCommandSetData_ColorOffsetShadows:a++,PostProcessingCommandSetData_ColorSaturationMidtones:a++,PostProcessingCommandSetData_ColorContrastMidtones:a++,PostProcessingCommandSetData_ColorGammaMsidtones:a++,PostProcessingCommandSetData_ColorGainMidtones:a++,PostProcessingCommandSetData_ColorOffsetMidtones:a++,PostProcessingCommandSetData_ColorSaturationHighlights:a++,PostProcessingCommandSetData_ColorContrastHighlights:a++,PostProcessingCommandSetData_ColorGammaHighlights:a++,PostProcessingCommandSetData_ColorGainHighlights:a++,PostProcessingCommandSetData_ColorOffsetHighlights:a++,PostProcessingCommandSetData_ColorCorrectionHighlightsMin:a++,PostProcessingCommandSetData_ColorCorrectionHighlightsMax:a++,PostProcessingCommandSetData_ColorCorrectionShadowsMax:a++,PostProcessingCommandSetData_BlueCorrection:a++,PostProcessingCommandSetData_ExpandGamut:a++,PostProcessingCommandSetData_ToneCurveAmount:a++,PostProcessingCommandSetData_FilmSlope:a++,PostProcessingCommandSetData_FilmToe:a++,PostProcessingCommandSetData_FilmShoulder:a++,PostProcessingCommandSetData_FilmBlackClip:a++,PostProcessingCommandSetData_FilmWhiteClip:a++,PostProcessingCommandSetData_Sharpen:a++,PostProcessingCommandSetData_FilmGrainIntensity:a++,PostProcessingCommandSetData_FilmGrainIntensityShadows:a++,PostProcessingCommandSetData_FilmGrainIntensityMidtones:a++,PostProcessingCommandSetData_FilmGrainIntensityHighlights:a++,PostProcessingCommandSetData_FilmGrainShadowsMax:a++,PostProcessingCommandSetData_FilmGrainHighlightsMin:a++,PostProcessingCommandSetData_FilmGrainHighlightsMax:a++,PostProcessingCommandSetData_FilmGrainTexelSize:a++,PostProcessingCommandSetData_DepthOfFieldSqueezeFactor:a++,PostProcessingCommandSetData_SceneColorTine:a++,PostProcessingCommandSetData_SceneFringeIntensity:+a,PostProcessingCommandSetData_ChromaticAberrationStartOffset:58},0),a=(r.PostProcessingCommandSetDataType1={PostProcessingCommandSetData_BloomMethod:a++,PostProcessingCommandSetData_BloomIntensity:a++,PostProcessingCommandSetData_BloomThreshold:a++,PostProcessingCommandSetData_BloomSizeScale:a++,PostProcessingCommandSetData_Bloom1Size:a++,PostProcessingCommandSetData_Bloom2Size:a++,PostProcessingCommandSetData_Bloom3Size:a++,PostProcessingCommandSetData_Bloom4Size:a++,PostProcessingCommandSetData_Bloom5Size:a++,PostProcessingCommandSetData_Bloom6Size:a++,PostProcessingCommandSetData_BloomTint:a++,PostProcessingCommandSetData_Bloom2Tint:a++,PostProcessingCommandSetData_Bloom3Tint:a++,PostProcessingCommandSetData_Bloom4Tint:a++,PostProcessingCommandSetData_Bloom5Tint:a++,PostProcessingCommandSetData_Bloom6Tint:a++,PostProcessingCommandSetData_BloomConvolutionSize:a++,PostProcessingCommandSetData_BloomConvolutionCenterUv:a++,PostProcessingCommandSetData_BloomConvolutionPreFilterMin:a++,PostProcessingCommandSetData_BloomConvolutionPreFilterMax:a++,PostProcessingCommandSetData_BloomConvolutionPreFilterMult:a++,PostProcessingCommandSetData_BloomConvolutionBufferScale:a++,PostProcessingCommandSetData_BloomDirtMaskIntensity:a++,PostProcessingCommandSetData_BloomDirtMaskTint:a++,PostProcessingCommandSetData_DynamicGlobalIilluminantionMethod:a++,PostProcessingCommandSetData_IndirectLightingColor:a++,PostProcessingCommandSetData_IndirectLightingIntensity:a++,PostProcessingCommandSetData_LumenFinalGatherQuality:a++,PostProcessingCommandSetData_RayTracingGlobalIlluminationType:a++,PostProcessingCommandSetData_RayTracingGiMaxBounces:a++,PostProcessingCommandSetData_RayTracingGiSamplePerPixel:a++,PostProcessingCommandSetData_ReflectionMethod:a++,PostProcessingCommandSetData_LumenReflectionQuality:a++,PostProcessingCommandSetData_ScreenSpaceReflectionIntensity:a++,PostProcessingCommandSetData_ScreenSpaceReflectionQuality:a++,PostProcessingCommandSetData_ScreenSpaceReflectionMaxRoughness:a++,PostProcessingCommandSetData_RayTracingReflectionsMaxRoughness:a++,PostProcessingCommandSetData_RayTracingReflectionMaxBounces:a++,PostProcessingCommandSetData_RayTracingReflectionSamplesPerPixel:a++,PostProcessingCommandSetData_ReflectionAndRefractedRayTracedShadows:a++,PostProcessingCommandSetData_RayTracingReflectionTranslucency:a++,PostProcessingCommandSetData_AmbientCubemapTint:a++,PostProcessingCommandSetData_AmbientCubemapIntensity:a++,PostProcessingCommandSetData_CameraShutterSpeed:a++,PostProcessingCommandSetData_CameraIso:a++,PostProcessingCommandSetData_DepthOfFieldFstop:a++,PostProcessingCommandSetData_DepthOfFieldMinFstop:+a,PostProcessingCommandSetData_DepthOfFieldBladeCount:47},0),a=(r.PostProcessingCommandSetDataType2={PostProcessingCommandSetData_LensFlare_intensity:a++,PostProcessingCommandSetData_LensFlareTint:a++,PostProcessingCommandSetData_LensFlare_bokehSize:a++,PostProcessingCommandSetData_LensFlareThreshold:a++,PostProcessingCommandSetData_LensFlareTints:a++,PostProcessingCommandSetData_LensFlareTints1:a++,PostProcessingCommandSetData_LensFlareTints2:a++,PostProcessingCommandSetData_LensFlareTints3:a++,PostProcessingCommandSetData_LensFlareTints4:a++,PostProcessingCommandSetData_LensFlareTints5:a++,PostProcessingCommandSetData_LensFlareTints6:a++,PostProcessingCommandSetData_LensFlareTints7:a++,PostProcessingCommandSetData_VignetteIntensity:a++,PostProcessingCommandSetData_AmbientOcclusionIntensity:a++,PostProcessingCommandSetData_AmbientOcclusionRadius:a++,PostProcessingCommandSetData_AmbientOcclusionFadeDistance:a++,PostProcessingCommandSetData_OcclusionStaticFraction:a++,PostProcessingCommandSetData_AmbientOcclusionRadiusInWs:a++,PostProcessingCommandSetData_AmbientOcclusionFadeRadius:a++,PostProcessingCommandSetData_AmbientOcclusionPower:a++,PostProcessingCommandSetData_AmbientOcclusionBias:a++,PostProcessingCommandSetData_AmbientOcclusionQuality:a++,PostProcessingCommandSetData_AmbientOcclusionMipBlend:a++,PostProcessingCommandSetData_AmbientOcclusionMipScale:a++,PostProcessingCommandSetData_AmbientOcclusionMipThreshold:a++,PostProcessingCommandSetData_AmbientOcclusionTemporalBlendWeight:a++,PostProcessingCommandSetData_TracingAo:a++,PostProcessingCommandSetData_TracingAoSamplesPerPixel:a++,PostProcessingCommandSetData_RracingAoIntensity:a++,PostProcessingCommandSetData_RayTracingAoRadius:a++,PostProcessingCommandSetData_ColorGgradingIntensity:a++,PostProcessingCommandSetData_DepthOfFieldSensorWidth:a++,PostProcessingCommandSetData_DepthOfFieldFocalDistance:a++,PostProcessingCommandSetData_DepthOfFieldDepthBlurAmount:a++,PostProcessingCommandSetData_DepthOfFieldDepthBlurRadius:a++,PostProcessingCommandSetData_DepthOfFieldFocalRegion:a++,PostProcessingCommandSetData_DepthOfFieldNearTransitionRegion:a++,PostProcessingCommandSetData_DepthOfFieldFarTransitionRegion:a++,PostProcessingCommandSetData_DepthOfFieldScale:a++,PostProcessingCommandSetData_DepthOfFieldNearBlurSize:a++,PostProcessingCommandSetData_DepthOfFieldFarBlurSize:a++,PostProcessingCommandSetData_DepthOfFieldOcclusion:a++,PostProcessingCommandSetData_DepthOfFieldSkyFocusDistance:a++,PostProcessingCommandSetData_DepthOfFieldVignetteSize:a++,PostProcessingCommandSetData_MotionBlurAmount:a++,PostProcessingCommandSetData_MotionBlurMax:a++,PostProcessingCommandSetData_MotionBlurTargetFps:a++,PostProcessingCommandSetData_MotionBlurPerObjectSize:a++,PostProcessingCommandSetData_TranslucencyType:a++,PostProcessingCommandSetData_RayTrancingTranslucencyMaxRoughness:a++,PostProcessingCommandSetData_RayTracingTranslucencyRefractionRays:a++,PostProcessingCommandSetData_TracingTranslucencySamplesPerPixel:a++,PostProcessingCommandSetData_TracingTranslucencyShadows:a++,PostProcessingCommandSetData_TracingTranslucencyRefraction:a++,PostProcessingCommandSetData_PathTracingMaxBounces:+a,PostProcessingCommandSetData_PathTracingSamplesPerPixel:55},0),a=(r.PostProcessingCommandSetDataType3={PostProcessingCommandSetData_TemperatureType:a++,PostProcessingCommandSetData_BloomConvolutionScatterDispersion:a++,PostProcessingCommandSetData_LocalExposure:a++,PostProcessingCommandSetData_LocalExposureHighlightContrastScale:a++,PostProcessingCommandSetData_LocalExposureShadowContrastScale:a++,PostProcessingCommandSetData_LocalExposureDetailStrength:a++,PostProcessingCommandSetData_LocalExposureBlurredLuminanceBlend:a++,PostProcessingCommandSetData_LocalExposureBlurredLuminanceKernelSizePercent:a++,PostProcessingCommandSetData_LocalExposureMiddleGreyBias:a++,PostProcessingCommandSetData_LumenSceneLightingQuality:a++,PostProcessingCommandSetData_LumenSceneDetail:a++,PostProcessingCommandSetData_LumenSceneViewDistance:a++,PostProcessingCommandSetData_LumenSceneLightingUpdateSpeed:a++,PostProcessingCommandSetData_LumenFinalGatherLightingUpdateSpeed:a++,PostProcessingCommandSetData_LumenMaxTraceDistance:a++,PostProcessingCommandSetData_LumenDiffuseColorBoost:a++,PostProcessingCommandSetData_LumenSkylightLeaking:a++,PostProcessingCommandSetData_LumenFullSkylightLeakingDistance:a++,PostProcessingCommandSetData_LumenRayLightingMode:a++,PostProcessingCommandSetData_LumenFrontLayerTranslucencyReflections:a++,PostProcessingCommandSetData_LumenMaxReflectionBounces:a++,PostProcessingCommandSetData_LumenSurfaceCacheResolution:a++,PostProcessingCommandSetData_PathTracingMaxPathExposure:a++,PostProcessingCommandSetData_PathTracingEnableReferenceDOF:a++,PostProcessingCommandSetData_PathTracingEnableReferenceAtmosphere:a++,PostProcessingCommandSetData_PathTracingEnableDenoiser:a++,PostProcessingCommandSetData_PathTracingIncludeEmissive:a++,PostProcessingCommandSetData_PathTracingIncludeIndirectEmissive:a++,PostProcessingCommandSetData__PathTracingIncludeDiffuse:a++,PostProcessingCommandSetData_PathTracingIncludeIndirectDiffuse:a++,PostProcessingCommandSetData_PathTracingIncludeSpecular:a++,PostProcessingCommandSetData_PathTracingIncludeIndirectSpecular:a++,PostProcessingCommandSetData_PathTracingIncludeVolume:+a,PostProcessingCommandSetData_PathTracingIncludeIndirectVolume:33},0),o=(r.PostProcessingCommandSetDataGlobal={PostProcessingCommandSetData_SetUseDefault:a++,PostProcessingCommandSetData_EyeAdaptationQuality:a++,PostProcessingCommandSetData_MotionBlur:a++,PostProcessingCommandSetData_ShadowVirtualEnable:a++,PostProcessingCommandSetData_ShadowDistanceScale:+a,PostProcessingCommandSetData_SkylightIntensityMultiplier:5},r.CommandType={PostProcessingCommand_SetData:0,PostProcessingCommand_GetPostProcessing:1},function(e,t){e.writeFloat64(null!=t.r?t.r:t.x),e.writeFloat64(null!=t.g?t.g:t.y),e.writeFloat64(null!=t.b?t.b:t.z),e.writeFloat64(null!=t.a?t.a:t.w)});function i(e){var t={};return t.autoExposure=e.autoExposure,t.autoExposureBias=e.autoExposureBias,t.autoExposureSpeedUp=e.autoExposureSpeedUp,t.contrast=e.contrast,t.saturation=e.saturation,t.useDefault=e.useDefault,t.motionBlur=e.motionBlur,t.shadowVirtualEnable=e.shadowVirtualEnable,t.shadowDistanceScale=e.shadowDistanceScale,t.skylightIntensityMultiplier=e.skylightIntensityMultiplier,t.whiteTemp=e.whiteTemp,t.whiteTint=e.whiteTint,t.filmSlope=e.filmSlope,t.filmToe=e.filmToe,t.filmShoulder=e.filmShoulder,t.filmBlackClip=e.filmBlackClip,t.filmWhiteClip=e.filmWhiteClip,t}r.interface.set_postprocessing_data=function(e){e=i(e);r.create_custom_command(r.CommandType.PostProcessingCommand_SetData,n,e)},r.interface.set_postprocessing_data_for_test=function(e){r.create_custom_command(r.CommandType.PostProcessingCommand_SetData,n,e)},r.interface.get_postprocessing=function(){r.create_custom_command(r.CommandType.PostProcessingCommand_GetPostProcessing,t.GetNoParamCommandPackData)};return r.RespondType={PostProcessingRespond_PostProcessingGet:0},r.create_sub_handler(r.RespondType.PostProcessingRespond_PostProcessingGet,function(e){e=new TextDecoder("utf-16").decode(e),e=i(JSON.parse(e));r.interface.OnPostprocessingGet&&r.interface.OnPostprocessingGet(e)}),r.interface.OnPostprocessingGet=void 0,e.postprocessing_interface=r.interface,r.interface},pe.ue_globalparams_interface=function(e,t){var i,r,o,n;return null!=e.ue_globalparams_interface?e.ue_globalparams_interface:((i=e.handlers.get(t.StampPixelStreamingHandleType.StampType_UeGlobalParams)).UeGlobalParamsCommandSetDataType={UeGlobalParamsCommandSetData_BackGroundColor:0,UeGlobalParamsCommandSetData_ExposureSettingFixed:1,UeGlobalParamsCommandSetData_ExposureSettingFixedEv100:2,UeGlobalParamsCommandSetData_ScaleColor:3},i.CommandType={UeGlobalParamsCommand_SetData:0,UeGlobalParamsCommand_GetUeGlobalParams:1},r=function(e,t){e.writeFloat64(null!=t.r?t.r:t.x),e.writeFloat64(null!=t.g?t.g:t.y),e.writeFloat64(null!=t.b?t.b:t.z),e.writeFloat64(null!=t.a?t.a:t.w)},o=function(e,t){e.writeInt32(null!=t.r?t.r:t.x),e.writeInt32(null!=t.g?t.g:t.y),e.writeInt32(null!=t.b?t.b:t.z)},n=function(e,t){var n,a,t=new Q(e,t),e=e[2];return n=e,a=BigInt(0),null!=n&&(null!=n.backGroundColor&&(a+=BigInt(1)<<BigInt(i.UeGlobalParamsCommandSetDataType.UeGlobalParamsCommandSetData_BackGroundColor)),null!=n.exposureSettingFixed&&(a+=BigInt(1)<<BigInt(i.UeGlobalParamsCommandSetDataType.UeGlobalParamsCommandSetData_ExposureSettingFixed)),null!=n.exposureSettingFixedEv100&&(a+=BigInt(1)<<BigInt(i.UeGlobalParamsCommandSetDataType.UeGlobalParamsCommandSetData_ExposureSettingFixedEv100)),null!=n.scaleColor)&&(a+=BigInt(1)<<BigInt(i.UeGlobalParamsCommandSetDataType.UeGlobalParamsCommandSetData_ScaleColor)),t.writeUint64(a),n=t,null!=(a=e)&&(null!=a.backGroundColor&&o(n,a.backGroundColor),null!=a.exposureSettingFixed&&n.writeUint8(a.exposureSettingFixed?1:0),null!=a.exposureSettingFixedEv100&&n.writeFloat32(a.exposureSettingFixedEv100),null!=a.scaleColor)&&r(n,a.scaleColor),t.ValidData()},i.interface.set_globalparams_data=function(e){i.create_custom_command(i.CommandType.UeGlobalParamsCommand_SetData,n,e)},i.interface.get_globalparams=function(){i.create_custom_command(i.CommandType.UeGlobalParamsCommand_GetUeGlobalParams,t.GetNoParamCommandPackData)},i.RespondType={UeGlobalParamsRespond_UeGlobalParamsGet:0},i.create_sub_handler(i.RespondType.UeGlobalParamsRespond_UeGlobalParamsGet,function(e){e=new TextDecoder("utf-16").decode(e),e=JSON.parse(e);i.interface.OnUeGlobalParamsGet&&i.interface.OnUeGlobalParamsGet(e)}),i.interface.OnUeGlobalParamsGet=void 0,e.ue_globalparams_interface=i.interface,i.interface)},fe.webui_interface=function(e,t){var n,a,i,r,o,s,c,l,m,d,u;return null!=e.webui_interface?e.webui_interface:((n=e.handlers.get(t.StampPixelStreamingHandleType.StampType_WebUI)).CommandType={WebUICommand_CreateWebUI:0,WebUICommand_AddWebInterface:1,WebUICommand_RemoveWebInterface:2,WebUICommand_SetWebInterfaceVisible:3,WebUICommand_Load:4,WebUICommand_SetUserWidgetVisible:5,WebUICommand_RemoveUserWidget:6,WebUICommand_SetWebInterfacePoition:7,WebUICommand_SetWebInterfaceAnchors:8,WebUICommand_SetWebInterfaceOffset:9,WebUICommand_SetWebInterfaceAlign:10,WebUICommand_ComputeIntersect:11,WebUICommand_SetMinMaxVisibleRange:12},a=function(e,t){var n=new Q(e,t);n.writeWString(e[2]),n.writeWString(e[3]),n.writeWString(e[4]),n.writeUint8(e[5]);for(var a=6;a<14;++a)n.writeFloat64(e[a]);return n.writeUint8(e[14]),e[14]&&(n.writeFloat64(e[15]),n.writeFloat64(e[16]),n.writeFloat64(e[17]),n.writeUint8(e[18]),e[19])&&e[20]&&(n.writeFloat32(e[19]),n.writeFloat32(e[20])),n.ValidData()},i=function(e,t){t=new Q(e,t);return t.writeWString(e[2]),t.writeWString(e[3]),t.ValidData()},r=function(e,t){t=new Q(e,t);return t.writeWString(e[2]),t.writeWString(e[3]),t.writeUint8(e[4]?1:0),t.ValidData()},o=function(e,t){t=new Q(e,t);return t.writeWString(e[2]),t.writeWString(e[3]),t.writeWString(e[4]),t.writeUint8(e[5]),t.ValidData()},s=function(e,t){t=new Q(e,t);return t.writeWString(e[2]),t.writeUint8(e[3]?1:0),t.ValidData()},c=function(e,t){t=new Q(e,t);return t.writeWString(e[2]),t.ValidData()},l=function(e,t){var n=new Q(e,t);n.writeWString(e[2]),n.writeWString(e[3]);for(var a=4;a<e.length;++a)n.writeFloat64(e[a]);return n.ValidData()},m=function(e,t){t=new Q(e,t);return t.writeWString(e[2]),t.writeWString(e[3]),t.writeUint8(e[4]),t.ValidData()},d=function(e,t){t=new Q(e,t);return t.writeInt32(e[2]),t.writeInt32(e[3]),t.ValidData()},u=function(e,t){t=new Q(e,t);return t.writeWString(e[2]),t.writeWString(e[3]),t.writeFloat32(e[4]),t.writeFloat32(e[5]),t.ValidData()},n.interface.create_webui=function(e){n.create_custom_command(n.CommandType.WebUICommand_CreateWebUI,a,e)},n.interface.add_web_interface=function(e){n.create_custom_command(n.CommandType.WebUICommand_AddWebInterface,a,e)},n.interface.remove_web_interface=function(e){n.create_custom_command(n.CommandType.WebUICommand_RemoveWebInterface,i,e)},n.interface.set_web_interface_visible=function(e){n.create_custom_command(n.CommandType.WebUICommand_SetWebInterfaceVisible,r,e)},n.interface.load=function(e){n.create_custom_command(n.CommandType.WebUICommand_Load,o,e)},n.interface.set_user_widget_visible=function(e){n.create_custom_command(n.CommandType.WebUICommand_SetUserWidgetVisible,s,e)},n.interface.remove_user_widget=function(e){n.create_custom_command(n.CommandType.WebUICommand_RemoveUserWidget,c,e)},n.interface.set_web_interface_position=function(e){n.create_custom_command(n.CommandType.WebUICommand_SetWebInterfacePoition,l,e)},n.interface.set_web_interface_anchors=function(e){n.create_custom_command(n.CommandType.WebUICommand_SetWebInterfaceAnchors,l,e)},n.interface.set_web_interface_offset=function(e){n.create_custom_command(n.CommandType.WebUICommand_SetWebInterfaceOffset,l,e)},n.interface.set_web_interface_align=function(e){n.create_custom_command(n.CommandType.WebUICommand_SetWebInterfaceAlign,m,e)},n.interface.intersect=function(e){n.create_custom_command(n.CommandType.WebUICommand_ComputeIntersect,d,e)},n.interface.set_min_max_visible_range=function(e){n.create_custom_command(n.CommandType.WebUICommand_SetMinMaxVisibleRange,u,e)},n.RespondType={WebUIRespond_OnWebUI:0},n.create_sub_handler(n.RespondType.WebUIRespond_OnWebUI,function(e){n.interface.OnWebUI&&n.interface.OnWebUI(e)}),n.interface.OnWebUI=void 0,e.webui_interface=n.interface,n.interface)},Se.oceanology_interface=function(e,t){if(null!=e.oceanology_interface)return e.oceanology_interface;var n=e.handlers.get(t.StampPixelStreamingHandleType.StampType_Oceanology);n.CommandType={OceanologyCommand_CreateOceanologyInfiniteOcean:0,OceanologyCommand_CreateOceanologyFluidFlux:1,OceanologyCommand_CreateOceanologySubmergedAnalysis:2,OceanologyCommand_SetUnderwaterParams:3,OceanologyCommand_SetBubblesParams:4,OceanologyCommand_SetQuadTree:5,OceanologyCommand_SetShorelineWetness:6,OceanologyCommand_SetGerstnerWaves:7,OceanologyCommand_SetSurfaceScattering:8,OceanologyCommand_SetCaustics:9,OceanologyCommand_SetFoam:10,OceanologyCommand_SetWaterSurfaceHeight:11,OceanologyCommand_SetCoastlineDomain:12,OceanologyCommand_SetCoastline:13,OceanologyCommand_SetCoastlineColorPreset:14,OceanologyCommand_SetCoastlineColorPresetData:15,OceanologyCommand_GetCoastlineColorPresetData:16,OceanologyCommand_SetCoastlinePolygonCutMask:17,OceanologyCommand_SetOceanWaveShoreWater:18,OceanologyCommand_SetOceanWaveDistantWater:19,OceanologyCommand_AddFluxModifierSource:20,OceanologyCommand_SetFluxModifierSource:21,OceanologyCommand_SetFluxModifierSourceRestartSimulation:22,OceanologyCommand_SetFluxSimulationState:23,OceanologyCommand_SetFluxSimulationPreview:24,OceanologyCommand_SetFluxSimulationTime:25,OceanologyCommand_SetFluxSimulationDomain:26,OceanologyCommand_SetFluxSimulationPhysics:27,OceanologyCommand_SetFluxSimulationFoam:28,OceanologyCommand_SetFluxSimulationWetmap:29,OceanologyCommand_SetVisible:30,OceanologyCommand_RemoveActor:31,OceanologyCommand_SetActorLocation:32,OceanologyCommand_SetActorScale:33,OceanologyCommand_SetActorRotation:34,OceanologyCommand_GenerateProceduralMesh:35,OceanologyCommand_AddWaterSourceDetect:36,OceanologyCommand_GetWaterSourceDetectState:37,OceanologyCommand_AddFluxWorldBrush:38,OceanologyCommand_AddFluxWorldPainter:39,OceanologyCommand_SetFluxWorldBrush:40,OceanologyCommand_SetFluxWorldPainter:41,OceanologyCommand_SetScenePainterActor:42,OceanologyCommand_AddFluxSurfaceMeshGenerator:43,OceanologyCommand_GetFluxSurfaceMeshGenerator:44,OceanologyCommand_SetFluxHeightColor:45,OceanologyCommand_SetCoastlinePosChanged:46,OceanologyCommand_Invalid:47};function a(e,t){var n=new Q(e,t);n.writeWString(e[2]);for(var a=0;a<3;++a)n.writeFloat64(e[a+3]);return n.ValidData()}function i(e,t){var n=new Q(e,t);n.writeWString(e[2]),n.writeWString(e[3]),n.writeWString(e[4]);for(var a=5;a<e.length;++a)n.writeFloat64(e[a]);return n.ValidData()}function r(e,t){var n=new Q(e,t);n.writeWString(e[2]),n.writeWString(e[3]),n.writeWString(e[4]);for(var a=5;a<e.length;++a)n.writeFloat64(e[a]);return n.ValidData()}function o(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.writeUint8(e[3]),t.ValidData()}function s(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.ValidData()}function c(e,t){var n=new Q(e,t);n.writeWString(e[2]),n.writeUint8(e[3]);for(var a=4;a<e.length-4;++a)n.writeFloat64(e[a]);for(a=e.length-4;a<e.length;++a)n.writeFloat32(e[a][0]),n.writeFloat32(e[a][1]),n.writeFloat32(e[a][2]),n.writeFloat32(e[a][3]);return n.ValidData()}function l(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.writeUint8(e[3]),t.writeInt32(e[4]),t.writeFloat64(e[5]),t.ValidData()}function m(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.writeFloat32(e[3]),t.writeInt32(e[4][0]),t.writeInt32(e[4][1]),t.writeInt32(e[5]),t.writeFloat32(e[6]),t.writeInt32(e[7]),t.writeFloat32(e[8]),t.writeFloat64(e[9]),t.writeUint8(e[10]),t.writeFloat32(e[11]),t.writeFloat32(e[12]),t.writeFloat32(e[13]),t.ValidData()}function d(e,t){var n=new Q(e,t);n.writeWString(e[2]),n.writeUint8(e[3]);for(var a=4;a<e.length;++a)n.writeFloat64(e[a]);return n.ValidData()}function u(e,t){var n=new Q(e,t);n.writeWString(e[2]),n.writeUint8(e[3]);for(var a=4;a<e.length;++a)n.writeFloat64(e[a]);return n.ValidData()}function g(e,t){var n=new Q(e,t);n.writeWString(e[2]);for(var a=3;a<e.length-4;++a)n.writeFloat64(e[a]);for(a=e.length-4;a<e.length;++a)n.writeFloat32(e[a][0]),n.writeFloat32(e[a][1]),n.writeFloat32(e[a][2]),n.writeFloat32(e[a][3]);return n.ValidData()}function h(e,t){var n=new Q(e,t);n.writeWString(e[2]);for(var a=3;a<e.length;++a)n.writeFloat64(e[a]);return n.ValidData()}function _(e,t){var n=new Q(e,t);n.writeWString(e[2]);for(var a=3;a<e.length;++a)n.writeFloat64(e[a]);return n.ValidData()}function p(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.writeFloat64(e[3]),t.ValidData()}function f(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.writeUint8(e[3]),t.writeInt32(e[4][0]),t.writeInt32(e[4][1]),t.writeFloat64(e[5][0]),t.writeFloat64(e[5][1]),t.writeInt32(e[6]),t.writeFloat64(e[7]),t.writeFloat64(e[8]),t.writeUint8(e[9]),t.writeInt32(e[10]),t.ValidData()}function S(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.writeUint8(e[3]),t.writeUint8(e[4]),t.writeFloat64(e[5][0]),t.writeFloat64(e[5][1]),t.writeFloat64(e[5][2]),t.writeInt32(e[6]),t.writeInt32(e[7]),t.writeFloat64(e[8]),t.writeFloat64(e[9]),t.writeUint8(e[10]),t.ValidData()}function C(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.ValidData()}function y(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.writeUint8(e[3]),t.writeWString(e[4]),t.ValidData()}function w(e,t){var n=new Q(e,t);n.writeWString(e[2]),n.writeUint8(e[3]),n.writeFloat64(e[4]);for(var a=5;a<e.length-1;++a)n.writeFloat32(e[a][0]),n.writeFloat32(e[a][1]),n.writeFloat32(e[a][2]),n.writeFloat32(e[a][3]);return n.writeFloat64(e[e.length-1]),n.ValidData()}function T(e,t){var n=new Q(e,t),a=(n.writeWString(e[2]),n.writeUint8(e[3]),n.writeInt32(e[4]),null==e[5]?0:e[5].length/2);n.writeInt32(a);for(var i=0;i<a;++i)n.writeFloat64(e[5][2*i]),n.writeFloat64(e[5][1+2*i]);return n.ValidData()}function P(e,t){var n=new Q(e,t);n.writeWString(e[2]);for(var a=3;a<e.length;++a)n.writeFloat64(e[a]);return n.ValidData()}function D(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.writeFloat64(e[3]),t.writeFloat64(e[4]),t.writeFloat64(e[5]),t.writeFloat64(e[6]),t.writeFloat64(e[7][0]),t.writeFloat64(e[7][1]),t.writeFloat64(e[8]),t.writeFloat64(e[9]),t.ValidData()}function v(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.writeFloat64(e[3]),t.writeFloat64(e[4]),t.writeFloat64(e[5]),t.writeFloat64(e[6]),t.writeFloat64(e[7][0]),t.writeFloat64(e[7][1]),t.writeUint8(e[8]),t.writeUint8(e[9]),t.writeFloat64(e[10]),t.writeFloat64(e[11]),t.writeFloat64(e[12]),t.writeInt32(e[13]),t.ValidData()}function I(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.writeFloat64(e[3]),t.writeFloat64(e[4][0]),t.writeFloat64(e[4][1]),t.writeUint8(e[5]),t.writeUint8(e[6]),t.writeFloat64(e[7]),t.writeFloat64(e[8]),t.writeFloat64(e[9]),t.writeInt32(e[10]),t.ValidData()}function b(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.ValidData()}function F(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.writeUint8(e[3]),t.ValidData()}function L(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.writeFloat64(e[3]),t.writeFloat64(e[4]),t.writeFloat64(e[5]),t.ValidData()}function R(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.writeInt32(e[3]),t.writeInt32(e[4]),t.writeInt32(e[5]),t.writeFloat64(e[6]),t.writeFloat64(e[7]),t.writeFloat64(e[8]),t.ValidData()}function E(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.writeUint8(e[3]),t.writeInt32(e[4][0]),t.writeInt32(e[4][1]),t.writeFloat64(e[5][0]),t.writeFloat64(e[5][1]),t.writeFloat32(e[6][0]),t.writeFloat32(e[6][1]),t.writeFloat32(e[6][2]),t.writeFloat32(e[6][3]),t.writeFloat64(e[7]),t.writeFloat64(e[8]),t.writeFloat64(e[9]),t.writeFloat64(e[10]),t.ValidData()}function B(e,t){var n=new Q(e,t);n.writeWString(e[2]);for(var a=3;a<e.length;++a)n.writeFloat64(e[a]);return n.ValidData()}function M(e,t){var n=new Q(e,t);n.writeWString(e[2]);for(var a=3;a<e.length;++a)n.writeFloat64(e[a]);return n.ValidData()}function x(e,t){var n=new Q(e,t);n.writeWString(e[2]);for(var a=3;a<e.length;++a)n.writeFloat64(e[a]);return n.ValidData()}function k(e,t){var n=new Q(e,t);n.writeWString(e[2]);for(var a=3;a<e.length;++a)n.writeFloat64(e[a]);return n.ValidData()}function U(e,t){(t=new Q(e,t)).writeWString(e[2]),t.writeWString(e[3]),t.writeUint8(e[4]),t.writeUint8(e[5]),t.writeFloat32(e[6]),t.writeUint8(e[7]?1:0);var n=null==e[8]||3!=e[8].length?0:1;return t.writeUint8(n?1:0),n&&(t.writeFloat64(e[8][0]),t.writeFloat64(e[8][1]),t.writeFloat64(e[8][2])),t.ValidData()}function G(e,t){var n=new Q(e,t);n.writeUint32(e[2]);for(var a=0;a<e[2];++a){n.writeWString(e[3+2*a]);for(var i=0;i<3;++i)n.writeFloat64(e[3+2*a+1][i])}return n.ValidData()}function A(e,t){var n=new Q(e,t);n.writeUint32(e[2]);for(var a=0;a<e[2];++a)n.writeWString(e[3+a]);return n.ValidData()}function O(e,t){var n=new Q(e,t);n.writeUint32(e[2]);for(var a=0;a<e[2];++a){n.writeWString(e[3+2*a]);for(var i=0;i<3;++i)n.writeFloat64(e[3+2*a+1][i])}return n.ValidData()}function W(e,t){var n=new Q(e,t),a=(n.writeWString(e[2]),n.writeFloat64(e[3]),n.writeFloat64(e[4]),n.writeFloat64(e[5]),n.writeFloat64(e[6]),n.writeUint8(e[7]),null==e[8]?0:e[8].length/2);n.writeUint32(a);for(var i=0;i<a;++i)n.writeFloat64(e[8][2*i]),n.writeFloat64(e[8][1+2*i]);return n.writeFloat64(null==e[9]?0:e[9]),n.writeFloat64(null==e[10]?0:e[10]),n.ValidData()}function V(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.writeUint32(e[3]),t.writeUint32(e[4]),t.writeFloat64(e[5]),t.ValidData()}function H(e,t){return(t=new Q(e,t)).writeWString(e[2]),t.writeWString(e[3]),t.ValidData()}function z(e,t){var n=new Q(e,t);n.writeWString(e[2]);for(var a=3;a<e.length;++a)n.writeFloat64(e[a]);return n.ValidData()}function N(e,t){var n=new Q(e,t),a=(n.writeWString(e[2]),n.writeUint8(e[3]?1:0),n.writeFloat64(e[4]),e[5].length/2);n.writeUint32(a);for(var i,r,o=0;o<a;++o)n.writeFloat32(e[5][2*o]),i=e[5][2*o+1],r=n,i=parseInt("0x"+i.toString().substring(1).toLowerCase()),r.writeUint32(i);return n.ValidData()}function j(e,t){var n=new Q(e,t);n.writeWString(e[2]),n.writeWString(e[3]);for(var a=0;a<3;++a)n.writeFloat64(e[4][a]);n.writeFloat64(e[5]),n.writeUint8(e[6]),n.writeUint32(e[7]);var i=null==e[8]?0:e[8].length/2;for(n.writeInt32(i),a=0;a<i;++a)n.writeFloat64(e[8][2*a]),n.writeFloat64(e[8][1+2*a]);return n.ValidData()}n.interface.create_oceanology_infinite_ocean=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_CreateOceanologyInfiniteOcean,a,e)},n.interface.create_oceanology_fluid_flux=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_CreateOceanologyFluidFlux,i,e)},n.interface.create_oceanology_submerged_analysis=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_CreateOceanologySubmergedAnalysis,r,e)},n.interface.set_oceanology_underwater=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetUnderwaterParams,c,e)},n.interface.set_oceanology_bubbles=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetBubblesParams,l,e)},n.interface.set_oceanology_quad_tree=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetQuadTree,m,e)},n.interface.set_oceanology_shoreline_wetness=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetShorelineWetness,d,e)},n.interface.set_oceanology_gerstner_waves=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetGerstnerWaves,u,e)},n.interface.set_oceanology_surface_scattering=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetSurfaceScattering,g,e)},n.interface.set_oceanology_caustics=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetCaustics,h,e)},n.interface.set_oceanology_foam=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetFoam,_,e)},n.interface.set_oceanology_water_surface_height=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetWaterSurfaceHeight,p,e)},n.interface.set_oceanology_coastline_domain=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetCoastlineDomain,f,e)},n.interface.set_oceanology_coastline=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetCoastline,S,e)},n.interface.get_oceanology_coastline_color_preset_data=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_GetCoastlineColorPresetData,C,e)},n.interface.set_oceanology_coastline_color_preset=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetCoastlineColorPreset,y,e)},n.interface.set_oceanology_coastline_color_preset_data=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetCoastlineColorPresetData,w,e)},n.interface.set_oceanology_coastline_polygon_cut_mask=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetCoastlinePolygonCutMask,T,e)},n.interface.set_oceanology_ocean_wave_shore_water=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetOceanWaveShoreWater,P,e)},n.interface.set_oceanology_ocean_wave_distant_water=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetOceanWaveDistantWater,D,e)},n.interface.add_flux_modifier_source=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_AddFluxModifierSource,v,e)},n.interface.set_flux_modifier_source=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetFluxModifierSource,I,e)},n.interface.set_flux_modifier_source_restart_simulation=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetFluxModifierSourceRestartSimulation,b,e)},n.interface.set_flux_simulation_state=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetFluxSimulationState,F,e)},n.interface.set_flux_simulation_preview=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetFluxSimulationPreview,L,e)},n.interface.set_flux_simulation_time=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetFluxSimulationTime,R,e)},n.interface.set_flux_simulation_domain=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetFluxSimulationDomain,E,e)},n.interface.set_flux_simulation_physics=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetFluxSimulationPhysics,B,e)},n.interface.set_flux_simulation_foam=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetFluxSimulationFoam,M,e)},n.interface.set_flux_simulation_wetmap=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetFluxSimulationWetmap,x,e)},n.interface.set_scene_actor_visible=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetVisible,o,e)},n.interface.remove_scene_actor=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_RemoveActor,s,e)},n.interface.set_actor_location=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetActorLocation,k,e)},n.interface.set_actor_scale=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetActorScale,k,e)},n.interface.set_actor_rotation=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetActorRotation,k,e)},n.interface.get_submerged_analysis_info=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_GetFluxSurfaceMeshGenerator,U,e)},n.interface.add_water_source_detect=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_AddWaterSourceDetect,G,e)},n.interface.get_water_source_detect_state=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_GetWaterSourceDetectState,A,e)},n.interface.add_flux_world_brush=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_AddFluxWorldBrush,O,e)},n.interface.add_flux_world_painter=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_AddFluxWorldPainter,O,e)},n.interface.set_flux_world_brush=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetFluxWorldBrush,W,e)},n.interface.set_flux_world_painter=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetFluxWorldPainter,V,e)},n.interface.set_scene_painter_actor=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetScenePainterActor,H,e)},n.interface.add_surface_mesh_generator=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_AddFluxSurfaceMeshGenerator,z,e)},n.interface.set_flux_height_color=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetFluxHeightColor,N,e)},n.interface.set_coastline_pos_changed=function(e){n.create_custom_command(n.CommandType.OceanologyCommand_SetCoastlinePosChanged,j,e)};return n.RespondType={OceanologyRespond_OnOceanology:0},n.create_sub_handler(n.RespondType.OceanologyRespond_OnOceanology,function(e){n.interface.OnOceanology&&n.interface.OnOceanology(e)}),n.interface.OnOceanology=void 0,e.oceanology_interface=n.interface,n.interface},Ce.beidou_grid_interface=function(e,t){var o,n,a,r,s,i,c,l,m,d,u,g,h,_;return null!=e.beidou_grid_interface?e.beidou_grid_interface:((o=e.handlers.get(t.StampPixelStreamingHandleType.StampType_Beidou)).CommandType={BeidouCommand_Invalid:0,BeidouCommand_Create:1,BeidouCommand_Modify:2,BeidouCommand_Query:3},o.RespondType={BeidouRespond_OnCreated:0,BeidouRespond_OnModify:1,BeidouRespond_OnQueryID:2,BeidouRespond_OnQueryFromID:3,BeidouRespond_OnQueryFromPolygon:4,BeidouRespond_OnQueryFromLine:5,BeidouRespond_OnQueryFromSquareInfo:6,BeidouRespond_OnQueryFromLineInfo:7},o.interface.LayerType={SE_RTTI_BEIDOU_GRID_LAYER:146,SE_RTTI_BEIDOU_GRID_LAYER_PATH:147},o.interface.QueryType={BeiDou_GetID:0,BeiDou_FromID:1,BeiDou_FromPolygon:2,BeiDou_FromLine:3,BeiDou_FromSqaureInfo:4,BeiDou_FromLineInfo:5},t=function(e){null!=o.interface.OnQuery&&o.interface.OnQuery(e)},n=function(e){null!=o.interface.OnQuery&&(e=new TextDecoder("utf-16").decode(e),e=JSON.parse(e),o.interface.OnQuery(e))},o.SetDataType={BeidouCommand_SetColor:0,BeidouCommand_SetLevel:1,BeidouCommand_SetBeginLayer:2,BeidouCommand_SetEndLayer:3,BeidouCommand_SetLonLatRect:4,BeidouCommand_SetPoints:5,BeidouCommand_SetBackColor:6,BeidouCommand_SetLineWidth:7,BeidouCommand_SetLineIntensity:8,BeidouCommand_SetBackTransparent:9,BeidouCommand_SetIlluminateIntensity:10,BeidouCommand_SetBeidouGridType:11},a=function(e,t){var n,a;if(n=e,a=BigInt(0),null!=n&&(null!=n.color&&(a+=BigInt(1)<<BigInt(o.SetDataType.BeidouCommand_SetColor)),null!=n.level&&(a+=BigInt(1)<<BigInt(o.SetDataType.BeidouCommand_SetLevel)),null!=n.beginLayer&&(a+=BigInt(1)<<BigInt(o.SetDataType.BeidouCommand_SetBeginLayer)),null!=n.endLayer&&(a+=BigInt(1)<<BigInt(o.SetDataType.BeidouCommand_SetEndLayer)),null!=n.lonLatRect&&(a+=BigInt(1)<<BigInt(o.SetDataType.BeidouCommand_SetLonLatRect)),null!=n.points&&(a+=BigInt(1)<<BigInt(o.SetDataType.BeidouCommand_SetPoints)),null!=n.backColor&&(a+=BigInt(1)<<BigInt(o.SetDataType.BeidouCommand_SetBackColor)),null!=n.lineWidth&&(a+=BigInt(1)<<BigInt(o.SetDataType.BeidouCommand_SetLineWidth)),null!=n.lineIntensity&&(a+=BigInt(1)<<BigInt(o.SetDataType.BeidouCommand_SetLineIntensity)),null!=n.backTransparent&&(a+=BigInt(1)<<BigInt(o.SetDataType.BeidouCommand_SetBackTransparent)),null!=n.illuminateIntensity&&(a+=BigInt(1)<<BigInt(o.SetDataType.BeidouCommand_SetIlluminateIntensity)),null!=n.beidouGridType)&&(a+=BigInt(1)<<BigInt(o.SetDataType.BeidouCommand_SetBeidouGridType)),t.writeUint64(a),null!=e){if(null!=e.color&&p(e.color,t),null!=e.level&&t.writeInt32(e.level),null!=e.beginLayer&&t.writeInt32(e.beginLayer),null!=e.endLayer&&t.writeInt32(e.endLayer),null!=e.lonLatRect&&(t.writeFloat64(e.lonLatRect.minLon),t.writeFloat64(e.lonLatRect.minLat),t.writeFloat64(e.lonLatRect.maxLon),t.writeFloat64(e.lonLatRect.maxLat)),null!=e.points){var i=e.points.length;t.writeUint32(i);for(var r=0;r<i;++r)t.writeFloat64(e.points[r].X),t.writeFloat64(e.points[r].Y),t.writeFloat64(e.points[r].Z)}null!=e.backColor&&p(e.backColor,t),null!=e.lineWidth&&t.writeFloat32(e.lineWidth),null!=e.lineIntensity&&t.writeFloat32(e.lineIntensity),null!=e.backTransparent&&t.writeFloat32(e.backTransparent),null!=e.illuminateIntensity&&t.writeFloat32(e.illuminateIntensity),null!=e.beidouGridType&&t.writeInt32(e.beidouGridType)}return t.ValidData()},r=function(e,t){e.beidouGridType=null!=e.beidouGridType?e.beidouGridType:0,e.color,e.backColor,e.lineWidth,e.lineIntensity,e.backTransparent,e.illuminateIntensity,e.level,e.beginLayer,e.endLayer,e.lonLatRect,e.beidouGridType,a(e,t)},s=function(e,t){e.beidouGridType=null!=e.beidouGridType?e.beidouGridType:0;var n={};n.color=e.color,n.backColor=e.backColor,n.lineWidth=e.lineWidth,n.lineIntensity=e.lineIntensity,n.backTransparent=e.backTransparent,n.illuminateIntensity=e.illuminateIntensity,n.level=e.level,n.points=e.points,n.beidouGridType=e.beidouGridType,a(n,t)},i=function(e,t){var n,a,i,t=new Q(e,t),e=e[2];return n=e,(a=t).writeInt32(n.rtti),a.writeWString(n.name),i=null!=n.isWhole&&n.isWhole,a.writeUint8(i?1:0),a.writeWString(n.guid),(o.interface.LayerType.SE_RTTI_BEIDOU_GRID_LAYER_PATH==e.rtti?s:r)(e,t),t.ValidData()},c=function(e,t){t=new Q(e,t),e=e[2];return t.writeWString(e.guid),(o.interface.LayerType.SE_RTTI_BEIDOU_GRID_LAYER_PATH==e.rtti?s:r)(e,t),t.ValidData()},l=function(e,t){t=new Q(e,t),e=e[2];return t.writeInt32(e.type),t.writeInt32(e.level),t.writeFloat64(e.location.X),t.writeFloat64(e.location.Y),t.writeFloat64(e.location.Z),t.writeInt32(e.level),t.writeInt32(null!=e.beidou_grid_type?e.beidou_grid_type:0),t.ValidData()},o.interface.query_beidou_id=function(e,t,n){var a=o.interface.QueryType.BeiDou_GetID;o.create_custom_command(o.CommandType.BeidouCommand_Query,l,[{location:e,level:t,type:a,beidou_grid_type:n}])},m=function(e,t){t=new Q(e,t),e=e[2];return t.writeInt32(e.type),t.writeWString(e.id),t.writeInt32(null!=e.beidou_grid_type?e.beidou_grid_type:0),t.ValidData()},o.interface.query_beidou_info_from_id=function(e,t){var n=o.interface.QueryType.BeiDou_FromID;o.create_custom_command(o.CommandType.BeidouCommand_Query,m,[{id:e,type:n,beidou_grid_type:t}])},d=function(e,t){var n=e.length;t.writeUint32(n);for(var a=0;a<n;++a)t.writeFloat64(e[a].X),t.writeFloat64(e[a].Y),t.writeFloat64(e[a].Z)},u=function(e,t){t=new Q(e,t),e=e[2];return t.writeInt32(e.type),t.writeWString(e.guid),d(e.points,t),t.writeInt64(BigInt(null!=e.height?e.height:-1)),t.ValidData()},o.interface.query_from_polygon=function(e){e.type=o.interface.QueryType.BeiDou_FromPolygon,o.create_custom_command(o.CommandType.BeidouCommand_Query,u,[e])},g=function(e,t){t=new Q(e,t),e=e[2],t.writeInt32(e.type),t.writeWString(e.guid),d(e.points,t),e=null==e.usePointHeight?0:e.usePointHeight;return t.writeUint8(e?1:0),t.ValidData()},o.interface.query_from_line=function(e){e.type=o.interface.QueryType.BeiDou_FromLine,o.create_custom_command(o.CommandType.BeidouCommand_Query,g,[e])},h=function(e,t){t=new Q(e,t),e=e[2];return t.writeInt32(e.type),t.writeWString(e.guid),d(e.points,t),t.writeInt64(BigInt(e.lonBegin)),t.writeInt64(BigInt(e.lonEnd)),t.writeInt64(BigInt(e.latBegin)),t.writeInt64(BigInt(e.latEnd)),t.writeInt64(BigInt(e.heightBegin)),t.writeInt64(BigInt(e.heightEnd)),t.writeInt32(e.level),t.ValidData()},o.interface.query_from_square_info=function(e){e.type=o.interface.QueryType.BeiDou_FromSqaureInfo,o.create_custom_command(o.CommandType.BeidouCommand_Query,h,[e])},_=function(e,t){t=new Q(e,t),e=e[2];return t.writeInt32(e.type),t.writeWString(e.guid),d(e.coords,t),t.writeUint8(e.useHeight?1:0),t.ValidData()},o.interface.query_from_line_info=function(e){e.type=o.interface.QueryType.BeiDou_FromLineInfo,o.create_custom_command(o.CommandType.BeidouCommand_Query,_,[e])},o.interface.create_layer=function(e){o.create_custom_command(o.CommandType.BeidouCommand_Create,i,[e])},o.interface.modify_layer=function(e){o.create_custom_command(o.CommandType.BeidouCommand_Modify,c,[e])},o.create_sub_handler(o.RespondType.BeidouRespond_OnCreated,function(e){null!=o.interface.OnCreateFinished&&o.interface.OnCreateFinished(e)}),o.create_sub_handler(o.RespondType.BeidouRespond_OnModify,function(e){null!=o.interface.OnModified&&o.interface.OnModified(e)}),o.create_sub_handler(o.RespondType.BeidouRespond_OnQueryID,t),o.create_sub_handler(o.RespondType.BeidouRespond_OnQueryFromID,t),o.create_sub_handler(o.RespondType.BeidouRespond_OnQueryFromPolygon,n),o.create_sub_handler(o.RespondType.BeidouRespond_OnQueryFromLine,n),o.create_sub_handler(o.RespondType.BeidouRespond_OnQueryFromSquareInfo,n),o.create_sub_handler(o.RespondType.BeidouRespond_OnQueryFromLineInfo,n),o.interface.OnCreateFinished=void 0,o.interface.OnModified=void 0,o.interface.OnQuery=void 0,e.beidou_grid_interface=o.interface,o.interface);function p(e,t){e=parseInt("0x"+e.toString().substring(1).toLowerCase());t.writeUint32(e)}},ye.image_generator_control=function(e,t){var r,n,a;return null!=e.image_generator_control?e.image_generator_control:((r=e.handlers.get(t.StampPixelStreamingHandleType.StampType_ImageGeneratorInterface)).CommandType={Interface_BeginGenerate:0,Interface_PauseGenerate:1,Interface_ResumeGenerate:2,Interface_EndGenerate:3,Interface_GotoImage:4,Interface_GenerateOne:5},n=function(e,t){t=new Q(e,t);return t.writeWString(e[2]),t.writeLine(e[3]),t.ValidData()},r.interface.begin_generate=function(e,t){r.create_custom_command(r.CommandType.Interface_BeginGenerate,n,[e,t])},r.interface.pause_generate=function(){r.create_custom_command(r.CommandType.Interface_PauseGenerate,t.GetNoParamCommandPackData)},r.interface.resume_generate=function(){r.create_custom_command(r.CommandType.Interface_ResumeGenerate,t.GetNoParamCommandPackData)},r.interface.end_generate=function(){r.create_custom_command(r.CommandType.Interface_EndGenerate,t.GetNoParamCommandPackData)},a=function(e,t){t=new Q(e,t);return t.writeUint32(e[2]),t.ValidData()},r.interface.goto_image=function(e){r.create_custom_command(r.CommandType.Interface_GotoImage,a,[e])},r.interface.generate_one=function(){r.create_custom_command(r.CommandType.Interface_GenerateOne,t.GetNoParamCommandPackData)},r.RespondType={InterfaceRespond_OnBeginGenerateFinished:0,InterfaceRespond_OnPauseGenerateFinished:1,InterfaceRespond_OnEndGenerateFinished:2,InterfaceRespond_OnGenerateOneFinished:3},r.create_sub_handler(r.RespondType.InterfaceRespond_OnBeginGenerateFinished,function(e){r.interface.OnBeginGenerateFinished&&r.interface.OnBeginGenerateFinished(e)}),r.create_sub_handler(r.RespondType.InterfaceRespond_OnPauseGenerateFinished,function(e){r.interface.OnPauseGenerateFinished&&r.interface.OnPauseGenerateFinished(e)}),r.create_sub_handler(r.RespondType.InterfaceRespond_OnEndGenerateFinished,function(e){var t,n,a,i;r.interface.OnEndGenerateFinished&&(i=(a=new DataView(e.buffer)).getUint32(t=0,!0),t+=4,n=new TextDecoder("utf-16").decode(e.subarray(4,4+i)),a=a.getUint32(t+=i,!0),i=e.subarray(t+=4,t+a),r.interface.OnEndGenerateFinished(n,i,a))}),r.create_sub_handler(r.RespondType.InterfaceRespond_OnGenerateOneFinished,function(e){var t,n,a,i;r.interface.OnGenerateOneFinished&&(i=(a=new DataView(e.buffer)).getUint32(t=0,!0),t+=4,n=new TextDecoder("utf-16").decode(e.subarray(4,4+i)),a=a.getUint32(t+=i,!0),t+=4,i=0==a?void 0:e.subarray(t,t+a),r.interface.OnGenerateOneFinished(n,i,a))}),r.interface.OnBeginGenerateFinished=void 0,r.interface.OnPauseGenerateFinished=void 0,r.interface.OnEndGenerateFinished=void 0,r.interface.OnGenerateOneFinished=void 0,e.image_generator_control=r.interface,r.interface)},we.panorama_720_shot_interface=function(e,t){var n,a,i;return null!=e.panorama_720_shot_interface?e.panorama_720_shot_interface:((n=e.handlers.get(t.StampPixelStreamingHandleType.StampType_Panorama720ShotInterface)).CommandType={Panorama720Shot_BeginCapture:0,Panorama720Shot_SetRotation:1,Panorama720Shot_CaptureFrame:2,Panorama720Shot_EndCapture:3},a=function(e,t){t=new Q(e,t),e=e[2];return t.writeInt32(e.size),t.writeFloat64(e.out_time),t.writeFloat64(e.location.x),t.writeFloat64(e.location.y),t.writeFloat64(e.location.z),t.ValidData()},n.interface.begin_capture=function(e){n.create_custom_command(n.CommandType.Panorama720Shot_BeginCapture,a,[e])},i=function(e,t){t=new Q(e,t),e=e[2];return t.writeFloat64(e.heading),t.writeFloat64(e.pitch),t.ValidData()},n.interface.set_rotation=function(e){n.create_custom_command(n.CommandType.Panorama720Shot_SetRotation,i,[e])},n.interface.capture_frame=function(){n.create_custom_command(n.CommandType.Panorama720Shot_CaptureFrame,t.GetNoParamCommandPackData)},n.interface.end_capture=function(){n.create_custom_command(n.CommandType.Panorama720Shot_EndCapture,t.GetNoParamCommandPackData)},n.RespondType={Panorama720ShotRespond_OnBeginCaptureFinished:0,Panorama720ShotRespond_OnCaptureFrameFinished:1,Panorama720ShotRespond_OnEndCaptureFinished:2},n.create_sub_handler(n.RespondType.Panorama720ShotRespond_OnBeginCaptureFinished,function(e){n.interface.OnBeginCaptureFinished&&n.interface.OnBeginCaptureFinished(e)}),n.create_sub_handler(n.RespondType.Panorama720ShotRespond_OnCaptureFrameFinished,function(e){n.interface.OnCaptureFinished&&n.interface.OnCaptureFinished(e)}),n.create_sub_handler(n.RespondType.Panorama720ShotRespond_OnEndCaptureFinished,function(e){n.interface.OnEndCaptureFinished&&n.interface.OnEndCaptureFinished(e)}),n.interface.OnBeginCaptureFinished=void 0,n.interface.OnEndCaptureFinished=void 0,n.interface.OnCaptureFinished=void 0,e.panorama_720_shot_interface=n.interface,n.interface)},Te.edit_data_interface=function(e,t){var n;return null!=e.edit_data_interface?e.edit_data_interface:((n=e.handlers.get(t.StampPixelStreamingHandleType.StampType_EditDataInterface)).interface.parse_get_all_layer_data=function(e){for(var t=new TextDecoder,n=new Q(void 0,void 0,e),a=(n.readInt32(),n.readInt32(),n.readInt32()),i=n.readInt32(),r=[],o=(r.length=a,16),s=0;s<a;++s){n.seek_to(o),r[s]={},r[s].type=n.readInt32(),r[s].islock=n.readUint8(),r[s].objectflag=n.readUint8(),r[s].status=n.readUint8(),n.readUint8(),r[s].layerid=n.readInt32();var c=n.readBuf(16);r[s].lockip=t.decode(c),r[s].lockip=l(r[s].lockip),c=n.readBuf(64),r[s].guid=t.decode(c),r[s].guid=l(r[s].guid),r[s].north=n.readFloat64(),r[s].south=n.readFloat64(),r[s].east=n.readFloat64(),r[s].west=n.readFloat64(),r[s].maxheight=n.readFloat64(),c=n.readBuf(128),r[s].name=t.decode(c),r[s].name=l(r[s].name),c=n.readBuf(64),r[s].dbip=t.decode(c),r[s].dbip=l(r[s].dbip),c=n.readBuf(1e3),r[s].publish_path=t.decode(c),r[s].publish_path=l(r[s].publish_path),r[s].groupid=n.readUint32(),o+=i}},n.interface.pack_create_layer_data=function(e){var t=new TextEncoder,n=new Q(void 0,void 0,new ArrayBuffer(238)),a=t.encode(e.guid);return n.writeBuf(a),n.seek_to(64),a=t.encode(e.name),n.writeBuf(a),n.seek_to(192),n.writeFloat64(e.objectRect.north),n.writeFloat64(e.objectRect.south),n.writeFloat64(e.objectRect.east),n.writeFloat64(e.objectRect.west),n.writeFloat64(e.objectRect.maxheight),n.writeUint8(e.objectFlag),n.writeInt32(e.type),n.writeUint8(e.status),n.ValidData()},n.interface.parse_boolean=function(e){if(1==e.byteLength)return 1==new Uint8Array(e)[0]},n.interface.parse_create_layer_data=function(e){return n.interface.parse_boolean(e)},n.interface.parse_add_col_data=function(e){return n.interface.parse_boolean(e)},n.interface.parse_make_block_edited=function(e){return n.interface.parse_boolean(e)},n.interface.parse_get_publish_status=function(e){return n.interface.parse_boolean(e)},e.edit_data_interface=n.interface,n.interface);function l(e){return e.replace(/^\0+|\0+$/g,"").trim()}},n.prototype.GetNoParamCommandPackData=function(e,t){return new Q(e,t).ValidData()},n.prototype.GetGuidCommandPackData=function(e,t){var n=e[2],e=new Q(e,t);return e.writeWString(n),e.ValidData()},n.prototype.analysis_interface=function(e){return O.analysis_interface(e,this)},n.prototype.camera_interface=function(e){return x.camera_interface(e,this)},n.prototype.directional_light_interface=function(e){return U.directional_light_interface(e,this)},n.prototype.dynamic_system_interface=function(e){return G.dynamic_system_interface(e,this)},n.prototype.element_interface=function(e){return A.element_interface(e,this)},n.prototype.environment_interface=function(e){return W.environment_interface(e,this)},n.prototype.gb28181_camera_manager_interface=function(e){return V.gb28181_camera_manager_interface(e,this)},n.prototype.geology_interface=function(e){return H.geology_interface(e,this)},n.prototype.geometry_algorithm_interface=function(e){return z.geometry_algorithm_interface(e,this)},n.prototype.global_control_interface=function(e){return N.global_control_interface(e,this)},n.prototype.globe_observer_interface=function(e){return j.globe_observer_interface(e,this)},n.prototype.gps_interface=function(e){return K.gps_interface(e,this)},n.prototype.exponential_height_fog_interface=function(e){return Y.exponential_height_fog_interface(e,this)},n.prototype.layer_manager_interface=function(e){return q.layer_manager_interface(e,this)},n.prototype.measure_interface=function(e){return X.measure_interface(e,this)},n.prototype.ms_class_obj_interface=function(e){return J.ms_class_obj_interface(e,this)},n.prototype.ms_symbol_library_interface=function(e){return $.ms_symbol_library_interface(e,this)},n.prototype.particle_system_interface=function(e){return Z.particle_system_interface(e,this)},n.prototype.polygon_algorithm_interface=function(e){return ee.polygon_algorithm_interface(e,this)},n.prototype.query_interface=function(e){return te.query_interface(e,this)},n.prototype.roam_interface=function(e){return ne.roam_interface(e,this)},n.prototype.shape_creator_interface=function(e){return ae.shape_creator_interface(e,this)},n.prototype.sky_light_interface=function(e){return ie.sky_light_interface(e,this)},n.prototype.stamp_frame=function(e){return re.stamp_frame(e,this)},n.prototype.terrain_manager_interface=function(e){return oe.terrain_manager_interface(e,this)},n.prototype.tile_block_style_interface=function(e){return se.tile_block_style_interface(e,this)},n.prototype.track_interface=function(e){return ce.track_interface(e,this)},n.prototype.vector_tile_layer_interface=function(e){return le.vector_tile_layer_interface(e,this)},n.prototype.volumetric_cloud_interface=function(e){return me.volumetric_cloud_interface(e,this)},n.prototype.powerline_interface=function(e){return de.powerline_interface(e,this)},n.prototype.weather_interface=function(e){return ue.weather_interface(e,this)},n.prototype.video_recorder_control=function(e){return ge.video_recorder_control(e,this)},n.prototype.mass_interface=function(e){return he.mass_interface(e,this)},n.prototype.postprocessing_interface=function(e){return _e.postprocessing_interface(e,this)},n.prototype.ue_globalparams_interface=function(e){return pe.ue_globalparams_interface(e,this)},n.prototype.webui_interface=function(e){return fe.webui_interface(e,this)},n.prototype.oceanology_interface=function(e){return Se.oceanology_interface(e,this)},n.prototype.beidou_grid_interface=function(e){return Ce.beidou_grid_interface(e,this)},n.prototype.image_generator_control=function(e){return ye.image_generator_control(e,this)},n.prototype.panorama_720_shot_interface=function(e){return we.panorama_720_shot_interface(e,this)},n.prototype.edit_data_interface=function(e){return Te.edit_data_interface(e,this)};var Pe={371:(e,t,n)=>{e=n.nmd(e);var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};l.localCName=l.generateIdentifier(),l.splitLines=function(e){return e.trim().split("\n").map(function(e){return e.trim()})},l.splitSections=function(e){return e.split("\nm=").map(function(e,t){return(0<t?"m="+e:e).trim()+"\r\n"})},l.getDescription=function(e){e=l.splitSections(e);return e&&e[0]},l.getMediaSections=function(e){e=l.splitSections(e);return e.shift(),e},l.matchPrefix=function(e,t){return l.splitLines(e).filter(function(e){return 0===e.indexOf(t)})},l.parseCandidate=function(e){for(var t=void 0,n={foundation:(t=(0===e.indexOf("a=candidate:")?e.substring(12):e.substring(10)).split(" "))[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},a=8;a<t.length;a+=2)switch(t[a]){case"raddr":n.relatedAddress=t[a+1];break;case"rport":n.relatedPort=parseInt(t[a+1],10);break;case"tcptype":n.tcpType=t[a+1];break;case"ufrag":n.ufrag=t[a+1],n.usernameFragment=t[a+1];break;default:void 0===n[t[a]]&&(n[t[a]]=t[a+1])}return n},l.writeCandidate=function(e){var t=[],n=(t.push(e.foundation),e.component),n=(t.push("rtp"===n?1:"rtcp"===n?2:n),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port),e.type);return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},l.parseIceOptions=function(e){return e.substring(14).split(" ")},l.parseRtpMap=function(e){var e=e.substring(9).split(" "),t={payloadType:parseInt(e.shift(),10)},e=e[0].split("/");return t.name=e[0],t.clockRate=parseInt(e[1],10),t.channels=3===e.length?parseInt(e[2],10):1,t.numChannels=t.channels,t},l.writeRtpMap=function(e){var t=e.payloadType,n=(void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType),e.channels||e.numChannels||1);return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},l.parseExtmap=function(e){e=e.substring(9).split(" ");return{id:parseInt(e[0],10),direction:0<e[0].indexOf("/")?e[0].split("/")[1]:"sendrecv",uri:e[1],attributes:e.slice(2).join(" ")}},l.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+(e.attributes?" "+e.attributes:"")+"\r\n"},l.parseFmtp=function(e){for(var t={},n=void 0,a=e.substring(e.indexOf(" ")+1).split(";"),i=0;i<a.length;i++)t[(n=a[i].trim().split("="))[0].trim()]=n[1];return t},l.writeFmtp=function(t){var n,e="",a=t.payloadType;return void 0!==t.preferredPayloadType&&(a=t.preferredPayloadType),t.parameters&&Object.keys(t.parameters).length&&(n=[],Object.keys(t.parameters).forEach(function(e){void 0!==t.parameters[e]?n.push(e+"="+t.parameters[e]):n.push(e)}),e+="a=fmtp:"+a+" "+n.join(";")+"\r\n"),e},l.parseRtcpFb=function(e){e=e.substring(e.indexOf(" ")+1).split(" ");return{type:e.shift(),parameter:e.join(" ")}},l.writeRtcpFb=function(e){var t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach(function(e){t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"}),t},l.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substring(7,t),10)},a=e.indexOf(":",t);return-1<a?(n.attribute=e.substring(t+1,a),n.value=e.substring(a+1)):n.attribute=e.substring(t+1),n},l.parseSsrcGroup=function(e){e=e.substring(13).split(" ");return{semantics:e.shift(),ssrcs:e.map(function(e){return parseInt(e,10)})}},l.getMid=function(e){e=l.matchPrefix(e,"a=mid:")[0];if(e)return e.substring(6)},l.parseFingerprint=function(e){e=e.substring(14).split(" ");return{algorithm:e[0].toLowerCase(),value:e[1].toUpperCase()}},l.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:l.matchPrefix(e+t,"a=fingerprint:").map(l.parseFingerprint)}},l.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach(function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"}),n},l.parseCryptoLine=function(e){e=e.substring(9).split(" ");return{tag:parseInt(e[0],10),cryptoSuite:e[1],keyParams:e[2],sessionParams:e.slice(3)}},l.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"===a(e.keyParams)?l.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},l.parseCryptoKeyParams=function(e){return 0!==e.indexOf("inline:")?null:{keyMethod:"inline",keySalt:(e=e.substring(7).split("|"))[0],lifeTime:e[1],mkiValue:e[2]?e[2].split(":")[0]:void 0,mkiLength:e[2]?e[2].split(":")[1]:void 0}},l.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},l.getCryptoParameters=function(e,t){return l.matchPrefix(e+t,"a=crypto:").map(l.parseCryptoLine)},l.getIceParameters=function(e,t){var n=l.matchPrefix(e+t,"a=ice-ufrag:")[0],e=l.matchPrefix(e+t,"a=ice-pwd:")[0];return n&&e?{usernameFragment:n.substring(12),password:e.substring(10)}:null},l.writeIceParameters=function(e){var t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},l.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=l.splitLines(e)[0].split(" "),a=3;a<n.length;a++){var i=n[a],r=l.matchPrefix(e,"a=rtpmap:"+i+" ")[0];if(r){var o=l.parseRtpMap(r),r=l.matchPrefix(e,"a=fmtp:"+i+" ");switch(o.parameters=r.length?l.parseFmtp(r[0]):{},o.rtcpFeedback=l.matchPrefix(e,"a=rtcp-fb:"+i+" ").map(l.parseRtcpFb),t.codecs.push(o),o.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(o.name.toUpperCase())}}}l.matchPrefix(e,"a=extmap:").forEach(function(e){t.headerExtensions.push(l.parseExtmap(e))});var s=l.matchPrefix(e,"a=rtcp-fb:* ").map(l.parseRtcpFb);return t.codecs.forEach(function(e){s.forEach(function(t){e.rtcpFeedback.find(function(e){return e.type===t.type&&e.parameter===t.parameter})||e.rtcpFeedback.push(t)})}),t},l.writeRtpDescription=function(e,t){var n="",a=(n=(n=(n=(n+="m="+e+" ")+(0<t.codecs.length?"9":"0")+" UDP/TLS/RTP/SAVPF ")+(t.codecs.map(function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType}).join(" ")+"\r\n"))+"c=IN IP4 0.0.0.0\r\n"+"a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach(function(e){n=(n=(n+=l.writeRtpMap(e))+l.writeFmtp(e))+l.writeRtcpFb(e)}),0);return t.codecs.forEach(function(e){e.maxptime>a&&(a=e.maxptime)}),0<a&&(n+="a=maxptime:"+a+"\r\n"),t.headerExtensions&&t.headerExtensions.forEach(function(e){n+=l.writeExtmap(e)}),n},l.parseRtpEncodingParameters=function(e){var t=[],n=l.parseRtpParameters(e),a=-1!==n.fecMechanisms.indexOf("RED"),i=-1!==n.fecMechanisms.indexOf("ULPFEC"),r=l.matchPrefix(e,"a=ssrc:").map(function(e){return l.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute}),o=0<r.length&&r[0].ssrc,s=void 0,r=l.matchPrefix(e,"a=ssrc-group:FID").map(function(e){return e.substring(17).split(" ").map(function(e){return parseInt(e,10)})}),c=(0<r.length&&1<r[0].length&&r[0][0]===o&&(s=r[0][1]),n.codecs.forEach(function(e){"RTX"===e.name.toUpperCase()&&e.parameters.apt&&(e={ssrc:o,codecPayloadType:parseInt(e.parameters.apt,10)},o&&s&&(e.rtx={ssrc:s}),t.push(e),a)&&((e=JSON.parse(JSON.stringify(e))).fec={ssrc:o,mechanism:i?"red+ulpfec":"red"},t.push(e))}),0===t.length&&o&&t.push({ssrc:o}),l.matchPrefix(e,"b="));return c.length&&(c=0===c[0].indexOf("b=TIAS:")?parseInt(c[0].substring(7),10):0===c[0].indexOf("b=AS:")?1e3*parseInt(c[0].substring(5),10)*.95-16e3:void 0,t.forEach(function(e){e.maxBitrate=c})),t},l.parseRtcpParameters=function(e){var t={},n=l.matchPrefix(e,"a=ssrc:").map(function(e){return l.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute})[0],n=(n&&(t.cname=n.value,t.ssrc=n.ssrc),l.matchPrefix(e,"a=rtcp-rsize")),n=(t.reducedSize=0<n.length,t.compound=0===n.length,l.matchPrefix(e,"a=rtcp-mux"));return t.mux=0<n.length,t},l.writeRtcpParameters=function(e){var t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},l.parseMsid=function(e){var t=void 0,n=l.matchPrefix(e,"a=msid:");return 1===n.length?{stream:(t=n[0].substring(7).split(" "))[0],track:t[1]}:0<(n=l.matchPrefix(e,"a=ssrc:").map(function(e){return l.parseSsrcMedia(e)}).filter(function(e){return"msid"===e.attribute})).length?{stream:(t=n[0].value.split(" "))[0],track:t[1]}:void 0},l.parseSctpDescription=function(e){var t=l.parseMLine(e),n=l.matchPrefix(e,"a=max-message-size:"),a=void 0,n=(0<n.length&&(a=parseInt(n[0].substring(19),10)),isNaN(a)&&(a=65536),l.matchPrefix(e,"a=sctp-port:"));return 0<n.length?{port:parseInt(n[0].substring(12),10),protocol:t.fmt,maxMessageSize:a}:0<(n=l.matchPrefix(e,"a=sctpmap:")).length?(t=n[0].substring(10).split(" "),{port:parseInt(t[0],10),protocol:t[1],maxMessageSize:a}):void 0},l.writeSctpDescription=function(e,t){var n=[],n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"];return void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},l.generateSessionId=function(){return Math.random().toString().substr(2,22)},l.writeSessionBoilerplate=function(e,t,n){t=void 0!==t?t:2;return"v=0\r\no="+(n||"thisisadapterortc")+" "+(e||l.generateSessionId())+" "+t+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},l.getDirection=function(e,t){for(var n=l.splitLines(e),a=0;a<n.length;a++)switch(n[a]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[a].substring(2)}return t?l.getDirection(t):"sendrecv"},l.getKind=function(e){return l.splitLines(e)[0].split(" ")[0].substring(2)},l.isRejected=function(e){return"0"===e.split(" ",2)[1]},l.parseMLine=function(e){e=l.splitLines(e)[0].substring(2).split(" ");return{kind:e[0],port:parseInt(e[1],10),protocol:e[2],fmt:e.slice(3).join(" ")}},l.parseOLine=function(e){e=l.matchPrefix(e,"o=")[0].substring(2).split(" ");return{username:e[0],sessionId:e[1],sessionVersion:parseInt(e[2],10),netType:e[3],addressType:e[4],address:e[5]}},l.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var t=l.splitLines(e),n=0;n<t.length;n++)if(t[n].length<2||"="!==t[n].charAt(1))return!1;return!0},"object"===a(e)&&(e.exports=l)}},De={};function i(e){var t=De[e];return void 0!==t||(t=De[e]={id:e,loaded:!1,exports:{}},Pe[e](t,t.exports,i),t.loaded=!0),t.exports}i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r,o,s,l,c,m,d={};{i.d(d,{Dz:()=>bt,g$:()=>qe,Lt:()=>Ke,Q9:()=>Ye,qf:()=>y,hV:()=>xt,z$:()=>Bt,J0:()=>b,De:()=>It,$C:()=>s,al:()=>it,_W:()=>rt,Gv:()=>St,m:()=>Ct,tz:()=>at,Nu:()=>Et,zg:()=>Vt,vp:()=>vt,vU:()=>P,wF:()=>ht,rv:()=>Lt,Nh:()=>Rt,ss:()=>At,qW:()=>yt,QL:()=>ft,cf:()=>zt,eM:()=>gt,Yd:()=>g,Tk:()=>c,iM:()=>We,qy:()=>h,ce:()=>Ve,sK:()=>D,Ok:()=>I,q5:()=>Mt,g:()=>Sn,xl:()=>dt,I:()=>ut,bx:()=>w,dD:()=>Dt,Ib:()=>p,Az:()=>f,Iw:()=>S,qY:()=>C,db:()=>Qe,mR:()=>T,Tn:()=>_,rV:()=>_t,gh:()=>st,Mi:()=>ct,j:()=>lt,YB:()=>mt,i5:()=>pt,x_:()=>v,Am:()=>k,eR:()=>Xe,r8:()=>ot,u3:()=>Ht,vd:()=>$e,iV:()=>et,jZ:()=>Ze,SW:()=>nt,ZH:()=>tt,Ni:()=>mn,lh:()=>Je,bq:()=>He,$f:()=>hn,eu:()=>Pt,Ax:()=>Tt,Mc:()=>wt});class g{static GetStackTrace(){var e=new Error;let t="No Stack Available for this browser";return t=e.stack?e.stack.toString().replace(/Error/g,""):t}static SetLoggerVerbosity(e){null!=this.verboseLogLevel&&(this.verboseLogLevel=e)}static Log(e,t,n){n>this.verboseLogLevel||console.log(`Level: Log
|
|
2
|
+
Msg: ${t}
|
|
3
|
+
Caller: `+e)}static Info(e,t,n){n>this.verboseLogLevel||console.info(`Level: Info
|
|
4
|
+
Msg: `+t)}static Error(e,t){console.error(`Level: Error
|
|
5
|
+
Msg: ${t}
|
|
6
|
+
Caller: `+e)}static Warning(e,t){console.warn(`Level: Warning
|
|
7
|
+
Caller: ${e}
|
|
8
|
+
Msg: `+t)}}g.verboseLogLevel=5,(m=r=r||{}).LIST_STREAMERS="listStreamers",m.SUBSCRIBE="subscribe",m.UNSUBSCRIBE="unsubscribe",m.ICE_CANDIDATE="iceCandidate",m.OFFER="offer",m.ANSWER="answer",m.DATACHANNELREQUEST="dataChannelRequest",m.SFURECVDATACHANNELREADY="peerDataChannelsReady",m.PONG="pong";class h{payload(){return g.Log(g.GetStackTrace(),"Sending => \n"+JSON.stringify(this,void 0,4),6),JSON.stringify(this)}}class Ee extends h{constructor(){super(),this.type=r.LIST_STREAMERS}}class Be extends h{constructor(e){super(),this.type=r.SUBSCRIBE,this.streamerId=e}}class Me extends h{constructor(){super(),this.type=r.UNSUBSCRIBE}}class ke extends h{constructor(e){super(),this.type=r.PONG,this.time=e}}class Oe extends h{constructor(e){super(),this.type=r.OFFER,e&&(this.type=e.type,this.sdp=e.sdp)}}class xe extends h{constructor(e){super(),this.type=r.ANSWER,e&&(this.type=e.type,this.sdp=e.sdp)}}class Ue extends h{constructor(){super(),this.type=r.DATACHANNELREQUEST}}class Ge extends h{constructor(){super(),this.type=r.SFURECVDATACHANNELREADY}}class Ae{constructor(e){this.type=r.ICE_CANDIDATE,this.candidate=e}payload(){return g.Log(g.GetStackTrace(),"Sending => \n"+JSON.stringify(this,void 0,4),6),JSON.stringify(this)}}(m=o=o||{}).CONFIG="config",m.STREAMER_LIST="streamerList",m.PLAYER_COUNT="playerCount",m.OFFER="offer",m.ANSWER="answer",m.ICE_CANDIDATE="iceCandidate",m.PEER_DATA_CHANNELS="peerDataChannels",m.PING="ping",m.WARNING="warning";class We{}class Ve extends We{}class _{constructor(){this.FromUEMessageHandlers=new Map}addMessageHandler(e,t){this.FromUEMessageHandlers.set(e,t)}handleMessage(e,t){this.FromUEMessageHandlers.has(e)?this.FromUEMessageHandlers.get(e)(t):g.Error(g.GetStackTrace(),`Message type of ${e} does not have a message handler registered on the frontend - ignoring message.`)}static setupDefaultHandlers(n){n.signallingProtocol.addMessageHandler(o.PING,e=>{var t=new ke((new Date).getTime()).payload();g.Log(g.GetStackTrace(),o.PING+": "+e,6),n.webSocket.send(t)}),n.signallingProtocol.addMessageHandler(o.CONFIG,e=>{g.Log(g.GetStackTrace(),o.CONFIG,6);e=JSON.parse(e);n.onConfig(e)}),n.signallingProtocol.addMessageHandler(o.STREAMER_LIST,e=>{g.Log(g.GetStackTrace(),o.STREAMER_LIST,6);e=JSON.parse(e);n.onStreamerList(e)}),n.signallingProtocol.addMessageHandler(o.PLAYER_COUNT,e=>{g.Log(g.GetStackTrace(),o.PLAYER_COUNT,6);e=JSON.parse(e);g.Log(g.GetStackTrace(),"Player Count: "+e.count,6),n.onPlayerCount(e)}),n.signallingProtocol.addMessageHandler(o.ANSWER,e=>{g.Log(g.GetStackTrace(),o.ANSWER,6);e=JSON.parse(e);n.onWebRtcAnswer(e)}),n.signallingProtocol.addMessageHandler(o.OFFER,e=>{g.Log(g.GetStackTrace(),o.OFFER,6);e=JSON.parse(e);n.onWebRtcOffer(e)}),n.signallingProtocol.addMessageHandler(o.ICE_CANDIDATE,e=>{g.Log(g.GetStackTrace(),o.ICE_CANDIDATE,6);e=JSON.parse(e);n.onIceCandidate(e.candidate)}),n.signallingProtocol.addMessageHandler(o.WARNING,e=>{g.Warning(g.GetStackTrace(),"Warning received: "+e)}),n.signallingProtocol.addMessageHandler(o.PEER_DATA_CHANNELS,e=>{g.Log(g.GetStackTrace(),o.PEER_DATA_CHANNELS,6);e=JSON.parse(e);n.onWebRtcPeerDataChannels(e)})}}class He{constructor(){this.WS_OPEN_STATE=1,this.onOpen=new EventTarget,this.onClose=new EventTarget,this.signallingProtocol=new _,_.setupDefaultHandlers(this)}connect(e){g.Log(g.GetStackTrace(),e,6);try{return this.webSocket=new WebSocket(e),this.webSocket.onopen=e=>this.handleOnOpen(e),this.webSocket.onerror=()=>this.handleOnError(),this.webSocket.onclose=e=>this.handleOnClose(e),this.webSocket.onmessage=e=>this.handleOnMessage(e),this.webSocket.onmessagebinary=e=>this.handleOnMessageBinary(e),!0}catch(e){return g.Error(e,e),!1}}handleOnMessageBinary(e){e&&e.data&&e.data.text().then(e=>{e=new MessageEvent("messageFromBinary",{data:e});this.handleOnMessage(e)}).catch(e=>{g.Error(g.GetStackTrace(),"Failed to parse binary blob from websocket, reason: "+e)})}handleOnMessage(e){var t;e.data&&e.data instanceof Blob?this.handleOnMessageBinary(e):(t=JSON.parse(e.data),g.Log(g.GetStackTrace(),"received => \n"+JSON.stringify(JSON.parse(e.data),void 0,4),6),this.signallingProtocol.handleMessage(t.type,e.data))}handleOnOpen(e){g.Log(g.GetStackTrace(),"Connected to the signalling server via WebSocket",6),this.onOpen.dispatchEvent(new Event("open"))}handleOnError(){g.Error(g.GetStackTrace(),"WebSocket error")}handleOnClose(e){g.Log(g.GetStackTrace(),"Disconnected to the signalling server via WebSocket: "+JSON.stringify(e.code)+" - "+e.reason),this.onClose.dispatchEvent(new CustomEvent("close",{detail:e}))}requestStreamerList(){var e=new Ee;this.webSocket.send(e.payload())}sendSubscribe(e){e=new Be(e);this.webSocket.send(e.payload())}sendUnsubscribe(){var e=new Me;this.webSocket.send(e.payload())}sendWebRtcOffer(e){e=new Oe(e);this.webSocket.send(e.payload())}sendWebRtcAnswer(e){e=new xe(e);this.webSocket.send(e.payload())}sendWebRtcDatachannelRequest(){var e=new Ue;this.webSocket.send(e.payload())}sendSFURecvDataChannelReady(){var e=new Ge;this.webSocket.send(e.payload())}sendIceCandidate(e){if(g.Log(g.GetStackTrace(),"Sending Ice Candidate"),this.webSocket&&this.webSocket.readyState===this.WS_OPEN_STATE){const g=new Ae(e);this.webSocket.send(g.payload())}}close(){var e;null!=(e=this.webSocket)&&e.close()}onConfig(e){}onStreamerList(e){}onIceCandidate(e){}onWebRtcAnswer(e){}onWebRtcOffer(e){}onWebRtcPeerDataChannels(e){}onPlayerCount(e){}}class ze{constructor(e){this.videoElementProvider=e,this.audioElement=document.createElement("Audio"),this.videoElementProvider.setAudioElement(this.audioElement)}handleOnTrack(e){g.Log(g.GetStackTrace(),"handleOnTrack "+JSON.stringify(e.streams),6);var t=this.videoElementProvider.getVideoElement();if(e.track&&g.Log(g.GetStackTrace(),"Got track - "+e.track.kind+" id="+e.track.id+" readyState="+e.track.readyState,6),"audio"!=e.track.kind)return"video"==e.track.kind&&t.srcObject!==e.streams[0]?(t.srcObject=e.streams[0],void g.Log(g.GetStackTrace(),"Set video source from video track ontrack.")):void 0;this.CreateAudioTrack(e.streams[0])}CreateAudioTrack(e){var t=this.videoElementProvider.getVideoElement();t.srcObject!=e&&t.srcObject&&t.srcObject!==e&&(this.audioElement.srcObject=e,g.Log(g.GetStackTrace(),"Created new audio element to play separate audio stream."))}}class Ne{constructor(e){this.freezeFrameHeight=0,this.freezeFrameWidth=0,this.rootDiv=e,this.rootElement=document.createElement("div"),this.rootElement.id="freezeFrame",this.rootElement.style.display="none",this.rootElement.style.pointerEvents="none",this.rootElement.style.position="absolute",this.rootElement.style.zIndex="20",this.imageElement=document.createElement("img"),this.imageElement.style.position="absolute",this.rootElement.appendChild(this.imageElement),this.rootDiv.appendChild(this.rootElement)}setElementForShow(){this.rootElement.style.display="block"}setElementForHide(){this.rootElement.style.display="none"}updateImageElementSource(e){e=btoa(e.reduce((e,t)=>e+String.fromCharCode(t),""));this.imageElement.src="data:image/jpeg;base64,"+e}setDimensionsFromElementAndResize(){this.freezeFrameHeight=this.imageElement.naturalHeight,this.freezeFrameWidth=this.imageElement.naturalWidth,this.resize()}resize(){if(0!==this.freezeFrameWidth&&0!==this.freezeFrameHeight){let e=0,t=0,n=0,a=0;var i=this.rootDiv.clientWidth/this.rootDiv.clientHeight,r=this.freezeFrameWidth/this.freezeFrameHeight;a=i<r?(e=this.rootDiv.clientWidth,t=Math.floor(this.rootDiv.clientWidth/r),n=Math.floor(.5*(this.rootDiv.clientHeight-t)),0):(e=Math.floor(this.rootDiv.clientHeight*r),t=this.rootDiv.clientHeight,n=0,Math.floor(.5*(this.rootDiv.clientWidth-e))),this.rootElement.style.width=this.rootDiv.offsetWidth+"px",this.rootElement.style.height=this.rootDiv.offsetHeight+"px",this.rootElement.style.left="0px",this.rootElement.style.top="0px",this.imageElement.style.width=e+"px",this.imageElement.style.height=t+"px",this.imageElement.style.left=a+"px",this.imageElement.style.top=n+"px"}}}class je{constructor(e){this.receiving=!1,this.size=0,this.jpeg=void 0,this.valid=!1,this.freezeFrameDelay=50,this.freezeFrame=new Ne(e)}showFreezeFrame(){this.valid&&this.freezeFrame.setElementForShow()}hideFreezeFrame(){this.valid=!1,this.freezeFrame.setElementForHide()}updateFreezeFrameAndShow(e,t){this.freezeFrame.updateImageElementSource(e),this.freezeFrame.imageElement.onload=()=>{this.freezeFrame.setDimensionsFromElementAndResize(),t()}}processFreezeFrameMessage(e,t){this.receiving||(this.receiving=!0,this.valid=!1,this.size=0,this.jpeg=void 0),this.size=new DataView(e.slice(1,5).buffer).getInt32(0,!0);e=e.slice(5);if(this.jpeg){const g=new Uint8Array(this.jpeg.length+e.length);g.set(this.jpeg,0),g.set(e,this.jpeg.length),this.jpeg=g}else this.jpeg=e,this.receiving=!0,g.Log(g.GetStackTrace(),`received first chunk of freeze frame: ${this.jpeg.length}/`+this.size,6);this.jpeg.length===this.size?(this.receiving=!1,this.valid=!0,g.Log(g.GetStackTrace(),"received complete freeze frame "+this.size,6),this.updateFreezeFrameAndShow(this.jpeg,t)):this.jpeg.length>this.size&&(g.Error(g.GetStackTrace(),`received bigger freeze frame than advertised: ${this.jpeg.length}/`+this.size),this.jpeg=void 0,this.receiving=!1)}}class p{constructor(e,t,n,a,i=()=>{}){this.onChange=i,this.onChangeEmit=()=>{},this.id=e,this.description=n,this.label=t,this.value=a}set label(e){this._label=e,this.onChangeEmit(this._value)}get label(){return this._label}get value(){return this._value}set value(e){this._value=e,this.onChange(this._value,this),this.onChangeEmit(this._value)}}class f extends p{constructor(e,t,n,a,i,r=()=>{}){super(e,t,n,a,r);e=new URLSearchParams(window.location.search);if(i&&e.has(this.id)){const e=this.getUrlParamFlag();this.flag=e}else this.flag=a;this.useUrlParams=i}getUrlParamFlag(){var e=new URLSearchParams(window.location.search);return!!e.has(this.id)&&"false"!==e.get(this.id)&&"False"!==e.get(this.id)}updateURLParams(){var e;this.useUrlParams&&(e=new URLSearchParams(window.location.search),!0===this.flag?e.set(this.id,"true"):e.set(this.id,"false"),window.history.replaceState({},"",""!==e.toString()?location.pathname+"?"+e:""+location.pathname))}enable(){this.flag=!0}get flag(){return!!this.value}set flag(e){this.value=e}}class S extends p{constructor(e,t,n,a,i,r,o,s=()=>{}){super(e,t,n,r,s),this._min=a,this._max=i;t=new URLSearchParams(window.location.search);if(o&&t.has(this.id)){const e=Number.parseInt(t.get(this.id));this.number=Number.isNaN(e)?r:e}else this.number=r;this.useUrlParams=o}updateURLParams(){var e;this.useUrlParams&&((e=new URLSearchParams(window.location.search)).set(this.id,this.number.toString()),window.history.replaceState({},"",""!==e.toString()?location.pathname+"?"+e:""+location.pathname))}set number(e){this.value=this.clamp(e)}get number(){return this.value}clamp(e){return Math.max(Math.min(this._max,e),this._min)}get min(){return this._min}get max(){return this._max}addOnChangedListener(e){this.onChange=e}}class Qe extends p{constructor(e,t,n,a,i,r=()=>{}){super(e,t,n,a,r);e=new URLSearchParams(window.location.search);if(i&&e.has(this.id)){const e=this.getUrlParamText();this.text=e}else this.text=a;this.useUrlParams=i}getUrlParamText(){var e=new URLSearchParams(window.location.search);return e.has(this.id)&&null!=(e=e.get(this.id))?e:""}updateURLParams(){var e;this.useUrlParams&&((e=new URLSearchParams(window.location.search)).set(this.id,this.text),window.history.replaceState({},"",""!==e.toString()?location.pathname+"?"+e:""+location.pathname))}get text(){return this.value}set text(e){this.value=e}}class C extends p{constructor(e,t,n,a,i,r,o=()=>{}){super(e,t,n,[a,a],o),this.options=i;e=new URLSearchParams(window.location.search),t=r&&e.has(this.id)?this.getUrlParamText():a;this.selected=t,this.useUrlParams=r}getUrlParamText(){var e=new URLSearchParams(window.location.search);return e.has(this.id)&&null!=(e=e.get(this.id))?e:""}updateURLParams(){var e;this.useUrlParams&&((e=new URLSearchParams(window.location.search)).set(this.id,this.selected),window.history.replaceState({},"",""!==e.toString()?location.pathname+"?"+e:""+location.pathname))}addOnChangedListener(e){this.onChange=e}get options(){return this._options}set options(e){this._options=e,this.onChangeEmit(this.selected)}get selected(){return this.value}set selected(t){var e;null==t||t.length<=0||((e=this.options.filter(e=>-1!==e.indexOf(t))).length||(e=this.options.filter(e=>-1!==e.indexOf(t.split(" ")[0]))).length)&&(this.value=e[0])}}class Ke extends Event{constructor(e){super("afkWarningActivate"),this.data=e}}class y extends Event{constructor(e){super("afkWarningUpdate"),this.data=e}}class Ye extends Event{constructor(){super("afkWarningDeactivate")}}class qe extends Event{constructor(){super("afkTimedOut")}}class Xe extends Event{constructor(e){super("videoEncoderAvgQP"),this.data=e}}class Je extends Event{constructor(){super("webRtcSdp")}}class $e extends Event{constructor(){super("webRtcAutoConnect")}}class Ze extends Event{constructor(){super("webRtcConnecting")}}class et extends Event{constructor(){super("webRtcConnected")}}class tt extends Event{constructor(){super("webRtcFailed")}}class nt extends Event{constructor(e){super("webRtcDisconnected"),this.data=e}}class at extends Event{constructor(e){super("dataChannelOpen"),this.data=e}}class it extends Event{constructor(e){super("dataChannelClose"),this.data=e}}class rt extends Event{constructor(e){super("dataChannelError"),this.data=e}}class ot extends Event{constructor(){super("videoInitialized")}}class st extends Event{constructor(){super("streamLoading")}}class ct extends Event{constructor(){super("streamConnect")}}class lt extends Event{constructor(){super("streamDisconnect")}}class mt extends Event{constructor(){super("streamReconnect")}}class dt extends Event{constructor(e){super("playStreamError"),this.data=e}}class ut extends Event{constructor(){super("playStream")}}class w extends Event{constructor(e){super("playStreamRejected"),this.data=e}}class gt extends Event{constructor(e){super("loadFreezeFrame"),this.data=e}}class ht extends Event{constructor(){super("hideFreezeFrame")}}class _t extends Event{constructor(e){super("statsReceived"),this.data=e}}class pt extends Event{constructor(e){super("streamerListMessage"),this.data=e}}class ft extends Event{constructor(e){super("latencyTestResult"),this.data=e}}class St extends Event{constructor(e){super("dataChannelLatencyTestResponse"),this.data=e}}class Ct extends Event{constructor(e){super("dataChannelLatencyTestResult"),this.data=e}}class yt extends Event{constructor(e){super("initialSettings"),this.data=e}}class T extends Event{constructor(e){super("settingsChanged"),this.data=e}}class wt extends Event{constructor(){super("xrSessionStarted")}}class Tt extends Event{constructor(){super("xrSessionEnded")}}class Pt extends Event{constructor(e){super("xrFrame"),this.data=e}}class Dt extends Event{constructor(e){super("playerCount"),this.data=e}}class vt extends EventTarget{dispatchEvent(e){return super.dispatchEvent(e)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}}class P{}P.AutoConnect="AutoConnect",P.AutoPlayVideo="AutoPlayVideo",P.AFKDetection="TimeoutIfIdle",P.BrowserSendOffer="OfferToReceive",P.HoveringMouseMode="HoveringMouse",P.ForceMonoAudio="ForceMonoAudio",P.ForceTURN="ForceTURN",P.FakeMouseWithTouches="FakeMouseWithTouches",P.IsQualityController="ControlsQuality",P.MatchViewportResolution="MatchViewportRes",P.StartVideoMuted="StartVideoMuted",P.SuppressBrowserKeys="SuppressBrowserKeys",P.UseMic="UseMic",P.KeyboardInput="KeyboardInput",P.MouseInput="MouseInput",P.TouchInput="TouchInput",P.GamepadInput="GamepadInput",P.XRControllerInput="XRControllerInput",P.WaitForStreamer="WaitForStreamer";class D{}D.AFKTimeoutSecs="AFKTimeout",D.MinQP="MinQP",D.MaxQP="MaxQP",D.WebRTCFPS="WebRTCFPS",D.WebRTCMinBitrate="WebRTCMinBitrate",D.WebRTCMaxBitrate="WebRTCMaxBitrate",D.MaxReconnectAttempts="MaxReconnectAttempts",D.StreamerAutoJoinInterval="StreamerAutoJoinInterval";class v{}v.SignallingServerUrl="ss";class I{}I.PreferredCodec="PreferredCodec",I.StreamerId="StreamerId";class It{constructor(e={}){this.flags=new Map,this.numericParameters=new Map,this.textParameters=new Map,this.optionParameters=new Map;var{initialSettings:e,useUrlParams:t}=e;this._useUrlParams=!!t,this.populateDefaultSettings(this._useUrlParams),e&&this.setSettings(e)}get useUrlParams(){return this._useUrlParams}populateDefaultSettings(e){this.textParameters.set(v.SignallingServerUrl,new Qe(v.SignallingServerUrl,"Signalling url","Url of the signalling server",("https:"===location.protocol?"wss://":"ws://")+window.location.hostname+("80"===window.location.port||""===window.location.port?"":":"+window.location.port),e)),this.optionParameters.set(I.StreamerId,new C(I.StreamerId,"Streamer ID","The ID of the streamer to stream.","",[],e)),this.optionParameters.set(I.PreferredCodec,new C(I.PreferredCodec,"Preferred Codec","The preferred codec to be used during codec negotiation","H264 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f",function(){const t=[];if(RTCRtpReceiver.getCapabilities){const n=/(VP\d|H26\d|AV1).*/;RTCRtpReceiver.getCapabilities("video").codecs.forEach(e=>{e=e.mimeType.split("/")[1]+" "+(e.sdpFmtpLine||"");null!==n.exec(e)&&t.push(e)})}else t.push("Only available on Chrome");return t}(),e)),this.flags.set(P.AutoConnect,new f(P.AutoConnect,"Auto connect to stream","Whether we should attempt to auto connect to the signalling server or show a click to start prompt.",!1,e)),this.flags.set(P.AutoPlayVideo,new f(P.AutoPlayVideo,"Auto play video","When video is ready automatically start playing it as opposed to showing a play button.",!0,e)),this.flags.set(P.BrowserSendOffer,new f(P.BrowserSendOffer,"Browser send offer","Browser will initiate the WebRTC handshake by sending the offer to the streamer",!1,e)),this.flags.set(P.UseMic,new f(P.UseMic,"Use microphone","Make browser request microphone access and open an input audio track.",!1,e)),this.flags.set(P.StartVideoMuted,new f(P.StartVideoMuted,"Start video muted","Video will start muted if true.",!1,e)),this.flags.set(P.SuppressBrowserKeys,new f(P.SuppressBrowserKeys,"Suppress browser keys","Suppress certain browser keys that we use in UE, for example F5 to show shader complexity instead of refresh the page.",!0,e)),this.flags.set(P.IsQualityController,new f(P.IsQualityController,"Is quality controller?","True if this peer controls stream quality",!0,e)),this.flags.set(P.ForceMonoAudio,new f(P.ForceMonoAudio,"Force mono audio","Force browser to request mono audio in the SDP",!1,e)),this.flags.set(P.ForceTURN,new f(P.ForceTURN,"Force TURN","Only generate TURN/Relayed ICE candidates.",!1,e)),this.flags.set(P.AFKDetection,new f(P.AFKDetection,"AFK if idle","Timeout the experience if user is AFK for a period.",!1,e)),this.flags.set(P.MatchViewportResolution,new f(P.MatchViewportResolution,"Match viewport resolution","Pixel Streaming will be instructed to dynamically resize the video stream to match the size of the video element.",!1,e)),this.flags.set(P.HoveringMouseMode,new f(P.HoveringMouseMode,"Control Scheme: Locked Mouse","Either locked mouse, where the pointer is consumed by the video and locked to it, or hovering mouse, where the mouse is not consumed.",!1,e,(e,t)=>{t.label=`Control Scheme: ${e?"Hovering":"Locked"} Mouse`})),this.flags.set(P.FakeMouseWithTouches,new f(P.FakeMouseWithTouches,"Fake mouse with touches","A single finger touch is converted into a mouse event. This allows a non-touch application to be controlled partially via a touch device.",!1,e)),this.flags.set(P.KeyboardInput,new f(P.KeyboardInput,"Keyboard input","If enabled, send keyboard events to streamer",!0,e)),this.flags.set(P.MouseInput,new f(P.MouseInput,"Mouse input","If enabled, send mouse events to streamer",!0,e)),this.flags.set(P.TouchInput,new f(P.TouchInput,"Touch input","If enabled, send touch events to streamer",!0,e)),this.flags.set(P.GamepadInput,new f(P.GamepadInput,"Gamepad input","If enabled, send gamepad events to streamer",!0,e)),this.flags.set(P.XRControllerInput,new f(P.XRControllerInput,"XR controller input","If enabled, send XR controller events to streamer",!0,e)),this.flags.set(P.WaitForStreamer,new f(P.WaitForStreamer,"Wait for streamer","Will continue trying to connect to the first streamer available.",!0,e)),this.numericParameters.set(D.AFKTimeoutSecs,new S(D.AFKTimeoutSecs,"AFK timeout","The time (in seconds) it takes for the application to time out if AFK timeout is enabled.",0,600,120,e)),this.numericParameters.set(D.MaxReconnectAttempts,new S(D.MaxReconnectAttempts,"Max Reconnects","Maximum number of reconnects the application will attempt when a streamer disconnects.",0,999,3,e)),this.numericParameters.set(D.MinQP,new S(D.MinQP,"Min QP","The lower bound for the quantization parameter (QP) of the encoder. 0 = Best quality, 51 = worst quality.",0,51,0,e)),this.numericParameters.set(D.MaxQP,new S(D.MaxQP,"Max QP","The upper bound for the quantization parameter (QP) of the encoder. 0 = Best quality, 51 = worst quality.",0,51,51,e)),this.numericParameters.set(D.WebRTCFPS,new S(D.WebRTCFPS,"Max FPS","The maximum FPS that WebRTC will try to transmit frames at.",1,999,60,e)),this.numericParameters.set(D.WebRTCMinBitrate,new S(D.WebRTCMinBitrate,"Min Bitrate (kbps)","The minimum bitrate that WebRTC should use.",0,5e5,0,e)),this.numericParameters.set(D.WebRTCMaxBitrate,new S(D.WebRTCMaxBitrate,"Max Bitrate (kbps)","The maximum bitrate that WebRTC should use.",0,5e5,0,e)),this.numericParameters.set(D.StreamerAutoJoinInterval,new S(D.StreamerAutoJoinInterval,"Streamer Auto Join Interval (ms)","Delay between retries when waiting for an available streamer.",100,9e5,3e3,e))}_addOnNumericSettingChangedListener(e,t){this.numericParameters.has(e)&&this.numericParameters.get(e).addOnChangedListener(t)}_addOnOptionSettingChangedListener(e,t){this.optionParameters.has(e)&&this.optionParameters.get(e).addOnChangedListener(t)}getNumericSettingValue(e){if(this.numericParameters.has(e))return this.numericParameters.get(e).number;throw new Error("There is no numeric setting with the id of "+e)}getTextSettingValue(e){if(this.textParameters.has(e))return this.textParameters.get(e).value;throw new Error("There is no numeric setting with the id of "+e)}setNumericSetting(e,t){if(!this.numericParameters.has(e))throw new Error("There is no numeric setting with the id of "+e);this.numericParameters.get(e).number=t}_addOnSettingChangedListener(e,t){this.flags.has(e)&&(this.flags.get(e).onChange=t)}_addOnTextSettingChangedListener(e,t){this.textParameters.has(e)&&(this.textParameters.get(e).onChange=t)}getSettingOption(e){return this.optionParameters.get(e)}isFlagEnabled(e){return this.flags.get(e).flag}setFlagEnabled(e,t){this.flags.has(e)?this.flags.get(e).flag=t:g.Warning(g.GetStackTrace(),`Cannot toggle flag called ${e} - it does not exist in the Config.flags map.`)}setTextSetting(e,t){this.textParameters.has(e)?this.textParameters.get(e).text=t:g.Warning(g.GetStackTrace(),`Cannot set text setting called ${e} - it does not exist in the Config.textParameters map.`)}setOptionSettingOptions(e,t){this.optionParameters.has(e)?this.optionParameters.get(e).options=t:g.Warning(g.GetStackTrace(),`Cannot set text setting called ${e} - it does not exist in the Config.optionParameters map.`)}setOptionSettingValue(e,t){this.optionParameters.has(e)?this.optionParameters.get(e).selected=t:g.Warning(g.GetStackTrace(),`Cannot set text setting called ${e} - it does not exist in the Config.enumParameters map.`)}setFlagLabel(e,t){this.flags.has(e)?this.flags.get(e).label=t:g.Warning(g.GetStackTrace(),`Cannot set label for flag called ${e} - it does not exist in the Config.flags map.`)}setSettings(e){for(const t of Object.keys(e))(t=>Object.getOwnPropertyNames(P).some(e=>P[e]===t))(t)?this.setFlagEnabled(t,e[t]):(t=>Object.getOwnPropertyNames(D).some(e=>D[e]===t))(t)?this.setNumericSetting(t,e[t]):(t=>Object.getOwnPropertyNames(v).some(e=>v[e]===t))(t)?this.setTextSetting(t,e[t]):(t=>Object.getOwnPropertyNames(I).some(e=>I[e]===t))(t)&&this.setOptionSettingValue(t,e[t])}getSettings(){var e,t,n,a,i,r,o,s,c={};for([e,t]of this.flags.entries())c[e]=t.flag;for([n,a]of this.numericParameters.entries())c[n]=a.number;for([i,r]of this.textParameters.entries())c[i]=r.text;for([o,s]of this.optionParameters.entries())c[o]=s.selected;return c}getFlags(){return Array.from(this.flags.values())}getTextSettings(){return Array.from(this.textParameters.values())}getNumericSettings(){return Array.from(this.numericParameters.values())}getOptionSettings(){return Array.from(this.optionParameters.values())}_registerOnChangeEvents(t){for(const e of this.flags.keys()){const n=this.flags.get(e);n&&(n.onChangeEmit=e=>t.dispatchEvent(new T({id:n.id,type:"flag",value:e,target:n})))}for(const a of this.numericParameters.keys()){const i=this.numericParameters.get(a);i&&(i.onChangeEmit=e=>t.dispatchEvent(new T({id:i.id,type:"number",value:e,target:i})))}for(const r of this.textParameters.keys()){const o=this.textParameters.get(r);o&&(o.onChangeEmit=e=>t.dispatchEvent(new T({id:o.id,type:"text",value:e,target:o})))}for(const s of this.optionParameters.keys()){const c=this.optionParameters.get(s);c&&(c.onChangeEmit=e=>t.dispatchEvent(new T({id:c.id,type:"option",value:e,target:c})))}}}(m=s=s||{})[m.LockedMouse=0]="LockedMouse",m[m.HoveringMouse=1]="HoveringMouse";class bt{constructor(e,t,n){this.closeTimeout=10,this.active=!1,this.countdownActive=!1,this.warnTimer=void 0,this.countDown=0,this.countDownTimer=void 0,this.config=e,this.pixelStreaming=t,this.onDismissAfk=n,this.onAFKTimedOutCallback=()=>{console.log("AFK timed out, did you want to override this callback?")}}onAfkClick(){clearInterval(this.countDownTimer),(this.active||this.countdownActive)&&(this.startAfkWarningTimer(),this.pixelStreaming.dispatchEvent(new Ye))}startAfkWarningTimer(){0<this.config.getNumericSettingValue(D.AFKTimeoutSecs)&&this.config.isFlagEnabled(P.AFKDetection)?this.active=!0:this.active=!1,this.resetAfkWarningTimer()}stopAfkWarningTimer(){this.active=!1,this.countdownActive=!1,clearTimeout(this.warnTimer),clearInterval(this.countDownTimer)}pauseAfkWarningTimer(){this.active=!1}resetAfkWarningTimer(){this.active&&this.config.isFlagEnabled(P.AFKDetection)&&(clearTimeout(this.warnTimer),this.warnTimer=setTimeout(()=>this.activateAfkEvent(),1e3*this.config.getNumericSettingValue(D.AFKTimeoutSecs)))}activateAfkEvent(){this.pauseAfkWarningTimer(),this.pixelStreaming.dispatchEvent(new Ke({countDown:this.countDown,dismissAfk:this.onDismissAfk})),this.countDown=this.closeTimeout,this.countdownActive=!0,this.pixelStreaming.dispatchEvent(new y({countDown:this.countDown})),this.config.isFlagEnabled(P.HoveringMouseMode)||document.exitPointerLock&&document.exitPointerLock(),this.countDownTimer=setInterval(()=>{this.countDown--,0==this.countDown?(this.pixelStreaming.dispatchEvent(new qe),this.onAFKTimedOutCallback(),g.Log(g.GetStackTrace(),"You have been disconnected due to inactivity"),this.stopAfkWarningTimer()):this.pixelStreaming.dispatchEvent(new y({countDown:this.countDown}))},1e3)}}class Ft{constructor(){this.isReceivingFreezeFrame=!1}getDataChannelInstance(){return this}createDataChannel(e,t,n){this.peerConnection=e,this.label=t,null==(this.datachannelOptions=n)&&(this.datachannelOptions={},this.datachannelOptions.ordered=!0),this.dataChannel=this.peerConnection.createDataChannel(this.label,this.datachannelOptions),this.setupDataChannel()}setupDataChannel(){this.dataChannel.binaryType="arraybuffer",this.dataChannel.onopen=e=>this.handleOnOpen(e),this.dataChannel.onclose=e=>this.handleOnClose(e),this.dataChannel.onmessage=e=>this.handleOnMessage(e),this.dataChannel.onerror=e=>this.handleOnError(e)}handleOnOpen(e){var t;g.Log(g.GetStackTrace(),`Data Channel (${this.label}) opened.`,7),this.onOpen(null==(t=this.dataChannel)?void 0:t.label,e)}handleOnClose(e){var t;g.Log(g.GetStackTrace(),`Data Channel (${this.label}) closed.`,7),this.onClose(null==(t=this.dataChannel)?void 0:t.label,e)}handleOnMessage(e){g.Log(g.GetStackTrace(),`Data Channel (${this.label}) message: `+e,8)}handleOnError(e){var t;g.Log(g.GetStackTrace(),`Data Channel (${this.label}) error: `+e,7),this.onError(null==(t=this.dataChannel)?void 0:t.label,e)}onOpen(e,t){}onClose(e,t){}onError(e,t){}}class Lt{}class Rt{}class Et{}class b{}class Bt{}class Mt{}class kt{}class Ot{}class xt{constructor(){this.inboundVideoStats=new Rt,this.inboundAudioStats=new Lt,this.candidatePair=new Bt,this.DataChannelStats=new Et,this.outBoundVideoStats=new Mt,this.sessionStats=new kt,this.streamStats=new Ot,this.codecs=new Map}processStats(e){this.localCandidates=new Array,this.remoteCandidates=new Array,e.forEach(e=>{switch(e.type){case"candidate-pair":this.handleCandidatePair(e);break;case"certificate":case"media-source":case"media-playout":case"outbound-rtp":case"peer-connection":case"remote-inbound-rtp":case"transport":break;case"codec":this.handleCodec(e);break;case"data-channel":this.handleDataChannel(e);break;case"inbound-rtp":this.handleInBoundRTP(e);break;case"local-candidate":this.handleLocalCandidate(e);break;case"remote-candidate":this.handleRemoteCandidate(e);break;case"remote-outbound-rtp":this.handleRemoteOutBound(e);break;case"track":this.handleTrack(e);break;case"stream":this.handleStream(e);break;default:g.Error(g.GetStackTrace(),"unhandled Stat Type"),g.Log(g.GetStackTrace(),e)}})}handleStream(e){this.streamStats=e}handleCandidatePair(e){this.candidatePair.bytesReceived=e.bytesReceived,this.candidatePair.bytesSent=e.bytesSent,this.candidatePair.localCandidateId=e.localCandidateId,this.candidatePair.remoteCandidateId=e.remoteCandidateId,this.candidatePair.nominated=e.nominated,this.candidatePair.readable=e.readable,this.candidatePair.selected=e.selected,this.candidatePair.writable=e.writable,this.candidatePair.state=e.state,this.candidatePair.currentRoundTripTime=e.currentRoundTripTime}handleDataChannel(e){this.DataChannelStats.bytesReceived=e.bytesReceived,this.DataChannelStats.bytesSent=e.bytesSent,this.DataChannelStats.dataChannelIdentifier=e.dataChannelIdentifier,this.DataChannelStats.id=e.id,this.DataChannelStats.label=e.label,this.DataChannelStats.messagesReceived=e.messagesReceived,this.DataChannelStats.messagesSent=e.messagesSent,this.DataChannelStats.protocol=e.protocol,this.DataChannelStats.state=e.state,this.DataChannelStats.timestamp=e.timestamp}handleLocalCandidate(e){var t=new b;t.label="local-candidate",t.address=e.address,t.port=e.port,t.protocol=e.protocol,t.candidateType=e.candidateType,t.id=e.id,this.localCandidates.push(t)}handleRemoteCandidate(e){var t=new b;t.label="local-candidate",t.address=e.address,t.port=e.port,t.protocol=e.protocol,t.id=e.id,t.candidateType=e.candidateType,this.remoteCandidates.push(t)}handleInBoundRTP(e){switch(e.kind){case"video":this.inboundVideoStats=e,null!=this.lastVideoStats&&(this.inboundVideoStats.bitrate=8*(this.inboundVideoStats.bytesReceived-this.lastVideoStats.bytesReceived)/(this.inboundVideoStats.timestamp-this.lastVideoStats.timestamp),this.inboundVideoStats.bitrate=Math.floor(this.inboundVideoStats.bitrate)),this.lastVideoStats=Object.assign({},this.inboundVideoStats);break;case"audio":this.inboundAudioStats=e,null!=this.lastAudioStats&&(this.inboundAudioStats.bitrate=8*(this.inboundAudioStats.bytesReceived-this.lastAudioStats.bytesReceived)/(this.inboundAudioStats.timestamp-this.lastAudioStats.timestamp),this.inboundAudioStats.bitrate=Math.floor(this.inboundAudioStats.bitrate)),this.lastAudioStats=Object.assign({},this.inboundAudioStats);break;default:g.Log(g.GetStackTrace(),"Kind is not handled")}}handleRemoteOutBound(e){"video"===e.kind&&(this.outBoundVideoStats.bytesSent=e.bytesSent,this.outBoundVideoStats.id=e.id,this.outBoundVideoStats.localId=e.localId,this.outBoundVideoStats.packetsSent=e.packetsSent,this.outBoundVideoStats.remoteTimestamp=e.remoteTimestamp,this.outBoundVideoStats.timestamp=e.timestamp)}handleTrack(e){"track"!==e.type||"video_label"!==e.trackIdentifier&&"video"!==e.kind||(this.inboundVideoStats.framesDropped=e.framesDropped,this.inboundVideoStats.framesReceived=e.framesReceived,this.inboundVideoStats.frameHeight=e.frameHeight,this.inboundVideoStats.frameWidth=e.frameWidth)}handleCodec(e){var t=e.id,e=""+e.mimeType.replace("video/","").replace("audio/","")+(e.sdpFmtpLine?" "+e.sdpFmtpLine:"");this.codecs.set(t,e)}handleSessionStatistics(e,t,n){e=Date.now()-e,this.sessionStats.runTime=new Date(e).toISOString().substr(11,8).toString(),e=null===t?"Not sent yet":t?"true":"false";this.sessionStats.controlsStreamInput=e,this.sessionStats.videoEncoderAvgQP=n}isNumber(e){return"number"==typeof e&&isFinite(e)}}var ve=i(371);class Ut{static isVideoTransciever(e){return this.canTransceiverReceiveVideo(e)||this.canTransceiverSendVideo(e)}static canTransceiverReceiveVideo(e){return!!e&&("sendrecv"===e.direction||"recvonly"===e.direction)&&e.receiver&&e.receiver.track&&"video"===e.receiver.track.kind}static canTransceiverSendVideo(e){return!!e&&("sendrecv"===e.direction||"sendonly"===e.direction)&&e.sender&&e.sender.track&&"video"===e.sender.track.kind}static isAudioTransciever(e){return this.canTransceiverReceiveAudio(e)||this.canTransceiverSendAudio(e)}static canTransceiverReceiveAudio(e){return!!e&&("sendrecv"===e.direction||"recvonly"===e.direction)&&e.receiver&&e.receiver.track&&"audio"===e.receiver.track.kind}static canTransceiverSendAudio(e){return!!e&&("sendrecv"===e.direction||"sendonly"===e.direction)&&e.sender&&e.sender.track&&"audio"===e.sender.track.kind}}function u(e,o,s,c){return new(s=s||Promise)(function(n,t){function a(e){try{r(c.next(e))}catch(e){t(e)}}function i(e){try{r(c.throw(e))}catch(e){t(e)}}function r(e){var t;e.done?n(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(a,i)}r((c=c.apply(e,o||[])).next())})}class Gt{constructor(e,t,n){this.config=t,this.createPeerConnection(e,n)}createPeerConnection(e,t){this.config.isFlagEnabled(P.ForceTURN)&&(e.iceTransportPolicy="relay",g.Log(g.GetStackTrace(),"Forcing TURN usage by setting ICE Transport Policy in peer connection config.")),this.peerConnection=new RTCPeerConnection(e),this.peerConnection.onsignalingstatechange=e=>this.handleSignalStateChange(e),this.peerConnection.oniceconnectionstatechange=e=>this.handleIceConnectionStateChange(e),this.peerConnection.onicegatheringstatechange=e=>this.handleIceGatheringStateChange(e),this.peerConnection.ontrack=e=>this.handleOnTrack(e),this.peerConnection.onicecandidate=e=>this.handleIceCandidate(e),this.peerConnection.ondatachannel=e=>this.handleDataChannel(e),this.aggregatedStats=new xt,this.preferredCodec=t,this.updateCodecSelection=!0}createOffer(a,i){return u(this,void 0,void 0,function*(){g.Log(g.GetStackTrace(),"Create Offer",6);var e="localhost"===location.hostname||"127.0.0.1"===location.hostname,t="https:"===location.protocol;let n=i.isFlagEnabled(P.UseMic);!n||e||t||(n=!1,g.Error(g.GetStackTrace(),"Microphone access in the browser will not work if you are not on HTTPS or localhost. Disabling mic access."),g.Error(g.GetStackTrace(),"For testing you can enable HTTP microphone access Chrome by visiting chrome://flags/ and enabling 'unsafely-treat-insecure-origin-as-secure'")),this.setupTransceiversAsync(n).finally(()=>{var e;null!=(e=this.peerConnection)&&e.createOffer(a).then(e=>{var t;this.showTextOverlayConnecting(),e.sdp=this.mungeSDP(e.sdp,n),null!=(t=this.peerConnection)&&t.setLocalDescription(e),this.onSendWebRTCOffer(e)}).catch(()=>{this.showTextOverlaySetupFailure()})})})}receiveOffer(e,a){var t;return u(this,void 0,void 0,function*(){g.Log(g.GetStackTrace(),"Receive Offer",6),null!=(t=this.peerConnection)&&t.setRemoteDescription(e).then(()=>{var e="localhost"===location.hostname||"127.0.0.1"===location.hostname,t="https:"===location.protocol;let n=a.isFlagEnabled(P.UseMic);!n||e||t||(n=!1,g.Error(g.GetStackTrace(),"Microphone access in the browser will not work if you are not on HTTPS or localhost. Disabling mic access."),g.Error(g.GetStackTrace(),"For testing you can enable HTTP microphone access Chrome by visiting chrome://flags/ and enabling 'unsafely-treat-insecure-origin-as-secure'")),this.setupTransceiversAsync(n).finally(()=>{var e;null!=(e=this.peerConnection)&&e.createAnswer().then(e=>{var t;return e.sdp=this.mungeSDP(e.sdp,n),null==(t=this.peerConnection)?void 0:t.setLocalDescription(e)}).then(()=>{var e;this.onSendWebRTCAnswer(null==(e=this.peerConnection)?void 0:e.currentLocalDescription)}).catch(()=>{g.Error(g.GetStackTrace(),"createAnswer() failed")})})}),this.config.setOptionSettingOptions(I.PreferredCodec,this.parseAvailableCodecs(e).filter(e=>this.config.getSettingOption(I.PreferredCodec).options.includes(e)))})}receiveAnswer(e){var t;null!=(t=this.peerConnection)&&t.setRemoteDescription(e),this.config.setOptionSettingOptions(I.PreferredCodec,this.parseAvailableCodecs(e).filter(e=>this.config.getSettingOption(I.PreferredCodec).options.includes(e)))}generateStats(){var e;null!=(e=this.peerConnection)&&e.getStats(null).then(e=>{this.aggregatedStats.processStats(e),this.onVideoStats(this.aggregatedStats),this.updateCodecSelection&&this.config.setOptionSettingValue(I.PreferredCodec,this.aggregatedStats.codecs.get(this.aggregatedStats.inboundVideoStats.codecId))})}close(){this.peerConnection&&(this.peerConnection.close(),this.peerConnection=null)}mungeSDP(e,t){let n=e.replace(/(a=fmtp:\d+ .*level-asymmetry-allowed=.*)\r\n/gm,"$1;x-google-start-bitrate=10000;x-google-max-bitrate=100000\r\n"),a="maxaveragebitrate=510000;";return t&&(a+="sprop-maxcapturerate=48000;"),a=a+(this.config.isFlagEnabled(P.ForceMonoAudio)?"stereo=0;":"stereo=1;")+"useinbandfec=1",n=n.replace("useinbandfec=1",a)}handleOnIce(e){var t;g.Log(g.GetStackTrace(),"peerconnection handleOnIce",6),this.config.isFlagEnabled(P.ForceTURN)&&e.candidate.indexOf("relay")<0?g.Info(g.GetStackTrace(),`Dropping candidate because it was not TURN relay. | Type= ${e.type} | Protocol= ${e.protocol} | Address=${e.address} | Port=${e.port} |`,6):null!=(t=this.peerConnection)&&t.addIceCandidate(e)}handleSignalStateChange(e){g.Log(g.GetStackTrace(),"signaling state change: "+e,6)}handleIceConnectionStateChange(e){g.Log(g.GetStackTrace(),"ice connection state change: "+e,6),this.onIceConnectionStateChange(e)}handleIceGatheringStateChange(e){g.Log(g.GetStackTrace(),"ice gathering state change: "+JSON.stringify(e),6)}handleOnTrack(e){this.onTrack(e)}handleIceCandidate(e){this.onPeerIceCandidate(e)}handleDataChannel(e){this.onDataChannel(e)}onTrack(e){}onIceConnectionStateChange(e){}onPeerIceCandidate(e){}onDataChannel(e){}setupTransceiversAsync(t){var n,a,i;return u(this,void 0,void 0,function*(){var e=0<(null==(n=this.peerConnection)?void 0:n.getTransceivers().length);if(null!=(i=this.peerConnection)&&i.addTransceiver("video",{direction:"recvonly"}),RTCRtpReceiver.getCapabilities&&""!=this.preferredCodec)for(const t of null!=(i=null==(n=this.peerConnection)?void 0:n.getTransceivers())?i:[])if(t&&t.receiver&&t.receiver.track&&"video"===t.receiver.track.kind&&t.setCodecPreferences){const n=this.preferredCodec.split(" "),i=[{mimeType:"video/"+n[0],clockRate:9e4,sdpFmtpLine:n[1]||""}];this.config.getSettingOption(I.PreferredCodec).options.filter(e=>e!=this.preferredCodec).forEach(e=>{e=e.split(" ");i.push({mimeType:"video/"+e[0],clockRate:9e4,sdpFmtpLine:e[1]||""})});for(const t of i)""===t.sdpFmtpLine&&delete t.sdpFmtpLine;t.setCodecPreferences(i)}if(t){const t={video:!1,audio:{autoGainControl:!1,channelCount:1,echoCancellation:!1,latency:0,noiseSuppression:!1,sampleRate:48e3,sampleSize:16,volume:1}},n=yield navigator.mediaDevices.getUserMedia(t);if(n)if(e){for(const t of null!=(i=null==(i=this.peerConnection)?void 0:i.getTransceivers())?i:[])if(Ut.canTransceiverReceiveAudio(t))for(const i of n.getTracks())i.kind&&"audio"==i.kind&&(t.sender.replaceTrack(i),t.direction="sendrecv")}else for(const t of n.getTracks())!t.kind||"audio"!=t.kind||null!=(a=this.peerConnection)&&a.addTransceiver(t,{direction:"sendrecv"});else null!=(i=this.peerConnection)&&i.addTransceiver("audio",{direction:"recvonly"})}else null!=(n=this.peerConnection)&&n.addTransceiver("audio",{direction:"recvonly"})})}onVideoStats(e){}onSendWebRTCOffer(e){}onSendWebRTCAnswer(e){}showTextOverlayConnecting(){}showTextOverlaySetupFailure(){}parseAvailableCodecs(e){if(!RTCRtpReceiver.getCapabilities)return["Only available on Chrome"];const a=[],t=(0,ve.splitSections)(e.sdp);return t.shift(),t.forEach(e=>{const t=(0,ve.parseRtpParameters)(e)["codecs"],n=/(VP\d|H26\d|AV1).*/;t.forEach(t=>{const e=t.name+" "+Object.keys(t.parameters||{}).map(e=>e+"="+t.parameters[e]).join(";");if(null!==n.exec(e)){"VP9"==t.name&&(t.parameters={"profile-id":"0"});const e=t.name+" "+Object.keys(t.parameters||{}).map(e=>e+"="+t.parameters[e]).join(";");a.push(e)}})}),a}}class At{constructor(){this.PixelStreamingSettings=new Wt,this.EncoderSettings=new Vt,this.WebRTCSettings=new Ht}ueCompatible(){null!=this.WebRTCSettings.MaxFPS&&(this.WebRTCSettings.FPS=this.WebRTCSettings.MaxFPS)}}class Wt{}class Vt{}class Ht{}class zt{constructor(){this.ReceiptTimeMs=null,this.TransmissionTimeMs=null,this.PreCaptureTimeMs=null,this.PostCaptureTimeMs=null,this.PreEncodeTimeMs=null,this.PostEncodeTimeMs=null,this.EncodeMs=null,this.CaptureToSendMs=null,this.testStartTimeMs=0,this.browserReceiptTimeMs=0,this.latencyExcludingDecode=0,this.testDuration=0,this.networkLatency=0,this.browserSendLatency=0,this.frameDisplayDeltaTimeMs=0,this.endToEndLatency=0,this.encodeLatency=0}setFrameDisplayDeltaTime(e){0==this.frameDisplayDeltaTimeMs&&(this.frameDisplayDeltaTimeMs=Math.round(e))}processFields(){null!=this.EncodeMs||null==this.PreEncodeTimeMs&&null==this.PostEncodeTimeMs||(g.Log(g.GetStackTrace(),`Setting Encode Ms
|
|
9
|
+
${this.PostEncodeTimeMs}
|
|
10
|
+
`+this.PreEncodeTimeMs,6),this.EncodeMs=this.PostEncodeTimeMs-this.PreEncodeTimeMs),null!=this.CaptureToSendMs||null==this.PreCaptureTimeMs&&null==this.PostCaptureTimeMs||(g.Log(g.GetStackTrace(),`Setting CaptureToSendMs Ms
|
|
11
|
+
${this.PostCaptureTimeMs}
|
|
12
|
+
`+this.PreCaptureTimeMs,6),this.CaptureToSendMs=this.PostCaptureTimeMs-this.PreCaptureTimeMs)}}class F{static setExtensionFromBytes(e,t){t.receiving||(t.mimetype="",t.extension="",t.receiving=!0,t.valid=!1,t.size=0,t.data=[],t.timestampStart=(new Date).getTime(),g.Log(g.GetStackTrace(),"Received first chunk of file",6));e=new TextDecoder("utf-16").decode(e.slice(1));g.Log(g.GetStackTrace(),e,6),t.extension=e}static setMimeTypeFromBytes(e,t){t.receiving||(t.mimetype="",t.extension="",t.receiving=!0,t.valid=!1,t.size=0,t.data=[],t.timestampStart=(new Date).getTime(),g.Log(g.GetStackTrace(),"Received first chunk of file",6));e=new TextDecoder("utf-16").decode(e.slice(1));g.Log(g.GetStackTrace(),e,6),t.mimetype=e}static setContentsFromBytes(e,t){if(t.receiving){t.size=Math.ceil(new DataView(e.slice(1,5).buffer).getInt32(0,!0)/16379);const i=e.slice(5);if(t.data.push(i),g.Log(g.GetStackTrace(),`Received file chunk: ${t.data.length}/`+t.size,6),t.data.length===t.size){t.receiving=!1,t.valid=!0,g.Log(g.GetStackTrace(),"Received complete file",6);const e=(new Date).getTime()-t.timestampStart,i=Math.round(16*t.size*1024/e);g.Log(g.GetStackTrace(),`Average transfer bitrate: ${i}kb/s over ${e/1e3} seconds`,6);var n=new Blob(t.data,{type:t.mimetype}),a=document.createElement("a");a.setAttribute("href",URL.createObjectURL(n)),a.setAttribute("download","transfer."+t.extension),document.body.append(a),a.remove()}else t.data.length>t.size&&(t.receiving=!1,g.Error(g.GetStackTrace(),`Received bigger file than advertised: ${t.data.length}/`+t.size))}}}class Nt{constructor(){this.mimetype="",this.extension="",this.receiving=!1,this.size=0,this.data=[],this.valid=!1}}class L{}L.mainButton=0,L.auxiliaryButton=1,L.secondaryButton=2,L.fourthButton=3,L.fifthButton=4;class R{}R.primaryButton=1,R.secondaryButton=2,R.auxiliaryButton=4,R.fourthButton=8,R.fifthButton=16;class E{constructor(){this.unregisterCallbacks=[]}addUnregisterCallback(e){this.unregisterCallbacks.push(e)}unregisterAll(){for(const e of this.unregisterCallbacks)e();this.unregisterCallbacks=[]}}class jt{constructor(e,t,n){this.touchEventListenerTracker=new E,this.toStreamerMessagesProvider=e,this.videoElementProvider=t,this.coordinateConverter=n;const a=e=>this.onTouchStart(e),i=e=>this.onTouchEnd(e),r=e=>this.onTouchMove(e);document.addEventListener("touchstart",a,{passive:!1}),document.addEventListener("touchend",i,{passive:!1}),document.addEventListener("touchmove",r,{passive:!1}),this.touchEventListenerTracker.addUnregisterCallback(()=>document.removeEventListener("touchstart",a)),this.touchEventListenerTracker.addUnregisterCallback(()=>document.removeEventListener("touchend",i)),this.touchEventListenerTracker.addUnregisterCallback(()=>document.removeEventListener("touchmove",r))}unregisterTouchEvents(){this.touchEventListenerTracker.unregisterAll()}setVideoElementParentClientRect(e){this.videoElementParentClientRect=e}onTouchStart(e){var t,n;this.videoElementProvider.isVideoReady()&&(null==this.fakeTouchFinger&&(t=e.changedTouches[0],this.fakeTouchFinger=new Qt(t.identifier,t.clientX-this.videoElementParentClientRect.left,t.clientY-this.videoElementParentClientRect.top),n=this.videoElementProvider.getVideoParentElement(),t=new MouseEvent("mouseenter",t),n.dispatchEvent(t),n=this.coordinateConverter.normalizeAndQuantizeUnsigned(this.fakeTouchFinger.x,this.fakeTouchFinger.y),this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDown")([L.mainButton,n.x,n.y])),e.preventDefault())}onTouchEnd(t){if(this.videoElementProvider.isVideoReady()){var n=this.videoElementProvider.getVideoParentElement(),a=this.toStreamerMessagesProvider.toStreamerHandlers;for(let e=0;e<t.changedTouches.length;e++){var i=t.changedTouches[e];if(i.identifier===this.fakeTouchFinger.id){const t=i.clientX-this.videoElementParentClientRect.left,r=i.clientY-this.videoElementParentClientRect.top,o=this.coordinateConverter.normalizeAndQuantizeUnsigned(t,r);a.get("MouseUp")([L.mainButton,o.x,o.y]);i=new MouseEvent("mouseleave",i);n.dispatchEvent(i),this.fakeTouchFinger=null;break}}t.preventDefault()}}onTouchMove(t){if(this.videoElementProvider.isVideoReady()){var n=this.toStreamerMessagesProvider.toStreamerHandlers;for(let e=0;e<t.touches.length;e++){var a=t.touches[e];if(a.identifier===this.fakeTouchFinger.id){const t=a.clientX-this.videoElementParentClientRect.left,i=a.clientY-this.videoElementParentClientRect.top,r=this.coordinateConverter.normalizeAndQuantizeUnsigned(t,i),o=this.coordinateConverter.normalizeAndQuantizeSigned(t-this.fakeTouchFinger.x,i-this.fakeTouchFinger.y);n.get("MouseMove")([r.x,r.y,o.x,o.y]),this.fakeTouchFinger.x=t,this.fakeTouchFinger.y=i;break}}t.preventDefault()}}}class Qt{constructor(e,t,n){this.id=e,this.x=t,this.y=n}}class B{}B.backSpace=8,B.shift=16,B.control=17,B.alt=18,B.rightShift=253,B.rightControl=254,B.rightAlt=255;class Kt{constructor(e,t,n){this.keyboardEventListenerTracker=new E,this.CodeToKeyCode={Escape:27,Digit0:48,Digit1:49,Digit2:50,Digit3:51,Digit4:52,Digit5:53,Digit6:54,Digit7:55,Digit8:56,Digit9:57,Minus:173,Equal:187,Backspace:8,Tab:9,KeyQ:81,KeyW:87,KeyE:69,KeyR:82,KeyT:84,KeyY:89,KeyU:85,KeyI:73,KeyO:79,KeyP:80,BracketLeft:219,BracketRight:221,Enter:13,ControlLeft:17,KeyA:65,KeyS:83,KeyD:68,KeyF:70,KeyG:71,KeyH:72,KeyJ:74,KeyK:75,KeyL:76,Semicolon:186,Quote:222,Backquote:192,ShiftLeft:16,Backslash:220,KeyZ:90,KeyX:88,KeyC:67,KeyV:86,KeyB:66,KeyN:78,KeyM:77,Comma:188,Period:190,Slash:191,ShiftRight:253,AltLeft:18,Space:32,CapsLock:20,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,Pause:19,ScrollLock:145,NumpadDivide:111,NumpadMultiply:106,NumpadSubtract:109,NumpadAdd:107,NumpadDecimal:110,Numpad9:105,Numpad8:104,Numpad7:103,Numpad6:102,Numpad5:101,Numpad4:100,Numpad3:99,Numpad2:98,Numpad1:97,Numpad0:96,NumLock:144,ControlRight:254,AltRight:255,Home:36,End:35,ArrowUp:38,ArrowLeft:37,ArrowRight:39,ArrowDown:40,PageUp:33,PageDown:34,Insert:45,Delete:46,ContextMenu:93},this.toStreamerMessagesProvider=e,this.config=t,this.activeKeysProvider=n}registerKeyBoardEvents(){const e=e=>this.handleOnKeyDown(e),t=e=>this.handleOnKeyUp(e),n=e=>this.handleOnKeyPress(e);document.addEventListener("keydown",e),document.addEventListener("keyup",t),document.addEventListener("keypress",n),this.keyboardEventListenerTracker.addUnregisterCallback(()=>document.removeEventListener("keydown",e)),this.keyboardEventListenerTracker.addUnregisterCallback(()=>document.removeEventListener("keyup",t)),this.keyboardEventListenerTracker.addUnregisterCallback(()=>document.removeEventListener("keypress",n))}unregisterKeyBoardEvents(){this.keyboardEventListenerTracker.unregisterAll()}handleOnKeyDown(e){var t=this.getKeycode(e);t&&(g.Log(g.GetStackTrace(),`key down ${t}, repeat = `+e.repeat,6),this.toStreamerMessagesProvider.toStreamerHandlers.get("KeyDown")([this.getKeycode(e),e.repeat?1:0]),this.activeKeysProvider.getActiveKeys().push(t),t===B.backSpace&&document.dispatchEvent(new KeyboardEvent("keypress",{charCode:B.backSpace})),this.config.isFlagEnabled(P.SuppressBrowserKeys))&&this.isKeyCodeBrowserKey(t)&&e.preventDefault()}handleOnKeyUp(e){var t=this.getKeycode(e);t&&(g.Log(g.GetStackTrace(),"key up "+t,6),this.toStreamerMessagesProvider.toStreamerHandlers.get("KeyUp")([t]),this.config.isFlagEnabled(P.SuppressBrowserKeys))&&this.isKeyCodeBrowserKey(t)&&e.preventDefault()}handleOnKeyPress(e){"charCode"in e?(e=e.charCode,g.Log(g.GetStackTrace(),"key press "+e,6),this.toStreamerMessagesProvider.toStreamerHandlers.get("KeyPress")([e])):g.Warning(g.GetStackTrace(),"KeyboardEvent.charCode is deprecated in this browser, cannot send key press.")}getKeycode(e){return"keyCode"in e?e.keyCode===B.shift&&"ShiftRight"===e.code?B.rightShift:e.keyCode===B.control&&"ControlRight"===e.code?B.rightControl:e.keyCode===B.alt&&"AltRight"===e.code?B.rightAlt:e.keyCode:(e=e).code in this.CodeToKeyCode?this.CodeToKeyCode[e.code]:(g.Warning(g.GetStackTrace(),`Keyboard code of ${e.code} is not supported in our mapping, ignoring this key.`),null)}isKeyCodeBrowserKey(e){return 112<=e&&e<=123||9===e}}class Yt{constructor(e,t,n){this.x=0,this.y=0,this.updateMouseMovePositionEvent=e=>{this.updateMouseMovePosition(e)},this.mouseEventListenerTracker=new E,this.videoElementProvider=e,this.mouseController=t,this.activeKeysProvider=n;e=this.videoElementProvider.getVideoParentElement();this.x=e.getBoundingClientRect().width/2,this.y=e.getBoundingClientRect().height/2,this.coord=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(this.x,this.y)}unregisterMouseEvents(){this.mouseEventListenerTracker.unregisterAll()}lockStateChange(){const e=this.videoElementProvider.getVideoParentElement(),t=this.mouseController.toStreamerMessagesProvider.toStreamerHandlers;var n,a;document.pointerLockElement===e||document.mozPointerLockElement===e?(g.Log(g.GetStackTrace(),"Pointer locked",6),document.addEventListener("mousemove",this.updateMouseMovePositionEvent,!1),this.mouseEventListenerTracker.addUnregisterCallback(()=>document.removeEventListener("mousemove",this.updateMouseMovePositionEvent,!1))):(g.Log(g.GetStackTrace(),"The pointer lock status is now unlocked",6),document.removeEventListener("mousemove",this.updateMouseMovePositionEvent,!1),n=this.activeKeysProvider.getActiveKeys(),a=[],new Set(n).forEach(e=>{}),a.forEach(e=>{t.get("KeyUp")([e])}))}updateMouseMovePosition(e){var t,n,a;this.videoElementProvider.isVideoReady()&&(t=this.mouseController.toStreamerMessagesProvider.toStreamerHandlers,a=this.videoElementProvider.getVideoParentElement().clientWidth,n=this.videoElementProvider.getVideoParentElement().clientHeight,this.x+=e.movementX,this.y+=e.movementY,this.x>a&&(this.x-=a),this.y>n&&(this.y-=n),this.x<0&&(this.x=a+this.x),this.y<0&&(this.y=n-this.y),this.coord=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(this.x,this.y),a=this.mouseController.coordinateConverter.normalizeAndQuantizeSigned(e.movementX,e.movementY),t.get("MouseMove")([this.coord.x,this.coord.y,a.x,a.y]))}handleMouseDown(e){this.videoElementProvider.isVideoReady()&&this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDown")([e.button,this.coord.x,this.coord.y])}handleMouseUp(e){this.videoElementProvider.isVideoReady()&&this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp")([e.button,this.coord.x,this.coord.y])}handleMouseWheel(e){this.videoElementProvider.isVideoReady()&&this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseWheel")([e.wheelDelta,this.coord.x,this.coord.y])}handleMouseDouble(e){this.videoElementProvider.isVideoReady()&&this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDouble")([e.button,this.coord.x,this.coord.y])}handlePressMouseButtons(e){this.videoElementProvider.isVideoReady()&&this.mouseController.pressMouseButtons(e.buttons,this.x,this.y)}handleReleaseMouseButtons(e){this.videoElementProvider.isVideoReady()&&this.mouseController.releaseMouseButtons(e.buttons,this.x,this.y)}}class qt{constructor(e){this.mouseController=e}unregisterMouseEvents(){}updateMouseMovePosition(e){var t,n;this.mouseController.videoElementProvider.isVideoReady()&&(g.Log(g.GetStackTrace(),"MouseMove",6),t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY),n=this.mouseController.coordinateConverter.normalizeAndQuantizeSigned(e.movementX,e.movementY),this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseMove")([t.x,t.y,n.x,n.y]),e.preventDefault())}handleMouseDown(e){var t;this.mouseController.videoElementProvider.isVideoReady()&&(g.Log(g.GetStackTrace(),"onMouse Down",6),t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY),this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDown")([e.button,t.x,t.y]),e.preventDefault())}handleMouseUp(e){var t;this.mouseController.videoElementProvider.isVideoReady()&&(g.Log(g.GetStackTrace(),"onMouse Up",6),t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY),this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp")([e.button,t.x,t.y]),e.preventDefault())}handleContextMenu(e){this.mouseController.videoElementProvider.isVideoReady()&&e.preventDefault()}handleMouseWheel(e){var t;this.mouseController.videoElementProvider.isVideoReady()&&(t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY),this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseWheel")([e.wheelDelta,t.x,t.y]),e.preventDefault())}handleMouseDouble(e){var t;this.mouseController.videoElementProvider.isVideoReady()&&(t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY),this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDouble")([e.button,t.x,t.y]))}handlePressMouseButtons(e){this.mouseController.videoElementProvider.isVideoReady()&&(g.Log(g.GetStackTrace(),"onMouse press",6),this.mouseController.pressMouseButtons(e.buttons,e.offsetX,e.offsetY))}handleReleaseMouseButtons(e){this.mouseController.videoElementProvider.isVideoReady()&&(g.Log(g.GetStackTrace(),"onMouse release",6),this.mouseController.releaseMouseButtons(e.buttons,e.offsetX,e.offsetY))}}class Xt{constructor(e,t,n,a){this.mouseEventListenerTracker=new E,this.toStreamerMessagesProvider=e,this.coordinateConverter=n,this.videoElementProvider=t,this.activeKeysProvider=a,this.registerMouseEnterAndLeaveEvents()}unregisterMouseEvents(){this.mouseEventListenerTracker.unregisterAll()}registerLockedMouseEvents(e){const t=this.videoElementProvider.getVideoParentElement(),n=new Yt(this.videoElementProvider,e,this.activeKeysProvider);if(t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock,document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock,t.requestPointerLock){const e=()=>{t.requestPointerLock()};t.addEventListener("click",e),this.mouseEventListenerTracker.addUnregisterCallback(()=>t.removeEventListener("click",e))}const a=()=>n.lockStateChange(),i=(document.addEventListener("pointerlockchange",a,!1),document.addEventListener("mozpointerlockchange",a,!1),this.mouseEventListenerTracker.addUnregisterCallback(()=>document.removeEventListener("pointerlockchange",a,!1)),this.mouseEventListenerTracker.addUnregisterCallback(()=>document.removeEventListener("mozpointerlockchange",a,!1)),e=>n.handleMouseDown(e)),r=e=>n.handleMouseUp(e),o=e=>n.handleMouseWheel(e),s=e=>n.handleMouseDouble(e);t.addEventListener("mousedown",i),t.addEventListener("mouseup",r),t.addEventListener("wheel",o),t.addEventListener("dblclick",s),this.mouseEventListenerTracker.addUnregisterCallback(()=>t.removeEventListener("mousedown",i)),this.mouseEventListenerTracker.addUnregisterCallback(()=>t.removeEventListener("mouseup",r)),this.mouseEventListenerTracker.addUnregisterCallback(()=>t.removeEventListener("wheel",o)),this.mouseEventListenerTracker.addUnregisterCallback(()=>t.removeEventListener("dblclick",s)),this.mouseEventListenerTracker.addUnregisterCallback(()=>n.unregisterMouseEvents()),this.mouseEventListenerTracker.addUnregisterCallback(()=>{!document.exitPointerLock||document.pointerLockElement!==t&&document.mozPointerLockElement!==t||document.exitPointerLock()})}registerHoveringMouseEvents(e){const t=this.videoElementProvider.getVideoParentElement(),n=new qt(e),a=e=>n.updateMouseMovePosition(e),i=e=>n.handleMouseDown(e),r=e=>n.handleMouseUp(e),o=e=>n.handleContextMenu(e),s=e=>n.handleMouseWheel(e),c=e=>n.handleMouseDouble(e);t.addEventListener("mousemove",a),t.addEventListener("mousedown",i),t.addEventListener("mouseup",r),t.addEventListener("contextmenu",o),t.addEventListener("wheel",s),t.addEventListener("dblclick",c),this.mouseEventListenerTracker.addUnregisterCallback(()=>t.removeEventListener("mousemove",a)),this.mouseEventListenerTracker.addUnregisterCallback(()=>t.removeEventListener("mousedown",i)),this.mouseEventListenerTracker.addUnregisterCallback(()=>t.removeEventListener("mouseup",r)),this.mouseEventListenerTracker.addUnregisterCallback(()=>t.removeEventListener("contextmenu",o)),this.mouseEventListenerTracker.addUnregisterCallback(()=>t.removeEventListener("wheel",s)),this.mouseEventListenerTracker.addUnregisterCallback(()=>t.removeEventListener("dblclick",c)),this.mouseEventListenerTracker.addUnregisterCallback(()=>n.unregisterMouseEvents())}registerMouseEnterAndLeaveEvents(){const e=this.videoElementProvider.getVideoParentElement(),t=e=>{this.videoElementProvider.isVideoReady()&&(g.Log(g.GetStackTrace(),"Mouse Entered",6),this.sendMouseEnter(),this.pressMouseButtons(e.buttons,e.x,e.y))},n=e=>{this.videoElementProvider.isVideoReady()&&(g.Log(g.GetStackTrace(),"Mouse Left",6),this.sendMouseLeave(),this.releaseMouseButtons(e.buttons,e.x,e.y))};e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",n),this.mouseEventListenerTracker.addUnregisterCallback(()=>e.removeEventListener("mouseenter",t)),this.mouseEventListenerTracker.addUnregisterCallback(()=>e.removeEventListener("mouseleave",n))}releaseMouseButtons(e,t,n){t=this.coordinateConverter.normalizeAndQuantizeUnsigned(t,n);e&R.primaryButton&&this.sendMouseUp(L.mainButton,t.x,t.y),e&R.secondaryButton&&this.sendMouseUp(L.secondaryButton,t.x,t.y),e&R.auxiliaryButton&&this.sendMouseUp(L.auxiliaryButton,t.x,t.y),e&R.fourthButton&&this.sendMouseUp(L.fourthButton,t.x,t.y),e&R.fifthButton&&this.sendMouseUp(L.fifthButton,t.x,t.y)}pressMouseButtons(e,t,n){this.videoElementProvider.isVideoReady()&&(t=this.coordinateConverter.normalizeAndQuantizeUnsigned(t,n),e&R.primaryButton&&this.sendMouseDown(L.mainButton,t.x,t.y),e&R.secondaryButton&&this.sendMouseDown(L.secondaryButton,t.x,t.y),e&R.auxiliaryButton&&this.sendMouseDown(L.auxiliaryButton,t.x,t.y),e&R.fourthButton&&this.sendMouseDown(L.fourthButton,t.x,t.y),e&R.fifthButton)&&this.sendMouseDown(L.fifthButton,t.x,t.y)}sendMouseEnter(){this.videoElementProvider.isVideoReady()&&this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseEnter")()}sendMouseLeave(){this.videoElementProvider.isVideoReady()&&this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseLeave")()}sendMouseDown(e,t,n){this.videoElementProvider.isVideoReady()&&(g.Log(g.GetStackTrace(),`mouse button ${e} down at (${t}, ${n})`,6),this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDown")([e,t,n]))}sendMouseUp(e,t,n){this.videoElementProvider.isVideoReady()&&(g.Log(g.GetStackTrace(),`mouse button ${e} up at (${t}, ${n})`,6),t=this.coordinateConverter.normalizeAndQuantizeUnsigned(t,n),this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp")([e,t.x,t.y]))}}class Jt{constructor(e,t,n){this.fingers=[9,8,7,6,5,4,3,2,1,0],this.fingerIds=new Map,this.maxByteValue=255,this.touchEventListenerTracker=new E,this.toStreamerMessagesProvider=e,this.videoElementProvider=t,this.coordinateConverter=n,this.videoElementParent=t.getVideoElement();const a=e=>this.onTouchStart(e),i=e=>this.onTouchEnd(e),r=e=>this.onTouchMove(e),o=(this.videoElementParent.addEventListener("touchstart",a),this.videoElementParent.addEventListener("touchend",i),this.videoElementParent.addEventListener("touchmove",r),this.touchEventListenerTracker.addUnregisterCallback(()=>this.videoElementParent.removeEventListener("touchstart",a)),this.touchEventListenerTracker.addUnregisterCallback(()=>this.videoElementParent.removeEventListener("touchend",i)),this.touchEventListenerTracker.addUnregisterCallback(()=>this.videoElementParent.removeEventListener("touchmove",r)),g.Log(g.GetStackTrace(),"Touch Events Registered",6),e=>{e.preventDefault()});document.addEventListener("touchmove",o),this.touchEventListenerTracker.addUnregisterCallback(()=>document.removeEventListener("touchmove",o))}unregisterTouchEvents(){this.touchEventListenerTracker.unregisterAll()}rememberTouch(e){var t=this.fingers.pop();void 0===t&&g.Log(g.GetStackTrace(),"exhausted touch identifiers",6),this.fingerIds.set(e.identifier,t)}forgetTouch(e){this.fingers.push(this.fingerIds.get(e.identifier)),this.fingers.sort(function(e,t){return t-e}),this.fingerIds.delete(e.identifier)}onTouchStart(t){if(this.videoElementProvider.isVideoReady()){for(let e=0;e<t.changedTouches.length;e++)this.rememberTouch(t.changedTouches[e]);g.Log(g.GetStackTrace(),"touch start",6),this.emitTouchData("TouchStart",t.changedTouches),t.preventDefault()}}onTouchEnd(t){if(this.videoElementProvider.isVideoReady()){g.Log(g.GetStackTrace(),"touch end",6),this.emitTouchData("TouchEnd",t.changedTouches);for(let e=0;e<t.changedTouches.length;e++)this.forgetTouch(t.changedTouches[e]);t.preventDefault()}}onTouchMove(e){this.videoElementProvider.isVideoReady()&&(g.Log(g.GetStackTrace(),"touch move",6),this.emitTouchData("TouchMove",e.touches),e.preventDefault())}emitTouchData(t,n){if(this.videoElementProvider.isVideoReady()){var a=this.videoElementProvider.getVideoParentElement().getBoundingClientRect(),i=this.toStreamerMessagesProvider.toStreamerHandlers;for(let e=0;e<n.length;e++){var r=n[e],o=r.clientX-a.left,s=r.clientY-a.top,c=(g.Log(g.GetStackTrace(),`F${this.fingerIds.get(r.identifier)}=(${o}, ${s})`,6),this.coordinateConverter.normalizeAndQuantizeUnsigned(o,s));switch(t){case"TouchStart":i.get("TouchStart")([1,c.x,c.y,this.fingerIds.get(r.identifier),this.maxByteValue*r.force,c.inRange?1:0]);break;case"TouchEnd":i.get("TouchEnd")([1,c.x,c.y,this.fingerIds.get(r.identifier),this.maxByteValue*r.force,c.inRange?1:0]);break;case"TouchMove":i.get("TouchMove")([1,c.x,c.y,this.fingerIds.get(r.identifier),this.maxByteValue*r.force,c.inRange?1:0])}}}}}class $t{constructor(e){this.gamePadEventListenerTracker=new E,this.toStreamerMessagesProvider=e,this.requestAnimationFrame=(window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.requestAnimationFrame).bind(window);const t=window;if("GamepadEvent"in t){const e=e=>this.gamePadConnectHandler(e),t=e=>this.gamePadDisconnectHandler(e);window.addEventListener("gamepadconnected",e),window.addEventListener("gamepaddisconnected",t),this.gamePadEventListenerTracker.addUnregisterCallback(()=>window.removeEventListener("gamepadconnected",e)),this.gamePadEventListenerTracker.addUnregisterCallback(()=>window.removeEventListener("gamepaddisconnected",t))}else if("WebKitGamepadEvent"in t){const e=e=>this.gamePadConnectHandler(e),t=e=>this.gamePadDisconnectHandler(e);window.addEventListener("webkitgamepadconnected",e),window.addEventListener("webkitgamepaddisconnected",t),this.gamePadEventListenerTracker.addUnregisterCallback(()=>window.removeEventListener("webkitgamepadconnected",e)),this.gamePadEventListenerTracker.addUnregisterCallback(()=>window.removeEventListener("webkitgamepaddisconnected",t))}if(this.controllers=[],navigator.getGamepads)for(const e of navigator.getGamepads())e&&this.gamePadConnectHandler(new GamepadEvent("gamepadconnected",{gamepad:e}))}unregisterGamePadEvents(){this.gamePadEventListenerTracker.unregisterAll();for(const e of this.controllers)void 0!==e.id&&this.onGamepadDisconnected(e.id);this.controllers=[],this.onGamepadConnected=()=>{},this.onGamepadDisconnected=()=>{}}gamePadConnectHandler(e){g.Log(g.GetStackTrace(),"Gamepad connect handler",6);e=e.gamepad;this.controllers.push({currentState:e,prevState:e,id:void 0}),this.controllers[e.index].currentState=e,this.controllers[e.index].prevState=e,g.Log(g.GetStackTrace(),"gamepad: "+e.id+" connected",6),window.requestAnimationFrame(()=>this.updateStatus()),this.onGamepadConnected()}gamePadDisconnectHandler(e){g.Log(g.GetStackTrace(),"Gamepad disconnect handler",6),g.Log(g.GetStackTrace(),"gamepad: "+e.gamepad.id+" disconnected",6);var t=this.controllers[e.gamepad.index];delete this.controllers[e.gamepad.index],this.controllers=this.controllers.filter(e=>void 0!==e),this.onGamepadDisconnected(t.id)}scanGamePads(){var t=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads():[];for(let e=0;e<t.length;e++)t[e]&&t[e].index in this.controllers&&(this.controllers[t[e].index].currentState=t[e])}updateStatus(){this.scanGamePads();var t=this.toStreamerMessagesProvider.toStreamerHandlers;for(const c of this.controllers){var n=void 0===c.id?this.controllers.indexOf(c):c.id,a=c.currentState;for(let e=0;e<c.currentState.buttons.length;e++){var i=c.currentState.buttons[e],r=c.prevState.buttons[e];i.pressed?e==l.LeftTrigger?t.get("GamepadAnalog")([n,5,i.value]):e==l.RightTrigger?t.get("GamepadAnalog")([n,6,i.value]):t.get("GamepadButtonPressed")([n,e,r.pressed?1:0]):!i.pressed&&r.pressed&&(e==l.LeftTrigger?t.get("GamepadAnalog")([n,5,0]):e==l.RightTrigger?t.get("GamepadAnalog")([n,6,0]):t.get("GamepadButtonReleased")([n,e]))}for(let e=0;e<a.axes.length;e+=2){var o=parseFloat(a.axes[e].toFixed(4)),s=-parseFloat(a.axes[e+1].toFixed(4));t.get("GamepadAnalog")([n,e+1,o]),t.get("GamepadAnalog")([n,e+2,s])}this.controllers[n].prevState=a}0<this.controllers.length&&this.requestAnimationFrame(()=>this.updateStatus())}onGamepadResponseReceived(e){for(const t of this.controllers)if(void 0===t.id){t.id=e;break}}onGamepadConnected(){}onGamepadDisconnected(e){}}(m=l=l||{})[m.RightClusterBottomButton=0]="RightClusterBottomButton",m[m.RightClusterRightButton=1]="RightClusterRightButton",m[m.RightClusterLeftButton=2]="RightClusterLeftButton",m[m.RightClusterTopButton=3]="RightClusterTopButton",m[m.LeftShoulder=4]="LeftShoulder",m[m.RightShoulder=5]="RightShoulder",m[m.LeftTrigger=6]="LeftTrigger",m[m.RightTrigger=7]="RightTrigger",m[m.SelectOrBack=8]="SelectOrBack",m[m.StartOrForward=9]="StartOrForward",m[m.LeftAnalogPress=10]="LeftAnalogPress",m[m.RightAnalogPress=11]="RightAnalogPress",m[m.LeftClusterTopButton=12]="LeftClusterTopButton",m[m.LeftClusterBottomButton=13]="LeftClusterBottomButton",m[m.LeftClusterLeftButton=14]="LeftClusterLeftButton",m[m.LeftClusterRightButton=15]="LeftClusterRightButton",m[m.CentreButton=16]="CentreButton",m[m.LeftStickHorizontal=0]="LeftStickHorizontal",m[m.LeftStickVertical=1]="LeftStickVertical",m[m.RightStickHorizontal=2]="RightStickHorizontal",m[m.RightStickVertical=3]="RightStickVertical";class Zt{constructor(e,t,n){this.activeKeys=new en,this.toStreamerMessagesProvider=e,this.videoElementProvider=t,this.coordinateConverter=n}registerKeyBoard(e){g.Log(g.GetStackTrace(),"Register Keyboard Events",7);e=new Kt(this.toStreamerMessagesProvider,e,this.activeKeys);return e.registerKeyBoardEvents(),e}registerMouse(e){g.Log(g.GetStackTrace(),"Register Mouse Events",7);var t=new Xt(this.toStreamerMessagesProvider,this.videoElementProvider,this.coordinateConverter,this.activeKeys);switch(e){case s.LockedMouse:t.registerLockedMouseEvents(t);break;case s.HoveringMouse:t.registerHoveringMouseEvents(t);break;default:g.Info(g.GetStackTrace(),"unknown Control Scheme Type Defaulting to Locked Mouse Events"),t.registerLockedMouseEvents(t)}return t}registerTouch(e,t){if(g.Log(g.GetStackTrace(),"Registering Touch",6),e){const g=new jt(this.toStreamerMessagesProvider,this.videoElementProvider,this.coordinateConverter);return g.setVideoElementParentClientRect(t),g}return new Jt(this.toStreamerMessagesProvider,this.videoElementProvider,this.coordinateConverter)}registerGamePad(){return g.Log(g.GetStackTrace(),"Register Game Pad",7),new $t(this.toStreamerMessagesProvider)}}class en{constructor(){this.activeKeys=[],this.activeKeys=[]}getActiveKeys(){return this.activeKeys}}class tn{constructor(e,t){this.lastTimeResized=(new Date).getTime(),this.videoElement=document.createElement("video"),this.config=t,this.videoElement.id="streamingVideo",this.videoElement.disablePictureInPicture=!0,this.videoElement.playsInline=!0,this.videoElement.style.width="100%",this.videoElement.style.height="100%",this.videoElement.style.position="absolute",this.client_size_factor=1,this.videoElement.style.pointerEvents="all",e.appendChild(this.videoElement),this.onResizePlayerCallback=()=>{console.log("Resolution changed, restyling player, did you forget to override this function?")},this.onMatchViewportResolutionCallback=()=>{console.log("Resolution changed and match viewport resolution is turned on, did you forget to override this function?")},this.videoElement.onclick=()=>{null!=this.audioElement&&this.audioElement.paused&&this.audioElement.play(),this.videoElement.paused&&this.videoElement.play()},this.videoElement.onloadedmetadata=()=>{this.onVideoInitialized()},window.addEventListener("resize",()=>this.resizePlayerStyle(),!0),window.addEventListener("orientationchange",()=>this.onOrientationChange())}setAudioElement(e){this.audioElement=e}play(){return this.videoElement.muted=this.config.isFlagEnabled(P.StartVideoMuted),this.videoElement.autoplay=this.config.isFlagEnabled(P.AutoPlayVideo),this.videoElement.play()}isPaused(){return this.videoElement.paused}isVideoReady(){return void 0!==this.videoElement.readyState&&0<this.videoElement.readyState}hasVideoSource(){return void 0!==this.videoElement.srcObject&&null!==this.videoElement.srcObject}getVideoElement(){return this.videoElement}getVideoParentElement(){return this.videoElement.parentElement}setVideoEnabled(t){this.videoElement.srcObject.getTracks().forEach(e=>e.enabled=t)}onVideoInitialized(){}onOrientationChange(){clearTimeout(this.orientationChangeTimeout),this.orientationChangeTimeout=window.setTimeout(()=>{this.resizePlayerStyle()},500)}resizePlayerStyle(){var e=this.getVideoParentElement();e&&(this.updateVideoStreamSize(),e.classList.contains("fixed-size")||this.resizePlayerStyleToFillParentElement(),this.onResizePlayerCallback())}resizePlayerStyleToFillParentElement(){this.getVideoParentElement().setAttribute("style","top: 0px; left: 0px; width: 100%; height: 100%; cursor: default;")}updateVideoStreamSize(){if(this.config.isFlagEnabled(P.MatchViewportResolution))if(300<(new Date).getTime()-this.lastTimeResized){const g=this.getVideoParentElement();var e,t;g&&(e=this.client_size_factor*g.clientWidth,t=this.client_size_factor*g.clientHeight,this.onMatchViewportResolutionCallback(e,t),this.lastTimeResized=(new Date).getTime())}else g.Log(g.GetStackTrace(),"Resizing too often - skipping",6),clearTimeout(this.resizeTimeoutHandle),this.resizeTimeoutHandle=window.setTimeout(()=>this.updateVideoStreamSize(),100)}}class nn{constructor(){this.toStreamerHandlers=new Map,this.fromStreamerHandlers=new Map,this.toStreamerMessages=new Map,this.fromStreamerMessages=new Map}populateDefaultProtocol(){this.toStreamerMessages.set("IFrameRequest",{id:0,structure:[]}),this.toStreamerMessages.set("RequestQualityControl",{id:1,structure:[]}),this.toStreamerMessages.set("FpsRequest",{id:2,structure:[]}),this.toStreamerMessages.set("AverageBitrateRequest",{id:3,structure:[]}),this.toStreamerMessages.set("StartStreaming",{id:4,structure:[]}),this.toStreamerMessages.set("StopStreaming",{id:5,structure:[]}),this.toStreamerMessages.set("LatencyTest",{id:6,structure:["string"]}),this.toStreamerMessages.set("RequestInitialSettings",{id:7,structure:[]}),this.toStreamerMessages.set("TestEcho",{id:8,structure:[]}),this.toStreamerMessages.set("DataChannelLatencyTest",{id:9,structure:[]}),this.toStreamerMessages.set("UIInteraction",{id:50,structure:["string"]}),this.toStreamerMessages.set("Command",{id:51,structure:["string"]}),this.toStreamerMessages.set("KeyDown",{id:60,structure:["uint8","uint8"]}),this.toStreamerMessages.set("KeyUp",{id:61,structure:["uint8"]}),this.toStreamerMessages.set("KeyPress",{id:62,structure:["uint16"]}),this.toStreamerMessages.set("MouseEnter",{id:70,structure:[]}),this.toStreamerMessages.set("MouseLeave",{id:71,structure:[]}),this.toStreamerMessages.set("MouseDown",{id:72,structure:["uint8","uint16","uint16"]}),this.toStreamerMessages.set("MouseUp",{id:73,structure:["uint8","uint16","uint16"]}),this.toStreamerMessages.set("MouseMove",{id:74,structure:["uint16","uint16","int16","int16"]}),this.toStreamerMessages.set("MouseWheel",{id:75,structure:["int16","uint16","uint16"]}),this.toStreamerMessages.set("MouseDouble",{id:76,structure:["uint8","uint16","uint16"]}),this.toStreamerMessages.set("TouchStart",{id:80,structure:["uint8","uint16","uint16","uint8","uint8","uint8"]}),this.toStreamerMessages.set("TouchEnd",{id:81,structure:["uint8","uint16","uint16","uint8","uint8","uint8"]}),this.toStreamerMessages.set("TouchMove",{id:82,structure:["uint8","uint16","uint16","uint8","uint8","uint8"]}),this.toStreamerMessages.set("GamepadConnected",{id:93,structure:[]}),this.toStreamerMessages.set("GamepadButtonPressed",{id:90,structure:["uint8","uint8","uint8"]}),this.toStreamerMessages.set("GamepadButtonReleased",{id:91,structure:["uint8","uint8","uint8"]}),this.toStreamerMessages.set("GamepadAnalog",{id:92,structure:["uint8","uint8","double"]}),this.toStreamerMessages.set("GamepadDisconnected",{id:94,structure:["uint8"]}),this.fromStreamerMessages.set(0,"QualityControlOwnership"),this.fromStreamerMessages.set(1,"Response"),this.fromStreamerMessages.set(2,"Command"),this.fromStreamerMessages.set(3,"FreezeFrame"),this.fromStreamerMessages.set(4,"UnfreezeFrame"),this.fromStreamerMessages.set(5,"VideoEncoderAvgQP"),this.fromStreamerMessages.set(6,"LatencyTest"),this.fromStreamerMessages.set(7,"InitialSettings"),this.fromStreamerMessages.set(8,"FileExtension"),this.fromStreamerMessages.set(9,"FileMimeType"),this.fromStreamerMessages.set(10,"FileContents"),this.fromStreamerMessages.set(11,"TestEcho"),this.fromStreamerMessages.set(12,"InputControlOwnership"),this.fromStreamerMessages.set(13,"GamepadResponse"),this.fromStreamerMessages.set(14,"DataChannelLatencyTest"),this.fromStreamerMessages.set(255,"Protocol")}registerMessageHandler(e,t,n){switch(e){case c.ToStreamer:this.toStreamerHandlers.set(t,n);break;case c.FromStreamer:this.fromStreamerHandlers.set(t,n);break;default:g.Log(g.GetStackTrace(),"Unknown message direction "+e)}}}(m=c=c||{})[m.ToStreamer=0]="ToStreamer",m[m.FromStreamer=1]="FromStreamer";class an{constructor(){this.responseEventListeners=new Map}addResponseEventListener(e,t){this.responseEventListeners.set(e,t)}removeResponseEventListener(e){this.responseEventListeners.delete(e)}onResponse(e){g.Log(g.GetStackTrace(),"DataChannelReceiveMessageType.Response",6);const t=new TextDecoder("utf-16").decode(e.slice(1));g.Log(g.GetStackTrace(),t,6),this.responseEventListeners.forEach(e=>{e(t)})}}class rn{constructor(e,t){this.dataChannelSender=e,this.toStreamerMessagesMapProvider=t}sendMessageToStreamer(e,t){void 0===t&&(t=[]);const i=this.toStreamerMessagesMapProvider.toStreamerMessages.get(e);if(void 0===i)g.Error(g.GetStackTrace(),`Attempted to send a message to the streamer with message type: ${e}, but the frontend hasn't been configured to send such a message. Check you've added the message type in your cpp`);else if(i.structure&&t&&i.structure.length!==t.length)g.Error(g.GetStackTrace(),`Provided message data doesn't match expected layout. Expected [ ${i.structure.map(e=>{switch(e){case"uint8":case"uint16":case"int16":case"float":case"double":return"number";case"string":return"string"}}).toString()} ] but received [ ${t.map(e=>typeof e).toString()} ]`);else{let n=0;const r=new TextEncoder,o=(t.forEach((e,t)=>{if(null!=i.structure&&0<i.structure.length)switch(i.structure[t]){case"uint8":n+=1;break;case"uint16":case"int16":n+=2;break;case"float":n+=4;break;case"double":n+=8;break;case"string":n=(n+=2)+2*r.encode(e).length}}),new DataView(new ArrayBuffer(n+1)));o.setUint8(0,i.id);let a=1;t.forEach((t,e)=>{if(null!=i.structure&&0<i.structure.length)switch(i.structure[e]){case"uint8":o.setUint8(a,t),a+=1;break;case"uint16":o.setUint16(a,t,!0),a+=2;break;case"int16":o.setInt16(a,t,!0),a+=2;break;case"float":o.setFloat32(a,t,!0),a+=4;break;case"double":o.setFloat64(a,t,!0),a+=8;break;case"string":o.setUint16(a,t.length,!0),a+=2;for(let e=0;e<t.length;e++)o.setUint16(a,t.charCodeAt(e),!0),a+=2}}),this.dataChannelSender.canSend()?this.dataChannelSender.sendData(o.buffer):g.Info(g.GetStackTrace(),`Data channel cannot send yet, skipping sending message: ${e} - `+new Uint8Array(o.buffer))}}}class on{constructor(e){this.sendMessageController=e}SendRequestQualityControl(){this.sendMessageController.sendMessageToStreamer("RequestQualityControl")}SendMaxFpsRequest(){this.sendMessageController.sendMessageToStreamer("FpsRequest")}SendAverageBitrateRequest(){this.sendMessageController.sendMessageToStreamer("AverageBitrateRequest")}SendStartStreaming(){this.sendMessageController.sendMessageToStreamer("StartStreaming")}SendStopStreaming(){this.sendMessageController.sendMessageToStreamer("StopStreaming")}SendRequestInitialSettings(){this.sendMessageController.sendMessageToStreamer("RequestInitialSettings")}}class sn{constructor(e){this.dataChannelProvider=e}canSend(){return void 0!==this.dataChannelProvider.getDataChannelInstance().dataChannel&&"open"==this.dataChannelProvider.getDataChannelInstance().dataChannel.readyState}sendData(e){var t=this.dataChannelProvider.getDataChannelInstance();"open"==t.dataChannel.readyState?(t.dataChannel.send(e),g.Log(g.GetStackTrace(),"Message Sent: "+new Uint8Array(e),6),this.resetAfkWarningTimerOnDataSend()):g.Error(g.GetStackTrace(),"Message Failed: "+new Uint8Array(e))}resetAfkWarningTimerOnDataSend(){}}class cn{constructor(e){this.videoElementProvider=e,this.normalizeAndQuantizeUnsignedFunc=()=>{throw new Error("Normalize and quantize unsigned, method not implemented.")},this.normalizeAndQuantizeSignedFunc=()=>{throw new Error("Normalize and unquantize signed, method not implemented.")},this.denormalizeAndUnquantizeUnsignedFunc=()=>{throw new Error("Denormalize and unquantize unsigned, method not implemented.")}}normalizeAndQuantizeUnsigned(e,t){return this.normalizeAndQuantizeUnsignedFunc(e,t)}unquantizeAndDenormalizeUnsigned(e,t){return this.denormalizeAndUnquantizeUnsignedFunc(e,t)}normalizeAndQuantizeSigned(e,t){return this.normalizeAndQuantizeSignedFunc(e,t)}setupNormalizeAndQuantize(){var e,t;this.videoElementParent=this.videoElementProvider.getVideoParentElement(),this.videoElement=this.videoElementProvider.getVideoElement(),this.videoElementParent&&this.videoElement&&(e=this.videoElementParent.clientHeight/this.videoElementParent.clientWidth,(t=this.videoElement.videoHeight/this.videoElement.videoWidth)<e?(g.Log(g.GetStackTrace(),"Setup Normalize and Quantize for playerAspectRatio > videoAspectRatio",6),this.ratio=e/t,this.normalizeAndQuantizeUnsignedFunc=(e,t)=>this.normalizeAndQuantizeUnsignedPlayerBigger(e,t),this.normalizeAndQuantizeSignedFunc=(e,t)=>this.normalizeAndQuantizeSignedPlayerBigger(e,t),this.denormalizeAndUnquantizeUnsignedFunc=(e,t)=>this.denormalizeAndUnquantizeUnsignedPlayerBigger(e,t)):(g.Log(g.GetStackTrace(),"Setup Normalize and Quantize for playerAspectRatio <= videoAspectRatio",6),this.ratio=t/e,this.normalizeAndQuantizeUnsignedFunc=(e,t)=>this.normalizeAndQuantizeUnsignedPlayerSmaller(e,t),this.normalizeAndQuantizeSignedFunc=(e,t)=>this.normalizeAndQuantizeSignedPlayerSmaller(e,t),this.denormalizeAndUnquantizeUnsignedFunc=(e,t)=>this.denormalizeAndUnquantizeUnsignedPlayerSmaller(e,t)))}normalizeAndQuantizeUnsignedPlayerBigger(e,t){e/=this.videoElementParent.clientWidth,t=this.ratio*(t/this.videoElementParent.clientHeight-.5)+.5;return e<0||1<e||t<0||1<t?new M(!1,65535,65535):new M(!0,65536*e,65536*t)}denormalizeAndUnquantizeUnsignedPlayerBigger(e,t){e/=65536,t=(t/65536-.5)/this.ratio+.5;return new k(e*this.videoElementParent.clientWidth,t*this.videoElementParent.clientHeight)}normalizeAndQuantizeSignedPlayerBigger(e,t){e/=.5*this.videoElementParent.clientWidth,t=this.ratio*t/(.5*this.videoElementParent.clientHeight);return new ln(32767*e,32767*t)}normalizeAndQuantizeUnsignedPlayerSmaller(e,t){e=this.ratio*(e/this.videoElementParent.clientWidth-.5)+.5,t/=this.videoElementParent.clientHeight;return e<0||1<e||t<0||1<t?new M(!1,65535,65535):new M(!0,65536*e,65536*t)}denormalizeAndUnquantizeUnsignedPlayerSmaller(e,t){e=(e/65536-.5)/this.ratio+.5,t/=65536;return new k(e*this.videoElementParent.clientWidth,t*this.videoElementParent.clientHeight)}normalizeAndQuantizeSignedPlayerSmaller(e,t){e=this.ratio*e/(.5*this.videoElementParent.clientWidth),t/=.5*this.videoElementParent.clientHeight;return new ln(32767*e,32767*t)}}class M{constructor(e,t,n){this.inRange=e,this.x=t,this.y=n}}class k{constructor(e,t){this.x=e,this.y=t}}class ln{constructor(e,t){this.x=e,this.y=t}}class mn{constructor(e,t){this.shouldShowPlayOverlay=!0,this.autoJoinTimer=void 0,this.config=e,this.pixelStreaming=t,this.responseController=new an,this.file=new Nt,this.sdpConstraints={offerToReceiveAudio:!0,offerToReceiveVideo:!0},this.afkController=new bt(this.config,this.pixelStreaming,this.onAfkTriggered.bind(this)),this.afkController.onAFKTimedOutCallback=()=>{this.closeSignalingServer("You have been disconnected due to inactivity")},this.freezeFrameController=new je(this.pixelStreaming.videoElementParent),this.videoPlayer=new tn(this.pixelStreaming.videoElementParent,this.config),this.videoPlayer.onVideoInitialized=()=>this.handleVideoInitialized(),this.videoPlayer.onMatchViewportResolutionCallback=(e,t)=>{e={"Resolution.Width":e,"Resolution.Height":t};this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify(e)])},this.videoPlayer.onResizePlayerCallback=()=>{this.setUpMouseAndFreezeFrame()},this.streamController=new ze(this.videoPlayer),this.coordinateConverter=new cn(this.videoPlayer),this.sendrecvDataChannelController=new Ft,this.recvDataChannelController=new Ft,this.registerDataChannelEventEmitters(this.sendrecvDataChannelController),this.registerDataChannelEventEmitters(this.recvDataChannelController),this.dataChannelSender=new sn(this.sendrecvDataChannelController),this.dataChannelSender.resetAfkWarningTimerOnDataSend=()=>this.afkController.resetAfkWarningTimer(),this.streamMessageController=new nn,this.webSocketController=new He,this.webSocketController.onConfig=e=>this.handleOnConfigMessage(e),this.webSocketController.onStreamerList=e=>this.handleStreamerListMessage(e),this.webSocketController.onPlayerCount=e=>{this.pixelStreaming._onPlayerCount(e.count)},this.webSocketController.onOpen.addEventListener("open",()=>{this.config.isFlagEnabled(P.BrowserSendOffer)||this.webSocketController.requestStreamerList()}),this.webSocketController.onClose.addEventListener("close",e=>{var t=this.shouldReconnect&&1001!=e.detail.code&&0<this.config.getNumericSettingValue(D.MaxReconnectAttempts),n=this.disconnectMessage||e.detail.reason;this.pixelStreaming._onDisconnect(n,!t&&!this.isReconnecting),this.afkController.stopAfkWarningTimer(),this.statsTimerHandle&&void 0!==this.statsTimerHandle&&window.clearInterval(this.statsTimerHandle),this.setVideoEncoderAvgQP(0),this.setTouchInputEnabled(!1),this.setMouseInputEnabled(!1),this.setKeyboardInputEnabled(!1),this.setGamePadInputEnabled(!1),t&&setTimeout(()=>{this.isReconnecting=!0,this.reconnectAttempt++,this.tryReconnect(e.detail.reason)},2e3)}),this.sendMessageController=new rn(this.dataChannelSender,this.streamMessageController),this.toStreamerMessagesController=new on(this.sendMessageController),this.registerMessageHandlers(),this.streamMessageController.populateDefaultProtocol(),this.inputClassesFactory=new Zt(this.streamMessageController,this.videoPlayer,this.coordinateConverter),this.isUsingSFU=!1,this.isQualityController=!1,this.preferredCodec="",this.shouldReconnect=!0,this.isReconnecting=!1,this.reconnectAttempt=0,this.config._addOnOptionSettingChangedListener(I.StreamerId,e=>{""!==e&&(this.peerConnectionController.peerConnection.close(),this.peerConnectionController.createPeerConnection(this.peerConfig,this.preferredCodec),this.subscribedStream=e,this.webSocketController.sendSubscribe(e))}),this.setVideoEncoderAvgQP(-1),this.signallingUrlBuilder=()=>{let e=this.config.getTextSettingValue(v.SignallingServerUrl);return this.config.isFlagEnabled(P.BrowserSendOffer)&&(e+="?"+P.BrowserSendOffer+"=true"),e}}requestUnquantizedAndDenormalizeUnsigned(e,t){return this.coordinateConverter.unquantizeAndDenormalizeUnsigned(e,t)}handleOnMessage(e){var t=new Uint8Array(e.data),t=(g.Log(g.GetStackTrace(),"Message incoming:"+t,6),this.streamMessageController.fromStreamerMessages.get(t[0]));this.streamMessageController.fromStreamerHandlers.get(t)(e.data)}registerMessageHandlers(){this.streamMessageController.registerMessageHandler(c.FromStreamer,"QualityControlOwnership",e=>this.onQualityControlOwnership(e)),this.streamMessageController.registerMessageHandler(c.FromStreamer,"Response",e=>this.responseController.onResponse(e)),this.streamMessageController.registerMessageHandler(c.FromStreamer,"Command",e=>{this.onCommand(e)}),this.streamMessageController.registerMessageHandler(c.FromStreamer,"FreezeFrame",e=>this.onFreezeFrameMessage(e)),this.streamMessageController.registerMessageHandler(c.FromStreamer,"UnfreezeFrame",()=>this.invalidateFreezeFrameAndEnableVideo()),this.streamMessageController.registerMessageHandler(c.FromStreamer,"VideoEncoderAvgQP",e=>this.handleVideoEncoderAvgQP(e)),this.streamMessageController.registerMessageHandler(c.FromStreamer,"LatencyTest",e=>this.handleLatencyTestResult(e)),this.streamMessageController.registerMessageHandler(c.FromStreamer,"DataChannelLatencyTest",e=>this.handleDataChannelLatencyTestResponse(e)),this.streamMessageController.registerMessageHandler(c.FromStreamer,"InitialSettings",e=>this.handleInitialSettings(e)),this.streamMessageController.registerMessageHandler(c.FromStreamer,"FileExtension",e=>this.onFileExtension(e)),this.streamMessageController.registerMessageHandler(c.FromStreamer,"FileMimeType",e=>this.onFileMimeType(e)),this.streamMessageController.registerMessageHandler(c.FromStreamer,"FileContents",e=>this.onFileContents(e)),this.streamMessageController.registerMessageHandler(c.FromStreamer,"TestEcho",()=>{}),this.streamMessageController.registerMessageHandler(c.FromStreamer,"InputControlOwnership",e=>this.onInputControlOwnership(e)),this.streamMessageController.registerMessageHandler(c.FromStreamer,"GamepadResponse",e=>this.onGamepadResponse(e)),this.streamMessageController.registerMessageHandler(c.FromStreamer,"Protocol",e=>this.onProtocolMessage(e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"IFrameRequest",()=>this.sendMessageController.sendMessageToStreamer("IFrameRequest")),this.streamMessageController.registerMessageHandler(c.ToStreamer,"RequestQualityControl",()=>this.sendMessageController.sendMessageToStreamer("RequestQualityControl")),this.streamMessageController.registerMessageHandler(c.ToStreamer,"FpsRequest",()=>this.sendMessageController.sendMessageToStreamer("FpsRequest")),this.streamMessageController.registerMessageHandler(c.ToStreamer,"AverageBitrateRequest",()=>this.sendMessageController.sendMessageToStreamer("AverageBitrateRequest")),this.streamMessageController.registerMessageHandler(c.ToStreamer,"StartStreaming",()=>this.sendMessageController.sendMessageToStreamer("StartStreaming")),this.streamMessageController.registerMessageHandler(c.ToStreamer,"StopStreaming",()=>this.sendMessageController.sendMessageToStreamer("StopStreaming")),this.streamMessageController.registerMessageHandler(c.ToStreamer,"LatencyTest",e=>this.sendMessageController.sendMessageToStreamer("LatencyTest",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"RequestInitialSettings",()=>this.sendMessageController.sendMessageToStreamer("RequestInitialSettings")),this.streamMessageController.registerMessageHandler(c.ToStreamer,"TestEcho",()=>{}),this.streamMessageController.registerMessageHandler(c.ToStreamer,"UIInteraction",e=>this.sendMessageController.sendMessageToStreamer("UIInteraction",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"Command",e=>this.sendMessageController.sendMessageToStreamer("Command",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"TextboxEntry",e=>this.sendMessageController.sendMessageToStreamer("TextboxEntry",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"KeyDown",e=>this.sendMessageController.sendMessageToStreamer("KeyDown",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"KeyUp",e=>this.sendMessageController.sendMessageToStreamer("KeyUp",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"KeyPress",e=>this.sendMessageController.sendMessageToStreamer("KeyPress",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"MouseEnter",e=>this.sendMessageController.sendMessageToStreamer("MouseEnter",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"MouseLeave",e=>this.sendMessageController.sendMessageToStreamer("MouseLeave",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"MouseDown",e=>this.sendMessageController.sendMessageToStreamer("MouseDown",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"MouseUp",e=>this.sendMessageController.sendMessageToStreamer("MouseUp",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"MouseMove",e=>this.sendMessageController.sendMessageToStreamer("MouseMove",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"MouseWheel",e=>this.sendMessageController.sendMessageToStreamer("MouseWheel",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"MouseDouble",e=>this.sendMessageController.sendMessageToStreamer("MouseDouble",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"TouchStart",e=>this.sendMessageController.sendMessageToStreamer("TouchStart",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"TouchEnd",e=>this.sendMessageController.sendMessageToStreamer("TouchEnd",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"TouchMove",e=>this.sendMessageController.sendMessageToStreamer("TouchMove",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"GamepadConnected",()=>this.sendMessageController.sendMessageToStreamer("GamepadConnected")),this.streamMessageController.registerMessageHandler(c.ToStreamer,"GamepadButtonPressed",e=>this.sendMessageController.sendMessageToStreamer("GamepadButtonPressed",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"GamepadButtonReleased",e=>this.sendMessageController.sendMessageToStreamer("GamepadButtonReleased",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"GamepadAnalog",e=>this.sendMessageController.sendMessageToStreamer("GamepadAnalog",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"GamepadDisconnected",e=>this.sendMessageController.sendMessageToStreamer("GamepadDisconnected",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"XRHMDTransform",e=>this.sendMessageController.sendMessageToStreamer("XRHMDTransform",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"XRControllerTransform",e=>this.sendMessageController.sendMessageToStreamer("XRControllerTransform",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"XRSystem",e=>this.sendMessageController.sendMessageToStreamer("XRSystem",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"XRButtonTouched",e=>this.sendMessageController.sendMessageToStreamer("XRButtonTouched",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"XRButtonPressed",e=>this.sendMessageController.sendMessageToStreamer("XRButtonPressed",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"XRButtonReleased",e=>this.sendMessageController.sendMessageToStreamer("XRButtonReleased",e)),this.streamMessageController.registerMessageHandler(c.ToStreamer,"XRAnalog",e=>this.sendMessageController.sendMessageToStreamer("XRAnalog",e))}onCommand(e){g.Log(g.GetStackTrace(),"DataChannelReceiveMessageType.Command",6);e=new TextDecoder("utf-16").decode(e.slice(1)),g.Log(g.GetStackTrace(),"Data Channel Command: "+e,6),e=JSON.parse(e);"onScreenKeyboard"===e.command&&this.pixelStreaming._activateOnScreenKeyboard(e)}onProtocolMessage(e){try{const t=new TextDecoder("utf-16").decode(e.slice(1)),n=JSON.parse(t),a=(Object.prototype.hasOwnProperty.call(n,"Direction")||g.Error(g.GetStackTrace(),"Malformed protocol received. Ensure the protocol message contains a direction"),n.Direction);delete n.Direction,g.Log(g.GetStackTrace(),`Received new ${a==c.FromStreamer?"FromStreamer":"ToStreamer"} protocol. Updating existing protocol...`),Object.keys(n).forEach(e=>{var t=n[e];switch(a){case c.ToStreamer:Object.prototype.hasOwnProperty.call(t,"id")?"UIInteraction"!==e&&"Command"!==e&&"LatencyTest"!==e&&(this.streamMessageController.toStreamerHandlers.get(e)?this.streamMessageController.toStreamerMessages.set(e,t):g.Error(g.GetStackTrace(),`There was no registered handler for "${e}" - try adding one using registerMessageHandler(MessageDirection.ToStreamer, "${e}", myHandler)`)):g.Error(g.GetStackTrace(),`ToStreamer->${e} protocol definition was malformed as it didn't contain at least an id
|
|
13
|
+
|
|
14
|
+
Definition was: `+JSON.stringify(t,null,2));break;case c.FromStreamer:Object.prototype.hasOwnProperty.call(t,"id")?this.streamMessageController.fromStreamerHandlers.get(e)?this.streamMessageController.fromStreamerMessages.set(t.id,e):g.Error(g.GetStackTrace(),`There was no registered handler for "${t}" - try adding one using registerMessageHandler(MessageDirection.FromStreamer, "${e}", myHandler)`):g.Error(g.GetStackTrace(),`FromStreamer->${e} protocol definition was malformed as it didn't contain at least an id
|
|
15
|
+
|
|
16
|
+
Definition was: `+JSON.stringify(t,null,2));break;default:g.Error(g.GetStackTrace(),"Unknown direction: "+a)}}),this.toStreamerMessagesController.SendRequestInitialSettings(),this.toStreamerMessagesController.SendRequestQualityControl()}catch(e){g.Log(g.GetStackTrace(),e)}}onInputControlOwnership(e){e=new Uint8Array(e),g.Log(g.GetStackTrace(),"DataChannelReceiveMessageType.InputControlOwnership",6),e=new Boolean(e[1]).valueOf();g.Log(g.GetStackTrace(),"Received input controller message - will your input control the stream: "+e),this.pixelStreaming._onInputControlOwnership(e)}onGamepadResponse(e){e=new TextDecoder("utf-16").decode(e.slice(1)),e=JSON.parse(e);this.gamePadController.onGamepadResponseReceived(e.controllerId)}onAfkTriggered(){this.afkController.onAfkClick(),this.videoPlayer.isPaused()&&this.videoPlayer.hasVideoSource()&&this.playStream()}setAfkEnabled(e){e?this.onAfkTriggered():this.afkController.stopAfkWarningTimer()}tryReconnect(e){this.webSocketController?(this.isReconnecting=!0,this.webSocketController.webSocket&&this.webSocketController.webSocket.readyState!=WebSocket.CLOSED?(this.closeSignalingServer(e+" Restarting stream..."),setTimeout(()=>{this.tryReconnect(e)},3e3)):(this.pixelStreaming._onWebRtcAutoConnect(),this.connectToSignallingServer())):g.Log(g.GetStackTrace(),"The Web Socket Controller does not exist so this will not work right now.")}loadFreezeFrameOrShowPlayOverlay(){this.pixelStreaming.dispatchEvent(new gt({shouldShowPlayOverlay:this.shouldShowPlayOverlay,isValid:this.freezeFrameController.valid,jpegData:this.freezeFrameController.jpeg})),!0===this.shouldShowPlayOverlay?(g.Log(g.GetStackTrace(),"showing play overlay"),this.resizePlayerStyle()):(g.Log(g.GetStackTrace(),"showing freeze frame"),this.freezeFrameController.showFreezeFrame()),setTimeout(()=>{this.videoPlayer.setVideoEnabled(!1)},this.freezeFrameController.freezeFrameDelay)}onFreezeFrameMessage(e){g.Log(g.GetStackTrace(),"DataChannelReceiveMessageType.FreezeFrame",6);e=new Uint8Array(e);this.freezeFrameController.processFreezeFrameMessage(e,()=>this.loadFreezeFrameOrShowPlayOverlay())}invalidateFreezeFrameAndEnableVideo(){g.Log(g.GetStackTrace(),"DataChannelReceiveMessageType.FreezeFrame",6),setTimeout(()=>{this.pixelStreaming.dispatchEvent(new ht),this.freezeFrameController.hideFreezeFrame()},this.freezeFrameController.freezeFrameDelay),this.videoPlayer.getVideoElement()&&this.videoPlayer.setVideoEnabled(!0)}onFileExtension(e){e=new Uint8Array(e);F.setExtensionFromBytes(e,this.file)}onFileMimeType(e){e=new Uint8Array(e);F.setMimeTypeFromBytes(e,this.file)}onFileContents(e){e=new Uint8Array(e);F.setContentsFromBytes(e,this.file)}playStream(){var e;this.videoPlayer.getVideoElement()?this.videoPlayer.hasVideoSource()?(this.setTouchInputEnabled(this.config.isFlagEnabled(P.TouchInput)),this.pixelStreaming.dispatchEvent(new ut),!this.streamController.audioElement.srcObject||(e=this.config.isFlagEnabled(P.StartVideoMuted),this.streamController.audioElement.muted=e)?this.playVideo():this.streamController.audioElement.play().then(()=>{this.playVideo()}).catch(e=>{g.Log(g.GetStackTrace(),e),g.Log(g.GetStackTrace(),"Browser does not support autoplaying video without interaction - to resolve this we are going to show the play button overlay."),this.pixelStreaming.dispatchEvent(new w({reason:e}))}),this.shouldShowPlayOverlay=!1,this.freezeFrameController.showFreezeFrame()):g.Warning(g.GetStackTrace(),"Cannot play stream, the video element has no srcObject to play."):(e="Could not play video stream because the video player was not initialized correctly.",this.pixelStreaming.dispatchEvent(new dt({message:e})),g.Error(g.GetStackTrace(),e),this.closeSignalingServer("Stream not initialized correctly"))}playVideo(){this.videoPlayer.play().catch(e=>{this.streamController.audioElement.srcObject&&this.streamController.audioElement.pause(),g.Log(g.GetStackTrace(),e),g.Log(g.GetStackTrace(),"Browser does not support autoplaying video without interaction - to resolve this we are going to show the play button overlay."),this.pixelStreaming.dispatchEvent(new w({reason:e}))})}autoPlayVideoOrSetUpPlayOverlay(){this.config.isFlagEnabled(P.AutoPlayVideo)&&this.playStream(),this.resizePlayerStyle()}connectToSignallingServer(){this.locallyClosed=!1,this.shouldReconnect=!0,this.disconnectMessage=null;var e=this.signallingUrlBuilder();this.webSocketController.connect(e)}startSession(e){if(this.peerConfig=e,this.config.isFlagEnabled(P.ForceTURN)&&!this.checkTurnServerAvailability(e))g.Info(g.GetStackTrace(),"No turn server was found in the Peer Connection Options. TURN cannot be forced, closing connection. Please use STUN instead"),this.closeSignalingServer("TURN cannot be forced, closing connection. Please use STUN instead.");else{this.peerConnectionController=new Gt(this.peerConfig,this.config,this.preferredCodec),this.peerConnectionController.onVideoStats=e=>this.handleVideoStats(e),this.peerConnectionController.onSendWebRTCOffer=e=>this.handleSendWebRTCOffer(e),this.peerConnectionController.onSendWebRTCAnswer=e=>this.handleSendWebRTCAnswer(e),this.peerConnectionController.onPeerIceCandidate=e=>this.handleSendIceCandidate(e),this.peerConnectionController.onDataChannel=e=>this.handleDataChannel(e),this.peerConnectionController.showTextOverlayConnecting=()=>this.pixelStreaming._onWebRtcConnecting();let e=!(this.peerConnectionController.showTextOverlaySetupFailure=()=>this.pixelStreaming._onWebRtcFailed());this.peerConnectionController.onIceConnectionStateChange=()=>{!e&&["connected","completed"].includes(this.peerConnectionController.peerConnection.iceConnectionState)&&(this.pixelStreaming._onWebRtcConnected(),e=!0)},this.peerConnectionController.onTrack=e=>this.streamController.handleOnTrack(e),this.config.isFlagEnabled(P.BrowserSendOffer)&&(this.sendrecvDataChannelController.createDataChannel(this.peerConnectionController.peerConnection,"cirrus",this.datachannelOptions),this.sendrecvDataChannelController.handleOnMessage=e=>this.handleOnMessage(e),this.peerConnectionController.createOffer(this.sdpConstraints,this.config))}}checkTurnServerAvailability(e){if(e.iceServers)for(const t of e.iceServers)for(const e of t.urls)if(e.includes("turn"))return g.Log(g.GetStackTrace(),"A turn sever was found at "+e),!0;return g.Info(g.GetStackTrace(),"A turn sever was not found"),!1}handleOnConfigMessage(e){this.resizePlayerStyle(),this.startSession(e.peerConnectionOptions),this.webSocketController.onWebRtcAnswer=e=>this.handleWebRtcAnswer(e),this.webSocketController.onWebRtcOffer=e=>this.handleWebRtcOffer(e),this.webSocketController.onWebRtcPeerDataChannels=e=>this.handleWebRtcSFUPeerDatachannels(e),this.webSocketController.onIceCandidate=e=>this.handleIceCandidate(e)}handleStreamerListMessage(e){g.Log(g.GetStackTrace(),"Got streamer list "+e.ids,6);var t=[...e.ids];t.unshift(""),this.config.setOptionSettingOptions(I.StreamerId,t);let n=null,a=null;var t=this.config.isFlagEnabled(P.WaitForStreamer),i=this.config.getNumericSettingValue(D.MaxReconnectAttempts),r=this.config.getNumericSettingValue(D.StreamerAutoJoinInterval),o=new URLSearchParams(window.location.search);o.has(I.StreamerId)?n=o.get(I.StreamerId):this.subscribedStream&&(n=this.subscribedStream),n&&e.ids.includes(n)?a=n:n&&t&&"__LEGACY__"!=n||1!=e.ids.length||(a=e.ids[0]),a?(this.isReconnecting=!1,this.reconnectAttempt=0,this.config.setOptionSettingValue(I.StreamerId,a)):t&&(this.reconnectAttempt<i?(this.isReconnecting=!0,this.reconnectAttempt++,setTimeout(()=>{this.webSocketController.requestStreamerList()},r)):(this.reconnectAttempt=0,this.isReconnecting=!1,this.shouldReconnect=!1)),this.pixelStreaming.dispatchEvent(new pt({messageStreamerList:e,autoSelectedStreamerId:a,wantedStreamerId:n}))}handleWebRtcAnswer(e){g.Log(g.GetStackTrace(),"Got answer sdp "+e.sdp,6);e={sdp:e.sdp,type:"answer"};this.peerConnectionController.receiveAnswer(e),this.handlePostWebrtcNegotiation()}handleWebRtcOffer(e){g.Log(g.GetStackTrace(),"Got offer sdp "+e.sdp,6),this.isUsingSFU=!!e.sfu&&e.sfu,this.isUsingSFU&&(this.peerConnectionController.preferredCodec="");e={sdp:e.sdp,type:"offer"};this.peerConnectionController.receiveOffer(e,this.config),this.handlePostWebrtcNegotiation()}handleWebRtcSFUPeerDatachannels(e){const t={ordered:!0,negotiated:!0,id:e.sendStreamId},n=e.sendStreamId!=e.recvStreamId;if(this.sendrecvDataChannelController.createDataChannel(this.peerConnectionController.peerConnection,n?"send-datachannel":"datachannel",t),n){const t={ordered:!0,negotiated:!0,id:e.recvStreamId};this.recvDataChannelController.createDataChannel(this.peerConnectionController.peerConnection,"recv-datachannel",t),this.recvDataChannelController.handleOnOpen=()=>this.webSocketController.sendSFURecvDataChannelReady(),this.recvDataChannelController.handleOnMessage=e=>this.handleOnMessage(e)}else this.sendrecvDataChannelController.handleOnMessage=e=>this.handleOnMessage(e)}handlePostWebrtcNegotiation(){this.afkController.startAfkWarningTimer(),this.pixelStreaming._onWebRtcSdp(),this.statsTimerHandle&&void 0!==this.statsTimerHandle&&window.clearInterval(this.statsTimerHandle),this.statsTimerHandle=window.setInterval(()=>this.getStats(),1e3),this.setMouseInputEnabled(this.config.isFlagEnabled(P.MouseInput)),this.setKeyboardInputEnabled(this.config.isFlagEnabled(P.KeyboardInput)),this.setGamePadInputEnabled(this.config.isFlagEnabled(P.GamepadInput))}handleIceCandidate(e){g.Log(g.GetStackTrace(),"Web RTC Controller: onWebRtcIce",6);e=new RTCIceCandidate(e);this.peerConnectionController.handleOnIce(e)}handleSendIceCandidate(e){g.Log(g.GetStackTrace(),"OnIceCandidate",6),e.candidate&&e.candidate.candidate&&this.webSocketController.sendIceCandidate(e.candidate)}handleDataChannel(e){g.Log(g.GetStackTrace(),"Data channel created for us by browser as we are a receiving peer.",6),this.sendrecvDataChannelController.dataChannel=e.channel,this.sendrecvDataChannelController.setupDataChannel(),this.sendrecvDataChannelController.handleOnMessage=e=>this.handleOnMessage(e)}handleSendWebRTCOffer(e){g.Log(g.GetStackTrace(),"Sending the offer to the Server",6),this.webSocketController.sendWebRtcOffer(e)}handleSendWebRTCAnswer(e){g.Log(g.GetStackTrace(),"Sending the answer to the Server",6),this.webSocketController.sendWebRtcAnswer(e),this.isUsingSFU&&this.webSocketController.sendWebRtcDatachannelRequest()}setUpMouseAndFreezeFrame(){this.videoElementParentClientRect=this.videoPlayer.getVideoParentElement().getBoundingClientRect(),this.coordinateConverter.setupNormalizeAndQuantize(),this.freezeFrameController.freezeFrame.resize()}closeSignalingServer(e){this.locallyClosed=!0,this.shouldReconnect=!1,this.disconnectMessage=e,null!=(e=this.webSocketController)&&e.close()}closePeerConnection(){var e;null!=(e=this.peerConnectionController)&&e.close()}close(){this.closeSignalingServer(""),this.closePeerConnection()}getStats(){this.peerConnectionController.generateStats()}sendLatencyTest(){this.latencyStartTime=Date.now(),this.streamMessageController.toStreamerHandlers.get("LatencyTest")([JSON.stringify({StartTime:this.latencyStartTime})])}sendDataChannelLatencyTest(e){this.streamMessageController.toStreamerHandlers.get("DataChannelLatencyTest")([JSON.stringify(e)])}sendEncoderMinQP(e){g.Log(g.GetStackTrace(),`MinQP=${e}
|
|
17
|
+
`,6),null!=e&&this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({"Encoder.MinQP":e})])}sendEncoderMaxQP(e){g.Log(g.GetStackTrace(),`MaxQP=${e}
|
|
18
|
+
`,6),null!=e&&this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({"Encoder.MaxQP":e})])}sendWebRTCMinBitrate(e){g.Log(g.GetStackTrace(),"WebRTC Min Bitrate="+e,6),null!=e&&this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({"WebRTC.MinBitrate":e})])}sendWebRTCMaxBitrate(e){g.Log(g.GetStackTrace(),"WebRTC Max Bitrate="+e,6),null!=e&&this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({"WebRTC.MaxBitrate":e})])}sendWebRTCFps(e){g.Log(g.GetStackTrace(),"WebRTC FPS="+e,6),null!=e&&(this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({"WebRTC.Fps":e})]),this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({"WebRTC.MaxFps":e})]))}sendShowFps(){g.Log(g.GetStackTrace(),"---- Sending show stat to UE ----",6),this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({"stat.fps":""})])}sendIframeRequest(){g.Log(g.GetStackTrace(),"---- Sending Request for an IFrame ----",6),this.streamMessageController.toStreamerHandlers.get("IFrameRequest")()}emitUIInteraction(e){g.Log(g.GetStackTrace(),"---- Sending custom UIInteraction message ----",6),this.streamMessageController.toStreamerHandlers.get("UIInteraction")([JSON.stringify(e)])}emitCommand(e){g.Log(g.GetStackTrace(),"---- Sending custom Command message ----",6),this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify(e)])}emitConsoleCommand(e){g.Log(g.GetStackTrace(),"---- Sending custom Command:ConsoleCommand message ----",6),this.streamMessageController.toStreamerHandlers.get("Command")([JSON.stringify({ConsoleCommand:e})])}sendRequestQualityControlOwnership(){g.Log(g.GetStackTrace(),"---- Sending Request to Control Quality ----",6),this.toStreamerMessagesController.SendRequestQualityControl()}handleLatencyTestResult(e){g.Log(g.GetStackTrace(),"DataChannelReceiveMessageType.latencyTest",6);var e=new TextDecoder("utf-16").decode(e.slice(1)),t=new zt;Object.assign(t,JSON.parse(e)),t.processFields(),t.testStartTimeMs=this.latencyStartTime,t.browserReceiptTimeMs=Date.now(),t.latencyExcludingDecode=~~(t.browserReceiptTimeMs-t.testStartTimeMs),t.testDuration=~~(t.TransmissionTimeMs-t.ReceiptTimeMs),t.networkLatency=~~(t.latencyExcludingDecode-t.testDuration),t.frameDisplayDeltaTimeMs&&t.browserReceiptTimeMs&&(t.endToEndLatency=(t.frameDisplayDeltaTimeMs,t.networkLatency,~~+t.CaptureToSendMs)),this.pixelStreaming._onLatencyTestResult(t)}handleDataChannelLatencyTestResponse(e){g.Log(g.GetStackTrace(),"DataChannelReceiveMessageType.dataChannelLatencyResponse",6);e=new TextDecoder("utf-16").decode(e.slice(1)),e=JSON.parse(e);this.pixelStreaming._onDataChannelLatencyTestResponse(e)}handleInitialSettings(e){g.Log(g.GetStackTrace(),"DataChannelReceiveMessageType.InitialSettings",6);var e=new TextDecoder("utf-16").decode(e.slice(1)),t=JSON.parse(e),n=new At;t.Encoder&&(n.EncoderSettings=t.Encoder),t.WebRTC&&(n.WebRTCSettings=t.WebRTC),t.PixelStreaming&&(n.PixelStreamingSettings=t.PixelStreaming),t.ConfigOptions&&void 0!==t.ConfigOptions.DefaultToHover&&this.config.setFlagEnabled(P.HoveringMouseMode,!!t.ConfigOptions.DefaultToHover),n.ueCompatible(),g.Log(g.GetStackTrace(),e,6),this.pixelStreaming._onInitialSettings(n)}handleVideoEncoderAvgQP(e){g.Log(g.GetStackTrace(),"DataChannelReceiveMessageType.VideoEncoderAvgQP",6);e=Number(new TextDecoder("utf-16").decode(e.slice(1)));this.setVideoEncoderAvgQP(e)}handleVideoInitialized(){this.pixelStreaming._onVideoInitialized(),this.autoPlayVideoOrSetUpPlayOverlay(),this.resizePlayerStyle(),this.videoPlayer.updateVideoStreamSize()}onQualityControlOwnership(e){e=new Uint8Array(e);g.Log(g.GetStackTrace(),"DataChannelReceiveMessageType.QualityControlOwnership",6),this.isQualityController=new Boolean(e[1]).valueOf(),g.Log(g.GetStackTrace(),"Received quality controller message, will control quality: "+this.isQualityController),this.pixelStreaming._onQualityControlOwnership(this.isQualityController)}handleVideoStats(e){this.pixelStreaming._onVideoStats(e)}resizePlayerStyle(){this.videoPlayer.resizePlayerStyle()}setPreferredCodec(e){this.preferredCodec=e,this.peerConnectionController&&(this.peerConnectionController.preferredCodec=e,this.peerConnectionController.updateCodecSelection=!1)}setVideoEncoderAvgQP(e){this.videoAvgQp=e,this.pixelStreaming._onVideoEncoderAvgQP(this.videoAvgQp)}setKeyboardInputEnabled(e){var t;null!=(t=this.keyboardController)&&t.unregisterKeyBoardEvents(),e&&(this.keyboardController=this.inputClassesFactory.registerKeyBoard(this.config))}setMouseInputEnabled(e){var t;if(null!=(t=this.mouseController)&&t.unregisterMouseEvents(),e){const e=this.config.isFlagEnabled(P.HoveringMouseMode)?s.HoveringMouse:s.LockedMouse;this.mouseController=this.inputClassesFactory.registerMouse(e)}}setTouchInputEnabled(e){var t;null!=(t=this.touchController)&&t.unregisterTouchEvents(),e&&(this.touchController=this.inputClassesFactory.registerTouch(this.config.isFlagEnabled(P.FakeMouseWithTouches),this.videoElementParentClientRect))}setGamePadInputEnabled(e){var t;null!=(t=this.gamePadController)&&t.unregisterGamePadEvents(),e&&(this.gamePadController=this.inputClassesFactory.registerGamePad(),this.gamePadController.onGamepadConnected=()=>{this.streamMessageController.toStreamerHandlers.get("GamepadConnected")()},this.gamePadController.onGamepadDisconnected=e=>{this.streamMessageController.toStreamerHandlers.get("GamepadDisconnected")([e])})}registerDataChannelEventEmitters(e){e.onOpen=(e,t)=>this.pixelStreaming.dispatchEvent(new at({label:e,event:t})),e.onClose=(e,t)=>this.pixelStreaming.dispatchEvent(new it({label:e,event:t})),e.onError=(e,t)=>this.pixelStreaming.dispatchEvent(new rt({label:e,event:t}))}registerMessageHandler(t,n,a){n===c.FromStreamer&&void 0===a&&g.Warning(g.GetStackTrace(),`Unable to register handler for ${t} as no handler was passed`),this.streamMessageController.registerMessageHandler(n,t,e=>void 0===a&&n===c.ToStreamer?this.sendMessageController.sendMessageToStreamer(t,e):a(e))}}class dn{static vertexShader(){return"\n\t\tattribute vec2 a_position;\n\t\tattribute vec2 a_texCoord;\n\n\t\t// input\n\t\tuniform vec2 u_resolution;\n\t\tuniform vec4 u_offset;\n\n\t\t//\n\t\tvarying vec2 v_texCoord;\n\n\t\tvoid main() {\n\t\t // convert the rectangle from pixels to 0.0 to 1.0\n\t\t vec2 zeroToOne = a_position / u_resolution;\n\n\t\t // convert from 0->1 to 0->2\n\t\t vec2 zeroToTwo = zeroToOne * 2.0;\n\n\t\t // convert from 0->2 to -1->+1 (clipspace)\n\t\t vec2 clipSpace = zeroToTwo - 1.0;\n\n\t\t gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);\n\t\t // pass the texCoord to the fragment shader\n\t\t // The GPU will interpolate this value between points.\n\t\t v_texCoord = (a_texCoord * u_offset.xy) + u_offset.zw;\n\t\t}\n\t\t"}static fragmentShader(){return"\n\t\tprecision mediump float;\n\n\t\t// our texture\n\t\tuniform sampler2D u_image;\n\n\t\t// the texCoords passed in from the vertex shader.\n\t\tvarying vec2 v_texCoord;\n\n\t\tvoid main() {\n\t\t gl_FragColor = texture2D(u_image, v_texCoord);\n\t\t}\n\t\t"}}class un{static deepCopyGamepad(e){return JSON.parse(JSON.stringify({buttons:e.buttons.map(e=>JSON.parse(JSON.stringify({pressed:e.pressed,touched:e.touched}))),axes:e.axes}))}}class gn{constructor(e){this.toStreamerMessagesProvider=e,this.controllers=[]}updateStatus(n,a,i){if(n.gamepad){a=a.getPose(n.gripSpace,i);if(a){let e=0,t=(n.profiles.includes("htc-vive")?e=1:n.profiles.includes("oculus-touch")&&(e=2),this.toStreamerMessagesProvider.toStreamerHandlers.get("XRSystem")([e]),2);switch(n.handedness){case"left":t=0;break;case"right":t=1}var r=a.transform.matrix,o=[];for(let e=0;e<16;e++)o[e]=new Float32Array([r[e]])[0];this.toStreamerMessagesProvider.toStreamerHandlers.get("XRControllerTransform")([o[0],o[4],o[8],o[12],o[1],o[5],o[9],o[13],o[2],o[6],o[10],o[14],o[3],o[7],o[11],o[15],t]),void 0===this.controllers[t]&&(this.controllers[t]={prevState:void 0,currentState:void 0,id:void 0},this.controllers[t].prevState=un.deepCopyGamepad(n.gamepad)),this.controllers[t].currentState=un.deepCopyGamepad(n.gamepad);var i=this.controllers[t],s=i.currentState,c=i.prevState;for(let e=0;e<s.buttons.length;e++){const a=s.buttons[e],i=c.buttons[e];a.pressed?this.toStreamerMessagesProvider.toStreamerHandlers.get("XRButtonPressed")([t,e,i.pressed?1:0]):!a.pressed&&i.pressed&&this.toStreamerMessagesProvider.toStreamerHandlers.get("XRButtonReleased")([t,e,0]),a.touched&&!a.pressed?this.toStreamerMessagesProvider.toStreamerHandlers.get("XRButtonPressed")([t,3,i.touched?1:0]):!a.touched&&i.touched&&this.toStreamerMessagesProvider.toStreamerHandlers.get("XRButtonReleased")([t,3,0])}for(let e=0;e<s.axes.length;e++)this.toStreamerMessagesProvider.toStreamerHandlers.get("XRAnalog")([t,e,s.axes[e]]);this.controllers[t].prevState=s}}}}class hn{constructor(e){this.xrSession=null,this.webRtcController=e,this.xrControllers=[],this.xrGamepadController=new gn(this.webRtcController.streamMessageController),this.onSessionEnded=new EventTarget,this.onSessionStarted=new EventTarget,this.onFrame=new EventTarget}xrClicked(){this.xrSession?this.xrSession.end():navigator.xr.requestSession("immersive-vr").then(e=>{this.onXrSessionStarted(e)})}onXrSessionEnded(){g.Log(g.GetStackTrace(),"XR Session ended"),this.xrSession=null,this.onSessionEnded.dispatchEvent(new Event("xrSessionEnded"))}onXrSessionStarted(e){g.Log(g.GetStackTrace(),"XR Session started"),this.xrSession=e,this.xrSession.addEventListener("end",()=>{this.onXrSessionEnded()});var t=document.createElement("canvas"),t=(this.gl=t.getContext("webgl2",{xrCompatible:!0}),this.xrSession.updateRenderState({baseLayer:new XRWebGLLayer(this.xrSession,this.gl)}),this.gl.createShader(this.gl.VERTEX_SHADER)),n=(this.gl.shaderSource(t,dn.vertexShader()),this.gl.compileShader(t),this.gl.createShader(this.gl.FRAGMENT_SHADER)),a=(this.gl.shaderSource(n,dn.fragmentShader()),this.gl.compileShader(n),this.gl.createProgram()),t=(this.gl.attachShader(a,t),this.gl.attachShader(a,n),this.gl.linkProgram(a),this.gl.useProgram(a),this.positionLocation=this.gl.getAttribLocation(a,"a_position"),this.texcoordLocation=this.gl.getAttribLocation(a,"a_texCoord"),this.positionBuffer=this.gl.createBuffer(),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.positionBuffer),this.gl.enableVertexAttribArray(this.positionLocation),this.gl.createTexture());this.gl.bindTexture(this.gl.TEXTURE_2D,t),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.NEAREST),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.NEAREST),this.texcoordBuffer=this.gl.createBuffer(),this.resolutionLocation=this.gl.getUniformLocation(a,"u_resolution"),this.offsetLocation=this.gl.getUniformLocation(a,"u_offset"),e.requestReferenceSpace("local").then(e=>{this.xrRefSpace=e,this.xrSession.requestAnimationFrame((e,t)=>this.onXrFrame(e,t))}),this.onSessionStarted.dispatchEvent(new Event("xrSessionStarted"))}onXrFrame(t,a){var e=a.getViewerPose(this.xrRefSpace);if(e){const t=e.transform.matrix,a=[];for(let e=0;e<16;e++)a[e]=new Float32Array([t[e]])[0];this.webRtcController.streamMessageController.toStreamerHandlers.get("XRHMDTransform")([a[0],a[4],a[8],a[12],a[1],a[5],a[9],a[13],a[2],a[6],a[10],a[14],a[3],a[7],a[11],a[15]]);e=this.xrSession.renderState.baseLayer;this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,e.framebuffer),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,this.webRtcController.videoPlayer.getVideoElement()),this.render(this.webRtcController.videoPlayer.getVideoElement())}this.webRtcController.config.isFlagEnabled(P.XRControllerInput)&&this.xrSession.inputSources.forEach((e,t,n)=>{this.xrGamepadController.updateStatus(e,a,this.xrRefSpace)},this),this.xrSession.requestAnimationFrame((e,t)=>this.onXrFrame(e,t)),this.onFrame.dispatchEvent(new Pt({time:t,frame:a}))}render(e){var t;this.gl&&(t=this.xrSession.renderState.baseLayer,this.gl.viewport(0,0,t.framebufferWidth,t.framebufferHeight),this.gl.uniform4f(this.offsetLocation,1,1,0,0),this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array([0,0,e.videoWidth,0,0,e.videoHeight,0,e.videoHeight,e.videoWidth,0,e.videoWidth,e.videoHeight]),this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.texcoordBuffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.positionBuffer),t=this.gl.FLOAT,this.gl.vertexAttribPointer(this.positionLocation,2,t,!1,0,0),this.gl.enableVertexAttribArray(this.texcoordLocation),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.texcoordBuffer),t=this.gl.FLOAT,this.gl.vertexAttribPointer(this.texcoordLocation,2,t,!1,0,0),this.gl.uniform2f(this.resolutionLocation,e.videoWidth,e.videoHeight),t=this.gl.TRIANGLES,this.gl.drawArrays(t,0,6))}static isSessionSupported(e){return navigator.xr?navigator.xr.isSessionSupported(e):new Promise(()=>!1)}}class _n{constructor(e){this.editTextButton=null,this.hiddenInput=null,"ontouchstart"in document.documentElement&&this.createOnScreenKeyboardHelpers(e)}unquantizeAndDenormalizeUnsigned(e,t){return null}createOnScreenKeyboardHelpers(e){this.hiddenInput||(this.hiddenInput=document.createElement("input"),this.hiddenInput.id="hiddenInput",this.hiddenInput.maxLength=0,e.appendChild(this.hiddenInput)),this.editTextButton||(this.editTextButton=document.createElement("button"),this.editTextButton.id="editTextButton",this.editTextButton.innerHTML="edit text",e.appendChild(this.editTextButton),this.editTextButton.classList.add("hiddenState"),this.editTextButton.addEventListener("touchend",e=>{this.hiddenInput.focus(),e.preventDefault()}))}showOnScreenKeyboard(e){e.showOnScreenKeyboard?(this.editTextButton.classList.remove("hiddenState"),e=this.unquantizeAndDenormalizeUnsigned(e.x,e.y),this.editTextButton.style.top=e.y.toString()+"px",this.editTextButton.style.left=(e.x-40).toString()+"px"):(this.editTextButton.classList.add("hiddenState"),this.hiddenInput.blur())}}class pn{constructor(e){this.seq=e.Seq,this.playerSentTimestamp=Date.now(),this.requestFillerSize=e.Filler?e.Filler.length:0}update(e){this.playerReceivedTimestamp=Date.now(),this.streamerReceivedTimestamp=e.ReceivedTimestamp,this.streamerSentTimestamp=e.SentTimestamp,this.responseFillerSize=e.Filler?e.Filler.length:0}}class fn{constructor(e,t){this.sink=e,this.callback=t,this.records=new Map,this.seq=0}start(e){return!this.isRunning()&&(this.startTime=Date.now(),this.records.clear(),this.interval=setInterval((()=>{Date.now()-this.startTime>=e.duration?this.stop():this.sendRequest(e.requestSize,e.responseSize)}).bind(this),Math.floor(1e3/e.rps)),!0)}stop(){this.interval&&(clearInterval(this.interval),this.interval=void 0,this.callback(this.produceResult()))}produceResult(){const e=new Map(this.records);return{records:e,dataChannelRtt:Math.ceil(Array.from(this.records.values()).reduce((e,t)=>e+(t.playerReceivedTimestamp-t.playerSentTimestamp),0)/this.records.size),playerToStreamerTime:Math.ceil(Array.from(this.records.values()).reduce((e,t)=>e+(t.streamerReceivedTimestamp-t.playerSentTimestamp),0)/this.records.size),streamerToPlayerTime:Math.ceil(Array.from(this.records.values()).reduce((e,t)=>e+(t.playerReceivedTimestamp-t.streamerSentTimestamp),0)/this.records.size),exportLatencyAsCSV:()=>{let t="Timestamp;RTT;PlayerToStreamer;StreamerToPlayer;\n";return e.forEach(e=>{t=(t=(t=(t+=e.playerSentTimestamp+";")+(e.playerReceivedTimestamp-e.playerSentTimestamp+";"))+(e.streamerReceivedTimestamp-e.playerSentTimestamp+";"))+(e.playerReceivedTimestamp-e.streamerSentTimestamp+";")+"\n"}),t}}}isRunning(){return!!this.interval}receive(e){var t;this.isRunning()&&(e?(t=this.records.get(e.Seq))&&t.update(e):g.Error(g.GetStackTrace(),"Undefined response from server"))}sendRequest(e,t){e=this.createRequest(e,t),t=new pn(e);this.records.set(t.seq,t),this.sink(e)}createRequest(e,t){return{Seq:this.seq++,FillResponseSize:t,Filler:e?"A".repeat(e):""}}}class Sn{constructor(e,t){this.allowConsoleCommands=!1,this.config=e,null!=t&&t.videoElementParent&&(this._videoElementParent=t.videoElementParent),this._eventEmitter=new vt,this.configureSettings(),this.setWebRtcPlayerController(new mn(this.config,this)),this.onScreenKeyboardHelper=new _n(this.videoElementParent),this.onScreenKeyboardHelper.unquantizeAndDenormalizeUnsigned=(e,t)=>this._webRtcController.requestUnquantizedAndDenormalizeUnsigned(e,t),this._activateOnScreenKeyboard=e=>this.onScreenKeyboardHelper.showOnScreenKeyboard(e),this._webXrController=new hn(this._webRtcController)}get videoElementParent(){return this._videoElementParent||(this._videoElementParent=document.createElement("div"),this._videoElementParent.id="videoElementParent"),this._videoElementParent}configureSettings(){this.config._addOnSettingChangedListener(P.IsQualityController,e=>{!0!==e||this._webRtcController.isQualityController||this._webRtcController.sendRequestQualityControlOwnership()}),this.config._addOnSettingChangedListener(P.AFKDetection,e=>{this._webRtcController.setAfkEnabled(e)}),this.config._addOnSettingChangedListener(P.MatchViewportResolution,()=>{this._webRtcController.videoPlayer.updateVideoStreamSize()}),this.config._addOnSettingChangedListener(P.HoveringMouseMode,e=>{this.config.setFlagLabel(P.HoveringMouseMode,`Control Scheme: ${e?"Hovering":"Locked"} Mouse`),this._webRtcController.setMouseInputEnabled(this.config.isFlagEnabled(P.MouseInput))}),this.config._addOnSettingChangedListener(P.KeyboardInput,e=>{this._webRtcController.setKeyboardInputEnabled(e)}),this.config._addOnSettingChangedListener(P.MouseInput,e=>{this._webRtcController.setMouseInputEnabled(e)}),this.config._addOnSettingChangedListener(P.TouchInput,e=>{this._webRtcController.setTouchInputEnabled(e)}),this.config._addOnSettingChangedListener(P.GamepadInput,e=>{this._webRtcController.setGamePadInputEnabled(e)}),this.config._addOnNumericSettingChangedListener(D.MinQP,e=>{g.Log(g.GetStackTrace(),"-------- Sending MinQP --------",7),this._webRtcController.sendEncoderMinQP(e),g.Log(g.GetStackTrace(),"-------------------------------------------",7)}),this.config._addOnNumericSettingChangedListener(D.MaxQP,e=>{g.Log(g.GetStackTrace(),"-------- Sending encoder settings --------",7),this._webRtcController.sendEncoderMaxQP(e),g.Log(g.GetStackTrace(),"-------------------------------------------",7)}),this.config._addOnNumericSettingChangedListener(D.WebRTCMinBitrate,e=>{g.Log(g.GetStackTrace(),"-------- Sending web rtc settings --------",7),this._webRtcController.sendWebRTCMinBitrate(1e3*e),g.Log(g.GetStackTrace(),"-------------------------------------------",7)}),this.config._addOnNumericSettingChangedListener(D.WebRTCMaxBitrate,e=>{g.Log(g.GetStackTrace(),"-------- Sending web rtc settings --------",7),this._webRtcController.sendWebRTCMaxBitrate(1e3*e),g.Log(g.GetStackTrace(),"-------------------------------------------",7)}),this.config._addOnNumericSettingChangedListener(D.WebRTCFPS,e=>{g.Log(g.GetStackTrace(),"-------- Sending web rtc settings --------",7),this._webRtcController.sendWebRTCFps(e),g.Log(g.GetStackTrace(),"-------------------------------------------",7)}),this.config._addOnOptionSettingChangedListener(I.PreferredCodec,e=>{this._webRtcController&&this._webRtcController.setPreferredCodec(e)}),this.config._registerOnChangeEvents(this._eventEmitter)}_activateOnScreenKeyboard(e){throw new Error("Method not implemented.")}_onInputControlOwnership(e){this._inputController=e}setWebRtcPlayerController(e){this._webRtcController=e,this._webRtcController.setPreferredCodec(this.config.getSettingOption(I.PreferredCodec).selected),this._webRtcController.resizePlayerStyle(),this.checkForAutoConnect()}connect(){this._eventEmitter.dispatchEvent(new ct),this._webRtcController.connectToSignallingServer()}reconnect(){this._eventEmitter.dispatchEvent(new mt),this._webRtcController.tryReconnect("Reconnecting...")}disconnect(){this._eventEmitter.dispatchEvent(new lt),this._webRtcController.close()}play(){this._onStreamLoading(),this._webRtcController.playStream()}checkForAutoConnect(){this.config.isFlagEnabled(P.AutoConnect)&&(this._onWebRtcAutoConnect(),this._webRtcController.connectToSignallingServer())}unmuteMicrophone(e=!1){if(!this.config.isFlagEnabled("UseMic"))return e?(this.config.setFlagEnabled("UseMic",!0),void this.reconnect()):void g.Warning(g.GetStackTrace(),"Trying to unmute mic, but PixelStreaming was initialized with no microphone track. Call with forceEnable == true to re-connect with a mic track.");this.setMicrophoneMuted(!1)}muteMicrophone(){this.config.isFlagEnabled("UseMic")?this.setMicrophoneMuted(!0):g.Info(g.GetStackTrace(),"Trying to mute mic, but PixelStreaming has no microphone track, so sending sound is already disabled.")}setMicrophoneMuted(e){var t;for(const n of null!=(t=null==(t=null==(t=null==(t=this._webRtcController)?void 0:t.peerConnectionController)?void 0:t.peerConnection)?void 0:t.getTransceivers())?t:[])Ut.canTransceiverSendAudio(n)&&(n.sender.track.enabled=!e)}_onWebRtcAutoConnect(){this._eventEmitter.dispatchEvent(new $e)}_onWebRtcSdp(){this._eventEmitter.dispatchEvent(new Je)}_onStreamLoading(){this._eventEmitter.dispatchEvent(new st)}_onDisconnect(e,t){this._eventEmitter.dispatchEvent(new nt({eventString:e,allowClickToReconnect:t}))}_onWebRtcConnecting(){this._eventEmitter.dispatchEvent(new Ze)}_onWebRtcConnected(){this._eventEmitter.dispatchEvent(new et)}_onWebRtcFailed(){this._eventEmitter.dispatchEvent(new tt)}_onVideoInitialized(){this._eventEmitter.dispatchEvent(new ot),this._videoStartTime=Date.now()}_onLatencyTestResult(e){this._eventEmitter.dispatchEvent(new ft({latencyTimings:e}))}_onDataChannelLatencyTestResponse(e){this._eventEmitter.dispatchEvent(new St({response:e}))}_onVideoStats(e){this._videoStartTime&&void 0!==this._videoStartTime||(this._videoStartTime=Date.now()),e.handleSessionStatistics(this._videoStartTime,this._inputController,this._webRtcController.videoAvgQp),this._eventEmitter.dispatchEvent(new _t({aggregatedStats:e}))}_onVideoEncoderAvgQP(e){this._eventEmitter.dispatchEvent(new Xe({avgQP:e}))}_onInitialSettings(e){this._eventEmitter.dispatchEvent(new yt({settings:e})),e.PixelStreamingSettings&&(this.allowConsoleCommands=null!=(t=e.PixelStreamingSettings.AllowPixelStreamingCommands)&&t,!1===this.allowConsoleCommands)&&g.Info(g.GetStackTrace(),"-AllowPixelStreamingCommands=false, sending arbitrary console commands from browser to UE is disabled.");var t=this.config.useUrlParams,n=new URLSearchParams(window.location.search);e.EncoderSettings&&(this.config.setNumericSetting(D.MinQP,t&&n.has(D.MinQP)?Number.parseInt(n.get(D.MinQP)):e.EncoderSettings.MinQP),this.config.setNumericSetting(D.MaxQP,t&&n.has(D.MaxQP)?Number.parseInt(n.get(D.MaxQP)):e.EncoderSettings.MaxQP)),e.WebRTCSettings&&(this.config.setNumericSetting(D.WebRTCMinBitrate,t&&n.has(D.WebRTCMinBitrate)?Number.parseInt(n.get(D.WebRTCMinBitrate)):e.WebRTCSettings.MinBitrate/1e3),this.config.setNumericSetting(D.WebRTCMaxBitrate,t&&n.has(D.WebRTCMaxBitrate)?Number.parseInt(n.get(D.WebRTCMaxBitrate)):e.WebRTCSettings.MaxBitrate/1e3),this.config.setNumericSetting(D.WebRTCFPS,t&&n.has(D.WebRTCFPS)?Number.parseInt(n.get(D.WebRTCFPS)):e.WebRTCSettings.FPS))}_onQualityControlOwnership(e){this.config.setFlagEnabled(P.IsQualityController,e)}_onPlayerCount(e){this._eventEmitter.dispatchEvent(new Dt({count:e}))}requestLatencyTest(){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._webRtcController.sendLatencyTest(),!0)}requestDataChannelLatencyTest(e){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._dataChannelLatencyTestController||(this._dataChannelLatencyTestController=new fn(this._webRtcController.sendDataChannelLatencyTest.bind(this._webRtcController),e=>{this._eventEmitter.dispatchEvent(new Ct({result:e}))}),this.addEventListener("dataChannelLatencyTestResponse",({data:{response:e}})=>{this._dataChannelLatencyTestController.receive(e)})),this._dataChannelLatencyTestController.start(e))}requestShowFps(){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._webRtcController.sendShowFps(),!0)}requestIframe(){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._webRtcController.sendIframeRequest(),!0)}emitUIInteraction(e){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._webRtcController.emitUIInteraction(e),!0)}emitCommand(e){return!(!this._webRtcController.videoPlayer.isVideoReady()||!this.allowConsoleCommands&&"ConsoleCommand"in e||(this._webRtcController.emitCommand(e),0))}emitConsoleCommand(e){return!(!this.allowConsoleCommands||!this._webRtcController.videoPlayer.isVideoReady()||(this._webRtcController.emitConsoleCommand(e),0))}addResponseEventListener(e,t){this._webRtcController.responseController.addResponseEventListener(e,t)}removeResponseEventListener(e){this._webRtcController.responseController.removeResponseEventListener(e)}dispatchEvent(e){return this._eventEmitter.dispatchEvent(e)}addEventListener(e,t){this._eventEmitter.addEventListener(e,t)}removeEventListener(e,t){this._eventEmitter.removeEventListener(e,t)}toggleXR(){this.webXrController.xrClicked()}setSignallingUrlBuilder(e){this._webRtcController.signallingUrlBuilder=e}get webSocketController(){return this._webRtcController.webSocketController}get webXrController(){return this._webXrController}registerMessageHandler(t,e,n){e!==c.FromStreamer||void 0!==n?e===c.ToStreamer&&void 0===n?this._webRtcController.streamMessageController.registerMessageHandler(e,t,e=>this._webRtcController.sendMessageController.sendMessageToStreamer(t,e)):this._webRtcController.streamMessageController.registerMessageHandler(e,t,e=>n(e)):g.Warning(g.GetStackTrace(),"Unable to register an undefined handler for "+t)}get toStreamerHandlers(){return this._webRtcController.streamMessageController.toStreamerHandlers}isReconnecting(){return this._webRtcController.isReconnecting}}}var Ie=d.De,be=d.g;function Fe(e,t,n){this.earth=n,this.config=new Ie({initialSettings:e}),this.streaming=new be(this.config,{videoElementParent:t}),null!=window&&null!=window.loggerContext&&(window.loggerContext.logLevel=2),null!=(n.player=this).streaming.webRtcController?this.webRtcController=this.streaming.webRtcController:null!=this.streaming._webRtcController&&(this.webRtcController=this.streaming._webRtcController),this.init()}var Le=262144,Re=Le-21;Fe.prototype.init=function(){this.webRtcController.sendMessageController.emitLibAxInteraction=function(e){this.sendLibAxInteraction("LibAx",e)},this.webRtcController.sendMessageController.sendLibAxInteraction=function(e,t){e=this.toStreamerMessagesMapProvider.toStreamerMessages.get(e);if(void 0!==e){t=this.PackData(t,e.id);if(this.dataChannelSender.canSend())if(t.buffer.byteLength>Le)for(var n=function(e){var t=e.buffer,n=t.byteLength;if(!(n<=Le)){for(var n=n-13,a=new Uint8Array(21),i=(a[0]=e.getUint8(0,!0),new DataView(a.buffer)),r=(i.setUint32(1,n,!0),e.getUint32(5,!0)),e=e.getUint32(9,!0),o=(i.setUint32(13,r,!0),i.setUint32(17,e,!0),Math.floor(n/Re)),s=n%Re,c=(0<s&&(o+=1),[]),l=(c.length=o,Re),m=13,d=0;d<o;++d){i.setUint32(5,l=0<s&&d==o-1?s:l,!0),i.setUint32(9,d,!0),c[d]=new Uint8Array(l+21),c[d].set(a,0);var u=t.slice(m,m+l),u=new Uint8Array(u);c[d].set(u,21),m+=l}return c}}(t),a=0,i=n.length;a<i;++a)this.dataChannelSender.sendData(n[a]);else this.dataChannelSender.sendData(t.buffer)}},this.webRtcController.streamMessageController.toStreamerMessages.set("LibAx",{id:9,byteLength:0,structure:[]}),this.webRtcController.streamMessageController.fromStreamerMessages.set("LibAx",15),this.webRtcController.streamMessageController.fromStreamerMessages.set("LibAxByteContents",14),this.webRtcController.streamMessageController.registerMessageHandler(1,"LibAx",e=>this.earth.response(e)),this.webRtcController.streamMessageController.registerMessageHandler(1,"LibAxByteContents",e=>this.earth.response_byte(e)),this.webRtcController.streamMessageController.registerMessageHandler(0,"LibAx",e=>this.webRtcController.sendMessageController.emitLibAxInteraction(e))};e.StampCoreApi=n,e.VERSION="1.0.2010.1001",e.lib_ax=t,e.player53=Fe,Object.defineProperty(e,"__esModule",{value:!0})});
|