From 737866aa9277c2e7a65161dee77e4a671faa4c97 Mon Sep 17 00:00:00 2001 From: liufumingren Date: Sat, 18 Jul 2026 03:02:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=91=84=E5=83=8F=E5=A4=B4=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=A8=A1=E5=9D=97=20-=20=E8=BF=9E=E9=80=9A=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E3=80=81=E9=80=9A=E9=81=93=E6=8B=89=E5=8F=96=E3=80=81?= =?UTF-8?q?=E5=AE=9E=E6=97=B6=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 localServerApi.ts: 本地代理 API (通道列表/连通测试/实时流) - 新增 localCameraServer store: 管理本机多端口连接 - 新增 CameraPreviewDialog: 摄像头预览弹窗 (RTSP→MJPEG, 内外网回退) - 新增 CameraPlayer: 海康SDK播放器组件(备用) - 录像服务器列表增加连通测试按钮(先内网后公网) - 摄像头表单选择服务器后自动拉取通道列表 - 通道选中自动填充设备信息(IP/端口/型号/序列号) - camera API create/update 入参扩充(ip/port/model/serial_number/stream_type) - custom_name 改为必填 - vite.config.ts 增加 /ISAPI 代理转发 - public/hikvision/ 海康Web SDK静态资源 --- public/hikvision/encryption/AES.js | 621 ++ public/hikvision/encryption/cryptico.min.js | 106 + .../hikvision/encryption/crypto-3.1.2.min.js | 35 + public/hikvision/encryption/encryption.js | 111 + public/hikvision/jquery-1.7.1.min.js | 4 + public/hikvision/jsPlugin/jquery.min.js | 2 + .../hikvision/jsPlugin/jsPlugin-3.0.0.min.js | 301 + .../PlayCtrlWasm/playctrlV1/Decoder.js | 174 + .../PlayCtrlWasm/playctrlV3/Decoder.js | 21 + .../PlayCtrlWasm/playctrlV3/Decoder.wasm | Bin 0 -> 3503388 bytes .../PlayCtrlWasm/playctrlV3/Decoder.worker.js | 1 + .../PlayCtrlWasm/playctrlV3_NoSIMD/Decoder.js | 21 + .../playctrlV3_NoSIMD/Decoder.wasm | Bin 0 -> 3070922 bytes .../playctrlV3_NoSIMD/Decoder.worker.js | 1 + .../playctrlV3_NoWorker/Decoder.js | 21 + .../playctrlV3_NoWorker/Decoder.wasm | Bin 0 -> 2948325 bytes .../playctrl/PlayCtrlWasm/wasmplayer.min.js | 1 + .../jsPlugin/transform/libSystemTransform.js | 6630 +++++++++++++++++ .../transform/libSystemTransform.wasm | Bin 0 -> 834489 bytes .../transform/systemTransform-worker.js | 240 + public/hikvision/player.html | 180 + public/hikvision/webVideoCtrl.js | 1 + src/api/camera/camera.ts | 10 + src/api/camera_server/localServerApi.ts | 118 + src/stores/modules/localCameraServer.ts | 158 + .../video/camera/component/CameraPlayer.vue | 192 + .../camera/component/CameraPreviewDialog.vue | 300 + src/views/video/camera/index.vue | 263 +- src/views/video/cameraServer/index.vue | 101 + vite.config.ts | 5 + 30 files changed, 9612 insertions(+), 6 deletions(-) create mode 100644 public/hikvision/encryption/AES.js create mode 100644 public/hikvision/encryption/cryptico.min.js create mode 100644 public/hikvision/encryption/crypto-3.1.2.min.js create mode 100644 public/hikvision/encryption/encryption.js create mode 100644 public/hikvision/jquery-1.7.1.min.js create mode 100644 public/hikvision/jsPlugin/jquery.min.js create mode 100644 public/hikvision/jsPlugin/jsPlugin-3.0.0.min.js create mode 100644 public/hikvision/jsPlugin/playctrl/PlayCtrlWasm/playctrlV1/Decoder.js create mode 100644 public/hikvision/jsPlugin/playctrl/PlayCtrlWasm/playctrlV3/Decoder.js create mode 100644 public/hikvision/jsPlugin/playctrl/PlayCtrlWasm/playctrlV3/Decoder.wasm create mode 100644 public/hikvision/jsPlugin/playctrl/PlayCtrlWasm/playctrlV3/Decoder.worker.js create mode 100644 public/hikvision/jsPlugin/playctrl/PlayCtrlWasm/playctrlV3_NoSIMD/Decoder.js create mode 100644 public/hikvision/jsPlugin/playctrl/PlayCtrlWasm/playctrlV3_NoSIMD/Decoder.wasm create mode 100644 public/hikvision/jsPlugin/playctrl/PlayCtrlWasm/playctrlV3_NoSIMD/Decoder.worker.js create mode 100644 public/hikvision/jsPlugin/playctrl/PlayCtrlWasm/playctrlV3_NoWorker/Decoder.js create mode 100644 public/hikvision/jsPlugin/playctrl/PlayCtrlWasm/playctrlV3_NoWorker/Decoder.wasm create mode 100644 public/hikvision/jsPlugin/playctrl/PlayCtrlWasm/wasmplayer.min.js create mode 100644 public/hikvision/jsPlugin/transform/libSystemTransform.js create mode 100644 public/hikvision/jsPlugin/transform/libSystemTransform.wasm create mode 100644 public/hikvision/jsPlugin/transform/systemTransform-worker.js create mode 100644 public/hikvision/player.html create mode 100644 public/hikvision/webVideoCtrl.js create mode 100644 src/api/camera_server/localServerApi.ts create mode 100644 src/stores/modules/localCameraServer.ts create mode 100644 src/views/video/camera/component/CameraPlayer.vue create mode 100644 src/views/video/camera/component/CameraPreviewDialog.vue diff --git a/public/hikvision/encryption/AES.js b/public/hikvision/encryption/AES.js new file mode 100644 index 00000000..f257d7ca --- /dev/null +++ b/public/hikvision/encryption/AES.js @@ -0,0 +1,621 @@ +(function() { + var Nr = 10; + // convert two-dimensional indicies to one-dim array indices + var I00 = 0; + var I01 = 1; + var I02 = 2; + var I03 = 3; + var I10 = 4; + var I11 = 5; + var I12 = 6; + var I13 = 7; + var I20 = 8; + var I21 = 9; + var I22 = 10; + var I23 = 11; + var I30 = 12; + var I31 = 13; + var I32 = 14; + var I33 = 15; + + // S-Box substitution table + var S_enc = new Array( + 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, + 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, + 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, + 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, + 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, + 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, + 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, + 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, + 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, + 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, + 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, + 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, + 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, + 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, + 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, + 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, + 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, + 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, + 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, + 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, + 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, + 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, + 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, + 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, + 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, + 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, + 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, + 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, + 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, + 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, + 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, + 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16); + + // inverse S-Box for decryptions + var S_dec = new Array( + 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, + 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, + 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, + 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, + 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, + 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, + 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, + 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, + 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, + 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, + 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, + 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, + 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, + 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, + 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, + 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, + 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, + 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, + 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, + 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, + 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, + 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, + 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, + 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, + 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, + 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, + 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, + 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, + 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, + 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, + 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, + 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d); + + function cvt_hex8 (val) { + var vh = (val>>>4)&0x0f; + return vh.toString(16) + (val&0x0f).toString(16); + } + function cvt_byte (str) { + // get the first hex digit + var val1 = str.charCodeAt(0); + // do some error checking + if (val1 >= 48 && val1 <= 57) { + // have a valid digit 0-9 + val1 -= 48; + } else if (val1 >= 65 && val1 <= 70) { + // have a valid digit A-F + val1 -= 55; + } else if (val1 >= 97 && val1 <= 102) { + // have a valid digit A-F + val1 -= 87; + } else { + // not 0-9 or A-F, complain + console.log( str.charAt(1)+" is not a valid hex digit" ); + return -1; + } + // get the second hex digit + var val2 = str.charCodeAt(1); + // do some error checking + if ( val2 >= 48 && val2 <= 57 ) { + // have a valid digit 0-9 + val2 -= 48; + } else if ( val2 >= 65 && val2 <= 70 ) { + // have a valid digit A-F + val2 -= 55; + } else if ( val2 >= 97 && val2 <= 102 ) { + // have a valid digit A-F + val2 -= 87; + } else { + // not 0-9 or A-F, complain + console.log( str.charAt(2)+" is not a valid hex digit" ); + return -1; + } + // all is ok, return the value + return val1*16 + val2; + } + + // conversion function for non-constant subscripts + // assume subscript range 0..3 + function I(x,y) { + return (x*4) + y; + } + + // remove spaces from input + function remove_spaces(instr) { + var i; + var outstr = ""; + for(i=0; i 16) { + console.log("is too long, using the first 16 ASCII characters" ); + } + // have ASCII data + // 16 characters? + if (str.length >= 16) { + // 16 or more characters + for(i=0; i<16; i++) { + dbyte[i] = str.charCodeAt(i); + } + } else { + // less than 16 characters - fill with NULLs + for(i=0; i 0) { + if((a&1) != 0) + res = res ^ b; // "add" to the result + a >>>= 1; // shift a to get next higher-order bit + b <<= 1; // shift multiplier also + } + // now reduce it modulo x**8 + x**4 + x**3 + x + 1 + var hbit = 0x10000; // bit to test if we need to take action + var modulus = 0x11b00; // modulus - XOR by this to change value + while(hbit >= 0x100) { + if ((res & hbit) != 0) { + res ^= modulus; // XOR with the modulus + } + // prepare for the next loop + hbit >>= 1; + modulus >>= 1; + } + return res; + } + + // apply the S-box substitution to the key expansion + function SubWord(word_ary) { + var i; + for(i=0; i<16; i++) { + word_ary[i] = S_enc[word_ary[i]]; + } + return word_ary; + } + + // rotate the bytes in a word + function RotWord(word_ary) { + return new Array(word_ary[1], word_ary[2], word_ary[3], word_ary[0]); + } + + // calculate the first item Rcon[i] = { x^(i-1), 0, 0, 0 } + // note we only return the first item + function Rcon(exp) { + var val = 2; + var result = 1; + + // remember to calculate x^(exp-1) + exp--; + + // process the exponent using normal shift and multiply + while ( exp > 0 ) + { + if ( (exp & 1) != 0 ) + result = aes_mul( result, val ); + + // square the value + val = aes_mul( val, val ); + + // move to the next bit + exp >>= 1; + } + + return result; + } + // round key generation + // return a byte array with the expanded key information + function key_expand( key ) + { + var temp = new Array(4); + var i, j; + var w = new Array(4*(Nr+1)); + + // copy initial key stuff + for( i=0; i<16; i++ ) + { + w[i] = key[i]; + } + + // generate rest of key schedule using 32-bit words + i = 4; + while ( i < 4*(Nr+1)) // blocksize * ( rounds + 1 ) + { + // copy word W[i-1] to temp + for( j=0; j<4; j++ ) + temp[j] = w[(i-1)*4+j]; + + if ( i % 4 == 0) + { + // temp = SubWord(RotWord(temp)) ^ Rcon[i/4]; + temp = RotWord( temp ); + temp = SubWord( temp ); + temp[0] ^= Rcon( i>>>2 ); + } + + // word = word ^ temp + for( j=0; j<4; j++ ) + w[i*4+j] = w[(i-4)*4+j] ^ temp[j]; + + i++; + } + + return w; + } + + // do S-Box substitution + function SubBytes(state, Sbox) + { + var i; + + for( i=0; i<16; i++ ) + state[i] = Sbox[ state[i] ]; + + return state; + } + + // shift each row as appropriate + function ShiftRows(state) + { + var t0, t1, t2, t3; + + // top row (row 0) isn't shifted + + // next row (row 1) rotated left 1 place + t0 = state[I10]; + t1 = state[I11]; + t2 = state[I12]; + t3 = state[I13]; + state[I10] = t1; + state[I11] = t2; + state[I12] = t3; + state[I13] = t0; + + // next row (row 2) rotated left 2 places + t0 = state[I20]; + t1 = state[I21]; + t2 = state[I22]; + t3 = state[I23]; + state[I20] = t2; + state[I21] = t3; + state[I22] = t0; + state[I23] = t1; + + // bottom row (row 3) rotated left 3 places + t0 = state[I30]; + t1 = state[I31]; + t2 = state[I32]; + t3 = state[I33]; + state[I30] = t3; + state[I31] = t0; + state[I32] = t1; + state[I33] = t2; + + return state; + } + + // inverset shift each row as appropriate + function InvShiftRows(state) + { + var t0, t1, t2, t3; + + // top row (row 0) isn't shifted + + // next row (row 1) rotated left 1 place + t0 = state[I10]; + t1 = state[I11]; + t2 = state[I12]; + t3 = state[I13]; + state[I10] = t3; + state[I11] = t0; + state[I12] = t1; + state[I13] = t2; + + // next row (row 2) rotated left 2 places + t0 = state[I20]; + t1 = state[I21]; + t2 = state[I22]; + t3 = state[I23]; + state[I20] = t2; + state[I21] = t3; + state[I22] = t0; + state[I23] = t1; + + // bottom row (row 3) rotated left 3 places + t0 = state[I30]; + t1 = state[I31]; + t2 = state[I32]; + t3 = state[I33]; + state[I30] = t1; + state[I31] = t2; + state[I32] = t3; + state[I33] = t0; + + return state; + } + + // process column info + function MixColumns(state) + { + var col; + var c0, c1, c2, c3; + + for( col=0; col<4; col++ ) + { + c0 = state[I(0,col)]; + c1 = state[I(1,col)]; + c2 = state[I(2,col)]; + c3 = state[I(3,col)]; + + // do mixing, and put back into array + state[I(0,col)] = aes_mul(2,c0) ^ aes_mul(3,c1) ^ c2 ^ c3; + state[I(1,col)] = c0 ^ aes_mul(2,c1) ^ aes_mul(3,c2) ^ c3; + state[I(2,col)] = c0 ^ c1 ^ aes_mul(2,c2) ^ aes_mul(3,c3); + state[I(3,col)] = aes_mul(3,c0) ^ c1 ^ c2 ^ aes_mul(2,c3); + } + + return state; + } + + // inverse process column info + function InvMixColumns(state) + { + var col; + var c0, c1, c2, c3; + + for( col=0; col<4; col++ ) + { + c0 = state[I(0,col)]; + c1 = state[I(1,col)]; + c2 = state[I(2,col)]; + c3 = state[I(3,col)]; + + // do inverse mixing, and put back into array + state[I(0,col)] = aes_mul(0x0e,c0) ^ aes_mul(0x0b,c1) + ^ aes_mul(0x0d,c2) ^ aes_mul(0x09,c3); + state[I(1,col)] = aes_mul(0x09,c0) ^ aes_mul(0x0e,c1) + ^ aes_mul(0x0b,c2) ^ aes_mul(0x0d,c3); + state[I(2,col)] = aes_mul(0x0d,c0) ^ aes_mul(0x09,c1) + ^ aes_mul(0x0e,c2) ^ aes_mul(0x0b,c3); + state[I(3,col)] = aes_mul(0x0b,c0) ^ aes_mul(0x0d,c1) + ^ aes_mul(0x09,c2) ^ aes_mul(0x0e,c3); + } + + return state; + } + + // insert subkey information + function AddRoundKey( state, w, base ) + { + var col; + + for( col=0; col<4; col++ ) + { + state[I(0,col)] ^= w[base+col*4]; + state[I(1,col)] ^= w[base+col*4+1]; + state[I(2,col)] ^= w[base+col*4+2]; + state[I(3,col)] ^= w[base+col*4+3]; + } + + return state; + } + + // return a transposed array + function transpose( msg ) + { + var row, col; + var state = new Array( 16 ); + + for( row=0; row<4; row++ ) + for( col=0; col<4; col++ ) + state[I(row,col)] = msg[I(col,row)]; + + return state; + } + + // final AES state + var AES_output = new Array(16); + + // format AES output + // -- uses the global array DES_output + function format_AES_output(bASCII) + { + var i; + var bits; + var str=""; + + // what type of data do we have to work with? + if (bASCII) + { + // convert each set of bits back to ASCII + for( i=0; i<16; i++ ) + str += String.fromCharCode( AES_output[i] ); + } + else + { + // output hexdecimal data (insert spaces) + str = cvt_hex8( AES_output[0] ); + for( i=1; i<16; i++ ) + { + str += "" + cvt_hex8( AES_output[i] ); + } + } + return str; + } + + // do encrytion + function aes_encrypt(str, key, bASCII) + { + //console.log(" aes_encrypt:\tstr = " + str + "\tkey = " + key + "\t bASCII = " + bASCII); + var w = new Array( 4*(Nr+1) ); // subkey information + var state = new Array( 16 ); // working state + var round; + + //accumulated_output_info = ""; + + // get the message from the user + // also check if it is ASCII or hex + var msg = get_value(str, bASCII); + + // problems?? + if ( msg[0] < 0 ) + { + return; + } + + // get the key from the user + var key = get_value(key, false); + // problems?? + if ( key[0] < 0 ) + { + return; + } + + // expand the key + w = key_expand( key ); + + // initial state = message in columns (transposed from what we input) + state = transpose( msg ); + + // display the round key - Transpose due to the way it is stored/used + state = AddRoundKey(state, w, 0); + + for( round=1; round=1; round-- ) + { + state = InvShiftRows(state); + state = SubBytes(state, S_dec); + // display the round key - Transpose due to the way it is stored/used + // note here the spec uses 32-bit words, we are using bytes, so an extra *4 + state = AddRoundKey(state, w, round*4*4); + state = InvMixColumns(state); + } + + InvShiftRows(state); + SubBytes(state, S_dec); + AddRoundKey(state, w, 0); + + // process output + AES_output = transpose( state ); + var szOutput = format_AES_output(!bASCII); + return szOutput; + } + window.aes_encrypt = aes_encrypt; + window.aes_decrypt = aes_decrypt; + window.console = window.console || { + log: function() {} + }; +}()); \ No newline at end of file diff --git a/public/hikvision/encryption/cryptico.min.js b/public/hikvision/encryption/cryptico.min.js new file mode 100644 index 00000000..a1d93ee4 --- /dev/null +++ b/public/hikvision/encryption/cryptico.min.js @@ -0,0 +1,106 @@ +var dbits,canary=244837814094590,j_lm=(canary&16777215)==15715070;function BigInteger(a,b,c){a!=null&&("number"==typeof a?this.fromNumber(a,b,c):b==null&&"string"!=typeof a?this.fromString(a,256):this.fromString(a,b))}function nbi(){return new BigInteger(null)}function am1(a,b,c,d,e,g){for(;--g>=0;){var h=b*this[a++]+c[d]+e,e=Math.floor(h/67108864);c[d++]=h&67108863}return e} +function am2(a,b,c,d,e,g){var h=b&32767;for(b>>=15;--g>=0;){var f=this[a]&32767,o=this[a++]>>15,p=b*f+o*h,f=h*f+((p&32767)<<15)+c[d]+(e&1073741823),e=(f>>>30)+(p>>>15)+b*o+(e>>>30);c[d++]=f&1073741823}return e}function am3(a,b,c,d,e,g){var h=b&16383;for(b>>=14;--g>=0;){var f=this[a]&16383,o=this[a++]>>14,p=b*f+o*h,f=h*f+((p&16383)<<14)+c[d]+e,e=(f>>28)+(p>>14)+b*o;c[d++]=f&268435455}return e} +j_lm&&navigator.appName=="Microsoft Internet Explorer"?(BigInteger.prototype.am=am2,dbits=30):j_lm&&navigator.appName!="Netscape"?(BigInteger.prototype.am=am1,dbits=26):(BigInteger.prototype.am=am3,dbits=28);BigInteger.prototype.DB=dbits;BigInteger.prototype.DM=(1<=0;--b)a[b]=this[b];a.t=this.t;a.s=this.s}function bnpFromInt(a){this.t=1;this.s=a<0?-1:0;a>0?this[0]=a:a<-1?this[0]=a+DV:this.t=0} +function nbv(a){var b=nbi();b.fromInt(a);return b} +function bnpFromString(a,b){var c;if(b==16)c=4;else if(b==8)c=3;else if(b==256)c=8;else if(b==2)c=1;else if(b==32)c=5;else if(b==4)c=2;else{this.fromRadix(a,b);return}this.s=this.t=0;for(var d=a.length,e=!1,g=0;--d>=0;){var h=c==8?a[d]&255:intAt(a,d);h<0?a.charAt(d)=="-"&&(e=!0):(e=!1,g==0?this[this.t++]=h:g+c>this.DB?(this[this.t-1]|=(h&(1<>this.DB-g):this[this.t-1]|=h<=this.DB&&(g-=this.DB))}if(c==8&&(a[0]&128)!=0)this.s=-1,g>0&&(this[this.t-1]|=(1<< +this.DB-g)-1<0&&this[this.t-1]==a;)--this.t} +function bnToString(a){if(this.s<0)return"-"+this.negate().toString(a);if(a==16)a=4;else if(a==8)a=3;else if(a==2)a=1;else if(a==32)a=5;else if(a==64)a=6;else if(a==4)a=2;else return this.toRadix(a);var b=(1<0){if(h>h)>0)d=!0,e=int2char(c);for(;g>=0;)h>(h+=this.DB-a)):(c=this[g]>>(h-=a)&b,h<=0&&(h+=this.DB,--g)),c>0&&(d=!0),d&&(e+=int2char(c))}return d?e:"0"} +function bnNegate(){var a=nbi();BigInteger.ZERO.subTo(this,a);return a}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(a){var b=this.s-a.s;if(b!=0)return b;var c=this.t,b=c-a.t;if(b!=0)return b;for(;--c>=0;)if((b=this[c]-a[c])!=0)return b;return 0}function nbits(a){var b=1,c;if((c=a>>>16)!=0)a=c,b+=16;if((c=a>>8)!=0)a=c,b+=8;if((c=a>>4)!=0)a=c,b+=4;if((c=a>>2)!=0)a=c,b+=2;a>>1!=0&&(b+=1);return b} +function bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(a,b){var c;for(c=this.t-1;c>=0;--c)b[c+a]=this[c];for(c=a-1;c>=0;--c)b[c]=0;b.t=this.t+a;b.s=this.s}function bnpDRShiftTo(a,b){for(var c=a;c=0;--f)b[f+g+1]=this[f]>>d|h,h=(this[f]&e)<=0;--f)b[f]=0;b[g]=h;b.t=this.t+g+1;b.s=this.s;b.clamp()} +function bnpRShiftTo(a,b){b.s=this.s;var c=Math.floor(a/this.DB);if(c>=this.t)b.t=0;else{var d=a%this.DB,e=this.DB-d,g=(1<>d;for(var h=c+1;h>d;d>0&&(b[this.t-c-1]|=(this.s&g)<>=this.DB;if(a.t>=this.DB;d+=this.s}else{for(d+=this.s;c>=this.DB;d-=a.s}b.s=d<0?-1:0;d<-1?b[c++]=this.DV+d:d>0&&(b[c++]=d);b.t=c;b.clamp()} +function bnpMultiplyTo(a,b){var c=this.abs(),d=a.abs(),e=c.t;for(b.t=e+d.t;--e>=0;)b[e]=0;for(e=0;e=0;)a[c]=0;for(c=0;c=b.DV)a[c+b.t]-=b.DV,a[c+b.t+1]=1}a.t>0&&(a[a.t-1]+=b.am(c,b[c],a,2*c,0,1));a.s=0;a.clamp()} +function bnpDivRemTo(a,b,c){var d=a.abs();if(!(d.t<=0)){var e=this.abs();if(e.t0?(d.lShiftTo(f,g),e.lShiftTo(f,c)):(d.copyTo(g),e.copyTo(c));d=g.t;e=g[d-1];if(e!=0){var o=e*(1<1?g[d-2]>>this.F2:0),p=this.FV/o,o=(1<=0&&(c[c.t++]=1,c.subTo(j,c));BigInteger.ONE.dlShiftTo(d, +j);for(j.subTo(g,g);g.t=0;){var l=c[--n]==e?this.DM:Math.floor(c[n]*p+(c[n-1]+q)*o);if((c[n]+=g.am(0,l,c,k,0,d))0&&c.rShiftTo(f,c);h<0&&BigInteger.ZERO.subTo(c,c)}}}}function bnMod(a){var b=nbi();this.abs().divRemTo(a,null,b);this.s<0&&b.compareTo(BigInteger.ZERO)>0&&a.subTo(b,b);return b}function Classic(a){this.m=a} +function cConvert(a){return a.s<0||a.compareTo(this.m)>=0?a.mod(this.m):a}function cRevert(a){return a}function cReduce(a){a.divRemTo(this.m,null,a)}function cMulTo(a,b,c){a.multiplyTo(b,c);this.reduce(c)}function cSqrTo(a,b){a.squareTo(b);this.reduce(b)}Classic.prototype.convert=cConvert;Classic.prototype.revert=cRevert;Classic.prototype.reduce=cReduce;Classic.prototype.mulTo=cMulTo;Classic.prototype.sqrTo=cSqrTo; +function bnpInvDigit(){if(this.t<1)return 0;var a=this[0];if((a&1)==0)return 0;var b=a&3,b=b*(2-(a&15)*b)&15,b=b*(2-(a&255)*b)&255,b=b*(2-((a&65535)*b&65535))&65535,b=b*(2-a*b%this.DV)%this.DV;return b>0?this.DV-b:-b}function Montgomery(a){this.m=a;this.mp=a.invDigit();this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<0&&this.m.subTo(b,b);return b}function montRevert(a){var b=nbi();a.copyTo(b);this.reduce(b);return b} +function montReduce(a){for(;a.t<=this.mt2;)a[a.t++]=0;for(var b=0;b>15)*this.mpl&this.um)<<15)&a.DM,c=b+this.m.t;for(a[c]+=this.m.am(0,d,a,b,0,this.m.t);a[c]>=a.DV;)a[c]-=a.DV,a[++c]++}a.clamp();a.drShiftTo(this.m.t,a);a.compareTo(this.m)>=0&&a.subTo(this.m,a)}function montSqrTo(a,b){a.squareTo(b);this.reduce(b)}function montMulTo(a,b,c){a.multiplyTo(b,c);this.reduce(c)}Montgomery.prototype.convert=montConvert; +Montgomery.prototype.revert=montRevert;Montgomery.prototype.reduce=montReduce;Montgomery.prototype.mulTo=montMulTo;Montgomery.prototype.sqrTo=montSqrTo;function bnpIsEven(){return(this.t>0?this[0]&1:this.s)==0}function bnpExp(a,b){if(a>4294967295||a<1)return BigInteger.ONE;var c=nbi(),d=nbi(),e=b.convert(this),g=nbits(a)-1;for(e.copyTo(c);--g>=0;)if(b.sqrTo(c,d),(a&1<0)b.mulTo(d,e,c);else var h=c,c=d,d=h;return b.revert(c)} +function bnModPowInt(a,b){var c;c=a<256||b.isEven()?new Classic(b):new Montgomery(b);return this.exp(a,c)}BigInteger.prototype.copyTo=bnpCopyTo;BigInteger.prototype.fromInt=bnpFromInt;BigInteger.prototype.fromString=bnpFromString;BigInteger.prototype.clamp=bnpClamp;BigInteger.prototype.dlShiftTo=bnpDLShiftTo;BigInteger.prototype.drShiftTo=bnpDRShiftTo;BigInteger.prototype.lShiftTo=bnpLShiftTo;BigInteger.prototype.rShiftTo=bnpRShiftTo;BigInteger.prototype.subTo=bnpSubTo; +BigInteger.prototype.multiplyTo=bnpMultiplyTo;BigInteger.prototype.squareTo=bnpSquareTo;BigInteger.prototype.divRemTo=bnpDivRemTo;BigInteger.prototype.invDigit=bnpInvDigit;BigInteger.prototype.isEven=bnpIsEven;BigInteger.prototype.exp=bnpExp;BigInteger.prototype.toString=bnToString;BigInteger.prototype.negate=bnNegate;BigInteger.prototype.abs=bnAbs;BigInteger.prototype.compareTo=bnCompareTo;BigInteger.prototype.bitLength=bnBitLength;BigInteger.prototype.mod=bnMod;BigInteger.prototype.modPowInt=bnModPowInt; +BigInteger.ZERO=nbv(0);BigInteger.ONE=nbv(1);function bnClone(){var a=nbi();this.copyTo(a);return a}function bnIntValue(){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)<>24}function bnShortValue(){return this.t==0?this.s:this[0]<<16>>16} +function bnpChunkSize(a){return Math.floor(Math.LN2*this.DB/Math.log(a))}function bnSigNum(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function bnpToRadix(a){a==null&&(a=10);if(this.signum()==0||a<2||a>36)return"0";var b=this.chunkSize(a),b=Math.pow(a,b),c=nbv(b),d=nbi(),e=nbi(),g="";for(this.divRemTo(c,d,e);d.signum()>0;)g=(b+e.intValue()).toString(a).substr(1)+g,d.divRemTo(c,d,e);return e.intValue().toString(a)+g} +function bnpFromRadix(a,b){this.fromInt(0);b==null&&(b=10);for(var c=this.chunkSize(b),d=Math.pow(b,c),e=!1,g=0,h=0,f=0;f=c&&(this.dMultiply(d),this.dAddOffset(h,0),h=g=0))}g>0&&(this.dMultiply(Math.pow(b,g)),this.dAddOffset(h,0));e&&BigInteger.ZERO.subTo(this,this)} +function bnpFromNumber(a,b,c){if("number"==typeof b)if(a<2)this.fromInt(1);else{this.fromNumber(a,c);this.testBit(a-1)||this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);for(this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(b);)this.dAddOffset(2,0),this.bitLength()>a&&this.subTo(BigInteger.ONE.shiftLeft(a-1),this)}else{var c=[],d=a&7;c.length=(a>>3)+1;b.nextBytes(c);d>0?c[0]&=(1<0){if(c>c)!=(this.s&this.DM)>>c)b[e++]=d|this.s<=0;)if(c<8?(d=(this[a]&(1<>(c+=this.DB-8)):(d=this[a]>>(c-=8)&255,c<=0&&(c+=this.DB,--a)),(d&128)!=0&&(d|=-256),e==0&&(this.s&128)!=(d&128)&&++e,e>0||d!=this.s)b[e++]=d}return b}function bnEquals(a){return this.compareTo(a)==0}function bnMin(a){return this.compareTo(a)<0?this:a} +function bnMax(a){return this.compareTo(a)>0?this:a}function bnpBitwiseTo(a,b,c){var d,e,g=Math.min(a.t,this.t);for(d=0;d>=16,b+=16);(a&255)==0&&(a>>=8,b+=8);(a&15)==0&&(a>>=4,b+=4);(a&3)==0&&(a>>=2,b+=2);(a&1)==0&&++b;return b}function bnGetLowestSetBit(){for(var a=0;a=this.t?this.s!=0:(this[b]&1<>=this.DB;if(a.t>=this.DB;d+=this.s}else{for(d+=this.s;c>=this.DB;d+=a.s}b.s=d<0?-1:0;d>0?b[c++]=d:d<-1&&(b[c++]=this.DV+d);b.t=c;b.clamp()}function bnAdd(a){var b=nbi();this.addTo(a,b);return b}function bnSubtract(a){var b=nbi();this.subTo(a,b);return b} +function bnMultiply(a){var b=nbi();this.multiplyTo(a,b);return b}function bnSquare(){var a=nbi();this.squareTo(a);return a}function bnDivide(a){var b=nbi();this.divRemTo(a,b,null);return b}function bnRemainder(a){var b=nbi();this.divRemTo(a,null,b);return b}function bnDivideAndRemainder(a){var b=nbi(),c=nbi();this.divRemTo(a,b,c);return[b,c]}function bnpDMultiply(a){this[this.t]=this.am(0,a-1,this,0,0,this.t);++this.t;this.clamp()} +function bnpDAddOffset(a,b){if(a!=0){for(;this.t<=b;)this[this.t++]=0;for(this[b]+=a;this[b]>=this.DV;)this[b]-=this.DV,++b>=this.t&&(this[this.t++]=0),++this[b]}}function NullExp(){}function nNop(a){return a}function nMulTo(a,b,c){a.multiplyTo(b,c)}function nSqrTo(a,b){a.squareTo(b)}NullExp.prototype.convert=nNop;NullExp.prototype.revert=nNop;NullExp.prototype.mulTo=nMulTo;NullExp.prototype.sqrTo=nSqrTo;function bnPow(a){return this.exp(a,new NullExp)} +function bnpMultiplyLowerTo(a,b,c){var d=Math.min(this.t+a.t,b);c.s=0;for(c.t=d;d>0;)c[--d]=0;var e;for(e=c.t-this.t;d=0;)c[d]=0;for(d=Math.max(b-this.t,0);d2*this.m.t)return a.mod(this.m);else if(a.compareTo(this.m)<0)return a;else{var b=nbi();a.copyTo(b);this.reduce(b);return b}}function barrettRevert(a){return a} +function barrettReduce(a){a.drShiftTo(this.m.t-1,this.r2);if(a.t>this.m.t+1)a.t=this.m.t+1,a.clamp();this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);for(this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);a.compareTo(this.r2)<0;)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);a.compareTo(this.m)>=0;)a.subTo(this.m,a)}function barrettSqrTo(a,b){a.squareTo(b);this.reduce(b)}function barrettMulTo(a,b,c){a.multiplyTo(b,c);this.reduce(c)}Barrett.prototype.convert=barrettConvert; +Barrett.prototype.revert=barrettRevert;Barrett.prototype.reduce=barrettReduce;Barrett.prototype.mulTo=barrettMulTo;Barrett.prototype.sqrTo=barrettSqrTo; +function bnModPow(a,b){var c=a.bitLength(),d,e=nbv(1),g;if(c<=0)return e;else d=c<18?1:c<48?3:c<144?4:c<768?5:6;g=c<8?new Classic(b):b.isEven()?new Barrett(b):new Montgomery(b);var h=[],f=3,o=d-1,p=(1<1){c=nbi();for(g.sqrTo(h[1],c);f<=p;)h[f]=nbi(),g.mulTo(c,h[f-2],h[f]),f+=2}for(var q=a.t-1,n,k=!0,j=nbi(),c=nbits(a[q])-1;q>=0;){c>=o?n=a[q]>>c-o&p:(n=(a[q]&(1<0&&(n|=a[q-1]>>this.DB+c-o));for(f=d;(n&1)==0;)n>>=1,--f;if((c-=f)<0)c+=this.DB,--q;if(k)h[n].copyTo(e), +k=!1;else{for(;f>1;)g.sqrTo(e,j),g.sqrTo(j,e),f-=2;f>0?g.sqrTo(e,j):(f=e,e=j,j=f);g.mulTo(j,h[n],e)}for(;q>=0&&(a[q]&1<0&&(b.rShiftTo(d,b),a.rShiftTo(d,a));for(;b.signum()>0;)(c=b.getLowestSetBit())>0&&b.rShiftTo(c,b),(c=a.getLowestSetBit())>0&&a.rShiftTo(c,a),b.compareTo(a)>=0?(b.subTo(a,b),b.rShiftTo(1,b)):(a.subTo(b,a),a.rShiftTo(1,a));d>0&&a.lShiftTo(d,a);return a} +function bnpModInt(a){if(a<=0)return 0;var b=this.DV%a,c=this.s<0?a-1:0;if(this.t>0)if(b==0)c=this[0]%a;else for(var d=this.t-1;d>=0;--d)c=(b*c+this[d])%a;return c} +function bnModInverse(a){var b=a.isEven();if(this.isEven()&&b||a.signum()==0)return BigInteger.ZERO;for(var c=a.clone(),d=this.clone(),e=nbv(1),g=nbv(0),h=nbv(0),f=nbv(1);c.signum()!=0;){for(;c.isEven();){c.rShiftTo(1,c);if(b){if(!e.isEven()||!g.isEven())e.addTo(this,e),g.subTo(a,g);e.rShiftTo(1,e)}else g.isEven()||g.subTo(a,g);g.rShiftTo(1,g)}for(;d.isEven();){d.rShiftTo(1,d);if(b){if(!h.isEven()||!f.isEven())h.addTo(this,h),f.subTo(a,f);h.rShiftTo(1,h)}else f.isEven()||f.subTo(a,f);f.rShiftTo(1, +f)}c.compareTo(d)>=0?(c.subTo(d,c),b&&e.subTo(h,e),g.subTo(f,g)):(d.subTo(c,d),b&&h.subTo(e,h),f.subTo(g,f))}if(d.compareTo(BigInteger.ONE)!=0)return BigInteger.ZERO;if(f.compareTo(a)>=0)return f.subtract(a);if(f.signum()<0)f.addTo(a,f);else return f;return f.signum()<0?f.add(a):f} +var lowprimes=[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],lplim=67108864/lowprimes[lowprimes.length-1]; +function bnIsProbablePrime(a){var b,c=this.abs();if(c.t==1&&c[0]<=lowprimes[lowprimes.length-1]){for(b=0;b>1;if(a>lowprimes.length)a=lowprimes.length;for(var e=nbi(),g=0;g=g;)a/=2,b/=2,f>>>=1;return(a+f)/b};return q};h=b.pow(c,d);e=b.pow(2, +e);g=e*2;p(b.random(),a)})([],Math,256,6,52);function SeededRandom(){}function SRnextBytes(a){var b;for(b=0;b>8&255;rng_pool[rng_pptr++]^=a>>16&255;rng_pool[rng_pptr++]^=a>>24&255;rng_pptr>=rng_psize&&(rng_pptr-=rng_psize)}function rng_seed_time(){rng_seed_int((new Date).getTime())} +if(rng_pool==null){rng_pool=[];rng_pptr=0;var t;if(navigator.appName=="Netscape"&&navigator.appVersion<"5"&&window.crypto){var z=window.crypto.random(32);for(t=0;t>>8,rng_pool[rng_pptr++]=t&255;rng_pptr=0;rng_seed_time()} +function rng_get_byte(){if(rng_state==null){rng_seed_time();rng_state=prng_newstate();rng_state.init(rng_pool);for(rng_pptr=0;rng_pptr>16)+(b>>16)+(c>>16)<<16|c&65535}function c(a,b){return a>>>b|a<<32-b}a=function(a){for(var a=a.replace(/\r\n/g,"\n"),b="",c=0;c127&&h<2048?b+=String.fromCharCode(h>>6|192):(b+=String.fromCharCode(h>>12|224),b+=String.fromCharCode(h>>6&63|128)),b+=String.fromCharCode(h&63|128))}return b}(a);return function(a){for(var b="",c=0;c> +2]>>(3-c%4)*8+4&15)+"0123456789abcdef".charAt(a[c>>2]>>(3-c%4)*8&15);return b}(function(a,e){var g=[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],h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],f=Array(64),o,p,q,n,k,j,l,m,s,r,u,w;a[e>>5]|=128<<24-e%32;a[(e+64>>9<<4)+15]=e;for(s=0;s>>10,f[r-7]),c(f[r-15],7)^c(f[r-15],18)^f[r-15]>>>3),f[r-16]),u=b(b(b(b(m,c(k,6)^c(k,11)^c(k,25)),k&j^~k&l),g[r]),f[r]),w=b(c(o,2)^c(o,13)^c(o,22),o&p^o&q^p&q),m=l,l=j,j=k,k=b(n,u),n=q,q=p,p=o,o=b(u,w);h[0]=b(o,h[0]);h[1]=b(p,h[1]);h[2]=b(q,h[2]);h[3]=b(n,h[3]);h[4]=b(k,h[4]);h[5]=b(j,h[5]);h[6]=b(l,h[6]);h[7]=b(m,h[7])}return h}(function(a){for(var b=[],c=0;c>5]|=(a.charCodeAt(c/ +8)&255)<<24-c%32;return b}(a),a.length*8))}var sha256={hex:function(a){return SHA256(a)}}; +function SHA1(a){function b(a,b){return a<>>32-b}function c(a){var b="",c,d;for(c=7;c>=0;c--)d=a>>>c*4&15,b+=d.toString(16);return b}var d,e,g=Array(80),h=1732584193,f=4023233417,o=2562383102,p=271733878,q=3285377520,n,k,j,l,m,a=function(a){for(var a=a.replace(/\r\n/g,"\n"),b="",c=0;c127&&d<2048?b+=String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d& +63|128))}return b}(a);n=a.length;var s=[];for(d=0;d>>29);s.push(n<<3&4294967295);for(a=0;a>>32-g,c)}function d(a,c,d,e,f,g,h){a=b(a,b(b(c&e|d&~e,f),h));return b(a<>>32-g,c)}function e(a,c,d,e,f,g,h){a=b(a,b(b(c^d^e,f),h));return b(a<>>32-g,c)}function g(a, +c,d,e,f,g,h){a=b(a,b(b(d^(c|~e),f),h));return b(a<>>32-g,c)}function h(a){var b="",c="",d;for(d=0;d<=3;d++)c=a>>>d*8&255,c="0"+c.toString(16),b+=c.substr(c.length-2,2);return b}var f=[],o,p,q,n,k,j,l,m,a=function(a){for(var a=a.replace(/\r\n/g,"\n"),b="",c=0;c127&&d<2048?b+=String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b}(a), +f=function(a){var b,c=a.length;b=c+8;for(var d=((b-b%64)/64+1)*16,e=Array(d-1),f=0,g=0;g>>29;return e}(a);k=1732584193;j=4023233417;l=2562383102;m=271733878;for(a=0;a=0&&b>0;){var e=a.charCodeAt(d--);e<128?c[--b]=e:e>127&&e<2048?(c[--b]=e&63|128,c[--b]=e>>6|192):(c[--b]=e&63|128,c[--b]=e>>6&63|128,c[--b]=e>>12|224)}c[--b]=0;d=new SecureRandom;for(e=[];b>2;){for(e[0]=0;e[0]==0;)d.nextBytes(e);c[--b]=e[0]}c[--b]=2;c[--b]=0;return new BigInteger(c)} +function RSAKey(){this.n=null;this.e=0;this.coeff=this.dmq1=this.dmp1=this.q=this.p=this.d=null}function RSASetPublic(a,b){a!=null&&b!=null&&a.length>0&&b.length>0?(this.n=parseBigInt(a,16),this.e=parseInt(b,16)):alert("Invalid RSA public key")}function RSADoPublic(a){return a.modPowInt(this.e,this.n)}function RSAEncrypt(a){a=pkcs1pad2(a,this.n.bitLength()+7>>3);if(a==null)return null;a=this.doPublic(a);if(a==null)return null;a=a.toString(16);return(a.length&1)==0?a:"0"+a} +RSAKey.prototype.doPublic=RSADoPublic;RSAKey.prototype.setPublic=RSASetPublic;RSAKey.prototype.encrypt=RSAEncrypt;function pkcs1unpad2(a,b){for(var c=a.toByteArray(),d=0;d=c.length)return null;for(var e="";++d191&&g<224?(e+=String.fromCharCode((g&31)<<6|c[d+1]&63),++d):(e+=String.fromCharCode((g&15)<<12|(c[d+1]&63)<<6|c[d+2]&63),d+=2)}return e} +function RSASetPrivate(a,b,c){a!=null&&b!=null&&a.length>0&&b.length>0?(this.n=parseBigInt(a,16),this.e=parseInt(b,16),this.d=parseBigInt(c,16)):alert("Invalid RSA private key")} +function RSASetPrivateEx(a,b,c,d,e,g,h,f){a!=null&&b!=null&&a.length>0&&b.length>0?(this.n=parseBigInt(a,16),this.e=parseInt(b,16),this.d=parseBigInt(c,16),this.p=parseBigInt(d,16),this.q=parseBigInt(e,16),this.dmp1=parseBigInt(g,16),this.dmq1=parseBigInt(h,16),this.coeff=parseBigInt(f,16)):alert("Invalid RSA private key")} +function RSAGenerate(a,b){var c=new SeededRandom,d=a>>1;this.e=parseInt(b,16);for(var e=new BigInteger(b,16);;){for(;;)if(this.p=new BigInteger(a-d,1,c),this.p.subtract(BigInteger.ONE).gcd(e).compareTo(BigInteger.ONE)==0&&this.p.isProbablePrime(10))break;for(;;)if(this.q=new BigInteger(d,1,c),this.q.subtract(BigInteger.ONE).gcd(e).compareTo(BigInteger.ONE)==0&&this.q.isProbablePrime(10))break;if(this.p.compareTo(this.q)<=0){var g=this.p;this.p=this.q;this.q=g}var g=this.p.subtract(BigInteger.ONE), +h=this.q.subtract(BigInteger.ONE),f=g.multiply(h);if(f.gcd(e).compareTo(BigInteger.ONE)==0){this.n=this.p.multiply(this.q);this.d=e.modInverse(f);this.dmp1=this.d.mod(g);this.dmq1=this.d.mod(h);this.coeff=this.q.modInverse(this.p);break}}} +function RSADoPrivate(a){if(this.p==null||this.q==null)return a.modPow(this.d,this.n);for(var b=a.mod(this.p).modPow(this.dmp1,this.p),a=a.mod(this.q).modPow(this.dmq1,this.q);b.compareTo(a)<0;)b=b.add(this.p);return b.subtract(a).multiply(this.coeff).mod(this.p).multiply(this.q).add(a)}function RSADecrypt(a){a=this.doPrivate(parseBigInt(a,16));return a==null?null:pkcs1unpad2(a,this.n.bitLength()+7>>3)}RSAKey.prototype.doPrivate=RSADoPrivate;RSAKey.prototype.setPrivate=RSASetPrivate; +RSAKey.prototype.setPrivateEx=RSASetPrivateEx;RSAKey.prototype.generate=RSAGenerate;RSAKey.prototype.decrypt=RSADecrypt;var _RSASIGN_DIHEAD=[];_RSASIGN_DIHEAD.sha1="3021300906052b0e03021a05000414";_RSASIGN_DIHEAD.sha256="3031300d060960864801650304020105000420";var _RSASIGN_HASHHEXFUNC=[];_RSASIGN_HASHHEXFUNC.sha1=sha1.hex;_RSASIGN_HASHHEXFUNC.sha256=sha256.hex; +function _rsasign_getHexPaddedDigestInfoForString(a,b,c){b/=4;for(var a=(0,_RSASIGN_HASHHEXFUNC[c])(a),c="00"+_RSASIGN_DIHEAD[c]+a,a="",b=b-4-c.length,d=0;d=256)e^=283}else c>24&&g%c==16&&(h=[a.Sbox[h[0]],a.Sbox[h[1]],a.Sbox[h[2]],a.Sbox[h[3]]]);for(var f=0;f<4;f++)b[g+f]=b[g+f-c]^h[f]}};a.Encrypt=function(b,c){var d=c.length;a.AddRoundKey(b,c.slice(0,16));for(var e=16;e=16;d-=16)a.AddRoundKey(b,c.slice(d,d+16)),a.MixColumns_Inv(b),a.ShiftRows(b,a.ShiftRowTab_Inv),a.SubBytes(b,a.Sbox_Inv);a.AddRoundKey(b,c.slice(0,16))};a.SubBytes=function(a,c){for(var d=0;d<16;d++)a[d]=c[a[d]]};a.AddRoundKey=function(a,c){for(var d=0;d<16;d++)a[d]^=c[d]};a.ShiftRows=function(a,c){for(var d=[].concat(a),e=0;e<16;e++)a[e]=d[c[e]]}; +a.MixColumns=function(b){for(var c=0;c<16;c+=4){var d=b[c+0],e=b[c+1],g=b[c+2],h=b[c+3],f=d^e^g^h;b[c+0]^=f^a.xtime[d^e];b[c+1]^=f^a.xtime[e^g];b[c+2]^=f^a.xtime[g^h];b[c+3]^=f^a.xtime[h^d]}};a.MixColumns_Inv=function(b){for(var c=0;c<16;c+=4){var d=b[c+0],e=b[c+1],g=b[c+2],h=b[c+3],f=d^e^g^h,o=a.xtime[f],p=a.xtime[a.xtime[o^d^g]]^f;f^=a.xtime[a.xtime[o^e^h]];b[c+0]^=p^a.xtime[d^e];b[c+1]^=f^a.xtime[e^g];b[c+2]^=p^a.xtime[g^h];b[c+3]^=f^a.xtime[h^d]}};return a}(),cryptico=function(){var a={};aes.Init(); +a.b256to64=function(a){var c,d,e,g="",h=0,f=0,o=a.length;for(e=0;e>2&63),c=(d&3)<<4):f==1?(g+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c|d>>4&15),c=(d&15)<<2):f==2&&(g+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c|d>>6&3),h+=1,g+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d&63)),h+=1,f+=1,f==3&& +(f=0);f>0&&(g+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c),g+="=");f==1&&(g+="=");return g};a.b64to256=function(a){var c,d,e="",g=0,h=0,f=a.length;for(d=0;d=0&&(g&&(e+=String.fromCharCode(h|c>>6-g&255)),g=g+2&7,h=c<> +6)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d&63);c+1==a.length?(d=parseInt(a.substring(c,c+1),16),e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d<<2)):c+2==a.length&&(d=parseInt(a.substring(c,c+2),16),e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<4));for(;(e.length&3)>0;)e+="=";return e};a.b64to16=function(a){var c="", +d,e=0,g;for(d=0;d>2),g=v&3,e=1):e==1?(c+=int2char(g<<2|v>>4),g=v&15,e=2):e==2?(c+=int2char(g),c+=int2char(v>>2),g=v&3,e=3):(c+=int2char(g<<2|v>>4),c+=int2char(v&15),e=0))}e==1&&(c+=int2char(g<<2));return c};a.string2bytes=function(a){for(var c=[],d=0;d>>2]|=(e[k>>>2]>>>24-8*(k%4)&255)<<24-8*((j+k)%4);else if(65535>>2]=e[k>>>2];else c.push.apply(c,e);this.sigBytes+=a;return this},clamp:function(){var a=this.words,c=this.sigBytes;a[c>>>2]&=4294967295<< +32-8*(c%4);a.length=u.ceil(c/4)},clone:function(){var a=t.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var c=[],e=0;e>>2]>>>24-8*(j%4)&255;e.push((k>>>4).toString(16));e.push((k&15).toString(16))}return e.join("")},parse:function(a){for(var c=a.length,e=[],j=0;j>>3]|=parseInt(a.substr(j, +2),16)<<24-4*(j%8);return new r.init(e,c/2)}},b=w.Latin1={stringify:function(a){var c=a.words;a=a.sigBytes;for(var e=[],j=0;j>>2]>>>24-8*(j%4)&255));return e.join("")},parse:function(a){for(var c=a.length,e=[],j=0;j>>2]|=(a.charCodeAt(j)&255)<<24-8*(j%4);return new r.init(e,c)}},x=w.Utf8={stringify:function(a){try{return decodeURIComponent(escape(b.stringify(a)))}catch(c){throw Error("Malformed UTF-8 data");}},parse:function(a){return b.parse(unescape(encodeURIComponent(a)))}}, +q=l.BufferedBlockAlgorithm=t.extend({reset:function(){this._data=new r.init;this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=x.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var c=this._data,e=c.words,j=c.sigBytes,k=this.blockSize,b=j/(4*k),b=a?u.ceil(b):u.max((b|0)-this._minBufferSize,0);a=b*k;j=u.min(4*a,j);if(a){for(var q=0;q>>2]>>>24-8*(r%4)&255)<<16|(l[r+1>>>2]>>>24-8*((r+1)%4)&255)<<8|l[r+2>>>2]>>>24-8*((r+2)%4)&255,v=0;4>v&&r+0.75*v>>6*(3-v)&63));if(l=t.charAt(64))for(;d.length%4;)d.push(l);return d.join("")},parse:function(d){var l=d.length,s=this._map,t=s.charAt(64);t&&(t=d.indexOf(t),-1!=t&&(l=t));for(var t=[],r=0,w=0;w< +l;w++)if(w%4){var v=s.indexOf(d.charAt(w-1))<<2*(w%4),b=s.indexOf(d.charAt(w))>>>6-2*(w%4);t[r>>>2]|=(v|b)<<24-8*(r%4);r++}return p.create(t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})(); +(function(u){function p(b,n,a,c,e,j,k){b=b+(n&a|~n&c)+e+k;return(b<>>32-j)+n}function d(b,n,a,c,e,j,k){b=b+(n&c|a&~c)+e+k;return(b<>>32-j)+n}function l(b,n,a,c,e,j,k){b=b+(n^a^c)+e+k;return(b<>>32-j)+n}function s(b,n,a,c,e,j,k){b=b+(a^(n|~c))+e+k;return(b<>>32-j)+n}for(var t=CryptoJS,r=t.lib,w=r.WordArray,v=r.Hasher,r=t.algo,b=[],x=0;64>x;x++)b[x]=4294967296*u.abs(u.sin(x+1))|0;r=r.MD5=v.extend({_doReset:function(){this._hash=new w.init([1732584193,4023233417,2562383102,271733878])}, +_doProcessBlock:function(q,n){for(var a=0;16>a;a++){var c=n+a,e=q[c];q[c]=(e<<8|e>>>24)&16711935|(e<<24|e>>>8)&4278255360}var a=this._hash.words,c=q[n+0],e=q[n+1],j=q[n+2],k=q[n+3],z=q[n+4],r=q[n+5],t=q[n+6],w=q[n+7],v=q[n+8],A=q[n+9],B=q[n+10],C=q[n+11],u=q[n+12],D=q[n+13],E=q[n+14],x=q[n+15],f=a[0],m=a[1],g=a[2],h=a[3],f=p(f,m,g,h,c,7,b[0]),h=p(h,f,m,g,e,12,b[1]),g=p(g,h,f,m,j,17,b[2]),m=p(m,g,h,f,k,22,b[3]),f=p(f,m,g,h,z,7,b[4]),h=p(h,f,m,g,r,12,b[5]),g=p(g,h,f,m,t,17,b[6]),m=p(m,g,h,f,w,22,b[7]), +f=p(f,m,g,h,v,7,b[8]),h=p(h,f,m,g,A,12,b[9]),g=p(g,h,f,m,B,17,b[10]),m=p(m,g,h,f,C,22,b[11]),f=p(f,m,g,h,u,7,b[12]),h=p(h,f,m,g,D,12,b[13]),g=p(g,h,f,m,E,17,b[14]),m=p(m,g,h,f,x,22,b[15]),f=d(f,m,g,h,e,5,b[16]),h=d(h,f,m,g,t,9,b[17]),g=d(g,h,f,m,C,14,b[18]),m=d(m,g,h,f,c,20,b[19]),f=d(f,m,g,h,r,5,b[20]),h=d(h,f,m,g,B,9,b[21]),g=d(g,h,f,m,x,14,b[22]),m=d(m,g,h,f,z,20,b[23]),f=d(f,m,g,h,A,5,b[24]),h=d(h,f,m,g,E,9,b[25]),g=d(g,h,f,m,k,14,b[26]),m=d(m,g,h,f,v,20,b[27]),f=d(f,m,g,h,D,5,b[28]),h=d(h,f, +m,g,j,9,b[29]),g=d(g,h,f,m,w,14,b[30]),m=d(m,g,h,f,u,20,b[31]),f=l(f,m,g,h,r,4,b[32]),h=l(h,f,m,g,v,11,b[33]),g=l(g,h,f,m,C,16,b[34]),m=l(m,g,h,f,E,23,b[35]),f=l(f,m,g,h,e,4,b[36]),h=l(h,f,m,g,z,11,b[37]),g=l(g,h,f,m,w,16,b[38]),m=l(m,g,h,f,B,23,b[39]),f=l(f,m,g,h,D,4,b[40]),h=l(h,f,m,g,c,11,b[41]),g=l(g,h,f,m,k,16,b[42]),m=l(m,g,h,f,t,23,b[43]),f=l(f,m,g,h,A,4,b[44]),h=l(h,f,m,g,u,11,b[45]),g=l(g,h,f,m,x,16,b[46]),m=l(m,g,h,f,j,23,b[47]),f=s(f,m,g,h,c,6,b[48]),h=s(h,f,m,g,w,10,b[49]),g=s(g,h,f,m, +E,15,b[50]),m=s(m,g,h,f,r,21,b[51]),f=s(f,m,g,h,u,6,b[52]),h=s(h,f,m,g,k,10,b[53]),g=s(g,h,f,m,B,15,b[54]),m=s(m,g,h,f,e,21,b[55]),f=s(f,m,g,h,v,6,b[56]),h=s(h,f,m,g,x,10,b[57]),g=s(g,h,f,m,t,15,b[58]),m=s(m,g,h,f,D,21,b[59]),f=s(f,m,g,h,z,6,b[60]),h=s(h,f,m,g,C,10,b[61]),g=s(g,h,f,m,j,15,b[62]),m=s(m,g,h,f,A,21,b[63]);a[0]=a[0]+f|0;a[1]=a[1]+m|0;a[2]=a[2]+g|0;a[3]=a[3]+h|0},_doFinalize:function(){var b=this._data,n=b.words,a=8*this._nDataBytes,c=8*b.sigBytes;n[c>>>5]|=128<<24-c%32;var e=u.floor(a/ +4294967296);n[(c+64>>>9<<4)+15]=(e<<8|e>>>24)&16711935|(e<<24|e>>>8)&4278255360;n[(c+64>>>9<<4)+14]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360;b.sigBytes=4*(n.length+1);this._process();b=this._hash;n=b.words;for(a=0;4>a;a++)c=n[a],n[a]=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360;return b},clone:function(){var b=v.clone.call(this);b._hash=this._hash.clone();return b}});t.MD5=v._createHelper(r);t.HmacMD5=v._createHmacHelper(r)})(Math); +(function(){var u=CryptoJS,p=u.lib,d=p.Base,l=p.WordArray,p=u.algo,s=p.EvpKDF=d.extend({cfg:d.extend({keySize:4,hasher:p.MD5,iterations:1}),init:function(d){this.cfg=this.cfg.extend(d)},compute:function(d,r){for(var p=this.cfg,s=p.hasher.create(),b=l.create(),u=b.words,q=p.keySize,p=p.iterations;u.length>>2]&255}};d.BlockCipher=v.extend({cfg:v.cfg.extend({mode:b,padding:q}),reset:function(){v.reset.call(this);var a=this.cfg,b=a.iv,a=a.mode;if(this._xformMode==this._ENC_XFORM_MODE)var c=a.createEncryptor;else c=a.createDecryptor,this._minBufferSize=1;this._mode=c.call(a, +this,b&&b.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else b=this._process(!0),a.unpad(b);return b},blockSize:4});var n=d.CipherParams=l.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}}),b=(p.format={}).OpenSSL={stringify:function(a){var b=a.ciphertext;a=a.salt;return(a?s.create([1398893684, +1701076831]).concat(a).concat(b):b).toString(r)},parse:function(a){a=r.parse(a);var b=a.words;if(1398893684==b[0]&&1701076831==b[1]){var c=s.create(b.slice(2,4));b.splice(0,4);a.sigBytes-=16}return n.create({ciphertext:a,salt:c})}},a=d.SerializableCipher=l.extend({cfg:l.extend({format:b}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);var l=a.createEncryptor(c,d);b=l.finalize(b);l=l.cfg;return n.create({ciphertext:b,key:c,iv:l.iv,algorithm:a,mode:l.mode,padding:l.padding,blockSize:a.blockSize,formatter:d.format})}, +decrypt:function(a,b,c,d){d=this.cfg.extend(d);b=this._parse(b,d.format);return a.createDecryptor(c,d).finalize(b.ciphertext)},_parse:function(a,b){return"string"==typeof a?b.parse(a,this):a}}),p=(p.kdf={}).OpenSSL={execute:function(a,b,c,d){d||(d=s.random(8));a=w.create({keySize:b+c}).compute(a,d);c=s.create(a.words.slice(b),4*c);a.sigBytes=4*b;return n.create({key:a,iv:c,salt:d})}},c=d.PasswordBasedCipher=a.extend({cfg:a.cfg.extend({kdf:p}),encrypt:function(b,c,d,l){l=this.cfg.extend(l);d=l.kdf.execute(d, +b.keySize,b.ivSize);l.iv=d.iv;b=a.encrypt.call(this,b,c,d.key,l);b.mixIn(d);return b},decrypt:function(b,c,d,l){l=this.cfg.extend(l);c=this._parse(c,l.format);d=l.kdf.execute(d,b.keySize,b.ivSize,c.salt);l.iv=d.iv;return a.decrypt.call(this,b,c,d.key,l)}})}(); +(function(){for(var u=CryptoJS,p=u.lib.BlockCipher,d=u.algo,l=[],s=[],t=[],r=[],w=[],v=[],b=[],x=[],q=[],n=[],a=[],c=0;256>c;c++)a[c]=128>c?c<<1:c<<1^283;for(var e=0,j=0,c=0;256>c;c++){var k=j^j<<1^j<<2^j<<3^j<<4,k=k>>>8^k&255^99;l[e]=k;s[k]=e;var z=a[e],F=a[z],G=a[F],y=257*a[k]^16843008*k;t[e]=y<<24|y>>>8;r[e]=y<<16|y>>>16;w[e]=y<<8|y>>>24;v[e]=y;y=16843009*G^65537*F^257*z^16843008*e;b[k]=y<<24|y>>>8;x[k]=y<<16|y>>>16;q[k]=y<<8|y>>>24;n[k]=y;e?(e=z^a[a[a[G^z]]],j^=a[a[j]]):e=j=1}var H=[0,1,2,4,8, +16,32,64,128,27,54],d=d.AES=p.extend({_doReset:function(){for(var a=this._key,c=a.words,d=a.sigBytes/4,a=4*((this._nRounds=d+6)+1),e=this._keySchedule=[],j=0;j>>24]<<24|l[k>>>16&255]<<16|l[k>>>8&255]<<8|l[k&255]):(k=k<<8|k>>>24,k=l[k>>>24]<<24|l[k>>>16&255]<<16|l[k>>>8&255]<<8|l[k&255],k^=H[j/d|0]<<24);e[j]=e[j-d]^k}c=this._invKeySchedule=[];for(d=0;dd||4>=j?k:b[l[k>>>24]]^x[l[k>>>16&255]]^q[l[k>>> +8&255]]^n[l[k&255]]},encryptBlock:function(a,b){this._doCryptBlock(a,b,this._keySchedule,t,r,w,v,l)},decryptBlock:function(a,c){var d=a[c+1];a[c+1]=a[c+3];a[c+3]=d;this._doCryptBlock(a,c,this._invKeySchedule,b,x,q,n,s);d=a[c+1];a[c+1]=a[c+3];a[c+3]=d},_doCryptBlock:function(a,b,c,d,e,j,l,f){for(var m=this._nRounds,g=a[b]^c[0],h=a[b+1]^c[1],k=a[b+2]^c[2],n=a[b+3]^c[3],p=4,r=1;r>>24]^e[h>>>16&255]^j[k>>>8&255]^l[n&255]^c[p++],s=d[h>>>24]^e[k>>>16&255]^j[n>>>8&255]^l[g&255]^c[p++],t= +d[k>>>24]^e[n>>>16&255]^j[g>>>8&255]^l[h&255]^c[p++],n=d[n>>>24]^e[g>>>16&255]^j[h>>>8&255]^l[k&255]^c[p++],g=q,h=s,k=t;q=(f[g>>>24]<<24|f[h>>>16&255]<<16|f[k>>>8&255]<<8|f[n&255])^c[p++];s=(f[h>>>24]<<24|f[k>>>16&255]<<16|f[n>>>8&255]<<8|f[g&255])^c[p++];t=(f[k>>>24]<<24|f[n>>>16&255]<<16|f[g>>>8&255]<<8|f[h&255])^c[p++];n=(f[n>>>24]<<24|f[g>>>16&255]<<16|f[h>>>8&255]<<8|f[k&255])^c[p++];a[b]=q;a[b+1]=s;a[b+2]=t;a[b+3]=n},keySize:8});u.AES=p._createHelper(d)})(); diff --git a/public/hikvision/encryption/encryption.js b/public/hikvision/encryption/encryption.js new file mode 100644 index 00000000..9f44fe2f --- /dev/null +++ b/public/hikvision/encryption/encryption.js @@ -0,0 +1,111 @@ +define(function(require, exports, module) { + var _oCommon, _oUtils, _oBase64; + + require("websdk"); + _oCommon = require("common"); + _oUtils = require("utils"); + _oBase64 = require("base64"); + + function EncryptionFac () {} + + EncryptionFac.prototype.encrypt = function (oStr, iRSABits, bBase64Encrypted, cbFun) { + //var that = this; + var iBits = 1024; + + if (iRSABits) { + iBits = iRSABits; + } + + var szPassPhrase = new Date() + "", + szMattsRSAkey = cryptico.generateRSAKey(szPassPhrase, iBits), + szPublicKeyString = cryptico.publicKeyString(szMattsRSAkey), + szXml = "" + _oBase64.encode(szPublicKeyString) + "", + oXmlDoc = _oUtils.parseXmlFromStr(szXml); + + WebSDK.WSDK_Request(_oCommon.m_szHostName, _oCommon.m_iHttpProtocal, _oCommon.m_iHttpPort, { + cmd: "challenge", + type: "POST", + data: oXmlDoc, + success: function (status, xmlDoc) { + var szDecryptionResult = cryptico.decrypt(_oBase64.decode(_oUtils.nodeValue(xmlDoc, "key")), szMattsRSAkey); + if(szDecryptionResult.plaintext != null) { + var szKey,szEncryptPassword; + var aResult = []; + if (iBits === 256) { + szKey = _oUtils.toHex(szDecryptionResult.plaintext); + } else { + szKey = szDecryptionResult.plaintext; + } + + szEncryptPassword = aes_encrypt(szDecryptionResult.plaintext.substring(0, 16), szKey, true); + + if("function" === typeof cbFun) { + if("string" === typeof oStr) { + bBase64Encrypted && ( oStr = _oBase64.encode(oStr) ); + cbFun( _oBase64.encode( szEncryptPassword + _oUtils.encodeAES(oStr, szKey, "", "ecb") ) ); + } else if("[object Array]" === Object.prototype.toString.call(oStr)) { + for(var i = 0, iArrayLen = oStr.length; i < iArrayLen; i++) { + bBase64Encrypted && ( oStr[i] = _oBase64.encode(oStr[i]) ); + var szTemp = szEncryptPassword + _oUtils.encodeAES(oStr[i], szKey, "", "ecb"); + aResult.push( _oBase64.encode(szTemp) ); + } + cbFun(aResult); + } + } + } + } + }); + }; + + EncryptionFac.prototype.encryptSync = function (oStr, iRSABits, bBase64Encrypted) { + //var that = this; + var iBits = 1024; + var aResult = []; + + if (iRSABits) { + iBits = iRSABits; + } + + var szPassPhrase = new Date() + "", + szMattsRSAkey = cryptico.generateRSAKey(szPassPhrase, iBits), + szPublicKeyString = cryptico.publicKeyString(szMattsRSAkey), + szXml = "" + _oBase64.encode(szPublicKeyString) + "", + oXmlDoc = _oUtils.parseXmlFromStr(szXml); + + WebSDK.WSDK_Request(_oCommon.m_szHostName, _oCommon.m_iHttpProtocal, _oCommon.m_iHttpPort, { + cmd: "challenge", + type: "POST", + async: false, + data: oXmlDoc, + success: function (status, xmlDoc) { + var szDecryptionResult = cryptico.decrypt(_oBase64.decode(_oUtils.nodeValue(xmlDoc, "key")), szMattsRSAkey); + if(szDecryptionResult.plaintext != null) { + var szKey, szEncryptPassword; + if (iBits === 256) { + szKey = _oUtils.toHex(szDecryptionResult.plaintext); + } else { + szKey = szDecryptionResult.plaintext; + } + szEncryptPassword = aes_encrypt(szDecryptionResult.plaintext.substring(0, 16), szKey, true); + if("string" === typeof oStr) { + bBase64Encrypted && ( oStr = _oBase64.encode(oStr) ); + aResult.push( _oBase64.encode( szEncryptPassword + _oUtils.encodeAES(oStr, szKey, "", "ecb") ) ); + } else { + for(var i = 0, iArrayLen = oStr.length; i < iArrayLen; i++) { + bBase64Encrypted && ( oStr[i] = _oBase64.encode(oStr[i]) ); + var szTemp = szEncryptPassword + _oUtils.encodeAES(oStr[i], szKey, "", "ecb"); + aResult.push( _oBase64.encode(szTemp) ); + } + } + } + } + }); + if("string" === typeof oStr) { + return aResult[0]; + } else { + return aResult; + } + }; + + module.exports = new EncryptionFac(); +}); \ No newline at end of file diff --git a/public/hikvision/jquery-1.7.1.min.js b/public/hikvision/jquery-1.7.1.min.js new file mode 100644 index 00000000..835d77d5 --- /dev/null +++ b/public/hikvision/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"?"":"")+""),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;g0){if(c!=="border")for(;g=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)[^>]*$|#([\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(;j0)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(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i0&& 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;d1?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
a",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>",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="
"+""+"
",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="
t
",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="
",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-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=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=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=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;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?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;h0){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+~,(\[\\]+)+|[>+~])(\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;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=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 bc[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=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.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.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="

";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="
";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;h0)for(h=g;h=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-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:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_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
","
"]),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>");try{for(var c=0,d=this.length;c1&&l0?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>");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]===""&&!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=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>/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("
").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=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-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/public/hikvision/jsPlugin/jquery.min.js b/public/hikvision/jsPlugin/jquery.min.js new file mode 100644 index 00000000..49d1fcfb --- /dev/null +++ b/public/hikvision/jsPlugin/jquery.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.3.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function e(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function e(t){return null!=t&&t===t.window},v={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in v)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b="3.3.1",w=function(e,t){return new w.fn.init(e,t)},T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.fn=w.prototype={jquery:"3.3.1",constructor:w,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n0&&t-1 in e)}var E=function(e){var t,n,r,i,o,a,s,u,l,c,f,p,d,h,g,y,v,m,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,E=ae(),k=ae(),S=ae(),D=function(e,t){return e===t&&(f=!0),0},N={}.hasOwnProperty,A=[],j=A.pop,q=A.push,L=A.push,H=A.slice,O=function(e,t){for(var n=0,r=e.length;n+~]|"+M+")"+M+"*"),z=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){p()},ie=me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(A=H.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){L={apply:A.length?function(e,t){q.apply(e,H.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function oe(e,t,r,i){var o,s,l,c,f,h,v,m=t&&t.ownerDocument,T=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return r;if(!i&&((t?t.ownerDocument||t:w)!==d&&p(t),t=t||d,g)){if(11!==T&&(f=J.exec(e)))if(o=f[1]){if(9===T){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return L.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!S[e+" "]&&(!y||!y.test(e))){if(1!==T)m=t,v=e;else if("object"!==t.nodeName.toLowerCase()){(c=t.getAttribute("id"))?c=c.replace(te,ne):t.setAttribute("id",c=b),s=(h=a(e)).length;while(s--)h[s]="#"+c+" "+ve(h[s]);v=h.join(","),m=K.test(e)&&ge(t.parentNode)||t}if(v)try{return L.apply(r,m.querySelectorAll(v)),r}catch(e){}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(B,"$1"),t,r,i)}function ae(){var e=[];function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}return t}function se(e){return e[b]=!0,e}function ue(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ge(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==d&&9===a.nodeType&&a.documentElement?(d=a,h=d.documentElement,g=!o(d),w!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=ue(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],y=[],(n.qsa=Q.test(d.querySelectorAll))&&(ue(function(e){h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+b+"-]").length||y.push("~="),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||y.push(".#.+[+~]")}),ue(function(e){e.innerHTML="";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(n.matchesSelector=Q.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),v.push("!=",W)}),y=y.length&&new RegExp(y.join("|")),v=v.length&&new RegExp(v.join("|")),t=Q.test(h.compareDocumentPosition),x=t||Q.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===d||e.ownerDocument===w&&x(w,e)?-1:t===d||t.ownerDocument===w&&x(w,t)?1:c?O(c,e)-O(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===d?-1:t===d?1:i?-1:o?1:c?O(c,e)-O(c,t):0;if(i===o)return ce(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?ce(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},d):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),t=t.replace(z,"='$1']"),n.matchesSelector&&g&&!S[t+" "]&&(!v||!v.test(t))&&(!y||!y.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),x(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&N.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(D),f){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",y=t.parentNode,v=s&&t.nodeName.toLowerCase(),m=!u&&!s,x=!1;if(y){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?y.firstChild:y.lastChild],a&&m){x=(d=(l=(c=(f=(p=y)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],p=d&&y.childNodes[d];while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if(1===p.nodeType&&++x&&p===t){c[e]=[T,d,x];break}}else if(m&&(x=d=(l=(c=(f=(p=t)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===x)while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===v:1===p.nodeType)&&++x&&(m&&((c=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[T,x]),p===t))break;return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){var r,o=i(e,t),a=o.length;while(a--)e[r=O(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[b]?se(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(Z,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return U.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:de(!1),disabled:de(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n){for(var r=0,i=t.length;r-1&&(o[l]=!(a[l]=f))}}else v=we(v===a?v.splice(h,v.length):v),i?i(null,a,v,u):L.apply(a,v)})}function Ce(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=me(function(e){return e===t},s,!0),f=me(function(e){return O(t,e)>-1},s,!0),p=[function(e,n,r){var i=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u1&&xe(p),u>1&&ve(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(B,"$1"),n,u0,i=e.length>0,o=function(o,a,s,u,c){var f,h,y,v=0,m="0",x=o&&[],b=[],w=l,C=o||i&&r.find.TAG("*",c),E=T+=null==w?1:Math.random()||.1,k=C.length;for(c&&(l=a===d||a||c);m!==k&&null!=(f=C[m]);m++){if(i&&f){h=0,a||f.ownerDocument===d||(p(f),s=!g);while(y=e[h++])if(y(f,a||d,s)){u.push(f);break}c&&(T=E)}n&&((f=!y&&f)&&v--,o&&x.push(f))}if(v+=m,n&&m!==v){h=0;while(y=t[h++])y(x,b,a,s);if(o){if(v>0)while(m--)x[m]||b[m]||(b[m]=j.call(u));b=we(b)}L.apply(u,b),c&&!o&&b.length>0&&v+t.length>1&&oe.uniqueSort(u)}return c&&(T=E,l=w),x};return n?se(o):o}return s=oe.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=a(e)),n=t.length;while(n--)(o=Ce(t[n]))[b]?r.push(o):i.push(o);(o=S(e,Ee(i,r))).selector=e}return o},u=oe.select=function(e,t,n,i){var o,u,l,c,f,p="function"==typeof e&&e,d=!i&&a(e=p.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(Z,ee),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}o=V.needsContext.test(e)?0:u.length;while(o--){if(l=u[o],r.relative[c=l.type])break;if((f=r.find[c])&&(i=f(l.matches[0].replace(Z,ee),K.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ve(u)))return L.apply(n,i),n;break}}}return(p||s(e,d))(i,t,!g,n,!t||K.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(D).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ue(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||le("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||le("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||le(P,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);w.find=E,w.expr=E.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=E.uniqueSort,w.text=E.getText,w.isXMLDoc=E.isXML,w.contains=E.contains,w.escapeSelector=E.escape;var k=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&w(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},D=w.expr.match.needsContext;function N(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var A=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return g(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return u.call(t,e)>-1!==n}):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return 1===e.nodeType}))},w.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(w(e).filter(function(){for(t=0;t1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&D.test(e)?w(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var i,o;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),A.test(i[1])&&w.isPlainObject(t))for(i in t)g(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(o=r.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,q=w(r);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(w(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return k(e,"parentNode")},parentsUntil:function(e,t,n){return k(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return k(e,"nextSibling")},prevAll:function(e){return k(e,"previousSibling")},nextUntil:function(e,t,n){return k(e,"nextSibling",n)},prevUntil:function(e,t,n){return k(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return N(e,"iframe")?e.contentDocument:(N(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(O[e]||w.uniqueSort(i),H.test(e)&&i.reverse()),this.pushStack(i)}});var M=/[^\x20\t\r\n\f]+/g;function R(e){var t={};return w.each(e.match(M)||[],function(e,n){t[n]=!0}),t}w.Callbacks=function(e){e="string"==typeof e?R(e):w.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1){n=a.shift();while(++s-1)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l};function I(e){return e}function W(e){throw e}function $(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.extend({Deferred:function(t){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return w.Deferred(function(t){w.each(n,function(n,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,u=arguments,l=function(){var e,l;if(!(t=o&&(r!==W&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),e.setTimeout(c))}}return w.Deferred(function(e){n[0][3].add(a(0,e,g(i)?i:I,e.notifyWith)),n[1][3].add(a(0,e,g(t)?t:I)),n[2][3].add(a(0,e,g(r)?r:W))}).promise()},promise:function(e){return null!=e?w.extend(e,i):i}},o={};return w.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=w.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&($(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||g(i[n]&&i[n].then)))return a.then();while(n--)$(i[n],s(n),a.reject);return a.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&B.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},w.readyException=function(t){e.setTimeout(function(){throw t})};var F=w.Deferred();w.fn.ready=function(e){return F.then(e)["catch"](function(e){w.readyException(e)}),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||F.resolveWith(r,[w]))}}),w.ready.then=F.then;function _(){r.removeEventListener("DOMContentLoaded",_),e.removeEventListener("load",_),w.ready()}"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(w.ready):(r.addEventListener("DOMContentLoaded",_),e.addEventListener("load",_));var z=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n)){i=!0;for(s in n)z(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,g(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(w(e),n)})),t))for(;s1,null,!0)},removeData:function(e){return this.each(function(){K.remove(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=J.get(e,t),n&&(!r||Array.isArray(n)?r=J.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),o=w._queueHooks(e,t),a=function(){w.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:w.Callbacks("once memory").add(function(){J.remove(e,[t+"queue",n])})})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]+)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"
","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&N(e,t)?w.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n-1)i&&i.push(o);else if(l=w.contains(o.ownerDocument,o),a=ye(f.appendChild(o),"script"),l&&ve(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}!function(){var e=r.createDocumentFragment().appendChild(r.createElement("div")),t=r.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),h.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="",h.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var be=r.documentElement,we=/^key/,Te=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ce=/^([^.]*)(?:\.(.+)|)/;function Ee(){return!0}function ke(){return!1}function Se(){try{return r.activeElement}catch(e){}}function De(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)De(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=ke;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return w().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=w.guid++)),e.each(function(){w.event.add(this,t,i,r,n)})}w.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.get(e);if(y){n.handler&&(n=(o=n).handler,i=o.selector),i&&w.find.matchesSelector(be,i),n.guid||(n.guid=w.guid++),(u=y.events)||(u=y.events={}),(a=y.handle)||(a=y.handle=function(t){return"undefined"!=typeof w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(M)||[""]).length;while(l--)d=g=(s=Ce.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=w.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=w.event.special[d]||{},c=w.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),w.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.hasData(e)&&J.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(M)||[""]).length;while(l--)if(s=Ce.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){f=w.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||w.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)w.event.remove(e,d+t[l],n,r,!0);w.isEmptyObject(u)&&J.remove(e,"handle events")}},dispatch:function(e){var t=w.event.fix(e),n,r,i,o,a,s,u=new Array(arguments.length),l=(J.get(this,"events")||{})[t.type]||[],c=w.event.special[t.type]||{};for(u[0]=t,n=1;n=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n-1:w.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,Ae=/\s*$/g;function Le(e,t){return N(e,"table")&&N(11!==t.nodeType?t:t.firstChild,"tr")?w(e).children("tbody")[0]||e:e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Pe(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(J.hasData(e)&&(o=J.access(e),a=J.set(t,o),l=o.events)){delete a.handle,a.events={};for(i in l)for(n=0,r=l[i].length;n1&&"string"==typeof y&&!h.checkClone&&je.test(y))return e.each(function(i){var o=e.eq(i);v&&(t[0]=y.call(this,i,o.html())),Re(o,t,n,r)});if(p&&(i=xe(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(u=(s=w.map(ye(i,"script"),He)).length;f")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=w.contains(e.ownerDocument,e);if(!(h.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(a=ye(s),r=0,i=(o=ye(e)).length;r0&&ve(a,!u&&ye(e,"script")),s},cleanData:function(e){for(var t,n,r,i=w.event.special,o=0;void 0!==(n=e[o]);o++)if(Y(n)){if(t=n[J.expando]){if(t.events)for(r in t.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,t.handle);n[J.expando]=void 0}n[K.expando]&&(n[K.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Ie(this,e,!0)},remove:function(e){return Ie(this,e)},text:function(e){return z(this,function(e){return void 0===e?w.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Le(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Le(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(w.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return w.clone(this,e,t)})},html:function(e){return z(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ae.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))),u}function et(e,t,n){var r=$e(e),i=Fe(e,t,r),o="border-box"===w.css(e,"boxSizing",!1,r),a=o;if(We.test(i)){if(!n)return i;i="auto"}return a=a&&(h.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===w.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(i=parseFloat(i)||0)+Ze(e,t,n||(o?"border":"content"),a,r,i)+"px"}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Fe(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=G(t),u=Xe.test(t),l=e.style;if(u||(t=Je(s)),a=w.cssHooks[t]||w.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"==(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=ue(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(w.cssNumber[s]?"":"px")),h.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=G(t);return Xe.test(t)||(t=Je(s)),(a=w.cssHooks[t]||w.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Fe(e,t,r)),"normal"===i&&t in Ve&&(i=Ve[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return!ze.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?et(e,t,r):se(e,Ue,function(){return et(e,t,r)})},set:function(e,n,r){var i,o=$e(e),a="border-box"===w.css(e,"boxSizing",!1,o),s=r&&Ze(e,t,r,a,o);return a&&h.scrollboxSize()===o.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Ze(e,t,"border",!1,o)-.5)),s&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),Ke(e,n,s)}}}),w.cssHooks.marginLeft=_e(h.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Fe(e,"marginLeft"))||e.getBoundingClientRect().left-se(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(w.cssHooks[e+t].set=Ke)}),w.fn.extend({css:function(e,t){return z(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=$e(e),i=t.length;a1)}});function tt(e,t,n,r,i){return new tt.prototype.init(e,t,n,r,i)}w.Tween=tt,tt.prototype={constructor:tt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=tt.propHooks[this.prop];return e&&e.get?e.get(this):tt.propHooks._default.get(this)},run:function(e){var t,n=tt.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):tt.propHooks._default.set(this),this}},tt.prototype.init.prototype=tt.prototype,tt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[w.cssProps[e.prop]]&&!w.cssHooks[e.prop]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},tt.propHooks.scrollTop=tt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=tt.prototype.init,w.fx.step={};var nt,rt,it=/^(?:toggle|show|hide)$/,ot=/queueHooks$/;function at(){rt&&(!1===r.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(at):e.setTimeout(at,w.fx.interval),w.fx.tick())}function st(){return e.setTimeout(function(){nt=void 0}),nt=Date.now()}function ut(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function lt(e,t,n){for(var r,i=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})}}),w.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?w.prop(e,t,n):(1===o&&w.isXMLDoc(e)||(i=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?dt:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=w.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!h.radioValue&&"radio"===t&&N(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(M);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),dt={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ht[t]||w.find.attr;ht[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ht[a],ht[a]=i,i=null!=n(e,t,r)?a:null,ht[a]=o),i}});var gt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;w.fn.extend({prop:function(e,t){return z(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[w.propFix[e]||e]})}}),w.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,i=w.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):gt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),h.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this});function vt(e){return(e.match(M)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function xt(e){return Array.isArray(e)?e:"string"==typeof e?e.match(M)||[]:[]}w.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).addClass(e.call(this,t,mt(this)))});if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])while(r.indexOf(" "+o+" ")>-1)r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(n){w(this).toggleClass(e.call(this,n,mt(this),t),t)}):this.each(function(){var t,i,o,a;if(r){i=0,o=w(this),a=xt(e);while(t=a[i++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else void 0!==e&&"boolean"!==n||((t=mt(this))&&J.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":J.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&(" "+vt(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var bt=/\r/g;w.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=g(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,w(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,function(e){return null==e?"":e+""})),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return(t=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(bt,""):null==n?"":n}}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:vt(w.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},h.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),h.focusin="onfocusin"in e;var wt=/^(?:focusinfocus|focusoutblur)$/,Tt=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(t,n,i,o){var a,s,u,l,c,p,d,h,v=[i||r],m=f.call(t,"type")?t.type:t,x=f.call(t,"namespace")?t.namespace.split("."):[];if(s=h=u=i=i||r,3!==i.nodeType&&8!==i.nodeType&&!wt.test(m+w.event.triggered)&&(m.indexOf(".")>-1&&(m=(x=m.split(".")).shift(),x.sort()),c=m.indexOf(":")<0&&"on"+m,t=t[w.expando]?t:new w.Event(m,"object"==typeof t&&t),t.isTrigger=o?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:w.makeArray(n,[t]),d=w.event.special[m]||{},o||!d.trigger||!1!==d.trigger.apply(i,n))){if(!o&&!d.noBubble&&!y(i)){for(l=d.delegateType||m,wt.test(l+m)||(s=s.parentNode);s;s=s.parentNode)v.push(s),u=s;u===(i.ownerDocument||r)&&v.push(u.defaultView||u.parentWindow||e)}a=0;while((s=v[a++])&&!t.isPropagationStopped())h=s,t.type=a>1?l:d.bindType||m,(p=(J.get(s,"events")||{})[t.type]&&J.get(s,"handle"))&&p.apply(s,n),(p=c&&s[c])&&p.apply&&Y(s)&&(t.result=p.apply(s,n),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(v.pop(),n)||!Y(i)||c&&g(i[m])&&!y(i)&&((u=i[c])&&(i[c]=null),w.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,Tt),i[m](),t.isPropagationStopped()&&h.removeEventListener(m,Tt),w.event.triggered=void 0,u&&(i[c]=u)),t.result}},simulate:function(e,t,n){var r=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(r,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each(function(){w.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}}),h.focusin||w.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){w.event.simulate(t,e.target,w.event.fix(e))};w.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=J.access(r,t);i||r.addEventListener(e,n,!0),J.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=J.access(r,t)-1;i?J.access(r,t,i):(r.removeEventListener(e,n,!0),J.remove(r,t))}}});var Ct=e.location,Et=Date.now(),kt=/\?/;w.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||w.error("Invalid XML: "+t),n};var St=/\[\]$/,Dt=/\r?\n/g,Nt=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;function jt(e,t,n,r){var i;if(Array.isArray(t))w.each(t,function(t,i){n||St.test(e)?r(e,i):jt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==x(t))r(e,t);else for(i in t)jt(e+"["+i+"]",t[i],n,r)}w.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,function(){i(this.name,this.value)});else for(n in e)jt(n,e[n],t,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&At.test(this.nodeName)&&!Nt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(Dt,"\r\n")}}):{name:t.name,value:n.replace(Dt,"\r\n")}}).get()}});var qt=/%20/g,Lt=/#.*$/,Ht=/([?&])_=[^&]*/,Ot=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Mt=/^(?:GET|HEAD)$/,Rt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Bt=r.createElement("a");Bt.href=Ct.href;function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(M)||[];if(g(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function _t(e,t,n,r){var i={},o=e===Wt;function a(s){var u;return i[s]=!0,w.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function zt(e,t){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&w.extend(!0,e,r),e}function Xt(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}function Ut(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:Pt.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,w.ajaxSettings),t):zt(w.ajaxSettings,e)},ajaxPrefilter:Ft(It),ajaxTransport:Ft(Wt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,p,d,h=w.ajaxSetup({},n),g=h.context||h,y=h.context&&(g.nodeType||g.jquery)?w(g):w.event,v=w.Deferred(),m=w.Callbacks("once memory"),x=h.statusCode||{},b={},T={},C="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s){s={};while(t=Ot.exec(a))s[t[1].toLowerCase()]=t[2]}t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=T[e.toLowerCase()]=T[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)E.always(e[E.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||C;return i&&i.abort(t),k(0,t),this}};if(v.promise(E),h.url=((t||h.url||Ct.href)+"").replace(Rt,Ct.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(M)||[""],null==h.crossDomain){l=r.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Bt.protocol+"//"+Bt.host!=l.protocol+"//"+l.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=w.param(h.data,h.traditional)),_t(It,h,n,E),c)return E;(f=w.event&&h.global)&&0==w.active++&&w.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Mt.test(h.type),o=h.url.replace(Lt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(qt,"+")):(d=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(kt.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(Ht,"$1"),d=(kt.test(o)?"&":"?")+"_="+Et+++d),h.url=o+d),h.ifModified&&(w.lastModified[o]&&E.setRequestHeader("If-Modified-Since",w.lastModified[o]),w.etag[o]&&E.setRequestHeader("If-None-Match",w.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&E.setRequestHeader("Content-Type",h.contentType),E.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+$t+"; q=0.01":""):h.accepts["*"]);for(p in h.headers)E.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(g,E,h)||c))return E.abort();if(C="abort",m.add(h.complete),E.done(h.success),E.fail(h.error),i=_t(Wt,h,n,E)){if(E.readyState=1,f&&y.trigger("ajaxSend",[E,h]),c)return E;h.async&&h.timeout>0&&(u=e.setTimeout(function(){E.abort("timeout")},h.timeout));try{c=!1,i.send(b,k)}catch(e){if(c)throw e;k(-1,e)}}else k(-1,"No Transport");function k(t,n,r,s){var l,p,d,b,T,C=n;c||(c=!0,u&&e.clearTimeout(u),i=void 0,a=s||"",E.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(b=Xt(h,E,r)),b=Ut(h,b,E,l),l?(h.ifModified&&((T=E.getResponseHeader("Last-Modified"))&&(w.lastModified[o]=T),(T=E.getResponseHeader("etag"))&&(w.etag[o]=T)),204===t||"HEAD"===h.type?C="nocontent":304===t?C="notmodified":(C=b.state,p=b.data,l=!(d=b.error))):(d=C,!t&&C||(C="error",t<0&&(t=0))),E.status=t,E.statusText=(n||C)+"",l?v.resolveWith(g,[p,C,E]):v.rejectWith(g,[E,C,d]),E.statusCode(x),x=void 0,f&&y.trigger(l?"ajaxSuccess":"ajaxError",[E,h,l?p:d]),m.fireWith(g,[E,C]),f&&(y.trigger("ajaxComplete",[E,h]),--w.active||w.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],function(e,t){w[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:i,data:n,success:r},w.isPlainObject(e)&&e))}}),w._evalUrl=function(e){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=w(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g(e)?this.each(function(t){w(this).wrapInner(e.call(this,t))}):this.each(function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){w(this).replaceWith(this.childNodes)}),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Vt={0:200,1223:204},Gt=w.ajaxSettings.xhr();h.cors=!!Gt&&"withCredentials"in Gt,h.ajax=Gt=!!Gt,w.ajaxTransport(function(t){var n,r;if(h.cors||Gt&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Vt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),w.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),w.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(i,o){t=w(" + + + + + + diff --git a/public/hikvision/webVideoCtrl.js b/public/hikvision/webVideoCtrl.js new file mode 100644 index 00000000..b6ba601d --- /dev/null +++ b/public/hikvision/webVideoCtrl.js @@ -0,0 +1 @@ +!function(){if(!window.WebVideoCtrl){var e=function(){var e="100%",n="100%",r="";oSecurityCap={},szAESKey="";var s={szversion:"websdk3.220200429",szContainerID:"",szColorProperty:"",szOcxClassId:"clsid:FDF0038A-CF64-4634-81AB-80F0A7946D6C",szMimeTypes:"application/webvideo-plugin-kit",szBasePath:"",iWndowType:1,iPlayMode:2,bWndFull:!0,iPackageType:2,bDebugMode:!1,bNoPlugin:!0,cbSelWnd:null,cbDoubleClickWnd:null,cbEvent:null,cbRemoteConfig:null,cbInitPluginComplete:null,proxyAddress:null},o=null,i=0,a=!1,c=[],u=[],l=null,d=null,p=null,f=this,I=null;this.w_options=s,this.w_deviceSet=c,this.w_wndSet=u,this.w_xmlLocalCfg=I;var h="IPCamera",P="IPDome",m="IPZoom";window.GetSelectWndInfo=function(e){if(q()){i=e;var t=[];t.push(""),t.push(""+e+""),t.push(""),s.cbSelWnd&&s.cbSelWnd(p.loadXML(t.join("")))}},window.WindowDblClick=function(e){a=e,s.cbDoubleClickWnd&&s.cbDoubleClickWnd(i,a)},window.ZoomInfoCallback=function(e){var t=f.findWndIndexByIndex(i);if(-1!=t){var n=u[t];if(-1!=(t=f.findDeviceIndexByIP(n.szDeviceIdentify))){var r=c[t];r.oProtocolInc.set3DZoom(r,n,e,{success:function(e){},error:function(){}})}}},window.PluginEventHandler=function(e,t,n){q()&&s.cbEvent&&s.cbEvent(e,t,n)},window.GetHttpInfo=function(e,t,n){X.prototype.processCallback(e,t)},window.RemoteConfigInfo=function(e){s.cbRemoteConfig&&s.cbRemoteConfig(e)},window.KeyBoardEventInfo=function(e){100===parseInt(e,10)&&(a=!1,s.cbDoubleClickWnd&&s.cbDoubleClickWnd(i,a))};var g=function(){if(s.bDebugMode){var e=v(arguments);l._alert(e)}},v=function(){for(var e=arguments[0],t=1;t-1?e.substring(0,t):e},y=function(e){return void 0===e},C=function(e){return"[object Object]"===Object.prototype.toString.call(e)},x=function(e,t){var n="",r={type:"GET",async:!1,success:function(e){e&&e.Token&&(n=e.Token.value)}};return f.I_SendHTTPRequest(t,"ISAPI/Security/token?format=json",r),e.oAuthType[e.szIP]&&parseInt(e.oAuthType[e.szIP],10)>=2?n:""},b=function(e,n,r){f.I_GetSecurityVersion(e,{success:function(e){oSecurityCap.iKeyIterateNum=parseInt(t.$XML(e).find("keyIterateNum").eq(0).text(),10),oSecurityCap.oIrreversibleEncrypt={bSupport:"true"===t.$XML(e).find("isIrreversible").eq(0).text(),salt:t.$XML(e).find("salt").eq(0).text()},szAESKey=p.strToAESKey(n,r)}})},D=function(e){f.I_GetDeviceInfo(e.szIP,{success:function(n){e.szDeviceType=t.$XML(n).find("deviceType").eq(0).text()}}),f.I_GetAnalogChannelInfo(e.szIP,{success:function(e){},error:function(){}}),f.I_GetAudioInfo(e.szIP,{success:function(n){var r=t.$XML(n).find("audioCompressionType",!0);if(r.length>0){var s=t.$XML(r).eq(0).text(),o=0;"G.711ulaw"==s?o=1:"G.711alaw"==s?o=2:"G.726"==s?o=3:"MP2L2"==s||"MPEL2"==s?o=4:"G.722.1"==s?o=0:"AAC"==s?o=5:"PCM"==s&&(o=6),e.iAudioType=o}""!==t.$XML(n).find("audioBitRate").eq(0).text()?e.m_iAudioBitRate=1e3*parseInt(t.$XML(n).find("audioBitRate").eq(0).text(),10):e.m_iAudioBitRate=0,""!==t.$XML(n).find("audioSamplingRate").eq(0).text()?e.m_iAudioSamplingRate=1e3*parseInt(t.$XML(n).find("audioSamplingRate").eq(0).text(),10):e.m_iAudioSamplingRate=0}})},T=function(e){e.bSupportWebsocket=!1,e.bSupportSubStreamPlayback=!1,e.oProtocolInc.getSystemCapa(e,{success:function(n){var r=t.$XML(n).find("NetworkCap").eq(0).find("isSupportWebsocket",!0);r.length>0&&(e.bSupportWebsocket="true"===t.$XML(n).find("NetworkCap").eq(0).find("isSupportWebsocket").eq(0).text()),e.bSupportWebsocket=!0,(r=t.$XML(n).find("RacmCap").eq(0).find("isSupportMainAndSubRecord",!0)).length>0&&(e.bSupportSubStreamPlayback="true"===t.$XML(n).find("RacmCap").eq(0).find("isSupportMainAndSubRecord").eq(0).text()),e.bSupportSubStreamPlayback=!0}})},z=function(e){var n=-1,r=-1,s=-1,o=-1,i=-1;return e.oProtocolInc.getPortInfo(e,{async:!1,success:function(e){var a=t.$XML(e).find("AdminAccessProtocol",!0);n=554;for(var c=0,u=a.length;c0||t.$XML(e).find("ipv6Address",!0).length>0},error:function(){n=!1}}),n},L=function(e){e.oProtocolInc instanceof _&&e.oProtocolInc.getSDKCapa(e,{async:!1,success:function(n){e.oStreamCapa.bObtained=!0,e.oStreamCapa.bSupportShttpPlay="true"===t.$XML(n).find("isSupportHttpPlay").eq(0).text(),e.oStreamCapa.bSupportShttpPlayback="true"===t.$XML(n).find("isSupportHttpPlayback").eq(0).text(),e.oStreamCapa.bSupportShttpsPlay="true"===t.$XML(n).find("isSupportHttpsPlay").eq(0).text(),e.oStreamCapa.bSupportShttpsPlayback="true"===t.$XML(n).find("isSupportHttpsPlayback").eq(0).text(),e.oStreamCapa.bSupportShttpPlaybackTransCode="true"===t.$XML(n).find("isSupportHttpTransCodePlayback").eq(0).text(),e.oStreamCapa.bSupportShttpsPlaybackTransCode="true"===t.$XML(n).find("isSupportHttpsTransCodePlayback").eq(0).text(),t.$XML(n).find("ipChanBase",!0).length>0?e.oStreamCapa.iIpChanBase=parseInt(t.$XML(n).find("ipChanBase").eq(0).text(),10):e.oStreamCapa.iIpChanBase=1},error:function(){e.oStreamCapa.bObtained=!0}})},q=function(){if(s.bNoPlugin){var e=p.browser();return!!(e.chrome&&parseInt(e.version,10)>90||e.mozilla&&parseInt(e.version,10)>90||e.safari&&parseInt(e.version,10)>=14)}return!1},M=function(e){var t=location.hostname,n=location.port;return"http:"==location.protocol?n=n||"80":"https:"==location.protocol&&(n=n||"443"),s.proxyAddress&&(t=s.proxyAddress.ip,n=s.proxyAddress.port),/^(http|https):\/\/([^\/]+)(.+)$/.test(e)&&(e=e.replace(RegExp.$2,t+":"+n)),p.cookie("webVideoCtrlProxy",RegExp.$2,{raw:!0}),e},k=function(e){p.cookie("webVideoCtrlProxyWss",null),p.cookie("webVideoCtrlProxyWs",null);var t=location.hostname,n=location.port;return/^(ws):\/\/([^\/:]+):(\d+)\/(.+)$/.test(e)?(n=location.port||"80",e=e.replace(RegExp.$2+":"+RegExp.$3,t+":"+n)):/^(wss):\/\/([^\/:]+):(\d+)\/(.+)$/.test(e)&&(n=location.port||"443",e=e.replace(RegExp.$2+":"+RegExp.$3,t+":"+n)),e.indexOf("wss")>-1?p.cookie("webVideoCtrlProxyWss",RegExp.$2+":"+RegExp.$3,{raw:!0}):p.cookie("webVideoCtrlProxyWs",RegExp.$2+":"+RegExp.$3,{raw:!0}),p.cookie("webVideoCtrlProxyWsChannel",RegExp.$4,{raw:!0}),e+"/webSocketVideoCtrlProxy"},G=function(){return p.loadXML("4Invalid OperationnotSupport")};function W(){if(void 0!==W.unique)return W.unique;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.iWSPort=-1,this.iAudioType=1,this.m_iAudioBitRate=-1,this.m_iAudioSamplingRate=-1,this.iDeviceProtocol=1,this.oProtocolInc=null,this.iAnalogChannelNum=0,this.szDeviceType="",this.bVoiceTalk=!1,this.oAuthType={},this.oStreamCapa={bObtained:!1,bSupportShttpPlay:!1,bSupportShttpPlayback:!1,bSupportShttpsPlay:!1,bSupportShttpsPlayback:!1,bSupportShttpPlaybackTransCode:!1,bSupportShttpsPlaybackTransCode:!1,iIpChanBase:1},W.unique=this}this.I_SupportNoPlugin=function(){return q()},this.I_DestroyWorker=function(){null!==o&&q()&&o.JS_DestroyWorker()},this.I_Resize=function(t,r){null!==o&&q()&&(e=t,n=r,o.JS_Resize(t,r))},this.I_InitPlugin=function(t,r,i){if(e=t,n=r,p.extend(s,i),q()){var c=p.getDirName();c&&("object"==typeof exports&&"undefined"!=typeof module||("function"==typeof define&&define.amd?require([c+"/jsPlugin/jsPlugin-3.0.0.min"],(function(e){window.JSPlugin=e.JSPlugin,i.cbInitPluginComplete&&i.cbInitPluginComplete()})):p.loadScript(c+"/jsPlugin/jsPlugin-3.0.0.min.js",(function(){i.cbInitPluginComplete&&i.cbInitPluginComplete()})))),window.addEventListener("resize",(function(){if(null!==o&&q()){var e=$("#"+s.szContainerID);o.JS_Resize(e.width(),e.height())}})),y(document.fullScreen)?y(document.webkitIsFullScreen)?y(document.mozFullScreen)||document.addEventListener("mozfullscreenchange",(function(e){var t=document.fullscreen||document.webkitIsFullScreen||document.mozFullScreen||!1;a&&!t&&window.KeyBoardEventInfo(100)})):document.addEventListener("webkitfullscreenchange",(function(e){var t=document.fullscreen||document.webkitIsFullScreen||document.mozFullScreen||!1;a&&!t&&window.KeyBoardEventInfo(100)})):document.addEventListener("fullscreenchange",(function(e){var t=document.fullscreen||document.webkitIsFullScreen||document.mozFullScreen||!1;a&&!t&&window.KeyBoardEventInfo(100)})),window.addEventListener("unload",(function(){null!==o&&o.JS_DestroyWorker()}))}},this.I_InsertOBJECTPlugin=function(t){if(y(t)||(s.szContainerID=t),null==document.getElementById(s.szContainerID))return-1;if(null!=document.getElementById(r)||0!=document.getElementsByName(r).length)return-1;var i=document.getElementById(t);if(e=i.offsetWidth,n=i.offsetHeight,q()){var a={szId:t,iType:1,iWidth:e,iHeight:n,iMaxSplit:4,iCurrentSplit:s.iWndowType,szBasePath:p.getDirName()+"/jsPlugin"},c=s.szColorProperty;if(""!=c){for(var u={},l=c.split(";"),d="",f=0,h=l.length;f-1?u.background="#"+d.split(":")[1]:d.indexOf("sub-border-select")>-1?u.borderSelect="#"+d.split(":")[1]:d.indexOf("sub-border")>-1&&(u.border="#"+d.split(":")[1]);a.oStyle=u}(o=new JSPlugin(a)).JS_SetWindowControlCallback({onGetSelectWndInfo:window.GetSelectWndInfo,pluginErrorHandler:function(e,t,n){console.log(e,t,n),s.cbPluginErrorHandler(e,t,n)},performanceLack:function(){s.cbPerformanceLack()},secretKeyError:function(e){s.cbSecretKeyError(e)}})}return null==o&&null==o.object?-1:("object"==typeof window.attachEvent&&p.browser().msie&&(o.attachEvent("GetSelectWndInfo",GetSelectWndInfo),o.attachEvent("ZoomInfoCallback",ZoomInfoCallback),o.attachEvent("GetHttpInfo",GetHttpInfo),o.attachEvent("PluginEventHandler",PluginEventHandler),o.attachEvent("RemoteConfigInfo",RemoteConfigInfo),o.attachEvent("KeyBoardEventInfo",KeyBoardEventInfo)),function(){if(!q()&&null!==o){var e=o.HWP_GetLocalConfig();I=p.loadXML(e)}}(),0)},this.I2_OpenFileDlg=function(e){return new Promise((function(t){let n=window.document.createElement("input");n.type="file",n.addEventListener("change",(function(){let r="";1===e&&(r=n.value),t({szFileName:r,file:n.files[0]})}));let r=document.createEvent("MouseEvents");r.initEvent("click",!0,!0),n.dispatchEvent(r)}))},this.getAuthType=function(e,n,r,s,o,i){e.oAuthType[n]=1;var a={async:!0,success:function(r){e.oAuthType[n]=t.$XML(r).find("sessionIDVersion").eq(0).text(),i()},error:function(t){t>500&&(e.oAuthType[n]=t),i(t)}};d.getSessionCap(n,r,s,o,a)},this.setDeviceInfo=function(e,t,n,r,s){return(t=new W).szIP=n,2==r?(t.szHttpProtocol="https://",t.iHttpsPort=s):(t.szHttpProtocol="http://",t.iHttpPort=s),t.iCGIPort=s,t.szDeviceIdentify=n+"_"+s,t.iDeviceProtocol=1,t.oProtocolInc=e,t},this.successV1cb=function(e,n,r,s,o,i,a,u){(n=this.setDeviceInfo(e,n,r,s,o)).szAuth=t.$XML(i).find("sessionID").eq(0).text(),D(n),g("使用%s协议登录成功",1),n.sessionFailed=0,c.push(n),T(n),b(n.szDeviceIdentify,a,u),n.sesstionTimer=setInterval((function(){e.sessionHeartbeat(n,(function(){n.sessionFailed=0}),(function(){n.sessionFailed++,n.sessionFailed>=5&&(window.PluginEventHandler(null,-1,n.szDeviceIdentify),clearInterval(n.sesstionTimer))}))}),3e4)},this.successV2cb=function(e,n,r,s,o,i,a,u){(n=this.setDeviceInfo(e,n,r,s,o)).szAuth=x(n,n.szDeviceIdentify);let l=t.$XML(i).find("sessionTag").eq(0).text();l&&(n.sessionTag=l),D(n),g("使用%s协议登录成功",1),n.sessionFailed=0,c.push(n),T(n),b(n.szDeviceIdentify,a,u),n.sesstionTimer=setInterval((function(){e.sessionHeartbeat(n,(function(){n.sessionFailed=0}),(function(){n.sessionFailed++,n.sessionFailed>=5&&(window.PluginEventHandler(null,-1,n.szDeviceIdentify),clearInterval(n.sesstionTimer))}))}),3e4)},this.I_LoginV1=function(e,t,n,r,s,o,i,a){var c=this,u={success:null,error:null};return p.extend(u,{success:function(u){var l={success:null,error:null};p.extend(l,{success:function(u){a.success&&(a.success(u),c.successV1cb(e,t,n,r,s,u,i,o))},error:function(e,t){a.error&&a.error(e,t)}}),e.sessionLogin(n,r,s,o,i,u,l)},error:function(e,t){a.error&&a.error(e,t)}}),u},this.I_LoginV2=function(e,t,n,r,s,o,i,a,c){var u={success:null,error:null},l=this;return p.extend(u,{success:function(u){var d={success:null,error:null};p.extend(d,{success:function(e){l.successV2cb(t,n,r,s,o,e,a,i),c.success&&c.success(e)},error:function(e,t){c.error&&c.error(e,t)}}),t.sessionV2Login(e,r,s,o,i,a,u,d)},error:function(e,t){c.error&&c.error(e,t)}}),u},this.I_Login=function(e,t,n,r,s,o){var i=e+"_"+n;if(-1!=this.findDeviceIndexByIP(i))return g("设备已经登录过"),-1;var a=d,c=1;if(y(o.cgi)||1==o.cgi&&(a=d,c=1),q())if(1==c){var u=new W;this.getAuthType(u,e,t,n,r,(function(){var i=u.oAuthType[e];if(i>2){var c=MD5((new Date).getTime().toString()).substring(0,8);c=parseInt(c.replace("#",""),16).toString().substring(0,8);var l=this.I_LoginV2(c,a,u,e,t,n,r,s,o);a.getSessionV2Cap(c,e,t,n,r,l)}else if(i<2){l=this.I_LoginV1(a,u,e,t,n,r,s,o);a.getSessionCap(e,t,n,r,l)}else{c=MD5((new Date).getTime().toString()).substring(0,8);c=parseInt(c.replace("#",""),16).toString().substring(0,8);l=this.I_LoginV2(c,a,u,e,t,n,r,s,o);a.getSessionV2Cap(c,e,t,n,r,l)}}))}else o.error&&o.error(403,G())},this.I_Logout=function(e){var t=this.findDeviceIndexByIP(e);if(-1!=t){if(q()){var n=c[t];clearInterval(n.sesstionTimer),n.oProtocolInc.sessionLogout(n,{})}return c.splice(t,1),0}return-1},this.I_GetAudioInfo=function(e,t){var n=this.findDeviceIndexByIP(e);if(-1!=n){var r=c[n],s={success:null,error:null};p.extend(s,t),r.oProtocolInc.getAudioInfo(r,s)}},this.I_GetDeviceInfo=function(e,t){var n=this.findDeviceIndexByIP(e);if(-1!=n){var r=c[n],s={success:null,error:null};p.extend(s,t),r.oProtocolInc.getDeviceInfo(r,s)}},this.I_GetAnalogChannelInfo=function(e,t){var n=this.findDeviceIndexByIP(e);if(-1!=n){var r=c[n],s={success:null,error:null};p.extend(s,t),r.oProtocolInc.getAnalogChannelInfo(r,s)}},this.I_GetSecurityVersion=function(e,t){var n=this.findDeviceIndexByIP(e);if(-1!=n){var r=c[n],s={success:null,error:null};p.extend(s,t),r.oProtocolInc.getSecurityVersion(r,s)}},this.I_GetDigitalChannelInfo=function(e,t){var n=this.findDeviceIndexByIP(e);if(-1!=n){var r=c[n],s={success:null,error:null};p.extend(s,t),r.oProtocolInc.getDigitalChannelInfo(r,s)}},this.I_GetZeroChannelInfo=function(e,t){var n=this.findDeviceIndexByIP(e);if(-1!=n){var r=c[n],s={success:null,error:null};p.extend(s,t),r.oProtocolInc.getZeroChannelInfo(r,s)}},this.getStream=function(e,t,n){var r=$.Deferred();return q()&&o.JS_Play(e,t,n).then((function(){addToWndSet(),r.resolve()}),(function(){r.reject()})),r},this.I_StartRealPlay=function(e,t){var n=this.findDeviceIndexByIP(e),r="",s="",o=-1,a=0,l=0,d=!1,f={iWndIndex:i,iStreamType:1,iChannelID:1,bZeroChannel:!1};if(p.extend(f,t),-1!=n){L(c[n]);var I=c[n];if(q()){if(!I.bSupportWebsocket)return void(t.error&&t.error(403,G()));r=I.oProtocolInc.CGI.startWsRealPlay;var h=location.protocol;/^(https)(.*)$/.test(h)?(s="wss://",o=I.iWebSocketsPort):(s="ws://",o=I.iWebSocketPort),y(f.iWSPort)||(o=f.iWSPort),l=f.iStreamType,a=f.iChannelID<=I.iAnalogChannelNum?f.iChannelID:I.oStreamCapa.iIpChanBase+parseInt(f.iChannelID,10)-I.iAnalogChannelNum-1,d=!0}if(-1==o)return g("获取端口号失败"),void(t.error&&t.error());p.extend(f,{urlProtocol:s,cgi:r,iPort:o,iStreamType:l,iChannelID:a}),n=this.findWndIndexByIndex(f.iWndIndex);var P=this;-1==n&&I.oProtocolInc.startRealPlay(I,f).then((function(){n=P.findWndIndexByIndex(f.iWndIndex),u[n].bShttpIPChannel=d,t.success&&t.success()}),(function(){q()||(I.iRtspPort=-1),t.error&&t.error()}))}else t.error&&t.error()},this.I_GetWndSet=function(e){return JSON.parse(JSON.stringify(u))},this.I_Stop=function(e){var t;t=0===e.iIndex?{iWndIndex:0}:{iWndIndex:e.iIndex||i},C(e)?p.extend(t,e):y(e)||(t.iWndIndex=e);var n=this.findWndIndexByIndex(t.iWndIndex);if(-1!=n){var r=u[n];r.bRecord&&q(),r.bSound&&q(),r.bEZoom&&q(),q()&&o.JS_Stop(t.iWndIndex).then((function(){u.splice(n,1),t.success&&t.success()}),(function(){t.error&&t.error()}))}else t.error&&t.error()},this.I_StopAll=function(){return u=[],o.JS_StopRealPlayAll()},this.I_OpenSound=function(e){return new Promise(((t,n)=>{e=y(e)?i:e,-1!=this.findWndIndexByIndex(e)?o.JS_OpenSound(e).then((()=>{t()})).catch((e=>{n(e)})):n()}))},this.I_CloseSound=function(e){return new Promise(((t,n)=>{e=y(e)?i:e;var r=this.findWndIndexByIndex(e);if(-1!=r){var s=u[r];o.JS_CloseSound(e).then((()=>{s.bSound=!1,t()})).catch((e=>{n(e)}))}else n()}))},this.I_SetVolume=function(e,t){var n=Promise.reject();return e=parseInt(e,10),isNaN(e)||e<0||e>100?n:(t=y(t)?i:t,-1!=this.findWndIndexByIndex(t)?n=o.JS_SetVolume(t,e):n)},this.I2_CapturePic=function(e,t){var n={iWndIndex:i,bDateDir:!0};C(t)?p.extend(n,t):y(t)||(n.iWndIndex=t);var r=this.findWndIndexByIndex(n.iWndIndex),s=$.Deferred();if(-1!=r){if(q()){var a="JPEG";".jpg"===e.slice(-4).toLowerCase()?e=e.slice(0,-4):".jpeg"===e.slice(-5).toLowerCase()?e=e.slice(0,-5):".bmp"===e.slice(-4).toLowerCase()&&(e=e.slice(0,-4),a="BMP"),o.JS_CapturePicture(n.iWndIndex,e,a,n.cbCallback).then((function(){s.resolve()}),(function(){s.reject()}))}}else s.reject();return s},this.I_StartRecord=function(e,t){var n={iWndIndex:i,bDateDir:!0};C(t)?p.extend(n,t):y(t)||(n.iWndIndex=t);var r=this.findWndIndexByIndex(n.iWndIndex);if(-1!=r){var s=u[r];if(s.bRecord)n.error&&n.error();else if(q())p.browser().chrome?o.JS_StartSave(n.iWndIndex,e).then((function(){s.bRecord=!0,n.success&&n.success()}),(function(){n.error&&n.error()})):n.error&&n.error()}else n.error&&n.error()},this.I_StopRecord=function(e){var t={iWndIndex:i};C(e)?p.extend(t,e):y(e)||(t.iWndIndex=e);var n=this.findWndIndexByIndex(t.iWndIndex);if(-1!=n){var r=u[n];if(r.bRecord){if(q())p.browser().chrome?o.JS_StopSave(t.iWndIndex).then((function(){r.bRecord=!1,t.success&&t.success()}),(function(){t.error&&t.error()})):t.error&&t.error()}else t.error&&t.error()}else t.error&&t.error()},this.I_PTZControl=function(e,t,n){var r={iWndIndex:i,iPTZIndex:e,iPTZSpeed:4};p.extend(r,n),p.extend(r,{async:!1});var s=this.findWndIndexByIndex(r.iWndIndex);if(-1!=s){var o=u[s];if(-1!=(s=this.findDeviceIndexByIP(o.szIP))){var a=c[s];9==e?a.oProtocolInc.ptzAutoControl(a,t,o,r):a.oProtocolInc.ptzControl(a,t,o,r)}}},this.I_EnableEZoom=function(e){return new Promise(((t,n)=>{e=y(e)?i:e;var r=this.findWndIndexByIndex(e);if(-1!=r){var s=u[r];s.bEZoom?n():q()&&o.JS_EnableZoom(e).then((e=>{s.bEZoom=!0,t()})).catch((()=>{n()}))}else n()}))},this.I_DisableEZoom=function(e){return new Promise(((t,n)=>{e=y(e)?i:e;var r=this.findWndIndexByIndex(e);if(-1!=r){var s=u[r];s.bEZoom?q()&&o.JS_DisableZoom(e).then((e=>{s.bEZoom=!1,t()})).catch((()=>{n()})):n()}else n()}))},this.I_Enable3DZoom=function(e,t){e=y(e)?i:e;var n=this.findWndIndexByIndex(e);if(-1!=n){var r=u[n];if(!r.b3DZoom)return o.JS_Enable3DZoom(e,(function(e){window.ZoomInfoCallback(e),t&&t(e)})).then((()=>{r.b3DZoom=!0}))}return Promise.reject()},this.I_Disable3DZoom=function(e){e=y(e)?i:e;var t=this.findWndIndexByIndex(e),n=-1;if(-1!=t){var r=u[t];r.b3DZoom&&(q()&&(o.JS_Disable3DZoom(e),n=0),0==n&&(r.b3DZoom=!1))}return n},this.I_FullScreen=function(e){return o.JS_FullScreenDisplay(!0)},this.I_SetPreset=function(e,t){var n={iWndIndex:i,iPresetID:e};p.extend(n,t);var r=this.findWndIndexByIndex(n.iWndIndex);if(-1!=r){var s=u[r];if(-1!=(r=this.findDeviceIndexByIP(s.szIP))){var o=c[r];o.oProtocolInc.setPreset(o,s,n)}}},this.I_GoPreset=function(e,t){var n={iWndIndex:i,iPresetID:e};p.extend(n,t);var r=this.findWndIndexByIndex(n.iWndIndex);if(-1!=r){var s=u[r];if(-1!=(r=this.findDeviceIndexByIP(s.szIP))){var o=c[r];o.oProtocolInc.goPreset(o,s,n)}}},this.I_RecordSearch=function(e,t,n,r,s){var o=this.findDeviceIndexByIP(e);if(-1!=o){var i=c[o],a={iChannelID:t,szStartTime:n,szEndTime:r,iSearchPos:0,iStreamType:1,success:null,error:null};p.extend(a,s),i.oProtocolInc.recordSearch(i,a)}},this.I_StartPlayback=function(e,t){var n=this.findDeviceIndexByIP(e),r="",s="",o=-1,a=1,u=0,l=p.dateFormat(new Date,"yyyy-MM-dd"),d={iWndIndex:i,iStreamType:1,iChannelID:1,szStartTime:l+" 00:00:00",szEndTime:l+" 23:59:59"};if(p.extend(d,t),-1!=n){L(c[n]);var f=c[n];if(q()){if(!f.bSupportWebsocket)return void(t.error&&t.error(403,G()));if(!y(d.oTransCodeParam))return void(t.error&&t.error());r=f.oProtocolInc.CGI.startWsPlayback;var I=location.protocol;/^(https)(.*)$/.test(I)?(s="wss://",o=f.iWebSocketsPort):(s="ws://",o=f.iWebSocketPort),y(d.iWSPort)||(o=d.iWSPort),u=d.iStreamType,a=100*(a=d.iChannelID<=f.iAnalogChannelNum?d.iChannelID:f.oStreamCapa.iIpChanBase+parseInt(d.iChannelID,10)-f.iAnalogChannelNum-1)+u}if(-1==o)return g("获取端口号失败"),void(t.error&&t.error());p.extend(d,{urlProtocol:s,cgi:r,iPort:o,iChannelID:a}),-1==(n=this.findWndIndexByIndex(d.iWndIndex))&&q()&&(d.szStartTime=d.szStartTime.replace(" ","T")+"Z",d.szEndTime=d.szEndTime.replace(" ","T")+"Z",f.oProtocolInc.startPlayback(f,d).then((function(){t.success&&t.success()}),(function(){t.error&&(d.szStartTime=d.szStartTime.replace(" ","T").replace(/-|:/g,"")+"Z",d.szEndTime=d.szEndTime.replace(" ","T").replace(/-|:/g,"")+"Z",f.oProtocolInc.startPlayback(f,d).then((function(){f.timeTypeChange=!0,t.success&&t.success()}),(function(){t.error&&t.error()})))})))}else t.error&&t.error()},this.I_Pause=function(e){var t={iWndIndex:i};C(e)?p.extend(t,e):y(e)||(t.iWndIndex=e);var n=this.findWndIndexByIndex(t.iWndIndex);if(-1!=n){var r=u[n],s=r.iPlayStatus,a=-1;if(2==s)a=3;else{if(5!=s)return void(t.error&&t.error());a=6}q()&&o.JS_Pause(t.iWndIndex).then((function(){r.iPlayStatus=a,t.success&&t.success()}),(function(){t.error&&t.error()}))}else t.error&&t.error()},this.I_Resume=function(e){var t={iWndIndex:i};C(e)?p.extend(t,e):y(e)||(t.iWndIndex=e);var n=this.findWndIndexByIndex(t.iWndIndex);if(-1!=n){var r=u[n],s=r.iPlayStatus,a=-1;if(3==s||4==s)a=2;else{if(6!=s)return void(t.error&&t.error());a=5}q()&&o.JS_Resume(t.iWndIndex).then((function(){r.iPlayStatus=a,t.success&&t.success()}),(function(){t.error&&t.error()}))}else t.error&&t.error()},this.I_PlaySlow=function(e){var t={iWndIndex:i};C(e)?p.extend(t,e):y(e)||(t.iWndIndex=e);var n=this.findWndIndexByIndex(t.iWndIndex);-1!=n?2==u[n].iPlayStatus?o.JS_Slow(t.iWndIndex).then((function(){t.success&&t.success()}),(function(){t.error&&t.error()})):t.error&&t.error():t.error&&t.error()},this.I_PlayFast=function(e){var t={iWndIndex:i};C(e)?p.extend(t,e):y(e)||(t.iWndIndex=e);var n=this.findWndIndexByIndex(t.iWndIndex);-1!=n?2==u[n].iPlayStatus?o.JS_Fast(t.iWndIndex).then((function(){t.success&&t.success()}),(function(){t.error&&t.error()})):t.error&&t.error():t.error&&t.error()},this.I_GetOSDTime=function(e){var t={iWndIndex:i};C(e)?p.extend(t,e):y(e)||(t.iWndIndex=e),-1!=this.findWndIndexByIndex(t.iWndIndex)?q()&&o.JS_GetOSDTime(t.iWndIndex).then((function(e){if(t.success){var n=p.dateFormat(new Date(1e3*e),"yyyy-MM-dd hh:mm:ss");t.success(n)}}),(function(){t.error&&t.error()})):t.error&&t.error()},this.I_StartDownloadRecord=function(e,t,n,r){return new Promise(((s,o)=>{var i=this.findDeviceIndexByIP(e);if(-1!=i){var a=c[i],u={szPlaybackURI:t,szFileName:n,bDateDir:!0};y(r)||p.extend(u,r),a.oProtocolInc.startDownloadRecord(a,u).then((e=>{s(e)})).catch((e=>{o(e)}))}}))},this.I_StartDownloadRecordByTime=function(e,t,n,r,s,o){return new Promise(((i,a)=>{var u=this.findDeviceIndexByIP(e);if(-1!=u){var l=c[u],d={szPlaybackURI:t=t.split("?")[0]+"?starttime="+r.replace(" ","T")+"Z&endtime="+s.replace(" ","T")+"Z",szFileName:n,bDateDir:!0};y(o)||p.extend(d,o),l.oProtocolInc.startDownloadRecord(l,d).then((e=>{i(e)})).catch((e=>{a(e)}))}}))},this.I_ExportDeviceConfig=function(e,t){var n=this.findDeviceIndexByIP(e);if(-1!=n){var r=c[n];return r.oProtocolInc.exportDeviceConfig(r,t)}return Promise.reject()},this.I_ImportDeviceConfig=function(e,t,n,r){return new Promise(((s,o)=>{var i=this.findDeviceIndexByIP(e);if(-1!=i){var a=c[i],u={szFileName:t,file:r};a.oProtocolInc.importDeviceConfig(a,u,n).then((()=>{s()})).catch((()=>{o()}))}else o()}))},this.I_RestoreDefault=function(e,t,n){var r={success:null,error:null};p.extend(r,n);var s=this.findDeviceIndexByIP(e);if(-1!=s){var o=c[s];o.oProtocolInc.restore(o,t,r)}},this.I_Restart=function(e,t){var n=this.findDeviceIndexByIP(e),r={success:null,error:null};if(p.extend(r,t),-1!=n){var s=c[n];s.oProtocolInc.restart(s,r)}},this.I_Reconnect=function(e,t){var n=this.findDeviceIndexByIP(e),r={success:null,error:null};if(p.extend(r,t),-1!=n){var s=c[n];s.oProtocolInc.login(s.szIP,s.iCGIPort,s.szAuth,r,s)}},this.I2_StartUpgrade=function(e,t,n){var r=this.findDeviceIndexByIP(e);if(-1!=r){var s=c[r],o={szFileName:t,UpgradeFile:n};return s.oProtocolInc.asyncstartUpgrade(s,o)}return Promise.reject()},this.I_UpgradeProgress=function(e){var t=this.findDeviceIndexByIP(e),n="";if(-1!=t){var r=c[t];n=v("%s%s:%s/ISAPI/System/upgradeStatus",r.szHttpProtocol,r.szIP,r.iCGIPort),n=M(n)}return new Promise(((e,t)=>{var s=new XMLHttpRequest;p.cookie("updatePlugin",!1,{raw:!0}),s.onreadystatechange=function(){if(4===s.readyState)if(200===s.status){let t="true"===$(p.parseXmlFromStr(s.responseText)).find("upgrading").text(),n=parseInt($(p.parseXmlFromStr(s.responseText)).find("percent").text(),10);e({upgrading:t,percent:n})}else t()},s.open("get",n,!1),r.sessionTag&&s.setRequestHeader("SessionTag",r.sessionTag),s.send(null)}))},this.I_CheckPluginVersion=function(){return q()?0:o.HWP_CheckPluginUpdate("3,0,6,23,0,6,27,3,3,611,1,3,62,5,2,81,0,5,59")?-1:0},this.I_SendHTTPRequest=function(e,t,n){var r=this.findDeviceIndexByIP(e);if(!(r<0)){var s=c[r],o=new X,i={type:"GET",url:s.szHttpProtocol+s.szIP+":"+s.iCGIPort+"/"+t,auth:s.szAuth,success:null,error:null};p.extend(i,n),p.extend(i,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),o.setRequestParam(i),o.submitRequest()}},this.I_ChangeWndNum=function(e){return isNaN(parseInt(e,10))?Promise.reject():o.JS_ArrangeWindow(e)},this.I_GetWindowStatus=function(e){if(y(e)){var t=[];return p.extend(t,u),t}var n=this.findWndIndexByIndex(e);if(-1!=n){t={};return p.extend(t,u[n]),t}return null},this.I_DeviceCapturePic=function(e,t,n,r){var s=this.findDeviceIndexByIP(e),o=-1;if(-1!=s){var i=c[s],a={bDateDir:!0};if(p.extend(a,r),!y(a.iResolutionWidth)&&!p.isInt(a.iResolutionWidth))return o;if(!y(a.iResolutionHeight)&&!p.isInt(a.iResolutionHeight))return o;o=i.oProtocolInc.deviceCapturePic(i,t,n,a)}return o},this.I_GetDevicePort=function(e){var t=this.findDeviceIndexByIP(e),n=null;if(-1!=t){var r=c[t];n=function(e){var t=null;if(A(e))(t=z(e)).iRtspPort,t.iDevicePort;else{for(var n=R(e),r=!1,s=0;s-1){for(var t=0,n=c.length;t-1){for(var t=0,n=c.length;te.match(/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/)?.[0]||null)(this.options.url));-1!==o&&(r=c[o])}catch(e){}var i=M(this.options.url),a=new window.XMLHttpRequest;a.open(this.options.type,i,this.options.async);if(s.proxyAddress){a.withCredentials=!0;var u=(e=this.options.url,/^(http|https):\/\/([^\/]+)(.+)$/.test(e)?RegExp.$2:"");a.setRequestHeader("deviceIdentify",u)}a.setRequestHeader("X-Requested-With","XMLHttpRequest"),a.setRequestHeader("If-Modified-Since","0"),r.sessionTag&&a.setRequestHeader("SessionTag",r.sessionTag),a.send(this.options.data||null);var l=function(){if(4===a.readyState){t={funSuccessCallback:n.options.success,funErrorCallback:n.options.error};var e=a.status+a.responseText;0===a.status&&(e=""),n.httpDataAnalyse(t,e)}};this.options.async?(a.timeout=this.options.timeout,a.onreadystatechange=function(){l()}):l()}},X.prototype.getHttpMethod=function(e){var t={GET:1,POST:2,PUT:5,DELETE:6}[e];return t||-1},X.prototype.processCallback=function(e,t){for(var n=null,r=0;r-1||this.options&&this.options.url.indexOf("?format=json")>-1?e.funSuccessCallback(JSON.parse(n)):e.funSuccessCallback(p.loadXML(n)):e.funErrorCallback&&e.funErrorCallback(r,p.loadXML(n)))};var _=function(){};_.prototype.CGI={login:"%s%s:%s/ISAPI/Security/userCheck",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"},getStreamDynChannels:"%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/DynStreaming/channels",startRealPlay:{channels:"%s%s:%s/PSIA/streaming/channels/%s",zeroChannels:"%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/ZeroStreaming/channels/%s"},startShttpRealPlay:{channels:"%s%s:%s/SDK/play/%s/004",zeroChannels:"%s%s:%s/SDK/play/100/004/ZeroStreaming"},startWsRealPlay:{channels:"%s%s:%s/%s",zeroChannels:"%s%s:%s/%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:{ipdome:"%s%s:%s/ISAPI/PTZCtrl/channels/%s/presets/%s/goto",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/Image/channels/%s/focus",digital:"%s%s:%s/ISAPI/ContentMgmt/ImageProxy/channels/%s/focus",ipc:"%s%s:%s/ISAPI/System/Video/inputs/channels/%s/focus"},ptzIris:{analog:"%s%s:%s/ISAPI/Image/channels/%s/iris",digital:"%s%s:%s/ISAPI/ContentMgmt/ImageProxy/channels/%s/iris",ipc:"%s%s:%s/ISAPI/System/Video/inputs/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:"%s%s:%s/PSIA/streaming/tracks/%s?starttime=%s&endtime=%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"},_.prototype.login=function(e,t,n,r,s){r.protocol;var o=v(this.CGI.login,s.szHttpProtocol,e,t),i=new X,a={type:"GET",url:o,auth:n,success:null,error:null};p.extend(a,r),p.extend(a,{success:function(e){r.success&&r.success(e)},error:function(e,t){r.error&&r.error(e,t)}}),i.setRequestParam(a),i.submitRequest()},_.prototype.getAudioInfo=function(e,t){var n=v(this.CGI.getAudioInfo,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new X,s={type:"GET",url:n,auth:e.szAuth,success:null,error:null};p.extend(s,t),p.extend(s,{success:function(e){t.success&&t.success(e)},error:function(e,n){t.error&&t.error(e,n)}}),r.setRequestParam(s),r.submitRequest()},_.prototype.getSecurityVersion=function(e,t){var n=v(this.CGI.getSecurityVersion,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new X,s={type:"GET",url:n,auth:e.szAuth,success:null,error:null};p.extend(s,t),p.extend(s,{success:function(e){t.success&&t.success(e)},error:function(e,n){t.error&&t.error(e,n)}}),r.setRequestParam(s),r.submitRequest()},_.prototype.getDeviceInfo=function(e,n){var r=v(this.CGI.getDeviceInfo,e.szHttpProtocol,e.szIP,e.iCGIPort),s=new X,o={type:"GET",url:r,auth:e.szAuth,success:null,error:null};p.extend(o,n),p.extend(o,{success:function(e){var r=[];r.push(""),r.push(""+p.escape(t.$XML(e).find("deviceName").eq(0).text())+""),r.push(""+t.$XML(e).find("deviceID").eq(0).text()+""),r.push(""+t.$XML(e).find("deviceType").eq(0).text()+""),r.push(""+t.$XML(e).find("model").eq(0).text()+""),r.push(""+t.$XML(e).find("serialNumber").eq(0).text()+""),r.push(""+t.$XML(e).find("macAddress").eq(0).text()+""),r.push(""+t.$XML(e).find("firmwareVersion").eq(0).text()+""),r.push(""+t.$XML(e).find("firmwareReleasedDate").eq(0).text()+""),r.push(""+t.$XML(e).find("encoderVersion").eq(0).text()+""),r.push(""+t.$XML(e).find("encoderReleasedDate").eq(0).text()+""),r.push(""),e=p.loadXML(r.join("")),n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),s.setRequestParam(o),s.submitRequest()},_.prototype.getAnalogChannelInfo=function(e,n){var r=v(this.CGI.getAnalogChannelInfo,e.szHttpProtocol,e.szIP,e.iCGIPort),s=new X,o={type:"GET",url:r,auth:e.szAuth,success:null,error:null};p.extend(o,n),p.extend(o,{success:function(r){var s=[];s.push("");var o=t.$XML(r).find("VideoInputChannel",!0);e.iAnalogChannelNum=o.length;for(var i=0,a=o.length;i"),s.push(""+t.$XML(c).find("id").eq(0).text()+""),s.push(""+t.$XML(c).find("inputPort").eq(0).text()+""),s.push(""+p.escape(t.$XML(c).find("name").eq(0).text())+""),s.push(""+t.$XML(c).find("videoFormat").eq(0).text()+""),s.push("")}s.push(""),r=p.loadXML(s.join("")),n.success&&n.success(r)},error:function(t,r){e.iAnalogChannelNum=0,n.error&&n.error(t,r)}}),s.setRequestParam(o),s.submitRequest()},_.prototype.getDigitalChannel=function(e,n){var r=v(this.CGI.getDigitalChannel,e.szHttpProtocol,e.szIP,e.iCGIPort),s=new X,o={type:"GET",url:r,auth:e.szAuth,success:null,error:null};p.extend(o,n),p.extend(o,{success:function(e){var r=[];r.push("");for(var s=t.$XML(e).find("InputProxyChannel",!0),o=0,i=s.length;o"),r.push(""+t.$XML(a).find("id").eq(0).text()+""),r.push(""+p.escape(t.$XML(a).find("name").eq(0).text())+""),r.push("")}r.push(""),e=p.loadXML(r.join("")),n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),s.setRequestParam(o),s.submitRequest()},_.prototype.getDigitalChannelInfo=function(e,n){var r=null,s={};if(this.getDigitalChannel(e,{async:!1,success:function(e){r=e;for(var n=t.$XML(r).find("InputProxyChannel",!0),o=0,i=n.length;o");for(var o=t.$XML(e).find("InputProxyChannelStatus",!0),i=0,a=o.length;i"),r.push(""+u+""),r.push(""),r.push(""+t.$XML(c).find("proxyProtocol").eq(0).text()+""),r.push(""+t.$XML(c).find("addressingFormatType").eq(0).text()+""),r.push(""+t.$XML(c).find("ipAddress").eq(0).text()+""),r.push(""+t.$XML(c).find("managePortNo").eq(0).text()+""),r.push(""+t.$XML(c).find("srcInputPort").eq(0).text()+""),r.push(""+p.escape(t.$XML(c).find("userName").eq(0).text())+""),r.push(""+t.$XML(c).find("streamType").eq(0).text()+""),r.push(""+t.$XML(c).find("online").eq(0).text()+""),r.push(""+p.escape(s[u])+""),r.push(""),r.push("")}r.push(""),e=p.loadXML(r.join("")),n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),i.setRequestParam(a),i.submitRequest()}},_.prototype.getZeroChannelInfo=function(e,t){var n=v(this.CGI.getZeroChannelInfo,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new X,s={type:"GET",url:n,auth:e.szAuth,success:null,error:null};p.extend(s,t),p.extend(s,{success:function(e){t.success&&t.success(e)},error:function(e,n){t.error&&t.error(e,n)}}),r.setRequestParam(s),r.submitRequest()},_.prototype.getStreamChannels=function(e,t){if(0!=e.iAnalogChannelNum)var n=v(this.CGI.getStreamChannels.analog,e.szHttpProtocol,e.szIP,e.iCGIPort);else n=v(this.CGI.getStreamChannels.digital,e.szHttpProtocol,e.szIP,e.iCGIPort);var r=new X,s={type:"GET",url:n,auth:e.szAuth,success:null,error:null};p.extend(s,t),p.extend(s,{success:function(e){t.success&&t.success(e)},error:function(e,n){t.error&&t.error(e,n)}}),r.setRequestParam(s),r.submitRequest()},_.prototype.getPPPoEStatus=function(e,t){var n=v(this.CGI.getPPPoEStatus,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new X,s={type:"GET",url:n,auth:e.szAuth,success:null,error:null};p.extend(s,t),p.extend(s,{success:function(e){t.success&&t.success(e)},error:function(e,n){t.error&&t.error(e,n)}}),r.setRequestParam(s),r.submitRequest()},_.prototype.getUPnPPortStatus=function(e,t){var n=v(this.CGI.getUPnPPortStatus,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new X,s={type:"GET",url:n,auth:e.szAuth,success:null,error:null};p.extend(s,t),p.extend(s,{success:function(e){t.success&&t.success(e)},error:function(e,n){t.error&&t.error(e,n)}}),r.setRequestParam(s),r.submitRequest()},_.prototype.getNetworkBond=function(e,t){var n=v(this.CGI.getNetworkBond,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new X,s={type:"GET",url:n,auth:e.szAuth,success:null,error:null};p.extend(s,t),p.extend(s,{success:function(e){t.success&&t.success(e)},error:function(e,n){t.error&&t.error(e,n)}}),r.setRequestParam(s),r.submitRequest()},_.prototype.getNetworkInterface=function(e,t){var n=v(this.CGI.getNetworkInterface,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new X,s={type:"GET",url:n,auth:e.szAuth,success:null,error:null};p.extend(s,t),p.extend(s,{success:function(e){t.success&&t.success(e)},error:function(e,n){t.error&&t.error(e,n)}}),r.setRequestParam(s),r.submitRequest()},_.prototype.getPortInfo=function(e,t){var n=v(this.CGI.getPortInfo,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new X,s={type:"GET",url:n,auth:e.szAuth,success:null,error:null};p.extend(s,t),p.extend(s,{success:function(e){t.success&&t.success(e)},error:function(e,n){t.error&&t.error(e,n)}}),r.setRequestParam(s),r.submitRequest()},_.prototype.startRealPlay=function(e,t){var n=100*t.iChannelID+t.iStreamType,r="",i=t.bProxy,a=e.szIP;if("rtsp://"===t.urlProtocol&&(a=S(a)),t.bZeroChannel?(q()&&(n=0),r=v(t.cgi.zeroChannels,t.urlProtocol,a,t.iPort,n)):r=v(t.cgi.channels,t.urlProtocol,a,t.iPort,n),s.proxyAddress&&q()){p.cookie("webVideoCtrlProxy",a+":"+t.iPort,{raw:!0}),r=v(t.cgi.zeroChannels,t.urlProtocol,s.proxyAddress.ip,s.proxyAddress.port,n);var c=a+":"+t.iPort;r.indexOf("?")>-1?r+="&deviceIdentify="+c:r+="?deviceIdentify="+c}var l=$.Deferred();if(q()){var d={sessionID:e.szAuth,token:x(e,e.szDeviceIdentify)};i&&(r=k(r)),o.JS_Play(r,d,t.iWndIndex).then((function(){var n;(n=new E).iIndex=t.iWndIndex,n.szIP=e.szIP,n.iCGIPort=e.iCGIPort,n.szDeviceIdentify=e.szDeviceIdentify,n.iChannelID=t.iChannelID,n.iPlayStatus=1,u.push(n),l.resolve()}),(function(){l.reject()}))}return l},_.prototype.startVoiceTalk=function(e,t){var n=v(this.CGI.startVoiceTalk.open,e.szHttpProtocol,e.szIP,e.iCGIPort,t),r=v(this.CGI.startVoiceTalk.close,e.szHttpProtocol,e.szIP,e.iCGIPort,t),s=v(this.CGI.startVoiceTalk.audioData,e.szHttpProtocol,e.szIP,e.iCGIPort,t);return o.HWP_StartVoiceTalkEx(n,r,s,e.szAuth,e.iAudioType,e.m_iAudioBitRate,e.m_iAudioSamplingRate)},_.prototype.ptzAutoControl=function(e,t,n,r){var s=n.iChannelID,o="",i="";if(r.iPTZSpeed=r.iPTZSpeed<7?15*r.iPTZSpeed:100,t&&(r.iPTZSpeed=0),e.szDeviceType!=P)o=s<=e.iAnalogChannelNum?v(this.CGI.ptzAutoControl.analog,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID):n.bShttpIPChannel?v(this.CGI.ptzAutoControl.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID-e.oStreamCapa.iIpChanBase+1+e.iAnalogChannelNum):v(this.CGI.ptzAutoControl.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID),i=""+r.iPTZSpeed+"";else{0===r.iPTZSpeed&&(t=!0);var a=99;t&&(a=96),o=v(this.CGI.ptzAutoControl.ipdome,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID,a)}var c=new X,u={type:"PUT",url:o,async:!1,auth:e.szAuth,data:i,success:null,error:null},l=this;p.extend(u,r),p.extend(u,{success:function(e){n.bPTZAuto=!n.bPTZAuto,r.success&&r.success(e)},error:function(t,s){if(h==e.szDeviceType||m==e.szDeviceType){o=n.bShttpIPChannel?v(l.CGI.ptzControl.analog,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID-e.oStreamCapa.iIpChanBase+1+e.iAnalogChannelNum):v(l.CGI.ptzControl.analog,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID),i=""+r.iPTZSpeed+"0";var a=new X,c={type:"PUT",url:o,async:!1,auth:e.szAuth,data:i,success:null,error:null};p.extend(c,r),a.setRequestParam(c),a.submitRequest()}else r.error&&r.error(t,s)}}),c.setRequestParam(u),c.submitRequest()},_.prototype.ptzControl=function(e,t,n,r){var s=n.iChannelID,o="";n.bPTZAuto&&this.ptzAutoControl(e,!0,n,{iPTZSpeed:0}),r.iPTZSpeed=t?0:r.iPTZSpeed<7?15*r.iPTZSpeed:100;var i=[{},{pan:0,tilt:r.iPTZSpeed},{pan:0,tilt:-r.iPTZSpeed},{pan:-r.iPTZSpeed,tilt:0},{pan:r.iPTZSpeed,tilt:0},{pan:-r.iPTZSpeed,tilt:r.iPTZSpeed},{pan:-r.iPTZSpeed,tilt:-r.iPTZSpeed},{pan:r.iPTZSpeed,tilt:r.iPTZSpeed},{pan:r.iPTZSpeed,tilt:-r.iPTZSpeed},{},{speed:r.iPTZSpeed},{speed:-r.iPTZSpeed},{speed:r.iPTZSpeed},{speed:-r.iPTZSpeed},{speed:r.iPTZSpeed},{speed:-r.iPTZSpeed}],a="",c={};switch(r.iPTZIndex){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:c=this.CGI.ptzControl,a=""+i[r.iPTZIndex].pan+""+i[r.iPTZIndex].tilt+"";break;case 10:case 11:c=this.CGI.ptzControl,a=""+i[r.iPTZIndex].speed+"";break;case 12:case 13:c=this.CGI.ptzFocus,a=""+i[r.iPTZIndex].speed+"";break;case 14:case 15:c=this.CGI.ptzIris,a=""+i[r.iPTZIndex].speed+"";break;default:return void(r.error&&r.error())}o=c!=this.CGI.ptzFocus&&c!=this.CGI.ptzIris||e.szDeviceType!=h&&e.szDeviceType!=P&&e.szDeviceType!=m?s<=e.iAnalogChannelNum?v(c.analog,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID):n.bShttpIPChannel?v(c.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID-e.oStreamCapa.iIpChanBase+1+e.iAnalogChannelNum):v(c.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID):v(c.ipc,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID);var u=new X,l={type:"PUT",url:o,async:!1,auth:e.szAuth,data:a,success:null,error:null};p.extend(l,r),p.extend(l,{success:function(e){r.success&&r.success(e)},error:function(e,t){r.error&&r.error(e,t)}}),u.setRequestParam(l),u.submitRequest()},_.prototype.setPreset=function(e,t,n){var r="",s="";r=t.iChannelID<=e.iAnalogChannelNum?v(this.CGI.setPreset.analog,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID,n.iPresetID):t.bShttpIPChannel?v(this.CGI.setPreset.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID-e.oStreamCapa.iIpChanBase+1+e.iAnalogChannelNum,n.iPresetID):v(this.CGI.setPreset.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID,n.iPresetID),s="",s+="",s+=""+n.iPresetID+"",e.szDeviceType!=P&&(s+="Preset"+n.iPresetID+""),s+="";var o=new X,i={type:"PUT",url:r,auth:e.szAuth,data:s,success:null,error:null};p.extend(i,n),p.extend(i,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),o.setRequestParam(i),o.submitRequest()},_.prototype.goPreset=function(e,t,n){var r="";r=t.iChannelID<=e.iAnalogChannelNum?v(this.CGI.goPreset.analog,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID,n.iPresetID):t.bShttpIPChannel?v(this.CGI.goPreset.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID-e.oStreamCapa.iIpChanBase+1+e.iAnalogChannelNum,n.iPresetID):v(this.CGI.goPreset.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID,n.iPresetID);var s=new X,o={type:"PUT",url:r,auth:e.szAuth,success:null,error:null};p.extend(o,n),p.extend(o,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),s.setRequestParam(o),s.submitRequest()},_.prototype.overlayInfo=function(){return szUrl=this.CGI.overlayInfo.analog,szUrl},_.prototype.recordSearch=function(e,n){var r,s,o=n.iChannelID,i=n.iStreamType,a=n.szStartTime.replace(" ","T")+"Z",c=n.szEndTime.replace(" ","T")+"Z";r=v(this.CGI.recordSearch,e.szHttpProtocol,e.szIP,e.iCGIPort),s=""+new F+""+(100*o+i)+""+a+""+c+"40"+n.iSearchPos+"//metadata.ISAPI.org/VideoMotion";var u=new X,l={type:"POST",url:r,auth:e.szAuth,data:s,success:null,error:null};p.extend(l,n),p.extend(l,{success:function(e){var r=[];r.push(""),r.push(""+t.$XML(e).find("responseStatus").eq(0).text()+""),r.push(""+t.$XML(e).find("responseStatusStrg").eq(0).text()+""),r.push(""+t.$XML(e).find("numOfMatches").eq(0).text()+""),r.push("");for(var s=t.$XML(e).find("searchMatchItem",!0),o=0,i=s.length;o"),r.push(""+t.$XML(a).find("trackID").eq(0).text()+""),r.push(""+t.$XML(a).find("startTime").eq(0).text()+""),r.push(""+t.$XML(a).find("endTime").eq(0).text()+""),r.push(""+p.escape(t.$XML(a).find("playbackURI").eq(0).text())+""),r.push(""+t.$XML(a).find("metadataDescriptor").eq(0).text().split("/")[1]+""),r.push("")}r.push(""),r.push(""),e=p.loadXML(r.join("")),n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),u.setRequestParam(l),u.submitRequest()},_.prototype.startPlayback=function(e,t){var n=t.iWndIndex,r="",i=t.szStartTime,a=t.szEndTime,c=t.bProxy,l=e.szIP;if("rtsp://"===t.urlProtocol&&(l=S(l)),q())if(s.proxyAddress){p.cookie("webVideoCtrlProxy",l+":"+t.iPort,{raw:!0}),r=v(t.cgi,t.urlProtocol,s.proxyAddress.ip,s.proxyAddress.port,t.iChannelID);var d=l+":"+t.iPort;r.indexOf("?")>-1?r+="&deviceIdentify="+d:r+="?deviceIdentify="+d}else r=v(t.cgi,t.urlProtocol,l,t.iPort,t.iChannelID,i,a);if(!y(t.oTransCodeParam)){var f=function(e){var t={TransFrameRate:"",TransResolution:"",TransBitrate:""};if(p.extend(t,e),""==t.TransFrameRate||""==t.TransResolution||""==t.TransBitrate)return"";var n=[];return n.push(""),n.push(""),n.push(""+t.TransFrameRate+""),n.push(""+t.TransResolution+""),n.push(""+t.TransBitrate+""),n.push(""),n.join("")}(t.oTransCodeParam);if(""==f)return-1;o.HWP_SetTrsPlayBackParam(n,f)}var I=$.Deferred();if(q()){var h={sessionID:e.szAuth,token:x(e,e.szDeviceIdentify)};c&&(r=k(r)),o.JS_Play(r,h,n,i,a).then((function(){var r;(r=new E).iIndex=n,r.szIP=e.szIP,r.iCGIPort=e.iCGIPort,r.szDeviceIdentify=e.szDeviceIdentify,r.iChannelID=t.iChannelID,r.iPlayStatus=2,u.push(r),I.resolve()}),(function(){I.reject()}))}return I},_.prototype.reversePlayback=function(e,t){var n=t.iWndIndex,r=t.szStartTime,s=t.szEndTime,i=e.szIP;"rtsp://"===t.urlProtocol&&(i=S(i));var a=v(t.cgi,t.urlProtocol,i,t.iPort,t.iChannelID,r,s),c=o.HWP_ReversePlay(a,e.szAuth,n,r,s);if(0==c){var l=new E;l.iIndex=n,l.szIP=e.szIP,l.iCGIPort=e.iCGIPort,l.szDeviceIdentify=e.szDeviceIdentify,l.iChannelID=t.iChannelID,l.iPlayStatus=5,u.push(l)}return c},_.prototype.startDownloadRecord=function(e,n){var r=v(this.CGI.startDownloadRecord,e.szHttpProtocol,e.szIP,e.iCGIPort),s=""+p.escape(n.szPlaybackURI)+"";return function(n,r,s,o){var i,a,c=t.$XML(p.parseXmlFromStr(o)).find("playbackURI").eq(0).text(),u=n+"?token="+x(e,e.szDeviceIdentify)+"&playbackURI="+c,l=".mp4";if(n.indexOf("picture/Streaming/tracks")>0&&(u=n,l=".jpg"),!s){var d=u.indexOf("&name=")+6,f=u.indexOf("&size=");s=u.substring(d,f),-1===f&&(s="file")}return i=u,a=s+l,new Promise(((t,n)=>{fetch(i,{headers:{Accept:"application/octet-stream",SessionTag:e.sessionTag}}).then((e=>{if(console.log("response",e),200===e.status)return e.blob();n()})).then((e=>{if(console.log("blob",e),!e)return void n();const r=document.createElement("a");r.href=URL.createObjectURL(e),r.download=a||"download",r.click(),URL.revokeObjectURL(r.href),t()}))}))}(r=M(r),e.szAuth,n.szFileName,s)},_.prototype.exportDeviceConfig=function(e,t){return new Promise(((n,r)=>{var s=v(this.CGI.downloaddeviceConfig,e.szHttpProtocol,e.szIP,e.iCGIPort);s=M(s),t&&(s=p.exportPasswordDeviceConfig(s,t)),p.nativeAjax({url:s,responseType:"blob",sessionTag:e.sessionTag,success:(e,t)=>{t("file"),n()},error:()=>{r()}})}))},_.prototype.importDeviceConfig=function(e,t,n){var r,s=v(this.CGI.uploaddeviceConfig,e.szHttpProtocol,e.szIP,e.iCGIPort);return s=M(s),n&&(s=p.exportPasswordDeviceConfig(s,n)),r=s,new Promise(((n,s)=>{var o=new XMLHttpRequest;o.onreadystatechange=function(){4===o.readyState&&(200===o.status?n():s())},o.open("put",r,!1),e.sessionTag&&o.setRequestHeader("SessionTag",e.sessionTag),o.send(t.file)}))},_.prototype.restart=function(e,t){var n=v(this.CGI.restart,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new X,s={type:"PUT",url:n,auth:e.szAuth,success:null,error:null};p.extend(s,t),p.extend(s,{success:function(e){t.success&&t.success(e)},error:function(e,n){t.error&&t.error(e,n)}}),r.setRequestParam(s),r.submitRequest()},_.prototype.restore=function(e,t,n){var r=v(this.CGI.restore,e.szHttpProtocol,e.szIP,e.iCGIPort,t),s=new X,o={type:"PUT",url:r,auth:e.szAuth,success:null,error:null};p.extend(o,n),p.extend(o,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),s.setRequestParam(o),s.submitRequest()},_.prototype.startUpgrade=function(e,t){$.Deferred();var n=v(this.CGI.startUpgrade.upgrade,e.szHttpProtocol,e.szIP,e.iCGIPort),r=v(this.CGI.startUpgrade.status,e.szHttpProtocol,e.szIP,e.iCGIPort);return szRet=o.HWP_StartUpgrade(n,r,e.szAuth,t.szFileName)},_.prototype.asyncstartUpgrade=function(e,t){var n=$.Deferred(),r=v(this.CGI.startUpgrade.upgrade,e.szHttpProtocol,e.szIP,e.iCGIPort),s=v(this.CGI.startUpgrade.status,e.szHttpProtocol,e.szIP,e.iCGIPort);if(q()){(function(n,r){return new Promise((function(s,o){n||o(),r||o();var i=new XMLHttpRequest;i.onreadystatechange=function(){if(4===i.readyState)if(200===i.status)s();else{var e=p.parseXmlFromStr(i.responseText);"lowPrivilege"===$(e).find("subStatusCode").text()?o(403):o()}},i.open("put",n,!0),e.sessionTag&&i.setRequestHeader("SessionTag",e.sessionTag),i.send(t.UpgradeFile)}))})(r=M(r)+"?token="+x(e,e.szDeviceIdentify),s=M(s)).then((function(e){n.resolve(e)}),(function(e){n.reject(e)}))}return n},_.prototype.set3DZoom=function(e,t,n,r){var s="";if(s=t.iChannelID<=e.iAnalogChannelNum?v(this.CGI.set3DZoom.analog,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID):t.bShttpIPChannel?v(this.CGI.set3DZoom.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID-e.oStreamCapa.iIpChanBase+1+e.iAnalogChannelNum):v(this.CGI.set3DZoom.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID),q()){const e=o.JS_GetWndContainer(t.iIndex).getBoundingClientRect(),r=e.width,s=e.height;console.log("窗口宽高:",r,s);p.loadXML(n);var i=parseInt(n.startPos[0]/r*255,10),a=parseInt(n.startPos[1]/s*255,10),c=parseInt(n.endPos[0]/r*255,10),u=parseInt(n.endPos[1]/s*255,10)}var l=""+i+""+(255-a)+""+c+""+(255-u)+"",d=new X,f={type:"PUT",url:s,data:l,auth:e.szAuth,success:null,error:null};p.extend(f,r),p.extend(f,{success:function(e){r.success&&r.success(e)},error:function(e,t){r.error&&r.error(e,t)}}),d.setRequestParam(f),d.submitRequest()},_.prototype.getSDKCapa=function(e,t){var n=v(this.CGI.SDKCapabilities,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new X,s={type:"GET",url:n,async:!1,auth:e.szAuth,success:null,error:null};p.extend(s,t),p.extend(s,{success:function(e){t.success&&t.success(e)},error:function(e,n){t.error&&t.error(e,n)}}),r.setRequestParam(s),r.submitRequest()},_.prototype.deviceCapturePic=function(e,t,n,r){t=100*t+1;var s=-1,o=v(this.CGI.deviceCapture.channels,e.szHttpProtocol,e.szIP,e.iCGIPort,t),i=[];if(p.isInt(r.iResolutionWidth)&&i.push("videoResolutionWidth="+r.iResolutionWidth),p.isInt(r.iResolutionHeight)&&i.push("videoResolutionHeight="+r.iResolutionHeight),i.length>0&&(o+="?"+i.join("&")),q()){s=function(e,t){return $("body").append('
  • '),$("#jsplugin_download_li").trigger("click"),$("#jsplugin_download_a").remove(),0}(o=M(o),n)}return s},_.prototype.getSessionV2Cap=function(e,t,n,r,s,o){var i="";i=2==n?"https://":"http://";var a=v(this.CGI.sessionCap,i,t,r,encodeURIComponent(s));a=a+"&random:"+e;var c=new X,u={type:"GET",url:a,auth:"",success:null,error:null};p.extend(u,o),p.extend(u,{success:function(e){o.success&&o.success(e)},error:function(e,t){o.error&&o.error(e,t)}}),c.setRequestParam(u),c.submitRequest()},_.prototype.getSessionCap=function(e,t,n,r,s){var o="";o=2==t?"https://":"http://";var i=v(this.CGI.sessionCap,o,e,n,encodeURIComponent(r)),a=new X,c={type:"GET",url:i,auth:"",success:null,error:null};p.extend(c,s),p.extend(c,{success:function(e){s.success&&s.success(e)},error:function(e,t){s.error&&s.error(e,t)}}),a.setRequestParam(c),a.submitRequest()},_.prototype.sessionV2Login=function(e,n,r,s,o,i,a,c){var u="";u=2==r?"https://":"http://";var l=parseInt(t.$XML(a).find("sessionIDVersion").eq(0).text(),10),d="true"===t.$XML(a).find("isSupportSessionTag").eq(0).text(),f="true"===t.$XML(a).find("isSessionIDValidLongTerm").eq(0).text(),I=v(this.CGI.sessionLogin,u,n,s)+"?timeStamp="+Date.now(),h=t.$XML(a).find("sessionID").eq(0).text(),P=t.$XML(a).find("challenge").eq(0).text(),m=parseInt(t.$XML(a).find("iterations").eq(0).text(),10),g=!1,S="";t.$XML(a).find("isIrreversible",!0).length>0&&(g="true"===t.$XML(a).find("isIrreversible").eq(0).text(),S=t.$XML(a).find("salt").eq(0).text()),this.m_oInfoForLocalPlgin={szRandom:e,sessionID:h,iterations:m,challenge:P,user:o};var y=p.encodePwd(i,{challenge:P,userName:o,salt:S,iIterate:m},g),C="";C+=""+p.escape(o)+"",C+=""+y+"",C+=""+h+"",C+=""+f+"",C+=""+l+"",C+=""+d+"",C+="";var x=new X,b={type:"POST",url:I,data:C,auth:"",success:null,error:null};p.extend(b,c),p.extend(b,{success:function(e){c.success&&c.success(e)},error:function(e,t){c.error&&c.error(e,t)}}),x.setRequestParam(b),x.submitRequest()},_.prototype.sessionLogin=function(e,n,r,s,o,i,a){var c="";c=2==n?"https://":"http://";var u=v(this.CGI.sessionLogin,c,e,r),l=t.$XML(i).find("sessionID").eq(0).text(),d=t.$XML(i).find("challenge").eq(0).text(),f=parseInt(t.$XML(i).find("iterations").eq(0).text(),10),I=!1,h="";t.$XML(i).find("isIrreversible",!0).length>0&&(I="true"===t.$XML(i).find("isIrreversible").eq(0).text(),h=t.$XML(i).find("salt").eq(0).text());var P="";if(I){P=p.sha256(s+h+o),P=p.sha256(P+d);for(m=2;m",g+=""+P+"",g+=""+l+"",g+="";var S=new X,y={type:"POST",url:u,data:g,auth:"",success:null,error:null};p.extend(y,a),p.extend(y,{success:function(e){a.success&&a.success(e)},error:function(e,t){a.error&&a.error(e,t)}}),S.setRequestParam(y),S.submitRequest()},_.prototype.sessionHeartbeat=function(e,t,n){var r=v(this.CGI.getDeviceInfo,e.szHttpProtocol,e.szIP,e.iCGIPort),s=new X,o={type:"GET",url:r,auth:e.szAuth,success:null,error:null};p.extend(o,{success:function(e){t&&t(e)},error:function(e,t){n&&n(e,t)}}),s.setRequestParam(o),s.submitRequest()},_.prototype.sessionLogout=function(e,t){var n=v(this.CGI.sessionLogout,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new X,s={type:"PUT",url:n,auth:e.szAuth,success:null,error:null};p.extend(s,t),p.extend(s,{success:function(e){t.success&&t.success(e)},error:function(e,n){t.error&&t.error(e,n)}}),r.setRequestParam(s),r.submitRequest()},_.prototype.getSystemCapa=function(e,t){var n=v(this.CGI.systemCapabilities,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new X,s={type:"GET",url:n,async:!1,auth:e.szAuth,success:null,error:null};p.extend(s,t),p.extend(s,{success:function(e){t.success&&t.success(e)},error:function(e,n){t.error&&t.error(e,n)}}),r.setRequestParam(s),r.submitRequest()};var B,H,Z=function(){};Z.prototype._alert=function(e){s.bDebugMode&&console.log(e)},B=this,(H=function(e){this.elems=[],this.length=0,this.length=this.elems.push(e)}).prototype.find=function(e,t){var n=this.elems[this.length-1]?this.elems[this.length-1].getElementsByTagName(e):[];return this.length=this.elems.push(n),t?n:this},H.prototype.eq=function(e,t){var n=this.elems[this.length-1].length,r=null;return n>0&&e0&&t[1].indexOf("trident")>-1&&(t[1]="msie");var n={};return n[t[1]]=!0,n.version=t[2],n},N.prototype.loadXML=function(e){if(null==e||""==e)return null;var t=null;window.DOMParser?t=(new DOMParser).parseFromString(e,"text/xml"):((t=new ActiveXObject("Microsoft.XMLDOM")).async=!1,t.loadXML(e));return t},N.prototype.toXMLStr=function(e){var t="";try{t=(new XMLSerializer).serializeToString(e)}catch(n){try{t=e.xml}catch(e){return""}}return-1==t.indexOf(""+t),t},N.prototype.escape=function(e){return e?e.replace(/&/g,"&").replace(//g,">"):e},N.prototype.encodePwd=function(e,t,n){var r="";if(n){r=p.sha256(t.userName+t.salt+e),r=p.sha256(r+t.challenge);for(s=2;s>2,o=(3&t)<<4|(n=e.charCodeAt(u++))>>4,i=(15&n)<<2|(r=e.charCodeAt(u++))>>6,a=63&r,isNaN(n)?i=a=64:isNaN(r)&&(a=64),c=c+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(i)+this._keyStr.charAt(a);return c},decode:function(e){var t,n,r,s,o,i,a="",c=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c>4,n=(15&s)<<4|(o=this._keyStr.indexOf(e.charAt(c++)))>>2,r=(3&o)<<6|(i=this._keyStr.indexOf(e.charAt(c++))),a+=String.fromCharCode(t),64!=o&&(a+=String.fromCharCode(n)),64!=i&&(a+=String.fromCharCode(r));return a=N.prototype.Base64._utf8_decode(a)},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",n=0;n127&&r<2048?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(63&r|128)):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(63&r|128))}return t},_utf8_decode:function(e){for(var t="",n=0,r=c1=c2=0;n191&&r<224?(c2=e.charCodeAt(n+1),t+=String.fromCharCode((31&r)<<6|63&c2),n+=2):(c2=e.charCodeAt(n+1),c3=e.charCodeAt(n+2),t+=String.fromCharCode((15&r)<<12|(63&c2)<<6|63&c3),n+=3);return t}},N.prototype.createEventScript=function(e,t,n){var r=document.createElement("script");r.htmlFor=e,r.event=t,r.innerHTML=n,document.body.parentNode.appendChild(r)},N.prototype.isInt=function(e){return/^\d+$/.test(e)},N.prototype.getDirName=function(){var e="";if(""!==s.szBasePath)e=s.szBasePath;else{var t=/[^?#]*\//,n=document.getElementById("videonode");if(n)e=n.src.match(t)[0];else{for(var r=document.scripts,o=0,i=r.length;o-1){n=r[o];break}n&&(e=n.src.match(t)[0])}}return e},N.prototype.loadScript=function(e,t){var n=document.createElement("script");n.type="text/javascript",n.onload=function(){t()},n.src=e,document.getElementsByTagName("head")[0].appendChild(n)},N.prototype.encodeString=function(e){return e?e.replace(/&/g,"&").replace(//g,">"):""},N.prototype.getIrreversibleKey=function(e,t){var n=e;if(oSecurityCap.oIrreversibleEncrypt.bSupport){var r=oSecurityCap.oIrreversibleEncrypt.salt;return p.sha256(t+r+e)}return n},N.prototype.strToAESKey=function(e,t){var n="";if(oSecurityCap.iKeyIterateNum>0){n=p.sha256(p.getIrreversibleKey(e,t)+"AaBbCcDd1234!@#$");for(var r=1;r0;)s+=o>16?aes_encrypt(e.substring(i,i+16),t,!0):aes_encrypt(e.substring(i),t,!0),o-=16,i+=16;else{void 0===n&&(n="6cd9616beb39d4034fdebe107df9a399");var a=CryptoJS.enc.Hex.parse(t),c=CryptoJS.enc.Hex.parse(n);s=CryptoJS.AES.encrypt(e,a,{mode:CryptoJS.mode.CBC,iv:c,padding:CryptoJS.pad.Pkcs7}).ciphertext.toString()}return s},N.prototype.sha256=function(e){function t(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function n(e,t){return e>>>t|e<<32-t}return e=function(e){e=e.replace(/\r\n/g,"\n");for(var t="",n=0;n127&&r<2048?t+=String.fromCharCode(r>>6|192):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128)),t+=String.fromCharCode(63&r|128))}return t}(e),function(e){for(var t="",n=0;n<4*e.length;n++)t+="0123456789abcdef".charAt(e[n>>2]>>8*(3-n%4)+4&15)+"0123456789abcdef".charAt(e[n>>2]>>8*(3-n%4)&15);return t}(function(e,r){var s,o,i,a,c,u,l,d,p,f,I,h,P=[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],m=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],g=Array(64);for(e[r>>5]|=128<<24-r%32,e[15+(r+64>>9<<4)]=r,p=0;p>>10,g[f-7]),n(g[f-15],7)^n(g[f-15],18)^g[f-15]>>>3),g[f-16]),I=t(t(t(t(d,n(c,6)^n(c,11)^n(c,25)),c&u^~c&l),P[f]),g[f]),h=t(n(s,2)^n(s,13)^n(s,22),s&o^s&i^o&i),d=l,l=u,u=c,c=t(a,I),a=i,i=o,o=s,s=t(I,h);m[0]=t(s,m[0]),m[1]=t(o,m[1]),m[2]=t(i,m[2]),m[3]=t(a,m[3]),m[4]=t(c,m[4]),m[5]=t(u,m[5]),m[6]=t(l,m[6]),m[7]=t(d,m[7])}return m}(function(e){for(var t=[],n=0;n<8*e.length;n+=8)t[n>>5]|=(255&e.charCodeAt(n/8))<<24-n%32;return t}(e),8*e.length))},N.prototype.cookie=function(e,t,n){if(arguments.length>1&&(null===t||"object"!=typeof t)){if(n=this.extend({},n),null===t&&(n.expires=-1),"number"==typeof n.expires){var r=n.expires,s=n.expires=new Date;s.setDate(s.getDate()+r)}return document.cookie=[encodeURIComponent(e),"=",n.raw?String(t):encodeURIComponent(String(t)),n.expires?"; expires="+n.expires.toUTCString():"",n.path?"; path="+n.path:"; path=/",n.domain?"; domain="+n.domain:"",n.secure?"; secure":""].join("")}var o,i=(n=t||{}).raw?function(e){return e}:decodeURIComponent;return(o=new RegExp("(?:^|; )"+encodeURIComponent(e)+"=([^;]*)").exec(document.cookie))?i(o[1]):null},N.prototype.nativeAjax=function(e){if(null===e||"object"!=typeof e)throw new Error("希望接收一个对象作为参数");if(!e.url)throw new Error("不合理的url");var t={type:"GET",async:!0,responseType:"json",timeout:6e4};for(var n in t)-1===Object.keys(e).indexOf(n)&&(e[n]=t[n]);var r=new XMLHttpRequest;r.open(e.type,e.url,e.async),r.timeout=e.timeout,e.ContentType&&r.setRequestHeader("Content-Type",e.ContentType),e.ContentLength&&r.setRequestHeader("Content-Length",e.ContentLength),e.sessionTag&&r.setRequestHeader("SessionTag",e.sessionTag),r.responseType=e.responseType,r.onload=function(){4===r.readyState&&(200===r.status?e.success(r.response,o,r):e.error(r.response,r))},r.error=function(){e.error(r.response,r)};var s=e.data||null;function o(e,t){if(t=t||r.response,window.navigator&&window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(t,e);else{var n=document.createElement("a");document.body.appendChild(n),n.style="display: none";let r=[];r.push(t);var s=window.URL.createObjectURL(new Blob(r,{type:"application/octet-stream"}));n.href=s,n.download=e,n.click(),n.remove?n.remove():document.body.removeChild(n),window.URL.revokeObjectURL(s)}}r.send(s)},F.prototype.valueOf=function(){return this.id},F.prototype.toString=function(){return this.id},F.prototype.createUUID=function(){var e=new Date(1582,10,15,0,0,0,0),t=(new Date).getTime()-e.getTime(),n="-";return F.getIntegerBits(t,0,31)+n+F.getIntegerBits(t,32,47)+n+(F.getIntegerBits(t,48,59)+"1")+n+F.getIntegerBits(F.rand(4095),0,7)+F.getIntegerBits(F.rand(4095),0,7)+n+(F.getIntegerBits(F.rand(8191),0,7)+F.getIntegerBits(F.rand(8191),8,15)+F.getIntegerBits(F.rand(8191),0,7)+F.getIntegerBits(F.rand(8191),8,15)+F.getIntegerBits(F.rand(8191),0,15))},F.getIntegerBits=function(e,t,n){var r=F.returnBase(e,16),s=new Array,o="",i=0;for(i=0;i=t)r=this.returnBase(s,t)+n[o];else r=n[s]+n[o]}return r},F.rand=function(e){return Math.floor(Math.random()*e)},d=new _,l=new Z;var V=(p=new N).dateFormat(new Date,"yyyyMMddhhmmss");return r="webVideoCtrl"+V,"object"!=typeof window.attachEvent&&p.browser().msie&&(p.createEventScript(r,"GetSelectWndInfo(SelectWndInfo)","GetSelectWndInfo(SelectWndInfo);"),p.createEventScript(r,"ZoomInfoCallback(szZoomInfo)","ZoomInfoCallback(szZoomInfo);"),p.createEventScript(r,"GetHttpInfo(lID, lpInfo, lReverse)","GetHttpInfo(lID, lpInfo, lReverse);"),p.createEventScript(r,"PluginEventHandler(iEventType, iParam1, iParam2)","PluginEventHandler(iEventType, iParam1, iParam2);"),p.createEventScript(r,"RemoteConfigInfo(lID)","RemoteConfigInfo(lID);"),p.createEventScript(r,"KeyBoardEventInfo(iKeyCode)","KeyBoardEventInfo(iKeyCode);")),this}(),t=window.WebVideoCtrl=e;t.version="1.1.0"}}(),"object"==typeof exports&&"undefined"!=typeof module||("function"==typeof define&&define.amd?define((function(){return WebVideoCtrl})):"function"==typeof define&&define.cmd&&define((function(e,t,n){n.exports=WebVideoCtrl}))); \ No newline at end of file diff --git a/src/api/camera/camera.ts b/src/api/camera/camera.ts index 646b5ba3..07d5f541 100644 --- a/src/api/camera/camera.ts +++ b/src/api/camera/camera.ts @@ -40,6 +40,11 @@ export function create(data: { server_id: number channel_id: number channel_name?: string + ip?: string + port?: number + model?: string + serial_number?: string + stream_type?: string custom_name?: string status?: number remark?: string @@ -63,6 +68,11 @@ export function update(data: { server_id?: number channel_id?: number channel_name?: string + ip?: string + port?: number + model?: string + serial_number?: string + stream_type?: string custom_name?: string status?: number remark?: string diff --git a/src/api/camera_server/localServerApi.ts b/src/api/camera_server/localServerApi.ts new file mode 100644 index 00000000..2b8b3744 --- /dev/null +++ b/src/api/camera_server/localServerApi.ts @@ -0,0 +1,118 @@ +/** + * 本地录像服务器 HTTP REST API 列表 + * + * 本机端口:17311 → 17312 → 17313 + * 所有请求直接发往 localhost,不经过主后端 /system 代理。 + * + * 使用方式: + * import { localServerApi } from '@/api/camera_server/localServerApi' + * const res = await localServerApi.getHikvisionChannels(baseUrl, params) + * + * 新增 API 时只需在此文件追加函数即可。 + */ + +import axios from 'axios' + +// ============================================================ +// 通用请求工具 +// ============================================================ + +/** 创建针对指定 baseUrl 的 axios 实例(每次调用按需创建,避免共享拦截器) */ +function createClient(baseUrl: string) { + return axios.create({ + baseURL: baseUrl, + timeout: 15000, + headers: { 'Content-Type': 'application/json' } + }) +} + +/** 对本地 API 做统一响应解包(兼容多种格式) */ +function unwrap(res: any): T { + const body = res?.data + if (!body || typeof body !== 'object') return body as T + + // 格式1: { success: true, channels: [...] } + if ('success' in body && body.success) { + return (body.channels !== undefined ? body.channels : body.data ?? body) as T + } + + // 格式2: { code, data, message } + if ('code' in body) { + if (body.code !== 0 && body.code !== 200) { + throw new Error(body.message || body.msg || `请求失败 (code=${body.code})`) + } + return (body.data !== undefined ? body.data : body) as T + } + + return body as T +} + +// ============================================================ +// API 列表(按模块分组,方便扩展) +// ============================================================ + +// ---------- 海康威视 ---------- + +/** 获取海康威视通道列表(通用请求,参数透传) */ +export async function getHikvisionChannels( + baseUrl: string, + params?: Record +) { + const client = createClient(baseUrl) + const res = await client.post('/api/hikvision/channels', params || {}) + return unwrap(res) +} + +// ---------- 连通测试 ---------- + +export interface CameraServerConnectionParams { + ip: string + port?: number + user: string + pass: string +} + +/** + * 测试录像服务器连通性 + * 向本地代理服务发送请求,由其转发到目标录像服务器 + */ +export async function testConnection( + baseUrl: string, + params: CameraServerConnectionParams +) { + const client = createClient(baseUrl) + const res = await client.post('/api/hikvision/channels', { + ip: params.ip, + port: params.port, + user: params.user, + pass: params.pass + }) + return unwrap(res) +} + +// ---------- MJPEG 实时流 ---------- + +const DEFAULT_PROXY_BASE = 'http://localhost:17311' + +/** + * 生成 MJPEG 实时流 URL + * 后端 GET /api/hikvision/live-stream 返回 multipart MJPEG 流 + * 前端直接用 渲染 + * + * @example + * getLiveStreamUrl({ ip: '192.168.8.241', user: 'admin', pass: 'ky666888', channel: 9, streamType: 1 }) + * // → http://localhost:17311/api/hikvision/live-stream?ip=192.168.8.241&user=admin&pass=ky666888&channel=9&streamType=1 + */ +export function getLiveStreamUrl(params: { + ip: string + user: string + pass: string + channel: number + streamType?: number +}): string { + const { ip, user, pass, channel, streamType = 1 } = params + return `${DEFAULT_PROXY_BASE}/api/hikvision/live-stream?ip=${encodeURIComponent(ip)}&user=${encodeURIComponent(user)}&pass=${encodeURIComponent(pass)}&channel=${channel}&streamType=${streamType}` +} + +// ---------- 后续在此追加其他 API ---------- +// export async function getSomeOtherApi(baseUrl: string, params?: any) { ... } diff --git a/src/stores/modules/localCameraServer.ts b/src/stores/modules/localCameraServer.ts new file mode 100644 index 00000000..2f62018c --- /dev/null +++ b/src/stores/modules/localCameraServer.ts @@ -0,0 +1,158 @@ +/** + * 本地录像服务器连接 Store + * + * 管理本机多端口 HTTP 服务连接状态与 API 调用。 + * 端口:17311(主)→ 17312 → 17313(备) + * + * 使用方式: + * import { useLocalCameraServerStore } from '@/stores/modules/localCameraServer' + * const store = useLocalCameraServerStore() + * const channels = await store.fetchHikvisionChannels({ ip: '192.168.1.100' }) + */ + +import { defineStore } from 'pinia' +import { ref, computed } from 'vue' +import * as localServerApi from '@/api/camera_server/localServerApi' + +/** 可用端口列表 */ +export const LOCAL_SERVER_PORTS = [17311, 17312, 17313] as const + +export type LocalServerPort = (typeof LOCAL_SERVER_PORTS)[number] + +interface LocalServerState { + /** 当前使用的端口 */ + currentPort: LocalServerPort + /** 各端口连接状态 */ + portStatus: Record + /** 最后一次错误信息 */ + lastError: string +} + +export const useLocalCameraServerStore = defineStore('localCameraServer', () => { + // ============================================================ + // State + // ============================================================ + + const currentPort = ref(17311) + const portStatus = ref>({ + 17311: 'idle', + 17312: 'idle', + 17313: 'idle' + }) + const lastError = ref('') + + // ============================================================ + // Getters + // ============================================================ + + /** 当前 baseUrl */ + const baseUrl = computed(() => `http://localhost:${currentPort.value}`) + + /** 当前端口是否已连接 */ + const isConnected = computed(() => portStatus.value[currentPort.value] === 'connected') + + /** 是否有任一端口已连接 */ + const hasAnyConnection = computed(() => + Object.values(portStatus.value).some((s) => s === 'connected') + ) + + /** 所有端口状态汇总(用于 UI 展示) */ + const portStatusList = computed(() => + LOCAL_SERVER_PORTS.map((port) => ({ + port, + status: portStatus.value[port], + isCurrent: port === currentPort.value + })) + ) + + // ============================================================ + // Actions — 连接管理 + // ============================================================ + + /** 切换到指定端口 */ + function setPort(port: LocalServerPort) { + currentPort.value = port + } + + /** 尝试按顺序连接端口(17311 → 17312 → 17313),返回第一个可用的 baseUrl */ + async function autoConnect(): Promise { + lastError.value = '' + + for (const port of LOCAL_SERVER_PORTS) { + portStatus.value[port] = 'connecting' + try { + // 用健康检查探测端口是否可达 + const controller = new AbortController() + const timeoutId = setTimeout(() => controller.abort(), 3000) + + await fetch(`http://localhost:${port}/api/hikvision/channels`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({}), + signal: controller.signal + }) + + clearTimeout(timeoutId) + // 无论业务返回什么,能连通就说明端口可用 + portStatus.value[port] = 'connected' + currentPort.value = port + return baseUrl.value + } catch { + portStatus.value[port] = 'error' + } + } + + lastError.value = `无法连接到任何本地录像服务器(尝试端口:${LOCAL_SERVER_PORTS.join('、')})` + throw new Error(lastError.value) + } + + /** 重置所有端口状态 */ + function resetStatus() { + LOCAL_SERVER_PORTS.forEach((port) => { + portStatus.value[port] = 'idle' + }) + lastError.value = '' + } + + // ============================================================ + // Actions — 业务 API(直接调用 localServerApi) + // ============================================================ + + /** + * 获取海康威视通道列表 + * 自动使用当前 baseUrl,如果未连接则先尝试 autoConnect + */ + async function fetchHikvisionChannels(params?: { + serverId?: number + ip?: string + port?: number + username?: string + password?: string + }) { + if (!hasAnyConnection.value) { + await autoConnect() + } + return localServerApi.getHikvisionChannels(baseUrl.value, params) + } + + // ---------- 后续在此追加其他业务方法 ---------- + // async function fetchSomeOtherApi(params?: any) { ... } + + return { + // state + currentPort, + portStatus, + lastError, + // getters + baseUrl, + isConnected, + hasAnyConnection, + portStatusList, + // actions — 连接管理 + setPort, + autoConnect, + resetStatus, + // actions — 业务 API + fetchHikvisionChannels + } +}) diff --git a/src/views/video/camera/component/CameraPlayer.vue b/src/views/video/camera/component/CameraPlayer.vue new file mode 100644 index 00000000..37a62802 --- /dev/null +++ b/src/views/video/camera/component/CameraPlayer.vue @@ -0,0 +1,192 @@ +