From 09ab26b8df36c5ebd7cfc20a862011fb98681588 Mon Sep 17 00:00:00 2001
From: longyvfengyun <496960745@qq.com>
Date: 星期五, 30 六月 2023 08:35:06 +0800
Subject: [PATCH] 视频监控

---
 static/hk/jquery-1.7.1.min.js                  |    4 
 src/views/home/index.vue                       |   10 
 src/views/home/js/homeContentModule.js         |    1 
 package-lock.json                              |   11 
 src/views/mainLayout/components/PageHeader.vue |    2 
 src/views/video/video.vue                      |    5 
 src/views/home/js/homeInfoModule.js            |   42 
 src/components/MapPin.vue                      |   20 
 package.json                                   |    1 
 static/hk/jsVideoPlugin-1.0.0.min.js           |   37 
 static/hk/webVideoCtrl.js                      | 4261 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 static/hk/HCWebSDKPlugin.exe                   |    0 
 12 files changed, 4,387 insertions(+), 7 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index cf9e439..cc50220 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -11,6 +11,7 @@
         "@element-plus/icons-vue": "^2.1.0",
         "axios": "^1.4.0",
         "element-plus": "^2.3.6",
+        "jquery": "^3.7.0",
         "pinia": "^2.1.4",
         "vue": "^3.3.4",
         "vue-router": "^4.2.2"
@@ -1074,6 +1075,11 @@
       "bin": {
         "jiti": "bin/jiti.js"
       }
+    },
+    "node_modules/jquery": {
+      "version": "3.7.0",
+      "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.0.tgz",
+      "integrity": "sha512-umpJ0/k8X0MvD1ds0P9SfowREz2LenHsQaxSohMZ5OMNEU2r0tf8pdeEFTHMFxWVxKNyU9rTtK3CWzUCTKJUeQ=="
     },
     "node_modules/kolorist": {
       "version": "1.8.0",
@@ -2308,6 +2314,11 @@
       "integrity": "sha512-QAdOptna2NYiSSpv0O/BwoHBSmz4YhpzJHyi+fnMRTXFjp7B8i/YG5Z8IfusxB1ufjcD2Sre1F3R+nX3fvy7gg==",
       "dev": true
     },
+    "jquery": {
+      "version": "3.7.0",
+      "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.0.tgz",
+      "integrity": "sha512-umpJ0/k8X0MvD1ds0P9SfowREz2LenHsQaxSohMZ5OMNEU2r0tf8pdeEFTHMFxWVxKNyU9rTtK3CWzUCTKJUeQ=="
+    },
     "kolorist": {
       "version": "1.8.0",
       "resolved": "https://registry.npmjs.org/kolorist/-/kolorist-1.8.0.tgz",
diff --git a/package.json b/package.json
index 1070f79..d2d3c1a 100644
--- a/package.json
+++ b/package.json
@@ -11,6 +11,7 @@
     "@element-plus/icons-vue": "^2.1.0",
     "axios": "^1.4.0",
     "element-plus": "^2.3.6",
+    "jquery": "^3.7.0",
     "pinia": "^2.1.4",
     "vue": "^3.3.4",
     "vue-router": "^4.2.2"
diff --git a/src/components/MapPin.vue b/src/components/MapPin.vue
index dddadaf..7aea943 100644
--- a/src/components/MapPin.vue
+++ b/src/components/MapPin.vue
@@ -33,6 +33,16 @@
 		y: {
 			type: Number,
 			default: 0
+		},
+		info: {
+			type: Object,
+			default() {
+				return {
+					tmp: 0,
+					hum: 0,
+					diff: 0
+				}
+			}
 		}
 	});
 
@@ -48,7 +58,10 @@
 	<div class="map-pin" :style="posStyle">
 		<el-tooltip placement="top" :visible="visible">
 			<template #content>
-				{{name}}
+				<div class="home-info name">{{name}}</div>
+				<div class="home-info">娓╁害锛歿{ info.tmp }} 鈩�</div>
+				<div class="home-info">婀垮害锛歿{ info.hum }} %RH</div>
+				<div class="home-info">鍘嬪樊锛歿{ info.diff }} Pa</div>
 			</template>
 			<div class="map-pin-content">
 					<div class="pin"></div>
@@ -102,4 +115,9 @@
 		}
 	}
 }
+.home-info {
+	&.name {
+		text-align: center;
+	}
+}
 </style>
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 33ce1df..051d1eb 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -1,9 +1,11 @@
 <script setup>
-import {onMounted, onUnmounted, watch} from "vue";
+import {onMounted, onUnmounted, ref, watch} from "vue";
 import MapPin from "@/components/MapPin.vue";
 import slideMenu from "@/views/mainLayout/js/slideMenu";
 import homeContentModule from "@/views/home/js/homeContentModule";
 import homeInfoModule from "@/views/home/js/homeInfoModule";
+
+const isShowMapPin = ref(true);
 
 const {
 	isCollapse
@@ -19,7 +21,9 @@
 const {homeInfo} = homeInfoModule();
 
 watch(isCollapse, ()=>{
+	isShowMapPin.value = false;
 	setTimeout(()=>{
+		isShowMapPin.value = true;
 		setContainerSize();
 	}, 500);
 });
@@ -40,12 +44,14 @@
 <template>
 	<div class="home-content" ref="homeContentDom">
 		<map-pin
+			v-if="isShowMapPin"
 			v-for="(item, index) in homeInfo" :key="'key'+index"
 			:visible="item.pos.visible"
 			:name="item.name"
 			:c-width="cWidth" :c-height="cHeight"
 			:d-width="dWidth" :d-height="dHeight"
-			:x="item.pos.x" :y="item.pos.y"></map-pin>
+			:x="item.pos.x" :y="item.pos.y"
+			:info="item.info"></map-pin>
 		<div class="card-box-list">
 
 		</div>
diff --git a/src/views/home/js/homeContentModule.js b/src/views/home/js/homeContentModule.js
index fc34f8b..20cb071 100644
--- a/src/views/home/js/homeContentModule.js
+++ b/src/views/home/js/homeContentModule.js
@@ -9,7 +9,6 @@
   const cHeight = ref(0);
   const dWidth = ref(2500);
   const dHeight = ref(1389);
-
   /**
    * 璁剧疆瀹瑰櫒鐨勫ぇ灏�
    */
diff --git a/src/views/home/js/homeInfoModule.js b/src/views/home/js/homeInfoModule.js
index 2195249..5e514d3 100644
--- a/src/views/home/js/homeInfoModule.js
+++ b/src/views/home/js/homeInfoModule.js
@@ -11,6 +11,11 @@
         visible: true,
         x: 710,
         y: 690
+      },
+      info: {
+        tmp: 10,
+        hum: 0,
+        diff: 0
       }
     },
     {
@@ -22,6 +27,11 @@
         visible: true,
         x: 916,
         y: 690
+      },
+      info: {
+        tmp: 0,
+        hum: 0,
+        diff: 0
       }
     },
     {
@@ -33,6 +43,11 @@
         visible: true,
         x: 1212,
         y: 690
+      },
+      info: {
+        tmp: 0,
+        hum: 0,
+        diff: 0
       }
     },
     {
@@ -44,6 +59,11 @@
         visible: true,
         x: 1395,
         y: 690
+      },
+      info: {
+        tmp: 0,
+        hum: 0,
+        diff: 0
       }
     },
     {
@@ -55,6 +75,11 @@
         visible: true,
         x: 1576,
         y: 650
+      },
+      info: {
+        tmp: 0,
+        hum: 0,
+        diff: 0
       }
     },
     {
@@ -66,6 +91,11 @@
         visible: true,
         x: 1495,
         y: 337
+      },
+      info: {
+        tmp: 0,
+        hum: 0,
+        diff: 0
       }
     },
     {
@@ -77,6 +107,11 @@
         visible: true,
         x: 1190,
         y: 355
+      },
+      info: {
+        tmp: 0,
+        hum: 0,
+        diff: 0
       }
     },
     {
@@ -86,8 +121,13 @@
       diffPre: 1,
       pos: {
         visible: true,
-        x: 1009,
+        x: 1000,
         y: 378
+      },
+      info: {
+        tmp: 0,
+        hum: 0,
+        diff: 0
       }
     }
   ]);
diff --git a/src/views/mainLayout/components/PageHeader.vue b/src/views/mainLayout/components/PageHeader.vue
index 57be938..23d4f43 100644
--- a/src/views/mainLayout/components/PageHeader.vue
+++ b/src/views/mainLayout/components/PageHeader.vue
@@ -24,7 +24,7 @@
 					</el-icon>
 				</span>
 			<span class="sys-name">瀹夌惇閰垫瘝锛堣タ钘忥級鐩婄敓鑿屼俊鎭噰闆嗕腑蹇冩櫤鑳藉疄楠屽</span>
-			<span class="sys-version">V1.21</span>
+			<span class="sys-version">V1.121</span>
 		</div>
 		<div class="page-header-right">
 			<div class="hdw-avatar">
diff --git a/src/views/video/video.vue b/src/views/video/video.vue
index 9af0031..3652f5e 100644
--- a/src/views/video/video.vue
+++ b/src/views/video/video.vue
@@ -1,9 +1,12 @@
 <script setup>
+import webVideoCtrl from "../../../static/hk/webVideoCtrl";
 
 </script>
 
 <template>
-	<div>瑙嗛鐩戞帶</div>
+	<div >
+
+	</div>
 </template>
 
 <style scoped>
diff --git a/static/hk/HCWebSDKPlugin.exe b/static/hk/HCWebSDKPlugin.exe
new file mode 100644
index 0000000..11af48b
--- /dev/null
+++ b/static/hk/HCWebSDKPlugin.exe
Binary files differ
diff --git a/static/hk/jquery-1.7.1.min.js b/static/hk/jquery-1.7.1.min.js
new file mode 100644
index 0000000..835d77d
--- /dev/null
+++ b/static/hk/jquery-1.7.1.min.js
@@ -0,0 +1,4 @@
+/*! jQuery v1.7.1 jquery.com | jquery.org/license */
+(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function cb(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function ca(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bE.test(a)?d(a,e):ca(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)ca(a+"["+e+"]",b[e],c,d);else d(a,b)}function b_(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bT,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bP),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bC(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bx:by,g=0,h=e.length;if(d>0){if(c!=="border")for(;g<h;g++)c||(d-=parseFloat(f.css(a,"padding"+e[g]))||0),c==="margin"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,"border"+e[g]+"Width"))||0;return d+"px"}d=bz(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;g<h;g++)d+=parseFloat(f.css(a,"padding"+e[g]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+e[g]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+e[g]))||0);return d+"px"}function bp(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,t2=/(trident.*rv:)([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||t2.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];if(b.length>0&& b[1].indexOf("trident")>-1){b[1]="msie"}return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test("聽")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?m(g):h==="function"&&(!a.unique||!o.has(g))&&c.push(g)},n=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;for(;c&&l<k;l++)if(c[l].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])))},o={add:function(){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&o.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));return this},fire:function(){o.fireWith(this,arguments);return this},fired:function(){return!!e}};return o};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p,q=c.createElement("div"),r=c.documentElement;q.setAttribute("className","t"),q.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="<div "+n+"><div></div></div>"+"<table "+n+" cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="<div style='width:4px;'></div>",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h=null;if(typeof a=="undefined"){if(this.length){h=f.data(this[0]);if(this[0].nodeType===1&&!f._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var i=0,j=e.length;i<j;i++)g=e[i].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]));f._data(this[0],"parsedAttrs",!0)}}return h}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split("."),d[1]=d[1]?"."+d[1]:"";if(c===b){h=this.triggerHandler("getData"+d[1]+"!",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));return h===b&&d[1]?this.data(d[0]):h}return this.each(function(){var b=f(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),f.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise()}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h<g;h++)e=d[h],e&&(c=f.propFix[e]||e,f.attr(a,e,""),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};
+f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=[],j,k,l,m,n,o,p,q,r,s,t;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){m=f(this),m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this){o={},q=[],m[0]=l;for(j=0;j<e;j++)r=d[j],s=r.selector,o[s]===b&&(o[s]=r.quick?H(l,r.quick):m.is(s)),o[s]&&q.push(r);q.length&&i.push({elem:l,matches:q})}}d.length>e&&i.push({elem:this,matches:d.slice(e)});for(j=0;j<i.length&&!c.isPropagationStopped();j++){p=i[j],c.currentTarget=p.elem;for(k=0;k<p.matches.length&&!c.isImmediatePropagationStopped();k++){r=p.matches[k];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace))c.data=r.data,c.handleObj=r,n=((f.event.special[r.origType]||{}).handle||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))}}return c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0)}),d._submit_attached=!0)})},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.POS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function()
+{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bp)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bn(k[i]);else bn(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bq=/alpha\([^)]*\)/i,br=/opacity=([^)]*)/,bs=/([A-Z]|^ms)/g,bt=/^-?\d+(?:px)?$/i,bu=/^-?\d/,bv=/^([\-+])=([\-+.\de]+)/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bv.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bz)return bz(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bC(a,b,d);f.swap(a,bw,function(){e=bC(a,b,d)});return e}},set:function(a,b){if(!bt.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cv(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cu("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cu("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cv(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cn.test(h)?(o=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),o?(f._data(this,"toggle"+i,o==="show"?"hide":"show"),j[o]()):j[h]()):(k=co.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(f.cssNumber[i]?"":"px"),n!=="px"&&(f.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,f.style(this,i,l+n)),k[1]&&(m=(k[1]==="-="?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cr||cs(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){e.options.hide&&f._data(e.elem,"fxshow"+e.prop)===b&&f._data(e.elem,"fxshow"+e.prop,e.start)},h()&&f.timers.push(h)&&!cp&&(cp=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cr||cs(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cp),cp=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(["width","height"],function(a,b){f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.support.fixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.support.fixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
\ No newline at end of file
diff --git a/static/hk/jsVideoPlugin-1.0.0.min.js b/static/hk/jsVideoPlugin-1.0.0.min.js
new file mode 100644
index 0000000..861380e
--- /dev/null
+++ b/static/hk/jsVideoPlugin-1.0.0.min.js
@@ -0,0 +1,37 @@
+/*! {"version":"V1.0.0 build230210","playCrtl":"V7.4.0.1","pluginVersion":"V3.0.7.50","localServiceVersion":"V1.0.38"} */
+(function webpackUniversalModuleDefinition(e,t){if(typeof exports==="object"&&typeof module==="object")module.exports=t();else if(typeof define==="function"&&define.amd)define([],t);else{var n=t();for(var i in n)(typeof exports==="object"?exports:e)[i]=n[i]}})(window,function(){return function(n){var i={};function r(e){if(i[e]){return i[e].exports}var t=i[e]={i:e,l:false,exports:{}};n[e].call(t.exports,t,t.exports,r);t.l=true;return t.exports}r.m=n;r.c=i;r.d=function(e,t,n){if(!r.o(e,t)){Object.defineProperty(e,t,{enumerable:true,get:n})}};r.r=function(e){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})};r.t=function(t,e){if(e&1)t=r(t);if(e&8)return t;if(e&4&&typeof t==="object"&&t&&t.__esModule)return t;var n=Object.create(null);r.r(n);Object.defineProperty(n,"default",{enumerable:true,value:t});if(e&2&&typeof t!="string")for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n};r.n=function(e){var t=e&&e.__esModule?function n(){return e["default"]}:function i(){return e};r.d(t,"a",t);return t};r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};r.p="";return r(r.s=60)}([function(e,t){(function(){e.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(this)},function(nn,rn,e){var on,sn;
+/*!
+ * jQuery JavaScript Library v3.6.0
+ * https://jquery.com/
+ *
+ * Includes Sizzle.js
+ * https://sizzlejs.com/
+ *
+ * Copyright OpenJS Foundation and other contributors
+ * Released under the MIT license
+ * https://jquery.org/license
+ *
+ * Date: 2021-03-02T17:08Z
+ */
+(function(e,t){"use strict";if(true&&typeof nn.exports==="object"){nn.exports=e.document?t(e,true):function(e){if(!e.document){throw new Error("jQuery requires a window with a document")}return t(e)}}else{t(e)}})(typeof window!=="undefined"?window:this,function(C,L){"use strict";var t=[];var F=Object.getPrototypeOf;var a=t.slice;var W=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)};var N=t.push;var B=t.indexOf;var z={};var J=z.toString;var H=z.hasOwnProperty;var U=H.toString;var j=U.call(Object);var v={};var m=function m(e){return typeof e==="function"&&typeof e.nodeType!=="number"&&typeof e.item!=="function"};var y=function y(e){return e!=null&&e===e.window};var k=C.document;var G={type:true,src:true,nonce:true,noModule:true};function V(e,t,n){n=n||k;var i,r,o=n.createElement("script");o.text=e;if(t){for(i in G){r=t[i]||t.getAttribute&&t.getAttribute(i);if(r){o.setAttribute(i,r)}}}n.head.appendChild(o).parentNode.removeChild(o)}function g(e){if(e==null){return e+""}return typeof e==="object"||typeof e==="function"?z[J.call(e)]||"object":typeof e}var Y="3.6.0",T=function(e,t){return new T.fn.init(e,t)};T.fn=T.prototype={jquery:Y,constructor:T,length:0,toArray:function(){return a.call(this)},get:function(e){if(e==null){return a.call(this)}return e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=T.merge(this.constructor(),e);t.prevObject=this;return t},each:function(e){return T.each(this,e)},map:function(n){return this.pushStack(T.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(T.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(T.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:N,sort:t.sort,splice:t.splice};T.extend=T.fn.extend=function(){var e,t,n,i,r,o,s=arguments[0]||{},a=1,u=arguments.length,l=false;if(typeof s==="boolean"){l=s;s=arguments[a]||{};a++}if(typeof s!=="object"&&!m(s)){s={}}if(a===u){s=this;a--}for(;a<u;a++){if((e=arguments[a])!=null){for(t in e){i=e[t];if(t==="__proto__"||s===i){continue}if(l&&i&&(T.isPlainObject(i)||(r=Array.isArray(i)))){n=s[t];if(r&&!Array.isArray(n)){o=[]}else if(!r&&!T.isPlainObject(n)){o={}}else{o=n}r=false;s[t]=T.extend(l,o,i)}else if(i!==undefined){s[t]=i}}}}return s};T.extend({expando:"jQuery"+(Y+Math.random()).replace(/\D/g,""),isReady:true,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;if(!e||J.call(e)!=="[object Object]"){return false}t=F(e);if(!t){return true}n=H.call(t,"constructor")&&t.constructor;return typeof n==="function"&&U.call(n)===j},isEmptyObject:function(e){var t;for(t in e){return false}return true},globalEval:function(e,t,n){V(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,i=0;if(X(e)){n=e.length;for(;i<n;i++){if(t.call(e[i],i,e[i])===false){break}}}else{for(i in e){if(t.call(e[i],i,e[i])===false){break}}}return e},makeArray:function(e,t){var n=t||[];if(e!=null){if(X(Object(e))){T.merge(n,typeof e==="string"?[e]:e)}else{N.call(n,e)}}return n},inArray:function(e,t,n){return t==null?-1:B.call(t,e,n)},merge:function(e,t){var n=+t.length,i=0,r=e.length;for(;i<n;i++){e[r++]=t[i]}e.length=r;return e},grep:function(e,t,n){var i,r=[],o=0,s=e.length,a=!n;for(;o<s;o++){i=!t(e[o],o);if(i!==a){r.push(e[o])}}return r},map:function(e,t,n){var i,r,o=0,s=[];if(X(e)){i=e.length;for(;o<i;o++){r=t(e[o],o,n);if(r!=null){s.push(r)}}}else{for(o in e){r=t(e[o],o,n);if(r!=null){s.push(r)}}}return W(s)},guid:1,support:v});if(typeof Symbol==="function"){T.fn[Symbol.iterator]=t[Symbol.iterator]}T.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){z["[object "+t+"]"]=t.toLowerCase()});function X(e){var t=!!e&&"length"in e&&e.length,n=g(e);if(m(e)||y(e)){return false}return n==="array"||t===0||typeof t==="number"&&t>0&&t-1 in e}var e=
+/*!
+ * Sizzle CSS Selector Engine v2.3.6
+ * https://sizzlejs.com/
+ *
+ * Copyright JS Foundation and other contributors
+ * Released under the MIT license
+ * https://js.foundation/
+ *
+ * Date: 2021-02-16
+ */
+function(L){var e,p,w,o,F,v,W,N,S,u,l,_,b,r,C,m,s,a,y,k="sizzle"+1*new Date,f=L.document,T=0,B=0,z=i(),J=i(),H=i(),g=i(),U=function(e,t){if(e===t){l=true}return 0},j={}.hasOwnProperty,t=[],G=t.pop,V=t.push,R=t.push,Y=t.slice,P=function(e,t){var n=0,i=e.length;for(;n<i;n++){if(e[n]===t){return n}}return-1},X="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|"+"ismap|loop|multiple|open|readonly|required|scoped",c="[\\x20\\t\\r\\n\\f]",n="(?:\\\\[\\da-fA-F]{1,6}"+c+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",Z="\\["+c+"*("+n+")(?:"+c+"*([*^$|!~]?=)"+c+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+n+"))|)"+c+"*\\]",K=":("+n+")(?:\\(("+"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|"+"((?:\\\\.|[^\\\\()[\\]]|"+Z+")*)|"+".*"+")\\)|)",$=new RegExp(c+"+","g"),D=new RegExp("^"+c+"+|((?:^|[^\\\\])(?:\\\\.)*)"+c+"+$","g"),Q=new RegExp("^"+c+"*,"+c+"*"),ee=new RegExp("^"+c+"*([>+~]|"+c+")"+c+"*"),te=new RegExp(c+"|>"),ne=new RegExp(K),ie=new RegExp("^"+n+"$"),h={ID:new RegExp("^#("+n+")"),CLASS:new RegExp("^\\.("+n+")"),TAG:new RegExp("^("+n+"|[*])"),ATTR:new RegExp("^"+Z),PSEUDO:new RegExp("^"+K),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+c+"*(even|odd|(([+-]|)(\\d*)n|)"+c+"*(?:([+-]|)"+c+"*(\\d+)|))"+c+"*\\)|)","i"),bool:new RegExp("^(?:"+X+")$","i"),needsContext:new RegExp("^"+c+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+c+"*((?:-\\d)?\\d*)"+c+"*\\)|)(?=[^-]|$)","i")},re=/HTML$/i,oe=/^(?:input|select|textarea|button)$/i,se=/^h\d$/i,d=/^[^{]+\{\s*\[native \w/,ae=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ue=/[+~]/,x=new RegExp("\\\\[\\da-fA-F]{1,6}"+c+"?|\\\\([^\\r\\n\\f])","g"),I=function(e,t){var n="0x"+e.slice(1)-65536;return t?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,n&1023|56320)},le=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,fe=function(e,t){if(t){if(e==="\0"){return"锟�"}return e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" "}return"\\"+e},ce=function(){_()},he=Se(function(e){return e.disabled===true&&e.nodeName.toLowerCase()==="fieldset"},{dir:"parentNode",next:"legend"});try{R.apply(t=Y.call(f.childNodes),f.childNodes);t[f.childNodes.length].nodeType}catch(M){R={apply:t.length?function(e,t){V.apply(e,Y.call(t))}:function(e,t){var n=e.length,i=0;while(e[n++]=t[i++]){}e.length=n-1}}}function E(e,t,n,i){var r,o,s,a,u,l,f,c=t&&t.ownerDocument,h=t?t.nodeType:9;n=n||[];if(typeof e!=="string"||!e||h!==1&&h!==9&&h!==11){return n}if(!i){_(t);t=t||b;if(C){if(h!==11&&(u=ae.exec(e))){if(r=u[1]){if(h===9){if(s=t.getElementById(r)){if(s.id===r){n.push(s);return n}}else{return n}}else{if(c&&(s=c.getElementById(r))&&y(t,s)&&s.id===r){n.push(s);return n}}}else if(u[2]){R.apply(n,t.getElementsByTagName(e));return n}else if((r=u[3])&&p.getElementsByClassName&&t.getElementsByClassName){R.apply(n,t.getElementsByClassName(r));return n}}if(p.qsa&&!g[e+" "]&&(!m||!m.test(e))&&(h!==1||t.nodeName.toLowerCase()!=="object")){f=e;c=t;if(h===1&&(te.test(e)||ee.test(e))){c=ue.test(e)&&ge(t.parentNode)||t;if(c!==t||!p.scope){if(a=t.getAttribute("id")){a=a.replace(le,fe)}else{t.setAttribute("id",a=k)}}l=v(e);o=l.length;while(o--){l[o]=(a?"#"+a:":scope")+" "+we(l[o])}f=l.join(",")}try{R.apply(n,c.querySelectorAll(f));return n}catch(d){g(e,true)}finally{if(a===k){t.removeAttribute("id")}}}}}return N(e.replace(D,"$1"),t,n,i)}function i(){var n=[];function i(e,t){if(n.push(e+" ")>w.cacheLength){delete i[n.shift()]}return i[e+" "]=t}return i}function q(e){e[k]=true;return e}function A(e){var t=b.createElement("fieldset");try{return!!e(t)}catch(M){return false}finally{if(t.parentNode){t.parentNode.removeChild(t)}t=null}}function de(e,t){var n=e.split("|"),i=n.length;while(i--){w.attrHandle[n[i]]=t}}function pe(e,t){var n=t&&e,i=n&&e.nodeType===1&&t.nodeType===1&&e.sourceIndex-t.sourceIndex;if(i){return i}if(n){while(n=n.nextSibling){if(n===t){return-1}}}return e?1:-1}function ve(n){return function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type===n}}function me(n){return function(e){var t=e.nodeName.toLowerCase();return(t==="input"||t==="button")&&e.type===n}}function ye(t){return function(e){if("form"in e){if(e.parentNode&&e.disabled===false){if("label"in e){if("label"in e.parentNode){return e.parentNode.disabled===t}else{return e.disabled===t}}return e.isDisabled===t||e.isDisabled!==!t&&he(e)===t}return e.disabled===t}else if("label"in e){return e.disabled===t}return false}}function O(s){return q(function(o){o=+o;return q(function(e,t){var n,i=s([],e.length,o),r=i.length;while(r--){if(e[n=i[r]]){e[n]=!(t[n]=e[n])}}})})}function ge(e){return e&&typeof e.getElementsByTagName!=="undefined"&&e}p=E.support={};F=E.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!re.test(t||n&&n.nodeName||"HTML")};_=E.setDocument=function(e){var t,n,i=e?e.ownerDocument||e:f;if(i==b||i.nodeType!==9||!i.documentElement){return b}b=i;r=b.documentElement;C=!F(b);if(f!=b&&(n=b.defaultView)&&n.top!==n){if(n.addEventListener){n.addEventListener("unload",ce,false)}else if(n.attachEvent){n.attachEvent("onunload",ce)}}p.scope=A(function(e){r.appendChild(e).appendChild(b.createElement("div"));return typeof e.querySelectorAll!=="undefined"&&!e.querySelectorAll(":scope fieldset div").length});p.attributes=A(function(e){e.className="i";return!e.getAttribute("className")});p.getElementsByTagName=A(function(e){e.appendChild(b.createComment(""));return!e.getElementsByTagName("*").length});p.getElementsByClassName=d.test(b.getElementsByClassName);p.getById=A(function(e){r.appendChild(e).id=k;return!b.getElementsByName||!b.getElementsByName(k).length});if(p.getById){w.filter["ID"]=function(e){var t=e.replace(x,I);return function(e){return e.getAttribute("id")===t}};w.find["ID"]=function(e,t){if(typeof t.getElementById!=="undefined"&&C){var n=t.getElementById(e);return n?[n]:[]}}}else{w.filter["ID"]=function(e){var n=e.replace(x,I);return function(e){var t=typeof e.getAttributeNode!=="undefined"&&e.getAttributeNode("id");return t&&t.value===n}};w.find["ID"]=function(e,t){if(typeof t.getElementById!=="undefined"&&C){var n,i,r,o=t.getElementById(e);if(o){n=o.getAttributeNode("id");if(n&&n.value===e){return[o]}r=t.getElementsByName(e);i=0;while(o=r[i++]){n=o.getAttributeNode("id");if(n&&n.value===e){return[o]}}}return[]}}}w.find["TAG"]=p.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!=="undefined"){return t.getElementsByTagName(e)}else if(p.qsa){return t.querySelectorAll(e)}}:function(e,t){var n,i=[],r=0,o=t.getElementsByTagName(e);if(e==="*"){while(n=o[r++]){if(n.nodeType===1){i.push(n)}}return i}return o};w.find["CLASS"]=p.getElementsByClassName&&function(e,t){if(typeof t.getElementsByClassName!=="undefined"&&C){return t.getElementsByClassName(e)}};s=[];m=[];if(p.qsa=d.test(b.querySelectorAll)){A(function(e){var t;r.appendChild(e).innerHTML="<a id='"+k+"'></a>"+"<select id='"+k+"-\r\\' msallowcapture=''>"+"<option selected=''></option></select>";if(e.querySelectorAll("[msallowcapture^='']").length){m.push("[*^$]="+c+"*(?:''|\"\")")}if(!e.querySelectorAll("[selected]").length){m.push("\\["+c+"*(?:value|"+X+")")}if(!e.querySelectorAll("[id~="+k+"-]").length){m.push("~=")}t=b.createElement("input");t.setAttribute("name","");e.appendChild(t);if(!e.querySelectorAll("[name='']").length){m.push("\\["+c+"*name"+c+"*="+c+"*(?:''|\"\")")}if(!e.querySelectorAll(":checked").length){m.push(":checked")}if(!e.querySelectorAll("a#"+k+"+*").length){m.push(".#.+[+~]")}e.querySelectorAll("\\\f");m.push("[\\r\\n\\f]")});A(function(e){e.innerHTML="<a href='' disabled='disabled'></a>"+"<select disabled='disabled'><option/></select>";var t=b.createElement("input");t.setAttribute("type","hidden");e.appendChild(t).setAttribute("name","D");if(e.querySelectorAll("[name=d]").length){m.push("name"+c+"*[*^$|!~]?=")}if(e.querySelectorAll(":enabled").length!==2){m.push(":enabled",":disabled")}r.appendChild(e).disabled=true;if(e.querySelectorAll(":disabled").length!==2){m.push(":enabled",":disabled")}e.querySelectorAll("*,:x");m.push(",.*:")})}if(p.matchesSelector=d.test(a=r.matches||r.webkitMatchesSelector||r.mozMatchesSelector||r.oMatchesSelector||r.msMatchesSelector)){A(function(e){p.disconnectedMatch=a.call(e,"*");a.call(e,"[s!='']:x");s.push("!=",K)})}m=m.length&&new RegExp(m.join("|"));s=s.length&&new RegExp(s.join("|"));t=d.test(r.compareDocumentPosition);y=t||d.test(r.contains)?function(e,t){var n=e.nodeType===9?e.documentElement:e,i=t&&t.parentNode;return e===i||!!(i&&i.nodeType===1&&(n.contains?n.contains(i):e.compareDocumentPosition&&e.compareDocumentPosition(i)&16))}:function(e,t){if(t){while(t=t.parentNode){if(t===e){return true}}}return false};U=t?function(e,t){if(e===t){l=true;return 0}var n=!e.compareDocumentPosition-!t.compareDocumentPosition;if(n){return n}n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1;if(n&1||!p.sortDetached&&t.compareDocumentPosition(e)===n){if(e==b||e.ownerDocument==f&&y(f,e)){return-1}if(t==b||t.ownerDocument==f&&y(f,t)){return 1}return u?P(u,e)-P(u,t):0}return n&4?-1:1}:function(e,t){if(e===t){l=true;return 0}var n,i=0,r=e.parentNode,o=t.parentNode,s=[e],a=[t];if(!r||!o){return e==b?-1:t==b?1:r?-1:o?1:u?P(u,e)-P(u,t):0}else if(r===o){return pe(e,t)}n=e;while(n=n.parentNode){s.unshift(n)}n=t;while(n=n.parentNode){a.unshift(n)}while(s[i]===a[i]){i++}return i?pe(s[i],a[i]):s[i]==f?-1:a[i]==f?1:0};return b};E.matches=function(e,t){return E(e,null,null,t)};E.matchesSelector=function(e,t){_(e);if(p.matchesSelector&&C&&!g[t+" "]&&(!s||!s.test(t))&&(!m||!m.test(t))){try{var n=a.call(e,t);if(n||p.disconnectedMatch||e.document&&e.document.nodeType!==11){return n}}catch(M){g(t,true)}}return E(t,b,null,[e]).length>0};E.contains=function(e,t){if((e.ownerDocument||e)!=b){_(e)}return y(e,t)};E.attr=function(e,t){if((e.ownerDocument||e)!=b){_(e)}var n=w.attrHandle[t.toLowerCase()],i=n&&j.call(w.attrHandle,t.toLowerCase())?n(e,t,!C):undefined;return i!==undefined?i:p.attributes||!C?e.getAttribute(t):(i=e.getAttributeNode(t))&&i.specified?i.value:null};E.escape=function(e){return(e+"").replace(le,fe)};E.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};E.uniqueSort=function(e){var t,n=[],i=0,r=0;l=!p.detectDuplicates;u=!p.sortStable&&e.slice(0);e.sort(U);if(l){while(t=e[r++]){if(t===e[r]){i=n.push(r)}}while(i--){e.splice(n[i],1)}}u=null;return e};o=E.getText=function(e){var t,n="",i=0,r=e.nodeType;if(!r){while(t=e[i++]){n+=o(t)}}else if(r===1||r===9||r===11){if(typeof e.textContent==="string"){return e.textContent}else{for(e=e.firstChild;e;e=e.nextSibling){n+=o(e)}}}else if(r===3||r===4){return e.nodeValue}return n};w=E.selectors={cacheLength:50,createPseudo:q,match:h,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){e[1]=e[1].replace(x,I);e[3]=(e[3]||e[4]||e[5]||"").replace(x,I);if(e[2]==="~="){e[3]=" "+e[3]+" "}return e.slice(0,4)},CHILD:function(e){e[1]=e[1].toLowerCase();if(e[1].slice(0,3)==="nth"){if(!e[3]){E.error(e[0])}e[4]=+(e[4]?e[5]+(e[6]||1):2*(e[3]==="even"||e[3]==="odd"));e[5]=+(e[7]+e[8]||e[3]==="odd")}else if(e[3]){E.error(e[0])}return e},PSEUDO:function(e){var t,n=!e[6]&&e[2];if(h["CHILD"].test(e[0])){return null}if(e[3]){e[2]=e[4]||e[5]||""}else if(n&&ne.test(n)&&(t=v(n,true))&&(t=n.indexOf(")",n.length-t)-n.length)){e[0]=e[0].slice(0,t);e[2]=n.slice(0,t)}return e.slice(0,3)}},filter:{TAG:function(e){var t=e.replace(x,I).toLowerCase();return e==="*"?function(){return true}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=z[e+" "];return t||(t=new RegExp("(^|"+c+")"+e+"("+c+"|$)"))&&z(e,function(e){return t.test(typeof e.className==="string"&&e.className||typeof e.getAttribute!=="undefined"&&e.getAttribute("class")||"")})},ATTR:function(n,i,r){return function(e){var t=E.attr(e,n);if(t==null){return i==="!="}if(!i){return true}t+="";return i==="="?t===r:i==="!="?t!==r:i==="^="?r&&t.indexOf(r)===0:i==="*="?r&&t.indexOf(r)>-1:i==="$="?r&&t.slice(-r.length)===r:i==="~="?(" "+t.replace($," ")+" ").indexOf(r)>-1:i==="|="?t===r||t.slice(0,r.length+1)===r+"-":false}},CHILD:function(p,e,t,v,m){var y=p.slice(0,3)!=="nth",g=p.slice(-4)!=="last",P=e==="of-type";return v===1&&m===0?function(e){return!!e.parentNode}:function(e,t,n){var i,r,o,s,a,u,l=y!==g?"nextSibling":"previousSibling",f=e.parentNode,c=P&&e.nodeName.toLowerCase(),h=!n&&!P,d=false;if(f){if(y){while(l){s=e;while(s=s[l]){if(P?s.nodeName.toLowerCase()===c:s.nodeType===1){return false}}u=l=p==="only"&&!u&&"nextSibling"}return true}u=[g?f.firstChild:f.lastChild];if(g&&h){s=f;o=s[k]||(s[k]={});r=o[s.uniqueID]||(o[s.uniqueID]={});i=r[p]||[];a=i[0]===T&&i[1];d=a&&i[2];s=a&&f.childNodes[a];while(s=++a&&s&&s[l]||(d=a=0)||u.pop()){if(s.nodeType===1&&++d&&s===e){r[p]=[T,a,d];break}}}else{if(h){s=e;o=s[k]||(s[k]={});r=o[s.uniqueID]||(o[s.uniqueID]={});i=r[p]||[];a=i[0]===T&&i[1];d=a}if(d===false){while(s=++a&&s&&s[l]||(d=a=0)||u.pop()){if((P?s.nodeName.toLowerCase()===c:s.nodeType===1)&&++d){if(h){o=s[k]||(s[k]={});r=o[s.uniqueID]||(o[s.uniqueID]={});r[p]=[T,d]}if(s===e){break}}}}}d-=m;return d===v||d%v===0&&d/v>=0}}},PSEUDO:function(e,o){var t,s=w.pseudos[e]||w.setFilters[e.toLowerCase()]||E.error("unsupported pseudo: "+e);if(s[k]){return s(o)}if(s.length>1){t=[e,e,"",o];return w.setFilters.hasOwnProperty(e.toLowerCase())?q(function(e,t){var n,i=s(e,o),r=i.length;while(r--){n=P(e,i[r]);e[n]=!(t[n]=i[r])}}):function(e){return s(e,0,t)}}return s}},pseudos:{not:q(function(e){var i=[],r=[],a=W(e.replace(D,"$1"));return a[k]?q(function(e,t,n,i){var r,o=a(e,null,i,[]),s=e.length;while(s--){if(r=o[s]){e[s]=!(t[s]=r)}}}):function(e,t,n){i[0]=e;a(i,null,n,r);i[0]=null;return!r.pop()}}),has:q(function(t){return function(e){return E(t,e).length>0}}),contains:q(function(t){t=t.replace(x,I);return function(e){return(e.textContent||o(e)).indexOf(t)>-1}}),lang:q(function(n){if(!ie.test(n||"")){E.error("unsupported lang: "+n)}n=n.replace(x,I).toLowerCase();return function(e){var t;do{if(t=C?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang")){t=t.toLowerCase();return t===n||t.indexOf(n+"-")===0}}while((e=e.parentNode)&&e.nodeType===1);return false}}),target:function(e){var t=L.location&&L.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===r},focus:function(e){return e===b.activeElement&&(!b.hasFocus||b.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ye(false),disabled:ye(true),checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling){if(e.nodeType<6){return false}}return true},parent:function(e){return!w.pseudos["empty"](e)},header:function(e){return se.test(e.nodeName)},input:function(e){return oe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},text:function(e){var t;return e.nodeName.toLowerCase()==="input"&&e.type==="text"&&((t=e.getAttribute("type"))==null||t.toLowerCase()==="text")},first:O(function(){return[0]}),last:O(function(e,t){return[t-1]}),eq:O(function(e,t,n){return[n<0?n+t:n]}),even:O(function(e,t){var n=0;for(;n<t;n+=2){e.push(n)}return e}),odd:O(function(e,t){var n=1;for(;n<t;n+=2){e.push(n)}return e}),lt:O(function(e,t,n){var i=n<0?n+t:n>t?t:n;for(;--i>=0;){e.push(i)}return e}),gt:O(function(e,t,n){var i=n<0?n+t:n;for(;++i<t;){e.push(i)}return e})}};w.pseudos["nth"]=w.pseudos["eq"];for(e in{radio:true,checkbox:true,file:true,password:true,image:true}){w.pseudos[e]=ve(e)}for(e in{submit:true,reset:true}){w.pseudos[e]=me(e)}function Pe(){}Pe.prototype=w.filters=w.pseudos;w.setFilters=new Pe;v=E.tokenize=function(e,t){var n,i,r,o,s,a,u,l=J[e+" "];if(l){return t?0:l.slice(0)}s=e;a=[];u=w.preFilter;while(s){if(!n||(i=Q.exec(s))){if(i){s=s.slice(i[0].length)||s}a.push(r=[])}n=false;if(i=ee.exec(s)){n=i.shift();r.push({value:n,type:i[0].replace(D," ")});s=s.slice(n.length)}for(o in w.filter){if((i=h[o].exec(s))&&(!u[o]||(i=u[o](i)))){n=i.shift();r.push({value:n,type:o,matches:i});s=s.slice(n.length)}}if(!n){break}}return t?s.length:s?E.error(e):J(e,a).slice(0)};function we(e){var t=0,n=e.length,i="";for(;t<n;t++){i+=e[t].value}return i}function Se(a,e,t){var u=e.dir,l=e.next,f=l||u,c=t&&f==="parentNode",h=B++;return e.first?function(e,t,n){while(e=e[u]){if(e.nodeType===1||c){return a(e,t,n)}}return false}:function(e,t,n){var i,r,o,s=[T,h];if(n){while(e=e[u]){if(e.nodeType===1||c){if(a(e,t,n)){return true}}}}else{while(e=e[u]){if(e.nodeType===1||c){o=e[k]||(e[k]={});r=o[e.uniqueID]||(o[e.uniqueID]={});if(l&&l===e.nodeName.toLowerCase()){e=e[u]||e}else if((i=r[f])&&i[0]===T&&i[1]===h){return s[2]=i[2]}else{r[f]=s;if(s[2]=a(e,t,n)){return true}}}}}return false}}function _e(r){return r.length>1?function(e,t,n){var i=r.length;while(i--){if(!r[i](e,t,n)){return false}}return true}:r[0]}function be(e,t,n){var i=0,r=t.length;for(;i<r;i++){E(e,t[i],n)}return n}function Ce(e,t,n,i,r){var o,s=[],a=0,u=e.length,l=t!=null;for(;a<u;a++){if(o=e[a]){if(!n||n(o,i,r)){s.push(o);if(l){t.push(a)}}}}return s}function ke(d,p,v,m,y,e){if(m&&!m[k]){m=ke(m)}if(y&&!y[k]){y=ke(y,e)}return q(function(e,t,n,i){var r,o,s,a=[],u=[],l=t.length,f=e||be(p||"*",n.nodeType?[n]:n,[]),c=d&&(e||!p)?Ce(f,a,d,n,i):f,h=v?y||(e?d:l||m)?[]:t:c;if(v){v(c,h,n,i)}if(m){r=Ce(h,u);m(r,[],n,i);o=r.length;while(o--){if(s=r[o]){h[u[o]]=!(c[u[o]]=s)}}}if(e){if(y||d){if(y){r=[];o=h.length;while(o--){if(s=h[o]){r.push(c[o]=s)}}y(null,h=[],r,i)}o=h.length;while(o--){if((s=h[o])&&(r=y?P(e,s):a[o])>-1){e[r]=!(t[r]=s)}}}}else{h=Ce(h===t?h.splice(l,h.length):h);if(y){y(null,t,h,i)}else{R.apply(t,h)}}})}function Te(e){var r,t,n,i=e.length,o=w.relative[e[0].type],s=o||w.relative[" "],a=o?1:0,u=Se(function(e){return e===r},s,true),l=Se(function(e){return P(r,e)>-1},s,true),f=[function(e,t,n){var i=!o&&(n||t!==S)||((r=t).nodeType?u(e,t,n):l(e,t,n));r=null;return i}];for(;a<i;a++){if(t=w.relative[e[a].type]){f=[Se(_e(f),t)]}else{t=w.filter[e[a].type].apply(null,e[a].matches);if(t[k]){n=++a;for(;n<i;n++){if(w.relative[e[n].type]){break}}return ke(a>1&&_e(f),a>1&&we(e.slice(0,a-1).concat({value:e[a-2].type===" "?"*":""})).replace(D,"$1"),t,a<n&&Te(e.slice(a,n)),n<i&&Te(e=e.slice(n)),n<i&&we(e))}f.push(t)}}return _e(f)}function Re(m,y){var g=y.length>0,P=m.length>0,e=function(e,t,n,i,r){var o,s,a,u=0,l="0",f=e&&[],c=[],h=S,d=e||P&&w.find["TAG"]("*",r),p=T+=h==null?1:Math.random()||.1,v=d.length;if(r){S=t==b||t||r}for(;l!==v&&(o=d[l])!=null;l++){if(P&&o){s=0;if(!t&&o.ownerDocument!=b){_(o);n=!C}while(a=m[s++]){if(a(o,t||b,n)){i.push(o);break}}if(r){T=p}}if(g){if(o=!a&&o){u--}if(e){f.push(o)}}}u+=l;if(g&&l!==u){s=0;while(a=y[s++]){a(f,c,t,n)}if(e){if(u>0){while(l--){if(!(f[l]||c[l])){c[l]=G.call(i)}}}c=Ce(c)}R.apply(i,c);if(r&&!e&&c.length>0&&u+y.length>1){E.uniqueSort(i)}}if(r){T=p;S=h}return f};return g?q(e):e}W=E.compile=function(e,t){var n,i=[],r=[],o=H[e+" "];if(!o){if(!t){t=v(e)}n=t.length;while(n--){o=Te(t[n]);if(o[k]){i.push(o)}else{r.push(o)}}o=H(e,Re(r,i));o.selector=e}return o};N=E.select=function(e,t,n,i){var r,o,s,a,u,l=typeof e==="function"&&e,f=!i&&v(e=l.selector||e);n=n||[];if(f.length===1){o=f[0]=f[0].slice(0);if(o.length>2&&(s=o[0]).type==="ID"&&t.nodeType===9&&C&&w.relative[o[1].type]){t=(w.find["ID"](s.matches[0].replace(x,I),t)||[])[0];if(!t){return n}else if(l){t=t.parentNode}e=e.slice(o.shift().value.length)}r=h["needsContext"].test(e)?0:o.length;while(r--){s=o[r];if(w.relative[a=s.type]){break}if(u=w.find[a]){if(i=u(s.matches[0].replace(x,I),ue.test(o[0].type)&&ge(t.parentNode)||t)){o.splice(r,1);e=i.length&&we(o);if(!e){R.apply(n,i);return n}break}}}}(l||W(e,f))(i,t,!C,n,!t||ue.test(e)&&ge(t.parentNode)||t);return n};p.sortStable=k.split("").sort(U).join("")===k;p.detectDuplicates=!!l;_();p.sortDetached=A(function(e){return e.compareDocumentPosition(b.createElement("fieldset"))&1});if(!A(function(e){e.innerHTML="<a href='#'></a>";return e.firstChild.getAttribute("href")==="#"})){de("type|href|height|width",function(e,t,n){if(!n){return e.getAttribute(t,t.toLowerCase()==="type"?1:2)}})}if(!p.attributes||!A(function(e){e.innerHTML="<input/>";e.firstChild.setAttribute("value","");return e.firstChild.getAttribute("value")===""})){de("value",function(e,t,n){if(!n&&e.nodeName.toLowerCase()==="input"){return e.defaultValue}})}if(!A(function(e){return e.getAttribute("disabled")==null})){de(X,function(e,t,n){var i;if(!n){return e[t]===true?t.toLowerCase():(i=e.getAttributeNode(t))&&i.specified?i.value:null}})}return E}(C);T.find=e;T.expr=e.selectors;T.expr[":"]=T.expr.pseudos;T.uniqueSort=T.unique=e.uniqueSort;T.text=e.getText;T.isXMLDoc=e.isXML;T.contains=e.contains;T.escapeSelector=e.escape;var i=function(e,t,n){var i=[],r=n!==undefined;while((e=e[t])&&e.nodeType!==9){if(e.nodeType===1){if(r&&T(e).is(n)){break}i.push(e)}}return i};var Z=function(e,t){var n=[];for(;e;e=e.nextSibling){if(e.nodeType===1&&e!==t){n.push(e)}}return n};var K=T.expr.match.needsContext;function l(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var $=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function Q(e,n,i){if(m(n)){return T.grep(e,function(e,t){return!!n.call(e,t,e)!==i})}if(n.nodeType){return T.grep(e,function(e){return e===n!==i})}if(typeof n!=="string"){return T.grep(e,function(e){return B.call(n,e)>-1!==i})}return T.filter(n,e,i)}T.filter=function(e,t,n){var i=t[0];if(n){e=":not("+e+")"}if(t.length===1&&i.nodeType===1){return T.find.matchesSelector(i,e)?[i]:[]}return T.find.matches(e,T.grep(t,function(e){return e.nodeType===1}))};T.fn.extend({find:function(e){var t,n,i=this.length,r=this;if(typeof e!=="string"){return this.pushStack(T(e).filter(function(){for(t=0;t<i;t++){if(T.contains(r[t],this)){return true}}}))}n=this.pushStack([]);for(t=0;t<i;t++){T.find(e,r[t],n)}return i>1?T.uniqueSort(n):n},filter:function(e){return this.pushStack(Q(this,e||[],false))},not:function(e){return this.pushStack(Q(this,e||[],true))},is:function(e){return!!Q(this,typeof e==="string"&&K.test(e)?T(e):e||[],false).length}});var ee,te=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,ne=T.fn.init=function(e,t,n){var i,r;if(!e){return this}n=n||ee;if(typeof e==="string"){if(e[0]==="<"&&e[e.length-1]===">"&&e.length>=3){i=[null,e,null]}else{i=te.exec(e)}if(i&&(i[1]||!t)){if(i[1]){t=t instanceof T?t[0]:t;T.merge(this,T.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:k,true));if($.test(i[1])&&T.isPlainObject(t)){for(i in t){if(m(this[i])){this[i](t[i])}else{this.attr(i,t[i])}}}return this}else{r=k.getElementById(i[2]);if(r){this[0]=r;this.length=1}return this}}else if(!t||t.jquery){return(t||n).find(e)}else{return this.constructor(t).find(e)}}else if(e.nodeType){this[0]=e;this.length=1;return this}else if(m(e)){return n.ready!==undefined?n.ready(e):e(T)}return T.makeArray(e,this)};ne.prototype=T.fn;ee=T(k);var ie=/^(?:parents|prev(?:Until|All))/,re={children:true,contents:true,next:true,prev:true};T.fn.extend({has:function(e){var t=T(e,this),n=t.length;return this.filter(function(){var e=0;for(;e<n;e++){if(T.contains(this,t[e])){return true}}})},closest:function(e,t){var n,i=0,r=this.length,o=[],s=typeof e!=="string"&&T(e);if(!K.test(e)){for(;i<r;i++){for(n=this[i];n&&n!==t;n=n.parentNode){if(n.nodeType<11&&(s?s.index(n)>-1:n.nodeType===1&&T.find.matchesSelector(n,e))){o.push(n);break}}}}return this.pushStack(o.length>1?T.uniqueSort(o):o)},index:function(e){if(!e){return this[0]&&this[0].parentNode?this.first().prevAll().length:-1}if(typeof e==="string"){return B.call(T(e),this[0])}return B.call(this,e.jquery?e[0]:e)},add:function(e,t){return this.pushStack(T.uniqueSort(T.merge(this.get(),T(e,t))))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}});function oe(e,t){while((e=e[t])&&e.nodeType!==1){}return e}T.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return i(e,"parentNode")},parentsUntil:function(e,t,n){return i(e,"parentNode",n)},next:function(e){return oe(e,"nextSibling")},prev:function(e){return oe(e,"previousSibling")},nextAll:function(e){return i(e,"nextSibling")},prevAll:function(e){return i(e,"previousSibling")},nextUntil:function(e,t,n){return i(e,"nextSibling",n)},prevUntil:function(e,t,n){return i(e,"previousSibling",n)},siblings:function(e){return Z((e.parentNode||{}).firstChild,e)},children:function(e){return Z(e.firstChild)},contents:function(e){if(e.contentDocument!=null&&F(e.contentDocument)){return e.contentDocument}if(l(e,"template")){e=e.content||e}return T.merge([],e.childNodes)}},function(i,r){T.fn[i]=function(e,t){var n=T.map(this,r,e);if(i.slice(-5)!=="Until"){t=e}if(t&&typeof t==="string"){n=T.filter(t,n)}if(this.length>1){if(!re[i]){T.uniqueSort(n)}if(ie.test(i)){n.reverse()}}return this.pushStack(n)}});var R=/[^\x20\t\r\n\f]+/g;function se(e){var n={};T.each(e.match(R)||[],function(e,t){n[t]=true});return n}T.Callbacks=function(i){i=typeof i==="string"?se(i):T.extend({},i);var r,e,t,n,o=[],s=[],a=-1,u=function(){n=n||i.once;t=r=true;for(;s.length;a=-1){e=s.shift();while(++a<o.length){if(o[a].apply(e[0],e[1])===false&&i.stopOnFalse){a=o.length;e=false}}}if(!i.memory){e=false}r=false;if(n){if(e){o=[]}else{o=""}}},l={add:function(){if(o){if(e&&!r){a=o.length-1;s.push(e)}(function n(e){T.each(e,function(e,t){if(m(t)){if(!i.unique||!l.has(t)){o.push(t)}}else if(t&&t.length&&g(t)!=="string"){n(t)}})})(arguments);if(e&&!r){u()}}return this},remove:function(){T.each(arguments,function(e,t){var n;while((n=T.inArray(t,o,n))>-1){o.splice(n,1);if(n<=a){a--}}});return this},has:function(e){return e?T.inArray(e,o)>-1:o.length>0},empty:function(){if(o){o=[]}return this},disable:function(){n=s=[];o=e="";return this},disabled:function(){return!o},lock:function(){n=s=[];if(!e&&!r){o=e=""}return this},locked:function(){return!!n},fireWith:function(e,t){if(!n){t=t||[];t=[e,t.slice?t.slice():t];s.push(t);if(!r){u()}}return this},fire:function(){l.fireWith(this,arguments);return this},fired:function(){return!!t}};return l};function c(e){return e}function ae(e){throw e}function ue(e,t,n,i){var r;try{if(e&&m(r=e.promise)){r.call(e).done(t).fail(n)}else if(e&&m(r=e.then)){r.call(e,t,n)}else{t.apply(undefined,[e].slice(i))}}catch(e){n.apply(undefined,[e])}}T.extend({Deferred:function(e){var o=[["notify","progress",T.Callbacks("memory"),T.Callbacks("memory"),2],["resolve","done",T.Callbacks("once memory"),T.Callbacks("once memory"),0,"resolved"],["reject","fail",T.Callbacks("once memory"),T.Callbacks("once memory"),1,"rejected"]],r="pending",s={state:function(){return r},always:function(){a.done(arguments).fail(arguments);return this},"catch":function(e){return s.then(null,e)},pipe:function(){var r=arguments;return T.Deferred(function(i){T.each(o,function(e,t){var n=m(r[t[4]])&&r[t[4]];a[t[1]](function(){var e=n&&n.apply(this,arguments);if(e&&m(e.promise)){e.promise().progress(i.notify).done(i.resolve).fail(i.reject)}else{i[t[0]+"With"](this,n?[e]:arguments)}})});r=null}).promise()},then:function(t,n,i){var l=0;function f(o,s,a,u){return function(){var n=this,i=arguments,t=function(){var e,t;if(o<l){return}e=a.apply(n,i);if(e===s.promise()){throw new TypeError("Thenable self-resolution")}t=e&&(typeof e==="object"||typeof e==="function")&&e.then;if(m(t)){if(u){t.call(e,f(l,s,c,u),f(l,s,ae,u))}else{l++;t.call(e,f(l,s,c,u),f(l,s,ae,u),f(l,s,c,s.notifyWith))}}else{if(a!==c){n=undefined;i=[e]}(u||s.resolveWith)(n,i)}},r=u?t:function(){try{t()}catch(e){if(T.Deferred.exceptionHook){T.Deferred.exceptionHook(e,r.stackTrace)}if(o+1>=l){if(a!==ae){n=undefined;i=[e]}s.rejectWith(n,i)}}};if(o){r()}else{if(T.Deferred.getStackHook){r.stackTrace=T.Deferred.getStackHook()}C.setTimeout(r)}}}return T.Deferred(function(e){o[0][3].add(f(0,e,m(i)?i:c,e.notifyWith));o[1][3].add(f(0,e,m(t)?t:c));o[2][3].add(f(0,e,m(n)?n:ae))}).promise()},promise:function(e){return e!=null?T.extend(e,s):s}},a={};T.each(o,function(e,t){var n=t[2],i=t[5];s[t[1]]=n.add;if(i){n.add(function(){r=i},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock)}n.add(t[3].fire);a[t[0]]=function(){a[t[0]+"With"](this===a?undefined:this,arguments);return this};a[t[0]+"With"]=n.fireWith});s.promise(a);if(e){e.call(a,a)}return a},when:function(e){var n=arguments.length,t=n,i=Array(t),r=a.call(arguments),o=T.Deferred(),s=function(t){return function(e){i[t]=this;r[t]=arguments.length>1?a.call(arguments):e;if(!--n){o.resolveWith(i,r)}}};if(n<=1){ue(e,o.done(s(t)).resolve,o.reject,!n);if(o.state()==="pending"||m(r[t]&&r[t].then)){return o.then()}}while(t--){ue(r[t],s(t),o.reject)}return o.promise()}});var le=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;T.Deferred.exceptionHook=function(e,t){if(C.console&&C.console.warn&&e&&le.test(e.name)){C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)}};T.readyException=function(e){C.setTimeout(function(){throw e})};var fe=T.Deferred();T.fn.ready=function(e){fe.then(e)["catch"](function(e){T.readyException(e)});return this};T.extend({isReady:false,readyWait:1,ready:function(e){if(e===true?--T.readyWait:T.isReady){return}T.isReady=true;if(e!==true&&--T.readyWait>0){return}fe.resolveWith(k,[T])}});T.ready.then=fe.then;function ce(){k.removeEventListener("DOMContentLoaded",ce);C.removeEventListener("load",ce);T.ready()}if(k.readyState==="complete"||k.readyState!=="loading"&&!k.documentElement.doScroll){C.setTimeout(T.ready)}else{k.addEventListener("DOMContentLoaded",ce);C.addEventListener("load",ce)}var f=function(e,t,n,i,r,o,s){var a=0,u=e.length,l=n==null;if(g(n)==="object"){r=true;for(a in n){f(e,t,a,n[a],true,o,s)}}else if(i!==undefined){r=true;if(!m(i)){s=true}if(l){if(s){t.call(e,i);t=null}else{l=t;t=function(e,t,n){return l.call(T(e),n)}}}if(t){for(;a<u;a++){t(e[a],n,s?i:i.call(e[a],a,t(e[a],n)))}}}if(r){return e}if(l){return t.call(e)}return u?t(e[0],n):o};var he=/^-ms-/,de=/-([a-z])/g;function pe(e,t){return t.toUpperCase()}function h(e){return e.replace(he,"ms-").replace(de,pe)}var P=function(e){return e.nodeType===1||e.nodeType===9||!+e.nodeType};function n(){this.expando=T.expando+n.uid++}n.uid=1;n.prototype={cache:function(e){var t=e[this.expando];if(!t){t={};if(P(e)){if(e.nodeType){e[this.expando]=t}else{Object.defineProperty(e,this.expando,{value:t,configurable:true})}}}return t},set:function(e,t,n){var i,r=this.cache(e);if(typeof t==="string"){r[h(t)]=n}else{for(i in t){r[h(i)]=t[i]}}return r},get:function(e,t){return t===undefined?this.cache(e):e[this.expando]&&e[this.expando][h(t)]},access:function(e,t,n){if(t===undefined||t&&typeof t==="string"&&n===undefined){return this.get(e,t)}this.set(e,t,n);return n!==undefined?n:t},remove:function(e,t){var n,i=e[this.expando];if(i===undefined){return}if(t!==undefined){if(Array.isArray(t)){t=t.map(h)}else{t=h(t);t=t in i?[t]:t.match(R)||[]}n=t.length;while(n--){delete i[t[n]]}}if(t===undefined||T.isEmptyObject(i)){if(e.nodeType){e[this.expando]=undefined}else{delete e[this.expando]}}},hasData:function(e){var t=e[this.expando];return t!==undefined&&!T.isEmptyObject(t)}};var w=new n;var d=new n;var ve=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,me=/[A-Z]/g;function ye(e){if(e==="true"){return true}if(e==="false"){return false}if(e==="null"){return null}if(e===+e+""){return+e}if(ve.test(e)){return JSON.parse(e)}return e}function ge(e,t,n){var i;if(n===undefined&&e.nodeType===1){i="data-"+t.replace(me,"-$&").toLowerCase();n=e.getAttribute(i);if(typeof n==="string"){try{n=ye(n)}catch(r){}d.set(e,t,n)}else{n=undefined}}return n}T.extend({hasData:function(e){return d.hasData(e)||w.hasData(e)},data:function(e,t,n){return d.access(e,t,n)},removeData:function(e,t){d.remove(e,t)},_data:function(e,t,n){return w.access(e,t,n)},_removeData:function(e,t){w.remove(e,t)}});T.fn.extend({data:function(n,e){var t,i,r,o=this[0],s=o&&o.attributes;if(n===undefined){if(this.length){r=d.get(o);if(o.nodeType===1&&!w.get(o,"hasDataAttrs")){t=s.length;while(t--){if(s[t]){i=s[t].name;if(i.indexOf("data-")===0){i=h(i.slice(5));ge(o,i,r[i])}}}w.set(o,"hasDataAttrs",true)}}return r}if(typeof n==="object"){return this.each(function(){d.set(this,n)})}return f(this,function(e){var t;if(o&&e===undefined){t=d.get(o,n);if(t!==undefined){return t}t=ge(o,n);if(t!==undefined){return t}return}this.each(function(){d.set(this,n,e)})},null,e,arguments.length>1,null,true)},removeData:function(e){return this.each(function(){d.remove(this,e)})}});T.extend({queue:function(e,t,n){var i;if(e){t=(t||"fx")+"queue";i=w.get(e,t);if(n){if(!i||Array.isArray(n)){i=w.access(e,t,T.makeArray(n))}else{i.push(n)}}return i||[]}},dequeue:function(e,t){t=t||"fx";var n=T.queue(e,t),i=n.length,r=n.shift(),o=T._queueHooks(e,t),s=function(){T.dequeue(e,t)};if(r==="inprogress"){r=n.shift();i--}if(r){if(t==="fx"){n.unshift("inprogress")}delete o.stop;r.call(e,s,o)}if(!i&&o){o.empty.fire()}},_queueHooks:function(e,t){var n=t+"queueHooks";return w.get(e,n)||w.access(e,n,{empty:T.Callbacks("once memory").add(function(){w.remove(e,[t+"queue",n])})})}});T.fn.extend({queue:function(t,n){var e=2;if(typeof t!=="string"){n=t;t="fx";e--}if(arguments.length<e){return T.queue(this[0],t)}return n===undefined?this:this.each(function(){var e=T.queue(this,t,n);T._queueHooks(this,t);if(t==="fx"&&e[0]!=="inprogress"){T.dequeue(this,t)}})},dequeue:function(e){return this.each(function(){T.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,i=1,r=T.Deferred(),o=this,s=this.length,a=function(){if(!--i){r.resolveWith(o,[o])}};if(typeof e!=="string"){t=e;e=undefined}e=e||"fx";while(s--){n=w.get(o[s],e+"queueHooks");if(n&&n.empty){i++;n.empty.add(a)}}a();return r.promise(t)}});var Pe=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source;var p=new RegExp("^(?:([+-])=|)("+Pe+")([a-z%]*)$","i");var S=["Top","Right","Bottom","Left"];var _=k.documentElement;var b=function(e){return T.contains(e.ownerDocument,e)},we={composed:true};if(_.getRootNode){b=function(e){return T.contains(e.ownerDocument,e)||e.getRootNode(we)===e.ownerDocument}}var Se=function(e,t){e=t||e;return e.style.display==="none"||e.style.display===""&&b(e)&&T.css(e,"display")==="none"};function _e(e,t,n,i){var r,o,s=20,a=i?function(){return i.cur()}:function(){return T.css(e,t,"")},u=a(),l=n&&n[3]||(T.cssNumber[t]?"":"px"),f=e.nodeType&&(T.cssNumber[t]||l!=="px"&&+u)&&p.exec(T.css(e,t));if(f&&f[3]!==l){u=u/2;l=l||f[3];f=+u||1;while(s--){T.style(e,t,f+l);if((1-o)*(1-(o=a()/u||.5))<=0){s=0}f=f/o}f=f*2;T.style(e,t,f+l);n=n||[]}if(n){f=+f||+u||0;r=n[1]?f+(n[1]+1)*n[2]:+n[2];if(i){i.unit=l;i.start=f;i.end=r}}return r}var be={};function Ce(e){var t,n=e.ownerDocument,i=e.nodeName,r=be[i];if(r){return r}t=n.body.appendChild(n.createElement(i));r=T.css(t,"display");t.parentNode.removeChild(t);if(r==="none"){r="block"}be[i]=r;return r}function D(e,t){var n,i,r=[],o=0,s=e.length;for(;o<s;o++){i=e[o];if(!i.style){continue}n=i.style.display;if(t){if(n==="none"){r[o]=w.get(i,"display")||null;if(!r[o]){i.style.display=""}}if(i.style.display===""&&Se(i)){r[o]=Ce(i)}}else{if(n!=="none"){r[o]="none";w.set(i,"display",n)}}}for(o=0;o<s;o++){if(r[o]!=null){e[o].style.display=r[o]}}return e}T.fn.extend({show:function(){return D(this,true)},hide:function(){return D(this)},toggle:function(e){if(typeof e==="boolean"){return e?this.show():this.hide()}return this.each(function(){if(Se(this)){T(this).show()}else{T(this).hide()}})}});var r=/^(?:checkbox|radio)$/i;var ke=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i;var Te=/^$|^module$|\/(?:java|ecma)script/i;(function(){var e=k.createDocumentFragment(),t=e.appendChild(k.createElement("div")),n=k.createElement("input");n.setAttribute("type","radio");n.setAttribute("checked","checked");n.setAttribute("name","t");t.appendChild(n);v.checkClone=t.cloneNode(true).cloneNode(true).lastChild.checked;t.innerHTML="<textarea>x</textarea>";v.noCloneChecked=!!t.cloneNode(true).lastChild.defaultValue;t.innerHTML="<option></option>";v.option=!!t.lastChild})();var x={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};x.tbody=x.tfoot=x.colgroup=x.caption=x.thead;x.th=x.td;if(!v.option){x.optgroup=x.option=[1,"<select multiple='multiple'>","</select>"]}function I(e,t){var n;if(typeof e.getElementsByTagName!=="undefined"){n=e.getElementsByTagName(t||"*")}else if(typeof e.querySelectorAll!=="undefined"){n=e.querySelectorAll(t||"*")}else{n=[]}if(t===undefined||t&&l(e,t)){return T.merge([e],n)}return n}function Re(e,t){var n=0,i=e.length;for(;n<i;n++){w.set(e[n],"globalEval",!t||w.get(t[n],"globalEval"))}}var De=/<|&#?\w+;/;function xe(e,t,n,i,r){var o,s,a,u,l,f,c=t.createDocumentFragment(),h=[],d=0,p=e.length;for(;d<p;d++){o=e[d];if(o||o===0){if(g(o)==="object"){T.merge(h,o.nodeType?[o]:o)}else if(!De.test(o)){h.push(t.createTextNode(o))}else{s=s||c.appendChild(t.createElement("div"));a=(ke.exec(o)||["",""])[1].toLowerCase();u=x[a]||x._default;s.innerHTML=u[1]+T.htmlPrefilter(o)+u[2];f=u[0];while(f--){s=s.lastChild}T.merge(h,s.childNodes);s=c.firstChild;s.textContent=""}}}c.textContent="";d=0;while(o=h[d++]){if(i&&T.inArray(o,i)>-1){if(r){r.push(o)}continue}l=b(o);s=I(c.appendChild(o),"script");if(l){Re(s)}if(n){f=0;while(o=s[f++]){if(Te.test(o.type||"")){n.push(o)}}}}return c}var Ie=/^([^.]*)(?:\.(.+)|)/;function s(){return true}function u(){return false}function Ee(e,t){return e===qe()===(t==="focus")}function qe(){try{return k.activeElement}catch(e){}}function Ae(e,t,n,i,r,o){var s,a;if(typeof t==="object"){if(typeof n!=="string"){i=i||n;n=undefined}for(a in t){Ae(e,a,n,i,t[a],o)}return e}if(i==null&&r==null){r=n;i=n=undefined}else if(r==null){if(typeof n==="string"){r=i;i=undefined}else{r=i;i=n;n=undefined}}if(r===false){r=u}else if(!r){return e}if(o===1){s=r;r=function(e){T().off(e);return s.apply(this,arguments)};r.guid=s.guid||(s.guid=T.guid++)}return e.each(function(){T.event.add(this,t,r,i,n)})}T.event={global:{},add:function(t,e,n,i,r){var o,s,a,u,l,f,c,h,d,p,v,m=w.get(t);if(!P(t)){return}if(n.handler){o=n;n=o.handler;r=o.selector}if(r){T.find.matchesSelector(_,r)}if(!n.guid){n.guid=T.guid++}if(!(u=m.events)){u=m.events=Object.create(null)}if(!(s=m.handle)){s=m.handle=function(e){return typeof T!=="undefined"&&T.event.triggered!==e.type?T.event.dispatch.apply(t,arguments):undefined}}e=(e||"").match(R)||[""];l=e.length;while(l--){a=Ie.exec(e[l])||[];d=v=a[1];p=(a[2]||"").split(".").sort();if(!d){continue}c=T.event.special[d]||{};d=(r?c.delegateType:c.bindType)||d;c=T.event.special[d]||{};f=T.extend({type:d,origType:v,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&T.expr.match.needsContext.test(r),namespace:p.join(".")},o);if(!(h=u[d])){h=u[d]=[];h.delegateCount=0;if(!c.setup||c.setup.call(t,i,p,s)===false){if(t.addEventListener){t.addEventListener(d,s)}}}if(c.add){c.add.call(t,f);if(!f.handler.guid){f.handler.guid=n.guid}}if(r){h.splice(h.delegateCount++,0,f)}else{h.push(f)}T.event.global[d]=true}},remove:function(e,t,n,i,r){var o,s,a,u,l,f,c,h,d,p,v,m=w.hasData(e)&&w.get(e);if(!m||!(u=m.events)){return}t=(t||"").match(R)||[""];l=t.length;while(l--){a=Ie.exec(t[l])||[];d=v=a[1];p=(a[2]||"").split(".").sort();if(!d){for(d in u){T.event.remove(e,d+t[l],n,i,true)}continue}c=T.event.special[d]||{};d=(i?c.delegateType:c.bindType)||d;h=u[d]||[];a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)");s=o=h.length;while(o--){f=h[o];if((r||v===f.origType)&&(!n||n.guid===f.guid)&&(!a||a.test(f.namespace))&&(!i||i===f.selector||i==="**"&&f.selector)){h.splice(o,1);if(f.selector){h.delegateCount--}if(c.remove){c.remove.call(e,f)}}}if(s&&!h.length){if(!c.teardown||c.teardown.call(e,p,m.handle)===false){T.removeEvent(e,d,m.handle)}delete u[d]}}if(T.isEmptyObject(u)){w.remove(e,"handle events")}},dispatch:function(e){var t,n,i,r,o,s,a=new Array(arguments.length),u=T.event.fix(e),l=(w.get(this,"events")||Object.create(null))[u.type]||[],f=T.event.special[u.type]||{};a[0]=u;for(t=1;t<arguments.length;t++){a[t]=arguments[t]}u.delegateTarget=this;if(f.preDispatch&&f.preDispatch.call(this,u)===false){return}s=T.event.handlers.call(this,u,l);t=0;while((r=s[t++])&&!u.isPropagationStopped()){u.currentTarget=r.elem;n=0;while((o=r.handlers[n++])&&!u.isImmediatePropagationStopped()){if(!u.rnamespace||o.namespace===false||u.rnamespace.test(o.namespace)){u.handleObj=o;u.data=o.data;i=((T.event.special[o.origType]||{}).handle||o.handler).apply(r.elem,a);if(i!==undefined){if((u.result=i)===false){u.preventDefault();u.stopPropagation()}}}}}if(f.postDispatch){f.postDispatch.call(this,u)}return u.result},handlers:function(e,t){var n,i,r,o,s,a=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!(e.type==="click"&&e.button>=1)){for(;l!==this;l=l.parentNode||this){if(l.nodeType===1&&!(e.type==="click"&&l.disabled===true)){o=[];s={};for(n=0;n<u;n++){i=t[n];r=i.selector+" ";if(s[r]===undefined){s[r]=i.needsContext?T(r,this).index(l)>-1:T.find(r,this,null,[l]).length}if(s[r]){o.push(i)}}if(o.length){a.push({elem:l,handlers:o})}}}}l=this;if(u<t.length){a.push({elem:l,handlers:t.slice(u)})}return a},addProp:function(t,e){Object.defineProperty(T.Event.prototype,t,{enumerable:true,configurable:true,get:m(e)?function(){if(this.originalEvent){return e(this.originalEvent)}}:function(){if(this.originalEvent){return this.originalEvent[t]}},set:function(e){Object.defineProperty(this,t,{enumerable:true,configurable:true,writable:true,value:e})}})},fix:function(e){return e[T.expando]?e:new T.Event(e)},special:{load:{noBubble:true},click:{setup:function(e){var t=this||e;if(r.test(t.type)&&t.click&&l(t,"input")){Oe(t,"click",s)}return false},trigger:function(e){var t=this||e;if(r.test(t.type)&&t.click&&l(t,"input")){Oe(t,"click")}return true},_default:function(e){var t=e.target;return r.test(t.type)&&t.click&&l(t,"input")&&w.get(t,"click")||l(t,"a")}},beforeunload:{postDispatch:function(e){if(e.result!==undefined&&e.originalEvent){e.originalEvent.returnValue=e.result}}}}};function Oe(e,r,o){if(!o){if(w.get(e,r)===undefined){T.event.add(e,r,s)}return}w.set(e,r,false);T.event.add(e,r,{namespace:false,handler:function(e){var t,n,i=w.get(this,r);if(e.isTrigger&1&&this[r]){if(!i.length){i=a.call(arguments);w.set(this,r,i);t=o(this,r);this[r]();n=w.get(this,r);if(i!==n||t){w.set(this,r,false)}else{n={}}if(i!==n){e.stopImmediatePropagation();e.preventDefault();return n&&n.value}}else if((T.event.special[r]||{}).delegateType){e.stopPropagation()}}else if(i.length){w.set(this,r,{value:T.event.trigger(T.extend(i[0],T.Event.prototype),i.slice(1),this)});e.stopImmediatePropagation()}}})}T.removeEvent=function(e,t,n){if(e.removeEventListener){e.removeEventListener(t,n)}};T.Event=function(e,t){if(!(this instanceof T.Event)){return new T.Event(e,t)}if(e&&e.type){this.originalEvent=e;this.type=e.type;this.isDefaultPrevented=e.defaultPrevented||e.defaultPrevented===undefined&&e.returnValue===false?s:u;this.target=e.target&&e.target.nodeType===3?e.target.parentNode:e.target;this.currentTarget=e.currentTarget;this.relatedTarget=e.relatedTarget}else{this.type=e}if(t){T.extend(this,t)}this.timeStamp=e&&e.timeStamp||Date.now();this[T.expando]=true};T.Event.prototype={constructor:T.Event,isDefaultPrevented:u,isPropagationStopped:u,isImmediatePropagationStopped:u,isSimulated:false,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=s;if(e&&!this.isSimulated){e.preventDefault()}},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=s;if(e&&!this.isSimulated){e.stopPropagation()}},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=s;if(e&&!this.isSimulated){e.stopImmediatePropagation()}this.stopPropagation()}};T.each({altKey:true,bubbles:true,cancelable:true,changedTouches:true,ctrlKey:true,detail:true,eventPhase:true,metaKey:true,pageX:true,pageY:true,shiftKey:true,view:true,"char":true,code:true,charCode:true,key:true,keyCode:true,button:true,buttons:true,clientX:true,clientY:true,offsetX:true,offsetY:true,pointerId:true,pointerType:true,screenX:true,screenY:true,targetTouches:true,toElement:true,touches:true,which:true},T.event.addProp);T.each({focus:"focusin",blur:"focusout"},function(e,t){T.event.special[e]={setup:function(){Oe(this,e,Ee);return false},trigger:function(){Oe(this,e);return true},_default:function(){return true},delegateType:t}});T.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,o){T.event.special[e]={delegateType:o,bindType:o,handle:function(e){var t,n=this,i=e.relatedTarget,r=e.handleObj;if(!i||i!==n&&!T.contains(n,i)){e.type=r.origType;t=r.handler.apply(this,arguments);e.type=o}return t}}});T.fn.extend({on:function(e,t,n,i){return Ae(this,e,t,n,i)},one:function(e,t,n,i){return Ae(this,e,t,n,i,1)},off:function(e,t,n){var i,r;if(e&&e.preventDefault&&e.handleObj){i=e.handleObj;T(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler);return this}if(typeof e==="object"){for(r in e){this.off(r,t,e[r])}return this}if(t===false||typeof t==="function"){n=t;t=undefined}if(n===false){n=u}return this.each(function(){T.event.remove(this,e,n,t)})}});var Me=/<script|<style|<link/i,Le=/checked\s*(?:[^=]|=\s*.checked.)/i,Fe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function We(e,t){if(l(e,"table")&&l(t.nodeType!==11?t:t.firstChild,"tr")){return T(e).children("tbody")[0]||e}return e}function Ne(e){e.type=(e.getAttribute("type")!==null)+"/"+e.type;return e}function Be(e){if((e.type||"").slice(0,5)==="true/"){e.type=e.type.slice(5)}else{e.removeAttribute("type")}return e}function ze(e,t){var n,i,r,o,s,a,u;if(t.nodeType!==1){return}if(w.hasData(e)){o=w.get(e);u=o.events;if(u){w.remove(t,"handle events");for(r in u){for(n=0,i=u[r].length;n<i;n++){T.event.add(t,r,u[r][n])}}}}if(d.hasData(e)){s=d.access(e);a=T.extend({},s);d.set(t,a)}}function Je(e,t){var n=t.nodeName.toLowerCase();if(n==="input"&&r.test(e.type)){t.checked=e.checked}else if(n==="input"||n==="textarea"){t.defaultValue=e.defaultValue}}function E(n,i,r,o){i=W(i);var e,t,s,a,u,l,f=0,c=n.length,h=c-1,d=i[0],p=m(d);if(p||c>1&&typeof d==="string"&&!v.checkClone&&Le.test(d)){return n.each(function(e){var t=n.eq(e);if(p){i[0]=d.call(this,e,t.html())}E(t,i,r,o)})}if(c){e=xe(i,n[0].ownerDocument,false,n,o);t=e.firstChild;if(e.childNodes.length===1){e=t}if(t||o){s=T.map(I(e,"script"),Ne);a=s.length;for(;f<c;f++){u=e;if(f!==h){u=T.clone(u,true,true);if(a){T.merge(s,I(u,"script"))}}r.call(n[f],u,f)}if(a){l=s[s.length-1].ownerDocument;T.map(s,Be);for(f=0;f<a;f++){u=s[f];if(Te.test(u.type||"")&&!w.access(u,"globalEval")&&T.contains(l,u)){if(u.src&&(u.type||"").toLowerCase()!=="module"){if(T._evalUrl&&!u.noModule){T._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l)}}else{V(u.textContent.replace(Fe,""),u,l)}}}}}}return n}function He(e,t,n){var i,r=t?T.filter(t,e):e,o=0;for(;(i=r[o])!=null;o++){if(!n&&i.nodeType===1){T.cleanData(I(i))}if(i.parentNode){if(n&&b(i)){Re(I(i,"script"))}i.parentNode.removeChild(i)}}return e}T.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var i,r,o,s,a=e.cloneNode(true),u=b(e);if(!v.noCloneChecked&&(e.nodeType===1||e.nodeType===11)&&!T.isXMLDoc(e)){s=I(a);o=I(e);for(i=0,r=o.length;i<r;i++){Je(o[i],s[i])}}if(t){if(n){o=o||I(e);s=s||I(a);for(i=0,r=o.length;i<r;i++){ze(o[i],s[i])}}else{ze(e,a)}}s=I(a,"script");if(s.length>0){Re(s,!u&&I(e,"script"))}return a},cleanData:function(e){var t,n,i,r=T.event.special,o=0;for(;(n=e[o])!==undefined;o++){if(P(n)){if(t=n[w.expando]){if(t.events){for(i in t.events){if(r[i]){T.event.remove(n,i)}else{T.removeEvent(n,i,t.handle)}}}n[w.expando]=undefined}if(n[d.expando]){n[d.expando]=undefined}}}}});T.fn.extend({detach:function(e){return He(this,e,true)},remove:function(e){return He(this,e)},text:function(e){return f(this,function(e){return e===undefined?T.text(this):this.empty().each(function(){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){this.textContent=e}})},null,e,arguments.length)},append:function(){return E(this,arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=We(this,e);t.appendChild(e)}})},prepend:function(){return E(this,arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=We(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return E(this,arguments,function(e){if(this.parentNode){this.parentNode.insertBefore(e,this)}})},after:function(){return E(this,arguments,function(e){if(this.parentNode){this.parentNode.insertBefore(e,this.nextSibling)}})},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){if(e.nodeType===1){T.cleanData(I(e,false));e.textContent=""}}return this},clone:function(e,t){e=e==null?false:e;t=t==null?e:t;return this.map(function(){return T.clone(this,e,t)})},html:function(e){return f(this,function(e){var t=this[0]||{},n=0,i=this.length;if(e===undefined&&t.nodeType===1){return t.innerHTML}if(typeof e==="string"&&!Me.test(e)&&!x[(ke.exec(e)||["",""])[1].toLowerCase()]){e=T.htmlPrefilter(e);try{for(;n<i;n++){t=this[n]||{};if(t.nodeType===1){T.cleanData(I(t,false));t.innerHTML=e}}t=0}catch(r){}}if(t){this.empty().append(e)}},null,e,arguments.length)},replaceWith:function(){var n=[];return E(this,arguments,function(e){var t=this.parentNode;if(T.inArray(this,n)<0){T.cleanData(I(this));if(t){t.replaceChild(e,this)}}},n)}});T.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,s){T.fn[e]=function(e){var t,n=[],i=T(e),r=i.length-1,o=0;for(;o<=r;o++){t=o===r?this:this.clone(true);T(i[o])[s](t);N.apply(n,t.get())}return this.pushStack(n)}});var Ue=new RegExp("^("+Pe+")(?!px)[a-z%]+$","i");var je=function(e){var t=e.ownerDocument.defaultView;if(!t||!t.opener){t=C}return t.getComputedStyle(e)};var Ge=function(e,t,n){var i,r,o={};for(r in t){o[r]=e.style[r];e.style[r]=t[r]}i=n.call(e);for(r in t){e.style[r]=o[r]}return i};var Ve=new RegExp(S.join("|"),"i");(function(){function e(){if(!l){return}u.style.cssText="position:absolute;left:-11111px;width:60px;"+"margin-top:1px;padding:0;border:0";l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;"+"margin:auto;border:1px;padding:1px;"+"width:60%;top:1%";_.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n=e.top!=="1%";a=t(e.marginLeft)===12;l.style.right="60%";o=t(e.right)===36;i=t(e.width)===36;l.style.position="absolute";r=t(l.offsetWidth/3)===12;_.removeChild(u);l=null}function t(e){return Math.round(parseFloat(e))}var n,i,r,o,s,a,u=k.createElement("div"),l=k.createElement("div");if(!l.style){return}l.style.backgroundClip="content-box";l.cloneNode(true).style.backgroundClip="";v.clearCloneStyle=l.style.backgroundClip==="content-box";T.extend(v,{boxSizingReliable:function(){e();return i},pixelBoxStyles:function(){e();return o},pixelPosition:function(){e();return n},reliableMarginLeft:function(){e();return a},scrollboxSize:function(){e();return r},reliableTrDimensions:function(){var e,t,n,i;if(s==null){e=k.createElement("table");t=k.createElement("tr");n=k.createElement("div");e.style.cssText="position:absolute;left:-11111px;border-collapse:separate";t.style.cssText="border:1px solid";t.style.height="1px";n.style.height="9px";n.style.display="block";_.appendChild(e).appendChild(t).appendChild(n);i=C.getComputedStyle(t);s=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===t.offsetHeight;_.removeChild(e)}return s}})})();function Ye(e,t,n){var i,r,o,s,a=e.style;n=n||je(e);if(n){s=n.getPropertyValue(t)||n[t];if(s===""&&!b(e)){s=T.style(e,t)}if(!v.pixelBoxStyles()&&Ue.test(s)&&Ve.test(t)){i=a.width;r=a.minWidth;o=a.maxWidth;a.minWidth=a.maxWidth=a.width=s;s=n.width;a.width=i;a.minWidth=r;a.maxWidth=o}}return s!==undefined?s+"":s}function Xe(e,t){return{get:function(){if(e()){delete this.get;return}return(this.get=t).apply(this,arguments)}}}var Ze=["Webkit","Moz","ms"],Ke=k.createElement("div").style,$e={};function Qe(e){var t=e[0].toUpperCase()+e.slice(1),n=Ze.length;while(n--){e=Ze[n]+t;if(e in Ke){return e}}}function et(e){var t=T.cssProps[e]||$e[e];if(t){return t}if(e in Ke){return e}return $e[e]=Qe(e)||e}var tt=/^(none|table(?!-c[ea]).+)/,nt=/^--/,it={position:"absolute",visibility:"hidden",display:"block"},rt={letterSpacing:"0",fontWeight:"400"};function ot(e,t,n){var i=p.exec(t);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):t}function st(e,t,n,i,r,o){var s=t==="width"?1:0,a=0,u=0;if(n===(i?"border":"content")){return 0}for(;s<4;s+=2){if(n==="margin"){u+=T.css(e,n+S[s],true,r)}if(!i){u+=T.css(e,"padding"+S[s],true,r);if(n!=="padding"){u+=T.css(e,"border"+S[s]+"Width",true,r)}else{a+=T.css(e,"border"+S[s]+"Width",true,r)}}else{if(n==="content"){u-=T.css(e,"padding"+S[s],true,r)}if(n!=="margin"){u-=T.css(e,"border"+S[s]+"Width",true,r)}}}if(!i&&o>=0){u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-a-.5))||0}return u}function at(e,t,n){var i=je(e),r=!v.boxSizingReliable()||n,o=r&&T.css(e,"boxSizing",false,i)==="border-box",s=o,a=Ye(e,t,i),u="offset"+t[0].toUpperCase()+t.slice(1);if(Ue.test(a)){if(!n){return a}a="auto"}if((!v.boxSizingReliable()&&o||!v.reliableTrDimensions()&&l(e,"tr")||a==="auto"||!parseFloat(a)&&T.css(e,"display",false,i)==="inline")&&e.getClientRects().length){o=T.css(e,"boxSizing",false,i)==="border-box";s=u in e;if(s){a=e[u]}}a=parseFloat(a)||0;return a+st(e,t,n||(o?"border":"content"),s,i,a)+"px"}T.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ye(e,"opacity");return n===""?"1":n}}}},cssNumber:{animationIterationCount:true,columnCount:true,fillOpacity:true,flexGrow:true,flexShrink:true,fontWeight:true,gridArea:true,gridColumn:true,gridColumnEnd:true,gridColumnStart:true,gridRow:true,gridRowEnd:true,gridRowStart:true,lineHeight:true,opacity:true,order:true,orphans:true,widows:true,zIndex:true,zoom:true},cssProps:{},style:function(e,t,n,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style){return}var r,o,s,a=h(t),u=nt.test(t),l=e.style;if(!u){t=et(a)}s=T.cssHooks[t]||T.cssHooks[a];if(n!==undefined){o=typeof n;if(o==="string"&&(r=p.exec(n))&&r[1]){n=_e(e,t,r);o="number"}if(n==null||n!==n){return}if(o==="number"&&!u){n+=r&&r[3]||(T.cssNumber[a]?"":"px")}if(!v.clearCloneStyle&&n===""&&t.indexOf("background")===0){l[t]="inherit"}if(!s||!("set"in s)||(n=s.set(e,n,i))!==undefined){if(u){l.setProperty(t,n)}else{l[t]=n}}}else{if(s&&"get"in s&&(r=s.get(e,false,i))!==undefined){return r}return l[t]}},css:function(e,t,n,i){var r,o,s,a=h(t),u=nt.test(t);if(!u){t=et(a)}s=T.cssHooks[t]||T.cssHooks[a];if(s&&"get"in s){r=s.get(e,true,n)}if(r===undefined){r=Ye(e,t,i)}if(r==="normal"&&t in rt){r=rt[t]}if(n===""||n){o=parseFloat(r);return n===true||isFinite(o)?o||0:r}return r}});T.each(["height","width"],function(e,l){T.cssHooks[l]={get:function(e,t,n){if(t){return tt.test(T.css(e,"display"))&&(!e.getClientRects().length||!e.getBoundingClientRect().width)?Ge(e,it,function(){return at(e,l,n)}):at(e,l,n)}},set:function(e,t,n){var i,r=je(e),o=!v.scrollboxSize()&&r.position==="absolute",s=o||n,a=s&&T.css(e,"boxSizing",false,r)==="border-box",u=n?st(e,l,n,a,r):0;if(a&&o){u-=Math.ceil(e["offset"+l[0].toUpperCase()+l.slice(1)]-parseFloat(r[l])-st(e,l,"border",false,r)-.5)}if(u&&(i=p.exec(t))&&(i[3]||"px")!=="px"){e.style[l]=t;t=T.css(e,l)}return ot(e,t,u)}}});T.cssHooks.marginLeft=Xe(v.reliableMarginLeft,function(e,t){if(t){return(parseFloat(Ye(e,"marginLeft"))||e.getBoundingClientRect().left-Ge(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}});T.each({margin:"",padding:"",border:"Width"},function(r,o){T.cssHooks[r+o]={expand:function(e){var t=0,n={},i=typeof e==="string"?e.split(" "):[e];for(;t<4;t++){n[r+S[t]+o]=i[t]||i[t-2]||i[0]}return n}};if(r!=="margin"){T.cssHooks[r+o].set=ot}});T.fn.extend({css:function(e,t){return f(this,function(e,t,n){var i,r,o={},s=0;if(Array.isArray(t)){i=je(e);r=t.length;for(;s<r;s++){o[t[s]]=T.css(e,t[s],false,i)}return o}return n!==undefined?T.style(e,t,n):T.css(e,t)},e,t,arguments.length>1)}});function o(e,t,n,i,r){return new o.prototype.init(e,t,n,i,r)}T.Tween=o;o.prototype={constructor:o,init:function(e,t,n,i,r,o){this.elem=e;this.prop=n;this.easing=r||T.easing._default;this.options=t;this.start=this.now=this.cur();this.end=i;this.unit=o||(T.cssNumber[n]?"":"px")},cur:function(){var e=o.propHooks[this.prop];return e&&e.get?e.get(this):o.propHooks._default.get(this)},run:function(e){var t,n=o.propHooks[this.prop];if(this.options.duration){this.pos=t=T.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration)}else{this.pos=t=e}this.now=(this.end-this.start)*t+this.start;if(this.options.step){this.options.step.call(this.elem,this.now,this)}if(n&&n.set){n.set(this)}else{o.propHooks._default.set(this)}return this}};o.prototype.init.prototype=o.prototype;o.propHooks={_default:{get:function(e){var t;if(e.elem.nodeType!==1||e.elem[e.prop]!=null&&e.elem.style[e.prop]==null){return e.elem[e.prop]}t=T.css(e.elem,e.prop,"");return!t||t==="auto"?0:t},set:function(e){if(T.fx.step[e.prop]){T.fx.step[e.prop](e)}else if(e.elem.nodeType===1&&(T.cssHooks[e.prop]||e.elem.style[et(e.prop)]!=null)){T.style(e.elem,e.prop,e.now+e.unit)}else{e.elem[e.prop]=e.now}}}};o.propHooks.scrollTop=o.propHooks.scrollLeft={set:function(e){if(e.elem.nodeType&&e.elem.parentNode){e.elem[e.prop]=e.now}}};T.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"};T.fx=o.prototype.init;T.fx.step={};var q,ut,lt=/^(?:toggle|show|hide)$/,ft=/queueHooks$/;function ct(){if(ut){if(k.hidden===false&&C.requestAnimationFrame){C.requestAnimationFrame(ct)}else{C.setTimeout(ct,T.fx.interval)}T.fx.tick()}}function ht(){C.setTimeout(function(){q=undefined});return q=Date.now()}function dt(e,t){var n,i=0,r={height:e};t=t?1:0;for(;i<4;i+=2-t){n=S[i];r["margin"+n]=r["padding"+n]=e}if(t){r.opacity=r.width=e}return r}function pt(e,t,n){var i,r=(A.tweeners[t]||[]).concat(A.tweeners["*"]),o=0,s=r.length;for(;o<s;o++){if(i=r[o].call(n,t,e)){return i}}}function vt(e,t,n){var i,r,o,s,a,u,l,f,c="width"in t||"height"in t,h=this,d={},p=e.style,v=e.nodeType&&Se(e),m=w.get(e,"fxshow");if(!n.queue){s=T._queueHooks(e,"fx");if(s.unqueued==null){s.unqueued=0;a=s.empty.fire;s.empty.fire=function(){if(!s.unqueued){a()}}}s.unqueued++;h.always(function(){h.always(function(){s.unqueued--;if(!T.queue(e,"fx").length){s.empty.fire()}})})}for(i in t){r=t[i];if(lt.test(r)){delete t[i];o=o||r==="toggle";if(r===(v?"hide":"show")){if(r==="show"&&m&&m[i]!==undefined){v=true}else{continue}}d[i]=m&&m[i]||T.style(e,i)}}u=!T.isEmptyObject(t);if(!u&&T.isEmptyObject(d)){return}if(c&&e.nodeType===1){n.overflow=[p.overflow,p.overflowX,p.overflowY];l=m&&m.display;if(l==null){l=w.get(e,"display")}f=T.css(e,"display");if(f==="none"){if(l){f=l}else{D([e],true);l=e.style.display||l;f=T.css(e,"display");D([e])}}if(f==="inline"||f==="inline-block"&&l!=null){if(T.css(e,"float")==="none"){if(!u){h.done(function(){p.display=l});if(l==null){f=p.display;l=f==="none"?"":f}}p.display="inline-block"}}}if(n.overflow){p.overflow="hidden";h.always(function(){p.overflow=n.overflow[0];p.overflowX=n.overflow[1];p.overflowY=n.overflow[2]})}u=false;for(i in d){if(!u){if(m){if("hidden"in m){v=m.hidden}}else{m=w.access(e,"fxshow",{display:l})}if(o){m.hidden=!v}if(v){D([e],true)}h.done(function(){if(!v){D([e])}w.remove(e,"fxshow");for(i in d){T.style(e,i,d[i])}})}u=pt(v?m[i]:0,i,h);if(!(i in m)){m[i]=u.start;if(v){u.end=u.start;u.start=0}}}}function mt(e,t){var n,i,r,o,s;for(n in e){i=h(n);r=t[i];o=e[n];if(Array.isArray(o)){r=o[1];o=e[n]=o[0]}if(n!==i){e[i]=o;delete e[n]}s=T.cssHooks[i];if(s&&"expand"in s){o=s.expand(o);delete e[i];for(n in o){if(!(n in e)){e[n]=o[n];t[n]=r}}}else{t[i]=r}}}function A(s,e,t){var n,a,i=0,r=A.prefilters.length,u=T.Deferred().always(function(){delete o.elem}),o=function(){if(a){return false}var e=q||ht(),t=Math.max(0,l.startTime+l.duration-e),n=t/l.duration||0,i=1-n,r=0,o=l.tweens.length;for(;r<o;r++){l.tweens[r].run(i)}u.notifyWith(s,[l,i,t]);if(i<1&&o){return t}if(!o){u.notifyWith(s,[l,1,0])}u.resolveWith(s,[l]);return false},l=u.promise({elem:s,props:T.extend({},e),opts:T.extend(true,{specialEasing:{},easing:T.easing._default},t),originalProperties:e,originalOptions:t,startTime:q||ht(),duration:t.duration,tweens:[],createTween:function(e,t){var n=T.Tween(s,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);l.tweens.push(n);return n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a){return this}a=true;for(;t<n;t++){l.tweens[t].run(1)}if(e){u.notifyWith(s,[l,1,0]);u.resolveWith(s,[l,e])}else{u.rejectWith(s,[l,e])}return this}}),f=l.props;mt(f,l.opts.specialEasing);for(;i<r;i++){n=A.prefilters[i].call(l,s,f,l.opts);if(n){if(m(n.stop)){T._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)}return n}}T.map(f,pt,l);if(m(l.opts.start)){l.opts.start.call(s,l)}l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always);T.fx.timer(T.extend(o,{elem:s,anim:l,queue:l.opts.queue}));return l}T.Animation=T.extend(A,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);_e(n.elem,e,p.exec(t),n);return n}]},tweener:function(e,t){if(m(e)){t=e;e=["*"]}else{e=e.match(R)}var n,i=0,r=e.length;for(;i<r;i++){n=e[i];A.tweeners[n]=A.tweeners[n]||[];A.tweeners[n].unshift(t)}},prefilters:[vt],prefilter:function(e,t){if(t){A.prefilters.unshift(e)}else{A.prefilters.push(e)}}});T.speed=function(e,t,n){var i=e&&typeof e==="object"?T.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};if(T.fx.off){i.duration=0}else{if(typeof i.duration!=="number"){if(i.duration in T.fx.speeds){i.duration=T.fx.speeds[i.duration]}else{i.duration=T.fx.speeds._default}}}if(i.queue==null||i.queue===true){i.queue="fx"}i.old=i.complete;i.complete=function(){if(m(i.old)){i.old.call(this)}if(i.queue){T.dequeue(this,i.queue)}};return i};T.fn.extend({fadeTo:function(e,t,n,i){return this.filter(Se).css("opacity",0).show().end().animate({opacity:t},e,n,i)},animate:function(t,e,n,i){var r=T.isEmptyObject(t),o=T.speed(e,n,i),s=function(){var e=A(this,T.extend({},t),o);if(r||w.get(this,"finish")){e.stop(true)}};s.finish=s;return r||o.queue===false?this.each(s):this.queue(o.queue,s)},stop:function(r,e,o){var s=function(e){var t=e.stop;delete e.stop;t(o)};if(typeof r!=="string"){o=e;e=r;r=undefined}if(e){this.queue(r||"fx",[])}return this.each(function(){var e=true,t=r!=null&&r+"queueHooks",n=T.timers,i=w.get(this);if(t){if(i[t]&&i[t].stop){s(i[t])}}else{for(t in i){if(i[t]&&i[t].stop&&ft.test(t)){s(i[t])}}}for(t=n.length;t--;){if(n[t].elem===this&&(r==null||n[t].queue===r)){n[t].anim.stop(o);e=false;n.splice(t,1)}}if(e||!o){T.dequeue(this,r)}})},finish:function(s){if(s!==false){s=s||"fx"}return this.each(function(){var e,t=w.get(this),n=t[s+"queue"],i=t[s+"queueHooks"],r=T.timers,o=n?n.length:0;t.finish=true;T.queue(this,s,[]);if(i&&i.stop){i.stop.call(this,true)}for(e=r.length;e--;){if(r[e].elem===this&&r[e].queue===s){r[e].anim.stop(true);r.splice(e,1)}}for(e=0;e<o;e++){if(n[e]&&n[e].finish){n[e].finish.call(this)}}delete t.finish})}});T.each(["toggle","show","hide"],function(e,i){var r=T.fn[i];T.fn[i]=function(e,t,n){return e==null||typeof e==="boolean"?r.apply(this,arguments):this.animate(dt(i,true),e,t,n)}});T.each({slideDown:dt("show"),slideUp:dt("hide"),slideToggle:dt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,i){T.fn[e]=function(e,t,n){return this.animate(i,e,t,n)}});T.timers=[];T.fx.tick=function(){var e,t=0,n=T.timers;q=Date.now();for(;t<n.length;t++){e=n[t];if(!e()&&n[t]===e){n.splice(t--,1)}}if(!n.length){T.fx.stop()}q=undefined};T.fx.timer=function(e){T.timers.push(e);T.fx.start()};T.fx.interval=13;T.fx.start=function(){if(ut){return}ut=true;ct()};T.fx.stop=function(){ut=null};T.fx.speeds={slow:600,fast:200,_default:400};T.fn.delay=function(i,e){i=T.fx?T.fx.speeds[i]||i:i;e=e||"fx";return this.queue(e,function(e,t){var n=C.setTimeout(e,i);t.stop=function(){C.clearTimeout(n)}})};(function(){var e=k.createElement("input"),t=k.createElement("select"),n=t.appendChild(k.createElement("option"));e.type="checkbox";v.checkOn=e.value!=="";v.optSelected=n.selected;e=k.createElement("input");e.value="t";e.type="radio";v.radioValue=e.value==="t"})();var yt,gt=T.expr.attrHandle;T.fn.extend({attr:function(e,t){return f(this,T.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){T.removeAttr(this,e)})}});T.extend({attr:function(e,t,n){var i,r,o=e.nodeType;if(o===3||o===8||o===2){return}if(typeof e.getAttribute==="undefined"){return T.prop(e,t,n)}if(o!==1||!T.isXMLDoc(e)){r=T.attrHooks[t.toLowerCase()]||(T.expr.match.bool.test(t)?yt:undefined)}if(n!==undefined){if(n===null){T.removeAttr(e,t);return}if(r&&"set"in r&&(i=r.set(e,n,t))!==undefined){return i}e.setAttribute(t,n+"");return n}if(r&&"get"in r&&(i=r.get(e,t))!==null){return i}i=T.find.attr(e,t);return i==null?undefined:i},attrHooks:{type:{set:function(e,t){if(!v.radioValue&&t==="radio"&&l(e,"input")){var n=e.value;e.setAttribute("type",t);if(n){e.value=n}return t}}}},removeAttr:function(e,t){var n,i=0,r=t&&t.match(R);if(r&&e.nodeType===1){while(n=r[i++]){e.removeAttribute(n)}}}});yt={set:function(e,t,n){if(t===false){T.removeAttr(e,n)}else{e.setAttribute(n,n)}return n}};T.each(T.expr.match.bool.source.match(/\w+/g),function(e,t){var s=gt[t]||T.find.attr;gt[t]=function(e,t,n){var i,r,o=t.toLowerCase();if(!n){r=gt[o];gt[o]=i;i=s(e,t,n)!=null?o:null;gt[o]=r}return i}});var Pt=/^(?:input|select|textarea|button)$/i,wt=/^(?:a|area)$/i;T.fn.extend({prop:function(e,t){return f(this,T.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[T.propFix[e]||e]})}});T.extend({prop:function(e,t,n){var i,r,o=e.nodeType;if(o===3||o===8||o===2){return}if(o!==1||!T.isXMLDoc(e)){t=T.propFix[t]||t;r=T.propHooks[t]}if(n!==undefined){if(r&&"set"in r&&(i=r.set(e,n,t))!==undefined){return i}return e[t]=n}if(r&&"get"in r&&(i=r.get(e,t))!==null){return i}return e[t]},propHooks:{tabIndex:{get:function(e){var t=T.find.attr(e,"tabindex");if(t){return parseInt(t,10)}if(Pt.test(e.nodeName)||wt.test(e.nodeName)&&e.href){return 0}return-1}}},propFix:{"for":"htmlFor","class":"className"}});if(!v.optSelected){T.propHooks.selected={get:function(e){var t=e.parentNode;if(t&&t.parentNode){t.parentNode.selectedIndex}return null},set:function(e){var t=e.parentNode;if(t){t.selectedIndex;if(t.parentNode){t.parentNode.selectedIndex}}}}}T.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){T.propFix[this.toLowerCase()]=this});function O(e){var t=e.match(R)||[];return t.join(" ")}function M(e){return e.getAttribute&&e.getAttribute("class")||""}function St(e){if(Array.isArray(e)){return e}if(typeof e==="string"){return e.match(R)||[]}return[]}T.fn.extend({addClass:function(t){var e,n,i,r,o,s,a,u=0;if(m(t)){return this.each(function(e){T(this).addClass(t.call(this,e,M(this)))})}e=St(t);if(e.length){while(n=this[u++]){r=M(n);i=n.nodeType===1&&" "+O(r)+" ";if(i){s=0;while(o=e[s++]){if(i.indexOf(" "+o+" ")<0){i+=o+" "}}a=O(i);if(r!==a){n.setAttribute("class",a)}}}}return this},removeClass:function(t){var e,n,i,r,o,s,a,u=0;if(m(t)){return this.each(function(e){T(this).removeClass(t.call(this,e,M(this)))})}if(!arguments.length){return this.attr("class","")}e=St(t);if(e.length){while(n=this[u++]){r=M(n);i=n.nodeType===1&&" "+O(r)+" ";if(i){s=0;while(o=e[s++]){while(i.indexOf(" "+o+" ")>-1){i=i.replace(" "+o+" "," ")}}a=O(i);if(r!==a){n.setAttribute("class",a)}}}}return this},toggleClass:function(r,t){var o=typeof r,s=o==="string"||Array.isArray(r);if(typeof t==="boolean"&&s){return t?this.addClass(r):this.removeClass(r)}if(m(r)){return this.each(function(e){T(this).toggleClass(r.call(this,e,M(this),t),t)})}return this.each(function(){var e,t,n,i;if(s){t=0;n=T(this);i=St(r);while(e=i[t++]){if(n.hasClass(e)){n.removeClass(e)}else{n.addClass(e)}}}else if(r===undefined||o==="boolean"){e=M(this);if(e){w.set(this,"__className__",e)}if(this.setAttribute){this.setAttribute("class",e||r===false?"":w.get(this,"__className__")||"")}}})},hasClass:function(e){var t,n,i=0;t=" "+e+" ";while(n=this[i++]){if(n.nodeType===1&&(" "+O(M(n))+" ").indexOf(t)>-1){return true}}return false}});var _t=/\r/g;T.fn.extend({val:function(n){var i,e,r,t=this[0];if(!arguments.length){if(t){i=T.valHooks[t.type]||T.valHooks[t.nodeName.toLowerCase()];if(i&&"get"in i&&(e=i.get(t,"value"))!==undefined){return e}e=t.value;if(typeof e==="string"){return e.replace(_t,"")}return e==null?"":e}return}r=m(n);return this.each(function(e){var t;if(this.nodeType!==1){return}if(r){t=n.call(this,e,T(this).val())}else{t=n}if(t==null){t=""}else if(typeof t==="number"){t+=""}else if(Array.isArray(t)){t=T.map(t,function(e){return e==null?"":e+""})}i=T.valHooks[this.type]||T.valHooks[this.nodeName.toLowerCase()];if(!i||!("set"in i)||i.set(this,t,"value")===undefined){this.value=t}})}});T.extend({valHooks:{option:{get:function(e){var t=T.find.attr(e,"value");return t!=null?t:O(T.text(e))}},select:{get:function(e){var t,n,i,r=e.options,o=e.selectedIndex,s=e.type==="select-one",a=s?null:[],u=s?o+1:r.length;if(o<0){i=u}else{i=s?o:0}for(;i<u;i++){n=r[i];if((n.selected||i===o)&&!n.disabled&&(!n.parentNode.disabled||!l(n.parentNode,"optgroup"))){t=T(n).val();if(s){return t}a.push(t)}}return a},set:function(e,t){var n,i,r=e.options,o=T.makeArray(t),s=r.length;while(s--){i=r[s];if(i.selected=T.inArray(T.valHooks.option.get(i),o)>-1){n=true}}if(!n){e.selectedIndex=-1}return o}}}});T.each(["radio","checkbox"],function(){T.valHooks[this]={set:function(e,t){if(Array.isArray(t)){return e.checked=T.inArray(T(e).val(),t)>-1}}};if(!v.checkOn){T.valHooks[this].get=function(e){return e.getAttribute("value")===null?"on":e.value}}});v.focusin="onfocusin"in C;var bt=/^(?:focusinfocus|focusoutblur)$/,Ct=function(e){e.stopPropagation()};T.extend(T.event,{trigger:function(e,t,n,i){var r,o,s,a,u,l,f,c,h=[n||k],d=H.call(e,"type")?e.type:e,p=H.call(e,"namespace")?e.namespace.split("."):[];o=c=s=n=n||k;if(n.nodeType===3||n.nodeType===8){return}if(bt.test(d+T.event.triggered)){return}if(d.indexOf(".")>-1){p=d.split(".");d=p.shift();p.sort()}u=d.indexOf(":")<0&&"on"+d;e=e[T.expando]?e:new T.Event(d,typeof e==="object"&&e);e.isTrigger=i?2:3;e.namespace=p.join(".");e.rnamespace=e.namespace?new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;e.result=undefined;if(!e.target){e.target=n}t=t==null?[e]:T.makeArray(t,[e]);f=T.event.special[d]||{};if(!i&&f.trigger&&f.trigger.apply(n,t)===false){return}if(!i&&!f.noBubble&&!y(n)){a=f.delegateType||d;if(!bt.test(a+d)){o=o.parentNode}for(;o;o=o.parentNode){h.push(o);s=o}if(s===(n.ownerDocument||k)){h.push(s.defaultView||s.parentWindow||C)}}r=0;while((o=h[r++])&&!e.isPropagationStopped()){c=o;e.type=r>1?a:f.bindType||d;l=(w.get(o,"events")||Object.create(null))[e.type]&&w.get(o,"handle");if(l){l.apply(o,t)}l=u&&o[u];if(l&&l.apply&&P(o)){e.result=l.apply(o,t);if(e.result===false){e.preventDefault()}}}e.type=d;if(!i&&!e.isDefaultPrevented()){if((!f._default||f._default.apply(h.pop(),t)===false)&&P(n)){if(u&&m(n[d])&&!y(n)){s=n[u];if(s){n[u]=null}T.event.triggered=d;if(e.isPropagationStopped()){c.addEventListener(d,Ct)}n[d]();if(e.isPropagationStopped()){c.removeEventListener(d,Ct)}T.event.triggered=undefined;if(s){n[u]=s}}}}return e.result},simulate:function(e,t,n){var i=T.extend(new T.Event,n,{type:e,isSimulated:true});T.event.trigger(i,null,t)}});T.fn.extend({trigger:function(e,t){return this.each(function(){T.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n){return T.event.trigger(e,t,n,true)}}});if(!v.focusin){T.each({focus:"focusin",blur:"focusout"},function(n,i){var r=function(e){T.event.simulate(i,e.target,T.event.fix(e))};T.event.special[i]={setup:function(){var e=this.ownerDocument||this.document||this,t=w.access(e,i);if(!t){e.addEventListener(n,r,true)}w.access(e,i,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=w.access(e,i)-1;if(!t){e.removeEventListener(n,r,true);w.remove(e,i)}else{w.access(e,i,t)}}}})}var kt=C.location;var Tt={guid:Date.now()};var Rt=/\?/;T.parseXML=function(e){var t,n;if(!e||typeof e!=="string"){return null}try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(i){}n=t&&t.getElementsByTagName("parsererror")[0];if(!t||n){T.error("Invalid XML: "+(n?T.map(n.childNodes,function(e){return e.textContent}).join("\n"):e))}return t};var Dt=/\[\]$/,xt=/\r?\n/g,It=/^(?:submit|button|image|reset|file)$/i,Et=/^(?:input|select|textarea|keygen)/i;function qt(n,e,i,r){var t;if(Array.isArray(e)){T.each(e,function(e,t){if(i||Dt.test(n)){r(n,t)}else{qt(n+"["+(typeof t==="object"&&t!=null?e:"")+"]",t,i,r)}})}else if(!i&&g(e)==="object"){for(t in e){qt(n+"["+t+"]",e[t],i,r)}}else{r(n,e)}}T.param=function(e,t){var n,i=[],r=function(e,t){var n=m(t)?t():t;i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(n==null?"":n)};if(e==null){return""}if(Array.isArray(e)||e.jquery&&!T.isPlainObject(e)){T.each(e,function(){r(this.name,this.value)})}else{for(n in e){qt(n,e[n],t,r)}}return i.join("&")};T.fn.extend({serialize:function(){return T.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=T.prop(this,"elements");return e?T.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!T(this).is(":disabled")&&Et.test(this.nodeName)&&!It.test(e)&&(this.checked||!r.test(e))}).map(function(e,t){var n=T(this).val();if(n==null){return null}if(Array.isArray(n)){return T.map(n,function(e){return{name:t.name,value:e.replace(xt,"\r\n")}})}return{name:t.name,value:n.replace(xt,"\r\n")}}).get()}});var At=/%20/g,Ot=/#.*$/,Mt=/([?&])_=[^&]*/,Lt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ft=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Wt=/^(?:GET|HEAD)$/,Nt=/^\/\//,Bt={},zt={},Jt="*/".concat("*"),Ht=k.createElement("a");Ht.href=kt.href;function Ut(o){return function(e,t){if(typeof e!=="string"){t=e;e="*"}var n,i=0,r=e.toLowerCase().match(R)||[];if(m(t)){while(n=r[i++]){if(n[0]==="+"){n=n.slice(1)||"*";(o[n]=o[n]||[]).unshift(t)}else{(o[n]=o[n]||[]).push(t)}}}}}function jt(t,r,o,s){var a={},u=t===zt;function l(e){var i;a[e]=true;T.each(t[e]||[],function(e,t){var n=t(r,o,s);if(typeof n==="string"&&!u&&!a[n]){r.dataTypes.unshift(n);l(n);return false}else if(u){return!(i=n)}});return i}return l(r.dataTypes[0])||!a["*"]&&l("*")}function Gt(e,t){var n,i,r=T.ajaxSettings.flatOptions||{};for(n in t){if(t[n]!==undefined){(r[n]?e:i||(i={}))[n]=t[n]}}if(i){T.extend(true,e,i)}return e}function Vt(e,t,n){var i,r,o,s,a=e.contents,u=e.dataTypes;while(u[0]==="*"){u.shift();if(i===undefined){i=e.mimeType||t.getResponseHeader("Content-Type")}}if(i){for(r in a){if(a[r]&&a[r].test(i)){u.unshift(r);break}}}if(u[0]in n){o=u[0]}else{for(r in n){if(!u[0]||e.converters[r+" "+u[0]]){o=r;break}if(!s){s=r}}o=o||s}if(o){if(o!==u[0]){u.unshift(o)}return n[o]}}function Yt(e,t,n,i){var r,o,s,a,u,l={},f=e.dataTypes.slice();if(f[1]){for(s in e.converters){l[s.toLowerCase()]=e.converters[s]}}o=f.shift();while(o){if(e.responseFields[o]){n[e.responseFields[o]]=t}if(!u&&i&&e.dataFilter){t=e.dataFilter(t,e.dataType)}u=o;o=f.shift();if(o){if(o==="*"){o=u}else if(u!=="*"&&u!==o){s=l[u+" "+o]||l["* "+o];if(!s){for(r in l){a=r.split(" ");if(a[1]===o){s=l[u+" "+a[0]]||l["* "+a[0]];if(s){if(s===true){s=l[r]}else if(l[r]!==true){o=a[0];f.unshift(a[1])}break}}}}if(s!==true){if(s&&e["throws"]){t=s(t)}else{try{t=s(t)}catch(c){return{state:"parsererror",error:s?c:"No conversion from "+u+" to "+o}}}}}}}return{state:"success",data:t}}T.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:kt.href,type:"GET",isLocal:Ft.test(kt.protocol),global:true,processData:true,"async":true,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jt,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":true,"text json":JSON.parse,"text xml":T.parseXML},flatOptions:{url:true,context:true}},ajaxSetup:function(e,t){return t?Gt(Gt(e,T.ajaxSettings),t):Gt(T.ajaxSettings,e)},ajaxPrefilter:Ut(Bt),ajaxTransport:Ut(zt),ajax:function(e,t){if(typeof e==="object"){t=e;e=undefined}t=t||{};var f,c,h,n,d,i,p,v,r,o,m=T.ajaxSetup({},t),y=m.context||m,g=m.context&&(y.nodeType||y.jquery)?T(y):T.event,P=T.Deferred(),w=T.Callbacks("once memory"),S=m.statusCode||{},s={},a={},u="canceled",_={readyState:0,getResponseHeader:function(e){var t;if(p){if(!n){n={};while(t=Lt.exec(h)){n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}}t=n[e.toLowerCase()+" "]}return t==null?null:t.join(", ")},getAllResponseHeaders:function(){return p?h:null},setRequestHeader:function(e,t){if(p==null){e=a[e.toLowerCase()]=a[e.toLowerCase()]||e;s[e]=t}return this},overrideMimeType:function(e){if(p==null){m.mimeType=e}return this},statusCode:function(e){var t;if(e){if(p){_.always(e[_.status])}else{for(t in e){S[t]=[S[t],e[t]]}}}return this},abort:function(e){var t=e||u;if(f){f.abort(t)}l(0,t);return this}};P.promise(_);m.url=((e||m.url||kt.href)+"").replace(Nt,kt.protocol+"//");m.type=t.method||t.type||m.method||m.type;m.dataTypes=(m.dataType||"*").toLowerCase().match(R)||[""];if(m.crossDomain==null){i=k.createElement("a");try{i.href=m.url;i.href=i.href;m.crossDomain=Ht.protocol+"//"+Ht.host!==i.protocol+"//"+i.host}catch(b){m.crossDomain=true}}if(m.data&&m.processData&&typeof m.data!=="string"){m.data=T.param(m.data,m.traditional)}jt(Bt,m,t,_);if(p){return _}v=T.event&&m.global;if(v&&T.active++===0){T.event.trigger("ajaxStart")}m.type=m.type.toUpperCase();m.hasContent=!Wt.test(m.type);c=m.url.replace(Ot,"");if(!m.hasContent){o=m.url.slice(c.length);if(m.data&&(m.processData||typeof m.data==="string")){c+=(Rt.test(c)?"&":"?")+m.data;delete m.data}if(m.cache===false){c=c.replace(Mt,"$1");o=(Rt.test(c)?"&":"?")+"_="+Tt.guid+++o}m.url=c+o}else if(m.data&&m.processData&&(m.contentType||"").indexOf("application/x-www-form-urlencoded")===0){m.data=m.data.replace(At,"+")}if(m.ifModified){if(T.lastModified[c]){_.setRequestHeader("If-Modified-Since",T.lastModified[c])}if(T.etag[c]){_.setRequestHeader("If-None-Match",T.etag[c])}}if(m.data&&m.hasContent&&m.contentType!==false||t.contentType){_.setRequestHeader("Content-Type",m.contentType)}_.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+(m.dataTypes[0]!=="*"?", "+Jt+"; q=0.01":""):m.accepts["*"]);for(r in m.headers){_.setRequestHeader(r,m.headers[r])}if(m.beforeSend&&(m.beforeSend.call(y,_,m)===false||p)){return _.abort()}u="abort";w.add(m.complete);_.done(m.success);_.fail(m.error);f=jt(zt,m,t,_);if(!f){l(-1,"No Transport")}else{_.readyState=1;if(v){g.trigger("ajaxSend",[_,m])}if(p){return _}if(m["async"]&&m.timeout>0){d=C.setTimeout(function(){_.abort("timeout")},m.timeout)}try{p=false;f.send(s,l)}catch(b){if(p){throw b}l(-1,b)}}function l(e,t,n,i){var r,o,s,a,u,l=t;if(p){return}p=true;if(d){C.clearTimeout(d)}f=undefined;h=i||"";_.readyState=e>0?4:0;r=e>=200&&e<300||e===304;if(n){a=Vt(m,_,n)}if(!r&&T.inArray("script",m.dataTypes)>-1&&T.inArray("json",m.dataTypes)<0){m.converters["text script"]=function(){}}a=Yt(m,a,_,r);if(r){if(m.ifModified){u=_.getResponseHeader("Last-Modified");if(u){T.lastModified[c]=u}u=_.getResponseHeader("etag");if(u){T.etag[c]=u}}if(e===204||m.type==="HEAD"){l="nocontent"}else if(e===304){l="notmodified"}else{l=a.state;o=a.data;s=a.error;r=!s}}else{s=l;if(e||!l){l="error";if(e<0){e=0}}}_.status=e;_.statusText=(t||l)+"";if(r){P.resolveWith(y,[o,l,_])}else{P.rejectWith(y,[_,l,s])}_.statusCode(S);S=undefined;if(v){g.trigger(r?"ajaxSuccess":"ajaxError",[_,m,r?o:s])}w.fireWith(y,[_,l]);if(v){g.trigger("ajaxComplete",[_,m]);if(!--T.active){T.event.trigger("ajaxStop")}}}return _},getJSON:function(e,t,n){return T.get(e,t,n,"json")},getScript:function(e,t){return T.get(e,undefined,t,"script")}});T.each(["get","post"],function(e,r){T[r]=function(e,t,n,i){if(m(t)){i=i||n;n=t;t=undefined}return T.ajax(T.extend({url:e,type:r,dataType:i,data:t,success:n},T.isPlainObject(e)&&e))}});T.ajaxPrefilter(function(e){var t;for(t in e.headers){if(t.toLowerCase()==="content-type"){e.contentType=e.headers[t]||""}}});T._evalUrl=function(e,t,n){return T.ajax({url:e,type:"GET",dataType:"script",cache:true,"async":false,global:false,converters:{"text script":function(){}},dataFilter:function(e){T.globalEval(e,t,n)}})};T.fn.extend({wrapAll:function(e){var t;if(this[0]){if(m(e)){e=e.call(this[0])}t=T(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){t.insertBefore(this[0])}t.map(function(){var e=this;while(e.firstElementChild){e=e.firstElementChild}return e}).append(this)}return this},wrapInner:function(n){if(m(n)){return this.each(function(e){T(this).wrapInner(n.call(this,e))})}return this.each(function(){var e=T(this),t=e.contents();if(t.length){t.wrapAll(n)}else{e.append(n)}})},wrap:function(t){var n=m(t);return this.each(function(e){T(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){this.parent(e).not("body").each(function(){T(this).replaceWith(this.childNodes)});return this}});T.expr.pseudos.hidden=function(e){return!T.expr.pseudos.visible(e)};T.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)};T.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var Xt={0:200,1223:204},Zt=T.ajaxSettings.xhr();v.cors=!!Zt&&"withCredentials"in Zt;v.ajax=Zt=!!Zt;T.ajaxTransport(function(o){var s,a;if(v.cors||Zt&&!o.crossDomain){return{send:function(e,t){var n,i=o.xhr();i.open(o.type,o.url,o["async"],o.username,o.password);if(o.xhrFields){for(n in o.xhrFields){i[n]=o.xhrFields[n]}}if(o.mimeType&&i.overrideMimeType){i.overrideMimeType(o.mimeType)}if(!o.crossDomain&&!e["X-Requested-With"]){e["X-Requested-With"]="XMLHttpRequest"}for(n in e){i.setRequestHeader(n,e[n])}s=function(e){return function(){if(s){s=a=i.onload=i.onerror=i.onabort=i.ontimeout=i.onreadystatechange=null;if(e==="abort"){i.abort()}else if(e==="error"){if(typeof i.status!=="number"){t(0,"error")}else{t(i.status,i.statusText)}}else{t(Xt[i.status]||i.status,i.statusText,(i.responseType||"text")!=="text"||typeof i.responseText!=="string"?{binary:i.response}:{text:i.responseText},i.getAllResponseHeaders())}}}};i.onload=s();a=i.onerror=i.ontimeout=s("error");if(i.onabort!==undefined){i.onabort=a}else{i.onreadystatechange=function(){if(i.readyState===4){C.setTimeout(function(){if(s){a()}})}}}s=s("abort");try{i.send(o.hasContent&&o.data||null)}catch(r){if(s){throw r}}},abort:function(){if(s){s()}}}}});T.ajaxPrefilter(function(e){if(e.crossDomain){e.contents.script=false}});T.ajaxSetup({accepts:{script:"text/javascript, application/javascript, "+"application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){T.globalEval(e);return e}}});T.ajaxPrefilter("script",function(e){if(e.cache===undefined){e.cache=false}if(e.crossDomain){e.type="GET"}});T.ajaxTransport("script",function(n){if(n.crossDomain||n.scriptAttrs){var i,r;return{send:function(e,t){i=T("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",r=function(e){i.remove();r=null;if(e){t(e.type==="error"?404:200,e.type)}});k.head.appendChild(i[0])},abort:function(){if(r){r()}}}}});var Kt=[],$t=/(=)\?(?=&|$)|\?\?/;T.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||T.expando+"_"+Tt.guid++;this[e]=true;return e}});T.ajaxPrefilter("json jsonp",function(e,t,n){var i,r,o,s=e.jsonp!==false&&($t.test(e.url)?"url":typeof e.data==="string"&&(e.contentType||"").indexOf("application/x-www-form-urlencoded")===0&&$t.test(e.data)&&"data");if(s||e.dataTypes[0]==="jsonp"){i=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback;if(s){e[s]=e[s].replace($t,"$1"+i)}else if(e.jsonp!==false){e.url+=(Rt.test(e.url)?"&":"?")+e.jsonp+"="+i}e.converters["script json"]=function(){if(!o){T.error(i+" was not called")}return o[0]};e.dataTypes[0]="json";r=C[i];C[i]=function(){o=arguments};n.always(function(){if(r===undefined){T(C).removeProp(i)}else{C[i]=r}if(e[i]){e.jsonpCallback=t.jsonpCallback;Kt.push(i)}if(o&&m(r)){r(o[0])}o=r=undefined});return"script"}});v.createHTMLDocument=function(){var e=k.implementation.createHTMLDocument("").body;e.innerHTML="<form></form><form></form>";return e.childNodes.length===2}();T.parseHTML=function(e,t,n){if(typeof e!=="string"){return[]}if(typeof t==="boolean"){n=t;t=false}var i,r,o;if(!t){if(v.createHTMLDocument){t=k.implementation.createHTMLDocument("");i=t.createElement("base");i.href=k.location.href;t.head.appendChild(i)}else{t=k}}r=$.exec(e);o=!n&&[];if(r){return[t.createElement(r[1])]}r=xe([e],t,o);if(o&&o.length){T(o).remove()}return T.merge([],r.childNodes)};T.fn.load=function(e,t,n){var i,r,o,s=this,a=e.indexOf(" ");if(a>-1){i=O(e.slice(a));e=e.slice(0,a)}if(m(t)){n=t;t=undefined}else if(t&&typeof t==="object"){r="POST"}if(s.length>0){T.ajax({url:e,type:r||"GET",dataType:"html",data:t}).done(function(e){o=arguments;s.html(i?T("<div>").append(T.parseHTML(e)).find(i):e)}).always(n&&function(e,t){s.each(function(){n.apply(this,o||[e.responseText,t,e])})})}return this};T.expr.pseudos.animated=function(t){return T.grep(T.timers,function(e){return t===e.elem}).length};T.offset={setOffset:function(e,t,n){var i,r,o,s,a,u,l,f=T.css(e,"position"),c=T(e),h={};if(f==="static"){e.style.position="relative"}a=c.offset();o=T.css(e,"top");u=T.css(e,"left");l=(f==="absolute"||f==="fixed")&&(o+u).indexOf("auto")>-1;if(l){i=c.position();s=i.top;r=i.left}else{s=parseFloat(o)||0;r=parseFloat(u)||0}if(m(t)){t=t.call(e,n,T.extend({},a))}if(t.top!=null){h.top=t.top-a.top+s}if(t.left!=null){h.left=t.left-a.left+r}if("using"in t){t.using.call(e,h)}else{c.css(h)}}};T.fn.extend({offset:function(t){if(arguments.length){return t===undefined?this:this.each(function(e){T.offset.setOffset(this,t,e)})}var e,n,i=this[0];if(!i){return}if(!i.getClientRects().length){return{top:0,left:0}}e=i.getBoundingClientRect();n=i.ownerDocument.defaultView;return{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}},position:function(){if(!this[0]){return}var e,t,n,i=this[0],r={top:0,left:0};if(T.css(i,"position")==="fixed"){t=i.getBoundingClientRect()}else{t=this.offset();n=i.ownerDocument;e=i.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&T.css(e,"position")==="static"){e=e.parentNode}if(e&&e!==i&&e.nodeType===1){r=T(e).offset();r.top+=T.css(e,"borderTopWidth",true);r.left+=T.css(e,"borderLeftWidth",true)}}return{top:t.top-r.top-T.css(i,"marginTop",true),left:t.left-r.left-T.css(i,"marginLeft",true)}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&T.css(e,"position")==="static"){e=e.offsetParent}return e||_})}});T.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,r){var o="pageYOffset"===r;T.fn[t]=function(e){return f(this,function(e,t,n){var i;if(y(e)){i=e}else if(e.nodeType===9){i=e.defaultView}if(n===undefined){return i?i[r]:e[t]}if(i){i.scrollTo(!o?n:i.pageXOffset,o?n:i.pageYOffset)}else{e[t]=n}},t,e,arguments.length)}});T.each(["top","left"],function(e,n){T.cssHooks[n]=Xe(v.pixelPosition,function(e,t){if(t){t=Ye(e,n);return Ue.test(t)?T(e).position()[n]+"px":t}})});T.each({Height:"height",Width:"width"},function(s,a){T.each({padding:"inner"+s,content:a,"":"outer"+s},function(i,o){T.fn[o]=function(e,t){var n=arguments.length&&(i||typeof e!=="boolean"),r=i||(e===true||t===true?"margin":"border");return f(this,function(e,t,n){var i;if(y(e)){return o.indexOf("outer")===0?e["inner"+s]:e.document.documentElement["client"+s]}if(e.nodeType===9){i=e.documentElement;return Math.max(e.body["scroll"+s],i["scroll"+s],e.body["offset"+s],i["offset"+s],i["client"+s])}return n===undefined?T.css(e,t,r):T.style(e,t,n,r)},a,n?e:undefined,n)}})});T.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){T.fn[t]=function(e){return this.on(t,e)}});T.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,i){return this.on(t,e,n,i)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}});T.each(("blur focus focusin focusout resize scroll click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup contextmenu").split(" "),function(e,n){T.fn[n]=function(e,t){return arguments.length>0?this.on(n,null,e,t):this.trigger(n)}});var Qt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;T.proxy=function(e,t){var n,i,r;if(typeof t==="string"){n=e[t];t=e;e=n}if(!m(e)){return undefined}i=a.call(arguments,2);r=function(){return e.apply(t||this,i.concat(a.call(arguments)))};r.guid=e.guid=e.guid||T.guid++;return r};T.holdReady=function(e){if(e){T.readyWait++}else{T.ready(true)}};T.isArray=Array.isArray;T.parseJSON=JSON.parse;T.nodeName=l;T.isFunction=m;T.isWindow=y;T.camelCase=h;T.type=g;T.now=Date.now;T.isNumeric=function(e){var t=T.type(e);return(t==="number"||t==="string")&&!isNaN(e-parseFloat(e))};T.trim=function(e){return e==null?"":(e+"").replace(Qt,"")};if(true){!(on=[],sn=function(){return T}.apply(rn,on),sn!==undefined&&(nn.exports=sn))}var en=C.jQuery,tn=C.$;T.noConflict=function(e){if(C.$===T){C.$=tn}if(e&&C.jQuery===T){C.jQuery=en}return T};if(typeof L==="undefined"){C.jQuery=C.$=T}return T})},function(w,e,S){(function(){var i,h,n,r,o,d,t,s,a,e,u,l,f,c,p,v,m,y,g,P={}.hasOwnProperty;g=S(3),y=g.isObject,m=g.isFunction,v=g.isEmpty,p=g.getValue;s=null;n=null;r=null;o=null;d=null;f=null;c=null;l=null;t=null;h=null;u=null;a=null;i=null;w.exports=e=function(){function e(e){this.parent=e;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}this.value=null;this.children=[];this.baseURI=null;if(!s){s=S(20);n=S(22);r=S(23);o=S(24);d=S(25);f=S(30);c=S(31);l=S(32);t=S(49);h=S(0);u=S(94);a=S(21);i=S(95)}}Object.defineProperty(e.prototype,"nodeName",{get:function(){return this.name}});Object.defineProperty(e.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(e.prototype,"nodeValue",{get:function(){return this.value}});Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent}});Object.defineProperty(e.prototype,"childNodes",{get:function(){if(!this.childNodeList||!this.childNodeList.nodes){this.childNodeList=new u(this.children)}return this.childNodeList}});Object.defineProperty(e.prototype,"firstChild",{get:function(){return this.children[0]||null}});Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}});Object.defineProperty(e.prototype,"previousSibling",{get:function(){var e;e=this.parent.children.indexOf(this);return this.parent.children[e-1]||null}});Object.defineProperty(e.prototype,"nextSibling",{get:function(){var e;e=this.parent.children.indexOf(this);return this.parent.children[e+1]||null}});Object.defineProperty(e.prototype,"ownerDocument",{get:function(){return this.document()||null}});Object.defineProperty(e.prototype,"textContent",{get:function(){var e,t,n,i,r;if(this.nodeType===h.Element||this.nodeType===h.DocumentFragment){r="";i=this.children;for(t=0,n=i.length;t<n;t++){e=i[t];if(e.textContent){r+=e.textContent}}return r}else{return null}},set:function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}});e.prototype.setParent=function(e){var t,n,i,r,o;this.parent=e;if(e){this.options=e.options;this.stringify=e.stringify}r=this.children;o=[];for(n=0,i=r.length;n<i;n++){t=r[n];o.push(t.setParent(this))}return o};e.prototype.element=function(e,t,n){var i,r,o,s,a,u,l,f,c,h,d;u=null;if(t===null&&n==null){c=[{},null],t=c[0],n=c[1]}if(t==null){t={}}t=p(t);if(!y(t)){h=[t,n],n=h[0],t=h[1]}if(e!=null){e=p(e)}if(Array.isArray(e)){for(o=0,l=e.length;o<l;o++){r=e[o];u=this.element(r)}}else if(m(e)){u=this.element(e.apply())}else if(y(e)){for(a in e){if(!P.call(e,a))continue;d=e[a];if(m(d)){d=d.apply()}if(!this.options.ignoreDecorators&&this.stringify.convertAttKey&&a.indexOf(this.stringify.convertAttKey)===0){u=this.attribute(a.substr(this.stringify.convertAttKey.length),d)}else if(!this.options.separateArrayItems&&Array.isArray(d)&&v(d)){u=this.dummy()}else if(y(d)&&v(d)){u=this.element(a)}else if(!this.options.keepNullNodes&&d==null){u=this.dummy()}else if(!this.options.separateArrayItems&&Array.isArray(d)){for(s=0,f=d.length;s<f;s++){r=d[s];i={};i[a]=r;u=this.element(i)}}else if(y(d)){if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&a.indexOf(this.stringify.convertTextKey)===0){u=this.element(d)}else{u=this.element(a);u.element(d)}}else{u=this.element(a,d)}}}else if(!this.options.keepNullNodes&&n===null){u=this.dummy()}else{if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&e.indexOf(this.stringify.convertTextKey)===0){u=this.text(n)}else if(!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&e.indexOf(this.stringify.convertCDataKey)===0){u=this.cdata(n)}else if(!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&e.indexOf(this.stringify.convertCommentKey)===0){u=this.comment(n)}else if(!this.options.ignoreDecorators&&this.stringify.convertRawKey&&e.indexOf(this.stringify.convertRawKey)===0){u=this.raw(n)}else if(!this.options.ignoreDecorators&&this.stringify.convertPIKey&&e.indexOf(this.stringify.convertPIKey)===0){u=this.instruction(e.substr(this.stringify.convertPIKey.length),n)}else{u=this.node(e,t,n)}}if(u==null){throw new Error("Could not create any elements with: "+e+". "+this.debugInfo())}return u};e.prototype.insertBefore=function(e,t,n){var i,r,o,s,a;if(e!=null?e.type:void 0){o=e;s=t;o.setParent(this);if(s){r=children.indexOf(s);a=children.splice(r);children.push(o);Array.prototype.push.apply(children,a)}else{children.push(o)}return o}else{if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(e))}r=this.parent.children.indexOf(this);a=this.parent.children.splice(r);i=this.parent.element(e,t,n);Array.prototype.push.apply(this.parent.children,a);return i}};e.prototype.insertAfter=function(e,t,n){var i,r,o;if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(e))}r=this.parent.children.indexOf(this);o=this.parent.children.splice(r+1);i=this.parent.element(e,t,n);Array.prototype.push.apply(this.parent.children,o);return i};e.prototype.remove=function(){var e,t;if(this.isRoot){throw new Error("Cannot remove the root element. "+this.debugInfo())}e=this.parent.children.indexOf(this);[].splice.apply(this.parent.children,[e,e-e+1].concat(t=[])),t;return this.parent};e.prototype.node=function(e,t,n){var i,r;if(e!=null){e=p(e)}t||(t={});t=p(t);if(!y(t)){r=[t,n],n=r[0],t=r[1]}i=new s(this,e,t);if(n!=null){i.text(n)}this.children.push(i);return i};e.prototype.text=function(e){var t;if(y(e)){this.element(e)}t=new c(this,e);this.children.push(t);return this};e.prototype.cdata=function(e){var t;t=new n(this,e);this.children.push(t);return this};e.prototype.comment=function(e){var t;t=new r(this,e);this.children.push(t);return this};e.prototype.commentBefore=function(e){var t,n,i;n=this.parent.children.indexOf(this);i=this.parent.children.splice(n);t=this.parent.comment(e);Array.prototype.push.apply(this.parent.children,i);return this};e.prototype.commentAfter=function(e){var t,n,i;n=this.parent.children.indexOf(this);i=this.parent.children.splice(n+1);t=this.parent.comment(e);Array.prototype.push.apply(this.parent.children,i);return this};e.prototype.raw=function(e){var t;t=new f(this,e);this.children.push(t);return this};e.prototype.dummy=function(){var e;e=new t(this);return e};e.prototype.instruction=function(e,t){var n,i,r,o,s;if(e!=null){e=p(e)}if(t!=null){t=p(t)}if(Array.isArray(e)){for(o=0,s=e.length;o<s;o++){n=e[o];this.instruction(n)}}else if(y(e)){for(n in e){if(!P.call(e,n))continue;i=e[n];this.instruction(n,i)}}else{if(m(t)){t=t.apply()}r=new l(this,e,t);this.children.push(r)}return this};e.prototype.instructionBefore=function(e,t){var n,i,r;i=this.parent.children.indexOf(this);r=this.parent.children.splice(i);n=this.parent.instruction(e,t);Array.prototype.push.apply(this.parent.children,r);return this};e.prototype.instructionAfter=function(e,t){var n,i,r;i=this.parent.children.indexOf(this);r=this.parent.children.splice(i+1);n=this.parent.instruction(e,t);Array.prototype.push.apply(this.parent.children,r);return this};e.prototype.declaration=function(e,t,n){var i,r;i=this.document();r=new o(i,e,t,n);if(i.children.length===0){i.children.unshift(r)}else if(i.children[0].type===h.Declaration){i.children[0]=r}else{i.children.unshift(r)}return i.root()||i};e.prototype.dtd=function(e,t){var n,i,r,o,s,a,u,l,f,c;i=this.document();r=new d(i,e,t);f=i.children;for(o=s=0,u=f.length;s<u;o=++s){n=f[o];if(n.type===h.DocType){i.children[o]=r;return r}}c=i.children;for(o=a=0,l=c.length;a<l;o=++a){n=c[o];if(n.isRoot){i.children.splice(o,0,r);return r}}i.children.push(r);return r};e.prototype.up=function(){if(this.isRoot){throw new Error("The root node has no parent. Use doc() if you need to get the document object.")}return this.parent};e.prototype.root=function(){var e;e=this;while(e){if(e.type===h.Document){return e.rootObject}else if(e.isRoot){return e}else{e=e.parent}}};e.prototype.document=function(){var e;e=this;while(e){if(e.type===h.Document){return e}else{e=e.parent}}};e.prototype.end=function(e){return this.document().end(e)};e.prototype.prev=function(){var e;e=this.parent.children.indexOf(this);if(e<1){throw new Error("Already at the first node. "+this.debugInfo())}return this.parent.children[e-1]};e.prototype.next=function(){var e;e=this.parent.children.indexOf(this);if(e===-1||e===this.parent.children.length-1){throw new Error("Already at the last node. "+this.debugInfo())}return this.parent.children[e+1]};e.prototype.importDocument=function(e){var t;t=e.root().clone();t.parent=this;t.isRoot=false;this.children.push(t);return this};e.prototype.debugInfo=function(e){var t,n;e=e||this.name;if(e==null&&!((t=this.parent)!=null?t.name:void 0)){return""}else if(e==null){return"parent: <"+this.parent.name+">"}else if(!((n=this.parent)!=null?n.name:void 0)){return"node: <"+e+">"}else{return"node: <"+e+">, parent: <"+this.parent.name+">"}};e.prototype.ele=function(e,t,n){return this.element(e,t,n)};e.prototype.nod=function(e,t,n){return this.node(e,t,n)};e.prototype.txt=function(e){return this.text(e)};e.prototype.dat=function(e){return this.cdata(e)};e.prototype.com=function(e){return this.comment(e)};e.prototype.ins=function(e,t){return this.instruction(e,t)};e.prototype.doc=function(){return this.document()};e.prototype.dec=function(e,t,n){return this.declaration(e,t,n)};e.prototype.e=function(e,t,n){return this.element(e,t,n)};e.prototype.n=function(e,t,n){return this.node(e,t,n)};e.prototype.t=function(e){return this.text(e)};e.prototype.d=function(e){return this.cdata(e)};e.prototype.c=function(e){return this.comment(e)};e.prototype.r=function(e){return this.raw(e)};e.prototype.i=function(e,t){return this.instruction(e,t)};e.prototype.u=function(){return this.up()};e.prototype.importXMLBuilder=function(e){return this.importDocument(e)};e.prototype.replaceChild=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};e.prototype.removeChild=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};e.prototype.appendChild=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};e.prototype.hasChildNodes=function(){return this.children.length!==0};e.prototype.cloneNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};e.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};e.prototype.isSupported=function(e,t){return true};e.prototype.hasAttributes=function(){return this.attribs.length!==0};e.prototype.compareDocumentPosition=function(e){var t,n;t=this;if(t===e){return 0}else if(this.document()!==e.document()){n=i.Disconnected|i.ImplementationSpecific;if(Math.random()<.5){n|=i.Preceding}else{n|=i.Following}return n}else if(t.isAncestor(e)){return i.Contains|i.Preceding}else if(t.isDescendant(e)){return i.Contains|i.Following}else if(t.isPreceding(e)){return i.Preceding}else{return i.Following}};e.prototype.isSameNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};e.prototype.lookupPrefix=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};e.prototype.isDefaultNamespace=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};e.prototype.lookupNamespaceURI=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};e.prototype.isEqualNode=function(e){var t,n,i;if(e.nodeType!==this.nodeType){return false}if(e.children.length!==this.children.length){return false}for(t=n=0,i=this.children.length-1;0<=i?n<=i:n>=i;t=0<=i?++n:--n){if(!this.children[t].isEqualNode(e.children[t])){return false}}return true};e.prototype.getFeature=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};e.prototype.setUserData=function(e,t,n){throw new Error("This DOM method is not implemented."+this.debugInfo())};e.prototype.getUserData=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};e.prototype.contains=function(e){if(!e){return false}return e===this||this.isDescendant(e)};e.prototype.isDescendant=function(e){var t,n,i,r,o;o=this.children;for(i=0,r=o.length;i<r;i++){t=o[i];if(e===t){return true}n=t.isDescendant(e);if(n){return true}}return false};e.prototype.isAncestor=function(e){return e.isDescendant(this)};e.prototype.isPreceding=function(e){var t,n;t=this.treePosition(e);n=this.treePosition(this);if(t===-1||n===-1){return false}else{return t<n}};e.prototype.isFollowing=function(e){var t,n;t=this.treePosition(e);n=this.treePosition(this);if(t===-1||n===-1){return false}else{return t>n}};e.prototype.treePosition=function(t){var n,i;i=0;n=false;this.foreachTreeNode(this.document(),function(e){i++;if(!n&&e===t){return n=true}});if(n){return i}else{return-1}};e.prototype.foreachTreeNode=function(e,t){var n,i,r,o,s;e||(e=this.document());o=e.children;for(i=0,r=o.length;i<r;i++){n=o[i];if(s=t(n)){return s}else{s=this.foreachTreeNode(n,t);if(s){return s}}}};return e}()}).call(this)},function(l,e){(function(){var e,t,n,i,s,r,o,a=[].slice,u={}.hasOwnProperty;e=function(){var e,t,n,i,r,o;o=arguments[0],r=2<=arguments.length?a.call(arguments,1):[];if(s(Object.assign)){Object.assign.apply(null,arguments)}else{for(e=0,n=r.length;e<n;e++){i=r[e];if(i!=null){for(t in i){if(!u.call(i,t))continue;o[t]=i[t]}}}}return o};s=function(e){return!!e&&Object.prototype.toString.call(e)==="[object Function]"};r=function(e){var t;return!!e&&((t=typeof e)==="function"||t==="object")};n=function(e){if(s(Array.isArray)){return Array.isArray(e)}else{return Object.prototype.toString.call(e)==="[object Array]"}};i=function(e){var t;if(n(e)){return!e.length}else{for(t in e){if(!u.call(e,t))continue;return false}return true}};o=function(e){var t,n;return r(e)&&(n=Object.getPrototypeOf(e))&&(t=n.constructor)&&typeof t==="function"&&t instanceof t&&Function.prototype.toString.call(t)===Function.prototype.toString.call(Object)};t=function(e){if(s(e.valueOf)){return e.valueOf()}else{return e}};l.exports.assign=e;l.exports.isFunction=s;l.exports.isObject=r;l.exports.isArray=n;l.exports.isEmpty=i;l.exports.isPlainObject=o;l.exports.getValue=t}).call(this)},function(e,t,n){"use strict";var i=typeof Uint8Array!=="undefined"&&typeof Uint16Array!=="undefined"&&typeof Int32Array!=="undefined";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){var t=Array.prototype.slice.call(arguments,1);while(t.length){var n=t.shift();if(!n){continue}if(typeof n!=="object"){throw new TypeError(n+"must be non-object")}for(var i in n){if(r(n,i)){e[i]=n[i]}}}return e};t.shrinkBuf=function(e,t){if(e.length===t){return e}if(e.subarray){return e.subarray(0,t)}e.length=t;return e};var o={arraySet:function(e,t,n,i,r){if(t.subarray&&e.subarray){e.set(t.subarray(n,n+i),r);return}for(var o=0;o<i;o++){e[r+o]=t[n+o]}},flattenChunks:function(e){var t,n,i,r,o,s;i=0;for(t=0,n=e.length;t<n;t++){i+=e[t].length}s=new Uint8Array(i);r=0;for(t=0,n=e.length;t<n;t++){o=e[t];s.set(o,r);r+=o.length}return s}};var s={arraySet:function(e,t,n,i,r){for(var o=0;o<i;o++){e[r+o]=t[n+o]}},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){if(e){t.Buf8=Uint8Array;t.Buf16=Uint16Array;t.Buf32=Int32Array;t.assign(t,o)}else{t.Buf8=Array;t.Buf16=Array;t.Buf32=Array;t.assign(t,s)}};t.setTyped(i)},function(e,t,n){"use strict";var i=n(15);var r=Object.keys||function(e){var t=[];for(var n in e){t.push(n)}return t};e.exports=c;var o=Object.create(n(9));o.inherits=n(7);var s=n(53);var a=n(36);o.inherits(c,s);{var u=r(a.prototype);for(var l=0;l<u.length;l++){var f=u[l];if(!c.prototype[f])c.prototype[f]=a.prototype[f]}}function c(e){if(!(this instanceof c))return new c(e);s.call(this,e);a.call(this,e);if(e&&e.readable===false)this.readable=false;if(e&&e.writable===false)this.writable=false;this.allowHalfOpen=true;if(e&&e.allowHalfOpen===false)this.allowHalfOpen=false;this.once("end",h)}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:false,get:function(){return this._writableState.highWaterMark}});function h(){if(this.allowHalfOpen||this._writableState.ended)return;i.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(c.prototype,"destroyed",{get:function(){if(this._readableState===undefined||this._writableState===undefined){return false}return this._readableState.destroyed&&this._writableState.destroyed},set:function(e){if(this._readableState===undefined||this._writableState===undefined){return}this._readableState.destroyed=e;this._writableState.destroyed=e}});c.prototype._destroy=function(e,t){this.push(null);this.end();i.nextTick(t,e)}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(i){if(typeof window==="object")n=window}e.exports=n},function(e,t){if(typeof Object.create==="function"){e.exports=function i(e,t){if(t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}}else{e.exports=function i(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype;e.prototype=new n;e.prototype.constructor=e}}}},function(e,t,n){var i=n(64);var r=n(65);var o=r;o.v1=i;o.v4=r;e.exports=o},function(e,t,n){function i(e){if(Array.isArray){return Array.isArray(e)}return y(e)==="[object Array]"}t.isArray=i;function r(e){return typeof e==="boolean"}t.isBoolean=r;function o(e){return e===null}t.isNull=o;function s(e){return e==null}t.isNullOrUndefined=s;function a(e){return typeof e==="number"}t.isNumber=a;function u(e){return typeof e==="string"}t.isString=u;function l(e){return typeof e==="symbol"}t.isSymbol=l;function f(e){return e===void 0}t.isUndefined=f;function c(e){return y(e)==="[object RegExp]"}t.isRegExp=c;function h(e){return typeof e==="object"&&e!==null}t.isObject=h;function d(e){return y(e)==="[object Date]"}t.isDate=d;function p(e){return y(e)==="[object Error]"||e instanceof Error}t.isError=p;function v(e){return typeof e==="function"}t.isFunction=v;function m(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}t.isPrimitive=m;t.isBuffer=n(34).Buffer.isBuffer;function y(e){return Object.prototype.toString.call(e)}},function(e,r,t){"use strict";(function(C){Object.defineProperty(r,"__esModule",{value:true});var n=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(e,t,n){if(t)i(e.prototype,t);if(n)i(e,n);return e}}();function i(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var e=function(){function e(){i(this,e)}n(e,[{key:"browser",value:function f(){var e=/(edge)[/]([\w.]+)/;var t=/(chrome)[/]([\w.]+)/;var n=/(safari)[/]([\w.]+)/;var i=/(opera)(?:.*version)?[/]([\w.]+)/;var r=/(msie) ([\w.]+)/;var o=/(trident.*rv:)([\w.]+)/;var s=/(mozilla)(?:.*? rv:([\w.]+))?/;var a=navigator.userAgent.toLowerCase();var u=e.exec(a)||t.exec(a)||n.exec(a)||i.exec(a)||r.exec(a)||o.exec(a)||a.indexOf("compatible")<0&&s.exec(a)||["unknow","0"];if(u.length>0&&u[1].indexOf("trident")>-1){u[1]="msie"}var l={};l[u[1]]=true;l.version=u[2];return l}},{key:"getCreateWndMode",value:function o(){var e=navigator.userAgent;var t=navigator.platform;var n="Win64"===t||"Win32"===t||"Windows"===t;var i=this.browser();var r=true;if(window.top!==window){r=false}else{if(n){if(e.indexOf("Windows NT 10.0")>-1&&i.mozilla){r=false}if(i.edge){r=false}}else{r=false}}return r}},{key:"getWndPostion",value:function b(e,t,n,i,r){var o=0;var s=0;var a=e.offset();var u=this.getDevicePixelRatio();var l=parseInt(e.css("border-left-width"),10);var f=parseInt(e.css("border-top-width"),10);if(t){if(this.browser().msie){var c=window.outerWidth-window.innerWidth-(window.screenLeft-window.screenX);o=a.left+(window.screenLeft-window.screenX)+l-c;s=a.top+(window.screenTop-window.screenY)+f}else{var h=0;var d=0;var p=Math.round((window.outerWidth-window.innerWidth)/2);if(this.browser().chrome){if(-8===p||0===window.screen.height-window.outerHeight){if(-8===p){h=8;d=8}}else if(8===p){h=-5}else if(0===p){d=8}}if(this.browser().mozilla){if(7===p||6===p){h=-6}else if(8===p){h=-8}else if(0===p){}if(window.opener){h=h-8;d=d-30;if(8===p){h=h+8}}}o=a.left+p+l+h;s=a.top+(window.outerHeight-window.innerHeight-p)+f+d}}else{if(this.browser().msie){var v=window.outerWidth-window.innerWidth-(window.screenLeft-window.screenX);o=a.left+(window.screenLeft-window.screenX)+l-v;s=a.top+(window.screenTop-window.screenY)+f}else{var m=(window.outerWidth-window.innerWidth)/2;o=a.left+m+l;s=a.top+(window.outerHeight-window.innerHeight-m)+f;if(this.browser().chrome){if(0===m){o+=8;s+=8}}}}if(this.browser().chrome){o=a.left+l;s=a.top+f}var y=0;var g=0;if(n&&C("#"+n).length){var P=C("#"+n).offset();if(!this.browser().msie){y=window.scrollX;g=window.scrollY}var w=Math.round((P.left-y)*u);var S=Math.round((P.top-g)*u);o+=w;s+=S}else{if(!this.browser().msie){y=window.scrollX;g=window.scrollY}o=Math.round((o-y)*u);s=Math.round((s-g)*u)}if(i){var _=parent.$("#"+r).offset();o+=_.left;s+=_.top;y=0;g=0;if(!this.browser().msie){y=parent.window.scrollX;g=parent.window.scrollY}o=Math.round((o-y)*u);s=Math.round((s-g)*u)}return{left:o,top:s}}},{key:"detectPort",value:function m(e,t,i){var r=this;var o=[];var n=null;if(sessionStorage){n=parseInt(sessionStorage.getItem("LocalServiceControlPort"),10);if(n!==null){if(e<=n&&n<=t){n=parseInt(n,10)}else{sessionStorage.removeItem("LocalServiceControlPort");n=null}}}for(var s=e;s<=t;s++){if(s===n){continue}o.push(s)}if(n!==null){o.unshift(n)}var a=0;var u=function u(){a++;if(o.length===a&&i.error){i.error()}};var l=function l(e){if(sessionStorage){sessionStorage.setItem("LocalServiceControlPort",e)}if(i.success){i.success(e)}};var f=(new Date).getTime();if(o.length){if(navigator.userAgent.toLowerCase().indexOf("firefox")>0){var c=function c(e,n){setTimeout(function(){r.createImageHttp(o[n],{oSessionInfo:i.oSessionInfo,timeStamp:f+n,success:function t(e){l(e)},error:function e(){u()}})},100)};for(var h=0,d=o.length;h<d;h++){c(d,h)}}else{r.createWebsocketDetectPort(o[0],{oSessionInfo:i.oSessionInfo,timeStamp:f+0,success:function p(e){l(e)},error:function v(){u();var n=function n(e,t){setTimeout(function(){r.createWebsocketDetectPort(o[t],{oSessionInfo:i.oSessionInfo,timeStamp:f+t,success:function p(e){l(e)},error:function v(){u()}})},100)};for(var e=1,t=o.length;e<t;e++){n(t,e)}}})}}}},{key:"createImageHttp",value:function s(e,t){var n=new Image;n.onload=function(){if(t.success){t.success(e)}};n.onerror=function(){if(t.error){t.error()}};n.onabort=function(){if(t.abort){t.abort()}};var i="http://127.0.0.1:"+e+"/imghttp/local?update="+t.timeStamp;var r=t.oSessionInfo;if(r){i+="&sessionID="+r.sessionID+"&user="+encodeURIComponent(r.user)+"&challenge="+r.challenge+"&iterations="+r.iterations+"&random="+r.random;n.src=i}}},{key:"createWebsocketDetectPort",value:function a(t,n){var i=n.oSessionInfo;if(i){var e="ws://127.0.0.1:"+t;var r=new WebSocket(e);var o=-1;r.onopen=function(){var e={cmd:"detectport",sessionID:i.sessionID,user:encodeURIComponent(i.user),challenge:i.challenge,iterations:i.iterations,random:i.random};r.send(JSON.stringify(e));o=setTimeout(function(){n.error();r.close()},2e3)};r.onmessage=function(e){if(JSON.parse(e.data)&&JSON.parse(e.data).errorCode===0){n.success(t)}else{n.error()}r.close();clearTimeout(o);o=-1};r.onerror=function(){n.error();clearTimeout(o);o=-1}}}},{key:"utf8to16",value:function u(e){var t="";var n=0;var i=void 0;var r=void 0;var o=void 0;var s=void 0;i=e.length;while(n<i){r=e.charCodeAt(n++);switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t+=e.charAt(n-1);break;case 12:case 13:o=e.charCodeAt(n++);t+=String.fromCharCode((r&31)<<6|o&63);break;case 14:o=e.charCodeAt(n++);s=e.charCodeAt(n++);t+=String.fromCharCode((r&15)<<12|(o&63)<<6|(s&63)<<0);break;default:break}}return t}},{key:"createEventScript",value:function r(e,t,n){var i=document.createElement("script");i.htmlFor=e;i.event=t;i.innerHTML=n;document.getElementById(e).appendChild(i)}},{key:"getDevicePixelRatio",value:function t(){var e=window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI;return e}},{key:"createxmlDoc",value:function l(){var e;var t=["MSXML2.DOMDocument","MSXML2.DOMDocument.5.0","MSXML2.DOMDocument.4.0","MSXML2.DOMDocument.3.0","Microsoft.XmlDom"];for(var n=0,i=t.length;n<i;n++){try{e=new ActiveXObject(t[n]);break}catch(r){e=document.implementation.createDocument("","",null);break}}e["async"]="false";return e}},{key:"parseXmlFromStr",value:function c(e){if(null===e||""===e){return null}e=e.replace(/&(?!lt;|amp;|gt;|apos;|quot;)/g,"&amp;");var t=null;try{if(window.navigator.userAgent.indexOf("MSIE 9.0")>0){t=new ActiveXObject("Microsoft.XMLDOM");t["async"]=false;t.loadXML(e)}else{var n=new DOMParser;t=n.parseFromString(e,"text/xml")}}catch(i){t=new ActiveXObject("Microsoft.XMLDOM");t["async"]=false;t.loadXML(e)}return t}}]);return e}();var t=r.oUtils=new e}).call(this,t(1))},function(i,e,o){(function(){var e,t,n=function(e,t){for(var n in t){if(r.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},r={}.hasOwnProperty;t=o(2);i.exports=e=function(e){n(t,e);function t(e){t.__super__.constructor.call(this,e);this.value=""}Object.defineProperty(t.prototype,"data",{get:function(){return this.value},set:function(e){return this.value=e||""}});Object.defineProperty(t.prototype,"length",{get:function(){return this.value.length}});Object.defineProperty(t.prototype,"textContent",{get:function(){return this.value},set:function(e){return this.value=e||""}});t.prototype.clone=function(){return Object.create(this)};t.prototype.substringData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.appendData=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.insertData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.deleteData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.replaceData=function(e,t,n){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.isEqualNode=function(e){if(!t.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)){return false}if(e.data!==this.data){return false}return true};return t}(t)}).call(this)},function(e,t){(function(){e.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(this)},function(e,t,n){"use strict";var i=typeof Reflect==="object"?Reflect:null;var f=i&&typeof i.apply==="function"?i.apply:function f(e,t,n){return Function.prototype.apply.call(e,t,n)};var r;if(i&&typeof i.ownKeys==="function"){r=i.ownKeys}else if(Object.getOwnPropertySymbols){r=function r(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}}else{r=function r(e){return Object.getOwnPropertyNames(e)}}function u(e){if(console&&console.warn)console.warn(e)}var o=Number.isNaN||function o(e){return e!==e};function s(){s.init.call(this)}e.exports=s;e.exports.once=w;s.EventEmitter=s;s.prototype._events=undefined;s.prototype._eventsCount=0;s.prototype._maxListeners=undefined;var a=10;function l(e){if(typeof e!=="function"){throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:true,get:function(){return a},set:function(e){if(typeof e!=="number"||e<0||o(e)){throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".")}a=e}});s.init=function(){if(this._events===undefined||this._events===Object.getPrototypeOf(this)._events){this._events=Object.create(null);this._eventsCount=0}this._maxListeners=this._maxListeners||undefined};s.prototype.setMaxListeners=function b(e){if(typeof e!=="number"||e<0||o(e)){throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".")}this._maxListeners=e;return this};function c(e){if(e._maxListeners===undefined)return s.defaultMaxListeners;return e._maxListeners}s.prototype.getMaxListeners=function C(){return c(this)};s.prototype.emit=function k(e){var t=[];for(var n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e==="error";var r=this._events;if(r!==undefined)i=i&&r.error===undefined;else if(!i)return false;if(i){var o;if(t.length>0)o=t[0];if(o instanceof Error){throw o}var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));s.context=o;throw s}var a=r[e];if(a===undefined)return false;if(typeof a==="function"){f(a,this,t)}else{var u=a.length;var l=y(a,u);for(var n=0;n<u;++n)f(l[n],this,t)}return true};function h(e,t,n,i){var r;var o;var s;l(n);o=e._events;if(o===undefined){o=e._events=Object.create(null);e._eventsCount=0}else{if(o.newListener!==undefined){e.emit("newListener",t,n.listener?n.listener:n);o=e._events}s=o[t]}if(s===undefined){s=o[t]=n;++e._eventsCount}else{if(typeof s==="function"){s=o[t]=i?[n,s]:[s,n]}else if(i){s.unshift(n)}else{s.push(n)}r=c(e);if(r>0&&s.length>r&&!s.warned){s.warned=true;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners "+"added. Use emitter.setMaxListeners() to "+"increase limit");a.name="MaxListenersExceededWarning";a.emitter=e;a.type=t;a.count=s.length;u(a)}}return e}s.prototype.addListener=function T(e,t){return h(this,e,t,false)};s.prototype.on=s.prototype.addListener;s.prototype.prependListener=function R(e,t){return h(this,e,t,true)};function d(){if(!this.fired){this.target.removeListener(this.type,this.wrapFn);this.fired=true;if(arguments.length===0)return this.listener.call(this.target);return this.listener.apply(this.target,arguments)}}function p(e,t,n){var i={fired:false,wrapFn:undefined,target:e,type:t,listener:n};var r=d.bind(i);r.listener=n;i.wrapFn=r;return r}s.prototype.once=function w(e,t){l(t);this.on(e,p(this,e,t));return this};s.prototype.prependOnceListener=function D(e,t){l(t);this.prependListener(e,p(this,e,t));return this};s.prototype.removeListener=function x(e,t){var n,i,r,o,s;l(t);i=this._events;if(i===undefined)return this;n=i[e];if(n===undefined)return this;if(n===t||n.listener===t){if(--this._eventsCount===0)this._events=Object.create(null);else{delete i[e];if(i.removeListener)this.emit("removeListener",e,n.listener||t)}}else if(typeof n!=="function"){r=-1;for(o=n.length-1;o>=0;o--){if(n[o]===t||n[o].listener===t){s=n[o].listener;r=o;break}}if(r<0)return this;if(r===0)n.shift();else{g(n,r)}if(n.length===1)i[e]=n[0];if(i.removeListener!==undefined)this.emit("removeListener",e,s||t)}return this};s.prototype.off=s.prototype.removeListener;s.prototype.removeAllListeners=function I(e){var t,n,i;n=this._events;if(n===undefined)return this;if(n.removeListener===undefined){if(arguments.length===0){this._events=Object.create(null);this._eventsCount=0}else if(n[e]!==undefined){if(--this._eventsCount===0)this._events=Object.create(null);else delete n[e]}return this}if(arguments.length===0){var r=Object.keys(n);var o;for(i=0;i<r.length;++i){o=r[i];if(o==="removeListener")continue;this.removeAllListeners(o)}this.removeAllListeners("removeListener");this._events=Object.create(null);this._eventsCount=0;return this}t=n[e];if(typeof t==="function"){this.removeListener(e,t)}else if(t!==undefined){for(i=t.length-1;i>=0;i--){this.removeListener(e,t[i])}}return this};function v(e,t,n){var i=e._events;if(i===undefined)return[];var r=i[t];if(r===undefined)return[];if(typeof r==="function")return n?[r.listener||r]:[r];return n?P(r):y(r,r.length)}s.prototype.listeners=function E(e){return v(this,e,true)};s.prototype.rawListeners=function q(e){return v(this,e,false)};s.listenerCount=function(e,t){if(typeof e.listenerCount==="function"){return e.listenerCount(t)}else{return m.call(e,t)}};s.prototype.listenerCount=m;function m(e){var t=this._events;if(t!==undefined){var n=t[e];if(typeof n==="function"){return 1}else if(n!==undefined){return n.length}}return 0}s.prototype.eventNames=function A(){return this._eventsCount>0?r(this._events):[]};function y(e,t){var n=new Array(t);for(var i=0;i<t;++i)n[i]=e[i];return n}function g(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function P(e){var t=new Array(e.length);for(var n=0;n<t.length;++n){t[n]=e[n].listener||e[n]}return t}function w(r,o){return new Promise(function(e,t){function n(e){r.removeListener(o,i);t(e)}function i(){if(typeof r.removeListener==="function"){r.removeListener("error",n)}e([].slice.call(arguments))}_(r,o,i,{once:true});if(o!=="error"){S(r,n,{once:true})}})}function S(e,t,n){if(typeof e.on==="function"){_(e,"error",t,n)}}function _(t,n,i,r){if(typeof t.on==="function"){if(r.once){t.once(n,i)}else{t.on(n,i)}}else if(typeof t.addEventListener==="function"){t.addEventListener(n,function o(e){if(r.once){t.removeEventListener(n,o)}i(e)})}else{throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}}},function(e,t){var n=e.exports={};var i;var r;function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){i=setTimeout}else{i=o}}catch(e){i=o}try{if(typeof clearTimeout==="function"){r=clearTimeout}else{r=s}}catch(e){r=s}})();function a(e){if(i===setTimeout){return setTimeout(e,0)}if((i===o||!i)&&setTimeout){i=setTimeout;return setTimeout(e,0)}try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}function u(e){if(r===clearTimeout){return clearTimeout(e)}if((r===s||!r)&&clearTimeout){r=clearTimeout;return clearTimeout(e)}try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}var l=[];var f=false;var c;var h=-1;function d(){if(!f||!c){return}f=false;if(c.length){l=c.concat(l)}else{h=-1}if(l.length){p()}}function p(){if(f){return}var e=a(d);f=true;var t=l.length;while(t){c=l;l=[];while(++h<t){if(c){c[h].run()}}h=-1;t=l.length}c=null;f=false;u(e)}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1){for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}}l.push(new v(e,t));if(l.length===1&&!f){a(p)}};function v(e,t){this.fun=e;this.array=t}v.prototype.run=function(){this.fun.apply(null,this.array)};n.title="browser";n.browser=true;n.env={};n.argv=[];n.version="";n.versions={};function m(){}n.on=m;n.addListener=m;n.once=m;n.off=m;n.removeListener=m;n.removeAllListeners=m;n.emit=m;n.prependListener=m;n.prependOnceListener=m;n.listeners=function(e){return[]};n.binding=function(e){throw new Error("process.binding is not supported")};n.cwd=function(){return"/"};n.chdir=function(e){throw new Error("process.chdir is not supported")};n.umask=function(){return 0}},function(t,e,n){"use strict";(function(c){if(typeof c==="undefined"||!c.version||c.version.indexOf("v0.")===0||c.version.indexOf("v1.")===0&&c.version.indexOf("v1.8.")!==0){t.exports={nextTick:e}}else{t.exports=c}function e(e,t,n,i){if(typeof e!=="function"){throw new TypeError('"callback" argument must be a function')}var r=arguments.length;var o,s;switch(r){case 0:case 1:return c.nextTick(e);case 2:return c.nextTick(function a(){e.call(null,t)});case 3:return c.nextTick(function u(){e.call(null,t,n)});case 4:return c.nextTick(function l(){e.call(null,t,n,i)});default:o=new Array(r-1);s=0;while(s<o.length){o[s++]=arguments[s]}return c.nextTick(function f(){e.apply(null,o)})}}}).call(this,n(14))},function(e,t,n){var i=n(34);var r=i.Buffer;function o(e,t){for(var n in e){t[n]=e[n]}}if(r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow){e.exports=i}else{o(i,t);t.Buffer=s}function s(e,t,n){return r(e,t,n)}o(r,s);s.from=function(e,t,n){if(typeof e==="number"){throw new TypeError("Argument must not be a number")}return r(e,t,n)};s.alloc=function(e,t,n){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}var i=r(e);if(t!==undefined){if(typeof n==="string"){i.fill(t,n)}else{i.fill(t)}}else{i.fill(0)}return i};s.allocUnsafe=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return r(e)};s.allocUnsafeSlow=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return i.SlowBuffer(e)}},function(e,t,n){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(e,s,a){(function(){"use strict";var e,t,n,i,r=function(e,t){for(var n in t){if(o.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},o={}.hasOwnProperty;t=a(19);e=a(89);n=a(98);i=a(58);s.defaults=t.defaults;s.processors=i;s.ValidationError=function(e){r(t,e);function t(e){this.message=e}return t}(Error);s.Builder=e.Builder;s.Parser=n.Parser;s.parseString=n.parseString;s.parseStringPromise=n.parseStringPromise}).call(this)},function(e,t){(function(){t.defaults={.1:{explicitCharkey:false,trim:true,normalize:true,normalizeTags:false,attrkey:"@",charkey:"#",explicitArray:false,ignoreAttrs:false,mergeAttrs:false,explicitRoot:false,validator:null,xmlns:false,explicitChildren:false,childkey:"@@",charsAsChildren:false,includeWhiteChars:false,"async":false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:false,trim:false,normalize:false,normalizeTags:false,attrkey:"$",charkey:"_",explicitArray:true,ignoreAttrs:false,mergeAttrs:false,explicitRoot:true,validator:null,xmlns:false,explicitChildren:false,preserveChildrenOrder:false,childkey:"$$",charsAsChildren:false,includeWhiteChars:false,"async":false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:true},doctype:null,renderOpts:{pretty:true,indent:"  ",newline:"\n"},headless:false,chunkSize:1e4,emptyTag:"",cdata:false}}}).call(this)},function(a,e,h){(function(){var u,r,e,t,n,o,s,l,i,f=function(e,t){for(var n in t){if(c.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},c={}.hasOwnProperty;i=h(3),l=i.isObject,s=i.isFunction,o=i.getValue;n=h(2);u=h(0);r=h(48);t=h(21);a.exports=e=function(e){f(a,e);function a(e,t,n){var i,r,o,s;a.__super__.constructor.call(this,e);if(t==null){throw new Error("Missing element name. "+this.debugInfo())}this.name=this.stringify.name(t);this.type=u.Element;this.attribs={};this.schemaTypeInfo=null;if(n!=null){this.attribute(n)}if(e.type===u.Document){this.isRoot=true;this.documentObject=e;e.rootObject=this;if(e.children){s=e.children;for(r=0,o=s.length;r<o;r++){i=s[r];if(i.type===u.DocType){i.name=this.name;break}}}}}Object.defineProperty(a.prototype,"tagName",{get:function(){return this.name}});Object.defineProperty(a.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(a.prototype,"prefix",{get:function(){return""}});Object.defineProperty(a.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(a.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(a.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(a.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(a.prototype,"attributes",{get:function(){if(!this.attributeMap||!this.attributeMap.nodes){this.attributeMap=new t(this.attribs)}return this.attributeMap}});a.prototype.clone=function(){var e,t,n,i;n=Object.create(this);if(n.isRoot){n.documentObject=null}n.attribs={};i=this.attribs;for(t in i){if(!c.call(i,t))continue;e=i[t];n.attribs[t]=e.clone()}n.children=[];this.children.forEach(function(e){var t;t=e.clone();t.parent=n;return n.children.push(t)});return n};a.prototype.attribute=function(e,t){var n,i;if(e!=null){e=o(e)}if(l(e)){for(n in e){if(!c.call(e,n))continue;i=e[n];this.attribute(n,i)}}else{if(s(t)){t=t.apply()}if(this.options.keepNullAttributes&&t==null){this.attribs[e]=new r(this,e,"")}else if(t!=null){this.attribs[e]=new r(this,e,t)}}return this};a.prototype.removeAttribute=function(e){var t,n,i;if(e==null){throw new Error("Missing attribute name. "+this.debugInfo())}e=o(e);if(Array.isArray(e)){for(n=0,i=e.length;n<i;n++){t=e[n];delete this.attribs[t]}}else{delete this.attribs[e]}return this};a.prototype.toString=function(e){return this.options.writer.element(this,this.options.writer.filterOptions(e))};a.prototype.att=function(e,t){return this.attribute(e,t)};a.prototype.a=function(e,t){return this.attribute(e,t)};a.prototype.getAttribute=function(e){if(this.attribs.hasOwnProperty(e)){return this.attribs[e].value}else{return null}};a.prototype.setAttribute=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};a.prototype.getAttributeNode=function(e){if(this.attribs.hasOwnProperty(e)){return this.attribs[e]}else{return null}};a.prototype.setAttributeNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};a.prototype.removeAttributeNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};a.prototype.getElementsByTagName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};a.prototype.getAttributeNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};a.prototype.setAttributeNS=function(e,t,n){throw new Error("This DOM method is not implemented."+this.debugInfo())};a.prototype.removeAttributeNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};a.prototype.getAttributeNodeNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};a.prototype.setAttributeNodeNS=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};a.prototype.getElementsByTagNameNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};a.prototype.hasAttribute=function(e){return this.attribs.hasOwnProperty(e)};a.prototype.hasAttributeNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};a.prototype.setIdAttribute=function(e,t){if(this.attribs.hasOwnProperty(e)){return this.attribs[e].isId}else{return t}};a.prototype.setIdAttributeNS=function(e,t,n){throw new Error("This DOM method is not implemented."+this.debugInfo())};a.prototype.setIdAttributeNode=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};a.prototype.getElementsByTagName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};a.prototype.getElementsByTagNameNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};a.prototype.getElementsByClassName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};a.prototype.isEqualNode=function(e){var t,n,i;if(!a.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)){return false}if(e.namespaceURI!==this.namespaceURI){return false}if(e.prefix!==this.prefix){return false}if(e.localName!==this.localName){return false}if(e.attribs.length!==this.attribs.length){return false}for(t=n=0,i=this.attribs.length-1;0<=i?n<=i:n>=i;t=0<=i?++n:--n){if(!this.attribs[t].isEqualNode(e.attribs[t])){return false}}return true};return a}(n)}).call(this)},function(t,e){(function(){var e;t.exports=e=function(){function e(e){this.nodes=e}Object.defineProperty(e.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}});e.prototype.clone=function(){return this.nodes=null};e.prototype.getNamedItem=function(e){return this.nodes[e]};e.prototype.setNamedItem=function(e){var t;t=this.nodes[e.nodeName];this.nodes[e.nodeName]=e;return t||null};e.prototype.removeNamedItem=function(e){var t;t=this.nodes[e];delete this.nodes[e];return t||null};e.prototype.item=function(e){return this.nodes[Object.keys(this.nodes)[e]]||null};e.prototype.getNamedItemNS=function(e,t){throw new Error("This DOM method is not implemented.")};e.prototype.setNamedItemNS=function(e){throw new Error("This DOM method is not implemented.")};e.prototype.removeNamedItemNS=function(e,t){throw new Error("This DOM method is not implemented.")};return e}()}).call(this)},function(n,e,s){(function(){var i,e,t,r=function(e,t){for(var n in t){if(o.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},o={}.hasOwnProperty;i=s(0);t=s(11);n.exports=e=function(e){r(n,e);function n(e,t){n.__super__.constructor.call(this,e);if(t==null){throw new Error("Missing CDATA text. "+this.debugInfo())}this.name="#cdata-section";this.type=i.CData;this.value=this.stringify.cdata(t)}n.prototype.clone=function(){return Object.create(this)};n.prototype.toString=function(e){return this.options.writer.cdata(this,this.options.writer.filterOptions(e))};return n}(t)}).call(this)},function(n,e,s){(function(){var i,e,t,r=function(e,t){for(var n in t){if(o.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},o={}.hasOwnProperty;i=s(0);e=s(11);n.exports=t=function(e){r(n,e);function n(e,t){n.__super__.constructor.call(this,e);if(t==null){throw new Error("Missing comment text. "+this.debugInfo())}this.name="#comment";this.type=i.Comment;this.value=this.stringify.comment(t)}n.prototype.clone=function(){return Object.create(this)};n.prototype.toString=function(e){return this.options.writer.comment(this,this.options.writer.filterOptions(e))};return n}(e)}).call(this)},function(i,e,o){(function(){var s,e,t,a,n=function(e,t){for(var n in t){if(r.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},r={}.hasOwnProperty;a=o(3).isObject;t=o(2);s=o(0);i.exports=e=function(e){n(o,e);function o(e,t,n,i){var r;o.__super__.constructor.call(this,e);if(a(t)){r=t,t=r.version,n=r.encoding,i=r.standalone}if(!t){t="1.0"}this.type=s.Declaration;this.version=this.stringify.xmlVersion(t);if(n!=null){this.encoding=this.stringify.xmlEncoding(n)}if(i!=null){this.standalone=this.stringify.xmlStandalone(i)}}o.prototype.toString=function(e){return this.options.writer.declaration(this,this.options.writer.filterOptions(e))};return o}(t)}).call(this)},function(l,e,h){(function(){var f,s,i,r,o,e,a,t,c,n=function(e,t){for(var n in t){if(u.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},u={}.hasOwnProperty;c=h(3).isObject;t=h(2);f=h(0);s=h(26);r=h(27);i=h(28);o=h(29);a=h(21);l.exports=e=function(e){n(l,e);function l(e,t,n){var i,r,o,s,a,u;l.__super__.constructor.call(this,e);this.type=f.DocType;if(e.children){s=e.children;for(r=0,o=s.length;r<o;r++){i=s[r];if(i.type===f.Element){this.name=i.name;break}}}this.documentObject=e;if(c(t)){a=t,t=a.pubID,n=a.sysID}if(n==null){u=[t,n],n=u[0],t=u[1]}if(t!=null){this.pubID=this.stringify.dtdPubID(t)}if(n!=null){this.sysID=this.stringify.dtdSysID(n)}}Object.defineProperty(l.prototype,"entities",{get:function(){var e,t,n,i,r;i={};r=this.children;for(t=0,n=r.length;t<n;t++){e=r[t];if(e.type===f.EntityDeclaration&&!e.pe){i[e.name]=e}}return new a(i)}});Object.defineProperty(l.prototype,"notations",{get:function(){var e,t,n,i,r;i={};r=this.children;for(t=0,n=r.length;t<n;t++){e=r[t];if(e.type===f.NotationDeclaration){i[e.name]=e}}return new a(i)}});Object.defineProperty(l.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(l.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(l.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});l.prototype.element=function(e,t){var n;n=new i(this,e,t);this.children.push(n);return this};l.prototype.attList=function(e,t,n,i,r){var o;o=new s(this,e,t,n,i,r);this.children.push(o);return this};l.prototype.entity=function(e,t){var n;n=new r(this,false,e,t);this.children.push(n);return this};l.prototype.pEntity=function(e,t){var n;n=new r(this,true,e,t);this.children.push(n);return this};l.prototype.notation=function(e,t){var n;n=new o(this,e,t);this.children.push(n);return this};l.prototype.toString=function(e){return this.options.writer.docType(this,this.options.writer.filterOptions(e))};l.prototype.ele=function(e,t){return this.element(e,t)};l.prototype.att=function(e,t,n,i,r){return this.attList(e,t,n,i,r)};l.prototype.ent=function(e,t){return this.entity(e,t)};l.prototype.pent=function(e,t){return this.pEntity(e,t)};l.prototype.not=function(e,t){return this.notation(e,t)};l.prototype.up=function(){return this.root()||this.documentObject};l.prototype.isEqualNode=function(e){if(!l.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)){return false}if(e.name!==this.name){return false}if(e.publicId!==this.publicId){return false}if(e.systemId!==this.systemId){return false}return true};return l}(t)}).call(this)},function(i,e,o){(function(){var a,e,t,n=function(e,t){for(var n in t){if(r.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},r={}.hasOwnProperty;t=o(2);a=o(0);i.exports=e=function(e){n(s,e);function s(e,t,n,i,r,o){s.__super__.constructor.call(this,e);if(t==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(n==null){throw new Error("Missing DTD attribute name. "+this.debugInfo(t))}if(!i){throw new Error("Missing DTD attribute type. "+this.debugInfo(t))}if(!r){throw new Error("Missing DTD attribute default. "+this.debugInfo(t))}if(r.indexOf("#")!==0){r="#"+r}if(!r.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)){throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(t))}if(o&&!r.match(/^(#FIXED|#DEFAULT)$/)){throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(t))}this.elementName=this.stringify.name(t);this.type=a.AttributeDeclaration;this.attributeName=this.stringify.name(n);this.attributeType=this.stringify.dtdAttType(i);if(o){this.defaultValue=this.stringify.dtdAttDefault(o)}this.defaultValueType=r}s.prototype.toString=function(e){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(e))};return s}(t)}).call(this)},function(i,e,a){(function(){var o,e,t,s,n=function(e,t){for(var n in t){if(r.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},r={}.hasOwnProperty;s=a(3).isObject;t=a(2);o=a(0);i.exports=e=function(e){n(r,e);function r(e,t,n,i){r.__super__.constructor.call(this,e);if(n==null){throw new Error("Missing DTD entity name. "+this.debugInfo(n))}if(i==null){throw new Error("Missing DTD entity value. "+this.debugInfo(n))}this.pe=!!t;this.name=this.stringify.name(n);this.type=o.EntityDeclaration;if(!s(i)){this.value=this.stringify.dtdEntityValue(i);this.internal=true}else{if(!i.pubID&&!i.sysID){throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(n))}if(i.pubID&&!i.sysID){throw new Error("System identifier is required for a public external entity. "+this.debugInfo(n))}this.internal=false;if(i.pubID!=null){this.pubID=this.stringify.dtdPubID(i.pubID)}if(i.sysID!=null){this.sysID=this.stringify.dtdSysID(i.sysID)}if(i.nData!=null){this.nData=this.stringify.dtdNData(i.nData)}if(this.pe&&this.nData){throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(n))}}}Object.defineProperty(r.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(r.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(r.prototype,"notationName",{get:function(){return this.nData||null}});Object.defineProperty(r.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(r.prototype,"xmlEncoding",{get:function(){return null}});Object.defineProperty(r.prototype,"xmlVersion",{get:function(){return null}});r.prototype.toString=function(e){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(e))};return r}(t)}).call(this)},function(i,e,s){(function(){var r,e,t,n=function(e,t){for(var n in t){if(o.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},o={}.hasOwnProperty;t=s(2);r=s(0);i.exports=e=function(e){n(i,e);function i(e,t,n){i.__super__.constructor.call(this,e);if(t==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(!n){n="(#PCDATA)"}if(Array.isArray(n)){n="("+n.join(",")+")"}this.name=this.stringify.name(t);this.type=r.ElementDeclaration;this.value=this.stringify.dtdElementValue(n)}i.prototype.toString=function(e){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(e))};return i}(t)}).call(this)},function(i,e,s){(function(){var r,e,t,n=function(e,t){for(var n in t){if(o.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},o={}.hasOwnProperty;t=s(2);r=s(0);i.exports=e=function(e){n(i,e);function i(e,t,n){i.__super__.constructor.call(this,e);if(t==null){throw new Error("Missing DTD notation name. "+this.debugInfo(t))}if(!n.pubID&&!n.sysID){throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(t))}this.name=this.stringify.name(t);this.type=r.NotationDeclaration;if(n.pubID!=null){this.pubID=this.stringify.dtdPubID(n.pubID)}if(n.sysID!=null){this.sysID=this.stringify.dtdSysID(n.sysID)}}Object.defineProperty(i.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(i.prototype,"systemId",{get:function(){return this.sysID}});i.prototype.toString=function(e){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(e))};return i}(t)}).call(this)},function(n,e,s){(function(){var i,e,t,r=function(e,t){for(var n in t){if(o.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},o={}.hasOwnProperty;i=s(0);e=s(2);n.exports=t=function(e){r(n,e);function n(e,t){n.__super__.constructor.call(this,e);if(t==null){throw new Error("Missing raw text. "+this.debugInfo())}this.type=i.Raw;this.value=this.stringify.raw(t)}n.prototype.clone=function(){return Object.create(this)};n.prototype.toString=function(e){return this.options.writer.raw(this,this.options.writer.filterOptions(e))};return n}(e)}).call(this)},function(n,e,s){(function(){var i,e,t,r=function(e,t){for(var n in t){if(o.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},o={}.hasOwnProperty;i=s(0);e=s(11);n.exports=t=function(e){r(n,e);function n(e,t){n.__super__.constructor.call(this,e);if(t==null){throw new Error("Missing element text. "+this.debugInfo())}this.name="#text";this.type=i.Text;this.value=this.stringify.text(t)}Object.defineProperty(n.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(n.prototype,"wholeText",{get:function(){var e,t,n;n="";t=this.previousSibling;while(t){n=t.data+n;t=t.previousSibling}n+=this.data;e=this.nextSibling;while(e){n=n+e.data;e=e.nextSibling}return n}});n.prototype.clone=function(){return Object.create(this)};n.prototype.toString=function(e){return this.options.writer.text(this,this.options.writer.filterOptions(e))};n.prototype.splitText=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};n.prototype.replaceWholeText=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};return n}(e)}).call(this)},function(i,e,s){(function(){var r,e,t,n=function(e,t){for(var n in t){if(o.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},o={}.hasOwnProperty;r=s(0);e=s(11);i.exports=t=function(e){n(i,e);function i(e,t,n){i.__super__.constructor.call(this,e);if(t==null){throw new Error("Missing instruction target. "+this.debugInfo())}this.type=r.ProcessingInstruction;this.target=this.stringify.insTarget(t);this.name=this.target;if(n){this.value=this.stringify.insValue(n)}}i.prototype.clone=function(){return Object.create(this)};i.prototype.toString=function(e){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(e))};i.prototype.isEqualNode=function(e){if(!i.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)){return false}if(e.target!==this.target){return false}return true};return i}(e)}).call(this)},function(i,e,o){(function(){var e,t,n=function(e,t){for(var n in t){if(r.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},r={}.hasOwnProperty;t=o(51);i.exports=e=function(e){n(t,e);function t(e){t.__super__.constructor.call(this,e)}t.prototype.document=function(e,t){var n,i,r,o,s;t=this.filterOptions(t);o="";s=e.children;for(i=0,r=s.length;i<r;i++){n=s[i];o+=this.writeChildNode(n,t,0)}if(t.pretty&&o.slice(-t.newline.length)===t.newline){o=o.slice(0,-t.newline.length)}return o};return t}(t)}).call(this)},function(e,et,tt){"use strict";(function(e){
+/*!
+ * The buffer module from node.js, for the browser.
+ *
+ * @author   Feross Aboukhadijeh <http://feross.org>
+ * @license  MIT
+ */
+var i=tt(100);var o=tt(101);var s=tt(52);et.Buffer=c;et.SlowBuffer=y;et.INSPECT_MAX_BYTES=50;c.TYPED_ARRAY_SUPPORT=e.TYPED_ARRAY_SUPPORT!==undefined?e.TYPED_ARRAY_SUPPORT:t();et.kMaxLength=n();function t(){try{var e=new Uint8Array(1);e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return e.foo()===42&&typeof e.subarray==="function"&&e.subarray(1,1).byteLength===0}catch(t){return false}}function n(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(n()<t){throw new RangeError("Invalid typed array length")}if(c.TYPED_ARRAY_SUPPORT){e=new Uint8Array(t);e.__proto__=c.prototype}else{if(e===null){e=new c(t)}e.length=t}return e}function c(e,t,n){if(!c.TYPED_ARRAY_SUPPORT&&!(this instanceof c)){return new c(e,t,n)}if(typeof e==="number"){if(typeof t==="string"){throw new Error("If encoding is specified then the first argument must be a string")}return f(this,e)}return r(this,e,t,n)}c.poolSize=8192;c._augment=function(e){e.__proto__=c.prototype;return e};function r(e,t,n,i){if(typeof t==="number"){throw new TypeError('"value" argument must not be a number')}if(typeof ArrayBuffer!=="undefined"&&t instanceof ArrayBuffer){return p(e,t,n,i)}if(typeof t==="string"){return h(e,t,n)}return v(e,t)}c.from=function(e,t,n){return r(null,e,t,n)};if(c.TYPED_ARRAY_SUPPORT){c.prototype.__proto__=Uint8Array.prototype;c.__proto__=Uint8Array;if(typeof Symbol!=="undefined"&&Symbol.species&&c[Symbol.species]===c){Object.defineProperty(c,Symbol.species,{value:null,configurable:true})}}function u(e){if(typeof e!=="number"){throw new TypeError('"size" argument must be a number')}else if(e<0){throw new RangeError('"size" argument must not be negative')}}function l(e,t,n,i){u(t);if(t<=0){return a(e,t)}if(n!==undefined){return typeof i==="string"?a(e,t).fill(n,i):a(e,t).fill(n)}return a(e,t)}c.alloc=function(e,t,n){return l(null,e,t,n)};function f(e,t){u(t);e=a(e,t<0?0:m(t)|0);if(!c.TYPED_ARRAY_SUPPORT){for(var n=0;n<t;++n){e[n]=0}}return e}c.allocUnsafe=function(e){return f(null,e)};c.allocUnsafeSlow=function(e){return f(null,e)};function h(e,t,n){if(typeof n!=="string"||n===""){n="utf8"}if(!c.isEncoding(n)){throw new TypeError('"encoding" must be a valid string encoding')}var i=g(t,n)|0;e=a(e,i);var r=e.write(t,n);if(r!==i){e=e.slice(0,r)}return e}function d(e,t){var n=t.length<0?0:m(t.length)|0;e=a(e,n);for(var i=0;i<n;i+=1){e[i]=t[i]&255}return e}function p(e,t,n,i){t.byteLength;if(n<0||t.byteLength<n){throw new RangeError("'offset' is out of bounds")}if(t.byteLength<n+(i||0)){throw new RangeError("'length' is out of bounds")}if(n===undefined&&i===undefined){t=new Uint8Array(t)}else if(i===undefined){t=new Uint8Array(t,n)}else{t=new Uint8Array(t,n,i)}if(c.TYPED_ARRAY_SUPPORT){e=t;e.__proto__=c.prototype}else{e=d(e,t)}return e}function v(e,t){if(c.isBuffer(t)){var n=m(t.length)|0;e=a(e,n);if(e.length===0){return e}t.copy(e,0,0,n);return e}if(t){if(typeof ArrayBuffer!=="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t){if(typeof t.length!=="number"||ee(t.length)){return a(e,0)}return d(e,t)}if(t.type==="Buffer"&&s(t.data)){return d(e,t.data)}}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function m(e){if(e>=n()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+n().toString(16)+" bytes")}return e|0}function y(e){if(+e!=e){e=0}return c.alloc(+e)}c.isBuffer=function te(e){return!!(e!=null&&e._isBuffer)};c.compare=function M(e,t){if(!c.isBuffer(e)||!c.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var n=e.length;var i=t.length;for(var r=0,o=Math.min(n,i);r<o;++r){if(e[r]!==t[r]){n=e[r];i=t[r];break}}if(n<i)return-1;if(i<n)return 1;return 0};c.isEncoding=function ne(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};c.concat=function ie(e,t){if(!s(e)){throw new TypeError('"list" argument must be an Array of Buffers')}if(e.length===0){return c.alloc(0)}var n;if(t===undefined){t=0;for(n=0;n<e.length;++n){t+=e[n].length}}var i=c.allocUnsafe(t);var r=0;for(n=0;n<e.length;++n){var o=e[n];if(!c.isBuffer(o)){throw new TypeError('"list" argument must be an Array of Buffers')}o.copy(i,r);r+=o.length}return i};function g(e,t){if(c.isBuffer(e)){return e.length}if(typeof ArrayBuffer!=="undefined"&&typeof ArrayBuffer.isView==="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)){return e.byteLength}if(typeof e!=="string"){e=""+e}var n=e.length;if(n===0)return 0;var i=false;for(;;){switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case undefined:return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return A(e).length;default:if(i)return q(e).length;t=(""+t).toLowerCase();i=true}}}c.byteLength=g;function L(e,t,n){var i=false;if(t===undefined||t<0){t=0}if(t>this.length){return""}if(n===undefined||n>this.length){n=this.length}if(n<=0){return""}n>>>=0;t>>>=0;if(n<=t){return""}if(!e)e="utf8";while(true){switch(e){case"hex":return G(this,t,n);case"utf8":case"utf-8":return b(this,t,n);case"ascii":return U(this,t,n);case"latin1":case"binary":return j(this,t,n);case"base64":return J(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();i=true}}}c.prototype._isBuffer=true;function P(e,t,n){var i=e[t];e[t]=e[n];e[n]=i}c.prototype.swap16=function re(){var e=this.length;if(e%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var t=0;t<e;t+=2){P(this,t,t+1)}return this};c.prototype.swap32=function oe(){var e=this.length;if(e%4!==0){throw new RangeError("Buffer size must be a multiple of 32-bits")}for(var t=0;t<e;t+=4){P(this,t,t+3);P(this,t+1,t+2)}return this};c.prototype.swap64=function se(){var e=this.length;if(e%8!==0){throw new RangeError("Buffer size must be a multiple of 64-bits")}for(var t=0;t<e;t+=8){P(this,t,t+7);P(this,t+1,t+6);P(this,t+2,t+5);P(this,t+3,t+4)}return this};c.prototype.toString=function ae(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return b(this,0,e);return L.apply(this,arguments)};c.prototype.equals=function ue(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return c.compare(this,e)===0};c.prototype.inspect=function le(){var e="";var t=et.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return"<Buffer "+e+">"};c.prototype.compare=function M(e,t,n,i,r){if(!c.isBuffer(e)){throw new TypeError("Argument must be a Buffer")}if(t===undefined){t=0}if(n===undefined){n=e?e.length:0}if(i===undefined){i=0}if(r===undefined){r=this.length}if(t<0||n>e.length||i<0||r>this.length){throw new RangeError("out of range index")}if(i>=r&&t>=n){return 0}if(i>=r){return-1}if(t>=n){return 1}t>>>=0;n>>>=0;i>>>=0;r>>>=0;if(this===e)return 0;var o=r-i;var s=n-t;var a=Math.min(o,s);var u=this.slice(i,r);var l=e.slice(t,n);for(var f=0;f<a;++f){if(u[f]!==l[f]){o=u[f];s=l[f];break}}if(o<s)return-1;if(s<o)return 1;return 0};function w(e,t,n,i,r){if(e.length===0)return-1;if(typeof n==="string"){i=n;n=0}else if(n>2147483647){n=2147483647}else if(n<-2147483648){n=-2147483648}n=+n;if(isNaN(n)){n=r?0:e.length-1}if(n<0)n=e.length+n;if(n>=e.length){if(r)return-1;else n=e.length-1}else if(n<0){if(r)n=0;else return-1}if(typeof t==="string"){t=c.from(t,i)}if(c.isBuffer(t)){if(t.length===0){return-1}return S(e,t,n,i,r)}else if(typeof t==="number"){t=t&255;if(c.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==="function"){if(r){return Uint8Array.prototype.indexOf.call(e,t,n)}else{return Uint8Array.prototype.lastIndexOf.call(e,t,n)}}return S(e,[t],n,i,r)}throw new TypeError("val must be string, number or Buffer")}function S(e,t,n,i,r){var o=1;var s=e.length;var a=t.length;if(i!==undefined){i=String(i).toLowerCase();if(i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le"){if(e.length<2||t.length<2){return-1}o=2;s/=2;a/=2;n/=2}}function u(e,t){if(o===1){return e[t]}else{return e.readUInt16BE(t*o)}}var l;if(r){var f=-1;for(l=n;l<s;l++){if(u(e,l)===u(t,f===-1?0:l-f)){if(f===-1)f=l;if(l-f+1===a)return f*o}else{if(f!==-1)l-=l-f;f=-1}}}else{if(n+a>s)n=s-a;for(l=n;l>=0;l--){var c=true;for(var h=0;h<a;h++){if(u(e,l+h)!==u(t,h)){c=false;break}}if(c)return l}}return-1}c.prototype.includes=function fe(e,t,n){return this.indexOf(e,t,n)!==-1};c.prototype.indexOf=function ce(e,t,n){return w(this,e,t,n,true)};c.prototype.lastIndexOf=function he(e,t,n){return w(this,e,t,n,false)};function F(e,t,n,i){n=Number(n)||0;var r=e.length-n;if(!i){i=r}else{i=Number(i);if(i>r){i=r}}var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");if(i>o/2){i=o/2}for(var s=0;s<i;++s){var a=parseInt(t.substr(s*2,2),16);if(isNaN(a))return s;e[n+s]=a}return s}function W(e,t,n,i){return O(q(t,e.length-n),e,n,i)}function _(e,t,n,i){return O($(t),e,n,i)}function N(e,t,n,i){return _(e,t,n,i)}function B(e,t,n,i){return O(A(t),e,n,i)}function z(e,t,n,i){return O(Q(t,e.length-n),e,n,i)}c.prototype.write=function de(e,t,n,i){if(t===undefined){i="utf8";n=this.length;t=0}else if(n===undefined&&typeof t==="string"){i=t;n=this.length;t=0}else if(isFinite(t)){t=t|0;if(isFinite(n)){n=n|0;if(i===undefined)i="utf8"}else{i=n;n=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var r=this.length-t;if(n===undefined||n>r)n=r;if(e.length>0&&(n<0||t<0)||t>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!i)i="utf8";var o=false;for(;;){switch(i){case"hex":return F(this,e,t,n);case"utf8":case"utf-8":return W(this,e,t,n);case"ascii":return _(this,e,t,n);case"latin1":case"binary":return N(this,e,t,n);case"base64":return B(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();o=true}}};c.prototype.toJSON=function pe(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function J(e,t,n){if(t===0&&n===e.length){return i.fromByteArray(e)}else{return i.fromByteArray(e.slice(t,n))}}function b(e,t,n){n=Math.min(e.length,n);var i=[];var r=t;while(r<n){var o=e[r];var s=null;var a=o>239?4:o>223?3:o>191?2:1;if(r+a<=n){var u,l,f,c;switch(a){case 1:if(o<128){s=o}break;case 2:u=e[r+1];if((u&192)===128){c=(o&31)<<6|u&63;if(c>127){s=c}}break;case 3:u=e[r+1];l=e[r+2];if((u&192)===128&&(l&192)===128){c=(o&15)<<12|(u&63)<<6|l&63;if(c>2047&&(c<55296||c>57343)){s=c}}break;case 4:u=e[r+1];l=e[r+2];f=e[r+3];if((u&192)===128&&(l&192)===128&&(f&192)===128){c=(o&15)<<18|(u&63)<<12|(l&63)<<6|f&63;if(c>65535&&c<1114112){s=c}}}}if(s===null){s=65533;a=1}else if(s>65535){s-=65536;i.push(s>>>10&1023|55296);s=56320|s&1023}i.push(s);r+=a}return H(i)}var C=4096;function H(e){var t=e.length;if(t<=C){return String.fromCharCode.apply(String,e)}var n="";var i=0;while(i<t){n+=String.fromCharCode.apply(String,e.slice(i,i+=C))}return n}function U(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r){i+=String.fromCharCode(e[r]&127)}return i}function j(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r){i+=String.fromCharCode(e[r])}return i}function G(e,t,n){var i=e.length;if(!t||t<0)t=0;if(!n||n<0||n>i)n=i;var r="";for(var o=t;o<n;++o){r+=K(e[o])}return r}function V(e,t,n){var i=e.slice(t,n);var r="";for(var o=0;o<i.length;o+=2){r+=String.fromCharCode(i[o]+i[o+1]*256)}return r}c.prototype.slice=function ve(e,t){var n=this.length;e=~~e;t=t===undefined?n:~~t;if(e<0){e+=n;if(e<0)e=0}else if(e>n){e=n}if(t<0){t+=n;if(t<0)t=0}else if(t>n){t=n}if(t<e)t=e;var i;if(c.TYPED_ARRAY_SUPPORT){i=this.subarray(e,t);i.__proto__=c.prototype}else{var r=t-e;i=new c(r,undefined);for(var o=0;o<r;++o){i[o]=this[o+e]}}return i};function k(e,t,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUIntLE=function me(e,t,n){e=e|0;t=t|0;if(!n)k(e,t,this.length);var i=this[e];var r=1;var o=0;while(++o<t&&(r*=256)){i+=this[e+o]*r}return i};c.prototype.readUIntBE=function ye(e,t,n){e=e|0;t=t|0;if(!n){k(e,t,this.length)}var i=this[e+--t];var r=1;while(t>0&&(r*=256)){i+=this[e+--t]*r}return i};c.prototype.readUInt8=function ge(e,t){if(!t)k(e,1,this.length);return this[e]};c.prototype.readUInt16LE=function Pe(e,t){if(!t)k(e,2,this.length);return this[e]|this[e+1]<<8};c.prototype.readUInt16BE=function we(e,t){if(!t)k(e,2,this.length);return this[e]<<8|this[e+1]};c.prototype.readUInt32LE=function Se(e,t){if(!t)k(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};c.prototype.readUInt32BE=function _e(e,t){if(!t)k(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};c.prototype.readIntLE=function be(e,t,n){e=e|0;t=t|0;if(!n)k(e,t,this.length);var i=this[e];var r=1;var o=0;while(++o<t&&(r*=256)){i+=this[e+o]*r}r*=128;if(i>=r)i-=Math.pow(2,8*t);return i};c.prototype.readIntBE=function Ce(e,t,n){e=e|0;t=t|0;if(!n)k(e,t,this.length);var i=t;var r=1;var o=this[e+--i];while(i>0&&(r*=256)){o+=this[e+--i]*r}r*=128;if(o>=r)o-=Math.pow(2,8*t);return o};c.prototype.readInt8=function ke(e,t){if(!t)k(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};c.prototype.readInt16LE=function Te(e,t){if(!t)k(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};c.prototype.readInt16BE=function Re(e,t){if(!t)k(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};c.prototype.readInt32LE=function De(e,t){if(!t)k(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};c.prototype.readInt32BE=function xe(e,t){if(!t)k(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};c.prototype.readFloatLE=function Ie(e,t){if(!t)k(e,4,this.length);return o.read(this,e,true,23,4)};c.prototype.readFloatBE=function Ee(e,t){if(!t)k(e,4,this.length);return o.read(this,e,false,23,4)};c.prototype.readDoubleLE=function qe(e,t){if(!t)k(e,8,this.length);return o.read(this,e,true,52,8)};c.prototype.readDoubleBE=function Ae(e,t){if(!t)k(e,8,this.length);return o.read(this,e,false,52,8)};function T(e,t,n,i,r,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<o)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}c.prototype.writeUIntLE=function Oe(e,t,n,i){e=+e;t=t|0;n=n|0;if(!i){var r=Math.pow(2,8*n)-1;T(this,e,t,n,r,0)}var o=1;var s=0;this[t]=e&255;while(++s<n&&(o*=256)){this[t+s]=e/o&255}return t+n};c.prototype.writeUIntBE=function Me(e,t,n,i){e=+e;t=t|0;n=n|0;if(!i){var r=Math.pow(2,8*n)-1;T(this,e,t,n,r,0)}var o=n-1;var s=1;this[t+o]=e&255;while(--o>=0&&(s*=256)){this[t+o]=e/s&255}return t+n};c.prototype.writeUInt8=function Le(e,t,n){e=+e;t=t|0;if(!n)T(this,e,t,1,255,0);if(!c.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e&255;return t+1};function R(e,t,n,i){if(t<0)t=65535+t+1;for(var r=0,o=Math.min(e.length-n,2);r<o;++r){e[n+r]=(t&255<<8*(i?r:1-r))>>>(i?r:1-r)*8}}c.prototype.writeUInt16LE=function Fe(e,t,n){e=+e;t=t|0;if(!n)T(this,e,t,2,65535,0);if(c.TYPED_ARRAY_SUPPORT){this[t]=e&255;this[t+1]=e>>>8}else{R(this,e,t,true)}return t+2};c.prototype.writeUInt16BE=function We(e,t,n){e=+e;t=t|0;if(!n)T(this,e,t,2,65535,0);if(c.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e&255}else{R(this,e,t,false)}return t+2};function D(e,t,n,i){if(t<0)t=4294967295+t+1;for(var r=0,o=Math.min(e.length-n,4);r<o;++r){e[n+r]=t>>>(i?r:3-r)*8&255}}c.prototype.writeUInt32LE=function Ne(e,t,n){e=+e;t=t|0;if(!n)T(this,e,t,4,4294967295,0);if(c.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e&255}else{D(this,e,t,true)}return t+4};c.prototype.writeUInt32BE=function Be(e,t,n){e=+e;t=t|0;if(!n)T(this,e,t,4,4294967295,0);if(c.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e&255}else{D(this,e,t,false)}return t+4};c.prototype.writeIntLE=function ze(e,t,n,i){e=+e;t=t|0;if(!i){var r=Math.pow(2,8*n-1);T(this,e,t,n,r-1,-r)}var o=0;var s=1;var a=0;this[t]=e&255;while(++o<n&&(s*=256)){if(e<0&&a===0&&this[t+o-1]!==0){a=1}this[t+o]=(e/s>>0)-a&255}return t+n};c.prototype.writeIntBE=function Je(e,t,n,i){e=+e;t=t|0;if(!i){var r=Math.pow(2,8*n-1);T(this,e,t,n,r-1,-r)}var o=n-1;var s=1;var a=0;this[t+o]=e&255;while(--o>=0&&(s*=256)){if(e<0&&a===0&&this[t+o+1]!==0){a=1}this[t+o]=(e/s>>0)-a&255}return t+n};c.prototype.writeInt8=function He(e,t,n){e=+e;t=t|0;if(!n)T(this,e,t,1,127,-128);if(!c.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e&255;return t+1};c.prototype.writeInt16LE=function Ue(e,t,n){e=+e;t=t|0;if(!n)T(this,e,t,2,32767,-32768);if(c.TYPED_ARRAY_SUPPORT){this[t]=e&255;this[t+1]=e>>>8}else{R(this,e,t,true)}return t+2};c.prototype.writeInt16BE=function je(e,t,n){e=+e;t=t|0;if(!n)T(this,e,t,2,32767,-32768);if(c.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e&255}else{R(this,e,t,false)}return t+2};c.prototype.writeInt32LE=function Ge(e,t,n){e=+e;t=t|0;if(!n)T(this,e,t,4,2147483647,-2147483648);if(c.TYPED_ARRAY_SUPPORT){this[t]=e&255;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{D(this,e,t,true)}return t+4};c.prototype.writeInt32BE=function Ve(e,t,n){e=+e;t=t|0;if(!n)T(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(c.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e&255}else{D(this,e,t,false)}return t+4};function x(e,t,n,i,r,o){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function I(e,t,n,i,r){if(!r){x(e,t,n,4,34028234663852886e22,-34028234663852886e22)}o.write(e,t,n,i,23,4);return n+4}c.prototype.writeFloatLE=function Ye(e,t,n){return I(this,e,t,true,n)};c.prototype.writeFloatBE=function Xe(e,t,n){return I(this,e,t,false,n)};function E(e,t,n,i,r){if(!r){x(e,t,n,8,17976931348623157e292,-17976931348623157e292)}o.write(e,t,n,i,52,8);return n+8}c.prototype.writeDoubleLE=function Ze(e,t,n){return E(this,e,t,true,n)};c.prototype.writeDoubleBE=function Ke(e,t,n){return E(this,e,t,false,n)};c.prototype.copy=function $e(e,t,n,i){if(!n)n=0;if(!i&&i!==0)i=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(i>0&&i<n)i=n;if(i===n)return 0;if(e.length===0||this.length===0)return 0;if(t<0){throw new RangeError("targetStart out of bounds")}if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(e.length-t<i-n){i=e.length-t+n}var r=i-n;var o;if(this===e&&n<t&&t<i){for(o=r-1;o>=0;--o){e[o+t]=this[o+n]}}else if(r<1e3||!c.TYPED_ARRAY_SUPPORT){for(o=0;o<r;++o){e[o+t]=this[o+n]}}else{Uint8Array.prototype.set.call(e,this.subarray(n,n+r),t)}return r};c.prototype.fill=function Qe(e,t,n,i){if(typeof e==="string"){if(typeof t==="string"){i=t;t=0;n=this.length}else if(typeof n==="string"){i=n;n=this.length}if(e.length===1){var r=e.charCodeAt(0);if(r<256){e=r}}if(i!==undefined&&typeof i!=="string"){throw new TypeError("encoding must be a string")}if(typeof i==="string"&&!c.isEncoding(i)){throw new TypeError("Unknown encoding: "+i)}}else if(typeof e==="number"){e=e&255}if(t<0||this.length<t||this.length<n){throw new RangeError("Out of range index")}if(n<=t){return this}t=t>>>0;n=n===undefined?this.length:n>>>0;if(!e)e=0;var o;if(typeof e==="number"){for(o=t;o<n;++o){this[o]=e}}else{var s=c.isBuffer(e)?e:q(new c(e,i).toString());var a=s.length;for(o=0;o<n-t;++o){this[o+t]=s[o%a]}}return this};var Y=/[^+\/0-9A-Za-z-_]/g;function X(e){e=Z(e).replace(Y,"");if(e.length<2)return"";while(e.length%4!==0){e=e+"="}return e}function Z(e){if(e.trim)return e.trim();return e.replace(/^\s+|\s+$/g,"")}function K(e){if(e<16)return"0"+e.toString(16);return e.toString(16)}function q(e,t){t=t||Infinity;var n;var i=e.length;var r=null;var o=[];for(var s=0;s<i;++s){n=e.charCodeAt(s);if(n>55295&&n<57344){if(!r){if(n>56319){if((t-=3)>-1)o.push(239,191,189);continue}else if(s+1===i){if((t-=3)>-1)o.push(239,191,189);continue}r=n;continue}if(n<56320){if((t-=3)>-1)o.push(239,191,189);r=n;continue}n=(r-55296<<10|n-56320)+65536}else if(r){if((t-=3)>-1)o.push(239,191,189)}r=null;if(n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else{throw new Error("Invalid code point")}}return o}function $(e){var t=[];for(var n=0;n<e.length;++n){t.push(e.charCodeAt(n)&255)}return t}function Q(e,t){var n,i,r;var o=[];for(var s=0;s<e.length;++s){if((t-=2)<0)break;n=e.charCodeAt(s);i=n>>8;r=n%256;o.push(r);o.push(i)}return o}function A(e){return i.toByteArray(X(e))}function O(e,t,n,i){for(var r=0;r<i;++r){if(r+n>=t.length||r>=e.length)break;t[r+n]=e[r]}return r}function ee(e){return e!==e}}).call(this,tt(6))},function(e,t,n){t=e.exports=n(53);t.Stream=t;t.Readable=t;t.Writable=n(36);t.Duplex=n(5);t.Transform=n(57);t.PassThrough=n(108)},function(N,e,B){"use strict";(function(e,t,n){var s=B(15);N.exports=g;function L(e,t,n){this.chunk=e;this.encoding=t;this.callback=n;this.next=null}function h(e){var t=this;this.next=null;this.entry=null;this.finish=function(){M(t,e)}}var a=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?t:s.nextTick;var u;g.WritableState=m;var i=Object.create(B(9));i.inherits=B(7);var r={deprecate:B(107)};var o=B(54);var l=B(16).Buffer;var f=n.Uint8Array||function(){};function c(e){return l.from(e)}function d(e){return l.isBuffer(e)||e instanceof f}var p=B(55);i.inherits(g,o);function v(){}function m(e,t){u=u||B(5);e=e||{};var n=t instanceof u;this.objectMode=!!e.objectMode;if(n)this.objectMode=this.objectMode||!!e.writableObjectMode;var i=e.highWaterMark;var r=e.writableHighWaterMark;var o=this.objectMode?16:16*1024;if(i||i===0)this.highWaterMark=i;else if(n&&(r||r===0))this.highWaterMark=r;else this.highWaterMark=o;this.highWaterMark=Math.floor(this.highWaterMark);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;var s=e.decodeStrings===false;this.decodeStrings=!s;this.defaultEncoding=e.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(e){T(t,e)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.bufferedRequestCount=0;this.corkedRequestsFree=new h(this)}m.prototype.getBuffer=function F(){var e=this.bufferedRequest;var t=[];while(e){t.push(e);e=e.next}return t};(function(){try{Object.defineProperty(m.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.","DEP0003")})}catch(e){}})();var y;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){y=Function.prototype[Symbol.hasInstance];Object.defineProperty(g,Symbol.hasInstance,{value:function(e){if(y.call(this,e))return true;if(this!==g)return false;return e&&e._writableState instanceof m}})}else{y=function(e){return e instanceof this}}function g(e){u=u||B(5);if(!y.call(g,this)&&!(this instanceof u)){return new g(e)}this._writableState=new m(e,this);this.writable=true;if(e){if(typeof e.write==="function")this._write=e.write;if(typeof e.writev==="function")this._writev=e.writev;if(typeof e.destroy==="function")this._destroy=e.destroy;if(typeof e["final"]==="function")this._final=e["final"]}o.call(this)}g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function P(e,t){var n=new Error("write after end");e.emit("error",n);s.nextTick(t,n)}function w(e,t,n,i){var r=true;var o=false;if(n===null){o=new TypeError("May not write null values to stream")}else if(typeof n!=="string"&&n!==undefined&&!t.objectMode){o=new TypeError("Invalid non-string/buffer chunk")}if(o){e.emit("error",o);s.nextTick(i,o);r=false}return r}g.prototype.write=function(e,t,n){var i=this._writableState;var r=false;var o=!i.objectMode&&d(e);if(o&&!l.isBuffer(e)){e=c(e)}if(typeof t==="function"){n=t;t=null}if(o)t="buffer";else if(!t)t=i.defaultEncoding;if(typeof n!=="function")n=v;if(i.ended)P(this,n);else if(o||w(this,i,e,n)){i.pendingcb++;r=_(this,i,o,e,t,n)}return r};g.prototype.cork=function(){var e=this._writableState;e.corked++};g.prototype.uncork=function(){var e=this._writableState;if(e.corked){e.corked--;if(!e.writing&&!e.corked&&!e.finished&&!e.bufferProcessing&&e.bufferedRequest)x(this,e)}};g.prototype.setDefaultEncoding=function W(e){if(typeof e==="string")e=e.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e;return this};function S(e,t,n){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=l.from(t,n)}return t}Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:false,get:function(){return this._writableState.highWaterMark}});function _(e,t,n,i,r,o){if(!n){var s=S(t,i,r);if(i!==s){n=true;r="buffer";i=s}}var a=t.objectMode?1:i.length;t.length+=a;var u=t.length<t.highWaterMark;if(!u)t.needDrain=true;if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:r,isBuf:n,callback:o,next:null};if(l){l.next=t.lastBufferedRequest}else{t.bufferedRequest=t.lastBufferedRequest}t.bufferedRequestCount+=1}else{b(e,t,false,a,i,r,o)}return u}function b(e,t,n,i,r,o,s){t.writelen=i;t.writecb=s;t.writing=true;t.sync=true;if(n)e._writev(r,t.onwrite);else e._write(r,o,t.onwrite);t.sync=false}function C(e,t,n,i,r){--t.pendingcb;if(n){s.nextTick(r,i);s.nextTick(A,e,t);e._writableState.errorEmitted=true;e.emit("error",i)}else{r(i);e._writableState.errorEmitted=true;e.emit("error",i);A(e,t)}}function k(e){e.writing=false;e.writecb=null;e.length-=e.writelen;e.writelen=0}function T(e,t){var n=e._writableState;var i=n.sync;var r=n.writecb;k(n);if(t)C(e,n,i,t,r);else{var o=I(n);if(!o&&!n.corked&&!n.bufferProcessing&&n.bufferedRequest){x(e,n)}if(i){a(R,e,n,o,r)}else{R(e,n,o,r)}}}function R(e,t,n,i){if(!n)D(e,t);t.pendingcb--;i();A(e,t)}function D(e,t){if(t.length===0&&t.needDrain){t.needDrain=false;e.emit("drain")}}function x(e,t){t.bufferProcessing=true;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var i=t.bufferedRequestCount;var r=new Array(i);var o=t.corkedRequestsFree;o.entry=n;var s=0;var a=true;while(n){r[s]=n;if(!n.isBuf)a=false;n=n.next;s+=1}r.allBuffers=a;b(e,t,true,t.length,r,"",o.finish);t.pendingcb++;t.lastBufferedRequest=null;if(o.next){t.corkedRequestsFree=o.next;o.next=null}else{t.corkedRequestsFree=new h(t)}t.bufferedRequestCount=0}else{while(n){var u=n.chunk;var l=n.encoding;var f=n.callback;var c=t.objectMode?1:u.length;b(e,t,false,c,u,l,f);n=n.next;t.bufferedRequestCount--;if(t.writing){break}}if(n===null)t.lastBufferedRequest=null}t.bufferedRequest=n;t.bufferProcessing=false}g.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))};g.prototype._writev=null;g.prototype.end=function(e,t,n){var i=this._writableState;if(typeof e==="function"){n=e;e=null;t=null}else if(typeof t==="function"){n=t;t=null}if(e!==null&&e!==undefined)this.write(e,t);if(i.corked){i.corked=1;this.uncork()}if(!i.ending&&!i.finished)O(this,i,n)};function I(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function E(t,n){t._final(function(e){n.pendingcb--;if(e){t.emit("error",e)}n.prefinished=true;t.emit("prefinish");A(t,n)})}function q(e,t){if(!t.prefinished&&!t.finalCalled){if(typeof e._final==="function"){t.pendingcb++;t.finalCalled=true;s.nextTick(E,e,t)}else{t.prefinished=true;e.emit("prefinish")}}}function A(e,t){var n=I(t);if(n){q(e,t);if(t.pendingcb===0){t.finished=true;e.emit("finish")}}return n}function O(e,t,n){t.ending=true;A(e,t);if(n){if(t.finished)s.nextTick(n);else e.once("finish",n)}t.ended=true;e.writable=false}function M(e,t,n){var i=e.entry;e.entry=null;while(i){var r=i.callback;t.pendingcb--;r(n);i=i.next}if(t.corkedRequestsFree){t.corkedRequestsFree.next=e}else{t.corkedRequestsFree=e}}Object.defineProperty(g.prototype,"destroyed",{get:function(){if(this._writableState===undefined){return false}return this._writableState.destroyed},set:function(e){if(!this._writableState){return}this._writableState.destroyed=e}});g.prototype.destroy=p.destroy;g.prototype._undestroy=p.undestroy;g.prototype._destroy=function(e,t){this.end();t(e)}}).call(this,B(14),B(56).setImmediate,B(6))},function(e,t,n){"use strict";var i=n(16).Buffer;var r=i.isEncoding||function(e){e=""+e;switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function o(e){if(!e)return"utf8";var t;while(true){switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase();t=true}}}function s(e){var t=o(e);if(typeof t!=="string"&&(i.isEncoding===r||!r(e)))throw new Error("Unknown encoding: "+e);return t||e}t.StringDecoder=a;function a(e){this.encoding=s(e);var t;switch(this.encoding){case"utf16le":this.text=p;this.end=v;t=4;break;case"utf8":this.fillLast=c;t=4;break;case"base64":this.text=m;this.end=y;t=3;break;default:this.write=g;this.end=P;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=i.allocUnsafe(t)}a.prototype.write=function(e){if(e.length===0)return"";var t;var n;if(this.lastNeed){t=this.fillLast(e);if(t===undefined)return"";n=this.lastNeed;this.lastNeed=0}else{n=0}if(n<e.length)return t?t+this.text(e,n):this.text(e,n);return t||""};a.prototype.end=d;a.prototype.text=h;a.prototype.fillLast=function(e){if(this.lastNeed<=e.length){e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length);this.lastNeed-=e.length};function u(e){if(e<=127)return 0;else if(e>>5===6)return 2;else if(e>>4===14)return 3;else if(e>>3===30)return 4;return e>>6===2?-1:-2}function l(e,t,n){var i=t.length-1;if(i<n)return 0;var r=u(t[i]);if(r>=0){if(r>0)e.lastNeed=r-1;return r}if(--i<n||r===-2)return 0;r=u(t[i]);if(r>=0){if(r>0)e.lastNeed=r-2;return r}if(--i<n||r===-2)return 0;r=u(t[i]);if(r>=0){if(r>0){if(r===2)r=0;else e.lastNeed=r-3}return r}return 0}function f(e,t,n){if((t[0]&192)!==128){e.lastNeed=0;return"锟�"}if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128){e.lastNeed=1;return"锟�"}if(e.lastNeed>2&&t.length>2){if((t[2]&192)!==128){e.lastNeed=2;return"锟�"}}}}function c(e){var t=this.lastTotal-this.lastNeed;var n=f(this,e,t);if(n!==undefined)return n;if(this.lastNeed<=e.length){e.copy(this.lastChar,t,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}e.copy(this.lastChar,t,0,e.length);this.lastNeed-=e.length}function h(e,t){var n=l(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var i=e.length-(n-this.lastNeed);e.copy(this.lastChar,0,i);return e.toString("utf8",t,i)}function d(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+"锟�";return t}function p(e,t){if((e.length-t)%2===0){var n=e.toString("utf16le",t);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1];return n.slice(0,-1)}}return n}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=e[e.length-1];return e.toString("utf16le",t,e.length-1)}function v(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function m(e,t){var n=(e.length-t)%3;if(n===0)return e.toString("base64",t);this.lastNeed=3-n;this.lastTotal=3;if(n===1){this.lastChar[0]=e[e.length-1]}else{this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1]}return e.toString("base64",t,e.length-n)}function y(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+this.lastChar.toString("base64",0,3-this.lastNeed);return t}function g(e){return e.toString(this.encoding)}function P(e){return e&&e.length?this.write(e):""}},function(e,i,t){"use strict";(function(p){Object.defineProperty(i,"__esModule",{value:true});var v=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var n=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(e,t,n){if(t)i(e.prototype,t);if(n)i(e,n);return e}}();function m(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var e=function(){function e(){m(this,e);this._keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}n(e,[{key:"$",value:function p(e){var t=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;var n=/^(?:\s*(<[\w\W]+>)[^>]*|.([\w-]*))$/;if(t.test(e)){var i=t.exec(e);return document.getElementById(i[2])}else if(n.test(e)){var r=n.exec(e);var o=document.getElementsByTagName("*");var s=[];for(var a=0,u=o.length;a<u;a++){if(o[a].className.match(new RegExp("(\\s|^)"+r[2]+"(\\s|$)"))){s.push(o[a])}}return s}}},{key:"dateFormat",value:function r(e,t){var n={"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()};if(/(y+)/.test(t)){t=t.replace(RegExp.$1,(e.getFullYear()+"").substr(4-RegExp.$1.length))}for(var i in n){if(new RegExp("("+i+")").test(t)){t=t.replace(RegExp.$1,RegExp.$1.length===1?n[i]:("00"+n[i]).substr((""+n[i]).length))}}return t}},{key:"downloadFile",value:function s(e,t){var n=e;if(!(e instanceof Blob||e instanceof File)){n=new Blob([e])}var i=window.URL.createObjectURL(n);var r=window.document.createElement("a");r.href=i;r.download=t;var o=document.createEvent("MouseEvents");o.initEvent("click",true,true);r.dispatchEvent(o)}},{key:"createxmlDoc",value:function o(){var e;var t=["MSXML2.DOMDocument","MSXML2.DOMDocument.5.0","MSXML2.DOMDocument.4.0","MSXML2.DOMDocument.3.0","Microsoft.XmlDom"];for(var n=0,i=t.length;n<i;n++){try{e=new ActiveXObject(t[n]);break}catch(r){e=document.implementation.createDocument("","",null);break}}e["async"]="false";return e}},{key:"parseXmlFromStr",value:function i(e){if(null===e||""===e){return null}var t=this.createxmlDoc();if(navigator.appName==="Netscape"||navigator.appName==="Opera"){var n=new DOMParser;t=n.parseFromString(e,"text/xml")}else{t.loadXML(e)}return t}},{key:"encode",value:function f(e){var t="";var n;var i;var r;var o;var s;var a;var u;var l=0;e=this._utf8_encode(e);while(l<e.length){n=e.charCodeAt(l++);i=e.charCodeAt(l++);r=e.charCodeAt(l++);o=n>>2;s=(n&3)<<4|i>>4;a=(i&15)<<2|r>>6;u=r&63;if(isNaN(i)){a=u=64}else if(isNaN(r)){u=64}t=t+this._keyStr.charAt(o)+this._keyStr.charAt(s)+this._keyStr.charAt(a)+this._keyStr.charAt(u)}return t}},{key:"decode",value:function c(e){var t="";var n;var i;var r;var o;var s;var a;var u;var l=0;e=e.replace(/[^A-Za-z0-9+/=]/g,"");while(l<e.length){o=this._keyStr.indexOf(e.charAt(l++));s=this._keyStr.indexOf(e.charAt(l++));a=this._keyStr.indexOf(e.charAt(l++));u=this._keyStr.indexOf(e.charAt(l++));n=o<<2|s>>4;i=(s&15)<<4|a>>2;r=(a&3)<<6|u;t=t+String.fromCharCode(n);if(a!==64){t=t+String.fromCharCode(i)}if(u!==64){t=t+String.fromCharCode(r)}}t=this._utf8_decode(t);return t}},{key:"_utf8_encode",value:function a(e){e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n<e.length;n++){var i=e.charCodeAt(n);if(i<128){t+=String.fromCharCode(i)}else if(i>127&&i<2048){t+=String.fromCharCode(i>>6|192);t+=String.fromCharCode(i&63|128)}else{t+=String.fromCharCode(i>>12|224);t+=String.fromCharCode(i>>6&63|128);t+=String.fromCharCode(i&63|128)}}return t}},{key:"_utf8_decode",value:function u(e){var t="";var n=0;var i=0;var r=0;while(n<e.length){i=e.charCodeAt(n);if(i<128){t+=String.fromCharCode(i);n++}else if(i>191&&i<224){r=e.charCodeAt(n+1);t+=String.fromCharCode((i&31)<<6|r&63);n+=2}else{r=e.charCodeAt(n+1);var o=e.charCodeAt(n+2);t+=String.fromCharCode((i&15)<<12|(r&63)<<6|o&63);n+=3}}return t}},{key:"isFirefox",value:function l(){var e=false;var t=navigator.userAgent.toLowerCase();var n="";var i=-1;if(t.match(/firefox\/([\d.]+)/)){n=t.match(/firefox\/([\d.]+)/)[1];i=parseInt(n.split(".")[0],10);if(i>-1){e=true}}return e}},{key:"isSafari",value:function h(){var e=false;var t=navigator.userAgent.toLowerCase();var n="";var i=-1;if(t.match(/version\/([\d.]+).safari./)){n=t.match(/version\/([\d.]+).safari./)[1];i=parseInt(n.split(".")[0],10);if(i>-1){e=true}}return e}},{key:"isEdge",value:function t(){return navigator.userAgent.toLowerCase().indexOf("edge")>-1}},{key:"getStatusCode",value:function d(e){var t=e.responseXML;var n="";try{if(t){n=p(t).find("subStatusCode").text()}else if("object"===v(JSON.parse(e.responseText))){var i=JSON.parse(e.responseText);n=""+i["subStatusCode"]}}catch(r){}return n}}]);return e}();var t=i.oTool=new e}).call(this,t(1))},function(e,t){var n=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof window.msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto);if(n){var i=new Uint8Array(16);e.exports=function o(){n(i);return i}}else{var r=new Array(16);e.exports=function s(){for(var e=0,t;e<16;e++){if((e&3)===0)t=Math.random()*4294967296;r[e]=t>>>((e&3)<<3)&255}return r}}},function(e,t){var r=[];for(var n=0;n<256;++n){r[n]=(n+256).toString(16).substr(1)}function i(e,t){var n=t||0;var i=r;return[i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]]].join("")}e.exports=i},function(e,t,n){"use strict";function i(e,t,n,i){var r=e&65535|0,o=e>>>16&65535|0,s=0;while(n!==0){s=n>2e3?2e3:n;n-=s;do{r=r+t[i++]|0;o=o+r|0}while(--s);r%=65521;o%=65521}return r|o<<16|0}e.exports=i},function(e,t,n){"use strict";function i(){var e,t=[];for(var n=0;n<256;n++){e=n;for(var i=0;i<8;i++){e=e&1?3988292384^e>>>1:e>>>1}t[n]=e}return t}var a=i();function r(e,t,n,i){var r=a,o=i+n;e^=-1;for(var s=i;s<o;s++){e=e>>>8^r[(e^t[s])&255]}return e^-1}e.exports=r},function(e,t,n){"use strict";var u=n(4);var r=true;var o=true;try{String.fromCharCode.apply(null,[0])}catch(s){r=false}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(s){o=false}var l=new u.Buf8(256);for(var i=0;i<256;i++){l[i]=i>=252?6:i>=248?5:i>=240?4:i>=224?3:i>=192?2:1}l[254]=l[254]=1;t.string2buf=function(e){var t,n,i,r,o,s=e.length,a=0;for(r=0;r<s;r++){n=e.charCodeAt(r);if((n&64512)===55296&&r+1<s){i=e.charCodeAt(r+1);if((i&64512)===56320){n=65536+(n-55296<<10)+(i-56320);r++}}a+=n<128?1:n<2048?2:n<65536?3:4}t=new u.Buf8(a);for(o=0,r=0;o<a;r++){n=e.charCodeAt(r);if((n&64512)===55296&&r+1<s){i=e.charCodeAt(r+1);if((i&64512)===56320){n=65536+(n-55296<<10)+(i-56320);r++}}if(n<128){t[o++]=n}else if(n<2048){t[o++]=192|n>>>6;t[o++]=128|n&63}else if(n<65536){t[o++]=224|n>>>12;t[o++]=128|n>>>6&63;t[o++]=128|n&63}else{t[o++]=240|n>>>18;t[o++]=128|n>>>12&63;t[o++]=128|n>>>6&63;t[o++]=128|n&63}}return t};function f(e,t){if(t<65534){if(e.subarray&&o||!e.subarray&&r){return String.fromCharCode.apply(null,u.shrinkBuf(e,t))}}var n="";for(var i=0;i<t;i++){n+=String.fromCharCode(e[i])}return n}t.buf2binstring=function(e){return f(e,e.length)};t.binstring2buf=function(e){var t=new u.Buf8(e.length);for(var n=0,i=t.length;n<i;n++){t[n]=e.charCodeAt(n)}return t};t.buf2string=function(e,t){var n,i,r,o;var s=t||e.length;var a=new Array(s*2);for(i=0,n=0;n<s;){r=e[n++];if(r<128){a[i++]=r;continue}o=l[r];if(o>4){a[i++]=65533;n+=o-1;continue}r&=o===2?31:o===3?15:7;while(o>1&&n<s){r=r<<6|e[n++]&63;o--}if(o>1){a[i++]=65533;continue}if(r<65536){a[i++]=r}else{r-=65536;a[i++]=55296|r>>10&1023;a[i++]=56320|r&1023}}return f(a,i)};t.utf8border=function(e,t){var n;t=t||e.length;if(t>e.length){t=e.length}n=t-1;while(n>=0&&(e[n]&192)===128){n--}if(n<0){return t}if(n===0){return t}return n+l[e[n]]>t?n:t}},function(e,t,n){"use strict";function i(){this.input=null;this.next_in=0;this.avail_in=0;this.total_in=0;this.output=null;this.next_out=0;this.avail_out=0;this.total_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}e.exports=i},function(e,t,n){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(t,e){(function(){var e;t.exports=e=function(){function e(){}e.prototype.hasFeature=function(e,t){return true};e.prototype.createDocumentType=function(e,t,n){throw new Error("This DOM method is not implemented.")};e.prototype.createDocument=function(e,t,n){throw new Error("This DOM method is not implemented.")};e.prototype.createHTMLDocument=function(e){throw new Error("This DOM method is not implemented.")};e.prototype.getFeature=function(e,t){throw new Error("This DOM method is not implemented.")};return e}()}).call(this)},function(f,e,c){(function(){var r,n,i,e,t,o,s,a,u=function(e,t){for(var n in t){if(l.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},l={}.hasOwnProperty;a=c(3).isPlainObject;i=c(46);n=c(91);t=c(2);r=c(0);s=c(50);o=c(33);f.exports=e=function(e){u(t,e);function t(e){t.__super__.constructor.call(this,null);this.name="#document";this.type=r.Document;this.documentURI=null;this.domConfig=new n;e||(e={});if(!e.writer){e.writer=new o}this.options=e;this.stringify=new s(e)}Object.defineProperty(t.prototype,"implementation",{value:new i});Object.defineProperty(t.prototype,"doctype",{get:function(){var e,t,n,i;i=this.children;for(t=0,n=i.length;t<n;t++){e=i[t];if(e.type===r.DocType){return e}}return null}});Object.defineProperty(t.prototype,"documentElement",{get:function(){return this.rootObject||null}});Object.defineProperty(t.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(t.prototype,"strictErrorChecking",{get:function(){return false}});Object.defineProperty(t.prototype,"xmlEncoding",{get:function(){if(this.children.length!==0&&this.children[0].type===r.Declaration){return this.children[0].encoding}else{return null}}});Object.defineProperty(t.prototype,"xmlStandalone",{get:function(){if(this.children.length!==0&&this.children[0].type===r.Declaration){return this.children[0].standalone==="yes"}else{return false}}});Object.defineProperty(t.prototype,"xmlVersion",{get:function(){if(this.children.length!==0&&this.children[0].type===r.Declaration){return this.children[0].version}else{return"1.0"}}});Object.defineProperty(t.prototype,"URL",{get:function(){return this.documentURI}});Object.defineProperty(t.prototype,"origin",{get:function(){return null}});Object.defineProperty(t.prototype,"compatMode",{get:function(){return null}});Object.defineProperty(t.prototype,"characterSet",{get:function(){return null}});Object.defineProperty(t.prototype,"contentType",{get:function(){return null}});t.prototype.end=function(e){var t;t={};if(!e){e=this.options.writer}else if(a(e)){t=e;e=this.options.writer}return e.document(this,e.filterOptions(t))};t.prototype.toString=function(e){return this.options.writer.document(this,this.options.writer.filterOptions(e))};t.prototype.createElement=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.createTextNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.createComment=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.createCDATASection=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.createProcessingInstruction=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.createAttribute=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.createEntityReference=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.getElementsByTagName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.importNode=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.createElementNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.createAttributeNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.getElementsByTagNameNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.getElementById=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.adoptNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.renameNode=function(e,t,n){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.getElementsByClassName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.createEvent=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.createNodeIterator=function(e,t,n){throw new Error("This DOM method is not implemented."+this.debugInfo())};t.prototype.createTreeWalker=function(e,t,n){throw new Error("This DOM method is not implemented."+this.debugInfo())};return t}(t)}).call(this)},function(n,e,r){(function(){var i,e,t;i=r(0);t=r(2);n.exports=e=function(){function e(e,t,n){this.parent=e;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}if(t==null){throw new Error("Missing attribute name. "+this.debugInfo(t))}this.name=this.stringify.name(t);this.value=this.stringify.attValue(n);this.type=i.Attribute;this.isId=false;this.schemaTypeInfo=null}Object.defineProperty(e.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(e.prototype,"ownerElement",{get:function(){return this.parent}});Object.defineProperty(e.prototype,"textContent",{get:function(){return this.value},set:function(e){return this.value=e||""}});Object.defineProperty(e.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(e.prototype,"prefix",{get:function(){return""}});Object.defineProperty(e.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(e.prototype,"specified",{get:function(){return true}});e.prototype.clone=function(){return Object.create(this)};e.prototype.toString=function(e){return this.options.writer.attribute(this,this.options.writer.filterOptions(e))};e.prototype.debugInfo=function(e){e=e||this.name;if(e==null){return"parent: <"+this.parent.name+">"}else{return"attribute: {"+e+"}, parent: <"+this.parent.name+">"}};e.prototype.isEqualNode=function(e){if(e.namespaceURI!==this.namespaceURI){return false}if(e.prefix!==this.prefix){return false}if(e.localName!==this.localName){return false}if(e.value!==this.value){return false}return true};return e}()}).call(this)},function(o,e,s){(function(){var n,e,t,i=function(e,t){for(var n in t){if(r.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},r={}.hasOwnProperty;t=s(2);n=s(0);o.exports=e=function(e){i(t,e);function t(e){t.__super__.constructor.call(this,e);this.type=n.Dummy}t.prototype.clone=function(){return Object.create(this)};t.prototype.toString=function(e){return""};return t}(t)}).call(this)},function(t,e){(function(){var e,r=function(e,t){return function(){return e.apply(t,arguments)}},o={}.hasOwnProperty;t.exports=e=function(){function e(e){this.assertLegalName=r(this.assertLegalName,this);this.assertLegalChar=r(this.assertLegalChar,this);var t,n,i;e||(e={});this.options=e;if(!this.options.version){this.options.version="1.0"}n=e.stringify||{};for(t in n){if(!o.call(n,t))continue;i=n[t];this[t]=i}}e.prototype.name=function(e){if(this.options.noValidation){return e}return this.assertLegalName(""+e||"")};e.prototype.text=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(this.textEscape(""+e||""))};e.prototype.cdata=function(e){if(this.options.noValidation){return e}e=""+e||"";e=e.replace("]]>","]]]]><![CDATA[>");return this.assertLegalChar(e)};e.prototype.comment=function(e){if(this.options.noValidation){return e}e=""+e||"";if(e.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+e)}return this.assertLegalChar(e)};e.prototype.raw=function(e){if(this.options.noValidation){return e}return""+e||""};e.prototype.attValue=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(this.attEscape(e=""+e||""))};e.prototype.insTarget=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};e.prototype.insValue=function(e){if(this.options.noValidation){return e}e=""+e||"";if(e.match(/\?>/)){throw new Error("Invalid processing instruction value: "+e)}return this.assertLegalChar(e)};e.prototype.xmlVersion=function(e){if(this.options.noValidation){return e}e=""+e||"";if(!e.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+e)}return e};e.prototype.xmlEncoding=function(e){if(this.options.noValidation){return e}e=""+e||"";if(!e.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)){throw new Error("Invalid encoding: "+e)}return this.assertLegalChar(e)};e.prototype.xmlStandalone=function(e){if(this.options.noValidation){return e}if(e){return"yes"}else{return"no"}};e.prototype.dtdPubID=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};e.prototype.dtdSysID=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};e.prototype.dtdElementValue=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};e.prototype.dtdAttType=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};e.prototype.dtdAttDefault=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};e.prototype.dtdEntityValue=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};e.prototype.dtdNData=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};e.prototype.convertAttKey="@";e.prototype.convertPIKey="?";e.prototype.convertTextKey="#text";e.prototype.convertCDataKey="#cdata";e.prototype.convertCommentKey="#comment";e.prototype.convertRawKey="#raw";e.prototype.assertLegalChar=function(e){var t,n;if(this.options.noValidation){return e}t="";if(this.options.version==="1.0"){t=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(n=e.match(t)){throw new Error("Invalid character in string: "+e+" at index "+n.index)}}else if(this.options.version==="1.1"){t=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(n=e.match(t)){throw new Error("Invalid character in string: "+e+" at index "+n.index)}}return e};e.prototype.assertLegalName=function(e){var t;if(this.options.noValidation){return e}this.assertLegalChar(e);t=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;if(!e.match(t)){throw new Error("Invalid character in name")}return e};e.prototype.textEscape=function(e){var t;if(this.options.noValidation){return e}t=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return e.replace(t,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;")};e.prototype.attEscape=function(e){var t;if(this.options.noValidation){return e}t=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return e.replace(t,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")};return e}()}).call(this)},function(v,e,m){(function(){var y,g,e,t,n,i,r,o,s,a,u,l,f,c,h,d,p,P={}.hasOwnProperty;p=m(3).assign;y=m(0);s=m(24);a=m(25);e=m(22);t=m(23);l=m(20);c=m(30);h=m(31);f=m(32);u=m(49);n=m(26);i=m(28);r=m(27);o=m(29);g=m(12);v.exports=d=function(){function e(e){var t,n,i;e||(e={});this.options=e;n=e.writer||{};for(t in n){if(!P.call(n,t))continue;i=n[t];this["_"+t]=this[t];this[t]=i}}e.prototype.filterOptions=function(e){var t,n,i,r,o,s,a,u;e||(e={});e=p({},this.options,e);t={writer:this};t.pretty=e.pretty||false;t.allowEmpty=e.allowEmpty||false;t.indent=(n=e.indent)!=null?n:"  ";t.newline=(i=e.newline)!=null?i:"\n";t.offset=(r=e.offset)!=null?r:0;t.dontPrettyTextNodes=(o=(s=e.dontPrettyTextNodes)!=null?s:e.dontprettytextnodes)!=null?o:0;t.spaceBeforeSlash=(a=(u=e.spaceBeforeSlash)!=null?u:e.spacebeforeslash)!=null?a:"";if(t.spaceBeforeSlash===true){t.spaceBeforeSlash=" "}t.suppressPrettyCount=0;t.user={};t.state=g.None;return t};e.prototype.indent=function(e,t,n){var i;if(!t.pretty||t.suppressPrettyCount){return""}else if(t.pretty){i=(n||0)+t.offset+1;if(i>0){return new Array(i).join(t.indent)}}return""};e.prototype.endline=function(e,t,n){if(!t.pretty||t.suppressPrettyCount){return""}else{return t.newline}};e.prototype.attribute=function(e,t,n){var i;this.openAttribute(e,t,n);i=" "+e.name+'="'+e.value+'"';this.closeAttribute(e,t,n);return i};e.prototype.cdata=function(e,t,n){var i;this.openNode(e,t,n);t.state=g.OpenTag;i=this.indent(e,t,n)+"<![CDATA[";t.state=g.InsideTag;i+=e.value;t.state=g.CloseTag;i+="]]>"+this.endline(e,t,n);t.state=g.None;this.closeNode(e,t,n);return i};e.prototype.comment=function(e,t,n){var i;this.openNode(e,t,n);t.state=g.OpenTag;i=this.indent(e,t,n)+"\x3c!-- ";t.state=g.InsideTag;i+=e.value;t.state=g.CloseTag;i+=" --\x3e"+this.endline(e,t,n);t.state=g.None;this.closeNode(e,t,n);return i};e.prototype.declaration=function(e,t,n){var i;this.openNode(e,t,n);t.state=g.OpenTag;i=this.indent(e,t,n)+"<?xml";t.state=g.InsideTag;i+=' version="'+e.version+'"';if(e.encoding!=null){i+=' encoding="'+e.encoding+'"'}if(e.standalone!=null){i+=' standalone="'+e.standalone+'"'}t.state=g.CloseTag;i+=t.spaceBeforeSlash+"?>";i+=this.endline(e,t,n);t.state=g.None;this.closeNode(e,t,n);return i};e.prototype.docType=function(e,t,n){var i,r,o,s,a;n||(n=0);this.openNode(e,t,n);t.state=g.OpenTag;s=this.indent(e,t,n);s+="<!DOCTYPE "+e.root().name;if(e.pubID&&e.sysID){s+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'}else if(e.sysID){s+=' SYSTEM "'+e.sysID+'"'}if(e.children.length>0){s+=" [";s+=this.endline(e,t,n);t.state=g.InsideTag;a=e.children;for(r=0,o=a.length;r<o;r++){i=a[r];s+=this.writeChildNode(i,t,n+1)}t.state=g.CloseTag;s+="]"}t.state=g.CloseTag;s+=t.spaceBeforeSlash+">";s+=this.endline(e,t,n);t.state=g.None;this.closeNode(e,t,n);return s};e.prototype.element=function(e,t,n){var i,r,o,s,a,u,l,f,c,h,d,p,v,m;n||(n=0);h=false;d="";this.openNode(e,t,n);t.state=g.OpenTag;d+=this.indent(e,t,n)+"<"+e.name;p=e.attribs;for(c in p){if(!P.call(p,c))continue;i=p[c];d+=this.attribute(i,t,n)}o=e.children.length;s=o===0?null:e.children[0];if(o===0||e.children.every(function(e){return(e.type===y.Text||e.type===y.Raw)&&e.value===""})){if(t.allowEmpty){d+=">";t.state=g.CloseTag;d+="</"+e.name+">"+this.endline(e,t,n)}else{t.state=g.CloseTag;d+=t.spaceBeforeSlash+"/>"+this.endline(e,t,n)}}else if(t.pretty&&o===1&&(s.type===y.Text||s.type===y.Raw)&&s.value!=null){d+=">";t.state=g.InsideTag;t.suppressPrettyCount++;h=true;d+=this.writeChildNode(s,t,n+1);t.suppressPrettyCount--;h=false;t.state=g.CloseTag;d+="</"+e.name+">"+this.endline(e,t,n)}else{if(t.dontPrettyTextNodes){v=e.children;for(a=0,l=v.length;a<l;a++){r=v[a];if((r.type===y.Text||r.type===y.Raw)&&r.value!=null){t.suppressPrettyCount++;h=true;break}}}d+=">"+this.endline(e,t,n);t.state=g.InsideTag;m=e.children;for(u=0,f=m.length;u<f;u++){r=m[u];d+=this.writeChildNode(r,t,n+1)}t.state=g.CloseTag;d+=this.indent(e,t,n)+"</"+e.name+">";if(h){t.suppressPrettyCount--}d+=this.endline(e,t,n);t.state=g.None}this.closeNode(e,t,n);return d};e.prototype.writeChildNode=function(e,t,n){switch(e.type){case y.CData:return this.cdata(e,t,n);case y.Comment:return this.comment(e,t,n);case y.Element:return this.element(e,t,n);case y.Raw:return this.raw(e,t,n);case y.Text:return this.text(e,t,n);case y.ProcessingInstruction:return this.processingInstruction(e,t,n);case y.Dummy:return"";case y.Declaration:return this.declaration(e,t,n);case y.DocType:return this.docType(e,t,n);case y.AttributeDeclaration:return this.dtdAttList(e,t,n);case y.ElementDeclaration:return this.dtdElement(e,t,n);case y.EntityDeclaration:return this.dtdEntity(e,t,n);case y.NotationDeclaration:return this.dtdNotation(e,t,n);default:throw new Error("Unknown XML node type: "+e.constructor.name)}};e.prototype.processingInstruction=function(e,t,n){var i;this.openNode(e,t,n);t.state=g.OpenTag;i=this.indent(e,t,n)+"<?";t.state=g.InsideTag;i+=e.target;if(e.value){i+=" "+e.value}t.state=g.CloseTag;i+=t.spaceBeforeSlash+"?>";i+=this.endline(e,t,n);t.state=g.None;this.closeNode(e,t,n);return i};e.prototype.raw=function(e,t,n){var i;this.openNode(e,t,n);t.state=g.OpenTag;i=this.indent(e,t,n);t.state=g.InsideTag;i+=e.value;t.state=g.CloseTag;i+=this.endline(e,t,n);t.state=g.None;this.closeNode(e,t,n);return i};e.prototype.text=function(e,t,n){var i;this.openNode(e,t,n);t.state=g.OpenTag;i=this.indent(e,t,n);t.state=g.InsideTag;i+=e.value;t.state=g.CloseTag;i+=this.endline(e,t,n);t.state=g.None;this.closeNode(e,t,n);return i};e.prototype.dtdAttList=function(e,t,n){var i;this.openNode(e,t,n);t.state=g.OpenTag;i=this.indent(e,t,n)+"<!ATTLIST";t.state=g.InsideTag;i+=" "+e.elementName+" "+e.attributeName+" "+e.attributeType;if(e.defaultValueType!=="#DEFAULT"){i+=" "+e.defaultValueType}if(e.defaultValue){i+=' "'+e.defaultValue+'"'}t.state=g.CloseTag;i+=t.spaceBeforeSlash+">"+this.endline(e,t,n);t.state=g.None;this.closeNode(e,t,n);return i};e.prototype.dtdElement=function(e,t,n){var i;this.openNode(e,t,n);t.state=g.OpenTag;i=this.indent(e,t,n)+"<!ELEMENT";t.state=g.InsideTag;i+=" "+e.name+" "+e.value;t.state=g.CloseTag;i+=t.spaceBeforeSlash+">"+this.endline(e,t,n);t.state=g.None;this.closeNode(e,t,n);return i};e.prototype.dtdEntity=function(e,t,n){var i;this.openNode(e,t,n);t.state=g.OpenTag;i=this.indent(e,t,n)+"<!ENTITY";t.state=g.InsideTag;if(e.pe){i+=" %"}i+=" "+e.name;if(e.value){i+=' "'+e.value+'"'}else{if(e.pubID&&e.sysID){i+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'}else if(e.sysID){i+=' SYSTEM "'+e.sysID+'"'}if(e.nData){i+=" NDATA "+e.nData}}t.state=g.CloseTag;i+=t.spaceBeforeSlash+">"+this.endline(e,t,n);t.state=g.None;this.closeNode(e,t,n);return i};e.prototype.dtdNotation=function(e,t,n){var i;this.openNode(e,t,n);t.state=g.OpenTag;i=this.indent(e,t,n)+"<!NOTATION";t.state=g.InsideTag;i+=" "+e.name;if(e.pubID&&e.sysID){i+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'}else if(e.pubID){i+=' PUBLIC "'+e.pubID+'"'}else if(e.sysID){i+=' SYSTEM "'+e.sysID+'"'}t.state=g.CloseTag;i+=t.spaceBeforeSlash+">"+this.endline(e,t,n);t.state=g.None;this.closeNode(e,t,n);return i};e.prototype.openNode=function(e,t,n){};e.prototype.closeNode=function(e,t,n){};e.prototype.openAttribute=function(e,t,n){};e.prototype.closeAttribute=function(e,t,n){};return e}()}).call(this)},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return n.call(e)=="[object Array]"}},function(G,e,V){"use strict";(function(e,y){var g=V(15);G.exports=v;var i=V(52);var s;v.ReadableState=p;var L=V(13).EventEmitter;var P=function(e,t){return e.listeners(t).length};var r=V(54);var a=V(16).Buffer;var t=e.Uint8Array||function(){};function u(e){return a.from(e)}function o(e){return a.isBuffer(e)||e instanceof t}var n=Object.create(V(9));n.inherits=V(7);var l=V(103);var w=void 0;if(l&&l.debuglog){w=l.debuglog("stream")}else{w=function(){}}var f=V(104);var c=V(55);var h;n.inherits(v,r);var d=["error","close","destroy","pause","resume"];function S(e,t,n){if(typeof e.prependListener==="function")return e.prependListener(t,n);if(!e._events||!e._events[t])e.on(t,n);else if(i(e._events[t]))e._events[t].unshift(n);else e._events[t]=[n,e._events[t]]}function p(e,t){s=s||V(5);e=e||{};var n=t instanceof s;this.objectMode=!!e.objectMode;if(n)this.objectMode=this.objectMode||!!e.readableObjectMode;var i=e.highWaterMark;var r=e.readableHighWaterMark;var o=this.objectMode?16:16*1024;if(i||i===0)this.highWaterMark=i;else if(n&&(r||r===0))this.highWaterMark=r;else this.highWaterMark=o;this.highWaterMark=Math.floor(this.highWaterMark);this.buffer=new f;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.destroyed=false;this.defaultEncoding=e.defaultEncoding||"utf8";this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(e.encoding){if(!h)h=V(37).StringDecoder;this.decoder=new h(e.encoding);this.encoding=e.encoding}}function v(e){s=s||V(5);if(!(this instanceof v))return new v(e);this._readableState=new p(e,this);this.readable=true;if(e){if(typeof e.read==="function")this._read=e.read;if(typeof e.destroy==="function")this._destroy=e.destroy}r.call(this)}Object.defineProperty(v.prototype,"destroyed",{get:function(){if(this._readableState===undefined){return false}return this._readableState.destroyed},set:function(e){if(!this._readableState){return}this._readableState.destroyed=e}});v.prototype.destroy=c.destroy;v.prototype._undestroy=c.undestroy;v.prototype._destroy=function(e,t){this.push(null);t(e)};v.prototype.push=function(e,t){var n=this._readableState;var i;if(!n.objectMode){if(typeof e==="string"){t=t||n.defaultEncoding;if(t!==n.encoding){e=a.from(e,t);t=""}i=true}}else{i=true}return m(this,e,t,false,i)};v.prototype.unshift=function(e){return m(this,e,null,true,false)};function m(e,t,n,i,r){var o=e._readableState;if(t===null){o.reading=false;D(e,o)}else{var s;if(!r)s=b(o,t);if(s){e.emit("error",s)}else if(o.objectMode||t&&t.length>0){if(typeof t!=="string"&&!o.objectMode&&Object.getPrototypeOf(t)!==a.prototype){t=u(t)}if(i){if(o.endEmitted)e.emit("error",new Error("stream.unshift() after end event"));else _(e,o,t,true)}else if(o.ended){e.emit("error",new Error("stream.push() after EOF"))}else{o.reading=false;if(o.decoder&&!n){t=o.decoder.write(t);if(o.objectMode||t.length!==0)_(e,o,t,false);else E(e,o)}else{_(e,o,t,false)}}}else if(!i){o.reading=false}}return C(o)}function _(e,t,n,i){if(t.flowing&&t.length===0&&!t.sync){e.emit("data",n);e.read(0)}else{t.length+=t.objectMode?1:n.length;if(i)t.buffer.unshift(n);else t.buffer.push(n);if(t.needReadable)x(e)}E(e,t)}function b(e,t){var n;if(!o(t)&&typeof t!=="string"&&t!==undefined&&!e.objectMode){n=new TypeError("Invalid non-string/buffer chunk")}return n}function C(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}v.prototype.isPaused=function(){return this._readableState.flowing===false};v.prototype.setEncoding=function(e){if(!h)h=V(37).StringDecoder;this._readableState.decoder=new h(e);this._readableState.encoding=e;return this};var k=8388608;function T(e){if(e>=k){e=k}else{e--;e|=e>>>1;e|=e>>>2;e|=e>>>4;e|=e>>>8;e|=e>>>16;e++}return e}function R(e,t){if(e<=0||t.length===0&&t.ended)return 0;if(t.objectMode)return 1;if(e!==e){if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length}if(e>t.highWaterMark)t.highWaterMark=T(e);if(e<=t.length)return e;if(!t.ended){t.needReadable=true;return 0}return t.length}v.prototype.read=function(e){w("read",e);e=parseInt(e,10);var t=this._readableState;var n=e;if(e!==0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){w("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)O(this);else x(this);return null}e=R(e,t);if(e===0&&t.ended){if(t.length===0)O(this);return null}var i=t.needReadable;w("need readable",i);if(t.length===0||t.length-e<t.highWaterMark){i=true;w("length less than watermark",i)}if(t.ended||t.reading){i=false;w("reading or ended",i)}else if(i){w("do read");t.reading=true;t.sync=true;if(t.length===0)t.needReadable=true;this._read(t.highWaterMark);t.sync=false;if(!t.reading)e=R(n,t)}var r;if(e>0)r=A(e,t);else r=null;if(r===null){t.needReadable=true;e=0}else{t.length-=e}if(t.length===0){if(!t.ended)t.needReadable=true;if(n!==e&&t.ended)O(this)}if(r!==null)this.emit("data",r);return r};function D(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();if(n&&n.length){t.buffer.push(n);t.length+=t.objectMode?1:n.length}}t.ended=true;x(e)}function x(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){w("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)g.nextTick(I,e);else I(e)}}function I(e){w("emit readable");e.emit("readable");q(e)}function E(e,t){if(!t.readingMore){t.readingMore=true;g.nextTick(F,e,t)}}function F(e,t){var n=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark){w("maybeReadMore read 0");e.read(0);if(n===t.length)break;else n=t.length}t.readingMore=false}v.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};v.prototype.pipe=function(n,e){var i=this;var r=this._readableState;switch(r.pipesCount){case 0:r.pipes=n;break;case 1:r.pipes=[r.pipes,n];break;default:r.pipes.push(n);break}r.pipesCount+=1;w("pipe count=%d opts=%j",r.pipesCount,e);var t=(!e||e.end!==false)&&n!==y.stdout&&n!==y.stderr;var o=t?a:m;if(r.endEmitted)g.nextTick(o);else i.once("end",o);n.on("unpipe",s);function s(e,t){w("onunpipe");if(e===i){if(t&&t.hasUnpiped===false){t.hasUnpiped=true;f()}}}function a(){w("onend");n.end()}var u=W(i);n.on("drain",u);var l=false;function f(){w("cleanup");n.removeListener("close",p);n.removeListener("finish",v);n.removeListener("drain",u);n.removeListener("error",d);n.removeListener("unpipe",s);i.removeListener("end",a);i.removeListener("end",m);i.removeListener("data",h);l=true;if(r.awaitDrain&&(!n._writableState||n._writableState.needDrain))u()}var c=false;i.on("data",h);function h(e){w("ondata");c=false;var t=n.write(e);if(false===t&&!c){if((r.pipesCount===1&&r.pipes===n||r.pipesCount>1&&M(r.pipes,n)!==-1)&&!l){w("false write response, pause",i._readableState.awaitDrain);i._readableState.awaitDrain++;c=true}i.pause()}}function d(e){w("onerror",e);m();n.removeListener("error",d);if(P(n,"error")===0)n.emit("error",e)}S(n,"error",d);function p(){n.removeListener("finish",v);m()}n.once("close",p);function v(){w("onfinish");n.removeListener("close",p);m()}n.once("finish",v);function m(){w("unpipe");i.unpipe(n)}n.emit("pipe",i);if(!r.flowing){w("pipe resume");i.resume()}return n};function W(t){return function(){var e=t._readableState;w("pipeOnDrain",e.awaitDrain);if(e.awaitDrain)e.awaitDrain--;if(e.awaitDrain===0&&P(t,"data")){e.flowing=true;q(t)}}}v.prototype.unpipe=function(e){var t=this._readableState;var n={hasUnpiped:false};if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;t.flowing=false;if(e)e.emit("unpipe",this,n);return this}if(!e){var i=t.pipes;var r=t.pipesCount;t.pipes=null;t.pipesCount=0;t.flowing=false;for(var o=0;o<r;o++){i[o].emit("unpipe",this,n)}return this}var s=M(t.pipes,e);if(s===-1)return this;t.pipes.splice(s,1);t.pipesCount-=1;if(t.pipesCount===1)t.pipes=t.pipes[0];e.emit("unpipe",this,n);return this};v.prototype.on=function(e,t){var n=r.prototype.on.call(this,e,t);if(e==="data"){if(this._readableState.flowing!==false)this.resume()}else if(e==="readable"){var i=this._readableState;if(!i.endEmitted&&!i.readableListening){i.readableListening=i.needReadable=true;i.emittedReadable=false;if(!i.reading){g.nextTick(N,this)}else if(i.length){x(this)}}}return n};v.prototype.addListener=v.prototype.on;function N(e){w("readable nexttick read 0");e.read(0)}v.prototype.resume=function(){var e=this._readableState;if(!e.flowing){w("resume");e.flowing=true;B(this,e)}return this};function B(e,t){if(!t.resumeScheduled){t.resumeScheduled=true;g.nextTick(z,e,t)}}function z(e,t){if(!t.reading){w("resume read 0");e.read(0)}t.resumeScheduled=false;t.awaitDrain=0;e.emit("resume");q(e);if(t.flowing&&!t.reading)e.read(0)}v.prototype.pause=function(){w("call pause flowing=%j",this._readableState.flowing);if(false!==this._readableState.flowing){w("pause");this._readableState.flowing=false;this.emit("pause")}return this};function q(e){var t=e._readableState;w("flow",t.flowing);while(t.flowing&&e.read()!==null){}}v.prototype.wrap=function(n){var i=this;var r=this._readableState;var o=false;n.on("end",function(){w("wrapped end");if(r.decoder&&!r.ended){var e=r.decoder.end();if(e&&e.length)i.push(e)}i.push(null)});n.on("data",function(e){w("wrapped data");if(r.decoder)e=r.decoder.write(e);if(r.objectMode&&(e===null||e===undefined))return;else if(!r.objectMode&&(!e||!e.length))return;var t=i.push(e);if(!t){o=true;n.pause()}});for(var e in n){if(this[e]===undefined&&typeof n[e]==="function"){this[e]=function(e){return function(){return n[e].apply(n,arguments)}}(e)}}for(var t=0;t<d.length;t++){n.on(d[t],this.emit.bind(this,d[t]))}this._read=function(e){w("wrapped _read",e);if(o){o=false;n.resume()}};return this};Object.defineProperty(v.prototype,"readableHighWaterMark",{enumerable:false,get:function(){return this._readableState.highWaterMark}});v._fromList=A;function A(e,t){if(t.length===0)return null;var n;if(t.objectMode)n=t.buffer.shift();else if(!e||e>=t.length){if(t.decoder)n=t.buffer.join("");else if(t.buffer.length===1)n=t.buffer.head.data;else n=t.buffer.concat(t.length);t.buffer.clear()}else{n=J(e,t.buffer,t.decoder)}return n}function J(e,t,n){var i;if(e<t.head.data.length){i=t.head.data.slice(0,e);t.head.data=t.head.data.slice(e)}else if(e===t.head.data.length){i=t.shift()}else{i=n?H(e,t):U(e,t)}return i}function H(e,t){var n=t.head;var i=1;var r=n.data;e-=r.length;while(n=n.next){var o=n.data;var s=e>o.length?o.length:e;if(s===o.length)r+=o;else r+=o.slice(0,e);e-=s;if(e===0){if(s===o.length){++i;if(n.next)t.head=n.next;else t.head=t.tail=null}else{t.head=n;n.data=o.slice(s)}break}++i}t.length-=i;return r}function U(e,t){var n=a.allocUnsafe(e);var i=t.head;var r=1;i.data.copy(n);e-=i.data.length;while(i=i.next){var o=i.data;var s=e>o.length?o.length:e;o.copy(n,n.length-e,0,s);e-=s;if(e===0){if(s===o.length){++r;if(i.next)t.head=i.next;else t.head=t.tail=null}else{t.head=i;i.data=o.slice(s)}break}++r}t.length-=r;return n}function O(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');if(!t.endEmitted){t.ended=true;g.nextTick(j,t,e)}}function j(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function M(e,t){for(var n=0,i=e.length;n<i;n++){if(e[n]===t)return n}return-1}}).call(this,V(6),V(14))},function(e,t,n){e.exports=n(13).EventEmitter},function(e,t,n){"use strict";var o=n(15);function i(e,t){var n=this;var i=this._readableState&&this._readableState.destroyed;var r=this._writableState&&this._writableState.destroyed;if(i||r){if(t){t(e)}else if(e&&(!this._writableState||!this._writableState.errorEmitted)){o.nextTick(s,this,e)}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(e||null,function(e){if(!t&&e){o.nextTick(s,n,e);if(n._writableState){n._writableState.errorEmitted=true}}else if(t){t(e)}});return this}function r(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function s(e,t){e.emit("error",t)}e.exports={destroy:i,undestroy:r}},function(e,r,o){(function(e){var t=typeof e!=="undefined"&&e||typeof self!=="undefined"&&self||window;var n=Function.prototype.apply;r.setTimeout=function(){return new i(n.call(setTimeout,t,arguments),clearTimeout)};r.setInterval=function(){return new i(n.call(setInterval,t,arguments),clearInterval)};r.clearTimeout=r.clearInterval=function(e){if(e){e.close()}};function i(e,t){this._id=e;this._clearFn=t}i.prototype.unref=i.prototype.ref=function(){};i.prototype.close=function(){this._clearFn.call(t,this._id)};r.enroll=function(e,t){clearTimeout(e._idleTimeoutId);e._idleTimeout=t};r.unenroll=function(e){clearTimeout(e._idleTimeoutId);e._idleTimeout=-1};r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;if(t>=0){e._idleTimeoutId=setTimeout(function n(){if(e._onTimeout)e._onTimeout()},t)}};o(106);r.setImmediate=typeof self!=="undefined"&&self.setImmediate||typeof e!=="undefined"&&e.setImmediate||this&&this.setImmediate;r.clearImmediate=typeof self!=="undefined"&&self.clearImmediate||typeof e!=="undefined"&&e.clearImmediate||this&&this.clearImmediate}).call(this,o(6))},function(e,t,n){"use strict";e.exports=s;var i=n(5);var r=Object.create(n(9));r.inherits=n(7);r.inherits(s,i);function o(e,t){var n=this._transformState;n.transforming=false;var i=n.writecb;if(!i){return this.emit("error",new Error("write callback called multiple times"))}n.writechunk=null;n.writecb=null;if(t!=null)this.push(t);i(e);var r=this._readableState;r.reading=false;if(r.needReadable||r.length<r.highWaterMark){this._read(r.highWaterMark)}}function s(e){if(!(this instanceof s))return new s(e);i.call(this,e);this._transformState={afterTransform:o.bind(this),needTransform:false,transforming:false,writecb:null,writechunk:null,writeencoding:null};this._readableState.needReadable=true;this._readableState.sync=false;if(e){if(typeof e.transform==="function")this._transform=e.transform;if(typeof e.flush==="function")this._flush=e.flush}this.on("prefinish",a)}function a(){var n=this;if(typeof this._flush==="function"){this._flush(function(e,t){u(n,e,t)})}else{u(this,null,null)}}s.prototype.push=function(e,t){this._transformState.needTransform=false;return i.prototype.push.call(this,e,t)};s.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")};s.prototype._write=function(e,t,n){var i=this._transformState;i.writecb=n;i.writechunk=e;i.writeencoding=t;if(!i.transforming){var r=this._readableState;if(i.needTransform||r.needReadable||r.length<r.highWaterMark)this._read(r.highWaterMark)}};s.prototype._read=function(e){var t=this._transformState;if(t.writechunk!==null&&t.writecb&&!t.transforming){t.transforming=true;this._transform(t.writechunk,t.writeencoding,t.afterTransform)}else{t.needTransform=true}};s.prototype._destroy=function(e,t){var n=this;i.prototype._destroy.call(this,e,function(e){t(e);n.emit("close")})};function u(e,t,n){if(t)return e.emit("error",t);if(n!=null)e.push(n);if(e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}},function(e,n){(function(){"use strict";var t;t=new RegExp(/(?!xmlns)^.*:/);n.normalize=function(e){return e.toLowerCase()};n.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)};n.stripPrefix=function(e){return e.replace(t,"")};n.parseNumbers=function(e){if(!isNaN(e)){e=e%1===0?parseInt(e,10):parseFloat(e)}return e};n.parseBooleans=function(e){if(/^(?:true|false)$/i.test(e)){e=e.toLowerCase()==="true"}return e}}).call(this)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var h=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(e,t,n){if(t)i(e.prototype,t);if(n)i(e,n);return e}}();function p(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var i=function(){function e(){p(this,e);this._keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}h(e,[{key:"browser",value:function d(){var e=/(edge)[/]([\w.]+)/;var t=/(chrome)[/]([\w.]+)/;var n=/(safari)[/]([\w.]+)/;var i=/(opera)(?:.*version)?[/]([\w.]+)/;var r=/(msie) ([\w.]+)/;var o=/(trident.*rv:)([\w.]+)/;var s=/(mozilla)(?:.*? rv:([\w.]+))?/;var a=navigator.userAgent.toLowerCase();var u=e.exec(a)||t.exec(a)||n.exec(a)||i.exec(a)||r.exec(a)||o.exec(a)||a.indexOf("compatible")<0&&s.exec(a)||["unknow","0"];if(u.length>0&&u[1].indexOf("trident")>-1){u[1]="msie"}var l={};l[u[1]]=true;l.version=Math.floor(u[2].split(".")[0]);if(l.safari){var f=a.indexOf("version/")+8;var c=a.indexOf(" safari/");var h=a.slice(f,c);l.version=Math.floor(h.split(".")[0])}return l}},{key:"createEventScript",value:function r(e,t,n){var i=document.createElement("script");i.htmlFor=e;i.event=t;i.innerHTML=n;document.getElementById(e).appendChild(i)}},{key:"createxmlDoc",value:function o(){var e;var t=["MSXML2.DOMDocument","MSXML2.DOMDocument.5.0","MSXML2.DOMDocument.4.0","MSXML2.DOMDocument.3.0","Microsoft.XmlDom"];for(var n=0,i=t.length;n<i;n++){try{e=new ActiveXObject(t[n]);break}catch(r){e=document.implementation.createDocument("","",null);break}}e["async"]="false";return e}},{key:"parseXmlFromStr",value:function s(e){if(null===e||""===e){return null}e=e.replace(/&(?!lt;|amp;|gt;|apos;|quot;)/g,"&amp;");var t=null;try{if(window.navigator.userAgent.indexOf("MSIE 9.0")>0){t=new ActiveXObject("Microsoft.XMLDOM");t["async"]=false;t.loadXML(e)}else{var n=new DOMParser;t=n.parseFromString(e,"text/xml")}}catch(i){t=new ActiveXObject("Microsoft.XMLDOM");t["async"]=false;t.loadXML(e)}return t}},{key:"isNotSupportNoPlugin",value:function n(){var e=this.browser();var t=false;if(e.edge&&e.version<16){t=true}else if(e.safari&&e.version<11){t=true}else if(e.chrome&&e.version<57){t=true}else if(e.firfox&&e.version<52){t=true}return t}},{key:"encode",value:function f(e){var t="";var n;var i;var r;var o;var s;var a;var u;var l=0;e=this._utf8_encode(e);while(l<e.length){n=e.charCodeAt(l++);i=e.charCodeAt(l++);r=e.charCodeAt(l++);o=n>>2;s=(n&3)<<4|i>>4;a=(i&15)<<2|r>>6;u=r&63;if(isNaN(i)){a=u=64}else if(isNaN(r)){u=64}t=t+this._keyStr.charAt(o)+this._keyStr.charAt(s)+this._keyStr.charAt(a)+this._keyStr.charAt(u)}return t}},{key:"decode",value:function c(e){var t="";var n;var i;var r;var o;var s;var a;var u;var l=0;e=e.replace(/[^A-Za-z0-9+/=]/g,"");while(l<e.length){o=this._keyStr.indexOf(e.charAt(l++));s=this._keyStr.indexOf(e.charAt(l++));a=this._keyStr.indexOf(e.charAt(l++));u=this._keyStr.indexOf(e.charAt(l++));n=o<<2|s>>4;i=(s&15)<<4|a>>2;r=(a&3)<<6|u;t=t+String.fromCharCode(n);if(a!==64){t=t+String.fromCharCode(i)}if(u!==64){t=t+String.fromCharCode(r)}}t=this._utf8_decode(t);return t}},{key:"_utf8_encode",value:function a(e){e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n<e.length;n++){var i=e.charCodeAt(n);if(i<128){t+=String.fromCharCode(i)}else if(i>127&&i<2048){t+=String.fromCharCode(i>>6|192);t+=String.fromCharCode(i&63|128)}else{t+=String.fromCharCode(i>>12|224);t+=String.fromCharCode(i>>6&63|128);t+=String.fromCharCode(i&63|128)}}return t}},{key:"_utf8_decode",value:function u(e){var t="";var n=0;var i=0;var r=0;while(n<e.length){i=e.charCodeAt(n);if(i<128){t+=String.fromCharCode(i);n++}else if(i>191&&i<224){r=e.charCodeAt(n+1);t+=String.fromCharCode((i&31)<<6|r&63);n+=2}else{r=e.charCodeAt(n+1);var o=e.charCodeAt(n+2);t+=String.fromCharCode((i&15)<<12|(r&63)<<6|o&63);n+=3}}return t}},{key:"colorTransfer",value:function i(e){var t=parseInt(e,10);var n=t.toString(16);n="0"+n;return n.substring(n.length-2)}},{key:"colorRgb",value:function l(e){var t=e.toLowerCase();var n=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;if(t&&n.test(t)){if(t.length===4){var i="#";for(var r=1;r<4;r+=1){i+=t.slice(r,r+1).concat(t.slice(r,r+1))}t=i}var o=[];for(var s=1;s<7;s+=2){o.push(parseInt("0x"+t.slice(s,s+2),16))}return o}return[0,0,0]}}]);return e}();var r=t.oUtils=new i},function(e,t,n){e.exports=n(61)},function(e,t,n){"use strict";(function(Xt){Object.defineProperty(t,"__esModule",{value:true});t.JSVideoPlugin=undefined;var Zt=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(e,t,n){if(t)i(e.prototype,t);if(n)i(e,n);return e}}();var Kt=n(62);var $t=n(75);var Qt=n(114);var en=n(59);function tn(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++){n[t]=e[t]}return n}else{return Array.from(e)}}function nn(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var rn=[];var e=function(){var e=function(){function n(e){nn(this,n);var t={szId:"playWnd",iType:0,iWidth:400,iHeight:300,iMaxSplit:4,iCurrentSplit:2,szPlayMode:"normal",szBasePath:"./dist",onConnectSuccess:null,onConnectError:null,oSessionInfo:null,bNewInstance:false,iPluginType:-1,iFoceInitMode:0};this.oOptions=Xt.extend(t,e);this.oPlugin=null;this.iPluginMode=0;this._getVideoPlugin()}Zt(n,[{key:"initActiveX",value:function i(){var e=this;try{e.oPlugin=new Qt.ActiveXControl({szId:e.oOptions.szId,iType:e.oOptions.iType,iWidth:e.oOptions.iWidth,iHeight:e.oOptions.iHeight,iMaxSplit:e.oOptions.iMaxSplit,iCurrentSplit:e.oOptions.iCurrentSplit,szPlayMode:e.oOptions.szPlayMode,szClassId:e.oOptions.szClassId,szIframeId:e.oOptions.szIframeId,szBackgroundColor:e.oOptions.szBackgroundColor,szSubBackgroundColor:e.oOptions.szSubBackgroundColor,szBorderColor:e.oOptions.szBorderColor,szSelectBorderColor:e.oOptions.szSelectBorderColor});e.iPluginMode=0;if(e.oPlugin.oPlugin){setTimeout(function(){e.oOptions.onConnectSuccess&&e.oOptions.onConnectSuccess()},50)}else{setTimeout(function(){e.oOptions.onConnectError&&e.oOptions.onConnectError()},50)}}catch(t){e.oOptions.onConnectError&&e.oOptions.onConnectError(t)}}},{key:"initJSPlugin",value:function r(){var e=this;try{e.oPlugin=new Kt.JSPlugin({szId:e.oOptions.szId,iType:e.oOptions.iType,iWidth:e.oOptions.iWidth,iHeight:e.oOptions.iHeight,iMaxSplit:e.oOptions.iMaxSplit,iCurrentSplit:e.oOptions.iCurrentSplit,szBasePath:e.oOptions.szBasePath,szPlayMode:e.oOptions.szPlayMode,oStyle:e.oOptions.oStyle,szIframeId:e.oOptions.szIframeId,szBackgroundColor:e.oOptions.szBackgroundColor?"#"+e.oOptions.szBackgroundColor:"",szSubBackgroundColor:e.oOptions.szSubBackgroundColor?"#"+e.oOptions.szSubBackgroundColor:"",szBorderColor:e.oOptions.szBorderColor?"#"+e.oOptions.szBorderColor:"",szSelectBorderColor:e.oOptions.szSelectBorderColor?"#"+e.oOptions.szSelectBorderColor:""});e.iPluginMode=1;e.oOptions.onConnectSuccess&&e.oOptions.onConnectSuccess()}catch(t){e.oOptions.onConnectError&&e.oOptions.onConnectError()}}},{key:"initLocalService",value:function o(){var e=this;var t={bNoDetectPort:e.oOptions.bNoDetectPort,oSessionInfo:e.oOptions.oSessionInfo,szPluginContainer:e.oOptions.szId,szIframeId:e.oOptions.szIframeId,bChildIframe:e.oOptions.bChildIframe,szChildIframeId:e.oOptions.szChildIframeId,szBackgroundColor:e.oOptions.szBackgroundColor,szSubBackgroundColor:e.oOptions.szSubBackgroundColor,szBorderColor:e.oOptions.szBorderColor,szSelectBorderColor:e.oOptions.szSelectBorderColor,szPlayMode:e.oOptions.szPlayMode,cbConnectSuccess:function n(){e.oPlugin.bLocalServiceRunning=true;rn[e.oOptions.szId]=e.oPlugin;e.iPluginMode=2;if(e.oOptions.iType!==0){e.oPlugin.JS_CreateWnd(e.oOptions.szId,e.oOptions.iWidth,e.oOptions.iHeight).then(function(){setTimeout(function(){e.JS_ArrangeWindow(e.oOptions.iCurrentSplit,[]).then(function(){},function(){});e.oOptions.onConnectSuccess&&e.oOptions.onConnectSuccess()},50)},function(){e.oOptions.onConnectSuccess&&e.oOptions.onConnectSuccess("create window error")})}else{setTimeout(function(){e.JS_ArrangeWindow(e.oOptions.iCurrentSplit,[]).then(function(){},function(){});e.oOptions.onConnectSuccess&&e.oOptions.onConnectSuccess()},50)}},cbConnectError:function i(){e.oPlugin.bLocalServiceRunning=false;if(!en.oUtils.isNotSupportNoPlugin()){setTimeout(function(){e.initJSPlugin()},300)}else{e.oOptions.onConnectError&&e.oOptions.onConnectError()}},cbConnectClose:function r(){e.oPlugin.bLocalServiceRunning=false;e.oOptions.onConnectClose&&e.oOptions.onConnectClose();e.oPlugin=null;delete rn[e.oOptions.szId]},iServicePortStart:e.oOptions.iServicePortStart,iServicePortEnd:e.oOptions.iServicePortEnd,bUseInQT:e.oOptions.bUseInQT};if("bEmbed"in e.oOptions){t.bEmbed=!!e.oOptions.bEmbed}if("beforeCreateWnd"in e.oOptions&&"function"===typeof e.oOptions.beforeCreateWnd){t.beforeCreateWnd=e.oOptions.beforeCreateWnd}e.oPlugin=new $t.LocalServiceControl(t)}},{key:"reInitLocalService",value:function t(){var e=this;e.oPlugin=rn[e.oOptions.szId];e.iPluginMode=2;if(e.oOptions.iType!==0){e.oPlugin.JS_CreateWnd(e.oOptions.szId,e.oOptions.iWidth,e.oOptions.iHeight).then(function(){setTimeout(function(){e.JS_ArrangeWindow(e.oOptions.iCurrentSplit,[]).then(function(){},function(){});e.oOptions.onConnectSuccess&&e.oOptions.onConnectSuccess()},50)},function(){})}else{setTimeout(function(){e.JS_ArrangeWindow(e.oOptions.iCurrentSplit,[]).then(function(){},function(){});e.oOptions.onConnectSuccess&&e.oOptions.onConnectSuccess()},50)}}},{key:"_getVideoPlugin",value:function s(){var e=this;if(e.oOptions.iFoceInitMode>0){e.oOptions.iPluginType=e.oOptions.iFoceInitMode}if(e.oOptions.iPluginType>-1){if(e.oOptions.iPluginType===0){e.initActiveX()}else if(e.oOptions.iPluginType===1){setTimeout(function(){e.initJSPlugin()},300)}else if(e.oOptions.iPluginType===2){if(window._oMultiVideoPlugin&&!e.oOptions.bNewInstance){e.reInitLocalService()}else{e.initLocalService()}}return}if(en.oUtils.browser().msie){e.initActiveX()}else{if(rn[e.oOptions.szId]&&!e.oOptions.bNewInstance){e.reInitLocalService()}else{e.initLocalService()}}}},{key:"JS_GetVideoMode",value:function e(){return this.iPluginMode}},{key:"JS_CreateWnd",value:function a(e,t,n){return this.oPlugin.JS_CreateWnd(e,t,n)}},{key:"JS_ShowWnd",value:function u(){return this.oPlugin.JS_ShowWnd()}},{key:"JS_HideWnd",value:function l(){return this.oPlugin.JS_HideWnd()}},{key:"JS_SetWndCover",value:function f(e,t){return this.oPlugin.JS_SetWndCover(e,t)}},{key:"JS_CheckLocalServiceConnected",value:function c(){return $t.LocalServiceControl.prototype.JS_CheckLocalServiceConnected()}},{key:"JS_SetWindowControlCallback",value:function h(e){this.oPlugin.JS_SetWindowControlCallback(e)}},{key:"JS_ArrangeWindow",value:function d(e,t){return this.oPlugin.JS_ArrangeWindow(e,t)}},{key:"JS_SetSecretKey",value:function p(e,t,n){return this.oPlugin.JS_SetSecretKey(e,t,n)}},{key:"JS_SetOriginalString",value:function v(e,t){return this.oPlugin.JS_SetOriginalString(e,t)}},{key:"JS_GetEncryptString",value:function m(e,t,n){return this.oPlugin.JS_GetEncryptString(e,t,n)}},{key:"JS_GetDecryptString",value:function y(e,t,n){return this.oPlugin.JS_GetDecryptString(e,t,n)}},{key:"JS_DestroyPlugin",value:function g(){return this.oPlugin.JS_DestroyPlugin(this.oOptions.bNewInstance)}},{key:"JS_Play",value:function P(e,t,n,i,r,o){var s=e.indexOf("://")+3;var a=e.substring(s).indexOf("/");var u=e.substring(0,a+s);var l=e.substring(a+s+1);if(this.iPluginMode===0||this.iPluginMode===2){if(!o){if(!i&&!r){e=u.replace(/video/i,"rtsp")+"/ISAPI/streaming/channels/"+l;if(l==="0"){e=u.replace(/video/i,"rtsp")+"/ISAPI/Custom/SelfExt/ContentMgmt/ZeroStreaming/channels/101"}}else{e=u.replace(/video/i,"rtsp")+"/ISAPI/streaming/tracks/"+l+"?starttime="+i+"&endtime="+r}}var f=t.auth;var c=en.oUtils.decode(f);if(c.indexOf(":::4:")===-1){f=t.userInfo}e=e.replace(/https/g,"http");e=e.replace(/rtsps/g,"rtsp");return this.oPlugin.JS_Play(e,{auth:f},n,i,r)}else if(this.iPluginMode===1){e=e.replace(/video/i,"ws");var h=en.oUtils.decode(t.auth);var d={sessionID:h.split("::")[1]};if(h.indexOf(":::3:")>-1){d={sessionID:h.split(":::3:")[1]}}else if(h.indexOf(":::4:")>-1){d={token:h.split(":::4:")[1]}}t.secondAuth&&(d.secondAuth=t.secondAuth);return this.oPlugin.JS_Play(e,d,n,i,r)}}},{key:"JS_Play2",value:function w(e,t){return this.oPlugin.JS_Play2(e,t)}},{key:"JS_OpenFileBrowser2",value:function S(e,t){return this.oPlugin.JS_OpenFileBrowser2(e,t)}},{key:"JS_uploadFileByForm",value:function _(e){return this.oPlugin.JS_uploadFileByForm(e)}},{key:"JS_StopFormAsynUpload",value:function b(){return this.oPlugin.JS_StopFormAsynUpload()}},{key:"JS_ReversePlay",value:function C(e,t,n,i,r){var o=e.indexOf("://")+3;var s=e.substring(o).indexOf("/");var a=e.substring(0,s+o);var u=e.substring(s+o+1);if(this.iPluginMode===0||this.iPluginMode===2){e=a.replace(/video/i,"rtsp")+"/ISAPI/streaming/tracks/"+u+"?starttime="+i+"&endtime="+r;var l=t.auth;var f=en.oUtils.decode(l);if(f.indexOf(":::4:")===-1){l=t.userInfo}e=e.replace(/https/g,"http");return this.oPlugin.JS_ReversePlay(e,{auth:l},n,i,r)}else if(this.iPluginMode===1){e=a.replace(/video/i,"ws");return this.oPlugin.JS_ReversePlay(e,t,n,i,r)}}},{key:"JS_Stop",value:function k(e){return this.oPlugin.JS_Stop(e)}},{key:"JS_Seek",value:function T(e,t,n){return this.oPlugin.JS_Seek(e,t,n)}},{key:"JS_StopRealPlayAll",value:function R(){return this.oPlugin.JS_StopRealPlayAll()}},{key:"JS_Pause",value:function D(e){return this.oPlugin.JS_Pause(e)}},{key:"JS_Resume",value:function x(e){return this.oPlugin.JS_Resume(e)}},{key:"JS_Slow",value:function I(e){return this.oPlugin.JS_Slow(e)}},{key:"JS_Fast",value:function E(e){return this.oPlugin.JS_Fast(e)}},{key:"JS_Transmission",value:function q(e,t){return this.oPlugin.JS_Transmission(e,t)}},{key:"JS_FrameForward",value:function A(e){return this.oPlugin.JS_FrameForward(e)}},{key:"JS_GetOSDTime",value:function O(e){return this.oPlugin.JS_GetOSDTime(e)}},{key:"JS_GetPlayInfo",value:function M(e){return this.oPlugin.JS_GetPlayInfo(e)}},{key:"JS_OpenSound",value:function L(e){return this.oPlugin.JS_OpenSound(e)}},{key:"JS_CloseSound",value:function F(){return this.oPlugin.JS_CloseSound()}},{key:"JS_GetVolume",value:function W(e){return this.oPlugin.JS_GetVolume(e)}},{key:"JS_SetVolume",value:function N(e,t){return this.oPlugin.JS_SetVolume(e,t)}},{key:"JS_EnableZoom",value:function B(e,t){return this.oPlugin.JS_EnableZoom(e,t)}},{key:"JS_DisableZoom",value:function z(e){return this.oPlugin.JS_DisableZoom(e)}},{key:"JS_CapturePicture",value:function J(e,t,n){return this.oPlugin.JS_CapturePicture(e,t,n)}},{key:"JS_StartSave",value:function H(e,t){return this.oPlugin.JS_StartSave(e,t)}},{key:"JS_StopSave",value:function U(e){return this.oPlugin.JS_StopSave(e)}},{key:"JS_StartTalk",value:function j(e,t,n,i,r,o,s,a,u,l){return this.oPlugin.JS_StartTalk(e,t,n,i,r,o,s,a,u,l)}},{key:"JS_StopTalk",value:function G(){return this.oPlugin.JS_StopTalk()}},{key:"JS_SetPlayMode",value:function V(e){return this.oPlugin.JS_SetPlayMode(e)}},{key:"JS_SetFullScreenCapability",value:function Y(e){return this.oPlugin.JS_SetFullScreenCapability(e)}},{key:"JS_FullScreenDisplay",value:function X(e){return this.oPlugin.JS_FullScreenDisplay(e)}},{key:"JS_EnableIVS",value:function Z(e,t,n){return this.oPlugin.JS_EnableIVS(e,t,n)}},{key:"JS_SRInit",value:function K(e,t){return this.oPlugin.JS_SRInit(e,t)}},{key:"JS_SRPTZ",value:function $(e,t,n){return this.oPlugin.JS_SRPTZ(e,t,n)}},{key:"JS_SetPlaybackDrawType",value:function Q(e,t){return this.oPlugin.JS_SetPlaybackDrawType(e,t)}},{key:"JS_SetPlayBackType",value:function ee(e){return this.oPlugin.JS_SetPlayBackType(e)}},{key:"JS_SetTrsPlayBackParam",value:function te(e,t){return this.oPlugin.JS_SetTrsPlayBackParam(e,t)}},{key:"JS_GetLocalConfig",value:function ne(){return this.oPlugin.JS_GetLocalConfig()}},{key:"JS_SetLocalConfig",value:function ie(e){return this.oPlugin.JS_SetLocalConfig(e)}},{key:"JS_GetLastError",value:function re(){return this.oPlugin.JS_GetLastError()}},{key:"JS_OpenFileBrowser",value:function oe(e,t){return this.oPlugin.JS_OpenFileBrowser(e,t)}},{key:"JS_OpenDirectory",value:function se(e){return this.oPlugin.JS_OpenDirectory(e)}},{key:"JS_StartAsynUpload",value:function ae(e,t,n,i,r){if(r&&this.iPluginMode===1){var o=en.oUtils.decode(n);n=o.split(":::4:")[1]}return this.oPlugin.JS_StartAsynUpload(e,t,n,i,r)}},{key:"JS_StopAsynUpload",value:function ue(){return this.oPlugin.JS_StopAsynUpload()}},{key:"JS_GetUploadErrorInfo",value:function le(){return this.oPlugin.JS_GetUploadErrorInfo()}},{key:"JS_UploadFile",value:function fe(e,t,n,i,r){if(r&&this.iPluginMode===1){var o=en.oUtils.decode(t);t=o.split(":::4:")[1]}return this.oPlugin.JS_UploadFile(e,t,n,i,r)}},{key:"JS_GetIpcImportErrorInfo",value:function ce(){return this.oPlugin.JS_GetIpcImportErrorInfo()}},{key:"JS_DownloadFile",value:function he(e,t,n,i,r,o){return this.oPlugin.JS_DownloadFile(e,t,n,i,r,o)}},{key:"JS_DownloadFileNoPlugin",value:function de(e,t,n,i,r,o){return this.oPlugin.JS_DownloadFileNoPlugin(e,t,n,i,r,o)}},{key:"JS_StartUpgrade",value:function pe(e,t,n,i,r,o){if(o&&this.iPluginMode===1){var s=en.oUtils.decode(n);n=s.split(":::4:")[1]}return this.oPlugin.JS_StartUpgrade(e,t,n,i,r,o)}},{key:"JS_StopUpgrade",value:function ve(){return this.oPlugin.JS_StopUpgrade()}},{key:"JS_GetUpgradeStatus",value:function me(){return this.oPlugin.JS_GetUpgradeStatus()}},{key:"JS_GetUpgradeProgress",value:function ye(){return this.oPlugin.JS_GetUpgradeProgress()}},{key:"JS_ExportDeviceLog",value:function ge(e,t,n){var i=null;if(this.iPluginMode!==0){i=Kt.JSPlugin.prototype.JS_ExportDeviceLog(e,t,n)}else{i=this.oPlugin.JS_ExportDeviceLog(e,t,n)}return i}},{key:"JS_ExportReport",value:function Pe(e,t,n){var i=null;if(this.iPluginMode!==0){i=Kt.JSPlugin.prototype.JS_ExportReport(e,t,n)}else{i=this.oPlugin.JS_ExportReport(e,t,n)}return i}},{key:"JS_StartAsyncDownload",value:function we(e,t,n,i,r){return this.oPlugin.JS_StartAsyncDownload(e,t,n,i,r)}},{key:"JS_StopAsyncDownload",value:function Se(e){return this.oPlugin.JS_StopAsyncDownload(e)}},{key:"JS_GetDownloadStatus",value:function _e(e){return this.oPlugin.JS_GetDownloadStatus(e)}},{key:"JS_GetDownloadProgress",value:function be(e){return this.oPlugin.JS_GetDownloadProgress(e)}},{key:"JS_EnablePDC",value:function Ce(e,t){return this.oPlugin.JS_EnablePDC(e,t)}},{key:"JS_Resize",value:function ke(e,t){return this.oPlugin.JS_Resize(e,t)}},{key:"JS_SetDrawCallback",value:function Te(e,t,n,i,r,o){return this.oPlugin.JS_SetDrawCallback(e,t,n,i,r,o)}},{key:"JS_SetDrawStatus",value:function Re(e,t,n){return this.oPlugin.JS_SetDrawStatus(e,t,n)}},{key:"JS_ClearRegion",value:function De(){return this.oPlugin.JS_ClearRegion()}},{key:"JS_SetDrawShapeInfo",value:function xe(e,t){return this.oPlugin.JS_SetDrawShapeInfo(e,t)}},{key:"JS_SetGridInfo",value:function Ie(e){return this.oPlugin.JS_SetGridInfo(e)}},{key:"JS_GetGridInfo",value:function Ee(){return this.oPlugin.JS_GetGridInfo()}},{key:"JS_SetRectInfo",value:function qe(e){return this.oPlugin.JS_SetRectInfo(e)}},{key:"JS_GetRectInfo",value:function Ae(){return this.oPlugin.JS_GetRectInfo()}},{key:"JS_SetPolygonInfo",value:function Oe(e){return this.oPlugin.JS_SetPolygonInfo(e)}},{key:"JS_GetPolygonInfo",value:function Me(){return this.oPlugin.JS_GetPolygonInfo()}},{key:"JS_SetLineInfo",value:function Le(e){return this.oPlugin.JS_SetLineInfo(e)}},{key:"JS_GetLineInfo",value:function Fe(){return this.oPlugin.JS_GetLineInfo()}},{key:"JS_SetPointInfo",value:function We(e,t){return this.oPlugin.JS_SetPointInfo(e,t)}},{key:"JS_GetPointInfo",value:function Ne(){return this.oPlugin.JS_GetPointInfo()}},{key:"JS_SetTextOverlay",value:function Be(e){return this.oPlugin.JS_SetTextOverlay(e)}},{key:"JS_GetTextOverlay",value:function ze(){return this.oPlugin.JS_GetTextOverlay()}},{key:"JS_ClearShapeByType",value:function Je(e,t){return this.oPlugin.JS_ClearShapeByType(e,t)}},{key:"JS_ChooseShape",value:function He(e,t){return this.oPlugin.JS_ChooseShape(e,t)}},{key:"JS_SetCorrectionType",value:function Ue(e){return this.oPlugin.JS_SetCorrectionType(e)}},{key:"JS_SetPlaceType",value:function je(e){return this.oPlugin.JS_SetPlaceType(e)}},{key:"JS_StartFishListener",value:function Ge(e,t,n){return this.oPlugin.JS_StartFishListener(e,t,n)}},{key:"JS_StopFishListener",value:function Ve(){return this.oPlugin.JS_StopFishListener()}},{key:"JS_SetFishBoxListInfo",value:function Ye(e){return this.oPlugin.JS_SetFishBoxListInfo(e)}},{key:"JS_GetFishBoxListInfo",value:function Xe(){return this.oPlugin.JS_GetFishBoxListInfo()}},{key:"JS_ClearAllWndFishBoxInfo",value:function Ze(){return this.oPlugin.JS_ClearAllWndFishBoxInfo()}},{key:"JS_SetFishWndProperty",value:function Ke(e,t,n){return this.oPlugin.JS_SetFishWndProperty(e,t,n)}},{key:"JS_SetFishParams",value:function $e(e,t,n,i){return this.oPlugin.JS_SetFishParams(e,t,n,i)}},{key:"JS_ArrangeFECWindow",value:function Qe(e){return this.oPlugin.JS_ArrangeFECWindow(e)}},{key:"JS_StartFECScan",value:function et(e){return this.oPlugin.JS_StartFECScan(e)}},{key:"JS_StopFECScan",value:function tt(){return this.oPlugin.JS_StopFECScan()}},{key:"JS_FishEyePTZ",value:function nt(e,t){return this.oPlugin.JS_FishEyePTZ(e,t)}},{key:"JS_FishEyeGetPreset",value:function it(){return this.oPlugin.JS_FishEyeGetPreset()}},{key:"JS_FishEyeSetPreset",value:function rt(e){return this.oPlugin.JS_FishEyeSetPreset(e)}},{key:"JS_StartFECCruise",value:function ot(e){return this.oPlugin.JS_StartFECCruise(e)}},{key:"JS_StopFECCruise",value:function st(){return this.oPlugin.JS_StopFECCruise()}},{key:"JS_SetIsHttps",value:function at(e){return this.oPlugin.JS_SetIsHttps(e)}},{key:"JS_SetReconnectInfo",value:function ut(e,t){return this.oPlugin.JS_SetReconnectInfo(e,t)}},{key:"JS_CheckUpdate",value:function lt(e){return this.oPlugin.JS_CheckUpdate(e)}},{key:"JS_SelectShape",value:function ft(e,t){return this.oPlugin.JS_SelectShape(e,t)}},{key:"JS_GetPictureSize",value:function ct(e){return this.oPlugin.JS_GetPictureSize(e)}},{key:"JS_SetOriginResolution",value:function ht(e,t,n){return this.oPlugin.JS_SetOriginResolution(e,t,n)}},{key:"JS_SetPlayWndMode",value:function dt(e,t,n){return this.oPlugin.JS_SetPlayWndMode(e,t,n)}},{key:"JS_UpdateWindowStyle",value:function pt(e){return this.oPlugin.JS_UpdateWindowStyle(e)}},{key:"JS_CuttingPartWindow",value:function vt(e,t,n,i){return this.oPlugin.JS_CuttingPartWindow(e,t,n,i)}},{key:"JS_RepairPartWindow",value:function mt(e,t,n,i){return this.oPlugin.JS_RepairPartWindow(e,t,n,i)}},{key:"JS_ClearAllCanvas",value:function yt(){var e=null;if(this.iPluginMode===1){e=this.oPlugin.JS_ClearAllCanvas()}else{e=new Promise(function(e){e()})}return e}},{key:"JS_PlayWithImg",value:function gt(e,t){return this.oPlugin.JS_PlayWithImg(e,t)}},{key:"JS_DestroyAll",value:function Pt(){return this.oPlugin.JS_DestroyAll()}},{key:"JS_SetPackageType",value:function wt(e){return this.oPlugin.JS_SetPackageType(e)}},{key:"JS_SetZeroChanInfo",value:function St(e,t,n){return this.oPlugin.JS_SetZeroChanInfo(e,t,n)}},{key:"JS_SetSnapDrawWndIndex",value:function _t(e){return this.oPlugin.JS_SetSnapDrawWndIndex(e)}},{key:"JS_SetWindowSelected",value:function bt(e){return this.oPlugin.JS_SetWindowSelected(e)}},{key:"JS_GetDownFilePath",value:function Ct(e){return this.oPlugin.JS_GetDownFilePath(e)}},{key:"JS_SycVideoAndAudio",value:function kt(e,t,n){return this.oPlugin.JS_SycVideoAndAudio(e,t,n)}},{key:"JS_DeleteDownloadFile",value:function Tt(e,t,n){return this.oPlugin.JS_DeleteDownloadFile(e,t,n)}},{key:"JS_GetEngineSupport",value:function Rt(){return this.oPlugin.JS_GetEngineSupport()}},{key:"JS_ExsitGetSlfPointList",value:function Dt(){return this.oPlugin.JS_ExistGetSlfPointList()}},{key:"JS_GetSlfPointList",value:function xt(e,t){return this.oPlugin.JS_GetSlfPointList(e,t)}},{key:"JS_GetSlfVersion",value:function It(){return this.oPlugin.JS_GetSlfVersion()}},{key:"JS_AudioPlay",value:function Et(e,t,n,i,r,o){return this.oPlugin.JS_AudioPlay(e,t,n,i,r,o)}},{key:"JS_StartSycAudioPlay",value:function qt(e,t,n,i){return this.oPlugin.JS_StartSycAudioPlay(e,t,n,i)}},{key:"JS_StopSycAudioPlay",value:function At(e){return this.oPlugin.JS_StopSycAudioPlay(e)}},{key:"JS_SetAudioPlayStatus",value:function Ot(e){return this.oPlugin.JS_SetAudioPlayStatus(e)}},{key:"JS_StopAudioPlay",value:function Mt(){return this.oPlugin.JS_StopAudioPlay()}},{key:"JS_StartAudioSave",value:function Lt(e){return this.oPlugin.JS_StartAudioSave(e)}},{key:"JS_StopAudioSave",value:function Ft(){return this.oPlugin.JS_StopAudioSave()}},{key:"JS_GetAudioPlayedTime",value:function Wt(){return this.oPlugin.JS_GetAudioPlayedTime()}},{key:"JS_AudioPause",value:function Nt(){return this.oPlugin.JS_AudioPause()}},{key:"JS_AudioResume",value:function Bt(){return this.oPlugin.JS_AudioResume()}},{key:"JS_SetAudioVolume",value:function zt(e,t){return this.oPlugin.JS_SetAudioVolume(e,t)}},{key:"JS_StartAlarmChan",value:function Jt(e,t,n,i){var r;if(isNaN(i)){arguments[3]=3e4}var o=Array.prototype.slice.call(arguments,0);return(r=this.oPlugin).JS_StartAlarmChan.apply(r,tn(o))}},{key:"JS_StopAlarmChan",value:function Ht(e){var t;if(isNaN(e)){arguments[0]=3e4}var n=Array.prototype.slice.call(arguments,0);return(t=this.oPlugin).JS_StopAlarmChan.apply(t,tn(n))}},{key:"JS_StartFormAsynUpload",value:function Ut(e,t){var n;if(isNaN(t)){arguments[1]=3e4}var i=Array.prototype.slice.call(arguments,0);return(n=this.oPlugin).JS_StartFormAsynUpload.apply(n,tn(i))}},{key:"JS_StopFormAsynUpload",value:function b(e){var t;if(isNaN(e)){arguments[0]=3e4}var n=Array.prototype.slice.call(arguments,0);return(t=this.oPlugin).JS_StopFormAsynUpload.apply(t,tn(n))}},{key:"JS_IsPluginExist",value:function jt(){try{return this.oPlugin.JS_IsPluginExist()}catch(e){console.log(e);return false}}},{key:"JS_SetPicInfoToPlayer",value:function Gt(e,t,n,i){return this.oPlugin.JS_SetPicInfoToPlayer(e,t,n,i)}},{key:"JS_SubmitHttpRequest",value:function Vt(e){return this.oPlugin.JS_StartSyncHttpTransmission(e)}},{key:"JS_GetCaptureData",value:function Yt(e){return this.oPlugin.JS_GetCaptureData(e)}}]);return n}();e.getPluginMode=function(t,n,i){var r=0;var e=new Promise(function(e){if(en.oUtils.browser().msie||en.oUtils.browser().safari&&en.oUtils.browser().version<11||en.oUtils.browser().firefox&&en.oUtils.browser().version<52||en.oUtils.browser().chrome&&en.oUtils.browser().version<45){e(r)}else{$t.LocalServiceControl.prototype.JS_CheckLocalServiceConnected(t,n,i).then(function(){r=2;e(r)},function(){r=1;e(r)})}});return e};window.MPversion=function(){var e=n(115);return e};return e}();t.JSVideoPlugin=e}).call(this,n(1))},function(e,t,i){"use strict";(function(xt){Object.defineProperty(t,"__esModule",{value:true});t.JSPlugin=undefined;var It=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(e,t,n){if(t)i(e.prototype,t);if(n)i(e,n);return e}}();var Et=i(38);var n=i(63);var qt=i(72);var At=i(73);var Ot=i(74);function Mt(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var e=function(){var Ke=null;var $e=0;var Qe=1;var u=40;var l=1024*1024*4;var f=1001;var c=1002;var h=1003;var et=2001;var tt=2002;var nt=new n.StreamClient;var it=null;var rt=null;var ot=Symbol("OPTIONS");var st=Symbol("CURRENTPLAYRATE");var at=Symbol("CURRENTSOUNDWND");var ut=Symbol("MAXWNDNUM");var lt=Symbol("MAXWNDNUM");var ft=Symbol("DRAWCANVAS");var ct=Symbol("SHAPEID");var ht=Symbol("WINDOWFULL");var dt=Symbol("SINGLEWINDOW");var pt=Symbol("FILETMP");var vt=Symbol("STATUSTMP");var mt=Symbol("UPGRADESTATUSURL");var yt=Symbol("CURWNDINDEX");var gt=Symbol("CALLBACKFUNCTION");var Pt=Symbol("CALLBACKFUNCTIONS");var wt=Symbol("EVENTCALLBACK");var Rt=Symbol("PLUGINVERSION");var St=Symbol("CANFULLSCREEN");var _t=Symbol("DRAWWNDINDEX");var d=Symbol("CURDRAWWNDINDEX");function Dt(){document.addEventListener("visibilitychange",function(){if(document.hidden){for(var e=0;e<16;e++){if(Ke[lt][e]&&Ke[lt][e].bLoad){Ke[lt][e].oPlayCtrl.PlayM4_IsVisible(false)}}}else{for(var t=0;t<16;t++){if(Ke[lt][t]&&Ke[lt][t].bLoad){Ke[lt][t].oPlayCtrl.PlayM4_IsVisible(true)}}}},false)}function bt(e,t){if(e&&t){Ke[ot].iWidth=e;Ke[ot].iHeight=t}var n=Ke[ot].iWidth%Ke[ot].iCurrentSplit;var i=Ke[ot].iHeight%Ke[ot].iCurrentSplit;var r=(Ke[ot].iWidth-n-Ke[ot].iCurrentSplit*2)/Ke[ot].iCurrentSplit;var o=(Ke[ot].iHeight-i-Ke[ot].iCurrentSplit*2)/Ke[ot].iCurrentSplit;var s=(Ke[ot].iWidth-n)/Ke[ot].iCurrentSplit;var a=(Ke[ot].iHeight-i)/Ke[ot].iCurrentSplit;var u=Ke[ot].iCurrentSplit;if(Ke[ot].szIframeId&&xt("#"+Ke[ot].szIframeId).length){rt=xt("#"+Ke[ot].szId,xt("#"+Ke[ot].szIframeId)[0].contentWindow.document)}else{if(typeof Ke[ot].szId==="string"){rt=xt("#"+Ke[ot].szId)}else{rt=Ke[ot].szId}}var l='<div class="parent-wnd" style="overflow:hidden;width:100%; height:100%; position: relative;">';for(var f=0;f<Ke[ut];f++){e=r+(f%u===u-1?n:0);t=o+(f+u>=Math.pow(u,2)?i:0);var c=s+(f%u===u-1?n:0);var h=a+(f+u>=Math.pow(u,2)?i:0);l+='<div style="float:left; background-color: '+Ke.oPluginColor.subBackgroundColor+"; position: relative; width: "+c+"px; height: "+h+'px;">'+'<img style="display:none;" id="playImg'+f+'" src="">'+'<canvas id="'+Ke[ot].szId+"canvas_play"+f+'" class="play-window" style="border:1px solid '+Ke.oPluginColor.borderColor+';" wid="'+f+'" width="'+e+'" height="'+t+'"></canvas>'+'<canvas id="'+Ke[ot].szId+"canvas_draw"+f+'"  class="draw-window" style="position:absolute; top:0; left:0;" wid="'+f+'" width='+c+" height="+h+"></canvas>"+"</div>"}l+="</div>";rt.html(l);rt.find(".parent-wnd").eq(0).children().eq(0).find(".play-window").eq(0).css("border","1px solid "+Ke.oPluginColor.selectBorderColor)}function e(){Ke.EventCallback=function(){return{loadEventHandler:function e(){window.loadEventHandler&&window.loadEventHandler()},zoomEventResponse:function t(){},windowEventSelect:function n(t,e){if(Ke[yt]===t&&!e){return}Ke[yt]=t;if(Ke[_t]>=0&&Ke[_t]<=Ke[ut]-1){if(Ke[d]===Ke[_t]){return}t=Ke[_t]}Ke[d]=t;if(0<=t){Ke[gt]=Ke[Pt][t]}xt(".draw-window").unbind();Ke[ft].setDrawStatus(false);Ke[ft]=null;Ke[ft]=new Ot.ESCanvas(Ke[ot].szId+"canvas_draw"+t);Ke[ft].setShapeType("Rect");Ke[ft].setDrawStyle("#ff0000","",0);if(Ke[lt][t].bEZoom||Ke[lt][t].bSetDrawCallback){if(Ke[lt][t].bEZoom){Ke[ft].setDrawStatus(true,function(e){if(e.startPos&&e.endPos){if(e.startPos[0]>e.endPos[0]){Ke[lt][t].oPlayCtrl.PlayM4_SetDisplayRegion(null,false)}else{Ke[lt][t].oPlayCtrl.PlayM4_SetDisplayRegion({left:e.startPos[0],top:e.startPos[1],right:e.endPos[0],bottom:e.endPos[1]},true)}}})}else if(Ke[lt][t].bSetDrawCallback){Ke[ft].setDrawStatus(true,function(e){Ke[gt](e)})}}if(Ke[wt].onGetSelectWndInfo){Ke[wt].onGetSelectWndInfo(t)}},pluginErrorHandler:function i(e,t,n){if(Ke[wt].onPluginEventHandler){Ke[wt].onPluginEventHandler(e,t,n)}},windowEventOver:function r(e){if(Ke[wt].onWindowEventOver){Ke[wt].onWindowEventOver(e)}},windowEventOut:function o(e){if(Ke[wt].onWindowEventOut){Ke[wt].onWindowEventOut(e)}},windowEventUp:function s(e){if(Ke[wt].onWindowEventUp){Ke[wt].onWindowEventUp(e)}},windowFullCcreenChange:function a(e){if(Ke[wt].onWindowFullCcreenChange){Ke[wt].onWindowFullCcreenChange(e)}},firstFrameDisplay:function u(e){if(Ke[wt].onFirstFrameDisplay){Ke[wt].onFirstFrameDisplay(e)}},performanceLack:function l(){if(Ke[wt].onPerformanceLack){Ke[wt].onPerformanceLack()}},mouseEvent:function f(e,t,n,i){if(Ke[wt].onMouseEvent){Ke[wt].onMouseEvent({eventType:t,point:[n,i],wndIndex:e})}}}}()}function Ct(){e();rt.find(".parent-wnd").eq(0).children().each(function(o){var s=this;var i=false;xt(s).unbind().bind("mousedown",function(e){rt.find(".parent-wnd").eq(0).find(".play-window").css("border","1px solid "+Ke.oPluginColor.borderColor);rt.find(".parent-wnd").eq(0).children().eq(o).find(".play-window").eq(0).css("border","1px solid "+Ke.oPluginColor.selectBorderColor);Ke.EventCallback.windowEventSelect(parseInt(rt.find(".parent-wnd").eq(0).children().eq(o).find(".play-window").eq(0).attr("wid"),10));i=true;var t=e.offsetX/Ke[ft].m_iCanvasWidth;var n=e.offsetY/Ke[ft].m_iCanvasHeight;if(e.button===2){Ke.EventCallback.mouseEvent(o,4,t,n)}else if(e.button===0){Ke.EventCallback.mouseEvent(o,1,t,n)}e.stopPropagation()});xt(s).bind("mousemove",function(e){var t=e.offsetX/Ke[ft].m_iCanvasWidth;var n=e.offsetY/Ke[ft].m_iCanvasHeight;if(i){Ke.EventCallback.mouseEvent(o,7,t,n)}else{Ke.EventCallback.mouseEvent(o,6,t,n)}e.stopPropagation()});xt(s).bind("mousewheel",function(e){var t=e.offsetX/Ke[ft].m_iCanvasWidth;var n=e.offsetY/Ke[ft].m_iCanvasHeight;Ke.EventCallback.mouseEvent(o,8,t,n);e.stopPropagation()});xt(s).bind("mouseover",function(e){Ke.EventCallback.windowEventOver(o);e.stopPropagation()});xt(s).bind("mouseout",function(e){Ke.EventCallback.windowEventOut(o);e.stopPropagation()});xt(s).bind("mouseup",function(e){i=false;Ke.EventCallback.windowEventUp(o);var t=e.offsetX/Ke[ft].m_iCanvasWidth;var n=e.offsetY/Ke[ft].m_iCanvasHeight;if(e.button===2){Ke.EventCallback.mouseEvent(o,5,t,n)}else if(e.button===0){Ke.EventCallback.mouseEvent(o,3,t,n)}});xt(s).bind("dblclick",function(e){if(!Ke[lt][Ke[yt]].bPlay){return}if(!Ke[St]){return}var t=document.fullscreen||document.webkitIsFullScreen||document.mozFullScreen||false;var n=xt(s).get(0);if(!t){if(n.requestFullScreen){n.requestFullScreen()}else if(n.webkitRequestFullScreen){n.webkitRequestFullScreen()}else if(n.mozRequestFullScreen){n.mozRequestFullScreen()}Ke[dt]=xt(s)}else{if(rt.find(".parent-wnd").eq(0).width()===xt(window).width()){return}if(document.exitFullscreen){document.exitFullscreen()}else if(document.webkitCancelFullScreen){document.webkitCancelFullScreen()}else if(document.mozCancelFullScreen){document.mozCancelFullScreen()}Ke[dt]=null;Ke[ht]=false}var i=e.offsetX/Ke[ft].m_iCanvasWidth;var r=e.offsetX/Ke[ft].m_iCanvasHeight;Ke.EventCallback.mouseEvent(o,2,i,r);e.stopPropagation()})});if(typeof document.fullScreen!=="undefined"){document.addEventListener("fullscreenchange",function(){var e=document.fullscreen||false;Ke.EventCallback.windowFullCcreenChange(e)})}else if(typeof document.webkitIsFullScreen!=="undefined"){document.addEventListener("webkitfullscreenchange",function(){var e=document.webkitIsFullScreen||false;Ke.EventCallback.windowFullCcreenChange(e)})}else if(typeof document.mozFullScreen!=="undefined"){document.addEventListener("mozfullscreenchange",function(){var e=document.mozFullScreen||false;Ke.EventCallback.windowFullCcreenChange(e)})}}function kt(e){if(Ke[ot].aCustom&&Ke[ot].aCustom.length>0){p()}else{var t=rt.find(".parent-wnd").eq(0).children().length;var n=Ke[ot].iWidth%Ke[ot].iCurrentSplit;var i=Ke[ot].iHeight%Ke[ot].iCurrentSplit;var r=(Ke[ot].iWidth-n-Ke[ot].iCurrentSplit*2)/Ke[ot].iCurrentSplit;var o=(Ke[ot].iHeight-i-Ke[ot].iCurrentSplit*2)/Ke[ot].iCurrentSplit;var s=(Ke[ot].iWidth-n)/Ke[ot].iCurrentSplit;var a=(Ke[ot].iHeight-i)/Ke[ot].iCurrentSplit;var u=Ke[ot].iCurrentSplit;for(var l=0;l<t;l++){var f=r+(l%u===u-1?n:0);var c=o+(l+u>=Math.pow(u,2)?i:0);var h=s+(l%u===u-1?n:0);var d=a+(l+u>=Math.pow(u,2)?i:0);rt.find(".parent-wnd").eq(0).children().eq(l).width(h);rt.find(".parent-wnd").eq(0).children().eq(l).height(d);rt.find(".parent-wnd").eq(0).children().eq(l).find(".draw-window").attr("width",h);rt.find(".parent-wnd").eq(0).children().eq(l).find(".draw-window").attr("height",d);rt.find(".parent-wnd").eq(0).children().eq(l).find(".play-window").attr("width",f);rt.find(".parent-wnd").eq(0).children().eq(l).find(".play-window").attr("height",c)}if(Ke[ft]&&e){Ke[ft].resizeCanvas()}rt.find(".parent-wnd").eq(Ke[yt]).find(".play-window").css("border","1px solid "+Ke.oPluginColor.borderColor);rt.find(".parent-wnd").eq(Ke[yt]).children().eq(0).find(".play-window").eq(0).css("border","1px solid "+Ke.oPluginColor.selectBorderColor)}}function p(){var e=Ke[ot].iCurrentSplit;var t=Ke[ot].iCurrentSplit;var n=Ke[ot].aCustom;if(n){e=1/n[0].width;t=1/n[0].height}var i=rt.find(".parent-wnd").eq(0).children().length;var r=Ke[ot].iWidth%e;var o=Ke[ot].iHeight%t;var s=(Ke[ot].iWidth-r-e*2)/e;var a=(Ke[ot].iHeight-o-t*2)/t;var u=(Ke[ot].iWidth-r)/e;var l=(Ke[ot].iHeight-o)/t;for(var f=0;f<i;f++){var c=s+(f%e===e-1?r:0);var h=a+(f+t>=Math.pow(t,2)?o:0);var d=u+(f%e===e-1?r:0);var p=l+(f+t>=Math.pow(t,2)?o:0);rt.find(".parent-wnd").eq(0).children().eq(f).width(d);rt.find(".parent-wnd").eq(0).children().eq(f).height(p);rt.find(".parent-wnd").eq(0).children().eq(f).find(".draw-window").attr("width",d);rt.find(".parent-wnd").eq(0).children().eq(f).find(".draw-window").attr("height",p);rt.find(".parent-wnd").eq(0).children().eq(f).find(".play-window").attr("width",c);rt.find(".parent-wnd").eq(0).children().eq(f).find(".play-window").attr("height",h)}rt.find(".parent-wnd").eq(Ke[yt]).find(".play-window").css("border","1px solid "+Ke.oPluginColor.borderColor);rt.find(".parent-wnd").eq(Ke[yt]).children().eq(0).find(".play-window").eq(0).css("border","1px solid "+Ke.oPluginColor.selectBorderColor)}function Tt(e,t,o,n,i,r,s){if(!xt("#"+Ke[lt][o].windowID).length){return}var a=false;if(n&&i){a=true}Ke[lt][o].bLoad=true;nt.openStream(e,t,function(e){if(!Ke[lt][o].oPlayCtrl){return}if(e.bHead&&!Ke[lt][o].bPlay){Ke[lt][o].bPlay=true;Ke[lt][o].aHead=new Uint8Array(e.buf);Ke[lt][o].oPlayCtrl.PlayM4_OpenStream(e.buf,u,1024*1024*2);if(Ke[lt][o].szSecretKey!==""){setTimeout(function(){Ke[lt][o].oPlayCtrl.PlayM4_SetSecretKey(1,Ke[lt][o].szSecretKey,128);Ke[lt][o].szSecretKey=""},100)}if(Ke[lt][o].aHead[8]===4){Ke[lt][o].oPlayCtrl.PlayM4_SetStreamOpenMode(0)}else{Ke[lt][o].oPlayCtrl.PlayM4_SetStreamOpenMode(1)}Ke[lt][o].oPlayCtrl.PlayM4_SetInputBufSize(l);Ke[lt][o].oPlayCtrl.PlayM4_Play(Ke[lt][o].windowID)}else{var t=new Uint8Array(e.buf);var n=Ke[lt][o].oPlayCtrl.PlayM4_GetInputBufSize();var i=Ke[lt][o].oPlayCtrl.PlayM4_GetYUVBufSize();if(i===2&&!Ke[lt][o].bFirstFrame){Ke[lt][o].bFirstFrame=true;Ke.EventCallback.firstFrameDisplay(o)}var r=Ke[lt][o].oPlayCtrl.PlayM4_GetDecodeFrameType();if(n>l*.5&&n<l*.8&&Ke[lt][o].iRate===1){if(r!==Qe&&!Ke[lt][o].bFrameForward){Ke[lt][o].oPlayCtrl.PlayM4_SetDecodeFrameType(Qe)}Ke.EventCallback.performanceLack()}else if(n>=l*.8){}if(i>10&&i<15&&!Ke[lt][o].bFrameForward){if(r!==Qe){Ke[lt][o].oPlayCtrl.PlayM4_SetDecodeFrameType(Qe)}Ke.EventCallback.performanceLack()}else if(i>15){}if(i<10&&n<l*.5&&Ke[lt][o].iRate===1){if(r!==$e){Ke[lt][o].oPlayCtrl.PlayM4_SetDecodeFrameType($e)}}if(e.statusString){Ke.EventCallback.pluginErrorHandler(o,f,e)}else if(e.type&&e.type==="exception"){Ke.EventCallback.pluginErrorHandler(o,c,e)}else if(e.type==="videoNotSupport"){Ke.EventCallback.pluginErrorHandler(o,et,e)}else{Ke[lt][o].oPlayCtrl.PlayM4_InputData(t,t.length)}}if(Ke[lt][o].szStorageUUID){it.inputData(Ke[lt][o].szStorageUUID,e.buf)}e=null},function(){if(Ke[lt][o].bPlay){Ke.EventCallback.pluginErrorHandler(o,h);Ke[lt][o].bPlay=false;Ke[lt][o].bFrameForward=false;Ke[lt][o].iRate=1;if(Ke[lt][o].oPlayCtrl){Ke[lt][o].oPlayCtrl.PlayM4_Stop();Ke[lt][o].oPlayCtrl.PlayM4_CloseStream()}}}).then(function(e){Ke[lt][o].szStreamUUID=e;nt.startPlay(e,n,i,t).then(function(){if(a){Ke[lt][o].szPlayType="playback";Ke[lt][o].iRate=1;Ke[lt][o].oPlayCtrl.PlayM4_PlayRate(Ke[lt][o].iRate)}else{Ke[lt][o].szPlayType="realplay"}r()},function(e){s(e)})},function(e){s(e)})}var t=function(){function r(e){Mt(this,r);Ke=this;var t={szId:"playWnd",iType:1,iWidth:400,iHeight:300,iMaxSplit:4,iCurrentSplit:2,szBasePath:"./"};this[ot]=xt.extend(t,e);var n={border:"#343434",borderSelect:"#FFCC00",background:"#4C4B4B"};n=xt.extend(n,e.oStyle);this[ot].oStyle=n;this.oPluginColor={backgroundColor:this[ot].szBackgroundColor?this[ot].szBackgroundColor:this[ot].oStyle.background,subBackgroundColor:this[ot].szSubBackgroundColor?this[ot].szSubBackgroundColor:this[ot].oStyle.background,borderColor:this[ot].szBorderColor?this[ot].szBorderColor:this[ot].oStyle.border,selectBorderColor:this[ot].szSelectBorderColor?this[ot].szSelectBorderColor:this[ot].oStyle.borderSelect};if(this[ot].iCurrentSplit>this[ot].iMaxSplit){this[ot].iCurrentSplit=this[ot].iMaxSplit}this[st]=1;this[at]=-1;this[ut]=this[ot].iMaxSplit*this[ot].iMaxSplit;this[ct]="";this[ht]=false;this[dt]=null;this[pt]=null;this[vt]="";this[mt]="";this[yt]=-1;this[gt]=null;this[Pt]=[];this[wt]={};this[St]=true;this[Rt]="V1.2.0 build20181011";it=new At.StorageManager(this[ot].szBasePath+"/transform");if(Ke[ot].szIframeId&&xt("#"+Ke[ot].szIframeId).length){rt=xt("#"+Ke[ot].szId,xt("#"+Ke[ot].szIframeId)[0].contentWindow.document)}else{if(typeof Ke[ot].szId==="string"){rt=xt("#"+Ke[ot].szId)}else{rt=Ke[ot].szId}}this[lt]=[];for(var i=0;i<this[ut];i++){this[lt][i]={};this[lt][i].bSelect=false;this[lt][i].bPlay=false;this[lt][i].bPause=false;this[lt][i].bRecord=false;this[lt][i].oPlayCtrl=null;this[lt][i].szPlayType="";this[lt][i].szStorageUUID="";this[lt][i].szStreamUUID="";this[lt][i].aHead=[];this[lt][i].bLoad=false;this[lt][i].windowID=Ke[ot].szId+"canvas_play"+i;this[lt][i].drawID=Ke[ot].szId+"canvas_draw"+i;this[lt][i].iRate=1;this[lt][i].bEZoom=false;this[lt][i].bSetDrawCallback=false;this[lt][i].szSecretKey="";this[lt][i].bFrameForward=false;this[lt][i].iDecodeType=$e;this[lt][i].bFirstFrame=false}Dt();bt();this[ft]=new Ot.ESCanvas(Ke[ot].szId+"canvas_draw0");if(this[ot].iType===0){rt.hide()}Ct();Ke.EventCallback.windowEventSelect(0)}It(r,[{key:"JS_UpdateWindowStyle",value:function n(e){this[ot].oStyle=e;this.oPluginColor={backgroundColor:this[ot].szBackgroundColor?this[ot].szBackgroundColor:this[ot].oStyle.background,subBackgroundColor:this[ot].szSubBackgroundColor?this[ot].szSubBackgroundColor:this[ot].oStyle.background,borderColor:this[ot].szBorderColor?this[ot].szBorderColor:this[ot].oStyle.border,selectBorderColor:this[ot].szSelectBorderColor?this[ot].szSelectBorderColor:this[ot].oStyle.borderSelect};kt()}},{key:"JS_CreateWnd",value:function o(e,t,n){var i=new Promise(function(e){bt(t,n);Ke[ft].updateCanvas(Ke[ot].szId+"canvas_draw0");Ke[ft].clearAllShape();if(n===0||t===0){rt.hide()}else{rt.show()}Ke.EventCallback.windowEventSelect(0);Ct();Ke[pt]=null;e()});return i}},{key:"JS_ShowWnd",value:function t(){var e=new Promise(function(e){e()});return e}},{key:"JS_HideWnd",value:function i(){var e=new Promise(function(e){e()});return e}},{key:"JS_SetWndCover",value:function s(){var e=new Promise(function(e){e()});return e}},{key:"JS_SetWindowControlCallback",value:function a(e){xt.extend(Ke[wt],e);Ke[wt]&&Ke[ft].setDrawEventCallback(Ke[wt].onDrawEvent)}},{key:"JS_ArrangeWindow",value:function u(n,i){var e=new Promise(function(e){if(n<Ke[ot].iMaxSplit){Ke[ot].iCurrentSplit=n}else{Ke[ot].iCurrentSplit=Ke[ot].iMaxSplit}if(Et.oTool.isFirefox()){for(var t=0;t<Ke[ot].iMaxSplit*Ke[ot].iMaxSplit;t++){if(Ke[lt][t].oPlayCtrl){Ke[lt][t].oPlayCtrl.PlayM4_ClearCanvas()}}}if(i){Ke[ot].aCustom=i}else{Ke[ot].aCustom=[]}kt(true);Ke.EventCallback.windowEventSelect(0);e()});return e}},{key:"JS_SetSecretKey",value:function l(n,i){var e=new Promise(function(e,t){if(n<0){t();return}if(i===""||typeof i==="undefined"){t();return}Ke[lt][n].szSecretKey=i;e()});return e}},{key:"JS_SetOriginalString",value:function f(){var e=new Promise(function(e){e()});return e}},{key:"JS_GetEncryptString",value:function c(){var e=new Promise(function(e){e("")});return e}},{key:"JS_GetDecryptString",value:function h(){var e=new Promise(function(e){e("")});return e}},{key:"JS_DestroyPlugin",value:function d(){var e=new Promise(function(e){Ke[lt].forEach(function(e){if(e.bPlay){e.oPlayCtrl.PlayM4_CloseStream()}if(e.oPlayCtrl){e.oPlayCtrl.PlayM4_Destroy();e.oPlayCtrl=null;e.bLoad=false}});Ke[ft].setShapeType("");e()});return e}},{key:"JS_Play",value:function p(i,r,o,s,a){var e=new Promise(function(t,n){if(o<0||o>Ke[ut]-1){n();return}if(Ke[lt][o].bFrameForward){n();return}if(Ke[lt][o].bPlay){Ke.JS_Stop(o)}setTimeout(function(){Ke[lt][o].bFirstFrame=false;Ke[lt][o].iDecodeType=$e;if(Ke[lt][o].oPlayCtrl){Tt(i,r,o,s,a,t,n)}else{Ke[lt][o].oPlayCtrl=new qt.JSPlayCtrl(Ke[ot].szBasePath+"/playctrl/",function(e){if(e.cmd==="loaded"&&!Ke[lt][o].bLoad){Tt(i,r,o,s,a,t,n)}else if(e.cmd==="OnebyOne"){if(!e.status){if(!Ke[lt][o].bPause){nt.pause(Ke[lt][o].szStreamUUID);Ke[lt][o].bPause=true}}else{if(Ke[lt][o].bPause){nt.resume(Ke[lt][o].szStreamUUID);Ke[lt][o].bPause=false}}}else if(e.cmd==="GetFrameData"){Ke.EventCallback.pluginErrorHandler(o,et)}},o)}},200)});return e}},{key:"JS_ReversePlay",value:function v(){var e=new Promise(function(e){e()});return e}},{key:"JS_SetTrsPlayBackParam",value:function m(){var e=new Promise(function(e){e()});return e}},{key:"JS_Stop",value:function y(n){var e=new Promise(function(e,t){if(n<0||n>Ke[ut]-1){t();return}if(Ke[lt][n].szStorageUUID){Ke.JS_StopSave(n)}if(Ke[lt][n].bEZoom){Ke.JS_DisableZoom(n)}if(Ke[at]===n){Ke[at]=-1}nt.stop(Ke[lt][n].szStreamUUID).then(function(){Ke[lt][n].bPlay=false;Ke[lt][n].bFrameForward=false;Ke[lt][n].iRate=1;if(Ke[lt][n].oPlayCtrl){Ke[lt][n].oPlayCtrl.PlayM4_Stop();Ke[lt][n].oPlayCtrl.PlayM4_CloseStream()}setTimeout(function(){e()},500)},function(){setTimeout(function(){t()},500)})});return e}},{key:"JS_Seek",value:function g(n,i,r){var e=new Promise(function(e,t){if(n<0||n>Ke[ut]-1){t();return}if(!Ke[lt][n].bPlay){t();return}nt.seek(Ke[lt][n].szStreamUUID,i,r).then(function(){e()},function(e){t(e)})});return e}},{key:"JS_StopRealPlayAll",value:function P(){var e=new Promise(function(e){nt.stopAll();Ke[lt].forEach(function(e,t){if(e.bPlay){if(e.szStorageUUID){Ke.JS_StopSave(t)}if(e.bEZoom){Ke.JS_DisableZoom(t)}e.oPlayCtrl.PlayM4_Stop();e.oPlayCtrl.PlayM4_CloseStream()}e.bPlay=false});Ke[at]=-1;e()});return e}},{key:"JS_Pause",value:function w(n){var e=new Promise(function(e,t){if(n<0||n>Ke[ut]-1){t();return}if(!Ke[lt][n].bPlay){t();return}if(Ke[lt][n].bFrameForward){t();return}nt.pause(Ke[lt][n].szStreamUUID).then(function(){Ke[lt][n].oPlayCtrl.PlayM4_Pause(true);Ke[lt][n].bPause=true;e()},function(e){t(e)})});return e}},{key:"JS_Resume",value:function S(n){var e=new Promise(function(e,t){if(n<0||n>Ke[ut]-1){t();return}if(!Ke[lt][n].bPlay){t();return}nt.resume(Ke[lt][n].szStreamUUID).then(function(){if(Ke[st]!==1){Ke[lt][n].iRate=Ke[st];nt.setPlayRate(Ke[lt][n].szStreamUUID,Ke[lt][n].iRate);Ke[lt][n].oPlayCtrl.PlayM4_PlayRate(Ke[lt][n].iRate);if(Ke[st]>1){Ke[lt][n].oPlayCtrl.PlayM4_SetDecodeFrameType(Qe)}else{Ke[lt][n].oPlayCtrl.PlayM4_SetDecodeFrameType($e)}}if(Ke[lt][n].bFrameForward){Ke[lt][n].oPlayCtrl.PlayM4_Play(Ke[lt][n].windowID);Ke[lt][n].bFrameForward=false}else{Ke[lt][n].oPlayCtrl.PlayM4_Pause(false)}Ke[lt][n].bPause=false;e()},function(e){t(e)})});return e}},{key:"JS_Slow",value:function _(n){var e=new Promise(function(e,t){if(n<0||n>Ke[ut]-1){t();return}if(!Ke[lt][n].bPlay){t();return}if(Ke[lt][n].szPlayType!=="playback"){t();return}if(Ke[lt][n].iRate===-8){t();return}if(Ke[lt][n].bFrameForward){t();return}if(Ke[lt][n].iRate<0&&Ke[lt][n].iRate>-8){Ke[lt][n].iRate*=2}if(Ke[lt][n].iRate===1){Ke[lt][n].iRate*=-2}if(Ke[lt][n].iRate>1){Ke[lt][n].iRate/=2}nt.setPlayRate(Ke[lt][n].szStreamUUID,Ke[lt][n].iRate).then(function(){if(Ke[lt][n].iRate<2){Ke[lt][n].oPlayCtrl.PlayM4_SetDecodeFrameType($e)}else{Ke[lt][n].oPlayCtrl.PlayM4_SetDecodeFrameType(Qe);Ke[lt][n].oPlayCtrl.PlayM4_SetIFrameDecInterval(0)}Ke[lt][n].oPlayCtrl.PlayM4_PlayRate(Ke[lt][n].iRate);e()},function(e){t(e)})});return e}},{key:"JS_Fast",value:function b(n){var e=new Promise(function(e,t){if(n<0||n>Ke[ut]-1){t();return}if(!Ke[lt][n].bPlay){t();return}if(Ke[lt][n].szPlayType!=="playback"){t();return}if(Ke[lt][n].bFrameForward){t();return}if(Ke[lt][n].iRate===8){t();return}if(Ke[lt][n].iRate===-2){Ke[lt][n].iRate=1}else if(Ke[lt][n].iRate<-2){Ke[lt][n].iRate/=2}else if(Ke[lt][n].iRate>0&&Ke[lt][n].iRate<8){Ke[lt][n].iRate*=2}nt.setPlayRate(Ke[lt][n].szStreamUUID,Ke[lt][n].iRate).then(function(){if(Ke[lt][n].iRate<2){Ke[lt][n].oPlayCtrl.PlayM4_SetDecodeFrameType($e)}else{Ke[lt][n].oPlayCtrl.PlayM4_SetDecodeFrameType(Qe);if(Ke[lt][n].iRate===8){Ke[lt][n].oPlayCtrl.PlayM4_SetIFrameDecInterval(2)}else{Ke[lt][n].oPlayCtrl.PlayM4_SetIFrameDecInterval(0)}}Ke[lt][n].oPlayCtrl.PlayM4_PlayRate(Ke[lt][n].iRate);e()},function(e){t(e)})});return e}},{key:"JS_Transmission",value:function C(e,i){var t=new Promise(function(t,n){if(e<0||e>Ke[ut]-1){n();return}if(!Ke[lt][e].szStreamUUID){n();return}nt.transmission(Ke[lt][e].szStreamUUID,i).then(function(e){t(e)},function(e){n(e)})});return t}},{key:"JS_FrameForward",value:function k(n){var e=new Promise(function(e,t){if(n<0||n>Ke[ut]-1){t();return}if(!Ke[lt][n].bPlay){t();return}if(Ke[lt][n].iRate!==1){Ke[lt][n].iRate=1;Ke[st]=Ke[lt][n].iRate;nt.setPlayRate(Ke[lt][n].szStreamUUID,Ke[lt][n].iRate).then(function(){Ke[lt][n].oPlayCtrl.PlayM4_PlayRate(Ke[lt][n].iRate);Ke[lt][n].oPlayCtrl.PlayM4_SetDecodeFrameType($e);Ke[lt][n].oPlayCtrl.PlayM4_OneByOne();Ke[lt][n].bFrameForward=true},function(e){t(e)})}else{Ke[lt][n].oPlayCtrl.PlayM4_PlayRate(Ke[lt][n].iRate);Ke[lt][n].oPlayCtrl.PlayM4_SetDecodeFrameType($e);Ke[lt][n].oPlayCtrl.PlayM4_OneByOne();Ke[lt][n].bFrameForward=true}e()});return e}},{key:"JS_GetOSDTime",value:function T(n){var e=new Promise(function(i,e){if(n<0||n>Ke[ut]-1){e();return}if(!Ke[lt][n].bPlay){e();return}var t=Ke[lt][n].oPlayCtrl.PlayM4_GetOSDTime(function(e){var t=Et.oTool.isSafari()||Et.oTool.isEdge()?"/":" ";var n=Date.parse(e.replace(/-/g,t))/1e3;i(n)});if(t!==1){e();return}});return e}},{key:"JS_OpenSound",value:function R(n){var e=new Promise(function(e,t){if(n<0||n>Ke[ut]-1){t();return}if(!Ke[lt][n].bPlay){t();return}if(Ke[at]===n){t();return}if(Ke[at]!==-1){Ke[lt][Ke[at]].oPlayCtrl.PlayM4_StopSound()}if(Ke[lt][n].oPlayCtrl.PlayM4_PlaySound(n)!==1){t();return}Ke[at]=n;e()});return e}},{key:"JS_CloseSound",value:function D(){var e=new Promise(function(e,t){var n=Ke[at];if(n<0||n>Ke[ut]-1){t();return}if(!Ke[lt][n].bPlay){t();return}if(Ke[lt][n].oPlayCtrl.PlayM4_StopSound()!==1){t();return}Ke[at]=-1;e()});return e}},{key:"JS_GetVolume",value:function x(e){var t=new Promise(function(t){Ke[lt][e].oPlayCtrl.PlayM4_GetVolume(function(e){t(e)})});return t}},{key:"JS_SetVolume",value:function I(n,i){var e=new Promise(function(e,t){if(Ke[lt][n].oPlayCtrl.PlayM4_SetVolume(i)!==1){t();return}e()});return e}},{key:"JS_EnableZoom",value:function E(n){var e=new Promise(function(e,t){if(n<0||n>Ke[ut]-1){t();return}if(!Ke[lt][n].bPlay){t();return}xt(".draw-window").unbind();Ke[ft]=new Ot.ESCanvas(Ke[ot].szId+"canvas_draw"+n);Ke[ft].setShapeType("Rect");Ke[ft].setDrawStyle("#ff0000","",0);Ke[ft].setDrawStatus(true,function(e){if(e.startPos&&e.endPos){if(e.startPos[0]>e.endPos[0]){Ke[lt][n].oPlayCtrl.PlayM4_SetDisplayRegion(null,false)}else{Ke[lt][n].oPlayCtrl.PlayM4_SetDisplayRegion({left:e.startPos[0],top:e.startPos[1],right:e.endPos[0],bottom:e.endPos[1]},true)}}});Ke[lt][n].bEZoom=true;e()});return e}},{key:"JS_DisableZoom",value:function q(n){var e=new Promise(function(e,t){if(n<0||n>Ke[ut]-1){t();return}if(!Ke[lt][n].bPlay){t();return}Ke[ft].setDrawStatus(false);if(Ke[lt][n].oPlayCtrl.PlayM4_SetDisplayRegion(null,false)!==1){t();return}Ke[lt][n].bEZoom=false;Ke[wt]&&Ke[wt].onDrawEvent&&Ke[ft].setDrawEventCallback(Ke[wt].onDrawEvent);e()});return e}},{key:"JS_CapturePicture",value:function A(r,o,s){var e=new Promise(function(t,n){if(r<0||r>Ke[ut]-1){n();return}if(!Ke[lt][r].bPlay){n();return}if(!s){s="JPEG"}if(s==="BMP"){var e=Ke[lt][r].oPlayCtrl.PlayM4_GetBMP(function(e){if(e===6){n(tt)}else{Et.oTool.downloadFile(e,o+".BMP");t()}});if(e!==1){n(tt)}}else if(s==="JPEG"){var i=Ke[lt][r].oPlayCtrl.PlayM4_GetJPEG(function(e){if(e===6){n(tt)}else{Et.oTool.downloadFile(e,o+".jpeg");t()}});if(i!==1){n(tt)}}});return e}},{key:"JS_StartSave",value:function O(o,s){var e=new Promise(function(t,e){if(o<0||o>Ke[ut]-1){e();return}if(!Ke[lt][o].bPlay){e();return}if(s.indexOf(".mp4")<0){s=s+".mp4"}var n=Ke[lt][o].aHead;var i=0;if(Ke[lt][o].szPlayType==="playback"){i=1}it.startRecord(s,n,2,i,{cbEventHandler:function r(e){Ke.EventCallback.pluginErrorHandler(o,e)}}).then(function(e){Ke[lt][o].szStorageUUID=e;t()},function(){e()})});return e}},{key:"JS_StopSave",value:function M(n){var e=new Promise(function(e,t){if(!Ke[lt][n].szStorageUUID){t();return}it.stopRecord(Ke[lt][n].szStorageUUID).then(function(){Ke[lt][n].szStorageUUID="";e()},function(e){t(e)})});return e}},{key:"JS_StartTalk",value:function L(){var e=new Promise(function(e){e()});return e}},{key:"JS_StopTalk",value:function F(){var e=new Promise(function(e){e()});return e}},{key:"JS_SetPlayMode",value:function W(){var e=new Promise(function(e){e()});return e}},{key:"JS_SetFullScreenCapability",value:function N(t){var e=new Promise(function(e){Ke[St]=!!t;e()});return e}},{key:"JS_FullScreenDisplay",value:function B(n){var e=new Promise(function(e){if(n){var t=rt.get(0);if(t.requestFullScreen){t.requestFullScreen()}else if(t.webkitRequestFullScreen){t.webkitRequestFullScreen()}else if(t.mozRequestFullScreen){t.mozRequestFullScreen()}}Ke[ht]=n;e()});return e}},{key:"JS_FullScreenSingle",value:function z(e){if(!Ke[lt][e].bPlay){return}var t=document.fullscreen||document.webkitIsFullScreen||document.mozFullScreen||false;var n=rt.find(".parent-wnd").eq(0).children().eq(e).get(0);if(!t){if(n.requestFullScreen){n.requestFullScreen()}else if(n.webkitRequestFullScreen){n.webkitRequestFullScreen()}else if(n.mozRequestFullScreen){n.mozRequestFullScreen()}Ke[dt]=rt.find(".parent-wnd").eq(0).children().eq(e)}else{if(rt.find(".parent-wnd").eq(0).width()===xt(window).width()){return}if(document.exitFullscreen){document.exitFullscreen()}else if(document.webkitCancelFullScreen){document.webkitCancelFullScreen()}else if(document.mozCancelFullScreen){document.mozCancelFullScreen()}Ke[dt]=null;Ke[ht]=false}}},{key:"JS_EnableIVS",value:function J(){var e=new Promise(function(e){e()});return e}},{key:"JS_SRInit",value:function H(){var e=new Promise(function(e){e()});return e}},{key:"JS_SRPTZ",value:function U(){var e=new Promise(function(e){e()});return e}},{key:"JS_SetPlaybackDrawType",value:function j(){var e=new Promise(function(e){e()});return e}},{key:"JS_GetLocalConfig",value:function G(){var t={protocolType:0,streamType:0,packgeSize:1,playWndType:0,buffNumberType:2,recordPath:"",capturePath:"",playbackFilePath:"",playbackPicPath:"",downloadPath:"",snapScenePicPath:"",snapViewPicPath:"",ivsMode:-1,realPlayAll:0,captureFileFormat:0,osdPosInfo:0,osdPicInfo:1,showWizard:1,secretKey:"",showFireBox:0,showFireDistance:0,showFireMaxTemperature:0,showFireMaxTemperaturePos:0,showTemperaturePoint:0,showTemperatureLine:0,showTemperatureBox:0,captureIncludeTemperatureInfo:0};var e=new Promise(function(e){e(t)});return e}},{key:"JS_SetLocalConfig",value:function V(){var e=new Promise(function(e){e()});return e}},{key:"JS_GetLastError",value:function Y(){var n=0;var e=new Promise(function(e,t){if(n<0){t()}else{e(n)}});return e}},{key:"JS_OpenFileBrowser",value:function X(i,r){var e=new Promise(function(t){Ke[pt]=null;var n=window.document.createElement("input");n.type="file";if(r.toLowerCase()==="bmp"){n.accept="image/bmp"}if(i===0){n.setAttribute("webkitdirectory","")}n.addEventListener("change",function(){var e="";if(i===1){Ke[pt]=n.files[0];e=n.files[0].name}else if(i===0){Ke[pt]=n.files}t(e)});var e=document.createEvent("MouseEvents");e.initEvent("click",true,true);n.dispatchEvent(e)});return e}},{key:"JS_OpenDirectory",value:function Z(){var e=new Promise(function(e){e()});return e}},{key:"JS_StartAsynUpload",value:function K(i,e,r,t,o){var n=new Promise(function(e,t){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(n.readyState===4){if(n.status===200){Ke[vt]=n.responseText;e()}else{t(n)}}};if(o){if(i.indexOf("?")>=0){i+="&token="+r}else{i+="?token="+r}}n.open("put",i,true);n.send(Ke[pt])});return n}},{key:"JS_StopAsynUpload",value:function $(){var e=new Promise(function(e){Ke[vt]="";e()});return e}},{key:"JS_UploadFile",value:function Q(i,r,e,o,s){var t=new Promise(function(e,t){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(n.readyState===4){if(n.status!==200){t({readyState:4,status:n.status,responseXML:n.responseText?Et.oTool.parseXmlFromStr(n.responseText):null,errorInfo:n.responseText})}else{e()}}};if(s){if(i.indexOf("?")>=0){i+="&token="+r}else{i+="?token="+r}}n.open("put",i,false);if(o){n.setRequestHeader("Content-Type",o)}else{n.setRequestHeader("Content-Type","oct/stream")}n.send(Ke[pt])});return t}},{key:"JS_GetUploadErrorInfo",value:function ee(){var e=new Promise(function(e,t){if(typeof Ke[vt]==="string"&&Ke[vt].length>0){e(Ke[vt])}else{t()}});return e}},{key:"JS_DownloadFile",value:function te(t){var e=new Promise(function(e){xt("body").append('<a id="jsplugin_download_a" href="'+t+'"><li id="jsplugin_download_li"></li></a>');xt("#jsplugin_download_li").trigger("click");xt("#jsplugin_download_a").remove();e()});return e}},{key:"JS_DownloadFileNoPlugin",value:function ne(t){var e=new Promise(function(e){xt("body").append('<a id="jsplugin_download_a" href="'+t+'"><li id="jsplugin_download_li"></li></a>');xt("#jsplugin_download_li").trigger("click");xt("#jsplugin_download_a").remove();e()});return e}},{key:"JS_StartUpgrade",value:function ie(e,t,n,i,r,s){var o=new Promise(function(i,r){if(!e){r();return}Ke[vt]=0;var o=new XMLHttpRequest;o.onreadystatechange=function(){if(o.readyState===4){if(o.status===200){Ke[vt]=100;i()}else{Ke[vt]=1;var e=Et.oTool.parseXmlFromStr(o.responseText);if(xt(e).find("subStatusCode").text()==="lowPrivilege"){r(403)}else if(xt(e).find("MErrDevSelfEx").length>0||xt(e).find("MErrCode").length>0){var t=parseInt(xt(e).find("MErrDevSelfEx").text(),10);var n=parseInt(xt(e).find("MErrCode").text(),10);if(t>0){r(t)}else if(n>0){r(n)}else{r()}}else{r()}}}};if(s){if(e.indexOf("?")>=0){e+="&token="+n}else{e+="?token="+n}}o.open("put",e,true);o.send(Ke[pt]);Ke[mt]=t});return o}},{key:"JS_StopUpgrade",value:function re(){var e=new Promise(function(e){Ke[pt]=null;e()});return e}},{key:"JS_GetUpgradeStatus",value:function oe(){var e=new Promise(function(e){if(Ke[vt]===100){e(0)}e(Ke[vt])});return e}},{key:"JS_GetUpgradeProgress",value:function se(){var e=new Promise(function(e){var t=0;if(!Ke[mt]){e(t)}var n=new XMLHttpRequest;n.onreadystatechange=function(){if(n.readyState===4){if(n.status===200){t=parseInt(xt(Et.oTool.parseXmlFromStr(n.responseText)).find("percent").text(),10)}}};n.open("get",Ke[mt],false);n.send(null);if(Ke[vt]===100){e(100)}e(t)});return e}},{key:"JS_ExportDeviceLog",value:function ae(p,v,m){var e=new Promise(function(e){var t=[];var n=[];t=t.concat(xt(p).find("searchMatchItem").toArray());for(var i=0;i<t.length;i++){n[i]=[];n[i][0]=xt(t[i]).find("logtime").text().replace("T"," ").replace("Z","");n[i][1]=xt(t[i]).find("majortype").text();n[i][2]=xt(t[i]).find("minortype").text();n[i][3]=xt(t[i]).find("channelid").text();n[i][4]=xt(t[i]).find("userName").text();n[i][5]=xt(t[i]).find("remoteaddress").text()}var r=[];function o(e){r.push(e);var t=e.slice("");if(/^[\u4e00-\u9fa5]/.test(e)){for(var n=0;n<30-t.length*2;n++){r.push(" ")}}else{for(var i=0;i<30-t.length;i++){r.push(" ")}}}o(" ");o(xt(p).find("laLogTime").text());o(xt(p).find("laLogMajorType").text());o(xt(p).find("laLogMinorType").text());o(xt(p).find("laLogChannel").text());o(xt(p).find("laLogRemoteUser").text());o(xt(p).find("laLogRemoteIP").text());r.push("\r\n");for(var s=0;s<n.length;s++){var a=(s+1).toString();o(a);for(var u=0;u<6;u++){o(n[s][u])}r.push("\r\n")}r=r.join("");var l="\ufeff";var f=void 0;if(m===5){f=new Blob([l+r],{type:"text/csv"})}else{f=new Blob([r],{type:"text/plain"});v="Log.txt"}var c=(window.URL||window.webkitURL).createObjectURL(f);var h=window.document.createElement("a");h.href=c;h.download=v;var d=document.createEvent("MouseEvents");d.initEvent("click",true,true);h.dispatchEvent(d);e()});return e}},{key:"outCsv",value:function ue(e,t,n,i){var r="";var o="";for(var s=0;s<n.length;s++){o+=xt(e).find(n[s]).eq(0).text()+","}o=o.slice(0,-1);r+=o+"\r\n";for(var a=0;a<i.length;a++){o="";for(var u=0;u<n.length;u++){o+='"'+i[a][u]+'",'}o.slice(0,o.length-1);r+=o+"\r\n"}if(r===""){return}var l="";l+=t;var f="\ufeff";if(window.navigator.msSaveOrOpenBlob){var c=f+r;var h=new Blob([decodeURIComponent(encodeURI(c))],{type:"data:text/csv;charset=utf-8,"});navigator.msSaveBlob(h,l+".csv")}else{f="data:text/csv;charset=utf-8,\ufeff";var d=f+r;var p=encodeURI(d).replace(/&/g,"%26").replace(/\+/g,"%2B").replace(/\s/g,"%20").replace(/#/g,"%23");var v=document.createElement("a");v.setAttribute("href",p);v.setAttribute("download",l+".csv");document.body.appendChild(v);v.click()}}},{key:"JS_ExportReport",value:function le(m,y,g){var P=this;var e=new Promise(function(e){var t=[];var n=[];var i=xt(m).find("NameList").text().split(",");t=t.concat(xt(m).find("tDataItem").toArray());for(var r=0;r<t.length;r++){n[r]=[];for(var o=0;o<i.length;o++){n[r][o]=xt(t[r]).find(i[o]).text();if(i[o]==="logtime"){n[r][o]=n[r][o].replace("T"," ").replace("Z","")}}}var s=[];if(g===1){P.outCsv(m,y,i,n)}else{var a=function a(e){s.push(e);var t=e.slice("");if(/^[\u4e00-\u9fa5]/.test(e)){for(var n=0;n<30-t.length*2;n++){s.push(" ")}}else{for(var i=0;i<30-t.length;i++){s.push(" ")}}};a(" ");for(var u=0;u<i.length;u++){a(xt(m).find(i[u]).eq(0).text())}s.push("\r\n");for(var l=0;l<n.length;l++){var f=(l+1).toString();a(f);for(var c=0;c<i.length;c++){a(n[l][c])}s.push("\r\n")}s=s.join("");var h=void 0;h=new Blob([s],{type:"text/plain"});var d=(window.URL||window.webkitURL).createObjectURL(h);var p=window.document.createElement("a");p.href=d;p.download=y;var v=document.createEvent("MouseEvents");v.initEvent("click",true,true);p.dispatchEvent(v)}e()});return e}},{key:"JS_StartAsyncDownload",value:function fe(i,e,r,o){var t=new Promise(function(e){var t=xt(Et.oTool.parseXmlFromStr(o)).find("playbackURI").eq(0).text();var n=i+(i.indexOf("?")>=0?"&":"?")+"playbackURI="+t;xt("body").append('<a id="jsplugin_download_a" href="'+n+'" download='+r+'><li id="jsplugin_download_li"></li></a>');xt("#jsplugin_download_li").trigger("click");xt("#jsplugin_download_a").remove();e()});return t}},{key:"JS_StopAsyncDownload",value:function ce(){var e=new Promise(function(e){e()});return e}},{key:"JS_GetDownloadStatus",value:function he(){var e=new Promise(function(e){e()});return e}},{key:"JS_GetDownloadProgress",value:function de(){var e=new Promise(function(e){e()});return e}},{key:"JS_EnablePDC",value:function pe(){var e=new Promise(function(e){e()});return e}},{key:"JS_Resize",value:function ve(n,i){var e=new Promise(function(e){setTimeout(function(){var e=document.fullscreen||document.webkitIsFullScreen||document.mozFullScreen||false;if(Ke[ht]&&e){n=xt(window).width();i=xt(window).height();rt.find("div").eq(0).css({width:n,height:i})}else{rt.find("div").eq(0).css({width:n,height:i})}Ke[ot].iWidth=n;Ke[ot].iHeight=i;if(Et.oTool.isFirefox()){for(var t=0;t<Ke[ot].iMaxSplit*Ke[ot].iMaxSplit;t++){if(Ke[lt][t].oPlayCtrl){Ke[lt][t].oPlayCtrl.PlayM4_ClearCanvas()}}}kt();if(Ke[dt]&&e){n=xt(window).width();i=xt(window).height();Ke[dt].css({width:n,height:i});Ke[dt].find("canvas").attr("width",n-2);Ke[dt].find("canvas").attr("height",i-2)}if(!e){Ke[dt]=null;Ke[ht]=false}Ke[ft].resizeCanvas();Ke[ft].canvasRedraw()},80);e()});return e}},{key:"JS_SetDrawCallback",value:function me(n,i,e,t,r){var o=new Promise(function(e,t){Ke[gt]=null;Ke[Pt][n]=null;if(!Ke[lt][n].bPlay){t();return}if(i){xt(".draw-window").unbind();Ke[gt]=r;Ke[Pt][n]=r;Ke[ft]=new Ot.ESCanvas(Ke[ot].szId+"canvas_draw"+n);Ke[ft].setShapeType("Rect");Ke[ft].setDrawStyle("#ff0000","",0);Ke[ft].setDrawStatus(true,function(e){r(e)});Ke[lt][n].bSetDrawCallback=true}else{Ke[ft].setDrawStatus(false);Ke[lt][n].bSetDrawCallback=false;Ke[wt]&&Ke[wt].onDrawEvent&&Ke[ft].setDrawEventCallback(Ke[wt].onDrawEvent)}e()});return o}},{key:"JS_SetDrawStatus",value:function ye(n){var e=new Promise(function(e,t){if(!Ke[ft]){t();return}Ke[ft].setDrawStatus(n);e()});return e}},{key:"JS_ClearRegion",value:function ge(){var e=new Promise(function(e,t){if(!Ke[ft]){t();return}Ke[ft].clearAllShape();e()});return e}},{key:"JS_SetDrawShapeInfo",value:function Pe(i,r){var e=new Promise(function(e,t){if(typeof i==="undefined"||i===""){t();return}if(""!==r.id&&"Rect"===i){Ke[ft].deleteRepeatByIdAndType(r.id,"Rect")}Ke[ft].setShapeType(i);Ke[ft].setDrawStatus(true);Ke[ft].setDrawMutiShapeOneTime(false);Ke[ft].setDrawStyle(r.drawColor||"",r.fillColor||r.drawColor||"",r.translucent||0);if(r.maxShapeSupport&&r.maxShapeSupport>0){if(r.id){var n=Ke[ft].getAllShapesInfo().length;Ke[ft].setMaxShapeSupport(n+1)}else{Ke[ft].setMaxShapeSupport(r.maxShapeSupport)}}Ke[ft].setCurrentShapeInfo({szId:r.id,szTips:r.tips,lineType:r.lineType,iMinClosed:r.minPointSupport||r.minClosed||3,iMaxPointNum:r.maxPointSupport||r.pointNumMax||11,iPolygonType:1,szDrawColor:r.drawColor||"",szFillColor:r.fillColor||r.drawColor||"",iTranslucent:r.translucent||0,iRedrawMode:r.redrawMode||0,type:r.type});e()});return e}},{key:"JS_SetGridInfo",value:function we(i){var e=new Promise(function(e,t){if(i===null||typeof i==="undefined"){t();return}var n="#ff0000";if(i.drawColor){n=i.drawColor}Ke[ft].setDrawStyle(n);Ke[ft].setShapesInfoByType("Grid",[{gridMap:i.gridMap,gridColNum:i.gridColNum,gridRowNum:i.gridRowNum}]);Ke[ft].setShapeType("Grid");e()});return e}},{key:"JS_GetGridInfo",value:function Se(){var e=new Promise(function(e,t){if(!Ke[ft]){t()}var n=Ke[ft].getShapesInfoByType("Grid")[0];if(!n){t()}e({gridColNum:n.gridColNum,gridRowNum:n.gridRowNum,gridMap:n.gridMap})});return e}},{key:"JS_SetRectInfo",value:function _e(s){var e=new Promise(function(e,t){if(typeof s==="undefined"||!s.length){t();return}if(s[0]&&s[0].maxShapeSupport&&s[0].maxShapeSupport>0){Ke[ft].setMaxShapeSupport(s[0].maxShapeSupport)}else{Ke[ft].setMaxShapeSupport(25)}Ke[ft].setDrawMutiShapeOneTime(false);var n=[];if(s.length>0){for(var i=0,r=s.length;i<r;i++){var o=s[i].points;if(o.length>0){n.push(s[i])}}}if(n.length>0){Ke[ft].setShapesInfoByType("Rect",n);e()}else{t()}});return e}},{key:"JS_GetRectInfo",value:function be(){var e=new Promise(function(e,t){if(!Ke[ft]){t()}var n=[];var i=Ke[ft].getShapesInfoByType("Rect");for(var r=0,o=i.length;r<o;r++){var s=i[r];var a={id:s.id,points:s.points,closed:s.closed,tips:s.tips};n.push(a)}e(n)});return e}},{key:"JS_SetPolygonInfo",value:function Ce(s){var e=new Promise(function(e,t){if(typeof s==="undefined"||!s.length){t();return}Ke[ft].setMaxShapeSupport(25);Ke[ft].setDrawMutiShapeOneTime(false);Ke[ft].setShapeType("");var n=[];if(s.length>0){for(var i=0,r=s.length;i<r;i++){var o=s[i].points;if(o.length>0){Ke[ft].setCurrentShapeInfo({szId:s[i].id});n.push(s[i])}}}if(n.length>0){Ke[ft].setShapesInfoByType("Polygon",n);e()}else{t()}});return e}},{key:"JS_GetPolygonInfo",value:function ke(){var e=new Promise(function(e){var t=[];var n=Ke[ft].getShapesInfoByType("Polygon");for(var i=0,r=n.length;i<r;i++){var o=n[i];var s={id:o.id,points:o.points,closed:o.closed,tips:o.tips,drawColor:o.drawColor};t.push(s)}e(t)});return e}},{key:"JS_SetLineInfo",value:function Te(f){var e=new Promise(function(e,t){if(typeof f==="undefined"||!f.length){t();return}var n=[];Ke[ft].setMaxShapeSupport(25);Ke[ft].setDrawMutiShapeOneTime(false);if(f.length>0){for(var i=0,r=f.length;i<r;i++){var o=Ke[ft].getShapesInfoByType("Line");for(var s=0,a=o.length;s<a;s++){var u=o[s];if(f[i].id===u.id){Ke[ft].deleteRepeatByIdAndType(f[i].id,"Line")}}var l=f[i].points;if(l.length>0){n.push(f[i])}}}if(n.length>0){Ke[ft].setShapesInfoByType("Line",n);Ke[ft].setShapeType("");e()}else{t()}});return e}},{key:"JS_GetLineInfo",value:function Re(){var e=new Promise(function(e){var t=[];var n=Ke[ft].getShapesInfoByType("Line");for(var i=0,r=n.length;i<r;i++){var o=n[i];var s={id:o.id,lineType:o.lineType,points:o.points,tips:o.tips,direction:o.direction,closed:o.closed,pdcArrow:o.pdcArrow};t.push(s)}e(t)});return e}},{key:"JS_SetTextOverlay",value:function De(v){var e=new Promise(function(e){Ke[ft]=null;Ke[ft]=new Ot.ESCanvas(Ke[ot].szId+"canvas_draw"+Ke[yt]);Ke[ft].setMaxShapeSupport(25);Ke[ft].clearShapeByType("RectOSD");Ke[ft].setDrawStyle("#ff0000","#343434",.7);var t="";var n="";var i=0;var r=0;if(v.channelName){t=v.channelName.name;n=v.channelName.enable.toString();i=v.channelName.point[0];r=v.channelName.point[1];Ke[ft].addOSDShape(t,n,i,r,{szOSDType:"overlay-ch",szAlignment:v.channelName.alignment||"0"})}if(v.date){var o=v.date.dateType;var s=v.date.showWeekDay;var a=v.date.timeFormat;var u="";var l="";t="";n=v.date.enable.toString();i=v.date.point[0];r=v.date.point[1];var f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var c=new Date;if(s){u=f[c.getDay()]}if(a==="24hour"){l=""}else{l="AM/PM"}switch(o){case 0:t="YYYY-MM-DD "+u+" hh:mm:ss "+l;break;case 1:t="MM-DD-YYYY "+u+" hh:mm:ss "+l;break;case 2:t="CHR-YYYY-MM-DD "+u+" hh:mm:ss "+l;break;case 3:t="CHR-MM-DD-YYYY "+u+" hh:mm:ss "+l;break;case 4:t="DD-MM-YYYY "+u+" hh:mm:ss "+l;break;case 5:t="CHR-DD-MM-YYYY "+u+" hh:mm:ss "+l;break;default:break}Ke[ft].addOSDShape(t,n,i,r,{szOSDType:"overlay-date",szDateStyle:o.toString(),szDisplayWeek:s.toString(),szClockType:a,szAlignment:v.date.alignment||"0"})}if(v.text){var h="";var d=v.text.length;t="";n="";i=0;r=0;for(var p=0;p<d;p++){h=v.text[p].id;t=v.text[p].text;n=v.text[p].enable.toString();i=v.text[p].point[0];r=v.text[p].point[1];Ke[ft].addOSDShape(t,n,i,r,{szOSDType:"overlay-text",szId:h,szAlignment:v.text[p].alignment||"0"})}}Ke[wt]&&Ke[wt].onDrawEvent&&Ke[ft].setDrawEventCallback(Ke[wt].onDrawEvent);e()});return e}},{key:"JS_GetTextOverlay",value:function xe(){var e=new Promise(function(e){var t={};var n=[];var i=Ke[ft].getShapesInfoByType("RectOSD");for(var r=0,o=i.length;r<o;r++){var s=i[r];if(s.szOSDType==="overlay-ch"){t.channelName={enable:s.szEnabled==="true",name:s.szText,alignment:s.szAlignment||"0",point:[s.iPositionX,s.iPositionY]}}if(s.szOSDType==="overlay-date"){t.date={enable:s.szEnabled==="true",alignment:s.szAlignment||"0",dateType:parseInt(s.szDateStyle,10),timeFormat:s.szClockType,showWeekDay:s.szDisplayWeek==="true",point:[s.iPositionX,s.iPositionY]}}if(s.szOSDType==="overlay-text"){n.push({id:s.szId,enable:s.szEnabled==="true",alignment:s.szAlignment||"0",text:s.szText,point:[s.iPositionX,s.iPositionY]})}}t.text=n;e(t)});return e}},{key:"JS_SetPointInfo",value:function Ie(f){var e=new Promise(function(e,t){if(typeof f==="undefined"||!f.length){t();return}var n=[];Ke[ft].setMaxShapeSupport(25);Ke[ft].setDrawMutiShapeOneTime(false);if(f.length>0){for(var i=0,r=f.length;i<r;i++){var o=Ke[ft].getShapesInfoByType("Point");for(var s=0,a=o.length;s<a;s++){var u=o[s];if(f[i].id===u.id){Ke[ft].deleteRepeatByIdAndType(f[i].id,"Point")}}var l=f[i].points;if(l.length>0){f[i].points=[l];n.push(f[i])}}}if(n.length>0){Ke[ft].setShapesInfoByType("Point",n);e()}else{t()}});return e}},{key:"JS_GetPointInfo",value:function Ee(){var e=new Promise(function(e){var t=[];var n=Ke[ft].getShapesInfoByType("Point");for(var i=0,r=n.length;i<r;i++){var o=n[i];var s={id:o.id,point:o.points,tips:o.tips,type:o.type,drawColor:o.drawColor};t.push(s)}e(t)});return e}},{key:"JS_ClearShapeByType",value:function qe(o,s){var e=new Promise(function(e,t){if(!Ke[ft]){t();return}if(o==="Choosed"){var n=Ke[ft].deleteChoosedShape();e(n)}else if(s&&s.length>0){for(var i=0,r=s.length;i<r;i++){Ke[ft].deleteTargetShape(o,s[i])}e()}else{Ke[ft].clearShapeByType(o);e()}});return e}},{key:"JS_PlayWithImg",value:function Ae(e,r){if(this[ot].iType===0){return Promise.resolve()}var t=xt("#"+this[ot].szId+"canvas_play"+e);var n=t.width();var i=t.height();t.hide();var o=xt("#playImg"+e);o.show();o.css({width:n+"px",height:i+"px",border:"1px solid "+Ke.oPluginColor.borderColor,position:"absolute",left:0});return new Promise(function(e,t){function n(){o.unbind("load",n);o.unbind("error",i);e()}function i(){o.unbind("error",i);o.unbind("load",n);t()}o.bind("load",n);o.bind("error",i);o.attr("src",r)})}},{key:"JS_SetIsHttps",value:function Oe(){var e=new Promise(function(e){e()});return e}},{key:"JS_SetReconnectInfo",value:function Me(){var e=new Promise(function(e){e()});return e}},{key:"JS_CheckUpdate",value:function Le(){var e=new Promise(function(e){e(false)});return e}},{key:"JS_SelectShape",value:function Fe(n,i){var e=new Promise(function(e,t){if(!n){t();return}Ke[ft].selectShapeById(n,""+i);e()});return e}},{key:"JS_GetPictureSize",value:function We(){var e=new Promise(function(e){e()});return e}},{key:"JS_SetOriginResolution",value:function Ne(){var e=new Promise(function(e){e()});return e}},{key:"JS_SetPlayWndMode",value:function Be(){var e=new Promise(function(e){e()});return e}},{key:"JS_UpdateWindowStyle",value:function n(t){var e=new Promise(function(e){Ke[ot].oStyle=t;kt();e()});return e}},{key:"JS_CuttingPartWindow",value:function ze(){var e=new Promise(function(e){e()});return e}},{key:"JS_RepairPartWindow",value:function Je(){var e=new Promise(function(e){e()});return e}},{key:"JS_ClearAllCanvas",value:function He(){var e=new Promise(function(e){xt(".draw-window").each(function(){xt(this)[0].getContext("2d").clearRect(0,0,xt(this).width(),xt(this).height())});e()});return e}},{key:"JS_DestroyAll",value:function e(){this.JS_DestroyPlugin();return Promise.resolve()}},{key:"JS_SetPackageType",value:function Ue(){return Promise.resolve()}},{key:"JS_SetSnapDrawWndIndex",value:function je(e){Ke[_t]=e;if(Ke[_t]<0||Ke[_t]>Ke[ut]-1){e=Ke[yt]}Ke.EventCallback.windowEventSelect(e,true);return Promise.resolve()}},{key:"JS_GetSlfPointList",value:function Ge(){var e=new Promise(function(e){e()});return e}},{key:"JS_GetSlfVersion",value:function Ve(){var e=new Promise(function(e){e()});return e}},{key:"JS_ExistGetSlfPointList",value:function Ye(){var e=new Promise(function(e){e()});return e}},{key:"JS_GetIpcImportErrorInfo",value:function Xe(){var e=new Promise(function(e){e()});return e}},{key:"JS_SetWindowSelected",value:function Ze(e){rt.find(".parent-wnd").eq(0).find(".play-window").css("border","1px solid "+Ke.oPluginColor.borderColor);rt.find(".parent-wnd").eq(0).children().eq(e).find(".play-window").eq(0).css("border","1px solid "+Ke.oPluginColor.selectBorderColor);Ke.EventCallback.windowEventSelect(e);return Promise.resolve()}}]);return r}();return t}();t.JSPlugin=e}).call(this,i(1))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.StreamClient=undefined;var d=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(e,t,n){if(t)i(e.prototype,t);if(n)i(e,n);return e}}();var i=n(8);var p=u(i);var r=n(66);var o=n(67);var s=n(68);var a=n(71);function u(e){return e&&e.__esModule?e:{"default":e}}function v(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var l=function(){var C=Symbol("WEBSOCKET");var c=Symbol("WEBSOCKETALL");var k=Symbol("GETINDEX");var T=Symbol("PROTOCOLVERSION");var R=Symbol("CIPHERSUITES");var h=new r.DirectDeviceCustom;var D=new o.DirectDevice;var x=new s.LiveMedia;var I=new a.LocalService;var e=function(){function e(){v(this,e);this[T]="0.1";this[R]=0;this[C]=[];this[c]=[];this.ERRORS={};this[k]=function(e){var t=-1;for(var n=0,i=this[C].length;n<i;n++){if(this[C][n].id===e){t=n;break}}return t}}d(e,[{key:"openStream",value:function f(e,v,m,n){var t=false;if(e.indexOf("[")>-1){t=true}var y=this;var i=e.split("://");var r=i[0];var g="";var P=7681;var w=1;var S=0;if(t){g=i[1].split("]:")[0]+"]";P=Math.floor(i[1].split("]:")[1].split("/")[0]);w=Math.floor(i[1].split("]:")[1].split("/")[1]/100);S=Math.floor(i[1].split("]:")[1].split("/")[1]%100)-1}else{g=i[1].split(":")[0];P=Math.floor(i[1].split(":")[1].split("/")[0]);w=Math.floor(i[1].split(":")[1].split("/")[1]/100);S=Math.floor(i[1].split(":")[1].split("/")[1]%100)-1}if(w===0){S=0}v=v||{};var o="&sessionID=";if(v.token&&!v.playURL){o="&token="}var s="";if(v.secondAuth){var a=v.secondAuth.split("&");if(a&&a.length){a.forEach(function(e){if(-1!==e.indexOf("security=")||-1!==e.indexOf("iv=")){s+="&"+e}else{var t=e.split("=");if(t&&2===t.length){v[t[0]]=t[1]}}})}}var u=v.sessionID||v.session||(v.playURL?"":v.token)||"";var _=new window.WebSocket(r+"://"+g+":"+P+(v.mode?"/"+v.mode:"")+"?version="+y[T]+"&cipherSuites="+y[R]+o+u+s+(v.proxy?"&proxy="+v.proxy:""));_.binaryType="arraybuffer";var b=p["default"].v4();var l=new Promise(function(d,p){_.onopen=function(){y[c].push(h.createClientObject(_,b,w,S));if(!v.playURL&&!v.sessionID&&!v.deviceSerial&&!v.token){y[C].push(h.createClientObject(_,b,w,S));d(b)}};_.onmessage=function(e){if(typeof e.data==="string"){var t=JSON.parse(e.data);var n=y[k](b);if(t&&t.version&&t.cipherSuite){y[T]=t.version;y[R]=parseInt(t.cipherSuite,10);if(t&&t.PKD&&t.rand){y[C].push(x.createClientObject(_,b,t.PKD,t.rand,v))}else{var i="live://"+g+":"+P+"/"+w+"/"+S;if(y[R]===-1){y[C].push(I.createClientObject(_,b,i,v))}else{y[C].push(D.createClientObject(_,b,i))}}d(b);return}if(t&&t.sdp){var r=D.getMediaFromSdp(t.sdp);var o=D.getMediaType(t.sdp);if("0004"===o){m({type:"videoNotSupport"})}else{m({bHead:true,buf:r})}}if(t&&t.cmd){if(t.cmd==="end"){m({type:"exception",cmd:t.cmd})}}if(t&&t.statusString){if(t.statusString.toLowerCase()==="ok"){if(y[C][n].resolve){y[C][n].resolve(t)}}if(t.statusString.toLowerCase()!=="ok"){var s=D.getError(t);if(n>-1){if(y[C][n].reject){y[C][n].reject(s)}}else{p(s)}}}}else{var a={};var u=new Uint8Array(e.data);if(u.byteLength===64||u.byteLength===40){var l=-1;var f=u.byteLength;for(var c=0;c<f;c++){if(u[c]===73&&u[c+1]===77&&u[c+2]===75&&u[c+3]===72){l=c;break}}if(l!==-1){var h=u.slice(l,l+40);a={bHead:true,buf:h}}else{a={bHead:false,buf:u}}}else{a={bHead:false,buf:u}}m(a);u=null;a=null;e=null}};_.onclose=function(){for(var e=0,t=y[C].length;e<t;e++){if(y[C][e].id===b){y[C][e].resolve();y[C].splice(e,1);setTimeout(function(){n()},200);break}}p()}});return l}},{key:"startPlay",value:function n(e,i,r,o){var s=this;var a=this[k](e);if(i&&r&&s[T]==="0.1"){i=i.replace(/-/g,"").replace(/:/g,"");r=r.replace(/-/g,"").replace(/:/g,"")}var t=new Promise(function(e,t){if(a>-1){s[C][a].resolve=e;s[C][a].reject=t;var n=null;if(!i||!r){if(s[C][a].iCurChannel===0&&s[T]==="0.1"){n=h.zeroPlayCmd(s[C][a].iCurChannel,s[C][a].iCurStream)}else{if(s[T]!=="0.1"){if(s[R]===0){n=x.playCmd(s[C][a])}else if(s[R]===1){n=D.playCmd(s[C][a].playURL)}else if(s[R]===-1){n=I.playCmd(s[C][a])}}else{n=h.playCmd(s[C][a].iCurChannel,s[C][a].iCurStream)}}}else{if(s[T]!=="0.1"){if(s[R]===0){n=x.playbackCmd(s[C][a],i,r)}else if(s[R]===1){n=D.playbackCmd(i,r,s[C][a].playURL,o)}else if(s[R]===-1){n=I.playbackCmd(s[C][a],i,r)}}else{n=h.playbackCmd(i,r,s[C][a].iCurChannel,s[C][a].iCurStream)}}s[C][a].socket.send(n);if(s[T]==="0.1"){e()}}else{if(s[T]==="0.1"){t()}}});return t}},{key:"singleFrame",value:function t(){}},{key:"setPlayRate",value:function i(s,a){var u=this;var e=new Promise(function(e,t){for(var n=0,i=u[C].length;n<i;n++){if(u[C][n].id===s){if(u[T]==="0.1"){var r=h.playRateCmd(a);u[C][n].socket.send(r);e();break}else{u[C][n].resolve=e;u[C][n].reject=t;var o=D.playRateCmd(a);u[C][n].socket.send(o)}}}});return e}},{key:"seek",value:function r(o,s,a){var u=this;var e=new Promise(function(e,t){for(var n=0,i=u[C].length;n<i;n++){if(u[C][n].id===o){u[C][n].resolve=e;u[C][n].reject=t;var r=x.seekCmd(s,a);u[C][n].socket.send(r)}}});return e}},{key:"pause",value:function o(s){var a=this;var e=new Promise(function(e,t){for(var n=0,i=a[C].length;n<i;n++){if(a[C][n].id===s){if(a[T]==="0.1"){var r=h.pauseCmd();a[C][n].socket.send(r);e();break}else{a[C][n].resolve=e;a[C][n].reject=t;var o=D.pauseCmd();a[C][n].socket.send(o)}}}});return e}},{key:"transmission",value:function a(r,o){var s=this;var e=new Promise(function(e,t){for(var n=0,i=s[C].length;n<i;n++){if(s[C][n].id===r){s[C][n].resolve=e;s[C][n].reject=t;s[C][n].socket.send(o)}}});return e}},{key:"resume",value:function u(s){var a=this;var e=new Promise(function(e,t){for(var n=0,i=a[C].length;n<i;n++){if(a[C][n].id===s){if(a[T]==="0.1"){var r=h.resumeCmd();a[C][n].socket.send(r);e();break}else{a[C][n].resolve=e;a[C][n].reject=t;var o=D.resumeCmd();a[C][n].socket.send(o)}}}});return e}},{key:"stop",value:function l(o){var s=this;var e=new Promise(function(e,t){if(!o){t()}else{var n=-1;for(var i=0,r=s[C].length;i<r;i++){if(s[C][i].id===o){n=i;s[C][i].resolve=e;s[C][i].socket.close(1e3,"CLOSE");break}}if(n===-1){t()}}});return e}},{key:"stopAll",value:function s(){var e=this;for(var t=0,n=e[C].length;t<n;t++){e[C][t].socket.close(1e3,"CLOSE")}for(var i=0,r=e[c].length;i<r;i++){e[c][i].socket.close(1e3,"CLOSE")}}}]);return e}();return e}();t.StreamClient=l},function(e,t,n){var p=n(39);var v=n(40);var m;var y;var g=0;var P=0;function i(e,t,n){var i=t&&n||0;var r=t||[];e=e||{};var o=e.node||m;var s=e.clockseq!==undefined?e.clockseq:y;if(o==null||s==null){var a=p();if(o==null){o=m=[a[0]|1,a[1],a[2],a[3],a[4],a[5]]}if(s==null){s=y=(a[6]<<8|a[7])&16383}}var u=e.msecs!==undefined?e.msecs:(new Date).getTime();var l=e.nsecs!==undefined?e.nsecs:P+1;var f=u-g+(l-P)/1e4;if(f<0&&e.clockseq===undefined){s=s+1&16383}if((f<0||u>g)&&e.nsecs===undefined){l=0}if(l>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}g=u;P=l;y=s;u+=122192928e5;var c=((u&268435455)*1e4+l)%4294967296;r[i++]=c>>>24&255;r[i++]=c>>>16&255;r[i++]=c>>>8&255;r[i++]=c&255;var h=u/4294967296*1e4&268435455;r[i++]=h>>>8&255;r[i++]=h&255;r[i++]=h>>>24&15|16;r[i++]=h>>>16&255;r[i++]=s>>>8|128;r[i++]=s&255;for(var d=0;d<6;++d){r[i+d]=o[d]}return t?t:v(r)}e.exports=i},function(e,t,n){var s=n(39);var a=n(40);function i(e,t,n){var i=t&&n||0;if(typeof e=="string"){t=e==="binary"?new Array(16):null;e=null}e=e||{};var r=e.random||(e.rng||s)();r[6]=r[6]&15|64;r[8]=r[8]&63|128;if(t){for(var o=0;o<16;++o){t[i+o]=r[o]}}return t||a(r)}e.exports=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var s=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(e,t,n){if(t)i(e.prototype,t);if(n)i(e,n);return e}}();function u(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var i=function(){var e=function(){function e(){u(this,e)}s(e,[{key:"createClientObject",value:function r(e,t,n,i){return{socket:e,id:t,iCurChannel:n,iCurStream:i,resolve:null,reject:null}}},{key:"zeroPlayCmd",value:function i(e,t){var n=[0,0,0,44,0,0,0,0,0,0,0,0,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,e+1,0,0,0,t,0,0,4,0];return new Uint8Array(n)}},{key:"playCmd",value:function o(e,t){var n=[0,0,0,44,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,e,0,0,0,t,0,0,4,0];return new Uint8Array(n)}},{key:"playbackCmd",value:function w(e,t,n,i){var r=e.split("T")[0];var o=e.split("T")[1];var s="0"+parseInt(r.substring(0,4),10).toString(16);var a=parseInt(r.substring(4,6),10);var u=parseInt(r.substring(6),10);var l=parseInt(o.substring(0,2),10);var f=parseInt(o.substring(2,4),10);var c=parseInt(o.substring(4,6),10);var h=t.split("T")[0];var d=t.split("T")[1];var p="0"+parseInt(h.substring(0,4),10).toString(16);var v=parseInt(h.substring(4,6),10);var m=parseInt(d.substring(0,2),10);var y=parseInt(d.substring(2,4),10);var g=parseInt(d.substring(4,6),10);var P=[0,0,0,96,0,0,0,0,0,0,0,0,0,3,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,n,0,0,parseInt(s.substring(0,2),16),parseInt(s.substring(2,4),16),0,0,0,a,0,0,0,u,0,0,0,l,0,0,0,f,0,0,0,c,0,0,parseInt(p.substring(0,2),16),parseInt(p.substring(2,4),16),0,0,0,v,0,0,0,u,0,0,0,m,0,0,0,y,0,0,0,g,0,0,0,0,0,0,0,0,i,0,0,0];return new Uint8Array(P)}},{key:"playRateCmd",value:function a(e){var t=(parseInt(e,10)>>>0).toString(16).toLocaleUpperCase().toString(16);for(var n=t.length;n<8;n++){t="0"+t}var i=[0,0,0,0];for(var r=0,o=t.length;r<o;r=r+2){i[Math.floor(r/2)]=parseInt(t.substring(r,r+2),16)}var s=[0,0,0,36,0,0,0,0,0,0,0,0,0,3,1,47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,i[0],i[1],i[2],i[3]];return new Uint8Array(s)}},{key:"pauseCmd",value:function t(){var e=[0,0,0,32,0,0,0,0,0,0,0,0,0,3,1,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];return new Uint8Array(e)}},{key:"resumeCmd",value:function n(){var e=[0,0,0,32,0,0,0,0,0,0,0,0,0,3,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];return new Uint8Array(e)}}]);return e}();return e}();t.DirectDeviceCustom=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var f=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(e,t,n){if(t)i(e.prototype,t);if(n)i(e,n);return e}}();function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var h=2203;var d=2206;var p=2207;var v=3001;var m=3002;var y=3003;var g=3004;var P=3005;var w=3006;var S=3007;var _=7045;var b=7046;var i=function(){var e=function(){function e(){c(this,e)}f(e,[{key:"createClientObject",value:function i(e,t,n){return{socket:e,id:t,playURL:n,resolve:null,reject:null}}},{key:"getMediaFromSdp",value:function s(e){var t=e.indexOf("MEDIAINFO=")+10;var n=e.slice(t,t+80);var i=[];for(var r=0,o=n.length/2;r<o;r++){i[r]=parseInt(n.slice(r*2,r*2+2),16)}return new Uint8Array(i)}},{key:"getMediaType",value:function r(e){var t=e.indexOf("MEDIAINFO=")+10;var n=e.slice(t,t+80);n=n.slice(20,24);return n}},{key:"playCmd",value:function n(e){var t={sequence:0,cmd:"realplay",url:e};return JSON.stringify(t)}},{key:"playbackCmd",value:function o(e,t,n,i){var r={sequence:0,cmd:"playback",url:n,startTime:e,endTime:t};i&&i.userName&&(r.userName=i.userName);i&&i.password&&(r.password=i.password);return JSON.stringify(r)}},{key:"playRateCmd",value:function a(e){var t={sequence:0,cmd:"speed",rate:e};return JSON.stringify(t)}},{key:"pauseCmd",value:function t(){var e={sequence:0,cmd:"pause"};return JSON.stringify(e)}},{key:"resumeCmd",value:function u(){var e={sequence:0,cmd:"resume"};return JSON.stringify(e)}},{key:"getError",value:function l(e){var t=v;if(e){if(parseInt(e.MErrDevSelfEx,10)>0){t=parseInt(e.MErrDevSelfEx,10)}else if(parseInt(e.MErrCode,10)>0){t=parseInt(e.MErrCode,10)}else if(parseInt(e.statusCode,10)===6&&e.subStatusCode==="streamLimit"){t=m}else if(parseInt(e.statusCode,10)===4&&e.subStatusCode==="badAuthorization"){t=y}else if(parseInt(e.statusCode,10)===4&&e.subStatusCode==="lowPrivilege"){t=g}else if(parseInt(e.statusCode,10)===4&&e.subStatusCode==="notSupport"){t=P}else if(parseInt(e.statusCode,10)===6&&e.subStatusCode==="insufficientTranscodingResources"){t=S}else if(parseInt(e.statusCode,10)===6&&e.subStatusCode==="incorrentUserNameOrPassword"){t=h}else if(parseInt(e.statusCode,10)===6&&e.subStatusCode==="needDoubleVerification"){t=d}else if(parseInt(e.statusCode,10)===6&&e.subStatusCode==="noDoubleVerificationUser"){t=p}else if(parseInt(e.statusCode,10)===6&&e.subStatusCode==="achieveMaxChannelLimit"){t=w}else if(parseInt(e.statusCode,10)===4&&e.subStatusCode==="limitPreviewNumber"){t=_}else if(parseInt(e.statusCode,10)===4&&e.subStatusCode==="notEncodeOrFail"){t=b}}return t}}]);return e}();return e}();t.DirectDevice=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.LiveMedia=undefined;var o=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(e,t,n){if(t)i(e.prototype,t);if(n)i(e,n);return e}}();var i=n(69);var s=a(i);var r=n(70);var u=a(r);function a(e){return e&&e.__esModule?e:{"default":e}}function l(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var f=function(){var e=function(){function e(){l(this,e)}o(e,[{key:"createClientObject",value:function a(e,t,n,i,r){var o=u["default"].AES.encrypt((new Date).getTime().toString(),u["default"].enc.Hex.parse("1234567891234567123456789123456712345678912345671234567891234567"),{mode:u["default"].mode.CBC,iv:u["default"].enc.Hex.parse("12345678912345671234567891234567"),padding:u["default"].pad.Pkcs7}).ciphertext.toString();if(o.length<64){o=o+o}var s=u["default"].AES.encrypt((new Date).getTime().toString(),u["default"].enc.Hex.parse("12345678912345671234567891234567"),{mode:u["default"].mode.CBC,iv:u["default"].enc.Hex.parse("12345678912345671234567891234567"),padding:u["default"].pad.Pkcs7}).ciphertext.toString();return{socket:e,id:t,PKD:n,rand:i,playURL:r.playURL||"",auth:r.auth||"",token:r.token||"",key:o,iv:s,resolve:null,reject:null}}},{key:"playCmd",value:function n(e){var t={sequence:0,cmd:"realplay",url:e.playURL,key:s["default"].encrypt(e.iv+":"+e.key,e.PKD).cipher.split("?")[0],authorization:u["default"].AES.encrypt(e.rand+":"+e.auth,u["default"].enc.Hex.parse(e.key),{mode:u["default"].mode.CBC,iv:u["default"].enc.Hex.parse(e.iv),padding:u["default"].pad.Pkcs7}).ciphertext.toString(),token:u["default"].AES.encrypt(e.token,u["default"].enc.Hex.parse(e.key),{mode:u["default"].mode.CBC,iv:u["default"].enc.Hex.parse(e.iv),padding:u["default"].pad.Pkcs7}).ciphertext.toString()};return JSON.stringify(t)}},{key:"playbackCmd",value:function r(e,t,n){var i={sequence:0,cmd:"playback",url:e.playURL,key:s["default"].encrypt(e.iv+":"+e.key,e.PKD).cipher.split("?")[0],authorization:u["default"].AES.encrypt(e.rand+":"+e.auth,u["default"].enc.Hex.parse(e.key),{mode:u["default"].mode.CBC,iv:u["default"].enc.Hex.parse(e.iv),padding:u["default"].pad.Pkcs7}).ciphertext.toString(),token:u["default"].AES.encrypt(e.token,u["default"].enc.Hex.parse(e.key),{mode:u["default"].mode.CBC,iv:u["default"].enc.Hex.parse(e.iv),padding:u["default"].pad.Pkcs7}).ciphertext.toString(),startTime:t,endTime:n};return JSON.stringify(i)}},{key:"seekCmd",value:function i(e,t){var n={sequence:0,cmd:"seek",startTime:e,endTime:t};return JSON.stringify(n)}}]);return e}();return e}();t.LiveMedia=f},function(W,N,B){"use strict";var z=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var e={appName:"Netscape",appVersion:40};var t,J=0xdeadbeefcafe,n=(J&16777215)==15715070;function m(e,t,n){e!=null&&("number"==typeof e?this.fromNumber(e,t,n):t==null&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function y(){return new m(null)}function H(e,t,n,i,r,o){for(;--o>=0;){var s=t*this[e++]+n[i]+r,r=Math.floor(s/67108864);n[i++]=s&67108863}return r}function U(e,t,n,i,r,o){var s=t&32767;for(t>>=15;--o>=0;){var a=this[e]&32767,u=this[e++]>>15,l=t*a+u*s,a=s*a+((l&32767)<<15)+n[i]+(r&1073741823),r=(a>>>30)+(l>>>15)+t*u+(r>>>30);n[i++]=a&1073741823}return r}function j(e,t,n,i,r,o){var s=t&16383;for(t>>=14;--o>=0;){var a=this[e]&16383,u=this[e++]>>14,l=t*a+u*s,a=s*a+((l&16383)<<14)+n[i]+r,r=(a>>28)+(l>>14)+t*u;n[i++]=a&268435455}return r}n&&e.appName=="Microsoft Internet Explorer"?(m.prototype.am=U,t=30):n&&e.appName!="Netscape"?(m.prototype.am=H,t=26):(m.prototype.am=j,t=28);m.prototype.DB=t;m.prototype.DM=(1<<t)-1;m.prototype.DV=1<<t;var r=52;m.prototype.FV=Math.pow(2,r);m.prototype.F1=r-t;m.prototype.F2=2*t-r;var G="0123456789abcdefghijklmnopqrstuvwxyz",o=[],s,a;s="0".charCodeAt(0);for(a=0;a<=9;++a){o[s++]=a}s="a".charCodeAt(0);for(a=10;a<36;++a){o[s++]=a}s="A".charCodeAt(0);for(a=10;a<36;++a){o[s++]=a}function l(e){return G.charAt(e)}function f(e,t){var n=o[e.charCodeAt(t)];return n==null?-1:n}function V(e){for(var t=this.t-1;t>=0;--t){e[t]=this[t]}e.t=this.t;e.s=this.s}function Y(e){this.t=1;this.s=e<0?-1:0;e>0?this[0]=e:e<-1?this[0]=e+DV:this.t=0}function p(e){var t=y();t.fromInt(e);return t}function X(e,t){var n;if(t==16)n=4;else if(t==8)n=3;else if(t==256)n=8;else if(t==2)n=1;else if(t==32)n=5;else if(t==4)n=2;else{this.fromRadix(e,t);return}this.s=this.t=0;for(var i=e.length,r=!1,o=0;--i>=0;){var s=n==8?e[i]&255:f(e,i);s<0?e.charAt(i)=="-"&&(r=!0):(r=!1,o==0?this[this.t++]=s:o+n>this.DB?(this[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this[this.t++]=s>>this.DB-o):this[this.t-1]|=s<<o,o+=n,o>=this.DB&&(o-=this.DB))}if(n==8&&(e[0]&128)!=0)this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o);this.clamp();r&&m.ZERO.subTo(this,this)}function Z(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;){--this.t}}function K(e){if(this.s<0)return"-"+this.negate().toString(e);if(e==16)e=4;else if(e==8)e=3;else if(e==2)e=1;else if(e==32)e=5;else if(e==64)e=6;else if(e==4)e=2;else return this.toRadix(e);var t=(1<<e)-1,n,i=!1,r="",o=this.t,s=this.DB-o*this.DB%e;if(o-- >0){if(s<this.DB&&(n=this[o]>>s)>0)i=!0,r=l(n);for(;o>=0;){s<e?(n=(this[o]&(1<<s)-1)<<e-s,n|=this[--o]>>(s+=this.DB-e)):(n=this[o]>>(s-=e)&t,s<=0&&(s+=this.DB,--o)),n>0&&(i=!0),i&&(r+=l(n))}}return i?r:"0"}function $(){var e=y();m.ZERO.subTo(this,e);return e}function Q(){return this.s<0?this.negate():this}function ee(e){var t=this.s-e.s;if(t!=0)return t;var n=this.t,t=n-e.t;if(t!=0)return t;for(;--n>=0;){if((t=this[n]-e[n])!=0)return t}return 0}function g(e){var t=1,n;if((n=e>>>16)!=0)e=n,t+=16;if((n=e>>8)!=0)e=n,t+=8;if((n=e>>4)!=0)e=n,t+=4;if((n=e>>2)!=0)e=n,t+=2;e>>1!=0&&(t+=1);return t}function te(){return this.t<=0?0:this.DB*(this.t-1)+g(this[this.t-1]^this.s&this.DM)}function ne(e,t){var n;for(n=this.t-1;n>=0;--n){t[n+e]=this[n]}for(n=e-1;n>=0;--n){t[n]=0}t.t=this.t+e;t.s=this.s}function ie(e,t){for(var n=e;n<this.t;++n){t[n-e]=this[n]}t.t=Math.max(this.t-e,0);t.s=this.s}function re(e,t){var n=e%this.DB,i=this.DB-n,r=(1<<i)-1,o=Math.floor(e/this.DB),s=this.s<<n&this.DM,a;for(a=this.t-1;a>=0;--a){t[a+o+1]=this[a]>>i|s,s=(this[a]&r)<<n}for(a=o-1;a>=0;--a){t[a]=0}t[o]=s;t.t=this.t+o+1;t.s=this.s;t.clamp()}function oe(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var i=e%this.DB,r=this.DB-i,o=(1<<i)-1;t[0]=this[n]>>i;for(var s=n+1;s<this.t;++s){t[s-n-1]|=(this[s]&o)<<r,t[s-n]=this[s]>>i}i>0&&(t[this.t-n-1]|=(this.s&o)<<r);t.t=this.t-n;t.clamp()}}function se(e,t){for(var n=0,i=0,r=Math.min(e.t,this.t);n<r;){i+=this[n]-e[n],t[n++]=i&this.DM,i>>=this.DB}if(e.t<this.t){for(i-=e.s;n<this.t;){i+=this[n],t[n++]=i&this.DM,i>>=this.DB}i+=this.s}else{for(i+=this.s;n<e.t;){i-=e[n],t[n++]=i&this.DM,i>>=this.DB}i-=e.s}t.s=i<0?-1:0;i<-1?t[n++]=this.DV+i:i>0&&(t[n++]=i);t.t=n;t.clamp()}function ae(e,t){var n=this.abs(),i=e.abs(),r=n.t;for(t.t=r+i.t;--r>=0;){t[r]=0}for(r=0;r<i.t;++r){t[r+n.t]=n.am(0,i[r],t,r,0,n.t)}t.s=0;t.clamp();this.s!=e.s&&m.ZERO.subTo(t,t)}function ue(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;){e[n]=0}for(n=0;n<t.t-1;++n){var i=t.am(n,t[n],e,2*n,0,1);if((e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,i,t.t-n-1))>=t.DV)e[n+t.t]-=t.DV,e[n+t.t+1]=1}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1));e.s=0;e.clamp()}function le(e,t,n){var i=e.abs();if(!(i.t<=0)){var r=this.abs();if(r.t<i.t)t!=null&&t.fromInt(0),n!=null&&this.copyTo(n);else{n==null&&(n=y());var o=y(),s=this.s,e=e.s,a=this.DB-g(i[i.t-1]);a>0?(i.lShiftTo(a,o),r.lShiftTo(a,n)):(i.copyTo(o),r.copyTo(n));i=o.t;r=o[i-1];if(r!=0){var u=r*(1<<this.F1)+(i>1?o[i-2]>>this.F2:0),l=this.FV/u,u=(1<<this.F1)/u,f=1<<this.F2,c=n.t,h=c-i,d=t==null?y():t;o.dlShiftTo(h,d);n.compareTo(d)>=0&&(n[n.t++]=1,n.subTo(d,n));m.ONE.dlShiftTo(i,d);for(d.subTo(o,o);o.t<i;){o[o.t++]=0}for(;--h>=0;){var p=n[--c]==r?this.DM:Math.floor(n[c]*l+(n[c-1]+f)*u);if((n[c]+=o.am(0,p,n,h,0,i))<p){o.dlShiftTo(h,d);for(n.subTo(d,n);n[c]<--p;){n.subTo(d,n)}}}t!=null&&(n.drShiftTo(i,t),s!=e&&m.ZERO.subTo(t,t));n.t=i;n.clamp();a>0&&n.rShiftTo(a,n);s<0&&m.ZERO.subTo(n,n)}}}}function fe(e){var t=y();this.abs().divRemTo(e,null,t);this.s<0&&t.compareTo(m.ZERO)>0&&e.subTo(t,t);return t}function P(e){this.m=e}function ce(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function he(e){return e}function de(e){e.divRemTo(this.m,null,e)}function pe(e,t,n){e.multiplyTo(t,n);this.reduce(n)}function ve(e,t){e.squareTo(t);this.reduce(t)}P.prototype.convert=ce;P.prototype.revert=he;P.prototype.reduce=de;P.prototype.mulTo=pe;P.prototype.sqrTo=ve;function me(){if(this.t<1)return 0;var e=this[0];if((e&1)==0)return 0;var t=e&3,t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV;return t>0?this.DV-t:-t}function w(e){this.m=e;this.mp=e.invDigit();this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<<e.DB-15)-1;this.mt2=2*e.t}function ye(e){var t=y();e.abs().dlShiftTo(this.m.t,t);t.divRemTo(this.m,null,t);e.s<0&&t.compareTo(m.ZERO)>0&&this.m.subTo(t,t);return t}function ge(e){var t=y();e.copyTo(t);this.reduce(t);return t}function Pe(e){for(;e.t<=this.mt2;){e[e.t++]=0}for(var t=0;t<this.m.t;++t){var n=e[t]&32767,i=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM,n=t+this.m.t;for(e[n]+=this.m.am(0,i,e,t,0,this.m.t);e[n]>=e.DV;){e[n]-=e.DV,e[++n]++}}e.clamp();e.drShiftTo(this.m.t,e);e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function we(e,t){e.squareTo(t);this.reduce(t)}function Se(e,t,n){e.multiplyTo(t,n);this.reduce(n)}w.prototype.convert=ye;w.prototype.revert=ge;w.prototype.reduce=Pe;w.prototype.mulTo=Se;w.prototype.sqrTo=we;function _e(){return(this.t>0?this[0]&1:this.s)==0}function be(e,t){if(e>4294967295||e<1)return m.ONE;var n=y(),i=y(),r=t.convert(this),o=g(e)-1;for(r.copyTo(n);--o>=0;){if(t.sqrTo(n,i),(e&1<<o)>0)t.mulTo(i,r,n);else var s=n,n=i,i=s}return t.revert(n)}function Ce(e,t){var n;n=e<256||t.isEven()?new P(t):new w(t);return this.exp(e,n)}m.prototype.copyTo=V;m.prototype.fromInt=Y;m.prototype.fromString=X;m.prototype.clamp=Z;m.prototype.dlShiftTo=ne;m.prototype.drShiftTo=ie;m.prototype.lShiftTo=re;m.prototype.rShiftTo=oe;m.prototype.subTo=se;m.prototype.multiplyTo=ae;m.prototype.squareTo=ue;m.prototype.divRemTo=le;m.prototype.invDigit=me;m.prototype.isEven=_e;m.prototype.exp=be;m.prototype.toString=K;m.prototype.negate=$;m.prototype.abs=Q;m.prototype.compareTo=ee;m.prototype.bitLength=te;m.prototype.mod=fe;m.prototype.modPowInt=Ce;m.ZERO=p(0);m.ONE=p(1);function ke(){var e=y();this.copyTo(e);return e}function Te(){if(this.s<0){if(this.t==1)return this[0]-this.DV;else{if(this.t==0)return-1}}else if(this.t==1)return this[0];else if(this.t==0)return 0;return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function Re(){return this.t==0?this.s:this[0]<<24>>24}function De(){return this.t==0?this.s:this[0]<<16>>16}function xe(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function Ie(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function Ee(e){e==null&&(e=10);if(this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),t=Math.pow(e,t),n=p(t),i=y(),r=y(),o="";for(this.divRemTo(n,i,r);i.signum()>0;){o=(t+r.intValue()).toString(e).substr(1)+o,i.divRemTo(n,i,r)}return r.intValue().toString(e)+o}function qe(e,t){this.fromInt(0);t==null&&(t=10);for(var n=this.chunkSize(t),i=Math.pow(t,n),r=!1,o=0,s=0,a=0;a<e.length;++a){var u=f(e,a);u<0?e.charAt(a)=="-"&&this.signum()==0&&(r=!0):(s=t*s+u,++o>=n&&(this.dMultiply(i),this.dAddOffset(s,0),s=o=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(s,0));r&&m.ZERO.subTo(this,this)}function Ae(e,t,n){if("number"==typeof t){if(e<2)this.fromInt(1);else{this.fromNumber(e,n);this.testBit(e-1)||this.bitwiseTo(m.ONE.shiftLeft(e-1),u,this);for(this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);){this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(m.ONE.shiftLeft(e-1),this)}}}else{var n=[],i=e&7;n.length=(e>>3)+1;t.nextBytes(n);i>0?n[0]&=(1<<i)-1:n[0]=0;this.fromString(n,256)}}function Oe(){var e=this.t,t=[];t[0]=this.s;var n=this.DB-e*this.DB%8,i,r=0;if(e-- >0){if(n<this.DB&&(i=this[e]>>n)!=(this.s&this.DM)>>n)t[r++]=i|this.s<<this.DB-n;for(;e>=0;){if(n<8?(i=(this[e]&(1<<n)-1)<<8-n,i|=this[--e]>>(n+=this.DB-8)):(i=this[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),(i&128)!=0&&(i|=-256),r==0&&(this.s&128)!=(i&128)&&++r,r>0||i!=this.s)t[r++]=i}}return t}function Me(e){return this.compareTo(e)==0}function Le(e){return this.compareTo(e)<0?this:e}function Fe(e){return this.compareTo(e)>0?this:e}function We(e,t,n){var i,r,o=Math.min(e.t,this.t);for(i=0;i<o;++i){n[i]=t(this[i],e[i])}if(e.t<this.t){r=e.s&this.DM;for(i=o;i<this.t;++i){n[i]=t(this[i],r)}n.t=this.t}else{r=this.s&this.DM;for(i=o;i<e.t;++i){n[i]=t(r,e[i])}n.t=e.t}n.s=t(this.s,e.s);n.clamp()}function Ne(e,t){return e&t}function Be(e){var t=y();this.bitwiseTo(e,Ne,t);return t}function u(e,t){return e|t}function ze(e){var t=y();this.bitwiseTo(e,u,t);return t}function c(e,t){return e^t}function Je(e){var t=y();this.bitwiseTo(e,c,t);return t}function h(e,t){return e&~t}function He(e){var t=y();this.bitwiseTo(e,h,t);return t}function Ue(){for(var e=y(),t=0;t<this.t;++t){e[t]=this.DM&~this[t]}e.t=this.t;e.s=~this.s;return e}function je(e){var t=y();e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t);return t}function Ge(e){var t=y();e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t);return t}function Ve(e){if(e==0)return-1;var t=0;(e&65535)==0&&(e>>=16,t+=16);(e&255)==0&&(e>>=8,t+=8);(e&15)==0&&(e>>=4,t+=4);(e&3)==0&&(e>>=2,t+=2);(e&1)==0&&++t;return t}function Ye(){for(var e=0;e<this.t;++e){if(this[e]!=0)return e*this.DB+Ve(this[e])}return this.s<0?this.t*this.DB:-1}function Xe(e){for(var t=0;e!=0;){e&=e-1,++t}return t}function Ze(){for(var e=0,t=this.s&this.DM,n=0;n<this.t;++n){e+=Xe(this[n]^t)}return e}function Ke(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<e%this.DB)!=0}function $e(e,t){var n=m.ONE.shiftLeft(e);this.bitwiseTo(n,t,n);return n}function Qe(e){return this.changeBit(e,u)}function et(e){return this.changeBit(e,h)}function tt(e){return this.changeBit(e,c)}function nt(e,t){for(var n=0,i=0,r=Math.min(e.t,this.t);n<r;){i+=this[n]+e[n],t[n++]=i&this.DM,i>>=this.DB}if(e.t<this.t){for(i+=e.s;n<this.t;){i+=this[n],t[n++]=i&this.DM,i>>=this.DB}i+=this.s}else{for(i+=this.s;n<e.t;){i+=e[n],t[n++]=i&this.DM,i>>=this.DB}i+=e.s}t.s=i<0?-1:0;i>0?t[n++]=i:i<-1&&(t[n++]=this.DV+i);t.t=n;t.clamp()}function it(e){var t=y();this.addTo(e,t);return t}function rt(e){var t=y();this.subTo(e,t);return t}function ot(e){var t=y();this.multiplyTo(e,t);return t}function st(){var e=y();this.squareTo(e);return e}function at(e){var t=y();this.divRemTo(e,t,null);return t}function ut(e){var t=y();this.divRemTo(e,null,t);return t}function lt(e){var t=y(),n=y();this.divRemTo(e,t,n);return[t,n]}function ft(e){this[this.t]=this.am(0,e-1,this,0,0,this.t);++this.t;this.clamp()}function ct(e,t){if(e!=0){for(;this.t<=t;){this[this.t++]=0}for(this[t]+=e;this[t]>=this.DV;){this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}}function d(){}function S(e){return e}function ht(e,t,n){e.multiplyTo(t,n)}function dt(e,t){e.squareTo(t)}d.prototype.convert=S;d.prototype.revert=S;d.prototype.mulTo=ht;d.prototype.sqrTo=dt;function pt(e){return this.exp(e,new d)}function vt(e,t,n){var i=Math.min(this.t+e.t,t);n.s=0;for(n.t=i;i>0;){n[--i]=0}var r;for(r=n.t-this.t;i<r;++i){n[i+this.t]=this.am(0,e[i],n,i,0,this.t)}for(r=Math.min(e.t,t);i<r;++i){this.am(0,e[i],n,i,0,t-i)}n.clamp()}function mt(e,t,n){--t;var i=n.t=this.t+e.t-t;for(n.s=0;--i>=0;){n[i]=0}for(i=Math.max(t-this.t,0);i<e.t;++i){n[this.t+i-t]=this.am(t-i,e[i],n,0,0,this.t+i-t)}n.clamp();n.drShiftTo(1,n)}function _(e){this.r2=y();this.q3=y();m.ONE.dlShiftTo(2*e.t,this.r2);this.mu=this.r2.divide(e);this.m=e}function yt(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);else if(e.compareTo(this.m)<0)return e;else{var t=y();e.copyTo(t);this.reduce(t);return t}}function gt(e){return e}function Pt(e){e.drShiftTo(this.m.t-1,this.r2);if(e.t>this.m.t+1)e.t=this.m.t+1,e.clamp();this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);for(this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;){e.dAddOffset(1,this.m.t+1)}for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;){e.subTo(this.m,e)}}function wt(e,t){e.squareTo(t);this.reduce(t)}function St(e,t,n){e.multiplyTo(t,n);this.reduce(n)}_.prototype.convert=yt;_.prototype.revert=gt;_.prototype.reduce=Pt;_.prototype.mulTo=St;_.prototype.sqrTo=wt;function _t(e,t){var n=e.bitLength(),i,r=p(1),o;if(n<=0)return r;else i=n<18?1:n<48?3:n<144?4:n<768?5:6;o=n<8?new P(t):t.isEven()?new _(t):new w(t);var s=[],a=3,u=i-1,l=(1<<i)-1;s[1]=o.convert(this);if(i>1){n=y();for(o.sqrTo(s[1],n);a<=l;){s[a]=y(),o.mulTo(n,s[a-2],s[a]),a+=2}}for(var f=e.t-1,c,h=!0,d=y(),n=g(e[f])-1;f>=0;){n>=u?c=e[f]>>n-u&l:(c=(e[f]&(1<<n+1)-1)<<u-n,f>0&&(c|=e[f-1]>>this.DB+n-u));for(a=i;(c&1)==0;){c>>=1,--a}if((n-=a)<0)n+=this.DB,--f;if(h)s[c].copyTo(r),h=!1;else{for(;a>1;){o.sqrTo(r,d),o.sqrTo(d,r),a-=2}a>0?o.sqrTo(r,d):(a=r,r=d,d=a);o.mulTo(d,s[c],r)}for(;f>=0&&(e[f]&1<<n)==0;){o.sqrTo(r,d),a=r,r=d,d=a,--n<0&&(n=this.DB-1,--f)}}return o.revert(r)}function bt(e){var t=this.s<0?this.negate():this.clone(),e=e.s<0?e.negate():e.clone();if(t.compareTo(e)<0)var n=t,t=e,e=n;var n=t.getLowestSetBit(),i=e.getLowestSetBit();if(i<0)return t;n<i&&(i=n);i>0&&(t.rShiftTo(i,t),e.rShiftTo(i,e));for(;t.signum()>0;){(n=t.getLowestSetBit())>0&&t.rShiftTo(n,t),(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),t.compareTo(e)>=0?(t.subTo(e,t),t.rShiftTo(1,t)):(e.subTo(t,e),e.rShiftTo(1,e))}i>0&&e.lShiftTo(i,e);return e}function Ct(e){if(e<=0)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(t==0)n=this[0]%e;else for(var i=this.t-1;i>=0;--i){n=(t*n+this[i])%e}return n}function kt(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return m.ZERO;for(var n=e.clone(),i=this.clone(),r=p(1),o=p(0),s=p(0),a=p(1);n.signum()!=0;){for(;n.isEven();){n.rShiftTo(1,n);if(t){if(!r.isEven()||!o.isEven())r.addTo(this,r),o.subTo(e,o);r.rShiftTo(1,r)}else o.isEven()||o.subTo(e,o);o.rShiftTo(1,o)}for(;i.isEven();){i.rShiftTo(1,i);if(t){if(!s.isEven()||!a.isEven())s.addTo(this,s),a.subTo(e,a);s.rShiftTo(1,s)}else a.isEven()||a.subTo(e,a);a.rShiftTo(1,a)}n.compareTo(i)>=0?(n.subTo(i,n),t&&r.subTo(s,r),o.subTo(a,o)):(i.subTo(n,i),t&&s.subTo(r,s),a.subTo(o,a))}if(i.compareTo(m.ONE)!=0)return m.ZERO;if(a.compareTo(e)>=0)return a.subtract(e);if(a.signum()<0)a.addTo(e,a);else return a;return a.signum()<0?a.add(e):a}var b=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Tt=67108864/b[b.length-1];function Rt(e){var t,n=this.abs();if(n.t==1&&n[0]<=b[b.length-1]){for(t=0;t<b.length;++t){if(n[0]==b[t])return!0}return!1}if(n.isEven())return!1;for(t=1;t<b.length;){for(var i=b[t],r=t+1;r<b.length&&i<Tt;){i*=b[r++]}for(i=n.modInt(i);t<r;){if(i%b[t++]==0)return!1}}return n.millerRabin(e)}function Dt(e){var t=this.subtract(m.ONE),n=t.getLowestSetBit();if(n<=0)return!1;var i=t.shiftRight(n),e=e+1>>1;if(e>b.length)e=b.length;for(var r=y(),o=0;o<e;++o){r.fromInt(b[Math.floor(Math.random()*b.length)]);var s=r.modPow(i,this);if(s.compareTo(m.ONE)!=0&&s.compareTo(t)!=0){for(var a=1;a++<n&&s.compareTo(t)!=0;){if(s=s.modPowInt(2,this),s.compareTo(m.ONE)==0)return!1}if(s.compareTo(t)!=0)return!1}}return!0}m.prototype.chunkSize=xe;m.prototype.toRadix=Ee;m.prototype.fromRadix=qe;m.prototype.fromNumber=Ae;m.prototype.bitwiseTo=We;m.prototype.changeBit=$e;m.prototype.addTo=nt;m.prototype.dMultiply=ft;m.prototype.dAddOffset=ct;m.prototype.multiplyLowerTo=vt;m.prototype.multiplyUpperTo=mt;m.prototype.modInt=Ct;m.prototype.millerRabin=Dt;m.prototype.clone=ke;m.prototype.intValue=Te;m.prototype.byteValue=Re;m.prototype.shortValue=De;m.prototype.signum=Ie;m.prototype.toByteArray=Oe;m.prototype.equals=Me;m.prototype.min=Le;m.prototype.max=Fe;m.prototype.and=Be;m.prototype.or=ze;m.prototype.xor=Je;m.prototype.andNot=He;m.prototype.not=Ue;m.prototype.shiftLeft=je;m.prototype.shiftRight=Ge;m.prototype.getLowestSetBit=Ye;m.prototype.bitCount=Ze;m.prototype.testBit=Ke;m.prototype.setBit=Qe;m.prototype.clearBit=et;m.prototype.flipBit=tt;m.prototype.add=it;m.prototype.subtract=rt;m.prototype.multiply=ot;m.prototype.divide=at;m.prototype.remainder=ut;m.prototype.divideAndRemainder=lt;m.prototype.modPow=_t;m.prototype.modInverse=kt;m.prototype.pow=pt;m.prototype.gcd=bt;m.prototype.isProbablePrime=Rt;m.prototype.square=st;(function(r,o,u,s,a,l,f){function c(e){var t,n,a=this,i=e.length,r=0,o=a.i=a.j=a.m=0;a.S=[];a.c=[];for(i||(e=[i++]);r<u;){a.S[r]=r++}for(r=0;r<u;r++){t=a.S[r],o=o+t+e[r%i]&u-1,n=a.S[o],a.S[r]=n,a.S[o]=t}a.g=function(e){var t=a.S,n=a.i+1&u-1,i=t[n],r=a.j+i&u-1,o=t[r];t[n]=o;t[r]=i;for(var s=t[i+o&u-1];--e;){n=n+1&u-1,i=t[n],r=r+i&u-1,o=t[r],t[n]=o,t[r]=i,s=s*u+t[i+o&u-1]}a.i=n;a.j=r;return s};a.g(u)}function h(e,t,n,i,r){n=[];r=typeof e==="undefined"?"undefined":z(e);if(t&&r=="object")for(i in e){if(i.indexOf("S")<5)try{n.push(h(e[i],t-1))}catch(l){}}return n.length?n:e+(r!="string"?"\0":"")}function d(e,t,n,i){e+="";for(i=n=0;i<e.length;i++){var r=t,o=i&u-1,s=(n^=t[i&u-1]*19)+e.charCodeAt(i);r[o]=s&u-1}e="";for(i in t){e+=String.fromCharCode(t[i])}return e}o.seedrandom=function(e,t){var n=[],i,e=d(h(t?[e,r]:arguments.length?e:[(new Date).getTime(),r,window],3),n);i=new c(n);d(i.S,r);o.random=function(){for(var e=i.g(s),t=f,n=0;e<a;){e=(e+n)*u,t*=u,n=i.g(1)}for(;e>=l;){e/=2,t/=2,n>>>=1}return(e+n)/t};return e};f=o.pow(u,s);a=o.pow(2,a);l=a*2;d(o.random(),r)})([],Math,256,6,52);function C(){}function xt(e){var t;for(t=0;t<e.length;t++){e[t]=Math.floor(Math.random()*256)}}C.prototype.nextBytes=xt;function k(){this.j=this.i=0;this.S=[]}function It(e){var t,n,i;for(t=0;t<256;++t){this.S[t]=t}for(t=n=0;t<256;++t){n=n+this.S[t]+e[t%e.length]&255,i=this.S[t],this.S[t]=this.S[n],this.S[n]=i}this.j=this.i=0}function Et(){var e;this.i=this.i+1&255;this.j=this.j+this.S[this.i]&255;e=this.S[this.i];this.S[this.i]=this.S[this.j];this.S[this.j]=e;return this.S[e+this.S[this.i]&255]}k.prototype.init=It;k.prototype.next=Et;function qt(){return new k}var T=256,R,D,x;function At(e){D[x++]^=e&255;D[x++]^=e>>8&255;D[x++]^=e>>16&255;D[x++]^=e>>24&255;x>=T&&(x-=T)}function Ot(){At((new Date).getTime())}if(D==null){D=[];x=0;var I;if(e.appName=="Netscape"&&e.appVersion<"5"&&window.crypto){var Mt=window.crypto.random(32);for(I=0;I<Mt.length;++I){D[x++]=Mt.charCodeAt(I)&255}}for(;x<T;){I=Math.floor(65536*Math.random()),D[x++]=I>>>8,D[x++]=I&255}x=0;Ot()}function Lt(){if(R==null){Ot();R=qt();R.init(D);for(x=0;x<D.length;++x){D[x]=0}x=0}return R.next()}function Ft(e){var t;for(t=0;t<e.length;++t){e[t]=Lt()}}function E(){}E.prototype.nextBytes=Ft;function Wt(e){function y(e,t){var n=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(n>>16)<<16|n&65535}function g(e,t){return e>>>t|e<<32-t}e=function(e){for(var e=e.replace(/\r\n/g,"\n"),t="",n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t+=String.fromCharCode(i):(i>127&&i<2048?t+=String.fromCharCode(i>>6|192):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128)),t+=String.fromCharCode(i&63|128))}return t}(e);return function(e){for(var t="",n=0;n<e.length*4;n++){t+="0123456789abcdef".charAt(e[n>>2]>>(3-n%4)*8+4&15)+"0123456789abcdef".charAt(e[n>>2]>>(3-n%4)*8&15)}return t}(function(e,t){var n=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],i=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],r=Array(64),o,s,a,u,l,f,c,h,d,p,v,m;e[t>>5]|=128<<24-t%32;e[(t+64>>9<<4)+15]=t;for(d=0;d<e.length;d+=16){o=i[0];s=i[1];a=i[2];u=i[3];l=i[4];f=i[5];c=i[6];h=i[7];for(p=0;p<64;p++){r[p]=p<16?e[p+d]:y(y(y(g(r[p-2],17)^g(r[p-2],19)^r[p-2]>>>10,r[p-7]),g(r[p-15],7)^g(r[p-15],18)^r[p-15]>>>3),r[p-16]),v=y(y(y(y(h,g(l,6)^g(l,11)^g(l,25)),l&f^~l&c),n[p]),r[p]),m=y(g(o,2)^g(o,13)^g(o,22),o&s^o&a^s&a),h=c,c=f,f=l,l=y(u,v),u=a,a=s,s=o,o=y(v,m)}i[0]=y(o,i[0]);i[1]=y(s,i[1]);i[2]=y(a,i[2]);i[3]=y(u,i[3]);i[4]=y(l,i[4]);i[5]=y(f,i[5]);i[6]=y(c,i[6]);i[7]=y(h,i[7])}return i}(function(e){for(var t=[],n=0;n<e.length*8;n+=8){t[n>>5]|=(e.charCodeAt(n/8)&255)<<24-n%32}return t}(e),e.length*8))}var Nt={hex:function hn(e){return Wt(e)}};function Bt(e){function t(e,t){return e<<t|e>>>32-t}function n(e){var t="",n,i;for(n=7;n>=0;n--){i=e>>>n*4&15,t+=i.toString(16)}return t}var i,r,o=Array(80),s=1732584193,a=4023233417,u=2562383102,l=271733878,f=3285377520,c,h,d,p,v,e=function(e){for(var e=e.replace(/\r\n/g,"\n"),t="",n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t+=String.fromCharCode(i):(i>127&&i<2048?t+=String.fromCharCode(i>>6|192):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128)),t+=String.fromCharCode(i&63|128))}return t}(e);c=e.length;var m=[];for(i=0;i<c-3;i+=4){r=e.charCodeAt(i)<<24|e.charCodeAt(i+1)<<16|e.charCodeAt(i+2)<<8|e.charCodeAt(i+3),m.push(r)}switch(c%4){case 0:i=2147483648;break;case 1:i=e.charCodeAt(c-1)<<24|8388608;break;case 2:i=e.charCodeAt(c-2)<<24|e.charCodeAt(c-1)<<16|32768;break;case 3:i=e.charCodeAt(c-3)<<24|e.charCodeAt(c-2)<<16|e.charCodeAt(c-1)<<8|128}for(m.push(i);m.length%16!=14;){m.push(0)}m.push(c>>>29);m.push(c<<3&4294967295);for(e=0;e<m.length;e+=16){for(i=0;i<16;i++){o[i]=m[e+i]}for(i=16;i<=79;i++){o[i]=t(o[i-3]^o[i-8]^o[i-14]^o[i-16],1)}r=s;c=a;h=u;d=l;p=f;for(i=0;i<=19;i++){v=t(r,5)+(c&h|~c&d)+p+o[i]+1518500249&4294967295,p=d,d=h,h=t(c,30),c=r,r=v}for(i=20;i<=39;i++){v=t(r,5)+(c^h^d)+p+o[i]+1859775393&4294967295,p=d,d=h,h=t(c,30),c=r,r=v}for(i=40;i<=59;i++){v=t(r,5)+(c&h|c&d|h&d)+p+o[i]+2400959708&4294967295,p=d,d=h,h=t(c,30),c=r,r=v}for(i=60;i<=79;i++){v=t(r,5)+(c^h^d)+p+o[i]+3395469782&4294967295,p=d,d=h,h=t(c,30),c=r,r=v}s=s+r&4294967295;a=a+c&4294967295;u=u+h&4294967295;l=l+d&4294967295;f=f+p&4294967295}v=n(s)+n(a)+n(u)+n(l)+n(f);return v.toLowerCase()}var zt={hex:function hn(e){return Bt(e)}},Jt=function Jt(e){function a(e,t){var n,i,r,o,s;r=e&2147483648;o=t&2147483648;n=e&1073741824;i=t&1073741824;s=(e&1073741823)+(t&1073741823);return n&i?s^2147483648^r^o:n|i?s&1073741824?s^3221225472^r^o:s^1073741824^r^o:s^r^o}function t(e,t,n,i,r,o,s){e=a(e,a(a(t&n|~t&i,r),s));return a(e<<o|e>>>32-o,t)}function n(e,t,n,i,r,o,s){e=a(e,a(a(t&i|n&~i,r),s));return a(e<<o|e>>>32-o,t)}function i(e,t,n,i,r,o,s){e=a(e,a(a(t^n^i,r),s));return a(e<<o|e>>>32-o,t)}function r(e,t,n,i,r,o,s){e=a(e,a(a(n^(t|~i),r),s));return a(e<<o|e>>>32-o,t)}function o(e){var t="",n="",i;for(i=0;i<=3;i++){n=e>>>i*8&255,n="0"+n.toString(16),t+=n.substr(n.length-2,2)}return t}var s=[],u,l,f,c,h,d,p,v,e=function(e){for(var e=e.replace(/\r\n/g,"\n"),t="",n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t+=String.fromCharCode(i):(i>127&&i<2048?t+=String.fromCharCode(i>>6|192):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128)),t+=String.fromCharCode(i&63|128))}return t}(e),s=function(e){var t,n=e.length;t=n+8;for(var i=((t-t%64)/64+1)*16,r=Array(i-1),o=0,s=0;s<n;){t=(s-s%4)/4,o=s%4*8,r[t]|=e.charCodeAt(s)<<o,s++}r[(s-s%4)/4]|=128<<s%4*8;r[i-2]=n<<3;r[i-1]=n>>>29;return r}(e);h=1732584193;d=4023233417;p=2562383102;v=271733878;for(e=0;e<s.length;e+=16){u=h,l=d,f=p,c=v,h=t(h,d,p,v,s[e+0],7,3614090360),v=t(v,h,d,p,s[e+1],12,3905402710),p=t(p,v,h,d,s[e+2],17,606105819),d=t(d,p,v,h,s[e+3],22,3250441966),h=t(h,d,p,v,s[e+4],7,4118548399),v=t(v,h,d,p,s[e+5],12,1200080426),p=t(p,v,h,d,s[e+6],17,2821735955),d=t(d,p,v,h,s[e+7],22,4249261313),h=t(h,d,p,v,s[e+8],7,1770035416),v=t(v,h,d,p,s[e+9],12,2336552879),p=t(p,v,h,d,s[e+10],17,4294925233),d=t(d,p,v,h,s[e+11],22,2304563134),h=t(h,d,p,v,s[e+12],7,1804603682),v=t(v,h,d,p,s[e+13],12,4254626195),p=t(p,v,h,d,s[e+14],17,2792965006),d=t(d,p,v,h,s[e+15],22,1236535329),h=n(h,d,p,v,s[e+1],5,4129170786),v=n(v,h,d,p,s[e+6],9,3225465664),p=n(p,v,h,d,s[e+11],14,643717713),d=n(d,p,v,h,s[e+0],20,3921069994),h=n(h,d,p,v,s[e+5],5,3593408605),v=n(v,h,d,p,s[e+10],9,38016083),p=n(p,v,h,d,s[e+15],14,3634488961),d=n(d,p,v,h,s[e+4],20,3889429448),h=n(h,d,p,v,s[e+9],5,568446438),v=n(v,h,d,p,s[e+14],9,3275163606),p=n(p,v,h,d,s[e+3],14,4107603335),d=n(d,p,v,h,s[e+8],20,1163531501),h=n(h,d,p,v,s[e+13],5,2850285829),v=n(v,h,d,p,s[e+2],9,4243563512),p=n(p,v,h,d,s[e+7],14,1735328473),d=n(d,p,v,h,s[e+12],20,2368359562),h=i(h,d,p,v,s[e+5],4,4294588738),v=i(v,h,d,p,s[e+8],11,2272392833),p=i(p,v,h,d,s[e+11],16,1839030562),d=i(d,p,v,h,s[e+14],23,4259657740),h=i(h,d,p,v,s[e+1],4,2763975236),v=i(v,h,d,p,s[e+4],11,1272893353),p=i(p,v,h,d,s[e+7],16,4139469664),d=i(d,p,v,h,s[e+10],23,3200236656),h=i(h,d,p,v,s[e+13],4,681279174),v=i(v,h,d,p,s[e+0],11,3936430074),p=i(p,v,h,d,s[e+3],16,3572445317),d=i(d,p,v,h,s[e+6],23,76029189),h=i(h,d,p,v,s[e+9],4,3654602809),v=i(v,h,d,p,s[e+12],11,3873151461),p=i(p,v,h,d,s[e+15],16,530742520),d=i(d,p,v,h,s[e+2],23,3299628645),h=r(h,d,p,v,s[e+0],6,4096336452),v=r(v,h,d,p,s[e+7],10,1126891415),p=r(p,v,h,d,s[e+14],15,2878612391),d=r(d,p,v,h,s[e+5],21,4237533241),h=r(h,d,p,v,s[e+12],6,1700485571),v=r(v,h,d,p,s[e+3],10,2399980690),p=r(p,v,h,d,s[e+10],15,4293915773),d=r(d,p,v,h,s[e+1],21,2240044497),h=r(h,d,p,v,s[e+8],6,1873313359),v=r(v,h,d,p,s[e+15],10,4264355552),p=r(p,v,h,d,s[e+6],15,2734768916),d=r(d,p,v,h,s[e+13],21,1309151649),h=r(h,d,p,v,s[e+4],6,4149444226),v=r(v,h,d,p,s[e+11],10,3174756917),p=r(p,v,h,d,s[e+2],15,718787259),d=r(d,p,v,h,s[e+9],21,3951481745),h=a(h,u),d=a(d,l),p=a(p,f),v=a(v,c)}return(o(h)+o(d)+o(p)+o(v)).toLowerCase()};function q(e,t){return new m(e,t)}function Ht(e,t){for(var n="",i=0;i+t<e.length;){n+=e.substring(i,i+t)+"\n",i+=t}return n+e.substring(i,e.length)}function Ut(e){return e<16?"0"+e.toString(16):e.toString(16)}function jt(e,t){if(t<e.length+11)throw"Message too long for RSA (n="+t+", l="+e.length+")";for(var n=[],i=e.length-1;i>=0&&t>0;){var r=e.charCodeAt(i--);r<128?n[--t]=r:r>127&&r<2048?(n[--t]=r&63|128,n[--t]=r>>6|192):(n[--t]=r&63|128,n[--t]=r>>6&63|128,n[--t]=r>>12|224)}n[--t]=0;i=new E;for(r=[];t>2;){for(r[0]=0;r[0]==0;){i.nextBytes(r)}n[--t]=r[0]}n[--t]=2;n[--t]=0;return new m(n)}function A(){this.n=null;this.e=0;this.coeff=this.dmq1=this.dmp1=this.q=this.p=this.d=null}function Gt(e,t){e!=null&&t!=null&&e.length>0&&t.length>0?(this.n=q(e,16),this.e=parseInt(t,16)):alert("Invalid RSA public key")}function Vt(e){return e.modPowInt(this.e,this.n)}function Yt(e){e=jt(e,this.n.bitLength()+7>>3);if(e==null)return null;e=this.doPublic(e);if(e==null)return null;e=e.toString(16);return(e.length&1)==0?e:"0"+e}A.prototype.doPublic=Vt;A.prototype.setPublic=Gt;A.prototype.encrypt=Yt;function Xt(e,t){for(var n=e.toByteArray(),i=0;i<n.length&&n[i]==0;){++i}if(n.length-i!=t-1||n[i]!=2)return null;for(++i;n[i]!=0;){if(++i>=n.length)return null}for(var r="";++i<n.length;){var o=n[i]&255;o<128?r+=String.fromCharCode(o):o>191&&o<224?(r+=String.fromCharCode((o&31)<<6|n[i+1]&63),++i):(r+=String.fromCharCode((o&15)<<12|(n[i+1]&63)<<6|n[i+2]&63),i+=2)}return r}function Zt(e,t,n){e!=null&&t!=null&&e.length>0&&t.length>0?(this.n=q(e,16),this.e=parseInt(t,16),this.d=q(n,16)):alert("Invalid RSA private key")}function Kt(e,t,n,i,r,o,s,a){e!=null&&t!=null&&e.length>0&&t.length>0?(this.n=q(e,16),this.e=parseInt(t,16),this.d=q(n,16),this.p=q(i,16),this.q=q(r,16),this.dmp1=q(o,16),this.dmq1=q(s,16),this.coeff=q(a,16)):alert("Invalid RSA private key")}function $t(e,t){var n=new C,i=e>>1;this.e=parseInt(t,16);for(var r=new m(t,16);;){for(;;){if(this.p=new m(e-i,1,n),this.p.subtract(m.ONE).gcd(r).compareTo(m.ONE)==0&&this.p.isProbablePrime(10))break}for(;;){if(this.q=new m(i,1,n),this.q.subtract(m.ONE).gcd(r).compareTo(m.ONE)==0&&this.q.isProbablePrime(10))break}if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q;this.q=o}var o=this.p.subtract(m.ONE),s=this.q.subtract(m.ONE),a=o.multiply(s);if(a.gcd(r).compareTo(m.ONE)==0){this.n=this.p.multiply(this.q);this.d=r.modInverse(a);this.dmp1=this.d.mod(o);this.dmq1=this.d.mod(s);this.coeff=this.q.modInverse(this.p);break}}}function Qt(e){if(this.p==null||this.q==null)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),e=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(e)<0;){t=t.add(this.p)}return t.subtract(e).multiply(this.coeff).mod(this.p).multiply(this.q).add(e)}function en(e){e=this.doPrivate(q(e,16));return e==null?null:Xt(e,this.n.bitLength()+7>>3)}A.prototype.doPrivate=Qt;A.prototype.setPrivate=Zt;A.prototype.setPrivateEx=Kt;A.prototype.generate=$t;A.prototype.decrypt=en;var O=[];O.sha1="3021300906052b0e03021a05000414";O.sha256="3031300d060960864801650304020105000420";var M=[];M.sha1=zt.hex;M.sha256=Nt.hex;function L(e,t,n){t/=4;for(var e=(0,M[n])(e),n="00"+O[n]+e,e="",t=t-4-n.length,i=0;i<t;i+=2){e+="ff"}return sPaddedMessageHex="0001"+e+n}function tn(e,t){var n=L(e,this.n.bitLength(),t);return this.doPrivate(q(n,16)).toString(16)}function nn(e){e=L(e,this.n.bitLength(),"sha1");return this.doPrivate(q(e,16)).toString(16)}function rn(e){e=L(e,this.n.bitLength(),"sha256");return this.doPrivate(q(e,16)).toString(16)}function on(e,t,n){var i=new A;i.setPublic(t,n);return i.doPublic(e)}function sn(e,t,n){return on(e,t,n).toString(16).replace(/^1f+00/,"")}function an(e){for(var t in O){var n=O[t],i=n.length;if(e.substring(0,i)==n)return[t,e.substring(i)]}return[]}function un(e,t,n,i){t=sn(t,n,i);n=an(t);if(n.length==0)return!1;t=n[1];e=(0,M[n[0]])(e);return t==e}function ln(e,t){var n=q(e,16);return un(t,n,this.n.toString(16),this.e.toString(16))}function fn(e,t){var t=t.replace(/[ \n]+/g,""),n=this.doPublic(q(t,16)).toString(16).replace(/^1f+00/,""),i=an(n);if(i.length==0)return!1;n=i[1];i=(0,M[i[0]])(e);return n==i}A.prototype.signString=tn;A.prototype.signStringWithSHA1=nn;A.prototype.signStringWithSHA256=rn;A.prototype.verifyString=fn;A.prototype.verifyHexSignatureForMessage=ln;var F=function(){var l={Sbox:[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],ShiftRowTab:[0,5,10,15,4,9,14,3,8,13,2,7,12,1,6,11]};l.Init=function(){l.Sbox_Inv=Array(256);for(var e=0;e<256;e++){l.Sbox_Inv[l.Sbox[e]]=e}l.ShiftRowTab_Inv=Array(16);for(e=0;e<16;e++){l.ShiftRowTab_Inv[l.ShiftRowTab[e]]=e}l.xtime=Array(256);for(e=0;e<128;e++){l.xtime[e]=e<<1,l.xtime[128+e]=e<<1^27}};l.Done=function(){delete l.Sbox_Inv;delete l.ShiftRowTab_Inv;delete l.xtime};l.ExpandKey=function(e){var t=e.length,n,i=1;switch(t){case 16:n=176;break;case 24:n=208;break;case 32:n=240;break;default:alert("my.ExpandKey: Only key lengths of 16, 24 or 32 bytes allowed!")}for(var r=t;r<n;r+=4){var o=e.slice(r-4,r);if(r%t==0){if(o=[l.Sbox[o[1]]^i,l.Sbox[o[2]],l.Sbox[o[3]],l.Sbox[o[0]]],(i<<=1)>=256)i^=283}else t>24&&r%t==16&&(o=[l.Sbox[o[0]],l.Sbox[o[1]],l.Sbox[o[2]],l.Sbox[o[3]]]);for(var s=0;s<4;s++){e[r+s]=e[r+s-t]^o[s]}}};l.Encrypt=function(e,t){var n=t.length;l.AddRoundKey(e,t.slice(0,16));for(var i=16;i<n-16;i+=16){l.SubBytes(e,l.Sbox),l.ShiftRows(e,l.ShiftRowTab),l.MixColumns(e),l.AddRoundKey(e,t.slice(i,i+16))}l.SubBytes(e,l.Sbox);l.ShiftRows(e,l.ShiftRowTab);l.AddRoundKey(e,t.slice(i,n))};l.Decrypt=function(e,t){var n=t.length;l.AddRoundKey(e,t.slice(n-16,n));l.ShiftRows(e,l.ShiftRowTab_Inv);l.SubBytes(e,l.Sbox_Inv);for(n-=32;n>=16;n-=16){l.AddRoundKey(e,t.slice(n,n+16)),l.MixColumns_Inv(e),l.ShiftRows(e,l.ShiftRowTab_Inv),l.SubBytes(e,l.Sbox_Inv)}l.AddRoundKey(e,t.slice(0,16))};l.SubBytes=function(e,t){for(var n=0;n<16;n++){e[n]=t[e[n]]}};l.AddRoundKey=function(e,t){for(var n=0;n<16;n++){e[n]^=t[n]}};l.ShiftRows=function(e,t){for(var n=[].concat(e),i=0;i<16;i++){e[i]=n[t[i]]}};l.MixColumns=function(e){for(var t=0;t<16;t+=4){var n=e[t+0],i=e[t+1],r=e[t+2],o=e[t+3],s=n^i^r^o;e[t+0]^=s^l.xtime[n^i];e[t+1]^=s^l.xtime[i^r];e[t+2]^=s^l.xtime[r^o];e[t+3]^=s^l.xtime[o^n]}};l.MixColumns_Inv=function(e){for(var t=0;t<16;t+=4){var n=e[t+0],i=e[t+1],r=e[t+2],o=e[t+3],s=n^i^r^o,a=l.xtime[s],u=l.xtime[l.xtime[a^n^r]]^s;s^=l.xtime[l.xtime[a^i^o]];e[t+0]^=u^l.xtime[n^i];e[t+1]^=s^l.xtime[i^r];e[t+2]^=u^l.xtime[r^o];e[t+3]^=s^l.xtime[o^n]}};return l}(),cn=function(){var u={};F.Init();u.b256to64=function(e){var t,n,i,r="",o=0,s=0,a=e.length;for(i=0;i<a;i++){n=e.charCodeAt(i),s==0?(r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n>>2&63),t=(n&3)<<4):s==1?(r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t|n>>4&15),t=(n&15)<<2):s==2&&(r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t|n>>6&3),o+=1,r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n&63)),o+=1,s+=1,s==3&&(s=0)}s>0&&(r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t),r+="=");s==1&&(r+="=");return r};u.b64to256=function(e){var t,n,i="",r=0,o=0,s=e.length;for(n=0;n<s;n++){t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(n)),t>=0&&(r&&(i+=String.fromCharCode(o|t>>6-r&255)),r=r+2&7,o=t<<r&255)}return i};u.b16to64=function(e){var t,n,i="";e.length%2==1&&(e="0"+e);for(t=0;t+3<=e.length;t+=3){n=parseInt(e.substring(t,t+3),16),i+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n>>6)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n&63)}t+1==e.length?(n=parseInt(e.substring(t,t+1),16),i+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),i+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n>>2)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((n&3)<<4));for(;(i.length&3)>0;){i+="="}return i};u.b64to16=function(e){var t="",n,i=0,r;for(n=0;n<e.length;++n){if(e.charAt(n)=="=")break;v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(n));v<0||(i==0?(t+=l(v>>2),r=v&3,i=1):i==1?(t+=l(r<<2|v>>4),r=v&15,i=2):i==2?(t+=l(r),t+=l(v>>2),r=v&3,i=3):(t+=l(r<<2|v>>4),t+=l(v&15),i=0))}i==1&&(t+=l(r<<2));return t};u.string2bytes=function(e){for(var t=[],n=0;n<e.length;n++){t.push(e.charCodeAt(n))}return t};u.bytes2string=function(e){for(var t="",n=0;n<e.length;n++){t+=String.fromCharCode(e[n])}return t};u.blockXOR=function(e,t){for(var n=Array(16),i=0;i<16;i++){n[i]=e[i]^t[i]}return n};u.blockIV=function(){var e=new E,t=Array(16);e.nextBytes(t);return t};u.pad16=function(e){var t=e.slice(0),n=(16-e.length%16)%16;for(i=e.length;i<e.length+n;i++){t.push(0)}return t};u.depad=function(e){for(e=e.slice(0);e[e.length-1]==0;){e=e.slice(0,e.length-1)}return e};u.encryptAESCBC=function(e,t){var n=t.slice(0);F.ExpandKey(n);for(var i=u.string2bytes(e),i=u.pad16(i),r=u.blockIV(),o=0;o<i.length/16;o++){var s=i.slice(o*16,o*16+16),a=r.slice(o*16,o*16+16),s=u.blockXOR(a,s);F.Encrypt(s,n);r=r.concat(s)}n=u.bytes2string(r);return u.b256to64(n)};u.decryptAESCBC=function(e,t){var n=t.slice(0);F.ExpandKey(n);for(var e=u.b64to256(e),i=u.string2bytes(e),r=[],o=1;o<i.length/16;o++){var s=i.slice(o*16,o*16+16),a=i.slice((o-1)*16,(o-1)*16+16);F.Decrypt(s,n);s=u.blockXOR(a,s);r=r.concat(s)}r=u.depad(r);return u.bytes2string(r)};u.wrap60=function(e){for(var t="",n=0;n<e.length;n++){n%60==0&&n!=0&&(t+="\n"),t+=e[n]}return t};u.generateAESKey=function(){var e=Array(16);(new E).nextBytes(e);return e};u.generateRSAKey=function(e,t){Math.seedrandom(Nt.hex(e));var n=new A;n.generate(t,"10001");return n};u.publicKeyString=function(e){return pubkey=e.n.toString(16)};u.publicKeyID=function(e){return Jt(e)};u.publicKeyFromString=function(e){var e=e.split("|")[0],t=new A;t.setPublic(e,"10001");return t};u.encrypt=function(e,t,n){var i="";try{var r=u.publicKeyFromString(t);i+=r.encrypt(e)+"?"}catch(o){return{status:"Invalid public key"}}return{status:"success",cipher:i}};u.decrypt=function(e,t){var n=e.split("?"),i=t.decrypt(n[0]);return{status:"success",plaintext:i,signature:"unsigned"}};return u}();W.exports=cn},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var O=O||function(a,n){var e={},t=e.lib={},i=function i(){},r=t.Base={extend:function d(e){i.prototype=this;var t=new i;e&&t.mixIn(e);t.hasOwnProperty("init")||(t.init=function(){t.$super.init.apply(this,arguments)});t.init.prototype=t;t.$super=this;return t},create:function p(){var e=this.extend();e.init.apply(e,arguments);return e},init:function v(){},mixIn:function m(e){for(var t in e){e.hasOwnProperty(t)&&(this[t]=e[t])}e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function y(){return this.init.prototype.extend(this)}},u=t.WordArray=r.extend({init:function v(e,t){e=this.words=e||[];this.sigBytes=t!=n?t:4*e.length},toString:function g(e){return(e||s).stringify(this)},concat:function P(e){var t=this.words,n=e.words,i=this.sigBytes;e=e.sigBytes;this.clamp();if(i%4)for(var r=0;r<e;r++){t[i+r>>>2]|=(n[r>>>2]>>>24-8*(r%4)&255)<<24-8*((i+r)%4)}else if(65535<n.length)for(r=0;r<e;r+=4){t[i+r>>>2]=n[r>>>2]}else t.push.apply(t,n);this.sigBytes+=e;return this},clamp:function w(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-8*(t%4);e.length=a.ceil(t/4)},clone:function y(){var e=r.clone.call(this);e.words=this.words.slice(0);return e},random:function S(e){for(var t=[],n=0;n<e;n+=4){t.push(4294967296*a.random()|0)}return new u.init(t,e)}}),o=e.enc={},s=o.Hex={stringify:function _(e){var t=e.words;e=e.sigBytes;for(var n=[],i=0;i<e;i++){var r=t[i>>>2]>>>24-8*(i%4)&255;n.push((r>>>4).toString(16));n.push((r&15).toString(16))}return n.join("")},parse:function b(e){for(var t=e.length,n=[],i=0;i<t;i+=2){n[i>>>3]|=parseInt(e.substr(i,2),16)<<24-4*(i%8)}return new u.init(n,t/2)}},l=o.Latin1={stringify:function _(e){var t=e.words;e=e.sigBytes;for(var n=[],i=0;i<e;i++){n.push(String.fromCharCode(t[i>>>2]>>>24-8*(i%4)&255))}return n.join("")},parse:function b(e){for(var t=e.length,n=[],i=0;i<t;i++){n[i>>>2]|=(e.charCodeAt(i)&255)<<24-8*(i%4)}return new u.init(n,t)}},f=o.Utf8={stringify:function _(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(t){throw Error("Malformed UTF-8 data")}},parse:function b(e){return l.parse(unescape(encodeURIComponent(e)))}},c=t.BufferedBlockAlgorithm=r.extend({reset:function C(){this._data=new u.init;this._nDataBytes=0},_append:function k(e){"string"==typeof e&&(e=f.parse(e));this._data.concat(e);this._nDataBytes+=e.sigBytes},_process:function T(e){var t=this._data,n=t.words,i=t.sigBytes,r=this.blockSize,o=i/(4*r),o=e?a.ceil(o):a.max((o|0)-this._minBufferSize,0);e=o*r;i=a.min(4*e,i);if(e){for(var s=0;s<e;s+=r){this._doProcessBlock(n,s)}s=n.splice(0,e);t.sigBytes-=i}return new u.init(s,i)},clone:function y(){var e=r.clone.call(this);e._data=this._data.clone();return e},_minBufferSize:0});t.Hasher=c.extend({cfg:r.extend(),init:function v(e){this.cfg=this.cfg.extend(e);this.reset()},reset:function C(){c.reset.call(this);this._doReset()},update:function R(e){this._append(e);this._process();return this},finalize:function D(e){e&&this._append(e);return this._doFinalize()},blockSize:16,_createHelper:function x(n){return function(e,t){return new n.init(t).finalize(e)}},_createHmacHelper:function I(n){return function(e,t){return new h.HMAC.init(n,t).finalize(e)}}});var h=e.algo={};return e}(Math);(function(){var e=O,u=e.lib.WordArray;e.enc.Base64={stringify:function a(e){var t=e.words,n=e.sigBytes,i=this._map;e.clamp();e=[];for(var r=0;r<n;r+=3){for(var o=(t[r>>>2]>>>24-8*(r%4)&255)<<16|(t[r+1>>>2]>>>24-8*((r+1)%4)&255)<<8|t[r+2>>>2]>>>24-8*((r+2)%4)&255,s=0;4>s&&r+.75*s<n;s++){e.push(i.charAt(o>>>6*(3-s)&63))}}if(t=i.charAt(64))for(;e.length%4;){e.push(t)}return e.join("")},parse:function l(e){var t=e.length,n=this._map,i=n.charAt(64);i&&(i=e.indexOf(i),-1!=i&&(t=i));for(var i=[],r=0,o=0;o<t;o++){if(o%4){var s=n.indexOf(e.charAt(o-1))<<2*(o%4),a=n.indexOf(e.charAt(o))>>>6-2*(o%4);i[r>>>2]|=(s|a)<<24-8*(r%4);r++}}return u.create(i,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();(function(o){function b(e,t,n,i,r,o,s){e=e+(t&n|~t&i)+r+s;return(e<<o|e>>>32-o)+t}function C(e,t,n,i,r,o,s){e=e+(t&i|n&~i)+r+s;return(e<<o|e>>>32-o)+t}function k(e,t,n,i,r,o,s){e=e+(t^n^i)+r+s;return(e<<o|e>>>32-o)+t}function T(e,t,n,i,r,o,s){e=e+(n^(t|~i))+r+s;return(e<<o|e>>>32-o)+t}for(var e=O,t=e.lib,n=t.WordArray,i=t.Hasher,t=e.algo,R=[],r=0;64>r;r++){R[r]=4294967296*o.abs(o.sin(r+1))|0}t=t.MD5=i.extend({_doReset:function s(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function D(e,t){for(var n=0;16>n;n++){var i=t+n,r=e[i];e[i]=(r<<8|r>>>24)&16711935|(r<<24|r>>>8)&4278255360}var n=this._hash.words,i=e[t+0],r=e[t+1],o=e[t+2],s=e[t+3],a=e[t+4],u=e[t+5],l=e[t+6],f=e[t+7],c=e[t+8],h=e[t+9],d=e[t+10],p=e[t+11],v=e[t+12],m=e[t+13],y=e[t+14],g=e[t+15],P=n[0],w=n[1],S=n[2],_=n[3],P=b(P,w,S,_,i,7,R[0]),_=b(_,P,w,S,r,12,R[1]),S=b(S,_,P,w,o,17,R[2]),w=b(w,S,_,P,s,22,R[3]),P=b(P,w,S,_,a,7,R[4]),_=b(_,P,w,S,u,12,R[5]),S=b(S,_,P,w,l,17,R[6]),w=b(w,S,_,P,f,22,R[7]),P=b(P,w,S,_,c,7,R[8]),_=b(_,P,w,S,h,12,R[9]),S=b(S,_,P,w,d,17,R[10]),w=b(w,S,_,P,p,22,R[11]),P=b(P,w,S,_,v,7,R[12]),_=b(_,P,w,S,m,12,R[13]),S=b(S,_,P,w,y,17,R[14]),w=b(w,S,_,P,g,22,R[15]),P=C(P,w,S,_,r,5,R[16]),_=C(_,P,w,S,l,9,R[17]),S=C(S,_,P,w,p,14,R[18]),w=C(w,S,_,P,i,20,R[19]),P=C(P,w,S,_,u,5,R[20]),_=C(_,P,w,S,d,9,R[21]),S=C(S,_,P,w,g,14,R[22]),w=C(w,S,_,P,a,20,R[23]),P=C(P,w,S,_,h,5,R[24]),_=C(_,P,w,S,y,9,R[25]),S=C(S,_,P,w,s,14,R[26]),w=C(w,S,_,P,c,20,R[27]),P=C(P,w,S,_,m,5,R[28]),_=C(_,P,w,S,o,9,R[29]),S=C(S,_,P,w,f,14,R[30]),w=C(w,S,_,P,v,20,R[31]),P=k(P,w,S,_,u,4,R[32]),_=k(_,P,w,S,c,11,R[33]),S=k(S,_,P,w,p,16,R[34]),w=k(w,S,_,P,y,23,R[35]),P=k(P,w,S,_,r,4,R[36]),_=k(_,P,w,S,a,11,R[37]),S=k(S,_,P,w,f,16,R[38]),w=k(w,S,_,P,d,23,R[39]),P=k(P,w,S,_,m,4,R[40]),_=k(_,P,w,S,i,11,R[41]),S=k(S,_,P,w,s,16,R[42]),w=k(w,S,_,P,l,23,R[43]),P=k(P,w,S,_,h,4,R[44]),_=k(_,P,w,S,v,11,R[45]),S=k(S,_,P,w,g,16,R[46]),w=k(w,S,_,P,o,23,R[47]),P=T(P,w,S,_,i,6,R[48]),_=T(_,P,w,S,f,10,R[49]),S=T(S,_,P,w,y,15,R[50]),w=T(w,S,_,P,u,21,R[51]),P=T(P,w,S,_,v,6,R[52]),_=T(_,P,w,S,s,10,R[53]),S=T(S,_,P,w,d,15,R[54]),w=T(w,S,_,P,r,21,R[55]),P=T(P,w,S,_,c,6,R[56]),_=T(_,P,w,S,g,10,R[57]),S=T(S,_,P,w,l,15,R[58]),w=T(w,S,_,P,m,21,R[59]),P=T(P,w,S,_,a,6,R[60]),_=T(_,P,w,S,p,10,R[61]),S=T(S,_,P,w,o,15,R[62]),w=T(w,S,_,P,h,21,R[63]);n[0]=n[0]+P|0;n[1]=n[1]+w|0;n[2]=n[2]+S|0;n[3]=n[3]+_|0},_doFinalize:function a(){var e=this._data,t=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32;var r=o.floor(n/4294967296);t[(i+64>>>9<<4)+15]=(r<<8|r>>>24)&16711935|(r<<24|r>>>8)&4278255360;t[(i+64>>>9<<4)+14]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360;e.sigBytes=4*(t.length+1);this._process();e=this._hash;t=e.words;for(n=0;4>n;n++){i=t[n],t[n]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360}return e},clone:function u(){var e=i.clone.call(this);e._hash=this._hash.clone();return e}});e.MD5=i._createHelper(t);e.HmacMD5=i._createHmacHelper(t)})(Math);(function(){var e=O,t=e.lib,n=t.Base,l=t.WordArray,t=e.algo,i=t.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:t.MD5,iterations:1}),init:function r(e){this.cfg=this.cfg.extend(e)},compute:function f(e,t){for(var n=this.cfg,i=n.hasher.create(),r=l.create(),o=r.words,s=n.keySize,n=n.iterations;o.length<s;){a&&i.update(a);var a=i.update(e).finalize(t);i.reset();for(var u=1;u<n;u++){a=i.finalize(a),i.reset()}r.concat(a)}r.sigBytes=4*s;return r}});e.EvpKDF=function(e,t,n){return i.create(n).compute(e,t)}})();O.lib.Cipher||function(o){var e=O,t=e.lib,n=t.Base,s=t.WordArray,i=t.BufferedBlockAlgorithm,r=e.enc.Base64,a=e.algo.EvpKDF,u=t.Cipher=i.extend({cfg:n.extend(),createEncryptor:function v(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function m(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function y(e,t,n){this.cfg=this.cfg.extend(n);this._xformMode=e;this._key=t;this.reset()},reset:function g(){i.reset.call(this);this._doReset()},process:function P(e){this._append(e);return this._process()},finalize:function w(e){e&&this._append(e);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function S(i){return{encrypt:function r(e,t,n){return("string"==typeof t?p:d).encrypt(i,e,t,n)},decrypt:function o(e,t,n){return("string"==typeof t?p:d).decrypt(i,e,t,n)}}}});t.StreamCipher=u.extend({_doFinalize:function _(){return this._process(!0)},blockSize:1});var l=e.mode={},f=function f(e,t,n){var i=this._iv;i?this._iv=o:i=this._prevBlock;for(var r=0;r<n;r++){e[t+r]^=i[r]}},c=(t.BlockCipherMode=n.extend({createEncryptor:function v(e,t){return this.Encryptor.create(e,t)},createDecryptor:function m(e,t){return this.Decryptor.create(e,t)},init:function y(e,t){this._cipher=e;this._iv=t}})).extend();c.Encryptor=c.extend({processBlock:function b(e,t){var n=this._cipher,i=n.blockSize;f.call(this,e,t,i);n.encryptBlock(e,t);this._prevBlock=e.slice(t,t+i)}});c.Decryptor=c.extend({processBlock:function b(e,t){var n=this._cipher,i=n.blockSize,r=e.slice(t,t+i);n.decryptBlock(e,t);f.call(this,e,t,i);this._prevBlock=r}});l=l.CBC=c;c=(e.pad={}).Pkcs7={pad:function C(e,t){for(var n=4*t,n=n-e.sigBytes%n,i=n<<24|n<<16|n<<8|n,r=[],o=0;o<n;o+=4){r.push(i)}n=s.create(r,n);e.concat(n)},unpad:function k(e){e.sigBytes-=e.words[e.sigBytes-1>>>2]&255}};t.BlockCipher=u.extend({cfg:u.cfg.extend({mode:l,padding:c}),reset:function g(){u.reset.call(this);var e=this.cfg,t=e.iv,e=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=e.createEncryptor;else n=e.createDecryptor,this._minBufferSize=1;this._mode=n.call(e,this,t&&t.words)},_doProcessBlock:function T(e,t){this._mode.processBlock(e,t)},_doFinalize:function _(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var h=t.CipherParams=n.extend({init:function y(e){this.mixIn(e)},toString:function R(e){return(e||this.formatter).stringify(this)}}),l=(e.format={}).OpenSSL={stringify:function D(e){var t=e.ciphertext;e=e.salt;return(e?s.create([1398893684,1701076831]).concat(e).concat(t):t).toString(r)},parse:function x(e){e=r.parse(e);var t=e.words;if(1398893684==t[0]&&1701076831==t[1]){var n=s.create(t.slice(2,4));t.splice(0,4);e.sigBytes-=16}return h.create({ciphertext:e,salt:n})}},d=t.SerializableCipher=n.extend({cfg:n.extend({format:l}),encrypt:function I(e,t,n,i){i=this.cfg.extend(i);var r=e.createEncryptor(n,i);t=r.finalize(t);r=r.cfg;return h.create({ciphertext:t,key:n,iv:r.iv,algorithm:e,mode:r.mode,padding:r.padding,blockSize:e.blockSize,formatter:i.format})},decrypt:function E(e,t,n,i){i=this.cfg.extend(i);t=this._parse(t,i.format);return e.createDecryptor(n,i).finalize(t.ciphertext)},_parse:function q(e,t){return"string"==typeof e?t.parse(e,this):e}}),e=(e.kdf={}).OpenSSL={execute:function A(e,t,n,i){i||(i=s.random(8));e=a.create({keySize:t+n}).compute(e,i);n=s.create(e.words.slice(t),4*n);e.sigBytes=4*t;return h.create({key:e,iv:n,salt:i})}},p=t.PasswordBasedCipher=d.extend({cfg:d.cfg.extend({kdf:e}),encrypt:function I(e,t,n,i){i=this.cfg.extend(i);n=i.kdf.execute(n,e.keySize,e.ivSize);i.iv=n.iv;e=d.encrypt.call(this,e,t,n.key,i);e.mixIn(n);return e},decrypt:function E(e,t,n,i){i=this.cfg.extend(i);t=this._parse(t,i.format);n=i.kdf.execute(n,e.keySize,e.ivSize,t.salt);i.iv=n.iv;return d.decrypt.call(this,e,t,n.key,i)}})}();(function(){for(var e=O,t=e.lib.BlockCipher,n=e.algo,s=[],i=[],r=[],o=[],a=[],u=[],l=[],f=[],c=[],h=[],d=[],p=0;256>p;p++){d[p]=128>p?p<<1:p<<1^283}for(var v=0,m=0,p=0;256>p;p++){var y=m^m<<1^m<<2^m<<3^m<<4,y=y>>>8^y&255^99;s[v]=y;i[y]=v;var g=d[v],P=d[g],w=d[P],S=257*d[y]^16843008*y;r[v]=S<<24|S>>>8;o[v]=S<<16|S>>>16;a[v]=S<<8|S>>>24;u[v]=S;S=16843009*w^65537*P^257*g^16843008*v;l[y]=S<<24|S>>>8;f[y]=S<<16|S>>>16;c[y]=S<<8|S>>>24;h[y]=S;v?(v=g^d[d[d[w^g]]],m^=d[d[m]]):v=m=1}var _=[0,1,2,4,8,16,32,64,128,27,54],n=n.AES=t.extend({_doReset:function b(){for(var e=this._key,t=e.words,n=e.sigBytes/4,e=4*((this._nRounds=n+6)+1),i=this._keySchedule=[],r=0;r<e;r++){if(r<n)i[r]=t[r];else{var o=i[r-1];r%n?6<n&&4==r%n&&(o=s[o>>>24]<<24|s[o>>>16&255]<<16|s[o>>>8&255]<<8|s[o&255]):(o=o<<8|o>>>24,o=s[o>>>24]<<24|s[o>>>16&255]<<16|s[o>>>8&255]<<8|s[o&255],o^=_[r/n|0]<<24);i[r]=i[r-n]^o}}t=this._invKeySchedule=[];for(n=0;n<e;n++){r=e-n,o=n%4?i[r]:i[r-4],t[n]=4>n||4>=r?o:l[s[o>>>24]]^f[s[o>>>16&255]]^c[s[o>>>8&255]]^h[s[o&255]]}},encryptBlock:function C(e,t){this._doCryptBlock(e,t,this._keySchedule,r,o,a,u,s)},decryptBlock:function k(e,t){var n=e[t+1];e[t+1]=e[t+3];e[t+3]=n;this._doCryptBlock(e,t,this._invKeySchedule,l,f,c,h,i);n=e[t+1];e[t+1]=e[t+3];e[t+3]=n},_doCryptBlock:function T(e,t,n,i,r,o,s,a){for(var u=this._nRounds,l=e[t]^n[0],f=e[t+1]^n[1],c=e[t+2]^n[2],h=e[t+3]^n[3],d=4,p=1;p<u;p++){var v=i[l>>>24]^r[f>>>16&255]^o[c>>>8&255]^s[h&255]^n[d++],m=i[f>>>24]^r[c>>>16&255]^o[h>>>8&255]^s[l&255]^n[d++],y=i[c>>>24]^r[h>>>16&255]^o[l>>>8&255]^s[f&255]^n[d++],h=i[h>>>24]^r[l>>>16&255]^o[f>>>8&255]^s[c&255]^n[d++],l=v,f=m,c=y}v=(a[l>>>24]<<24|a[f>>>16&255]<<16|a[c>>>8&255]<<8|a[h&255])^n[d++];m=(a[f>>>24]<<24|a[c>>>16&255]<<16|a[h>>>8&255]<<8|a[l&255])^n[d++];y=(a[c>>>24]<<24|a[h>>>16&255]<<16|a[l>>>8&255]<<8|a[f&255])^n[d++];h=(a[h>>>24]<<24|a[l>>>16&255]<<16|a[f>>>8&255]<<8|a[c&255])^n[d++];e[t]=v;e[t+1]=m;e[t+2]=y;e[t+3]=h},keySize:8});e.AES=t._createHelper(n)})();t["default"]=O},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var i=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(e,t,n){if(t)i(e.prototype,t);if(n)i(e,n);return e}}();function s(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var r=function(){var e=function(){function e(){s(this,e)}i(e,[{key:"createClientObject",value:function r(e,t,n,i){return{socket:e,id:t,playURL:n,deviceSerial:i.deviceSerial||"",verificationCode:i.verificationCode||"",resolve:null,reject:null}}},{key:"playCmd",value:function n(e){var t={sequence:0,cmd:"realplay",deviceSerial:e.deviceSerial,verificationCode:e.verificationCode,url:e.playURL};return JSON.stringify(t)}},{key:"playbackCmd",value:function o(e,t,n){var i={sequence:0,cmd:"playback",deviceSerial:e.deviceSerial,verificationCode:e.verificationCode,url:e.playURL,startTime:t,endTime:n};return JSON.stringify(i)}}]);return e}();return e}();t.LocalService=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:true});var Q=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(e,t,n){if(t)i(e.prototype,t);if(n)i(e,n);return e}}();function ee(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var te=0;var ne=1;var ie=2;var i=3;var r=4;var o=5;var s=6;var a=7;var re=11;var u=12;var l=13;var f=14;var c=15;var oe=16;var h=17;var d=18;var p=19;var v=20;var m=21;var y=22;var g=24;var P=25;var w=26;var S=27;var _=28;var b=29;var C=30;var se=31;var k=33;var T=34;var R=99;var D=40;var x=41;var I=42;var E=43;var q=44;var A=45;var O=46;var M=47;var ae=48;var ue=60;var le=61;var L=62;var fe=63;var ce=71;var F=72;var W=73;var N=74;var B=75;var z=76;var J=77;var H=78;var he=79;var de=100;var pe=101;var ve=1;var U=2;var j=3;var G=4;var me=5;var ye=6;var ge=1;var V=2;var Y=8;var Pe=16;var X=8e3;var Z=16e3;var K=24e3;var $=32e3;var Oe=48e3;var Me=64e3;var we={AUDIO_G711_U:28944,AUDIO_G711_A:28945,AUDIO_G722_1:29217,AUDIO_G726_U:29280,AUDIO_G726_A:29281,AUDIO_G726_2:29282,AUDIO_AACLC:8193,AUDIO_MPEG:8192,AUDIO_ADPCM:4096,AUDIO_NULL:0};var Se=0;var _e=1;var Le=1;var Fe=256;var We=28944;var Ne=28945;var be=0;var Ce=1;var Be="BMP";var ze="JPEG";var ke=0;var Te=1;var Re=15;var Je=8;var He=1;var Ue=50;var je=5;var Ge=2;var Ve=5*1024*1024;var Ye=100;var De=1024*20;var Xe=200;var Ze=100;var Ke=20;var $e=100;var xe=200;var Ie=1;var Qe=0;var et={left:0,top:0,right:0,bottom:0};var tt={width:0,height:0,frameNum:0,yuvData:null};var nt={width:0,height:0,frameNum:0,yuvData:null};var it={sampleRate:0,channel:0,bitsPerSample:0,length:0,pcmData:null};var Ee=false;var qe=false;var Ae=false;var rt=0;var ot={id:null,cmd:null,data:null,errorCode:0,status:null};var st=e.JSPlayCtrl=function(){function a(e,t,s){ee(this,a);if(e!=null&&e!==undefined&&typeof e==="string"){this.szBasePath=e}else{return te}if(t&&typeof t==="function"){this.fnCallBack=t}else{return te}this.decodeWorker=null;this.streamOpenMode=null;this.bOpenStream=false;this.iFrameNumOrTime=0;this.bSetPlayPositionType=Qe;this.audioRenderer=null;this.aAudioBuffer=[];this.iAudioBufferSize=0;this.bWriteAudEnc=false;this.iAudioEncBufferSize=0;this.aAudioEncBuffer=[];this.oSuperRender=null;this.aVideoFrameBuffer=[];this.YUVBufferSize=He;this.szOSDTime=null;this.bWriteYUVData=false;this.iYUV10size=0;this.aVideoYUVBuffer=[];this.bWritePCMData=false;this.iAudioBuffer500Size=0;this.aAudioPCMBuffer=[];this.bWriteRawData=false;this.iRawDataSize=0;this.aRawDataBuffer=[];this.bWriteRTPData=true;this.iRTPDataSize=0;this.aRTPDataBuffer=[];this.downloadRTP=false;this.rtpNum=0;this.bPlaySound=false;this.bPlay=false;this.bPause=false;this.bOnebyOne=false;this.bPlayRateChange=false;this.bAudioTypeSupport=true;this.audioNum=0;this.videoNum=0;this.SetPlayPositionFlag=false;this.FrameForwardLen=1;this.bOnlyPlaySound=false;this.dataCallBackFun=null;this.YUVBufSizeCBFun=null;this.AudEncodeDataCBFun=null;this.DecCallBackFun=null;this.DisplayCallBackFun=null;this.PCMCallBackFun=null;this.DecInfoYUV=tt;this.DisplayInfoYUV=nt;this.DecInfoPCM=it;this.nWidth=0;this.nHeight=0;this.nSPSCropLeft=0;this.nSPSCropRight=0;this.nSPSCropTop=0;this.nSPSCropBottom=0;this.sCanvasId=null;this.aDisplayBuf=null;this.bVisibility=true;this.nDecFrameType=ke;this.iCanvasWidth=0;this.iCanvasHeight=0;this.iZoomNum=0;this.iRatio_x=1;this.iRatio_y=1;this.stDisplayRect={top:0,left:0,right:0,bottom:0};this.bDisRect=false;this.stYUVRect={top:0,left:0,right:0,bottom:0};this.aInputDataLens=[];this.aInputDataBuffer=[];this.bIsGetYUV=false;this.bIsFirstFrame=true;this.iInputMaxBufSize=Ve;this.bIsInput=false;this.bIsInputBufOver=false;this.iInputDataLen=De;var w=this;this.setCallBack=function(e,t,n,i,r){var o=ot;o.id=s;o.cmd=t;o.data=n;o.errorCode=i;o.status=r;e.fnCallBack(o)};if(!Ee){Ee=true;var n=document.createElement("script");n.type="text/javascript";n.src=w.szBasePath+"AudioRenderer.js";var i=document.getElementsByTagName("head")[0];i.appendChild(n);n.onload=n.onreadystatechange=function(){if(!this.readyState||this.readyState==="loaded"||this.readyState==="complete"){if(Ae){console.log(">>>JS AudioRenderer.js load finish!")}}}}if(!qe){qe=true;var r=document.createElement("script");r.type="text/javascript";r.src=w.szBasePath+"SuperRender_10.js";var o=document.getElementsByTagName("head")[0];o.appendChild(r);r.onload=r.onreadystatechange=function(){if(!this.readyState||this.readyState==="loaded"||this.readyState==="complete"){if(Ae){console.log(">>>JS SuperRender_10.js load finish!")}}}}this.convertErrorCode=function(e){switch(e){case 1:return ne;case 98:return te;default:return e}};this.arrayBufferCopy=function(e){var t=e.byteLength;var n=new Uint8Array(t);var i=new Uint8Array(e);var r=0;for(r=0;r<t;r++){n[r]=i[r]}return n};this.inputDataFun=function(){var e;var t;var n=0;w.bIsGetYUV=false;if(w.bIsInputBufOver){if(Ae){console.log(">>>JS inputDataFun over!")}e=new Uint8Array(1);t=new Uint8Array(e);var i={command:"InputData",data:t.buffer,dataSize:0};w.decodeWorker.postMessage(i,[i.data])}else{if(w.bPlay&&(!w.bPause||w.bOnebyOne)||this.bOnlyPlaySound){while(w.aInputDataLens.length>0){n+=w.aInputDataLens.shift();if(n>w.iInputDataLen){break}}if(Ae){console.log(">>>JS inputDataFun-len:%d,totalSize:%d",n,w.aInputDataBuffer.length)}e=w.aInputDataBuffer.splice(0,n);t=new Uint8Array(e);var i={command:"InputData",data:t.buffer,dataSize:n};w.decodeWorker.postMessage(i,[i.data])}}e=null;t=null};this.getPic=function(e,t){if(this.decodeWorker==null||this.oSuperRender==null){return ie}if(!this.bPlay){return ie}if(e&&typeof e==="function"){this.dataCallBackFun=e}else{return te}if(0===this.iZoomNum){this.stYUVRect.left=0;this.stYUVRect.top=0;this.stYUVRect.right=0;this.stYUVRect.bottom=0}else{if(0===this.iCanvasWidth||0===this.iCanvasHeight){this.stYUVRect.left=0;this.stYUVRect.top=0;this.stYUVRect.right=0;this.stYUVRect.bottom=0}else{var n=this.nWidth/this.iCanvasWidth;var i=this.nHeight/this.iCanvasHeight;this.stYUVRect.left=Math.round(this.stDisplayRect.left*n);this.stYUVRect.top=Math.round(this.stDisplayRect.top*i);this.stYUVRect.right=Math.round(this.stDisplayRect.right*n);this.stYUVRect.bottom=Math.round(this.stDisplayRect.bottom*i)}if(this.stYUVRect.right-this.stYUVRect.left<32||this.stYUVRect.bottom-this.stYUVRect.top<32){return te}}if(this.aDisplayBuf==null){return ie}var r=this.arrayBufferCopy(this.aDisplayBuf);var o={command:t,data:r.buffer,width:this.nWidth,height:this.nHeight,rect:this.stYUVRect};if(Ae){console.log(">>>JS capture nWidth = %d,nWidth = %d",this.nWidth,this.nHeight)}this.decodeWorker.postMessage(o,[o.data]);return ne};this.createWorker=function(P){if(window.Worker){if(this.decodeWorker==null){this.decodeWorker=new Worker(w.szBasePath+"DecodeWorker.js");if(Ae){console.log(">>>JS  createWorker success!!!!!!!!!!!!!!!!!!!!!!!!!")}if(this.decodeWorker==null){return ue}}this.decodeWorker.onmessage=function(e){var t=null;var n=e.data;switch(n["function"]){case"printLog":console.log("print JSPlayerSDK log failed");break;case"loaded":t="loaded";P.setCallBack(P,"loaded",0,0,true);break;case"SetStreamOpenMode":t="SetStreamOpenMode";break;case"OpenStream":t="OpenStream";if(1===n.errorCode){w.bOpenStream=true;return}break;case"InputData":t="InputData";if(n.errorCode===re){w.bIsInputBufOver=true;w.inputDataFun();if(Ae){console.log(">>>JS InputData PLAYM4_BUF_OVER")}}if(n.errorCode===se){w.bIsInputBufOver=false;if(Ae){console.log(">>>JS InputData PLAYM4_NEED_MORE_DATA")}}break;case"GetFrameData":t="GetFrameData";if(!w.bOnlyPlaySound){if(Ae){console.log(">>>JS mainthread display GetFrameData 1-1")}if(n.data!=null&&n.frameInfo!=null){var i=n.frameInfo.width;var r=n.frameInfo.height}if(!w.bPlay){return}if(!w.bIsFirstFrame&&n.errorCode===se){w.bIsInputBufOver=false;setTimeout(w.inputDataFun(),5);break}else if(w.bIsInputBufOver){w.inputDataFun()}else{if(n.type==="videoType"){if(w.aInputDataLens.length>0&&w.bIsInput){w.inputDataFun();w.bIsInput=false}else{w.bIsGetYUV=true}w.bIsFirstFrame=false}}}if(Ae){console.log(">>>JS mainthread display GetFrameData bVisibility:"+w.bVisibility)}if(w.bVisibility){if(ne===n.errorCode){switch(n.type){case"videoType":if(Ae){console.log(">>>JS mainthread display GetFrameData type:"+n.type)}if(n.data==null||n.frameInfo==null){return te}if(w.DecCallBackFun!=null){if(Ae){console.log(">>>JS MainThread-GetYUVData")}w.DecInfoYUV.height=n.frameInfo.height;w.DecInfoYUV.width=n.frameInfo.width;w.DecInfoYUV.frameNum=n.frameInfo.frameNum;w.DecInfoYUV.yuvData=new Uint8Array(n.data);w.DecCallBackFun(w.DecInfoYUV)}w.bIsFirstFrame=false;P.nWidth=n.frameInfo.width;P.nHeight=n.frameInfo.height;P.nSPSCropLeft=n.frameInfo.cropLeft;P.nSPSCropRight=n.frameInfo.cropRight;P.nSPSCropTop=n.frameInfo.cropTop;P.nSPSCropBottom=n.frameInfo.cropBottom;var o=new Object;o.data=n.data;o.osdTime=n.osd;o.nWidth=n.frameInfo.width;o.nHeight=n.frameInfo.height;o.frameNum=n.frameInfo.frameNum;o.timeStamp=n.frameInfo.timeStamp;if(P.bWriteYUVData){var s=new Uint8Array(n.data);var a=P.aVideoYUVBuffer.length;for(var u=0,l=s.length;u<l;u++){P.aVideoYUVBuffer[a+u]=s[u]}P.iYUV10size++;s=null}if(P.bWriteYUVData&&P.iYUV10size>=Ke){var f=new Uint8Array(P.aVideoYUVBuffer);P.downloadFile(f,"videoYUV.data");P.aVideoYUVBuffer.splice(0,P.aVideoYUVBuffer.length);P.bWriteYUVData=false;P.iYUV10size=0;f=null}if(Ae){console.log(">>>JS mainthread getVideoInfo Width:"+o.nWidth+",height:"+o.nHeight+",frameNum:"+o.frameNum)}P.aVideoFrameBuffer.push(o);o=null;var c=P.aVideoFrameBuffer.length;if(c>je){if(Ae){console.log(">>>JS render loose frame iYUVNum:%d",c)}if(!P.bOnebyOne){P.aVideoFrameBuffer.splice(0,Ge)}}if(P.SetPlayPositionFlag&&P.bSetPlayPositionType===Ie&&(n.frameInfo.frameNum===P.iFrameNumOrTime||n.frameInfo.timeStamp===P.iFrameNumOrTime)){P.setCallBack(P,"SetFrameNum",0,0,false);P.bIsFirstFrame=true;break}if(P.bOnebyOne){if(P.aVideoFrameBuffer.length>=Re){P.setCallBack(P,"OnebyOne",0,0,false);P.bIsFirstFrame=true;break}}break;case"audioType":if(Ae){console.log(">>>JS mainthread display GetFrameData 2-3 type:"+n.type+",bPlaySound:"+P.bPlaySound+",!bPlayRateChange:"+!P.bPlayRateChange+",bOnlyPlaySound:"+w.bOnlyPlaySound)}if(P.bPlaySound&&!P.bPlayRateChange||w.bOnlyPlaySound){if(Ae){console.log(">>>JS mainthread display GetFrameData 2-4 type"+n.type+"bOnlyPlaySound:"+w.bOnlyPlaySound)}if(w.PCMCallBackFun!=null){if(Ae){console.log(">>>JS MainThread-GetYUVData")}w.DecInfoPCM.sampleRate=n.frameInfo.samplesPerSec;w.DecInfoPCM.channel=n.frameInfo.channels;w.DecInfoPCM.bitsPerSample=n.frameInfo.bitsPerSample;w.DecInfoPCM.pcmData=new Uint8Array(n.data);w.DecInfoPCM.length=w.DecInfoPCM.pcmData.length;w.PCMCallBackFun(w.DecInfoPCM)}var s=new Uint8Array(n.data);var a=P.aAudioBuffer.length;for(var u=0,l=s.length;u<l;u++){P.aAudioBuffer[a+u]=s[u]}P.iAudioBufferSize++;s=null;if(Ae){console.log(">>>JS play sound 1 iAudioBufferNum:%d, BufferLen:%d",P.iAudioBufferSize,P.aAudioBuffer.length)}if(P.bWritePCMData){var s=new Uint8Array(n.data);var a=P.aAudioPCMBuffer.length;for(var u=0,l=s.length;u<l;u++){P.aAudioPCMBuffer[a+u]=s[u]}console.log("audio_type num:"+P.iAudioBuffer500Size+", len:"+s.length);P.iAudioBuffer500Size++;s=null}if(P.bWritePCMData&&P.iAudioBuffer500Size>=Ze){var h=new Uint8Array(P.aAudioPCMBuffer);P.downloadFile(h,"audioPCM.data");P.aAudioPCMBuffer.splice(0,P.aAudioPCMBuffer.length);P.bWritePCMData=false;P.iAudioBuffer500Size=0;h=null}if(P.iAudioBufferSize>=Ue){if(Ae){console.log(">>>JS play sound 2 iAudioBufferNum:%d, BufferLen:%d",P.iAudioBufferSize,P.aAudioBuffer.length)}P.audioRenderer.Play(P.aAudioBuffer,P.aAudioBuffer.length,n.frameInfo);if(Ae){console.log(">>>JS mainthread display Audio push 3 sysTime:"+((new Date).getMonth()+1)+"-"+(new Date).getDate()+" "+(new Date).getHours()+":"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds())}P.aAudioBuffer.splice(0,P.aAudioBuffer.length);P.aAudioBuffer.length=0;P.iAudioBufferSize=0}}break;case"privateType":if(Ae){console.log(">>>JS mainthread display GetFrameData 2-5 type"+n.type+"bOnlyPlaySound:"+w.bOnlyPlaySound)}break;default:if(Ae){console.log(">>>JS mainthread display GetFrameData 2-6 type:"+n.type+",bOnlyPlaySound:"+w.bOnlyPlaySound)}break}}else{if(Ae){console.log(">>>JS mainthread GetFrameData is not Ok,errorCode:"+n.errorCode)}}}break;case"GetRawData":t="GetRawData";if(P.bWriteRawData){var d=new Uint8Array(n.data);var p=P.aRawDataBuffer.length;for(var u=0,l=d.length;u<l;u++){P.aRawDataBuffer[p+u]=d[u]}P.iRawDataSize++;d=null}if(P.bWriteRawData&&P.iRawDataSize>=$e){var v=new Uint8Array(P.aRawDataBuffer);P.downloadFile(v,"rawBuffer.data");P.aRawDataBuffer.splice(0,P.aRawDataBuffer.length);P.bWriteRawData=false;P.iRawDataSize=0;v=null}break;case"PlaySound":t="PlaySound";break;case"SetPlayPosition":console.log(">>>JS mainthread SetPlayPosition error,errorCode:"+n.errorCode);break;case"GetJPEG":t="GetJPEG";var m=n.data;P.dataCallBackFun(m);break;case"GetBMP":t="GetBMP";var y=n.data;P.dataCallBackFun(y);break;case"GetAudEncodeData":if(Ae){console.log(">>>JS MainThread-GetAudEncodeData 1")}t="GetAudEncodeData";if(ne===n.errorCode){if(w.AudEncodeDataCBFun!=null){if(Ae){console.log(">>>JS  GetAudEncodeData 1 dataSize"+n.dataSize+", nSysTime:"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds())}w.AudEncodeDataCBFun(new Uint8Array(n.data));if(Ae){console.log(">>>JS  GetAudEncodeData 2 dataSize"+n.dataSize+", nSysTime:"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds())}}if(P.bWriteAudEnc){var s=new Uint8Array(n.data);var a=P.aAudioEncBuffer.length;for(var u=0,l=s.length;u<l;u++){P.aAudioEncBuffer[a+u]=s[u]}P.iAudioEncBufferSize++;s=null}if(P.bWriteAudEnc&&P.iAudioEncBufferSize>=Xe){var g=new Uint8Array(P.aAudioEncBuffer);P.downloadFile(g,"Enc.AAC");P.aAudioEncBuffer.splice(0,P.aAudioEncBuffer.length);P.bWriteAudEnc=false;P.iAudioEncBufferSize=0;g=null}}else{if(Ae){console.log(">>>JS MainThread-GetAudEncodeData 2 err")}}break;default:break}if("GetFrameData"!==t||"GetAudEncodeData"!==t){P.setCallBack(P,t,0,P.convertErrorCode(n.errorCode),true)}else{if(oe===n.errorCode||pe===n.errorCode||de===n.errorCode||ae===n.errorCode){P.setCallBack(P,t,0,P.convertErrorCode(n.errorCode),true)}}}}};this.createWorker(w);this.draw=function(){if(w.bPlay){if(!w.bPause||w.bOnebyOne){requestAnimationFrame(w.draw);var e=w.aVideoFrameBuffer.length;if(w.YUVBufSizeCBFun!=null){w.YUVBufSizeCBFun(e)}if(w.bOnebyOne){if(e<=Je){w.setCallBack(w,"OnebyOne",0,se,true)}if(e<=w.FrameForwardLen+1){w.setCallBack(w,"OnebyOne",0,se,true);return}else{var t=w.FrameForwardLen;while(t>1){var n=w.aVideoFrameBuffer.shift();t--}}w.bOnebyOne=false}if(Ae){console.log(">>>JS Draw aVideoFrameBuffer.length == "+e)}if(e>w.YUVBufferSize){var i=w.aVideoFrameBuffer.shift();if(w.SetPlayPositionFlag){if(Ae){console.log(">>>JS SetPlayPositionFlag frameNumOrTime:"+w.iFrameNumOrTime+",currentFrameNum:"+i.frameNum)}if(i.frameNum!=w.iFrameNumOrTime){if(Ae){console.log(">>>JS frameNum!= frameNumOrTime:"+i.frameNum)}return}if(w.bSetPlayPositionType===Ie){w.bPause=true}w.SetPlayPositionFlag=false}if(Ae){console.log(">>>after display frameNum:"+i.frameNum)}w.aDisplayBuf=i.data;var r=new Uint8Array(w.aDisplayBuf);if(Ae){console.log(">>>JS SR_DisplayFrameData 1 nWidth:%d, nHeight:%d, nWidth1:%d, nHeight1:%d",i.nWidth,i.nHeight,w.nWidth,w.nHeight)}w.oSuperRender.SR_DisplayFrameData(i.nWidth,i.nHeight,r,i.nWidth-w.nSPSCropLeft-w.nSPSCropRight,i.nHeight-w.nSPSCropTop-w.nSPSCropBottom);if(w.DisplayCallBackFun!=null){if(Ae){console.log(">>>JS MainThread-DisplayCallBackFun")}w.DisplayInfoYUV.height=i.nHeight;w.DisplayInfoYUV.width=i.nWidth;w.DisplayInfoYUV.frameNum=i.frameNum;w.DisplayInfoYUV.yuvData=new Uint8Array(r);w.DisplayCallBackFun(w.DisplayInfoYUV)}if(Ae&&w.bOnebyOne){console.log("OneByOne frameNum:"+i.frameNum)}if(Ae){console.log(">>>JS SR_DisplayFrameData 2 nWidth:%d, nHeight:%d, nWidth1:%d, nHeight1:%d",i.nWidth,i.nHeight,w.nWidth,w.nHeight)}r=null;w.szOSDTime=i.osdTime;i=null}else{w.setCallBack(w,"Play",0,se,true)}}}else{if(!w.bPlay){if(Ae){console.log(">>>JS mainThread stop play jsplaySDKInterface")}w.aVideoFrameBuffer.splice(0,w.aVideoFrameBuffer.length);w.aAudioBuffer.splice(0,w.aAudioBuffer.length)}}};this.checkAudioType=function(e){var i=function i(e,t){var n=e[t]&255|(e[t+1]&255)<<8|(e[t+2]&255)<<16|(e[t+3]&255)<<24;return n};var t=[e[12],e[13],0,0];var n=i(t,0);switch(n){case we.AUDIO_G711_A:case we.AUDIO_G711_U:case we.AUDIO_G722_1:case we.AUDIO_G726_2:case we.AUDIO_G726_A:case we.AUDIO_G726_U:case we.AUDIO_AACLC:case we.AUDIO_MPEG:case we.AUDIO_ADPCM:return ne;default:return oe}}}Q(a,[{key:"PlayM4_SetCurrentFrameNum",value:function n(e,t){if(this.decodeWorker==null||this.oSuperRender==null){return ie}if(!this.bPlay){return ie}if(e<0){return te}if(t!==0&&t!==1){return te}return this.PlayM4_SetPlayPosition(0,e,t)}},{key:"PlayM4_SetPlayPosition",value:function i(e,t,n){if(this.decodeWorker==null||this.oSuperRender==null){return ie}if(!this.bPlay){return ie}if(e!==0&&e!==1){return te}if(t<0){return te}if(n!==0&&n!==1){return te}this.SetPlayPositionFlag=true;this.iFrameNumOrTime=t;this.bSetPlayPositionType=n;this.decodeWorker.postMessage({command:"SetPlayPosition",data:this.iFrameNumOrTime,type:e});this.aAudioBuffer.splice(0,this.aAudioBuffer.length);this.iAudioBufferSize=0;this.aVideoFrameBuffer.splice(0,this.aVideoFrameBuffer.length);this.aInputDataBuffer.splice(0,this.aInputDataBuffer.length);this.aInputDataLens.splice(0,this.aInputDataLens.length);this.bIsFirstFrame=true;this.bIsInputBufOver=false;return ne}},{key:"PlayM4_OpenPlayerSDKPrintLog",value:function t(e){if(e===true){Ae=true;this.decodeWorker.postMessage({command:"printLog",data:e})}else{Ae=false;this.decodeWorker.postMessage({command:"printLog",data:e})}return ne}},{key:"PlayM4_DownloadYUVdata",value:function e(){this.bWriteYUVData=true;return ne}},{key:"PlayM4_DownloadPCMdata",value:function r(){this.bWritePCMData=true;return ne}},{key:"PlayM4_SetDecCallBack",value:function o(e){if(Ae){console.log(">>>JS MainThread-PlayM4_SetDecCallBack")}if(e&&typeof e==="function"){this.DecCallBackFun=e;return ne}else{return te}}},{key:"PlayM4_SetDisplayCallBack",value:function s(e){if(Ae){console.log(">>>JS MainThread-PlayM4_SetDisplayCallBack")}if(e&&typeof e==="function"){this.DisplayCallBackFun=e;return ne}else{return te}}},{key:"PlayM4_SetPCMCallBack",value:function u(e){if(Ae){console.log(">>>JS MainThread-PlayM4_SetDisplayCallBack")}if(e&&typeof e==="function"){this.PCMCallBackFun=e;return ne}else{return te}}},{key:"PlayM4_SetStreamOpenMode",value:function l(e){if(e==null||e===undefined){return te}if(e!==be&&e!==Ce){return te}this.streamOpenMode=e;if(Ae){console.log(">>>JS PlayM4_SetStreamOpenMode nMode:"+e)}return ne}},{key:"PlayM4_DownloadRTPData",value:function f(e){this.downloadRTP=e}},{key:"PlayM4_OpenStream",value:function c(e,t,n){if(Ae){console.log(">>>JS PlayM4_OpenStream 1 nSysTime:"+((new Date).getMonth()+1)+"-"+(new Date).getDate()+" "+(new Date).getHours()+":"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds())}if(this.decodeWorker==null){return ie}if(this.downloadRTP){var i=new Uint8Array(e.buffer);this.DownloadRTPData(i);console.log("write 40 hik head")}if(e==null||t<=0||n<=0){return te}this.bPlay=false;this.bPause=false;this.bOnebyOne=false;this.bIsFirstFrame=true;this.bIsGetYUV=false;this.bIsInput=false;var r=this.checkAudioType(e);if(ne!==r){this.bAudioTypeSupport=false}else{this.bAudioTypeSupport=true}this.decodeWorker.postMessage({command:"SetStreamOpenMode",data:this.streamOpenMode});if(Ae){console.log(">>>JS PlayM4_OpenStream 2 nSysTime:"+((new Date).getMonth()+1)+"-"+(new Date).getDate()+" "+(new Date).getHours()+":"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds())}this.decodeWorker.postMessage({command:"OpenStream",data:e,dataSize:t,bufPoolSize:n});if(Ae){console.log(">>>JS PlayM4_OpenStream 3 nSysTime:"+((new Date).getMonth()+1)+"-"+(new Date).getDate()+" "+(new Date).getHours()+":"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds())}this.bOpenStream=true;return ne}},{key:"PlayM4_CloseStream",value:function h(){if(Ae){console.log(">>>JS PlayM4_CloseStream 1 nSysTime:"+((new Date).getMonth()+1)+"-"+(new Date).getDate()+" "+(new Date).getHours()+":"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds())}if(this.decodeWorker===null||this.bOpenStream===false){return ie}this.bOnlyPlaySound=false;this.PlayM4_Stop();this.decodeWorker.postMessage({command:"CloseStream"});if(this.oSuperRender!==null){this.oSuperRender.SR_Destroy();this.oSuperRender=null}if(this.audioRenderer!==null){this.audioRenderer.Stop();this.audioRenderer=null}this.aAudioBuffer.splice(0,this.aAudioBuffer.length);this.aVideoFrameBuffer.splice(0,this.aVideoFrameBuffer.length);this.aInputDataBuffer.splice(0,this.aInputDataBuffer.length);this.aInputDataLens.splice(0,this.aInputDataLens.length);this.aAudioEncBuffer.splice(0,this.aAudioEncBuffer.length);this.aVideoYUVBuffer.splice(0,this.aVideoYUVBuffer.length);this.aAudioPCMBuffer.splice(0,this.aAudioPCMBuffer.length);this.aRawDataBuffer.splice(0,this.aRawDataBuffer.length);this.bOpenStream=false;this.iAudioBufferSize=0;this.szOSDTime=null;return ne}},{key:"PlayM4_Destroy",value:function d(){if(Ae){console.log(">>>JS PlayM4_Destroy 1 nSysTime:"+((new Date).getMonth()+1)+"-"+(new Date).getDate()+" "+(new Date).getHours()+":"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds())}if(this.decodeWorker===null){return ne}this.PlayM4_CloseStream();this.decodeWorker.terminate();this.decodeWorker=null;return ne}},{key:"PlayM4_InputData",value:function p(e,t){var n=this.aInputDataBuffer.length;if(t===4){var i=new Uint8Array(e.buffer);if(i[0]===1&&i[1]===2&&i[2]===3&&i[3]===4){if(Ae){console.log(">>>JS PlaySDKInterface PlayM4_InputData:intput end")}if(this.bIsFirstFrame){if(Ae){console.log(">>>JS inputData FirstTime")}this.inputDataFun()}else{if(this.bIsGetYUV){this.inputDataFun()}else{this.bIsInput=true}}i=null;return ne}}if(n+t>this.iInputMaxBufSize){console.log("input over");this.inputDataFun();return re}var r=null;var o=t;switch(this.streamOpenMode){case Ce:r=new Uint8Array(e.buffer);if(this.downloadRTP){this.DownloadRTPData(r);this.rtpNum++;console.log("STREAM_FILE psNUm:"+this.rtpNum)}this.aInputDataLens.push(t);break;case be:o=t+4;var s=new Uint32Array([t]);var a=new Uint8Array(s.buffer);r=new Uint8Array(o);r.set(a,0);r.set(e,4);if(this.downloadRTP){this.DownloadRTPData(r);this.rtpNum++;console.log("STREAM_REALTIME rtpNUm:"+this.rtpNum)}s=null;a=null;this.aInputDataLens.push(t+4);break;default:return oe}for(var u=0;u<o;u++){this.aInputDataBuffer[n+u]=r[u]}if(!this.bPlay||this.decodeWorker===null||this.bOpenStream===false){return ne}r=null;if(Ae){console.log(">>>JS PlayM4_InputData 1锛� nSize:%d, iInputBufLen:%d, iInputMaxBufSize;%d",t,this.aInputDataBuffer.length,this.iInputMaxBufSize)}if(this.bOnlyPlaySound){if(Ae){console.log(">>>JS PlayM4_InputData: OnlyPlaySound")}this.inputDataFun()}else{if(this.bIsFirstFrame){if(Ae){console.log(">>>JS PlayM4_InputData is firstFrame")}this.inputDataFun()}else{if(this.bIsGetYUV){if(Ae){console.log(">>>JS PlayM4_InputData is GetYUV")}this.inputDataFun()}else{if(Ae){console.log(">>>JS PlayM4_InputData 1-3 sysTime:"+((new Date).getMonth()+1)+"-"+(new Date).getDate()+" "+(new Date).getHours()+":"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds())}this.bIsInput=true}}}return ne}},{key:"DownloadRTPData",value:function v(e){if(this.bWriteRTPData){var t=new Uint8Array(e);var n=this.aRTPDataBuffer.length;for(var i=0,r=t.length;i<r;i++){this.aRTPDataBuffer[n+i]=t[i]}this.iRTPDataSize++;t=null}if(this.bWriteRTPData&&this.iRTPDataSize>=xe){console.log("download"+xe+"RTPdata");var o=new Uint8Array(this.aRTPDataBuffer);this.downloadFile(o,"RTP.data");this.aRTPDataBuffer.splice(0,this.aRTPDataBuffer.length);this.bWriteRTPData=false;this.iRTPDataSize=0;this.rtpNum=0;this.downloadRTP=false;o=null}}},{key:"PlayM4_Play",value:function m(e){if(this.decodeWorker===null){return ie}if(Ae){console.log(">>>JS PlayM4_Play canvasID: "+e)}if(e===null){this.bOnlyPlaySound=true;this.sCanvasId=null}else{if(typeof e!=="string"){return te}if(this.bOnebyOne){this.bPlayRateChange=false;this.bOnebyOne=false;this.bPause=false;this.draw()}if(this.bPlay){return ne}if(this.oSuperRender==null){this.oSuperRender=new SuperRender(e,this.szBasePath);if(this.oSuperRender==null){return le}}this.sCanvasId=e;this.bPlay=true;this.bPause=false;this.bOnebyOne=false;this.bPlaySound=false;this.bPlayRateChange=false;this.bOnlyPlaySound=false;this.draw()}if(this.audioRenderer==null){this.audioRenderer=new AudioRenderer;if(this.audioRenderer==null){return le}}return ne}},{key:"PlayM4_Stop",value:function y(){if(Ae){console.log(">>>JS PlayM4_Stop 1")}if(this.decodeWorker==null||this.oSuperRender==null){return ie}if(!this.bPlay){return ie}if(this.bPlaySound){this.PlayM4_StopSound();this.bPlaySound=true}this.bPlay=false;this.bOnebyOne=false;this.bPause=false;this.oSuperRender.SR_SetDisplayRect(null);this.iZoomNum=0;this.bDisRect=false;this.oSuperRender.SR_DisplayFrameData(this.nWidth,this.nHeight,null);return ne}},{key:"PlayM4_PlayRate",value:function g(e){if(this.decodeWorker==null){return ie}if(e===1){this.bPlayRateChange=false}else{this.bPlayRateChange=true}if(e<1){e=1}this.iInputDataLen=e*De;return ne}},{key:"PlayM4_Pause",value:function P(e){if(this.decodeWorker==null||this.oSuperRender==null){return ie}if(!this.bPlay){return ie}if(this.bOnebyOne){return ie}if(typeof e!=="boolean"){return te}this.bPause=e;this.bIsFirstFrame=true;if(Ae){console.log(">>>JS PlayM4_Pause:"+e)}if(e){if(this.bPlaySound){this.PlayM4_StopSound();this.bPlaySound=true}}else{if(this.bPlaySound){this.PlayM4_PlaySound()}this.draw()}return ne}},{key:"PlayM4_OneByOne",value:function w(e){if(this.decodeWorker==null||this.oSuperRender==null){return ie}if(!this.bPlay){return ie}if(e>10||e<=0){return te}if(!e){e=1}this.iInputDataLen=De;this.FrameForwardLen=e;this.bPause=true;this.bOnebyOne=true;this.bIsFirstFrame=true;this.draw();return ne}},{key:"PlayM4_PlaySound",value:function S(e){if(this.decodeWorker===null||this.bOpenStream===false){return ie}if(!this.bAudioTypeSupport){return oe}if(e<0||e>16){return te}if(this.audioRenderer==null){this.audioRenderer=new AudioRenderer;if(this.audioRenderer==null){return le}}this.audioRenderer.SetWndNum(e);this.audioRenderer.oAudioContext.resume();this.bPlaySound=true;return ne}},{key:"PlayM4_StopSound",value:function _(){if(this.decodeWorker==null||this.audioRenderer==null){return ie}if(!this.bPlaySound){return ie}this.bPlaySound=false;return ne}},{key:"PlayM4_SetDisplayBuf",value:function b(e){if(this.decodeWorker==null){return ie}if(e<=0){return te}this.YUVBufferSize=e;return ne}},{key:"PlayM4_SetSecretKey",value:function C(e,t,n){if(this.decodeWorker==null||this.bOpenStream===false){return ie}if(t==null){return te}if(_e===e){if(128===n){if(t==null||t===undefined){return te}}else{return te}}else if(Se===e){}else{return te}this.decodeWorker.postMessage({command:"SetSecretKey",data:t,nKeyType:e,nKeyLen:n});return ne}},{key:"PlayM4_SetDecodeFrameType",value:function k(e){if(this.decodeWorker==null||this.oSuperRender==null){return ie}if(e!==ke&&e!==Te){return te}if(Ae){console.log(">>>JS PlayM4_SetDecodeFrameType");console.log(e)}this.nDecFrameType=e;this.decodeWorker.postMessage({command:"SetDecodeFrameType",data:e});return ne}},{key:"PlayM4_SetIFrameDecInterval",value:function T(e){if(this.nDecFrameType!==Te){return ie}if(e<0){return te}this.decodeWorker.postMessage({command:"SetIFrameDecInterval",data:e});return ne}},{key:"PlayM4_SetLostFrameMode",value:function R(e){if(e<0||e>1){return te}this.decodeWorker.postMessage({command:"SetLostFrameMode",data:e});return ne}},{key:"PlayM4_SetDisplayRegion",value:function D(e,t){if(Ae){console.log("PlayM4_SetDisplayRegion ")}if(this.decodeWorker===null||this.bPlay===false||this.oSuperRender===null){return ie}if(this.canvasId===null){return ie}if(t===true){if(e===null||e===undefined){if(Ae){console.log("PlayM4_SetDisplayRegion: dipalyRect is null")}return te}if(typeof e.left==="number"&&typeof e.top==="number"&&typeof e.right==="number"&&typeof e.bottom==="number"){if(e.right<0||e.left<0||e.top<0||e.bottom<0){if(Ae){console.log("PlayM4_SetDisplayRegion: dipalyRect rectParameter is wrong")}return te}var n=e.left;var i=e.right;var r=e.top;var o=e.bottom;var s=document.getElementById(this.sCanvasId).getBoundingClientRect();this.iCanvasWidth=s.width;this.iCanvasHeight=s.height;if(i-n<16||o-r<16||i-n>this.iCanvasWidth||o-r>this.iCanvasHeight){return te}if(this.iZoomNum!==0){n=Math.round(n/this.iRatio_x)+this.stDisplayRect.left;r=Math.round(r/this.iRatio_y)+this.stDisplayRect.top;i=Math.round(i/this.iRatio_x)+this.stDisplayRect.left;o=Math.round(o/this.iRatio_y)+this.stDisplayRect.top}this.stDisplayRect={top:r,left:n,right:i,bottom:o};this.oSuperRender.SR_SetDisplayRect(this.stDisplayRect);this.bDisRect=true;var a=i-n;var u=o-r;this.iRatio_x=this.iCanvasWidth/a;this.iRatio_y=this.iCanvasHeight/u;this.iZoomNum++}else{return te}}else{this.oSuperRender.SR_SetDisplayRect(null);this.iZoomNum=0;this.bDisRect=false}if(this.bPause||this.bOnebyOne||this.bPlayRateChange){this.oSuperRender.SR_DisplayFrameData(this.nWidth,this.nHeight,new Uint8Array(this.aDisplayBuf))}return ne}},{key:"PlayM4_GetBMP",value:function x(e){return this.getPic(e,"GetBMP")}},{key:"PlayM4_GetJPEG",value:function I(e){return this.getPic(e,"GetJPEG")}},{key:"PlayM4_SetVolume",value:function E(e){if(this.decodeWorker==null){return ie}if(this.audioRenderer==null){return ie}if(e<0||e>100){return te}this.audioRenderer.SetVolume(e/100);return ne}},{key:"PlayM4_GetVolume",value:function q(e){if(this.decodeWorker==null){return ie}if(this.audioRenderer==null){return ie}if(e&&typeof e==="function"){var t=this.audioRenderer.GetVolume();if(t===null){return fe}else{e(Math.round(t*10)*10);return ne}}else{return te}}},{key:"PlayM4_GetOSDTime",value:function A(e){if(this.decodeWorker==null){return ie}if(!this.bPlay){return ie}if(e&&typeof e==="function"){e(this.szOSDTime);return ne}else{return te}}},{key:"PlayM4_IsVisible",value:function O(e){this.bVisibility=e;if(Ae){console.log(">>>JS PlayM4_IsVisible visibility:"+e)}return ne}},{key:"PlayM4_GetSdkVersion",value:function M(){return"07020146"}},{key:"PlayM4_GetBuildDate",value:function L(){return"20211104"}},{key:"PlayM4_GetInputBufSize",value:function F(){return this.aInputDataBuffer.length}},{key:"PlayM4_SetInputBufSize",value:function W(e){if(e>0){this.iInputMaxBufSize=e;return ne}else{return te}}},{key:"PlayM4_GetYUVBufSize",value:function N(){return this.aVideoFrameBuffer.length}},{key:"PlayM4_GetFrameResolution",value:function B(e){if(this.decodeWorker==null){return ie}if(e&&typeof e==="function"){e(this.nWidth,this.nHeight);return ne}else{return te}}},{key:"PlayM4_RegisterYUVBufSizeCB",value:function z(e){if(e&&typeof e==="function"){this.YUVBufSizeCBFun=e;return ne}else{return te}}},{key:"PlayM4_UnRegisterYUVBufSizeCB",value:function J(){if(this.YUVBufSizeCBFun!=null){this.YUVBufSizeCBFun=null}return ne}},{key:"PlayM4_ClearCanvas",value:function H(){if(this.oSuperRender==null){return ie}this.oSuperRender.SR_DisplayFrameData(this.nWidth,this.nHeight,null);return ne}},{key:"PlayM4_ReleaseInputBuffer",value:function U(){if(this.aInputDataBuffer===null){return ie}this.aInputDataBuffer.splice(0,this.aInputDataBuffer.length);this.aInputDataLens.splice(0,this.aInputDataLens.length);return ne}},{key:"PlayM4_GetDecodeFrameType",value:function j(){return this.nDecFrameType}},{key:"PlayM4_CreateAudEncode",value:function G(e){if(Ae){console.log(">>>JS PlayM4_CreateAudEncode 1 nEncoderType:"+e)}if(this.decodeWorker==null){return he}if(e<ve||e>ye||e===me){return ce}this.decodeWorker.postMessage({command:"CreateAudEncode",encodertype:e});if(Ae){console.log(">>>JS PlayM4_CreateAudEncode 2 nEncoderType:"+e)}return ne}},{key:"PlayM4_SetAudEncodeParam",value:function V(e,t,n,i){if(Ae){console.log(">>>JS PlayM4_SetAudEncodeParam 1 nSampleRate:"+e+",nChannel:"+t+" ,nBitRate:"+n+" ,nBitWidth:"+i)}if(this.decodeWorker==null){return he}if(t!=ge||i!=Pe){return ce}this.decodeWorker.postMessage({command:"SetAudEncodeParam",samplerate:e,channel:t,bitrate:n,bitwidth:i});if(Ae){console.log(">>>JS PlayM4_SetAudEncodeParam 2 nSampleRate:"+e+",nChannel:"+t+" ,nBitRate:"+n+" ,nBitWidth:"+i)}return ne}},{key:"PlayM4_InputAudEncodeData",value:function Y(e,t){if(Ae){console.log(">>>JS PlayM4_InputAudEncodeData 1 dataSize:"+t)}if(this.decodeWorker==null){return he}if(Ae){console.log(">>>JS  PlayM4_InputAudEncodeData 2 dataSize:"+t+", nSysTime:"+(new Date).getMinutes()+":"+(new Date).getSeconds()+"."+(new Date).getMilliseconds())}this.decodeWorker.postMessage({command:"InputAudEncodeData",data:e,dataSize:t});return ne}},{key:"PlayM4_DestroyAudEncode",value:function X(){if(Ae){console.log(">>>JS MainThread-PlayM4_DestroyAudEncode 1 ")}if(this.decodeWorker==null){return he}this.aAudioEncBuffer.splice(0,this.aAudioEncBuffer.length);this.iAudioEncBufferSize=0;this.decodeWorker.postMessage({command:"DestroyAudEncode"});return ne}},{key:"PlayM4_GetAudioEmcBuf",value:function Z(){return this.aAudioEncBuffer}},{key:"PlayM4_RegisterAudEncodeCB",value:function K(e){if(Ae){console.log(">>>JS PlayM4_RegisterAudEncodeCB 1 callback:"+e)}if(e&&typeof e==="function"){this.AudEncodeDataCBFun=e;if(Ae){console.log(">>>JS PlayM4_RegisterAudEncodeCB 2 callback:"+e)}return ne}else{return te}}},{key:"downloadFile",value:function $(e,t){var n=e;if(!(e instanceof Blob||e instanceof File)){n=new Blob([e])}var i=window.URL.createObjectURL(n);var r=window.document.createElement("a");r.href=i;r.download=t;var o=document.createEvent("MouseEvents");o.initEvent("click",true,true);r.dispatchEvent(o)}}]);return a}()},function(e,i,r){"use strict";(function(h){Object.defineProperty(i,"__esModule",{value:true});i.StorageManager=undefined;var l=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(e,t,n){if(t)i(e.prototype,t);if(n)i(e,n);return e}}();var e=r(8);var d=t(e);var f=r(38);function t(e){return e&&e.__esModule?e:{"default":e}}function p(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var c="Web/RecordFiles/";var v="Web/PlaybackFiles/";var m=1e3;var s=1;var y=3001;window.requestFileSystem=window.requestFileSystem||window.webkitRequestFileSystem;window.URL=window.URL||window.webkitURL;var u=function(){function r(e,t,n,i){p(this,r);this.szUUID=e;this.szFileName=t;this.iStreamType=n;this.szPath="";this.bStart=false;this.aStreamList=[];this.options=i}l(r,[{key:"init",value:function t(){var n=this;if(0===this.iStreamType){this.szPath=c}else if(1===this.iStreamType){this.szPath=v}this.szPath+=this.getDateDir();var i=n.szPath.split("/");var e=new Promise(function(t){window.requestFileSystem(window.TEMPORARY,n.options.iFileSize,function(e){n.createDir(e.root,i,function(){t()})},n.errorHandler)});return e}},{key:"getDateDir",value:function e(){return f.oTool.dateFormat(new Date,"yyyy-MM-dd")}},{key:"createDir",value:function o(e,t,n){var i=this;if(t.length){e.getDirectory(t[0],{create:true},function(e){i.createDir(e,t.slice(1),n)},i.errorHandler)}else{n()}}},{key:"errorHandler",value:function n(){}},{key:"writeFileHeader",value:function s(n){var i=this;window.requestFileSystem(window.TEMPORARY,i.options.iFileSize,function(e){e.root.getFile(i.szPath+"/"+i.szFileName,{create:true},function(e){e.createWriter(function(e){e.onwriteend=function(){i.bStart=true;i.writeFile(e)};e.onerror=function(){};e.seek(e.length);var t=new Blob([n]);e.write(t)},i.errorHandler)},i.errorHandler)},i.errorHandler)}},{key:"writeFileContent",value:function i(e){this.aStreamList.push(e)}},{key:"writeFile",value:function a(e){var t=this;if(this.bStart){if(this.aStreamList.length>0){var n=this.aStreamList.shift();e.seek(e.length);if(e.length>=this.options.iFileSize){if(this.options.cbEventHandler){this.options.cbEventHandler(y,this.szUUID)}return}var i=new Blob([n]);e.write(i)}else{setTimeout(function(){t.writeFile(e)},m)}}}},{key:"stopWriteFile",value:function u(){var i=this;this.bStart=false;this.aStreamList.length=0;var e=new Promise(function(t,n){window.requestFileSystem(window.TEMPORARY,i.options.iFileSize,function(e){e.root.getFile(i.szPath+"/"+i.szFileName,{create:false},function(e){e.file(function(e){t();f.oTool.downloadFile(e,e.name)})},function(){n()})},function(){n()})});return e}}]);return r}();var g=function(){function a(e,t,n,i,r,o,s){p(this,a);this.szBasePath=e;this.szUUID=t;this.szFileName=n;this.aHeadBuf=new Uint8Array(i);this.iPackType=r;this.iStreamType=o;this.oWorker=null;this.oFileSystem=null;this.options=s}l(a,[{key:"init",value:function t(){var n=this;var e=new Promise(function(e,t){n.initFileSystem().then(function(){n.initWorker().then(function(){e(n.szUUID)},function(e){t(e)})},function(e){t(e)})});return e}},{key:"initFileSystem",value:function i(){var n=this;this.oFileSystem=new u(this.szUUID,this.szFileName,this.iStreamType,this.options);var e=new Promise(function(e,t){n.oFileSystem.init().then(function(){e()},function(e){t(e)})});return e}},{key:"initWorker",value:function n(){var r=this;var e=new Promise(function(i){r.oWorker=new Worker(r.szBasePath+"/systemTransform-worker.min.js");r.oWorker.onmessage=function(e){var t=e.data;if("loaded"===t.type){r.oWorker.postMessage({type:"create",buf:r.aHeadBuf.buffer,len:40,packType:r.iPackType},[r.aHeadBuf.buffer])}else if("created"===t.type){i()}else if("outputData"===t.type){var n=new Uint8Array(t.buf);if(s===t.dType){r.oFileSystem.writeFileHeader(n)}else{r.oFileSystem.writeFileContent(n)}}}});return e}},{key:"inputData",value:function r(e){if(this.oWorker){var t=new Uint8Array(e);this.oWorker.postMessage({type:"inputData",buf:t.buffer,len:t.length},[t.buffer])}}},{key:"stopRecord",value:function o(){var n=this;var e=new Promise(function(e,t){if(n.oWorker){n.oWorker.postMessage({type:"release"})}else{t()}if(n.oFileSystem){n.oFileSystem.stopWriteFile().then(function(){e()},function(){t()})}else{t()}});return e}}]);return a}();var n=function(){var c=Symbol("STORAGELIST");var e=function(){function n(e,t){p(this,n);this.szBasePath=e;this[c]={};this.options={iFileSize:1024*1024*1024};h.extend(this.options,t)}l(n,[{key:"startRecord",value:function f(e,t,n,i,r){var o=this;var s=d["default"].v4();var a=h.extend({},this.options,r);var u=new g(this.szBasePath,s,e,t,n,i,a);var l=new Promise(function(t,n){u.init().then(function(e){o[c][e]=u;t(e)},function(e){n(e)})});return l}},{key:"inputData",value:function i(e,t){var n=this[c][e];if(n){n.inputData(t)}}},{key:"stopRecord",value:function t(i){var r=this;var e=new Promise(function(e,t){var n=r[c][i];if(n){n.stopRecord().then(function(){delete r[c][i];e()},function(){t()})}else{t()}});return e}}]);return n}();return e}();i.StorageManager=n}).call(this,r(1))},function(e,t,n){"use strict";(function(K){Object.defineProperty(t,"__esModule",{value:true});var $=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(e,t,n){if(t)i(e.prototype,t);if(n)i(e,n);return e}}();function p(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function m(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t}function Q(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var e=function(){var D=null;var x=Symbol("CANVAS");var I=Symbol("CONTEXT");var E=Symbol("SHAPES");var q=Symbol("DRAWSTATUS");var A=Symbol("SHAPETYPE");var O=Symbol("MAXSHAPENUMSUPPORT");var M=Symbol("SHAPESTYLE");var L=Symbol("POLYGONDRAWING");var F=Symbol("LINEDRAWING");var W=Symbol("CURRENTSHAPEINFO");var N=Symbol("DRAWSHAPEMULTIONETIME");var B=Symbol("EVENTCALLBACK");var z=Symbol("DRAWEVENTCALLBACK");var o=null;function J(e){D[I].clearRect(0,0,D.m_iCanvasWidth,D.m_iCanvasHeight);if(o&&e==="canvasRedraw"){o.setPointInfo(D.resizeCanvasPoints(o.m_aPoint));o.draw()}for(var t=0,n=D[E].length;t<n;t++){if(e==="canvasRedraw"){D[E][t].setPointInfo(D.resizeCanvasPoints(D[E][t].m_aPoint))}D[E][t].draw()}}function H(e){var t=D[E].length;if(t<D[O]){D[E].push(e);o=null}}function U(){var a=false;var u=0;var l=0;var f="draw";var c=null;function r(){var e=-1;for(var t=0,n=D[E].length;t<n;t++){if(D[E][t].m_bChoosed){e=t;break}}return e}D[x][0].oncontextmenu=function(){return false};D[x][0].onselectstart=function(){return false};D[x].unbind();D[x].bind("mousedown",function(e){if(e.button===2){if(D[L]&&c){if(c.m_aPoint.length>=c.m_iMinClosed){c.m_bClosed=true;D[L]=false;c.setPointInfo(c.m_aPoint);H(c);J();a=false;if(!D[N]&&0===c.m_iRedrawMode){D[q]=false}D[z]&&D[z]({id:+c.m_szId,type:c.m_szType,event:"drawEnd"})}}if(D[F]&&c){if(c.m_aPoint.length>=c.m_iMinClosed){c.m_bClosed=true;D[F]=false;D[q]=false;c.setPointInfo(c.m_aPoint);H(c);J()}}}else if(e.button===0){u=e.offsetX;l=e.offsetY;f="draw";if(!D[L]){var t=r();if(t!==-1){if(D[E][t].inArc(e.offsetX,e.offsetY,5)){f="stretch"}}if(f!=="stretch"){for(var n=0,i=D[E].length;n<i;n++){if(D[E][n].inShape(e.offsetX,e.offsetY)&&D[E][n].m_iEditType!==2){D[E][n].m_bChoosed=true;D[E][n].getMouseDownPoints(e.offsetX,e.offsetY);f="drag";D[z]&&D[z]({id:+D[E][n].m_szId,type:D[E][n].m_szType,event:"choosed"})}else{D[E][n].m_bChoosed=false}}}if(f==="drag"){D[x][0].style.cursor="move"}else{D[x][0].style.cursor="default"}if("draw"===f&&1===D[E].length&&1===D[E][0].m_iRedrawMode&&D[q]){D.deleteRepeatByIdAndType(D[E][0].m_szId,D[E][0].m_szType)}}if(f==="draw"){if(D[q]){if(D[O]<=D[E].length&&D[A]!=="Grid"&&D[A]!=="Point"){return}if(D[A]==="Rect"){c=new j;c.m_szId=D[W].szId||"";c.m_szTips=D[W].szTips||"";c.m_iRedrawMode=D[W].iRedrawMode}else if(D[A]==="Grid"){if(D[E].length===0){c=new V;H(c)}}else if(D[A]==="Polygon"){if(!D[L]){D[L]=true;c=new X;c.m_szId=D[W].szId||"";c.m_szTips=D[W].szTips||"";c.m_iMinClosed=D[W].iMinClosed||3;c.m_iMaxPointNum=D[W].iMaxPointNum||11;c.m_iPolygonType=D[W].iPolygonType;c.m_szDrawColor=D[W].szDrawColor;c.m_szFillColor=D[W].szFillColor;c.m_iTranslucent=D[W].iTranslucent;c.m_iRedrawMode=D[W].iRedrawMode;o=c}if(c.m_iPolygonType===1){c.addPoint(u,l);if(c.m_aPoint.length===c.m_iMaxPointNum){c.m_bClosed=true;D[L]=false;H(c);J();a=false;if(!D[N]&&0===c.m_iRedrawMode){D[q]=false}D[z]&&D[z]({id:+c.m_szId,type:c.m_szType,event:"drawEnd"})}}}else if(D[A]==="Point"){D.clearShapeByType("Point");c=new Z;c.m_szId=D[W].szId||"";c.m_szDrawColor=D[W].szDrawColor;c.m_szTips=D[W].tips||"";c.m_iEditType=D[W].editType||0;c.m_szPointType=D[W].type||"circle";c.setPointInfo([[u,l]]);H(c);J()}else if(D[A]==="Line"){if(!D[F]){D[F]=true;c=new Y;c.m_szId=D[W].szId||"";c.m_szTips=D[W].szTips||"";c.m_szDrawColor=D[W].szDrawColor;c.m_iMinClosed=D[W].iMinClosed||2;c.m_iMaxPointNum=D[W].iMaxPointNum||2;c.m_iLineType=D[W].lineType||0;o=c}c.addPoint(u,l);if(c.m_aPoint.length===c.m_iMaxPointNum){c.m_bClosed=true;D[F]=false;D[q]=false;H(c);J();a=false;D[z]&&D[z]({id:+c.m_szId,type:c.m_szType,event:"drawEnd"})}}}}a=true}});D[x].bind("mousemove",function(e){if(!D[L]&&!D[F]){var t=r();if(t>-1){if(a){if(f==="drag"){D[E][t].drag(e.offsetX,e.offsetY)}else if(f==="stretch"){D[E][t].stretch(e.offsetX,e.offsetY);D[z]&&D[z]({id:+D[E][t].m_szId,type:D[E][t].m_szType,event:"stretch"})}}}else{if(D[q]){if(a){if(D[A]==="Rect"){c.move([[u,l],[e.offsetX,e.offsetY]])}else if(D[A]==="Grid"){D[E][0].move(u,l,e.offsetX,e.offsetY)}}}}}else if(D[L]){if(D[q]){if(a){if(D[A]==="Polygon"&&c.m_iPolygonType===0){c.m_bClosed=true}J();c.move(e.offsetX,e.offsetY,u,l)}}}else if(D[F]){if(D[q]){if(a){J();c.move(e.offsetX,e.offsetY)}}}});D[x].bind("mouseup",function(e){D[x][0].style.cursor="default";if(c!==null&&typeof c!=="undefined"&&f==="draw"&&D[q]){if(D[A]==="Rect"){if(Math.abs(e.offsetX-u)>2&&Math.abs(e.offsetY-l)>2){H(c);if(!D[N]&&0===c.m_iRedrawMode&&1===D[O]){D[q]=false}D[z]&&D[z]({id:+c.m_szId,type:c.m_szType,event:"drawEnd"})}if(D[B]){var t={id:+c.m_szId,startPos:[],endPos:[],tips:c.m_szTips};if(c.m_aPoint[0]&&c.m_aPoint[2]){try{var n=void 0;var i=void 0;var r=void 0;var o=void 0;if(e.offsetX>u&&e.offsetY>l){t.startPos=c.m_aPoint[0]||[e.offsetX,e.offsetY];t.endPos=c.m_aPoint[2]||[e.offsetX,e.offsetY];n=c.m_aPoint[0][0]/D.m_iCanvasWidth;i=c.m_aPoint[0][1]/D.m_iCanvasHeight;r=c.m_aPoint[2][0]/D.m_iCanvasWidth;o=c.m_aPoint[2][1]/D.m_iCanvasHeight}else{t.startPos=c.m_aPoint[2]||[e.offsetX,e.offsetY];t.endPos=c.m_aPoint[0]||[e.offsetX,e.offsetY];n=c.m_aPoint[2][0]/D.m_iCanvasWidth;i=c.m_aPoint[2][1]/D.m_iCanvasHeight;r=c.m_aPoint[0][0]/D.m_iCanvasWidth;o=c.m_aPoint[0][1]/D.m_iCanvasHeight}t.points=[[n,i],[r,i],[r,o],[n,o]];D[B]&&D[B](t)}catch(s){}}D.clearAllShape()}c=null}else if(D[A]==="Polygon"&&c.m_iPolygonType===0&&D[L]){if(Math.abs(e.offsetX-u)>2&&Math.abs(e.offsetY-l)>2){H(c);D[L]=false;if(!D[N]&&0===c.m_iRedrawMode){D[q]=false}D[z]&&D[z]({id:+c.m_szId,type:c.m_szType,event:"drawEnd"})}}}if(!D[L]&&!D[F]){a=false}else{a=true}if(!D[L]||!D[F]){J()}});D[x].bind("dblclick",function(){if(D[q]){if(D[A]==="Grid"){D[E][0].m_szGridMap="fffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffc";J()}}if(o){o.m_aPoint.pop()}});D[x].bind("mouseout",function(){D[x][0].style.cursor="default";if(!D[L]&&!D[F]){a=false}else{a=true}})}var e=function(){function e(){Q(this,e);this.m_szId="";this.m_aPoint=[];this.m_bChoosed=false;this.m_szDrawColor=D[M].szDrawColor;this.m_szFillColor=D[M].szFillColor;this.m_iTranslucent=D[M].iTranslucent;this.m_iIndexChoosePoint=-1;this.m_iDriftStartX=0;this.m_iDriftStartY=0;this.m_oEdgePoints={top:{x:0,y:0},left:{x:0,y:0},right:{x:0,y:0},bottom:{x:0,y:0}};this.m_szTips="";this.m_iEditType=0;this.m_iMinClosed=3;this.m_iMaxPointNum=11;this.m_bClosed=false;this.m_iRedrawMode=0}$(e,[{key:"draw",value:function t(){}},{key:"drag",value:function r(e,t){if(this.m_iEditType!==2){var n=this.m_aPoint.length;var i=0;for(i=0;i<n;i++){if(this.m_aPoint[i][0]+e-this.m_iDriftStartX>D.m_iCanvasWidth||this.m_aPoint[i][1]+t-this.m_iDriftStartY>D.m_iCanvasHeight||this.m_aPoint[i][0]+e-this.m_iDriftStartX<0||this.m_aPoint[i][1]+t-this.m_iDriftStartY<0){this.m_iDriftStartX=e;this.m_iDriftStartY=t;return}}for(i=0;i<n;i++){this.m_aPoint[i][0]=this.m_aPoint[i][0]+e-this.m_iDriftStartX;this.m_aPoint[i][1]=this.m_aPoint[i][1]+t-this.m_iDriftStartY}this.m_iDriftStartX=e;this.m_iDriftStartY=t;this.setPointInfo(this.m_aPoint);J()}}},{key:"stretch",value:function n(e,t){if(this.m_iEditType===0){if(this.m_iIndexChoosePoint!==-1){this.m_aPoint[this.m_iIndexChoosePoint][0]=e;this.m_aPoint[this.m_iIndexChoosePoint][1]=t}this.setPointInfo(this.m_aPoint);J()}}},{key:"inShape",value:function s(e,t){var n=false;var i=this.m_aPoint.length;for(var r=0,o=i-1;r<i;o=r++){if(this.m_aPoint[r][1]>t!==this.m_aPoint[o][1]>t&&e<(this.m_aPoint[o][0]-this.m_aPoint[r][0])*(t-this.m_aPoint[r][1])/(this.m_aPoint[o][1]-this.m_aPoint[r][1])+this.m_aPoint[r][0]){n=!n}}return n}},{key:"inArc",value:function a(e,t,n){var i=false;for(var r=0,o=this.m_aPoint.length;r<o;r++){var s=Math.sqrt((e-this.m_aPoint[r][0])*(e-this.m_aPoint[r][0])+(t-this.m_aPoint[r][1])*(t-this.m_aPoint[r][1]));if(s<n){i=true;this.m_iIndexChoosePoint=r;break}}return i}},{key:"getMouseDownPoints",value:function i(e,t){this.m_iDriftStartX=e;this.m_iDriftStartY=t}},{key:"getPointInfo",value:function o(){return this.m_aPoint}},{key:"setPointInfo",value:function u(e){if(e!==null&&typeof e!=="undefined"&&e.length>0){this.m_aPoint=e;this.setEdgePoints(e)}}},{key:"addPoint",value:function l(e,t){if(this.m_aPoint.length<this.m_iMaxPointNum){this.m_aPoint.push([e,t])}if(this.m_aPoint.length===this.m_iMaxPointNum){this.setPointInfo(this.m_aPoint)}}},{key:"setEdgePoints",value:function f(e){for(var t=0,n=e.length;t<n;t++){if(t===0){this.m_oEdgePoints.top.x=e[t][0];this.m_oEdgePoints.top.y=e[t][1];this.m_oEdgePoints.left.x=e[t][0];this.m_oEdgePoints.left.y=e[t][1];this.m_oEdgePoints.right.x=e[t][0];this.m_oEdgePoints.right.y=e[t][1];this.m_oEdgePoints.bottom.x=e[t][0];this.m_oEdgePoints.bottom.y=e[t][1]}else{if(e[t][1]<this.m_oEdgePoints.top.y){this.m_oEdgePoints.top.x=e[t][0];this.m_oEdgePoints.top.y=e[t][1]}if(e[t][0]>this.m_oEdgePoints.right.x){this.m_oEdgePoints.right.x=e[t][0];this.m_oEdgePoints.right.y=e[t][1]}if(e[t][1]>this.m_oEdgePoints.bottom.y){this.m_oEdgePoints.bottom.x=e[t][0];this.m_oEdgePoints.bottom.y=e[t][1]}if(e[t][0]<this.m_oEdgePoints.left.x){this.m_oEdgePoints.left.x=e[t][0];this.m_oEdgePoints.left.y=e[t][1]}}}}}]);return e}();var j=function(e){m(t,e);function t(){Q(this,t);var e=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));e.m_szType="Rect";return e}$(t,[{key:"setPointInfo",value:function a(e){if(e!==null&&typeof e!=="undefined"){var t=e[0][0];var n=e[0][1];var i=e[0][0];var r=e[0][1];for(var o=0,s=e.length;o<s;o++){if(t>e[o][0]){t=e[o][0]}if(n>e[o][1]){n=e[o][1]}if(i<e[o][0]){i=e[o][0]}if(r<e[o][1]){r=e[o][1]}}this.m_aPoint=[[t,n],[i,n],[i,r],[t,r]]}}},{key:"draw",value:function l(){D[I].fillStyle=this.m_szFillColor;D[I].strokeStyle=this.m_szDrawColor;var e=this.m_aPoint[0][0];var t=this.m_aPoint[0][1];var n=this.m_aPoint[2][0]-e;var i=this.m_aPoint[2][1]-t;D[I].globalAlpha=this.m_iTranslucent;D[I].fillRect(e,t,n,i);D[I].globalAlpha=1;D[I].fillText(this.m_szTips,(e+this.m_aPoint[2][0])/2,(t+this.m_aPoint[2][1])/2);if(this.m_bChoosed){var r=Math.round(n/2);var o=Math.round(i/2);if(this.m_iEditType===0){var s=[e,e+r,e+n,e,e+n,e,e+r,e+n];var a=[t,t,t,t+o,t+o,t+i,t+i,t+i];for(var u=0;u<8;u++){D[I].beginPath();D[I].arc(s[u],a[u],3,0,360,false);D[I].fillStyle=this.m_szDrawColor;D[I].closePath();D[I].fill()}}}D[I].strokeRect(e,t,n,i)}},{key:"stretch",value:function n(e,t){if(this.m_iEditType===0){if(this.m_iIndexChoosePoint===0){if(e<this.m_aPoint[2][0]&&t<this.m_aPoint[2][1]){this.m_aPoint[0][0]=e;this.m_aPoint[0][1]=t;this.m_aPoint[3][0]=e;this.m_aPoint[1][1]=t}}else if(this.m_iIndexChoosePoint===1){if(t<this.m_aPoint[2][1]){this.m_aPoint[0][1]=t;this.m_aPoint[1][1]=t}}else if(this.m_iIndexChoosePoint===2){if(e>this.m_aPoint[3][0]&&t<this.m_aPoint[3][1]){this.m_aPoint[1][0]=e;this.m_aPoint[1][1]=t;this.m_aPoint[2][0]=e;this.m_aPoint[0][1]=t}}else if(this.m_iIndexChoosePoint===3){if(e<this.m_aPoint[2][0]){this.m_aPoint[0][0]=e;this.m_aPoint[3][0]=e}}else if(this.m_iIndexChoosePoint===4){if(e>this.m_aPoint[0][0]){this.m_aPoint[1][0]=e;this.m_aPoint[2][0]=e}}else if(this.m_iIndexChoosePoint===5){if(e<this.m_aPoint[1][0]&&t>this.m_aPoint[1][1]){this.m_aPoint[3][0]=e;this.m_aPoint[3][1]=t;this.m_aPoint[0][0]=e;this.m_aPoint[2][1]=t}}else if(this.m_iIndexChoosePoint===6){if(t>this.m_aPoint[1][1]){this.m_aPoint[2][1]=t;this.m_aPoint[3][1]=t}}else if(this.m_iIndexChoosePoint===7){if(e>this.m_aPoint[0][0]&&t>this.m_aPoint[0][1]){this.m_aPoint[2][0]=e;this.m_aPoint[2][1]=t;this.m_aPoint[1][0]=e;this.m_aPoint[3][1]=t}}J()}}},{key:"move",value:function o(e){J();this.m_bChoosed=true;var t=e[0][0];var n=e[0][1];var i=e[1][0];var r=e[1][1];this.setPointInfo([[t,n],[i,n],[i,r],[t,r]]);this.draw()}},{key:"inArc",value:function d(e,t,n){var i=this.m_aPoint[0][0];var r=this.m_aPoint[0][1];var o=this.m_aPoint[2][0]-i;var s=this.m_aPoint[2][1]-r;var a=Math.round(o/2);var u=Math.round(s/2);var l=[i,i+a,i+o,i,i+o,i,i+a,i+o];var f=[r,r,r,r+u,r+u,r+s,r+s,r+s];for(var c=0;c<8;c++){var h=Math.sqrt((e-l[c])*(e-l[c])+(t-f[c])*(t-f[c]));if(h<n){this.m_iIndexChoosePoint=c;return true}}return false}}]);return t}(e);var G=function(e){m(i,e);function i(e,t){Q(this,i);var n=p(this,(i.__proto__||Object.getPrototypeOf(i)).call(this));n.m_szType="RectOSD";n.m_szOSDType="overlay-date";n.m_szText=e||"";n.m_szEnabled=t||"";n.m_szDateStyle="";n.m_szClockType="";n.m_szDisplayWeek="";n.m_szId="";n.m_szAlignment="0";return n}$(i,[{key:"draw",value:function r(){if(this.m_szEnabled==="true"){var e=this.m_aPoint[0][0];var t=this.m_aPoint[0][1];var n=this.m_aPoint[2][0]-e;var i=this.m_aPoint[2][1]-t;D[I].beginPath();D[I].strokeStyle=this.m_szDrawColor;D[I].globalAlpha=1;D[I].rect(e,t,n,i);D[I].font="15px serif";D[I].strokeText(this.m_szText,e,t+15);D[I].stroke()}}},{key:"drag",value:function o(e,t){var n=this.m_aPoint.length;var i=0;if("0"===this.m_szAlignment){for(i=0;i<n;i++){if(this.m_aPoint[i][1]+t-this.m_iDriftStartY>D.m_iCanvasHeight||this.m_aPoint[i][0]+e-this.m_iDriftStartX<0||this.m_aPoint[i][1]+t-this.m_iDriftStartY<0){this.m_iDriftStartX=e;this.m_iDriftStartY=t;return}}for(i=0;i<n;i++){this.m_aPoint[i][0]=this.m_aPoint[i][0]+e-this.m_iDriftStartX;this.m_aPoint[i][1]=this.m_aPoint[i][1]+t-this.m_iDriftStartY}}else if("1"===this.m_szAlignment||"2"===this.m_szAlignment){for(i=0;i<n;i++){if(this.m_aPoint[i][1]+t-this.m_iDriftStartY>D.m_iCanvasHeight||this.m_aPoint[i][1]+t-this.m_iDriftStartY<0){this.m_iDriftStartX=e;this.m_iDriftStartY=t;return}}for(i=0;i<n;i++){this.m_aPoint[i][1]=this.m_aPoint[i][1]+t-this.m_iDriftStartY}}this.m_iDriftStartX=e;this.m_iDriftStartY=t;this.setEdgePoints(this.m_aPoint);J()}},{key:"stretch",value:function t(){}}]);return i}(e);var V=function(e){m(t,e);function t(){Q(this,t);var e=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));e.m_szType="Grid";e.m_iGridColNum=22;e.m_iGridRowNum=18;e.m_szGridMap="";e.m_aAddGridMap=[];return e}$(t,[{key:"draw",value:function l(){var e=D.m_iCanvasWidth/this.m_iGridColNum;var t=D.m_iCanvasHeight/this.m_iGridRowNum;var n="";for(var i=0;i<this.m_iGridRowNum;i++){var r=this.m_szGridMap.substring(i*6,i*6+6);var o=parseInt("f"+r,16).toString(2).split("").slice(4);var s="";for(var a=0;a<this.m_iGridColNum;a++){var u="";if(o[a]==="1"){D[I].strokeStyle=this.m_szDrawColor;D[I].globalAlpha=1;D[I].strokeRect(e*a,t*i,e,t);u="1"}else{u="0"}if(this.m_aAddGridMap.length){if(this.m_aAddGridMap[i][a]===1){D[I].strokeStyle=this.m_szDrawColor;D[I].strokeRect(e*a,t*i,e,t);u="1"}}s+=u}n+=parseInt("1111"+s+"00",2).toString(16).substring(1)}this.m_szGridMap=n}},{key:"move",value:function v(e,t,n,i){var r=D.m_iCanvasWidth/this.m_iGridColNum;var o=D.m_iCanvasHeight/this.m_iGridRowNum;var s=Math.floor(e/r);var a=Math.floor(t/o);var u=Math.floor(Math.abs(n-e)/r);var l=Math.floor(Math.abs(i-t)/o);var f=1;var c=1;if(n-e>0){f=1}else{f=-1}if(i-t>0){c=1}else{c=-1}var h=[];for(var d=0;d<this.m_iGridRowNum;d++){h[d]=[];for(var p=0;p<this.m_iGridColNum;p++){if(f===1){if(c===1){if(d>=a&&d<=a+l&&p>=s&&p<=s+u){h[d][p]=1}else{h[d][p]=0}}else{if(d<=a&&d>=a-l&&p>=s&&p<=s+u){h[d][p]=1}else{h[d][p]=0}}}else{if(c===1){if(d>=a&&d<=a+l&&p<=s&&p>=s-u){h[d][p]=1}else{h[d][p]=0}}else{if(d<=a&&d>=a-l&&p<=s&&p>=s-u){h[d][p]=1}else{h[d][p]=0}}}}}this.m_aAddGridMap=h;this.draw()}}]);return t}(e);var Y=function(e){m(t,e);function t(){Q(this,t);var e=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));e.m_szType="Line";e.m_iLineType=0;e.m_iDirection=0;e.m_iArrowType=0;e.m_aCrossArrowPoint=[];return e}$(t,[{key:"draw",value:function n(){if(this.m_iLineType===0||this.m_iLineType===2){this.drawNormalLine()}else if(this.m_iLineType===1){this.drawArrowLine2()}else if(this.m_iLineType===3){this.drawCrossLine()}else if(this.m_iLineType===4){this.drawLineCount()}}},{key:"drawNormalLine",value:function r(){D[I].globalAlpha=1;if(this.m_aPoint.length>0){D[I].beginPath();D[I].strokeStyle=this.m_szDrawColor;D[I].lineWidth=2;D[I].moveTo(this.m_aPoint[0][0],this.m_aPoint[0][1]);for(var e=1,t=this.m_aPoint.length;e<t;e++){D[I].lineTo(this.m_aPoint[e][0],this.m_aPoint[e][1])}D[I].stroke();if(this.m_bChoosed){for(var n=0,i=this.m_aPoint.length;n<i;n++){D[I].beginPath();D[I].fillStyle=this.m_szDrawColor;D[I].arc(this.m_aPoint[n][0],this.m_aPoint[n][1],3,0,Math.PI*2,true);D[I].closePath();D[I].fill()}}if(this.m_szTips!==""){D[I].strokeStyle=this.m_szDrawColor;D[I].fillStyle=this.m_szDrawColor;D[I].fillText(this.m_szTips,this.m_aPoint[0][0]+10,this.m_aPoint[0][1]+4)}}}},{key:"drawArrowLine2",value:function c(){this.drawNormalLine();var e=(this.m_aPoint[0][0]+this.m_aPoint[1][0])/2;var t=(this.m_aPoint[0][1]+this.m_aPoint[1][1])/2;var n=Math.atan2(t-this.m_aPoint[0][1],e-this.m_aPoint[0][0])*180/Math.PI;var i=(n+90)*Math.PI/180;var r=(n-90)*Math.PI/180;var o=25*Math.cos(i);var s=25*Math.sin(i);var a=25*Math.cos(r);var u=25*Math.sin(r);var l=0;var f=0;l=e-o;f=t-s;this.drawArrowLine(0,l,f,e,t);D[I].strokeStyle=this.m_szDrawColor}},{key:"drawArrowLine",value:function y(e,t,n,i,r,o,s,a){o=typeof o!=="undefined"?o:30;s=typeof s!=="undefined"?s:10;a=typeof a!=="undefined"?a:1;var u=Math.atan2(n-r,t-i)*180/Math.PI;var l=(u+o)*Math.PI/180;var f=(u-o)*Math.PI/180;var c=s*Math.cos(l);var h=s*Math.sin(l);var d=s*Math.cos(f);var p=s*Math.sin(f);D[I].save();D[I].beginPath();var v=t-c;var m=n-h;D[I].moveTo(v,m);D[I].lineTo(t,n);v=t-d;m=n-p;D[I].lineTo(v,m);D[I].moveTo(t,n);D[I].lineTo(i,r);if(e===1){v=i+c;m=r+h;D[I].moveTo(v,m);D[I].lineTo(i,r);v=i+d;m=r+p;D[I].lineTo(v,m)}D[I].strokeStyle=this.m_szDrawColor;D[I].lineWidth=a;D[I].stroke();D[I].restore()}},{key:"drawCrossLine",value:function d(){this.drawNormalLine();var e=(this.m_aPoint[0][0]+this.m_aPoint[1][0])/2;var t=(this.m_aPoint[0][1]+this.m_aPoint[1][1])/2;var n=Math.atan2(t-this.m_aPoint[0][1],e-this.m_aPoint[0][0])*180/Math.PI;var i=(n+90)*Math.PI/180;var r=(n-90)*Math.PI/180;var o=25*Math.cos(i);var s=25*Math.sin(i);var a=25*Math.cos(r);var u=25*Math.sin(r);var l=0;var f=0;l=e-o;f=t-s;var c=0;var h=0;if(this.m_iDirection===0){c=-10;h=-15}else if(this.m_iDirection===1){c=10;h=10}else{c=10;h=-15}if(this.m_iDirection!==0){this.drawArrowLine(0,l,f,e,t)}D[I].strokeStyle=this.m_szDrawColor;D[I].font="8px";D[I].strokeText("A",l+c,f+4);l=e-a;f=t-u;if(this.m_iDirection!==1){this.drawArrowLine(0,l,f,e,t)}D[I].strokeStyle=this.m_szDrawColor;D[I].font="8px";D[I].strokeText("B",l+h,f+4)}},{key:"drawLineCount",value:function h(){this.drawNormalLine();var e=(this.m_aPoint[0][0]+this.m_aPoint[1][0])/2;var t=(this.m_aPoint[0][1]+this.m_aPoint[1][1])/2;var n=Math.atan2(t-this.m_aPoint[0][1],e-this.m_aPoint[0][0])*180/Math.PI;var i=(n+90)*Math.PI/180;var r=(n-90)*Math.PI/180;var o=25*Math.cos(i);var s=25*Math.sin(i);var a=25*Math.cos(r);var u=25*Math.sin(r);var l=0;var f=0;l=e-o;f=t-s;if(this.m_iArrowType===1){l=e-a;f=t-u;this.drawArrowLine(0,l,f,e,t)}else if(this.m_iArrowType===0){this.drawArrowLine(0,l,f,e,t)}this.m_aCrossArrowPoint=[[e,t],[l,f]]}},{key:"inShape",value:function u(e,t){var n=false;for(var i=0,r=this.m_aPoint.length-1;i<r;i++){var o=Math.sqrt((this.m_aPoint[i+1][0]-this.m_aPoint[i][0])*(this.m_aPoint[i+1][0]-this.m_aPoint[i][0])+(this.m_aPoint[i+1][1]-this.m_aPoint[i][1])*(this.m_aPoint[i+1][1]-this.m_aPoint[i][1]));var s=Math.sqrt((e-this.m_aPoint[i][0])*(e-this.m_aPoint[i][0])+(t-this.m_aPoint[i][1])*(t-this.m_aPoint[i][1]));var a=Math.sqrt((e-this.m_aPoint[i+1][0])*(e-this.m_aPoint[i+1][0])+(t-this.m_aPoint[i+1][1])*(t-this.m_aPoint[i+1][1]));if(s+a-o<1){n=true}}return n}},{key:"move",value:function o(e,t){if(this.m_aPoint.length<this.m_iMaxPointNum&&this.m_aPoint.length>0){D[I].strokeStyle=this.m_szDrawColor;D[I].globalAlpha=1;var n=0;var i=0;for(n=0,i=this.m_aPoint.length;n<i;n++){D[I].beginPath();D[I].arc(this.m_aPoint[n][0],this.m_aPoint[n][1],3,0,360,false);D[I].fillStyle=this.m_szDrawColor;D[I].closePath();D[I].fill()}D[I].beginPath();D[I].moveTo(this.m_aPoint[0][0],this.m_aPoint[0][1]);for(n=0,i=this.m_aPoint.length;n<i;n++){if(n!==0){D[I].lineTo(this.m_aPoint[n][0],this.m_aPoint[n][1])}}D[I].lineTo(e,t);D[I].stroke()}}}]);return t}(e);var X=function(e){m(t,e);function t(){Q(this,t);var e=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));e.m_szType="Polygon";e.m_iPolygonType=1;return e}$(t,[{key:"setPointInfo",value:function a(e){if(e!==null&&typeof e!=="undefined"){if(this.m_iPolygonType===0){var t=e[0][0];var n=e[0][1];var i=e[0][0];var r=e[0][1];for(var o=0,s=e.length;o<s;o++){if(t>e[o][0]){t=e[o][0]}if(n>e[o][1]){n=e[o][1]}if(i<e[o][0]){i=e[o][0]}if(r<e[o][1]){r=e[o][1]}}this.m_aPoint=[[t,n],[i,n],[i,r],[t,r]]}else if(this.m_iPolygonType===1){this.m_aPoint=e}else{this.m_aPoint=e}this.setEdgePoints(e)}}},{key:"draw",value:function n(){if(this.m_aPoint.length>0){D[I].fillStyle=this.m_szFillColor;D[I].strokeStyle=this.m_szDrawColor;D[I].globalAlpha=1;var e=0;var t=0;if(this.m_bChoosed){for(e=0,t=this.m_aPoint.length;e<t;e++){D[I].beginPath();D[I].arc(this.m_aPoint[e][0],this.m_aPoint[e][1],3,0,360,false);D[I].fillStyle=this.m_szDrawColor;D[I].closePath();D[I].fill()}}D[I].beginPath();D[I].moveTo(this.m_aPoint[0][0],this.m_aPoint[0][1]);for(e=0,t=this.m_aPoint.length;e<t;e++){if(e!==0){D[I].lineTo(this.m_aPoint[e][0],this.m_aPoint[e][1])}}D[I].stroke();if(this.m_bClosed){D[I].fillText(this.m_szTips,(this.m_oEdgePoints.left.x+this.m_oEdgePoints.right.x)/2,(this.m_oEdgePoints.top.y+this.m_oEdgePoints.bottom.y)/2);D[I].closePath();D[I].stroke();D[I].globalAlpha=this.m_iTranslucent;D[I].fill()}}}},{key:"move",value:function f(e,t,n,i){if(this.m_iPolygonType===1){if(this.m_aPoint.length<this.m_iMaxPointNum&&this.m_aPoint.length>0){D[I].fillStyle=this.m_szFillColor;D[I].strokeStyle=this.m_szDrawColor;D[I].globalAlpha=1;var r=0;var o=0;for(r=0,o=this.m_aPoint.length;r<o;r++){D[I].beginPath();D[I].arc(this.m_aPoint[r][0],this.m_aPoint[r][1],3,0,360,false);D[I].fillStyle=this.m_szDrawColor;D[I].closePath();D[I].fill()}D[I].beginPath();D[I].moveTo(this.m_aPoint[0][0],this.m_aPoint[0][1]);for(r=0,o=this.m_aPoint.length;r<o;r++){if(r!==0){D[I].lineTo(this.m_aPoint[r][0],this.m_aPoint[r][1])}}D[I].lineTo(e,t);D[I].closePath();D[I].stroke()}}else if(this.m_iPolygonType===0){this.m_bChoosed=true;var s=n;var a=i;var u=e;var l=t;this.setPointInfo([[s,a],[u,a],[u,l],[s,l]]);this.draw()}}},{key:"stretch",value:function i(e,t){if(this.m_iEditType===0){if(this.m_iPolygonType===1){if(this.m_iIndexChoosePoint!==-1){this.m_aPoint[this.m_iIndexChoosePoint][0]=e;this.m_aPoint[this.m_iIndexChoosePoint][1]=t}}else{if(this.m_iIndexChoosePoint===0){if(e<this.m_aPoint[2][0]&&t<this.m_aPoint[2][1]){this.m_aPoint[0][0]=e;this.m_aPoint[0][1]=t;this.m_aPoint[3][0]=e;this.m_aPoint[1][1]=t}}else if(this.m_iIndexChoosePoint===1){if(e>this.m_aPoint[3][0]&&t<this.m_aPoint[3][1]){this.m_aPoint[1][0]=e;this.m_aPoint[1][1]=t;this.m_aPoint[2][0]=e;this.m_aPoint[0][1]=t}}else if(this.m_iIndexChoosePoint===2){if(e>this.m_aPoint[0][0]&&t>this.m_aPoint[0][1]){this.m_aPoint[2][0]=e;this.m_aPoint[2][1]=t;this.m_aPoint[1][0]=e;this.m_aPoint[3][1]=t}}else if(this.m_iIndexChoosePoint===3){if(e<this.m_aPoint[1][0]&&t>this.m_aPoint[1][1]){this.m_aPoint[3][0]=e;this.m_aPoint[3][1]=t;this.m_aPoint[0][0]=e;this.m_aPoint[2][1]=t}}}this.setPointInfo(this.m_aPoint);J()}}}]);return t}(e);var Z=function(e){m(t,e);function t(){Q(this,t);var e=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));e.m_szType="Point";e.m_szId="";e.m_szPointType="circle";return e}$(t,[{key:"draw",value:function n(){if(this.m_szPointType==="circle"){this.drawCirclePoint()}else if(this.m_szPointType==="cross"){this.drawcrossPoint()}}},{key:"drawCirclePoint",value:function i(){D[I].beginPath();D[I].fillStyle=this.m_szDrawColor;D[I].globalAlpha=1;D[I].arc(this.m_aPoint[0][0],this.m_aPoint[0][1],10,0,Math.PI*2,true);D[I].closePath();D[I].fill()}},{key:"drawcrossPoint",value:function r(){D[I].beginPath();D[I].strokeStyle=this.m_szDrawColor;D[I].fillStyle=this.m_szDrawColor;D[I].lineWidth=2;D[I].globalAlpha=1;D[I].moveTo(this.m_aPoint[0][0]-12,this.m_aPoint[0][1]);D[I].lineTo(this.m_aPoint[0][0]+12,this.m_aPoint[0][1]);D[I].moveTo(this.m_aPoint[0][0],this.m_aPoint[0][1]-12);D[I].lineTo(this.m_aPoint[0][0],this.m_aPoint[0][1]+12);D[I].fillText(this.m_szTips,this.m_aPoint[0][0]+12,this.m_aPoint[0][1]-12);D[I].closePath();D[I].stroke()}},{key:"stretch",value:function o(){}},{key:"inShape",value:function s(e,t){var n=false;if(this.m_szPointType==="cross"){if(e<=this.m_aPoint[0][0]+4&&e>=this.m_aPoint[0][0]-4&&t<=this.m_aPoint[0][1]+12&&t>=this.m_aPoint[0][1]-12){n=true}else if(t<=this.m_aPoint[0][1]+4&&t>=this.m_aPoint[0][1]-4&&e<=this.m_aPoint[0][0]+12&&e>=this.m_aPoint[0][0]-12){n=true}}return n}}]);return t}(e);var t=function(){function t(e){Q(this,t);D=this;this[x]=K("#"+e);this.szCanvasId=e;this[I]=this[x][0].getContext("2d");this[E]=[];this[q]=false;this[A]="";this[O]=10;this[N]=true;this[W]={};this[B]=null;this[M]={szDrawColor:"#ff0000",szFillColor:"#343434",iTranslucent:.7};this[L]=false;this[F]=false;this.m_iCanvasWidth=this[x].width()||document.getElementById(this.szCanvasId).width;this.m_iCanvasHeight=this[x].height()||document.getElementById(this.szCanvasId).height;this.m_iHorizontalResolution=0;this.m_iVerticalResolution=0;this.m_szDisplayMode="";this.m_szVideoFormat="";this.m_iHistoryCanvasWidth=this[x].width();this.m_iHistoryCanvasHeight=this[x].height();U();this[E].length=0}$(t,[{key:"_getCanvasPoints",value:function r(e){var t=e.length;var n=[];for(var i=0;i<t;i++){n.push([e[i][0]*this.m_iCanvasWidth,e[i][1]*this.m_iCanvasHeight])}return n}},{key:"_getNormalizedPoints",value:function o(e){var t=e.length;var n=[];for(var i=0;i<t;i++){n.push([e[i][0]/this.m_iCanvasWidth,e[i][1]/this.m_iCanvasHeight])}return n}},{key:"resizeCanvasPoints",value:function s(e){var t=e.length;var n=[];for(var i=0;i<t;i++){e[i][0]=e[i][0]*this.m_iCanvasWidth/this.m_iHistoryCanvasWidth;e[i][1]=e[i][1]*this.m_iCanvasHeight/this.m_iHistoryCanvasHeight;n.push([e[i][0],e[i][1]])}return n}},{key:"setDrawMutiShapeOneTime",value:function n(e){this[N]=e}},{key:"setMaxShapeSupport",value:function i(e){this[O]=e}},{key:"getMaxShapeSupport",value:function e(){return this[O]}},{key:"setDrawStatus",value:function a(e,t){this[q]=e;if(t&&e){this[B]=t}if(!e){this[B]=null}}},{key:"setShapeType",value:function u(e){this[A]=e;J()}},{key:"setCurrentShapeInfo",value:function l(e){for(var t=0,n=this[E].length;t<n;t++){if(this[E][t].m_szId===e.szId){this[E].splice(t,1);break}}J();this[W]=e||{szId:"",szTips:"",iMinClosed:3,iMaxPointNum:11,iPolygonType:1,iRedrawMode:0}}},{key:"getShapeType",value:function f(){return this[A]}},{key:"getAllShapesInfo",value:function c(){var e=[];for(var t=0,n=this[E].length;t<n;t++){if(this[E][t].m_szType==="Grid"){e.push({szType:this[E][t].m_szType,szGridMap:this[E][t].m_szGridMap,iGridColNum:this[E][t].m_iGridColNum,iGridRowNum:this[E][t].m_iGridRowNum})}else if(this[E][t].m_szType==="RectOSD"){e.push({szType:this[E][t].m_szType,szText:this[E][t].m_szText,szEnabled:this[E][t].m_szEnabled,szOSDType:this[E][t].m_szOSDType,iPositionX:this[E][t].m_aPoint[0][0]/this.m_iCanvasWidth,iPositionY:this[E][t].m_aPoint[0][1]/this.m_iCanvasHeight,szDateStyle:this[E][t].m_szDateStyle,szClockType:this[E][t].m_szClockType,szDisplayWeek:this[E][t].m_szDisplayWeek,szId:this[E][t].m_szId,szAlignment:this[E][t].m_szAlignment})}else{e.push({szType:this[E][t].m_szType,aPoint:this._getNormalizedPoints(this[E][t].m_aPoint),szId:this[E][t].m_szId,bChoosed:this[E][t].m_bChoosed})}}return e}},{key:"deleteRepeatByIdAndType",value:function h(e,t){var n=this.getAllShapesInfo();var i=n.length;if(i>0){for(var r=0;r<i;r++){if(n[r].szType===t){if(Number(n[r].szId)===Number(e)){this.deleteShape(r)}}}}}},{key:"getShapesInfoByType",value:function d(e){var t=[];for(var n=0,i=this[E].length;n<i;n++){if(this[E][n].m_szType===e){if(this[E][n].m_szType==="Grid"){t.push({gridMap:this[E][n].m_szGridMap,gridColNum:this[E][n].m_iGridColNum,gridRowNum:this[E][n].m_iGridRowNum})}else if(this[E][n].m_szType==="RectOSD"){t.push({szType:this[E][n].m_szType,szText:this[E][n].m_szText,szEnabled:this[E][n].m_szEnabled,szOSDType:this[E][n].m_szOSDType,iPositionX:this[E][n].m_aPoint[0][0]/this.m_iCanvasWidth,iPositionY:this[E][n].m_aPoint[0][1]/this.m_iCanvasHeight,szDateStyle:this[E][n].m_szDateStyle,szClockType:this[E][n].m_szClockType,szDisplayWeek:this[E][n].m_szDisplayWeek,szId:this[E][n].m_szId,szAlignment:this[E][n].m_szAlignment})}else if(e==="Polygon"){t.push({id:this[E][n].m_szId,points:this._getNormalizedPoints(this[E][n].m_aPoint),closed:this[E][n].m_bClosed,tips:this[E][n].m_szTips,drawColor:this[E][n].m_szDrawColor})}else if(e==="Line"){var r={id:this[E][n].m_szId,points:this._getNormalizedPoints(this[E][n].m_aPoint),tips:this[E][n].m_szTips,closed:this[E][n].m_bClosed,lineType:this[E][n].m_iLineType,direction:this[E][n].m_iDirection};if(r.lineType===1||r.lineType===4){r.direction=this[E][n].m_iArrowType}if(r.lineType===4){r.pdcArrow=this._getNormalizedPoints(this[E][n].m_aCrossArrowPoint)}t.push(r)}else if(e==="Rect"){t.push({id:this[E][n].m_szId,points:this._getNormalizedPoints(this[E][n].m_aPoint),tips:this[E][n].m_szTips,closed:this[E][n].m_bClosed})}else if(e==="Point"){t.push({id:this[E][n].m_szId,points:this._getNormalizedPoints(this[E][n].m_aPoint)[0],tips:this[E][n].m_szTips,type:this[E][n].m_szPointType,drawColor:this[E][n].m_szDrawColor})}else{t.push({points:this._getNormalizedPoints(this[E][n].m_aPoint)})}}}return t}},{key:"setShapesInfoByType",value:function p(e,t){if(!t){t=[]}var n=null;if(e==="Rect"||e==="Polygon"||e==="Line"||e==="Point"){for(var i=0,r=t.length;i<r;i++){if(e==="Rect"){if(""!==t[i].id){this.deleteRepeatByIdAndType(t[i].id,"Rect")}n=new j;n.m_szId=t[i].id;n.m_iEditType=t[i].editType||0;n.m_szTips=t[i].tips;n.m_szDrawColor=t[i].drawColor;n.m_szFillColor=t[i].fillColor||t[i].drawColor;n.m_iTranslucent=t[i].translucent;n.m_iRedrawMode=t[i].redrawMode;n.m_bClosed=t[i].closed||true}else if(e==="Polygon"){if(""!==t[i].id){this.deleteRepeatByIdAndType(t[i].id,"Polygon")}n=new X;n.m_szTips=t[i].tips;n.m_szId=t[i].id||"";n.m_iMinClosed=t[i].minPointSupport||3;n.m_iMaxPointNum=t[i].maxPointSupport||11;n.m_iEditType=t[i].editType||0;n.m_szDrawColor=t[i].drawColor;n.m_szFillColor=t[i].fillColor||t[i].drawColor;n.m_iTranslucent=t[i].translucent;n.m_iRedrawMode=t[i].redrawMode;n.m_bClosed=t[i].closed||true}else if(e==="Line"){if(""!==t[i].id){this.deleteRepeatByIdAndType(t[i].id,"Line")}n=new Y;n.m_iLineType=t[i].lineType;n.m_szTips=t[i].tips;n.m_szId=t[i].id;n.m_bClosed=t[i].redrawMode||true;n.m_iDirection=parseInt(t[i].direction,10);if(t[i].lineType===1||t[i].lineType===4){n.m_iArrowType=parseInt(t[i].direction,10)}n.m_szDrawColor=t[i].drawColor}else if(e==="Point"){if(""!==t[i].id){this.deleteRepeatByIdAndType(t[i].id,"Point")}n=new Z;n.m_szId=t[i].id;n.m_szDrawColor=t[i].drawColor;n.m_szTips=t[i].tips||"";n.m_iEditType=t[i].editType||0;n.m_szPointType=t[i].type||"circle"}n.setPointInfo(this._getCanvasPoints(t[i].points));if(i===0){n.m_bChoosed=true}H(n)}}else if(e==="Grid"){n=new V;n.m_szGridMap=t[0].gridMap||"";n.m_iGridColNum=t[0].gridColNum||22;n.m_iGridRowNum=t[0].gridRowNum||18;H(n)}J()}},{key:"addOSDShape",value:function v(e,t,n,i,r){var o=n*this.m_iCanvasWidth;var s=i*this.m_iCanvasHeight;if(!o&&!s){o=0;s=0}if(!r){r={}}var a=new G(e,t);var u=e.replace(/[^x00-xff]/g,"rr").length*10;a.m_szOSDType=r.szOSDType||"";a.m_szDateStyle=r.szDateStyle||"";a.m_szClockType=r.szClockType||"";a.m_szDisplayWeek=r.szDisplayWeek||"";a.m_szId=r.szId||"";a.m_szAlignment=""+r.szAlignment||"0";if("0"===a.m_szAlignment){a.m_aPoint=[[o,s],[u+o,s],[u+o,s+20],[o,s+20]]}else if("1"===a.m_szAlignment){a.m_aPoint=[[0,s],[u,s],[u,s+20],[0,s+20]]}else if("2"===a.m_szAlignment){a.m_aPoint=[[this.m_iCanvasWidth-u,s],[this.m_iCanvasWidth,s],[this.m_iCanvasWidth,s+20],[this.m_iCanvasWidth-u,s+20]]}else{a.m_aPoint=[[o,s],[u+o,s],[u+o,s+20],[o,s+20]]}H(a);J()}},{key:"selectShapeById",value:function m(e,t){for(var n=0,i=D[E].length;n<i;n++){if(e===D[E][n].m_szType){if(t===D[E][n].m_szId+""){D[E][n].m_bChoosed=true}else{D[E][n].m_bChoosed=false}}}J()}},{key:"setCanvasSize",value:function y(e,t){if(e>0&&t>0){this.m_iCanvasWidth=e;this.m_iCanvasHeight=t;J()}}},{key:"setDrawStyle",value:function g(e,t,n){this[M]={szDrawColor:e,szFillColor:t,iTranslucent:n}}},{key:"clearAllShape",value:function P(){this[E].length=0;D[L]=false;D[F]=false;J()}},{key:"clearShapeByType",value:function w(e){var t=this[E].length;for(var n=t;n>0;n--){if(this[E][n-1].m_szType===e){if(e==="Grid"){this[E][n-1].m_szGridMap="";this[E][n-1].m_aAddGridMap=[]}else{this[E].splice(n-1,1)}}}if("Polygon"===e){D[L]=false}if("Line"===e){D[F]=false}if(e==="All"||e==="AllWindows"){this[E].length=0}J()}},{key:"deleteChoosedShape",value:function S(){var e=this.getAllShapesInfo();var t=e.length;if(t>0){for(var n=0;n<t;n++){if(e[n].bChoosed){this.deleteShape(n);return+e[n].szId}}return-1}return-1}},{key:"deleteTargetShape",value:function _(e,t){var n=this.getAllShapesInfo();var i=n.length;if(i>0){for(var r=0;r<i;r++){if(n[r].szType===e){if(n[r].szId===t){this.deleteShape(r);break}}}}}},{key:"deleteShape",value:function b(e){if(this[E].length>e){this[E].splice(e,1)}J()}},{key:"updateCanvas",value:function C(e){this[x]=K("#"+e);this.szCanvasId=e;this[I]=this[x][0].getContext("2d");this.m_iCanvasWidth=this[x].width()||document.getElementById(this.szCanvasId).width;this.m_iCanvasHeight=this[x].height()||document.getElementById(this.szCanvasId).height;U()}},{key:"resizeCanvas",value:function k(){this.m_iHistoryCanvasWidth=this.m_iCanvasWidth;this.m_iHistoryCanvasHeight=this.m_iCanvasHeight;this.m_iCanvasWidth=this[x].width()||document.getElementById(this.szCanvasId).width;this.m_iCanvasHeight=this[x].height()||document.getElementById(this.szCanvasId).height}},{key:"canvasRedraw",value:function T(){J("canvasRedraw")}},{key:"setDrawEventCallback",value:function R(e){this[z]=e}}]);return t}();return t}();t.ESCanvas=e}).call(this,n(1))},function(e,r,o){"use strict";(function(Jt){Object.defineProperty(r,"__esModule",{value:true});r.LocalServiceControl=undefined;var Ht=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(e,t,n){if(t)i(e.prototype,t);if(n)i(e,n);return e}}();var Ut=o(76);var jt=o(10);var e=o(18);var t=n(e);function n(e){return e&&e.__esModule?e:{"default":e}}function Gt(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++){n[t]=e[t]}return n}else{return Array.from(e)}}function Vt(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var i=function(){var e=function(){function r(e){Vt(this,r);var t=this;var n={szPluginContainer:"",cbConnectSuccess:null,cbConnectError:null,cbConnectClose:null};this.oOptions=Jt.extend(n,e);this.oPluginColor={backgroundColor:t.oOptions.szBackgroundColor,subBackgroundColor:t.oOptions.szSubBackgroundColor,borderColor:t.oOptions.szBorderColor,selectBorderColor:t.oOptions.szSelectBorderColor};if(this.oOptions.szIframeId&&Jt("#"+this.oOptions.szIframeId).length){this.oOptions.oPluginContainer=Jt("#"+this.oOptions.szPluginContainer,Jt("#"+this.oOptions.szIframeId)[0].contentWindow.document)}else{this.oOptions.oPluginContainer=Jt("#"+this.oOptions.szPluginContainer)}this.bFreeze=false;this.bFocus=true;this.bEmbed=false;if("bEmbed"in t.oOptions){this.bEmbed=!!t.oOptions.bEmbed}else{this.bEmbed=jt.oUtils.getCreateWndMode()}this.szWndId="";this.iCreateWndTimer=-1;this.iUpdateParentWndTimer=-1;this.bDevTool=false;this.iVCTimeStart=-1;this.iVCTimeEnd=-1;this.oWndCover={left:0,top:0,right:0,bottom:0};this.bOpened=false;this.bLocalServiceRunning=false;this.fCurrentCallback=null;this.afCurrentCallback=[];this.iProtocolType=0;this.oPluginCallback={};this.iPackageType=2;this.iDrawWondIndex=-1;this.iPluginMode=2;this.fVisibilityChange=function(){if(document.hidden){t.iVCTimeStart=(new Date).getTime();t.fHideWnd()}else{t.iVCTimeEnd=(new Date).getTime();var e=jt.oUtils.browser();if(e.chrome||e.mozilla){if(t.iUpdateParentWndTimer>0){clearTimeout(t.iUpdateParentWndTimer);t.iUpdateParentWndTimer=-1}if(t.iVCTimeEnd-t.iVCTimeStart<100){t.iUpdateParentWndTimer=setTimeout(function(){t.oRequest.updateParentWnd().then(function(){if(!t.bFreeze&&!t.bDevTool){t.fShowWnd()}},function(){})},100)}else{if(!t.bFreeze&&!t.bDevTool){t.fShowWnd()}}}else{if(!t.bFreeze&&!t.bDevTool){t.fShowWnd()}}}};this.fHideWnd=function(){return this.oRequest.hideWnd()};this.fShowWnd=function(){this.oRequest.showWnd()};this.fUnload=function(){Jt(window).off("unload",this.fUnload);this.JS_Disconnect()};this.fFocus=function(){t.bFocus=true;setTimeout(function(){if(!document.hidden&&!t.bFreeze&&!t.bDevTool){t.fShowWnd()}},200)};this.fBlur=function(){this.bFocus=false};document.addEventListener("visibilitychange",this.fVisibilityChange,true);Jt(window).on("focus",this.fFocus);Jt(window).on("blur",this.fBlur);this.oRequest=new Ut.Request({szPluginContainer:this.oOptions.szPluginContainer,cbConnectSuccess:this.oOptions.cbConnectSuccess,cbConnectError:this.oOptions.cbConnectError,cbConnectClose:function i(e){if(t.iCreateWndTimer>0){clearTimeout(t.iCreateWndTimer);t.iCreateWndTimer=-1}if(t.oOptions.cbConnectClose){t.oOptions.cbConnectClose(e)}},oSessionInfo:this.oOptions.oSessionInfo,bNoDetectPort:this.oOptions.bNoDetectPort,bUseInQT:this.oOptions.bUseInQT,iServicePortStart:this.oOptions.iServicePortStart,iServicePortEnd:this.oOptions.iServicePortEnd});if(this.oRequest!==null){Jt(window).on("unload",this.fUnload)}}Ht(r,[{key:"JS_Disconnect",value:function e(){this.oRequest.disconnect()}},{key:"JS_CreateWnd",value:function t(n,u,l){var f=this;this.szWndId=n;var e=new Promise(function(t,i){var e=null;if(f.oOptions.szIframeId&&Jt("#"+f.oOptions.szIframeId).length){e=Jt("#"+n,Jt("#"+f.oOptions.szIframeId)[0].contentWindow.document)}else{e=Jt("#"+n)}if(e.length>0){var o=jt.oUtils.getWndPostion(e,f.bEmbed,f.oOptions.szIframeId,f.oOptions.bChildIframe,f.oOptions.szChildIframeId);var s=f.oOptions.szIframeId?Jt("#"+f.oOptions.szIframeId)[0].contentWindow||window.top:window.top;var a=s.document.title;f.iCreateWndTimer=function(){var r="";if(jt.oUtils.browser().msie){r="IEFrame"}else if(jt.oUtils.browser().chrome){r="Chrome"}if(!f.bDevTool){var e=jt.oUtils.getDevicePixelRatio();u=Math.round(u*e);l=Math.round(l*e);var n=function n(e,t){var i=function i(t,n){f.oRequest.createWnd(o.left,o.top,u,l,r,f.bEmbed,f.oPluginColor).then(function(){s.document.title=a;f.freshDocumentTitle();t()},function(e){s.document.title=a;f.freshDocumentTitle();if(5001===e.errorCode){if(!document.hidden&&!f.bFreeze&&f.bFocus){f.fShowWnd()}t()}else{n(e)}})};f.handleBeforeCreateWnd(f.oOptions.beforeCreateWnd).then(function(){i(e,t)},function(){i(e,t)})};f.oRequest.destroyWnd().then(function(){n(t,i)},function(){n(t,i)})}};Jt(function(){f.oRequest.getRequestUUID().then(function(e){if(!e){i("uuid undefined");return false}s.document.title=e;f.freshDocumentTitle();f.iCreateWndTimer()})})}else{i()}});return e}},{key:"handleBeforeCreateWnd",value:function n(i){return new Promise(function(e,t){if("function"===typeof i){try{i(e,t)}catch(n){t(n)}}else{e()}})}},{key:"JS_CheckLocalServiceConnected",value:function o(n,i,r){var e=new Promise(function(e,t){Ut.Request.checkLocalServiceConnected(n,i,r).then(function(){e()},function(){t()})});return e}},{key:"JS_ShowWnd",value:function i(){var n=this;var e=new Promise(function(e,t){n.bFreeze=false;if(!document.hidden&&!n.bDevTool){n.fShowWnd()}e()});return e}},{key:"JS_HideWnd",value:function s(){var n=this;var e=new Promise(function(e,t){n.bFreeze=true;n.fHideWnd().then(function(){e()},function(){t()})});return e}},{key:"JS_SetWndCover",value:function a(i,r){var o=this;var e=new Promise(function(e,t){var n=jt.oUtils.getDevicePixelRatio();if(!jt.oUtils.browser().msie){if("left"===i){o.oWndCover.left=r}else if("top"===i){o.oWndCover.top=r}else if("right"===i){o.oWndCover.right=r}else if("bottom"===i){o.oWndCover.bottom=r}}r=Math.round(r*n);o.oRequest.setWndCover(i,r).then(function(){e()},function(){t()})});return e}},{key:"JS_SetWindowControlCallback",value:function h(e){var t=this;Jt.extend(this.oPluginCallback,e);var n={onGetSelectWndInfo:function i(e){if(0<=e.wndInfo.wndIndex){t.fCurrentCallback=t.afCurrentCallback[e.wndInfo.wndIndex]}if(t.oPluginCallback.onGetSelectWndInfo){t.oPluginCallback.onGetSelectWndInfo(parseInt(e.wndInfo.wndIndex,10))}},onPluginEventHandler:function r(e){if(t.oPluginCallback.onPluginEventHandler){t.oPluginCallback.onPluginEventHandler(parseInt(e.wndIndex,10),parseInt(e.eventType,10))}},onDrawCallback:function o(e){if(t.fCurrentCallback){t.fCurrentCallback(e.shapeInfo)}},onDrawEvent:function s(e){if(t.oPluginCallback.onDrawEvent){t.oPluginCallback.onDrawEvent(e)}},onFisheyePTZInfo:function a(e){if(t.oPluginCallback.onFisheyePTZInfo){t.oPluginCallback.onFisheyePTZInfo(e&&e.fishEyePTZInfo)}},onFullScreenChange:function u(e){if(t.oPluginCallback.onFullScreenChange){t.oPluginCallback.onFullScreenChange(e&&e.full)}},onMouseEvent:function l(e){if(t.oPluginCallback.onMouseEvent){t.oPluginCallback.onMouseEvent(e&&e.mouseInfo)}},onUploadAlarmInfo:function f(e){if(t.oPluginCallback.onUploadAlarmInfo){t.oPluginCallback.onUploadAlarmInfo(e&&e.alarm)}},onGetVoiceInfo:function c(e){if(t.oPluginCallback.onGetVoiceInfo){if(e&&e.dbValue){t.oPluginCallback.onGetVoiceInfo([e.dbValue])}if(e&&e.levlAngle){t.oPluginCallback.onGetVoiceInfo([],parseInt(e.levlAngle,10))}}}};this.oRequest.setWindowControlCallback(n)}},{key:"JS_ArrangeWindow",value:function u(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.arrangeWindow(n,i).then(function(){e()},function(){t()})});return e}},{key:"JS_SetSecretKey",value:function l(e,n,i){var r=this;var t=new Promise(function(e,t){r.oRequest.setSecretKey(n,i).then(function(){e()},function(e){t(e.errorCode)})});return t}},{key:"JS_SetOriginalString",value:function f(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.setOriginalString(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetEncryptString",value:function c(e,i,r){var o=this;var t=new Promise(function(t,n){o.oRequest.getEncryptString(e,i,r).then(function(e){t(e.encryptString)},function(e){n(e.errorCode)})});return t}},{key:"JS_GetDecryptString",value:function d(e,i,r){var o=this;var t=new Promise(function(t,n){o.oRequest.getDecryptString(e,i,r).then(function(e){t(e.decryptString)},function(e){n(e.errorCode)})});return t}},{key:"JS_DestroyPlugin",value:function p(n){var i=this;this.oPluginCallback={};var e=new Promise(function(e,t){i.oRequest.destroyWnd().then(function(){if(n){i.JS_Disconnect()}e()},function(){t()})});return e}},{key:"JS_DestroyAll",value:function v(){this.JS_DestroyPlugin();this.oRequest.destroy();return Promise.resolve()}},{key:"JS_Play",value:function m(n,i,r,o,s){var a=this;var e=new Promise(function(e,t){a.oRequest.startPlay(n,i,r,o,s).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_Play2",value:function y(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.startPlayV2(i,n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_ReversePlay",value:function g(n,i,r,o,s){var a=this;var e=new Promise(function(e,t){a.oRequest.reversePlay(n,i,r,o,s).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_Stop",value:function P(n){var i=this;var e=new Promise(function(e,t){i.oRequest.stop(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_Seek",value:function w(){var e=new Promise(function(e){e()});return e}},{key:"JS_StopRealPlayAll",value:function S(){var n=this;var e=new Promise(function(e,t){n.oRequest.stopAll().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_Pause",value:function _(n){var i=this;var e=new Promise(function(e,t){i.oRequest.pause(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_Resume",value:function b(n){var i=this;var e=new Promise(function(e,t){i.oRequest.resume(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_Slow",value:function C(n){var i=this;var e=new Promise(function(e,t){i.oRequest.slow(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_Fast",value:function k(n){var i=this;var e=new Promise(function(e,t){i.oRequest.fast(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_Transmission",value:function T(){var e=new Promise(function(e){e()});return e}},{key:"JS_FrameForward",value:function R(n){var i=this;var e=new Promise(function(e,t){i.oRequest.frame(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetOSDTime",value:function D(e){var i=this;var t=new Promise(function(t,n){i.oRequest.getOSDTime(e).then(function(e){t(e.osdTime)},function(e){n(e.errorCode)})});return t}},{key:"JS_GetPlayInfo",value:function x(e){var i=this;var t=new Promise(function(t,n){i.oRequest.getPlayInfo(e).then(function(e){t(e.playInfo)},function(e){n(e.errorCode)})});return t}},{key:"JS_OpenSound",value:function I(n){var i=this;var e=new Promise(function(e,t){i.oRequest.openSound(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_CloseSound",value:function E(){var n=this;var e=new Promise(function(e,t){n.oRequest.closeSound().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetVolume",value:function q(e){var i=this;var t=new Promise(function(t,n){i.oRequest.getVolume(e).then(function(e){t(e.volume)},function(e){n(e.errorCode)})});return t}},{key:"JS_SetVolume",value:function A(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.setVolume(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_EnableZoom",value:function O(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.enableZoom(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_DisableZoom",value:function M(n){var i=this;var e=new Promise(function(e,t){i.oRequest.disableZoom(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_CapturePicture",value:function L(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.capture(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StartSave",value:function F(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.startSave(n,i,r.iPackageType).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StopSave",value:function W(n){var i=this;var e=new Promise(function(e,t){i.oRequest.stopSave(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StartTalk",value:function N(n,i,r,o,s,a,u,l,f,c){var h=this;var e=new Promise(function(e,t){h.oRequest.startTalk(n,i,r,o,s,a,u,l,f,c).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StopTalk",value:function B(){var n=this;var e=new Promise(function(e,t){n.oRequest.stopTalk().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetPlayMode",value:function z(){var e=new Promise(function(e){e()});return e}},{key:"JS_SetFullScreenCapability",value:function J(n){var i=this;var e=new Promise(function(e,t){i.oRequest.setFullScreenCapability(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_FullScreenDisplay",value:function H(n){var i=this;var e=new Promise(function(e,t){i.oRequest.fullScreen(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_EnableIVS",value:function U(n,i,r){var o=this;var e=new Promise(function(e,t){o.oRequest.enableIVS(n,i,r).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SRInit",value:function j(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.SRInit(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SRPTZ",value:function G(n,i,r){var o=this;var e=new Promise(function(e,t){o.oRequest.SRPTZ(n,i,r).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetPlaybackDrawType",value:function V(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.setPlaybackDrawType(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetPlayBackType",value:function Y(n){var i=this;var e=new Promise(function(e,t){i.oRequest.setPlayBackType(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetTrsPlayBackParam",value:function X(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.setTrsPlayBackParam(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetLocalConfig",value:function Z(){var i=this;var e=new Promise(function(t,n){i.oRequest.getLocalConfig().then(function(e){t(e.localConfig);i.iProtocolType=parseInt(e.localConfig.protocolType,10)},function(e){n(e&&e.errorCode)})});return e}},{key:"JS_GetEngineSupport",value:function K(){var e=this;var t=new Promise(function(t,n){e.oRequest.getEngineSupport().then(function(e){t(e)},function(e){n(e&&e.errorCode)})});return t}},{key:"JS_SetLocalConfig",value:function $(n){var i=this;var e=new Promise(function(e,t){i.oRequest.setLocalConfig(n).then(function(){i.iProtocolType=parseInt(n.protocolType,10);e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetLastError",value:function Q(){var e=this;var t=new Promise(function(t,n){e.oRequest.getLastError().then(function(e){t(e.lastError)},function(e){n(e.errorCode)})});return t}},{key:"JS_OpenFileBrowser",value:function ee(e,i){var r=this;var t=new Promise(function(t,n){if(!r.bLocalServiceRunning||r.bOpened){n();return}r.bOpened=true;r.oRequest.browseFilePath(e,i).then(function(e){r.bOpened=false;t(e.filepath)},function(e){r.bOpened=false;n(e.errorCode)})});return t}},{key:"JS_OpenDirectory",value:function te(n){var i=this;var e=new Promise(function(e,t){i.oRequest.openDirectory(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StartAsynUpload",value:function ne(n,i,r,o){var s=this;var e=new Promise(function(e,t){s.oRequest.startAsynUpload(n,i,r,o).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StopAsynUpload",value:function ie(){var n=this;var e=new Promise(function(e,t){n.oRequest.stopAsynUpload().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetUploadErrorInfo",value:function re(){var e=this;var t=new Promise(function(t,n){e.oRequest.getUploadErrorInfo().then(function(e){t(e.errorInfo)},function(e){n(e.errorCode)})});return t}},{key:"JS_UploadFile",value:function oe(e,i,r,o){var s=this;var t=new Promise(function(t,n){s.oRequest.uploadFile(e,i,r,o).then(function(e){t(e)},function(e){n({readyState:4,status:e.errorCode,responseXML:e.errorInfo?jt.oUtils.parseXmlFromStr(e.errorInfo):null,errorInfo:e.errorInfo})})});return t}},{key:"JS_GetIpcImportErrorInfo",value:function se(){var e=this;var t=new Promise(function(t,n){e.oRequest.getIpcImportErrorInfo().then(function(e){t(e.errorInfo)},function(e){n(e.errorCode)})});return t}},{key:"JS_DownloadFile",value:function ae(e,i,r,o,s,a){var u=this;var t=new Promise(function(t,n){u.oRequest.downloadFile(e,i,r,o,s,a).then(function(e){if(typeof e.ret==="undefined"){t(0)}else{t(e.ret)}},function(e){n({readyState:4,status:e.errorCode,responseXML:e.errorInfo?jt.oUtils.parseXmlFromStr(e.errorInfo):null})})});return t}},{key:"JS_DownloadFileNoPlugin",value:function ue(t){var e=new Promise(function(e){Jt("body").append('<a id="jsplugin_download_a" href="'+t+'"><li id="jsplugin_download_li"></li></a>');Jt("#jsplugin_download_li").trigger("click");Jt("#jsplugin_download_a").remove();e()});return e}},{key:"JS_StartUpgrade",value:function le(n,i,r,o,s){var a=this;var e=new Promise(function(e,t){a.oRequest.startUpgrade(n,i,r,o,s).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StopUpgrade",value:function fe(){var n=this;var e=new Promise(function(e,t){n.oRequest.stopUpgrade().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetUpgradeStatus",value:function ce(){var e=this;var t=new Promise(function(t,n){e.oRequest.getUpgradeStatus().then(function(e){t(e.upgradeStatus)},function(e){n(e.errorCode)})});return t}},{key:"JS_GetUpgradeProgress",value:function he(){var e=this;var t=new Promise(function(t,n){e.oRequest.getUpgradeProgress().then(function(e){t(e.upgradeProgress)},function(e){n(e.errorCode)})});return t}},{key:"JS_ExportDeviceLog",value:function de(e,i,r){var o=this;var t=new Promise(function(t,n){o.oRequest.exportDeviceLog(e,i,r).then(function(e){if(typeof e.ret==="undefined"){t(0)}else{t(e.ret)}},function(e){n(e.errorCode)})});return t}},{key:"JS_ExportReport",value:function pe(e,i,r){var o=this;var t=new Promise(function(t,n){o.oRequest.exportReport(e,i,r).then(function(e){if(typeof e.ret==="undefined"){t(0)}else{t(e.ret)}},function(e){n(e.errorCode)})});return t}},{key:"JS_StartAsyncDownload",value:function ve(e,i,r,o){var s=this;var t=new Promise(function(t,n){s.oRequest.startAsyncDownload(e,i,r,o,s.iPackageType).then(function(e){t(e.downloadId)},function(e){n({readyState:4,status:e.errorCode,responseXML:e.errorInfo?jt.oUtils.parseXmlFromStr(e.errorInfo):null})})});return t}},{key:"JS_StopAsyncDownload",value:function me(n){var i=this;var e=new Promise(function(e,t){i.oRequest.stopAsyncDownload(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetDownloadStatus",value:function ye(e){var i=this;var t=new Promise(function(t,n){i.oRequest.getDownloadStatus(e).then(function(e){t(e.downloadStatus)},function(e){n(e.errorCode)})});return t}},{key:"JS_GetDownloadProgress",value:function ge(e){var i=this;var t=new Promise(function(t,n){i.oRequest.getDownloadProgress(e).then(function(e){t(e.downloadProgress)},function(e){n(e.errorCode)})});return t}},{key:"JS_EnablePDC",value:function Pe(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.enablePDC(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_Resize",value:function we(o,s){var a=this;var e=new Promise(function(e,t){var n=null;if(a.oOptions.szIframeId&&Jt("#"+a.oOptions.szIframeId).length){n=Jt("#"+a.szWndId,Jt("#"+a.oOptions.szIframeId)[0].contentWindow.document)}else{n=Jt("#"+a.szWndId)}if(n.length>0){var i=jt.oUtils.getWndPostion(n,a.bEmbed,a.oOptions.szIframeId,a.oOptions.bChildIframe,a.oOptions.szChildIframeId);var r=jt.oUtils.getDevicePixelRatio();if(!jt.oUtils.browser().msie){if(a.oWndCover.left>0){i.left=i.left+Math.round(a.oWndCover.left*r);o=o-a.oWndCover.left}if(a.oWndCover.top>0){i.top=i.top+Math.round(a.oWndCover.top*r);s=s-a.oWndCover.top}if(a.oWndCover.right>0){o=o-a.oWndCover.right}if(a.oWndCover.bottom>0){s=s-a.oWndCover.bottom}}o=Math.round(o*r);s=Math.round(s*r);a.oRequest.setWndGeometry(i.left,i.top,o,s).then(function(){e()},function(){t()})}else{t()}});return e}},{key:"JS_SetDrawCallback",value:function Se(n,i,r,o,s,a){var u=this;a=a||{};u.fCurrentCallback=null;u.afCurrentCallback[n]=null;var e=new Promise(function(e,t){u.oRequest.setDrawCallback(n,i,r,o,a).then(function(){u.fCurrentCallback=s;u.afCurrentCallback[n]=s;e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetDrawStatus",value:function _e(n){var i=this;var e=new Promise(function(e,t){i.oRequest.setDrawStatus(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_ClearRegion",value:function be(){var n=this;var e=new Promise(function(e,t){n.oRequest.clearRegion().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetDrawShapeInfo",value:function Ce(n,i){var r=this;var e=new Promise(function(e,t){if(r.iDrawWondIndex!==-1){i.wndIndex=r.iDrawWondIndex}r.oRequest.setDrawShapeInfo(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetGridInfo",value:function ke(n){var i=this;var e=new Promise(function(e,t){i.oRequest.setGridInfo(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetGridInfo",value:function Te(){var e=this;var t=new Promise(function(t,n){e.oRequest.getGridInfo().then(function(e){t(e.gridInfo)},function(e){n(e.errorCode)})});return t}},{key:"JS_SetRectInfo",value:function Re(i){var r=this;var e=new Promise(function(e,t){if(r.iDrawWondIndex!==-1){var n=void 0;for(n=0;n<i.length;n++){i[n].wndIndex=r.iDrawWondIndex}}r.oRequest.setRectInfo(i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetRectInfo",value:function De(){var e=this;var t=new Promise(function(t,n){e.oRequest.getRectInfo(e.iDrawWondIndex).then(function(e){t(e.rectInfo)},function(e){n(e.errorCode)})});return t}},{key:"JS_SetPolygonInfo",value:function xe(i){var r=this;var e=new Promise(function(e,t){if(r.iDrawWondIndex!==-1){var n=void 0;for(n=0;n<i.length;n++){i[n].wndIndex=r.iDrawWondIndex}}r.oRequest.setPolygonInfo(i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetPolygonInfo",value:function Ie(){var e=this;var t=new Promise(function(t,n){e.oRequest.getPolygonInfo(e.iDrawWondIndex).then(function(e){t(e.polygonInfo)},function(e){n(e.errorCode)})});return t}},{key:"JS_SetLineInfo",value:function Ee(n){var i=this;var e=new Promise(function(e,t){i.oRequest.setLineInfo(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetLineInfo",value:function qe(){var e=this;var t=new Promise(function(t,n){e.oRequest.getLineInfo().then(function(e){t(e.lineInfo)},function(e){n(e.errorCode)})});return t}},{key:"JS_SetPointInfo",value:function Ae(n){var i=this;var e=new Promise(function(e,t){i.oRequest.setPointInfo(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetPointInfo",value:function Oe(){var e=this;var t=new Promise(function(t,n){e.oRequest.getPointInfo().then(function(e){t(e.pointInfo)},function(e){n(e.errorCode)})});return t}},{key:"JS_SetTextOverlay",value:function Me(n){var i=this;var e=new Promise(function(e,t){i.oRequest.setTextOverlay(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetTextOverlay",value:function Le(){var e=this;var t=new Promise(function(t,n){e.oRequest.getTextOverlay().then(function(e){t(e.overlayInfo)},function(e){n(e.errorCode)})});return t}},{key:"JS_ClearShapeByType",value:function Fe(i,e){var r=this;var t=new Promise(function(t,n){r.oRequest.clearShapeByType(i,e).then(function(e){if("Choosed"===i){t(e.clearedShapeId)}else{t()}},function(e){n(e.errorCode)})});return t}},{key:"JS_ChooseShape",value:function We(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.chooseShape(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetCorrectionType",value:function Ne(n){var i=this;var e=new Promise(function(e,t){i.oRequest.setCorrectionType(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetPlaceType",value:function Be(n){var i=this;var e=new Promise(function(e,t){i.oRequest.setPlaceType(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StartFishListener",value:function ze(n,i,r){var o=this;var e=new Promise(function(e,t){o.oRequest.startFishListener(n,i,r).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StopFishListener",value:function Je(){var n=this;var e=new Promise(function(e,t){n.oRequest.stopFishListener().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetFishBoxListInfo",value:function He(n){var i=this;var e=new Promise(function(e,t){i.oRequest.setFishBoxListInfo(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetFishBoxListInfo",value:function Ue(){var e=this;var t=new Promise(function(t,n){e.oRequest.getFishBoxListInfo().then(function(e){t(e.fishBoxList)},function(e){n(e.errorCode)})});return t}},{key:"JS_ClearAllWndFishBoxInfo",value:function je(){var n=this;var e=new Promise(function(e,t){n.oRequest.clearAllWndFishBoxInfo().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetFishWndProperty",value:function Ge(n,i,r){var o=this;var e=new Promise(function(e,t){o.oRequest.setFishWndProperty(n,i,r).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetFishParams",value:function Ve(n,i,r,o){var s=this;var e=new Promise(function(e,t){s.oRequest.setFishParams(n,i,r,o).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_ArrangeFECWindow",value:function Ye(n){var i=this;var e=new Promise(function(e,t){i.oRequest.arrangeFECWindow(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StartFECScan",value:function Xe(n){var i=this;var e=new Promise(function(e,t){i.oRequest.startFECScan(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StopFECScan",value:function Ze(){var n=this;var e=new Promise(function(e,t){n.oRequest.stopFECScan().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_FishEyePTZ",value:function Ke(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.fishEyePTZ(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_FishEyeGetPreset",value:function $e(){var e=this;var t=new Promise(function(t,n){e.oRequest.fishEyeGetPreset().then(function(e){t(e.fishEyePreset)},function(e){n(e.errorCode)})});return t}},{key:"JS_FishEyeSetPreset",value:function Qe(n){var i=this;var e=new Promise(function(e,t){i.oRequest.fishEyeSetPreset(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StartFECCruise",value:function et(n){var i=this;var e=new Promise(function(e,t){i.oRequest.startFECCruise(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StopFECCruise",value:function tt(){var n=this;var e=new Promise(function(e,t){n.oRequest.stopFECCruise().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetIsHttps",value:function nt(n){var i=this;var e=new Promise(function(e,t){i.oRequest.setIsHttps(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetReconnectInfo",value:function it(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.setReconnectInfo(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_CheckUpdate",value:function rt(n){var i=this;var e=new Promise(function(r,e){var t=jt.oUtils.parseXmlFromStr(n);var o=Jt(t).find("localServiceControl").eq(0).text();i.oRequest.getLocalServiceVersion().then(function(e){var t=parseInt(e.localServiceVersion.replace(/\./g,""),10);var n=parseInt(o.replace(/\./g,""),10);var i=n>t;r(i)},function(){e()})});return e}},{key:"JS_SelectShape",value:function ot(n,i){var r=this;var e=new Promise(function(e,t){r.oRequest.selectShape(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetPictureSize",value:function st(e){var i=this;var t=new Promise(function(t,n){i.oRequest.getPictureSize(e).then(function(e){t(e)},function(e){n(e.errorCode)})});return t}},{key:"JS_SetOriginResolution",value:function at(n,i,r){var o=this;var e=new Promise(function(e,t){o.oRequest.setOriginResolution(n,i,r).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetPlayWndMode",value:function ut(n,i,r){var o=this;var e=new Promise(function(e,t){o.oRequest.setPlayWndMode(n,i,r).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_CuttingPartWindow",value:function lt(n,i,r,o){var s=this;var e=new Promise(function(e,t){s.oRequest.cuttingPartWindow(n,i,r,o).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_RepairPartWindow",value:function ft(n,i,r,o){var s=this;var e=new Promise(function(e,t){s.oRequest.repairPartWindow(n,i,r,o).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_PlayWithImg",value:function ct(){return Promise.resolve()}},{key:"JS_SetPackageType",value:function ht(e){this.iPackageType=e;return Promise.resolve()}},{key:"JS_SetSnapDrawWndIndex",value:function dt(e){this.iDrawWondIndex=e;return Promise.resolve()}},{key:"JS_ExistGetSlfPointList",value:function pt(){return Promise.resolve(true)}},{key:"JS_GetSlfPointList",value:function vt(e,i){var r=this;var t=new Promise(function(t,n){r.oRequest.getSlfPointList(e,i).then(function(e){t(e.points)},function(e){n(e.errorCode)})});return t}},{key:"JS_SetWindowSelected",value:function mt(n){var i=this;var e=new Promise(function(e,t){i.oRequest.setWindowSelected(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_AudioPlay",value:function yt(n,i,r,o,s,a){var u=this;var e=new Promise(function(e,t){u.oRequest.audioPlay(n,i,r,o,s,a).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StartSycAudioPlay",value:function gt(n,i,r,o){var s=this;var e=new Promise(function(e,t){s.oRequest.startSycAudioPlay(n,i,r,o).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetDownFilePath",value:function Pt(e){var i=this;var t=new Promise(function(t,n){i.oRequest.getDownFilePath(e).then(function(e){t(e.files)},function(e){n(e.errorCode)})});return t}},{key:"JS_DeleteDownLoadFile",value:function wt(e){var i=this;var t=new Promise(function(t,n){i.oRequest.deleteDownloadFile(e).then(function(e){t(e)},function(e){n(e.errorCode)})});return t}},{key:"JS_SycVideoAndAudio",value:function St(e,i,r){var o=this;var t=new Promise(function(t,n){o.oRequest.sycVideoAndAudio(e,i,r).then(function(e){t(e.files)},function(e){n(e.errorCode)})});return t}},{key:"JS_StopSycAudioPlay",value:function _t(n){var i=this;var e=new Promise(function(e,t){i.oRequest.stopSycAudioPlay(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetAudioPlayStatus",value:function bt(n){var i=this;var e=new Promise(function(e,t){i.oRequest.setAudioPlayStatus(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StopAudioPlay",value:function Ct(){var n=this;var e=new Promise(function(e,t){n.oRequest.stopAudioPlay().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StartAudioSave",value:function kt(n){var i=this;var e=new Promise(function(e,t){i.oRequest.startAudioRecord(n).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StopAudioSave",value:function Tt(){var n=this;var e=new Promise(function(e,t){n.oRequest.stopAudioSave().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_GetAudioPlayedTime",value:function Rt(){var e=this;var t=new Promise(function(n,i){if(!e.bLocalServiceRunning){i();return}e.oRequest.getAudioPlayedTime().then(function(e){var t=e.time;if(t<0||!t){i()}else{n(t)}},function(e){i(e.errorCode)})});return t}},{key:"JS_AudioPause",value:function Dt(){var n=this;var e=new Promise(function(e,t){if(!n.bLocalServiceRunning){t();return}n.oRequest.audioPlayPasue().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_AudioResume",value:function xt(){var n=this;var e=new Promise(function(e,t){if(!n.bLocalServiceRunning){t();return}n.oRequest.audioPlayResume().then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_SetAudioVolume",value:function It(n,i){var r=this;var e=new Promise(function(e,t){if(!r.bLocalServiceRunning){t();return}r.oRequest.setAudioVolume(n,i).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StartAlarmChan",value:function Et(e,t,n,i){var r=Array.prototype.slice.call(arguments,0);return this.commonReturn("startAlarmChan",r)}},{key:"JS_StopAlarmChan",value:function qt(e){var t=Array.prototype.slice.call(arguments,0);return this.commonReturn("stopAlarmChan",t)}},{key:"JS_StartFormAsynUpload",value:function At(e,t){var n=Array.prototype.slice.call(arguments,0);return this.commonReturn("startFormAsynUpload",n)}},{key:"JS_StopFormAsynUpload",value:function Ot(e){var t=Array.prototype.slice.call(arguments,0);return this.commonReturn("stopFormAsynUpload",t)}},{key:"JS_IsPluginExist",value:function Mt(){var e=false;if(this.oRequest&&this.oRequest.oRequest&&this.oRequest.oRequest.szUUID){e=true}return e}},{key:"JS_OpenFileBrowser2",value:function Lt(){var e=Array.prototype.slice.call(arguments,0);return this.commonReturn("openFileBrowser2",e)}},{key:"commonReturn",value:function Ft(r){var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var s=this;var e=new Promise(function(t,n){try{var e;(e=s.oRequest)[r].apply(e,Gt(o)).then(function(e){t(e)},function(e){n(e)})}catch(i){n(i)}});return e}},{key:"freshDocumentTitle",value:function Wt(){var e=document.createElement("iframe");e.src="data:text/html;base64,bm90aGluZw==";e.style.display="none";var t=function t(){setTimeout(function(){e.removeEventListener("load",t);e.parentNode.removeChild(e)},0)};e.addEventListener("load",t);document.body.appendChild(e)}},{key:"JS_SetPicInfoToPlayer",value:function Nt(n,i,r,o){var s=this;var e=new Promise(function(e,t){if(!s.bLocalServiceRunning){t();return}s.oRequest.setPicInfoToPlayer(n,i,r,o).then(function(){e()},function(e){t(e.errorCode)})});return e}},{key:"JS_StartSyncHttpTransmission",value:function Bt(e){var i=this;var t=new Promise(function(t,n){if(!i.bLocalServiceRunning){n();return}i.oRequest.syncHttpTransmission(e).then(function(e){t(e)},function(e){n(e.errorCode)})});return t}},{key:"JS_GetCaptureData",value:function zt(e){var i=this;var t=new Promise(function(t,n){if(!i.bLocalServiceRunning){n();return}i.oRequest.getCaptureData(e).then(function(e){t(e.fileContent)},function(e){n(e.errorCode)})});return t}}]);return r}();return e}();r.LocalServiceControl=i}).call(this,o(1))},function(e,i,r){"use strict";(function(Lt){Object.defineProperty(i,"__esModule",{value:true});i.Request=undefined;var Ft=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var Wt=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(e,t,n){if(t)i(e.prototype,t);if(n)i(e,n);return e}}();var Nt=r(77);var Bt=r(78);var zt=r(88);var Jt=r(10);var e=r(18);var Ht=t(e);function t(e){return e&&e.__esModule?e:{"default":e}}function Ut(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++){n[t]=e[t]}return n}else{return Array.from(e)}}function jt(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var n=function(){var e=function(){function n(e){jt(this,n);var t={szPluginContainer:"",cbConnectSuccess:null,cbConnectError:null,cbConnectClose:null,iServicePortStart:33686,iServicePortEnd:33689};this.oOptions=Lt.extend(t,e);this.iPort=-1;this.oRequest=null;this.isInit=false;this.oCallbacks={};this.oRequestPromise=this.init(this.oOptions.oSessionInfo)||Promise.resolve(false)}Wt(n,[{key:"destroy",value:function t(){var e=this;this.disconnect().then(function(){e.oOptions=null;e.oRequest=null;e.oCallbacks={}})}},{key:"init",value:function s(e){var i=this;var r=Lt.Deferred();if(i.oOptions.bNoDetectPort){i.oRequest=new Nt.WebSocketRequest({iPort:i.oOptions.iServicePortStart,cbConnectSuccess:i.oOptions.cbConnectSuccess,cbConnectError:i.oOptions.cbConnectError,cbConnectClose:i.oOptions.cbConnectClose});r.resolve(true)}else{if(i.oOptions.bUseInQT){i.oRequest=new zt.WebChannelRequest({iPort:i.iPort,cbConnectSuccess:i.oOptions.cbConnectSuccess,cbConnectError:i.oOptions.cbConnectError,cbConnectClose:i.oOptions.cbConnectClose});r.resolve(true)}else{Jt.oUtils.detectPort(i.oOptions.iServicePortStart,i.oOptions.iServicePortEnd,{oSessionInfo:e,success:function o(e){i.iPort=e;if(Jt.oUtils.browser().msie){r.resolve(false)}else{if("https:"===window.location.protocol){if(Jt.oUtils.browser().chrome){try{i.oRequest=new Nt.WebSocketRequest({iPort:i.iPort,cbConnectSuccess:i.oOptions.cbConnectSuccess,cbConnectError:i.oOptions.cbConnectError,cbConnectClose:i.oOptions.cbConnectClose})}catch(n){i.oRequest=new Bt.ImageHttpRequest({iPort:i.iPort,cbConnectSuccess:i.oOptions.cbConnectSuccess,cbConnectError:i.oOptions.cbConnectError,cbConnectClose:i.oOptions.cbConnectClose})}}else{i.oRequest=new Bt.ImageHttpRequest({iPort:i.iPort,cbConnectSuccess:i.oOptions.cbConnectSuccess,cbConnectError:i.oOptions.cbConnectError,cbConnectClose:i.oOptions.cbConnectClose})}r.resolve(true)}else{if("WebSocket"in window){i.oRequest=new Nt.WebSocketRequest({iPort:i.iPort,cbConnectSuccess:i.oOptions.cbConnectSuccess,cbConnectError:i.oOptions.cbConnectError,cbConnectClose:i.oOptions.cbConnectClose});r.resolve(true)}else{r.resolve(false)}}}i.isInit=true;for(var t in i.oCallbacks){i.oRequest[t](i.oCallbacks[t])}},error:function t(){if(i.oOptions.cbConnectError){i.oOptions.cbConnectError()}r.resolve(false)}})}}return r.promise()}},{key:"setWindowControlCallback",value:function e(r){var o=this;return this.oRequest?this.oRequest.setWindowControlCallback(r):new Promise(function(n,i){o.oRequestPromise.then(function(e){if(e){try{o.oRequest.setWindowControlCallback(r);n()}catch(t){i(t)}}else{i("request init fail")}},function(e){i(e)})})}},{key:"getServiceVersion",value:function i(){return this.oRequest?this.oRequest.getServiceVersion():""}},{key:"getRequestUUID",value:function r(){var i=this;return this.oRequest?Promise.resolve(this.oRequest.getRequestUUID()):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){t(i.oRequest.getRequestUUID())}else{n("oRequest init fail")}},function(e){n(e)})})}},{key:"disconnect",value:function o(){var r=this;return this.oRequest?this.oRequest.disconnect():new Promise(function(n,i){r.oRequestPromise.then(function(e){if(e){try{r.oRequest.disconnect();n()}catch(t){i(t)}}else{i("request init fail")}},function(e){i(e)})})}},{key:"createWnd",value:function c(i,r,o,s,a,u,l){var f=this;return this.oRequest?this.oRequest.sendRequest({cmd:"window.createWnd",rect:{left:i,top:r,width:o,height:s},className:a,embed:u,pluginColor:l}):new Promise(function(t,n){f.oRequestPromise.then(function(e){if(e){f.oRequest.sendRequest({cmd:"window.createWnd",rect:{left:i,top:r,width:o,height:s},className:a,embed:u,pluginColor:l}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"showWnd",value:function a(){var i=this;return this.oRequest?this.oRequest.sendRequest({cmd:"window.showWnd"}):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest({cmd:"window.showWnd"}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"hideWnd",value:function u(){var i=this;return this.oRequest?this.oRequest.sendRequest({cmd:"window.hideWnd"}):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest({cmd:"window.hideWnd"}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"destroyWnd",value:function l(){var i=this;return this.oRequest?this.oRequest.sendRequest({cmd:"window.destroyWnd"}):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest({cmd:"window.destroyWnd"}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setWndGeometry",value:function f(i,r,o,s){var a=this;return this.oRequest?this.oRequest.sendRequest({cmd:"window.setWndGeometry",rect:{left:i,top:r,width:o,height:s}}):new Promise(function(t,n){a.oRequestPromise.then(function(e){if(e){a.oRequest.sendRequest({cmd:"window.setWndGeometry",rect:{left:i,top:r,width:o,height:s}}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setWndCover",value:function h(i,r){var o=this;return this.oRequest?this.oRequest.sendRequest({cmd:"window.setWndCover",position:i,size:r}):new Promise(function(t,n){o.oRequestPromise.then(function(e){if(e){o.oRequest.sendRequest({cmd:"window.setWndCover",position:i,size:r}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setWndZOrder",value:function d(i){var r=this;return this.oRequest?this.oRequest.sendRequest({cmd:"window.setWndZOrder",flag:i}):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest({cmd:"window.setWndZOrder",flag:i}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"updateParentWnd",value:function p(){var i=this;return this.oRequest?this.oRequest.sendRequest({cmd:"window.updateParentWnd"}):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest({cmd:"window.updateParentWnd"}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getLocalServiceVersion",value:function v(){var i=this;return this.oRequest?this.oRequest.sendRequest({cmd:"window.getLocalServiceVersion"}):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest({cmd:"window.getLocalServiceVersion"}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"startPlay",value:function m(e,t,n,i,r){var o=this;if(t===null||typeof t==="undefined"){t={}}var s={cmd:"video.startPlay",url:e,token:t.token||"",auth:t.auth||"",wndIndex:n,startTime:i||"",stopTime:r||""};return this.oRequest?this.oRequest.sendRequest(s):new Promise(function(t,n){o.oRequestPromise.then(function(e){if(e){o.oRequest.sendRequest(s).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"startPlayV2",value:function y(e,t){var i=this;if(e===null||typeof e==="undefined"){e={}}var r={cmd:"video.startPlayV2",oParams:e,wndIndex:t};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"stop",value:function g(i){var r=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.stop",wndIndex:i}):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest({cmd:"video.stop",wndIndex:i}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"stopAll",value:function P(){var i=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.stopAll"}):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest({cmd:"video.stopAll"}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"reversePlay",value:function w(e,t,n,i,r){var o=this;if(t===null||typeof t==="undefined"){t={}}var s={cmd:"video.reversePlay",url:e,token:t.token||"",auth:t.auth||"",wndIndex:n,startTime:i||"",stopTime:r||""};return this.oRequest?this.oRequest.sendRequest(s):new Promise(function(t,n){o.oRequestPromise.then(function(e){if(e){o.oRequest.sendRequest(s).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"startSave",value:function S(e,t,n){var i=this;var r={cmd:"video.startSave",wndIndex:e,fileName:t||"",packageType:n};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"stopSave",value:function _(e){var i=this;var r={cmd:"video.stopSave",wndIndex:e};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getLastError",value:function b(){var i=this;var r={cmd:"video.getLastError"};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"openSound",value:function C(e){var i=this;var r={cmd:"video.openSound",wndIndex:e};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"closeSound",value:function k(){var i=this;var r={cmd:"video.closeSound"};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getVolume",value:function T(){var i=this;var r={cmd:"video.getVolume"};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setVolume",value:function R(e,t){var i=this;var r={cmd:"video.setVolume",wndIndex:e,volume:t};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"pause",value:function D(e){var i=this;var r={cmd:"video.pause",wndIndex:e};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setAudioVolume",value:function x(e,t){var n={cmd:"video.setAudioVolume",wndIndex:e,volume:t};return this.oRequest.sendRequest(n)}},{key:"getAudioPlayedTime",value:function I(e){var t={cmd:"video.getAudioPlayedTime",wndIndex:e};return this.oRequest.sendRequest(t)}},{key:"audioPlayPasue",value:function E(e){var t={cmd:"video.audioPlayPasue",wndIndex:e};return this.oRequest.sendRequest(t)}},{key:"audioPlayResume",value:function q(e){var t={cmd:"video.audioPlayResume",wndIndex:e};return this.oRequest.sendRequest(t)}},{key:"resume",value:function A(e){var i=this;var r={cmd:"video.resume",wndIndex:e};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"slow",value:function L(e){var i=this;var r={cmd:"video.slow",wndIndex:e};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"fast",value:function F(e){var i=this;var r={cmd:"video.fast",wndIndex:e};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"frame",value:function W(e){var i=this;var r={cmd:"video.frame",wndIndex:e};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getOSDTime",value:function N(e){var i=this;var r={cmd:"video.getOSDTime",wndIndex:e};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getPlayInfo",value:function O(e){var i=this;var r={cmd:"video.getPlayInfo",wndIndex:e};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"capture",value:function B(e,t){var i=this;var r={cmd:"video.capture",wndIndex:e,fileName:t||""};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"arrangeWindow",value:function z(e,t){var i=this;var r={cmd:"video.arrangeWindow",type:e,custom:t||[]};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"enableIVS",value:function J(e,t,n){var i=this;var r={cmd:"video.enableIVS",wndIndex:e,type:t,enable:n};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setPlaybackDrawType",value:function H(e,t){var i=this;var r={cmd:"video.setPlaybackDrawType",wndIndex:e,type:t};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setPlayBackType",value:function U(e){var i=this;var r={cmd:"video.setPlayBackType",type:e};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setTrsPlayBackParam",value:function j(e,t){var i=this;var r={cmd:"video.setTrsPlayBackParam",wndIndex:e,params:t};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"startTalk",value:function G(e,t,n,i,r,o,s,a,u,l){var f=this;var c={cmd:"video.startTalk",openUrl:e,closeUrl:t,dataUrl:n,auth:i,audioType:r,bitRate:o,sampleRate:s,soundChannel:a,deviceCastChannelNum:u,talkMode:l};return this.oRequest?this.oRequest.sendRequest(c):new Promise(function(t,n){f.oRequestPromise.then(function(e){if(e){f.oRequest.sendRequest(c).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"stopTalk",value:function V(){var i=this;var r={cmd:"video.stopTalk"};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"enableZoom",value:function Y(e,t){var i=this;var r={cmd:"video.enableZoom",wndIndex:e,type:t};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"disableZoom",value:function X(e){var i=this;var r={cmd:"video.disableZoom",wndIndex:e};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setFullScreenCapability",value:function Z(e){var i=this;var r={cmd:"video.setFullScreenCapability",mode:e};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"fullScreen",value:function K(e){var i=this;var r={cmd:"video.fullScreen",full:e};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setSecretKey",value:function $(e,t){var i=this;var r={cmd:"video.setSecretKey",keyType:t,key:e};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getEncryptString",value:function Q(e,t,n){var i=this;var r={cmd:"video.getEncryptString",type:e,originalKey:t,encrypted:n};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setOriginalString",value:function ee(e,t){var i=this;var r={cmd:"video.setOriginalString",key:e,encrypted:t};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getDecryptString",value:function te(e,t,n){var i=this;var r={cmd:"video.getDecryptString",type:e,encrypted:t,key:n};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getLocalConfig",value:function ne(){var i=this;var r={cmd:"video.getLocalConfig"};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getEngineSupport",value:function ie(){var i=this;var r={cmd:"video.getEngineSupport"};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setLocalConfig",value:function re(e){var i=this;var r={cmd:"video.setLocalConfig",localConfig:e};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setPlayMode",value:function oe(e){var i=this;var r={cmd:"video.setPlayMode",mode:e};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"browseFilePath",value:function se(e,t){var i=this;var r={cmd:"video.browseFilePath",mode:e,fileType:t};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"openDirectory",value:function ae(e){var i=this;var r={cmd:"video.openDirectory",dir:e};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"startAsynUpload",value:function ue(e,t,n,i){var r=this;var o={cmd:"video.startAsynUpload",uploadUrl:e,statusUrl:t,auth:n,filepath:i};return this.oRequest?this.oRequest.sendRequest(o):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest(o).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"stopAsynUpload",value:function le(){var i=this;var r={cmd:"video.stopAsynUpload"};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getUploadErrorInfo",value:function fe(){var i=this;var r={cmd:"video.getUploadErrorInfo"};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"uploadFile",value:function ce(e,t,n,i){var r=this;var o={cmd:"video.uploadFile",uploadUrl:e,auth:t,filepath:n,contentType:i};return this.oRequest?this.oRequest.sendRequest(o):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest(o).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getIpcImportErrorInfo",value:function he(){var i=this;var r={cmd:"video.getIpcImportErrorInfo"};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"downloadFile",value:function de(e,t,n,i,r,o){var s=this;var a={cmd:"video.downloadFile",downloadUrl:e,auth:t,xmlContent:n,method:i,fileType:r,decode:o};return this.oRequest?this.oRequest.sendRequest(a):new Promise(function(t,n){s.oRequestPromise.then(function(e){if(e){s.oRequest.sendRequest(a).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"startUpgrade",value:function pe(e,t,n,i,r){var o=this;var s={cmd:"video.startUpgrade",upgradeUrl:e,statusUrl:t,auth:n,filepath:i,upgradeFlag:r};return this.oRequest?this.oRequest.sendRequest(s):new Promise(function(t,n){o.oRequestPromise.then(function(e){if(e){o.oRequest.sendRequest(s).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"stopUpgrade",value:function ve(){var i=this;var r={cmd:"video.stopUpgrade"};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getUpgradeStatus",value:function me(){var i=this;var r={cmd:"video.getUpgradeStatus"};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getUpgradeProgress",value:function ye(){var i=this;var r={cmd:"video.getUpgradeProgress"};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"exportDeviceLog",value:function ge(e,t,n){var i=this;var r={cmd:"video.exportDeviceLog",logXml:e,filename:t,fileType:n};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"enablePDC",value:function Pe(e,t){var i=this;var r={cmd:"video.enablePDC",wndIndex:e,enable:t};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"exportReport",value:function we(e,t,n){var i=this;var r={cmd:"video.exportReport",reportXml:e,filename:t,fileType:n};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"startAsyncDownload",value:function Se(e,t,n,i,r){var o=this;var s={cmd:"video.startAsyncDownload",downloadUrl:e,auth:t,filename:n,downloadXml:i,packageType:r};return this.oRequest?this.oRequest.sendRequest(s):new Promise(function(t,n){o.oRequestPromise.then(function(e){if(e){o.oRequest.sendRequest(s).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"stopAsyncDownload",value:function _e(e){var i=this;var r={cmd:"video.stopAsyncDownload",downloadId:e};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getDownloadStatus",value:function be(e){var i=this;var r={cmd:"video.getDownloadStatus",downloadId:e};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getDownloadProgress",value:function Ce(e){var i=this;var r={cmd:"video.getDownloadProgress",downloadId:e};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"SRInit",value:function ke(e,t){var i=this;var r={cmd:"video.SRInit",wndIndex:e,type:t};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"SRPTZ",value:function Te(e,t,n){var i=this;var r={cmd:"video.SRPTZ",wndIndex:e,direction:t,step:n};return this.oRequest?this.oRequest.sendRequest(r):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest(r).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setDrawCallback",value:function Re(e,t,n,i,r){var o=this;var s={cmd:"video.setDrawCallback",wndIndex:e,enable:t,type:n,display:i};Lt.extend(s,r);return this.oRequest?this.oRequest.sendRequest(s):new Promise(function(t,n){o.oRequestPromise.then(function(e){if(e){o.oRequest.sendRequest(s).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setDrawStatus",value:function De(i){var r=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.setDrawStatus",enable:i}):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest({cmd:"video.setDrawStatus",enable:i}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"clearRegion",value:function xe(){var i=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.clearRegion"}):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest({cmd:"video.clearRegion"}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setDrawShapeInfo",value:function Ie(i,r){var o=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.setDrawShapeInfo",drawType:i,drawInfo:r}):new Promise(function(t,n){o.oRequestPromise.then(function(e){if(e){o.oRequest.sendRequest({cmd:"video.setDrawShapeInfo",drawType:i,drawInfo:r}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setGridInfo",value:function Ee(i){var r=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.setGridInfo",gridInfo:i}):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest({cmd:"video.setGridInfo",gridInfo:i}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getGridInfo",value:function qe(){var i=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.getGridInfo"}):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest({cmd:"video.getGridInfo"}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setPolygonInfo",value:function Ae(i){var r=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.setPolygonInfo",polygonInfo:i}):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest({cmd:"video.setPolygonInfo",polygonInfo:i}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getPolygonInfo",value:function Oe(i){var r=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.getPolygonInfo",wndIndex:i}):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest({cmd:"video.getPolygonInfo",wndIndex:i}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setLineInfo",value:function Me(i){var r=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.setLineInfo",lineInfo:i}):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest({cmd:"video.setLineInfo",lineInfo:i}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getLineInfo",value:function Le(){var i=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.getLineInfo"}):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest({cmd:"video.getLineInfo"}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setPointInfo",value:function Fe(i){var r=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.setPointInfo",pointInfo:i}):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest({cmd:"video.setPointInfo",pointInfo:i}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getPointInfo",value:function We(){var i=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.getPointInfo"}):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest({cmd:"video.getPointInfo"}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setTextOverlay",value:function Ne(i){var r=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.setTextOverlay",overlayInfo:i}):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest({cmd:"video.setTextOverlay",overlayInfo:i}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getTextOverlay",value:function Be(){var i=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.getTextOverlay"}):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest({cmd:"video.getTextOverlay"}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setRectInfo",value:function ze(i){var r=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.setRectInfo",rectInfo:i}):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest({cmd:"video.setRectInfo",rectInfo:i}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getRectInfo",value:function Je(i){var r=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.getRectInfo",wndIndex:i}):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest({cmd:"video.getRectInfo",wndIndex:i}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"clearShapeByType",value:function He(i,r){var o=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.clearShapeByType",type:i,id:r}):new Promise(function(t,n){o.oRequestPromise.then(function(e){if(e){o.oRequest.sendRequest({cmd:"video.clearShapeByType",type:i,id:r}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"chooseShape",value:function Ue(i,r){var o=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.chooseShape",type:i,id:r}):new Promise(function(t,n){o.oRequestPromise.then(function(e){if(e){o.oRequest.sendRequest({cmd:"video.chooseShape",type:i,id:r}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setCorrectionType",value:function je(i){var r=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.setCorrectionType",type:i}):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest({cmd:"video.setCorrectionType",type:i}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setPlaceType",value:function Ge(i){var r=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.setPlaceType",type:i}):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest({cmd:"video.setPlaceType",type:i}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"startFishListener",value:function Ve(i,r,o){var s=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.startFishListener",url:i,auth:r,extData:o}):new Promise(function(t,n){s.oRequestPromise.then(function(e){if(e){s.oRequest.sendRequest({cmd:"video.startFishListener",url:i,auth:r,extData:o}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"stopFishListener",value:function Ye(){var i=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.stopFishListener"}):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest({cmd:"video.stopFishListener"}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setFishBoxListInfo",value:function Xe(i){var r=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.setFishBoxListInfo",fishBoxList:i}):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest({cmd:"video.setFishBoxListInfo",fishBoxList:i}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getFishBoxListInfo",value:function Ze(){var i=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.getFishBoxListInfo"}):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest({cmd:"video.getFishBoxListInfo"}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"clearAllWndFishBoxInfo",value:function Ke(){var i=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.clearAllWndFishBoxInfo"}):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest({cmd:"video.clearAllWndFishBoxInfo"}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setFishWndProperty",value:function $e(i,r,o){var s=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.setFishWndProperty",wndIndex:i,type:r,id:o}):new Promise(function(t,n){s.oRequestPromise.then(function(e){if(e){s.oRequest.sendRequest({cmd:"video.setFishWndProperty",wndIndex:i,type:r,id:o}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setFishParams",value:function Qe(i,r,o,s){var a=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.setFishParams",top:i,right:r,bottom:o,left:s}):new Promise(function(t,n){a.oRequestPromise.then(function(e){if(e){a.oRequest.sendRequest({cmd:"video.setFishParams",top:i,right:r,bottom:o,left:s}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"arrangeFECWindow",value:function et(i){var r=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.arrangeFECWindow",type:i}):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest({cmd:"video.arrangeFECWindow",type:i}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"startFECScan",value:function tt(i){var r=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.startFECScan",speed:i}):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest({cmd:"video.startFECScan",speed:i}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"stopFECScan",value:function nt(){var i=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.stopFECScan"}):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest({cmd:"video.stopFECScan"}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"fishEyePTZ",value:function it(i,r){var o=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.fishEyePTZ",direction:i,speed:r}):new Promise(function(t,n){o.oRequestPromise.then(function(e){if(e){o.oRequest.sendRequest({cmd:"video.fishEyePTZ",direction:i,speed:r}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"fishEyeGetPreset",value:function rt(){var i=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.fishEyeGetPreset"}):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest({cmd:"video.fishEyeGetPreset"}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"fishEyeSetPreset",value:function ot(i){var r=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.fishEyeSetPreset",fishEyePreset:i}):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest({cmd:"video.fishEyeSetPreset",fishEyePreset:i}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"startFECCruise",value:function st(i){var r=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.startFECCruise",fishEyePresetList:i}):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest({cmd:"video.startFECCruise",fishEyePresetList:i}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"stopFECCruise",value:function at(){var i=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.stopFECCruise"}):new Promise(function(t,n){i.oRequestPromise.then(function(e){if(e){i.oRequest.sendRequest({cmd:"video.stopFECCruise"}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setIsHttps",value:function ut(i){var r=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.setIsHttps",https:i}):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest({cmd:"video.setIsHttps",https:i}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setReconnectInfo",value:function lt(i,r){var o=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.setReconnectInfo",wndIndex:i,auth:r}):new Promise(function(t,n){o.oRequestPromise.then(function(e){if(e){o.oRequest.sendRequest({cmd:"video.setReconnectInfo",wndIndex:i,auth:r}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"selectShape",value:function ft(i,r){var o=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.chooseShape",type:i,id:r}):new Promise(function(t,n){o.oRequestPromise.then(function(e){if(e){o.oRequest.sendRequest({cmd:"video.chooseShape",type:i,id:r}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getPlayInfo",value:function O(i){var r=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.getPlayInfo",wndIndex:i}):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest({cmd:"video.getPlayInfo",wndIndex:i}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setOriginResolution",value:function ct(i,r,o){var s=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.setWndResolution",wndIndex:i,width:r,height:o}):new Promise(function(t,n){s.oRequestPromise.then(function(e){if(e){s.oRequest.sendRequest({cmd:"video.setWndResolution",wndIndex:i,width:r,height:o}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setPlayWndMode",value:function ht(i,r,o){var s=this;return this.oRequest?this.oRequest.sendRequest({cmd:"video.setWndRatioMode",wndIndex:i,mode:r,allWnd:o}):new Promise(function(t,n){s.oRequestPromise.then(function(e){if(e){s.oRequest.sendRequest({cmd:"video.setWndRatioMode",wndIndex:i,mode:r,allWnd:o}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"cuttingPartWindow",value:function dt(i,r,o,s){var a=this;return this.oRequest?this.oRequest.sendRequest({cmd:"window.cuttingPartWindow",rect:{left:i,top:r,width:o,height:s},round:0}):new Promise(function(t,n){a.oRequestPromise.then(function(e){if(e){a.oRequest.sendRequest({cmd:"window.cuttingPartWindow",rect:{left:i,top:r,width:o,height:s},round:0}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"setWindowSelected",value:function pt(i){var r=this;return this.oRequest?this.oRequest.sendRequest({cmd:"window.setWindowSelected",wndIndex:i}):new Promise(function(t,n){r.oRequestPromise.then(function(e){if(e){r.oRequest.sendRequest({cmd:"window.setWindowSelected",wndIndex:i}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"getSlfPointList",value:function vt(e,t){return this.oRequest.sendRequest({cmd:"video.getSlfPointList",filePath:e,key:t})}},{key:"audioPlay",value:function mt(e,t,n,i,r,o){return this.oRequest.sendRequest({cmd:"video.audioPlay",url:e,auth:t,soundChannel:n,mode:i,playSound:r,audioType:o})}},{key:"startSycAudioPlay",value:function yt(e,t,n,i){return this.oRequest.sendRequest({cmd:"video.startSycAudioPlay",url:e,auth:t,wndIndex:n,mode:i})}},{key:"getDownFilePath",value:function gt(e){return this.oRequest.sendRequest({cmd:"video.getDownFilePath",downloadId:e})}},{key:"deleteDownloadFile",value:function Pt(e){return this.oRequest.sendRequest({cmd:"video.deleteDownloadFile",filePath:e})}},{key:"sycVideoAndAudio",value:function wt(e,t,n){return this.oRequest.sendRequest({cmd:"video.sycVideoAndAudio",outfilePath:e,videoPath:t,audioPath:n})}},{key:"stopSycAudioPlay",value:function St(e){return this.oRequest.sendRequest({cmd:"video.stopSycAudioPlay",wndIndex:e})}},{key:"setAudioPlayStatus",value:function _t(e){return this.oRequest.sendRequest({cmd:"video.setAudioPlayStatus",playSound:e})}},{key:"stopAudioPlay",value:function bt(){return this.oRequest.sendRequest({cmd:"video.stopAudioPlay"})}},{key:"startAudioRecord",value:function Ct(e){return this.oRequest.sendRequest({cmd:"video.startAudioRecord",fileName:e})}},{key:"stopAudioSave",value:function kt(){return this.oRequest.sendRequest({cmd:"video.stopAudioSave"})}},{key:"repairPartWindow",value:function M(e,t,n,i){return this.oRequest.sendRequest({cmd:"window.repairPartWindow",rect:{left:e,top:t,width:n,height:i},round:0})}},{key:"repairPartWindow",value:function M(i,r,o,s){var a=this;return this.oRequest?this.oRequest.sendRequest({cmd:"window.repairPartWindow",rect:{left:i,top:r,width:o,height:s},round:0}):new Promise(function(t,n){a.oRequestPromise.then(function(e){if(e){a.oRequest.sendRequest({cmd:"window.repairPartWindow",rect:{left:i,top:r,width:o,height:s},round:0}).then(function(e){t(e)},function(e){n(e)})}else{n("request init fail")}},function(e){n(e)})})}},{key:"startAlarmChan",value:function Tt(e,t,n){var i={cmd:"video.startAlarmChan",URL:e,auth:t,extData:n};return this.judgeRequestHandle("sendRequest",[i])}},{key:"stopAlarmChan",value:function Rt(){var e={cmd:"video.stopAlarmChan"};return this.judgeRequestHandle("sendRequest",[e])}},{key:"getPictureSize",value:function Dt(e){var t={cmd:"video.getPictureSize",wndIndex:e};return this.judgeRequestHandle("sendRequest",[t])}},{key:"startFormAsynUpload",value:function xt(e){var i=this;if((typeof e==="undefined"?"undefined":Ft(e))==="object"){e.cmd="video.startFormAsynUpload";return i.judgeRequestHandle("sendRequest",[e])}Ht["default"].parseString(e,function(e,t){if(e){return Promise.reject(e)}if(t&&t.UploadInfo){var n={cmd:"video.startFormAsynUpload",uploadUrl:t.UploadInfo.url&&t.UploadInfo.url[0],formName:t.UploadInfo.formName&&t.UploadInfo.formName[0],param:t.UploadInfo.param&&t.UploadInfo.param[0],auth:t.UploadInfo.auth&&t.UploadInfo.auth[0],filepath:t.UploadInfo.filePath&&t.UploadInfo.filePath[0]};return i.judgeRequestHandle("sendRequest",[n])}});return Promise.reject("params error")}},{key:"stopFormAsynUpload",value:function It(){var e={cmd:"video.stopFormAsynUpload"};return this.judgeRequestHandle("sendRequest",[e])}},{key:"openFileBrowser2",value:function Et(e,t){var n={cmd:"video.browseFilePathV2",lSelectMode:e,iListMax:t};return this.judgeRequestHandle("sendRequest",[n])}},{key:"judgeRequestHandle",value:function qt(r,o){var s=this;if(this.oRequest){var e;return(e=this.oRequest)[r].apply(e,Ut(o))}return new Promise(function(n,i){s.oRequestPromise.then(function(e){if(e){var t;(t=s.oRequest)[r].apply(t,Ut(o)).then(function(e){n(e)},function(e){i(e)})}else{i("oRequest init fail")}},function(e){i(e)})})}},{key:"setPicInfoToPlayer",value:function At(e,t,n,i){var r={cmd:"video.setPicInfoToPlayer",wndIndex:e,path:t,picType:n,open:i};return this.judgeRequestHandle("sendRequest",[r])}},{key:"syncHttpTransmission",value:function Ot(e){var t={cmd:"video.syncHttpTransmission",url:e.url,auth:e.auth,method:e.method,content:e.content?e.content:"",timeout:e.timeout?e.timeout:3e4};return this.judgeRequestHandle("sendRequest",[t])}},{key:"getCaptureData",value:function Mt(e){var t={cmd:"video.captureUpload",wndIndex:e};return this.judgeRequestHandle("sendRequest",[t])}}]);return n}();e.checkLocalServiceConnected=function(r,o,s){if(o===null||typeof o==="undefined"){o=33686;s=33695}var e=new Promise(function(e,t){Jt.oUtils.detectPort(o,s,{oSessionInfo:r,success:function n(){e()},error:function i(){t()}})});return e};return e}();i.Request=n}).call(this,r(1))},function(e,i,r){"use strict";(function(u){Object.defineProperty(i,"__esModule",{value:true});i.WebSocketRequest=undefined;var l=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(e,t,n){if(t)i(e.prototype,t);if(n)i(e,n);return e}}();var e=r(8);var f=t(e);var c=r(10);function t(e){return e&&e.__esModule?e:{"default":e}}function h(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var n=function(){var e=function(){function n(e){h(this,n);var t={iPort:-1,cbConnectSuccess:null,cbConnectError:null,cbConnectClose:null};this.oOptions=u.extend(t,e);this.oWebSocket=null;this.szUUID="";this.szVersion="";this.oRequestList={};this.bNormalClose=false;this.oWindowControlCallback={};this.init()}l(n,[{key:"init",value:function t(){var r=this;var e=function e(){if(r.oOptions.cbConnectClose){r.oOptions.cbConnectClose(r.bNormalClose)}r.bNormalClose=false};r.oWebSocket=new WebSocket("ws://127.0.0.1:"+r.oOptions.iPort);r.oWebSocket.onerror=function(){};r.oWebSocket.onopen=function(){var e=f["default"].v4();var t={sequence:e,cmd:"system.webconnect"};var n=JSON.stringify(t);r.oWebSocket.send(n)};r.oWebSocket.onmessage=function(e){var t=e.data;if(!t){return}var n=JSON.parse(t);var i=n.sequence;if(typeof i==="undefined"&&typeof n.cmd==="undefined"){r.szUUID=n.uuid;r.szVersion=n.version;if(r.oOptions.cbConnectSuccess){r.oOptions.cbConnectSuccess()}}else{if(typeof n.cmd!=="undefined"){r.parseCmd(n)}else{if(typeof r.oRequestList[i]!=="undefined"){if(0===n.errorCode){r.oRequestList[i].resolve(n)}else{r.oRequestList[i].reject(n)}delete r.oRequestList[i]}}}};r.oWebSocket.onclose=function(){r.oWebSocket=null;if(c.oUtils.browser().mozilla){setTimeout(function(){e()},100)}else{e()}}}},{key:"setWindowControlCallback",value:function i(e){this.oWindowControlCallback=e}},{key:"getServiceVersion",value:function e(){return this.szVersion}},{key:"getRequestUUID",value:function r(){return this.szUUID}},{key:"disconnect",value:function o(){this.bNormalClose=true;if(this.oWebSocket&&WebSocket.OPEN===this.oWebSocket.readyState){this.oWebSocket.close()}}},{key:"sendRequest",value:function s(r){var o=this;var e=new Promise(function(e,t){var n=f["default"].v4();r.sequence=n;o.oRequestList[n]={resolve:e,reject:t};r.uuid=o.szUUID;r.timestamp=(new Date).getTime()+"";var i=JSON.stringify(r);if(o.oWebSocket&&WebSocket.OPEN===o.oWebSocket.readyState){o.oWebSocket.send(i)}else{t()}});return e}},{key:"parseCmd",value:function a(e){var t=e.cmd;var n=t.split(".");var i=n[1];if("window"===n[0]||"video"===n[0]){if(this.oWindowControlCallback[i]){this.oWindowControlCallback[i](e)}}}}]);return n}();return e}();i.WebSocketRequest=n}).call(this,r(1))},function(e,r,o){"use strict";(function(p){Object.defineProperty(r,"__esModule",{value:true});r.ImageHttpRequest=undefined;var h=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(e,t,n){if(t)i(e.prototype,t);if(n)i(e,n);return e}}();var e=o(8);var v=n(e);var t=o(79);var m=n(t);var y=o(10);function n(e){return e&&e.__esModule?e:{"default":e}}function g(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var i=function(){var e=function(){function n(e){g(this,n);var t={iPort:-1,cbConnectSuccess:null,cbConnectError:null,cbConnectClose:null};this.oOptions=p.extend(t,e);this.szHost="http://127.0.0.1";this.szUUID="";this.szVersion="";this.bNormalClose=false;this.bConnected=false;this.bInitConnect=true;this.iGetErrorCount=0;this.oWindowControlCallback={};this.oUIControlCallback={};this.init()}h(n,[{key:"init",value:function s(){var n=this;var e=v["default"].v4();var t={sequence:e,cmd:"system.webconnect"};var i=JSON.stringify(t);n.sendImageHttp(n.szHost+":"+n.oOptions.iPort+"/imghttp/local",i,e,{success:function r(e){if(!e){return}var t=JSON.parse(e);n.szUUID=t.uuid;n.szVersion=t.version;n.bConnected=true;n.bInitConnect=false;setTimeout(function(){n.imageHttpPolling()},100);if(n.oOptions.cbConnectSuccess){n.oOptions.cbConnectSuccess()}},error:function o(){}})}},{key:"sendImageHttp",value:function d(i,e,t,r){var o=this;var n={success:null,error:null,abort:null};r=p.extend(n,r);var s=encodeURIComponent(btoa(m["default"].deflate(e)));var a=this.splitStr(s);var u=[];var l="";for(var f=0,c=a.length;f<c;f++){if(f===c-1){l="update="+(new Date).getTime()+"&isLast=true&data="+a[f]+"&sequence="+t}else{l="update="+(new Date).getTime()+"&isLast=false&data="+a[f]+"&sequence="+t}u.push(l)}if(u.length>0){var h=function h(){o.imageHttp(i+"?"+u[0],{success:function t(e){u.shift();if(u.length>0){if(o.bInitConnect||o.bConnected){h()}}else{if(r.success){r.success(e)}}},error:function e(){if(r.error){r.error()}},abort:function n(){if(r.abort){r.abort()}}})};h()}}},{key:"splitStr",value:function a(e){var t=this.getByteLen(e);var n=[];var i=1500;for(var r=0,o=Math.ceil(t/i);r<o;r++){n[r]=e.slice(i*r,i*(r+1))}return n}},{key:"getByteLen",value:function o(e){var t=0;var n="";for(var i=0,r=e.length;i<r;i++){n=e.charAt(i);if(/[^\x20-\xff]/.test(n)){t+=2}else{t+=1}}return t}},{key:"imageHttp",value:function i(e,f){var t={success:null,error:null,abort:null};f=p.extend(t,f);var c=new Image;c.onload=function(){if(f.success){var e=document.createElement("canvas");var t=e.getContext("2d");var n=c.width;var i=c.height;e.width=n;e.height=i;try{t.drawImage(c,0,0);var r=t.getImageData(0,0,n,i).data;var o="";var s=-1;for(var a=i-1;a>=0;a--){for(var u=0;u<n*4;u++){s=a*n*4+u;if(0===r[s]){break}else if(255===r[s]){continue}else{o+=String.fromCharCode(r[s])}}}f.success(y.oUtils.utf8to16(o))}catch(l){if(f.error){f.error()}}}};c.onerror=function(){if(f.error){f.error()}};c.onabort=function(){if(f.abort){f.abort()}};c.crossOrigin="anonymous";c.src=e}},{key:"setWindowControlCallback",value:function t(e){this.oWindowControlCallback=e}},{key:"getServiceVersion",value:function e(){return this.szVersion}},{key:"getRequestUUID",value:function r(){return this.szUUID}},{key:"disconnect",value:function u(){var e=this;var t=v["default"].v4();var n={sequence:t,uuid:e.szUUID,cmd:"system.disconnect"};var i=JSON.stringify(n);if(e.bConnected){e.sendImageHttp(e.szHost+":"+e.oOptions.iPort+"/imghttp/local",i,t,{success:function r(){e.bNormalClose=true;e.bConnected=false},error:function o(){e.bConnected=false}})}}},{key:"imageHttpPolling",value:function l(){var n=this;var e=v["default"].v4();var t={sequence:e,uuid:n.szUUID,cmd:"system.get"};var i=JSON.stringify(t);if(n.bConnected){n.sendImageHttp(n.szHost+":"+n.oOptions.iPort+"/imghttp/local",i,e,{success:function r(e){n.iGetErrorCount=0;if("timeout"===e){setTimeout(function(){n.imageHttpPolling()},100)}else if("invalid"===e){n.bConnected=false;if(n.oOptions.cbConnectError){n.oOptions.cbConnectError()}}else{var t=JSON.parse(e);if(typeof t.cmd!=="undefined"){n.parseCmd(t)}else{}setTimeout(function(){n.imageHttpPolling()},100)}},error:function o(){if(5===n.iGetErrorCount){n.bNormalClose=false;n.bConnected=false;if(n.oOptions.cbConnectClose){n.oOptions.cbConnectClose(n.bNormalClose)}}else{setTimeout(function(){n.iGetErrorCount++;n.imageHttpPolling()},100)}}})}}},{key:"sendRequest",value:function f(u){var l=this;var e=new Promise(function(n,i){var e=u.cmd.split(".");var t="";if(e.length>1){t="laputa"===e[0]?"laputa":"local"}else{i()}var r=v["default"].v4();u.sequence=r;u.uuid=l.szUUID;u.timestamp=(new Date).getTime()+"";var o=JSON.stringify(u);if(l.bConnected){l.sendImageHttp(l.szHost+":"+l.oOptions.iPort+"/imghttp/"+t,o,r,{success:function s(e){if(!e){i();return}var t=JSON.parse(e);if(0===t.errorCode){n(t)}else{i(t)}},error:function a(){i()}})}else{i()}});return e}},{key:"parseCmd",value:function c(e){var t=e.cmd;var n=t.split(".");var i=n[1];if("window"===n[0]||"video"===n[0]){if(this.oWindowControlCallback[i]){this.oWindowControlCallback[i](e)}}}}]);return n}();return e}();r.ImageHttpRequest=i}).call(this,o(1))},function(e,t,n){"use strict";var i=n(4).assign;var r=n(80);var o=n(83);var s=n(45);var a={};i(a,r,o,s);e.exports=a},function(e,t,n){"use strict";var s=n(81);var a=n(4);var u=n(43);var r=n(17);var o=n(44);var l=Object.prototype.toString;var f=0;var c=4;var h=0;var d=1;var p=2;var v=-1;var m=0;var y=8;function g(e){if(!(this instanceof g))return new g(e);this.options=a.assign({level:v,method:y,chunkSize:16384,windowBits:15,memLevel:8,strategy:m,to:""},e||{});var t=this.options;if(t.raw&&t.windowBits>0){t.windowBits=-t.windowBits}else if(t.gzip&&t.windowBits>0&&t.windowBits<16){t.windowBits+=16}this.err=0;this.msg="";this.ended=false;this.chunks=[];this.strm=new o;this.strm.avail_out=0;var n=s.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==h){throw new Error(r[n])}if(t.header){s.deflateSetHeader(this.strm,t.header)}if(t.dictionary){var i;if(typeof t.dictionary==="string"){i=u.string2buf(t.dictionary)}else if(l.call(t.dictionary)==="[object ArrayBuffer]"){i=new Uint8Array(t.dictionary)}else{i=t.dictionary}n=s.deflateSetDictionary(this.strm,i);if(n!==h){throw new Error(r[n])}this._dict_set=true}}g.prototype.push=function(e,t){var n=this.strm;var i=this.options.chunkSize;var r,o;if(this.ended){return false}o=t===~~t?t:t===true?c:f;if(typeof e==="string"){n.input=u.string2buf(e)}else if(l.call(e)==="[object ArrayBuffer]"){n.input=new Uint8Array(e)}else{n.input=e}n.next_in=0;n.avail_in=n.input.length;do{if(n.avail_out===0){n.output=new a.Buf8(i);n.next_out=0;n.avail_out=i}r=s.deflate(n,o);if(r!==d&&r!==h){this.onEnd(r);this.ended=true;return false}if(n.avail_out===0||n.avail_in===0&&(o===c||o===p)){if(this.options.to==="string"){this.onData(u.buf2binstring(a.shrinkBuf(n.output,n.next_out)))}else{this.onData(a.shrinkBuf(n.output,n.next_out))}}}while((n.avail_in>0||n.avail_out===0)&&r!==d);if(o===c){r=s.deflateEnd(this.strm);this.onEnd(r);this.ended=true;return r===h}if(o===p){this.onEnd(h);n.avail_out=0;return true}return true};g.prototype.onData=function(e){this.chunks.push(e)};g.prototype.onEnd=function(e){if(e===h){if(this.options.to==="string"){this.result=this.chunks.join("")}else{this.result=a.flattenChunks(this.chunks)}}this.chunks=[];this.err=e;this.msg=this.strm.msg};function i(e,t){var n=new g(t);n.push(e,true);if(n.err){throw n.msg||r[n.err]}return n.result}function P(e,t){t=t||{};t.raw=true;return i(e,t)}function w(e,t){t=t||{};t.gzip=true;return i(e,t)}t.Deflate=g;t.deflate=i;t.deflateRaw=P;t.gzip=w},function(o,e,t){"use strict";var c=t(4);var l=t(82);var N=t(41);var f=t(42);var s=t(17);var h=0;var B=1;var z=3;var d=4;var J=5;var p=0;var H=1;var v=-2;var u=-3;var m=-5;var U=-1;var j=1;var y=2;var G=3;var V=4;var Y=0;var X=2;var g=8;var Z=9;var K=15;var $=8;var Q=29;var ee=256;var n=ee+1+Q;var te=30;var ne=19;var ie=2*n+1;var re=15;var P=3;var w=258;var S=w+P+1;var oe=32;var _=42;var se=69;var b=73;var C=91;var k=103;var T=113;var R=666;var D=1;var x=2;var I=3;var E=4;var ae=3;function q(e,t){e.msg=s[t];return t}function ue(e){return(e<<1)-(e>4?9:0)}function A(e){var t=e.length;while(--t>=0){e[t]=0}}function O(e){var t=e.state;var n=t.pending;if(n>e.avail_out){n=e.avail_out}if(n===0){return}c.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out);e.next_out+=n;t.pending_out+=n;e.total_out+=n;e.avail_out-=n;t.pending-=n;if(t.pending===0){t.pending_out=0}}function a(e,t){l._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t);e.block_start=e.strstart;O(e.strm)}function M(e,t){e.pending_buf[e.pending++]=t}function L(e,t){e.pending_buf[e.pending++]=t>>>8&255;e.pending_buf[e.pending++]=t&255}function le(e,t,n,i){var r=e.avail_in;if(r>i){r=i}if(r===0){return 0}e.avail_in-=r;c.arraySet(t,e.input,e.next_in,r,n);if(e.state.wrap===1){e.adler=N(e.adler,t,r,n)}else if(e.state.wrap===2){e.adler=f(e.adler,t,r,n)}e.next_in+=r;e.total_in+=r;return r}function fe(e,t){var n=e.max_chain_length;var i=e.strstart;var r;var o;var s=e.prev_length;var a=e.nice_match;var u=e.strstart>e.w_size-S?e.strstart-(e.w_size-S):0;var l=e.window;var f=e.w_mask;var c=e.prev;var h=e.strstart+w;var d=l[i+s-1];var p=l[i+s];if(e.prev_length>=e.good_match){n>>=2}if(a>e.lookahead){a=e.lookahead}do{r=t;if(l[r+s]!==p||l[r+s-1]!==d||l[r]!==l[i]||l[++r]!==l[i+1]){continue}i+=2;r++;do{}while(l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&i<h);o=w-(h-i);i=h-w;if(o>s){e.match_start=t;s=o;if(o>=a){break}d=l[i+s-1];p=l[i+s]}}while((t=c[t&f])>u&&--n!==0);if(s<=e.lookahead){return s}return e.lookahead}function F(e){var t=e.w_size;var n,i,r,o,s;do{o=e.window_size-e.lookahead-e.strstart;if(e.strstart>=t+(t-S)){c.arraySet(e.window,e.window,t,t,0);e.match_start-=t;e.strstart-=t;e.block_start-=t;i=e.hash_size;n=i;do{r=e.head[--n];e.head[n]=r>=t?r-t:0}while(--i);i=t;n=i;do{r=e.prev[--n];e.prev[n]=r>=t?r-t:0}while(--i);o+=t}if(e.strm.avail_in===0){break}i=le(e.strm,e.window,e.strstart+e.lookahead,o);e.lookahead+=i;if(e.lookahead+e.insert>=P){s=e.strstart-e.insert;e.ins_h=e.window[s];e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;while(e.insert){e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+P-1])&e.hash_mask;e.prev[s&e.w_mask]=e.head[e.ins_h];e.head[e.ins_h]=s;s++;e.insert--;if(e.lookahead+e.insert<P){break}}}}while(e.lookahead<S&&e.strm.avail_in!==0)}function ce(e,t){var n=65535;if(n>e.pending_buf_size-5){n=e.pending_buf_size-5}for(;;){if(e.lookahead<=1){F(e);if(e.lookahead===0&&t===h){return D}if(e.lookahead===0){break}}e.strstart+=e.lookahead;e.lookahead=0;var i=e.block_start+n;if(e.strstart===0||e.strstart>=i){e.lookahead=e.strstart-i;e.strstart=i;a(e,false);if(e.strm.avail_out===0){return D}}if(e.strstart-e.block_start>=e.w_size-S){a(e,false);if(e.strm.avail_out===0){return D}}}e.insert=0;if(t===d){a(e,true);if(e.strm.avail_out===0){return I}return E}if(e.strstart>e.block_start){a(e,false);if(e.strm.avail_out===0){return D}}return D}function he(e,t){var n;var i;for(;;){if(e.lookahead<S){F(e);if(e.lookahead<S&&t===h){return D}if(e.lookahead===0){break}}n=0;if(e.lookahead>=P){e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+P-1])&e.hash_mask;n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h];e.head[e.ins_h]=e.strstart}if(n!==0&&e.strstart-n<=e.w_size-S){e.match_length=fe(e,n)}if(e.match_length>=P){i=l._tr_tally(e,e.strstart-e.match_start,e.match_length-P);e.lookahead-=e.match_length;if(e.match_length<=e.max_lazy_match&&e.lookahead>=P){e.match_length--;do{e.strstart++;e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+P-1])&e.hash_mask;n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h];e.head[e.ins_h]=e.strstart}while(--e.match_length!==0);e.strstart++}else{e.strstart+=e.match_length;e.match_length=0;e.ins_h=e.window[e.strstart];e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask}}else{i=l._tr_tally(e,0,e.window[e.strstart]);e.lookahead--;e.strstart++}if(i){a(e,false);if(e.strm.avail_out===0){return D}}}e.insert=e.strstart<P-1?e.strstart:P-1;if(t===d){a(e,true);if(e.strm.avail_out===0){return I}return E}if(e.last_lit){a(e,false);if(e.strm.avail_out===0){return D}}return x}function i(e,t){var n;var i;var r;for(;;){if(e.lookahead<S){F(e);if(e.lookahead<S&&t===h){return D}if(e.lookahead===0){break}}n=0;if(e.lookahead>=P){e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+P-1])&e.hash_mask;n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h];e.head[e.ins_h]=e.strstart}e.prev_length=e.match_length;e.prev_match=e.match_start;e.match_length=P-1;if(n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-S){e.match_length=fe(e,n);if(e.match_length<=5&&(e.strategy===j||e.match_length===P&&e.strstart-e.match_start>4096)){e.match_length=P-1}}if(e.prev_length>=P&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-P;i=l._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-P);e.lookahead-=e.prev_length-1;e.prev_length-=2;do{if(++e.strstart<=r){e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+P-1])&e.hash_mask;n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h];e.head[e.ins_h]=e.strstart}}while(--e.prev_length!==0);e.match_available=0;e.match_length=P-1;e.strstart++;if(i){a(e,false);if(e.strm.avail_out===0){return D}}}else if(e.match_available){i=l._tr_tally(e,0,e.window[e.strstart-1]);if(i){a(e,false)}e.strstart++;e.lookahead--;if(e.strm.avail_out===0){return D}}else{e.match_available=1;e.strstart++;e.lookahead--}}if(e.match_available){i=l._tr_tally(e,0,e.window[e.strstart-1]);e.match_available=0}e.insert=e.strstart<P-1?e.strstart:P-1;if(t===d){a(e,true);if(e.strm.avail_out===0){return I}return E}if(e.last_lit){a(e,false);if(e.strm.avail_out===0){return D}}return x}function de(e,t){var n;var i;var r,o;var s=e.window;for(;;){if(e.lookahead<=w){F(e);if(e.lookahead<=w&&t===h){return D}if(e.lookahead===0){break}}e.match_length=0;if(e.lookahead>=P&&e.strstart>0){r=e.strstart-1;i=s[r];if(i===s[++r]&&i===s[++r]&&i===s[++r]){o=e.strstart+w;do{}while(i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&r<o);e.match_length=w-(o-r);if(e.match_length>e.lookahead){e.match_length=e.lookahead}}}if(e.match_length>=P){n=l._tr_tally(e,1,e.match_length-P);e.lookahead-=e.match_length;e.strstart+=e.match_length;e.match_length=0}else{n=l._tr_tally(e,0,e.window[e.strstart]);e.lookahead--;e.strstart++}if(n){a(e,false);if(e.strm.avail_out===0){return D}}}e.insert=0;if(t===d){a(e,true);if(e.strm.avail_out===0){return I}return E}if(e.last_lit){a(e,false);if(e.strm.avail_out===0){return D}}return x}function pe(e,t){var n;for(;;){if(e.lookahead===0){F(e);if(e.lookahead===0){if(t===h){return D}break}}e.match_length=0;n=l._tr_tally(e,0,e.window[e.strstart]);e.lookahead--;e.strstart++;if(n){a(e,false);if(e.strm.avail_out===0){return D}}}e.insert=0;if(t===d){a(e,true);if(e.strm.avail_out===0){return I}return E}if(e.last_lit){a(e,false);if(e.strm.avail_out===0){return D}}return x}function r(e,t,n,i,r){this.good_length=e;this.max_lazy=t;this.nice_length=n;this.max_chain=i;this.func=r}var W;W=[new r(0,0,0,0,ce),new r(4,4,8,4,he),new r(4,5,16,8,he),new r(4,6,32,32,he),new r(4,4,16,16,i),new r(8,16,32,32,i),new r(8,16,128,128,i),new r(8,32,128,256,i),new r(32,128,258,1024,i),new r(32,258,258,4096,i)];function ve(e){e.window_size=2*e.w_size;A(e.head);e.max_lazy_match=W[e.level].max_lazy;e.good_match=W[e.level].good_length;e.nice_match=W[e.level].nice_length;e.max_chain_length=W[e.level].max_chain;e.strstart=0;e.block_start=0;e.lookahead=0;e.insert=0;e.match_length=e.prev_length=P-1;e.match_available=0;e.ins_h=0}function me(){this.strm=null;this.status=0;this.pending_buf=null;this.pending_buf_size=0;this.pending_out=0;this.pending=0;this.wrap=0;this.gzhead=null;this.gzindex=0;this.method=g;this.last_flush=-1;this.w_size=0;this.w_bits=0;this.w_mask=0;this.window=null;this.window_size=0;this.prev=null;this.head=null;this.ins_h=0;this.hash_size=0;this.hash_bits=0;this.hash_mask=0;this.hash_shift=0;this.block_start=0;this.match_length=0;this.prev_match=0;this.match_available=0;this.strstart=0;this.match_start=0;this.lookahead=0;this.prev_length=0;this.max_chain_length=0;this.max_lazy_match=0;this.level=0;this.strategy=0;this.good_match=0;this.nice_match=0;this.dyn_ltree=new c.Buf16(ie*2);this.dyn_dtree=new c.Buf16((2*te+1)*2);this.bl_tree=new c.Buf16((2*ne+1)*2);A(this.dyn_ltree);A(this.dyn_dtree);A(this.bl_tree);this.l_desc=null;this.d_desc=null;this.bl_desc=null;this.bl_count=new c.Buf16(re+1);this.heap=new c.Buf16(2*n+1);A(this.heap);this.heap_len=0;this.heap_max=0;this.depth=new c.Buf16(2*n+1);A(this.depth);this.l_buf=0;this.lit_bufsize=0;this.last_lit=0;this.d_buf=0;this.opt_len=0;this.static_len=0;this.matches=0;this.insert=0;this.bi_buf=0;this.bi_valid=0}function ye(e){var t;if(!e||!e.state){return q(e,v)}e.total_in=e.total_out=0;e.data_type=X;t=e.state;t.pending=0;t.pending_out=0;if(t.wrap<0){t.wrap=-t.wrap}t.status=t.wrap?_:T;e.adler=t.wrap===2?0:1;t.last_flush=h;l._tr_init(t);return p}function ge(e){var t=ye(e);if(t===p){ve(e.state)}return t}function Pe(e,t){if(!e||!e.state){return v}if(e.state.wrap!==2){return v}e.state.gzhead=t;return p}function we(e,t,n,i,r,o){if(!e){return v}var s=1;if(t===U){t=6}if(i<0){s=0;i=-i}else if(i>15){s=2;i-=16}if(r<1||r>Z||n!==g||i<8||i>15||t<0||t>9||o<0||o>V){return q(e,v)}if(i===8){i=9}var a=new me;e.state=a;a.strm=e;a.wrap=s;a.gzhead=null;a.w_bits=i;a.w_size=1<<a.w_bits;a.w_mask=a.w_size-1;a.hash_bits=r+7;a.hash_size=1<<a.hash_bits;a.hash_mask=a.hash_size-1;a.hash_shift=~~((a.hash_bits+P-1)/P);a.window=new c.Buf8(a.w_size*2);a.head=new c.Buf16(a.hash_size);a.prev=new c.Buf16(a.w_size);a.lit_bufsize=1<<r+6;a.pending_buf_size=a.lit_bufsize*4;a.pending_buf=new c.Buf8(a.pending_buf_size);a.d_buf=1*a.lit_bufsize;a.l_buf=(1+2)*a.lit_bufsize;a.level=t;a.strategy=o;a.method=n;return ge(e)}function Se(e,t){return we(e,t,g,K,$,Y)}function _e(e,t){var n,i;var r,o;if(!e||!e.state||t>J||t<0){return e?q(e,v):v}i=e.state;if(!e.output||!e.input&&e.avail_in!==0||i.status===R&&t!==d){return q(e,e.avail_out===0?m:v)}i.strm=e;n=i.last_flush;i.last_flush=t;if(i.status===_){if(i.wrap===2){e.adler=0;M(i,31);M(i,139);M(i,8);if(!i.gzhead){M(i,0);M(i,0);M(i,0);M(i,0);M(i,0);M(i,i.level===9?2:i.strategy>=y||i.level<2?4:0);M(i,ae);i.status=T}else{M(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(!i.gzhead.extra?0:4)+(!i.gzhead.name?0:8)+(!i.gzhead.comment?0:16));M(i,i.gzhead.time&255);M(i,i.gzhead.time>>8&255);M(i,i.gzhead.time>>16&255);M(i,i.gzhead.time>>24&255);M(i,i.level===9?2:i.strategy>=y||i.level<2?4:0);M(i,i.gzhead.os&255);if(i.gzhead.extra&&i.gzhead.extra.length){M(i,i.gzhead.extra.length&255);M(i,i.gzhead.extra.length>>8&255)}if(i.gzhead.hcrc){e.adler=f(e.adler,i.pending_buf,i.pending,0)}i.gzindex=0;i.status=se}}else{var s=g+(i.w_bits-8<<4)<<8;var a=-1;if(i.strategy>=y||i.level<2){a=0}else if(i.level<6){a=1}else if(i.level===6){a=2}else{a=3}s|=a<<6;if(i.strstart!==0){s|=oe}s+=31-s%31;i.status=T;L(i,s);if(i.strstart!==0){L(i,e.adler>>>16);L(i,e.adler&65535)}e.adler=1}}if(i.status===se){if(i.gzhead.extra){r=i.pending;while(i.gzindex<(i.gzhead.extra.length&65535)){if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>r){e.adler=f(e.adler,i.pending_buf,i.pending-r,r)}O(e);r=i.pending;if(i.pending===i.pending_buf_size){break}}M(i,i.gzhead.extra[i.gzindex]&255);i.gzindex++}if(i.gzhead.hcrc&&i.pending>r){e.adler=f(e.adler,i.pending_buf,i.pending-r,r)}if(i.gzindex===i.gzhead.extra.length){i.gzindex=0;i.status=b}}else{i.status=b}}if(i.status===b){if(i.gzhead.name){r=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>r){e.adler=f(e.adler,i.pending_buf,i.pending-r,r)}O(e);r=i.pending;if(i.pending===i.pending_buf_size){o=1;break}}if(i.gzindex<i.gzhead.name.length){o=i.gzhead.name.charCodeAt(i.gzindex++)&255}else{o=0}M(i,o)}while(o!==0);if(i.gzhead.hcrc&&i.pending>r){e.adler=f(e.adler,i.pending_buf,i.pending-r,r)}if(o===0){i.gzindex=0;i.status=C}}else{i.status=C}}if(i.status===C){if(i.gzhead.comment){r=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>r){e.adler=f(e.adler,i.pending_buf,i.pending-r,r)}O(e);r=i.pending;if(i.pending===i.pending_buf_size){o=1;break}}if(i.gzindex<i.gzhead.comment.length){o=i.gzhead.comment.charCodeAt(i.gzindex++)&255}else{o=0}M(i,o)}while(o!==0);if(i.gzhead.hcrc&&i.pending>r){e.adler=f(e.adler,i.pending_buf,i.pending-r,r)}if(o===0){i.status=k}}else{i.status=k}}if(i.status===k){if(i.gzhead.hcrc){if(i.pending+2>i.pending_buf_size){O(e)}if(i.pending+2<=i.pending_buf_size){M(i,e.adler&255);M(i,e.adler>>8&255);e.adler=0;i.status=T}}else{i.status=T}}if(i.pending!==0){O(e);if(e.avail_out===0){i.last_flush=-1;return p}}else if(e.avail_in===0&&ue(t)<=ue(n)&&t!==d){return q(e,m)}if(i.status===R&&e.avail_in!==0){return q(e,m)}if(e.avail_in!==0||i.lookahead!==0||t!==h&&i.status!==R){var u=i.strategy===y?pe(i,t):i.strategy===G?de(i,t):W[i.level].func(i,t);if(u===I||u===E){i.status=R}if(u===D||u===I){if(e.avail_out===0){i.last_flush=-1}return p}if(u===x){if(t===B){l._tr_align(i)}else if(t!==J){l._tr_stored_block(i,0,0,false);if(t===z){A(i.head);if(i.lookahead===0){i.strstart=0;i.block_start=0;i.insert=0}}}O(e);if(e.avail_out===0){i.last_flush=-1;return p}}}if(t!==d){return p}if(i.wrap<=0){return H}if(i.wrap===2){M(i,e.adler&255);M(i,e.adler>>8&255);M(i,e.adler>>16&255);M(i,e.adler>>24&255);M(i,e.total_in&255);M(i,e.total_in>>8&255);M(i,e.total_in>>16&255);M(i,e.total_in>>24&255)}else{L(i,e.adler>>>16);L(i,e.adler&65535)}O(e);if(i.wrap>0){i.wrap=-i.wrap}return i.pending!==0?p:H}function be(e){var t;if(!e||!e.state){return v}t=e.state.status;if(t!==_&&t!==se&&t!==b&&t!==C&&t!==k&&t!==T&&t!==R){return q(e,v)}e.state=null;return t===T?q(e,u):p}function Ce(e,t){var n=t.length;var i;var r,o;var s;var a;var u;var l;var f;if(!e||!e.state){return v}i=e.state;s=i.wrap;if(s===2||s===1&&i.status!==_||i.lookahead){return v}if(s===1){e.adler=N(e.adler,t,n,0)}i.wrap=0;if(n>=i.w_size){if(s===0){A(i.head);i.strstart=0;i.block_start=0;i.insert=0}f=new c.Buf8(i.w_size);c.arraySet(f,t,n-i.w_size,i.w_size,0);t=f;n=i.w_size}a=e.avail_in;u=e.next_in;l=e.input;e.avail_in=n;e.next_in=0;e.input=t;F(i);while(i.lookahead>=P){r=i.strstart;o=i.lookahead-(P-1);do{i.ins_h=(i.ins_h<<i.hash_shift^i.window[r+P-1])&i.hash_mask;i.prev[r&i.w_mask]=i.head[i.ins_h];i.head[i.ins_h]=r;r++}while(--o);i.strstart=r;i.lookahead=P-1;F(i)}i.strstart+=i.lookahead;i.block_start=i.strstart;i.insert=i.lookahead;i.lookahead=0;i.match_length=i.prev_length=P-1;i.match_available=0;e.next_in=u;e.input=l;e.avail_in=a;i.wrap=s;return p}e.deflateInit=Se;e.deflateInit2=we;e.deflateReset=ge;e.deflateResetKeep=ye;e.deflateSetHeader=Pe;e.deflate=_e;e.deflateEnd=be;e.deflateSetDictionary=Ce;e.deflateInfo="pako deflate (from Nodeca project)"},function(L,e,F){"use strict";var W=F(4);var N=4;var i=0;var r=1;var B=2;function t(e){var t=e.length;while(--t>=0){e[t]=0}}var z=0;var a=1;var J=2;var H=3;var U=258;var s=29;var u=256;var l=u+1+s;var f=30;var c=19;var m=2*l+1;var y=15;var o=16;var j=7;var h=256;var d=16;var p=17;var v=18;var g=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];var P=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];var G=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];var w=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var V=512;var S=new Array((l+2)*2);t(S);var _=new Array(f*2);t(_);var b=new Array(V);t(b);var C=new Array(U-H+1);t(C);var k=new Array(s);t(k);var T=new Array(f);t(T);function R(e,t,n,i,r){this.static_tree=e;this.extra_bits=t;this.extra_base=n;this.elems=i;this.max_length=r;this.has_stree=e&&e.length}var D;var x;var I;function n(e,t){this.dyn_tree=e;this.max_code=0;this.stat_desc=t}function Y(e){return e<256?b[e]:b[256+(e>>>7)]}function E(e,t){e.pending_buf[e.pending++]=t&255;e.pending_buf[e.pending++]=t>>>8&255}function q(e,t,n){if(e.bi_valid>o-n){e.bi_buf|=t<<e.bi_valid&65535;E(e,e.bi_buf);e.bi_buf=t>>o-e.bi_valid;e.bi_valid+=n-o}else{e.bi_buf|=t<<e.bi_valid&65535;e.bi_valid+=n}}function A(e,t,n){q(e,n[t*2],n[t*2+1])}function X(e,t){var n=0;do{n|=e&1;e>>>=1;n<<=1}while(--t>0);return n>>>1}function Z(e){if(e.bi_valid===16){E(e,e.bi_buf);e.bi_buf=0;e.bi_valid=0}else if(e.bi_valid>=8){e.pending_buf[e.pending++]=e.bi_buf&255;e.bi_buf>>=8;e.bi_valid-=8}}function K(e,t){var n=t.dyn_tree;var i=t.max_code;var r=t.stat_desc.static_tree;var o=t.stat_desc.has_stree;var s=t.stat_desc.extra_bits;var a=t.stat_desc.extra_base;var u=t.stat_desc.max_length;var l;var f,c;var h;var d;var p;var v=0;for(h=0;h<=y;h++){e.bl_count[h]=0}n[e.heap[e.heap_max]*2+1]=0;for(l=e.heap_max+1;l<m;l++){f=e.heap[l];h=n[n[f*2+1]*2+1]+1;if(h>u){h=u;v++}n[f*2+1]=h;if(f>i){continue}e.bl_count[h]++;d=0;if(f>=a){d=s[f-a]}p=n[f*2];e.opt_len+=p*(h+d);if(o){e.static_len+=p*(r[f*2+1]+d)}}if(v===0){return}do{h=u-1;while(e.bl_count[h]===0){h--}e.bl_count[h]--;e.bl_count[h+1]+=2;e.bl_count[u]--;v-=2}while(v>0);for(h=u;h!==0;h--){f=e.bl_count[h];while(f!==0){c=e.heap[--l];if(c>i){continue}if(n[c*2+1]!==h){e.opt_len+=(h-n[c*2+1])*n[c*2];n[c*2+1]=h}f--}}}function $(e,t,n){var i=new Array(y+1);var r=0;var o;var s;for(o=1;o<=y;o++){i[o]=r=r+n[o-1]<<1}for(s=0;s<=t;s++){var a=e[s*2+1];if(a===0){continue}e[s*2]=X(i[a]++,a)}}function Q(){var e;var t;var n;var i;var r;var o=new Array(y+1);n=0;for(i=0;i<s-1;i++){k[i]=n;for(e=0;e<1<<g[i];e++){C[n++]=i}}C[n-1]=i;r=0;for(i=0;i<16;i++){T[i]=r;for(e=0;e<1<<P[i];e++){b[r++]=i}}r>>=7;for(;i<f;i++){T[i]=r<<7;for(e=0;e<1<<P[i]-7;e++){b[256+r++]=i}}for(t=0;t<=y;t++){o[t]=0}e=0;while(e<=143){S[e*2+1]=8;e++;o[8]++}while(e<=255){S[e*2+1]=9;e++;o[9]++}while(e<=279){S[e*2+1]=7;e++;o[7]++}while(e<=287){S[e*2+1]=8;e++;o[8]++}$(S,l+1,o);for(e=0;e<f;e++){_[e*2+1]=5;_[e*2]=X(e,5)}D=new R(S,g,u+1,l,y);x=new R(_,P,0,f,y);I=new R(new Array(0),G,0,c,j)}function ee(e){var t;for(t=0;t<l;t++){e.dyn_ltree[t*2]=0}for(t=0;t<f;t++){e.dyn_dtree[t*2]=0}for(t=0;t<c;t++){e.bl_tree[t*2]=0}e.dyn_ltree[h*2]=1;e.opt_len=e.static_len=0;e.last_lit=e.matches=0}function te(e){if(e.bi_valid>8){E(e,e.bi_buf)}else if(e.bi_valid>0){e.pending_buf[e.pending++]=e.bi_buf}e.bi_buf=0;e.bi_valid=0}function ne(e,t,n,i){te(e);if(i){E(e,n);E(e,~n)}W.arraySet(e.pending_buf,e.window,t,n,e.pending);e.pending+=n}function ie(e,t,n,i){var r=t*2;var o=n*2;return e[r]<e[o]||e[r]===e[o]&&i[t]<=i[n]}function O(e,t,n){var i=e.heap[n];var r=n<<1;while(r<=e.heap_len){if(r<e.heap_len&&ie(t,e.heap[r+1],e.heap[r],e.depth)){r++}if(ie(t,i,e.heap[r],e.depth)){break}e.heap[n]=e.heap[r];n=r;r<<=1}e.heap[n]=i}function re(e,t,n){var i;var r;var o=0;var s;var a;if(e.last_lit!==0){do{i=e.pending_buf[e.d_buf+o*2]<<8|e.pending_buf[e.d_buf+o*2+1];r=e.pending_buf[e.l_buf+o];o++;if(i===0){A(e,r,t)}else{s=C[r];A(e,s+u+1,t);a=g[s];if(a!==0){r-=k[s];q(e,r,a)}i--;s=Y(i);A(e,s,n);a=P[s];if(a!==0){i-=T[s];q(e,i,a)}}}while(o<e.last_lit)}A(e,h,t)}function M(e,t){var n=t.dyn_tree;var i=t.stat_desc.static_tree;var r=t.stat_desc.has_stree;var o=t.stat_desc.elems;var s,a;var u=-1;var l;e.heap_len=0;e.heap_max=m;for(s=0;s<o;s++){if(n[s*2]!==0){e.heap[++e.heap_len]=u=s;e.depth[s]=0}else{n[s*2+1]=0}}while(e.heap_len<2){l=e.heap[++e.heap_len]=u<2?++u:0;n[l*2]=1;e.depth[l]=0;e.opt_len--;if(r){e.static_len-=i[l*2+1]}}t.max_code=u;for(s=e.heap_len>>1;s>=1;s--){O(e,n,s)}l=o;do{s=e.heap[1];e.heap[1]=e.heap[e.heap_len--];O(e,n,1);a=e.heap[1];e.heap[--e.heap_max]=s;e.heap[--e.heap_max]=a;n[l*2]=n[s*2]+n[a*2];e.depth[l]=(e.depth[s]>=e.depth[a]?e.depth[s]:e.depth[a])+1;n[s*2+1]=n[a*2+1]=l;e.heap[1]=l++;O(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1];K(e,t);$(n,u,e.bl_count)}function oe(e,t,n){var i;var r=-1;var o;var s=t[0*2+1];var a=0;var u=7;var l=4;if(s===0){u=138;l=3}t[(n+1)*2+1]=65535;for(i=0;i<=n;i++){o=s;s=t[(i+1)*2+1];if(++a<u&&o===s){continue}else if(a<l){e.bl_tree[o*2]+=a}else if(o!==0){if(o!==r){e.bl_tree[o*2]++}e.bl_tree[d*2]++}else if(a<=10){e.bl_tree[p*2]++}else{e.bl_tree[v*2]++}a=0;r=o;if(s===0){u=138;l=3}else if(o===s){u=6;l=3}else{u=7;l=4}}}function se(e,t,n){var i;var r=-1;var o;var s=t[0*2+1];var a=0;var u=7;var l=4;if(s===0){u=138;l=3}for(i=0;i<=n;i++){o=s;s=t[(i+1)*2+1];if(++a<u&&o===s){continue}else if(a<l){do{A(e,o,e.bl_tree)}while(--a!==0)}else if(o!==0){if(o!==r){A(e,o,e.bl_tree);a--}A(e,d,e.bl_tree);q(e,a-3,2)}else if(a<=10){A(e,p,e.bl_tree);q(e,a-3,3)}else{A(e,v,e.bl_tree);q(e,a-11,7)}a=0;r=o;if(s===0){u=138;l=3}else if(o===s){u=6;l=3}else{u=7;l=4}}}function ae(e){var t;oe(e,e.dyn_ltree,e.l_desc.max_code);oe(e,e.dyn_dtree,e.d_desc.max_code);M(e,e.bl_desc);for(t=c-1;t>=3;t--){if(e.bl_tree[w[t]*2+1]!==0){break}}e.opt_len+=3*(t+1)+5+5+4;return t}function ue(e,t,n,i){var r;q(e,t-257,5);q(e,n-1,5);q(e,i-4,4);for(r=0;r<i;r++){q(e,e.bl_tree[w[r]*2+1],3)}se(e,e.dyn_ltree,t-1);se(e,e.dyn_dtree,n-1)}function le(e){var t=4093624447;var n;for(n=0;n<=31;n++,t>>>=1){if(t&1&&e.dyn_ltree[n*2]!==0){return i}}if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0){return r}for(n=32;n<u;n++){if(e.dyn_ltree[n*2]!==0){return r}}return i}var fe=false;function ce(e){if(!fe){Q();fe=true}e.l_desc=new n(e.dyn_ltree,D);e.d_desc=new n(e.dyn_dtree,x);e.bl_desc=new n(e.bl_tree,I);e.bi_buf=0;e.bi_valid=0;ee(e)}function he(e,t,n,i){q(e,(z<<1)+(i?1:0),3);ne(e,t,n,true)}function de(e){q(e,a<<1,3);A(e,h,S);Z(e)}function pe(e,t,n,i){var r,o;var s=0;if(e.level>0){if(e.strm.data_type===B){e.strm.data_type=le(e)}M(e,e.l_desc);M(e,e.d_desc);s=ae(e);r=e.opt_len+3+7>>>3;o=e.static_len+3+7>>>3;if(o<=r){r=o}}else{r=o=n+5}if(n+4<=r&&t!==-1){he(e,t,n,i)}else if(e.strategy===N||o===r){q(e,(a<<1)+(i?1:0),3);re(e,S,_)}else{q(e,(J<<1)+(i?1:0),3);ue(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1);re(e,e.dyn_ltree,e.dyn_dtree)}ee(e);if(i){te(e)}}function ve(e,t,n){e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255;e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255;e.pending_buf[e.l_buf+e.last_lit]=n&255;e.last_lit++;if(t===0){e.dyn_ltree[n*2]++}else{e.matches++;t--;e.dyn_ltree[(C[n]+u+1)*2]++;e.dyn_dtree[Y(t)*2]++}return e.last_lit===e.lit_bufsize-1}e._tr_init=ce;e._tr_stored_block=he;e._tr_flush_block=pe;e._tr_tally=ve;e._tr_align=de},function(e,t,n){"use strict";var c=n(84);var h=n(4);var d=n(43);var p=n(45);var i=n(17);var r=n(44);var o=n(87);var v=Object.prototype.toString;function s(e){if(!(this instanceof s))return new s(e);this.options=h.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;if(t.raw&&t.windowBits>=0&&t.windowBits<16){t.windowBits=-t.windowBits;if(t.windowBits===0){t.windowBits=-15}}if(t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)){t.windowBits+=32}if(t.windowBits>15&&t.windowBits<48){if((t.windowBits&15)===0){t.windowBits|=15}}this.err=0;this.msg="";this.ended=false;this.chunks=[];this.strm=new r;this.strm.avail_out=0;var n=c.inflateInit2(this.strm,t.windowBits);if(n!==p.Z_OK){throw new Error(i[n])}this.header=new o;c.inflateGetHeader(this.strm,this.header);if(t.dictionary){if(typeof t.dictionary==="string"){t.dictionary=d.string2buf(t.dictionary)}else if(v.call(t.dictionary)==="[object ArrayBuffer]"){t.dictionary=new Uint8Array(t.dictionary)}if(t.raw){n=c.inflateSetDictionary(this.strm,t.dictionary);if(n!==p.Z_OK){throw new Error(i[n])}}}}s.prototype.push=function(e,t){var n=this.strm;var i=this.options.chunkSize;var r=this.options.dictionary;var o,s;var a,u,l;var f=false;if(this.ended){return false}s=t===~~t?t:t===true?p.Z_FINISH:p.Z_NO_FLUSH;if(typeof e==="string"){n.input=d.binstring2buf(e)}else if(v.call(e)==="[object ArrayBuffer]"){n.input=new Uint8Array(e)}else{n.input=e}n.next_in=0;n.avail_in=n.input.length;do{if(n.avail_out===0){n.output=new h.Buf8(i);n.next_out=0;n.avail_out=i}o=c.inflate(n,p.Z_NO_FLUSH);if(o===p.Z_NEED_DICT&&r){o=c.inflateSetDictionary(this.strm,r)}if(o===p.Z_BUF_ERROR&&f===true){o=p.Z_OK;f=false}if(o!==p.Z_STREAM_END&&o!==p.Z_OK){this.onEnd(o);this.ended=true;return false}if(n.next_out){if(n.avail_out===0||o===p.Z_STREAM_END||n.avail_in===0&&(s===p.Z_FINISH||s===p.Z_SYNC_FLUSH)){if(this.options.to==="string"){a=d.utf8border(n.output,n.next_out);u=n.next_out-a;l=d.buf2string(n.output,a);n.next_out=u;n.avail_out=i-u;if(u){h.arraySet(n.output,n.output,a,u,0)}this.onData(l)}else{this.onData(h.shrinkBuf(n.output,n.next_out))}}}if(n.avail_in===0&&n.avail_out===0){f=true}}while((n.avail_in>0||n.avail_out===0)&&o!==p.Z_STREAM_END);if(o===p.Z_STREAM_END){s=p.Z_FINISH}if(s===p.Z_FINISH){o=c.inflateEnd(this.strm);this.onEnd(o);this.ended=true;return o===p.Z_OK}if(s===p.Z_SYNC_FLUSH){this.onEnd(p.Z_OK);n.avail_out=0;return true}return true};s.prototype.onData=function(e){this.chunks.push(e)};s.prototype.onEnd=function(e){if(e===p.Z_OK){if(this.options.to==="string"){this.result=this.chunks.join("")}else{this.result=h.flattenChunks(this.chunks)}}this.chunks=[];this.err=e;this.msg=this.strm.msg};function a(e,t){var n=new s(t);n.push(e,true);if(n.err){throw n.msg||i[n.err]}return n.result}function u(e,t){t=t||{};t.raw=true;return a(e,t)}t.Inflate=s;t.inflate=a;t.inflateRaw=u;t.ungzip=a},function(r,e,t){"use strict";var x=t(4);var I=t(41);var E=t(42);var ae=t(85);var q=t(86);var ue=0;var A=1;var O=2;var M=4;var le=5;var L=6;var F=0;var fe=1;var ce=2;var W=-2;var N=-3;var B=-4;var he=-5;var z=8;var J=1;var H=2;var U=3;var j=4;var G=5;var V=6;var Y=7;var X=8;var Z=9;var K=10;var $=11;var Q=12;var ee=13;var de=14;var te=15;var pe=16;var ve=17;var me=18;var ye=19;var ne=20;var ie=21;var ge=22;var Pe=23;var we=24;var Se=25;var _e=26;var re=27;var be=28;var Ce=29;var oe=30;var se=31;var ke=32;var o=852;var s=592;var a=15;var u=a;function Te(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function l(){this.mode=0;this.last=false;this.wrap=0;this.havedict=false;this.flags=0;this.dmax=0;this.check=0;this.total=0;this.head=null;this.wbits=0;this.wsize=0;this.whave=0;this.wnext=0;this.window=null;this.hold=0;this.bits=0;this.length=0;this.offset=0;this.extra=0;this.lencode=null;this.distcode=null;this.lenbits=0;this.distbits=0;this.ncode=0;this.nlen=0;this.ndist=0;this.have=0;this.next=null;this.lens=new x.Buf16(320);this.work=new x.Buf16(288);this.lendyn=null;this.distdyn=null;this.sane=0;this.back=0;this.was=0}function f(e){var t;if(!e||!e.state){return W}t=e.state;e.total_in=e.total_out=t.total=0;e.msg="";if(t.wrap){e.adler=t.wrap&1}t.mode=J;t.last=0;t.havedict=0;t.dmax=32768;t.head=null;t.hold=0;t.bits=0;t.lencode=t.lendyn=new x.Buf32(o);t.distcode=t.distdyn=new x.Buf32(s);t.sane=1;t.back=-1;return F}function c(e){var t;if(!e||!e.state){return W}t=e.state;t.wsize=0;t.whave=0;t.wnext=0;return f(e)}function h(e,t){var n;var i;if(!e||!e.state){return W}i=e.state;if(t<0){n=0;t=-t}else{n=(t>>4)+1;if(t<48){t&=15}}if(t&&(t<8||t>15)){return W}if(i.window!==null&&i.wbits!==t){i.window=null}i.wrap=n;i.wbits=t;return c(e)}function d(e,t){var n;var i;if(!e){return W}i=new l;e.state=i;i.window=null;n=h(e,t);if(n!==F){e.state=null}return n}function p(e){return d(e,u)}var v=true;var n,i;function Re(e){if(v){var t;n=new x.Buf32(512);i=new x.Buf32(32);t=0;while(t<144){e.lens[t++]=8}while(t<256){e.lens[t++]=9}while(t<280){e.lens[t++]=7}while(t<288){e.lens[t++]=8}q(A,e.lens,0,288,n,0,e.work,{bits:9});t=0;while(t<32){e.lens[t++]=5}q(O,e.lens,0,32,i,0,e.work,{bits:5});v=false}e.lencode=n;e.lenbits=9;e.distcode=i;e.distbits=5}function De(e,t,n,i){var r;var o=e.state;if(o.window===null){o.wsize=1<<o.wbits;o.wnext=0;o.whave=0;o.window=new x.Buf8(o.wsize)}if(i>=o.wsize){x.arraySet(o.window,t,n-o.wsize,o.wsize,0);o.wnext=0;o.whave=o.wsize}else{r=o.wsize-o.wnext;if(r>i){r=i}x.arraySet(o.window,t,n-i,r,o.wnext);i-=r;if(i){x.arraySet(o.window,t,n-i,i,0);o.wnext=i;o.whave=o.wsize}else{o.wnext+=r;if(o.wnext===o.wsize){o.wnext=0}if(o.whave<o.wsize){o.whave+=r}}}return 0}function m(e,t){var n;var i,r;var o;var s;var a,u;var l;var f;var c,h;var d;var p;var v;var m=0;var y,g,P;var w,S,_;var b;var C;var k=new x.Buf8(4);var T;var R;var D=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0){return W}n=e.state;if(n.mode===Q){n.mode=ee}s=e.next_out;r=e.output;u=e.avail_out;o=e.next_in;i=e.input;a=e.avail_in;l=n.hold;f=n.bits;c=a;h=u;C=F;e:for(;;){switch(n.mode){case J:if(n.wrap===0){n.mode=ee;break}while(f<16){if(a===0){break e}a--;l+=i[o++]<<f;f+=8}if(n.wrap&2&&l===35615){n.check=0;k[0]=l&255;k[1]=l>>>8&255;n.check=E(n.check,k,2,0);l=0;f=0;n.mode=H;break}n.flags=0;if(n.head){n.head.done=false}if(!(n.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg="incorrect header check";n.mode=oe;break}if((l&15)!==z){e.msg="unknown compression method";n.mode=oe;break}l>>>=4;f-=4;b=(l&15)+8;if(n.wbits===0){n.wbits=b}else if(b>n.wbits){e.msg="invalid window size";n.mode=oe;break}n.dmax=1<<b;e.adler=n.check=1;n.mode=l&512?K:Q;l=0;f=0;break;case H:while(f<16){if(a===0){break e}a--;l+=i[o++]<<f;f+=8}n.flags=l;if((n.flags&255)!==z){e.msg="unknown compression method";n.mode=oe;break}if(n.flags&57344){e.msg="unknown header flags set";n.mode=oe;break}if(n.head){n.head.text=l>>8&1}if(n.flags&512){k[0]=l&255;k[1]=l>>>8&255;n.check=E(n.check,k,2,0)}l=0;f=0;n.mode=U;case U:while(f<32){if(a===0){break e}a--;l+=i[o++]<<f;f+=8}if(n.head){n.head.time=l}if(n.flags&512){k[0]=l&255;k[1]=l>>>8&255;k[2]=l>>>16&255;k[3]=l>>>24&255;n.check=E(n.check,k,4,0)}l=0;f=0;n.mode=j;case j:while(f<16){if(a===0){break e}a--;l+=i[o++]<<f;f+=8}if(n.head){n.head.xflags=l&255;n.head.os=l>>8}if(n.flags&512){k[0]=l&255;k[1]=l>>>8&255;n.check=E(n.check,k,2,0)}l=0;f=0;n.mode=G;case G:if(n.flags&1024){while(f<16){if(a===0){break e}a--;l+=i[o++]<<f;f+=8}n.length=l;if(n.head){n.head.extra_len=l}if(n.flags&512){k[0]=l&255;k[1]=l>>>8&255;n.check=E(n.check,k,2,0)}l=0;f=0}else if(n.head){n.head.extra=null}n.mode=V;case V:if(n.flags&1024){d=n.length;if(d>a){d=a}if(d){if(n.head){b=n.head.extra_len-n.length;if(!n.head.extra){n.head.extra=new Array(n.head.extra_len)}x.arraySet(n.head.extra,i,o,d,b)}if(n.flags&512){n.check=E(n.check,i,d,o)}a-=d;o+=d;n.length-=d}if(n.length){break e}}n.length=0;n.mode=Y;case Y:if(n.flags&2048){if(a===0){break e}d=0;do{b=i[o+d++];if(n.head&&b&&n.length<65536){n.head.name+=String.fromCharCode(b)}}while(b&&d<a);if(n.flags&512){n.check=E(n.check,i,d,o)}a-=d;o+=d;if(b){break e}}else if(n.head){n.head.name=null}n.length=0;n.mode=X;case X:if(n.flags&4096){if(a===0){break e}d=0;do{b=i[o+d++];if(n.head&&b&&n.length<65536){n.head.comment+=String.fromCharCode(b)}}while(b&&d<a);if(n.flags&512){n.check=E(n.check,i,d,o)}a-=d;o+=d;if(b){break e}}else if(n.head){n.head.comment=null}n.mode=Z;case Z:if(n.flags&512){while(f<16){if(a===0){break e}a--;l+=i[o++]<<f;f+=8}if(l!==(n.check&65535)){e.msg="header crc mismatch";n.mode=oe;break}l=0;f=0}if(n.head){n.head.hcrc=n.flags>>9&1;n.head.done=true}e.adler=n.check=0;n.mode=Q;break;case K:while(f<32){if(a===0){break e}a--;l+=i[o++]<<f;f+=8}e.adler=n.check=Te(l);l=0;f=0;n.mode=$;case $:if(n.havedict===0){e.next_out=s;e.avail_out=u;e.next_in=o;e.avail_in=a;n.hold=l;n.bits=f;return ce}e.adler=n.check=1;n.mode=Q;case Q:if(t===le||t===L){break e}case ee:if(n.last){l>>>=f&7;f-=f&7;n.mode=re;break}while(f<3){if(a===0){break e}a--;l+=i[o++]<<f;f+=8}n.last=l&1;l>>>=1;f-=1;switch(l&3){case 0:n.mode=de;break;case 1:Re(n);n.mode=ne;if(t===L){l>>>=2;f-=2;break e}break;case 2:n.mode=ve;break;case 3:e.msg="invalid block type";n.mode=oe}l>>>=2;f-=2;break;case de:l>>>=f&7;f-=f&7;while(f<32){if(a===0){break e}a--;l+=i[o++]<<f;f+=8}if((l&65535)!==(l>>>16^65535)){e.msg="invalid stored block lengths";n.mode=oe;break}n.length=l&65535;l=0;f=0;n.mode=te;if(t===L){break e}case te:n.mode=pe;case pe:d=n.length;if(d){if(d>a){d=a}if(d>u){d=u}if(d===0){break e}x.arraySet(r,i,o,d,s);a-=d;o+=d;u-=d;s+=d;n.length-=d;break}n.mode=Q;break;case ve:while(f<14){if(a===0){break e}a--;l+=i[o++]<<f;f+=8}n.nlen=(l&31)+257;l>>>=5;f-=5;n.ndist=(l&31)+1;l>>>=5;f-=5;n.ncode=(l&15)+4;l>>>=4;f-=4;if(n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols";n.mode=oe;break}n.have=0;n.mode=me;case me:while(n.have<n.ncode){while(f<3){if(a===0){break e}a--;l+=i[o++]<<f;f+=8}n.lens[D[n.have++]]=l&7;l>>>=3;f-=3}while(n.have<19){n.lens[D[n.have++]]=0}n.lencode=n.lendyn;n.lenbits=7;T={bits:n.lenbits};C=q(ue,n.lens,0,19,n.lencode,0,n.work,T);n.lenbits=T.bits;if(C){e.msg="invalid code lengths set";n.mode=oe;break}n.have=0;n.mode=ye;case ye:while(n.have<n.nlen+n.ndist){for(;;){m=n.lencode[l&(1<<n.lenbits)-1];y=m>>>24;g=m>>>16&255;P=m&65535;if(y<=f){break}if(a===0){break e}a--;l+=i[o++]<<f;f+=8}if(P<16){l>>>=y;f-=y;n.lens[n.have++]=P}else{if(P===16){R=y+2;while(f<R){if(a===0){break e}a--;l+=i[o++]<<f;f+=8}l>>>=y;f-=y;if(n.have===0){e.msg="invalid bit length repeat";n.mode=oe;break}b=n.lens[n.have-1];d=3+(l&3);l>>>=2;f-=2}else if(P===17){R=y+3;while(f<R){if(a===0){break e}a--;l+=i[o++]<<f;f+=8}l>>>=y;f-=y;b=0;d=3+(l&7);l>>>=3;f-=3}else{R=y+7;while(f<R){if(a===0){break e}a--;l+=i[o++]<<f;f+=8}l>>>=y;f-=y;b=0;d=11+(l&127);l>>>=7;f-=7}if(n.have+d>n.nlen+n.ndist){e.msg="invalid bit length repeat";n.mode=oe;break}while(d--){n.lens[n.have++]=b}}}if(n.mode===oe){break}if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block";n.mode=oe;break}n.lenbits=9;T={bits:n.lenbits};C=q(A,n.lens,0,n.nlen,n.lencode,0,n.work,T);n.lenbits=T.bits;if(C){e.msg="invalid literal/lengths set";n.mode=oe;break}n.distbits=6;n.distcode=n.distdyn;T={bits:n.distbits};C=q(O,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,T);n.distbits=T.bits;if(C){e.msg="invalid distances set";n.mode=oe;break}n.mode=ne;if(t===L){break e}case ne:n.mode=ie;case ie:if(a>=6&&u>=258){e.next_out=s;e.avail_out=u;e.next_in=o;e.avail_in=a;n.hold=l;n.bits=f;ae(e,h);s=e.next_out;r=e.output;u=e.avail_out;o=e.next_in;i=e.input;a=e.avail_in;l=n.hold;f=n.bits;if(n.mode===Q){n.back=-1}break}n.back=0;for(;;){m=n.lencode[l&(1<<n.lenbits)-1];y=m>>>24;g=m>>>16&255;P=m&65535;if(y<=f){break}if(a===0){break e}a--;l+=i[o++]<<f;f+=8}if(g&&(g&240)===0){w=y;S=g;_=P;for(;;){m=n.lencode[_+((l&(1<<w+S)-1)>>w)];y=m>>>24;g=m>>>16&255;P=m&65535;if(w+y<=f){break}if(a===0){break e}a--;l+=i[o++]<<f;f+=8}l>>>=w;f-=w;n.back+=w}l>>>=y;f-=y;n.back+=y;n.length=P;if(g===0){n.mode=_e;break}if(g&32){n.back=-1;n.mode=Q;break}if(g&64){e.msg="invalid literal/length code";n.mode=oe;break}n.extra=g&15;n.mode=ge;case ge:if(n.extra){R=n.extra;while(f<R){if(a===0){break e}a--;l+=i[o++]<<f;f+=8}n.length+=l&(1<<n.extra)-1;l>>>=n.extra;f-=n.extra;n.back+=n.extra}n.was=n.length;n.mode=Pe;case Pe:for(;;){m=n.distcode[l&(1<<n.distbits)-1];y=m>>>24;g=m>>>16&255;P=m&65535;if(y<=f){break}if(a===0){break e}a--;l+=i[o++]<<f;f+=8}if((g&240)===0){w=y;S=g;_=P;for(;;){m=n.distcode[_+((l&(1<<w+S)-1)>>w)];y=m>>>24;g=m>>>16&255;P=m&65535;if(w+y<=f){break}if(a===0){break e}a--;l+=i[o++]<<f;f+=8}l>>>=w;f-=w;n.back+=w}l>>>=y;f-=y;n.back+=y;if(g&64){e.msg="invalid distance code";n.mode=oe;break}n.offset=P;n.extra=g&15;n.mode=we;case we:if(n.extra){R=n.extra;while(f<R){if(a===0){break e}a--;l+=i[o++]<<f;f+=8}n.offset+=l&(1<<n.extra)-1;l>>>=n.extra;f-=n.extra;n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back";n.mode=oe;break}n.mode=Se;case Se:if(u===0){break e}d=h-u;if(n.offset>d){d=n.offset-d;if(d>n.whave){if(n.sane){e.msg="invalid distance too far back";n.mode=oe;break}}if(d>n.wnext){d-=n.wnext;p=n.wsize-d}else{p=n.wnext-d}if(d>n.length){d=n.length}v=n.window}else{v=r;p=s-n.offset;d=n.length}if(d>u){d=u}u-=d;n.length-=d;do{r[s++]=v[p++]}while(--d);if(n.length===0){n.mode=ie}break;case _e:if(u===0){break e}r[s++]=n.length;u--;n.mode=ie;break;case re:if(n.wrap){while(f<32){if(a===0){break e}a--;l|=i[o++]<<f;f+=8}h-=u;e.total_out+=h;n.total+=h;if(h){e.adler=n.check=n.flags?E(n.check,r,h,s-h):I(n.check,r,h,s-h)}h=u;if((n.flags?l:Te(l))!==n.check){e.msg="incorrect data check";n.mode=oe;break}l=0;f=0}n.mode=be;case be:if(n.wrap&&n.flags){while(f<32){if(a===0){break e}a--;l+=i[o++]<<f;f+=8}if(l!==(n.total&4294967295)){e.msg="incorrect length check";n.mode=oe;break}l=0;f=0}n.mode=Ce;case Ce:C=fe;break e;case oe:C=N;break e;case se:return B;case ke:default:return W}}e.next_out=s;e.avail_out=u;e.next_in=o;e.avail_in=a;n.hold=l;n.bits=f;if(n.wsize||h!==e.avail_out&&n.mode<oe&&(n.mode<re||t!==M)){if(De(e,e.output,e.next_out,h-e.avail_out)){n.mode=se;return B}}c-=e.avail_in;h-=e.avail_out;e.total_in+=c;e.total_out+=h;n.total+=h;if(n.wrap&&h){e.adler=n.check=n.flags?E(n.check,r,h,e.next_out-h):I(n.check,r,h,e.next_out-h)}e.data_type=n.bits+(n.last?64:0)+(n.mode===Q?128:0)+(n.mode===ne||n.mode===te?256:0);if((c===0&&h===0||t===M)&&C===F){C=he}return C}function y(e){if(!e||!e.state){return W}var t=e.state;if(t.window){t.window=null}e.state=null;return F}function g(e,t){var n;if(!e||!e.state){return W}n=e.state;if((n.wrap&2)===0){return W}n.head=t;t.done=false;return F}function P(e,t){var n=t.length;var i;var r;var o;if(!e||!e.state){return W}i=e.state;if(i.wrap!==0&&i.mode!==$){return W}if(i.mode===$){r=1;r=I(r,t,n,0);if(r!==i.check){return N}}o=De(e,t,n,n);if(o){i.mode=se;return B}i.havedict=1;return F}e.inflateReset=c;e.inflateReset2=h;e.inflateResetKeep=f;e.inflateInit=p;e.inflateInit2=d;e.inflate=m;e.inflateEnd=y;e.inflateGetHeader=g;e.inflateSetDictionary=P;e.inflateInfo="pako inflate (from Nodeca project)"},function(e,t,n){"use strict";var R=30;var D=12;e.exports=function x(e,t){var n;var i;var r;var o;var s;var a;var u;var l;var f;var c;var h;var d;var p;var v;var m;var y;var g;var P;var w;var S;var _;var b;var C;var k,T;n=e.state;i=e.next_in;k=e.input;r=i+(e.avail_in-5);o=e.next_out;T=e.output;s=o-(t-e.avail_out);a=o+(e.avail_out-257);u=n.dmax;l=n.wsize;f=n.whave;c=n.wnext;h=n.window;d=n.hold;p=n.bits;v=n.lencode;m=n.distcode;y=(1<<n.lenbits)-1;g=(1<<n.distbits)-1;e:do{if(p<15){d+=k[i++]<<p;p+=8;d+=k[i++]<<p;p+=8}P=v[d&y];t:for(;;){w=P>>>24;d>>>=w;p-=w;w=P>>>16&255;if(w===0){T[o++]=P&65535}else if(w&16){S=P&65535;w&=15;if(w){if(p<w){d+=k[i++]<<p;p+=8}S+=d&(1<<w)-1;d>>>=w;p-=w}if(p<15){d+=k[i++]<<p;p+=8;d+=k[i++]<<p;p+=8}P=m[d&g];n:for(;;){w=P>>>24;d>>>=w;p-=w;w=P>>>16&255;if(w&16){_=P&65535;w&=15;if(p<w){d+=k[i++]<<p;p+=8;if(p<w){d+=k[i++]<<p;p+=8}}_+=d&(1<<w)-1;if(_>u){e.msg="invalid distance too far back";n.mode=R;break e}d>>>=w;p-=w;w=o-s;if(_>w){w=_-w;if(w>f){if(n.sane){e.msg="invalid distance too far back";n.mode=R;break e}}b=0;C=h;if(c===0){b+=l-w;if(w<S){S-=w;do{T[o++]=h[b++]}while(--w);b=o-_;C=T}}else if(c<w){b+=l+c-w;w-=c;if(w<S){S-=w;do{T[o++]=h[b++]}while(--w);b=0;if(c<S){w=c;S-=w;do{T[o++]=h[b++]}while(--w);b=o-_;C=T}}}else{b+=c-w;if(w<S){S-=w;do{T[o++]=h[b++]}while(--w);b=o-_;C=T}}while(S>2){T[o++]=C[b++];T[o++]=C[b++];T[o++]=C[b++];S-=3}if(S){T[o++]=C[b++];if(S>1){T[o++]=C[b++]}}}else{b=o-_;do{T[o++]=T[b++];T[o++]=T[b++];T[o++]=T[b++];S-=3}while(S>2);if(S){T[o++]=T[b++];if(S>1){T[o++]=T[b++]}}}}else if((w&64)===0){P=m[(P&65535)+(d&(1<<w)-1)];continue n}else{e.msg="invalid distance code";n.mode=R;break e}break}}else if((w&64)===0){P=v[(P&65535)+(d&(1<<w)-1)];continue t}else if(w&32){n.mode=D;break e}else{e.msg="invalid literal/length code";n.mode=R;break e}break}}while(i<r&&o<a);S=p>>3;i-=S;p-=S<<3;d&=(1<<p)-1;e.next_in=i;e.next_out=o;e.avail_in=i<r?5+(r-i):5-(i-r);e.avail_out=o<a?257+(a-o):257-(o-a);n.hold=d;n.bits=p;return}},function(e,t,n){"use strict";var O=n(4);var M=15;var L=852;var F=592;var W=0;var N=1;var B=2;var z=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0];var J=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78];var H=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0];var U=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function j(e,t,n,i,r,o,s,a){var u=a.bits;var l=0;var f=0;var c=0,h=0;var d=0;var p=0;var v=0;var m=0;var y=0;var g=0;var P;var w;var S;var _;var b;var C=null;var k=0;var T;var R=new O.Buf16(M+1);var D=new O.Buf16(M+1);var x=null;var I=0;var E,q,A;for(l=0;l<=M;l++){R[l]=0}for(f=0;f<i;f++){R[t[n+f]]++}d=u;for(h=M;h>=1;h--){if(R[h]!==0){break}}if(d>h){d=h}if(h===0){r[o++]=1<<24|64<<16|0;r[o++]=1<<24|64<<16|0;a.bits=1;return 0}for(c=1;c<h;c++){if(R[c]!==0){break}}if(d<c){d=c}m=1;for(l=1;l<=M;l++){m<<=1;m-=R[l];if(m<0){return-1}}if(m>0&&(e===W||h!==1)){return-1}D[1]=0;for(l=1;l<M;l++){D[l+1]=D[l]+R[l]}for(f=0;f<i;f++){if(t[n+f]!==0){s[D[t[n+f]]++]=f}}if(e===W){C=x=s;T=19}else if(e===N){C=z;k-=257;x=J;I-=257;T=256}else{C=H;x=U;T=-1}g=0;f=0;l=c;b=o;p=d;v=0;S=-1;y=1<<d;_=y-1;if(e===N&&y>L||e===B&&y>F){return 1}for(;;){E=l-v;if(s[f]<T){q=0;A=s[f]}else if(s[f]>T){q=x[I+s[f]];A=C[k+s[f]]}else{q=32+64;A=0}P=1<<l-v;w=1<<p;c=w;do{w-=P;r[b+(g>>v)+w]=E<<24|q<<16|A|0}while(w!==0);P=1<<l-1;while(g&P){P>>=1}if(P!==0){g&=P-1;g+=P}else{g=0}f++;if(--R[l]===0){if(l===h){break}l=t[n+s[f]]}if(l>d&&(g&_)!==S){if(v===0){v=d}b+=c;p=l-v;m=1<<p;while(p+v<h){m-=R[p+v];if(m<=0){break}p++;m<<=1}y+=1<<p;if(e===N&&y>L||e===B&&y>F){return 1}S=g&_;r[S]=d<<24|p<<16|b-o|0}}if(g!==0){r[b+g]=l-v<<24|64<<16|0}a.bits=d;return 0}},function(e,t,n){"use strict";function i(){this.text=0;this.time=0;this.xflags=0;this.os=0;this.extra=null;this.extra_len=0;this.name="";this.comment="";this.hcrc=0;this.done=false}e.exports=i},function(e,i,r){"use strict";(function(u){Object.defineProperty(i,"__esModule",{value:true});i.WebChannelRequest=undefined;var l=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(e,t,n){if(t)i(e.prototype,t);if(n)i(e,n);return e}}();var e=r(8);var f=t(e);function t(e){return e&&e.__esModule?e:{"default":e}}function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var n=function(){var e=function(){function n(e){c(this,n);var t={iPort:-1,cbConnectSuccess:null,cbConnectError:null,cbConnectClose:null};this.oOptions=u.extend(t,e);this.oWebChannel=null;this.szUUID="";this.szVersion="";this.oRequestList={};this.bNormalClose=false;this.oChannleObj=null;this.oWindowControlCallback={};this.init()}l(n,[{key:"init",value:function e(){var i=this;this.oChannleObj=new window.QWebChannel(window.qt.webChannelTransport,function(e){i.oWebChannel=e.objects.document;var n=f["default"].v4();setTimeout(function(){var e={sequence:n,cmd:"system.webconnect"};var t=JSON.stringify(e);i.oWebChannel.receiveText(t)},500);i.oWebChannel.textSent.connect(function(e){if(!e){return}var t=JSON.parse(e);n=t.sequence;if(typeof n==="undefined"&&typeof t.cmd==="undefined"){i.szUUID=t.uuid;i.szVersion=t.version;if(i.oOptions.cbConnectSuccess){i.oOptions.cbConnectSuccess()}}else{if(typeof t.cmd!=="undefined"){i.parseCmd(t)}else{if(typeof i.oRequestList[n]!=="undefined"){if(0===t.errorCode){i.oRequestList[n].resolve(t)}else{i.oRequestList[n].reject(t)}delete i.oRequestList[n]}}}})})}},{key:"setWindowControlCallback",value:function t(e){this.oWindowControlCallback=e}},{key:"getServiceVersion",value:function i(){return this.szVersion}},{key:"getRequestUUID",value:function r(){return this.szUUID}},{key:"disconnect",value:function o(){}},{key:"sendRequest",value:function s(r){var o=this;var e=new Promise(function(e,t){var n=f["default"].v4();r.sequence=n;o.oRequestList[n]={resolve:e,reject:t};r.uuid=o.szUUID;r.timestamp=(new Date).getTime()+"";var i=JSON.stringify(r);if(o.oWebChannel){o.oWebChannel.receiveText(i)}else{t()}});return e}},{key:"parseCmd",value:function a(e){var t=e.cmd;var n=t.split(".");var i=n[1];if("window"===n[0]||"video"===n[0]){if(this.oWindowControlCallback[i]){this.oWindowControlCallback[i](e)}}}}]);return n}();return e}();i.WebChannelRequest=n}).call(this,r(1))},function(e,n,o){(function(){"use strict";var i,r,t,h,d,p={}.hasOwnProperty;i=o(90);r=o(19).defaults;h=function(e){return typeof e==="string"&&(e.indexOf("&")>=0||e.indexOf(">")>=0||e.indexOf("<")>=0)};d=function(e){return"<![CDATA["+t(e)+"]]>"};t=function(e){return e.replace("]]>","]]]]><![CDATA[>")};n.Builder=function(){function e(e){var t,n,i;this.options={};n=r["0.2"];for(t in n){if(!p.call(n,t))continue;i=n[t];this.options[t]=i}for(t in e){if(!p.call(e,t))continue;i=e[t];this.options[t]=i}}e.prototype.buildObject=function(e){var l,f,c,t,n;l=this.options.attrkey;f=this.options.charkey;if(Object.keys(e).length===1&&this.options.rootName===r["0.2"].rootName){n=Object.keys(e)[0];e=e[n]}else{n=this.options.rootName}c=function(u){return function(e,t){var n,i,r,o,s,a;if(typeof t!=="object"){if(u.options.cdata&&h(t)){e.raw(d(t))}else{e.txt(t)}}else if(Array.isArray(t)){for(o in t){if(!p.call(t,o))continue;i=t[o];for(s in i){r=i[s];e=c(e.ele(s),r).up()}}}else{for(s in t){if(!p.call(t,s))continue;i=t[s];if(s===l){if(typeof i==="object"){for(n in i){a=i[n];e=e.att(n,a)}}}else if(s===f){if(u.options.cdata&&h(i)){e=e.raw(d(i))}else{e=e.txt(i)}}else if(Array.isArray(i)){for(o in i){if(!p.call(i,o))continue;r=i[o];if(typeof r==="string"){if(u.options.cdata&&h(r)){e=e.ele(s).raw(d(r)).up()}else{e=e.ele(s,r).up()}}else{e=c(e.ele(s),r).up()}}}else if(typeof i==="object"){e=c(e.ele(s),i).up()}else{if(typeof i==="string"&&u.options.cdata&&h(i)){e=e.ele(s).raw(d(i)).up()}else{if(i==null){i=""}e=e.ele(s,i.toString()).up()}}}}return e}}(this);t=i.create(n,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars});return c(t,e).end(this.options.renderOpts)};return e}()}).call(this)},function(f,e,c){(function(){var e,t,n,s,r,i,o,a,u,l;l=c(3),a=l.assign,u=l.isFunction;n=c(46);s=c(47);r=c(96);o=c(33);i=c(97);e=c(0);t=c(12);f.exports.create=function(e,t,n,i){var r,o;if(e==null){throw new Error("Root element needs a name.")}i=a({},t,n,i);r=new s(i);o=r.element(e);if(!i.headless){r.declaration(i);if(i.pubID!=null||i.sysID!=null){r.dtd(i)}}return o};f.exports.begin=function(e,t,n){var i;if(u(e)){i=[e,t],t=i[0],n=i[1];e={}}if(t){return new r(e,t,n)}else{return new s(e)}};f.exports.stringWriter=function(e){return new o(e)};f.exports.streamWriter=function(e,t){return new i(e,t)};f.exports.implementation=new n;f.exports.nodeType=e;f.exports.writerState=t}).call(this)},function(i,e,r){(function(){var e,t,n;t=r(92);n=r(93);i.exports=e=function(){function e(){var e;this.defaultParams={"canonical-form":false,"cdata-sections":false,comments:false,"datatype-normalization":false,"element-content-whitespace":true,entities:true,"error-handler":new t,infoset:true,"validate-if-schema":false,namespaces:true,"namespace-declarations":true,"normalize-characters":false,"schema-location":"","schema-type":"","split-cdata-sections":true,validate:false,"well-formed":true};this.params=e=Object.create(this.defaultParams)}Object.defineProperty(e.prototype,"parameterNames",{get:function(){return new n(Object.keys(this.defaultParams))}});e.prototype.getParameter=function(e){if(this.params.hasOwnProperty(e)){return this.params[e]}else{return null}};e.prototype.canSetParameter=function(e,t){return true};e.prototype.setParameter=function(e,t){if(t!=null){return this.params[e]=t}else{return delete this.params[e]}};return e}()}).call(this)},function(t,e){(function(){var e;t.exports=e=function(){function e(){}e.prototype.handleError=function(e){throw new Error(e)};return e}()}).call(this)},function(t,e){(function(){var e;t.exports=e=function(){function e(e){this.arr=e||[]}Object.defineProperty(e.prototype,"length",{get:function(){return this.arr.length}});e.prototype.item=function(e){return this.arr[e]||null};e.prototype.contains=function(e){return this.arr.indexOf(e)!==-1};return e}()}).call(this)},function(t,e){(function(){var e;t.exports=e=function(){function e(e){this.nodes=e}Object.defineProperty(e.prototype,"length",{get:function(){return this.nodes.length||0}});e.prototype.clone=function(){return this.nodes=null};e.prototype.item=function(e){return this.nodes[e]||null};return e}()}).call(this)},function(e,t){(function(){e.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},function(k,e,T){(function(){var l,o,r,n,i,s,a,u,f,c,h,d,e,p,v,m,y,g,P,w,S,_,b,t,C={}.hasOwnProperty;t=T(3),_=t.isObject,S=t.isFunction,b=t.isPlainObject,w=t.getValue;l=T(0);d=T(47);p=T(20);n=T(22);i=T(23);m=T(30);P=T(31);v=T(32);c=T(24);h=T(25);s=T(26);u=T(27);a=T(28);f=T(29);r=T(48);g=T(50);y=T(33);o=T(12);k.exports=e=function(){function e(e,t,n){var i;this.name="?xml";this.type=l.Document;e||(e={});i={};if(!e.writer){e.writer=new y}else if(b(e.writer)){i=e.writer;e.writer=new y}this.options=e;this.writer=e.writer;this.writerOptions=this.writer.filterOptions(i);this.stringify=new g(e);this.onDataCallback=t||function(){};this.onEndCallback=n||function(){};this.currentNode=null;this.currentLevel=-1;this.openTags={};this.documentStarted=false;this.documentCompleted=false;this.root=null}e.prototype.createChildNode=function(e){var t,n,i,r,o,s,a,u;switch(e.type){case l.CData:this.cdata(e.value);break;case l.Comment:this.comment(e.value);break;case l.Element:i={};a=e.attribs;for(n in a){if(!C.call(a,n))continue;t=a[n];i[n]=t.value}this.node(e.name,i);break;case l.Dummy:this.dummy();break;case l.Raw:this.raw(e.value);break;case l.Text:this.text(e.value);break;case l.ProcessingInstruction:this.instruction(e.target,e.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+e.constructor.name)}u=e.children;for(o=0,s=u.length;o<s;o++){r=u[o];this.createChildNode(r);if(r.type===l.Element){this.up()}}return this};e.prototype.dummy=function(){return this};e.prototype.node=function(e,t,n){var i;if(e==null){throw new Error("Missing node name.")}if(this.root&&this.currentLevel===-1){throw new Error("Document can only have one root node. "+this.debugInfo(e))}this.openCurrent();e=w(e);if(t==null){t={}}t=w(t);if(!_(t)){i=[t,n],n=i[0],t=i[1]}this.currentNode=new p(this,e,t);this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;if(n!=null){this.text(n)}return this};e.prototype.element=function(e,t,n){var i,r,o,s,a,u;if(this.currentNode&&this.currentNode.type===l.DocType){this.dtdElement.apply(this,arguments)}else{if(Array.isArray(e)||_(e)||S(e)){s=this.options.noValidation;this.options.noValidation=true;u=new d(this.options).element("TEMP_ROOT");u.element(e);this.options.noValidation=s;a=u.children;for(r=0,o=a.length;r<o;r++){i=a[r];this.createChildNode(i);if(i.type===l.Element){this.up()}}}else{this.node(e,t,n)}}return this};e.prototype.attribute=function(e,t){var n,i;if(!this.currentNode||this.currentNode.children){throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(e))}if(e!=null){e=w(e)}if(_(e)){for(n in e){if(!C.call(e,n))continue;i=e[n];this.attribute(n,i)}}else{if(S(t)){t=t.apply()}if(this.options.keepNullAttributes&&t==null){this.currentNode.attribs[e]=new r(this,e,"")}else if(t!=null){this.currentNode.attribs[e]=new r(this,e,t)}}return this};e.prototype.text=function(e){var t;this.openCurrent();t=new P(this,e);this.onData(this.writer.text(t,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};e.prototype.cdata=function(e){var t;this.openCurrent();t=new n(this,e);this.onData(this.writer.cdata(t,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};e.prototype.comment=function(e){var t;this.openCurrent();t=new i(this,e);this.onData(this.writer.comment(t,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};e.prototype.raw=function(e){var t;this.openCurrent();t=new m(this,e);this.onData(this.writer.raw(t,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};e.prototype.instruction=function(e,t){var n,i,r,o,s;this.openCurrent();if(e!=null){e=w(e)}if(t!=null){t=w(t)}if(Array.isArray(e)){for(n=0,o=e.length;n<o;n++){i=e[n];this.instruction(i)}}else if(_(e)){for(i in e){if(!C.call(e,i))continue;r=e[i];this.instruction(i,r)}}else{if(S(t)){t=t.apply()}s=new v(this,e,t);this.onData(this.writer.processingInstruction(s,this.writerOptions,this.currentLevel+1),this.currentLevel+1)}return this};e.prototype.declaration=function(e,t,n){var i;this.openCurrent();if(this.documentStarted){throw new Error("declaration() must be the first node.")}i=new c(this,e,t,n);this.onData(this.writer.declaration(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};e.prototype.doctype=function(e,t,n){this.openCurrent();if(e==null){throw new Error("Missing root node name.")}if(this.root){throw new Error("dtd() must come before the root node.")}this.currentNode=new h(this,t,n);this.currentNode.rootNodeName=e;this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;return this};e.prototype.dtdElement=function(e,t){var n;this.openCurrent();n=new a(this,e,t);this.onData(this.writer.dtdElement(n,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};e.prototype.attList=function(e,t,n,i,r){var o;this.openCurrent();o=new s(this,e,t,n,i,r);this.onData(this.writer.dtdAttList(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};e.prototype.entity=function(e,t){var n;this.openCurrent();n=new u(this,false,e,t);this.onData(this.writer.dtdEntity(n,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};e.prototype.pEntity=function(e,t){var n;this.openCurrent();n=new u(this,true,e,t);this.onData(this.writer.dtdEntity(n,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};e.prototype.notation=function(e,t){var n;this.openCurrent();n=new f(this,e,t);this.onData(this.writer.dtdNotation(n,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};e.prototype.up=function(){if(this.currentLevel<0){throw new Error("The document node has no parent.")}if(this.currentNode){if(this.currentNode.children){this.closeNode(this.currentNode)}else{this.openNode(this.currentNode)}this.currentNode=null}else{this.closeNode(this.openTags[this.currentLevel])}delete this.openTags[this.currentLevel];this.currentLevel--;return this};e.prototype.end=function(){while(this.currentLevel>=0){this.up()}return this.onEnd()};e.prototype.openCurrent=function(){if(this.currentNode){this.currentNode.children=true;return this.openNode(this.currentNode)}};e.prototype.openNode=function(e){var t,n,i,r;if(!e.isOpen){if(!this.root&&this.currentLevel===0&&e.type===l.Element){this.root=e}n="";if(e.type===l.Element){this.writerOptions.state=o.OpenTag;n=this.writer.indent(e,this.writerOptions,this.currentLevel)+"<"+e.name;r=e.attribs;for(i in r){if(!C.call(r,i))continue;t=r[i];n+=this.writer.attribute(t,this.writerOptions,this.currentLevel)}n+=(e.children?">":"/>")+this.writer.endline(e,this.writerOptions,this.currentLevel);this.writerOptions.state=o.InsideTag}else{this.writerOptions.state=o.OpenTag;n=this.writer.indent(e,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+e.rootNodeName;if(e.pubID&&e.sysID){n+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'}else if(e.sysID){n+=' SYSTEM "'+e.sysID+'"'}if(e.children){n+=" [";this.writerOptions.state=o.InsideTag}else{this.writerOptions.state=o.CloseTag;n+=">"}n+=this.writer.endline(e,this.writerOptions,this.currentLevel)}this.onData(n,this.currentLevel);return e.isOpen=true}};e.prototype.closeNode=function(e){var t;if(!e.isClosed){t="";this.writerOptions.state=o.CloseTag;if(e.type===l.Element){t=this.writer.indent(e,this.writerOptions,this.currentLevel)+"</"+e.name+">"+this.writer.endline(e,this.writerOptions,this.currentLevel)}else{t=this.writer.indent(e,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(e,this.writerOptions,this.currentLevel)}this.writerOptions.state=o.None;this.onData(t,this.currentLevel);return e.isClosed=true}};e.prototype.onData=function(e,t){this.documentStarted=true;return this.onDataCallback(e,t+1)};e.prototype.onEnd=function(){this.documentCompleted=true;return this.onEndCallback()};e.prototype.debugInfo=function(e){if(e==null){return""}else{return"node: <"+e+">"}};e.prototype.ele=function(){return this.element.apply(this,arguments)};e.prototype.nod=function(e,t,n){return this.node(e,t,n)};e.prototype.txt=function(e){return this.text(e)};e.prototype.dat=function(e){return this.cdata(e)};e.prototype.com=function(e){return this.comment(e)};e.prototype.ins=function(e,t){return this.instruction(e,t)};e.prototype.dec=function(e,t,n){return this.declaration(e,t,n)};e.prototype.dtd=function(e,t,n){return this.doctype(e,t,n)};e.prototype.e=function(e,t,n){return this.element(e,t,n)};e.prototype.n=function(e,t,n){return this.node(e,t,n)};e.prototype.t=function(e){return this.text(e)};e.prototype.d=function(e){return this.cdata(e)};e.prototype.c=function(e){return this.comment(e)};e.prototype.r=function(e){return this.raw(e)};e.prototype.i=function(e,t){return this.instruction(e,t)};e.prototype.att=function(){if(this.currentNode&&this.currentNode.type===l.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};e.prototype.a=function(){if(this.currentNode&&this.currentNode.type===l.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};e.prototype.ent=function(e,t){return this.entity(e,t)};e.prototype.pent=function(e,t){return this.pEntity(e,t)};e.prototype.not=function(e,t){return this.notation(e,t)};return e}()}).call(this)},function(i,e,r){(function(){var d,p,e,t,n=function(e,t){for(var n in t){if(v.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},v={}.hasOwnProperty;d=r(0);t=r(51);p=r(12);i.exports=e=function(e){n(i,e);function i(e,t){this.stream=e;i.__super__.constructor.call(this,t)}i.prototype.endline=function(e,t,n){if(e.isLastRootNode&&t.state===p.CloseTag){return""}else{return i.__super__.endline.call(this,e,t,n)}};i.prototype.document=function(e,t){var n,i,r,o,s,a,u,l,f;u=e.children;for(i=r=0,s=u.length;r<s;i=++r){n=u[i];n.isLastRootNode=i===e.children.length-1}t=this.filterOptions(t);l=e.children;f=[];for(o=0,a=l.length;o<a;o++){n=l[o];f.push(this.writeChildNode(n,t,0))}return f};i.prototype.attribute=function(e,t,n){return this.stream.write(i.__super__.attribute.call(this,e,t,n))};i.prototype.cdata=function(e,t,n){return this.stream.write(i.__super__.cdata.call(this,e,t,n))};i.prototype.comment=function(e,t,n){return this.stream.write(i.__super__.comment.call(this,e,t,n))};i.prototype.declaration=function(e,t,n){return this.stream.write(i.__super__.declaration.call(this,e,t,n))};i.prototype.docType=function(e,t,n){var i,r,o,s;n||(n=0);this.openNode(e,t,n);t.state=p.OpenTag;this.stream.write(this.indent(e,t,n));this.stream.write("<!DOCTYPE "+e.root().name);if(e.pubID&&e.sysID){this.stream.write(' PUBLIC "'+e.pubID+'" "'+e.sysID+'"')}else if(e.sysID){this.stream.write(' SYSTEM "'+e.sysID+'"')}if(e.children.length>0){this.stream.write(" [");this.stream.write(this.endline(e,t,n));t.state=p.InsideTag;s=e.children;for(r=0,o=s.length;r<o;r++){i=s[r];this.writeChildNode(i,t,n+1)}t.state=p.CloseTag;this.stream.write("]")}t.state=p.CloseTag;this.stream.write(t.spaceBeforeSlash+">");this.stream.write(this.endline(e,t,n));t.state=p.None;return this.closeNode(e,t,n)};i.prototype.element=function(e,t,n){var i,r,o,s,a,u,l,f,c,h;n||(n=0);this.openNode(e,t,n);t.state=p.OpenTag;this.stream.write(this.indent(e,t,n)+"<"+e.name);c=e.attribs;for(l in c){if(!v.call(c,l))continue;i=c[l];this.attribute(i,t,n)}o=e.children.length;s=o===0?null:e.children[0];if(o===0||e.children.every(function(e){return(e.type===d.Text||e.type===d.Raw)&&e.value===""})){if(t.allowEmpty){this.stream.write(">");t.state=p.CloseTag;this.stream.write("</"+e.name+">")}else{t.state=p.CloseTag;this.stream.write(t.spaceBeforeSlash+"/>")}}else if(t.pretty&&o===1&&(s.type===d.Text||s.type===d.Raw)&&s.value!=null){this.stream.write(">");t.state=p.InsideTag;t.suppressPrettyCount++;f=true;this.writeChildNode(s,t,n+1);t.suppressPrettyCount--;f=false;t.state=p.CloseTag;this.stream.write("</"+e.name+">")}else{this.stream.write(">"+this.endline(e,t,n));t.state=p.InsideTag;h=e.children;for(a=0,u=h.length;a<u;a++){r=h[a];this.writeChildNode(r,t,n+1)}t.state=p.CloseTag;this.stream.write(this.indent(e,t,n)+"</"+e.name+">")}this.stream.write(this.endline(e,t,n));t.state=p.None;return this.closeNode(e,t,n)};i.prototype.processingInstruction=function(e,t,n){return this.stream.write(i.__super__.processingInstruction.call(this,e,t,n))};i.prototype.raw=function(e,t,n){return this.stream.write(i.__super__.raw.call(this,e,t,n))};i.prototype.text=function(e,t,n){return this.stream.write(i.__super__.text.call(this,e,t,n))};i.prototype.dtdAttList=function(e,t,n){return this.stream.write(i.__super__.dtdAttList.call(this,e,t,n))};i.prototype.dtdElement=function(e,t,n){return this.stream.write(i.__super__.dtdElement.call(this,e,t,n))};i.prototype.dtdEntity=function(e,t,n){return this.stream.write(i.__super__.dtdEntity.call(this,e,t,n))};i.prototype.dtdNotation=function(e,t,n){return this.stream.write(i.__super__.dtdNotation.call(this,e,t,n))};return i}(t)}).call(this)},function(e,l,t){(function(){"use strict";var r,o,e,d,p,s,i,a,u=function(e,t){return function(){return e.apply(t,arguments)}},n=function(e,t){for(var n in t){if(v.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},v={}.hasOwnProperty;i=t(99);e=t(13);r=t(113);s=t(58);a=t(56).setImmediate;o=t(19).defaults;d=function(e){return typeof e==="object"&&e!=null&&Object.keys(e).length===0};p=function(e,t,n){var i,r,o;for(i=0,r=e.length;i<r;i++){o=e[i];t=o(t,n)}return t};l.Parser=function(e){n(t,e);function t(e){this.parseStringPromise=u(this.parseStringPromise,this);this.parseString=u(this.parseString,this);this.reset=u(this.reset,this);this.assignOrPush=u(this.assignOrPush,this);this.processAsync=u(this.processAsync,this);var t,n,i;if(!(this instanceof l.Parser)){return new l.Parser(e)}this.options={};n=o["0.2"];for(t in n){if(!v.call(n,t))continue;i=n[t];this.options[t]=i}for(t in e){if(!v.call(e,t))continue;i=e[t];this.options[t]=i}if(this.options.xmlns){this.options.xmlnskey=this.options.attrkey+"ns"}if(this.options.normalizeTags){if(!this.options.tagNameProcessors){this.options.tagNameProcessors=[]}this.options.tagNameProcessors.unshift(s.normalize)}this.reset()}t.prototype.processAsync=function(){var e,t;try{if(this.remaining.length<=this.options.chunkSize){e=this.remaining;this.remaining="";this.saxParser=this.saxParser.write(e);return this.saxParser.close()}else{e=this.remaining.substr(0,this.options.chunkSize);this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length);this.saxParser=this.saxParser.write(e);return a(this.processAsync)}}catch(n){t=n;if(!this.saxParser.errThrown){this.saxParser.errThrown=true;return this.emit(t)}}};t.prototype.assignOrPush=function(e,t,n){if(!(t in e)){if(!this.options.explicitArray){return e[t]=n}else{return e[t]=[n]}}else{if(!(e[t]instanceof Array)){e[t]=[e[t]]}return e[t].push(n)}};t.prototype.reset=function(){var a,c,n,h;this.removeAllListeners();this.saxParser=i.parser(this.options.strict,{trim:false,normalize:false,xmlns:this.options.xmlns});this.saxParser.errThrown=false;this.saxParser.onerror=function(t){return function(e){t.saxParser.resume();if(!t.saxParser.errThrown){t.saxParser.errThrown=true;return t.emit("error",e)}}}(this);this.saxParser.onend=function(e){return function(){if(!e.saxParser.ended){e.saxParser.ended=true;return e.emit("end",e.resultObject)}}}(this);this.saxParser.ended=false;this.EXPLICIT_CHARKEY=this.options.explicitCharkey;this.resultObject=null;h=[];a=this.options.attrkey;c=this.options.charkey;this.saxParser.onopentag=function(s){return function(e){var t,n,i,r,o;i={};i[c]="";if(!s.options.ignoreAttrs){o=e.attributes;for(t in o){if(!v.call(o,t))continue;if(!(a in i)&&!s.options.mergeAttrs){i[a]={}}n=s.options.attrValueProcessors?p(s.options.attrValueProcessors,e.attributes[t],t):e.attributes[t];r=s.options.attrNameProcessors?p(s.options.attrNameProcessors,t):t;if(s.options.mergeAttrs){s.assignOrPush(i,r,n)}else{i[a][r]=n}}}i["#name"]=s.options.tagNameProcessors?p(s.options.tagNameProcessors,e.name):e.name;if(s.options.xmlns){i[s.options.xmlnskey]={uri:e.uri,local:e.local}}return h.push(i)}}(this);this.saxParser.onclosetag=function(f){return function(){var e,t,n,i,r,o,s,a,u,l;o=h.pop();r=o["#name"];if(!f.options.explicitChildren||!f.options.preserveChildrenOrder){delete o["#name"]}if(o.cdata===true){e=o.cdata;delete o.cdata}u=h[h.length-1];if(o[c].match(/^\s*$/)&&!e){t=o[c];delete o[c]}else{if(f.options.trim){o[c]=o[c].trim()}if(f.options.normalize){o[c]=o[c].replace(/\s{2,}/g," ").trim()}o[c]=f.options.valueProcessors?p(f.options.valueProcessors,o[c],r):o[c];if(Object.keys(o).length===1&&c in o&&!f.EXPLICIT_CHARKEY){o=o[c]}}if(d(o)){o=f.options.emptyTag!==""?f.options.emptyTag:t}if(f.options.validator!=null){l="/"+function(){var e,t,n;n=[];for(e=0,t=h.length;e<t;e++){i=h[e];n.push(i["#name"])}return n}().concat(r).join("/");(function(){var e;try{return o=f.options.validator(l,u&&u[r],o)}catch(t){e=t;return f.emit("error",e)}})()}if(f.options.explicitChildren&&!f.options.mergeAttrs&&typeof o==="object"){if(!f.options.preserveChildrenOrder){i={};if(f.options.attrkey in o){i[f.options.attrkey]=o[f.options.attrkey];delete o[f.options.attrkey]}if(!f.options.charsAsChildren&&f.options.charkey in o){i[f.options.charkey]=o[f.options.charkey];delete o[f.options.charkey]}if(Object.getOwnPropertyNames(o).length>0){i[f.options.childkey]=o}o=i}else if(u){u[f.options.childkey]=u[f.options.childkey]||[];s={};for(n in o){if(!v.call(o,n))continue;s[n]=o[n]}u[f.options.childkey].push(s);delete o["#name"];if(Object.keys(o).length===1&&c in o&&!f.EXPLICIT_CHARKEY){o=o[c]}}}if(h.length>0){return f.assignOrPush(u,r,o)}else{if(f.options.explicitRoot){a=o;o={};o[r]=a}f.resultObject=o;f.saxParser.ended=true;return f.emit("end",f.resultObject)}}}(this);n=function(i){return function(e){var t,n;n=h[h.length-1];if(n){n[c]+=e;if(i.options.explicitChildren&&i.options.preserveChildrenOrder&&i.options.charsAsChildren&&(i.options.includeWhiteChars||e.replace(/\\n/g,"").trim()!=="")){n[i.options.childkey]=n[i.options.childkey]||[];t={"#name":"__text__"};t[c]=e;if(i.options.normalize){t[c]=t[c].replace(/\s{2,}/g," ").trim()}n[i.options.childkey].push(t)}return n}}}(this);this.saxParser.ontext=n;return this.saxParser.oncdata=function(e){return function(e){var t;t=n(e);if(t){return t.cdata=true}}}(this)};t.prototype.parseString=function(e,t){var n;if(t!=null&&typeof t==="function"){this.on("end",function(e){this.reset();return t(null,e)});this.on("error",function(e){this.reset();return t(e)})}try{e=e.toString();if(e.trim()===""){this.emit("end",null);return true}e=r.stripBOM(e);if(this.options["async"]){this.remaining=e;a(this.processAsync);return this.saxParser}return this.saxParser.write(e).close()}catch(i){n=i;if(!(this.saxParser.errThrown||this.saxParser.ended)){this.emit("error",n);return this.saxParser.errThrown=true}else if(this.saxParser.ended){throw n}}};t.prototype.parseStringPromise=function(t){return new Promise(function(e){return function(n,i){return e.parseString(t,function(e,t){if(e){return i(e)}else{return n(t)}})}}(this))};return t}(e);l.parseString=function(e,t,n){var i,r,o;if(n!=null){if(typeof n==="function"){i=n}if(typeof t==="object"){r=t}}else{if(typeof t==="function"){i=t}r={}}o=new l.Parser(r);return o.parseString(e,i)};l.parseStringPromise=function(e,t){var n,i;if(typeof t==="object"){n=t}i=new l.Parser(n);return i.parseStringPromise(e)}}).call(this)},function(e,t,U){(function(H){(function(a){a.parser=function(e,t){return new i(e,t)};a.SAXParser=i;a.SAXStream=f;a.createStream=t;a.MAX_BUFFER_LENGTH=64*1024;var u=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];a.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function i(e,t){if(!(this instanceof i)){return new i(e,t)}var n=this;r(n);n.q=n.c="";n.bufferCheckPosition=a.MAX_BUFFER_LENGTH;n.opt=t||{};n.opt.lowercase=n.opt.lowercase||n.opt.lowercasetags;n.looseCase=n.opt.lowercase?"toLowerCase":"toUpperCase";n.tags=[];n.closed=n.closedRoot=n.sawRoot=false;n.tag=n.error=null;n.strict=!!e;n.noscript=!!(e||n.opt.noscript);n.state=S.BEGIN;n.strictEntities=n.opt.strictEntities;n.ENTITIES=n.strictEntities?Object.create(a.XML_ENTITIES):Object.create(a.ENTITIES);n.attribList=[];if(n.opt.xmlns){n.ns=Object.create(v)}n.trackPosition=n.opt.position!==false;if(n.trackPosition){n.position=n.line=n.column=0}_(n,"onready")}if(!Object.create){Object.create=function(e){function t(){}t.prototype=e;var n=new t;return n}}if(!Object.keys){Object.keys=function(e){var t=[];for(var n in e)if(e.hasOwnProperty(n))t.push(n);return t}}function l(e){var t=Math.max(a.MAX_BUFFER_LENGTH,10);var n=0;for(var i=0,r=u.length;i<r;i++){var o=e[u[i]].length;if(o>t){switch(u[i]){case"textNode":C(e);break;case"cdata":b(e,"oncdata",e.cdata);e.cdata="";break;case"script":b(e,"onscript",e.script);e.script="";break;default:T(e,"Max buffer length exceeded: "+u[i])}}n=Math.max(n,o)}var s=a.MAX_BUFFER_LENGTH-n;e.bufferCheckPosition=s+e.position}function r(e){for(var t=0,n=u.length;t<n;t++){e[u[t]]=""}}function e(e){C(e);if(e.cdata!==""){b(e,"oncdata",e.cdata);e.cdata=""}if(e.script!==""){b(e,"onscript",e.script);e.script=""}}i.prototype={end:function(){R(this)},write:J,resume:function(){this.error=null;return this},close:function(){return this.write(null)},flush:function(){e(this)}};var o;try{o=U(102).Stream}catch(M){o=function(){}}var s=a.EVENTS.filter(function(e){return e!=="error"&&e!=="end"});function t(e,t){return new f(e,t)}function f(e,t){if(!(this instanceof f)){return new f(e,t)}o.apply(this);this._parser=new i(e,t);this.writable=true;this.readable=true;var n=this;this._parser.onend=function(){n.emit("end")};this._parser.onerror=function(e){n.emit("error",e);n._parser.error=null};this._decoder=null;s.forEach(function(t){Object.defineProperty(n,"on"+t,{get:function(){return n._parser["on"+t]},set:function(e){if(!e){n.removeAllListeners(t);n._parser["on"+t]=e;return e}n.on(t,e)},enumerable:true,configurable:false})})}f.prototype=Object.create(o.prototype,{constructor:{value:f}});f.prototype.write=function(e){if(typeof H==="function"&&typeof H.isBuffer==="function"&&H.isBuffer(e)){if(!this._decoder){var t=U(37).StringDecoder;this._decoder=new t("utf8")}e=this._decoder.write(e)}this._parser.write(e.toString());this.emit("data",e);return true};f.prototype.end=function(e){if(e&&e.length){this.write(e)}this._parser.end();return true};f.prototype.on=function(t,e){var n=this;if(!n._parser["on"+t]&&s.indexOf(t)!==-1){n._parser["on"+t]=function(){var e=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);e.splice(0,0,t);n.emit.apply(n,e)}}return o.prototype.on.call(n,t,e)};var c="[CDATA[";var h="DOCTYPE";var d="http://www.w3.org/XML/1998/namespace";var p="http://www.w3.org/2000/xmlns/";var v={xml:d,xmlns:p};var m=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;var y=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;var L=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;var F=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function g(e){return e===" "||e==="\n"||e==="\r"||e==="\t"}function P(e){return e==='"'||e==="'"}function W(e){return e===">"||g(e)}function w(e,t){return e.test(t)}function N(e,t){return!w(e,t)}var S=0;a.STATE={BEGIN:S++,BEGIN_WHITESPACE:S++,TEXT:S++,TEXT_ENTITY:S++,OPEN_WAKA:S++,SGML_DECL:S++,SGML_DECL_QUOTED:S++,DOCTYPE:S++,DOCTYPE_QUOTED:S++,DOCTYPE_DTD:S++,DOCTYPE_DTD_QUOTED:S++,COMMENT_STARTING:S++,COMMENT:S++,COMMENT_ENDING:S++,COMMENT_ENDED:S++,CDATA:S++,CDATA_ENDING:S++,CDATA_ENDING_2:S++,PROC_INST:S++,PROC_INST_BODY:S++,PROC_INST_ENDING:S++,OPEN_TAG:S++,OPEN_TAG_SLASH:S++,ATTRIB:S++,ATTRIB_NAME:S++,ATTRIB_NAME_SAW_WHITE:S++,ATTRIB_VALUE:S++,ATTRIB_VALUE_QUOTED:S++,ATTRIB_VALUE_CLOSED:S++,ATTRIB_VALUE_UNQUOTED:S++,ATTRIB_VALUE_ENTITY_Q:S++,ATTRIB_VALUE_ENTITY_U:S++,CLOSE_TAG:S++,CLOSE_TAG_SAW_WHITE:S++,SCRIPT:S++,SCRIPT_ENDING:S++};a.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"};a.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,"int":8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830};Object.keys(a.ENTITIES).forEach(function(e){var t=a.ENTITIES[e];var n=typeof t==="number"?String.fromCharCode(t):t;a.ENTITIES[e]=n});for(var n in a.STATE){a.STATE[a.STATE[n]]=n}S=a.STATE;function _(e,t,n){e[t]&&e[t](n)}function b(e,t,n){if(e.textNode)C(e);_(e,t,n)}function C(e){e.textNode=k(e.opt,e.textNode);if(e.textNode)_(e,"ontext",e.textNode);e.textNode=""}function k(e,t){if(e.trim)t=t.trim();if(e.normalize)t=t.replace(/\s+/g," ");return t}function T(e,t){C(e);if(e.trackPosition){t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c}t=new Error(t);e.error=t;_(e,"onerror",t);return e}function R(e){if(e.sawRoot&&!e.closedRoot)D(e,"Unclosed root tag");if(e.state!==S.BEGIN&&e.state!==S.BEGIN_WHITESPACE&&e.state!==S.TEXT){T(e,"Unexpected end")}C(e);e.c="";e.closed=true;_(e,"onend");i.call(e,e.strict,e.opt);return e}function D(e,t){if(typeof e!=="object"||!(e instanceof i)){throw new Error("bad call to strictFail")}if(e.strict){T(e,t)}}function B(e){if(!e.strict)e.tagName=e.tagName[e.looseCase]();var t=e.tags[e.tags.length-1]||e;var n=e.tag={name:e.tagName,attributes:{}};if(e.opt.xmlns){n.ns=t.ns}e.attribList.length=0;b(e,"onopentagstart",n)}function x(e,t){var n=e.indexOf(":");var i=n<0?["",e]:e.split(":");var r=i[0];var o=i[1];if(t&&e==="xmlns"){r="xmlns";o=""}return{prefix:r,local:o}}function I(e){if(!e.strict){e.attribName=e.attribName[e.looseCase]()}if(e.attribList.indexOf(e.attribName)!==-1||e.tag.attributes.hasOwnProperty(e.attribName)){e.attribName=e.attribValue="";return}if(e.opt.xmlns){var t=x(e.attribName,true);var n=t.prefix;var i=t.local;if(n==="xmlns"){if(i==="xml"&&e.attribValue!==d){D(e,"xml: prefix must be bound to "+d+"\n"+"Actual: "+e.attribValue)}else if(i==="xmlns"&&e.attribValue!==p){D(e,"xmlns: prefix must be bound to "+p+"\n"+"Actual: "+e.attribValue)}else{var r=e.tag;var o=e.tags[e.tags.length-1]||e;if(r.ns===o.ns){r.ns=Object.create(o.ns)}r.ns[i]=e.attribValue}}e.attribList.push([e.attribName,e.attribValue])}else{e.tag.attributes[e.attribName]=e.attribValue;b(e,"onattribute",{name:e.attribName,value:e.attribValue})}e.attribName=e.attribValue=""}function E(t,e){if(t.opt.xmlns){var n=t.tag;var i=x(t.tagName);n.prefix=i.prefix;n.local=i.local;n.uri=n.ns[i.prefix]||"";if(n.prefix&&!n.uri){D(t,"Unbound namespace prefix: "+JSON.stringify(t.tagName));n.uri=i.prefix}var r=t.tags[t.tags.length-1]||t;if(n.ns&&r.ns!==n.ns){Object.keys(n.ns).forEach(function(e){b(t,"onopennamespace",{prefix:e,uri:n.ns[e]})})}for(var o=0,s=t.attribList.length;o<s;o++){var a=t.attribList[o];var u=a[0];var l=a[1];var f=x(u,true);var c=f.prefix;var h=f.local;var d=c===""?"":n.ns[c]||"";var p={name:u,value:l,prefix:c,local:h,uri:d};if(c&&c!=="xmlns"&&!d){D(t,"Unbound namespace prefix: "+JSON.stringify(c));p.uri=c}t.tag.attributes[u]=p;b(t,"onattribute",p)}t.attribList.length=0}t.tag.isSelfClosing=!!e;t.sawRoot=true;t.tags.push(t.tag);b(t,"onopentag",t.tag);if(!e){if(!t.noscript&&t.tagName.toLowerCase()==="script"){t.state=S.SCRIPT}else{t.state=S.TEXT}t.tag=null;t.tagName=""}t.attribName=t.attribValue="";t.attribList.length=0}function q(n){if(!n.tagName){D(n,"Weird empty close tag.");n.textNode+="</>";n.state=S.TEXT;return}if(n.script){if(n.tagName!=="script"){n.script+="</"+n.tagName+">";n.tagName="";n.state=S.SCRIPT;return}b(n,"onscript",n.script);n.script=""}var e=n.tags.length;var t=n.tagName;if(!n.strict){t=t[n.looseCase]()}var i=t;while(e--){var r=n.tags[e];if(r.name!==i){D(n,"Unexpected close tag")}else{break}}if(e<0){D(n,"Unmatched closing tag: "+n.tagName);n.textNode+="</"+n.tagName+">";n.state=S.TEXT;return}n.tagName=t;var o=n.tags.length;while(o-- >e){var s=n.tag=n.tags.pop();n.tagName=n.tag.name;b(n,"onclosetag",n.tagName);var a={};for(var u in s.ns){a[u]=s.ns[u]}var l=n.tags[n.tags.length-1]||n;if(n.opt.xmlns&&s.ns!==l.ns){Object.keys(s.ns).forEach(function(e){var t=s.ns[e];b(n,"onclosenamespace",{prefix:e,uri:t})})}}if(e===0)n.closedRoot=true;n.tagName=n.attribValue=n.attribName="";n.attribList.length=0;n.state=S.TEXT}function z(e){var t=e.entity;var n=t.toLowerCase();var i;var r="";if(e.ENTITIES[t]){return e.ENTITIES[t]}if(e.ENTITIES[n]){return e.ENTITIES[n]}t=n;if(t.charAt(0)==="#"){if(t.charAt(1)==="x"){t=t.slice(2);i=parseInt(t,16);r=i.toString(16)}else{t=t.slice(1);i=parseInt(t,10);r=i.toString(10)}}t=t.replace(/^0+/,"");if(isNaN(i)||r.toLowerCase()!==t){D(e,"Invalid character entity");return"&"+e.entity+";"}return String.fromCodePoint(i)}function A(e,t){if(t==="<"){e.state=S.OPEN_WAKA;e.startTagPosition=e.position}else if(!g(t)){D(e,"Non-whitespace before first tag.");e.textNode=t;e.state=S.TEXT}}function O(e,t){var n="";if(t<e.length){n=e.charAt(t)}return n}function J(e){var t=this;if(this.error){throw this.error}if(t.closed){return T(t,"Cannot write after close. Assign an onready handler.")}if(e===null){return R(t)}if(typeof e==="object"){e=e.toString()}var n=0;var i="";while(true){i=O(e,n++);t.c=i;if(!i){break}if(t.trackPosition){t.position++;if(i==="\n"){t.line++;t.column=0}else{t.column++}}switch(t.state){case S.BEGIN:t.state=S.BEGIN_WHITESPACE;if(i==="\ufeff"){continue}A(t,i);continue;case S.BEGIN_WHITESPACE:A(t,i);continue;case S.TEXT:if(t.sawRoot&&!t.closedRoot){var r=n-1;while(i&&i!=="<"&&i!=="&"){i=O(e,n++);if(i&&t.trackPosition){t.position++;if(i==="\n"){t.line++;t.column=0}else{t.column++}}}t.textNode+=e.substring(r,n-1)}if(i==="<"&&!(t.sawRoot&&t.closedRoot&&!t.strict)){t.state=S.OPEN_WAKA;t.startTagPosition=t.position}else{if(!g(i)&&(!t.sawRoot||t.closedRoot)){D(t,"Text data outside of root node.")}if(i==="&"){t.state=S.TEXT_ENTITY}else{t.textNode+=i}}continue;case S.SCRIPT:if(i==="<"){t.state=S.SCRIPT_ENDING}else{t.script+=i}continue;case S.SCRIPT_ENDING:if(i==="/"){t.state=S.CLOSE_TAG}else{t.script+="<"+i;t.state=S.SCRIPT}continue;case S.OPEN_WAKA:if(i==="!"){t.state=S.SGML_DECL;t.sgmlDecl=""}else if(g(i)){}else if(w(m,i)){t.state=S.OPEN_TAG;t.tagName=i}else if(i==="/"){t.state=S.CLOSE_TAG;t.tagName=""}else if(i==="?"){t.state=S.PROC_INST;t.procInstName=t.procInstBody=""}else{D(t,"Unencoded <");if(t.startTagPosition+1<t.position){var o=t.position-t.startTagPosition;i=new Array(o).join(" ")+i}t.textNode+="<"+i;t.state=S.TEXT}continue;case S.SGML_DECL:if((t.sgmlDecl+i).toUpperCase()===c){b(t,"onopencdata");t.state=S.CDATA;t.sgmlDecl="";t.cdata=""}else if(t.sgmlDecl+i==="--"){t.state=S.COMMENT;t.comment="";t.sgmlDecl=""}else if((t.sgmlDecl+i).toUpperCase()===h){t.state=S.DOCTYPE;if(t.doctype||t.sawRoot){D(t,"Inappropriately located doctype declaration")}t.doctype="";t.sgmlDecl=""}else if(i===">"){b(t,"onsgmldeclaration",t.sgmlDecl);t.sgmlDecl="";t.state=S.TEXT}else if(P(i)){t.state=S.SGML_DECL_QUOTED;t.sgmlDecl+=i}else{t.sgmlDecl+=i}continue;case S.SGML_DECL_QUOTED:if(i===t.q){t.state=S.SGML_DECL;t.q=""}t.sgmlDecl+=i;continue;case S.DOCTYPE:if(i===">"){t.state=S.TEXT;b(t,"ondoctype",t.doctype);t.doctype=true}else{t.doctype+=i;if(i==="["){t.state=S.DOCTYPE_DTD}else if(P(i)){t.state=S.DOCTYPE_QUOTED;t.q=i}}continue;case S.DOCTYPE_QUOTED:t.doctype+=i;if(i===t.q){t.q="";t.state=S.DOCTYPE}continue;case S.DOCTYPE_DTD:t.doctype+=i;if(i==="]"){t.state=S.DOCTYPE}else if(P(i)){t.state=S.DOCTYPE_DTD_QUOTED;t.q=i}continue;case S.DOCTYPE_DTD_QUOTED:t.doctype+=i;if(i===t.q){t.state=S.DOCTYPE_DTD;t.q=""}continue;case S.COMMENT:if(i==="-"){t.state=S.COMMENT_ENDING}else{t.comment+=i}continue;case S.COMMENT_ENDING:if(i==="-"){t.state=S.COMMENT_ENDED;t.comment=k(t.opt,t.comment);if(t.comment){b(t,"oncomment",t.comment)}t.comment=""}else{t.comment+="-"+i;t.state=S.COMMENT}continue;case S.COMMENT_ENDED:if(i!==">"){D(t,"Malformed comment");t.comment+="--"+i;t.state=S.COMMENT}else{t.state=S.TEXT}continue;case S.CDATA:if(i==="]"){t.state=S.CDATA_ENDING}else{t.cdata+=i}continue;case S.CDATA_ENDING:if(i==="]"){t.state=S.CDATA_ENDING_2}else{t.cdata+="]"+i;t.state=S.CDATA}continue;case S.CDATA_ENDING_2:if(i===">"){if(t.cdata){b(t,"oncdata",t.cdata)}b(t,"onclosecdata");t.cdata="";t.state=S.TEXT}else if(i==="]"){t.cdata+="]"}else{t.cdata+="]]"+i;t.state=S.CDATA}continue;case S.PROC_INST:if(i==="?"){t.state=S.PROC_INST_ENDING}else if(g(i)){t.state=S.PROC_INST_BODY}else{t.procInstName+=i}continue;case S.PROC_INST_BODY:if(!t.procInstBody&&g(i)){continue}else if(i==="?"){t.state=S.PROC_INST_ENDING}else{t.procInstBody+=i}continue;case S.PROC_INST_ENDING:if(i===">"){b(t,"onprocessinginstruction",{name:t.procInstName,body:t.procInstBody});t.procInstName=t.procInstBody="";t.state=S.TEXT}else{t.procInstBody+="?"+i;t.state=S.PROC_INST_BODY}continue;case S.OPEN_TAG:if(w(y,i)){t.tagName+=i}else{B(t);if(i===">"){E(t)}else if(i==="/"){t.state=S.OPEN_TAG_SLASH}else{if(!g(i)){D(t,"Invalid character in tag name")}t.state=S.ATTRIB}}continue;case S.OPEN_TAG_SLASH:if(i===">"){E(t,true);q(t)}else{D(t,"Forward-slash in opening tag not followed by >");t.state=S.ATTRIB}continue;case S.ATTRIB:if(g(i)){continue}else if(i===">"){E(t)}else if(i==="/"){t.state=S.OPEN_TAG_SLASH}else if(w(m,i)){t.attribName=i;t.attribValue="";t.state=S.ATTRIB_NAME}else{D(t,"Invalid attribute name")}continue;case S.ATTRIB_NAME:if(i==="="){t.state=S.ATTRIB_VALUE}else if(i===">"){D(t,"Attribute without value");t.attribValue=t.attribName;I(t);E(t)}else if(g(i)){t.state=S.ATTRIB_NAME_SAW_WHITE}else if(w(y,i)){t.attribName+=i}else{D(t,"Invalid attribute name")}continue;case S.ATTRIB_NAME_SAW_WHITE:if(i==="="){t.state=S.ATTRIB_VALUE}else if(g(i)){continue}else{D(t,"Attribute without value");t.tag.attributes[t.attribName]="";t.attribValue="";b(t,"onattribute",{name:t.attribName,value:""});t.attribName="";if(i===">"){E(t)}else if(w(m,i)){t.attribName=i;t.state=S.ATTRIB_NAME}else{D(t,"Invalid attribute name");t.state=S.ATTRIB}}continue;case S.ATTRIB_VALUE:if(g(i)){continue}else if(P(i)){t.q=i;t.state=S.ATTRIB_VALUE_QUOTED}else{D(t,"Unquoted attribute value");t.state=S.ATTRIB_VALUE_UNQUOTED;t.attribValue=i}continue;case S.ATTRIB_VALUE_QUOTED:if(i!==t.q){if(i==="&"){t.state=S.ATTRIB_VALUE_ENTITY_Q}else{t.attribValue+=i}continue}I(t);t.q="";t.state=S.ATTRIB_VALUE_CLOSED;continue;case S.ATTRIB_VALUE_CLOSED:if(g(i)){t.state=S.ATTRIB}else if(i===">"){E(t)}else if(i==="/"){t.state=S.OPEN_TAG_SLASH}else if(w(m,i)){D(t,"No whitespace between attributes");t.attribName=i;t.attribValue="";t.state=S.ATTRIB_NAME}else{D(t,"Invalid attribute name")}continue;case S.ATTRIB_VALUE_UNQUOTED:if(!W(i)){if(i==="&"){t.state=S.ATTRIB_VALUE_ENTITY_U}else{t.attribValue+=i}continue}I(t);if(i===">"){E(t)}else{t.state=S.ATTRIB}continue;case S.CLOSE_TAG:if(!t.tagName){if(g(i)){continue}else if(N(m,i)){if(t.script){t.script+="</"+i;t.state=S.SCRIPT}else{D(t,"Invalid tagname in closing tag.")}}else{t.tagName=i}}else if(i===">"){q(t)}else if(w(y,i)){t.tagName+=i}else if(t.script){t.script+="</"+t.tagName;t.tagName="";t.state=S.SCRIPT}else{if(!g(i)){D(t,"Invalid tagname in closing tag")}t.state=S.CLOSE_TAG_SAW_WHITE}continue;case S.CLOSE_TAG_SAW_WHITE:if(g(i)){continue}if(i===">"){q(t)}else{D(t,"Invalid characters in closing tag")}continue;case S.TEXT_ENTITY:case S.ATTRIB_VALUE_ENTITY_Q:case S.ATTRIB_VALUE_ENTITY_U:var s;var a;switch(t.state){case S.TEXT_ENTITY:s=S.TEXT;a="textNode";break;case S.ATTRIB_VALUE_ENTITY_Q:s=S.ATTRIB_VALUE_QUOTED;a="attribValue";break;case S.ATTRIB_VALUE_ENTITY_U:s=S.ATTRIB_VALUE_UNQUOTED;a="attribValue";break}if(i===";"){t[a]+=z(t);t.entity="";t.state=s}else if(w(t.entity.length?F:L,i)){t.entity+=i}else{D(t,"Invalid character in entity name");t[a]+="&"+t.entity+i;t.entity="";t.state=s}continue;default:throw new Error(t,"Unknown state: "+t.state)}}if(t.position>=t.bufferCheckPosition){l(t)}return t}
+/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */if(!String.fromCodePoint){(function(){var u=String.fromCharCode;var l=Math.floor;var e=function(){var e=16384;var t=[];var n;var i;var r=-1;var o=arguments.length;if(!o){return""}var s="";while(++r<o){var a=Number(arguments[r]);if(!isFinite(a)||a<0||a>1114111||l(a)!==a){throw RangeError("Invalid code point: "+a)}if(a<=65535){t.push(a)}else{a-=65536;n=(a>>10)+55296;i=a%1024+56320;t.push(n,i)}if(r+1===o||t.length>e){s+=u.apply(null,t);t.length=0}}return s};if(Object.defineProperty){Object.defineProperty(String,"fromCodePoint",{value:e,configurable:true,writable:true})}else{String.fromCodePoint=e}})()}})(false?undefined:t)}).call(this,U(34).Buffer)},function(e,t,n){"use strict";t.byteLength=s;t.toByteArray=a;t.fromByteArray=v;var u=[];var l=[];var f=typeof Uint8Array!=="undefined"?Uint8Array:Array;var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var r=0,o=i.length;r<o;++r){u[r]=i[r];l[i.charCodeAt(r)]=r}l["-".charCodeAt(0)]=62;l["_".charCodeAt(0)]=63;function c(e){var t=e.length;if(t%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var n=e.indexOf("=");if(n===-1)n=t;var i=n===t?0:4-n%4;return[n,i]}function s(e){var t=c(e);var n=t[0];var i=t[1];return(n+i)*3/4-i}function h(e,t,n){return(t+n)*3/4-n}function a(e){var t;var n=c(e);var i=n[0];var r=n[1];var o=new f(h(e,i,r));var s=0;var a=r>0?i-4:i;var u;for(u=0;u<a;u+=4){t=l[e.charCodeAt(u)]<<18|l[e.charCodeAt(u+1)]<<12|l[e.charCodeAt(u+2)]<<6|l[e.charCodeAt(u+3)];o[s++]=t>>16&255;o[s++]=t>>8&255;o[s++]=t&255}if(r===2){t=l[e.charCodeAt(u)]<<2|l[e.charCodeAt(u+1)]>>4;o[s++]=t&255}if(r===1){t=l[e.charCodeAt(u)]<<10|l[e.charCodeAt(u+1)]<<4|l[e.charCodeAt(u+2)]>>2;o[s++]=t>>8&255;o[s++]=t&255}return o}function d(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[e&63]}function p(e,t,n){var i;var r=[];for(var o=t;o<n;o+=3){i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255);r.push(d(i))}return r.join("")}function v(e){var t;var n=e.length;var i=n%3;var r=[];var o=16383;for(var s=0,a=n-i;s<a;s+=o){r.push(p(e,s,s+o>a?a:s+o))}if(i===1){t=e[n-1];r.push(u[t>>2]+u[t<<4&63]+"==")}else if(i===2){t=(e[n-2]<<8)+e[n-1];r.push(u[t>>10]+u[t>>4&63]+u[t<<2&63]+"=")}return r.join("")}},function(e,t){
+/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
+t.read=function(e,t,n,i,r){var o,s;var a=r*8-i-1;var u=(1<<a)-1;var l=u>>1;var f=-7;var c=n?r-1:0;var h=n?-1:1;var d=e[t+c];c+=h;o=d&(1<<-f)-1;d>>=-f;f+=a;for(;f>0;o=o*256+e[t+c],c+=h,f-=8){}s=o&(1<<-f)-1;o>>=-f;f+=i;for(;f>0;s=s*256+e[t+c],c+=h,f-=8){}if(o===0){o=1-l}else if(o===u){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,i);o=o-l}return(d?-1:1)*s*Math.pow(2,o-i)};t.write=function(e,t,n,i,r,o){var s,a,u;var l=o*8-r-1;var f=(1<<l)-1;var c=f>>1;var h=r===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=i?0:o-1;var p=i?1:-1;var v=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){a=isNaN(t)?1:0;s=f}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(u=Math.pow(2,-s))<1){s--;u*=2}if(s+c>=1){t+=h/u}else{t+=h*Math.pow(2,1-c)}if(t*u>=2){s++;u/=2}if(s+c>=f){a=0;s=f}else if(s+c>=1){a=(t*u-1)*Math.pow(2,r);s=s+c}else{a=t*Math.pow(2,c-1)*Math.pow(2,r);s=0}}for(;r>=8;e[n+d]=a&255,d+=p,a/=256,r-=8){}s=s<<r|a;l+=r;for(;l>0;e[n+d]=s&255,d+=p,s/=256,l-=8){}e[n+d-p]|=v*128}},function(e,t,n){e.exports=r;var f=n(13).EventEmitter;var i=n(7);i(r,f);r.Readable=n(35);r.Writable=n(109);r.Duplex=n(110);r.Transform=n(111);r.PassThrough=n(112);r.Stream=r;function r(){f.call(this)}r.prototype.pipe=function(t,e){var n=this;function i(e){if(t.writable){if(false===t.write(e)&&n.pause){n.pause()}}}n.on("data",i);function r(){if(n.readable&&n.resume){n.resume()}}t.on("drain",r);if(!t._isStdio&&(!e||e.end!==false)){n.on("end",s);n.on("close",a)}var o=false;function s(){if(o)return;o=true;t.end()}function a(){if(o)return;o=true;if(typeof t.destroy==="function")t.destroy()}function u(e){l();if(f.listenerCount(this,"error")===0){throw e}}n.on("error",u);t.on("error",u);function l(){n.removeListener("data",i);t.removeListener("drain",r);n.removeListener("end",s);n.removeListener("close",a);n.removeListener("error",u);t.removeListener("error",u);n.removeListener("end",l);n.removeListener("close",l);t.removeListener("close",l)}n.on("end",l);n.on("close",l);t.on("close",l);t.emit("pipe",n);return t}},function(e,t){},function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var u=n(16).Buffer;var i=n(105);function l(e,t,n){e.copy(t,n)}e.exports=function(){function e(){a(this,e);this.head=null;this.tail=null;this.length=0}e.prototype.push=function n(e){var t={data:e,next:null};if(this.length>0)this.tail.next=t;else this.head=t;this.tail=t;++this.length};e.prototype.unshift=function i(e){var t={data:e,next:this.head};if(this.length===0)this.tail=t;this.head=t;++this.length};e.prototype.shift=function t(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e};e.prototype.clear=function r(){this.head=this.tail=null;this.length=0};e.prototype.join=function o(e){if(this.length===0)return"";var t=this.head;var n=""+t.data;while(t=t.next){n+=e+t.data}return n};e.prototype.concat=function s(e){if(this.length===0)return u.alloc(0);if(this.length===1)return this.head.data;var t=u.allocUnsafe(e>>>0);var n=this.head;var i=0;while(n){l(n.data,t,i);i+=n.data.length;n=n.next}return t};return e}();if(i&&i.inspect&&i.inspect.custom){e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e}}},function(e,t){},function(e,t,n){(function(e,g){(function(n,i){"use strict";if(n.setImmediate){return}var r=1;var o={};var s=false;var a=n.document;var u;function e(e){if(typeof e!=="function"){e=new Function(""+e)}var t=new Array(arguments.length-1);for(var n=0;n<t.length;n++){t[n]=arguments[n+1]}var i={callback:e,args:t};o[r]=i;u(r);return r++}function l(e){delete o[e]}function f(e){var t=e.callback;var n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(i,n);break}}function c(e){if(s){setTimeout(c,0,e)}else{var t=o[e];if(t){s=true;try{f(t)}finally{l(e);s=false}}}}function t(){u=function(e){g.nextTick(function(){c(e)})}}function h(){if(n.postMessage&&!n.importScripts){var e=true;var t=n.onmessage;n.onmessage=function(){e=false};n.postMessage("","*");n.onmessage=t;return e}}function d(){var t="setImmediate$"+Math.random()+"$";var e=function(e){if(e.source===n&&typeof e.data==="string"&&e.data.indexOf(t)===0){c(+e.data.slice(t.length))}};if(n.addEventListener){n.addEventListener("message",e,false)}else{n.attachEvent("onmessage",e)}u=function(e){n.postMessage(t+e,"*")}}function p(){var t=new MessageChannel;t.port1.onmessage=function(e){var t=e.data;c(t)};u=function(e){t.port2.postMessage(e)}}function v(){var n=a.documentElement;u=function(e){var t=a.createElement("script");t.onreadystatechange=function(){c(e);t.onreadystatechange=null;n.removeChild(t);t=null};n.appendChild(t)}}function m(){u=function(e){setTimeout(c,0,e)}}var y=Object.getPrototypeOf&&Object.getPrototypeOf(n);y=y&&y.setTimeout?y:n;if({}.toString.call(n.process)==="[object process]"){t()}else if(h()){d()}else if(n.MessageChannel){p()}else if(a&&"onreadystatechange"in a.createElement("script")){v()}else{m()}y.setImmediate=e;y.clearImmediate=l})(typeof self==="undefined"?typeof e==="undefined"?this:e:self)}).call(this,n(6),n(14))},function(t,e,n){(function(i){t.exports=e;function e(e,t){if(r("noDeprecation")){return e}var n=false;function i(){if(!n){if(r("throwDeprecation")){throw new Error(t)}else if(r("traceDeprecation")){console.trace(t)}else{console.warn(t)}n=true}return e.apply(this,arguments)}return i}function r(e){try{if(!i.localStorage)return false}catch(n){return false}var t=i.localStorage[e];if(null==t)return false;return String(t).toLowerCase()==="true"}}).call(this,n(6))},function(e,t,n){"use strict";e.exports=o;var i=n(57);var r=Object.create(n(9));r.inherits=n(7);r.inherits(o,i);function o(e){if(!(this instanceof o))return new o(e);i.call(this,e)}o.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){e.exports=n(36)},function(e,t,n){e.exports=n(5)},function(e,t,n){e.exports=n(35).Transform},function(e,t,n){e.exports=n(35).PassThrough},function(e,t){(function(){"use strict";t.stripBOM=function(e){if(e[0]==="\ufeff"){return e.substring(1)}else{return e}}}).call(this)},function(e,i,r){"use strict";(function(zt){Object.defineProperty(i,"__esModule",{value:true});i.ActiveXControl=undefined;var Jt=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var Ht=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}return function(e,t,n){if(t)i(e.prototype,t);if(n)i(e,n);return e}}();var Ut=r(59);var e=r(18);var jt=t(e);function t(e){return e&&e.__esModule?e:{"default":e}}function Gt(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var n=function(){var e=function(){function i(e){Gt(this,i);var t={szId:"playWnd",iType:0,iWidth:400,iHeight:300,iMaxSplit:4,iCurrentSplit:2,szPlayMode:"normal"};this.szClassId="E7EF736D-B4E6-4A5A-BA94-732D71107808";this.oOptions=zt.extend(t,e);if(this.oOptions.szIframeId&&zt("#"+this.oOptions.szIframeId).length){this.oOptions.oId=zt("#"+this.oOptions.szId,zt("#"+this.oOptions.szIframeId)[0].contentWindow.document)}else{this.oOptions.oId=zt("#"+this.oOptions.szId)}var n="";if(this.oOptions.szBackgroundColor){n+="plugin-background:"+this.oOptions.szBackgroundColor+";"}if(this.oOptions.szClassId){this.szClassId=this.oOptions.szClassId}if(this.oOptions.szBorderColor){n+="sub-border:"+this.oOptions.szBorderColor+";"}if(this.oOptions.szSubBackgroundColor){n+="sub-background:"+this.oOptions.szSubBackgroundColor+";"}if(this.oOptions.szSelectBorderColor){n+="sub-border-select:"+this.oOptions.szSelectBorderColor+";"}if(n){this.szColorParam="<param name='colors' value='"+n+"'>"}this.oOptions.oId.html("<object classid='clsid:"+this.szClassId+"' codebase='' standby='Waiting...' "+"id='"+this.oOptions.szId+"_multiVideoActiveX' width='100%' height='100%' name='ocx' align='center' ><param name='wndtype' value='"+this.oOptions.iCurrentSplit+"'><param name='playmode' value='"+this.oOptions.szPlayMode+"'>"+this.szColorParam+"</object>");this.oPlugin=this.oOptions.oId.find("#"+this.oOptions.szId+"_multiVideoActiveX")[0];if(this.oPlugin===null||typeof this.oPlugin==="undefined"){this.oPlugin=null}else if(this.oPlugin.object===null||typeof this.oPlugin.object==="undefined"){this.oPlugin=null}this.fCurrentCallback=null;this.afCurrentCallback=[];this.fPointCallback=null;this.iProtocolType=0;this.oPluginCallback={};this.szPluginVersion="V3.0.6.46";this.ConsoleLog=function(e){var t=sessionStorage.getItem("bDebugMode");if(t){console.log(e)}}}Ht(i,[{key:"JS_CreateWnd",value:function o(e,t,n){var i=this;var r=zt.Deferred();setTimeout(function(){i.oOptions.oId.html("<object classid='clsid:"+i.szClassId+"' codebase='' standby='Waiting...' "+"id='"+i.oOptions.szId+"_multiVideoActiveX' width='"+t+"' height='"+n+"' name='ocx' align='center' ><param name='wndtype' value='"+i.oOptions.iCurrentSplit+"'><param name='playmode' value='"+i.oOptions.szPlayMode+"'>"+this.szColorParam+"</object>");i.oPlugin=i.oOptions.oId.find("#"+i.oOptions.szId+"_multiVideoActiveX")[0];if(i.oPlugin===null||i.oPlugin.object===null){i.oPlugin=null}r.resolve()},100);return r.promise()}},{key:"JS_ShowWnd",value:function n(){var e=this;var t=zt.Deferred();setTimeout(function(){zt("#"+e.oOptions.szId+"_multiVideoActiveX").show();t.resolve()},100);return t.promise()}},{key:"JS_HideWnd",value:function r(){var e=this;var t=zt.Deferred();setTimeout(function(){zt("#"+e.oOptions.szId+"_multiVideoActiveX").hide();t.resolve()},100);return t.promise()}},{key:"JS_SetWndCover",value:function t(){var e=zt.Deferred();setTimeout(function(){e.resolve()},100);return e.promise()}},{key:"JS_SetWindowControlCallback",value:function s(e){var f=this;var t=f.oOptions.szIframeId&&zt("#"+f.oOptions.szIframeId).length?zt("#"+f.oOptions.szIframeId)[0].contentWindow:window;zt.extend(this.oPluginCallback,e);t.GetSelectWndInfo=function(e){var t=Ut.oUtils.parseXmlFromStr(e);var n=parseInt(zt(t).find("SelectWnd").eq(0).text(),10);if(0<=n){f.fCurrentCallback=f.afCurrentCallback[n]}if(f.oPluginCallback.onGetSelectWndInfo){f.oPluginCallback.onGetSelectWndInfo(n)}};t.PluginEventHandler=function(e,t,n){if(e===69){var i=f.oPlugin.HWP_GetDrawLineInfo(t);var r=Ut.oUtils.parseXmlFromStr(i);var o=[];zt(r).find("RegionCoordinates").each(function(){var e=parseFloat(zt(this).find("positionX").text());var t=1-parseFloat(zt(this).find("positionY").text());o.push([e,t])});var s="Line";if(o.length>3){s="Polygon"}if(f.fCurrentCallback){f.fCurrentCallback({id:1,type:s,points:o})}}else if(e===14){f.oPluginCallback.onPluginEventHandler&&f.oPluginCallback.onPluginEventHandler(e,t)}else if(e===67){f.oPluginCallback.onDrawEvent&&f.oPluginCallback.onDrawEvent({id:parseInt(t,10),type:"Line",event:"choosed"})}else if(e===68){var a="Polygon";if(0===parseInt(n,10)){a="Rect"}f.oPluginCallback.onDrawEvent&&f.oPluginCallback.onDrawEvent({id:parseInt(t,10),type:a,event:"choosed"})}else if(e===70){var u="Polygon";if(0===parseInt(n,10)){u="Rect"}f.oPluginCallback.onDrawEvent&&f.oPluginCallback.onDrawEvent({id:parseInt(t,10),type:u,event:"drawEnd"})}else{f.oPluginCallback.onPluginEventHandler&&f.oPluginCallback.onPluginEventHandler(t,e)}};t.ZoomInfoCallback=function(e){var t=Ut.oUtils.parseXmlFromStr(e);var n=[];var i=0;var r=0;var o=0;var s=0;i=parseInt(zt(t).find("StartPoint").eq(0).find("positionX").eq(0).text(),10)/255;r=parseInt(zt(t).find("StartPoint").eq(0).find("positionY").eq(0).text(),10)/255;o=parseInt(zt(t).find("EndPoint").eq(0).find("positionX").eq(0).text(),10)/255;s=parseInt(zt(t).find("EndPoint").eq(0).find("positionY").eq(0).text(),10)/255;n=[[i,r],[o,r],[o,s],[i,s]];if(f.fCurrentCallback){f.fCurrentCallback({id:1,type:"Rect",points:n},e)}};t.EZoomInfoCallback=function(e){var t=Ut.oUtils.parseXmlFromStr(e);var n=[];var i=0;var r=0;var o=0;var s=0;i=parseInt(zt(t).find("StartPoint").eq(0).find("positionX").eq(0).text(),10)/255;r=parseInt(zt(t).find("StartPoint").eq(0).find("positionY").eq(0).text(),10)/255;o=parseInt(zt(t).find("EndPoint").eq(0).find("positionX").eq(0).text(),10)/255;s=parseInt(zt(t).find("EndPoint").eq(0).find("positionY").eq(0).text(),10)/255;n=[[i,r],[o,r],[o,s],[i,s]];if(f.fCurrentCallback){f.fCurrentCallback({id:1,type:"Rect",points:n},e)}};t.GetFishPTZInfo=function(e){var t=Ut.oUtils.parseXmlFromStr(e);var n=parseInt(zt(t).find("infoType").eq(0).text(),10);var i=parseInt(zt(t).find("WndType").eq(0).text(),10);var r=zt(t).find("id").eq(0).text();var o=[parseFloat(zt(t).find("posX").eq(0).text()),parseFloat(zt(t).find("posY").eq(0).text())];var s=[parseFloat(zt(t).find("pos2X").eq(0).text()),parseFloat(zt(t).find("pos2Y").eq(0).text())];var a=parseInt(zt(t).find("pointSequence").eq(0).text(),10);var u=parseInt(zt(t).find("tracSequence").eq(0).text(),10);var l={type:n,windowType:i,id:r,position:o,originPosition:s,pointId:a,traceId:u};if(f.oPluginCallback.onFisheyePTZInfo){f.oPluginCallback.onFisheyePTZInfo(l)}};t.KeyBoardEvent=function(e){var t=Ut.oUtils.parseXmlFromStr(e);var n=parseInt(zt(t).find("keyCode").eq(0).text(),10);if(n===27){if(f.oPluginCallback.onFullScreenChange){f.oPluginCallback.onFullScreenChange(false)}}};t.MouseEvent=function(e,t){var n=Ut.oUtils.parseXmlFromStr(e);var i=parseInt(zt(n).find("WndIndex").eq(0).text(),10);var r=parseInt(zt(n).find("EventType").eq(0).text(),10);var o=parseFloat(zt(n).find("Position").eq(0).find("x").eq(0).text());var s=parseFloat(zt(n).find("Position").eq(0).find("y").eq(0).text());if(f.oPluginCallback.onMouseEvent){f.oPluginCallback.onMouseEvent({wndIndex:i,eventType:r,point:[o,s],pluginID:t})}if(f.fPointCallback&&r===1){f.fPointCallback({id:1,eventType:r,point:[o,s]})}};t.SetZeroChanEnlarge=function(e){var t=Ut.oUtils.parseXmlFromStr(e);var n=parseInt(zt(t).find("BeState").eq(0).text(),10);var i=parseInt(zt(t).find("MCP_x").eq(0).text(),10);var r=parseInt(zt(t).find("MCP_y").eq(0).text(),10);if(f.oPluginCallback.onZeroEnlargeState){f.oPluginCallback.onZeroEnlargeState({state:n,x:i,y:r})}};t.GetVoiceInfo=function(e){var t=Ut.oUtils.parseXmlFromStr(e);var n=[];var i=zt(t).find("levlAngle").eq(0).text()?parseInt(zt(t).find("levlAngle").eq(0).text(),10):"";zt(t).find("voiceInfo").each(function(){var e=parseFloat(zt(this).find("dbValue").eq(0).text());n.push(e)});if(f.oPluginCallback.onGetVoiceInfo){if(i){f.oPluginCallback.onGetVoiceInfo([],i)}else{f.oPluginCallback.onGetVoiceInfo(n)}}}}},{key:"JS_ArrangeWindow",value:function a(e,t){var n=zt.Deferred();if(t&&t.length>0){var i='<?xml version="1.0" encoding="UTF-8"?><CustomWindowList>';zt.each(t,function(e,t){i+="<CustomWindow>\n                        <id>"+(e+1)+"</id>\n                        <windowType>0</windowType>\n                        <EditType>"+(t.dragable?1:0)+"</EditType>\n                        <color><r>255</r><g>0</g><b>0</b></color>\n                        <StartPos><x>"+t.left+"</x><y>"+t.top+"</y></StartPos>\n                        <WHLength><width>"+t.width+"</width><height>"+t.height+"</height></WHLength>\n                        <zIndex>"+t.layer+"</zIndex>\n                        </CustomWindow>"});i+="</CustomWindowList>";this.oPlugin.HWP_ArrangeCustomWindow(i)}else{this.oPlugin.HWP_ArrangeWindow(e)}setTimeout(function(){n.resolve()},100);return n.promise()}},{key:"JS_SetSecretKey",value:function u(e,t,n){var i=zt.Deferred();var r=this;var o=this.oPlugin.HWP_SetSecretKey(n,t);setTimeout(function(){if(o<0){o=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_SetSecretKey:"+o);i.reject()}else{i.resolve()}},100);return i.promise()}},{key:"JS_GetEncryptString",value:function l(e,t,n){var i=zt.Deferred();var r=0;var o=this;r=this.oPlugin.HWP_SetOriginalString(t,n,"");var s=this.oPlugin.HWP_GetEncryptString(e);setTimeout(function(){if(r<0){r=o.oPlugin.HWP_GetLastError();o.ConsoleLog("HWP_SetOriginalString:"+r);i.reject()}else{i.resolve(s)}},100);return i.promise()}},{key:"JS_GetDecryptString",value:function e(t,n,i){var r=this;var o=zt.Deferred();setTimeout(function(){if(!i){o.reject();return}var e=r.oPlugin.HWP_GetDecryptString(t,n,i);o.resolve(e)},100);return o.promise()}},{key:"JS_SetOriginalString",value:function f(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_SetOriginalString(e,t,"");setTimeout(function(){if(r<0){r=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetOriginalString:"+r);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_DestroyPlugin",value:function c(){var e=zt.Deferred();zt("#"+this.oOptions.szId+"_multiVideoActiveX").remove();this.oPlugin=null;this.oPluginCallback={};setTimeout(function(){e.resolve()},100);return e.promise()}},{key:"JS_Play",value:function h(e,t,n,i,r){var o=zt.Deferred();var s=this;var a=this.oPlugin.HWP_Play(e,t.auth,n,i,r);setTimeout(function(){if(a<0){a=s.oPlugin.HWP_GetLastError();s.ConsoleLog("HWP_Play:"+a);o.reject(a)}else{o.resolve()}},100);return o.promise()}},{key:"JS_Play2",value:function d(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_Play_V20(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_Play_V20:"+e);n.reject(r)}else{n.resolve(r)}},100);return n.promise()}},{key:"JS_OpenFileBrowser2",value:function p(e,t){if(!t){t=32}var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_OpenFileBrowser_V2(e,t);setTimeout(function(){if(r){n.resolve(r)}else{var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_OpenFileBrowser_V2:"+e);n.reject()}},100);return n.promise()}},{key:"JS_uploadFileByForm",value:function v(e){var t=-1;var n=zt.Deferred();var i=this;t=this.oPlugin.HWP_StartFormAsynUpload(e);setTimeout(function(){if(t===0){n.resolve(t)}else{var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_StartFormAsynUpload:"+e);n.reject(t)}},100);return n.promise()}},{key:"HWP_StopFormAsynUpload",value:function m(){var t=-1;var n=this;var i=zt.Deferred();t=this.oPlugin.HWP_StopFormAsynUpload();setTimeout(function(){if(t===0){i.resolve(t)}else{var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StartFormAsynUpload:"+e);i.reject(t)}},100);return i.promise()}},{key:"JS_ReversePlay",value:function y(e,t,n,i,r){var o=this;var s=zt.Deferred();var a=o.oPlugin.HWP_ReversePlay(e,t.auth,n,i,r);setTimeout(function(){if(a<0){a=o.oPlugin.HWP_GetLastError();o.ConsoleLog("HWP_ReversePlay:"+a);s.reject(a)}else{s.resolve()}},100);return s.promise()}},{key:"JS_Stop",value:function g(e){var t=zt.Deferred();var n=this;if(!(this&&this.oPlugin)){t.reject()}else{try{var i=this.oPlugin.HWP_Stop(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_Stop:"+e);t.reject()}else{t.resolve()}},100)}catch(r){n.ConsoleLog("HWP_Stop:"+r);t.reject(r)}}return t.promise()}},{key:"JS_Seek",value:function P(){var e=zt.Deferred();setTimeout(function(){e.resolve()},100);return e.promise()}},{key:"JS_StopRealPlayAll",value:function w(){var e=zt.Deferred();var t=this.oPlugin.StopRealPlayAll();setTimeout(function(){if(t<0){e.reject()}else{e.resolve()}},100);return e.promise()}},{key:"JS_Pause",value:function S(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_Pause(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_Pause:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_Resume",value:function _(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_Resume(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_Resume:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_Slow",value:function b(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_Slow(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_Slow:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_Fast",value:function C(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_Fast(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_Fast:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_Transmission",value:function k(){var e=zt.Deferred();setTimeout(function(){e.resolve()},100);return e.promise()}},{key:"JS_FrameForward",value:function T(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_FrameForward(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_FrameForward:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetOSDTime",value:function R(e){var t=zt.Deferred();var n=-1;var i=this;n=this.oPlugin.HWP_GetOSDTime(e);setTimeout(function(){if(n<0||!n){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_GetOSDTime:"+n+";HWP_GetLastError:"+e);t.reject()}else{t.resolve(n)}},100);return t.promise()}},{key:"JS_OpenSound",value:function D(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_OpenSound(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_OpenSound:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_CloseSound",value:function x(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_CloseSound();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_CloseSound:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetVolume",value:function I(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_GetVolume(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_GetVolume:"+e);t.reject()}else{t.resolve(i)}},100);return t.promise()}},{key:"JS_SetVolume",value:function E(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_SetVolume(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetVolume:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_SetAudioVolume",value:function q(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_SetAudioVolume(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetAudioVolume:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_EnableZoom",value:function A(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_EnableZoom(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_EnableZoom:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_DisableZoom",value:function O(e){var t=zt.Deferred();this.oPlugin.HWP_DisableZoom(e);var n=this;setTimeout(function(){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_DisableZoom:"+e);t.resolve()},100);return t.promise()}},{key:"JS_CapturePicture",value:function M(e,t){var n=this;var i=zt.Deferred();t=t.replace(/playback_/g,"");var r=n.oPlugin.HWP_CapturePicture(e,t);setTimeout(function(){if(r<0){r=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_CapturePicture:"+r);i.reject(r)}else{i.resolve()}},100);return i.promise()}},{key:"JS_StartSave",value:function L(e,t){var n=this;var i=zt.Deferred();var r=n.oPlugin.HWP_StartSave(e,t);setTimeout(function(){if(r<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StartSave:"+e);i.reject(r)}else{i.resolve()}},100);return i.promise()}},{key:"JS_StopSave",value:function F(e){var t=this;var n=zt.Deferred();var i=this.oPlugin.HWP_StopSave(e);setTimeout(function(){if(i<0){var e=t.oPlugin.HWP_GetLastError();t.ConsoleLog("HWP_StopSave:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_StartTalk",value:function W(e,t,n,i,r,o,s,a,u,l){var f=zt.Deferred();var c=void 0;var h=this;if(typeof l==="undefined"){c=this.oPlugin.HWP_StartVoiceTalk_V20(e,t,n,i,r,o,s,a,u)}else{c=this.oPlugin.HWP_StartVoiceTalk_V20Ex(e,t,n,i,r,o,s,a,u,l?l:0)}setTimeout(function(){if(c<0){var e=h.oPlugin.HWP_GetLastError();var t=typeof l==="undefined"?"HWP_StartVoiceTalk_V20":"HWP_StartVoiceTalk_V20Ex";h.ConsoleLog(t+":"+e);f.reject()}else{f.resolve()}},100);return f.promise()}},{key:"JS_StopTalk",value:function N(){var e=zt.Deferred();this.oPlugin.HWP_StopVoiceTalk();setTimeout(function(){e.resolve()},100);return e.promise()}},{key:"JS_SetPlayMode",value:function B(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_SetPlayModeType(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetPlayModeType:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_SetFullScreenCapability",value:function z(t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_SetCanFullScreen(t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetCanFullScreen:"+t+";HWP_GetLastError:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_FullScreenDisplay",value:function J(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_FullScreenDisplay(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_FullScreenDisplay:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_EnableIVS",value:function H(e,t,n){var i=zt.Deferred();var r=this;var o=this.oPlugin.HWP_EnableIVS(e,t,n);setTimeout(function(){if(o<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_EnableIVS:"+e);i.reject()}else{i.resolve()}},100);return i.promise()}},{key:"JS_SRInit",value:function U(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_SR_Init(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SR_Init:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_SRPTZ",value:function j(e,t,n){var i=zt.Deferred();var r=this;var o=0;if(t===4||t===5){o=this.oPlugin.HWP_SR_Zoom(e,5-t,n)}else{o=this.oPlugin.HWP_SR_PTZ(e,t,n)}setTimeout(function(){if(o<0){var e=r.oPlugin.HWP_GetLastError();if(t===4||t===5){r.ConsoleLog("HWP_SR_Zoom:"+e)}else{r.ConsoleLog("HWP_SR_PTZ:"+e)}i.reject()}else{i.resolve()}},100);return i.promise()}},{key:"JS_SetPlaybackDrawType",value:function G(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_SetPlaybackDrawType(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetPlaybackDrawType:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_SetPlayBackType",value:function V(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_SetPlayBackType(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetPlayBackType:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_SetTrsPlayBackParam",value:function Y(e,t){var n=zt.Deferred();var i=this;var r='<?xml version="1.0" encoding="utf-8"?><CompressionInfo>'+"<TransBitrate>"+t.transBitrate+"</TransBitrate>"+"<TransFrameRate>"+t.transFrameRate+"</TransFrameRate>"+"<TransResolution>"+t.transResolution+"</TransResolution></CompressionInfo>";var o=this.oPlugin.HWP_SetTrsPlayBackParam(e,r);setTimeout(function(){if(o<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetTrsPlayBackParam:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_GetLocalConfig",value:function X(){var t=this;var n=zt.Deferred();var e=this.oPlugin.HWP_GetLocalConfig();var i=Ut.oUtils.parseXmlFromStr(e);var r={protocolType:zt(i).find("ProtocolType").eq(0).text(),streamType:zt(i).find("StreamType").eq(0).text(),packgeSize:zt(i).find("PackgeSize").eq(0).text(),playWndType:zt(i).find("PlayWndType").eq(0).text(),buffNumberType:zt(i).find("BuffNumberType").eq(0).text(),recordPath:zt(i).find("RecordPath").eq(0).text(),capturePath:zt(i).find("CapturePath").eq(0).text(),playbackFilePath:zt(i).find("PlaybackFilePath").eq(0).text(),playbackPicPath:zt(i).find("PlaybackPicPath").eq(0).text(),downloadPath:zt(i).find("DownloadPath").eq(0).text(),snapScenePicPath:zt(i).find("SnapScenePicPath").eq(0).text(),snapViewPicPath:zt(i).find("SnapViewPicPath").eq(0).text(),ivsMode:zt(i).find("IVSMode").eq(0).text(),realPlayAll:zt(i).find("RealPlayAll").eq(0).text(),captureFileFormat:zt(i).find("CaptureFileFormat").eq(0).text(),osdPosInfo:zt(i).find("OSDPosInfo").eq(0).text(),osdPicInfo:zt(i).find("OSDPicInfo").eq(0).text(),showWizard:zt(i).find("ShowWizard").eq(0).text(),secretKey:zt(i).find("SecretKey").eq(0).text(),showFireBox:zt(i).find("ShowFireBox").eq(0).text(),showFireDistance:zt(i).find("ShowFireDistance").eq(0).text(),showFireMaxTemperature:zt(i).find("ShowFireMaxTemp").eq(0).text(),showFireMaxTemperaturePos:zt(i).find("ShowFireMaxTempPos").eq(0).text(),showTemperaturePoint:zt(i).find("ShowTemPoint").eq(0).text(),showTemperatureLine:zt(i).find("ShowTemLine").eq(0).text(),showTemperatureBox:zt(i).find("ShowTemBox").eq(0).text(),captureIncludeTemperatureInfo:zt(i).find("CaptureTemp").eq(0).text(),customBuffNumber:zt(i).find("CustomBuffNumber").eq(0).text(),faceSnapPicPath:zt(i).find("FaceSnapPicPath").eq(0).text(),d3dCapture:zt(i).find("D3DCapture").eq(0).text(),HumanTrack:zt(i).find("HumanTrack").eq(0).text(),VehicleTrack:zt(i).find("VehicleTrack").eq(0).text(),RenderTrack:zt(i).find("RenderTrack").eq(0).text(),shieldMask:zt(i).find("ShieldMask").eq(0).text(),wasteGasDection:zt(i).find("WasteGasDection").eq(0).text(),gasInfo:zt(i).find("GasInfo").eq(0).text(),audioDownloadPath:zt(i).find("AudioDownloadPath").eq(0).text(),audioRecordPath:zt(i).find("AudioRecordPath").eq(0).text(),picOrRegionFill:zt(i).find("PicOrRegionFill").eq(0).text()};t.iProtocolType=parseInt(r.protocolType,10);setTimeout(function(){if(!r){var e=t.oPlugin.HWP_GetLastError();t.ConsoleLog("HWP_GetLocalConfig:"+e);n.reject()}else{n.resolve(r)}},100);return n.promise()}},{key:"JS_SetLocalConfig",value:function Z(t){var n=this;var i=zt.Deferred();var e='<?xml version="1.0" encoding="utf-8"?><LocalConfigInfo>'+"<ProtocolType>"+t.protocolType+"</ProtocolType><StreamType>"+t.streamType+"</StreamType>"+"<PackgeSize>"+t.packgeSize+"</PackgeSize><PlayWndType>"+t.playWndType+"</PlayWndType>"+"<BuffNumberType>"+t.buffNumberType+"</BuffNumberType><RecordPath>"+t.recordPath+"</RecordPath>"+"<CapturePath>"+t.capturePath+"</CapturePath><PlaybackFilePath>"+t.playbackFilePath+"</PlaybackFilePath>"+"<PlaybackPicPath>"+t.playbackPicPath+"</PlaybackPicPath><DownloadPath>"+t.downloadPath+"</DownloadPath>"+"<SnapScenePicPath>"+t.snapScenePicPath+"</SnapScenePicPath><SnapViewPicPath>"+t.snapViewPicPath+"</SnapViewPicPath>"+"<IVSMode>"+t.ivsMode+"</IVSMode><RealPlayAll>"+t.realPlayAll+"</RealPlayAll>"+"<CaptureFileFormat>"+t.captureFileFormat+"</CaptureFileFormat><OSDPosInfo>"+t.osdPosInfo+"</OSDPosInfo>"+"<OSDPicInfo>"+t.osdPicInfo+"</OSDPicInfo><ShowWizard>"+t.showWizard+"</ShowWizard>"+"<SecretKey>"+t.secretKey+"</SecretKey><ShowFireBox>"+t.showFireBox+"</ShowFireBox>"+"<ShowFireDistance>"+t.showFireDistance+"</ShowFireDistance><ShowFireMaxTemp>"+t.showFireMaxTemperature+"</ShowFireMaxTemp>"+"<ShowFireMaxTempPos>"+t.showFireMaxTemperaturePos+"</ShowFireMaxTempPos><ShowTemPoint>"+t.showTemperaturePoint+"</ShowTemPoint>"+"<ShowTemLine>"+t.showTemperatureLine+"</ShowTemLine><ShowTemBox>"+t.showTemperatureBox+"</ShowTemBox>"+"<CaptureTemp>"+t.captureIncludeTemperatureInfo+"</CaptureTemp>"+"<CustomBuffNumber>"+t.customBuffNumber+"</CustomBuffNumber>"+"<FaceSnapPicPath>"+t.faceSnapPicPath+"</FaceSnapPicPath>"+"<HumanTrack>"+t.HumanTrack+"</HumanTrack>"+"<VehicleTrack>"+t.VehicleTrack+"</VehicleTrack>"+"<RenderTrack>"+t.RenderTrack+"</RenderTrack>"+"<ShieldMask>"+t.shieldMask+"</ShieldMask>"+"<WasteGasDection>"+t.wasteGasDection+"</WasteGasDection>"+"<GasInfo>"+t.gasInfo+"</GasInfo>"+"<AudioDownloadPath>"+t.audioDownloadPath+"</AudioDownloadPath>"+"<AudioRecordPath>"+t.audioRecordPath+"</AudioRecordPath>"+"<PicOrRegionFill>"+t.picOrRegionFill+"</PicOrRegionFill>"+"</LocalConfigInfo>";var r=this.oPlugin.HWP_SetLocalConfig(e);setTimeout(function(){if(r<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_GetLocalConfig:"+e);i.reject()}else{n.iProtocolType=parseInt(t.protocolType,10);i.resolve()}},100);return i.promise()}},{key:"JS_GetLastError",value:function K(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetLastError();setTimeout(function(){if(t<0){e.reject()}else{e.resolve(t)}},100);return e.promise()}},{key:"JS_OpenFileBrowser",value:function $(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_OpenFileBrowser(e,t);setTimeout(function(){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_OpenFileBrowser:"+e);n.resolve(r)},100);return n.promise()}},{key:"JS_OpenDirectory",value:function Q(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_OpenDirectory(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_OpenFileBrowser:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_StartAsynUpload",value:function ee(e,t,n,i){var r=zt.Deferred();var o=this;var s=this.oPlugin.HWP_StartAsynUpload(e,t,n,i,0);setTimeout(function(){if(s<0){s=o.oPlugin.HWP_GetLastError();o.ConsoleLog("HWP_OpenFileBrowser:"+s);r.reject(s)}else{r.resolve()}},100);return r.promise()}},{key:"JS_StopAsynUpload",value:function te(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StopAsynUpload();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StopAsynUpload:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetUploadErrorInfo",value:function ne(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetUploadErrorInfo();setTimeout(function(){e.resolve(t)},100);return e.promise()}},{key:"JS_UploadFile",value:function ie(e,t,n,i){var r=this;var o=zt.Deferred();var s=r.oPlugin.HWP_UploadFile(e,t,n,i,0);setTimeout(function(){if(s<0){var e=r.oPlugin.HWP_GetHttpErrorInfo();s=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_UploadFile:"+s);r.ConsoleLog("HWP_GetHttpErrorInfo:"+e);o.reject({readyState:4,status:s,responseXML:e?Ut.oUtils.parseXmlFromStr(e):null,errorInfo:e})}else{o.resolve()}},100);return o.promise()}},{key:"JS_GetIpcImportErrorInfo",value:function re(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetIpcImportErrorInfo();setTimeout(function(){e.resolve(t)},100);return e.promise()}},{key:"JS_DownloadFile",value:function oe(e,t,n,i,r,o){var s=this;var a=zt.Deferred();var u=0;if(i===2){u=this.oPlugin.HWP_ExportFile(e,t,n,i,o)}else{u=this.oPlugin.HWP_ExportDeviceConfig(e,t,"",r)}setTimeout(function(){if(u<0){var e=s.oPlugin.HWP_GetHttpErrorInfo();u=s.oPlugin.HWP_GetLastError();s.ConsoleLog("HWP_GetHttpErrorInfo:"+e);if(i===2){s.ConsoleLog("HWP_ExportFile:"+u)}else{s.ConsoleLog("HWP_ExportDeviceConfig:"+u)}a.reject({readyState:4,status:u,responseXML:e?Ut.oUtils.parseXmlFromStr(e):null})}else{a.resolve(u)}},100);return a.promise()}},{key:"JS_DownloadFileNoPlugin",value:function se(t){var e=new Promise(function(e){zt("body").append('<a id="jsplugin_download_a" href="'+t+'"><li id="jsplugin_download_li"></li></a>');zt("#jsplugin_download_li").trigger("click");zt("#jsplugin_download_a").remove();e()});return e}},{key:"JS_StartUpgrade",value:function ae(e,t,n,i,r){var o=this;var s=zt.Deferred();var a=o.oPlugin.HWP_StartUpgradeEx(e,t,n,i,r,"");if(a<0){a=o.oPlugin.HWP_GetLastError();o.ConsoleLog("HWP_StartUpgradeEx:"+a);if(a===10){var u=void 0;try{u=o.oPlugin.HWP_GetProtectModeWithoutAdmin()}catch(l){u=-1}if(u===1){s.reject(605)}else{s.reject(a)}}else{s.reject(a)}}else{s.resolve()}return s.promise()}},{key:"JS_StopUpgrade",value:function ue(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StopUpgrade();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StopUpgrade:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetUpgradeStatus",value:function le(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_UpgradeStatus();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_UpgradeStatus:"+e);t.reject()}else{t.resolve(i)}},100);return t.promise()}},{key:"JS_GetUpgradeProgress",value:function fe(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_UpgradeStatus();if(i>=0){i=this.oPlugin.HWP_UpgradeProgress()}setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_UpgradeProgress:"+e);t.reject()}else{t.resolve(i)}},100);return t.promise()}},{key:"JS_ExportDeviceLog",value:function ce(e,t,n){var i=zt.Deferred();var r=this;var o=this.oPlugin.HWP_ExportDeviceLog(e,t,n);setTimeout(function(){if(o<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_ExportDeviceLog:"+e);i.reject()}else{i.resolve()}},100);return i.promise()}},{key:"JS_ExportReport",value:function he(e,t,n){var i=zt.Deferred();var r=this;var o=this.oPlugin.HWP_ExportReport(e,t,n);setTimeout(function(){if(o<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_ExportReport:"+e);i.reject()}else{i.resolve({status:o})}},100);return i.promise()}},{key:"JS_StartAsyncDownload",value:function de(e,t,n,i,r){var o=this;var s=zt.Deferred();var a=o.oPlugin.HWP_StartDownloadEx(e,t,n,i,r?r:"");setTimeout(function(){if(a<0){a=o.oPlugin.HWP_GetLastError();var e=o.oPlugin.HWP_GetHttpErrorInfo();o.ConsoleLog("HWP_ExportReport:"+a);o.ConsoleLog("HWP_GetHttpErrorInfo:"+e);s.reject({readyState:4,status:a,responseXML:e?Ut.oUtils.parseXmlFromStr(e):null})}else{s.resolve(a)}},100);return s.promise()}},{key:"JS_StopAsyncDownload",value:function pe(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StopDownload(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StopDownload:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetDownloadStatus",value:function ve(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_GetDownloadStatus(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_GetDownloadStatus:"+e);t.reject()}else{t.resolve(i)}},100);return t.promise()}},{key:"JS_GetDownloadProgress",value:function me(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_GetDownloadStatus(e);if(i>=0){i=this.oPlugin.HWP_GetDownloadProgress(e)}setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_GetDownloadProgress:"+e);t.reject()}else{t.resolve(i)}},100);return t.promise()}},{key:"JS_EnablePDC",value:function ye(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_EnablePDC(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_EnablePDC:"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_Resize",value:function ge(){var t=zt.Deferred();var n=this;setTimeout(function(){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_EnablePDC:"+e);t.resolve()},100);return t.promise()}},{key:"JS_SetDrawCallback",value:function Pe(t,e,n,i,r,o){var s=this;var a=zt.Deferred();s.fCurrentCallback=null;s.afCurrentCallback[t]=null;s.fPointCallback=null;var u=0;var l=0;var f="";if(n!=="Rect"){if(n==="Line"){l=2}else if(n==="Polygon"){l=4}else if(n==="Point"){var c="<?xml version='1.0' encoding='utf-8'?><SnapPointList>";c+="<mode>1</mode>";c+="<maxPointNum>1</maxPointNum>";c+="<SnapPoint><color><r>0</r><g>0</g><b>255</b></color><type>2</type></SnapPoint>";c+="</SnapPointList>";u=this.oPlugin.HWP_SetSnapPointInfo(0,c);f="HWP_SetSnapPointInfo";setTimeout(function(){if(u<0){var e=s.oPlugin.HWP_GetLastError();s.ConsoleLog(f+":"+e);a.reject()}else{s.fPointCallback=r;a.resolve()}},100);return a.promise()}else{l=0}if(e){f="HWP_SetPlaybackDrawType";u=s.oPlugin.HWP_SetPlaybackDrawType(t,l)}else{f="HWP_ClearDrawLineInfo";u=s.oPlugin.HWP_ClearDrawLineInfo(t)}}else{if(e){var h=1;if(o&&o.mode>=0){h=o.mode}u=s.oPlugin.HWP_EnableZoom(t,h);f="HWP_EnableZoom"}else{s.oPlugin.HWP_DisableZoom(t);f="HWP_DisableZoom"}}setTimeout(function(){if(u<0){var e=s.oPlugin.HWP_GetLastError();s.ConsoleLog(f+":"+e);a.reject()}else{s.fCurrentCallback=r;s.afCurrentCallback[t]=r;a.resolve()}},100);return a.promise()}},{key:"JS_SetDrawStatus",value:function we(e,t){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var i=zt.Deferred();var r=0;r=this.oPlugin.HWP_SetDrawStatus(e);if(e){if(t){r=this.oPlugin.HWP_SetSnapDrawMode(n,t)}else{r=this.oPlugin.HWP_SetSnapDrawMode(n,3)}}else{r=this.oPlugin.HWP_SetSnapDrawMode(n,-1)}setTimeout(function(){i.resolve(r)},100);return i.promise()}},{key:"JS_ClearRegion",value:function Se(){var e=zt.Deferred();var t=this.oPlugin.HWP_ClearRegion();setTimeout(function(){e.resolve(t)},100);return e.promise()}},{key:"JS_SetDrawShapeInfo",value:function _e(e,t){var n=zt.Deferred();var i=0;var r=this;var o="";if(e==="Rect"){i=this.oPlugin.HWP_SetSnapDrawMode(0,1);o="HWP_SetSnapDrawMode";if(i>=0){if(t.type===0){var s="<?xml version='1.0' encoding='utf-8'?><DetectionRegionInfo><videoFormat>PAL</videoFormat><RegionType>roi</RegionType><ROI>";s+="<HorizontalResolution>704</HorizontalResolution>"+"<VerticalResolution>576</VerticalResolution></ROI>"+"<DisplayMode>"+(t.translucent!==1?"transparent":"shelter")+"</DisplayMode>"+"<DetectionRegionList></DetectionRegionList><MaxRegionNum>"+t.maxShapeSupport+"</MaxRegionNum></DetectionRegionInfo>";i=this.oPlugin.HWP_SetRegionInfo(s);o="HWP_SetRegionInfo"}else if(t.type===1){var a="<?xml version='1.0' encoding='utf-8'?><SnapPolygonList>";a+="<SnapPolygon>";a+="<id>"+t.id+"</id>";a+="<tips>"+t.tips+"</tips>";a+="<tipsPos>"+(t.tipsPos||0)+"</tipsPos>";a+="<isClosed>false</isClosed>";a+="<polygonType>0</polygonType>";a+="<showSquare>"+t.widthHeightRate+"</showSquare>";a+="<pointList></pointList>";a+="<color><r>"+Ut.oUtils.colorRgb(t.drawColor)[0]+"</r><g>"+Ut.oUtils.colorRgb(t.drawColor)[1]+"</g><b>"+Ut.oUtils.colorRgb(t.drawColor)[2]+"</b></color>";a+="</SnapPolygon>";a+="</SnapPolygonList>";i=this.oPlugin.HWP_SetSnapPolygonInfo(a);o="HWP_SetSnapPolygonInfo"}}}else if(e==="Grid"){i=this.oPlugin.HWP_SetSnapDrawMode(0,1);o="HWP_SetSnapDrawMode";if(i>=0){var u="<?xml version='1.0'?><MoveDetection><videoFormat>PAL</videoFormat>";u+="<RegionType>grid</RegionType><Grid><rowGranularity>"+t.gridRowNum+"</rowGranularity>";u+="<columnGranularity>"+t.gridColNum+"</columnGranularity></Grid>";u+="<DisplayMode>transparent</DisplayMode><gridMap></gridMap></MoveDetection>";i=this.oPlugin.HWP_SetRegionInfo(u);o="HWP_SetRegionInfo"}}else if(e==="Polygon"){i=this.oPlugin.HWP_SetSnapDrawMode(0,2);o="HWP_SetSnapDrawMode";if(i>=0){var l="<?xml version='1.0' encoding='utf-8'?><SnapPolygonList>";l+="<SnapPolygon>";l+="<id>"+t.id+"</id>";l+="<tips>"+t.tips+"</tips>";l+="<isClosed>false</isClosed>";l+="<polygonType>1</polygonType>";l+="<PointNumMax>"+(t.maxPointSupport+1)+"</PointNumMax>";l+="<MinClosed>"+(t.minPointSupport+1)+"</MinClosed>";l+="<pointList></pointList>";l+="<color><r>"+Ut.oUtils.colorRgb(t.drawColor)[0]+"</r><g>"+Ut.oUtils.colorRgb(t.drawColor)[1]+"</g><b>"+Ut.oUtils.colorRgb(t.drawColor)[2]+"</b></color>";l+="</SnapPolygon>";l+="</SnapPolygonList>";i=this.oPlugin.HWP_SetSnapPolygonInfo(l);o="HWP_SetSnapPolygonInfo"}}else if(e==="Line"){var f='<?xml version="1.0" encoding="utf-8"?><SnapLineList>';f+="<SnapLine>";f+="<id>"+t.id+"</id>";f+="<editType>"+t.editType+"</editType>";f+="<LineTypeEx>"+t.lineType+"</LineTypeEx>";f+="<Tips>"+t.tips+"</Tips>";f+="<CustomType>"+t.direction+"</CustomType><MoveChange>"+t.mode+"</MoveChange>";if(t.lineType!==2){f+="<ArrowType>"+t.direction+"</ArrowType>";f+="<StartPos><x>"+t.points[0][0]+"</x><y>"+t.points[0][1]+"</y></StartPos><EndPos><x>"+t.points[1][0]+"</x><y>"+t.points[1][1]+"</y></EndPos>"}else{f+="<ArrowType>"+(!t.direction?0:t.direction-1)+"</ArrowType>";f+="<BreakLine>";var c=t.points&&t.points.length;if(c>0){f+="<PointList>";for(var h=0;h<c;h++){f+="<point><x>"+t.points[h][0]+"</x><y>"+t.points[h][1]+"</y></point>"}f+="</PointList>"}f+="<isClosed>"+(c>0).toString()+"</isClosed>";f+="<isShowArrow>"+(t.direction===0?"false":"true")+"</isShowArrow>";if(t.minClosed){f+="<MinClosed>"+t.minClosed+"</MinClosed>"}if(t.pointNumMax){f+="<PointNumMax>"+t.pointNumMax+"</PointNumMax>"}if(t.directionTips){f+="<directionTips>"+t.directionTips+"</directionTips>"}f+="</BreakLine>"}f+="<LineSelected>false</LineSelected>";f+="<color><r>"+Ut.oUtils.colorRgb(t.drawColor)[0]+"</r><g>"+Ut.oUtils.colorRgb(t.drawColor)[1]+"</g><b>"+Ut.oUtils.colorRgb(t.drawColor)[2]+"</b></color>";f+="</SnapLine>";f+="</SnapLineList>";i=this.oPlugin.HWP_SetSnapLineInfo(f);o="HWP_SetSnapLineInfo"}else if(e==="Point"){var d="<?xml version='1.0' encoding='utf-8'?><SnapPointList>";var p=!t.replace?0:1;d+="<mode>"+p+"</mode>";d+="<SnapPoint>";if(t.id){d+="<id>"+t.id+"</id>"}if(t.type){d+="<type>"+(t.type==="cross"?1:2)+"</type>"}if(t.drawColor){var v=Ut.oUtils.colorRgb(t.drawColor);d+="<color>";d+="<r>"+v[0]+"</r>";d+="<g>"+v[1]+"</g>";d+="<b>"+v[2]+"</b>";d+="</color>"}d+="</SnapPoint>";d+="</SnapPointList>";i=this.oPlugin.HWP_SetSnapPointInfo(0,d);o="HWP_SetSnapPointInfo";return d}setTimeout(function(){if(i<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog(o+":"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_SetGridInfo",value:function be(e){var t=zt.Deferred();var n=this;var i="<?xml version='1.0'?><MoveDetection><videoFormat>PAL</videoFormat>";i+="<RegionType>grid</RegionType><Grid><rowGranularity>"+e.gridRowNum+"</rowGranularity>";i+="<columnGranularity>"+e.gridColNum+"</columnGranularity></Grid>";i+="<DisplayMode>transparent</DisplayMode><gridMap>"+e.gridMap+"</gridMap></MoveDetection>";var r=this.oPlugin.HWP_SetRegionInfo(i);setTimeout(function(){if(r<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetRegionInfo:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetGridInfo",value:function Ce(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetRegionInfo();var n=Ut.oUtils.parseXmlFromStr(t);var i=parseInt(zt(n).find("columnGranularity").text(),10);var r=parseInt(zt(n).find("rowGranularity").text(),10);var o={gridColNum:i,gridRowNum:r,gridMap:zt(n).find("gridMap").text()};setTimeout(function(){e.resolve(o)},100);return e.promise()}},{key:"JS_SetRectInfo",value:function ke(t){var n=zt.Deferred();var i=-1;var r=this;var o="";if(t[0].type===0){var s="<?xml version='1.0' encoding='utf-8'?><DetectionRegionInfo><videoFormat>PAL</videoFormat><RegionType>roi</RegionType><ROI>";var e="transparent";if(t[0].translucent===1){e="shelter"}else if(t[0].translucent===2){e="quadrilateral"}s+="<HorizontalResolution>704</HorizontalResolution>"+"<VerticalResolution>576</VerticalResolution></ROI>"+"<DisplayMode>"+e+"</DisplayMode>"+"<DetectionRegionList>";zt.each(t,function(e){s+="<DetectionRegion>";s+="<RegionCoordinatesList>";zt.each(t[e].points,function(e,t){s+="<RegionCoordinates><positionX>"+Math.round(t[0]*704)+"</positionX>"+"<positionY>"+Math.round((1-t[1])*576)+"</positionY></RegionCoordinates>"});s+="</RegionCoordinatesList>";s+="</DetectionRegion>"});s+="</DetectionRegionList><MaxRegionNum>"+t[0].maxShapeSupport+"</MaxRegionNum></DetectionRegionInfo>";i=this.oPlugin.HWP_SetRegionInfo(s);o="HWP_SetRegionInfo"}else if(t[0].type===1){var a="<?xml version='1.0' encoding='utf-8'?><SnapPolygonList>";zt.each(t,function(e,t){a+="<SnapPolygon>";a+="<id>"+t.id+"</id>";a+="<EditType>"+(t.editType||0)+"</EditType>";a+="<tips>"+(t.tips||"")+"</tips>";a+="<tipsPos>"+(t.tipsPos||0)+"</tipsPos>";a+="<isClosed>true</isClosed>";a+="<polygonType>0</polygonType>";a+="<showSquare>"+t.widthHeightRate+"</showSquare>";a+="<pointList>";zt.each(t.points,function(e,t){a+="<point><x>"+t[0]+"</x><y>"+t[1]+"</y></point>"});a+="</pointList>";a+="<color><r>"+Ut.oUtils.colorRgb(t.drawColor)[0]+"</r><g>"+Ut.oUtils.colorRgb(t.drawColor)[1]+"</g><b>"+Ut.oUtils.colorRgb(t.drawColor)[2]+"</b></color>";a+="</SnapPolygon>"});a+="</SnapPolygonList>";i=this.oPlugin.HWP_SetSnapPolygonInfo(a);o="HWP_SetSnapPolygonInfo"}setTimeout(function(){if(i<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog(o+":"+e);n.reject()}else{n.resolve()}},100);return n.promise()}},{key:"JS_GetRectInfo",value:function Te(){var e=zt.Deferred();var n=[];var t=this.oPlugin.HWP_GetRegionInfo();var i=Ut.oUtils.parseXmlFromStr(t);zt(i).find("DetectionRegion").each(function(e){var t=[];zt(this).find("RegionCoordinatesList").find("RegionCoordinates").each(function(){t.push([parseInt(zt(this).find("positionX").text(),10)/704,1-parseInt(zt(this).find("positionY").text(),10)/576])});n.push({id:e+1,points:t})});var s=[];var r=this.oPlugin.HWP_GetSnapPolygonInfo();var o=Ut.oUtils.parseXmlFromStr(r);zt(o).find("SnapPolygon").each(function(){var e=parseInt(zt(this).find("polygonType").text(),10);if(e===0){var t=zt(this).find("id").text();var n=zt(this).find("isClosed").text()==="true";var i=zt(this).find("tips").text();var r=[];zt(this).find("pointList").find("point").each(function(){r.push([parseFloat(zt(this).find("x").text()),parseFloat(zt(this).find("y").text())])});var o={id:t,closed:n,points:r,tips:i};s.push(o)}});setTimeout(function(){if(n.length>0){e.resolve(n)}else if(s.length>0){e.resolve(s)}else{e.resolve([])}},100);return e.promise()}},{key:"JS_SetPolygonInfo",value:function Re(e){var t=zt.Deferred();var n=this;var i="<?xml version='1.0' encoding='utf-8'?><SnapPolygonList>";zt.each(e,function(e,t){if(typeof t.closed==="undefined"){t.closed=true}i+="<SnapPolygon>";i+="<id>"+t.id+"</id>";i+="<EditType>"+t.editType+"</EditType>";i+="<tips>"+t.tips+"</tips>";i+="<isClosed>"+t.closed.toString()+"</isClosed>";i+="<polygonType>1</polygonType>";i+="<pointList>";zt.each(t.points,function(e,t){i+="<point><x>"+t[0]+"</x><y>"+t[1]+"</y></point>"});i+="</pointList>";i+="<color><r>"+Ut.oUtils.colorRgb(t.drawColor)[0]+"</r><g>"+Ut.oUtils.colorRgb(t.drawColor)[1]+"</g><b>"+Ut.oUtils.colorRgb(t.drawColor)[2]+"</b></color>";i+="</SnapPolygon>"});i+="</SnapPolygonList>";var r=this.oPlugin.HWP_SetSnapPolygonInfo(i);setTimeout(function(){if(r<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetSnapPolygonInfo:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetPolygonInfo",value:function De(){var e=zt.Deferred();var l=[];var t=this.oPlugin.HWP_GetSnapPolygonInfo();var n=Ut.oUtils.parseXmlFromStr(t);zt(n).find("SnapPolygon").each(function(){var e=parseInt(zt(this).find("polygonType").text(),10);if(e===1){var t=zt(this).find("id").text();var n=zt(this).find("isClosed").text()==="true";var i=zt(this).find("tips").text();var r="#"+Ut.oUtils.colorTransfer(zt(this).find("r").text())+Ut.oUtils.colorTransfer(zt(this).find("g").text())+Ut.oUtils.colorTransfer(zt(this).find("b").text());var o=parseInt(zt(this).find("PointNumMax").text(),10);var s=parseInt(zt(this).find("MinClosed").text(),10);var a=[];zt(this).find("pointList").find("point").each(function(){a.push([parseFloat(zt(this).find("x").text()),parseFloat(zt(this).find("y").text())])});var u={id:t,points:a,closed:n,tips:i,drawColor:r,polygonType:e,pointNumMax:o,minClosed:s};l.push(u)}});setTimeout(function(){e.resolve(l)},100);return e.promise()}},{key:"JS_SetLineInfo",value:function xe(e){var t=zt.Deferred();var n=this;var r='<?xml version="1.0" encoding="utf-8"?><SnapLineList>';zt.each(e,function(e,t){r+="<SnapLine>";r+="<id>"+t.id+"</id>";r+="<editType>"+t.editType+"</editType>";r+="<LineTypeEx>"+t.lineType+"</LineTypeEx>";r+="<Tips>"+t.tips+"</Tips>";if(t.lineType!==2){r+="<MoveChange>"+t.mode+"</MoveChange>";r+="<ArrowType>"+t.direction+"</ArrowType><CustomType>"+t.direction+"</CustomType><StartPos><x>"+t.points[0][0]+"</x><y>"+t.points[0][1]+"</y></StartPos><EndPos><x>"+t.points[1][0]+"</x><y>"+t.points[1][1]+"</y></EndPos>";if(t.cutOffPositions){r+="<ParkingNoShow>true</ParkingNoShow><ParkingPointList>";zt.each(t.cutOffPositions,function(e,t){r+="<parkingWidth>"+t+"</parkingWidth>"});r+="</ParkingPointList>"}}else{r+="<ArrowType>"+(!t.direction?0:t.direction-1)+"</ArrowType><BreakLine><PointList>";var n=t.points.length;for(var i=0;i<n;i++){r+="<point><x>"+t.points[i][0]+"</x><y>"+t.points[i][1]+"</y></point>"}r+="</PointList><isClosed>"+(n>0).toString()+"</isClosed>";r+="<isShowArrow>"+(t.direction===0?"false":"true")+"</isShowArrow>";if(t.minClosed){r+="<MinClosed>"+t.minClosed+"</MinClosed>"}if(t.pointNumMax){r+="<PointNumMax>"+t.pointNumMax+"</PointNumMax>"}if(t.directionTips){r+="<directionTips>"+t.directionTips+"</directionTips>"}r+="</BreakLine>"}r+="<LineSelected>false</LineSelected>";r+="<color><r>"+Ut.oUtils.colorRgb(t.drawColor)[0]+"</r><g>"+Ut.oUtils.colorRgb(t.drawColor)[1]+"</g><b>"+Ut.oUtils.colorRgb(t.drawColor)[2]+"</b></color>";r+="</SnapLine>"});r+="</SnapLineList>";var i=this.oPlugin.HWP_SetSnapLineInfo(r);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetSnapPolygonInfo:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetLineInfo",value:function Ie(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetSnapLineInfo();var n=Ut.oUtils.parseXmlFromStr(t);var p=[];zt(n).find("SnapLine").each(function(){var e=parseInt(zt(this).find("id").text(),10);var t=parseInt(zt(this).find("LineTypeEx").text(),10);var n=zt(this).find("tips").text();var i=void 0;if(t===3){i=parseInt(zt(this).find("CustomType").text(),10)||parseInt(zt(this).find("LineType").text(),10)}else if(t===1||t===4){i=parseInt(zt(this).find("ArrowType").text(),10)}else if(t===2){var r=parseInt(zt(this).find("ArrowType").text(),10);if(isNaN(r)){r=1}else{r+=1}i=r}var o=[];var s=[];var a=[];var u=false;var l=[];var f=false;var c=false;var h={bShow:false,aPoints:[]};if(t!==2){o.push([parseFloat(zt(this).find("StartPos").find("x").text()),parseFloat(zt(this).find("StartPos").find("y").text())]);o.push([parseFloat(zt(this).find("EndPos").find("x").text()),parseFloat(zt(this).find("EndPos").find("y").text())]);if(t===4){s.push([parseFloat(zt(this).find("Demarcation").find("Sp_x").text()),parseFloat(zt(this).find("Demarcation").find("Sp_y").text())]);s.push([parseFloat(zt(this).find("Demarcation").find("Ep_x").text()),parseFloat(zt(this).find("Demarcation").find("Ep_y").text())]);a.push([parseFloat(zt(this).find("PDCArrow").find("Sp_x").text()),parseFloat(zt(this).find("PDCArrow").find("Sp_y").text())]);a.push([parseFloat(zt(this).find("PDCArrow").find("Ep_x").text()),parseFloat(zt(this).find("PDCArrow").find("Ep_y").text())]);u="true"===zt(this).find("PDCShowMark").text()}if(t===5){h.bShow=true;h.aPoints.length=0;zt(this).find("PN_Width").each(function(){h.aPoints.push(parseFloat(zt(this).text()))})}}else{zt(this).find("BreakLine").find("point").each(function(){o.push([parseFloat(zt(this).find("x").text()),parseFloat(zt(this).find("y").text())])});f="true"===zt(this).find("isShowArrow").text();c="true"===zt(this).find("isClosed").text();if(f){zt(this).find("BreakLine").find("BLArrow").each(function(){l.push([[parseFloat(zt(this).find("Sp_x").text()),parseFloat(zt(this).find("Sp_y").text())],[parseFloat(zt(this).find("Ep_x").text()),parseFloat(zt(this).find("Ep_y").text())]])})}}var d={id:e,lineType:t,tips:n,points:o,direction:i,demarcation:s,pdcArrow:a,showMark:u,showArrow:f,arrowList:l,bClosed:c};if(h.bShow){d.cutOffPositions=h.aPoints}p.push(d)});setTimeout(function(){e.resolve(p)},100);return e.promise()}},{key:"JS_SetTextOverlay",value:function Ee(e){var t=zt.Deferred();var n=this;var i=e.channelName.name.replace(/&/g,"&amp;");i=i.replace(/</g,"&lt;");var r=e.width?e.width:704;var o=e.height?e.height:576;var s="<?xml version='1.0' encoding='UTF-8'?><OSD>"+"<videoResolutionWidth>"+r+"</videoResolutionWidth><videoResolutionHeight>"+o+"</videoResolutionHeight>"+"<channelNameOverlay><enabled>"+e.channelName.enable+"</enabled><ChannelName>"+i+"</ChannelName>"+"<alignment>"+e.channelName.alignment+"</alignment>"+"<minMoveValue>"+e.minMoveValue+"</minMoveValue>"+"<positionX>"+Math.round(e.channelName.point[0]*r)+"</positionX>"+"<positionY>"+Math.round(e.channelName.point[1]*o)+"</positionY></channelNameOverlay>"+"<DateTimeOverlay><enabled>"+e.date.enable+"</enabled><type>"+e.date.dateType+"</type>"+"<clockType>"+e.date.timeFormat+"</clockType><displayWeek>"+e.date.showWeekDay+"</displayWeek>"+"<alignment>"+e.date.alignment+"</alignment>"+"<minMoveValue>"+e.minMoveValue+"</minMoveValue>"+"<positionX>"+Math.round(e.date.point[0]*r)+"</positionX>"+"<positionY>"+Math.round(e.date.point[1]*o)+"</positionY></DateTimeOverlay>"+"<TextOverlayList>";for(var a=0,u=e.text.length;a<u;a++){var l=e.text[a].text.replace(/&/g,"&amp;");l=l.replace(/</g,"&lt;");s+="<TextOverlay>";s+="<id>"+e.text[a].id+"</id><enabled>"+e.text[a].enable+"</enabled>"+"<alignment>"+e.text[a].alignment+"</alignment>"+"<minMoveValue>"+e.minMoveValue+"</minMoveValue>"+"<positionX>"+Math.round(e.text[a].point[0]*r)+"</positionX>"+"<positionY>"+Math.round(e.text[a].point[1]*o)+"</positionY>"+"<displayText>"+l+"</displayText>";s+="</TextOverlay>"}s+="</TextOverlayList></OSD>";var f=this.oPlugin.HWP_SetTextOverlay(s);setTimeout(function(){if(f<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetTextOverlay:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetTextOverlay",value:function qe(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetTextOverlay();var n=Ut.oUtils.parseXmlFromStr(t);var i={};var r=zt(n).find("channelNameOverlay").eq(0);var o=zt(n).find("DateTimeOverlay").eq(0);var s=zt(n).find("TextOverlayList").eq(0);var a=parseInt(zt(n).find("videoResolutionWidth").eq(0).text(),10);var u=parseInt(zt(n).find("videoResolutionHeight").eq(0).text(),10);i.channelName={enable:zt(r).find("enabled").eq(0).text()==="true",name:zt(r).find("name").eq(0).text(),alignment:0,point:[zt(r).find("positionX").eq(0).text()/a,zt(r).find("positionY").eq(0).text()/u]};i.date={enable:zt(o).find("enabled").eq(0).text()==="true",alignment:parseInt(zt(o).find("alignment").eq(0).text(),10)||0,dateType:parseInt(zt(o).find("type").eq(0).text(),10)||0,timeFormat:zt(o).find("clockType").eq(0).text(),showWeekDay:zt(o).find("displayWeek").eq(0).text()==="true",point:[zt(o).find("positionX").eq(0).text()/a,zt(o).find("positionY").eq(0).text()/u]};i.text=[];for(var l=0,f=zt(s).find("TextOverlay").length;l<f;l++){var c=zt(s).find("TextOverlay").eq(l);var h={id:zt(c).find("id").eq(0).text(),enable:zt(c).find("enabled").eq(0).text()==="true",alignment:parseInt(zt(c).find("alignment").eq(0).text(),10)||0,text:zt(c).find("displayText").eq(0).text(),point:[zt(c).find("positionX").eq(0).text()/a,zt(c).find("positionY").eq(0).text()/u]};i.text.push(h)}setTimeout(function(){e.resolve(i)},100);return e.promise()}},{key:"JS_ClearShapeByType",value:function Ae(t,e){var n=zt.Deferred();var i=0;var r=this;var o=0;if(t==="Rect"){o=0}else if(t==="Polygon"){o=1}else if(t==="Line"){o=2}else if(t==="All"){o=4;this.oPlugin.HWP_ClearDrawLineInfo(0)}else if(t==="Choosed"){o=6}else if(t==="Point"){o=5}if(e&&e.length>0&&(o===0||o===1)){var s='<?xml version="1.0" encoding="utf-8"?><SnapPolygonList>';for(var a=0,u=e.length;a<u;a++){s+="<SnapPolygon><id>"+e[a]+"</id><polygonType>"+o+"</polygonType></SnapPolygon>"}s+="</SnapPolygonList>";i=this.oPlugin.HWP_ClearTargetPolygon(s);setTimeout(function(){if(i<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_ClearTargetPolygon:"+e);n.reject()}else{n.resolve()}},100)}else{i=this.oPlugin.HWP_ClearSnapInfo(o);setTimeout(function(){if("Choosed"===t){n.resolve(i);return}if(i<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_ClearSnapInfo:"+e);n.reject()}else{n.resolve(i)}},100)}return n.promise()}},{key:"JS_SetCorrectionType",value:function Oe(e){var t=zt.Deferred();var n=0;var i=this;if(e===1){n=this.oPlugin.HWP_SetPlayModeType(7)}else{n=this.oPlugin.HWP_SetPlayModeType(7)}n=this.oPlugin.HWP_SetCorrectionType(e);setTimeout(function(){if(n<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetCorrectionType:"+e);t.reject(n)}else{t.resolve()}},100);return t.promise()}},{key:"JS_SetPlaceType",value:function Me(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_SetPlaceType(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetPlaceType:"+e);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_StartFishListener",value:function Le(e,t,n){var i=zt.Deferred();var r=this;var o=this.oPlugin.HWP_StartFishListener(e,t,n);setTimeout(function(){if(o<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_StartFishListener:"+e);i.reject(o)}else{i.resolve()}},100);return i.promise()}},{key:"JS_StopFishListener",value:function Fe(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StopFishListener();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StopFishListener:"+e);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_SetFishBoxListInfo",value:function We(e){var t=zt.Deferred();var n=this;var i='<?xml version="1.0" encoding="utf-8"?><FishBoxList>';zt.each(e,function(e,t){i+="<PointPos>";i+="<id>"+t.id+"</id>";i+="<xPoint>"+t.xPoint+"</xPoint>";i+="<yPoint>"+t.yPoint+"</yPoint>";i+="<zPoint>"+t.zPoint+"</zPoint>";i+="</PointPos>"});i+="</FishBoxList>";var r=this.oPlugin.HWP_SetFishBoxListInfo(i);setTimeout(function(){if(r<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetFishBoxListInfo:"+e);t.reject(r)}else{t.resolve()}},100);return t.promise()}},{key:"JS_GetFishBoxListInfo",value:function Ne(){var e=zt.Deferred();var t=this.oPlugin.HWP_FECGetBoxPosList();var n=Ut.oUtils.parseXmlFromStr(t);var r=[];zt(n).find("PointPos").each(function(){var e=parseInt(zt(this).find("id").text(),10);var t=parseFloat(zt(this).find("xPoint").text());var n=parseFloat(zt(this).find("yPoint").text());var i=parseFloat(zt(this).find("zPoint").text());r.push({id:e,xPoint:t,yPoint:n,zPoint:i})});setTimeout(function(){e.resolve(r)},100);return e.promise()}},{key:"JS_ClearAllWndFishBoxInfo",value:function Be(){var e=zt.Deferred();this.oPlugin.HWP_ClearAllWndFishBoxInfo();setTimeout(function(){e.resolve()},100);return e.promise()}},{key:"JS_SetFishWndProperty",value:function ze(e,t,n){var i=zt.Deferred();var r=this.oPlugin.HWP_SetFishWndPty(e,t,n);var o=this;setTimeout(function(){if(r<0){var e=o.oPlugin.HWP_GetLastError();o.ConsoleLog("HWP_SetFishWndPty:"+e);i.reject(r)}else{i.resolve()}},100);return i.promise()}},{key:"JS_SetFishParams",value:function Je(e,t,n,i){var r=zt.Deferred();var o=this;var s='<?xml version="1.0" encoding="utf-8"?><FishParams><CoreParams>';s+="<top>"+e+"</top>";s+="<right>"+t+"</right>";s+="<bottom>"+n+"</bottom>";s+="<left>"+i+"</left>";s+="</CoreParams></FishParams>";var a=this.oPlugin.HWP_SetFishParams(s);setTimeout(function(){if(a<0){var e=o.oPlugin.HWP_GetLastError();o.ConsoleLog("HWP_SetFishParams:"+e);r.reject(a)}else{r.resolve()}},100);return r.promise()}},{key:"JS_ArrangeFECWindow",value:function He(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_ArrangeFECWindow(e,"");setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_ArrangeFECWindow:"+e);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_StartFECScan",value:function Ue(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StartFECScan(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StartFECScan:"+e);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_StopFECScan",value:function je(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StopFECScan();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StopFECScan:"+e);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_FishEyePTZ",value:function Ge(e,t){var n=zt.Deferred();var i=0;var r=this;var o="";if(e===4){i=this.oPlugin.HWP_FECZoomIn(t);o="HWP_FECZoomIn"}else if(e===5){i=this.oPlugin.HWP_FECZoomOut(t);o="HWP_FECZoomOut"}else{i=this.oPlugin.HWP_FECPTZ(t);o="HWP_FECPTZ"}setTimeout(function(){if(i<0){var e=r.oPlugin.HWP_GetLastError();r.ConsoleLog(o+":"+e);n.reject(i)}else{n.resolve()}},100);return n.promise()}},{key:"JS_FishEyeGetPreset",value:function Ve(){var e=zt.Deferred();var t=this.oPlugin.HWP_FECGetPreset();var n=Ut.oUtils.parseXmlFromStr(t);var i=parseFloat(zt(n).find("xPoint").text());var r=parseFloat(zt(n).find("yPoint").text());var o=parseFloat(zt(n).find("zPoint").text());var s={xPoint:i,yPoint:r,zPoint:o};setTimeout(function(){e.resolve(s)},100);return e.promise()}},{key:"JS_FishEyeSetPreset",value:function Ye(e){var t=zt.Deferred();var n=this;var i='<?xml version="1.0" encoding="utf-8"?><FishEyePreset>';i+="<xPoint>"+e.xPoint+"</xPoint>";i+="<yPoint>"+e.yPoint+"</yPoint>";i+="<zPoint>"+e.zPoint+"</zPoint>";i+="</FishEyePreset>";var r=this.oPlugin.HWP_FECSetPreset(i);setTimeout(function(){if(r<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_FECSetPreset:"+e);t.reject(r)}else{t.resolve()}},100);return t.promise()}},{key:"JS_StartFECCruise",value:function Xe(e){var t=zt.Deferred();var n=this;var i='<?xml version="1.0" encoding="utf-8"?><FishEyePresetList>';zt.each(e,function(e,t){i+="<Preset>";i+="<xPoint>"+t.xPoint+"</xPoint>";i+="<yPoint>"+t.yPoint+"</yPoint>";i+="<zPoint>"+t.zPoint+"</zPoint>";i+="<time>"+t.time+"</time>";i+="</Preset>"});i+="</FishEyePresetList>";var r=this.oPlugin.HWP_StartFECCruise(i);setTimeout(function(){if(r<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StartFECCruise:"+e);t.reject(r)}else{t.resolve()}},100);return t.promise()}},{key:"JS_StopFECCruise",value:function Ze(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StopFECCruise();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StopFECCruise:"+e);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_SetIsHttps",value:function Ke(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_SetIsHttps(e);setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetIsHttps:"+e);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_SetReconnectInfo",value:function $e(e,t){var n=zt.Deferred();var i=this;var r=this.oPlugin.HWP_SetReconnectInfo(e,t);setTimeout(function(){if(r<0){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_SetReconnectInfo:"+e);n.reject(r)}else{n.resolve()}},100);return n.promise()}},{key:"JS_CheckUpdate",value:function Qe(e){var t=zt.Deferred();var n=this;try{var i=e.replace(/<\blocalServiceControl.*<\/localServiceControl\b>/,"");var r=this.oPlugin.HWP_CheckPluginUpdate(i);setTimeout(function(){t.resolve(r)},100)}catch(o){n.ConsoleLog("HWP_CheckPluginUpdate:"+o);t.reject(o)}return t.promise()}},{key:"JS_SelectShape",value:function et(e,t){var n=zt.Deferred();var i=0;if(e==="Rect"){i=0}else if(e==="Polygon"){i=1}else if(e==="Line"){i=2}else if(e==="All"){i=4;this.oPlugin.HWP_ClearDrawLineInfo(0)}var r=this.oPlugin.HWP_SelectDraw(0,i,t);setTimeout(function(){n.resolve(r)},100);return n.promise()}},{key:"JS_GetPictureSize",value:function tt(e){var t=zt.Deferred();var n=this.oPlugin.HWP_GetPictureSize(e);setTimeout(function(){t.resolve({width:parseInt(n.split("*")[0],10),height:parseInt(n.split("*")[1],10)})},100);return t.promise()}},{key:"JS_SetOriginResolution",value:function nt(e,t,n){var i=zt.Deferred();var r=this.oPlugin.HWP_setOriginResolution(e,t,n);setTimeout(function(){i.resolve(r)},100);return i.promise()}},{key:"JS_SetPlayWndMode",value:function it(e,t,n){var i=zt.Deferred();if(n){e=64}var r=this.oPlugin.HWP_setPlayWndMode(e,t);setTimeout(function(){i.resolve(r)},100);return i.promise()}},{key:"JS_UpdateWindowStyle",value:function rt(){var e=new Promise(function(e){e()});return e}},{key:"JS_CuttingPartWindow",value:function ot(){var e=new Promise(function(e){e()});return e}},{key:"JS_RepairPartWindow",value:function st(){var e=new Promise(function(e){e()});return e}},{key:"JS_SetPointInfo",value:function at(e,t){var n='<?xml version="1.0" encoding="utf-8"?><SnapLineList>';var i="<?xml version='1.0' encoding='utf-8'?><SnapPointList>";t=t?t:0;i+="<mode>"+t+"</mode>";i+="<maxPointNum>1</maxPointNum>";var r=false;if(e){zt.each(e,function(){var e="";if(this.id>0){e+="<id>"+this.id+"</id>"}if(this.drawColor){var t=Ut.oUtils.colorRgb(this.drawColor);e+="<color>";e+="<r>"+t[0]+"</r>";e+="<g>"+t[1]+"</g>";e+="<b>"+t[2]+"</b>";e+="</color>"}if(this.tips){e+="<Tips>"+this.tips+"</Tips>"}if(this.editType||this.editType===0){e+="<editType>"+this.editType+"</editType>"}if(this.lineType===2){r=true;n+="<SnapLine>";n+=e+"<LineTypeEx>2</LineTypeEx>"+"<StartPos>"+"<x></x>"+"<y></y>"+"</StartPos>"+"<EndPos>"+"<x></x>"+"<y></y>"+"</EndPos>"+"<BreakLine>"+"<isClosed>true</isClosed>"+"<MinClosed>1</MinClosed>"+"<PointNumMax>1</PointNumMax>";if(this.points&&this.points.length>0){n+="<pointList><point><x>"+this.points[0]+"</x><y>"+this.points[1]+"</y></point></pointList>"}n+="</BreakLine>"+"</SnapLine>"}else{i+="<SnapPoint>"+e;if(this.type){i+="<type>"+(this.type==="circle"?2:1)+"</type>"}if(this.points){i+="<position>";i+="<positionX>"+this.points[0]+"</positionX>";i+="<positionY>"+this.points[1]+"</positionY>";i+="</position>"}i+="</SnapPoint>"}})}i+="</SnapPointList>";n+="</SnapLineList>";var o=zt.Deferred();var s=void 0;if(r){s=this.oPlugin.HWP_SetSnapLineInfo(n)}else{s=this.oPlugin.HWP_SetSnapPointInfo(0,i)}setTimeout(function(){o.resolve(s)},100);return o.promise()}},{key:"JS_GetPointInfo",value:function ut(){var e=Ut.oUtils.parseXmlFromStr(this.oPlugin.HWP_GetSnapPointInfo(0));var t=Ut.oUtils.parseXmlFromStr(this.oPlugin.HWP_GetSnapLineInfo());var n=[];zt(e).find("SnapPoint").each(function(){n.push({id:parseInt(zt(this).find("id").text(),10),drawColor:"#"+Ut.oUtils.colorTransfer(zt(this).find("color r").text())+Ut.oUtils.colorTransfer(zt(this).find("color g").text())+Ut.oUtils.colorTransfer(zt(this).find("color b").text()),type:zt(this).find("type").text()==="2"?"circle":"cross",replace:parseInt(zt(e).find("mode").text(),10)===1,point:[parseFloat(zt(e).find("positionX").text()),parseFloat(zt(e).find("positionY").text())]})});zt(t).find("SnapLine").each(function(){if(zt(this).find("BreakLine point").length===1){n.push({id:parseInt(zt(this).find("id").text(),10),drawColor:"#"+Ut.oUtils.colorTransfer(zt(this).find("color r").text())+Ut.oUtils.colorTransfer(zt(this).find("color g").text())+Ut.oUtils.colorTransfer(zt(this).find("color b").text()),type:"cross",replace:false,point:[parseFloat(zt(this).find("BreakLine x").text()),parseFloat(zt(this).find("BreakLine y").text())]})}});var i=zt.Deferred();setTimeout(function(){i.resolve(n)},100);return i.promise()}},{key:"JS_PlayWithImg",value:function lt(){return Promise.resolve()}},{key:"JS_DestroyAll",value:function ft(){this.JS_DestroyPlugin();return Promise.resolve()}},{key:"JS_SetPackageType",value:function ct(e){this.oPlugin.HWP_SetPackageType(e);return Promise.resolve()}},{key:"JS_GetPlayInfo",value:function ht(e){var t=this.oPlugin.HWP_GetPictureSize(e);var n=t.split("*");var i={pictureSize:{width:parseInt(n[0],10),height:parseInt(n[1],10)}};return Promise.resolve(i)}},{key:"JS_SetZeroChanInfo",value:function dt(e,t,n){this.oPlugin.HWP_SetZeroChanInfo(e,t,n);return Promise.resolve()}},{key:"JS_SetSnapDrawWndIndex",value:function pt(e){this.oPlugin.HWP_SetSnapDrawWndIndex(e);return Promise.resolve()}},{key:"JS_SetWindowSelected",value:function vt(e){this.oPlugin.HWP_SetWindowSelected(e);return Promise.resolve()}},{key:"JS_GetEngineSupport",value:function mt(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetEngineSupport();var n=Ut.oUtils.parseXmlFromStr(t);var i={HardDecodeCap:{GPUType:zt(n).find("HardDecodeCap GPUType").eq(0).text(),D3D9Support:zt(n).find("HardDecodeCap D3D9Support").eq(0).text(),D3D11Support:zt(n).find("HardDecodeCap D3D11Support").eq(0).text()},RenderCap:{DDrawSupport:zt(n).find("RenderCap DDrawSupport").eq(0).text(),D3D9SurfaceSupport:zt(n).find("RenderCap D3D9SurfaceSupport").eq(0).text(),D3D9TextureSupport:zt(n).find("RenderCap D3D9TextureSupport").eq(0).text(),D3D11Support:zt(n).find("RenderCap D3D11Support").eq(0).text()}};setTimeout(function(){if(!i){e.reject()}else{e.resolve(i)}},100);return e.promise()}},{key:"JS_ExistGetSlfPointList",value:function yt(){var e=zt.Deferred();var t=typeof this.oPlugin.HWP_GetSlfPointList!=="undefined";setTimeout(function(){e.resolve(t)},100);return e.promise()}},{key:"JS_GetSlfPointList",value:function gt(e,t){var n=zt.Deferred();var i=this.oPlugin.HWP_GetSlfPointList(e,t);var r=Ut.oUtils.parseXmlFromStr(i);var o=[];zt(r).find("SLFPoint").each(function(){var e={x:zt(this).find("ImagePoint").eq(0).find("x").eq(0).text(),y:zt(this).find("ImagePoint").eq(0).find("y").eq(0).text(),p:zt(this).find("PTZValue").eq(0).find("p").eq(0).text(),t:zt(this).find("PTZValue").eq(0).find("t").eq(0).text(),z:zt(this).find("PTZValue").eq(0).find("z").eq(0).text()};o.push(e)});setTimeout(function(){n.resolve(o)},100);return n.promise()}},{key:"JS_GetSlfVersion",value:function Pt(){var e=zt.Deferred();var t=this.oPlugin.HWP_GetSlfVersion();setTimeout(function(){e.resolve(t)},100);return e.promise()}},{key:"JS_AudioPlay",value:function wt(e,t,n,i,r){var o=zt.Deferred();var s=this;var a=null;if(r){a=this.oPlugin.HWP_StartAudioPlayEx(e,t,n,i,r)}else{a=this.oPlugin.HWP_StartAudioPlay(e,t,n,i)}setTimeout(function(){if(a<0){a=s.oPlugin.HWP_GetLastError();s.ConsoleLog("HWP_StartAudioPlayEx:"+a);o.reject(a)}else{o.resolve()}},100);return o.promise()}},{key:"JS_StartSycAudioPlay",value:function St(e,t,n,i){var r=zt.Deferred();var o=this;var s=null;s=this.oPlugin.HWP_StartSycAudioPlay(n,e,t,i);setTimeout(function(){if(s<0){s=o.oPlugin.HWP_GetLastError();o.ConsoleLog("HWP_StartSycAudioPlay:"+s);r.reject(s)}else{r.resolve()}},100);return r.promise()}},{key:"JS_GetDownFilePath",value:function _t(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_GetDownLoadFilePath(e);console.log("JS_GetDownFilePath");console.log(i);setTimeout(function(){if(i){t.resolve(i)}else{i=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_GetDownLoadFilePath:"+i);t.reject(i)}},100);return t.promise()}},{key:"JS_DeleteDownLoadFile",value:function bt(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_DeleteDownLoadFile(e);setTimeout(function(){if(i){t.resolve(i)}else{i=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_DeleteDownLoadFile:"+i);t.reject(i)}},100);return t.promise()}},{key:"JS_SycVideoAndAudio",value:function Ct(e,t,n){var i=zt.Deferred();var r=this;var o=zt(t).find("files").eq(0).text();var s=zt(n).find("files").eq(0).text();var a="<merges><outpath>"+e+"</outpath>";a+="<videos>"+o+"</videos>";a+="<audios>"+s+"</audios>";a+="</merges>";var u=this.oPlugin.HWP_SycVideoAndAudio(a);setTimeout(function(){if(u){i.resolve(u)}else{u=r.oPlugin.HWP_GetLastError();r.ConsoleLog("HWP_SycVideoAndAudio:"+u);i.reject(u)}},100);return i.promise()}},{key:"JS_StopSycAudioPlay",value:function kt(e){var t=zt.Deferred();var n=this;var i=null;i=this.oPlugin.HWP_StopSycAudioPlay(e);setTimeout(function(){if(i<0){i=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StopSycAudioPlay:"+i);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_SetAudioPlayStatus",value:function Tt(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_SetAudioPlayStatus(e);setTimeout(function(){if(i<0){i=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_SetAudioPlayStatus:"+i);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_StopAudioPlay",value:function Rt(){var e=zt.Deferred();var t=this;var n=this.oPlugin.HWP_StopAudioPlay();setTimeout(function(){if(n<0){n=t.oPlugin.HWP_GetLastError();t.ConsoleLog("HWP_StopAudioPlay:"+n);e.reject(n)}else{e.resolve()}},100);return e.promise()}},{key:"JS_StartAudioSave",value:function Dt(e){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_StartAudioRecord(e);setTimeout(function(){if(i<0){i=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_StartAudioRecord:"+i);t.reject(i)}else{t.resolve()}},100);return t.promise()}},{key:"JS_StopAudioSave",value:function xt(){var e=zt.Deferred();var t=this;var n=this.oPlugin.HWP_StopAudioRecord();setTimeout(function(){if(n<0){n=t.oPlugin.HWP_GetLastError();t.ConsoleLog("HWP_StopAudioRecord:"+n);e.reject(n)}else{e.resolve()}},100);return e.promise()}},{key:"JS_GetAudioPlayedTime",value:function It(){var t=zt.Deferred();var n=-1;var i=this;n=this.oPlugin.HWP_GetAudioPlayedTime();setTimeout(function(){if(n<0||!n){var e=i.oPlugin.HWP_GetLastError();i.ConsoleLog("HWP_GetAudioPlayedTime:"+e);t.reject()}else{t.resolve(n)}},100);return t.promise()}},{key:"JS_AudioPause",value:function Et(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_AudioPlayPasue();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_AudioPlayPasue:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_AudioResume",value:function qt(){var t=zt.Deferred();var n=this;var i=this.oPlugin.HWP_AudioPlayResume();setTimeout(function(){if(i<0){var e=n.oPlugin.HWP_GetLastError();n.ConsoleLog("HWP_AudioPlayPasue:"+e);t.reject()}else{t.resolve()}},100);return t.promise()}},{key:"JS_StartAlarmChan",value:function At(e,t,n,i){return this.runPluginMethod("HWP_StartAlarmChan",[e,t,n],i)}},{key:"JS_StopAlarmChan",value:function Ot(e){return this.runPluginMethod("HWP_StopAlarmChan",[],e)}},{key:"JS_StartFormAsynUpload",value:function Mt(e,t){var n=typeof e==="undefined"?"undefined":Jt(e);var i="";if("object"===n){var r=new jt["default"].Builder;i=r.buildObject({UploadInfo:e})}else if("string"===n){i=e}else{return Promise.reject("")}return this.runPluginMethod("HWP_StartFormAsynUpload",[i],t)}},{key:"JS_StopFormAsynUpload",value:function Lt(e){return this.runPluginMethod("HWP_StopFormAsynUpload",[],e)}},{key:"JS_IsPluginExist",value:function Ft(){var e=false;var t=null;try{t=new ActiveXObject("WebVideoActiveX.WebVideoActiveXCtrl.1")}catch(n){t=null}if(null!==t){e=true}else{e=false}return e}},{key:"runPluginMethod",value:function Wt(e,t,n){var i=zt.Deferred();var r=this;var o={iRet:-1};var s=setTimeout(function(){i.reject(e+" time out ")},n);var a=void 0;Object.defineProperty(o,"iRet",{enumerable:true,configurable:true,set:function l(e){if(s){clearTimeout(s)}if(e<0){i.reject(e)}else{i.resolve(e)}a=e},get:function f(){return a}});try{if(this.oPlugin){switch(e){case"HWP_StartAlarmChan":o.iRet=this.oPlugin.HWP_StartAlarmChan(t[0],t[1],t[2]);break;case"HWP_StopAlarmChan":o.iRet=this.oPlugin.HWP_StopAlarmChan();break;case"HWP_StartFormAsynUpload":o.iRet=this.oPlugin.HWP_StartFormAsynUpload(t[0]);break;case"HWP_StopFormAsynUpload":o.iRet=this.oPlugin.HWP_StopFormAsynUpload();break;default:break}if(o.iRet<0){var u=r.oPlugin.HWP_GetLastError();r.ConsoleLog(e+":"+u)}}else{i.reject("without plugin")}}catch(c){r.ConsoleLog(e+":"+c);i.reject(c)}return i.promise()}},{key:"reactive",value:function Nt(e,t,n){var i=this;var r="__"+e+"Get";var o="__"+e+"Set";var s=void 0;Object.defineProperty(this,e,{get:function a(){zt(document.body).trigger(r,{value:s});if(t&&typeof t==="function"){return t.bind(i)(s)}return s},set:function u(e){zt(document.body).trigger(o,{oldValue:s,newValue:e});if(n&&typeof n==="function"){n.bind(i)(s,e)}else{s=e}}})}},{key:"JS_SetPicInfoToPlayer",value:function Bt(e,t,n,i){var r=zt.Deferred();var o=this.oPlugin.HWP_SetPicInfoToPlayer(e,t,n,i);var s=this;setTimeout(function(){if(o<0){o=s.oPlugin.HWP_GetLastError();r.reject(o)}else{r.resolve()}},100);return r.promise()}}]);return i}();return e}();i.ActiveXControl=n}).call(this,r(1))},function(e){e.exports=JSON.parse('{"version":"V1.0.0 build230210","playCrtl":"V7.4.0.1","pluginVersion":"V3.0.7.50","localServiceVersion":"V1.0.38"}')}])});
\ No newline at end of file
diff --git a/static/hk/webVideoCtrl.js b/static/hk/webVideoCtrl.js
new file mode 100644
index 0000000..60cdfb8
--- /dev/null
+++ b/static/hk/webVideoCtrl.js
@@ -0,0 +1,4261 @@
+import $ from "jquery";
+const WebVideoCtrl = function() {
+  var m_szWidth = "100%";
+  var m_szHeight = "100%";
+  var m_options = {
+    szversion: "V3.3.0 build20230314",
+    szContainerID: "",
+    szColorProperty: "",
+    szBasePath: "",
+    iWndowType: 1,
+    bWndFull: true,
+    iPackageType: 2,
+    bDebugMode: true,
+    cbSelWnd: null,
+    cbDoubleClickWnd: null,
+    cbEvent: null,
+    cbInitPluginComplete: null
+  };
+  var m_pluginOBJECT = null;
+  var m_iSelWnd = 0;
+  var m_bFullScreen = false;
+  var m_deviceSet = [];
+  var m_wndSet = [];
+  var m_ISAPIProtocol = null;
+  var m_utilsInc = null;
+  var m_webVideoCtrl = this;
+  var m_oLocalCfg = null;
+  var PROTOCOL_DEVICE_ISAPI = 1;
+  var ERROR_CODE_UNKNOWN = 1e3;
+  var ERROR_CODE_NETWORKERROR = 1001;
+  var ERROR_CODE_PARAMERROR = 1002;
+  var ERROR_CODE_LOGIN_NOLOGIN = 2e3;
+  var ERROR_CODE_LOGIN_REPEATLOGIN = 2001;
+  var ERROR_CODE_LOGIN_NOSUPPORT = 2002;
+  var ERROR_CODE_PLAY_PLUGININITFAIL = 3e3;
+  var ERROR_CODE_PLAY_NOREPEATPLAY = 3001;
+  var ERROR_CODE_PLAY_PLAYBACKABNORMAL = 3002;
+  var ERROR_CODE_PLAY_PLAYBACKSTOP = 3003;
+  var ERROR_CODE_PLAY_NOFREESPACE = 3004;
+  var ERROR_CODE_TALK_FAIL = 5e3;
+  var HTTP_STATUS_OK_200 = 200;
+  var HTTP_STATUS_ERROR_403 = 403;
+  var PLAY_STATUS_STOP = 0;
+  var PLAY_STATUS_REALPLAY = 1;
+  var PLAY_STATUS_PLAYBACK = 2;
+  var PLAY_STATUS_PAUSE = 3;
+  var PLAY_STATUS_FRAME = 4;
+  var PLAY_STATUS_REVERSE_PLAYBACK = 5;
+  var PLAY_STATUS_REVERSE_PAUSE = 6;
+  var PROTOCOLTYPE_PLAY_TCP = 0;
+  var PROTOCOLTYPE_PLAY_UDP = 1;
+  var DEVICE_TYPE_IPCAMERA = "IPCamera";
+  var DEVICE_TYPE_IPDOME = "IPDome";
+  var DEVICE_TYPE_IPZOOM = "IPZoom";
+  var DEVICE_TYPE_GATEWAY = "Gateway";
+  var m_szVersion = "<?xml version='1.0' encoding='utf-8'?><FileVersion>" + "<Platform name='win32'>" + "<localServiceControl>1.0.0.40</localServiceControl>";
+  "</Platform>" + "</FileVersion>";
+  var _onGetSelectWndInfo = function(iWnd) {
+    m_iSelWnd = iWnd;
+    if (m_options.cbSelWnd) {
+      var arrXml = [];
+      arrXml.push("<RealPlayInfo>");
+      arrXml.push("<SelectWnd>" + m_iSelWnd + "</SelectWnd>");
+      arrXml.push("</RealPlayInfo>");
+      m_options.cbSelWnd(m_utilsInc.loadXML(arrXml.join("")))
+    }
+  };
+  var _onMouseEvent = function(oData) {
+    if (m_options.cbDoubleClickWnd && 2 === oData.eventType) {
+      if (m_options.bWndFull) {
+        var iIndex = m_webVideoCtrl.findWndIndexByIndex(oData.wndIndex);
+        if (iIndex != -1) {
+          m_bFullScreen = !m_bFullScreen
+        }
+      }
+      m_options.cbDoubleClickWnd(oData.wndIndex, m_bFullScreen)
+    }
+  };
+  var _onPluginEventHandler = function(iWndIndex, iErrorCode, oError) {
+    var iNewError = ERROR_CODE_UNKNOWN;
+    if (0 === iErrorCode) {
+      iNewError = ERROR_CODE_PLAY_PLAYBACKABNORMAL
+    } else if (2 === iErrorCode) {
+      iNewError = ERROR_CODE_PLAY_PLAYBACKSTOP
+    } else if (3 === iErrorCode) {
+      iNewError = ERROR_CODE_TALK_FAIL
+    } else if (21 === iErrorCode) {
+      iNewError = ERROR_CODE_PLAY_NOFREESPACE
+    }
+    if (ERROR_CODE_PLAY_PLAYBACKABNORMAL == iNewError || ERROR_CODE_PLAY_PLAYBACKSTOP == iNewError) {
+      m_webVideoCtrl.I_Stop(iWndIndex)
+    } else if (ERROR_CODE_PLAY_NOFREESPACE == iNewError) {
+      m_webVideoCtrl.I_StopRecord(iWndIndex)
+    } else if (ERROR_CODE_TALK_FAIL == iNewError) {
+      m_webVideoCtrl.I_StopVoiceTalk()
+    } else {}
+    if (m_options.cbEvent) {
+      m_options.cbEvent(iNewError, iWndIndex, oError)
+    }
+  };
+  var _onKeyBoardEvent = function(iKeyCode) {
+    if (100 === parseInt(iKeyCode, 10)) {
+      m_bFullScreen = false;
+      if (m_options.cbDoubleClickWnd) {
+        m_options.cbDoubleClickWnd(m_iSelWnd, m_bFullScreen)
+      }
+    }
+  };
+  var _onZoomInfoCallback = function(oPoints) {
+    var iIndex = m_webVideoCtrl.findWndIndexByIndex(m_iSelWnd);
+    if (iIndex != -1) {
+      var oWndInfo = m_wndSet[iIndex];
+      iIndex = m_webVideoCtrl.findDeviceIndexByIP(oWndInfo.szDeviceIdentify);
+      if (iIndex != -1) {
+        var oDeviceInfo = m_deviceSet[iIndex];
+        oDeviceInfo.oProtocolInc.set3DZoom(oDeviceInfo, oWndInfo, oPoints, {})
+      }
+    }
+  };
+  var _oNoLoginError = {
+    errorCode: ERROR_CODE_LOGIN_NOLOGIN,
+    errorMsg: "The device is not login."
+  };
+  var _oUnKnownError = {
+    errorCode: ERROR_CODE_UNKNOWN,
+    errorMsg: "Unknown error."
+  };
+  var _oParamsError = {
+    errorCode: ERROR_CODE_PARAMERROR,
+    errorMsg: "Params error."
+  };
+  var _printString = function() {
+    if (m_options.bDebugMode) {
+      var printString = m_utilsInc.formatString(arguments);
+      console.log(printString)
+    }
+  };
+  var _initLocalCfg = function() {
+    let oPromise = new Promise(function(resolve, reject) {
+      m_pluginOBJECT.JS_GetLocalConfig()
+        .then(oLocalCofing => {
+          m_oLocalCfg = oLocalCofing;
+          resolve()
+        }, () => {
+          reject()
+        })
+    });
+    return oPromise
+  };
+  var _initDeviceInfo = function(oDeviceInfo) {
+    let oPromise = new Promise(function(resolve, reject) {
+      let oP1 = oDeviceInfo.oProtocolInc.getDeviceInfo(oDeviceInfo, {});
+      let oP2 = oDeviceInfo.oProtocolInc.getAnalogChannelInfo(oDeviceInfo, {});
+      let oP3 = oDeviceInfo.oProtocolInc.getAudioInfo(oDeviceInfo, {});
+      let oP4 = _getPort(oDeviceInfo);
+      let oP5 = oDeviceInfo.oProtocolInc.getDeviceMinusLocalTime(oDeviceInfo);
+      Promise.all([oP1, oP2, oP3, oP4, oP5])
+        .then(() => {
+          resolve()
+        }, () => {
+          resolve()
+        })
+    });
+    return oPromise
+  };
+  var _initPlugin = function(szContainerID) {
+    let oPromise = new Promise(function(resolve, reject) {
+      if (!m_utilsInc.isUndefined(szContainerID)) {
+        m_options.szContainerID = szContainerID
+      }
+      if (document.getElementById(m_options.szContainerID) == null) {
+        reject(_oParamsError);
+        return
+      }
+      var oParam = {
+        szId: szContainerID,
+        iType: 1,
+        iWidth: m_szWidth,
+        iHeight: m_szHeight,
+        iMaxSplit: 4,
+        iCurrentSplit: m_options.iWndowType,
+        iServicePortStart: 34686,
+        iServicePortEnd: 34690,
+        oSessionInfo: {
+          sessionID: "11c12b3257f037bb50052db3ac5e342572c3d963622baca122755c482ce8823a",
+          user: "admin",
+          challenge: "275816f02ec2dca22b6a6ae87c7cb7e3",
+          iterations: 100,
+          random: "34765058"
+        },
+        iPluginType: 2,
+        onConnectSuccess: () => {
+          var oElem = $("#" + szContainerID);
+          m_pluginOBJECT.JS_Resize(oElem.width(), oElem.height());
+          if (2 !== m_pluginOBJECT.iPluginMode) {
+            reject({
+              errorCode: ERROR_CODE_PLAY_PLUGININITFAIL,
+              errorMsg: "Plugin init failed."
+            });
+            return
+          }
+          var iWndFull = m_options.bWndFull ? 1 : 0;
+          m_pluginOBJECT.JS_SetFullScreenCapability(iWndFull);
+          m_pluginOBJECT.JS_SetPackageType(m_options.iPackageType);
+          _initPluginEvent();
+          _initLocalCfg()
+            .then(() => {
+              resolve()
+            })
+        },
+        onConnectError: () => {
+          reject({
+            errorCode: ERROR_CODE_PLAY_PLUGININITFAIL,
+            errorMsg: "Plugin init failed."
+          })
+        },
+        szBasePath: m_utilsInc.getDirName()
+      };
+      m_pluginOBJECT = new JSVideoPlugin(oParam)
+    });
+    return oPromise
+  };
+  var _initPluginEvent = function() {
+    m_pluginOBJECT.JS_SetWindowControlCallback({
+      onGetSelectWndInfo: iwnd => {
+        _onGetSelectWndInfo(iwnd)
+      },
+      onPluginEventHandler: (iWndIndex, iEventType, iParam2) => {
+        _onPluginEventHandler(iWndIndex, iEventType, iParam2)
+      },
+      KeyBoardEvent: szXml => {
+        _onKeyBoardEvent(szXml)
+      },
+      onMouseEvent: function(oData) {
+        _onMouseEvent(oData)
+      }
+    })
+  };
+  var _getPort = function(oDeviceInfo) {
+    let oPromise = new Promise(async (resolve, reject) => {
+      var oPort = null;
+      let bPPPoE = await _getPPPoEEnable(oDeviceInfo);
+      if (bPPPoE) {
+        oPort = await _getInternalPort(oDeviceInfo)
+      } else {
+        var ipset = await _getDeviceIPAddr(oDeviceInfo);
+        var bSame = false;
+        for (var i = 0; i < ipset.length; i++) {
+          if (ipset[i].ipv4 == oDeviceInfo.szIP || ipset[i].ipv6 == oDeviceInfo.szIP) {
+            bSame = true;
+            break
+          }
+        }
+        if (bSame) {
+          oPort = await _getInternalPort(oDeviceInfo)
+        } else {
+          oPort = await _getExternalPort(oDeviceInfo);
+          if (-1 == oPort.iRtspPort && -1 == oPort.iDevicePort) {
+            oPort = await _getInternalPort(oDeviceInfo)
+          }
+        }
+      }
+      oDeviceInfo.iRtspPort = oPort.iRtspPort;
+      oDeviceInfo.iHttpPort = oPort.iHttpPort;
+      resolve(oPort)
+    });
+    return oPromise
+  };
+  var _getInternalPort = function(oDeviceInfo) {
+    let oPromise = new Promise((resolve, reject) => {
+      var iRtspPort = -1,
+        iHttpPort = -1,
+        iDevicePort = -1;
+      oDeviceInfo.oProtocolInc.getPortInfo(oDeviceInfo, {
+        async: false,
+        success: function(xmlDoc) {
+          var nodeList = NS.$XML(xmlDoc)
+            .find("AdminAccessProtocol", true);
+          iRtspPort = 554;
+          for (var i = 0, iLen = nodeList.length; i < iLen; i++) {
+            if (NS.$XML(nodeList)
+              .eq(i)
+              .find("protocol")
+              .eq(0)
+              .text()
+              .toLowerCase() === "rtsp") {
+              iRtspPort = parseInt(NS.$XML(nodeList)
+                .eq(i)
+                .find("portNo")
+                .eq(0)
+                .text(), 10)
+            }
+            if (NS.$XML(nodeList)
+              .eq(i)
+              .find("protocol")
+              .eq(0)
+              .text()
+              .toLowerCase() === "http") {
+              iHttpPort = parseInt(NS.$XML(nodeList)
+                .eq(i)
+                .find("portNo")
+                .eq(0)
+                .text(), 10)
+            }
+            if (NS.$XML(nodeList)
+              .eq(i)
+              .find("protocol")
+              .eq(0)
+              .text()
+              .toLowerCase() === "dev_manage") {
+              iDevicePort = parseInt(NS.$XML(nodeList)
+                .eq(i)
+                .find("portNo")
+                .eq(0)
+                .text(), 10)
+            }
+          }
+          resolve({
+            iRtspPort: iRtspPort,
+            iHttpPort: iHttpPort,
+            iDevicePort: iDevicePort
+          })
+        },
+        error: function() {
+          resolve({
+            iRtspPort: -1,
+            iHttpPort: -1,
+            iDevicePort: -1
+          })
+        }
+      })
+    });
+    return oPromise
+  };
+  var _getExternalPort = function(oDeviceInfo) {
+    let oPromise = new Promise((resolve, reject) => {
+      var iRtspPort = -1,
+        iHttpPort = -1,
+        iDevicePort = -1;
+      oDeviceInfo.oProtocolInc.getUPnPPortStatus(oDeviceInfo, {
+        async: false,
+        success: function(xmlDoc) {
+          var nodeList = NS.$XML(xmlDoc)
+            .find("portStatus", true);
+          for (var i = 0, iLen = nodeList.length; i < iLen; i++) {
+            if (NS.$XML(nodeList)
+              .eq(i)
+              .find("internalPort")
+              .eq(0)
+              .text()
+              .toLowerCase() == "rtsp") {
+              iRtspPort = parseInt(NS.$XML(nodeList)
+                .eq(i)
+                .find("externalPort")
+                .eq(0)
+                .text(), 10)
+            }
+            if (NS.$XML(nodeList)
+              .eq(i)
+              .find("internalPort")
+              .eq(0)
+              .text()
+              .toLowerCase() == "http") {
+              iHttpPort = parseInt(NS.$XML(nodeList)
+                .eq(i)
+                .find("externalPort")
+                .eq(0)
+                .text(), 10)
+            }
+            if (NS.$XML(nodeList)
+              .eq(i)
+              .find("internalPort")
+              .eq(0)
+              .text()
+              .toLowerCase() == "admin") {
+              iDevicePort = parseInt(NS.$XML(nodeList)
+                .eq(i)
+                .find("externalPort")
+                .eq(0)
+                .text(), 10)
+            }
+          }
+          resolve({
+            iRtspPort: iRtspPort,
+            iHttpPort: iHttpPort,
+            iDevicePort: iDevicePort
+          })
+        },
+        error: function() {
+          resolve({
+            iRtspPort: -1,
+            iHttpPort: -1,
+            iDevicePort: -1
+          })
+        }
+      })
+    });
+    return oPromise
+  };
+  var _getDeviceIPAddr = function(oDeviceInfo) {
+    let oPromise = new Promise(function(resolve) {
+      var arrIP = [];
+      oDeviceInfo.oProtocolInc.getNetworkBond(oDeviceInfo, {
+        async: false,
+        success: function(xmlDoc) {
+          if (NS.$XML(xmlDoc)
+            .find("enabled")
+            .eq(0)
+            .text() == "true") {
+            arrIP.push({
+              ipv4: NS.$XML(xmlDoc)
+                .find("ipAddress")
+                .eq(0)
+                .text(),
+              ipv6: NS.$XML(xmlDoc)
+                .find("ipv6Address")
+                .eq(0)
+                .text()
+            });
+            resolve(arrIP)
+          } else {
+            oDeviceInfo.oProtocolInc.getNetworkInterface(oDeviceInfo, {
+              async: false,
+              success: function(xmlDoc) {
+                var nodeList = NS.$XML(xmlDoc)
+                  .find("NetworkInterface", true);
+                for (var i = 0, iLen = nodeList.length; i < iLen; i++) {
+                  arrIP.push({
+                    ipv4: NS.$XML(xmlDoc)
+                      .find("ipAddress")
+                      .eq(0)
+                      .text(),
+                    ipv6: NS.$XML(xmlDoc)
+                      .find("ipv6Address")
+                      .eq(0)
+                      .text()
+                  });
+                  break
+                }
+                resolve(arrIP)
+              },
+              error: function() {
+                resolve(arrIP)
+              }
+            })
+          }
+        },
+        error: function() {
+          oDeviceInfo.oProtocolInc.getNetworkInterface(oDeviceInfo, {
+            async: false,
+            success: function(xmlDoc) {
+              var nodeList = NS.$XML(xmlDoc)
+                .find("NetworkInterface", true);
+              for (var i = 0, iLen = nodeList.length; i < iLen; i++) {
+                arrIP.push({
+                  ipv4: NS.$XML(xmlDoc)
+                    .find("ipAddress")
+                    .eq(0)
+                    .text(),
+                  ipv6: NS.$XML(xmlDoc)
+                    .find("ipv6Address")
+                    .eq(0)
+                    .text()
+                });
+                break
+              }
+              resolve(arrIP)
+            },
+            error: function() {
+              resolve(arrIP)
+            }
+          })
+        }
+      })
+    });
+    return oPromise
+  };
+  var _getPPPoEEnable = function(oDeviceInfo) {
+    let oPromise = new Promise(function(resolve) {
+      var bEnabled = false;
+      oDeviceInfo.oProtocolInc.getPPPoEStatus(oDeviceInfo, {
+        success: function(xmlDoc) {
+          if (NS.$XML(xmlDoc)
+            .find("ipAddress", true)
+            .length > 0) {
+            bEnabled = true
+          } else if (NS.$XML(xmlDoc)
+            .find("ipv6Address", true)
+            .length > 0) {
+            bEnabled = true
+          } else {
+            bEnabled = false
+          }
+          resolve(bEnabled)
+        },
+        error: function() {
+          bEnabled = false;
+          resolve(bEnabled)
+        }
+      })
+    });
+    return oPromise
+  };
+  var _generateTransCodeXml = function(oTransCodeParam) {
+    var oDefaultParam = {
+      TransFrameRate: "",
+      TransResolution: "",
+      TransBitrate: ""
+    };
+    m_utilsInc.extend(oDefaultParam, oTransCodeParam);
+    if (oDefaultParam.TransFrameRate == "" || oDefaultParam.TransResolution == "" || oDefaultParam.TransBitrate == "") {
+      return ""
+    }
+    var ArraySet = [];
+    ArraySet.push("<?xml version='1.0' encoding='UTF-8'?>");
+    ArraySet.push("<CompressionInfo>");
+    ArraySet.push("<TransFrameRate>" + oDefaultParam.TransFrameRate + "</TransFrameRate>");
+    ArraySet.push("<TransResolution>" + oDefaultParam.TransResolution + "</TransResolution>");
+    ArraySet.push("<TransBitrate>" + oDefaultParam.TransBitrate + "</TransBitrate>");
+    ArraySet.push("</CompressionInfo>");
+    return ArraySet.join("")
+  };
+  var _setDeviceInfo = function(cgiInstance, oDeviceInfo, szIP, iProtocol, iPort, szUserName, szPassword) {
+    oDeviceInfo.szIP = szIP;
+    if (iProtocol == 2) {
+      oDeviceInfo.szHttpProtocol = "https://";
+      oDeviceInfo.iHttpsPort = iPort
+    } else {
+      oDeviceInfo.szHttpProtocol = "http://";
+      oDeviceInfo.iHttpPort = iPort
+    }
+    oDeviceInfo.iCGIPort = iPort;
+    oDeviceInfo.szDeviceIdentify = szIP + "_" + iPort;
+    oDeviceInfo.iDeviceProtocol = PROTOCOL_DEVICE_ISAPI;
+    oDeviceInfo.oProtocolInc = cgiInstance;
+    oDeviceInfo.szAuth = m_utilsInc.Base64.encode(":" + szUserName + ":" + szPassword)
+  };
+  var _doLogin = function(cgiInstance, oDeviceInfo, szIP, iProtocol, iPort, szUserName, szPassword, options) {
+    var newOptions = {
+      success: null,
+      error: null
+    };
+    m_utilsInc.extend(newOptions, options);
+    m_utilsInc.extend(newOptions, {
+      success: function(xmlDoc) {
+        _setDeviceInfo(cgiInstance, oDeviceInfo, szIP, iProtocol, iPort, szUserName, szPassword);
+        m_deviceSet.push(oDeviceInfo);
+        _initDeviceInfo(oDeviceInfo)
+          .then(() => {
+            if (options.success) {
+              options.success(xmlDoc)
+            }
+          })
+      },
+      error: function(oError) {
+        if (options.error) {
+          options.error(oError)
+        }
+      }
+    });
+    return cgiInstance.digestLogin(szIP, iProtocol, iPort, szUserName, szPassword, newOptions)
+  };
+  this.I_SupportNoPlugin = function() {
+    return false
+  };
+  this.I_Resize = function(iWidth, iHeight) {
+    return m_pluginOBJECT.JS_Resize(iWidth, iHeight)
+  };
+  this.I_InitPlugin = function(options) {
+    m_utilsInc.extend(m_options, options);
+    var szDirName = m_utilsInc.getDirName();
+    if (szDirName) {
+      if ("object" === typeof exports && typeof module !== "undefined") {} else if ("function" === typeof define && define.amd) {
+        require([szDirName + "/jsVideoPlugin-1.0.0.min.js"], function(o) {
+          window.JSVideoPlugin = o.JSVideoPlugin;
+          if (options.cbInitPluginComplete) {
+            options.cbInitPluginComplete()
+          }
+        })
+      } else {
+        m_utilsInc.loadScript(szDirName + "/jsVideoPlugin-1.0.0.min.js", function() {
+          if (options.cbInitPluginComplete) {
+            options.cbInitPluginComplete()
+          }
+        })
+      }
+    }
+    window.addEventListener("resize", function() {
+      if (m_pluginOBJECT !== null) {
+        var oElem = $("#" + m_options.szContainerID);
+        m_pluginOBJECT.JS_Resize(oElem.width(), oElem.height())
+      }
+    });
+    window.addEventListener("unload", function() {})
+  };
+  this.I_InsertOBJECTPlugin = function(szContainerID) {
+    return _initPlugin(szContainerID)
+  };
+  this.I_WriteOBJECT_XHTML = function() {
+    return 0
+  };
+  this.I_OpenFileDlg = async function(iType) {
+    let oPromise = new Promise(function(resolve, reject) {
+      m_pluginOBJECT.JS_OpenFileBrowser(iType, "")
+        .then(szFilePath => {
+          resolve(szFilePath)
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_GetLocalCfg = function() {
+    let oPromise = new Promise(function(resolve, reject) {
+      m_pluginOBJECT.JS_GetLocalConfig()
+        .then(oLocalCofing => {
+          resolve(oLocalCofing)
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_SetLocalCfg = function(oLocalCofing) {
+    let oPromise = new Promise(function(resolve, reject) {
+      m_pluginOBJECT.JS_SetLocalConfig(oLocalCofing)
+        .then(() => {
+          resolve()
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_Login = function(szIP, iProtocol, iPort, szUserName, szPassword, options) {
+    let oPromise = new Promise(function(resolve, reject) {
+      var szDeviceIdentify = szIP + "_" + iPort;
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      if (iIndex != -1) {
+        if (options.error) {
+          options.error({
+            errorCode: ERROR_CODE_LOGIN_REPEATLOGIN,
+            errorMsg: "The device is already login."
+          })
+        }
+        reject({
+          errorCode: ERROR_CODE_LOGIN_REPEATLOGIN,
+          errorMsg: "The device is already login."
+        });
+        return
+      }
+      var cgiInstance = m_ISAPIProtocol;
+      var oDeviceInfo = new deviceInfoClass;
+      _doLogin(cgiInstance, oDeviceInfo, szIP, iProtocol, iPort, szUserName, szPassword, options)
+        .then(() => {
+          resolve()
+        }, oError => {
+          reject(oError)
+        })
+    });
+    return oPromise
+  };
+  this.I_Logout = function(szDeviceIdentify) {
+    let oPromise = new Promise(function(resolve, reject) {
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      if (iIndex != -1) {
+        m_deviceSet.splice(iIndex, 1);
+        resolve()
+      }
+    });
+    return oPromise
+  };
+  this.I_GetAudioInfo = function(szDeviceIdentify, options) {
+    let oPromise = new Promise(function(resolve, reject) {
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      if (iIndex != -1) {
+        var oDeviceInfo = m_deviceSet[iIndex];
+        oDeviceInfo.oProtocolInc.getAudioInfo(oDeviceInfo, options)
+          .then(oData => {
+            resolve(oData)
+          }, oError => {
+            reject(oError)
+          })
+      } else {
+        reject(_oNoLoginError)
+      }
+    });
+    return oPromise
+  };
+  this.I_GetDeviceInfo = function(szDeviceIdentify, options) {
+    let oPromise = new Promise(function(resolve, reject) {
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      if (iIndex != -1) {
+        var oDeviceInfo = m_deviceSet[iIndex];
+        oDeviceInfo.oProtocolInc.getDeviceInfo(oDeviceInfo, options)
+          .then(oData => {
+            resolve(oData)
+          }, oError => {
+            reject(oError)
+          })
+      } else {
+        reject(_oNoLoginError)
+      }
+    });
+    return oPromise
+  };
+  this.I_GetAnalogChannelInfo = function(szDeviceIdentify, options) {
+    let oPromise = new Promise(function(resolve, reject) {
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      if (iIndex != -1) {
+        var oDeviceInfo = m_deviceSet[iIndex];
+        oDeviceInfo.oProtocolInc.getAnalogChannelInfo(oDeviceInfo, options)
+          .then(oData => {
+            resolve(oData)
+          }, oError => {
+            reject(oError)
+          })
+      } else {
+        reject(_oNoLoginError)
+      }
+    });
+    return oPromise
+  };
+  this.I_GetDigitalChannelInfo = function(szDeviceIdentify, options) {
+    let oPromise = new Promise(function(resolve, reject) {
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      if (iIndex != -1) {
+        var oDeviceInfo = m_deviceSet[iIndex];
+        oDeviceInfo.oProtocolInc.getDigitalChannelInfo(oDeviceInfo, options)
+          .then(oData => {
+            resolve(oData)
+          }, oError => {
+            reject(oError)
+          })
+      } else {
+        reject(_oNoLoginError)
+      }
+    });
+    return oPromise
+  };
+  this.I_GetZeroChannelInfo = function(szDeviceIdentify, options) {
+    let oPromise = new Promise(function(resolve, reject) {
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      if (iIndex != -1) {
+        var oDeviceInfo = m_deviceSet[iIndex];
+        oDeviceInfo.oProtocolInc.getZeroChannelInfo(oDeviceInfo, options)
+          .then(oData => {
+            resolve(oData)
+          }, oError => {
+            reject(oError)
+          })
+      } else {
+        reject(_oNoLoginError)
+      }
+    });
+    return oPromise
+  };
+  this.I_StartRealPlay = function(szDeviceIdentify, options) {
+    let oPromise = new Promise(function(resolve, reject) {
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      var newOptions = {
+        iWndIndex: m_iSelWnd,
+        iStreamType: 1,
+        iChannelID: 1,
+        bZeroChannel: false
+      };
+      m_utilsInc.extend(newOptions, options);
+      if (iIndex != -1) {
+        var oDeviceInfo = m_deviceSet[iIndex];
+        var iWndIndex = this.findWndIndexByIndex(newOptions.iWndIndex);
+        if (-1 == iWndIndex) {
+          oDeviceInfo.oProtocolInc.startRealPlay(oDeviceInfo, newOptions)
+            .then(function() {
+              if (options.success) {
+                options.success()
+              }
+              resolve()
+            }, function() {
+              if (options.error) {
+                options.error(_oUnKnownError)
+              }
+              reject(_oUnKnownError)
+            })
+        } else {
+          reject({
+            errorCode: ERROR_CODE_PLAY_NOREPEATPLAY,
+            errorMsg: "The window is already playing."
+          })
+        }
+      } else {
+        if (options.error) {
+          options.error(_oNoLoginError)
+        }
+        reject(_oNoLoginError)
+      }
+    });
+    return oPromise
+  };
+  this.I_StartPlay = function(szDeviceIdentify, options) {
+    let oPromise = new Promise(async function(resolve, reject) {
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      var newOptions = {
+        iWndIndex: m_iSelWnd
+      };
+      m_utilsInc.extend(newOptions, options);
+      var oDeviceInfo = m_deviceSet[iIndex];
+      iIndex = this.findWndIndexByIndex(newOptions.iWndIndex);
+      if (-1 == iIndex) {
+        oDeviceInfo.oProtocolInc.startPlay(oDeviceInfo, newOptions)
+          .then(function() {
+            if (options.success) {
+              options.success()
+            }
+            resolve()
+          }, function() {
+            if (options.error) {
+              options.error(_oUnKnownError)
+            }
+            reject(_oUnKnownError)
+          })
+      } else {
+        reject({
+          errorCode: ERROR_CODE_PLAY_NOREPEATPLAY,
+          errorMsg: "The window is already playing."
+        })
+      }
+    });
+    return oPromise
+  };
+  this.I_SetSecretKey = function(szSecretKey) {
+    let oPromise = new Promise((resolve, reject) => {
+      m_pluginOBJECT.JS_SetSecretKey(0, szSecretKey, 1)
+        .then(() => {
+          resolve()
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_GetEncryptString = function(szSecretKey) {
+    let oPromise = new Promise((resolve, reject) => {
+      m_pluginOBJECT.JS_GetEncryptString(3, szSecretKey)
+        .then(szEncode => {
+          resolve(szEncode)
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_Stop = function(options) {
+    let oPromise = new Promise(async function(resolve, reject) {
+      var newOptions = {
+        iWndIndex: m_iSelWnd
+      };
+      if (m_utilsInc.isObject(options)) {
+        m_utilsInc.extend(newOptions, options)
+      } else {
+        if (!m_utilsInc.isUndefined(options)) {
+          newOptions.iWndIndex = options
+        }
+      }
+      var iIndex = this.findWndIndexByIndex(newOptions.iWndIndex);
+      if (iIndex != -1) {
+        var wndInfo = m_wndSet[iIndex];
+        if (wndInfo.bRecord) {
+          m_pluginOBJECT.JS_StopSave(wndInfo.iIndex)
+        }
+        if (wndInfo.bSound) {
+          m_pluginOBJECT.JS_CloseSound()
+        }
+        if (wndInfo.bEZoom) {
+          m_pluginOBJECT.JS_DisableZoom(wndInfo.iIndex)
+        }
+        m_pluginOBJECT.JS_Stop(newOptions.iWndIndex)
+          .then(() => {
+            m_wndSet.splice(iIndex, 1);
+            if (newOptions.success) {
+              newOptions.success()
+            }
+            resolve()
+          }, () => {
+            if (newOptions.error) {
+              newOptions.error(_oUnKnownError)
+            }
+            reject(_oUnKnownError)
+          })
+      } else {
+        resolve()
+      }
+    });
+    return oPromise
+  };
+  this.I_StopAllPlay = function() {
+    let oPromise = new Promise(async function(resolve, reject) {
+      m_pluginOBJECT.JS_StopRealPlayAll()
+        .then(() => {
+          m_wndSet.length = 0;
+          resolve()
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_OpenSound = function(iWndIndex) {
+    iWndIndex = m_utilsInc.isUndefined(iWndIndex) ? m_iSelWnd : iWndIndex;
+    let oPromise = new Promise((resolve, reject) => {
+      var iIndex = this.findWndIndexByIndex(iWndIndex);
+      if (iIndex != -1) {
+        var wndInfo = m_wndSet[iIndex];
+        if (!wndInfo.bSound) {
+          m_pluginOBJECT.JS_OpenSound(iWndIndex)
+            .then(() => {
+              wndInfo.bSound = true;
+              resolve()
+            }, () => {
+              reject(_oUnKnownError)
+            })
+        } else {
+          reject(_oUnKnownError)
+        }
+      } else {
+        reject(_oUnKnownError)
+      }
+    });
+    return oPromise
+  };
+  this.I_CloseSound = function(iWndIndex) {
+    iWndIndex = m_utilsInc.isUndefined(iWndIndex) ? m_iSelWnd : iWndIndex;
+    let oPromise = new Promise((resolve, reject) => {
+      var iIndex = this.findWndIndexByIndex(iWndIndex);
+      if (iIndex != -1) {
+        var wndInfo = m_wndSet[iIndex];
+        if (wndInfo.bSound) {
+          m_pluginOBJECT.JS_CloseSound()
+            .then(() => {
+              wndInfo.bSound = false;
+              resolve()
+            }, () => {
+              reject(_oUnKnownError)
+            })
+        } else {
+          reject(_oUnKnownError)
+        }
+      } else {
+        reject(_oUnKnownError)
+      }
+    });
+    return oPromise
+  };
+  this.I_SetVolume = function(iVolume, iWndIndex) {
+    let oPromise = new Promise((resolve, reject) => {
+      var iRet = -1;
+      iVolume = parseInt(iVolume, 10);
+      if (isNaN(iVolume)) {
+        reject(_oParamsError);
+        return
+      }
+      if (iVolume < 0 || iVolume > 100) {
+        reject(_oParamsError);
+        return
+      }
+      iWndIndex = m_utilsInc.isUndefined(iWndIndex) ? m_iSelWnd : iWndIndex;
+      var iIndex = this.findWndIndexByIndex(iWndIndex);
+      if (iIndex != -1) {
+        m_pluginOBJECT.JS_SetVolume(iWndIndex, iVolume)
+          .then(() => {
+            resolve()
+          }, () => {
+            reject(_oUnKnownError)
+          })
+      } else {
+        reject(_oUnKnownError)
+      }
+    });
+    return oPromise
+  };
+  this.I_CapturePic = function(szPicName, options) {
+    let oPromise = new Promise((resolve, reject) => {
+      var newOptions = {
+        iWndIndex: m_iSelWnd,
+        bDateDir: true
+      };
+      if (m_utilsInc.isObject(options)) {
+        m_utilsInc.extend(newOptions, options)
+      } else {
+        if (!m_utilsInc.isUndefined(options)) {
+          newOptions.iWndIndex = options
+        }
+      }
+      var iIndex = this.findWndIndexByIndex(newOptions.iWndIndex);
+      if (iIndex != -1) {
+        if (".jpg" === szPicName.slice(-4)
+          .toLowerCase()) {
+          szPicName = szPicName.slice(0, -4)
+        } else if (".jpeg" === szPicName.slice(-5)
+          .toLowerCase()) {
+          szPicName = szPicName.slice(0, -5)
+        }
+        m_pluginOBJECT.JS_CapturePicture(newOptions.iWndIndex, szPicName, newOptions.bDateDir)
+          .then(() => {
+            resolve()
+          }, () => {
+            reject(_oUnKnownError)
+          })
+      } else {
+        reject(_oUnKnownError)
+      }
+    });
+    return oPromise
+  };
+  this.I_CapturePicData = function(options) {
+    let oPromise = new Promise((resolve, reject) => {
+      var newOptions = {
+        iWndIndex: m_iSelWnd,
+        bDateDir: true
+      };
+      if (m_utilsInc.isObject(options)) {
+        m_utilsInc.extend(newOptions, options)
+      } else {
+        if (!m_utilsInc.isUndefined(options)) {
+          newOptions.iWndIndex = options
+        }
+      }
+      var iIndex = this.findWndIndexByIndex(newOptions.iWndIndex);
+      if (iIndex != -1) {
+        m_pluginOBJECT.JS_GetCaptureData(newOptions.iWndIndex)
+          .then(function(data) {
+            resolve(data)
+          }, function(data) {
+            reject(_oUnKnownError)
+          })
+      } else {
+        reject(_oUnKnownError)
+      }
+    });
+    return oPromise
+  };
+  this.I_StartRecord = function(szFileName, options) {
+    let oPromise = new Promise((resolve, reject) => {
+      var newOptions = {
+        iWndIndex: m_iSelWnd,
+        bDateDir: true
+      };
+      if (m_utilsInc.isObject(options)) {
+        m_utilsInc.extend(newOptions, options)
+      } else {
+        if (!m_utilsInc.isUndefined(options)) {
+          newOptions.iWndIndex = options
+        }
+      }
+      var iIndex = this.findWndIndexByIndex(newOptions.iWndIndex);
+      if (iIndex != -1) {
+        var wndInfo = m_wndSet[iIndex];
+        if (!wndInfo.bRecord) {
+          m_pluginOBJECT.JS_StartSave(newOptions.iWndIndex, szFileName)
+            .then(function() {
+              wndInfo.bRecord = true;
+              if (newOptions.success) {
+                newOptions.success()
+              }
+              resolve()
+            }, function() {
+              if (newOptions.error) {
+                newOptions.error(_oUnKnownError)
+              }
+              reject(_oUnKnownError)
+            })
+        } else {
+          if (newOptions.error) {
+            newOptions.error(_oUnKnownError)
+          }
+          reject(_oUnKnownError)
+        }
+      } else {
+        if (newOptions.error) {
+          newOptions.error(_oUnKnownError)
+        }
+        reject(_oUnKnownError)
+      }
+    });
+    return oPromise
+  };
+  this.I_StopRecord = function(options) {
+    let oPromise = new Promise((resolve, reject) => {
+      var newOptions = {
+        iWndIndex: m_iSelWnd
+      };
+      if (m_utilsInc.isObject(options)) {
+        m_utilsInc.extend(newOptions, options)
+      } else {
+        if (!m_utilsInc.isUndefined(options)) {
+          newOptions.iWndIndex = options
+        }
+      }
+      var iIndex = this.findWndIndexByIndex(newOptions.iWndIndex);
+      if (iIndex != -1) {
+        var wndInfo = m_wndSet[iIndex];
+        if (wndInfo.bRecord) {
+          m_pluginOBJECT.JS_StopSave(newOptions.iWndIndex)
+            .then(function() {
+              wndInfo.bRecord = false;
+              if (newOptions.success) {
+                newOptions.success()
+              }
+              resolve()
+            }, function() {
+              if (newOptions.error) {
+                newOptions.error(_oUnKnownError)
+              }
+              reject(_oUnKnownError)
+            })
+        } else {
+          if (newOptions.error) {
+            newOptions.error(_oUnKnownError)
+          }
+          reject(_oUnKnownError)
+        }
+      } else {
+        if (newOptions.error) {
+          newOptions.error(_oUnKnownError)
+        }
+        reject(_oUnKnownError)
+      }
+    });
+    return oPromise
+  };
+  this.I_StartVoiceTalk = function(szDeviceIdentify, iAudioChannel) {
+    let oPromise = new Promise((resolve, reject) => {
+      if (isNaN(parseInt(iAudioChannel, 10))) {
+        reject(_oParamsError);
+        return
+      }
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      if (iIndex != -1) {
+        var oDeviceInfo = m_deviceSet[iIndex];
+        if (!oDeviceInfo.bVoiceTalk) {
+          oDeviceInfo.oProtocolInc.startVoiceTalk(oDeviceInfo, iAudioChannel)
+            .then(() => {
+              m_deviceSet[iIndex].bVoiceTalk = true;
+              resolve()
+            }, () => {
+              reject(_oUnKnownError)
+            })
+        } else {
+          reject(_oUnKnownError)
+        }
+      } else {
+        reject(_oUnKnownError)
+      }
+    });
+    return oPromise
+  };
+  this.I_StopVoiceTalk = function() {
+    let oPromise = new Promise((resolve, reject) => {
+      m_pluginOBJECT.JS_StopTalk()
+        .then(() => {
+          for (var i = 0, iLen = m_deviceSet.length; i < iLen; i++) {
+            if (m_deviceSet[i].bVoiceTalk) {
+              m_deviceSet[i].bVoiceTalk = false;
+              break
+            }
+          }
+          resolve()
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_StartAudioPlay = function(szDeviceIdentify, options) {
+    let oPromise = new Promise((resolve, reject) => {
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      if (iIndex != -1) {
+        var oDeviceInfo = m_deviceSet[iIndex];
+        options.szAuth = oDeviceInfo.szAuth;
+        if (!oDeviceInfo.bVoiceTalk) {
+          oDeviceInfo.oProtocolInc.audioPlay(options)
+            .then(() => {
+              m_deviceSet[iIndex].bVoiceTalk = true;
+              resolve()
+            }, () => {
+              reject(_oUnKnownError)
+            })
+        } else {
+          reject(_oUnKnownError)
+        }
+      } else {
+        reject(_oUnKnownError)
+      }
+    });
+    return oPromise
+  };
+  this.I_StopAudioPlay = function() {
+    let oPromise = new Promise((resolve, reject) => {
+      m_pluginOBJECT.JS_StopAudioPlay()
+        .then(() => {
+          for (var i = 0, iLen = m_deviceSet.length; i < iLen; i++) {
+            if (m_deviceSet[i].bVoiceTalk) {
+              m_deviceSet[i].bVoiceTalk = false;
+              break
+            }
+          }
+          resolve()
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_PTZControl = function(iPTZIndex, bStop, options) {
+    let oPromise = new Promise((resolve, reject) => {
+      var newOptions = {
+        iWndIndex: m_iSelWnd,
+        iPTZIndex: iPTZIndex,
+        iPTZSpeed: 4
+      };
+      m_utilsInc.extend(newOptions, options);
+      var iIndex = this.findWndIndexByIndex(newOptions.iWndIndex);
+      if (iIndex != -1) {
+        var wndInfo = m_wndSet[iIndex];
+        iIndex = this.findDeviceIndexByIP(wndInfo.szIP);
+        if (iIndex != -1) {
+          var oDeviceInfo = m_deviceSet[iIndex];
+          if (9 == iPTZIndex) {
+            oDeviceInfo.oProtocolInc.ptzAutoControl(oDeviceInfo, bStop, wndInfo, newOptions)
+              .then(() => {
+                resolve()
+              }, oError => {
+                reject(oError)
+              })
+          } else {
+            oDeviceInfo.oProtocolInc.ptzControl(oDeviceInfo, bStop, wndInfo, newOptions)
+              .then(() => {
+                resolve()
+              }, oError => {
+                reject(oError)
+              })
+          }
+        }
+      }
+    });
+    return oPromise
+  };
+  this.I_EnableEZoom = function(iWndIndex) {
+    let oPromise = new Promise((resolve, reject) => {
+      iWndIndex = m_utilsInc.isUndefined(iWndIndex) ? m_iSelWnd : iWndIndex;
+      var iIndex = this.findWndIndexByIndex(iWndIndex);
+      if (iIndex != -1) {
+        var wndInfo = m_wndSet[iIndex];
+        if (!wndInfo.bEZoom) {
+          m_pluginOBJECT.JS_EnableZoom(iWndIndex)
+            .then(() => {
+              wndInfo.bEZoom = true;
+              resolve()
+            }, () => {
+              reject(_oUnKnownError)
+            })
+        }
+      } else {
+        reject(_oUnKnownError)
+      }
+    });
+    return oPromise
+  };
+  this.I_DisableEZoom = function(iWndIndex) {
+    let oPromise = new Promise((resolve, reject) => {
+      iWndIndex = m_utilsInc.isUndefined(iWndIndex) ? m_iSelWnd : iWndIndex;
+      var iIndex = this.findWndIndexByIndex(iWndIndex);
+      if (iIndex != -1) {
+        var wndInfo = m_wndSet[iIndex];
+        if (wndInfo.bEZoom) {
+          m_pluginOBJECT.JS_DisableZoom(iWndIndex)
+            .then(() => {
+              wndInfo.bEZoom = false;
+              resolve()
+            }, () => {
+              reject(_oUnKnownError)
+            })
+        } else {
+          resolve()
+        }
+      } else {
+        reject(_oUnKnownError)
+      }
+    });
+    return oPromise
+  };
+  this.I_Enable3DZoom = function(iWndIndex) {
+    let oPromise = new Promise((resolve, reject) => {
+      iWndIndex = m_utilsInc.isUndefined(iWndIndex) ? m_iSelWnd : iWndIndex;
+      var iIndex = this.findWndIndexByIndex(iWndIndex);
+      if (iIndex != -1) {
+        var wndInfo = m_wndSet[iIndex];
+        if (!wndInfo.b3DZoom) {
+          m_pluginOBJECT.JS_SetDrawCallback(iWndIndex, true, "Rect", false, function(oRect) {
+            _onZoomInfoCallback(oRect.points)
+          });
+          wndInfo.b3DZoom = true;
+          resolve()
+        } else {
+          resolve()
+        }
+      } else {
+        reject(_oUnKnownError)
+      }
+    });
+    return oPromise
+  };
+  this.I_Disable3DZoom = function(iWndIndex) {
+    let oPromise = new Promise((resolve, reject) => {
+      iWndIndex = m_utilsInc.isUndefined(iWndIndex) ? m_iSelWnd : iWndIndex;
+      var iIndex = this.findWndIndexByIndex(iWndIndex);
+      if (iIndex != -1) {
+        var wndInfo = m_wndSet[iIndex];
+        if (wndInfo.b3DZoom) {
+          m_pluginOBJECT.JS_SetDrawCallback(iWndIndex, false, "Rect", false, function() {});
+          wndInfo.b3DZoom = false;
+          resolve()
+        } else {
+          resolve()
+        }
+      } else {
+        reject(_oUnKnownError)
+      }
+    });
+    return oPromise
+  };
+  this.I_FullScreen = function(bFull) {
+    let oPromise = new Promise(function(resolve, reject) {
+      m_pluginOBJECT.JS_FullScreenDisplay(bFull)
+        .then(() => {
+          resolve()
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_SetPreset = function(iPresetID, options) {
+    let oPromise = new Promise(function(resolve, reject) {
+      var newOptions = {
+        iWndIndex: m_iSelWnd,
+        iPresetID: iPresetID
+      };
+      m_utilsInc.extend(newOptions, options);
+      var iIndex = this.findWndIndexByIndex(newOptions.iWndIndex);
+      if (iIndex != -1) {
+        var wndInfo = m_wndSet[iIndex];
+        iIndex = this.findDeviceIndexByIP(wndInfo.szIP);
+        if (iIndex != -1) {
+          var oDeviceInfo = m_deviceSet[iIndex];
+          oDeviceInfo.oProtocolInc.setPreset(oDeviceInfo, wndInfo, newOptions)
+            .then(() => {
+              resolve()
+            }, oError => {
+              reject(oError)
+            })
+        } else {
+          reject(_oUnKnownError)
+        }
+      } else {
+        reject(_oUnKnownError)
+      }
+    });
+    return oPromise
+  };
+  this.I_GoPreset = function(iPresetID, options) {
+    let oPromise = new Promise(async function(resolve, reject) {
+      var newOptions = {
+        iWndIndex: m_iSelWnd,
+        iPresetID: iPresetID
+      };
+      m_utilsInc.extend(newOptions, options);
+      var iIndex = this.findWndIndexByIndex(newOptions.iWndIndex);
+      if (iIndex != -1) {
+        var wndInfo = m_wndSet[iIndex];
+        iIndex = this.findDeviceIndexByIP(wndInfo.szIP);
+        if (iIndex != -1) {
+          var oDeviceInfo = m_deviceSet[iIndex];
+          oDeviceInfo.oProtocolInc.goPreset(oDeviceInfo, wndInfo, newOptions)
+            .then(() => {
+              resolve()
+            }, oError => {
+              reject(oError)
+            })
+        } else {
+          reject(_oUnKnownError)
+        }
+      } else {
+        reject(_oUnKnownError)
+      }
+    });
+    return oPromise
+  };
+  this.I_RecordSearch = function(szDeviceIdentify, iChannelID, szStartTime, szEndTime, options) {
+    let oPromise = new Promise(async function(resolve, reject) {
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      if (iIndex != -1) {
+        var oDeviceInfo = m_deviceSet[iIndex];
+        if (oDeviceInfo.szDeviceType === DEVICE_TYPE_IPCAMERA || oDeviceInfo.szDeviceType === DEVICE_TYPE_IPDOME || oDeviceInfo.szDeviceType === DEVICE_TYPE_IPZOOM) {
+          szStartTime = m_utilsInc.convertToUTCTime(szStartTime);
+          szEndTime = m_utilsInc.convertToUTCTime(szEndTime)
+        }
+        var newOptions = {
+          iChannelID: iChannelID,
+          szStartTime: szStartTime,
+          szEndTime: szEndTime,
+          iSearchPos: 0,
+          iStreamType: 1
+        };
+        m_utilsInc.extend(newOptions, options);
+        newOptions.success = null;
+        oDeviceInfo.oProtocolInc.recordSearch(oDeviceInfo, newOptions)
+          .then(oData => {
+            if (oDeviceInfo.szDeviceType === DEVICE_TYPE_IPCAMERA || oDeviceInfo.szDeviceType === DEVICE_TYPE_IPDOME || oDeviceInfo.szDeviceType === DEVICE_TYPE_IPZOOM) {
+              var szRecordStartTime = "";
+              var szRecordEndTime = "";
+              for (var i = 0, nLen = $(oData)
+                .find("searchMatchItem")
+                .length; i < nLen; i++) {
+                szRecordStartTime = $(oData)
+                  .find("startTime")
+                  .eq(i)
+                  .text();
+                szRecordEndTime = $(oData)
+                  .find("endTime")
+                  .eq(i)
+                  .text();
+                szRecordStartTime = m_utilsInc.convertToLocalTime(szRecordStartTime, oDeviceInfo.iDeviceMinusLocalTime);
+                szRecordEndTime = m_utilsInc.convertToLocalTime(szRecordEndTime, oDeviceInfo.iDeviceMinusLocalTime);
+                $(oData)
+                  .find("startTime")
+                  .eq(i)
+                  .text(szRecordStartTime);
+                $(oData)
+                  .find("endTime")
+                  .eq(i)
+                  .text(szRecordEndTime)
+              }
+            }
+            if (options.success) {
+              options.success(oData)
+            }
+            resolve(oData)
+          }, oError => {
+            reject(oError)
+          })
+      } else {
+        reject(_oNoLoginError)
+      }
+    });
+    return oPromise
+  };
+  this.I_StartPlayback = function(szDeviceIdentify, options) {
+    let oPromise = new Promise(function(resolve, reject) {
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify),
+        cgi = "",
+        urlProtocol = "",
+        iChannelID = 1,
+        iStream = 0;
+      var szCurTime = m_utilsInc.dateFormat(new Date, "yyyy-MM-dd");
+      var newOptions = {
+        iWndIndex: m_iSelWnd,
+        iStreamType: 1,
+        iChannelID: 1,
+        szStartTime: szCurTime + " 00:00:00",
+        szEndTime: szCurTime + " 23:59:59"
+      };
+      m_utilsInc.extend(newOptions, options);
+      if (iIndex != -1) {
+        var oDeviceInfo = m_deviceSet[iIndex];
+        cgi = oDeviceInfo.oProtocolInc.CGI.startPlayback;
+        urlProtocol = "rtsp://";
+        iStream = newOptions.iStreamType;
+        iChannelID = newOptions.iChannelID * 100 + iStream;
+        m_utilsInc.extend(newOptions, {
+          urlProtocol: urlProtocol,
+          cgi: cgi,
+          iChannelID: iChannelID
+        });
+        iIndex = this.findWndIndexByIndex(newOptions.iWndIndex);
+        if (-1 == iIndex) {
+          if (oDeviceInfo.szDeviceType === DEVICE_TYPE_IPCAMERA || oDeviceInfo.szDeviceType === DEVICE_TYPE_IPDOME || oDeviceInfo.szDeviceType === DEVICE_TYPE_IPZOOM) {
+            newOptions.szStartTime = m_utilsInc.convertToUTCTime(newOptions.szStartTime);
+            newOptions.szEndTime = m_utilsInc.convertToUTCTime(newOptions.szEndTime)
+          }
+          newOptions.szStartTime = newOptions.szStartTime.replace(/[-:]/g, "")
+            .replace(" ", "T") + "Z";
+          newOptions.szEndTime = newOptions.szEndTime.replace(/[-:]/g, "")
+            .replace(" ", "T") + "Z";
+          oDeviceInfo.oProtocolInc.startPlayback(oDeviceInfo, newOptions)
+            .then(function() {
+              if (options.success) {
+                options.success()
+              }
+              resolve()
+            }, function() {
+              if (options.error) {
+                options.error(_oUnKnownError)
+              }
+              reject(_oUnKnownError)
+            })
+        }
+      } else {
+        if (options.error) {
+          options.error(_oNoLoginError)
+        }
+        reject(_oNoLoginError)
+      }
+    });
+    return oPromise
+  };
+  this.I_ReversePlayback = function(szDeviceIdentify, options) {
+    let oPromise = new Promise(function(resolve, reject) {
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify),
+        iRet = -1,
+        cgi = "",
+        urlProtocol = "",
+        iPort = -1,
+        iChannelID = -1,
+        iStream = 0;
+      var szCurTime = m_utilsInc.dateFormat(new Date, "yyyy-MM-dd");
+      var newOptions = {
+        iWndIndex: m_iSelWnd,
+        iStreamType: 1,
+        iChannelID: 1,
+        szStartTime: szCurTime + " 00:00:00",
+        szEndTime: szCurTime + " 23:59:59"
+      };
+      m_utilsInc.extend(newOptions, options);
+      if (iIndex != -1) {
+        var oDeviceInfo = m_deviceSet[iIndex];
+        var iProtocolType = parseInt(m_oLocalCfg.protocolType, 10);
+        cgi = oDeviceInfo.oProtocolInc.CGI.startPlayback;
+        urlProtocol = "rtsp://";
+        iStream = newOptions.iStreamType;
+        iChannelID = newOptions.iChannelID * 100 + iStream;
+        m_utilsInc.extend(newOptions, {
+          urlProtocol: urlProtocol,
+          cgi: cgi,
+          iChannelID: iChannelID
+        });
+        iIndex = this.findWndIndexByIndex(newOptions.iWndIndex);
+        if (-1 == iIndex) {
+          newOptions.szStartTime = newOptions.szStartTime.replace(/[-:]/g, "")
+            .replace(" ", "T") + "Z";
+          newOptions.szEndTime = newOptions.szEndTime.replace(/[-:]/g, "")
+            .replace(" ", "T") + "Z";
+          oDeviceInfo.oProtocolInc.reversePlayback(oDeviceInfo, newOptions)
+            .then(function() {
+              if (options.success) {
+                options.success()
+              }
+              resolve()
+            }, function() {
+              if (options.error) {
+                options.error(_oUnKnownError)
+              }
+              reject(_oUnKnownError)
+            })
+        }
+      }
+    });
+    return oPromise
+  };
+  this.I_Frame = function(options) {
+    let oPromise = new Promise(async function(resolve, reject) {
+      var newOptions = {
+        iWndIndex: m_iSelWnd
+      };
+      if (m_utilsInc.isObject(options)) {
+        m_utilsInc.extend(newOptions, options)
+      } else {
+        if (!m_utilsInc.isUndefined(options)) {
+          newOptions.iWndIndex = options
+        }
+      }
+      var iIndex = this.findWndIndexByIndex(newOptions.iWndIndex);
+      if (iIndex != -1) {
+        var wndInfo = m_wndSet[iIndex],
+          iPlayStatus = wndInfo.iPlayStatus;
+        if (iPlayStatus == PLAY_STATUS_PLAYBACK || iPlayStatus == PLAY_STATUS_FRAME) {
+          m_pluginOBJECT.JS_FrameForward(newOptions.iWndIndex)
+            .then(function() {
+              wndInfo.iPlayStatus = PLAY_STATUS_FRAME;
+              if (newOptions.success) {
+                newOptions.success()
+              }
+              resolve()
+            }, function() {
+              if (newOptions.error) {
+                newOptions.error(_oUnKnownError)
+              }
+              reject(_oUnKnownError)
+            })
+        } else {
+          if (newOptions.error) {
+            newOptions.error(_oUnKnownError)
+          }
+          reject(_oUnKnownError)
+        }
+      } else {
+        if (newOptions.error) {
+          newOptions.error(_oUnKnownError)
+        }
+        reject(_oUnKnownError)
+      }
+    });
+    return oPromise
+  };
+  this.I_Pause = function(options) {
+    let oPromise = new Promise(async function(resolve, reject) {
+      var newOptions = {
+        iWndIndex: m_iSelWnd
+      };
+      if (m_utilsInc.isObject(options)) {
+        m_utilsInc.extend(newOptions, options)
+      } else {
+        if (!m_utilsInc.isUndefined(options)) {
+          newOptions.iWndIndex = options
+        }
+      }
+      var iIndex = this.findWndIndexByIndex(newOptions.iWndIndex);
+      if (iIndex != -1) {
+        var wndInfo = m_wndSet[iIndex],
+          iPlayStatus = wndInfo.iPlayStatus,
+          iNextStatus = -1;
+        if (iPlayStatus == PLAY_STATUS_PLAYBACK) {
+          iNextStatus = PLAY_STATUS_PAUSE
+        } else if (iPlayStatus == PLAY_STATUS_REVERSE_PLAYBACK) {
+          iNextStatus = PLAY_STATUS_REVERSE_PAUSE
+        } else {
+          if (newOptions.error) {
+            newOptions.error(_oUnKnownError)
+          }
+          reject(_oUnKnownError);
+          return
+        }
+        m_pluginOBJECT.JS_Pause(newOptions.iWndIndex)
+          .then(function() {
+            wndInfo.iPlayStatus = iNextStatus;
+            if (newOptions.success) {
+              newOptions.success()
+            }
+            resolve()
+          }, function() {
+            if (newOptions.error) {
+              newOptions.error(_oUnKnownError)
+            }
+            reject(_oUnKnownError)
+          })
+      } else {
+        if (newOptions.error) {
+          newOptions.error(_oUnKnownError)
+        }
+        reject(_oUnKnownError)
+      }
+    });
+    return oPromise
+  };
+  this.I_Resume = function(options) {
+    let oPromise = new Promise(async function(resolve, reject) {
+      var newOptions = {
+        iWndIndex: m_iSelWnd
+      };
+      if (m_utilsInc.isObject(options)) {
+        m_utilsInc.extend(newOptions, options)
+      } else {
+        if (!m_utilsInc.isUndefined(options)) {
+          newOptions.iWndIndex = options
+        }
+      }
+      var iIndex = this.findWndIndexByIndex(newOptions.iWndIndex);
+      if (iIndex != -1) {
+        var wndInfo = m_wndSet[iIndex],
+          iPlayStatus = wndInfo.iPlayStatus,
+          iNextStatus = -1;
+        if (iPlayStatus == PLAY_STATUS_PAUSE || iPlayStatus == PLAY_STATUS_FRAME) {
+          iNextStatus = PLAY_STATUS_PLAYBACK
+        } else if (iPlayStatus == PLAY_STATUS_REVERSE_PAUSE) {
+          iNextStatus = PLAY_STATUS_REVERSE_PLAYBACK
+        } else {
+          if (newOptions.error) {
+            newOptions.error(_oUnKnownError)
+          }
+          reject(_oUnKnownError);
+          return
+        }
+        m_pluginOBJECT.JS_Resume(newOptions.iWndIndex)
+          .then(function() {
+            wndInfo.iPlayStatus = iNextStatus;
+            if (newOptions.success) {
+              newOptions.success()
+            }
+            resolve()
+          }, function() {
+            if (newOptions.error) {
+              newOptions.error(_oUnKnownError)
+            }
+            reject(_oUnKnownError)
+          })
+      } else {
+        if (newOptions.error) {
+          newOptions.error(_oUnKnownError)
+        }
+        reject(_oUnKnownError)
+      }
+    });
+    return oPromise
+  };
+  this.I_PlaySlow = function(options) {
+    let oPromise = new Promise(async function(resolve, reject) {
+      var newOptions = {
+        iWndIndex: m_iSelWnd
+      };
+      if (m_utilsInc.isObject(options)) {
+        m_utilsInc.extend(newOptions, options)
+      } else {
+        if (!m_utilsInc.isUndefined(options)) {
+          newOptions.iWndIndex = options
+        }
+      }
+      var iIndex = this.findWndIndexByIndex(newOptions.iWndIndex);
+      if (iIndex != -1) {
+        var wndInfo = m_wndSet[iIndex];
+        if (wndInfo.iPlayStatus == PLAY_STATUS_PLAYBACK) {
+          m_pluginOBJECT.JS_Slow(newOptions.iWndIndex)
+            .then(function() {
+              if (newOptions.success) {
+                newOptions.success()
+              }
+              resolve()
+            }, function() {
+              if (newOptions.error) {
+                newOptions.error(_oUnKnownError)
+              }
+              reject(_oUnKnownError)
+            })
+        } else {
+          if (newOptions.error) {
+            newOptions.error(_oUnKnownError)
+          }
+          reject(_oUnKnownError)
+        }
+      } else {
+        if (newOptions.error) {
+          newOptions.error(_oUnKnownError)
+        }
+        reject(_oUnKnownError)
+      }
+    });
+    return oPromise
+  };
+  this.I_PlayFast = function(options) {
+    let oPromise = new Promise(async function(resolve, reject) {
+      var newOptions = {
+        iWndIndex: m_iSelWnd
+      };
+      if (m_utilsInc.isObject(options)) {
+        m_utilsInc.extend(newOptions, options)
+      } else {
+        if (!m_utilsInc.isUndefined(options)) {
+          newOptions.iWndIndex = options
+        }
+      }
+      var iIndex = this.findWndIndexByIndex(newOptions.iWndIndex);
+      if (iIndex != -1) {
+        var wndInfo = m_wndSet[iIndex];
+        if (wndInfo.iPlayStatus == PLAY_STATUS_PLAYBACK) {
+          m_pluginOBJECT.JS_Fast(newOptions.iWndIndex)
+            .then(function() {
+              if (newOptions.success) {
+                newOptions.success()
+              }
+              resolve()
+            }, function() {
+              if (newOptions.error) {
+                newOptions.error(_oUnKnownError)
+              }
+              reject(_oUnKnownError)
+            })
+        } else {
+          if (newOptions.error) {
+            newOptions.error(_oUnKnownError)
+          }
+          reject(_oUnKnownError)
+        }
+      } else {
+        if (newOptions.error) {
+          newOptions.error(_oUnKnownError)
+        }
+        reject(_oUnKnownError)
+      }
+    });
+    return oPromise
+  };
+  this.I_GetOSDTime = function(options) {
+    let oPromise = new Promise(async function(resolve, reject) {
+      var newOptions = {
+        iWndIndex: m_iSelWnd
+      };
+      if (m_utilsInc.isObject(options)) {
+        m_utilsInc.extend(newOptions, options)
+      } else {
+        if (!m_utilsInc.isUndefined(options)) {
+          newOptions.iWndIndex = options
+        }
+      }
+      var iIndex = this.findWndIndexByIndex(newOptions.iWndIndex);
+      if (iIndex != -1) {
+        m_pluginOBJECT.JS_GetOSDTime(newOptions.iWndIndex)
+          .then(function(iTime) {
+            if (newOptions.success) {
+              var szOSDTime = m_utilsInc.dateFormat(new Date(iTime * 1e3), "yyyy-MM-dd hh:mm:ss");
+              newOptions.success(szOSDTime)
+            }
+            resolve(szOSDTime)
+          }, function() {
+            if (newOptions.error) {
+              newOptions.error(_oUnKnownError)
+            }
+            reject(_oUnKnownError)
+          })
+      } else {
+        if (newOptions.error) {
+          newOptions.error(_oUnKnownError)
+        }
+        reject(_oUnKnownError)
+      }
+    });
+    return oPromise
+  };
+  this.I_StartDownloadRecord = function(szDeviceIdentify, szPlaybackURI, szFileName, options) {
+    let oPromise = new Promise((resolve, reject) => {
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      if (iIndex != -1) {
+        var oDeviceInfo = m_deviceSet[iIndex];
+        var newOptions = {
+          szPlaybackURI: szPlaybackURI,
+          szFileName: szFileName + ".mp4",
+          bDateDir: true
+        };
+        if (!m_utilsInc.isUndefined(options)) {
+          m_utilsInc.extend(newOptions, options)
+        }
+        oDeviceInfo.oProtocolInc.startDownloadRecord(oDeviceInfo, newOptions)
+          .then(iDownloadID => {
+            resolve(iDownloadID)
+          }, oError => {
+            reject(oError)
+          })
+      } else {
+        reject(_oNoLoginError)
+      }
+    });
+    return oPromise
+  };
+  this.I_StartDownloadRecordByTime = function(szDeviceIdentify, szPlaybackURI, szFileName, szStartTime, szEndTime, options) {
+    let oPromise = new Promise((resolve, reject) => {
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      if (iIndex != -1) {
+        var oDeviceInfo = m_deviceSet[iIndex];
+        szPlaybackURI = szPlaybackURI.split("?")[0] + "?starttime=" + szStartTime.replace(" ", "T") + "Z&endtime=" + szEndTime.replace(" ", "T") + "Z";
+        var newOptions = {
+          szPlaybackURI: szPlaybackURI,
+          szFileName: szFileName + ".mp4",
+          bDateDir: true
+        };
+        if (!m_utilsInc.isUndefined(options)) {
+          m_utilsInc.extend(newOptions, options)
+        }
+        oDeviceInfo.oProtocolInc.startDownloadRecord(oDeviceInfo, newOptions)
+          .then(iDownloadID => {
+            resolve(iDownloadID)
+          }, oError => {
+            reject(oError)
+          })
+      }
+    });
+    return oPromise
+  };
+  this.I_GetDownloadStatus = function(iDownloadID) {
+    let oPromise = new Promise((resolve, reject) => {
+      m_pluginOBJECT.JS_GetDownloadStatus(iDownloadID)
+        .then(data => {
+          resolve(data)
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_GetDownloadProgress = function(iDownloadID) {
+    let oPromise = new Promise((resolve, reject) => {
+      m_pluginOBJECT.JS_GetDownloadProgress(iDownloadID)
+        .then(data => {
+          resolve(data)
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_StopDownloadRecord = function(iDownloadID) {
+    let oPromise = new Promise((resolve, reject) => {
+      m_pluginOBJECT.JS_StopAsyncDownload(iDownloadID)
+        .then(() => {
+          resolve()
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_ExportDeviceConfig = function(szDeviceIdentify) {
+    let oPromise = new Promise((resolve, reject) => {
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      if (iIndex != -1) {
+        var oDeviceInfo = m_deviceSet[iIndex];
+        oDeviceInfo.oProtocolInc.exportDeviceConfig(oDeviceInfo)
+          .then(() => {
+            resolve()
+          }, () => {
+            reject(_oUnKnownError)
+          })
+      } else {
+        reject(_oNoLoginError)
+      }
+    });
+    return oPromise
+  };
+  this.I_ImportDeviceConfig = function(szDeviceIdentify, szFileName) {
+    let oPromise = new Promise((resolve, reject) => {
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      if (iIndex != -1) {
+        var oDeviceInfo = m_deviceSet[iIndex];
+        var newOptions = {
+          szFileName: szFileName
+        };
+        oDeviceInfo.oProtocolInc.importDeviceConfig(oDeviceInfo, newOptions)
+          .then(() => {
+            resolve()
+          }, () => {
+            reject(_oUnKnownError)
+          })
+      } else {
+        reject(_oNoLoginError)
+      }
+    });
+    return oPromise
+  };
+  this.I_RestoreDefault = function(szDeviceIdentify, szMode, options) {
+    let oPromise = new Promise((resolve, reject) => {
+      var newOptions = {
+        success: null,
+        error: null
+      };
+      m_utilsInc.extend(newOptions, options);
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      if (iIndex != -1) {
+        var oDeviceInfo = m_deviceSet[iIndex];
+        oDeviceInfo.oProtocolInc.restore(oDeviceInfo, szMode, newOptions)
+          .then(() => {
+            resolve()
+          }, oError => {
+            reject(oError)
+          })
+      } else {
+        reject(_oNoLoginError)
+      }
+    });
+    return oPromise
+  };
+  this.I_Restart = function(szDeviceIdentify, options) {
+    let oPromise = new Promise((resolve, reject) => {
+      var newOptions = {
+        success: null,
+        error: null
+      };
+      m_utilsInc.extend(newOptions, options);
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      if (iIndex != -1) {
+        var oDeviceInfo = m_deviceSet[iIndex];
+        oDeviceInfo.oProtocolInc.restart(oDeviceInfo, newOptions)
+          .then(() => {
+            resolve()
+          }, oError => {
+            reject(oError)
+          })
+      } else {
+        reject(_oNoLoginError)
+      }
+    });
+    return oPromise
+  };
+  this.I_Reconnect = function(szDeviceIdentify, options) {
+    let oPromise = new Promise((resolve, reject) => {
+      var newOptions = {
+        success: null,
+        error: null
+      };
+      m_utilsInc.extend(newOptions, options);
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      if (iIndex != -1) {
+        var oDeviceInfo = m_deviceSet[iIndex];
+        oDeviceInfo.oProtocolInc.login(oDeviceInfo.szIP, oDeviceInfo.iCGIPort, oDeviceInfo.szAuth, newOptions)
+          .then(() => {
+            resolve()
+          }, oError => {
+            reject(oError)
+          })
+      } else {
+        reject(_oNoLoginError)
+      }
+    });
+    return oPromise
+  };
+  this.I_StartUpgrade = function(szDeviceIdentify, szFileName) {
+    let oPromise = new Promise((resolve, reject) => {
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      if (iIndex != -1) {
+        var oDeviceInfo = m_deviceSet[iIndex];
+        oDeviceInfo.oProtocolInc.startUpgrade(oDeviceInfo, szFileName)
+          .then(() => {
+            resolve()
+          }, () => {
+            reject(_oUnKnownError)
+          })
+      } else {
+        reject(_oNoLoginError)
+      }
+    });
+    return oPromise
+  };
+  this.I_UpgradeStatus = function(szDeviceIdentify) {
+    let oPromise = new Promise((resolve, reject) => {
+      this.I_SendHTTPRequest(szDeviceIdentify, m_ISAPIProtocol.CGI.startUpgrade.status, {})
+        .then(data => {
+          var bUpgrading = $(data)
+            .find("upgrading")
+            .eq(0)
+            .text() === "true";
+          resolve(bUpgrading)
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_UpgradeProgress = function(szDeviceIdentify) {
+    let oPromise = new Promise((resolve, reject) => {
+      this.I_SendHTTPRequest(szDeviceIdentify, m_ISAPIProtocol.CGI.startUpgrade.status, {})
+        .then(data => {
+          var iPercent = parseInt($(data)
+            .find("percent")
+            .eq(0)
+            .text(), 10);
+          resolve(iPercent)
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_StopUpgrade = function() {
+    let oPromise = new Promise((resolve, reject) => {
+      m_pluginOBJECT.JS_StopUpgrade()
+        .then(() => {
+          resolve()
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_CheckPluginInstall = function() {
+    return true
+  };
+  this.I_CheckPluginVersion = function() {
+    let oPromise = new Promise((resolve, reject) => {
+      m_pluginOBJECT.JS_CheckUpdate(m_szVersion)
+        .then(bFlag => {
+          resolve(bFlag)
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_SendHTTPRequest = function(szDeviceIdentify, szURI, options) {
+    let oPromise = new Promise(async function(resolve, reject) {
+      var httpClient = new HttpPluginClient;
+      var szURL = "";
+      var szAuth = "";
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      if (iIndex >= 0) {
+        if ("%" === szURI.substr(0, 1)) {
+          szURI = szURI.substr(8)
+        }
+        var oDeviceInfo = m_deviceSet[iIndex];
+        szURL = oDeviceInfo.szHttpProtocol + oDeviceInfo.szIP + ":" + oDeviceInfo.iCGIPort + "/" + szURI;
+        szAuth = oDeviceInfo.szAuth
+      }
+      var newOptions = {
+        type: "GET",
+        url: szURL,
+        auth: szAuth,
+        success: null,
+        error: null
+      };
+      m_utilsInc.extend(newOptions, options);
+      httpClient.submitRequest(newOptions)
+        .then(function(oRes) {
+          if (200 === oRes.httpStatusCode) {
+            let oData;
+            if (0 === oRes.httpResponse.indexOf("<?xml")) {
+              oData = m_utilsInc.loadXML(oRes.httpResponse)
+            } else {
+              oData = JSON.parse(oRes.httpResponse)
+            }
+            options.success && options.success(oData);
+            resolve(oData)
+          } else if (200 !== oRes.httpStatusCode) {
+            let oData = m_utilsInc.loadXML(oRes.httpResponse);
+            if (!oData) {
+              oData = JSON.parse(oRes.httpResponse)
+            }
+            options.error && options.error({
+              errorCode: oRes.httpStatusCode,
+              errorMsg: oData
+            });
+            reject({
+              errorCode: oRes.httpStatusCode,
+              errorMsg: oData
+            })
+          }
+        }, function(errorCode) {
+          if (options.error) {
+            options.error({
+              errorCode: errorCode,
+              errorMsg: ""
+            })
+          }
+          reject({
+            errorCode: errorCode,
+            errorMsg: ""
+          })
+        })
+    });
+    return oPromise
+  };
+  this.I_ChangeWndNum = function(iWndType) {
+    let oPromise = new Promise((resolve, reject) => {
+      m_pluginOBJECT.JS_ArrangeWindow(iWndType)
+        .then(() => {
+          resolve()
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_GetLastError = function() {
+    let oPromise = new Promise((resolve, reject) => {
+      m_pluginOBJECT.JS_GetLastError()
+        .then(data => {
+          resolve(data)
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_GetWindowStatus = function(iWndIndex) {
+    if (m_utilsInc.isUndefined(iWndIndex)) {
+      var wndSet = [];
+      m_utilsInc.extend(wndSet, m_wndSet);
+      return wndSet
+    } else {
+      var i = this.findWndIndexByIndex(iWndIndex);
+      if (i != -1) {
+        var wndSet = {};
+        m_utilsInc.extend(wndSet, m_wndSet[i]);
+        return wndSet
+      } else {
+        return null
+      }
+    }
+  };
+  this.I_GetIPInfoByMode = function(iMode, szAddress, iPort, szDeviceInfo) {
+    return
+  };
+  this.I_SetPlayModeType = function(iMode) {
+    let oPromise = new Promise((resolve, reject) => {
+      m_pluginOBJECT.JS_SetPlayMode(iMode)
+        .then(() => {
+          resolve()
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_SetSnapDrawMode = function(iWndIndex, iMode) {
+    let bType = false;
+    if (iMode !== -1) {
+      bType = true
+    }
+    let oPromise = new Promise((resolve, reject) => {
+      m_pluginOBJECT.JS_SetDrawStatus(bType, iMode)
+        .then(() => {
+          resolve()
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_SetSnapPolygonInfo = function(iWndIndex, szInfo) {
+    let oPromise = new Promise((resolve, reject) => {
+      var aP = [];
+      var oData = m_utilsInc.formatPolygonXmlToJson(szInfo);
+      if (oData.aAddRect.length > 0) {
+        aP.push(m_pluginOBJECT.JS_SetDrawShapeInfo("Rect", oData.aAddRect[0]))
+      }
+      if (oData.aAddPolygon.length > 0) {
+        aP.push(m_pluginOBJECT.JS_SetDrawShapeInfo("Polygon", oData.aAddPolygon[0]))
+      }
+      if (oData.aRect.length > 0) {
+        aP.push(m_pluginOBJECT.JS_SetRectInfo(oData.aRect))
+      }
+      if (oData.aPolygon.length > 0) {
+        aP.push(m_pluginOBJECT.JS_SetPolygonInfo(oData.aPolygon))
+      }
+      Promise.all(aP)
+        .then(() => {
+          resolve()
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_GetSnapPolygonInfo = function(iWndIndex) {
+    let oPromise = new Promise((resolve, reject) => {
+      var aP = [];
+      aP.push(m_pluginOBJECT.JS_GetPolygonInfo());
+      aP.push(m_pluginOBJECT.JS_GetRectInfo());
+      Promise.all(aP)
+        .then(aData => {
+          var szXmlData = m_utilsInc.formatPolygonJsonToXml(aData);
+          resolve(szXmlData)
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_ClearSnapInfo = function(iWndIndex, aShapes) {
+    let oPromise = new Promise((resolve, reject) => {
+      if (aShapes) {
+        var aPolygon = [];
+        var aRect = [];
+        aShapes.forEach(item => {
+          if (1 === item.polygonType) {
+            aPolygon.push(item.id)
+          } else {
+            aRect.push(item.id)
+          }
+          var aP = [];
+          if (aPolygon.length) {
+            aP.push(m_pluginOBJECT.JS_ClearShapeByType("Polygon", aPolygon))
+          }
+          if (aRect.length) {
+            aP.push(m_pluginOBJECT.JS_ClearShapeByType("Rect", aRect))
+          }
+          Promise.all(aP)
+            .then(() => {
+              resolve()
+            }, () => {
+              reject(_oUnKnownError)
+            })
+        })
+      } else {
+        m_pluginOBJECT.JS_ClearShapeByType("AllWindows")
+          .then(() => {
+            resolve()
+          }, () => {
+            reject(_oUnKnownError)
+          })
+      }
+    });
+    return oPromise
+  };
+  this.I_DeviceCapturePic = function(szDeviceIdentify, iChannelID, szPicName, options) {
+    return false;
+    var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+    var iRet = -1;
+    if (iIndex != -1) {
+      var oDeviceInfo = m_deviceSet[iIndex];
+      var newOptions = {
+        bDateDir: true
+      };
+      m_utilsInc.extend(newOptions, options);
+      if (!m_utilsInc.isUndefined(newOptions.iResolutionWidth) && !m_utilsInc.isInt(newOptions.iResolutionWidth)) {
+        return iRet
+      }
+      if (!m_utilsInc.isUndefined(newOptions.iResolutionHeight) && !m_utilsInc.isInt(newOptions.iResolutionHeight)) {
+        return iRet
+      }
+      iRet = oDeviceInfo.oProtocolInc.deviceCapturePic(oDeviceInfo, iChannelID, szPicName, newOptions)
+    }
+    return iRet
+  };
+  this.I_SetPackageType = function(iPackageType) {
+    let oPromise = new Promise((resolve, reject) => {
+      m_pluginOBJECT.JS_SetPackageType(iPackageType)
+        .then(() => {
+          resolve()
+        }, () => {
+          reject(_oUnKnownError)
+        })
+    });
+    return oPromise
+  };
+  this.I_GetDevicePort = function(szDeviceIdentify) {
+    let oPromise = new Promise(async (resolve, reject) => {
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      var oPort = null;
+      if (iIndex != -1) {
+        var oDeviceInfo = m_deviceSet[iIndex];
+        try {
+          oPort = await _getPort(oDeviceInfo);
+          resolve(oPort)
+        } catch (err) {
+          reject({
+            errorCode: ERROR_CODE_NETWORKERROR,
+            errorMsg: ""
+          })
+        }
+      } else {
+        reject(_oNoLoginError)
+      }
+    });
+    return oPromise
+  };
+  this.I_GetTextOverlay = function(szUrl, szDeviceIdentify, options) {
+    let oPromise = new Promise((resolve, reject) => {
+      var iIndex = this.findDeviceIndexByIP(szDeviceIdentify);
+      if (iIndex != -1) {
+        var oDeviceInfo = m_deviceSet[iIndex];
+        var wndInfo = m_wndSet[iIndex];
+        var newOptions = {
+          type: "GET",
+          success: options.success,
+          error: options.error
+        };
+        this.I_SendHTTPRequest(oDeviceInfo.szIP + "_" + oDeviceInfo.iCGIPort, szUrl, newOptions)
+          .then(oData => {
+            resolve(oData)
+          }, oError => {
+            reject(oError)
+          })
+      } else {
+        reject(_oNoLoginError)
+      }
+    });
+    return oPromise
+  };
+  this.findDeviceIndexByIP = function(szDeviceIdentify) {
+    if (szDeviceIdentify.indexOf("_") > -1) {
+      for (var i = 0, iLen = m_deviceSet.length; i < iLen; i++) {
+        if (m_deviceSet[i].szDeviceIdentify == szDeviceIdentify) {
+          return i
+        }
+      }
+    } else {
+      for (var i = 0, iLen = m_deviceSet.length; i < iLen; i++) {
+        if (m_deviceSet[i].szIP == szDeviceIdentify) {
+          return i
+        }
+      }
+    }
+    return -1
+  };
+  this.findWndIndexByIndex = function(iWndIndex) {
+    for (var i = 0, iLen = m_wndSet.length; i < iLen; i++) {
+      if (m_wndSet[i].iIndex == iWndIndex) {
+        return i
+      }
+    }
+    return -1
+  };
+
+  function deviceInfoClass() {
+    this.szIP = "";
+    this.szHostName = "";
+    this.szAuth = "";
+    this.szHttpProtocol = "http://";
+    this.iCGIPort = 80;
+    this.szDeviceIdentify = "";
+    this.iDevicePort = -1;
+    this.iHttpPort = -1;
+    this.iHttpsPort = -1;
+    this.iRtspPort = -1;
+    this.iAudioType = 1;
+    this.m_iAudioBitRate = -1;
+    this.m_iAudioSamplingRate = -1;
+    this.iDeviceProtocol = PROTOCOL_DEVICE_ISAPI;
+    this.oProtocolInc = null;
+    this.iAnalogChannelNum = 0;
+    this.szDeviceType = "";
+    this.bVoiceTalk = false;
+    this.iDeviceMinusLocalTime = 0
+  }
+  var wndInfoClass = function() {
+    this.iIndex = 0;
+    this.szIP = "";
+    this.iCGIPort = 80;
+    this.szDeviceIdentify = "";
+    this.iChannelID = "";
+    this.iPlayStatus = PLAY_STATUS_STOP;
+    this.bSound = false;
+    this.bRecord = false;
+    this.bPTZAuto = false;
+    this.bEZoom = false;
+    this.b3DZoom = false
+  };
+  var HttpPluginClient = function() {
+    this.options = {
+      type: "GET",
+      url: "",
+      auth: "",
+      timeout: 3e4,
+      data: "",
+      async: true,
+      success: null,
+      error: null
+    };
+    this.m_szHttpHead = "";
+    this.m_szHttpContent = "";
+    this.m_szHttpData = ""
+  };
+  HttpPluginClient.prototype.submitRequest = function(options) {
+    options.method = this.getHttpMethod(options.type);
+    options.content = options.data;
+    delete options.type;
+    delete options.data;
+    return m_pluginOBJECT.JS_SubmitHttpRequest(options)
+  };
+  HttpPluginClient.prototype.getHttpMethod = function(szMethod) {
+    var oMethod = {
+        GET: 1,
+        POST: 2,
+        PUT: 5,
+        DELETE: 6
+      },
+      iMethod = oMethod[szMethod];
+    return iMethod ? iMethod : -1
+  };
+  var ISAPIProtocol = function() {};
+  ISAPIProtocol.prototype.CGI = {
+    login: "%s%s:%s/ISAPI/Security/userCheck?format=json",
+    getAudioInfo: "%s%s:%s/ISAPI/System/TwoWayAudio/channels",
+    getDeviceInfo: "%s%s:%s/ISAPI/System/deviceInfo",
+    getAnalogChannelInfo: "%s%s:%s/ISAPI/System/Video/inputs/channels",
+    getDigitalChannel: "%s%s:%s/ISAPI/ContentMgmt/InputProxy/channels",
+    getDigitalChannelInfo: "%s%s:%s/ISAPI/ContentMgmt/InputProxy/channels/status",
+    getZeroChannelInfo: "%s%s:%s/ISAPI/ContentMgmt/ZeroVideo/channels",
+    getStreamChannels: {
+      analog: "%s%s:%s/ISAPI/Streaming/channels",
+      digital: "%s%s:%s/ISAPI/ContentMgmt/StreamingProxy/channels"
+    },
+    startRealPlay: {
+      channels: "video://%s:%s/%s",
+      zeroChannels: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/ZeroStreaming/channels/%s"
+    },
+    startVoiceTalk: {
+      open: "%s%s:%s/ISAPI/System/TwoWayAudio/channels/%s/open",
+      close: "%s%s:%s/ISAPI/System/TwoWayAudio/channels/%s/close",
+      audioData: "%s%s:%s/ISAPI/System/TwoWayAudio/channels/%s/audioData"
+    },
+    ptzControl: {
+      analog: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/continuous",
+      digital: "%s%s:%s/ISAPI/ContentMgmt/PTZCtrlProxy/channels/%s/continuous"
+    },
+    ptzAutoControl: {
+      analog: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/autoPan",
+      digital: "%s%s:%s/ISAPI/ContentMgmt/PTZCtrlProxy/channels/%s/autoPan"
+    },
+    setPreset: {
+      analog: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/presets/%s",
+      digital: "%s%s:%s/ISAPI/ContentMgmt/PTZCtrlProxy/channels/%s/presets/%s"
+    },
+    goPreset: {
+      analog: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/presets/%s/goto",
+      digital: "%s%s:%s/ISAPI/ContentMgmt/PTZCtrlProxy/channels/%s/presets/%s/goto"
+    },
+    ptzFocus: {
+      analog: "%s%s:%s/ISAPI/System/Video/inputs/channels/%s/focus",
+      digital: "%s%s:%s/ISAPI/ContentMgmt/ImageProxy/channels/%s/focus"
+    },
+    ptzIris: {
+      analog: "%s%s:%s/ISAPI/System/Video/inputs/channels/%s/iris",
+      digital: "%s%s:%s/ISAPI/ContentMgmt/ImageProxy/channels/%s/iris"
+    },
+    getNetworkBond: "%s%s:%s/ISAPI/System/Network/Bond",
+    getNetworkInterface: "%s%s:%s/ISAPI/System/Network/interfaces",
+    getUPnPPortStatus: "%s%s:%s/ISAPI/System/Network/UPnP/ports/status",
+    getPPPoEStatus: "%s%s:%s/ISAPI/System/Network/PPPoE/1/status",
+    getPortInfo: "%s%s:%s/ISAPI/Security/adminAccesses",
+    recordSearch: "%s%s:%s/ISAPI/ContentMgmt/search",
+    startPlayback: "video://%s:%s/%s",
+    startWsPlayback: "%s%s:%s/%s",
+    startShttpPlayback: "%s%s:%s/SDK/playback/%s",
+    startShttpReversePlayback: "%s%s:%s/SDK/playback/%s/reversePlay",
+    startTransCodePlayback: "%s%s:%s/SDK/playback/%s/transcoding",
+    startDownloadRecord: "%s%s:%s/ISAPI/ContentMgmt/download",
+    downloaddeviceConfig: "%s%s:%s/ISAPI/System/configurationData",
+    uploaddeviceConfig: "%s%s:%s/ISAPI/System/configurationData",
+    restart: "%s%s:%s/ISAPI/System/reboot",
+    restore: "%s%s:%s/ISAPI/System/factoryReset?mode=%s",
+    startUpgrade: {
+      upgrade: "%s%s:%s/ISAPI/System/updateFirmware",
+      status: "%s%s:%s/ISAPI/System/upgradeStatus"
+    },
+    set3DZoom: {
+      analog: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/position3D",
+      digital: "%s%s:%s/ISAPI/ContentMgmt/PTZCtrlProxy/channels/%s/position3D"
+    },
+    getSecurityVersion: "%s%s:%s/ISAPI/Security/capabilities?username=admin",
+    SDKCapabilities: "%s%s:%s/SDK/capabilities",
+    deviceCapture: {
+      channels: "%s%s:%s/ISAPI/Streaming/channels/%s/picture"
+    },
+    overlayInfo: {
+      analog: "%s%s:%s/ISAPI/System/Video/inputs/channels/%s/overlays/",
+      digital: "%s%s:%s/ISAPI/ContentMgmt/InputProxy/channels/%s/video/overlays"
+    },
+    sessionCap: "%s%s:%s/ISAPI/Security/sessionLogin/capabilities?username=%s",
+    sessionLogin: "%s%s:%s/ISAPI/Security/sessionLogin",
+    sessionHeartbeat: "%s%s:%s/ISAPI/Security/sessionHeartbeat",
+    sessionLogout: "%s%s:%s/ISAPI/Security/sessionLogout",
+    systemCapabilities: "%s%s:%s/ISAPI/System/capabilities",
+    time: "ISAPI/System/time"
+  };
+  ISAPIProtocol.prototype.login = function(szIP, iPort, szAuth, options) {
+    return m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, this.CGI.login, options)
+  };
+  ISAPIProtocol.prototype.getAudioInfo = function(oDeviceInfo, options) {
+    let oPromise = new Promise(function(resolve, reject) {
+      var newOptions = {};
+      m_utilsInc.extend(newOptions, options);
+      m_utilsInc.extend(newOptions, {
+        success: function(oData) {
+          var oNodeList = NS.$XML(oData)
+            .find("audioCompressionType", true);
+          if (oNodeList.length > 0) {
+            var szAudioCompressionType = NS.$XML(oNodeList)
+                .eq(0)
+                .text(),
+              iAudioType = 0;
+            if ("G.711ulaw" == szAudioCompressionType) {
+              iAudioType = 1
+            } else if ("G.711alaw" == szAudioCompressionType) {
+              iAudioType = 2
+            } else if ("G.726" == szAudioCompressionType) {
+              iAudioType = 3
+            } else if ("MP2L2" == szAudioCompressionType || "MPEL2" == szAudioCompressionType) {
+              iAudioType = 4
+            } else if ("G.722.1" == szAudioCompressionType) {
+              iAudioType = 0
+            } else if ("AAC" == szAudioCompressionType) {
+              iAudioType = 5
+            } else if ("PCM" == szAudioCompressionType) {
+              iAudioType = 6
+            } else if ("MP3" == szAudioCompressionType) {
+              iAudioType = 7
+            }
+            oDeviceInfo.iAudioType = iAudioType
+          }
+          if (NS.$XML(oData)
+            .find("audioBitRate")
+            .eq(0)
+            .text() !== "") {
+            oDeviceInfo.m_iAudioBitRate = parseInt(NS.$XML(oData)
+              .find("audioBitRate")
+              .eq(0)
+              .text(), 10) * 1e3
+          } else {
+            oDeviceInfo.m_iAudioBitRate = 0
+          }
+          if (NS.$XML(oData)
+            .find("audioSamplingRate")
+            .eq(0)
+            .text() !== "") {
+            oDeviceInfo.m_iAudioSamplingRate = parseInt(NS.$XML(oData)
+              .find("audioSamplingRate")
+              .eq(0)
+              .text(), 10) * 1e3
+          } else {
+            oDeviceInfo.m_iAudioSamplingRate = 0
+          }
+          if (NS.$XML(oData)
+            .find("channelNum")
+            .eq(0)
+            .text() !== "") {
+            oDeviceInfo.m_iSoundChan = parseInt(NS.$XML(oData)
+              .find("channelNum")
+              .eq(0)
+              .text(), 10)
+          } else {
+            oDeviceInfo.m_iSoundChan = 1
+          }
+          if (NS.$XML(oData)
+            .find("deviceCastChannelNum")
+            .eq(0)
+            .text() !== "") {
+            oDeviceInfo.m_iDeviceAudioSoundChan = parseInt(NS.$XML(oData)
+              .find("deviceCastChannelNum")
+              .eq(0)
+              .text(), 10)
+          } else {
+            oDeviceInfo.m_iDeviceAudioSoundChan = 1
+          }
+          if (options.success) {
+            options.success(oData)
+          }
+          resolve(oData)
+        },
+        error: function(oError) {
+          if (options.error) {
+            options.error(oError)
+          }
+          reject(oError)
+        }
+      });
+      m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, m_ISAPIProtocol.CGI.getAudioInfo, newOptions)
+    });
+    return oPromise
+  };
+  ISAPIProtocol.prototype.getDeviceInfo = function(oDeviceInfo, options) {
+    let oPromise = new Promise(function(resolve, reject) {
+      var newOptions = {};
+      m_utilsInc.extend(newOptions, options);
+      m_utilsInc.extend(newOptions, {
+        success: function(xmlDoc) {
+          var oData;
+          oDeviceInfo.szDeviceType = NS.$XML(xmlDoc)
+            .find("deviceType")
+            .eq(0)
+            .text();
+          var arrXml = [];
+          arrXml.push("<DeviceInfo>");
+          arrXml.push("<deviceName>" + m_utilsInc.escape(NS.$XML(xmlDoc)
+            .find("deviceName")
+            .eq(0)
+            .text()) + "</deviceName>");
+          arrXml.push("<deviceID>" + NS.$XML(xmlDoc)
+            .find("deviceID")
+            .eq(0)
+            .text() + "</deviceID>");
+          arrXml.push("<deviceType>" + NS.$XML(xmlDoc)
+            .find("deviceType")
+            .eq(0)
+            .text() + "</deviceType>");
+          arrXml.push("<model>" + NS.$XML(xmlDoc)
+            .find("model")
+            .eq(0)
+            .text() + "</model>");
+          arrXml.push("<serialNumber>" + NS.$XML(xmlDoc)
+            .find("serialNumber")
+            .eq(0)
+            .text() + "</serialNumber>");
+          arrXml.push("<macAddress>" + NS.$XML(xmlDoc)
+            .find("macAddress")
+            .eq(0)
+            .text() + "</macAddress>");
+          arrXml.push("<firmwareVersion>" + NS.$XML(xmlDoc)
+            .find("firmwareVersion")
+            .eq(0)
+            .text() + "</firmwareVersion>");
+          arrXml.push("<firmwareReleasedDate>" + NS.$XML(xmlDoc)
+            .find("firmwareReleasedDate")
+            .eq(0)
+            .text() + "</firmwareReleasedDate>");
+          arrXml.push("<encoderVersion>" + NS.$XML(xmlDoc)
+            .find("encoderVersion")
+            .eq(0)
+            .text() + "</encoderVersion>");
+          arrXml.push("<encoderReleasedDate>" + NS.$XML(xmlDoc)
+            .find("encoderReleasedDate")
+            .eq(0)
+            .text() + "</encoderReleasedDate>");
+          arrXml.push("</DeviceInfo>");
+          oData = m_utilsInc.loadXML(arrXml.join(""));
+          if (options.success) {
+            options.success(oData)
+          }
+          resolve(oData)
+        },
+        error: function(oError) {
+          if (options.error) {
+            options.error(oError)
+          }
+          reject(oError)
+        }
+      });
+      m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, m_ISAPIProtocol.CGI.getDeviceInfo, newOptions)
+    });
+    return oPromise
+  };
+  ISAPIProtocol.prototype.getDeviceMinusLocalTime = function(oDeviceInfo) {
+    let oPromise = new Promise(function(resolve, reject) {
+      var newOptions = {
+        success: xmlDoc => {
+          var szDeviceTime = $(xmlDoc)
+            .find("localTime")
+            .eq(0)
+            .text()
+            .substring(0, 19);
+          var arDTms = szDeviceTime.match(/(\d+)-(\d+)-(\d+)(\D+)(\d+):(\d+):(\d+)/);
+          if (arDTms.length !== 8) {
+            return
+          }
+          var dtDeviceDate = new Date(arDTms[1], arDTms[2] - 1, arDTms[3], arDTms[5], arDTms[6], arDTms[7]);
+          var szTimeZone = $(xmlDoc)
+            .find("timeZone")
+            .eq(0)
+            .text();
+          var iDSTTime = 0;
+          var iDSTPos = szTimeZone.indexOf("DST");
+          if (iDSTPos != -1) {
+            var dtDSTStart = new Date(dtDeviceDate.getTime());
+            dtDSTStart.setMinutes(0);
+            dtDSTStart.setSeconds(0);
+            var dtDSTStop = new Date(dtDeviceDate.getTime());
+            dtDSTStop.setMinutes(0);
+            dtDSTStop.setSeconds(0);
+            var szDSTStartTime = szTimeZone.split(",")[1];
+            var szDSTStopTime = szTimeZone.split(",")[2];
+            var iDSTStartMonth = parseInt(szDSTStartTime.split(".")[0].replace("M", ""), 10);
+            dtDSTStart.setMonth(iDSTStartMonth - 1);
+            var iDSTStartWeek = parseInt(szDSTStartTime.split(".")[1], 10);
+            var iDSTStartDay = parseInt(szDSTStartTime.split(".")[2].split("/")[0]);
+            var iDSTStartTime = parseInt(szDSTStartTime.split(".")[2].split("/")[1].split(":")[0], 10);
+            dtDSTStart.setHours(iDSTStartTime);
+            var iTime = 0;
+            var iDate = 0;
+            for (var i = 1; i <= 31; i++) {
+              dtDSTStart.setDate(i);
+              if (dtDSTStart.getMonth() !== iDSTStartMonth - 1) {
+                break
+              }
+              if (dtDSTStart.getDay() == iDSTStartDay) {
+                iTime++;
+                iDate = i;
+                if (iTime == iDSTStartWeek) {
+                  break
+                }
+              }
+            }
+            dtDSTStart.setDate(iDate);
+            dtDSTStart.setMonth(iDSTStartMonth - 1);
+            var iDSTStopMonth = parseInt(szDSTStopTime.split(".")[0].replace("M", ""), 10);
+            dtDSTStop.setMonth(iDSTStopMonth - 1);
+            var iDSTStopWeek = parseInt(szDSTStopTime.split(".")[1], 10);
+            var iDSTStopDay = parseInt(szDSTStopTime.split(".")[2].split("/")[0]);
+            var iDSTStopTime = parseInt(szDSTStopTime.split(".")[2].split("/")[1].split(":")[0], 10);
+            dtDSTStop.setHours(iDSTStopTime);
+            iTime = 0;
+            iDate = 0;
+            for (var i = 1; i <= 31; i++) {
+              dtDSTStop.setDate(i);
+              if (dtDSTStop.getMonth() !== iDSTStopMonth - 1) {
+                break
+              }
+              if (dtDSTStop.getDay() == iDSTStopDay) {
+                iTime++;
+                iDate = i;
+                if (iTime == iDSTStopWeek) {
+                  break
+                }
+              }
+            }
+            dtDSTStop.setDate(iDate);
+            dtDSTStop.setMonth(iDSTStopMonth - 1);
+            if (dtDSTStart.getTime() < dtDSTStop.getTime()) {
+              if (dtDeviceDate.getTime() >= dtDSTStart.getTime() && dtDeviceDate.getTime() <= dtDSTStop.getTime()) {
+                var szDSTTime = szTimeZone.substring(iDSTPos + 3, iDSTPos + 11);
+                iDSTTime = parseInt(szDSTTime.split(":")[0], 10) * 60 + parseInt(szDSTTime.split(":")[1], 10)
+              }
+            } else {
+              if (dtDeviceDate.getTime() >= dtDSTStart.getTime() || dtDeviceDate.getTime() <= dtDSTStop.getTime()) {
+                var szDSTTime = szTimeZone.substring(iDSTPos + 3, iDSTPos + 11);
+                iDSTTime = parseInt(szDSTTime.split(":")[0], 10) * 60 + parseInt(szDSTTime.split(":")[1], 10)
+              }
+            }
+          }
+          var arDTZms = szTimeZone.match(/\D+([+-])(\d+):(\d+):(\d+)/);
+          if (arDTZms.length == 5) {
+            var dtNow = new Date;
+            var iLocalOffsetMin = dtNow.getTimezoneOffset();
+            var iDeviceOffsetMin = parseInt(arDTZms[2]) * 60 + parseInt(arDTZms[3]);
+            iDeviceOffsetMin = arDTZms[1] === "+" ? iDeviceOffsetMin : -iDeviceOffsetMin;
+            iDeviceMinusLocalTime = (iLocalOffsetMin - iDeviceOffsetMin + iDSTTime) * 60 * 1e3
+          }
+          oDeviceInfo.iDeviceMinusLocalTime = iDeviceMinusLocalTime;
+          resolve(iDeviceMinusLocalTime)
+        },
+        error: () => {
+          reject()
+        }
+      };
+      m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, m_ISAPIProtocol.CGI.time, newOptions)
+    });
+    return oPromise
+  };
+  ISAPIProtocol.prototype.getAnalogChannelInfo = function(oDeviceInfo, options) {
+    let oPromise = new Promise(function(resolve, reject) {
+      var newOptions = {};
+      m_utilsInc.extend(newOptions, options);
+      m_utilsInc.extend(newOptions, {
+        success: function(xmlData) {
+          var arrXml = [];
+          arrXml.push("<VideoInputChannelList>");
+          var nodeList = NS.$XML(xmlData)
+            .find("VideoInputChannel", true);
+          oDeviceInfo.iAnalogChannelNum = nodeList.length;
+          for (var i = 0, iLen = nodeList.length; i < iLen; i++) {
+            var node = nodeList[i];
+            arrXml.push("<VideoInputChannel>");
+            arrXml.push("<id>" + NS.$XML(node)
+              .find("id")
+              .eq(0)
+              .text() + "</id>");
+            arrXml.push("<inputPort>" + NS.$XML(node)
+              .find("inputPort")
+              .eq(0)
+              .text() + "</inputPort>");
+            arrXml.push("<name>" + m_utilsInc.escape(NS.$XML(node)
+              .find("name")
+              .eq(0)
+              .text()) + "</name>");
+            arrXml.push("<videoFormat>" + NS.$XML(node)
+              .find("videoFormat")
+              .eq(0)
+              .text() + "</videoFormat>");
+            arrXml.push("</VideoInputChannel>")
+          }
+          arrXml.push("</VideoInputChannelList>");
+          var xmlDoc = m_utilsInc.loadXML(arrXml.join(""));
+          if (options.success) {
+            options.success(xmlDoc)
+          }
+          resolve(xmlDoc)
+        },
+        error: function(oError) {
+          if (options.error) {
+            options.error(oError)
+          }
+          reject(oError)
+        }
+      });
+      m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, m_ISAPIProtocol.CGI.getAnalogChannelInfo, newOptions)
+    });
+    return oPromise
+  };
+  ISAPIProtocol.prototype.getDigitalChannel = function(oDeviceInfo, options) {
+    let oPromise = new Promise(function(resolve, reject) {
+      var newOptions = {};
+      m_utilsInc.extend(newOptions, options);
+      m_utilsInc.extend(newOptions, {
+        success: function(xmlData) {
+          var arrXml = [];
+          arrXml.push("<InputProxyChannelList>");
+          var nodeList = NS.$XML(xmlData)
+            .find("InputProxyChannel", true);
+          for (var i = 0, iLen = nodeList.length; i < iLen; i++) {
+            var node = nodeList[i];
+            arrXml.push("<InputProxyChannel>");
+            arrXml.push("<id>" + NS.$XML(node)
+              .find("id")
+              .eq(0)
+              .text() + "</id>");
+            arrXml.push("<name>" + m_utilsInc.escape(NS.$XML(node)
+              .find("name")
+              .eq(0)
+              .text()) + "</name>");
+            arrXml.push("</InputProxyChannel>")
+          }
+          arrXml.push("</InputProxyChannelList>");
+          var xmlDoc = m_utilsInc.loadXML(arrXml.join(""));
+          if (options.success) {
+            options.success(xmlDoc)
+          }
+          resolve(xmlDoc)
+        },
+        error: function(oError) {
+          if (options.error) {
+            options.error(oError)
+          }
+          reject(oError)
+        }
+      });
+      m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, m_ISAPIProtocol.CGI.getDigitalChannel, newOptions)
+    });
+    return oPromise
+  };
+  ISAPIProtocol.prototype.getDigitalChannelInfo = function(oDeviceInfo, options) {
+    let oPromise = new Promise(async (resolve, reject) => {
+      var oDigitalChannelXML = null,
+        oDigitalChannelName = {};
+      try {
+        oDigitalChannelXML = await m_ISAPIProtocol.getDigitalChannel(oDeviceInfo, {})
+      } catch (oError) {
+        reject(oError)
+      }
+      var nodeList = NS.$XML(oDigitalChannelXML)
+        .find("InputProxyChannel", true);
+      for (var i = 0, iLen = nodeList.length; i < iLen; i++) {
+        var node = nodeList[i],
+          szId = NS.$XML(node)
+            .find("id")
+            .eq(0)
+            .text(),
+          szName = NS.$XML(node)
+            .find("name")
+            .eq(0)
+            .text();
+        oDigitalChannelName[szId] = szName
+      }
+      var newOptions = {};
+      m_utilsInc.extend(newOptions, options);
+      m_utilsInc.extend(newOptions, {
+        success: function(xmlData) {
+          var arrXml = [];
+          arrXml.push("<InputProxyChannelStatusList>");
+          var nodeList = NS.$XML(xmlData)
+            .find("InputProxyChannelStatus", true);
+          for (var i = 0, iLen = nodeList.length; i < iLen; i++) {
+            var node = nodeList[i],
+              szId = NS.$XML(node)
+                .find("id")
+                .eq(0)
+                .text();
+            arrXml.push("<InputProxyChannelStatus>");
+            arrXml.push("<id>" + szId + "</id>");
+            arrXml.push("<sourceInputPortDescriptor>");
+            arrXml.push("<proxyProtocol>" + NS.$XML(node)
+              .find("proxyProtocol")
+              .eq(0)
+              .text() + "</proxyProtocol>");
+            arrXml.push("<addressingFormatType>" + NS.$XML(node)
+              .find("addressingFormatType")
+              .eq(0)
+              .text() + "</addressingFormatType>");
+            arrXml.push("<ipAddress>" + NS.$XML(node)
+              .find("ipAddress")
+              .eq(0)
+              .text() + "</ipAddress>");
+            arrXml.push("<managePortNo>" + NS.$XML(node)
+              .find("managePortNo")
+              .eq(0)
+              .text() + "</managePortNo>");
+            arrXml.push("<srcInputPort>" + NS.$XML(node)
+              .find("srcInputPort")
+              .eq(0)
+              .text() + "</srcInputPort>");
+            arrXml.push("<userName>" + m_utilsInc.escape(NS.$XML(node)
+              .find("userName")
+              .eq(0)
+              .text()) + "</userName>");
+            arrXml.push("<streamType>" + NS.$XML(node)
+              .find("streamType")
+              .eq(0)
+              .text() + "</streamType>");
+            arrXml.push("<online>" + NS.$XML(node)
+              .find("online")
+              .eq(0)
+              .text() + "</online>");
+            arrXml.push("<name>" + m_utilsInc.escape(oDigitalChannelName[szId]) + "</name>");
+            arrXml.push("</sourceInputPortDescriptor>");
+            arrXml.push("</InputProxyChannelStatus>")
+          }
+          arrXml.push("</InputProxyChannelStatusList>");
+          var xmlDoc = m_utilsInc.loadXML(arrXml.join(""));
+          if (options.success) {
+            options.success(xmlDoc)
+          }
+          resolve(xmlDoc)
+        },
+        error: function(oError) {
+          if (options.error) {
+            options.error(oError)
+          }
+          reject(oError)
+        }
+      });
+      m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, m_ISAPIProtocol.CGI.getDigitalChannelInfo, newOptions)
+    });
+    return oPromise
+  };
+  ISAPIProtocol.prototype.getZeroChannelInfo = function(oDeviceInfo, options) {
+    return m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, this.CGI.getZeroChannelInfo, options)
+  };
+  ISAPIProtocol.prototype.getStreamChannels = function(oDeviceInfo, options) {
+    if (oDeviceInfo.iAnalogChannelNum != 0) {
+      var url = m_utilsInc.formatString(this.CGI.getStreamChannels.analog, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort)
+    } else {
+      var url = m_utilsInc.formatString(this.CGI.getStreamChannels.digital, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort)
+    }
+    let szURI;
+    if (oDeviceInfo.iAnalogChannelNum != 0) {
+      szURI = this.CGI.getStreamChannels.analog
+    } else {
+      szURI = this.CGI.getStreamChannels.digital
+    }
+    return m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, szURI, options)
+  };
+  ISAPIProtocol.prototype.getPPPoEStatus = function(oDeviceInfo, options) {
+    return m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, this.CGI.getPPPoEStatus, options)
+  };
+  ISAPIProtocol.prototype.getUPnPPortStatus = function(oDeviceInfo, options) {
+    return m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, this.CGI.getUPnPPortStatus, options)
+  };
+  ISAPIProtocol.prototype.getNetworkBond = function(oDeviceInfo, options) {
+    return m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, this.CGI.getNetworkBond, options)
+  };
+  ISAPIProtocol.prototype.getNetworkInterface = function(oDeviceInfo, options) {
+    return m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, this.CGI.getNetworkInterface, options)
+  };
+  ISAPIProtocol.prototype.getPortInfo = function(oDeviceInfo, options) {
+    return m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, this.CGI.getPortInfo, options)
+  };
+  ISAPIProtocol.prototype.startRealPlay = function(oDeviceInfo, options) {
+    let oPromise = new Promise(async function(resolve, reject) {
+      var iChannelID = options.iChannelID * 100 + options.iStreamType,
+        szUrl = "";
+      var szRtspIP = m_utilsInc.delPort(oDeviceInfo.szIP);
+      var iRtspPort = oDeviceInfo.iRtspPort;
+      if (options.iPort) {
+        iRtspPort = options.iPort
+      }
+      if (options.bZeroChannel) {
+        szUrl = m_utilsInc.formatString(oDeviceInfo.oProtocolInc.CGI.startRealPlay.zeroChannels, szRtspIP, iRtspPort, iChannelID)
+      } else {
+        szUrl = m_utilsInc.formatString(oDeviceInfo.oProtocolInc.CGI.startRealPlay.channels, szRtspIP, iRtspPort, iChannelID)
+      }
+      var addToWndSet = function() {
+        var wndInfo = new wndInfoClass;
+        wndInfo.iIndex = options.iWndIndex;
+        wndInfo.szIP = oDeviceInfo.szIP;
+        wndInfo.iCGIPort = oDeviceInfo.iCGIPort;
+        wndInfo.szDeviceIdentify = oDeviceInfo.szDeviceIdentify;
+        wndInfo.iChannelID = options.iChannelID;
+        wndInfo.iPlayStatus = PLAY_STATUS_REALPLAY;
+        m_wndSet.push(wndInfo)
+      };
+      await m_pluginOBJECT.JS_SetSecretKey(0, m_oLocalCfg.secretKey, 1);
+      m_pluginOBJECT.JS_Play(szUrl, {
+        auth: oDeviceInfo.szAuth,
+        userInfo: oDeviceInfo.szAuth
+      }, options.iWndIndex, "", "", options.bFlag)
+        .then(() => {
+          addToWndSet();
+          resolve()
+        }, () => {
+          reject()
+        })
+    });
+    return oPromise
+  };
+  ISAPIProtocol.prototype.startPlay = function(oDeviceInfo, options) {
+    let oPromise = new Promise(async function(resolve, reject) {
+      var addToWndSet = function() {
+        var wndInfo = new wndInfoClass;
+        wndInfo.iIndex = options.iWndIndex;
+        wndInfo.szIP = oDeviceInfo.szIP;
+        wndInfo.szDeviceIdentify = oDeviceInfo.szDeviceIdentify;
+        wndInfo.iPlayStatus = PLAY_STATUS_PLAYBACK;
+        m_wndSet.push(wndInfo)
+      };
+      m_pluginOBJECT.JS_Play(options.szUrl, {
+        auth: oDeviceInfo.szAuth,
+        userInfo: oDeviceInfo.szAuth
+      }, options.iWndIndex, options.startTime, options.endTime, true)
+        .then(() => {
+          addToWndSet();
+          resolve()
+        }, () => {
+          reject()
+        })
+    });
+    return oPromise
+  };
+  ISAPIProtocol.prototype.startVoiceTalk = function(oDeviceInfo, iAudioChannel) {
+    var szOpenUrl = m_utilsInc.formatString(this.CGI.startVoiceTalk.open, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort, iAudioChannel),
+      szCloseUrl = m_utilsInc.formatString(this.CGI.startVoiceTalk.close, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort, iAudioChannel),
+      szAudioDataUrl = m_utilsInc.formatString(this.CGI.startVoiceTalk.audioData, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort, iAudioChannel);
+    return m_pluginOBJECT.JS_StartTalk(szOpenUrl, szCloseUrl, szAudioDataUrl, oDeviceInfo.szAuth, oDeviceInfo.iAudioType, oDeviceInfo.m_iAudioBitRate, oDeviceInfo.m_iAudioSamplingRate, oDeviceInfo.m_iSoundChan, oDeviceInfo.m_iDeviceAudioSoundChan)
+  };
+  ISAPIProtocol.prototype.audioPlay = function(options) {
+    return m_pluginOBJECT.JS_AudioPlay(options.szUrl, options.szAuth, -1, -1, true, options.iAudioType)
+  };
+  ISAPIProtocol.prototype.ptzAutoControl = function(oDeviceInfo, bStop, oWndInfo, options) {
+    let oPromise = new Promise((resolve, reject) => {
+      var iChannelID = oWndInfo.iChannelID,
+        szUrl = "",
+        szData = "";
+      options.iPTZSpeed = options.iPTZSpeed < 7 ? options.iPTZSpeed * 15 : 100;
+      if (bStop) {
+        options.iPTZSpeed = 0
+      }
+      if (iChannelID <= oDeviceInfo.iAnalogChannelNum) {
+        szUrl = m_utilsInc.formatString(m_ISAPIProtocol.CGI.ptzAutoControl.analog, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort, oWndInfo.iChannelID)
+      } else {
+        szUrl = m_utilsInc.formatString(m_ISAPIProtocol.CGI.ptzAutoControl.digital, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort, oWndInfo.iChannelID)
+      }
+      szData = "<?xml version='1.0' encoding='UTF-8'?>" + "<autoPanData>" + "<autoPan>" + options.iPTZSpeed + "</autoPan>" + "</autoPanData>";
+      var newOptions = {
+        type: "PUT",
+        url: szUrl,
+        data: szData,
+        success: null,
+        error: null
+      };
+      var self = this;
+      m_utilsInc.extend(newOptions, options);
+      m_utilsInc.extend(newOptions, {
+        success: function() {
+          oWndInfo.bPTZAuto = !oWndInfo.bPTZAuto;
+          if (options.success) {
+            options.success()
+          }
+          resolve()
+        },
+        error: function(oError) {
+          if (options.error) {
+            options.error(oError)
+          }
+          reject(oError)
+        }
+      });
+      m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, "", newOptions)
+    });
+    return oPromise
+  };
+  ISAPIProtocol.prototype.ptzControl = function(oDeviceInfo, bStop, oWndInfo, options) {
+    var iChannelID = oWndInfo.iChannelID,
+      szUrl = "";
+    if (oWndInfo.bPTZAuto) {
+      this.ptzAutoControl(oDeviceInfo, true, oWndInfo, {
+        iPTZSpeed: 0
+      })
+    }
+    if (bStop) {
+      options.iPTZSpeed = 0
+    } else {
+      options.iPTZSpeed = options.iPTZSpeed < 7 ? options.iPTZSpeed * 15 : 100
+    }
+    var oDirection = [{}, {
+      pan: 0,
+      tilt: options.iPTZSpeed
+    }, {
+      pan: 0,
+      tilt: -options.iPTZSpeed
+    }, {
+      pan: -options.iPTZSpeed,
+      tilt: 0
+    }, {
+      pan: options.iPTZSpeed,
+      tilt: 0
+    }, {
+      pan: -options.iPTZSpeed,
+      tilt: options.iPTZSpeed
+    }, {
+      pan: -options.iPTZSpeed,
+      tilt: -options.iPTZSpeed
+    }, {
+      pan: options.iPTZSpeed,
+      tilt: options.iPTZSpeed
+    }, {
+      pan: options.iPTZSpeed,
+      tilt: -options.iPTZSpeed
+    }, {}, {
+      speed: options.iPTZSpeed
+    }, {
+      speed: -options.iPTZSpeed
+    }, {
+      speed: options.iPTZSpeed
+    }, {
+      speed: -options.iPTZSpeed
+    }, {
+      speed: options.iPTZSpeed
+    }, {
+      speed: -options.iPTZSpeed
+    }];
+    var szData = "";
+    var oCommond = {};
+    switch (options.iPTZIndex) {
+      case 1:
+      case 2:
+      case 3:
+      case 4:
+      case 5:
+      case 6:
+      case 7:
+      case 8:
+        oCommond = this.CGI.ptzControl;
+        szData = "<?xml version='1.0' encoding='UTF-8'?>" + "<PTZData>" + "<pan>" + oDirection[options.iPTZIndex].pan + "</pan>" + "<tilt>" + oDirection[options.iPTZIndex].tilt + "</tilt>" + "</PTZData>";
+        break;
+      case 10:
+      case 11:
+        oCommond = this.CGI.ptzControl;
+        szData = "<?xml version='1.0' encoding='UTF-8'?>" + "<PTZData>" + "<zoom>" + oDirection[options.iPTZIndex].speed + "</zoom>" + "</PTZData>";
+        break;
+      case 12:
+      case 13:
+        oCommond = this.CGI.ptzFocus;
+        szData = "<?xml version='1.0' encoding='UTF-8'?>" + "<FocusData>" + "<focus>" + oDirection[options.iPTZIndex].speed + "</focus>" + "</FocusData>";
+        break;
+      case 14:
+      case 15:
+        oCommond = this.CGI.ptzIris;
+        szData = "<?xml version='1.0' encoding='UTF-8'?>" + "<IrisData>" + "<iris>" + oDirection[options.iPTZIndex].speed + "</iris>" + "</IrisData>";
+        break;
+      default:
+        return
+    }
+    if (iChannelID <= oDeviceInfo.iAnalogChannelNum) {
+      szUrl = m_utilsInc.formatString(oCommond.analog, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort, oWndInfo.iChannelID)
+    } else {
+      szUrl = m_utilsInc.formatString(oCommond.digital, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort, oWndInfo.iChannelID)
+    }
+    var newOptions = {
+      type: "PUT",
+      url: szUrl,
+      data: szData,
+      success: null,
+      error: null
+    };
+    m_utilsInc.extend(newOptions, options);
+    return m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, "", newOptions)
+  };
+  ISAPIProtocol.prototype.setPreset = function(oDeviceInfo, oWndInfo, options) {
+    var iChannelID = oWndInfo.iChannelID,
+      szUrl = "",
+      szData = "";
+    if (iChannelID <= oDeviceInfo.iAnalogChannelNum) {
+      szUrl = m_utilsInc.formatString(this.CGI.setPreset.analog, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort, oWndInfo.iChannelID, options.iPresetID)
+    } else {
+      szUrl = m_utilsInc.formatString(this.CGI.setPreset.digital, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort, oWndInfo.iChannelID, options.iPresetID)
+    }
+    szData = "<?xml version='1.0' encoding='UTF-8'?>";
+    szData += "<PTZPreset>";
+    szData += "<id>" + options.iPresetID + "</id>";
+    if (oDeviceInfo.szDeviceType != DEVICE_TYPE_IPDOME) {
+      szData += "<presetName>" + "Preset" + options.iPresetID + "</presetName>"
+    }
+    szData += "</PTZPreset>";
+    var newOptions = {
+      type: "PUT",
+      url: szUrl,
+      data: szData,
+      success: null,
+      error: null
+    };
+    m_utilsInc.extend(newOptions, options);
+    return m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, "", newOptions)
+  };
+  ISAPIProtocol.prototype.goPreset = function(oDeviceInfo, oWndInfo, options) {
+    var iChannelID = oWndInfo.iChannelID,
+      szUrl = "";
+    if (iChannelID <= oDeviceInfo.iAnalogChannelNum) {
+      szUrl = m_utilsInc.formatString(this.CGI.goPreset.analog, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort, oWndInfo.iChannelID, options.iPresetID)
+    } else {
+      szUrl = m_utilsInc.formatString(this.CGI.goPreset.digital, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort, oWndInfo.iChannelID, options.iPresetID)
+    }
+    var newOptions = {
+      type: "PUT",
+      url: szUrl,
+      success: null,
+      error: null
+    };
+    m_utilsInc.extend(newOptions, options);
+    return m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, "", newOptions)
+  };
+  ISAPIProtocol.prototype.recordSearch = function(oDeviceInfo, options) {
+    let oPromise = new Promise((resolve, reject) => {
+      var szUrl = "",
+        szData = "",
+        iChannelID = options.iChannelID,
+        iStreamType = options.iStreamType,
+        szStartTime = options.szStartTime.replace(" ", "T") + "Z",
+        szEndTime = options.szEndTime.replace(" ", "T") + "Z";
+      szUrl = m_utilsInc.formatString(m_ISAPIProtocol.CGI.recordSearch, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort);
+      szData = "<?xml version='1.0' encoding='UTF-8'?>" + "<CMSearchDescription>" + "<searchID>" + new UUID + "</searchID>" + "<trackList><trackID>" + (iChannelID * 100 + iStreamType) + "</trackID></trackList>" + "<timeSpanList>" + "<timeSpan>" + "<startTime>" + szStartTime + "</startTime>" + "<endTime>" + szEndTime + "</endTime>" + "</timeSpan>" + "</timeSpanList>" + "<maxResults>50</maxResults>" + "<searchResultPostion>" + options.iSearchPos + "</searchResultPostion>" + "<metadataList>" + "<metadataDescriptor>//metadata.ISAPI.org/VideoMotion</metadataDescriptor>" + "</metadataList>" + "</CMSearchDescription>";
+      var httpClient = new HttpPluginClient;
+      var newOptions = {
+        type: "POST",
+        url: szUrl,
+        data: szData,
+        success: null,
+        error: null
+      };
+      m_utilsInc.extend(newOptions, options);
+      m_utilsInc.extend(newOptions, {
+        success: function(xmlDoc) {
+          var arrXml = [];
+          arrXml.push("<CMSearchResult>");
+          arrXml.push("<responseStatus>" + NS.$XML(xmlDoc)
+            .find("responseStatus")
+            .eq(0)
+            .text() + "</responseStatus>");
+          arrXml.push("<responseStatusStrg>" + NS.$XML(xmlDoc)
+            .find("responseStatusStrg")
+            .eq(0)
+            .text() + "</responseStatusStrg>");
+          arrXml.push("<numOfMatches>" + NS.$XML(xmlDoc)
+            .find("numOfMatches")
+            .eq(0)
+            .text() + "</numOfMatches>");
+          arrXml.push("<matchList>");
+          var nodeList = NS.$XML(xmlDoc)
+            .find("searchMatchItem", true);
+          for (var i = 0, iLen = nodeList.length; i < iLen; i++) {
+            var node = nodeList[i];
+            arrXml.push("<searchMatchItem>");
+            arrXml.push("<trackID>" + NS.$XML(node)
+              .find("trackID")
+              .eq(0)
+              .text() + "</trackID>");
+            arrXml.push("<startTime>" + NS.$XML(node)
+              .find("startTime")
+              .eq(0)
+              .text() + "</startTime>");
+            arrXml.push("<endTime>" + NS.$XML(node)
+              .find("endTime")
+              .eq(0)
+              .text() + "</endTime>");
+            arrXml.push("<playbackURI>" + m_utilsInc.escape(NS.$XML(node)
+              .find("playbackURI")
+              .eq(0)
+              .text()) + "</playbackURI>");
+            arrXml.push("<metadataDescriptor>" + NS.$XML(node)
+              .find("metadataDescriptor")
+              .eq(0)
+              .text()
+              .split("/")[1] + "</metadataDescriptor>");
+            arrXml.push("</searchMatchItem>")
+          }
+          arrXml.push("</matchList>");
+          arrXml.push("</CMSearchResult>");
+          xmlDoc = m_utilsInc.loadXML(arrXml.join(""));
+          if (options.success) {
+            options.success(xmlDoc)
+          }
+          resolve(xmlDoc)
+        },
+        error: function(oError) {
+          if (options.error) {
+            options.error(oError)
+          }
+          reject(oError)
+        }
+      });
+      m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, "", newOptions)
+    });
+    return oPromise
+  };
+  ISAPIProtocol.prototype.startPlayback = function(oDeviceInfo, options) {
+    let oPromise = new Promise(async function(resolve, reject) {
+      var iWndIndex = options.iWndIndex,
+        szUrl = "",
+        szStartTime = options.szStartTime,
+        szEndTime = options.szEndTime;
+      var szRtspIP = m_utilsInc.delPort(oDeviceInfo.szIP);
+      var iRtspPort = oDeviceInfo.iRtspPort;
+      if (options.iPort) {
+        iRtspPort = options.iPort
+      }
+      szUrl = m_utilsInc.formatString(options.cgi, szRtspIP, iRtspPort, options.iChannelID);
+      if (!m_utilsInc.isUndefined(options.oTransCodeParam)) {
+        var szTransStreamXml = _generateTransCodeXml(options.oTransCodeParam);
+        if ("" == szTransStreamXml) {
+          return -1
+        }
+        m_pluginOBJECT.JS_SetTrsPlayBackParam(iWndIndex, szTransStreamXml)
+      }
+      var addToWndSet = function() {
+        var wndInfo = new wndInfoClass;
+        wndInfo.iIndex = iWndIndex;
+        wndInfo.szIP = oDeviceInfo.szIP;
+        wndInfo.iCGIPort = oDeviceInfo.iCGIPort;
+        wndInfo.szDeviceIdentify = oDeviceInfo.szDeviceIdentify;
+        wndInfo.iChannelID = options.iChannelID;
+        wndInfo.iPlayStatus = PLAY_STATUS_PLAYBACK;
+        m_wndSet.push(wndInfo)
+      };
+      m_pluginOBJECT.JS_Play(szUrl, {
+        auth: oDeviceInfo.szAuth,
+        userInfo: oDeviceInfo.szAuth
+      }, iWndIndex, szStartTime, szEndTime, options.bFlag)
+        .then(() => {
+          addToWndSet();
+          resolve()
+        }, () => {
+          reject()
+        })
+    });
+    return oPromise
+  };
+  ISAPIProtocol.prototype.reversePlayback = function(oDeviceInfo, options) {
+    let oPromise = new Promise(function(resolve, reject) {
+      var iWndIndex = options.iWndIndex,
+        szStartTime = options.szStartTime,
+        szEndTime = options.szEndTime;
+      var szRtspIP = m_utilsInc.delPort(oDeviceInfo.szIP);
+      var iRtspPort = oDeviceInfo.iRtspPort;
+      if (options.iPort) {
+        iRtspPort = options.iPort
+      }
+      var szUrl = m_utilsInc.formatString(options.cgi, szRtspIP, iRtspPort, options.iChannelID);
+      m_pluginOBJECT.JS_ReversePlay(szUrl, {
+        auth: oDeviceInfo.szAuth,
+        userInfo: oDeviceInfo.szAuth
+      }, iWndIndex, szStartTime, szEndTime)
+        .then(() => {
+          var wndInfo = new wndInfoClass;
+          wndInfo.iIndex = iWndIndex;
+          wndInfo.szIP = oDeviceInfo.szIP;
+          wndInfo.iCGIPort = oDeviceInfo.iCGIPort;
+          wndInfo.szDeviceIdentify = oDeviceInfo.szDeviceIdentify;
+          wndInfo.iChannelID = options.iChannelID;
+          wndInfo.iPlayStatus = PLAY_STATUS_REVERSE_PLAYBACK;
+          m_wndSet.push(wndInfo);
+          resolve()
+        }, () => {
+          reject()
+        })
+    });
+    return oPromise
+  };
+  ISAPIProtocol.prototype.startDownloadRecord = function(oDeviceInfo, options) {
+    var szUrl = m_utilsInc.formatString(this.CGI.startDownloadRecord, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort);
+    var szDownXml = "<?xml version='1.0' encoding='UTF-8'?>" + "<downloadRequest>" + "<playbackURI>" + m_utilsInc.escape(options.szPlaybackURI) + "</playbackURI>" + "</downloadRequest>";
+    return m_pluginOBJECT.JS_StartAsyncDownload(szUrl, oDeviceInfo.szAuth, options.szFileName, szDownXml, options.bDateDir)
+  };
+  ISAPIProtocol.prototype.exportDeviceConfig = function(oDeviceInfo) {
+    var szUrl = m_utilsInc.formatString(this.CGI.downloaddeviceConfig, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort);
+    return m_pluginOBJECT.JS_DownloadFile(szUrl, oDeviceInfo.szAuth, "", 0)
+  };
+  ISAPIProtocol.prototype.importDeviceConfig = function(oDeviceInfo, options) {
+    var szUrl = m_utilsInc.formatString(this.CGI.uploaddeviceConfig, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort);
+    return m_pluginOBJECT.JS_StartAsynUpload(szUrl, "", oDeviceInfo.szAuth, options.szFileName, 0)
+  };
+  ISAPIProtocol.prototype.restart = function(oDeviceInfo, options) {
+    var newOptions = {
+      type: "PUT",
+      success: null,
+      error: null
+    };
+    return m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, this.CGI.restart, newOptions)
+  };
+  ISAPIProtocol.prototype.restore = function(oDeviceInfo, szMode, options) {
+    var szUrl = m_utilsInc.formatString(this.CGI.restore, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort, szMode);
+    var newOptions = {
+      type: "PUT",
+      url: szUrl,
+      success: null,
+      error: null
+    };
+    return m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, "", newOptions)
+  };
+  ISAPIProtocol.prototype.startUpgrade = function(oDeviceInfo, szFileName) {
+    var szUpgradeURL = m_utilsInc.formatString(this.CGI.startUpgrade.upgrade, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort),
+      szStatusURL = m_utilsInc.formatString(this.CGI.startUpgrade.status, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort);
+    return m_pluginOBJECT.JS_StartUpgrade(szUpgradeURL, "", oDeviceInfo.szAuth, szFileName)
+  };
+  ISAPIProtocol.prototype.set3DZoom = function(oDeviceInfo, oWndInfo, oPoints, options) {
+    var iChannelID = oWndInfo.iChannelID,
+      szUrl = "";
+    if (iChannelID <= oDeviceInfo.iAnalogChannelNum) {
+      szUrl = m_utilsInc.formatString(this.CGI.set3DZoom.analog, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort, oWndInfo.iChannelID)
+    } else {
+      szUrl = m_utilsInc.formatString(this.CGI.set3DZoom.digital, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort, oWndInfo.iChannelID)
+    }
+    if (oPoints[0][0] === 0 && oPoints[0][1] === 0 && !(oPoints[2][0] === 0 && oPoints[2][1] === 0)) {
+      oPoints[0][0] = oPoints[2][0];
+      oPoints[0][1] = oPoints[2][1]
+    }
+    var szXml = "<?xml version='1.0' encoding='UTF-8'?><Position3D><StartPoint>" + "<positionX>" + parseInt(oPoints[0][0] * 255, 10) + "</positionX>" + "<positionY>" + (255 - parseInt(oPoints[0][1] * 255, 10)) + "</positionY>" + "</StartPoint><EndPoint><positionX>" + parseInt(oPoints[2][0] * 255, 10) + "</positionX>" + "<positionY>" + (255 - parseInt(oPoints[2][1] * 255, 10)) + "</positionY></EndPoint></Position3D>";
+    var httpClient = new HttpPluginClient;
+    var newOptions = {
+      type: "PUT",
+      url: szUrl,
+      data: szXml,
+      success: null,
+      error: null
+    };
+    m_utilsInc.extend(newOptions, options);
+    return m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, "", newOptions)
+  };
+  ISAPIProtocol.prototype.getSDKCapa = function(oDeviceInfo, options) {
+    return m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, this.CGI.SDKCapabilities, options)
+  };
+  ISAPIProtocol.prototype.deviceCapturePic = function(oDeviceInfo, iChannelID, szPicName, options) {
+    var iChannelID = iChannelID * 100 + 1;
+    var iRet = -1;
+    var szUrl = m_utilsInc.formatString(this.CGI.deviceCapture.channels, oDeviceInfo.szHttpProtocol, oDeviceInfo.szIP, oDeviceInfo.iCGIPort, iChannelID);
+    var aQuery = [];
+    if (m_utilsInc.isInt(options.iResolutionWidth)) {
+      aQuery.push("videoResolutionWidth=" + options.iResolutionWidth)
+    }
+    if (m_utilsInc.isInt(options.iResolutionHeight)) {
+      aQuery.push("videoResolutionHeight=" + options.iResolutionHeight)
+    }
+    if (aQuery.length > 0) {
+      szUrl += "?" + aQuery.join("&")
+    }
+    var JDeviceCapturePic = function(szUrl, szFileName) {
+      var szFileFormat = ".jpg";
+      $("body")
+        .append('<a id="jsplugin_download_a" href="' + szUrl + '" download=' + szFileName + szFileFormat + '><li id="jsplugin_download_li"></li></a>');
+      $("#jsplugin_download_li")
+        .trigger("click");
+      $("#jsplugin_download_a")
+        .remove();
+      return 0
+    };
+    iRet = JDeviceCapturePic(szUrl, szPicName);
+    return iRet
+  };
+  ISAPIProtocol.prototype.digestLogin = function(szIP, iProtocol, iPort, szUserName, szPassword, options) {
+    var szHttpProtocol = "";
+    if (iProtocol == 2) {
+      szHttpProtocol = "https://"
+    } else {
+      szHttpProtocol = "http://"
+    }
+    var szUrl = m_utilsInc.formatString(this.CGI.login, szHttpProtocol, szIP, iPort);
+    var newOptions = {
+      type: "GET",
+      url: szUrl,
+      auth: m_utilsInc.Base64.encode(":" + szUserName + ":" + szPassword),
+      success: null,
+      error: null
+    };
+    var szDeviceIdentify = szIP + "_" + iPort;
+    m_utilsInc.extend(newOptions, options);
+    return m_webVideoCtrl.I_SendHTTPRequest(szDeviceIdentify, "", newOptions)
+  };
+  ISAPIProtocol.prototype.getSystemCapa = function(oDeviceInfo, options) {
+    return m_webVideoCtrl.I_SendHTTPRequest(oDeviceInfo.szDeviceIdentify, this.CGI.systemCapabilities, options)
+  };
+  (function(wvc) {
+    var XML = function(xd) {
+      this.elems = [];
+      this.length = 0;
+      this.length = this.elems.push(xd)
+    };
+    XML.prototype.find = function(szNodeName, bRet) {
+      var oXmlNode = this.elems[this.length - 1] ? this.elems[this.length - 1].getElementsByTagName(szNodeName) : [];
+      this.length = this.elems.push(oXmlNode);
+      if (bRet) {
+        return oXmlNode
+      } else {
+        return this
+      }
+    };
+    XML.prototype.eq = function(i, bRet) {
+      var iLen = this.elems[this.length - 1].length,
+        oXmlNode = null;
+      if (iLen > 0 && i < iLen) {
+        oXmlNode = this.elems[this.length - 1][i]
+      }
+      this.length = this.elems.push(oXmlNode);
+      if (bRet) {
+        return oXmlNode
+      } else {
+        return this
+      }
+    };
+    XML.prototype.text = function(szText) {
+      if (this.elems[this.length - 1]) {
+        if (szText) {
+          if (window.DOMParser) {
+            this.elems[this.length - 1].textContent = szText
+          } else {
+            this.elems[this.length - 1].text = szText
+          }
+        } else {
+          if (window.DOMParser) {
+            return this.elems[this.length - 1].textContent
+          } else {
+            return this.elems[this.length - 1].text
+          }
+        }
+      } else {
+        return ""
+      }
+    };
+    XML.prototype.attr = function(szAttrName) {
+      if (this.elems[this.length - 1]) {
+        var oAttr = this.elems[this.length - 1].attributes.getNamedItem(szAttrName);
+        if (oAttr) {
+          return oAttr.value
+        } else {
+          return ""
+        }
+      }
+    };
+    wvc.$XML = function(xd) {
+      return new XML(xd)
+    }
+  })(this);
+  var Utils = function() {};
+  Utils.prototype.extend = function() {
+    var target = arguments[0] || {},
+      i = 1,
+      length = arguments.length,
+      options;
+    for (; i < length; i++) {
+      if ((options = arguments[i]) != null) {
+        for (var name in options) {
+          var src = target[name],
+            copy = options[name];
+          if (target === copy) {
+            continue
+          }
+          if ("object" == typeof copy) {
+            target[name] = this.extend({}, copy)
+          } else if (copy !== undefined) {
+            target[name] = copy
+          }
+        }
+      }
+    }
+    return target
+  };
+  Utils.prototype.browser = function() {
+    var rchrome = /(chrome)[ \/]([\w.]+)/;
+    var rsafari = /(safari)[ \/]([\w.]+)/;
+    var ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/;
+    var rmsie = /(msie) ([\w.]+)/;
+    var rmsie2 = /(trident.*rv:)([\w.]+)/;
+    var rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/;
+    var ua = navigator.userAgent.toLowerCase();
+    var match = rchrome.exec(ua) || rsafari.exec(ua) || ropera.exec(ua) || rmsie.exec(ua) || rmsie2.exec(ua) || ua.indexOf("compatible") < 0 && rmozilla.exec(ua) || ["unknow", "0"];
+    if (match.length > 0 && match[1].indexOf("trident") > -1) {
+      match[1] = "msie"
+    }
+    var oBrowser = {};
+    oBrowser[match[1]] = true;
+    oBrowser.version = match[2];
+    return oBrowser
+  };
+  Utils.prototype.loadXML = function(szXml) {
+    if (null == szXml || "" == szXml) {
+      return null
+    }
+    var oXmlDoc = null;
+    if (window.DOMParser) {
+      var oParser = new DOMParser;
+      oXmlDoc = oParser.parseFromString(szXml, "text/xml")
+    } else {
+      oXmlDoc = new ActiveXObject("Microsoft.XMLDOM");
+      oXmlDoc.async = false;
+      oXmlDoc.loadXML(szXml)
+    }
+    return oXmlDoc
+  };
+  Utils.prototype.toXMLStr = function(oXmlDoc) {
+    var szXmlDoc = "";
+    try {
+      var oSerializer = new XMLSerializer;
+      szXmlDoc = oSerializer.serializeToString(oXmlDoc)
+    } catch (e) {
+      try {
+        szXmlDoc = oXmlDoc.xml
+      } catch (e) {
+        return ""
+      }
+    }
+    if (szXmlDoc.indexOf("<?xml") == -1) {
+      szXmlDoc = "<?xml version='1.0' encoding='utf-8'?>" + szXmlDoc
+    }
+    return szXmlDoc
+  };
+  Utils.prototype.escape = function(szStr) {
+    if (szStr) {
+      return szStr.replace(/&/g, "&amp;")
+        .replace(/</g, "&lt;")
+        .replace(/>/g, "&gt;")
+    }
+    return szStr
+  };
+  Utils.prototype.dateFormat = function(oDate, fmt) {
+    var o = {
+      "M+": oDate.getMonth() + 1,
+      "d+": oDate.getDate(),
+      "h+": oDate.getHours(),
+      "m+": oDate.getMinutes(),
+      "s+": oDate.getSeconds(),
+      "q+": Math.floor((oDate.getMonth() + 3) / 3),
+      S: oDate.getMilliseconds()
+    };
+    if (/(y+)/.test(fmt)) {
+      fmt = fmt.replace(RegExp.$1, (oDate.getFullYear() + "")
+        .substr(4 - RegExp.$1.length))
+    }
+    for (var k in o) {
+      if (new RegExp("(" + k + ")")
+        .test(fmt)) {
+        fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k])
+          .substr(("" + o[k])
+            .length))
+      }
+    }
+    return fmt
+  };
+  Utils.prototype.Base64 = {
+    _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
+    encode: function(input) {
+      var output = "";
+      var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
+      var i = 0;
+      input = Utils.prototype.Base64._utf8_encode(input);
+      while (i < input.length) {
+        chr1 = input.charCodeAt(i++);
+        chr2 = input.charCodeAt(i++);
+        chr3 = input.charCodeAt(i++);
+        enc1 = chr1 >> 2;
+        enc2 = (chr1 & 3) << 4 | chr2 >> 4;
+        enc3 = (chr2 & 15) << 2 | chr3 >> 6;
+        enc4 = chr3 & 63;
+        if (isNaN(chr2)) {
+          enc3 = enc4 = 64
+        } else if (isNaN(chr3)) {
+          enc4 = 64
+        }
+        output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4)
+      }
+      return output
+    },
+    decode: function(input) {
+      var output = "";
+      var chr1, chr2, chr3;
+      var enc1, enc2, enc3, enc4;
+      var i = 0;
+      input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
+      while (i < input.length) {
+        enc1 = this._keyStr.indexOf(input.charAt(i++));
+        enc2 = this._keyStr.indexOf(input.charAt(i++));
+        enc3 = this._keyStr.indexOf(input.charAt(i++));
+        enc4 = this._keyStr.indexOf(input.charAt(i++));
+        chr1 = enc1 << 2 | enc2 >> 4;
+        chr2 = (enc2 & 15) << 4 | enc3 >> 2;
+        chr3 = (enc3 & 3) << 6 | enc4;
+        output = output + String.fromCharCode(chr1);
+        if (enc3 != 64) {
+          output = output + String.fromCharCode(chr2)
+        }
+        if (enc4 != 64) {
+          output = output + String.fromCharCode(chr3)
+        }
+      }
+      output = Utils.prototype.Base64._utf8_decode(output);
+      return output
+    },
+    _utf8_encode: function(string) {
+      string = string.replace(/\r\n/g, "\n");
+      var utftext = "";
+      for (var n = 0; n < string.length; n++) {
+        var c = string.charCodeAt(n);
+        if (c < 128) {
+          utftext += String.fromCharCode(c)
+        } else if (c > 127 && c < 2048) {
+          utftext += String.fromCharCode(c >> 6 | 192);
+          utftext += String.fromCharCode(c & 63 | 128)
+        } else {
+          utftext += String.fromCharCode(c >> 12 | 224);
+          utftext += String.fromCharCode(c >> 6 & 63 | 128);
+          utftext += String.fromCharCode(c & 63 | 128)
+        }
+      }
+      return utftext
+    },
+    _utf8_decode: function(utftext) {
+      var string = "";
+      var i = 0;
+      var c = c1 = c2 = 0;
+      while (i < utftext.length) {
+        c = utftext.charCodeAt(i);
+        if (c < 128) {
+          string += String.fromCharCode(c);
+          i++
+        } else if (c > 191 && c < 224) {
+          c2 = utftext.charCodeAt(i + 1);
+          string += String.fromCharCode((c & 31) << 6 | c2 & 63);
+          i += 2
+        } else {
+          c2 = utftext.charCodeAt(i + 1);
+          c3 = utftext.charCodeAt(i + 2);
+          string += String.fromCharCode((c & 15) << 12 | (c2 & 63) << 6 | c3 & 63);
+          i += 3
+        }
+      }
+      return string
+    }
+  };
+  Utils.prototype.createEventScript = function(szFor, szEvent, szHtml) {
+    var oScript = document.createElement("script");
+    oScript.htmlFor = szFor;
+    oScript.event = szEvent;
+    oScript.innerHTML = szHtml;
+    document.body.parentNode.appendChild(oScript)
+  };
+  Utils.prototype.isInt = function(str) {
+    return /^\d+$/.test(str)
+  };
+  Utils.prototype.getDirName = function() {
+    var szDirName = "";
+    if (m_options.szBasePath !== "") {
+      szDirName = m_options.szBasePath
+    } else {
+      var szDirNameRegex = /[^?#]*\//;
+      var oScript = document.getElementById("videonode");
+      if (oScript) {
+        szDirName = oScript.src.match(szDirNameRegex)[0]
+      } else {
+        var aScript = document.scripts;
+        for (var i = 0, iLen = aScript.length; i < iLen; i++) {
+          if (aScript[i].src.indexOf("webVideoCtrl.js") > -1) {
+            oScript = aScript[i];
+            break
+          }
+        }
+        if (oScript) {
+          szDirName = oScript.src.match(szDirNameRegex)[0]
+        }
+      }
+    }
+    return szDirName
+  };
+  Utils.prototype.loadScript = function(url, callback) {
+    var oScript = document.createElement("script");
+    oScript.type = "text/javascript";
+    oScript.onload = function() {
+      callback()
+    };
+    oScript.src = url;
+    document.getElementsByTagName("head")[0].appendChild(oScript)
+  };
+  Utils.prototype.cookie = function(key, value, options) {
+    if (arguments.length > 1 && (value === null || typeof value !== "object")) {
+      options = this.extend({}, options);
+      if (value === null) {
+        options.expires = -1
+      }
+      if (typeof options.expires === "number") {
+        var days = options.expires,
+          t = options.expires = new Date;
+        t.setDate(t.getDate() + days)
+      }
+      return document.cookie = [encodeURIComponent(key), "=", options.raw ? String(value) : encodeURIComponent(String(value)), options.expires ? "; expires=" + options.expires.toUTCString() : "", options.path ? "; path=" + options.path : "; path=/", options.domain ? "; domain=" + options.domain : "", options.secure ? "; secure" : ""].join("")
+    }
+    options = value || {};
+    var result, decode = options.raw ? function(s) {
+      return s
+    } : decodeURIComponent;
+    return (result = new RegExp("(?:^|; )" + encodeURIComponent(key) + "=([^;]*)")
+      .exec(document.cookie)) ? decode(result[1]) : null
+  };
+  Utils.prototype.isUndefined = function(o) {
+    return typeof o === "undefined"
+  };
+  Utils.prototype.isObject = function(o) {
+    return Object.prototype.toString.call(o) === "[object Object]"
+  };
+  Utils.prototype.delPort = function(szIP) {
+    var iPos = szIP.indexOf(":");
+    if (iPos > -1) {
+      return szIP.substring(0, iPos)
+    } else {
+      return szIP
+    }
+  };
+  Utils.prototype.formatString = function() {
+    var string = arguments[0];
+    for (var i = 1; i < arguments.length; i++) {
+      string = string.replace("%s", arguments[i])
+    }
+    return string
+  };
+  Utils.prototype.encodeString = function(str) {
+    if (str) {
+      return str.replace(/&/g, "&amp;")
+        .replace(/</g, "&lt;")
+        .replace(/>/g, "&gt;")
+    } else {
+      return ""
+    }
+  };
+  Utils.prototype.formatPolygonXmlToJson = function(szXml) {
+    var oXml = this.loadXML(szXml);
+    var aPolygonList = [];
+    var aPoints = [];
+    var aRect = [];
+    var aAddPolygon = [];
+    var aAddRect = [];
+    var oData;
+
+    function colorTransfer(szColor) {
+      var iValue = parseInt(szColor, 10);
+      var szValue = iValue.toString(16);
+      szValue = "0" + szValue;
+      return szValue.substring(szValue.length - 2)
+    }
+    $(oXml)
+      .find("SnapPolygon")
+      .each(function() {
+        var iEditType = parseInt($(this)
+          .find("EditType, editType")
+          .text(), 10) || 0;
+        var isClose = $(this)
+          .find("isClosed")
+          .text() === "true";
+        var iPolygonType = parseInt($(this)
+          .find("polygonType")
+          .text(), 10);
+        var fShowSquare = parseFloat($(this)
+          .find("showSquare")
+          .text()) || 0;
+        var szTips = $(this)
+          .find("tips")
+          .text() || $(this)
+          .find("Tips")
+          .text();
+        var iTipsPos = parseInt($(this)
+          .find("tipsPos")
+          .text(), 10) || 0;
+        var bShowWH = $(this)
+          .find("showWH")
+          .text() === "true";
+        var szColor = "#" + colorTransfer($(this)
+          .find("r")
+          .text()) + colorTransfer($(this)
+          .find("g")
+          .text()) + colorTransfer($(this)
+          .find("b")
+          .text());
+        var iMaxPoint = parseInt($(this)
+          .find("PointNumMax")
+          .text(), 10) - 1;
+        var iMinPoint = parseInt($(this)
+          .find("MinClosed")
+          .text(), 10) - 1;
+        var iId = parseInt($(this)
+          .find("id")
+          .text(), 10);
+        var iRedrawMode = parseInt($(this)
+          .find("RedrawMode")
+          .text(), 10) || 0;
+        if ($(this)
+          .find("pointList")
+          .find("point")
+          .length === 0) {
+          if (iPolygonType === 1) {
+            aAddPolygon.push({
+              id: iId,
+              tips: szTips,
+              drawColor: szColor,
+              translucent: .1,
+              maxShapeSupport: 1,
+              maxPointSupport: iMaxPoint,
+              minPointSupport: iMinPoint,
+              showWH: bShowWH,
+              redrawMode: iRedrawMode
+            })
+          } else if (iPolygonType === 0) {
+            aAddRect.push({
+              id: iId,
+              tips: szTips,
+              drawColor: szColor,
+              translucent: .1,
+              widthHeightRate: fShowSquare,
+              maxShapeSupport: 1,
+              type: 1,
+              redrawMode: iRedrawMode,
+              tipsPos: iTipsPos
+            })
+          }
+        } else {
+          aPoints = [];
+          $(this)
+            .find("pointList")
+            .find("point")
+            .each(function() {
+              aPoints.push([parseFloat($(this)
+                .find("x")
+                .text()), parseFloat($(this)
+                .find("y")
+                .text())])
+            });
+          oData = {
+            id: iId,
+            editType: iEditType,
+            points: aPoints,
+            closed: isClose,
+            tips: szTips,
+            drawColor: szColor,
+            maxPointSupport: iMaxPoint,
+            minPointSupport: iMinPoint,
+            translucent: .1,
+            redrawMode: iRedrawMode
+          };
+          if (iPolygonType === 1) {
+            oData["showWH"] = bShowWH;
+            aPolygonList.push(oData)
+          } else if (iPolygonType === 0) {
+            oData["widthHeightRate"] = fShowSquare;
+            oData["type"] = 1;
+            oData.tipsPos = iTipsPos;
+            aRect.push(oData)
+          }
+        }
+      });
+    return {
+      aRect: aRect,
+      aPolygon: aPolygonList,
+      aAddRect: aAddRect,
+      aAddPolygon: aAddPolygon
+    }
+  };
+  Utils.prototype.formatPolygonJsonToXml = function(aData) {
+    function colorRgb(szHex) {
+      var sColor = szHex.toLowerCase();
+      var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
+      if (sColor && reg.test(sColor)) {
+        var i;
+        if (sColor.length === 4) {
+          var sColorNew = "#";
+          for (i = 1; i < 4; i += 1) {
+            sColorNew += sColor.slice(i, i + 1)
+              .concat(sColor.slice(i, i + 1))
+          }
+          sColor = sColorNew
+        }
+        var aColorChange = [];
+        for (i = 1; i < 7; i += 2) {
+          aColorChange.push(parseInt("0x" + sColor.slice(i, i + 2), 16))
+        }
+        return aColorChange
+      }
+      return [0, 0, 0]
+    }
+    var aPolygon = aData[0];
+    var aRect = aData[1];
+    var szXml = "<?xml version='1.0' encoding='utf-8'?><SnapPolygonList>";
+    var that = this;
+    $.each(aPolygon, function(index, oVal) {
+      var aColor = [0, 0, 0];
+      if (oVal.drawColor) {
+        aColor = colorRgb(oVal.drawColor)
+      } else {
+        aColor = colorRgb("#FF0000")
+      }
+      szXml += "<SnapPolygon>";
+      szXml += "<id>" + oVal.id + "</id>";
+      oVal.tips = that.encodeString(oVal.tips);
+      if (!oVal.tips) {
+        szXml += "<tips></tips>"
+      } else {
+        szXml += "<tips>" + oVal.tips + "</tips>"
+      }
+      szXml += "<isClosed>" + oVal.closed.toString() + "</isClosed>";
+      szXml += "<color><r>" + aColor[0] + "</r><g>" + aColor[1] + "</g><b>" + aColor[2] + "</b></color>";
+      szXml += "<polygonType>1</polygonType>";
+      szXml += "<PointNumMax>" + (oVal.pointNumMax ? oVal.pointNumMax : 10) + "</PointNumMax>";
+      szXml += "<MinClosed>" + (oVal.minClosed ? oVal.minClosed : 4) + "</MinClosed>";
+      szXml += "<pointList>";
+      $.each(oVal.points, function(i, aVal) {
+        szXml += "<point><x>" + aVal[0] + "</x><y>" + aVal[1] + "</y></point>"
+      });
+      szXml += "</pointList>";
+      szXml += "</SnapPolygon>"
+    });
+    $.each(aRect, function(index, oVal) {
+      var aColor = [0, 0, 0];
+      if (oVal.drawColor) {
+        aColor = colorRgb(oVal.drawColor)
+      } else {
+        aColor = colorRgb("#FF0000")
+      }
+      szXml += "<SnapPolygon>";
+      szXml += "<id>" + oVal.id + "</id>";
+      szXml += "<color><r>" + aColor[0] + "</r><g>" + aColor[1] + "</g><b>" + aColor[2] + "</b></color>";
+      szXml += "<polygonType>0</polygonType>";
+      oVal.tips = that.encodeString(oVal.tips);
+      if (!oVal.tips) {
+        szXml += "<tips></tips>"
+      } else {
+        szXml += "<tips>" + oVal.tips + "</tips>"
+      }
+      if (typeof oVal.closed !== "undefined" && oVal.closed !== null) {
+        szXml += "<isClosed>" + oVal.closed.toString() + "</isClosed>"
+      } else {
+        szXml += "<isClosed>true</isClosed>"
+      }
+      szXml += "<pointList>";
+      var aRectTmp = [];
+      if (oVal.points.length) {
+        var iMinX = 2;
+        var iMaxX = -1;
+        var iMinY = 2;
+        var iMaxY = -1;
+        $.each(oVal.points, function() {
+          if (iMinX > this[0]) {
+            iMinX = this[0]
+          }
+          if (iMinY > this[1]) {
+            iMinY = this[1]
+          }
+          if (iMaxX < this[0]) {
+            iMaxX = this[0]
+          }
+          if (iMaxY < this[1]) {
+            iMaxY = this[1]
+          }
+        });
+        aRectTmp.push([iMinX, iMinY]);
+        aRectTmp.push([iMaxX, iMinY]);
+        aRectTmp.push([iMaxX, iMaxY]);
+        aRectTmp.push([iMinX, iMaxY])
+      }
+      $.each(aRectTmp, function(i, aVal) {
+        szXml += "<point><x>" + aVal[0] + "</x><y>" + aVal[1] + "</y></point>"
+      });
+      szXml += "</pointList>";
+      szXml += "</SnapPolygon>"
+    });
+    szXml += "</SnapPolygonList>";
+    return szXml
+  };
+  Utils.prototype.convertToUTCTime = function(szLocalTime, szFormat) {
+    if (typeof szFormat == "undefined") {
+      szFormat = "yyyy-MM-dd hh:mm:ss"
+    }
+    szLocalTime = szLocalTime.replace("T", " ")
+      .replace("Z", "");
+    var _dLocalDate = new Date(Date.parse(szLocalTime.replace(/-/g, "/")));
+    _dLocalDate = this.utcDateFormat(_dLocalDate, szFormat);
+    _dLocalDate = _dLocalDate.replace(" ", "T");
+    return _dLocalDate
+  };
+  Utils.prototype.utcDateFormat = function(oDate, fmt) {
+    var o = {
+      "M+": oDate.getUTCMonth() + 1,
+      "d+": oDate.getUTCDate(),
+      "h+": oDate.getUTCHours(),
+      "m+": oDate.getUTCMinutes(),
+      "s+": oDate.getUTCSeconds(),
+      "q+": Math.floor((oDate.getUTCMonth() + 3) / 3),
+      S: oDate.getUTCMilliseconds()
+    };
+    if (/(y+)/.test(fmt)) {
+      fmt = fmt.replace(RegExp.$1, (oDate.getUTCFullYear() + "")
+        .substr(4 - RegExp.$1.length))
+    }
+    for (var k in o) {
+      if (new RegExp("(" + k + ")")
+        .test(fmt)) {
+        fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k])
+          .substr(("" + o[k])
+            .length))
+      }
+    }
+    return fmt
+  };
+  Utils.prototype.convertToLocalTime = function(szUTCTime, iDiffTime) {
+    szUTCTime = szUTCTime.replace("T", " ")
+      .replace("Z", "");
+    if (typeof iDiffTime == "undefined") {
+      iDiffTime = 0
+    }
+    var szFormat = "yyyy-MM-dd hh:mm:ss";
+    var _aDate = szUTCTime.split(" ")[0].split("-");
+    var _iFullYear = parseInt(_aDate[0], 10);
+    var _iMonth = parseInt(_aDate[1], 10) - 1;
+    var _iDay = parseInt(_aDate[2], 10);
+    var _aTimes = szUTCTime.split(" ")[1].split(":");
+    var _iHour = parseInt(_aTimes[0], 10);
+    var _iMinute = parseInt(_aTimes[1], 10);
+    var _iSecond = parseInt(_aTimes[2], 10);
+    var _dLocalDate = new Date(Date.UTC(_iFullYear, _iMonth, _iDay, _iHour, _iMinute, _iSecond));
+    _dLocalDate.setTime(_dLocalDate.getTime() + iDiffTime);
+    return this.dateFormat(_dLocalDate, szFormat)
+      .replace(" ", "T") + "Z"
+  };
+
+  function UUID() {
+    this.id = this.createUUID()
+  }
+  UUID.prototype.valueOf = function() {
+    return this.id
+  };
+  UUID.prototype.toString = function() {
+    return this.id
+  };
+  UUID.prototype.createUUID = function() {
+    var dg = new Date(1582, 10, 15, 0, 0, 0, 0);
+    var dc = new Date;
+    var t = dc.getTime() - dg.getTime();
+    var h = "-";
+    var tl = UUID.getIntegerBits(t, 0, 31);
+    var tm = UUID.getIntegerBits(t, 32, 47);
+    var thv = UUID.getIntegerBits(t, 48, 59) + "1";
+    var csar = UUID.getIntegerBits(UUID.rand(4095), 0, 7);
+    var csl = UUID.getIntegerBits(UUID.rand(4095), 0, 7);
+    var n = UUID.getIntegerBits(UUID.rand(8191), 0, 7) + UUID.getIntegerBits(UUID.rand(8191), 8, 15) + UUID.getIntegerBits(UUID.rand(8191), 0, 7) + UUID.getIntegerBits(UUID.rand(8191), 8, 15) + UUID.getIntegerBits(UUID.rand(8191), 0, 15);
+    return tl + h + tm + h + thv + h + csar + csl + h + n
+  };
+  UUID.getIntegerBits = function(val, start, end) {
+    var base16 = UUID.returnBase(val, 16);
+    var quadArray = new Array;
+    var quadString = "";
+    var i = 0;
+    for (i = 0; i < base16.length; i++) {
+      quadArray.push(base16.substring(i, i + 1))
+    }
+    for (i = Math.floor(start / 4); i <= Math.floor(end / 4); i++) {
+      if (!quadArray[i] || quadArray[i] == "") quadString += "0";
+      else quadString += quadArray[i]
+    }
+    return quadString
+  };
+  UUID.returnBase = function(number, base) {
+    var convert = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
+    if (number < base) var output = convert[number];
+    else {
+      var MSD = "" + Math.floor(number / base);
+      var LSD = number - MSD * base;
+      if (MSD >= base) var output = this.returnBase(MSD, base) + convert[LSD];
+      else var output = convert[MSD] + convert[LSD]
+    }
+    return output
+  };
+  UUID.rand = function(max) {
+    return Math.floor(Math.random() * max)
+  };
+  m_ISAPIProtocol = new ISAPIProtocol;
+  m_utilsInc = new Utils;
+  return this
+};
+
+export default WebVideoCtrl;

--
Gitblit v1.9.1