/*! * * swRTC sdk update at Wed Feb 23 2022 11:15:25 GMT+0800 (GMT+08:00), by lxl; * 1.model optimize; * 2.auth token; * 3.bug fix; * */ (window.webpackJsonp=window.webpackJsonp||[]).push([[1],{0:function(e,t){},"0PJp":function(e,t,n){},"7Szd":function(e,t,n){},"9/Cq":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return Ajax}));var qs__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("Qyje"),qs__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_0__),md5=__webpack_require__("aCH8"),str2utf8=window.TextEncoder?function(e){for(var t=new TextEncoder("utf8").encode(e),n="",i=0;i0;)if("="!=t){c++;var d=t.charCodeAt();if(!((t=i[d])<0)){switch(r%4){case 0:a=t<<2;break;case 1:a|=t>>4,o+=String.fromCharCode(a),a=(15&t)<<4;break;case 2:a|=t>>2,o+=String.fromCharCode(a),a=(3&t)<<6;break;case 3:a|=t,o+=String.fromCharCode(a)}r++}}else if("="!=s[c++]&&r%4==1)return NULL;return o},getSessionId:function(){for(var e=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],t="",n=0;n<32;n++){t+=e[parseInt(61*Math.random())]}return t},shangbao:function(e){var t={projectId:this.projectId,businessId:this.businessId,data:this.rptData},n=this._params(t);this.native_jsonp().send("https://datapolaris.shunwang.com/commonReport/jsReport?"+n+"&callback=swcallback&_t="+(new Date).getTime(),{callbackName:"swcallback",onSuccess:function(t){e&&e(t)},onTimeout:function(t){e&&e()},timeout:3})},swcallback:function(e){}};function Ajax(e){var t=e.data,n=(e.success,e.failed,e.id);SwPvReport.businessId=n,SwPvReport.rptData=t,SwPvReport.shangbao()}},EfXH:function(e,t,n){},IUVT:function(e,t,n){},K1c7:function(e,t,n){},NA3w:function(e,t,n){"use strict";n.r(t);var i={};n.r(i),n.d(i,"P2PClient",(function(){return Be})),n.d(i,"P2PError",(function(){return H}));var a=n("QILm"),r=n.n(a),o=n("lSNA"),s=n.n(o),c=n("o0o1"),d=n.n(c),l=n("yXPU"),u=n.n(l),p=(n("LvDl"),n("RIqP")),h=n.n(p),v=n("cDf5"),f=n.n(v),m=n("lwsE"),y=n.n(m),g=n("W8MJ"),b=n.n(g),k=n("PJYZ"),_=n.n(k),w=n("7W2i"),S=n.n(w),P=n("a1gu"),E=n.n(P),x=n("Nsbk"),T=n.n(x),C=n("ym5e"),R=n.n(C),M=n("j6EF"),I=n.n(M),O=(n("0JNz"),function(){var e=function(){},t={DEBUG:0,TRACE:1,INFO:2,WARNING:3,ERROR:4,NONE:5};t.log=window.console.log.bind(window.console);var n=function(e){return"function"==typeof window.console[e]?window.console[e].bind(window.console):window.console.log.bind(window.console)},i=function(i){t.debug=i<=0?n("log"):e,t.trace=i<=1?n("trace"):e,t.info=i<=2?n("info"):e,t.warning=i<=3?n("warn"):e,t.error=i<=4?n("error"):e};return i(4),t.setLogLevel=i,t}());function L(e){return function(){var t,n=T()(e);if(D()){var i=T()(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return E()(this,t)}}function D(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}var A=function(){var e={dispatcher:{}};e.dispatcher.eventListeners={},this.addEventListener=function(t,n){void 0===e.dispatcher.eventListeners[t]&&(e.dispatcher.eventListeners[t]=[]),e.dispatcher.eventListeners[t].push(n)},this.removeEventListener=function(t,n){if(e.dispatcher.eventListeners[t]){var i=e.dispatcher.eventListeners[t].indexOf(n);-1!==i&&e.dispatcher.eventListeners[t].splice(i,1)}},this.clearEventListener=function(t){e.dispatcher.eventListeners[t]=[]},this.dispatchEvent=function(t){e.dispatcher.eventListeners[t.type]&&e.dispatcher.eventListeners[t.type].map((function(e){e(t)}))}},N=function e(t){y()(this,e),this.type=t},B=function(e){S()(n,e);var t=L(n);function n(e,i){var a;return y()(this,n),(a=t.call(this,e)).origin=i.origin,a.message=i.message,a.to=i.to,a}return n}(N),j=n("oShl"),z=n.n(j);function U(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}var F={P2P_CONN_SERVER_UNKNOWN:{code:2100,message:"Server unknown error."},P2P_CONN_SERVER_UNAVAILABLE:{code:2101,message:"Server is unavaliable."},P2P_CONN_SERVER_BUSY:{code:2102,message:"Server is too busy."},P2P_CONN_SERVER_NOT_SUPPORTED:{code:2103,message:"Method has not been supported by server."},P2P_CONN_CLIENT_UNKNOWN:{code:2110,message:"Client unknown error."},P2P_CONN_CLIENT_NOT_INITIALIZED:{code:2111,message:"Connection is not initialized."},P2P_CONN_AUTH_UNKNOWN:{code:2120,message:"Authentication unknown error."},P2P_CONN_AUTH_FAILED:{code:2121,message:"Wrong username or token."},P2P_MESSAGING_TARGET_UNREACHABLE:{code:2201,message:"Remote user cannot be reached."},P2P_CLIENT_DENIED:{code:2202,message:"User is denied."},P2P_CLIENT_UNKNOWN:{code:2400,message:"Unknown errors."},P2P_CLIENT_UNSUPPORTED_METHOD:{code:2401,message:"This method is unsupported in current browser."},P2P_CLIENT_ILLEGAL_ARGUMENT:{code:2402,message:"Illegal argument."},P2P_CLIENT_INVALID_STATE:{code:2403,message:"Invalid peer state."},P2P_CLIENT_NOT_ALLOWED:{code:2404,message:"Remote user is not allowed."},P2P_WEBRTC_UNKNOWN:{code:2500,message:"WebRTC error."},P2P_WEBRTC_SDP:{code:2502,message:"SDP error."},P2P_REMOTO_BUSSY:{code:3e3,message:"Remote server is bussy"}};function W(e){return{2100:F.P2P_CONN_SERVER_UNKNOWN,2101:F.P2P_CONN_SERVER_UNAVAILABLE,2102:F.P2P_CONN_SERVER_BUSY,2103:F.P2P_CONN_SERVER_NOT_SUPPORTED,2110:F.P2P_CONN_CLIENT_UNKNOWN,2111:F.P2P_CONN_CLIENT_NOT_INITIALIZED,2120:F.P2P_CONN_AUTH_UNKNOWN,2121:F.P2P_CONN_AUTH_FAILED,2201:F.P2P_MESSAGING_TARGET_UNREACHABLE,2400:F.P2P_CLIENT_UNKNOWN,2401:F.P2P_CLIENT_UNSUPPORTED_METHOD,2402:F.P2P_CLIENT_ILLEGAL_ARGUMENT,2403:F.P2P_CLIENT_INVALID_STATE,2404:F.P2P_CLIENT_NOT_ALLOWED,2500:F.P2P_WEBRTC_UNKNOWN,2501:F.P2P_WEBRTC_SDP,3e3:F.P2P_REMOTO_BUSSY}[e]}var H=function(e){S()(i,e);var t,n=(t=i,function(){var e,n=T()(t);if(U()){var i=T()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return E()(this,e)});function i(e,t){var a;return y()(this,i),(a=n.call(this,t)).code="number"==typeof e?e:e.code,a}return i}(z()(Error)),G=n("J4zp"),V=n.n(G);function q(){return/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent)}function J(){return"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function K(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}var X=function(e){S()(i,e);var t,n=(t=i,function(){var e,n=T()(t);if(K()){var i=T()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return E()(this,e)});function i(e,t,a,r,o){var s;return y()(this,i),s=n.call(this),Object.defineProperty(_()(s),"id",{configurable:!1,writable:!1,value:e||J()}),s.stop=t,s.getStats=a,s.mute=r,s.unmute=o,s}return i}(A);function Y(e){return function(){var t,n=T()(e);if(Q()){var i=T()(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return E()(this,t)}}function Q(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function Z(e,t){return t.some((function(t){return t===e}))}var $=function e(t,n){if(y()(this,e),!Z(t,[void 0,"mic","screen-cast","file","mixed"]))throw new TypeError("Incorrect value for audioSourceInfo");if(!Z(n,[void 0,"camera","screen-cast","file","encoded-file","raw-file","mixed"]))throw new TypeError("Incorrect value for videoSourceInfo");this.audio=t,this.video=n},ee=function(e){S()(n,e);var t=Y(n);function n(e,i,a){var r;if(y()(this,n),r=t.call(this),e&&!(e instanceof MediaStream)||"object"!==f()(i))throw new TypeError("Invalid stream or sourceInfo.");if(e&&(e.getAudioTracks().length>0&&!i.audio||e.getVideoTracks().length>0&&!i.video))throw new TypeError("Missing audio source info or video source info.");return Object.defineProperty(_()(r),"mediaStream",{configurable:!1,writable:!0,value:e}),Object.defineProperty(_()(r),"source",{configurable:!1,writable:!1,value:i}),Object.defineProperty(_()(r),"attributes",{configurable:!0,writable:!1,value:a}),r}return n}(A),te=function(e){S()(n,e);var t=Y(n);function n(e,i,a){var r;if(y()(this,n),!(e instanceof MediaStream))throw new TypeError("Invalid stream.");return r=t.call(this,e,i,a),Object.defineProperty(_()(r),"id",{configurable:!1,writable:!1,value:J()}),r}return n}(ee),ne=function(e){S()(n,e);var t=Y(n);function n(e,i,a,r,o){var s;return y()(this,n),s=t.call(this,a,r,o),Object.defineProperty(_()(s),"id",{configurable:!1,writable:!1,value:e||J()}),Object.defineProperty(_()(s),"origin",{configurable:!1,writable:!1,value:i}),s.settings=void 0,s.extraCapabilities=void 0,s}return n}(ee),ie=function(e){S()(n,e);var t=Y(n);function n(e,i){var a;return y()(this,n),(a=t.call(this,e)).stream=i.stream,a}return n}(N);function ae(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(!e)return;if("string"==typeof e)return re(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return re(e,t)}(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a,r=!0,o=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return r=e.done,e},e:function(e){o=!0,a=e},f:function(){try{r||null==i.return||i.return()}finally{if(o)throw a}}}}function re(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0;i--)e[i].match(n)&&e.splice(i,1);return e}function me(e,t,n){if(!n||0===n.length)return e;n="audio"===t?n.concat(he):n.concat(ve);var i=e.split("\r\n"),a=le(i,"m=",t);if(null===a)return e;var r=i[a].split(" ");r.splice(0,3);var o,s=[],c=ae(n);try{for(c.s();!(o=c.n()).done;)for(var d=o.value,l=0;l=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a,r=!0,o=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return r=e.done,e},e:function(e){o=!0,a=e},f:function(){try{r||null==i.return||i.return()}finally{if(o)throw a}}}}function be(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0||e.search("H264")<0)return e;for(var n=e.match(/rtpmap:(.+?)H264/)[1],i="apt="+n,a="",r=e.split("\n"),o=0;o=0;o--){var s=!a||-1==r[o].search("a=fmtp:"+a)&&-1==r[o].search("a=rtpmap:"+a);-1!=r[o].search("m=video")&&(r[o]=r[o].replace(n,"")),-1==r[o].search("a=rtpmap:"+n)&&-1==r[o].search("a=rtcp-fb:"+n)&&-1==r[o].search("a=fmtp:"+n)&&s||r.splice(o,1)}return r.join("\n")}},{key:"_createAndSendAnswer",value:function(){var e,t=this;this._drainPendingStreams(),this._isNegotiationNeeded=!1,this._isCaller=!1,this._pc.createAnswer().then((function(n){return n.sdp=t._filterSDP(n.sdp),n.sdp=t._setRtpReceiverOptions(n.sdp),e=n,!window.my_owt_localDesc_answer&&n.sdp&&n.sdp.indexOf("m=video ")>=0&&(window.my_owt_localDesc_answer=n,O.warning("get local sdp for resolve codec")),t._logCurrentAndPendingLocalDescription(),t._pc.setLocalDescription(n)})).then((function(){return t._sendSdp(e)})).catch((function(e){O.error(e.message+" Please check your codec settings.");var n=new H(F.P2P_WEBRTC_SDP,e.message);t._stop(n,!0)}))}},{key:"_logCurrentAndPendingLocalDescription",value:function(){O.info("Current description: "+this._pc.currentLocalDescription),O.info("Pending description: "+this._pc.pendingLocalDescription)}},{key:"_getAndDeleteTrackSourceInfo",value:function(e){if(e.length>0){var t=e[0].id;if(this._remoteTrackSourceInfo.has(t)){var n=this._remoteTrackSourceInfo.get(t);return this._remoteTrackSourceInfo.delete(t),n}O.warning("Cannot find source info for "+t)}}},{key:"_unpublish",value:function(e){var t=this;return navigator.mozGetUserMedia||!this._remoteSideSupportsRemoveStream?(O.error("Stopping a publication is not supported on Firefox. Please use P2PClient.stop() to stop the connection with remote endpoint."),Promise.reject(new H(F.P2P_CLIENT_UNSUPPORTED_METHOD))):this._publishedStreams.has(e)?(this._pendingUnpublishStreams.push(e),new Promise((function(n,i){t._unpublishPromises.set(e.mediaStream.id,{resolve:n,reject:i}),t._drainPendingStreams()}))):Promise.reject(new H(F.P2P_CLIENT_ILLEGAL_ARGUMENT))}},{key:"_createDataChannel",value:function(e){if(this._dataChannels.has(e))O.warning("Data channel labeled "+e+" already exists.");else if(this._pc){O.debug("Create data channel.");var t=this._pc.createDataChannel(e);this._bindEventsToDataChannel(t),this._dataChannels.set(we,t),this._onNegotiationneeded()}else O.debug("PeerConnection is not available before creating DataChannel.")}},{key:"_bindEventsToDataChannel",value:function(e){var t=this;e.onmessage=function(e){t._onDataChannelMessage.apply(t,[e])},e.onopen=function(e){t._onDataChannelOpen.apply(t,[e])},e.onclose=function(e){t._onDataChannelClose.apply(t,[e])},e.onerror=function(e){t.dispatchEvent(new B("channel-error",{origin:t._remoteId,message:e})),O.debug("Data Channel Error: "+e)}}},{key:"_getStreamByTrack",value:function(e){var t,n=[],i=ge(this._remoteStreamInfo);try{for(i.s();!(t=i.n()).done;){var a=V()(t.value,2)[1];if(a.stream&&a.stream.mediaStream){var r,o=ge(a.stream.mediaStream.getTracks());try{for(o.s();!(r=o.n()).done;){e===r.value&&n.push(a.stream.mediaStream)}}catch(e){o.e(e)}finally{o.f()}}}}catch(e){i.e(e)}finally{i.f()}return n}},{key:"_areAllTracksEnded",value:function(e){var t,n=ge(e.getTracks());try{for(n.s();!(t=n.n()).done;){if("live"===t.value.readyState)return!1}}catch(e){n.e(e)}finally{n.f()}return!0}},{key:"_stop",value:function(e,t){var n=e;n?this.dispatchEvent({type:"owt-stop",error:n}):n={message:"sdk call owt stop",code:1e4};var i,a=ge(this._dataChannels);try{for(a.s();!(i=a.n()).done;){V()(i.value,2)[1].close()}}catch(e){a.e(e)}finally{a.f()}this._dataChannels.clear(),this._pc&&"closed"!==this._pc.iceConnectionState&&this._pc.close();var r,o=ge(this._publishPromises);try{for(o.s();!(r=o.n()).done;){V()(r.value,2)[1].reject(n)}}catch(e){o.e(e)}finally{o.f()}this._publishPromises.clear();var s,c=ge(this._unpublishPromises);try{for(c.s();!(s=c.n()).done;){V()(s.value,2)[1].reject(n)}}catch(e){c.e(e)}finally{c.f()}this._unpublishPromises.clear();var d,l=ge(this._sendDataPromises);try{for(l.s();!(d=l.n()).done;){V()(d.value,2)[1].reject(n)}}catch(e){l.e(e)}finally{l.f()}if(this._sendDataPromises.clear(),this._publishedStreams.forEach((function(e){e.dispatchEvent(new N("ended"))})),this._publishedStreams.clear(),this._remoteStreams.forEach((function(e){e.dispatchEvent(new N("ended"))})),this._remoteStreams=[],!this._disposed){var u;if(t)e&&((u=JSON.parse(JSON.stringify(e))).message="Error happened at remote side."),O.warning("chat closed from brower"),this._sendSignalingMessage(Pe,u).catch((function(e){O.debug("Failed to send close."+e.message)}));this.dispatchEvent(new Event("ended"))}}},{key:"_setStreamToRemoteStreamInfo",value:function(e){var t=this._remoteStreamInfo.get(e.id),n=t.attributes,i=new $(this._remoteStreamInfo.get(e.id).source.audio,this._remoteStreamInfo.get(e.id).source.video);t.stream=new ne(void 0,this._remoteId,e,i,n),t.mediaStream=e;var a=t.stream;a?this._remoteStreams.push(a):O.warning("Failed to create RemoteStream.")}},{key:"_checkIceConnectionStateAndFireEvent",value:function(){var e=this;if("connected"===this._pc.iceConnectionState||"completed"===this._pc.iceConnectionState){var t,n=ge(this._remoteStreamInfo);try{for(n.s();!(t=n.n()).done;){var i=V()(t.value,2)[1];if(i.mediaStream){var a=new ie("streamadded",{stream:i.stream});if(this._isUnifiedPlan()){var r,o=ge(i.mediaStream.getTracks());try{for(o.s();!(r=o.n()).done;){r.value.addEventListener("ended",(function(t){var n,i=ge(e._getStreamByTrack(t.target));try{for(i.s();!(n=i.n()).done;){var a=n.value;e._areAllTracksEnded(a)&&e._onRemoteStreamRemoved(a)}}catch(e){i.e(e)}finally{i.f()}}))}}catch(e){o.e(e)}finally{o.f()}}this._sendSignalingMessage(Ce,i.trackIds),this._remoteStreamInfo.get(i.mediaStream.id).mediaStream=null,this.dispatchEvent(a)}}}catch(e){n.e(e)}finally{n.f()}}}}]),n}(A),De=1,Ae=2,Ne=3,Be=function(e,t){Object.setPrototypeOf(this,new A);var n,i=e,a=t,r=new Map,o=this,s=De;a.onMessage=function(e,t){O.debug("Received signaling message from "+e+": "+t);var n=JSON.parse(t);"chat-closed"!==n.type?o.allowedRemoteIds.indexOf(e)>=0?d(e,!1).onMessage(n):(d(e,!1).stop(),c(e,"chat-closed",F.P2P_CLIENT_DENIED)):r.has(e)&&(d(e,!1).onMessage(n),r.delete(e))},a.onServerDisconnected=function(e){s=De,o.dispatchEvent({type:"serverdisconnected",isServerDis:!!e})},this.allowedRemoteIds=[],this.connect=function(e){return s!==De?(O.warning("Invalid connection state: "+s),Promise.reject(new H(F.P2P_CLIENT_INVALID_STATE))):(s=Ae,new Promise((function(t,i){a.connect(e).then((function(e){s=Ne,t(n=e)}),(function(e){i(new H(W(e)))}))})))},this.disconnect=function(){s!=De&&(r.forEach((function(e){e.stop()})),r.clear(),a.disconnect())},this.publish=function(e,t){return s!==Ne?Promise.reject(new H(F.P2P_CLIENT_INVALID_STATE,"P2P Client is not connected to signaling channel.")):this.allowedRemoteIds.indexOf(e)<0?Promise.reject(new H(F.P2P_CLIENT_NOT_ALLOWED)):Promise.resolve(d(e,!0).publish(t))},this.send=function(e,t){return s!==Ne?Promise.reject(new H(F.P2P_CLIENT_INVALID_STATE,"P2P Client is not connected to signaling channel.")):this.allowedRemoteIds.indexOf(e)<0?Promise.reject(new H(F.P2P_CLIENT_NOT_ALLOWED)):t instanceof ArrayBuffer?Promise.resolve(d(e,!0).sendByte(t)):Promise.resolve(d(e,!0).send(t))},this.stop=function(e){r.has(e)?(r.get(e).stop(),r.delete(e)):O.warning("No PeerConnection between current endpoint and specific remote endpoint.")},this.getStats=function(e){return r.has(e)?r.get(e).getStats():Promise.reject(new H(F.P2P_CLIENT_INVALID_STATE,"No PeerConnection between current endpoint and specific remote endpoint."))};var c=function(e,t,n){var i={type:t};return n&&(i.data=n),a.send(e,JSON.stringify(i)).catch((function(e){if("number"==typeof e)throw W(e)}))},d=function(e,t){if(!r.has(e)){var a=Object.create(A);a.sendSignalingMessage=c;var s=new Le(i,n,e,a,t);s.addEventListener("iceStateChange",(function(e){o.dispatchEvent(e)})),s.addEventListener("connectionstatechange",(function(e){o.dispatchEvent(e)})),s.addEventListener("streamadded",(function(e){o.dispatchEvent(e)})),s.addEventListener("messagereceived",(function(e){o.dispatchEvent(e)})),s.addEventListener("channel-open",(function(e){o.dispatchEvent(e)})),s.addEventListener("channel-close",(function(e){o.dispatchEvent(e)})),s.addEventListener("channel-error",(function(e){o.dispatchEvent(e)})),s.addEventListener("owt-stop",(function(e){o.dispatchEvent(e)})),s.addEventListener("ended",(function(){r.delete(e)})),r.set(e,s)}return r.get(e)}},je=i,ze=n("gFX4"),Ue=n.n(ze),Fe=function(){this.onMessage=null,this.onServerDisconnected=null;var e=null,t=this,n=null,i=!1,a=0,r={2100:"Server unknown error.",2101:"Server is unavaliable.",2102:"Server is too busy.",2103:"Method has not been supported by server.",2110:"Client unknown error.",2111:"Connection is not initialized.",2120:"Authentication unknown error.",2121:"Wrong username or token.",2201:"Remote user cannot be reached.",2400:"Unknown errors.",2401:"This method is unsupported in current browser.",2402:"Illegal argument.",2403:"Invalid peer state.",2404:"Remote user is not allowed.",2500:"WebRTC error.",2502:"SDP error.",3e3:"Remote server is bussy"};this.send=function(n,i){var a={data:i,to:n};return new Promise((function(n,i){e.emit("owt-message",a,(function(e){if(e){if(t.onErr&&e){var a={code:e,msg:r[e]||"unkown"};t.onErr(a)}i(e)}else n()}))}))},this.connect=function(r){var o=r.host,s=r.token,c=r.auth,d=[],l=null;d.push("clientType=Web"),d.push("clientVersion=4.2"),s&&d.push("token="+encodeURIComponent(s)),d.push("authToken="+encodeURIComponent(c)),d&&(l=d.join("&"));var u={query:l,reconnection:!0,reconnectionAttempts:5,"force new connection":!0,rejectUnauthorized:!0,secure:!0,transports:["websocket"]};return i=!1,(e=Ue()(o,u)).on("connect",(function(){i=!0,a=0})),e.on("server-authenticated",(function(e){n&&n.resolve(e.uid),n=null})),e.on("reconnecting",(function(){a++})),e.on("reconnect_failed",(function(){t.onServerDisconnected&&(i=!1,t.onServerDisconnected())})),e.on("server-disconnect",(function(){i=!1,a=5,t.onServerDisconnected(!0)})),e.on("disconnect",(function(){a>=5&&t.onServerDisconnected&&i&&(i=!1,t.onServerDisconnected())})),e.on("connect_failed",(function(e){n&&n.reject(parseInt(e)),n=null})),e.on("error",(function(e){"2103"!=e&&"3000"!=e||!n||(n.reject(e),n=null)})),e.on("owt-message",(function(e){t.onMessage&&t.onMessage(e.from,e.data)})),new Promise((function(e,t){n={resolve:e,reject:t}}))},this.disconnect=function(){return a=5,e&&e.close(),Promise.resolve()}};function We(e){var t=navigator.userAgent,n=t.toLowerCase(),i=/mobile|tablet|ip(ad|hone|od)|ios|android/i.test(t)||n.indexOf("safari")>-1&&/Mac OS/i.test(t)&&/Macintosh/i.test(t)&&screen.width<1280,a=i&&(n.indexOf("android")>-1||n.indexOf("linux")>-1)||n.indexOf("adr")>-1,r=i&&!a,o=r&&n.indexOf("iphone")>-1,s=r&&!o,c=/MicroMessenger/i.test(t),d=/CriOS/i.test(t)||/Chrome/i.test(t),l=i&&/aweme/i.test(t),u=i&&/Weibo/i.test(t),p={ua:t,mobile:i,android:a,ios:r,wx:c,chrome:d,iphone:o,ipad:s,safari:r&&!d&&!c&&!u&&!l&&/Safari|Macintosh/i.test(t),tiktok:l,weibo:u,onlySafari:!d&&/Mac OS/i.test(t)&&/Safari|Macintosh/i.test(t)};return e&&p.hasOwnProperty(e)?p[e]:p}function He(e){return null==e||isNaN(e)}var Ge=function(e){return e instanceof ArrayBuffer};function Ve(){return Number(Math.random().toString().substr(3,3)+Date.now().toString().substr(-3,3))}function qe(e,t){for(var n=t,i=(n=n.substring(1,n.length)).split("&"),a=new Object,r=0;r-1?"Linux":"unkown"}var Ye=function(e){var t=We("onlySafari");if(e&&e.forEach){var n={encryption:"sha-256",audio:{send:{tracks:[],codecs:[],availableBandwidth:0,streams:0},recv:{tracks:[],codecs:[],availableBandwidth:0,streams:0},bytesSent:0,bytesReceived:0},video:{send:{tracks:[],codecs:[],availableBandwidth:0,streams:0},recv:{tracks:[],codecs:[],availableBandwidth:0,streams:0},bytesSent:0,bytesReceived:0},bandwidth:{systemBandwidth:0,sentPerSecond:0,encodedPerSecond:0,helper:{audioBytesSent:0,videoBytesSent:0},speed:0},results:{},connectionType:{systemNetworkType:((navigator.connection||{}).type||"unknown").toString().toLowerCase(),systemIpAddress:"192.168.1.2",local:{candidateType:[],transport:[],ipAddress:[],networkType:[]},remote:{candidateType:[],transport:[],ipAddress:[],networkType:[]}},resolutions:{send:{width:0,height:0},recv:{width:0,height:0}},internal:{audio:{send:{},recv:{}},video:{send:{},recv:{}},candidates:{},transport:{id:null,data:[]}},nomore:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){nomore=!0})),videoResult:[],audioResult:[]},i={},a={},r={},o={},s={},c={},d={},l={},u={audio:{send:[],recv:[]},video:{send:[],recv:[]}},p=[];return e.forEach((function(e){p.push(e)})),!0,p.forEach((function(e){switch(e.mediaType){case"audio":n.audioResult.push(e),function(e){var t=e.id.split("_").pop();if(!0===e.isRemote&&(t="recv"),!1===e.isRemote&&(t="send"),t){if(n.audio[t]&&-1===n.audio[t].codecs.indexOf(e.googCodecName||"opus")&&n.audio[t].codecs.push(e.googCodecName||"opus"),e.bytesSent&&n.internal.audio[t]){var i=0;n.internal.audio[t].prevBytesSent||(n.internal.audio[t].prevBytesSent=e.bytesSent);var a=e.bytesSent-n.internal.audio[t].prevBytesSent;n.internal.audio[t].prevBytesSent=e.bytesSent,i=a/1024,n.audio[t].availableBandwidth=i.toFixed(1),n.audio.bytesSent=i.toFixed(1)}if(e.bytesReceived&&n.internal.audio[t]){i=0;n.internal.audio[t].prevBytesReceived||(n.internal.audio[t].prevBytesReceived=e.bytesReceived);a=e.bytesReceived-n.internal.audio[t].prevBytesReceived;n.internal.audio[t].prevBytesReceived=e.bytesReceived,i=a/1024,n.audio.bytesReceived=i.toFixed(1)}if(e.googTrackId&&n.audio[t]&&-1===n.audio[t].tracks.indexOf(e.googTrackId)&&n.audio[t].tracks.push(e.googTrackId),e.googCurrentDelayMs){i=0;n.internal.audio.prevGoogCurrentDelayMs||(n.internal.audio.prevGoogCurrentDelayMs=e.googCurrentDelayMs);a=e.googCurrentDelayMs-n.internal.audio.prevGoogCurrentDelayMs;n.internal.audio.prevGoogCurrentDelayMs=e.googCurrentDelayMs,n.audio.latency=a.toFixed(1),n.audio.latency<0&&(n.audio.latency=0)}if(e.packetsLost){i=0;n.internal.audio.prevPacketsLost||(n.internal.audio.prevPacketsLost=e.packetsLost);a=e.packetsLost-n.internal.audio.prevPacketsLost;n.internal.audio.prevPacketsLost=e.packetsLost,n.audio.packetsLost=a.toFixed(1),n.audio.packetsLost<0&&(n.audio.packetsLost=0)}}}(e);break;case"video":n.videoResult.push(e),function(e){var t=e.id.split("_").pop();if(!0===e.isRemote&&(t="recv"),!1===e.isRemote&&(t="send"),t){if(n.video[t]&&-1===n.video[t].codecs.indexOf(e.googCodecName||"VP8")&&n.video[t].codecs.push(e.googCodecName||"VP8"),e.bytesSent&&n.internal.video[t]){var i=0;n.internal.video[t].prevBytesSent||(n.internal.video[t].prevBytesSent=e.bytesSent);var a=e.bytesSent-n.internal.video[t].prevBytesSent;n.internal.video[t].prevBytesSent=e.bytesSent,i=a/1024,n.video[t].availableBandwidth=i.toFixed(1),n.video.bytesSent=i.toFixed(1)}if(e.bytesReceived&&n.internal.video[t]){i=0;n.internal.video[t].prevBytesReceived||(n.internal.video[t].prevBytesReceived=e.bytesReceived);a=e.bytesReceived-n.internal.video[t].prevBytesReceived;n.internal.video[t].prevBytesReceived=e.bytesReceived,i=a/1024,n.video.bytesReceived=i.toFixed(1)}if(e.googFrameHeightReceived&&e.googFrameWidthReceived&&(n.resolutions[t].width=e.googFrameWidthReceived,n.resolutions[t].height=e.googFrameHeightReceived),e.googFrameHeightSent&&e.googFrameWidthSent&&(n.resolutions[t].width=e.googFrameWidthSent,n.resolutions[t].height=e.googFrameHeightSent),e.googTrackId&&-1===n.video[t].tracks.indexOf(e.googTrackId)&&n.video[t].tracks.push(e.googTrackId),e.framerateMean){n.bandwidth.framerateMean=e.framerateMean;i=0;n.internal.video[t].prevFramerateMean||(n.internal.video[t].prevFramerateMean=e.bitrateMean);a=e.bytesSent-n.internal.video[t].prevFramerateMean;n.internal.video[t].prevFramerateMean=e.framerateMean,i=a/1024,n.video[t].framerateMean=a.toFixed(1)}if(e.bitrateMean){n.bandwidth.bitrateMean=e.bitrateMean;i=0;n.internal.video[t].prevBitrateMean||(n.internal.video[t].prevBitrateMean=e.bitrateMean);a=e.bytesSent-n.internal.video[t].prevBitrateMean;n.internal.video[t].prevBitrateMean=e.bitrateMean,i=a/1024,n.video[t].bitrateMean=a.toFixed(1)}if(e.googCurrentDelayMs){i=0;n.internal.video.prevGoogCurrentDelayMs||(n.internal.video.prevGoogCurrentDelayMs=e.googCurrentDelayMs);a=e.googCurrentDelayMs-n.internal.video.prevGoogCurrentDelayMs;n.internal.video.prevGoogCurrentDelayMs=e.googCurrentDelayMs,n.video.latency=a.toFixed(1),n.video.latency<0&&(n.video.latency=0)}if(e.packetsLost){i=0;n.internal.video.prevPacketsLost||(n.internal.video.prevPacketsLost=e.packetsLost);a=e.packetsLost-n.internal.video.prevPacketsLost;n.internal.video.prevPacketsLost=e.packetsLost,n.video.packetsLost=a.toFixed(1),n.video.packetsLost<0&&(n.video.packetsLost=0)}}}(e)}switch(e.type){case"googLibjingleSession":n.isOfferer=e.googInitiator;break;case"datachannel":n.datachannel={state:e.state};break;case"googCertificate":n.encryption=e.googFingerprintAlgorithm;break;case"certificate":n.encryption=e.fingerprintAlgorithm;break;case"VideoBwe":!function(e){n.bandwidth.availableSendBandwidth=e.googAvailableSendBandwidth,n.bandwidth.googActualEncBitrate=e.googActualEncBitrate,n.bandwidth.googAvailableSendBandwidth=e.googAvailableSendBandwidth,n.bandwidth.googAvailableReceiveBandwidth=e.googAvailableReceiveBandwidth,n.bandwidth.googRetransmitBitrate=e.googRetransmitBitrate,n.bandwidth.googTargetEncBitrate=e.googTargetEncBitrate,n.bandwidth.googBucketDelay=e.googBucketDelay,n.bandwidth.googTransmitBitrate=e.googTransmitBitrate}(e);break;case"ssrc":!function(e){if(e.googCodecName&&("video"===e.mediaType||"audio"===e.mediaType)){var t=e.id.split("_").pop();-1===u[e.mediaType][t].indexOf(e.ssrc)&&u[e.mediaType][t].push(e.ssrc),n[e.mediaType][t].streams=u[e.mediaType][t].length}}(e);break;case"localcandidate":case"local-candidate":!function(e){e.id&&(i[e.id]||(i[e.id]=[]),a[e.id]||(a[e.id]=[]),r[e.id]||(r[e.id]=[]),o[e.id]||(o[e.id]=[]),e.candidateType&&-1===i[e.id].indexOf(e.candidateType)&&i[e.id].push(e.candidateType),e.transport&&-1===a[e.id].indexOf(e.transport)&&a[e.id].push(e.transport),e.ipAddress&&-1===r[e.id].indexOf(e.ipAddress+":"+e.portNumber)&&r[e.id].push(e.ipAddress+":"+e.portNumber),e.networkType&&-1===o[e.id].indexOf(e.networkType)&&o[e.id].push(e.networkType),n.internal.candidates[e.id]={candidateType:i[e.id],ipAddress:r[e.id],portNumber:e.portNumber,networkType:o[e.id],priority:e.priority,transport:a[e.id],timestamp:e.timestamp,id:e.id,type:e.type,protocol:e.protocol},n.connectionType.local.candidateType=i[e.id],n.connectionType.local.ipAddress=r[e.id],n.connectionType.local.networkType=o[e.id],n.connectionType.local.transport=a[e.id])}(e);break;case"remote-candidate":case"googCandidatePair":!function(e){e.id&&(s[e.id]||(s[e.id]=[]),c[e.id]||(c[e.id]=[]),d[e.id]||(d[e.id]=[]),l[e.id]||(l[e.id]=[]),e.candidateType&&-1===s[e.id].indexOf(e.candidateType)&&s[e.id].push(e.candidateType),e.transport&&-1===c[e.id].indexOf(e.transport)&&c[e.id].push(e.transport),e.ipAddress&&-1===d[e.id].indexOf(e.ipAddress+":"+e.portNumber)&&d[e.id].push(e.ipAddress+":"+e.portNumber),e.networkType&&-1===l[e.id].indexOf(e.networkType)&&l[e.id].push(e.networkType),n.internal.candidates[e.id]={candidateType:s[e.id],ipAddress:d[e.id],portNumber:e.portNumber,networkType:l[e.id],priority:e.priority,transport:c[e.id],timestamp:e.timestamp,id:e.id,type:e.type},n.connectionType.remote.candidateType=s[e.id],n.connectionType.remote.ipAddress=d[e.id],n.connectionType.remote.networkType=l[e.id],n.connectionType.remote.transport=c[e.id])}(e);break;case"inbound-rtp":!function(e){var t=e.mediaType||"audio",i=e.isRemote?"recv":"send";if(i){if(e.bytesSent){var a=0;n.internal[t][i].prevBytesSent||(n.internal[t][i].prevBytesSent=e.bytesSent);var r=e.bytesSent-n.internal[t][i].prevBytesSent;n.internal[t][i].prevBytesSent=e.bytesSent,a=r/1024,n[t][i].availableBandwidth=a.toFixed(1),n[t].bytesSent=a.toFixed(1)}if(e.bytesReceived){a=0;n.internal[t][i].prevBytesReceived||(n.internal[t][i].prevBytesReceived=e.bytesReceived);r=e.bytesReceived-n.internal[t][i].prevBytesReceived;n.internal[t][i].prevBytesReceived=e.bytesReceived,a=r/1024,n[t].bytesReceived=a.toFixed(1)}}}(e);break;case"outbound-rtp":!function(e){var t=e.mediaType||"audio",i=e.isRemote?"recv":"send";if(i){if(e.bytesSent){var a=0;n.internal[t][i].prevBytesSent||(n.internal[t][i].prevBytesSent=e.bytesSent);var r=e.bytesSent-n.internal[t][i].prevBytesSent;n.internal[t][i].prevBytesSent=e.bytesSent,a=r/1024,n[t][i].availableBandwidth=a.toFixed(1),n[t].bytesSent=a.toFixed(1)}if(e.bytesReceived){a=0;n.internal[t][i].prevBytesReceived||(n.internal[t][i].prevBytesReceived=e.bytesReceived);r=e.bytesReceived-n.internal[t][i].prevBytesReceived;n.internal[t][i].prevBytesReceived=e.bytesReceived,a=r/1024,n[t].bytesReceived=a.toFixed(1)}}}(e);break;case"track":!function(e){var t=!0===e.remoteSource?"send":"recv";"video"===e.kind&&n.videoResult.push(e),e.frameWidth&&e.frameHeight&&(n.resolutions[t].width=e.frameWidth,n.resolutions[t].height=e.frameHeight)}(e);break;case"transport":n.internal.transport.data.push(e),"connected"===e.dtlsState&&(n.internal.transport.id=(e.selectedCandidatePairId||[]).split("_").slice(1).map((function(e){return"RTCIceCandidate_"+e})))}!function(e){if("googCandidatePair"===e.type||"candidate-pair"===e.type||"local-candidate"===e.type||"remote-candidate"===e.type){if("true"==e.googActiveConnection)Object.keys(n.internal.candidates).forEach((function(t){var i=n.internal.candidates[t];-1!==i.ipAddress.indexOf(e.googLocalAddress)&&(n.connectionType.local.candidateType=i.candidateType,n.connectionType.local.ipAddress=i.ipAddress,n.connectionType.local.networkType=i.networkType,n.connectionType.local.transport=i.transport),-1!==i.ipAddress.indexOf(e.googRemoteAddress)&&(n.connectionType.remote.candidateType=i.candidateType,n.connectionType.remote.ipAddress=i.ipAddress,n.connectionType.remote.networkType=i.networkType,n.connectionType.remote.transport=i.transport)})),n.connectionType.transport=e.googTransportType,(i=n.internal.candidates[e.localCandidateId])&&i.ipAddress&&(n.connectionType.systemIpAddress=i.ipAddress),(a=n.internal.candidates[e.remoteCandidateId])&&a.ipAddress&&(n.connectionType.systemIpAddress=a.ipAddress);if("candidate-pair"===e.type&&!0===e.selected&&!0===e.nominated&&"succeeded"===e.state)var i=n.internal.candidates[e.remoteCandidateId],a=n.internal.candidates[e.remoteCandidateId];if("local-candidate"===e.type&&(n.connectionType.local.candidateType=e.candidateType,n.connectionType.local.ipAddress=e.ipAddress,n.connectionType.local.networkType=e.networkType,n.connectionType.local.transport=e.mozLocalTransport||e.transport),"remote-candidate"===e.type&&(n.connectionType.remote.candidateType=e.candidateType,n.connectionType.remote.ipAddress=e.ipAddress,n.connectionType.remote.networkType=e.networkType,n.connectionType.remote.transport=e.mozRemoteTransport||e.transport),t){var r=e.localCandidateId?"send":"recv";if(!r)return;if(e.bytesSent){var o=0;n.internal.video[r].prevBytesSent||(n.internal.video[r].prevBytesSent=e.bytesSent);var s=e.bytesSent-n.internal.video[r].prevBytesSent;n.internal.video[r].prevBytesSent=e.bytesSent,o=s/1024,n.video[r].availableBandwidth=o.toFixed(1),n.video.bytesSent=o.toFixed(1)}if(e.bytesReceived){o=0;n.internal.video[r].prevBytesReceived||(n.internal.video[r].prevBytesReceived=e.bytesReceived);s=e.bytesReceived-n.internal.video[r].prevBytesReceived;n.internal.video[r].prevBytesReceived=e.bytesReceived,o=s/1024,n.video.bytesReceived=o.toFixed(1)}if(e.availableOutgoingBitrate){o=0;n.internal.video[r].prevAvailableOutgoingBitrate||(n.internal.video[r].prevAvailableOutgoingBitrate=e.availableOutgoingBitrate);s=e.availableOutgoingBitrate-n.internal.video[r].prevAvailableOutgoingBitrate;n.internal.video[r].prevAvailableOutgoingBitrate=e.availableOutgoingBitrate,o=s/1024,n.video.availableOutgoingBitrate=o.toFixed(1)}if(e.availableIncomingBitrate){o=0;n.internal.video[r].prevAvailableIncomingBitrate||(n.internal.video[r].prevAvailableIncomingBitrate=e.availableIncomingBitrate);s=e.availableIncomingBitrate-n.internal.video[r].prevAvailableIncomingBitrate;n.internal.video[r].prevAvailableIncomingBitrate=e.availableIncomingBitrate,o=s/1024,n.video.availableIncomingBitrate=o.toFixed(1)}}}}(e),function(e){!e.googCodecName||"video"!==e.mediaType&&"audio"!==e.mediaType||(e.bytesSent&&(n[e.mediaType].bytesSent=parseInt(e.bytesSent)),e.bytesReceived&&(n[e.mediaType].bytesReceived=parseInt(e.bytesReceived)))}(e)})),n.results=p,n.audio&&n.video&&(n.bandwidth.speed=n.audio.bytesSent-n.bandwidth.helper.audioBytesSent+(n.video.bytesSent-n.bandwidth.helper.videoBytesSent),n.bandwidth.helper.audioBytesSent=n.audio.bytesSent,n.bandwidth.helper.videoBytesSent=n.video.bytesSent),n}},Qe=1,Ze=0,$e=0,et=0,tt=0,nt=0,it=0,at=0,rt=0,ot=0,st=0,ct=0,dt=0,lt={delay:0,jitter:0,bitrate:0,packetsReceived:0,packetsLost:0,nack:0,pliCount:0,firCount:0,fDecod:0,fDrop:0,fRecv:0,fDecodMS:0,protocol:null},ut=function(){function e(){y()(this,e),this._eventListeners={}}return b()(e,[{key:"add",value:function(e,t){void 0===this._eventListeners[e]&&(this._eventListeners[e]=[]),this._eventListeners[e].push(t)}},{key:"remove",value:function(e,t){if(this._eventListeners[e]){var n=this._eventListeners[e].indexOf(t);-1!==n&&(n=this._eventListeners[e].findIndex((function(e){return e.toString()===t.toString()}))),-1!==n&&this._eventListeners[e].splice(n,1)}}},{key:"emit",value:function(e){this._eventListeners[e.type]&&this._eventListeners[e.type].map((function(t){t(e)}))}},{key:"clean",value:function(e){e?this._eventListeners[e]=[]:this._eventListeners={}}}]),e}(),pt=n("9/Cq"),ht=!0,vt=null,ft=null,mt=[],yt=null,gt=null;function bt(e,t){ht=e,vt=t||"lxl"}function kt(){return"##serverTime##\t##clientIP##\t000000000000\t".concat(vt,"\t")}function _t(){var e=Xe(),t=["unkown","Windows","android","Mac","Linux"].findIndex((function(t){return t===e}));t=t<0?0:t;var n=Je(),i=["unknown","wired","wifi","4g","5g"].findIndex((function(e){return e===n}));i=i<0?0:i;var a=[null,"udp","tcp"].findIndex((function(e){return e===yt}));a=a<0?0:a,Object(pt.a)({data:"".concat(kt(),"1\t7\t12\t").concat(Date.now(),"\t2,").concat(t,",").concat(i,",0,").concat(a,",0,0,0,0,0"),id:"dataRecordV2"})}var wt=function(e){if(ht)try{Object(pt.a)({data:JSON.stringify(e),id:"keyRecord"})}catch(e){}},St=function(){ht=!1,window.clearInterval(gt),mt=[]};function Pt(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}var Et={0:"unkown error.",1:"缺少domWrap参数",2:"缺少必要dom元素",3:"初始化完成",4:"信令服务连接失败",5:"云主机找不到",6:"云主机被占用",7:"信令服务连接成功",8:"信令服务断开",22:"信令服务器强制断开",30:"ice连接状态改变",9:"云主机id不合法",10:"客户端id不合法",11:"p2p error",12:"视频首帧或者canplay",13:"p2p断开",14:"clientID/remoteID/token is required.",15:"客户端强制断开",16:"云主机主动断开",18:"刷新断开",17:"游戏登录失败",19:"游戏登录成功",20:"游戏登录中",21:"游戏登录超时",27:"数据通道创建成功",28:"数据通道关闭",29:"数据通道错误",25:"发送detect",26:"发送start",50:"auth认证",51:"初始化视频",53:"认证成功",54:"认证失败",55:"初始化视频回复",56:"视频重置ResetClient",57:"初始化input回复",400:"发送detect失败",404:"ice断开"},xt=Object.entries({1:{type:"init",list:[3]},2:{type:"connectSuccess",list:[55]},3:{type:"videoStreamLoaded",list:[12]},4:{type:"disconnected",list:[13,15,16,18]},11:{type:"initFail",list:[1,2,14]},12:{type:"p2pError",list:[4,5,6,8,11,22,28,29,400,404]},100:{type:"gameLoginStateChange",list:[17,19,20,21]}}),Tt=null,Ct=function(e){S()(i,e);var t,n=(t=i,function(){var e,n=T()(t);if(Pt()){var i=T()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return E()(this,e)});function i(){return y()(this,i),n.call(this)}return b()(i,[{key:"dispatchEvent",value:function(e,t){!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(ht){var n={report_time:"##serverTime##",ip:"##clientIP##",mac:"000000000000",token:vt,normal:1,record:{}},i={0:"unkown error",1:"missing parame domWrap",2:"Missing required DOM element",3:"sdk init success",4:"connect signaling service fail",5:"remote client not fount",6:"remote client is busy",7:"connect signaling service success",8:"signal service disconnect",22:"signal service force disconnect",30:"ice connect state change",9:"remote id is illegal",10:"client id is illegal",11:"p2p error",12:"p2p connect success",13:"p2p disconnect",14:"clientID/remoteID/token is required",27:"dataChannel open",28:"dataChannel close",29:"dataChannel error",15:"client disconnected",16:"remote client active disconnection",18:"client refresh page",17:"game login fail",19:"game login success",20:"game login in progress",21:"game login timeout",25:"send detect msg",26:"send start msg",50:"send auth msg",51:"send init video msg",53:"auth successed",54:"auth fail",55:"init video successed",56:"receive reset client msg",57:"init input successed"};switch(e){case 1:case 2:case 3:case 14:3===e?n.record={module:8,type:1,desc:i[e]||"unkown"}:(n.record={module:8,type:2,desc:i[e]||"unkown"},n.mormal=0);break;case 4:case 5:case 6:case 7:case 8:case 22:7===e?n.record={module:7,type:3,desc:i[e]||"unkown"}:(n.record={module:7,type:4,desc:(i[e]||"unkown")+",linker_handle:"+e},n.mormal=0);break;case 30:n.record={module:7,type:6,desc:(i[e]||"unkown")+(t&&t.msg?",state="+t.msg:"")};break;case 27:n.record={module:7,type:7,desc:i[e]||"unkown"};break;case 28:n.record={module:7,type:8,desc:i[e]||"unkown"};break;case 29:n.record={module:7,type:9,desc:i[e]||"unkown"},n.mormal=0;break;case 15:case 16:case 18:case 9:case 10:case 11:case 13:n.record={module:1,type:4,desc:(i[e]||"unkown")+",linker_handle:"+e};break;case 17:case 19:case 20:case 21:break;case 12:n.record={module:1,type:3,desc:i[e]||"unkown"},_t();break;case 25:n.record={module:7,type:10,desc:i[e]||"unkown"};break;case 26:n.record={module:7,type:11,desc:i[e]||"unkown"};break;case 50:n.record={module:1,type:16,desc:i[e]||"unkown"};break;case 51:n.record={module:2,type:17,desc:i[e]||"unkown"};break;case 53:n.record={module:1,type:6,desc:i[e]||"unkown"};break;case 54:n.record={module:1,type:7,desc:i[e]||"unkown"},n.mormal=0;break;case 55:n.record={module:2,type:18,desc:i[e]||"unkown"};break;case 56:n.record={module:1,type:17,desc:i[e]||"unkown"}}n.record.module&&n.record.type&&wt(n)}}(e,t||Et[e]);var n={code:e,msg:Et[e]||Et[0],content:t||""};this.emit({type:"p2pStateChange",msg:n});for(var i=0;i8)switch(s){case 101:d="x";break;case 102:d="y";break;case 107:d="kRelativePos"}else d=Nt[s];d&&(t[d]=4===o?new Uint8Array(e.buffer,e.byteOffset+r,c):e["getUint"+8*c](r,!0)),r+=c}else t=null;return t}catch(e){return null}},jt=function(e){for(var t=JSON.stringify(e),n=t.length,i=new ArrayBuffer(24+n),a=new Uint8Array(i),r=0;r>>=0}function fn(e){var t=new Array;return t[0]=e>>>24>>>0,t[1]=e<<8>>>24>>>0,t[2]=e<<16>>>24,t[3]=e<<24>>>24,String(t[0])+"."+String(t[1])+"."+String(t[2])+"."+String(t[3])}var mn=function(){var e=u()(d.a.mark((function e(t){var n,i,a,r,o,s,c,l,u,p,v,f=arguments;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(f.length>1&&void 0!==f[1])||f[1],n=null,!t){e.next=74;break}if(!Ge(t)){e.next=7;break}n=t,e.next=15;break;case 7:if(!(t instanceof Blob)){e.next=13;break}return e.next=10,t.arrayBuffer();case 10:n=e.sent,e.next=15;break;case 13:return e.abrupt("return",{msg:"error msg type"});case 15:if(i=new DataView(n),a=n.byteLength,r={head:{},body:{},type:null},!(a>=24)){e.next=72;break}o=0,s=4,c=0,l=[];case 21:if(!(o23)){e.next=62;break}if(!r||r.type!==rn&&r.type!==un){e.next=26;break}return e.abrupt("break",70);case 26:if(!l||!l.length){e.next=59;break}if(!(p=l[c])){e.next=56;break}if(!(s=p.len)){e.next=52;break}if(r.type!==Jt||"reserve_size"!==l[c].key){e.next=36;break}return r.body.reserveByte=Bt(new DataView(n,o)),e.abrupt("break",70);case 36:if(!p.symbols||2!==p.len){e.next=40;break}r.body[mpas.key]=i.getint16(offset,!0),e.next=52;break;case 40:if(!p.isConcat){e.next=44;break}r.type===rn&&"fps"===p.key?r.body.fps=yn(s,o,i):r.type===Jt&&"data"===p.key?r.body.data=new Uint8Array(n,o,s):"client_mac"===p.key?r.body[p.key]=yn(s,o,i,!0).map((function(e){var t=e.toString(16);return t.length>1?t:"0"+t})).join(":"):r.body[p.key]=String.fromCharCode.apply(String,h()(yn(s,o,i,!0))),e.next=52;break;case 44:e.t0=p.key,e.next="client_ip"===e.t0||"client_gateway"===e.t0?47:50;break;case 47:return r.body[p.key]=yn(s,o,i,!1),r.body[p.key]=fn(r.body[p.key]),e.abrupt("break",52);case 50:return r.body[p.key]=yn(s,o,i,!1),e.abrupt("break",52);case 52:r.type===pn&&"data_size"===l[c].key?l[c+1].len=r.body.data_size||0:r.type===Ft&&"token_size"===l[c].key?l[c+1].len=r.body.token_size||0:r.type===Jt&&"data_size"===l[c].key?l[c+1].len=r.body.data_size||0:r.type===Zt&&"key_flags_size"===l[c].key?l[c+1].len=4*(r.body.key_flags_size||0):r.type===rn&&"fps_size"===l[c].key&&(l[c+1].len=r.body.data_size||0),c++,e.next=57;break;case 56:return e.abrupt("break",70);case 57:e.next=60;break;case 59:return e.abrupt("break",70);case 60:e.next=67;break;case 62:v=Math.ceil(o/s),u=zt[v],r.head[u||"key"+v]=i.getUint32(o,!0),4===o&&"type"===u&&(l=Ut[r.head.type]||[],r.type=r.head.type),s=4;case 67:o+=s,e.next=21;break;case 70:e.next=73;break;case 72:r={msg:"error length"};case 73:return e.abrupt("return",r);case 74:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function yn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;try{var a=0;if(i&&e){for(var r=[],o=0;o0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;R()(this,li)[li](e,t)}},{key:"resolveSDP",value:function(){var e=window.my_owt_localDesc_answer&&window.my_owt_localDesc_answer.sdp?window.my_owt_localDesc_answer.sdp:null;if(e){var t=e.indexOf("m=video ");if(t>=0){var n=e.indexOf("m=",t+8);n=-1===n?e.length:n;for(var i=["VP8","VP9","H264","H265"],a=[],r=e.substring(t,n).split("a=rtpmap:"),o=0;o=0){a.push(i.splice(s,1)[0]);break}return a.length?a:null}}return null}},{key:"getRemoteMouse",value:function(){R()(this,vi)[vi]({type:sn,head:{id:53,type:sn,size:24,version:1,ack:0,token:1},body:{reserve_size:0}})}},{key:"changeFPS",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60,t=arguments.length>1?arguments[1]:void 0,n=Number(e||0);if(e&&n&&n!==R()(this,qn)[qn]){t&&(R()(this,Vn)[Vn]+=1),R()(this,qn)[qn]=n;var i=String(e);R()(this,vi)[vi]({type:rn,head:{id:13,type:rn,size:24,version:1,ack:0,token:1},body:{a:1,b:1,c:2,fps_size:i.length,fps:i,d:0,reserve_size:0}},!1)}}},{key:"setArt",value:function(e){R()(this,vi)[vi]({id:"111",jsonrpc:"2.0",method:"setVideoEncodeBitrate",params:{auto:"auto"===e,value:"auto"===e?0:1024*e*1024}},!1,!1,!0)}},{key:"setArtByte",value:function(e){R()(this,vi)[vi]({type:rn,head:{id:123,type:rn,size:24,version:1,ack:0,token:1},body:{a:1,b:1,c:4,fps_size:e.length,fps:e,d:0,reserve_size:0}},!1)}},{key:"playVideo",value:function(){var e=this;this.videoElement&&(this.videoElement.muted=!0,this.videoElement.play().then((function(){R()(e,hi)[hi]()})).catch((function(t){e.emit({type:"playVideoFail",msg:t.body||t})})).finally((function(){e.videoElement.muted=R()(e,ri)[ri]}))),this.audioElement&&(this.audioElement.muted=!0,this.audioElement.play().finally((function(){e.audioElement.muted=R()(e,ri)[ri]})))}},{key:"getMuteSate",value:function(){return R()(this,ri)[ri]}},{key:"initGamePad",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;R()(this,Ri)[Ri](e)}},{key:"destoryGamePad",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;R()(this,Mi)[Mi](e)}},{key:"sendGamePad",value:function(e){R()(this,Gi)[Gi](e)}},{key:"startConnect",value:function(){R()(this,_i)[_i]()}},{key:"stopConnect",value:function(e){R()(this,wi)[wi](!1,!0,e)}},{key:"resetKeyboard",value:function(){R()(this,Ai)[Ai]()}},{key:"sendrel",value:function(e){var t=e.x,n=e.y,i=this.mouseSens/50,a=Math.round(t*i),r=Math.round(n*i);R()(this,vi)[vi]({type:Zt,head:{id:7,type:Zt,size:24,version:1,ack:0,token:1},body:{x:a,y:r,z:0,key_flags_size:0,key_flags:0,reserve_size:0}},!1,!1)}},{key:"sendCalcRel",value:function(e){var t=e.x,n=e.y,i=Math.round(t),a=Math.round(n);R()(this,vi)[vi]({type:Zt,head:{id:7,type:Zt,size:24,version:1,ack:0,token:1},body:{x:i,y:a,z:0,key_flags_size:0,key_flags:0,reserve_size:0}},!1,!1)}},{key:"sendAbs",value:function(e,t){R()(this,vi)[vi]({type:$t,head:{id:27,type:$t,size:24,version:1,ack:0,token:1},body:{x:e,y:t,key_flags_size:0,key_flags:0,reserve_size:0}},!1,!1)}},{key:"sendMousedown",value:function(e){e.preventDefault&&e.preventDefault();var t=[1,5,3];!He(e.button)&&t[e.button]&&R()(this,vi)[vi]({type:Zt,head:{id:2,type:Zt,size:24,version:1,ack:0,token:1},body:{x:0,y:0,z:0,key_flags_size:1,key_flags:t[e.button],reserve_size:0}})}},{key:"sendMouseup",value:function(e){e.preventDefault&&e.preventDefault();var t=[2,6,4];!He(e.button)&&t[e.button]&&R()(this,vi)[vi]({type:Zt,head:{id:3,type:Zt,size:24,version:1,ack:0,token:1},body:{x:0,y:0,z:0,key_flags_size:1,key_flags:t[e.button],reserve_size:0}})}},{key:"sendMousewheel",value:function(e){R()(this,vi)[vi]({type:Zt,head:{id:8,type:Zt,size:24,version:1,ack:0,token:1},body:{x:0,y:0,z:-1*e.deltaY,key_flags_size:0,key_flags:0,reserve_size:0}})}},{key:"sendKeydown",value:function(e){R()(this,An)[An]&&e.preventDefault&&e.preventDefault();var t=e.charCode||e.keyCode||e.which;Dt&&(t=Dt[t]||t,2!==e.location||150!==t&&152!==t&&154!==t||(t+=1)),R()(this,vi)[vi]({type:en,head:{id:4,type:en,size:24,version:1,ack:0,token:1},body:{keyevent_size:1,key:t,down:1,reserve_size:0,reserve_size1:0}})}},{key:"sendKeyup",value:function(e){R()(this,An)[An]&&e.preventDefault&&e.preventDefault();var t=e.charCode||e.keyCode||e.which;Dt&&(t=Dt[t]||t,2!==e.location||150!==t&&152!==t&&154!==t||(t+=1)),R()(this,vi)[vi]({type:en,head:{id:4,type:en,size:24,version:1,ack:0,token:1},body:{keyevent_size:1,key:t,down:0,reserve_size:0,reserve_size1:0}})}},{key:"sendTouch",value:function(e,t,n){R()(this,vi)[vi]({type:ln,head:{id:24,type:ln,size:24,version:1,ack:0,token:1},body:{touchId:0,fingerId:1,eventType:e,x:t,y:n,pressure:50,timestamp:0,reserve:0}})}},{key:"switchSound",value:function(e){return R()(this,ri)[ri]=!e,this.audioElement&&(this.audioElement.muted=!e),this.videoElement&&(this.videoElement.muted=!e),R()(this,ri)[ri]}},{key:"toggleScreenFull",value:function(e){return e?Lt()||Mt(this.videoWrap):!1===e?Lt()&&It():Lt()?It():Mt(this.videoWrap),document.IsFullScreen}},{key:"getConnectState",value:function(){return R()(this,An)[An]}},{key:"sendTransData",value:function(e){e&&R()(this,Vi)[Vi](e,1)}},{key:"callGame",value:function(e,t){R()(this,Bi)[Bi](e,t)}},{key:"sendFileApi",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;e&&R()(this,Vi)[Vi](e,t)}},{key:"sendFileByte",value:function(e,t){R()(this,vi)[vi]({type:pn,head:{id:93,type:pn,size:24,version:1,ack:0,token:1},body:{data_type:11,data_size:t,data:e,reserve_size:0}},!0)}}]),i}(Ct),Xi=function(){var e=this;return this.videoWrap?this.videoElement&&this.audioElement&&this.canvas&&(!this.isMobile||this.mouseMask)?(this.videoElement.muted=!0,this.audioElement.muted=!0,window.onresize=function(){R()(e,hi)[hi](),R()(e,An)[An]&&R()(e,Ai)[Ai]()},function(e){if(e){var t={requestFullscreen:"fullscreenchange",webkitRequestFullscreen:"webkitfullscreenchange",mozRequestFullScreen:"mozfullscreenchange",msRequestFullscreen:"msfullscreenchange"},n=document.documentElement,i="";for(var a in t)if(n[a]){i=t[a];break}document.addEventListener?document.addEventListener(i,e,!1):document.attachEvent("on"+i,e)}}((function(){R()(e,hi)[hi](),R()(e,An)[An]&&R()(e,Ai)[Ai]()})),window.onbeforeunload=function(){R()(e,An)[An]&&R()(e,Ai)[Ai](),R()(e,wi)[wi](!1,!0,null,!0)},document.addEventListener("visibilitychange",(function(){R()(e,An)[An]&&R()(e,Ai)[Ai](),document.visibilityState&&"visible"===document.visibilityState&&R()(e,An)[An]?(e.videoElement.muted=R()(e,ri)[ri],e.audioElement.muted=R()(e,ri)[ri]):R()(e,An)[An]&&(e.videoElement.muted=!0,e.audioElement.muted=!0)})),this.isMobile&&(this.videoElement&&We("ios")?this.videoElement.classList.remove("is-fill"):this.videoElement.classList.add("is-fill")),R()(this,di)[di](),void this.dispatchEvent(3)):(this.dispatchEvent(2),!1):(this.dispatchEvent(1),!1)},Yi=function(){clearInterval(R()(this,ei)[ei]),clearInterval(R()(this,ti)[ti]),clearInterval(R()(this,ni)[ni]),R()(this,gi)[gi](),R()(this,jn)[jn]={},R()(this,Gn)[Gn]=[],this.datachannelDelay=0},Qi=function(){window.my_owt_localDesc_answer=null,R()(this,si)[si](),R()(this,Bn)[Bn]={},R()(this,Gn)[Gn]=[],R()(this,Vn)[Vn]=0,R()(this,qn)[qn]=this.initFps||60,this.remoteSolution.w=1280,this.remoteSolution.h=720,this.remoteDeskSolution.w=1280,this.remoteDeskSolution.h=720,this.iphoneRealWidth=1280,this.ipadRealHeight=720,this.videoPaddingTop=0,this.videoPaddingLeft=0,R()(this,hi)[hi](),R()(this,zn)[zn]={x:0,y:0},R()(this,Un)[Un]=null,R()(this,Fn)[Fn]=null,R()(this,Kn)[Kn]=!1,R()(this,Xn)[Xn]=!1,R()(this,Yn)[Yn]=!1,R()(this,Qn)[Qn]=0,R()(this,Zn)[Zn]=!this.gameId&&"no-game",this.relativeMovementMode=!1,R()(this,$n)[$n]=!0},Zi=function(){R()(this,ci)[ci](),!this.connect&&navigator&&navigator.keyboard&&navigator.keyboard.unlock&&navigator.keyboard.unlock(),It(),R()(this,Jn)[Jn]=0,R()(this,Wn)[Wn]={x:0,y:0},this.lastMousePos={x:0,y:0},this.signal=null,this.p2p=null},$i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.isMobile&&(this.cursorImg.style="top:".concat(t,"px;left:").concat(e,"px;"))},ea=function(){var e=this.videoElement.clientWidth,t=this.videoElement.clientHeight;if(We("ios")){var n=this.remoteSolution.w/this.remoteSolution.h,i=e/t;n>i?(this.ipadRealHeight=e*this.remoteSolution.h/this.remoteSolution.w,this.videoPaddingTop=Math.abs(t-this.ipadRealHeight)/2||0,this.videoPaddingLeft=0,this.iphoneRealWidth=e):nthis.resolution.h,this.videoElement.removeAttribute("style"),this.keyContainer&&this.keyContainer.removeAttribute("style"),this.gameContainer&&this.gameContainer.removeAttribute("style"),this.mouseMask.removeAttribute("style"),this.landscapeMode){this.videoWrap.classList.remove("is-rotate");var t=this.resolution.h>this.resolution.w?this.resolution.w:this.resolution.h;if(We("ios")&&this.videoElement.clientHeight>t){var n=t-70+"px";this.videoElement.style.height=n,this.mouseMask.style.height=n,this.keyContainer&&(this.keyContainer.style.height=n),this.gameContainer&&(this.gameContainer.style.height=n)}}else this.videoElement.style.width=this.mouseMask.clientHeight+"px",this.videoElement.style.height=this.mouseMask.clientWidth+"px",this.videoElement.style.marginLeft=this.mouseMask.clientWidth+"px",this.videoWrap.classList.add("is-rotate");R()(this,ui)[ui]()},na=function(){this.resolution.w=window.screen.availWidth,this.resolution.h=window.screen.availHeight,this.isMobile&&R()(this,pi)[pi](),R()(this,Wi)[Wi](),this.videoRect.w=this.videoElement.clientWidth,this.videoRect.h=this.videoElement.clientHeight},ia=function(e,t,n,i,a){if(t||R()(this,An)[An]&&this.p2p)try{var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{type:null,head:{},body:{}},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(t)return jt(e);if(n){var i=new ArrayBuffer(32),a=new DataView(i,24);return a.setUint32(0,2,!0),i}if(e&&e.type&&Ut[e.type]){var r=function(){var t=Ut[e.type];e.type===Ft?(e.body.token_size=e.body.token.length||0,t.find((function(e){return"token"===e.key})).len=e.body.token_size||0):e.type===Jt||e.type===pn?t.find((function(e){return"data"===e.key})).len=e.body.data_size||0:e.type===Zt?t.find((function(e){return"key_flags"===e.key})).len=4*(e.body.key_flags_size||0):e.type===rn&&(t.find((function(e){return"fps"===e.key})).len=e.body.fps_size||0);for(var n=zt.length,i=0,a=0;a=0||t[u].key.indexOf("gateway")>=0)&&(h=vn(h||"")||0),e.type===pn&&"data"===t[u].key&&11===e.body.data_type)new Uint8Array(o,l,e.body.data_size).set(new Uint8Array(e.body.data)),l+=e.body.data_size;else if(e.type===ln&&"timestamp"===t[u].key){var v=new Uint32Array(o,l,2);v[0]=0,v[1]=0,l+=8}else if(e.type===Ft&&"reserve_size"===t[u].key)[1,0,0,0,3,3,0,3,0,0,0].forEach((function(e){s.setUint8(l,e,!0),l+=1}));else if(e.type===Vt&&"reserve_size"===t[u].key)[1,0,0,0,1,2,0,0].forEach((function(e){s.setUint8(l,e,!0),l+=1}));else if("button_state"===t[u].key)s.setUint32(l,h,!0),l+=4;else if("key_flags"===t[u].key&&t[u].len&&Ke(h,"Array"))h.forEach((function(e){s.setUint32(l,e,!0),l+=4}));else if(t[u].symbols&&2===t[u].len)s.setInt16(l,h,!0),l+=t[u].len;else if(t[u].isConcat){if(t[u].len)if(t[u].key.indexOf("mac")>=0)for(var m=h.split(":"),y=0;y<6;y++)s.setUint8(l,Number(m[y])||0,!0),l+=1;else if("string"===f()(h).toLowerCase()){h.length;for(var g=0;g=60)){var e=mt[0].timestamp||0,t="".concat(kt(),"1\t2\t13\t").concat(Math.round(e/1e3),"\t"),n="".concat(kt(),"1\t4\t5\t").concat(Math.round(e/1e3),"\t");mt.forEach((function(i,a){t+="".concat(i.fRecv,",0,").concat(i.fDecod,",0,0,0,").concat(i.fDecodMS,",").concat(Math.round((i.timestamp-e)/1e3)),n+="0,".concat(i.packetsReceived,",").concat(i.packetsLost,",").concat(i.channelDelay,",").concat(i.pliCount,",").concat(i.firCount,",").concat(i.nack,",").concat(Math.round((i.timestamp-e)/1e3)),a0&&(e.audioElement.srcObject=t.stream.mediaStream,e.playVideo())})),this.p2p.addEventListener("messagereceived",(function(t){mn(t.message,e.isMobile).then((function(t){if(t&&t.type)switch(t.type){case Gt:t&&t.head&&t.head.id&&R()(e,jn)[jn][t.head.id]&&(e.datachannelDelay=Date.now()-R()(e,jn)[jn][t.head.id],delete R()(e,jn)[jn][t.head.id],e.p2pRTTChange&&e.p2pRTTChange(e.datachannelDelay||0));break;case Wt:t.head&&0===t.head.ack&&(!t.body||0!==t.body.err_code&&3!==t.body.err_code?(e.dispatchEvent(54),R()(e,wi)[wi]()):0===t.body.err_code?(e.dispatchEvent(53),R()(e,Xn)[Xn]=!0,clearInterval(R()(e,ni)[ni]),R()(e,ni)[ni]=setInterval((function(){return R()(e,Pi)[Pi]()}),1e3)):R()(e,Xn)[Xn]||(e.dispatchEvent(54),R()(e,wi)[wi]()));break;case qt:clearInterval(R()(e,ni)[ni]),!R()(e,Yn)[Yn]&&t&&t.body&&0===t.body.err_code&&(e.dispatchEvent(55),R()(e,Yn)[Yn]=!0,R()(e,hi)[hi](),R()(e,Jn)[Jn]=0,R()(e,Ai)[Ai](),R()(e,Ji)[Ji](),R()(e,qi)[qi]());break;case Jt:t.body&&R()(e,ji)[ji](t.body);break;case on:e.dispatchEvent(56),R()(e,Yn)[Yn]=!1,clearInterval(R()(e,ni)[ni]),R()(e,ni)[ni]=setInterval((function(){return R()(e,Pi)[Pi]()}),1e3);break;case pn:t.body&&t.body.data&&(e.emit({type:"NotifyDataTunnelMsg",msg:t.body.data}),t.body.data.length<=4&&(R()(e,Zn)[Zn]=!0,t.body.data&&(t.body.data=Number(t.body.data)||0),1===t.body.data?e.dispatchEvent(19):e.dispatchEvent(17)));break;case Qt:e.dispatchEvent(57),e.isMobile&&e.getRemoteMouse();break;case cn:e.emit({type:"remoteMousePSChange",msg:t.body}),R()(e,Ii)[Ii](t.body);break;case dn:var n=t.body&&t.body.type?t.body.type:null,i=n?[null,"设备主机已取消分享,无法继续远程","设备主机已被删除,无法继续远程"][n]:null;e.dispatchEvent(16,i||"主机分享取消"),R()(e,wi)[wi]();break;case hn:t.body&&e._handleFileSendAck(t.body)}})).catch((function(e){}))})),this.p2p)},ra=function(){this.dispatchEvent(26),R()(this,vi)[vi]({id:"101",jsonrpc:"2.0",method:"start",params:{clientType:"js"}},!0,!1,!0),R()(this,Oi)[Oi](),R()(this,Si)[Si](),this.AutoFullScreen&&Mt(this.videoWrap),navigator&&navigator.keyboard&&navigator.keyboard.lock&&navigator.keyboard.lock().then((function(){})).catch((function(e){}))},oa=function(){this.dispatchEvent(7),R()(this,ci)[ci](),R()(this,ki)[ki]()},sa=function(){clearInterval(R()(this,ii)[ii]),R()(this,ai)[ai]=0},ca=function(){R()(this,ai)[ai]+=1,R()(this,ai)[ai]>5?(R()(this,gi)[gi](),this.dispatchEvent(400)):(this.dispatchEvent(25),R()(this,vi)[vi]({id:"111",jsonrpc:"2.0",method:"detect",params:{clientType:"js"}},!0,!1,!0))},da=function(){var e=this;R()(this,gi)[gi](),R()(this,bi)[bi](),R()(this,ii)[ii]=window.setInterval((function(){return R()(e,bi)[bi]()}),1e3)},la=function(){var e=this;if(R()(this,oi)[oi](),this.clientId&&this.remoteId&&this.token){if(R()(this,Jn)[Jn]++,R()(this,Jn)[Jn]>=this.MAX_RECONNECT_TIMES)return this.dispatchEvent(15,"max reconnect time"),!1;this.p2p=null,R()(this,Nn)[Nn]=!1,R()(this,fi)[fi]().connect({host:this.signalAddress,token:this.clientId,auth:this.token}).then((function(){return R()(e,yi)[yi]()})).catch((function(t){e.dispatchEvent(4),R()(e,si)[si](),e.p2p.disconnect()}))}else this.dispatchEvent(14)},ua=function(e,t,n,i){St(),R()(this,si)[si](),R()(this,Nn)[Nn]=!!t,R()(this,An)[An]=!1;try{e||this.p2p&&R()(this,An)[An]&&R()(this,Ai)[Ai](),this.p2p&&this.p2p.disconnect()}catch(e){}i?this.dispatchEvent(18):this.dispatchEvent(t?15:13),n&&n()},pa=function(){this.dispatchEvent(50),R()(this,vi)[vi]({type:Ft,head:{id:10,type:Ft,size:24,version:1,ack:0,token:1},body:{client_os:10,client_type:1,client_mac:this.client_mac,client_ip:this.client_ip,client_gateway:this.client_gateway,token_size:3,token:this.token,reserve_size:0}},!0)},ha=function(){var e,t=this,n=this.resolveSDP();n&&(R()(this,Ei)[Ei](n),R()(this,xi)[xi](),R()(this,Ti)[Ti](),R()(this,Ni)[Ni](),R()(this,Ci)[Ci](),R()(this,Hn)[Hn]&&(e=this)&&(Ln(),Cn=e,wn?(window.addEventListener("gamepadconnected",Rn),window.addEventListener("gamepaddisconnected",Mn)):Sn&&(window.addEventListener("webkitgamepadconnected",Rn),window.addEventListener("webkitgamepaddisconnected",Mn))),this.videoElement&&(this.videoElement.addEventListener("canplay",(function(){t.emit({type:"videoCanplay"}),t.dispatchEvent(12),t.playVideo()})),this.videoElement.addEventListener("loadeddata",(function(){t.emit({type:"firstFrame"}),t.dispatchEvent(12),t.playVideo()})))),wt({report_time:"##serverTime##",ip:"##clientIP##",mac:"000000000000",token:this.token,nomarl:1,record:{module:7,type:12,desc:"client_type:browser, client_os:"+Xe()+", client_net_type:"+Je()+",client_external_ip:0.0.0.0,client_transport_type:unknown,client_port_type:unknown,client_net_type:unknown,server_net_type:unknown,server_external_ip:0.0.0.0, server_port_type:unknown,server_nat_type:unknown,p2p_used_time_ms:0"}})},va=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=["H264","H265","VP8","VP9"],n=0,i=0;i=0&&(n|=Math.pow(2,a))}var r={};if(this.setResolution&&this.setResolution.w&&this.setResolution.h)r.w=this.setResolution.w,r.h=this.setResolution.h;else{if((r={w:parseInt(screen.width*window.devicePixelRatio),h:parseInt(screen.height*window.devicePixelRatio)}).w1920&&(r.w=1920,r.h=1080)}this.dispatchEvent(51),R()(this,vi)[vi]({type:Vt,head:{id:11,type:Vt,size:24,version:1,ack:0,token:1},body:{codec_type:n,cur_width:r.w,cur_height:r.h,cur_refresh_rate:60,max_width:r.w,max_height:r.h,max_refresh_rate:60,reserve_size:0}},!0,!1)},fa=function(){R()(this,vi)[vi]({type:Kt,head:{id:12,type:Kt,size:24,version:1,ack:0,token:1},body:{support_codec_type:2,reserve_size:0}},!0)},ma=function(){R()(this,vi)[vi]({type:Xt,head:{id:22,type:Xt,size:24,version:1,ack:0,token:1},body:{channels:2,sample_rate:48e3,bits_per_sample:16,bits_rate:0,reserve_size:0}},!0)},ya=function(){R()(this,vi)[vi]({type:Yt,head:{id:13,type:Yt,size:24,version:1,ack:0,token:1},body:{reserve_size:0}},!0)},ga=function(e){R()(this,vi)[vi]({type:an,head:{id:98,type:an,size:24,version:1,ack:0,token:1},body:{action:0,gamepad_index:e,reserve:0}},!0)},ba=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;R()(this,vi)[vi]({type:an,head:{id:98,type:an,size:24,version:1,ack:0,token:1},body:{action:1,gamepad_index:e,reserve:0}},!0)},ka=function(e){if(e){var t=this.remoteDeskSolution.w,n=this.remoteDeskSolution.h;this.remoteDeskSolution.w=e.width||this.remoteSolution.w||1280,this.remoteDeskSolution.h=e.height||this.remoteSolution.h||720,this.lastMousePos.x=e.x||0,this.lastMousePos.y=e.y||0,this.lastMousePos.x=this.lastMousePos.x*this.iphoneRealWidth/this.remoteDeskSolution.w,this.lastMousePos.y=this.lastMousePos.y*this.ipadRealHeight/this.remoteDeskSolution.h,t===this.remoteDeskSolution.w&&n===this.remoteDeskSolution.h||R()(this,hi)[hi]()}},_a=function(){var e=this;clearInterval(R()(this,ti)[ti]);var t=function(){"loading"===R()(e,Zn)[Zn]&&(R()(e,Qn)[Qn]++,R()(e,Qn)[Qn]>e.loginMaxCount&&(R()(e,Zn)[Zn]="time-out",R()(e,Qn)[Qn]=0,e.dispatchEvent(21)));for(var t=Ve();R()(e,jn)[jn][t];)t=Ve();R()(e,jn)[jn][t]=Date.now(),R()(e,vi)[vi]({type:Ht,head:{id:t,type:Ht,size:24,version:1,ack:0,token:1}},!0),e.isMobile&&e.getRemoteMouse()};t(),R()(this,ti)[ti]=setInterval(t,1e3)},wa=function(){var e=this;if(clearInterval(R()(this,ei)[ei]),!this.isOpenStats)return!1;R()(this,ei)[ei]=setInterval((function(){var t=e.remoteId;t&&e.p2p.getStats(t).then((function(t){var n=function(e){var t=Ye(e);++Qe>3&&(Qe=0);var n=t&&t.videoResult?t.videoResult.length:0,i="",a=0,r=0,o=0;if(n){for(var s=JSON.parse(JSON.stringify(lt)),c=!1,d=!1,l=0;l=8?this.changeFPS(30,!0):this.changeFPS(60,!0),R()(this,Gn)[Gn]=[]))},Pa=function(){R()(this,vi)[vi]({type:tn,head:{id:13,type:tn,size:24,version:1,ack:0,token:1},body:{type:2,reserve_size:0}},!0)},Ea=function(){this.isMobile&&R()(this,vi)[vi]({type:rn,head:{id:0,type:rn,size:24,version:0,ack:0,token:0},body:{a:1,b:1,c:265,fps_size:1,fps:31,d:0,reserve_size:0}},!1,!0)},xa=function(e,t){if(!R()(this,Kn)[Kn]&&e){this.gameId=e,R()(this,Zn)[Zn]=!1;var n=e.toString();R()(this,Vi)[Vi](n),t&&(R()(this,Qn)[Qn]=0,this.dispatchEvent(20),R()(this,Zn)[Zn]="loading"),R()(this,Kn)[Kn]=!0}},Ta=function(e){var t=this.relativeMovementMode;this.relativeMovementMode=!e.visible,t!==this.relativeMovementMode&&R()(this,Fi)[Fi](),this.relativeMovementMode?(R()(this,zn)[zn].x=0,R()(this,zn)[zn].y=0):4===e.type?R()(this,Ui)[Ui](e):R()(this,zi)[zi](e)},Ca=function(e){if(!e.reserveByte||He(e.reserveByte.x)||He(e.reserveByte.y))R()(this,zn)[zn].x=0,R()(this,zn)[zn].y=0;else{var t=e.reserveByte.x,n=e.reserveByte.y;R()(this,zn)[zn].x=t>32?0:t,R()(this,zn)[zn].y=n>32?0:n}var i=e.data,a=e.w,r=e.h,o=(e.type,[]),s=r||32,c=a||32;if(i)if(i.buffer&&!Ge(i.buffer))R()(this,Un)[Un]=null;else{i.length;if((o=i.subarray(54)).some(Boolean)){var d=this.canvas.getContext("2d");d.canvas.width=c,d.canvas.height=s,d.fillStyle="rgba(255,255,255,0)",d.clearRect(0,0,c,s);for(var l=0;l32?0:t,R()(this,zn)[zn].y=n>32?0:n}var i=e.reserveByte||{},a=i.kCursorResId;if(a)R()(this,Fn)[Fn]=At[a]||"default";else{var r=i.kBitmapMaskWidth||0,o=i.kBitmapMaskHeight||0,s=i.kBitmapColorWidth||0,c=i.kBitmapColorHeight||0,d=i.kBitmapMaskData||[],l=i.kBitmapColorData,u=i.kBitmapMaskBitsPixel,p=(i.kBitmapColorBitsPixel,this.canvas.getContext("2d")),h=s||r,v=c||o;if(p.canvas.width=h,p.canvas.height=v,p.fillStyle="rgba(255,255,255,0)",p.clearRect(0,0,h,v),l&&l.length){for(var f=!0,m=0;m>w?0:1,T=f?x:l[k+3]/255;p.fillStyle="rgba("+S+","+P+","+E+","+T+")",p.fillRect(b,g,1,1)}R()(this,Un)[Un]=this.canvas.toDataURL("image/png")}else if(d&&d.length){if(1===u){var C=d.length,M=d.slice(0,C/2),I=d.slice(C/2);v/=2,p.canvas.height=v;for(var O=0;O>A,B=I[D]&128>>A?255:0,j=N?B/255:1;p.fillStyle="rgba("+B+","+B+","+B+","+j+")",p.fillRect(L,O,1,1)}R()(this,Un)[Un]=this.canvas.toDataURL("image/png")}}else R()(this,Un)[Un]=null;R()(this,Fn)[Fn]=null}R()(this,Fn)[Fn]?this.videoElement.style.cursor=R()(this,Fn)[Fn]:this.videoElement.style.cursor=R()(this,Un)[Un]?"url("+R()(this,Un)[Un]+") "+R()(this,zn)[zn].x+" "+R()(this,zn)[zn].y+",auto":"auto"},Ma=function(){wt({nomarl:1,record:{module:5,type:7,desc:this.relativeMovementMode?"relative mouse mode":"absolute mouse mode"}}),this.isMobile?R()(this,Hi)[Hi]():this.relativeMovementMode?this.videoElement.style.cursor=this.isMouseControl?"none":"auto":R()(this,Fn)[Fn]?this.videoElement.style.cursor=this.isMouseControl?R()(this,Fn)[Fn]:"auto":R()(this,Un)[Un]?this.videoElement.style.cursor="url("+R()(this,Un)[Un]+") "+R()(this,zn)[zn].x+" "+R()(this,zn)[zn].y+",auto":this.videoElement.style.cursor="auto"},Ia=function(){if(this.isMobile)R()(this,Hi)[Hi]();else try{this.relativeMovementMode?this.isMouseControl&&Lt()&&!Rt()&&(t=this.videoElement,n=t||document.documentElement,(i=n.requestPointerLock||n.mozRequestPointerLock||n.webkitRequestPointerLock||n.msRequestPointerLock)&&i.call(n)):Rt()&&((e=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock)&&e.call(document))}catch(e){}var e,t,n,i},Oa=function(){this.cursorImg&&(this.relativeMovementMode?(this.cursorImgurl&&this.cursorImg.setAttribute("src",this.cursorImgurl),this.cursorImg.classList.remove("show")):this.cursorImg.classList.add("show"))},La=function(e){R()(this,vi)[vi]({type:nn,head:{id:99,type:nn,size:24,version:1,ack:0,token:1},body:e})},Da=function(e,t){R()(this,vi)[vi]({type:pn,head:{id:93,type:pn,size:24,version:1,ack:0,token:1},body:{data_type:t,data_size:e.length,data:e,reserve_size:0}},!0)},Aa=function(){var e=this,t=function(t){t.target===e.videoElement&&(Lt()||Mt(e.videoWrap))},n=function(t){t.target===e.mouseMask&&(Lt()||Mt(e.videoWrap))},i=function(t){t.target===e.videoElement&&e.videoElement.focus()};if(this.videoElement.removeEventListener("click",i),this.videoElement.addEventListener("click",i),this.videoElement.removeEventListener("click",t),this.mouseMask&&this.mouseMask.removeEventListener("click",n),this.AutoFullScreen&&(this.isMobile?this.mouseMask&&this.mouseMask.addEventListener("click",n,{once:!0}):this.videoElement.addEventListener("click",t,{once:!0})),!this.isMobile){var a=function(e){(!0===e.ctrlKey||e.metaKey)&&e.preventDefault()};window.addEventListener("mousewheel",a,{passive:!1}),window.removeEventListener("DOMMouseScroll",a,{passive:!1})}},Na=function(){var e=this,t=function(){e.playVideo()};this.isMobile?(this.mouseMask&&this.mouseMask.removeEventListener("click",t),this.mouseMask&&this.mouseMask.addEventListener("click",t)):(this.videoElement.removeEventListener("click",t),this.videoElement.addEventListener("click",t))},Ba=(Math.pow(2,15),new Image(20,13));Ba.src=n("fakn").default;window.navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate;n("K1c7"),n("EfXH"),n("OqcQ"),n("Y0lW"),n("0PJp"),n("ek+N"),n("7Szd"),n("cwiY"),n("IUVT");function ja(e){var t=e.data,n=void 0===t?{}:t,i=e.type,a=void 0===i?"POST":i,r=e.url;e.contentType;return new Promise((function(e){try{var t=null;if(t=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),"GET"==a){if("object"==f()(n)){var i="";for(var o in n)i+=encodeURIComponent(o)+"="+encodeURIComponent(n[o])+"&";n=i.replace(/&$/,"")}if(n)t.open("GET",r+"?"+n,!0);else{var s=Math.random();t.open("GET",r+"?t="+s,!0)}t.send()}else"POST"==a&&(t.open("POST",r,!0),t.setRequestHeader("Content-type","application/json"),t.send(JSON.stringify(n)));t.onreadystatechange=function(){if(4==t.readyState){if(200==t.status){var n={};try{n=t.responseText&&!t.responseText.startsWith("<")?JSON.parse(t.responseText):{}}catch(e){n={success:!1,message:t.responseText}}return n.status=t.status,e(n)}var i={};try{i=t.responseText&&!t.responseText.startsWith("<")?JSON.parse(t.responseText):{}}catch(e){i={success:!1,message:t.responseText}}return i.status=t.status,i.success=i.success||!1,e(i)}}}catch(t){return e({success:!1,data:t||{}})}}))}var za=function(e){return ja({url:"/fastLink/device/deviceVerificationType",data:e,type:"POST"})},Ua=function(e,t){return ja({url:"/fastLink/shareUrl/connect/check",data:{deviceNo:e,random:t},type:"POST"})},Fa=function(e){if(e.clientNo&&e.deviceNo)return ja({url:"/fastLink/config/idTransfer",data:e,type:"POST"})},Wa=function(e){if(e)return ja({url:"/fastLink/stream/record/close",data:{streamRecordId:e},type:"POST"})};n("OjQg");function Ha(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ga(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"alert",t=document.getElementById("loading-mask");t&&(t.style.display="block",t.style.zIndex="alert"===e?104:100)}function nr(){var e=document.getElementById("loading-mask");e&&(e.style.display="none")}function ir(e){return document.getElementById(e)}function ar(){return{checkAlert:ir("check-alert"),windows:ir("windows"),custom:ir("custom"),windowsUser:ir("windows-user"),windowsPassword:ir("windows-password"),customPassword:ir("custom-password"),checkBtn:ir("check-btn"),autoLogin:ir("auto-login"),switchBtn:ir("switch-btn")}}function rr(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;Qa||(Qa=ar()),tr("check"),Qa.checkAlert.style.display=e?"block":"none",e&&(Qa.checkBtn.onclick=fr,3===t?Qa.switchBtn.onclick=or:Qa.switchBtn.innerText="",2===t&&or(!1))}function or(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];"windows"===Ya?(sr(Ya),Qa.windows.style.display="none",Qa.custom.style.display="block",e&&(Qa.switchBtn.innerText="切换到系统账户"),Ya="custom"):"custom"===Ya&&(sr(Ya),Qa.windows.style.display="block",Qa.custom.style.display="none",e&&(Qa.switchBtn.innerText="切换到密码登录"),Ya="windows")}function sr(e){"windows"===e?(Qa.windowsUser.value="",Qa.windowsPassword.value=""):"custom"===e&&(Qa.customPassword.value="")}function cr(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function dr(e){var t={x:0,y:0},n={x:0,y:0};function i(i){e.relativeMovementMode?e.sendrel(function(i){var a,r,o,s,c=window.devicePixelRatio||1;return a=Math.round(i.movementX/c),r=Math.round(i.movementY/c),t.x+=a,t.y+=r,a=Math.floor(t.x),r=Math.floor(t.y),o=a-n.x,s=r-n.y,n.x=a,n.y=r,e.remoteSolution.w&&e.remoteSolution.h&&(o=o*e.remoteSolution.w/e.videoRect.w,s=s*e.remoteSolution.h/e.videoRect.h),{x:o,y:s}}(i)):e.sendAbs(i.offsetX/e.videoRect.w,i.offsetY/e.videoRect.h)}e.videoElement.addEventListener("contextmenu",(function(e){return e.preventDefault(),!1})),e.videoElement.removeEventListener("mousemove",i),e.videoElement.addEventListener("mousemove",i),e.videoElement.addEventListener("mousedown",e.sendMousedown),e.videoElement.addEventListener("mouseup",e.sendMouseup),document.addEventListener("keydown",e.sendKeydown),document.addEventListener("keyup",e.sendKeyup),document.addEventListener("wheel",e.sendMousewheel);var a=document.getElementById("model-btn"),r=document.getElementById("control-box"),o=r.querySelector("#tog-control"),s=r.querySelector("#tog-full"),c=r.querySelector("#control-select"),d=c.querySelector("#speed-inner"),l=r.querySelector("#speed-list"),u=l.querySelectorAll("li");function p(){r.classList.remove("show"),l.classList.remove("show")}document.addEventListener("click",(function(t){if(t.target.classList.contains("art-item"))!function(t){var n=t.target,i=Array.prototype.indexOf.call(u,n);if(i>=0){for(var a=0;aa?a:i.x,i.y=i.y<0?0:i.y>o?o:i.y;var s=i.x,c=i.y;if(n.setMobileCursor(e.center.x,e.center.y),t){if(n.remoteDeskSolution.w&&n.remoteDeskSolution.h){var d=(s-n.lastMousePos.x)*n.remoteDeskSolution.w/a,l=(c-n.lastMousePos.y)*n.remoteDeskSolution.h/o;n.lastMousePos.x=s,n.lastMousePos.y=c,n.sendCalcRel({x:d,y:l})}}else s=i.x/a,c=i.y/o,n.sendAbs(s,c);n.getRemoteMouse()}a.off("tap press pan"),a.on("tap",(function(t){if(t&&t.center){var i=!1;n.time>0&&Date.now()-n.time0&&void 0!==o[0]?o[0]:{},n=o.length>1&&void 0!==o[1]&&o[1],i=o.length>2?o[2]:void 0,a=Ga({clientNo:Ka,deviceNo:qa},t),e.next=6,Fa(a);case 6:(r=e.sent).success?(n||(rr(!1),Qa.autoLogin.checked?localStorage.setItem("USERINFO",JSON.stringify(Ga({},t,{loginType:Ya}))):localStorage.setItem("USERINFO","")),Za=r.data,pr()):(rr(!0,i),$a(r.message||"获取数据失败"));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function fr(){var e,t="windows"===(e=Ya)?{verificationName:Qa.windowsUser.value,verificationPassword:Qa.windowsPassword.value}:"custom"===e?{verificationPassword:Qa.customPassword.value}:void 0;"windows"!==Ya||t.verificationName?t.verificationPassword?hr(t):$a("请输入密码"):$a("请输入用户名")}function mr(){return(mr=u()(d.a.mark((function e(){var t,n,i,a,o,s,c,l;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(qa=qe("d",location.search),t=qe("r",location.search),!qa){e.next=38;break}return e.next=5,Ua(qa,t);case 5:if((n=e.sent).success){e.next=8;break}return e.abrupt("return",$a(n.message||"主机不可用"));case 8:if(n.data&&n.data.pass){e.next=10;break}return e.abrupt("return",$a(n.message||"主机不可用"));case 10:return qa=window.atob(qa),Ka=cr(),e.next=14,za({deviceNo:qa});case 14:if((i=e.sent).success){e.next=17;break}return e.abrupt("return",$a(i.message||"校验信息获取失败"));case 17:if(0!==i.data.verificationType){e.next=20;break}return hr(),e.abrupt("return");case 20:if(a=localStorage.getItem("USERINFO")){e.next=23;break}return e.abrupt("return",rr(!0,i.data.verificationType));case 23:if(e.prev=23,o={windows:1,custom:2},s=JSON.parse(a),c=s.loginType,l=r()(s,["loginType"]),3!==i.data.verificationType&&o[c]!==i.data.verificationType){e.next=29;break}return hr(l,!0,i.data.verificationType),e.abrupt("return");case 29:e.next=35;break;case 31:e.prev=31,e.t0=e.catch(23),localStorage.setItem("USERINFO","");case 35:rr(!0,i.data.verificationType),e.next=39;break;case 38:$a("缺少必要参数");case 39:case"end":return e.stop()}}),e,null,[[23,31]])})))).apply(this,arguments)}document.addEventListener("DOMContentLoaded",(function(){var e,t;e="",t=document.querySelector("#video-and-stats"),Va?(e='
输入Windows账户名和密码,验证后即可远程
输入访问密码,验证后即可远程
登录
切换到密码登录
',document.body.classList.add("sm"),document.body.classList.remove("pc")):(e='
打开

收起控制面板

速率设置:自适应
  • 自适应
  • 10M
  • 20M
  • 40M
  • 80M
提示
输入Windows账户名和密码,验证后即可远程
输入访问密码,验证后即可远程
登录
切换到密码登录
',document.body.classList.add("pc"),document.body.classList.remove("sm")),t.innerHTML=e,function(){mr.apply(this,arguments)}()}))},OqcQ:function(e,t,n){},Y0lW:function(e,t,n){},cwiY:function(e,t,n){},"ek+N":function(e,t,n){},fakn:function(e,t,n){"use strict";n.r(t),t.default=n.p+"static1/img/eye.png"}},[["NA3w",0,2]]]);