From 6f5610b40d04a99f41563367e0710f5b64d1f021 Mon Sep 17 00:00:00 2001 From: sunmeng <1162067978@qq.com> Date: Thu, 7 Nov 2024 14:10:49 +0800 Subject: [PATCH] 1 --- package-lock.json | 6 +-- public/index.html | 1 + src/assets/js/ek.js | 108 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 112 insertions(+), 3 deletions(-) create mode 100644 src/assets/js/ek.js diff --git a/package-lock.json b/package-lock.json index 2823099..7493b8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5376,9 +5376,9 @@ "dev": true }, "node_modules/ezuikit-js": { - "version": "7.7.7", - "resolved": "https://registry.npmjs.org/ezuikit-js/-/ezuikit-js-7.7.7.tgz", - "integrity": "sha512-VRkQN5u7bTdSwCqQYk3db7lR2kiXdCrMzr/rwmRZww8xqeXaghgttPjjI/kS+u/xVMAkl6hp9+47Yxs/zBRB8A==" + "version": "7.7.10", + "resolved": "https://registry.npmmirror.com/ezuikit-js/-/ezuikit-js-7.7.10.tgz", + "integrity": "sha512-mpySnXY3F4LzW0R262IZIFBfp3fpDNVaB5UBAeO/IhofZii+2UD0p5Oc/2BrPfjADmcZnGCMOvJ92hlUMkk5EQ==" }, "node_modules/fast-deep-equal": { "version": "3.1.3", diff --git a/public/index.html b/public/index.html index 3e5a139..936d92c 100644 --- a/public/index.html +++ b/public/index.html @@ -11,6 +11,7 @@ +
diff --git a/src/assets/js/ek.js b/src/assets/js/ek.js new file mode 100644 index 0000000..1040e48 --- /dev/null +++ b/src/assets/js/ek.js @@ -0,0 +1,108 @@ +/* +* +* ezuikit.js v8.1.0 +* Copyright (c) 2024-11-4 Ezviz-OpenBiz +* Released under ISC the License. +* +*/ +!function(A,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(A="undefined"!=typeof globalThis?globalThis:A||self).EZUIKit=e()}(this,(function(){"use strict";function A(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,i=Array(e);t=A.length?{done:!0}:{done:!1,value:A[i++]}},e:function(A){throw A},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 a,r=!0,o=!1;return{s:function(){t=t.call(A)},n:function(){var A=t.next();return r=A.done,A},e:function(A){o=!0,a=A},f:function(){try{r||null==t.return||t.return()}finally{if(o)throw a}}}}function o(A,e,t){return(e=I(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function s(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable}))),t.push.apply(t,i)}return t}function g(A){for(var e=1;e=0;--a){var r=this.tryEntries[a],o=r.completion;if("root"===r.tryLoc)return n("end");if(r.tryLoc<=this.prev){var s=i.call(r,"catchLoc"),g=i.call(r,"finallyLoc");if(s&&g){if(this.prev=0;--t){var n=this.tryEntries[t];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev=0;--e){var t=this.tryEntries[e];if(t.finallyLoc===A)return this.complete(t.completion,t.afterLoc),b(t),B}},catch:function(A){for(var e=this.tryEntries.length-1;e>=0;--e){var t=this.tryEntries[e];if(t.tryLoc===A){var i=t.completion;if("throw"===i.type){var n=i.arg;b(t)}return n}}throw Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:R(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=A),B}},e}function l(e){return function(e){if(Array.isArray(e))return A(e)}(e)||function(A){if("undefined"!=typeof Symbol&&null!=A[Symbol.iterator]||null!=A["@@iterator"])return Array.from(A)}(e)||C(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(A){var e=function(A,e){if("object"!=typeof A||!A)return A;var t=A[Symbol.toPrimitive];if(void 0!==t){var i=t.call(A,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(A)}(A,"string");return"symbol"==typeof e?e:e+""}function d(A){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},d(A)}function C(e,t){if(e){if("string"==typeof e)return A(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?A(e,t):void 0}}var h=function(){return a((function A(e,i){t(this,A),this.coreX=e,this.coreY=i}),[{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}}])}();Date.prototype.Format=function(A){var e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var t in/(y+)/.test(A)&&(A=A.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),e)new RegExp("("+t+")").test(A)&&(A=A.replace(RegExp.$1,1==RegExp.$1.length?e[t]:("00"+e[t]).substr((""+e[t]).length)));return A};var u=function(A,e,t,i){var n=document.getElementsByTagName("head")[0].getElementsByTagName("script"),a=!1;if(t)a=t();else for(var r=0;r3){var t=e[1],i=e[2],n="1"===e[3],a="live";return A.indexOf("rec=local")>-1?a="rec":A.indexOf("rec=cloud")>-1&&(a="cloud.rec"),{deviceSerial:t,channelNo:i,hd:n,type:a}}return{}};var S=function(A,e,t,i,n,a){var r=A,o=new XMLHttpRequest;o.onreadystatechange=function(){if(4==o.readyState&&200==o.status)if(function(A){if("string"==typeof A)try{var e=JSON.parse(A);return!("object"!==d(e)||!e)}catch(A){return!1}console.log("It is not a string!")}(o.responseText)){var A=JSON.parse(o.responseText);n(A)}else n(o.responseText)},o.open(e,r,!0);var s=new FormData;for(var g in t)s.append(g,t[g]);if(i&&"object"===d(i))for(var g in i)o.setRequestHeader(g,i[g]);o.send(s)},D=function(){return!!window&&navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone|Opera Mini)/i)},w=function(){return a((function A(e,i){var n=this;t(this,A),u("https://open.ys7.com/assets/ezuikit_v3.4/js/hls.js",(function(){console.log("加载hls.min.js成功",window.Hls),console.log("isSupportHls",window.Hls.isSupported()),window.Hls.isSupported()&&n.initHLS(e,i)}),(function(){return!!window.Hls}))}),[{key:"toString",value:function(){return"hls ".concat(this.coreX,"-").concat(this.coreY)}},{key:"initHLS",value:function(A,e){var t=_(e),i=t.deviceSerial,n=t.channelNo;t.hd,window.ezuikitMonitor.report({protocol:"hls",url:e,serial:i,no:n,action:1});var a=document.getElementById(A),r=new window.Hls({defaultAudioCodec:"mp4a.40.2"});r.loadSource(e),r.attachMedia(a),r.on(window.Hls.Events.MANIFEST_PARSED,(function(){a.play()})),r.on(window.Hls.Events.ERROR,(function(A,e){if(e.fatal)switch(e.type){case window.Hls.ErrorTypes.NETWORK_ERROR:console.log("fatal network error encountered, try to recover"),r.startLoad();break;case window.Hls.ErrorTypes.MEDIA_ERROR:console.log("fatal media error encountered, try to recover"),r.recoverMediaError();break;default:r.destroy()}})),this.hls=r,this.video=a,this.hlsUrl=e}},{key:"play",value:function(){console.log("执行hls播放",this.video),this.hls.startLoad(),this.video.play()}},{key:"stop",value:function(){this.video.pause(),this.hls.stopLoad()}}])}(),b="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function F(A){return A&&A.__esModule&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}function R(A){if(A.__esModule)return A;var e=A.default;if("function"==typeof e){var t=function A(){return this instanceof A?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(A).forEach((function(e){var i=Object.getOwnPropertyDescriptor(A,e);Object.defineProperty(t,e,i.get?i:{enumerable:!0,get:function(){return A[e]}})})),t}var k={exports:{}};!function(A){!function(e,t){A.exports=t()}(globalThis,(()=>(()=>{var A={343:A=>{var e=Object.prototype.hasOwnProperty,t="~";function i(){}function n(A,e,t){this.fn=A,this.context=e,this.once=t||!1}function a(A,e,i,a,r){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new n(i,a||A,r),s=t?t+e:e;return A._events[s]?A._events[s].fn?A._events[s]=[A._events[s],o]:A._events[s].push(o):(A._events[s]=o,A._eventsCount++),A}function r(A,e){0==--A._eventsCount?A._events=new i:delete A._events[e]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(t=!1)),o.prototype.eventNames=function(){var A,i,n=[];if(0===this._eventsCount)return n;for(i in A=this._events)e.call(A,i)&&n.push(t?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(A)):n},o.prototype.listeners=function(A){var e=t?t+A:A,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,a=i.length,r=new Array(a);n{t.d(e,{A:()=>i});const i=function(){function A(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return A.prototype.isComplete=function(){return!this.hasAudio||this.hasAudio&&null!=this.audioCodec&&null!=this.audioSampleRate&&this.audioChannelCount,!this.hasVideo||this.hasVideo&&null!=this.videoCodec&&null!=this.width&&null!=this.height&&null!=this.fps&&null!=this.profile&&null!=this.level&&null!=this.refFrames&&null!=this.chromaFormat&&null!=this.sarNum&&this.sarDen,null!=this.mimeType},A.prototype.isSeekable=function(){return this.hasKeyframesIndex},A.prototype.getNearestKeyframe=function(A){if(null==this.keyframesIndex)return null;var e=this.keyframesIndex,t=this._search(e.times,A);return{index:t,milliseconds:e.times[t],fileposition:e.filepositions[t]}},A.prototype._search=function(A,e){var t=0,i=A.length-1,n=0,a=0,r=i;for(e=A[n]&&e{t.d(e,{$_:()=>i,EX:()=>a,EZ:()=>n,Sc:()=>r});var i=function(A,e,t,i,n){this.dts=A,this.pts=e,this.duration=t,this.originalDts=i,this.isSyncPoint=n,this.fileposition=null},n=function(){function A(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return A.prototype.appendSyncPoint=function(A){A.isSyncPoint=!0,this.syncPoints.push(A)},A}(),a=function(){function A(){this._list=[]}return A.prototype.clear=function(){this._list=[]},A.prototype.appendArray=function(A){var e=this._list;0!==A.length&&(e.length>0&&A[0].originalDts=e[n].dts&&A((null===(e=t[n].lastSample)||void 0===e?void 0:e.originalDts)||0)&&A=((null===(t=null===(e=i[a])||void 0===e?void 0:e.lastSample)||void 0===t?void 0:t.originalDts)||0)&&(a===i.length-1||a0&&(r=this._searchNearestSegmentBefore(n.originalBeginDts)+1),this._lastAppendLocation=r,this._list.splice(r,0,n)},A.prototype.getLastSegmentBefore=function(A){var e=this._searchNearestSegmentBefore(A);return e>=0?this._list[e]:null},A.prototype.getLastSampleBefore=function(A){var e=this.getLastSegmentBefore(A);return null!=e?e.lastSample:null},A.prototype.getLastSyncPointBefore=function(A){for(var e=this._searchNearestSegmentBefore(A),t=this._list[e].syncPoints;0===t.length&&e>0;)e--,t=this._list[e].syncPoints;return t.length>0?t[t.length-1]:null},A}()},976:(A,e,t)=>{t.d(e,{A:()=>NA});var i=t(413),n=t(502),a=t(620),r=t(825);function o(A,e,t){var i=A;if(e+t=128){e.push(String.fromCharCode(65535&a)),i+=2;continue}}else if(t[i]<240){if(o(t,i,2)&&(a=(15&t[i])<<12|(63&t[i+1])<<6|63&t[i+2])>=2048&&55296!=(63488&a)){e.push(String.fromCharCode(65535&a)),i+=3;continue}}else if(t[i]<248){var a;if(o(t,i,3)&&(a=(7&t[i])<<18|(63&t[i+1])<<12|(63&t[i+2])<<6|63&t[i+3])>65536&&a<1114112){a-=65536,e.push(String.fromCharCode(a>>>10|55296)),e.push(String.fromCharCode(1023&a|56320)),i+=4;continue}}e.push(String.fromCharCode(65533)),++i}return e.join("")};var g,c=t(713),l=(g=new ArrayBuffer(2),new DataView(g).setInt16(0,256,!0),256===new Int16Array(g)[0]);const I=function(){function A(){}return A.parseScriptData=function(e,t,i){var a={};try{var r=A.parseValue(e,t,i),o=A.parseValue(e,t+r.size,i-r.size);a[r.data]=o.data}catch(A){n.A.e("AMF",A.toString())}return a},A.parseObject=function(e,t,i){if(i<3)throw new c.j4("Data not enough when parse ScriptDataObject");var n=A.parseString(e,t,i),a=A.parseValue(e,t+n.size,i-n.size),r=a.objectEnd;return{data:{name:n.data,value:a.data},size:n.size+a.size,objectEnd:r}},A.parseVariable=function(e,t,i){return A.parseObject(e,t,i)},A.parseString=function(A,e,t){if(t<2)throw new c.j4("Data not enough when parse String");var i=new DataView(A,e,t).getUint16(0,!l);return{data:i>0?s(new Uint8Array(A,e+2,i)):"",size:2+i}},A.parseLongString=function(A,e,t){if(t<4)throw new c.j4("Data not enough when parse LongString");var i=new DataView(A,e,t).getUint32(0,!l);return{data:i>0?s(new Uint8Array(A,e+4,i)):"",size:4+i}},A.parseDate=function(A,e,t){if(t<10)throw new c.j4("Data size invalid when parse Date");var i=new DataView(A,e,t),n=i.getFloat64(0,!l),a=i.getInt16(8,!l);return{data:new Date(n+=60*a*1e3),size:10}},A.parseValue=function(e,t,i){if(i<1)throw new c.j4("Data not enough when parse Value");var a,r=new DataView(e,t,i),o=1,s=r.getUint8(0),g=!1;try{switch(s){case 0:a=r.getFloat64(1,!l),o+=8;break;case 1:a=!!r.getUint8(1),o+=1;break;case 2:var I=A.parseString(e,t+1,i-1);a=I.data,o+=I.size;break;case 3:a={};var d=0;for(9==(16777215&r.getUint32(i-4,!l))&&(d=3);o32)throw new c.Qn("ExpGolomb: readBits() bits exceeded max 32bits!");if(A<=this._current_word_bits_left){var e=this._current_word>>>32-A;return this._current_word<<=A,this._current_word_bits_left-=A,e}var t=this._current_word_bits_left?this._current_word:0;t>>>=32-this._current_word_bits_left;var i=A-this._current_word_bits_left;this._fillCurrentWord();var n=Math.min(i,this._current_word_bits_left),a=this._current_word>>>32-n;return this._current_word<<=n,this._current_word_bits_left-=n,t<>>A)return this._current_word<<=A,this._current_word_bits_left-=A,A;return this._fillCurrentWord(),A+this._skipLeadingZero()},A.prototype.readUEG=function(){var A=this._skipLeadingZero();return this.readBits(A+1)-1},A.prototype.readSEG=function(){var A=this.readUEG();return 1&A?A+1>>>1:-1*(A>>>1)},A}(),C=function(){function A(){}return A._ebsp2rbsp=function(A){for(var e=A,t=e.byteLength,i=new Uint8Array(t),n=0,a=0;a=2&&3===e[a]&&0===e[a-1]&&0===e[a-2]||(i[n]=e[a],n++);return new Uint8Array(i.buffer,0,n)},A.parseSPS=function(e){for(var t=e.subarray(1,4),i="avc1.",n=0;n<3;n++){var a=t[n].toString(16);a.length<2&&(a="0"+a),i+=a}var r=A._ebsp2rbsp(e),o=new d(r);o.readByte();var s=o.readByte();o.readByte();var g=o.readByte();o.readUEG();var c=A.getProfileString(s),l=A.getLevelString(g),I=1,C=420,h=8,u=8;if((100===s||110===s||122===s||244===s||44===s||83===s||86===s||118===s||128===s||138===s||144===s)&&(3===(I=o.readUEG())&&o.readBits(1),I<=3&&(C=[0,420,422,444][I]),h=o.readUEG()+8,u=o.readUEG()+8,o.readBits(1),o.readBool()))for(var B=3!==I?8:12,E=0;E0&&N<16?(w=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][N-1],b=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][N-1]):255===N&&(w=o.readByte()<<8|o.readByte(),b=o.readByte()<<8|o.readByte())}if(o.readBool()&&o.readBool(),o.readBool()&&(o.readBits(4),o.readBool()&&o.readBits(24)),o.readBool()&&(o.readUEG(),o.readUEG()),o.readBool()){var T=o.readBits(32),M=o.readBits(32);R=o.readBool(),F=(k=M)/(P=2*T)}}var L=1;1===w&&1===b||(L=w/b);var Y=0,G=0;0===I?(Y=1,G=2-y):(Y=3===I?1:2,G=(1===I?2:1)*(2-y));var U=16*(p+1),J=16*(m+1)*(2-y);U-=(_+S)*Y,J-=(D+v)*G;var H=Math.ceil(U*L);return o.destroy(),o=null,{codec_mimetype:i,profile_idc:s,level_idc:g,profile_string:c,level_string:l,chroma_format_idc:I,bit_depth:h,bit_depth_luma:h,bit_depth_chroma:u,ref_frames:x,chroma_format:C,chroma_format_string:A.getChromaFormatString(C),frame_rate:{fixed:R,fps:F,fps_den:P,fps_num:k},sar_ratio:{width:w,height:b},codec_size:{width:U,height:J},present_size:{width:H,height:J}}},A._skipScalingList=function(A,e){for(var t=8,i=8,n=0;n=2&&3===e[a]&&0===e[a-1]&&0===e[a-2]||(i[n]=e[a],n++);return new Uint8Array(i.buffer,0,n)},A.parseVPS=function(e){var t=A._ebsp2rbsp(e),i=new d(t);return i.readByte(),i.readByte(),i.readBits(4),i.readBits(2),i.readBits(6),{num_temporal_layers:i.readBits(3)+1,temporal_id_nested:i.readBool()}},A.parseSPS=function(e){var t=A._ebsp2rbsp(e),i=new d(t);i.readByte(),i.readByte();for(var n=0,a=0,r=0,o=0,s=(i.readBits(4),i.readBits(3)),g=(i.readBool(),i.readBits(2)),c=i.readBool(),l=i.readBits(5),I=i.readByte(),C=i.readByte(),h=i.readByte(),u=i.readByte(),B=i.readByte(),E=i.readByte(),f=i.readByte(),Q=i.readByte(),x=i.readByte(),p=i.readByte(),m=i.readByte(),y=[],_=[],S=0;S0)for(S=s;S<8;S++)i.readBits(2);for(S=0;S1&&i.readSEG(),S=0;S0&&z<=16?(j=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][z-1],W=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][z-1]):255===z&&(j=i.readBits(16),W=i.readBits(16))}if(i.readBool()&&i.readBool(),i.readBool()&&(i.readBits(3),i.readBool(),i.readBool()&&(i.readByte(),i.readByte(),i.readByte())),i.readBool()&&(i.readUEG(),i.readUEG()),i.readBool(),i.readBool(),i.readBool(),i.readBool()&&(i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG()),i.readBool()&&(X=i.readBits(32),q=i.readBits(32),i.readBool()&&i.readUEG(),i.readBool())){var $,AA,eA=!1;for($=i.readBool(),AA=i.readBool(),($||AA)&&((eA=i.readBool())&&(i.readByte(),i.readBits(5),i.readBool(),i.readBits(5)),i.readBits(4),i.readBits(4),eA&&i.readBits(4),i.readBits(5),i.readBits(5),i.readBits(5)),S=0;S<=s;S++){var tA=i.readBool();Z=tA;var iA=!1,nA=1;tA||(iA=i.readBool());var aA=!1;if(iA?i.readSEG():aA=i.readBool(),aA||(nA=i.readUEG()+1),$)for(G=0;G>3,a=!!(4&e[i]),r=!!(2&e[i]);e[i],i+=1,a&&(i+=1);var o=Number.POSITIVE_INFINITY;if(r){o=0;for(var s=0;o|=(127&e[i])<<7*s,128&e[i+=1];s++);}1===n&&(t=A.parseSeuqneceHeader(e.subarray(i,i+o))),i+=o}return t},A.parseSeuqneceHeader=function(e){var t=new d(e),i=t.readBits(3),n=(t.readBool(),t.readBool()),a=!0,r=0,o=0,s=[];if(n)s.push({operating_point_idc:0,level:t.readBits(5),tier:0});else{if(t.readBool()){var g=t.readBits(32),c=t.readBits(32),l=t.readBool();if(l){for(var I=0;0===t.readBits(1);)I+=1;I>=32||t.readBits(I)}r=c,o=g,a=l,t.readBool()&&(t.readBits(5),t.readBits(32),t.readBits(5),t.readBits(5))}for(var C=t.readBool(),h=t.readBits(5),u=0;u<=h;u++){var B=t.readBits(12),E=t.readBits(5),f=E>7?t.readBits(1):0;s.push({operating_point_idc:B,level:E,tier:f}),C&&t.readBool()&&t.readBits(4)}}var Q=s[0],x=Q.level,p=Q.tier,m=t.readBits(4),y=t.readBits(4),_=t.readBits(m+1)+1,S=t.readBits(y+1)+1,D=!1;n||(D=t.readBool()),D&&(t.readBits(4),t.readBits(4)),t.readBool(),t.readBool(),t.readBool();var v=!1;n||(t.readBool(),t.readBool(),t.readBool(),t.readBool(),(v=t.readBool())&&(t.readBool(),t.readBool()),(t.readBool()||t.readBits(1))&&(t.readBool()||t.readBits(1)),v&&t.readBits(3)),t.readBool(),t.readBool(),t.readBool();var w=t.readBool(),b=8;b=2===i&&w?t.readBool()?12:10:w?10:8;var F=!1;1!==i&&(F=t.readBool()),t.readBool()&&(t.readBits(8),t.readBits(8),t.readBits(8));var R=1,k=1;return F?(t.readBits(1),R=1,k=1):(t.readBits(1),0===i?(R=1,k=1):1===i?(R=0,k=0):12===b?t.readBits(1)&&t.readBits(1):(R=1,k=0),R&&k&&t.readBits(2),t.readBits(1)),t.readBool(),t.destroy(),t=null,{codec_mimetype:"av01.".concat(i,".").concat(A.getLevelString(x,p),".").concat(b.toString(10).padStart(2,"0")),level:x,tier:p,level_string:A.getLevelString(x,p),profile_idc:i,profile_string:"".concat(i),bit_depth:b,ref_frames:1,chroma_format:A.getChromaFormat(F,R,k),chroma_format_string:A.getChromaFormatString(F,R,k),frame_rate:{fixed:a,fps:r/o,fps_den:o,fps_num:r},sar_ratio:{width:1,height:1},codec_size:{width:_,height:S},present_size:{width:1*_,height:S}}},A.getLevelString=function(A,e){return"".concat(A.toString(10).padStart(2,"0")).concat(0===e?"M":"H")},A.getChromaFormat=function(A,e,t){return A?0:0===e&&0===t?3:1===e&&0===t?2:1===e&&1===t?1:Number.NaN},A.getChromaFormatString=function(A,e,t){return A?"4:0:0":0===e&&0===t?"4:4:4":1===e&&0===t?"4:2:2":1===e&&1===t?"4:2:0":"Unknown"},A}();var p=function(){function A(A,e){this.TAG="FLVDemuxer",this._config=e,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=A.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=A.hasAudioTrack,this._hasVideo=A.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new r.A,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var A=new ArrayBuffer(2);return new DataView(A).setInt16(0,256,!0),256===new Int16Array(A)[0]}()}return A.prototype.destroy=function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null},A.probe=function(A){var e=new Uint8Array(A);if(e.byteLength<9)return{needMoreData:!0};var t={match:!1};if(70!==e[0]||76!==e[1]||86!==e[2]||1!==e[3])return t;var i,n=(4&e[4])>>>2!=0,a=!!(1&e[4]),r=(i=e)[5]<<24|i[6]<<16|i[7]<<8|i[8];return r<9?t:{match:!0,consumed:r,dataOffset:r,hasAudioTrack:n,hasVideoTrack:a}},A.prototype.bindDataSource=function(A){return A.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(A.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(A){this._onTrackMetadata=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(A){this._onMediaInfo=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(A){this._onMetaDataArrived=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(A){this._onScriptDataArrived=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onError",{get:function(){return this._onError},set:function(A){this._onError=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(A){this._onDataAvailable=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(A){this._timestampBase=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"overridedDuration",{get:function(){return this._duration},set:function(A){this._durationOverrided=!0,this._duration=A,this._mediaInfo&&(this._mediaInfo.duration=A)},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"overridedHasAudio",{set:function(A){this._hasAudioFlagOverrided=!0,this._hasAudio=A,this._mediaInfo&&(this._mediaInfo.hasAudio=A)},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"overridedHasVideo",{set:function(A){this._hasVideoFlagOverrided=!0,this._hasVideo=A,this._mediaInfo&&(this._mediaInfo.hasVideo=A)},enumerable:!1,configurable:!0}),A.prototype.resetMediaInfo=function(){this._mediaInfo=new r.A},A.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched},A.prototype.parseChunks=function(e,t){var i,a;if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new c.j4("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var r=0,o=this._littleEndian;if(0===t){if(!(e.byteLength>13))return 0;var s=A.probe(e);r=(null==s?void 0:s.dataOffset)||0}for(this._firstParse&&(this._firstParse=!1,t+r!==this._dataOffset&&n.A.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==(g=new DataView(e,r)).getUint32(0,!o)&&n.A.w(this.TAG,"PrevTagSize0 !== 0 !!!"),r+=4);re.byteLength)break;var l=g.getUint8(0),I=16777215&g.getUint32(0,!o);if(r+11+I+4>e.byteLength)break;if(8===l||9===l||18===l){var d=g.getUint8(4),C=g.getUint8(5),h=g.getUint8(6)|C<<8|d<<16|g.getUint8(7)<<24;16777215&g.getUint32(7,!o)&&n.A.w(this.TAG,"Meet tag which has StreamID != 0!");var u=r+11;switch(l){case 8:this._parseAudioData(e,u,I,h);break;case 9:this._parseVideoData(e,u,I,h,t+r);break;case 18:this._parseScriptData(e,u,I)}var B=g.getUint32(11+I,!o);B!==11+I&&n.A.w(this.TAG,"Invalid PrevTagSize ".concat(B)),r+=11+I+4}else n.A.w(this.TAG,"Unsupported tag type ".concat(l,", skipped")),r+=11+I+4}return this._isInitialMetadataDispatched()&&this._dispatch&&((null===(i=this._audioTrack)||void 0===i?void 0:i.length)||(null===(a=this._videoTrack)||void 0===a?void 0:a.length))&&this._onDataAvailable(this._audioTrack,this._videoTrack),r},A.prototype._parseScriptData=function(A,e,t){var i,a,r,o=I.parseScriptData(A,e,t);if(o.hasOwnProperty("onMetaData")){if(null==o.onMetaData||"object"!=typeof o.onMetaData)return void n.A.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&n.A.w(this.TAG,"Found another onMetaData tag!"),this._metadata=o;var s=null===(i=this._metadata)||void 0===i?void 0:i.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},s)),"boolean"==typeof(null==s?void 0:s.hasAudio)&&(this._hasAudioFlagOverrided||(this._hasAudio=s.hasAudio,this._mediaInfo&&(this._mediaInfo.hasAudio=this._hasAudio))),"boolean"==typeof(null==s?void 0:s.hasVideo)&&(this._hasVideoFlagOverrided||(this._hasVideo=s.hasVideo,this._mediaInfo&&(this._mediaInfo.hasVideo=this._hasVideo))),"number"==typeof(null==s?void 0:s.audiodatarate)&&this._mediaInfo&&(this._mediaInfo.audioDataRate=s.audiodatarate),"number"==typeof(null==s?void 0:s.videodatarate)&&this._mediaInfo&&(this._mediaInfo.videoDataRate=s.videodatarate),"number"==typeof(null==s?void 0:s.width)&&this._mediaInfo&&(this._mediaInfo.width=s.width),"number"==typeof(null==s?void 0:s.height)&&this._mediaInfo&&(this._mediaInfo.height=s.height),"number"==typeof(null==s?void 0:s.duration)){if(!this._durationOverrided){var g=Math.floor(s.duration*this._timescale);this._duration=g,this._mediaInfo&&(this._mediaInfo.duration=g)}}else this._mediaInfo&&(this._mediaInfo.duration=0);if("number"==typeof(null==s?void 0:s.framerate)){var c=Math.floor(1e3*s.framerate);if(c>0){var l=c/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=l,this._referenceFrameRate.fps_num=c,this._referenceFrameRate.fps_den=1e3,this._mediaInfo&&(this._mediaInfo.fps=l)}}if("object"==typeof(null==s?void 0:s.keyframes)){this._mediaInfo&&(this._mediaInfo.hasKeyframesIndex=!0);var d=s.keyframes;this._mediaInfo&&(this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(d)),s.keyframes=null}else this._mediaInfo&&(this._mediaInfo.hasKeyframesIndex=!1);this._dispatch=!1,this._mediaInfo&&(this._mediaInfo.metadata=s),n.A.v(this.TAG,"Parsed onMetaData"),(null===(a=this._mediaInfo)||void 0===a?void 0:a.isComplete())&&(null===(r=this._onMediaInfo)||void 0===r||r.call(this,this._mediaInfo))}Object.keys(o).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},o))},A.prototype._parseKeyframesIndex=function(A){for(var e=[],t=[],i=1;i>>4;if(2===B||10===B){var E=0,f=(12&u)>>>2;if(f>=0&&f<=4){E=this._flvSoundRateTable[f];var x=1&u,p=this._audioMetadata,m=this._audioTrack;if(p||(!1!==this._hasAudio||this._hasAudioFlagOverrided||(this._hasAudio=!0,this._mediaInfo&&(this._mediaInfo.hasAudio=!0)),(p=this._audioMetadata={}).type="audio",p.id=null==m?void 0:m.id,p.timescale=this._timescale,p.duration=this._duration,p.audioSampleRate=E,p.channelCount=0===x?1:2),10===B){var y=this._parseAACAudioData(A,e+1,t-1);if(void 0===y)return;if(0===(null==y?void 0:y.packetType)){if(null==p?void 0:p.config){if(Q(y.data.config,null==p?void 0:p.config))return;n.A.w(this.TAG,"AudioSpecificConfig has been changed, re-generate initialization segment")}var _=y.data;p.audioSampleRate=null==_?void 0:_.samplingRate,p.channelCount=null==_?void 0:_.channelCount,p.codec=null==_?void 0:_.codec,p.originalCodec=null==_?void 0:_.originalCodec,p.config=null==_?void 0:_.config,p.refSampleDuration=1024/p.audioSampleRate*p.timescale,n.A.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(o=this._audioTrack)||void 0===o?void 0:o.length)||(null===(s=this._videoTrack)||void 0===s?void 0:s.length))&&(null===(g=this._onDataAvailable)||void 0===g||g.call(this,this._audioTrack,this._videoTrack)):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,null===(c=this._onTrackMetadata)||void 0===c||c.call(this,"audio",p),(v=this._mediaInfo).audioCodec=p.originalCodec||"",v.audioSampleRate=p.audioSampleRate,v.audioChannelCount=p.channelCount,v.hasVideo?null!=v.videoCodec&&(v.mimeType='video/x-flv; codecs="'+v.videoCodec+","+v.audioCodec+'"'):v.mimeType='video/x-flv; codecs="'+v.audioCodec+'"',(null==v?void 0:v.isComplete())&&(null===(l=this._onMediaInfo)||void 0===l||l.call(this,v))}else if(1===y.packetType){var S=this._timestampBase+i,D={unit:y.data,length:y.data.byteLength,dts:S,pts:S};m&&(null==m||m.samples.push(D),m.length+=(null===(I=null==y?void 0:y.data)||void 0===I?void 0:I.length)||0)}else n.A.e(this.TAG,"Flv: Unsupported AAC data type ".concat(y.packetType))}else if(2===B){if(!p.codec){var v;if(void 0===(_=this._parseMP3AudioData(A,e+1,t-1,!0)))return;p.audioSampleRate=_.samplingRate,p.channelCount=_.channelCount,p.codec=_.codec,p.originalCodec=_.originalCodec,p.refSampleDuration=1152/p.audioSampleRate*p.timescale,n.A.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,null===(d=this._onTrackMetadata)||void 0===d||d.call(this,"audio",p),(v=this._mediaInfo).audioCodec=p.codec,v.audioSampleRate=p.audioSampleRate,v.audioChannelCount=p.channelCount,v.audioDataRate=_.bitRate,(null==v?void 0:v.hasVideo)?null!=v.videoCodec&&(v.mimeType='video/x-flv; codecs="'+v.videoCodec+","+v.audioCodec+'"'):v.mimeType='video/x-flv; codecs="'+v.audioCodec+'"',v.isComplete()&&(null===(C=this._onMediaInfo)||void 0===C||C.call(this,v))}var w=this._parseMP3AudioData(A,e+1,t-1,!1);if(void 0===w)return;S=this._timestampBase+i;var b={unit:w,length:w.byteLength,dts:S,pts:S};null==m||m.samples.push(b),m&&(m.length+=w.length)}}else null===(r=this._onError)||void 0===r||r.call(this,h.A.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+f)}else null===(a=this._onError)||void 0===a||a.call(this,h.A.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+B)}},A.prototype._parseAACAudioData=function(A,e,t){if(!(t<=1)){var i={},a=new Uint8Array(A,e,t);return i.packetType=a[0],0===a[0]?i.data=this._parseAACAudioSpecificConfig(A,e+1,t-1):i.data=a.subarray(1),i}n.A.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},A.prototype._parseAACAudioSpecificConfig=function(A,e,t){var i,n,a,r,o=new Uint8Array(A,e,t),s=null,g=0,c=null;if(g=a=o[0]>>>3,(r=(7&o[0])<<1|o[1]>>>7)<0||r>=this._mpegSamplingRates.length)null===(i=this._onError)||void 0===i||i.call(this,h.A.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var l=this._mpegSamplingRates[r],I=(120&o[1])>>>3;if(!(I<0||I>=8)){5===g&&(c=(7&o[1])<<1|o[2]>>>7,o[2]);var d=self.navigator.userAgent.toLowerCase();return d.includes("firefox")?r>=6?(g=5,s=new Array(4),c=r-3):(g=2,s=new Array(2),c=r):d.includes("android")?(g=2,s=new Array(2),c=r):(g=5,c=r,s=new Array(4),r>=6?c=r-3:1===I&&(g=2,s=new Array(2),c=r)),s[0]=g<<3,s[0]|=(15&r)>>>1,s[1]=(15&r)<<7,s[1]|=(15&I)<<3,5===g&&(s[1]|=(15&c)>>>1,s[2]=(1&c)<<7,s[2]|=8,s[3]=0),{config:s,samplingRate:l,channelCount:I,codec:"mp4a.40."+g,originalCodec:"mp4a.40."+a}}null===(n=this._onError)||void 0===n||n.call(this,h.A.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},A.prototype._parseMP3AudioData=function(A,e,t,i){if(!(t<4)){this._littleEndian;var a,r=new Uint8Array(A,e,t);if(i){if(255!==r[0])return;var o=r[1]>>>3&3,s=(6&r[1])>>1,g=(240&r[2])>>>4,c=(12&r[2])>>>2,l=3&~(r[3]>>>6)?2:1,I=0,d=0;switch(o){case 0:I=this._mpegAudioV25SampleRateTable[c];break;case 2:I=this._mpegAudioV20SampleRateTable[c];break;case 3:I=this._mpegAudioV10SampleRateTable[c]}switch(s){case 1:g>>4;if(128&s){var c=15&s,l=String.fromCharCode.apply(String,function(A,e,t){if(t||2===arguments.length)for(var i,n=0,a=e.length;n0)&&!(i=a.next()).done;)r.push(i.value)}catch(A){n={error:A}}finally{try{i&&!i.done&&(t=a.return)&&t.call(a)}finally{if(n)throw n.error}}return r}(new Uint8Array(A,e,t).slice(1,5)),!1));"hvc1"===l?this._parseEnhancedHEVCVideoPacket(A,e+5,t-5,i,a,g,c):"av01"===l?this._parseEnhancedAV1VideoPacket(A,e+5,t-5,i,a,g,c):null===(o=this._onError)||void 0===o||o.call(this,h.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(l))}else{var I=15&s;7===I?this._parseAVCVideoPacket(A,e+1,t-1,i,a,g):12===I?this._parseHEVCVideoPacket(A,e+1,t-1,i,a,g):null===(r=this._onError)||void 0===r||r.call(this,h.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(I))}}},A.prototype._parseAVCVideoPacket=function(A,e,t,i,a,r){var o;if(t<4)n.A.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var s=this._littleEndian,g=new DataView(A,e,t),c=g.getUint8(0),l=(16777215&g.getUint32(0,!s))<<8>>8;0===c?this._parseAVCDecoderConfigurationRecord(A,e+4,t-4):1===c?this._parseAVCVideoData(A,e+4,t-4,i,a,r,l):2===c||null===(o=this._onError)||void 0===o||o.call(this,h.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(c))}},A.prototype._parseHEVCVideoPacket=function(A,e,t,i,a,r){var o;if(t<4)n.A.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");else{var s=this._littleEndian,g=new DataView(A,e,t),c=g.getUint8(0),l=(16777215&g.getUint32(0,!s))<<8>>8;0===c?this._parseHEVCDecoderConfigurationRecord(A,e+4,t-4):1===c?this._parseHEVCVideoData(A,e+4,t-4,i,a,r,l):2===c||null===(o=this._onError)||void 0===o||o.call(this,h.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(c))}},A.prototype._parseEnhancedHEVCVideoPacket=function(A,e,t,i,n,a,r){var o,s=this._littleEndian,g=new DataView(A,e,t);if(0===r)this._parseHEVCDecoderConfigurationRecord(A,e,t);else if(1===r){var c=(4294967040&g.getUint32(0,!s))>>8;this._parseHEVCVideoData(A,e+3,t-3,i,n,a,c)}else 3===r?this._parseHEVCVideoData(A,e,t,i,n,a,0):2===r||null===(o=this._onError)||void 0===o||o.call(this,h.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(r))},A.prototype._parseEnhancedAV1VideoPacket=function(A,e,t,i,n,a,r){var o,s;this._littleEndian,0===r?this._parseAV1CodecConfigurationRecord(A,e,t):1===r?this._parseAV1VideoData(A,e,t,i,n,a,0):5===r?null===(o=this._onError)||void 0===o||o.call(this,h.A.FORMAT_ERROR,"Flv: Not Suported MP2T AV1 video packet type ".concat(r)):2===r||null===(s=this._onError)||void 0===s||s.call(this,h.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(r))},A.prototype._parseAVCDecoderConfigurationRecord=function(A,e,t){var i,a,r,o,s,g,c,l,I,d,u;if(t<7)n.A.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var B=this._videoMetadata,E=this._videoTrack,f=this._littleEndian,x=new DataView(A,e,t);if(B){if(void 0!==B.avcc){var p=new Uint8Array(A,e,t);if(Q(p,B.avcc))return;n.A.w(this.TAG,"AVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else!1!==this._hasVideo||this._hasVideoFlagOverrided||(this._hasVideo=!0,this._mediaInfo&&(this._mediaInfo.hasVideo=!0)),(B=this._videoMetadata={}).type="video",B.id=null==E?void 0:E.id,B.timescale=this._timescale,B.duration=this._duration;var m=x.getUint8(0),y=x.getUint8(1);if(x.getUint8(2),x.getUint8(3),1===m&&0!==y)if(this._naluLengthSize=1+(3&x.getUint8(4)),3===this._naluLengthSize||4===this._naluLengthSize){var _=31&x.getUint8(5);if(0!==_){_>1&&n.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(_));for(var S=6,D=0;D<_;D++){var v=x.getUint16(S,!f);if(S+=2,0!==v){var w=new Uint8Array(A,e+S,v);S+=v;var b=C.parseSPS(w);if(0===D){B.codecWidth=b.codec_size.width,B.codecHeight=b.codec_size.height,B.presentWidth=b.present_size.width,B.presentHeight=b.present_size.height,B.profile=b.profile_string,B.level=b.level_string,B.bitDepth=b.bit_depth,B.chromaFormat=b.chroma_format,B.sarRatio=b.sar_ratio,B.frameRate=b.frame_rate,b.frame_rate.fixed&&0!==b.frame_rate.fps_num&&0!==b.frame_rate.fps_den||(B.frameRate=this._referenceFrameRate);var F=null===(o=B.frameRate)||void 0===o?void 0:o.fps_den,R=null===(s=B.frameRate)||void 0===s?void 0:s.fps_num;B.refSampleDuration=B.timescale*(F/R);for(var k=w.subarray(1,4),P="avc1.",N=0;N<3;N++){var T=k[N].toString(16);T.length<2&&(T="0"+T),P+=T}B.codec=P;var M=this._mediaInfo;M.width=B.codecWidth,M.height=B.codecHeight,M.fps=B.frameRate.fps,M.profile=B.profile,M.level=B.level,M.refFrames=b.ref_frames,M.chromaFormat=b.chroma_format_string,M.sarNum=B.sarRatio.width,M.sarDen=B.sarRatio.height,M.videoCodec=P,M.hasAudio?null!=M.audioCodec&&(M.mimeType='video/x-flv; codecs="'+M.videoCodec+","+M.audioCodec+'"'):M.mimeType='video/x-flv; codecs="'+M.videoCodec+'"',M.isComplete()&&(null===(g=this._onMediaInfo)||void 0===g||g.call(this,M))}}}var L=x.getUint8(S);if(0!==L){for(L>1&&n.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(L)),S++,D=0;D=t){n.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(C,", offset = ").concat(I,", dataSize = ").concat(t));break}var u=g.getUint32(I,!s);if(3===d&&(u>>>=8),u>t-d)return void n.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(C,", NaluSize > DataSize!"));var B=31&g.getUint8(I+d);5===B&&(h=!0);var E=new Uint8Array(A,e+I,d+u),f={type:B,data:E};c.push(f),l+=E.byteLength,I+=d+u}if(c.length){var Q=this._videoTrack,x={units:c,length:l,isKeyframe:h,dts:C,cts:o,pts:C+o};h&&(x.fileposition=a),Q&&(Q.samples.push(x),Q.length+=l)}},A.prototype._parseHEVCVideoData=function(A,e,t,i,a,r,o){for(var s=this._littleEndian,g=new DataView(A,e,t),c=[],l=0,I=0,d=this._naluLengthSize,C=this._timestampBase+i,h=1===r;I=t){n.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(C,", offset = ").concat(I,", dataSize = ").concat(t));break}var u=g.getUint32(I,!s);if(3===d&&(u>>>=8),u>t-d)return void n.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(C,", NaluSize > DataSize!"));var B=31&g.getUint8(I+d);19!==B&&20!==B||(h=!0);var E=new Uint8Array(A,e+I,d+u),f={type:B,data:E};c.push(f),l+=E.byteLength,I+=d+u}if(c.length){var Q=this._videoTrack,x={units:c,length:l,isKeyframe:h,dts:C,cts:o,pts:C+o};h&&(x.fileposition=a),Q&&(null==Q||Q.samples.push(x),Q.length+=l)}},A.prototype._parseAV1VideoData=function(A,e,t,i,n,a,r){this._littleEndian;var o,s=[],g=this._timestampBase+i,c=1===a;if(o=t,s.push({unitType:0,data:new Uint8Array(A,e+0,t)}),s.length){var l=this._videoTrack,I={units:s,length:o,isKeyframe:c,dts:g,cts:r,pts:g+r};c&&(I.fileposition=n),l&&(null==l||l.samples.push(I),l.length+=o)}},A}();const m=p,y=function(){function A(){}return A.prototype.destroy=function(){this.onError=null,this.onMediaInfo=null,this.onMetaDataArrived=null,this.onTrackMetadata=null,this.onDataAvailable=null,this.onTimedID3Metadata=null,this.onSMPTE2038Metadata=null,this.onSCTE35Metadata=null,this.onPESPrivateData=null,this.onPESPrivateDataDescriptor=null},A}();var _,S=function(){this.program_pmt_pid={}};!function(A){A[A.kMPEG1Audio=3]="kMPEG1Audio",A[A.kMPEG2Audio=4]="kMPEG2Audio",A[A.kPESPrivateData=6]="kPESPrivateData",A[A.kADTSAAC=15]="kADTSAAC",A[A.kLOASAAC=17]="kLOASAAC",A[A.kAC3=129]="kAC3",A[A.kEAC3=135]="kEAC3",A[A.kID3=21]="kID3",A[A.kSCTE35=134]="kSCTE35",A[A.kH264=27]="kH264",A[A.kH265=36]="kH265"}(_||(_={}));var D,v=function(){this.pid_stream_type={},this.common_pids={h264:void 0,h265:void 0,adts_aac:void 0,loas_aac:void 0,opus:void 0,ac3:void 0,eac3:void 0,mp3:void 0},this.pes_private_data_pids={},this.timed_id3_pids={},this.scte_35_pids={},this.smpte2038_pids={}},w=function(){},b=function(){},F=function(){this.slices=[],this.total_length=0,this.expected_length=0,this.file_position=0,this.random_access_indicator=0};!function(A){A[A.kUnspecified=0]="kUnspecified",A[A.kSliceNonIDR=1]="kSliceNonIDR",A[A.kSliceDPA=2]="kSliceDPA",A[A.kSliceDPB=3]="kSliceDPB",A[A.kSliceDPC=4]="kSliceDPC",A[A.kSliceIDR=5]="kSliceIDR",A[A.kSliceSEI=6]="kSliceSEI",A[A.kSliceSPS=7]="kSliceSPS",A[A.kSlicePPS=8]="kSlicePPS",A[A.kSliceAUD=9]="kSliceAUD",A[A.kEndOfSequence=10]="kEndOfSequence",A[A.kEndOfStream=11]="kEndOfStream",A[A.kFiller=12]="kFiller",A[A.kSPSExt=13]="kSPSExt",A[A.kReserved0=14]="kReserved0"}(D||(D={}));var R,k,P=function(){},N=function(A){var e=A.data.byteLength;this.type=A.type,this.data=new Uint8Array(4+e),new DataView(this.data.buffer).setUint32(0,e),this.data.set(A.data,4)},T=function(){function A(A){this.TAG="H264AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=A,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not find H264 startcode until payload end!")}return A.prototype.findNextStartCodeOffset=function(A){for(var e=A,t=this.data_;;){if(e+3>=t.byteLength)return this.eof_flag_=!0,t.byteLength;var i=t[e+0]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3],n=t[e+0]<<16|t[e+1]<<8|t[e+2];if(1===i||1===n)return e;e++}},A.prototype.readNextNaluPayload=function(){for(var A=this.data_,e=null;null==e&&!this.eof_flag_;){var t=this.current_startcode_offset_,i=31&A[t+=1==(A[t]<<24|A[t+1]<<16|A[t+2]<<8|A[t+3])?4:3],n=(128&A[t])>>>7,a=this.findNextStartCodeOffset(t);if(this.current_startcode_offset_=a,!(i>=D.kReserved0)&&0===n){var r=A.subarray(t,a);(e=new P).type=i,e.data=r}}return e},A}(),M=function(){function A(A,e,t){var i=8+A.byteLength+1+2+e.byteLength,n=!1;66!==A[3]&&77!==A[3]&&88!==A[3]&&(n=!0,i+=4);var a=this.data=new Uint8Array(i);a[0]=1,a[1]=A[1],a[2]=A[2],a[3]=A[3],a[4]=255,a[5]=225;var r=A.byteLength;a[6]=r>>>8,a[7]=255&r;var o=8;a.set(A,8),a[o+=r]=1;var s=e.byteLength;a[o+1]=s>>>8,a[o+2]=255&s,a.set(e,o+3),o+=3+s,n&&(a[o]=252|t.chroma_format_idc,a[o+1]=248|t.bit_depth_luma-8,a[o+2]=248|t.bit_depth_chroma-8,a[o+3]=0,o+=4)}return A.prototype.getData=function(){return this.data},A}();!function(A){A[A.kNull=0]="kNull",A[A.kAACMain=1]="kAACMain",A[A.kAAC_LC=2]="kAAC_LC",A[A.kAAC_SSR=3]="kAAC_SSR",A[A.kAAC_LTP=4]="kAAC_LTP",A[A.kAAC_SBR=5]="kAAC_SBR",A[A.kAAC_Scalable=6]="kAAC_Scalable",A[A.kLayer1=32]="kLayer1",A[A.kLayer2=33]="kLayer2",A[A.kLayer3=34]="kLayer3"}(R||(R={})),function(A){A[A.k96000Hz=0]="k96000Hz",A[A.k88200Hz=1]="k88200Hz",A[A.k64000Hz=2]="k64000Hz",A[A.k48000Hz=3]="k48000Hz",A[A.k44100Hz=4]="k44100Hz",A[A.k32000Hz=5]="k32000Hz",A[A.k24000Hz=6]="k24000Hz",A[A.k22050Hz=7]="k22050Hz",A[A.k16000Hz=8]="k16000Hz",A[A.k12000Hz=9]="k12000Hz",A[A.k11025Hz=10]="k11025Hz",A[A.k8000Hz=11]="k8000Hz",A[A.k7350Hz=12]="k7350Hz"}(k||(k={}));var L,Y,G=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],U=(L=function(A,e){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])},L(A,e)},function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=A}L(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}),J=function(){},H=function(A){function e(){return null!==A&&A.apply(this,arguments)||this}return U(e,A),e}(J),K=function(){function A(A){this.TAG="AACADTSParser",this.data_=A,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not found ADTS syncword until payload end")}return A.prototype.findNextSyncwordOffset=function(A){for(var e=A,t=this.data_;;){if(e+7>=t.byteLength)return this.eof_flag_=!0,t.byteLength;if(4095==(t[e+0]<<8|t[e+1])>>>4)return e;e++}},A.prototype.readNextAACFrame=function(){for(var A=this.data_,e=null;null==e&&!this.eof_flag_;){var t=this.current_syncword_offset_,i=(8&A[t+1])>>>3,n=(6&A[t+1])>>>1,a=1&A[t+1],r=(192&A[t+2])>>>6,o=(60&A[t+2])>>>2,s=(1&A[t+2])<<2|(192&A[t+3])>>>6,g=(3&A[t+3])<<11|A[t+4]<<3|(224&A[t+5])>>>5;if(A[t+6],t+g>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var c=1===a?7:9,l=g-c;t+=c;var I=this.findNextSyncwordOffset(t+l);if(this.current_syncword_offset_=I,(0===i||1===i)&&0===n){var d=A.subarray(t,t+l);(e=new J).audio_object_type=r+1,e.sampling_freq_index=o,e.sampling_frequency=G[o],e.channel_config=s,e.data=d}}return e},A.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},A.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},A}(),V=function(){function A(A){this.TAG="AACLOASParser",this.data_=A,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not found LOAS syncword until payload end")}return A.prototype.findNextSyncwordOffset=function(A){for(var e=A,t=this.data_;;){if(e+1>=t.byteLength)return this.eof_flag_=!0,t.byteLength;if(695==(t[e+0]<<3|t[e+1]>>>5))return e;e++}},A.prototype.getLATMValue=function(A){for(var e=A.readBits(2),t=0,i=0;i<=e;i++)t<<=8,t|=A.readByte();return t},A.prototype.readNextAACFrame=function(A){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_syncword_offset_,a=(31&e[i+1])<<8|e[i+2];if(i+3+a>=this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var r=new d(e.subarray(i+3,i+3+a)),o=null;if(r.readBool()){if(null==A){n.A.w(this.TAG,"StreamMuxConfig Missing"),this.current_syncword_offset_=this.findNextSyncwordOffset(i+3+a),r.destroy();continue}o=A}else{var s=r.readBool();if(s&&r.readBool()){n.A.e(this.TAG,"audioMuxVersionA is Not Supported"),r.destroy();break}if(s&&this.getLATMValue(r),!r.readBool()){n.A.e(this.TAG,"allStreamsSameTimeFraming zero is Not Supported"),r.destroy();break}if(0!==r.readBits(6)){n.A.e(this.TAG,"more than 2 numSubFrames Not Supported"),r.destroy();break}if(0!==r.readBits(4)){n.A.e(this.TAG,"more than 2 numProgram Not Supported"),r.destroy();break}if(0!==r.readBits(3)){n.A.e(this.TAG,"more than 2 numLayer Not Supported"),r.destroy();break}var g=s?this.getLATMValue(r):0,c=r.readBits(5);g-=5;var l=r.readBits(4);g-=4;var I=r.readBits(4);g-=4,r.readBits(3),(g-=3)>0&&r.readBits(g);var C=r.readBits(3);if(0!==C){n.A.e(this.TAG,"frameLengthType = ".concat(C,". Only frameLengthType = 0 Supported")),r.destroy();break}r.readByte();var h=r.readBool();if(h)if(s)this.getLATMValue(r);else{for(var u=0;;){u<<=8;var B=r.readBool();if(u+=r.readByte(),!B)break}console.log(u)}r.readBool()&&r.readByte(),(o=new H).audio_object_type=c,o.sampling_freq_index=l,o.sampling_frequency=G[o.sampling_freq_index],o.channel_config=I,o.other_data_present=h}for(var E=0;;){var f=r.readByte();if(E+=f,255!==f)break}for(var Q=new Uint8Array(E),x=0;x=6?(i=5,e=new Array(4),r=n-3):(i=2,e=new Array(2),r=n):o.includes("android")?(i=2,e=new Array(2),r=n):(i=5,r=n,e=new Array(4),n>=6?r=n-3:1===a&&(i=2,e=new Array(2),r=n)),e[0]=i<<3,e[0]|=(15&n)>>>1,e[1]=(15&n)<<7,e[1]|=(15&a)<<3,5===i&&(e[1]|=(15&r)>>>1,e[2]=(1&r)<<7,e[2]|=8,e[3]=0),this.config=e,this.sampling_rate=G[n],this.channel_count=a,this.codec_mimetype="mp4a.40."+i.toString(),this.original_codec_mimetype="mp4a.40."+t.toString()},j=function(){},W=function(){};!function(A){A[A.kSpliceNull=0]="kSpliceNull",A[A.kSpliceSchedule=4]="kSpliceSchedule",A[A.kSpliceInsert=5]="kSpliceInsert",A[A.kTimeSignal=6]="kTimeSignal",A[A.kBandwidthReservation=7]="kBandwidthReservation",A[A.kPrivateCommand=255]="kPrivateCommand"}(Y||(Y={}));var Z,X=function(A){var e=A.readBool();return e?(A.readBits(6),{time_specified_flag:e,pts_time:4*A.readBits(31)+A.readBits(2)}):(A.readBits(7),{time_specified_flag:e})},q=function(A){var e=A.readBool();return A.readBits(6),{auto_return:e,duration:4*A.readBits(31)+A.readBits(2)}},z=function(A,e){var t=e.readBits(8);return A?{component_tag:t}:{component_tag:t,splice_time:X(e)}},$=function(A){return{component_tag:A.readBits(8),utc_splice_time:A.readBits(32)}},AA=function(A){var e=A.readBits(32),t=A.readBool();A.readBits(7);var i={splice_event_id:e,splice_event_cancel_indicator:t};if(t)return i;if(i.out_of_network_indicator=A.readBool(),i.program_splice_flag=A.readBool(),i.duration_flag=A.readBool(),A.readBits(5),i.program_splice_flag)i.utc_splice_time=A.readBits(32);else{i.component_count=A.readBits(8),i.components=[];for(var n=0;n=t.byteLength)return this.eof_flag_=!0,t.byteLength;var i=t[e+0]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3],n=t[e+0]<<16|t[e+1]<<8|t[e+2];if(1===i||1===n)return e;e++}},A.prototype.readNextNaluPayload=function(){for(var A=this.data_,e=null;null==e&&!this.eof_flag_;){var t=this.current_startcode_offset_,i=A[t+=1==(A[t]<<24|A[t+1]<<16|A[t+2]<<8|A[t+3])?4:3]>>1&63,n=(128&A[t])>>>7,a=this.findNextStartCodeOffset(t);if(this.current_startcode_offset_=a,0===n){var r=A.subarray(t,a);(e=new sA).type=i,e.data=r}}return e},A}(),lA=function(){function A(A,e,t,i){var n=23+(5+A.byteLength)+(5+e.byteLength)+(5+t.byteLength),a=this.data=new Uint8Array(n);a[0]=1,a[1]=(3&i.general_profile_space)<<6|(i.general_tier_flag?1:0)<<5|31&i.general_profile_idc,a[2]=i.general_profile_compatibility_flags_1,a[3]=i.general_profile_compatibility_flags_2,a[4]=i.general_profile_compatibility_flags_3,a[5]=i.general_profile_compatibility_flags_4,a[6]=i.general_constraint_indicator_flags_1,a[7]=i.general_constraint_indicator_flags_2,a[8]=i.general_constraint_indicator_flags_3,a[9]=i.general_constraint_indicator_flags_4,a[10]=i.general_constraint_indicator_flags_5,a[11]=i.general_constraint_indicator_flags_6,a[12]=i.general_level_idc,a[13]=240|(3840&i.min_spatial_segmentation_idc)>>8,a[14]=255&i.min_spatial_segmentation_idc,a[15]=252|3&i.parallelismType,a[16]=252|3&i.chroma_format_idc,a[17]=248|7&i.bit_depth_luma_minus8,a[18]=248|7&i.bit_depth_chroma_minus8,a[19]=0,a[20]=0,a[21]=(3&i.constant_frame_rate)<<6|(7&i.num_temporal_layers)<<3|(i.temporal_id_nested?1:0)<<2|3,a[22]=3,a[23]=128|Z.kSliceVPS,a[24]=0,a[25]=1,a[26]=(65280&A.byteLength)>>8,a[27]=255&A.byteLength,a.set(A,28),a[23+(5+A.byteLength)+0]=128|Z.kSliceSPS,a[23+(5+A.byteLength)+1]=0,a[23+(5+A.byteLength)+2]=1,a[23+(5+A.byteLength)+3]=(65280&e.byteLength)>>8,a[23+(5+A.byteLength)+4]=255&e.byteLength,a.set(e,23+(5+A.byteLength)+5),a[23+(5+A.byteLength+5+e.byteLength)+0]=128|Z.kSlicePPS,a[23+(5+A.byteLength+5+e.byteLength)+1]=0,a[23+(5+A.byteLength+5+e.byteLength)+2]=1,a[23+(5+A.byteLength+5+e.byteLength)+3]=(65280&t.byteLength)>>8,a[23+(5+A.byteLength+5+e.byteLength)+4]=255&t.byteLength,a.set(t,23+(5+A.byteLength+5+e.byteLength)+5)}return A.prototype.getData=function(){return this.data},A}(),IA=function(){},dA=function(){},CA=function(){},hA=[[64,64,80,80,96,96,112,112,128,128,160,160,192,192,224,224,256,256,320,320,384,384,448,448,512,512,640,640,768,768,896,896,1024,1024,1152,1152,1280,1280],[69,70,87,88,104,105,121,122,139,140,174,175,208,209,243,244,278,279,348,349,417,418,487,488,557,558,696,697,835,836,975,976,1114,1115,1253,1254,1393,1394],[96,96,120,120,144,144,168,168,192,192,240,240,288,288,336,336,384,384,480,480,576,576,672,672,768,768,960,960,1152,1152,1344,1344,1536,1536,1728,1728,1920,1920]],uA=function(){function A(A){this.TAG="AC3Parser",this.data_=A,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not found AC3 syncword until payload end")}return A.prototype.findNextSyncwordOffset=function(A){for(var e=A,t=this.data_;;){if(e+7>=t.byteLength)return this.eof_flag_=!0,t.byteLength;if(2935==(t[e+0]<<8|t[e+1]))return e;e++}},A.prototype.readNextAC3Frame=function(){for(var A=this.data_,e=null;null==e&&!this.eof_flag_;){var t=this.current_syncword_offset_,i=A[t+4]>>6,n=[48e3,44200,33e3][i],a=63&A[t+4],r=2*hA[i][a];if(t+r>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var o=this.findNextSyncwordOffset(t+r);this.current_syncword_offset_=o;var s=A[t+5]>>3,g=7&A[t+5],c=A[t+6]>>5,l=0;1&c&&1!==c&&(l+=2),4&c&&(l+=2),2===c&&(l+=2);var I=(A[t+6]<<8|A[t+7])>>12-l&1,d=[2,1,2,3,3,4,4,5][c]+I;(e=new CA).sampling_frequency=n,e.channel_count=d,e.channel_mode=c,e.bit_stream_identification=s,e.low_frequency_effects_channel_on=I,e.bit_stream_mode=g,e.frame_size_code=a,e.data=A.subarray(t,t+r)}return e},A.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},A.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},A}(),BA=function(A){var e;e=[A.sampling_rate_code<<6|A.bit_stream_identification<<1|A.bit_stream_mode>>2,(3&A.bit_stream_mode)<<6|A.channel_mode<<3|A.low_frequency_effects_channel_on<<2|A.frame_size_code>>4,A.frame_size_code<<4&224],this.config=e,this.sampling_rate=A.sampling_frequency,this.bit_stream_identification=A.bit_stream_identification,this.bit_stream_mode=A.bit_stream_mode,this.low_frequency_effects_channel_on=A.low_frequency_effects_channel_on,this.channel_count=A.channel_count,this.channel_mode=A.channel_mode,this.codec_mimetype="ac-3",this.original_codec_mimetype="ac-3"},EA=function(){},fA=function(){function A(A){this.TAG="EAC3Parser",this.data_=A,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&n.A.e(this.TAG,"Could not found AC3 syncword until payload end")}return A.prototype.findNextSyncwordOffset=function(A){for(var e=A,t=this.data_;;){if(e+7>=t.byteLength)return this.eof_flag_=!0,t.byteLength;if(2935==(t[e+0]<<8|t[e+1]))return e;e++}},A.prototype.readNextEAC3Frame=function(){for(var A=this.data_,e=null;null==e&&!this.eof_flag_;){var t=this.current_syncword_offset_,i=new d(A.subarray(t+2)),n=(i.readBits(2),i.readBits(3),i.readBits(11)+1<<1),a=i.readBits(2),r=null,o=null;3===a?(r=[24e3,22060,16e3][a=i.readBits(2)],o=3):(r=[48e3,44100,32e3][a],o=i.readBits(2));var s=i.readBits(3),g=i.readBits(1),c=i.readBits(5);if(t+n>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var l=this.findNextSyncwordOffset(t+n);this.current_syncword_offset_=l;var I=[2,1,2,3,3,4,4,5][s]+g;i.destroy(),(e=new EA).sampling_frequency=r,e.channel_count=I,e.channel_mode=s,e.bit_stream_identification=c,e.low_frequency_effects_channel_on=g,e.frame_size=n,e.num_blks=[1,2,3,6][o],e.data=A.subarray(t,t+n)}return e},A.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},A.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},A}(),QA=function(A){var e,t=Math.floor(A.frame_size*A.sampling_frequency/(16*A.num_blks));e=[255&t,248&t,A.sampling_rate_code<<6|A.bit_stream_identification<<1,A.channel_mode<<1|A.low_frequency_effects_channel_on,0],this.config=e,this.sampling_rate=A.sampling_frequency,this.bit_stream_identification=A.bit_stream_identification,this.num_blks=A.num_blks,this.low_frequency_effects_channel_on=A.low_frequency_effects_channel_on,this.channel_count=A.channel_count,this.channel_mode=A.channel_mode,this.codec_mimetype="ec-3",this.original_codec_mimetype="ec-3"},xA=function(){var A=function(e,t){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])},A(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}A(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}}(),pA=function(){return pA=Object.assign||function(A){for(var e,t=1,i=arguments.length;t0)&&!(i=a.next()).done;)r.push(i.value)}catch(A){n={error:A}}finally{try{i&&!i.done&&(t=a.return)&&t.call(a)}finally{if(n)throw n.error}}return r},yA=function(A,e,t){if(t||2===arguments.length)for(var i,n=0,a=e.length;n=4?(n.A.v("TSDemuxer","ts_packet_size = 192, m2ts mode"),t-=4):204===i&&n.A.v("TSDemuxer","ts_packet_size = 204, RS encoded MPEG2-TS stream"),{match:!0,consumed:0,ts_packet_size:i,sync_offset:t})},e.prototype.bindDataSource=function(A){return A.onDataArrival=this.parseChunks.bind(this),this},e.prototype.resetMediaInfo=function(){this.media_info_=new r.A},e.prototype.parseChunks=function(A,e){var t;if(!(this.onError&&this.onMediaInfo&&this.onTrackMetadata&&this.onDataAvailable))throw new c.j4("onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var i=0;for(this.first_parse_&&(this.first_parse_=!1,i=this.sync_offset_);i+this.ts_packet_size_<=A.byteLength;){var a=e+i;192===this.ts_packet_size_&&(i+=4);var r=new Uint8Array(A,i,188),o=r[0];if(71!==o){n.A.e(this.TAG,"sync_byte = ".concat(o,", not 0x47"));break}var s=(64&r[1])>>>6,g=(r[1],(31&r[1])<<8|r[2]),l=(48&r[3])>>>4,I=15&r[3],d={},C=4;if(2===l||3===l){var h=r[4];if(5+h===188){i+=188,204===this.ts_packet_size_&&(i+=16);continue}h>0&&(d=this.parseAdaptationField(A,i+4,1+h)),C=5+h}if(1===l||3===l)if(0===g||g===this.current_pmt_pid_||void 0!==this.pmt_&&this.pmt_.pid_stream_type[g]===_.kSCTE35){var u=188-C;this.handleSectionSlice(A,i+C,u,{pid:g,file_position:a,payload_unit_start_indicator:s,continuity_conunter:I,random_access_indicator:d.random_access_indicator})}else if(void 0!==(null===(t=this.pmt_)||void 0===t?void 0:t.pid_stream_type[g])){u=188-C;var B=this.pmt_.pid_stream_type[g];(g===this.pmt_.common_pids.h264||g===this.pmt_.common_pids.h265||g===this.pmt_.common_pids.adts_aac||g===this.pmt_.common_pids.loas_aac||g===this.pmt_.common_pids.ac3||g===this.pmt_.common_pids.eac3||g===this.pmt_.common_pids.opus||g===this.pmt_.common_pids.mp3||this.pmt_.pes_private_data_pids[g]||this.pmt_.timed_id3_pids[g])&&this.handlePESSlice(A,i+C,u,{pid:g,stream_type:B,file_position:a,payload_unit_start_indicator:s,continuity_conunter:I,random_access_indicator:d.random_access_indicator})}i+=188,204===this.ts_packet_size_&&(i+=16)}return this.dispatchAudioVideoMediaSegment(),i},e.prototype.parseAdaptationField=function(A,e,t){var i=new Uint8Array(A,e,t),a=i[0];return a>0?a>183?(n.A.w(this.TAG,"Illegal adaptation_field_length: ".concat(a)),{}):{discontinuity_indicator:(128&i[1])>>>7,random_access_indicator:(64&i[1])>>>6,elementary_stream_priority_indicator:(32&i[1])>>>5}:{}},e.prototype.handleSectionSlice=function(A,e,t,i){var n=new Uint8Array(A,e,t),a=this.section_slice_queues_?this.section_slice_queues_[i.pid]:{};if(i.payload_unit_start_indicator){var r=n[0];if(void 0!==a&&0!==(null==a?void 0:a.total_length)){var o=new Uint8Array(A,e+1,Math.min(t,r));a.slices.push(o),a.total_length+=o.byteLength,a.total_length===a.expected_length?this.emitSectionSlices(a,i):this.clearSlices(a,i)}for(var s=1+r;s=a.expected_length&&this.clearSlices(a,i),s+=o.byteLength}}else void 0!==a&&0!==a.total_length&&(o=new Uint8Array(A,e,Math.min(t,a.expected_length-a.total_length)),a.slices.push(o),a.total_length+=o.byteLength,a.total_length===a.expected_length?this.emitSectionSlices(a,i):a.total_length>=a.expected_length&&this.clearSlices(a,i))},e.prototype.handlePESSlice=function(A,e,t,i){var a=new Uint8Array(A,e,t),r=a[0]<<16|a[1]<<8|a[2],o=(a[3],a[4]<<8|a[5]);if(i.payload_unit_start_indicator){if(1!==r)return void n.A.e(this.TAG,"handlePESSlice: packet_start_code_prefix should be 1 but with value ".concat(r));var s=this.pes_slice_queues_[i.pid];s&&(0===s.expected_length||s.expected_length===s.total_length?this.emitPESSlices(s,i):this.clearSlices(s,i)),this.pes_slice_queues_&&(this.pes_slice_queues_[i.pid]=new F,this.pes_slice_queues_[i.pid].file_position=i.file_position,this.pes_slice_queues_[i.pid].random_access_indicator=i.random_access_indicator)}if(void 0!==this.pes_slice_queues_[i.pid]){var g=this.pes_slice_queues_[i.pid];g.slices.push(a),i.payload_unit_start_indicator&&(g.expected_length=0===o?0:o+6),g.total_length+=a.byteLength,g.expected_length>0&&g.expected_length===g.total_length?this.emitPESSlices(g,i):g.expected_length>0&&g.expected_length>>6,o=e[8],s=void 0,g=void 0;2!==r&&3!==r||(s=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,g=3===r?536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2:s);var c=9+o,l=void 0;if(0!==a){if(a<3+o)return void n.A.v(this.TAG,"Malformed PES: PES_packet_length < 3 + PES_header_data_length");l=a-3-o}else l=e.byteLength-c;var I=e.subarray(c,c+l);switch(A.stream_type){case _.kMPEG1Audio:case _.kMPEG2Audio:this.parseMP3Payload(I,s);break;case _.kPESPrivateData:this.pmt_.common_pids.opus===A.pid?this.parseOpusPayload(I,s):this.pmt_.common_pids.ac3===A.pid?this.parseAC3Payload(I,s):this.pmt_.common_pids.eac3===A.pid?this.parseEAC3Payload(I,s):this.pmt_.smpte2038_pids[A.pid]?this.parseSMPTE2038MetadataPayload(I,s,g,A.pid,i):this.parsePESPrivateDataPayload(I,s,g,A.pid,i);break;case _.kADTSAAC:this.parseADTSAACPayload(I,s);break;case _.kLOASAAC:this.parseLOASAACPayload(I,s);break;case _.kAC3:this.parseAC3Payload(I,s);break;case _.kEAC3:this.parseEAC3Payload(I,s);break;case _.kID3:this.parseTimedID3MetadataPayload(I,s,g,A.pid,i);break;case _.kH264:this.parseH264Payload(I,s,g,A.file_position,A.random_access_indicator);break;case _.kH265:this.parseH265Payload(I,s,g,A.file_position,A.random_access_indicator)}}else 188!==i&&191!==i&&240!==i&&241!==i&&255!==i&&242!==i&&248!==i||A.stream_type!==_.kPESPrivateData||(c=6,l=void 0,l=0!==a?a:e.byteLength-c,I=e.subarray(c,c+l),this.parsePESPrivateDataPayload(I,void 0,void 0,A.pid,i));else n.A.e(this.TAG,"parsePES: packet_start_code_prefix should be 1 but with value ".concat(t))},e.prototype.parsePAT=function(A){var e=A[0];if(0===e){var t=(15&A[1])<<8|A[2],i=(A[3],A[4],(62&A[5])>>>1),a=1&A[5],r=A[6],o=(A[7],null);if(1===a&&0===r)(o=new S).version_number=i;else if(null==(o=this.pat_))return;for(var s=t-5-4,g=-1,c=-1,l=8;l<8+s;l+=4){var I=A[l]<<8|A[l+1],d=(31&A[l+2])<<8|A[l+3];0===I?o.network_pid=d:(o.program_pmt_pid[I]=d,-1===g&&(g=I),-1===c&&(c=d))}1===a&&0===r&&(void 0===this.pat_&&n.A.v(this.TAG,"Parsed first PAT: ".concat(JSON.stringify(o))),this.pat_=o,this.current_program_=g,this.current_pmt_pid_=c)}else n.A.e(this.TAG,"parsePAT: table_id ".concat(e," is not corresponded to PAT!"))},e.prototype.parsePMT=function(A){var e=A[0];if(2===e){var t=(15&A[1])<<8|A[2],i=A[3]<<8|A[4],a=(62&A[5])>>>1,r=1&A[5],o=A[6],s=(A[7],null);if(1===r&&0===o)(s=new v).program_number=i,s.version_number=a,this.program_pmt_map_[i]=s;else if(null==(s=this.program_pmt_map_[i]))return;A[8],A[9];for(var g=(15&A[10])<<8|A[11],c=12+g,l=t-9-g-4,I=c;I0){for(var E=I+5;E1&&(n.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(g,"ms, PES pts: ").concat(s,"ms")),s=g)}}for(var c=new K(A),l=null,I=s,d=0;null!=(l=c.readNextAACFrame());){o=1024/l.sampling_frequency*1e3;var C={codec:"aac",data:l};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(C)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(C)):(this.audio_metadata_={codec:"aac",audio_object_type:l.audio_object_type,sampling_freq_index:l.sampling_freq_index,sampling_frequency:l.sampling_frequency,channel_config:l.channel_config},this.dispatchAudioInitSegment(C)),d=I;var h=Math.floor(I),u={unit:l.data,length:l.data.byteLength,pts:h,dts:h};this.audio_track_&&(null===(a=this.audio_track_)||void 0===a||a.samples.push(u),this.audio_track_.length+=l.data.byteLength),I+=o}c.hasIncompleteData()&&(this.aac_last_incomplete_data_=c.getIncompleteData()),d&&(this.aac_last_sample_pts_=d)}},e.prototype.parseLOASAACPayload=function(A,e){var t,i,a;if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var r=new Uint8Array(A.byteLength+this.aac_last_incomplete_data_.byteLength);r.set(this.aac_last_incomplete_data_,0),r.set(A,this.aac_last_incomplete_data_.byteLength),A=r}var o,s=0;if(void 0!==e&&(s=e/this.timescale_),"aac"===(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec)){if(void 0===e&&void 0!==this.aac_last_sample_pts_)o=1024/this.audio_metadata_.sampling_frequency*1e3,s=this.aac_last_sample_pts_+o;else if(void 0===e)return void n.A.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.aac_last_sample_pts_){o=1024/this.audio_metadata_.sampling_frequency*1e3;var g=this.aac_last_sample_pts_+o;Math.abs(g-s)>1&&(n.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(g,"ms, PES pts: ").concat(s,"ms")),s=g)}}for(var c=new V(A),l=null,I=s,d=0;null!=(l=c.readNextAACFrame(null!==(i=this.loas_previous_frame)&&void 0!==i?i:void 0));){this.loas_previous_frame=l,o=1024/l.sampling_frequency*1e3;var C={codec:"aac",data:l};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(C)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(C)):(this.audio_metadata_={codec:"aac",audio_object_type:l.audio_object_type,sampling_freq_index:l.sampling_freq_index,sampling_frequency:l.sampling_frequency,channel_config:l.channel_config},this.dispatchAudioInitSegment(C)),d=I;var h=Math.floor(I),u={unit:l.data,length:l.data.byteLength,pts:h,dts:h};this.audio_track_&&(null===(a=this.audio_track_)||void 0===a||a.samples.push(u),this.audio_track_.length+=l.data.byteLength),I+=o}c.hasIncompleteData()&&(this.aac_last_incomplete_data_=c.getIncompleteData()),d&&(this.aac_last_sample_pts_=d)}},e.prototype.parseAC3Payload=function(A,e){var t,i;if(!this.has_video_||this.video_init_segment_dispatched_){var a,r=0;if(void 0!==e&&(r=e/this.timescale_),"ac-3"===(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec))if(void 0===e&&void 0!==this.aac_last_sample_pts_)a=1536/this.audio_metadata_.sampling_frequency*1e3,r=this.aac_last_sample_pts_+a;else if(void 0===e)return void n.A.w(this.TAG,"AC3: Unknown pts");for(var o=new uA(A),s=null,g=r,c=0;null!=(s=o.readNextAC3Frame());){a=1536/s.sampling_frequency*1e3;var l={codec:"ac-3",data:s};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(l)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(l)):(this.audio_metadata_={codec:"ac-3",sampling_frequency:s.sampling_frequency,bit_stream_identification:s.bit_stream_identification,bit_stream_mode:s.bit_stream_mode,low_frequency_effects_channel_on:s.low_frequency_effects_channel_on,channel_mode:s.channel_mode},this.dispatchAudioInitSegment(l)),c=g;var I=Math.floor(g),d={unit:s.data,length:s.data.byteLength,pts:I,dts:I};this.audio_track_&&(null===(i=this.audio_track_)||void 0===i||i.samples.push(d),this.audio_track_.length+=s.data.byteLength),g+=a}c&&(this.aac_last_sample_pts_=c)}},e.prototype.parseEAC3Payload=function(A,e){var t,i;if(!this.has_video_||this.video_init_segment_dispatched_){var a,r=0;if(void 0!==e&&(r=e/this.timescale_),"ec-3"===(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec))if(void 0===e&&void 0!==this.aac_last_sample_pts_)a=256*(this.audio_metadata_.num_blks||0)/(this.audio_metadata_.sampling_frequency||0)*1e3,r=this.aac_last_sample_pts_+a;else if(void 0===e)return void n.A.w(this.TAG,"EAC3: Unknown pts");for(var o=new fA(A),s=null,g=r,c=0;null!=(s=o.readNextEAC3Frame());){a=1536/s.sampling_frequency*1e3;var l={codec:"ec-3",data:s};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(l)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(l)):(this.audio_metadata_={codec:"ec-3",sampling_frequency:s.sampling_frequency,bit_stream_identification:s.bit_stream_identification,low_frequency_effects_channel_on:s.low_frequency_effects_channel_on,num_blks:s.num_blks,channel_mode:s.channel_mode},this.dispatchAudioInitSegment(l)),c=g;var I=Math.floor(g),d={unit:s.data,length:s.data.byteLength,pts:I,dts:I};this.audio_track_&&(null===(i=this.audio_track_)||void 0===i||i.samples.push(d),this.audio_track_.length+=s.data.byteLength),g+=a}c&&(this.aac_last_sample_pts_=c)}},e.prototype.parseOpusPayload=function(A,e){var t,i;if(!this.has_video_||this.video_init_segment_dispatched_){var a,r=0;if(void 0!==e&&(r=e/this.timescale_),"opus"===(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec))if(void 0===e&&void 0!==this.aac_last_sample_pts_)a=20,r=this.aac_last_sample_pts_+a;else if(void 0===e)return void n.A.w(this.TAG,"Opus: Unknown pts");for(var o=r,s=0,g=0;g>>3&3,n=(6&A[1])>>1,a=(A[2],(12&A[2])>>>2),r=3&~(A[3]>>>6)?2:1,o=0,s=34;switch(i){case 0:o=[11025,12e3,8e3,0][a];break;case 2:o=[22050,24e3,16e3,0][a];break;case 3:o=[44100,48e3,32e3,0][a]}switch(n){case 1:s=34;break;case 2:s=33;break;case 3:s=32}var g=new dA;g.object_type=s,g.sample_rate=o,g.channel_count=r,g.data=A;var c={codec:"mp3",data:g};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(c)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(c)):(this.audio_metadata_={codec:"mp3",object_type:s,sample_rate:o,channel_count:r},this.dispatchAudioInitSegment(c));var l={unit:A,length:A.byteLength,pts:e/this.timescale_,dts:e/this.timescale_};this.audio_track_&&(null===(t=this.audio_track_)||void 0===t||t.samples.push(l),this.audio_track_.length+=A.byteLength)}},e.prototype.detectAudioMetadataChange=function(A){var e,t,i,a;if(A.codec!==(null===(e=this.audio_metadata_)||void 0===e?void 0:e.codec))return n.A.v(this.TAG,"Audio: Audio Codecs changed from "+"".concat(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec," to ").concat(A.codec)),!0;if("aac"===A.codec&&"aac"===this.audio_metadata_.codec){if((r=A.data).audio_object_type!==this.audio_metadata_.audio_object_type)return n.A.v(this.TAG,"AAC: AudioObjectType changed from "+"".concat(this.audio_metadata_.audio_object_type," to ").concat(r.audio_object_type)),!0;if(r.sampling_freq_index!==this.audio_metadata_.sampling_freq_index)return n.A.v(this.TAG,"AAC: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sampling_freq_index," to ").concat(r.sampling_freq_index)),!0;if(r.channel_config!==this.audio_metadata_.channel_config)return n.A.v(this.TAG,"AAC: Channel configuration changed from "+"".concat(null===(i=this.audio_metadata_)||void 0===i?void 0:i.channel_config," to ").concat(r.channel_config)),!0}else if("ac-3"===A.codec&&"ac-3"===this.audio_metadata_.codec){var r;if((r=A.data).sampling_frequency!==this.audio_metadata_.sampling_frequency)return n.A.v(this.TAG,"AC3: Sampling Frequency changed from "+"".concat(null===(a=this.audio_metadata_)||void 0===a?void 0:a.sampling_frequency," to ").concat(r.sampling_frequency)),!0;if(r.bit_stream_identification!==this.audio_metadata_.bit_stream_identification)return n.A.v(this.TAG,"AC3: Bit Stream Identification changed from "+"".concat(this.audio_metadata_.bit_stream_identification," to ").concat(r.bit_stream_identification)),!0;if(r.bit_stream_mode!==this.audio_metadata_.bit_stream_mode)return n.A.v(this.TAG,"AC3: BitStream Mode changed from "+"".concat(this.audio_metadata_.bit_stream_mode," to ").concat(r.bit_stream_mode)),!0;if(r.channel_mode!==this.audio_metadata_.channel_mode)return n.A.v(this.TAG,"AC3: Channel Mode changed from "+"".concat(this.audio_metadata_.channel_mode," to ").concat(r.channel_mode)),!0;if(r.low_frequency_effects_channel_on!==this.audio_metadata_.low_frequency_effects_channel_on)return n.A.v(this.TAG,"AC3: Low Frequency Effects Channel On changed from "+"".concat(this.audio_metadata_.low_frequency_effects_channel_on," to ").concat(r.low_frequency_effects_channel_on)),!0}else if("opus"===A.codec&&"opus"===this.audio_metadata_.codec){if((o=A.meta).sample_rate!==this.audio_metadata_.sample_rate)return n.A.v(this.TAG,"Opus: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(o.sample_rate)),!0;if(o.channel_count!==this.audio_metadata_.channel_count)return n.A.v(this.TAG,"Opus: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(o.channel_count)),!0}else if("mp3"===A.codec&&"mp3"===this.audio_metadata_.codec){var o;if((o=A.data).object_type!==this.audio_metadata_.object_type)return n.A.v(this.TAG,"MP3: AudioObjectType changed from "+"".concat(this.audio_metadata_.object_type," to ").concat(o.object_type)),!0;if(o.sample_rate!==this.audio_metadata_.sample_rate)return n.A.v(this.TAG,"MP3: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(o.sample_rate)),!0;if(o.channel_count!==this.audio_metadata_.channel_count)return n.A.v(this.TAG,"MP3: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(o.channel_count)),!0}return!1},e.prototype.dispatchAudioInitSegment=function(A){var e,t,i,a,r,o,s={type:"audio"};if(s.id=null===(e=this.audio_track_)||void 0===e?void 0:e.id,s.timescale=1e3,s.duration=this.duration_,"aac"===(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec)){var g="aac"===A.codec?A.data:null,c=new O(g);s.audioSampleRate=c.sampling_rate,s.channelCount=c.channel_count,s.codec=c.codec_mimetype,s.originalCodec=c.original_codec_mimetype,s.config=c.config,s.refSampleDuration=1024/s.audioSampleRate*s.timescale}else if("ac-3"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec)){var l="ac-3"===A.codec?A.data:null,I=new BA(l);s.audioSampleRate=I.sampling_rate,s.channelCount=I.channel_count,s.codec=I.codec_mimetype,s.originalCodec=I.original_codec_mimetype,s.config=I.config,s.refSampleDuration=1536/s.audioSampleRate*s.timescale}else if("ec-3"===(null===(a=this.audio_metadata_)||void 0===a?void 0:a.codec)){var d="ec-3"===A.codec?A.data:null,C=new QA(d);s.audioSampleRate=C.sampling_rate,s.channelCount=C.channel_count,s.codec=C.codec_mimetype,s.originalCodec=C.original_codec_mimetype,s.config=C.config,s.refSampleDuration=256*C.num_blks/s.audioSampleRate*s.timescale}else"opus"===(null===(r=this.audio_metadata_)||void 0===r?void 0:r.codec)?(s.audioSampleRate=this.audio_metadata_.sample_rate,s.channelCount=this.audio_metadata_.channel_count,s.channelConfigCode=this.audio_metadata_.channel_config_code,s.codec="opus",s.originalCodec="opus",s.config=void 0,s.refSampleDuration=20):"mp3"===(null===(o=this.audio_metadata_)||void 0===o?void 0:o.codec)&&(s.audioSampleRate=this.audio_metadata_.sample_rate,s.channelCount=this.audio_metadata_.channel_count,s.codec="mp3",s.originalCodec="mp3",s.config=void 0);this.audio_init_segment_dispatched_||n.A.v(this.TAG,"Generated first AudioSpecificConfig for mimeType: ".concat(s.codec)),this.onTrackMetadata&&this.onTrackMetadata("audio",s),this.audio_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;var h=this.media_info_;h.hasAudio=!0,h.audioCodec=s.originalCodec,h.audioSampleRate=s.audioSampleRate,h.audioChannelCount=s.channelCount,h.hasVideo&&h.videoCodec?h.mimeType='video/mp2t; codecs="'.concat(h.videoCodec,",").concat(h.audioCodec,'"'):h.mimeType='video/mp2t; codecs="'.concat(h.audioCodec,'"'),h.isComplete()&&this.onMediaInfo&&this.onMediaInfo(h)},e.prototype.dispatchPESPrivateDataDescriptor=function(A,e,t){var i=new W;i.pid=A,i.stream_type=e,i.descriptor=t,this.onPESPrivateDataDescriptor&&this.onPESPrivateDataDescriptor(i)},e.prototype.parsePESPrivateDataPayload=function(A,e,t,i,n){var a=new j;if(a.pid=i,a.stream_id=n,a.len=A.byteLength,a.data=A,void 0!==e){var r=Math.floor(e/this.timescale_);a.pts=r}else a.nearest_pts=this.aac_last_sample_pts_;if(void 0!==t){var o=Math.floor(t/this.timescale_);a.dts=o}this.onPESPrivateData&&this.onPESPrivateData(a)},e.prototype.parseTimedID3MetadataPayload=function(A,e,t,i,n){var a=new j;if(a.pid=i,a.stream_id=n,a.len=A.byteLength,a.data=A,void 0!==e){var r=Math.floor(e/this.timescale_);a.pts=r}if(void 0!==t){var o=Math.floor(t/this.timescale_);a.dts=o}this.onTimedID3Metadata&&this.onTimedID3Metadata(a)},e.prototype.parseSMPTE2038MetadataPayload=function(A,e,t,i,n){var a=new IA;if(a.pid=i,a.stream_id=n,a.len=A.byteLength,a.data=A,void 0!==e){var r=Math.floor(e/this.timescale_);a.pts=r}if(a.nearest_pts=this.aac_last_sample_pts_,void 0!==t){var o=Math.floor(t/this.timescale_);a.dts=o}a.ancillaries=function(A){for(var e=new d(A),t=0,i=[];t+=6,0===e.readBits(6);){var n=e.readBool();t+=1;var a=e.readBits(11);t+=11;var r=e.readBits(12);t+=12;var o=255&e.readBits(10);t+=10;var s=255&e.readBits(10);t+=10;var g=255&e.readBits(10);t+=10;for(var c=new Uint8Array(g),l=0;l>>24&255,n[1]=i>>>16&255,n[2]=i>>>8&255,n[3]=255&i,n.set(A,4);var s=8;for(o=0;o>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))},A.trak=function(e){return A.box(A.types.trak,A.tkhd(e),A.mdia(e))},A.tkhd=function(e){var t=e.id,i=e.duration,n=e.presentWidth,a=e.presentHeight;return A.box(A.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>>8&255,255&n,0,0,a>>>8&255,255&a,0,0]))},A.mdia=function(e){return A.box(A.types.mdia,A.mdhd(e),A.hdlr(e),A.minf(e))},A.mdhd=function(e){var t=e.timescale,i=e.duration;return A.box(A.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,i>>>24&255,i>>>16&255,i>>>8&255,255&i,85,196,0,0]))},A.hdlr=function(e){var t;return t="audio"===e.type?A.constants.HDLR_AUDIO:A.constants.HDLR_VIDEO,A.box(A.types.hdlr,t)},A.minf=function(e){var t;return t="audio"===e.type?A.box(A.types.smhd,A.constants.SMHD):A.box(A.types.vmhd,A.constants.VMHD),A.box(A.types.minf,t,A.dinf(),A.stbl(e))},A.dinf=function(){return A.box(A.types.dinf,A.box(A.types.dref,A.constants.DREF))},A.stbl=function(e){return A.box(A.types.stbl,A.stsd(e),A.box(A.types.stts,A.constants.STTS),A.box(A.types.stsc,A.constants.STSC),A.box(A.types.stsz,A.constants.STSZ),A.box(A.types.stco,A.constants.STCO))},A.stsd=function(e){return"audio"===e.type?"mp3"===e.codec?A.box(A.types.stsd,A.constants.STSD_PREFIX,A.mp3(e)):"ac-3"===e.codec?A.box(A.types.stsd,A.constants.STSD_PREFIX,A.ac3(e)):"ec-3"===e.codec?A.box(A.types.stsd,A.constants.STSD_PREFIX,A.ec3(e)):"opus"===e.codec?A.box(A.types.stsd,A.constants.STSD_PREFIX,A.Opus(e)):A.box(A.types.stsd,A.constants.STSD_PREFIX,A.mp4a(e)):"video"===e.type&&e.codec.startsWith("hvc1")?A.box(A.types.stsd,A.constants.STSD_PREFIX,A.hvc1(e)):"video"===e.type&&e.codec.startsWith("av01")?A.box(A.types.stsd,A.constants.STSD_PREFIX,A.av01(e)):A.box(A.types.stsd,A.constants.STSD_PREFIX,A.avc1(e))},A.mp3=function(e){var t=e.channelCount,i=e.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return A.box(A.types[".mp3"],n)},A.mp4a=function(e){var t=e.channelCount,i=e.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return A.box(A.types.mp4a,n,A.esds(e))},A.ac3=function(e){var t,i=e.channelCount,n=e.audioSampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,n>>>8&255,255&n,0,0]);return A.box(A.types["ac-3"],a,A.box(A.types.dac3,new Uint8Array(null!==(t=e.config)&&void 0!==t?t:[])))},A.ec3=function(e){var t,i=e.channelCount,n=e.audioSampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,n>>>8&255,255&n,0,0]);return A.box(A.types["ec-3"],a,A.box(A.types.dec3,new Uint8Array(null!==(t=e.config)&&void 0!==t?t:[])))},A.esds=function(e){var t,i=null!==(t=e.config)&&void 0!==t?t:[],n=i.length,a=new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([n]).concat(i).concat([6,1,2]));return A.box(A.types.esds,a)},A.Opus=function(e){var t=e.channelCount,i=e.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return A.box(A.types.Opus,n,A.dOps(e))},A.dOps=function(e){var t=e.channelCount,i=e.channelConfigCode,n=e.audioSampleRate,a=[];switch(i){case 1:case 2:a=[0];break;case 0:a=[255,1,1,0,1];break;case 128:a=[255,2,0,0,1];break;case 3:a=[1,2,1,0,2,1];break;case 4:a=[1,2,2,0,1,2,3];break;case 5:a=[1,3,2,0,4,1,2,3];break;case 6:a=[1,4,2,0,4,1,2,3,5];break;case 7:a=[1,4,2,0,4,1,2,3,5,6];break;case 8:a=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:a=[1,1,2,0,1];break;case 131:a=[1,1,3,0,1,2];break;case 132:a=[1,1,4,0,1,2,3];break;case 133:a=[1,1,5,0,1,2,3,4];break;case 134:a=[1,1,6,0,1,2,3,4,5];break;case 135:a=[1,1,7,0,1,2,3,4,5,6];break;case 136:a=[1,1,8,0,1,2,3,4,5,6,7]}var r=new Uint8Array(function(A,e,t){if(t||2===arguments.length)for(var i,n=0,a=e.length;n>>24&255,n>>>17&255,n>>>8&255,n>>>0&255,0,0],function(A,e){var t="function"==typeof Symbol&&A[Symbol.iterator];if(!t)return A;var i,n,a=t.call(A),r=[];try{for(;(void 0===e||e-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(A){n={error:A}}finally{try{i&&!i.done&&(t=a.return)&&t.call(a)}finally{if(n)throw n.error}}return r}(a),!1));return A.box(A.types.dOps,r)},A.avc1=function(e){var t=e.avcc,i=e.codecWidth,n=e.codecHeight,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,i>>>8&255,255&i,n>>>8&255,255&n,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return A.box(A.types.avc1,a,A.box(A.types.avcC,t))},A.hvc1=function(e){var t=e.hvcc,i=e.codecWidth,n=e.codecHeight,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,i>>>8&255,255&i,n>>>8&255,255&n,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return A.box(A.types.hvc1,a,A.box(A.types.hvcC,t))},A.av01=function(e){var t,i,n=e.av1c,a=null!==(t=e.codecWidth)&&void 0!==t?t:192,r=null!==(i=e.codecHeight)&&void 0!==i?i:108,o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,a>>>8&255,255&a,r>>>8&255,255&r,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return A.box(A.types.av01,o,A.box(A.types.av1C,n))},A.mvex=function(e){return A.box(A.types.mvex,A.trex(e))},A.trex=function(e){var t=e.id,i=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return A.box(A.types.trex,i)},A.moof=function(e,t){return A.box(A.types.moof,A.mfhd(e.sequenceNumber),A.traf(e,t))},A.mfhd=function(e){var t=new Uint8Array([0,0,0,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e]);return A.box(A.types.mfhd,t)},A.traf=function(e,t){var i=e.id,n=A.box(A.types.tfhd,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),a=A.box(A.types.tfdt,new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t])),r=A.sdtp(e),o=A.trun(e,r.byteLength+16+16+8+16+8+8);return A.box(A.types.traf,n,a,o,r)},A.sdtp=function(e){for(var t=e.samples||[],i=t.length,n=new Uint8Array(4+i),a=0;a>>24&255,n>>>16&255,n>>>8&255,255&n,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0);for(var o=0;o>>24&255,s>>>16&255,s>>>8&255,255&s,g>>>24&255,g>>>16&255,g>>>8&255,255&g,c.isLeading<<2|c.dependsOn,c.isDependedOn<<6|c.hasRedundancy<<4|c.isNonSync,0,0,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*o)}return A.box(A.types.trun,r)},A.mdat=function(e){return A.box(A.types.mdat,e)},A.constants={FTYP:new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),STSD_PREFIX:new Uint8Array([0,0,0,0,0,0,0,1]),STTS:DA,STSC:DA,STCO:DA,STSZ:new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),HDLR_VIDEO:new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),HDLR_AUDIO:new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),DREF:new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),SMHD:new Uint8Array([0,0,0,0,0,0,0,0]),VMHD:new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])},A}();vA.init();const wA=vA,bA=function(){function A(){}return A.getSilentFrame=function(A,e){if("mp4a.40.2"===A){if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===e)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},A}();var FA=t(453);const RA=function(){function A(A){var e;this.TAG="MP4Remuxer",this._fillSilentAfterSeek=!1,this._config=A,this._isLive=!!A.isLive,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new FA.Sc("audio"),this._videoSegmentInfoList=new FA.Sc("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!a.A.chrome||!(a.A.version&&a.A.version.major<50||a.A.version&&50===a.A.version.major&&((null===(e=a.A.version)||void 0===e?void 0:e.build)||0)<2661)),this._fillSilentAfterSeek=!(!a.A.msedge&&!a.A.msie),this._mp3UseMpegAudio=!a.A.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return A.prototype.destroy=function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null},A.prototype.bindDataSource=function(A){var e;return A.onDataAvailable=null===(e=this.remux)||void 0===e?void 0:e.bind(this),A.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(A.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(A){this._onInitSegment=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(A){this._onMediaSegment=A},enumerable:!1,configurable:!0}),A.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},A.prototype.seek=function(A){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},A.prototype.remux=function(A,e){if(!this._onMediaSegment)throw new c.j4("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(A,e),e&&this._remuxVideo(e),A&&this._remuxAudio(A)},A.prototype._onTrackMetadataReceived=function(A,e){var t=null,i="mp4",n=e.codec;if("audio"===A)this._audioMeta=e,"mp3"===e.codec&&this._mp3UseMpegAudio?(i="mpeg",n="",t=new Uint8Array):t=wA.generateInitSegment(e);else{if("video"!==A)return;this._videoMeta=e,t=wA.generateInitSegment(e)}if(!this._onInitSegment)throw new c.j4("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(A,{type:A,data:t.buffer,codec:n,container:"".concat(A,"/").concat(i),mediaDuration:e.duration})},A.prototype._calculateDtsBase=function(A,e){var t,i;this._dtsBaseInited||((null===(t=null==A?void 0:A.samples)||void 0===t?void 0:t.length)&&(this._audioDtsBase=A.samples[0].dts),(null===(i=null==e?void 0:e.samples)||void 0===i?void 0:i.length)&&(this._videoDtsBase=e.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},A.prototype.getTimestampBase=function(){if(this._dtsBaseInited)return this._dtsBase},A.prototype.flushStashedSamples=function(){var A=this._videoStashedLastSample,e=this._audioStashedLastSample,t={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=A&&(t.samples.push(A),t.length=null==A?void 0:A.length);var i={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=e&&(i.samples.push(e),i.length=null==e?void 0:e.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(t,!0),this._remuxAudio(i,!0)},A.prototype._remuxAudio=function(A,e){var t,i,r,o,s,g,c;if(null!=this._audioMeta){var l,I,d=A,C=d.samples,h=-1,u=this._audioMeta.refSampleDuration,B="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,E=this._dtsBaseInited&&void 0===this._audioNextDts,f=!1;if(C&&0!==C.length&&(1!==C.length||e)){var Q=0,x=null,p=0;B?(Q=0,p=d.length):(Q=8,p=8+d.length);var m=null;if(C.length>1&&(p-=(m=C.pop()).length),null!=this._audioStashedLastSample){var y=this._audioStashedLastSample;this._audioStashedLastSample=null,C.unshift(y),p+=y.length}null!=m&&(this._audioStashedLastSample=m);var _=C[0].dts-this._dtsBase;if(this._audioNextDts)l=_-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())l=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(f=!0);else{var S=this._audioSegmentInfoList.getLastSampleBefore(_);if(null!=S){var D=_-(S.originalDts+S.duration);D<=3&&(D=0),l=_-(S.dts+S.duration+D)}else l=0}if(f){var v=_-l,w=this._videoSegmentInfoList.getLastSegmentBefore(_);if(null!=w&&w.beginDts=3*(u||0)&&this._fillAudioTimestampGap&&!a.A.safari){T=!0;var G,U=Math.floor(l/(u||0));n.A.w(this.TAG,"Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\n"+"originalDts: ".concat(N," ms, curRefDts: ").concat(Y," ms, ")+"dtsCorrection: ".concat(Math.round(l)," ms, generate: ").concat(U," frames")),b=Math.floor(Y),L=Math.floor(Y+(u||0))-b,null==(G=bA.getSilentFrame(null===(r=this._audioMeta)||void 0===r?void 0:r.originalCodec,this._audioMeta.channelCount))&&(n.A.w(this.TAG,"Unable to generate silent frame for "+"".concat(null===(o=this._audioMeta)||void 0===o?void 0:o.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),G=P),M=[];for(var J=0;J=1?null===(s=R[R.length-1])||void 0===s?void 0:s.duration:Math.floor(u||0),this._audioNextDts=b+L;-1===h&&(h=b),R.push({dts:b,pts:b,cts:0,unit:y.unit,size:null===(g=y.unit)||void 0===g?void 0:g.byteLength,duration:L,originalDts:N,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),T&&R.push.apply(R,M)}}if(0===R.length)return d.samples=[],void(d.length=0);for(B?x=new Uint8Array(p):((x=new Uint8Array(p))[0]=p>>>24&255,x[1]=p>>>16&255,x[2]=p>>>8&255,x[3]=255&p,x.set(wA.types.mdat,4)),k=0;k1&&(d-=(C=s.pop()).length),null!=this._videoStashedLastSample){var h=this._videoStashedLastSample;this._videoStashedLastSample=null,s.unshift(h),d+=(null==h?void 0:h.length)||0}null!=C&&(this._videoStashedLastSample=C);var u=s[0].dts-this._dtsBase;if(this._videoNextDts)n=u-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())n=0;else{var B=this._videoSegmentInfoList.getLastSampleBefore(u);if(null!=B){var E=u-(B.originalDts+B.duration);E<=3&&(E=0),n=u-(B.dts+B.duration+E)}else n=0}for(var f=new FA.EZ,Q=[],x=0;x=1?Q[Q.length-1].duration:Math.floor((null===(t=this._videoMeta)||void 0===t?void 0:t.refSampleDuration)||0),m){var v=new FA.$_(y,S,D,h.dts,!0);v.fileposition=h.fileposition,f.appendSyncPoint(v)}Q.push({dts:y,pts:S,cts:_,units:h.units,size:h.length,isKeyframe:m,duration:D,originalDts:p,flags:{isLeading:0,dependsOn:m?2:1,isDependedOn:m?1:0,hasRedundancy:0,isNonSync:m?0:1}})}for((I=new Uint8Array(d))[0]=d>>>24&255,I[1]=d>>>16&255,I[2]=d>>>8&255,I[3]=255&d,I.set(wA.types.mdat,4),x=0;x0)null===(t=this._demuxer)||void 0===t||t.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments?null===(i=this._mediaDataSource.segments[this._currentSegmentIndex])||void 0===i?void 0:i.timestampBase:0,g=(null===(a=this._demuxer)||void 0===a?void 0:a.parseChunks(A,e))||0;else{var c=null;(c=m.probe(A)).match&&(this._setupFLVDemuxerRemuxer(c),g=(null===(r=this._demuxer)||void 0===r?void 0:r.parseChunks(A,e))||0),c.match||(null==c?void 0:c.needMoreData)||(c=SA.probe(A)).match&&(this._setupTSDemuxerRemuxer(c),g=(null===(o=this._demuxer)||void 0===o?void 0:o.parseChunks(A,e))||0),c.match||(null==c?void 0:c.needMoreData)||(c=null,n.A.e(this.TAG,"Non MPEG-TS/FLV, Unsupported media type!"),Promise.resolve().then((function(){s._internalAbort()})),this._emitter.emit(PA.A.DEMUX_ERROR,h.A.FORMAT_UNSUPPORTED,"Non MPEG-TS/FLV, Unsupported media type!"))}return g},A.prototype._setupFLVDemuxerRemuxer=function(A){var e;this._demuxer=new m(A,this._config),this._remuxer||(this._remuxer=new RA(this._config));var t=this._mediaDataSource;void 0===t.duration||isNaN(t.duration)||(this._demuxer.overridedDuration=t.duration),"boolean"==typeof t.hasAudio&&(this._demuxer.overridedHasAudio=t.hasAudio),"boolean"==typeof t.hasVideo&&(this._demuxer.overridedHasVideo=t.hasVideo),t.segments&&this._demuxer&&this._remuxer&&(this._demuxer.timestampBase=null===(e=null==t?void 0:t.segments[this._currentSegmentIndex])||void 0===e?void 0:e.timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this))},A.prototype._setupTSDemuxerRemuxer=function(A){var e=this._demuxer=new SA(A,this._config);this._remuxer||(this._remuxer=new RA(this._config)),e.onError=this._onDemuxException.bind(this),e.onMediaInfo=this._onMediaInfo.bind(this),e.onMetaDataArrived=this._onMetaDataArrived.bind(this),e.onTimedID3Metadata=this._onTimedID3Metadata.bind(this),e.onSMPTE2038Metadata=this._onSMPTE2038Metadata.bind(this),e.onSCTE35Metadata=this._onSCTE35Metadata.bind(this),e.onPESPrivateDataDescriptor=this._onPESPrivateDataDescriptor.bind(this),e.onPESPrivateData=this._onPESPrivateData.bind(this),this._remuxer.bindDataSource(this._demuxer),this._demuxer.bindDataSource(this._ioctl),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this)},A.prototype._onMediaInfo=function(A){var e,t,i=this;null==this._mediaInfo&&(this._mediaInfo=Object.assign({},A),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=(null===(t=null===(e=this._mediaDataSource)||void 0===e?void 0:e.segments)||void 0===t?void 0:t.length)||0,Object.setPrototypeOf(this._mediaInfo,r.A.prototype));var n=Object.assign({},A);Object.setPrototypeOf(n,r.A.prototype),this._mediaInfo.segments&&(this._mediaInfo.segments[this._currentSegmentIndex]=n),this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then((function(){var A=i._pendingSeekTime;i._pendingSeekTime=null,i.seek(A)}))},A.prototype._onMetaDataArrived=function(A){this._emitter.emit(PA.A.METADATA_ARRIVED,A)},A.prototype._onScriptDataArrived=function(A){this._emitter.emit(PA.A.SCRIPTDATA_ARRIVED,A)},A.prototype._onTimedID3Metadata=function(A){var e,t=null===(e=this._remuxer)||void 0===e?void 0:e.getTimestampBase();void 0!==t&&(void 0!==A.pts&&(A.pts-=t),void 0!==A.dts&&(A.dts-=t),this._emitter.emit(PA.A.TIMED_ID3_METADATA_ARRIVED,A))},A.prototype._onSMPTE2038Metadata=function(A){var e,t=null===(e=this._remuxer)||void 0===e?void 0:e.getTimestampBase();void 0!==t&&(void 0!==A.pts&&(A.pts-=t),void 0!==A.dts&&(A.dts-=t),void 0!==A.nearest_pts&&(A.nearest_pts-=t),this._emitter.emit(PA.A.SMPTE2038_METADATA_ARRIVED,A))},A.prototype._onSCTE35Metadata=function(A){var e,t=null===(e=this._remuxer)||void 0===e?void 0:e.getTimestampBase();void 0!==t&&(void 0!==A.pts&&(A.pts-=t),void 0!==A.nearest_pts&&(A.nearest_pts-=t),this._emitter.emit(PA.A.SCTE35_METADATA_ARRIVED,A))},A.prototype._onPESPrivateDataDescriptor=function(A){this._emitter.emit(PA.A.PES_PRIVATE_DATA_DESCRIPTOR,A)},A.prototype._onPESPrivateData=function(A){var e,t=null===(e=this._remuxer)||void 0===e?void 0:e.getTimestampBase();void 0!==t&&(void 0!==A.pts&&(A.pts-=t),void 0!==A.nearest_pts&&(A.nearest_pts-=t),void 0!==A.dts&&(A.dts-=t),this._emitter.emit(PA.A.PES_PRIVATE_DATA_ARRIVED,A))},A.prototype._onIOSeeked=function(){var A;null===(A=this._remuxer)||void 0===A||A.insertDiscontinuity()},A.prototype._onIOComplete=function(A){var e,t,i=A+1;i<((null===(t=null===(e=this._mediaDataSource)||void 0===e?void 0:e.segments)||void 0===t?void 0:t.length)||0)?(this._internalAbort(),this._remuxer&&this._remuxer.flushStashedSamples(),this._loadSegment(i)):(this._remuxer&&this._remuxer.flushStashedSamples(),this._emitter.emit(PA.A.LOADING_COMPLETE),this._disableStatisticsReporter())},A.prototype._onIORedirect=function(A){var e,t=null===(e=this._ioctl)||void 0===e?void 0:e.extraData;this._mediaDataSource.segments&&(this._mediaDataSource.segments[t].redirectedURL=A)},A.prototype._onIORecoveredEarlyEof=function(){this._emitter.emit(PA.A.RECOVERED_EARLY_EOF)},A.prototype._onIOException=function(A,e){n.A.e(this.TAG,"IOException: type = ".concat(A,", code = ").concat(e.code,", msg = ").concat(e.msg)),this._emitter.emit(PA.A.IO_ERROR,A,e),this._disableStatisticsReporter()},A.prototype._onDemuxException=function(A,e){n.A.e(this.TAG,"DemuxException: type = ".concat(A,", info = ").concat(e)),this._emitter.emit(PA.A.DEMUX_ERROR,A,e)},A.prototype._onRemuxerInitSegmentArrival=function(A,e){this._emitter.emit(PA.A.INIT_SEGMENT,A,e)},A.prototype._onRemuxerMediaSegmentArrival=function(A,e){if(null==this._pendingSeekTime&&(this._emitter.emit(PA.A.MEDIA_SEGMENT,A,e),null!=this._pendingResolveSeekPoint&&"video"===A)){var t=e.info.syncPoints,i=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,a.A.safari&&t.length>0&&t[0].originalDts===i&&(i=t[0].pts),this._emitter.emit(PA.A.RECOMMEND_SEEKPOINT,i)}},A.prototype._enableStatisticsReporter=function(){null==this._statisticsReporter&&this._reportStatisticsInfo&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},A.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},A.prototype._reportSegmentMediaInfo=function(A){var e,t,i,n,a=(null===(e=this._mediaInfo)||void 0===e?void 0:e.segments)?null===(t=this._mediaInfo)||void 0===t?void 0:t.segments[A]:{},r=Object.assign({},a);r.duration=null===(i=this._mediaInfo)||void 0===i?void 0:i.duration,r.segmentCount=null===(n=this._mediaInfo)||void 0===n?void 0:n.segmentCount,delete r.segments,delete r.keyframesIndex,this._emitter.emit(PA.A.MEDIA_INFO,r)},A.prototype._reportStatisticsInfo=function(){var A,e,t,i,n,a,r={};r.url=null===(A=this._ioctl)||void 0===A?void 0:A.currentURL,r.hasRedirect=null===(e=this._ioctl)||void 0===e?void 0:e.hasRedirect,r.hasRedirect&&(r.redirectedURL=null===(t=this._ioctl)||void 0===t?void 0:t.currentRedirectedURL),r.speed=null===(i=this._ioctl)||void 0===i?void 0:i.currentSpeed,r.loaderType=null===(n=this._ioctl)||void 0===n?void 0:n.loaderType,r.currentSegmentIndex=this._currentSegmentIndex,r.totalSegmentCount=null===(a=this._mediaDataSource.segments)||void 0===a?void 0:a.length,this._emitter.emit(PA.A.STATISTICS_INFO,r)},A}()},716:(A,e,t)=>{t.d(e,{A:()=>i});const i={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",TIMED_ID3_METADATA_ARRIVED:"timed_id3_metadata_arrived",SMPTE2038_METADATA_ARRIVED:"smpte2038_metadata_arrived",SCTE35_METADATA_ARRIVED:"scte35_metadata_arrived",PES_PRIVATE_DATA_DESCRIPTOR:"pes_private_data_descriptor",PES_PRIVATE_DATA_ARRIVED:"pes_private_data_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"}},291:(A,e,t)=>{var i=t(641),n=t(976),a=t(716),r=null,o=function(A,e){self.postMessage({msg:"logcat_callback",data:{type:A,logcat:e}})};function s(A,e){var t={msg:a.A.INIT_SEGMENT,data:{type:A,data:e}};self.postMessage(t,[e.data])}function g(A,e){var t={msg:a.A.MEDIA_SEGMENT,data:{type:A,data:e}};self.postMessage(t,[e.data])}function c(){var A={msg:a.A.LOADING_COMPLETE};self.postMessage(A)}function l(){var A={msg:a.A.RECOVERED_EARLY_EOF};self.postMessage(A)}function I(A){var e={msg:a.A.MEDIA_INFO,data:A};self.postMessage(e)}function d(A){var e={msg:a.A.METADATA_ARRIVED,data:A};self.postMessage(e)}function C(A){var e={msg:a.A.SCRIPTDATA_ARRIVED,data:A};self.postMessage(e)}function h(A){var e={msg:a.A.TIMED_ID3_METADATA_ARRIVED,data:A};self.postMessage(e)}function u(A){var e={msg:a.A.SMPTE2038_METADATA_ARRIVED,data:A};self.postMessage(e)}function B(A){var e={msg:a.A.SCTE35_METADATA_ARRIVED,data:A};self.postMessage(e)}function E(A){var e={msg:a.A.PES_PRIVATE_DATA_DESCRIPTOR,data:A};self.postMessage(e)}function f(A){var e={msg:a.A.PES_PRIVATE_DATA_ARRIVED,data:A};self.postMessage(e)}function Q(A){var e={msg:a.A.STATISTICS_INFO,data:A};self.postMessage(e)}function x(A,e){self.postMessage({msg:a.A.IO_ERROR,data:{type:A,info:e}})}function p(A,e){self.postMessage({msg:a.A.DEMUX_ERROR,data:{type:A,info:e}})}function m(A){self.postMessage({msg:a.A.RECOMMEND_SEEKPOINT,data:A})}self.addEventListener("message",(function(A){switch(A.data.cmd){case"init":(r=new n.A(A.data.param[0],A.data.param[1])).on(a.A.IO_ERROR,x),r.on(a.A.DEMUX_ERROR,p),r.on(a.A.INIT_SEGMENT,s),r.on(a.A.MEDIA_SEGMENT,g),r.on(a.A.LOADING_COMPLETE,c),r.on(a.A.RECOVERED_EARLY_EOF,l),r.on(a.A.MEDIA_INFO,I),r.on(a.A.METADATA_ARRIVED,d),r.on(a.A.SCRIPTDATA_ARRIVED,C),r.on(a.A.TIMED_ID3_METADATA_ARRIVED,h),r.on(a.A.SMPTE2038_METADATA_ARRIVED,u),r.on(a.A.SCTE35_METADATA_ARRIVED,B),r.on(a.A.PES_PRIVATE_DATA_DESCRIPTOR,E),r.on(a.A.PES_PRIVATE_DATA_ARRIVED,f),r.on(a.A.STATISTICS_INFO,Q),r.on(a.A.RECOMMEND_SEEKPOINT,m);break;case"destroy":r&&(r.destroy(),r=null),self.postMessage({msg:"destroyed"});break;case"start":null==r||r.start();break;case"stop":null==r||r.stop();break;case"seek":null==r||r.seek(A.data.param);break;case"pause":null==r||r.pause();break;case"resume":null==r||r.resume();break;case"logging_config":var e=A.data.param;i.A.applyConfig(e),!0===e.enableCallback?i.A.addLogListener(o):i.A.removeLogListener(o)}}))},465:(A,e,t)=>{t.d(e,{A:()=>i});const i={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},133:(A,e,t)=>{t.d(e,{default:()=>K});var i={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32},n=t(302),a={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,liveBufferLatencyChasing:!1,liveBufferLatencyMaxLatency:1.5,liveBufferLatencyMinRemain:.5,lazyLoad:!0,lazyLoadMaxDuration:180,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:180,autoCleanupMinBackwardDuration:120,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0,url:void 0,redirectedURL:void 0,cors:!1};function r(){return Object.assign({},a)}var o=function(){function A(){}return A.supportMSEH264Playback=function(){var A;return null===(A=window.MediaSource)||void 0===A?void 0:A.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')},A.supportMSEH265Playback=function(){var A;return null===(A=window.MediaSource)||void 0===A?void 0:A.isTypeSupported('video/mp4; codecs="hvc1.1.6.L93.B0"')},A.supportNetworkStreamIO=function(){var A=new n.A({},r()),e=A.loaderType;return A.destroy(),"fetch-stream-loader"===e||"xhr-moz-chunked-loader"===e},A.getNetworkLoaderTypeName=function(){var A=new n.A({},r()),e=A.loaderType;return A.destroy(),e},A.supportNativeMediaPlayback=function(e){void 0===A.videoElement&&(A.videoElement=window.document.createElement("video"));var t=A.videoElement.canPlayType(e);return"probably"===t||"maybe"===t},A.getFeatureList=function(){var e={msePlayback:!1,mseLivePlayback:!1,mseH265Playback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeMP4H265Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return e.msePlayback=A.supportMSEH264Playback(),e.networkStreamIO=A.supportNetworkStreamIO(),e.networkLoaderName=A.getNetworkLoaderTypeName()||"",e.mseLivePlayback=e.msePlayback&&e.networkStreamIO,e.mseH265Playback=A.supportMSEH265Playback(),e.nativeMP4H264Playback=A.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),e.nativeMP4H265Playback=A.supportNativeMediaPlayback('video/mp4; codecs="hvc1.1.6.L93.B0"'),e.nativeWebmVP8Playback=A.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),e.nativeWebmVP9Playback=A.supportNativeMediaPlayback('video/webm; codecs="vp9"'),e},A}();const s=o;var g=t(288),c=t(413),l=t(502),I=t(620);const d={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",TIMED_ID3_METADATA_ARRIVED:"timed_id3_metadata_arrived",SMPTE2038_METADATA_ARRIVED:"smpte2038_metadata_arrived",SCTE35_METADATA_ARRIVED:"scte35_metadata_arrived",PES_PRIVATE_DATA_DESCRIPTOR:"pes_private_data_descriptor",PES_PRIVATE_DATA_ARRIVED:"pes_private_data_arrived",STATISTICS_INFO:"statistics_info",DESTROYING:"destroying"},C=function(){const A=ENTRY_MODULE,e={};function t(i){if(e[i])return e[i].exports;const n=e[i]={exports:{}};return A[i](n,n.exports,t),n.exports}t.m=A,t.n=A=>{const e=A&&A.__esModule?()=>A.default:()=>A;return t.d(e,{a:e}),e},t.d=(A,e)=>{for(const i in e)t.o(e,i)&&!t.o(A,i)&&Object.defineProperty(A,i,{enumerable:!0,get:e[i]})},t.g=function(){if("[object Object]"===Object.prototype.toString.call(globalThis))return globalThis;try{return this||new Function("return this")()}catch(A){if("[object Object]"===Object.prototype.toString.call(window))return window}}(),t.o=(A,e)=>Object.prototype.hasOwnProperty.call(A,e),t.r=A=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})};const i=t(ENTRY_MODULE);return i.default||i};C.toString();const h="[\\.|\\-|\\+|\\w|/|@]+",u="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+h+").*?\\)";function B(A){return(A+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function E(A){return!isNaN(1*A)}function f(A,e,i){const n={};n[i]=[];const a=e.toString(),r=a.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/)||a.match(/^\(\w+,\s*\w+,\s*(\w+)\)\s?\=\s?\>/);if(!r)return n;const o=r[1];let s,g=new RegExp("(\\\\n|\\W)"+B(o)+u,"g");for(;s=g.exec(a);)"dll-reference"!==s[3]&&n[i].push(s[3]);for(g=new RegExp("\\("+B(o)+'\\("(dll-reference\\s('+h+'))"\\)\\)'+u,"g");s=g.exec(a);)A[s[2]]||(n[i].push(s[1]),A[s[2]]=t(s[1]).m),n[s[2]]=n[s[2]]||[],n[s[2]].push(s[4]);const c=Object.keys(n);for(let A=0;Ae||A[t].length>0),!1)}function x(A,e,t,i){const n=A[i].map((A=>`"${A}": ${e[i][A].toString()}`)).join(","),a=C.toString().split("ENTRY_MODULE");return`${a[0]}{${n}}${a[1]}"${t}"${a[2]}`}function p(A,e){e=e||{};const i={main:t.m},n=e.all?{main:Object.keys(i.main)}:function(A,e){const t={main:[e]},i={main:[]},n={main:{}};for(;Q(t);){const e=Object.keys(t);for(let a=0;a"main"!==A)).forEach((A=>{let e=0;for(;n[A][e];)e++;n[A].push(e),i[A][e]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",a+=`var ${A} = (${x(n,i,e,modules)})();\n`})),a+=`(${x(n,i,A,"main")})();`;const r=new window.Blob([a],{type:"text/javascript"});if(e.bare)return r;const o=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(r),s=new window.Worker(o);return s.objectURL=o,s}var m=t(641),y=t(976),_=t(716),S=t(825),D=function(){function A(A,e){if(this.TAG="Transmuxer",this._workerDestroying=!1,this._controller=null,this._emitter=new c.A,e.enableWorker&&"undefined"!=typeof Worker)try{this._worker=this._worker=p(291),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[A,e]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},m.A.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:m.A.getConfig()})}catch(t){l.A.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new y.A(A,e)}else this._controller=new y.A(A,e);if(this._controller){var t=this._controller;null==t||t.on(_.A.IO_ERROR,this._onIOError.bind(this)),null==t||t.on(_.A.DEMUX_ERROR,this._onDemuxError.bind(this)),null==t||t.on(_.A.INIT_SEGMENT,this._onInitSegment.bind(this)),null==t||t.on(_.A.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),null==t||t.on(_.A.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),null==t||t.on(_.A.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),null==t||t.on(_.A.MEDIA_INFO,this._onMediaInfo.bind(this)),null==t||t.on(_.A.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),null==t||t.on(_.A.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),null==t||t.on(_.A.TIMED_ID3_METADATA_ARRIVED,this._onTimedID3MetadataArrived.bind(this)),null==t||t.on(_.A.SMPTE2038_METADATA_ARRIVED,this._onSMPTE2038MetadataArrived.bind(this)),null==t||t.on(_.A.SCTE35_METADATA_ARRIVED,this._onSCTE35MetadataArrived.bind(this)),null==t||t.on(_.A.PES_PRIVATE_DATA_DESCRIPTOR,this._onPESPrivateDataDescriptor.bind(this)),null==t||t.on(_.A.PES_PRIVATE_DATA_ARRIVED,this._onPESPrivateDataArrived.bind(this)),null==t||t.on(_.A.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),null==t||t.on(_.A.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return A.prototype.destroy=function(){var A;this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),m.A.removeListener(this.e.onLoggingConfigChanged),this.e=null):(null===(A=this._controller)||void 0===A||A.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},A.prototype.on=function(A,e){this._emitter.addListener(A,e)},A.prototype.off=function(A,e){this._emitter.removeListener(A,e)},A.prototype.hasWorker=function(){return null!=this._worker},A.prototype.open=function(){var A;this._worker?this._worker.postMessage({cmd:"start"}):null===(A=this._controller)||void 0===A||A.start()},A.prototype.close=function(){var A;this._worker?this._worker.postMessage({cmd:"stop"}):null===(A=this._controller)||void 0===A||A.stop()},A.prototype.seek=function(A){var e;this._worker?this._worker.postMessage({cmd:"seek",param:A}):null===(e=this._controller)||void 0===e||e.seek(A)},A.prototype.pause=function(){var A;this._worker?this._worker.postMessage({cmd:"pause"}):null===(A=this._controller)||void 0===A||A.pause()},A.prototype.resume=function(){var A;this._worker?this._worker.postMessage({cmd:"resume"}):null===(A=this._controller)||void 0===A||A.resume()},A.prototype._onInitSegment=function(A,e){var t=this;Promise.resolve().then((function(){t._emitter.emit(_.A.INIT_SEGMENT,A,e)}))},A.prototype._onMediaSegment=function(A,e){var t=this;Promise.resolve().then((function(){t._emitter.emit(_.A.MEDIA_SEGMENT,A,e)}))},A.prototype._onLoadingComplete=function(){var A=this;Promise.resolve().then((function(){A._emitter.emit(_.A.LOADING_COMPLETE)}))},A.prototype._onRecoveredEarlyEof=function(){var A=this;Promise.resolve().then((function(){A._emitter.emit(_.A.RECOVERED_EARLY_EOF)}))},A.prototype._onMediaInfo=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.MEDIA_INFO,A)}))},A.prototype._onMetaDataArrived=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.METADATA_ARRIVED,A)}))},A.prototype._onScriptDataArrived=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.SCRIPTDATA_ARRIVED,A)}))},A.prototype._onTimedID3MetadataArrived=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.TIMED_ID3_METADATA_ARRIVED,A)}))},A.prototype._onSMPTE2038MetadataArrived=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.SMPTE2038_METADATA_ARRIVED,A)}))},A.prototype._onSCTE35MetadataArrived=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.SCTE35_METADATA_ARRIVED,A)}))},A.prototype._onPESPrivateDataDescriptor=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.PES_PRIVATE_DATA_DESCRIPTOR,A)}))},A.prototype._onPESPrivateDataArrived=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.PES_PRIVATE_DATA_ARRIVED,A)}))},A.prototype._onStatisticsInfo=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.STATISTICS_INFO,A)}))},A.prototype._onIOError=function(A,e){var t=this;Promise.resolve().then((function(){t._emitter.emit(_.A.IO_ERROR,A,e)}))},A.prototype._onDemuxError=function(A,e){var t=this;Promise.resolve().then((function(){t._emitter.emit(_.A.DEMUX_ERROR,A,e)}))},A.prototype._onRecommendSeekpoint=function(A){var e=this;Promise.resolve().then((function(){e._emitter.emit(_.A.RECOMMEND_SEEKPOINT,A)}))},A.prototype._onLoggingConfigChanged=function(A){this._worker&&this._worker.postMessage({cmd:"logging_config",param:A})},A.prototype._onWorkerMessage=function(A){var e=A.data,t=null==e?void 0:e.data;if("destroyed"===e.msg||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(e.msg){case _.A.INIT_SEGMENT:case _.A.MEDIA_SEGMENT:this._emitter.emit(e.msg,t.type,t.data);break;case _.A.LOADING_COMPLETE:case _.A.RECOVERED_EARLY_EOF:this._emitter.emit(e.msg);break;case _.A.MEDIA_INFO:Object.setPrototypeOf(t,S.A.prototype),this._emitter.emit(e.msg,t);break;case _.A.METADATA_ARRIVED:case _.A.SCRIPTDATA_ARRIVED:case _.A.TIMED_ID3_METADATA_ARRIVED:case _.A.SMPTE2038_METADATA_ARRIVED:case _.A.SCTE35_METADATA_ARRIVED:case _.A.PES_PRIVATE_DATA_DESCRIPTOR:case _.A.PES_PRIVATE_DATA_ARRIVED:case _.A.STATISTICS_INFO:this._emitter.emit(e.msg,t);break;case _.A.IO_ERROR:case _.A.DEMUX_ERROR:this._emitter.emit(e.msg,t.type,t.info);break;case _.A.RECOMMEND_SEEKPOINT:this._emitter.emit(e.msg,t);break;case"logcat_callback":l.A.emitter.emit("log",t.type,t.logcat)}},A}();const v=D,w="error",b="source_open",F="update_end",R="buffer_full";var k=t(453),P=t(713),N=function(){function A(A){this.TAG="MSEController",this._config=A,this._emitter=new c.A,this._config.isLive&&void 0===this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new k.EX}return A.prototype.destroy=function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},A.prototype.on=function(A,e){this._emitter.addListener(A,e)},A.prototype.off=function(A,e){this._emitter.removeListener(A,e)},A.prototype.attachMediaElement=function(A){if(this._mediaSource)throw new P.j4("MediaSource has been attached to an HTMLMediaElement!");var e=this._mediaSource=new window.MediaSource;e.addEventListener("sourceopen",this.e.onSourceOpen),e.addEventListener("sourceended",this.e.onSourceEnded),e.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=A,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),A.src=this._mediaSourceObjectURL},A.prototype.detachMediaElement=function(){if(this._mediaSource){var A=this._mediaSource;for(var e in this._sourceBuffers){var t=this._pendingSegments[e];t.splice(0,t.length),this._pendingSegments[e]=null,this._pendingRemoveRanges[e]=null,this._lastInitSegments[e]=null;var i=this._sourceBuffers[e];if(i){if("closed"!==A.readyState){try{A.removeSourceBuffer(i)}catch(A){l.A.e(this.TAG,A.message)}null==i||i.removeEventListener("error",this.e.onSourceBufferError),null==i||i.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[e]=null,this._sourceBuffers[e]=null}}if("open"===A.readyState)try{A.endOfStream()}catch(A){l.A.e(this.TAG,A.message)}A.removeEventListener("sourceopen",this.e.onSourceOpen),A.removeEventListener("sourceended",this.e.onSourceEnded),A.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)},A.prototype.appendInitSegment=function(A,e){var t;if(!this._mediaSource||"open"!==this._mediaSource.readyState)return this._pendingSourceBufferInit.push(A),void this._pendingSegments[A.type].push(A);var i=A,n="".concat(i.container);i.codec&&i.codec.length>0&&(n+=";codecs=".concat(i.codec));var a=!1;if(l.A.v(this.TAG,"Received Initialization Segment, mimeType: "+n),this._lastInitSegments[i.type]=i,n!==this._mimeTypes[i.type]){if(this._mimeTypes[i.type])l.A.v(this.TAG,"Notice: ".concat(i.type," mimeType changed, origin: ").concat(this._mimeTypes[i.type]||"",", target: ").concat(n));else{a=!0;try{var r=this._sourceBuffers[i.type]=this._mediaSource.addSourceBuffer(n);r.addEventListener("error",this.e.onSourceBufferError),r.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(A){return l.A.e(this.TAG,A.message),void this._emitter.emit(w,{code:A.code,msg:A.message})}}this._mimeTypes[i.type]=n}e||this._pendingSegments[i.type].push(i),a||this._sourceBuffers[i.type]&&!(null===(t=this._sourceBuffers[i.type])||void 0===t?void 0:t.updating)&&this._doAppendSegments(),I.A.safari&&"audio/mpeg"===i.container&&i.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=i.mediaDuration/1e3,this._updateMediaSourceDuration())},A.prototype.appendMediaSegment=function(A){var e=A;this._pendingSegments[e.type].push(e),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var t=this._sourceBuffers[e.type];!t||t.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()},A.prototype.seek=function(A){var e,t;for(var i in this._sourceBuffers)if(this._sourceBuffers[i]){var n=this._sourceBuffers[i];if("open"===(null===(e=this._mediaSource)||void 0===e?void 0:e.readyState))try{null==n||n.abort()}catch(A){l.A.e(this.TAG,A.message)}this._idrList.clear();var a=this._pendingSegments[i];if(a.splice(0,a.length),"closed"!==(null===(t=this._mediaSource)||void 0===t?void 0:t.readyState)){if(n){for(var r=0;r=1&&t-a.start(0)>=((null===(e=this._config)||void 0===e?void 0:e.autoCleanupMaxBackwardDuration)||0))return!0}}return!1},A.prototype._doCleanupSourceBuffer=function(){var A,e,t,i=null===(A=this._mediaElement)||void 0===A?void 0:A.currentTime;for(var n in this._sourceBuffers){var a=this._sourceBuffers[n];if(a){for(var r=a.buffered,o=!1,s=0;s=((null===(e=this._config)||void 0===e?void 0:e.autoCleanupMaxBackwardDuration)||0)){o=!0;var l=i-((null===(t=this._config)||void 0===t?void 0:t.autoCleanupMinBackwardDuration)||0);this._pendingRemoveRanges[n].push({start:g,end:l})}}else c0&&(isNaN(a)||r>a)&&(l.A.v(this.TAG,"Update MediaSource duration from ".concat(a," to ").concat(r)),this._mediaSource.duration=r),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},A.prototype._doRemoveRanges=function(){var A;for(var e in this._pendingRemoveRanges)if(this._sourceBuffers[e]&&!(null===(A=this._sourceBuffers[e])||void 0===A?void 0:A.updating))for(var t=this._sourceBuffers[e],i=this._pendingRemoveRanges[e];i.length&&!(null==t?void 0:t.updating);){var n=i.shift();null==t||t.remove(n.start,n.end)}},A.prototype._doAppendSegments=function(){var A,e,t,i=this._pendingSegments;for(var n in i)if(this._sourceBuffers[n]&&!(null===(A=this._sourceBuffers[n])||void 0===A?void 0:A.updating)&&i[n].length>0){var a=i[n].shift();if(null==a?void 0:a.timestampOffset){var r=(null===(e=this._sourceBuffers[n])||void 0===e?void 0:e.timestampOffset)||0,o=a.timestampOffset/1e3;Math.abs(r-o)>.1&&(l.A.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(r," to ").concat(o)),this._sourceBuffers[n]&&(this._sourceBuffers[n].timestampOffset=o)),delete a.timestampOffset}if(!a.data||0===a.data.byteLength)continue;try{null===(t=this._sourceBuffers[n])||void 0===t||t.appendBuffer(a.data),this._isBufferFull=!1,"video"===n&&a.hasOwnProperty("info")&&this._idrList.appendArray(a.info.syncPoints)}catch(A){this._pendingSegments[n].unshift(a),22===A.code?(this._isBufferFull||this._emitter.emit(R),this._isBufferFull=!0):(l.A.e(this.TAG,A.message),this._emitter.emit(w,{code:A.code,msg:A.message}))}}},A.prototype._onSourceOpen=function(){var A;if(l.A.v(this.TAG,"MediaSource onSourceOpen"),null===(A=this._mediaSource)||void 0===A||A.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var e=this._pendingSourceBufferInit;e.length;){var t=e.shift();this.appendInitSegment(t,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(b)},A.prototype._onSourceEnded=function(){l.A.v(this.TAG,"MediaSource onSourceEnded")},A.prototype._onSourceClose=function(){l.A.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&null!=this.e&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))},A.prototype._hasPendingSegments=function(){var A=this._pendingSegments;return A.video.length>0||A.audio.length>0},A.prototype._hasPendingRemoveRanges=function(){var A=this._pendingRemoveRanges;return A.video.length>0||A.audio.length>0},A.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(F)},A.prototype._onSourceBufferError=function(A){l.A.e(this.TAG,"SourceBuffer Error: ".concat(A))},A}();const T=N;var M=t(465),L={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},Y={NETWORK_EXCEPTION:g.Xv.EXCEPTION,NETWORK_STATUS_CODE_INVALID:g.Xv.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:g.Xv.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:g.Xv.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:M.A.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:M.A.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:M.A.CODEC_UNSUPPORTED},G=function(){function A(A,e){var t,i,n;this.TAG="MSEPlayer",this._type="MSEPlayer",this._emitter=new c.A,this._config=r(),"object"==typeof e&&Object.assign(this._config,e);var a=A.type.toLowerCase();if("mse"!==a&&"mpegts"!==a&&"m2ts"!==a&&"flv"!==a)throw new P.Qn("MSEPlayer requires an mpegts/m2ts/flv MediaDataSource input!");A.isLive&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=A,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var o=I.A.chrome&&(I.A.version&&(null===(t=I.A.version)||void 0===t?void 0:t.major)<50||I.A.version&&50===(null===(i=null===I.A||void 0===I.A?void 0:I.A.version)||void 0===i?void 0:i.major)&&((null===(n=null===I.A||void 0===I.A?void 0:I.A.version)||void 0===n?void 0:n.build)||-1)<2661);this._alwaysSeekKeyframe=!!(o||I.A.msedge||I.A.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return A.prototype.destroy=function(){this._emitter.emit(d.DESTROYING),null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},A.prototype.on=function(A,e){var t=this;A===d.MEDIA_INFO?null!=this._mediaInfo&&Promise.resolve().then((function(){t._emitter.emit(d.MEDIA_INFO,t.mediaInfo)})):A===d.STATISTICS_INFO&&null!=this._statisticsInfo&&Promise.resolve().then((function(){t._emitter.emit(d.STATISTICS_INFO,t.statisticsInfo)})),this._emitter.addListener(A,e)},A.prototype.off=function(A,e){this._emitter.removeListener(A,e)},A.prototype.attachMediaElement=function(A){var e,t,i,n,a,r=this;if(this._mediaElement=A,A.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),A.addEventListener("seeking",this.e.onvSeeking),A.addEventListener("canplay",this.e.onvCanPlay),A.addEventListener("stalled",this.e.onvStalled),A.addEventListener("progress",this.e.onvProgress),this._msectl=new T(this._config),null===(e=this._msectl)||void 0===e||e.on(F,this._onmseUpdateEnd.bind(this)),null===(t=this._msectl)||void 0===t||t.on(R,this._onmseBufferFull.bind(this)),null===(i=this._msectl)||void 0===i||i.on(b,(function(){r._mseSourceOpened=!0,r._hasPendingLoad&&(r._hasPendingLoad=!1,r.load())})),null===(n=this._msectl)||void 0===n||n.on(w,(function(A){r._emitter.emit(d.ERROR,L.MEDIA_ERROR,Y.MEDIA_MSE_ERROR,A)})),null===(a=this._msectl)||void 0===a||a.attachMediaElement(A),null!=this._pendingSeekTime)try{A.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(A){}},A.prototype.detachMediaElement=function(){var A;this._mediaElement&&(null===(A=this._msectl)||void 0===A||A.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)},A.prototype.load=function(){var A=this;if(!this._mediaElement)throw new P.j4("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new P.j4("MSEPlayer.load() has been called, please call unload() first!");this._hasPendingLoad||(!this._config.deferLoadAfterSourceOpen||this._mseSourceOpened?(this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new v(this._mediaDataSource,this._config),this._transmuxer.on(_.A.INIT_SEGMENT,(function(e,t){var i;null===(i=A._msectl)||void 0===i||i.appendInitSegment(t)})),this._transmuxer.on(_.A.MEDIA_SEGMENT,(function(e,t){var i,n,a;if(null===(i=A._msectl)||void 0===i||i.appendMediaSegment(t),A._config.lazyLoad&&!A._config.isLive){var r=null===(n=A._mediaElement)||void 0===n?void 0:n.currentTime;t.info.endDts>=1e3*(r+((null===(a=A._config)||void 0===a?void 0:a.lazyLoadMaxDuration)||0))&&null==A._progressChecker&&(l.A.v(A.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),A._suspendTransmuxer())}})),this._transmuxer.on(_.A.LOADING_COMPLETE,(function(){var e;null===(e=A._msectl)||void 0===e||e.endOfStream(),A._emitter.emit(d.LOADING_COMPLETE)})),this._transmuxer.on(_.A.RECOVERED_EARLY_EOF,(function(){A._emitter.emit(d.RECOVERED_EARLY_EOF)})),this._transmuxer.on(_.A.IO_ERROR,(function(e,t){A._emitter.emit(d.ERROR,L.NETWORK_ERROR,e,t)})),this._transmuxer.on(_.A.DEMUX_ERROR,(function(e,t){A._emitter.emit(d.ERROR,L.MEDIA_ERROR,e,{code:-1,msg:t})})),this._transmuxer.on(_.A.MEDIA_INFO,(function(e){A._mediaInfo=e,A._emitter.emit(d.MEDIA_INFO,Object.assign({},e))})),this._transmuxer.on(_.A.METADATA_ARRIVED,(function(e){A._emitter.emit(d.METADATA_ARRIVED,e)})),this._transmuxer.on(_.A.SCRIPTDATA_ARRIVED,(function(e){A._emitter.emit(d.SCRIPTDATA_ARRIVED,e)})),this._transmuxer.on(_.A.TIMED_ID3_METADATA_ARRIVED,(function(e){A._emitter.emit(d.TIMED_ID3_METADATA_ARRIVED,e)})),this._transmuxer.on(_.A.SMPTE2038_METADATA_ARRIVED,(function(e){A._emitter.emit(d.SMPTE2038_METADATA_ARRIVED,e)})),this._transmuxer.on(_.A.SCTE35_METADATA_ARRIVED,(function(e){A._emitter.emit(d.SCTE35_METADATA_ARRIVED,e)})),this._transmuxer.on(_.A.PES_PRIVATE_DATA_DESCRIPTOR,(function(e){A._emitter.emit(d.PES_PRIVATE_DATA_DESCRIPTOR,e)})),this._transmuxer.on(_.A.PES_PRIVATE_DATA_ARRIVED,(function(e){A._emitter.emit(d.PES_PRIVATE_DATA_ARRIVED,e)})),this._transmuxer.on(_.A.STATISTICS_INFO,(function(e){A._statisticsInfo=A._fillStatisticsInfo(e),A._emitter.emit(d.STATISTICS_INFO,Object.assign({},A._statisticsInfo))})),this._transmuxer.on(_.A.RECOMMEND_SEEKPOINT,(function(e){A._mediaElement&&!A._config.accurateSeek&&(A._requestSetTime=!0,A._mediaElement.currentTime=e/1e3)})),this._transmuxer.open()):this._hasPendingLoad=!0)},A.prototype.unload=function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)},A.prototype.play=function(){var A;return function(A,e,t,i){return new(t||(t=Promise))((function(n,a){function r(A){try{s(i.next(A))}catch(A){a(A)}}function o(A){try{s(i.throw(A))}catch(A){a(A)}}function s(A){var e;A.done?n(A.value):(e=A.value,e instanceof t?e:new t((function(A){A(e)}))).then(r,o)}s((i=i.apply(A,e||[])).next())}))}(this,void 0,void 0,(function(){return function(A,e){var t,i,n,a,r={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(o){return function(s){return function(o){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,o[0]&&(r=0)),r;)try{if(t=1,i&&(n=2&o[0]?i.return:o[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;switch(i=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return r.label++,{value:o[1],done:!1};case 5:r.label++,i=o[1],o=[0];continue;case 7:o=r.ops.pop(),r.trys.pop();continue;default:if(!((n=(n=r.trys).length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){r=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]0&&!(null===(t=this._mediaElement)||void 0===t?void 0:t.paused)){var r=n.end(n.length-1);if(r>((null===(i=this._config)||void 0===i?void 0:i.liveBufferLatencyMaxLatency)||0)&&r-a>(this._config.liveBufferLatencyMaxLatency||0)){var o=r-(this._config.liveBufferLatencyMinRemain||0);this.currentTime=o}}if(this._config.lazyLoad&&!this._config.isLive){for(var s=0,g=0;g=a+(this._config.lazyLoadMaxDuration||0)&&null==this._progressChecker&&(l.A.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},A.prototype._onmseBufferFull=function(){l.A.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()},A.prototype._suspendTransmuxer=function(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))},A.prototype._checkProgressAndResume=function(){for(var A,e,t,i=(null===(A=this._mediaElement)||void 0===A?void 0:A.currentTime)||0,n=null===(e=this._mediaElement)||void 0===e?void 0:e.buffered,a=!1,r=0;r=o&&i=s-(this._config.lazyLoadRecoverDuration||0)&&(a=!0);break}}a&&(window.clearInterval(this._progressChecker),this._progressChecker=null,a&&(l.A.v(this.TAG,"Continue loading from paused position"),null===(t=this._transmuxer)||void 0===t||t.resume()))},A.prototype._isTimepointBuffered=function(A){for(var e,t=null===(e=this._mediaElement)||void 0===e?void 0:e.buffered,i=0;i=n&&A0){var g=(null===(t=this._mediaElement)||void 0===t?void 0:t.buffered).start(0);(g<1&&A0&&e.currentTime0){var r=a.start(0);if(r<1&&n0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},A.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},A.prototype.play=function(){var A;return function(A,e,t,i){return new(t||(t=Promise))((function(n,a){function r(A){try{s(i.next(A))}catch(A){a(A)}}function o(A){try{s(i.throw(A))}catch(A){a(A)}}function s(A){var e;A.done?n(A.value):(e=A.value,e instanceof t?e:new t((function(A){A(e)}))).then(r,o)}s((i=i.apply(A,e||[])).next())}))}(this,void 0,void 0,(function(){return function(A,e){var t,i,n,a,r={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(o){return function(s){return function(o){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,o[0]&&(r=0)),r;)try{if(t=1,i&&(n=2&o[0]?i.return:o[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;switch(i=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return r.label++,{value:o[1],done:!1};case 5:r.label++,i=o[1],o=[0];continue;case 7:o=r.ops.pop(),r.trys.pop();continue;default:if(!((n=(n=r.trys).length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){r=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]{A.exports=t(133).default},302:(A,e,t)=>{t.d(e,{A:()=>f});var i=t(502);const n=function(){function A(){var A;this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,(null===(A=self.performance)||void 0===A?void 0:A.now)?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return A.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},A.prototype.addBytes=function(A){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=A,this._totalBytes+=A):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=A,this._totalBytes+=A):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=A,this._totalBytes+=A,this._lastCheckpoint=this._now())},Object.defineProperty(A.prototype,"currentKBps",{get:function(){this.addBytes(0);var A=(this._now()-this._lastCheckpoint)/1e3;return 0===A&&(A=1),this._intervalBytes/A/1024},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"lastSecondKBps",{get:function(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"averageKBps",{get:function(){var A=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/A/1024},enumerable:!1,configurable:!0}),A}();var a,r=t(288),o=t(620),s=t(713),g=(a=function(A,e){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])},a(A,e)},function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=A}a(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)});const c=function(A){function e(e,t){var i=A.call(this,"fetch-stream-loader")||this;return i.TAG="FetchStreamLoader",i._seekHandler=e,i._config=t,i._needStash=!0,i._requestAbort=!1,i._abortController=null,i._contentLength=null,i._receivedLength=0,i}return g(e,A),e.isSupported=function(){var A;try{var e=o.A.msedge&&((null===(A=null===o.A||void 0===o.A?void 0:o.A.version)||void 0===A?void 0:A.minor)||0)>=15048&&!o.A.webkit,t=!o.A.msedge||e;return self.fetch&&self.ReadableStream&&t}catch(A){return!1}},e.prototype.destroy=function(){this.isWorking()&&this.abort(),A.prototype.destroy.call(this)},e.prototype.open=function(A,e){var t=this;this._dataSource=A,this._range=e;var i=A.url;this._config.reuseRedirectedURL&&void 0!==A.redirectedURL&&(i=A.redirectedURL);var n=this._seekHandler.getConfig(i,e),a=new self.Headers;if("object"==typeof n.headers){var o=n.headers;for(var g in o)o.hasOwnProperty(g)&&a.append(g,o[g])}var c={method:"GET",headers:a,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"==typeof this._config.headers)for(var g in this._config.headers)a.append(g,this._config.headers[g]);A.cors||(c.mode="same-origin"),A.withCredentials&&(c.credentials="include"),(null==A?void 0:A.referrerPolicy)&&(c.referrerPolicy=A.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,this._abortController&&(c.signal=this._abortController.signal)),this._status=r.eO.kConnecting,self.fetch(n.url,c).then((function(A){var e,i;if(t._requestAbort)return t._status=r.eO.kIdle,void(null===(e=A.body)||void 0===e||e.cancel());if(A.ok&&A.status>=200&&A.status<=299){if(A.url!==n.url&&t._onURLRedirect){var a=t._seekHandler.removeURLParameters(A.url);t._onURLRedirect(a)}var o=A.headers.get("Content-Length");return null!=o&&(t._contentLength=parseInt(o),0!==t._contentLength&&t._onContentLengthKnown&&t._onContentLengthKnown(t._contentLength)),t._pump.call(t,null===(i=A.body)||void 0===i?void 0:i.getReader())}if(t._status=r.eO.kError,!t._onError)throw new s.Al("FetchStreamLoader: Http code invalid, "+A.status+" "+A.statusText);t._onError(r.Xv.HTTP_STATUS_CODE_INVALID,{code:A.status,msg:A.statusText})})).catch((function(A){var e;if(!(null===(e=t._abortController)||void 0===e?void 0:e.signal.aborted)){if(t._status=r.eO.kError,!t._onError)throw A;t._onError(r.Xv.EXCEPTION,{code:-1,msg:A.message})}}))},e.prototype.abort=function(){var A;if(this._requestAbort=!0,(this._status!==r.eO.kBuffering||!o.A.chrome)&&this._abortController)try{null===(A=this._abortController)||void 0===A||A.abort()}catch(A){}},e.prototype._pump=function(A){var e=this;return A.read().then((function(t){var i,n,a,o;if(t.done)if(null!==e._contentLength&&e._receivedLength299)){if(this._status=r.eO.kError,!this._onError)throw new s.Al("MozChunkedLoader: Http code invalid, "+e.status+" "+e.statusText);this._onError(r.Xv.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})}else this._status=r.eO.kBuffering}},e.prototype._onProgress=function(A){var e;if(this._status!==r.eO.kError){null===this._contentLength&&null!==A.total&&0!==A.total&&(this._contentLength=A.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var t=A.target.response,i=((null===(e=this._range)||void 0===e?void 0:e.from)||0)+this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,i,this._receivedLength)}},e.prototype._onLoadEnd=function(A){this._requestAbort?this._requestAbort=!1:this._status!==r.eO.kError&&(this._status=r.eO.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))},e.prototype._onXhrError=function(A){this._status=r.eO.kError;var e=0,t=null;if(this._contentLength&&A.loaded=this._contentLength&&(n=((null===(e=this._range)||void 0===e?void 0:e.from)||0)+this._contentLength-1),this._currentRequestRange={from:i,to:n},this._internalOpen(this._dataSource,this._currentRequestRange)},e.prototype._internalOpen=function(A,e){this._lastTimeLoaded=0;var t=A.url;this._config.reuseRedirectedURL&&(null!=this._currentRedirectedURL?t=this._currentRedirectedURL:null!=A.redirectedURL&&(t=A.redirectedURL));var i=this._seekHandler.getConfig(t,e);this._currentRequestURL=i.url;var n=this._xhr=new XMLHttpRequest;if(n.open("GET",i.url,!0),n.responseType="arraybuffer",n.onreadystatechange=this._onReadyStateChange.bind(this),n.onprogress=this._onProgress.bind(this),n.onload=this._onLoad.bind(this),n.onerror=this._onXhrError.bind(this),A.withCredentials&&(n.withCredentials=!0),"object"==typeof i.headers){var a=i.headers;for(var r in a)a.hasOwnProperty(r)&&n.setRequestHeader(r,a[r])}if("object"==typeof this._config.headers)for(var r in a=this._config.headers)a.hasOwnProperty(r)&&n.setRequestHeader(r,a[r]);n.send()},e.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=r.eO.kComplete},e.prototype._internalAbort=function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)},e.prototype._onReadyStateChange=function(A){var e=A.target;if(2===e.readyState){if(null!=e.responseURL){var t=this._seekHandler.removeURLParameters(e.responseURL);e.responseURL!==this._currentRequestURL&&t!==this._currentRedirectedURL&&(this._currentRedirectedURL=t,this._onURLRedirect&&this._onURLRedirect(t))}if(e.status>=200&&e.status<=299){if(this._waitForTotalLength)return;this._status=r.eO.kBuffering}else{if(this._status=r.eO.kError,!this._onError)throw new s.Al("RangeLoader: Http code invalid, "+e.status+" "+e.statusText);this._onError(r.Xv.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})}}},e.prototype._onProgress=function(A){if(this._status!==r.eO.kError){if(null===this._contentLength){var e=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,e=!0;var t=A.total;this._internalAbort(),null!=t&&0!==t&&(this._totalLength=t)}if(-1===this._range.to?this._contentLength=(this._totalLength||0)-this._range.from:this._contentLength=this._range.to-this._range.from+1,e)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var i=A.loaded-this._lastTimeLoaded;this._lastTimeLoaded=A.loaded,this._speedSampler.addBytes(i)}},e.prototype._normalizeSpeed=function(A){var e=this._chunkSizeKBList,t=e.length-1,i=0,n=0,a=t;if(A=e[i]&&A=3&&(e=this._speedSampler.currentKBps)),0!==e){var t=this._normalizeSpeed(e);this._currentSpeedNormalized!==t&&(this._currentSpeedNormalized=t,this._currentChunkSizeKB=t)}var i=A.target.response,n=this._range.from+this._receivedLength;this._receivedLength+=i.byteLength;var a=!1;null!=this._contentLength&&this._receivedLength0&&this._receivedLength0)for(var a=e.split("&"),r=0;r0;o[0]!==this._startName&&o[0]!==this._endName&&(s&&(n+="&"),n+=a[r])}return 0===n.length?t:t+"?"+n},A}(),f=function(){function A(A,e,t){this.TAG="IOController",this._config=e,this._extraData=t,this._stashInitialSize=65536,void 0!==e.stashInitialSize&&e.stashInitialSize>0&&(this._stashInitialSize=e.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,e.enableStashBuffer||(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=A,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(A.url||""),this._refTotalLength=A.filesize?A.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new n,this._speedNormalizeList=[32,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return A.prototype.destroy=function(){var A,e,t;(null===(A=this._loader)||void 0===A?void 0:A.isWorking())&&(null===(e=this._loader)||void 0===e||e.abort()),null===(t=this._loader)||void 0===t||t.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null},A.prototype.isWorking=function(){var A;return(null===(A=this._loader)||void 0===A?void 0:A.isWorking())&&!this._paused},A.prototype.isPaused=function(){return this._paused},Object.defineProperty(A.prototype,"status",{get:function(){var A;return null===(A=this._loader)||void 0===A?void 0:A.status},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"extraData",{get:function(){return this._extraData},set:function(A){this._extraData=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(A){this._onDataArrival=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(A){this._onSeeked=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onError",{get:function(){return this._onError},set:function(A){this._onError=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onComplete",{get:function(){return this._onComplete},set:function(A){this._onComplete=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(A){this._onRedirect=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(A){this._onRecoveredEarlyEof=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"currentURL",{get:function(){var A;return null===(A=this._dataSource)||void 0===A?void 0:A.url},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"hasRedirect",{get:function(){var A;return null!=this._redirectedURL||void 0!==(null===(A=this._dataSource)||void 0===A?void 0:A.redirectedURL)},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"currentRedirectedURL",{get:function(){var A;return this._redirectedURL||(null===(A=this._dataSource)||void 0===A?void 0:A.redirectedURL)},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"currentSpeed",{get:function(){var A,e;return this._loaderClass===C?null===(A=this._loader)||void 0===A?void 0:A.currentSpeed:null===(e=this._speedSampler)||void 0===e?void 0:e.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"loaderType",{get:function(){var A;return null===(A=this._loader)||void 0===A?void 0:A.type},enumerable:!1,configurable:!0}),A.prototype._selectSeekHandler=function(){var A=this._config;if("range"===A.seekType)this._seekHandler=new B(!!this._config.rangeLoadZeroStart);else if("param"===A.seekType){var e=A.seekParamStart||"bstart",t=A.seekParamEnd||"bend";this._seekHandler=new E(e,t)}else{if("custom"!==A.seekType)throw new s.Qn("Invalid seekType in config: ".concat((null==A?void 0:A.seekType)||""));if("function"!=typeof A.customSeekHandler)throw new s.Qn("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new A.customSeekHandler}},A.prototype._selectLoader=function(){var A;if(null!=this._config.customLoader)this._loaderClass=(null===(A=this._config)||void 0===A?void 0:A.customLoader)||null;else if(this._isWebSocketURL)this._loaderClass=u;else if(c.isSupported())this._loaderClass=c;else if(I.isSupported())this._loaderClass=I;else{if(!C.isSupported())throw new s.Al("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=C}},A.prototype._createLoader=function(){var A;this._loaderClass&&(this._loader=new this._loaderClass(this._seekHandler,this._config),(null===(A=this._loader)||void 0===A?void 0:A.needStashBuffer)||(this._enableStash=!1),this._loader&&(this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)))},A.prototype.open=function(A){var e,t;this._currentRange={from:0,to:-1},A&&(this._currentRange.from=A),null===(e=this._speedSampler)||void 0===e||e.reset(),A||(this._fullRequestFlag=!0),null===(t=this._loader)||void 0===t||t.open(this._dataSource,Object.assign({},this._currentRange))},A.prototype.abort=function(){var A;null===(A=this._loader)||void 0===A||A.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},A.prototype.pause=function(){var A,e;this.isWorking()&&(null===(A=this._loader)||void 0===A||A.abort(),0!==this._stashUsed?(this._resumeFrom=this._stashByteStart,this._currentRange&&(this._currentRange.to=this._stashByteStart-1)):this._resumeFrom=((null===(e=this._currentRange)||void 0===e?void 0:e.to)||0)+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)},A.prototype.resume=function(){if(this._paused){this._paused=!1;var A=this._resumeFrom;this._resumeFrom=0,this._internalSeek(A,!0)}},A.prototype.seek=function(A){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(A,!0)},A.prototype._internalSeek=function(A,e){var t,i,n,a;(null===(t=this._loader)||void 0===t?void 0:t.isWorking())&&(null===(i=this._loader)||void 0===i||i.abort()),this._flushStashBuffer(e),null===(n=this._loader)||void 0===n||n.destroy(),this._loader=null;var r={from:A,to:-1};this._currentRange={from:r.from,to:-1},null===(a=this._speedSampler)||void 0===a||a.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,r),this._onSeeked&&this._onSeeked()},A.prototype.updateUrl=function(A){if(!A||"string"!=typeof A||0===A.length)throw new s.Qn("Url must be a non-empty string!");this._dataSource.url=A},A.prototype._expandBuffer=function(A){for(var e=this._stashSize;e+10485760){var i=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(t,0,e).set(i,0)}this._stashBuffer=t,this._bufferSize=e}},A.prototype._normalizeSpeed=function(A){var e=this._speedNormalizeList,t=e.length-1,i=0,n=0,a=t;if(A=e[i]&&A=512&&A<=1024?Math.floor(1.5*A):2*A)>8192&&(e=8192);var t=1024*e+1048576;this._bufferSize0){var o=this._stashBuffer.slice(0,this._stashUsed);(l=this._dispatchChunks(o,this._stashByteStart))0&&(I=new Uint8Array(o,l),c.set(I,0),this._stashUsed=I.byteLength,this._stashByteStart+=l):(this._stashUsed=0,this._stashByteStart+=l),this._stashUsed+A.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+A.byteLength),c=new Uint8Array(this._stashBuffer,0,this._bufferSize)),c.set(new Uint8Array(A),this._stashUsed),this._stashUsed+=A.byteLength}else(l=this._dispatchChunks(A,e))this._bufferSize&&(this._expandBuffer(g),c=new Uint8Array(this._stashBuffer,0,this._bufferSize)),c.set(new Uint8Array(A,l),0),this._stashUsed+=g,this._stashByteStart=e+l);else if(0===this._stashUsed){var g;(l=this._dispatchChunks(A,e))this._bufferSize&&this._expandBuffer(g),(c=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(A,l),0),this._stashUsed+=g,this._stashByteStart=e+l)}else{var c,l;if(this._stashUsed+A.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+A.byteLength),(c=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(A),this._stashUsed),this._stashUsed+=A.byteLength,(l=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart))0){var I=new Uint8Array(this._stashBuffer,l);c.set(I,0)}this._stashUsed-=l,this._stashByteStart+=l}}},A.prototype._flushStashBuffer=function(A){if(this._stashUsed>0){var e=this._stashBuffer.slice(0,this._stashUsed),t=this._dispatchChunks(e,this._stashByteStart),n=e.byteLength-t;if(t0){var a=new Uint8Array(this._stashBuffer,0,this._bufferSize),r=new Uint8Array(e,t);a.set(r,0),this._stashUsed=r.byteLength,this._stashByteStart+=t}return 0}i.A.w(this.TAG,"".concat(n," bytes unconsumed data remain when flush buffer, dropped"))}return this._stashUsed=0,this._stashByteStart=0,n}return 0},A.prototype._onLoaderComplete=function(A,e){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},A.prototype._onLoaderError=function(A,e){var t;switch(i.A.e(this.TAG,"Loader error, code = ".concat(e.code,", msg = ").concat(e.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,A=r.Xv.UNRECOVERABLE_EARLY_EOF),A){case r.Xv.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var n=((null===(t=this._currentRange)||void 0===t?void 0:t.to)||0)+1;return void(n{t.d(e,{HC:()=>r,Xv:()=>a,eO:()=>n});var i=t(713),n={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},a={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},r=function(){function A(A){this._type=A||"undefined",this._status=n.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return A.prototype.destroy=function(){this._status=n.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},A.prototype.isWorking=function(){return this._status===n.kConnecting||this._status===n.kBuffering},Object.defineProperty(A.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(A){this._onContentLengthKnown=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(A){this._onURLRedirect=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(A){this._onDataArrival=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onError",{get:function(){return this._onError},set:function(A){this._onError=A},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onComplete",{get:function(){return this._onComplete},set:function(A){this._onComplete=A},enumerable:!1,configurable:!0}),A.prototype.open=function(A,e){throw new i.Xu("Unimplemented abstract function!")},A.prototype.abort=function(){throw new i.Xu("Unimplemented abstract function!")},A}()},620:(A,e,t)=>{t.d(e,{A:()=>n});var i={};!function(){var A=self.navigator.userAgent.toLowerCase(),e=/(edge)\/([\w.]+)/.exec(A)||/(opr)[\/]([\w.]+)/.exec(A)||/(chrome)[ \/]([\w.]+)/.exec(A)||/(iemobile)[\/]([\w.]+)/.exec(A)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(A)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(A)||/(webkit)[ \/]([\w.]+)/.exec(A)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(A)||/(msie) ([\w.]+)/.exec(A)||A.includes("trident")&&/(rv)(?::| )([\w.]+)/.exec(A)||!A.includes("compatible")&&/(firefox)[ \/]([\w.]+)/.exec(A)||[],t=/(ipad)/.exec(A)||/(ipod)/.exec(A)||/(windows phone)/.exec(A)||/(iphone)/.exec(A)||/(kindle)/.exec(A)||/(android)/.exec(A)||/(windows)/.exec(A)||/(mac)/.exec(A)||/(linux)/.exec(A)||/(cros)/.exec(A)||[],n={browser:e[5]||e[3]||e[1]||"",version:e[2]||e[4]||"0",majorVersion:e[4]||e[2]||"0",platform:t[0]||""},a={};if(n.browser){a[n.browser]=!0;var r=n.majorVersion.split(".");a.version={major:parseInt(n.majorVersion,10),string:n.version},r.length>1&&(a.version.minor=parseInt(r[1],10)),r.length>2&&(a.version.build=parseInt(r[2],10))}if(n.platform&&(a[n.platform]=!0),(a.chrome||a.opr||a.safari)&&(a.webkit=!0),a.rv||a.iemobile){a.rv&&delete a.rv;var o="msie";n.browser=o,a[o]=!0}if(a.edge){delete a.edge;var s="msedge";n.browser=s,a[s]=!0}if(a.opr){var g="opera";n.browser=g,a[g]=!0}if(a.safari&&a.android){var c="android";n.browser=c,a[c]=!0}for(var l in a.name=n.browser,a.platform=n.platform,i)Object.prototype.hasOwnProperty.call(i,l)&&delete i[l];Object.assign(i,a)}();const n=i},713:(A,e,t)=>{t.d(e,{Al:()=>a,Qn:()=>o,Xu:()=>s,j4:()=>r});var i,n=(i=function(A,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])},i(A,e)},function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=A}i(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}),a=function(){function A(A){this.name="RuntimeException",this._message=A}return Object.defineProperty(A.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),A.prototype.toString=function(){return this.name+": "+this.message},A}(),r=function(A){function e(e){var t=A.call(this,e)||this;return t.name="IllegalStateException",t}return n(e,A),e}(a),o=function(A){function e(e){var t=A.call(this,e)||this;return t.name="InvalidArgumentException",t}return n(e,A),e}(a),s=function(A){function e(e){var t=A.call(this,e)||this;return t.name="NotImplementedException",t}return n(e,A),e}(a)},502:(A,e,t)=>{t.d(e,{A:()=>n});var i=t(413);const n=function(){function A(){}return A.e=function(e,t){var i;e&&!A.FORCE_GLOBAL_TAG||(e=A.GLOBAL_TAG);var n="[".concat(e,"] > ").concat(t);A.ENABLE_CALLBACK&&(null===(i=A.emitter)||void 0===i||i.emit("log","error",n)),A.ENABLE_ERROR&&(console.error?console.error(n):console.warn?console.warn(n):console.log(n))},A.i=function(e,t){e&&!A.FORCE_GLOBAL_TAG||(e=A.GLOBAL_TAG);var i="[".concat(e,"] > ").concat(t);A.ENABLE_CALLBACK&&A.emitter.emit("log","info",i),A.ENABLE_INFO&&(console.info?console.info(i):console.log(i))},A.w=function(e,t){e&&!A.FORCE_GLOBAL_TAG||(e=A.GLOBAL_TAG);var i="[".concat(e,"] > ").concat(t);A.ENABLE_CALLBACK&&A.emitter.emit("log","warn",i),A.ENABLE_WARN&&(console.warn?console.warn(i):console.log(i))},A.d=function(e,t){var i;e&&!A.FORCE_GLOBAL_TAG||(e=A.GLOBAL_TAG);var n="[".concat(e,"] > ").concat(t);A.ENABLE_CALLBACK&&(null===(i=A.emitter)||void 0===i||i.emit("log","debug",n)),A.ENABLE_DEBUG&&(console.debug?console.debug(n):console.log(n))},A.v=function(e,t){var i;e&&!A.FORCE_GLOBAL_TAG||(e=A.GLOBAL_TAG);var n="[".concat(e,"] > ").concat(t);A.ENABLE_CALLBACK&&(null===(i=A.emitter)||void 0===i||i.emit("log","verbose",n)),A.ENABLE_VERBOSE&&console.log(n)},A.FORCE_GLOBAL_TAG=!1,A.GLOBAL_TAG="ezuikit-flv",A.ENABLE_CALLBACK=!1,A.emitter=new i.A,A.ENABLE_ERROR=!0,A.ENABLE_INFO=!0,A.ENABLE_WARN=!0,A.ENABLE_DEBUG=!0,A.ENABLE_VERBOSE=!0,A}()},641:(A,e,t)=>{t.d(e,{A:()=>a});var i=t(413),n=t(502);const a=function(){function A(){}return Object.defineProperty(A,"forceGlobalTag",{get:function(){return n.A.FORCE_GLOBAL_TAG},set:function(e){n.A.FORCE_GLOBAL_TAG=e,A._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(A,"globalTag",{get:function(){return n.A.GLOBAL_TAG},set:function(e){n.A.GLOBAL_TAG=e,A._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(A,"enableAll",{get:function(){return n.A.ENABLE_VERBOSE&&n.A.ENABLE_DEBUG&&n.A.ENABLE_INFO&&n.A.ENABLE_WARN&&n.A.ENABLE_ERROR},set:function(e){n.A.ENABLE_VERBOSE=e,n.A.ENABLE_DEBUG=e,n.A.ENABLE_INFO=e,n.A.ENABLE_WARN=e,n.A.ENABLE_ERROR=e,A._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(A,"enableDebug",{get:function(){return n.A.ENABLE_DEBUG},set:function(e){n.A.ENABLE_DEBUG=e,A._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(A,"enableVerbose",{get:function(){return n.A.ENABLE_VERBOSE},set:function(e){n.A.ENABLE_VERBOSE=e,A._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(A,"enableInfo",{get:function(){return n.A.ENABLE_INFO},set:function(e){n.A.ENABLE_INFO=e,A._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(A,"enableWarn",{get:function(){return n.A.ENABLE_WARN},set:function(e){n.A.ENABLE_WARN=e,A._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(A,"enableError",{get:function(){return n.A.ENABLE_ERROR},set:function(e){n.A.ENABLE_ERROR=e,A._notifyChange()},enumerable:!1,configurable:!0}),A.getConfig=function(){return{globalTag:n.A.GLOBAL_TAG,forceGlobalTag:n.A.FORCE_GLOBAL_TAG,enableVerbose:n.A.ENABLE_VERBOSE,enableDebug:n.A.ENABLE_DEBUG,enableInfo:n.A.ENABLE_INFO,enableWarn:n.A.ENABLE_WARN,enableError:n.A.ENABLE_ERROR,enableCallback:n.A.ENABLE_CALLBACK}},A.applyConfig=function(A){n.A.GLOBAL_TAG=A.globalTag,n.A.FORCE_GLOBAL_TAG=A.forceGlobalTag,n.A.ENABLE_VERBOSE=A.enableVerbose,n.A.ENABLE_DEBUG=A.enableDebug,n.A.ENABLE_INFO=A.enableInfo,n.A.ENABLE_WARN=A.enableWarn,n.A.ENABLE_ERROR=A.enableError,n.A.ENABLE_CALLBACK=!!A.enableCallback},A._notifyChange=function(){var e=A.emitter;if(e.listenerCount("change")>0){var t=A.getConfig();e.emit("change",t)}},A.registerListener=function(e){A.emitter.addListener("change",e)},A.removeListener=function(e){A.emitter.removeListener("change",e)},A.addLogListener=function(e){n.A.emitter.addListener("log",e),n.A.emitter.listenerCount("log")>0&&(n.A.ENABLE_CALLBACK=!0,A._notifyChange())},A.removeLogListener=function(e){n.A.emitter.removeListener("log",e),0===n.A.emitter.listenerCount("log")&&(n.A.ENABLE_CALLBACK=!1,A._notifyChange())},A.emitter=new i.A,A}()},413:(A,e,t)=>{t.d(e,{A:()=>i});const i=t(343)}},e={};function t(i){var n=e[i];if(void 0!==n)return n.exports;var a=e[i]={exports:{}};return A[i](a,a.exports,t),a.exports}return t.m=A,t.d=(A,e)=>{for(var i in e)t.o(e,i)&&!t.o(A,i)&&Object.defineProperty(A,i,{enumerable:!0,get:e[i]})},t.o=(A,e)=>Object.prototype.hasOwnProperty.call(A,e),t(446)})()))}(k);var P=F(k.exports);window.flvjs=P;var N=function(){return a((function A(e,i){t(this,A),console.log("isSupportFlv",window.flvjs.isSupported()),window.flvjs.isSupported()&&this.initFLV(e,i)}),[{key:"toString",value:function(){return"Flv ".concat(this.coreX,"-").concat(this.coreY)}},{key:"initFLV",value:function(A,e){var t=_(e),i=t.deviceSerial,n=t.channelNo;t.hd;var a=t.type;window.ezuikitMonitor.report({protocol:"flv",url:e,serial:i,no:n,action:1,logInfo:{type:a}});var r=document.getElementById(A);r.getAttribute("controls")||r.setAttribute("controls",!0);var o=window.flvjs.createPlayer({type:"flv",url:e,isLive:!0},{enableStashBuffer:!0,stashInitialSize:128,enableWorker:!0});o.attachMediaElement(r),o.load(),o.play(),this.flvUrl=e,this.flv=o,this.video=r,this.video.addEventListener("oncanplaythrough",(function(){console.log("oncanplaythrough")}),!1),this.video.addEventListener("onerror",(function(){console.log("onerror")}),!1)}},{key:"play",value:function(){console.log("执行flv播放",this.video),this.video.play()}},{key:"stop",value:function(){this.video.pause(),this.flv.unload()}},{key:"destroy",value:function(){void 0!==this.flv&&null!==this.flv&&(this.flv.pause(),this.flv.unload(),this.flv.detachMediaElement(),this.flv.destroy(),this.flv=null)}}])}();!function(){function A(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function e(A,e){for(var t=0;t"']/g,Z=RegExp(j.source),X=RegExp(W.source),q=/<%-([\s\S]+?)%>/g,z=/<%([\s\S]+?)%>/g,$=/<%=([\s\S]+?)%>/g,AA=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,eA=/^\w*$/,tA=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,iA=/[\\^$.*+?()[\]{}|]/g,nA=RegExp(iA.source),aA=/^\s+/,rA=/\s/,oA=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,sA=/\{\n\/\* \[wrapped with (.+)\] \*/,gA=/,? & /,cA=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lA=/[()=,{}\[\]\/\s]/,IA=/\\(\\)?/g,dA=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,CA=/\w*$/,hA=/^[-+]0x[0-9a-f]+$/i,uA=/^0b[01]+$/i,BA=/^\[object .+?Constructor\]$/,EA=/^0o[0-7]+$/i,fA=/^(?:0|[1-9]\d*)$/,QA=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xA=/($^)/,pA=/['\n\r\u2028\u2029\\]/g,mA="\\ud800-\\udfff",yA="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",_A="\\u2700-\\u27bf",SA="a-z\\xdf-\\xf6\\xf8-\\xff",DA="A-Z\\xc0-\\xd6\\xd8-\\xde",vA="\\ufe0e\\ufe0f",wA="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",bA="['’]",FA="["+mA+"]",RA="["+wA+"]",kA="["+yA+"]",PA="\\d+",NA="["+_A+"]",TA="["+SA+"]",MA="[^"+mA+wA+PA+_A+SA+DA+"]",LA="\\ud83c[\\udffb-\\udfff]",YA="[^"+mA+"]",GA="(?:\\ud83c[\\udde6-\\uddff]){2}",UA="[\\ud800-\\udbff][\\udc00-\\udfff]",JA="["+DA+"]",HA="\\u200d",KA="(?:"+TA+"|"+MA+")",VA="(?:"+JA+"|"+MA+")",OA="(?:['’](?:d|ll|m|re|s|t|ve))?",jA="(?:['’](?:D|LL|M|RE|S|T|VE))?",WA="(?:"+kA+"|"+LA+")"+"?",ZA="["+vA+"]?",XA=ZA+WA+("(?:"+HA+"(?:"+[YA,GA,UA].join("|")+")"+ZA+WA+")*"),qA="(?:"+[NA,GA,UA].join("|")+")"+XA,zA="(?:"+[YA+kA+"?",kA,GA,UA,FA].join("|")+")",$A=RegExp(bA,"g"),Ae=RegExp(kA,"g"),ee=RegExp(LA+"(?="+LA+")|"+zA+XA,"g"),te=RegExp([JA+"?"+TA+"+"+OA+"(?="+[RA,JA,"$"].join("|")+")",VA+"+"+jA+"(?="+[RA,JA+KA,"$"].join("|")+")",JA+"?"+KA+"+"+OA,JA+"+"+jA,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",PA,qA].join("|"),"g"),ie=RegExp("["+HA+mA+yA+vA+"]"),ne=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ae=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],re=-1,oe={};oe[N]=oe[T]=oe[M]=oe[L]=oe[Y]=oe[G]=oe[U]=oe[J]=oe[H]=!0,oe[u]=oe[B]=oe[k]=oe[E]=oe[P]=oe[f]=oe[Q]=oe[x]=oe[m]=oe[y]=oe[_]=oe[D]=oe[v]=oe[w]=oe[R]=!1;var se={};se[u]=se[B]=se[k]=se[P]=se[E]=se[f]=se[N]=se[T]=se[M]=se[L]=se[Y]=se[m]=se[y]=se[_]=se[D]=se[v]=se[w]=se[F]=se[G]=se[U]=se[J]=se[H]=!0,se[Q]=se[x]=se[R]=!1;var ge={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ce=parseFloat,le=parseInt,Ie="object"==typeof b&&b&&b.Object===Object&&b,de="object"==typeof self&&self&&self.Object===Object&&self,Ce=Ie||de||Function("return this")(),he=e&&!e.nodeType&&e,ue=he&&A&&!A.nodeType&&A,Be=ue&&ue.exports===he,Ee=Be&&Ie.process,fe=function(){try{var A=ue&&ue.require&&ue.require("util").types;return A||Ee&&Ee.binding&&Ee.binding("util")}catch(A){}}(),Qe=fe&&fe.isArrayBuffer,xe=fe&&fe.isDate,pe=fe&&fe.isMap,me=fe&&fe.isRegExp,ye=fe&&fe.isSet,_e=fe&&fe.isTypedArray;function Se(A,e,t){switch(t.length){case 0:return A.call(e);case 1:return A.call(e,t[0]);case 2:return A.call(e,t[0],t[1]);case 3:return A.call(e,t[0],t[1],t[2])}return A.apply(e,t)}function De(A,e,t,i){for(var n=-1,a=null==A?0:A.length;++n-1}function ke(A,e,t){for(var i=-1,n=null==A?0:A.length;++i-1;);return t}function tt(A,e){for(var t=A.length;t--&&Je(e,A[t],0)>-1;);return t}var it=je({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),nt=je({"&":"&","<":"<",">":">",'"':""","'":"'"});function at(A){return"\\"+ge[A]}function rt(A){return ie.test(A)}function ot(A){var e=-1,t=Array(A.size);return A.forEach((function(A,i){t[++e]=[i,A]})),t}function st(A,e){return function(t){return A(e(t))}}function gt(A,e){for(var t=-1,i=A.length,n=0,r=[];++t",""":'"',"'":"'"});var ut=function A(e){var b,rA=(e=null==e?Ce:ut.defaults(Ce.Object(),e,ut.pick(Ce,ae))).Array,mA=e.Date,yA=e.Error,_A=e.Function,SA=e.Math,DA=e.Object,vA=e.RegExp,wA=e.String,bA=e.TypeError,FA=rA.prototype,RA=_A.prototype,kA=DA.prototype,PA=e["__core-js_shared__"],NA=RA.toString,TA=kA.hasOwnProperty,MA=0,LA=(b=/[^.]+$/.exec(PA&&PA.keys&&PA.keys.IE_PROTO||""))?"Symbol(src)_1."+b:"",YA=kA.toString,GA=NA.call(DA),UA=Ce._,JA=vA("^"+NA.call(TA).replace(iA,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),HA=Be?e.Buffer:t,KA=e.Symbol,VA=e.Uint8Array,OA=HA?HA.allocUnsafe:t,jA=st(DA.getPrototypeOf,DA),WA=DA.create,ZA=kA.propertyIsEnumerable,XA=FA.splice,qA=KA?KA.isConcatSpreadable:t,zA=KA?KA.iterator:t,ee=KA?KA.toStringTag:t,ie=function(){try{var A=Ia(DA,"defineProperty");return A({},"",{}),A}catch(A){}}(),ge=e.clearTimeout!==Ce.clearTimeout&&e.clearTimeout,Ie=mA&&mA.now!==Ce.Date.now&&mA.now,de=e.setTimeout!==Ce.setTimeout&&e.setTimeout,he=SA.ceil,ue=SA.floor,Ee=DA.getOwnPropertySymbols,fe=HA?HA.isBuffer:t,Ye=e.isFinite,je=FA.join,Bt=st(DA.keys,DA),Et=SA.max,ft=SA.min,Qt=mA.now,xt=e.parseInt,pt=SA.random,mt=FA.reverse,yt=Ia(e,"DataView"),_t=Ia(e,"Map"),St=Ia(e,"Promise"),Dt=Ia(e,"Set"),vt=Ia(e,"WeakMap"),wt=Ia(DA,"create"),bt=vt&&new vt,Ft={},Rt=La(yt),kt=La(_t),Pt=La(St),Nt=La(Dt),Tt=La(vt),Mt=KA?KA.prototype:t,Lt=Mt?Mt.valueOf:t,Yt=Mt?Mt.toString:t;function Gt(A){if(eo(A)&&!Kr(A)&&!(A instanceof Kt)){if(A instanceof Ht)return A;if(TA.call(A,"__wrapped__"))return Ya(A)}return new Ht(A)}var Ut=function(){function A(){}return function(e){if(!Ao(e))return{};if(WA)return WA(e);A.prototype=e;var i=new A;return A.prototype=t,i}}();function Jt(){}function Ht(A,e){this.__wrapped__=A,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=t}function Kt(A){this.__wrapped__=A,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=C,this.__views__=[]}function Vt(A){var e=-1,t=null==A?0:A.length;for(this.clear();++e=e?A:e)),A}function si(A,e,i,n,a,r){var o,s=1&e,g=2&e,c=4&e;if(i&&(o=a?i(A,n,a,r):i(A)),o!==t)return o;if(!Ao(A))return A;var l=Kr(A);if(l){if(o=function(A){var e=A.length,t=new A.constructor(e);e&&"string"==typeof A[0]&&TA.call(A,"index")&&(t.index=A.index,t.input=A.input);return t}(A),!s)return bn(A,o)}else{var I=ha(A),d=I==x||I==p;if(Wr(A))return yn(A,s);if(I==_||I==u||d&&!a){if(o=g||d?{}:Ba(A),!s)return g?function(A,e){return Fn(A,Ca(A),e)}(A,function(A,e){return A&&Fn(e,ko(e),A)}(o,A)):function(A,e){return Fn(A,da(A),e)}(A,ni(o,A))}else{if(!se[I])return a?A:{};o=function(A,e,t){var i=A.constructor;switch(e){case k:return _n(A);case E:case f:return new i(+A);case P:return function(A,e){var t=e?_n(A.buffer):A.buffer;return new A.constructor(t,A.byteOffset,A.byteLength)}(A,t);case N:case T:case M:case L:case Y:case G:case U:case J:case H:return Sn(A,t);case m:return new i;case y:case w:return new i(A);case D:return function(A){var e=new A.constructor(A.source,CA.exec(A));return e.lastIndex=A.lastIndex,e}(A);case v:return new i;case F:return n=A,Lt?DA(Lt.call(n)):{}}var n}(A,I,s)}}r||(r=new Zt);var C=r.get(A);if(C)return C;r.set(A,o),ro(A)?A.forEach((function(t){o.add(si(t,e,i,t,A,r))})):to(A)&&A.forEach((function(t,n){o.set(n,si(t,e,i,n,A,r))}));var h=l?t:(c?g?aa:na:g?ko:Ro)(A);return ve(h||A,(function(t,n){h&&(t=A[n=t]),ei(o,n,si(t,e,i,n,A,r))})),o}function gi(A,e,i){var n=i.length;if(null==A)return!n;for(A=DA(A);n--;){var a=i[n],r=e[a],o=A[a];if(o===t&&!(a in A)||!r(o))return!1}return!0}function ci(A,e,n){if("function"!=typeof A)throw new bA(i);return Fa((function(){A.apply(t,n)}),e)}function li(A,e,t,i){var n=-1,a=Re,r=!0,o=A.length,s=[],g=e.length;if(!o)return s;t&&(e=Pe(e,ze(t))),i?(a=ke,r=!1):e.length>=200&&(a=At,r=!1,e=new Wt(e));A:for(;++n-1},Ot.prototype.set=function(A,e){var t=this.__data__,i=ti(t,A);return i<0?(++this.size,t.push([A,e])):t[i][1]=e,this},jt.prototype.clear=function(){this.size=0,this.__data__={hash:new Vt,map:new(_t||Ot),string:new Vt}},jt.prototype.delete=function(A){var e=ca(this,A).delete(A);return this.size-=e?1:0,e},jt.prototype.get=function(A){return ca(this,A).get(A)},jt.prototype.has=function(A){return ca(this,A).has(A)},jt.prototype.set=function(A,e){var t=ca(this,A),i=t.size;return t.set(A,e),this.size+=t.size==i?0:1,this},Wt.prototype.add=Wt.prototype.push=function(A){return this.__data__.set(A,n),this},Wt.prototype.has=function(A){return this.__data__.has(A)},Zt.prototype.clear=function(){this.__data__=new Ot,this.size=0},Zt.prototype.delete=function(A){var e=this.__data__,t=e.delete(A);return this.size=e.size,t},Zt.prototype.get=function(A){return this.__data__.get(A)},Zt.prototype.has=function(A){return this.__data__.has(A)},Zt.prototype.set=function(A,e){var t=this.__data__;if(t instanceof Ot){var i=t.__data__;if(!_t||i.length<199)return i.push([A,e]),this.size=++t.size,this;t=this.__data__=new jt(i)}return t.set(A,e),this.size=t.size,this};var Ii=Pn(Qi),di=Pn(xi,!0);function Ci(A,e){var t=!0;return Ii(A,(function(A,i,n){return t=!!e(A,i,n)})),t}function hi(A,e,i){for(var n=-1,a=A.length;++n0&&t(o)?e>1?Bi(o,e-1,t,i,n):Ne(n,o):i||(n[n.length]=o)}return n}var Ei=Nn(),fi=Nn(!0);function Qi(A,e){return A&&Ei(A,e,Ro)}function xi(A,e){return A&&fi(A,e,Ro)}function pi(A,e){return Fe(e,(function(e){return qr(A[e])}))}function mi(A,e){for(var i=0,n=(e=Qn(e,A)).length;null!=A&&ie}function Di(A,e){return null!=A&&TA.call(A,e)}function vi(A,e){return null!=A&&e in DA(A)}function wi(A,e,i){for(var n=i?ke:Re,a=A[0].length,r=A.length,o=r,s=rA(r),g=1/0,c=[];o--;){var l=A[o];o&&e&&(l=Pe(l,ze(e))),g=ft(l.length,g),s[o]=!i&&(e||a>=120&&l.length>=120)?new Wt(o&&l):t}l=A[0];var I=-1,d=s[0];A:for(;++I=o?s:s*("desc"==t[i]?-1:1)}return A.index-e.index}(A,e,t)}))}function Vi(A,e,t){for(var i=-1,n=e.length,a={};++i-1;)o!==A&&XA.call(o,s,1),XA.call(A,s,1);return A}function ji(A,e){for(var t=A?e.length:0,i=t-1;t--;){var n=e[t];if(t==i||n!==a){var a=n;fa(n)?XA.call(A,n,1):In(A,n)}}return A}function Wi(A,e){return A+ue(pt()*(e-A+1))}function Zi(A,e){var t="";if(!A||e<1||e>I)return t;do{e%2&&(t+=A),(e=ue(e/2))&&(A+=A)}while(e);return t}function Xi(A,e){return Ra(Da(A,e,ns),A+"")}function qi(A){return qt(Uo(A))}function zi(A,e){var t=Uo(A);return Na(t,oi(e,0,t.length))}function $i(A,e,i,n){if(!Ao(A))return A;for(var a=-1,r=(e=Qn(e,A)).length,o=r-1,s=A;null!=s&&++an?0:n+e),(t=t>n?n:t)<0&&(t+=n),n=e>t?0:t-e>>>0,e>>>=0;for(var a=rA(n);++i>>1,r=A[a];null!==r&&!so(r)&&(t?r<=e:r=200){var g=e?null:Xn(A);if(g)return ct(g);r=!1,n=At,s=new Wt}else s=e?[]:o;A:for(;++i=n?A:nn(A,e,i)}var mn=ge||function(A){return Ce.clearTimeout(A)};function yn(A,e){if(e)return A.slice();var t=A.length,i=OA?OA(t):new A.constructor(t);return A.copy(i),i}function _n(A){var e=new A.constructor(A.byteLength);return new VA(e).set(new VA(A)),e}function Sn(A,e){var t=e?_n(A.buffer):A.buffer;return new A.constructor(t,A.byteOffset,A.length)}function Dn(A,e){if(A!==e){var i=A!==t,n=null===A,a=A==A,r=so(A),o=e!==t,s=null===e,g=e==e,c=so(e);if(!s&&!c&&!r&&A>e||r&&o&&g&&!s&&!c||n&&o&&g||!i&&g||!a)return 1;if(!n&&!r&&!c&&A1?i[a-1]:t,o=a>2?i[2]:t;for(r=A.length>3&&"function"==typeof r?(a--,r):t,o&&Qa(i[0],i[1],o)&&(r=a<3?t:r,a=1),e=DA(e);++n-1?a[r?e[o]:o]:t}}function Gn(A){return ia((function(e){var n=e.length,a=n,r=Ht.prototype.thru;for(A&&e.reverse();a--;){var o=e[a];if("function"!=typeof o)throw new bA(i);if(r&&!s&&"wrapper"==oa(o))var s=new Ht([],!0)}for(a=s?a:n;++a1&&f.reverse(),I&&cs))return!1;var c=r.get(A),l=r.get(e);if(c&&l)return c==e&&l==A;var I=-1,d=!0,C=2&i?new Wt:t;for(r.set(A,e),r.set(e,A);++I-1&&A%1==0&&A1?"& ":"")+e[i],e=e.join(t>2?", ":" "),A.replace(oA,"{\n/* [wrapped with "+e+"] */\n")}(i,function(A,e){return ve(h,(function(t){var i="_."+t[0];e&t[1]&&!Re(A,i)&&A.push(i)})),A.sort()}(function(A){var e=A.match(sA);return e?e[1].split(gA):[]}(i),t)))}function Pa(A){var e=0,i=0;return function(){var n=Qt(),a=16-(n-i);if(i=n,a>0){if(++e>=800)return arguments[0]}else e=0;return A.apply(t,arguments)}}function Na(A,e){var i=-1,n=A.length,a=n-1;for(e=e===t?n:e;++i1?A[e-1]:t;return i="function"==typeof i?(A.pop(),i):t,ar(A,i)}));function Ir(A){var e=Gt(A);return e.__chain__=!0,e}function dr(A,e){return e(A)}var Cr=ia((function(A){var e=A.length,i=e?A[0]:0,n=this.__wrapped__,a=function(e){return ri(e,A)};return!(e>1||this.__actions__.length)&&n instanceof Kt&&fa(i)?((n=n.slice(i,+i+(e?1:0))).__actions__.push({func:dr,args:[a],thisArg:t}),new Ht(n,this.__chain__).thru((function(A){return e&&!A.length&&A.push(t),A}))):this.thru(a)}));var hr=Rn((function(A,e,t){TA.call(A,t)?++A[t]:ai(A,t,1)}));var ur=Yn(Ha),Br=Yn(Ka);function Er(A,e){return(Kr(A)?ve:Ii)(A,ga(e,3))}function fr(A,e){return(Kr(A)?we:di)(A,ga(e,3))}var Qr=Rn((function(A,e,t){TA.call(A,t)?A[t].push(e):ai(A,t,[e])}));var xr=Xi((function(A,e,t){var i=-1,n="function"==typeof e,a=Or(A)?rA(A.length):[];return Ii(A,(function(A){a[++i]=n?Se(e,A,t):bi(A,e,t)})),a})),pr=Rn((function(A,e,t){ai(A,t,e)}));function mr(A,e){return(Kr(A)?Pe:Yi)(A,ga(e,3))}var yr=Rn((function(A,e,t){A[t?0:1].push(e)}),(function(){return[[],[]]}));var _r=Xi((function(A,e){if(null==A)return[];var t=e.length;return t>1&&Qa(A,e[0],e[1])?e=[]:t>2&&Qa(e[0],e[1],e[2])&&(e=[e[0]]),Ki(A,Bi(e,1),[])})),Sr=Ie||function(){return Ce.Date.now()};function Dr(A,e,i){return e=i?t:e,e=A&&null==e?A.length:e,zn(A,g,t,t,t,t,e)}function vr(A,e){var n;if("function"!=typeof e)throw new bA(i);return A=ho(A),function(){return--A>0&&(n=e.apply(this,arguments)),A<=1&&(e=t),n}}var wr=Xi((function(A,e,t){var i=1;if(t.length){var n=gt(t,sa(wr));i|=o}return zn(A,i,e,t,n)})),br=Xi((function(A,e,t){var i=3;if(t.length){var n=gt(t,sa(br));i|=o}return zn(e,i,A,t,n)}));function Fr(A,e,n){var a,r,o,s,g,c,l=0,I=!1,d=!1,C=!0;if("function"!=typeof A)throw new bA(i);function h(e){var i=a,n=r;return a=r=t,l=e,s=A.apply(n,i)}function u(A){var i=A-c;return c===t||i>=e||i<0||d&&A-l>=o}function B(){var A=Sr();if(u(A))return E(A);g=Fa(B,function(A){var t=e-(A-c);return d?ft(t,o-(A-l)):t}(A))}function E(A){return g=t,C&&a?h(A):(a=r=t,s)}function f(){var A=Sr(),i=u(A);if(a=arguments,r=this,c=A,i){if(g===t)return function(A){return l=A,g=Fa(B,e),I?h(A):s}(c);if(d)return mn(g),g=Fa(B,e),h(c)}return g===t&&(g=Fa(B,e)),s}return e=Bo(e)||0,Ao(n)&&(I=!!n.leading,o=(d="maxWait"in n)?Et(Bo(n.maxWait)||0,e):o,C="trailing"in n?!!n.trailing:C),f.cancel=function(){g!==t&&mn(g),l=0,a=c=r=g=t},f.flush=function(){return g===t?s:E(Sr())},f}var Rr=Xi((function(A,e){return ci(A,1,e)})),kr=Xi((function(A,e,t){return ci(A,Bo(e)||0,t)}));function Pr(A,e){if("function"!=typeof A||null!=e&&"function"!=typeof e)throw new bA(i);var t=function(){var i=arguments,n=e?e.apply(this,i):i[0],a=t.cache;if(a.has(n))return a.get(n);var r=A.apply(this,i);return t.cache=a.set(n,r)||a,r};return t.cache=new(Pr.Cache||jt),t}function Nr(A){if("function"!=typeof A)throw new bA(i);return function(){var e=arguments;switch(e.length){case 0:return!A.call(this);case 1:return!A.call(this,e[0]);case 2:return!A.call(this,e[0],e[1]);case 3:return!A.call(this,e[0],e[1],e[2])}return!A.apply(this,e)}}Pr.Cache=jt;var Tr=xn((function(A,e){var t=(e=1==e.length&&Kr(e[0])?Pe(e[0],ze(ga())):Pe(Bi(e,1),ze(ga()))).length;return Xi((function(i){for(var n=-1,a=ft(i.length,t);++n=e})),Hr=Fi(function(){return arguments}())?Fi:function(A){return eo(A)&&TA.call(A,"callee")&&!ZA.call(A,"callee")},Kr=rA.isArray,Vr=Qe?ze(Qe):function(A){return eo(A)&&_i(A)==k};function Or(A){return null!=A&&$r(A.length)&&!qr(A)}function jr(A){return eo(A)&&Or(A)}var Wr=fe||Bs,Zr=xe?ze(xe):function(A){return eo(A)&&_i(A)==f};function Xr(A){if(!eo(A))return!1;var e=_i(A);return e==Q||"[object DOMException]"==e||"string"==typeof A.message&&"string"==typeof A.name&&!no(A)}function qr(A){if(!Ao(A))return!1;var e=_i(A);return e==x||e==p||"[object AsyncFunction]"==e||"[object Proxy]"==e}function zr(A){return"number"==typeof A&&A==ho(A)}function $r(A){return"number"==typeof A&&A>-1&&A%1==0&&A<=I}function Ao(A){var e=typeof A;return null!=A&&("object"==e||"function"==e)}function eo(A){return null!=A&&"object"==typeof A}var to=pe?ze(pe):function(A){return eo(A)&&ha(A)==m};function io(A){return"number"==typeof A||eo(A)&&_i(A)==y}function no(A){if(!eo(A)||_i(A)!=_)return!1;var e=jA(A);if(null===e)return!0;var t=TA.call(e,"constructor")&&e.constructor;return"function"==typeof t&&t instanceof t&&NA.call(t)==GA}var ao=me?ze(me):function(A){return eo(A)&&_i(A)==D};var ro=ye?ze(ye):function(A){return eo(A)&&ha(A)==v};function oo(A){return"string"==typeof A||!Kr(A)&&eo(A)&&_i(A)==w}function so(A){return"symbol"==typeof A||eo(A)&&_i(A)==F}var go=_e?ze(_e):function(A){return eo(A)&&$r(A.length)&&!!oe[_i(A)]};var co=jn(Li),lo=jn((function(A,e){return A<=e}));function Io(A){if(!A)return[];if(Or(A))return oo(A)?dt(A):bn(A);if(zA&&A[zA])return function(A){for(var e,t=[];!(e=A.next()).done;)t.push(e.value);return t}(A[zA]());var e=ha(A);return(e==m?ot:e==v?ct:Uo)(A)}function Co(A){return A?(A=Bo(A))===l||A===-1/0?17976931348623157e292*(A<0?-1:1):A==A?A:0:0===A?A:0}function ho(A){var e=Co(A),t=e%1;return e==e?t?e-t:e:0}function uo(A){return A?oi(ho(A),0,C):0}function Bo(A){if("number"==typeof A)return A;if(so(A))return d;if(Ao(A)){var e="function"==typeof A.valueOf?A.valueOf():A;A=Ao(e)?e+"":e}if("string"!=typeof A)return 0===A?A:+A;A=qe(A);var t=uA.test(A);return t||EA.test(A)?le(A.slice(2),t?2:8):hA.test(A)?d:+A}function Eo(A){return Fn(A,ko(A))}function fo(A){return null==A?"":cn(A)}var Qo=kn((function(A,e){if(ya(e)||Or(e))Fn(e,Ro(e),A);else for(var t in e)TA.call(e,t)&&ei(A,t,e[t])})),xo=kn((function(A,e){Fn(e,ko(e),A)})),po=kn((function(A,e,t,i){Fn(e,ko(e),A,i)})),mo=kn((function(A,e,t,i){Fn(e,Ro(e),A,i)})),yo=ia(ri);var _o=Xi((function(A,e){A=DA(A);var i=-1,n=e.length,a=n>2?e[2]:t;for(a&&Qa(e[0],e[1],a)&&(n=1);++i1),e})),Fn(A,aa(A),t),i&&(t=si(t,7,ea));for(var n=e.length;n--;)In(t,e[n]);return t}));var Mo=ia((function(A,e){return null==A?{}:function(A,e){return Vi(A,e,(function(e,t){return vo(A,t)}))}(A,e)}));function Lo(A,e){if(null==A)return{};var t=Pe(aa(A),(function(A){return[A]}));return e=ga(e),Vi(A,t,(function(A,t){return e(A,t[0])}))}var Yo=qn(Ro),Go=qn(ko);function Uo(A){return null==A?[]:$e(A,Ro(A))}var Jo=Mn((function(A,e,t){return e=e.toLowerCase(),A+(t?Ho(e):e)}));function Ho(A){return qo(fo(A).toLowerCase())}function Ko(A){return(A=fo(A))&&A.replace(QA,it).replace(Ae,"")}var Vo=Mn((function(A,e,t){return A+(t?"-":"")+e.toLowerCase()})),Oo=Mn((function(A,e,t){return A+(t?" ":"")+e.toLowerCase()})),jo=Tn("toLowerCase");var Wo=Mn((function(A,e,t){return A+(t?"_":"")+e.toLowerCase()}));var Zo=Mn((function(A,e,t){return A+(t?" ":"")+qo(e)}));var Xo=Mn((function(A,e,t){return A+(t?" ":"")+e.toUpperCase()})),qo=Tn("toUpperCase");function zo(A,e,i){return A=fo(A),(e=i?t:e)===t?function(A){return ne.test(A)}(A)?function(A){return A.match(te)||[]}(A):function(A){return A.match(cA)||[]}(A):A.match(e)||[]}var $o=Xi((function(A,e){try{return Se(A,t,e)}catch(A){return Xr(A)?A:new yA(A)}})),As=ia((function(A,e){return ve(e,(function(e){e=Ma(e),ai(A,e,wr(A[e],A))})),A}));function es(A){return function(){return A}}var ts=Gn(),is=Gn(!0);function ns(A){return A}function as(A){return Ni("function"==typeof A?A:si(A,1))}var rs=Xi((function(A,e){return function(t){return bi(t,A,e)}})),os=Xi((function(A,e){return function(t){return bi(A,t,e)}}));function ss(A,e,t){var i=Ro(e),n=pi(e,i);null!=t||Ao(e)&&(n.length||!i.length)||(t=e,e=A,A=this,n=pi(e,Ro(e)));var a=!(Ao(t)&&"chain"in t&&!t.chain),r=qr(A);return ve(n,(function(t){var i=e[t];A[t]=i,r&&(A.prototype[t]=function(){var e=this.__chain__;if(a||e){var t=A(this.__wrapped__);return(t.__actions__=bn(this.__actions__)).push({func:i,args:arguments,thisArg:A}),t.__chain__=e,t}return i.apply(A,Ne([this.value()],arguments))})})),A}function gs(){}var cs=Kn(Pe),ls=Kn(be),Is=Kn(Le);function ds(A){return xa(A)?Oe(Ma(A)):function(A){return function(e){return mi(e,A)}}(A)}var Cs=On(),hs=On(!0);function us(){return[]}function Bs(){return!1}var Es=Hn((function(A,e){return A+e}),0),fs=Zn("ceil"),Qs=Hn((function(A,e){return A/e}),1),xs=Zn("floor");var ps,ms=Hn((function(A,e){return A*e}),1),ys=Zn("round"),_s=Hn((function(A,e){return A-e}),0);return Gt.after=function(A,e){if("function"!=typeof e)throw new bA(i);return A=ho(A),function(){if(--A<1)return e.apply(this,arguments)}},Gt.ary=Dr,Gt.assign=Qo,Gt.assignIn=xo,Gt.assignInWith=po,Gt.assignWith=mo,Gt.at=yo,Gt.before=vr,Gt.bind=wr,Gt.bindAll=As,Gt.bindKey=br,Gt.castArray=function(){if(!arguments.length)return[];var A=arguments[0];return Kr(A)?A:[A]},Gt.chain=Ir,Gt.chunk=function(A,e,i){e=(i?Qa(A,e,i):e===t)?1:Et(ho(e),0);var n=null==A?0:A.length;if(!n||e<1)return[];for(var a=0,r=0,o=rA(he(n/e));aa?0:a+i),(n=n===t||n>a?a:ho(n))<0&&(n+=a),n=i>n?0:uo(n);i>>0)?(A=fo(A))&&("string"==typeof e||null!=e&&!ao(e))&&!(e=cn(e))&&rt(A)?pn(dt(A),0,i):A.split(e,i):[]},Gt.spread=function(A,e){if("function"!=typeof A)throw new bA(i);return e=null==e?0:Et(ho(e),0),Xi((function(t){var i=t[e],n=pn(t,0,e);return i&&Ne(n,i),Se(A,this,n)}))},Gt.tail=function(A){var e=null==A?0:A.length;return e?nn(A,1,e):[]},Gt.take=function(A,e,i){return A&&A.length?nn(A,0,(e=i||e===t?1:ho(e))<0?0:e):[]},Gt.takeRight=function(A,e,i){var n=null==A?0:A.length;return n?nn(A,(e=n-(e=i||e===t?1:ho(e)))<0?0:e,n):[]},Gt.takeRightWhile=function(A,e){return A&&A.length?Cn(A,ga(e,3),!1,!0):[]},Gt.takeWhile=function(A,e){return A&&A.length?Cn(A,ga(e,3)):[]},Gt.tap=function(A,e){return e(A),A},Gt.throttle=function(A,e,t){var n=!0,a=!0;if("function"!=typeof A)throw new bA(i);return Ao(t)&&(n="leading"in t?!!t.leading:n,a="trailing"in t?!!t.trailing:a),Fr(A,e,{leading:n,maxWait:e,trailing:a})},Gt.thru=dr,Gt.toArray=Io,Gt.toPairs=Yo,Gt.toPairsIn=Go,Gt.toPath=function(A){return Kr(A)?Pe(A,Ma):so(A)?[A]:bn(Ta(fo(A)))},Gt.toPlainObject=Eo,Gt.transform=function(A,e,t){var i=Kr(A),n=i||Wr(A)||go(A);if(e=ga(e,4),null==t){var a=A&&A.constructor;t=n?i?new a:[]:Ao(A)&&qr(a)?Ut(jA(A)):{}}return(n?ve:Qi)(A,(function(A,i,n){return e(t,A,i,n)})),t},Gt.unary=function(A){return Dr(A,1)},Gt.union=er,Gt.unionBy=tr,Gt.unionWith=ir,Gt.uniq=function(A){return A&&A.length?ln(A):[]},Gt.uniqBy=function(A,e){return A&&A.length?ln(A,ga(e,2)):[]},Gt.uniqWith=function(A,e){return e="function"==typeof e?e:t,A&&A.length?ln(A,t,e):[]},Gt.unset=function(A,e){return null==A||In(A,e)},Gt.unzip=nr,Gt.unzipWith=ar,Gt.update=function(A,e,t){return null==A?A:dn(A,e,fn(t))},Gt.updateWith=function(A,e,i,n){return n="function"==typeof n?n:t,null==A?A:dn(A,e,fn(i),n)},Gt.values=Uo,Gt.valuesIn=function(A){return null==A?[]:$e(A,ko(A))},Gt.without=rr,Gt.words=zo,Gt.wrap=function(A,e){return Mr(fn(e),A)},Gt.xor=or,Gt.xorBy=sr,Gt.xorWith=gr,Gt.zip=cr,Gt.zipObject=function(A,e){return Bn(A||[],e||[],ei)},Gt.zipObjectDeep=function(A,e){return Bn(A||[],e||[],$i)},Gt.zipWith=lr,Gt.entries=Yo,Gt.entriesIn=Go,Gt.extend=xo,Gt.extendWith=po,ss(Gt,Gt),Gt.add=Es,Gt.attempt=$o,Gt.camelCase=Jo,Gt.capitalize=Ho,Gt.ceil=fs,Gt.clamp=function(A,e,i){return i===t&&(i=e,e=t),i!==t&&(i=(i=Bo(i))==i?i:0),e!==t&&(e=(e=Bo(e))==e?e:0),oi(Bo(A),e,i)},Gt.clone=function(A){return si(A,4)},Gt.cloneDeep=function(A){return si(A,5)},Gt.cloneDeepWith=function(A,e){return si(A,5,e="function"==typeof e?e:t)},Gt.cloneWith=function(A,e){return si(A,4,e="function"==typeof e?e:t)},Gt.conformsTo=function(A,e){return null==e||gi(A,e,Ro(e))},Gt.deburr=Ko,Gt.defaultTo=function(A,e){return null==A||A!=A?e:A},Gt.divide=Qs,Gt.endsWith=function(A,e,i){A=fo(A),e=cn(e);var n=A.length,a=i=i===t?n:oi(ho(i),0,n);return(i-=e.length)>=0&&A.slice(i,a)==e},Gt.eq=Gr,Gt.escape=function(A){return(A=fo(A))&&X.test(A)?A.replace(W,nt):A},Gt.escapeRegExp=function(A){return(A=fo(A))&&nA.test(A)?A.replace(iA,"\\$&"):A},Gt.every=function(A,e,i){var n=Kr(A)?be:Ci;return i&&Qa(A,e,i)&&(e=t),n(A,ga(e,3))},Gt.find=ur,Gt.findIndex=Ha,Gt.findKey=function(A,e){return Ge(A,ga(e,3),Qi)},Gt.findLast=Br,Gt.findLastIndex=Ka,Gt.findLastKey=function(A,e){return Ge(A,ga(e,3),xi)},Gt.floor=xs,Gt.forEach=Er,Gt.forEachRight=fr,Gt.forIn=function(A,e){return null==A?A:Ei(A,ga(e,3),ko)},Gt.forInRight=function(A,e){return null==A?A:fi(A,ga(e,3),ko)},Gt.forOwn=function(A,e){return A&&Qi(A,ga(e,3))},Gt.forOwnRight=function(A,e){return A&&xi(A,ga(e,3))},Gt.get=Do,Gt.gt=Ur,Gt.gte=Jr,Gt.has=function(A,e){return null!=A&&ua(A,e,Di)},Gt.hasIn=vo,Gt.head=Oa,Gt.identity=ns,Gt.includes=function(A,e,t,i){A=Or(A)?A:Uo(A),t=t&&!i?ho(t):0;var n=A.length;return t<0&&(t=Et(n+t,0)),oo(A)?t<=n&&A.indexOf(e,t)>-1:!!n&&Je(A,e,t)>-1},Gt.indexOf=function(A,e,t){var i=null==A?0:A.length;if(!i)return-1;var n=null==t?0:ho(t);return n<0&&(n=Et(i+n,0)),Je(A,e,n)},Gt.inRange=function(A,e,i){return e=Co(e),i===t?(i=e,e=0):i=Co(i),function(A,e,t){return A>=ft(e,t)&&A=-9007199254740991&&A<=I},Gt.isSet=ro,Gt.isString=oo,Gt.isSymbol=so,Gt.isTypedArray=go,Gt.isUndefined=function(A){return A===t},Gt.isWeakMap=function(A){return eo(A)&&ha(A)==R},Gt.isWeakSet=function(A){return eo(A)&&"[object WeakSet]"==_i(A)},Gt.join=function(A,e){return null==A?"":je.call(A,e)},Gt.kebabCase=Vo,Gt.last=Xa,Gt.lastIndexOf=function(A,e,i){var n=null==A?0:A.length;if(!n)return-1;var a=n;return i!==t&&(a=(a=ho(i))<0?Et(n+a,0):ft(a,n-1)),e==e?function(A,e,t){for(var i=t+1;i--;)if(A[i]===e)return i;return i}(A,e,a):Ue(A,Ke,a,!0)},Gt.lowerCase=Oo,Gt.lowerFirst=jo,Gt.lt=co,Gt.lte=lo,Gt.max=function(A){return A&&A.length?hi(A,ns,Si):t},Gt.maxBy=function(A,e){return A&&A.length?hi(A,ga(e,2),Si):t},Gt.mean=function(A){return Ve(A,ns)},Gt.meanBy=function(A,e){return Ve(A,ga(e,2))},Gt.min=function(A){return A&&A.length?hi(A,ns,Li):t},Gt.minBy=function(A,e){return A&&A.length?hi(A,ga(e,2),Li):t},Gt.stubArray=us,Gt.stubFalse=Bs,Gt.stubObject=function(){return{}},Gt.stubString=function(){return""},Gt.stubTrue=function(){return!0},Gt.multiply=ms,Gt.nth=function(A,e){return A&&A.length?Hi(A,ho(e)):t},Gt.noConflict=function(){return Ce._===this&&(Ce._=UA),this},Gt.noop=gs,Gt.now=Sr,Gt.pad=function(A,e,t){A=fo(A);var i=(e=ho(e))?It(A):0;if(!e||i>=e)return A;var n=(e-i)/2;return Vn(ue(n),t)+A+Vn(he(n),t)},Gt.padEnd=function(A,e,t){A=fo(A);var i=(e=ho(e))?It(A):0;return e&&ie){var n=A;A=e,e=n}if(i||A%1||e%1){var a=pt();return ft(A+a*(e-A+ce("1e-"+((a+"").length-1))),e)}return Wi(A,e)},Gt.reduce=function(A,e,t){var i=Kr(A)?Te:We,n=arguments.length<3;return i(A,ga(e,4),t,n,Ii)},Gt.reduceRight=function(A,e,t){var i=Kr(A)?Me:We,n=arguments.length<3;return i(A,ga(e,4),t,n,di)},Gt.repeat=function(A,e,i){return e=(i?Qa(A,e,i):e===t)?1:ho(e),Zi(fo(A),e)},Gt.replace=function(){var A=arguments,e=fo(A[0]);return A.length<3?e:e.replace(A[1],A[2])},Gt.result=function(A,e,i){var n=-1,a=(e=Qn(e,A)).length;for(a||(a=1,A=t);++nI)return[];var t=C,i=ft(A,C);e=ga(e),A-=C;for(var n=Xe(i,e);++t=r)return A;var s=i-It(n);if(s<1)return n;var g=o?pn(o,0,s).join(""):A.slice(0,s);if(a===t)return g+n;if(o&&(s+=g.length-s),ao(a)){if(A.slice(s).search(a)){var c,l=g;for(a.global||(a=vA(a.source,fo(CA.exec(a))+"g")),a.lastIndex=0;c=a.exec(l);)var I=c.index;g=g.slice(0,I===t?s:I)}}else if(A.indexOf(cn(a),s)!=s){var d=g.lastIndexOf(a);d>-1&&(g=g.slice(0,d))}return g+n},Gt.unescape=function(A){return(A=fo(A))&&Z.test(A)?A.replace(j,ht):A},Gt.uniqueId=function(A){var e=++MA;return fo(A)+e},Gt.upperCase=Xo,Gt.upperFirst=qo,Gt.each=Er,Gt.eachRight=fr,Gt.first=Oa,ss(Gt,(ps={},Qi(Gt,(function(A,e){TA.call(Gt.prototype,e)||(ps[e]=A)})),ps),{chain:!1}),Gt.VERSION="4.17.21",ve(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(A){Gt[A].placeholder=Gt})),ve(["drop","take"],(function(A,e){Kt.prototype[A]=function(i){i=i===t?1:Et(ho(i),0);var n=this.__filtered__&&!e?new Kt(this):this.clone();return n.__filtered__?n.__takeCount__=ft(i,n.__takeCount__):n.__views__.push({size:ft(i,C),type:A+(n.__dir__<0?"Right":"")}),n},Kt.prototype[A+"Right"]=function(e){return this.reverse()[A](e).reverse()}})),ve(["filter","map","takeWhile"],(function(A,e){var t=e+1,i=1==t||3==t;Kt.prototype[A]=function(A){var e=this.clone();return e.__iteratees__.push({iteratee:ga(A,3),type:t}),e.__filtered__=e.__filtered__||i,e}})),ve(["head","last"],(function(A,e){var t="take"+(e?"Right":"");Kt.prototype[A]=function(){return this[t](1).value()[0]}})),ve(["initial","tail"],(function(A,e){var t="drop"+(e?"":"Right");Kt.prototype[A]=function(){return this.__filtered__?new Kt(this):this[t](1)}})),Kt.prototype.compact=function(){return this.filter(ns)},Kt.prototype.find=function(A){return this.filter(A).head()},Kt.prototype.findLast=function(A){return this.reverse().find(A)},Kt.prototype.invokeMap=Xi((function(A,e){return"function"==typeof A?new Kt(this):this.map((function(t){return bi(t,A,e)}))})),Kt.prototype.reject=function(A){return this.filter(Nr(ga(A)))},Kt.prototype.slice=function(A,e){A=ho(A);var i=this;return i.__filtered__&&(A>0||e<0)?new Kt(i):(A<0?i=i.takeRight(-A):A&&(i=i.drop(A)),e!==t&&(i=(e=ho(e))<0?i.dropRight(-e):i.take(e-A)),i)},Kt.prototype.takeRightWhile=function(A){return this.reverse().takeWhile(A).reverse()},Kt.prototype.toArray=function(){return this.take(C)},Qi(Kt.prototype,(function(A,e){var i=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),a=Gt[n?"take"+("last"==e?"Right":""):e],r=n||/^find/.test(e);a&&(Gt.prototype[e]=function(){var e=this.__wrapped__,o=n?[1]:arguments,s=e instanceof Kt,g=o[0],c=s||Kr(e),l=function(A){var e=a.apply(Gt,Ne([A],o));return n&&I?e[0]:e};c&&i&&"function"==typeof g&&1!=g.length&&(s=c=!1);var I=this.__chain__,d=!!this.__actions__.length,C=r&&!I,h=s&&!d;if(!r&&c){e=h?e:new Kt(this);var u=A.apply(e,o);return u.__actions__.push({func:dr,args:[l],thisArg:t}),new Ht(u,I)}return C&&h?A.apply(this,o):(u=this.thru(l),C?n?u.value()[0]:u.value():u)})})),ve(["pop","push","shift","sort","splice","unshift"],(function(A){var e=FA[A],t=/^(?:push|sort|unshift)$/.test(A)?"tap":"thru",i=/^(?:pop|shift)$/.test(A);Gt.prototype[A]=function(){var A=arguments;if(i&&!this.__chain__){var n=this.value();return e.apply(Kr(n)?n:[],A)}return this[t]((function(t){return e.apply(Kr(t)?t:[],A)}))}})),Qi(Kt.prototype,(function(A,e){var t=Gt[e];if(t){var i=t.name+"";TA.call(Ft,i)||(Ft[i]=[]),Ft[i].push({name:e,func:t})}})),Ft[Un(t,2).name]=[{name:"wrapper",func:t}],Kt.prototype.clone=function(){var A=new Kt(this.__wrapped__);return A.__actions__=bn(this.__actions__),A.__dir__=this.__dir__,A.__filtered__=this.__filtered__,A.__iteratees__=bn(this.__iteratees__),A.__takeCount__=this.__takeCount__,A.__views__=bn(this.__views__),A},Kt.prototype.reverse=function(){if(this.__filtered__){var A=new Kt(this);A.__dir__=-1,A.__filtered__=!0}else(A=this.clone()).__dir__*=-1;return A},Kt.prototype.value=function(){var A=this.__wrapped__.value(),e=this.__dir__,t=Kr(A),i=e<0,n=t?A.length:0,a=function(A,e,t){var i=-1,n=t.length;for(;++i=this.__values__.length;return{done:A,value:A?t:this.__values__[this.__index__++]}},Gt.prototype.plant=function(A){for(var e,i=this;i instanceof Jt;){var n=Ya(i);n.__index__=0,n.__values__=t,e?a.__wrapped__=n:e=n;var a=n;i=i.__wrapped__}return a.__wrapped__=A,e},Gt.prototype.reverse=function(){var A=this.__wrapped__;if(A instanceof Kt){var e=A;return this.__actions__.length&&(e=new Kt(this)),(e=e.reverse()).__actions__.push({func:dr,args:[Ar],thisArg:t}),new Ht(e,this.__chain__)}return this.thru(Ar)},Gt.prototype.toJSON=Gt.prototype.valueOf=Gt.prototype.value=function(){return hn(this.__wrapped__,this.__actions__)},Gt.prototype.first=Gt.prototype.head,zA&&(Gt.prototype[zA]=function(){return this}),Gt}();ue?((ue.exports=ut)._=ut,he._=ut):Ce._=ut}).call(b)}(T,T.exports);var M=F(T.exports),L=function(){return a((function A(e,i){t(this,A),this.id=i,this.jSPlugin=e,this.state={play:!1,loading:!1,text:""},this.loadingSetText=this.loadingSetText}),[{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}},{key:"setPlayStatus",value:function(A){this.state=Object.assign(this.state,A)}},{key:"loadingStart",value:function(A){var e=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(e),e.innerHTML="@keyframes antRotate {to {transform: rotate(400deg);transform-origin:50% 50%;}} .loading {display: inline-block;z-index: 1000;-webkit-animation: antRotate 1s infinite linear;animation: antRotate 1s infinite linear;}";var t=A,i=document.getElementById(t),n=i.offsetWidth,a=i.offsetHeight,r=i.offsetLeft;this.jSPlugin.isInspect&&this.jSPlugin.Theme&&"map"==this.jSPlugin.Theme.inspectMode&&(r=0),document.getElementById("".concat(A,"-loading-id-0"))&&document.getElementById("".concat(A,"-loading-id-0")).parentNode.removeChild(document.getElementById("".concat(A,"-loading-id-0")));var o=document.createElement("div");o.setAttribute("id","".concat(A,"-loading-id-0"));var s="position:absolute;outline:none;pointer-events:none;";s+="width: 100%;background-size: cover; background-repeat:no-repeat;",s+="height: 100%;",s+="top:0;",s+="left:"+r+"px;",o.setAttribute("style",s),o.style.height=a,o.setAttribute("class","loading-container"),i.style.position="relative",this.jSPlugin.isInspect&&this.jSPlugin.Theme&&"map"==this.jSPlugin.Theme.inspectMode&&(i.style.position="absolute"),i.appendChild(o);var g=document.createElement("div"),c=document.createElement("div");g.setAttribute("class","loading-item"),g.setAttribute("id","".concat(A,"-loading-item-0"));s="display:inline-flex;pointer-events:none;flex-direction:column;justify-content:center;align-items: center;width:100%;height:"+a+"px;outline:none;vertical-align: top;position:absolute;";function l(A,e,t,i){return{top:parseInt(i/t,10)*(A/t),left:i%t*(e/t)}}s+="left:"+l(a,n,1,0).left+"px;",s+="top:"+l(a,n,1,0).top+"px;",g.setAttribute("style",s);var I=1,d=document.createElement("div");c.innerHTML="",c.style.color="#fff",d.setAttribute("class","loading"),d.setAttribute("id","loading-icon");var C='';!this.jSPlugin.isMobile&&this.jSPlugin.isCall&&(I=this.jSPlugin.width/1024,C='')),d.innerHTML=C,g.appendChild(d),g.appendChild(c),o.appendChild(g)}},{key:"loadingStop",value:function(A){var e=document.getElementById("".concat(A,"-loading-item-0"));e&&document.getElementById("loading-icon")&&e.removeChild(document.getElementById("loading-icon"))}},{key:"loadingSetText",value:function(A){var e=this;if(this.loadingClearText(),document.getElementById("".concat(this.id,"-loading-item-0"))){var t=document.getElementById("".concat(this.id,"-loading-item-0")),i=document.getElementById("".concat(this.id,"-loading-item-0")).childNodes[1];if(i||(t.style.height="100%",(i=document.createElement("div")).innerHTML=A.text,t.appendChild(i)),i.id="".concat(this.id,"-loading-item-txt"),i.innerHTML=A.text,i.style.fontSize="14px",!this.jSPlugin.isMobile&&this.jSPlugin.isCall){var n=this.jSPlugin.width/1024;i.style.fontSize="".concat(28*n,"px"),i.style.marginTop="16px"}if(this.jSPlugin.isCall&&1==A.type){var a=document.getElementById("".concat(this.id,"-loading-item-txt")),r=document.createElement("div");r.style="margin-bottom: 8px;width:24px;height:24px;",r.innerHTML='\n \n \n \n \n \n \n \n ',t.insertBefore(r,a)}if(i.style.color=A.color||"#FFFFFF",i.style.padding="0 6%",i.style.textAlign="center",this.state.text=A.text,A.delayClear)var o=setTimeout((function(){e.loadingClearText(),clearTimeout(o)}),parseInt(A.delayClear))}}},{key:"loadingSetTextWithBtn",value:function(A){var e=this;this.loadingClear(),console.log(this.jSPlugin);var t=!!this.jSPlugin.Theme.call&&this.jSPlugin.Theme.call.themeData||null;(t&&(0===t.customConfig.bellPoster||"onCall"===this.jSPlugin.Theme.call.bellStatus)||A.mask)&&document.getElementById("".concat(this.id,"-loading-id-0"))&&(document.getElementById("".concat(this.id,"-loading-id-0")).style.background=A.maskStyle||"rgba(0,0,0,0.7)");var i=document.getElementById("".concat(this.id,"-loading-item-0"));if(i){i.style.height="100%",i.style["pointer-events"]="auto";var n=document.createElement("div");if(n.id="".concat(this.id,"-loading-item-txt"),n.innerHTML=A.text,n.title=A.text,n.style.color=A.color||"#FFFFFF",A.isMobile){var a=14*(this.jSPlugin.width/375);n.style.fontSize=a+"px"}else{var r=28*(this.jSPlugin.width/1024);n.style.fontSize=r+"px"}if(this.jSPlugin.isInspect&&(n.style="text-align: center; color: white; font-size: 14px; white-space: nowrap;overflow: hidden;text-overflow: ellipsis; width: 70%;"),i.appendChild(n),A.type&&2==A.type){var o=8,s=24;if(A.isMobile){s=24*(this.jSPlugin.width/375)}else{var g=this.jSPlugin.width/1024;o=g<1?16*g:16,s=40*g}var c=document.getElementById("".concat(this.id,"-loading-item-txt"));(d=document.createElement("div")).style="margin-bottom: ".concat(o,"px;width:").concat(s,"px;height:").concat(s,"px;"),d.innerHTML='\n \n \n \n \n \n \n \n '),i.insertBefore(d,c)}else{var l=document.createElement("div");if(l.id="".concat(this.id,"-loading-item-btn-wrap"),l.innerHTML='\n
').concat(A.btnName,'
\n \n \n \n '),A.isMobile)1==A.type?l.style="color:white;width:100px;height:30px;border-radius: 10px;background: rgba(255,255,255,0.25);text-align:center;line-height:30px;margin-top:9px;font-size:14px;-webkit-tap-highlight-color: transparent;":l.style="border: 1px solid rgba(204,204,204,1);color:white;width:80px;height:24px;border-radius: 12px;background: rgba(255,255,255,0.1);text-align:center;line-height:24px;margin-top:20px;font-size:12px;-webkit-tap-highlight-color: transparent;";else{var I=this.jSPlugin.width/1024;l.style="color:#648FFC;margin-top:16px;cursor: pointer;font-size:".concat(24*I,"px;"),this.jSPlugin.isInspect&&this.jSPlugin.Theme&&"video"==this.jSPlugin.Theme.inspectMode&&(l.style="border: 1px solid rgba(255,255,255,1);color:white; cursor: pointer;text-align: center;width:80px;height:32px;border-radius:2px; text-align:center;line-height:32px;margin-top:16px;font-size:14px;-webkit-tap-highlight-color: transparent;")}if(i.appendChild(l),A.isMobile&&1==A.type){var d,C=document.getElementById("".concat(this.id,"-loading-item-txt"));(d=document.createElement("div")).style="margin-bottom: 8px;width:24px;height:24px;",d.innerHTML='\n \n \n \n \n \n \n \n ',i.insertBefore(d,C)}document.getElementById("".concat(this.id,"-loading-item-btn-wrap"))&&(document.getElementById("".concat(this.id,"-loading-item-btn-wrap")).onclick=function(){e.jSPlugin.play(),e.loadingClear(),e.loadingStart(e.id),e.loadingSetText({text:"视频加载中"})})}this.state.text=A.text,A.delayClear&&setTimeout((function(){e.loadingClearText()}),parseInt(A.delayClear))}}},{key:"loadingClearText",value:function(){if(document.getElementById("".concat(this.id,"-loading-item-0"))){var A=document.getElementById("".concat(this.id,"-loading-item-0")).childNodes;A.length>1?A[1].parentNode.removeChild(A[1]):A[0]&&A[0].parentNode.removeChild(A[0])}}},{key:"loadingClear",value:function(){if(document.getElementById("".concat(this.id,"-loading-item-0"))){for(var A=document.getElementById("".concat(this.id,"-loading-item-0")).childNodes,e=A.length-1;e>=0;e--)A[e].parentNode.removeChild(A[e]);document.getElementById("".concat(this.id,"-loading-id-0"))&&(document.getElementById("".concat(this.id,"-loading-id-0")).style.background="none"),document.getElementById("loading-icon")&&document.getElementById("loading-icon").parentNode.removeChild(document.getElementById("loading-icon"))}}},{key:"loadingEnd",value:function(){var A=document.getElementById("".concat(this.id,"-loading-item-0"));if(A){A.parentNode.removeChild(A);var e=document.getElementById("".concat(this.id,"-loading-id-0"));e&&0===e.children.length&&e.parentNode.removeChild(e)}document.getElementById("".concat(this.id,"-loading-item-0")).style.background="none"}}])}(),Y=function(){return a((function A(e,i){t(this,A),this.id=i,this.jSPlugin=e,this.timer=null,this.state={play:!1,loading:!1}}),[{key:"default",value:function(A,e){var t=this,i="msgId",n=e||document.getElementById("".concat(this.id,"-wrap"));document.getElementById("".concat(this.id,"-").concat(i))&&n.removeChild(document.getElementById("".concat(this.id,"-").concat(i)));var a=document.createElement("div");a.id="".concat(this.id,"-").concat(i),a.style="position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);text-align: center;padding: 4px 16px;background: #00000080;color: #FFFFFF;font-size: 14px;",a.innerHTML=A,n.appendChild(a),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((function(){var A=document.getElementById("".concat(t.id,"-").concat(i));n&&A&&n.removeChild(A)}),2e3)}}])}(),G={391001:"取流地址或端口非法",395e3:"服务内部异常,请稍后重试",395400:"预览取流参数异常",395402:"设备当前时段无录像,请选择其他时间段",395403:"服务异常,请重试或联系客服",395404:"设备不在线,请优化网络后重启设备再试",395405:"设备侧网络问题,请检查优化网络后重启设备再试",395406:"token过期,请重试",395407:"客户端的URL格式错误",395409:"预览开启隐私保护",395410:"服务异常,请重试或联系客服",395411:"无权查看当前设备",395412:"服务异常,请重试或联系客服",395413:"服务异常,请重试或联系客服",395415:"设备通道错误",395416:"当前观看路数达到设备最大限制,请重启设备或联系设备售后处理",395451:"设备不支持该码流类型,请检查设备通道支持情况或联系硬件售后",395452:"设备侧网络较差,请检查优化网络后重启设备再试",395454:"设备侧网络较差,请检查优化网络后重启设备再试",395455:"设备通道异常,请检查通道配置后重试",395456:"设备通道异常,请检查通道配置后重试",395457:"服务异常,请重试或联系客服",395458:"服务异常,请重试或联系客服",395459:"服务异常,请重试或联系客服",395460:"服务异常,请重试或联系客服",395492:"服务异常,请重试或联系客服",395500:"服务异常,请重试或联系客服",395501:"服务异常,请重试或联系客服",395503:"服务异常,请重试或联系客服",395504:"服务异常,请重试或联系客服",395505:"服务异常,请重试或联系客服",395506:"暂不支持该设备直接取流,请连接NVR后重试或联系客服",395507:"设备4G无限流量套餐仅支持萤石云视频APP使用,请联系APP客服更换套餐",395530:"服务异常,请重试或联系客服",395544:"视频源不存在,请检查设备配置",395545:"服务异常,请重试或联系客服",395546:"同时观看人数达到账号最大限制,请联系客服",395547:"同时观看人数达到账号最大限制,请联系客服",395556:"服务异常,请重试或联系客服",395557:"设备取流失败,请联系硬件售后",395558:"查找录像开始时间错误",395560:"服务异常,请重试或联系客服",395561:"服务异常,请重试或联系客服",395562:"服务异常,请重试或联系客服",395563:"服务异常,请重试或联系客服",395564:"服务异常,请重试或联系客服",395566:"服务异常,请重试或联系客服",395567:"服务异常,请重试或联系客服",395568:"服务异常,请重试或联系客服",395569:"服务异常,请重试或联系客服",395600:"服务异常,请重试或联系客服",395601:"服务异常,请重试或联系客服",395602:"服务异常,请重试或联系客服",395610:"服务异常,请重试或联系客服",395620:"服务异常,请重试或联系客服",395701:"服务异常,请重试或联系客服",395702:"服务异常,请重试或联系客服",395703:"服务异常,请重试或联系客服",396001:"服务异常,请重试或联系客服",396099:"服务异常,请重试或联系客服",396101:"服务异常,请重试或联系客服",396102:"服务异常,请重试或联系客服",396103:"服务异常,请重试或联系客服",396104:"服务异常,请重试或联系客服",396105:"设备异常,请重试或联系客服",396106:"设备通道异常,请检查通道配置后重试",396107:"设备异常,请重试或联系客服",396108:"服务异常,请重试或联系客服",396109:"服务异常,请重试或联系客服",396110:"设备异常,请重试或联系客服",396501:"设备异常,请重试或联系客服",396502:"设备异常,请重试或联系客服",396503:"设备异常,请重试或联系客服",396504:"设备异常,请重试或联系客服",396505:"设备异常,请重试或联系客服",396506:"设备异常,请重试或联系客服",396508:"设备异常,请重试或联系客服",396509:"设备异常,请重试或联系客服",396510:"设备异常,请重试或联系客服",396511:"设备异常,请重试或联系客服",396512:"设备异常,请重试或联系客服",396513:"设备异常,请重试或联系客服",396514:"设备异常,请重试或联系客服",396515:"设备异常,请重试或联系客服",396516:"设备异常,请重试或联系客服",396517:"设备异常,请重试或联系客服",396518:"设备异常,请重试或联系客服",396519:"设备网络异常,请检查优化网络后重启设备再试",396520:"设备网络异常,请检查优化网络后重启设备再试",396700:"服务异常,请重试或联系客服",396701:"回放结束",397001:"服务异常,请重试或联系客服",397002:"服务异常,请重试或联系客服",397003:"服务异常,请重试或联系客服",397004:"服务异常,请重试或联系客服",397005:"设备取流连接断开,请检查网络后重试",397006:"服务异常,请重试或联系客服",397007:"服务异常,请重试或联系客服",399e3:"服务异常,请重试或联系客服",399001:"客户端网络超时",399002:"服务异常,请重试或联系客服",399016:"token失效,请更新并重试",399048:"同时观看人数达到账号最大限制,请联系客服",399049:"免费版并发数达到上限,请升级企业版使用多并发能力",3810001:"操作失败",3810002:"账号异常,操作失败",3810005:"账号异常,操作失败",3820002:"设备不存在,请检查设备连接情况",3820006:"操作失败,请检查设备网络情况",3820007:"操作失败,请检查设备网络情况",3820008:"操作过于频繁,稍后再试",3820014:"操作失败",3820032:"通道不存在请检查设备连接情况",3849999:"操作失败,请重试",386e4:"操作失败,设备不支持该操作",3860001:"操作失败,用户无权限",3860002:"设备已旋转到上限位",3860003:"设备已旋转到下限位",3860004:"设备已旋转到左限位",3860005:"设备已旋转到右限位",3860006:"操作失败,请重试",3860009:"设备正在操作中",3860020:"操作失败",BTN_RETRY:"重试",BTN_RELOAD:"重新加载",LOADING:"加载中,请稍后",TIMEFORMAT_ERROR:"时间格式有误,请确认",USE_MULTITHREADING_WARING:"您当前浏览器可以开启谷歌实验室多线程特性,获取更好播放体验,避免浏览器卡顿及崩溃,详见",OPEN_INSTRUCTIONS:"开启说明",INIT_FINSHED:"初始化播放器完成",INIT_SUCCESS:"初始化播放器成功",GET_PLAYURL_FAILED:"获取播放地址失败",VIDEO_LOADING:"视频加载中",DISCONNECT:"连接断开,请重试",DEVICE_ENCRYPTED:"设备已加密",NO_RECORD:"未找到录像片段",PLAY_FAILED:"播放失败,请检查设备及客户端网络",PLAY_SUCCESS:"播放成功",STOP_SUCCESS:"停止成功",CHANGE_PLAYURL_SUCCESS:"切换播放地址成功",CHANGE_PLAYURL_FAILED:"切换播放地址失败",GET_OSD_TIME:"获取OSD时间",GET_OSD_TIME_FAILED:"获取OSD时间失败",SET_POSTER:"设置播放器封面",RESIZE:"调整播放器尺寸",SPEED:"倍速",SPEED_RATE:"倍",SPEED_CANCEL:"取消",GET_SPEED:"获取当前播放速率",MAX_SPEED_LIMIT:"播放速度最大为4倍速度",MIN_SPEED_LIMIT:"播放速度最小为1倍速度",SEEK_CANNOT_CROSS_DAYS:"seek时间不能跨日期",SEEK_TIMEFORMAT_ERROR:"seek时间格式错误",PAUSE:"暂停",PAUSE_FAILED:"暂停失败",RESUME:"恢复播放",RESUME_FAILED:"恢复播放失败",CALL_END:"通话已结束",USER_DO_NOT_OWN_DEVICE:"loadingSetTextWithBtn",NO_CLOUD_RECORD:"该设备在当天没有云录制的录像",CHANGE_VIDEO_LEVEL:"切换清晰度",CHANGE_VIDEO_LEVEL_FAIL:"切换清晰度失败",GET_VIDEO_LEVEL_LIST:"获取设备支持的清晰度列表",PLEASE_INPUT_RIGHT_VIDEO_LEVEL:"请输入正确的清度",VIDEO_LEVEL_NOT_SUPPORT:"当前设备不支持该清晰度",VIDEO_LEVEL_FLUENT:"流畅",VIDEO_LEVEL_SATNDARD:"标清",VIDEO_LEVEL_HEIGH:"高清",VIDEO_LEVEL_SPUER:"超清",VIDEO_LEVEL_EXTREME:"极清",VIDEO_LEVEL_3K:"3K",VIDEO_LEVEL_4k:"4K",RESET_THEME:"重置主题",BTN_PLAY:"播放/结束播放",BTN_SOUND:"声音",BTN_RECORDVIDEO:"录屏",BTN_CAPTURE:"截图",BTN_TALK:"对讲",BTN_ZOOM:"电子放大",BTN_3D_ZOOM:"3D定位",BTN_PTZ:"云台控制",BTN_EXPEND:"全局全屏",BTN_WEBEXPEND:"网页全屏",BTN_HD:"画面清晰度",BTN_SPEED:"回放倍速",BTN_CLOUDREC:"云存储回放",BTN_CLOUDRECORD:"云录制",BTN_REC:"本地存储",DEVICE_NAME:"设备名称",DEVICE_ID:"设备序列号",CAPTURE_SUCCESS:"截图成功",CAPTURE_FAILED:"截图失败",START_RECORD_SUCCESS:"开始录制成功",START_RECORD_FAILED:"开始录制失败",STOP_RECORD_SUCCESS:"停止录制成功",STOP_RECORD_FAILED:"停止录制失败",RECORD_TIPS:"今日录像",RECORDS:"个录像",OPEN_SOUND:"开启声音",CLOSE_SOUND:"关闭声音",ZOOM:"电子放大",START_ZOOM:"开启电子放大",CLOSE_ZOOM:"关闭电子放大",ZOOM_ADD:"+",ZOOM_SUB:"-",ZOOM_ADD_MAX:"已经放大到最大倍数8.0X",ZOOM_SUB_MIN:"已经缩小到最小倍数1.0X",ZOOM_LIMIT_MAX:"超出最大倍率8.0X",ZOOM_LIMIT_MIN:"超出最小倍率1.0X","3D_ZOOM":"3D定位","3D_ZOOM_DISABLE":"未启用3D定位功能","3D_ZOOM_FAILED":"3D定位失败,请重试",START_3D_ZOOM:"开启3D定位",CLOSE_3D_ZOOM:"关闭3D定位",DEVICE_NOT_SUPPORT_3D_ZOOM:"当前设备不支持3D定位功能","3D_ZOOM_ACTIVED":"3D定位已处于开启状态","3D_ZOOM_NOT_ACTIVED":"未启用3D定位功能","3D_ZOOM_CLOSED":"3D定位已处于关闭状态",CHANGE_ZOOM_TYPE:"改变缩放模式",FULLSCREEN:"全局全屏",FULLSCREEN_EXIT:"退出全局全屏",GET_WEB_FULLSCREEN_STATUS:"获取浏览器网页全屏状态",WEB_FULLSCREEN:"开启网页全屏",WEB_FULLSCREEN_EXIT:"退出网页全屏",DESTROY:"销毁",GET_CAPACITY:"获取设备能力级",GET_CAPACITY_FAILED:"获取设备能力级失败",GET_PTZ_STATUS:"获取当前云台状态",GET_PTZ_STATUS_FAILED:"未加载Theme模块,无法获取云台状态",MOBILE_HIDE_PTZ:"移动端,非全屏状态不展示云台",OPTION_PTZ_FAILED:"未加载Theme模块,无法操作云台",MOBILE_PTZ_TIPS:"请通过操控云台来调整摄像机视角",PTZ_FAST:"快",PTZ_MID:"中",PTZ_SLOW:"慢",PTZ_SPEED:"调整云台转动速度",DEVICE_ZOOM:"控制设备放大/缩小画面",DEVICE_FOCUS:"调整设备焦距",NOT_SUPPORT_DEVICE_ZOOM:"当前设备不支持物理缩放",NOT_SUPPORT_FOCUS:"当前设备不支持变焦",MIRROR:"镜像翻转",MIRROR_TYPE_ERROR:"翻转参数类型错误",CHANGE_FEC_TYPE:"切换鱼眼矫正类型",DEVICE_NOT_SUPPORT:"设备不支持鱼眼模式",TYPE_NOT_SUPPORT:"鱼眼矫正类型暂时不支持",FEC_SUPPORT_VERSION:"当前只有V3软解支持鱼眼矫正",NO_CANVAS_ID:"鱼眼矫正类型需要分屏,但是没有传正确的分屏的canvas id",SET_FEC_PARAMS:"设置3D矫正视角参数",GET_FEC_PARAMS:"获取3D矫正视角参数",SET_FEC_PARAMS_FAILED:"该矫正类型不能设置3D矫正视角参数",GET_FEC_PARAMS_FAILED:"该矫正类型不能获取3D矫正视角参数",GET_FEC_PARAMS_SUPPORT_VERSION:"当前只有V3软解支持鱼眼矫正获取3D矫正视角参数",SET_WATERMARK:"设置水印"},U={391001:"Illegal streaming address or port",395e3:"Internal service exception, please try again later",395400:"Preview streaming parameter exception",395402:"Device has no recording in the current time period, please select another time period",395403:"Service exception, please try again or contact customer service",395404:"The device is not online, Please optimize the network and restart the device to try again",395405:"Device side network is poor, please check and optimize the network and restart the device to try again",395406:"Token expired, please try again",395407:"Client URL format error",395409:"Service exception, please try again or contact customer service",395410:"Service exception, please try again or contact customer service",395411:"No permission to view the current device",395412:"Service exception, please try again or contact customer service",395413:"Service exception, please try again or contact customer service",395415:"Device channel error",395416:"The current number of viewing channels has reached the maximum limit of the device. Please restart the device or contact the device after-sales service",395451:"The device does not support this bitstream type. Please check the device channel support or contact the hardware after-sales service",395452:"The network on the device side is poor. Please check and optimize the network and restart the device to try again",395454:"The network on the device side is poor. Please check and optimize the network and restart the device to try again",395455:"The device channel is abnormal. Please check the channel configuration and try again",395456:"The device channel is abnormal. Please check the channel configuration and try again",395457:"Service exception, please try again or contact customer service",395458:"Service exception, please try again or contact customer service",395459:"Service exception, please try again or contact customer service",395460:"Service exception, please try again or contact customer service",395492:"Service exception, please try again or contact customer service",395500:"Service exception, please try again or contact customer service",395501:"Service exception, please try again or contact customer service",395503:"Service exception, please try again or contact customer service",395504:"Service exception, please try again or contact customer service",395505:"Service exception, please try again or contact customer service",395506:"Direct streaming of this device is not supported at present, please try again or contact customer service after connecting to NVR",395507:"Device 4G unlimited traffic package only supports EZVIZ Cloud Video APP, please contact APP customer service to change the package",395530:"Service exception, please try again or contact customer service",395544:"Video source does not exist, please check device configuration",395545:"Service exception, please try again or contact customer service",395546:"The number of simultaneous viewers has reached the maximum limit of the account, please contact customer service",395547:"The number of simultaneous viewers has reached the maximum limit of the account, please contact customer service",395556:"Service exception, please try again or contact customer service",395557:"Device streaming failed, please contact hardware after-sales",395558:"Error in finding the start time of recording",395560:"Service exception, please try again or contact customer service",395561:"Service exception, please try again or contact customer service",395562:"Service exception, please try again or contact customer service",395563:"Service exception, please try again or contact customer service",395564:"Service exception, please try again or contact customer service",395566:"Service exception, please try again or contact customer service",395567:"Service exception, please try again or contact customer service",395568:"Service exception, please try again or contact customer service",395569:"Service exception, please try again or contact customer service",395600:"Service exception, please try again or contact customer service",395601:"Service exception, please try again or contact customer service",395602:"Service exception, please try again or contact customer service",395610:"Service exception, please try again or contact customer service",395620:"Service exception, please try again or contact customer service",395701:"Service exception, please try again or contact customer service",395702:"Service exception, please try again or contact customer service",395703:"Service exception, please try again or contact customer service",396001:"Service exception, please try again or contact customer service",396099:"Service exception, please try again or contact customer service",396101:"Service exception, please try again or contact customer service",396102:"Service exception, please try again or contact customer service",396103:"Service exception, please try again or contact customer service",396104:"Service exception, please try again or contact customer service",396105:"Device abnormality, please try again or contact customer service",396106:"Device channel abnormality, please check the channel configuration and try again",396107:"Device abnormality, please try again or contact customer service",396108:"Service exception, please try again or contact customer service",396109:"Service exception, please try again or contact customer service",396110:"Device abnormality, please try again or contact customer service",396501:"Device abnormality, please try again or contact customer service",396502:"Device abnormality, please try again or contact customer service",396503:"Device abnormality, please try again or contact customer service",396504:"Device abnormality, please try again or contact customer service",396505:"Device abnormality, please try again or contact customer service",396506:"Device abnormality, please try again or contact customer service",396508:"Device abnormality, please try again or contact customer service",396509:"Device abnormality, please try again or contact customer service",396510:"Device abnormality, please try again or contact customer service",396511:"Device abnormality, please try again or contact customer service",396512:"Device abnormality, please try again or contact customer service",396513:"Device abnormality, please try again or contact customer service",396514:"Device abnormality, please try again or contact customer service",396515:"Device abnormality, please try again or contact customer service",396516:"Device abnormality, please try again or contact customer service",396517:"Device abnormality, please try again or contact customer service",396518:"Device abnormality, please try again or contact customer service",396519:"Device network abnormality, please check and optimize the network and restart the device to try again",396520:"Device network abnormality, please check and optimize the network and restart the device to try again",396700:"Service exception, please try again or contact customer service",396701:"Playback ends",397001:"Service exception, please try again or contact customer service",397002:"Service exception, please try again or contact customer service",397003:"Service exception, please try again or contact customer service",397004:"Service exception, please try again or contact customer service",397005:"Device streaming connection is disconnected, please check the network and try again",397006:"Service exception, please try again or contact customer service",397007:"Service exception, please try again or contact customer service",399e3:"Service exception, please try again or contact customer service",399001:"Client network timeout",399002:"Service exception, please try again or contact customer service",399016:"Token invalid, please update and retry",399048:"The number of simultaneous viewers has reached the maximum account limit, please contact customer service",399049:"The number of simultaneous viewers has reached the maximum account limit, please contact customer service",3810001:"Operation failed",3810002:"Account exception, operation failed",3810005:"Account exception, operation failed",3820002:"Device does not exist, please check the device connection status",3820006:"Operation failed, please check the network condition of the device",3820007:"Operation failed, please check the network condition of the device",3820008:"The operation is too frequent, please try again later",3820014:"Operation failed",3820032:"The channel does not exist. Please check the device connection status",3849999:"Operation failed, please try again",386e4:"Operation failed, the device does not support this operation",3860001:"Operation failed, user does not have permission",3860002:"The device has been rotated to the upper limit position",3860003:"The device has been rotated to the lower limit position",3860004:"The device has rotated to the left limit position",3860005:"The device has been rotated to the right limit position",3860006:"Operation failed, please try again",3860009:"The device is currently in operation",3860020:"Operation failed",BTN_RETRY:"Retry",BTN_RELOAD:"Reload",LOADING:"Loading, please wait",TIMEFORMAT_ERROR:"The time format is wrong, please confirm",USE_MULTITHREADING_WARING:"Your current browser can enable the multi-threaded feature of Google Labs to get a better playback experience and avoid browser freezes and crashes. For details, see:",OPEN_INSTRUCTIONS:"Enablement instructions",INIT_FINSHED:"Initialize the player completed",INIT_SUCCESS:"Initialize the player successfully",GET_PLAYURL_FAILED:"Failed to obtain the playback address",VIDEO_LOADING:"Video loading",DISCONNECT:"Connection disconnected, please try again",DEVICE_ENCRYPTED:"Device encrypted",NO_RECORD:"No video clips found",PLAY_FAILED:"Play failed, please check the device and client network",PLAY_SUCCESS:"Play successfully",STOP_SUCCESS:"Stop successfully",CHANGE_PLAYURL_SUCCESS:"Switch the playback address successfully",CHANGE_PLAYURL_FAILED:"Switch the playback address failed",GET_OSD_TIME:"Get OSD time",GET_OSD_TIME_FAILED:"Failed to get OSD time",SET_POSTER:"Set the player cover",RESIZE:"Adjust the player size",SPEED:"speeds",SPEED_RATE:"X",SPEED_CANCEL:"Cancel",GET_SPEED:"Get the current playback rate",MAX_SPEED_LIMIT:"The maximum playback speed is 4 times the speed",MIN_SPEED_LIMIT:"The minimum playback speed is 1 times the speed",SEEK_CANNOT_CROSS_DAYS:"The seek time cannot cross dates",SEEK_TIMEFORMAT_ERROR:"The seek time format is wrong",PAUSE:"Pause",PAUSE_FAILED:"Pause failed",RESUME:"Resume playback",RESUME_FAILED:"Resume playback failed",CALL_END:"Call ended",USER_DO_NOT_OWN_DEVICE:"loadingSetTextWithBtn",NO_CLOUD_RECORD:"The device has no cloud recorded video on that day",CHANGE_VIDEO_LEVEL:"Switch definition",CHANGE_VIDEO_LEVEL_FAIL:"Switch definition failed",GET_VIDEO_LEVEL_LIST:"Get the definition list supported by the device",PLEASE_INPUT_RIGHT_VIDEO_LEVEL:"Please enter the correct definition",VIDEO_LEVEL_NOT_SUPPORT:"The current device does not support this definition",VIDEO_LEVEL_FLUENT:"Fluent",VIDEO_LEVEL_SATNDARD:"Standard",VIDEO_LEVEL_HEIGH:"heigh",VIDEO_LEVEL_SPUER:"Super",VIDEO_LEVEL_EXTREME:"Extreme",VIDEO_LEVEL_3K:"3K",VIDEO_LEVEL_4k:"4K",RESET_THEME:"Reset theme",BTN_PLAY:"Play/end playback",BTN_SOUND:"Sound",BTN_RECORDVIDEO:"Screen recording",BTN_CAPTURE:"Screenshot",BTN_TALK:"Intercom",BTN_ZOOM:"Electronic zoom",BTN_3D_ZOOM:"3D positioning",BTN_PTZ:"PTZ control",BTN_EXPEND:"Global full screen",BTN_WEBEXPEND:"Web page full screen",BTN_HD:"Image definition",BTN_SPEED:"Playback speed",BTN_CLOUDREC:"Cloud storage playback",BTN_CLOUDRECORD:"Cloud recording",BTN_REC:"Local storage",DEVICE_NAME:"Device name",DEVICE_ID:"Device serial number",CAPTURE_SUCCESS:"Screenshot successful",CAPTURE_FAILED:"Screenshot failed",START_RECORD_SUCCESS:"Start recording successful",START_RECORD_FAILED:"Screenshot failed",STOP_RECORD_SUCCESS:"Stop recording successful",STOP_RECORD_FAILED:"Stop recording failed",RECORD_TIPS:"Today's recording",RECORDS:" in total",OPEN_SOUND:"Turn on sound",CLOSE_SOUND:"Turn off sound",ZOOM:"Electronic zoom",START_ZOOM:"Turn on electronic zoom",CLOSE_ZOOM:"Turn off electronic zoom",ZOOM_ADD:"+",ZOOM_SUB:"-",ZOOM_ADD_MAX:"It has been enlarged to a maximum magnification of 8.0X",ZOOM_SUB_MIN:"It has been reduced to the minimum multiple of 1.0X",ZOOM_LIMIT_MAX:"Exceeding maximum magnification of 8.0X",ZOOM_LIMIT_MIN:"Exceeding the minimum magnification of 1.0X","3D_ZOOM":"3D positioning","3D_ZOOM_DISABLE":"3D positioning function not enabled","3D_ZOOM_FAILED":"3D positioning failed, please try again",START_3D_ZOOM:"Turn on 3D positioning",CLOSE_3D_ZOOM:"Turn off 3D positioning",DEVICE_NOT_SUPPORT_3D_ZOOM:"Current device does not support 3D positioning function","3D_ZOOM_ACTIVED":"3D positioning is already enabled","3D_ZOOM_NOT_ACTIVED":"3D positioning function is not enabled","3D_ZOOM_CLOSED":"3D positioning is already disabled",CHANGE_ZOOM_TYPE:"Change zoom mode",FULLSCREEN:"Global full screen",FULLSCREEN_EXIT:"Exit global full screen",GET_WEB_FULLSCREEN_STATUS:"Get browser web page full screen status",WEB_FULLSCREEN:"Turn on web page full screen",WEB_FULLSCREEN_EXIT:"Exit full screen webpage",DESTROY:"Destroy",GET_CAPACITY:"Get device capability level",GET_CAPACITY_FAILED:"Get device capability level failed",GET_PTZ_STATUS:"Get current PTZ status",GET_PTZ_STATUS_FAILED:"Theme module is not loaded, PTZ status cannot be obtained",MOBILE_HIDE_PTZ:"Mobile terminal, PTZ is not displayed in non-full screen state",OPTION_PTZ_FAILED:"Theme module is not loaded, PTZ cannot be operated",MOBILE_PTZ_TIPS:"Adjust camera angle by manipulating gimbal",PTZ_FAST:"F",PTZ_MID:"M",PTZ_SLOW:"S",PTZ_SPEED:"Adjust the PTZ rotation speed",DEVICE_ZOOM:"Control the device to zoom in/out of the screen",DEVICE_FOCUS:"Adjusting the device's focal length",NOT_SUPPORT_DEVICE_ZOOM:"Device does not support physical zoom",NOT_SUPPORT_FOCUS:"Device does not support adjusting the focal length",MIRROR:"Mirror flip",MIRROR_TYPE_ERROR:"Flip parameter type error",CHANGE_FEC_TYPE:"Switch fisheye correction type",DEVICE_NOT_SUPPORT:"Device does not support fisheye mode",TYPE_NOT_SUPPORT:"Fisheye correction type is not supported temporarily",FEC_SUPPORT_VERSION:"Currently only V3 software solution supports fisheye correction",NO_CANVAS_ID:"Fisheye correction type requires split screen, but the correct split screen canvas id is not passed",SET_FEC_PARAMS:"Set 3D correction perspective parameters",GET_FEC_PARAMS:"Get 3D correction perspective parameters",SET_FEC_PARAMS_FAILED:"This correction type cannot set 3D correction perspective parameters",GET_FEC_PARAMS_FAILED:"This correction type cannot get 3D correction perspective parameters",GET_FEC_PARAMS_SUPPORT_VERSION:"Currently only V3 software solution supports fisheye correction Get 3D correction perspective parameters",SET_WATERMARK:"Set watermark"},J={color:"red",backgroundColor:"red",activeColor:"red",btnList:[{btnKey:"ade5d065a113432e8091a1c5bc819c57-934f270c08b14e928bf0c2ae8e1a937d-header-0",iconId:"deviceID",part:"left",defaultActive:1,isrender:1,themeId:"934f270c08b14e928bf0c2ae8e1a937d"},{btnKey:"ade5d065a113432e8091a1c5bc819c57-934f270c08b14e928bf0c2ae8e1a937d-header-1",iconId:"deviceName",part:"left",defaultActive:1,isrender:1,themeId:"934f270c08b14e928bf0c2ae8e1a937d"}]},H={color:"blue",backgroundColor:"blue",activeColor:"blue",btnList:[{btnKey:"ade5d065a113432e8091a1c5bc819c57-934f270c08b14e928bf0c2ae8e1a937d-footer-0",iconId:"play",part:"left",defaultActive:0,isrender:0,themeId:"934f270c08b14e928bf0c2ae8e1a937d"}]},K=function(A){this.jsPlugin=A;var e={id:A.id,isMouseDown:!1,isOver:!1,mousePosition:null,oldTime:null,nowTime:A.nowTime||null,moved:null,hoverTime:"2018-12-07 12:00:00",hoverLeft:0,timeTipShow:!1,randomNum:123,timeWidthTbls:[60,1800,3600,86400],timeUnits:["范围: 1分钟; 单位: 秒","范围: 30分钟; 单位: 分钟","范围: 1小时; 单位: 分钟","范围: 1天; 单位: 小时","范围: 3天; 单位: 小时"],drawPen:null,timeSection:[],canvasWidth:null,canvasHeight:null,timeTips:null},t=this;Object.keys(e).forEach((function(A){t[A]=e[A]})),this.options={width:this.canvasWidth,height:48,time:(new Date).getTime(),timeSection:[],timeWidth:0},this.subTime=function(A){return A<10?"0"+A:A},this.tranTime=function(A){var e=A;if(A){var t=new Date(A);e=t.getFullYear()+"/"+(t.getMonth()+1)+"/"+t.getDate()+" "+this.subTime(t.getHours())+":"+this.subTime(t.getMinutes())+":"+this.subTime(t.getSeconds())}return e},this.init=function(A){var e=this.options;return new Promise((function(i,n){A.width&&document.getElementById(A.id).setAttribute("width",parseInt(A.width,10)+"px"),t.randomNum=(Math.random()+"").split(".").join(""),t.timeWidthTblIndex=e.timeWidth;var a=document.getElementById("".concat(t.jsPlugin.id,"-canvas"));t.drawPen=a.getContext("2d"),t.nowTime=A.nowTime,t.timeSection=e.timeSection||[],t.canvasWidth=a.offsetWidth,t.canvasHeight=a.offsetHeight,t.updata(),document.getElementById("".concat(t.jsPlugin.id,"-canvas")).addEventListener("mousemove",(function(A){t.options.readOnly||t.mousemove(A)})),document.getElementById("".concat(t.jsPlugin.id,"-canvas")).addEventListener("mouseover",(function(A){t.options.readOnly||t.mouseover(A)})),document.getElementById("".concat(t.jsPlugin.id,"-canvas")).addEventListener("mouseleave",(function(A){t.options.readOnly||t.mouseleave(A)})),document.getElementById("".concat(t.jsPlugin.id,"-canvas")).addEventListener("mousedown",(function(A){t.options.readOnly||t.mousedown(A)})),document.getElementById("".concat(t.jsPlugin.id,"-canvas")).addEventListener("mouseup",(function(e){if(!t.options.readOnly){var i=A.onChange;t.mouseUpFn(e,i)}})),i()}))},this.setWidth=function(A){A.width&&(document.getElementById(A.id).width=A.width,document.getElementById("".concat(A.id,"-canvas")).width=A.width,document.getElementById("".concat(A.id,"-canvas-container")).width=A.width,t.canvasWidth=A.width,t.updata({time:t.nowTime||new Date}))},this.mousemove=function(A){if(this.isMouseDown&&this.isOver){var e=this.mousePosition-A.pageX;if(0===e)return;var t=0;switch(this.timeWidth){case 60:t=.1;break;case 1800:t=3;break;case 3600:t=90;break;case 86400:t=120}var i=new Date(this.oldTime).getTime()+e*t*1e3;this.updata({time:i}),this.moved=!0}else{var n=parseInt(document.getElementById("".concat(this.jsPlugin.id,"-canvas-container")).offsetLeft,10);this.mousePosition=A.pageX-n,this.updata()}},this.mousedown=function(A){this.isMouseDown=!0,this.mousePosition=A.pageX,this.oldTime=this.nowTime},this.mouseover=function(A){this.isOver=!0},this.mouseleave=function(A){this.isOver=!1,this.isMouseDown=!1,this.updata()},this.changeSize=function(A){console.log("changeSize",A),this.options.timeWidth=A,this.updata({timeWidth:A})},this.mouseUpFn=function(A,e){if(this.isMouseDown&&(this.isMouseDown=!1,this.moved)){this.moved=!1;var t=new Date(this.nowTime).getFullYear()+"/"+(new Date(this.nowTime).getMonth()+1)+"/"+new Date(this.nowTime).getDate()+" "+this.subTime(new Date(this.nowTime).getHours())+":"+this.subTime(new Date(this.nowTime).getMinutes())+":"+this.subTime(new Date(this.nowTime).getSeconds());this.nowTime=new Date(t),this.updata({time:this.nowTime}),this.oldTime=this.nowTime,console.log("nowTime",new Date(this.nowTime),t),e(this.nowTime)}},this.readOnly=function(A){console.log("更改为只读"),this.options.readOnly=!0,document.getElementById("".concat(this.jsPlugin.id,"-canvas")).style.cursor="not-allowed"},this.unReadOnly=function(A){console.log("更改为只读"),this.options.readOnly=!1,document.getElementById("".concat(this.jsPlugin.id,"-canvas")).style.cursor="pointer"},this.run=function(A){t.isMouseDown||t.updata(A)},this.getTime=function(A){console.log("this",this),console.log("当前时间",new Date(this.nowTime))},this.updata=function(A){A=A||{},t.nowTime=A.time||t.nowTime,t.timeSection=A.timeSection||t.timeSection,t.timeWidthTblIndex=A.timeWidth||t.timeWidthTblIndex,t.timeWidth=t.timeWidthTbls[A.timeWidth||t.timeWidthTblIndex],t.timeUnit=t.timeUnits[A.timeWidth||t.timeWidthTblIndex],0===A.timeWidth&&(t.timeWidthTblIndex=0,t.timeWidth=t.timeWidthTbls[0],t.timeUnit=t.timeUnits[0]),t.drawPen.fillStyle="#000000",t.drawPen.fillRect(0,0,t.canvasWidth,t.canvasHeight),t.drawScale(),t.drawRecord(),t.drawOtherMsg()},this.drawSolidLine=function(A,e,t,i,n,a){this.drawPen.save(),this.drawPen.strokeStyle=a,this.drawPen.lineWidth=n,this.drawPen.beginPath(),this.drawPen.moveTo(A,e),this.drawPen.lineTo(t,i),this.drawPen.stroke(),this.drawPen.restore()},this.drawString=function(A,e,t,i,n){this.drawPen.font="12px serif",this.drawPen.fillStyle="#ffffff",this.drawPen.textAlign=i||"left",this.drawPen.fillText(A,e,t+10)},this.drawScale=function(){var A=this,e="rgba(255,255,255)",t=new Date(A.nowTime),i=t.getSeconds(),n=t.getMinutes(),a=t.getHours(),r=t.getDate(),o=0;switch(A.timeWidth){case 60:var s=parseInt(A.canvasWidth/10);t.setSeconds(t.getSeconds()-parseInt(s/2,10)),r=t.getDate(),a=t.getHours(),n=t.getMinutes(),i=t.getSeconds();for(var g=0;ge.canvasWidth&&(i=e.canvasWidth),i<=0&&(i=0),i}},this.drawOtherMsg=function(){this.drawSolidLine(this.canvasWidth/2,0,this.canvasWidth/2,this.canvasHeight,2,"#1890FF"),this.drawPen.shadowBlur=0,this.isOver&&!this.isMouseDown?(this.mouseTime=this.mousePosition/this.canvasWidth*this.timeWidth*1e3+this.nowTime-this.timeWidth/2*1e3,this.mouseString=this.tranTime(this.mouseTime),this.hoverTime=this.mouseString,this.hoverLeft=this.mousePosition-60,this.timeTipShow=!0):this.timeTipShow=!1}},V="https://open.ys7.com",O=256,j=1536,W=2304,Z=[{place:3,name:"鱼眼不矫正",type:0,correctType:0},{place:3,name:"360°全景",type:1,correctType:768},{place:3,name:"4分屏",type:4,correctList:[{correctType:O,x:.25,y:.25},{correctType:O,x:.75,y:.25},{correctType:O,x:.25,y:.75},{correctType:O,x:.75,y:.75}],correctType:O},{place:3,name:"柱状",type:5,correctType:j,viewParam:{x:0,y:0}}],X=[{place:1,name:"鱼眼不矫正",type:0,correctType:0},{place:1,name:"360°全景",type:1,correctType:768},{place:1,name:"4分屏",type:2,correctList:[{correctType:O,x:.25,y:.25},{correctType:O,x:.75,y:.25},{correctType:O,x:.25,y:.75},{correctType:O,x:.75,y:.75}],correctType:O},{place:1,name:"广角",type:4,correctType:W}];var q=V,z=function(){return a((function A(e){return t(this,A),A.instant?A.instant:(q=e||q,A.instant=this)}),[{key:"setDomain",value:function(A){q=A||q}},{key:"fetch",value:function(A){function e(e,t){return A.apply(this,arguments)}return e.toString=function(){return A.toString()},e}((function(A,e){return A="string"==typeof A?/^http/.test(A)?A:q+A:A,new Promise((function(t,i){fetch(A,e).then((function(A){try{return A.json()}catch(A){i({code:-1,msg:"data json parse error"})}})).then((function(A){200==+A.code||A.meta&&200===A.meta.code?t(A):i(A)})).catch((function(A){i(A)}))}))}))}])}();function AA(A){var e=A.slice(0,4),t=A.slice(4,6),i=A.slice(6,8),n=A.slice(8,10),a=A.slice(10,12),r=A.slice(12,14);return new Date("".concat(e,"/").concat(t,"/").concat(i," ").concat(n,":").concat(a,":").concat(r))}function eA(A,e){var t,i,n={startTime:e.startTime?new Date(e.startTime).Format("yyyy-MM-dd hh:mm:ss"):void 0,endTime:e.startTime?new Date(e.endTime).Format("yyyy-MM-dd hh:mm:ss"):void 0,spaceId:e.spaceId},a=Object.keys(n).reduce((function(A,e){return null==n[e]?A:A+="&".concat(e,"=").concat(encodeURIComponent(n[e]))}),"").replace("&",""),r=A.env.domain+"/api/service/cloudrecord/video/info/list?".concat(a);return(t=r,i={method:"get",headers:{accessToken:A.accessToken||A.token.deviceToken.global,deviceSerial:e.deviceSerial,localIndex:e.channelNo}},new Promise((function(A,e){fetch(t,i).then((function(A){return A.json()})).then((function(t){200==+t.code||t.meta&&200===t.meta.code?A(t):e(t)})).catch((function(A){e(A)}))}))).then((function(A){return A.data=(A.data||[]).map((function(A){return A.endTime=AA(A.stopTime).getTime(),A.startTime=AA(A.startTime).getTime(),A.busType=7,A})),A}))}function tA(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(e<=-24||e>=24)&&(e=0);var t=A.slice(0,4),i=A.slice(4,6),n=A.slice(6,8),a=A.slice(8,10),r=A.slice(10,12),o=A.slice(12,14),s=new Date(Date.UTC(t,i-1,n,a,r,o));s.setHours(s.getHours()+e),s>new Date&&(s=new Date);var g=s.getUTCFullYear(),c=("0"+(s.getUTCMonth()+1)).slice(-2),l=("0"+s.getUTCDate()).slice(-2),I=("0"+s.getUTCHours()).slice(-2),d=("0"+s.getUTCMinutes()).slice(-2),C=("0"+s.getUTCSeconds()).slice(-2);return new Date("".concat(g,"/").concat(c,"/").concat(l," ").concat(I,":").concat(d,":").concat(C))}o(z,"instant",void 0);var iA=function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(e<=-24||e>=24)&&(e=0);var t=60*e*60*1e3,i=A.getTime()+t;return new Date(i)},nA=function(){return a((function A(e){if(t(this,A),this.jSPlugin=e,!document.getElementById("".concat(this.jSPlugin.id,"-audioControls")))return!1;this.currentTimeWidth=0,this.date=new Date,this.datepickerVisible=!1,this.seekTimer=null,this.disabled=!1,this.isSeeking=!1,this.seekFrequency=2e3,this.recList=[],this.lastDate=null,this.nowTime=null,this.jSPlugin.params&&this.jSPlugin.params.seekFrequency&&(this.seekFrequency=this.jSPlugin.params.seekFrequency),this.datepickerLang={zh:"zh-CN",en:"en-US"},this.recInit()}),[{key:"recInit",value:function(){var A=this;if(!document.getElementById("".concat(this.jSPlugin.id,"-audioControls")))return!1;this.currentTimeWidth=0;var e=parseInt(getComputedStyle(document.getElementById(this.jSPlugin.id)).width,10)-100,t=document.createElement("div");t.style="display:inline-block;height:48px;",t.id=this.jSPlugin.id+"-canvas-container";var i=document.createElement("canvas");i.id=this.jSPlugin.id+"-canvas",i.className="time-line-body",i.height="48",i.width=e,i.style="display:inline-block;",i.innerHTML="该浏览器不支持canvas",t.appendChild(i),Q(t,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")));var n=document.createElement("div");n.className="timeline-controls",n.style="display:flex;width:100px;height:48px;text-align:center;line-height: 48px;vertical-align: top;background: #000000;";var a='\n
\n \n \n add\n \n \n \n \n \n \n \n \n \n \n \n \n \n reduce\n \n \n \n \n \n \n \n \n
\n\n\n');n.innerHTML=a,Q(n,t),this.timeLine=new K(this.jSPlugin);var r,o,s=this;this.timeLine.init({id:this.jSPlugin.id+"-canvas",width:e,nowTime:this.nowTime,onChange:function(e){console.log("time",e,new Date(e).Format("yyyyMMddhhmmss"));var t=new Date(e).Format("yyyyMMddhhmmss");if(console.log("----------------this.jSPlugin.url",A.jSPlugin.url),A.jSPlugin.Theme&&A.jSPlugin.Theme.decoderState.state.recordvideo&&(A.jSPlugin.Theme.setDecoderState({recordvideo:!1}),"cloud.rec"===y(A.jSPlugin.url).type&&A.jSPlugin.stopSave()),"cloud.rec"===y(A.jSPlugin.url).type||A.jSPlugin.useSeek&&A.jSPlugin.capacity&&"1"==A.jSPlugin.capacity.support_seek_playback)A.isSeeking||s.recList.length>0&&(new Date(e).valueOf()>=s.lastDate?A.jSPlugin.pluginStatus.loadingSetText({text:"seek回放未找到录像片段",color:"red",delayClear:2e3}):A.unSyncTimeLine().then((function(){A.isSeeking=!0,A.jSPlugin.pluginStatus.loadingStart(A.jSPlugin.id),A.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),A.jSPlugin.pluginStatus.loadingSetText({text:A.jSPlugin.i18n.t("LOADING")}),A.jSPlugin.Theme.setDisabled(!0),A.jSPlugin._tempSeekTime=e,A.jSPlugin.seek(t.substr(8,6),"235959").then((function(){var t=setInterval((function(){A.jSPlugin._destroy?clearInterval(t):A.jSPlugin.getOSDTime().then((function(i){var n=new Date(e).valueOf()/1e3;if(console.log("seek时间同步:",new Date(1e3*i.data).Format("hh:mm:ss"),new Date(1e3*n).Format("hh:mm:ss"),i.data>=n),i.data>=n-2){if(A.isSeeking=!1,A.syncTimeLine(),clearInterval(t),A.jSPlugin.pluginStatus.loadingStop(A.jSPlugin.id),A.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),A.jSPlugin.pluginStatus.loadingClear(),A.jSPlugin.Theme.setDisabled(!1),A.jSPlugin._tempSeekTime=null,A.jSPlugin.Theme)A.jSPlugin.Theme.decoderState.state.sound&&A.jSPlugin.openSound();s.jSPlugin.waterMark_JSPlugin&&s.jSPlugin.setWaterMarkFont(s.jSPlugin.waterMark_JSPlugin)}}))}),1e3)}))})));else{var i=function(){setTimeout((function(){A.disabled=!1}),A.seekFrequency)},n=A.jSPlugin.Theme.decoderState.state.play,a=function(e){A.disabled=!0,n?A.unSyncTimeLine().then((function(){A.jSPlugin.pluginStatus.loadingStart(A.jSPlugin.id),A.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),A.jSPlugin.pluginStatus.loadingSetText({text:A.jSPlugin.i18n.t("LOADING")}),A.jSPlugin.Theme.setDisabled(!0);var i=A.jSPlugin.url;i.indexOf("begin")>-1?i=i.replace(/(begin=)(\d+)/,(function(A,e,i){return e+t})):i+="?begin=".concat(t),A.jSPlugin.play({url:i}).then((function(){e&&e(),A.syncTimeLine(),A.jSPlugin.pluginStatus.loadingStop(A.jSPlugin.id),A.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),A.jSPlugin.pluginStatus.loadingClear(),A.jSPlugin.Theme.setDisabled(!1),s.jSPlugin.waterMark_JSPlugin&&s.jSPlugin.setWaterMarkFont(s.jSPlugin.waterMark_JSPlugin)})).catch((function(A){console.log("时间轴拖动失败:",A)}))})):A.unSyncTimeLine().then((function(){A.jSPlugin.pluginStatus.loadingStart(A.jSPlugin.id),A.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),A.jSPlugin.pluginStatus.loadingSetText({text:A.jSPlugin.i18n.t("LOADING")}),A.jSPlugin.Theme.setDisabled(!0),A.jSPlugin.pause(t).then((function(){console.log("暂停成功"),A.jSPlugin.resume(t).then((function(t){A.jSPlugin.Theme&&A.jSPlugin.Theme.setDecoderState({play:!0}),A.jSPlugin.Theme&&A.jSPlugin.Theme.decoderState.state.sound&&A.jSPlugin.openSound(),e&&e(),A.syncTimeLine(),A.jSPlugin.pluginStatus.loadingStop(A.jSPlugin.id),A.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),A.jSPlugin.pluginStatus.loadingClear(),A.jSPlugin.Theme.setDisabled(!1)})).catch((function(A){console.log("恢复失败",A)}))})).catch((function(){console.log("暂停失败"),A.jSPlugin.resume(t).then((function(t){A.jSPlugin.Theme&&A.jSPlugin.Theme.setDecoderState({play:!0}),e&&e(),A.syncTimeLine(),A.jSPlugin.pluginStatus.loadingStop(A.jSPlugin.id),A.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),A.jSPlugin.pluginStatus.loadingClear(),A.jSPlugin.Theme.setDisabled(!1)})).catch((function(A){console.log("恢复失败",A)}))}))})),A.jSPlugin.Theme&&A.jSPlugin.Theme.decoderState&&A.jSPlugin.Theme.decoderState.state&&A.jSPlugin.Theme.decoderState.state.zoom&&(A.jSPlugin.Theme.setDecoderState({zoom:!1}),A.jSPlugin.Zoom.stopZoom())};A.disabled?(console.log("操作频繁,等待2秒后执行"),A.seekTimer&&clearTimeout(A.seekTimer),A.seekTimer=setTimeout((function(){a(i)}),A.seekFrequency)):a(i)}}}).then((function(){A.syncTimeLine()})),r=s.jSPlugin,o=document.getElementById("".concat(r.id,"-wrap")),B("".concat(r.staticPath,"/rec/datepicker.min.css")),u("".concat(r.staticPath,"/rec/jquery.min.js"),(function(A){u("".concat(A.staticPath,"/rec/datepicker.js"),(function(A){u("".concat(A.staticPath,"/rec/datepicker.").concat(s.datepickerLang[A.language],".js"),(function(A){var e=o.getElementsByClassName("datepicker-container")[0];!e&&$("#".concat(A.id,"-datepicker")).datepicker&&$("#".concat(A.id,"-datepicker")).datepicker({autoShow:!1,autoHide:!0,autoPick:!0,language:s.datepickerLang[A.language],date:new Date(f("begin",A.params.url).replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"))||new Date,format:"yyyy-mm-dd",endDate:new Date,inline:!0,container:o}),(e=o.getElementsByClassName("datepicker-container")[0])&&(e.style.display="none"),s.datepickerVisible=!1,$("#".concat(A.id,"-datepicker")).on("pick.datepicker",(function(t){if(console.log("重新选择日期",t.date,new Date(t.date).Format("yyyyMMddhhmmss"),new Date(document.getElementById("".concat(A.id,"-datepicker")).value).Format("yyyyMMdd")),t.date>new Date||new Date(t.date).Format("yyyyMMddhhmmss")===new Date(document.getElementById("".concat(A.id,"-datepicker")).value).Format("yyyyMMdd"))t.preventDefault();else{var i=new Date(t.date).Format("yyyy-MM-dd");document.getElementById("".concat(A.id,"-datepicker")).value=i,A.eventEmitter.emit("recStartTimeChange",{code:0,data:{time:i}}),s.renderRec(t.date),A.Theme.decoderState&&A.Theme.decoderState.state?A.Theme.decoderState.state.cloudRec?A.changePlayUrl({begin:new Date(t.date).Format("yyyyMMddhhmmss"),type:"cloud.rec"},(function(){}),!1):A.Theme.decoderState.state.rec?A.changePlayUrl({begin:new Date(t.date).Format("yyyyMMddhhmmss"),type:"rec"},(function(){}),!1):A.changePlayUrl({begin:new Date(t.date).Format("yyyyMMddhhmmss")},(function(){}),!1):A.changePlayUrl({begin:new Date(t.date).Format("yyyyMMddhhmmss")},(function(){}),!1)}e&&(e.style.display="none"),s.datepickerVisible=!1,A.Theme&&A.Theme.decoderState&&A.Theme.decoderState.state&&A.Theme.decoderState.state.zoom&&(A.Theme.setDecoderState({zoom:!1}),A.Zoom.stopZoom())})),$("#".concat(A.id,"-datepicker")).off("click").on("click",(function(A){console.log("点击日期"),s.datepickerVisible?e&&(e.style.display="none"):e&&(e.style.display="inline"),s.datepickerVisible=!s.datepickerVisible}))}),(function(){}),A)}),(function(){}),A)}),(function(){}),r),document.getElementById("".concat(this.jSPlugin.id,"-timeline-scale-add")).onclick=function(){A.unSyncTimeLine().then((function(){A.currentTimeWidth<3&&A.timeLine.changeSize(++A.currentTimeWidth),A.syncTimeLine()}))},document.getElementById("".concat(this.jSPlugin.id,"-timeline-scale-sub")).onclick=function(){A.unSyncTimeLine().then((function(){A.currentTimeWidth>0&&A.timeLine.changeSize(--A.currentTimeWidth),A.syncTimeLine()}))};var g=f("begin",this.jSPlugin.url)||(new Date).Format("yyyyMMdd");g=tA(g,f("timeZone",this.jSPlugin.url)?parseInt(f("timeZone",this.jSPlugin.url)):0),this.renderRec(g.Format("yyyy-MM-dd")),this.observer=new MutationObserver((function(A,e){}));var c=document.getElementById("".concat(this.jSPlugin.id));this.observer.observe(c,{attributes:!0,attributeOldValue:!0,attributeFilter:["style"]})}},{key:"setDatepickerDate",value:function(A){var e=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));if(e){var t=e.getElementsByClassName("datepicker-container")[0];if(t){var i=t;i.parentNode.removeChild(i),document.getElementById("".concat(this.jSPlugin.id,"-datepicker")).value=A.replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"),$("#".concat(this.jSPlugin.id,"-datepicker")).datepicker({autoShow:!1,autoHide:!0,autoPick:!0,language:"zh-CN",defaultDate:A,format:"yyyy-mm-dd",endDate:new Date,inline:!0,container:document.getElementById("".concat(this.jSPlugin.id,"-wrap"))})}}}},{key:"datepickerHide",value:function(){var A=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));A&&(A.getElementsByClassName("datepicker-container")[0].style.display="none");this.datepickerVisible=!1}},{key:"datepickerShow",value:function(){var A=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));A&&(A.getElementsByClassName("datepicker-container")[0].style.display="inline");this.datepickerVisible=!0}},{key:"recAutoSize",value:function(A){var e=this,t=this,i=parseInt(getComputedStyle(document.getElementById(t.jSPlugin.id)).width,10)-100;document.getElementById("".concat(this.jSPlugin.id,"-canvas"))&&i!==parseInt(document.getElementById("".concat(t.jSPlugin.id,"-canvas")).width)&&t.unSyncTimeLine().then((function(){t.timeLine.setWidth({id:"".concat(e.jSPlugin.id),width:i}),t.syncTimeLine(),A&&A()}))}},{key:"syncTimeLine",value:function(){var A=this;this.jSPlugin.recTimer&&clearInterval(this.jSPlugin.recTimer),window.recTimer?Array.isArray(window.recTimer[this.jSPlugin.id])&&window.recTimer[this.jSPlugin.id].map((function(A){clearInterval(A)})):window.recTimer={},window.recTimer[this.jSPlugin.id]=[];var e=this;this.jSPlugin.recTimer=setInterval((function(){e.jSPlugin.getOSDTime().then((function(t){var i=t.data;if(-1===i)console.log("获取播放时间错误");else if(i>0){var n=new Date(i>1e12?i:1e3*i);A.nowTime=n,e.timeLine.run({time:n})}})).catch((function(A){var t=e.jSPlugin.Theme.decoderState.state.pauseDate;e.timeLine.run({time:e.timeLine.nowTime||t})}))}),1e3),window.recTimer[this.jSPlugin.id].push(this.jSPlugin.recTimer)}},{key:"unSyncTimeLine",value:function(){var A=this;return new Promise((function(e,t){A.jSPlugin.recTimer&&(clearInterval(A.jSPlugin.recTimer),A.jSPlugin.recTimer=null),window.recTimer?Array.isArray(window.recTimer[A.jSPlugin.id])&&(window.recTimer[A.jSPlugin.id].map((function(A){clearInterval(A)})),window.recTimer[A.jSPlugin.id]=[]):window.recTimer={},e()}))}},{key:"renderRec",value:function(A){var e=this;this.date=A;var t=this,i=new Date(new Date(A).Format("yyyy-MM-dd 00:00:00").replace(/-/g,"/")).getTime();this.jSPlugin.timeZone&&-1===this.jSPlugin.url.indexOf(".cloud")&&(i=new Date(iA(new Date(i),this.jSPlugin.timeZone).Format("yyyy-MM-dd 00:00:00").replace(/-/g,"/")).getTime());var n=new Date(new Date(i).Format("yyyy-MM-dd 23:59:59").replace(/-/g,"/")).getTime();if(this.timeLine.getRecord([],i,n),this.jSPlugin._isCloudRecord&&-1!==this.jSPlugin.url.indexOf(".cloud")&&"7"===f("busType",this.jSPlugin.url)){var a={deviceSerial:y(this.jSPlugin.url).deviceSerial,channelNo:y(this.jSPlugin.url).channelNo,startTime:i,endTime:n,spaceId:this.jSPlugin._spaceId};eA(this.jSPlugin,a).then((function(A){if(A.data&&A.data.length>0){var a=A.data;t.recList=a,t.lastDate=a[a.length-1].endTime,e.timeLine.getRecord(a,i,n)}}))}else{var r={accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,recType:"cloud.rec"===y(this.jSPlugin.url).type?1:2,deviceSerial:y(this.jSPlugin.url).deviceSerial,channelNo:y(this.jSPlugin.url).channelNo,startTime:i,endTime:n,version:"2.0"},o=this.jSPlugin.env.domain+"/api/lapp/video/by/time";S(o,"POST",r,"",(function(A){if(A.data&&A.data.files&&A.data.files.length>0){var a=A.data.files,o=(new Date).getTime(),s=A.data.isAll;if(t.recList=a,t.lastDate=a[a.length-1].endTime,s)e.timeLine.getRecord(a,i,n);else{var g=function(){r.startTime=o,S(this.jSPlugin.env.domain+"/api/lapp/video/by/time","POST",r,"",(function(A){A.data&&A.data.files&&A.data.files.length>0&&0==A.data.isAll?(A.data.files&&(a=a.concat(A.data.files),t.recList=a,t.lastDate=a[a.length-1].endTime),o=A.data.nextFileTime>0?A.data.nextFileTime:(new Date).getTime(),g()):t.timeLine.getRecord(a,i,n)}))};g()}e.timeLine.run({time:new Date(i)})}else A.data&&A.data.length>0&&(t.recList=A.data,t.lastDate=A.data[A.data.length-1].endTime,t.timeLine.getRecord(A.data,i,n),t.timeLine.run({time:new Date(i)}))}))}}}])}(),aA=function(A){this.state={id:A.id,start:"00:00:00",end:"24:00:00",current:0,timelag:30,timeArr:[],availTimeLine:[],scrollTop:0,index:0,date:"",noTimeLineTxt:"",disabled:!1};var e=this;this.setState=function(A){Object.keys(A).forEach((function(t){e.state[t]=A[t],"scrollTop"===t&&document.getElementById("time-line-item").parentNode.scrollTo(0,A[t]),"current"===t&&(document.getElementById("time-line-current").innerHTML=A[t])}))},this.setDisabled=function(A){this.setState({disabled:A}),document.getElementById("time-line-item").parentNode.style.overflowY=A?"hidden":"scroll"},this.timeToSecond=function(A){var e=A.split(":"),t=Number(e[0]),i=Number(e[1]),n=Number(e[2]);return 60*t*60+60*i+(n||0)},this.minuteToTime=function(A){var e=Math.floor(A/60),t=A%60;return(e>9?e:"0"+e)+":"+(t>9?t:"0"+t)},this.timeToMinute=function(A){var e=A.split(":");return 60*Number(e[0])+Number(e[1])},this.getPlayParam=A.getPlayParam,this.checkIsAppleDevice=function(){var A=navigator.userAgent,e=!!A.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),t=A.indexOf("iPad")>-1,i=A.indexOf("iPhone")>-1||A.indexOf("Mac")>-1;return!!(e||t||i)},this.checkIsHarmonyOS=function(){return navigator.userAgent.indexOf("ohos")>-1},this.checkIsHarmonyOS()?(document.getElementById("time-line-item").parentNode.addEventListener("touchstart",(function(){if(e.state.disabled)return!1;A.ontouchstart()}),!1),document.getElementById("time-line-item").parentNode.addEventListener("touchmove",(function(){if(e.state.disabled)return!1;A.ontouchmove()}),!1),document.getElementById("time-line-item").parentNode.addEventListener("touchend",(function(){if(e.state.disabled)return!1;var t;new Promise((function(A,e){var i=-1;t=setInterval((function(){var e=document.getElementById("time-line-item").parentNode.scrollTop;e!==i?(console.log("scolling",e,i),i=e):(console.log("scoll stop",e,i),clearInterval(t),A(e))}),100)})).then((function(A){console.log("scollPromise: then",A,e),e.rectTopTotime(A),console.log("页面滚动实际高度",A,e.state),e.getPlayParam({current:e.state.current})})),A.ontouchend()}),!1)):(document.getElementById("time-line-item").parentNode.ontouchstart=function(){if(e.state.disabled)return!1;A.ontouchstart()},document.getElementById("time-line-item").parentNode.ontouchmove=function(){if(e.state.disabled)return!1;A.ontouchmove()},document.getElementById("time-line-item").parentNode.ontouchend=function(){if(e.state.disabled)return!1;var t;new Promise((function(A,e){var i=-1;t=setInterval((function(){var e=document.getElementById("time-line-item").parentNode.scrollTop;e!==i?(console.log("scolling",e,i),i=e):(console.log("scoll stop",e,i),clearInterval(t),A(e))}),100)})).then((function(A){console.log("scollPromise: then",A,e),e.rectTopTotime(A),console.log("页面滚动实际高度",A,e.state),e.getPlayParam({current:e.state.current})})),A.ontouchend()}),this.matchTimeDot()};aA.prototype.changeScale=function(A){this.setState({timelag:A}),this.matchTimeDot()},aA.prototype.setDateLine=function(A,e){A.length>0?(void 0===e&&(e=A.length-1),this.setState({availTimeLine:A,start:A[e].st,end:A[e].et,current:A[e].st}),this.matchRecTimeDot(),this.primaryOffsetH()):(this.setState({availTimeLine:[]}),this.matchRecTimeDot())},aA.prototype.matchTimeDot=function(){var A=this.state;A.start;var e=A.end,t=A.timelag;A.availTimeLine;for(var i=[],n=this.timeToMinute(e),a=n=Math.floor(n/t)*t;a>=0;){var r=0,o=0;a==n&&(r=70),0==a&&(o=230);var s=this.minuteToTime(a);i.push({id:a,current:s,label:"a"+a,marginTop:r,marginBottom:o,recArr:[]}),a-=t}this.setState({timeArr:i}),this.renderDateLine()},aA.prototype.matchRecTimeDot=function(){var A=this.state,e=A.start,t=A.end,i=A.timelag,n=A.availTimeLine,a=A.timeArr;console.log("start",e,"end",t);var r=n.length;if(0===r)for(var o=0;oc&&a[o].id')})),n+="
').concat(A.current,"
"),i.innerHTML=n,t.appendChild(i)}))},aA.prototype.primaryOffsetH=function(){var A=this.state,e=A.start,t=A.timelag,i=A.timeArr[0].current,n=this.timeToSecond(i)-this.timeToSecond(e),a=Math.ceil(n/t)+60;this.setState({scrollTop:a}),console.log("起始偏移量",a)},aA.prototype.currentOffsetH=function(){var A=this.state,e=A.current,t=A.timelag,i=A.timeArr[0].current,n=this.timeToSecond(i)-this.timeToSecond(e),a=Math.ceil(n/t)+60;this.setState({scrollTop:a})},aA.prototype.rectTopTotime=function(A){var e,t,i=this.state.timelag,n=Math.floor(A/60),a=A-60*n;if(console.log("index:",n,"offsetH:",a),0==a)e=this.state.timeArr[n-1].current,t=0;else{var r=this.state.timeArr[n].current,o=this.timeToMinute(r),s=(60-a)*i,g=Math.floor(s/60)+o,c=60*Math.floor(s/60);t=Math.ceil(s-c),e=this.minuteToTime(g)}this.setState({current:e+":"+(t>9?t:"0"+t),scrollTop:A})},aA.prototype.stepScrollTimeLine=function(A){this.setState({current:A}),this.currentOffsetH()},aA.prototype.secondCountDown=function(A){var e=this.state.current.split(":"),t=60*Number(e[0])*60+60*Number(e[1])+Number(e[2])+1,i=Math.floor(t/3600),n=Math.floor((t-3600*i)/60),a=t-3600*i-60*n;this.setState({current:(i>9?i:"0"+i)+":"+(n>9?n:"0"+n)+":"+(a>9?a:"0"+a)})};var rA=aA;function oA(A){var e=new Date(A),t=e.getHours(),i=e.getMinutes(),n=e.getSeconds();return(t>9?t:"0"+t)+":"+(i>9?i:"0"+i)+":"+(n>9?n:"0"+n)}Date.prototype.Format=function(A){var e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var t in/(y+)/.test(A)&&(A=A.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),e)new RegExp("("+t+")").test(A)&&(A=A.replace(RegExp.$1,1==RegExp.$1.length?e[t]:("00"+e[t]).substr((""+e[t]).length)));return A};var sA=function(){return a((function A(e,i,n){var a=this;t(this,A),this.changeRecSpeed=i,this.resetMobileZoomStatus=n,this.isMobile=!0,this.jSPlugin=e,this.date=(new Date).Format("yyyy-MM-dd"),this.begin=((new Date).Format("yyyy-MM-dd")+" 00:00:00").replace(/-/g,"/"),this.end=((new Date).Format("yyyy-MM-dd")+" 23:59:59").replace(/-/g,"/"),this.initBegin=null,this.initEnd=null,this.type=y(this.jSPlugin.url).type,this.operating=!1,this.seekTimer=null,this.disabled=!1,this.seekFrequency=2e3,this.recList=[],this.isSeeking=!1,this.datepickerLang={zh:"zh-CN",en:"en-US"},this.datepickerVisible=!1,this.jSPlugin.params&&this.jSPlugin.params.seekFrequency&&(this.seekFrequency=this.jSPlugin.params.seekFrequency);var r=document.createElement("style");if(r.innerHTML='\n body{\n padding: 0;\n margin: 0;\n }\n .time-line-container {\n text-align: left;\n height: 300px;\n /* outline: 1px solid red; */\n /* background: gray; */\n position: relative;\n /* padding-top: 60px; */\n margin-top: 20px;\n }\n\n .time-line-container .time-line-item-container {\n display: inline-block;\n /* height: 400px; */\n width: 30%;\n /* background: indianred; */\n overflow-y: scroll;\n overflow-x: hidden;\n /* padding-top: 60px; */\n height: 300px;\n box-sizing: border-box;\n white-space: nowrap;\n position: relative;\n }\n\n .time-line-container .time-line-item-container::-webkit-scrollbar {\n width: 0px;\n /*滚动条宽度*/\n height: 0px;\n /*滚动条高度*/\n }\n\n .time-line-item .time-item {\n position: relative;\n box-sizing: border-box;\n height: 60px;\n font-size: 12px;\n color: rgb(150, 150, 150);\n border-right: 6px solid;\n border-right-color: #ddd;\n }\n\n .time-line-item .time-item .scale {\n width: 6px;\n height: 9px;\n border-bottom: 1px solid #ccc;\n float: right;\n clear: both;\n }\n\n .time-line-item .time-item .item-unavail {\n width: 6px;\n position: absolute;\n left: 100%;\n background-color: #ddd;\n }\n\n .time-line-container .current-time {\n position: absolute;\n left: 0;\n top: 40px;\n height: 29px;\n /* line-height: 58px; */\n border-bottom: 1px solid #648FFC;\n width: 60%;\n margin-left: 26%;\n }\n\n .time-line-container .current-time .current-time-bg {\n position: relative;\n top: 15px;\n width: 100px;\n height: 29px;\n line-height: 29px;\n left: -70px;\n font-size: 12px;\n color: #2C2C2C;\n }\n\n .time-line-container .current-time .current-time-bg::before {\n content: \'\';\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 100%;\n background: #648FFC;\n top: 11px;\n position: absolute;\n right: 30px;\n }\n\n .date-switch-container {\n height: 40px;\n position: relative;\n text-align: center;\n margin: 20px 10px;\n }\n\n .date-switch-container .current-date {\n line-height: 40px;\n height: 22px;\n font-size: 16px;\n color: #2C2C2C;\n text-align: center;\n font-weight: bold;\n }\n\n .date-container {\n width: 40px;\n height: 40px;\n position: absolute;\n right: 0;\n top: 0;\n }\n\n .rec-type-container {\n display: flex;\n justify-content: space-between;\n }\n\n .rec-type-container .rec-type-text {\n padding: 0 15px;\n font-size: 12px;\n color: #2C2C2C;\n }\n\n .rec-type-container .rec-type-switch {\n padding: 0 20px;\n }\n\n .date-container input {\n position: absolute;\n opacity: 0;\n display: inline-block;\n width: 40px;\n height: 40px;\n z-index: 10;\n left: 0;\n }\n\n .date-container label {\n position: absolute;\n left: 0;\n top: 0;\n /* display: none; */\n z-index: 0;\n }\n\n .date-icon {\n display: inline-block;\n width: 40px;\n height: 40px;\n background: url(\'https://resource.eziot.com/group2/M00/00/6A/CtwQF2F6VieAQrU9AAABP-_Nsqo949.png\') no-repeat 100% 100%;\n }\n .select-container {\n padding: 10px;\n display: flex;\n justify-content: space-between;\n }\n\n .advice {\n height: 24px;\n width: 70px;\n display: flex;\n justify-content: space-between;\n line-height: 24px;\n background: #F8F8F8;\n border-radius: 8px;\n }\n\n .advice span {\n width: 40px;\n display: inline-block;\n }\n\n input[type="checkbox"]:not(:checked)+.advice span:first-child {\n box-shadow: 0px 2px 5px 0px rgb(23 45 101 / 20%);\n border-radius: 8px;\n text-align: center;\n\n }\n\n input[type="checkbox"]:checked+.advice span:last-child {\n box-shadow: 0px 2px 5px 0px rgb(23 45 101 / 20%);\n border-radius: 8px;\n text-align: center;\n }\n\n input[type="checkbox"]:not(:checked)+.advice span:first-child svg {\n fill: #648FFC !important;\n }\n\n input[type="checkbox"]:checked+.advice span:last-child svg {\n fill: #648FFC !important;\n }',document.getElementsByTagName("head")[0].appendChild(r),f("begin",this.jSPlugin.url)){var o=f("begin",this.jSPlugin.url);this.date=o.slice(0,4)+"/"+o.slice(4,6)+"/"+o.slice(6,8),this.begin=this.date+" ".concat(o.slice(8,10)||"00",":").concat(o.slice(10,12)||"00",":").concat(o.slice(12,14)||"00"),this.end=this.date+" 23:59:59",this.initBegin=this.begin}if(f("end",this.jSPlugin.url)){var s=f("end",this.jSPlugin.url);this.end=this.date+" ".concat(s.slice(8,10)||"23",":").concat(s.slice(10,12)||"59",":").concat(s.slice(12,14)||"59"),this.initEnd=this.end}var g=document.createElement("div");g.id="date-switch-container-wrap",g.className="date-switch-container-wrap",g.style="",g.innerHTML='\n
\n
'.concat(this.jSPlugin.i18n.t("RECORD_TIPS"),'
\n
\n \n
\n
\n
\n '),Q(g,document.getElementById("".concat(this.jSPlugin.id,"-wrap")));var c=document.createElement("div");c.id="rec-type-container-wrap",c.className="rec-type-container-wrap",c.style="",c.innerHTML='\n
\n
0'.concat(this.jSPlugin.i18n.t("RECORDS"),'
\n
\n \n
\n
\n '),Q(c,g);var l=document.createElement("div");l.id="mobile-rec-wrap",l.className="mobileRec-wrap",l.style="",l.innerHTML='\n
\n
\n
00:00:00
\n
\n
\n
\n
\n
\n
\n ',Q(l,c),this.TimeLineOBJ=new rA({id:"time-line-item",getPlayParam:function(A){var e=a;console.log("子组件传值到父组件",A,A.current,a.date);var t=A.current,i=new Date(a.date).Format("yyyyMMdd").substr(0,8)+(A.current?t.replace(/:/g,""):A.current.replace(/:/g,""));if("cloud.rec"===a.type||a.jSPlugin.useSeek&&a.jSPlugin.capacity&&"1"==a.jSPlugin.capacity.support_seek_playback)a.isSeeking||e.recList.length>0&&(new Date("".concat(a.date," ").concat(A.current)).valueOf()>=e.lastDate?(a.jSPlugin.pluginStatus.loadingSetText({text:"seek回放未找到录像片段",color:"red",delayClear:2e3}),a.syncTimeLine()):a.unSyncTimeLine().then((function(){a.isSeeking=!0,a.jSPlugin.pluginStatus.loadingStart(a.jSPlugin.id),a.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),a.jSPlugin.pluginStatus.loadingSetText({text:a.jSPlugin.i18n.t("LOADING")}),a.jSPlugin.Theme.setDisabled(!0),a.jSPlugin.seek(i.substr(8,6),"235959").then((function(){var A=setInterval((function(){a.jSPlugin.getOSDTime().then((function(t){console.log("seek时间同步:",new Date(1e3*t.data).Format("yyyyMMddhhmmss"),i,new Date(1e3*t.data).Format("yyyyMMddhhmmss")>=i),new Date(1e3*t.data).Format("yyyyMMddhhmmss")>=i&&(a.isSeeking=!1,a.syncTimeLine(),clearInterval(A),a.jSPlugin.pluginStatus.loadingStop(a.jSPlugin.id),a.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),a.jSPlugin.pluginStatus.loadingClear(),a.jSPlugin.Theme.setDisabled(!1),a.jSPlugin.waterMark_JSPlugin&&e.jSPlugin.setWaterMarkFont(e.jSPlugin.waterMark_JSPlugin))}))}),1e3)}))})));else{var n=function(){setTimeout((function(){a.disabled=!1}),a.seekFrequency)},r=a.jSPlugin.Theme.decoderState.state.play,o=function(A){a.disabled=!0,a.jSPlugin.pluginStatus.loadingStart(a.jSPlugin.id),a.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),a.jSPlugin.pluginStatus.loadingSetText({text:a.jSPlugin.i18n.t("LOADING")}),a.jSPlugin.Theme.setDisabled(!0),r?a.unSyncTimeLine().then((function(){a.jSPlugin.pause(i).then((function(){console.log("暂停成功"),a.jSPlugin.resume(i).then((function(t){console.log("恢复成功"),a.syncTimeLine(),a.jSPlugin.pluginStatus.loadingStop(a.jSPlugin.id),a.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),a.jSPlugin.pluginStatus.loadingClear(),a.jSPlugin.Theme.setDisabled(!1),a.jSPlugin.waterMark_JSPlugin&&e.jSPlugin.setWaterMarkFont(e.jSPlugin.waterMark_JSPlugin),A&&A()}))})).catch((function(){console.log("暂停失败"),a.jSPlugin.resume(i).then((function(e){console.log("恢复成功"),a.syncTimeLine(),a.jSPlugin.pluginStatus.loadingStop(a.jSPlugin.id),a.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),a.jSPlugin.pluginStatus.loadingClear(),a.jSPlugin.Theme.setDisabled(!1),A&&A()}))}))})):a.unSyncTimeLine().then((function(){a.jSPlugin.resume(i).then((function(e){console.log("恢复成功"),a.syncTimeLine(),A&&A()}))}))};a.disabled?(console.log("操作频繁,等待2秒后执行"),a.seekTimer&&clearTimeout(a.seekTimer),a.seekTimer=setTimeout((function(){o(n)}),a.seekFrequency)):o(n)}},ontouchstart:function(){a.operating=!0,a.unSyncTimeLine()},ontouchmove:function(){0==a.operating&&(a.operating=!0,a.unSyncTimeLine())},ontouchend:function(){a.operating=!1}}),this.fetchDeviceRec(),document.getElementById("cloudType").checked="rec"===this.type,document.getElementById("cloudType").addEventListener("change",(function(A){var e=A.target.checked?2:1;a.type=A.target.checked?"rec":"cloud.rec",console.log("recType",e),a.jSPlugin.changePlayUrl({type:a.type,begin:"".concat(new Date(a.date).Format("yyyyMMdd"),"000000")}).then((function(){console.log("切换类型成功"),a.syncTimeLine(),a.changeRecSpeed(1),a.resetMobileZoomStatus()}),(function(A){console.log("err",A)})).catch((function(A){console.log(A)}))})),this.syncTimeLine();var I=this;!function(A){var e=document.getElementById("".concat(A.id,"-wrap"));B("".concat(A.staticPath,"/rec/datepicker.min.css")),u("".concat(A.staticPath,"/rec/jquery.min.js"),(function(A){u("".concat(A.staticPath,"/rec/datepicker.js"),(function(A){u("".concat(A.staticPath,"/rec/datepicker.").concat(I.datepickerLang[A.language],".js"),(function(A){var t=e.getElementsByClassName("datepicker-container")[0];!t&&$("#".concat(A.id,"-datepicker")).datepicker&&$("#".concat(A.id,"-datepicker")).datepicker({autoShow:!1,autoHide:!0,autoPick:!0,language:I.datepickerLang[A.language],date:new Date(f("begin",A.params.url).replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"))||new Date,format:"yyyy-mm-dd",endDate:new Date,inline:!0,container:e}),(t=e.getElementsByClassName("datepicker-container")[0])&&(t.style.display="none",t.style.bottom="-314px",t.style.right="0px"),I.datepickerVisible=!1,$("#".concat(A.id,"-datepicker")).on("pick.datepicker",(function(e){console.log("重新选择日期",e.date,new Date(e.date).Format("yyyyMMddhhmmss"),new Date(document.getElementById("".concat(A.id,"-datepicker")).value).Format("yyyyMMdd"));var i={begin:new Date(e.date).Format("yyyyMMddhhmmss")};if(I.begin=e.date,e.date>new Date||new Date(e.date).Format("yyyyMMddhhmmss")===new Date(document.getElementById("".concat(A.id,"-datepicker")).value).Format("yyyyMMdd"))e.preventDefault();else{var n=new Date(e.date).Format("yyyy-MM-dd");document.getElementById("".concat(A.id,"-datepicker")).value=n,A.eventEmitter.emit("recStartTimeChange",{code:0,data:{time:n}}),A.Theme.decoderState&&A.Theme.decoderState.state&&(A.Theme.decoderState.state.cloudRec?i={begin:new Date(e.date).Format("yyyyMMddhhmmss"),type:"cloud.rec"}:A.Theme.decoderState.state.rec&&(i={begin:new Date(e.date).Format("yyyyMMddhhmmss"),type:"rec"}))}A.changePlayUrl(i,(function(){}),!1).then((function(){setTimeout((function(){var A=document.getElementById("date");A&&(A.value=new Date(e.date).Format("yyyy-MM-dd"))}),0),I.fetchDeviceRec()})),I.changeRecSpeed(1),I.resetMobileZoomStatus(),t&&(t.style.display="none"),I.datepickerVisible=!1})),$("#".concat(A.id,"-datepicker")).off("click").on("click",(function(A){I.datepickerVisible?t&&(t.style.display="none"):t&&(t.style.display="inline"),I.datepickerVisible=!I.datepickerVisible})),document.getElementById("date-picker")&&document.getElementById("date-picker").addEventListener("focus",(function(A){A.target.blur()}))}),(function(){}),A)}),(function(){}),A)}),(function(){}),A)}(this.jSPlugin)}),[{key:"fetchDeviceRec",value:function(){var A=this,e=function(e){var t=e.length;document.getElementById("recCount").innerHTML=t;for(var i=[],n=t-1;n>=0;n--){var a=e[n],r=oA(a.endTime),o=oA(a.startTime);i.push({st:o,et:r})}A.TimeLineOBJ.setDateLine(i)},t=new FormData,i=this;t.append("deviceSerial",y(this.jSPlugin.url).deviceSerial),t.append("channelNo",y(this.jSPlugin.url).channelNo),t.append("accessToken",this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video),t.append("recType","cloud.rec"===this.type?1:2);var n=f("timeZone",this.jSPlugin.url);if(n<=23&&n>=-23&&"cloud.rec"!==this.type){var a=tA(new Date(this.begin).Format("yyyyMMddhhmmss"),+n);t.append("startTime",new Date(a.Format("yyyy/MM/dd")+" 00:00:00").getTime()),t.append("endTime",new Date(a.Format("yyyy/MM/dd")+" 23:59:59").getTime()),this.date=a.Format("yyyy/MM/dd")}else t.append("startTime",new Date(this.begin).getTime()),t.append("endTime",new Date(this.end).getTime());fetch(this.jSPlugin.env.domain+"/api/lapp/video/by/time",{method:"POST",body:t}).then((function(A){return A.json()})).then((function(A){if(200==A.code&&A.data){var t;t=A.data,i.recList=t,i.lastDate=t[t.length-1].endTime,e(t)}else e([])}))}},{key:"syncTimeLine",value:function(){var A=this;this.jSPlugin.recTimer&&clearInterval(this.jSPlugin.recTimer),window.recTimer?Array.isArray(window.recTimer[this.jSPlugin.id])&&window.recTimer[this.jSPlugin.id].map((function(A){clearInterval(A)})):window.recTimer={},window.recTimer[this.jSPlugin.id]=[];var e=this;this.jSPlugin.recTimer=setInterval((function(){if(A.operating)return console.log("操作中"),!1;A.jSPlugin.getOSDTime().then((function(A){A.data>0&&e.TimeLineOBJ.stepScrollTimeLine(function(A){var e=new Date(A),t=e.getHours(),i=e.getMinutes(),n=e.getSeconds();return(t>9?t:"0"+t)+":"+(i>9?i:"0"+i)+":"+(n>9?n:"0"+n)}(1e3*A.data))})).catch((function(A){console.log("err:-----",A),console.log("未找到当前获取播放时间,等待中...")}))}),1e3),window.recTimer[this.jSPlugin.id].push(this.jSPlugin.recTimer)}},{key:"unSyncTimeLine",value:function(){var A=this;return new Promise((function(e,t){A.jSPlugin.recTimer&&(clearInterval(A.jSPlugin.recTimer),A.jSPlugin.recTimer=null),window.recTimer?Array.isArray(window.recTimer[A.jSPlugin.id])&&(window.recTimer[A.jSPlugin.id].map((function(A){clearInterval(A)})),window.recTimer[A.jSPlugin.id]=[]):window.recTimer={},e()}))}}])}(),gA=function(){return a((function A(e){var i=this;if(t(this,A),this.jSPlugin=e,this.pluginStatus=new L(this,this.jSPlugin.id),this.showPtz=!1,document.getElementById(this.jSPlugin.id+"-ez-ptz-item"))return!1;var n=document.createElement("div");n.id=this.jSPlugin.id+"-ez-ptz-item",n.className="ez-ptz-wrap",n.style="display:none;";var a=document.createElement("style");a.innerHTML="\n .ez-ptz-container {\n position: relative;\n width: 80px;\n height: 80px;\n background: rgba(255, 255, 255, 0.70);\n box-shadow: 0px 0px 33px 4px rgb(0 0 0 / 15%);\n border: 1px solid rgba(255, 255, 255, 0.70);\n border-radius: 100%;\n cursor: pointer;\n overflow: hidden;\n user-select: none;\n }\n .ez-ptz-container .ez-ptz-icon.top {\n width: 0;\n height: 0;\n border-left: 4px solid transparent;\n border-right: 4px solid transparent;\n border-bottom: 8px solid #999999;\n position: absolute;\n display: inline-block;\n left: calc(50% - 4px);\n top: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.top.active {\n border-bottom-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.bottom {\n width: 0;\n height: 0;\n border-left: 4px solid transparent;\n border-right: 4px solid transparent;\n border-top: 8px solid #999999;\n position: absolute;\n display: inline-block;\n left: calc(50% - 4px);\n bottom: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.bottom.active {\n border-top-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.right {\n width: 0;\n height: 0;\n border-top: 4px solid transparent;\n border-bottom: 4px solid transparent;\n border-left: 8px solid #999999;\n position: absolute;\n display: inline-block;\n top: calc(50% - 4px);\n right: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.right.active {\n border-left-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.left {\n width: 0;\n height: 0;\n border-top: 4px solid transparent;\n border-bottom: 4px solid transparent;\n border-right: 8px solid #999999;\n position: absolute;\n display: inline-block;\n top: calc(50% - 4px);\n left: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.left.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.top-left {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n position: absolute;\n display: inline-block;\n top: calc(25% - 4px);\n left: 16px;\n background: #999999;\n }\n\n .ez-ptz-container .ez-ptz-icon.top-left.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.left-bottom {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n position: absolute;\n display: inline-block;\n bottom: calc(25% - 4px);\n left: 16px;\n background: #999999;\n }\n\n .ez-ptz-container .ez-ptz-icon.left-bottom.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.bottom-right {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n position: absolute;\n display: inline-block;\n bottom: calc(25% - 4px);\n right: 16px;\n background: #999999;\n }\n\n .ez-ptz-container .ez-ptz-icon.bottom-right.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.right-top {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n position: absolute;\n display: inline-block;\n top: calc(25% - 4px);\n right: 16px;\n background: #999999;\n }\n\n .ez-ptz-container .ez-ptz-icon.right-top.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-main.center {\n width: 23px;\n height: 23px;\n background: #407AFF;\n border-radius: 100%;\n top: calc(50% - 12.4px);\n left: calc(50% - 12.4px);\n position: absolute;\n }\n\n .ez-ptz-wrap {\n position: absolute;\n right: 0px;\n top: 0;\n width: 85px;\n height: 100%;\n padding: 0 20px;\n flex-direction: column;\n justify-content: center;\n background: rgba(0,0,0,0.9);\n box-sizing: content-box !important;\n }\n\n .ez-ptz-close {\n position: absolute;\n color: #FFFFFF;\n top: 0;\n right: 0px;\n }\n\n .ez-ptzspeed-progress-line{\n height: 1px;\n background: #ffffff;\n margin: 16px 0 8px;\n display: flex;\n justify-content: space-between;\n }\n\n .ez-ptzspeed-progress-line-dot{\n width: 5px;\n height: 5px;\n border: 2px solid #ffffff;\n border-radius: 50%;\n background: #ffffff;\n margin: -3px 0;\n cursor: pointer;\n }\n\n .ez-ptzspeed-progress-line-dot.active{\n border-color: #407AFF;\n }\n \n .ez-ptzspeed-progress-points{\n display: flex;\n justify-content: space-between;\n }\n\n .ez-ptzspeed-progress-points-slow{\n cursor: pointer;\n color: #ffffff;\n }\n\n .ez-ptzspeed-progress-points-mid{\n cursor: pointer;\n color: #ffffff;\n }\n\n .ez-ptzspeed-progress-points-fast{\n cursor: pointer;\n color: #ffffff;\n }\n\n .ez-ptzbtn-container{\n width: 100%;\n height:".concat(e.isMobile?"60px":"18px",";\n margin-top: 14px;\n display: ").concat(e.isMobile?"block":"flex",";\n }\n\n .ez-ptzbtn-focal,\n .ez-ptzbtn-zoom{\n width: ").concat(e.isMobile?"100%":"50%",";\n height: 20px;\n display: flex;\n border: 1px solid rgba(255,255,255,0.5);\n border-radius: 10px;\n padding-bottom: 0px;\n box-sizing: content-box;\n }\n\n .ez-ptzbtn-zoom-add,\n .ez-ptzbtn-zoom-sub,\n .ez-ptzbtn-focal-add,\n .ez-ptzbtn-focal-sub{\n width: ").concat(e.isMobile?"50%":"24px",";\n height: 20px;\n cursor: pointer;\n text-align: center;\n }\n\n .ez-ptzbtn-zoom{\n margin: ").concat(e.isMobile?"0 0 8px":"0 4px 0 0",";\n }\n\n .ez-ptzbtn-zoom-add{\n border-right: 1px solid rgba(255,255,255,0.5);\n }\n\n .ez-ptzbtn-focal-add{\n border-right: 1px solid rgba(255,255,255,0.5);\n }\n "),document.getElementsByTagName("head")[0].appendChild(a),n.innerHTML='\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n ').concat(this.jSPlugin.i18n.t("PTZ_SLOW"),'\n
\n
\n ').concat(this.jSPlugin.i18n.t("PTZ_MID"),'\n
\n
\n ').concat(this.jSPlugin.i18n.t("PTZ_FAST"),'\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n '),document.getElementById("".concat(e.id,"-wrap")).appendChild(n),document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).onmousedown=function(A){A.preventDefault(),A.stopPropagation(),console.log("点击开始"),i._handlePtzTouch(A,"start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).onmouseup=function(A){A.preventDefault(),A.stopPropagation(),console.log("触摸结束"),i._handlePtzTouch(A,"stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).ontouchstart=function(A){A.preventDefault(),A.stopPropagation(),console.log("触摸开始"),i._handlePtzTouch(A,"start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).ontouchend=function(A){A.preventDefault(),A.stopPropagation(),console.log("触摸结束",A),i._handlePtzTouch(A,"stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzspeed-container")).onmouseup=function(A){A.target.id&&(A.target.id.indexOf("slow")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.slow:1,document.getElementById("ptzspeed-slow-dot").classList.add("active"),document.getElementById("ptzspeed-mid-dot").classList.remove("active"),document.getElementById("ptzspeed-fast-dot").classList.remove("active")),A.target.id.indexOf("mid")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.mid:3,document.getElementById("ptzspeed-slow-dot").classList.remove("active"),document.getElementById("ptzspeed-mid-dot").classList.add("active"),document.getElementById("ptzspeed-fast-dot").classList.remove("active")),A.target.id.indexOf("fast")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.fast:7,document.getElementById("ptzspeed-slow-dot").classList.remove("active"),document.getElementById("ptzspeed-mid-dot").classList.remove("active"),document.getElementById("ptzspeed-fast-dot").classList.add("active")))},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzspeed-container")).ontouchend=function(A){A.target.id&&(A.target.id.indexOf("slow")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.slow:1,document.getElementById("ptzspeed-slow-dot").classList.add("active"),document.getElementById("ptzspeed-mid-dot").classList.remove("active"),document.getElementById("ptzspeed-fast-dot").classList.remove("active")),A.target.id.indexOf("mid")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.mid:3,document.getElementById("ptzspeed-slow-dot").classList.remove("active"),document.getElementById("ptzspeed-mid-dot").classList.add("active"),document.getElementById("ptzspeed-fast-dot").classList.remove("active")),A.target.id.indexOf("fast")>-1&&(i.jSPlugin.ptzSpeed=i.jSPlugin.ptzSpeedOptions?i.jSPlugin.ptzSpeedOptions.fast:7,document.getElementById("ptzspeed-slow-dot").classList.remove("active"),document.getElementById("ptzspeed-mid-dot").classList.remove("active"),document.getElementById("ptzspeed-fast-dot").classList.add("active")))},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-add")).onmousedown=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","add","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-add")).onmouseup=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","add","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-sub")).onmousedown=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","sub","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-sub")).onmouseup=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","sub","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-add")).onmousedown=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","add","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-add")).onmouseup=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","add","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-sub")).onmousedown=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","sub","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-sub")).onmouseup=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","sub","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-add")).ontouchstart=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","add","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-add")).ontouchend=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","add","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-sub")).ontouchstart=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","sub","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-zoom-sub")).ontouchend=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("zoom","sub","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-add")).ontouchstart=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","add","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-add")).ontouchend=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","add","stop")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-sub")).ontouchstart=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","sub","start")},document.getElementById("".concat(this.jSPlugin.id,"-ez-ptzbtn-focal-sub")).ontouchend=function(A){A.preventDefault(),A.stopPropagation(),i._handleBtnTouch("focal","sub","stop")}}),[{key:"show",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-item"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-item")).style="display: flex;box-sizing: content-box;"),this.showPtz=!0,this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("openPtz",{eventType:"openPtz",code:0,target:this,msg:"开启云台"})}},{key:"hide",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-item"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-item")).style="display: none"),this.showPtz=!1,this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("closePtz",{eventType:"closePtz",code:0,target:this,msg:"关闭云台"})}},{key:"_handlePtzTouch",value:function(A,e){var t=this,i=document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).getBoundingClientRect(),n=i.left+41,a=i.top+41,r=A.x||A.changedTouches[0].clientX,o=A.y||A.changedTouches[0].clientY,s=0,g=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start",c=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,l=0;function I(A,e){var t=Math.atan2(e,A);t<0&&(t+=2*Math.PI);var i=t*(180/Math.PI)-225-12.5;return i<0&&(i+=360),Math.floor(i/45)+1}if(/^rotate\(90/.test(document.getElementById("".concat(this.jSPlugin.id,"-wrap")).style.transform))switch(I(r-n,o-a)){case 1:s=2,l=90;break;case 2:s=4,l=135;break;case 3:s=0,l=180;break;case 4:s=6,l=225;break;case 5:s=3,l=270;break;case 6:s=7,l=315;break;case 7:s=1,l=0;break;case 8:s=5,l=45}else switch(I(r-n,o-a)){case 1:s=0,l=180;break;case 2:s=6,l=225;break;case 3:s=3,l=270;break;case 4:s=7,l=315;break;case 5:s=1,l=0;break;case 6:s=5,l=45;break;case 7:s=2,l=90;break;case 8:s=4,l=135}document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).style="background-image:linear-gradient(".concat(l,"deg, #4277FF 0%, rgba(100,143,252,0.00) 30%)"),"stop"===e&&(g=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop",c=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-container")).style="");var d=new FormData;d.append("deviceSerial",y(this.jSPlugin.url).deviceSerial),d.append("channelNo",y(this.jSPlugin.url).channelNo),d.append("speed",this.jSPlugin.ptzSpeed),d.append("direction",s),d.append("accessToken",c),fetch(g,{method:"POST",body:d}).then((function(A){return A.json()})).then((function(A){if("start"===e&&200!=A.code){console.log(A.code,t.jSPlugin.i18n.t("38"+A.code));var i=t.jSPlugin.i18n.t("38"+A.code)||A.msg;t.pluginStatus.loadingSetText({text:i,color:"red",delayClear:2e3})}60005!=A.code&&60002!=A.code&&60003!=A.code&&60004!=A.code&&60006!=A.code||(document.getElementById("".concat(t.jSPlugin.id,"-ez-ptz-container")).style="background-image:linear-gradient(".concat(l,"deg, #f45656 0%, rgba(100,143,252,0.00) 30%)"))})).catch((function(A){console.log("云台调用异常",A)}))}},{key:"_handleBtnTouch",value:function(A,e,t){var i=this,n=8;n="zoom"===A?"add"===e?8:9:"add"===e?10:11;var a=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start",r=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video;"stop"===t&&(a=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop",r=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video);var o=new FormData;o.append("deviceSerial",y(this.jSPlugin.url).deviceSerial),o.append("channelNo",y(this.jSPlugin.url).channelNo),o.append("speed",this.jSPlugin.ptzSpeed),o.append("direction",n),o.append("accessToken",r),fetch(a,{method:"POST",body:o}).then((function(A){return A.json()})).then((function(e){"start"===t&&200!=e.code&&(6e4==e.code||60006==e.code?i.pluginStatus.loadingSetText({text:"zoom"===A?i.jSPlugin.i18n.t("NOT_SUPPORT_DEVICE_ZOOM"):i.jSPlugin.i18n.t("NOT_SUPPORT_FOCUS"),color:"red",delayClear:2e3}):i.pluginStatus.loadingSetText({text:e.msg,color:"red",delayClear:2e3}))})).catch((function(A){}))}}])}();function cA(A){throw new Error('Could not dynamically require "'+A+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}!function(A){A.exports=function(){function A(e,t,i){function n(r,o){if(!t[r]){if(!e[r]){if(!o&&cA)return cA(r);if(a)return a(r,!0);var s=new Error("Cannot find module '"+r+"'");throw s.code="MODULE_NOT_FOUND",s}var g=t[r]={exports:{}};e[r][0].call(g.exports,(function(A){return n(e[r][1][A]||A)}),g,g.exports,A,e,t,i)}return t[r].exports}for(var a=cA,r=0;r0&&void 0!==arguments[0]?arguments[0]:{}).window,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0},t=i.log,g=i.detectBrowser(A),c={browserDetails:g,commonShim:s,extractVersion:i.extractVersion,disableLog:i.disableLog,disableWarnings:i.disableWarnings};switch(g.browser){case"chrome":if(!n||!n.shimPeerConnection||!e.shimChrome)return t("Chrome shim is not included in this adapter release."),c;t("adapter.js shimming chrome."),c.browserShim=n,n.shimGetUserMedia(A),n.shimMediaStream(A),n.shimPeerConnection(A),n.shimOnTrack(A),n.shimAddTrackRemoveTrack(A),n.shimGetSendersWithDtmf(A),n.shimGetStats(A),n.shimSenderReceiverGetStats(A),n.fixNegotiationNeeded(A),s.shimRTCIceCandidate(A),s.shimConnectionState(A),s.shimMaxMessageSize(A),s.shimSendThrowTypeError(A),s.removeAllowExtmapMixed(A);break;case"firefox":if(!r||!r.shimPeerConnection||!e.shimFirefox)return t("Firefox shim is not included in this adapter release."),c;t("adapter.js shimming firefox."),c.browserShim=r,r.shimGetUserMedia(A),r.shimPeerConnection(A),r.shimOnTrack(A),r.shimRemoveStream(A),r.shimSenderGetStats(A),r.shimReceiverGetStats(A),r.shimRTCDataChannel(A),r.shimAddTransceiver(A),r.shimCreateOffer(A),r.shimCreateAnswer(A),s.shimRTCIceCandidate(A),s.shimConnectionState(A),s.shimMaxMessageSize(A),s.shimSendThrowTypeError(A);break;case"edge":if(!a||!a.shimPeerConnection||!e.shimEdge)return t("MS edge shim is not included in this adapter release."),c;t("adapter.js shimming edge."),c.browserShim=a,a.shimGetUserMedia(A),a.shimGetDisplayMedia(A),a.shimPeerConnection(A),a.shimReplaceTrack(A),s.shimMaxMessageSize(A),s.shimSendThrowTypeError(A);break;case"safari":if(!o||!e.shimSafari)return t("Safari shim is not included in this adapter release."),c;t("adapter.js shimming safari."),c.browserShim=o,o.shimRTCIceServerUrls(A),o.shimCreateOfferLegacy(A),o.shimCallbacksAPI(A),o.shimLocalStreamsAPI(A),o.shimRemoteStreamsAPI(A),o.shimTrackEventTransceiver(A),o.shimGetUserMedia(A),s.shimRTCIceCandidate(A),s.shimMaxMessageSize(A),s.shimSendThrowTypeError(A),s.removeAllowExtmapMixed(A);break;default:t("Unsupported browser!")}return c}},{"./chrome/chrome_shim":3,"./common_shim":6,"./edge/edge_shim":7,"./firefox/firefox_shim":11,"./safari/safari_shim":14,"./utils":15}],3:[function(A,e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.shimGetDisplayMedia=t.shimGetUserMedia=void 0;var i="function"==typeof Symbol&&"symbol"===d(Symbol.iterator)?function(A){return d(A)}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":d(A)},n=A("./getusermedia");Object.defineProperty(t,"shimGetUserMedia",{enumerable:!0,get:function(){return n.shimGetUserMedia}});var a=A("./getdisplaymedia");Object.defineProperty(t,"shimGetDisplayMedia",{enumerable:!0,get:function(){return a.shimGetDisplayMedia}}),t.shimMediaStream=g,t.shimOnTrack=c,t.shimGetSendersWithDtmf=l,t.shimGetStats=I,t.shimSenderReceiverGetStats=C,t.shimAddTrackRemoveTrackWithNative=h,t.shimAddTrackRemoveTrack=u,t.shimPeerConnection=B,t.fixNegotiationNeeded=E;var r=o(A("../utils.js"));function o(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[t]=A[t]);return e.default=A,e}function s(A,e,t){return e in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function g(A){A.MediaStream=A.MediaStream||A.webkitMediaStream}function c(A){if("object"===(void 0===A?"undefined":i(A))&&A.RTCPeerConnection&&!("ontrack"in A.RTCPeerConnection.prototype)){Object.defineProperty(A.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(A){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=A)},enumerable:!0,configurable:!0});var e=A.RTCPeerConnection.prototype.setRemoteDescription;A.RTCPeerConnection.prototype.setRemoteDescription=function(){var t=this;return this._ontrackpoly||(this._ontrackpoly=function(e){e.stream.addEventListener("addtrack",(function(i){var n=void 0;n=A.RTCPeerConnection.prototype.getReceivers?t.getReceivers().find((function(A){return A.track&&A.track.id===i.track.id})):{track:i.track};var a=new Event("track");a.track=i.track,a.receiver=n,a.transceiver={receiver:n},a.streams=[e.stream],t.dispatchEvent(a)})),e.stream.getTracks().forEach((function(i){var n=void 0;n=A.RTCPeerConnection.prototype.getReceivers?t.getReceivers().find((function(A){return A.track&&A.track.id===i.id})):{track:i};var a=new Event("track");a.track=i,a.receiver=n,a.transceiver={receiver:n},a.streams=[e.stream],t.dispatchEvent(a)}))},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else r.wrapPeerConnectionEvent(A,"track",(function(A){return A.transceiver||Object.defineProperty(A,"transceiver",{value:{receiver:A.receiver}}),A}))}function l(A){if("object"===(void 0===A?"undefined":i(A))&&A.RTCPeerConnection&&!("getSenders"in A.RTCPeerConnection.prototype)&&"createDTMFSender"in A.RTCPeerConnection.prototype){var e=function(A,e){return{track:e,get dtmf(){return void 0===this._dtmf&&("audio"===e.kind?this._dtmf=A.createDTMFSender(e):this._dtmf=null),this._dtmf},_pc:A}};if(!A.RTCPeerConnection.prototype.getSenders){A.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};var t=A.RTCPeerConnection.prototype.addTrack;A.RTCPeerConnection.prototype.addTrack=function(A,i){var n=t.apply(this,arguments);return n||(n=e(this,A),this._senders.push(n)),n};var n=A.RTCPeerConnection.prototype.removeTrack;A.RTCPeerConnection.prototype.removeTrack=function(A){n.apply(this,arguments);var e=this._senders.indexOf(A);-1!==e&&this._senders.splice(e,1)}}var a=A.RTCPeerConnection.prototype.addStream;A.RTCPeerConnection.prototype.addStream=function(A){var t=this;this._senders=this._senders||[],a.apply(this,[A]),A.getTracks().forEach((function(A){t._senders.push(e(t,A))}))};var r=A.RTCPeerConnection.prototype.removeStream;A.RTCPeerConnection.prototype.removeStream=function(A){var e=this;this._senders=this._senders||[],r.apply(this,[A]),A.getTracks().forEach((function(A){var t=e._senders.find((function(e){return e.track===A}));t&&e._senders.splice(e._senders.indexOf(t),1)}))}}else if("object"===(void 0===A?"undefined":i(A))&&A.RTCPeerConnection&&"getSenders"in A.RTCPeerConnection.prototype&&"createDTMFSender"in A.RTCPeerConnection.prototype&&A.RTCRtpSender&&!("dtmf"in A.RTCRtpSender.prototype)){var o=A.RTCPeerConnection.prototype.getSenders;A.RTCPeerConnection.prototype.getSenders=function(){var A=this,e=o.apply(this,[]);return e.forEach((function(e){return e._pc=A})),e},Object.defineProperty(A.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function I(A){if(A.RTCPeerConnection){var e=A.RTCPeerConnection.prototype.getStats;A.RTCPeerConnection.prototype.getStats=function(){var A=this,t=Array.prototype.slice.call(arguments),i=t[0],n=t[1],a=t[2];if(arguments.length>0&&"function"==typeof i)return e.apply(this,arguments);if(0===e.length&&(0===arguments.length||"function"!=typeof i))return e.apply(this,[]);var r=function(A){var e={};return A.result().forEach((function(A){var t={id:A.id,timestamp:A.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[A.type]||A.type};A.names().forEach((function(e){t[e]=A.stat(e)})),e[t.id]=t})),e},o=function(A){return new Map(Object.keys(A).map((function(e){return[e,A[e]]})))};if(arguments.length>=2){var s=function(A){n(o(r(A)))};return e.apply(this,[s,i])}return new Promise((function(t,i){e.apply(A,[function(A){t(o(r(A)))},i])})).then(n,a)}}}function C(A){if("object"===(void 0===A?"undefined":i(A))&&A.RTCPeerConnection&&A.RTCRtpSender&&A.RTCRtpReceiver){if(!("getStats"in A.RTCRtpSender.prototype)){var e=A.RTCPeerConnection.prototype.getSenders;e&&(A.RTCPeerConnection.prototype.getSenders=function(){var A=this,t=e.apply(this,[]);return t.forEach((function(e){return e._pc=A})),t});var t=A.RTCPeerConnection.prototype.addTrack;t&&(A.RTCPeerConnection.prototype.addTrack=function(){var A=t.apply(this,arguments);return A._pc=this,A}),A.RTCRtpSender.prototype.getStats=function(){var A=this;return this._pc.getStats().then((function(e){return r.filterStats(e,A.track,!0)}))}}if(!("getStats"in A.RTCRtpReceiver.prototype)){var n=A.RTCPeerConnection.prototype.getReceivers;n&&(A.RTCPeerConnection.prototype.getReceivers=function(){var A=this,e=n.apply(this,[]);return e.forEach((function(e){return e._pc=A})),e}),r.wrapPeerConnectionEvent(A,"track",(function(A){return A.receiver._pc=A.srcElement,A})),A.RTCRtpReceiver.prototype.getStats=function(){var A=this;return this._pc.getStats().then((function(e){return r.filterStats(e,A.track,!1)}))}}if("getStats"in A.RTCRtpSender.prototype&&"getStats"in A.RTCRtpReceiver.prototype){var a=A.RTCPeerConnection.prototype.getStats;A.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof A.MediaStreamTrack){var e=arguments[0],t=void 0,i=void 0,n=void 0;return this.getSenders().forEach((function(A){A.track===e&&(t?n=!0:t=A)})),this.getReceivers().forEach((function(A){return A.track===e&&(i?n=!0:i=A),A.track===e})),n||t&&i?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():i?i.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return a.apply(this,arguments)}}}}function h(A){A.RTCPeerConnection.prototype.getLocalStreams=function(){var A=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((function(e){return A._shimmedLocalStreams[e][0]}))};var e=A.RTCPeerConnection.prototype.addTrack;A.RTCPeerConnection.prototype.addTrack=function(A,t){if(!t)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var i=e.apply(this,arguments);return this._shimmedLocalStreams[t.id]?-1===this._shimmedLocalStreams[t.id].indexOf(i)&&this._shimmedLocalStreams[t.id].push(i):this._shimmedLocalStreams[t.id]=[t,i],i};var t=A.RTCPeerConnection.prototype.addStream;A.RTCPeerConnection.prototype.addStream=function(A){var e=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},A.getTracks().forEach((function(A){var t=e.getSenders().find((function(e){return e.track===A}));if(t)throw new DOMException("Track already exists.","InvalidAccessError")}));var i=this.getSenders();t.apply(this,arguments);var n=this.getSenders().filter((function(A){return-1===i.indexOf(A)}));this._shimmedLocalStreams[A.id]=[A].concat(n)};var i=A.RTCPeerConnection.prototype.removeStream;A.RTCPeerConnection.prototype.removeStream=function(A){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[A.id],i.apply(this,arguments)};var n=A.RTCPeerConnection.prototype.removeTrack;A.RTCPeerConnection.prototype.removeTrack=function(A){var e=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},A&&Object.keys(this._shimmedLocalStreams).forEach((function(t){var i=e._shimmedLocalStreams[t].indexOf(A);-1!==i&&e._shimmedLocalStreams[t].splice(i,1),1===e._shimmedLocalStreams[t].length&&delete e._shimmedLocalStreams[t]})),n.apply(this,arguments)}}function u(A){if(A.RTCPeerConnection){var e=r.detectBrowser(A);if(A.RTCPeerConnection.prototype.addTrack&&e.version>=65)return h(A);var t=A.RTCPeerConnection.prototype.getLocalStreams;A.RTCPeerConnection.prototype.getLocalStreams=function(){var A=this,e=t.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map((function(e){return A._reverseStreams[e.id]}))};var i=A.RTCPeerConnection.prototype.addStream;A.RTCPeerConnection.prototype.addStream=function(e){var t=this;if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},e.getTracks().forEach((function(A){var e=t.getSenders().find((function(e){return e.track===A}));if(e)throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[e.id]){var n=new A.MediaStream(e.getTracks());this._streams[e.id]=n,this._reverseStreams[n.id]=e,e=n}i.apply(this,[e])};var n=A.RTCPeerConnection.prototype.removeStream;A.RTCPeerConnection.prototype.removeStream=function(A){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},n.apply(this,[this._streams[A.id]||A]),delete this._reverseStreams[this._streams[A.id]?this._streams[A.id].id:A.id],delete this._streams[A.id]},A.RTCPeerConnection.prototype.addTrack=function(e,t){var i=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var n=[].slice.call(arguments,1);if(1!==n.length||!n[0].getTracks().find((function(A){return A===e})))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");var a=this.getSenders().find((function(A){return A.track===e}));if(a)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};var r=this._streams[t.id];if(r)r.addTrack(e),Promise.resolve().then((function(){i.dispatchEvent(new Event("negotiationneeded"))}));else{var o=new A.MediaStream([e]);this._streams[t.id]=o,this._reverseStreams[o.id]=t,this.addStream(o)}return this.getSenders().find((function(A){return A.track===e}))},["createOffer","createAnswer"].forEach((function(e){var t=A.RTCPeerConnection.prototype[e],i=s({},e,(function(){var A=this,e=arguments;return arguments.length&&"function"==typeof arguments[0]?t.apply(this,[function(t){var i=g(A,t);e[0].apply(null,[i])},function(A){e[1]&&e[1].apply(null,A)},arguments[2]]):t.apply(this,arguments).then((function(e){return g(A,e)}))}));A.RTCPeerConnection.prototype[e]=i[e]}));var a=A.RTCPeerConnection.prototype.setLocalDescription;A.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=c(this,arguments[0]),a.apply(this,arguments)):a.apply(this,arguments)};var o=Object.getOwnPropertyDescriptor(A.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(A.RTCPeerConnection.prototype,"localDescription",{get:function(){var A=o.get.apply(this);return""===A.type?A:g(this,A)}}),A.RTCPeerConnection.prototype.removeTrack=function(A){var e=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!A._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(A._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};var t=void 0;Object.keys(this._streams).forEach((function(i){e._streams[i].getTracks().find((function(e){return A.track===e}))&&(t=e._streams[i])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(A.track),this.dispatchEvent(new Event("negotiationneeded")))}}function g(A,e){var t=e.sdp;return Object.keys(A._reverseStreams||[]).forEach((function(e){var i=A._reverseStreams[e],n=A._streams[i.id];t=t.replace(new RegExp(n.id,"g"),i.id)})),new RTCSessionDescription({type:e.type,sdp:t})}function c(A,e){var t=e.sdp;return Object.keys(A._reverseStreams||[]).forEach((function(e){var i=A._reverseStreams[e],n=A._streams[i.id];t=t.replace(new RegExp(i.id,"g"),n.id)})),new RTCSessionDescription({type:e.type,sdp:t})}}function B(A){var e=r.detectBrowser(A);if(!A.RTCPeerConnection&&A.webkitRTCPeerConnection&&(A.RTCPeerConnection=A.webkitRTCPeerConnection),A.RTCPeerConnection){e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(e){var t=A.RTCPeerConnection.prototype[e],i=s({},e,(function(){return arguments[0]=new("addIceCandidate"===e?A.RTCIceCandidate:A.RTCSessionDescription)(arguments[0]),t.apply(this,arguments)}));A.RTCPeerConnection.prototype[e]=i[e]}));var t=A.RTCPeerConnection.prototype.addIceCandidate;A.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?e.version<78&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():t.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}}function E(A){r.wrapPeerConnectionEvent(A,"negotiationneeded",(function(A){if("stable"===A.target.signalingState)return A}))}},{"../utils.js":15,"./getdisplaymedia":4,"./getusermedia":5}],4:[function(A,e,t){function i(A,e){A.navigator.mediaDevices&&"getDisplayMedia"in A.navigator.mediaDevices||A.navigator.mediaDevices&&("function"==typeof e?A.navigator.mediaDevices.getDisplayMedia=function(t){return e(t).then((function(e){var i=t.video&&t.video.width,n=t.video&&t.video.height,a=t.video&&t.video.frameRate;return t.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:e,maxFrameRate:a||3}},i&&(t.video.mandatory.maxWidth=i),n&&(t.video.mandatory.maxHeight=n),A.navigator.mediaDevices.getUserMedia(t)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}Object.defineProperty(t,"__esModule",{value:!0}),t.shimGetDisplayMedia=i},{}],5:[function(A,e,t){Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"===d(Symbol.iterator)?function(A){return d(A)}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":d(A)};t.shimGetUserMedia=o;var n=a(A("../utils.js"));function a(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[t]=A[t]);return e.default=A,e}var r=n.log;function o(A){var e=A&&A.navigator;if(e.mediaDevices){var t=n.detectBrowser(A),a=function(A){if("object"!==(void 0===A?"undefined":i(A))||A.mandatory||A.optional)return A;var e={};return Object.keys(A).forEach((function(t){if("require"!==t&&"advanced"!==t&&"mediaSource"!==t){var n="object"===i(A[t])?A[t]:{ideal:A[t]};void 0!==n.exact&&"number"==typeof n.exact&&(n.min=n.max=n.exact);var a=function(A,e){return A?A+e.charAt(0).toUpperCase()+e.slice(1):"deviceId"===e?"sourceId":e};if(void 0!==n.ideal){e.optional=e.optional||[];var r={};"number"==typeof n.ideal?(r[a("min",t)]=n.ideal,e.optional.push(r),(r={})[a("max",t)]=n.ideal,e.optional.push(r)):(r[a("",t)]=n.ideal,e.optional.push(r))}void 0!==n.exact&&"number"!=typeof n.exact?(e.mandatory=e.mandatory||{},e.mandatory[a("",t)]=n.exact):["min","max"].forEach((function(A){void 0!==n[A]&&(e.mandatory=e.mandatory||{},e.mandatory[a(A,t)]=n[A])}))}})),A.advanced&&(e.optional=(e.optional||[]).concat(A.advanced)),e},o=function(A,n){if(t.version>=61)return n(A);if((A=JSON.parse(JSON.stringify(A)))&&"object"===i(A.audio)){var o=function(A,e,t){e in A&&!(t in A)&&(A[t]=A[e],delete A[e])};o((A=JSON.parse(JSON.stringify(A))).audio,"autoGainControl","googAutoGainControl"),o(A.audio,"noiseSuppression","googNoiseSuppression"),A.audio=a(A.audio)}if(A&&"object"===i(A.video)){var s=A.video.facingMode;s=s&&("object"===(void 0===s?"undefined":i(s))?s:{ideal:s});var g=t.version<66;if(s&&("user"===s.exact||"environment"===s.exact||"user"===s.ideal||"environment"===s.ideal)&&(!e.mediaDevices.getSupportedConstraints||!e.mediaDevices.getSupportedConstraints().facingMode||g)){delete A.video.facingMode;var c=void 0;if("environment"===s.exact||"environment"===s.ideal?c=["back","rear"]:"user"!==s.exact&&"user"!==s.ideal||(c=["front"]),c)return e.mediaDevices.enumerateDevices().then((function(e){e=e.filter((function(A){return"videoinput"===A.kind}));var t=e.find((function(A){return c.some((function(e){return A.label.toLowerCase().includes(e)}))}));return!t&&e.length&&c.includes("back")&&(t=e[e.length-1]),t&&(A.video.deviceId=s.exact?{exact:t.deviceId}:{ideal:t.deviceId}),A.video=a(A.video),r("chrome: "+JSON.stringify(A)),n(A)}))}A.video=a(A.video)}return r("chrome: "+JSON.stringify(A)),n(A)},s=function(A){return t.version>=64?A:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[A.name]||A.name,message:A.message,constraint:A.constraint||A.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},g=function(A,t,i){o(A,(function(A){e.webkitGetUserMedia(A,t,(function(A){i&&i(s(A))}))}))};if(e.getUserMedia=g.bind(e),e.mediaDevices.getUserMedia){var c=e.mediaDevices.getUserMedia.bind(e.mediaDevices);e.mediaDevices.getUserMedia=function(A){return o(A,(function(A){return c(A).then((function(e){if(A.audio&&!e.getAudioTracks().length||A.video&&!e.getVideoTracks().length)throw e.getTracks().forEach((function(A){A.stop()})),new DOMException("","NotFoundError");return e}),(function(A){return Promise.reject(s(A))}))}))}}}}},{"../utils.js":15}],6:[function(A,e,t){Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"===d(Symbol.iterator)?function(A){return d(A)}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":d(A)};t.shimRTCIceCandidate=s,t.shimMaxMessageSize=g,t.shimSendThrowTypeError=c,t.shimConnectionState=l,t.removeAllowExtmapMixed=I;var n=o(A("sdp")),a=r(A("./utils"));function r(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[t]=A[t]);return e.default=A,e}function o(A){return A&&A.__esModule?A:{default:A}}function s(A){if(!(!A.RTCIceCandidate||A.RTCIceCandidate&&"foundation"in A.RTCIceCandidate.prototype)){var e=A.RTCIceCandidate;A.RTCIceCandidate=function(A){if("object"===(void 0===A?"undefined":i(A))&&A.candidate&&0===A.candidate.indexOf("a=")&&((A=JSON.parse(JSON.stringify(A))).candidate=A.candidate.substr(2)),A.candidate&&A.candidate.length){var t=new e(A),a=n.default.parseCandidate(A.candidate),r=Object.assign(t,a);return r.toJSON=function(){return{candidate:r.candidate,sdpMid:r.sdpMid,sdpMLineIndex:r.sdpMLineIndex,usernameFragment:r.usernameFragment}},r}return new e(A)},A.RTCIceCandidate.prototype=e.prototype,a.wrapPeerConnectionEvent(A,"icecandidate",(function(e){return e.candidate&&Object.defineProperty(e,"candidate",{value:new A.RTCIceCandidate(e.candidate),writable:"false"}),e}))}}function g(A){if(A.RTCPeerConnection){var e=a.detectBrowser(A);"sctp"in A.RTCPeerConnection.prototype||Object.defineProperty(A.RTCPeerConnection.prototype,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp}});var t=function(A){if(!A||!A.sdp)return!1;var e=n.default.splitSections(A.sdp);return e.shift(),e.some((function(A){var e=n.default.parseMLine(A);return e&&"application"===e.kind&&-1!==e.protocol.indexOf("SCTP")}))},i=function(A){var e=A.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===e||e.length<2)return-1;var t=parseInt(e[1],10);return t!=t?-1:t},r=function(A){var t=65536;return"firefox"===e.browser&&(t=e.version<57?-1===A?16384:2147483637:e.version<60?57===e.version?65535:65536:2147483637),t},o=function(A,t){var i=65536;"firefox"===e.browser&&57===e.version&&(i=65535);var a=n.default.matchPrefix(A.sdp,"a=max-message-size:");return a.length>0?i=parseInt(a[0].substr(19),10):"firefox"===e.browser&&-1!==t&&(i=2147483637),i},s=A.RTCPeerConnection.prototype.setRemoteDescription;A.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===e.browser&&e.version>=76&&"plan-b"===this.getConfiguration().sdpSemantics&&Object.defineProperty(this,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0}),t(arguments[0])){var A=i(arguments[0]),n=r(A),a=o(arguments[0],A),g=void 0;g=0===n&&0===a?Number.POSITIVE_INFINITY:0===n||0===a?Math.max(n,a):Math.min(n,a);var c={};Object.defineProperty(c,"maxMessageSize",{get:function(){return g}}),this._sctp=c}return s.apply(this,arguments)}}}function c(A){if(A.RTCPeerConnection&&"createDataChannel"in A.RTCPeerConnection.prototype){var e=A.RTCPeerConnection.prototype.createDataChannel;A.RTCPeerConnection.prototype.createDataChannel=function(){var A=e.apply(this,arguments);return t(A,this),A},a.wrapPeerConnectionEvent(A,"datachannel",(function(A){return t(A.channel,A.target),A}))}function t(A,e){var t=A.send;A.send=function(){var i=arguments[0],n=i.length||i.size||i.byteLength;if("open"===A.readyState&&e.sctp&&n>e.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+e.sctp.maxMessageSize+" bytes)");return t.apply(A,arguments)}}}function l(A){if(A.RTCPeerConnection&&!("connectionState"in A.RTCPeerConnection.prototype)){var e=A.RTCPeerConnection.prototype;Object.defineProperty(e,"connectionState",{get:function(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(e,"onconnectionstatechange",{get:function(){return this._onconnectionstatechange||null},set:function(A){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),A&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=A)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((function(A){var t=e[A];e[A]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=function(A){var e=A.target;if(e._lastConnectionState!==e.connectionState){e._lastConnectionState=e.connectionState;var t=new Event("connectionstatechange",A);e.dispatchEvent(t)}return A},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),t.apply(this,arguments)}}))}}function I(A){if(A.RTCPeerConnection){var e=a.detectBrowser(A);if(!("chrome"===e.browser&&e.version>=71)){var t=A.RTCPeerConnection.prototype.setRemoteDescription;A.RTCPeerConnection.prototype.setRemoteDescription=function(A){return A&&A.sdp&&-1!==A.sdp.indexOf("\na=extmap-allow-mixed")&&(A.sdp=A.sdp.split("\n").filter((function(A){return"a=extmap-allow-mixed"!==A.trim()})).join("\n")),t.apply(this,arguments)}}}}},{"./utils":15,sdp:17}],7:[function(A,e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.shimGetDisplayMedia=t.shimGetUserMedia=void 0;var i=A("./getusermedia");Object.defineProperty(t,"shimGetUserMedia",{enumerable:!0,get:function(){return i.shimGetUserMedia}});var n=A("./getdisplaymedia");Object.defineProperty(t,"shimGetDisplayMedia",{enumerable:!0,get:function(){return n.shimGetDisplayMedia}}),t.shimPeerConnection=c,t.shimReplaceTrack=l;var a=g(A("../utils")),r=A("./filtericeservers"),o=s(A("rtcpeerconnection-shim"));function s(A){return A&&A.__esModule?A:{default:A}}function g(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[t]=A[t]);return e.default=A,e}function c(A){var e=a.detectBrowser(A);if(A.RTCIceGatherer&&(A.RTCIceCandidate||(A.RTCIceCandidate=function(A){return A}),A.RTCSessionDescription||(A.RTCSessionDescription=function(A){return A}),e.version<15025)){var t=Object.getOwnPropertyDescriptor(A.MediaStreamTrack.prototype,"enabled");Object.defineProperty(A.MediaStreamTrack.prototype,"enabled",{set:function(A){t.set.call(this,A);var e=new Event("enabled");e.enabled=A,this.dispatchEvent(e)}})}A.RTCRtpSender&&!("dtmf"in A.RTCRtpSender.prototype)&&Object.defineProperty(A.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new A.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),A.RTCDtmfSender&&!A.RTCDTMFSender&&(A.RTCDTMFSender=A.RTCDtmfSender);var i=(0,o.default)(A,e.version);A.RTCPeerConnection=function(A){return A&&A.iceServers&&(A.iceServers=(0,r.filterIceServers)(A.iceServers,e.version),a.log("ICE servers after filtering:",A.iceServers)),new i(A)},A.RTCPeerConnection.prototype=i.prototype}function l(A){A.RTCRtpSender&&!("replaceTrack"in A.RTCRtpSender.prototype)&&(A.RTCRtpSender.prototype.replaceTrack=A.RTCRtpSender.prototype.setTrack)}},{"../utils":15,"./filtericeservers":8,"./getdisplaymedia":9,"./getusermedia":10,"rtcpeerconnection-shim":16}],8:[function(A,e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.filterIceServers=a;var i=n(A("../utils"));function n(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[t]=A[t]);return e.default=A,e}function a(A,e){var t=!1;return(A=JSON.parse(JSON.stringify(A))).filter((function(A){if(A&&(A.urls||A.url)){var e=A.urls||A.url;A.url&&!A.urls&&i.deprecated("RTCIceServer.url","RTCIceServer.urls");var n="string"==typeof e;return n&&(e=[e]),e=e.filter((function(A){if(0===A.indexOf("stun:"))return!1;var e=A.startsWith("turn")&&!A.startsWith("turn:[")&&A.includes("transport=udp");return e&&!t?(t=!0,!0):e&&!t})),delete A.url,A.urls=n?e[0]:e,!!e.length}}))}},{"../utils":15}],9:[function(A,e,t){function i(A){"getDisplayMedia"in A.navigator&&A.navigator.mediaDevices&&(A.navigator.mediaDevices&&"getDisplayMedia"in A.navigator.mediaDevices||(A.navigator.mediaDevices.getDisplayMedia=A.navigator.getDisplayMedia.bind(A.navigator)))}Object.defineProperty(t,"__esModule",{value:!0}),t.shimGetDisplayMedia=i},{}],10:[function(A,e,t){function i(A){var e=A&&A.navigator,t=function(A){return{name:{PermissionDeniedError:"NotAllowedError"}[A.name]||A.name,message:A.message,constraint:A.constraint,toString:function(){return this.name}}},i=e.mediaDevices.getUserMedia.bind(e.mediaDevices);e.mediaDevices.getUserMedia=function(A){return i(A).catch((function(A){return Promise.reject(t(A))}))}}Object.defineProperty(t,"__esModule",{value:!0}),t.shimGetUserMedia=i},{}],11:[function(A,e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.shimGetDisplayMedia=t.shimGetUserMedia=void 0;var i="function"==typeof Symbol&&"symbol"===d(Symbol.iterator)?function(A){return d(A)}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":d(A)},n=A("./getusermedia");Object.defineProperty(t,"shimGetUserMedia",{enumerable:!0,get:function(){return n.shimGetUserMedia}});var a=A("./getdisplaymedia");Object.defineProperty(t,"shimGetDisplayMedia",{enumerable:!0,get:function(){return a.shimGetDisplayMedia}}),t.shimOnTrack=g,t.shimPeerConnection=c,t.shimSenderGetStats=l,t.shimReceiverGetStats=I,t.shimRemoveStream=C,t.shimRTCDataChannel=h,t.shimAddTransceiver=u,t.shimCreateOffer=B,t.shimCreateAnswer=E;var r=o(A("../utils"));function o(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[t]=A[t]);return e.default=A,e}function s(A,e,t){return e in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function g(A){"object"===(void 0===A?"undefined":i(A))&&A.RTCTrackEvent&&"receiver"in A.RTCTrackEvent.prototype&&!("transceiver"in A.RTCTrackEvent.prototype)&&Object.defineProperty(A.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})}function c(A){var e=r.detectBrowser(A);if("object"===(void 0===A?"undefined":i(A))&&(A.RTCPeerConnection||A.mozRTCPeerConnection)){if(!A.RTCPeerConnection&&A.mozRTCPeerConnection&&(A.RTCPeerConnection=A.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(e){var t=A.RTCPeerConnection.prototype[e],i=s({},e,(function(){return arguments[0]=new("addIceCandidate"===e?A.RTCIceCandidate:A.RTCSessionDescription)(arguments[0]),t.apply(this,arguments)}));A.RTCPeerConnection.prototype[e]=i[e]})),e.version<68){var t=A.RTCPeerConnection.prototype.addIceCandidate;A.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?arguments[0]&&""===arguments[0].candidate?Promise.resolve():t.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}var n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},a=A.RTCPeerConnection.prototype.getStats;A.RTCPeerConnection.prototype.getStats=function(){var A=Array.prototype.slice.call(arguments),t=A[0],i=A[1],r=A[2];return a.apply(this,[t||null]).then((function(A){if(e.version<53&&!i)try{A.forEach((function(A){A.type=n[A.type]||A.type}))}catch(e){if("TypeError"!==e.name)throw e;A.forEach((function(e,t){A.set(t,Object.assign({},e,{type:n[e.type]||e.type}))}))}return A})).then(i,r)}}}function l(A){if("object"===(void 0===A?"undefined":i(A))&&A.RTCPeerConnection&&A.RTCRtpSender&&(!A.RTCRtpSender||!("getStats"in A.RTCRtpSender.prototype))){var e=A.RTCPeerConnection.prototype.getSenders;e&&(A.RTCPeerConnection.prototype.getSenders=function(){var A=this,t=e.apply(this,[]);return t.forEach((function(e){return e._pc=A})),t});var t=A.RTCPeerConnection.prototype.addTrack;t&&(A.RTCPeerConnection.prototype.addTrack=function(){var A=t.apply(this,arguments);return A._pc=this,A}),A.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}}function I(A){if("object"===(void 0===A?"undefined":i(A))&&A.RTCPeerConnection&&A.RTCRtpSender&&(!A.RTCRtpSender||!("getStats"in A.RTCRtpReceiver.prototype))){var e=A.RTCPeerConnection.prototype.getReceivers;e&&(A.RTCPeerConnection.prototype.getReceivers=function(){var A=this,t=e.apply(this,[]);return t.forEach((function(e){return e._pc=A})),t}),r.wrapPeerConnectionEvent(A,"track",(function(A){return A.receiver._pc=A.srcElement,A})),A.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}}function C(A){A.RTCPeerConnection&&!("removeStream"in A.RTCPeerConnection.prototype)&&(A.RTCPeerConnection.prototype.removeStream=function(A){var e=this;r.deprecated("removeStream","removeTrack"),this.getSenders().forEach((function(t){t.track&&A.getTracks().includes(t.track)&&e.removeTrack(t)}))})}function h(A){A.DataChannel&&!A.RTCDataChannel&&(A.RTCDataChannel=A.DataChannel)}function u(A){if("object"===(void 0===A?"undefined":i(A))&&A.RTCPeerConnection){var e=A.RTCPeerConnection.prototype.addTransceiver;e&&(A.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];var A=arguments[1],t=A&&"sendEncodings"in A;t&&A.sendEncodings.forEach((function(A){if("rid"in A&&!/^[a-z0-9]{0,16}$/i.test(A.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in A&&!(parseFloat(A.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in A&&!(parseFloat(A.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));var i=e.apply(this,arguments);if(t){var n=i.sender,a=n.getParameters();"encodings"in a||(a.encodings=A.sendEncodings,this.setParametersPromises.push(n.setParameters(a).catch((function(){}))))}return i})}}function B(A){if("object"===(void 0===A?"undefined":i(A))&&A.RTCPeerConnection){var e=A.RTCPeerConnection.prototype.createOffer;A.RTCPeerConnection.prototype.createOffer=function(){var A=this,t=arguments;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return e.apply(A,t)})).finally((function(){A.setParametersPromises=[]})):e.apply(this,arguments)}}}function E(A){if("object"===(void 0===A?"undefined":i(A))&&A.RTCPeerConnection){var e=A.RTCPeerConnection.prototype.createAnswer;A.RTCPeerConnection.prototype.createAnswer=function(){var A=this,t=arguments;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return e.apply(A,t)})).finally((function(){A.setParametersPromises=[]})):e.apply(this,arguments)}}}},{"../utils":15,"./getdisplaymedia":12,"./getusermedia":13}],12:[function(A,e,t){function i(A,e){A.navigator.mediaDevices&&"getDisplayMedia"in A.navigator.mediaDevices||A.navigator.mediaDevices&&(A.navigator.mediaDevices.getDisplayMedia=function(t){if(!t||!t.video){var i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,Promise.reject(i)}return!0===t.video?t.video={mediaSource:e}:t.video.mediaSource=e,A.navigator.mediaDevices.getUserMedia(t)})}Object.defineProperty(t,"__esModule",{value:!0}),t.shimGetDisplayMedia=i},{}],13:[function(A,e,t){Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"===d(Symbol.iterator)?function(A){return d(A)}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":d(A)};t.shimGetUserMedia=r;var n=a(A("../utils"));function a(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[t]=A[t]);return e.default=A,e}function r(A){var e=n.detectBrowser(A),t=A&&A.navigator,a=A&&A.MediaStreamTrack;if(t.getUserMedia=function(A,e,i){n.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),t.mediaDevices.getUserMedia(A).then(e,i)},!(e.version>55&&"autoGainControl"in t.mediaDevices.getSupportedConstraints())){var r=function(A,e,t){e in A&&!(t in A)&&(A[t]=A[e],delete A[e])},o=t.mediaDevices.getUserMedia.bind(t.mediaDevices);if(t.mediaDevices.getUserMedia=function(A){return"object"===(void 0===A?"undefined":i(A))&&"object"===i(A.audio)&&(A=JSON.parse(JSON.stringify(A)),r(A.audio,"autoGainControl","mozAutoGainControl"),r(A.audio,"noiseSuppression","mozNoiseSuppression")),o(A)},a&&a.prototype.getSettings){var s=a.prototype.getSettings;a.prototype.getSettings=function(){var A=s.apply(this,arguments);return r(A,"mozAutoGainControl","autoGainControl"),r(A,"mozNoiseSuppression","noiseSuppression"),A}}if(a&&a.prototype.applyConstraints){var g=a.prototype.applyConstraints;a.prototype.applyConstraints=function(A){return"audio"===this.kind&&"object"===(void 0===A?"undefined":i(A))&&(A=JSON.parse(JSON.stringify(A)),r(A,"autoGainControl","mozAutoGainControl"),r(A,"noiseSuppression","mozNoiseSuppression")),g.apply(this,[A])}}}}},{"../utils":15}],14:[function(A,e,t){Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"===d(Symbol.iterator)?function(A){return d(A)}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":d(A)};t.shimLocalStreamsAPI=r,t.shimRemoteStreamsAPI=o,t.shimCallbacksAPI=s,t.shimGetUserMedia=g,t.shimConstraints=c,t.shimRTCIceServerUrls=l,t.shimTrackEventTransceiver=I,t.shimCreateOfferLegacy=C;var n=a(A("../utils"));function a(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[t]=A[t]);return e.default=A,e}function r(A){if("object"===(void 0===A?"undefined":i(A))&&A.RTCPeerConnection){if("getLocalStreams"in A.RTCPeerConnection.prototype||(A.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in A.RTCPeerConnection.prototype)){var e=A.RTCPeerConnection.prototype.addTrack;A.RTCPeerConnection.prototype.addStream=function(A){var t=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(A)||this._localStreams.push(A),A.getAudioTracks().forEach((function(i){return e.call(t,i,A)})),A.getVideoTracks().forEach((function(i){return e.call(t,i,A)}))},A.RTCPeerConnection.prototype.addTrack=function(A){var t=arguments[1];return t&&(this._localStreams?this._localStreams.includes(t)||this._localStreams.push(t):this._localStreams=[t]),e.apply(this,arguments)}}"removeStream"in A.RTCPeerConnection.prototype||(A.RTCPeerConnection.prototype.removeStream=function(A){var e=this;this._localStreams||(this._localStreams=[]);var t=this._localStreams.indexOf(A);if(-1!==t){this._localStreams.splice(t,1);var i=A.getTracks();this.getSenders().forEach((function(A){i.includes(A.track)&&e.removeTrack(A)}))}})}}function o(A){if("object"===(void 0===A?"undefined":i(A))&&A.RTCPeerConnection&&("getRemoteStreams"in A.RTCPeerConnection.prototype||(A.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in A.RTCPeerConnection.prototype))){Object.defineProperty(A.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(A){var e=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=A),this.addEventListener("track",this._onaddstreampoly=function(A){A.streams.forEach((function(A){if(e._remoteStreams||(e._remoteStreams=[]),!e._remoteStreams.includes(A)){e._remoteStreams.push(A);var t=new Event("addstream");t.stream=A,e.dispatchEvent(t)}}))})}});var e=A.RTCPeerConnection.prototype.setRemoteDescription;A.RTCPeerConnection.prototype.setRemoteDescription=function(){var A=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(e){e.streams.forEach((function(e){if(A._remoteStreams||(A._remoteStreams=[]),!(A._remoteStreams.indexOf(e)>=0)){A._remoteStreams.push(e);var t=new Event("addstream");t.stream=e,A.dispatchEvent(t)}}))}),e.apply(A,arguments)}}}function s(A){if("object"===(void 0===A?"undefined":i(A))&&A.RTCPeerConnection){var e=A.RTCPeerConnection.prototype,t=e.createOffer,n=e.createAnswer,a=e.setLocalDescription,r=e.setRemoteDescription,o=e.addIceCandidate;e.createOffer=function(A,e){var i=arguments.length>=2?arguments[2]:arguments[0],n=t.apply(this,[i]);return e?(n.then(A,e),Promise.resolve()):n},e.createAnswer=function(A,e){var t=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[t]);return e?(i.then(A,e),Promise.resolve()):i};var s=function(A,e,t){var i=a.apply(this,[A]);return t?(i.then(e,t),Promise.resolve()):i};e.setLocalDescription=s,s=function(A,e,t){var i=r.apply(this,[A]);return t?(i.then(e,t),Promise.resolve()):i},e.setRemoteDescription=s,s=function(A,e,t){var i=o.apply(this,[A]);return t?(i.then(e,t),Promise.resolve()):i},e.addIceCandidate=s}}function g(A){var e=A&&A.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){var t=e.mediaDevices,i=t.getUserMedia.bind(t);e.mediaDevices.getUserMedia=function(A){return i(c(A))}}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=function(A,t,i){e.mediaDevices.getUserMedia(A).then(t,i)}.bind(e))}function c(A){return A&&void 0!==A.video?Object.assign({},A,{video:n.compactObject(A.video)}):A}function l(A){var e=A.RTCPeerConnection;A.RTCPeerConnection=function(A,t){if(A&&A.iceServers){for(var i=[],a=0;a=t&&parseInt(i[t],10)}function s(A,e,t){if(A.RTCPeerConnection){var i=A.RTCPeerConnection.prototype,n=i.addEventListener;i.addEventListener=function(A,i){if(A!==e)return n.apply(this,arguments);var a=function(A){var e=t(A);e&&i(e)};return this._eventMap=this._eventMap||{},this._eventMap[i]=a,n.apply(this,[A,a])};var a=i.removeEventListener;i.removeEventListener=function(A,t){if(A!==e||!this._eventMap||!this._eventMap[t])return a.apply(this,arguments);var i=this._eventMap[t];return delete this._eventMap[t],a.apply(this,[A,i])},Object.defineProperty(i,"on"+e,{get:function(){return this["_on"+e]},set:function(A){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),A&&this.addEventListener(e,this["_on"+e]=A)},enumerable:!0,configurable:!0})}}function g(A){return"boolean"!=typeof A?new Error("Argument type: "+(void 0===A?"undefined":i(A))+". Please use a boolean."):(a=A,A?"adapter.js logging disabled":"adapter.js logging enabled")}function c(A){return"boolean"!=typeof A?new Error("Argument type: "+(void 0===A?"undefined":i(A))+". Please use a boolean."):(r=!A,"adapter.js deprecation warnings "+(A?"disabled":"enabled"))}function l(){if("object"===("undefined"==typeof window?"undefined":i(window))){if(a)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function I(A,e){r&&console.warn(A+" is deprecated, please use "+e+" instead.")}function C(A){var e=A.navigator,t={browser:null,version:null};if(void 0===A||!A.navigator)return t.browser="Not a browser.",t;if(e.mozGetUserMedia)t.browser="firefox",t.version=o(e.userAgent,/Firefox\/(\d+)\./,1);else if(e.webkitGetUserMedia||!1===A.isSecureContext&&A.webkitRTCPeerConnection&&!A.RTCIceGatherer)t.browser="chrome",t.version=o(e.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(e.mediaDevices&&e.userAgent.match(/Edge\/(\d+).(\d+)$/))t.browser="edge",t.version=o(e.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!A.RTCPeerConnection||!e.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=o(e.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=A.RTCRtpTransceiver&&"currentDirection"in A.RTCRtpTransceiver.prototype}return t}function h(A){return"[object Object]"===Object.prototype.toString.call(A)}function u(A){return h(A)?Object.keys(A).reduce((function(e,t){var i=h(A[t]),a=i?u(A[t]):A[t],r=i&&!Object.keys(a).length;return void 0===a||r?e:Object.assign(e,n({},t,a))}),{}):A}function B(A,e,t){e&&!t.has(e.id)&&(t.set(e.id,e),Object.keys(e).forEach((function(i){i.endsWith("Id")?B(A,A.get(e[i]),t):i.endsWith("Ids")&&e[i].forEach((function(e){B(A,A.get(e),t)}))})))}function E(A,e,t){var i=t?"outbound-rtp":"inbound-rtp",n=new Map;if(null===e)return n;var a=[];return A.forEach((function(A){"track"===A.type&&A.trackIdentifier===e.id&&a.push(A)})),a.forEach((function(e){A.forEach((function(t){t.type===i&&t.trackId===e.id&&B(A,t,n)}))})),n}},{}],16:[function(A,e,t){var i=A("sdp");function n(A){return{inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[A.type]||A.type}function a(A,e,t,n,a){var r=i.writeRtpDescription(A.kind,e);if(r+=i.writeIceParameters(A.iceGatherer.getLocalParameters()),r+=i.writeDtlsParameters(A.dtlsTransport.getLocalParameters(),"offer"===t?"actpass":a||"active"),r+="a=mid:"+A.mid+"\r\n",A.rtpSender&&A.rtpReceiver?r+="a=sendrecv\r\n":A.rtpSender?r+="a=sendonly\r\n":A.rtpReceiver?r+="a=recvonly\r\n":r+="a=inactive\r\n",A.rtpSender){var o=A.rtpSender._initialTrackId||A.rtpSender.track.id;A.rtpSender._initialTrackId=o;var s="msid:"+(n?n.id:"-")+" "+o+"\r\n";r+="a="+s,r+="a=ssrc:"+A.sendEncodingParameters[0].ssrc+" "+s,A.sendEncodingParameters[0].rtx&&(r+="a=ssrc:"+A.sendEncodingParameters[0].rtx.ssrc+" "+s,r+="a=ssrc-group:FID "+A.sendEncodingParameters[0].ssrc+" "+A.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return r+="a=ssrc:"+A.sendEncodingParameters[0].ssrc+" cname:"+i.localCName+"\r\n",A.rtpSender&&A.sendEncodingParameters[0].rtx&&(r+="a=ssrc:"+A.sendEncodingParameters[0].rtx.ssrc+" cname:"+i.localCName+"\r\n"),r}function r(A,e){var t=!1;return(A=JSON.parse(JSON.stringify(A))).filter((function(A){if(A&&(A.urls||A.url)){var i=A.urls||A.url;A.url&&!A.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var n="string"==typeof i;return n&&(i=[i]),i=i.filter((function(A){return 0!==A.indexOf("turn:")||-1===A.indexOf("transport=udp")||-1!==A.indexOf("turn:[")||t?0===A.indexOf("stun:")&&e>=14393&&-1===A.indexOf("?transport=udp"):(t=!0,!0)})),delete A.url,A.urls=n?i[0]:i,!!i.length}}))}function o(A,e){var t={codecs:[],headerExtensions:[],fecMechanisms:[]},i=function(A,e){A=parseInt(A,10);for(var t=0;t0;o--)this._iceGatherers.push(new A.RTCIceGatherer({iceServers:t.iceServers,gatherPolicy:t.iceTransportPolicy}));else t.iceCandidatePoolSize=0;this._config=t,this.transceivers=[],this._sdpSessionId=i.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(d.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(d.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),d.prototype.onicecandidate=null,d.prototype.onaddstream=null,d.prototype.ontrack=null,d.prototype.onremovestream=null,d.prototype.onsignalingstatechange=null,d.prototype.oniceconnectionstatechange=null,d.prototype.onconnectionstatechange=null,d.prototype.onicegatheringstatechange=null,d.prototype.onnegotiationneeded=null,d.prototype.ondatachannel=null,d.prototype._dispatchEvent=function(A,e){this._isClosed||(this.dispatchEvent(e),"function"==typeof this["on"+A]&&this["on"+A](e))},d.prototype._emitGatheringStateChange=function(){var A=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",A)},d.prototype.getConfiguration=function(){return this._config},d.prototype.getLocalStreams=function(){return this.localStreams},d.prototype.getRemoteStreams=function(){return this.remoteStreams},d.prototype._createTransceiver=function(A,e){var t=this.transceivers.length>0,i={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:A,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&t)i.iceTransport=this.transceivers[0].iceTransport,i.dtlsTransport=this.transceivers[0].dtlsTransport;else{var n=this._createIceAndDtlsTransports();i.iceTransport=n.iceTransport,i.dtlsTransport=n.dtlsTransport}return e||this.transceivers.push(i),i},d.prototype.addTrack=function(e,t){if(this._isClosed)throw c("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var i,n=this.transceivers.find((function(A){return A.track===e}));if(n)throw c("InvalidAccessError","Track already exists.");for(var a=0;a=15025)A.getTracks().forEach((function(e){t.addTrack(e,A)}));else{var i=A.clone();A.getTracks().forEach((function(A,e){var t=i.getTracks()[e];A.addEventListener("enabled",(function(A){t.enabled=A.enabled}))})),i.getTracks().forEach((function(A){t.addTrack(A,i)}))}},d.prototype.removeTrack=function(e){if(this._isClosed)throw c("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(e instanceof A.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var t=this.transceivers.find((function(A){return A.rtpSender===e}));if(!t)throw c("InvalidAccessError","Sender was not created by this connection.");var i=t.stream;t.rtpSender.stop(),t.rtpSender=null,t.track=null,t.stream=null;var n=this.transceivers.map((function(A){return A.stream}));-1===n.indexOf(i)&&this.localStreams.indexOf(i)>-1&&this.localStreams.splice(this.localStreams.indexOf(i),1),this._maybeFireNegotiationNeeded()},d.prototype.removeStream=function(A){var e=this;A.getTracks().forEach((function(A){var t=e.getSenders().find((function(e){return e.track===A}));t&&e.removeTrack(t)}))},d.prototype.getSenders=function(){return this.transceivers.filter((function(A){return!!A.rtpSender})).map((function(A){return A.rtpSender}))},d.prototype.getReceivers=function(){return this.transceivers.filter((function(A){return!!A.rtpReceiver})).map((function(A){return A.rtpReceiver}))},d.prototype._createIceGatherer=function(e,t){var i=this;if(t&&e>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var n=new A.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(n,"state",{value:"new",writable:!0}),this.transceivers[e].bufferedCandidateEvents=[],this.transceivers[e].bufferCandidates=function(A){var t=!A.candidate||0===Object.keys(A.candidate).length;n.state=t?"completed":"gathering",null!==i.transceivers[e].bufferedCandidateEvents&&i.transceivers[e].bufferedCandidateEvents.push(A)},n.addEventListener("localcandidate",this.transceivers[e].bufferCandidates),n},d.prototype._gather=function(e,t){var n=this,a=this.transceivers[t].iceGatherer;if(!a.onlocalcandidate){var r=this.transceivers[t].bufferedCandidateEvents;this.transceivers[t].bufferedCandidateEvents=null,a.removeEventListener("localcandidate",this.transceivers[t].bufferCandidates),a.onlocalcandidate=function(A){if(!(n.usingBundle&&t>0)){var r=new Event("icecandidate");r.candidate={sdpMid:e,sdpMLineIndex:t};var o=A.candidate,s=!o||0===Object.keys(o).length;if(s)"new"!==a.state&&"gathering"!==a.state||(a.state="completed");else{"new"===a.state&&(a.state="gathering"),o.component=1,o.ufrag=a.getLocalParameters().usernameFragment;var g=i.writeCandidate(o);r.candidate=Object.assign(r.candidate,i.parseCandidate(g)),r.candidate.candidate=g,r.candidate.toJSON=function(){return{candidate:r.candidate.candidate,sdpMid:r.candidate.sdpMid,sdpMLineIndex:r.candidate.sdpMLineIndex,usernameFragment:r.candidate.usernameFragment}}}var c=i.getMediaSections(n._localDescription.sdp);c[r.candidate.sdpMLineIndex]+=s?"a=end-of-candidates\r\n":"a="+r.candidate.candidate+"\r\n",n._localDescription.sdp=i.getDescription(n._localDescription.sdp)+c.join("");var l=n.transceivers.every((function(A){return A.iceGatherer&&"completed"===A.iceGatherer.state}));"gathering"!==n.iceGatheringState&&(n.iceGatheringState="gathering",n._emitGatheringStateChange()),s||n._dispatchEvent("icecandidate",r),l&&(n._dispatchEvent("icecandidate",new Event("icecandidate")),n.iceGatheringState="complete",n._emitGatheringStateChange())}},A.setTimeout((function(){r.forEach((function(A){a.onlocalcandidate(A)}))}),0)}},d.prototype._createIceAndDtlsTransports=function(){var e=this,t=new A.RTCIceTransport(null);t.onicestatechange=function(){e._updateIceConnectionState(),e._updateConnectionState()};var i=new A.RTCDtlsTransport(t);return i.ondtlsstatechange=function(){e._updateConnectionState()},i.onerror=function(){Object.defineProperty(i,"state",{value:"failed",writable:!0}),e._updateConnectionState()},{iceTransport:t,dtlsTransport:i}},d.prototype._disposeIceAndDtlsTransports=function(A){var e=this.transceivers[A].iceGatherer;e&&(delete e.onlocalcandidate,delete this.transceivers[A].iceGatherer);var t=this.transceivers[A].iceTransport;t&&(delete t.onicestatechange,delete this.transceivers[A].iceTransport);var i=this.transceivers[A].dtlsTransport;i&&(delete i.ondtlsstatechange,delete i.onerror,delete this.transceivers[A].dtlsTransport)},d.prototype._transceive=function(A,t,n){var a=o(A.localCapabilities,A.remoteCapabilities);t&&A.rtpSender&&(a.encodings=A.sendEncodingParameters,a.rtcp={cname:i.localCName,compound:A.rtcpParameters.compound},A.recvEncodingParameters.length&&(a.rtcp.ssrc=A.recvEncodingParameters[0].ssrc),A.rtpSender.send(a)),n&&A.rtpReceiver&&a.codecs.length>0&&("video"===A.kind&&A.recvEncodingParameters&&e<15019&&A.recvEncodingParameters.forEach((function(A){delete A.rtx})),A.recvEncodingParameters.length?a.encodings=A.recvEncodingParameters:a.encodings=[{}],a.rtcp={compound:A.rtcpParameters.compound},A.rtcpParameters.cname&&(a.rtcp.cname=A.rtcpParameters.cname),A.sendEncodingParameters.length&&(a.rtcp.ssrc=A.sendEncodingParameters[0].ssrc),A.rtpReceiver.receive(a))},d.prototype.setLocalDescription=function(A){var e,t,n=this;if(-1===["offer","answer"].indexOf(A.type))return Promise.reject(c("TypeError",'Unsupported type "'+A.type+'"'));if(!s("setLocalDescription",A.type,n.signalingState)||n._isClosed)return Promise.reject(c("InvalidStateError","Can not set local "+A.type+" in state "+n.signalingState));if("offer"===A.type)e=i.splitSections(A.sdp),t=e.shift(),e.forEach((function(A,e){var t=i.parseRtpParameters(A);n.transceivers[e].localCapabilities=t})),n.transceivers.forEach((function(A,e){n._gather(A.mid,e)}));else if("answer"===A.type){e=i.splitSections(n._remoteDescription.sdp),t=e.shift();var a=i.matchPrefix(t,"a=ice-lite").length>0;e.forEach((function(A,e){var r=n.transceivers[e],s=r.iceGatherer,g=r.iceTransport,c=r.dtlsTransport,l=r.localCapabilities,I=r.remoteCapabilities;if(!(i.isRejected(A)&&0===i.matchPrefix(A,"a=bundle-only").length||r.rejected)){var d=i.getIceParameters(A,t),C=i.getDtlsParameters(A,t);a&&(C.role="server"),n.usingBundle&&0!==e||(n._gather(r.mid,e),"new"===g.state&&g.start(s,d,a?"controlling":"controlled"),"new"===c.state&&c.start(C));var h=o(l,I);n._transceive(r,h.codecs.length>0,!1)}}))}return n._localDescription={type:A.type,sdp:A.sdp},"offer"===A.type?n._updateSignalingState("have-local-offer"):n._updateSignalingState("stable"),Promise.resolve()},d.prototype.setRemoteDescription=function(n){var a=this;if(-1===["offer","answer"].indexOf(n.type))return Promise.reject(c("TypeError",'Unsupported type "'+n.type+'"'));if(!s("setRemoteDescription",n.type,a.signalingState)||a._isClosed)return Promise.reject(c("InvalidStateError","Can not set remote "+n.type+" in state "+a.signalingState));var r={};a.remoteStreams.forEach((function(A){r[A.id]=A}));var d=[],C=i.splitSections(n.sdp),h=C.shift(),u=i.matchPrefix(h,"a=ice-lite").length>0,B=i.matchPrefix(h,"a=group:BUNDLE ").length>0;a.usingBundle=B;var E=i.matchPrefix(h,"a=ice-options:")[0];return a.canTrickleIceCandidates=!!E&&E.substr(14).split(" ").indexOf("trickle")>=0,C.forEach((function(s,c){var I=i.splitLines(s),C=i.getKind(s),E=i.isRejected(s)&&0===i.matchPrefix(s,"a=bundle-only").length,f=I[0].substr(2).split(" ")[2],Q=i.getDirection(s,h),x=i.parseMsid(s),p=i.getMid(s)||i.generateIdentifier();if(E||"application"===C&&("DTLS/SCTP"===f||"UDP/DTLS/SCTP"===f))a.transceivers[c]={mid:p,kind:C,protocol:f,rejected:!0};else{var m,y,_,S,D,v,w,b,F;!E&&a.transceivers[c]&&a.transceivers[c].rejected&&(a.transceivers[c]=a._createTransceiver(C,!0));var R,k,P=i.parseRtpParameters(s);E||(R=i.getIceParameters(s,h),(k=i.getDtlsParameters(s,h)).role="client"),w=i.parseRtpEncodingParameters(s);var N=i.parseRtcpParameters(s),T=i.matchPrefix(s,"a=end-of-candidates",h).length>0,M=i.matchPrefix(s,"a=candidate:").map((function(A){return i.parseCandidate(A)})).filter((function(A){return 1===A.component}));if(("offer"===n.type||"answer"===n.type)&&!E&&B&&c>0&&a.transceivers[c]&&(a._disposeIceAndDtlsTransports(c),a.transceivers[c].iceGatherer=a.transceivers[0].iceGatherer,a.transceivers[c].iceTransport=a.transceivers[0].iceTransport,a.transceivers[c].dtlsTransport=a.transceivers[0].dtlsTransport,a.transceivers[c].rtpSender&&a.transceivers[c].rtpSender.setTransport(a.transceivers[0].dtlsTransport),a.transceivers[c].rtpReceiver&&a.transceivers[c].rtpReceiver.setTransport(a.transceivers[0].dtlsTransport)),"offer"!==n.type||E){if("answer"===n.type&&!E){y=(m=a.transceivers[c]).iceGatherer,_=m.iceTransport,S=m.dtlsTransport,D=m.rtpReceiver,v=m.sendEncodingParameters,b=m.localCapabilities,a.transceivers[c].recvEncodingParameters=w,a.transceivers[c].remoteCapabilities=P,a.transceivers[c].rtcpParameters=N,M.length&&"new"===_.state&&(!u&&!T||B&&0!==c?M.forEach((function(A){g(m.iceTransport,A)})):_.setRemoteCandidates(M)),B&&0!==c||("new"===_.state&&_.start(y,R,"controlling"),"new"===S.state&&S.start(k));var L=o(m.localCapabilities,m.remoteCapabilities).codecs.filter((function(A){return"rtx"===A.name.toLowerCase()})).length;!L&&m.sendEncodingParameters[0].rtx&&delete m.sendEncodingParameters[0].rtx,a._transceive(m,"sendrecv"===Q||"recvonly"===Q,"sendrecv"===Q||"sendonly"===Q),!D||"sendrecv"!==Q&&"sendonly"!==Q?delete m.rtpReceiver:(F=D.track,x?(r[x.stream]||(r[x.stream]=new A.MediaStream),t(F,r[x.stream]),d.push([F,D,r[x.stream]])):(r.default||(r.default=new A.MediaStream),t(F,r.default),d.push([F,D,r.default])))}}else{(m=a.transceivers[c]||a._createTransceiver(C)).mid=p,m.iceGatherer||(m.iceGatherer=a._createIceGatherer(c,B)),M.length&&"new"===m.iceTransport.state&&(!T||B&&0!==c?M.forEach((function(A){g(m.iceTransport,A)})):m.iceTransport.setRemoteCandidates(M)),b=A.RTCRtpReceiver.getCapabilities(C),e<15019&&(b.codecs=b.codecs.filter((function(A){return"rtx"!==A.name}))),v=m.sendEncodingParameters||[{ssrc:1001*(2*c+2)}];var Y,G=!1;"sendrecv"===Q||"sendonly"===Q?(G=!m.rtpReceiver,D=m.rtpReceiver||new A.RTCRtpReceiver(m.dtlsTransport,C),G&&(F=D.track,x&&"-"===x.stream||(x?(r[x.stream]||(r[x.stream]=new A.MediaStream,Object.defineProperty(r[x.stream],"id",{get:function(){return x.stream}})),Object.defineProperty(F,"id",{get:function(){return x.track}}),Y=r[x.stream]):(r.default||(r.default=new A.MediaStream),Y=r.default)),Y&&(t(F,Y),m.associatedRemoteMediaStreams.push(Y)),d.push([F,D,Y]))):m.rtpReceiver&&m.rtpReceiver.track&&(m.associatedRemoteMediaStreams.forEach((function(A){var e=A.getTracks().find((function(A){return A.id===m.rtpReceiver.track.id}));e&&l(e,A)})),m.associatedRemoteMediaStreams=[]),m.localCapabilities=b,m.remoteCapabilities=P,m.rtpReceiver=D,m.rtcpParameters=N,m.sendEncodingParameters=v,m.recvEncodingParameters=w,a._transceive(a.transceivers[c],!1,G)}}})),void 0===a._dtlsRole&&(a._dtlsRole="offer"===n.type?"active":"passive"),a._remoteDescription={type:n.type,sdp:n.sdp},"offer"===n.type?a._updateSignalingState("have-remote-offer"):a._updateSignalingState("stable"),Object.keys(r).forEach((function(e){var t=r[e];if(t.getTracks().length){if(-1===a.remoteStreams.indexOf(t)){a.remoteStreams.push(t);var i=new Event("addstream");i.stream=t,A.setTimeout((function(){a._dispatchEvent("addstream",i)}))}d.forEach((function(A){var e=A[0],i=A[1];t.id===A[2].id&&I(a,e,i,[t])}))}})),d.forEach((function(A){A[2]||I(a,A[0],A[1],[])})),A.setTimeout((function(){a&&a.transceivers&&a.transceivers.forEach((function(A){A.iceTransport&&"new"===A.iceTransport.state&&A.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),A.iceTransport.addRemoteCandidate({}))}))}),4e3),Promise.resolve()},d.prototype.close=function(){this.transceivers.forEach((function(A){A.iceTransport&&A.iceTransport.stop(),A.dtlsTransport&&A.dtlsTransport.stop(),A.rtpSender&&A.rtpSender.stop(),A.rtpReceiver&&A.rtpReceiver.stop()})),this._isClosed=!0,this._updateSignalingState("closed")},d.prototype._updateSignalingState=function(A){this.signalingState=A;var e=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",e)},d.prototype._maybeFireNegotiationNeeded=function(){var e=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,A.setTimeout((function(){if(e.needNegotiation){e.needNegotiation=!1;var A=new Event("negotiationneeded");e._dispatchEvent("negotiationneeded",A)}}),0))},d.prototype._updateIceConnectionState=function(){var A,e={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(A){A.iceTransport&&!A.rejected&&e[A.iceTransport.state]++})),A="new",e.failed>0?A="failed":e.checking>0?A="checking":e.disconnected>0?A="disconnected":e.new>0?A="new":e.connected>0?A="connected":e.completed>0&&(A="completed"),A!==this.iceConnectionState){this.iceConnectionState=A;var t=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",t)}},d.prototype._updateConnectionState=function(){var A,e={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(A){A.iceTransport&&A.dtlsTransport&&!A.rejected&&(e[A.iceTransport.state]++,e[A.dtlsTransport.state]++)})),e.connected+=e.completed,A="new",e.failed>0?A="failed":e.connecting>0?A="connecting":e.disconnected>0?A="disconnected":e.new>0?A="new":e.connected>0&&(A="connected"),A!==this.connectionState){this.connectionState=A;var t=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",t)}},d.prototype.createOffer=function(){var t=this;if(t._isClosed)return Promise.reject(c("InvalidStateError","Can not call createOffer after close"));var n=t.transceivers.filter((function(A){return"audio"===A.kind})).length,r=t.transceivers.filter((function(A){return"video"===A.kind})).length,o=arguments[0];if(o){if(o.mandatory||o.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==o.offerToReceiveAudio&&(n=!0===o.offerToReceiveAudio?1:!1===o.offerToReceiveAudio?0:o.offerToReceiveAudio),void 0!==o.offerToReceiveVideo&&(r=!0===o.offerToReceiveVideo?1:!1===o.offerToReceiveVideo?0:o.offerToReceiveVideo)}for(t.transceivers.forEach((function(A){"audio"===A.kind?--n<0&&(A.wantReceive=!1):"video"===A.kind&&--r<0&&(A.wantReceive=!1)}));n>0||r>0;)n>0&&(t._createTransceiver("audio"),n--),r>0&&(t._createTransceiver("video"),r--);var s=i.writeSessionBoilerplate(t._sdpSessionId,t._sdpSessionVersion++);t.transceivers.forEach((function(n,a){var r=n.track,o=n.kind,s=n.mid||i.generateIdentifier();n.mid=s,n.iceGatherer||(n.iceGatherer=t._createIceGatherer(a,t.usingBundle));var g=A.RTCRtpSender.getCapabilities(o);e<15019&&(g.codecs=g.codecs.filter((function(A){return"rtx"!==A.name}))),g.codecs.forEach((function(A){"H264"===A.name&&void 0===A.parameters["level-asymmetry-allowed"]&&(A.parameters["level-asymmetry-allowed"]="1"),n.remoteCapabilities&&n.remoteCapabilities.codecs&&n.remoteCapabilities.codecs.forEach((function(e){A.name.toLowerCase()===e.name.toLowerCase()&&A.clockRate===e.clockRate&&(A.preferredPayloadType=e.payloadType)}))})),g.headerExtensions.forEach((function(A){(n.remoteCapabilities&&n.remoteCapabilities.headerExtensions||[]).forEach((function(e){A.uri===e.uri&&(A.id=e.id)}))}));var c=n.sendEncodingParameters||[{ssrc:1001*(2*a+1)}];r&&e>=15019&&"video"===o&&!c[0].rtx&&(c[0].rtx={ssrc:c[0].ssrc+1}),n.wantReceive&&(n.rtpReceiver=new A.RTCRtpReceiver(n.dtlsTransport,o)),n.localCapabilities=g,n.sendEncodingParameters=c})),"max-compat"!==t._config.bundlePolicy&&(s+="a=group:BUNDLE "+t.transceivers.map((function(A){return A.mid})).join(" ")+"\r\n"),s+="a=ice-options:trickle\r\n",t.transceivers.forEach((function(A,e){s+=a(A,A.localCapabilities,"offer",A.stream,t._dtlsRole),s+="a=rtcp-rsize\r\n",!A.iceGatherer||"new"===t.iceGatheringState||0!==e&&t.usingBundle||(A.iceGatherer.getLocalCandidates().forEach((function(A){A.component=1,s+="a="+i.writeCandidate(A)+"\r\n"})),"completed"===A.iceGatherer.state&&(s+="a=end-of-candidates\r\n"))}));var g=new A.RTCSessionDescription({type:"offer",sdp:s});return Promise.resolve(g)},d.prototype.createAnswer=function(){var t=this;if(t._isClosed)return Promise.reject(c("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==t.signalingState&&"have-local-pranswer"!==t.signalingState)return Promise.reject(c("InvalidStateError","Can not call createAnswer in signalingState "+t.signalingState));var n=i.writeSessionBoilerplate(t._sdpSessionId,t._sdpSessionVersion++);t.usingBundle&&(n+="a=group:BUNDLE "+t.transceivers.map((function(A){return A.mid})).join(" ")+"\r\n"),n+="a=ice-options:trickle\r\n";var r=i.getMediaSections(t._remoteDescription.sdp).length;t.transceivers.forEach((function(A,i){if(!(i+1>r)){if(A.rejected)return"application"===A.kind?"DTLS/SCTP"===A.protocol?n+="m=application 0 DTLS/SCTP 5000\r\n":n+="m=application 0 "+A.protocol+" webrtc-datachannel\r\n":"audio"===A.kind?n+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===A.kind&&(n+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(n+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+A.mid+"\r\n");var s;A.stream&&("audio"===A.kind?s=A.stream.getAudioTracks()[0]:"video"===A.kind&&(s=A.stream.getVideoTracks()[0]),s&&e>=15019&&"video"===A.kind&&!A.sendEncodingParameters[0].rtx&&(A.sendEncodingParameters[0].rtx={ssrc:A.sendEncodingParameters[0].ssrc+1}));var g=o(A.localCapabilities,A.remoteCapabilities),c=g.codecs.filter((function(A){return"rtx"===A.name.toLowerCase()})).length;!c&&A.sendEncodingParameters[0].rtx&&delete A.sendEncodingParameters[0].rtx,n+=a(A,g,"answer",A.stream,t._dtlsRole),A.rtcpParameters&&A.rtcpParameters.reducedSize&&(n+="a=rtcp-rsize\r\n")}}));var s=new A.RTCSessionDescription({type:"answer",sdp:n});return Promise.resolve(s)},d.prototype.addIceCandidate=function(A){var e,t=this;return A&&void 0===A.sdpMLineIndex&&!A.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise((function(n,a){if(!t._remoteDescription)return a(c("InvalidStateError","Can not add ICE candidate without a remote description"));if(A&&""!==A.candidate){var r=A.sdpMLineIndex;if(A.sdpMid)for(var o=0;o0?i.parseCandidate(A.candidate):{};if("tcp"===l.protocol&&(0===l.port||9===l.port))return n();if(l.component&&1!==l.component)return n();if((0===r||r>0&&s.iceTransport!==t.transceivers[0].iceTransport)&&!g(s.iceTransport,l))return a(c("OperationError","Can not add ICE candidate"));var I=A.candidate.trim();0===I.indexOf("a=")&&(I=I.substr(2)),(e=i.getMediaSections(t._remoteDescription.sdp))[r]+="a="+(l.type?I:"end-of-candidates")+"\r\n",t._remoteDescription.sdp=i.getDescription(t._remoteDescription.sdp)+e.join("")}else for(var d=0;d0?e[0].split("/")[1]:"sendrecv",uri:e[1]}},i.writeExtmap=function(A){return"a=extmap:"+(A.id||A.preferredId)+(A.direction&&"sendrecv"!==A.direction?"/"+A.direction:"")+" "+A.uri+"\r\n"},i.parseFmtp=function(A){for(var e,t={},i=A.substr(A.indexOf(" ")+1).split(";"),n=0;n-1?(t.attribute=A.substr(e+1,i-e-1),t.value=A.substr(i+1)):t.attribute=A.substr(e+1),t},i.parseSsrcGroup=function(A){var e=A.substr(13).split(" ");return{semantics:e.shift(),ssrcs:e.map((function(A){return parseInt(A,10)}))}},i.getMid=function(A){var e=i.matchPrefix(A,"a=mid:")[0];if(e)return e.substr(6)},i.parseFingerprint=function(A){var e=A.substr(14).split(" ");return{algorithm:e[0].toLowerCase(),value:e[1]}},i.getDtlsParameters=function(A,e){return{role:"auto",fingerprints:i.matchPrefix(A+e,"a=fingerprint:").map(i.parseFingerprint)}},i.writeDtlsParameters=function(A,e){var t="a=setup:"+e+"\r\n";return A.fingerprints.forEach((function(A){t+="a=fingerprint:"+A.algorithm+" "+A.value+"\r\n"})),t},i.getIceParameters=function(A,e){var t=i.splitLines(A);return{usernameFragment:(t=t.concat(i.splitLines(e))).filter((function(A){return 0===A.indexOf("a=ice-ufrag:")}))[0].substr(12),password:t.filter((function(A){return 0===A.indexOf("a=ice-pwd:")}))[0].substr(10)}},i.writeIceParameters=function(A){return"a=ice-ufrag:"+A.usernameFragment+"\r\na=ice-pwd:"+A.password+"\r\n"},i.parseRtpParameters=function(A){for(var e={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},t=i.splitLines(A)[0].split(" "),n=3;n0?"9":"0",t+=" UDP/TLS/RTP/SAVPF ",t+=e.codecs.map((function(A){return void 0!==A.preferredPayloadType?A.preferredPayloadType:A.payloadType})).join(" ")+"\r\n",t+="c=IN IP4 0.0.0.0\r\n",t+="a=rtcp:9 IN IP4 0.0.0.0\r\n",e.codecs.forEach((function(A){t+=i.writeRtpMap(A),t+=i.writeFmtp(A),t+=i.writeRtcpFb(A)}));var n=0;return e.codecs.forEach((function(A){A.maxptime>n&&(n=A.maxptime)})),n>0&&(t+="a=maxptime:"+n+"\r\n"),t+="a=rtcp-mux\r\n",e.headerExtensions&&e.headerExtensions.forEach((function(A){t+=i.writeExtmap(A)})),t},i.parseRtpEncodingParameters=function(A){var e,t=[],n=i.parseRtpParameters(A),a=-1!==n.fecMechanisms.indexOf("RED"),r=-1!==n.fecMechanisms.indexOf("ULPFEC"),o=i.matchPrefix(A,"a=ssrc:").map((function(A){return i.parseSsrcMedia(A)})).filter((function(A){return"cname"===A.attribute})),s=o.length>0&&o[0].ssrc,g=i.matchPrefix(A,"a=ssrc-group:FID").map((function(A){return A.substr(17).split(" ").map((function(A){return parseInt(A,10)}))}));g.length>0&&g[0].length>1&&g[0][0]===s&&(e=g[0][1]),n.codecs.forEach((function(A){if("RTX"===A.name.toUpperCase()&&A.parameters.apt){var i={ssrc:s,codecPayloadType:parseInt(A.parameters.apt,10)};s&&e&&(i.rtx={ssrc:e}),t.push(i),a&&((i=JSON.parse(JSON.stringify(i))).fec={ssrc:s,mechanism:r?"red+ulpfec":"red"},t.push(i))}})),0===t.length&&s&&t.push({ssrc:s});var c=i.matchPrefix(A,"b=");return c.length&&(c=0===c[0].indexOf("b=TIAS:")?parseInt(c[0].substr(7),10):0===c[0].indexOf("b=AS:")?1e3*parseInt(c[0].substr(5),10)*.95-16e3:void 0,t.forEach((function(A){A.maxBitrate=c}))),t},i.parseRtcpParameters=function(A){var e={},t=i.matchPrefix(A,"a=ssrc:").map((function(A){return i.parseSsrcMedia(A)})).filter((function(A){return"cname"===A.attribute}))[0];t&&(e.cname=t.value,e.ssrc=t.ssrc);var n=i.matchPrefix(A,"a=rtcp-rsize");e.reducedSize=n.length>0,e.compound=0===n.length;var a=i.matchPrefix(A,"a=rtcp-mux");return e.mux=a.length>0,e},i.parseMsid=function(A){var e,t=i.matchPrefix(A,"a=msid:");if(1===t.length)return{stream:(e=t[0].substr(7).split(" "))[0],track:e[1]};var n=i.matchPrefix(A,"a=ssrc:").map((function(A){return i.parseSsrcMedia(A)})).filter((function(A){return"msid"===A.attribute}));return n.length>0?{stream:(e=n[0].value.split(" "))[0],track:e[1]}:void 0},i.parseSctpDescription=function(A){var e,t=i.parseMLine(A),n=i.matchPrefix(A,"a=max-message-size:");n.length>0&&(e=parseInt(n[0].substr(19),10)),isNaN(e)&&(e=65536);var a=i.matchPrefix(A,"a=sctp-port:");if(a.length>0)return{port:parseInt(a[0].substr(12),10),protocol:t.fmt,maxMessageSize:e};if(i.matchPrefix(A,"a=sctpmap:").length>0){var r=i.matchPrefix(A,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(r[0],10),protocol:r[1],maxMessageSize:e}}},i.writeSctpDescription=function(A,e){var t=[];return t="DTLS/SCTP"!==A.protocol?["m="+A.kind+" 9 "+A.protocol+" "+e.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+e.port+"\r\n"]:["m="+A.kind+" 9 "+A.protocol+" "+e.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+e.port+" "+e.protocol+" 65535\r\n"],void 0!==e.maxMessageSize&&t.push("a=max-message-size:"+e.maxMessageSize+"\r\n"),t.join("")},i.generateSessionId=function(){return Math.random().toString().substr(2,21)},i.writeSessionBoilerplate=function(A,e,t){var n=void 0!==e?e:2;return"v=0\r\no="+(t||"thisisadapterortc")+" "+(A||i.generateSessionId())+" "+n+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},i.writeMediaSection=function(A,e,t,n){var a=i.writeRtpDescription(A.kind,e);if(a+=i.writeIceParameters(A.iceGatherer.getLocalParameters()),a+=i.writeDtlsParameters(A.dtlsTransport.getLocalParameters(),"offer"===t?"actpass":"active"),a+="a=mid:"+A.mid+"\r\n",A.direction?a+="a="+A.direction+"\r\n":A.rtpSender&&A.rtpReceiver?a+="a=sendrecv\r\n":A.rtpSender?a+="a=sendonly\r\n":A.rtpReceiver?a+="a=recvonly\r\n":a+="a=inactive\r\n",A.rtpSender){var r="msid:"+n.id+" "+A.rtpSender.track.id+"\r\n";a+="a="+r,a+="a=ssrc:"+A.sendEncodingParameters[0].ssrc+" "+r,A.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+A.sendEncodingParameters[0].rtx.ssrc+" "+r,a+="a=ssrc-group:FID "+A.sendEncodingParameters[0].ssrc+" "+A.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return a+="a=ssrc:"+A.sendEncodingParameters[0].ssrc+" cname:"+i.localCName+"\r\n",A.rtpSender&&A.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+A.sendEncodingParameters[0].rtx.ssrc+" cname:"+i.localCName+"\r\n"),a},i.getDirection=function(A,e){for(var t=i.splitLines(A),n=0;n=26&&A<=e||IA.extension.isInstalled()}return!0};var lA={extensionId:"hapfgfdkleiggjjpfpenajgdnfckjpaj",isInstalled:function(){return null!==document.querySelector("#janus-extension-installed")},getScreen:function(A){var e=window.setTimeout((function(){var e=new Error("NavigatorUserMediaError");return e.name='The required Chrome extension is not installed: click here to install it. (NOTE: this will need you to refresh the page)',A(e)}),1e3);this.cache[e]=A,window.postMessage({type:"janusGetScreen",id:e},"*")},init:function(){var A={};this.cache=A,window.addEventListener("message",(function(e){if(e.origin==window.location.origin)if("janusGotScreen"==e.data.type&&A[e.data.id]){var t=A[e.data.id];if(delete A[e.data.id],""===e.data.sourceId){var i=new Error("NavigatorUserMediaError");i.name="You cancelled the request for permission, giving up...",t(i)}else t(null,e.data.sourceId)}else"janusGetScreenPending"==e.data.type&&(console.log("clearing ",e.data.id),window.clearTimeout(e.data.id))}))}};function IA(A){if(void 0===IA.initDone)return A.error("Library not initialized"),{};if(!IA.isWebrtcSupported())return A.error("WebRTC not supported by this browser"),{};if(IA.log("Library initialized: "+IA.initDone),(A=A||{}).success="function"==typeof A.success?A.success:IA.noop,A.error="function"==typeof A.error?A.error:IA.noop,A.destroyed="function"==typeof A.destroyed?A.destroyed:IA.noop,null===A.server||void 0===A.server)return A.error("Invalid server url"),{};var t=!1,i=null,n={},a=null,r=null,o=0,s=A.server;IA.isArray(s)?(IA.log("Multiple servers provided ("+s.length+"), will use the first that works"),s=null,r=A.server,IA.debug(r)):0===s.indexOf("ws")?(t=!0,IA.log("Using WebSockets to contact Janus: "+s)):(t=!1,IA.log("Using REST API to contact Janus: "+s));var g=A.iceServers;null==g&&(g=[{urls:"stun:stun.l.google.com:19302"}]);var l=A.iceTransportPolicy,I=A.bundlePolicy,C=A.ipv6;null==C&&(C=!1);var h=!1;void 0!==A.withCredentials&&null!==A.withCredentials&&(h=!0===A.withCredentials);var u=10;void 0!==A.max_poll_events&&null!==A.max_poll_events&&(u=A.max_poll_events),u<1&&(u=1);var B=null;void 0!==A.token&&null!==A.token&&(B=A.token);var E=null;void 0!==A.apisecret&&null!==A.apisecret&&(E=A.apisecret),this.destroyOnUnload=!0,void 0!==A.destroyOnUnload&&null!==A.destroyOnUnload&&(this.destroyOnUnload=!0===A.destroyOnUnload);var f=25e3;void 0!==A.keepAlivePeriod&&null!==A.keepAlivePeriod&&(f=A.keepAlivePeriod),isNaN(f)&&(f=25e3);var Q=6e4;function x(A){var e={high:9e5,medium:3e5,low:1e5};return null!=A&&(A.high&&(e.high=A.high),A.medium&&(e.medium=A.medium),A.low&&(e.low=A.low)),e}void 0!==A.longPollTimeout&&null!==A.longPollTimeout&&(Q=A.longPollTimeout),isNaN(Q)&&(Q=6e4);var p=!1,m=null,y={},_=this,S=0,D={};function v(){if(null!=m)if(IA.debug("Long poll..."),p){var e=s+"/"+m+"?rid="+(new Date).getTime();null!=u&&(e=e+"&maxev="+u),null!=B&&(e=e+"&token="+encodeURIComponent(B)),null!=E&&(e=e+"&apisecret="+encodeURIComponent(E)),IA.httpAPICall(e,{verb:"GET",withCredentials:h,success:w,timeout:Q,error:function(e,t){if(IA.error(e+":",t),++S>3)return p=!1,void A.error("Lost connection to the server (is it down?)");v()}})}else IA.warn("Is the server down? (connected=false)")}function w(A,e){if(S=0,t||null==m||!0===e||v(),t||!IA.isArray(A))if("keepalive"!==A.rtcgw)if("ack"!==A.rtcgw)if("success"!==A.rtcgw)if("trickle"===A.rtcgw){if(null==(s=A.sender))return void IA.warn("Missing sender...");if(null==(c=y[s]))return void IA.debug("This handle is not attached to this session");var n=A.candidate;IA.debug("Got a trickled candidate on session "+m),IA.debug(n);var a=c.webrtcStuff;a.pc&&a.remoteSdp?(IA.debug("Adding remote candidate:",n),n&&!0!==n.completed?a.pc.addIceCandidate(n):a.pc.addIceCandidate(IA.endOfCandidates)):(IA.debug("We didn't do setRemoteDescription (trickle got here before the offer?), caching candidate"),a.candidates||(a.candidates=[]),a.candidates.push(n),IA.debug(a.candidates))}else{if("webrtcup"===A.rtcgw)return IA.debug("Got a webrtcup event on session "+m),IA.debug(A),null==(s=A.sender)?void IA.warn("Missing sender..."):null==(c=y[s])?void IA.debug("This handle is not attached to this session"):void c.webrtcState(!0);if("hangup"===A.rtcgw){if(IA.debug("Got a hangup event on session "+m),IA.debug(A),null==(s=A.sender))return void IA.warn("Missing sender...");if(null==(c=y[s]))return void IA.debug("This handle is not attached to this session");c.webrtcState(!1,A.reason),c.hangup()}else if("detached"===A.rtcgw){if(IA.debug("Got a detached event on session "+m),IA.debug(A),null==(s=A.sender))return void IA.warn("Missing sender...");if(null==(c=y[s]))return;c.detached=!0,c.ondetached(),c.detach()}else if("media"===A.rtcgw){if(IA.debug("Got a media event on session "+m),IA.debug(A),null==(s=A.sender))return void IA.warn("Missing sender...");if(null==(c=y[s]))return void IA.debug("This handle is not attached to this session");c.mediaState(A.type,A.receiving)}else if("slowlink"===A.rtcgw){if(IA.debug("Got a slowlink event on session "+m),IA.debug(A),null==(s=A.sender))return void IA.warn("Missing sender...");if(null==(c=y[s]))return void IA.debug("This handle is not attached to this session");c.slowLink(A.uplink,A.lost)}else{if("error"===A.rtcgw){var r,o;if(IA.error("Ooops: "+A.error.code+" "+A.error.reason),IA.debug(A),null!=(r=A.transaction))null!=(o=D[r])&&o(A),delete D[r];return}if("event"===A.rtcgw){var s;if(IA.debug("Got a plugin event on session "+m),IA.debug(A),null==(s=A.sender))return void IA.warn("Missing sender...");var g=A.plugindata;if(null==g)return void IA.warn("Missing plugindata...");IA.debug(" -- Event is coming from "+s+" ("+g.plugin+")");var c,l=g.data;if(IA.debug(l),null==(c=y[s]))return void IA.warn("This handle is not attached to this session");var I=A.jsep;null!=I&&(IA.debug("Handling SDP as well..."),IA.debug(I));var d=c.onmessage;null!=d?(IA.debug("Notifying application..."),d(l,I)):IA.debug("No provided notification callback")}else{if("timeout"===A.rtcgw)return IA.error("Timeout on session "+m),IA.debug(A),void(t&&i.close(3504,"Gateway timeout"));IA.warn("Unknown message/event '"+A.rtcgw+"' on session "+m),IA.debug(A)}}}else IA.debug("Got a success on session "+m),IA.debug(A),null!=(r=A.transaction)&&(null!=(o=D[r])&&o(A),delete D[r]);else IA.debug("Got an ack on session "+m),IA.debug(A),null!=(r=A.transaction)&&(null!=(o=D[r])&&o(A),delete D[r]);else IA.vdebug("Got a keepalive on session "+m);else for(var C=0;C data channel: "+t),"open"===t){if(a.dataChannel[e].pending&&a.dataChannel[e].pending.length>0){for(var i in IA.log("Sending pending messages on <"+e+">:",a.dataChannel[e].pending.length),a.dataChannel[e].pending){var r=a.dataChannel[e].pending[i];IA.log("Sending string on data channel <"+e+">: "+r),a.dataChannel[e].send(r)}a.dataChannel[e].pending=[]}n.ondataopen(e)}};a.dataChannel[e]=t||a.pc.createDataChannel(e,{ordered:!1}),a.dataChannel[e].onmessage=function(A){IA.log("Received message on data channel:",A);var e=A.target.label;n.ondata(A.data,e)},a.dataChannel[e].onopen=r,a.dataChannel[e].onclose=r,a.dataChannel[e].onerror=function(A){IA.error("Got error on data channel:",A)},a.dataChannel[e].pending=[],i&&a.dataChannel[e].pending.push(i)}else IA.warn("Invalid handle")}function N(A,e){(e=e||{}).success="function"==typeof e.success?e.success:IA.noop,e.error="function"==typeof e.error?e.error:IA.noop;var t=y[A];if(null==t||null===t.webrtcStuff||void 0===t.webrtcStuff)return IA.warn("Invalid handle"),void e.error("Invalid handle");var i=t.webrtcStuff,n=e.text;if(null==n)return IA.warn("Invalid text"),void e.error("Invalid text");var a=e.label?e.label:IA.dataChanDefaultLabel;return i.dataChannel[a]?"open"!==i.dataChannel[a].readyState?(i.dataChannel[a].pending.push(n),void e.success()):(IA.log("Sending string on data channel <"+a+">: "+n),i.dataChannel[a].send(n),void e.success()):(P(A,a,!1,n),void e.success())}function T(A,e){(e=e||{}).success="function"==typeof e.success?e.success:IA.noop,e.error="function"==typeof e.error?e.error:IA.noop;var t=y[A];if(null==t||null===t.webrtcStuff||void 0===t.webrtcStuff)return IA.warn("Invalid handle"),void e.error("Invalid handle");var i=t.webrtcStuff;if(null===i.dtmfSender||void 0===i.dtmfSender){if(void 0!==i.pc&&null!==i.pc){var n=i.pc.getSenders().find((function(A){return A.track&&"audio"===A.track.kind}));if(!n)return IA.warn("Invalid DTMF configuration (no audio track)"),void e.error("Invalid DTMF configuration (no audio track)");i.dtmfSender=n.dtmf,i.dtmfSender&&(IA.log("Created DTMF Sender"),i.dtmfSender.ontonechange=function(A){IA.debug("Sent DTMF tone: "+A.tone)})}if(null===i.dtmfSender||void 0===i.dtmfSender)return IA.warn("Invalid DTMF configuration"),void e.error("Invalid DTMF configuration")}var a=e.dtmf;if(null==a)return IA.warn("Invalid DTMF parameters"),void e.error("Invalid DTMF parameters");var r=a.tones;if(null==r)return IA.warn("Invalid DTMF string"),void e.error("Invalid DTMF string");var o=a.duration;null==o&&(o=500);var s=a.gap;null==s&&(s=50),IA.debug("Sending DTMF string "+r+" (duration "+o+"ms, gap "+s+"ms)"),i.dtmfSender.insertDTMF(r,o,s),e.success()}function M(A,e){(e=e||{}).success="function"==typeof e.success?e.success:IA.noop,e.error="function"==typeof e.error?e.error:IA.noop;var n=!0;void 0!==e.asyncRequest&&null!==e.asyncRequest&&(n=!0===e.asyncRequest);var a=!0;void 0!==e.noRequest&&null!==e.noRequest&&(a=!0===e.noRequest),IA.log("Destroying handle "+A+" (async="+n+")"),X(A);var r=y[A];if(null==r||r.detached)return delete y[A],void e.success();if(a)return delete y[A],void e.success();if(!p)return IA.warn("Is the server down? (connected=false)"),void e.error("Is the server down? (connected=false)");var o={rtcgw:"detach",transaction:IA.randomString(12)};if(null!==r.token&&void 0!==r.token&&(o.token=r.token),null!=E&&(o.apisecret=E),t)return o.session_id=m,o.handle_id=A,i.send(JSON.stringify(o)),delete y[A],void e.success();IA.httpAPICall(s+"/"+m+"/"+A,{verb:"POST",async:n,withCredentials:h,body:o,success:function(t){IA.log("Destroyed handle:"),IA.debug(t),"success"!==t.rtcgw&&IA.error("Ooops: "+t.error.code+" "+t.error.reason),delete y[A],e.success()},error:function(t,i){IA.error(t+":",i),delete y[A],e.success()}})}function L(A,e,t,i,n){return Y.apply(this,arguments)}function Y(){return Y=function(A){return function(){var t=this,i=arguments;return new Promise((function(n,a){var r=A.apply(t,i);function o(A){e(r,n,a,o,s,"next",A)}function s(A){e(r,n,a,o,s,"throw",A)}o(void 0)}))}}(c().mark((function A(e,t,i,n,a){var r,o,s,h,u,B,E,f,Q,p,m,_,S,D,v,w,b,F,R,N,T,M,L,Y;return c().wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(null!=(r=y[e])&&null!==r.webrtcStuff&&void 0!==r.webrtcStuff){A.next=5;break}return IA.warn("Invalid handle"),n.error("Invalid handle"),A.abrupt("return");case 5:if(o=r.webrtcStuff,IA.debug("streamsDone:",a),a&&(IA.debug(" -- Audio tracks:",a.getAudioTracks()),IA.debug(" -- Video tracks:",a.getVideoTracks())),s=!1,o.myStream&&i.update&&!o.streamExternal){A.next=14;break}o.myStream=a,s=!0,A.next=66;break;case 14:if(!((!i.update&&q(i)||i.update&&(i.addAudio||i.replaceAudio))&&a.getAudioTracks()&&a.getAudioTracks().length)){A.next=45;break}if(o.myStream.addTrack(a.getAudioTracks()[0]),!IA.unifiedPlan){A.next=43;break}if(IA.log((i.replaceAudio?"Replacing":"Adding")+" audio track:",a.getAudioTracks()[0]),h=null,!((u=o.pc.getTransceivers())&&u.length>0)){A.next=30;break}A.t0=c().keys(u);case 22:if((A.t1=A.t0()).done){A.next=30;break}if(B=A.t1.value,!((E=u[B]).sender&&E.sender.track&&"audio"===E.sender.track.kind||E.receiver&&E.receiver.track&&"audio"===E.receiver.track.kind)){A.next=28;break}return h=E,A.abrupt("break",30);case 28:A.next=22;break;case 30:return f=null,A.prev=31,A.next=34,n.customizeStream(a);case 34:f=A.sent,A.next=40;break;case 37:A.prev=37,A.t2=A.catch(31),n.error(A.t2);case 40:h&&h.sender?h.sender.replaceTrack((null===(Q=f)||void 0===Q||null===(p=Q.getAudioTracks)||void 0===p||null===(p=p.call(Q))||void 0===p?void 0:p[0])||a.getAudioTracks()[0]):o.pc.addTrack((null===(m=f)||void 0===m||null===(_=m.getAudioTracks)||void 0===_||null===(_=_.call(m))||void 0===_?void 0:_[0])||a.getAudioTracks()[0],f||a),A.next=45;break;case 43:IA.log((i.replaceAudio?"Replacing":"Adding")+" audio track:",a.getAudioTracks()[0]),o.pc.addTrack(a.getAudioTracks()[0],a);case 45:if(!((!i.update&&$(i)||i.update&&(i.addVideo||i.replaceVideo))&&a.getVideoTracks()&&a.getVideoTracks().length)){A.next=66;break}if(o.myStream.addTrack(a.getVideoTracks()[0]),!IA.unifiedPlan){A.next=64;break}if(IA.log((i.replaceVideo?"Replacing":"Adding")+" video track:",a.getVideoTracks()[0]),S=null,!((u=o.pc.getTransceivers())&&u.length>0)){A.next=61;break}A.t3=c().keys(u);case 53:if((A.t4=A.t3()).done){A.next=61;break}if(B=A.t4.value,!((E=u[B]).sender&&E.sender.track&&"video"===E.sender.track.kind||E.receiver&&E.receiver.track&&"video"===E.receiver.track.kind)){A.next=59;break}return S=E,A.abrupt("break",61);case 59:A.next=53;break;case 61:S&&S.sender?S.sender.replaceTrack(a.getVideoTracks()[0]):o.pc.addTrack(a.getVideoTracks()[0],a),A.next=66;break;case 64:IA.log((i.replaceVideo?"Replacing":"Adding")+" video track:",a.getVideoTracks()[0]),o.pc.addTrack(a.getVideoTracks()[0],a);case 66:if(!o.pc){if(D={iceServers:g,iceTransportPolicy:l,bundlePolicy:I},"chrome"===IA.webRTCAdapter.browserDetails.browser&&(D.sdpSemantics=IA.webRTCAdapter.browserDetails.version<72?"plan-b":"unified-plan"),v={optional:[{DtlsSrtpKeyAgreement:!0}]},!0===C&&v.optional.push({googIPv6:!0}),n.rtcConstraints&&"object"===d(n.rtcConstraints))for(B in IA.debug("Adding custom PeerConnection constraints:",n.rtcConstraints),n.rtcConstraints)v.optional.push(n.rtcConstraints[B]);"edge"===IA.webRTCAdapter.browserDetails.browser&&(D.bundlePolicy="max-bundle"),IA.log("Creating PeerConnection"),IA.debug(v),o.pc=new RTCPeerConnection(D,v),IA.debug(o.pc),o.pc.getStats&&(o.volume={},o.bitrate.value="0 kbits/sec"),IA.log("Preparing local SDP and gathering candidates (trickle="+o.trickle+")"),o.pc.oniceconnectionstatechange=function(A){o.pc&&r.iceState(o.pc.iceConnectionState)},o.pc.onicecandidate=function(A){if(null==A.candidate||"edge"===IA.webRTCAdapter.browserDetails.browser&&A.candidate.candidate.indexOf("endOfCandidates")>0)IA.log("End of candidates."),o.iceDone=!0,!0===o.trickle?k(e,{completed:!0}):K(e,n);else{var t={candidate:A.candidate.candidate,sdpMid:A.candidate.sdpMid,sdpMLineIndex:A.candidate.sdpMLineIndex};!0===o.trickle&&k(e,t)}},o.pc.ontrack=function(A){IA.log("Handling Remote Track"),IA.debug(A),A.streams&&(o.remoteStream=A.streams[0],r.onremotestream(o.remoteStream),A.track.onended||(IA.log("Adding onended callback to track:",A.track),A.track.onended=function(A){IA.log("Remote track muted/removed:",A),o.remoteStream&&(o.remoteStream.removeTrack(A.target),r.onremotestream(o.remoteStream))},A.track.onmute=A.track.onended,A.track.onunmute=function(A){IA.log("Remote track flowing again:",A);try{o.remoteStream.addTrack(A.target),r.onremotestream(o.remoteStream)}catch(A){IA.error(A)}}))}}if(!s||null==a){A.next=97;break}IA.log("Adding local stream"),w=!0===n.simulcast2,b=a.getTracks(),F=0;case 72:if(!(F0){for(var A=0;A=26&&D<=v?(B={video:{mandatory:{googLeakyBucket:!0,maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:n.screenshareFrameRate,maxFrameRate:n.screenshareFrameRate,chromeMediaSource:"screen"}},audio:q(n)&&!n.keepAudio},S(B,_)):IA.extension.getScreen((function(A,e){if(A)return a.consentDialog(!1),t.error(A);(B={audio:!1,video:{mandatory:{chromeMediaSource:"desktop",maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:n.screenshareFrameRate,maxFrameRate:n.screenshareFrameRate},optional:[{googLeakyBucket:!0},{googTemporalLayeredScreencast:!0}]}}).video.mandatory.chromeMediaSourceId=e,S(B,_,q(n)&&!n.keepAudio)}))}else if("firefox"===IA.webRTCAdapter.browserDetails.browser){if(!(IA.webRTCAdapter.browserDetails.version>=33)){var w=new Error("NavigatorUserMediaError");return w.name="Your version of Firefox does not support screen sharing, please install Firefox 33 (or more recent versions)",a.consentDialog(!1),void t.error(w)}B={video:{mozMediaSource:n.video,mediaSource:n.video},audio:q(n)&&!n.keepAudio},S(B,(function(A,e){if(_(A,e),!A)var t=e.currentTime,i=window.setInterval((function(){e||window.clearInterval(i),e.currentTime==t&&(window.clearInterval(i),e.onended&&e.onended()),t=e.currentTime}),500)}))}return}}null!=n&&"screen"===n.video||navigator.mediaDevices.enumerateDevices().then((function(e){var r=e.some((function(A){return"audioinput"===A.kind})),o=function(A){if(IA.debug("isScreenSendEnabled:",A),null==A)return!1;if("object"!==d(A.video)||"object"!==d(A.video.mandatory))return!1;var e=A.video.mandatory;if(e.chromeMediaSource)return"desktop"===e.chromeMediaSource||"screen"===e.chromeMediaSource;if(e.mozMediaSource)return"window"===e.mozMediaSource||"screen"===e.mozMediaSource;if(e.mediaSource)return"window"===e.mediaSource||"screen"===e.mediaSource;return!1}(n)||e.some((function(A){return"videoinput"===A.kind})),s=q(n),g=$(n),c=function(A){return IA.debug("isAudioSendRequired:",A),null!=A&&(!1!==A.audio&&!1!==A.audioSend&&(void 0!==A.failIfNoAudio&&null!==A.failIfNoAudio&&!0===A.failIfNoAudio))}(n),l=function(A){return IA.debug("isVideoSendRequired:",A),null!=A&&(!1!==A.video&&!1!==A.videoSend&&(void 0!==A.failIfNoVideo&&null!==A.failIfNoVideo&&!0===A.failIfNoVideo))}(n);if(s||g||c||l){var C=!!s&&r,h=!!g&&o;if(!C&&!h)return a.consentDialog(!1),t.error("No capture device found"),!1;if(!C&&c)return a.consentDialog(!1),t.error("Audio capture is required, but no capture device found"),!1;if(!h&&l)return a.consentDialog(!1),t.error("Video capture is required, but no capture device found"),!1}var u={audio:!(!r||n.keepAudio)&&E,video:!(!o||n.keepVideo)&&f};IA.debug("getUserMedia constraints",u),u.audio||u.video?navigator.mediaDevices.getUserMedia(u).then((function(e){a.consentDialog(!1),L(A,i,n,t,e)})).catch((function(A){a.consentDialog(!1),t.error({code:A.code,name:A.name,message:A.message})})):(a.consentDialog(!1),L(A,i,n,t,I))})).catch((function(A){a.consentDialog(!1),t.error("enumerateDevices error",A)}))}else L(A,i,n,t)}function U(A,e){(e=e||{}).success="function"==typeof e.success?e.success:IA.noop,e.error="function"==typeof e.error?e.error:Z;var t=e.jsep,i=y[A];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return IA.warn("Invalid handle"),void e.error("Invalid handle");var n=i.webrtcStuff;if(null!=t){if(null===n.pc)return IA.warn("Wait, no PeerConnection?? if this is an answer, use createAnswer and not handleRemoteJsep"),void e.error("No PeerConnection: if this is an answer, use createAnswer and not handleRemoteJsep");n.pc.setRemoteDescription(t).then((function(){if(IA.log("Remote description accepted!"),n.remoteSdp=t.sdp,n.candidates&&n.candidates.length>0){for(var A=0;A0)for(var c in g){var l=g[c];l.sender&&l.sender.track&&"audio"===l.sender.track.kind||l.receiver&&l.receiver.track&&"audio"===l.receiver.track.kind?o||(o=l):(l.sender&&l.sender.track&&"video"===l.sender.track.kind||l.receiver&&l.receiver.track&&"video"===l.receiver.track.kind)&&(s||(s=l))}var I=q(e),d=z(e);I||d?I&&d?o&&(o.setDirection?o.setDirection("sendrecv"):o.direction="sendrecv",IA.log("Setting audio transceiver to sendrecv:",o)):I&&!d?o&&(o.setDirection?o.setDirection("sendonly"):o.direction="sendonly",IA.log("Setting audio transceiver to sendonly:",o)):!I&&d&&(o?(o.setDirection?o.setDirection("recvonly"):o.direction="recvonly",IA.log("Setting audio transceiver to recvonly:",o)):(o=n.pc.addTransceiver("audio",{direction:"recvonly"}),IA.log("Adding recvonly audio transceiver:",o))):e.removeAudio&&o&&(o.setDirection?o.setDirection("inactive"):o.direction="inactive",IA.log("Setting audio transceiver to inactive:",o));var C=$(e),h=AA(e);C||h?C&&h?s&&(s.setDirection?s.setDirection("sendrecv"):s.direction="sendrecv",IA.log("Setting video transceiver to sendrecv:",s)):C&&!h?s&&(s.setDirection?s.setDirection("sendonly"):s.direction="sendonly",IA.log("Setting video transceiver to sendonly:",s)):!C&&h&&(s?(s.setDirection?s.setDirection("recvonly"):s.direction="recvonly",IA.log("Setting video transceiver to recvonly:",s)):(s=n.pc.addTransceiver("video",{direction:"recvonly"}),IA.log("Adding recvonly video transceiver:",s))):e.removeVideo&&s&&(s.setDirection?s.setDirection("inactive"):s.direction="inactive",IA.log("Setting video transceiver to inactive:",s))}else r.offerToReceiveAudio=z(e),r.offerToReceiveVideo=AA(e);!0===t.iceRestart&&(r.iceRestart=!0),IA.debug(r);var u=$(e);if(u&&a&&"firefox"===IA.webRTCAdapter.browserDetails.browser){IA.log("Enabling Simulcasting for Firefox (RID)");var B=n.pc.getSenders().find((function(A){return"video"==A.track.kind}));if(B){var E=B.getParameters();E||(E={});var f=x(t.simulcastMaxBitrates);E.encodings=[{rid:"h",active:!0,maxBitrate:f.high},{rid:"m",active:!0,maxBitrate:f.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:f.low,scaleResolutionDownBy:4}],B.setParameters(E)}}n.pc.createOffer(r).then((function(A){IA.debug(A);var e={type:A.type,sdp:A.sdp};t.customizeSdp(e),A.sdp=e.sdp,IA.log("Setting local description"),u&&a&&("chrome"===IA.webRTCAdapter.browserDetails.browser||"safari"===IA.webRTCAdapter.browserDetails.browser?(IA.log("Enabling Simulcasting for Chrome (SDP munging)"),A.sdp=function(A){for(var e=A.split("\r\n"),t=!1,i=[-1],n=[-1],a=null,r=null,o=null,s=null,g=-1,c=0;c-1){g=c;break}}else if(t){var l=e[c].match(/a=ssrc-group:FID (\d+) (\d+)/);if(l)i[0]=l[1],n[0]=l[2],e.splice(c,1),c--;else{if(i[0]){if((C=e[c].match("a=ssrc:"+i[0]+" cname:(.+)"))&&(a=C[1]),(C=e[c].match("a=ssrc:"+i[0]+" msid:(.+)"))&&(r=C[1]),(C=e[c].match("a=ssrc:"+i[0]+" mslabel:(.+)"))&&(o=C[1]),(C=e[c].match("a=ssrc:"+i[0]+" label:(.+)"))&&(s=C[1]),0===e[c].indexOf("a=ssrc:"+n[0])){e.splice(c,1),c--;continue}if(0===e[c].indexOf("a=ssrc:"+i[0])){e.splice(c,1),c--;continue}}0!=e[c].length||(e.splice(c,1),c--)}}}if(i[0]<0){g=-1,t=!1;for(c=0;c-1){g=c;break}}else if(t){if(i[0]<0){var d=e[c].match(/a=ssrc:(\d+)/);if(d){i[0]=d[1],e.splice(c,1),c--;continue}}else{var C;if((C=e[c].match("a=ssrc:"+i[0]+" cname:(.+)"))&&(a=C[1]),(C=e[c].match("a=ssrc:"+i[0]+" msid:(.+)"))&&(r=C[1]),(C=e[c].match("a=ssrc:"+i[0]+" mslabel:(.+)"))&&(o=C[1]),(C=e[c].match("a=ssrc:"+i[0]+" label:(.+)"))&&(s=C[1]),0===e[c].indexOf("a=ssrc:"+n[0])){e.splice(c,1),c--;continue}if(0===e[c].indexOf("a=ssrc:"+i[0])){e.splice(c,1),c--;continue}}0!=e[c].length||(e.splice(c,1),c--)}}}if(i[0]<0)return IA.warn("Couldn't find the video SSRC, simulcasting NOT enabled"),A;g<0&&(g=e.length);i[1]=Math.floor(4294967295*Math.random()),i[2]=Math.floor(4294967295*Math.random()),n[1]=Math.floor(4294967295*Math.random()),n[2]=Math.floor(4294967295*Math.random());for(c=0;c0)for(var c in g){var l=g[c];l.sender&&l.sender.track&&"audio"===l.sender.track.kind||l.receiver&&l.receiver.track&&"audio"===l.receiver.track.kind?o||(o=l):(l.sender&&l.sender.track&&"video"===l.sender.track.kind||l.receiver&&l.receiver.track&&"video"===l.receiver.track.kind)&&(s||(s=l))}var I=q(e),d=z(e);if(I||d){if(I&&d){if(o)try{o.setDirection?o.setDirection("sendrecv"):o.direction="sendrecv",IA.log("Setting audio transceiver to sendrecv:",o)}catch(A){IA.error(A)}}else if(I&&!d)try{o&&(o.setDirection?o.setDirection("sendonly"):o.direction="sendonly",IA.log("Setting audio transceiver to sendonly:",o))}catch(A){IA.error(A)}else if(!I&&d)if(o)try{o.setDirection?o.setDirection("recvonly"):o.direction="recvonly",IA.log("Setting audio transceiver to recvonly:",o)}catch(A){IA.error(A)}else o=n.pc.addTransceiver("audio",{direction:"recvonly"}),IA.log("Adding recvonly audio transceiver:",o)}else if(e.removeAudio&&o)try{o.setDirection?o.setDirection("inactive"):o.direction="inactive",IA.log("Setting audio transceiver to inactive:",o)}catch(A){IA.error(A)}var C=$(e),h=AA(e);if(C||h){if(C&&h){if(s)try{s.setDirection?s.setDirection("sendrecv"):s.direction="sendrecv",IA.log("Setting video transceiver to sendrecv:",s)}catch(A){IA.error(A)}}else if(C&&!h){if(s)try{s.setDirection?s.setDirection("sendonly"):s.direction="sendonly",IA.log("Setting video transceiver to sendonly:",s)}catch(A){IA.error(A)}}else if(!C&&h)if(s)try{s.setDirection?s.setDirection("recvonly"):s.direction="recvonly",IA.log("Setting video transceiver to recvonly:",s)}catch(A){IA.error(A)}else s=n.pc.addTransceiver("video",{direction:"recvonly"}),IA.log("Adding recvonly video transceiver:",s)}else if(e.removeVideo&&s)try{s.setDirection?s.setDirection("inactive"):s.direction="inactive",IA.log("Setting video transceiver to inactive:",s)}catch(A){IA.error(A)}}else r="firefox"==IA.webRTCAdapter.browserDetails.browser||"edge"==IA.webRTCAdapter.browserDetails.browser?{offerToReceiveAudio:z(e),offerToReceiveVideo:AA(e)}:{mandatory:{OfferToReceiveAudio:z(e),OfferToReceiveVideo:AA(e)}};IA.debug(r);var u=$(e);if(u&&a&&"firefox"===IA.webRTCAdapter.browserDetails.browser){IA.log("Enabling Simulcasting for Firefox (RID)");var B=n.pc.getSenders()[1];IA.log(B);var E=B.getParameters();IA.log(E);var f=x(t.simulcastMaxBitrates);B.setParameters({encodings:[{rid:"high",active:!0,priority:"high",maxBitrate:f.high},{rid:"medium",active:!0,priority:"medium",maxBitrate:f.medium},{rid:"low",active:!0,priority:"low",maxBitrate:f.low}]})}n.pc.createAnswer(r).then((function(A){IA.debug(A);var e={type:A.type,sdp:A.sdp};t.customizeSdp(e),A.sdp=e.sdp,IA.log("Setting local description"),u&&a&&("chrome"===IA.webRTCAdapter.browserDetails.browser?IA.warn("simulcast=true, but this is an answer, and video breaks in Chrome if we enable it"):"firefox"!==IA.webRTCAdapter.browserDetails.browser&&IA.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring")),n.mySdp=A.sdp,n.pc.setLocalDescription(A).catch(t.error),n.mediaConstraints=r,n.iceDone||n.trickle?t.success(A):IA.log("Waiting for all candidates...")}),t.error)}function K(A,e){(e=e||{}).success="function"==typeof e.success?e.success:IA.noop,e.error="function"==typeof e.error?e.error:IA.noop;var t=y[A];if(null!=t&&null!==t.webrtcStuff&&void 0!==t.webrtcStuff){var i=t.webrtcStuff;IA.log("Sending offer/answer SDP..."),null!==i.mySdp&&void 0!==i.mySdp?(i.mySdp={type:i.pc.localDescription.type,sdp:i.pc.localDescription.sdp},!1===i.trickle&&(i.mySdp.trickle=!1),IA.debug(e),i.sdpSent=!0,e.success(i.mySdp)):IA.warn("Local SDP instance is invalid, not sending anything...")}else IA.warn("Invalid handle, not sending anything")}function V(A,e){var t=y[A];if(null==t||null===t.webrtcStuff||void 0===t.webrtcStuff)return IA.warn("Invalid handle"),0;var i=e?"remote":"local",n=t.webrtcStuff;return n.volume[i]||(n.volume[i]={value:0}),n.pc.getStats&&"chrome"===IA.webRTCAdapter.browserDetails.browser?!e||null!==n.remoteStream&&void 0!==n.remoteStream?e||null!==n.myStream&&void 0!==n.myStream?null===n.volume[i].timer||void 0===n.volume[i].timer?(IA.log("Starting "+i+" volume monitor"),n.volume[i].timer=setInterval((function(){n.pc.getStats((function(A){for(var t=A.result(),a=0;a-1)&&"inbound-rtp"===A.type&&A.id.indexOf("rtcp")<0?e=!0:"ssrc"!=A.type||!A.bytesReceived||"VP8"!==A.googCodecName&&""!==A.googCodecName||(e=!0),e)if(t.bitrate.bsnow=A.bytesReceived,t.bitrate.tsnow=A.timestamp,null===t.bitrate.bsbefore||null===t.bitrate.tsbefore)t.bitrate.bsbefore=t.bitrate.bsnow,t.bitrate.tsbefore=t.bitrate.tsnow;else{var i=t.bitrate.tsnow-t.bitrate.tsbefore;"safari"==IA.webRTCAdapter.browserDetails.browser&&(i/=1e3);var n=Math.round(8*(t.bitrate.bsnow-t.bitrate.bsbefore)/i);"safari"===IA.webRTCAdapter.browserDetails.browser&&(n=parseInt(n/1e3)),t.bitrate.value=n+" kbits/sec",t.bitrate.bsbefore=t.bitrate.bsnow,t.bitrate.tsbefore=t.bitrate.tsnow}}}))}))}),1e3),"0 kbits/sec"):t.bitrate.value:(IA.warn("Getting the video bitrate unsupported by browser"),"Feature unsupported by browser")}function Z(A){IA.error("WebRTC error:",A)}function X(A,e){IA.log("Cleaning WebRTC stuff");var n=y[A];if(null!=n){var a=n.webrtcStuff;if(null!=a){if(!0===e){var r={rtcgw:"hangup",transaction:IA.randomString(12)};null!==n.token&&void 0!==n.token&&(r.token=n.token),null!=E&&(r.apisecret=E),IA.debug("Sending hangup request (handle="+A+"):"),IA.debug(r),t?(r.session_id=m,r.handle_id=A,i.send(JSON.stringify(r))):IA.httpAPICall(s+"/"+m+"/"+A,{verb:"POST",withCredentials:h,body:r})}a.remoteStream=null,a.volume&&(a.volume.local&&a.volume.local.timer&&clearInterval(a.volume.local.timer),a.volume.remote&&a.volume.remote.timer&&clearInterval(a.volume.remote.timer)),a.volume={},a.bitrate.timer&&clearInterval(a.bitrate.timer),a.bitrate.timer=null,a.bitrate.bsnow=null,a.bitrate.bsbefore=null,a.bitrate.tsnow=null,a.bitrate.tsbefore=null,a.bitrate.value=null;try{if(!a.streamExternal&&null!==a.myStream&&void 0!==a.myStream){IA.log("Stopping local stream tracks");var o=a.myStream.getTracks();for(var g in o){var c=o[g];IA.log(c),null!=c&&c.stop()}}}catch(A){}a.streamExternal=!1,a.myStream=null;try{a.pc.close()}catch(A){}a.pc=null,a.candidates=null,a.mySdp=null,a.remoteSdp=null,a.iceDone=!1,a.dataChannel={},a.dtmfSender=null}n.oncleanup()}}function q(A){return IA.debug("isAudioSendEnabled:",A),null==A||!1!==A.audio&&(void 0===A.audioSend||null===A.audioSend||!0===A.audioSend)}function z(A){return IA.debug("isAudioRecvEnabled:",A),null==A||!1!==A.audio&&(void 0===A.audioRecv||null===A.audioRecv||!0===A.audioRecv)}function $(A){return IA.debug("isVideoSendEnabled:",A),null==A||!1!==A.video&&(void 0===A.videoSend||null===A.videoSend||!0===A.videoSend)}function AA(A){return IA.debug("isVideoRecvEnabled:",A),null==A||!1!==A.video&&(void 0===A.videoRecv||null===A.videoRecv||!0===A.videoRecv)}function eA(A){return IA.debug("isDataEnabled:",A),"edge"==IA.webRTCAdapter.browserDetails.browser?(IA.warn("Edge doesn't support data channels yet"),!1):null!=A&&!0===A.data}F(A),this.getServer=function(){return s},this.isConnected=function(){return p},this.reconnect=function(A){(A=A||{}).success="function"==typeof A.success?A.success:IA.noop,A.error="function"==typeof A.error?A.error:IA.noop,A.reconnect=!0,F(A)},this.getSessionId=function(){return m},this.destroy=function(e){!function(e){e=e||{},e.success="function"==typeof e.success?e.success:IA.noop;var r=!0;void 0!==e.asyncRequest&&null!==e.asyncRequest&&(r=!0===e.asyncRequest);var o=!0;void 0!==e.notifyDestroyed&&null!==e.notifyDestroyed&&(o=!0===e.notifyDestroyed);var g=!1;void 0!==e.cleanupHandles&&null!==e.cleanupHandles&&(g=!0===e.cleanupHandles);if(IA.log("Destroying session "+m+" (async="+r+")"),!p)return IA.warn("Is the server down? (connected=false)"),void e.success();if(null==m)return IA.warn("No session to destroy"),e.success(),void(o&&A.destroyed());if(g)for(var c in y)M(c,{noRequest:!0});var l={rtcgw:"destroy",transaction:IA.randomString(12)};null!=B&&(l.token=B);null!=E&&(l.apisecret=E);if(t){l.session_id=m;var I=function(){for(var A in n)i.removeEventListener(A,n[A]);i.removeEventListener("message",d),i.removeEventListener("error",C),a&&clearTimeout(a),i.close()},d=function(t){var i=JSON.parse(t.data);i.session_id==l.session_id&&i.transaction==l.transaction&&(I(),e.success(),o&&A.destroyed())},C=function(t){I(),e.error("Failed to destroy the server: Is the server down?"),o&&A.destroyed()};return i.addEventListener("message",d),i.addEventListener("error",C),void i.send(JSON.stringify(l))}IA.httpAPICall(s+"/"+m,{verb:"POST",async:r,withCredentials:h,body:l,success:function(t){IA.log("Destroyed session:"),IA.debug(t),m=null,p=!1,"success"!==t.rtcgw&&IA.error("Ooops: "+t.error.code+" "+t.error.reason),e.success(),o&&A.destroyed()},error:function(t,i){IA.error(t+":",i),m=null,p=!1,e.success(),o&&A.destroyed()}})}(e)},this.attach=function(A){!function(A){if(A=A||{},A.success="function"==typeof A.success?A.success:IA.noop,A.error="function"==typeof A.error?A.error:IA.noop,A.consentDialog="function"==typeof A.consentDialog?A.consentDialog:IA.noop,A.iceState="function"==typeof A.iceState?A.iceState:IA.noop,A.mediaState="function"==typeof A.mediaState?A.mediaState:IA.noop,A.webrtcState="function"==typeof A.webrtcState?A.webrtcState:IA.noop,A.slowLink="function"==typeof A.slowLink?A.slowLink:IA.noop,A.onmessage="function"==typeof A.onmessage?A.onmessage:IA.noop,A.onlocalstream="function"==typeof A.onlocalstream?A.onlocalstream:IA.noop,A.onremotestream="function"==typeof A.onremotestream?A.onremotestream:IA.noop,A.ondata="function"==typeof A.ondata?A.ondata:IA.noop,A.ondataopen="function"==typeof A.ondataopen?A.ondataopen:IA.noop,A.oncleanup="function"==typeof A.oncleanup?A.oncleanup:IA.noop,A.ondetached="function"==typeof A.ondetached?A.ondetached:IA.noop,!p)return IA.warn("Is the server down? (connected=false)"),void A.error("Is the server down? (connected=false)");var e=A.plugin;if(null==e)return IA.error("Invalid plugin"),void A.error("Invalid plugin");var n=A.opaqueId,a=A.token?A.token:B,r=IA.randomString(12),o={rtcgw:"attach",plugin:e,opaque_id:n,transaction:r};null!=a&&(o.token=a);null!=E&&(o.apisecret=E);if(t)return D[r]=function(t){if(IA.debug(t),"success"!==t.rtcgw)return IA.error("Ooops: "+t.error.code+" "+t.error.reason),void A.error("Ooops: "+t.error.code+" "+t.error.reason);var i=t.data.id;IA.log("Created handle: "+i);var n={session:_,plugin:e,id:i,token:a,detached:!1,webrtcStuff:{started:!1,myStream:null,streamExternal:!1,remoteStream:null,mySdp:null,mediaConstraints:null,pc:null,dataChannel:{},dtmfSender:null,trickle:!0,iceDone:!1,volume:{value:null,timer:null},bitrate:{value:null,bsnow:null,bsbefore:null,tsnow:null,tsbefore:null,timer:null}},getId:function(){return i},getPlugin:function(){return e},getVolume:function(){return V(i,!0)},getRemoteVolume:function(){return V(i,!0)},getLocalVolume:function(){return V(i,!1)},isAudioMuted:function(){return O(i,!1)},muteAudio:function(){return j(i,!1,!0)},unmuteAudio:function(){return j(i,!1,!1)},isVideoMuted:function(){return O(i,!0)},muteVideo:function(){return j(i,!0,!0)},unmuteVideo:function(){return j(i,!0,!1)},getBitrate:function(){return W(i)},send:function(A){R(i,A)},data:function(A){N(i,A)},dtmf:function(A){T(i,A)},consentDialog:A.consentDialog,iceState:A.iceState,mediaState:A.mediaState,webrtcState:A.webrtcState,slowLink:A.slowLink,onmessage:A.onmessage,createOffer:function(A){G(i,!0,A)},createAnswer:function(A){G(i,!1,A)},handleRemoteJsep:function(A){U(i,A)},onlocalstream:A.onlocalstream,onremotestream:A.onremotestream,ondata:A.ondata,ondataopen:A.ondataopen,oncleanup:A.oncleanup,ondetached:A.ondetached,hangup:function(A){X(i,!0===A)},detach:function(A){M(i,A)}};y[i]=n,A.success(n)},o.session_id=m,void i.send(JSON.stringify(o));IA.httpAPICall(s+"/"+m,{verb:"POST",withCredentials:h,body:o,success:function(t){if(IA.debug(t),"success"!==t.rtcgw)return IA.error("Ooops: "+t.error.code+" "+t.error.reason),void A.error("Ooops: "+t.error.code+" "+t.error.reason);var i=t.data.id;IA.log("Created handle: "+i);var n={session:_,plugin:e,id:i,token:a,detached:!1,webrtcStuff:{started:!1,myStream:null,streamExternal:!1,remoteStream:null,mySdp:null,mediaConstraints:null,pc:null,dataChannel:{},dtmfSender:null,trickle:!0,iceDone:!1,volume:{value:null,timer:null},bitrate:{value:null,bsnow:null,bsbefore:null,tsnow:null,tsbefore:null,timer:null}},getId:function(){return i},getPlugin:function(){return e},getVolume:function(){return V(i,!0)},getRemoteVolume:function(){return V(i,!0)},getLocalVolume:function(){return V(i,!1)},isAudioMuted:function(){return O(i,!1)},muteAudio:function(){return j(i,!1,!0)},unmuteAudio:function(){return j(i,!1,!1)},isVideoMuted:function(){return O(i,!0)},muteVideo:function(){return j(i,!0,!0)},unmuteVideo:function(){return j(i,!0,!1)},getBitrate:function(){return W(i)},send:function(A){R(i,A)},data:function(A){N(i,A)},dtmf:function(A){T(i,A)},consentDialog:A.consentDialog,iceState:A.iceState,mediaState:A.mediaState,webrtcState:A.webrtcState,slowLink:A.slowLink,onmessage:A.onmessage,createOffer:function(A){G(i,!0,A)},createAnswer:function(A){G(i,!1,A)},handleRemoteJsep:function(A){U(i,A)},onlocalstream:A.onlocalstream,onremotestream:A.onremotestream,ondata:A.ondata,ondataopen:A.ondataopen,oncleanup:A.oncleanup,ondetached:A.ondetached,hangup:function(A){X(i,!0===A)},detach:function(A){M(i,A)}};y[i]=n,A.success(n)},error:function(A,e){IA.error(A+":",e)}})}(A)}}IA.useDefaultDependencies=function(A){var e=A&&A.fetch||fetch,t=A&&A.Promise||Promise,i=A&&A.WebSocket||WebSocket;return{newWebSocket:function(A,e){return new i(A,e)},extension:A&&A.extension||lA,isArray:function(A){return Array.isArray(A)},webRTCAdapter:A&&A.adapter||window.adapter,httpAPICall:function(A,i){var n={method:i.verb,headers:{Accept:"application/json, text/plain, */*"},cache:"no-cache"};"POST"===i.verb&&(n.headers["Content-Type"]="application/json"),void 0!==i.withCredentials&&(n.credentials=!0===i.withCredentials?"include":i.withCredentials?i.withCredentials:"omit"),void 0!==i.body&&(n.body=JSON.stringify(i.body));var a=e(A,n).catch((function(A){return t.reject({message:"Probably a network error, is the server down?",error:A})}));if(void 0!==i.timeout){var r=new t((function(A,e){var t=setTimeout((function(){return clearTimeout(t),e({message:"Request timed out",timeout:i.timeout})}),i.timeout)}));a=t.race([a,r])}return a.then((function(A){return A.ok?d(i.success)===d(IA.noop)?A.json().then((function(A){i.success(A)})).catch((function(e){return t.reject({message:"Failed to parse response body",error:e,response:A})})):void 0:t.reject({message:"API call failed",response:A})})).catch((function(A){d(i.error)===d(IA.noop)&&i.error(A.message||"<< internal error >>",A)})),a}}},IA.useOldDependencies=function(A){var e=A&&A.jQuery||jQuery,t=A&&A.WebSocket||WebSocket;return{newWebSocket:function(A,e){return new t(A,e)},isArray:function(A){return e.isArray(A)},extension:A&&A.extension||lA,webRTCAdapter:A&&A.adapter||adapter,httpAPICall:function(A,t){var i=void 0!==t.body?{contentType:"application/json",data:JSON.stringify(t.body)}:{},n=void 0!==t.withCredentials?{xhrFields:{withCredentials:t.withCredentials}}:{};return e.ajax(e.extend(i,n,{url:A,type:t.verb,cache:!1,dataType:"json",async:t.async,timeout:t.timeout,success:function(A){d(t.success)===d(IA.noop)&&t.success(A)},error:function(A,e,i){d(t.error)===d(IA.noop)&&t.error(e,i)}}))}}},IA.noop=function(){},IA.dataChanDefaultLabel="JanusDataChannel",IA.endOfCandidates=null,IA.init=function(A){if((A=A||{}).callback="function"==typeof A.callback?A.callback:IA.noop,!0===IA.initDone)A.callback();else{if("undefined"!=typeof console&&void 0!==console.log||(console={log:function(){}}),IA.trace=IA.noop,IA.debug=IA.noop,IA.vdebug=IA.noop,IA.log=IA.noop,IA.warn=IA.noop,IA.error=IA.noop,!0===A.debug||"all"===A.debug)IA.trace=console.trace.bind(console),IA.debug=console.debug.bind(console),IA.vdebug=console.debug.bind(console),IA.log=console.log.bind(console),IA.warn=console.warn.bind(console),IA.error=console.error.bind(console);else if(Array.isArray(A.debug))for(var e in A.debug){var t=A.debug[e];switch(t){case"trace":IA.trace=console.trace.bind(console);break;case"debug":IA.debug=console.debug.bind(console);break;case"vdebug":IA.vdebug=console.debug.bind(console);break;case"log":IA.log=console.log.bind(console);break;case"warn":IA.warn=console.warn.bind(console);break;case"error":IA.error=console.error.bind(console);break;default:console.error("Unknown debugging option '"+t+"' (supported: 'trace', 'debug', 'vdebug', 'log', warn', 'error')")}}var i=A.dependencies||IA.useDefaultDependencies();IA.isArray=i.isArray,IA.webRTCAdapter=i.webRTCAdapter,IA.httpAPICall=i.httpAPICall,IA.newWebSocket=i.newWebSocket,IA.extension=i.extension,IA.extension.init(),IA.listDevices=function(A,e){A="function"==typeof A?A:IA.noop,null==e&&(e={audio:!0,video:!0}),IA.isGetUserMediaAvailable()?navigator.mediaDevices.getUserMedia(e).then((function(e){navigator.mediaDevices.enumerateDevices().then((function(t){IA.debug(t),A(t);try{var i=e.getTracks();for(var n in i){var a=i[n];null!=a&&a.stop()}}catch(A){}}))})).catch((function(e){IA.error(e),A([])})):(IA.warn("navigator.mediaDevices unavailable"),A([]))},IA.attachMediaStream=function(A,e){"chrome"===IA.webRTCAdapter.browserDetails.browser?IA.webRTCAdapter.browserDetails.version>=52?A.srcObject=e:IA.error("Error attaching stream to element"):A.srcObject=e},IA.reattachMediaStream=function(A,e){"chrome"===IA.webRTCAdapter.browserDetails.browser?IA.webRTCAdapter.browserDetails.version>=52?A.srcObject=e.srcObject:void 0!==A.src?A.src=e.src:IA.error("Error reattaching stream to element"):A.srcObject=e.srcObject};var n=["iPad","iPhone","iPod"].indexOf(navigator.platform)>=0?"pagehide":"beforeunload",a=window["on"+n];if(window.addEventListener(n,(function(A){for(var e in IA.log("Closing window"),IA.sessions)null!==IA.sessions[e]&&void 0!==IA.sessions[e]&&IA.sessions[e].destroyOnUnload&&(IA.log("Destroying session "+e),IA.sessions[e].destroy({asyncRequest:!1,notifyDestroyed:!1}));a&&"function"==typeof a&&a()})),IA.safariVp8=!1,"safari"===IA.webRTCAdapter.browserDetails.browser&&IA.webRTCAdapter.browserDetails.version>=605)if(RTCRtpSender&&RTCRtpSender.getCapabilities&&RTCRtpSender.getCapabilities("video")&&RTCRtpSender.getCapabilities("video").codecs&&RTCRtpSender.getCapabilities("video").codecs.length){for(var e in RTCRtpSender.getCapabilities("video").codecs){var r=RTCRtpSender.getCapabilities("video").codecs[e];if(r&&r.mimeType&&"video/vp8"===r.mimeType.toLowerCase()){IA.safariVp8=!0;break}}IA.safariVp8?IA.log("This version of Safari supports VP8"):IA.warn("This version of Safari does NOT support VP8: if you're using a Technology Preview, try enabling the 'WebRTC VP8 codec' setting in the 'Experimental Features' Develop menu")}else{var o=new RTCPeerConnection({},{});o.createOffer({offerToReceiveVideo:!0}).then((function(A){IA.safariVp8=-1!==A.sdp.indexOf("VP8"),IA.safariVp8?IA.log("This version of Safari supports VP8"):IA.warn("This version of Safari does NOT support VP8: if you're using a Technology Preview, try enabling the 'WebRTC VP8 codec' setting in the 'Experimental Features' Develop menu"),o.close(),o=null}))}if(IA.unifiedPlan=!1,"firefox"===IA.webRTCAdapter.browserDetails.browser&&IA.webRTCAdapter.browserDetails.version>=59)IA.unifiedPlan=!0;else if("chrome"===IA.webRTCAdapter.browserDetails.browser&&IA.webRTCAdapter.browserDetails.version<72)IA.unifiedPlan=!1;else if("undefined"==typeof RTCRtpTransceiver||"currentDirection"in RTCRtpTransceiver.prototype){var s=new RTCPeerConnection;try{s.addTransceiver("audio"),IA.unifiedPlan=!0}catch(A){}s.close()}else IA.unifiedPlan=!1;IA.initDone=!0,A.callback()}},IA.isWebrtcSupported=function(){return void 0!==window.RTCPeerConnection&&null!==window.RTCPeerConnection},IA.isGetUserMediaAvailable=function(){return void 0!==navigator.mediaDevices&&null!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia&&null!==navigator.mediaDevices.getUserMedia},IA.randomString=function(A){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t="",i=0;i0&&void 0!==arguments[0]?arguments[0]:{},e=A.customizeStream,t=void 0===e?null:e,i=A.audio,n=void 0===i||i;dA.isWebrtcSupported()?CA=new dA({server:window.EZUIKit.opt.rtcUrl,success:function(){CA.attach({plugin:"rtcgw.plugin.tts",opaqueId:uA,success:function(A){hA=window.tts=A,dA.log("Plugin attached! ("+hA.getPlugin()+", id="+hA.getId()+")");var e=window.EZUIKit.opt.talkLink;console.log("ttsUlr",e);var i={request:"start",url:e,codec:"opus",dir:"sendrecv",audio_debug:1,url_version:"1"};"gb28181"===window.EZUIKit.opt.talkType&&(i.devProto="gb28181"),dA.debug("Trying a createOffer too (audio/video sendrecv)"),hA.createOffer({media:{audio:n||!0,video:!1,data:!1},simulcast:!1,simulcast2:!1,customizeStream:t,success:function(A){dA.debug("Got SDP!"),dA.debug(A),hA.send({message:i,jsep:A}),void 0!==window.EZUIKit.handleTalkSuccess&&window.EZUIKit.handleTalkSuccess()},error:function(A){dA.error("WebRTC error:",A),void 0!==window.EZUIKit.handleTalkError&&window.EZUIKit.handleTalkError(A)}})},error:function(A){console.error(" -- Error attaching plugin...",A),bootbox.alert("Error attaching plugin... "+A),"undefined"!==window.EZUIKit.handleTalkError&&window.EZUIKit.handleTalkError(A)},consentDialog:function(A){dA.debug("Consent dialog should be "+(A?"on":"off")+" now")},iceState:function(A){dA.log("ICE state changed to "+A)},mediaState:function(A,e){dA.log("Janus "+(e?"started":"stopped")+" receiving our "+A)},webrtcState:function(A){dA.log("Janus says our WebRTC PeerConnection is "+(A?"up":"down")+" now")},slowLink:function(A,e){dA.warn("Janus reports problems "+(A?"sending":"receiving")+" packets on this PeerConnection ("+e+" lost packets)")},onmessage:function(A,e){dA.debug(" ::: Got a message :::"),dA.debug(A),null!=e&&(dA.debug("Handling SDP as well..."),dA.debug(e),hA.handleRemoteJsep({jsep:e}));var t=A.result;if(null!=t){if("done"===t)return bootbox.alert("The TTS Test is over"),null!=BA&&BA.stop(),void(BA=null);"msg"===t&&void 0!==window.EZUIKit.handleTalkMessage&&window.EZUIKit.handleTalkMessage(A),"slow_link"===t.status&&toastr.warning("Janus apparently missed many packets we sent, maybe we should reduce the bitrate","Packet loss?",{timeOut:2e3})}},onlocalstream:function(A){dA.debug(" ::: Got a local stream :::"),dA.debug(A),dA.attachMediaStream(document.getElementById("myaudio"),A),"completed"!==hA.webrtcStuff.pc.iceConnectionState&&"connected"!==hA.webrtcStuff.pc.iceConnectionState&&(null==BA?document.getElementById("audioright"):BA.spin());var e=A.getAudioTracks();null==e||e.length},onremotestream:function(A){dA.debug(" ::: Got a remote stream :::"),dA.debug(A),dA.attachMediaStream(document.getElementById("peeraudio"),A);var e=A.getAudioTracks();null==e||0===e.length||document.getElementById("peeraudio").play()},ondataopen:function(A){dA.log("The DataChannel is available!")},ondata:function(A){dA.debug("We got data from the DataChannel! "+A)},oncleanup:function(){dA.log(" ::: Got a cleanup notification :::"),null!=BA&&BA.stop(),BA=null}})},error:function(A){dA.error(A),"undefined"!==window.EZUIKit.handleTalkError&&window.EZUIKit.handleTalkError(A)},destroyed:function(){}}):bootbox.alert("No WebRTC support... ")}}});var EA=function(){return a((function A(e){var i=this;t(this,A),this.jSPlugin=e,this.pluginStatus=new L(this,this.jSPlugin.params.id),this.talkChannelNo=e.talkChannelNo,this.gainNode=null,this.volumeGain=null,this.volumeChangeInterval=null,this.microphoneId=null;var n=document.createElement("div");n.id="audioleft";var a=document.createElement("div");a.id="audioright",a.style="display:none;";var r=document.createElement("audio");r.id="myaudio",r.muted=!0,r.setAttribute("autoplay",!0),r.setAttribute("controls",!0),n.appendChild(r),n.style="display:none;";var o=document.createElement("audio");o.id="peeraudio",o.setAttribute("autoplay",!0),o.setAttribute("controls",!0),a.appendChild(o),window.EZUIKit.handleTalkError=function(A){console.log("talk err",A),void 0!==i.jSPlugin.handleTalkError&&i.jSPlugin.handleTalkError(A)},window.EZUIKit.handleTalkSuccess=function(A){console.log("talk success",A),void 0!==i.jSPlugin.handleTalkSuccess&&i.jSPlugin.handleTalkSuccess(A)},window.EZUIKit.opt={rtcUrl:"",talkLink:"",ttsUrl:"",stream:"",deviceSerial:y(this.jSPlugin.url).deviceSerial,channelNo:y(this.jSPlugin.url).channelNo},document.body.appendChild(n),document.body.appendChild(a)}),[{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}},{key:"startTalk",value:function(A){var e=this,t=this;new Promise((function(A,t){e.jSPlugin.capacity&&e.jSPlugin.capacity.support_switch_talkmode&&"1"==e.jSPlugin.capacity.support_switch_talkmode?fetch(e.jSPlugin.env.domain+"/api/service/device/talkMode"+"?deviceSerial=".concat(y(e.jSPlugin.url).deviceSerial),{method:"GET",headers:{accessToken:e.jSPlugin.accessToken||e.jSPlugin.token.deviceToken.global}}).then((function(A){return A.json()})).then((function(t){t.meta&&200==t.meta.code?t.data&&t.data.valueInfo&&0==t.data.valueInfo.mode?fetch(e.jSPlugin.env.domain+"/api/v3/device/talkMode"+"?deviceSerial=".concat(y(e.jSPlugin.url).deviceSerial,"&channelNo=").concat(y(e.jSPlugin.url).channelNo,"&mode=1"),{method:"PUT",headers:{accessToken:e.jSPlugin.accessToken||e.jSPlugin.token.deviceToken.video}}).then((function(A){return A.json()})).then((function(e){e.meta&&200==e.meta.code?A():A({code:-1,msg:"对讲模式切换失败",res:e})})).catch((function(e){A({code:-1,msg:"对讲模式切换失败",res:e})})):A():A({code:-1,msg:"获取当前对讲模式失败",res:t})})).catch((function(e){A({code:-1,msg:"获取当前对讲模式失败",res:e})})):A({code:-1,msg:"当前设备不支持对讲模式切换"})})).then((function(i){if(e.jSPlugin.capacity&&e.jSPlugin.capacity.support_talk&&(!e.jSPlugin.capacity||"3"!==e.jSPlugin.capacity.support_talk&&"1"!==e.jSPlugin.capacity.support_talk))return"function"==typeof e.jSPlugin.params.handleError&&(e.pluginStatus.loadingSetText({text:"设备不支持对讲",color:"red",delayClear:2e3}),e.jSPlugin.params.handleError({msg:"设备不支持对讲",retcode:-1e3,id:e.jSPlugin.params.id,type:"handleError"})),console.log("设备不支持对讲"),!1;var n=new FormData;if(n.append("accessToken",e.jSPlugin.accessToken||e.jSPlugin.token.deviceToken.video),n.append("deviceSerial",y(e.jSPlugin.url).deviceSerial),n.append("channelNo",e.jSPlugin.channelNo||"0"),e.jSPlugin.params.extraParams&&e.jSPlugin.params.extraParams.talkParams&&"object"===d(e.jSPlugin.params.extraParams.talkParams))for(var a in e.jSPlugin.params.extraParams.talkParams)data.append(a,e.jSPlugin.params.extraParams.talkParams[a]);fetch(e.jSPlugin.env.domain+"/api/lapp/live/talk/url",{method:"POST",body:n}).then((function(A){return A.json()})).then((function(i){if(200==i.code){var n=i.data;if(n){var a=n.rtcUrl;if(-1===a.indexOf("ws")&&(a=a.replace("https","wss").replace("rtcgw","rtcgw-ws")),window.EZUIKit.opt.rtcUrl=a,window.EZUIKit.opt.ttsUrl="tts://"+n.ttsUrl,e.jSPlugin.params.extraParams&&e.jSPlugin.params.extraParams.ttsParams)if("string"==typeof e.jSPlugin.params.extraParams.ttsParams)window.EZUIKit.opt.ttsUrl+="&"+e.jSPlugin.params.extraParams.ttsParams;else if("object"===d(e.jSPlugin.params.extraParams.ttsParams))for(var r in e.jSPlugin.params.extraParams.ttsParams)window.EZUIKit.opt.ttsUrl+="&"+r+"="+e.jSPlugin.params.extraParams.ttsParams[r];window.EZUIKit.opt.deviceSerial=y(e.jSPlugin.url).deviceSerial,window.EZUIKit.opt.channelNo=e.talkChannelNo||"0";var o="talk?dev="+window.EZUIKit.opt.deviceSerial+"&chann="+window.EZUIKit.opt.channelNo+"&encodetype=2";window.EZUIKit.opt.talkLink=window.EZUIKit.opt.ttsUrl.split("?")[0]+"/"+o,n.ttsUrl.indexOf("gb28181")>-1&&(window.EZUIKit.opt.talkType="gb28181"),A&&A(n.ttsUrl.indexOf("gb28181")>-1||-1!==window.EZUIKit.opt.deviceSerial.indexOf(":")),window.EZUIKit.opt.stream=e.jSPlugin.accessToken?n.stream:e.jSPlugin.token.streamToken.talk,window.startTalk({customizeStream:t._customizeStream.bind(t),audio:!e.microphoneId||{deviceId:e.microphoneId}}),e.observeVolumeChange(),e.jSPlugin.eventEmitter&&e.jSPlugin.eventEmitter.emit("startTalk",{eventType:"startTalk",code:0,target:e,msg:"开启对讲"})}}else console.log(i.code,e.jSPlugin.i18n.t("38"+i.code)),e.pluginStatus.loadingSetText({text:i.msg||e.jSPlugin.i18n.t("38"+i.code),color:"red",delayClear:2e3}),e.jSPlugin.eventEmitter&&e.jSPlugin.eventEmitter.emit("startTalk",{eventType:"startTalk",code:-1,target:e,msg:i.msg||e.jSPlugin.i18n.t("38"+i.code)}),"function"==typeof e.jSPlugin.params.handleError&&e.jSPlugin.params.handleError({msg:i.msg||e.jSPlugin.i18n.t("38"+i.code),retcode:i.code,id:e.jSPlugin.params.id,type:"handleError"})})).catch((function(A){console.log("err",A)}))})).catch((function(A){console.log("对讲开启失败:",A)}))}},{key:"stopTalk",value:function(){var A=this;window.stopTalk(),this.gainNode=null,clearInterval(this.volumeChangeInterval),this.volumeChangeInterval=null,this.jSPlugin.eventEmitter&&(setTimeout((function(){A.jSPlugin.eventEmitter.emit("volumeChange",{eventType:"volumeChange",code:0,target:A,data:0,msg:"音量变化"})}),200),this.jSPlugin.eventEmitter.emit("stopTalk",{eventType:"stopTalk",code:0,target:this,msg:"结束对讲"})),document.getElementById("myaudio")&&document.getElementById("myaudio").srcObject&&document.getElementById("myaudio").srcObject.getTracks()[0].stop()}},{key:"changeTalkChannelNo",value:function(A){window.EZUIKit.opt&&window.EZUIKit.opt.channelNo&&(this.talkChannelNo=A,window.EZUIKit.opt.channelNo=A)}},{key:"_customizeStream",value:function(A){var e=this;return new Promise((function(t,i){var n,a=new window.AudioContext;e.gainNode=a.createGain(),console.log("thisa",e);var r=a.createMediaStreamSource(A);e.gainNode.gain.value=null!==(n=e.volumeGain)&&void 0!==n?n:1;var o=a.createMediaStreamDestination();r.connect(e.gainNode),e.gainNode.connect(o),t(o.stream)}))}},{key:"setVolumeGain",value:function(A){var e=["",null].includes(A)?1:Number(A);return"number"==typeof e&&e>=0?(this.volumeGain=Math.min(e,10),this.gainNode&&(this.gainNode.gain.value=this.volumeGain),{code:0,msg:"成功",res:null}):{code:-1,msg:"参数格式有误",res:null}}},{key:"observeVolumeChange",value:function(){var A=this,e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).interval,t=void 0===e?100:e;this.volumeChangeInterval&&(clearInterval(volumeChangeInterval),volumeChangeInterval=null),this.volumeChangeInterval=setInterval((function(){var e,t;null===(e=window.tts)||void 0===e||null===(e=e.webrtcStuff)||void 0===e||null===(e=e.pc)||void 0===e||null===(t=e.getStats)||void 0===t||null===(t=t.call(e))||void 0===t||t.then((function(e){e.forEach((function(e){var t;"media-source"===e.type&&(null===(t=A.jSPlugin)||void 0===t||null===(t=t.eventEmitter)||void 0===t||t.emit("volumeChange",{eventType:"volumeChange",code:0,target:A,data:e.audioLevel,msg:"音量变化"}))}))}))}),t)}},{key:"getMicrophonePermission",value:function(){return new Promise((function(A,e){navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){e.getTracks().forEach((function(A){A.stop()})),A({code:0,msg:"成功",res:null})})).catch((function(e){A({code:-1,msg:"获取麦克风权限失败",res:e})}))}))}},{key:"getMicrophonesList",value:function(){return new Promise((function(A,e){navigator.mediaDevices?navigator.mediaDevices.enumerateDevices().then((function(e){var t=[];e.map((function(A){"audioinput"==A.kind&&t.push(A)})),A({code:0,msg:"成功",res:t})})):A({code:-1,msg:"未查询到相关设备",res:null})}))}},{key:"setProfile",value:function(A){var e=this,t=A.microphoneId;t!==this.microphoneId&&(this.microphoneId=t,this.gainNode&&(window.stopTalk(),setTimeout((function(){window.startTalk({customizeStream:e._customizeStream.bind(e),audio:!e.microphoneId||{deviceId:e.microphoneId}})}),200)))}}])}(),fA=function(){return a((function A(e){var i=this;t(this,A),this.jSPlugin=e,this.pluginStatus=new L(this,this.jSPlugin.id);var n=document.createElement("style");n.innerHTML="\n body{\n padding: 0;\n margin: 0;\n }\n #mobile-ez-ptz-container {\n display: inline-block;\n width: 375px;\n text-align: center;\n }\n .live-ptz-title{\n height: 25px;\n font-size: 18px;\n color: #2c2c2c;\n text-align: center;\n font-weight: 700;\n margin: 24px 0 12px;\n }\n .live-ptz-intro {\n margin-bottom: 24px;\n color: #aaaaaa;\n }\n .mobile-ez-ptz-wrap {\n background-image: linear-gradient(180deg, #f6f8ff 0%, #ededed6b 50%)\n }\n #mobile-ez-ptz-container .mobile-ez-ptz-container {\n position: relative;\n width: 260px;\n height: 260px;\n background: rgba(255, 255, 255, 0.80);\n border: 1px solid rgba(255, 255, 255, 0.80);\n border-radius: 100%;\n cursor: pointer;\n overflow: hidden;\n margin: auto;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.top {\n width: 0;\n height: 0;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: 6px solid #aaaaaa;\n position: absolute;\n display: inline-block;\n left: calc(50% - 6px);\n top: 10px;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.top.active {\n border-bottom-color: #1890FF;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.bottom {\n width: 0;\n height: 0;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-top: 6px solid #aaaaaa;\n position: absolute;\n display: inline-block;\n left: calc(50% - 6px);\n bottom: 10px;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.bottom.active {\n border-top-color: #1890FF;\n\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.right {\n width: 0;\n height: 0;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n border-left: 6px solid #aaaaaa;\n position: absolute;\n display: inline-block;\n top: calc(50% - 6px);\n right: 10px;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.right.active {\n border-left-color: #1890FF;\n\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.left {\n width: 0;\n height: 0;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n border-right: 6px solid #aaaaaa;\n position: absolute;\n display: inline-block;\n top: calc(50% - 6px);\n left: 10px;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.left.active {\n border-right-color: #1890FF;\n\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .ez-ptz-main.center {\n width: 52px;\n height: 52px;\n background: #FFFFFF;\n border: 2px solid #eee;\n border-radius: 100%;\n top: calc(50% - 26px);\n left: calc(50% - 26px);\n position: absolute;\n /* box-shadow: 0px -39px 40px 6px #1890ff; */\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-wrap {\n display: inline-block;\n padding: 24px 24px;\n border-radius: 100%;\n overflow: hidden;\n }\n\n #mobile-ez-ptz-container .ez-ptz-close {\n position: absolute;\n color: #FFFFFF;\n top: 0;\n right: 0px;\n }",document.getElementsByTagName("head")[0].appendChild(n);var a=document.createElement("div");a.className="mobile-ez-ptz-container",a.id="mobile-ez-ptz-container";var r=window.innerHeight;a.style="display:inline-block;width: ".concat(this.jSPlugin.width,"px;text-align:center;height: ").concat(r-this.jSPlugin.height-5,"px");var o=document.createElement("div");o.className="live-ptz-title",o.id="live-ptz-title",o.innerHTML=this.jSPlugin.i18n.t("BTN_PTZ"),document.getElementById("live-ptz-title")||a.appendChild(o);var s=document.createElement("div");s.className="live-ptz-intro",s.id="live-ptz-intro",s.innerHTML=this.jSPlugin.i18n.t("MOBILE_PTZ_TIPS"),document.getElementById("live-ptz-intro")||a.appendChild(s);var g=document.createElement("div");g.id="mobile-ez-ptz-item",g.className="mobile-ez-ptz-wrap",g.innerHTML='\n
\n
\n
\n
\n
\n
\n
\n ',document.getElementById("mobile-ez-ptz-item")||a.appendChild(g),Q(a,document.getElementById("".concat(this.jSPlugin.id,"-wrap"))),document.getElementById("mobile-ez-ptz-item").ontouchstart=function(A){A.preventDefault(),console.log("触摸开始"),i._handlePtzTouch(A,"start")},document.getElementById("mobile-ez-ptz-item").ontouchend=function(A){A.preventDefault(),console.log("触摸结束",A),i._handlePtzTouch(A,"stop")},document.getElementById("mobile-ez-ptz-item").onmousedown=function(A){A.preventDefault(),console.log("触摸开始"),i._handlePtzTouch(A,"start")},document.getElementById("mobile-ez-ptz-item").onmouseup=function(A){A.preventDefault(),console.log("触摸结束",A),i._handlePtzTouch(A,"stop")}}),[{key:"show",value:function(){document.getElementById("mobile-ez-ptz-container").style="display: inline-block"}},{key:"hide",value:function(){document.getElementById("mobile-ez-ptz-container").style="display: none"}},{key:"_handlePtzTouch",value:function(A,e){var t=this,i=document.getElementById("mobile-ez-ptz-item").getBoundingClientRect(),n=i.left+130,a=i.top+130,r=(A.x||A.changedTouches[0].clientX)-n,o=(A.y||A.changedTouches[0].clientY)-a,s=0,g=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start",c=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video;Math.abs(r)>Math.abs(o)?r>0?(s=3,document.getElementsByClassName("mobile-ez-ptz-icon")[3].className=document.getElementsByClassName("mobile-ez-ptz-icon")[3].className.replace("default","active")):(s=2,document.getElementsByClassName("mobile-ez-ptz-icon")[1].className=document.getElementsByClassName("mobile-ez-ptz-icon")[1].className.replace("default","active")):o>0?(s=1,document.getElementsByClassName("mobile-ez-ptz-icon")[2].className=document.getElementsByClassName("mobile-ez-ptz-icon")[2].className.replace("default","active")):(s=0,document.getElementsByClassName("mobile-ez-ptz-icon")[0].className=document.getElementsByClassName("mobile-ez-ptz-icon")[0].className.replace("default","active")),document.getElementById("mobile-ez-ptz-item").style="background-image:linear-gradient(".concat(0===s?180:1===s?0:2===s?90:270,"deg, #c0ddf1 0%, rgba(100,143,252,0.00) 50%)"),"stop"===e&&(g=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop",c=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,document.getElementById("mobile-ez-ptz-item").style="",document.getElementsByClassName("mobile-ez-ptz-icon")[3].className=document.getElementsByClassName("mobile-ez-ptz-icon")[3].className.replace("active","default"),document.getElementsByClassName("mobile-ez-ptz-icon")[1].className=document.getElementsByClassName("mobile-ez-ptz-icon")[1].className.replace("active","default"),document.getElementsByClassName("mobile-ez-ptz-icon")[2].className=document.getElementsByClassName("mobile-ez-ptz-icon")[2].className.replace("active","default"),document.getElementsByClassName("mobile-ez-ptz-icon")[0].className=document.getElementsByClassName("mobile-ez-ptz-icon")[0].className.replace("active","default"));var l=new FormData;l.append("deviceSerial",y(this.jSPlugin.url).deviceSerial),l.append("channelNo",y(this.jSPlugin.url).channelNo),l.append("speed",1),l.append("direction",s),l.append("accessToken",c),fetch(g,{method:"POST",body:l}).then((function(A){return A.json()})).then((function(A){if(200==A.code);else{console.log(A.code,t.jSPlugin.i18n.t("38"+A.code));var e=t.jSPlugin.i18n.t("38"+A.code)||A.msg;t.pluginStatus.loadingSetText({text:e,color:"red",delayClear:2e3}),60005!=A.code&&60002!=A.code&&60003!=A.code&&60004!=A.code||(document.getElementById("mobile-ez-ptz-item").style="background-image:linear-gradient(".concat(0===s?180:1===s?0:2===s?90:270,"deg, #f45656 0%, rgba(100,143,252,0.00) 50%)"))}})).catch((function(A){console.log("云台调用异常",A)}))}}])}(),QA={header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-0",iconId:"deviceID",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-1",iconId:"deviceName",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-2",iconId:"cloudRec",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-3",iconId:"rec",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"}]},footer:{color:"#FFFFFF",backgroundColor:"rgb(0 0 0 / 0%)",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-0",iconId:"play",part:"left",defaultActive:1,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-1",iconId:"capturePicture",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-2",iconId:"sound",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-3",iconId:"pantile",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-4",iconId:"recordvideo",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-5",iconId:"talk",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-6",iconId:"hd",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-7",iconId:"webExpend",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-8",iconId:"expend",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"}]}},xA={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},pA={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:1},{iconId:"rec",part:"right",defaultActive:0,isrender:1}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},mA={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-0",iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-1",iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-2",iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-3",iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},yA={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-0",iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-1",iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-2",iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-3",iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},_A={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:0},{iconId:"deviceName",part:"left",defaultActive:0,isrender:0},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:0},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:0},{iconId:"sound",part:"left",defaultActive:1,isrender:0},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:0},{iconId:"talk",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:0}]}}},SA={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:0},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},DA={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:1},{iconId:"cloudRecord",part:"right",defaultActive:0,isrender:1},{iconId:"rec",part:"right",defaultActive:0,isrender:1}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},vA={data:{header:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:0},{iconId:"deviceName",part:"left",defaultActive:0,isrender:0},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"#00000080",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:0},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:0},{iconId:"sound",part:"left",defaultActive:1,isrender:0},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:0},{iconId:"talk",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:0},{iconId:"speed",part:"right",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:0}]}}},wA=[{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"pcLive",themeIntro:"PC直播全量版",themeName:"PC直播全量版",themeType:"webLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:mA.data.header,footer:mA.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"security",themeIntro:"PC直播安防版",themeName:"PC直播安防版",themeType:"webLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:yA.data.header,footer:yA.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"voice",themeIntro:"PC直播语音版",themeName:"PC直播语音版",themeType:"webLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:SA.data.header,footer:SA.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"simple",themeIntro:"PC直播极简版",themeName:"PC直播极简版",themeType:"webLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"",header:_A.data.header,footer:_A.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"pcRec",themeIntro:"PC回放全量版",themeName:"PC回放全量版",themeType:"webRec",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:DA.data.header,footer:DA.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"mobileLive",themeIntro:"Mobile直播全量版",themeName:"Mobile直播全量版",themeType:"mobileLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_GmAL5IhAABZs1vUK0s564.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:xA.data.header,footer:xA.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"mobileRec",themeIntro:"Mobile回放全量版",themeName:"Mobile回放全量版",themeType:"mobileRec",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_GmAL5IhAABZs1vUK0s564.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:pA.data.header,footer:pA.data.footer},{autoFocus:0,createTime:"2021-06-14T08:04:37.000Z",themeId:"miniRec",themeIntro:"Mobile回放全量版",themeName:"Mobile回放全量版",themeType:"mobileRec",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_GmAL5IhAABZs1vUK0s564.png",poster:"",header:vA.data.header,footer:vA.data.footer}],bA=function(){return a((function A(e){var i=this;t(this,A),this.jSPlugin=e,this.enableZoom=!1,this.videoWidth=1920,this.videoHeight=1080,this.currentScale=1,this.currentPosition={left:0,top:0,right:1920,bottom:1080},this.info={},this.dpr="v1"==e.decoderType?1:e.dpr,this.clientRect=document.getElementById(e.id).getBoundingClientRect(),this.DOM=document.getElementById(e.id);var n=document.createElement("div");n.id="".concat(e.id,"-zoom-container");var a=document.getElementById("".concat(e.id,"-audioControls")),r=48;a&&(r=a.offsetHeight);var o=e.isMobile?"\n -webkit-transform: scale(0.8);\n -moz-transform: scale(0.8);\n -ms-transform: scale(0.8);\n transform: scale(0.8);\n transform-origin: left bottom;":"";n.style="position: absolute;\n display:none;\n left: 12px;\n bottom: ".concat(e.isMobile?"".concat(r+6,"px"):"80px",";\n ").concat(o,"\n ");var s='\n \n
2.0X
\n
\n \n \n ').concat(this.jSPlugin.i18n.t("ZOOM_ADD"),'\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n
\n
\n
\n \n \n ').concat(this.jSPlugin.i18n.t("ZOOM_SUB"),'\n \n \n \n \n \n \n \n \n \n \n
\n \n ');if(n.innerHTML=s,document.getElementById("".concat(e.id,"-audioControls-left"))&&(document.getElementById("".concat(e.id,"-audioControls-left")).parentNode.appendChild(n),document.getElementById("".concat(e.id,"-addScale")).onclick=function(){i.addScale()},document.getElementById("".concat(e.id,"-subScale")).onclick=function(){i.subScale()}),e.jSPlugin)try{var g=e.jSPlugin._JSPlayM4_GetFrameInfo(0);this.info=Object.assign({},g),this.videoWidth=(g.width||e.width)*this.dpr,this.videoHeight=(g.height||e.height)*this.dpr,this.currentPosition.right=g.width*this.dpr,this.currentPosition.bottom=g.height*this.dpr,e.jSPlugin.bEZoom=!0}catch(A){}this._event()}),[{key:"_event",value:function(){var A=this,e=setInterval((function(){var t=document.getElementById("".concat(A.jSPlugin.id,"-container-0"));clearInterval(e),A.jSPlugin.isMobile?t&&(t.addEventListener("touchstart",(function(e){return A.onTouchstart(e)})),t.addEventListener("touchend",(function(e){return A.onTouchend(e)}))):t&&(t.addEventListener("mousedown",(function(e){return A.onMouseDown(e)})),t.addEventListener("mouseup",(function(e){return A.onMouseUp(e)})))}),100)}},{key:"onMouseDown",value:function(A){if(1===this.currentScale)return!1;this.moveX=A.clientX,this.moveY=A.clientY}},{key:"onMouseUp",value:function(A){var e=this.currentPosition;if(1===this.currentScale)return!1;e.left=e.left-(A.clientX-this.moveX),e.top=e.top-(A.clientY-this.moveY),this.doScale()}},{key:"onTouchstart",value:function(A){if(1===this.currentScale)return!1;if(this.jSPlugin.use3DZoom||1===this.currentScale)return!1;if(!this.jSPlugin.beforeMobileZoomVerify())return!1;if(!this.inited){var e=this.jSPlugin.jSPlugin._JSPlayM4_GetFrameInfo(0);this.videoWidth=e.width,this.videoHeight=e.height,this.currentPosition.left=0,this.currentPosition.top=0,this.isMobileFullScreen?(this.currentPosition.right=e.height,this.currentPosition.bottom=e.width):(this.currentPosition.right=e.width,this.currentPosition.bottom=e.height),this.inited=!0}var t=A.touches[0];if(t){var i={clientX:0,clientY:0};i.clientX=t.clientX,i.clientY=t.clientY,this.point1=i}}},{key:"onTouchend",value:function(A){var e=this,t=this.currentPosition;if(1===this.currentScale)return!1;var i=A.changedTouches[0];this.isMobileFullScreen?(t.left=t.left-(i.clientY-e.point1.clientY),t.top=t.top+(i.clientX-e.point1.clientX)):(t.left=t.left-(i.clientX-e.point1.clientX),t.top=t.top-(i.clientY-e.point1.clientY)),e.doScale()}},{key:"renderDot",value:function(){var A=this.currentScale;document.getElementById("".concat(this.jSPlugin.id,"-scale-value"))&&(document.getElementById("".concat(this.jSPlugin.id,"-scale-value")).innerHTML="".concat(A,".0X")),document.getElementById("".concat(this.jSPlugin.id,"-line-dot"))&&(document.getElementById("".concat(this.jSPlugin.id,"-line-dot")).style.height="".concat((A-1)/7*100,"%")),document.getElementById("".concat(this.jSPlugin.id,"-scale-body-line-dot"))&&(document.getElementById("".concat(this.jSPlugin.id,"-scale-body-line-dot")).style.bottom="calc(".concat((A-1)/7*100,"% - 3px)"))}},{key:"getTopMostElement",value:function(A,e,t){var i=A?A.getBoundingClientRect():null,n=e?e.getBoundingClientRect():null,a=t?t.getBoundingClientRect():null;if(!i&&!n&&!a)return null;if(!i)return n.top1?1.25:.75),A.right=A.right*i*(i>1?1.25:.75),this.info.width=t.width,this.videoWidth=t.width*(i>1.25?1:.75)*this.dpr}if(t.height!=this.info.height){var n=parseFloat(t.height/this.info.height);A.top=A.top*n*(n>1?1.25:.75),A.bottom=A.bottom*n*(n>1?1.25:.75),this.info.height=t.height,this.videoHeight=t.height*(n>1?1.25:.75)*this.dpr}A.left=A.left+.5*(A.right-A.left-this.videoWidth/e),A.left<=0?A.left=0:A.left>this.videoWidth-this.videoWidth/e&&(A.left=this.videoWidth-this.videoWidth/e),A.right=A.left+this.videoWidth/e,A.top=A.top+.5*(A.bottom-A.top-this.videoHeight/e),A.top<=0?A.top=0:A.top>this.videoHeight-this.videoHeight/e&&(A.top=this.videoHeight-this.videoHeight/e),A.bottom=A.top+this.videoHeight/e,A.left=parseInt(A.left,10),A.right=parseInt(A.right,10),A.top=parseInt(A.top,10),A.bottom=parseInt(A.bottom,10);try{A.left0&&void 0!==arguments[0]?arguments[0]:1;return this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("zoomAdd",{eventType:"zoomAdd",code:1,target:this,msg:"执行放大"}),this.currentScale>=8?(this.jSPlugin.Message&&this.jSPlugin.Message.default(this.jSPlugin.i18n.t("ZOOM_ADD_MAX"),document.getElementById("".concat(this.jSPlugin.id))),!1):(this.currentScale=this.currentScale+A,this.currentScale>8?(console.log("超出最大倍率"),this.jSPlugin.Message&&this.jSPlugin.Message.default(this.jSPlugin.i18n.t("ZOOM_LIMIT_MAX"),document.getElementById("".concat(this.jSPlugin.id))),!1):void this.doScale())}},{key:"subScale",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("zoomSub",{eventType:"zoomSub",code:1,target:this,msg:"执行缩小"}),this.currentScale<=1?(this.jSPlugin.Message&&this.jSPlugin.Message.default(this.jSPlugin.i18n.t("ZOOM_SUB_MIN"),document.getElementById("".concat(this.jSPlugin.id))),!1):(this.currentScale=this.currentScale-A,this.currentScale<1?(this.jSPlugin.Message&&this.jSPlugin.Message.default(this.jSPlugin.i18n.t("ZOOM_LIMIT_MIN"),document.getElementById("".concat(this.jSPlugin.id))),!1):void this.doScale())}},{key:"_JSPlayM4_SetDisplayRegion",value:function(A,e,t,i,n){this.jSPlugin&&this.jSPlugin.jSPlugin&&(console.log("%c计算后,","color: red;",this.videoWidth,this.videoHeight,A,e,t,i,this.currentScale),this.jSPlugin.jSPlugin._JSPlayM4_SetDisplayRegion(A,e,t,i,n,this.isMobileFullScreen))}},{key:"isMobileFullScreen",get:function(){return!!(D()&&this.jSPlugin.Theme&&this.jSPlugin.Theme.decoderState&&this.jSPlugin.Theme.decoderState.state.expend)}}])}(),FA=[{videoLevel:1,streamTypeIn:2},{videoLevel:2,streamTypeIn:1}],RA={0:"VIDEO_LEVEL_FLUENT",1:"VIDEO_LEVEL_SATNDARD",2:"VIDEO_LEVEL_HEIGH",3:"VIDEO_LEVEL_SPUER",4:"VIDEO_LEVEL_EXTREME",5:"VIDEO_LEVEL_3K",6:"VIDEO_LEVEL_4k"},kA="8.1.0",PA=function(A,e,t,i){var n="".concat(A.env.domain,"/api/service/media/template/getDetail?accessToken=").concat(A.accessToken||A.token.httpToken.url,"&id=").concat(e);fetch(n,{method:"GET"}).then((function(A){return A.json()})).then((function(A){var e;(e=A).meta&&t(e)})).catch((function(A){var e;e=A,console.log(e),i(e)}))},NA=function(A){var e="";return Object.keys(A).map((function(t,i){e+="".concat(t,":").concat(A[t]).concat(i0&&(this.autoFocus=parseInt(this.themeData.autoFocus),this.startAutoFocus(),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).addEventListener("click",(function(){document.getElementById("".concat(A.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(A.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(A.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),A.startAutoFocus()}))),this.setDecoderState({cloudRec:"cloud.rec"===y(this.jSPlugin.url).type,rec:"rec"===y(this.jSPlugin.url).type,type:y(this.jSPlugin.url).type});else if(!this.themeInited)var n=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&A.jSPlugin.autoplay&&(clearInterval(n),A.themeInited=!0)}),50);M.findIndex(this.themeData.footer.btnList,(function(A){return"zoom"===A.iconId&&A.isrender>0}))>=0&&(this.isMobile&&!this.jSPlugin.use3DZoom&&(this.jSPlugin.beforeMobileZoomVerify=function(){return!!A.decoderState.state.play}),this.jSPlugin.Zoom=new bA(this.jSPlugin)),setTimeout((function(){document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen||A.jSPlugin.jSPlugin.JS_Resize(A.jSPlugin.width,A.jSPlugin.height-A._extendHeadeTimeLinrHight(!1,!1))}),50)}},{key:"setDecoderState",value:function(A){var e=this,t=this.themeData,i=t.header,n=t.footer;Object.keys(A).map((function(t,a){var r="#FFFFFF",o="#FFFFFF";switch(-1===i.btnList.findIndex((function(A){return A.iconId===t}))?(r=n.color.replace("-diy",""),o=n.activeColor.replace("-diy","")):(r=i.color.replace("-diy",""),o=n.activeColor.replace("-diy","")),t){case"play":A[t]?document.getElementById("".concat(e.jSPlugin.id,"-play"))&&(document.getElementById("".concat(e.jSPlugin.id,"-play-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(e.jSPlugin.id,"-play-content")).children[0].children[1].style="display:none",document.getElementById("".concat(e.jSPlugin.id,"-play")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-play-content")).childNodes[0].children[0].style.fill=A[t]?o:r):document.getElementById("".concat(e.jSPlugin.id,"-play"))&&(document.getElementById("".concat(e.jSPlugin.id,"-play-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(e.jSPlugin.id,"-play-content")).children[0].children[0].style="display:none",document.getElementById("".concat(e.jSPlugin.id,"-play")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-play-content")).childNodes[0].children[1].style.fill=A[t]?o:r);break;case"sound":document.getElementById("".concat(e.jSPlugin.id,"-sound"))&&(A[t]?(document.getElementById("".concat(e.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(e.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:none",document.getElementById("".concat(e.jSPlugin.id,"-sound")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-sound-content")).childNodes[0].children[1].style.fill=A[t]?o:r):(document.getElementById("".concat(e.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(e.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:none",document.getElementById("".concat(e.jSPlugin.id,"-sound")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-sound-content")).childNodes[0].children[0].style.fill=A[t]?o:r));break;case"recordvideo":document.getElementById("".concat(e.jSPlugin.id,"-recordvideo"))&&(document.getElementById("".concat(e.jSPlugin.id,"-recordvideo")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-recordvideo-content")).childNodes[0].style.fill=A[t]?o:r,A[t]?e.countTime("add",0):e.countTime("destroy",0));break;case"talk":document.getElementById("".concat(e.jSPlugin.id,"-talk"))&&(document.getElementById("".concat(e.jSPlugin.id,"-talk")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-talk-content")).childNodes[1].style.fill=A[t]?o:r);break;case"zoom":document.getElementById("".concat(e.jSPlugin.id,"-zoom"))&&(document.getElementById("".concat(e.jSPlugin.id,"-zoom")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-zoom-content")).childNodes[1].style.fill=A[t]?o:r);break;case"pantile":document.getElementById("".concat(e.jSPlugin.id,"-pantile"))&&(document.getElementById("".concat(e.jSPlugin.id,"-pantile")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-pantile-content")).childNodes[0].style.fill=A[t]?o:r);break;case"webExpend":A[t]?(document.getElementById("".concat(e.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(e.jSPlugin.id,"-webExpend-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(e.jSPlugin.id,"-webExpend-content")).children[0].children[0].style="display:none"),document.getElementById("".concat(e.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(e.jSPlugin.id,"-expend")).className="disabled")):(document.getElementById("".concat(e.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(e.jSPlugin.id,"-webExpend-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(e.jSPlugin.id,"-webExpend-content")).children[0].children[1].style="display:none"),document.getElementById("".concat(e.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(e.jSPlugin.id,"-expend")).className="")),document.getElementById("".concat(e.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(e.jSPlugin.id,"-webExpend")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-webExpend-content")).childNodes[0].childNodes[0].style.fill=A[t]?o:r,document.getElementById("".concat(e.jSPlugin.id,"-webExpend-content")).childNodes[0].childNodes[1].style.fill=A[t]?o:r);break;case"capturePicture":document.getElementById("".concat(e.jSPlugin.id,"-capturePicture"))&&(document.getElementById("".concat(e.jSPlugin.id,"-capturePicture")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-capturePicture-content")).childNodes[0].style.fill=A[t]?o:r);break;case"expend":A[t]?(document.getElementById("".concat(e.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(e.jSPlugin.id,"-expend-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(e.jSPlugin.id,"-expend-content")).children[0].children[0].style="display:none"),document.getElementById("".concat(e.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(e.jSPlugin.id,"-webExpend")).className="disabled")):(document.getElementById("".concat(e.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(e.jSPlugin.id,"-expend-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(e.jSPlugin.id,"-expend-content")).children[0].children[1].style="display:none"),document.getElementById("".concat(e.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(e.jSPlugin.id,"-webExpend")).className="")),document.getElementById("".concat(e.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(e.jSPlugin.id,"-expend")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-expend-content")).childNodes[0].childNodes[0].style.fill=A[t]?o:r,document.getElementById("".concat(e.jSPlugin.id,"-expend-content")).childNodes[0].childNodes[1].style.fill=A[t]?o:r);break;case"hd":break;case"speed":if(document.getElementById("".concat(e.jSPlugin.id,"-speed"))){var s=document.getElementById("".concat(e.jSPlugin.id,"-speed-content")).children[1].children[0];"not-allowed"!==s.style.cursor&&(s.style.color=A[t]?o:r,s.style.borderColor=A[t]?o:r)}document.getElementById("".concat(e.jSPlugin.id,"-select-mask"))&&(e.isMobile&&A[t]?document.getElementById("".concat(e.jSPlugin.id,"-select-mask")).style.display="block":document.getElementById("".concat(e.jSPlugin.id,"-select-mask")).style.display="none");break;case"cloudRec":document.getElementById("".concat(e.jSPlugin.id,"-cloudRec"))&&(document.getElementById("".concat(e.jSPlugin.id,"-cloudRec")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-cloudRec-content")).children[0].children[0].style.fill=A[t]?o:r),document.getElementById("".concat(e.jSPlugin.id,"-rec"))&&(document.getElementById("".concat(e.jSPlugin.id,"-rec")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-rec-content")).children[0].children[0].style.fill=A[t]?r:o);break;case"cloudRecord":var g=document.getElementById("".concat(e.jSPlugin.id,"-cloudRecord"));g&&(g.className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-cloudRecord-content")).children[0].children[0].style.fill=A[t]?o:r),document.getElementById("".concat(e.jSPlugin.id,"-rec"))&&(document.getElementById("".concat(e.jSPlugin.id,"-rec")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-rec-content")).children[0].children[0].style.fill=A[t]?r:o);break;case"rec":document.getElementById("".concat(e.jSPlugin.id,"-cloudRec"))&&(document.getElementById("".concat(e.jSPlugin.id,"-cloudRec")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-cloudRec-content")).children[0].children[0].style.fill=A[t]?r:o),document.getElementById("".concat(e.jSPlugin.id,"-cloudRecord"))&&(document.getElementById("".concat(e.jSPlugin.id,"-cloudRecord")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-cloudRecord-content")).children[0].children[0].style.fill=A[t]?r:o),document.getElementById("".concat(e.jSPlugin.id,"-rec"))&&(document.getElementById("".concat(e.jSPlugin.id,"-rec")).className=A[t]?"active":"",document.getElementById("".concat(e.jSPlugin.id,"-rec-content")).children[0].children[0].style.fill=A[t]?o:r)}e.decoderState.state=Object.assign(e.decoderState.state,A)}))}},{key:"startAutoFocus",value:function(){var A=this,e=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById("".concat(A.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(A.jSPlugin.id,"-audioControls")).style.opacity=0,document.getElementById("".concat(A.jSPlugin.id,"-audioControls")).style.pointerEvents="none")}),1e3*e)}},{key:"stopAutoFocus",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer)}},{key:"hideFooter",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.display="none")}},{key:"showFooter",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.display="block")}},{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}},{key:"renderFooter",value:function(A,e){var t=this,i=this.matchBtn(A),n=document.createElement("div");n.className="theme-icon-item",n.innerHTML="".concat('')+'
')).concat(i.domString,"
")+"
",n.onclick=function(A){if(t.decoderState.state.isEditing)return!1;i.onclick(A)},i.onmouseenter&&(n.onmouseenter=function(A){if(t.decoderState.state.isEditing)return!1;i.onmouseenter(A)}),i.onmouseleave&&(n.onmouseleave=function(A){if(t.decoderState.state.isEditing)return!1;i.onmouseleave(A)});var a=document.createElement("span");a.className="icon-move left",a.innerHTML=''),a.onclick=function(){t.editIcon(i.id,"left","footer")},n.appendChild(a);var r=document.createElement("span");r.className="icon-move right",r.innerHTML=''),r.onclick=function(){t.editIcon(i.id,"right","footer")},n.appendChild(r);var o=document.createElement("span");o.className="icon-move close",o.innerHTML='')+'',o.onclick=function(){t.editIcon(i.id,"delete","footer")},n.appendChild(o),"left"===e?document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).childNodes[0].appendChild(n):document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).childNodes[1].appendChild(n)}},{key:"editIcon",value:function(A,e,t){var i=this.themeData;console.log("themeData",this.themeData);var n=this.themeData[t].btnList,a=M.findIndex(n,(function(e){return e.iconId===A})),r=n[a];switch(e){case"delete":if("rec"===A){if(-1===M.findIndex(n,(function(A){return"cloudRec"===A.iconId&&1==A.isrender})))return this.jSPlugin.Message&&this.jSPlugin.Message.default("必须选中一种存储介质"),!1}else if("cloudRec"===A&&-1===M.findIndex(n,(function(A){return"rec"===A.iconId&&1==A.isrender})))return this.jSPlugin.Message&&this.jSPlugin.Message.default("必须选中一种存储介质"),!1;n[a].isrender=0;break;case"right":for(var o=-1,s=a+1;s=0;c--)if(n[c].part===n[a].part&&1==n[c].isrender){g=c;break}-1!==g&&(n[a]=n[g],n[g]=r)}i[t].btnList=n,this.changeTheme(i)}},{key:"renderHeader",value:function(A,e){var t=this,i=this.matchBtn(A),n=document.createElement("div");n.className="theme-icon-item",n.style="max-width:50%;",n.innerHTML="".concat('')+'')).concat(i.domString,"")+'',n.onclick=function(A){if(t.decoderState.state.isEditing)return!1;i.onclick(A)};var a=document.createElement("span");a.className="icon-move close",a.innerHTML='')+'',a.onclick=function(){t.editIcon(i.id,"delete","header")},n.appendChild(a),"left"===e?document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[0].appendChild(n):document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[1].appendChild(n)}},{key:"countTime",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var i=document.createElement("div");i.id=this.jSPlugin.id+"time-area",i.className="time-area",i.innerHTML='00:00',document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).appendChild(i)}if(this.countTimer&&clearInterval(this.countTimer),"add"===A){var n=e;document.getElementById(t.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++n,document.getElementById(t.jSPlugin.id+"time-area").children[1].innerHTML=function(A){var e=parseInt(A),t=0,i=0,n="00",a="00",r="00";e>59&&(t=parseInt(e/60),e=parseInt(e%60),t>59&&(i=parseInt(t/60),t=parseInt(t%60)));return n=parseInt(e)>9?parseInt(e):"0"+parseInt(e),a=parseInt(t)>9?parseInt(t):"0"+parseInt(t),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?r+":"+a+":"+n:t>0?a+":"+n:"00:"+n}(n)}),1e3)}else"destroy"===A&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(t.jSPlugin.id+"time-area")&&(document.getElementById(t.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(t.jSPlugin.id+"time-area").style.display="none"))}},{key:"setDisabled",value:function(A){var e=this.decoderState.state,t=e.sound,i=e.expend,n=A?"cursor: not-allowed; color: gray; fill: gray; ":"cursor: default";null!=document.getElementById("".concat(this.jSPlugin.id,t?"-sound-icon":"-nosound-icon"))&&document.getElementById("".concat(this.jSPlugin.id,t?"-sound-icon":"-nosound-icon")).setAttribute("style",A?"cursor: not-allowed; color: gray; fill: gray;":"cursor: default"),null!=document.getElementById("".concat(this.jSPlugin.id,"-recordvideo-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-recordvideo-icon")).setAttribute("style",n),null!=document.getElementById("".concat(this.jSPlugin.id,"-capturePicture-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-capturePicture-icon")).setAttribute("style",n),null!=document.getElementById("".concat(this.jSPlugin.id,"-talk-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-talk-icon")).setAttribute("style",n),null!=document.getElementById("".concat(this.jSPlugin.id,i?"-unexpend-icon":"-expend-icon"))&&document.getElementById("".concat(this.jSPlugin.id,i?"-unexpend-icon":"-expend-icon")).setAttribute("style",n),this.allowZoom||null!=document.getElementById("".concat(this.jSPlugin.id,"-zoom-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-zoom-icon")).setAttribute("style",n),document.getElementById("".concat(this.jSPlugin.id,"-pantile-icon"))&&"none"!=document.getElementById("".concat(this.jSPlugin.id,"-pantile-icon")).style.display&&document.getElementById("".concat(this.jSPlugin.id,"-pantile-icon")).setAttribute("style",n);var a=document.getElementsByClassName("".concat(this.jSPlugin.id,"-select-quality-btn"));if(a.length)for(var r=0;r'+'')+'')+'',a.onclick=function(){var A=e.decoderState.state,t=A.play,i=A.isEditing,n=A.rec,a=A.cloudRec,r=A.recordvideo,o=A.pantile,s=A.expend;if(i)return!1;window.recTimer&&Array.isArray(window.recTimer[e.jSPlugin.id])&&(window.recTimer[e.jSPlugin.id].map((function(A){clearInterval(A)})),window.recTimer[e.jSPlugin.id]=[]),t?(n||a?(e.Rec&&e.Rec.unSyncTimeLine(),e.jSPlugin.pause().then((function(){e.setDecoderState({play:!t}),e.setDisabled(t)}))):(e.jSPlugin.stop((function(){}),!0).then((function(){e.setDecoderState({play:!t}),e.setDisabled(t)})),e.jSPlugin.Zoom.stopZoom(),e.jSPlugin.close3DZoom()),r&&e.setDecoderState({recordvideo:!1})):(n||a?(e.Rec&&e.Rec.syncTimeLine(),e.jSPlugin.resume().then((function(){e.setDisabled(t),e.setDecoderState({play:!t,expend:s})}))):e.jSPlugin.play().then((function(){e.setDisabled(t),e.setDecoderState({play:!t,expend:s})})),e.jSPlugin.use3DZoom&&e.resetMobileZoomStatus()),e.jSPlugin.use3DZoom?(e.setDecoderState({zoom:!1}),e.allowZoom=!1):e.allowZoom=n||a,o&&e.Ptz&&(e.Ptz.hide(),e.setDecoderState({pantile:!1})),document.getElementById("".concat(e.jSPlugin.id,"-speedSelect"))&&(document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).style.display="none"),e.setDecoderState({speed:!1})};break;case"sound":a.title=this.jSPlugin.i18n.t("BTN_SOUND"),a.id=A,a.domString=''+'')+'\n \n \n \n \n ')+"",a.onclick=function(){var A=e.decoderState.state,t=A.play,i=A.sound,n=A.talk,a=A.pantile;t&&!n&&(i?(e.jSPlugin.closeSound(),e.setDecoderState({sound:!1})):(e.jSPlugin.openSound(),e.setDecoderState({sound:!0})),a&&e.Ptz&&(e.Ptz.hide(),e.setDecoderState({pantile:!1})))};break;case"recordvideo":if(r)break;a.title=this.jSPlugin.i18n.t("BTN_RECORDVIDEO"),a.id=A,a.domString='')+'',a.onclick=function(){var A=e.decoderState.state,t=A.play,i=A.recordvideo;t&&(i?(e.jSPlugin.stopSave(),e.setDecoderState({recordvideo:!1})):(e.jSPlugin.startSave("".concat((new Date).getTime())),e.setDecoderState({recordvideo:!0})))};break;case"capturePicture":a.title=this.jSPlugin.i18n.t("BTN_CAPTURE"),a.id=A,a.domString='')+'',a.onclick=function(){e.decoderState.state.play?e.jSPlugin.capturePicture("".concat((new Date).getTime()),(function(){}),e.jSPlugin.download):console.log("视频未播放,无法截图")};break;case"talk":if(r)break;a.title=this.jSPlugin.i18n.t("BTN_TALK"),a.id=A,a.domString='
TA?8:5,"px; position: absolute; left: ").concat(this.jSPlugin.width>TA?20:13,"px; top: ").concat(this.jSPlugin.width>TA?14:9,'px; border-radius: 50%; overflow:hidden;">')+'')+"
"+'')+'',this.jSPlugin.eventEmitter.on("volumeChange",(function(A){var t=A.data;document.getElementById("".concat(e.jSPlugin.id,"-volume-column")).style.height="".concat(100*t,"%")})),a.onclick=function(){var A=e.decoderState.state,t=A.talk,i=A.sound;if(A.play)if(t){e.setDecoderState({talk:!1}),document.getElementById("".concat(e.jSPlugin.id,"-volume-column")).style.display="none",e.jSPlugin.Talk.stopTalk();var n=M.findIndex(e.themeData.footer.btnList,(function(A){return"sound"===A.iconId&&1===A.isrender&&1===A.defaultActive}))>-1;e.themeData&&n&&(e.jSPlugin.openSound(),e.setDecoderState({sound:!0}))}else e.setDecoderState({talk:!0}),document.getElementById("".concat(e.jSPlugin.id,"-volume-column")).style.display="block",e.jSPlugin.Talk.startTalk((function(A){i&&!A&&(e.jSPlugin.closeSound(),e.setDecoderState({sound:!1}))}))};break;case"zoom":if(r)break;a.title=this.jSPlugin.use3DZoom?this.jSPlugin.i18n.t("BTN_3D_ZOOM"):this.jSPlugin.i18n.t("BTN_ZOOM"),a.id=A,a.domString="
"+'\n \n \n \n \n '),a.onclick=function(){var A=e.decoderState.state,t=A.zoom,i=A.play,n=A.rec,a=A.cloudRec;if(e.jSPlugin.use3DZoom){if(!i)return!1;t?e.jSPlugin.close3DZoom():e.jSPlugin.enable3DZoom()}else{if(e.zoomDisable||!n&&!a&&!i)return!1;t?e.jSPlugin.Zoom.stopZoom():e.jSPlugin.Zoom.startZoom()}e.setDecoderState({zoom:!t})};break;case"pantile":if(r)break;a.title=this.jSPlugin.i18n.t("BTN_PTZ"),a.id=A,a.domString='')+'',a.onclick=function(){var A=e.decoderState.state,t=A.play,i=A.pantile,n=A.expend;if(t)if(i)e.Ptz.hide(),e.setDecoderState({pantile:!1});else{if(e.isMobile&&!n)return console.log("移动端,非全屏状态不展示云台"),!1;e.Ptz.show(),e.setDecoderState({pantile:!0})}};break;case"expend":a.title=this.jSPlugin.i18n.t("BTN_EXPEND"),a.id=A,a.domString='')+''+'\n '),a.onclick=function(){var A=e.decoderState.state,t=A.expend,i=A.pantile;if(A.play)if(e.setDecoderState({expend:!t}),t)if(e.isMobile){var n=e._extendHeadeTimeLinrHight(!1,!0),a=document.getElementById("".concat(e.jSPlugin.id,"-headControl"));document.getElementById("".concat(e.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(e.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="-32px"),a&&(a.style.position="relative"),document.getElementById("".concat(e.jSPlugin.id,"-select-speed"))&&(document.getElementById("".concat(e.jSPlugin.id,"-select-speed")).style.background="#ffffff"),function(A,e,t){var i="";i+="width:"+e+"px;",i+="height:"+t+"px;",i+="-webkit-transform: none; transform: none;",i+="-webkit-transform-origin: 0 0;",i+="transform-origin: 0 0;",A.style.cssText=i}(document.getElementById("".concat(e.jSPlugin.id,"-wrap")),e.jSPlugin.width,e.jSPlugin.height),e.jSPlugin.jSPlugin.JS_Resize(e.jSPlugin.width,e.jSPlugin.height-n),i&&e.Ptz&&(e.Ptz.hide(),e.setDecoderState({pantile:!1})),e.jSPlugin.fullScreenWidth=e.jSPlugin.width,e.jSPlugin.fullScreenHeight=e.jSPlugin.height,e.jSPlugin.Zoom&&e.jSPlugin.Zoom.handleFullscreen&&e.jSPlugin.Zoom.handleFullscreen(!t,e.jSPlugin.width,e.jSPlugin.height),document.getElementById("".concat(e.jSPlugin.id,"-pantile-icon"))&&(document.getElementById("".concat(e.jSPlugin.id,"-pantile-icon")).style.display="none"),document.getElementById("".concat(e.jSPlugin.id,"-hdSelect"))&&(document.getElementById("".concat(e.jSPlugin.id,"-hdSelect")).style.bottom="calc(constant(safe-area-inset-bottom) + 100px)",document.getElementById("".concat(e.jSPlugin.id,"-hdSelect")).style.bottom="calc(env(safe-area-inset-bottom) + 100px)",document.getElementById("".concat(e.jSPlugin.id,"-hdSelect")).style.height=45*e.jSPlugin.videoLevelList.length+"px")}else m();else if(e.isMobile){var r=e._extendHeadeTimeLinrHight(!1,!0);x(document.getElementById("".concat(e.jSPlugin.id,"-wrap")));var o=document.documentElement.clientWidth,s=document.documentElement.clientHeight;document.getElementById("".concat(e.jSPlugin.id))&&(document.getElementById("".concat(e.jSPlugin.id)).style["backface-visibility"]="hidden"),document.getElementById("".concat(e.jSPlugin.id,"-select-speed"))&&(document.getElementById("".concat(e.jSPlugin.id,"-select-speed")).style.background="none"),e.jSPlugin.jSPlugin.JS_Resize(s,o-r,!0),e.jSPlugin.fullScreenWidth=s,e.jSPlugin.fullScreenHeight=o-r,e.jSPlugin.Zoom&&e.jSPlugin.Zoom.handleFullscreen&&e.jSPlugin.Zoom.handleFullscreen(!t,s,o-r),document.getElementById("".concat(e.jSPlugin.id,"-pantile-icon"))&&(document.getElementById("".concat(e.jSPlugin.id,"-pantile-icon")).style.display="block"),document.getElementById("".concat(e.jSPlugin.id,"-hdSelect"))&&(document.getElementById("".concat(e.jSPlugin.id,"-hdSelect")).style.bottom=0,document.getElementById("".concat(e.jSPlugin.id,"-hdSelect")).style.height="100%")}else{o=window.screen.width,s=window.screen.height;p(document.getElementById("".concat(e.jSPlugin.id))).then((function(A){e.jSPlugin.jSPlugin.JS_Resize(o,s),e.jSPlugin.fullScreenWidth=o,e.jSPlugin.fullScreenHeight=s})).catch((function(A){console.log(A)})),e.jSPlugin.close3DZoom(),e.setDecoderState({speed:!1})}};break;case"webExpend":if(r)break;a.title=this.jSPlugin.i18n.t("BTN_WEBEXPEND"),a.id=A,a.domString='')+''+'",a.onclick=function(){var A=e.decoderState.state,t=A.webExpend;if(A.expend)return console.log("正在全局全屏"),!1;if(window.recTimer&&Array.isArray(window.recTimer[e.jSPlugin.id])&&(window.recTimer[e.jSPlugin.id].map((function(A){clearInterval(A)})),window.recTimer[e.jSPlugin.id]=[]),t)m();else{var i=window.screen.width,n=window.screen.height;p(document.getElementById("".concat(e.jSPlugin.id,"-wrap"))).then((function(){e.jSPlugin.jSPlugin.JS_Resize(i,n-e._extendHeadeTimeLinrHight(!1,!1))}))}e.jSPlugin.Theme.Rec&&setTimeout((function(){e.jSPlugin.Theme.Rec.recAutoSize()}),100),e.setDecoderState({webExpend:!t})};break;case"hd":if(r)break;var o="".concat(this.jSPlugin.id,"-select-quality"),s="".concat(o,"-item");a.title=this.jSPlugin.i18n.t("BTN_HD"),a.id=A;var g="",c="";return this.jSPlugin.videoLevelList.findIndex((function(A){return A.level==e.jSPlugin.videoLevel}))>-1?this.jSPlugin.videoLevelList.map((function(A){g+='
  • ').concat(e.jSPlugin.i18n.t(RA[A.level]),"
  • "),A.level==e.jSPlugin.videoLevel&&(c+=e._videoLevelIcon(e.jSPlugin.id,o,e.jSPlugin.width,TA,A))})):this.jSPlugin.videoLevelList.map((function(A,t){0===t&&(c+=e._videoLevelIcon(e.jSPlugin.id,o,e.jSPlugin.width,TA,A)),g+='
  • ').concat(e.jSPlugin.i18n.t(RA[A.level]),"
  • ")})),g+='
  • ').concat(this.jSPlugin.i18n.t("SPEED_CANCEL"),"
  • "),c+=''),a.domString='\n \n ').concat(c,"\n "),a.onclick=function(A){var t=e.decoderState.state,i=t.expend,n=t.recordvideo,a=t.play,r=t.zoom,s=t.pantile;if(A.stopPropagation(),a){var g=A.target.id,c=A.target.getAttribute("data-type");if(0===g.indexOf(o)){if(e.jSPlugin.videoLevel+""!==c){var l=e.jSPlugin.videoLevelList.find((function(A){return A.level+""===c}));!l||l.streamTypeIn===e.jSPlugin.streamTypeIn&&l.level+""==e.jSPlugin.videoLevel+""||(e.jSPlugin.changeVideoLevel(l),r&&e.jSPlugin.Zoom.stopZoom())}e.resetMobileZoomStatus(),n&&e.setDecoderState({recordvideo:!1})}e.showHD=!e.showHD,document.getElementById("".concat(e.jSPlugin.id,"-hdSelect"))&&(document.getElementById("".concat(e.jSPlugin.id,"-hdSelect")).style.display="none"===document.getElementById("".concat(e.jSPlugin.id,"-hdSelect")).style.display?"block":"none",e.isMobile&&(document.getElementById("".concat(e.jSPlugin.id,"-select-hd-mask")).style.display="none"===document.getElementById("".concat(e.jSPlugin.id,"-select-hd-mask")).style.display?"block":"none"),e.themeData.autoFocus>0&&("none"===document.getElementById("".concat(e.jSPlugin.id,"-hdSelect")).style.display?e.startAutoFocus():e.stopAutoFocus())),e.isMobile&&i&&e.showHD?document.getElementById("".concat(e.jSPlugin.id,"-hdSelect")).className="hd speed-select mobile expend":document.getElementById("".concat(e.jSPlugin.id,"-hdSelect")).className=e.isMobile?"hd speed-select mobile":"speed-select",s&&e.Ptz&&(e.Ptz.hide(),e.setDecoderState({pantile:!1}))}},a;case"speed":if(r)break;a.title=this.jSPlugin.i18n.t("BTN_SPEED"),a.id=A,a.domString='"+'\n
    ').concat(1===this.nextRate?this.jSPlugin.i18n.t("SPEED"):"".concat(this.nextRate).concat(this.jSPlugin.i18n.t("SPEED_RATE")).replace("3","0.5"),"
    \n ")+'')+"
    ",a.onclick=function(A){var t=e.decoderState.state,i=t.speed,n=t.expend,a=t.play;if(A.stopPropagation(),!a)return!1;if(!i&&e.isMobile&&(document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).className=n?"speed speed-select mobile expend":"speed speed-select mobile"),e.isMobile&&(n?(document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).style.bottom="constant(safe-area-inset-bottom)",document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).style.bottom="env(safe-area-inset-bottom)"):(document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).style.bottom="calc(constant(safe-area-inset-bottom) + 100px)",document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).style.bottom="calc(env(safe-area-inset-bottom) + 100px)")),e.nextRate=1,A.target.id)switch(A.target.id){case"".concat(e.jSPlugin.id,"-select-speed1"):e.nextRate=1,e.jSPlugin.jSPlugin.JS_Speed(e.nextRate),e.changeRecSpeed(1),e.jSPlugin.speed=1,e.setDecoderState({speed:!i});break;case"".concat(e.jSPlugin.id,"-select-speed2"):e.nextRate=2,e.jSPlugin.jSPlugin.JS_Speed(e.nextRate),e.changeRecSpeed(2),e.jSPlugin.speed=2,e.setDecoderState({speed:!i});break;case"".concat(e.jSPlugin.id,"-select-speed4"):e.nextRate=4,e.jSPlugin.jSPlugin.JS_Speed(e.nextRate),e.changeRecSpeed(4),e.jSPlugin.speed=4,e.setDecoderState({speed:!i});break;case"".concat(e.jSPlugin.id,"-select-speed05"):e.nextRate=3,e.jSPlugin.jSPlugin.JS_Speed(e.nextRate),e.changeRecSpeed(.5),e.jSPlugin.speed=.5,e.setDecoderState({speed:!i});break;default:e.isMobile?e.setDecoderState({speed:!i}):e.setDecoderState({speed:!0})}e.isMobile&&A.target.id==="".concat(e.jSPlugin.id,"-speed-text")?document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).style.display="block":document.getElementById("".concat(e.jSPlugin.id,"-speedSelect"))&&(document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).style.display="none"===document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).style.display?"block":"none"),e.setDecoderState({speed:!i}),e.themeData.autoFocus>0&&("none"===document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).style.display?e.startAutoFocus():e.stopAutoFocus())};break;case"deviceName":a.title=this.jSPlugin.i18n.t("DEVICE_NAME"),a.id=A,a.domString="".concat(this.jSPlugin.i18n.t("DEVICE_NAME"),""),a.onclick=function(){};break;case"deviceID":a.title=this.jSPlugin.i18n.t("DEVICE_ID"),a.id=A,a.domString="".concat(this.jSPlugin.i18n.t("DEVICE_ID"),""),a.onclick=function(){};break;case"cloudRec":if(this.jSPlugin._isCloudRecord)break;a.title=this.jSPlugin.i18n.t("BTN_CLOUDREC"),a.id=A,a.domString='\n \n \n\t\n\t\n\t\n \n \n '),a.onclick=function(){e.setDecoderState({type:"cloud.rec",cloudRec:!0,rec:!1}),e.jSPlugin.eventEmitter.emit("recTypeChange",{eventType:"recTypeChange",code:0,data:{type:"cloud"}}),e.jSPlugin.changePlayUrl({type:"cloud.rec"},(function(){var A=f("begin",e.jSPlugin.url)||(new Date).Format("yyyyMMdd");e.Rec.renderRec("".concat(A.slice(0,4),"-").concat(A.slice(4,6),"-").concat(A.slice(6,8))),e.decoderState.state.zoom&&(e.setDecoderState({zoom:!1}),e.jSPlugin.Zoom.stopZoom(),e.jSPlugin.close3DZoom())}),!1)};break;case"cloudRecord":if(!this.jSPlugin._isCloudRecord)break;a.title=this.jSPlugin.i18n.t("BTN_CLOUDRECORD"),a.id=A,a.domString=' \n\n\n\t\n\t\n\t\n\t'),a.onclick=function(){e.setDecoderState({type:"cloud.rec",cloudRec:!0,rec:!1}),e.jSPlugin.eventEmitter.emit("recTypeChange",{eventType:"recTypeChange",code:0,data:{type:"cloudRecord"}}),e.jSPlugin.url.replace(/rec\??|cloud.rec\??/,"cloud.rec?busType=7"),e.jSPlugin.changePlayUrl({type:"cloud.rec"},(function(){e.jSPlugin._isCloudRecord&&e.changeTheme("pcRec");var A=f("begin",e.jSPlugin.url)||(new Date).Format("yyyyMMdd");e.Rec.renderRec("".concat(A.slice(0,4),"-").concat(A.slice(4,6),"-").concat(A.slice(6,8))),e.decoderState.state.zoom&&(e.setDecoderState({zoom:!1}),e.jSPlugin.Zoom.stopZoom(),e.jSPlugin.close3DZoom())}),!1)};break;case"rec":a.title=this.jSPlugin.i18n.t("BTN_REC"),a.id=A,a.domString='\n \n \n \n\n\n\n \n \n '),a.onclick=function(){e.setDecoderState({type:"rec",cloudRec:!1,rec:!0}),e.jSPlugin.eventEmitter.emit("recTypeChange",{eventType:"recTypeChange",code:0,data:{type:"local"}}),e.jSPlugin.changePlayUrl({type:"rec"},(function(){e.jSPlugin._isCloudRecord&&e.changeTheme("pcRec");var A=f("begin",e.jSPlugin.url)||(new Date).Format("yyyyMMdd");e.Rec.renderRec("".concat(A.slice(0,4),"-").concat(A.slice(4,6),"-").concat(A.slice(6,8))),e.decoderState.state.zoom&&(e.setDecoderState({zoom:!1}),e.jSPlugin.Zoom.stopZoom(),e.jSPlugin.close3DZoom())}),!1)}}return a}},{key:"_videoLevelIcon",value:function(A,e,t,i,n){return'\n i?48:32,"px;line-height: ").concat(t>i?48:30,'px;text-align: center;">\n ').concat(this.jSPlugin.i18n.t(RA[n.level]),"\n \n ")}},{key:"_warpFullScreen",value:function(){var A=this,e=document.getElementById("".concat(this.jSPlugin.id,"-wrap")),t=this,i=function(){var e=t.decoderState.state,i=e.webExpend,n=e.expend,a=e.zoom;document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen?i?A.jSPlugin.eventEmitter&&A.jSPlugin.eventEmitter.emit("fullScreen",{eventType:"fullScreen",code:0,target:A,msg:"web 全屏"}):n&&(t.setDecoderState({expend:!1}),a&&t.jSPlugin.use3DZoom&&t.jSPlugin.enable3DZoom(),A.jSPlugin.eventEmitter&&A.jSPlugin.eventEmitter.emit("fullScreen",{eventType:"fullScreen",code:0,target:A,msg:"全局全屏"})):(t.jSPlugin.jSPlugin.JS_Resize(t.jSPlugin.width,t.jSPlugin.height-A._extendHeadeTimeLinrHight(!1,!1)),A.jSPlugin.eventEmitter&&A.jSPlugin.eventEmitter.emit("cancelFullScreen",{eventType:"cancelFullScreen",code:0,target:A,msg:"退出全局全屏"})),A.setDecoderState({speed:!1})};["fullscreenchange","webkitfullscreenchange","mozfullscreenchange"].forEach((function(A){e.removeEventListener(A,i),e.addEventListener(A,i)}))}},{key:"changeRecSpeed",value:function(A){var e=this,t=function(A){if(!document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")))return!1;document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).childNodes[0].className=document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).childNodes[0].className.replace("active","default"),document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).childNodes[1].className=document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).childNodes[1].className.replace("active","default"),document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).childNodes[2].className=document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).childNodes[2].className.replace("active","default"),document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).childNodes[3].className=document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).childNodes[3].className.replace("active","default"),document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).childNodes[A].className=document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).childNodes[A].className.replace("default","active")},i="1";switch(A){case 1:t(2),i=this.jSPlugin.i18n.t("SPEED");break;case 2:t(1),i="".concat(A).concat(this.jSPlugin.i18n.t("SPEED_RATE"));break;case 4:t(0),i="".concat(A).concat(this.jSPlugin.i18n.t("SPEED_RATE"));break;case.5:t(3),i="".concat(A).concat(this.jSPlugin.i18n.t("SPEED_RATE"));break;default:t(2),i="".concat(A).concat(this.jSPlugin.i18n.t("SPEED_RATE"))}document.getElementById("".concat(this.jSPlugin.id,"-speed-text"))&&(document.getElementById("".concat(this.jSPlugin.id,"-speed-text")).innerHTML=i)}},{key:"initThemeData",value:function(){var A=this,e=this.themeData,t=e.header,i=e.footer,n=this.jSPlugin.id;if(this.header=J,this.footer=H,this.isNeedRenderHeader=M.findIndex(t.btnList,(function(A){return A.isrender>0}))>=0&&"miniRec"!=this.jSPlugin.id,this.isMobile&&(this.isNeedRenderHeader=M.findIndex(t.btnList,(function(A){return A.isrender>0&&"deviceID"===A.iconId||A.isrender>0&&"deviceName"===A.iconId}))>=0&&"miniRec"!=this.jSPlugin.id),this.isNeedRenderFooter=M.findIndex(i.btnList,(function(A){return A.isrender>0}))>=0&&"miniRec"!=this.jSPlugin.id,this.isNeedRenderTimeLine=M.findIndex(t.btnList,(function(A){return"cloudRec"===A.iconId&&1===A.isrender||"rec"===A.iconId&&1===A.isrender}))>=0&&!this.jSPlugin.disabledTimeLine&&"miniRec"!=this.jSPlugin.id,["date-switch-container-wrap","rec-type-container-wrap","mobile-rec-wrap","mobile-ez-ptz-container"].forEach((function(A,e){document.getElementById(A)&&document.getElementById(A).parentElement.removeChild(document.getElementById(A))})),this.isNeedRenderHeader)if(document.getElementById("".concat(this.jSPlugin.id,"-headControl")))document.getElementById("".concat(this.jSPlugin.id,"-headControl")).innerHTML="
    ");else{var a=document.createElement("div");a.setAttribute("id","".concat(this.jSPlugin.id,"-headControl")),a.setAttribute("class","header-controls"),a.innerHTML="
    ");var o={height:this.jSPlugin.width>TA?"48px":"32px","line-height":this.jSPlugin.width>TA?"48px":"32px",display:"flex","justify-content":"space-between",top:0,"z-index":1,background:"#000000",color:"#FFFFFF",width:"100%"};a.style=NA(o),document.getElementById("".concat(n,"-wrap")).insertBefore(a,document.getElementById(n));var s=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(s)}),50)}else document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-headControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-headControl")));if(this.isNeedRenderFooter)if(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")))document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="-".concat(this.jSPlugin.width>TA?48:32,"px"),document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='"));else{var g=document.createElement("div");g.setAttribute("id","".concat(this.jSPlugin.id,"-ez-iframe-footer-container")),g.setAttribute("class","ez-iframe-footer-container");var c={"min-height":this.jSPlugin.width>TA?"48px":"32px","max-height":this.jSPlugin.width>TA?"96px":"80px",position:"relative","margin-top":this.jSPlugin.width>TA?"-48px":"-32px",display:"flex","flex-wrap":"wrap","justify-content":"space-between","z-index":999,top:0,color:"#FFFFFF",width:"100%"};g.style=NA(c),g.innerHTML='"),Q(g,document.getElementById(n))}else document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")));if(this.isNeedRenderHeader&&document.getElementById("".concat(this.jSPlugin.id,"-headControl"))){document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=t.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=t.color;var l,I=r(t.btnList);try{for(I.s();!(l=I.n()).done;){var d=l.value;if(d.isrender)try{this.renderHeader(d.iconId,d.part)}catch(A){}}}catch(A){I.e(A)}finally{I.f()}}if(this.isNeedRenderFooter&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))){document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=i.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=i.color;var C,h=r(i.btnList);try{for(h.s();!(C=h.n()).done;){var u=C.value;if(u.isrender)try{this.renderFooter(u.iconId,u.part)}catch(A){}}}catch(A){h.e(A)}finally{h.f()}}if(this.isNeedRenderTimeLine)if(this.isMobile)document.getElementById("".concat(this.jSPlugin.id,"-headControl-right"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl-right")).style.display="none"),this.Rec=new sA(this.jSPlugin,this.changeRecSpeed,this.resetMobileZoomStatus);else{this.Rec?this.Rec.recInit():(this.jSPlugin.decoderState=this.decoderState,this.jSPlugin.setDecoderState=this.setDecoderState,this.Rec=new nA(this.jSPlugin));var B=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(B)}),50)}M.findIndex(this.themeData.footer.btnList,(function(A){return"pantile"===A.iconId&&1===A.isrender}))>=0&&!this.jSPlugin.disabledPTZ&&(this.isMobile&&(this.MobilePtz=new fA(this.jSPlugin)),this.Ptz=new gA(this.jSPlugin));var E=function(){var e=A,t=e.decoderState.state,i=t.expend,n=t.zoom,a=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen;e.Rec&&window.randomNum==e.jSPlugin.randomNum&&setTimeout((function(){e.Rec.recAutoSize((function(){if(e.jSPlugin.Zoom.currentScale>1){var A=e.jSPlugin.Zoom.currentScale;e.jSPlugin.Zoom.stopZoom(),setTimeout((function(){e.jSPlugin.Zoom.startZoom(),e.jSPlugin.Zoom.currentScale=A,e.jSPlugin.Zoom.doScale(A)}),200)}}))}),100),a||(i&&n&&e.jSPlugin.use3DZoom&&e.jSPlugin.enable3DZoom(),e.setDecoderState({webExpend:!1,expend:!1})),document.getElementById("".concat(e.jSPlugin.id,"-hdSelect"))&&(document.getElementById("".concat(e.jSPlugin.id,"-hdSelect")).style.display="none"),document.getElementById("".concat(e.jSPlugin.id,"-speedSelect"))&&(document.getElementById("".concat(e.jSPlugin.id,"-speedSelect")).style.display="none"),e.isMobile&&(document.getElementById("".concat(e.jSPlugin.id,"-select-hd-mask"))&&(document.getElementById("".concat(e.jSPlugin.id,"-select-hd-mask")).style.display="none"),document.getElementById("".concat(e.jSPlugin.id,"-select-mask"))&&(document.getElementById("".concat(e.jSPlugin.id,"-select-mask")).style.display="none")),e.themeData.autoFocus>0&&e.startAutoFocus()};if(["fullscreenchange","webkitfullscreenchange","mozfullscreenchange"].forEach((function(A,e){window.onFullscreenChange&&document.removeEventListener(A,window.onFullscreenChange),document.addEventListener(A,E),window.onFullscreenChange=E})),this.themeData.poster){this.jSPlugin.poster=this.themeData.poster;var f=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(f),A.jSPlugin.setPoster(A.themeData.poster))}),50)}this.inited=!0,this.jSPlugin.deviceInfo&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content"))&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).style.maxWidth="100%",document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).style.overflow="hidden",document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).style.textOverflow="ellipsis",document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).style.whiteSpace="nowrap",document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).innerHTML=this.jSPlugin.deviceInfo.deviceName),document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content"))&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).style.maxWidth="100%",document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).style.overflow="hidden",document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).style.textOverflow="ellipsis",document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).style.whiteSpace="nowrap",document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).innerHTML=y(this.jSPlugin.url).deviceSerial)),this.renderThemeData()}},{key:"resetMobileZoomStatus",value:function(){if(this.isMobile){var A=document.getElementById("".concat(this.jSPlugin.id,"-zoom-container"));A&&A.style&&"none"!=A.style.display&&(A.style.display="none"),this.jSPlugin.jSPlugin.Zoom&&this.jSPlugin.jSPlugin.Zoom.resetZoom()}}},{key:"editStart",value:function(A){var e=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),t=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));t&&t.setAttribute("class","header-controls themeEditing"),e&&e.setAttribute("class","footer-controls themeEditing"),this.setDecoderState({isEditing:!0})}},{key:"editEnd",value:function(A){var e=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),t=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));t&&t.setAttribute("class","header-controls"),e&&e.setAttribute("class","footer-controls"),this.setDecoderState({isEditing:!1})}},{key:"webExpend",value:function(){var A=this,e=this.decoderState.state;e.webExpend;var t=e.expend;return!!e.play&&(t?(console.log("正在全局全屏"),!1):void p(document.getElementById("".concat(this.jSPlugin.id,"-wrap"))).then((function(e){A.jSPlugin.jSPlugin.JS_Resize(window.screen.width,window.screen.height-A._extendHeadeTimeLinrHight(!1,!1))})).catch((function(A){console.log(A)})))}},{key:"expend",value:function(){var A=this,e=this.decoderState.state,t=e.webExpend;if(!e.play)return!1;if(t)return console.log("正在网站全屏"),!1;if(this.isMobile){x(document.getElementById("".concat(this.jSPlugin.id,"-wrap")));var i=document.documentElement.clientWidth,n=document.documentElement.clientHeight;document.getElementById("".concat(this.jSPlugin.id)).style["backface-visibility"]="hidden",this.jSPlugin.jSPlugin.JS_Resize(n,i-this._extendHeadeTimeLinrHight(!1,!0))}else{p(document.getElementById("".concat(this.jSPlugin.id))).then((function(e){A.jSPlugin.jSPlugin.JS_Resize(window.screen.width,window.screen.height)})).catch((function(A){console.log(A)}))}}},{key:"_extendHeadeTimeLinrHight",value:function(A,e){var t=0,i=0,n=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));n&&!A&&(t=parseInt(getComputedStyle(n).height,10));var a=document.getElementById("".concat(this.jSPlugin.id,"-canvas-container"));return a&&!e&&(i=parseInt(window.getComputedStyle(a).height,10)),t+i}},{key:"disabledFECBtn",value:function(){var A=["".concat(this.jSPlugin.id,"-capturePicture"),"".concat(this.jSPlugin.id,"-capturePicture-content"),"".concat(this.jSPlugin.id,"-capturePicture-icon"),"".concat(this.jSPlugin.id,"-recordvideo"),"".concat(this.jSPlugin.id,"-recordvideo-content"),"".concat(this.jSPlugin.id,"-recordvideo-icon"),"".concat(this.jSPlugin.id,"-zoom"),"".concat(this.jSPlugin.id,"-zoom-content"),"".concat(this.jSPlugin.id,"-zoom-icon")],e=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));if(this.jSPlugin.use3DZoom?this.jSPlugin.close3DZoom():this.jSPlugin.Zoom.stopZoom(),this.setDecoderState({zoom:!1}),e){var t,i=r(A);try{for(i.s();!(t=i.n()).done;){var n=t.value,a=e.querySelector("#".concat(n));a&&(a.style.display="none")}}catch(A){i.e(A)}finally{i.f()}}}},{key:"resumeFECBtn",value:function(){var A=["".concat(this.jSPlugin.id,"-capturePicture"),"".concat(this.jSPlugin.id,"-capturePicture-content"),"".concat(this.jSPlugin.id,"-capturePicture-icon"),"".concat(this.jSPlugin.id,"-recordvideo"),"".concat(this.jSPlugin.id,"-recordvideo-content"),"".concat(this.jSPlugin.id,"-recordvideo-icon"),"".concat(this.jSPlugin.id,"-zoom"),"".concat(this.jSPlugin.id,"-zoom-content"),"".concat(this.jSPlugin.id,"-zoom-icon")],e=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));if(e){var t,i=r(A);try{for(i.s();!(t=i.n()).done;){var n=t.value,a=e.querySelector("#".concat(n));a&&(a.style.display="")}}catch(A){i.e(A)}finally{i.f()}}}},{key:"destroy",value:function(){var A=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));A&&(A.innerHTML="");var e=document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"));this._removeElement(e);var t=document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-item"));this._removeElement(t);var i=document.getElementById("mobile-ez-ptz-container");this._removeElement(i);var n=document.getElementById("date-switch-container-wrap");this._removeElement(n);var a=document.getElementById("rec-type-container-wrap");this._removeElement(a);var r=document.getElementById("mobile-rec-wrap");this._removeElement(r)}},{key:"_removeElement",value:function(A){A&&A.parentNode&&A.parentNode.removeChild(A)}}])}(),LA=function(){return a((function A(e){t(this,A),this.url=e.url||"",this.method=e.method||"POST",this.headers=e.headers||{},this.body=e.body||{},this.onBeforeUpload=e.onBeforeUpload||function(){},this.onUploadProgress=e.onUploadProgress||function(){},this.onUploadComplete=e.onUploadComplete||function(){},this.controller=new AbortController}),[{key:"upload",value:function(){var A=this;this.onBeforeUpload(this.body);var e={method:this.method,headers:this.headers,signal:this.controller.signal,body:this.body};fetch(this.url,e).then((function(A){return A.json()})).then((function(e){A.onUploadComplete({body:A.body,response:e})})).catch((function(A){"AbortError"===A.name?console.log("上传被取消"):console.error("Error:",A)})),e.body&&"FormData"==e.body.constructor.name&&"signal"in e&&e.signal.addEventListener("progress",(function(e){e.lengthComputable&&A.onUploadProgress(g(g({},A.body),{},{progress:e.loaded/e.total}))}))}},{key:"cancel",value:function(){this.controller.abort()}}])}(),YA=function(){return a((function A(e,i){t(this,A),this.jSPlugin=e,this.isMobile=i,this.timer=null,this.initToastCustom()}),[{key:"initToastCustom",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom"))?document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom")).style.display="none":this.randerToast()}},{key:"randerToast",value:function(){var A=this.jSPlugin.width,e=1;e=this.isMobile?A/375||1:A/1024||1;var t=document.getElementById("".concat(this.jSPlugin.id,"-wrap")),i=document.createElement("div");i.style="display:none;position:absolute;top:0;width: 100%;align-items: center;justify-content: center;",i.id="".concat(this.jSPlugin.id,"-wrap-Toast-custom"),this.isMobile?i.innerHTML='
    \n
    \n '):i.innerHTML='
    \n
    \n '),t.insertBefore(i,document.getElementById(this.jSPlugin.id))}},{key:"initToastContent",value:function(A){var e=this,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3;console.log("content----------------",A),this.timer=null,document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom"))?(document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom-content")).innerText=A||"",this.timer=setTimeout((function(){document.getElementById("".concat(e.jSPlugin.id,"-wrap"))&&document.getElementById("".concat(e.jSPlugin.id,"-wrap-Toast-custom"))&&document.getElementById("".concat(e.jSPlugin.id,"-wrap")).removeChild(document.getElementById("".concat(e.jSPlugin.id,"-wrap-Toast-custom")))}),t)):(this.randerToast(),this.initToastContent(A))}}])}(),GA=function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},r={"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},o="";r=Object.assign(r,a);var s=new Headers;Object.keys(r).map((function(A){s.append(A,r[A])})),r=s,Object.keys(Object.assign({},t)).forEach((function(A){var e=t[A];"string"==typeof t[A]&&(e=t[A].replace("%","%25")),void 0!==t[A]&&(o+="&".concat(A,"=").concat(encodeURIComponent(e)))})),o.length>0&&(o=-1!==["GET","PUT","DELETE"].indexOf(e.toUpperCase())?"?".concat(o.slice(1)):o.slice(1));var g=A+(-1!==["GET","PUT","DELETE"].indexOf(e.toUpperCase())?o:""),c={headers:r,method:e};"POST"===e&&(c.body=o),"POST"===e&&a&&"application/json"===a["Content-Type"]&&(c.body=JSON.stringify(t)),"GET"===e&&(-1===g.indexOf("?")?g+="?_r=".concat(Math.random()):g+="&_r=".concat(Math.random())),fetch(g,c).then((function(A){var e=A.headers.get("content-type");return e&&-1!==e.indexOf("application/json")?A.json():A.text()})).then((function(A){i&&i(A)})).catch((function(A){n&&n(A)}))},UA=function(A,e,t){var i=new FormData;i.append("deviceSerial",y(A.url).deviceSerial),i.append("cmd","open"),fetch("".concat(domain,"/api/v3/device/acs/remote/door?accessToken=").concat(A.accessToken||A.token.deviceToken.globalAll),{method:"POST",body:i}).then((function(A){return A.json()})).then((function(A){console.log("get theme data",A),e(A)})).catch((function(A){t(A)}))},JA=function(A,e,t){var i={accessToken:A.accessToken||A.token.httpToken.url,pageStart:0,pageSize:4,default:!0,voiceName:"轻应用语音文件"},n="".concat(A.env.domain,"/api/lapp/voice/query");GA(n,"POST",i,(function(A){console.log(A),e(A)}),(function(A){console.log(A),t(A)}),{"Content-Type":"application/x-www-form-urlencoded"})},HA=function(A,e,t,i){var n="".concat(A.env.domain,"/api/lapp/voice/send"),a=new FormData;a.append("deviceSerial",y(A.url).deviceSerial),a.append("accessToken",A.accessToken||A.token.deviceToken.video),a.append("channelNo",y(A.url).channelNo||1),a.append("fileUrl",e),fetch(n,{method:"POST",body:a}).then((function(A){return A.json()})).then((function(A){!function(A){console.log(A),t(A)}(A)})).catch((function(A){var e;e=A,console.log(e),i(e)}))},KA=function(){return a((function A(e,i){t(this,A),this.jSPlugin=e,this.videoWidth=e.width,this.switchFooter=i,this.sendLoadingStats=!1,this.toastCustom=new YA(e,!1),this.quickReplyList=["你好,请将快递放在门口","你好,稍等","你好,请将快递放入小区快递柜","你好,请将外卖放在门口"],this.initQuickReply()}),[{key:"initQuickReply",value:function(){document.getElementById("pc-quickReply-back")||this.renderQuickReply(),document.getElementById("pc-quickReply-back-item-0")||this.getQuickReplyList()}},{key:"renderQuickReply",value:function(){var A=this,e=this.videoWidth/1024||1,t=document.createElement("div");t.style="width:100%;",t.innerHTML='
    \n
    \n
    \n \n 返回\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n 返回\n
    \n
    \n \n \n
    '),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReply")).appendChild(t),document.getElementById("pc-quickReply-back").onclick=function(){A.switchFooter("onBell")}}},{key:"matchQuickReplyBtn",value:function(){var A=this,e=this.videoWidth/1024||1,t=document.getElementById("pc-quickReply-content");this.quickReplyList&&this.quickReplyList.length>0&&this.quickReplyList.forEach((function(i,n){var a=document.createElement("div");a.id="pc-quickReply-back-item-".concat(n),a.style="margin: ".concat(8*e,"px 0 ").concat(8*e,"px ").concat(8*e,"px;cursor: pointer;\n padding: 0 ").concat(20*e,"px;min-height: ").concat(64*e,"px;width:calc(50% - ").concat(16*e,"px);\n display: inline-block;background: rgba(0,0,0,0.70);border-radius: 8px;text-align: center;\n box-sizing: border-box;font-size:").concat(24*e,"px;color: rgba(255,255,255,0.90);"),a.innerHTML='
    \n ').concat(i.voiceName,"\n
    "),a.onclick=function(){A.sendLoadingStats||(console.log("item:"+i),A.sendQuickReply(i,n))},t.appendChild(a)}))}},{key:"setBtnCheckLoading",value:function(A,e){var t=this.videoWidth/1024||1;if(e>-1){document.getElementById("pc-quickReply-back-item-".concat(e));var i=document.getElementById("pc-quickReply-back-item-box-".concat(e)),n=document.getElementById("pc-quickReply-name-".concat(e));if(1==A){var a=document.getElementById("pc-quickReply-icon-loading-".concat(e));a&&n&&i.removeChild(a)}else if(n){var r=document.createElement("span");r.id="pc-quickReply-icon-loading-".concat(e),r.style="vertical-align: middle;margin-right:".concat(16*t,"px;"),r.innerHTML=''),i.insertBefore(r,n)}}}},{key:"getQuickReplyList",value:function(){var A=this;console.log("getQuickReplyList"),this.madeLoadingDom(0);JA(this.jSPlugin,(function(e){if(e&&200==e.code){var t=e.data||[],i=[];e.data.forEach((function(A,e){i=A.voiceName.split("_"),t[e].voiceName=i[1]})),A.quickReplyList=t,setTimeout((function(){A.madeLoadingDom(2)}),500)}else A.madeLoadingDom(1)}),(function(e){console.log(e),A.madeLoadingDom(1)}))}},{key:"madeLoadingDom",value:function(A){var e=this,t=this.videoWidth/1024||1;if(0==A){if(document.getElementById("pc-quickReply-content").style.display="none",document.getElementById("pc-quickReply-loaderror").style.display="none",document.getElementById("pc-quickReply-loading").style.display="block",!document.getElementById("pc-quickReply-loading-box")){var i=document.createElement("div");i.id="pc-quickReply-loading-box",i.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: column;",i.innerHTML='
    \n \n
    \n
    加载中…
    '),document.getElementById("pc-quickReply-loading").appendChild(i)}}else if(1==A){if(document.getElementById("pc-quickReply-content").style.display="none",document.getElementById("pc-quickReply-loading").style.display="none",document.getElementById("pc-quickReply-loaderror").style.display="block",!document.getElementById("pc-quickReply-loaderror-box")){var n=document.createElement("div");n.id="pc-quickReply-loaderror-box",n.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: column;",n.innerHTML='
    快速回复加载失败
    \n
    重新加载
    '),document.getElementById("pc-quickReply-loaderror").appendChild(n),document.getElementById("pc-quickReply-loaderror-reload").onclick=function(){e.getQuickReplyList()}}}else document.getElementById("pc-quickReply-loading").style.display="none",document.getElementById("pc-quickReply-loaderror").style.display="none",document.getElementById("pc-quickReply-content").style.display="block",this.matchQuickReplyBtn()}},{key:"sendQuickReply",value:function(A,e){var t=this;this.sendLoadingStats=!0,this.setBtnCheckLoading(0,e);HA(this.jSPlugin,A.fileUrl,(function(A){t.sendLoadingStats=!1,t.setBtnCheckLoading(1,e),A&&200==A.code?t.toastCustom.initToastContent("快捷回复成功"):t.toastCustom.initToastContent("快捷回复失败,请重试"),t.switchFooter("onBell")}),(function(A){console.log(A),t.sendLoadingStats=!1,t.setBtnCheckLoading(1,e),t.toastCustom.initToastContent("快捷回复失败,请重试"),t.switchFooter("onBell")}))}}])}(),VA=function(){return a((function A(e,i){t(this,A),this.jSPlugin=e,this.videoWidth=e.width,this.switchFooter=i,this.toastCustom=new YA(e,!1),this.lockStatus=!1,this.initRemoteUnlock()}),[{key:"initRemoteUnlock",value:function(){document.getElementById("pc-remoteUnlock-back")?this.madeSlideEvent():this.renderRemoteUnlock()}},{key:"renderRemoteUnlock",value:function(){var A=this,e=this.videoWidth/1024||1,t=document.createElement("div");t.style="width:100%;",t.id="pc-remoteUnlock-box",t.innerHTML='
    \n
    \n
    \n \n 返回\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n 返回\n
    \n
    \n
    '),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-remoteUnlock")).appendChild(t),document.getElementById("pc-remoteUnlock-back").onclick=function(){A.goback()},this.renderRemoteUnlockSlide()}},{key:"renderRemoteUnlockSlide",value:function(){var A=this.videoWidth/1024||1,e=document.getElementById("pc-remoteUnlock-content"),t=document.createElement("div");t.id="pc-remoteUnlock-content-slide",t.style="width: 100%;display: flex;justify-content: center;cursor: pointer;",t.innerHTML='
    \n
    \n
    右滑开锁
    \n
    \n \n \n \n \n \n \n \n \n \n
    \n
    '),e.appendChild(t),this.madeSlideEvent()}},{key:"getOffsetLeft",value:function(A){var e=0;do{e+=A.offsetLeft,A=A.parentNode}while(A.parentNode);return e}},{key:"madeSlideEvent",value:function(){var A=this.videoWidth/1024||1,e=document.getElementById("".concat(this.jSPlugin.id)),t=this.getOffsetLeft(e),i=document.getElementById("pc-remoteUnlock-slide-box"),n=document.getElementById("pc-remoteUnlock-slide-bgColor"),a=document.getElementById("pc-remoteUnlock-slide-tips"),r=document.getElementById("pc-remoteUnlock-slide-ball"),o=this;r.onmousedown=function(e){var s=(e=e||window.event).offsetX;r.style.transition="",n.style.transition="",document.onmouseup=function(){console.log("--------------onmouseup"),o.lockStatus||(n.style.width="0px",r.style.left=8*A+"px",r.style.transition="left 0.6s linear",n.style.transition="width 0.6s linear"),document.onmouseup=null,document.onmousemove=null},document.onmousemove=function(e){e=e||window.event;console.log("videoDom",t);var g=e.pageX-i.offsetLeft-s-t,c=i.clientWidth-r.clientWidth-8*A;g<=0&&(g=0),g>=c&&(g=c),r.style.left=g+"px",g!=c||o.lockStatus||o.lockStatus||(o.lockStatus=!0,document.getElementById("slide-ball-start").style.display="none",document.getElementById("slide-ball-end").style.display="inline",n.style.width=i.clientWidth+"px",n.style.backgroundColor="#598FFF",i.style.border="0",r.style.backgroundColor="#ffffff",a.textContent="正在开锁",r.onmousedown=null,document.onmousemove=null,o.sendRemoteUnlockApi())}}}},{key:"resetRemoteUnlockSlide",value:function(){var A=document.getElementById("pc-remoteUnlock-box"),e=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-remoteUnlock"));A&&e&&e.removeChild(A)}},{key:"sendRemoteUnlockApi",value:function(){var A=this;console.log("下发远程开锁");UA(this.jSPlugin,(function(e){e&&200==e.code?A.toastCustom.initToastContent("开锁成功"):A.toastCustom.initToastContent("开锁失败,请重试"),A.goback()}),(function(e){console.log(e),A.toastCustom.initToastContent("开锁失败,请重试"),A.goback()}))}},{key:"goback",value:function(){this.switchFooter("onCall"),this.resetRemoteUnlockSlide()}}])}(),OA={customConfig:{defaultMicro:0,defaultPlay:0,maxTalkTime:0,bellPoster:0,maxBellTime:0},header:{onBell:{color:"#2c2c2c",backgroundColor:"#00000000 linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.00) 100%)",activeColor:"#1890FF",autoFocus:0,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-0",iconId:"ringStatus",part:"left",defaultActive:0,isrender:1,color:"#ffffff",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-1",iconId:"deviceCategory",part:"left",defaultActive:0,isrender:1,color:"#ffffff",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"}]},onCall:{color:"#2c2c2c",backgroundColor:"#00000000",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-0",iconId:"callStatus",part:"left",defaultActive:0,isrender:1,color:"#ffffff",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-1",iconId:"deviceCategory",part:"left",defaultActive:0,isrender:1,color:"#ffffff",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"}]}},footer:{onBell:{color:"#ffffff",backgroundColor:"#00000000",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-0",iconId:"quickReply",part:"left",defaultActive:1,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-1",iconId:"rejection",part:"left",defaultActive:0,isrender:1,color:"#2C2C2C",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-2",iconId:"answer",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-3",iconId:"remoteUnlock",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"}]},onCall:{color:"#2c2c2c",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-0",iconId:"mute",part:"left",defaultActive:1,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-1",iconId:"hangUp",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-2",iconId:"remoteUnlock",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"}]}}};function jA(A){var e=new z,t=new FormData;for(var i in A)t.append(i,A[i]);return e.fetch("/api/lapp/device/info",{method:"POST",body:t})}var WA=function(A){var e="";return Object.keys(A).map((function(t,i){e+="".concat(t,":").concat(A[t]).concat(i1&&void 0!==arguments[1])||arguments[1],t=r.themeData,i=t.header,n=t.footer,a=null;if("onCall"==A){console.log("接听"),r.bellStatus="onCall",r.switchFooter("onCall"),n[r.bellStatus].btnList.map((function(A,e){A.isrender&&r.renderFooter(A.iconId,A),"mute"==A.iconId&&(a=A)})),i[r.bellStatus].btnList.map((function(A,e){A.isrender&&r.renderHeader(A.iconId,A)}));var o=document.getElementById("".concat(r.jSPlugin.id,"-header-onBell"));o&&o.parentElement.removeChild(o),1==r.themeData.customConfig.bellPoster&&document.getElementById("bellring-icon")&&document.getElementById("".concat(r.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),0==r.themeData.customConfig.defaultMicro&&a?r.muteCommon(a):r.setDecoderState({mute:!1},a.backgroundColor),r.removeBellRing()}else console.log("响铃"),r.bellStatus="onBell",r.jSPlugin.Theme.changeTheme(r.themeData,e)})),this.jSPlugin=e,this.videoWidth=e.width,this.videoHeight=e.height,this.themeData=i,this.setDecoderState=n,this.decoderState=a,this.isNeedRenderHeader=!1,this.isNeedRenderFooter=!1,this.autoFocus=0,this.autoFocusTimer=null,this.bellStatus="onBell",this.recordTimer=null,this.nextRate=1,this.themeInited=!1,this.inited=!1,this.activeThemeStatus=!0,this.activeThemeStatusTxt="模板未激活",this.toastCustom=new YA(e,!1)}),[{key:"initBellRing",value:function(){var A=this,e=this.decoderState.state,t=e.play,i=e.isEditing;e.rejection;var n=this.videoWidth/1024;this.maxBellTime=1e3*this.themeData.customConfig.maxBellTime;var a=document.getElementById("bellring"),r=document.getElementById("bellring-audio");if(!a&&!r){if(this.jSPlugin.isNeedBellRing){var o=document.createElement("div");o.id="bellring",o.innerHTML='
    \n \n
    ',document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(o)}if(1!=this.themeData.customConfig.bellPoster||i)document.getElementById("bellring-icon")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon"));else{var s=(this.videoHeight-180*n)/2,g=document.createElement("div");g.id="bellring-icon",g.style="position: absolute;pointer-events: none;background: none;width: 100%;\n position: absolute;top: ".concat(s,"px;display: flex;align-items: center;justify-content: center;"),g.innerHTML='
    \n
    \n \n icon/响铃\n \n \n \n \n \n
    \n
    '),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(g),t&&"onBell"==this.bellStatus&&this.jSPlugin.pause()}setTimeout((function(){var e=A.decoderState.state,t=e.isEditing,i=e.rejection;"onBell"!=A.bellStatus||i||(A.removeBellRing(),t||A.answerOvertime())}),this.maxBellTime)}}},{key:"removeBellRing",value:function(){document.getElementById("bellring")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring")),document.getElementById("bellring-icon")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon"))}},{key:"matchBtn",value:function(A,e){var t=this,i=this.themeData,n=i.header,a=i.footer,r=this.decoderState.state,o=r.mute,s=r.rejection,g={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}};-1===n[this.bellStatus].btnList.findIndex((function(e){return e.iconId===A}))?(g.color=a[this.bellStatus].color,g.backgroundColor=a[this.bellStatus].backgroundColor,g.activeColor=a[this.bellStatus].activeColor):(g.color=n[this.bellStatus].color,g.backgroundColor=n[this.bellStatus].backgroundColor,g.activeColor=n[this.bellStatus].activeColor);var c=this.videoWidth/6;this.videoWidth;var l=this.videoWidth/1024||1;switch(A){case"ringStatus":return g.title=this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,g.id=A,g.domString='').concat(this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,""),g.onclick=function(){},g;case"deviceCategory":return g.title="设备名称",g.id=A,g.domString='').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"设备名称",""),g.onclick=function(){},g;case"callStatus":return g.title="通话中",g.id=A,g.domString='通话中'),g.onclick=function(){},g;case"deviceCategory":return g.title="设备名称",g.id=A,g.domString='').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"设备名称",""),g.onclick=function(){},g;case"rejection":return g.title="拒绝",g.id=A,g.domString='
    \n
    \n \n 拒绝\n \n \n \n \n \n
    \n
    拒绝
    \n
    '),g.onclick=function(){var A=t.decoderState.state,e=A.play,i=A.isEditing,n=A.rejection;if(i||n)return!1;console.log("拒绝"),e&&t.jSPlugin.stop(),t.removeBellRing(),t.setDecoderState({play:!1,rejection:!0}),t.rejectionStatusDispose(),"function"==typeof t.jSPlugin.hangUpCallback&&t.jSPlugin.hangUpCallback("rejection")},g;case"quickReply":return g.title="快捷回复",g.id=A,g.domString='
    \n
    \n \n 快捷回复\n \n \n \n \n \n
    \n
    快捷回复
    \n
    '),g.onclick=function(){if(t.decoderState.state.rejection)return!1;console.log("快捷回复"),t.switchFooter("quickReply"),t.quickReplyEle=new KA(t.jSPlugin,t.switchFooter)},g;case"answer":return g.title="接听",g.id=A,g.domString='
    \n
    \n \n 接听\n \n \n \n \n \n
    \n
    接听
    \n
    '),g.onclick=function(){var A=t.decoderState.state,i=A.play,r=A.isEditing,o=A.talk,s=A.sound,g=A.rejection;if(r||g)return!1;console.log("接听"),t.jSPlugin.pluginStatus.loadingClear(),i||(t.jSPlugin.pluginStatus.loadingStart(t.jSPlugin.id),t.jSPlugin.pluginStatus.loadingSetText({text:"视频加载中"}),t.jSPlugin.play(),t.setDecoderState({play:!i})),o||1!=t.themeData.customConfig.defaultMicro||(t.setDecoderState({talk:!0,mute:!1}),s&&t.jSPlugin.closeSound(),t.jSPlugin.Talk.startTalk()),t.setDecoderState({sound:!1}),t.bellStatus="onCall",t.switchFooter("onCall"),a[t.bellStatus].btnList.map((function(A,e){A.isrender&&t.renderFooter(A.iconId,A)})),n[t.bellStatus].btnList.map((function(A,e){A.isrender&&t.renderHeader(A.iconId,A)}));var c=document.getElementById("".concat(t.jSPlugin.id,"-header-onBell"));c&&c.parentElement.removeChild(c),1==t.themeData.customConfig.bellPoster&&(document.getElementById("bellring-icon")&&document.getElementById("".concat(t.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),t.jSPlugin.setPoster("")),0==t.themeData.customConfig.defaultMicro&&(t.muteCommon(e),t.jSPlugin.openSound(),t.setDecoderState({sound:!0})),t.removeBellRing(),t.maxTalkTime=1e3*t.themeData.customConfig.maxTalkTime*60;var l=t;setTimeout((function(){o&&(console.log("结束对讲"),l.setDecoderState({talk:!1}),l.jSPlugin.Talk.stopTalk()),i&&(l.jSPlugin.stop(),l.setDecoderState({play:!i})),t.rejectionStatusDispose(),t.remoteUnlockEle&&t.remoteUnlockEle.goback(),"function"==typeof t.jSPlugin.hangUpCallback&&t.jSPlugin.hangUpCallback("hangUp")}),t.maxTalkTime)},g;case"remoteUnlock":return g.title="远程开锁",g.id=A,g.domString='
    \n
    \n \n 开锁\n \n \n \n \n \n
    \n
    远程开锁
    \n
    '),g.onclick=function(){var A=t.decoderState.state,e=A.isEditing,i=A.rejection;if(e||"onBell"==t.bellStatus||i)return!1;console.log("远程开锁"),t.switchFooter("remoteUnlock"),t.remoteUnlockEle=new VA(t.jSPlugin,t.switchFooter)},g;case"mute":return g.title="静音",g.id=A,g.domString='
    \n
    \n \n 静音\n \n \n \n \n \n
    \n
    静音
    \n
    '),g.onclick=function(){var A=t.decoderState.state,i=A.talk,n=A.sound;if(A.play,A.rejection)return!1;console.log("静音"),i?(console.log("结束对讲"),t.setDecoderState({talk:!1,mute:!0},e.backgroundColor),t.jSPlugin.Talk.stopTalk(),t.jSPlugin.openSound(),t.setDecoderState({sound:!0})):(console.log("开始对讲"),t.setDecoderState({talk:!0,mute:!1},e.backgroundColor),n&&(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1})),t.jSPlugin.Talk.startTalk())},g;case"hangUp":return g.title="挂断",g.id=A,g.domString='
    \n
    \n \n 挂断\n \n \n \n \n \n
    \n
    挂断
    \n
    '),g.onclick=function(){var A=t.decoderState.state,e=A.talk,i=A.play,n=A.sound;if(A.rejection)return!1;e&&(console.log("结束对讲"),t.setDecoderState({talk:!1}),t.jSPlugin.Talk.stopTalk()),i&&(t.jSPlugin.stop(),t.setDecoderState({play:!i})),n&&(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1})),(i||e)&&(console.log("挂断"),t.removeBellRing(),t.rejectionStatusDispose(),"function"==typeof t.jSPlugin.hangUpCallback&&t.jSPlugin.hangUpCallback("hangUp"))},g;default:return g}}},{key:"answerOvertime",value:function(){this.toastCustom.initToastContent("应答超时");var A=this.decoderState.state.play;console.log("应答超时"),A&&this.jSPlugin.stop(),this.setDecoderState({play:!1,rejection:!0}),this.rejectionStatusDispose(),this.switchFooter("onBell"),"function"==typeof this.jSPlugin.hangUpCallback&&this.jSPlugin.hangUpCallback("rejection")}},{key:"rejectionStatusDispose",value:function(){var A=this,e=this.themeData.footer,t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),n=document.getElementById("header-".concat(this.bellStatus,"-ringStatus"));"onBell"==this.bellStatus?(t.innerHTML="",t.style.color="#ffffff"):(i.innerHTML="",i.style.color="#ffffff"),console.log("rejectionStatusDispose"),this.setDecoderState({rejection:!0}),e[this.bellStatus].btnList.map((function(e,t){e.isrender&&A.renderFooter(e.iconId,e)})),n.innerText="通话已结束",this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.pluginStatus.loadingSetTextWithBtn({text:"通话已结束",color:"white",isMobile:!1,type:2})}},{key:"userNoDevice",value:function(){var A=this;this.removeBellRing(),this.setDecoderState({rejection:!0});var e=this.themeData.footer,t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));"onBell"==this.bellStatus?(t.innerHTML="",t.style.color="#ffffff"):(i.innerHTML="",i.style.color="#ffffff"),console.log("userNoDevice"),this.setDecoderState({rejection:!0}),e[this.bellStatus].btnList.map((function(e,t){e.isrender&&A.renderFooter(e.iconId,e)})),this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.pluginStatus.loadingSetTextWithBtn({text:"该用户不拥有该设备",color:"white",isMobile:!1,type:2})}},{key:"renderHeader",value:function(A,e){var t=this,i=this.videoWidth/1024||1,n=this.matchBtn(A,e);if(document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content"))){var a=document.createElement("span");a.innerHTML="".concat(n.domString),document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content")).appendChild(a)}else{var r=document.createElement("div");r.id="".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus),r.style="max-width:50%;position:relative;",r.innerHTML='\n ').concat(n.domString,"\n "),r.onclick=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;n.onclick(A)},document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[0].appendChild(r)}}},{key:"renderFooter",value:function(A,e){var t=this,i=this.decoderState.state.mute;if(console.log("-------------renderFooter"),"remoteUnlock"==A&&this.jSPlugin.capacity&&(!this.jSPlugin.capacity.support_unlock||0==this.jSPlugin.capacity.support_unlock))return!1;var n=this.matchBtn(A,e),a=this.videoWidth/6,r=document.createElement("div");r.className="theme-icon-item",this.jSPlugin.isWebConsole?r.style="padding:0 ".concat(.1*a,"px;"):r.style="padding:0 ".concat(.1*a,"px;cursor: pointer;"),r.innerHTML="".concat('')+'
    ')).concat(n.domString,"
    ")+"
    ",r.onclick=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;n.onclick(A)},n.onmouseenter&&(r.onmouseenter=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;n.onmouseenter(A)}),n.onmouseleave&&(r.onmouseleave=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;n.onmouseleave(A)});var o=this.videoWidth/597,s=document.createElement("span");s.className="icon-move left",s.innerHTML='\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),s.onclick=function(){t.editIcon(n.id,"left","footer")},r.appendChild(s);var g=document.createElement("span");if(g.className="icon-move right",g.innerHTML='\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),g.onclick=function(){t.editIcon(n.id,"right","footer")},r.appendChild(g),"answer"==A||"rejection"==A||"hangUp"==A);else{var c=document.createElement("span");c.className="icon-move close",c.innerHTML='\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),c.onclick=function(){t.editIcon(n.id,"delete","footer")},r.appendChild(c)}"onCall"==this.bellStatus?document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).appendChild(r):document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).appendChild(r),this.decoderState.state.isEditing&&"mute"==A&&"onCall"==this.bellStatus&&(0!=this.themeData.customConfig.defaultMicro||i?this.setDecoderState({mute:!1},e.backgroundColor):this.setDecoderState({mute:!0},e.backgroundColor))}},{key:"switchFooter",value:function(A){var e={};switch(this.themeData&&(e=this.themeData.footer),A){case"onBell":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReply"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReply")).style.display="none"),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"))?"none"==document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="flex"):document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="flex";break;case"onCall":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-remoteUnlock")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display="flex",this.themeData&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.color=e[this.bellStatus].color);break;case"quickReply":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReply")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="none";break;case"remoteUnlock":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-remoteUnlock")).style.display="flex"}}},{key:"initThemeData",value:function(){var A=this;console.log("-------------initThemeData");var e=this.decoderState.state.isEditing,t=this.themeData,i=t.header,n=t.footer,a=this.jSPlugin.id,r=this.videoWidth/1024;if(this.isNeedRenderHeader=M.findIndex(i[this.bellStatus].btnList,(function(A){return A.isrender>0}))>=0,this.isNeedRenderFooter=M.findIndex(n[this.bellStatus].btnList,(function(A){return A.isrender>0}))>=0,this.isNeedRenderHeader)if(document.getElementById("".concat(this.jSPlugin.id,"-headControl")))document.getElementById("".concat(this.jSPlugin.id,"-headControl")).innerHTML="
    ");else{var o=document.createElement("div");o.setAttribute("id","".concat(this.jSPlugin.id,"-headControl")),o.setAttribute("class","header-controls"),o.innerHTML="
    "),console.log(this.jSPlugin.height);var s=.2*this.jSPlugin.height+"px",g={height:s,display:"flex","justify-content":"space-between",top:0,"z-index":999,color:"#FFFFFF",width:"100%",position:"relative","margin-bottom":"-"+s,"align-items":"center",background:"transparent linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.00) 100%)"};o.style=WA(g),document.getElementById("".concat(a,"-wrap")).insertBefore(o,document.getElementById(a));var c=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(c)}),50)}else document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-headControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-headControl")));var l=.3*this.jSPlugin.height;if(this.isNeedRenderFooter)if(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")))document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="-".concat(l,"px"),"onCall"==this.bellStatus?document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='\n \n \n \n \n '):document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='\n \n \n \n \n '));else{var I=document.createElement("div");I.setAttribute("id","".concat(this.jSPlugin.id,"-ez-iframe-footer-container")),I.setAttribute("class","ez-iframe-footer-container");var d={"min-height":l+"px","max-height":l+"px",position:"relative","margin-top":"-"+l+"px",display:"flex","flex-wrap":"wrap","justify-content":"space-between","z-index":999,top:0,color:"#FFFFFF",width:"100%","align-items":"center","background-image":"linear-gradient(180deg, rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.60) 100%)","font-size":24*r+"px"};I.style=WA(d),I.innerHTML='\n \n \n \n \n '),Q(I,document.getElementById(a))}else document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")));if(this.isNeedRenderHeader&&document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=i[this.bellStatus].backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=i[this.bellStatus].color,i[this.bellStatus].btnList.map((function(e,t){e.isrender&&A.renderHeader(e.iconId,e)}))),this.isNeedRenderFooter&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=n[this.bellStatus].backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=n[this.bellStatus].color,n[this.bellStatus].btnList.map((function(e,t){e.isrender&&A.renderFooter(e.iconId,e)}))),1==this.themeData.customConfig.bellPoster&&!e){this.jSPlugin.poster="https://resource.eziot.com/group1/M00/00/B8/CtwQEmPbGh2AVJB-ABDcYtyw5gk899.svg";var C=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(C),A.jSPlugin.setPoster(A.jSPlugin.poster))}),50)}this.activeThemeStatus&&(this.initBellRing(),window.addEventListener("click",this.autoPlayRing)),this.inited=!0,this.getCallDeviceInfo()}},{key:"renderThemeData",value:function(){var A=this,e=this.decoderState.state.isEditing,t=this.themeData,i=t.header,n=t.footer;if(this.isNeedRenderHeader&&i&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=i[this.bellStatus].backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=i[this.bellStatus].color.replace("-diy",""),i[this.bellStatus].btnList.map((function(e,t){e.isrender&&A.setDecoderState(o({},e.iconId,A.decoderState.state[e.iconId]))}))),this.isNeedRenderFooter&&n)document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=n[this.bellStatus].backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=n[this.bellStatus].color.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.color=n[this.bellStatus].color.replace("-diy",""),n[this.bellStatus].btnList.map((function(t,i){if(t.isrender&&A.setDecoderState(o({},t.iconId,A.decoderState.state[t.iconId])),0==i&&!A.themeInited&&A.activeThemeStatus)var n=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(n),1!=A.themeData.customConfig.bellPoster||e?A.jSPlugin.play():A.jSPlugin.pluginStatus.loadingClear(),A.themeInited=!0)}),50)})),-1!==this.jSPlugin.url.indexOf("hd.live")&&this.setDecoderState({hd:!0}),this.themeData.autoFocus>0&&(this.autoFocus=parseInt(this.themeData.autoFocus),this.startAutoFocus(),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).addEventListener("click",(function(){A.stopAutoFocus()}))),this.setDecoderState({cloudRec:"cloud.rec"===y(this.jSPlugin.url).type,rec:"rec"===y(this.jSPlugin.url).type,type:y(this.jSPlugin.url).type});else if(!this.themeInited&&this.activeThemeStatus)var a=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(a),A.themeData&&A.themeData.customConfig&&1==A.themeData.customConfig.bellPoster&&!e?A.jSPlugin.pluginStatus.loadingClear():A.jSPlugin.play(),A.themeInited=!0)}),50);var r=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(r),A.jSPlugin.reSize(A.jSPlugin.params.width,A.jSPlugin.params.height))}),50)}},{key:"setThemeData",value:function(A,e){this.themeData=A,"onCall"==e&&(this.bellStatus="onCall")}},{key:"startAutoFocus",value:function(){var A=this,e=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById("".concat(A.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(A.jSPlugin.id,"-audioControls")).style.opacity=0,document.getElementById("".concat(A.jSPlugin.id,"-audioControls")).style.pointerEvents="none")}),1e3*e)}},{key:"stopAutoFocus",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.startAutoFocus()}},{key:"editIcon",value:function(A,e,t){console.log("编辑组件",A,e,t);var i=this.themeData;console.log("themeData",this.themeData);var n=this.themeData[t][this.bellStatus].btnList,a=M.findIndex(n,(function(e){return e.iconId===A})),r=n[a];switch(e){case"delete":n[a].isrender=0;break;case"right":for(var o=-1,s=a+1;s=0;c--)if(n[c].part===n[a].part&&1==n[c].isrender){g=c;break}-1!==g&&(n[a]=n[g],n[g]=r)}console.log("new btnList",n),i[t][this.bellStatus].btnList=n,this.jSPlugin.Theme.changeTheme(i)}},{key:"countTime",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var i=document.createElement("div");i.id=this.jSPlugin.id+"time-area",i.className="time-area",i.innerHTML='00:00',document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).appendChild(i)}if(this.countTimer&&clearInterval(this.countTimer),"add"===A){var n=e;document.getElementById(t.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++n,document.getElementById(t.jSPlugin.id+"time-area").children[1].innerHTML=function(A){var e=parseInt(A),t=0,i=0,n="00",a="00",r="00";e>59&&(t=parseInt(e/60),e=parseInt(e%60),t>59&&(i=parseInt(t/60),t=parseInt(t%60)));return n=parseInt(e)>9?parseInt(e):"0"+parseInt(e),a=parseInt(t)>9?parseInt(t):"0"+parseInt(t),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?r+":"+a+":"+n:t>0?a+":"+n:"00:"+n}(n)}),1e3)}else"destroy"===A&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(t.jSPlugin.id+"time-area")&&(document.getElementById(t.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(t.jSPlugin.id+"time-area").style.display="none"))}},{key:"editStart",value:function(A){console.log("----------editStart2");var e=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));document.getElementById("".concat(this.jSPlugin.id,"-headControl")),e&&e.setAttribute("class","footer-controls themeEditing"),t&&t.setAttribute("class","footer-controls themeEditing"),this.setDecoderState({isEditing:!0})}},{key:"editEnd",value:function(A){console.log("----------editEnd2");var e=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),t=document.getElementById("".concat(this.jSPlugin.id,"-headControl")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));t&&t.setAttribute("class","header-controls"),e&&e.setAttribute("class","footer-controls"),i&&i.setAttribute("class","footer-controls")}},{key:"fetchThemeData",value:function(A){var e=this;PA(this.jSPlugin,A,(function(A){0==A.meta.code&&A.data?(e.activeThemeStatus=!0,e.themeData=A.data,A.data.header&&(e.themeData.header=A.data.header,e.themeData.header[e.bellStatus].btnList=e.themeData.header[e.bellStatus].btnList.sort((function(A,e){return A.btnKey.split("-")[3]-e.btnKey.split("-")[3]}))),A.data.footer&&(e.themeData.footer=A.data.footer,e.themeData.footer[e.bellStatus].btnList=e.themeData.footer[e.bellStatus].btnList.sort((function(A,e){return A.btnKey.split("-")[3]-e.btnKey.split("-")[3]}))),e.jSPlugin.capacity?(e.initThemeData(),e.renderThemeData()):setTimeout((function(){e.initThemeData(),e.renderThemeData()}),300)):(e.activeThemeStatus=!1,e.jSPlugin.pluginStatus.loadingClear(),e.setDecoderState({rejection:!0}),"111021"==A.meta.code?(e.jSPlugin.pluginStatus.loadingSetText({text:"无效的模板id",color:"#fff"}),e.activeThemeStatusTxt="无效的模板id"):"111023"==A.meta.code?(e.jSPlugin.pluginStatus.loadingSetText({text:"您的试用特权已到期,需前往轻应用控制台购买后使用。",color:"#fff"}),e.activeThemeStatusTxt="试用特权已到期"):(e.jSPlugin.pluginStatus.loadingSetText({text:"模板未激活,请先在开放平台轻应用控制台购买模板",color:"#fff"}),e.activeThemeStatusTxt="模板未激活"),e.themeData=OA,e.initThemeData(),e.renderThemeData())}),(function(){e.renderThemeData()}))}},{key:"getCallDeviceInfo",value:function(){var A=this;this.videoWidth,jA({accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,deviceSerial:y(this.jSPlugin.url).deviceSerial}).then((function(e){console.log("---------getCallDeviceInfo"),A.deviceInfoData=e.data,e.data.isEncrypt&&setTimeout((function(){A.jSPlugin.pluginStatus.loadingClear(),A.jSPlugin.pluginStatus.loadingSetText({text:"视频已加密",color:"#fff"})}),500),document.getElementById("header-".concat(A.bellStatus,"-deviceCategory"))&&(document.getElementById("header-".concat(A.bellStatus,"-deviceCategory")).innerText=""+e.data.deviceName)})).catch((function(e){20018!=e.code||A.jSPlugin.isWebConsole||A.userNoDevice(),console.log("获取设备信息失败",e)}))}},{key:"setHeaderText",value:function(A){var e=this.videoWidth/1024||1;document.getElementById("".concat(this.jSPlugin.id,"-deviceCategory-content"))&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceCategory-content")).innerHTML='').concat(A,'').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"",""))}}])}(),XA=function(){return a((function A(e,i){t(this,A),this.jSPlugin=e,this.heightPop=i||366,this.initPopupCustom()}),[{key:"initPopupCustom",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-wrap-popup-custom"))?document.getElementById("".concat(this.jSPlugin.id,"-wrap-popup-custom")).style.display="flex":this.randerPopup()}},{key:"randerPopup",value:function(){var A=this,e=document.documentElement.clientWidth/375||1,t=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(t),t.innerHTML="@keyframes slideContentUp {0% {bottom: -".concat(366*e,"px;}\n 25% {bottom: -").concat(244*e,"px;}\n 50% {bottom: -").concat(122*e,"px;}\n 100% {bottom:0;}} .open-popup{animation:slideContentUp 0.3s 1 linear; -webkit-animation: slideContentUp 0.3s 1 linear;}");var i=document.getElementById("".concat(this.jSPlugin.id,"-wrap")),n=document.createElement("div");n.style="display:flex;",n.id="".concat(this.jSPlugin.id,"-wrap-popup-custom"),n.innerHTML='
    \n
    \n
    \n
    \n
    \n \n icon/close\n \n \n \n \n \n \n \n
    \n \n
    \n
    \n
    \n '),i.appendChild(n),document.getElementById("".concat(this.jSPlugin.id,"-wrap-popup-custom-mask")).onclick=function(){A.closePopupCustom()},document.getElementById("".concat(this.jSPlugin.id,"-popup-board-close")).onclick=function(){A.closePopupCustom()}}},{key:"closePopupCustom",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){})();var A=document.getElementById("".concat(this.jSPlugin.id,"-wrap")),e=document.getElementById("".concat(this.jSPlugin.id,"-wrap-popup-custom"));A&&e&&A.removeChild(e)}},{key:"initPopupContent",value:function(A,e){document.getElementById("popup-board-title-content").innerText=A||"",e&&document.getElementById("".concat(this.jSPlugin.id,"-popup-board-content")).appendChild(e)}}])}(),qA=function(){return a((function A(e,i,n){t(this,A),this.jSPlugin=e,this.videoWidth=n,this.switchFooter=i,this.toastCustom=new YA(e,!0),this.sendLoadingStats=!1,this.quickReplyList=["你好,请将快递放在门口","你好,稍等","你好,请将快递放入小区快递柜","你好,请将外卖放在门口"],this.popupCustom=new XA(e,366),document.getElementById("mobile-quickReply-list")||(this.popupCustom.initPopupContent("快捷回复",this.renderQuickReply()),this.initQuickReply())}),[{key:"initQuickReply",value:function(){document.getElementById("mobile-quickReply-list-item-0")||this.getQuickReplyList()}},{key:"renderQuickReply",value:function(){document.documentElement.clientWidth;var A=document.createElement("div");return A.style="width:100%;",A.id="mobile-quickReply-list",A.innerHTML='
    \n \n ',A}},{key:"matchQuickReplyBtn",value:function(){var A=this,e=this.videoWidth/375||1,t=document.getElementById("mobile-quickReply-content");this.quickReplyList&&this.quickReplyList.length>0&&this.quickReplyList.forEach((function(i,n){var a=document.createElement("div");a.id="mobile-quickReply-list-item-".concat(n),a.style="margin: ".concat(14*e,"px 0;\n padding: ").concat(12*e,"px ").concat(15*e,"px;min-height: ").concat(50*e,"px;width:100%;\n background: #ffffff;border-radius: ").concat(25*e,"px;display: flex;align-items: center;\n box-sizing: border-box;font-size:").concat(16*e,"px;color: #2c2c2c;"),a.innerHTML='\n \n icon/快捷回复播放\n \n \n \n \n \n ').concat(i.voiceName,""),a.onclick=function(){console.log("item:"+i),A.sendLoadingStats||(A.setBtnCheckStatus(n),A.sendQuickReply(i))},t.appendChild(a)}))}},{key:"setBtnCheckStatus",value:function(A){var e=this,t="";this.quickReplyList.forEach((function(i,n){t=document.getElementById("mobile-quickReply-list-item-".concat(n)),n==A?(t.style.background="#F4F6FC",t.style.color="#648FFC",e.setBtnCheckLoding(0,n)):(t.style.background="#ffffff",t.style.color="#2c2c2c")}))}},{key:"setBtnCheckLoding",value:function(A,e){console.log(e);var t=this.videoWidth/375||1;if(e>-1){var i=document.getElementById("mobile-quickReply-list-item-".concat(e)),n=document.getElementById("mobile-quickReply-name-".concat(e)),a=document.getElementById("mobile-quickReply-icon-".concat(e));if(1==A){if(document.getElementById("mobile-quickReply-icon-loading-".concat(e))&&n){var r=document.createElement("span");r.id="mobile-quickReply-icon-".concat(e),r.style="height:".concat(24*t,"px;"),r.innerHTML='\n \n icon/快捷回复播放\n \n \n \n \n \n '),i.insertBefore(r,n)}}else if(a&&n){i.removeChild(a);var o=document.createElement("span");o.id="mobile-quickReply-icon-loading-".concat(e),o.style="height:".concat(20*t,"px;width: ").concat(24*t,"px;"),o.innerHTML=''),i.insertBefore(o,n)}}}},{key:"getQuickReplyList",value:function(){var A=this;console.log("getQuickReplyList"),this.madeLoadingDom(0);JA(this.jSPlugin,(function(e){if(e&&200==e.code){var t=e.data||[],i=[];e.data.forEach((function(A,e){i=A.voiceName.split("_"),t[e].voiceName=i[1]})),A.quickReplyList=t,setTimeout((function(){A.madeLoadingDom(2)}),500)}else A.madeLoadingDom(1)}),(function(e){console.log(e),A.madeLoadingDom(1)}))}},{key:"madeLoadingDom",value:function(A){var e=this,t=this.videoWidth/375||1;if(0==A){if(document.getElementById("mobile-quickReply-content").style.display="none",document.getElementById("mobile-quickReply-loaderror").style.display="none",document.getElementById("mobile-quickReply-loading").style.display="block",!document.getElementById("mobile-quickReply-loading-box")){var i=document.createElement("div");i.id="mobile-quickReply-loading-box",i.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: row;",i.innerHTML='
    \n \n
    \n
    正在加载,请稍候
    '),document.getElementById("mobile-quickReply-loading").appendChild(i)}}else if(1==A){if(document.getElementById("mobile-quickReply-content").style.display="none",document.getElementById("mobile-quickReply-loading").style.display="none",document.getElementById("mobile-quickReply-loaderror").style.display="block",!document.getElementById("mobile-quickReply-loaderror-box")){var n=document.createElement("div");n.id="mobile-quickReply-loaderror-box",n.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: column;",n.innerHTML='
    \n \n
    \n
    \n 加载失败 \n 点击重试\n
    '),document.getElementById("mobile-quickReply-loaderror").appendChild(n),document.getElementById("mobile-quickReply-loaderror-reload").onclick=function(){e.getQuickReplyList()}}}else document.getElementById("mobile-quickReply-loading").style.display="none",document.getElementById("mobile-quickReply-loaderror").style.display="none",document.getElementById("mobile-quickReply-content").style.display="block",this.matchQuickReplyBtn()}},{key:"sendQuickReply",value:function(A){var e=this;this.sendLoadingStats=!0;HA(this.jSPlugin,A.fileUrl,(function(A){e.sendLoadingStats=!1,A&&200==A.code?e.toastCustom.initToastContent("快捷回复成功"):e.toastCustom.initToastContent("快捷回复失败,请重试"),e.popupCustom.closePopupCustom()}),(function(A){console.log(A),e.sendLoadingStats=!1,e.toastCustom.initToastContent("快捷回复失败,请重试"),e.popupCustom.closePopupCustom()}))}},{key:"closeQuickReplyEle",value:function(){this.popupCustom.closePopupCustom()}}])}(),zA=function(){return a((function A(e,i,n){t(this,A),this.jSPlugin=e,this.videoWidth=n,this.switchFooter=i,this.toastCustom=new YA(e,!0),this.lockStatus=!1,this.popupCustom=new XA(e,265),this.popupCustom.initPopupContent("远程开锁",this.renderRemoteUnlock()),this.renderRemoteUnlockSlide()}),[{key:"initRemoteUnlock",value:function(){document.getElementById("mobile-remoteUnlock-content")?this.madeSlideEvent():this.renderRemoteUnlock()}},{key:"renderRemoteUnlock",value:function(){var A=this.videoWidth/1024||1,e=document.createElement("div");return e.style="width:100%;",e.id="mobile-remoteUnlock-box",e.innerHTML='
    \n
    \n
    '),e}},{key:"renderRemoteUnlockSlide",value:function(){var A=this.videoWidth/375||1,e=document.getElementById("mobile-remoteUnlock-content"),t=document.createElement("div");t.id="mobile-remoteUnlock-content-slide",t.style="width: 100%;display: flex;justify-content: center;padding: 0 ".concat(15*A,"px"),t.innerHTML='
    \n
    \n
    右滑开锁
    \n
    \n \n icon/箭头向右\n \n \n \n \n \n \n
    \n
    '),e.appendChild(t),this.madeSlideEvent()}},{key:"madeSlideEvent",value:function(){var A=this.videoWidth/375||1,e=document.getElementById("mobile-remoteUnlock-slide-box"),t=document.getElementById("mobile-remoteUnlock-slide-bgColor"),i=document.getElementById("mobile-remoteUnlock-slide-tips"),n=document.getElementById("mobile-remoteUnlock-slide-ball"),a=this;n.ontouchstart=function(r){console.log("ontouchstart");var o=(r=r||window.event).touches[0].pageX;n.style.transition="",t.style.transition="",document.ontouchmove=function(r){var s=(r=r||window.event).touches[0].pageX-e.offsetLeft-o,g=e.clientWidth-n.clientWidth-8*A;s<=0&&(s=0),s>=g&&(s=g),n.style.left=s+"px",s!=g||a.lockStatus||(a.lockStatus=!0,document.getElementById("slide-ball-start").style.display="none",document.getElementById("slide-ball-end").style.display="inline",t.style.width=e.clientWidth+"px",t.style.backgroundColor="#598FFF",e.style.border="0",n.style.backgroundColor="#ffffff",i.textContent="正在开锁",i.style.color="#ffffff",n.ontouchstart=null,a.sendRemoteUnlockApi())},document.ontouchend=function(){a.lockStatus||(t.style.width="0px",n.style.left=8*A+"px",n.style.transition="left 0.6s linear",t.style.transition="width 0.6s linear"),document.ontouchend=null,document.ontouchmove=null}}}},{key:"resetRemoteUnlockSlide",value:function(){var A=this.videoWidth/1024||1;this.lockStatus=!1;var e=document.getElementById("mobile-remoteUnlock-slide-box"),t=document.getElementById("mobile-remoteUnlock-slide-bgColor"),i=document.getElementById("mobile-remoteUnlock-slide-tips"),n=document.getElementById("mobile-remoteUnlock-slide-ball");t.style.width="0px",n.style.left=8*A+"px",i.textContent="右滑开锁",i.style.color="#666666",document.getElementById("slide-ball-start").style.display="inline",document.getElementById("slide-ball-end").style.display="none",t.style.backgroundColor="#FFFFFF",e.style.border="1px solid rgba(255,255,255,1)",n.style.backgroundColor="#598FFF"}},{key:"sendRemoteUnlockApi",value:function(){var A=this;console.log("下发远程开锁");UA(this.jSPlugin,(function(e){e&&200==e.code?A.toastCustom.initToastContent("开锁成功"):A.toastCustom.initToastContent("开锁失败,请重试"),A.popupCustom.closePopupCustom()}),(function(e){console.log(e),A.toastCustom.initToastContent("开锁失败,请重试"),A.popupCustom.closePopupCustom()}))}},{key:"closeRemoteUnlock",value:function(){this.popupCustom.closePopupCustom()}}])}(),$A={customConfig:{defaultMicro:0,defaultPlay:0,maxTalkTime:0,bellPoster:0,maxBellTime:0},header:{onBell:{color:"#2c2c2c",backgroundColor:"#00000000 linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.00) 100%)",activeColor:"#1890FF",autoFocus:0,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-0",iconId:"ringStatus",part:"left",defaultActive:0,isrender:1,color:"#2c2c2c",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-1",iconId:"deviceCategory",part:"left",defaultActive:0,isrender:1,color:"#2c2c2c",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"}]},onCall:{color:"#2c2c2c",backgroundColor:"#00000000",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-0",iconId:"callStatus",part:"left",defaultActive:0,isrender:1,color:"#2c2c2c",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-1",iconId:"deviceCategory",part:"left",defaultActive:0,isrender:1,color:"#2c2c2c",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"}]}},footer:{onBell:{color:"#2c2c2c",backgroundColor:"#00000000",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-0",iconId:"quickReply",part:"left",defaultActive:1,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-1",iconId:"rejection",part:"left",defaultActive:0,isrender:1,color:"#2C2C2C",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-2",iconId:"answer",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-3",iconId:"remoteUnlock",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"}]},onCall:{color:"#2c2c2c",backgroundColor:"#00000080",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-0",iconId:"mute",part:"left",defaultActive:1,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-1",iconId:"hangUp",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-2",iconId:"remoteUnlock",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"}]}}},Ae=function(A){var e="";return Object.keys(A).map((function(t,i){e+="".concat(t,":").concat(A[t]).concat(i1&&void 0!==arguments[1])||arguments[1],t=r.themeData,i=t.header,n=t.footer,a=null;if("onCall"==A){console.log("接听"),r.bellStatus="onCall",r.switchFooter("onCall"),n[r.bellStatus].btnList.map((function(A,e){A.isrender&&r.renderFooter(A.iconId,A),"mute"==A.iconId&&(a=A)})),i[r.bellStatus].btnList.map((function(A,e){A.isrender&&r.renderHeader(A.iconId,A)}));var o=document.getElementById("".concat(r.jSPlugin.id,"-header-onBell"));o&&o.parentElement.removeChild(o),1==r.themeData.customConfig.bellPoster&&document.getElementById("bellring-icon")&&document.getElementById("".concat(r.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),0==r.themeData.customConfig.defaultMicro&&a?r.muteCommon(a):r.setDecoderState({mute:!1},a.backgroundColor),r.removeBellRing(),r.miniRecCloseClick()}else console.log("响铃"),r.bellStatus="onBell",r.jSPlugin.Theme.changeTheme(r.themeData,e)})),o(this,"muteCommon",(function(A){var e=r.decoderState.state,t=e.talk,i=e.sound;t?(console.log("结束对讲"),r.setDecoderState({talk:!1,mute:!0},A.backgroundColor),r.jSPlugin.Talk.stopTalk(),i||r.jSPlugin.openSound(),r.setDecoderState({sound:!0})):(r.setDecoderState({talk:!1,mute:!0},A.backgroundColor),i||r.jSPlugin.openSound(),r.setDecoderState({sound:!0}))})),o(this,"autoPlayRing",(function(){console.log("autoPlayRing");var A=document.getElementById("bellring-audio");A&&(A.muted=!1,A.src="https://resource.eziot.com/group2/M00/00/8F/CtwQFmPbWnOAGuT5AAHZihhCJEM230.mp3",A.paused&&A.play()),r.checkIsAppleDevice()||!1?window.removeEventListener("touchstart",r.autoPlayRing):window.removeEventListener("click",r.autoPlayRing)})),this.jSPlugin=e,this.videoWidth=e.width,this.videoHeight=e.height,this.themeData=i,this.setDecoderState=n,this.decoderState=a,this.isNeedRenderHeader=!1,this.isNeedRenderFooter=!1,this.autoFocus=0,this.autoFocusTimer=null,this.bellStatus="onBell",this.recordTimer=null,this.nextRate=1,this.themeInited=!1,this.inited=!1,this.miniRecStatus="rec",this.activeThemeStatus=!0,this.activeThemeStatusTxt="模板未激活",this.miniRecNum=0,this.toastCustom=new YA(e,!0)}),[{key:"initBellRing",value:function(){var A=this,e=this.decoderState.state,t=e.play,i=e.isEditing,n=this.videoWidth,a=n/375;this.maxBellTime=1e3*this.themeData.customConfig.maxBellTime;var r=document.getElementById("bellring"),o=document.getElementById("bellring-audio");if(!r&&!o){if(this.jSPlugin.isNeedBellRing){var s=document.createElement("div");s.id="bellring",s.innerHTML='
    \n \n
    ',document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(s)}if(1!=this.themeData.customConfig.bellPoster||i)document.getElementById("bellring-icon")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon"));else{var g=1.8*n,c=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(c=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+.1*g+6);var l=c+(this.videoHeight-130*a)/2,I=document.createElement("div");I.id="bellring-icon",I.style="position: absolute;pointer-events: none;background: none;width: 100%;\n position: absolute;top: ".concat(l,"px;display: flex;align-items: center;justify-content: center;"),I.innerHTML='
    \n
    \n \n icon/响铃\n \n \n \n \n \n
    \n
    '),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(I),t&&"onBell"==this.bellStatus&&this.jSPlugin.pause()}setTimeout((function(){var e=A.decoderState.state,t=e.isEditing,i=e.rejection;"onBell"!=A.bellStatus||i||(A.removeBellRing(),t||A.answerOvertime())}),this.maxBellTime)}}},{key:"removeBellRing",value:function(){document.getElementById("bellring")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring")),document.getElementById("bellring-icon")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon"))}},{key:"getMiniCallTimeUrl",value:function(){if(console.log("--------------getMiniCallTimeUrl"),-1!==this.jSPlugin.url.indexOf("hd.live")?this.recUrl=this.jSPlugin.url.replace("hd.live","rec"):this.recUrl=this.jSPlugin.url.replace("live","rec"),this.jSPlugin.callTime){var A=parseInt(this.jSPlugin.callTime),e=A+5e3,t=new Date(A-1e4).Format("yyyyMMddhhmmss"),i=new Date(e).Format("yyyyMMddhhmmss");this.recUrl="".concat(this.recUrl,"?begin=").concat(t,"&end=").concat(i),console.log("recurl="+this.recUrl)}}},{key:"initMiniRec",value:function(){var A=this,e=this,t=this.videoWidth,i=t/375,n=1.8*t,a=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(a=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+.1*n+6);var r=a+this.videoHeight+10*i;if(console.log(a),document.getElementById("miniRecbox"))document.getElementById("miniRecbox")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniRecbox")),document.getElementById("miniClose")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniClose")),this.initMiniRec();else{var o=document.createElement("div");o.id="miniRecbox",o.style="-webkit-border-radius: 8px;border-radius: 8px;overflow: hidden;position: absolute;top: ".concat(r,"px;right: ").concat(9*i,"px;"),o.innerHTML='
    ',document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(o),this.getMiniCallTimeUrl();var s={domain:V};this.miniRecPlayer=new wl({id:"miniRec",width:160*i,height:90*i,template:"miniRec",url:this.recUrl,token:this.jSPlugin.token,handleError:function(t){console.log("小窗口handleError------------",t),t&&6701==t.retcode?(A.miniRecNum=A.miniRecNum+1,console.log("小窗口miniRecNum-----------------",A.miniRecNum),A.miniRecNum<5?e.miniRecPlayer.changePlayUrl({type:"miniRec"}):(console.log("小窗口------------------已播放5次,关闭小窗口"),e.miniRecCloseClick())):(console.log("小窗口------------------播放失败,关闭小窗口"),e.miniRecCloseClick())},env:this.jSPlugin.env||s});var g=document.createElement("div");g.id="miniClose",g.style="position: absolute;top: ".concat(r+8,"px;right: ").concat(16*i,"px;"),g.innerHTML='
    \n \n close\n \n \n \n \n \n \n \n
    '),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(g),document.getElementById("miniClose-btn").onclick=function(){e.miniRecCloseClick()}}}},{key:"initMiniImageRec",value:function(){console.log("initMiniImageRec");var A=this.videoWidth/375,e=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(e=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+26);var t=e+this.videoHeight+10*A;if(document.getElementById("miniRecbox"))document.getElementById("miniRecbox").style.top=t+"px",document.getElementById("miniClose").style.top=t+8+"px";else{var i=document.createElement("div");i.id="miniRecbox",i.style="-webkit-border-radius: 8px;border-radius: 8px;overflow: hidden;position: absolute;\n top: ".concat(t,"px;\n right: ").concat(9*A,"px;\n user-select: none;\n "),i.innerHTML='
    \n \n
    示意小窗位置
    \n
    '),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(i);var n=document.createElement("div");n.id="miniClose",n.style="z-index: 4;position: absolute;top: ".concat(t+8,"px;right: ").concat(16*A,"px;"),n.innerHTML='
    \n \n close\n \n \n \n \n \n \n \n
    '),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(n),document.getElementById("miniClose-btn").onclick=function(){}}}},{key:"miniRecCloseClick",value:function(){document.getElementById("miniRecbox")&&(console.log("---------------------miniRecCloseClick"),"rec"==this.miniRecStatus&&(this.miniRecPlayer&&this.miniRecPlayer.stop(),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniClose")),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniRecbox"))))}},{key:"miniRecSwitchClick",value:function(){console.log("---------------小窗口切换");var A=this.decoderState.state.isEditing,e=this.videoWidth,t=e/375,i=1.8*e,n=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(n=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+.1*i+6),console.log("headerHeight-------",n);var a=n+this.videoHeight+10*t;if(console.log("videoTop-------",a),"rec"==this.miniRecStatus){this.miniRecStatus="live",A?(document.getElementById("miniRec-embed").style.width=this.jSPlugin.width+"px",document.getElementById("miniRec-embed").style.height=this.jSPlugin.height+"px",document.getElementById("miniRec").style.width=this.jSPlugin.width+"px",document.getElementById("miniRec").style.height=this.jSPlugin.height+"px"):this.miniRecPlayer.reSize(this.jSPlugin.width,this.jSPlugin.height),this.jSPlugin.reSize(160*t,90*t);var r=this.videoHeight+10*t,o=.2*i-90*t-10*t;document.getElementById("".concat(this.jSPlugin.id,"-wrap")).style.width=this.videoWidth+"px",document.getElementById("".concat(this.jSPlugin.id)).style.marginTop=r+"px",document.getElementById("".concat(this.jSPlugin.id)).style.marginLeft=e-160*t-9+"px",document.getElementById("".concat(this.jSPlugin.id)).style.overflow="hidden",document.getElementById("".concat(this.jSPlugin.id)).style.borderRadius="8px",document.getElementById("miniRecbox").style.top=n+"px",document.getElementById("miniRecbox").style.left="0",document.getElementById("miniRecbox").style.right="0",document.getElementById("miniRecbox").style.borderRadius="0px",document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop=o+"px"}else console.log(this.jSPlugin.width),this.miniRecStatus="rec",A?(document.getElementById("miniRec-embed").style.width=160*t+"px",document.getElementById("miniRec-embed").style.height=90*t+"px",document.getElementById("miniRec").style.width=160*t+"px",document.getElementById("miniRec").style.height=90*t+"px"):this.miniRecPlayer.reSize(160*t,90*t),this.jSPlugin.reSize(this.videoWidth,this.videoHeight),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).style.width=this.videoWidth+NaN,document.getElementById("".concat(this.jSPlugin.id)).style.marginTop="0",document.getElementById("".concat(this.jSPlugin.id)).style.marginLeft="0",document.getElementById("".concat(this.jSPlugin.id)).style.overflow="hidden",document.getElementById("".concat(this.jSPlugin.id)).style.borderRadius="0px",document.getElementById("miniRecbox").style.top=a+"px",document.getElementById("miniRecbox").style.right="9px",document.getElementById("miniRecbox").style.left="auto",document.getElementById("miniRecbox").style.borderRadius="8px",document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop=.2*i+"px"}},{key:"matchBtn",value:function(A,e){var t=this,i=this.themeData,n=i.header,a=i.footer,r=this.decoderState.state,o=r.mute,s=r.rejection;document.documentElement.clientHeight;var g=this.videoWidth/375,c=this.videoWidth/375||1,l={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}};-1===n[this.bellStatus].btnList.findIndex((function(e){return e.iconId===A}))?(l.color=a[this.bellStatus].color,l.backgroundColor=a[this.bellStatus].backgroundColor,l.activeColor=a[this.bellStatus].activeColor):(l.color=n[this.bellStatus].color,l.backgroundColor=n[this.bellStatus].backgroundColor,l.activeColor=n[this.bellStatus].activeColor);var I=this.videoWidth/4;switch(A){case"ringStatus":return l.title=this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,l.id=A,l.domString='').concat(this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,""),l.onclick=function(){},l;case"deviceCategory":return l.title="设备名称",l.id=A,l.domString='').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"设备名称",""),l.onclick=function(){},l;case"callStatus":return l.title="通话中",l.id=A,l.domString='通话中'),l.onclick=function(){},l;case"deviceCategory":return l.title="设备名称",l.id=A,l.domString='').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"设备名称",""),l.onclick=function(){},l;case"rejection":return l.title="拒绝",l.id=A,l.domString='
    \n
    \n \n 拒绝\n \n \n \n \n \n
    \n
    拒绝
    \n
    '),l.onclick=function(){var A=t,e=t.decoderState.state,i=e.play,n=e.isEditing,a=e.rejection;if(n||a)return!1;console.log("拒绝"),i&&t.jSPlugin.stop(),t.removeBellRing(),t.setDecoderState({play:!1,rejection:!0}),A.miniRecCloseClick(),t.rejectionStatusDispose(),"function"==typeof t.jSPlugin.hangUpCallback&&t.jSPlugin.hangUpCallback("rejection")},l;case"quickReply":return l.title="快捷回复",l.id=A,l.domString='
    \n
    \n \n 快捷回复\n \n \n \n \n \n
    \n
    快捷回复
    \n
    '),l.onclick=function(){var A=t.decoderState.state,e=A.isEditing,i=A.rejection;if(e||i)return!1;console.log("快捷回复"),t.switchFooter("quickReply"),t.quickReplyEle=new qA(t.jSPlugin,t.switchFooter,t.videoWidth)},l;case"answer":return l.title="接听",l.id=A,l.domString='
    \n
    \n \n 接听\n \n \n \n \n \n
    \n
    接听
    \n
    '),l.onclick=function(){var A=t.decoderState.state,i=A.play,r=A.isEditing,o=A.talk,s=A.sound,g=A.rejection;if(r||g)return!1;console.log("接听"),t.jSPlugin.pluginStatus.loadingClear(),t.bellStatus="onCall",t.switchFooter("onCall"),a[t.bellStatus].btnList.map((function(A,e){A.isrender&&t.renderFooter(A.iconId,A)})),n[t.bellStatus].btnList.map((function(A,e){A.isrender&&t.renderHeader(A.iconId,A)}));var c=document.getElementById("".concat(t.jSPlugin.id,"-header-onBell"));c&&c.parentElement.removeChild(c),1==t.themeData.customConfig.bellPoster&&(document.getElementById("bellring-icon")&&document.getElementById("".concat(t.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),t.jSPlugin.setPoster("")),t.removeBellRing(),t.miniRecCloseClick(),i||(t.jSPlugin.pluginStatus.loadingStart(t.jSPlugin.id),t.jSPlugin.pluginStatus.loadingSetText({text:"视频加载中"}),t.jSPlugin.play(),t.setDecoderState({play:!i})),o||1!=t.themeData.customConfig.defaultMicro||(t.setDecoderState({talk:!0,mute:!1}),s&&t.jSPlugin.closeSound(),t.jSPlugin.Talk.startTalk()),t.setDecoderState({sound:!1}),0==t.themeData.customConfig.defaultMicro&&(t.muteCommon(e),t.jSPlugin.openSound(),t.setDecoderState({sound:!0})),t.maxTalkTime=1e3*t.themeData.customConfig.maxTalkTime*60;var l=t;setTimeout((function(){o&&(console.log("结束对讲"),l.setDecoderState({talk:!1}),l.jSPlugin.Talk.stopTalk()),i&&(l.jSPlugin.stop(),l.setDecoderState({play:!i})),t.rejectionStatusDispose(),t.remoteUnlockEle&&t.remoteUnlockEle.closeRemoteUnlock(),"function"==typeof t.jSPlugin.hangUpCallback&&t.jSPlugin.hangUpCallback("hangUp")}),t.maxTalkTime)},l;case"remoteUnlock":return l.title="远程开锁",l.id=A,l.domString='
    \n
    \n \n 开锁\n \n \n \n \n \n
    \n
    远程开锁
    \n
    '),l.onclick=function(){var A=t.decoderState.state,e=A.isEditing;A.play;var i=A.rejection;if(e||"onBell"==t.bellStatus||i)return!1;console.log("远程开锁"),t.switchFooter("remoteUnlock"),t.remoteUnlockEle=new zA(t.jSPlugin,t.switchFooter,t.videoWidth)},l;case"mute":return l.title="静音",l.id=A,l.domString='
    \n
    \n \n icon/静音\n \n \n \n \n \n
    \n
    静音
    \n
    '),l.onclick=function(){var A=t.decoderState.state,i=A.talk,n=A.sound;if(A.play,A.rejection)return!1;console.log("静音"),i?(console.log("结束对讲"),t.setDecoderState({talk:!1,mute:!0},e.backgroundColor),t.jSPlugin.Talk.stopTalk(),t.jSPlugin.openSound(),t.setDecoderState({sound:!0})):(console.log("开始对讲"),t.setDecoderState({talk:!0,mute:!1},e.backgroundColor),n&&(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1})),t.jSPlugin.Talk.startTalk())},l;case"hangUp":return l.title="挂断",l.id=A,l.domString='
    \n
    \n \n 挂断\n \n \n \n \n \n
    \n
    挂断
    \n
    '),l.onclick=function(){var A=t,e=t.decoderState.state,i=e.talk,n=e.play;if(e.rejection)return!1;i&&(console.log("结束对讲"),t.setDecoderState({talk:!1}),t.jSPlugin.Talk.stopTalk()),n&&(t.jSPlugin.stop(),t.setDecoderState({play:!n})),(n||i)&&(A.miniRecCloseClick(),console.log("挂断"),t.rejectionStatusDispose(),"function"==typeof t.jSPlugin.hangUpCallback&&t.jSPlugin.hangUpCallback("hangUp"))},l;default:return l}}},{key:"answerOvertime",value:function(){this.toastCustom.initToastContent("应答超时");var A=this.decoderState.state.play;console.log("应答超时"),A&&this.jSPlugin.stop(),this.setDecoderState({play:!1,rejection:!0}),this.miniRecCloseClick(),this.rejectionStatusDispose(),this.quickReplyEle&&this.quickReplyEle.closeQuickReplyEle(),"function"==typeof this.jSPlugin.hangUpCallback&&this.jSPlugin.hangUpCallback("rejection")}},{key:"rejectionStatusDispose",value:function(){var A=this,e=this.themeData.footer,t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn")),a=document.getElementById("header-".concat(this.bellStatus,"-ringStatus"));"onBell"==this.bellStatus?(t.innerHTML="",n.innerHTML="",t.style.color="#2C2C2C"):(i.innerHTML="",i.style.color="#2C2C2C"),console.log("rejectionStatusDispose"),this.setDecoderState({rejection:!0}),e[this.bellStatus].btnList.map((function(e,t){e.isrender&&A.renderFooter(e.iconId,e)})),a.innerText="通话已结束",this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.pluginStatus.loadingSetTextWithBtn({text:"通话已结束",color:"white",isMobile:!0,type:2})}},{key:"userNoDevice",value:function(){var A=this;this.removeBellRing(),this.setDecoderState({rejection:!0});var e=this.themeData.footer,t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn"));"onBell"==this.bellStatus?(t.innerHTML="",n.innerHTML="",t.style.color="#2C2C2C"):(i.innerHTML="",i.style.color="#2C2C2C"),console.log("userNoDevice"),this.setDecoderState({rejection:!0}),e[this.bellStatus].btnList.map((function(e,t){e.isrender&&A.renderFooter(e.iconId,e)})),this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.pluginStatus.loadingSetTextWithBtn({text:"该用户不拥有该设备",color:"white",isMobile:!0,type:2})}},{key:"renderHeader",value:function(A,e){var t=this,i=this.matchBtn(A,e);if(document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content"))){var n=document.createElement("span");n.innerHTML="".concat(i.domString),document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content")).appendChild(n)}else{var a=document.createElement("div");a.id="".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus),a.style="max-width:50%;position:relative;",a.innerHTML='\n ').concat(i.domString,"\n "),a.onclick=function(A){if(t.decoderState.state.isEditing)return!1;i.onclick(A)},document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[0].appendChild(a)}}},{key:"renderFooter",value:function(A,e){var t=this,i=this.decoderState.state.mute;if("remoteUnlock"==A&&this.jSPlugin.capacity&&(!this.jSPlugin.capacity.support_unlock||0==this.jSPlugin.capacity.support_unlock))return!1;var n=this.matchBtn(A,e),a=this.videoWidth/4,r=document.createElement("div");if(r.className="theme-icon-item","quickReply"!==n.id&&(r.style="width:".concat(.66*a,"px;padding:0 ").concat(.12*a,"px;box-sizing: content-box;-webkit-tap-highlight-color:transparent;")),r.innerHTML="".concat('')+'
    ')).concat(n.domString,"
    ")+"
    ",r.onclick=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;n.onclick(A)},n.onmouseenter&&(r.onmouseenter=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;n.onmouseenter(A)}),n.onmouseleave&&(r.onmouseleave=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;n.onmouseleave(A)}),"quickReply"!=A){var o=document.createElement("span");o.className="icon-move left",o.innerHTML='\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),o.onclick=function(){t.editIcon(n.id,"left","footer")},r.appendChild(o);var s=document.createElement("span");s.className="icon-move right",s.innerHTML='\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),s.onclick=function(){t.editIcon(n.id,"right","footer")},r.appendChild(s)}if("answer"==A||"rejection"==A||"hangUp"==A);else{var g=document.createElement("span");g.className="icon-move close",g.innerHTML='\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),g.onclick=function(){t.editIcon(n.id,"delete","footer")},r.appendChild(g)}"onCall"==this.bellStatus?document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).appendChild(r):(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).appendChild(r),"quickReply"===n.id&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn")).appendChild(r)),this.decoderState.state.isEditing&&"mute"==A&&"onCall"==this.bellStatus&&(0!=this.themeData.customConfig.defaultMicro||i?this.setDecoderState({mute:!1},e.backgroundColor):this.setDecoderState({mute:!0},e.backgroundColor))}},{key:"switchFooter",value:function(A){var e=this.themeData.footer;switch(A){case"onBell":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"))?"none"==document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-btn-quickReply")).style.display="flex"):(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-btn-quickReply")).style.display="flex");break;case"onCall":document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-btn-quickReply")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display="flex",this.themeData&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.color=e[this.bellStatus].color)}}},{key:"initThemeData",value:function(){var A=this;console.log("-------------initThemeData");var e=this.themeData,t=e.header,i=e.footer,n=this.decoderState.state.isEditing,a=this.videoWidth,r=a/375,s=1.8*a,g=this.jSPlugin.id;if(this.isNeedRenderHeader=M.findIndex(t[this.bellStatus].btnList,(function(A){return A.isrender>0}))>=0,this.isNeedRenderFooter=M.findIndex(i[this.bellStatus].btnList,(function(A){return A.isrender>0}))>=0,this.isNeedRenderHeader)if(document.getElementById("".concat(this.jSPlugin.id,"-headControl")))document.getElementById("".concat(this.jSPlugin.id,"-headControl")).innerHTML="
    ");else{var c=document.createElement("div");c.setAttribute("id","".concat(this.jSPlugin.id,"-headControl")),c.setAttribute("class","header-controls"),c.innerHTML="
    "),console.log(this.jSPlugin.height),this.jSPlugin.height;var l=o(o({display:"flex","justify-content":"space-between",top:0,"z-index":999,color:"#FFFFFF",width:"100%",position:"relative","margin-bottom":.1*s+"px","align-items":"center","text-align":"center","font-size":"24ox"},"color","#2c2c2c"),"margin-top","6px");c.style=Ae(l),document.getElementById("".concat(g,"-wrap")).insertBefore(c,document.getElementById(g));var I=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(I)}),50)}else document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-headControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-headControl")));if(this.jSPlugin.height,this.isNeedRenderFooter)if(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")))document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="".concat(.2*s,"px"),"onCall"==this.bellStatus?document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='\n \n \n \n \n \n '):document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='\n \n \n \n \n \n '));else{var d=document.createElement("div");d.setAttribute("id","".concat(this.jSPlugin.id,"-ez-iframe-footer-container")),d.setAttribute("class","ez-iframe-footer-container");var C={position:"relative","margin-top":.2*s+"px",display:"flex","flex-wrap":"wrap","justify-content":"space-between","z-index":999,top:0,color:"#FFFFFF",width:"100%","align-items":"center","font-size":"12px"};d.style=Ae(C),d.innerHTML='\n \n \n \n \n \n '),Q(d,document.getElementById(g))}else document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")));if(this.isNeedRenderHeader&&document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&t[this.bellStatus].btnList.map((function(e,t){e.isrender&&A.renderHeader(e.iconId,e)})),this.isNeedRenderFooter&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=i[this.bellStatus].backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=i[this.bellStatus].color,i[this.bellStatus].btnList.map((function(e,t){e.isrender&&A.renderFooter(e.iconId,e)}))),1!=this.themeData.customConfig.bellPoster||n)this.jSPlugin.setPoster("");else{this.jSPlugin.poster="https://resource.eziot.com/group1/M00/00/B8/CtwQEmPbGh2AVJB-ABDcYtyw5gk899.svg";var h=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(h),A.jSPlugin.setPoster(A.jSPlugin.poster))}),50)}this.activeThemeStatus&&(this.initBellRing(),this.checkIsAppleDevice()||!1?window.addEventListener("touchstart",this.autoPlayRing):window.addEventListener("click",this.autoPlayRing));this.inited=!0,this.getCallDeviceInfo()}},{key:"checkIsAppleDevice",value:function(){var A=navigator.userAgent,e=!!A.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),t=A.indexOf("iPad")>-1,i=A.indexOf("iPhone")>-1||A.indexOf("Mac")>-1;return!!(e||t||i)}},{key:"renderThemeData",value:function(){var A=this,e=this.themeData,t=e.header,i=e.footer,n=this.decoderState.state.isEditing;if(this.isNeedRenderHeader&&t&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=t[this.bellStatus].color.replace("-diy",""),t[this.bellStatus].btnList.map((function(e,t){e.isrender&&A.setDecoderState(o({},e.iconId,A.decoderState.state[e.iconId]))}))),this.isNeedRenderFooter&&i)document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=i[this.bellStatus].backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=i[this.bellStatus].color.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.color=i[this.bellStatus].color.replace("-diy",""),i[this.bellStatus].btnList.map((function(e,t){if(e.isrender&&A.setDecoderState(o({},e.iconId,A.decoderState.state[e.iconId])),console.log("-------------activeThemeStatus"),0==t&&!A.themeInited&&A.activeThemeStatus)var i=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(i),1!=A.themeData.customConfig.bellPoster||n?A.jSPlugin.play():A.jSPlugin.pluginStatus.loadingClear(),A.themeInited=!0)}),50)})),-1!==this.jSPlugin.url.indexOf("hd.live")&&this.setDecoderState({hd:!0}),this.themeData.autoFocus>0&&(this.autoFocus=parseInt(this.themeData.autoFocus),this.startAutoFocus(),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).addEventListener("click",(function(){A.stopAutoFocus()}))),this.setDecoderState({cloudRec:"cloud.rec"===y(this.jSPlugin.url).type,rec:"rec"===y(this.jSPlugin.url).type,type:y(this.jSPlugin.url).type});else if(!this.themeInited&&this.activeThemeStatus)var a=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(a),A.themeData&&A.themeData.customConfig&&1==A.themeData.customConfig.bellPoster&&!n?A.jSPlugin.pluginStatus.loadingClear():A.jSPlugin.play(),A.themeInited=!0)}),50);var r=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(r),A.jSPlugin.reSize(A.jSPlugin.params.width,A.jSPlugin.params.height))}),50);n||this.jSPlugin.isWebConsole?1==this.themeData.customConfig.miniWinRec?this.initMiniImageRec():this.miniRecCloseClick():setTimeout((function(){"onBell"==A.bellStatus&&A.jSPlugin.capacity&&1==A.jSPlugin.capacity.support_doorcall_playback&&(console.log("小窗口initMiniRec-------------设备能力集成功"),1==A.themeData.customConfig.miniWinRec&&(console.log("小窗口initMiniRec---------------画中画设置已开启"),(!A.deviceInfoData||A.deviceInfoData&&!A.deviceInfoData.isEncrypt)&&(console.log("小窗口initMiniRec---------------设备未加密"),A.miniRecNum=0,A.initMiniRec())))}),1e3)}},{key:"setThemeData",value:function(A,e){this.themeData=A,"onCall"==e&&(this.bellStatus="onCall")}},{key:"startAutoFocus",value:function(){var A=this,e=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById("".concat(A.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(A.jSPlugin.id,"-audioControls")).style.opacity=0,document.getElementById("".concat(A.jSPlugin.id,"-audioControls")).style.pointerEvents="none")}),1e3*e)}},{key:"stopAutoFocus",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.startAutoFocus()}},{key:"editIcon",value:function(A,e,t){console.log("编辑组件",A,e,t);var i=this.themeData;console.log("themeData",this.themeData);var n=this.themeData[t][this.bellStatus].btnList,a=M.findIndex(n,(function(e){return e.iconId===A})),r=n[a];switch(e){case"delete":n[a].isrender=0;break;case"right":for(var o=-1,s=a+1;s=0;c--)if(n[c].part===n[a].part&&1==n[c].isrender){g=c;break}-1!==g&&(n[a]=n[g],n[g]=r)}console.log("new btnList",n),i[t][this.bellStatus].btnList=n,this.jSPlugin.Theme.changeTheme(i)}},{key:"countTime",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var i=document.createElement("div");i.id=this.jSPlugin.id+"time-area",i.className="time-area",i.innerHTML='00:00',document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).appendChild(i)}if(this.countTimer&&clearInterval(this.countTimer),"add"===A){var n=e;document.getElementById(t.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++n,document.getElementById(t.jSPlugin.id+"time-area").children[1].innerHTML=function(A){var e=parseInt(A),t=0,i=0,n="00",a="00",r="00";e>59&&(t=parseInt(e/60),e=parseInt(e%60),t>59&&(i=parseInt(t/60),t=parseInt(t%60)));return n=parseInt(e)>9?parseInt(e):"0"+parseInt(e),a=parseInt(t)>9?parseInt(t):"0"+parseInt(t),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?r+":"+a+":"+n:t>0?a+":"+n:"00:"+n}(n)}),1e3)}else"destroy"===A&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(t.jSPlugin.id+"time-area")&&(document.getElementById(t.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(t.jSPlugin.id+"time-area").style.display="none"))}},{key:"editStart",value:function(A){console.log("----------editStart1");var e=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));document.getElementById("".concat(this.jSPlugin.id,"-headControl")),e&&e.setAttribute("class","footer-controls themeEditing"),t&&t.setAttribute("class","footer-controls themeEditing"),this.setDecoderState({isEditing:!0})}},{key:"editEnd",value:function(A){console.log("----------editEnd1");var e=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),t=document.getElementById("".concat(this.jSPlugin.id,"-headControl")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));t&&t.setAttribute("class","header-controls"),e&&e.setAttribute("class","footer-controls"),i&&i.setAttribute("class","footer-controls")}},{key:"fetchThemeData",value:function(A){var e=this;switch(this.jSPlugin.themeId){case"pcLive":case"pcRec":case"mobileLive":case"mobileRec":case"miniRec":break;default:PA(this.jSPlugin,A,(function(A){0==A.meta.code&&A.data?(e.activeThemeStatus=!0,e.themeData=A.data,A.data.header&&(e.themeData.header=A.data.header,e.themeData.header[e.bellStatus].btnList=e.themeData.header[e.bellStatus].btnList.sort((function(A,e){return A.btnKey.split("-")[3]-e.btnKey.split("-")[3]}))),A.data.footer&&(e.themeData.footer=A.data.footer,e.themeData.footer[e.bellStatus].btnList=e.themeData.footer[e.bellStatus].btnList.sort((function(A,e){return A.btnKey.split("-")[3]-e.btnKey.split("-")[3]}))),e.jSPlugin.capacity?(e.initThemeData(),e.renderThemeData()):setTimeout((function(){e.initThemeData(),e.renderThemeData()}),300)):(e.activeThemeStatus=!1,e.jSPlugin.pluginStatus.loadingClear(),e.setDecoderState({rejection:!0}),"111021"==A.meta.code?(e.jSPlugin.pluginStatus.loadingSetText({text:"无效的模板id",color:"#fff",type:1}),e.activeThemeStatusTxt="无效的模板id"):"111023"==A.meta.code?(e.jSPlugin.pluginStatus.loadingSetText({text:"您的试用特权已到期,需前往轻应用控制台购买后使用。",color:"#fff",type:1}),e.activeThemeStatusTxt="试用特权已到期"):(e.jSPlugin.pluginStatus.loadingSetText({text:"模板未激活,请先在开放平台轻应用控制台购买模板",color:"#fff",type:1}),e.activeThemeStatusTxt="模板未激活"),e.themeData=$A,e.initThemeData(),e.renderThemeData())}),(function(){e.renderThemeData()}))}}},{key:"getCallDeviceInfo",value:function(){var A=this;this.videoWidth,jA({accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,deviceSerial:y(this.jSPlugin.url).deviceSerial}).then((function(e){e.data&&(A.deviceInfoData=e.data,e.data.isEncrypt&&(console.log("小窗口miniRecCloseClick------------设备已加密"),A.miniRecCloseClick(),setTimeout((function(){A.jSPlugin.pluginStatus.loadingClear(),A.jSPlugin.pluginStatus.loadingSetText({text:"视频已加密",color:"#fff"})}),1e3)),document.getElementById("header-".concat(A.bellStatus,"-deviceCategory"))&&(document.getElementById("header-".concat(A.bellStatus,"-deviceCategory")).innerText=""+e.data.deviceName))})).catch((function(e){console.log("获取设备信息失败",e),20018!=e.code||A.jSPlugin.isWebConsole||A.userNoDevice()}))}},{key:"setHeaderText",value:function(A){console.log("setHeaderText");var e=this.videoWidth/375||1;document.getElementById("".concat(this.jSPlugin.id,"-deviceCategory-content"))&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceCategory-content")).innerHTML='').concat(A,'').concat(this.deviceInfoData&&this.deviceInfoData.category||"",""))}}])}(),te=function(){return a((function A(e){if(t(this,A),this.jSPlugin=e,this.videoWidth=e.width,this.autoFocus=0,this.autoFocusTimer=null,this.decoderState={state:{isEditing:!1,play:!1,sound:!1,recordvideo:!1,recordCount:"00:00",talk:!1,mute:!1,rejection:!1,cloudRec:"cloud.rec"===y(e.url).type,rec:"rec"===y(e.url).type,type:y(e.url).type}},console.log("matchEzopenUrl(jSPlugin.url)",y(e.url),this.decoderState.state),this.isMobile=navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i),void 0!==e.isMobile&&(this.isMobile=e.isMobile),this.themeData={},"themeData"==this.jSPlugin.themeId&&(this.themeData=this.jSPlugin.params.themeData),this.jSPlugin.themeId)if(this.isMobile?this.call=new ee(this.jSPlugin,this.themeData,this.setDecoderState,this.decoderState):this.call=new ZA(this.jSPlugin,this.themeData,this.setDecoderState,this.decoderState),"themeData"===this.jSPlugin.themeId)this.themeData=this.jSPlugin.params.themeData,this.call.initThemeData(),this.call.renderThemeData();else this.call.fetchThemeData(this.jSPlugin.themeId);this.jSPlugin.Talk||(this.jSPlugin.Talk=new EA(this.jSPlugin)),B("".concat(this.jSPlugin.staticPath,"/speed/speed.css")),B("".concat(this.jSPlugin.staticPath,"/css/theme.css"))}),[{key:"changeTheme",value:function(A){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"onBell";if("string"==typeof A)switch(this.jSPlugin.themeId=A,this.jSPlugin.themeId){case"pcLive":case"mobileCall":case"webCall":this.call.initThemeData(),this.call.renderThemeData();break;default:this.call.fetchThemeData(A)}else"object"===d(A)&&(this.themeData=A,this.call.setThemeData(A,t),this.call.initThemeData(),this.call.renderThemeData(),this.decoderState.state.isEditing&&e&&this.call.editStart());this.jSPlugin&&this.jSPlugin.handleThemeChange&&this.jSPlugin.handleThemeChange(A)}},{key:"setDecoderState",value:function(A,e){var t=this,i=this.themeData;i.header,i.footer,Object.keys(A).map((function(i){if("mute"===i)document.getElementById("".concat(t.jSPlugin.id,"-icon-mute"))&&(console.log("mute"),A[i]?(document.getElementById("".concat(t.jSPlugin.id,"-icon-mute")).style.background=e,document.getElementById("".concat(t.jSPlugin.id,"-icon-mute")).style.border=" 1px solid ".concat(e),document.getElementById("icon-mute-path").style.fill="#ffffff"):(document.getElementById("".concat(t.jSPlugin.id,"-icon-mute")).style.background="#ffffff",document.getElementById("".concat(t.jSPlugin.id,"-icon-mute")).style.border="1px solid ".concat(e),document.getElementById("icon-mute-path").style.fill=e));t.decoderState.state=Object.assign(t.decoderState.state,A)}))}},{key:"startAutoFocus",value:function(){var A=this,e=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById("".concat(A.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(A.jSPlugin.id,"-audioControls")).style.opacity=0,document.getElementById("".concat(A.jSPlugin.id,"-audioControls")).style.pointerEvents="none")}),1e3*e)}},{key:"stopAutoFocus",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.startAutoFocus()}},{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}},{key:"editIcon",value:function(A,e,t){console.log("编辑组件",A,e,t);var i=this.themeData;console.log("themeData",this.themeData);var n=this.themeData[t].btnList,a=M.findIndex(n,(function(e){return e.iconId===A})),r=n[a];switch(e){case"delete":if("rec"===A){if(-1===M.findIndex(n,(function(A){return"cloudRec"===A.iconId&&1==A.isrender})))return this.jSPlugin.Message&&this.jSPlugin.Message.default("必须选中一种存储介质"),!1}else if("cloudRec"===A&&-1===M.findIndex(n,(function(A){return"rec"===A.iconId&&1==A.isrender})))return this.jSPlugin.Message&&this.jSPlugin.Message.default("必须选中一种存储介质"),!1;n[a].isrender=0;break;case"right":for(var o=-1,s=a+1;s=0;c--)if(n[c].part===n[a].part&&1==n[c].isrender){g=c;break}-1!==g&&(n[a]=n[g],n[g]=r)}console.log("new btnList",n),i[t].btnList=n,this.changeTheme(i)}},{key:"countTime",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var i=document.createElement("div");i.id=this.jSPlugin.id+"time-area",i.className="time-area",i.innerHTML='00:00',document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).appendChild(i)}if(this.countTimer&&clearInterval(this.countTimer),"add"===A){var n=e;document.getElementById(t.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++n,document.getElementById(t.jSPlugin.id+"time-area").children[1].innerHTML=function(A){var e=parseInt(A),t=0,i=0,n="00",a="00",r="00";e>59&&(t=parseInt(e/60),e=parseInt(e%60),t>59&&(i=parseInt(t/60),t=parseInt(t%60)));return n=parseInt(e)>9?parseInt(e):"0"+parseInt(e),a=parseInt(t)>9?parseInt(t):"0"+parseInt(t),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?r+":"+a+":"+n:t>0?a+":"+n:"00:"+n}(n)}),1e3)}else"destroy"===A&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(t.jSPlugin.id+"time-area")&&(document.getElementById(t.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(t.jSPlugin.id+"time-area").style.display="none"))}},{key:"editStart",value:function(A){var e=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),i=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));i&&i.setAttribute("class","header-controls themeEditing"),e&&e.setAttribute("class","footer-controls themeEditing"),t&&t.setAttribute("class","footer-controls themeEditing"),this.setDecoderState({isEditing:!0})}},{key:"editEnd",value:function(A){var e=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),t=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));t&&t.setAttribute("class","header-controls"),e&&e.setAttribute("class","footer-controls"),this.setDecoderState({isEditing:!1})}},{key:"setDisabled",value:function(A){}},{key:"getDeviceInfo",value:function(){var A=this,e=this.videoWidth/1024||1;jA({accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,deviceSerial:y(this.jSPlugin.url).deviceSerial}).then((function(t){200==t.code&&t.data&&document.getElementById("".concat(A.jSPlugin.id,"-deviceCategory-content"))&&(document.getElementById("".concat(A.jSPlugin.id,"-deviceCategory-content")).style.maxWidth="100%",document.getElementById("".concat(A.jSPlugin.id,"-deviceCategory-content")).style.overflow="hidden",document.getElementById("".concat(A.jSPlugin.id,"-deviceCategory-content")).style.textOverflow="ellipsis",document.getElementById("".concat(A.jSPlugin.id,"-deviceCategory-content")).style.whiteSpace="nowrap",document.getElementById("".concat(A.jSPlugin.id,"-deviceCategory-content")).innerHTML='有人按门铃').concat(t.data.category,""))})).catch((function(A){console.log("获取设备信息失败",A)}))}}])}(),ie=function(){return a((function A(e){t(this,A),this.jSPlugin=e;var i=window["EZUIKIT_TIMER_INTERVAL_".concat(e.id)];i&&Object.keys(i).length>0&&this.resetTimer(),window["EZUIKIT_TIMER_INTERVAL_".concat(e.id)]={}}),[{key:"createInterval",value:function(A,e,t){window["EZUIKIT_TIMER_INTERVAL_".concat(this.jSPlugin.id)][A]=setInterval(e,t)}},{key:"clearTimer",value:function(A){var e=window["EZUIKIT_TIMER_INTERVAL_".concat(this.jSPlugin.id)];e[A]&&(clearInterval(e[A]),delete e[A])}},{key:"resetTimer",value:function(){var A=window["EZUIKIT_TIMER_INTERVAL_".concat(this.jSPlugin.id)];for(var e in A)clearInterval(A[e]),delete A[e]}}])}(),ne=a((function A(e){var i=this;t(this,A),o(this,"initMap",(function(){var A=i,e=i.videoWidth,t=i.videoHeight;if(document.getElementById("".concat(i.jSPlugin.id,"-miniRecbox")))document.getElementById("".concat(i.jSPlugin.id,"-wrap")).removeChild(document.getElementById("".concat(i.jSPlugin.id,"-miniRecbox"))),i.initMap();else{var n=document.createElement("div");n.id="".concat(i.jSPlugin.id,"-miniRecbox"),n.style=";position: absolute; bottom:96px;right:".concat(i.jSPlugin.inspectVideoWidth,"px;"),n.innerHTML='
    '),document.getElementById("".concat(i.jSPlugin.id,"-wrap")).insertBefore(n,document.getElementById("".concat(i.jSPlugin.id,"-ez-iframe-footer-container"))),A.map=A.loadMap("".concat(i.jSPlugin.id,"-mapbox"))}return A.map})),o(this,"loadMap",(function(A){var e=new BMapGL.Map(A);return e.centerAndZoom(new BMapGL.Point(116.297611,40.047363),15),e.enableScrollWheelZoom(!0),e})),o(this,"createCircle",(function(A,e,t,n){var a=new BMapGL.Point(A,e),r=new BMapGL.Marker(a,{title:n});if(i.map.addOverlay(r),0!=t){var o=new BMapGL.Circle(new BMapGL.Point(A,e),t,{strokeColor:"#ff4d4f",strokeWeight:4,strokeOpacity:1,strokeStyle:"dashed",fillOpacity:0});i.map.addOverlay(o)}})),o(this,"createInspectPoints",(function(A){A.map((function(A){i.createCircle(A.longitude,A.latitude,A.radius,A.inspectPointName)}))})),o(this,"createPolygon",(function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#407AFF",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"solid",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:4,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"407AFF",o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=[];A.split(";").map((function(A){var e=A.split(",");s.push(new BMapGL.Point(e[0],e[1]))})),i.inspectRange=new BMapGL.Polygon(s,{strokeColor:e,strokeWeight:n,strokeOpacity:a,strokeStyle:t,fillOpacity:o,fillColor:r}),i.map.addOverlay(i.inspectRange)})),o(this,"createTrack",(function(A){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#18C796",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"solid",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,g=arguments.length>8&&void 0!==arguments[8]?arguments[8]:500,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]&&arguments[10],I=[];if(A.map((function(A){var e=!1;i.currentTrack.length>0&&i.currentTrack.map((function(t){t.longitude===A.longitude&&t.latitude===A.latitude&&t.reportTime===A.reportTime&&(e=!0)})),e||(0==I.length&&i.currentTrack.length>0&&I.push(new BMapGL.Point(i.currentTrack[i.currentTrack.length-1].longitude,i.currentTrack[i.currentTrack.length-1].latitude)),I.push(new BMapGL.Point(A.longitude,A.latitude)))})),0!=I.length){var d=new BMapGL.Polyline(I,{strokeColor:t,strokeWeight:a,strokeOpacity:r,strokeStyle:n,fillOpacity:o});if(e?(i.map.addOverlay(d),i.map.centerAndZoom(I[I.length-1],15)):(i.trackAni=new BMapGLLib.TrackAnimation(i.map,d,{overallView:l,tilt:s,duration:g,delay:c}),i.trackAni.start()),i.currentTrack=A,i.currentTrack.length>0&&i.currentTrack.length>0){var C=new BMapGL.Point(i.currentTrack[0].longitude,i.currentTrack[0].latitude);if(i.startPoint=new BMapGL.Marker(C,{icon:new BMapGL.Icon("".concat(i.jSPlugin.staticPath,"/imgs/start.png"),new BMapGL.Size(32,47)),offset:new BMapGL.Size(0,-17)}),i.map.addOverlay(i.startPoint),1==i.currentTrack.length)return;var h=new BMapGL.Point(i.currentTrack[i.currentTrack.length-1].longitude,i.currentTrack[i.currentTrack.length-1].latitude);i.endPoint&&i.map.removeOverlay(i.endPoint),setTimeout((function(){i.endPoint=new BMapGL.Marker(h,{icon:new BMapGL.Icon("".concat(i.jSPlugin.staticPath,"/imgs/end.png"),new BMapGL.Size(30,30))}),i.map.addOverlay(i.endPoint)}),e?0:g)}}})),o(this,"centerToTrack",(function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;i.currentTrack.length>0&&(1==i.currentTrack.length?i.map.centerAndZoom(new BMapGL.Point(i.currentTrack[0].longitude,i.currentTrack[0].latitude),A):i.map.centerAndZoom(new BMapGL.Point(i.currentTrack[i.currentTrack.length-1].longitude,i.currentTrack[i.currentTrack.length-1].latitude),A))})),this.jSPlugin=e,this.videoWidth=e.width,this.videoHeight=e.height,this.toastCustom=new YA(e,!1),this.currentTrack=[],this.startPoint=null,this.endPoint=null,this.trackAni=null,this.inspectRange=null,this.map=this.initMap()})),ae=a((function A(e){var i=this;t(this,A),o(this,"init",(function(){var A=i;if(i.videoWidth,i.videoHeight,document.getElementById("".concat(i.jSPlugin.id,"-inspect-global-box")))document.getElementById("".concat(i.jSPlugin.id,"-inspect-global-box"))&&document.getElementById("".concat(i.jSPlugin.id,"-wrap")).removeChild(document.getElementById("".concat(i.jSPlugin.id,"-inspect-global-box"))),A.init();else{var e=document.createElement("div");e.id="".concat(i.jSPlugin.id,"-inspect-global-box"),e.style=";position: absolute; left:0; top: 0; width: 100%; height: 100%; z-index: 10000; background: #fff;",e.innerHTML='
    \n
    \n
    \n
    加载中…
    \n
    \n '),document.getElementById("".concat(i.jSPlugin.id,"-wrap")).appendChild(e)}})),o(this,"deviceErrorInfo",(function(A,e){var t=Object.assign({tips:"",refreshBtn:"",refreshShow:!1},A);if(document.getElementById("".concat(i.jSPlugin.id,"-no-inspect-box")))document.getElementById("".concat(i.jSPlugin.id,"-no-inspect-box"))&&document.getElementById("".concat(i.jSPlugin.id,"-inspect-global-box")).removeChild(document.getElementById("".concat(i.jSPlugin.id,"-no-inspect-box"))),i.deviceErrorInfo(A,e);else{i.videoHeight;var n=document.createElement("div");n.id="".concat(i.jSPlugin.id,"-no-inspect-box"),n.style="width:100%;height:100%; background: #ffffff; display: flex; justify-content: center; align-items: center",n.innerHTML='
    \n
    \n \n
    \n
    '.concat(t.tips,'
    \n \n
    \n "),document.getElementById("".concat(i.jSPlugin.id,"-inspect-global-box")).appendChild(n),document.getElementById("".concat(i.jSPlugin.id,"-inspect-device-status-refresh")).addEventListener("click",(function(){e&&e()}))}})),o(this,"globalContainerToggle",(function(A,e){document.getElementById(A)&&(document.getElementById(A).style.display=e?"flex":"none")})),this.jSPlugin=e,this.videoWidth=e.width,this.videoHeight=e.height,this.toastCustom=new YA(e,!1),this.init()})),re=function(){return a((function A(e){t(this,A),this.timer=null;var i={wrapNode:document.body,time:2e3,content:"",type:"info",center:!1,top:8};this.params=g(g({},i),e),this.init()}),[{key:"init",value:function(){var A=this;this.timer=null;var e=this.params,t=e.wrapNode,i=e.content,n=e.time,a=e.type,r=e.center,o=e.top;this.wrapNode=t;var s=document.createElement("div");s.setAttribute("class","ezuikit-message"),r?s.setAttribute("style","top: 50%; transform: translateY(-50%);"):s.setAttribute("style","top: ".concat(o||0,"px;")),this.wrapNode.appendChild(s),this.initMessageContent(a,i,s),0!==n&&(this.timer=setTimeout((function(){A.wrapNode.removeChild(s)}),n||2e3))}},{key:"initMessageContent",value:function(A,e,t){var i=document.createElement("div");i.setAttribute("class","ezuikit-message-notice"),i.innerHTML='\n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t\t\t').concat("warning"===A?'':"","\n\t\t\t\t\t\t").concat("info"===A?'':"","\n\t\t\t\t\t\t").concat("error"===A?'':"","\n\t\t\t\t\t\t").concat("success"===A?'':"","\n\t\t\t\t\t\n\t\t\t\t\t").concat(e,"\n\t\t\t\t
    \n\t\t\t
    \n\t\t\t"),t.appendChild(i)}}])}(),oe=function(){return a((function A(e){t(this,A),this.params=g(g({},{id:"",width:"100%",height:"100%",preview:!0,showIcon:!0,src:"",alt:"",fallback:"https://img.ys7.com/group32/M00/81/9D/CtxIA2HnrGyADm_jAAAFfWjIDJs811.png"}),e),this.id=Math.random().toString(36).substr(2),this.init()}),[{key:"init",value:function(){var A=this.params,e=A.id,t=A.width,i=A.height,n=A.preview;if(document.getElementById(e)){var a=document.createElement("div");a.setAttribute("class","ezuikit-image"),a.setAttribute("style","width:".concat(t,";height:").concat(i,";")),document.getElementById(e).appendChild(a),this.initImage(a),n&&this.initPreview(a)}}},{key:"previewImg",value:function(){var A=this.params,e=A.src,t=A.alt,i=A.fallback,n=document.createElement("div");n.setAttribute("id",this.id+"-preview"),n.setAttribute("class","ezuikit-image-preview"),n.innerHTML='\n\t\t\t
    \n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t
    \n\t\t\t');var a=document.createElement("img");a.setAttribute("class","ezuikit-image-preview-img"),a.setAttribute("alt",t),a.setAttribute("src",e),a.addEventListener("error",(function(){a.setAttribute("src",i)})),document.body.appendChild(n),n.querySelector(".ezuikit-image-preview-img-main").appendChild(a),document.getElementById(this.id+"-ezuikit-image-preview-operations").addEventListener("click",(function(){document.body.removeChild(n)}))}},{key:"initImage",value:function(A){var e=this.params,t=e.src,i=e.alt,n=e.fallback,a=document.createElement("img");a.setAttribute("class","ezuikit-image-img"),a.setAttribute("alt",i),a.setAttribute("src",t),a.addEventListener("error",(function(){a.setAttribute("src",n)})),A.appendChild(a)}},{key:"initPreview",value:function(A){var e=this,t=this.params.showIcon,i=document.createElement("div");i.setAttribute("class","ezuikit-image-mask"),t&&(i.innerHTML='\n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t预览\n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t\t'),A.appendChild(i),A.onclick=function(){e.previewImg()}}}])}(),se=function(){return a((function A(e){t(this,A),this.params=g(g({},{id:"",parentNodeId:"",title:"",content:"",placement:"top",cancelText:"取消",arrowPointAtCenter:!1,okText:"确定",onCancel:function(){},onConfirm:function(){}}),e),this.initState=!1,this.init(e)}),[{key:"init",value:function(){var A=this,e=this.params,t=e.id,i=e.content,n=e.placement,a=e.title,r=document.getElementById(t);if(r){var o=document.createElement("div");if(o.setAttribute("id",t+"-popover"),o.setAttribute("class","ezuikit-popover"),o.setAttribute("style","display:none;"),o.innerHTML='\n\t\t\t\t\t
    \n\t\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t'.concat(a?'
    '.concat(a,"
    "):"",'\n\t\t\t\t\t\t
    ').concat(i,"
    \n\t\t\t\t\t
    \n\t\t\t\t"),!document.getElementById(t+"-popover")){var s=document.body;this.params.parentNodeId&&(s=document.getElementById(this.params.parentNodeId)),s.appendChild(o),this.renderPopover(o,r,n)}document.body.addEventListener("click",(function(e){A.addEventListenerFn(e)}))}}},{key:"addEventListenerFn",value:function(A){var e=this.params.id,t=document.getElementById(e),i=document.getElementById(e+"-popover");t&&A.target!==t&&!t.contains(A.target)&&i&&A.target!==i&&!i.contains(A.target)&&this.hidePopover()}},{key:"hidePopover",value:function(){var A=this.params.id,e=document.getElementById(A+"-popover");e&&document.body.removeChild(e)}},{key:"renderPopover",value:function(A,e,t,i,n){A.style.display="block";var a=e.getBoundingClientRect(),r=a.top,o=a.left,s=a.width,g=a.height,c=A.getBoundingClientRect(),l=c.width,I=c.height;i&&(l=i),n&&(I=n);var d=document.body;this.params.parentNodeId&&(d=document.getElementById(this.params.parentNodeId));var C=this.params.arrowPointAtCenter,h=0,u=0,B=A.getElementsByClassName("ezuikit-popover-arrow")[0],E=B.getBoundingClientRect(),f=E.width,Q=E.height;if(C){var x=0,p=0;switch(t){case"top":default:x=l/2,p=I;break;case"bottom":x=l/2,p=0;break;case"left":x=l,p=I/2;break;case"right":x=0,p=I/2;break;case"topLeft":x=(s-f)/2,p=I;break;case"topRight":x=l-(s+f)/2,p=I;break;case"bottomLeft":x=(s-f)/2,p=0;break;case"bottomRight":x=l-(s+f)/2,p=0;break;case"leftTop":x=l,p=(g-Q)/2;break;case"leftBottom":x=l,p=I-(g+Q)/2;break;case"rightTop":x=0,p=(g-10)/2;break;case"rightBottom":x=0,p=I-(g+Q)/2}B.style.left=x+"px",B.style.top=p+"px"}switch(t){case"top":h=-(I+Q),u=(s-l)/2,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-top");break;case"bottom":h=g-Q/2,u=(s-l)/2,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-bottom");break;case"left":h=(g-I)/2,u=-(l+f/2),A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-left");break;case"right":h=(g-I)/2,u=s-f/2,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-right");break;case"topLeft":h=-(I+Q),u=0,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-topLeft");break;case"topRight":h=-(I+Q),u=s-l,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-topRight");break;case"bottomLeft":h=g-Q/2,u=0,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-bottomLeft");break;case"bottomRight":h=g-Q/2,u=s-l,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-bottomRight");break;case"leftTop":h=0,u=-(l+f/2),A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-leftTop");break;case"leftBottom":h=g-I,u=-(l+f/2),A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-leftBottom");break;case"rightTop":h=0,u=s-f/2,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-rightTop");break;case"rightBottom":h=g-I,u=s-f/2,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-rightBottom");break;default:h=-I,u=(s-l)/2,A.setAttribute("class","ezuikit-popover ezuikit-popover-placement-top")}var m=document.documentElement.scrollTop||document.body.scrollTop,y=document.documentElement.scrollLeft||document.body.scrollLeft;A.style.top=r+m+h+"px",A.style.left=o+y+u+"px";var _=A.getBoundingClientRect(),S=d===document.body?{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}:d.getBoundingClientRect(),D=t;_.leftS.right&&(D=(D=D.replace("Left","Right")).replace("left","right")),_.topS.bottom&&(D=(D=D.replace("Bottom","Top")).replace("bottom","top")),D!==t&&this.renderPopover(A,e,D,l,I)}}])}(),ge=function(){return a((function A(e){t(this,A),this.params=g(g({},{id:"",content:"",placement:"top",cancelText:"取消",arrowPointAtCenter:!1,okText:"确定",onCancel:function(){},onConfirm:function(){}}),e),this.PopconfirmDom=null,this.init(e)}),[{key:"init",value:function(){var A=this,e=this.params,t=e.content,i=e.cancelText,n=e.okText,a=e.onCancel,r=e.onConfirm,o=document.createElement("div");o.innerHTML='\n
    \n
    \n\t\t\t\t\t\n \t\n \n\t\t\t\t\t\n
    \n
    \n
    \n ');var s=document.createElement("button");s.className="ezuikit-btn ezuikit-cancel-btn",s.innerText=i;var c=document.createElement("button");return c.className="ezuikit-btn ezuikit-ok-btn ezuikit-btn-primary",c.innerText=n,o.querySelector(".ezuikit-popover-buttons").appendChild(s),o.querySelector(".ezuikit-popover-buttons").appendChild(c),this.PopconfirmDom=new se(g(g({},this.params),{},{content:o.innerHTML})),document.getElementById("".concat(this.params.id,"-popover")).querySelector(".ezuikit-cancel-btn")&&(document.getElementById("".concat(this.params.id,"-popover")).querySelector(".ezuikit-cancel-btn").onclick=function(){a?a():A.hide()}),document.getElementById("".concat(this.params.id,"-popover")).querySelector(".ezuikit-ok-btn")&&(document.getElementById("".concat(this.params.id,"-popover")).querySelector(".ezuikit-ok-btn").onclick=function(){r?r():A.hide()}),this.PopconfirmDom}},{key:"hide",value:function(){this.PopconfirmDom.hidePopover()}}])}(),ce=function(){return a((function A(e){t(this,A),this.params=g(g({},{id:"",width:"100%",height:"100%",preview:!0,poster:"",fallback:"https://img.ys7.com/group32/M00/81/9D/CtxIA2HnrGyADm_jAAAFfWjIDJs811.png",src:""}),e),this.id=Math.random().toString(36).substr(2),this.init()}),[{key:"init",value:function(){var A=this.params,e=A.id,t=A.width,i=A.height,n=A.preview;if(document.getElementById(e)){var a=document.createElement("div");a.setAttribute("class","ezuikit-video"),a.setAttribute("style","width:".concat(t,";height:").concat(i,";")),document.getElementById(e).appendChild(a),this.initVideo(a),n&&this.initPreview(a)}}},{key:"previewVideo",value:function(){var A=this.params.src,e=document.createElement("div");e.setAttribute("id",this.id+"-preview"),e.setAttribute("class","ezuikit-image-video"),e.innerHTML='\n\t\t\t
    \n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t
    \n\t\t\t'),document.body.appendChild(e),document.getElementById(this.id+"-ezuikit-video-preview-operations").addEventListener("click",(function(){document.body.removeChild(e)}))}},{key:"initVideo",value:function(A){var e=this.params,t=e.poster,i=e.fallback,n=document.createElement("img");n.setAttribute("class","ezuikit-video-img"),n.setAttribute("src",t),n.addEventListener("error",(function(){n.setAttribute("src",i)})),A.appendChild(n)}},{key:"initPreview",value:function(A){var e=this,t=document.createElement("div");t.setAttribute("class","ezuikit-video-mask"),t.innerHTML='\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
    \n\t\t\t',A.appendChild(t),A.onclick=function(){e.previewVideo()}}}])}(),le=function(A,e,t,i){var n={accessToken:A.accessToken||A.token.httpToken.url,inspectRecordId:e,page:0},a="".concat(A.env.domain,"/api/service/devicekit/bodycamera/device/trace");GA(a,"GET",n,(function(A){t&&t(A)}),(function(A){i&&i(A)}),{"Content-Type":"application/x-www-form-urlencoded"})},Ie=function(A,e,t,i){var n={accessToken:A.accessToken||A.token.deviceToken.video,deviceSerial:y(A.url).deviceSerial,validateCode:y(A.url).validCode,channelNo:y(A.url).channelNo,evidenceFileType:e},a="".concat(A.env.domain,"/api/service/devicekit/common/file/evidence");GA(a,"POST",n,(function(A){t&&t(A)}),(function(A){i&&i(A)}),{"Content-Type":"application/x-www-form-urlencoded"})},de=function(A,e,t,i){var n={accessToken:A.accessToken||A.token.httpToken.url,taskId:e},a="".concat(A.env.domain,"/api/service/devicekit/opencloud/task/info");GA(a,"GET",n,(function(A){t&&t(A)}),(function(A){i&&i(A)}),{"Content-Type":"application/x-www-form-urlencoded"})};var Ce=function(){return a((function A(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){};t(this,A),this.jSPlugin=e,this.currentEventInfo=i,this.inspectInfo=e.Theme.inspect.inspectInfo,this.type=a,this.timer=n,this.startTime=1e3,this.videoRecordingStatus=!0,this.saveSuccessCallback=r,this.init()}),[{key:"init",value:function(){this.renderEventDetail(),this.eventDetailDomEvent()}},{key:"show",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-wrap")).setAttribute("class","inspect-event-detail-wrap show")}},{key:"hide",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-wrap")).setAttribute("class","inspect-event-detail-wrap"),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-box")).innerHTML=""}},{key:"validationEventTag",value:function(){return 0==document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).value.length?(document.getElementById("".concat(this.jSPlugin.id,"-event-tag-error")).style.display="block",document.getElementById("".concat(this.jSPlugin.id,"-event-tag-error")).innerHTML="请输入事件标签",document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).setAttribute("class","ezuikit-input input-has-error"),!1):(document.getElementById("".concat(this.jSPlugin.id,"-event-tag-error")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).setAttribute("class","ezuikit-input"),!0)}},{key:"renderVideo",value:function(A,e,t){var i=this;if(document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-videoPreview")).innerHTML="",1===A||2===A){if(document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-videoPreview")).innerHTML='\n
    \n
    \n
    \n
    \n 视频正在存储中…\n
    \n '),1!==this.type){var n=this.currentEventInfo.evidenceId;this.timer.clearTimer("videoRecordingStatusTimer"),this.timer.createInterval("videoRecordingStatusTimer",(function(){de(i.jSPlugin,n,(function(A){if(A.meta&&200===A.meta.code){var e=A.data,t=e.taskStatus,n=e.fileUrl,a=e.videoCoverPic||"".concat(i.jSPlugin.staticPath,"/imgs/bg.svg");i.renderVideo(t,a,n)}}))}),1e3)}}else 4===A||5===A||6===A||7===A?(document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-videoPreview")).innerHTML='\n
    \n
    \n \n
    \n 视频存储失败\n
    \n '),this.timer.clearTimer("videoRecordingStatusTimer")):0!==A&&3!==A||(new ce({id:"".concat(this.jSPlugin.id,"-inspectEventDetail-videoPreview"),poster:e,fallback:"".concat(this.jSPlugin.staticPath,"/imgs/bg.svg"),src:t}),this.timer.clearTimer("videoRecordingStatusTimer"))}},{key:"renderEventDetail",value:function(){var A=this,e=this.currentEventInfo,t=e.evidenceFileType,i=e.fileUrl,n=e.taskStatus,a=e.videoCoverPic,r=document.createElement("div");r.setAttribute("class","inspectEventDetail");var o="";if(o=1===t?a||"".concat(this.jSPlugin.staticPath,"/imgs/bg.svg"):i||"".concat(this.jSPlugin.staticPath,"/imgs/bg.svg"),r.innerHTML='\n
    \n
    \n \n
    \n
    ').concat(1===this.type?"编辑":"").concat(0===t?"图片存证":"视频存证",'
    \n
    \n
    \n ').concat(0===t?'
    \n

    图片已取证,请填写存证信息:

    \n
    \n
    '):'
    \n \n
    \n \n
    00:00:00
    \n
    \n \n
    \n
    \n

    视频已取证:

    \n
    \n
    \n
    '),'\n \n
    \n \n '),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-box")).appendChild(r),1===this.type?document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML="".concat(1===t?this.currentEventInfo.eventBeginTime+" ~ "+this.currentEventInfo.eventEndTime:this.currentEventInfo.eventTime):(document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML="".concat((new Date).Format("yyyy-MM-dd hh:mm:ss")).concat(1===t?" ~ -":""),1===t&&document.getElementById("".concat(this.jSPlugin.id,"-video-recording-time"))&&this.videoRecordingStatus&&(0===this.type&&document.getElementById("".concat(this.jSPlugin.id,"-event-ok")).setAttribute("disabled","disabled"),this.timer.createInterval("videoRecordingTimer",(function(){var e,t,i,n;A.startTime&&(document.getElementById("".concat(A.jSPlugin.id,"-video-recording-time")).innerHTML=(e=A.startTime,t=parseInt(e%864e5/36e5),i=parseInt(e%36e5/6e4),n=parseInt(e%6e4/1e3),(t<10?"0".concat(t):t)+":"+(i<10?"0".concat(i):i)+":"+(n<10?"0".concat(n):n))),A.startTime+=1e3,A.startTime>A.jSPlugin.inspectRecordingDuration&&(document.getElementById("".concat(A.jSPlugin.id,"-video-recording-stop-btn")).click(),A.timer&&A.timer.clearTimer("videoRecordingTimer"))}),1e3))),1===t){var s=this.currentEventInfo&&this.currentEventInfo.fileUrl;this.renderVideo(n,o,s)}else new oe({id:"".concat(this.jSPlugin.id,"-inspectEventDetail-picUrl"),src:o,fallback:"".concat(this.jSPlugin.staticPath,"/imgs/fallback.svg"),showIcon:!1});this.show()}},{key:"eventDetailDomEvent",value:function(){var A=this,e=this.currentEventInfo,t=e.evidenceFileType,i=e.evidenceId;document.getElementById("".concat(this.jSPlugin.id,"-event-cancel")).addEventListener("click",(function(e){A.cancelPopover=new ge({id:"".concat(A.jSPlugin.id,"-event-cancel"),content:"确定要取消吗?".concat(1===A.type?"取消后编辑的内容将不会保存。":"取消后对应存证也将删除。"),placement:"topRight",arrowPointAtCenter:!0,onCancel:function(){A.cancelPopover.hide()},onConfirm:function(){1===t&&(A.videoRecordingStatus&&0===A.type&&(A.timer&&A.timer.clearTimer("videoRecordingTimer"),A.startTime=1e3,document.getElementById("".concat(A.jSPlugin.id,"-video-recording-stop-btn")).click()),A.timer.clearTimer("videoRecordingStatusTimer")),A.cancelPopover.hide(),A.hide()}})})),document.getElementById("".concat(this.jSPlugin.id,"-event-ok")).addEventListener("click",(function(){if(A.validationEventTag()){var e=A.currentEventInfo,t=e.evidenceFileType,i=e.evidenceId,n=A.inspectInfo,a=n.inspectRecordId,r=n.inspectPerson,o=document.getElementById("".concat(A.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML,s={inspectRecordId:a,depositaryOfficer:r,evidenceFileId:i,evidenceFileType:t,eventType:document.getElementById("".concat(A.jSPlugin.id,"-event-tag")).value,eventRemark:document.getElementById("".concat(A.jSPlugin.id,"-event-remark")).value};1===t&&(s.eventBeginTime=o.split("~")[0].trim(),s.eventEndTime=o.split("~")[1].trim(),A.timer.clearTimer("videoRecordingStatusTimer")),0===t&&(s.eventTime=o),1===A.type&&(s.inspectEventId=A.currentEventInfo.inspectEventId,delete s.depositaryOfficer,delete s.eventTime,delete s.eventBeginTime,delete s.eventEndTime,delete s.evidenceFileId,delete s.evidenceFileType,function(A,e,t,i){var n={accessToken:A.accessToken||A.token.httpToken.url,inspectRecordId:"",inspectEventId:"",eventType:"",eventRemark:""},a=Object.assign(n,e),r="".concat(A.env.domain,"/api/service/devicekit/bodycamera/inspect/event/update");GA(r,"POST",a,(function(A){t&&t(A)}),(function(A){i&&i(A)}),{"Content-Type":"application/x-www-form-urlencoded"})}(A.jSPlugin,s,(function(e){e.meta&&200===e.meta.code?(A.hide(),A.saveSuccessCallback&&A.saveSuccessCallback({eventType:s.eventType,eventRemark:s.eventRemark})):new re({type:"error",content:"保存失败,".concat(e.meta&&e.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(A.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){new re({type:"error",content:"保存失败,请稍后重试!",wrapNode:document.getElementById("".concat(A.jSPlugin.id,"-inspect-event-box")),top:40})}))),0===A.type&&function(A,e,t,i){var n={accessToken:A.accessToken||A.token.httpToken.url,inspectRecordId:"",eventType:"",evidenceFileId:"",eventTime:"",eventBeginTime:"",eventEndTime:"",depositaryOfficer:"",eventRemark:"",evidenceFileType:""},a=Object.assign(n,e),r="".concat(A.env.domain,"/api/service/devicekit/bodycamera/inspect/event");GA(r,"POST",a,(function(A){t&&t(A)}),(function(A){i&&i(A)}),{"Content-Type":"application/x-www-form-urlencoded"})}(A.jSPlugin,s,(function(e){e.meta&&200===e.meta.code?(A.hide(),A.saveSuccessCallback&&A.saveSuccessCallback()):new re({type:"error",content:"保存失败,".concat(e.meta&&e.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(A.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){new re({type:"error",content:"保存失败,请稍后重试!",wrapNode:document.getElementById("".concat(A.jSPlugin.id,"-inspect-event-box")),top:40})}))}})),document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-back")).addEventListener("click",(function(){A.backPopover=new ge({id:"".concat(A.jSPlugin.id,"-inspectEventDetail-back"),content:"确定要返回吗?".concat(1===A.type?"返回后编辑的内容将不会保存。":"返回后对应存证也将删除。"),placement:"bottomRight",arrowPointAtCenter:!0,onCancel:function(){A.backPopover.hide()},onConfirm:function(){1===t&&(A.videoRecordingStatus&&0===A.type&&(A.timer&&A.timer.clearTimer("videoRecordingTimer"),A.startTime=1e3,document.getElementById("".concat(A.jSPlugin.id,"-video-recording-stop-btn")).click()),A.timer.clearTimer("videoRecordingStatusTimer")),A.backPopover.hide(),A.hide()}})})),document.getElementById("".concat(this.jSPlugin.id,"-video-recording-stop-btn"))&&document.getElementById("".concat(this.jSPlugin.id,"-video-recording-stop-btn")).addEventListener("click",(function(){document.getElementById("".concat(A.jSPlugin.id,"-video-recording-stop-btn")).setAttribute("class","inspectEventDetail-stop-btn ezuikit-btn ezuikit-btn-loading"),document.getElementById("".concat(A.jSPlugin.id,"-video-recording-stop-btn")).querySelector(".ezuikit-btn-loading-icon").style.display="inline-block",function(A,e,t,i){var n={accessToken:A.accessToken||A.token.httpToken.url,taskId:e},a="".concat(A.env.domain,"/api/v3/open/cloud/video/frame/stop");GA(a,"POST",n,(function(A){t&&t(A)}),(function(A){i&&i(A)}),{"Content-Type":"application/x-www-form-urlencoded"})}(A.jSPlugin,i,(function(e){document.getElementById("".concat(A.jSPlugin.id,"-video-recording-stop-btn"))&&(document.getElementById("".concat(A.jSPlugin.id,"-video-recording-stop-btn")).setAttribute("class","inspectEventDetail-stop-btn ezuikit-btn"),document.getElementById("".concat(A.jSPlugin.id,"-video-recording-stop-btn")).querySelector(".ezuikit-btn-loading-icon").style.display="none"),e.meta&&200===e.meta.code?de(A.jSPlugin,i,(function(e){if(e.meta&&200===e.meta.code){var t=e.data,i=t.taskStatus,n=t.fileUrl,a=t.videoCoverPic;A.timer&&A.timer.clearTimer("videoRecordingTimer");var r=a||"".concat(A.jSPlugin.staticPath,"/imgs/bg.svg");A.renderVideo(i,r,n),document.getElementById("".concat(A.jSPlugin.id,"-inspectEventDetail-content-video-info")).style.display="block",document.getElementById("".concat(A.jSPlugin.id,"-inspectEventDetail-content-video-timer")).style.display="none";var o=document.getElementById("".concat(A.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML;document.getElementById("".concat(A.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML="".concat(o.split("~")[0]," ~ ").concat((new Date).Format("yyyy-MM-dd hh:mm:ss")),A.videoRecordingStatus=!1,document.getElementById("".concat(A.jSPlugin.id,"-event-ok")).removeAttribute("disabled")}})):new re({type:"error",content:"停止录制失败,请稍后重试!",wrapNode:document.getElementById("".concat(A.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){document.getElementById("".concat(A.jSPlugin.id,"-video-recording-stop-btn"))&&(document.getElementById("".concat(A.jSPlugin.id,"-video-recording-stop-btn")).setAttribute("class","inspectEventDetail-stop-btn ezuikit-btn"),document.getElementById("".concat(A.jSPlugin.id,"-video-recording-stop-btn")).querySelector(".ezuikit-btn-loading-icon").style.display="none"),new re({type:"error",content:"停止录制失败,请稍后重试!",wrapNode:document.getElementById("".concat(A.jSPlugin.id,"-inspect-event-box")),top:40})}))})),document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).addEventListener("input",(function(){A.validationEventTag()})),document.getElementById("".concat(this.jSPlugin.id,"-event-remark")).addEventListener("input",(function(A){var e=A.target.value;A.target.parentNode.setAttribute("data-count","".concat(e.length," / 100"))})),document.getElementById("".concat(this.jSPlugin.id,"-event-remark")).addEventListener("focus",(function(A){A.target.parentNode.setAttribute("class","ezuikit-input-textarea ezuikit-input-textarea-show-count ezuikit-input-textarea-focus")})),document.getElementById("".concat(this.jSPlugin.id,"-event-remark")).addEventListener("blur",(function(A){A.target.parentNode.setAttribute("class","ezuikit-input-textarea ezuikit-input-textarea-show-count")}))}}])}(),he=function(){return a((function A(e,i,n){var a=this;t(this,A),o(this,"hideDelEConfirm",(function(){for(var A=0;A\n

    巡检事件

    \n
    \n
    \n \n \n 图片存证\n \n \n \n 视频存证\n
    \n
    \n \n \n \n
    \n
    \n \n
    \n
    \n
    \n \n

    暂无事件

    \n
    \n \n \n
    \n

    巡检事件

    \n
    \n
    \n '),document.getElementById("".concat(a.jSPlugin.id,"-wrap")).appendChild(e),a.jSPlugin.Theme.decoderState.state.play?a.enableEvidenceBtn():a.disableEvidenceBtn(),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-img")).onclick=function(){a.listLoading||a.startEvidence||(a.startEvidence=!0,a.hideDelEConfirm(),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-img")).setAttribute("class","ezuikit-btn ezuikit-btn-primary ezuikit-btn-loading"),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-img")).querySelector(".ezuikit-btn-loading-icon").style.display="inline-block",Ie(a.jSPlugin,0,(function(A){a.startEvidence=!1,document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-img")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-img")).querySelector(".ezuikit-btn-loading-icon").style.display="none",A.meta&&200===A.meta.code?new Ce(a.jSPlugin,A.data,a.timer,0,(function(){a.initEvent(),new re({type:"success",content:"保存成功",wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})})):new re({type:"error",content:"图片存证失败,".concat(A.meta&&A.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){a.startEvidence=!1,document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-img")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-img")).querySelector(".ezuikit-btn-loading-icon").style.display="none",new re({type:"error",content:"图片存证失败,请稍后重试!",wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})})))},document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-video")).onclick=function(){a.listLoading||a.startEvidence||(a.startEvidence=!0,a.hideDelEConfirm(),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-video")).setAttribute("class","ezuikit-btn ezuikit-btn-primary ezuikit-btn-loading"),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-video")).querySelector(".ezuikit-btn-loading-icon").style.display="inline-block",Ie(a.jSPlugin,1,(function(A){a.startEvidence=!1,document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-video")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-video")).querySelector(".ezuikit-btn-loading-icon").style.display="none",A.meta&&200===A.meta.code?new Ce(a.jSPlugin,A.data,a.timer,0,(function(){a.initEvent(),new re({type:"success",content:"保存成功",wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})})):new re({type:"error",content:"视频存证失败,".concat(A.meta&&A.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){a.startEvidence=!1,document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-video")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-video")).querySelector(".ezuikit-btn-loading-icon").style.display="none",new re({type:"error",content:"视频存证失败,请稍后重试!",wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})})))},document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-refresh")).onclick=function(){a.listLoading||a.startEvidence||(a.hideDelEConfirm(),document.getElementById("".concat(a.jSPlugin.id,"-inspect-loading")).style.display="block",document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-wrap")).style.display="none",document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-nodata-wrap")).style.display="none",A.initEvent())}}})),o(this,"renderList",(function(A){document.getElementById("".concat(a.jSPlugin.id,"-inspect-loading")).style.display="none";var e=A.data||[];if(e.length>0){document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-wrap")).style.display="block",document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-nodata-wrap")).style.display="none";for(var t=function(){var t=document.createElement("div");t.setAttribute("class","inspect-event-item");var n=e[i];t.setAttribute("id","".concat(a.jSPlugin.id,"-inspect-event-item-").concat(n.inspectEventId)),t.innerHTML="",document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-wrap-main")).appendChild(t);var r,o=document.createElement("div");o.setAttribute("class","inspect-event-item-header-wrap"),1==n.evidenceFileType&&(r="".concat(n.eventBeginTime.split(" ")[1],"~").concat(n.eventEndTime.split(" ")[1])),0==n.evidenceFileType&&(r="".concat(n.eventTime.split(" ")[1]));var s="";1===n.evidenceFileType&&(1===n.taskStatus||2===n.taskStatus?s="storage":4===n.taskStatus||5===n.taskStatus||6===n.taskStatus||7===n.taskStatus?s="storage-error":0!==n.taskStatus&&3!==n.taskStatus||(s="storage-success")),o.innerHTML='\n
    \n
    \n \n \n \n \n \n \n \n \n \n ').concat(r||"-",'\n
    \n
    \n \n \n \n \n
    \n
    \n '),t.appendChild(o),o.onclick=function(A){"none"===o.querySelector(".inspect-event-item-header-toggle-up").style.display?(o.querySelector(".inspect-event-item-header-toggle-up").style.display="block",o.querySelector(".inspect-event-item-header-toggle-down").style.display="none",t.querySelector(".inspect-event-item-body").style.display="block"):(o.querySelector(".inspect-event-item-header-toggle-up").style.display="none",o.querySelector(".inspect-event-item-header-toggle-down").style.display="block",t.querySelector(".inspect-event-item-body").style.display="none")};var g=document.createElement("div");g.setAttribute("class","inspect-event-item-body"),g.style.display="none";var c=(1===n.evidenceFileType?n.videoCoverPic:n.fileUrl)||"".concat(a.jSPlugin.staticPath,"/imgs/bg.svg");g.innerHTML='\n
    \n
    \n
    \n ').concat(n.eventType,"\n
    \n
    \n "),t.appendChild(g),1==n.evidenceFileType&&(1===n.taskStatus||2===n.taskStatus?document.getElementById("".concat(a.jSPlugin.id,"-inspect-view-").concat(n.inspectEventId)).innerHTML='\n
    \n
    \n
    \n
    \n 视频正在存储中…\n
    \n '):4===n.taskStatus?document.getElementById("".concat(a.jSPlugin.id,"-inspect-view-").concat(n.inspectEventId)).innerHTML='\n
    \n
    \n \n
    \n 视频存储失败\n
    \n '):0!==n.taskStatus&&3!==n.taskStatus||new ce({id:"".concat(a.jSPlugin.id,"-inspect-view-").concat(n.inspectEventId),src:n.fileUrl,poster:c,fallback:"".concat(a.jSPlugin.staticPath,"/imgs/bg.svg")})),0==n.evidenceFileType&&new oe({id:"".concat(a.jSPlugin.id,"-inspect-view-").concat(n.inspectEventId),src:c,fallback:"".concat(a.jSPlugin.staticPath,"/imgs/bg.svg"),showIcon:!1});var l=document.createElement("div");l.setAttribute("class","inspect-event-item-body-info-opr");var I=document.createElement("span");I.setAttribute("class","inspect-event-item-body-info-opr-icon"),I.innerHTML='\n \n ',l.appendChild(I);var d=document.createElement("span");d.setAttribute("class","inspect-event-item-body-info-opr-icon"),d.id="".concat(a.jSPlugin.id,"-inspect-event-del-").concat(n.inspectEventId),d.innerHTML=' \n \n ',l.appendChild(d),I.onclick=function(A){a.startEvidence||new Ce(a.jSPlugin,n,a.timer,1,(function(A){new re({type:"success",content:"保存成功",wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40}),n=Object.assign(n,A),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-item-").concat(n.inspectEventId)).querySelector(".inspect-event-item-body-info-tag-label").innerHTML=n.eventType,document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-item-").concat(n.inspectEventId)).querySelector(".inspect-event-item-body-info-tag-label").setAttribute("title",n.eventType)}))},d.onclick=function(A){a.startEvidence||(a.delE=new ge({id:"".concat(a.jSPlugin.id,"-inspect-event-del-").concat(n.inspectEventId),content:"确定要删除该事件吗?",placement:"topRight",arrowPointAtCenter:!0,onCancel:function(){a.delE.hide()},onConfirm:function(){!function(A,e,t,i){var n={accessToken:A.accessToken||A.token.httpToken.url,inspectEventId:""},a=Object.assign(n,e),r="".concat(A.env.domain,"/api/service/devicekit/bodycamera/inspect/event/delete");GA(r,"POST",a,(function(A){t&&t(A)}),(function(A){i&&i(A)}),{"Content-Type":"application/x-www-form-urlencoded"})}(a.jSPlugin,{inspectEventId:n.inspectEventId},(function(A){A.meta&&200===A.meta.code?(a.delE.hide(),a.initEvent(),setTimeout((function(){new re({type:"success",content:"删除成功",wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})}),10)):new re({type:"error",content:"删除失败,".concat(A.meta&&A.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){new re({type:"error",content:"删除失败,请稍后重试!",wrapNode:document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-box")),top:40})}))}}),a.delEConfirmList.push(a.delE))},t.querySelector(".inspect-event-item-body-info").appendChild(l),document.getElementById("".concat(a.jSPlugin.id,"-inspect-event-list-wrap")).onscroll=function(e){var t=e.target;a.hideDelEConfirm(),t.scrollTop+t.offsetHeight>=t.scrollHeight-48&&!a.listLoading&&(A.start+1)*A.size0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,i=this;i.listLoading=!0,0===e?i.initRender(e):document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="flex";var n=function(e){new re({type:"error",content:e.meta&&e.meta.message||"列表获取失败,请稍后重试!",wrapNode:document.getElementById("".concat(A.jSPlugin.id,"-inspect-event-box")),top:40}),i.renderList({})};i.inspectRecordId?function(A,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30,n=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,r={accessToken:A.accessToken||A.token.httpToken.url,inspectRecordId:e,pageStart:t,pageSize:i},o="".concat(A.env.domain,"/api/service/devicekit/bodycamera/inspect/event/page");GA(o,"GET",r,(function(A){n&&n(A)}),(function(A){a&&a(A)}),{"Content-Type":"application/x-www-form-urlencoded"})}(i.jSPlugin,i.inspectRecordId,e,t,(function(e){i.listLoading=!1,document.getElementById("".concat(A.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="none",e.meta&&200===e.meta.code?i.renderList(e.data||{}):n(e)}),(function(e){i.listLoading=!1,document.getElementById("".concat(A.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="none",n(e)})):(i.listLoading=!1,document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="none",i.renderList({}))}},{key:"disableEvidenceBtn",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-img")).setAttribute("disabled","disabled"),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-video")).setAttribute("disabled","disabled")}},{key:"enableEvidenceBtn",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-img")).removeAttribute("disabled"),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-video")).removeAttribute("disabled")}}])}(),ue=function(){return a((function A(e,i,n,a,r){var s=this;t(this,A),o(this,"createLocationControl",(function(){var A=s;function e(){this.defaultAnchor=BMAP_ANCHOR_BOTTOM_LEFT,this.defaultOffset=new BMapGL.Size(40,105)}return e.prototype=new BMapGL.Control,e.prototype.initialize=function(e){var t=document.createElement("div");return t.style.cssText="width: 26px;height: 26px;display: flex;align-items: center;justify-content: center; box-shadow: 1px 2px 1px rgb(0 0 0 / 15%); background: #fff; cursor: pointer;",t.id="".concat(A.jSPlugin.id,"-location-btn"),t.innerHTML='\n \n ',t.onclick=function(e){setTimeout((function(){A.inspectMapWin.centerToTrack(18)}),100)},e.getContainer().appendChild(t),t},new e})),o(this,"initSwithcBtn",(function(){var A=document.createElement("div");A.id="".concat(s.jSPlugin.id,"-miniSwitch"),A.style="cursor: pointer;position: absolute; bottom: 106px; right: ".concat(s.jSPlugin.inspectVideoWidth+10,"px; z-index: 999;"),A.innerHTML="
    \n \n 大小窗切换\n \n \n \n \n \n
    '),document.getElementById("".concat(s.jSPlugin.id,"-wrap")).appendChild(A),document.getElementById("".concat(s.jSPlugin.id,"-miniSwitch-btn")).onclick=function(){M.throttle((function(){return s.miniRecSwitchClick()}),1e3)()}})),o(this,"initMiniWinToggleBtn",(function(){var A=.3333*s.videoWidth,e=.3333*s.videoHeight,t=document.createElement("div");t.id="".concat(s.jSPlugin.id,"-miniToggle"),t.style="cursor: pointer;position: absolute; bottom: ".concat(e/2+96-30,"px; right: ").concat(s.jSPlugin.inspectVideoWidth+A,"px; z-index: 999; height:60px; box-sizing: border-box; padding-top: 20px; text-align: center; width:20px; overflow: hidden; background: #000000; border-radius: 2px 0px 0px 2px; opacity: 0.7;"),t.innerHTML="
    \n \n \n \n \n
    '),document.getElementById("".concat(s.jSPlugin.id,"-wrap")).appendChild(t),document.getElementById("".concat(s.jSPlugin.id,"-miniToggle")).onclick=function(){s.miniWinToggleClick()}})),o(this,"init",(function(){s.initSwithcBtn(),s.initMiniWinToggleBtn()})),o(this,"setStyleListByIds",(function(A){A.map((function(A){var e=document.getElementById(A.id);e&&Object.keys(A.styleList).map((function(t){e.style[t]=A.styleList[t]}))}))})),this.jSPlugin=e,this.inspectMode=i,this.inspectMapWin=n,this.changeInspectMode=a,this.videoWidth=e.width,this.videoHeight=e.height,this.minWinStatus="open",this.decoderState=r,this.ZoomControl=new BMapGL.ZoomControl({anchor:BMAP_ANCHOR_BOTTOM_LEFT,offset:new BMapGL.Size(40,50)}),this.LocationControl=this.createLocationControl(),this.NavigationControl3D=new BMapGL.NavigationControl3D({anchor:BMAP_ANCHOR_BOTTOM_LEFT,offset:new BMapGL.Size(28,105)}),this.init()}),[{key:"miniWinToggleClick",value:function(){var A=.3333*this.jSPlugin.width;"open"===this.minWinStatus?(this.setStyleListByIds([{id:"video"===this.inspectMode?"".concat(this.jSPlugin.id,"-mapbox"):"".concat(this.jSPlugin.id),styleList:{width:"0px"}},{id:"".concat(this.jSPlugin.id,"-miniSwitch"),styleList:{display:"none"}},{id:"".concat(this.jSPlugin.id,"-miniToggle"),styleList:{right:"".concat(this.jSPlugin.inspectVideoWidth,"px")}},{id:"".concat(this.jSPlugin.id,"-min-win-close-icon"),styleList:{display:"none"}},{id:"".concat(this.jSPlugin.id,"-min-win-open-icon"),styleList:{display:"inline-block"}}]),this.minWinStatus="close"):(this.setStyleListByIds([{id:"video"===this.inspectMode?"".concat(this.jSPlugin.id,"-mapbox"):"".concat(this.jSPlugin.id),styleList:{width:A+"px"}},{id:"".concat(this.jSPlugin.id,"-miniSwitch"),styleList:{display:"block"}},{id:"".concat(this.jSPlugin.id,"-miniToggle"),styleList:{right:"".concat(this.jSPlugin.inspectVideoWidth+A,"px")}},{id:"".concat(this.jSPlugin.id,"-min-win-close-icon"),styleList:{display:"inline-block"}},{id:"".concat(this.jSPlugin.id,"-min-win-open-icon"),styleList:{display:"none"}}]),this.minWinStatus="open")}},{key:"miniRecSwitchClick",value:function(){var A=this,e=.3333*this.jSPlugin.width,t=.3333*this.jSPlugin.height;"video"===this.inspectMode?(this.jSPlugin.Zoom&&this.jSPlugin.Zoom.stopZoom(),this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-mapbox"),styleList:{width:this.jSPlugin.width+"px",height:this.jSPlugin.height+"px",marginBottom:"-40px"}},{id:"".concat(this.jSPlugin.id,"-ez-iframe-footer-container"),styleList:{top:this.jSPlugin.height+"px"}},{id:"".concat(this.jSPlugin.id),styleList:{position:"absolute",zIndex:"100",bottom:"96px",right:"".concat(this.jSPlugin.inspectVideoWidth,"px"),overflow:"hidden"}}]),this.jSPlugin.Theme.inspect.reSizeVideo(e,t),this.inspectMode="map",this.changeInspectMode("map"),this.inspectMapWin.map.addControl(this.NavigationControl3D),this.inspectMapWin.map.addControl(this.LocationControl),this.inspectMapWin.map.addControl(this.ZoomControl),this.inspectMapWin.map.addOverlay(this.inspectMapWin.inspectRange),document.getElementById("".concat(this.jSPlugin.id,"-loading-item-btn-wrap"))&&this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-loading-item-btn"),styleList:{display:"none"}},{id:"".concat(this.jSPlugin.id,"-loading-item-btn-svg"),styleList:{display:"block"}},{id:"".concat(this.jSPlugin.id,"-loading-item-btn-wrap"),styleList:{border:"none",width:"32px",height:"14px"}}]),setTimeout((function(){A.inspectMapWin.centerToTrack(18)}),100)):(this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-mapbox"),styleList:{width:e+"px",height:t+"px",marginBottom:"0"}},{id:"".concat(this.jSPlugin.id,"-ez-iframe-footer-container"),styleList:{top:"0px"}},{id:"".concat(this.jSPlugin.id),styleList:{position:"relative",zIndex:"0",bottom:"0",right:"0"}}]),this.jSPlugin.Theme.inspect.reSizeVideo(this.jSPlugin.width,this.jSPlugin.height),this.inspectMode="video",this.changeInspectMode("video"),this.inspectMapWin.map.removeControl(this.ZoomControl),this.inspectMapWin.map.removeControl(this.NavigationControl3D),this.inspectMapWin.map.removeControl(this.LocationControl),this.inspectMapWin.map.removeOverlay(this.inspectMapWin.inspectRange),document.getElementById("".concat(this.jSPlugin.id,"-loading-item-btn-wrap"))&&this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-loading-item-btn"),styleList:{display:"block"}},{id:"".concat(this.jSPlugin.id,"-loading-item-btn-svg"),styleList:{display:"none"}},{id:"".concat(this.jSPlugin.id,"-loading-item-btn-wrap"),styleList:{border:"1px solid rgb(255, 255, 255)",width:"80px",height:"32px",color:"#fff","text-align":"center","line-height":"32px","font-size":"14px"}}]),setTimeout((function(){A.inspectMapWin.centerToTrack()}),100),this.jSPlugin.Zoom&&this.decoderState.state.play&&this.jSPlugin.Zoom.startZoom()),this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-wrap"),styleList:{width:this.jSPlugin.width+this.jSPlugin.inspectVideoWidth+"px",height:this.jSPlugin.height+this.jSPlugin.inspectVideoHeight+"px"}}])}}])}(),Be={customConfig:{defaultMicro:0,defaultPlay:0,maxTalkTime:0,bellPoster:0,maxBellTime:0,inspectInfo:{color:"#000000",backgroundColor:"#ffffff",activeColor:"#1890FF",btnList:[{btnKey:"inspectName",iconId:"inspectName",part:"left",defaultActive:0,isrender:1,color:"#262626"},{btnKey:"inspectBeginTime",iconId:"inspectBeginTime",part:"left",defaultActive:0,isrender:1,color:"#262626"},{btnKey:"inspectPerson",iconId:"inspectPerson",part:"right",defaultActive:0,isrender:1,color:"#262626"}]}},header:{color:"#2c2c2c",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{btnKey:"deviceName",iconId:"deviceName",part:"left",defaultActive:0,isrender:1,color:"#ffffff"},{btnKey:"inspectTime",iconId:"inspectTime",part:"left",defaultActive:0,isrender:1,color:"#ffffff"},{btnKey:"signalType",iconId:"signalType",part:"right",defaultActive:0,isrender:1,color:"#ffffff"},{btnKey:"batteryStatus",iconId:"batteryStatus",part:"right",defaultActive:0,isrender:1,color:"#ffffff"}]},footer:{color:"#ffffff",backgroundColor:"#000000",activeColor:"blue",btnList:[{btnKey:"talk",iconId:"talk",part:"left",defaultActive:1,isrender:1,backgroundColor:"#cccccc"},{btnKey:"sound",iconId:"sound",part:"left",defaultActive:1,isrender:1,backgroundColor:"#cccccc"}]}},Ee=function(A){var e="";return Object.keys(A).map((function(t,i){e+="".concat(t,":").concat(A[t]).concat(i\n \n ':"".concat(A,""):null}},{key:"renderBatteryStatus",value:function(A){return A&&0!=A?'\n
    \n ').concat(A,'%\n
    \n
    \n
    \n \n \n \n
    \n '):null}},{key:"renderInspectTime",value:function(A){if(!A)return null;var e,t,i,n,a=A.split(" "),r=a[0].split("-"),o=a[1].split(":"),s=new Date(r[0],r[1]-1,r[2],o[0],o[1],o[2]),g=(new Date).getTime()-new Date(s).getTime();return'\n \n '.concat((e=g,t=parseInt(e%864e5/36e5),i=parseInt(e%36e5/6e4),n=parseInt(e%6e4/1e3),(t<10?"0".concat(t):t)+":"+(i<10?"0".concat(i):i)+":"+(n<10?"0".concat(n):n)),"\n ")}},{key:"matchBtn",value:function(A,e){var t=this,i=this.themeData,n=i.customConfig,a=i.header,r=i.footer,o=n.inspectInfo,s={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}},g=o.btnList.findIndex((function(e){return e.iconId===A}));switch(-1!==g?(s.color=o.color,s.backgroundColor=o.backgroundColor,s.activeColor=o.activeColor):-1!==(g=a.btnList.findIndex((function(e){return e.iconId===A})))?(s.color=a.color,s.backgroundColor=a.backgroundColor,s.activeColor=a.activeColor):(s.color=r.color,s.backgroundColor=r.backgroundColor,s.activeColor=r.activeColor),A){case"inspectName":return s.title="巡检名称",s.id=A,s.domString='巡检名称'),s.onclick=function(){},s;case"inspectBeginTime":return s.title="巡检开始时间",s.id=A,s.domString='巡检开始时间:-'),s.onclick=function(){},s;case"inspectPerson":return s.title="本地巡检员",s.id=A,s.domString='本地巡检员:-'),s.onclick=function(){},s;case"deviceName":return s.title="设备名称",s.id=A,s.domString='设备名称'),s.onclick=function(){},s;case"inspectTime":return s.title="巡检时长",s.id=A,s.domString='巡检时长:-'),s.onclick=function(){},s;case"signalType":return s.title="信号类型",s.id=A,s.domString=''),s.onclick=function(){},s;case"batteryStatus":return s.title="设备电量",s.id=A,s.domString=''),s.onclick=function(){},s;case"talk":return s.title="对讲",s.id=A,s.domString="
    "+'')+''+'对讲'),s.onclick=function(){var A=t.decoderState.state,e=A.talk,i=A.sound;if(A.play)if(e){console.log("结束对讲"),t.setDecoderState({talk:!1}),t.jSPlugin.Talk.stopTalk();var n=M.findIndex(t.themeData.footer.btnList,(function(A){return"sound"===A.iconId&&1===A.isrender&&1===A.defaultActive}))>-1;t.themeData&&n&&(t.jSPlugin.openSound(),t.setDecoderState({sound:!0}))}else console.log("开始对讲"),t.setDecoderState({talk:!0}),t.jSPlugin.Talk.startTalk((function(A){i&&!A&&(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1}))}))},s;case"sound":return s.title="音量",s.id=A,s.domString=''+'')+'\n \n \n \n \n ')+'音量'),s.onclick=function(){var A=t.decoderState.state,e=A.play,i=A.sound,n=A.talk;e&&!n&&(i?(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1})):(t.jSPlugin.openSound(),t.setDecoderState({sound:!0})))},s;default:return s}}},{key:"renderInspectInfo",value:function(A,e){var t=this.matchBtn(A,e),i=document.createElement("sapn");i.innerHTML="".concat(t.domString),"left"===e.part?document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl-left")).appendChild(i):document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl-right")).appendChild(i)}},{key:"renderHeader",value:function(A,e){var t=this.matchBtn(A,e),i=document.createElement("span");i.className="".concat(this.jSPlugin.id,"-header-content"),i.style="display: flex; align-items: center; ",i.innerHTML="\n ".concat(t.domString,"\n "),"left"===e.part?document.getElementById("".concat(this.jSPlugin.id,"-headControl-left")).appendChild(i):document.getElementById("".concat(this.jSPlugin.id,"-headControl-right")).appendChild(i)}},{key:"renderFooter",value:function(A,e){var t=this,i=this.matchBtn(A,e),n=this.videoWidth/6,a=document.createElement("div");a.className="theme-icon-item",this.jSPlugin.isWebConsole?a.style="padding:0 ".concat(.1*n,"px;"):a.style="padding:0 ".concat(.1*n,"px;cursor: pointer;"),a.innerHTML="".concat('')+'
    ')).concat(i.domString,"
    ")+"
    ",a.onclick=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;i.onclick(A)},i.onmouseenter&&(a.onmouseenter=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;i.onmouseenter(A)}),i.onmouseleave&&(a.onmouseleave=function(A){if(t.decoderState.state.isEditing||!t.activeThemeStatus)return!1;i.onmouseleave(A)}),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).appendChild(a)}},{key:"initThemeData",value:function(){var A=this,e=this.themeData,t=e.customConfig,i=e.header,n=e.footer,a=t.inspectInfo,r=this.jSPlugin.id;if(this.isNeedRenderInspectInfo=M.findIndex(a.btnList,(function(A){return A.isrender>0}))>=0,this.isNeedRenderHeader=M.findIndex(i.btnList,(function(A){return A.isrender>0}))>=0,this.isNeedRenderFooter=M.findIndex(n.btnList,(function(A){return A.isrender>0}))>=0,this.isNeedRenderInspectInfo)if(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")))document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).innerHTML="
    ");else{var o=document.createElement("div");o.setAttribute("id","".concat(this.jSPlugin.id,"-inspectInfoControl")),o.setAttribute("class","inspectInfo-controls"),o.innerHTML="
    ");var s={height:"58px",display:"flex","justify-content":"space-between",top:0,"z-index":999,color:"#000000",width:"".concat(this.jSPlugin.width+290,"px"),position:"relative","align-items":"center",background:"#ffffff","border-bottom":"1px solid #D9D9D9","box-sizing":"border-box"};o.style=Ee(s),document.getElementById("".concat(r,"-wrap")).insertBefore(o,document.getElementById(this.jSPlugin.id));var g=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(g)}),50)}else document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")));if(this.isNeedRenderHeader)if(document.getElementById("".concat(this.jSPlugin.id,"-headControl")))document.getElementById("".concat(this.jSPlugin.id,"-headControl")).innerHTML="
    ");else{var c=document.createElement("div");c.setAttribute("id","".concat(this.jSPlugin.id,"-headControl")),c.setAttribute("class","header-controls"),c.innerHTML="
    ");var l={height:"56px",display:"flex","justify-content":"space-between",top:0,"z-index":999,color:"#FFFFFF",width:this.jSPlugin.width+"px",padding:"0 16px","box-sizing":"border-box",position:"relative","align-items":"center",background:"#000000"};c.style=Ee(l),document.getElementById("".concat(r,"-wrap")).insertBefore(c,document.getElementById(r));var I=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(I)}),50)}else document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-headControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-headControl")));if(this.isNeedRenderFooter)if(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")))document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="-".concat("56px","px"));else{var d=document.createElement("div");d.setAttribute("id","".concat(this.jSPlugin.id,"-ez-iframe-footer-container")),d.setAttribute("class","ez-iframe-footer-container");var C={position:"relative",display:"flex",height:"56px","flex-wrap":"wrap","justify-content":"center","z-index":999,top:0,color:"#FFFFFF",width:this.jSPlugin.width+"px","align-items":"center","background-color":"#000000","font-size":"14px"};d.style=Ee(C),d.innerHTML='\n
    \n
    \n
    \n "),Q(d,document.getElementById(r))}else document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")));this.isNeedRenderInspectInfo&&document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.background=a.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.color=a.color,a.btnList.map((function(e,t){e.isrender&&A.renderInspectInfo(e.iconId,e)}))),this.isNeedRenderHeader&&document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=i.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=i.color,i.btnList.map((function(e,t){e.isrender&&A.renderHeader(e.iconId,e)}))),this.isNeedRenderFooter&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=n.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=n.color,n.btnList.map((function(e,t){e.isrender&&A.renderFooter(e.iconId,e)}))),this.inspectMapWin=new ne(this.jSPlugin),this.inspectSmallWin=new ue(this.jSPlugin,this.inspectMode,this.inspectMapWin,this.changeInspectMode,this.decoderState)}},{key:"renderThemeData",value:function(){var A=this,e=this.decoderState.state.isEditing,t=this.themeData,i=t.inspectInfo,n=t.header,a=t.footer;if(this.isNeedRenderInspectInfo&&i&&(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.background=i.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.color=i.color.replace("-diy",""),i.btnList.map((function(e,t){e.isrender&&A.setDecoderState(o({},e.iconId,A.decoderState.state[e.iconId]))}))),this.isNeedRenderHeader&&n&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=n.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=n.color.replace("-diy",""),n.btnList&&n.btnList.map((function(e,t){e.isrender&&A.setDecoderState(o({},e.iconId,A.decoderState.state[e.iconId]))}))),this.isNeedRenderFooter&&a)document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=a.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=a.color.replace("-diy",""),a.btnList.map((function(t,i){if(t.isrender&&A.setDecoderState(o({},t.iconId,A.decoderState.state[t.iconId])),0==i&&!A.themeInited&&A.activeThemeStatus)var n=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(n),1!=A.themeData.customConfig.bellPoster||e?A.jSPlugin.play():A.jSPlugin.pluginStatus.loadingClear(),A.themeInited=!0)}),50)})),this.setDecoderState({cloudRec:"cloud.rec"===y(this.jSPlugin.url).type,rec:"rec"===y(this.jSPlugin.url).type,type:y(this.jSPlugin.url).type});else if(!this.themeInited&&this.activeThemeStatus)var r=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(r),A.themeData&&A.themeData.customConfig&&1==A.themeData.customConfig.bellPoster&&!e?A.jSPlugin.pluginStatus.loadingClear():A.jSPlugin.play(),A.themeInited=!0)}),50);var s=setInterval((function(){window.EZUIKit[A.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(s),A.reSizeVideo(A.videoWidth,A.videoHeight))}),50);this.jSPlugin.Zoom||(this.jSPlugin.Zoom=new bA(this.jSPlugin)),this.getInspectDevInfo(this.jSPlugin,!0,!1)}},{key:"getInspectRecord",value:function(){var A=this;!function(A,e,t){var i={accessToken:A.accessToken||A.token.deviceToken.video,deviceSerial:y(A.url).deviceSerial},n="".concat(A.env.domain,"/api/service/devicekit/bodycamera/inspect/detail/latest");GA(n,"GET",i,(function(A){e&&e(A)}),(function(A){t&&t(A)}),{"Content-Type":"application/x-www-form-urlencoded"})}(this.jSPlugin,(function(e){if(200==e.meta.code&&e.data){var t=e.data;t.inspectRange&&A.inspectMapWin.createPolygon(t.inspectRange,"#407AFF","dashed",4,1,"#407AFF",.08),t.inspectPoints&&t.inspectPoints.length>0&&A.inspectMapWin.createInspectPoints(t.inspectPoints),"video"===A.inspectMode&&A.inspectMapWin.map.removeOverlay(A.inspectMapWin.inspectRange),document.getElementById("".concat(A.jSPlugin.id,"-inspectInfo-inspectName"))&&t.inspectName&&(document.getElementById("".concat(A.jSPlugin.id,"-inspectInfo-inspectName")).innerText=""+t.inspectName),document.getElementById("".concat(A.jSPlugin.id,"-inspectInfo-inspectBeginTime"))&&t.beginTime&&(document.getElementById("".concat(A.jSPlugin.id,"-inspectInfo-inspectBeginTime")).innerText="巡检开始时间:"+t.beginTime),document.getElementById("".concat(A.jSPlugin.id,"-header-inspectTime"))&&A.timer.createInterval("InspectTimer",(function(){document.getElementById("".concat(A.jSPlugin.id,"-header-inspectTime")).innerHTML=A.renderInspectTime(t.beginTime)}),1e3),document.getElementById("".concat(A.jSPlugin.id,"-inspectInfo-inspectPerson"))&&t.inspectPerson&&(document.getElementById("".concat(A.jSPlugin.id,"-inspectInfo-inspectPerson")).innerText="本地巡检员:"+t.inspectPerson),A.inspectInfo=t,t.inspectRecordId&&le(A.jSPlugin,t.inspectRecordId,(function(e){200==e.meta.code&&e.data&&(A.inspectMapWin.createTrack(e.data,!0),A.timer.createInterval("TraceTimer",(function(){t.inspectRecordId&&le(A.jSPlugin,t.inspectRecordId,(function(e){200==e.meta.code&&e.data&&A.inspectMapWin.createTrack(e.data,!1)}),(function(){}))}),5e3))}),(function(){})),A.InspectEvent=new he(A.jSPlugin,t.inspectRecordId,A.timer)}else A.InspectEvent=new he(A.jSPlugin,null,A.timer)}),(function(A){}))}},{key:"getInspectDevInfo",value:function(A){var e=this,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];!function(A,e,t){var i={accessToken:A.accessToken||A.token.deviceToken.video,deviceSerial:y(A.url).deviceSerial},n="".concat(A.env.domain,"/api/service/devicekit/bodycamera");GA(n,"GET",i,(function(A){e&&e(A)}),(function(A){t&&t(A)}),{"Content-Type":"application/x-www-form-urlencoded"})}(A,(function(n){n.meta&&200==n.meta.code&&n.data?1===n.data.status?(i&&!e.decoderState.state.play&&(e.jSPlugin.pluginStatus.loadingStart(e.jSPlugin.id),e.jSPlugin.pluginStatus.loadingSetText({text:"视频加载中"}),e.jSPlugin.play()),e.globalContainer.globalContainerToggle("".concat(e.jSPlugin.id,"-inspect-global-box"),!1),document.getElementById("".concat(e.jSPlugin.id,"-header-deviceName"))&&(document.getElementById("".concat(e.jSPlugin.id,"-header-deviceName")).innerText="".concat(n.data.deviceName,"(").concat(n.data.deviceSerial,")"),document.getElementById("".concat(e.jSPlugin.id,"-header-deviceName")).setAttribute("title","".concat(n.data.deviceName,"(").concat(n.data.deviceSerial,")"))),document.getElementById("".concat(e.jSPlugin.id,"-header-signalType"))&&(document.getElementById("".concat(e.jSPlugin.id,"-header-signalType")).innerHTML=e.renderSignalType(n.data.signalType)),document.getElementById("".concat(e.jSPlugin.id,"-header-batteryStatus"))&&(document.getElementById("".concat(e.jSPlugin.id,"-header-batteryStatus")).innerHTML=e.renderBatteryStatus(n.data.batteryStatus)),e.timer.createInterval("InspectDevInfoTimer",(function(){e.getInspectDevInfo(A,!1,!1)}),3e5),t&&e.getInspectRecord()):(e.globalContainer.globalContainerToggle("".concat(e.jSPlugin.id,"-inspect-loading-box"),!1),e.jSPlugin.stop(),e.globalContainer.deviceErrorInfo({tips:"当前设备未在巡检中",refreshBtn:"刷新",refreshShow:!0},(function(){e.globalContainer.globalContainerToggle("".concat(e.jSPlugin.id,"-no-inspect-box"),!1),e.globalContainer.globalContainerToggle("".concat(e.jSPlugin.id,"-inspect-loading-box"),!0),e.getInspectDevInfo(A,!0,!0)}))):(e.globalContainer.globalContainerToggle("".concat(e.jSPlugin.id,"-inspect-loading-box"),!1),e.jSPlugin.stop(),e.globalContainer.deviceErrorInfo({tips:n.meta.message,refreshShow:!1}))}),(function(){e.globalContainer.globalContainerToggle("".concat(e.jSPlugin.id,"-inspect-global-box"),!1)}))}},{key:"fetchThemeData",value:function(A){var e=this;PA(this.jSPlugin,A,(function(A){if(0!==A.meta.code||!A.data)return e.activeThemeStatus=!1,e.jSPlugin.pluginStatus.loadingClear(),"111021"==A.meta.code?(e.globalContainer.globalContainerToggle("".concat(e.jSPlugin.id,"-inspect-loading-box"),!1),e.jSPlugin.stop(),e.globalContainer.deviceErrorInfo({tips:"无效的模板id",refreshBtn:"刷新",refreshShow:!1}),void(e.activeThemeStatusTxt="无效的模板id")):"111023"==A.meta.code?(e.globalContainer.globalContainerToggle("".concat(e.jSPlugin.id,"-inspect-loading-box"),!1),e.jSPlugin.stop(),e.globalContainer.deviceErrorInfo({tips:"您的试用特权已到期,需前往轻应用控制台购买后使用。",refreshBtn:"刷新",refreshShow:!1}),void(e.activeThemeStatusTxt="试用特权已到期")):(e.globalContainer.globalContainerToggle("".concat(e.jSPlugin.id,"-inspect-loading-box"),!1),e.jSPlugin.stop(),e.globalContainer.deviceErrorInfo({tips:"模板未激活,请先在开放平台轻应用控制台购买模板",refreshBtn:"刷新",refreshShow:!1}),void(e.activeThemeStatusTxt="模板未激活"));e.activeThemeStatus=!0,e.themeData=A.data,e.jSPlugin.capacity?(e.initThemeData(),e.renderThemeData()):setTimeout((function(){e.initThemeData(),e.renderThemeData()}),300)}),(function(){e.themeData=Be,e.themeData.header&&(e.themeData.header.btnList=e.themeData.header.btnList.sort((function(A,e){return A.btnKey.split("-")[3]-e.btnKey.split("-")[3]}))),e.themeData.footer&&(e.themeData.footer.btnList=e.themeData.footer.btnList.sort((function(A,e){return A.btnKey.split("-")[3]-e.btnKey.split("-")[3]}))),e.initThemeData(),e.renderThemeData()}))}},{key:"reSizeVideo",value:function(A,e){if(document.getElementById("".concat(this.jSPlugin.id)).style.width=A+"px",document.getElementById("".concat(this.jSPlugin.id)).style.height=e+"px",this.jSPlugin&&this.jSPlugin.bPlay)this.jSPlugin.JS_Resize(A,e);else{document.getElementById("".concat(this.jSPlugin.id,"-player"))&&(document.getElementById("".concat(this.jSPlugin.id,"-player")).width=A,document.getElementById("".concat(this.jSPlugin.id,"-player")).height=e,document.getElementById("".concat(this.jSPlugin.id,"-player")).style.width=A+"px",document.getElementById("".concat(this.jSPlugin.id,"-player")).style.height=e+"px",document.getElementById("".concat(this.jSPlugin.id,"-container-0")).style.height=e+"px");var t=1;if(document.getElementById("".concat(this.jSPlugin.id,"canvas0")))navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)&&(t=2),document.getElementById("".concat(this.jSPlugin.id,"canvas0")).style.width=A*t+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas0")).style.height=e*t+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas0")).width=A*t,document.getElementById("".concat(this.jSPlugin.id,"canvas0")).height=e*t,document.getElementById("".concat(this.jSPlugin.id,"canvas0")).parentNode.style.width=A*t+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas0")).parentNode.style.height=e*t+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas_draw0")).height=e*t}}},{key:"reSize",value:function(A,e){var t=.3333*A,i=.3333*e;document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.width=A+this.jSPlugin.inspectVideoWidth+"px"),document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.width=A+"px"),document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.width=A+"px"),"video"===this.jSPlugin.Theme.inspectMode?(this.reSizeVideo(A,e),document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.top=0),document.getElementById("".concat(this.jSPlugin.id,"-mapbox")).style.width=t+"px",document.getElementById("".concat(this.jSPlugin.id,"-mapbox")).style.height=i+"px"):(document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.top=e+"px"),this.reSizeVideo(t,i),document.getElementById("".concat(this.jSPlugin.id,"-mapbox")).style.width=A+"px",document.getElementById("".concat(this.jSPlugin.id,"-mapbox")).style.height=e+"px"),document.getElementById("".concat(this.jSPlugin.id,"-miniToggle")).style.bottom=i/2+96-30+"px",document.getElementById("".concat(this.jSPlugin.id,"-miniToggle")).style.right=this.jSPlugin.inspectVideoWidth+t+"px"}}])}(),xe=function(){return a((function A(e){var i=this;if(t(this,A),o(this,"changeInspectMode",(function(A){i.inspectMode=A})),this.jSPlugin=e,this.videoWidth=e.width,this.videoHeight=e.height,this.inspectMode="video",this.autoFocus=0,this.decoderState={state:{isEditing:!1,play:!1,sound:!1,recordvideo:!1,recordCount:"00:00",talk:!1,mute:!1,rejection:!1,cloudRec:"cloud.rec"===y(e.url).type,rec:"rec"===y(e.url).type,type:y(e.url).type}},this.isMobile=navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i),void 0!==e.isMobile&&(this.isMobile=e.isMobile),this.themeData=Be,"themeData"==this.jSPlugin.themeId&&(this.themeData=this.jSPlugin.params.themeData),this.timer||(this.timer=new ie(e)),this.jSPlugin.themeId)if(this.isMobile||(this.inspect=new Qe(this.jSPlugin,this.themeData,this.setDecoderState,this.decoderState,this.inspectMode,this.changeInspectMode,this.timer)),"themeData"===this.jSPlugin.themeId)this.themeData=this.jSPlugin.params.themeData,this.inspect.initThemeData(),this.inspect.renderThemeData();else this.inspect.fetchThemeData(this.jSPlugin.themeId);this.jSPlugin.Talk||(this.jSPlugin.Talk=new EA(this.jSPlugin)),B("".concat(this.jSPlugin.staticPath,"/css/theme.css")),B("".concat(this.jSPlugin.staticPath,"/css/component.css")),B("".concat(this.jSPlugin.staticPath,"/css/inspectTheme.css"))}),[{key:"setDecoderState",value:function(A,e){var t=this,i="#FFFFFF",n="#1890FF";Object.keys(A).map((function(e){switch(e){case"talk":document.getElementById("".concat(t.jSPlugin.id,"-talk"))&&(document.getElementById("".concat(t.jSPlugin.id,"-talk")).className=A[e]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-talk-content")).childNodes[1].style.fill=A[e]?n:i,document.getElementById("".concat(t.jSPlugin.id,"-talk-content")).childNodes[2].style.color=A[e]?n:i);break;case"sound":document.getElementById("".concat(t.jSPlugin.id,"-sound"))&&(A[e]?(document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:none",document.getElementById("".concat(t.jSPlugin.id,"-sound")).className=A[e]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).childNodes[0].children[1].style.fill=A[e]?n:i,document.getElementById("".concat(t.jSPlugin.id,"-sound-label")).style.color=A[e]?n:i):(document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:none",document.getElementById("".concat(t.jSPlugin.id,"-sound")).className=A[e]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-sound-label")).style.color=A[e]?n:i))}t.decoderState.state=Object.assign(t.decoderState.state,A)}))}},{key:"setDisabled",value:function(A){var e=this.decoderState.state,t=e.sound;e.hd,null!=document.getElementById("".concat(this.jSPlugin.id,t?"-sound-icon":"-nosound-icon"))&&document.getElementById("".concat(this.jSPlugin.id,t?"-sound-icon":"-nosound-icon")).setAttribute("style",A?"cursor: not-allowed;fill: gray":"cursor: default"),null!=document.getElementById("".concat(this.jSPlugin.id,"-sound-label"))&&document.getElementById("".concat(this.jSPlugin.id,"-sound-label")).setAttribute("style",A?"cursor: not-allowed; color: gray":"cursor: default"),null!=document.getElementById("".concat(this.jSPlugin.id,"-talk-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-talk-icon")).setAttribute("style",A?"cursor: not-allowed;fill: gray":"cursor: default"),null!=document.getElementById("".concat(this.jSPlugin.id,"-talk-label"))&&document.getElementById("".concat(this.jSPlugin.id,"-talk-label")).setAttribute("style",A?"cursor: not-allowed; color: gray":"cursor: default")}},{key:"inspectEnding",value:function(){var A=document.createElement("div");A.id="".concat(this.jSPlugin.id,"-inspect-ending-box"),A.style="width:100%; position: absolute; z-index: 10000; top:58px; bottom:0; left:0; background: #ffffff;",A.innerHTML='
    \n
    \n
    \n \n
    \n
    巡检已结束
    \n
    \n
    \n ',document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(A),this.jSPlugin.Zoom&&this.jSPlugin.Zoom.stopZoom()}}])}(),pe=function(){return a((function A(){t(this,A),this.events={}}),[{key:"on",value:function(A,e){A&&e&&(this.events[A]=this.events[A]||[],this.events[A].push(e))}},{key:"emit",value:function(A,e){A&&this.events[A]&&this.events[A].forEach((function(A){return A(e)}))}},{key:"off",value:function(A,e){A&&e&&this.events[A]&&this.events[A].splice(this.events[A].indexOf(e),1)}},{key:"once",value:function(A,e){var t=this;this.on(A,(function i(){var n=Array.prototype.slice.call(arguments);e.apply(null,n),t.off(A,i)}))}},{key:"removeAllListener",value:function(){this.events={}}}])}();!function(A,e){"object"===("undefined"==typeof module?"undefined":d(module))&&"object"===d(module.exports)?module.exports=A.document?e(A,!0):function(A){if(!A.document)throw new Error("EZUIPlayer requires a window with a document");return e(A)}:e(A)}("undefined"!=typeof window?window:void 0,(function(A,e){function t(A,e){for(var t=document.getElementsByTagName("head")[0].getElementsByTagName("script"),i=!1,n=0;n0&&(A+="&controls="+e.controls.join(","))),e.websocketParams&&(A+="&websocketParams="+JSON.stringify(e.websocketParams)),A;case"standard":return a+"/ezopen/h5/iframe?bSupporDoubleClickFull=0&url="+o.opt.url.replace("?","&")+"&autoplay="+o.opt.autoplay+"&audio="+o.opt.audio+"&accessToken="+e.accessToken+"&templete=1&id="+s+"&decoderVersion="+o.opt.decoderVersion;case"security":return a+"/ezopen/h5/iframe_se?bSupporDoubleClickFull=0&url="+o.opt.url.replace("?","&")+"&autoplay="+o.opt.autoplay+"&audio="+o.opt.audio+"&accessToken="+e.accessToken+"&templete=0&id="+s+"&decoderVersion="+o.opt.decoderVersion;case"theme":return A=a+"/jssdk/theme.html?url=".concat(e.url,"&accessToken=").concat(e.accessToken,"&id=").concat(s,"&isMobile=").concat(e.isMobile),void 0!==e.isMobile&&(A+="&isMobile="+e.isMobile),void 0!==e.autoplay&&(A+="&autoplay="+e.autoplay),void 0!==e.domain&&"https://test12open.ys7.com"==e.domain&&(A+="&env=test12"),void 0!==e.env&&void 0!==e.env.domain&&"https://test12open.ys7.com"==e.env.domain&&(A+="&env=test12"),void 0!==e.header&&(A+="&header="+e.header),A;default:return a+"/ezopen/h5/iframe?bSupporDoubleClickFull=0&url="+o.opt.url.replace("?","&")+"&autoplay="+o.opt.autoplay+"&audio="+o.opt.audio+"&accessToken="+e.accessToken+"&templete=0&id="+s+"&decoderVersion="+o.opt.decoderVersion}}();var l=document.getElementById(s).offsetHeight,I=document.getElementById(s).offsetWidth;e.height&&(l=parseInt(e.height),/\%$/.test(e.height)&&(I=document.getElementById(s).offsetWidth*(parseInt(e.height)/100))),e.width&&(I=parseInt(e.width),/\%$/.test(e.width)&&(I=document.getElementById(s).offsetWidth*(parseInt(e.width)/100))),c.width=I,c.height=l,c.id="EZUIKitPlayer-"+s,c.setAttribute("allowfullscreen",!0),c.setAttribute("allow","autoplay"),c.setAttribute("frameborder",0),g.appendChild(c);var C=o.opt.filePath+"/js/jquery.js";t(C,(function(){t("https://open.ys7.com/assets/layer/layer.js",(function(){if(B().headerContainer){var r=document.createElement("div");r.setAttribute("class","panel-top");var s=document.createElement("div");if(s.setAttribute("class","contros"),r.appendChild(s),g.insertBefore(r,c),B().capturePictureModule){var l=document.createElement("span");l.innerHTML=' ',l.onclick=function(){o.capturePicture()},s.appendChild(l)}if(console.log("matchHeaderOpt().saveModule",B().saveModule),B().saveModule){var I=document.createElement("span");I.innerHTML=' ',I.onclick=function(){o.startSave(),document.getElementById("startSave").setAttribute("class","icon hide"),document.getElementById("stopSave").setAttribute("class","icon")},s.appendChild(I);var d=document.createElement("span");d.innerHTML=' ',d.onclick=function(){o.stopSave(),document.getElementById("stopSave").setAttribute("class","icon hide"),document.getElementById("startSave").setAttribute("class","icon")},s.appendChild(d)}if(B().zoomModule){var C=document.createElement("span");C.innerHTML=' ',C.onclick=function(){o.enableZoom(),document.getElementById("enableZoom").setAttribute("class","icon hide"),document.getElementById("closeZoom").setAttribute("class","icon")},s.appendChild(C);var h=document.createElement("span");h.innerHTML=' ',h.onclick=function(){o.closeZoom(),document.getElementById("closeZoom").setAttribute("class","icon hide"),document.getElementById("enableZoom").setAttribute("class","icon")},s.appendChild(h)}}function u(){var A={footerContainer:!1,talkModule:!1,broadcastModule:!1,hdModule:!1,fullScreenModule:!1};switch(o.opt.template){case"simple":case"standard":var t;if(e.footer&&e.footer instanceof Array)A={footerContainer:!0,talkModule:-1!==(t=e.footer).indexOf("talk"),broadcastModule:-1!==t.indexOf("broadcast"),hdModule:-1!==t.indexOf("hd"),fullScreenModule:-1!==t.indexOf("fullScreen")};break;case"security":break;case"voice":A={footerContainer:!0,talkModule:!0,broadcastModule:!0,hdModule:!0,fullScreenModule:!0}}return A}function B(){var A={headerContainer:!1,capturePictureModule:!1,saveModule:!1,zoomModule:!1};switch(o.opt.template){case"simple":if(e.header&&e.header instanceof Array){var t=e.header;A={headerContainer:!0,capturePictureModule:-1!==t.indexOf("capturePicture"),saveModule:-1!==t.indexOf("save"),zoomModule:-1!==t.indexOf("zoom")}}break;case"standard":case"security":break;case"voice":A={headerContainer:!0,capturePictureModule:!0,saveModule:!0,zoomModule:!0}}return A}if(u().footerContainer||-1!==o.opt.plugin.indexOf("talk")){var E=o.opt.filePath+"/npm/css/recoder.css",f=o.opt.filePath+"/npm/js/recoder.js",Q=o.opt.filePath+"/recorder.js";if(function(A,e){for(var t=document.getElementsByTagName("head")[0].getElementsByTagName("link"),i=!1,n=0;n0?(t--,document.getElementById("time-area").innerHTML=i(t)):(clearInterval(n.state.countTimer),n.state.countTimer=void 0,console.log("倒计时结束,开启声音"))}),1e3)}else"destory"===A&&(clearInterval(n.state.countTimer),n.state.countTimer=void 0,document.getElementById("time-area").innerHTML="00:00");function i(A){var e,t,i,n=parseInt(A),a=0,r=0;return n>59&&(a=parseInt(n/60),n=parseInt(n%60),a>59&&(r=parseInt(a/60),a=parseInt(a%60))),e=parseInt(n)>9?parseInt(n):"0"+parseInt(n),t=parseInt(a)>9?parseInt(a):"0"+parseInt(a),i=parseInt(r)>9?parseInt(r):"0"+parseInt(r),r>0?i+":"+t+":"+e:a>0?t+":"+e:"00:"+e}},p=document.createElement("div");if(p.setAttribute("class","audio-controls"),g.appendChild(p),u().hdModule||u().fullScreenModule){var m=document.createElement("div");if(m.setAttribute("class","contros"),p.appendChild(m),u().hdModule){var y=document.createElement("span");y.setAttribute("id","video-hd"),y.innerHTML=-1===o.opt.url.indexOf(".hd")?"标清":"高清",y.onclick=function(){if(o.opt.videoLoading)return layer.msg("视频加载中,请稍后"),!1;var A=o.stop();o.opt.videoLoading=!0,A.then((function(A){o.opt.videoLoading=!1,-1===o.opt.url.indexOf(".hd")?(o.opt.url=o.opt.url.replace(".live",".hd.live"),y.innerHTML=-1===o.opt.url.indexOf(".hd")?"标清":"高清"):(o.opt.url=o.opt.url.replace(".hd.live",".live"),y.innerHTML=-1===o.opt.url.indexOf(".hd")?"标清":"高清"),o.play(o.opt.url)})).catch((function(A){console.log("error",A)}))},m.appendChild(y)}if(u().fullScreenModule){var _=document.createElement("span");_.setAttribute("class","hide"),_.setAttribute("id","ezuikit-open-sound"),_.setAttribute("title","打开声音"),_.setAttribute("style","vertical-align: top;"),_.innerHTML='',_.onclick=function(){o.openSound(0),_.setAttribute("class","hide"),S.setAttribute("class","")};var S=document.createElement("span");_.setAttribute("id","ezuikit-close-sound"),S.setAttribute("class","hide"),S.setAttribute("title","关闭声音"),S.setAttribute("style","vertical-align: top;"),S.innerHTML='',S.onclick=function(){o.closeSound(0),_.setAttribute("class",""),S.setAttribute("class","hide")},m.appendChild(_),m.appendChild(S)}if(1==o.opt.audio?S.setAttribute("class",""):(_.setAttribute("class",""),o.closeSound(0)),u().fullScreenModule){var D=document.createElement("span");D.setAttribute("title","全屏"),D.setAttribute("style","vertical-align: top;"),D.innerHTML=' ',D.onclick=function(){o.fullScreen()},m.appendChild(D)}}if(u().talkModule){var v=document.createElement("div"),w=document.createElement("div");v.setAttribute("class","ptp-talk off"),v.innerHTML=' 开启对讲',v.onclick=function(){if(console.log("EZUIKit.state.countTimer",n.state.countTimer),n.state.countTimer)return A.layer.msg("语音设备正忙,请稍后重试"),!1;x("add",0),console.log("开始对讲,关闭声音"),o.closeSound(0),console.log(o.opt),o.startTalk(),this.setAttribute("class","ptp-talk off hide"),w.setAttribute("class","ptp-talk on")},w.setAttribute("class","ptp-talk on hide"),w.innerHTML=' 关闭对讲',w.onclick=function(){console.log(o.opt),o.stopTalk(),x("destory",0),o.openSound(0),this.setAttribute("class","ptp-talk on hide"),v.setAttribute("class","ptp-talk off")},p.appendChild(v),p.appendChild(w)}if(u().broadcastModule){var b=function(A){i(a+"/api/lapp/voice/query","POST",{accessToken:o.opt.accessToken,pageStart:A,pageSize:n.state.pageSize,default:n.state.fetchDefaultList?"true":"false"},0,(function(e){console.log("data",e),200==e.code&&(F(e.data,5),n.state.page=e.page.page,0!=A||0!=e.data.length||n.state.fetchDefaultList||(n.state.fetchDefaultList=!0,b(0)))}))},F=function(A){if(console.log("renderVoliceList",A),A&&A.length>0){for(var e=0;e"+(A[e].voiceName.length>10?A[e].voiceName.substr(0,10)+"...":A[e].voiceName)+"",document.getElementsByClassName("voice-list-ul")[0].append(t),t.onclick=function(A){console.log("点击元素",A.target,A.target.dataset.url);var e=A.target.dataset.url,t=A.target.dataset.time;R(e,t)}}A.length===n.state.pageSize?document.getElementById("voice-list-end").innerHTML="向下滚动加载更多":document.getElementById("voice-list-end").innerHTML="没有更多数据了"}},R=function(e,t){console.log("播放语音",e,t),i(a+"/api/lapp/voice/send","POST",{accessToken:o.opt.accessToken,deviceSerial:o.opt.deviceSerial,channelNo:o.opt.channelNo,fileUrl:e},0,(function(e){console.log("data.data",e.data),200==e.code?x("sub",parseInt(t)):"10001"==e.code?A.layer.msg("未找到当前语音"):A.layer.msg(e.msg||"发送失败,请稍后再试")}))},k=document.createElement("div"),P=document.createElement("div");k.setAttribute("class","broadcast off"),P.setAttribute("class","broadcast on hide"),k.innerHTML=' 语音播报',k.onclick=function(){this.setAttribute("class","broadcast off hide"),P.setAttribute("class","broadcast on")},P.innerHTML='
    自定义语音
    语音播报',P.onclick=function(){this.setAttribute("class","broadcast on hide"),k.setAttribute("class","broadcast off")},p.appendChild(k),p.appendChild(P),document.getElementById("voice-custom").onclick=function(){console.log("显示自定义语音"),N.setAttribute("class","speak off")},b(0);var N=document.createElement("div"),T=document.createElement("div");N.setAttribute("class","speak off hide"),T.setAttribute("class","speak on hide"),N.setAttribute("id","startSpeak"),T.setAttribute("id","stopSpeak"),N.innerHTML=' 按住说话',T.innerHTML=' 松开发送',p.appendChild(N),p.appendChild(T),document.getElementById("voice-list").onscroll=function(A){var e=this.scrollHeight;console.log("sum",e,this.scrollTop,document.getElementById("voice-list").clientHeight),e<=this.scrollTop+this.clientHeight&&(console.log("拖动到底,执行加载",n.state.page),b(++n.state.page))};var M,L=document.createElement("div");L.setAttribute("class","time-area"),L.setAttribute("id","time-area"),L.innerHTML="00:00",p.appendChild(L),document.getElementById("startSpeak").onmousedown=function(){if(n.state.countTimer)return A.layer.msg("语音设备正忙,请稍后重试"),!1;var e;function t(t){var i=e.createMediaStreamSource(t);M=new A.Recorder(i)}console.log("按住说话"),N.setAttribute("class","speak off hide"),T.setAttribute("class","speak on"),function(){console.log("run init");try{A.AudioContext=A.AudioContext||A.webkitAudioContext,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia,A.URL=A.URL||A.webkitURL,e=new AudioContext,console.log("Audio context set up."),console.log("navigator.getUserMedia "+(navigator.getUserMedia?"available.":"not present!"))}catch(e){console.log("err",e),A.layer.msg("No web audio support in this browser!")}navigator.getUserMedia({audio:!0},t,(function(A){console.log("No live audio input: "+A)}))}(),x("add",0),setTimeout((function(){n.state.recodeTime=0,M&&M.record()}),1e3),n.state.recodeTimer&&clearInterval(n.state.recodeTimer),n.state.recodeTimer=setInterval((function(){n.state.recodeTime>=59?(o.stopTalk(),x("destory",0),this.setAttribute("class","ptp-talk on hide"),v.setAttribute("class","ptp-talk off"),A.layer.msg("不超过1分钟")):n.state.recodeTime=n.state.recodeTime+1}),1e3)},document.getElementById("stopSpeak").onmouseup=function(){console.log("松开发送"),T.setAttribute("class","speak on hide"),function(){if(x("destory",0),n.state.recodeTime<1)return A.layer.msg("说话时间过短"),clearInterval(n.state.recodeTimer),!1;clearInterval(n.state.recodeTimer),function(){try{M&&M.stop(),M&&M.exportWAV((function(e){if(console.log("wav_file",e),e.size<1e3)return A.layer.msg("录音失败,请重试"),n.state.recodeTime=0,!1;x("sub",n.state.recodeTime+2);var t=new FormData;function r(e){console.log("data.data",e.data),200==e.code?x("sub",n.state.recodeTime+2):"10001"==e.code?A.layer.msg("未找到当前语音"):A.layer.msg(e.msg||"发送失败,请稍后再试")}t.append("voiceFile",e),t.append("accessToken",o.opt.accessToken),t.append("deviceSerial",o.opt.deviceSerial),t.append("channelNo",o.opt.channelNo),i(a+"/api/lapp/voice/sendonce","POST",{voiceFile:e,accessToken:o.opt.accessToken,deviceSerial:o.opt.deviceSerial,channelNo:o.opt.channelNo},0,r)})),M&&M.clear()}catch(A){console.log(A)}}()}()}}}}}))}));o=this;function h(A){o.opt.fullScreenStatus=A?1:0,e.fullScreenChangeCallBack&&e.fullScreenChangeCallBack({data:A,id:o.opt.id})}A.addEventListener("message",(function(t){t.origin;var i=o.opt.id;if(t.data.type)switch(t.data.type){case"openSound":i==t.data.id&&e.openSoundCallBack&&e.openSoundCallBack(t.data);break;case"closeSound":i==t.data.id&&e.closeSoundCallBack&&e.closeSoundCallBack(t.data);break;case"capturePicture":i==t.data.id&&e.capturePictureCallBack&&e.capturePictureCallBack(t.data);break;case"startSave":i==t.data.id&&e.startSaveCallBack&&e.startSaveCallBack(t.data);break;case"stopSave":i==t.data.id&&e.stopSaveCallBack&&e.stopSaveCallBack(t.data);break;case"fullScreen":i==t.data.id&&e.fullScreenCallBack&&e.fullScreenCallBack(t.data);break;case"getOSDTime":i==t.data.id&&e.getOSDTimeCallBack&&e.getOSDTimeCallBack(t.data);break;case"handleSuccess":i==t.data.id&&e.handleSuccess&&e.handleSuccess(t.data);break;case"handleError":i==t.data.id&&e.handleError&&e.handleError(t.data);break;case"dblclick":i==t.data.id&&o.opt.bSupporDoubleClickFull&&(0===o.opt.fullScreenStatus?o.fullScreen():o.cancelFullScreen());break;case"startTalk":o.startTalk(),o.closeSound();break;case"stopTalk":o.stopTalk(),o.openSound();break;case"clickEventHandle":console.log("event.data",t.data),e.clickEventHandle&&e.clickEventHandle(t.data);break;case"removeEventHandle":e.removeEventHandle&&e.removeEventHandle(t.data);break;case"esc":e.clickEventHandle&&e.clickEventHandle(t.data);break;case"iframeFullScreen":if(i==t.data.id){!function(e){var t=e.requestFullScreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullScreen;if(t)t.call(e);else if(void 0!==A.ActiveXObject){var i=new ActiveXObject("WScript.Shell");null!==i&&i.SendKeys("{F11}")}}(document.getElementById("EZUIKitPlayer-"+t.data.id))}}})),void 0!==document.fullScreen?document.addEventListener("fullscreenchange",(function(){h(document.fullscreen||!1)})):void 0!==document.webkitIsFullScreen?document.addEventListener("webkitfullscreenchange",(function(){h(document.webkitIsFullScreen||!1)})):void 0!==document.mozFullScreen&&document.addEventListener("mozfullscreenchange",(function(){h(document.mozFullScreen||!1)}))};return s.prototype.play=function(e){var t="EZUIKitPlayer-"+this.opt.id,i=document.getElementById(t).contentWindow;"object"===d(e)&&e.url&&(this.opt.url=e.url),"object"===d(e)&&e.accessToken&&(this.opt.accessToken=e.accessToken),"string"==typeof e&&(this.opt.url=e),i.postMessage({action:"play",accessToken:this.opt.accessToken,url:this.opt.url},a+"/ezopen/h5/iframe");var n=this;return this.opt.videoLoading=!0,new Promise((function(e,t){A.addEventListener("message",(function(A){n.opt.id==A.data.id&&"handleSuccess"===A.data.type&&(setTimeout((function(){n.opt.videoLoading=!1}),1e3),e(A.data))}))}))},s.prototype.stop=function(){var e="EZUIKitPlayer-"+this.opt.id;document.getElementById(e).contentWindow.postMessage("stop",a+"/ezopen/h5/iframe");var t=this;return new Promise((function(e,i){A.addEventListener("message",(function(A){t.opt.id==A.data.id&&"stop"===A.data.type&&e(A.data)}))}))},s.prototype.openSound=function(){var e="EZUIKitPlayer-"+this.opt.id;document.getElementById(e).contentWindow.postMessage("openSound",a+"/ezopen/h5/iframe");var t=this;return new Promise((function(e,i){A.addEventListener("message",(function(A){t.opt.id==A.data.id&&"openSound"===A.data.type&&e(A.data)}))}))},s.prototype.closeSound=function(){var e="EZUIKitPlayer-"+this.opt.id;document.getElementById(e).contentWindow.postMessage("closeSound",a+"/ezopen/h5/iframe");var t=this;return new Promise((function(e,i){A.addEventListener("message",(function(A){t.opt.id==A.data.id&&"closeSound"===A.data.type&&e(A.data)}))}))},s.prototype.startSave=function(e){var t="EZUIKitPlayer-"+this.opt.id;document.getElementById(t).contentWindow.postMessage({action:"startSave",fileName:e||"default"},a+"/ezopen/h5/iframe");var i=this;return new Promise((function(e,t){A.addEventListener("message",(function(A){i.opt.id==A.data.id&&"startSave"===A.data.type&&e(A.data)}))}))},s.prototype.stopSave=function(){var e="EZUIKitPlayer-"+this.opt.id;document.getElementById(e).contentWindow.postMessage("stopSave",a+"/ezopen/h5/iframe");var t=this;return new Promise((function(e,i){A.addEventListener("message",(function(A){t.opt.id==A.data.id&&"stopSave"===A.data.type&&e(A.data)}))}))},s.prototype.fullScreen=function(){if(1===this.opt.fullScreenStatus)return!1;var e="EZUIKitPlayer-"+this.opt.id,t=document.getElementById(e).contentWindow;if(navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)){var i=document.documentElement.clientWidth,n=document.documentElement.clientHeight,r=(document.body,"");r+="width:"+n+"px;",r+="height:"+i+"px;",r+="-webkit-transform: rotate(90deg); transform: rotate(90deg);",r+="-webkit-transform-origin: "+i/2+"px "+i/2+"px;",r+="transform-origin: "+i/2+"px "+i/2+"px;",r+="position: fixed;top: 0;left: 0;z-index:10",document.getElementById(e).style.cssText=r,setTimeout((function(){t.postMessage("autoResize",a+"/ezopen/h5/iframe")}),500)}else{!function(e){var t=e.requestFullScreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullScreen;if(t)t.call(e);else if(void 0!==A.ActiveXObject){var i=new ActiveXObject("WScript.Shell");null!==i&&i.SendKeys("{F11}")}}(document.getElementById(e))}this.params.fullScreenCallBack&&this.params.fullScreenCallBack(this.opt.id),this.opt.fullScreenStatus=1},s.prototype.cancelFullScreen=function(){if(0===this.opt.fullScreenStatus)return!1;var A="EZUIKitPlayer-"+this.opt.id,e=document.getElementById(A).contentWindow;if(navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)){var t=document.getElementById(A).width,i=document.getElementById(A).height,n=(document.body,"");n+="width:"+t+"px;",n+="height:"+i+"px;",n+="-webkit-transform: none; transform: none;",n+="-webkit-transform-origin: 0 0;",n+="transform-origin: 0 0;",document.getElementById(A).style.cssText=n,setTimeout((function(){e.postMessage("autoResize",a+"/ezopen/h5/iframe")}),500);var r=A+"cancel-full-screen",o=document.getElementById(r);o&&document.body.removeChild(o)}else document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.mozCancelFullScreen&&document.mozCancelFullScreen();this.params.cancelFullScreenCallBack&&this.params.cancelFullScreenCallBack(this.opt.id),this.opt.fullScreenStatus=0},s.prototype.capturePicture=function(e,t){var i="EZUIKitPlayer-"+this.opt.id;document.getElementById(i).contentWindow.postMessage({action:"capturePicture",fileName:e||"default",isUndownload:t},a+"/ezopen/h5/iframe");var n=this;return new Promise((function(e,t){A.addEventListener("message",(function(A){n.opt.id==A.data.id&&"capturePicture"===A.data.type&&e(A.data)}))}))},s.prototype.enableZoom=function(){var A="EZUIKitPlayer-"+this.opt.id;document.getElementById(A).contentWindow.postMessage("enableZoom",a+"/ezopen/h5/iframe")},s.prototype.closeZoom=function(){var A="EZUIKitPlayer-"+this.opt.id;document.getElementById(A).contentWindow.postMessage("closeZoom",a+"/ezopen/h5/iframe")},s.prototype.getOSDTime=function(){var e="EZUIKitPlayer-"+this.opt.id;document.getElementById(e).contentWindow.postMessage("getOSDTime",a+"/ezopen/h5/iframe");var t=this;return new Promise((function(e,i){A.addEventListener("message",(function(A){t.opt.id==A.data.id&&"getOSDTime"===A.data.type&&e(A.data)}))}))},s.prototype.autoResize=function(){var A="EZUIKitPlayer-"+this.opt.id;document.getElementById(A).contentWindow.postMessage("autoResize",a+"/ezopen/h5/iframe")},s.prototype.reSize=function(A,e){var t="EZUIKitPlayer-"+this.opt.id,i=document.getElementById(t).contentWindow,n=document.getElementById(this.opt.id);n.style.width=A+"px",n.style.height=e+"px",document.getElementById(this.opt.id).style.width=A+"px",document.getElementById(this.opt.id).style.height=e+"px";var r=document.getElementById(t);r.setAttribute("width",A),r.setAttribute("height",e),r.style.width=A+"px",r.style.height=e+"px",setTimeout((function(){i.postMessage({action:"autoResize"},a+"/ezopen/h5/iframe")}),500)},s.prototype.startTalk=function(){console.log("执行开始对讲"),console.log(this.opt);var e=this;n.opt=this.opt,A.EZUIKit&&(A.EZUIKit.opt=this.opt);i(e.opt.apiDomain,"POST",{accessToken:e.opt.accessToken,deviceSerial:e.opt.deviceSerial,channelNo:e.opt.channelNo},0,(function(t){if(200==t.code){var i=t.data;if(i){var n=i.rtcUrl;-1===n.indexOf("ws")&&(n=n.replace("https","wss").replace("rtcgw","rtcgw-ws")),e.opt.rtcUrl=n,e.opt.ttsUrl="tts://"+i.ttsUrl;var a="talk://"+e.opt.deviceSerial+":0:"+e.opt.channelNo+":cas.ys7.com:6500";e.opt.talkLink=e.opt.ttsUrl+"/"+a,e.opt.stream=i.stream,A.startTalk()}}}))},s.prototype.stopTalk=function(){console.log("执行结束对讲"),A.stopTalk()},s.prototype.edit=function(){var A="EZUIKitPlayer-"+this.opt.id;document.getElementById(A).contentWindow.postMessage("edit",a+"/ezopen/h5/iframe")},s.prototype.btnReRender=function(A){var e="EZUIKitPlayer-"+this.opt.id;document.getElementById(e).contentWindow.postMessage({action:"btnReRender",data:A},a+"/ezopen/h5/iframe")},s.prototype.changePlayUrl=function(A){A.deviceSerial&&(this.opt.deviceSerial=A.deviceSerial),A.channelNo&&(this.opt.channelNo=A.channelNo),A.accessToken&&(this.opt.accessToken=A.accessToken);var e="EZUIKitPlayer-"+this.opt.id;document.getElementById(e).contentWindow.postMessage({action:"changePlayUrl",data:A},a+"/ezopen/h5/iframe")},s.prototype.fetchThemeData=function(){var A="EZUIKitPlayer-"+this.opt.id;document.getElementById(A).contentWindow.postMessage({action:"fetchThemeData"},a+"/ezopen/h5/iframe")},s.prototype.setThemeData=function(A,e,t){var i="EZUIKitPlayer-"+this.opt.id;document.getElementById(i).contentWindow.postMessage({action:"setThemeData",data:{accessToken:A,header:e,footer:t}},a+"/ezopen/h5/iframe")},n.EZUIKitPlayer=s,A.EZUIKitV3=n,n}));var me=EZUIKitV3,ye=function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=void 0,n=void 0,a=void 0,r=[];return function(){var s=function(A){return"function"==typeof A?A():A}(e),g=(new Date).getTime(),c=!i||g-i>s;i=g;for(var l=arguments.length,I=Array(l),d=0;d>>0)+"_",n=0;return function A(t){if(this instanceof A)throw new TypeError("Symbol is not a constructor");return new e(i+(t||"")+"_"+n++,t)}})),a("Symbol.iterator",(function(A){if(A)return A;A=Symbol("Symbol.iterator");for(var i="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),a=0;a0&&e-1 in A)}function y(A,e){return A.nodeName&&A.nodeName.toLowerCase()===e.toLowerCase()}p.fn=p.prototype={jquery:Q,constructor:p,length:0,toArray:function(){return n.call(this)},get:function(A){return null==A?n.call(this):A<0?this[A+this.length]:this[A]},pushStack:function(A){var e=p.merge(this.constructor(),A);return e.prevObject=this,e},each:function(A){return p.each(this,A)},map:function(A){return this.pushStack(p.map(this,(function(e,t){return A.call(e,t,e)})))},slice:function(){return this.pushStack(n.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(p.grep(this,(function(A,e){return(e+1)%2})))},odd:function(){return this.pushStack(p.grep(this,(function(A,e){return e%2})))},eq:function(A){var e=this.length,t=+A+(A<0?e:0);return this.pushStack(t>=0&&t+~]|"+v+")"+v+"*"),U=new RegExp(v+"|>"),J=new RegExp(M),H=new RegExp("^"+N+"$"),K={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N+"|[*])"),ATTR:new RegExp("^"+T),PSEUDO:new RegExp("^"+M),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+v+"*(even|odd|(([+-]|)(\\d*)n|)"+v+"*(?:([+-]|)"+v+"*(\\d+)|))"+v+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+v+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+v+"*((?:-\\d)?\\d*)"+v+"*\\)|)(?=[^-]|$)","i")},V=/^(?:input|select|textarea|button)$/i,O=/^h\d$/i,j=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,W=/[+~]/,Z=new RegExp("\\\\[\\da-fA-F]{1,6}"+v+"?|\\\\([^\\r\\n\\f])","g"),X=function(A,e){var t="0x"+A.slice(1)-65536;return e||(t<0?String.fromCharCode(t+65536):String.fromCharCode(t>>10|55296,1023&t|56320))},q=function(){sA()},z=IA((function(A){return!0===A.disabled&&y(A,"fieldset")}),{dir:"parentNode",next:"legend"});try{u.apply(t=n.call(R.childNodes),R.childNodes),t[R.childNodes.length].nodeType}catch(A){u={apply:function(A,e){k.apply(A,n.call(e))},call:function(A){k.apply(A,n.call(arguments,1))}}}function $(A,e,t,i){var n,a,r,o,s,c,l,h=e&&e.ownerDocument,E=e?e.nodeType:9;if(t=t||[],"string"!=typeof A||!A||1!==E&&9!==E&&11!==E)return t;if(!i&&(sA(e),e=e||g,I)){if(11!==E&&(s=j.exec(A)))if(n=s[1]){if(9===E){if(!(r=e.getElementById(n)))return t;if(r.id===n)return u.call(t,r),t}else if(h&&(r=h.getElementById(n))&&$.contains(e,r)&&r.id===n)return u.call(t,r),t}else{if(s[2])return u.apply(t,e.getElementsByTagName(A)),t;if((n=s[3])&&e.getElementsByClassName)return u.apply(t,e.getElementsByClassName(n)),t}if(!(b[A+" "]||C&&C.test(A))){if(l=A,h=e,1===E&&(U.test(A)||G.test(A))){for((h=W.test(A)&&oA(e.parentNode)||e)==e&&d.scope||((o=e.getAttribute("id"))?o=p.escapeSelector(o):e.setAttribute("id",o=B)),a=(c=cA(A)).length;a--;)c[a]=(o?"#"+o:":scope")+" "+lA(c[a]);l=c.join(",")}try{return u.apply(t,h.querySelectorAll(l)),t}catch(e){b(A,!0)}finally{o===B&&e.removeAttribute("id")}}}return EA(A.replace(w,"$1"),e,t,i)}function AA(){var A=[];return function e(t,n){return A.push(t+" ")>i.cacheLength&&delete e[A.shift()],e[t+" "]=n}}function eA(A){return A[B]=!0,A}function tA(A){var e=g.createElement("fieldset");try{return!!A(e)}catch(A){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function iA(A){return function(e){return y(e,"input")&&e.type===A}}function nA(A){return function(e){return(y(e,"input")||y(e,"button"))&&e.type===A}}function aA(A){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===A:e.disabled===A:e.isDisabled===A||e.isDisabled!==!A&&z(e)===A:e.disabled===A:"label"in e&&e.disabled===A}}function rA(A){return eA((function(e){return e=+e,eA((function(t,i){for(var n,a=A([],t.length,e),r=a.length;r--;)t[n=a[r]]&&(t[n]=!(i[n]=t[n]))}))}))}function oA(A){return A&&void 0!==A.getElementsByTagName&&A}function sA(A){var e,t=A?A.ownerDocument||A:R;return t!=g&&9===t.nodeType&&t.documentElement?(l=(g=t).documentElement,I=!p.isXMLDoc(g),h=l.matches||l.webkitMatchesSelector||l.msMatchesSelector,l.msMatchesSelector&&R!=g&&(e=g.defaultView)&&e.top!==e&&e.addEventListener("unload",q),d.getById=tA((function(A){return l.appendChild(A).id=p.expando,!g.getElementsByName||!g.getElementsByName(p.expando).length})),d.disconnectedMatch=tA((function(A){return h.call(A,"*")})),d.scope=tA((function(){return g.querySelectorAll(":scope")})),d.cssHas=tA((function(){try{return g.querySelector(":has(*,:jqfake)"),!1}catch(A){return!0}})),d.getById?(i.filter.ID=function(A){var e=A.replace(Z,X);return function(A){return A.getAttribute("id")===e}},i.find.ID=function(A,e){if(void 0!==e.getElementById&&I){var t=e.getElementById(A);return t?[t]:[]}}):(i.filter.ID=function(A){var e=A.replace(Z,X);return function(A){var t=void 0!==A.getAttributeNode&&A.getAttributeNode("id");return t&&t.value===e}},i.find.ID=function(A,e){if(void 0!==e.getElementById&&I){var t,i,n,a=e.getElementById(A);if(a){if((t=a.getAttributeNode("id"))&&t.value===A)return[a];for(n=e.getElementsByName(A),i=0;a=n[i++];)if((t=a.getAttributeNode("id"))&&t.value===A)return[a]}return[]}}),i.find.TAG=function(A,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(A):e.querySelectorAll(A)},i.find.CLASS=function(A,e){if(void 0!==e.getElementsByClassName&&I)return e.getElementsByClassName(A)},C=[],tA((function(A){var e;l.appendChild(A).innerHTML="",A.querySelectorAll("[selected]").length||C.push("\\["+v+"*(?:value|"+P+")"),A.querySelectorAll("[id~="+B+"-]").length||C.push("~="),A.querySelectorAll("a#"+B+"+*").length||C.push(".#.+[+~]"),A.querySelectorAll(":checked").length||C.push(":checked"),(e=g.createElement("input")).setAttribute("type","hidden"),A.appendChild(e).setAttribute("name","D"),l.appendChild(A).disabled=!0,2!==A.querySelectorAll(":disabled").length&&C.push(":enabled",":disabled"),(e=g.createElement("input")).setAttribute("name",""),A.appendChild(e),A.querySelectorAll("[name='']").length||C.push("\\["+v+"*name"+v+"*="+v+"*(?:''|\"\")")})),d.cssHas||C.push(":has"),C=C.length&&new RegExp(C.join("|")),F=function(A,e){if(A===e)return s=!0,0;var t=!A.compareDocumentPosition-!e.compareDocumentPosition;return t||(1&(t=(A.ownerDocument||A)==(e.ownerDocument||e)?A.compareDocumentPosition(e):1)||!d.sortDetached&&e.compareDocumentPosition(A)===t?A===g||A.ownerDocument==R&&$.contains(R,A)?-1:e===g||e.ownerDocument==R&&$.contains(R,e)?1:r?o.call(r,A)-o.call(r,e):0:4&t?-1:1)},g):g}for(e in $.matches=function(A,e){return $(A,null,null,e)},$.matchesSelector=function(A,e){if(sA(A),I&&!b[e+" "]&&(!C||!C.test(e)))try{var t=h.call(A,e);if(t||d.disconnectedMatch||A.document&&11!==A.document.nodeType)return t}catch(A){b(e,!0)}return $(e,g,null,[A]).length>0},$.contains=function(A,e){return(A.ownerDocument||A)!=g&&sA(A),p.contains(A,e)},$.attr=function(A,e){(A.ownerDocument||A)!=g&&sA(A);var t=i.attrHandle[e.toLowerCase()],n=t&&c.call(i.attrHandle,e.toLowerCase())?t(A,e,!I):void 0;return void 0!==n?n:A.getAttribute(e)},$.error=function(A){throw new Error("Syntax error, unrecognized expression: "+A)},p.uniqueSort=function(A){var e,t=[],i=0,a=0;if(s=!d.sortStable,r=!d.sortStable&&n.call(A,0),S.call(A,F),s){for(;e=A[a++];)e===A[a]&&(i=t.push(a));for(;i--;)D.call(A,t[i],1)}return r=null,A},p.fn.uniqueSort=function(){return this.pushStack(p.uniqueSort(n.apply(this)))},i=p.expr={cacheLength:50,createPseudo:eA,match:K,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(A){return A[1]=A[1].replace(Z,X),A[3]=(A[3]||A[4]||A[5]||"").replace(Z,X),"~="===A[2]&&(A[3]=" "+A[3]+" "),A.slice(0,4)},CHILD:function(A){return A[1]=A[1].toLowerCase(),"nth"===A[1].slice(0,3)?(A[3]||$.error(A[0]),A[4]=+(A[4]?A[5]+(A[6]||1):2*("even"===A[3]||"odd"===A[3])),A[5]=+(A[7]+A[8]||"odd"===A[3])):A[3]&&$.error(A[0]),A},PSEUDO:function(A){var e,t=!A[6]&&A[2];return K.CHILD.test(A[0])?null:(A[3]?A[2]=A[4]||A[5]||"":t&&J.test(t)&&(e=cA(t,!0))&&(e=t.indexOf(")",t.length-e)-t.length)&&(A[0]=A[0].slice(0,e),A[2]=t.slice(0,e)),A.slice(0,3))}},filter:{TAG:function(A){var e=A.replace(Z,X).toLowerCase();return"*"===A?function(){return!0}:function(A){return y(A,e)}},CLASS:function(A){var e=Q[A+" "];return e||(e=new RegExp("(^|"+v+")"+A+"("+v+"|$)"))&&Q(A,(function(A){return e.test("string"==typeof A.className&&A.className||void 0!==A.getAttribute&&A.getAttribute("class")||"")}))},ATTR:function(A,e,t){return function(i){var n=$.attr(i,A);return null==n?"!="===e:!e||(n+="","="===e?n===t:"!="===e?n!==t:"^="===e?t&&0===n.indexOf(t):"*="===e?t&&n.indexOf(t)>-1:"$="===e?t&&n.slice(-t.length)===t:"~="===e?(" "+n.replace(L," ")+" ").indexOf(t)>-1:"|="===e&&(n===t||n.slice(0,t.length+1)===t+"-"))}},CHILD:function(A,e,t,i,n){var a="nth"!==A.slice(0,3),r="last"!==A.slice(-4),o="of-type"===e;return 1===i&&0===n?function(A){return!!A.parentNode}:function(e,t,s){var g,c,l,I,d,C=a!==r?"nextSibling":"previousSibling",h=e.parentNode,u=o&&e.nodeName.toLowerCase(),f=!s&&!o,Q=!1;if(h){if(a){for(;C;){for(l=e;l=l[C];)if(o?y(l,u):1===l.nodeType)return!1;d=C="only"===A&&!d&&"nextSibling"}return!0}if(d=[r?h.firstChild:h.lastChild],r&&f){for(Q=(I=(g=(c=h[B]||(h[B]={}))[A]||[])[0]===E&&g[1])&&g[2],l=I&&h.childNodes[I];l=++I&&l&&l[C]||(Q=I=0)||d.pop();)if(1===l.nodeType&&++Q&&l===e){c[A]=[E,I,Q];break}}else if(f&&(Q=I=(g=(c=e[B]||(e[B]={}))[A]||[])[0]===E&&g[1]),!1===Q)for(;(l=++I&&l&&l[C]||(Q=I=0)||d.pop())&&(!(o?y(l,u):1===l.nodeType)||!++Q||(f&&((c=l[B]||(l[B]={}))[A]=[E,Q]),l!==e)););return(Q-=n)===i||Q%i==0&&Q/i>=0}}},PSEUDO:function(A,e){var t,n=i.pseudos[A]||i.setFilters[A.toLowerCase()]||$.error("unsupported pseudo: "+A);return n[B]?n(e):n.length>1?(t=[A,A,"",e],i.setFilters.hasOwnProperty(A.toLowerCase())?eA((function(A,t){for(var i,a=n(A,e),r=a.length;r--;)A[i=o.call(A,a[r])]=!(t[i]=a[r])})):function(A){return n(A,0,t)}):n}},pseudos:{not:eA((function(A){var e=[],t=[],i=BA(A.replace(w,"$1"));return i[B]?eA((function(A,e,t,n){for(var a,r=i(A,null,n,[]),o=A.length;o--;)(a=r[o])&&(A[o]=!(e[o]=a))})):function(A,n,a){return e[0]=A,i(e,null,a,t),e[0]=null,!t.pop()}})),has:eA((function(A){return function(e){return $(A,e).length>0}})),contains:eA((function(A){return A=A.replace(Z,X),function(e){return(e.textContent||p.text(e)).indexOf(A)>-1}})),lang:eA((function(A){return H.test(A||"")||$.error("unsupported lang: "+A),A=A.replace(Z,X).toLowerCase(),function(e){var t;do{if(t=I?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===A||0===t.indexOf(A+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var t=A.location&&A.location.hash;return t&&t.slice(1)===e.id},root:function(A){return A===l},focus:function(A){return A===function(){try{return g.activeElement}catch(A){}}()&&g.hasFocus()&&!!(A.type||A.href||~A.tabIndex)},enabled:aA(!1),disabled:aA(!0),checked:function(A){return y(A,"input")&&!!A.checked||y(A,"option")&&!!A.selected},selected:function(A){return A.parentNode&&A.parentNode.selectedIndex,!0===A.selected},empty:function(A){for(A=A.firstChild;A;A=A.nextSibling)if(A.nodeType<6)return!1;return!0},parent:function(A){return!i.pseudos.empty(A)},header:function(A){return O.test(A.nodeName)},input:function(A){return V.test(A.nodeName)},button:function(A){return y(A,"input")&&"button"===A.type||y(A,"button")},text:function(A){var e;return y(A,"input")&&"text"===A.type&&(null==(e=A.getAttribute("type"))||"text"===e.toLowerCase())},first:rA((function(){return[0]})),last:rA((function(A,e){return[e-1]})),eq:rA((function(A,e,t){return[t<0?t+e:t]})),even:rA((function(A,e){for(var t=0;te?e:t;--i>=0;)A.push(i);return A})),gt:rA((function(A,e,t){for(var i=t<0?t+e:t;++i1?function(e,t,i){for(var n=A.length;n--;)if(!A[n](e,t,i))return!1;return!0}:A[0]}function CA(A,e,t,i,n){for(var a,r=[],o=0,s=A.length,g=null!=e;o-1&&(a[c]=!(r[c]=I))}}else d=CA(d===r?d.splice(B,d.length):d),n?n(null,r,d,g):u.apply(r,d)}))}function uA(A){for(var e,t,n,r=A.length,s=i.relative[A[0].type],g=s||i.relative[" "],c=s?1:0,l=IA((function(A){return A===e}),g,!0),I=IA((function(A){return o.call(e,A)>-1}),g,!0),d=[function(A,t,i){var n=!s&&(i||t!=a)||((e=t).nodeType?l(A,t,i):I(A,t,i));return e=null,n}];c1&&dA(d),c>1&&lA(A.slice(0,c-1).concat({value:" "===A[c-2].type?"*":""})).replace(w,"$1"),t,c0,n=A.length>0,r=function(r,o,s,c,l){var d,C,h,B=0,f="0",Q=r&&[],x=[],m=a,y=r||n&&i.find.TAG("*",l),S=E+=null==m?1:Math.random()||.1,D=y.length;for(l&&(a=o==g||o||l);f!==D&&null!=(d=y[f]);f++){if(n&&d){for(C=0,o||d.ownerDocument==g||(sA(d),s=!I);h=A[C++];)if(h(d,o||g,s)){u.call(c,d);break}l&&(E=S)}t&&((d=!h&&d)&&B--,r&&Q.push(d))}if(B+=f,t&&f!==B){for(C=0;h=e[C++];)h(Q,x,o,s);if(r){if(B>0)for(;f--;)Q[f]||x[f]||(x[f]=_.call(c));x=CA(x)}u.apply(c,x),l&&!r&&x.length>0&&B+e.length>1&&p.uniqueSort(c)}return l&&(E=S,a=m),Q};return t?eA(r):r}(r,n)),o.selector=A}return o}function EA(A,e,t,n){var a,r,o,s,g,c="function"==typeof A&&A,l=!n&&cA(A=c.selector||A);if(t=t||[],1===l.length){if((r=l[0]=l[0].slice(0)).length>2&&"ID"===(o=r[0]).type&&9===e.nodeType&&I&&i.relative[r[1].type]){if(!(e=(i.find.ID(o.matches[0].replace(Z,X),e)||[])[0]))return t;c&&(e=e.parentNode),A=A.slice(r.shift().value.length)}for(a=K.needsContext.test(A)?0:r.length;a--&&(o=r[a],!i.relative[s=o.type]);)if((g=i.find[s])&&(n=g(o.matches[0].replace(Z,X),W.test(r[0].type)&&oA(e.parentNode)||e))){if(r.splice(a,1),!(A=n.length&&lA(r)))return u.apply(t,n),t;break}}return(c||BA(A,l))(n,e,!I,t,!e||W.test(A)&&oA(e.parentNode)||e),t}gA.prototype=i.filters=i.pseudos,i.setFilters=new gA,d.sortStable=B.split("").sort(F).join("")===B,sA(),d.sortDetached=tA((function(A){return 1&A.compareDocumentPosition(g.createElement("fieldset"))})),p.find=$,p.expr[":"]=p.expr.pseudos,p.unique=p.uniqueSort,$.compile=BA,$.select=EA,$.setDocument=sA,$.tokenize=cA,$.escape=p.escapeSelector,$.getText=p.text,$.isXML=p.isXMLDoc,$.selectors=p.expr,$.support=p.support,$.uniqueSort=p.uniqueSort}();var P=function(A,e,t){for(var i=[],n=void 0!==t;(A=A[e])&&9!==A.nodeType;)if(1===A.nodeType){if(n&&p(A).is(t))break;i.push(A)}return i},N=function(A,e){for(var t=[];A;A=A.nextSibling)1===A.nodeType&&A!==e&&t.push(A);return t},T=p.expr.match.needsContext,M=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function L(A,e,t){return C(e)?p.grep(A,(function(A,i){return!!e.call(A,i,A)!==t})):e.nodeType?p.grep(A,(function(A){return A===e!==t})):"string"!=typeof e?p.grep(A,(function(A){return o.call(e,A)>-1!==t})):p.filter(e,A,t)}p.filter=function(A,e,t){var i=e[0];return t&&(A=":not("+A+")"),1===e.length&&1===i.nodeType?p.find.matchesSelector(i,A)?[i]:[]:p.find.matches(A,p.grep(e,(function(A){return 1===A.nodeType})))},p.fn.extend({find:function(A){var e,t,i=this.length,n=this;if("string"!=typeof A)return this.pushStack(p(A).filter((function(){for(e=0;e1?p.uniqueSort(t):t},filter:function(A){return this.pushStack(L(this,A||[],!1))},not:function(A){return this.pushStack(L(this,A||[],!0))},is:function(A){return!!L(this,"string"==typeof A&&T.test(A)?p(A):A||[],!1).length}});var Y,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(p.fn.init=function(A,e,t){var i,n;if(!A)return this;if(t=t||Y,"string"==typeof A){if(!(i="<"===A[0]&&">"===A[A.length-1]&&A.length>=3?[null,A,null]:G.exec(A))||!i[1]&&e)return!e||e.jquery?(e||t).find(A):this.constructor(e).find(A);if(i[1]){if(e=e instanceof p?e[0]:e,p.merge(this,p.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:u,!0)),M.test(i[1])&&p.isPlainObject(e))for(i in e)C(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(n=u.getElementById(i[2]))&&(this[0]=n,this.length=1),this}return A.nodeType?(this[0]=A,this.length=1,this):C(A)?void 0!==t.ready?t.ready(A):A(p):p.makeArray(A,this)}).prototype=p.fn,Y=p(u);var U=/^(?:parents|prev(?:Until|All))/,J={children:!0,contents:!0,next:!0,prev:!0};function H(A,e){for(;(A=A[e])&&1!==A.nodeType;);return A}p.fn.extend({has:function(A){var e=p(A,this),t=e.length;return this.filter((function(){for(var A=0;A-1:1===t.nodeType&&p.find.matchesSelector(t,A))){a.push(t);break}return this.pushStack(a.length>1?p.uniqueSort(a):a)},index:function(A){return A?"string"==typeof A?o.call(p(A),this[0]):o.call(this,A.jquery?A[0]:A):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(A,e){return this.pushStack(p.uniqueSort(p.merge(this.get(),p(A,e))))},addBack:function(A){return this.add(null==A?this.prevObject:this.prevObject.filter(A))}}),p.each({parent:function(A){var e=A.parentNode;return e&&11!==e.nodeType?e:null},parents:function(A){return P(A,"parentNode")},parentsUntil:function(A,e,t){return P(A,"parentNode",t)},next:function(A){return H(A,"nextSibling")},prev:function(A){return H(A,"previousSibling")},nextAll:function(A){return P(A,"nextSibling")},prevAll:function(A){return P(A,"previousSibling")},nextUntil:function(A,e,t){return P(A,"nextSibling",t)},prevUntil:function(A,e,t){return P(A,"previousSibling",t)},siblings:function(A){return N((A.parentNode||{}).firstChild,A)},children:function(A){return N(A.firstChild)},contents:function(A){return null!=A.contentDocument&&i(A.contentDocument)?A.contentDocument:(y(A,"template")&&(A=A.content||A),p.merge([],A.childNodes))}},(function(A,e){p.fn[A]=function(t,i){var n=p.map(this,e,t);return"Until"!==A.slice(-5)&&(i=t),i&&"string"==typeof i&&(n=p.filter(i,n)),this.length>1&&(J[A]||p.uniqueSort(n),U.test(A)&&n.reverse()),this.pushStack(n)}}));var K=/[^\x20\t\r\n\f]+/g;function V(A){return A}function O(A){throw A}function j(A,e,t,i){var n;try{A&&C(n=A.promise)?n.call(A).done(e).fail(t):A&&C(n=A.then)?n.call(A,e,t):e.apply(void 0,[A].slice(i))}catch(A){t.apply(void 0,[A])}}p.Callbacks=function(A){A="string"==typeof A?function(A){var e={};return p.each(A.match(K)||[],(function(A,t){e[t]=!0})),e}(A):p.extend({},A);var e,t,i,n,a=[],r=[],o=-1,s=function(){for(n=n||A.once,i=e=!0;r.length;o=-1)for(t=r.shift();++o-1;)a.splice(t,1),t<=o&&o--})),this},has:function(A){return A?p.inArray(A,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return n=r=[],a=t="",this},disabled:function(){return!a},lock:function(){return n=r=[],t||e||(a=t=""),this},locked:function(){return!!n},fireWith:function(A,t){return n||(t=[A,(t=t||[]).slice?t.slice():t],r.push(t),e||s()),this},fire:function(){return g.fireWith(this,arguments),this},fired:function(){return!!i}};return g},p.extend({Deferred:function(e){var t=[["notify","progress",p.Callbacks("memory"),p.Callbacks("memory"),2],["resolve","done",p.Callbacks("once memory"),p.Callbacks("once memory"),0,"resolved"],["reject","fail",p.Callbacks("once memory"),p.Callbacks("once memory"),1,"rejected"]],i="pending",n={state:function(){return i},always:function(){return a.done(arguments).fail(arguments),this},catch:function(A){return n.then(null,A)},pipe:function(){var A=arguments;return p.Deferred((function(e){p.each(t,(function(t,i){var n=C(A[i[4]])&&A[i[4]];a[i[1]]((function(){var A=n&&n.apply(this,arguments);A&&C(A.promise)?A.promise().progress(e.notify).done(e.resolve).fail(e.reject):e[i[0]+"With"](this,n?[A]:arguments)}))})),A=null})).promise()},then:function(e,i,n){var a=0;function r(e,t,i,n){return function(){var o=this,s=arguments,g=function(){var A,g;if(!(e=a&&(i!==O&&(o=void 0,s=[A]),t.rejectWith(o,s))}};e?c():(p.Deferred.getErrorHook?c.error=p.Deferred.getErrorHook():p.Deferred.getStackHook&&(c.error=p.Deferred.getStackHook()),A.setTimeout(c))}}return p.Deferred((function(A){t[0][3].add(r(0,A,C(n)?n:V,A.notifyWith)),t[1][3].add(r(0,A,C(e)?e:V)),t[2][3].add(r(0,A,C(i)?i:O))})).promise()},promise:function(A){return null!=A?p.extend(A,n):n}},a={};return p.each(t,(function(A,e){var r=e[2],o=e[5];n[e[1]]=r.add,o&&r.add((function(){i=o}),t[3-A][2].disable,t[3-A][3].disable,t[0][2].lock,t[0][3].lock),r.add(e[3].fire),a[e[0]]=function(){return a[e[0]+"With"](this===a?void 0:this,arguments),this},a[e[0]+"With"]=r.fireWith})),n.promise(a),e&&e.call(a,a),a},when:function(A){var e=arguments.length,t=e,i=Array(t),a=n.call(arguments),r=p.Deferred(),o=function(A){return function(t){i[A]=this,a[A]=arguments.length>1?n.call(arguments):t,--e||r.resolveWith(i,a)}};if(e<=1&&(j(A,r.done(o(t)).resolve,r.reject,!e),"pending"===r.state()||C(a[t]&&a[t].then)))return r.then();for(;t--;)j(a[t],o(t),r.reject);return r.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;p.Deferred.exceptionHook=function(e,t){A.console&&A.console.warn&&e&&W.test(e.name)&&A.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},p.readyException=function(e){A.setTimeout((function(){throw e}))};var Z=p.Deferred();function X(){u.removeEventListener("DOMContentLoaded",X),A.removeEventListener("load",X),p.ready()}p.fn.ready=function(A){return Z.then(A).catch((function(A){p.readyException(A)})),this},p.extend({isReady:!1,readyWait:1,ready:function(A){(!0===A?--p.readyWait:p.isReady)||(p.isReady=!0,!0!==A&&--p.readyWait>0||Z.resolveWith(u,[p]))}}),p.ready.then=Z.then,"complete"===u.readyState||"loading"!==u.readyState&&!u.documentElement.doScroll?A.setTimeout(p.ready):(u.addEventListener("DOMContentLoaded",X),A.addEventListener("load",X));var q=function(A,e,t,i,n,a,r){var o=0,s=A.length,g=null==t;if("object"===f(t))for(o in n=!0,t)q(A,e,o,t[o],!0,a,r);else if(void 0!==i&&(n=!0,C(i)||(r=!0),g&&(r?(e.call(A,i),e=null):(g=e,e=function(A,e,t){return g.call(p(A),t)})),e))for(;o1,null,!0)},removeData:function(A){return this.each((function(){aA.remove(this,A)}))}}),p.extend({queue:function(A,e,t){var i;if(A)return e=(e||"fx")+"queue",i=nA.get(A,e),t&&(!i||Array.isArray(t)?i=nA.access(A,e,p.makeArray(t)):i.push(t)),i||[]},dequeue:function(A,e){e=e||"fx";var t=p.queue(A,e),i=t.length,n=t.shift(),a=p._queueHooks(A,e);"inprogress"===n&&(n=t.shift(),i--),n&&("fx"===e&&t.unshift("inprogress"),delete a.stop,n.call(A,(function(){p.dequeue(A,e)}),a)),!i&&a&&a.empty.fire()},_queueHooks:function(A,e){var t=e+"queueHooks";return nA.get(A,t)||nA.access(A,t,{empty:p.Callbacks("once memory").add((function(){nA.remove(A,[e+"queue",t])}))})}}),p.fn.extend({queue:function(A,e){var t=2;return"string"!=typeof A&&(e=A,A="fx",t--),arguments.length\x20\t\r\n\f]*)/i,yA=/^$|^module$|\/(?:java|ecma)script/i;QA=u.createDocumentFragment().appendChild(u.createElement("div")),(xA=u.createElement("input")).setAttribute("type","radio"),xA.setAttribute("checked","checked"),xA.setAttribute("name","t"),QA.appendChild(xA),d.checkClone=QA.cloneNode(!0).cloneNode(!0).lastChild.checked,QA.innerHTML="",d.noCloneChecked=!!QA.cloneNode(!0).lastChild.defaultValue,QA.innerHTML="",d.option=!!QA.lastChild;var _A={thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function SA(A,e){var t;return t=void 0!==A.getElementsByTagName?A.getElementsByTagName(e||"*"):void 0!==A.querySelectorAll?A.querySelectorAll(e||"*"):[],void 0===e||e&&y(A,e)?p.merge([A],t):t}function DA(A,e){for(var t=0,i=A.length;t",""]);var vA=/<|&#?\w+;/;function wA(A,e,t,i,n){for(var a,r,o,s,g,c,l=e.createDocumentFragment(),I=[],d=0,C=A.length;d-1)n&&n.push(a);else if(g=dA(a),r=SA(l.appendChild(a),"script"),g&&DA(r),t)for(c=0;a=r[c++];)yA.test(a.type||"")&&t.push(a);return l}var bA=/^([^.]*)(?:\.(.+)|)/;function FA(){return!0}function RA(){return!1}function kA(A,e,t,i,n,a){var r,o;if("object"==typeof e){for(o in"string"!=typeof t&&(i=i||t,t=void 0),e)kA(A,o,t,i,e[o],a);return A}if(null==i&&null==n?(n=t,i=t=void 0):null==n&&("string"==typeof t?(n=i,i=void 0):(n=i,i=t,t=void 0)),!1===n)n=RA;else if(!n)return A;return 1===a&&(r=n,n=function(A){return p().off(A),r.apply(this,arguments)},n.guid=r.guid||(r.guid=p.guid++)),A.each((function(){p.event.add(this,e,n,i,t)}))}function PA(A,e,t){t?(nA.set(A,e,!1),p.event.add(A,e,{namespace:!1,handler:function(A){var t,i=nA.get(this,e);if(1&A.isTrigger&&this[e]){if(i)(p.event.special[e]||{}).delegateType&&A.stopPropagation();else if(i=n.call(arguments),nA.set(this,e,i),this[e](),t=nA.get(this,e),nA.set(this,e,!1),i!==t)return A.stopImmediatePropagation(),A.preventDefault(),t}else i&&(nA.set(this,e,p.event.trigger(i[0],i.slice(1),this)),A.stopPropagation(),A.isImmediatePropagationStopped=FA)}})):void 0===nA.get(A,e)&&p.event.add(A,e,FA)}p.event={global:{},add:function(A,e,t,i,n){var a,r,o,s,g,c,l,I,d,C,h,u=nA.get(A);if(tA(A))for(t.handler&&(t=(a=t).handler,n=a.selector),n&&p.find.matchesSelector(IA,n),t.guid||(t.guid=p.guid++),(s=u.events)||(s=u.events=Object.create(null)),(r=u.handle)||(r=u.handle=function(e){return void 0!==p&&p.event.triggered!==e.type?p.event.dispatch.apply(A,arguments):void 0}),g=(e=(e||"").match(K)||[""]).length;g--;)d=h=(o=bA.exec(e[g])||[])[1],C=(o[2]||"").split(".").sort(),d&&(l=p.event.special[d]||{},d=(n?l.delegateType:l.bindType)||d,l=p.event.special[d]||{},c=p.extend({type:d,origType:h,data:i,handler:t,guid:t.guid,selector:n,needsContext:n&&p.expr.match.needsContext.test(n),namespace:C.join(".")},a),(I=s[d])||((I=s[d]=[]).delegateCount=0,l.setup&&!1!==l.setup.call(A,i,C,r)||A.addEventListener&&A.addEventListener(d,r)),l.add&&(l.add.call(A,c),c.handler.guid||(c.handler.guid=t.guid)),n?I.splice(I.delegateCount++,0,c):I.push(c),p.event.global[d]=!0)},remove:function(A,e,t,i,n){var a,r,o,s,g,c,l,I,d,C,h,u=nA.hasData(A)&&nA.get(A);if(u&&(s=u.events)){for(g=(e=(e||"").match(K)||[""]).length;g--;)if(d=h=(o=bA.exec(e[g])||[])[1],C=(o[2]||"").split(".").sort(),d){for(l=p.event.special[d]||{},I=s[d=(i?l.delegateType:l.bindType)||d]||[],o=o[2]&&new RegExp("(^|\\.)"+C.join("\\.(?:.*\\.|)")+"(\\.|$)"),r=a=I.length;a--;)c=I[a],!n&&h!==c.origType||t&&t.guid!==c.guid||o&&!o.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(I.splice(a,1),c.selector&&I.delegateCount--,l.remove&&l.remove.call(A,c));r&&!I.length&&(l.teardown&&!1!==l.teardown.call(A,C,u.handle)||p.removeEvent(A,d,u.handle),delete s[d])}else for(d in s)p.event.remove(A,d+e[g],t,i,!0);p.isEmptyObject(s)&&nA.remove(A,"handle events")}},dispatch:function(A){var e,t,i,n,a,r,o=new Array(arguments.length),s=p.event.fix(A),g=(nA.get(this,"events")||Object.create(null))[s.type]||[],c=p.event.special[s.type]||{};for(o[0]=s,e=1;e=1))for(;g!==this;g=g.parentNode||this)if(1===g.nodeType&&("click"!==A.type||!0!==g.disabled)){for(a=[],r={},t=0;t-1:p.find(n,this,null,[g]).length),r[n]&&a.push(i);a.length&&o.push({elem:g,handlers:a})}return g=this,s\s*$/g;function LA(A,e){return y(A,"table")&&y(11!==e.nodeType?e:e.firstChild,"tr")&&p(A).children("tbody")[0]||A}function YA(A){return A.type=(null!==A.getAttribute("type"))+"/"+A.type,A}function GA(A){return"true/"===(A.type||"").slice(0,5)?A.type=A.type.slice(5):A.removeAttribute("type"),A}function UA(A,e){var t,i,n,a,r,o;if(1===e.nodeType){if(nA.hasData(A)&&(o=nA.get(A).events))for(n in nA.remove(e,"handle events"),o)for(t=0,i=o[n].length;t1&&"string"==typeof u&&!d.checkClone&&TA.test(u))return A.each((function(n){var a=A.eq(n);B&&(e[0]=u.call(this,n,a.html())),HA(a,e,t,i)}));if(I&&(r=(n=wA(e,A[0].ownerDocument,!1,A,i)).firstChild,1===n.childNodes.length&&(n=r),r||i)){for(s=(o=p.map(SA(n,"script"),YA)).length;l0&&DA(r,!s&&SA(A,"script")),o},cleanData:function(A){for(var e,t,i,n=p.event.special,a=0;void 0!==(t=A[a]);a++)if(tA(t)){if(e=t[nA.expando]){if(e.events)for(i in e.events)n[i]?p.event.remove(t,i):p.removeEvent(t,i,e.handle);t[nA.expando]=void 0}t[aA.expando]&&(t[aA.expando]=void 0)}}}),p.fn.extend({detach:function(A){return KA(this,A,!0)},remove:function(A){return KA(this,A)},text:function(A){return q(this,(function(A){return void 0===A?p.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=A)}))}),null,A,arguments.length)},append:function(){return HA(this,arguments,(function(A){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||LA(this,A).appendChild(A)}))},prepend:function(){return HA(this,arguments,(function(A){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=LA(this,A);e.insertBefore(A,e.firstChild)}}))},before:function(){return HA(this,arguments,(function(A){this.parentNode&&this.parentNode.insertBefore(A,this)}))},after:function(){return HA(this,arguments,(function(A){this.parentNode&&this.parentNode.insertBefore(A,this.nextSibling)}))},empty:function(){for(var A,e=0;null!=(A=this[e]);e++)1===A.nodeType&&(p.cleanData(SA(A,!1)),A.textContent="");return this},clone:function(A,e){return A=null!=A&&A,e=null==e?A:e,this.map((function(){return p.clone(this,A,e)}))},html:function(A){return q(this,(function(A){var e=this[0]||{},t=0,i=this.length;if(void 0===A&&1===e.nodeType)return e.innerHTML;if("string"==typeof A&&!NA.test(A)&&!_A[(mA.exec(A)||["",""])[1].toLowerCase()]){A=p.htmlPrefilter(A);try{for(;t=0&&(s+=Math.max(0,Math.ceil(A["offset"+e[0].toUpperCase()+e.slice(1)]-a-s-o-.5))||0),s+g}function oe(A,e,t){var i=jA(A),n=(!d.boxSizingReliable()||t)&&"border-box"===p.css(A,"boxSizing",!1,i),a=n,r=XA(A,e,i),o="offset"+e[0].toUpperCase()+e.slice(1);if(VA.test(r)){if(!t)return r;r="auto"}return(!d.boxSizingReliable()&&n||!d.reliableTrDimensions()&&y(A,"tr")||"auto"===r||!parseFloat(r)&&"inline"===p.css(A,"display",!1,i))&&A.getClientRects().length&&(n="border-box"===p.css(A,"boxSizing",!1,i),(a=o in A)&&(r=A[o])),(r=parseFloat(r)||0)+re(A,e,t||(n?"border":"content"),a,i,r)+"px"}function se(A,e,t,i,n){return new se.prototype.init(A,e,t,i,n)}p.extend({cssHooks:{opacity:{get:function(A,e){if(e){var t=XA(A,"opacity");return""===t?"1":t}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(A,e,t,i){if(A&&3!==A.nodeType&&8!==A.nodeType&&A.style){var n,a,r,o=eA(e),s=OA.test(e),g=A.style;if(s||(e=ee(o)),r=p.cssHooks[e]||p.cssHooks[o],void 0===t)return r&&"get"in r&&void 0!==(n=r.get(A,!1,i))?n:g[e];"string"===(a=typeof t)&&(n=cA.exec(t))&&n[1]&&(t=uA(A,e,n),a="number"),null!=t&&t==t&&("number"!==a||s||(t+=n&&n[3]||(p.cssNumber[o]?"":"px")),d.clearCloneStyle||""!==t||0!==e.indexOf("background")||(g[e]="inherit"),r&&"set"in r&&void 0===(t=r.set(A,t,i))||(s?g.setProperty(e,t):g[e]=t))}},css:function(A,e,t,i){var n,a,r,o=eA(e);return OA.test(e)||(e=ee(o)),(r=p.cssHooks[e]||p.cssHooks[o])&&"get"in r&&(n=r.get(A,!0,t)),void 0===n&&(n=XA(A,e,i)),"normal"===n&&e in ne&&(n=ne[e]),""===t||t?(a=parseFloat(n),!0===t||isFinite(a)?a||0:n):n}}),p.each(["height","width"],(function(A,e){p.cssHooks[e]={get:function(A,t,i){if(t)return!te.test(p.css(A,"display"))||A.getClientRects().length&&A.getBoundingClientRect().width?oe(A,e,i):WA(A,ie,(function(){return oe(A,e,i)}))},set:function(A,t,i){var n,a=jA(A),r=!d.scrollboxSize()&&"absolute"===a.position,o=(r||i)&&"border-box"===p.css(A,"boxSizing",!1,a),s=i?re(A,e,i,o,a):0;return o&&r&&(s-=Math.ceil(A["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(a[e])-re(A,e,"border",!1,a)-.5)),s&&(n=cA.exec(t))&&"px"!==(n[3]||"px")&&(A.style[e]=t,t=p.css(A,e)),ae(0,t,s)}}})),p.cssHooks.marginLeft=qA(d.reliableMarginLeft,(function(A,e){if(e)return(parseFloat(XA(A,"marginLeft"))||A.getBoundingClientRect().left-WA(A,{marginLeft:0},(function(){return A.getBoundingClientRect().left})))+"px"})),p.each({margin:"",padding:"",border:"Width"},(function(A,e){p.cssHooks[A+e]={expand:function(t){for(var i=0,n={},a="string"==typeof t?t.split(" "):[t];i<4;i++)n[A+lA[i]+e]=a[i]||a[i-2]||a[0];return n}},"margin"!==A&&(p.cssHooks[A+e].set=ae)})),p.fn.extend({css:function(A,e){return q(this,(function(A,e,t){var i,n,a={},r=0;if(Array.isArray(e)){for(i=jA(A),n=e.length;r1)}}),p.Tween=se,se.prototype={constructor:se,init:function(A,e,t,i,n,a){this.elem=A,this.prop=t,this.easing=n||p.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=a||(p.cssNumber[t]?"":"px")},cur:function(){var A=se.propHooks[this.prop];return A&&A.get?A.get(this):se.propHooks._default.get(this)},run:function(A){var e,t=se.propHooks[this.prop];return this.options.duration?this.pos=e=p.easing[this.easing](A,this.options.duration*A,0,1,this.options.duration):this.pos=e=A,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),t&&t.set?t.set(this):se.propHooks._default.set(this),this}},se.prototype.init.prototype=se.prototype,se.propHooks={_default:{get:function(A){var e;return 1!==A.elem.nodeType||null!=A.elem[A.prop]&&null==A.elem.style[A.prop]?A.elem[A.prop]:(e=p.css(A.elem,A.prop,""))&&"auto"!==e?e:0},set:function(A){p.fx.step[A.prop]?p.fx.step[A.prop](A):1!==A.elem.nodeType||!p.cssHooks[A.prop]&&null==A.elem.style[ee(A.prop)]?A.elem[A.prop]=A.now:p.style(A.elem,A.prop,A.now+A.unit)}}},se.propHooks.scrollTop=se.propHooks.scrollLeft={set:function(A){A.elem.nodeType&&A.elem.parentNode&&(A.elem[A.prop]=A.now)}},p.easing={linear:function(A){return A},swing:function(A){return.5-Math.cos(A*Math.PI)/2},_default:"swing"},p.fx=se.prototype.init,p.fx.step={};var ge,ce,le=/^(?:toggle|show|hide)$/,Ie=/queueHooks$/;function de(){ce&&(!1===u.hidden&&A.requestAnimationFrame?A.requestAnimationFrame(de):A.setTimeout(de,p.fx.interval),p.fx.tick())}function Ce(){return A.setTimeout((function(){ge=void 0})),ge=Date.now()}function he(A,e){var t,i=0,n={height:A};for(e=e?1:0;i<4;i+=2-e)n["margin"+(t=lA[i])]=n["padding"+t]=A;return e&&(n.opacity=n.width=A),n}function ue(A,e,t){for(var i,n=(Be.tweeners[e]||[]).concat(Be.tweeners["*"]),a=0,r=n.length;a1)},removeAttr:function(A){return this.each((function(){p.removeAttr(this,A)}))}}),p.extend({attr:function(A,e,t){var i,n,a=A.nodeType;if(3!==a&&8!==a&&2!==a)return void 0===A.getAttribute?p.prop(A,e,t):(1===a&&p.isXMLDoc(A)||(n=p.attrHooks[e.toLowerCase()]||(p.expr.match.bool.test(e)?Ee:void 0)),void 0!==t?null===t?void p.removeAttr(A,e):n&&"set"in n&&void 0!==(i=n.set(A,t,e))?i:(A.setAttribute(e,t+""),t):n&&"get"in n&&null!==(i=n.get(A,e))?i:null==(i=p.find.attr(A,e))?void 0:i)},attrHooks:{type:{set:function(A,e){if(!d.radioValue&&"radio"===e&&y(A,"input")){var t=A.value;return A.setAttribute("type",e),t&&(A.value=t),e}}}},removeAttr:function(A,e){var t,i=0,n=e&&e.match(K);if(n&&1===A.nodeType)for(;t=n[i++];)A.removeAttribute(t)}}),Ee={set:function(A,e,t){return!1===e?p.removeAttr(A,t):A.setAttribute(t,t),t}},p.each(p.expr.match.bool.source.match(/\w+/g),(function(A,e){var t=fe[e]||p.find.attr;fe[e]=function(A,e,i){var n,a,r=e.toLowerCase();return i||(a=fe[r],fe[r]=n,n=null!=t(A,e,i)?r:null,fe[r]=a),n}}));var Qe=/^(?:input|select|textarea|button)$/i,xe=/^(?:a|area)$/i;function pe(A){return(A.match(K)||[]).join(" ")}function me(A){return A.getAttribute&&A.getAttribute("class")||""}function ye(A){return Array.isArray(A)?A:"string"==typeof A&&A.match(K)||[]}p.fn.extend({prop:function(A,e){return q(this,p.prop,A,e,arguments.length>1)},removeProp:function(A){return this.each((function(){delete this[p.propFix[A]||A]}))}}),p.extend({prop:function(A,e,t){var i,n,a=A.nodeType;if(3!==a&&8!==a&&2!==a)return 1===a&&p.isXMLDoc(A)||(e=p.propFix[e]||e,n=p.propHooks[e]),void 0!==t?n&&"set"in n&&void 0!==(i=n.set(A,t,e))?i:A[e]=t:n&&"get"in n&&null!==(i=n.get(A,e))?i:A[e]},propHooks:{tabIndex:{get:function(A){var e=p.find.attr(A,"tabindex");return e?parseInt(e,10):Qe.test(A.nodeName)||xe.test(A.nodeName)&&A.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),d.optSelected||(p.propHooks.selected={get:function(A){var e=A.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(A){var e=A.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),p.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){p.propFix[this.toLowerCase()]=this})),p.fn.extend({addClass:function(A){var e,t,i,n,a,r;return C(A)?this.each((function(e){p(this).addClass(A.call(this,e,me(this)))})):(e=ye(A)).length?this.each((function(){if(i=me(this),t=1===this.nodeType&&" "+pe(i)+" "){for(a=0;a-1;)t=t.replace(" "+n+" "," ");r=pe(t),i!==r&&this.setAttribute("class",r)}})):this:this.attr("class","")},toggleClass:function(A,e){var t,i,n,a,r=typeof A,o="string"===r||Array.isArray(A);return C(A)?this.each((function(t){p(this).toggleClass(A.call(this,t,me(this),e),e)})):"boolean"==typeof e&&o?e?this.addClass(A):this.removeClass(A):(t=ye(A),this.each((function(){if(o)for(a=p(this),n=0;n-1)return!0;return!1}});var _e=/\r/g;p.fn.extend({val:function(A){var e,t,i,n=this[0];return arguments.length?(i=C(A),this.each((function(t){var n;1===this.nodeType&&(null==(n=i?A.call(this,t,p(this).val()):A)?n="":"number"==typeof n?n+="":Array.isArray(n)&&(n=p.map(n,(function(A){return null==A?"":A+""}))),(e=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,n,"value")||(this.value=n))}))):n?(e=p.valHooks[n.type]||p.valHooks[n.nodeName.toLowerCase()])&&"get"in e&&void 0!==(t=e.get(n,"value"))?t:"string"==typeof(t=n.value)?t.replace(_e,""):null==t?"":t:void 0}}),p.extend({valHooks:{option:{get:function(A){var e=p.find.attr(A,"value");return null!=e?e:pe(p.text(A))}},select:{get:function(A){var e,t,i,n=A.options,a=A.selectedIndex,r="select-one"===A.type,o=r?null:[],s=r?a+1:n.length;for(i=a<0?s:r?a:0;i-1)&&(t=!0);return t||(A.selectedIndex=-1),a}}}}),p.each(["radio","checkbox"],(function(){p.valHooks[this]={set:function(A,e){if(Array.isArray(e))return A.checked=p.inArray(p(A).val(),e)>-1}},d.checkOn||(p.valHooks[this].get=function(A){return null===A.getAttribute("value")?"on":A.value})}));var Se=A.location,De={guid:Date.now()},ve=/\?/;p.parseXML=function(e){var t,i;if(!e||"string"!=typeof e)return null;try{t=(new A.DOMParser).parseFromString(e,"text/xml")}catch(A){}return i=t&&t.getElementsByTagName("parsererror")[0],t&&!i||p.error("Invalid XML: "+(i?p.map(i.childNodes,(function(A){return A.textContent})).join("\n"):e)),t};var we=/^(?:focusinfocus|focusoutblur)$/,be=function(A){A.stopPropagation()};p.extend(p.event,{trigger:function(e,t,i,n){var a,r,o,s,g,l,I,d,B=[i||u],E=c.call(e,"type")?e.type:e,f=c.call(e,"namespace")?e.namespace.split("."):[];if(r=d=o=i=i||u,3!==i.nodeType&&8!==i.nodeType&&!we.test(E+p.event.triggered)&&(E.indexOf(".")>-1&&(f=E.split("."),E=f.shift(),f.sort()),g=E.indexOf(":")<0&&"on"+E,(e=e[p.expando]?e:new p.Event(E,"object"==typeof e&&e)).isTrigger=n?2:3,e.namespace=f.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=i),t=null==t?[e]:p.makeArray(t,[e]),I=p.event.special[E]||{},n||!I.trigger||!1!==I.trigger.apply(i,t))){if(!n&&!I.noBubble&&!h(i)){for(s=I.delegateType||E,we.test(s+E)||(r=r.parentNode);r;r=r.parentNode)B.push(r),o=r;o===(i.ownerDocument||u)&&B.push(o.defaultView||o.parentWindow||A)}for(a=0;(r=B[a++])&&!e.isPropagationStopped();)d=r,e.type=a>1?s:I.bindType||E,(l=(nA.get(r,"events")||Object.create(null))[e.type]&&nA.get(r,"handle"))&&l.apply(r,t),(l=g&&r[g])&&l.apply&&tA(r)&&(e.result=l.apply(r,t),!1===e.result&&e.preventDefault());return e.type=E,n||e.isDefaultPrevented()||I._default&&!1!==I._default.apply(B.pop(),t)||!tA(i)||g&&C(i[E])&&!h(i)&&((o=i[g])&&(i[g]=null),p.event.triggered=E,e.isPropagationStopped()&&d.addEventListener(E,be),i[E](),e.isPropagationStopped()&&d.removeEventListener(E,be),p.event.triggered=void 0,o&&(i[g]=o)),e.result}},simulate:function(A,e,t){var i=p.extend(new p.Event,t,{type:A,isSimulated:!0});p.event.trigger(i,null,e)}}),p.fn.extend({trigger:function(A,e){return this.each((function(){p.event.trigger(A,e,this)}))},triggerHandler:function(A,e){var t=this[0];if(t)return p.event.trigger(A,e,t,!0)}});var Fe=/\[\]$/,Re=/\r?\n/g,ke=/^(?:submit|button|image|reset|file)$/i,Pe=/^(?:input|select|textarea|keygen)/i;function Ne(A,e,t,i){var n;if(Array.isArray(e))p.each(e,(function(e,n){t||Fe.test(A)?i(A,n):Ne(A+"["+("object"==typeof n&&null!=n?e:"")+"]",n,t,i)}));else if(t||"object"!==f(e))i(A,e);else for(n in e)Ne(A+"["+n+"]",e[n],t,i)}p.param=function(A,e){var t,i=[],n=function(A,e){var t=C(e)?e():e;i[i.length]=encodeURIComponent(A)+"="+encodeURIComponent(null==t?"":t)};if(null==A)return"";if(Array.isArray(A)||A.jquery&&!p.isPlainObject(A))p.each(A,(function(){n(this.name,this.value)}));else for(t in A)Ne(t,A[t],e,n);return i.join("&")},p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var A=p.prop(this,"elements");return A?p.makeArray(A):this})).filter((function(){var A=this.type;return this.name&&!p(this).is(":disabled")&&Pe.test(this.nodeName)&&!ke.test(A)&&(this.checked||!pA.test(A))})).map((function(A,e){var t=p(this).val();return null==t?null:Array.isArray(t)?p.map(t,(function(A){return{name:e.name,value:A.replace(Re,"\r\n")}})):{name:e.name,value:t.replace(Re,"\r\n")}})).get()}});var Te=/%20/g,Me=/#.*$/,Le=/([?&])_=[^&]*/,Ye=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ge=/^(?:GET|HEAD)$/,Ue=/^\/\//,Je={},He={},Ke="*/".concat("*"),Ve=u.createElement("a");function Oe(A){return function(e,t){"string"!=typeof e&&(t=e,e="*");var i,n=0,a=e.toLowerCase().match(K)||[];if(C(t))for(;i=a[n++];)"+"===i[0]?(i=i.slice(1)||"*",(A[i]=A[i]||[]).unshift(t)):(A[i]=A[i]||[]).push(t)}}function je(A,e,t,i){var n={},a=A===He;function r(o){var s;return n[o]=!0,p.each(A[o]||[],(function(A,o){var g=o(e,t,i);return"string"!=typeof g||a||n[g]?a?!(s=g):void 0:(e.dataTypes.unshift(g),r(g),!1)})),s}return r(e.dataTypes[0])||!n["*"]&&r("*")}function We(A,e){var t,i,n=p.ajaxSettings.flatOptions||{};for(t in e)void 0!==e[t]&&((n[t]?A:i||(i={}))[t]=e[t]);return i&&p.extend(!0,A,i),A}Ve.href=Se.href,p.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Se.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Se.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ke,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":p.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(A,e){return e?We(We(A,p.ajaxSettings),e):We(p.ajaxSettings,A)},ajaxPrefilter:Oe(Je),ajaxTransport:Oe(He),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var i,n,a,r,o,s,g,c,l,I,d=p.ajaxSetup({},t),C=d.context||d,h=d.context&&(C.nodeType||C.jquery)?p(C):p.event,B=p.Deferred(),E=p.Callbacks("once memory"),f=d.statusCode||{},Q={},x={},m="canceled",y={readyState:0,getResponseHeader:function(A){var e;if(g){if(!r)for(r={};e=Ye.exec(a);)r[e[1].toLowerCase()+" "]=(r[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=r[A.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return g?a:null},setRequestHeader:function(A,e){return null==g&&(A=x[A.toLowerCase()]=x[A.toLowerCase()]||A,Q[A]=e),this},overrideMimeType:function(A){return null==g&&(d.mimeType=A),this},statusCode:function(A){var e;if(A)if(g)y.always(A[y.status]);else for(e in A)f[e]=[f[e],A[e]];return this},abort:function(A){var e=A||m;return i&&i.abort(e),_(0,e),this}};if(B.promise(y),d.url=((e||d.url||Se.href)+"").replace(Ue,Se.protocol+"//"),d.type=t.method||t.type||d.method||d.type,d.dataTypes=(d.dataType||"*").toLowerCase().match(K)||[""],null==d.crossDomain){s=u.createElement("a");try{s.href=d.url,s.href=s.href,d.crossDomain=Ve.protocol+"//"+Ve.host!=s.protocol+"//"+s.host}catch(A){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=p.param(d.data,d.traditional)),je(Je,d,t,y),g)return y;for(l in(c=p.event&&d.global)&&0==p.active++&&p.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Ge.test(d.type),n=d.url.replace(Me,""),d.hasContent?d.data&&d.processData&&0===(d.contentType||"").indexOf("application/x-www-form-urlencoded")&&(d.data=d.data.replace(Te,"+")):(I=d.url.slice(n.length),d.data&&(d.processData||"string"==typeof d.data)&&(n+=(ve.test(n)?"&":"?")+d.data,delete d.data),!1===d.cache&&(n=n.replace(Le,"$1"),I=(ve.test(n)?"&":"?")+"_="+De.guid+++I),d.url=n+I),d.ifModified&&(p.lastModified[n]&&y.setRequestHeader("If-Modified-Since",p.lastModified[n]),p.etag[n]&&y.setRequestHeader("If-None-Match",p.etag[n])),(d.data&&d.hasContent&&!1!==d.contentType||t.contentType)&&y.setRequestHeader("Content-Type",d.contentType),y.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Ke+"; q=0.01":""):d.accepts["*"]),d.headers)y.setRequestHeader(l,d.headers[l]);if(d.beforeSend&&(!1===d.beforeSend.call(C,y,d)||g))return y.abort();if(m="abort",E.add(d.complete),y.done(d.success),y.fail(d.error),i=je(He,d,t,y)){if(y.readyState=1,c&&h.trigger("ajaxSend",[y,d]),g)return y;d.async&&d.timeout>0&&(o=A.setTimeout((function(){y.abort("timeout")}),d.timeout));try{g=!1,i.send(Q,_)}catch(A){if(g)throw A;_(-1,A)}}else _(-1,"No Transport");function _(e,t,r,s){var l,I,u,Q,x,m=t;g||(g=!0,o&&A.clearTimeout(o),i=void 0,a=s||"",y.readyState=e>0?4:0,l=e>=200&&e<300||304===e,r&&(Q=function(A,e,t){for(var i,n,a,r,o=A.contents,s=A.dataTypes;"*"===s[0];)s.shift(),void 0===i&&(i=A.mimeType||e.getResponseHeader("Content-Type"));if(i)for(n in o)if(o[n]&&o[n].test(i)){s.unshift(n);break}if(s[0]in t)a=s[0];else{for(n in t){if(!s[0]||A.converters[n+" "+s[0]]){a=n;break}r||(r=n)}a=a||r}if(a)return a!==s[0]&&s.unshift(a),t[a]}(d,y,r)),!l&&p.inArray("script",d.dataTypes)>-1&&p.inArray("json",d.dataTypes)<0&&(d.converters["text script"]=function(){}),Q=function(A,e,t,i){var n,a,r,o,s,g={},c=A.dataTypes.slice();if(c[1])for(r in A.converters)g[r.toLowerCase()]=A.converters[r];for(a=c.shift();a;)if(A.responseFields[a]&&(t[A.responseFields[a]]=e),!s&&i&&A.dataFilter&&(e=A.dataFilter(e,A.dataType)),s=a,a=c.shift())if("*"===a)a=s;else if("*"!==s&&s!==a){if(!(r=g[s+" "+a]||g["* "+a]))for(n in g)if((o=n.split(" "))[1]===a&&(r=g[s+" "+o[0]]||g["* "+o[0]])){!0===r?r=g[n]:!0!==g[n]&&(a=o[0],c.unshift(o[1]));break}if(!0!==r)if(r&&A.throws)e=r(e);else try{e=r(e)}catch(A){return{state:"parsererror",error:r?A:"No conversion from "+s+" to "+a}}}return{state:"success",data:e}}(d,Q,y,l),l?(d.ifModified&&((x=y.getResponseHeader("Last-Modified"))&&(p.lastModified[n]=x),(x=y.getResponseHeader("etag"))&&(p.etag[n]=x)),204===e||"HEAD"===d.type?m="nocontent":304===e?m="notmodified":(m=Q.state,I=Q.data,l=!(u=Q.error))):(u=m,!e&&m||(m="error",e<0&&(e=0))),y.status=e,y.statusText=(t||m)+"",l?B.resolveWith(C,[I,m,y]):B.rejectWith(C,[y,m,u]),y.statusCode(f),f=void 0,c&&h.trigger(l?"ajaxSuccess":"ajaxError",[y,d,l?I:u]),E.fireWith(C,[y,m]),c&&(h.trigger("ajaxComplete",[y,d]),--p.active||p.event.trigger("ajaxStop")))}return y},getJSON:function(A,e,t){return p.get(A,e,t,"json")},getScript:function(A,e){return p.get(A,void 0,e,"script")}}),p.each(["get","post"],(function(A,e){p[e]=function(A,t,i,n){return C(t)&&(n=n||i,i=t,t=void 0),p.ajax(p.extend({url:A,type:e,dataType:n,data:t,success:i},p.isPlainObject(A)&&A))}})),p.ajaxPrefilter((function(A){var e;for(e in A.headers)"content-type"===e.toLowerCase()&&(A.contentType=A.headers[e]||"")})),p._evalUrl=function(A,e,t){return p.ajax({url:A,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(A){p.globalEval(A,e,t)}})},p.fn.extend({wrapAll:function(A){var e;return this[0]&&(C(A)&&(A=A.call(this[0])),e=p(A,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var A=this;A.firstElementChild;)A=A.firstElementChild;return A})).append(this)),this},wrapInner:function(A){return C(A)?this.each((function(e){p(this).wrapInner(A.call(this,e))})):this.each((function(){var e=p(this),t=e.contents();t.length?t.wrapAll(A):e.append(A)}))},wrap:function(A){var e=C(A);return this.each((function(t){p(this).wrapAll(e?A.call(this,t):A)}))},unwrap:function(A){return this.parent(A).not("body").each((function(){p(this).replaceWith(this.childNodes)})),this}}),p.expr.pseudos.hidden=function(A){return!p.expr.pseudos.visible(A)},p.expr.pseudos.visible=function(A){return!!(A.offsetWidth||A.offsetHeight||A.getClientRects().length)},p.ajaxSettings.xhr=function(){try{return new A.XMLHttpRequest}catch(A){}};var Ze={0:200,1223:204},Xe=p.ajaxSettings.xhr();d.cors=!!Xe&&"withCredentials"in Xe,d.ajax=Xe=!!Xe,p.ajaxTransport((function(e){var t,i;if(d.cors||Xe&&!e.crossDomain)return{send:function(n,a){var r,o=e.xhr();if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(r in e.xhrFields)o[r]=e.xhrFields[r];for(r in e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest"),n)o.setRequestHeader(r,n[r]);t=function(A){return function(){t&&(t=i=o.onload=o.onerror=o.onabort=o.ontimeout=o.onreadystatechange=null,"abort"===A?o.abort():"error"===A?"number"!=typeof o.status?a(0,"error"):a(o.status,o.statusText):a(Ze[o.status]||o.status,o.statusText,"text"!==(o.responseType||"text")||"string"!=typeof o.responseText?{binary:o.response}:{text:o.responseText},o.getAllResponseHeaders()))}},o.onload=t(),i=o.onerror=o.ontimeout=t("error"),void 0!==o.onabort?o.onabort=i:o.onreadystatechange=function(){4===o.readyState&&A.setTimeout((function(){t&&i()}))},t=t("abort");try{o.send(e.hasContent&&e.data||null)}catch(A){if(t)throw A}},abort:function(){t&&t()}}})),p.ajaxPrefilter((function(A){A.crossDomain&&(A.contents.script=!1)})),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(A){return p.globalEval(A),A}}}),p.ajaxPrefilter("script",(function(A){void 0===A.cache&&(A.cache=!1),A.crossDomain&&(A.type="GET")})),p.ajaxTransport("script",(function(A){var e,t;if(A.crossDomain||A.scriptAttrs)return{send:function(i,n){e=p("