main.js 220.5 KB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.MCUClientEngine=t():e.MCUClientEngine=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}(function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))switch(typeof e[t]){case"function":break;case"object":e[t]=function(t){var n=t.slice(1),r=e[t[0]];return function(e,t,i){r.apply(this,[e,t,i].concat(n))}}(e[t]);break;default:e[t]=e[e[t]]}return e}([function(e,t,n){e.exports=n(23)},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t){n(this,e),this.sdkInfo=t||"",this.id=this.initId()}return r(e,[{key:"initId",value:function(){var e=this.sdkInfo.constructor.name.toLowerCase();return"string"===e?this.sdkInfo:"object"===e?this.sdkInfo.mid||"":""}},{key:"log",value:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];this._log(e.LOG,n)}},{key:"warn",value:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];this._log(e.WARN,n)}},{key:"error",value:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];this._log(e.ERROR,n)}},{key:"_log",value:function(t,n){n=JSON.stringify(n);var r=this.id+" -> "+n;if(t>=e.logLevel)switch(t){case e.LOG:console.log(r);break;case e.WARN:console.warn(r);break;case e.ERROR:console.error(r)}}}]),e}();i.LOG=0,i.WARN=1,i.ERROR=2,i.NO=1/0,i.logLevel=i.LOG;var s={getLoger:function(e){return new i(e)},setLogLevel:function(e){i.logLevel=e},LOG:i.LOG,WARN:i.WARN,ERROR:i.ERROR,NO:i.NO};t.default=s;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"Loger","D:/work/McuClient/src/Loger.js"),__REACT_HOT_LOADER__.register(s,"default","D:/work/McuClient/src/Loger.js"))})()},function(e,t){"use strict";function n(){}Object.defineProperty(t,"__esModule",{value:!0}),n.CLASS_INIT_SUCCESS="class.init.success",n.CLASS_INIT_FAILED="class.init.failed",n.CLASS_JOIN_FAILED="join.class.failed",n.CLASS_JOIN_SUCCESS="join.class.success",n.CLASS_SHOW_DETAIL="class_detail.message",n.CLASS_SHOW_ROSTER_NUM="roster_num.message",n.CLASS_EXIT="class.exit",n.CHAT_RECEIVE="chat.message",n.VIDEO_SHOW="video.message",n.DOC_SHOW="document.message",n.DOC_SWITCH="document.switch",n.DOC_UPDATE="document.update",n.DOC_DEL="document.delete",n.DOC_ANNO="document.anno",n.ANNO_UPDATE="anno_update",n.AUDIO_SHOW="audio.message",n.NET_ERROR="net_error",n.PRO_ERROR="pro_error",n.ERROR_NET="网络异常",n.ERROR_PARAM="参数不正确",n.ERROR_CLASS_JOIN_FULL="class.join,full",n.ERROR_CLASS_JOIN_CONFILICT="class.join.conflict",n.ERROR_CLASS_PASSWORD_WRONG="class.password.wrong",n.ERROR_CLASS_MD5_WRONG="class.md5.wrong",n.ERROR_CLASS_PROTOCOL_WRONG="class.protocol.wrong";var r=n;t.default=r;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(n,"MessageTypes","D:/work/McuClient/src/MessageTypes.js"),__REACT_HOT_LOADER__.register(r,"default","D:/work/McuClient/src/MessageTypes.js"))})()},function(e,t){"use strict";function n(e){for(var t in n)if(n[t]===e)return t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.NR_GUEST=0,n.NR_NORMAL=1,n.NR_ADMIN=2,n.NR_MASTER=4,n.NR_SLAVE=8,n.NR_ASSISTANT=16,n.NR_INVISIBLE=32,n.INVALIDATE_CHANNEL_ID=-1,n.INVALIDATE_NODE_ID=-1,n.DOCUMENT_LOAD=0,n.DOCUMENT_DEL=1,n.CGS_RELEASED=0,n.CGS_PENDING=1,n.CGS_OPENNED=2,n.CGS_GRABBING=3,n.CONFERENCE_SESSION_ID=11,n.CHAT_SESSION_ID=12,n.GIFT_SESSION_ID=13,n.AUDIO_SESSION_ID=14,n.VIDEO_SESSION_ID=15,n.WEBSHARING_SESSION_ID=16,n.DOCSHARING_SESSION_ID=17,n.WHITEBOARD_SESSION_ID=18,n.MEDIA_SESSION_ID=19,n.SCREENSHARING_SESSION_ID=20,n.POLL_SESSION_ID=21,n.BROADCAST_CHANNEL_ID=0,n.CONFERENCE_CHANNEL_ID=n.CONFERENCE_SESSION_ID,n.CHAT_CHANNEL_ID=n.CHAT_SESSION_ID,n.GIFT_CHANNEL_ID=n.GIFT_SESSION_ID,n.WEBSHARING_CHANNEL_ID=n.WEBSHARING_SESSION_ID,n.DOCSHARING_CHANNEL_ID=n.DOCSHARING_SESSION_ID,n.WHITEBOARD_CHANNEL_ID=n.WHITEBOARD_SESSION_ID,n.MEDIA_CHANNEL_ID=n.MEDIA_SESSION_ID,n.SCREENSHARING_CHANNEL_ID=n.SCREENSHARING_SESSION_ID,n.CONFERENCE_SESSION_NAME="conference app",n.CHAT_SESSION_NAME="chat app",n.GIFT_SESSION_NAME="gift app",n.AUDIO_SESSION_NAME="audio app",n.VIDEO_SESSION_NAME="video app",n.WEBSHARING_SESSION_NAME="web sharing app",n.DOCSHARING_SESSION_NAME="doc sharing app",n.WHITEBOARD_SESSION_NAME="whiteboard app",n.MEDIA_SESSION_NAME="media sharing app",n.SCREENSHARING_SESSION_NAME="screen sharing app",n.CONFERENCE_SESSION_TAG="con-tag",n.CHAT_SESSION_TAG="cha-tag",n.GIFT_SESSION_TAG="gif-tag",n.AUDIO_SESSION_TAG="aud-tag",n.VIDEO_SESSION_TAG="vid-tag",n.WEBSHARING_SESSION_TAG="web-tag",n.DOCSHARING_SESSION_TAG="doc-tag",n.WHITEBOARD_SESSION_TAG="wbd-tag",n.MEDIA_SESSION_TAG="med-tag",n.SCREENSHARING_SESSION_TAG="scr-tag",n.CONFERENCE_OBJ_ROSTER_ID=(n.CONFERENCE_SESSION_ID<<16)+1,n.CONFERENCE_OBJ_ROSTER_NAME="node list",n.CONFERENCE_OBJ_ROSTER_TAG="node list tag",n.CONFERENCE_OBJ_QUEUE_ID=(n.CONFERENCE_SESSION_ID<<16)+2,n.CONFERENCE_OBJ_QUEUE_NAME="mic list",n.CONFERENCE_OBJ_QUEUE_TAG="mic list tag",n.CONFERENCE_OBJ_TABLE_ID=(n.CONFERENCE_SESSION_ID<<16)+3,n.CONFERENCE_OBJ_TABLE_NAME="tabbar list",n.CONFERENCE_OBJ_TABLE_TAG="tabbar list tag",n.CONFERENCE_OBJ_COUNTER_ID=(n.CONFERENCE_SESSION_ID<<16)+4,n.CONFERENCE_OBJ_COUNTER_NAME="id list",n.CONFERENCE_OBJ_COUNTER_TAG="id list tag",n.WEBSHARING_OBJ_TABLE_ID=(n.WEBSHARING_SESSION_ID<<16)+1,n.WEBSHARING_OBJ_TABLE_NAME="web list",n.WEBSHARING_OBJ_TABLE_TAG="web list tag",n.DOCSHARING_OBJ_TABLE_ID=(n.DOCSHARING_SESSION_ID<<16)+1,n.DOCSHARING_OBJ_TABLE_NAME="doc list",n.DOCSHARING_OBJ_TABLE_TAG="doc list tag",n.DOCSHARING_OBJ_TABLE_ID_H5=(n.DOCSHARING_SESSION_ID<<16)+2,n.DOCSHARING_OBJ_TABLE_NAME_H5="doc list h5",n.DOCSHARING_OBJ_TABLE_TAG_H5="doc list tag h5",n.WHITEBOARD_OBJ_TABLE_ID=(n.WHITEBOARD_SESSION_ID<<16)+1,n.WHITEBOARD_OBJ_TABLE_NAME="wbd list",n.WHITEBOARD_OBJ_TABLE_TAG="wbd list tag",n.MEDIA_OBJ_TABLE_ID=(n.MEDIA_SESSION_ID<<16)+1,n.MEDIA_OBJ_TABLE_NAME="med list",n.MEDIA_OBJ_TABLE_TAG="med list tag",n.CHAT_OBJ_TABLE_ID=(n.CHAT_SESSION_ID<<16)+1,n.CHAT_OBJ_TABLE_NAME="chat list",n.CHAT_OBJ_TABLE_TAG="chat list tag",n.AUDIO_OBJ_TABLE_ID=(n.AUDIO_SESSION_ID<<16)+1,n.AUDIO_OBJ_TABLE_NAME="audio channel list",n.AUDIO_OBJ_TABLE_TAG="audio channel list tag",n.VIDEO_OBJ_TABLE_ID=(n.VIDEO_SESSION_ID<<16)+1,n.VIDEO_OBJ_TABLE_NAME="video channel list",n.VIDEO_OBJ_TABLE_TAG="video channel list tag",n.SCREENSHARING_OBJ_TABLE_ID=(n.SCREENSHARING_SESSION_ID<<16)+1,n.SCREEN_OBJ_TABLE_NAME="scr list",n.SCREEN_OBJ_TABLE_TAG="scr list tag",n.POLL_OBJ_TABLE_ID=(n.POLL_SESSION_ID<<16)+1,n.VOTE_OBJ_TABLE_ID=(n.POLL_SESSION_ID<<16)+2,n.RECORD_OBJ_TABLE_ID=(n.POLL_SESSION_ID<<16)+3,n.SHAMLIVE_OBJ_TABLE_ID=(n.POLL_SESSION_ID<<16)+4,n.POLL_OBJ_TABLE_NAME="poll list",n.POLL_OBJ_TABLE_TAG="poll list tag",n.REG_TABLE_INSERT_TAIL=16777215,n.REG_TABLE_DELETE_ALL=16777215,n.CJS_RELEASED=0,n.CJS_JOINNING=1,n.CJS_JOINNED=2,n.WBA_CLOSE=1,n.WBA_CHANGE=2,n.WBA_OPEN=3,n.WBA_DOC_ANNOTATION=4,n.WBA_LASER_PEN=5;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&__REACT_HOT_LOADER__.register(n,"ApeConsts","D:/work/McuClient/src/apes/ApeConsts.js")})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n,r,i,s,o,a,u,f,l){var h=new E.RCSendDataPdu;return h.set("type",e),h.set("subType",t),h.set("initiator",n),h.set("confId",r),h.set("sessionId",i),h.set("channelId",s),h.set("upward",o),h.set("reliability",a),h.set("priority",u),h.set("peer",f),h.set("seg",l),h}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(36),a=r(o),u=n(30),f=r(u),l=n(15),h=r(l),d=n(8),c=r(d),_=a.default.newBuilder({convertFieldsToCamelCase:!0});a.default.loadProto(f.default,_);var E=_.build();E.decode_pdu=function(e){return E.RCSendDataPdu.decode(e)},E.create_connect_provider_request_pdu=function(e,t,n,r,s,o,a,u,f){return i(h.default.RCPDU_CONNECT_PROVIDER_REQUEST,e,t,n,r,s,!0,o,a,u,f)},E.create_uniform_pdu=function(e,t,n,r,s,o,a,u,f){return i(h.default.RCPDU_UNIFORM_SEND_DATA_REQUEST,e,t,n,r,s,!0,o,a,u,f)},E.create_normal_pdu=function(e,t,n,r,s,o,a,u,f,l){return i(h.default.RCPDU_SEND_DATA_REQUEST,e,t,n,r,s,o,a,u,f,l)},E.id2type=function(e){for(var t in h.default)if(h.default[t]===e)return t},E=s({},E,h.default,c.default);var p=E;t.default=p;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(_,"builder","D:/work/McuClient/src/pdu/index.js"),__REACT_HOT_LOADER__.register(E,"pdu","D:/work/McuClient/src/pdu/index.js"),__REACT_HOT_LOADER__.register(i,"create_pdu","D:/work/McuClient/src/pdu/index.js"),__REACT_HOT_LOADER__.register(p,"default","D:/work/McuClient/src/pdu/index.js"))})()},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){n(this,e),this.MAPS={}}return r(e,[{key:"on",value:function(e,t){if(e&&t){var n=this.MAPS[e];if(!n)return this.MAPS[e]=[t];n.push(t)}}},{key:"off",value:function(e,t){if(e){var n=this.MAPS[e];if(n){if(t)return n.splice(n.indexOf(t),1);n.length=0}}}},{key:"_emit",value:function(e,t){if(e){var n=this.MAPS["*"];n&&n.length&&n.forEach(function(n){n(e,t)});var r=this.MAPS[e];r&&r.length&&r.forEach(function(e){e(t)})}}}]),e}(),s=i;t.default=s;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"Emiter","D:/work/McuClient/src/Emiter.js"),__REACT_HOT_LOADER__.register(s,"default","D:/work/McuClient/src/Emiter.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(4),f=r(u),l=n(5),h=r(l),d=n(14),c=r(d),_=n(1),E=r(_),p=n(2),g=r(p),R=n(3),y=r(R),C=n(13),T=r(C),S=n(8),I=r(S),m=E.default.getLoger("Ape"),v=function(e){function t(e,n,r){i(this,t);var o=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return o._session_id=e,o._channel_id=e,o._session_name=n,o._session_tag=r,o._session_channels={},o._adapter_pdu=new f.default.RCAdapterPdu,o._confInfo=null,o._rCArrayBufferUtil=T.default,o._apeDelayed=!1,o._apeDelayedMsgs=[],o._apeDelayedTimer=0,o.on(f.default.RCPDU_SESSION_JOIN_RESPONSE,o._joinSessionHandler.bind(o)),o.on(f.default.RCPDU_CHANNEL_JOIN_RESPONSE,o._joinChannelHandler.bind(o)),o.on(f.default.RCPDU_REG_ADAPTER,o._pduMessageHandler.bind(o)),o.mcu=c.default,o.mcu.on(g.default.CLASS_JOIN_SUCCESS,o._mcuConferenceJoinSuccessHandler.bind(o)),o.mcu.registerApe(o),o}return o(t,e),a(t,[{key:"regResponsePduHandler",value:function(){}},{key:"_pduMessageHandler",value:function(e){var t=this;return this._apeDelayed?void setTimeout(function(){t._pduRegAdapterHandler(e)},this._confInfo.mcuDelay||12e3):void this._pduRegAdapterHandler(e)}},{key:"_pduRegAdapterHandler",value:function(e){var t=f.default.RCAdapterPdu.decode(e),n=t.item,r=n.length;m.log(this._session_name+"数据同步消息.同步条数",r);for(var i=0;i<r;++i){var s=n[i],o=s.type,a=s.itemData;if(f.default.RCPDU_REG_UPDATE_OBJ===o){var u=f.default.RCRegistryUpdateObjPdu.decode(a),l=u.subType,h=u.objId,d=u.userData;switch(m.log("REG OBJECT EVENT ->",f.default.id2type(l)),l){case f.default.RCPDU_REG_ROSTER_INSERT_PDU:for(var c=f.default.RCRegstryRosterInsertItemPdu.decode(d),_=c.items,E=_.length,p=0;p<E;++p){var g=_[p],R=g.item_id,y=f.default.RCNodeInfoRecordPdu.decode(g.item_data);this.rosterInsertHandler(R,y)}break;case f.default.RCPDU_REG_ROSTER_DELETE_PDU:var C=f.default.RCRegistryRosterDeleteItemPdu.decode(d);this.rosterDelHandler(C.nodeId);break;case f.default.RCPDU_REG_ROSTER_UPDATE_PDU:for(var T=f.default.RCRegistryRosterUpdateItemPdu.decode(d),S=T.items,I=S.length,v=0;v<I;++v){var b=S[v],A=b.nodeId,O=f.default.RCNodeInfoRecordPdu.decode(b.nodeData);this.rosterUpdateHandler(A,O)}break;case f.default.RCPDU_REG_TABLE_INSERT_PDU:for(var N=f.default.RCRegistryTableInsertItemPdu.decode(d),P=N.items,w=P.length,D=0;D<w;++D){var U=P[D];this.tableInsertHandler(U.owner,U.itemIdx,U.itemData)}break;case f.default.RCPDU_REG_TABLE_DELETE_PDU:var L=f.default.RCRegistryTableDeleteItemPdu.decode(d);this.tableDeleteHandler(h,L);break;case f.default.RCPDU_REG_TABLE_UPDATE_PDU:for(var k=f.default.RCRegistryTableUpdateItemPdu.decode(d),M=k.items,B=M.length,G=0;G<B;++G){var H=M[G];this.tableUpdateHandler(H.owner,H.itemIdx,H.itemData)}break;case f.default.RCPDU_REG_QUEUE_UPDATE_PDU:case f.default.RCPDU_REG_QUEUE_DELETE_PDU:case f.default.RCPDU_REG_QUEUE_INSERT_PDU:m.warn("REG QUEUE ARE IGNORED")}}else if(f.default.RCPDU_REG_RESPONSE_OBJ==o){var F=f.default.RCRegistryResponseObjPdu.decode(a);this.regResponsePduHandler(F)}}}},{key:"rosterInsertHandler",value:function(e,t){m.warn(this._session_name+" rosterInsertHandler 应有子类具体覆盖处理.")}},{key:"rosterUpdateHandler",value:function(e,t){m.warn(this._session_name+" rosterUpdateHandler 应有子类具体覆盖处理.")}},{key:"rosterDelHandler",value:function(e){m.warn(this._session_name+" rosterDelHandler 应有子类具体覆盖处理.")}},{key:"tableInsertHandler",value:function(e,t){m.warn(this._session_name+" tableInsertHandler 应有子类具体覆盖处理.")}},{key:"tableUpdateHandler",value:function(e,t,n){m.warn(this._session_name+" tableUpdateHandler 应有子类具体覆盖处理.")}},{key:"tableDeleteHandler",value:function(e,t){m.warn(this._session_name+" tableDelHandler 应有子类具体覆盖处理.")}},{key:"_joinSessionHandler",value:function(e){m.log(this._session_name," -> 加入Session")}},{key:"_joinChannelHandler",value:function(e){var t=f.default.RCChannelJoinResponsePdu.decode(e);t.result===f.default.RET_SUCCESS?(m.log(this._session_name," -> 加入Channel成功. ChannelId",t.requestedChannelId),this._session_channels[t.requestedChannelId]=y.default.CJS_JOINNED):m.log(this._session_name," -> 加入Channel失败.",t)}},{key:"_mcuConferenceJoinSuccessHandler",value:function(e){m.log("创建Ape->","SessionId",this._session_id,"SessionName",this._session_name,"SessionTag",this._session_tag),this._confInfo=e;var t=new f.default.RCSessionJoinRequestPdu;t.id=this._session_id,t.name=this._session_name,t.tag=this._session_tag,t.sessionData=this._adapter_pdu.toArrayBuffer(),this.sendUniform(t,!0);var n=new f.default.RCChannelJoinRequestPdu;n.initiator=this.mcu.confInfo.nodeId,n.channelId=this._session_id,this.send(n)}},{key:"registerKey",value:function(e,t,n,r){var i=new f.default.RCAdapterItemPdu;i.type=f.default.RCPDU_REG_REGISTER_KEY;var s=new f.default.RCRegistryRegisterKeyPdu;s.id=e,s.name=t,s.tag=n,r.length&&(s.userData=r),i.itemData=s.toArrayBuffer(),this._adapter_pdu.item.push(i)}},{key:"registerObj",value:function(e,t,n,r,i,s){var o=new f.default.RCAdapterItemPdu;o.type=f.default.RCPDU_REG_REGISTER_OBJ;var a=new f.default.RCRegistryRegisterObjPdu;a.type=e,a.objId=t,a.name=n,a.tag=r,i&&(a.owner=i),s.length&&(a.userData=s),o.itemData=a.toArrayBuffer(),this._adapter_pdu.item.push(o)}},{key:"send",value:function(e){m.log("Ape发送数据NORMAL PDU",e);var t=f.default.create_normal_pdu(e.type,this._confInfo.nodeId,this._confInfo.confId,this._session_id,this._channel_id,!0,!0,I.default.DP_TOP,this._confInfo.topNodeID,I.default.SEG_ONCE);t.data=e.toArrayBuffer(),this.mcu.send(t)}},{key:"sendUniform",value:function(e,t){m.log("Ape发送数据UNIFORM PDU",e);var n=f.default.create_uniform_pdu(e.type,this._confInfo.nodeId,this._confInfo.confId,this._session_id,t?y.default.BROADCAST_CHANNEL_ID:this._channel_id,!0,I.default.DP_TOP,t?this._confInfo.topNodeID:e.peer||0,I.default.SEG_ONCE);n.data=e.toArrayBuffer(),this.mcu.send(n)}}]),t}(h.default),b=v;t.default=b;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(m,"loger","D:/work/McuClient/src/apes/Ape.js"),__REACT_HOT_LOADER__.register(v,"Ape","D:/work/McuClient/src/apes/Ape.js"),__REACT_HOT_LOADER__.register(b,"default","D:/work/McuClient/src/apes/Ape.js"))})()},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t){"use strict";function n(){}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.NT_TERMINAL=0,n.NT_MULTIPORT_TERMINAL=1,n.NT_MCU=2,n.DP_TOP=0,n.DP_HIGH=1,n.DP_MEDIUM=2,n.DP_LOW=3,n.SEG_BEGIN=0,n.SEG_END=1,n.SEG_ONCE=2,n.RET_SUCCESS=0,n.RET_USER_REJECTED=1,n.RET_INVALID_CONFERENCE=2,n.RET_INVALID_PASSWORD=3,n.RET_INVALID_CONVENER_PASSWORD=4,n.RET_CHALLENGE_RESPONSE_REQUIRED=5,n.RET_INVALID_CHALLENGE_RESPONSE=6,n.RET_NO_CONNECTION=7,n.RET_FULL_CAPACITY=8;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&__REACT_HOT_LOADER__.register(n,"PduConsts","D:/work/McuClient/src/pdu/PduConsts.js")})()},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){n(this,e)}return r(e,null,[{key:"isEmptyObject",value:function(e){for(var t in e)return!1;return!0}}]),e}(),s=i;t.default=s;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"EngineUtils","D:/work/McuClient/src/EngineUtils.js"),__REACT_HOT_LOADER__.register(s,"default","D:/work/McuClient/src/EngineUtils.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(1),a=r(o),u=a.default.getLoger("GlobalConfig"),f=function(){function e(){i(this,e)}return s(e,null,[{key:"setDebugData",value:function(e){this.isDebug=!0,this.deBugData=e}},{key:"getConfInfo",value:function(){return this.isDebug?(this.deBugData.MCUServerIP=this.MCUServerIP,this.deBugData.MCUServerPort=this.MCUServerPort,this.deBugData.maxVideoChannels=this.maxVideoChannels,this.deBugData.maxAudioChannels=this.maxAudioChannels,this.deBugData.maxMediaChannels=this.maxMediaChannels,this.deBugData):{siteId:this.siteId,confId:this.confId,h5Module:this.h5Module,nodeId:this.nodeId,topNodeID:this.topNodeID,userRole:this.userRole,role:this.role,isHost:this.isHost,classRole:this.classRole,userId:this.userId,userName:this.userName,password:this.password,userType:this.userType,passwordRequired:this.passwordRequired,md5:this.md5,msType:this.msType,portal:this.portal,mcuDelay:this.mcuDelay,MCUServerIP:this.MCUServerIP,MCUServerPort:this.MCUServerPort,maxVideoChannels:this.maxVideoChannels,maxAudioChannels:this.maxAudioChannels,maxMediaChannels:this.maxMediaChannels}}}]),e}();f.siteId="gust",f.confId=1653304953,f.nodeId=1483947664,f.topNodeID=101,f.userRole="normal",f.role=1,f.isHost=!1,f.classRole=0,f.userId=0,f.userName="",f.password="",f.userType=8,f.h5Module=0,f.passwordRequired=!1,f.md5="",f.msType=1,f.mcuDelay=3e3,f.portal="112.126.80.182:80",f.ip="112.126.80.182",f.port="80",f.MCUServerIP="114.215.195.70",f.MCUServerPort=9003,f.maxVideoChannels=1,f.maxAudioChannels=1,f.maxMediaChannels=2,f.isDebug=!1,f.deBugData={},f.meetingParam={};var l=f;t.default=l;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(u,"loger","D:/work/McuClient/src/GlobalConfig.js"),__REACT_HOT_LOADER__.register(f,"GlobalConfig","D:/work/McuClient/src/GlobalConfig.js"),__REACT_HOT_LOADER__.register(l,"default","D:/work/McuClient/src/GlobalConfig.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(6),f=r(u),l=n(3),h=r(l),d=n(2),c=r(d),_=n(4),E=r(_),p=n(20),g=n(19),R=r(g),y=n(1),C=r(y),T=C.default.getLoger("ConferApe"),S=function(e){function t(){i(this,t);var e=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,h.default.CONFERENCE_SESSION_ID,h.default.CONFERENCE_SESSION_NAME,h.default.CONFERENCE_SESSION_TAG));return e.hostNodeId=-1,e.hostUserId="",e.rosters={},e.activeDocId="",e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(E.default.RCPDU_REG_REGISTER_ROSTER,h.default.CONFERENCE_OBJ_ROSTER_ID,h.default.CONFERENCE_OBJ_ROSTER_NAME,h.default.CONFERENCE_OBJ_ROSTER_TAG,0,new ArrayBuffer),e.registerObj(E.default.RCPDU_REG_REGISTER_QUEUE,h.default.CONFERENCE_OBJ_QUEUE_ID,h.default.CONFERENCE_OBJ_QUEUE_NAME,h.default.CONFERENCE_OBJ_QUEUE_TAG,0,new ArrayBuffer),e.registerObj(E.default.RCPDU_REG_REGISTER_TABLE,h.default.CONFERENCE_OBJ_TABLE_ID,h.default.CONFERENCE_OBJ_TABLE_NAME,h.default.CONFERENCE_OBJ_TABLE_TAG,0,new ArrayBuffer),e.registerObj(E.default.RCPDU_REG_REGISTER_COUNTER,h.default.CONFERENCE_OBJ_COUNTER_ID,h.default.CONFERENCE_OBJ_COUNTER_NAME,h.default.CONFERENCE_OBJ_COUNTER_TAG,0,new ArrayBuffer),e.on(E.default.RCPDU_SESSION_JOIN_RESPONSE,e._joinSessionHandler.bind(e)),e}return o(t,e),a(t,[{key:"_joinSessionHandler",value:function(e){var t=this.mcu.mcuConfInfo.self,n=new E.default.RCNodeInfoUserDataPdu;n.qq="",n.skype="",n.mobile="",t.userData=n.toArrayBuffer(),t.deviceType=3;var r=new E.default.RCRegistryRosterItemPdu;r.nodeId=t.nodeId,r.nodeData=t.toArrayBuffer();var i=new E.default.RCRegistryRosterUpdateItemPdu;i.type=E.default.RCPDU_REG_ROSTER_UPDATE_PDU,i.items.push(r);var s=new E.default.RCRegistryUpdateObjPdu;s.objId=h.default.CONFERENCE_OBJ_ROSTER_ID,s.subType=i.type,s.userData=i.toArrayBuffer();var o=new E.default.RCAdapterItemPdu;o.type=E.default.RCPDU_REG_UPDATE_OBJ,o.itemData=s.toArrayBuffer();var a=new E.default.RCAdapterPdu;a.type=E.default.RCPDU_REG_ADAPTER,a.item.push(o),this.sendUniform(a,!0)}},{key:"tableUpdateHandler",value:function(e,t,n){try{var r=E.default.RCTabUpdateDataRequestPdu.decode(n),i=new p.Zlib.Inflate(r.action.compact().view).decompress(),s=R.default.getStringFromBytes(i),o=s.match(/<TabType>(.+)<\/TabType>/);o.length>1&&"show.docsharing"==o[1]&&"true"==s.match(/<visible>(.+)<\/visible>/)[1]&&(this.activeDocId=s.match(/<TabID>(.+)<\/TabID>/)[1],this._emit(c.default.DOC_SWITCH,this.activeDocId))}catch(e){T.warn("ConferApe table update got exception.")}}},{key:"rosterInsertHandler",value:function(e,t){this.rosterUpdateHandler(e,t)}},{key:"rosterUpdateHandler",value:function(e,t){t.role!==h.default.NR_MASTER&&t.role!==h.default.NR_SLAVE||(this.hostNodeId=t.nodeId,this.hostUserId=t.userId),t.role===h.default.NR_NORMAL&&this.hostNodeId===t.nodeId&&(this.hostNodeId=-1,this.hostUserId="");var n=this.rosters[e];this.rosters[e]=t,n||this.emitRosterChange()}},{key:"rosterDelHandler",value:function(e){delete this.rosters[e],this.emitRosterChange(),e==this._confInfo.nodeId&&this._emit(c.default.CLASS_EXIT)}},{key:"emitRosterChange",value:function(){this._emit(c.default.CLASS_SHOW_ROSTER_NUM,Object.keys(this.rosters).length)}}]),t}(f.default),I=S;t.default=I;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(T,"loger","D:/work/McuClient/src/apes/ConferApe.js"),__REACT_HOT_LOADER__.register(S,"ConferApe","D:/work/McuClient/src/apes/ConferApe.js"),__REACT_HOT_LOADER__.register(I,"default","D:/work/McuClient/src/apes/ConferApe.js"))})()},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){n(this,e)}return r(e,null,[{key:"ab2str",value:function(e){return String.fromCharCode.apply(null,new Uint16Array(e))}},{key:"str2ab",value:function(e){for(var t=new ArrayBuffer(2*e.length),n=new Uint16Array(t),r=0,i=e.length;r<i;r++)n[r]=e.charCodeAt(r);return t}},{key:"strToUint8Array",value:function(e){var t=void 0,n=void 0,r=void 0,i=void 0;t="",r=e.length;var s=[];for(n=0;n<r;n++)i=e.charCodeAt(n),i>=1&&i<=127?s.push(i):i>2047?(s.push(224|i>>12&15),s.push(128|i>>6&63),s.push(128|i>>0&63)):(s.push(192|i>>6&31),s.push(128|i>>0&63));return new Uint8Array(s)}},{key:"uint8ArrayToStr",value:function(e,t){var n=void 0,r=void 0,i=void 0,s=void 0,o=void 0,a=void 0;for(n="",i=e.buffer.byteLength,r=e.offset+t;r<e.limit;)switch(s=e.view[r++],s>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:n+=String.fromCharCode(e.view[r-1]);break;case 12:case 13:o=e.view[r++],n+=String.fromCharCode((31&s)<<6|63&o);break;case 14:o=e.view[r++],a=e.view[r++],n+=String.fromCharCode((15&s)<<12|(63&o)<<6|(63&a)<<0)}return n}}]),e}(),s=i;t.default=s;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(i,"ArrayBufferUtil","D:/work/McuClient/src/libs/ArrayBufferUtil.js"),__REACT_HOT_LOADER__.register(s,"default","D:/work/McuClient/src/libs/ArrayBufferUtil.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(5),f=r(u),l=n(2),h=r(l),d=n(1),c=r(d),_=n(29),E=r(_),p=n(4),g=r(p),R=n(15),y=r(R),C=n(8),T=r(C),S=n(3),I=r(S),m=n(12),v=(r(m),n(13)),b=r(v),A=n(32),O=r(A),N=c.default.getLoger("MCU"),P=function(e){function t(){i(this,t);var e=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._apes={},e._everSocket=E.default,e._everSocket.on(E.default.OPEN,e._everSocketOpenHandler.bind(e)),e._everSocket.on(E.default.MESSAGE,e._everSocketMsgReceivedHandler.bind(e)),e}return o(t,e),a(t,[{key:"registerApe",value:function(e){this._apes[e._session_id]=e}},{key:"_everSocketOpenHandler",value:function(){N.log("MCU-发送加入会议请求.");var e=this.confInfo;e.nodeId=parseInt(Date.now()/1e3);var t=new g.default.RCConferenceJoinRequestPdu;t.type=2,t.initiator=e.nodeId,t.nodeType=T.default.NT_TERMINAL;var n=new g.default.RCConferenceDescriptorPdu;n.id=e.confId,n.name=new ArrayBuffer,n.mode=0,n.capacity=1,t.confDesc=n;var r=g.default.create_connect_provider_request_pdu(t.type,e.nodeId,e.confId,0,I.default.BROADCAST_CHANNEL_ID,!0,T.default.DP_TOP,e.topNodeID,T.default.SEG_ONCE);r.set("site",e.siteId),r.set("userId",e.userId),r.set("userName",O.default.fromByteArray(b.default.strToUint8Array(e.userName))),r.set("userRole",e.userRole),r.set("deviceType",""),r.set("data",t.toArrayBuffer()),this._everSocket.send(r.toArrayBuffer())}},{key:"_everSocketMsgReceivedHandler",value:function(e){var t=g.default.decode_pdu(e),n=t.get("type"),r=t.get("data");switch(N.log("MCU-FirstLayer封装消息","type",g.default.id2type(t.type),t.type,"sessionId",(0,I.default)(t.sessionId),t.sessionId),n){case y.default.RCPDU_CONNECT_PROVIDER_RESPONSE:var i=g.default.RCConferenceJoinResponsePdu.decode(r),s=i.get("result");switch(s){case T.default.RET_SUCCESS:this._updateMCUConfInfoDesc(i.get("confDesc")),this._emit(h.default.CLASS_JOIN_SUCCESS,this.confInfo);break;case T.default.RET_FULL_CAPACITY:this._emit(h.default.CLASS_JOIN_FAILED,h.default.ERROR_CLASS_JOIN_FULL);break;default:N.warn("JoinConfPdu-未知类型-等待处理.",s)}break;case y.default.RCPDU_SEND_DATA_REQUEST:var o=this._apes[t.sessionId],a=(0,I.default)(t.sessionId);if(o){var u=g.default.id2type(t.subType);N.log("MCU-SecondLayer封装消息","sessionId",a,t.sessionId,"subtype",u,t.subType),o._emit(t.subType,t.data)}else N.warn(a+"尚未注册");break;default:N.warn("PDU-未知类型-等待处理.",n)}}},{key:"_updateMCUConfInfoDesc",value:function(e){var t=this.mcuConfInfo.info;t._conference_name=b.default.uint8ArrayToStr(e.name,0),t._capacity=e.capacity,t._mode=e.mode}},{key:"send",value:function(e){this.connected?(N.log("MCU-发送会议数据....",e),this._everSocket.send(e.toArrayBuffer())):N.log("MCU-发送会议数据失败,MCU底层通道不可用")}},{key:"leaveMCU",value:function(){this._everSocket.end()}},{key:"joinMCU",value:function(e){N.log("开始建立EverSocket通道.",e),e.confId=parseInt(e.confId),this.confInfo=e;var t=new g.default.RCNodeInfoRecordPdu;t.name=this.confInfo.userName,t.nodeId=this.confInfo.nodeId,t.userId=this.confInfo.userId,t.role=1,t.level=0;var n={};n._conference_id=this.confInfo.confId,n._top_node_id=this.confInfo.topNodeID,this.mcuConfInfo={},this.mcuConfInfo.self=t,this.mcuConfInfo.info=n,this.confInfo.mcuConfInfo=this.mcuConfInfo,this._everSocket.begin(this.confInfo.MCUServerIP,this.confInfo.MCUServerPort)}},{key:"connected",get:function(){return!(!this._everSocket||!this._everSocket.connected)}}]),t}(f.default),w=new P;
t.default=w;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(N,"loger","D:/work/McuClient/src/mcu.js"),__REACT_HOT_LOADER__.register(P,"MCU","D:/work/McuClient/src/mcu.js"),__REACT_HOT_LOADER__.register(w,"default","D:/work/McuClient/src/mcu.js"))})()},function(e,t){"use strict";function n(e){}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.RCPDU_CONNECT_PROVIDER_REQUEST=0,n.RCPDU_CONNECT_PROVIDER_RESPONSE=1,n.RCPDU_CONFERENCE_JOIN_REQUEST=2,n.RCPDU_CONFERENCE_JOIN_RESPONSE=3,n.RCPDU_CONFERENCE_INVITE_REQUEST=10,n.RCPDU_CONFERENCE_INVITE_RESPONSE=11,n.RCPDU_CONFERENCE_LOCK_REQUEST=20,n.RCPDU_CONFERENCE_LOCK_RESPONSE=21,n.RCPDU_CONFERENCE_LOCK_INDICATION=22,n.RCPDU_CONFERENCE_UNLOCK_REQUEST=30,n.RCPDU_CONFERENCE_UNLOCK_RESPONSE=31,n.RCPDU_CONFERENCE_UNLOCK_INDICATION=32,n.RCPDU_CONFERENCE_LEAVE_REQUEST=39,n.RCPDU_CONFERENCE_TERMINATE_REQUEST=40,n.RCPDU_CONFERENCE_TERMINATE_RESPONSE=41,n.RCPDU_CONFERENCE_TERMINATE_INDICATION=42,n.RCPDU_CONFERENCE_EJECT_USER_REQUEST=50,n.RCPDU_CONFERENCE_EJECT_USER_RESPONSE=51,n.RCPDU_CONFERENCE_EJECT_USER_INDICATION=52,n.RCPDU_ROSTER_UPDATE_INDICATION=60,n.RCPDU_REGISTRY_UPDATE_REQUEST=70,n.RCPDU_REGISTRY_UPDATE_RESPONSE=71,n.RCPDU_REGISTRY_UPDATE_INDICATION=72,n.RCPDU_FUNCTION_NOT_SUPPORTED_RESPONSE=80,n.RCPDU_SESSION_JOIN_REQUEST=90,n.RCPDU_SESSION_JOIN_RESPONSE=91,n.RCPDU_CHANNEL_GRAB_REQUEST=100,n.RCPDU_CHANNEL_GRAB_RESPONSE=101,n.RCPDU_CHANNEL_GRAB_INDICATION=102,n.RCPDU_CHANNEL_JOIN_REQUEST=103,n.RCPDU_CHANNEL_JOIN_RESPONSE=104,n.RCPDU_CHANNEL_LEAVE_REQUEST=105,n.RCPDU_CHANNEL_RELEASE_REQUEST=106,n.RCPDU_CHANNEL_RELEASE_INDICATION=107,n.RCPDU_SEND_DATA_REQUEST=120,n.RCPDU_SEND_DATA_REQUEST=120,n.RCPDU_SEND_DATA_INDICATION=121,n.RCPDU_UNIFORM_SEND_DATA_REQUEST=125,n.RCPDU_UNIFORM_SEND_DATA_INDICATION=126,n.RCPDU_TOKEN_GRAB_REQUEST=130,n.RCPDU_TOKEN_GRAB_CONFIRM=131,n.RCPDU_TOKEN_INHIBIT_REQUEST=132,n.RCPDU_TOKEN_INHIBIT_CONFIRM=133,n.RCPDU_TOKEN_GIVE_REQUEST=134,n.RCPDU_TOKEN_GIVE_INDICATION=135,n.RCPDU_TOKEN_GIVE_RESPONSE=136,n.RCPDU_TOKEN_GIVE_CONFIRM=137,n.RCPDU_TOKEN_PLEASE_REQUEST=138,n.RCPDU_TOKEN_PLEASE_INDICATION=139,n.RCPDU_TOKEN_RELEASE_REQUEST=140,n.RCPDU_TOKEN_RELEASE_CONFIRM=141,n.RCPDU_TOKEN_TEST_REQUEST=142,n.RCPDU_TOKEN_TEST_CONFIRM=143,n.RCPDU_REG_REGISTER_KEY=200,n.RCPDU_REG_UNREGISTER_KEY=201,n.RCPDU_REG_REGISTER_ROSTER=202,n.RCPDU_REG_REGISTER_TOKEN=203,n.RCPDU_REG_REGISTER_PARAMETER=204,n.RCPDU_REG_REGISTER_COUNTER=205,n.RCPDU_REG_REGISTER_TABLE=206,n.RCPDU_REG_REGISTER_CACHE=207,n.RCPDU_REG_REGISTER_OBJ=208,n.RCPDU_REG_UNREGISTER_OBJ=209,n.RCPDU_REG_UPDATE_OBJ=210,n.RCPDU_REG_ADAPTER=211,n.RCPDU_REG_CLEANUP_NODE=212,n.RCPDU_REG_REGISTER_QUEUE=213,n.RCPDU_REG_TABLE_INSERT_PDU=230,n.RCPDU_REG_TABLE_DELETE_PDU=231,n.RCPDU_REG_TABLE_UPDATE_PDU=232,n.RCPDU_REG_ROSTER_INSERT_PDU=240,n.RCPDU_REG_ROSTER_DELETE_PDU=241,n.RCPDU_REG_ROSTER_UPDATE_PDU=242,n.RCPDU_REG_PARAMETER_UPDATE_PDU=250,n.RCPDU_REG_QUEUE_INSERT_PDU=255,n.RCPDU_REG_QUEUE_DELETE_PDU=256,n.RCPDU_REG_QUEUE_UPDATE_PDU=257,n.RCPDU_CONFERENCE_SEND_DATA_REQUEST=259,n.RCPDU_VIDEO_SEND_DATA_REQUEST=260,n.RCPDU_AUDIO_SEND_DATA_REQUEST=261,n.RCPDU_GIFT_SEND_DATA_REQUEST=262,n.RCPDU_CHAT_SEND_DATA_REQUEST=263,n.RCPDU_VOTING_POLL_RECORD=265,n.RCPDU_REG_REQUEST_OBJ=290,n.RCPDU_REG_RESPONSE_OBJ=291,n.RCPDU_REG_COUNTER_REQUEST_PDU=292,n.RCPDU_REG_COUNTER_RESPONSE_PDU=293,n.RCPDU_INDEX_ADAPTER=300,n.RCPDU_INDEX_SERVER_USERS=301,n.RCPDU_INDEX_CONFERENCE_USER_JOINED=302,n.RCPDU_INDEX_CONFERENCE_USER_EXITED=303,n.RCPDU_INDEX_CONFERENCE_USERS=304;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&__REACT_HOT_LOADER__.register(n,"RCPduPackage","D:/work/McuClient/src/pdu/PduType.js")})()},function(e,t,n){var r,i,s;(function(e){!function(o,a){n(9).amd?(i=[n(18)],r=a,s="function"==typeof r?r.apply(t,i):r,!(void 0!==s&&(e.exports=s))):"object"==typeof e&&e&&e.exports?e.exports=function(){var e;try{e=n(18)}catch(e){}return a(e)}():(o.dcodeIO=o.dcodeIO||{}).ByteBuffer=a(o.dcodeIO.Long)}(this,function(e){"use strict";function t(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function n(){var e=[],t=[];return function(){return 0===arguments.length?t.join("")+u.apply(String,e):(e.length+arguments.length>1024&&(t.push(u.apply(String,e)),e.length=0),void Array.prototype.push.apply(e,arguments))}}function r(e,t,n,r,i){var s,o,a=8*i-r-1,u=(1<<a)-1,f=u>>1,l=-7,h=n?i-1:0,d=n?-1:1,c=e[t+h];for(h+=d,s=c&(1<<-l)-1,c>>=-l,l+=a;l>0;s=256*s+e[t+h],h+=d,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=r;l>0;o=256*o+e[t+h],h+=d,l-=8);if(0===s)s=1-f;else{if(s===u)return o?NaN:(c?-1:1)*(1/0);o+=Math.pow(2,r),s-=f}return(c?-1:1)*o*Math.pow(2,s-r)}function i(e,t,n,r,i,s){var o,a,u,f=8*s-i-1,l=(1<<f)-1,h=l>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,c=r?0:s-1,_=r?1:-1,E=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),t+=o+h>=1?d/u:d*Math.pow(2,1-h),t*u>=2&&(o++,u/=2),o+h>=l?(a=0,o=l):o+h>=1?(a=(t*u-1)*Math.pow(2,i),o+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[n+c]=255&a,c+=_,a/=256,i-=8);for(o=o<<i|a,f+=i;f>0;e[n+c]=255&o,c+=_,o/=256,f-=8);e[n+c-_]|=128*E}var s=function(e,t,n){if("undefined"==typeof e&&(e=s.DEFAULT_CAPACITY),"undefined"==typeof t&&(t=s.DEFAULT_ENDIAN),"undefined"==typeof n&&(n=s.DEFAULT_NOASSERT),!n){if(e|=0,e<0)throw RangeError("Illegal capacity");t=!!t,n=!!n}this.buffer=0===e?a:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=t,this.noAssert=n};s.VERSION="5.0.1",s.LITTLE_ENDIAN=!0,s.BIG_ENDIAN=!1,s.DEFAULT_CAPACITY=16,s.DEFAULT_ENDIAN=s.BIG_ENDIAN,s.DEFAULT_NOASSERT=!1,s.Long=e||null;var o=s.prototype;o.__isByteBuffer__,Object.defineProperty(o,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var a=new ArrayBuffer(0),u=String.fromCharCode;s.accessor=function(){return Uint8Array},s.allocate=function(e,t,n){return new s(e,t,n)},s.concat=function(e,t,n,r){"boolean"!=typeof t&&"string"==typeof t||(r=n,n=t,t=void 0);for(var i,o=0,a=0,u=e.length;a<u;++a)s.isByteBuffer(e[a])||(e[a]=s.wrap(e[a],t)),i=e[a].limit-e[a].offset,i>0&&(o+=i);if(0===o)return new s(0,n,r);var f,l=new s(o,n,r);for(a=0;a<u;)f=e[a++],i=f.limit-f.offset,i<=0||(l.view.set(f.view.subarray(f.offset,f.limit),l.offset),l.offset+=i);return l.limit=l.offset,l.offset=0,l},s.isByteBuffer=function(e){return(e&&e.__isByteBuffer__)===!0},s.type=function(){return ArrayBuffer},s.wrap=function(e,t,n,r){if("string"!=typeof t&&(r=n,n=t,t=void 0),"string"==typeof e)switch("undefined"==typeof t&&(t="utf8"),t){case"base64":return s.fromBase64(e,n);case"hex":return s.fromHex(e,n);case"binary":return s.fromBinary(e,n);case"utf8":return s.fromUTF8(e,n);case"debug":return s.fromDebug(e,n);default:throw Error("Unsupported encoding: "+t)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");var i;if(s.isByteBuffer(e))return i=o.clone.call(e),i.markedOffset=-1,i;if(e instanceof Uint8Array)i=new s(0,n,r),e.length>0&&(i.buffer=e.buffer,i.offset=e.byteOffset,i.limit=e.byteOffset+e.byteLength,i.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)i=new s(0,n,r),e.byteLength>0&&(i.buffer=e,i.offset=0,i.limit=e.byteLength,i.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");i=new s(e.length,n,r),i.limit=e.length;for(var a=0;a<e.length;++a)i.view[a]=e[a]}return i},o.writeBitSet=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if(!(e instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,i=t,s=e.length,o=s>>3,a=0;for(t+=this.writeVarint32(s,t);o--;)r=1&!!e[a++]|(1&!!e[a++])<<1|(1&!!e[a++])<<2|(1&!!e[a++])<<3|(1&!!e[a++])<<4|(1&!!e[a++])<<5|(1&!!e[a++])<<6|(1&!!e[a++])<<7,this.writeByte(r,t++);if(a<s){var u=0;for(r=0;a<s;)r|=(1&!!e[a++])<<u++;this.writeByte(r,t++)}return n?(this.offset=t,this):t-i},o.readBitSet=function(e){var t="undefined"==typeof e;t&&(e=this.offset);var n,r=this.readVarint32(e),i=r.value,s=i>>3,o=0,a=[];for(e+=r.length;s--;)n=this.readByte(e++),a[o++]=!!(1&n),a[o++]=!!(2&n),a[o++]=!!(4&n),a[o++]=!!(8&n),a[o++]=!!(16&n),a[o++]=!!(32&n),a[o++]=!!(64&n),a[o++]=!!(128&n);if(o<i){var u=0;for(n=this.readByte(e++);o<i;)a[o++]=!!(n>>u++&1)}return t&&(this.offset=e),a},o.readBytes=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}var r=this.slice(t,t+e);return n&&(this.offset+=e),r},o.writeBytes=o.append,o.writeInt8=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=1,this.view[t]=e,n&&(this.offset+=1),this},o.writeByte=o.writeInt8,o.readInt8=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=this.view[e];return 128===(128&n)&&(n=-(255-n+1)),t&&(this.offset+=1),n},o.readByte=o.readInt8,o.writeUint8=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=1,this.view[t]=e,n&&(this.offset+=1),this},o.writeUInt8=o.writeUint8,o.readUint8=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=this.view[e];return t&&(this.offset+=1),n},o.readUInt8=o.readUint8,o.writeInt16=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),n&&(this.offset+=2),this},o.writeShort=o.writeInt16,o.readInt16=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e],n|=this.view[e+1]<<8):(n=this.view[e]<<8,n|=this.view[e+1]),32768===(32768&n)&&(n=-(65535-n+1)),t&&(this.offset+=2),n},o.readShort=o.readInt16,o.writeUint16=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),n&&(this.offset+=2),this},o.writeUInt16=o.writeUint16,o.readUint16=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e],n|=this.view[e+1]<<8):(n=this.view[e]<<8,n|=this.view[e+1]),t&&(this.offset+=2),n},o.readUInt16=o.readUint16,o.writeInt32=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),n&&(this.offset+=4),this},o.writeInt=o.writeInt32,o.readInt32=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0):(n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0),n|=0,t&&(this.offset+=4),n},o.readInt=o.readInt32,o.writeUint32=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),n&&(this.offset+=4),this},o.writeUInt32=o.writeUint32,o.readUint32=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0):(n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0),t&&(this.offset+=4),n},o.readUInt32=o.readUint32,e&&(o.writeInt64=function(t,n){var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),n+=8;var i=this.buffer.byteLength;n>i&&this.resize((i*=2)>n?i:n),n-=8;var s=t.low,o=t.high;return this.littleEndian?(this.view[n+3]=s>>>24&255,this.view[n+2]=s>>>16&255,this.view[n+1]=s>>>8&255,this.view[n]=255&s,n+=4,this.view[n+3]=o>>>24&255,this.view[n+2]=o>>>16&255,this.view[n+1]=o>>>8&255,this.view[n]=255&o):(this.view[n]=o>>>24&255,this.view[n+1]=o>>>16&255,this.view[n+2]=o>>>8&255,this.view[n+3]=255&o,n+=4,this.view[n]=s>>>24&255,this.view[n+1]=s>>>16&255,this.view[n+2]=s>>>8&255,this.view[n+3]=255&s),r&&(this.offset+=8),this},o.writeLong=o.writeInt64,o.readInt64=function(t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var r=0,i=0;this.littleEndian?(r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0,t+=4,i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0,t+=4,r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0);var s=new e(r,i,!1);return n&&(this.offset+=8),s},o.readLong=o.readInt64,o.writeUint64=function(t,n){var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),n+=8;var i=this.buffer.byteLength;n>i&&this.resize((i*=2)>n?i:n),n-=8;var s=t.low,o=t.high;return this.littleEndian?(this.view[n+3]=s>>>24&255,this.view[n+2]=s>>>16&255,this.view[n+1]=s>>>8&255,this.view[n]=255&s,n+=4,this.view[n+3]=o>>>24&255,this.view[n+2]=o>>>16&255,this.view[n+1]=o>>>8&255,this.view[n]=255&o):(this.view[n]=o>>>24&255,this.view[n+1]=o>>>16&255,this.view[n+2]=o>>>8&255,this.view[n+3]=255&o,n+=4,this.view[n]=s>>>24&255,this.view[n+1]=s>>>16&255,this.view[n+2]=s>>>8&255,this.view[n+3]=255&s),r&&(this.offset+=8),this},o.writeUInt64=o.writeUint64,o.readUint64=function(t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var r=0,i=0;this.littleEndian?(r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0,t+=4,i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0,t+=4,r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0);var s=new e(r,i,!0);return n&&(this.offset+=8),s},o.readUInt64=o.readUint64),o.writeFloat32=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,i(this.view,e,t,this.littleEndian,23,4),n&&(this.offset+=4),this},o.writeFloat=o.writeFloat32,o.readFloat32=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=r(this.view,e,this.littleEndian,23,4);return t&&(this.offset+=4),n},o.readFloat=o.readFloat32,o.writeFloat64=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=8;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=8,i(this.view,e,t,this.littleEndian,52,8),n&&(this.offset+=8),this},o.writeDouble=o.writeFloat64,o.readFloat64=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var n=r(this.view,e,this.littleEndian,52,8);return t&&(this.offset+=8),n},o.readDouble=o.readFloat64,s.MAX_VARINT32_BYTES=5,s.calculateVarint32=function(e){return e>>>=0,e<128?1:e<16384?2:e<1<<21?3:e<1<<28?4:5},s.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},s.zigZagDecode32=function(e){return e>>>1^-(1&e)|0},o.writeVarint32=function(e,t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,i=s.calculateVarint32(e);t+=i;var o=this.buffer.byteLength;for(t>o&&this.resize((o*=2)>t?o:t),t-=i,e>>>=0;e>=128;)r=127&e|128,this.view[t++]=r,e>>>=7;return this.view[t++]=e,n?(this.offset=t,this):i},o.writeVarint32ZigZag=function(e,t){return this.writeVarint32(s.zigZagEncode32(e),t)},o.readVarint32=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n,r=0,i=0;do{if(!this.noAssert&&e>this.limit){var s=Error("Truncated");throw s.truncated=!0,s}n=this.view[e++],r<5&&(i|=(127&n)<<7*r),++r}while(0!==(128&n));return i|=0,t?(this.offset=e,i):{value:i,length:r}},o.readVarint32ZigZag=function(e){var t=this.readVarint32(e);return"object"==typeof t?t.value=s.zigZagDecode32(t.value):t=s.zigZagDecode32(t),t},e&&(s.MAX_VARINT64_BYTES=10,s.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var n=t.toInt()>>>0,r=t.shiftRightUnsigned(28).toInt()>>>0,i=t.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==r?n<16384?n<128?1:2:n<1<<21?3:4:r<16384?r<128?5:6:r<1<<21?7:8:i<128?9:10},s.zigZagEncode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):t.unsigned!==!1&&(t=t.toSigned()),t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()},s.zigZagDecode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):t.unsigned!==!1&&(t=t.toSigned()),t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()},o.writeVarint64=function(t,n){var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):t.unsigned!==!1&&(t=t.toSigned());var i=s.calculateVarint64(t),o=t.toInt()>>>0,a=t.shiftRightUnsigned(28).toInt()>>>0,u=t.shiftRightUnsigned(56).toInt()>>>0;n+=i;var f=this.buffer.byteLength;switch(n>f&&this.resize((f*=2)>n?f:n),n-=i,i){case 10:this.view[n+9]=u>>>7&1;case 9:this.view[n+8]=9!==i?128|u:127&u;case 8:this.view[n+7]=8!==i?a>>>21|128:a>>>21&127;case 7:this.view[n+6]=7!==i?a>>>14|128:a>>>14&127;case 6:this.view[n+5]=6!==i?a>>>7|128:a>>>7&127;case 5:this.view[n+4]=5!==i?128|a:127&a;case 4:this.view[n+3]=4!==i?o>>>21|128:o>>>21&127;case 3:this.view[n+2]=3!==i?o>>>14|128:o>>>14&127;case 2:this.view[n+1]=2!==i?o>>>7|128:o>>>7&127;case 1:this.view[n]=1!==i?128|o:127&o}return r?(this.offset+=i,this):i},o.writeVarint64ZigZag=function(e,t){return this.writeVarint64(s.zigZagEncode64(e),t)},o.readVarint64=function(t){var n="undefined"==typeof t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r=t,i=0,s=0,o=0,a=0;if(a=this.view[t++],i=127&a,128&a&&(a=this.view[t++],i|=(127&a)<<7,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],i|=(127&a)<<14,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],i|=(127&a)<<21,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],s=127&a,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],s|=(127&a)<<7,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],s|=(127&a)<<14,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],s|=(127&a)<<21,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],o=127&a,(128&a||this.noAssert&&"undefined"==typeof a)&&(a=this.view[t++],o|=(127&a)<<7,128&a||this.noAssert&&"undefined"==typeof a))))))))))throw Error("Buffer overrun");var u=e.fromBits(i|s<<28,s>>>4|o<<24,!1);return n?(this.offset=t,u):{value:u,length:t-r}},o.readVarint64ZigZag=function(t){var n=this.readVarint64(t);return n&&n.value instanceof e?n.value=s.zigZagDecode64(n.value):n=s.zigZagDecode64(n),n}),o.writeCString=function(e,n){var r="undefined"==typeof n;r&&(n=this.offset);var i,s=e.length;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(i=0;i<s;++i)if(0===e.charCodeAt(i))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}s=l.calculateUTF16asUTF8(t(e))[1],n+=s+1;var o=this.buffer.byteLength;return n>o&&this.resize((o*=2)>n?o:n),n-=s+1,l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),this.view[n++]=0,r?(this.offset=n,this):s},o.readCString=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r,i=e,s=-1;return l.decodeUTF8toUTF16(function(){if(0===s)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return s=this.view[e++],0===s?null:s}.bind(this),r=n(),!0),t?(this.offset=e,r()):{string:r(),length:e-i}},o.writeIString=function(e,n){var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,s=n;i=l.calculateUTF16asUTF8(t(e),this.noAssert)[1],n+=4+i;var o=this.buffer.byteLength;if(n>o&&this.resize((o*=2)>n?o:n),n-=4+i,this.littleEndian?(this.view[n+3]=i>>>24&255,this.view[n+2]=i>>>16&255,this.view[n+1]=i>>>8&255,this.view[n]=255&i):(this.view[n]=i>>>24&255,this.view[n+1]=i>>>16&255,this.view[n+2]=i>>>8&255,this.view[n+3]=255&i),n+=4,l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==s+4+i)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+4+i));return r?(this.offset=n,this):n-s},o.readIString=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=e,r=this.readUint32(e),i=this.readUTF8String(r,s.METRICS_BYTES,e+=4);return e+=i.length,t?(this.offset=e,i.string):{string:i.string,length:e-n}},s.METRICS_CHARS="c",s.METRICS_BYTES="b",o.writeUTF8String=function(e,n){var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,s=n;i=l.calculateUTF16asUTF8(t(e))[1],n+=i;var o=this.buffer.byteLength;return n>o&&this.resize((o*=2)>n?o:n),n-=i,l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),r?(this.offset=n,this):n-s},o.writeString=o.writeUTF8String,s.calculateUTF8Chars=function(e){return l.calculateUTF16asUTF8(t(e))[0]},s.calculateUTF8Bytes=function(e){return l.calculateUTF16asUTF8(t(e))[1]},s.calculateString=s.calculateUTF8Bytes,o.readUTF8String=function(e,t,r){"number"==typeof t&&(r=t,t=void 0);var i="undefined"==typeof r;if(i&&(r=this.offset),"undefined"==typeof t&&(t=s.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||r%1!==0)throw TypeError("Illegal offset: "+r+" (not an integer)");if(r>>>=0,r<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var o,a=0,u=r;if(t===s.METRICS_CHARS){if(o=n(),l.decodeUTF8(function(){return a<e&&r<this.limit?this.view[r++]:null}.bind(this),function(e){++a,l.UTF8toUTF16(e,o)}),a!==e)throw RangeError("Illegal range: Truncated data, "+a+" == "+e);return i?(this.offset=r,o()):{string:o(),length:r-u}}if(t===s.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof r||r%1!==0)throw TypeError("Illegal offset: "+r+" (not an integer)");if(r>>>=0,r<0||r+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+e+") <= "+this.buffer.byteLength)}var f=r+e;if(l.decodeUTF8toUTF16(function(){return r<f?this.view[r++]:null}.bind(this),o=n(),this.noAssert),r!==f)throw RangeError("Illegal range: Truncated data, "+r+" == "+f);return i?(this.offset=r,o()):{string:o(),length:r-u}}throw TypeError("Unsupported metrics: "+t)},o.readString=o.readUTF8String,o.writeVString=function(e,n){var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,o,a=n;i=l.calculateUTF16asUTF8(t(e),this.noAssert)[1],o=s.calculateVarint32(i),n+=o+i;var u=this.buffer.byteLength;if(n>u&&this.resize((u*=2)>n?u:n),n-=o+i,n+=this.writeVarint32(i,n),l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==a+i+o)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+i+o));return r?(this.offset=n,this):n-a},o.readVString=function(e){var t="undefined"==typeof e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");
if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=e,r=this.readVarint32(e),i=this.readUTF8String(r.value,s.METRICS_BYTES,e+=r.length);return e+=i.length,t?(this.offset=e,i.string):{string:i.string,length:e-n}},o.append=function(e,t,n){"number"!=typeof t&&"string"==typeof t||(n=t,t=void 0);var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}e instanceof s||(e=s.wrap(e,t));var i=e.limit-e.offset;if(i<=0)return this;n+=i;var o=this.buffer.byteLength;return n>o&&this.resize((o*=2)>n?o:n),n-=i,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=i,r&&(this.offset+=i),this},o.appendTo=function(e,t){return e.append(this,t),this},o.assert=function(e){return this.noAssert=!e,this},o.capacity=function(){return this.buffer.byteLength},o.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},o.clone=function(e){var t=new s(0,this.littleEndian,this.noAssert);return e?(t.buffer=new ArrayBuffer(this.buffer.byteLength),t.view=new Uint8Array(t.buffer)):(t.buffer=this.buffer,t.view=this.view),t.offset=this.offset,t.markedOffset=this.markedOffset,t.limit=this.limit,t},o.compact=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(0===e&&t===this.buffer.byteLength)return this;var n=t-e;if(0===n)return this.buffer=a,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this;var r=new ArrayBuffer(n),i=new Uint8Array(r);return i.set(this.view.subarray(e,t)),this.buffer=r,this.view=i,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=n,this},o.copy=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(e===t)return new s(0,this.littleEndian,this.noAssert);var n=t-e,r=new s(n,this.littleEndian,this.noAssert);return r.offset=0,r.limit=n,r.markedOffset>=0&&(r.markedOffset-=e),this.copyTo(r,0,e,t),r},o.copyTo=function(e,t,n,r){var i,o;if(!this.noAssert&&!s.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(o="undefined"==typeof t)?e.offset:0|t,n=(i="undefined"==typeof n)?this.offset:0|n,r="undefined"==typeof r?this.limit:0|r,t<0||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(n<0||r>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);var a=r-n;return 0===a?e:(e.ensureCapacity(t+a),e.view.set(this.view.subarray(n,r),t),i&&(this.offset+=a),o&&(e.offset+=a),this)},o.ensureCapacity=function(e){var t=this.buffer.byteLength;return t<e?this.resize((t*=2)>e?t:e):this},o.fill=function(e,t,n){var r="undefined"==typeof t;if(r&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),"undefined"==typeof t&&(t=this.offset),"undefined"==typeof n&&(n=this.limit),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!==0)throw TypeError("Illegal end: Not an integer");if(n>>>=0,t<0||t>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(t>=n)return this;for(;t<n;)this.view[t++]=e;return r&&(this.offset=t),this},o.flip=function(){return this.limit=this.offset,this.offset=0,this},o.mark=function(e){if(e="undefined"==typeof e?this.offset:e,!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=e,this},o.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},o.LE=function(e){return this.littleEndian="undefined"==typeof e||!!e,this},o.BE=function(e){return this.littleEndian="undefined"!=typeof e&&!e,this},o.prepend=function(e,t,n){"number"!=typeof t&&"string"==typeof t||(n=t,t=void 0);var r="undefined"==typeof n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!==0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}e instanceof s||(e=s.wrap(e,t));var i=e.limit-e.offset;if(i<=0)return this;var o=i-n;if(o>0){var a=new ArrayBuffer(this.buffer.byteLength+o),u=new Uint8Array(a);u.set(this.view.subarray(n,this.buffer.byteLength),i),this.buffer=a,this.view=u,this.offset+=o,this.markedOffset>=0&&(this.markedOffset+=o),this.limit+=o,n+=o}else{new Uint8Array(this.buffer)}return this.view.set(e.view.subarray(e.offset,e.limit),n-i),e.offset=e.limit,r&&(this.offset-=i),this},o.prependTo=function(e,t){return e.prepend(this,t),this},o.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},o.remaining=function(){return this.limit-this.offset},o.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},o.resize=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if(e|=0,e<0)throw RangeError("Illegal capacity: 0 <= "+e)}if(this.buffer.byteLength<e){var t=new ArrayBuffer(e),n=new Uint8Array(t);n.set(this.view),this.buffer=t,this.view=n}return this},o.reverse=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t?this:(Array.prototype.reverse.call(this.view.subarray(e,t)),this)},o.skip=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(t<0||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},o.slice=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var n=this.clone();return n.offset=e,n.limit=t,n},o.toBuffer=function(e){var t=this.offset,n=this.limit;if(!this.noAssert){if("number"!=typeof t||t%1!==0)throw TypeError("Illegal offset: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!==0)throw TypeError("Illegal limit: Not an integer");if(n>>>=0,t<0||t>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(!e&&0===t&&n===this.buffer.byteLength)return this.buffer;if(t===n)return a;var r=new ArrayBuffer(n-t);return new Uint8Array(r).set(new Uint8Array(this.buffer).subarray(t,n),0),r},o.toArrayBuffer=o.toBuffer,o.toString=function(e,t,n){if("undefined"==typeof e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(e="utf8",t=e,n=t),e){case"utf8":return this.toUTF8(t,n);case"base64":return this.toBase64(t,n);case"hex":return this.toHex(t,n);case"binary":return this.toBinary(t,n);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}};var f=function(){for(var e={},t=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],n=[],r=0,i=t.length;r<i;++r)n[t[r]]=r;return e.encode=function(e,n){for(var r,i;null!==(r=e());)n(t[r>>2&63]),i=(3&r)<<4,null!==(r=e())?(i|=r>>4&15,n(t[63&(i|r>>4&15)]),i=(15&r)<<2,null!==(r=e())?(n(t[63&(i|r>>6&3)]),n(t[63&r])):(n(t[63&i]),n(61))):(n(t[63&i]),n(61),n(61))},e.decode=function(e,t){function r(e){throw Error("Illegal character code: "+e)}for(var i,s,o;null!==(i=e());)if(s=n[i],"undefined"==typeof s&&r(i),null!==(i=e())&&(o=n[i],"undefined"==typeof o&&r(i),t(s<<2>>>0|(48&o)>>4),null!==(i=e()))){if(s=n[i],"undefined"==typeof s){if(61===i)break;r(i)}if(t((15&o)<<4>>>0|(60&s)>>2),null!==(i=e())){if(o=n[i],"undefined"==typeof o){if(61===i)break;r(i)}t((3&s)<<6>>>0|o)}}},e.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)},e}();o.toBase64=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),e|=0,t|=0,e<0||t>this.capacity||e>t)throw RangeError("begin, end");var r;return f.encode(function(){return e<t?this.view[e++]:null}.bind(this),r=n()),r()},s.fromBase64=function(e,n){if("string"!=typeof e)throw TypeError("str");var r=new s(e.length/4*3,n),i=0;return f.decode(t(e),function(e){r.view[i++]=e}),r.limit=i,r},s.btoa=function(e){return s.fromBinary(e).toBase64()},s.atob=function(e){return s.fromBase64(e).toBinary()},o.toBinary=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),e|=0,t|=0,e<0||t>this.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var n=[],r=[];e<t;)n.push(this.view[e++]),n.length>=1024&&(r.push(String.fromCharCode.apply(String,n)),n=[]);return r.join("")+String.fromCharCode.apply(String,n)},s.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var n,r=0,i=e.length,o=new s(i,t);r<i;){if(n=e.charCodeAt(r),n>255)throw RangeError("illegal char code: "+n);o.view[r++]=n}return o.limit=i,o},o.toDebug=function(e){for(var t,n=-1,r=this.buffer.byteLength,i="",s="",o="";n<r;){if(n!==-1&&(t=this.view[n],i+=t<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(s+=t>32&&t<127?String.fromCharCode(t):".")),++n,e&&n>0&&n%16===0&&n!==r){for(;i.length<51;)i+=" ";o+=i+s+"\n",i=s=""}i+=n===this.offset&&n===this.limit?n===this.markedOffset?"!":"|":n===this.offset?n===this.markedOffset?"[":"<":n===this.limit?n===this.markedOffset?"]":">":n===this.markedOffset?"'":e||0!==n&&n!==r?" ":""}if(e&&" "!==i){for(;i.length<51;)i+=" ";o+=i+s+"\n"}return e?o:i},s.fromDebug=function(e,t,n){for(var r,i,o=e.length,a=new s((o+1)/3|0,t,n),u=0,f=0,l=!1,h=!1,d=!1,c=!1,_=!1;u<o;){switch(r=e.charAt(u++)){case"!":if(!n){if(h||d||c){_=!0;break}h=d=c=!0}a.offset=a.markedOffset=a.limit=f,l=!1;break;case"|":if(!n){if(h||c){_=!0;break}h=c=!0}a.offset=a.limit=f,l=!1;break;case"[":if(!n){if(h||d){_=!0;break}h=d=!0}a.offset=a.markedOffset=f,l=!1;break;case"<":if(!n){if(h){_=!0;break}h=!0}a.offset=f,l=!1;break;case"]":if(!n){if(c||d){_=!0;break}c=d=!0}a.limit=a.markedOffset=f,l=!1;break;case">":if(!n){if(c){_=!0;break}c=!0}a.limit=f,l=!1;break;case"'":if(!n){if(d){_=!0;break}d=!0}a.markedOffset=f,l=!1;break;case" ":l=!1;break;default:if(!n&&l){_=!0;break}if(i=parseInt(r+e.charAt(u++),16),!n&&(isNaN(i)||i<0||i>255))throw TypeError("Illegal str: Not a debug encoded string");a.view[f++]=i,l=!0}if(_)throw TypeError("Illegal str: Invalid symbol at "+u)}if(!n){if(!h||!c)throw TypeError("Illegal str: Missing offset or limit");if(f<a.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+f+" < "+o)}return a},o.toHex=function(e,t){if(e="undefined"==typeof e?this.offset:e,t="undefined"==typeof t?this.limit:t,!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var n,r=new Array(t-e);e<t;)n=this.view[e++],n<16?r.push("0",n.toString(16)):r.push(n.toString(16));return r.join("")},s.fromHex=function(e,t,n){if(!n){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if(e.length%2!==0)throw TypeError("Illegal str: Length not a multiple of 2")}for(var r,i=e.length,o=new s(i/2|0,t),a=0,u=0;a<i;a+=2){if(r=parseInt(e.substring(a,a+2),16),!n&&(!isFinite(r)||r<0||r>255))throw TypeError("Illegal str: Contains non-hex characters");o.view[u++]=r}return o.limit=u,o};var l=function(){var e={};return e.MAX_CODEPOINT=1114111,e.encodeUTF8=function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<128?t(127&n):n<2048?(t(n>>6&31|192),t(63&n|128)):n<65536?(t(n>>12&15|224),t(n>>6&63|128),t(63&n|128)):(t(n>>18&7|240),t(n>>12&63|128),t(n>>6&63|128),t(63&n|128)),n=null},e.decodeUTF8=function(e,t){for(var n,r,i,s,o=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(n=e());)if(0===(128&n))t(n);else if(192===(224&n))null===(r=e())&&o([n,r]),t((31&n)<<6|63&r);else if(224===(240&n))(null===(r=e())||null===(i=e()))&&o([n,r,i]),t((15&n)<<12|(63&r)<<6|63&i);else{if(240!==(248&n))throw RangeError("Illegal starting byte: "+n);(null===(r=e())||null===(i=e())||null===(s=e()))&&o([n,r,i,s]),t((7&n)<<18|(63&r)<<12|(63&i)<<6|63&s)}},e.UTF16toUTF8=function(e,t){for(var n,r=null;;){if(null===(n=null!==r?r:e()))break;n>=55296&&n<=57343&&null!==(r=e())&&r>=56320&&r<=57343?(t(1024*(n-55296)+r-56320+65536),r=null):t(n)}null!==r&&t(r)},e.UTF8toUTF16=function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<=65535?t(n):(n-=65536,t((n>>10)+55296),t(n%1024+56320)),n=null},e.encodeUTF16toUTF8=function(t,n){e.UTF16toUTF8(t,function(t){e.encodeUTF8(t,n)})},e.decodeUTF8toUTF16=function(t,n){e.decodeUTF8(t,function(t){e.UTF8toUTF16(t,n)})},e.calculateCodePoint=function(e){return e<128?1:e<2048?2:e<65536?3:4},e.calculateUTF8=function(e){for(var t,n=0;null!==(t=e());)n+=t<128?1:t<2048?2:t<65536?3:4;return n},e.calculateUTF16asUTF8=function(t){var n=0,r=0;return e.UTF16toUTF8(t,function(e){++n,r+=e<128?1:e<2048?2:e<65536?3:4}),[n,r]},e}();return o.toUTF8=function(e,t){if("undefined"==typeof e&&(e=this.offset),"undefined"==typeof t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!==0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!==0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r;try{l.decodeUTF8toUTF16(function(){return e<t?this.view[e++]:null}.bind(this),r=n())}catch(n){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return r()},s.fromUTF8=function(e,n,r){if(!r&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var i=new s(l.calculateUTF16asUTF8(t(e),!0)[1],n,r),o=0;return l.encodeUTF16toUTF8(t(e),function(e){i.view[o++]=e}),i.limit=o,i},s})}).call(t,n(7)(e))},function(e,t){var n={utf8:{stringToBytes:function(e){return n.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(n.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}};e.exports=n},function(e,t,n){var r,i,s;(function(e){!function(o,a){n(9).amd?(i=[],r=a,s="function"==typeof r?r.apply(t,i):r,!(void 0!==s&&(e.exports=s))):"object"==typeof e&&e&&e.exports?e.exports=a():(o.dcodeIO=o.dcodeIO||{}).Long=a()}(this,function(){"use strict";function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return(e&&e.__isLong__)===!0}function n(e,t){var n,r,s;return t?(e>>>=0,(s=0<=e&&e<256)&&(r=u[e])?r:(n=i(e,(0|e)<0?-1:0,!0),s&&(u[e]=n),n)):(e|=0,(s=-128<=e&&e<128)&&(r=a[e])?r:(n=i(e,e<0?-1:0,!1),s&&(a[e]=n),n))}function r(e,t){if(isNaN(e)||!isFinite(e))return t?p:E;if(t){if(e<0)return p;if(e>=d)return T}else{if(e<=-c)return S;if(e+1>=c)return C}return e<0?r(-e,t).neg():i(e%h|0,e/h|0,t)}function i(t,n,r){return new e(t,n,r)}function s(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return E;if("number"==typeof t?(n=t,t=!1):t=!!t,n=n||10,n<2||36<n)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return s(e.substring(1),t,n).neg();for(var o=r(f(n,8)),a=E,u=0;u<e.length;u+=8){var l=Math.min(8,e.length-u),h=parseInt(e.substring(u,u+l),n);if(l<8){var d=r(f(n,l));a=a.mul(d).add(r(h))}else a=a.mul(o),a=a.add(r(h))}return a.unsigned=t,a}function o(t){return t instanceof e?t:"number"==typeof t?r(t):"string"==typeof t?s(t):i(t.low,t.high,t.unsigned)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var a={},u={};e.fromInt=n,e.fromNumber=r,e.fromBits=i;var f=Math.pow;e.fromString=s,e.fromValue=o;var l=1<<24,h=4294967296,d=0x10000000000000000,c=d/2,_=n(l),E=n(0);e.ZERO=E;var p=n(0,!0);e.UZERO=p;var g=n(1);e.ONE=g;var R=n(1,!0);e.UONE=R;var y=n(-1);e.NEG_ONE=y;var C=i(-1,2147483647,!1);e.MAX_VALUE=C;var T=i(-1,-1,!0);e.MAX_UNSIGNED_VALUE=T;var S=i(0,-2147483648,!1);e.MIN_VALUE=S;var I=e.prototype;return I.toInt=function(){return this.unsigned?this.low>>>0:this.low},I.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},I.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(S)){var t=r(e),n=this.div(t),i=n.mul(t).sub(this);return n.toString(e)+i.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var s=r(f(e,6),this.unsigned),o=this,a="";;){var u=o.div(s),l=o.sub(u.mul(s)).toInt()>>>0,h=l.toString(e);if(o=u,o.isZero())return h+a;for(;h.length<6;)h="0"+h;a=""+h+a}},I.getHighBits=function(){return this.high},I.getHighBitsUnsigned=function(){return this.high>>>0},I.getLowBits=function(){return this.low},I.getLowBitsUnsigned=function(){return this.low>>>0},I.getNumBitsAbs=function(){if(this.isNegative())return this.eq(S)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},I.isZero=function(){return 0===this.high&&0===this.low},I.isNegative=function(){return!this.unsigned&&this.high<0},I.isPositive=function(){return this.unsigned||this.high>=0},I.isOdd=function(){return 1===(1&this.low)},I.isEven=function(){return 0===(1&this.low)},I.equals=function(e){return t(e)||(e=o(e)),(this.unsigned===e.unsigned||this.high>>>31!==1||e.high>>>31!==1)&&(this.high===e.high&&this.low===e.low)},I.eq=I.equals,I.notEquals=function(e){return!this.eq(e)},I.neq=I.notEquals,I.lessThan=function(e){return this.comp(e)<0},I.lt=I.lessThan,I.lessThanOrEqual=function(e){return this.comp(e)<=0},I.lte=I.lessThanOrEqual,I.greaterThan=function(e){return this.comp(e)>0},I.gt=I.greaterThan,I.greaterThanOrEqual=function(e){return this.comp(e)>=0},I.gte=I.greaterThanOrEqual,I.compare=function(e){if(t(e)||(e=o(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},I.comp=I.compare,I.negate=function(){return!this.unsigned&&this.eq(S)?S:this.not().add(g)},I.neg=I.negate,I.add=function(e){t(e)||(e=o(e));var n=this.high>>>16,r=65535&this.high,s=this.low>>>16,a=65535&this.low,u=e.high>>>16,f=65535&e.high,l=e.low>>>16,h=65535&e.low,d=0,c=0,_=0,E=0;return E+=a+h,_+=E>>>16,E&=65535,_+=s+l,c+=_>>>16,_&=65535,c+=r+f,d+=c>>>16,c&=65535,d+=n+u,d&=65535,i(_<<16|E,d<<16|c,this.unsigned)},I.subtract=function(e){return t(e)||(e=o(e)),this.add(e.neg())},I.sub=I.subtract,I.multiply=function(e){if(this.isZero())return E;if(t(e)||(e=o(e)),e.isZero())return E;if(this.eq(S))return e.isOdd()?S:E;if(e.eq(S))return this.isOdd()?S:E;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(_)&&e.lt(_))return r(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,s=65535&this.high,a=this.low>>>16,u=65535&this.low,f=e.high>>>16,l=65535&e.high,h=e.low>>>16,d=65535&e.low,c=0,p=0,g=0,R=0;return R+=u*d,g+=R>>>16,R&=65535,g+=a*d,p+=g>>>16,g&=65535,g+=u*h,p+=g>>>16,g&=65535,p+=s*d,c+=p>>>16,p&=65535,p+=a*h,c+=p>>>16,p&=65535,p+=u*l,c+=p>>>16,p&=65535,c+=n*d+s*h+a*l+u*f,c&=65535,i(g<<16|R,c<<16|p,this.unsigned)},I.mul=I.multiply,I.divide=function(e){if(t(e)||(e=o(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?p:E;var n,i,s;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return p;if(e.gt(this.shru(1)))return R;s=p}else{if(this.eq(S)){if(e.eq(g)||e.eq(y))return S;if(e.eq(S))return g;var a=this.shr(1);return n=a.div(e).shl(1),n.eq(E)?e.isNegative()?g:y:(i=this.sub(e.mul(n)),s=n.add(i.div(e)))}if(e.eq(S))return this.unsigned?p:E;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=E}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var u=Math.ceil(Math.log(n)/Math.LN2),l=u<=48?1:f(2,u-48),h=r(n),d=h.mul(e);d.isNegative()||d.gt(i);)n-=l,h=r(n,this.unsigned),d=h.mul(e);h.isZero()&&(h=g),s=s.add(h),i=i.sub(d)}return s},I.div=I.divide,I.modulo=function(e){return t(e)||(e=o(e)),this.sub(this.div(e).mul(e))},I.mod=I.modulo,I.not=function(){return i(~this.low,~this.high,this.unsigned)},I.and=function(e){return t(e)||(e=o(e)),i(this.low&e.low,this.high&e.high,this.unsigned)},I.or=function(e){return t(e)||(e=o(e)),i(this.low|e.low,this.high|e.high,this.unsigned)},I.xor=function(e){return t(e)||(e=o(e)),i(this.low^e.low,this.high^e.high,this.unsigned)},I.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0===(e&=63)?this:e<32?i(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):i(0,this.low<<e-32,this.unsigned)},I.shl=I.shiftLeft,I.shiftRight=function(e){return t(e)&&(e=e.toInt()),0===(e&=63)?this:e<32?i(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):i(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},I.shr=I.shiftRight,I.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),e&=63,0===e)return this;var n=this.high;if(e<32){var r=this.low;return i(r>>>e|n<<32-e,n>>>e,this.unsigned)}return 32===e?i(n,0,this.unsigned):i(n>>>e-32,0,this.unsigned)},I.shru=I.shiftRightUnsigned,I.toSigned=function(){return this.unsigned?i(this.low,this.high,!1):this},I.toUnsigned=function(){return this.unsigned?this:i(this.low,this.high,!0)},I.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},I.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},I.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})}).call(t,n(7)(e))},function(e,t,n){(function(e){e.require&&(n(37),n(38));var t={isNotUTF8:function(e,n,r){try{t.getStringFromBytes(e,n,r,!0)}catch(e){return!0}return!1},getCharLength:function(e){return 240==(240&e)?4:224==(224&e)?3:192==(192&e)?2:e==(127&e)?1:0},getCharCode:function(e,n,r){var i=0,s="";if(n=n||0,r=r||t.getCharLength(e[n]),0==r)throw new Error(e[n].toString(2)+" is not a significative byte (offset:"+n+").");if(1===r)return e[n];if(s="00000000".slice(0,r)+1+"00000000".slice(r+1),e[n]&parseInt(s,2))throw Error("Index "+n+": A "+r+" bytes encoded char cannot encode the "+(r+1)+"th rank bit to 1.");for(s="0000".slice(0,r+1)+"11111111".slice(r+1),i+=(e[n]&parseInt(s,2))<<6*--r;r;){if(128!==(128&e[n+1])||64===(64&e[n+1]))throw Error("Index "+(n+1)+': Next bytes of encoded char must begin with a "10" bit sequence.');i+=(63&e[++n])<<6*--r}return i},getStringFromBytes:function(e,n,r,i){var s,o=[];for(n|=0,r="number"==typeof r?r:e.byteLength||e.length;n<r;n++){if(s=t.getCharLength(e[n]),n+s>r){if(i)throw Error("Index "+n+": Found a "+s+" bytes encoded char declaration but only "+(r-n)+" bytes are available.")}else o.push(String.fromCodePoint(t.getCharCode(e,n,s,i)));n+=s-1}return o.join("")},getBytesForCharCode:function(e){if(e<128)return 1;if(e<2048)return 2;if(e<65536)return 3;if(e<2097152)return 4;throw new Error("CharCode "+e+" cannot be encoded with UTF8.")},setBytesFromCharCode:function(e,n,r,i){if(e|=0,n=n||[],r|=0,i=i||t.getBytesForCharCode(e),1==i)n[r]=e;else for(n[r++]=(parseInt("1111".slice(0,i),2)<<8-i)+(e>>>6*--i);i>0;)n[r++]=e>>>6*--i&63|128;return n},setBytesFromString:function(e,n,r,i,s){e=e||"",n=n||[],r|=0,i="number"==typeof i?i:n.byteLength||1/0;for(var o=0,a=e.length;o<a;o++){var u=t.getBytesForCharCode(e[o].codePointAt(0));if(s&&r+u>i)throw new Error('Not enought bytes to encode the char "'+e[o]+'" at the offset "'+r+'".');t.setBytesFromCharCode(e[o].codePointAt(0),n,r,u,s),r+=u}return n}};e.exports=t}).call(t,n(7)(e))},function(e,t){(function(){"use strict";function e(e){throw e}function t(e,t){var n=e.split("."),r=S;!(n[0]in r)&&r.execScript&&r.execScript("var "+n[0]);for(var i;n.length&&(i=n.shift());)n.length||t===C?r=r[i]?r[i]:r[i]={}:r[i]=t}function n(t,n){this.index="number"==typeof n?n:0,this.i=0,this.buffer=t instanceof(I?Uint8Array:Array)?t:new(I?Uint8Array:Array)(32768),2*this.buffer.length<=this.index&&e(Error("invalid index")),this.buffer.length<=this.index&&this.f()}function r(e){this.buffer=new(I?Uint16Array:Array)(2*e),this.length=0}function i(e){var t,n,r,i,s,o,a,u,f,l,h=e.length,d=0,c=Number.POSITIVE_INFINITY;for(u=0;u<h;++u)e[u]>d&&(d=e[u]),e[u]<c&&(c=e[u]);for(t=1<<d,n=new(I?Uint32Array:Array)(t),r=1,i=0,s=2;r<=d;){for(u=0;u<h;++u)if(e[u]===r){for(o=0,a=i,f=0;f<r;++f)o=o<<1|1&a,a>>=1;for(l=r<<16|u,f=o;f<t;f+=s)n[f]=l;++i}++r,i<<=1,s<<=1}return[n,d,c]}function s(e,t){this.h=w,this.w=0,this.input=I&&e instanceof Array?new Uint8Array(e):e,this.b=0,t&&(t.lazy&&(this.w=t.lazy),"number"==typeof t.compressionType&&(this.h=t.compressionType),t.outputBuffer&&(this.a=I&&t.outputBuffer instanceof Array?new Uint8Array(t.outputBuffer):t.outputBuffer),"number"==typeof t.outputIndex&&(this.b=t.outputIndex)),this.a||(this.a=new(I?Uint8Array:Array)(32768))}function o(e,t){this.length=e,this.H=t}function a(t,n){function r(t,n){var r,i=t.H,s=[],o=0;r=k[t.length],s[o++]=65535&r,s[o++]=r>>16&255,s[o++]=r>>24;var a;switch(T){case 1===i:a=[0,i-1,0];break;case 2===i:a=[1,i-2,0];break;case 3===i:a=[2,i-3,0];break;case 4===i:a=[3,i-4,0];break;case 6>=i:a=[4,i-5,1];break;case 8>=i:a=[5,i-7,1];break;case 12>=i:a=[6,i-9,2];break;case 16>=i:a=[7,i-13,2];break;case 24>=i:a=[8,i-17,3];break;case 32>=i:a=[9,i-25,3];break;case 48>=i:a=[10,i-33,4];break;case 64>=i:a=[11,i-49,4];break;case 96>=i:a=[12,i-65,5];break;case 128>=i:a=[13,i-97,5];break;case 192>=i:a=[14,i-129,6];break;case 256>=i:a=[15,i-193,6];break;case 384>=i:a=[16,i-257,7];break;case 512>=i:a=[17,i-385,7];break;case 768>=i:a=[18,i-513,8];break;case 1024>=i:a=[19,i-769,8];break;case 1536>=i:a=[20,i-1025,9];break;case 2048>=i:a=[21,i-1537,9];break;case 3072>=i:a=[22,i-2049,10];break;case 4096>=i:a=[23,i-3073,10];break;case 6144>=i:a=[24,i-4097,11];break;case 8192>=i:a=[25,i-6145,11];break;case 12288>=i:a=[26,i-8193,12];break;case 16384>=i:a=[27,i-12289,12];break;case 24576>=i:a=[28,i-16385,13];break;case 32768>=i:a=[29,i-24577,13];break;default:e("invalid distance")}r=a,s[o++]=r[0],s[o++]=r[1],s[o++]=r[2];var u,f;for(u=0,f=s.length;u<f;++u)E[p++]=s[u];R[s[0]]++,y[s[3]]++,g=t.length+n-1,d=null}var i,s,o,a,f,l,h,d,c,_={},E=I?new Uint16Array(2*n.length):[],p=0,g=0,R=new(I?Uint32Array:Array)(286),y=new(I?Uint32Array:Array)(30),S=t.w;if(!I){for(o=0;285>=o;)R[o++]=0;for(o=0;29>=o;)y[o++]=0}for(R[256]=1,i=0,s=n.length;i<s;++i){for(o=f=0,a=3;o<a&&i+o!==s;++o)f=f<<8|n[i+o];if(_[f]===C&&(_[f]=[]),l=_[f],!(0<g--)){for(;0<l.length&&32768<i-l[0];)l.shift();if(i+3>=s){for(d&&r(d,-1),o=0,a=s-i;o<a;++o)c=n[i+o],E[p++]=c,++R[c];break}0<l.length?(h=u(n,i,l),d?d.length<h.length?(c=n[i-1],E[p++]=c,++R[c],r(h,0)):r(d,-1):h.length<S?d=h:r(h,0)):d?r(d,-1):(c=n[i],E[p++]=c,++R[c])}l.push(i)}return E[p++]=256,R[256]++,t.M=R,t.L=y,I?E.subarray(0,p):E}function u(e,t,n){var r,i,s,a,u,f,l=0,h=e.length;a=0,f=n.length;e:for(;a<f;a++){if(r=n[f-a-1],s=3,3<l){for(u=l;3<u;u--)if(e[r+u-1]!==e[t+u-1])continue e;s=l}for(;258>s&&t+s<h&&e[r+s]===e[t+s];)++s;if(s>l&&(i=r,l=s),258===s)break}return new o(l,t-i)}function f(e,t){var n,i,s,o,a,u=e.length,f=new r(572),h=new(I?Uint8Array:Array)(u);if(!I)for(o=0;o<u;o++)h[o]=0;for(o=0;o<u;++o)0<e[o]&&f.push(o,e[o]);if(n=Array(f.length/2),i=new(I?Uint32Array:Array)(f.length/2),1===n.length)return h[f.pop().index]=1,h;for(o=0,a=f.length/2;o<a;++o)n[o]=f.pop(),i[o]=n[o].value;for(s=l(i,i.length,t),o=0,a=n.length;o<a;++o)h[n[o].index]=s[o];return h}function l(e,t,n){function r(e){var n=c[e][_[e]];n===t?(r(e+1),r(e+1)):--h[n],++_[e]}var i,s,o,a,u,f=new(I?Uint16Array:Array)(n),l=new(I?Uint8Array:Array)(n),h=new(I?Uint8Array:Array)(t),d=Array(n),c=Array(n),_=Array(n),E=(1<<n)-t,p=1<<n-1;for(f[n-1]=t,s=0;s<n;++s)E<p?l[s]=0:(l[s]=1,E-=p),E<<=1,f[n-2-s]=(f[n-1-s]/2|0)+t;for(f[0]=l[0],d[0]=Array(f[0]),c[0]=Array(f[0]),s=1;s<n;++s)f[s]>2*f[s-1]+l[s]&&(f[s]=2*f[s-1]+l[s]),d[s]=Array(f[s]),c[s]=Array(f[s]);for(i=0;i<t;++i)h[i]=n;for(o=0;o<f[n-1];++o)d[n-1][o]=e[o],c[n-1][o]=o;for(i=0;i<n;++i)_[i]=0;for(1===l[n-1]&&(--h[0],++_[n-1]),s=n-2;0<=s;--s){for(a=i=0,u=_[s+1],o=0;o<f[s];o++)a=d[s+1][u]+d[s+1][u+1],a>e[i]?(d[s][o]=a,c[s][o]=t,u+=2):(d[s][o]=e[i],c[s][o]=i,++i);_[s]=0,1===l[s]&&r(s)}return h}function h(e){var t,n,r,i,s=new(I?Uint16Array:Array)(e.length),o=[],a=[],u=0;for(t=0,n=e.length;t<n;t++)o[e[t]]=(0|o[e[t]])+1;for(t=1,n=16;t<=n;t++)a[t]=u,u+=0|o[t],u<<=1;for(t=0,n=e.length;t<n;t++)for(u=a[e[t]],a[e[t]]+=1,r=s[t]=0,i=e[t];r<i;r++)s[t]=s[t]<<1|1&u,u>>>=1;return s}function d(t,n){switch(this.l=[],this.m=32768,this.e=this.g=this.c=this.q=0,this.input=I?new Uint8Array(t):t,this.s=!1,this.n=B,this.C=!1,!n&&(n={})||(n.index&&(this.c=n.index),n.bufferSize&&(this.m=n.bufferSize),n.bufferType&&(this.n=n.bufferType),n.resize&&(this.C=n.resize)),this.n){case M:this.b=32768,this.a=new(I?Uint8Array:Array)(32768+this.m+258);break;case B:this.b=0,this.a=new(I?Uint8Array:Array)(this.m),this.f=this.K,this.t=this.I,this.o=this.J;break;default:e(Error("invalid inflate mode"))}}function c(t,n){for(var r,i=t.g,s=t.e,o=t.input,a=t.c,u=o.length;s<n;)a>=u&&e(Error("input buffer is broken")),i|=o[a++]<<s,s+=8;return r=i&(1<<n)-1,t.g=i>>>n,t.e=s-n,t.c=a,r}function _(e,t){for(var n,r,i=e.g,s=e.e,o=e.input,a=e.c,u=o.length,f=t[0],l=t[1];s<l&&!(a>=u);)i|=o[a++]<<s,s+=8;return n=f[i&(1<<l)-1],r=n>>>16,e.g=i>>r,e.e=s-r,e.c=a,65535&n}function E(e){function t(e,t,n){var r,i,s,o=this.z;for(s=0;s<e;)switch(r=_(this,t)){case 16:for(i=3+c(this,2);i--;)n[s++]=o;break;
case 17:for(i=3+c(this,3);i--;)n[s++]=0;o=0;break;case 18:for(i=11+c(this,7);i--;)n[s++]=0;o=0;break;default:o=n[s++]=r}return this.z=o,n}var n,r,s,o,a=c(e,5)+257,u=c(e,5)+1,f=c(e,4)+4,l=new(I?Uint8Array:Array)(j.length);for(o=0;o<f;++o)l[j[o]]=c(e,3);if(!I)for(o=f,f=l.length;o<f;++o)l[j[o]]=0;n=i(l),r=new(I?Uint8Array:Array)(a),s=new(I?Uint8Array:Array)(u),e.z=0,e.o(i(t.call(e,a,n,r)),i(t.call(e,u,n,s)))}function p(e){if("string"==typeof e){var t,n,r=e.split("");for(t=0,n=r.length;t<n;t++)r[t]=(255&r[t].charCodeAt(0))>>>0;e=r}for(var i,s=1,o=0,a=e.length,u=0;0<a;){i=1024<a?1024:a,a-=i;do s+=e[u++],o+=s;while(--i);s%=65521,o%=65521}return(o<<16|s)>>>0}function g(t,n){var r,i;switch(this.input=t,this.c=0,!n&&(n={})||(n.index&&(this.c=n.index),n.verify&&(this.N=n.verify)),r=t[this.c++],i=t[this.c++],15&r){case re:this.method=re;break;default:e(Error("unsupported compression method"))}0!==((r<<8)+i)%31&&e(Error("invalid fcheck flag:"+((r<<8)+i)%31)),32&i&&e(Error("fdict flag is not supported")),this.B=new d(t,{index:this.c,bufferSize:n.bufferSize,bufferType:n.bufferType,resize:n.resize})}function R(e,t){this.input=e,this.a=new(I?Uint8Array:Array)(32768),this.h=ie.k;var n,r={};!t&&(t={})||"number"!=typeof t.compressionType||(this.h=t.compressionType);for(n in t)r[n]=t[n];r.outputBuffer=this.a,this.A=new s(this.input,r)}function y(e,n){var r,i,s,o;if(Object.keys)r=Object.keys(n);else for(i in r=[],s=0,n)r[s++]=i;for(s=0,o=r.length;s<o;++s)i=r[s],t(e+"."+i,n[i])}var C=void 0,T=!0,S=this,I="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array&&"undefined"!=typeof DataView;n.prototype.f=function(){var e,t=this.buffer,n=t.length,r=new(I?Uint8Array:Array)(n<<1);if(I)r.set(t);else for(e=0;e<n;++e)r[e]=t[e];return this.buffer=r},n.prototype.d=function(e,t,n){var r,i=this.buffer,s=this.index,o=this.i,a=i[s];if(n&&1<t&&(e=8<t?(N[255&e]<<24|N[e>>>8&255]<<16|N[e>>>16&255]<<8|N[e>>>24&255])>>32-t:N[e]>>8-t),8>t+o)a=a<<t|e,o+=t;else for(r=0;r<t;++r)a=a<<1|e>>t-r-1&1,8===++o&&(o=0,i[s++]=N[a],a=0,s===i.length&&(i=this.f()));i[s]=a,this.buffer=i,this.i=o,this.index=s},n.prototype.finish=function(){var e,t=this.buffer,n=this.index;return 0<this.i&&(t[n]<<=8-this.i,t[n]=N[t[n]],n++),I?e=t.subarray(0,n):(t.length=n,e=t),e};var m,v=new(I?Uint8Array:Array)(256);for(m=0;256>m;++m){for(var b=m,A=b,O=7,b=b>>>1;b;b>>>=1)A<<=1,A|=1&b,--O;v[m]=(A<<O&255)>>>0}var N=v;r.prototype.getParent=function(e){return 2*((e-2)/4|0)},r.prototype.push=function(e,t){var n,r,i,s=this.buffer;for(n=this.length,s[this.length++]=t,s[this.length++]=e;0<n&&(r=this.getParent(n),s[n]>s[r]);)i=s[n],s[n]=s[r],s[r]=i,i=s[n+1],s[n+1]=s[r+1],s[r+1]=i,n=r;return this.length},r.prototype.pop=function(){var e,t,n,r,i,s=this.buffer;for(t=s[0],e=s[1],this.length-=2,s[0]=s[this.length],s[1]=s[this.length+1],i=0;(r=2*i+2,!(r>=this.length))&&(r+2<this.length&&s[r+2]>s[r]&&(r+=2),s[r]>s[i]);)n=s[i],s[i]=s[r],s[r]=n,n=s[i+1],s[i+1]=s[r+1],s[r+1]=n,i=r;return{index:e,value:t,length:this.length}};var P,w=2,D={NONE:0,r:1,k:w,O:3},U=[];for(P=0;288>P;P++)switch(T){case 143>=P:U.push([P+48,8]);break;case 255>=P:U.push([P-144+400,9]);break;case 279>=P:U.push([P-256+0,7]);break;case 287>=P:U.push([P-280+192,8]);break;default:e("invalid literal: "+P)}s.prototype.j=function(){var t,r,i,s,o=this.input;switch(this.h){case 0:for(i=0,s=o.length;i<s;){r=I?o.subarray(i,i+65535):o.slice(i,i+65535),i+=r.length;var u=r,l=i===s,d=C,c=C,_=C,E=C,p=C,g=this.a,R=this.b;if(I){for(g=new Uint8Array(this.a.buffer);g.length<=R+u.length+5;)g=new Uint8Array(g.length<<1);g.set(this.a)}if(d=l?1:0,g[R++]=0|d,c=u.length,_=~c+65536&65535,g[R++]=255&c,g[R++]=c>>>8&255,g[R++]=255&_,g[R++]=_>>>8&255,I)g.set(u,R),R+=u.length,g=g.subarray(0,R);else{for(E=0,p=u.length;E<p;++E)g[R++]=u[E];g.length=R}this.b=R,this.a=g}break;case 1:var y=new n(I?new Uint8Array(this.a.buffer):this.a,this.b);y.d(1,1,T),y.d(1,2,T);var S,m,v,b=a(this,o);for(S=0,m=b.length;S<m;S++)if(v=b[S],n.prototype.d.apply(y,U[v]),256<v)y.d(b[++S],b[++S],T),y.d(b[++S],5),y.d(b[++S],b[++S],T);else if(256===v)break;this.a=y.finish(),this.b=this.a.length;break;case w:var A,O,N,P,D,L,k,M,B,G,H,F,x,j,q,V=new n(I?new Uint8Array(this.a.buffer):this.a,this.b),Y=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],J=Array(19);for(A=w,V.d(1,1,T),V.d(A,2,T),O=a(this,o),L=f(this.M,15),k=h(L),M=f(this.L,7),B=h(M),N=286;257<N&&0===L[N-1];N--);for(P=30;1<P&&0===M[P-1];P--);var W,Q,z,K,Z,$,X=N,ee=P,te=new(I?Uint32Array:Array)(X+ee),ne=new(I?Uint32Array:Array)(316),re=new(I?Uint8Array:Array)(19);for(W=Q=0;W<X;W++)te[Q++]=L[W];for(W=0;W<ee;W++)te[Q++]=M[W];if(!I)for(W=0,K=re.length;W<K;++W)re[W]=0;for(W=Z=0,K=te.length;W<K;W+=Q){for(Q=1;W+Q<K&&te[W+Q]===te[W];++Q);if(z=Q,0===te[W])if(3>z)for(;0<z--;)ne[Z++]=0,re[0]++;else for(;0<z;)$=138>z?z:138,$>z-3&&$<z&&($=z-3),10>=$?(ne[Z++]=17,ne[Z++]=$-3,re[17]++):(ne[Z++]=18,ne[Z++]=$-11,re[18]++),z-=$;else if(ne[Z++]=te[W],re[te[W]]++,z--,3>z)for(;0<z--;)ne[Z++]=te[W],re[te[W]]++;else for(;0<z;)$=6>z?z:6,$>z-3&&$<z&&($=z-3),ne[Z++]=16,ne[Z++]=$-3,re[16]++,z-=$}for(t=I?ne.subarray(0,Z):ne.slice(0,Z),G=f(re,7),j=0;19>j;j++)J[j]=G[Y[j]];for(D=19;4<D&&0===J[D-1];D--);for(H=h(G),V.d(N-257,5,T),V.d(P-1,5,T),V.d(D-4,4,T),j=0;j<D;j++)V.d(J[j],3,T);for(j=0,q=t.length;j<q;j++)if(F=t[j],V.d(H[F],G[F],T),16<=F){switch(j++,F){case 16:x=2;break;case 17:x=3;break;case 18:x=7;break;default:e("invalid code: "+F)}V.d(t[j],x,T)}var ie,se,oe,ae,ue,fe,le,he,de=[k,L],ce=[B,M];for(ue=de[0],fe=de[1],le=ce[0],he=ce[1],ie=0,se=O.length;ie<se;++ie)if(oe=O[ie],V.d(ue[oe],fe[oe],T),256<oe)V.d(O[++ie],O[++ie],T),ae=O[++ie],V.d(le[ae],he[ae],T),V.d(O[++ie],O[++ie],T);else if(256===oe)break;this.a=V.finish(),this.b=this.a.length;break;default:e("invalid compression type")}return this.a};var L=function(){function t(t){switch(T){case 3===t:return[257,t-3,0];case 4===t:return[258,t-4,0];case 5===t:return[259,t-5,0];case 6===t:return[260,t-6,0];case 7===t:return[261,t-7,0];case 8===t:return[262,t-8,0];case 9===t:return[263,t-9,0];case 10===t:return[264,t-10,0];case 12>=t:return[265,t-11,1];case 14>=t:return[266,t-13,1];case 16>=t:return[267,t-15,1];case 18>=t:return[268,t-17,1];case 22>=t:return[269,t-19,2];case 26>=t:return[270,t-23,2];case 30>=t:return[271,t-27,2];case 34>=t:return[272,t-31,2];case 42>=t:return[273,t-35,3];case 50>=t:return[274,t-43,3];case 58>=t:return[275,t-51,3];case 66>=t:return[276,t-59,3];case 82>=t:return[277,t-67,4];case 98>=t:return[278,t-83,4];case 114>=t:return[279,t-99,4];case 130>=t:return[280,t-115,4];case 162>=t:return[281,t-131,5];case 194>=t:return[282,t-163,5];case 226>=t:return[283,t-195,5];case 257>=t:return[284,t-227,5];case 258===t:return[285,t-258,0];default:e("invalid length: "+t)}}var n,r,i=[];for(n=3;258>=n;n++)r=t(n),i[n]=r[2]<<24|r[1]<<16|r[0];return i}(),k=I?new Uint32Array(L):L,M=0,B=1,G={F:M,D:B};d.prototype.p=function(){for(;!this.s;){var t=c(this,3);switch(1&t&&(this.s=T),t>>>=1){case 0:var n=this.input,r=this.c,i=this.a,s=this.b,o=n.length,a=C,u=C,f=i.length,l=C;switch(this.e=this.g=0,r+1>=o&&e(Error("invalid uncompressed block header: LEN")),a=n[r++]|n[r++]<<8,r+1>=o&&e(Error("invalid uncompressed block header: NLEN")),u=n[r++]|n[r++]<<8,a===~u&&e(Error("invalid uncompressed block header: length verify")),r+a>n.length&&e(Error("input buffer is broken")),this.n){case M:for(;s+a>i.length;){if(l=f-s,a-=l,I)i.set(n.subarray(r,r+l),s),s+=l,r+=l;else for(;l--;)i[s++]=n[r++];this.b=s,i=this.f(),s=this.b}break;case B:for(;s+a>i.length;)i=this.f({v:2});break;default:e(Error("invalid inflate mode"))}if(I)i.set(n.subarray(r,r+a),s),s+=a,r+=a;else for(;a--;)i[s++]=n[r++];this.c=r,this.b=s,this.a=i;break;case 1:this.o(ee,ne);break;case 2:E(this);break;default:e(Error("unknown BTYPE: "+t))}}return this.t()};var H,F,x=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],j=I?new Uint16Array(x):x,q=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],V=I?new Uint16Array(q):q,Y=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],J=I?new Uint8Array(Y):Y,W=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],Q=I?new Uint16Array(W):W,z=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],K=I?new Uint8Array(z):z,Z=new(I?Uint8Array:Array)(288);for(H=0,F=Z.length;H<F;++H)Z[H]=143>=H?8:255>=H?9:279>=H?7:8;var $,X,ee=i(Z),te=new(I?Uint8Array:Array)(30);for($=0,X=te.length;$<X;++$)te[$]=5;var ne=i(te);d.prototype.o=function(e,t){var n=this.a,r=this.b;this.u=e;for(var i,s,o,a,u=n.length-258;256!==(i=_(this,e));)if(256>i)r>=u&&(this.b=r,n=this.f(),r=this.b),n[r++]=i;else for(s=i-257,a=V[s],0<J[s]&&(a+=c(this,J[s])),i=_(this,t),o=Q[i],0<K[i]&&(o+=c(this,K[i])),r>=u&&(this.b=r,n=this.f(),r=this.b);a--;)n[r]=n[r++-o];for(;8<=this.e;)this.e-=8,this.c--;this.b=r},d.prototype.J=function(e,t){var n=this.a,r=this.b;this.u=e;for(var i,s,o,a,u=n.length;256!==(i=_(this,e));)if(256>i)r>=u&&(n=this.f(),u=n.length),n[r++]=i;else for(s=i-257,a=V[s],0<J[s]&&(a+=c(this,J[s])),i=_(this,t),o=Q[i],0<K[i]&&(o+=c(this,K[i])),r+a>u&&(n=this.f(),u=n.length);a--;)n[r]=n[r++-o];for(;8<=this.e;)this.e-=8,this.c--;this.b=r},d.prototype.f=function(){var e,t,n=new(I?Uint8Array:Array)(this.b-32768),r=this.b-32768,i=this.a;if(I)n.set(i.subarray(32768,n.length));else for(e=0,t=n.length;e<t;++e)n[e]=i[e+32768];if(this.l.push(n),this.q+=n.length,I)i.set(i.subarray(r,r+32768));else for(e=0;32768>e;++e)i[e]=i[r+e];return this.b=32768,i},d.prototype.K=function(e){var t,n,r,i,s=this.input.length/this.c+1|0,o=this.input,a=this.a;return e&&("number"==typeof e.v&&(s=e.v),"number"==typeof e.G&&(s+=e.G)),2>s?(n=(o.length-this.c)/this.u[2],i=258*(n/2)|0,r=i<a.length?a.length+i:a.length<<1):r=a.length*s,I?(t=new Uint8Array(r),t.set(a)):t=a,this.a=t},d.prototype.t=function(){var e,t,n,r,i,s=0,o=this.a,a=this.l,u=new(I?Uint8Array:Array)(this.q+(this.b-32768));if(0===a.length)return I?this.a.subarray(32768,this.b):this.a.slice(32768,this.b);for(t=0,n=a.length;t<n;++t)for(e=a[t],r=0,i=e.length;r<i;++r)u[s++]=e[r];for(t=32768,n=this.b;t<n;++t)u[s++]=o[t];return this.l=[],this.buffer=u},d.prototype.I=function(){var e,t=this.b;return I?this.C?(e=new Uint8Array(t),e.set(this.a.subarray(0,t))):e=this.a.subarray(0,t):(this.a.length>t&&(this.a.length=t),e=this.a),this.buffer=e},g.prototype.p=function(){var t,n,r=this.input;return t=this.B.p(),this.c=this.B.c,this.N&&(n=(r[this.c++]<<24|r[this.c++]<<16|r[this.c++]<<8|r[this.c++])>>>0,n!==p(t)&&e(Error("invalid adler-32 checksum"))),t};var re=8,ie=D;R.prototype.j=function(){var t,n,r,i,s,o,a,u=0;switch(a=this.a,t=re){case re:n=Math.LOG2E*Math.log(32768)-8;break;default:e(Error("invalid compression method"))}switch(r=n<<4|t,a[u++]=r,t){case re:switch(this.h){case ie.NONE:s=0;break;case ie.r:s=1;break;case ie.k:s=2;break;default:e(Error("unsupported compression type"))}break;default:e(Error("invalid compression method"))}return i=s<<6|0,a[u++]=i|31-(256*r+i)%31,o=p(this.input),this.A.b=u,a=this.A.j(),u=a.length,I&&(a=new Uint8Array(a.buffer),a.length<=u+4&&(this.a=new Uint8Array(a.length+4),this.a.set(a),a=this.a),a=a.subarray(0,u+4)),a[u++]=o>>24&255,a[u++]=o>>16&255,a[u++]=o>>8&255,a[u++]=255&o,a},t("Zlib.Inflate",g),t("Zlib.Inflate.prototype.decompress",g.prototype.p),y("Zlib.Inflate.BufferType",{ADAPTIVE:G.D,BLOCK:G.F}),t("Zlib.Deflate",R),t("Zlib.Deflate.compress",function(e,t){return new R(e,t).j()}),t("Zlib.Deflate.prototype.compress",R.prototype.j),y("Zlib.Deflate.CompressionType",{NONE:ie.NONE,FIXED:ie.r,DYNAMIC:ie.k})}).call(this)},function(e,t){},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(5),f=r(u),l=n(24),h=r(l),d=n(14),c=r(d),_=n(2),E=r(_),p=n(1),g=r(p),R=n(12),y=r(R),C=n(25),T=r(C),S=n(27),I=r(S),m=n(26),v=r(m),b=n(28),A=r(b),O=n(10),N=r(O),P=n(11),w=r(P),D=g.default.getLoger("MessageEntrance"),U={version:"v1.0.0",author:"www.3mang.com"},L=void 0,k=void 0,M=void 0,B=void 0,G=void 0,H=void 0,F=void 0,x=void 0,j=void 0,q=void 0,V=void 0,Y=function(e){function t(){i(this,t);var e=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.sdkInfo=U,D.log(e.sdkInfo),e.on(E.default.CLASS_INIT_FAILED,e._sassInitFailedHandler.bind(e)),e.on(E.default.CLASS_JOIN_FAILED,e._joinClassFailureHandler.bind(e)),e.on(E.default.DOC_SHOW,e.docShowHandler.bind(e)),L=h.default,L.on("*",function(t,n){return e._emit(t,n)}),L.on(L.SUCCESS,e._sassVerifySuccessHandler.bind(e)),L.on(L.CLASS_INIT_SUCCESS,e._sassInitSuccessHandler.bind(e)),L.on(L.CLASS_INIT_FAILED,e._sassInitFailedHandler.bind(e)),L.on(L.CLASS_GET_MEETING_PARAM,e._h5SassGetMeetingParaSuccessHandler),k=c.default,k.on("*",function(t,n){return e._emit(t,n)}),k.on(E.default.CLASS_JOIN_SUCCESS,e._joinClassSuccessHandler.bind(e)),M=new y.default,M.on("*",function(t,n){return e._emit(t,n)}),M.on(E.default.DOC_SWITCH,e.docSwitchHandler.bind(e)),B=new T.default,B.on("*",function(t,n){return e._emit(t,n)}),G=new I.default,G.on("*",function(t,n){return e._emit(t,n)}),H=new v.default,H.on("*",function(t,n){return e._emit(t,n)}),H.on(E.default.DOC_UPDATE,e.docUpdateHandler.bind(e)),H.on(E.default.DOC_DEL,e.docDeleteHandler.bind(e)),F=new A.default,F.on("*",function(t,n){return e._emit(t,n)}),F.on(E.default.ANNO_UPDATE,e.annoUpdateHandler.bind(e)),e.init=e._init,e.joinClass=e._joinClass,e.sendChatMsg=e._sendChatMsg,e.setDebugData=e._setDebugData,e}return o(t,e),a(t,[{key:"_init",value:function(e,t,n){return x=t,j=n,null==e||N.default.isEmptyObject(e)?(D.log("init初始化失败1",E.default.ERROR_PARAM),void this._emit(E.default.CLASS_INIT_FAILED,E.default.ERROR_PARAM)):null==e.meetingNumber||isNaN(e.meetingNumber)||null==e.portal?(D.log("init初始化失败2",e),void this._emit(E.default.CLASS_INIT_FAILED,E.default.ERROR_PARAM)):(D.log("init",e),w.default.confId=e.meetingNumber,w.default.portal=e.portal,w.default.userRole=e.userRole||"normal",w.default.userId=e.userId||"0",void(L&&L.sassGetJoinParams(w.default.getConfInfo())))}},{key:"_joinClass",value:function(e,t,n){return q=t,V=n,null==e||N.default.isEmptyObject(e)?(this._emit(E.default.CLASS_JOIN_FAILED,E.default.ERROR_PARAM),void D.log("不能进入会议,传递的参数不对.",e)):null==e.userName?(D.log("不能进入会议,传递的参数不对.名字不能为空"),void this._emit(E.default.CLASS_JOIN_FAILED,E.default.ERROR_PARAM)):(w.default.userName=e.userName,w.default.password=e.password||"",void(L&&L.sassChecking(w.default.getConfInfo())))}},{key:"leaveClass",value:function(){k&&k.leaveMCU()}},{key:"_sassInitSuccessHandler",value:function(e){e&&(w.default.md5=e.md5||"",w.default.msType=e.msType||1,w.default.passwordRequired=e.passwordRequired||!1,w.default.siteId=e.siteId),D.log("向SASS平台获取入会验证信息成功."),this._emit(E.default.CLASS_INIT_SUCCESS,e),x&&x(e)}},{key:"_sassInitFailedHandler",value:function(){D.log("向SASS平台获取入会验证信息失败."),j&&j()}},{key:"_setDebugData",value:function(e){D.log("setDebugData "+e),w.default.setDebugData(e)}},{key:"_sassVerifySuccessHandler",value:function(e){D.log("加入底层MCU会议."),k&&k.joinMCU(w.default.getConfInfo())}},{key:"_h5SassGetMeetingParaSuccessHandler",value:function(e){D.log("获取getMeetingParam完成."),w.default.meetingParam=e,D.log(e)}},{key:"_joinClassSuccessHandler",value:function(){D.log("MCU 会议成功."),L&&(L.getClassDetail(),L.getMeetingParam()),q&&q()}},{key:"_joinClassFailureHandler",value:function(e){D.log("_joinClassFailureHandler",e),V&&V(e)}},{key:"conferenceHandler",value:function(e){var t={type:e,data:null};this._emit(t.type,t)}},{key:"_sendChatMsg",value:function(e){return null===e||N.default.isEmptyObject(e)?void D.log("sendChatMsg 传递的参数不对",e):void(B&&B.sendChatMsg(e))}},{key:"annoUpdateHandler",value:function(e){var t=M.activeDocId,n=H.docList[t];n&&e.id==n.wbid&&this._emit(E.default.DOC_ANNO,e)}},{key:"docShowHandler",value:function(e){D.log("Doc Show ->"+e.id+"|"+e.curPageNo);var t=F.annoInfos[e.wbid];t?this._emit(E.default.DOC_ANNO,t):this._emit(E.default.DOC_ANNO)}},{key:"docSwitchHandler",value:function(){var e=M.activeDocId;D.log("Switch Doc Active -> "+e);var t=H.docList[e];t&&this._emit(E.default.DOC_SHOW,t)}},{key:"docUpdateHandler",value:function(e){D.log("Doc UpdateId ->"+e.id+"| activeDocId ->"+M.activeDocId),e.id==M.activeDocId&&this._emit(E.default.DOC_SHOW,e)}},{key:"docDeleteHandler",value:function(e){e.id==M.activeDocId&&this._emit(E.default.DOC_DEL,e)}}]),t}(f.default),J=Y;t.default=J;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(D,"loger","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(U,"_sdkInfo","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(L,"_sass","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(k,"_mcu","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(M,"_confer_ape","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(B,"_chat_ape","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(G,"_video_ape","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(H,"_doc_ape","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(F,"_wb_ape","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(x,"_initSuccessCallBackFun","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(j,"_initFailureCallBackFun","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(q,"_joinClassSuccessCallBackFun","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(V,"_joinClassFailureCallBackFun","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(Y,"MessageEntrance","D:/work/McuClient/src/EngineEntrance.js"),__REACT_HOT_LOADER__.register(J,"default","D:/work/McuClient/src/EngineEntrance.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f}Object.defineProperty(t,"__esModule",{value:!0}),t.MessageTypes=void 0,t.createMcuClient=i;var s=n(22),o=r(s),a=n(2),u=r(a),f=new o.default;t.MessageTypes=u.default;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(f,"MCU_CLIENT","D:/work/McuClient/src/McuClientEngine.js"),__REACT_HOT_LOADER__.register(i,"createMcuClient","D:/work/McuClient/src/McuClientEngine.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(5),f=r(u),l=n(1),h=r(l),d=n(2),c=r(d),_=n(11),E=r(_),p=n(35),g=r(p),R=h.default.getLoger("Sass"),y={},C={},T=function(e){function t(){return i(this,t),s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this))}return o(t,e),a(t,[{key:"sassGetJoinParams",value:function(e){var n=this;R.log("Sass获取课堂校验信息",e);var r="http://"+e.portal+"/3m/api/meeting/joinParams.do?meetingNumber="+e.confId+"&userID="+e.userId;R.log("Sass获取课堂校验信息.",r),fetch(r,{timeout:5e3}).then(function(e){if(e.ok)return e.json();throw R.error("Sass获取课堂校验信息-网络异常.状态码:"+e.status),n._emit(t.CLASS_INIT_FAILED),""}).then(function(e){0===e.code?(R.log("Sass获取课堂校验信息完成"),n._emit(t.CLASS_INIT_SUCCESS,e)):(R.warn("Sass获取课堂校验信息失败."),n._emit(t.CLASS_INIT_FAILED))}).catch(function(e){R.error("Sass获取课堂校验信息异常.状态码:"+e),n._emit(t.CLASS_INIT_FAILED,e)})}},{key:"sassChecking",value:function(e){return R.log("发起Sass校验",e),y=e,"true"===y.passwordRequired||y.passwordRequired===!0?void this.sendPWDChecking():void this.sendMD5Checking()}},{key:"sendPWDChecking",value:function(){var e=this,t="http://"+y.portal+"/3m/getCheckMeetinig.do?siteId="+y.siteId+"&classId="+y.confId+"&password="+y.password;R.log("会议密码校验",t),fetch(t,{timeout:5e3}).then(function(t){if(200===t.status)return t.text();throw R.error("会议密码校验-网络异常.状态码:"+t.status),e._emit(c.default.NET_ERROR),""}).then(function(t){return"false"===t?(R.error("会议密码校验-失败."),void e._emit(c.default.CLASS_JOIN_FAILED,c.default.ERROR_CLASS_PASSWORD_WRONG)):"true"===t?(R.log("会议密码校验-成功."),void e.sendMD5Checking()):(R.error("会议密码校验-协议异常."),void e._emit(c.default.CLASS_JOIN_FAILED,c.default.ERROR_CLASS_PROTOCOL_WRONG))}).catch(function(t){R.error("会议密码校验-异常.状态码:"+t),e._emit(c.default.NET_ERROR)})}},{key:"sendMD5Checking",value:function(){var e=this,n="http://"+y.portal+"/3m/meeting/md5CheckMeeting.do?siteId="+y.siteId+"&meetingNumber="+y.confId+"&userId="+y.userId+"&userName="+y.userName+"&userType="+y.userType+"&nopassword="+y.passwordRequired+"&md5="+y.md5;R.log("H5SassMD5校验",n),fetch(n,{timeout:5e3}).then(function(t){if(200===t.status)return t.json();throw R.error("H5SassMD5校验-网络异常.状态码:"+t.status),e._emit(c.default.NET_ERROR),""}).then(function(n){if("true"==n.flag){if(n.h5_mcu_list){var r=n.h5_mcu_list.split(";")[0];y.MCUServerIP=r.split(":")[0],y.MCUServerPort=r.split(":")[1],E.default.MCUServerIP=y.MCUServerIP,E.default.MCUServerPort=y.MCUServerPort}y.maxVideoChannels=n.maxVideoChannels,y.maxAudioChannels=n.maxAudioChannels,y.maxMediaChannels=y.maxVideoChannels+y.maxAudioChannels,E.default.maxVideoChannels=y.maxVideoChannels,E.default.maxAudioChannels=y.maxAudioChannels,E.default.maxMediaChannels=y.maxMediaChannels,R.log("H5Sass校验完成"),console.log(n),e._emit(t.SUCCESS,n)}else R.log("H5SassMD5校验-失败."),e._emit(c.default.CLASS_JOIN_FAILED,c.default.ERROR_CLASS_MD5_WRONG)}).catch(function(t){R.error("H5SassMD5校验-异常.状态码:"+t),e._emit(c.default.NET_ERROR)})}},{key:"getClassDetail",value:function(){var e=this,t="http://"+y.portal+"/3m/meeting/getClassH5.do?classNumber="+y.confId;R.log("H5Sass获取Class详情.",t),fetch(t,{timeout:5e3}).then(function(t){if(t.ok)return t.json();throw R.error("H5Sass获取Class详情-网络异常.状态码:"+t.status),e._emit(c.default.NET_ERROR),""}).then(function(t){0===t.errorCode?(R.log("H5Sass获取Class详情完成"),e._emit(c.default.CLASS_SHOW_DETAIL,t)):(R.warn("H5Sass获取Class详情失败."),e._emit(c.default.NET_ERROR))}).catch(function(t){R.error("H5Sass获取Class详情异常.状态码:"+t),e._emit(c.default.NET_ERROR)})}},{key:"getMeetingParam",value:function(){var e=this,n=(new Date).getTime(),r=(0,g.default)(y.confId+""+n),i="http://"+y.portal+"/3m/api/meeting/detail.do?meetingNumber="+y.confId+"&timestamp="+n+"&authId="+r;R.log("H5Sass获取getMeetingParam ",i),fetch(i,{timeout:5e3}).then(function(t){if(t.ok)return t.json();throw R.error("H5Sass获取getMeetingParam-网络异常.状态码:"+t.status),e._emit(c.default.NET_ERROR),""}).then(function(n){0===n.code?(R.log("H5Sass获取getMeetingParam完成"),e._emit(t.CLASS_GET_MEETING_PARAM,n)):(R.warn("H5Sass获取getMeetingParam失败."),e._emit(c.default.NET_ERROR))}).catch(function(t){R.error("H5Sass获取getMeetingParam异常.状态码:"+t),e._emit(c.default.NET_ERROR)})}}]),t}(f.default);T.prototype.SUCCESS=T.SUCCESS="h5sass.success",T.prototype.CLASS_INIT_SUCCESS=T.CLASS_INIT_SUCCESS="sass.class.init.success",T.prototype.CLASS_INIT_FAILED=T.CLASS_INIT_FAILED="sass.class.init.failed",T.prototype.CLASS_GET_MEETING_PARAM=T.CLASS_GET_MEETING_PARAM="class_getMeetingParam.message";var S=new T;t.default=S;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(R,"loger","D:/work/McuClient/src/Sass.js"),__REACT_HOT_LOADER__.register(y,"confInfo","D:/work/McuClient/src/Sass.js"),__REACT_HOT_LOADER__.register(C,"initInfo","D:/work/McuClient/src/Sass.js"),__REACT_HOT_LOADER__.register(T,"Sass","D:/work/McuClient/src/Sass.js"),__REACT_HOT_LOADER__.register(S,"default","D:/work/McuClient/src/Sass.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(6),f=r(u),l=n(3),h=r(l),d=n(4),c=r(d),_=n(1),E=r(_),p=n(2),g=r(p),R=n(10),y=r(R),C=E.default.getLoger("ChatApe"),T=function(e){function t(){i(this,t);var e=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,h.default.CHAT_SESSION_ID,h.default.CHAT_SESSION_NAME,h.default.CHAT_SESSION_TAG));return e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(c.default.RCPDU_REG_REGISTER_TABLE,h.default.CHAT_OBJ_TABLE_ID,h.default.CHAT_OBJ_TABLE_NAME,h.default.CHAT_OBJ_TABLE_TAG,0,new ArrayBuffer),e.on(c.default.RCPDU_CHAT_SEND_DATA_REQUEST,e.chatMsgIncomingHandler.bind(e)),e}return o(t,e),a(t,[{key:"sendChatMsg",value:function(e){if(null===this._confInfo||y.default.isEmptyObject(this._confInfo))return void C.log("不能发送聊天消息.McuClient还未初始化数据!");C.log("发送聊天消息.",e.to,e.message);var t=new c.default.RCChatSendDataRequestPdu;t.type=c.default.RCPDU_CHAT_SEND_DATA_REQUEST,t.initiator=this._confInfo.nodeId,t.peer=parseInt(e.to),t.isPublic=!0,t.userData=this._rCArrayBufferUtil.strToUint8Array("h5"+e.message),t.fromName=this._rCArrayBufferUtil.strToUint8Array("h5"+this._confInfo.userName),t.fromRole=this._confInfo.classRole,t.isPublic||0===t.peer?this.sendUniform(t):this.send(t)}},{key:"chatMsgIncomingHandler",value:function(e){var t=c.default.RCChatSendDataRequestPdu.decode(e),n={};n.fromNodeID=t.initiator,n.toNodeID=t.peer,n.message=this._rCArrayBufferUtil.uint8ArrayToStr(t.userData,2),n.fromName=this._rCArrayBufferUtil.uint8ArrayToStr(t.fromName,2),n.fromRole=t.fromRole,C.log("接收聊天消息.",n),this._emit(g.default.CHAT_RECEIVE,n)}}]),t}(f.default),S=T;t.default=S;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(C,"loger","D:/work/McuClient/src/apes/ChatApe.js"),__REACT_HOT_LOADER__.register(T,"ChatApe","D:/work/McuClient/src/apes/ChatApe.js"),__REACT_HOT_LOADER__.register(S,"default","D:/work/McuClient/src/apes/ChatApe.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(6),f=r(u),l=n(3),h=r(l),d=n(4),c=r(d),_=n(1),E=r(_),p=n(2),g=r(p),R=E.default.getLoger("DocApe"),y=function(e){function t(){i(this,t);var e=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,h.default.DOCSHARING_SESSION_ID,h.default.DOCSHARING_SESSION_NAME,h.default.DOCSHARING_SESSION_TAG));return e.docList={},e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(c.default.RCPDU_REG_REGISTER_TABLE,h.default.DOCSHARING_OBJ_TABLE_ID_H5,h.default.DOCSHARING_OBJ_TABLE_NAME_H5,h.default.DOCSHARING_OBJ_TABLE_TAG_H5,0,new ArrayBuffer),e._apeDelayed=!0,e}return o(t,e),a(t,[{key:"tableInsertHandler",value:function(e,t,n){this.tableUpdateHandler(e,t,n)}},{key:"tableDeleteHandler",value:function(e,t){var n={};n.type=h.default.DOCUMENT_DEL,this._emit(g.default.DOC_DEL,n)}},{key:"tableUpdateHandler",value:function(e,t,n){try{var r=c.default.RCDocSendDataRequestPdu.decode(n);r.type=h.default.DOCUMENT_LOAD,r.ext=r.name.substr(r.name.indexOf(".")+1),r.wbid=(r.id<<10)+r.curPageNo,r.isPicture=~["bmp","png","gif","jpg","jpeg"].indexOf(r.ext),r.isPicture?(r.namePath=r.uri.substring(0,r.uri.lastIndexOf(".")),r.loadURL=r.namePath+"."+r.ext):(r.namePath=r.uri.substring(0,r.uri.lastIndexOf("/")),r.loadURL=r.namePath+"/"+r.curPageNo+".jpg"),this.docList[t]=r,this._emit(g.default.DOC_UPDATE,r),R.log("Doc update ->"+t)}catch(e){R.warn("Doc Table Update Decode包异常")}}}]),t}(f.default),C=y;t.default=C;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(R,"loger","D:/work/McuClient/src/apes/DocApe.js"),__REACT_HOT_LOADER__.register(y,"DocApe","D:/work/McuClient/src/apes/DocApe.js"),__REACT_HOT_LOADER__.register(C,"default","D:/work/McuClient/src/apes/DocApe.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(6),f=r(u),l=n(3),h=r(l),d=n(4),c=r(d),_=n(1),E=r(_),p=n(2),g=r(p),R=E.default.getLoger("VideoChat"),y=function(e){function t(){i(this,t);var e=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,h.default.VIDEO_SESSION_ID,h.default.VIDEO_SESSION_NAME,h.default.VIDEO_SESSION_TAG));return e.videoChannels={},e.activeChannelId=0,e.activeURL="",e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(c.default.RCPDU_REG_REGISTER_TABLE,h.default.VIDEO_OBJ_TABLE_ID,h.default.VIDEO_OBJ_TABLE_NAME,h.default.VIDEO_OBJ_TABLE_TAG,0,new ArrayBuffer),
e.on(c.default.RCPDU_VIDEO_SEND_DATA_REQUEST,e.videoIncomingHandler.bind(e)),e}return o(t,e),a(t,[{key:"videoIncomingHandler",value:function(e){var t=c.default.VideoSendDataRequestPdu.decode(e),n={};n._initiator=t.initiator,n._is_key_frame=t.keyFrame,n._sequence_id=t.sequenceId,n._slice_id=t.sliceId,n._data=t.userData,R.log("接受视频消息.",n),this._emit(g.default.VIDEO_SHOW,n)}},{key:"tableUpdateHandler",value:function(e,t,n){var r=c.default.RCVideoChannelInfoRecordPdu.decode(n);switch(r.owner=e,r.channelId=t,r.status=0===e?h.default.CGS_RELEASED:r.status,this.videoChannels[t]=r,r.status){case h.default.CGS_RELEASED:case h.default.CGS_PENDING:case h.default.CGS_GRABBING:this.activeChannelId===r.channelId&&(this.activeChannelId=0,this.activeURL="",this.emitVideoChange());break;case h.default.CGS_OPENNED:this.activeChannelId=r.channelId,"1"===this._confInfo.msType?this.activeURL="http://dazhi.3mang.com/live/"+this._confInfo.confId+"/"+this._confInfo.confId+"_"+r.channelId+"_flash_cam_mic_aac/playlist.m3u8":this.activeURL="http://hls.3mang.com/live/"+this._confInfo.confId+"_"+r.channelId+"_flash_cam_mic_aac/playlist.m3u8",this.emitVideoChange()}}},{key:"emitVideoChange",value:function(){this._emit(g.default.VIDEO_SHOW,{activeChannelId:this.activeChannelId,HLSURL:this.activeURL})}}]),t}(f.default),C=y;t.default=C;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(R,"loger","D:/work/McuClient/src/apes/VideoApe.js"),__REACT_HOT_LOADER__.register(y,"VideoChat","D:/work/McuClient/src/apes/VideoApe.js"),__REACT_HOT_LOADER__.register(C,"default","D:/work/McuClient/src/apes/VideoApe.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(6),f=r(u),l=n(3),h=r(l),d=n(4),c=r(d),_=n(1),E=r(_),p=n(2),g=r(p),R=n(20),y=n(19),C=r(y),T=E.default.getLoger("WhiteBoardApe"),S=function(e){function t(){i(this,t);var e=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,h.default.WHITEBOARD_SESSION_ID,h.default.WHITEBOARD_SESSION_NAME,h.default.WHITEBOARD_SESSION_TAG));return e.annoInfos={},e.registerKey(e._session_id,e._session_name,e._session_tag,new ArrayBuffer),e.registerObj(c.default.RCPDU_REG_REGISTER_TABLE,h.default.WHITEBOARD_OBJ_TABLE_ID,h.default.WHITEBOARD_OBJ_TABLE_NAME,h.default.WHITEBOARD_OBJ_TABLE_TAG,0,new ArrayBuffer),e.on(c.default.RCPDU_CONFERENCE_SEND_DATA_REQUEST,e.whiteboardMsgComingHandler.bind(e)),e._apeDelayed=!0,e}return o(t,e),a(t,[{key:"whiteboardMsgComingHandler",value:function(e){T.warn("whiteboardMsgComingHandler needs to be handled.")}},{key:"tableInsertHandler",value:function(e,t){this.emitDocChange(h.default.DOCUMENT_DEL)}},{key:"tableUpdateHandler",value:function(e,t,n){var r=c.default.RCWhiteboardDataRequestPdu.decode(n);if(r.type==h.default.WBA_DOC_ANNOTATION){var i=new R.Zlib.Inflate(r.action.compact().view).decompress(),s={id:t,svg:C.default.getStringFromBytes(i)};this.annoInfos[t]=s,this._emit(g.default.ANNO_UPDATE,s)}else T.log("白板动作忽略,类型:",(0,h.default)(r.type))}}]),t}(f.default),I=S;t.default=I;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(T,"loger","D:/work/McuClient/src/apes/WhiteBoardApe.js"),__REACT_HOT_LOADER__.register(S,"WhiteBoardApe","D:/work/McuClient/src/apes/WhiteBoardApe.js"),__REACT_HOT_LOADER__.register(I,"default","D:/work/McuClient/src/apes/WhiteBoardApe.js"))})()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(5),f=r(u),l=n(1),h=r(l),d=h.default.getLoger("EverSocket"),c=function(e){function t(){i(this,t);var e=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._connected=!1,e._lastActiveTime=0,e._enableEverSocket=!1,e}return o(t,e),a(t,[{key:"begin",value:function(e,t){d.log("开始WebSocket应用."),this._enableEverSocket=!0,this.wsURL="ws://"+e+":"+t,this._newConnection()}},{key:"end",value:function(){d.log("停止WebSocket应用."),this._clear()}},{key:"send",value:function(e){this._connected?(d.log("SEND MESSAGE---->"),this.websocket.send(e)):d.warn("WebSocket未建立连接.消息忽略")}},{key:"_setConnected",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._connected=e,this._connected?this._emit(t.OPEN):this._emit(t.CLOSED)}},{key:"_newConnection",value:function(){this.websocket=new WebSocket(this.wsURL),this.websocket.binaryType="arraybuffer",this.websocket.onopen=this._onOpen.bind(this),this.websocket.onclose=this._onClose.bind(this),this.websocket.onerror=this._onError.bind(this),this.websocket.onmessage=this._onMessage.bind(this)}},{key:"_reConnection",value:function(){var e=this;this._clear(),this.reConnectionTimeout=window.setTimeout(function(){d.log("WebSocket重新建立."),window.clearTimeout(e.reConnectionTimeout),e._newConnection()},t.RECONN_INTERVAL)}},{key:"_clear",value:function(){d.log("WebSocket,Timers销毁"),window.clearInterval(this.pingTimer),window.clearInterval(this.pongTimer),this.websocket.onopen=void 0,this.websocket.onclose=void 0,this.websocket.onerror=void 0,this.websocket.onmessage=void 0;try{this.websocket.close()}catch(e){d.log("ignore errors")}this.websocket=void 0,this._enableEverSocket=!1,this._setConnected(!1)}},{key:"_onOpen",value:function(){d.log("WebSocket建立成功",this.wsURL),this._setConnected()}},{key:"_onClose",value:function(e){d.log("WebSocket连接断开 CODE:"+e.code+" REASON:"+e.reason+" CLEAN: "+e.wasClean,this.wsURL),this._reConnection()}},{key:"_onError",value:function(){d.log("WebSocket错误出现"),this._connected=!1,this._reConnection()}},{key:"_onMessage",value:function(e){d.log("<----RECEIVE MESSAGE"),this._lastActiveTime=Date.now();var n=e.data;n.byteLength>0&&this._emit(t.MESSAGE,n)}},{key:"_sendPingHandler",value:function(){this._connected?this.websocket.send(new ArrayBuffer):this._reConnection()}},{key:"_checkPongHandler",value:function(){var e=Date.now();this._lastActiveTime&&this._lastActiveTime>=e-t.PONG_INTERVAL&&this._lastActiveTime<=e||(d.warn("---服务器PINGPONG超时-----"),this._reConnection())}},{key:"connected",get:function(){return this._connected}}]),t}(f.default);c.prototype.PONG_INTERVAL=c.PONG_INTERVAL=5e3,c.prototype.PING_INTERVAL=c.PING_INTERVAL=3e3,c.prototype.RECONN_INTERVAL=c.RECONN_INTERVAL=2e3,c.prototype.CONNECTING=c.CONNECTING=0,c.prototype.OPEN=c.OPEN=1,c.prototype.CLOSING=c.CLOSING=2,c.prototype.CLOSED=c.CLOSED=3,c.prototype.MESSAGE=c.MESSAGE=4;var _=new c;t.default=_;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(d,"loger","D:/work/McuClient/src/everSocket.js"),__REACT_HOT_LOADER__.register(c,"EverSocket","D:/work/McuClient/src/everSocket.js"),__REACT_HOT_LOADER__.register(_,"default","D:/work/McuClient/src/everSocket.js"))})()},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n='\n//start\n// pdu_def.proto\n\n// syntax = "proto3";\n\noption optimize_for = LITE_RUNTIME;\nenum RCPduPriority_E {\n    DP_TOP = 0;\n    DP_HIGH = 1;\n    DP_MEDIUM = 2;\n    DP_LOW = 3;\n}\n\nenum RCPduSegment_E {\n    SEG_BEGIN = 0;\n    SEG_END = 1;\n    SEG_ONCE = 2;\n}\n\nenum RCPduTokenStatus_E {\n    TS_NOT_IN_USE = 0;\n    TS_SELF_GRABBED = 1;\n    TS_OTHER_GRABBED = 2;\n    TS_SELF_INHIBITED = 3;\n    TS_OTHER_INHIBITED = 4;\n    TS_SELF_RECIPIENT = 5;\n    TS_SELF_GIVING = 6;\n    TS_OTHER_GIVING = 7;\n}\n\nenum RCPduType_E {\n// GCC PDU\n    RCPDU_CONNECT_PROVIDER_REQUEST = 0;\n    RCPDU_CONNECT_PROVIDER_RESPONSE = 1;\n    RCPDU_CONFERENCE_JOIN_REQUEST = 2;\n    RCPDU_CONFERENCE_JOIN_RESPONSE = 3;\n    RCPDU_CONFERENCE_INVITE_REQUEST = 10;\n    RCPDU_CONFERENCE_INVITE_RESPONSE = 11;\n    RCPDU_CONFERENCE_LOCK_REQUEST = 20;\n    RCPDU_CONFERENCE_LOCK_RESPONSE = 21;\n    RCPDU_CONFERENCE_LOCK_INDICATION = 22;\n    RCPDU_CONFERENCE_UNLOCK_REQUEST = 30;\n    RCPDU_CONFERENCE_UNLOCK_RESPONSE = 31;\n    RCPDU_CONFERENCE_UNLOCK_INDICATION = 32;\n    RCPDU_CONFERENCE_LEAVE_REQUEST = 39;\n    RCPDU_CONFERENCE_TERMINATE_REQUEST = 40;\n    RCPDU_CONFERENCE_TERMINATE_RESPONSE = 41;\n    RCPDU_CONFERENCE_TERMINATE_INDICATION = 42;\n    RCPDU_CONFERENCE_EJECT_USER_REQUEST = 50;\n    RCPDU_CONFERENCE_EJECT_USER_RESPONSE = 51;\n    RCPDU_CONFERENCE_EJECT_USER_INDICATION = 52;\n    RCPDU_ROSTER_UPDATE_INDICATION = 60;\n    RCPDU_REGISTRY_UPDATE_REQUEST = 70; // INCLUDE ALL OBJS OPERATION\n    RCPDU_REGISTRY_UPDATE_RESPONSE = 71;\n    RCPDU_REGISTRY_UPDATE_INDICATION = 72;\n    RCPDU_FUNCTION_NOT_SUPPORTED_RESPONSE = 80;\n\n    // MCS PDU\n    RCPDU_SESSION_JOIN_REQUEST = 90;\n    RCPDU_SESSION_JOIN_RESPONSE = 91;\n    RCPDU_CHANNEL_GRAB_REQUEST = 100;\n    RCPDU_CHANNEL_GRAB_RESPONSE = 101;\n    RCPDU_CHANNEL_GRAB_INDICATION = 102;\n    RCPDU_CHANNEL_JOIN_REQUEST = 103;\n    RCPDU_CHANNEL_JOIN_RESPONSE = 104;\n    RCPDU_CHANNEL_LEAVE_REQUEST = 105;\n    RCPDU_CHANNEL_RELEASE_REQUEST = 106;\n    RCPDU_CHANNEL_RELEASE_INDICATION = 107;\n    RCPDU_SEND_DATA_REQUEST = 120;\n    RCPDU_SEND_DATA_INDICATION = 121;\n    RCPDU_UNIFORM_SEND_DATA_REQUEST = 125;\n    RCPDU_UNIFORM_SEND_DATA_INDICATION = 126;\n    RCPDU_TOKEN_GRAB_REQUEST = 130;\n    RCPDU_TOKEN_GRAB_CONFIRM = 131;\n    RCPDU_TOKEN_INHIBIT_REQUEST = 132;\n    RCPDU_TOKEN_INHIBIT_CONFIRM = 133;\n    RCPDU_TOKEN_GIVE_REQUEST = 134;\n    RCPDU_TOKEN_GIVE_INDICATION = 135;\n    RCPDU_TOKEN_GIVE_RESPONSE = 136;\n    RCPDU_TOKEN_GIVE_CONFIRM = 137;\n    RCPDU_TOKEN_PLEASE_REQUEST = 138;\n    RCPDU_TOKEN_PLEASE_INDICATION = 139;\n    RCPDU_TOKEN_RELEASE_REQUEST = 140;\n    RCPDU_TOKEN_RELEASE_CONFIRM = 141;\n    RCPDU_TOKEN_TEST_REQUEST = 142;\n    RCPDU_TOKEN_TEST_CONFIRM = 143;\n\n    // Registry PDU\n    RCPDU_REG_REGISTER_KEY = 200;\n    RCPDU_REG_UNREGISTER_KEY = 201;\n    RCPDU_REG_REGISTER_ROSTER = 202;\n    RCPDU_REG_REGISTER_TOKEN = 203;\n    RCPDU_REG_REGISTER_PARAMETER = 204;\n    RCPDU_REG_REGISTER_COUNTER = 205;\n    RCPDU_REG_REGISTER_TABLE = 206;\n    RCPDU_REG_REGISTER_CACHE = 207;\n    RCPDU_REG_REGISTER_OBJ = 208;\n    RCPDU_REG_UNREGISTER_OBJ = 209;\n    RCPDU_REG_UPDATE_OBJ = 210;\n    RCPDU_REG_ADAPTER = 211;\n    RCPDU_REG_CLEANUP_NODE = 212;\n    RCPDU_REG_REGISTER_QUEUE = 213;\n\n    // Registry Obj update PDU\n    RCPDU_REG_TABLE_INSERT_PDU = 230;\n    RCPDU_REG_TABLE_DELETE_PDU = 231;\n    RCPDU_REG_TABLE_UPDATE_PDU = 232;\n    RCPDU_REG_ROSTER_INSERT_PDU = 240;\n    RCPDU_REG_ROSTER_DELETE_PDU = 241;\n    RCPDU_REG_ROSTER_UPDATE_PDU = 242;\n    RCPDU_REG_PARAMETER_UPDATE_PDU = 250;\n    RCPDU_REG_QUEUE_INSERT_PDU = 255;\n    RCPDU_REG_QUEUE_DELETE_PDU = 256;\n    RCPDU_REG_QUEUE_UPDATE_PDU = 257;\n\n    // data\n    RCPDU_CONFERENCE_SEND_DATA_REQUEST = 259;\n    RCPDU_VIDEO_SEND_DATA_REQUEST = 260;\n    RCPDU_AUDIO_SEND_DATA_REQUEST = 261;\n    RCPDU_GIFT_SEND_DATA_REQUEST = 262;\n    RCPDU_CHAT_SEND_DATA_REQUEST = 263;\n    RCPDU_VOTING_POLL_RECORD = 265;\n\n    // Registry resource request or response PDU\n    RCPDU_REG_REQUEST_OBJ = 290;\n    RCPDU_REG_RESPONSE_OBJ = 291;\n    RCPDU_REG_COUNTER_REQUEST_PDU = 292;\n    RCPDU_REG_COUNTER_RESPONSE_PDU = 293;\n\n    // Index exchange\n    RCPDU_INDEX_ADAPTER = 300;\n    RCPDU_INDEX_SERVER_USERS = 301;\n    RCPDU_INDEX_CONFERENCE_USER_JOINED = 302;\n    RCPDU_INDEX_CONFERENCE_USER_EXITED = 303;\n    RCPDU_INDEX_CONFERENCE_USERS = 304;\n}\n\nenum RCPduNodeType_E {\n    NT_TERMINAL = 0;\n    NT_MULTIPORT_TERMINAL = 1;\n    NT_MCU = 2;\n}\n\nenum RCPduReason_E {\n    RSN_USERINITIATED = 0;\n    RSN_DISCONNECTED = 1;\n    RSN_SUPER_LEFT = 2;\n}\n\nenum RCPduResult_E {\n    RET_SUCCESS = 0;\n    RET_USER_REJECTED = 1;\n    RET_INVALID_CONFERENCE = 2;\n    RET_INVALID_PASSWORD = 3;\n    RET_INVALID_CONVENER_PASSWORD = 4;\n    RET_CHALLENGE_RESPONSE_REQUIRED = 5;\n    RET_INVALID_CHALLENGE_RESPONSE = 6;\n    RET_NO_CONNECTION = 7;\n    RET_FULL_CAPACITY = 8;\n}\n\nenum RCPduNodeCategory_E {\n    NC_CONVENTIONAL = 0;\n    NC_COUNTED = 1;\n    NC_ANONYMOUS = 2;\n}\n\nmessage RCConferenceDescriptorPdu {\n    required uint32 id = 1;\n    required bytes name = 2;\n    optional bytes description = 3;\n    //optional string net_address       = 4;\n    optional uint32 mode = 4;\n    optional string password = 5;\n    optional uint32 capacity = 6;\n    optional bytes user_data = 7;\n}\n\nmessage RCNodeRecordPdu {\n    required uint32 id = 1;\n    optional uint32 superior_node = 2;\n    required RCPduNodeType_E type = 3;\n    required string name = 4;\n    required uint32 capability = 5;\n    optional string net_address = 6;\n    optional RCPduNodeCategory_E category = 7;\n}\n\nmessage RCApplicationRecordPdu {\n    required uint32 id = 1; // session id\n    required string name = 2;\n    required string tag = 3;\n    repeated uint32 channel_ids = 4 [packed = true];\n    optional uint32 capability = 5;\n}\n\n//reg.proto\n\noption optimize_for = LITE_RUNTIME;\nmessage RCRegistryRegisterKeyPdu {\n    required RCPduType_E type = 1 [default = RCPDU_REG_REGISTER_KEY];\n    required uint32 id = 2;\n    required string name = 3;\n    required string tag = 4;\n    optional bytes user_data = 5;\n}\n\nmessage RCRegistryUnregisterKeyPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_UNREGISTER_KEY];\n    required uint32 key_id = 2;\n}\n\nmessage RCRegistryRegisterObjPdu {\n    optional RCPduType_E type = 1;\n    required uint32 obj_id = 2;\n    required string name = 3;\n    required string tag = 4;\n    optional uint32 owner = 5;\n    optional bytes user_data = 6;\n}\n\nmessage RCRegistryUnregisterObjPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_UNREGISTER_OBJ];\n    required uint32 obj_id = 2;\n}\n\nmessage RCRegistryUpdateObjPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_UPDATE_OBJ];\n    required RCPduType_E sub_type = 2;\n    required uint32 obj_id = 3;\n    required bytes user_data = 4;\n}\n\nmessage RCAdapterItemPdu {\n    required RCPduType_E type = 1;\n    required bytes item_data = 2;\n}\n\n// adapter pdu that used to package a list of pdu.\nmessage RCAdapterPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_ADAPTER];\n    repeated RCAdapterItemPdu item = 2;\n}\n\n// table operation pdu\nmessage RCRegistryTableItemPdu {\n    required uint32 item_idx = 1;\n    required uint32 owner = 2;\n    required bytes item_data = 3;\n}\n\nmessage RCRegistryTableInsertItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_TABLE_INSERT_PDU];\n    repeated RCRegistryTableItemPdu items = 2;\n}\n\nmessage RCRegistryTableDeleteItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_TABLE_DELETE_PDU];\n    repeated uint32 item_idx = 2;\n}\n\nmessage RCRegistryTableUpdateItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_TABLE_UPDATE_PDU];\n    repeated RCRegistryTableItemPdu items = 2;\n}\n\n// roster operation pdu\nmessage RCRegistryRosterItemPdu {\n    required uint32 node_id = 1;\n    required bytes node_data = 2;\n}\n\nmessage RCRegistryRosterInsertItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_ROSTER_INSERT_PDU];\n    repeated RCRegistryRosterItemPdu items = 2;\n}\n\nmessage RCRegistryRosterDeleteItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_ROSTER_DELETE_PDU];\n    required uint32 node_id = 2;\n}\n\nmessage RCRegistryRosterUpdateItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_ROSTER_UPDATE_PDU];\n    repeated RCRegistryRosterItemPdu items = 2;\n}\n\n//message RCCleanupNodePdu\n//{\n//  optional RCPduType_E    type                = 1 [default = RCPDU_REG_CLEANUP_NODE];\n//  required uint32         node_id             = 2;\n//}\n\n// parameter operation pdu\nmessage RCRegistryParameterUpdatePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_PARAMETER_UPDATE_PDU];\n    required uint32 value = 2 [default = 0];\n    optional uint32 begin_bit = 3 [default = 31];\n    optional uint32 end_bit = 4;\n}\n\n// queue operation pdu\nmessage RCRegistryQueueItemPdu {\n    required uint32 owner = 1;\n    required uint32 item_id = 2;\n    optional bytes item_data = 3;\n    optional uint32 item_idx = 4;\n}\n\nmessage RCRegstryQueueInsertItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_QUEUE_INSERT_PDU];\n    repeated RCRegistryQueueItemPdu items = 2;\n}\n\nmessage RCRegistryQueueDeleteItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_QUEUE_DELETE_PDU];\n    required uint32 item_id = 2;\n}\n\nmessage RCRegistryQueueUpdateItemPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_QUEUE_UPDATE_PDU];\n    repeated RCRegistryQueueItemPdu items = 2;\n}\n\nmessage RCRegistryRequestObjPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_REQUEST_OBJ];\n    required RCPduType_E sub_type = 2;\n    required uint32 obj_id = 3;\n    required bytes user_data = 4;\n}\n\nmessage RCRegistryResponseObjPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_RESPONSE_OBJ];\n    required RCPduType_E sub_type = 2;\n    required uint32 obj_id = 3;\n    required bytes user_data = 4;\n}\n\nmessage RCRegistryCounterRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_COUNTER_REQUEST_PDU];\n    required uint32 count = 2;\n}\n\nmessage RCRegistryCounterResponsePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_REG_COUNTER_RESPONSE_PDU];\n    required uint32 start = 2;\n    required uint32 end = 3;\n}\n\n// mcs\noption optimize_for = LITE_RUNTIME;\n\n// Session management\nmessage RCSessionJoinRequestPdu {\n    required RCPduType_E type = 1 [default = RCPDU_SESSION_JOIN_REQUEST];\n    required uint32 id = 2;\n    required string name = 3;\n    required string tag = 4;\n    optional bytes session_data = 5; //聚合在一起的registry信息\n}\n\nmessage RCSessionJoinResponsePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_SESSION_JOIN_RESPONSE];\n    required uint32 id = 2;\n    optional bytes response_data = 3;\n}\n\n// Channel management\nmessage RCChannelGrabRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CHANNEL_GRAB_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 channel_id = 3;\n}\n\nmessage RCChannelGrabResponsePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CHANNEL_GRAB_RESPONSE];\n    required uint32 initiator = 2;\n    required uint32 requested_channel_id = 3;\n    required RCPduResult_E result = 4;\n    optional uint32 channel_id = 5;\n}\n\nmessage RCChannelGrabIndicationPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CHANNEL_GRAB_INDICATION];\n    required uint32 initiator = 2;\n    optional uint32 channel_id = 3;\n}\n\nmessage RCChannelJoinRequestPdu {\n    required RCPduType_E type = 1 [default = RCPDU_CHANNEL_JOIN_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 channel_id = 3;\n}\n\nmessage RCChannelJoinResponsePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CHANNEL_JOIN_RESPONSE];\n    required uint32 initiator = 2;\n    required uint32 requested_channel_id = 3;\n    required RCPduResult_E result = 4;\n}\n\nmessage RCChannelLeaveRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CHANNEL_LEAVE_REQUEST];\n    required uint32 initiator = 2;\n    repeated uint32 channel_ids = 3 [packed = true];\n}\n\nmessage RCChannelReleaseRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CHANNEL_RELEASE_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 channel_id = 3;\n}\n\nmessage RCChannelReleaseIndicationPdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_CHANNEL_RELEASE_INDICATION];\n    required uint32 initiator = 2;\n    required uint32 channel_id = 3;\n}\n\n// Data transfer\nmessage RCSendDataPdu {\n    required RCPduType_E type = 1 [default = RCPDU_SEND_DATA_REQUEST];\n    required RCPduType_E sub_type = 2;\n    required uint32 initiator = 3;\n    required uint32 conf_id = 4;\n    required uint32 session_id = 5;\n    required uint32 channel_id = 6;\n    required bool upward = 7;\n    required bool reliability = 8;\n    required RCPduPriority_E priority = 9;\n    required bytes data = 10;\n    optional uint32 peer = 11;\n    optional RCPduSegment_E seg = 12;\n    optional uint32 total_size = 13;\n    optional uint32 site_id = 14;\n    optional string user_id = 15;\n    optional string user_name = 16;\n    optional string user_role = 17;\n    optional string device_type = 18;\n    optional string site = 19;\n}\n\n//  Token management\nmessage RCTokenGrabRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_GRAB_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n}\n\nmessage RCTokenGrabConfirmPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_GRAB_CONFIRM];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n    required RCPduResult_E result = 4;\n    required RCPduTokenStatus_E status = 5;\n}\n\nmessage RCTokenInhibitRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_INHIBIT_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n}\n\nmessage RCTokenInhibitConfirmPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_INHIBIT_CONFIRM];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n    required RCPduResult_E result = 4;\n    required RCPduTokenStatus_E status = 5;\n}\n\nmessage RCTokenGiveRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_GIVE_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n    required uint64 recipient = 4;\n}\n\nmessage RCTokenGiveIndicationPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_GIVE_INDICATION];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n    required uint64 recipient = 4;\n}\n\nmessage RCTokenGiveResponsePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_GIVE_RESPONSE];\n    required uint32 token_id = 2;\n    required uint64 recipient = 3;\n    required RCPduResult_E result = 4;\n}\n\nmessage RCTokenGiveConfirmPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_GIVE_CONFIRM];\n    required uint32 token_id = 2;\n    required uint64 recipient = 3;\n    required RCPduResult_E result = 4;\n    required RCPduTokenStatus_E status = 5;\n}\n\nmessage RCTokenPleaseRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_PLEASE_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n}\n\nmessage RCTokenPleaseIndicationPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_PLEASE_INDICATION];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n}\n\nmessage RCTokenReleaseRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_RELEASE_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n}\n\nmessage RCTokenReleaseConfirmPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_TEST_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n    required RCPduResult_E result = 4;\n    required RCPduTokenStatus_E status = 5;\n}\n\nmessage RCTokenTestRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_TEST_REQUEST];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n}\n\nmessage RCTokenTestConfirmPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_TOKEN_TEST_CONFIRM];\n    required uint32 initiator = 2;\n    required uint32 token_id = 3;\n    required RCPduTokenStatus_E status = 4;\n}\n\n//gcc.proto\n\noption optimize_for = LITE_RUNTIME;\nmessage RCConferenceJoinRequestPdu {\n    required RCPduType_E type = 1 [default = RCPDU_CONFERENCE_JOIN_REQUEST];\n    required uint32 initiator = 2;\n    required RCPduNodeType_E node_type = 3;\n    required RCConferenceDescriptorPdu conf_desc = 4;\n}\n\nmessage RCConferenceJoinResponsePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CONFERENCE_JOIN_RESPONSE];\n    required uint32 conf_id = 2;\n    required RCPduResult_E result = 3;\n    optional RCConferenceDescriptorPdu conf_desc = 4;\n}\n\nmessage RCConferenceInviteRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CONFERENCE_INVITE_REQUEST];\n    required uint32 initiator = 2;\n    required RCConferenceDescriptorPdu conf_desc = 3;\n}\n\nmessage RCConferenceInviteResponsePdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_INVITE_RESPONSE];\n    required RCPduResult_E result = 2;\n    optional bytes user_data = 3;\n}\n\nmessage RCConferenceLockRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CONFERENCE_LOCK_REQUEST];\n}\n\nmessage RCConferenceLockResponsePdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CONFERENCE_LOCK_RESPONSE];\n    required RCPduResult_E result = 2;\n}\n\nmessage RCConferenceLockIndicationPdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_LOCK_INDICATION];\n}\n\nmessage RCConferenceUnlockRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CONFERENCE_UNLOCK_REQUEST];\n}\n\nmessage RCConferenceUnlockResponsePdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_UNLOCK_RESPONSE];\n    required RCPduResult_E result = 2;\n}\n\nmessage RCConferenceUnlockIndicationPdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_UNLOCK_INDICATION];\n}\n\nmessage RCConferenceLeaveRequestPdu {\n    optional RCPduType_E type = 1 [default = RCPDU_CONFERENCE_LEAVE_REQUEST];\n    required RCPduReason_E reason = 2;\n}\n\nmessage RCConferenceTerminateRequestPdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_TERMINATE_REQUEST];\n    required RCPduReason_E reason = 2;\n}\n\nmessage RCConferenceTerminateResponsePdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_TERMINATE_RESPONSE];\n    required RCPduResult_E result = 2;\n}\n\nmessage RCConferenceTerminateIndicationPdu { // MCS_Uniform_Send_Data on GCC_Broadcast_Channel\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_TERMINATE_INDICATION];\n    required RCPduReason_E reason = 2;\n}\n\nmessage RCConferenceEjectUserRequestPdu { // MCS_Send_Data on Node ID Channel of Top GCC\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_EJECT_USER_REQUEST];\n    required uint32 ejected_node_id = 2;\n    required RCPduReason_E reason = 3;\n}\n\nmessage RCConferenceEjectUserResponsePdu { // MCS_Send_Data on Node ID Channel of requester\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_EJECT_USER_RESPONSE];\n    required uint32 ejected_node_id = 2;\n    required RCPduResult_E result = 3;\n}\n\nmessage RCConferenceEjectUserIndicationPdu { // MCS_Uniform_Send_Data on GCC_Broadcast_Channel\n    optional RCPduType_E type = 1\n    [default = RCPDU_CONFERENCE_EJECT_USER_INDICATION];\n    required uint32 ejected_node_id = 2;\n    required RCPduReason_E reason = 3;\n}\n\nmessage RCRosterUpdateIndicationPdu { // MCS_Send_Data on Node ID Channel or\n// MCS_Uniform_Send_Data on GCC_Broadcast_Channel\n    optional RCPduType_E type = 1 [default = RCPDU_ROSTER_UPDATE_INDICATION];\n    required bool full_refresh = 2; // Conference Roster and all\n    repeated RCNodeRecordPdu node_record = 3;\n    repeated RCApplicationRecordPdu app_record = 4;\n}\n\nmessage RCRegistryUpdateRequestPdu { // MCS_Send_Data on Node ID Channel of Top GCC\n    optional RCPduType_E type = 1 [default = RCPDU_REGISTRY_UPDATE_REQUEST];\n    required uint32 key_id = 2;\n    required uint32 obj_id = 3;\n    required bytes user_data = 4;\n}\n\nmessage RCRegistryUpdateIndicationPdu { // MCS_Send_Data on Node ID Channel of Top GCC\n    optional RCPduType_E type = 1 [default = RCPDU_REGISTRY_UPDATE_RESPONSE];\n    required uint32 key_id = 2;\n    required uint32 obj_id = 3;\n    required bytes user_data = 4;\n}\n\nmessage RCRegistryUpdateResponsePdu { // MCS_Send_Data on Node ID Channel of requester\n    optional RCPduType_E type = 1 [default = RCPDU_REGISTRY_UPDATE_INDICATION];\n    required uint32 key_id = 2;\n    required uint32 obj_id = 3;\n    required RCPduResult_E result = 4;\n}\n\nmessage RCFunctionNotSupportedResponsePdu {\n    optional RCPduType_E type = 1\n    [default = RCPDU_FUNCTION_NOT_SUPPORTED_RESPONSE];\n    required uint32 request_pdu_id = 2;\n}\n\n//ape.proto\n\noption optimize_for = LITE_RUNTIME;\nmessage RCConferenceSendDataRequestPdu {\n    optional uint32 initiator = 1;\n    optional uint32 peer = 2;\n    required bool is_public = 3;\n    required bytes user_data = 4;\n}\n\nmessage RCChatSendDataRequestPdu {\n    optional uint32 initiator = 1;\n    optional uint32 peer = 2;\n    required bool is_public = 3;\n    required bytes user_data = 4;\n    required uint32 from_role = 5;\n    required bytes from_name = 6;\n}\n\nmessage RCChatSendH5DataRequestPdu {\n    optional uint32 initiator = 1;\n    optional uint32 peer = 2;\n    required bool is_public = 3;\n    required string user_data = 4;\n    required string from_role = 5;\n    required string from_name = 6;\n}\n\nmessage RCDocSendDataRequestPdu {\n    required int32 id = 1;\n    required string doc_type = 2;\n    required string uri  = 3;\n    optional int32 owner = 4;\n    optional int32 from = 5;\n    optional string name = 6;\n    optional int32 cur_page_no = 7;\n    optional int32 cur_H = 8;\n    optional int32 cur_V = 9;\n    optional int32 scale = 10;\n    optional int32 page_num = 11;\n}\n\nmessage RCGiftSendDataRequestPdu {\n    optional uint32 initiator = 1;\n    required uint32 peer = 2;\n    required uint32 index = 3;\n    required uint32 num = 4;\n    optional bytes user_data = 5;\n}\n\nmessage RCAudioSendDataRequestPdu {\n    optional uint32 initiator = 1;\n    required bytes user_data = 2;\n}\n\nmessage RCVideoSendDataRequestPdu {\n    optional uint32 initiator = 1;\n    required bool key_frame = 2;\n    required uint32 sequence_id = 3;\n    required uint32 slice_id = 4;\n    required bytes user_data = 5;\n}\n\nmessage RCAudioChannelInfoRecordPdu {\n    required uint32 status = 1;\n    required uint32 device_id = 2;\n    required uint32 framerate = 3;\n    required uint32 bitrate = 4;\n    required uint32 codec = 5;\n}\n\nmessage RCVideoChannelInfoRecordPdu {\n    optional uint32 status = 1;\n    optional uint32 device_id = 2;\n    optional uint32 width = 3;\n    optional uint32 height = 4;\n    optional uint32 framerate = 5;\n    optional uint32 bitrate = 6;\n    optional uint32 codec = 7;\n    optional string peer_id = 8;\n    optional string url = 9;\n    optional uint32 type = 10;\n    optional string shamlive = 11;\n    optional uint32 livetype = 12;\n    optional uint32 releaseGrab = 13;\n    optional string curTime = 14;\n}\n\nmessage RCAudioDeviceInfoRecordPdu {\n    required uint32 device_id = 1;\n    required string device_name = 2;\n}\n\nmessage RCVideoDeviceInfoRecordPdu {\n    required uint32 device_id = 1;\n    required string device_name = 2;\n}\n\nmessage RCNodeInfoRecordPdu {\n    required uint32 node_id = 1;\n    required string name = 2;\n    required uint32 role = 3;\n    required uint32 level = 4;\n    repeated RCAudioDeviceInfoRecordPdu audio_records = 5;\n    repeated RCVideoDeviceInfoRecordPdu video_records = 6;\n    optional uint32 status = 7;\n    optional bytes user_data = 8;\n    optional string user_id = 9;\n    optional uint32 handUpTime = 10;\n    optional uint32 deviceType = 11;\n    optional uint32 mobileDirection = 12;\n}\n\nmessage RCVotingPollSettingsPdu {\n    required bool timer = 1;\n    optional uint32 time_limit = 2;\n    optional uint32 total_score = 3;\n}\n\nmessage RCVotingPollResultPdu {\n    required string title = 1;\n    required string content = 2;\n    optional uint32 score = 3;\n}\n\nmessage RCVotingPollQuestionPdu {\n    required uint32 index = 1;\n    required uint32 type = 2;\n    required string title = 3;\n    repeated string options = 4;\n    optional uint32 score = 5;\n    optional uint32 time_limit = 6;\n    optional string restrict_input = 7;\n    optional uint32 char_limit = 8;\n    optional string answer = 9;\n    repeated uint32 selections = 10;\n    repeated string responses = 11;\n}\n\nmessage RCVotingPollRecordPdu {\n    required RCVotingPollSettingsPdu settings = 1;\n    required string title = 2;\n    repeated RCVotingPollResultPdu results = 3;\n    repeated RCVotingPollQuestionPdu questions = 4;\n}\n\nmessage RCNodeInfoUserDataPdu {\n    optional string qq = 1;\n    optional string skype = 2;\n    optional string mobile = 3;\n}\n\nmessage RCWhiteboardDataRequestPdu {\n    required uint32 id = 1;\n    required uint32 type = 2;\n    required uint32 initiator = 3;\n    optional bytes action = 4;\n    optional uint32 uncomprLen = 5;\n}\n\nmessage RCTabUpdateDataRequestPdu {\n    optional uint32 id = 1;\n    optional bytes action = 2;\n    optional uint32 uncomprLen =3;\n}\n\n\n\n//end\n';
t.default=n;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&__REACT_HOT_LOADER__.register(n,"default","D:/work/McuClient/src/pdu/pro.js")})()},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function s(e){if(h===clearTimeout)return clearTimeout(e);if((h===r||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(e);try{return h(e)}catch(t){try{return h.call(null,e)}catch(t){return h.call(this,e)}}}function o(){E&&c&&(E=!1,c.length?_=c.concat(_):p=-1,_.length&&a())}function a(){if(!E){var e=i(o);E=!0;for(var t=_.length;t;){for(c=_,_=[];++p<t;)c&&c[p].run();p=-1,t=_.length}c=null,E=!1,s(e)}}function u(e,t){this.fun=e,this.array=t}function f(){}var l,h,d=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(e){l=n}try{h="function"==typeof clearTimeout?clearTimeout:r}catch(e){h=r}}();var c,_=[],E=!1,p=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];_.push(new u(e,t)),1!==_.length||E||i(a)},u.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=f,d.addListener=f,d.once=f,d.off=f,d.removeListener=f,d.removeAllListeners=f,d.emit=f,d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(e,t){"use strict";function n(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function r(e){return 3*e.length/4-n(e)}function i(e){var t,r,i,s,o,a,u=e.length;o=n(e),a=new l(3*u/4-o),i=o>0?u-4:u;var h=0;for(t=0,r=0;t<i;t+=4,r+=3)s=f[e.charCodeAt(t)]<<18|f[e.charCodeAt(t+1)]<<12|f[e.charCodeAt(t+2)]<<6|f[e.charCodeAt(t+3)],a[h++]=s>>16&255,a[h++]=s>>8&255,a[h++]=255&s;return 2===o?(s=f[e.charCodeAt(t)]<<2|f[e.charCodeAt(t+1)]>>4,a[h++]=255&s):1===o&&(s=f[e.charCodeAt(t)]<<10|f[e.charCodeAt(t+1)]<<4|f[e.charCodeAt(t+2)]>>2,a[h++]=s>>8&255,a[h++]=255&s),a}function s(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function o(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(s(r));return i.join("")}function a(e){for(var t,n=e.length,r=n%3,i="",s=[],a=16383,f=0,l=n-r;f<l;f+=a)s.push(o(e,f,f+a>l?l:f+a));return 1===r?(t=e[n-1],i+=u[t>>2],i+=u[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=u[t>>10],i+=u[t>>4&63],i+=u[t<<2&63],i+="="),s.push(i),s.join("")}t.byteLength=r,t.toByteArray=i,t.fromByteArray=a;for(var u=[],f=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,c=h.length;d<c;++d)u[d]=h[d],f[h.charCodeAt(d)]=d;f["-".charCodeAt(0)]=62,f["_".charCodeAt(0)]=63},function(e,t){!function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var n=[],r=0;r<e.length;r+=3)for(var i=e[r]<<16|e[r+1]<<8|e[r+2],s=0;s<4;s++)8*r+6*s<=8*e.length?n.push(t.charAt(i>>>6*(3-s)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,i=0;r<e.length;i=++r%4)0!=i&&n.push((t.indexOf(e.charAt(r-1))&Math.pow(2,-2*i+8)-1)<<2*i|t.indexOf(e.charAt(r))>>>6-2*i);return n}};e.exports=n}()},function(e,t){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function r(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}e.exports=function(e){return null!=e&&(n(e)||r(e)||!!e._isBuffer)}},function(e,t,n){!function(){var t=n(33),r=n(17).utf8,i=n(34),s=n(17).bin,o=function(e,n){e.constructor==String?e=n&&"binary"===n.encoding?s.stringToBytes(e):r.stringToBytes(e):i(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||(e=e.toString());for(var a=t.bytesToWords(e),u=8*e.length,f=1732584193,l=-271733879,h=-1732584194,d=271733878,c=0;c<a.length;c++)a[c]=16711935&(a[c]<<8|a[c]>>>24)|4278255360&(a[c]<<24|a[c]>>>8);a[u>>>5]|=128<<u%32,a[(u+64>>>9<<4)+14]=u;for(var _=o._ff,E=o._gg,p=o._hh,g=o._ii,c=0;c<a.length;c+=16){var R=f,y=l,C=h,T=d;f=_(f,l,h,d,a[c+0],7,-680876936),d=_(d,f,l,h,a[c+1],12,-389564586),h=_(h,d,f,l,a[c+2],17,606105819),l=_(l,h,d,f,a[c+3],22,-1044525330),f=_(f,l,h,d,a[c+4],7,-176418897),d=_(d,f,l,h,a[c+5],12,1200080426),h=_(h,d,f,l,a[c+6],17,-1473231341),l=_(l,h,d,f,a[c+7],22,-45705983),f=_(f,l,h,d,a[c+8],7,1770035416),d=_(d,f,l,h,a[c+9],12,-1958414417),h=_(h,d,f,l,a[c+10],17,-42063),l=_(l,h,d,f,a[c+11],22,-1990404162),f=_(f,l,h,d,a[c+12],7,1804603682),d=_(d,f,l,h,a[c+13],12,-40341101),h=_(h,d,f,l,a[c+14],17,-1502002290),l=_(l,h,d,f,a[c+15],22,1236535329),f=E(f,l,h,d,a[c+1],5,-165796510),d=E(d,f,l,h,a[c+6],9,-1069501632),h=E(h,d,f,l,a[c+11],14,643717713),l=E(l,h,d,f,a[c+0],20,-373897302),f=E(f,l,h,d,a[c+5],5,-701558691),d=E(d,f,l,h,a[c+10],9,38016083),h=E(h,d,f,l,a[c+15],14,-660478335),l=E(l,h,d,f,a[c+4],20,-405537848),f=E(f,l,h,d,a[c+9],5,568446438),d=E(d,f,l,h,a[c+14],9,-1019803690),h=E(h,d,f,l,a[c+3],14,-187363961),l=E(l,h,d,f,a[c+8],20,1163531501),f=E(f,l,h,d,a[c+13],5,-1444681467),d=E(d,f,l,h,a[c+2],9,-51403784),h=E(h,d,f,l,a[c+7],14,1735328473),l=E(l,h,d,f,a[c+12],20,-1926607734),f=p(f,l,h,d,a[c+5],4,-378558),d=p(d,f,l,h,a[c+8],11,-2022574463),h=p(h,d,f,l,a[c+11],16,1839030562),l=p(l,h,d,f,a[c+14],23,-35309556),f=p(f,l,h,d,a[c+1],4,-1530992060),d=p(d,f,l,h,a[c+4],11,1272893353),h=p(h,d,f,l,a[c+7],16,-155497632),l=p(l,h,d,f,a[c+10],23,-1094730640),f=p(f,l,h,d,a[c+13],4,681279174),d=p(d,f,l,h,a[c+0],11,-358537222),h=p(h,d,f,l,a[c+3],16,-722521979),l=p(l,h,d,f,a[c+6],23,76029189),f=p(f,l,h,d,a[c+9],4,-640364487),d=p(d,f,l,h,a[c+12],11,-421815835),h=p(h,d,f,l,a[c+15],16,530742520),l=p(l,h,d,f,a[c+2],23,-995338651),f=g(f,l,h,d,a[c+0],6,-198630844),d=g(d,f,l,h,a[c+7],10,1126891415),h=g(h,d,f,l,a[c+14],15,-1416354905),l=g(l,h,d,f,a[c+5],21,-57434055),f=g(f,l,h,d,a[c+12],6,1700485571),d=g(d,f,l,h,a[c+3],10,-1894986606),h=g(h,d,f,l,a[c+10],15,-1051523),l=g(l,h,d,f,a[c+1],21,-2054922799),f=g(f,l,h,d,a[c+8],6,1873313359),d=g(d,f,l,h,a[c+15],10,-30611744),h=g(h,d,f,l,a[c+6],15,-1560198380),l=g(l,h,d,f,a[c+13],21,1309151649),f=g(f,l,h,d,a[c+4],6,-145523070),d=g(d,f,l,h,a[c+11],10,-1120210379),h=g(h,d,f,l,a[c+2],15,718787259),l=g(l,h,d,f,a[c+9],21,-343485551),f=f+R>>>0,l=l+y>>>0,h=h+C>>>0,d=d+T>>>0}return t.endian([f,l,h,d])};o._ff=function(e,t,n,r,i,s,o){var a=e+(t&n|~t&r)+(i>>>0)+o;return(a<<s|a>>>32-s)+t},o._gg=function(e,t,n,r,i,s,o){var a=e+(t&r|n&~r)+(i>>>0)+o;return(a<<s|a>>>32-s)+t},o._hh=function(e,t,n,r,i,s,o){var a=e+(t^n^r)+(i>>>0)+o;return(a<<s|a>>>32-s)+t},o._ii=function(e,t,n,r,i,s,o){var a=e+(n^(t|~r))+(i>>>0)+o;return(a<<s|a>>>32-s)+t},o._blocksize=16,o._digestsize=16,e.exports=function(e,n){if(void 0===e||null===e)throw new Error("Illegal argument "+e);var r=t.wordsToBytes(o(e,n));return n&&n.asBytes?r:n&&n.asString?s.bytesToString(r):t.bytesToHex(r)}}()},function(e,t,n){var r,i,s;(function(e,o){!function(e,a){n(9).amd?(i=[n(16)],r=a,s="function"==typeof r?r.apply(t,i):r,!(void 0!==s&&(o.exports=s))):"object"==typeof o&&o&&o.exports?o.exports=a(n(16),!0):(e.dcodeIO=e.dcodeIO||{}).ProtoBuf=a(e.dcodeIO.ByteBuffer)}(this,function(t,r){"use strict";var i={};return i.ByteBuffer=t,i.Long=t.Long||null,i.VERSION="5.0.1",i.WIRE_TYPES={},i.WIRE_TYPES.VARINT=0,i.WIRE_TYPES.BITS64=1,i.WIRE_TYPES.LDELIM=2,i.WIRE_TYPES.STARTGROUP=3,i.WIRE_TYPES.ENDGROUP=4,i.WIRE_TYPES.BITS32=5,i.PACKABLE_WIRE_TYPES=[i.WIRE_TYPES.VARINT,i.WIRE_TYPES.BITS64,i.WIRE_TYPES.BITS32],i.TYPES={int32:{name:"int32",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:i.WIRE_TYPES.VARINT,defaultValue:i.Long?i.Long.ZERO:void 0},uint64:{name:"uint64",wireType:i.WIRE_TYPES.VARINT,defaultValue:i.Long?i.Long.UZERO:void 0},sint64:{name:"sint64",wireType:i.WIRE_TYPES.VARINT,defaultValue:i.Long?i.Long.ZERO:void 0},bool:{name:"bool",wireType:i.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:i.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:i.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:i.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:i.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:i.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:i.WIRE_TYPES.BITS64,defaultValue:i.Long?i.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:i.WIRE_TYPES.BITS64,defaultValue:i.Long?i.Long.ZERO:void 0},float:{name:"float",wireType:i.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:i.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:i.WIRE_TYPES.STARTGROUP,defaultValue:null}},i.MAP_KEY_TYPES=[i.TYPES.int32,i.TYPES.sint32,i.TYPES.sfixed32,i.TYPES.uint32,i.TYPES.fixed32,i.TYPES.int64,i.TYPES.sint64,i.TYPES.sfixed64,i.TYPES.uint64,i.TYPES.fixed64,i.TYPES.bool,i.TYPES.string,i.TYPES.bytes],i.ID_MIN=1,i.ID_MAX=536870911,i.convertFieldsToCamelCase=!1,i.populateAccessors=!0,i.populateDefaults=!0,i.Util=function(){var t={};return t.IS_NODE=!("object"!=typeof e||e+""!="[object process]"||e.browser),t.XHR=function(){for(var e=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],t=null,n=0;n<e.length;n++){try{t=e[n]()}catch(e){continue}break}if(!t)throw Error("XMLHttpRequest is not supported");return t},t.fetch=function(e,r){if(r&&"function"!=typeof r&&(r=null),t.IS_NODE){var i=n(39);if(r)i.readFile(e,function(e,t){r(e?null:""+t)});else try{return i.readFileSync(e)}catch(e){return null}}else{var s=t.XHR();if(s.open("GET",e,!!r),s.setRequestHeader("Accept","text/plain"),"function"==typeof s.overrideMimeType&&s.overrideMimeType("text/plain"),!r)return s.send(null),200==s.status||0==s.status&&"string"==typeof s.responseText?s.responseText:null;if(s.onreadystatechange=function(){4==s.readyState&&r(200==s.status||0==s.status&&"string"==typeof s.responseText?s.responseText:null)},4==s.readyState)return;s.send(null)}},t.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,function(e,t){return t.toUpperCase()})},t}(),i.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g},i.DotProto=function(e,t){function n(e,n){var r=-1,i=1;if("-"==e.charAt(0)&&(i=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))r=parseInt(e);else if(t.NUMBER_HEX.test(e))r=parseInt(e.substring(2),16);else{if(!t.NUMBER_OCT.test(e))throw Error("illegal id value: "+(i<0?"-":"")+e);r=parseInt(e.substring(1),8)}if(r=i*r|0,!n&&r<0)throw Error("illegal id value: "+(i<0?"-":"")+e);return r}function r(e){var n=1;if("-"==e.charAt(0)&&(n=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))return n*parseInt(e,10);if(t.NUMBER_HEX.test(e))return n*parseInt(e.substring(2),16);if(t.NUMBER_OCT.test(e))return n*parseInt(e.substring(1),8);if("inf"===e)return n*(1/0);if("nan"===e)return NaN;if(t.NUMBER_FLT.test(e))return n*parseFloat(e);throw Error("illegal number value: "+(n<0?"-":"")+e)}function i(e,t,n){"undefined"==typeof e[t]?e[t]=n:(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(n))}var s={},o=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},a=o.prototype;a._readString=function(){var e='"'===this._stringOpen?t.STRING_DQ:t.STRING_SQ;e.lastIndex=this.index-1;var n=e.exec(this.source);if(!n)throw Error("unterminated string");return this.index=e.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,n[1]},a.next=function(){if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();var e,n,r;do{for(e=!1;t.WHITESPACE.test(r=this.source.charAt(this.index));)if("\n"===r&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,e=!0}else{if("*"!==(r=this.source.charAt(this.index)))return"/";do{if("\n"===r&&++this.line,++this.index===this.source.length)return null;n=r,r=this.source.charAt(this.index)}while("*"!==n||"/"!==r);++this.index,e=!0}}while(e);if(this.index===this.source.length)return null;var i=this.index;t.DELIM.lastIndex=0;var s=t.DELIM.test(this.source.charAt(i++));if(!s)for(;i<this.source.length&&!t.DELIM.test(this.source.charAt(i));)++i;var o=this.source.substring(this.index,this.index=i);return'"'!==o&&"'"!==o||(this._stringOpen=o),o},a.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},a.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},a.omit=function(e){return this.peek()===e&&(this.next(),!0)},a.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},s.Tokenizer=o;var u=function(e){this.tn=new o(e),this.proto3=!1},f=u.prototype;return f.parse=function(){var e,n,r={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},i=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!i||null!==r.package)throw Error("unexpected 'package'");if(e=this.tn.next(),!t.TYPEREF.test(e))throw Error("illegal package name: "+e);this.tn.skip(";"),r.package=e;break;case"import":if(!i)throw Error("unexpected 'import'");e=this.tn.peek(),("public"===e||(n="weak"===e))&&this.tn.next(),e=this._readString(),this.tn.skip(";"),n||r.imports.push(e);break;case"syntax":if(!i)throw Error("unexpected 'syntax'");this.tn.skip("="),"proto3"===(r.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(r,null),i=!1;break;case"enum":this._parseEnum(r),i=!1;break;case"option":this._parseOption(r);break;case"service":this._parseService(r);break;case"extend":this._parseExtend(r);break;default:throw Error("unexpected '"+e+"'")}}catch(e){throw e.message="Parse error at line "+this.tn.line+": "+e.message,e}return delete r.name,r},u.parse=function(e){return new u(e).parse()},f._readString=function(){var e,t,n="";do{if(t=this.tn.next(),"'"!==t&&'"'!==t)throw Error("illegal string delimiter: "+t);n+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return n},f._readValue=function(e){var n=this.tn.peek();if('"'===n||"'"===n)return this._readString();if(this.tn.next(),t.NUMBER.test(n))return r(n);if(t.BOOL.test(n))return"true"===n.toLowerCase();if(e&&t.TYPEREF.test(n))return n;throw Error("illegal value: "+n)},f._parseOption=function(e,n){var r=this.tn.next(),i=!1;if("("===r&&(i=!0,r=this.tn.next()),!t.TYPEREF.test(r))throw Error("illegal option name: "+r);var s=r;i&&(this.tn.skip(")"),s="("+s+")",r=this.tn.peek(),t.FQTYPEREF.test(r)&&(s+=r,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,s),n||this.tn.skip(";")},f._parseOptionValue=function(e,n){var r=this.tn.peek();if("{"!==r)i(e.options,n,this._readValue(!0));else for(this.tn.skip("{");"}"!==(r=this.tn.next());){if(!t.NAME.test(r))throw Error("illegal option name: "+n+"."+r);this.tn.omit(":")?i(e.options,n+"."+r,this._readValue(!0)):this._parseOptionValue(e,n+"."+r)}},f._parseService=function(e){var n=this.tn.next();if(!t.NAME.test(n))throw Error("illegal service name at line "+this.tn.line+": "+n);var r=n,i={name:r,rpc:{},options:{}};for(this.tn.skip("{");"}"!==(n=this.tn.next());)if("option"===n)this._parseOption(i);else{if("rpc"!==n)throw Error("illegal service token: "+n);this._parseServiceRPC(i)}this.tn.omit(";"),e.services.push(i)},f._parseServiceRPC=function(e){var n="rpc",r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal rpc service method name: "+r);var i=r,s={request:null,response:null,request_stream:!1,response_stream:!1,options:{}};if(this.tn.skip("("),r=this.tn.next(),"stream"===r.toLowerCase()&&(s.request_stream=!0,r=this.tn.next()),!t.TYPEREF.test(r))throw Error("illegal rpc service request type: "+r);if(s.request=r,this.tn.skip(")"),r=this.tn.next(),"returns"!==r.toLowerCase())throw Error("illegal rpc service request type delimiter: "+r);if(this.tn.skip("("),r=this.tn.next(),"stream"===r.toLowerCase()&&(s.response_stream=!0,r=this.tn.next()),s.response=r,this.tn.skip(")"),r=this.tn.peek(),"{"===r){for(this.tn.next();"}"!==(r=this.tn.next());){if("option"!==r)throw Error("illegal rpc service token: "+r);this._parseOption(s)}this.tn.omit(";")}else this.tn.skip(";");"undefined"==typeof e[n]&&(e[n]={}),e[n][i]=s},f._parseMessage=function(e,r){var i=!!r,s=this.tn.next(),o={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(s))throw Error("illegal "+(i?"group":"message")+" name: "+s);for(o.name=s,i&&(this.tn.skip("="),r.id=n(this.tn.next()),o.isGroup=!0),s=this.tn.peek(),"["===s&&r&&this._parseFieldOptions(r),this.tn.skip("{");"}"!==(s=this.tn.next());)if(t.RULE.test(s))this._parseMessageField(o,s);else if("oneof"===s)this._parseMessageOneOf(o);else if("enum"===s)this._parseEnum(o);else if("message"===s)this._parseMessage(o);else if("option"===s)this._parseOption(o);else if("service"===s)this._parseService(o);else if("extensions"===s)o.extensions=this._parseExtensionRanges();else if("reserved"===s)this._parseIgnored();else if("extend"===s)this._parseExtend(o);else{if(!t.TYPEREF.test(s))throw Error("illegal message token: "+s);if(!this.proto3)throw Error("illegal field rule: "+s);this._parseMessageField(o,"optional",s)}return this.tn.omit(";"),e.messages.push(o),o},f._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},f._parseMessageField=function(e,r,i){if(!t.RULE.test(r))throw Error("illegal message field rule: "+r);var s,o={rule:r,type:"",name:"",options:{},id:0};if("map"===r){if(i)throw Error("illegal type: "+i);if(this.tn.skip("<"),s=this.tn.next(),!t.TYPE.test(s)&&!t.TYPEREF.test(s))throw Error("illegal message field type: "+s);if(o.keytype=s,this.tn.skip(","),s=this.tn.next(),!t.TYPE.test(s)&&!t.TYPEREF.test(s))throw Error("illegal message field: "+s);if(o.type=s,this.tn.skip(">"),s=this.tn.next(),!t.NAME.test(s))throw Error("illegal message field name: "+s);o.name=s,this.tn.skip("="),o.id=n(this.tn.next()),s=this.tn.peek(),"["===s&&this._parseFieldOptions(o),this.tn.skip(";")}else if(i="undefined"!=typeof i?i:this.tn.next(),"group"===i){var a=this._parseMessage(e,o);if(!/^[A-Z]/.test(a.name))throw Error("illegal group name: "+a.name);o.type=a.name,o.name=a.name.toLowerCase(),this.tn.omit(";")}else{if(!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field type: "+i);if(o.type=i,s=this.tn.next(),!t.NAME.test(s))throw Error("illegal message field name: "+s);o.name=s,this.tn.skip("="),o.id=n(this.tn.next()),s=this.tn.peek(),"["===s&&this._parseFieldOptions(o),this.tn.skip(";")}return e.fields.push(o),o},f._parseMessageOneOf=function(e){var n=this.tn.next();if(!t.NAME.test(n))throw Error("illegal oneof name: "+n);var r,i=n,s=[];for(this.tn.skip("{");"}"!==(n=this.tn.next());)r=this._parseMessageField(e,"optional",n),r.oneof=i,s.push(r.id);this.tn.omit(";"),e.oneofs[i]=s},f._parseFieldOptions=function(e){this.tn.skip("[");for(var t,n=!0;"]"!==(t=this.tn.peek());)n||this.tn.skip(","),this._parseOption(e,!0),n=!1;this.tn.next()},f._parseEnum=function(e){var r={name:"",values:[],options:{}},i=this.tn.next();if(!t.NAME.test(i))throw Error("illegal name: "+i);for(r.name=i,this.tn.skip("{");"}"!==(i=this.tn.next());)if("option"===i)this._parseOption(r);else{if(!t.NAME.test(i))throw Error("illegal name: "+i);this.tn.skip("=");var s={name:i,id:n(this.tn.next(),!0)};i=this.tn.peek(),"["===i&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),r.values.push(s)}this.tn.omit(";"),e.enums.push(r)},f._parseExtensionRanges=function(){var t,n,i,s=[];do{for(n=[];;){switch(t=this.tn.next()){case"min":i=e.ID_MIN;break;case"max":i=e.ID_MAX;break;default:i=r(t)}if(n.push(i),2===n.length)break;if("to"!==this.tn.peek()){n.push(i);break}this.tn.next()}s.push(n)}while(this.tn.omit(","));return this.tn.skip(";"),s},f._parseExtend=function(e){var n=this.tn.next();if(!t.TYPEREF.test(n))throw Error("illegal extend reference: "+n);var r={ref:n,fields:[]};for(this.tn.skip("{");"}"!==(n=this.tn.next());)if(t.RULE.test(n))this._parseMessageField(r,n);else{if(!t.TYPEREF.test(n))throw Error("illegal extend token: "+n);if(!this.proto3)throw Error("illegal field rule: "+n);this._parseMessageField(r,"optional",n)}return this.tn.omit(";"),e.messages.push(r),r},f.toString=function(){return"Parser at line "+this.tn.line},s.Parser=u,s}(i,i.Lang),i.Reflect=function(e){function n(n){if("string"==typeof n&&(n=e.TYPES[n]),"undefined"==typeof n.defaultValue)throw Error("default value for type "+n.name+" is not supported");return n==e.TYPES.bytes?new t(0):n.defaultValue}function r(t,n){if(t&&"number"==typeof t.low&&"number"==typeof t.high&&"boolean"==typeof t.unsigned&&t.low===t.low&&t.high===t.high)return new e.Long(t.low,t.high,"undefined"==typeof n?t.unsigned:n);if("string"==typeof t)return e.Long.fromString(t,n||!1,10);if("number"==typeof t)return e.Long.fromNumber(t,n||!1);throw Error("not convertible to Long")}function i(t,n){var r=n.readVarint32(),s=7&r,o=r>>>3;switch(s){case e.WIRE_TYPES.VARINT:do r=n.readUint8();while(128===(128&r));break;case e.WIRE_TYPES.BITS64:n.offset+=8;break;case e.WIRE_TYPES.LDELIM:r=n.readVarint32(),n.offset+=r;break;case e.WIRE_TYPES.STARTGROUP:i(o,n);break;case e.WIRE_TYPES.ENDGROUP:if(o===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+o+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:n.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+s)}return!0}var s={},o=function(e,t,n){this.builder=e,this.parent=t,this.name=n,this.className},a=o.prototype;a.fqn=function(){for(var e=this.name,t=this;;){if(t=t.parent,null==t)break;e=t.name+"."+e}return e},a.toString=function(e){return(e?this.className+" ":"")+this.fqn()},a.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},s.T=o;var u=function(e,t,n,r,i){o.call(this,e,t,n),this.className="Namespace",this.children=[],this.options=r||{},this.syntax=i||"proto2"},f=u.prototype=Object.create(o.prototype);f.getChildren=function(e){if(e=e||null,null==e)return this.children.slice();for(var t=[],n=0,r=this.children.length;n<r;++n)this.children[n]instanceof e&&t.push(this.children[n]);return t},f.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof d.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof d.Field&&e.name!==e.originalName&&null===this.getChild(e.originalName)))throw Error("Duplicate name in namespace "+this.toString(!0)+": "+e.name);e.name=e.originalName}this.children.push(e)},f.getChild=function(e){for(var t="number"==typeof e?"id":"name",n=0,r=this.children.length;n<r;++n)if(this.children[n][t]===e)return this.children[n];return null},f.resolve=function(e,t){var n="string"==typeof e?e.split("."):e,r=this,i=0;if(""===n[i]){for(;null!==r.parent;)r=r.parent;i++}var o;do{do{if(!(r instanceof s.Namespace)){r=null;break}if(o=r.getChild(n[i]),!o||!(o instanceof s.T)||t&&!(o instanceof s.Namespace)){r=null;break}r=o,i++}while(i<n.length);if(null!=r)break;if(null!==this.parent)return this.parent.resolve(e,t)}while(null!=r);return r},f.qn=function(e){var t=[],n=e;do t.unshift(n.name),n=n.parent;while(null!==n);for(var r=1;r<=t.length;r++){var i=t.slice(t.length-r);if(e===this.resolve(i,e instanceof s.Namespace))return i.join(".")}return e.fqn()},f.build=function(){for(var e,t={},n=this.children,r=0,i=n.length;r<i;++r)e=n[r],e instanceof u&&(t[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(t,"$options",{value:this.buildOpt()}),t},f.buildOpt=function(){for(var e={},t=Object.keys(this.options),n=0,r=t.length;n<r;++n){var i=t[n],s=this.options[t[n]];e[i]=s}return e},f.getOption=function(e){return"undefined"==typeof e?this.options:"undefined"!=typeof this.options[e]?this.options[e]:null},s.Namespace=u;var l=function(t,n,r,i){if(this.type=t,this.resolvedType=n,this.isMapKey=r,this.syntax=i,r&&e.MAP_KEY_TYPES.indexOf(t)<0)throw Error("Invalid map key type: "+t.name)},h=l.prototype;l.defaultFieldValue=n,h.verifyValue=function(n){function i(e,t){throw Error("Illegal value for "+s.toString(!0)+" of type "+s.type.name+": "+e+" ("+t+")")}var s=this;switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:return("number"!=typeof n||n===n&&n%1!==0)&&i(typeof n,"not an integer"),n>4294967295?0|n:n;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof n||n===n&&n%1!==0)&&i(typeof n,"not an integer"),n<0?n>>>0:n;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return r(n,!1)}catch(e){i(typeof n,e.message)}else i(typeof n,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return r(n,!0)}catch(e){i(typeof n,e.message)}else i(typeof n,"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof n&&i(typeof n,"not a boolean"),n;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof n&&i(typeof n,"not a number"),n;case e.TYPES.string:return"string"==typeof n||n&&n instanceof String||i(typeof n,"not a string"),""+n;case e.TYPES.bytes:return t.isByteBuffer(n)?n:t.wrap(n,"base64");case e.TYPES.enum:var o=this.resolvedType.getChildren(e.Reflect.Enum.Value);for(u=0;u<o.length;u++){if(o[u].name==n)return o[u].id;if(o[u].id==n)return o[u].id}if("proto3"===this.syntax)return("number"!=typeof n||n===n&&n%1!==0)&&i(typeof n,"not an integer"),(n>4294967295||n<0)&&i(typeof n,"not in range for uint32"),n;i(n,"not a valid enum value");case e.TYPES.group:case e.TYPES.message:if(n&&"object"==typeof n||i(typeof n,"object expected"),n instanceof this.resolvedType.clazz)return n;if(n instanceof e.Builder.Message){var a={};for(var u in n)n.hasOwnProperty(u)&&(a[u]=n[u]);n=a}return new this.resolvedType.clazz(n)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+n+" (undefined type "+this.type+")")},h.calculateLength=function(n,r){if(null===r)return 0;var i;switch(this.type){case e.TYPES.int32:return r<0?t.calculateVarint64(r):t.calculateVarint32(r);case e.TYPES.uint32:return t.calculateVarint32(r);case e.TYPES.sint32:return t.calculateVarint32(t.zigZagEncode32(r));case e.TYPES.fixed32:case e.TYPES.sfixed32:case e.TYPES.float:return 4;case e.TYPES.int64:case e.TYPES.uint64:return t.calculateVarint64(r);case e.TYPES.sint64:return t.calculateVarint64(t.zigZagEncode64(r));case e.TYPES.fixed64:case e.TYPES.sfixed64:return 8;case e.TYPES.bool:return 1;case e.TYPES.enum:return t.calculateVarint32(r);case e.TYPES.double:return 8;case e.TYPES.string:return i=t.calculateUTF8Bytes(r),t.calculateVarint32(i)+i;case e.TYPES.bytes:if(r.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+r.remaining()+" bytes remaining");return t.calculateVarint32(r.remaining())+r.remaining();case e.TYPES.message:return i=this.resolvedType.calculate(r),t.calculateVarint32(i)+i;case e.TYPES.group:return i=this.resolvedType.calculate(r),i+t.calculateVarint32(n<<3|e.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+r+" (unknown type)")},h.encodeValue=function(n,r,i){if(null===r)return i;switch(this.type){case e.TYPES.int32:r<0?i.writeVarint64(r):i.writeVarint32(r);break;case e.TYPES.uint32:i.writeVarint32(r);break;case e.TYPES.sint32:i.writeVarint32ZigZag(r);break;case e.TYPES.fixed32:i.writeUint32(r);break;case e.TYPES.sfixed32:i.writeInt32(r);break;case e.TYPES.int64:case e.TYPES.uint64:i.writeVarint64(r);break;case e.TYPES.sint64:i.writeVarint64ZigZag(r);break;case e.TYPES.fixed64:i.writeUint64(r);break;case e.TYPES.sfixed64:i.writeInt64(r);break;case e.TYPES.bool:"string"==typeof r?i.writeVarint32("false"===r.toLowerCase()?0:!!r):i.writeVarint32(r?1:0);break;case e.TYPES.enum:i.writeVarint32(r);break;case e.TYPES.float:i.writeFloat32(r);break;case e.TYPES.double:i.writeFloat64(r);break;case e.TYPES.string:i.writeVString(r);break;case e.TYPES.bytes:if(r.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+r.remaining()+" bytes remaining");var s=r.offset;i.writeVarint32(r.remaining()),i.append(r),r.offset=s;break;case e.TYPES.message:var o=(new t).LE();this.resolvedType.encode(r,o),i.writeVarint32(o.offset),i.append(o.flip());break;case e.TYPES.group:this.resolvedType.encode(r,i),i.writeVarint32(n<<3|e.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+r+" (unknown type)")}return i},h.decode=function(t,n,r){if(n!=this.type.wireType)throw Error("Unexpected wire type for element");var i,s;switch(this.type){case e.TYPES.int32:return 0|t.readVarint32();case e.TYPES.uint32:return t.readVarint32()>>>0;case e.TYPES.sint32:return 0|t.readVarint32ZigZag();case e.TYPES.fixed32:return t.readUint32()>>>0;case e.TYPES.sfixed32:return 0|t.readInt32();case e.TYPES.int64:return t.readVarint64();case e.TYPES.uint64:return t.readVarint64().toUnsigned();case e.TYPES.sint64:return t.readVarint64ZigZag();case e.TYPES.fixed64:return t.readUint64();case e.TYPES.sfixed64:return t.readInt64();case e.TYPES.bool:return!!t.readVarint32();case e.TYPES.enum:return t.readVarint32();case e.TYPES.float:return t.readFloat();case e.TYPES.double:return t.readDouble();case e.TYPES.string:return t.readVString();case e.TYPES.bytes:if(s=t.readVarint32(),t.remaining()<s)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+s+" required but got only "+t.remaining());return i=t.clone(),i.limit=i.offset+s,t.offset+=s,i;case e.TYPES.message:return s=t.readVarint32(),this.resolvedType.decode(t,s);case e.TYPES.group:return this.resolvedType.decode(t,-1,r)}throw Error("[INTERNAL] Illegal decode type")},h.valueFromString=function(n){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");
switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return this.verifyValue(parseInt(n));case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return this.verifyValue(n);case e.TYPES.bool:return"true"===n;case e.TYPES.string:return this.verifyValue(n);case e.TYPES.bytes:return t.fromBinary(n)}},h.valueToString=function(t){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===e.TYPES.bytes?t.toString("binary"):t.toString()},s.Element=l;var d=function(e,t,n,r,i,s){u.call(this,e,t,n,r,s),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},c=d.prototype=Object.create(u.prototype);c.build=function(n){if(this.clazz&&!n)return this.clazz;var r=function(e,n){function r(n,i,s,o){if(null===n||"object"!=typeof n){if(o&&o instanceof e.Reflect.Enum){var a=e.Reflect.Enum.getName(o.object,n);if(null!==a)return a}return n}if(t.isByteBuffer(n))return i?n.toBase64():n.toBuffer();if(e.Long.isLong(n))return s?n.toString():e.Long.fromValue(n);var u;if(Array.isArray(n))return u=[],n.forEach(function(e,t){u[t]=r(e,i,s,o)}),u;if(u={},n instanceof e.Map){for(var f=n.entries(),l=f.next();!l.done;l=f.next())u[n.keyElem.valueToString(l.value[0])]=r(l.value[1],i,s,n.valueElem.resolvedType);return u}var h=n.$type,d=void 0;for(var c in n)n.hasOwnProperty(c)&&(h&&(d=h.getChild(c))?u[c]=r(n[c],i,s,d.resolvedType):u[c]=r(n[c],i,s));return u}var i=n.getChildren(e.Reflect.Message.Field),s=n.getChildren(e.Reflect.Message.OneOf),o=function(r,a){e.Builder.Message.call(this);for(var u=0,f=s.length;u<f;++u)this[s[u].name]=null;for(u=0,f=i.length;u<f;++u){var l=i[u];this[l.name]=l.repeated?[]:l.map?new e.Map(l):null,!l.required&&"proto3"!==n.syntax||null===l.defaultValue||(this[l.name]=l.defaultValue)}if(arguments.length>0){var h;if(1!==arguments.length||null===r||"object"!=typeof r||!("function"!=typeof r.encode||r instanceof o)||Array.isArray(r)||r instanceof e.Map||t.isByteBuffer(r)||r instanceof ArrayBuffer||e.Long&&r instanceof e.Long)for(u=0,f=arguments.length;u<f;++u)"undefined"!=typeof(h=arguments[u])&&this.$set(i[u].name,h);else this.$set(r)}},a=o.prototype=Object.create(e.Builder.Message.prototype);a.add=function(t,r,i){var s=n._fieldsByName[t];if(!i){if(!s)throw Error(this+"#"+t+" is undefined");if(!(s instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+s.toString(!0));if(!s.repeated)throw Error(this+"#"+t+" is not a repeated field");r=s.verifyValue(r,!0)}return null===this[t]&&(this[t]=[]),this[t].push(r),this},a.$add=a.add,a.set=function(t,r,i){if(t&&"object"==typeof t){i=r;for(var s in t)t.hasOwnProperty(s)&&"undefined"!=typeof(r=t[s])&&this.$set(s,r,i);return this}var o=n._fieldsByName[t];if(i)this[t]=r;else{if(!o)throw Error(this+"#"+t+" is not a field: undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+o.toString(!0));this[o.name]=r=o.verifyValue(r)}if(o&&o.oneof){var a=this[o.oneof.name];null!==r?(null!==a&&a!==o.name&&(this[a]=null),this[o.oneof.name]=o.name):a===t&&(this[o.oneof.name]=null)}return this},a.$set=a.set,a.get=function(t,r){if(r)return this[t];var i=n._fieldsByName[t];if(!(i&&i instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: undefined");if(!(i instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+i.toString(!0));return this[i.name]},a.$get=a.get;for(var u=0;u<i.length;u++){var f=i[u];f instanceof e.Reflect.Message.ExtensionField||n.builder.options.populateAccessors&&function(e){var t=e.originalName.replace(/(_[a-zA-Z])/g,function(e){return e.toUpperCase().replace("_","")});t=t.substring(0,1).toUpperCase()+t.substring(1);var r=e.originalName.replace(/([A-Z])/g,function(e){return"_"+e}),i=function(t,n){return this[e.name]=n?t:e.verifyValue(t),this},s=function(){return this[e.name]};null===n.getChild("set"+t)&&(a["set"+t]=i),null===n.getChild("set_"+r)&&(a["set_"+r]=i),null===n.getChild("get"+t)&&(a["get"+t]=s),null===n.getChild("get_"+r)&&(a["get_"+r]=s)}(f)}a.encode=function(e,r){"boolean"==typeof e&&(r=e,e=void 0);var i=!1;e||(e=new t,i=!0);var s=e.littleEndian;try{return n.encode(this,e.LE(),r),(i?e.flip():e).LE(s)}catch(t){throw e.LE(s),t}},o.encode=function(e,t,n){return new o(e).encode(t,n)},a.calculate=function(){return n.calculate(this)},a.encodeDelimited=function(e,r){var i=!1;e||(e=new t,i=!0);var s=(new t).LE();return n.encode(this,s,r).flip(),e.writeVarint32(s.remaining()),e.append(s),i?e.flip():e},a.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},a.toArrayBuffer=a.encodeAB,a.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},a.toBuffer=a.encodeNB,a.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},a.toBase64=a.encode64,a.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},a.toHex=a.encodeHex,a.toRaw=function(e,t){return r(this,!!e,!!t,this.$type)},a.encodeJSON=function(){return JSON.stringify(r(this,!0,!0,this.$type))},o.decode=function(e,r,i){"string"==typeof r&&(i=r,r=-1),"string"==typeof e&&(e=t.wrap(e,i?i:"base64")),e=t.isByteBuffer(e)?e:t.wrap(e);var s=e.littleEndian;try{var o=n.decode(e.LE());return e.LE(s),o}catch(t){throw e.LE(s),t}},o.decodeDelimited=function(e,r){if("string"==typeof e&&(e=t.wrap(e,r?r:"base64")),e=t.isByteBuffer(e)?e:t.wrap(e),e.remaining()<1)return null;var i=e.offset,s=e.readVarint32();if(e.remaining()<s)return e.offset=i,null;try{var o=n.decode(e.slice(e.offset,e.offset+s).LE());return e.offset+=s,o}catch(t){throw e.offset+=s,t}},o.decode64=function(e){return o.decode(e,"base64")},o.decodeHex=function(e){return o.decode(e,"hex")},o.decodeJSON=function(e){return new o(JSON.parse(e))},a.toString=function(){return n.toString()};return Object.defineProperty&&(Object.defineProperty(o,"$options",{value:n.buildOpt()}),Object.defineProperty(a,"$options",{value:o.$options}),Object.defineProperty(o,"$type",{value:n}),Object.defineProperty(a,"$type",{value:n})),o}(e,this);this._fields=[],this._fieldsById={},this._fieldsByName={};for(var i,s=0,o=this.children.length;s<o;s++)if(i=this.children[s],i instanceof R||i instanceof d||i instanceof S){if(r.hasOwnProperty(i.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+i.toString(!0)+" cannot override static property '"+i.name+"'");r[i.name]=i.build()}else if(i instanceof d.Field)i.build(),this._fields.push(i),this._fieldsById[i.id]=i,this._fieldsByName[i.name]=i;else if(!(i instanceof d.OneOf||i instanceof T))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[s].toString(!0));return this.clazz=r},c.encode=function(e,t,n){for(var r,i,s=null,o=0,a=this._fields.length;o<a;++o)r=this._fields[o],i=e[r.name],r.required&&null===i?null===s&&(s=r):r.encode(n?i:r.verifyValue(i),t,e);if(null!==s){var u=Error("Missing at least one required field for "+this.toString(!0)+": "+s);throw u.encoded=t,u}return t},c.calculate=function(e){for(var t,n,r=0,i=0,s=this._fields.length;i<s;++i){if(t=this._fields[i],n=e[t.name],t.required&&null===n)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);r+=t.calculate(n,e)}return r},c.decode=function(t,n,r){n="number"==typeof n?n:-1;for(var s,o,a,u,f=t.offset,l=new this.clazz;t.offset<f+n||n===-1&&t.remaining()>0;){if(s=t.readVarint32(),o=7&s,a=s>>>3,o===e.WIRE_TYPES.ENDGROUP){if(a!==r)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+a+" ("+(r?r+" expected":"not a group")+")");break}if(u=this._fieldsById[a]){if(u.repeated&&!u.options.packed)l[u.name].push(u.decode(o,t));else if(u.map){var h=u.decode(o,t);l[u.name].set(h[0],h[1])}else if(l[u.name]=u.decode(o,t),u.oneof){var d=l[u.oneof.name];null!==d&&d!==u.name&&(l[d]=null),l[u.oneof.name]=u.name}}else switch(o){case e.WIRE_TYPES.VARINT:t.readVarint32();break;case e.WIRE_TYPES.BITS32:t.offset+=4;break;case e.WIRE_TYPES.BITS64:t.offset+=8;break;case e.WIRE_TYPES.LDELIM:var c=t.readVarint32();t.offset+=c;break;case e.WIRE_TYPES.STARTGROUP:for(;i(a,t););break;default:throw Error("Illegal wire type for unknown field "+a+" in "+this.toString(!0)+"#decode: "+o)}}for(var _=0,E=this._fields.length;_<E;++_)if(u=this._fields[_],null===l[u.name])if("proto3"===this.syntax)l[u.name]=u.defaultValue;else{if(u.required){var p=Error("Missing at least one required field for "+this.toString(!0)+": "+u.name);throw p.decoded=l,p}e.populateDefaults&&null!==u.defaultValue&&(l[u.name]=u.defaultValue)}return l},s.Message=d;var _=function(t,n,r,i,s,a,u,f,l,h){o.call(this,t,n,a),this.className="Message.Field",this.required="required"===r,this.repeated="repeated"===r,this.map="map"===r,this.keyType=i||null,this.type=s,this.resolvedType=null,this.id=u,this.options=f||{},this.defaultValue=null,this.oneof=l||null,this.syntax=h||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof d.ExtensionField||(this.name=e.Util.toCamelCase(this.name))},E=_.prototype=Object.create(o.prototype);E.build=function(){this.element=new l(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new l(this.keyType,void 0,!0,this.syntax)),"proto3"!==this.syntax||this.repeated||this.map?"undefined"!=typeof this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=l.defaultFieldValue(this.type)},E.verifyValue=function(t,n){function r(e,t){throw Error("Illegal value for "+i.toString(!0)+" of type "+i.type.name+": "+e+" ("+t+")")}n=n||!1;var i=this;if(null===t)return this.required&&r(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&r(typeof t,"proto3 field without field presence cannot be null"),null;var s;if(this.repeated&&!n){Array.isArray(t)||(t=[t]);var o=[];for(s=0;s<t.length;s++)o.push(this.element.verifyValue(t[s]));return o}return this.map&&!n?t instanceof e.Map?t:(t instanceof Object||r(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&r(typeof t,"no array expected"),this.element.verifyValue(t))},E.hasWirePresence=function(t,n){if("proto3"!==this.syntax)return null!==t;if(this.oneof&&n[this.oneof.name]===this.name)return!0;switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return 0!==t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return 0!==t.low||0!==t.high;case e.TYPES.bool:return t;case e.TYPES.float:case e.TYPES.double:return 0!==t;case e.TYPES.string:return t.length>0;case e.TYPES.bytes:return t.remaining()>0;case e.TYPES.enum:return 0!==t;case e.TYPES.message:return null!==t;default:return!0}},E.encode=function(n,r,i){if(null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===n||this.repeated&&0==n.length)return r;try{if(this.repeated){var s;if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){r.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),r.ensureCapacity(r.offset+=1);var o=r.offset;for(s=0;s<n.length;s++)this.element.encodeValue(this.id,n[s],r);var a=r.offset-o,u=t.calculateVarint32(a);if(u>1){var f=r.slice(o,r.offset);o+=u-1,r.offset=o,r.append(f)}r.writeVarint32(a,o-u)}else for(s=0;s<n.length;s++)r.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,n[s],r)}else this.map?n.forEach(function(n,i,s){var o=t.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,i)+t.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,n);r.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),r.writeVarint32(o),r.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,i,r),r.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,n,r)},this):this.hasWirePresence(n,i)&&(r.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,n,r))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+n+" ("+e+")")}return r},E.calculate=function(n,r){if(n=this.verifyValue(n),null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===n||this.repeated&&0==n.length)return 0;var i=0;try{if(this.repeated){var s,o;if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(i+=t.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),o=0,s=0;s<n.length;s++)o+=this.element.calculateLength(this.id,n[s]);i+=t.calculateVarint32(o),i+=o}else for(s=0;s<n.length;s++)i+=t.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,n[s])}else this.map?n.forEach(function(n,r,s){var o=t.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,r)+t.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,n);i+=t.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),i+=t.calculateVarint32(o),i+=o},this):this.hasWirePresence(n,r)&&(i+=t.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,n))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+n+" ("+e+")")}return i},E.decode=function(t,n,r){var i,s,o=!this.map&&t==this.type.wireType||!r&&this.repeated&&this.options.packed&&t==e.WIRE_TYPES.LDELIM||this.map&&t==e.WIRE_TYPES.LDELIM;if(!o)throw Error("Illegal wire type for field "+this.toString(!0)+": "+t+" ("+this.type.wireType+" expected)");if(t==e.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!r){s=n.readVarint32(),s=n.offset+s;for(var a=[];n.offset<s;)a.push(this.decode(this.type.wireType,n,!0));return a}if(this.map){var u=l.defaultFieldValue(this.keyType);if(i=l.defaultFieldValue(this.type),s=n.readVarint32(),n.remaining()<s)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+s+" required but got only "+n.remaining());var f=n.clone();for(f.limit=f.offset+s,n.offset+=s;f.remaining()>0;){var h=f.readVarint32();t=7&h;var d=h>>>3;if(1===d)u=this.keyElement.decode(f,t,d);else{if(2!==d)throw Error("Unexpected tag in map field key/value submessage");i=this.element.decode(f,t,d)}}return[u,i]}return this.element.decode(n,t,this.id)},s.Message.Field=_;var p=function(e,t,n,r,i,s,o){_.call(this,e,t,n,null,r,i,s,o),this.extension};p.prototype=Object.create(_.prototype),s.Message.ExtensionField=p;var g=function(e,t,n){o.call(this,e,t,n),this.fields=[]};s.Message.OneOf=g;var R=function(e,t,n,r,i){u.call(this,e,t,n,r,i),this.className="Enum",this.object=null};R.getName=function(e,t){for(var n,r=Object.keys(e),i=0;i<r.length;++i)if(e[n=r[i]]===t)return n;return null};var y=R.prototype=Object.create(u.prototype);y.build=function(t){if(this.object&&!t)return this.object;for(var n=new e.Builder.Enum,r=this.getChildren(R.Value),i=0,s=r.length;i<s;++i)n[r[i].name]=r[i].id;return Object.defineProperty&&Object.defineProperty(n,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=n},s.Enum=R;var C=function(e,t,n,r){o.call(this,e,t,n),this.className="Enum.Value",this.id=r};C.prototype=Object.create(o.prototype),s.Enum.Value=C;var T=function(e,t,n,r){o.call(this,e,t,n),this.field=r};T.prototype=Object.create(o.prototype),s.Extension=T;var S=function(e,t,n,r){u.call(this,e,t,n,r),this.className="Service",this.clazz=null},I=S.prototype=Object.create(u.prototype);I.build=function(n){return this.clazz&&!n?this.clazz:this.clazz=function(e,n){for(var r=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(e,t,n){setTimeout(n.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},i=r.prototype=Object.create(e.Builder.Service.prototype),s=n.getChildren(e.Reflect.Service.RPCMethod),o=0;o<s.length;o++)!function(e){i[e.name]=function(r,i){try{try{r=e.resolvedRequestType.clazz.decode(t.wrap(r))}catch(e){if(!(e instanceof TypeError))throw e}if(null===r||"object"!=typeof r)throw Error("Illegal arguments");r instanceof e.resolvedRequestType.clazz||(r=new e.resolvedRequestType.clazz(r)),this.rpcImpl(e.fqn(),r,function(t,r){if(t)return void i(t);null===r&&(r="");try{r=e.resolvedResponseType.clazz.decode(r)}catch(e){}return r&&r instanceof e.resolvedResponseType.clazz?void i(null,r):void i(Error("Illegal response type received in service method "+n.name+"#"+e.name))})}catch(e){setTimeout(i.bind(this,e),0)}},r[e.name]=function(t,n,i){new r(t)[e.name](n,i)},Object.defineProperty&&(Object.defineProperty(r[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(i[e.name],"$options",{value:r[e.name].$options}))}(s[o]);return Object.defineProperty&&(Object.defineProperty(r,"$options",{value:n.buildOpt()}),Object.defineProperty(i,"$options",{value:r.$options}),Object.defineProperty(r,"$type",{value:n}),Object.defineProperty(i,"$type",{value:n})),r}(e,this)},s.Service=S;var m=function(e,t,n,r){o.call(this,e,t,n),this.className="Service.Method",this.options=r||{}},v=m.prototype=Object.create(o.prototype);v.buildOpt=f.buildOpt,s.Service.Method=m;var b=function(e,t,n,r,i,s,o,a){m.call(this,e,t,n,a),this.className="Service.RPCMethod",this.requestName=r,this.responseName=i,this.requestStream=s,this.responseStream=o,this.resolvedRequestType=null,this.resolvedResponseType=null};return b.prototype=Object.create(m.prototype),s.Service.RPCMethod=b,s}(i),i.Builder=function(e,t,r){function i(e){e.messages&&e.messages.forEach(function(t){t.syntax=e.syntax,i(t)}),e.enums&&e.enums.forEach(function(t){t.syntax=e.syntax})}var s=function(e){this.ns=new r.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},o=s.prototype;return s.isMessage=function(e){return"string"==typeof e.name&&("undefined"==typeof e.values&&"undefined"==typeof e.rpc)},s.isMessageField=function(e){return"string"==typeof e.rule&&"string"==typeof e.name&&"string"==typeof e.type&&"undefined"!=typeof e.id},s.isEnum=function(e){return"string"==typeof e.name&&!("undefined"==typeof e.values||!Array.isArray(e.values)||0===e.values.length)},s.isService=function(e){return!("string"!=typeof e.name||"object"!=typeof e.rpc||!e.rpc)},s.isExtend=function(e){return"string"==typeof e.ref},o.reset=function(){return this.ptr=this.ns,this},o.define=function(e){if("string"!=typeof e||!t.TYPEREF.test(e))throw Error("illegal namespace: "+e);return e.split(".").forEach(function(e){var t=this.ptr.getChild(e);null===t&&this.ptr.addChild(t=new r.Namespace(this,this.ptr,e)),this.ptr=t},this),this},o.create=function(t){if(!t)return this;if(Array.isArray(t)){if(0===t.length)return this;t=t.slice()}else t=[t];for(var n=[t];n.length>0;){if(t=n.pop(),!Array.isArray(t))throw Error("not a valid namespace: "+JSON.stringify(t));for(;t.length>0;){var i=t.shift();if(s.isMessage(i)){var o=new r.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax),a={};i.oneofs&&Object.keys(i.oneofs).forEach(function(e){o.addChild(a[e]=new r.Message.OneOf(this,o,e))},this),i.fields&&i.fields.forEach(function(e){if(null!==o.getChild(0|e.id))throw Error("duplicate or invalid field id in "+o.name+": "+e.id);if(e.options&&"object"!=typeof e.options)throw Error("illegal field options in "+o.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=a[e.oneof]))throw Error("illegal oneof in "+o.name+"#"+e.name+": "+e.oneof);e=new r.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),t&&t.fields.push(e),o.addChild(e)},this);var u=[];if(i.enums&&i.enums.forEach(function(e){u.push(e)}),i.messages&&i.messages.forEach(function(e){u.push(e)}),i.services&&i.services.forEach(function(e){u.push(e)}),i.extensions&&("number"==typeof i.extensions[0]?o.extensions=[i.extensions]:o.extensions=i.extensions),this.ptr.addChild(o),u.length>0){n.push(t),t=u,u=null,this.ptr=o,o=null;continue}u=null}else if(s.isEnum(i))o=new r.Enum(this,this.ptr,i.name,i.options,i.syntax),i.values.forEach(function(e){o.addChild(new r.Enum.Value(this,o,e.name,e.id))},this),this.ptr.addChild(o);else if(s.isService(i))o=new r.Service(this,this.ptr,i.name,i.options),Object.keys(i.rpc).forEach(function(e){var t=i.rpc[e];o.addChild(new r.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))},this),this.ptr.addChild(o);else{if(!s.isExtend(i))throw Error("not a valid definition: "+JSON.stringify(i));if(o=this.ptr.resolve(i.ref,!0))i.fields.forEach(function(t){if(null!==o.getChild(0|t.id))throw Error("duplicate extended field id in "+o.name+": "+t.id);if(o.extensions){var n=!1;if(o.extensions.forEach(function(e){t.id>=e[0]&&t.id<=e[1]&&(n=!0)}),!n)throw Error("illegal extended field id in "+o.name+": "+t.id+" (not within valid ranges)")}var i=t.name;this.options.convertFieldsToCamelCase&&(i=e.Util.toCamelCase(i));var s=new r.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn()+"."+i,t.id,t.options),a=new r.Extension(this,this.ptr,t.name,s);s.extension=a,this.ptr.addChild(a),o.addChild(s)},this);else if(!/\.?google\.protobuf\./.test(i.ref))throw Error("extended message "+i.ref+" is not defined")}i=null,o=null}t=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},o.import=function(t,r){var s="/";if("string"==typeof r){if(e.Util.IS_NODE&&(r=n(21).resolve(r)),this.files[r]===!0)return this.reset();this.files[r]=!0}else if("object"==typeof r){var o=r.root;e.Util.IS_NODE&&(o=n(21).resolve(o)),(o.indexOf("\\")>=0||r.file.indexOf("\\")>=0)&&(s="\\");var a=o+s+r.file;if(this.files[a]===!0)return this.reset();this.files[a]=!0}if(t.imports&&t.imports.length>0){var u,f=!1;"object"==typeof r?(this.importRoot=r.root,f=!0,u=this.importRoot,r=r.file,(u.indexOf("\\")>=0||r.indexOf("\\")>=0)&&(s="\\")):"string"==typeof r?this.importRoot?u=this.importRoot:r.indexOf("/")>=0?(u=r.replace(/\/[^\/]*$/,""),""===u&&(u="/")):r.indexOf("\\")>=0?(u=r.replace(/\\[^\\]*$/,""),s="\\"):u=".":u=null;for(var l=0;l<t.imports.length;l++)if("string"==typeof t.imports[l]){if(!u)throw Error("cannot determine import root");var h=t.imports[l];if("google/protobuf/descriptor.proto"===h)continue;if(h=u+s+h,this.files[h]===!0)continue;/\.proto$/i.test(h)&&!e.DotProto&&(h=h.replace(/\.proto$/,".json"));var d=e.Util.fetch(h);if(null===d)throw Error("failed to import '"+h+"' in '"+r+"': file not found");/\.json$/i.test(h)?this.import(JSON.parse(d+""),h):this.import(e.DotProto.Parser.parse(d),h)}else r?/\.(\w+)$/.test(r)?this.import(t.imports[l],r.replace(/^(.+)\.(\w+)$/,function(e,t,n){return t+"_import"+l+"."+n})):this.import(t.imports[l],r+"_import"+l):this.import(t.imports[l]);f&&(this.importRoot=null)}t.package&&this.define(t.package),t.syntax&&i(t);var c=this.ptr;return t.options&&Object.keys(t.options).forEach(function(e){c.options[e]=t.options[e]}),t.messages&&(this.create(t.messages),this.ptr=c),t.enums&&(this.create(t.enums),this.ptr=c),t.services&&(this.create(t.services),this.ptr=c),t.extends&&this.create(t.extends),this.reset()},o.resolveAll=function(){var n;if(null==this.ptr||"object"==typeof this.ptr.type)return this;if(this.ptr instanceof r.Namespace)this.ptr.children.forEach(function(e){this.ptr=e,this.resolveAll()},this);else if(this.ptr instanceof r.Message.Field){if(t.TYPE.test(this.ptr.type))this.ptr.type=e.TYPES[this.ptr.type];else{if(!t.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(n=(this.ptr instanceof r.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0),!n)throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=n,n instanceof r.Enum){if(this.ptr.type=e.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==n.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(n instanceof r.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=n.isGroup?e.TYPES.group:e.TYPES.message}}if(this.ptr.map){if(!t.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=e.TYPES[this.ptr.keyType]}}else if(this.ptr instanceof e.Reflect.Service.Method){if(!(this.ptr instanceof e.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(n=this.ptr.parent.resolve(this.ptr.requestName,!0),!(n&&n instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=n,n=this.ptr.parent.resolve(this.ptr.responseName,!0),!(n&&n instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=n}else if(!(this.ptr instanceof e.Reflect.Message.OneOf||this.ptr instanceof e.Reflect.Extension||this.ptr instanceof e.Reflect.Enum.Value))throw Error("illegal object in namespace: "+typeof this.ptr+": "+this.ptr);return this.reset()},o.build=function(e){if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!e)return this.result;for(var t="string"==typeof e?e.split("."):e,n=this.result,r=0;r<t.length;r++){if(!n[t[r]]){n=null;break}n=n[t[r]]}return n},o.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},o.toString=function(){return"Builder"},s.Message=function(){},s.Enum=function(){},s.Service=function(){},s}(i,i.Lang,i.Reflect),i.Map=function(e,t){function n(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}var r=function(e,n){if(!e.map)throw Error("field is not a map");if(this.field=e,this.keyElem=new t.Element(e.keyType,null,!0,e.syntax),this.valueElem=new t.Element(e.type,e.resolvedType,!1,e.syntax),this.map={},Object.defineProperty(this,"size",{get:function(){return Object.keys(this.map).length}}),n)for(var r=Object.keys(n),i=0;i<r.length;i++){var s=this.keyElem.valueFromString(r[i]),o=this.valueElem.verifyValue(n[r[i]]);this.map[this.keyElem.valueToString(s)]={key:s,value:o}}},i=r.prototype;return i.clear=function(){this.map={}},i.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),n=t in this.map;return delete this.map[t],n},i.entries=function(){for(var e,t=[],r=Object.keys(this.map),i=0;i<r.length;i++)t.push([(e=this.map[r[i]]).key,e.value]);return n(t)},i.keys=function(){for(var e=[],t=Object.keys(this.map),r=0;r<t.length;r++)e.push(this.map[t[r]].key);return n(e)},i.values=function(){for(var e=[],t=Object.keys(this.map),r=0;r<t.length;r++)e.push(this.map[t[r]].value);return n(e)},i.forEach=function(e,t){for(var n,r=Object.keys(this.map),i=0;i<r.length;i++)e.call(t,(n=this.map[r[i]]).value,n.key,this)},i.set=function(e,t){var n=this.keyElem.verifyValue(e),r=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(n)]={key:n,value:r},this},i.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));if(t in this.map)return this.map[t].value},i.has=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));return t in this.map},r}(i,i.Reflect),i.loadProto=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=void 0),i.loadJson(i.DotProto.Parser.parse(e),t,n)},i.protoFromString=i.loadProto,i.loadProtoFile=function(e,t,n){if(t&&"object"==typeof t?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return i.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,function(r){if(null===r)return void t(Error("Failed to fetch file"));try{t(null,i.loadProto(r,n,e))}catch(e){t(e)}});var r=i.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===r?null:i.loadProto(r,n,e)},i.protoFromFile=i.loadProtoFile,i.newBuilder=function(e){return e=e||{},"undefined"==typeof e.convertFieldsToCamelCase&&(e.convertFieldsToCamelCase=i.convertFieldsToCamelCase),"undefined"==typeof e.populateAccessors&&(e.populateAccessors=i.populateAccessors),new i.Builder(e)},i.loadJson=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=null),t&&"object"==typeof t||(t=i.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),t.import(e,n),t.resolveAll(),t},i.loadJsonFile=function(e,t,n){if(t&&"object"==typeof t?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return i.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,function(r){if(null===r)return void t(Error("Failed to fetch file"));try{t(null,i.loadJson(JSON.parse(r),n,e))}catch(e){t(e)}});var r=i.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===r?null:i.loadJson(JSON.parse(r),n,e)},i})}).call(t,n(31),n(7)(e))},function(e,t){String.fromCodePoint||!function(){var e=function(){try{var e={},t=Object.defineProperty,n=t(e,e,e)&&t}catch(e){}return n}(),t=String.fromCharCode,n=Math.floor,r=function(e){var r,i,s=16384,o=[],a=-1,u=arguments.length;if(!u)return"";for(var f="";++a<u;){var l=Number(arguments[a]);if(!isFinite(l)||l<0||l>1114111||n(l)!=l)throw RangeError("Invalid code point: "+l);l<=65535?o.push(l):(l-=65536,r=(l>>10)+55296,i=l%1024+56320,o.push(r,i)),(a+1==u||o.length>s)&&(f+=t.apply(null,o),o.length=0)}return f};e?e(String,"fromCodePoint",{value:r,configurable:!0,writable:!0}):String.fromCodePoint=r}()},function(e,t){String.prototype.codePointAt||!function(){"use strict";var e=function(){try{var e={},t=Object.defineProperty,n=t(e,e,e)&&t}catch(e){}return n}(),t=function(e){if(null==this)throw TypeError();var t=String(this),n=t.length,r=e?Number(e):0;if(r!=r&&(r=0),!(r<0||r>=n)){var i,s=t.charCodeAt(r);return s>=55296&&s<=56319&&n>r+1&&(i=t.charCodeAt(r+1),i>=56320&&i<=57343)?1024*(s-55296)+i-56320+65536:s}};e?e(String.prototype,"codePointAt",{value:t,configurable:!0,writable:!0}):String.prototype.codePointAt=t}()},21]))});