@ezuikit/player-theme 2.1.4-beta.1 → 3.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constant.js +2 -2
- package/dist/index.js +40 -1710
- package/dist/index.mjs +25 -1695
- package/dist/index.umd.js +445 -2208
- package/dist/style.css +8 -3
- package/dist/style.js +2 -2
- package/dist/types/index.d.ts +2 -2
- package/package.json +23 -7
package/dist/index.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @ezuikit/player-theme
|
|
3
|
-
* Copyright (c) 2026-
|
|
2
|
+
* @ezuikit/player-theme v3.0.0-beta.1
|
|
3
|
+
* Copyright (c) 2026-05-04 Ezviz-OpenBiz
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
(function (global, factory) {
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Theme = factory());
|
|
10
10
|
})(this, (function () { 'use strict';
|
|
11
11
|
|
|
12
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
13
|
+
|
|
12
14
|
function getDefaultExportFromCjs (x) {
|
|
13
15
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
14
16
|
}
|
|
@@ -584,7 +586,7 @@
|
|
|
584
586
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
585
587
|
}
|
|
586
588
|
}
|
|
587
|
-
function _create_class$
|
|
589
|
+
function _create_class$f(Constructor, protoProps, staticProps) {
|
|
588
590
|
if (protoProps) _defineProperties$9(Constructor.prototype, protoProps);
|
|
589
591
|
return Constructor;
|
|
590
592
|
}
|
|
@@ -599,14 +601,14 @@
|
|
|
599
601
|
configurable: true
|
|
600
602
|
}
|
|
601
603
|
});
|
|
602
|
-
if (superClass) _set_prototype_of$
|
|
604
|
+
if (superClass) _set_prototype_of$w(subClass, superClass);
|
|
603
605
|
}
|
|
604
|
-
function _set_prototype_of$
|
|
605
|
-
_set_prototype_of$
|
|
606
|
+
function _set_prototype_of$w(o, p) {
|
|
607
|
+
_set_prototype_of$w = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
606
608
|
o.__proto__ = p;
|
|
607
609
|
return o;
|
|
608
610
|
};
|
|
609
|
-
return _set_prototype_of$
|
|
611
|
+
return _set_prototype_of$w(o, p);
|
|
610
612
|
}
|
|
611
613
|
/**
|
|
612
614
|
* 控件基类
|
|
@@ -762,7 +764,7 @@
|
|
|
762
764
|
// 这是一个空函数, 子类可以实现重新改方法
|
|
763
765
|
this.__options.onClick == null ? void 0 : this.__options.onClick.call(this.__options, e);
|
|
764
766
|
};
|
|
765
|
-
_create_class$
|
|
767
|
+
_create_class$f(Control, [
|
|
766
768
|
{
|
|
767
769
|
key: "active",
|
|
768
770
|
get: /**
|
|
@@ -795,8 +797,8 @@
|
|
|
795
797
|
return Control;
|
|
796
798
|
}(EventEmitter);
|
|
797
799
|
|
|
798
|
-
function _extends$
|
|
799
|
-
_extends$
|
|
800
|
+
function _extends$u() {
|
|
801
|
+
_extends$u = Object.assign || function(target) {
|
|
800
802
|
for(var i = 1; i < arguments.length; i++){
|
|
801
803
|
var source = arguments[i];
|
|
802
804
|
for(var key in source){
|
|
@@ -807,7 +809,7 @@
|
|
|
807
809
|
}
|
|
808
810
|
return target;
|
|
809
811
|
};
|
|
810
|
-
return _extends$
|
|
812
|
+
return _extends$u.apply(this, arguments);
|
|
811
813
|
}
|
|
812
814
|
function _inherits$s(subClass, superClass) {
|
|
813
815
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -820,14 +822,14 @@
|
|
|
820
822
|
configurable: true
|
|
821
823
|
}
|
|
822
824
|
});
|
|
823
|
-
if (superClass) _set_prototype_of$
|
|
825
|
+
if (superClass) _set_prototype_of$v(subClass, superClass);
|
|
824
826
|
}
|
|
825
|
-
function _set_prototype_of$
|
|
826
|
-
_set_prototype_of$
|
|
827
|
+
function _set_prototype_of$v(o, p) {
|
|
828
|
+
_set_prototype_of$v = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
827
829
|
o.__proto__ = p;
|
|
828
830
|
return o;
|
|
829
831
|
};
|
|
830
|
-
return _set_prototype_of$
|
|
832
|
+
return _set_prototype_of$v(o, p);
|
|
831
833
|
}
|
|
832
834
|
var LOADING_DEFAULT_OPTIONS = {};
|
|
833
835
|
/**
|
|
@@ -838,7 +840,7 @@
|
|
|
838
840
|
function Loading(options) {
|
|
839
841
|
if (options === void 0) options = {};
|
|
840
842
|
var _this;
|
|
841
|
-
_this = Control.call(this, Object.assign({}, LOADING_DEFAULT_OPTIONS, _extends$
|
|
843
|
+
_this = Control.call(this, Object.assign({}, LOADING_DEFAULT_OPTIONS, _extends$u({}, options, {
|
|
842
844
|
tagName: 'div',
|
|
843
845
|
controlType: 'block',
|
|
844
846
|
classNameSuffix: 'loading'
|
|
@@ -876,8 +878,8 @@
|
|
|
876
878
|
return Loading;
|
|
877
879
|
}(Control);
|
|
878
880
|
|
|
879
|
-
function _extends$
|
|
880
|
-
_extends$
|
|
881
|
+
function _extends$t() {
|
|
882
|
+
_extends$t = Object.assign || function(target) {
|
|
881
883
|
for(var i = 1; i < arguments.length; i++){
|
|
882
884
|
var source = arguments[i];
|
|
883
885
|
for(var key in source){
|
|
@@ -888,7 +890,7 @@
|
|
|
888
890
|
}
|
|
889
891
|
return target;
|
|
890
892
|
};
|
|
891
|
-
return _extends$
|
|
893
|
+
return _extends$t.apply(this, arguments);
|
|
892
894
|
}
|
|
893
895
|
function _inherits$r(subClass, superClass) {
|
|
894
896
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -901,14 +903,14 @@
|
|
|
901
903
|
configurable: true
|
|
902
904
|
}
|
|
903
905
|
});
|
|
904
|
-
if (superClass) _set_prototype_of$
|
|
906
|
+
if (superClass) _set_prototype_of$u(subClass, superClass);
|
|
905
907
|
}
|
|
906
|
-
function _set_prototype_of$
|
|
907
|
-
_set_prototype_of$
|
|
908
|
+
function _set_prototype_of$u(o, p) {
|
|
909
|
+
_set_prototype_of$u = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
908
910
|
o.__proto__ = p;
|
|
909
911
|
return o;
|
|
910
912
|
};
|
|
911
|
-
return _set_prototype_of$
|
|
913
|
+
return _set_prototype_of$u(o, p);
|
|
912
914
|
}
|
|
913
915
|
// 不放在服务器上 是因为有可能http加载失败
|
|
914
916
|
// prettier-ignore
|
|
@@ -924,7 +926,7 @@
|
|
|
924
926
|
function Poster(options) {
|
|
925
927
|
if (options === void 0) options = {};
|
|
926
928
|
var _this;
|
|
927
|
-
_this = Control.call(this, Object.assign({}, POSTER_OPTIONS, _extends$
|
|
929
|
+
_this = Control.call(this, Object.assign({}, POSTER_OPTIONS, _extends$t({}, options, {
|
|
928
930
|
tagName: 'div',
|
|
929
931
|
controlType: 'block',
|
|
930
932
|
classNameSuffix: 'poster'
|
|
@@ -1191,8 +1193,8 @@
|
|
|
1191
1193
|
}
|
|
1192
1194
|
};
|
|
1193
1195
|
|
|
1194
|
-
function _extends$
|
|
1195
|
-
_extends$
|
|
1196
|
+
function _extends$s() {
|
|
1197
|
+
_extends$s = Object.assign || function(target) {
|
|
1196
1198
|
for(var i = 1; i < arguments.length; i++){
|
|
1197
1199
|
var source = arguments[i];
|
|
1198
1200
|
for(var key in source){
|
|
@@ -1203,7 +1205,7 @@
|
|
|
1203
1205
|
}
|
|
1204
1206
|
return target;
|
|
1205
1207
|
};
|
|
1206
|
-
return _extends$
|
|
1208
|
+
return _extends$s.apply(this, arguments);
|
|
1207
1209
|
}
|
|
1208
1210
|
function _inherits$q(subClass, superClass) {
|
|
1209
1211
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -1216,14 +1218,14 @@
|
|
|
1216
1218
|
configurable: true
|
|
1217
1219
|
}
|
|
1218
1220
|
});
|
|
1219
|
-
if (superClass) _set_prototype_of$
|
|
1221
|
+
if (superClass) _set_prototype_of$t(subClass, superClass);
|
|
1220
1222
|
}
|
|
1221
|
-
function _set_prototype_of$
|
|
1222
|
-
_set_prototype_of$
|
|
1223
|
+
function _set_prototype_of$t(o, p) {
|
|
1224
|
+
_set_prototype_of$t = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
1223
1225
|
o.__proto__ = p;
|
|
1224
1226
|
return o;
|
|
1225
1227
|
};
|
|
1226
|
-
return _set_prototype_of$
|
|
1228
|
+
return _set_prototype_of$t(o, p);
|
|
1227
1229
|
}
|
|
1228
1230
|
var MESSAGE_DEFAULT_OPTIONS = {};
|
|
1229
1231
|
/**
|
|
@@ -1234,7 +1236,7 @@
|
|
|
1234
1236
|
function Message(options) {
|
|
1235
1237
|
if (options === void 0) options = {};
|
|
1236
1238
|
var _this;
|
|
1237
|
-
_this = Control.call(this, Object.assign({}, MESSAGE_DEFAULT_OPTIONS, _extends$
|
|
1239
|
+
_this = Control.call(this, Object.assign({}, MESSAGE_DEFAULT_OPTIONS, _extends$s({}, options, {
|
|
1238
1240
|
tagName: 'div',
|
|
1239
1241
|
controlType: 'block'
|
|
1240
1242
|
}))) || this;
|
|
@@ -1383,12 +1385,12 @@
|
|
|
1383
1385
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
1384
1386
|
}
|
|
1385
1387
|
}
|
|
1386
|
-
function _create_class$
|
|
1388
|
+
function _create_class$e(Constructor, protoProps, staticProps) {
|
|
1387
1389
|
if (protoProps) _defineProperties$8(Constructor.prototype, protoProps);
|
|
1388
1390
|
return Constructor;
|
|
1389
1391
|
}
|
|
1390
|
-
function _extends$
|
|
1391
|
-
_extends$
|
|
1392
|
+
function _extends$r() {
|
|
1393
|
+
_extends$r = Object.assign || function(target) {
|
|
1392
1394
|
for(var i = 1; i < arguments.length; i++){
|
|
1393
1395
|
var source = arguments[i];
|
|
1394
1396
|
for(var key in source){
|
|
@@ -1399,7 +1401,7 @@
|
|
|
1399
1401
|
}
|
|
1400
1402
|
return target;
|
|
1401
1403
|
};
|
|
1402
|
-
return _extends$
|
|
1404
|
+
return _extends$r.apply(this, arguments);
|
|
1403
1405
|
}
|
|
1404
1406
|
function _inherits$p(subClass, superClass) {
|
|
1405
1407
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -1412,14 +1414,14 @@
|
|
|
1412
1414
|
configurable: true
|
|
1413
1415
|
}
|
|
1414
1416
|
});
|
|
1415
|
-
if (superClass) _set_prototype_of$
|
|
1417
|
+
if (superClass) _set_prototype_of$s(subClass, superClass);
|
|
1416
1418
|
}
|
|
1417
|
-
function _set_prototype_of$
|
|
1418
|
-
_set_prototype_of$
|
|
1419
|
+
function _set_prototype_of$s(o, p) {
|
|
1420
|
+
_set_prototype_of$s = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
1419
1421
|
o.__proto__ = p;
|
|
1420
1422
|
return o;
|
|
1421
1423
|
};
|
|
1422
|
-
return _set_prototype_of$
|
|
1424
|
+
return _set_prototype_of$s(o, p);
|
|
1423
1425
|
}
|
|
1424
1426
|
/**
|
|
1425
1427
|
* 播放/暂停控件
|
|
@@ -1428,7 +1430,7 @@
|
|
|
1428
1430
|
_inherits$p(Play, Control);
|
|
1429
1431
|
function Play(options) {
|
|
1430
1432
|
var _this;
|
|
1431
|
-
_this = Control.call(this, _extends$
|
|
1433
|
+
_this = Control.call(this, _extends$r({}, options, {
|
|
1432
1434
|
tagName: 'span',
|
|
1433
1435
|
controlType: 'button',
|
|
1434
1436
|
classNameSuffix: 'play'
|
|
@@ -1466,7 +1468,7 @@
|
|
|
1466
1468
|
});
|
|
1467
1469
|
}
|
|
1468
1470
|
};
|
|
1469
|
-
_create_class$
|
|
1471
|
+
_create_class$e(Play, [
|
|
1470
1472
|
{
|
|
1471
1473
|
key: "playing",
|
|
1472
1474
|
get: /**
|
|
@@ -1482,19 +1484,19 @@
|
|
|
1482
1484
|
/**
|
|
1483
1485
|
* picker component for js framework, support mobile and pc
|
|
1484
1486
|
*
|
|
1485
|
-
* @skax/picker v1.1.
|
|
1486
|
-
* Copyright (c) 2025-12-
|
|
1487
|
+
* @skax/picker v1.1.8
|
|
1488
|
+
* Copyright (c) 2025-12-12 ShineShao <xiaoshaoqq@gmail.com>
|
|
1487
1489
|
*
|
|
1488
1490
|
* This source code is licensed under the MIT license found in the
|
|
1489
1491
|
* LICENSE file in the root directory of this source tree.
|
|
1490
1492
|
*/
|
|
1491
1493
|
|
|
1492
|
-
var dist$
|
|
1493
|
-
var hasRequiredDist$
|
|
1494
|
+
var dist$5;
|
|
1495
|
+
var hasRequiredDist$5;
|
|
1494
1496
|
|
|
1495
|
-
function requireDist$
|
|
1496
|
-
if (hasRequiredDist$
|
|
1497
|
-
hasRequiredDist$
|
|
1497
|
+
function requireDist$5 () {
|
|
1498
|
+
if (hasRequiredDist$5) return dist$5;
|
|
1499
|
+
hasRequiredDist$5 = 1;
|
|
1498
1500
|
|
|
1499
1501
|
function _array_like_to_array(arr, len) {
|
|
1500
1502
|
if (len == null || len > arr.length) len = arr.length;
|
|
@@ -2069,14 +2071,14 @@
|
|
|
2069
2071
|
* Picker.VERSION; // 输出版本号
|
|
2070
2072
|
* ```
|
|
2071
2073
|
*/
|
|
2072
|
-
Picker.VERSION = '1.1.
|
|
2074
|
+
Picker.VERSION = '1.1.8';
|
|
2073
2075
|
|
|
2074
|
-
dist$
|
|
2075
|
-
return dist$
|
|
2076
|
+
dist$5 = Picker;
|
|
2077
|
+
return dist$5;
|
|
2076
2078
|
}
|
|
2077
2079
|
|
|
2078
|
-
var distExports$
|
|
2079
|
-
var Picker = /*@__PURE__*/getDefaultExportFromCjs(distExports$
|
|
2080
|
+
var distExports$5 = requireDist$5();
|
|
2081
|
+
var Picker = /*@__PURE__*/getDefaultExportFromCjs(distExports$5);
|
|
2080
2082
|
|
|
2081
2083
|
var delegate$2 = {exports: {}};
|
|
2082
2084
|
|
|
@@ -2361,7 +2363,7 @@
|
|
|
2361
2363
|
var cjsExports = requireCjs();
|
|
2362
2364
|
var deepmerge = /*@__PURE__*/getDefaultExportFromCjs(cjsExports);
|
|
2363
2365
|
|
|
2364
|
-
var dist$
|
|
2366
|
+
var dist$4 = {};
|
|
2365
2367
|
|
|
2366
2368
|
/*
|
|
2367
2369
|
* @ezuikit/utils-tools v2.0.2
|
|
@@ -2370,16 +2372,16 @@
|
|
|
2370
2372
|
* Released under the MIT License.
|
|
2371
2373
|
*/
|
|
2372
2374
|
|
|
2373
|
-
var hasRequiredDist$
|
|
2375
|
+
var hasRequiredDist$4;
|
|
2374
2376
|
|
|
2375
|
-
function requireDist$
|
|
2376
|
-
if (hasRequiredDist$
|
|
2377
|
-
hasRequiredDist$
|
|
2378
|
-
var getQuery=function(url){var query=url.split("?")[1],obj={};if(query)for(var vars=query.split("&"),i=0;i<vars.length;i++){var pair=vars[i].split("=");obj[pair[0]]=decodeURIComponent(pair[1]);}return obj};function parseEzopenUrl(url){var obj={};if(/^ezopen:\/\//.test(url)){if(url.includes("@")){var endIndex=url.indexOf("@"),startIndex=url.indexOf("//");obj.validateCode=url.substring(startIndex+2,endIndex),url=url.replace(obj.validateCode+"@","");}obj.protocol=url.split("//")[0],obj.search=url.split("?")[1]?"?"+url.split("?")[1]:"",obj.hostname=url.split("/")[2],obj.origin=obj.protocol+"//"+obj.hostname,obj.pathname=url.split("?")[0].replace(obj.origin,""),obj.href=url;var pathnames=obj.pathname.split("/"),lastPath=pathnames[2].split(".");return obj.deviceSerial=pathnames[1],obj.channelNo=lastPath[0],obj.type=lastPath[lastPath.length-1],"live"===obj.type&&(obj.definition=lastPath.length>2?lastPath[1]:"sd"),"rec"===obj.type&&pathnames[2]&&(obj.recType=pathnames[2].includes(".cloud.")?"cloud":""),obj.searchParams=getQuery(url),obj}return {}}var codec={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32};function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _instanceof(left,right){return null!=right&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?!!right[Symbol.hasInstance](left):left instanceof right}function _create_for_of_iterator_helper_loose(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(it)return (it=it.call(o)).next.bind(it);if(Array.isArray(o)||(it=function(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return "Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_array_like_to_array(o,minLen):void 0}}(o))||allowArrayLike){it&&(o=it);var i=0;return function(){return i>=o.length?{done:true}:{done:false,value:o[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var DateTime=function(){function DateTime(){}return DateTime.fillZero=function(num,len){return void 0===len&&(len=2),num.toString().padStart(len,"0")},DateTime.format=function(input,format){var date;if(_instanceof(input,Date))date=input;else {if("number"!=typeof input&&"string"!=typeof input)throw new Error("Invalid date input");date=DateTime.toDate(input+"");}for(var _step,result=format,_iterator=_create_for_of_iterator_helper_loose([[/(yyyy|YYYY)/g,function(){return DateTime.fillZero(date.getFullYear(),4)}],[/(yy|YY)/g,function(){return DateTime.fillZero(date.getFullYear()%100,2)}],[/(MM)/g,function(){return DateTime.fillZero(date.getMonth()+1,2)}],[/(M)/g,function(){return (date.getMonth()+1).toString()}],[/(dd|DD)/g,function(){return DateTime.fillZero(date.getDate(),2)}],[/(d|D)/g,function(){return date.getDate().toString()}],[/(HH|hh)/g,function(){return DateTime.fillZero(date.getHours(),2)}],[/(H|h)/g,function(){return date.getHours().toString()}],[/(mm)/g,function(){return DateTime.fillZero(date.getMinutes(),2)}],[/(m)/g,function(){return date.getMinutes().toString()}],[/(ss|SS)/g,function(){return DateTime.fillZero(date.getSeconds(),2)}],[/(s|S)/g,function(){return date.getSeconds().toString()}],[/(fff)/g,function(){return DateTime.fillZero(date.getMilliseconds(),3)}]]);!(_step=_iterator()).done;){var _step_value=_step.value,regexp=_step_value[0],fn=_step_value[1];result=result.replace(regexp,fn);}return result},DateTime.toDate=function(str){if(_instanceof(str,Date))return str;str=(str+"").trim().replace(/\/|\./gi,"-"),/^\d{4}$/.test(str)&&(str+="-01"),/^\d{4}-\d{2}$/.test(str)&&(str+="-01");try{return /^\d{4}-\d{2}-\d{2}$/.test(str)?new Date(+str.slice(0,4),+str.slice(5,7)-1,+str.slice(8,10),0,0,0):/^\d{8}$/.test(str)?(str+="",new Date(+str.slice(0,4),+str.slice(4,6)-1,+str.slice(6,8),0,0,0)):/^\d{14}$/.test(str)?(str+="",new Date(+str.slice(0,4),+str.slice(4,6)-1,+str.slice(6,8),+str.slice(8,10),+str.slice(10,12),+str.slice(12,14))):/^\d{13}$/.test(str)?new Date(Number(str)):/^\d{10}$/.test(str)?new Date(1e3*Number(str)):new Date(str)}catch(error){throw new Error("Invalid date string")}},DateTime.diff=function(date1,date2,type){ void 0===type&&(type="second");var d1=DateTime.toDate(date1),d2=DateTime.toDate(date2);return "second"===type?Math.floor((d1.getTime()-d2.getTime())/1e3):"minute"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60):"hour"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60):"day"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60/24):Math.abs(d1.getTime()-d2.getTime())},DateTime}();dist$
|
|
2379
|
-
return dist$
|
|
2377
|
+
function requireDist$4 () {
|
|
2378
|
+
if (hasRequiredDist$4) return dist$4;
|
|
2379
|
+
hasRequiredDist$4 = 1;
|
|
2380
|
+
var getQuery=function(url){var query=url.split("?")[1],obj={};if(query)for(var vars=query.split("&"),i=0;i<vars.length;i++){var pair=vars[i].split("=");obj[pair[0]]=decodeURIComponent(pair[1]);}return obj};function parseEzopenUrl(url){var obj={};if(/^ezopen:\/\//.test(url)){if(url.includes("@")){var endIndex=url.indexOf("@"),startIndex=url.indexOf("//");obj.validateCode=url.substring(startIndex+2,endIndex),url=url.replace(obj.validateCode+"@","");}obj.protocol=url.split("//")[0],obj.search=url.split("?")[1]?"?"+url.split("?")[1]:"",obj.hostname=url.split("/")[2],obj.origin=obj.protocol+"//"+obj.hostname,obj.pathname=url.split("?")[0].replace(obj.origin,""),obj.href=url;var pathnames=obj.pathname.split("/"),lastPath=pathnames[2].split(".");return obj.deviceSerial=pathnames[1],obj.channelNo=lastPath[0],obj.type=lastPath[lastPath.length-1],"live"===obj.type&&(obj.definition=lastPath.length>2?lastPath[1]:"sd"),"rec"===obj.type&&pathnames[2]&&(obj.recType=pathnames[2].includes(".cloud.")?"cloud":""),obj.searchParams=getQuery(url),obj}return {}}var codec={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32};function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _instanceof(left,right){return null!=right&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?!!right[Symbol.hasInstance](left):left instanceof right}function _create_for_of_iterator_helper_loose(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(it)return (it=it.call(o)).next.bind(it);if(Array.isArray(o)||(it=function(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return "Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_array_like_to_array(o,minLen):void 0}}(o))||allowArrayLike){it&&(o=it);var i=0;return function(){return i>=o.length?{done:true}:{done:false,value:o[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var DateTime=function(){function DateTime(){}return DateTime.fillZero=function(num,len){return void 0===len&&(len=2),num.toString().padStart(len,"0")},DateTime.format=function(input,format){var date;if(_instanceof(input,Date))date=input;else {if("number"!=typeof input&&"string"!=typeof input)throw new Error("Invalid date input");date=DateTime.toDate(input+"");}for(var _step,result=format,_iterator=_create_for_of_iterator_helper_loose([[/(yyyy|YYYY)/g,function(){return DateTime.fillZero(date.getFullYear(),4)}],[/(yy|YY)/g,function(){return DateTime.fillZero(date.getFullYear()%100,2)}],[/(MM)/g,function(){return DateTime.fillZero(date.getMonth()+1,2)}],[/(M)/g,function(){return (date.getMonth()+1).toString()}],[/(dd|DD)/g,function(){return DateTime.fillZero(date.getDate(),2)}],[/(d|D)/g,function(){return date.getDate().toString()}],[/(HH|hh)/g,function(){return DateTime.fillZero(date.getHours(),2)}],[/(H|h)/g,function(){return date.getHours().toString()}],[/(mm)/g,function(){return DateTime.fillZero(date.getMinutes(),2)}],[/(m)/g,function(){return date.getMinutes().toString()}],[/(ss|SS)/g,function(){return DateTime.fillZero(date.getSeconds(),2)}],[/(s|S)/g,function(){return date.getSeconds().toString()}],[/(fff)/g,function(){return DateTime.fillZero(date.getMilliseconds(),3)}]]);!(_step=_iterator()).done;){var _step_value=_step.value,regexp=_step_value[0],fn=_step_value[1];result=result.replace(regexp,fn);}return result},DateTime.toDate=function(str){if(_instanceof(str,Date))return str;str=(str+"").trim().replace(/\/|\./gi,"-"),/^\d{4}$/.test(str)&&(str+="-01"),/^\d{4}-\d{2}$/.test(str)&&(str+="-01");try{return /^\d{4}-\d{2}-\d{2}$/.test(str)?new Date(+str.slice(0,4),+str.slice(5,7)-1,+str.slice(8,10),0,0,0):/^\d{8}$/.test(str)?(str+="",new Date(+str.slice(0,4),+str.slice(4,6)-1,+str.slice(6,8),0,0,0)):/^\d{14}$/.test(str)?(str+="",new Date(+str.slice(0,4),+str.slice(4,6)-1,+str.slice(6,8),+str.slice(8,10),+str.slice(10,12),+str.slice(12,14))):/^\d{13}$/.test(str)?new Date(Number(str)):/^\d{10}$/.test(str)?new Date(1e3*Number(str)):new Date(str)}catch(error){throw new Error("Invalid date string")}},DateTime.diff=function(date1,date2,type){ void 0===type&&(type="second");var d1=DateTime.toDate(date1),d2=DateTime.toDate(date2);return "second"===type?Math.floor((d1.getTime()-d2.getTime())/1e3):"minute"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60):"hour"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60):"day"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60/24):Math.abs(d1.getTime()-d2.getTime())},DateTime}();dist$4.DateTime=DateTime,dist$4.addVc=function(url,codecs){ void 0===codecs&&(codecs=["h264"]);var vc=(codecs||["h264"]).reduce(function(acc,key){return key=key.toLowerCase(),acc+(codec[key]||0)},0),host=url.split("?")[0],query=url.split("?")[1];return query=(query||"").split("&").filter(function(item){return !/^vc=\d?/.test(item)}).join("&"),host+"?"+(query+=(query?"&":"")+"vc="+vc)},dist$4.getQuery=getQuery,dist$4.getStaticPath=function(path,base){ void 0===base&&(base="");var protocolReg=/^(https?:\/\/|^\/\/)/;if(""===path||void 0===path)return "";if(protocolReg.test(path))return path;path=path.replace(/\/+/g,"/"),base=protocolReg.test(base||"")?base:window.location.href;try{return new URL(path,base).href}catch(error){return path}},dist$4.isHttp=function(url){return /^http[s]?:\/\//.test(url)},dist$4.isMobile=function(agent){var _navigator,_navigator1,_navigator2,_window;return /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone|Opera Mini)/i.test(null!=agent?agent:null==(_navigator=navigator)?void 0:_navigator.userAgent)||/Macintosh/i.test(agent||(null==(_navigator1=navigator)?void 0:_navigator1.userAgent))&&(null==(_navigator2=navigator)?void 0:_navigator2.maxTouchPoints)>1||!!(null==(_window=window)?void 0:_window.__IS_MOBILE_SIMULATOR__)},dist$4.isRealMobile=function(agent){var _navigator,ua=(null!=agent?agent:null==(_navigator=navigator)?void 0:_navigator.userAgent).toLowerCase();if(/ipad|tablet|playbook|silk|android(?!.*mobile)/i.test(ua))return false;var hasTouch="ontouchstart"in window||navigator.maxTouchPoints>0;return /android|webos|iphone|ipod|blackberry|iemobile|opera mini/i.test(ua)&&hasTouch},dist$4.parseEzopenUrl=parseEzopenUrl,dist$4.pick=function(obj,keys){return Object.entries(obj).reduce(function(acc,param){var key=param[0],value=param[1];return keys.includes(key)&&(acc[key]=value),acc},{})},dist$4.switchEzopenUrl=function(url,options){var _ref=null!=options?options:{},type=_ref.type,recType=_ref.recType,search=_ref.search,definition=_ref.definition,channelNo=_ref.channelNo,deviceSerial=_ref.deviceSerial,validateCode=_ref.validateCode,obj=parseEzopenUrl(url);if(search){var ns=Object.assign({},obj.searchParams,getQuery("?"+search.replace("?","")));search=Object.entries(ns).reduce(function(acc,param){var key=param[0],value=param[1];return ""===value?acc:acc+=key+"="+encodeURIComponent(value)+"&"},"?").replace(/&$/,"");}else search=obj.search;return type=type||obj.type,recType=null!=recType?recType:obj.recType,definition=null!=definition?definition:obj.definition,channelNo=channelNo||obj.channelNo,deviceSerial=deviceSerial||obj.deviceSerial,validateCode=null!=validateCode?validateCode:obj.validateCode,obj.protocol+"//"+(validateCode?validateCode+"@":"")+obj.hostname+"/"+deviceSerial+"/"+channelNo+("rec"===type&&recType?"."+recType:"")+("live"===type&&"hd"===definition?"."+definition:"")+"."+type+search};
|
|
2381
|
+
return dist$4;
|
|
2380
2382
|
}
|
|
2381
2383
|
|
|
2382
|
-
var distExports$
|
|
2384
|
+
var distExports$4 = requireDist$4();
|
|
2383
2385
|
|
|
2384
2386
|
/**
|
|
2385
2387
|
* 节流函数
|
|
@@ -2607,7 +2609,7 @@
|
|
|
2607
2609
|
* ```ts
|
|
2608
2610
|
* Utils.isMobile // true | false
|
|
2609
2611
|
* ```
|
|
2610
|
-
*/ Utils.isMobile = distExports$
|
|
2612
|
+
*/ Utils.isMobile = distExports$4.isMobile();
|
|
2611
2613
|
|
|
2612
2614
|
function _defineProperties$7(target, props) {
|
|
2613
2615
|
for(var i = 0; i < props.length; i++){
|
|
@@ -2618,7 +2620,7 @@
|
|
|
2618
2620
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
2619
2621
|
}
|
|
2620
2622
|
}
|
|
2621
|
-
function _create_class$
|
|
2623
|
+
function _create_class$d(Constructor, protoProps, staticProps) {
|
|
2622
2624
|
if (protoProps) _defineProperties$7(Constructor.prototype, protoProps);
|
|
2623
2625
|
return Constructor;
|
|
2624
2626
|
}
|
|
@@ -2885,7 +2887,7 @@
|
|
|
2885
2887
|
});
|
|
2886
2888
|
});
|
|
2887
2889
|
};
|
|
2888
|
-
_create_class$
|
|
2890
|
+
_create_class$d(Progress, [
|
|
2889
2891
|
{
|
|
2890
2892
|
key: "disabled",
|
|
2891
2893
|
get: function get() {
|
|
@@ -2942,12 +2944,12 @@
|
|
|
2942
2944
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
2943
2945
|
}
|
|
2944
2946
|
}
|
|
2945
|
-
function _create_class$
|
|
2947
|
+
function _create_class$c(Constructor, protoProps, staticProps) {
|
|
2946
2948
|
if (protoProps) _defineProperties$6(Constructor.prototype, protoProps);
|
|
2947
2949
|
return Constructor;
|
|
2948
2950
|
}
|
|
2949
|
-
function _extends$
|
|
2950
|
-
_extends$
|
|
2951
|
+
function _extends$q() {
|
|
2952
|
+
_extends$q = Object.assign || function(target) {
|
|
2951
2953
|
for(var i = 1; i < arguments.length; i++){
|
|
2952
2954
|
var source = arguments[i];
|
|
2953
2955
|
for(var key in source){
|
|
@@ -2958,7 +2960,7 @@
|
|
|
2958
2960
|
}
|
|
2959
2961
|
return target;
|
|
2960
2962
|
};
|
|
2961
|
-
return _extends$
|
|
2963
|
+
return _extends$q.apply(this, arguments);
|
|
2962
2964
|
}
|
|
2963
2965
|
function _inherits$o(subClass, superClass) {
|
|
2964
2966
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -2971,14 +2973,14 @@
|
|
|
2971
2973
|
configurable: true
|
|
2972
2974
|
}
|
|
2973
2975
|
});
|
|
2974
|
-
if (superClass) _set_prototype_of$
|
|
2976
|
+
if (superClass) _set_prototype_of$r(subClass, superClass);
|
|
2975
2977
|
}
|
|
2976
|
-
function _set_prototype_of$
|
|
2977
|
-
_set_prototype_of$
|
|
2978
|
+
function _set_prototype_of$r(o, p) {
|
|
2979
|
+
_set_prototype_of$r = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
2978
2980
|
o.__proto__ = p;
|
|
2979
2981
|
return o;
|
|
2980
2982
|
};
|
|
2981
|
-
return _set_prototype_of$
|
|
2983
|
+
return _set_prototype_of$r(o, p);
|
|
2982
2984
|
}
|
|
2983
2985
|
var VOLUME_DEFAULT_OPTIONS = {
|
|
2984
2986
|
volume: 0.8,
|
|
@@ -2997,7 +2999,7 @@
|
|
|
2997
2999
|
if (options === void 0) options = {};
|
|
2998
3000
|
var _this;
|
|
2999
3001
|
var _this__options_props, _this__options_props1, _this__options_props2, _this__options_props3;
|
|
3000
|
-
_this = Control.call(this, _extends$
|
|
3002
|
+
_this = Control.call(this, _extends$q({}, options, {
|
|
3001
3003
|
tagName: 'span',
|
|
3002
3004
|
classNameSuffix: 'volume',
|
|
3003
3005
|
controlType: 'button'
|
|
@@ -3137,7 +3139,7 @@
|
|
|
3137
3139
|
}
|
|
3138
3140
|
});
|
|
3139
3141
|
};
|
|
3140
|
-
_create_class$
|
|
3142
|
+
_create_class$c(Volume, [
|
|
3141
3143
|
{
|
|
3142
3144
|
key: "muted",
|
|
3143
3145
|
get: /**
|
|
@@ -3412,7 +3414,7 @@
|
|
|
3412
3414
|
var screenfullExports = requireScreenfull();
|
|
3413
3415
|
var screenfull = /*@__PURE__*/getDefaultExportFromCjs(screenfullExports);
|
|
3414
3416
|
|
|
3415
|
-
function asyncGeneratorStep$
|
|
3417
|
+
function asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, key, arg) {
|
|
3416
3418
|
try {
|
|
3417
3419
|
var info = gen[key](arg);
|
|
3418
3420
|
var value = info.value;
|
|
@@ -3426,22 +3428,22 @@
|
|
|
3426
3428
|
Promise.resolve(value).then(_next, _throw);
|
|
3427
3429
|
}
|
|
3428
3430
|
}
|
|
3429
|
-
function _async_to_generator$
|
|
3431
|
+
function _async_to_generator$8(fn) {
|
|
3430
3432
|
return function() {
|
|
3431
3433
|
var self = this, args = arguments;
|
|
3432
3434
|
return new Promise(function(resolve, reject) {
|
|
3433
3435
|
var gen = fn.apply(self, args);
|
|
3434
3436
|
function _next(value) {
|
|
3435
|
-
asyncGeneratorStep$
|
|
3437
|
+
asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, "next", value);
|
|
3436
3438
|
}
|
|
3437
3439
|
function _throw(err) {
|
|
3438
|
-
asyncGeneratorStep$
|
|
3440
|
+
asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, "throw", err);
|
|
3439
3441
|
}
|
|
3440
3442
|
_next(undefined);
|
|
3441
3443
|
});
|
|
3442
3444
|
};
|
|
3443
3445
|
}
|
|
3444
|
-
function _ts_generator$
|
|
3446
|
+
function _ts_generator$8(thisArg, body) {
|
|
3445
3447
|
var f, y, t, _ = {
|
|
3446
3448
|
label: 0,
|
|
3447
3449
|
sent: function() {
|
|
@@ -3655,8 +3657,8 @@
|
|
|
3655
3657
|
* 全屏
|
|
3656
3658
|
* @returns Promise<void>
|
|
3657
3659
|
*/ _proto.fullscreen = function fullscreen() {
|
|
3658
|
-
return _async_to_generator$
|
|
3659
|
-
return _ts_generator$
|
|
3660
|
+
return _async_to_generator$8(function() {
|
|
3661
|
+
return _ts_generator$8(this, function(_state) {
|
|
3660
3662
|
switch(_state.label){
|
|
3661
3663
|
case 0:
|
|
3662
3664
|
if (!Utils.isMobile) return [
|
|
@@ -3691,8 +3693,8 @@
|
|
|
3691
3693
|
* 退出全屏
|
|
3692
3694
|
* @returns Promise<void>
|
|
3693
3695
|
*/ _proto.exitFullscreen = function exitFullscreen() {
|
|
3694
|
-
return _async_to_generator$
|
|
3695
|
-
return _ts_generator$
|
|
3696
|
+
return _async_to_generator$8(function() {
|
|
3697
|
+
return _ts_generator$8(this, function(_state) {
|
|
3696
3698
|
switch(_state.label){
|
|
3697
3699
|
case 0:
|
|
3698
3700
|
if (!Utils.isMobile) return [
|
|
@@ -3731,8 +3733,8 @@
|
|
|
3731
3733
|
* 全屏切换
|
|
3732
3734
|
* @returns Promise<void>
|
|
3733
3735
|
*/ _proto.toggle = function toggle() {
|
|
3734
|
-
return _async_to_generator$
|
|
3735
|
-
return _ts_generator$
|
|
3736
|
+
return _async_to_generator$8(function() {
|
|
3737
|
+
return _ts_generator$8(this, function(_state) {
|
|
3736
3738
|
switch(_state.label){
|
|
3737
3739
|
case 0:
|
|
3738
3740
|
if (!Utils.isMobile) return [
|
|
@@ -3855,8 +3857,8 @@
|
|
|
3855
3857
|
return Fullscreen;
|
|
3856
3858
|
}();
|
|
3857
3859
|
|
|
3858
|
-
function _extends$
|
|
3859
|
-
_extends$
|
|
3860
|
+
function _extends$p() {
|
|
3861
|
+
_extends$p = Object.assign || function(target) {
|
|
3860
3862
|
for(var i = 1; i < arguments.length; i++){
|
|
3861
3863
|
var source = arguments[i];
|
|
3862
3864
|
for(var key in source){
|
|
@@ -3867,7 +3869,7 @@
|
|
|
3867
3869
|
}
|
|
3868
3870
|
return target;
|
|
3869
3871
|
};
|
|
3870
|
-
return _extends$
|
|
3872
|
+
return _extends$p.apply(this, arguments);
|
|
3871
3873
|
}
|
|
3872
3874
|
function _inherits$n(subClass, superClass) {
|
|
3873
3875
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -3880,14 +3882,14 @@
|
|
|
3880
3882
|
configurable: true
|
|
3881
3883
|
}
|
|
3882
3884
|
});
|
|
3883
|
-
if (superClass) _set_prototype_of$
|
|
3885
|
+
if (superClass) _set_prototype_of$q(subClass, superClass);
|
|
3884
3886
|
}
|
|
3885
|
-
function _set_prototype_of$
|
|
3886
|
-
_set_prototype_of$
|
|
3887
|
+
function _set_prototype_of$q(o, p) {
|
|
3888
|
+
_set_prototype_of$q = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
3887
3889
|
o.__proto__ = p;
|
|
3888
3890
|
return o;
|
|
3889
3891
|
};
|
|
3890
|
-
return _set_prototype_of$
|
|
3892
|
+
return _set_prototype_of$q(o, p);
|
|
3891
3893
|
}
|
|
3892
3894
|
/**
|
|
3893
3895
|
* 全屏控件
|
|
@@ -3897,7 +3899,7 @@
|
|
|
3897
3899
|
function Fullscreen(options) {
|
|
3898
3900
|
var _this;
|
|
3899
3901
|
var _options_props, _this_options;
|
|
3900
|
-
_this = Control.call(this, _extends$
|
|
3902
|
+
_this = Control.call(this, _extends$p({
|
|
3901
3903
|
tagName: 'span',
|
|
3902
3904
|
classNameSuffix: 'fullscreen',
|
|
3903
3905
|
controlType: 'button'
|
|
@@ -3962,8 +3964,8 @@
|
|
|
3962
3964
|
return Fullscreen;
|
|
3963
3965
|
}(Control);
|
|
3964
3966
|
|
|
3965
|
-
function _extends$
|
|
3966
|
-
_extends$
|
|
3967
|
+
function _extends$o() {
|
|
3968
|
+
_extends$o = Object.assign || function(target) {
|
|
3967
3969
|
for(var i = 1; i < arguments.length; i++){
|
|
3968
3970
|
var source = arguments[i];
|
|
3969
3971
|
for(var key in source){
|
|
@@ -3974,7 +3976,7 @@
|
|
|
3974
3976
|
}
|
|
3975
3977
|
return target;
|
|
3976
3978
|
};
|
|
3977
|
-
return _extends$
|
|
3979
|
+
return _extends$o.apply(this, arguments);
|
|
3978
3980
|
}
|
|
3979
3981
|
function _inherits$m(subClass, superClass) {
|
|
3980
3982
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -3987,14 +3989,14 @@
|
|
|
3987
3989
|
configurable: true
|
|
3988
3990
|
}
|
|
3989
3991
|
});
|
|
3990
|
-
if (superClass) _set_prototype_of$
|
|
3992
|
+
if (superClass) _set_prototype_of$p(subClass, superClass);
|
|
3991
3993
|
}
|
|
3992
|
-
function _set_prototype_of$
|
|
3993
|
-
_set_prototype_of$
|
|
3994
|
+
function _set_prototype_of$p(o, p) {
|
|
3995
|
+
_set_prototype_of$p = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
3994
3996
|
o.__proto__ = p;
|
|
3995
3997
|
return o;
|
|
3996
3998
|
};
|
|
3997
|
-
return _set_prototype_of$
|
|
3999
|
+
return _set_prototype_of$p(o, p);
|
|
3998
4000
|
}
|
|
3999
4001
|
/**
|
|
4000
4002
|
* 回放类型切换(本地回放(sdk 卡), 云存储回放, 云录制回放)控件
|
|
@@ -4004,7 +4006,7 @@
|
|
|
4004
4006
|
function Rec(options) {
|
|
4005
4007
|
var _this;
|
|
4006
4008
|
var _options_props;
|
|
4007
|
-
_this = Control.call(this, _extends$
|
|
4009
|
+
_this = Control.call(this, _extends$o({}, options, {
|
|
4008
4010
|
tagName: 'div',
|
|
4009
4011
|
controlType: 'block',
|
|
4010
4012
|
classNameSuffix: 'rec'
|
|
@@ -4096,185 +4098,46 @@
|
|
|
4096
4098
|
return Rec;
|
|
4097
4099
|
}(Control);
|
|
4098
4100
|
|
|
4099
|
-
var dist$
|
|
4100
|
-
|
|
4101
|
-
var hasRequiredDist$8;
|
|
4101
|
+
var dist$3 = {exports: {}};
|
|
4102
4102
|
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4103
|
+
/*
|
|
4104
|
+
* @ezuikit/utils-i18n v2.0.0
|
|
4105
|
+
* i18n utils
|
|
4106
|
+
* Copyright (c) 2026-01-16 Ezviz-OpenBiz
|
|
4107
|
+
* Released under the MIT License.
|
|
4108
|
+
*/
|
|
4106
4109
|
|
|
4107
|
-
|
|
4110
|
+
var hasRequiredDist$3;
|
|
4108
4111
|
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
}
|
|
4116
|
-
}(Constructor.prototype, protoProps), Constructor;
|
|
4117
|
-
}
|
|
4112
|
+
function requireDist$3 () {
|
|
4113
|
+
if (hasRequiredDist$3) return dist$3.exports;
|
|
4114
|
+
hasRequiredDist$3 = 1;
|
|
4115
|
+
var deepmerge=requireCjs();function _create_class(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _type_of(obj){return obj&&"undefined"!=typeof Symbol&&obj.constructor===Symbol?"symbol":typeof obj}var I18n=function(){function I18n(translations,options){this._translations={},this._locale=null==options?void 0:options.defaultLocale,translations&&(this._translations=translations,(null==options?void 0:options.defaultLocale)||(this._locale=Object.keys(translations)[0])),this.options=options||{};}var _proto=I18n.prototype;return _proto.t=function(scope,variables){var value,translation=this._translations[this._locale];if(!translation)return "function"==typeof this.options.customizeMissing?this.options.customizeMissing(scope,variables):'[missing "'+this._locale+'" locale]';if("string"==typeof scope&&scope.includes(".")&&!(scope in translation)){var _this__findChainValue=this._findChainValue(translation,scope),v=_this__findChainValue[0];if(_this__findChainValue[1])value=v;else {if(void 0===(null==variables?void 0:variables.defaultvalue))return "function"==typeof this.options.customizeMissing?this.options.customizeMissing(scope,variables):'[missing "'+this._locale+"."+scope+'" translation]';value=variables.defaultvalue;}}else if(scope in translation)value=translation[scope];else {if(void 0===(null==variables?void 0:variables.defaultvalue))return "function"==typeof this.options.customizeMissing?this.options.customizeMissing(scope,variables):'[missing "'+this._locale+"."+scope+'" translation]';value=variables.defaultvalue;}return "string"==typeof value&&variables&&/\{\{\s*(\w+)\s*\}\}/.test(value)?value.replace(/\{\{\s*(\w+)\s*\}\}/g,(function(_,varName){return String(variables[varName])||""})):value},_proto.appendTranslations=function(translations){this._translations=deepmerge(this._translations,translations,{clone:false}),this._locale||(this._locale=Object.keys(this._translations)[0]),this._onChange();},_proto.switchLocale=function(locale){locale in this._translations&&(this._locale=locale,this._onChange());},_proto.switchTranslation=function(locale){this.switchLocale(locale);},_proto.getCurrentLocale=function(){return this._locale},_proto.getCurrentTranslation=function(){return this._translations[this._locale]},_proto.getVersion=function(){return "2.0.0"},_proto._onChange=function(){return null==this.options.onChange?void 0:this.options.onChange.call(this.options,this)},_proto._findChainValue=function(obj,path){for(var paths=path.split("."),translation=obj,i=0;i<paths.length;i++){if(!paths[i])return [void 0,false];if("object"!==(void 0===translation?"undefined":_type_of(translation))||null===translation)return [void 0,false];if(!(paths[i]in translation))return [void 0,false];if(translation=translation[paths[i]],i+1===paths.length)return [translation,true]}return [void 0,false]},_create_class(I18n,[{key:"locale",get:function(){return this._locale}},{key:"translations",get:function(){return this._translations}}]),I18n}();I18n.VERSION="2.0.0",dist$3.exports=I18n;
|
|
4116
|
+
return dist$3.exports;
|
|
4117
|
+
}
|
|
4118
4118
|
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
this._translations = {}, this._locale = null == options ? void 0 : options.defaultLocale,
|
|
4122
|
-
translations && (this._translations = translations, (null == options ? void 0 : options.defaultLocale) || (this._locale = Object.keys(translations)[0])),
|
|
4123
|
-
this.options = options || {};
|
|
4124
|
-
}
|
|
4125
|
-
var _proto = I18n.prototype;
|
|
4126
|
-
return _proto.t = function(scope, variables) {
|
|
4127
|
-
var value, translation = this._translations[this._locale];
|
|
4128
|
-
if (!translation) return "function" == typeof this.options.customizeMissing ? this.options.customizeMissing(scope, variables) : '[missing "' + this._locale + '" locale]';
|
|
4129
|
-
if ("string" == typeof scope && scope.includes(".") && !(scope in translation)) {
|
|
4130
|
-
var _this__findChainValue = this._findChainValue(translation, scope), v = _this__findChainValue[0];
|
|
4131
|
-
if (_this__findChainValue[1]) value = v; else {
|
|
4132
|
-
if (void 0 === (null == variables ? void 0 : variables.defaultvalue)) return "function" == typeof this.options.customizeMissing ? this.options.customizeMissing(scope, variables) : '[missing "' + this._locale + "." + scope + '" translation]';
|
|
4133
|
-
value = variables.defaultvalue;
|
|
4134
|
-
}
|
|
4135
|
-
} else if (scope in translation) value = translation[scope]; else {
|
|
4136
|
-
if (void 0 === (null == variables ? void 0 : variables.defaultvalue)) return "function" == typeof this.options.customizeMissing ? this.options.customizeMissing(scope, variables) : '[missing "' + this._locale + "." + scope + '" translation]';
|
|
4137
|
-
value = variables.defaultvalue;
|
|
4138
|
-
}
|
|
4139
|
-
return "string" == typeof value && variables && /\{\{\s*(\w+)\s*\}\}/.test(value) ? value.replace(/\{\{\s*(\w+)\s*\}\}/g, function(_, varName) {
|
|
4140
|
-
return String(variables[varName]) || "";
|
|
4141
|
-
}) : value;
|
|
4142
|
-
}, _proto.appendTranslations = function(translations) {
|
|
4143
|
-
this._translations = deepmerge(this._translations, translations, {
|
|
4144
|
-
clone: false
|
|
4145
|
-
}), this._locale || (this._locale = Object.keys(this._translations)[0]), this._onChange();
|
|
4146
|
-
}, _proto.switchLocale = function(locale) {
|
|
4147
|
-
locale in this._translations && (this._locale = locale, this._onChange());
|
|
4148
|
-
}, _proto.switchTranslation = function(locale) {
|
|
4149
|
-
this.switchLocale(locale);
|
|
4150
|
-
}, _proto.getCurrentLocale = function() {
|
|
4151
|
-
return this._locale;
|
|
4152
|
-
}, _proto.getCurrentTranslation = function() {
|
|
4153
|
-
return this._translations[this._locale];
|
|
4154
|
-
}, _proto.getVersion = function() {
|
|
4155
|
-
return "2.0.0";
|
|
4156
|
-
}, _proto._onChange = function() {
|
|
4157
|
-
return null == this.options.onChange ? void 0 : this.options.onChange.call(this.options, this);
|
|
4158
|
-
}, _proto._findChainValue = function(obj, path) {
|
|
4159
|
-
for (var paths = path.split("."), translation = obj, i = 0; i < paths.length; i++) {
|
|
4160
|
-
if (!(paths[i] in translation)) return [ void 0, false ];
|
|
4161
|
-
if (translation = translation[paths[i]], i + 1 === paths.length) return [ translation[paths[i]], true ];
|
|
4162
|
-
}
|
|
4163
|
-
return [ void 0, false ];
|
|
4164
|
-
}, _create_class(I18n, [ {
|
|
4165
|
-
key: "locale",
|
|
4166
|
-
get: function() {
|
|
4167
|
-
return this._locale;
|
|
4168
|
-
}
|
|
4169
|
-
}, {
|
|
4170
|
-
key: "translations",
|
|
4171
|
-
get: function() {
|
|
4172
|
-
return this._translations;
|
|
4173
|
-
}
|
|
4174
|
-
} ]), I18n;
|
|
4175
|
-
}();
|
|
4119
|
+
var distExports$3 = requireDist$3();
|
|
4120
|
+
var I18n$1 = /*@__PURE__*/getDefaultExportFromCjs(distExports$3);
|
|
4176
4121
|
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
var dist$7;
|
|
4185
|
-
var hasRequiredDist$7;
|
|
4186
|
-
|
|
4187
|
-
function requireDist$7 () {
|
|
4188
|
-
if (hasRequiredDist$7) return dist$7;
|
|
4189
|
-
hasRequiredDist$7 = 1;
|
|
4190
|
-
|
|
4191
|
-
var _$LoggerStyle$_ = {
|
|
4192
|
-
info: "",
|
|
4193
|
-
log: "background: #4096ff; color: #FFF;",
|
|
4194
|
-
warn: "background: yellow; color: #FFF;",
|
|
4195
|
-
error: "background: red; color: #FFF;"
|
|
4196
|
-
}, LoggerCls = function() {
|
|
4197
|
-
function LoggerCls(options) {
|
|
4198
|
-
void 0 === options && (options = {}), this._options = {
|
|
4199
|
-
level: "INFO",
|
|
4200
|
-
showTime: false
|
|
4201
|
-
}, this._levelNum = 3, this.info = this._loggerFactory("info", this._levelNum >= 3),
|
|
4202
|
-
this.log = this._loggerFactory("log", this._levelNum >= 2), this.warn = this._loggerFactory("warn", this._levelNum >= 1),
|
|
4203
|
-
this.error = this._loggerFactory("error", this._levelNum >= 0), this.setOptions(options);
|
|
4204
|
-
}
|
|
4205
|
-
var _proto = LoggerCls.prototype;
|
|
4206
|
-
return _proto.setOptions = function(options) {
|
|
4207
|
-
var _this__options_level;
|
|
4208
|
-
this._options = Object.assign({}, this._options, options), this._levelNum = this._matchLevel(null != (_this__options_level = this._options.level) ? _this__options_level : "INFO"),
|
|
4209
|
-
this.info = this._loggerFactory("info", this._levelNum >= 3), this.log = this._loggerFactory("log", this._levelNum >= 2),
|
|
4210
|
-
this.warn = this._loggerFactory("warn", this._levelNum >= 1), this.error = this._loggerFactory("error", this._levelNum >= 0);
|
|
4211
|
-
}, _proto._matchLevel = function(level) {
|
|
4212
|
-
var logLevel = 3;
|
|
4213
|
-
switch (level) {
|
|
4214
|
-
case "INFO":
|
|
4215
|
-
logLevel = 3;
|
|
4216
|
-
break;
|
|
4217
|
-
|
|
4218
|
-
case "LOG":
|
|
4219
|
-
logLevel = 2;
|
|
4220
|
-
break;
|
|
4221
|
-
|
|
4222
|
-
case "WARN":
|
|
4223
|
-
logLevel = 1;
|
|
4224
|
-
break;
|
|
4225
|
-
|
|
4226
|
-
case "ERROR":
|
|
4227
|
-
logLevel = 0;
|
|
4228
|
-
}
|
|
4229
|
-
return logLevel;
|
|
4230
|
-
}, _proto._loggerFactory = function(type, bool) {
|
|
4231
|
-
var fn = console[type];
|
|
4232
|
-
if (bool && fn) {
|
|
4233
|
-
var _fn, args0 = this._options.name ? "%c[" + this._options.name + "]%c %c[" + type.toUpperCase() + "]" : "%c[" + type.toUpperCase() + "]", color = [ this._options.name ? "background: green;color: #fff" : null, this._options.name ? "" : null, _$LoggerStyle$_[type] ].filter(function(color) {
|
|
4234
|
-
return null != color;
|
|
4235
|
-
});
|
|
4236
|
-
return (_fn = fn).bind.apply(_fn, [].concat([ console, args0 ], color));
|
|
4237
|
-
}
|
|
4238
|
-
return LoggerCls.noop;
|
|
4239
|
-
}, _proto.getOptions = function() {
|
|
4240
|
-
return this._options;
|
|
4241
|
-
}, _proto.getVersion = function() {
|
|
4242
|
-
return "2.0.0";
|
|
4243
|
-
}, LoggerCls;
|
|
4244
|
-
}();
|
|
4122
|
+
/*
|
|
4123
|
+
* @ezuikit/utils-logger v2.0.0
|
|
4124
|
+
* logger utils
|
|
4125
|
+
* Copyright (c) 2026-01-16 Ezviz-OpenBiz
|
|
4126
|
+
* Released under the MIT License.
|
|
4127
|
+
*/
|
|
4245
4128
|
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
}
|
|
4129
|
+
var dist$2;
|
|
4130
|
+
var hasRequiredDist$2;
|
|
4249
4131
|
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
dist$
|
|
4255
|
-
var logger = new LoggerCls(options);
|
|
4256
|
-
return new Proxy(logger, {
|
|
4257
|
-
get: function(target, prop) {
|
|
4258
|
-
if (__$list$__.includes(prop)) {
|
|
4259
|
-
var _target__options;
|
|
4260
|
-
if (null == (_target__options = target._options) ? void 0 : _target__options.showTime) {
|
|
4261
|
-
var time = (now = new Date(Date.now()), year = now.getFullYear(), month = now.getMonth() + 1,
|
|
4262
|
-
day = now.getDate(), hour = now.getHours(), min = now.getMinutes(), sec = now.getSeconds(),
|
|
4263
|
-
ms = now.getMilliseconds(), year + "/" + __fillTen__(month) + "/" + __fillTen__(day) + " " + __fillTen__(hour) + ":" + __fillTen__(min) + ":" + __fillTen__(sec) + ":" + ms);
|
|
4264
|
-
return target[prop].bind(console, "[" + time + "]");
|
|
4265
|
-
}
|
|
4266
|
-
return target[prop].bind(console);
|
|
4267
|
-
}
|
|
4268
|
-
var now, year, month, day, hour, min, sec, ms;
|
|
4269
|
-
return Reflect.get(target, prop);
|
|
4270
|
-
}
|
|
4271
|
-
});
|
|
4272
|
-
};
|
|
4273
|
-
return dist$7;
|
|
4132
|
+
function requireDist$2 () {
|
|
4133
|
+
if (hasRequiredDist$2) return dist$2;
|
|
4134
|
+
hasRequiredDist$2 = 1;
|
|
4135
|
+
var globalThis_1,hasRequiredGlobalThis,commonjsGlobal$1="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:{},es_object_toString={};function requireGlobalThis(){if(hasRequiredGlobalThis)return globalThis_1;hasRequiredGlobalThis=1;var check=function(it){return it&&it.Math===Math&&it};return globalThis_1=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof commonjsGlobal$1&&commonjsGlobal$1)||check("object"==typeof globalThis_1&&globalThis_1)||function(){return this}()||Function("return this")()}var isPure,hasRequiredIsPure,defineGlobalProperty,hasRequiredDefineGlobalProperty,hasRequiredSharedStore,shared,hasRequiredShared,fails,hasRequiredFails,functionBindNative,hasRequiredFunctionBindNative,functionUncurryThis,hasRequiredFunctionUncurryThis,isNullOrUndefined,hasRequiredIsNullOrUndefined,requireObjectCoercible,hasRequiredRequireObjectCoercible,toObject,hasRequiredToObject,hasOwnProperty_1,hasRequiredHasOwnProperty,uid,hasRequiredUid,environmentUserAgent,hasRequiredEnvironmentUserAgent,environmentV8Version,hasRequiredEnvironmentV8Version,symbolConstructorDetection,hasRequiredSymbolConstructorDetection,useSymbolAsUid,hasRequiredUseSymbolAsUid,wellKnownSymbol,hasRequiredWellKnownSymbol,toStringTagSupport,hasRequiredToStringTagSupport,isCallable,hasRequiredIsCallable,sharedStore={exports:{}};function requireDefineGlobalProperty(){if(hasRequiredDefineGlobalProperty)return defineGlobalProperty;hasRequiredDefineGlobalProperty=1;var globalThis=requireGlobalThis(),defineProperty=Object.defineProperty;return defineGlobalProperty=function(key,value){try{defineProperty(globalThis,key,{value:value,configurable:!0,writable:!0});}catch(error){globalThis[key]=value;}return value}}function requireSharedStore(){if(hasRequiredSharedStore)return sharedStore.exports;hasRequiredSharedStore=1;var IS_PURE=hasRequiredIsPure?isPure:(hasRequiredIsPure=1,isPure=false),globalThis=requireGlobalThis(),defineGlobalProperty=requireDefineGlobalProperty(),store=sharedStore.exports=globalThis["__core-js_shared__"]||defineGlobalProperty("__core-js_shared__",{});return (store.versions||(store.versions=[])).push({version:"3.46.0",mode:IS_PURE?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE",source:"https://github.com/zloirock/core-js"}),sharedStore.exports}function requireShared(){if(hasRequiredShared)return shared;hasRequiredShared=1;var store=requireSharedStore();return shared=function(key,value){return store[key]||(store[key]=value||{})}}function requireFails(){return hasRequiredFails?fails:(hasRequiredFails=1,fails=function(exec){try{return !!exec()}catch(error){return true}})}function requireFunctionBindNative(){if(hasRequiredFunctionBindNative)return functionBindNative;hasRequiredFunctionBindNative=1;var fails=requireFails();return functionBindNative=!fails((function(){var test=function(){}.bind();return "function"!=typeof test||test.hasOwnProperty("prototype")}))}function requireFunctionUncurryThis(){if(hasRequiredFunctionUncurryThis)return functionUncurryThis;hasRequiredFunctionUncurryThis=1;var NATIVE_BIND=requireFunctionBindNative(),FunctionPrototype=Function.prototype,call=FunctionPrototype.call,uncurryThisWithBind=NATIVE_BIND&&FunctionPrototype.bind.bind(call,call);return functionUncurryThis=NATIVE_BIND?uncurryThisWithBind:function(fn){return function(){return call.apply(fn,arguments)}},functionUncurryThis}function requireIsNullOrUndefined(){return hasRequiredIsNullOrUndefined?isNullOrUndefined:(hasRequiredIsNullOrUndefined=1,isNullOrUndefined=function(it){return null==it})}function requireRequireObjectCoercible(){if(hasRequiredRequireObjectCoercible)return requireObjectCoercible;hasRequiredRequireObjectCoercible=1;var isNullOrUndefined=requireIsNullOrUndefined(),$TypeError=TypeError;return requireObjectCoercible=function(it){if(isNullOrUndefined(it))throw new $TypeError("Can't call method on "+it);return it}}function requireToObject(){if(hasRequiredToObject)return toObject;hasRequiredToObject=1;var requireObjectCoercible=requireRequireObjectCoercible(),$Object=Object;return toObject=function(argument){return $Object(requireObjectCoercible(argument))}}function requireHasOwnProperty(){if(hasRequiredHasOwnProperty)return hasOwnProperty_1;hasRequiredHasOwnProperty=1;var uncurryThis=requireFunctionUncurryThis(),toObject=requireToObject(),hasOwnProperty=uncurryThis({}.hasOwnProperty);return hasOwnProperty_1=Object.hasOwn||function(it,key){return hasOwnProperty(toObject(it),key)}}function requireUid(){if(hasRequiredUid)return uid;hasRequiredUid=1;var uncurryThis=requireFunctionUncurryThis(),id=0,postfix=Math.random(),toString=uncurryThis(1.1.toString);return uid=function(key){return "Symbol("+(void 0===key?"":key)+")_"+toString(++id+postfix,36)}}function requireEnvironmentV8Version(){if(hasRequiredEnvironmentV8Version)return environmentV8Version;hasRequiredEnvironmentV8Version=1;var match,version,globalThis=requireGlobalThis(),userAgent=function(){if(hasRequiredEnvironmentUserAgent)return environmentUserAgent;hasRequiredEnvironmentUserAgent=1;var navigator=requireGlobalThis().navigator,userAgent=navigator&&navigator.userAgent;return environmentUserAgent=userAgent?String(userAgent):""}(),process=globalThis.process,Deno=globalThis.Deno,versions=process&&process.versions||Deno&&Deno.version,v8=versions&&versions.v8;return v8&&(version=(match=v8.split("."))[0]>0&&match[0]<4?1:+(match[0]+match[1])),!version&&userAgent&&(!(match=userAgent.match(/Edge\/(\d+)/))||match[1]>=74)&&(match=userAgent.match(/Chrome\/(\d+)/))&&(version=+match[1]),environmentV8Version=version}function requireSymbolConstructorDetection(){if(hasRequiredSymbolConstructorDetection)return symbolConstructorDetection;hasRequiredSymbolConstructorDetection=1;var V8_VERSION=requireEnvironmentV8Version(),fails=requireFails(),$String=requireGlobalThis().String;return symbolConstructorDetection=!!Object.getOwnPropertySymbols&&!fails((function(){var symbol=Symbol("symbol detection");return !$String(symbol)||!(Object(symbol)instanceof Symbol)||!Symbol.sham&&V8_VERSION&&V8_VERSION<41}))}function requireUseSymbolAsUid(){if(hasRequiredUseSymbolAsUid)return useSymbolAsUid;hasRequiredUseSymbolAsUid=1;var NATIVE_SYMBOL=requireSymbolConstructorDetection();return useSymbolAsUid=NATIVE_SYMBOL&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function requireWellKnownSymbol(){if(hasRequiredWellKnownSymbol)return wellKnownSymbol;hasRequiredWellKnownSymbol=1;var globalThis=requireGlobalThis(),shared=requireShared(),hasOwn=requireHasOwnProperty(),uid=requireUid(),NATIVE_SYMBOL=requireSymbolConstructorDetection(),USE_SYMBOL_AS_UID=requireUseSymbolAsUid(),Symbol=globalThis.Symbol,WellKnownSymbolsStore=shared("wks"),createWellKnownSymbol=USE_SYMBOL_AS_UID?Symbol.for||Symbol:Symbol&&Symbol.withoutSetter||uid;return wellKnownSymbol=function(name){return hasOwn(WellKnownSymbolsStore,name)||(WellKnownSymbolsStore[name]=NATIVE_SYMBOL&&hasOwn(Symbol,name)?Symbol[name]:createWellKnownSymbol("Symbol."+name)),WellKnownSymbolsStore[name]}}function requireToStringTagSupport(){if(hasRequiredToStringTagSupport)return toStringTagSupport;hasRequiredToStringTagSupport=1;var test={};return test[requireWellKnownSymbol()("toStringTag")]="z",toStringTagSupport="[object z]"===String(test)}function requireIsCallable(){if(hasRequiredIsCallable)return isCallable;hasRequiredIsCallable=1;var documentAll="object"==typeof document&&document.all;return isCallable=void 0===documentAll&&void 0!==documentAll?function(argument){return "function"==typeof argument||argument===documentAll}:function(argument){return "function"==typeof argument}}var descriptors,hasRequiredDescriptors,isObject,hasRequiredIsObject,documentCreateElement,hasRequiredDocumentCreateElement,ie8DomDefine,hasRequiredIe8DomDefine,v8PrototypeDefineBug,hasRequiredV8PrototypeDefineBug,anObject,hasRequiredAnObject,functionCall,hasRequiredFunctionCall,getBuiltIn,hasRequiredGetBuiltIn,objectIsPrototypeOf,hasRequiredObjectIsPrototypeOf,isSymbol,hasRequiredIsSymbol,tryToString,hasRequiredTryToString,aCallable,hasRequiredACallable,getMethod,hasRequiredGetMethod,ordinaryToPrimitive,hasRequiredOrdinaryToPrimitive,toPrimitive,hasRequiredToPrimitive,toPropertyKey,hasRequiredToPropertyKey,hasRequiredObjectDefineProperty,objectDefineProperty={};function requireDescriptors(){if(hasRequiredDescriptors)return descriptors;hasRequiredDescriptors=1;var fails=requireFails();return descriptors=!fails((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))}function requireIsObject(){if(hasRequiredIsObject)return isObject;hasRequiredIsObject=1;var isCallable=requireIsCallable();return isObject=function(it){return "object"==typeof it?null!==it:isCallable(it)}}function requireDocumentCreateElement(){if(hasRequiredDocumentCreateElement)return documentCreateElement;hasRequiredDocumentCreateElement=1;var globalThis=requireGlobalThis(),isObject=requireIsObject(),document=globalThis.document,EXISTS=isObject(document)&&isObject(document.createElement);return documentCreateElement=function(it){return EXISTS?document.createElement(it):{}}}function requireIe8DomDefine(){if(hasRequiredIe8DomDefine)return ie8DomDefine;hasRequiredIe8DomDefine=1;var DESCRIPTORS=requireDescriptors(),fails=requireFails(),createElement=requireDocumentCreateElement();return ie8DomDefine=!DESCRIPTORS&&!fails((function(){return 7!==Object.defineProperty(createElement("div"),"a",{get:function(){return 7}}).a}))}function requireV8PrototypeDefineBug(){if(hasRequiredV8PrototypeDefineBug)return v8PrototypeDefineBug;hasRequiredV8PrototypeDefineBug=1;var DESCRIPTORS=requireDescriptors(),fails=requireFails();return v8PrototypeDefineBug=DESCRIPTORS&&fails((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:false}).prototype}))}function requireAnObject(){if(hasRequiredAnObject)return anObject;hasRequiredAnObject=1;var isObject=requireIsObject(),$String=String,$TypeError=TypeError;return anObject=function(argument){if(isObject(argument))return argument;throw new $TypeError($String(argument)+" is not an object")}}function requireFunctionCall(){if(hasRequiredFunctionCall)return functionCall;hasRequiredFunctionCall=1;var NATIVE_BIND=requireFunctionBindNative(),call=Function.prototype.call;return functionCall=NATIVE_BIND?call.bind(call):function(){return call.apply(call,arguments)},functionCall}function requireGetBuiltIn(){if(hasRequiredGetBuiltIn)return getBuiltIn;hasRequiredGetBuiltIn=1;var globalThis=requireGlobalThis(),isCallable=requireIsCallable();return getBuiltIn=function(namespace,method){return arguments.length<2?(argument=globalThis[namespace],isCallable(argument)?argument:void 0):globalThis[namespace]&&globalThis[namespace][method];var argument;},getBuiltIn}function requireIsSymbol(){if(hasRequiredIsSymbol)return isSymbol;hasRequiredIsSymbol=1;var getBuiltIn=requireGetBuiltIn(),isCallable=requireIsCallable(),isPrototypeOf=function(){if(hasRequiredObjectIsPrototypeOf)return objectIsPrototypeOf;hasRequiredObjectIsPrototypeOf=1;var uncurryThis=requireFunctionUncurryThis();return objectIsPrototypeOf=uncurryThis({}.isPrototypeOf)}(),USE_SYMBOL_AS_UID=requireUseSymbolAsUid(),$Object=Object;return isSymbol=USE_SYMBOL_AS_UID?function(it){return "symbol"==typeof it}:function(it){var $Symbol=getBuiltIn("Symbol");return isCallable($Symbol)&&isPrototypeOf($Symbol.prototype,$Object(it))}}function requireTryToString(){if(hasRequiredTryToString)return tryToString;hasRequiredTryToString=1;var $String=String;return tryToString=function(argument){try{return $String(argument)}catch(error){return "Object"}}}function requireACallable(){if(hasRequiredACallable)return aCallable;hasRequiredACallable=1;var isCallable=requireIsCallable(),tryToString=requireTryToString(),$TypeError=TypeError;return aCallable=function(argument){if(isCallable(argument))return argument;throw new $TypeError(tryToString(argument)+" is not a function")}}function requireGetMethod(){if(hasRequiredGetMethod)return getMethod;hasRequiredGetMethod=1;var aCallable=requireACallable(),isNullOrUndefined=requireIsNullOrUndefined();return getMethod=function(V,P){var func=V[P];return isNullOrUndefined(func)?void 0:aCallable(func)}}function requireOrdinaryToPrimitive(){if(hasRequiredOrdinaryToPrimitive)return ordinaryToPrimitive;hasRequiredOrdinaryToPrimitive=1;var call=requireFunctionCall(),isCallable=requireIsCallable(),isObject=requireIsObject(),$TypeError=TypeError;return ordinaryToPrimitive=function(input,pref){var fn,val;if("string"===pref&&isCallable(fn=input.toString)&&!isObject(val=call(fn,input)))return val;if(isCallable(fn=input.valueOf)&&!isObject(val=call(fn,input)))return val;if("string"!==pref&&isCallable(fn=input.toString)&&!isObject(val=call(fn,input)))return val;throw new $TypeError("Can't convert object to primitive value")}}function requireToPrimitive(){if(hasRequiredToPrimitive)return toPrimitive;hasRequiredToPrimitive=1;var call=requireFunctionCall(),isObject=requireIsObject(),isSymbol=requireIsSymbol(),getMethod=requireGetMethod(),ordinaryToPrimitive=requireOrdinaryToPrimitive(),wellKnownSymbol=requireWellKnownSymbol(),$TypeError=TypeError,TO_PRIMITIVE=wellKnownSymbol("toPrimitive");return toPrimitive=function(input,pref){if(!isObject(input)||isSymbol(input))return input;var result,exoticToPrim=getMethod(input,TO_PRIMITIVE);if(exoticToPrim){if(void 0===pref&&(pref="default"),result=call(exoticToPrim,input,pref),!isObject(result)||isSymbol(result))return result;throw new $TypeError("Can't convert object to primitive value")}return void 0===pref&&(pref="number"),ordinaryToPrimitive(input,pref)}}function requireToPropertyKey(){if(hasRequiredToPropertyKey)return toPropertyKey;hasRequiredToPropertyKey=1;var toPrimitive=requireToPrimitive(),isSymbol=requireIsSymbol();return toPropertyKey=function(argument){var key=toPrimitive(argument,"string");return isSymbol(key)?key:key+""}}function requireObjectDefineProperty(){if(hasRequiredObjectDefineProperty)return objectDefineProperty;hasRequiredObjectDefineProperty=1;var DESCRIPTORS=requireDescriptors(),IE8_DOM_DEFINE=requireIe8DomDefine(),V8_PROTOTYPE_DEFINE_BUG=requireV8PrototypeDefineBug(),anObject=requireAnObject(),toPropertyKey=requireToPropertyKey(),$TypeError=TypeError,$defineProperty=Object.defineProperty,$getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor;return objectDefineProperty.f=DESCRIPTORS?V8_PROTOTYPE_DEFINE_BUG?function(O,P,Attributes){if(anObject(O),P=toPropertyKey(P),anObject(Attributes),"function"==typeof O&&"prototype"===P&&"value"in Attributes&&"writable"in Attributes&&!Attributes.writable){var current=$getOwnPropertyDescriptor(O,P);current&¤t.writable&&(O[P]=Attributes.value,Attributes={configurable:"configurable"in Attributes?Attributes.configurable:current.configurable,enumerable:"enumerable"in Attributes?Attributes.enumerable:current.enumerable,writable:false});}return $defineProperty(O,P,Attributes)}:$defineProperty:function(O,P,Attributes){if(anObject(O),P=toPropertyKey(P),anObject(Attributes),IE8_DOM_DEFINE)try{return $defineProperty(O,P,Attributes)}catch(error){}if("get"in Attributes||"set"in Attributes)throw new $TypeError("Accessors not supported");return "value"in Attributes&&(O[P]=Attributes.value),O},objectDefineProperty}var functionName,hasRequiredFunctionName,inspectSource,hasRequiredInspectSource,weakMapBasicDetection,hasRequiredWeakMapBasicDetection,createPropertyDescriptor,hasRequiredCreatePropertyDescriptor,createNonEnumerableProperty,hasRequiredCreateNonEnumerableProperty,sharedKey,hasRequiredSharedKey,hiddenKeys,hasRequiredHiddenKeys,internalState,hasRequiredInternalState,hasRequiredMakeBuiltIn,defineBuiltIn,hasRequiredDefineBuiltIn,classofRaw,hasRequiredClassofRaw,classof,hasRequiredClassof,objectToString,hasRequiredObjectToString,hasRequiredEs_object_toString,makeBuiltIn={exports:{}};function requireInspectSource(){if(hasRequiredInspectSource)return inspectSource;hasRequiredInspectSource=1;var uncurryThis=requireFunctionUncurryThis(),isCallable=requireIsCallable(),store=requireSharedStore(),functionToString=uncurryThis(Function.toString);return isCallable(store.inspectSource)||(store.inspectSource=function(it){return functionToString(it)}),inspectSource=store.inspectSource}function requireCreatePropertyDescriptor(){return hasRequiredCreatePropertyDescriptor?createPropertyDescriptor:(hasRequiredCreatePropertyDescriptor=1,createPropertyDescriptor=function(bitmap,value){return {enumerable:!(1&bitmap),configurable:!(2&bitmap),writable:!(4&bitmap),value:value}})}function requireCreateNonEnumerableProperty(){if(hasRequiredCreateNonEnumerableProperty)return createNonEnumerableProperty;hasRequiredCreateNonEnumerableProperty=1;var DESCRIPTORS=requireDescriptors(),definePropertyModule=requireObjectDefineProperty(),createPropertyDescriptor=requireCreatePropertyDescriptor();return createNonEnumerableProperty=DESCRIPTORS?function(object,key,value){return definePropertyModule.f(object,key,createPropertyDescriptor(1,value))}:function(object,key,value){return object[key]=value,object}}function requireSharedKey(){if(hasRequiredSharedKey)return sharedKey;hasRequiredSharedKey=1;var shared=requireShared(),uid=requireUid(),keys=shared("keys");return sharedKey=function(key){return keys[key]||(keys[key]=uid(key))}}function requireHiddenKeys(){return hasRequiredHiddenKeys?hiddenKeys:(hasRequiredHiddenKeys=1,hiddenKeys={})}function requireInternalState(){if(hasRequiredInternalState)return internalState;hasRequiredInternalState=1;var set,get,has,NATIVE_WEAK_MAP=function(){if(hasRequiredWeakMapBasicDetection)return weakMapBasicDetection;hasRequiredWeakMapBasicDetection=1;var globalThis=requireGlobalThis(),isCallable=requireIsCallable(),WeakMap=globalThis.WeakMap;return weakMapBasicDetection=isCallable(WeakMap)&&/native code/.test(String(WeakMap))}(),globalThis=requireGlobalThis(),isObject=requireIsObject(),createNonEnumerableProperty=requireCreateNonEnumerableProperty(),hasOwn=requireHasOwnProperty(),shared=requireSharedStore(),sharedKey=requireSharedKey(),hiddenKeys=requireHiddenKeys(),TypeError=globalThis.TypeError,WeakMap=globalThis.WeakMap;if(NATIVE_WEAK_MAP||shared.state){var store=shared.state||(shared.state=new WeakMap);store.get=store.get,store.has=store.has,store.set=store.set,set=function(it,metadata){if(store.has(it))throw new TypeError("Object already initialized");return metadata.facade=it,store.set(it,metadata),metadata},get=function(it){return store.get(it)||{}},has=function(it){return store.has(it)};}else {var STATE=sharedKey("state");hiddenKeys[STATE]=true,set=function(it,metadata){if(hasOwn(it,STATE))throw new TypeError("Object already initialized");return metadata.facade=it,createNonEnumerableProperty(it,STATE,metadata),metadata},get=function(it){return hasOwn(it,STATE)?it[STATE]:{}},has=function(it){return hasOwn(it,STATE)};}return internalState={set:set,get:get,has:has,enforce:function(it){return has(it)?get(it):set(it,{})},getterFor:function(TYPE){return function(it){var state;if(!isObject(it)||(state=get(it)).type!==TYPE)throw new TypeError("Incompatible receiver, "+TYPE+" required");return state}}}}function requireMakeBuiltIn(){if(hasRequiredMakeBuiltIn)return makeBuiltIn.exports;hasRequiredMakeBuiltIn=1;var uncurryThis=requireFunctionUncurryThis(),fails=requireFails(),isCallable=requireIsCallable(),hasOwn=requireHasOwnProperty(),DESCRIPTORS=requireDescriptors(),CONFIGURABLE_FUNCTION_NAME=function(){if(hasRequiredFunctionName)return functionName;hasRequiredFunctionName=1;var DESCRIPTORS=requireDescriptors(),hasOwn=requireHasOwnProperty(),FunctionPrototype=Function.prototype,getDescriptor=DESCRIPTORS&&Object.getOwnPropertyDescriptor,EXISTS=hasOwn(FunctionPrototype,"name"),PROPER=EXISTS&&"something"===function(){}.name,CONFIGURABLE=EXISTS&&(!DESCRIPTORS||DESCRIPTORS&&getDescriptor(FunctionPrototype,"name").configurable);return functionName={EXISTS:EXISTS,PROPER:PROPER,CONFIGURABLE:CONFIGURABLE}}().CONFIGURABLE,inspectSource=requireInspectSource(),InternalStateModule=requireInternalState(),enforceInternalState=InternalStateModule.enforce,getInternalState=InternalStateModule.get,$String=String,defineProperty=Object.defineProperty,stringSlice=uncurryThis("".slice),replace=uncurryThis("".replace),join=uncurryThis([].join),CONFIGURABLE_LENGTH=DESCRIPTORS&&!fails((function(){return 8!==defineProperty((function(){}),"length",{value:8}).length})),TEMPLATE=String(String).split("String"),makeBuiltIn$1=makeBuiltIn.exports=function(value,name,options){"Symbol("===stringSlice($String(name),0,7)&&(name="["+replace($String(name),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),options&&options.getter&&(name="get "+name),options&&options.setter&&(name="set "+name),(!hasOwn(value,"name")||CONFIGURABLE_FUNCTION_NAME&&value.name!==name)&&(DESCRIPTORS?defineProperty(value,"name",{value:name,configurable:true}):value.name=name),CONFIGURABLE_LENGTH&&options&&hasOwn(options,"arity")&&value.length!==options.arity&&defineProperty(value,"length",{value:options.arity});try{options&&hasOwn(options,"constructor")&&options.constructor?DESCRIPTORS&&defineProperty(value,"prototype",{writable:!1}):value.prototype&&(value.prototype=void 0);}catch(error){}var state=enforceInternalState(value);return hasOwn(state,"source")||(state.source=join(TEMPLATE,"string"==typeof name?name:"")),value};return Function.prototype.toString=makeBuiltIn$1((function(){return isCallable(this)&&getInternalState(this).source||inspectSource(this)}),"toString"),makeBuiltIn.exports}function requireDefineBuiltIn(){if(hasRequiredDefineBuiltIn)return defineBuiltIn;hasRequiredDefineBuiltIn=1;var isCallable=requireIsCallable(),definePropertyModule=requireObjectDefineProperty(),makeBuiltIn=requireMakeBuiltIn(),defineGlobalProperty=requireDefineGlobalProperty();return defineBuiltIn=function(O,key,value,options){options||(options={});var simple=options.enumerable,name=void 0!==options.name?options.name:key;if(isCallable(value)&&makeBuiltIn(value,name,options),options.global)simple?O[key]=value:defineGlobalProperty(key,value);else {try{options.unsafe?O[key]&&(simple=!0):delete O[key];}catch(error){}simple?O[key]=value:definePropertyModule.f(O,key,{value:value,enumerable:false,configurable:!options.nonConfigurable,writable:!options.nonWritable});}return O}}function requireClassofRaw(){if(hasRequiredClassofRaw)return classofRaw;hasRequiredClassofRaw=1;var uncurryThis=requireFunctionUncurryThis(),toString=uncurryThis({}.toString),stringSlice=uncurryThis("".slice);return classofRaw=function(it){return stringSlice(toString(it),8,-1)}}function requireClassof(){if(hasRequiredClassof)return classof;hasRequiredClassof=1;var TO_STRING_TAG_SUPPORT=requireToStringTagSupport(),isCallable=requireIsCallable(),classofRaw=requireClassofRaw(),TO_STRING_TAG=requireWellKnownSymbol()("toStringTag"),$Object=Object,CORRECT_ARGUMENTS="Arguments"===classofRaw(function(){return arguments}());return classof=TO_STRING_TAG_SUPPORT?classofRaw:function(it){var O,tag,result;return void 0===it?"Undefined":null===it?"Null":"string"==typeof(tag=function(it,key){try{return it[key]}catch(error){}}(O=$Object(it),TO_STRING_TAG))?tag:CORRECT_ARGUMENTS?classofRaw(O):"Object"===(result=classofRaw(O))&&isCallable(O.callee)?"Arguments":result}}function requireEs_object_toString(){if(hasRequiredEs_object_toString)return es_object_toString;hasRequiredEs_object_toString=1;var TO_STRING_TAG_SUPPORT=requireToStringTagSupport(),defineBuiltIn=requireDefineBuiltIn(),toString=function(){if(hasRequiredObjectToString)return objectToString;hasRequiredObjectToString=1;var TO_STRING_TAG_SUPPORT=requireToStringTagSupport(),classof=requireClassof();return objectToString=TO_STRING_TAG_SUPPORT?{}.toString:function(){return "[object "+classof(this)+"]"}}();return TO_STRING_TAG_SUPPORT||defineBuiltIn(Object.prototype,"toString",toString,{unsafe:true}),es_object_toString}var hasRequiredObjectPropertyIsEnumerable,indexedObject,hasRequiredIndexedObject,toIndexedObject,hasRequiredToIndexedObject,hasRequiredObjectGetOwnPropertyDescriptor,es_reflect_apply={},objectGetOwnPropertyDescriptor={},objectPropertyIsEnumerable={};function requireToIndexedObject(){if(hasRequiredToIndexedObject)return toIndexedObject;hasRequiredToIndexedObject=1;var IndexedObject=function(){if(hasRequiredIndexedObject)return indexedObject;hasRequiredIndexedObject=1;var uncurryThis=requireFunctionUncurryThis(),fails=requireFails(),classof=requireClassofRaw(),$Object=Object,split=uncurryThis("".split);return indexedObject=fails((function(){return !$Object("z").propertyIsEnumerable(0)}))?function(it){return "String"===classof(it)?split(it,""):$Object(it)}:$Object}(),requireObjectCoercible=requireRequireObjectCoercible();return toIndexedObject=function(it){return IndexedObject(requireObjectCoercible(it))}}function requireObjectGetOwnPropertyDescriptor(){if(hasRequiredObjectGetOwnPropertyDescriptor)return objectGetOwnPropertyDescriptor;hasRequiredObjectGetOwnPropertyDescriptor=1;var DESCRIPTORS=requireDescriptors(),call=requireFunctionCall(),propertyIsEnumerableModule=function(){if(hasRequiredObjectPropertyIsEnumerable)return objectPropertyIsEnumerable;hasRequiredObjectPropertyIsEnumerable=1;var $propertyIsEnumerable={}.propertyIsEnumerable,getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor&&!$propertyIsEnumerable.call({1:2},1);return objectPropertyIsEnumerable.f=NASHORN_BUG?function(V){var descriptor=getOwnPropertyDescriptor(this,V);return !!descriptor&&descriptor.enumerable}:$propertyIsEnumerable,objectPropertyIsEnumerable}(),createPropertyDescriptor=requireCreatePropertyDescriptor(),toIndexedObject=requireToIndexedObject(),toPropertyKey=requireToPropertyKey(),hasOwn=requireHasOwnProperty(),IE8_DOM_DEFINE=requireIe8DomDefine(),$getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor;return objectGetOwnPropertyDescriptor.f=DESCRIPTORS?$getOwnPropertyDescriptor:function(O,P){if(O=toIndexedObject(O),P=toPropertyKey(P),IE8_DOM_DEFINE)try{return $getOwnPropertyDescriptor(O,P)}catch(error){}if(hasOwn(O,P))return createPropertyDescriptor(!call(propertyIsEnumerableModule.f,O,P),O[P])},objectGetOwnPropertyDescriptor}var mathTrunc,hasRequiredMathTrunc,toIntegerOrInfinity,hasRequiredToIntegerOrInfinity,toAbsoluteIndex,hasRequiredToAbsoluteIndex,toLength,hasRequiredToLength,lengthOfArrayLike,hasRequiredLengthOfArrayLike,arrayIncludes,hasRequiredArrayIncludes,objectKeysInternal,hasRequiredObjectKeysInternal,enumBugKeys,hasRequiredEnumBugKeys,hasRequiredObjectGetOwnPropertyNames,objectGetOwnPropertyNames={};function requireToIntegerOrInfinity(){if(hasRequiredToIntegerOrInfinity)return toIntegerOrInfinity;hasRequiredToIntegerOrInfinity=1;var trunc=function(){if(hasRequiredMathTrunc)return mathTrunc;hasRequiredMathTrunc=1;var ceil=Math.ceil,floor=Math.floor;return mathTrunc=Math.trunc||function(x){var n=+x;return (n>0?floor:ceil)(n)}}();return toIntegerOrInfinity=function(argument){var number=+argument;return number!=number||0===number?0:trunc(number)}}function requireToAbsoluteIndex(){if(hasRequiredToAbsoluteIndex)return toAbsoluteIndex;hasRequiredToAbsoluteIndex=1;var toIntegerOrInfinity=requireToIntegerOrInfinity(),max=Math.max,min=Math.min;return toAbsoluteIndex=function(index,length){var integer=toIntegerOrInfinity(index);return integer<0?max(integer+length,0):min(integer,length)}}function requireToLength(){if(hasRequiredToLength)return toLength;hasRequiredToLength=1;var toIntegerOrInfinity=requireToIntegerOrInfinity(),min=Math.min;return toLength=function(argument){var len=toIntegerOrInfinity(argument);return len>0?min(len,9007199254740991):0}}function requireLengthOfArrayLike(){if(hasRequiredLengthOfArrayLike)return lengthOfArrayLike;hasRequiredLengthOfArrayLike=1;var toLength=requireToLength();return lengthOfArrayLike=function(obj){return toLength(obj.length)}}function requireObjectKeysInternal(){if(hasRequiredObjectKeysInternal)return objectKeysInternal;hasRequiredObjectKeysInternal=1;var uncurryThis=requireFunctionUncurryThis(),hasOwn=requireHasOwnProperty(),toIndexedObject=requireToIndexedObject(),indexOf=function(){if(hasRequiredArrayIncludes)return arrayIncludes;hasRequiredArrayIncludes=1;var toIndexedObject=requireToIndexedObject(),toAbsoluteIndex=requireToAbsoluteIndex(),lengthOfArrayLike=requireLengthOfArrayLike(),createMethod=function(IS_INCLUDES){return function($this,el,fromIndex){var O=toIndexedObject($this),length=lengthOfArrayLike(O);if(0===length)return !IS_INCLUDES&&-1;var value,index=toAbsoluteIndex(fromIndex,length);if(IS_INCLUDES&&el!=el){for(;length>index;)if((value=O[index++])!=value)return true}else for(;length>index;index++)if((IS_INCLUDES||index in O)&&O[index]===el)return IS_INCLUDES||index||0;return !IS_INCLUDES&&-1}};return arrayIncludes={includes:createMethod(true),indexOf:createMethod(false)}}().indexOf,hiddenKeys=requireHiddenKeys(),push=uncurryThis([].push);return objectKeysInternal=function(object,names){var key,O=toIndexedObject(object),i=0,result=[];for(key in O)!hasOwn(hiddenKeys,key)&&hasOwn(O,key)&&push(result,key);for(;names.length>i;)hasOwn(O,key=names[i++])&&(~indexOf(result,key)||push(result,key));return result}}function requireEnumBugKeys(){return hasRequiredEnumBugKeys?enumBugKeys:(hasRequiredEnumBugKeys=1,enumBugKeys=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var hasRequiredObjectGetOwnPropertySymbols,ownKeys,hasRequiredOwnKeys,copyConstructorProperties,hasRequiredCopyConstructorProperties,isForced_1,hasRequiredIsForced,_export,hasRequired_export,functionApply,hasRequiredFunctionApply,hasRequiredEs_reflect_apply,objectGetOwnPropertySymbols={};function requireOwnKeys(){if(hasRequiredOwnKeys)return ownKeys;hasRequiredOwnKeys=1;var getBuiltIn=requireGetBuiltIn(),uncurryThis=requireFunctionUncurryThis(),getOwnPropertyNamesModule=function(){if(hasRequiredObjectGetOwnPropertyNames)return objectGetOwnPropertyNames;hasRequiredObjectGetOwnPropertyNames=1;var internalObjectKeys=requireObjectKeysInternal(),hiddenKeys=requireEnumBugKeys().concat("length","prototype");return objectGetOwnPropertyNames.f=Object.getOwnPropertyNames||function(O){return internalObjectKeys(O,hiddenKeys)},objectGetOwnPropertyNames}(),getOwnPropertySymbolsModule=(hasRequiredObjectGetOwnPropertySymbols||(hasRequiredObjectGetOwnPropertySymbols=1,objectGetOwnPropertySymbols.f=Object.getOwnPropertySymbols),objectGetOwnPropertySymbols),anObject=requireAnObject(),concat=uncurryThis([].concat);return ownKeys=getBuiltIn("Reflect","ownKeys")||function(it){var keys=getOwnPropertyNamesModule.f(anObject(it)),getOwnPropertySymbols=getOwnPropertySymbolsModule.f;return getOwnPropertySymbols?concat(keys,getOwnPropertySymbols(it)):keys}}function requireCopyConstructorProperties(){if(hasRequiredCopyConstructorProperties)return copyConstructorProperties;hasRequiredCopyConstructorProperties=1;var hasOwn=requireHasOwnProperty(),ownKeys=requireOwnKeys(),getOwnPropertyDescriptorModule=requireObjectGetOwnPropertyDescriptor(),definePropertyModule=requireObjectDefineProperty();return copyConstructorProperties=function(target,source,exceptions){for(var keys=ownKeys(source),defineProperty=definePropertyModule.f,getOwnPropertyDescriptor=getOwnPropertyDescriptorModule.f,i=0;i<keys.length;i++){var key=keys[i];hasOwn(target,key)||exceptions&&hasOwn(exceptions,key)||defineProperty(target,key,getOwnPropertyDescriptor(source,key));}}}function require_export(){if(hasRequired_export)return _export;hasRequired_export=1;var globalThis=requireGlobalThis(),getOwnPropertyDescriptor=requireObjectGetOwnPropertyDescriptor().f,createNonEnumerableProperty=requireCreateNonEnumerableProperty(),defineBuiltIn=requireDefineBuiltIn(),defineGlobalProperty=requireDefineGlobalProperty(),copyConstructorProperties=requireCopyConstructorProperties(),isForced=function(){if(hasRequiredIsForced)return isForced_1;hasRequiredIsForced=1;var fails=requireFails(),isCallable=requireIsCallable(),replacement=/#|\.prototype\./,isForced=function(feature,detection){var value=data[normalize(feature)];return value===POLYFILL||value!==NATIVE&&(isCallable(detection)?fails(detection):!!detection)},normalize=isForced.normalize=function(string){return String(string).replace(replacement,".").toLowerCase()},data=isForced.data={},NATIVE=isForced.NATIVE="N",POLYFILL=isForced.POLYFILL="P";return isForced_1=isForced}();return _export=function(options,source){var target,key,targetProperty,sourceProperty,descriptor,TARGET=options.target,GLOBAL=options.global,STATIC=options.stat;if(target=GLOBAL?globalThis:STATIC?globalThis[TARGET]||defineGlobalProperty(TARGET,{}):globalThis[TARGET]&&globalThis[TARGET].prototype)for(key in source){if(sourceProperty=source[key],targetProperty=options.dontCallGetSet?(descriptor=getOwnPropertyDescriptor(target,key))&&descriptor.value:target[key],!isForced(GLOBAL?key:TARGET+(STATIC?".":"#")+key,options.forced)&&void 0!==targetProperty){if(typeof sourceProperty==typeof targetProperty)continue;copyConstructorProperties(sourceProperty,targetProperty);}(options.sham||targetProperty&&targetProperty.sham)&&createNonEnumerableProperty(sourceProperty,"sham",true),defineBuiltIn(target,key,sourceProperty,options);}}}function requireFunctionApply(){if(hasRequiredFunctionApply)return functionApply;hasRequiredFunctionApply=1;var NATIVE_BIND=requireFunctionBindNative(),FunctionPrototype=Function.prototype,apply=FunctionPrototype.apply,call=FunctionPrototype.call;return functionApply="object"==typeof Reflect&&Reflect.apply||(NATIVE_BIND?call.bind(apply):function(){return call.apply(apply,arguments)}),functionApply}var arraySlice,hasRequiredArraySlice,functionBind,hasRequiredFunctionBind,isConstructor,hasRequiredIsConstructor,aConstructor,hasRequiredAConstructor,es_reflect_construct={};function requireArraySlice(){if(hasRequiredArraySlice)return arraySlice;hasRequiredArraySlice=1;var uncurryThis=requireFunctionUncurryThis();return arraySlice=uncurryThis([].slice)}function requireFunctionBind(){if(hasRequiredFunctionBind)return functionBind;hasRequiredFunctionBind=1;var uncurryThis=requireFunctionUncurryThis(),aCallable=requireACallable(),isObject=requireIsObject(),hasOwn=requireHasOwnProperty(),arraySlice=requireArraySlice(),NATIVE_BIND=requireFunctionBindNative(),$Function=Function,concat=uncurryThis([].concat),join=uncurryThis([].join),factories={};return functionBind=NATIVE_BIND?$Function.bind:function(that){var F=aCallable(this),Prototype=F.prototype,partArgs=arraySlice(arguments,1),boundFunction=function(){var args=concat(partArgs,arraySlice(arguments));return this instanceof boundFunction?function(C,argsLength,args){if(!hasOwn(factories,argsLength)){for(var list=[],i=0;i<argsLength;i++)list[i]="a["+i+"]";factories[argsLength]=$Function("C,a","return new C("+join(list,",")+")");}return factories[argsLength](C,args)}(F,args.length,args):F.apply(that,args)};return isObject(Prototype)&&(boundFunction.prototype=Prototype),boundFunction},functionBind}function requireIsConstructor(){if(hasRequiredIsConstructor)return isConstructor;hasRequiredIsConstructor=1;var uncurryThis=requireFunctionUncurryThis(),fails=requireFails(),isCallable=requireIsCallable(),classof=requireClassof(),getBuiltIn=requireGetBuiltIn(),inspectSource=requireInspectSource(),noop=function(){},construct=getBuiltIn("Reflect","construct"),constructorRegExp=/^\s*(?:class|function)\b/,exec=uncurryThis(constructorRegExp.exec),INCORRECT_TO_STRING=!constructorRegExp.test(noop),isConstructorModern=function(argument){if(!isCallable(argument))return false;try{return construct(noop,[],argument),!0}catch(error){return false}},isConstructorLegacy=function(argument){if(!isCallable(argument))return false;switch(classof(argument)){case "AsyncFunction":case "GeneratorFunction":case "AsyncGeneratorFunction":return false}try{return INCORRECT_TO_STRING||!!exec(constructorRegExp,inspectSource(argument))}catch(error){return true}};return isConstructorLegacy.sham=true,isConstructor=!construct||fails((function(){var called;return isConstructorModern(isConstructorModern.call)||!isConstructorModern(Object)||!isConstructorModern((function(){called=true;}))||called}))?isConstructorLegacy:isConstructorModern}function requireAConstructor(){if(hasRequiredAConstructor)return aConstructor;hasRequiredAConstructor=1;var isConstructor=requireIsConstructor(),tryToString=requireTryToString(),$TypeError=TypeError;return aConstructor=function(argument){if(isConstructor(argument))return argument;throw new $TypeError(tryToString(argument)+" is not a constructor")}}var objectKeys,hasRequiredObjectKeys,hasRequiredObjectDefineProperties,html,hasRequiredHtml,objectCreate,hasRequiredObjectCreate,hasRequiredEs_reflect_construct,objectDefineProperties={};function requireObjectKeys(){if(hasRequiredObjectKeys)return objectKeys;hasRequiredObjectKeys=1;var internalObjectKeys=requireObjectKeysInternal(),enumBugKeys=requireEnumBugKeys();return objectKeys=Object.keys||function(O){return internalObjectKeys(O,enumBugKeys)}}function requireHtml(){if(hasRequiredHtml)return html;hasRequiredHtml=1;var getBuiltIn=requireGetBuiltIn();return html=getBuiltIn("document","documentElement")}function requireObjectCreate(){if(hasRequiredObjectCreate)return objectCreate;hasRequiredObjectCreate=1;var activeXDocument,anObject=requireAnObject(),definePropertiesModule=function(){if(hasRequiredObjectDefineProperties)return objectDefineProperties;hasRequiredObjectDefineProperties=1;var DESCRIPTORS=requireDescriptors(),V8_PROTOTYPE_DEFINE_BUG=requireV8PrototypeDefineBug(),definePropertyModule=requireObjectDefineProperty(),anObject=requireAnObject(),toIndexedObject=requireToIndexedObject(),objectKeys=requireObjectKeys();return objectDefineProperties.f=DESCRIPTORS&&!V8_PROTOTYPE_DEFINE_BUG?Object.defineProperties:function(O,Properties){anObject(O);for(var key,props=toIndexedObject(Properties),keys=objectKeys(Properties),length=keys.length,index=0;length>index;)definePropertyModule.f(O,key=keys[index++],props[key]);return O},objectDefineProperties}(),enumBugKeys=requireEnumBugKeys(),hiddenKeys=requireHiddenKeys(),html=requireHtml(),documentCreateElement=requireDocumentCreateElement(),sharedKey=requireSharedKey(),IE_PROTO=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(content){return "<script>"+content+"<\/script>"},NullProtoObjectViaActiveX=function(activeXDocument){activeXDocument.write(scriptTag("")),activeXDocument.close();var temp=activeXDocument.parentWindow.Object;return activeXDocument=null,temp},NullProtoObject=function(){try{activeXDocument=new ActiveXObject("htmlfile");}catch(error){}var iframeDocument,iframe;NullProtoObject="undefined"!=typeof document?document.domain&&activeXDocument?NullProtoObjectViaActiveX(activeXDocument):((iframe=documentCreateElement("iframe")).style.display="none",html.appendChild(iframe),iframe.src=String("javascript:"),(iframeDocument=iframe.contentWindow.document).open(),iframeDocument.write(scriptTag("document.F=Object")),iframeDocument.close(),iframeDocument.F):NullProtoObjectViaActiveX(activeXDocument);for(var length=enumBugKeys.length;length--;)delete NullProtoObject.prototype[enumBugKeys[length]];return NullProtoObject()};return hiddenKeys[IE_PROTO]=true,objectCreate=Object.create||function(O,Properties){var result;return null!==O?(EmptyConstructor.prototype=anObject(O),result=new EmptyConstructor,EmptyConstructor.prototype=null,result[IE_PROTO]=O):result=NullProtoObject(),void 0===Properties?result:definePropertiesModule.f(result,Properties)}}var hasRequiredEs_reflect_defineProperty,es_reflect_defineProperty={};var hasRequiredEs_reflect_deleteProperty,es_reflect_deleteProperty={};var isDataDescriptor,hasRequiredIsDataDescriptor,correctPrototypeGetter,hasRequiredCorrectPrototypeGetter,objectGetPrototypeOf,hasRequiredObjectGetPrototypeOf,hasRequiredEs_reflect_get,es_reflect_get={};function requireIsDataDescriptor(){if(hasRequiredIsDataDescriptor)return isDataDescriptor;hasRequiredIsDataDescriptor=1;var hasOwn=requireHasOwnProperty();return isDataDescriptor=function(descriptor){return void 0!==descriptor&&(hasOwn(descriptor,"value")||hasOwn(descriptor,"writable"))}}function requireCorrectPrototypeGetter(){if(hasRequiredCorrectPrototypeGetter)return correctPrototypeGetter;hasRequiredCorrectPrototypeGetter=1;var fails=requireFails();return correctPrototypeGetter=!fails((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype}))}function requireObjectGetPrototypeOf(){if(hasRequiredObjectGetPrototypeOf)return objectGetPrototypeOf;hasRequiredObjectGetPrototypeOf=1;var hasOwn=requireHasOwnProperty(),isCallable=requireIsCallable(),toObject=requireToObject(),sharedKey=requireSharedKey(),CORRECT_PROTOTYPE_GETTER=requireCorrectPrototypeGetter(),IE_PROTO=sharedKey("IE_PROTO"),$Object=Object,ObjectPrototype=$Object.prototype;return objectGetPrototypeOf=CORRECT_PROTOTYPE_GETTER?$Object.getPrototypeOf:function(O){var object=toObject(O);if(hasOwn(object,IE_PROTO))return object[IE_PROTO];var constructor=object.constructor;return isCallable(constructor)&&object instanceof constructor?constructor.prototype:object instanceof $Object?ObjectPrototype:null}}var hasRequiredEs_reflect_getOwnPropertyDescriptor,es_reflect_getOwnPropertyDescriptor={};var hasRequiredEs_reflect_getPrototypeOf,es_reflect_getPrototypeOf={};var hasRequiredEs_reflect_has;var arrayBufferNonExtensible,hasRequiredArrayBufferNonExtensible,objectIsExtensible,hasRequiredObjectIsExtensible,hasRequiredEs_reflect_isExtensible,es_reflect_isExtensible={};function requireObjectIsExtensible(){if(hasRequiredObjectIsExtensible)return objectIsExtensible;hasRequiredObjectIsExtensible=1;var fails=requireFails(),isObject=requireIsObject(),classof=requireClassofRaw(),ARRAY_BUFFER_NON_EXTENSIBLE=function(){if(hasRequiredArrayBufferNonExtensible)return arrayBufferNonExtensible;hasRequiredArrayBufferNonExtensible=1;var fails=requireFails();return arrayBufferNonExtensible=fails((function(){if("function"==typeof ArrayBuffer){var buffer=new ArrayBuffer(8);Object.isExtensible(buffer)&&Object.defineProperty(buffer,"a",{value:8});}}))}(),$isExtensible=Object.isExtensible,FAILS_ON_PRIMITIVES=fails((function(){}));return objectIsExtensible=FAILS_ON_PRIMITIVES||ARRAY_BUFFER_NON_EXTENSIBLE?function(it){return !!isObject(it)&&((!ARRAY_BUFFER_NON_EXTENSIBLE||"ArrayBuffer"!==classof(it))&&(!$isExtensible||$isExtensible(it)))}:$isExtensible}var hasRequiredEs_reflect_ownKeys;var freezing,hasRequiredFreezing,hasRequiredEs_reflect_preventExtensions,es_reflect_preventExtensions={};function requireEs_reflect_preventExtensions(){if(hasRequiredEs_reflect_preventExtensions)return es_reflect_preventExtensions;hasRequiredEs_reflect_preventExtensions=1;var $=require_export(),getBuiltIn=requireGetBuiltIn(),anObject=requireAnObject(),FREEZING=function(){if(hasRequiredFreezing)return freezing;hasRequiredFreezing=1;var fails=requireFails();return freezing=!fails((function(){return Object.isExtensible(Object.preventExtensions({}))}))}();return $({target:"Reflect",stat:true,sham:!FREEZING},{preventExtensions:function(target){anObject(target);try{var objectPreventExtensions=getBuiltIn("Object","preventExtensions");return objectPreventExtensions&&objectPreventExtensions(target),!0}catch(error){return false}}}),es_reflect_preventExtensions}var hasRequiredEs_reflect_set,es_reflect_set={};var isPossiblePrototype,hasRequiredIsPossiblePrototype,aPossiblePrototype,hasRequiredAPossiblePrototype,functionUncurryThisAccessor,hasRequiredFunctionUncurryThisAccessor,objectSetPrototypeOf,hasRequiredObjectSetPrototypeOf,hasRequiredEs_reflect_setPrototypeOf,es_reflect_setPrototypeOf={};function requireIsPossiblePrototype(){if(hasRequiredIsPossiblePrototype)return isPossiblePrototype;hasRequiredIsPossiblePrototype=1;var isObject=requireIsObject();return isPossiblePrototype=function(argument){return isObject(argument)||null===argument}}function requireAPossiblePrototype(){if(hasRequiredAPossiblePrototype)return aPossiblePrototype;hasRequiredAPossiblePrototype=1;var isPossiblePrototype=requireIsPossiblePrototype(),$String=String,$TypeError=TypeError;return aPossiblePrototype=function(argument){if(isPossiblePrototype(argument))return argument;throw new $TypeError("Can't set "+$String(argument)+" as a prototype")}}function requireObjectSetPrototypeOf(){if(hasRequiredObjectSetPrototypeOf)return objectSetPrototypeOf;hasRequiredObjectSetPrototypeOf=1;var uncurryThisAccessor=function(){if(hasRequiredFunctionUncurryThisAccessor)return functionUncurryThisAccessor;hasRequiredFunctionUncurryThisAccessor=1;var uncurryThis=requireFunctionUncurryThis(),aCallable=requireACallable();return functionUncurryThisAccessor=function(object,key,method){try{return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object,key)[method]))}catch(error){}}}(),isObject=requireIsObject(),requireObjectCoercible=requireRequireObjectCoercible(),aPossiblePrototype=requireAPossiblePrototype();return objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var setter,CORRECT_SETTER=false,test={};try{(setter=uncurryThisAccessor(Object.prototype,"__proto__","set"))(test,[]),CORRECT_SETTER=test instanceof Array;}catch(error){}return function(O,proto){return requireObjectCoercible(O),aPossiblePrototype(proto),isObject(O)?(CORRECT_SETTER?setter(O,proto):O.__proto__=proto,O):O}}():void 0)}var setToStringTag,hasRequiredSetToStringTag,hasRequiredEs_reflect_toStringTag,path,hasRequiredPath,reflect$1,hasRequiredReflect$1,reflect,hasRequiredReflect,es_reflect_toStringTag={};function requireSetToStringTag(){if(hasRequiredSetToStringTag)return setToStringTag;hasRequiredSetToStringTag=1;var defineProperty=requireObjectDefineProperty().f,hasOwn=requireHasOwnProperty(),TO_STRING_TAG=requireWellKnownSymbol()("toStringTag");return setToStringTag=function(target,TAG,STATIC){target&&!STATIC&&(target=target.prototype),target&&!hasOwn(target,TO_STRING_TAG)&&defineProperty(target,TO_STRING_TAG,{configurable:true,value:TAG});}}function requirePath(){if(hasRequiredPath)return path;hasRequiredPath=1;var globalThis=requireGlobalThis();return path=globalThis}function requireReflect$1(){if(hasRequiredReflect$1)return reflect$1;hasRequiredReflect$1=1,requireEs_object_toString(),function(){if(hasRequiredEs_reflect_apply)return es_reflect_apply;hasRequiredEs_reflect_apply=1;var $=require_export(),functionApply=requireFunctionApply(),aCallable=requireACallable(),anObject=requireAnObject();$({target:"Reflect",stat:true,forced:!requireFails()((function(){Reflect.apply((function(){}));}))},{apply:function(target,thisArgument,argumentsList){return functionApply(aCallable(target),thisArgument,anObject(argumentsList))}});}(),function(){if(hasRequiredEs_reflect_construct)return es_reflect_construct;hasRequiredEs_reflect_construct=1;var $=require_export(),getBuiltIn=requireGetBuiltIn(),apply=requireFunctionApply(),bind=requireFunctionBind(),aConstructor=requireAConstructor(),anObject=requireAnObject(),isObject=requireIsObject(),create=requireObjectCreate(),fails=requireFails(),nativeConstruct=getBuiltIn("Reflect","construct"),ObjectPrototype=Object.prototype,push=[].push,NEW_TARGET_BUG=fails((function(){function F(){}return !(nativeConstruct((function(){}),[],F)instanceof F)})),ARGS_BUG=!fails((function(){nativeConstruct((function(){}));})),FORCED=NEW_TARGET_BUG||ARGS_BUG;$({target:"Reflect",stat:true,forced:FORCED,sham:FORCED},{construct:function(Target,args){aConstructor(Target),anObject(args);var newTarget=arguments.length<3?Target:aConstructor(arguments[2]);if(ARGS_BUG&&!NEW_TARGET_BUG)return nativeConstruct(Target,args,newTarget);if(Target===newTarget){switch(args.length){case 0:return new Target;case 1:return new Target(args[0]);case 2:return new Target(args[0],args[1]);case 3:return new Target(args[0],args[1],args[2]);case 4:return new Target(args[0],args[1],args[2],args[3])}var $args=[null];return apply(push,$args,args),new(apply(bind,Target,$args))}var proto=newTarget.prototype,instance=create(isObject(proto)?proto:ObjectPrototype),result=apply(Target,instance,args);return isObject(result)?result:instance}});}(),function(){if(hasRequiredEs_reflect_defineProperty)return es_reflect_defineProperty;hasRequiredEs_reflect_defineProperty=1;var $=require_export(),DESCRIPTORS=requireDescriptors(),anObject=requireAnObject(),toPropertyKey=requireToPropertyKey(),definePropertyModule=requireObjectDefineProperty();$({target:"Reflect",stat:true,forced:requireFails()((function(){Reflect.defineProperty(definePropertyModule.f({},1,{value:1}),1,{value:2});})),sham:!DESCRIPTORS},{defineProperty:function(target,propertyKey,attributes){anObject(target);var key=toPropertyKey(propertyKey);anObject(attributes);try{return definePropertyModule.f(target,key,attributes),!0}catch(error){return false}}});}(),function(){if(hasRequiredEs_reflect_deleteProperty)return es_reflect_deleteProperty;hasRequiredEs_reflect_deleteProperty=1;var $=require_export(),anObject=requireAnObject(),getOwnPropertyDescriptor=requireObjectGetOwnPropertyDescriptor().f;$({target:"Reflect",stat:true},{deleteProperty:function(target,propertyKey){var descriptor=getOwnPropertyDescriptor(anObject(target),propertyKey);return !(descriptor&&!descriptor.configurable)&&delete target[propertyKey]}});}(),function(){if(hasRequiredEs_reflect_get)return es_reflect_get;hasRequiredEs_reflect_get=1;var $=require_export(),call=requireFunctionCall(),isObject=requireIsObject(),anObject=requireAnObject(),isDataDescriptor=requireIsDataDescriptor(),getOwnPropertyDescriptorModule=requireObjectGetOwnPropertyDescriptor(),getPrototypeOf=requireObjectGetPrototypeOf();$({target:"Reflect",stat:true},{get:function get(target,propertyKey){var descriptor,prototype,receiver=arguments.length<3?target:arguments[2];return anObject(target)===receiver?target[propertyKey]:(descriptor=getOwnPropertyDescriptorModule.f(target,propertyKey))?isDataDescriptor(descriptor)?descriptor.value:void 0===descriptor.get?void 0:call(descriptor.get,receiver):isObject(prototype=getPrototypeOf(target))?get(prototype,propertyKey,receiver):void 0}});}(),function(){if(hasRequiredEs_reflect_getOwnPropertyDescriptor)return es_reflect_getOwnPropertyDescriptor;hasRequiredEs_reflect_getOwnPropertyDescriptor=1;var $=require_export(),DESCRIPTORS=requireDescriptors(),anObject=requireAnObject(),getOwnPropertyDescriptorModule=requireObjectGetOwnPropertyDescriptor();$({target:"Reflect",stat:true,sham:!DESCRIPTORS},{getOwnPropertyDescriptor:function(target,propertyKey){return getOwnPropertyDescriptorModule.f(anObject(target),propertyKey)}});}(),function(){if(hasRequiredEs_reflect_getPrototypeOf)return es_reflect_getPrototypeOf;hasRequiredEs_reflect_getPrototypeOf=1;var $=require_export(),anObject=requireAnObject(),objectGetPrototypeOf=requireObjectGetPrototypeOf();$({target:"Reflect",stat:true,sham:!requireCorrectPrototypeGetter()},{getPrototypeOf:function(target){return objectGetPrototypeOf(anObject(target))}});}(),hasRequiredEs_reflect_has||(hasRequiredEs_reflect_has=1,require_export()({target:"Reflect",stat:true},{has:function(target,propertyKey){return propertyKey in target}})),function(){if(hasRequiredEs_reflect_isExtensible)return es_reflect_isExtensible;hasRequiredEs_reflect_isExtensible=1;var $=require_export(),anObject=requireAnObject(),$isExtensible=requireObjectIsExtensible();$({target:"Reflect",stat:true},{isExtensible:function(target){return anObject(target),$isExtensible(target)}});}(),hasRequiredEs_reflect_ownKeys||(hasRequiredEs_reflect_ownKeys=1,require_export()({target:"Reflect",stat:true},{ownKeys:requireOwnKeys()})),requireEs_reflect_preventExtensions(),function(){if(hasRequiredEs_reflect_set)return es_reflect_set;hasRequiredEs_reflect_set=1;var $=require_export(),call=requireFunctionCall(),anObject=requireAnObject(),isObject=requireIsObject(),isDataDescriptor=requireIsDataDescriptor(),fails=requireFails(),definePropertyModule=requireObjectDefineProperty(),getOwnPropertyDescriptorModule=requireObjectGetOwnPropertyDescriptor(),getPrototypeOf=requireObjectGetPrototypeOf(),createPropertyDescriptor=requireCreatePropertyDescriptor();$({target:"Reflect",stat:true,forced:fails((function(){var Constructor=function(){},object=definePropertyModule.f(new Constructor,"a",{configurable:true});return false!==Reflect.set(Constructor.prototype,"a",1,object)}))},{set:function set(target,propertyKey,V){var existingDescriptor,prototype,setter,receiver=arguments.length<4?target:arguments[3],ownDescriptor=getOwnPropertyDescriptorModule.f(anObject(target),propertyKey);if(!ownDescriptor){if(isObject(prototype=getPrototypeOf(target)))return set(prototype,propertyKey,V,receiver);ownDescriptor=createPropertyDescriptor(0);}if(isDataDescriptor(ownDescriptor)){if(false===ownDescriptor.writable||!isObject(receiver))return false;if(existingDescriptor=getOwnPropertyDescriptorModule.f(receiver,propertyKey)){if(existingDescriptor.get||existingDescriptor.set||false===existingDescriptor.writable)return false;existingDescriptor.value=V,definePropertyModule.f(receiver,propertyKey,existingDescriptor);}else definePropertyModule.f(receiver,propertyKey,createPropertyDescriptor(0,V));}else {if(void 0===(setter=ownDescriptor.set))return false;call(setter,receiver,V);}return true}});}(),function(){if(hasRequiredEs_reflect_setPrototypeOf)return es_reflect_setPrototypeOf;hasRequiredEs_reflect_setPrototypeOf=1;var $=require_export(),anObject=requireAnObject(),aPossiblePrototype=requireAPossiblePrototype(),objectSetPrototypeOf=requireObjectSetPrototypeOf();objectSetPrototypeOf&&$({target:"Reflect",stat:true},{setPrototypeOf:function(target,proto){anObject(target),aPossiblePrototype(proto);try{return objectSetPrototypeOf(target,proto),!0}catch(error){return false}}});}(),function(){if(hasRequiredEs_reflect_toStringTag)return es_reflect_toStringTag;hasRequiredEs_reflect_toStringTag=1;var $=require_export(),globalThis=requireGlobalThis(),setToStringTag=requireSetToStringTag();$({global:true},{Reflect:{}}),setToStringTag(globalThis.Reflect,"Reflect",true);}();var path=requirePath();return reflect$1=path.Reflect}!function(){if(hasRequiredReflect)return reflect;hasRequiredReflect=1;var parent=requireReflect$1();reflect=parent;}();var _$LoggerStyle$_={info:"",log:"background: #4096ff; color: #FFF;",warn:"background: yellow; color: #FFF;",error:"background: red; color: #FFF;"},LoggerCls=function(){function LoggerCls(options){ void 0===options&&(options={}),this._options={level:"INFO",showTime:false},this._levelNum=3,this.info=this._loggerFactory("info",this._levelNum>=3),this.log=this._loggerFactory("log",this._levelNum>=2),this.warn=this._loggerFactory("warn",this._levelNum>=1),this.error=this._loggerFactory("error",this._levelNum>=0),this.setOptions(options);}var _proto=LoggerCls.prototype;return _proto.setOptions=function(options){var _this__options_level;this._options=Object.assign({},this._options,options),this._levelNum=this._matchLevel(null!=(_this__options_level=this._options.level)?_this__options_level:"INFO"),this.info=this._loggerFactory("info",this._levelNum>=3),this.log=this._loggerFactory("log",this._levelNum>=2),this.warn=this._loggerFactory("warn",this._levelNum>=1),this.error=this._loggerFactory("error",this._levelNum>=0);},_proto._matchLevel=function(level){var logLevel=3;switch(level){case "INFO":logLevel=3;break;case "LOG":logLevel=2;break;case "WARN":logLevel=1;break;case "ERROR":logLevel=0;}return logLevel},_proto._loggerFactory=function(type,bool){var fn=console[type];if(bool&&fn){var _fn,args0=this._options.name?"%c["+this._options.name+"]%c %c["+type.toUpperCase()+"]":"%c["+type.toUpperCase()+"]",color=[this._options.name?"background: green;color: #fff":null,this._options.name?"":null,_$LoggerStyle$_[type]].filter((function(color){return null!=color}));return (_fn=fn).bind.apply(_fn,[].concat([console,args0],color))}return LoggerCls.noop},_proto.getOptions=function(){return this._options},_proto.getVersion=function(){return "2.0.0"},LoggerCls}();function __$fillTen(num){return (num=+num)<10&&(num="0"+num),num+""}LoggerCls.noop=function(){},LoggerCls.VERSION="2.0.0";var __$CONSOLE_LIST$__=["info","log","warn","error"];dist$2=function(options){var logger=new LoggerCls(options);return new Proxy(logger,{get:function(target,prop){if(__$CONSOLE_LIST$__.includes(prop)){var _target__options;if(null==(_target__options=target._options)?void 0:_target__options.showTime){var time=(now=new Date(Date.now()),year=now.getFullYear(),month=now.getMonth()+1,day=now.getDate(),hour=now.getHours(),min=now.getMinutes(),sec=now.getSeconds(),ms=now.getMilliseconds(),year+"/"+__$fillTen(month)+"/"+__$fillTen(day)+" "+__$fillTen(hour)+":"+__$fillTen(min)+":"+__$fillTen(sec)+":"+ms);return target[prop].bind(console,"["+time+"]")}return target[prop].bind(console)}var now,year,month,day,hour,min,sec,ms;return Reflect.get(target,prop)}})};
|
|
4136
|
+
return dist$2;
|
|
4274
4137
|
}
|
|
4275
4138
|
|
|
4276
|
-
var distExports$
|
|
4277
|
-
var Logger = /*@__PURE__*/getDefaultExportFromCjs(distExports$
|
|
4139
|
+
var distExports$2 = requireDist$2();
|
|
4140
|
+
var Logger = /*@__PURE__*/getDefaultExportFromCjs(distExports$2);
|
|
4278
4141
|
|
|
4279
4142
|
var zh = {
|
|
4280
4143
|
391001: '取流地址或端口非法',
|
|
@@ -5435,14 +5298,14 @@
|
|
|
5435
5298
|
configurable: true
|
|
5436
5299
|
}
|
|
5437
5300
|
});
|
|
5438
|
-
if (superClass) _set_prototype_of$
|
|
5301
|
+
if (superClass) _set_prototype_of$o(subClass, superClass);
|
|
5439
5302
|
}
|
|
5440
|
-
function _set_prototype_of$
|
|
5441
|
-
_set_prototype_of$
|
|
5303
|
+
function _set_prototype_of$o(o, p) {
|
|
5304
|
+
_set_prototype_of$o = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
5442
5305
|
o.__proto__ = p;
|
|
5443
5306
|
return o;
|
|
5444
5307
|
};
|
|
5445
|
-
return _set_prototype_of$
|
|
5308
|
+
return _set_prototype_of$o(o, p);
|
|
5446
5309
|
}
|
|
5447
5310
|
/**
|
|
5448
5311
|
* 截图控件
|
|
@@ -5563,8 +5426,8 @@
|
|
|
5563
5426
|
return Content;
|
|
5564
5427
|
}(EventEmitter);
|
|
5565
5428
|
|
|
5566
|
-
function _extends$
|
|
5567
|
-
_extends$
|
|
5429
|
+
function _extends$n() {
|
|
5430
|
+
_extends$n = Object.assign || function(target) {
|
|
5568
5431
|
for(var i = 1; i < arguments.length; i++){
|
|
5569
5432
|
var source = arguments[i];
|
|
5570
5433
|
for(var key in source){
|
|
@@ -5575,7 +5438,7 @@
|
|
|
5575
5438
|
}
|
|
5576
5439
|
return target;
|
|
5577
5440
|
};
|
|
5578
|
-
return _extends$
|
|
5441
|
+
return _extends$n.apply(this, arguments);
|
|
5579
5442
|
}
|
|
5580
5443
|
function _inherits$k(subClass, superClass) {
|
|
5581
5444
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -5588,14 +5451,14 @@
|
|
|
5588
5451
|
configurable: true
|
|
5589
5452
|
}
|
|
5590
5453
|
});
|
|
5591
|
-
if (superClass) _set_prototype_of$
|
|
5454
|
+
if (superClass) _set_prototype_of$n(subClass, superClass);
|
|
5592
5455
|
}
|
|
5593
|
-
function _set_prototype_of$
|
|
5594
|
-
_set_prototype_of$
|
|
5456
|
+
function _set_prototype_of$n(o, p) {
|
|
5457
|
+
_set_prototype_of$n = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
5595
5458
|
o.__proto__ = p;
|
|
5596
5459
|
return o;
|
|
5597
5460
|
};
|
|
5598
|
-
return _set_prototype_of$
|
|
5461
|
+
return _set_prototype_of$n(o, p);
|
|
5599
5462
|
}
|
|
5600
5463
|
/**
|
|
5601
5464
|
* 更多控件
|
|
@@ -5604,7 +5467,7 @@
|
|
|
5604
5467
|
_inherits$k(More, Control);
|
|
5605
5468
|
function More(options) {
|
|
5606
5469
|
var _this;
|
|
5607
|
-
_this = Control.call(this, _extends$
|
|
5470
|
+
_this = Control.call(this, _extends$n({}, options, {
|
|
5608
5471
|
tagName: 'span',
|
|
5609
5472
|
controlType: 'button',
|
|
5610
5473
|
classNameSuffix: 'more'
|
|
@@ -6231,12 +6094,12 @@
|
|
|
6231
6094
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
6232
6095
|
}
|
|
6233
6096
|
}
|
|
6234
|
-
function _create_class$
|
|
6097
|
+
function _create_class$b(Constructor, protoProps, staticProps) {
|
|
6235
6098
|
if (protoProps) _defineProperties$5(Constructor.prototype, protoProps);
|
|
6236
6099
|
return Constructor;
|
|
6237
6100
|
}
|
|
6238
|
-
function _extends$
|
|
6239
|
-
_extends$
|
|
6101
|
+
function _extends$m() {
|
|
6102
|
+
_extends$m = Object.assign || function(target) {
|
|
6240
6103
|
for(var i = 1; i < arguments.length; i++){
|
|
6241
6104
|
var source = arguments[i];
|
|
6242
6105
|
for(var key in source){
|
|
@@ -6247,7 +6110,7 @@
|
|
|
6247
6110
|
}
|
|
6248
6111
|
return target;
|
|
6249
6112
|
};
|
|
6250
|
-
return _extends$
|
|
6113
|
+
return _extends$m.apply(this, arguments);
|
|
6251
6114
|
}
|
|
6252
6115
|
function _inherits$j(subClass, superClass) {
|
|
6253
6116
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -6260,14 +6123,14 @@
|
|
|
6260
6123
|
configurable: true
|
|
6261
6124
|
}
|
|
6262
6125
|
});
|
|
6263
|
-
if (superClass) _set_prototype_of$
|
|
6126
|
+
if (superClass) _set_prototype_of$m(subClass, superClass);
|
|
6264
6127
|
}
|
|
6265
|
-
function _set_prototype_of$
|
|
6266
|
-
_set_prototype_of$
|
|
6128
|
+
function _set_prototype_of$m(o, p) {
|
|
6129
|
+
_set_prototype_of$m = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
6267
6130
|
o.__proto__ = p;
|
|
6268
6131
|
return o;
|
|
6269
6132
|
};
|
|
6270
|
-
return _set_prototype_of$
|
|
6133
|
+
return _set_prototype_of$m(o, p);
|
|
6271
6134
|
}
|
|
6272
6135
|
var ZOOM_DEFAULT_OPTIONS = {
|
|
6273
6136
|
open: false,
|
|
@@ -6280,7 +6143,7 @@
|
|
|
6280
6143
|
_inherits$j(Zoom, Control);
|
|
6281
6144
|
function Zoom(options) {
|
|
6282
6145
|
var _this;
|
|
6283
|
-
_this = Control.call(this, _extends$
|
|
6146
|
+
_this = Control.call(this, _extends$m({}, options, {
|
|
6284
6147
|
tagName: 'span',
|
|
6285
6148
|
controlType: 'button',
|
|
6286
6149
|
classNameSuffix: 'zoom'
|
|
@@ -6358,7 +6221,7 @@
|
|
|
6358
6221
|
this.active = !this.active;
|
|
6359
6222
|
Control.prototype._onControlClick.call(this, e);
|
|
6360
6223
|
};
|
|
6361
|
-
_create_class$
|
|
6224
|
+
_create_class$b(Zoom, [
|
|
6362
6225
|
{
|
|
6363
6226
|
key: "value",
|
|
6364
6227
|
get: function get() {
|
|
@@ -6409,732 +6272,14 @@
|
|
|
6409
6272
|
}(Control);
|
|
6410
6273
|
|
|
6411
6274
|
/*
|
|
6412
|
-
* @ezuikit/control-zoom
|
|
6413
|
-
* Copyright (c) 2026-03
|
|
6275
|
+
* @ezuikit/control-zoom v1.0.0-beta.1
|
|
6276
|
+
* Copyright (c) 2026-05-03 Ezviz-OpenBiz
|
|
6414
6277
|
* Released under the MIT License.
|
|
6415
6278
|
*/
|
|
6279
|
+
function _create_class$a(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}var ZOOM_DEFAULT_POSITION=[0,0],DefaultOptions={initialZoom:1,defaultCursor:"pointer",scrollVelocity:.1,animDuration:.25,allowZoom:true,allowPan:true,onChange:function(){},onTranslateChange:function(){},onTap:function(){},max:8,min:1,zoomStep:.1,allowTouchEvents:false,allowWheel:true,ignoredMouseButtons:[],doubleTouchMaxDelay:300,decelerationDuration:750},Zoom=function(){function Zoom(container,options){var _this=this;this._dragging=false,this.destroy=function(){_this.setAllowZoom(false),_this.reset(),_this.removeEventListeners();},this.setTransform=function(trans){_this.transform=trans;},this.getTransform=function(){return _this.transform},this.updateTranslate=function(){var translateX=0,translateY=0;translateX=_this.percentPos[0]<0?_this.percentPos[0]<-0.5*(_this.zoom-1)?-0.5*(_this.zoom-1):_this.percentPos[0]:_this.percentPos[0]>.5*(_this.zoom-1)?.5*(_this.zoom-1):_this.percentPos[0],translateY=_this.percentPos[1]<0?_this.percentPos[1]<-0.5*(_this.zoom-1)?-0.5*(_this.zoom-1):_this.percentPos[1]:_this.percentPos[1]>.5*(_this.zoom-1)?.5*(_this.zoom-1):_this.percentPos[1],_this.percentPos=[translateX,translateY];},this.update=function(){_this.container&&(_this.updateTranslate(),_this.container.style.transition="transform ease-out "+_this.transition+"s",_this.container.style.transform="translate3d("+100*_this.percentPos[0]+"%, "+100*_this.percentPos[1]+"%, 0) scale("+_this.zoom+")");},this.setAllowZoom=function(allow){_this.options.allowZoom=allow;},this.setZoom=function(zoom,reset){zoom=parseFloat(zoom.toFixed(_this.getPrecision(_this.options.zoomStep))),_this.zoom!==zoom&&(_this.zoom=zoom,_this.update(),null==_this.options.onChange||_this.options.onChange.call(_this.options,+_this.zoom.toFixed(_this.getPrecision(_this.options.zoomStep)),reset));},this.getZoom=function(){return _this.zoom},this.setPos=function(pos){var _this_container,_this_container1,containerWidth=null==(_this_container=_this.container)?void 0:_this_container.clientWidth,containerHeight=null==(_this_container1=_this.container)?void 0:_this_container1.clientHeight;+_this.pos[0]===pos[0]&&+_this.pos[1]===pos[1]||(_this.percentPos=[pos[0]/containerWidth,pos[1]/containerHeight],_this.update(),null==_this.options.onTranslateChange||_this.options.onTranslateChange.call(_this.options,{posX:pos[0],posY:pos[1]}));},this.setTransitionDuration=function(duration){_this.transition=duration,_this.update();},this.setCursor=function(cursor){_this.container&&(_this.container.style.cssText+="cursor:"+cursor+";",_this.cursor=cursor);},this.zoomIn=function(value){var _this_options_max,_this_options_max1,newPosX=_this.pos[0],newPosY=_this.pos[1],prevZoom=_this.zoom,newZoom=prevZoom+value<(null!=(_this_options_max=_this.options.max)?_this_options_max:8)?prevZoom+value:null!=(_this_options_max1=_this.options.max)?_this_options_max1:8;newZoom!==prevZoom&&(newPosX=newPosX*(newZoom-1)/(prevZoom>1?prevZoom-1:prevZoom),newPosY=newPosY*(newZoom-1)/(prevZoom>1?prevZoom-1:prevZoom)),_this.setZoom(newZoom),_this.setPos([newPosX,newPosY]),_this.setTransitionDuration(_this.options.animDuration);},this.zoomOut=function(value){var _this_options_min,_this_options_min1,newPosX=_this.pos[0],newPosY=_this.pos[1],prevZoom=_this.zoom,newZoom=prevZoom-value>(null!=(_this_options_min=_this.options.min)?_this_options_min:1)?prevZoom-value:null!=(_this_options_min1=_this.options.min)?_this_options_min1:1;newZoom!==prevZoom&&(newPosX=newPosX*(newZoom-1)/(prevZoom-1),newPosY=newPosY*(newZoom-1)/(prevZoom-1)),_this.setZoom(newZoom),_this.setPos([newPosX,newPosY]),_this.setTransitionDuration(_this.options.animDuration);},this.zoomToZone=function(relX,relY,relWidth,relHeight){var _this_container;if(_this.container){var _this_options_max,newPosX=_this.pos[0],newPosY=_this.pos[1],parentRect=(null==(_this_container=_this.container)?void 0:_this_container.parentNode).getBoundingClientRect(),prevZoom=_this.zoom,optimalZoomX=parentRect.width/relWidth,optimalZoomY=parentRect.height/relHeight,newZoom=Math.min(optimalZoomX,optimalZoomY,null!=(_this_options_max=_this.options.max)?_this_options_max:8),rect=_this.container.getBoundingClientRect(),_ref=[rect.width/prevZoom/2,rect.height/prevZoom/2],_ref1=[relX+relWidth/2,relY+relHeight/2];newPosX=(_ref[0]-_ref1[0])*newZoom,newPosY=(_ref[1]-_ref1[1])*newZoom,_this.setZoom(newZoom),_this.setPos([newPosX,newPosY]),_this.setTransitionDuration(_this.options.animDuration);}},this.getNewPosition=function(x,y,newZoom){var prevZoom=[_this.zoom,_this.pos[0],_this.pos[1]][0];if(1===newZoom||!_this)return ZOOM_DEFAULT_POSITION;var _ref1=[_this.container.clientWidth,_this.container.clientHeight],clientWidth=_ref1[0],clientHeight=_ref1[1];if(newZoom>prevZoom)return [0,0];var w=-(x-clientWidth/2)/(clientWidth/2)*newZoom/2,h=-(y-clientHeight/2)/(clientHeight/2)*newZoom/2;return w>newZoom/2-.5&&(w=3.5),h>newZoom/2-.5&&(h=3.5),[clientWidth*w,clientHeight*h]},this.fullZoomInOnPosition=function(x,y){var _this_options_max,zoom=null!=(_this_options_max=_this.options.max)?_this_options_max:DefaultOptions.max;_this.setZoom(null!=zoom?zoom:DefaultOptions.max),_this.setPos(_this.getNewPosition(x,y,zoom)),_this.setTransitionDuration(_this.options.animDuration);},this.getLimitedShift=function(shift,minLimit,maxLimit,minElement,maxElement){if(shift>0){if(minElement>minLimit)return 0;if(minElement+shift>minLimit)return minLimit-minElement}else if(shift<0){if(maxElement<maxLimit)return 0;if(maxElement+shift<maxLimit)return maxLimit-maxElement}return shift},this.getCursor=function(canMoveOnX,canMoveOnY){return canMoveOnX&&canMoveOnY?"move":canMoveOnX?"ew-resize":canMoveOnY?"ns-resize":"auto"},this.move=function(shiftX,shiftY,transitionDuration){if(void 0===transitionDuration&&(transitionDuration=0),_this.container){var newPosX=_this.pos[0],newPosY=_this.pos[1],rect=_this.container.getBoundingClientRect(),parentRect=_this.container.parentNode.getBoundingClientRect(),shiftHorizontal=_this.transform?shiftY:shiftX,shiftVertical=_this.transform?shiftX:shiftY,_ref=_this.transform?[rect.height>parentRect.bottom-parentRect.top,shiftVertical>0&&rect.top-parentRect.top<0,shiftVertical<0&&rect.bottom-parentRect.bottom>0]:[rect.width>parentRect.right-parentRect.left,shiftHorizontal>0&&rect.left-parentRect.left<0,shiftHorizontal<0&&rect.right-parentRect.right>0],canMoveOnX=_ref[0]||_ref[1]||_ref[2];canMoveOnX&&(_this.transform?newPosX+=_this.getLimitedShift(shiftVertical,parentRect.top,parentRect.bottom,rect.top,rect.bottom):newPosX+=_this.getLimitedShift(shiftHorizontal,parentRect.left,parentRect.right,rect.left,rect.right));var _ref1=_this.transform?[rect.width>parentRect.right-parentRect.left,shiftHorizontal>0&&rect.right-parentRect.right<0,shiftHorizontal<0&&rect.left-parentRect.left>0]:[rect.height>parentRect.bottom-parentRect.top,shiftVertical>0&&rect.top-parentRect.top<0,shiftVertical<0&&rect.bottom-parentRect.bottom>0],canMoveOnY=_ref1[0]||_ref1[1]||_ref1[2];if(canMoveOnY)if(_this.transform){newPosY+=function(shift,minLimit,maxLimit,minElement,maxElement){if(shift>0){if(maxElement<maxLimit+1)return 0;if(maxElement+shift<maxLimit+1)return maxLimit-maxElement}else if(shift<0){if(minElement+1>minLimit)return 0;if(minElement+1+shift>minLimit)return minLimit-minElement}return shift}(shiftHorizontal,parentRect.left,parentRect.right,rect.left,rect.right);}else newPosY+=_this.getLimitedShift(shiftVertical,parentRect.top,parentRect.bottom,rect.top,rect.bottom);var cursor=_this.getCursor(canMoveOnX,canMoveOnY);_this.setPos([newPosX,newPosY]),_this.setCursor(cursor),_this.setTransitionDuration(transitionDuration);}},this.isDoubleTapping=function(){var _this_lastTouchTime,_this_options_doubleTouchMaxDelay,_this_lastDoubleTapTime,_this_options_doubleTouchMaxDelay1,touchTime=(new Date).getTime();return touchTime-(null!=(_this_lastTouchTime=_this.lastTouchTime)?_this_lastTouchTime:0)<(null!=(_this_options_doubleTouchMaxDelay=_this.options.doubleTouchMaxDelay)?_this_options_doubleTouchMaxDelay:300)&&touchTime-(null!=(_this_lastDoubleTapTime=_this.lastDoubleTapTime)?_this_lastDoubleTapTime:0)>(null!=(_this_options_doubleTouchMaxDelay1=_this.options.doubleTouchMaxDelay)?_this_options_doubleTouchMaxDelay1:750)?(_this.lastDoubleTapTime=touchTime,true):(_this.lastTouchTime=touchTime,false)},this.startDeceleration=function(lastShiftOnX,lastShiftOnY){var startTimestamp=null,startDecelerationMove=function(timestamp){null===startTimestamp&&(startTimestamp=timestamp);var _this_options_decelerationDuration,_this_options_decelerationDuration1,_this_options_decelerationDuration2,progress=timestamp-startTimestamp,ratio=((null!=(_this_options_decelerationDuration=_this.options.decelerationDuration)?_this_options_decelerationDuration:750)-progress)/(null!=(_this_options_decelerationDuration1=_this.options.decelerationDuration)?_this_options_decelerationDuration1:750),_ref=[lastShiftOnX*ratio,lastShiftOnY*ratio],shiftX=_ref[0],shiftY=_ref[1];progress<(null!=(_this_options_decelerationDuration2=_this.options.decelerationDuration)?_this_options_decelerationDuration2:750)&&Math.max(Math.abs(shiftX),Math.abs(shiftY))>1?(_this.move(shiftX,shiftY,0),_this.lastRequestAnimationId=requestAnimationFrame(startDecelerationMove)):_this.lastRequestAnimationId=null;};_this.lastRequestAnimationId=requestAnimationFrame(startDecelerationMove);},this.reset=function(){_this.setZoom(_this.options.initialZoom,true),_this.cursor=_this.options.defaultCursor,_this.setTransitionDuration(_this.options.animDuration),_this.setPos(ZOOM_DEFAULT_POSITION);},this.addScale=function(scale){ void 0===scale&&(scale=1),_this.handleZoomAdd(scale);},this.handleZoomAdd=function(scale){if(void 0===scale&&(scale=1),_this.options.allowZoom&&_this.options.allowWheel){var _this_options_max,newZoom=parseFloat((_this.zoom+scale).toFixed(_this.getPrecision(_this.options.zoomStep)));newZoom>(null!=(_this_options_max=_this.options.max)?_this_options_max:8)&&(newZoom=8),_this.setZoom(newZoom),_this.setPos(_this.pos),_this.setTransitionDuration(.05);}},this.subScale=function(scale){ void 0===scale&&(scale=1),_this.handleZoomSub(scale);},this.handleZoomSub=function(scale){if(void 0===scale&&(scale=1),_this.options.allowZoom&&_this.options.allowWheel){var newZoom=parseFloat((_this.zoom-scale).toFixed(_this.getPrecision(_this.options.zoomStep)));newZoom<1&&(newZoom=1),_this.setZoom(newZoom),_this.setPos(_this.pos),_this.setTransitionDuration(.05);}},this.handleMouseWheel=function(event){if(event.preventDefault(),_this.options.allowZoom&&_this.options.allowWheel){var _this_options_max,_this_options_min,velocity=event.deltaY<0?_this.options.scrollVelocity:0-_this.options.scrollVelocity,newZoom=parseFloat(Math.max(Math.min(_this.zoom+velocity,null!=(_this_options_max=_this.options.max)?_this_options_max:8),null!=(_this_options_min=_this.options.min)?_this_options_min:1).toFixed(_this.getPrecision(_this.options.zoomStep)));_this.setZoom(newZoom),_this.setTransitionDuration(.05);}},this.handleMouseStart=function(event){var _this_options_ignoredMouseButtons;event.preventDefault(),_this.options.allowPan&&!(null==(_this_options_ignoredMouseButtons=_this.options.ignoredMouseButtons)?void 0:_this_options_ignoredMouseButtons.includes(event.button))&&(_this._dragging=true,_this.lastRequestAnimationId&&cancelAnimationFrame(_this.lastRequestAnimationId),_this.lastCursor=_this.getCoordinates(event));},this.handleMouseMove=function(event){event.preventDefault(),_this.options.allowPan&&_this.lastCursor&&_this._dragging&&_this._touchOrMouseDrag(event);},this.handleMouseStop=function(event){event.preventDefault(),_this.lastShift&&(_this.startDeceleration(_this.lastShift[0],_this.lastShift[1]),_this.lastShift=null),_this.lastCursor=null,_this.setCursor("auto"),_this._dragging=false;},this.handleTouchStart=function(event){var isThisDoubleTapping=_this.isDoubleTapping();_this.isMultiTouch=event.touches.length,_this.options.allowTouchEvents||event.preventDefault(),_this.lastRequestAnimationId&&cancelAnimationFrame(_this.lastRequestAnimationId);var _this_getCoordinates=_this.getCoordinates(event.touches[0]),posX=_this_getCoordinates[0],posY=_this_getCoordinates[1];if(_this.isMultiTouch>1)_this.lastCursor=[posX,posY];else if(isThisDoubleTapping&&_this.options.allowZoom)if(1===_this.zoom){var _this_container_getBoundingClientRect=_this.container.getBoundingClientRect();_this_container_getBoundingClientRect.top,_this_container_getBoundingClientRect.left;var ref,ref1,x=_this_container_getBoundingClientRect.x,y=_this_container_getBoundingClientRect.y;posX=(ref1=[posX-(x=(ref=_this.transform?[y,x]:[x,y])[0]),posY-(y=ref[1])])[0],posY=ref1[1],_this.fullZoomInOnPosition(posX,posY);}else _this.reset();else _this._tapStartTime=(new Date).getTime(),_this.options.allowPan&&(_this.lastCursor=[posX,posY]);},this.handleTouchMove=function(event){if(_this.options.allowTouchEvents||event.preventDefault(),_this.lastCursor)if(1===_this.isMultiTouch)_this._touchOrMouseDrag(event.touches[0]),_this.lastTouchDistance=null;else if(_this.isMultiTouch>1){var newZoom=_this.zoom,_this_getCoordinates=_this.getCoordinates(event.touches[0]),pos1X=_this_getCoordinates[0],pos1Y=_this_getCoordinates[1],_this_getCoordinates1=_this.getCoordinates(event.touches[1]),pos2X=_this_getCoordinates1[0],pos2Y=_this_getCoordinates1[1],distance=Math.sqrt(Math.pow(pos2X-pos1X,2)+Math.pow(pos2Y-pos1Y,2));if(_this.lastTouchDistance&&distance&&distance!==_this.lastTouchDistance){var _this_options_max,_this_options_min,_this_options_max1;if(_this.options.allowZoom)if((newZoom+=(distance-_this.lastTouchDistance)/100)>(null!=(_this_options_max=_this.options.max)?_this_options_max:8))newZoom=null!=(_this_options_max1=_this.options.max)?_this_options_max1:8;else if(newZoom<(null!=(_this_options_min=_this.options.min)?_this_options_min:1)){var _this_options_min1;newZoom=null!=(_this_options_min1=_this.options.min)?_this_options_min1:1;}_this.setZoom(newZoom),_this.setTransitionDuration(0);}_this.lastCursor=[pos1X,pos1Y],_this.lastTouchDistance=distance;}},this.handleTouchStop=function(){_this.lastShift&&(_this.startDeceleration(_this.lastShift[0],_this.lastShift[1]),_this.lastShift=null),_this._tapStartTime&&(new Date).getTime()-_this._tapStartTime<200&&(null==_this.options.onTap||_this.options.onTap.call(_this.options)),_this._tapStartTime=void 0,_this.lastCursor=null,_this.lastTouchDistance=null,_this.isMultiTouch=0;},this.container=container,this.options=Object.assign({},DefaultOptions,options||{}),this.percentPos=ZOOM_DEFAULT_POSITION,this.transition=this.options.animDuration,this.zoom=1,this.cursor="auto",this.lastCursor=[0,0],this.lastShift=null,this.lastTouchDistance=null,this.lastRequestAnimationId=null,this.lastTouchTime=(new Date).getTime(),this.lastDoubleTapTime=(new Date).getTime(),this.transform=false,this.isMultiTouch=1,this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseStart=this.handleMouseStart.bind(this),this.handleMouseStop=this.handleMouseStop.bind(this),this.handleMouseWheel=this.handleMouseWheel.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchStop=this.handleTouchStop.bind(this),this.getZoom=this.getZoom.bind(this),this.setZoom=this.setZoom.bind(this);}var _proto=Zoom.prototype;return _proto.setUpEventListeners=function(){var refCurrentValue=this.container;window.matchMedia("(pointer: fine)").matches?(this.options.allowWheel&&(null==refCurrentValue||refCurrentValue.addEventListener("wheel",this.handleMouseWheel,{passive:false})),null==refCurrentValue||refCurrentValue.addEventListener("mousedown",this.handleMouseStart,{passive:false}),null==refCurrentValue||refCurrentValue.addEventListener("mousemove",this.handleMouseMove,{passive:false}),null==refCurrentValue||refCurrentValue.addEventListener("mouseup",this.handleMouseStop,{passive:false}),null==refCurrentValue||refCurrentValue.addEventListener("mouseleave",this.handleMouseStop,{passive:false})):(null==refCurrentValue||refCurrentValue.addEventListener("touchstart",this.handleTouchStart,{passive:false}),null==refCurrentValue||refCurrentValue.addEventListener("touchmove",this.handleTouchMove,{passive:false}),null==refCurrentValue||refCurrentValue.addEventListener("touchend",this.handleTouchStop,{passive:false}),null==refCurrentValue||refCurrentValue.addEventListener("touchcancel",this.handleTouchStop,{passive:false}));},_proto.removeEventListeners=function(){var refCurrentValue=this.container;window.matchMedia("(pointer: fine)").matches?(this.options.allowWheel&&(null==refCurrentValue||refCurrentValue.removeEventListener("wheel",this.handleMouseWheel)),null==refCurrentValue||refCurrentValue.removeEventListener("mousedown",this.handleMouseStart),null==refCurrentValue||refCurrentValue.removeEventListener("mousemove",this.handleMouseMove),null==refCurrentValue||refCurrentValue.removeEventListener("mouseup",this.handleMouseStop),null==refCurrentValue||refCurrentValue.removeEventListener("mouseleave",this.handleMouseStop)):(null==refCurrentValue||refCurrentValue.removeEventListener("touchstart",this.handleTouchStart),null==refCurrentValue||refCurrentValue.removeEventListener("touchmove",this.handleTouchMove),null==refCurrentValue||refCurrentValue.removeEventListener("touchend",this.handleTouchStop),null==refCurrentValue||refCurrentValue.removeEventListener("touchcancel",this.handleTouchStop));},_proto.getPrecision=function(value){ void 0===value&&(value=1);var valueStr=value.toString();return valueStr.includes(".")?valueStr.split(".")[1].length:1},_proto.getCoordinates=function(event){var clientHeight=this.container.clientHeight,clientTop=this.container.clientTop,clientLeft=this.container.clientLeft,_ref=this.transform?[event.clientY,clientHeight-event.clientX]:[event.clientX-clientTop,event.clientY-clientLeft];return [_ref[0],_ref[1]]},_proto._touchOrMouseDrag=function(event){if(this.lastCursor){var _this_getCoordinates=this.getCoordinates(event),posX=_this_getCoordinates[0],posY=_this_getCoordinates[1],shiftX=posX-this.lastCursor[0],shiftY=posY-this.lastCursor[1];this.move(shiftX,shiftY,0),this.lastCursor=[posX,posY],this.lastShift=[shiftX,shiftY];}},_create_class$a(Zoom,[{key:"pos",get:function(){return [this.container.clientWidth*this.percentPos[0],this.container.clientHeight*this.percentPos[1]]}}]),Zoom}();Zoom.VERSION="1.0.0-beta.1";
|
|
6416
6280
|
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
function requireDist$6 () {
|
|
6421
|
-
if (hasRequiredDist$6) return dist$6;
|
|
6422
|
-
hasRequiredDist$6 = 1;
|
|
6423
|
-
|
|
6424
|
-
/**
|
|
6425
|
-
* Zoom position
|
|
6426
|
-
*
|
|
6427
|
-
*/ function _defineProperties(target, props) {
|
|
6428
|
-
for(var i = 0; i < props.length; i++){
|
|
6429
|
-
var descriptor = props[i];
|
|
6430
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
6431
|
-
descriptor.configurable = true;
|
|
6432
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
6433
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
6434
|
-
}
|
|
6435
|
-
}
|
|
6436
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
6437
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
6438
|
-
return Constructor;
|
|
6439
|
-
}
|
|
6440
|
-
var ZOOM_DEFAULT_POSITION = [
|
|
6441
|
-
0,
|
|
6442
|
-
0
|
|
6443
|
-
];
|
|
6444
|
-
/**
|
|
6445
|
-
* 默认值
|
|
6446
|
-
*/ var DefaultOptions = {
|
|
6447
|
-
initialZoom: 1,
|
|
6448
|
-
defaultCursor: 'pointer',
|
|
6449
|
-
scrollVelocity: 0.1,
|
|
6450
|
-
animDuration: 0.25,
|
|
6451
|
-
allowZoom: true,
|
|
6452
|
-
allowPan: true,
|
|
6453
|
-
onChange: function() {},
|
|
6454
|
-
onTranslateChange: function() {},
|
|
6455
|
-
onTap: function() {},
|
|
6456
|
-
max: 8,
|
|
6457
|
-
min: 1,
|
|
6458
|
-
zoomStep: 0.1,
|
|
6459
|
-
allowTouchEvents: false,
|
|
6460
|
-
allowWheel: true,
|
|
6461
|
-
ignoredMouseButtons: [],
|
|
6462
|
-
doubleTouchMaxDelay: 300,
|
|
6463
|
-
decelerationDuration: 750
|
|
6464
|
-
};
|
|
6465
|
-
/**
|
|
6466
|
-
* dom 节点放大和拖动
|
|
6467
|
-
*
|
|
6468
|
-
*/ var Zoom = /*#__PURE__*/ function() {
|
|
6469
|
-
function Zoom(container, options) {
|
|
6470
|
-
var _this = this;
|
|
6471
|
-
this._dragging = false;
|
|
6472
|
-
/**
|
|
6473
|
-
* 销毁
|
|
6474
|
-
* destroy
|
|
6475
|
-
*/ this.destroy = function() {
|
|
6476
|
-
_this.setAllowZoom(false);
|
|
6477
|
-
_this.reset();
|
|
6478
|
-
_this.removeEventListeners();
|
|
6479
|
-
};
|
|
6480
|
-
/**
|
|
6481
|
-
* 设置是否旋转
|
|
6482
|
-
* @param trans - 是否transform
|
|
6483
|
-
*/ this.setTransform = function(trans) {
|
|
6484
|
-
_this.transform = trans;
|
|
6485
|
-
};
|
|
6486
|
-
/**
|
|
6487
|
-
* 获取是否旋转
|
|
6488
|
-
* @returns
|
|
6489
|
-
*/ this.getTransform = function() {
|
|
6490
|
-
return _this.transform;
|
|
6491
|
-
};
|
|
6492
|
-
/**
|
|
6493
|
-
* 更新x轴和Y轴平移值
|
|
6494
|
-
*/ this.updateTranslate = function() {
|
|
6495
|
-
var translateX = 0;
|
|
6496
|
-
var translateY = 0;
|
|
6497
|
-
if (_this.percentPos[0] < 0) {
|
|
6498
|
-
translateX = _this.percentPos[0] < -(0.5 * (_this.zoom - 1)) ? -(0.5 * (_this.zoom - 1)) : _this.percentPos[0];
|
|
6499
|
-
} else {
|
|
6500
|
-
translateX = _this.percentPos[0] > 0.5 * (_this.zoom - 1) ? 0.5 * (_this.zoom - 1) : _this.percentPos[0];
|
|
6501
|
-
}
|
|
6502
|
-
if (_this.percentPos[1] < 0) {
|
|
6503
|
-
translateY = _this.percentPos[1] < -(0.5 * (_this.zoom - 1)) ? -(0.5 * (_this.zoom - 1)) : _this.percentPos[1];
|
|
6504
|
-
} else {
|
|
6505
|
-
translateY = _this.percentPos[1] > 0.5 * (_this.zoom - 1) ? 0.5 * (_this.zoom - 1) : _this.percentPos[1];
|
|
6506
|
-
}
|
|
6507
|
-
_this.percentPos = [
|
|
6508
|
-
translateX,
|
|
6509
|
-
translateY
|
|
6510
|
-
];
|
|
6511
|
-
};
|
|
6512
|
-
/**
|
|
6513
|
-
* 更新容器样式
|
|
6514
|
-
*/ this.update = function() {
|
|
6515
|
-
if (!_this.container) return;
|
|
6516
|
-
_this.updateTranslate();
|
|
6517
|
-
_this.container.style.transition = "transform ease-out " + _this.transition + "s";
|
|
6518
|
-
_this.container.style.transform = "translate3d(" + _this.percentPos[0] * 100 + "%, " + _this.percentPos[1] * 100 + "%, 0) scale(" + _this.zoom + ")";
|
|
6519
|
-
};
|
|
6520
|
-
/**
|
|
6521
|
-
* 设置支持缩放
|
|
6522
|
-
* @param allow
|
|
6523
|
-
*/ this.setAllowZoom = function(allow) {
|
|
6524
|
-
_this.options.allowZoom = allow;
|
|
6525
|
-
};
|
|
6526
|
-
/**
|
|
6527
|
-
* 设置缩放值
|
|
6528
|
-
* @param zoom - 缩放值
|
|
6529
|
-
* @param reset - 是否重置
|
|
6530
|
-
*/ this.setZoom = function(zoom, reset) {
|
|
6531
|
-
zoom = parseFloat(zoom.toFixed(_this.getPrecision(_this.options.zoomStep)));
|
|
6532
|
-
if (_this.zoom !== zoom) {
|
|
6533
|
-
_this.zoom = zoom;
|
|
6534
|
-
_this.update();
|
|
6535
|
-
_this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, +_this.zoom.toFixed(_this.getPrecision(_this.options.zoomStep)), reset);
|
|
6536
|
-
}
|
|
6537
|
-
};
|
|
6538
|
-
/**
|
|
6539
|
-
* 获取缩放值
|
|
6540
|
-
* @returns
|
|
6541
|
-
*/ this.getZoom = function() {
|
|
6542
|
-
return _this.zoom;
|
|
6543
|
-
};
|
|
6544
|
-
/**
|
|
6545
|
-
* 设置位置
|
|
6546
|
-
* @param pos - 位置 [X轴坐标转换, Y轴坐标转换]
|
|
6547
|
-
*/ this.setPos = function(pos) {
|
|
6548
|
-
var _this_container, _this_container1;
|
|
6549
|
-
var containerWidth = (_this_container = _this.container) == null ? void 0 : _this_container.clientWidth;
|
|
6550
|
-
var containerHeight = (_this_container1 = _this.container) == null ? void 0 : _this_container1.clientHeight;
|
|
6551
|
-
if (+_this.pos[0] !== pos[0] || +_this.pos[1] !== pos[1]) {
|
|
6552
|
-
_this.percentPos = [
|
|
6553
|
-
pos[0] / containerWidth,
|
|
6554
|
-
pos[1] / containerHeight
|
|
6555
|
-
];
|
|
6556
|
-
_this.update();
|
|
6557
|
-
_this.options.onTranslateChange == null ? void 0 : _this.options.onTranslateChange.call(_this.options, {
|
|
6558
|
-
posX: pos[0],
|
|
6559
|
-
posY: pos[1]
|
|
6560
|
-
});
|
|
6561
|
-
}
|
|
6562
|
-
};
|
|
6563
|
-
/**
|
|
6564
|
-
* 设置过渡时间
|
|
6565
|
-
* @param duration - 过渡时间, 单位秒
|
|
6566
|
-
*/ this.setTransitionDuration = function(duration) {
|
|
6567
|
-
_this.transition = duration;
|
|
6568
|
-
_this.update();
|
|
6569
|
-
};
|
|
6570
|
-
/**
|
|
6571
|
-
* 设置鼠标样式
|
|
6572
|
-
* @param cursor
|
|
6573
|
-
* @returns
|
|
6574
|
-
*/ this.setCursor = function(cursor) {
|
|
6575
|
-
if (!_this.container) return;
|
|
6576
|
-
_this.container.style.cssText += "cursor:" + cursor + ";";
|
|
6577
|
-
_this.cursor = cursor;
|
|
6578
|
-
};
|
|
6579
|
-
this.zoomIn = function(value) {
|
|
6580
|
-
var newPosX = _this.pos[0];
|
|
6581
|
-
var newPosY = _this.pos[1];
|
|
6582
|
-
var prevZoom = _this.zoom;
|
|
6583
|
-
var _this_options_max, _this_options_max1;
|
|
6584
|
-
var newZoom = prevZoom + value < ((_this_options_max = _this.options.max) != null ? _this_options_max : 8) ? prevZoom + value : (_this_options_max1 = _this.options.max) != null ? _this_options_max1 : 8;
|
|
6585
|
-
if (newZoom !== prevZoom) {
|
|
6586
|
-
newPosX = newPosX * (newZoom - 1) / (prevZoom > 1 ? prevZoom - 1 : prevZoom);
|
|
6587
|
-
newPosY = newPosY * (newZoom - 1) / (prevZoom > 1 ? prevZoom - 1 : prevZoom);
|
|
6588
|
-
}
|
|
6589
|
-
_this.setZoom(newZoom);
|
|
6590
|
-
_this.setPos([
|
|
6591
|
-
newPosX,
|
|
6592
|
-
newPosY
|
|
6593
|
-
]);
|
|
6594
|
-
_this.setTransitionDuration(_this.options.animDuration);
|
|
6595
|
-
};
|
|
6596
|
-
this.zoomOut = function(value) {
|
|
6597
|
-
var newPosX = _this.pos[0];
|
|
6598
|
-
var newPosY = _this.pos[1];
|
|
6599
|
-
var prevZoom = _this.zoom;
|
|
6600
|
-
var _this_options_min, _this_options_min1;
|
|
6601
|
-
var newZoom = prevZoom - value > ((_this_options_min = _this.options.min) != null ? _this_options_min : 1) ? prevZoom - value : (_this_options_min1 = _this.options.min) != null ? _this_options_min1 : 1;
|
|
6602
|
-
if (newZoom !== prevZoom) {
|
|
6603
|
-
newPosX = newPosX * (newZoom - 1) / (prevZoom - 1);
|
|
6604
|
-
newPosY = newPosY * (newZoom - 1) / (prevZoom - 1);
|
|
6605
|
-
}
|
|
6606
|
-
_this.setZoom(newZoom);
|
|
6607
|
-
_this.setPos([
|
|
6608
|
-
newPosX,
|
|
6609
|
-
newPosY
|
|
6610
|
-
]);
|
|
6611
|
-
_this.setTransitionDuration(_this.options.animDuration);
|
|
6612
|
-
};
|
|
6613
|
-
this.zoomToZone = function(relX, relY, relWidth, relHeight) {
|
|
6614
|
-
var _this_container;
|
|
6615
|
-
if (!_this.container) return;
|
|
6616
|
-
var newPosX = _this.pos[0];
|
|
6617
|
-
var newPosY = _this.pos[1];
|
|
6618
|
-
var parentRect = ((_this_container = _this.container) == null ? void 0 : _this_container.parentNode).getBoundingClientRect();
|
|
6619
|
-
var prevZoom = _this.zoom;
|
|
6620
|
-
// Calculate zoom factor to scale the zone
|
|
6621
|
-
var optimalZoomX = parentRect.width / relWidth;
|
|
6622
|
-
var optimalZoomY = parentRect.height / relHeight;
|
|
6623
|
-
var _this_options_max;
|
|
6624
|
-
var newZoom = Math.min(optimalZoomX, optimalZoomY, (_this_options_max = _this.options.max) != null ? _this_options_max : 8);
|
|
6625
|
-
// Calculate new position to center the zone
|
|
6626
|
-
var rect = _this.container.getBoundingClientRect();
|
|
6627
|
-
var _ref = [
|
|
6628
|
-
rect.width / prevZoom / 2,
|
|
6629
|
-
rect.height / prevZoom / 2
|
|
6630
|
-
], centerX = _ref[0], centerY = _ref[1];
|
|
6631
|
-
var _ref1 = [
|
|
6632
|
-
relX + relWidth / 2,
|
|
6633
|
-
relY + relHeight / 2
|
|
6634
|
-
], zoneCenterX = _ref1[0], zoneCenterY = _ref1[1];
|
|
6635
|
-
newPosX = (centerX - zoneCenterX) * newZoom;
|
|
6636
|
-
newPosY = (centerY - zoneCenterY) * newZoom;
|
|
6637
|
-
_this.setZoom(newZoom);
|
|
6638
|
-
_this.setPos([
|
|
6639
|
-
newPosX,
|
|
6640
|
-
newPosY
|
|
6641
|
-
]);
|
|
6642
|
-
_this.setTransitionDuration(_this.options.animDuration);
|
|
6643
|
-
};
|
|
6644
|
-
this.getNewPosition = function(x, y, newZoom) {
|
|
6645
|
-
var _ref = [
|
|
6646
|
-
_this.zoom,
|
|
6647
|
-
_this.pos[0],
|
|
6648
|
-
_this.pos[1]
|
|
6649
|
-
], prevZoom = _ref[0];
|
|
6650
|
-
if (newZoom === 1 || !_this) return ZOOM_DEFAULT_POSITION;
|
|
6651
|
-
var _ref1 = [
|
|
6652
|
-
_this.container.clientWidth,
|
|
6653
|
-
_this.container.clientHeight
|
|
6654
|
-
], clientWidth = _ref1[0], clientHeight = _ref1[1];
|
|
6655
|
-
if (newZoom > prevZoom) {
|
|
6656
|
-
return [
|
|
6657
|
-
0,
|
|
6658
|
-
0
|
|
6659
|
-
];
|
|
6660
|
-
} else {
|
|
6661
|
-
// 放到最大
|
|
6662
|
-
var w = -((x - clientWidth / 2) / (clientWidth / 2)) * newZoom / 2;
|
|
6663
|
-
var h = -((y - clientHeight / 2) / (clientHeight / 2)) * newZoom / 2;
|
|
6664
|
-
if (w > newZoom / 2 - 0.5) {
|
|
6665
|
-
w = 3.5;
|
|
6666
|
-
}
|
|
6667
|
-
if (h > newZoom / 2 - 0.5) {
|
|
6668
|
-
h = 3.5;
|
|
6669
|
-
}
|
|
6670
|
-
return [
|
|
6671
|
-
clientWidth * w,
|
|
6672
|
-
clientHeight * h
|
|
6673
|
-
];
|
|
6674
|
-
}
|
|
6675
|
-
};
|
|
6676
|
-
/**
|
|
6677
|
-
* 缩放到最大
|
|
6678
|
-
* @param x - 点击点X坐标
|
|
6679
|
-
* @param y - 点击点Y坐标
|
|
6680
|
-
*/ this.fullZoomInOnPosition = function(x, y) {
|
|
6681
|
-
var _this_options_max;
|
|
6682
|
-
var zoom = (_this_options_max = _this.options.max) != null ? _this_options_max : DefaultOptions.max;
|
|
6683
|
-
_this.setZoom(zoom != null ? zoom : DefaultOptions.max);
|
|
6684
|
-
_this.setPos(_this.getNewPosition(x, y, zoom));
|
|
6685
|
-
_this.setTransitionDuration(_this.options.animDuration);
|
|
6686
|
-
};
|
|
6687
|
-
this.getLimitedShift = function(shift, minLimit, maxLimit, minElement, maxElement) {
|
|
6688
|
-
if (shift > 0) {
|
|
6689
|
-
if (minElement > minLimit) {
|
|
6690
|
-
return 0;
|
|
6691
|
-
} else if (minElement + shift > minLimit) {
|
|
6692
|
-
return minLimit - minElement;
|
|
6693
|
-
}
|
|
6694
|
-
} else if (shift < 0) {
|
|
6695
|
-
if (maxElement < maxLimit) {
|
|
6696
|
-
return 0;
|
|
6697
|
-
} else if (maxElement + shift < maxLimit) {
|
|
6698
|
-
return maxLimit - maxElement;
|
|
6699
|
-
}
|
|
6700
|
-
}
|
|
6701
|
-
return shift;
|
|
6702
|
-
};
|
|
6703
|
-
this.getCursor = function(canMoveOnX, canMoveOnY) {
|
|
6704
|
-
if (canMoveOnX && canMoveOnY) {
|
|
6705
|
-
return 'move';
|
|
6706
|
-
} else if (canMoveOnX) {
|
|
6707
|
-
return 'ew-resize';
|
|
6708
|
-
} else if (canMoveOnY) {
|
|
6709
|
-
return 'ns-resize';
|
|
6710
|
-
} else {
|
|
6711
|
-
return 'auto';
|
|
6712
|
-
}
|
|
6713
|
-
};
|
|
6714
|
-
this.move = function(shiftX, shiftY, transitionDuration) {
|
|
6715
|
-
if (transitionDuration === void 0) transitionDuration = 0;
|
|
6716
|
-
if (!_this.container) return;
|
|
6717
|
-
var newPosX = _this.pos[0];
|
|
6718
|
-
var newPosY = _this.pos[1];
|
|
6719
|
-
// let canMoveOnX: boolean, canMoveOnY: boolean;
|
|
6720
|
-
var rect = _this.container.getBoundingClientRect();
|
|
6721
|
-
var parentRect = _this.container.parentNode.getBoundingClientRect();
|
|
6722
|
-
// 根据是否进行了伪横屏旋转,决定是使用 shiftX 还是 shiftY 来对画面进行移动
|
|
6723
|
-
var shiftHorizontal = _this.transform ? shiftY : shiftX;
|
|
6724
|
-
var shiftVertical = _this.transform ? shiftX : shiftY;
|
|
6725
|
-
var _ref = _this.transform ? [
|
|
6726
|
-
rect.height > parentRect.bottom - parentRect.top,
|
|
6727
|
-
shiftVertical > 0 && rect.top - parentRect.top < 0,
|
|
6728
|
-
shiftVertical < 0 && rect.bottom - parentRect.bottom > 0
|
|
6729
|
-
] : [
|
|
6730
|
-
rect.width > parentRect.right - parentRect.left,
|
|
6731
|
-
shiftHorizontal > 0 && rect.left - parentRect.left < 0,
|
|
6732
|
-
shiftHorizontal < 0 && rect.right - parentRect.right > 0
|
|
6733
|
-
], isLargerHor = _ref[0], isOutLeftBoundary = _ref[1], isOutRightBoundary = _ref[2];
|
|
6734
|
-
var canMoveOnX = isLargerHor || isOutLeftBoundary || isOutRightBoundary;
|
|
6735
|
-
if (canMoveOnX) {
|
|
6736
|
-
if (_this.transform) {
|
|
6737
|
-
newPosX += _this.getLimitedShift(shiftVertical, parentRect.top, parentRect.bottom, rect.top, rect.bottom);
|
|
6738
|
-
} else {
|
|
6739
|
-
newPosX += _this.getLimitedShift(shiftHorizontal, parentRect.left, parentRect.right, rect.left, rect.right);
|
|
6740
|
-
}
|
|
6741
|
-
}
|
|
6742
|
-
var _ref1 = _this.transform ? [
|
|
6743
|
-
rect.width > parentRect.right - parentRect.left,
|
|
6744
|
-
shiftHorizontal > 0 && rect.right - parentRect.right < 0,
|
|
6745
|
-
shiftHorizontal < 0 && rect.left - parentRect.left > 0
|
|
6746
|
-
] : [
|
|
6747
|
-
rect.height > parentRect.bottom - parentRect.top,
|
|
6748
|
-
shiftVertical > 0 && rect.top - parentRect.top < 0,
|
|
6749
|
-
shiftVertical < 0 && rect.bottom - parentRect.bottom > 0
|
|
6750
|
-
], isLargerVer = _ref1[0], isOutTopBoundary = _ref1[1], isOutBottomBoundary = _ref1[2];
|
|
6751
|
-
var canMoveOnY = isLargerVer || isOutTopBoundary || isOutBottomBoundary;
|
|
6752
|
-
if (canMoveOnY) {
|
|
6753
|
-
if (_this.transform) {
|
|
6754
|
-
var transformGetLimitedShift = function(shift, minLimit, maxLimit, minElement, maxElement) {
|
|
6755
|
-
// css伪横屏边界判断特殊处理
|
|
6756
|
-
if (shift > 0) {
|
|
6757
|
-
if (maxElement < maxLimit + 1) {
|
|
6758
|
-
return 0;
|
|
6759
|
-
} else if (maxElement + shift < maxLimit + 1) {
|
|
6760
|
-
return maxLimit - maxElement;
|
|
6761
|
-
}
|
|
6762
|
-
} else if (shift < 0) {
|
|
6763
|
-
if (minElement + 1 > minLimit) {
|
|
6764
|
-
return 0;
|
|
6765
|
-
} else if (minElement + 1 + shift > minLimit) {
|
|
6766
|
-
return minLimit - minElement;
|
|
6767
|
-
}
|
|
6768
|
-
}
|
|
6769
|
-
return shift;
|
|
6770
|
-
};
|
|
6771
|
-
newPosY += transformGetLimitedShift(shiftHorizontal, parentRect.left, parentRect.right, rect.left, rect.right);
|
|
6772
|
-
} else {
|
|
6773
|
-
newPosY += _this.getLimitedShift(shiftVertical, parentRect.top, parentRect.bottom, rect.top, rect.bottom);
|
|
6774
|
-
}
|
|
6775
|
-
}
|
|
6776
|
-
var cursor = _this.getCursor(canMoveOnX, canMoveOnY);
|
|
6777
|
-
_this.setPos([
|
|
6778
|
-
newPosX,
|
|
6779
|
-
newPosY
|
|
6780
|
-
]);
|
|
6781
|
-
_this.setCursor(cursor);
|
|
6782
|
-
_this.setTransitionDuration(transitionDuration);
|
|
6783
|
-
};
|
|
6784
|
-
/**
|
|
6785
|
-
* 移动端双击
|
|
6786
|
-
* @returns
|
|
6787
|
-
*/ this.isDoubleTapping = function() {
|
|
6788
|
-
var touchTime = new Date().getTime();
|
|
6789
|
-
var _this_lastTouchTime, _this_options_doubleTouchMaxDelay, _this_lastDoubleTapTime, _this_options_doubleTouchMaxDelay1;
|
|
6790
|
-
var isDoubleTap = touchTime - ((_this_lastTouchTime = _this.lastTouchTime) != null ? _this_lastTouchTime : 0) < ((_this_options_doubleTouchMaxDelay = _this.options.doubleTouchMaxDelay) != null ? _this_options_doubleTouchMaxDelay : 300) && touchTime - ((_this_lastDoubleTapTime = _this.lastDoubleTapTime) != null ? _this_lastDoubleTapTime : 0) > ((_this_options_doubleTouchMaxDelay1 = _this.options.doubleTouchMaxDelay) != null ? _this_options_doubleTouchMaxDelay1 : 750);
|
|
6791
|
-
if (isDoubleTap) {
|
|
6792
|
-
_this.lastDoubleTapTime = touchTime;
|
|
6793
|
-
return true;
|
|
6794
|
-
}
|
|
6795
|
-
_this.lastTouchTime = touchTime;
|
|
6796
|
-
return false;
|
|
6797
|
-
};
|
|
6798
|
-
this.startDeceleration = function(lastShiftOnX, lastShiftOnY) {
|
|
6799
|
-
var startTimestamp = null;
|
|
6800
|
-
var startDecelerationMove = function(timestamp) {
|
|
6801
|
-
if (startTimestamp === null) startTimestamp = timestamp;
|
|
6802
|
-
var progress = timestamp - startTimestamp;
|
|
6803
|
-
var _this_options_decelerationDuration, _this_options_decelerationDuration1;
|
|
6804
|
-
var ratio = (((_this_options_decelerationDuration = _this.options.decelerationDuration) != null ? _this_options_decelerationDuration : 750) - progress) / ((_this_options_decelerationDuration1 = _this.options.decelerationDuration) != null ? _this_options_decelerationDuration1 : 750);
|
|
6805
|
-
var _ref = [
|
|
6806
|
-
lastShiftOnX * ratio,
|
|
6807
|
-
lastShiftOnY * ratio
|
|
6808
|
-
], shiftX = _ref[0], shiftY = _ref[1];
|
|
6809
|
-
var _this_options_decelerationDuration2;
|
|
6810
|
-
if (progress < ((_this_options_decelerationDuration2 = _this.options.decelerationDuration) != null ? _this_options_decelerationDuration2 : 750) && Math.max(Math.abs(shiftX), Math.abs(shiftY)) > 1) {
|
|
6811
|
-
_this.move(shiftX, shiftY, 0);
|
|
6812
|
-
_this.lastRequestAnimationId = requestAnimationFrame(startDecelerationMove);
|
|
6813
|
-
} else {
|
|
6814
|
-
_this.lastRequestAnimationId = null;
|
|
6815
|
-
}
|
|
6816
|
-
};
|
|
6817
|
-
_this.lastRequestAnimationId = requestAnimationFrame(startDecelerationMove);
|
|
6818
|
-
};
|
|
6819
|
-
this.reset = function() {
|
|
6820
|
-
_this.setZoom(_this.options.initialZoom, true);
|
|
6821
|
-
_this.cursor = _this.options.defaultCursor;
|
|
6822
|
-
_this.setTransitionDuration(_this.options.animDuration);
|
|
6823
|
-
_this.setPos(ZOOM_DEFAULT_POSITION);
|
|
6824
|
-
};
|
|
6825
|
-
// api向前兼容
|
|
6826
|
-
this.addScale = function(scale) {
|
|
6827
|
-
if (scale === void 0) scale = 1;
|
|
6828
|
-
_this.handleZoomAdd(scale);
|
|
6829
|
-
};
|
|
6830
|
-
this.handleZoomAdd = function(scale) {
|
|
6831
|
-
if (scale === void 0) scale = 1;
|
|
6832
|
-
if (!_this.options.allowZoom || !_this.options.allowWheel) return;
|
|
6833
|
-
var newZoom = parseFloat((_this.zoom + scale).toFixed(_this.getPrecision(_this.options.zoomStep)));
|
|
6834
|
-
var _this_options_max;
|
|
6835
|
-
if (newZoom > ((_this_options_max = _this.options.max) != null ? _this_options_max : 8)) {
|
|
6836
|
-
newZoom = 8;
|
|
6837
|
-
}
|
|
6838
|
-
_this.setZoom(newZoom);
|
|
6839
|
-
_this.setPos(_this.pos);
|
|
6840
|
-
_this.setTransitionDuration(0.05);
|
|
6841
|
-
};
|
|
6842
|
-
// api向前兼容
|
|
6843
|
-
this.subScale = function(scale) {
|
|
6844
|
-
if (scale === void 0) scale = 1;
|
|
6845
|
-
_this.handleZoomSub(scale);
|
|
6846
|
-
};
|
|
6847
|
-
this.handleZoomSub = function(scale) {
|
|
6848
|
-
if (scale === void 0) scale = 1;
|
|
6849
|
-
if (!_this.options.allowZoom || !_this.options.allowWheel) return;
|
|
6850
|
-
var newZoom = parseFloat((_this.zoom - scale).toFixed(_this.getPrecision(_this.options.zoomStep)));
|
|
6851
|
-
if (newZoom < 1) {
|
|
6852
|
-
newZoom = 1;
|
|
6853
|
-
}
|
|
6854
|
-
_this.setZoom(newZoom);
|
|
6855
|
-
_this.setPos(_this.pos);
|
|
6856
|
-
_this.setTransitionDuration(0.05);
|
|
6857
|
-
};
|
|
6858
|
-
this.handleMouseWheel = function(event) {
|
|
6859
|
-
event.preventDefault();
|
|
6860
|
-
if (!_this.options.allowZoom || !_this.options.allowWheel) return;
|
|
6861
|
-
var velocity = event.deltaY < 0 ? _this.options.scrollVelocity : 0 - _this.options.scrollVelocity;
|
|
6862
|
-
var _this_options_max, _this_options_min;
|
|
6863
|
-
var newZoom = parseFloat(Math.max(Math.min(_this.zoom + velocity, (_this_options_max = _this.options.max) != null ? _this_options_max : 8), (_this_options_min = _this.options.min) != null ? _this_options_min : 1).toFixed(_this.getPrecision(_this.options.zoomStep)));
|
|
6864
|
-
_this.setZoom(newZoom);
|
|
6865
|
-
// this.setPos(this.getNewPosition(posX, posY, newZoom));
|
|
6866
|
-
_this.setTransitionDuration(0.05);
|
|
6867
|
-
};
|
|
6868
|
-
this.handleMouseStart = function(event) {
|
|
6869
|
-
var _this_options_ignoredMouseButtons;
|
|
6870
|
-
event.preventDefault();
|
|
6871
|
-
if (!_this.options.allowPan || ((_this_options_ignoredMouseButtons = _this.options.ignoredMouseButtons) == null ? void 0 : _this_options_ignoredMouseButtons.includes(event.button))) return;
|
|
6872
|
-
_this._dragging = true;
|
|
6873
|
-
if (_this.lastRequestAnimationId) cancelAnimationFrame(_this.lastRequestAnimationId);
|
|
6874
|
-
_this.lastCursor = _this.getCoordinates(event);
|
|
6875
|
-
};
|
|
6876
|
-
this.handleMouseMove = function(event) {
|
|
6877
|
-
event.preventDefault();
|
|
6878
|
-
if (!_this.options.allowPan || !_this.lastCursor || !_this._dragging) return;
|
|
6879
|
-
_this._touchOrMouseDrag(event);
|
|
6880
|
-
};
|
|
6881
|
-
this.handleMouseStop = function(event) {
|
|
6882
|
-
event.preventDefault();
|
|
6883
|
-
if (_this.lastShift) {
|
|
6884
|
-
_this.startDeceleration(_this.lastShift[0], _this.lastShift[1]);
|
|
6885
|
-
_this.lastShift = null;
|
|
6886
|
-
}
|
|
6887
|
-
_this.lastCursor = null;
|
|
6888
|
-
_this.setCursor('auto');
|
|
6889
|
-
_this._dragging = false;
|
|
6890
|
-
};
|
|
6891
|
-
this.handleTouchStart = function(event) {
|
|
6892
|
-
var isThisDoubleTapping = _this.isDoubleTapping();
|
|
6893
|
-
_this.isMultiTouch = event.touches.length;
|
|
6894
|
-
if (!_this.options.allowTouchEvents) event.preventDefault();
|
|
6895
|
-
if (_this.lastRequestAnimationId) cancelAnimationFrame(_this.lastRequestAnimationId);
|
|
6896
|
-
var _this_getCoordinates = _this.getCoordinates(event.touches[0]), posX = _this_getCoordinates[0], posY = _this_getCoordinates[1];
|
|
6897
|
-
if (_this.isMultiTouch > 1) {
|
|
6898
|
-
_this.lastCursor = [
|
|
6899
|
-
posX,
|
|
6900
|
-
posY
|
|
6901
|
-
];
|
|
6902
|
-
return;
|
|
6903
|
-
}
|
|
6904
|
-
if (isThisDoubleTapping && _this.options.allowZoom) {
|
|
6905
|
-
if (_this.zoom === 1) {
|
|
6906
|
-
var _this_container_getBoundingClientRect = _this.container.getBoundingClientRect(); _this_container_getBoundingClientRect.top; _this_container_getBoundingClientRect.left; var x = _this_container_getBoundingClientRect.x, y = _this_container_getBoundingClientRect.y;
|
|
6907
|
-
var ref;
|
|
6908
|
-
ref = _this.transform ? [
|
|
6909
|
-
y,
|
|
6910
|
-
x
|
|
6911
|
-
] : [
|
|
6912
|
-
x,
|
|
6913
|
-
y
|
|
6914
|
-
], x = ref[0], y = ref[1];
|
|
6915
|
-
var ref1;
|
|
6916
|
-
ref1 = [
|
|
6917
|
-
posX - x,
|
|
6918
|
-
posY - y
|
|
6919
|
-
], posX = ref1[0], posY = ref1[1];
|
|
6920
|
-
// 双击放大到最大
|
|
6921
|
-
_this.fullZoomInOnPosition(posX, posY);
|
|
6922
|
-
} else {
|
|
6923
|
-
_this.reset();
|
|
6924
|
-
}
|
|
6925
|
-
return;
|
|
6926
|
-
}
|
|
6927
|
-
_this._tapStartTime = new Date().getTime();
|
|
6928
|
-
if (_this.options.allowPan) _this.lastCursor = [
|
|
6929
|
-
posX,
|
|
6930
|
-
posY
|
|
6931
|
-
];
|
|
6932
|
-
};
|
|
6933
|
-
this.handleTouchMove = function(event) {
|
|
6934
|
-
if (!_this.options.allowTouchEvents) event.preventDefault();
|
|
6935
|
-
if (!_this.lastCursor) return;
|
|
6936
|
-
if (_this.isMultiTouch === 1) {
|
|
6937
|
-
_this._touchOrMouseDrag(event.touches[0]);
|
|
6938
|
-
_this.lastTouchDistance = null;
|
|
6939
|
-
} else if (_this.isMultiTouch > 1) {
|
|
6940
|
-
var newZoom = _this.zoom;
|
|
6941
|
-
// If we detect two points, we shall zoom up or down
|
|
6942
|
-
var _this_getCoordinates = _this.getCoordinates(event.touches[0]), pos1X = _this_getCoordinates[0], pos1Y = _this_getCoordinates[1];
|
|
6943
|
-
var _this_getCoordinates1 = _this.getCoordinates(event.touches[1]), pos2X = _this_getCoordinates1[0], pos2Y = _this_getCoordinates1[1];
|
|
6944
|
-
var distance = Math.sqrt(Math.pow(pos2X - pos1X, 2) + Math.pow(pos2Y - pos1Y, 2));
|
|
6945
|
-
if (_this.lastTouchDistance && distance && distance !== _this.lastTouchDistance) {
|
|
6946
|
-
if (_this.options.allowZoom) {
|
|
6947
|
-
newZoom += (distance - _this.lastTouchDistance) / 100;
|
|
6948
|
-
var _this_options_max, _this_options_min;
|
|
6949
|
-
if (newZoom > ((_this_options_max = _this.options.max) != null ? _this_options_max : 8)) {
|
|
6950
|
-
var _this_options_max1;
|
|
6951
|
-
newZoom = (_this_options_max1 = _this.options.max) != null ? _this_options_max1 : 8;
|
|
6952
|
-
} else if (newZoom < ((_this_options_min = _this.options.min) != null ? _this_options_min : 1)) {
|
|
6953
|
-
var _this_options_min1;
|
|
6954
|
-
newZoom = (_this_options_min1 = _this.options.min) != null ? _this_options_min1 : 1;
|
|
6955
|
-
}
|
|
6956
|
-
}
|
|
6957
|
-
// 不要做移动,因为会有冲突
|
|
6958
|
-
_this.setZoom(newZoom);
|
|
6959
|
-
_this.setTransitionDuration(0);
|
|
6960
|
-
}
|
|
6961
|
-
// Save data for the next move
|
|
6962
|
-
_this.lastCursor = [
|
|
6963
|
-
pos1X,
|
|
6964
|
-
pos1Y
|
|
6965
|
-
];
|
|
6966
|
-
_this.lastTouchDistance = distance;
|
|
6967
|
-
}
|
|
6968
|
-
};
|
|
6969
|
-
this.handleTouchStop = function() {
|
|
6970
|
-
if (_this.lastShift) {
|
|
6971
|
-
// Use the last shift to make a decelerating movement effect
|
|
6972
|
-
_this.startDeceleration(_this.lastShift[0], _this.lastShift[1]);
|
|
6973
|
-
_this.lastShift = null;
|
|
6974
|
-
}
|
|
6975
|
-
if (_this._tapStartTime && new Date().getTime() - _this._tapStartTime < 200) {
|
|
6976
|
-
_this.options.onTap == null ? void 0 : _this.options.onTap.call(_this.options);
|
|
6977
|
-
}
|
|
6978
|
-
_this._tapStartTime = undefined;
|
|
6979
|
-
_this.lastCursor = null;
|
|
6980
|
-
_this.lastTouchDistance = null;
|
|
6981
|
-
_this.isMultiTouch = 0;
|
|
6982
|
-
};
|
|
6983
|
-
this.container = container;
|
|
6984
|
-
this.options = Object.assign({}, DefaultOptions, options || {});
|
|
6985
|
-
this.percentPos = ZOOM_DEFAULT_POSITION;
|
|
6986
|
-
this.transition = this.options.animDuration;
|
|
6987
|
-
this.zoom = 1;
|
|
6988
|
-
this.cursor = 'auto';
|
|
6989
|
-
this.lastCursor = [
|
|
6990
|
-
0,
|
|
6991
|
-
0
|
|
6992
|
-
];
|
|
6993
|
-
this.lastShift = null;
|
|
6994
|
-
this.lastTouchDistance = null;
|
|
6995
|
-
this.lastRequestAnimationId = null;
|
|
6996
|
-
this.lastTouchTime = new Date().getTime();
|
|
6997
|
-
this.lastDoubleTapTime = new Date().getTime();
|
|
6998
|
-
this.transform = false; // 是否为横屏模式
|
|
6999
|
-
this.isMultiTouch = 1;
|
|
7000
|
-
this.handleMouseMove = this.handleMouseMove.bind(this);
|
|
7001
|
-
this.handleMouseStart = this.handleMouseStart.bind(this);
|
|
7002
|
-
this.handleMouseStop = this.handleMouseStop.bind(this);
|
|
7003
|
-
this.handleMouseWheel = this.handleMouseWheel.bind(this);
|
|
7004
|
-
this.handleTouchStart = this.handleTouchStart.bind(this);
|
|
7005
|
-
this.handleTouchMove = this.handleTouchMove.bind(this);
|
|
7006
|
-
this.handleTouchStop = this.handleTouchStop.bind(this);
|
|
7007
|
-
this.getZoom = this.getZoom.bind(this);
|
|
7008
|
-
this.setZoom = this.setZoom.bind(this);
|
|
7009
|
-
}
|
|
7010
|
-
var _proto = Zoom.prototype;
|
|
7011
|
-
// 设置事件侦听器
|
|
7012
|
-
_proto.setUpEventListeners = function setUpEventListeners() {
|
|
7013
|
-
var refCurrentValue = this.container;
|
|
7014
|
-
var hasMouseDevice = window.matchMedia('(pointer: fine)').matches;
|
|
7015
|
-
if (hasMouseDevice) {
|
|
7016
|
-
if (this.options.allowWheel) {
|
|
7017
|
-
refCurrentValue == null ? void 0 : refCurrentValue.addEventListener('wheel', this.handleMouseWheel, {
|
|
7018
|
-
passive: false
|
|
7019
|
-
});
|
|
7020
|
-
}
|
|
7021
|
-
// Apply mouse events only to devices which include an accurate pointing device
|
|
7022
|
-
refCurrentValue == null ? void 0 : refCurrentValue.addEventListener('mousedown', this.handleMouseStart, {
|
|
7023
|
-
passive: false
|
|
7024
|
-
});
|
|
7025
|
-
refCurrentValue == null ? void 0 : refCurrentValue.addEventListener('mousemove', this.handleMouseMove, {
|
|
7026
|
-
passive: false
|
|
7027
|
-
});
|
|
7028
|
-
refCurrentValue == null ? void 0 : refCurrentValue.addEventListener('mouseup', this.handleMouseStop, {
|
|
7029
|
-
passive: false
|
|
7030
|
-
});
|
|
7031
|
-
refCurrentValue == null ? void 0 : refCurrentValue.addEventListener('mouseleave', this.handleMouseStop, {
|
|
7032
|
-
passive: false
|
|
7033
|
-
});
|
|
7034
|
-
} else {
|
|
7035
|
-
// Apply touch events to all other devices
|
|
7036
|
-
refCurrentValue == null ? void 0 : refCurrentValue.addEventListener('touchstart', this.handleTouchStart, {
|
|
7037
|
-
passive: false
|
|
7038
|
-
});
|
|
7039
|
-
refCurrentValue == null ? void 0 : refCurrentValue.addEventListener('touchmove', this.handleTouchMove, {
|
|
7040
|
-
passive: false
|
|
7041
|
-
});
|
|
7042
|
-
refCurrentValue == null ? void 0 : refCurrentValue.addEventListener('touchend', this.handleTouchStop, {
|
|
7043
|
-
passive: false
|
|
7044
|
-
});
|
|
7045
|
-
refCurrentValue == null ? void 0 : refCurrentValue.addEventListener('touchcancel', this.handleTouchStop, {
|
|
7046
|
-
passive: false
|
|
7047
|
-
});
|
|
7048
|
-
}
|
|
7049
|
-
};
|
|
7050
|
-
// 移除事件侦听器
|
|
7051
|
-
_proto.removeEventListeners = function removeEventListeners() {
|
|
7052
|
-
var refCurrentValue = this.container;
|
|
7053
|
-
var hasMouseDevice = window.matchMedia('(pointer: fine)').matches;
|
|
7054
|
-
if (hasMouseDevice) {
|
|
7055
|
-
if (this.options.allowWheel) {
|
|
7056
|
-
refCurrentValue == null ? void 0 : refCurrentValue.removeEventListener('wheel', this.handleMouseWheel);
|
|
7057
|
-
}
|
|
7058
|
-
refCurrentValue == null ? void 0 : refCurrentValue.removeEventListener('mousedown', this.handleMouseStart);
|
|
7059
|
-
refCurrentValue == null ? void 0 : refCurrentValue.removeEventListener('mousemove', this.handleMouseMove);
|
|
7060
|
-
refCurrentValue == null ? void 0 : refCurrentValue.removeEventListener('mouseup', this.handleMouseStop);
|
|
7061
|
-
refCurrentValue == null ? void 0 : refCurrentValue.removeEventListener('mouseleave', this.handleMouseStop);
|
|
7062
|
-
} else {
|
|
7063
|
-
refCurrentValue == null ? void 0 : refCurrentValue.removeEventListener('touchstart', this.handleTouchStart);
|
|
7064
|
-
refCurrentValue == null ? void 0 : refCurrentValue.removeEventListener('touchmove', this.handleTouchMove);
|
|
7065
|
-
refCurrentValue == null ? void 0 : refCurrentValue.removeEventListener('touchend', this.handleTouchStop);
|
|
7066
|
-
refCurrentValue == null ? void 0 : refCurrentValue.removeEventListener('touchcancel', this.handleTouchStop);
|
|
7067
|
-
}
|
|
7068
|
-
};
|
|
7069
|
-
_proto.getPrecision = function getPrecision(value) {
|
|
7070
|
-
if (value === void 0) value = 1;
|
|
7071
|
-
var valueStr = value.toString();
|
|
7072
|
-
if (valueStr.includes('.')) {
|
|
7073
|
-
return valueStr.split('.')[1].length;
|
|
7074
|
-
} else {
|
|
7075
|
-
return 1;
|
|
7076
|
-
}
|
|
7077
|
-
};
|
|
7078
|
-
/**
|
|
7079
|
-
* 获取坐标 (伪横屏X、Y轴坐标转换, 相对值)
|
|
7080
|
-
* @param event
|
|
7081
|
-
* @returns
|
|
7082
|
-
*/ _proto.getCoordinates = function getCoordinates(event) {
|
|
7083
|
-
var clientHeight = this.container.clientHeight;
|
|
7084
|
-
var clientTop = this.container.clientTop;
|
|
7085
|
-
var clientLeft = this.container.clientLeft;
|
|
7086
|
-
var _ref = this.transform ? [
|
|
7087
|
-
event.clientY,
|
|
7088
|
-
clientHeight - event.clientX
|
|
7089
|
-
] : [
|
|
7090
|
-
event.clientX - clientTop,
|
|
7091
|
-
event.clientY - clientLeft
|
|
7092
|
-
], x1 = _ref[0], y1 = _ref[1];
|
|
7093
|
-
return [
|
|
7094
|
-
x1,
|
|
7095
|
-
y1
|
|
7096
|
-
];
|
|
7097
|
-
};
|
|
7098
|
-
_proto._touchOrMouseDrag = function _touchOrMouseDrag(event) {
|
|
7099
|
-
if (this.lastCursor) {
|
|
7100
|
-
var _this_getCoordinates = this.getCoordinates(event), posX = _this_getCoordinates[0], posY = _this_getCoordinates[1];
|
|
7101
|
-
var shiftX = posX - this.lastCursor[0];
|
|
7102
|
-
var shiftY = posY - this.lastCursor[1];
|
|
7103
|
-
this.move(shiftX, shiftY, 0);
|
|
7104
|
-
this.lastCursor = [
|
|
7105
|
-
posX,
|
|
7106
|
-
posY
|
|
7107
|
-
];
|
|
7108
|
-
this.lastShift = [
|
|
7109
|
-
shiftX,
|
|
7110
|
-
shiftY
|
|
7111
|
-
];
|
|
7112
|
-
}
|
|
7113
|
-
};
|
|
7114
|
-
_create_class(Zoom, [
|
|
7115
|
-
{
|
|
7116
|
-
key: "pos",
|
|
7117
|
-
get: function get() {
|
|
7118
|
-
return [
|
|
7119
|
-
this.container.clientWidth * this.percentPos[0],
|
|
7120
|
-
this.container.clientHeight * this.percentPos[1]
|
|
7121
|
-
];
|
|
7122
|
-
}
|
|
7123
|
-
}
|
|
7124
|
-
]);
|
|
7125
|
-
return Zoom;
|
|
7126
|
-
}();
|
|
7127
|
-
Zoom.VERSION = '0.0.2';
|
|
7128
|
-
|
|
7129
|
-
dist$6 = Zoom;
|
|
7130
|
-
return dist$6;
|
|
7131
|
-
}
|
|
7132
|
-
|
|
7133
|
-
var distExports$3 = requireDist$6();
|
|
7134
|
-
var Zoom = /*@__PURE__*/getDefaultExportFromCjs(distExports$3);
|
|
7135
|
-
|
|
7136
|
-
function _extends$j() {
|
|
7137
|
-
_extends$j = Object.assign || function(target) {
|
|
6281
|
+
function _extends$l() {
|
|
6282
|
+
_extends$l = Object.assign || function(target) {
|
|
7138
6283
|
for(var i = 1; i < arguments.length; i++){
|
|
7139
6284
|
var source = arguments[i];
|
|
7140
6285
|
for(var key in source){
|
|
@@ -7145,10 +6290,10 @@
|
|
|
7145
6290
|
}
|
|
7146
6291
|
return target;
|
|
7147
6292
|
};
|
|
7148
|
-
return _extends$
|
|
6293
|
+
return _extends$l.apply(this, arguments);
|
|
7149
6294
|
}
|
|
7150
6295
|
function __zoom(theme, container, options) {
|
|
7151
|
-
theme.zoomUtil = new Zoom(container, _extends$
|
|
6296
|
+
theme.zoomUtil = new Zoom(container, _extends$l({}, options || {}, {
|
|
7152
6297
|
min: 1,
|
|
7153
6298
|
onChange: function(zoom, reset) {
|
|
7154
6299
|
if (zoom !== theme._zoom) {
|
|
@@ -7166,7 +6311,7 @@
|
|
|
7166
6311
|
}));
|
|
7167
6312
|
}
|
|
7168
6313
|
|
|
7169
|
-
function asyncGeneratorStep$
|
|
6314
|
+
function asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, key, arg) {
|
|
7170
6315
|
try {
|
|
7171
6316
|
var info = gen[key](arg);
|
|
7172
6317
|
var value = info.value;
|
|
@@ -7180,22 +6325,22 @@
|
|
|
7180
6325
|
Promise.resolve(value).then(_next, _throw);
|
|
7181
6326
|
}
|
|
7182
6327
|
}
|
|
7183
|
-
function _async_to_generator$
|
|
6328
|
+
function _async_to_generator$7(fn) {
|
|
7184
6329
|
return function() {
|
|
7185
6330
|
var self = this, args = arguments;
|
|
7186
6331
|
return new Promise(function(resolve, reject) {
|
|
7187
6332
|
var gen = fn.apply(self, args);
|
|
7188
6333
|
function _next(value) {
|
|
7189
|
-
asyncGeneratorStep$
|
|
6334
|
+
asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, "next", value);
|
|
7190
6335
|
}
|
|
7191
6336
|
function _throw(err) {
|
|
7192
|
-
asyncGeneratorStep$
|
|
6337
|
+
asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, "throw", err);
|
|
7193
6338
|
}
|
|
7194
6339
|
_next(undefined);
|
|
7195
6340
|
});
|
|
7196
6341
|
};
|
|
7197
6342
|
}
|
|
7198
|
-
function _ts_generator$
|
|
6343
|
+
function _ts_generator$7(thisArg, body) {
|
|
7199
6344
|
var f, y, t, _ = {
|
|
7200
6345
|
label: 0,
|
|
7201
6346
|
sent: function() {
|
|
@@ -7287,9 +6432,9 @@
|
|
|
7287
6432
|
}
|
|
7288
6433
|
}
|
|
7289
6434
|
function getThemeDataByTemplate(theme, id) {
|
|
7290
|
-
return _async_to_generator$
|
|
6435
|
+
return _async_to_generator$7(function() {
|
|
7291
6436
|
var _theme_options_token_httpToken, _theme_options_token, url;
|
|
7292
|
-
return _ts_generator$
|
|
6437
|
+
return _ts_generator$7(this, function(_state) {
|
|
7293
6438
|
switch(_state.label){
|
|
7294
6439
|
case 0:
|
|
7295
6440
|
url = theme.options.env.domain + "/api/service/media/template/getDetail?accessToken=" + (theme.options.accessToken || ((_theme_options_token = theme.options.token) == null ? void 0 : (_theme_options_token_httpToken = _theme_options_token.httpToken) == null ? void 0 : _theme_options_token_httpToken.url)) + "&id=" + id;
|
|
@@ -7298,8 +6443,8 @@
|
|
|
7298
6443
|
fetch(url, {
|
|
7299
6444
|
method: 'GET'
|
|
7300
6445
|
}).then(function(response) {
|
|
7301
|
-
return _async_to_generator$
|
|
7302
|
-
return _ts_generator$
|
|
6446
|
+
return _async_to_generator$7(function() {
|
|
6447
|
+
return _ts_generator$7(this, function(_state) {
|
|
7303
6448
|
switch(_state.label){
|
|
7304
6449
|
case 0:
|
|
7305
6450
|
return [
|
|
@@ -7344,7 +6489,7 @@
|
|
|
7344
6489
|
})();
|
|
7345
6490
|
}
|
|
7346
6491
|
|
|
7347
|
-
function asyncGeneratorStep$
|
|
6492
|
+
function asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, key, arg) {
|
|
7348
6493
|
try {
|
|
7349
6494
|
var info = gen[key](arg);
|
|
7350
6495
|
var value = info.value;
|
|
@@ -7358,23 +6503,23 @@
|
|
|
7358
6503
|
Promise.resolve(value).then(_next, _throw);
|
|
7359
6504
|
}
|
|
7360
6505
|
}
|
|
7361
|
-
function _async_to_generator$
|
|
6506
|
+
function _async_to_generator$6(fn) {
|
|
7362
6507
|
return function() {
|
|
7363
6508
|
var self = this, args = arguments;
|
|
7364
6509
|
return new Promise(function(resolve, reject) {
|
|
7365
6510
|
var gen = fn.apply(self, args);
|
|
7366
6511
|
function _next(value) {
|
|
7367
|
-
asyncGeneratorStep$
|
|
6512
|
+
asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, "next", value);
|
|
7368
6513
|
}
|
|
7369
6514
|
function _throw(err) {
|
|
7370
|
-
asyncGeneratorStep$
|
|
6515
|
+
asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, "throw", err);
|
|
7371
6516
|
}
|
|
7372
6517
|
_next(undefined);
|
|
7373
6518
|
});
|
|
7374
6519
|
};
|
|
7375
6520
|
}
|
|
7376
|
-
function _extends$
|
|
7377
|
-
_extends$
|
|
6521
|
+
function _extends$k() {
|
|
6522
|
+
_extends$k = Object.assign || function(target) {
|
|
7378
6523
|
for(var i = 1; i < arguments.length; i++){
|
|
7379
6524
|
var source = arguments[i];
|
|
7380
6525
|
for(var key in source){
|
|
@@ -7385,9 +6530,9 @@
|
|
|
7385
6530
|
}
|
|
7386
6531
|
return target;
|
|
7387
6532
|
};
|
|
7388
|
-
return _extends$
|
|
6533
|
+
return _extends$k.apply(this, arguments);
|
|
7389
6534
|
}
|
|
7390
|
-
function _ts_generator$
|
|
6535
|
+
function _ts_generator$6(thisArg, body) {
|
|
7391
6536
|
var f, y, t, _ = {
|
|
7392
6537
|
label: 0,
|
|
7393
6538
|
sent: function() {
|
|
@@ -7513,7 +6658,7 @@
|
|
|
7513
6658
|
}
|
|
7514
6659
|
if (item.isrender !== 0 && REC_GROUP.includes(item.iconId)) {
|
|
7515
6660
|
// TODO: 因为回放是一组, 位置以第一个位置为准
|
|
7516
|
-
recControls.push(recControls[0] ? _extends$
|
|
6661
|
+
recControls.push(recControls[0] ? _extends$k({}, item, {
|
|
7517
6662
|
part: recControls[0].part
|
|
7518
6663
|
}) : item);
|
|
7519
6664
|
return false;
|
|
@@ -7536,7 +6681,7 @@
|
|
|
7536
6681
|
}
|
|
7537
6682
|
if (item.isrender !== 0 && REC_GROUP.includes(item.iconId)) {
|
|
7538
6683
|
// TODO: 因为回放是一组, 位置以第一个位置为准
|
|
7539
|
-
recControls.push(recControls[0] ? _extends$
|
|
6684
|
+
recControls.push(recControls[0] ? _extends$k({}, item, {
|
|
7540
6685
|
part: recControls[0].part
|
|
7541
6686
|
}) : item);
|
|
7542
6687
|
return false;
|
|
@@ -7598,9 +6743,9 @@
|
|
|
7598
6743
|
* @param data
|
|
7599
6744
|
* @returns
|
|
7600
6745
|
*/ function getThemeData(theme, data) {
|
|
7601
|
-
return _async_to_generator$
|
|
6746
|
+
return _async_to_generator$6(function() {
|
|
7602
6747
|
var themeData, _theme_logger, template;
|
|
7603
|
-
return _ts_generator$
|
|
6748
|
+
return _ts_generator$6(this, function(_state) {
|
|
7604
6749
|
switch(_state.label){
|
|
7605
6750
|
case 0:
|
|
7606
6751
|
themeData = data;
|
|
@@ -7787,8 +6932,8 @@
|
|
|
7787
6932
|
return Component;
|
|
7788
6933
|
}();
|
|
7789
6934
|
|
|
7790
|
-
function _extends$
|
|
7791
|
-
_extends$
|
|
6935
|
+
function _extends$j() {
|
|
6936
|
+
_extends$j = Object.assign || function(target) {
|
|
7792
6937
|
for(var i = 1; i < arguments.length; i++){
|
|
7793
6938
|
var source = arguments[i];
|
|
7794
6939
|
for(var key in source){
|
|
@@ -7799,7 +6944,7 @@
|
|
|
7799
6944
|
}
|
|
7800
6945
|
return target;
|
|
7801
6946
|
};
|
|
7802
|
-
return _extends$
|
|
6947
|
+
return _extends$j.apply(this, arguments);
|
|
7803
6948
|
}
|
|
7804
6949
|
function _inherits$i(subClass, superClass) {
|
|
7805
6950
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -7812,28 +6957,28 @@
|
|
|
7812
6957
|
configurable: true
|
|
7813
6958
|
}
|
|
7814
6959
|
});
|
|
7815
|
-
if (superClass) _set_prototype_of$
|
|
6960
|
+
if (superClass) _set_prototype_of$l(subClass, superClass);
|
|
7816
6961
|
}
|
|
7817
|
-
function _set_prototype_of$
|
|
7818
|
-
_set_prototype_of$
|
|
6962
|
+
function _set_prototype_of$l(o, p) {
|
|
6963
|
+
_set_prototype_of$l = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
7819
6964
|
o.__proto__ = p;
|
|
7820
6965
|
return o;
|
|
7821
6966
|
};
|
|
7822
|
-
return _set_prototype_of$
|
|
6967
|
+
return _set_prototype_of$l(o, p);
|
|
7823
6968
|
}
|
|
7824
6969
|
var Footer = /*#__PURE__*/ function(Component) {
|
|
7825
6970
|
_inherits$i(Footer, Component);
|
|
7826
6971
|
function Footer(options) {
|
|
7827
6972
|
if (options === void 0) options = {};
|
|
7828
|
-
return Component.call(this, _extends$
|
|
6973
|
+
return Component.call(this, _extends$j({}, options, {
|
|
7829
6974
|
cType: 'footer'
|
|
7830
6975
|
})) || this;
|
|
7831
6976
|
}
|
|
7832
6977
|
return Footer;
|
|
7833
6978
|
}(Component);
|
|
7834
6979
|
|
|
7835
|
-
function _extends$
|
|
7836
|
-
_extends$
|
|
6980
|
+
function _extends$i() {
|
|
6981
|
+
_extends$i = Object.assign || function(target) {
|
|
7837
6982
|
for(var i = 1; i < arguments.length; i++){
|
|
7838
6983
|
var source = arguments[i];
|
|
7839
6984
|
for(var key in source){
|
|
@@ -7844,7 +6989,7 @@
|
|
|
7844
6989
|
}
|
|
7845
6990
|
return target;
|
|
7846
6991
|
};
|
|
7847
|
-
return _extends$
|
|
6992
|
+
return _extends$i.apply(this, arguments);
|
|
7848
6993
|
}
|
|
7849
6994
|
function _inherits$h(subClass, superClass) {
|
|
7850
6995
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -7857,20 +7002,20 @@
|
|
|
7857
7002
|
configurable: true
|
|
7858
7003
|
}
|
|
7859
7004
|
});
|
|
7860
|
-
if (superClass) _set_prototype_of$
|
|
7005
|
+
if (superClass) _set_prototype_of$k(subClass, superClass);
|
|
7861
7006
|
}
|
|
7862
|
-
function _set_prototype_of$
|
|
7863
|
-
_set_prototype_of$
|
|
7007
|
+
function _set_prototype_of$k(o, p) {
|
|
7008
|
+
_set_prototype_of$k = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
7864
7009
|
o.__proto__ = p;
|
|
7865
7010
|
return o;
|
|
7866
7011
|
};
|
|
7867
|
-
return _set_prototype_of$
|
|
7012
|
+
return _set_prototype_of$k(o, p);
|
|
7868
7013
|
}
|
|
7869
|
-
var Header = /*#__PURE__*/ function(Component) {
|
|
7014
|
+
var Header$1 = /*#__PURE__*/ function(Component) {
|
|
7870
7015
|
_inherits$h(Header, Component);
|
|
7871
7016
|
function Header(options) {
|
|
7872
7017
|
if (options === void 0) options = {};
|
|
7873
|
-
return Component.call(this, _extends$
|
|
7018
|
+
return Component.call(this, _extends$i({}, options, {
|
|
7874
7019
|
cType: 'header'
|
|
7875
7020
|
})) || this;
|
|
7876
7021
|
}
|
|
@@ -8036,8 +7181,8 @@
|
|
|
8036
7181
|
};
|
|
8037
7182
|
}
|
|
8038
7183
|
|
|
8039
|
-
function _extends$
|
|
8040
|
-
_extends$
|
|
7184
|
+
function _extends$h() {
|
|
7185
|
+
_extends$h = Object.assign || function(target) {
|
|
8041
7186
|
for(var i = 1; i < arguments.length; i++){
|
|
8042
7187
|
var source = arguments[i];
|
|
8043
7188
|
for(var key in source){
|
|
@@ -8048,7 +7193,7 @@
|
|
|
8048
7193
|
}
|
|
8049
7194
|
return target;
|
|
8050
7195
|
};
|
|
8051
|
-
return _extends$
|
|
7196
|
+
return _extends$h.apply(this, arguments);
|
|
8052
7197
|
}
|
|
8053
7198
|
function _inherits$g(subClass, superClass) {
|
|
8054
7199
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -8061,14 +7206,14 @@
|
|
|
8061
7206
|
configurable: true
|
|
8062
7207
|
}
|
|
8063
7208
|
});
|
|
8064
|
-
if (superClass) _set_prototype_of$
|
|
7209
|
+
if (superClass) _set_prototype_of$j(subClass, superClass);
|
|
8065
7210
|
}
|
|
8066
|
-
function _set_prototype_of$
|
|
8067
|
-
_set_prototype_of$
|
|
7211
|
+
function _set_prototype_of$j(o, p) {
|
|
7212
|
+
_set_prototype_of$j = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
8068
7213
|
o.__proto__ = p;
|
|
8069
7214
|
return o;
|
|
8070
7215
|
};
|
|
8071
|
-
return _set_prototype_of$
|
|
7216
|
+
return _set_prototype_of$j(o, p);
|
|
8072
7217
|
}
|
|
8073
7218
|
/**
|
|
8074
7219
|
* 全局全屏
|
|
@@ -8077,7 +7222,7 @@
|
|
|
8077
7222
|
*/ var GlobalFullscreen = /*#__PURE__*/ function(Fullscreen) {
|
|
8078
7223
|
_inherits$g(GlobalFullscreen, Fullscreen);
|
|
8079
7224
|
function GlobalFullscreen(options) {
|
|
8080
|
-
return Fullscreen.call(this, _extends$
|
|
7225
|
+
return Fullscreen.call(this, _extends$h({}, options, {
|
|
8081
7226
|
controlType: 'button',
|
|
8082
7227
|
classNameSuffix: 'global-fullscreen'
|
|
8083
7228
|
})) || this;
|
|
@@ -8108,8 +7253,8 @@
|
|
|
8108
7253
|
return GlobalFullscreen;
|
|
8109
7254
|
}(Fullscreen);
|
|
8110
7255
|
|
|
8111
|
-
function _extends$
|
|
8112
|
-
_extends$
|
|
7256
|
+
function _extends$g() {
|
|
7257
|
+
_extends$g = Object.assign || function(target) {
|
|
8113
7258
|
for(var i = 1; i < arguments.length; i++){
|
|
8114
7259
|
var source = arguments[i];
|
|
8115
7260
|
for(var key in source){
|
|
@@ -8120,7 +7265,7 @@
|
|
|
8120
7265
|
}
|
|
8121
7266
|
return target;
|
|
8122
7267
|
};
|
|
8123
|
-
return _extends$
|
|
7268
|
+
return _extends$g.apply(this, arguments);
|
|
8124
7269
|
}
|
|
8125
7270
|
function _inherits$f(subClass, superClass) {
|
|
8126
7271
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -8133,14 +7278,14 @@
|
|
|
8133
7278
|
configurable: true
|
|
8134
7279
|
}
|
|
8135
7280
|
});
|
|
8136
|
-
if (superClass) _set_prototype_of$
|
|
7281
|
+
if (superClass) _set_prototype_of$i(subClass, superClass);
|
|
8137
7282
|
}
|
|
8138
|
-
function _set_prototype_of$
|
|
8139
|
-
_set_prototype_of$
|
|
7283
|
+
function _set_prototype_of$i(o, p) {
|
|
7284
|
+
_set_prototype_of$i = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
8140
7285
|
o.__proto__ = p;
|
|
8141
7286
|
return o;
|
|
8142
7287
|
};
|
|
8143
|
-
return _set_prototype_of$
|
|
7288
|
+
return _set_prototype_of$i(o, p);
|
|
8144
7289
|
}
|
|
8145
7290
|
/**
|
|
8146
7291
|
* 截图控件,点击后会触发截图事件, 截图数据会通过 onCapture 回调函数返回
|
|
@@ -8149,7 +7294,7 @@
|
|
|
8149
7294
|
_inherits$f(CapturePicture, Control);
|
|
8150
7295
|
function CapturePicture(options) {
|
|
8151
7296
|
var _this;
|
|
8152
|
-
_this = Control.call(this, _extends$
|
|
7297
|
+
_this = Control.call(this, _extends$g({}, options, {
|
|
8153
7298
|
tagName: 'span',
|
|
8154
7299
|
classNameSuffix: 'capture-picture'
|
|
8155
7300
|
})) || this, _this._timer = null;
|
|
@@ -8193,975 +7338,21 @@
|
|
|
8193
7338
|
this._timer = setTimeout(function() {
|
|
8194
7339
|
if (_this._timer) {
|
|
8195
7340
|
clearTimeout(_this._timer);
|
|
8196
|
-
_this._timer = null;
|
|
8197
|
-
}
|
|
8198
|
-
_this.active = false;
|
|
8199
|
-
}, 200);
|
|
8200
|
-
Control.prototype._onControlClick.call(this, e);
|
|
8201
|
-
};
|
|
8202
|
-
return CapturePicture;
|
|
8203
|
-
}(Control);
|
|
8204
|
-
|
|
8205
|
-
var dist$5 = {};
|
|
8206
|
-
|
|
8207
|
-
var dist$4 = {};
|
|
8208
|
-
|
|
8209
|
-
/*
|
|
8210
|
-
* @ezuikit/utils-tools v2.0.1
|
|
8211
|
-
* tools utils
|
|
8212
|
-
* Copyright (c) 2025-12-02 Ezviz-OpenBiz
|
|
8213
|
-
* Released under the MIT License.
|
|
8214
|
-
*/
|
|
8215
|
-
|
|
8216
|
-
var hasRequiredDist$5;
|
|
8217
|
-
|
|
8218
|
-
function requireDist$5 () {
|
|
8219
|
-
if (hasRequiredDist$5) return dist$4;
|
|
8220
|
-
hasRequiredDist$5 = 1;
|
|
8221
|
-
var getQuery=function(url){var query=url.split("?")[1],obj={};if(query)for(var vars=query.split("&"),i=0;i<vars.length;i++){var pair=vars[i].split("=");obj[pair[0]]=decodeURIComponent(pair[1]);}return obj};function parseEzopenUrl(url){var obj={};if(/^ezopen:\/\//.test(url)){if(url.includes("@")){var endIndex=url.indexOf("@"),startIndex=url.indexOf("//");obj.validateCode=url.substring(startIndex+2,endIndex),url=url.replace(obj.validateCode+"@","");}obj.protocol=url.split("//")[0],obj.search=url.split("?")[1]?"?"+url.split("?")[1]:"",obj.hostname=url.split("/")[2],obj.origin=obj.protocol+"//"+obj.hostname,obj.pathname=url.split("?")[0].replace(obj.origin,""),obj.href=url;var pathnames=obj.pathname.split("/"),lastPath=pathnames[2].split(".");return obj.deviceSerial=pathnames[1],obj.channelNo=lastPath[0],obj.type=lastPath[lastPath.length-1],"live"===obj.type&&(obj.definition=lastPath.length>2?lastPath[1]:"sd"),"rec"===obj.type&&pathnames[2]&&(obj.recType=pathnames[2].includes(".cloud.")?"cloud":""),obj.searchParams=getQuery(url),obj}return {}}var codec={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32};function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _instanceof(left,right){return null!=right&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?!!right[Symbol.hasInstance](left):left instanceof right}function _create_for_of_iterator_helper_loose(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(it)return (it=it.call(o)).next.bind(it);if(Array.isArray(o)||(it=function(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return "Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_array_like_to_array(o,minLen):void 0}}(o))||allowArrayLike){it&&(o=it);var i=0;return function(){return i>=o.length?{done:true}:{done:false,value:o[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var DateTime=function(){function DateTime(){}return DateTime.fillZero=function(num,len){return void 0===len&&(len=2),num.toString().padStart(len,"0")},DateTime.format=function(input,format){var date;if(_instanceof(input,Date))date=input;else {if("number"!=typeof input&&"string"!=typeof input)throw new Error("Invalid date input");date=DateTime.toDate(input+"");}for(var _step,result=format,_iterator=_create_for_of_iterator_helper_loose([[/(yyyy|YYYY)/g,function(){return DateTime.fillZero(date.getFullYear(),4)}],[/(yy|YY)/g,function(){return DateTime.fillZero(date.getFullYear()%100,2)}],[/(MM)/g,function(){return DateTime.fillZero(date.getMonth()+1,2)}],[/(M)/g,function(){return (date.getMonth()+1).toString()}],[/(dd|DD)/g,function(){return DateTime.fillZero(date.getDate(),2)}],[/(d|D)/g,function(){return date.getDate().toString()}],[/(HH|hh)/g,function(){return DateTime.fillZero(date.getHours(),2)}],[/(H|h)/g,function(){return date.getHours().toString()}],[/(mm)/g,function(){return DateTime.fillZero(date.getMinutes(),2)}],[/(m)/g,function(){return date.getMinutes().toString()}],[/(ss|SS)/g,function(){return DateTime.fillZero(date.getSeconds(),2)}],[/(s|S)/g,function(){return date.getSeconds().toString()}],[/(fff)/g,function(){return DateTime.fillZero(date.getMilliseconds(),3)}]]);!(_step=_iterator()).done;){var _step_value=_step.value,regexp=_step_value[0],fn=_step_value[1];result=result.replace(regexp,fn);}return result},DateTime.toDate=function(str){if(_instanceof(str,Date))return str;str=(str+"").trim().replace(/\/|\./gi,"-"),/^\d{4}$/.test(str)&&(str+="-01"),/^\d{4}-\d{2}$/.test(str)&&(str+="-01");try{return /^\d{4}-\d{2}-\d{2}$/.test(str)?new Date(str+"T00:00:00"):/^\d{8}$/.test(str)?(str+="",new Date(str.slice(0,4)+"-"+str.slice(4,6)+"-"+str.slice(6,8)+"T00:00:00")):/^\d{14}$/.test(str)?(str+="",new Date(str.slice(0,4)+"-"+str.slice(4,6)+"-"+str.slice(6,8)+"T"+str.slice(8,10)+":"+str.slice(10,12)+":"+str.slice(12,14))):/^\d{13}$/.test(str)?new Date(Number(str)):/^\d{10}$/.test(str)?new Date(1e3*Number(str)):new Date(str)}catch(error){throw new Error("Invalid date string")}},DateTime.diff=function(date1,date2,type){ void 0===type&&(type="second");var d1=DateTime.toDate(date1),d2=DateTime.toDate(date2);return "second"===type?Math.floor((d1.getTime()-d2.getTime())/1e3):"minute"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60):"hour"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60):"day"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60/24):Math.abs(d1.getTime()-d2.getTime())},DateTime}();dist$4.DateTime=DateTime,dist$4.addVc=function(url,codecs){ void 0===codecs&&(codecs=["h264"]);var vc=(codecs||["h264"]).reduce((function(acc,key){return key=key.toLowerCase(),acc+(codec[key]||0)}),0),host=url.split("?")[0],query=url.split("?")[1];return query=(query||"").split("&").filter((function(item){return !/^vc=\d?/.test(item)})).join("&"),host+"?"+(query+=(query?"&":"")+"vc="+vc)},dist$4.getQuery=getQuery,dist$4.getStaticPath=function(path,base){ void 0===base&&(base="");var protocolReg=/^(https?:\/\/|^\/\/)/;if(""===path||void 0===path)return "";if(protocolReg.test(path))return path;path=path.replace(/\/+/g,"/"),base=protocolReg.test(base||"")?base:window.location.href;try{return new URL(path,base).href}catch(error){return path}},dist$4.isHttp=function(url){return /^http[s]?:\/\//.test(url)},dist$4.isMobile=function(agent){var _navigator,_navigator1,_navigator2,_window;return /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone|Opera Mini)/i.test(null!=agent?agent:null==(_navigator=navigator)?void 0:_navigator.userAgent)||/Macintosh/i.test(agent||(null==(_navigator1=navigator)?void 0:_navigator1.userAgent))&&(null==(_navigator2=navigator)?void 0:_navigator2.maxTouchPoints)>1||!!(null==(_window=window)?void 0:_window.__IS_MOBILE_SIMULATOR__)},dist$4.parseEzopenUrl=parseEzopenUrl,dist$4.pick=function(obj,keys){return Object.entries(obj).reduce((function(acc,param){var key=param[0],value=param[1];return keys.includes(key)&&(acc[key]=value),acc}),{})},dist$4.switchEzopenUrl=function(url,options){var _ref=null!=options?options:{},type=_ref.type,recType=_ref.recType,search=_ref.search,definition=_ref.definition,channelNo=_ref.channelNo,deviceSerial=_ref.deviceSerial,validateCode=_ref.validateCode,obj=parseEzopenUrl(url);if(search){var ns=Object.assign({},obj.searchParams,getQuery("?"+search.replace("?","")));search=Object.entries(ns).reduce((function(acc,param){var key=param[0],value=param[1];return ""===value?acc:acc+=key+"="+encodeURIComponent(value)+"&"}),"?").replace(/&$/,"");}else search=obj.search;return type=type||obj.type,recType=null!=recType?recType:obj.recType,definition=null!=definition?definition:obj.definition,channelNo=channelNo||obj.channelNo,deviceSerial=deviceSerial||obj.deviceSerial,validateCode=null!=validateCode?validateCode:obj.validateCode,obj.protocol+"//"+(validateCode?validateCode+"@":"")+obj.hostname+"/"+deviceSerial+"/"+channelNo+("rec"===type&&recType?"."+recType:"")+("live"===type&&"hd"===definition?"."+definition:"")+"."+type+search};
|
|
8222
|
-
return dist$4;
|
|
8223
|
-
}
|
|
8224
|
-
|
|
8225
|
-
/*
|
|
8226
|
-
* @ezuikit/control-ptz v0.0.1
|
|
8227
|
-
* Copyright (c) 2026-03-18 Ezviz-OpenBiz
|
|
8228
|
-
* Released under the MIT License.
|
|
8229
|
-
*/
|
|
8230
|
-
|
|
8231
|
-
var hasRequiredDist$4;
|
|
8232
|
-
|
|
8233
|
-
function requireDist$4 () {
|
|
8234
|
-
if (hasRequiredDist$4) return dist$5;
|
|
8235
|
-
hasRequiredDist$4 = 1;
|
|
8236
|
-
|
|
8237
|
-
var deepmerge = requireCjs();
|
|
8238
|
-
var utilsTools = requireDist$5();
|
|
8239
|
-
|
|
8240
|
-
var en_US = {
|
|
8241
|
-
GET_PTZ_STATUS: 'Get current PTZ status',
|
|
8242
|
-
GET_PTZ_STATUS_FAILED: 'Theme module is not loaded, PTZ status cannot be obtained',
|
|
8243
|
-
MOBILE_HIDE_PTZ: 'Mobile terminal, PTZ is not displayed in non-full screen state',
|
|
8244
|
-
OPTION_PTZ_FAILED: 'Theme module is not loaded, PTZ cannot be operated',
|
|
8245
|
-
MOBILE_PTZ_TIPS: 'Adjust camera angle by manipulating gimbal',
|
|
8246
|
-
PTZ_FAST: 'F',
|
|
8247
|
-
PTZ_MID: 'M',
|
|
8248
|
-
PTZ_SLOW: 'S',
|
|
8249
|
-
PTZ_SPEED: 'Adjust the PTZ rotation speed',
|
|
8250
|
-
DEVICE_ZOOM: 'Control the device to zoom in/out of the screen',
|
|
8251
|
-
DEVICE_FOCUS: "Adjusting the device's focal length"
|
|
8252
|
-
};
|
|
8253
|
-
|
|
8254
|
-
var zh_CN = {
|
|
8255
|
-
GET_PTZ_STATUS: '获取当前云台状态',
|
|
8256
|
-
GET_PTZ_STATUS_FAILED: '未加载Theme模块,无法获取云台状态',
|
|
8257
|
-
MOBILE_HIDE_PTZ: '移动端,非全屏状态不展示云台',
|
|
8258
|
-
OPTION_PTZ_FAILED: '未加载Theme模块,无法操作云台',
|
|
8259
|
-
MOBILE_PTZ_TIPS: '请通过操控云台来调整摄像机视角',
|
|
8260
|
-
PTZ_FAST: '快',
|
|
8261
|
-
PTZ_MID: '中',
|
|
8262
|
-
PTZ_SLOW: '慢',
|
|
8263
|
-
PTZ_SPEED: '调整云台转动速度',
|
|
8264
|
-
DEVICE_ZOOM: '控制设备放大/缩小画面',
|
|
8265
|
-
DEVICE_FOCUS: '调整设备焦距'
|
|
8266
|
-
};
|
|
8267
|
-
|
|
8268
|
-
var PTZ_DEFAULT_OPTIONS = {
|
|
8269
|
-
language: 'zh',
|
|
8270
|
-
env: {
|
|
8271
|
-
domain: 'https://open.ys7.com'
|
|
8272
|
-
},
|
|
8273
|
-
accessToken: '',
|
|
8274
|
-
speed: 2,
|
|
8275
|
-
locales: {
|
|
8276
|
-
zh: zh_CN,
|
|
8277
|
-
en: en_US
|
|
8278
|
-
}
|
|
8279
|
-
};
|
|
8280
|
-
var PTZ_SPEED = {
|
|
8281
|
-
1: 1,
|
|
8282
|
-
2: 3,
|
|
8283
|
-
3: 7,
|
|
8284
|
-
slow: 1,
|
|
8285
|
-
mid: 3,
|
|
8286
|
-
fast: 7
|
|
8287
|
-
};
|
|
8288
|
-
var PTZ_PREFIX = 'ez-ptz';
|
|
8289
|
-
var PTZ_MOBILE_PREFIX = 'ez-mobile-ptz';
|
|
8290
|
-
var PTZ_SPEED_ACTIVE_PREFIX = PTZ_PREFIX + '-speed-active';
|
|
8291
|
-
var PTZ_DIRECTION_PREFIX = PTZ_PREFIX + '-direction';
|
|
8292
|
-
|
|
8293
|
-
var BasePtz = /*#__PURE__*/ function() {
|
|
8294
|
-
function BasePtz(container, options) {
|
|
8295
|
-
if (options === void 0) options = {};
|
|
8296
|
-
var _this_options_locales;
|
|
8297
|
-
if (!container) throw new Error('Ptz container is required');
|
|
8298
|
-
this.options = deepmerge(PTZ_DEFAULT_OPTIONS, options, {
|
|
8299
|
-
clone: false
|
|
8300
|
-
});
|
|
8301
|
-
if ((_this_options_locales = this.options.locales) == null ? void 0 : _this_options_locales[this.options.language]) {
|
|
8302
|
-
var _this_options_locales1;
|
|
8303
|
-
this.locale = (_this_options_locales1 = this.options.locales) == null ? void 0 : _this_options_locales1[this.options.language];
|
|
8304
|
-
} else {
|
|
8305
|
-
var _this_options_locales2;
|
|
8306
|
-
this.locale = (_this_options_locales2 = this.options.locales) == null ? void 0 : _this_options_locales2['zh'];
|
|
8307
|
-
}
|
|
8308
|
-
this.$container = container;
|
|
8309
|
-
this.speed = PTZ_SPEED[this.options.speed || 2];
|
|
8310
|
-
}
|
|
8311
|
-
var _proto = BasePtz.prototype;
|
|
8312
|
-
_proto.updateOptions = function updateOptions(options) {
|
|
8313
|
-
this.options = deepmerge(this.options, options, {
|
|
8314
|
-
clone: false
|
|
8315
|
-
});
|
|
8316
|
-
};
|
|
8317
|
-
_proto.destroy = function destroy() {};
|
|
8318
|
-
return BasePtz;
|
|
8319
|
-
}();
|
|
8320
|
-
|
|
8321
|
-
function _inherits$1(subClass, superClass) {
|
|
8322
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
8323
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
8324
|
-
}
|
|
8325
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
8326
|
-
constructor: {
|
|
8327
|
-
value: subClass,
|
|
8328
|
-
writable: true,
|
|
8329
|
-
configurable: true
|
|
8330
|
-
}
|
|
8331
|
-
});
|
|
8332
|
-
if (superClass) _set_prototype_of$1(subClass, superClass);
|
|
8333
|
-
}
|
|
8334
|
-
function _set_prototype_of$1(o, p) {
|
|
8335
|
-
_set_prototype_of$1 = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
8336
|
-
o.__proto__ = p;
|
|
8337
|
-
return o;
|
|
8338
|
-
};
|
|
8339
|
-
return _set_prototype_of$1(o, p);
|
|
8340
|
-
}
|
|
8341
|
-
var MobilePtz = /*#__PURE__*/ function(BasePtz) {
|
|
8342
|
-
_inherits$1(MobilePtz, BasePtz);
|
|
8343
|
-
function MobilePtz(container, options) {
|
|
8344
|
-
var _this;
|
|
8345
|
-
_this = BasePtz.call(this, container, options) || this;
|
|
8346
|
-
_this._touchstart = _this._touchstart.bind(_this);
|
|
8347
|
-
_this._touchend = _this._touchend.bind(_this);
|
|
8348
|
-
_this._render();
|
|
8349
|
-
return _this;
|
|
8350
|
-
}
|
|
8351
|
-
var _proto = MobilePtz.prototype;
|
|
8352
|
-
_proto.destroy = function destroy() {
|
|
8353
|
-
this._removeEventListener();
|
|
8354
|
-
if (this.$content) {
|
|
8355
|
-
this.$content.remove();
|
|
8356
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
8357
|
-
this.$content = null;
|
|
8358
|
-
}
|
|
8359
|
-
BasePtz.prototype.destroy.call(this);
|
|
8360
|
-
};
|
|
8361
|
-
_proto._render = function _render() {
|
|
8362
|
-
this.$content = document.createElement('div');
|
|
8363
|
-
this.$content.classList.add(PTZ_MOBILE_PREFIX + '-content');
|
|
8364
|
-
this.$content.innerHTML = '\n <div class="' + PTZ_MOBILE_PREFIX + '-wrap">\n <div class="' + PTZ_MOBILE_PREFIX + '-container">\n <div class="' + PTZ_MOBILE_PREFIX + "-center " + PTZ_MOBILE_PREFIX + '-center"></div>\n <div class="' + PTZ_MOBILE_PREFIX + "-icon " + PTZ_MOBILE_PREFIX + "-top " + PTZ_MOBILE_PREFIX + '-default"></div>\n <div class="' + PTZ_MOBILE_PREFIX + "-icon " + PTZ_MOBILE_PREFIX + "-left " + PTZ_MOBILE_PREFIX + '-default"></div>\n <div class="' + PTZ_MOBILE_PREFIX + "-icon " + PTZ_MOBILE_PREFIX + "-bottom " + PTZ_MOBILE_PREFIX + '-default"></div>\n <div class="' + PTZ_MOBILE_PREFIX + "-icon " + PTZ_MOBILE_PREFIX + "-right " + PTZ_MOBILE_PREFIX + '-default"></div>\n </div>\n </div>\n ';
|
|
8365
|
-
this.$container.appendChild(this.$content);
|
|
8366
|
-
this._addEventListener();
|
|
8367
|
-
};
|
|
8368
|
-
_proto._addEventListener = function _addEventListener() {
|
|
8369
|
-
// 云台控制事件绑定
|
|
8370
|
-
var $warp = this.$content.querySelector("." + PTZ_MOBILE_PREFIX + "-wrap");
|
|
8371
|
-
var touchstart = 'PointerEvent' in window ? 'pointerdown' : 'touchstart';
|
|
8372
|
-
var touchend = 'PointerEvent' in window ? 'pointerup' : 'touchend';
|
|
8373
|
-
if ($warp) {
|
|
8374
|
-
$warp.addEventListener(touchstart, this._touchstart);
|
|
8375
|
-
$warp.addEventListener(touchend, this._touchend);
|
|
8376
|
-
}
|
|
8377
|
-
};
|
|
8378
|
-
_proto._touchstart = function _touchstart(e) {
|
|
8379
|
-
e.preventDefault();
|
|
8380
|
-
this._handlePtzTouch(e, 'start');
|
|
8381
|
-
};
|
|
8382
|
-
_proto._touchend = function _touchend(e) {
|
|
8383
|
-
e.preventDefault();
|
|
8384
|
-
this._handlePtzTouch(e, 'stop');
|
|
8385
|
-
};
|
|
8386
|
-
_proto._removeEventListener = function _removeEventListener() {
|
|
8387
|
-
var $warp = this.$content.querySelector("." + PTZ_MOBILE_PREFIX + "-wrap");
|
|
8388
|
-
var touchstart = 'PointerEvent' in window ? 'pointerdown' : 'touchstart';
|
|
8389
|
-
var touchend = 'PointerEvent' in window ? 'pointerup' : 'touchend';
|
|
8390
|
-
if ($warp) {
|
|
8391
|
-
$warp.removeEventListener(touchstart, this._touchstart);
|
|
8392
|
-
$warp.removeEventListener(touchend, this._touchend);
|
|
8393
|
-
}
|
|
8394
|
-
};
|
|
8395
|
-
_proto._handlePtzTouch = function _handlePtzTouch(e, type) {
|
|
8396
|
-
var _this_options_token_deviceToken, _this_options_token, _e_changedTouches_, _e_changedTouches_1, _this_options_env, _this_options_token_deviceToken1, _this_options_token1;
|
|
8397
|
-
if (!(this.options.accessToken || ((_this_options_token = this.options.token) == null ? void 0 : (_this_options_token_deviceToken = _this_options_token.deviceToken) == null ? void 0 : _this_options_token_deviceToken.video))) throw new Error('Ptz accessToken or token.deviceToken.video is required');
|
|
8398
|
-
var $warp = this.$content.querySelector("." + PTZ_MOBILE_PREFIX + "-wrap");
|
|
8399
|
-
var rect = $warp.getBoundingClientRect();
|
|
8400
|
-
var containerCenterX = rect.left + 130;
|
|
8401
|
-
var containerCenterY = rect.top + 130;
|
|
8402
|
-
var eventX = e.x || ((_e_changedTouches_ = e.changedTouches[0]) == null ? void 0 : _e_changedTouches_.clientX);
|
|
8403
|
-
var eventY = e.y || ((_e_changedTouches_1 = e.changedTouches[0]) == null ? void 0 : _e_changedTouches_1.clientY);
|
|
8404
|
-
var left = eventX - containerCenterX;
|
|
8405
|
-
var top = eventY - containerCenterY;
|
|
8406
|
-
var direction = 0; // 操作命令:0-上,1-下,2-左,3右,4-左上,5-左下,6-右上,7-右下,8-放大,9-缩小,10-近焦距,11-远焦距
|
|
8407
|
-
var url = ((_this_options_env = this.options.env) == null ? void 0 : _this_options_env.domain) + '/api/lapp/device/ptz/start';
|
|
8408
|
-
var token = this.options.accessToken || ((_this_options_token1 = this.options.token) == null ? void 0 : (_this_options_token_deviceToken1 = _this_options_token1.deviceToken) == null ? void 0 : _this_options_token_deviceToken1.video);
|
|
8409
|
-
var $icons = $warp.querySelectorAll("." + PTZ_MOBILE_PREFIX + "-icon");
|
|
8410
|
-
// 判读方位
|
|
8411
|
-
if (Math.abs(left) > Math.abs(top)) {
|
|
8412
|
-
if (left > 0) {
|
|
8413
|
-
direction = 3;
|
|
8414
|
-
$icons[3].className = $icons[3].className.replace("" + PTZ_MOBILE_PREFIX + "-default", "" + PTZ_MOBILE_PREFIX + "-active");
|
|
8415
|
-
} else {
|
|
8416
|
-
direction = 2;
|
|
8417
|
-
$icons[1].className = $icons[1].className.replace("" + PTZ_MOBILE_PREFIX + "-default", "" + PTZ_MOBILE_PREFIX + "-active");
|
|
8418
|
-
}
|
|
8419
|
-
} else {
|
|
8420
|
-
if (top > 0) {
|
|
8421
|
-
direction = 1;
|
|
8422
|
-
$icons[2].className = $icons[2].className.replace("" + PTZ_MOBILE_PREFIX + "-default", "" + PTZ_MOBILE_PREFIX + "-active");
|
|
8423
|
-
} else {
|
|
8424
|
-
direction = 0;
|
|
8425
|
-
$icons[0].className = $icons[0].className.replace("" + PTZ_MOBILE_PREFIX + "-default", "" + PTZ_MOBILE_PREFIX + "-active");
|
|
8426
|
-
}
|
|
8427
|
-
}
|
|
8428
|
-
$warp.style.cssText = "background-image:linear-gradient(" + (direction === 0 ? 180 : direction === 1 ? 0 : direction === 2 ? 90 : 270) + "deg, #c0ddf1 0%, rgba(100,143,252,0.00) 50%)";
|
|
8429
|
-
if (type === 'stop') {
|
|
8430
|
-
var _this_options_env1;
|
|
8431
|
-
url = ((_this_options_env1 = this.options.env) == null ? void 0 : _this_options_env1.domain) + '/api/lapp/device/ptz/stop';
|
|
8432
|
-
$warp.style.cssText = '';
|
|
8433
|
-
$icons[3].className = $icons[3].className.replace("" + PTZ_MOBILE_PREFIX + "-active", "" + PTZ_MOBILE_PREFIX + "-default");
|
|
8434
|
-
$icons[1].className = $icons[1].className.replace("" + PTZ_MOBILE_PREFIX + "-active", "" + PTZ_MOBILE_PREFIX + "-default");
|
|
8435
|
-
$icons[2].className = $icons[2].className.replace("" + PTZ_MOBILE_PREFIX + "-active", "" + PTZ_MOBILE_PREFIX + "-default");
|
|
8436
|
-
$icons[0].className = $icons[0].className.replace("" + PTZ_MOBILE_PREFIX + "-active", "" + PTZ_MOBILE_PREFIX + "-default");
|
|
8437
|
-
}
|
|
8438
|
-
// 这个控件暂时没有 ptzSpeed 和areaId 和backDeg 的值
|
|
8439
|
-
// this.jSPlugin?.eventEmitter?.emit(EVENTS.ptz.ptzDirection, {
|
|
8440
|
-
// type,
|
|
8441
|
-
// direction,
|
|
8442
|
-
// isRotate: false,
|
|
8443
|
-
// ptzSpeed: 1,
|
|
8444
|
-
// });
|
|
8445
|
-
var operationResultCb = this.options.onDirection == null ? void 0 : this.options.onDirection.call(this.options, {
|
|
8446
|
-
direction: direction,
|
|
8447
|
-
speed: this.speed,
|
|
8448
|
-
type: type
|
|
8449
|
-
});
|
|
8450
|
-
var data = new FormData();
|
|
8451
|
-
data.append('deviceSerial', this.options.deviceSerial + '');
|
|
8452
|
-
data.append('channelNo', this.options.channelNo + '');
|
|
8453
|
-
data.append('speed', '1');
|
|
8454
|
-
data.append('direction', direction + '');
|
|
8455
|
-
data.append('accessToken', token);
|
|
8456
|
-
// prettier-ignore
|
|
8457
|
-
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
|
8458
|
-
fetch(url, {
|
|
8459
|
-
method: 'POST',
|
|
8460
|
-
body: data
|
|
8461
|
-
}).then(function(response) {
|
|
8462
|
-
return response.json();
|
|
8463
|
-
}).then(function(rt) {
|
|
8464
|
-
if (rt.code === 200) ; else {
|
|
8465
|
-
// this.jSPlugin?.logger?.error('[errors]', this.jSPlugin.i18n.t('38' + rt.code) + `(${rt.code})`);
|
|
8466
|
-
// const msg = this.jSPlugin.i18n.t('38' + rt.code) || rt.msg;
|
|
8467
|
-
// this.pluginStatus.loadingSetText({
|
|
8468
|
-
// text: msg,
|
|
8469
|
-
// color: 'red',
|
|
8470
|
-
// delayClear: 2000,
|
|
8471
|
-
// });
|
|
8472
|
-
if ([
|
|
8473
|
-
60005,
|
|
8474
|
-
60002,
|
|
8475
|
-
60003,
|
|
8476
|
-
60004
|
|
8477
|
-
].includes(+rt.code)) {
|
|
8478
|
-
$warp.style.cssText = "background-image:linear-gradient(" + (direction === 0 ? 180 : direction === 1 ? 0 : direction === 2 ? 90 : 270) + "deg, #f45656 0%, rgba(100,143,252,0.00) 50%)";
|
|
8479
|
-
}
|
|
8480
|
-
}
|
|
8481
|
-
operationResultCb == null ? void 0 : operationResultCb(rt);
|
|
8482
|
-
}).catch(function(err) {
|
|
8483
|
-
}).finally(function() {
|
|
8484
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
8485
|
-
operationResultCb = null;
|
|
8486
|
-
});
|
|
8487
|
-
};
|
|
8488
|
-
return MobilePtz;
|
|
8489
|
-
}(BasePtz);
|
|
8490
|
-
|
|
8491
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
8492
|
-
try {
|
|
8493
|
-
var info = gen[key](arg);
|
|
8494
|
-
var value = info.value;
|
|
8495
|
-
} catch (error) {
|
|
8496
|
-
reject(error);
|
|
8497
|
-
return;
|
|
8498
|
-
}
|
|
8499
|
-
if (info.done) {
|
|
8500
|
-
resolve(value);
|
|
8501
|
-
} else {
|
|
8502
|
-
Promise.resolve(value).then(_next, _throw);
|
|
8503
|
-
}
|
|
8504
|
-
}
|
|
8505
|
-
function _async_to_generator(fn) {
|
|
8506
|
-
return function() {
|
|
8507
|
-
var self = this, args = arguments;
|
|
8508
|
-
return new Promise(function(resolve, reject) {
|
|
8509
|
-
var gen = fn.apply(self, args);
|
|
8510
|
-
function _next(value) {
|
|
8511
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
8512
|
-
}
|
|
8513
|
-
function _throw(err) {
|
|
8514
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
8515
|
-
}
|
|
8516
|
-
_next(undefined);
|
|
8517
|
-
});
|
|
8518
|
-
};
|
|
8519
|
-
}
|
|
8520
|
-
function _defineProperties(target, props) {
|
|
8521
|
-
for(var i = 0; i < props.length; i++){
|
|
8522
|
-
var descriptor = props[i];
|
|
8523
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
8524
|
-
descriptor.configurable = true;
|
|
8525
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
8526
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
8527
|
-
}
|
|
8528
|
-
}
|
|
8529
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
8530
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
8531
|
-
return Constructor;
|
|
8532
|
-
}
|
|
8533
|
-
function _inherits(subClass, superClass) {
|
|
8534
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
8535
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
8536
|
-
}
|
|
8537
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
8538
|
-
constructor: {
|
|
8539
|
-
value: subClass,
|
|
8540
|
-
writable: true,
|
|
8541
|
-
configurable: true
|
|
8542
|
-
}
|
|
8543
|
-
});
|
|
8544
|
-
if (superClass) _set_prototype_of(subClass, superClass);
|
|
8545
|
-
}
|
|
8546
|
-
function _set_prototype_of(o, p) {
|
|
8547
|
-
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
8548
|
-
o.__proto__ = p;
|
|
8549
|
-
return o;
|
|
8550
|
-
};
|
|
8551
|
-
return _set_prototype_of(o, p);
|
|
8552
|
-
}
|
|
8553
|
-
function _ts_generator(thisArg, body) {
|
|
8554
|
-
var f, y, t, _ = {
|
|
8555
|
-
label: 0,
|
|
8556
|
-
sent: function() {
|
|
8557
|
-
if (t[0] & 1) throw t[1];
|
|
8558
|
-
return t[1];
|
|
8559
|
-
},
|
|
8560
|
-
trys: [],
|
|
8561
|
-
ops: []
|
|
8562
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
8563
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
8564
|
-
return this;
|
|
8565
|
-
}), g;
|
|
8566
|
-
function verb(n) {
|
|
8567
|
-
return function(v) {
|
|
8568
|
-
return step([
|
|
8569
|
-
n,
|
|
8570
|
-
v
|
|
8571
|
-
]);
|
|
8572
|
-
};
|
|
8573
|
-
}
|
|
8574
|
-
function step(op) {
|
|
8575
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
8576
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
8577
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
8578
|
-
if (y = 0, t) op = [
|
|
8579
|
-
op[0] & 2,
|
|
8580
|
-
t.value
|
|
8581
|
-
];
|
|
8582
|
-
switch(op[0]){
|
|
8583
|
-
case 0:
|
|
8584
|
-
case 1:
|
|
8585
|
-
t = op;
|
|
8586
|
-
break;
|
|
8587
|
-
case 4:
|
|
8588
|
-
_.label++;
|
|
8589
|
-
return {
|
|
8590
|
-
value: op[1],
|
|
8591
|
-
done: false
|
|
8592
|
-
};
|
|
8593
|
-
case 5:
|
|
8594
|
-
_.label++;
|
|
8595
|
-
y = op[1];
|
|
8596
|
-
op = [
|
|
8597
|
-
0
|
|
8598
|
-
];
|
|
8599
|
-
continue;
|
|
8600
|
-
case 7:
|
|
8601
|
-
op = _.ops.pop();
|
|
8602
|
-
_.trys.pop();
|
|
8603
|
-
continue;
|
|
8604
|
-
default:
|
|
8605
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
8606
|
-
_ = 0;
|
|
8607
|
-
continue;
|
|
8608
|
-
}
|
|
8609
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
8610
|
-
_.label = op[1];
|
|
8611
|
-
break;
|
|
8612
|
-
}
|
|
8613
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
8614
|
-
_.label = t[1];
|
|
8615
|
-
t = op;
|
|
8616
|
-
break;
|
|
8617
|
-
}
|
|
8618
|
-
if (t && _.label < t[2]) {
|
|
8619
|
-
_.label = t[2];
|
|
8620
|
-
_.ops.push(op);
|
|
8621
|
-
break;
|
|
8622
|
-
}
|
|
8623
|
-
if (t[2]) _.ops.pop();
|
|
8624
|
-
_.trys.pop();
|
|
8625
|
-
continue;
|
|
8626
|
-
}
|
|
8627
|
-
op = body.call(thisArg, _);
|
|
8628
|
-
} catch (e) {
|
|
8629
|
-
op = [
|
|
8630
|
-
6,
|
|
8631
|
-
e
|
|
8632
|
-
];
|
|
8633
|
-
y = 0;
|
|
8634
|
-
} finally{
|
|
8635
|
-
f = t = 0;
|
|
8636
|
-
}
|
|
8637
|
-
if (op[0] & 5) throw op[1];
|
|
8638
|
-
return {
|
|
8639
|
-
value: op[0] ? op[1] : void 0,
|
|
8640
|
-
done: true
|
|
8641
|
-
};
|
|
8642
|
-
}
|
|
8643
|
-
}
|
|
8644
|
-
/**
|
|
8645
|
-
* @class Ptz
|
|
8646
|
-
* @classdesc 云台控制
|
|
8647
|
-
*
|
|
8648
|
-
* @example
|
|
8649
|
-
* // 初始化云台控制
|
|
8650
|
-
* // 显示云台控制
|
|
8651
|
-
* ptz.show()
|
|
8652
|
-
* // 隐藏云台控制
|
|
8653
|
-
* ptz.hide()
|
|
8654
|
-
*/ var Ptz = /*#__PURE__*/ function(BasePtz) {
|
|
8655
|
-
_inherits(Ptz, BasePtz);
|
|
8656
|
-
function Ptz(container, options) {
|
|
8657
|
-
if (options === void 0) options = {};
|
|
8658
|
-
var _this;
|
|
8659
|
-
_this = BasePtz.call(this, container, options) || this, _this._isMobile = utilsTools.isMobile(), _this._isRotate = false, _this._clearTimer = null;
|
|
8660
|
-
_this._$wrapper = document.createElement('div');
|
|
8661
|
-
_this._$wrapper.className = PTZ_PREFIX + '-container-wrap';
|
|
8662
|
-
_this._$directionCircleContainer = document.createElement('div');
|
|
8663
|
-
_this._$directionCircleContainer.classList.add(PTZ_PREFIX + '-container');
|
|
8664
|
-
_this._$directionCircleContainer.innerHTML = '\n <div class="' + PTZ_PREFIX + "-main " + PTZ_DIRECTION_PREFIX + '-center"></div>\n <div class="' + PTZ_PREFIX + "-icon " + PTZ_DIRECTION_PREFIX + '-top" data-direction="0"></div>\n <div class="' + PTZ_PREFIX + "-icon " + PTZ_DIRECTION_PREFIX + '-top-left" data-direction="4"></div>\n <div class="' + PTZ_PREFIX + "-icon " + PTZ_DIRECTION_PREFIX + '-left" data-direction="2"></div>\n <div class="' + PTZ_PREFIX + "-icon " + PTZ_DIRECTION_PREFIX + '-left-bottom" data-direction="5"></div>\n <div class="' + PTZ_PREFIX + "-icon " + PTZ_DIRECTION_PREFIX + '-bottom" data-direction="1"></div>\n <div class="' + PTZ_PREFIX + "-icon " + PTZ_DIRECTION_PREFIX + '-bottom-right" data-direction="7"></div>\n <div class="' + PTZ_PREFIX + "-icon " + PTZ_DIRECTION_PREFIX + '-right" data-direction="3"></div>\n <div class="' + PTZ_PREFIX + "-icon " + PTZ_DIRECTION_PREFIX + '-right-top" data-direction="6"></div>\n ';
|
|
8665
|
-
_this._$wrapper.appendChild(_this._$directionCircleContainer);
|
|
8666
|
-
_this._$speedContainer = document.createElement('div');
|
|
8667
|
-
_this._$speedContainer.classList.add(PTZ_PREFIX + '-speed-container');
|
|
8668
|
-
_this._$speedContainer.innerHTML = '\n <div class="' + PTZ_PREFIX + '-speed-progress" title="' + _this.locale['PTZ_SPEED'] + '">\n <div class="' + PTZ_PREFIX + '-speed-progress-line">\n <div class="' + PTZ_PREFIX + "-speed-progress-line-dot " + (_this.speed === 1 ? PTZ_SPEED_ACTIVE_PREFIX : '') + '" data-id="slow" data-index="1" data-value="1"></div>\n <div class="' + PTZ_PREFIX + "-speed-progress-line-dot " + (_this.speed === 3 ? PTZ_SPEED_ACTIVE_PREFIX : '') + '" data-id="mid" data-index="2" data-value="3"></div>\n <div class="' + PTZ_PREFIX + "-speed-progress-line-dot " + (_this.speed === 7 ? PTZ_SPEED_ACTIVE_PREFIX : '') + '" data-id="fast" data-index="3" data-value="7"></div>\n </div>\n <div class="' + PTZ_PREFIX + '-speed-progress-points">\n <div class="' + PTZ_PREFIX + '-speed-progress-points-slow">\n ' + _this.locale['PTZ_SLOW'] + '\n </div>\n <div class="' + PTZ_PREFIX + '-speed-progress-points-mid">\n ' + _this.locale['PTZ_MID'] + '\n </div>\n <div class="' + PTZ_PREFIX + '-speed-progress-points-fast">\n ' + _this.locale['PTZ_FAST'] + "\n </div>\n </div>\n </div>\n ";
|
|
8669
|
-
_this._$wrapper.appendChild(_this._$speedContainer);
|
|
8670
|
-
_this._$btnContainer = document.createElement('div');
|
|
8671
|
-
_this._$btnContainer.classList.add(PTZ_PREFIX + '-btn-container');
|
|
8672
|
-
_this._$btnContainer.innerHTML = '\n <div class="' + PTZ_PREFIX + '-btn-zoom" title="' + _this.locale['DEVICE_ZOOM'] + '" style="user-select: none;">\n <div class="' + PTZ_PREFIX + '-btn-zoom-add" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M563.2 198.4c179.2 0 326.4 147.2 326.4 326.4s-147.2 326.4-326.4 326.4S230.4 704 230.4 524.8s147.2-326.4 332.8-326.4z m0 64c-147.2 0-262.4 115.2-262.4 262.4s115.2 262.4 262.4 262.4 262.4-115.2 262.4-262.4S704 262.4 563.2 262.4z" fill="#ffffff"></path>\n <path d="M691.2 556.8H428.8c-19.2 0-32-12.8-32-32s12.8-32 32-32h262.4c19.2 0 32 12.8 32 32s-12.8 32-32 32z" fill="#ffffff">\n </path>\n <path d="M556.8 691.2c-19.2 0-32-12.8-32-32V396.8c0-19.2 12.8-32 32-32s32 12.8 32 32v262.4c0 19.2-12.8 32-32 32z" fill="#ffffff"></path>\n </svg>\n </div>\n <div class="' + PTZ_PREFIX + '-btn-zoom-sub" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M569.6 838.4c-172.8 0-307.2-140.8-307.2-307.2s140.8-307.2 307.2-307.2 307.2 140.8 307.2 307.2-140.8 307.2-307.2 307.2z m0-64c134.4 0 249.6-108.8 249.6-249.6S704 281.6 569.6 281.6 320 396.8 320 531.2s108.8 243.2 249.6 243.2z" fill="#ffffff"></path>\n <path d="M691.2 563.2H448c-19.2 0-32-12.8-32-32s12.8-38.4 32-38.4h249.6c19.2 0 32 12.8 32 32s-19.2 38.4-38.4 38.4z" fill="#ffffff"></path>\n </svg>\n </div>\n </div>\n <div class="' + PTZ_PREFIX + '-btn-focal" title="' + _this.locale['DEVICE_FOCUS'] + '" style="user-select: none;">\n <div class="' + PTZ_PREFIX + '-btn-focal-add" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M646.4 825.6H320c-44.8 0-83.2-38.4-83.2-83.2V409.6c0-44.8 38.4-83.2 83.2-83.2h326.4c44.8 0 83.2 38.4 83.2 83.2v326.4c0 51.2-38.4 89.6-83.2 89.6zM320 390.4c-12.8 0-19.2 6.4-19.2 19.2v326.4c0 12.8 6.4 19.2 19.2 19.2h326.4c12.8 0 19.2-6.4 19.2-19.2V409.6c0-12.8-6.4-19.2-19.2-19.2H320z" fill="#ffffff"></path>\n <path d="M396.8 358.4V281.6c0-25.6 25.6-51.2 51.2-51.2h326.4c25.6 0 51.2 25.6 51.2 51.2v326.4c0 25.6-25.6 51.2-51.2 51.2H704l-6.4-268.8" fill="#ffffff"></path>\n </svg>\n </div>\n <div class="' + PTZ_PREFIX + '-btn-focal-sub" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M320 358.4h326.4c25.6 0 51.2 25.6 51.2 51.2v326.4c0 25.6-25.6 51.2-51.2 51.2H320c-25.6 0-51.2-25.6-51.2-51.2V409.6c0-25.6 25.6-51.2 51.2-51.2z" fill="#ffffff"></path>\n <path d="M774.4 697.6H704c-19.2 0-32-12.8-32-32s12.8-32 32-32h70.4c12.8 0 19.2-6.4 19.2-19.2V281.6c0-12.8-6.4-19.2-19.2-19.2H448c-12.8 0-19.2 6.4-19.2 19.2v70.4c0 19.2-12.8 32-32 32s-32-12.8-32-25.6V281.6c0-44.8 38.4-83.2 83.2-83.2h326.4c44.8 0 83.2 38.4 83.2 83.2v326.4c0 51.2-38.4 89.6-83.2 89.6z" fill="#ffffff"></path>\n </svg>\n </div>\n </div>\n ';
|
|
8673
|
-
_this._$wrapper.appendChild(_this._$btnContainer);
|
|
8674
|
-
container.appendChild(_this._$wrapper);
|
|
8675
|
-
// 云台控制事件绑定
|
|
8676
|
-
// 云台控制
|
|
8677
|
-
_this._$directionCircleContainer.onmousedown = function(e) {
|
|
8678
|
-
e.preventDefault();
|
|
8679
|
-
e.stopPropagation();
|
|
8680
|
-
_this._handlePtzTouch(e, 'start');
|
|
8681
|
-
};
|
|
8682
|
-
_this._$directionCircleContainer.onmouseup = function(e) {
|
|
8683
|
-
e.preventDefault();
|
|
8684
|
-
e.stopPropagation();
|
|
8685
|
-
_this._handlePtzTouch(e, 'stop');
|
|
8686
|
-
};
|
|
8687
|
-
_this._$directionCircleContainer.ontouchstart = function(e) {
|
|
8688
|
-
e.preventDefault();
|
|
8689
|
-
e.stopPropagation();
|
|
8690
|
-
_this._handlePtzTouch(e, 'start');
|
|
8691
|
-
};
|
|
8692
|
-
_this._$directionCircleContainer.ontouchend = function(e) {
|
|
8693
|
-
e.preventDefault();
|
|
8694
|
-
e.stopPropagation();
|
|
8695
|
-
_this._handlePtzTouch(e, 'stop');
|
|
8696
|
-
};
|
|
8697
|
-
_this._onSwitchSpeed = function(e) {
|
|
8698
|
-
var list = Array.from(_this._$speedContainer.querySelectorAll("." + PTZ_PREFIX + "-speed-progress-line-dot"));
|
|
8699
|
-
if (list.includes(e.target) && !e.target.classList.contains(PTZ_SPEED_ACTIVE_PREFIX)) {
|
|
8700
|
-
list.forEach(function(item) {
|
|
8701
|
-
if (item === e.target) {
|
|
8702
|
-
item.classList.add(PTZ_SPEED_ACTIVE_PREFIX);
|
|
8703
|
-
} else {
|
|
8704
|
-
item.classList.remove(PTZ_SPEED_ACTIVE_PREFIX);
|
|
8705
|
-
}
|
|
8706
|
-
});
|
|
8707
|
-
var value = e.target.getAttribute('data-value');
|
|
8708
|
-
var index = e.target.getAttribute('data-index');
|
|
8709
|
-
_this.speed = +value;
|
|
8710
|
-
_this.options.onSpeedChange == null ? void 0 : _this.options.onSpeedChange.call(_this.options, +index);
|
|
8711
|
-
}
|
|
8712
|
-
};
|
|
8713
|
-
// mouse 事件绑定
|
|
8714
|
-
// 云台速度变化事件绑定
|
|
8715
|
-
_this._$speedContainer.onmouseup = _this._onSwitchSpeed;
|
|
8716
|
-
if (_this._isMobile) {
|
|
8717
|
-
_this._$speedContainer.ontouchend = _this._onSwitchSpeed;
|
|
8718
|
-
}
|
|
8719
|
-
if (_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-zoom-add")) {
|
|
8720
|
-
// 物理缩放、变焦按钮事件监听
|
|
8721
|
-
_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-zoom-add").onmousedown = function(e) {
|
|
8722
|
-
e.preventDefault();
|
|
8723
|
-
e.stopPropagation();
|
|
8724
|
-
_this._handleBtnTouch('zoom', 'add', 'start');
|
|
8725
|
-
};
|
|
8726
|
-
_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-zoom-add").onmouseup = function(e) {
|
|
8727
|
-
e.preventDefault();
|
|
8728
|
-
e.stopPropagation();
|
|
8729
|
-
_this._handleBtnTouch('zoom', 'add', 'stop');
|
|
8730
|
-
};
|
|
8731
|
-
}
|
|
8732
|
-
if (_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-zoom-sub")) {
|
|
8733
|
-
_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-zoom-sub").onmousedown = function(e) {
|
|
8734
|
-
e.preventDefault();
|
|
8735
|
-
e.stopPropagation();
|
|
8736
|
-
_this._handleBtnTouch('zoom', 'sub', 'start');
|
|
8737
|
-
};
|
|
8738
|
-
_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-zoom-sub").onmouseup = function(e) {
|
|
8739
|
-
e.preventDefault();
|
|
8740
|
-
e.stopPropagation();
|
|
8741
|
-
_this._handleBtnTouch('zoom', 'sub', 'stop');
|
|
8742
|
-
};
|
|
8743
|
-
}
|
|
8744
|
-
if (_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-focal-add")) {
|
|
8745
|
-
_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-focal-add").onmousedown = function(e) {
|
|
8746
|
-
e.preventDefault();
|
|
8747
|
-
e.stopPropagation();
|
|
8748
|
-
_this._handleBtnTouch('focal', 'add', 'start');
|
|
8749
|
-
};
|
|
8750
|
-
_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-focal-add").onmouseup = function(e) {
|
|
8751
|
-
e.preventDefault();
|
|
8752
|
-
e.stopPropagation();
|
|
8753
|
-
_this._handleBtnTouch('focal', 'add', 'stop');
|
|
8754
|
-
};
|
|
8755
|
-
}
|
|
8756
|
-
if (_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-focal-sub")) {
|
|
8757
|
-
_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-focal-sub").onmousedown = function(e) {
|
|
8758
|
-
e.preventDefault();
|
|
8759
|
-
e.stopPropagation();
|
|
8760
|
-
_this._handleBtnTouch('focal', 'sub', 'start');
|
|
8761
|
-
};
|
|
8762
|
-
_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-focal-sub").onmouseup = function(e) {
|
|
8763
|
-
e.preventDefault();
|
|
8764
|
-
e.stopPropagation();
|
|
8765
|
-
_this._handleBtnTouch('focal', 'sub', 'stop');
|
|
8766
|
-
};
|
|
8767
|
-
}
|
|
8768
|
-
// mobile touch 事件监听
|
|
8769
|
-
if (_this._isMobile) {
|
|
8770
|
-
if (_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-zoom-add")) {
|
|
8771
|
-
_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-zoom-add").ontouchstart = function(e) {
|
|
8772
|
-
e.preventDefault();
|
|
8773
|
-
e.stopPropagation();
|
|
8774
|
-
_this._handleBtnTouch('zoom', 'add', 'start');
|
|
8775
|
-
};
|
|
8776
|
-
_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-zoom-add").ontouchend = function(e) {
|
|
8777
|
-
e.preventDefault();
|
|
8778
|
-
e.stopPropagation();
|
|
8779
|
-
_this._handleBtnTouch('zoom', 'add', 'stop');
|
|
8780
|
-
};
|
|
8781
|
-
}
|
|
8782
|
-
if (_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-zoom-sub")) {
|
|
8783
|
-
_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-zoom-sub").ontouchstart = function(e) {
|
|
8784
|
-
e.preventDefault();
|
|
8785
|
-
e.stopPropagation();
|
|
8786
|
-
_this._handleBtnTouch('zoom', 'sub', 'start');
|
|
8787
|
-
};
|
|
8788
|
-
_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-zoom-sub").ontouchend = function(e) {
|
|
8789
|
-
e.preventDefault();
|
|
8790
|
-
e.stopPropagation();
|
|
8791
|
-
_this._handleBtnTouch('zoom', 'sub', 'stop');
|
|
8792
|
-
};
|
|
8793
|
-
}
|
|
8794
|
-
if (_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-focal-add")) {
|
|
8795
|
-
_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-focal-add").ontouchstart = function(e) {
|
|
8796
|
-
e.preventDefault();
|
|
8797
|
-
e.stopPropagation();
|
|
8798
|
-
_this._handleBtnTouch('focal', 'add', 'start');
|
|
8799
|
-
};
|
|
8800
|
-
_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-focal-add").ontouchend = function(e) {
|
|
8801
|
-
e.preventDefault();
|
|
8802
|
-
e.stopPropagation();
|
|
8803
|
-
_this._handleBtnTouch('focal', 'add', 'stop');
|
|
8804
|
-
};
|
|
8805
|
-
}
|
|
8806
|
-
if (_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-focal-sub")) {
|
|
8807
|
-
_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-focal-sub").ontouchstart = function(e) {
|
|
8808
|
-
e.preventDefault();
|
|
8809
|
-
e.stopPropagation();
|
|
8810
|
-
_this._handleBtnTouch('focal', 'sub', 'start');
|
|
8811
|
-
};
|
|
8812
|
-
_this._$btnContainer.querySelector("." + PTZ_PREFIX + "-btn-focal-sub").ontouchend = function(e) {
|
|
8813
|
-
e.preventDefault();
|
|
8814
|
-
e.stopPropagation();
|
|
8815
|
-
_this._handleBtnTouch('focal', 'sub', 'stop');
|
|
8816
|
-
};
|
|
8817
|
-
}
|
|
8818
|
-
}
|
|
8819
|
-
return _this;
|
|
8820
|
-
}
|
|
8821
|
-
var _proto = Ptz.prototype;
|
|
8822
|
-
_proto.destroy = function destroy() {
|
|
8823
|
-
if (this._clearTimer) {
|
|
8824
|
-
clearTimeout(this._clearTimer);
|
|
8825
|
-
this._clearTimer = null;
|
|
8826
|
-
}
|
|
8827
|
-
if (this._$directionCircleContainer) {
|
|
8828
|
-
this._$directionCircleContainer.remove();
|
|
8829
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
8830
|
-
this._$directionCircleContainer = null;
|
|
8831
|
-
}
|
|
8832
|
-
if (this._$speedContainer) {
|
|
8833
|
-
this._onSwitchSpeed = null;
|
|
8834
|
-
this._$speedContainer.remove();
|
|
8835
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
8836
|
-
this._$speedContainer = null;
|
|
8837
|
-
}
|
|
8838
|
-
if (this._$btnContainer) {
|
|
8839
|
-
this._$btnContainer.remove();
|
|
8840
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
8841
|
-
this._$btnContainer = null;
|
|
8842
|
-
}
|
|
8843
|
-
if (this._$wrapper) {
|
|
8844
|
-
this._$wrapper.remove();
|
|
8845
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
8846
|
-
this._$wrapper = null;
|
|
8847
|
-
}
|
|
8848
|
-
BasePtz.prototype.destroy.call(this);
|
|
8849
|
-
};
|
|
8850
|
-
_proto._handlePtzTouch = function _handlePtzTouch(e, type) {
|
|
8851
|
-
var _this = this;
|
|
8852
|
-
var _this_options_token_deviceToken, _this_options_token, _this_options_env, _this_options_token_deviceToken1, _this_options_token1;
|
|
8853
|
-
if (!(this.options.accessToken || ((_this_options_token = this.options.token) == null ? void 0 : (_this_options_token_deviceToken = _this_options_token.deviceToken) == null ? void 0 : _this_options_token_deviceToken.video))) throw new Error('Ptz accessToken or token.deviceToken.video is required');
|
|
8854
|
-
// 初始化或获取当前PTZ操作队列
|
|
8855
|
-
if (!this._ptzQueue) {
|
|
8856
|
-
this._ptzQueue = Promise.resolve();
|
|
8857
|
-
}
|
|
8858
|
-
var container = this._$directionCircleContainer.getBoundingClientRect();
|
|
8859
|
-
var containerCenterX = container.left + (this._$directionCircleContainer.clientWidth + 2) / 2;
|
|
8860
|
-
var containerCenterY = container.top + (this._$directionCircleContainer.clientHeight + 2) / 2;
|
|
8861
|
-
var eventX = e.x || e.changedTouches[0].clientX;
|
|
8862
|
-
var eventY = e.y || e.changedTouches[0].clientY;
|
|
8863
|
-
var direction = 0;
|
|
8864
|
-
var url = ((_this_options_env = this.options.env) == null ? void 0 : _this_options_env.domain) + '/api/lapp/device/ptz/start';
|
|
8865
|
-
var token = this.options.accessToken || ((_this_options_token1 = this.options.token) == null ? void 0 : (_this_options_token_deviceToken1 = _this_options_token1.deviceToken) == null ? void 0 : _this_options_token_deviceToken1.video);
|
|
8866
|
-
var backDeg = 0;
|
|
8867
|
-
function getAreaId(x, y) {
|
|
8868
|
-
// 获取当前点击位置相对于圆心的角度
|
|
8869
|
-
var rad = Math.atan2(y, x);
|
|
8870
|
-
if (rad < 0) rad += 2 * Math.PI;
|
|
8871
|
-
var deg = rad * (180 / Math.PI) - 225 - 12.5;
|
|
8872
|
-
if (deg < 0) deg += 360;
|
|
8873
|
-
return Math.floor(deg / 45) + 1;
|
|
8874
|
-
}
|
|
8875
|
-
// 兼容画面旋转90度
|
|
8876
|
-
// const isRotate = false; // /^rotate\(90/.test(document.getElementById(`${this.jSPlugin.id}-wrap`).style.transform);
|
|
8877
|
-
var left = eventX - containerCenterX;
|
|
8878
|
-
var top = eventY - containerCenterY;
|
|
8879
|
-
if (this.isRotate) {
|
|
8880
|
-
switch(getAreaId(left, top)){
|
|
8881
|
-
case 1:
|
|
8882
|
-
direction = 2;
|
|
8883
|
-
backDeg = 90;
|
|
8884
|
-
break;
|
|
8885
|
-
case 2:
|
|
8886
|
-
direction = 4;
|
|
8887
|
-
backDeg = 135;
|
|
8888
|
-
break;
|
|
8889
|
-
case 3:
|
|
8890
|
-
direction = 0;
|
|
8891
|
-
backDeg = 180;
|
|
8892
|
-
break;
|
|
8893
|
-
case 4:
|
|
8894
|
-
direction = 6;
|
|
8895
|
-
backDeg = 225;
|
|
8896
|
-
break;
|
|
8897
|
-
case 5:
|
|
8898
|
-
direction = 3;
|
|
8899
|
-
backDeg = 270;
|
|
8900
|
-
break;
|
|
8901
|
-
case 6:
|
|
8902
|
-
direction = 7;
|
|
8903
|
-
backDeg = 315;
|
|
8904
|
-
break;
|
|
8905
|
-
case 7:
|
|
8906
|
-
direction = 1;
|
|
8907
|
-
backDeg = 0;
|
|
8908
|
-
break;
|
|
8909
|
-
case 8:
|
|
8910
|
-
direction = 5;
|
|
8911
|
-
backDeg = 45;
|
|
8912
|
-
break;
|
|
8913
|
-
}
|
|
8914
|
-
} else {
|
|
8915
|
-
switch(getAreaId(left, top)){
|
|
8916
|
-
case 1:
|
|
8917
|
-
direction = 0;
|
|
8918
|
-
backDeg = 180;
|
|
8919
|
-
break;
|
|
8920
|
-
case 2:
|
|
8921
|
-
direction = 6;
|
|
8922
|
-
backDeg = 225;
|
|
8923
|
-
break;
|
|
8924
|
-
case 3:
|
|
8925
|
-
direction = 3;
|
|
8926
|
-
backDeg = 270;
|
|
8927
|
-
break;
|
|
8928
|
-
case 4:
|
|
8929
|
-
direction = 7;
|
|
8930
|
-
backDeg = 315;
|
|
8931
|
-
break;
|
|
8932
|
-
case 5:
|
|
8933
|
-
direction = 1;
|
|
8934
|
-
backDeg = 0;
|
|
8935
|
-
break;
|
|
8936
|
-
case 6:
|
|
8937
|
-
direction = 5;
|
|
8938
|
-
backDeg = 45;
|
|
8939
|
-
break;
|
|
8940
|
-
case 7:
|
|
8941
|
-
direction = 2;
|
|
8942
|
-
backDeg = 90;
|
|
8943
|
-
break;
|
|
8944
|
-
case 8:
|
|
8945
|
-
direction = 4;
|
|
8946
|
-
backDeg = 135;
|
|
8947
|
-
break;
|
|
8948
|
-
}
|
|
8949
|
-
}
|
|
8950
|
-
if (this._clearTimer) {
|
|
8951
|
-
clearTimeout(this._clearTimer);
|
|
8952
|
-
this._clearTimer = null;
|
|
8953
|
-
}
|
|
8954
|
-
if (type === 'start') {
|
|
8955
|
-
this._$directionCircleContainer.style.cssText = "background-image:linear-gradient(" + backDeg + "deg, #4277FF 0%, rgba(100,143,252,0.00) 30%)";
|
|
8956
|
-
} else {
|
|
8957
|
-
this._$directionCircleContainer.style.cssText = '';
|
|
8958
|
-
}
|
|
8959
|
-
if (type === 'stop') {
|
|
8960
|
-
var _this_options_env1;
|
|
8961
|
-
url = ((_this_options_env1 = this.options.env) == null ? void 0 : _this_options_env1.domain) + '/api/lapp/device/ptz/stop';
|
|
8962
|
-
}
|
|
8963
|
-
var operationResultCb = this.options.onDirection == null ? void 0 : this.options.onDirection.call(this.options, {
|
|
8964
|
-
areaId: getAreaId(left, top),
|
|
8965
|
-
direction: direction,
|
|
8966
|
-
backDeg: backDeg,
|
|
8967
|
-
isRotate: this.isRotate,
|
|
8968
|
-
speed: this.speed,
|
|
8969
|
-
type: type
|
|
8970
|
-
});
|
|
8971
|
-
var data = new FormData();
|
|
8972
|
-
data.append('deviceSerial', this.options.deviceSerial + '');
|
|
8973
|
-
data.append('channelNo', this.options.channelNo + '');
|
|
8974
|
-
data.append('speed', this.speed + '');
|
|
8975
|
-
data.append('direction', direction + '');
|
|
8976
|
-
data.append('accessToken', token);
|
|
8977
|
-
// 将操作加入队列
|
|
8978
|
-
this._ptzQueue = this._ptzQueue.then(function() {
|
|
8979
|
-
return _async_to_generator(function() {
|
|
8980
|
-
var _this;
|
|
8981
|
-
return _ts_generator(this, function(_state) {
|
|
8982
|
-
switch(_state.label){
|
|
8983
|
-
case 0:
|
|
8984
|
-
_this = this;
|
|
8985
|
-
return [
|
|
8986
|
-
4,
|
|
8987
|
-
fetch(url, {
|
|
8988
|
-
method: 'POST',
|
|
8989
|
-
body: data
|
|
8990
|
-
}).then(function(response) {
|
|
8991
|
-
return _async_to_generator(function() {
|
|
8992
|
-
return _ts_generator(this, function(_state) {
|
|
8993
|
-
switch(_state.label){
|
|
8994
|
-
case 0:
|
|
8995
|
-
return [
|
|
8996
|
-
4,
|
|
8997
|
-
response.json()
|
|
8998
|
-
];
|
|
8999
|
-
case 1:
|
|
9000
|
-
return [
|
|
9001
|
-
2,
|
|
9002
|
-
_state.sent()
|
|
9003
|
-
];
|
|
9004
|
-
}
|
|
9005
|
-
});
|
|
9006
|
-
})();
|
|
9007
|
-
}).then(function(rt) {
|
|
9008
|
-
var _rt_result;
|
|
9009
|
-
operationResultCb == null ? void 0 : operationResultCb(rt);
|
|
9010
|
-
var code = rt.code || (rt == null ? void 0 : (_rt_result = rt.result) == null ? void 0 : _rt_result.code);
|
|
9011
|
-
if ([
|
|
9012
|
-
60000,
|
|
9013
|
-
60001,
|
|
9014
|
-
60002,
|
|
9015
|
-
60003,
|
|
9016
|
-
60004,
|
|
9017
|
-
60005,
|
|
9018
|
-
60006,
|
|
9019
|
-
10002
|
|
9020
|
-
].includes(+code)) {
|
|
9021
|
-
_this._$directionCircleContainer.style.cssText = "background-image:linear-gradient(" + backDeg + "deg, #f45656 0%, rgba(100,143,252,0.00) 30%)";
|
|
9022
|
-
}
|
|
9023
|
-
return rt;
|
|
9024
|
-
}).catch(function(err) {
|
|
9025
|
-
}).finally(function() {
|
|
9026
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
9027
|
-
operationResultCb = null;
|
|
9028
|
-
if (type === 'stop') {
|
|
9029
|
-
_this._clearTimer = setTimeout(function() {
|
|
9030
|
-
_this._$directionCircleContainer.style.cssText = '';
|
|
9031
|
-
}, 1000);
|
|
9032
|
-
}
|
|
9033
|
-
})
|
|
9034
|
-
];
|
|
9035
|
-
case 1:
|
|
9036
|
-
// prettier-ignore
|
|
9037
|
-
return [
|
|
9038
|
-
2,
|
|
9039
|
-
_state.sent()
|
|
9040
|
-
];
|
|
9041
|
-
}
|
|
9042
|
-
});
|
|
9043
|
-
}).call(_this);
|
|
9044
|
-
});
|
|
9045
|
-
if (type === 'stop') {
|
|
9046
|
-
this._ptzQueue = this._ptzQueue.finally(function() {});
|
|
9047
|
-
}
|
|
9048
|
-
// this.jSPlugin?.eventEmitter?.emit(EVENTS.ptzDirection, {
|
|
9049
|
-
// areaId: getAreaId(left, top),
|
|
9050
|
-
// direction,
|
|
9051
|
-
// backDeg,
|
|
9052
|
-
// isRotate,
|
|
9053
|
-
// ptzSpeed: this.jSPlugin.ptzSpeed,
|
|
9054
|
-
// type,
|
|
9055
|
-
// });
|
|
9056
|
-
};
|
|
9057
|
-
_proto._handleBtnTouch = function _handleBtnTouch(btn, option, type) {
|
|
9058
|
-
var _this = this;
|
|
9059
|
-
var _this_options_token, _this_options_env, _this_options_token_deviceToken, _this_options_token1;
|
|
9060
|
-
if (!(this.options.accessToken || ((_this_options_token = this.options.token) == null ? void 0 : _this_options_token.deviceToken.video))) throw new Error('Ptz accessToken or token.deviceToken.video is required');
|
|
9061
|
-
// 使用Promise来跟踪当前操作状态
|
|
9062
|
-
if (!this._ptzOperation) {
|
|
9063
|
-
this._ptzOperation = Promise.resolve();
|
|
9064
|
-
}
|
|
9065
|
-
var direction = 8;
|
|
9066
|
-
if (btn === 'zoom') {
|
|
9067
|
-
direction = option === 'add' ? 8 : 9;
|
|
9068
|
-
} else {
|
|
9069
|
-
direction = option === 'add' ? 10 : 11;
|
|
9070
|
-
}
|
|
9071
|
-
var url = ((_this_options_env = this.options.env) == null ? void 0 : _this_options_env.domain) + '/api/lapp/device/ptz/start';
|
|
9072
|
-
var token = this.options.accessToken || ((_this_options_token1 = this.options.token) == null ? void 0 : (_this_options_token_deviceToken = _this_options_token1.deviceToken) == null ? void 0 : _this_options_token_deviceToken.video);
|
|
9073
|
-
if (type === 'stop') {
|
|
9074
|
-
var _this_options_env1;
|
|
9075
|
-
url = ((_this_options_env1 = this.options.env) == null ? void 0 : _this_options_env1.domain) + '/api/lapp/device/ptz/stop';
|
|
9076
|
-
}
|
|
9077
|
-
var operationResultCb = this.options.onDirection == null ? void 0 : this.options.onDirection.call(this.options, {
|
|
9078
|
-
btn: btn,
|
|
9079
|
-
option: option,
|
|
9080
|
-
type: type
|
|
9081
|
-
});
|
|
9082
|
-
var data = new FormData();
|
|
9083
|
-
data.append('deviceSerial', this.options.deviceSerial + '');
|
|
9084
|
-
data.append('channelNo', this.options.channelNo + '');
|
|
9085
|
-
data.append('speed', this.speed + '');
|
|
9086
|
-
data.append('direction', direction + '');
|
|
9087
|
-
data.append('accessToken', token);
|
|
9088
|
-
// 将当前操作加入Promise链
|
|
9089
|
-
this._ptzOperation = this._ptzOperation.then(function() {
|
|
9090
|
-
return _async_to_generator(function() {
|
|
9091
|
-
return _ts_generator(this, function(_state) {
|
|
9092
|
-
switch(_state.label){
|
|
9093
|
-
case 0:
|
|
9094
|
-
return [
|
|
9095
|
-
4,
|
|
9096
|
-
fetch(url, {
|
|
9097
|
-
method: 'POST',
|
|
9098
|
-
body: data
|
|
9099
|
-
}).then(function(response) {
|
|
9100
|
-
return _async_to_generator(function() {
|
|
9101
|
-
return _ts_generator(this, function(_state) {
|
|
9102
|
-
switch(_state.label){
|
|
9103
|
-
case 0:
|
|
9104
|
-
return [
|
|
9105
|
-
4,
|
|
9106
|
-
response.json()
|
|
9107
|
-
];
|
|
9108
|
-
case 1:
|
|
9109
|
-
return [
|
|
9110
|
-
2,
|
|
9111
|
-
_state.sent()
|
|
9112
|
-
];
|
|
9113
|
-
}
|
|
9114
|
-
});
|
|
9115
|
-
})();
|
|
9116
|
-
}).then(function(rt) {
|
|
9117
|
-
operationResultCb == null ? void 0 : operationResultCb(rt);
|
|
9118
|
-
return rt;
|
|
9119
|
-
}).catch(function(err) {
|
|
9120
|
-
}).finally(function() {
|
|
9121
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
9122
|
-
operationResultCb = null;
|
|
9123
|
-
})
|
|
9124
|
-
];
|
|
9125
|
-
case 1:
|
|
9126
|
-
// prettier-ignore
|
|
9127
|
-
return [
|
|
9128
|
-
2,
|
|
9129
|
-
_state.sent()
|
|
9130
|
-
];
|
|
9131
|
-
}
|
|
9132
|
-
});
|
|
9133
|
-
})();
|
|
9134
|
-
});
|
|
9135
|
-
// 如果是stop操作,添加一个清理操作
|
|
9136
|
-
if (type === 'stop') {
|
|
9137
|
-
this._ptzOperation = this._ptzOperation.finally(function() {
|
|
9138
|
-
_this._ptzOperation = null; // 重置操作链
|
|
9139
|
-
});
|
|
9140
|
-
}
|
|
9141
|
-
};
|
|
9142
|
-
_create_class(Ptz, [
|
|
9143
|
-
{
|
|
9144
|
-
key: "isRotate",
|
|
9145
|
-
get: function get() {
|
|
9146
|
-
return this._isRotate;
|
|
9147
|
-
},
|
|
9148
|
-
set: /**
|
|
9149
|
-
* 是否旋转了
|
|
9150
|
-
*/ function set(isRotate) {
|
|
9151
|
-
this._isRotate = isRotate;
|
|
9152
|
-
}
|
|
9153
|
-
}
|
|
9154
|
-
]);
|
|
9155
|
-
return Ptz;
|
|
9156
|
-
}(BasePtz);
|
|
9157
|
-
|
|
9158
|
-
dist$5.BasePtz = BasePtz;
|
|
9159
|
-
dist$5.MobilePtz = MobilePtz;
|
|
9160
|
-
dist$5.Ptz = Ptz;
|
|
9161
|
-
return dist$5;
|
|
9162
|
-
}
|
|
7341
|
+
_this._timer = null;
|
|
7342
|
+
}
|
|
7343
|
+
_this.active = false;
|
|
7344
|
+
}, 200);
|
|
7345
|
+
Control.prototype._onControlClick.call(this, e);
|
|
7346
|
+
};
|
|
7347
|
+
return CapturePicture;
|
|
7348
|
+
}(Control);
|
|
9163
7349
|
|
|
9164
|
-
|
|
7350
|
+
/*
|
|
7351
|
+
* @ezuikit/control-ptz v1.0.0-beta.3
|
|
7352
|
+
* Copyright (c) 2026-05-03 Ezviz-OpenBiz
|
|
7353
|
+
* Released under the MIT License.
|
|
7354
|
+
*/
|
|
7355
|
+
var PTZ_DEFAULT_OPTIONS={language:"zh",env:{domain:"https://open.ys7.com"},accessToken:"",speed:2,locales:{zh:{GET_PTZ_STATUS:"获取当前云台状态",GET_PTZ_STATUS_FAILED:"未加载Theme模块,无法获取云台状态",MOBILE_HIDE_PTZ:"移动端,非全屏状态不展示云台",OPTION_PTZ_FAILED:"未加载Theme模块,无法操作云台",MOBILE_PTZ_TIPS:"请通过操控云台来调整摄像机视角",PTZ_FAST:"快",PTZ_MID:"中",PTZ_SLOW:"慢",PTZ_SPEED:"调整云台转动速度",DEVICE_ZOOM:"控制设备放大/缩小画面",DEVICE_FOCUS:"调整设备焦距"},en:{GET_PTZ_STATUS:"Get current PTZ status",GET_PTZ_STATUS_FAILED:"Theme module is not loaded, PTZ status cannot be obtained",MOBILE_HIDE_PTZ:"Mobile terminal, PTZ is not displayed in non-full screen state",OPTION_PTZ_FAILED:"Theme module is not loaded, PTZ cannot be operated",MOBILE_PTZ_TIPS:"Adjust camera angle by manipulating gimbal",PTZ_FAST:"F",PTZ_MID:"M",PTZ_SLOW:"S",PTZ_SPEED:"Adjust the PTZ rotation speed",DEVICE_ZOOM:"Control the device to zoom in/out of the screen",DEVICE_FOCUS:"Adjusting the device's focal length"}}},PTZ_SPEED={1:1,2:3,3:7,slow:1,mid:3,fast:7},BasePtz=function(){function BasePtz(container,options){var _this_options_locales,_this_options_locales1,_this_options_locales2;if(void 0===options&&(options={}),!container)throw new Error("Ptz container is required");(this.options=deepmerge(PTZ_DEFAULT_OPTIONS,options,{clone:false}),null==(_this_options_locales=this.options.locales)?void 0:_this_options_locales[this.options.language])?this.locale=null==(_this_options_locales1=this.options.locales)?void 0:_this_options_locales1[this.options.language]:this.locale=null==(_this_options_locales2=this.options.locales)?void 0:_this_options_locales2.zh;this.$container=container,this.speed=PTZ_SPEED[this.options.speed||2];}var _proto=BasePtz.prototype;return _proto.updateOptions=function(options){this.options=deepmerge(this.options,options,{clone:false});},_proto.destroy=function(){},BasePtz}();function _set_prototype_of$1$3(o,p){return _set_prototype_of$1$3=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1$3(o,p)}var MobilePtz=function(BasePtz){function MobilePtz(container,options){var _this;return (_this=BasePtz.call(this,container,options)||this)._touchstart=_this._touchstart.bind(_this),_this._touchend=_this._touchend.bind(_this),_this._render(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of$1$3(subClass,superClass);}(MobilePtz,BasePtz);var _proto=MobilePtz.prototype;return _proto.destroy=function(){this._removeEventListener(),this.$content&&(this.$content.remove(),this.$content=null),BasePtz.prototype.destroy.call(this);},_proto._render=function(){this.$content=document.createElement("div"),this.$content.classList.add("ez-mobile-ptz-content"),this.$content.innerHTML='\n <div class="ez-mobile-ptz-wrap">\n <div class="ez-mobile-ptz-container">\n <div class="ez-mobile-ptz-center ez-mobile-ptz-center"></div>\n <div class="ez-mobile-ptz-icon ez-mobile-ptz-top ez-mobile-ptz-default"></div>\n <div class="ez-mobile-ptz-icon ez-mobile-ptz-left ez-mobile-ptz-default"></div>\n <div class="ez-mobile-ptz-icon ez-mobile-ptz-bottom ez-mobile-ptz-default"></div>\n <div class="ez-mobile-ptz-icon ez-mobile-ptz-right ez-mobile-ptz-default"></div>\n </div>\n </div>\n ',this.$container.appendChild(this.$content),this._addEventListener();},_proto._addEventListener=function(){var $warp=this.$content.querySelector(".ez-mobile-ptz-wrap"),touchstart="PointerEvent"in window?"pointerdown":"touchstart",touchend="PointerEvent"in window?"pointerup":"touchend";$warp&&($warp.addEventListener(touchstart,this._touchstart),$warp.addEventListener(touchend,this._touchend));},_proto._touchstart=function(e){e.preventDefault(),this._handlePtzTouch(e,"start");},_proto._touchend=function(e){e.preventDefault(),this._handlePtzTouch(e,"stop");},_proto._removeEventListener=function(){var $warp=this.$content.querySelector(".ez-mobile-ptz-wrap"),touchstart="PointerEvent"in window?"pointerdown":"touchstart",touchend="PointerEvent"in window?"pointerup":"touchend";$warp&&($warp.removeEventListener(touchstart,this._touchstart),$warp.removeEventListener(touchend,this._touchend));},_proto._handlePtzTouch=function(e,type){var _this_options_token_deviceToken,_this_options_token,_e_changedTouches_,_e_changedTouches_1,_this_options_env,_this_options_token_deviceToken1,_this_options_token1;if(!this.options.accessToken&&!(null==(_this_options_token=this.options.token)||null==(_this_options_token_deviceToken=_this_options_token.deviceToken)?void 0:_this_options_token_deviceToken.video))throw new Error("Ptz accessToken or token.deviceToken.video is required");var _this_options_env1,$warp=this.$content.querySelector(".ez-mobile-ptz-wrap"),rect=$warp.getBoundingClientRect(),containerCenterX=rect.left+130,containerCenterY=rect.top+130,left=(e.x||(null==(_e_changedTouches_=e.changedTouches[0])?void 0:_e_changedTouches_.clientX))-containerCenterX,top=(e.y||(null==(_e_changedTouches_1=e.changedTouches[0])?void 0:_e_changedTouches_1.clientY))-containerCenterY,direction=0,url=(null==(_this_options_env=this.options.env)?void 0:_this_options_env.domain)+"/api/lapp/device/ptz/start",token=this.options.accessToken||(null==(_this_options_token1=this.options.token)||null==(_this_options_token_deviceToken1=_this_options_token1.deviceToken)?void 0:_this_options_token_deviceToken1.video),$icons=$warp.querySelectorAll(".ez-mobile-ptz-icon");(Math.abs(left)>Math.abs(top)?left>0?(direction=3,$icons[3].className=$icons[3].className.replace("ez-mobile-ptz-default","ez-mobile-ptz-active")):(direction=2,$icons[1].className=$icons[1].className.replace("ez-mobile-ptz-default","ez-mobile-ptz-active")):top>0?(direction=1,$icons[2].className=$icons[2].className.replace("ez-mobile-ptz-default","ez-mobile-ptz-active")):(direction=0,$icons[0].className=$icons[0].className.replace("ez-mobile-ptz-default","ez-mobile-ptz-active")),$warp.style.cssText="background-image:linear-gradient("+(0===direction?180:1===direction?0:2===direction?90:270)+"deg, #c0ddf1 0%, rgba(100,143,252,0.00) 50%)","stop"===type)&&(url=(null==(_this_options_env1=this.options.env)?void 0:_this_options_env1.domain)+"/api/lapp/device/ptz/stop",$warp.style.cssText="",$icons[3].className=$icons[3].className.replace("ez-mobile-ptz-active","ez-mobile-ptz-default"),$icons[1].className=$icons[1].className.replace("ez-mobile-ptz-active","ez-mobile-ptz-default"),$icons[2].className=$icons[2].className.replace("ez-mobile-ptz-active","ez-mobile-ptz-default"),$icons[0].className=$icons[0].className.replace("ez-mobile-ptz-active","ez-mobile-ptz-default"));var operationResultCb=null==this.options.onDirection?void 0:this.options.onDirection.call(this.options,{direction:direction,speed:this.speed,type:type}),data=new FormData;data.append("deviceSerial",this.options.deviceSerial+""),data.append("channelNo",this.options.channelNo+""),data.append("speed","1"),data.append("direction",direction+""),data.append("accessToken",token),fetch(url,{method:"POST",body:data}).then(function(response){return response.json()}).then(function(rt){200===rt.code||[60005,60002,60003,60004].includes(+rt.code)&&($warp.style.cssText="background-image:linear-gradient("+(0===direction?180:1===direction?0:2===direction?90:270)+"deg, #f45656 0%, rgba(100,143,252,0.00) 50%)"),null==operationResultCb||operationResultCb(rt);}).catch(function(err){}).finally(function(){operationResultCb=null;});},MobilePtz}(BasePtz);function asyncGeneratorStep$5(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value;}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw);}function _async_to_generator$5(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep$5(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep$5(gen,resolve,reject,_next,_throw,"throw",err);}_next(void 0);})}}function _create_class$9(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _set_prototype_of$h(o,p){return _set_prototype_of$h=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$h(o,p)}function _ts_generator$5(thisArg,body){var f,y,t,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]},g=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return g.next=verb(0),g.throw=verb(1),g.return=verb(2),"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_);}catch(e){op=[6,e],y=0;}finally{f=t=0;}if(5&op[0])throw op[1];return {value:op[0]?op[1]:void 0,done:true}}([n,v])}}}var Ptz$1=function(BasePtz){function Ptz(container,options){var _this;return void 0===options&&(options={}),(_this=BasePtz.call(this,container,options)||this)._isMobile=distExports$4.isMobile(),_this._isRotate=false,_this._clearTimer=null,_this._$wrapper=document.createElement("div"),_this._$wrapper.className="ez-ptz-container-wrap",_this._$directionCircleContainer=document.createElement("div"),_this._$directionCircleContainer.classList.add("ez-ptz-container"),_this._$directionCircleContainer.innerHTML='\n <div class="ez-ptz-main ez-ptz-direction-center"></div>\n <div class="ez-ptz-icon ez-ptz-direction-top" data-direction="0"></div>\n <div class="ez-ptz-icon ez-ptz-direction-top-left" data-direction="4"></div>\n <div class="ez-ptz-icon ez-ptz-direction-left" data-direction="2"></div>\n <div class="ez-ptz-icon ez-ptz-direction-left-bottom" data-direction="5"></div>\n <div class="ez-ptz-icon ez-ptz-direction-bottom" data-direction="1"></div>\n <div class="ez-ptz-icon ez-ptz-direction-bottom-right" data-direction="7"></div>\n <div class="ez-ptz-icon ez-ptz-direction-right" data-direction="3"></div>\n <div class="ez-ptz-icon ez-ptz-direction-right-top" data-direction="6"></div>\n ',_this._$wrapper.appendChild(_this._$directionCircleContainer),_this._$speedContainer=document.createElement("div"),_this._$speedContainer.classList.add("ez-ptz-speed-container"),_this._$speedContainer.innerHTML='\n <div class="ez-ptz-speed-progress" title="'+_this.locale.PTZ_SPEED+'">\n <div class="ez-ptz-speed-progress-line">\n <div class="ez-ptz-speed-progress-line-dot '+(1===_this.speed?"ez-ptz-speed-active":"")+'" data-id="slow" data-index="1" data-value="1"></div>\n <div class="ez-ptz-speed-progress-line-dot '+(3===_this.speed?"ez-ptz-speed-active":"")+'" data-id="mid" data-index="2" data-value="3"></div>\n <div class="ez-ptz-speed-progress-line-dot '+(7===_this.speed?"ez-ptz-speed-active":"")+'" data-id="fast" data-index="3" data-value="7"></div>\n </div>\n <div class="ez-ptz-speed-progress-points">\n <div class="ez-ptz-speed-progress-points-slow">\n '+_this.locale.PTZ_SLOW+'\n </div>\n <div class="ez-ptz-speed-progress-points-mid">\n '+_this.locale.PTZ_MID+'\n </div>\n <div class="ez-ptz-speed-progress-points-fast">\n '+_this.locale.PTZ_FAST+"\n </div>\n </div>\n </div>\n ",_this._$wrapper.appendChild(_this._$speedContainer),_this._$btnContainer=document.createElement("div"),_this._$btnContainer.classList.add("ez-ptz-btn-container"),_this._$btnContainer.innerHTML='\n <div class="ez-ptz-btn-zoom" title="'+_this.locale.DEVICE_ZOOM+'" style="user-select: none;">\n <div class="ez-ptz-btn-zoom-add" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M563.2 198.4c179.2 0 326.4 147.2 326.4 326.4s-147.2 326.4-326.4 326.4S230.4 704 230.4 524.8s147.2-326.4 332.8-326.4z m0 64c-147.2 0-262.4 115.2-262.4 262.4s115.2 262.4 262.4 262.4 262.4-115.2 262.4-262.4S704 262.4 563.2 262.4z" fill="#ffffff"></path>\n <path d="M691.2 556.8H428.8c-19.2 0-32-12.8-32-32s12.8-32 32-32h262.4c19.2 0 32 12.8 32 32s-12.8 32-32 32z" fill="#ffffff">\n </path>\n <path d="M556.8 691.2c-19.2 0-32-12.8-32-32V396.8c0-19.2 12.8-32 32-32s32 12.8 32 32v262.4c0 19.2-12.8 32-32 32z" fill="#ffffff"></path>\n </svg>\n </div>\n <div class="ez-ptz-btn-zoom-sub" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M569.6 838.4c-172.8 0-307.2-140.8-307.2-307.2s140.8-307.2 307.2-307.2 307.2 140.8 307.2 307.2-140.8 307.2-307.2 307.2z m0-64c134.4 0 249.6-108.8 249.6-249.6S704 281.6 569.6 281.6 320 396.8 320 531.2s108.8 243.2 249.6 243.2z" fill="#ffffff"></path>\n <path d="M691.2 563.2H448c-19.2 0-32-12.8-32-32s12.8-38.4 32-38.4h249.6c19.2 0 32 12.8 32 32s-19.2 38.4-38.4 38.4z" fill="#ffffff"></path>\n </svg>\n </div>\n </div>\n <div class="ez-ptz-btn-focal" title="'+_this.locale.DEVICE_FOCUS+'" style="user-select: none;">\n <div class="ez-ptz-btn-focal-add" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M646.4 825.6H320c-44.8 0-83.2-38.4-83.2-83.2V409.6c0-44.8 38.4-83.2 83.2-83.2h326.4c44.8 0 83.2 38.4 83.2 83.2v326.4c0 51.2-38.4 89.6-83.2 89.6zM320 390.4c-12.8 0-19.2 6.4-19.2 19.2v326.4c0 12.8 6.4 19.2 19.2 19.2h326.4c12.8 0 19.2-6.4 19.2-19.2V409.6c0-12.8-6.4-19.2-19.2-19.2H320z" fill="#ffffff"></path>\n <path d="M396.8 358.4V281.6c0-25.6 25.6-51.2 51.2-51.2h326.4c25.6 0 51.2 25.6 51.2 51.2v326.4c0 25.6-25.6 51.2-51.2 51.2H704l-6.4-268.8" fill="#ffffff"></path>\n </svg>\n </div>\n <div class="ez-ptz-btn-focal-sub" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M320 358.4h326.4c25.6 0 51.2 25.6 51.2 51.2v326.4c0 25.6-25.6 51.2-51.2 51.2H320c-25.6 0-51.2-25.6-51.2-51.2V409.6c0-25.6 25.6-51.2 51.2-51.2z" fill="#ffffff"></path>\n <path d="M774.4 697.6H704c-19.2 0-32-12.8-32-32s12.8-32 32-32h70.4c12.8 0 19.2-6.4 19.2-19.2V281.6c0-12.8-6.4-19.2-19.2-19.2H448c-12.8 0-19.2 6.4-19.2 19.2v70.4c0 19.2-12.8 32-32 32s-32-12.8-32-25.6V281.6c0-44.8 38.4-83.2 83.2-83.2h326.4c44.8 0 83.2 38.4 83.2 83.2v326.4c0 51.2-38.4 89.6-83.2 89.6z" fill="#ffffff"></path>\n </svg>\n </div>\n </div>\n ',_this._$wrapper.appendChild(_this._$btnContainer),container.appendChild(_this._$wrapper),_this._$directionCircleContainer.onmousedown=function(e){e.preventDefault(),e.stopPropagation(),_this._handlePtzTouch(e,"start");},_this._$directionCircleContainer.onmouseup=function(e){e.preventDefault(),e.stopPropagation(),_this._handlePtzTouch(e,"stop");},_this._$directionCircleContainer.ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),_this._handlePtzTouch(e,"start");},_this._$directionCircleContainer.ontouchend=function(e){e.preventDefault(),e.stopPropagation(),_this._handlePtzTouch(e,"stop");},_this._onSwitchSpeed=function(e){var list=Array.from(_this._$speedContainer.querySelectorAll(".ez-ptz-speed-progress-line-dot"));if(list.includes(e.target)&&!e.target.classList.contains("ez-ptz-speed-active")){list.forEach(function(item){item===e.target?item.classList.add("ez-ptz-speed-active"):item.classList.remove("ez-ptz-speed-active");});var value=e.target.getAttribute("data-value"),index=e.target.getAttribute("data-index");_this.speed=+value,null==_this.options.onSpeedChange||_this.options.onSpeedChange.call(_this.options,+index);}},_this._$speedContainer.onmouseup=_this._onSwitchSpeed,_this._isMobile&&(_this._$speedContainer.ontouchend=_this._onSwitchSpeed),_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add").onmousedown=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","add","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add").onmouseup=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","add","stop");}),_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub").onmousedown=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","sub","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub").onmouseup=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","sub","stop");}),_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add").onmousedown=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","add","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add").onmouseup=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","add","stop");}),_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub").onmousedown=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","sub","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub").onmouseup=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","sub","stop");}),_this._isMobile&&(_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add").ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","add","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add").ontouchend=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","add","stop");}),_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub").ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","sub","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub").ontouchend=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","sub","stop");}),_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add").ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","add","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add").ontouchend=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","add","stop");}),_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub").ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","sub","start");},_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub").ontouchend=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","sub","stop");})),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of$h(subClass,superClass);}(Ptz,BasePtz);var _proto=Ptz.prototype;return _proto.destroy=function(){this._clearTimer&&(clearTimeout(this._clearTimer),this._clearTimer=null),this._$directionCircleContainer&&(this._$directionCircleContainer.remove(),this._$directionCircleContainer=null),this._$speedContainer&&(this._onSwitchSpeed=null,this._$speedContainer.remove(),this._$speedContainer=null),this._$btnContainer&&(this._$btnContainer.remove(),this._$btnContainer=null),this._$wrapper&&(this._$wrapper.remove(),this._$wrapper=null),BasePtz.prototype.destroy.call(this);},_proto._handlePtzTouch=function(e,type){var _this_options_token_deviceToken,_this_options_token,_this_options_env,_this_options_token_deviceToken1,_this_options_token1,_this=this;if(!this.options.accessToken&&!(null==(_this_options_token=this.options.token)||null==(_this_options_token_deviceToken=_this_options_token.deviceToken)?void 0:_this_options_token_deviceToken.video))throw new Error("Ptz accessToken or token.deviceToken.video is required");this._ptzQueue||(this._ptzQueue=Promise.resolve());var container=this._$directionCircleContainer.getBoundingClientRect(),containerCenterX=container.left+(this._$directionCircleContainer.clientWidth+2)/2,containerCenterY=container.top+(this._$directionCircleContainer.clientHeight+2)/2,eventX=e.x||e.changedTouches[0].clientX,eventY=e.y||e.changedTouches[0].clientY,direction=0,url=(null==(_this_options_env=this.options.env)?void 0:_this_options_env.domain)+"/api/lapp/device/ptz/start",token=this.options.accessToken||(null==(_this_options_token1=this.options.token)||null==(_this_options_token_deviceToken1=_this_options_token1.deviceToken)?void 0:_this_options_token_deviceToken1.video),backDeg=0;function getAreaId(x,y){var rad=Math.atan2(y,x);rad<0&&(rad+=2*Math.PI);var deg=rad*(180/Math.PI)-225-12.5;return deg<0&&(deg+=360),Math.floor(deg/45)+1}var _this_options_env1,left=eventX-containerCenterX,top=eventY-containerCenterY;if(this.isRotate)switch(getAreaId(left,top)){case 1:direction=2,backDeg=90;break;case 2:direction=4,backDeg=135;break;case 3:direction=0,backDeg=180;break;case 4:direction=6,backDeg=225;break;case 5:direction=3,backDeg=270;break;case 6:direction=7,backDeg=315;break;case 7:direction=1,backDeg=0;break;case 8:direction=5,backDeg=45;}else switch(getAreaId(left,top)){case 1:direction=0,backDeg=180;break;case 2:direction=6,backDeg=225;break;case 3:direction=3,backDeg=270;break;case 4:direction=7,backDeg=315;break;case 5:direction=1,backDeg=0;break;case 6:direction=5,backDeg=45;break;case 7:direction=2,backDeg=90;break;case 8:direction=4,backDeg=135;}(this._clearTimer&&(clearTimeout(this._clearTimer),this._clearTimer=null),this._$directionCircleContainer.style.cssText="start"===type?"background-image:linear-gradient("+backDeg+"deg, #4277FF 0%, rgba(100,143,252,0.00) 30%)":"","stop"===type)&&(url=(null==(_this_options_env1=this.options.env)?void 0:_this_options_env1.domain)+"/api/lapp/device/ptz/stop");var operationResultCb=null==this.options.onDirection?void 0:this.options.onDirection.call(this.options,{areaId:getAreaId(left,top),direction:direction,backDeg:backDeg,isRotate:this.isRotate,speed:this.speed,type:type}),data=new FormData;data.append("deviceSerial",this.options.deviceSerial+""),data.append("channelNo",this.options.channelNo+""),data.append("speed",this.speed+""),data.append("direction",direction+""),data.append("accessToken",token),this._ptzQueue=this._ptzQueue.then(function(){return _async_to_generator$5(function(){var _this;return _ts_generator$5(this,function(_state){switch(_state.label){case 0:return _this=this,[4,fetch(url,{method:"POST",body:data}).then(function(response){return _async_to_generator$5(function(){return _ts_generator$5(this,function(_state){switch(_state.label){case 0:return [4,response.json()];case 1:return [2,_state.sent()]}})})()}).then(function(rt){var _rt_result;null==operationResultCb||operationResultCb(rt);var code=rt.code||(null==rt||null==(_rt_result=rt.result)?void 0:_rt_result.code);return [6e4,60001,60002,60003,60004,60005,60006,10002].includes(+code)&&(_this._$directionCircleContainer.style.cssText="background-image:linear-gradient("+backDeg+"deg, #f45656 0%, rgba(100,143,252,0.00) 30%)"),rt}).catch(function(err){}).finally(function(){operationResultCb=null,"stop"===type&&(_this._clearTimer=setTimeout(function(){_this._$directionCircleContainer.style.cssText="";},1e3));})];case 1:return [2,_state.sent()]}})}).call(_this)}),"stop"===type&&(this._ptzQueue=this._ptzQueue.finally(function(){}));},_proto._handleBtnTouch=function(btn,option,type){var _this_options_token,_this_options_env,_this_options_token_deviceToken,_this_options_token1,_this=this;if(!this.options.accessToken&&!(null==(_this_options_token=this.options.token)?void 0:_this_options_token.deviceToken.video))throw new Error("Ptz accessToken or token.deviceToken.video is required");this._ptzOperation||(this._ptzOperation=Promise.resolve());var direction=8;direction="zoom"===btn?"add"===option?8:9:"add"===option?10:11;var _this_options_env1,url=(null==(_this_options_env=this.options.env)?void 0:_this_options_env.domain)+"/api/lapp/device/ptz/start",token=this.options.accessToken||(null==(_this_options_token1=this.options.token)||null==(_this_options_token_deviceToken=_this_options_token1.deviceToken)?void 0:_this_options_token_deviceToken.video);"stop"===type&&(url=(null==(_this_options_env1=this.options.env)?void 0:_this_options_env1.domain)+"/api/lapp/device/ptz/stop");var operationResultCb=null==this.options.onDirection?void 0:this.options.onDirection.call(this.options,{btn:btn,option:option,type:type}),data=new FormData;data.append("deviceSerial",this.options.deviceSerial+""),data.append("channelNo",this.options.channelNo+""),data.append("speed",this.speed+""),data.append("direction",direction+""),data.append("accessToken",token),this._ptzOperation=this._ptzOperation.then(function(){return _async_to_generator$5(function(){return _ts_generator$5(this,function(_state){switch(_state.label){case 0:return [4,fetch(url,{method:"POST",body:data}).then(function(response){return _async_to_generator$5(function(){return _ts_generator$5(this,function(_state){switch(_state.label){case 0:return [4,response.json()];case 1:return [2,_state.sent()]}})})()}).then(function(rt){return null==operationResultCb||operationResultCb(rt),rt}).catch(function(err){}).finally(function(){operationResultCb=null;})];case 1:return [2,_state.sent()]}})})()}),"stop"===type&&(this._ptzOperation=this._ptzOperation.finally(function(){_this._ptzOperation=null;}));},_create_class$9(Ptz,[{key:"isRotate",get:function(){return this._isRotate},set:function(isRotate){this._isRotate=isRotate;}}]),Ptz}(BasePtz);
|
|
9165
7356
|
|
|
9166
7357
|
function _defineProperties$4(target, props) {
|
|
9167
7358
|
for(var i = 0; i < props.length; i++){
|
|
@@ -9172,12 +7363,12 @@
|
|
|
9172
7363
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
9173
7364
|
}
|
|
9174
7365
|
}
|
|
9175
|
-
function _create_class$
|
|
7366
|
+
function _create_class$8(Constructor, protoProps, staticProps) {
|
|
9176
7367
|
if (protoProps) _defineProperties$4(Constructor.prototype, protoProps);
|
|
9177
7368
|
return Constructor;
|
|
9178
7369
|
}
|
|
9179
|
-
function _extends$
|
|
9180
|
-
_extends$
|
|
7370
|
+
function _extends$f() {
|
|
7371
|
+
_extends$f = Object.assign || function(target) {
|
|
9181
7372
|
for(var i = 1; i < arguments.length; i++){
|
|
9182
7373
|
var source = arguments[i];
|
|
9183
7374
|
for(var key in source){
|
|
@@ -9188,7 +7379,7 @@
|
|
|
9188
7379
|
}
|
|
9189
7380
|
return target;
|
|
9190
7381
|
};
|
|
9191
|
-
return _extends$
|
|
7382
|
+
return _extends$f.apply(this, arguments);
|
|
9192
7383
|
}
|
|
9193
7384
|
function _inherits$e(subClass, superClass) {
|
|
9194
7385
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -9201,14 +7392,14 @@
|
|
|
9201
7392
|
configurable: true
|
|
9202
7393
|
}
|
|
9203
7394
|
});
|
|
9204
|
-
if (superClass) _set_prototype_of$
|
|
7395
|
+
if (superClass) _set_prototype_of$g(subClass, superClass);
|
|
9205
7396
|
}
|
|
9206
|
-
function _set_prototype_of$
|
|
9207
|
-
_set_prototype_of$
|
|
7397
|
+
function _set_prototype_of$g(o, p) {
|
|
7398
|
+
_set_prototype_of$g = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
9208
7399
|
o.__proto__ = p;
|
|
9209
7400
|
return o;
|
|
9210
7401
|
};
|
|
9211
|
-
return _set_prototype_of$
|
|
7402
|
+
return _set_prototype_of$g(o, p);
|
|
9212
7403
|
}
|
|
9213
7404
|
/**
|
|
9214
7405
|
* 云台控件
|
|
@@ -9217,7 +7408,7 @@
|
|
|
9217
7408
|
_inherits$e(Ptz, Control);
|
|
9218
7409
|
function Ptz(options) {
|
|
9219
7410
|
var _this;
|
|
9220
|
-
_this = Control.call(this, _extends$
|
|
7411
|
+
_this = Control.call(this, _extends$f({}, options, {
|
|
9221
7412
|
tagName: 'span',
|
|
9222
7413
|
controlType: 'button',
|
|
9223
7414
|
classNameSuffix: 'ptz'
|
|
@@ -9260,7 +7451,7 @@
|
|
|
9260
7451
|
this.$turntable.classList.add("" + PREFIX_CLASS + "-ptz-turntable");
|
|
9261
7452
|
this.$panel.appendChild(this.$turntable);
|
|
9262
7453
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
9263
|
-
this._ptzControl = new
|
|
7454
|
+
this._ptzControl = new Ptz$1(this.$turntable, _extends$f({}, this._options, {
|
|
9264
7455
|
onSpeedChange: this._onSpeedChange.bind(this),
|
|
9265
7456
|
onDirection: this._onDirection.bind(this)
|
|
9266
7457
|
}));
|
|
@@ -9269,7 +7460,7 @@
|
|
|
9269
7460
|
};
|
|
9270
7461
|
_proto.renderMobileExtend = function renderMobileExtend($container) {
|
|
9271
7462
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
9272
|
-
if (!this._ptzControl1) this._ptzControl1 = new
|
|
7463
|
+
if (!this._ptzControl1) this._ptzControl1 = new MobilePtz($container, _extends$f({}, this._options, {
|
|
9273
7464
|
onSpeedChange: this._onSpeedChange.bind(this),
|
|
9274
7465
|
onDirection: this._onDirection.bind(this)
|
|
9275
7466
|
}));
|
|
@@ -9314,7 +7505,7 @@
|
|
|
9314
7505
|
_proto.reset = function reset(hide) {
|
|
9315
7506
|
this.active = false;
|
|
9316
7507
|
};
|
|
9317
|
-
_create_class$
|
|
7508
|
+
_create_class$8(Ptz, [
|
|
9318
7509
|
{
|
|
9319
7510
|
key: "isRotated",
|
|
9320
7511
|
get: function get() {
|
|
@@ -9368,12 +7559,12 @@
|
|
|
9368
7559
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
9369
7560
|
}
|
|
9370
7561
|
}
|
|
9371
|
-
function _create_class$
|
|
7562
|
+
function _create_class$7(Constructor, protoProps, staticProps) {
|
|
9372
7563
|
if (protoProps) _defineProperties$3(Constructor.prototype, protoProps);
|
|
9373
7564
|
return Constructor;
|
|
9374
7565
|
}
|
|
9375
|
-
function _extends$
|
|
9376
|
-
_extends$
|
|
7566
|
+
function _extends$e() {
|
|
7567
|
+
_extends$e = Object.assign || function(target) {
|
|
9377
7568
|
for(var i = 1; i < arguments.length; i++){
|
|
9378
7569
|
var source = arguments[i];
|
|
9379
7570
|
for(var key in source){
|
|
@@ -9384,7 +7575,7 @@
|
|
|
9384
7575
|
}
|
|
9385
7576
|
return target;
|
|
9386
7577
|
};
|
|
9387
|
-
return _extends$
|
|
7578
|
+
return _extends$e.apply(this, arguments);
|
|
9388
7579
|
}
|
|
9389
7580
|
function _inherits$d(subClass, superClass) {
|
|
9390
7581
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -9397,14 +7588,14 @@
|
|
|
9397
7588
|
configurable: true
|
|
9398
7589
|
}
|
|
9399
7590
|
});
|
|
9400
|
-
if (superClass) _set_prototype_of$
|
|
7591
|
+
if (superClass) _set_prototype_of$f(subClass, superClass);
|
|
9401
7592
|
}
|
|
9402
|
-
function _set_prototype_of$
|
|
9403
|
-
_set_prototype_of$
|
|
7593
|
+
function _set_prototype_of$f(o, p) {
|
|
7594
|
+
_set_prototype_of$f = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
9404
7595
|
o.__proto__ = p;
|
|
9405
7596
|
return o;
|
|
9406
7597
|
};
|
|
9407
|
-
return _set_prototype_of$
|
|
7598
|
+
return _set_prototype_of$f(o, p);
|
|
9408
7599
|
}
|
|
9409
7600
|
var RECORD_DEFAULT_OPTIONS = {
|
|
9410
7601
|
maxDuration: 3600
|
|
@@ -9421,7 +7612,7 @@
|
|
|
9421
7612
|
_inherits$d(Record, Control);
|
|
9422
7613
|
function Record(options) {
|
|
9423
7614
|
var _this;
|
|
9424
|
-
_this = Control.call(this, _extends$
|
|
7615
|
+
_this = Control.call(this, _extends$e({}, options, {
|
|
9425
7616
|
tagName: 'span',
|
|
9426
7617
|
controlType: 'button',
|
|
9427
7618
|
classNameSuffix: 'record'
|
|
@@ -9491,7 +7682,7 @@
|
|
|
9491
7682
|
this.active = !this.active;
|
|
9492
7683
|
Control.prototype._onControlClick.call(this, e);
|
|
9493
7684
|
};
|
|
9494
|
-
_create_class$
|
|
7685
|
+
_create_class$7(Record, [
|
|
9495
7686
|
{
|
|
9496
7687
|
key: "active",
|
|
9497
7688
|
get: /**
|
|
@@ -9558,12 +7749,12 @@
|
|
|
9558
7749
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
9559
7750
|
}
|
|
9560
7751
|
}
|
|
9561
|
-
function _create_class$
|
|
7752
|
+
function _create_class$6(Constructor, protoProps, staticProps) {
|
|
9562
7753
|
if (protoProps) _defineProperties$2(Constructor.prototype, protoProps);
|
|
9563
7754
|
return Constructor;
|
|
9564
7755
|
}
|
|
9565
|
-
function _extends$
|
|
9566
|
-
_extends$
|
|
7756
|
+
function _extends$d() {
|
|
7757
|
+
_extends$d = Object.assign || function(target) {
|
|
9567
7758
|
for(var i = 1; i < arguments.length; i++){
|
|
9568
7759
|
var source = arguments[i];
|
|
9569
7760
|
for(var key in source){
|
|
@@ -9574,7 +7765,7 @@
|
|
|
9574
7765
|
}
|
|
9575
7766
|
return target;
|
|
9576
7767
|
};
|
|
9577
|
-
return _extends$
|
|
7768
|
+
return _extends$d.apply(this, arguments);
|
|
9578
7769
|
}
|
|
9579
7770
|
function _inherits$c(subClass, superClass) {
|
|
9580
7771
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -9587,14 +7778,14 @@
|
|
|
9587
7778
|
configurable: true
|
|
9588
7779
|
}
|
|
9589
7780
|
});
|
|
9590
|
-
if (superClass) _set_prototype_of$
|
|
7781
|
+
if (superClass) _set_prototype_of$e(subClass, superClass);
|
|
9591
7782
|
}
|
|
9592
|
-
function _set_prototype_of$
|
|
9593
|
-
_set_prototype_of$
|
|
7783
|
+
function _set_prototype_of$e(o, p) {
|
|
7784
|
+
_set_prototype_of$e = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
9594
7785
|
o.__proto__ = p;
|
|
9595
7786
|
return o;
|
|
9596
7787
|
};
|
|
9597
|
-
return _set_prototype_of$
|
|
7788
|
+
return _set_prototype_of$e(o, p);
|
|
9598
7789
|
}
|
|
9599
7790
|
function _ts_generator$4(thisArg, body) {
|
|
9600
7791
|
var f, y, t, _ = {
|
|
@@ -9699,7 +7890,7 @@
|
|
|
9699
7890
|
_inherits$c(Talk, Control);
|
|
9700
7891
|
function Talk(options) {
|
|
9701
7892
|
var _this;
|
|
9702
|
-
_this = Control.call(this, _extends$
|
|
7893
|
+
_this = Control.call(this, _extends$d({}, options, {
|
|
9703
7894
|
tagName: 'span',
|
|
9704
7895
|
controlType: 'button',
|
|
9705
7896
|
classNameSuffix: 'talk'
|
|
@@ -9763,7 +7954,7 @@
|
|
|
9763
7954
|
});
|
|
9764
7955
|
}).call(this);
|
|
9765
7956
|
};
|
|
9766
|
-
_create_class$
|
|
7957
|
+
_create_class$6(Talk, [
|
|
9767
7958
|
{
|
|
9768
7959
|
key: "value",
|
|
9769
7960
|
get: /**
|
|
@@ -9832,8 +8023,8 @@
|
|
|
9832
8023
|
});
|
|
9833
8024
|
};
|
|
9834
8025
|
}
|
|
9835
|
-
function _extends$
|
|
9836
|
-
_extends$
|
|
8026
|
+
function _extends$c() {
|
|
8027
|
+
_extends$c = Object.assign || function(target) {
|
|
9837
8028
|
for(var i = 1; i < arguments.length; i++){
|
|
9838
8029
|
var source = arguments[i];
|
|
9839
8030
|
for(var key in source){
|
|
@@ -9844,7 +8035,7 @@
|
|
|
9844
8035
|
}
|
|
9845
8036
|
return target;
|
|
9846
8037
|
};
|
|
9847
|
-
return _extends$
|
|
8038
|
+
return _extends$c.apply(this, arguments);
|
|
9848
8039
|
}
|
|
9849
8040
|
function _inherits$b(subClass, superClass) {
|
|
9850
8041
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -9857,14 +8048,14 @@
|
|
|
9857
8048
|
configurable: true
|
|
9858
8049
|
}
|
|
9859
8050
|
});
|
|
9860
|
-
if (superClass) _set_prototype_of$
|
|
8051
|
+
if (superClass) _set_prototype_of$d(subClass, superClass);
|
|
9861
8052
|
}
|
|
9862
|
-
function _set_prototype_of$
|
|
9863
|
-
_set_prototype_of$
|
|
8053
|
+
function _set_prototype_of$d(o, p) {
|
|
8054
|
+
_set_prototype_of$d = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
9864
8055
|
o.__proto__ = p;
|
|
9865
8056
|
return o;
|
|
9866
8057
|
};
|
|
9867
|
-
return _set_prototype_of$
|
|
8058
|
+
return _set_prototype_of$d(o, p);
|
|
9868
8059
|
}
|
|
9869
8060
|
function _ts_generator$3(thisArg, body) {
|
|
9870
8061
|
var f, y, t, _ = {
|
|
@@ -9967,7 +8158,7 @@
|
|
|
9967
8158
|
_inherits$b(Broadcast, Control);
|
|
9968
8159
|
function Broadcast(options) {
|
|
9969
8160
|
var _this;
|
|
9970
|
-
_this = Control.call(this, _extends$
|
|
8161
|
+
_this = Control.call(this, _extends$c({}, options, {
|
|
9971
8162
|
tagName: 'span',
|
|
9972
8163
|
controlType: 'button',
|
|
9973
8164
|
classNameSuffix: 'broadcast'
|
|
@@ -9980,10 +8171,10 @@
|
|
|
9980
8171
|
_this._render();
|
|
9981
8172
|
}
|
|
9982
8173
|
});
|
|
9983
|
-
if (options.sdkType ===
|
|
9984
|
-
_this.$container.style.removeProperty(
|
|
8174
|
+
if (options.sdkType === 'base') {
|
|
8175
|
+
_this.$container.style.removeProperty('display');
|
|
9985
8176
|
} else {
|
|
9986
|
-
_this.$container.style.display =
|
|
8177
|
+
_this.$container.style.display = 'none';
|
|
9987
8178
|
}
|
|
9988
8179
|
return _this;
|
|
9989
8180
|
}
|
|
@@ -10003,16 +8194,16 @@
|
|
|
10003
8194
|
}
|
|
10004
8195
|
};
|
|
10005
8196
|
/**
|
|
10006
|
-
|
|
10007
|
-
|
|
8197
|
+
* 销毁语音广播控件
|
|
8198
|
+
*/ _proto.destroy = function destroy() {
|
|
10008
8199
|
if (this.active) {
|
|
10009
8200
|
this.reset();
|
|
10010
8201
|
}
|
|
10011
8202
|
Control.prototype.destroy.call(this);
|
|
10012
8203
|
};
|
|
10013
8204
|
/**
|
|
10014
|
-
|
|
10015
|
-
|
|
8205
|
+
* 点击 Control 会触发
|
|
8206
|
+
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
10016
8207
|
var _this = this, _superprop_get__onControlClick = function() {
|
|
10017
8208
|
return Control.prototype._onControlClick;
|
|
10018
8209
|
};
|
|
@@ -10062,8 +8253,8 @@
|
|
|
10062
8253
|
});
|
|
10063
8254
|
};
|
|
10064
8255
|
}
|
|
10065
|
-
function _extends$
|
|
10066
|
-
_extends$
|
|
8256
|
+
function _extends$b() {
|
|
8257
|
+
_extends$b = Object.assign || function(target) {
|
|
10067
8258
|
for(var i = 1; i < arguments.length; i++){
|
|
10068
8259
|
var source = arguments[i];
|
|
10069
8260
|
for(var key in source){
|
|
@@ -10074,7 +8265,7 @@
|
|
|
10074
8265
|
}
|
|
10075
8266
|
return target;
|
|
10076
8267
|
};
|
|
10077
|
-
return _extends$
|
|
8268
|
+
return _extends$b.apply(this, arguments);
|
|
10078
8269
|
}
|
|
10079
8270
|
function _inherits$a(subClass, superClass) {
|
|
10080
8271
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -10087,14 +8278,14 @@
|
|
|
10087
8278
|
configurable: true
|
|
10088
8279
|
}
|
|
10089
8280
|
});
|
|
10090
|
-
if (superClass) _set_prototype_of$
|
|
8281
|
+
if (superClass) _set_prototype_of$c(subClass, superClass);
|
|
10091
8282
|
}
|
|
10092
|
-
function _set_prototype_of$
|
|
10093
|
-
_set_prototype_of$
|
|
8283
|
+
function _set_prototype_of$c(o, p) {
|
|
8284
|
+
_set_prototype_of$c = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
10094
8285
|
o.__proto__ = p;
|
|
10095
8286
|
return o;
|
|
10096
8287
|
};
|
|
10097
|
-
return _set_prototype_of$
|
|
8288
|
+
return _set_prototype_of$c(o, p);
|
|
10098
8289
|
}
|
|
10099
8290
|
function _ts_generator$2(thisArg, body) {
|
|
10100
8291
|
var f, y, t, _ = {
|
|
@@ -10197,7 +8388,7 @@
|
|
|
10197
8388
|
_inherits$a(AIChat, Control);
|
|
10198
8389
|
function AIChat(options) {
|
|
10199
8390
|
var _this;
|
|
10200
|
-
_this = Control.call(this, _extends$
|
|
8391
|
+
_this = Control.call(this, _extends$b({}, options, {
|
|
10201
8392
|
tagName: 'span',
|
|
10202
8393
|
controlType: 'button',
|
|
10203
8394
|
classNameSuffix: 'aichat'
|
|
@@ -10210,10 +8401,10 @@
|
|
|
10210
8401
|
_this._render();
|
|
10211
8402
|
}
|
|
10212
8403
|
});
|
|
10213
|
-
if (options.urlInfo.
|
|
10214
|
-
_this.$container.style.removeProperty(
|
|
8404
|
+
if (options.urlInfo.searchParams.busType !== '7' && options.urlInfo.recType === 'cloud' && options.sdkType === 'base') {
|
|
8405
|
+
_this.$container.style.removeProperty('display');
|
|
10215
8406
|
} else {
|
|
10216
|
-
_this.$container.style.display =
|
|
8407
|
+
_this.$container.style.display = 'none';
|
|
10217
8408
|
}
|
|
10218
8409
|
return _this;
|
|
10219
8410
|
}
|
|
@@ -10233,16 +8424,16 @@
|
|
|
10233
8424
|
}
|
|
10234
8425
|
};
|
|
10235
8426
|
/**
|
|
10236
|
-
|
|
10237
|
-
|
|
8427
|
+
* 销毁AI对话框控件
|
|
8428
|
+
*/ _proto.destroy = function destroy() {
|
|
10238
8429
|
if (this.active) {
|
|
10239
8430
|
this.reset();
|
|
10240
8431
|
}
|
|
10241
8432
|
Control.prototype.destroy.call(this);
|
|
10242
8433
|
};
|
|
10243
8434
|
/**
|
|
10244
|
-
|
|
10245
|
-
|
|
8435
|
+
* 点击 Control 会触发
|
|
8436
|
+
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
10246
8437
|
var _this = this, _superprop_get__onControlClick = function() {
|
|
10247
8438
|
return Control.prototype._onControlClick;
|
|
10248
8439
|
};
|
|
@@ -10272,12 +8463,12 @@
|
|
|
10272
8463
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
10273
8464
|
}
|
|
10274
8465
|
}
|
|
10275
|
-
function _create_class$
|
|
8466
|
+
function _create_class$5(Constructor, protoProps, staticProps) {
|
|
10276
8467
|
if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
|
|
10277
8468
|
return Constructor;
|
|
10278
8469
|
}
|
|
10279
|
-
function _extends$
|
|
10280
|
-
_extends$
|
|
8470
|
+
function _extends$a() {
|
|
8471
|
+
_extends$a = Object.assign || function(target) {
|
|
10281
8472
|
for(var i = 1; i < arguments.length; i++){
|
|
10282
8473
|
var source = arguments[i];
|
|
10283
8474
|
for(var key in source){
|
|
@@ -10288,7 +8479,7 @@
|
|
|
10288
8479
|
}
|
|
10289
8480
|
return target;
|
|
10290
8481
|
};
|
|
10291
|
-
return _extends$
|
|
8482
|
+
return _extends$a.apply(this, arguments);
|
|
10292
8483
|
}
|
|
10293
8484
|
function _inherits$9(subClass, superClass) {
|
|
10294
8485
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -10301,14 +8492,14 @@
|
|
|
10301
8492
|
configurable: true
|
|
10302
8493
|
}
|
|
10303
8494
|
});
|
|
10304
|
-
if (superClass) _set_prototype_of$
|
|
8495
|
+
if (superClass) _set_prototype_of$b(subClass, superClass);
|
|
10305
8496
|
}
|
|
10306
|
-
function _set_prototype_of$
|
|
10307
|
-
_set_prototype_of$
|
|
8497
|
+
function _set_prototype_of$b(o, p) {
|
|
8498
|
+
_set_prototype_of$b = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
10308
8499
|
o.__proto__ = p;
|
|
10309
8500
|
return o;
|
|
10310
8501
|
};
|
|
10311
|
-
return _set_prototype_of$
|
|
8502
|
+
return _set_prototype_of$b(o, p);
|
|
10312
8503
|
}
|
|
10313
8504
|
var SELECT_DEFAULT_OPTIONS = {
|
|
10314
8505
|
fieldNames: {
|
|
@@ -10374,7 +8565,7 @@
|
|
|
10374
8565
|
function Select(options) {
|
|
10375
8566
|
var _this;
|
|
10376
8567
|
var _this__options_fieldNames, _this__picker_$body;
|
|
10377
|
-
_this = Control.call(this, _extends$
|
|
8568
|
+
_this = Control.call(this, _extends$a({
|
|
10378
8569
|
tagName: 'span',
|
|
10379
8570
|
type: 'button',
|
|
10380
8571
|
controlType: 'button'
|
|
@@ -10536,7 +8727,7 @@
|
|
|
10536
8727
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
10537
8728
|
this._options.onClick == null ? void 0 : this._options.onClick.call(this._options, e);
|
|
10538
8729
|
};
|
|
10539
|
-
_create_class$
|
|
8730
|
+
_create_class$5(Select, [
|
|
10540
8731
|
{
|
|
10541
8732
|
key: "value",
|
|
10542
8733
|
get: function get() {
|
|
@@ -10572,8 +8763,8 @@
|
|
|
10572
8763
|
}
|
|
10573
8764
|
return self;
|
|
10574
8765
|
}
|
|
10575
|
-
function _extends$
|
|
10576
|
-
_extends$
|
|
8766
|
+
function _extends$9() {
|
|
8767
|
+
_extends$9 = Object.assign || function(target) {
|
|
10577
8768
|
for(var i = 1; i < arguments.length; i++){
|
|
10578
8769
|
var source = arguments[i];
|
|
10579
8770
|
for(var key in source){
|
|
@@ -10584,7 +8775,7 @@
|
|
|
10584
8775
|
}
|
|
10585
8776
|
return target;
|
|
10586
8777
|
};
|
|
10587
|
-
return _extends$
|
|
8778
|
+
return _extends$9.apply(this, arguments);
|
|
10588
8779
|
}
|
|
10589
8780
|
function _inherits$8(subClass, superClass) {
|
|
10590
8781
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -10597,14 +8788,14 @@
|
|
|
10597
8788
|
configurable: true
|
|
10598
8789
|
}
|
|
10599
8790
|
});
|
|
10600
|
-
if (superClass) _set_prototype_of$
|
|
8791
|
+
if (superClass) _set_prototype_of$a(subClass, superClass);
|
|
10601
8792
|
}
|
|
10602
|
-
function _set_prototype_of$
|
|
10603
|
-
_set_prototype_of$
|
|
8793
|
+
function _set_prototype_of$a(o, p) {
|
|
8794
|
+
_set_prototype_of$a = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
10604
8795
|
o.__proto__ = p;
|
|
10605
8796
|
return o;
|
|
10606
8797
|
};
|
|
10607
|
-
return _set_prototype_of$
|
|
8798
|
+
return _set_prototype_of$a(o, p);
|
|
10608
8799
|
}
|
|
10609
8800
|
function _type_of(obj) {
|
|
10610
8801
|
"@swc/helpers - typeof";
|
|
@@ -10659,7 +8850,7 @@
|
|
|
10659
8850
|
if (options === void 0) options = {};
|
|
10660
8851
|
var _this;
|
|
10661
8852
|
var _options_props, _options_props1, _options_locales_options_language;
|
|
10662
|
-
_this = Select.call(this, _extends$
|
|
8853
|
+
_this = Select.call(this, _extends$9({}, DEFINITION_DEFAULT_OPTIONS, {
|
|
10663
8854
|
value: (_options_props = options.props) == null ? void 0 : _options_props.videoLevel
|
|
10664
8855
|
}, options, {
|
|
10665
8856
|
fieldNames: {
|
|
@@ -10733,8 +8924,8 @@
|
|
|
10733
8924
|
}
|
|
10734
8925
|
return self;
|
|
10735
8926
|
}
|
|
10736
|
-
function _extends$
|
|
10737
|
-
_extends$
|
|
8927
|
+
function _extends$8() {
|
|
8928
|
+
_extends$8 = Object.assign || function(target) {
|
|
10738
8929
|
for(var i = 1; i < arguments.length; i++){
|
|
10739
8930
|
var source = arguments[i];
|
|
10740
8931
|
for(var key in source){
|
|
@@ -10745,7 +8936,7 @@
|
|
|
10745
8936
|
}
|
|
10746
8937
|
return target;
|
|
10747
8938
|
};
|
|
10748
|
-
return _extends$
|
|
8939
|
+
return _extends$8.apply(this, arguments);
|
|
10749
8940
|
}
|
|
10750
8941
|
function _inherits$7(subClass, superClass) {
|
|
10751
8942
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -10758,14 +8949,14 @@
|
|
|
10758
8949
|
configurable: true
|
|
10759
8950
|
}
|
|
10760
8951
|
});
|
|
10761
|
-
if (superClass) _set_prototype_of$
|
|
8952
|
+
if (superClass) _set_prototype_of$9(subClass, superClass);
|
|
10762
8953
|
}
|
|
10763
|
-
function _set_prototype_of$
|
|
10764
|
-
_set_prototype_of$
|
|
8954
|
+
function _set_prototype_of$9(o, p) {
|
|
8955
|
+
_set_prototype_of$9 = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
10765
8956
|
o.__proto__ = p;
|
|
10766
8957
|
return o;
|
|
10767
8958
|
};
|
|
10768
|
-
return _set_prototype_of$
|
|
8959
|
+
return _set_prototype_of$9(o, p);
|
|
10769
8960
|
}
|
|
10770
8961
|
// 支持的倍速列表, 需要是 2 的指数,不能小于 0.5, 最大 16 倍
|
|
10771
8962
|
var SUPPORT_SPEED = [
|
|
@@ -10803,7 +8994,7 @@
|
|
|
10803
8994
|
function Speed(options) {
|
|
10804
8995
|
var _this;
|
|
10805
8996
|
var _options_locales_options_language, _options_locales;
|
|
10806
|
-
_this = Select.call(this, _extends$
|
|
8997
|
+
_this = Select.call(this, _extends$8({}, SPEED_DEFAULT_OPTIONS, options, {
|
|
10807
8998
|
value: (options.props.speed || 1) + '',
|
|
10808
8999
|
classNameSuffix: 'speed',
|
|
10809
9000
|
controlType: 'button',
|
|
@@ -10857,45 +9048,15 @@
|
|
|
10857
9048
|
return Speed;
|
|
10858
9049
|
}(Select);
|
|
10859
9050
|
|
|
10860
|
-
var dist$3 = {};
|
|
10861
|
-
|
|
10862
|
-
var dist$2 = {};
|
|
10863
|
-
|
|
10864
|
-
/*
|
|
10865
|
-
* @ezuikit/utils-tools v2.0.2
|
|
10866
|
-
* tools utils
|
|
10867
|
-
* Copyright (c) 2026-01-05 Ezviz-OpenBiz
|
|
10868
|
-
* Released under the MIT License.
|
|
10869
|
-
*/
|
|
10870
|
-
|
|
10871
|
-
var hasRequiredDist$3;
|
|
10872
|
-
|
|
10873
|
-
function requireDist$3 () {
|
|
10874
|
-
if (hasRequiredDist$3) return dist$2;
|
|
10875
|
-
hasRequiredDist$3 = 1;
|
|
10876
|
-
var getQuery=function(url){var query=url.split("?")[1],obj={};if(query)for(var vars=query.split("&"),i=0;i<vars.length;i++){var pair=vars[i].split("=");obj[pair[0]]=decodeURIComponent(pair[1]);}return obj};function parseEzopenUrl(url){var obj={};if(/^ezopen:\/\//.test(url)){if(url.includes("@")){var endIndex=url.indexOf("@"),startIndex=url.indexOf("//");obj.validateCode=url.substring(startIndex+2,endIndex),url=url.replace(obj.validateCode+"@","");}obj.protocol=url.split("//")[0],obj.search=url.split("?")[1]?"?"+url.split("?")[1]:"",obj.hostname=url.split("/")[2],obj.origin=obj.protocol+"//"+obj.hostname,obj.pathname=url.split("?")[0].replace(obj.origin,""),obj.href=url;var pathnames=obj.pathname.split("/"),lastPath=pathnames[2].split(".");return obj.deviceSerial=pathnames[1],obj.channelNo=lastPath[0],obj.type=lastPath[lastPath.length-1],"live"===obj.type&&(obj.definition=lastPath.length>2?lastPath[1]:"sd"),"rec"===obj.type&&pathnames[2]&&(obj.recType=pathnames[2].includes(".cloud.")?"cloud":""),obj.searchParams=getQuery(url),obj}return {}}var codec={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32};function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _instanceof(left,right){return null!=right&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?!!right[Symbol.hasInstance](left):left instanceof right}function _create_for_of_iterator_helper_loose(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(it)return (it=it.call(o)).next.bind(it);if(Array.isArray(o)||(it=function(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return "Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_array_like_to_array(o,minLen):void 0}}(o))||allowArrayLike){it&&(o=it);var i=0;return function(){return i>=o.length?{done:true}:{done:false,value:o[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var DateTime=function(){function DateTime(){}return DateTime.fillZero=function(num,len){return void 0===len&&(len=2),num.toString().padStart(len,"0")},DateTime.format=function(input,format){var date;if(_instanceof(input,Date))date=input;else {if("number"!=typeof input&&"string"!=typeof input)throw new Error("Invalid date input");date=DateTime.toDate(input+"");}for(var _step,result=format,_iterator=_create_for_of_iterator_helper_loose([[/(yyyy|YYYY)/g,function(){return DateTime.fillZero(date.getFullYear(),4)}],[/(yy|YY)/g,function(){return DateTime.fillZero(date.getFullYear()%100,2)}],[/(MM)/g,function(){return DateTime.fillZero(date.getMonth()+1,2)}],[/(M)/g,function(){return (date.getMonth()+1).toString()}],[/(dd|DD)/g,function(){return DateTime.fillZero(date.getDate(),2)}],[/(d|D)/g,function(){return date.getDate().toString()}],[/(HH|hh)/g,function(){return DateTime.fillZero(date.getHours(),2)}],[/(H|h)/g,function(){return date.getHours().toString()}],[/(mm)/g,function(){return DateTime.fillZero(date.getMinutes(),2)}],[/(m)/g,function(){return date.getMinutes().toString()}],[/(ss|SS)/g,function(){return DateTime.fillZero(date.getSeconds(),2)}],[/(s|S)/g,function(){return date.getSeconds().toString()}],[/(fff)/g,function(){return DateTime.fillZero(date.getMilliseconds(),3)}]]);!(_step=_iterator()).done;){var _step_value=_step.value,regexp=_step_value[0],fn=_step_value[1];result=result.replace(regexp,fn);}return result},DateTime.toDate=function(str){if(_instanceof(str,Date))return str;str=(str+"").trim().replace(/\/|\./gi,"-"),/^\d{4}$/.test(str)&&(str+="-01"),/^\d{4}-\d{2}$/.test(str)&&(str+="-01");try{return /^\d{4}-\d{2}-\d{2}$/.test(str)?new Date(+str.slice(0,4),+str.slice(5,7)-1,+str.slice(8,10),0,0,0):/^\d{8}$/.test(str)?(str+="",new Date(+str.slice(0,4),+str.slice(4,6)-1,+str.slice(6,8),0,0)):/^\d{14}$/.test(str)?(str+="",new Date(+str.slice(0,4),+str.slice(4,6)-1,+str.slice(6,8),+str.slice(8,10),+str.slice(10,12),+str.slice(12,14))):/^\d{13}$/.test(str)?new Date(Number(str)):/^\d{10}$/.test(str)?new Date(1e3*Number(str)):new Date(str)}catch(error){throw new Error("Invalid date string")}},DateTime.diff=function(date1,date2,type){ void 0===type&&(type="second");var d1=DateTime.toDate(date1),d2=DateTime.toDate(date2);return "second"===type?Math.floor((d1.getTime()-d2.getTime())/1e3):"minute"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60):"hour"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60):"day"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60/24):Math.abs(d1.getTime()-d2.getTime())},DateTime}();dist$2.DateTime=DateTime,dist$2.addVc=function(url,codecs){ void 0===codecs&&(codecs=["h264"]);var vc=(codecs||["h264"]).reduce(function(acc,key){return key=key.toLowerCase(),acc+(codec[key]||0)},0),host=url.split("?")[0],query=url.split("?")[1];return query=(query||"").split("&").filter(function(item){return !/^vc=\d?/.test(item)}).join("&"),host+"?"+(query+=(query?"&":"")+"vc="+vc)},dist$2.getQuery=getQuery,dist$2.getStaticPath=function(path,base){ void 0===base&&(base="");var protocolReg=/^(https?:\/\/|^\/\/)/;if(""===path||void 0===path)return "";if(protocolReg.test(path))return path;path=path.replace(/\/+/g,"/"),base=protocolReg.test(base||"")?base:window.location.href;try{return new URL(path,base).href}catch(error){return path}},dist$2.isHttp=function(url){return /^http[s]?:\/\//.test(url)},dist$2.isMobile=function(agent){var _navigator,_navigator1,_navigator2,_window;return /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone|Opera Mini)/i.test(null!=agent?agent:null==(_navigator=navigator)?void 0:_navigator.userAgent)||/Macintosh/i.test(agent||(null==(_navigator1=navigator)?void 0:_navigator1.userAgent))&&(null==(_navigator2=navigator)?void 0:_navigator2.maxTouchPoints)>1||!!(null==(_window=window)?void 0:_window.__IS_MOBILE_SIMULATOR__)},dist$2.isRealMobile=function(agent){var _navigator,ua=(null!=agent?agent:null==(_navigator=navigator)?void 0:_navigator.userAgent).toLowerCase();if(/ipad|tablet|playbook|silk|android(?!.*mobile)/i.test(ua))return false;var hasTouch="ontouchstart"in window||navigator.maxTouchPoints>0;return /android|webos|iphone|ipod|blackberry|iemobile|opera mini/i.test(ua)&&hasTouch},dist$2.parseEzopenUrl=parseEzopenUrl,dist$2.pick=function(obj,keys){return Object.entries(obj).reduce(function(acc,param){var key=param[0],value=param[1];return keys.includes(key)&&(acc[key]=value),acc},{})},dist$2.switchEzopenUrl=function(url,options){var _ref=null!=options?options:{},type=_ref.type,recType=_ref.recType,search=_ref.search,definition=_ref.definition,channelNo=_ref.channelNo,deviceSerial=_ref.deviceSerial,validateCode=_ref.validateCode,obj=parseEzopenUrl(url);if(search){var ns=Object.assign({},obj.searchParams,getQuery("?"+search.replace("?","")));search=Object.entries(ns).reduce(function(acc,param){var key=param[0],value=param[1];return ""===value?acc:acc+=key+"="+encodeURIComponent(value)+"&"},"?").replace(/&$/,"");}else search=obj.search;return type=type||obj.type,recType=null!=recType?recType:obj.recType,definition=null!=definition?definition:obj.definition,channelNo=channelNo||obj.channelNo,deviceSerial=deviceSerial||obj.deviceSerial,validateCode=null!=validateCode?validateCode:obj.validateCode,obj.protocol+"//"+(validateCode?validateCode+"@":"")+obj.hostname+"/"+deviceSerial+"/"+channelNo+("rec"===type&&recType?"."+recType:"")+("live"===type&&"hd"===definition?"."+definition:"")+"."+type+search};
|
|
10877
|
-
return dist$2;
|
|
10878
|
-
}
|
|
10879
|
-
|
|
10880
9051
|
/*
|
|
10881
|
-
* @ezuikit/control-date-picker
|
|
10882
|
-
* Copyright (c) 2026-
|
|
9052
|
+
* @ezuikit/control-date-picker v2.0.0-beta.2
|
|
9053
|
+
* Copyright (c) 2026-05-04 Ezviz-OpenBiz
|
|
10883
9054
|
* Released under the MIT License.
|
|
10884
9055
|
*/
|
|
9056
|
+
var Util=function(){function Util(){}return Util.fillZero=function(num,len){return void 0===len&&(len=2),num.toString().padStart(len,"0")},Util.chunkBySize=function(arr,size){return Array.from({length:Math.ceil(arr.length/size)}).map(function(_,index){return arr.slice(index*size,(index+1)*size)})},Util.generateYears=function(year){for(var years=[],i=year%10+1;i>=0;i--)years.push(year-i);for(var i1=1;years.length<12;i1++)years.push(year+i1);return years},Util.getDaysInMonth=function(year,month){return new Date(year,month+1,0).getDate()},Util.getFirstDayOfMonth=function(year,month,startOfWeek){return void 0===startOfWeek&&(startOfWeek=0),(new Date(year,month).getDay()-startOfWeek+7)%7},Util.generateWeeksByYearMonth=function(year,month,startOfWeek){ void 0===startOfWeek&&(startOfWeek=0),month-=1;for(var daysInMonth=Util.getDaysInMonth(year,month),firstDay=Util.getFirstDayOfMonth(year,month,startOfWeek),weeks=[],i=1;i<=firstDay+daysInMonth;i++){var day=i-firstDay;day<1?weeks.push((0===month?year-1:year)+"-"+Util.fillZero((month+12-1)%12+1)+"-"+Util.fillZero(Util.getDaysInMonth(year,month-1)+day)):day>daysInMonth?weeks.push((11===month?year+1:year)+"-"+Util.fillZero((month+1)%12+1)+"-"+(day-daysInMonth)):weeks.push(year+"-"+Util.fillZero(month+1)+"-"+Util.fillZero(day));}for(var nextDay=1;weeks.length<42;)weeks.push((11===month?year+1:year)+"-"+Util.fillZero((month+1)%12+1)+"-"+Util.fillZero(nextDay++));return weeks},Util.generateHours=function(){for(var hours=[],i=0;i<24;i++)hours.push(Util.fillZero(i));return hours},Util.generateMinutesOrSeconds=function(){for(var hours=[],i=0;i<=59;i++)hours.push(Util.fillZero(i));return hours},Util}(),__$CALENDAR_LOCALES$__={en:{year:"",month:"",weeks:["Su","Mo","Tu","We","Th","Fr","Sa"],today:"Today",ok:"OK",months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},zh:{year:"年",month:"月",weeks:["日","一","二","三","四","五","六"],today:"今天",ok:"确定",months:["01","02","03","04","05","06","07","08","09","10","11","12"]}},__DEFAULT_COMPONENTS_OPTIONS__={showSuperPrevIcon:false,showSuperNextIcon:false,showPrevIcon:false,showNextIcon:false,showHeaderClose:false,showHeaderOk:false,renderSuperPrevIcon:'<span class="edate-super-prev-icon"></span>',renderSuperNextIcon:'<span class="edate-super-next-icon"></span>',renderPrevIcon:'<span class="edate-prev-icon"></span>',renderNextIcon:'<span class="edate-next-icon"></span>',renderHeaderCloseIcon:'<span class="edate-close-icon">\n <svg viewBox="0 0 24 24" fill="none" width="1em" height="1em" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="close">\n\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,0.707114,-0.707114,0.707099,6.34277,6.34326)" />\n\t\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,-0.707114,0.707114,0.707099,6.34277,17.6567)" />\n </svg>\n </span>',renderHeaderOkIcon:function(locale){return '<span class="edate-btn-text">'+((null==locale?void 0:locale.ok)||"确定")+"</span>"}},Header=function(){function Header(options){this.$header=null,this.options=deepmerge.all([{},__DEFAULT_COMPONENTS_OPTIONS__,options],{clone:false}),this.$header=document.createElement("div"),this.$header.classList.add("edate-header",options.prefixCls+"-header"),options.className&&this.$header.classList.add(options.className),this._render(),this._eventListeners();}var _proto=Header.prototype;return _proto._render=function(){var _this__getStrOrFunToStr,_this__getStrOrFunToStr1,_this__getStrOrFunToStr2,_this__getStrOrFunToStr3,_this__getStrOrFunToStr4,_this__getStrOrFunToStr5;this.$header&&(this.$header.innerHTML="\n "+(this.options.showHeaderClose?'<div class="edate-close-btn">\n '+(null!=(_this__getStrOrFunToStr=this._getStrOrFunToStr(this.options.renderHeaderCloseIcon))?_this__getStrOrFunToStr:__DEFAULT_COMPONENTS_OPTIONS__.renderHeaderCloseIcon)+"\n </div>":this.options.showHeaderOk?"<span></span>":"")+"\n "+(this.options.showSuperPrevIcon||this.options.showPrevIcon?'\n <div class="edate-prev-btns">\n '+(this.options.showSuperPrevIcon?'<div class="edate-super-prev-btn '+this.options.prefixCls+'-super-prev-btn">\n '+(null!=(_this__getStrOrFunToStr1=this._getStrOrFunToStr(this.options.renderSuperPrevIcon))?_this__getStrOrFunToStr1:__DEFAULT_COMPONENTS_OPTIONS__.renderSuperPrevIcon)+"\n </div>":"")+"\n "+(this.options.showPrevIcon?'<div class="edate-prev-btn '+this.options.prefixCls+'-prev-btn">\n '+(null!=(_this__getStrOrFunToStr2=this._getStrOrFunToStr(this.options.renderPrevIcon))?_this__getStrOrFunToStr2:__DEFAULT_COMPONENTS_OPTIONS__.renderPrevIcon)+"\n </div>":"")+"\n </div>\n ":"")+'\n\n <div class="edate-header-view '+this.options.prefixCls+'-header-view"></div>\n\n '+(this.options.showNextIcon||this.options.showSuperNextIcon?'\n <div class="edate-next-btns">\n '+(this.options.showNextIcon?'<div class="edate-next-btn '+this.options.prefixCls+'-next-btn">\n '+(null!=(_this__getStrOrFunToStr3=this._getStrOrFunToStr(this.options.renderNextIcon))?_this__getStrOrFunToStr3:__DEFAULT_COMPONENTS_OPTIONS__.renderNextIcon)+"\n </div>":"")+"\n "+(this.options.showSuperNextIcon?'<div class="edate-super-next-btn '+this.options.prefixCls+'-super-next-btn">\n '+(null!=(_this__getStrOrFunToStr4=this._getStrOrFunToStr(this.options.renderSuperNextIcon))?_this__getStrOrFunToStr4:__DEFAULT_COMPONENTS_OPTIONS__.renderSuperNextIcon)+"\n </div>":"")+"\n </div>\n ":"")+"\n "+(this.options.showHeaderOk?'<div class="edate-ok-btn">\n '+(null!=(_this__getStrOrFunToStr5=this._getStrOrFunToStr(this.options.renderHeaderOkIcon))?_this__getStrOrFunToStr5:__DEFAULT_COMPONENTS_OPTIONS__.renderHeaderOkIcon)+"\n </div>":this.options.showHeaderClose?"<span></span>":""));},_proto._getStrOrFunToStr=function(value){if(null!=value){var _this_options;if("function"==typeof value)return this._getStrOrFunToStr(null==value?void 0:value(null==(_this_options=this.options)?void 0:_this_options.locale));if("string"==typeof value)return value}},_proto.renderContent=function(html){if(this.$header){var _$content=this.$header.querySelector(".edate-header-view");if(!_$content)return;_$content.innerHTML=html;}},_proto.destroy=function(){this.$header&&this.$header.remove();},_proto._eventListeners=function(){var _this=this;_this.$header&&(delegate(_this.$header,".edate-super-prev-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onSuperPrev||_this.options.onSuperPrev.call(_this.options);}),delegate(_this.$header,".edate-prev-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onPrev||_this.options.onPrev.call(_this.options);}),delegate(_this.$header,".edate-next-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onNext||_this.options.onNext.call(_this.options);}),delegate(_this.$header,".edate-super-next-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onSuperNext||_this.options.onSuperNext.call(_this.options);}),delegate(_this.$header,".edate-close-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==_this.options.onClose||_this.options.onClose.call(_this.options),event.stopPropagation(),event.preventDefault());}),delegate(_this.$header,".edate-ok-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==_this.options.onOk||_this.options.onOk.call(_this.options),event.stopPropagation(),event.preventDefault());}));},Header}();function _extends$2$1(){return _extends$2$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends$2$1.apply(this,arguments)}var _CONTAINER_DEFAULT_OPTIONS_={prefixCls:"edate",locales:__$CALENDAR_LOCALES$__,showHeader:true},Container=function(){function Container(popupContainer,options){this.$panel=document.createElement("div"),this.$body=document.createElement("div"),this.$container=document.createElement("div"),this.language="zh",this.header=null,this.locale=__$CALENDAR_LOCALES$__.zh,this.options=deepmerge.all([{},_CONTAINER_DEFAULT_OPTIONS_,options],{clone:false}),this.$popupContainer=popupContainer?"function"==typeof popupContainer?popupContainer():popupContainer:document.body,this._setLocale(),this.$container.classList.add("edate-container",(this.options.prefixCls||"edate")+"-container"),options.isMobile&&this.$container.classList.add("edate-mobile",this.options.prefixCls+"-mobile"),this.options.wrapClassName&&this.$container.classList.add(this.options.wrapClassName),this.$panel.classList.add("edate-panel",(this.options.prefixCls||"edate")+"-panel"),this.options.showHeader&&(this.header=new Header(_extends$2$1({},this.options,{locale:this.locale,onPrev:this._onPrev.bind(this),onNext:this._onNext.bind(this),onSuperPrev:this._onSuperPrev.bind(this),onSuperNext:this._onSuperNext.bind(this),onClose:this._onClose.bind(this),onOk:this._onOk.bind(this)})),this.$panel.appendChild(this.header.$header)),this.$body.classList.add("edate-body",(this.options.prefixCls||"edate")+"-body"),this.$container.appendChild(this.$panel),this.$popupContainer.appendChild(this.$container);}var _proto=Container.prototype;return _proto._setLocale=function(){if(this.options.locales)if("string"==typeof this.options.language){var language=this.options.language||navigator.language;this.options.locales[language]?this.locale=this.options.locales[language]:this.locale=this.options.locales.zh;}else this.locale=this.options.locales.zh;},_proto.destroy=function(){var _this_$container;(null==(_this_$container=this.$container)?void 0:_this_$container.parentNode)&&this.$container.parentNode.removeChild(this.$container),this.header=null,this.$container=null;},_proto.setLocale=function(locale){"string"==typeof locale?this._setLocale():this.locale=locale;},_proto._onSuperPrev=function(){},_proto._onSuperNext=function(){},_proto._onPrev=function(){},_proto._onNext=function(){},_proto._onClose=function(){},_proto._onOk=function(){},Container}();function _create_class$3$1(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _extends$1$2(){return _extends$1$2=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends$1$2.apply(this,arguments)}function _set_prototype_of$3$1(o,p){return _set_prototype_of$3$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$3$1(o,p)}var _CALENDAR_DEFAULT_OPTIONS_={startOfWeek:0,showHeader:true,showSuperPrevIcon:true,showSuperNextIcon:true,showPrevIcon:true,showNextIcon:true,language:"zh",renderBadge:'<span class="ecalendar-badge"></span>',badges:[]},Calendar=function(Container){function Calendar(container,options){var _this,_this_options_badges,_this_options,_this_options1,_this_options2;return (_this=Container.call(this,container,_extends$1$2({},_CALENDAR_DEFAULT_OPTIONS_,options,{prefixCls:"ecalendar"}))||this).badges=[],(null==(_this_options_badges=_this.options.badges)?void 0:_this_options_badges.length)&&_this._updateBadges(_this.options.badges,false),(null==(_this_options=_this.options)?void 0:_this_options.startOfWeek)&&((null==(_this_options1=_this.options)?void 0:_this_options1.startOfWeek)>6||(null==(_this_options2=_this.options)?void 0:_this_options2.startOfWeek)<0)&&(_this.options.startOfWeek=0),_this._render(),_this.setCurrent(_this.options.current,false),_this._onHeader(),_this._onCell(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of$3$1(subClass,superClass);}(Calendar,Container);var _proto=Calendar.prototype;return _proto.setCurrent=function(date,change){if(void 0===change&&(change=true),"string"==typeof date||(left=date,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right))try{if(date="string"==typeof date?distExports$4.DateTime.toDate(date):date,(!this._current||distExports$4.DateTime.format(date,"YYYY-MM-DD")!==distExports$4.DateTime.format(this._current,"YYYY-MM-DD"))&&(this._current=date,change&&(null==this.options.onChange||this.options.onChange.call(this.options,date,distExports$4.DateTime.format(date,"YYYY-MM-DD"))),this.$body)){var _this_$body_querySelector,_this_$body_querySelector1;null==(_this_$body_querySelector=this.$body.querySelector(".ecalendar-cell-selected"))||_this_$body_querySelector.classList.remove("ecalendar-cell-selected");var title=distExports$4.DateTime.format(this._current,"YYYY-MM-DD");null==(_this_$body_querySelector1=this.$body.querySelector(".ecalendar-cell-in-view[title='"+title+"']"))||_this_$body_querySelector1.classList.add("ecalendar-cell-selected");}this._setRenderCurrent(this._current);}catch(error){this._setRenderCurrent(new Date);}else this._setRenderCurrent(new Date);var left,right;},_proto.updateBadges=function(badges){this._updateBadges(badges);},_proto._updateBadges=function(badges,rerender){ void 0===rerender&&(rerender=true),(null==badges?void 0:badges.length)>=0&&(this.badges=badges.map(function(date){return distExports$4.DateTime.format(date,"YYYY-MM-DD")}),rerender&&this._renderDate());},_proto._setRenderCurrent=function(date){(!this._renderCurrent||date&&distExports$4.DateTime.format(this._renderCurrent,"YYYY-MM")!==distExports$4.DateTime.format(date,"YYYY-MM"))&&(this._renderCurrent=date||new Date,this._renderDate());},_proto._onCell=function(){var _this=this;delegate(this.$body,".ecalendar-cell","click",function(event){var date=new Date(event.delegateTarget.getAttribute("title").replace(/\//gi,"/")),disabled=event.delegateTarget.classList.contains("edate-disabled");disabled||_this.setCurrent(date),null==_this.options.onCell||_this.options.onCell.call(_this.options,date,distExports$4.DateTime.format(_this._renderCurrent,"YYYY-MM-DD"),disabled),event.stopPropagation(),event.preventDefault();});},_proto._onSuperPrev=function(){var date=new Date(this._renderCurrent);date.setFullYear(date.getFullYear()-1,date.getMonth(),date.getDate()),this._setRenderCurrent(date),null==this.options.onPrevMonth||this.options.onPrevMonth.call(this.options,this._current,this._renderCurrent);},_proto._onSuperNext=function(){var date=new Date(this._renderCurrent);date.setFullYear(date.getFullYear()+1,date.getMonth(),date.getDate()),this._setRenderCurrent(date),null==this.options.onNextMonth||this.options.onNextMonth.call(this.options,this._current,this._renderCurrent);},_proto._onPrev=function(){var date=new Date(this._renderCurrent);date.setMonth(date.getMonth()-1,date.getDate()),this._setRenderCurrent(date),null==this.options.onPrevMonth||this.options.onPrevMonth.call(this.options,this._current,this._renderCurrent);},_proto._onNext=function(){var date=new Date(this._renderCurrent);date.setMonth(date.getMonth()+1,date.getDate()),this._setRenderCurrent(date),null==this.options.onNextMonth||this.options.onNextMonth.call(this.options,this._current,this._renderCurrent);},_proto._onHeader=function(){var _this=this;delegate(this.$panel,".ecalendar-header-month-btn","click",function(){null==_this.options.onMonth||_this.options.onMonth.call(_this.options,_this._current,_this._renderCurrent);}),delegate(this.$panel,".ecalendar-header-year-btn","click",function(){null==_this.options.onYear||_this.options.onYear.call(_this.options,_this._current,_this._renderCurrent);});},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current);},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current);},_proto._render=function(){var _this_locale,_this_locale1,shiftedCustomDays=[].concat(((null==(_this_locale=this.locale)?void 0:_this_locale.weeks)||[]).slice(this.options.startOfWeek),((null==(_this_locale1=this.locale)?void 0:_this_locale1.weeks)||[]).slice(0,this.options.startOfWeek));this.$body.innerHTML='<table class="ecalendar-content">\n <thead><tr>'+shiftedCustomDays.map(function(day){return "<th>"+day+"</th>"}).join("")+"</tr></thead>\n <tbody></tbody>\n </table>",this.$panel.appendChild(this.$body);},_proto._renderDate=function(){var _this_header,_this_$body_querySelector,_this=this;if(this.$body){var _this_locale_months,_this_locale,_this_locale1,_this_locale2,_this_locale3,_this_locale_months1,_this_locale4,_this_locale5,_this_$body_querySelector1,todayStr=distExports$4.DateTime.format(new Date,"YYYY-MM-DD"),year=this._renderCurrent.getFullYear(),month=this._renderCurrent.getMonth()+1,dayGroupArray=Util.chunkBySize(Util.generateWeeksByYearMonth(year,month,this.options.startOfWeek),7),allowMonthClick="function"==typeof this.options.onMonth,allowYearClick="function"==typeof this.options.onYear;if(null==(_this_header=this.header)?void 0:_this_header.$header)this.header.renderContent("\n "+("zh"!==this.options.language?'<span class="ecalendar-header-month-btn '+(allowMonthClick?"edate-header-title-hover":"")+'">'+(null==(_this_locale=this.locale)||null==(_this_locale_months=_this_locale.months)?void 0:_this_locale_months[+(month-1)])+((null==(_this_locale1=this.locale)?void 0:_this_locale1.month)||"")+'</span> <span class="ecalendar-header-year-btn '+(allowYearClick?"edate-header-title-hover":"")+'">'+year+((null==(_this_locale2=this.locale)?void 0:_this_locale2.year)||"")+"</span>":'<span class="ecalendar-header-year-btn '+(allowYearClick?"edate-header-title-hover":"")+'">'+year+((null==(_this_locale3=this.locale)?void 0:_this_locale3.year)||"")+'</span> <span class="ecalendar-header-month-btn '+(allowMonthClick?"edate-header-title-hover":"")+'">'+(null==(_this_locale4=this.locale)||null==(_this_locale_months1=_this_locale4.months)?void 0:_this_locale_months1[+(month-1)])+((null==(_this_locale5=this.locale)?void 0:_this_locale5.month)||"")+"</span>"));if(null==(_this_$body_querySelector=this.$body.querySelector(".ecalendar-content"))?void 0:_this_$body_querySelector.querySelector("tbody"))(null==(_this_$body_querySelector1=this.$body.querySelector(".ecalendar-content"))?void 0:_this_$body_querySelector1.querySelector("tbody")).innerHTML="\n "+dayGroupArray.slice(0,7).map(function(dates){return "<tr>\n "+dates.map(function(dateStr){var _this_options,_dateStr_split=dateStr.split("-"),y=_dateStr_split[0],m=_dateStr_split[1],d=_dateStr_split[2],date=new Date(+y,+m,+d),classNames=[month===+m?"ecalendar-cell-in-view":"",todayStr===dateStr?"ecalendar-cell-today":"",_this._current&&distExports$4.DateTime.format(_this._current,"YYYY-MM-DD")===dateStr?"ecalendar-cell-selected":"","function"==typeof(null==(_this_options=_this.options)?void 0:_this_options.disabledDate)&&_this.options.disabledDate(distExports$4.DateTime.toDate(dateStr),dateStr)?"edate-disabled":""].filter(Boolean),badgeHtml=_this._renderBadge(date,dateStr);return '<td title="'+dateStr+'" class="ecalendar-cell '+classNames.join(" ")+'">\n '+("function"==typeof _this.options.renderDate?_this.options.renderDate(date,dateStr):'<span class="ecalendar-cell-inner">'+Util.fillZero(+d)+"</span>")+"\n "+badgeHtml+"\n </td>"}).join("")+"\n </tr>"}).join("");}},_proto._renderBadge=function(date,dateStr){var badgeHtml="";badgeHtml="function"==typeof this.options.renderBadge?this.options.renderBadge(date,dateStr):"string"==typeof this.options.renderBadge?this.options.renderBadge:"";var showBadge="function"==typeof this.options.showBadge&&this.options.showBadge(date,dateStr);return this.badges.includes(dateStr)||showBadge||(badgeHtml=""),badgeHtml},_create_class$3$1(Calendar,[{key:"current",get:function(){return this._current}}]),Calendar}(Container);function _create_class$2$1(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _set_prototype_of$2$1(o,p){return _set_prototype_of$2$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$2$1(o,p)}Calendar.DateTime=distExports$4.DateTime;var _Month_DEFAULT_OPTIONS_={showHeader:true,showSuperPrevIcon:true,showSuperNextIcon:true,language:"zh"},Month=function(Container){function Month(popupContainer,options){var _this;return (_this=Container.call(this,popupContainer,deepmerge.all([{},_Month_DEFAULT_OPTIONS_,options||{},{showPrevIcon:false,showNextIcon:false,prefixCls:"emonth"}],{clone:false}))||this)._render(),_this.setCurrent(_this.options.current,false),_this._onHeaderTitle(),_this._onCell(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of$2$1(subClass,superClass);}(Month,Container);var _proto=Month.prototype;return _proto.setCurrent=function(date,change){ void 0===change&&(change=true),this._setCurrent(date,change);},_proto._setCurrent=function(date,change){if("string"==typeof date||(left=date,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right))try{var d=date;"string"==typeof d&&(d=distExports$4.DateTime.toDate(d));var current=d;this._current&&distExports$4.DateTime.format(current,"YYYY-MM-DD")===distExports$4.DateTime.format(this._current,"YYYY-MM-DD")||(this._current=current,"function"==typeof this.options.onChange&&change&&(null==this.options.onChange||this.options.onChange.call(this.options,current,distExports$4.DateTime.format(current,"YYYY-MM")))),this._setRenderCurrent(current);}catch(error){this._setRenderCurrent(new Date);}else this._setRenderCurrent(new Date);var left,right;},_proto._setRenderCurrent=function(date){if((!this._renderCurrent||this._renderCurrent&&distExports$4.DateTime.format(date,"YYYY")!==distExports$4.DateTime.format(this._renderCurrent,"YYYY"))&&(this._renderCurrent=date,this._renderMonths(date.getFullYear())),this._current){var _this_$body_querySelector,_this_$body_querySelector1;null==(_this_$body_querySelector=this.$body.querySelector(".emonth-cell-selected"))||_this_$body_querySelector.classList.remove("emonth-cell-selected");var selectedTitle=distExports$4.DateTime.format(this._current,"YYYY-MM");null==(_this_$body_querySelector1=this.$body.querySelector(".emonth-cell-in-view[title='"+selectedTitle+"']"))||_this_$body_querySelector1.classList.add("emonth-cell-selected");}this._setHeader();},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current);},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current);},_proto._onCell=function(){var _this=this;delegate(this.$body,".emonth-cell","click",function(e){e.stopPropagation(),e.preventDefault();var month=+e.delegateTarget.getAttribute("data-month"),newDate=distExports$4.DateTime.toDate(distExports$4.DateTime.format(_this._current,"yyyy-MM-dd HH:mm:ss"));newDate.setMonth(month-1);var disabled=e.delegateTarget.classList.contains("edate-disabled");disabled||_this.setCurrent(newDate),null==_this.options.onCell||_this.options.onCell.call(_this.options,newDate,distExports$4.DateTime.format(newDate,"YYYY-MM"),disabled);});},_proto._onSuperPrev=function(){var year=this._renderCurrent.getFullYear()-1,date=distExports$4.DateTime.toDate(year+distExports$4.DateTime.format(this._renderCurrent,"-MM-DDTHH:mm:ss"));this._setRenderCurrent(date),null==this.options.onSuperPrev||this.options.onSuperPrev.call(this.options,this._current,this._renderCurrent);},_proto._onSuperNext=function(){var year=this._renderCurrent.getFullYear()+1,date=distExports$4.DateTime.toDate(year+distExports$4.DateTime.format(this._renderCurrent,"-MM-DDTHH:mm:ss"));this._setRenderCurrent(date),null==this.options.onSuperNext||this.options.onSuperNext.call(this.options,this._current,this._renderCurrent);},_proto._onHeaderTitle=function(){var _this=this;delegate(this.$panel,".edate-header-title-hover","click",function(){null==_this.options.onYear||_this.options.onYear.call(_this.options,_this._current,_this._renderCurrent);});},_proto._setHeader=function(){if(this.$panel.querySelector(".emonth-header-view")){var allowClick="function"==typeof this.options.onYear;this.$panel.querySelector(".emonth-header-view").innerHTML='<span class="'+(allowClick?"edate-header-title-hover":"")+'">'+this._renderCurrent.getFullYear()+this.locale.year+"</span>";}},_proto._setDisabled=function(){for(var year=this._renderCurrent.getFullYear(),i=0;i<12;i++){var $cell=this.$body.querySelector(".emonth-cell[title='"+year+"-"+Util.fillZero(i+1)+"']");if($cell){var date=distExports$4.DateTime.toDate(year+"-"+Util.fillZero(i+1)+"-"+distExports$4.DateTime.format(this._renderCurrent,"DDTHH:mm:ss"));"function"==typeof this.options.disabledMonth&&this.options.disabledMonth(date,distExports$4.DateTime.format(date,"YYYY-MM"))?$cell.classList.add("edate-disabled"):$cell.classList.remove("edate-disabled");}}},_proto._render=function(){this.$body.innerHTML='<table class="emonth-content"></table>',this.$panel.appendChild(this.$body);},_proto._renderMonths=function(year){var _this=this;this.$body.querySelector(".emonth-content")&&(this.$body.querySelector(".emonth-content").innerHTML="\n <tbody>\n "+Util.chunkBySize(this.locale.months,3).slice(0,4).map(function(month,index){return "<tr>\n "+month.map(function(m,i){return '<td title="'+year+"-"+Util.fillZero(3*index+i+1)+'" data-month="'+Util.fillZero(3*index+i+1)+'" class="emonth-cell emonth-cell-in-view">\n <span class="emonth-cell-inner">'+(_this.options.monthRender&&"function"==typeof _this.options.monthRender?_this.options.monthRender(distExports$4.DateTime.toDate(year+"-"+Util.fillZero(3*index+i+1)),year+"-"+Util.fillZero(3*index+i+1))||"":m)+"</span>\n </td>"}).join("")+"\n </tr>"}).join("")+"\n </tbody>"),this._setDisabled();},_create_class$2$1(Month,[{key:"current",get:function(){return this._current}}]),Month}(Container);function _create_class$1$1(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _set_prototype_of$1$2(o,p){return _set_prototype_of$1$2=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1$2(o,p)}var _YEAR_DEFAULT_OPTIONS_={showHeader:true,showSuperPrevIcon:true,showSuperNextIcon:true,language:"zh",prefixCls:"eyear"},Year=function(Container){function Year(popupContainer,options){var _this;return (_this=Container.call(this,popupContainer,deepmerge.all([{},_YEAR_DEFAULT_OPTIONS_,options||{},{showPrevIcon:false,showNextIcon:false,renderPrevIcon:"",renderNextIcon:""}],{clone:false}))||this)._render(),_this._setCurrent(_this.options.current,false),_this._onCell(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of$1$2(subClass,superClass);}(Year,Container);var _proto=Year.prototype;return _proto.setCurrent=function(year,change){ void 0===change&&(change=true),this._setCurrent(year,change);},_proto._setCurrent=function(year,change){ void 0===change&&(change=true);var left,right,_year="number"==typeof year?distExports$4.DateTime.toDate(year):(left=year,(null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)?year:new Date);this._current&&distExports$4.DateTime.format(_year,"YYYY-MM-DD")===distExports$4.DateTime.format(this._current,"YYYY-MM-DD")||(this._current=_year,"function"==typeof this.options.onChange&&change&&this.options.onChange(_year)),this._renderTenYear=(this._current||new Date).getFullYear(),this._renderYearList();},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current);},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current);},_proto._onCell=function(){var _this=this;delegate(this.$body,".eyear-cell","click",function(e){var yearStr=+e.delegateTarget.getAttribute("title"),newDate=distExports$4.DateTime.toDate(distExports$4.DateTime.format(_this._current,"yyyy-MM-dd HH:mm:ss"));newDate.setFullYear(yearStr);var disabled=e.delegateTarget.classList.contains("edate-disabled");disabled||_this._setCurrent(newDate),null==_this.options.onCell||_this.options.onCell.call(_this.options,newDate,distExports$4.DateTime.format(newDate,"YYYY"),disabled),e.stopPropagation(),e.preventDefault();});},_proto._onSuperPrev=function(){this._renderTenYear=this._renderTenYear-10,null==this.options.onPrevYear||this.options.onPrevYear.call(this.options,this._current,Util.generateYears(this._renderTenYear)),this._renderYearList();},_proto._onSuperNext=function(){this._renderTenYear=this._renderTenYear+10,null==this.options.onNextYear||this.options.onNextYear.call(this.options,this._current,Util.generateYears(this._renderTenYear)),this._renderYearList();},_proto._render=function(){this.$body.innerHTML='<table class="eyear-content"></table>',this.$panel.appendChild(this.$body);},_proto._renderYearList=function(){var _this_header,_this=this,list=Util.generateYears(this._renderTenYear);null==(_this_header=this.header)||_this_header.renderContent(list[1]+" - "+list[list.length-2]),this.$body.querySelector(".eyear-content")&&(this.$body.querySelector(".eyear-content").innerHTML="\n <tbody>\n "+Util.chunkBySize(list,3).slice(0,4).map(function(years,i){return "<tr>\n "+years.map(function(y,j){var classNames=0===i&&0===j||3===i&&2===j?"eyear-cell":"eyear-cell eyear-cell-in-view";return +y===+_this._current.getFullYear()&&(classNames+=" eyear-cell-selected"),"function"==typeof _this.options.disabledYear&&_this.options.disabledYear(distExports$4.DateTime.toDate(y),y)&&(classNames+=" edate-disabled"),'<td title="'+y+'" class="'+classNames+'">\n '+(_this.options.yearRender&&"function"==typeof _this.options.yearRender?_this.options.yearRender(distExports$4.DateTime.toDate(y),y):'<span class="eyear-cell-inner">'+ +y+"</span>")+"\n </td>"}).join("")+"\n </tr>"}).join("")+"\n </tbody>\n ");},_create_class$1$1(Year,[{key:"current",get:function(){return this._current}}]),Year}(Container);function _create_class$4(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _extends$7(){return _extends$7=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends$7.apply(this,arguments)}function _set_prototype_of$8(o,p){return _set_prototype_of$8=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$8(o,p)}var _DATEPICKER_MODE_ARRAY=["date","month","year"],_DATEPICKER_DEFAULT_OPTIONS_={getPopupContainer:function(){return document.body},language:"zh",isMobile:false,mode:_DATEPICKER_MODE_ARRAY[0]},DatePicker=function(Picker){function DatePicker(container,options){var _this;return (_this=Picker.call(this,container,deepmerge.all([{},_DATEPICKER_DEFAULT_OPTIONS_,options||{},{wrapClassName:("edate-picker-container "+((null==options?void 0:options.wrapClassName)||"")).trim()}],{clone:false}))||this).current=null,_this._current=null,_this._calendar=null,_this._month=null,_this._year=null,_this._currentMode="date",_this.options=deepmerge.all([{},_DATEPICKER_DEFAULT_OPTIONS_,options||{}],{clone:false}),_this.options.current&&(_this.current=_this.options.current,_this._current=_this.options.current),_this._currentMode=_this.options.mode,_this._switchMode(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of$8(subClass,superClass);}(DatePicker,Picker);var _proto=DatePicker.prototype;return _proto.setCurrent=function(date,change){ void 0===change&&(change=true),this._setCurrent(date,change);},_proto.updateBadges=function(badges){var _this__calendar;(null==badges?void 0:badges.length)>=0&&(null==(_this__calendar=this._calendar)||_this__calendar.updateBadges(badges));},_proto.destroy=function(){var _this__calendar,_this__month,_this__year;null==(_this__calendar=this._calendar)||_this__calendar.destroy(),this._calendar=null,null==(_this__month=this._month)||_this__month.destroy(),this._month=null,null==(_this__year=this._year)||_this__year.destroy(),this._year=null,Picker.prototype.destroy.call(this);},_proto._setCurrent=function(date,change){var _this__calendar,_this__month,_this__year;void 0===change&&(change=true),this._current=date,null==(_this__calendar=this._calendar)||_this__calendar.setCurrent(date,change),null==(_this__month=this._month)||_this__month.setCurrent(date,change),null==(_this__year=this._year)||_this__year.setCurrent(date,change);},_proto._switchMode=function(){this.$body.classList.add("edate-picker-"+this._currentMode),"date"===this._currentMode?this._initCalendar():"month"===this._currentMode?this._initMonth():"year"===this._currentMode&&this._initYear(),this.setPlacement(this.options.placement||"top");},_proto.hide=function(){this.open=false;},_proto._onOpenChange=function(open){Picker.prototype._onOpenChange.call(this,open),open&&(this._removeCurrentTypeClass(),this._currentMode=this.options.mode||"date",this._switchMode(),this._setCurrent(this.current,false)),open||null==this.options.onClose||this.options.onClose.call(this.options,this.current,this._currentMode);},_proto._initCalendar=function(){var _this=this;this._calendar||(this._calendar=new Calendar(this.$body,_extends$7({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),onMonth:this._onMonth.bind(this),onYear:this._onYear.bind(this),onChange:function(date){var _this__calendar;_this._current&&distExports$4.DateTime.format(_this._current,"YYYY-MM-DD")===distExports$4.DateTime.format(date,"YYYY-MM-DD")||_this._onChange(date,null==(_this__calendar=_this._calendar)?void 0:_this__calendar.options.showHeaderOk);}})));},_proto._initMonth=function(){var _this=this;this._month||(this._month=new Month(this.$body,_extends$7({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onChange:function(date){var _this__month;_this._current&&distExports$4.DateTime.format(_this._current,"YYYY-MM")===distExports$4.DateTime.format(date,"YYYY-MM")||_this._onChange(date,null==(_this__month=_this._month)?void 0:_this__month.options.showHeaderOk);},onYear:this._onYear.bind(this)})));},_proto._initYear=function(){var _this=this;this._year||(this._year=new Year(this.$body,_extends$7({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onChange:function(date){var _this__year;_this._current&&distExports$4.DateTime.format(_this._current,"YYYY")===distExports$4.DateTime.format(date,"YYYY")||_this._onChange(date,null==(_this__year=_this._year)?void 0:_this__year.options.showHeaderOk);}})));},_proto._onOk=function(date){this.current=date||this._current,this._setCurrent(date||this._current),null==this.options.onOk||this.options.onOk.call(this.options,this.current,this._currentMode),this.hide();},_proto._onClose=function(){this.hide();},_proto._onChange=function(date,_showHeaderOk){this._setCurrent(date,true);},_proto._onCell=function(date,_renderDate,disabled){null==this.options.onCell||this.options.onCell.call(this.options,date,this._currentMode),this.options.isMobile||this._currentMode!==this.options.mode||disabled||this._current&&distExports$4.DateTime.format(date,"YYYY-MM-DD")!==distExports$4.DateTime.format(this._current,"YYYY-MM-DD")||(this.current=date,null==this.options.onChange||this.options.onChange.call(this.options,date,this._currentMode)),disabled||this._prvMode();},_proto._prvMode=function(){this._currentMode!==this.options.mode||this.options.isMobile||this.hide();var index=_DATEPICKER_MODE_ARRAY.indexOf(this._currentMode);index>=1&&(index--,this._removeCurrentTypeClass(),this._currentMode=_DATEPICKER_MODE_ARRAY[index],this._switchMode());},_proto._onYear=function(){this._removeCurrentTypeClass(),this._currentMode="year",this._switchMode();},_proto._onMonth=function(){this._removeCurrentTypeClass(),this._currentMode="month",this._switchMode();},_proto._removeCurrentTypeClass=function(){this.$body.classList.remove("edate-picker-"+this._currentMode);},_create_class$4(DatePicker,[{key:"_minModeIndex",get:function(){return _DATEPICKER_MODE_ARRAY.indexOf(this.options.mode)}}]),DatePicker}(Picker);
|
|
10885
9057
|
|
|
10886
|
-
|
|
10887
|
-
|
|
10888
|
-
function requireDist$2 () {
|
|
10889
|
-
if (hasRequiredDist$2) return dist$3;
|
|
10890
|
-
hasRequiredDist$2 = 1;
|
|
10891
|
-
var delegate=requireDelegate(),utilsTools=requireDist$3(),deepmerge=requireCjs(),Picker=requireDist$a(),Util=function(){function Util(){}return Util.fillZero=function(num,len){return void 0===len&&(len=2),num.toString().padStart(len,"0")},Util.chunkBySize=function(arr,size){return Array.from({length:Math.ceil(arr.length/size)}).map(function(_,index){return arr.slice(index*size,(index+1)*size)})},Util.generateYears=function(year){for(var years=[],i=year%10+1;i>=0;i--)years.push(year-i);for(var i1=1;years.length<12;i1++)years.push(year+i1);return years},Util.getDaysInMonth=function(year,month){return new Date(year,month+1,0).getDate()},Util.getFirstDayOfMonth=function(year,month,startOfWeek){return void 0===startOfWeek&&(startOfWeek=0),(new Date(year,month).getDay()-startOfWeek+7)%7},Util.generateWeeksByYearMonth=function(year,month,startOfWeek){ void 0===startOfWeek&&(startOfWeek=0),month-=1;for(var daysInMonth=Util.getDaysInMonth(year,month),firstDay=Util.getFirstDayOfMonth(year,month,startOfWeek),weeks=[],i=1;i<=firstDay+daysInMonth;i++){var day=i-firstDay;day<1?weeks.push((0===month?year-1:year)+"-"+Util.fillZero((month+12-1)%12+1)+"-"+Util.fillZero(Util.getDaysInMonth(year,month-1)+day)):day>daysInMonth?weeks.push((11===month?year+1:year)+"-"+Util.fillZero((month+1)%12+1)+"-"+(day-daysInMonth)):weeks.push(year+"-"+Util.fillZero(month+1)+"-"+Util.fillZero(day));}for(var nextDay=1;weeks.length<42;)weeks.push((11===month?year+1:year)+"-"+Util.fillZero((month+1)%12+1)+"-"+Util.fillZero(nextDay++));return weeks},Util.generateHours=function(){for(var hours=[],i=0;i<24;i++)hours.push(Util.fillZero(i));return hours},Util.generateMinutesOrSeconds=function(){for(var hours=[],i=0;i<=59;i++)hours.push(Util.fillZero(i));return hours},Util}(),__$CALENDAR_LOCALES$__={en:{year:"",month:"",weeks:["Su","Mo","Tu","We","Th","Fr","Sa"],today:"Today",ok:"OK",months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},zh:{year:"年",month:"月",weeks:["日","一","二","三","四","五","六"],today:"今天",ok:"确定",months:["01","02","03","04","05","06","07","08","09","10","11","12"]}},__DEFAULT_COMPONENTS_OPTIONS__={showSuperPrevIcon:false,showSuperNextIcon:false,showPrevIcon:false,showNextIcon:false,showHeaderClose:false,showHeaderOk:false,renderSuperPrevIcon:'<span class="edate-super-prev-icon"></span>',renderSuperNextIcon:'<span class="edate-super-next-icon"></span>',renderPrevIcon:'<span class="edate-prev-icon"></span>',renderNextIcon:'<span class="edate-next-icon"></span>',renderHeaderCloseIcon:'<span class="edate-close-icon">\n <svg viewBox="0 0 24 24" fill="none" width="1em" height="1em" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="close">\n\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,0.707114,-0.707114,0.707099,6.34277,6.34326)" />\n\t\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,-0.707114,0.707114,0.707099,6.34277,17.6567)" />\n </svg>\n </span>',renderHeaderOkIcon:function(locale){return '<span class="edate-btn-text">'+((null==locale?void 0:locale.ok)||"确定")+"</span>"}},Header=function(){function Header(options){this.$header=null,this.options=deepmerge.all([{},__DEFAULT_COMPONENTS_OPTIONS__,options],{clone:false}),this.$header=document.createElement("div"),this.$header.classList.add("edate-header",options.prefixCls+"-header"),options.className&&this.$header.classList.add(options.className),this._render(),this._eventListeners();}var _proto=Header.prototype;return _proto._render=function(){var _this__getStrOrFunToStr,_this__getStrOrFunToStr1,_this__getStrOrFunToStr2,_this__getStrOrFunToStr3,_this__getStrOrFunToStr4,_this__getStrOrFunToStr5;this.$header&&(this.$header.innerHTML="\n "+(this.options.showHeaderClose?'<div class="edate-close-btn">\n '+(null!=(_this__getStrOrFunToStr=this._getStrOrFunToStr(this.options.renderHeaderCloseIcon))?_this__getStrOrFunToStr:__DEFAULT_COMPONENTS_OPTIONS__.renderHeaderCloseIcon)+"\n </div>":this.options.showHeaderOk?"<span></span>":"")+"\n "+(this.options.showSuperPrevIcon||this.options.showPrevIcon?'\n <div class="edate-prev-btns">\n '+(this.options.showSuperPrevIcon?'<div class="edate-super-prev-btn '+this.options.prefixCls+'-super-prev-btn">\n '+(null!=(_this__getStrOrFunToStr1=this._getStrOrFunToStr(this.options.renderSuperPrevIcon))?_this__getStrOrFunToStr1:__DEFAULT_COMPONENTS_OPTIONS__.renderSuperPrevIcon)+"\n </div>":"")+"\n "+(this.options.showPrevIcon?'<div class="edate-prev-btn '+this.options.prefixCls+'-prev-btn">\n '+(null!=(_this__getStrOrFunToStr2=this._getStrOrFunToStr(this.options.renderPrevIcon))?_this__getStrOrFunToStr2:__DEFAULT_COMPONENTS_OPTIONS__.renderPrevIcon)+"\n </div>":"")+"\n </div>\n ":"")+'\n\n <div class="edate-header-view '+this.options.prefixCls+'-header-view"></div>\n\n '+(this.options.showNextIcon||this.options.showSuperNextIcon?'\n <div class="edate-next-btns">\n '+(this.options.showNextIcon?'<div class="edate-next-btn '+this.options.prefixCls+'-next-btn">\n '+(null!=(_this__getStrOrFunToStr3=this._getStrOrFunToStr(this.options.renderNextIcon))?_this__getStrOrFunToStr3:__DEFAULT_COMPONENTS_OPTIONS__.renderNextIcon)+"\n </div>":"")+"\n "+(this.options.showSuperNextIcon?'<div class="edate-super-next-btn '+this.options.prefixCls+'-super-next-btn">\n '+(null!=(_this__getStrOrFunToStr4=this._getStrOrFunToStr(this.options.renderSuperNextIcon))?_this__getStrOrFunToStr4:__DEFAULT_COMPONENTS_OPTIONS__.renderSuperNextIcon)+"\n </div>":"")+"\n </div>\n ":"")+"\n "+(this.options.showHeaderOk?'<div class="edate-ok-btn">\n '+(null!=(_this__getStrOrFunToStr5=this._getStrOrFunToStr(this.options.renderHeaderOkIcon))?_this__getStrOrFunToStr5:__DEFAULT_COMPONENTS_OPTIONS__.renderHeaderOkIcon)+"\n </div>":this.options.showHeaderClose?"<span></span>":""));},_proto._getStrOrFunToStr=function(value){if(null!=value){var _this_options;if("function"==typeof value)return this._getStrOrFunToStr(null==value?void 0:value(null==(_this_options=this.options)?void 0:_this_options.locale));if("string"==typeof value)return value}},_proto.renderContent=function(html){if(this.$header){var _$content=this.$header.querySelector(".edate-header-view");if(!_$content)return;_$content.innerHTML=html;}},_proto.destroy=function(){this.$header&&this.$header.remove();},_proto._eventListeners=function(){var _this=this;_this.$header&&(delegate(_this.$header,".edate-super-prev-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onSuperPrev||_this.options.onSuperPrev.call(_this.options);}),delegate(_this.$header,".edate-prev-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onPrev||_this.options.onPrev.call(_this.options);}),delegate(_this.$header,".edate-next-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onNext||_this.options.onNext.call(_this.options);}),delegate(_this.$header,".edate-super-next-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onSuperNext||_this.options.onSuperNext.call(_this.options);}),delegate(_this.$header,".edate-close-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==_this.options.onClose||_this.options.onClose.call(_this.options),event.stopPropagation(),event.preventDefault());}),delegate(_this.$header,".edate-ok-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==_this.options.onOk||_this.options.onOk.call(_this.options),event.stopPropagation(),event.preventDefault());}));},Header}();function _extends$2(){return _extends$2=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends$2.apply(this,arguments)}var _CONTAINER_DEFAULT_OPTIONS_={prefixCls:"edate",locales:__$CALENDAR_LOCALES$__,showHeader:true},Container=function(){function Container(popupContainer,options){this.$panel=document.createElement("div"),this.$body=document.createElement("div"),this.$container=document.createElement("div"),this.language="zh",this.header=null,this.locale=__$CALENDAR_LOCALES$__.zh,this.options=deepmerge.all([{},_CONTAINER_DEFAULT_OPTIONS_,options],{clone:false}),this.$popupContainer=popupContainer?"function"==typeof popupContainer?popupContainer():popupContainer:document.body,this._setLocale(),this.$container.classList.add("edate-container",(this.options.prefixCls||"edate")+"-container"),options.isMobile&&this.$container.classList.add("edate-mobile",this.options.prefixCls+"-mobile"),this.options.wrapClassName&&this.$container.classList.add(this.options.wrapClassName),this.$panel.classList.add("edate-panel",(this.options.prefixCls||"edate")+"-panel"),this.options.showHeader&&(this.header=new Header(_extends$2({},this.options,{locale:this.locale,onPrev:this._onPrev.bind(this),onNext:this._onNext.bind(this),onSuperPrev:this._onSuperPrev.bind(this),onSuperNext:this._onSuperNext.bind(this),onClose:this._onClose.bind(this),onOk:this._onOk.bind(this)})),this.$panel.appendChild(this.header.$header)),this.$body.classList.add("edate-body",(this.options.prefixCls||"edate")+"-body"),this.$container.appendChild(this.$panel),this.$popupContainer.appendChild(this.$container);}var _proto=Container.prototype;return _proto._setLocale=function(){if(this.options.locales)if("string"==typeof this.options.language){var language=this.options.language||navigator.language;this.options.locales[language]?this.locale=this.options.locales[language]:this.locale=this.options.locales.zh;}else this.locale=this.options.locales.zh;},_proto.destroy=function(){var _this_$container;(null==(_this_$container=this.$container)?void 0:_this_$container.parentNode)&&this.$container.parentNode.removeChild(this.$container),this.header=null,this.$container=null;},_proto.setLocale=function(locale){"string"==typeof locale?this._setLocale():this.locale=locale;},_proto._onSuperPrev=function(){},_proto._onSuperNext=function(){},_proto._onPrev=function(){},_proto._onNext=function(){},_proto._onClose=function(){},_proto._onOk=function(){},Container}();function _create_class$3(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _extends$1(){return _extends$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends$1.apply(this,arguments)}function _set_prototype_of$3(o,p){return _set_prototype_of$3=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$3(o,p)}var _CALENDAR_DEFAULT_OPTIONS_={startOfWeek:0,showHeader:true,showSuperPrevIcon:true,showSuperNextIcon:true,showPrevIcon:true,showNextIcon:true,language:"zh",renderBadge:'<span class="ecalendar-badge"></span>',badges:[]},Calendar=function(Container){function Calendar(container,options){var _this,_this_options_badges,_this_options,_this_options1,_this_options2;return (_this=Container.call(this,container,_extends$1({},_CALENDAR_DEFAULT_OPTIONS_,options,{prefixCls:"ecalendar"}))||this).badges=[],(null==(_this_options_badges=_this.options.badges)?void 0:_this_options_badges.length)&&_this._updateBadges(_this.options.badges,false),(null==(_this_options=_this.options)?void 0:_this_options.startOfWeek)&&((null==(_this_options1=_this.options)?void 0:_this_options1.startOfWeek)>6||(null==(_this_options2=_this.options)?void 0:_this_options2.startOfWeek)<0)&&(_this.options.startOfWeek=0),_this._render(),_this.setCurrent(_this.options.current,false),_this._onHeader(),_this._onCell(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of$3(subClass,superClass);}(Calendar,Container);var _proto=Calendar.prototype;return _proto.setCurrent=function(date,change){if(void 0===change&&(change=true),"string"==typeof date||(left=date,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right))try{if(date="string"==typeof date?utilsTools.DateTime.toDate(date):date,(!this._current||utilsTools.DateTime.format(date,"YYYY-MM-DD")!==utilsTools.DateTime.format(this._current,"YYYY-MM-DD"))&&(this._current=date,change&&(null==this.options.onChange||this.options.onChange.call(this.options,date,utilsTools.DateTime.format(date,"YYYY-MM-DD"))),this.$body)){var _this_$body_querySelector,_this_$body_querySelector1;null==(_this_$body_querySelector=this.$body.querySelector(".ecalendar-cell-selected"))||_this_$body_querySelector.classList.remove("ecalendar-cell-selected");var title=utilsTools.DateTime.format(this._current,"YYYY-MM-DD");null==(_this_$body_querySelector1=this.$body.querySelector(".ecalendar-cell-in-view[title='"+title+"']"))||_this_$body_querySelector1.classList.add("ecalendar-cell-selected");}this._setRenderCurrent(this._current);}catch(error){this._setRenderCurrent(new Date);}else this._setRenderCurrent(new Date);var left,right;},_proto.updateBadges=function(badges){this._updateBadges(badges);},_proto._updateBadges=function(badges,rerender){ void 0===rerender&&(rerender=true),(null==badges?void 0:badges.length)>=0&&(this.badges=badges.map(function(date){return utilsTools.DateTime.format(date,"YYYY-MM-DD")}),rerender&&this._renderDate());},_proto._setRenderCurrent=function(date){(!this._renderCurrent||date&&utilsTools.DateTime.format(this._renderCurrent,"YYYY-MM")!==utilsTools.DateTime.format(date,"YYYY-MM"))&&(this._renderCurrent=date||new Date,this._renderDate());},_proto._onCell=function(){var _this=this;delegate(this.$body,".ecalendar-cell","click",function(event){var date=new Date(event.delegateTarget.getAttribute("title").replace(/\//gi,"/")),disabled=event.delegateTarget.classList.contains("edate-disabled");disabled||_this.setCurrent(date),null==_this.options.onCell||_this.options.onCell.call(_this.options,date,utilsTools.DateTime.format(_this._renderCurrent,"YYYY-MM-DD"),disabled),event.stopPropagation(),event.preventDefault();});},_proto._onSuperPrev=function(){var date=new Date(this._renderCurrent);date.setFullYear(date.getFullYear()-1,date.getMonth(),date.getDate()),this._setRenderCurrent(date),null==this.options.onPrevMonth||this.options.onPrevMonth.call(this.options,this._current,this._renderCurrent);},_proto._onSuperNext=function(){var date=new Date(this._renderCurrent);date.setFullYear(date.getFullYear()+1,date.getMonth(),date.getDate()),this._setRenderCurrent(date),null==this.options.onNextMonth||this.options.onNextMonth.call(this.options,this._current,this._renderCurrent);},_proto._onPrev=function(){var date=new Date(this._renderCurrent);date.setMonth(date.getMonth()-1,date.getDate()),this._setRenderCurrent(date),null==this.options.onPrevMonth||this.options.onPrevMonth.call(this.options,this._current,this._renderCurrent);},_proto._onNext=function(){var date=new Date(this._renderCurrent);date.setMonth(date.getMonth()+1,date.getDate()),this._setRenderCurrent(date),null==this.options.onNextMonth||this.options.onNextMonth.call(this.options,this._current,this._renderCurrent);},_proto._onHeader=function(){var _this=this;delegate(this.$panel,".ecalendar-header-month-btn","click",function(){null==_this.options.onMonth||_this.options.onMonth.call(_this.options,_this._current,_this._renderCurrent);}),delegate(this.$panel,".ecalendar-header-year-btn","click",function(){null==_this.options.onYear||_this.options.onYear.call(_this.options,_this._current,_this._renderCurrent);});},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current);},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current);},_proto._render=function(){var _this_locale,_this_locale1,shiftedCustomDays=[].concat(((null==(_this_locale=this.locale)?void 0:_this_locale.weeks)||[]).slice(this.options.startOfWeek),((null==(_this_locale1=this.locale)?void 0:_this_locale1.weeks)||[]).slice(0,this.options.startOfWeek));this.$body.innerHTML='<table class="ecalendar-content">\n <thead><tr>'+shiftedCustomDays.map(function(day){return "<th>"+day+"</th>"}).join("")+"</tr></thead>\n <tbody></tbody>\n </table>",this.$panel.appendChild(this.$body);},_proto._renderDate=function(){var _this_header,_this_$body_querySelector,_this=this;if(this.$body){var _this_locale_months,_this_locale,_this_locale1,_this_locale2,_this_locale3,_this_locale_months1,_this_locale4,_this_locale5,_this_$body_querySelector1,todayStr=utilsTools.DateTime.format(new Date,"YYYY-MM-DD"),year=this._renderCurrent.getFullYear(),month=this._renderCurrent.getMonth()+1,dayGroupArray=Util.chunkBySize(Util.generateWeeksByYearMonth(year,month,this.options.startOfWeek),7),allowMonthClick="function"==typeof this.options.onMonth,allowYearClick="function"==typeof this.options.onYear;if(null==(_this_header=this.header)?void 0:_this_header.$header)this.header.renderContent("\n "+("zh"!==this.options.language?'<span class="ecalendar-header-month-btn '+(allowMonthClick?"edate-header-title-hover":"")+'">'+(null==(_this_locale=this.locale)||null==(_this_locale_months=_this_locale.months)?void 0:_this_locale_months[+(month-1)])+((null==(_this_locale1=this.locale)?void 0:_this_locale1.month)||"")+'</span> <span class="ecalendar-header-year-btn '+(allowYearClick?"edate-header-title-hover":"")+'">'+year+((null==(_this_locale2=this.locale)?void 0:_this_locale2.year)||"")+"</span>":'<span class="ecalendar-header-year-btn '+(allowYearClick?"edate-header-title-hover":"")+'">'+year+((null==(_this_locale3=this.locale)?void 0:_this_locale3.year)||"")+'</span> <span class="ecalendar-header-month-btn '+(allowMonthClick?"edate-header-title-hover":"")+'">'+(null==(_this_locale4=this.locale)||null==(_this_locale_months1=_this_locale4.months)?void 0:_this_locale_months1[+(month-1)])+((null==(_this_locale5=this.locale)?void 0:_this_locale5.month)||"")+"</span>"));if(null==(_this_$body_querySelector=this.$body.querySelector(".ecalendar-content"))?void 0:_this_$body_querySelector.querySelector("tbody"))(null==(_this_$body_querySelector1=this.$body.querySelector(".ecalendar-content"))?void 0:_this_$body_querySelector1.querySelector("tbody")).innerHTML="\n "+dayGroupArray.slice(0,7).map(function(dates){return "<tr>\n "+dates.map(function(dateStr){var _this_options,_dateStr_split=dateStr.split("-"),y=_dateStr_split[0],m=_dateStr_split[1],d=_dateStr_split[2],date=new Date(+y,+m,+d),classNames=[month===+m?"ecalendar-cell-in-view":"",todayStr===dateStr?"ecalendar-cell-today":"",_this._current&&utilsTools.DateTime.format(_this._current,"YYYY-MM-DD")===dateStr?"ecalendar-cell-selected":"","function"==typeof(null==(_this_options=_this.options)?void 0:_this_options.disabledDate)&&_this.options.disabledDate(utilsTools.DateTime.toDate(dateStr),dateStr)?"edate-disabled":""].filter(Boolean),badgeHtml=_this._renderBadge(date,dateStr);return '<td title="'+dateStr+'" class="ecalendar-cell '+classNames.join(" ")+'">\n '+("function"==typeof _this.options.renderDate?_this.options.renderDate(date,dateStr):'<span class="ecalendar-cell-inner">'+Util.fillZero(+d)+"</span>")+"\n "+badgeHtml+"\n </td>"}).join("")+"\n </tr>"}).join("");}},_proto._renderBadge=function(date,dateStr){var badgeHtml="";badgeHtml="function"==typeof this.options.renderBadge?this.options.renderBadge(date,dateStr):"string"==typeof this.options.renderBadge?this.options.renderBadge:"";var showBadge="function"==typeof this.options.showBadge&&this.options.showBadge(date,dateStr);return this.badges.includes(dateStr)||showBadge||(badgeHtml=""),badgeHtml},_create_class$3(Calendar,[{key:"current",get:function(){return this._current}}]),Calendar}(Container);function _create_class$2(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _set_prototype_of$2(o,p){return _set_prototype_of$2=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$2(o,p)}Calendar.DateTime=utilsTools.DateTime;var _Month_DEFAULT_OPTIONS_={showHeader:true,showSuperPrevIcon:true,showSuperNextIcon:true,language:"zh"},Month=function(Container){function Month(popupContainer,options){var _this;return (_this=Container.call(this,popupContainer,deepmerge.all([{},_Month_DEFAULT_OPTIONS_,options||{},{showPrevIcon:false,showNextIcon:false,prefixCls:"emonth"}],{clone:false}))||this)._render(),_this.setCurrent(_this.options.current,false),_this._onHeaderTitle(),_this._onCell(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of$2(subClass,superClass);}(Month,Container);var _proto=Month.prototype;return _proto.setCurrent=function(date,change){ void 0===change&&(change=true),this._setCurrent(date,change);},_proto._setCurrent=function(date,change){if("string"==typeof date||(left=date,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right))try{var d=date;"string"==typeof d&&(d=utilsTools.DateTime.toDate(d));var current=d;this._current&&utilsTools.DateTime.format(current,"YYYY-MM-DD")===utilsTools.DateTime.format(this._current,"YYYY-MM-DD")||(this._current=current,"function"==typeof this.options.onChange&&change&&(null==this.options.onChange||this.options.onChange.call(this.options,current,utilsTools.DateTime.format(current,"YYYY-MM")))),this._setRenderCurrent(current);}catch(error){this._setRenderCurrent(new Date);}else this._setRenderCurrent(new Date);var left,right;},_proto._setRenderCurrent=function(date){if((!this._renderCurrent||this._renderCurrent&&utilsTools.DateTime.format(date,"YYYY")!==utilsTools.DateTime.format(this._renderCurrent,"YYYY"))&&(this._renderCurrent=date,this._renderMonths(date.getFullYear())),this._current){var _this_$body_querySelector,_this_$body_querySelector1;null==(_this_$body_querySelector=this.$body.querySelector(".emonth-cell-selected"))||_this_$body_querySelector.classList.remove("emonth-cell-selected");var selectedTitle=utilsTools.DateTime.format(this._current,"YYYY-MM");null==(_this_$body_querySelector1=this.$body.querySelector(".emonth-cell-in-view[title='"+selectedTitle+"']"))||_this_$body_querySelector1.classList.add("emonth-cell-selected");}this._setHeader();},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current);},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current);},_proto._onCell=function(){var _this=this;delegate(this.$body,".emonth-cell","click",function(e){e.stopPropagation(),e.preventDefault();var month=+e.delegateTarget.getAttribute("data-month"),newDate=utilsTools.DateTime.toDate(utilsTools.DateTime.format(_this._current,"yyyy-MM-dd HH:mm:ss"));newDate.setMonth(month-1);var disabled=e.delegateTarget.classList.contains("edate-disabled");disabled||_this.setCurrent(newDate),null==_this.options.onCell||_this.options.onCell.call(_this.options,newDate,utilsTools.DateTime.format(newDate,"YYYY-MM"),disabled);});},_proto._onSuperPrev=function(){var year=this._renderCurrent.getFullYear()-1,date=utilsTools.DateTime.toDate(year+utilsTools.DateTime.format(this._renderCurrent,"-MM-DDTHH:mm:ss"));this._setRenderCurrent(date),null==this.options.onSuperPrev||this.options.onSuperPrev.call(this.options,this._current,this._renderCurrent);},_proto._onSuperNext=function(){var year=this._renderCurrent.getFullYear()+1,date=utilsTools.DateTime.toDate(year+utilsTools.DateTime.format(this._renderCurrent,"-MM-DDTHH:mm:ss"));this._setRenderCurrent(date),null==this.options.onSuperNext||this.options.onSuperNext.call(this.options,this._current,this._renderCurrent);},_proto._onHeaderTitle=function(){var _this=this;delegate(this.$panel,".edate-header-title-hover","click",function(){null==_this.options.onYear||_this.options.onYear.call(_this.options,_this._current,_this._renderCurrent);});},_proto._setHeader=function(){if(this.$panel.querySelector(".emonth-header-view")){var allowClick="function"==typeof this.options.onYear;this.$panel.querySelector(".emonth-header-view").innerHTML='<span class="'+(allowClick?"edate-header-title-hover":"")+'">'+this._renderCurrent.getFullYear()+this.locale.year+"</span>";}},_proto._setDisabled=function(){for(var year=this._renderCurrent.getFullYear(),i=0;i<12;i++){var $cell=this.$body.querySelector(".emonth-cell[title='"+year+"-"+Util.fillZero(i+1)+"']");if($cell){var date=utilsTools.DateTime.toDate(year+"-"+Util.fillZero(i+1)+"-"+utilsTools.DateTime.format(this._renderCurrent,"DDTHH:mm:ss"));"function"==typeof this.options.disabledMonth&&this.options.disabledMonth(date,utilsTools.DateTime.format(date,"YYYY-MM"))?$cell.classList.add("edate-disabled"):$cell.classList.remove("edate-disabled");}}},_proto._render=function(){this.$body.innerHTML='<table class="emonth-content"></table>',this.$panel.appendChild(this.$body);},_proto._renderMonths=function(year){var _this=this;this.$body.querySelector(".emonth-content")&&(this.$body.querySelector(".emonth-content").innerHTML="\n <tbody>\n "+Util.chunkBySize(this.locale.months,3).slice(0,4).map(function(month,index){return "<tr>\n "+month.map(function(m,i){return '<td title="'+year+"-"+Util.fillZero(3*index+i+1)+'" data-month="'+Util.fillZero(3*index+i+1)+'" class="emonth-cell emonth-cell-in-view">\n <span class="emonth-cell-inner">'+(_this.options.monthRender&&"function"==typeof _this.options.monthRender?_this.options.monthRender(utilsTools.DateTime.toDate(year+"-"+Util.fillZero(3*index+i+1)),year+"-"+Util.fillZero(3*index+i+1))||"":m)+"</span>\n </td>"}).join("")+"\n </tr>"}).join("")+"\n </tbody>"),this._setDisabled();},_create_class$2(Month,[{key:"current",get:function(){return this._current}}]),Month}(Container);function _create_class$1(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _set_prototype_of$1(o,p){return _set_prototype_of$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1(o,p)}var _YEAR_DEFAULT_OPTIONS_={showHeader:true,showSuperPrevIcon:true,showSuperNextIcon:true,language:"zh",prefixCls:"eyear"},Year=function(Container){function Year(popupContainer,options){var _this;return (_this=Container.call(this,popupContainer,deepmerge.all([{},_YEAR_DEFAULT_OPTIONS_,options||{},{showPrevIcon:false,showNextIcon:false,renderPrevIcon:"",renderNextIcon:""}],{clone:false}))||this)._render(),_this._setCurrent(_this.options.current,false),_this._onCell(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of$1(subClass,superClass);}(Year,Container);var _proto=Year.prototype;return _proto.setCurrent=function(year,change){ void 0===change&&(change=true),this._setCurrent(year,change);},_proto._setCurrent=function(year,change){ void 0===change&&(change=true);var left,right,_year="number"==typeof year?utilsTools.DateTime.toDate(year):(left=year,(null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)?year:new Date);this._current&&utilsTools.DateTime.format(_year,"YYYY-MM-DD")===utilsTools.DateTime.format(this._current,"YYYY-MM-DD")||(this._current=_year,"function"==typeof this.options.onChange&&change&&this.options.onChange(_year)),this._renderTenYear=(this._current||new Date).getFullYear(),this._renderYearList();},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current);},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current);},_proto._onCell=function(){var _this=this;delegate(this.$body,".eyear-cell","click",function(e){var yearStr=+e.delegateTarget.getAttribute("title"),newDate=utilsTools.DateTime.toDate(utilsTools.DateTime.format(_this._current,"yyyy-MM-dd HH:mm:ss"));newDate.setFullYear(yearStr);var disabled=e.delegateTarget.classList.contains("edate-disabled");disabled||_this._setCurrent(newDate),null==_this.options.onCell||_this.options.onCell.call(_this.options,newDate,utilsTools.DateTime.format(newDate,"YYYY"),disabled),e.stopPropagation(),e.preventDefault();});},_proto._onSuperPrev=function(){this._renderTenYear=this._renderTenYear-10,null==this.options.onPrevYear||this.options.onPrevYear.call(this.options,this._current,Util.generateYears(this._renderTenYear)),this._renderYearList();},_proto._onSuperNext=function(){this._renderTenYear=this._renderTenYear+10,null==this.options.onNextYear||this.options.onNextYear.call(this.options,this._current,Util.generateYears(this._renderTenYear)),this._renderYearList();},_proto._render=function(){this.$body.innerHTML='<table class="eyear-content"></table>',this.$panel.appendChild(this.$body);},_proto._renderYearList=function(){var _this_header,_this=this,list=Util.generateYears(this._renderTenYear);null==(_this_header=this.header)||_this_header.renderContent(list[1]+" - "+list[list.length-2]),this.$body.querySelector(".eyear-content")&&(this.$body.querySelector(".eyear-content").innerHTML="\n <tbody>\n "+Util.chunkBySize(list,3).slice(0,4).map(function(years,i){return "<tr>\n "+years.map(function(y,j){var classNames=0===i&&0===j||3===i&&2===j?"eyear-cell":"eyear-cell eyear-cell-in-view";return +y===+_this._current.getFullYear()&&(classNames+=" eyear-cell-selected"),"function"==typeof _this.options.disabledYear&&_this.options.disabledYear(utilsTools.DateTime.toDate(y),y)&&(classNames+=" edate-disabled"),'<td title="'+y+'" class="'+classNames+'">\n '+(_this.options.yearRender&&"function"==typeof _this.options.yearRender?_this.options.yearRender(utilsTools.DateTime.toDate(y),y):'<span class="eyear-cell-inner">'+ +y+"</span>")+"\n </td>"}).join("")+"\n </tr>"}).join("")+"\n </tbody>\n ");},_create_class$1(Year,[{key:"current",get:function(){return this._current}}]),Year}(Container);function _create_class(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _extends(){return _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends.apply(this,arguments)}function _set_prototype_of(o,p){return _set_prototype_of=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of(o,p)}var _DATEPICKER_MODE_ARRAY=["date","month","year"],_DATEPICKER_DEFAULT_OPTIONS_={getPopupContainer:function(){return document.body},language:"zh",isMobile:false,mode:_DATEPICKER_MODE_ARRAY[0]},DatePicker=function(Picker){function DatePicker(container,options){var _this;return (_this=Picker.call(this,container,deepmerge.all([{},_DATEPICKER_DEFAULT_OPTIONS_,options||{},{wrapClassName:("edate-picker-container "+((null==options?void 0:options.wrapClassName)||"")).trim()}],{clone:false}))||this).current=null,_this._current=null,_this._calendar=null,_this._month=null,_this._year=null,_this._currentMode="date",_this.options=deepmerge.all([{},_DATEPICKER_DEFAULT_OPTIONS_,options||{}],{clone:false}),_this.options.current&&(_this.current=_this.options.current,_this._current=_this.options.current),_this._currentMode=_this.options.mode,_this._switchMode(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of(subClass,superClass);}(DatePicker,Picker);var _proto=DatePicker.prototype;return _proto.setCurrent=function(date,change){ void 0===change&&(change=true),this._setCurrent(date,change);},_proto.updateBadges=function(badges){var _this__calendar;(null==badges?void 0:badges.length)>=0&&(null==(_this__calendar=this._calendar)||_this__calendar.updateBadges(badges));},_proto.destroy=function(){var _this__calendar,_this__month,_this__year;null==(_this__calendar=this._calendar)||_this__calendar.destroy(),this._calendar=null,null==(_this__month=this._month)||_this__month.destroy(),this._month=null,null==(_this__year=this._year)||_this__year.destroy(),this._year=null,Picker.prototype.destroy.call(this);},_proto._setCurrent=function(date,change){var _this__calendar,_this__month,_this__year;void 0===change&&(change=true),this._current=date,null==(_this__calendar=this._calendar)||_this__calendar.setCurrent(date,change),null==(_this__month=this._month)||_this__month.setCurrent(date,change),null==(_this__year=this._year)||_this__year.setCurrent(date,change);},_proto._switchMode=function(){this.$body.classList.add("edate-picker-"+this._currentMode),"date"===this._currentMode?this._initCalendar():"month"===this._currentMode?this._initMonth():"year"===this._currentMode&&this._initYear(),this.setPlacement(this.options.placement||"top");},_proto.hide=function(){this.open=false;},_proto._onOpenChange=function(open){Picker.prototype._onOpenChange.call(this,open),open&&(this._removeCurrentTypeClass(),this._currentMode=this.options.mode||"date",this._switchMode(),this._setCurrent(this.current,false)),open||null==this.options.onClose||this.options.onClose.call(this.options,this.current,this._currentMode);},_proto._initCalendar=function(){var _this=this;this._calendar||(this._calendar=new Calendar(this.$body,_extends({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),onMonth:this._onMonth.bind(this),onYear:this._onYear.bind(this),onChange:function(date){var _this__calendar;_this._current&&utilsTools.DateTime.format(_this._current,"YYYY-MM-DD")===utilsTools.DateTime.format(date,"YYYY-MM-DD")||_this._onChange(date,null==(_this__calendar=_this._calendar)?void 0:_this__calendar.options.showHeaderOk);}})));},_proto._initMonth=function(){var _this=this;this._month||(this._month=new Month(this.$body,_extends({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onChange:function(date){var _this__month;_this._current&&utilsTools.DateTime.format(_this._current,"YYYY-MM")===utilsTools.DateTime.format(date,"YYYY-MM")||_this._onChange(date,null==(_this__month=_this._month)?void 0:_this__month.options.showHeaderOk);},onYear:this._onYear.bind(this)})));},_proto._initYear=function(){var _this=this;this._year||(this._year=new Year(this.$body,_extends({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onChange:function(date){var _this__year;_this._current&&utilsTools.DateTime.format(_this._current,"YYYY")===utilsTools.DateTime.format(date,"YYYY")||_this._onChange(date,null==(_this__year=_this._year)?void 0:_this__year.options.showHeaderOk);}})));},_proto._onOk=function(date){this.current=date||this._current,this._setCurrent(date||this._current),null==this.options.onOk||this.options.onOk.call(this.options,this.current,this._currentMode),this.hide();},_proto._onClose=function(){this.hide();},_proto._onChange=function(date,_showHeaderOk){this._setCurrent(date,true);},_proto._onCell=function(date,_renderDate,disabled){null==this.options.onCell||this.options.onCell.call(this.options,date,this._currentMode),this.options.isMobile||this._currentMode!==this.options.mode||disabled||this._current&&utilsTools.DateTime.format(date,"YYYY-MM-DD")!==utilsTools.DateTime.format(this._current,"YYYY-MM-DD")||(this.current=date,null==this.options.onChange||this.options.onChange.call(this.options,date,this._currentMode)),disabled||this._prvMode();},_proto._prvMode=function(){this._currentMode!==this.options.mode||this.options.isMobile||this.hide();var index=_DATEPICKER_MODE_ARRAY.indexOf(this._currentMode);index>=1&&(index--,this._removeCurrentTypeClass(),this._currentMode=_DATEPICKER_MODE_ARRAY[index],this._switchMode());},_proto._onYear=function(){this._removeCurrentTypeClass(),this._currentMode="year",this._switchMode();},_proto._onMonth=function(){this._removeCurrentTypeClass(),this._currentMode="month",this._switchMode();},_proto._removeCurrentTypeClass=function(){this.$body.classList.remove("edate-picker-"+this._currentMode);},_create_class(DatePicker,[{key:"_minModeIndex",get:function(){return _DATEPICKER_MODE_ARRAY.indexOf(this.options.mode)}}]),DatePicker}(Picker);dist$3.Calendar=Calendar,dist$3.DatePicker=DatePicker,dist$3.Header=Header,dist$3.Month=Month,dist$3.Year=Year;
|
|
10892
|
-
return dist$3;
|
|
10893
|
-
}
|
|
10894
|
-
|
|
10895
|
-
var distExports$1 = requireDist$2();
|
|
10896
|
-
|
|
10897
|
-
function _extends$5() {
|
|
10898
|
-
_extends$5 = Object.assign || function(target) {
|
|
9058
|
+
function _extends$6() {
|
|
9059
|
+
_extends$6 = Object.assign || function(target) {
|
|
10899
9060
|
for(var i = 1; i < arguments.length; i++){
|
|
10900
9061
|
var source = arguments[i];
|
|
10901
9062
|
for(var key in source){
|
|
@@ -10906,7 +9067,7 @@
|
|
|
10906
9067
|
}
|
|
10907
9068
|
return target;
|
|
10908
9069
|
};
|
|
10909
|
-
return _extends$
|
|
9070
|
+
return _extends$6.apply(this, arguments);
|
|
10910
9071
|
}
|
|
10911
9072
|
function _inherits$6(subClass, superClass) {
|
|
10912
9073
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -10919,14 +9080,14 @@
|
|
|
10919
9080
|
configurable: true
|
|
10920
9081
|
}
|
|
10921
9082
|
});
|
|
10922
|
-
if (superClass) _set_prototype_of$
|
|
9083
|
+
if (superClass) _set_prototype_of$7(subClass, superClass);
|
|
10923
9084
|
}
|
|
10924
|
-
function _set_prototype_of$
|
|
10925
|
-
_set_prototype_of$
|
|
9085
|
+
function _set_prototype_of$7(o, p) {
|
|
9086
|
+
_set_prototype_of$7 = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
10926
9087
|
o.__proto__ = p;
|
|
10927
9088
|
return o;
|
|
10928
9089
|
};
|
|
10929
|
-
return _set_prototype_of$
|
|
9090
|
+
return _set_prototype_of$7(o, p);
|
|
10930
9091
|
}
|
|
10931
9092
|
/**
|
|
10932
9093
|
* 日历选择器控件
|
|
@@ -10936,7 +9097,7 @@
|
|
|
10936
9097
|
function DatePickerControl(options) {
|
|
10937
9098
|
var _this;
|
|
10938
9099
|
var _this_options_props_urlInfo_searchParams, _this_options_props_urlInfo, _this_options_props;
|
|
10939
|
-
_this = Control.call(this, _extends$
|
|
9100
|
+
_this = Control.call(this, _extends$6({
|
|
10940
9101
|
maxDate: new Date()
|
|
10941
9102
|
}, options, {
|
|
10942
9103
|
tagName: 'span',
|
|
@@ -10944,7 +9105,7 @@
|
|
|
10944
9105
|
classNameSuffix: 'date'
|
|
10945
9106
|
})) || this;
|
|
10946
9107
|
_this.options = options;
|
|
10947
|
-
_this._value = distExports$
|
|
9108
|
+
_this._value = distExports$4.DateTime.format(((_this_options_props = _this.options.props) == null ? void 0 : (_this_options_props_urlInfo = _this_options_props.urlInfo) == null ? void 0 : (_this_options_props_urlInfo_searchParams = _this_options_props_urlInfo.searchParams) == null ? void 0 : _this_options_props_urlInfo_searchParams.begin) || new Date(), 'YYYY-MM-DD');
|
|
10948
9109
|
_this._render();
|
|
10949
9110
|
// 日期上的点
|
|
10950
9111
|
_this.on(EVENTS.control.dateMonthChange, function(dates) {
|
|
@@ -10957,7 +9118,7 @@
|
|
|
10957
9118
|
_proto._render = function _render() {
|
|
10958
9119
|
var _this = this;
|
|
10959
9120
|
var _this_options_props;
|
|
10960
|
-
var isMobile1 = distExports$
|
|
9121
|
+
var isMobile1 = distExports$4.isMobile();
|
|
10961
9122
|
if (isMobile1) {
|
|
10962
9123
|
var _this_locale;
|
|
10963
9124
|
this.$container.innerHTML = '\n <span class="' + PREFIX_CLASS + '-mobile-date-filter" title="' + (((_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_CALENDAR) || '') + '">\n <span class="' + PREFIX_CLASS + '-mobile-date-filter-value">' + this._getDateStr() + "</span>\n " + IconComponents.filter() + "\n <span>";
|
|
@@ -10967,7 +9128,7 @@
|
|
|
10967
9128
|
title: (_this_locale1 = this.locale) == null ? void 0 : _this_locale1.BTN_CALENDAR
|
|
10968
9129
|
});
|
|
10969
9130
|
}
|
|
10970
|
-
this.datePicker = new
|
|
9131
|
+
this.datePicker = new DatePicker(this.$container, {
|
|
10971
9132
|
isMobile: isMobile1,
|
|
10972
9133
|
getPopupContainer: function() {
|
|
10973
9134
|
return _this.$container;
|
|
@@ -10979,7 +9140,7 @@
|
|
|
10979
9140
|
],
|
|
10980
9141
|
badges: ((_this_options_props = this.options.props) == null ? void 0 : _this_options_props.recMonth) || [],
|
|
10981
9142
|
language: this.options.language === 'zh' ? 'zh' : 'en',
|
|
10982
|
-
current: distExports$
|
|
9143
|
+
current: distExports$4.DateTime.toDate(this._value),
|
|
10983
9144
|
placement: 'tr',
|
|
10984
9145
|
triggerClose: true,
|
|
10985
9146
|
disabledDate: function(date) {
|
|
@@ -10987,8 +9148,8 @@
|
|
|
10987
9148
|
},
|
|
10988
9149
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10989
9150
|
onOk: function(date, _mode) {
|
|
10990
|
-
if (date && _this._value !== distExports$
|
|
10991
|
-
_this._value = distExports$
|
|
9151
|
+
if (date && _this._value !== distExports$4.DateTime.format(date, 'YYYY-MM-DD') && isMobile1) {
|
|
9152
|
+
_this._value = distExports$4.DateTime.format(date, 'YYYY-MM-DD');
|
|
10992
9153
|
_this.options.onOk == null ? void 0 : _this.options.onOk.call(_this.options, date);
|
|
10993
9154
|
_this.emit(EVENTS.control.dateChange, date);
|
|
10994
9155
|
if (date && _this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value")) {
|
|
@@ -10997,8 +9158,8 @@
|
|
|
10997
9158
|
}
|
|
10998
9159
|
},
|
|
10999
9160
|
onChange: function(date, mode) {
|
|
11000
|
-
if (date && _this._value !== distExports$
|
|
11001
|
-
_this._value = distExports$
|
|
9161
|
+
if (date && _this._value !== distExports$4.DateTime.format(date, 'YYYY-MM-DD') && !isMobile1 && mode === 'date') {
|
|
9162
|
+
_this._value = distExports$4.DateTime.format(date, 'YYYY-MM-DD');
|
|
11002
9163
|
_this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, date);
|
|
11003
9164
|
_this.emit(EVENTS.control.dateChange, date);
|
|
11004
9165
|
}
|
|
@@ -11017,8 +9178,8 @@
|
|
|
11017
9178
|
if (change === void 0) change = true;
|
|
11018
9179
|
var _this_datePicker;
|
|
11019
9180
|
(_this_datePicker = this.datePicker) == null ? void 0 : _this_datePicker.setCurrent(date, change);
|
|
11020
|
-
if (date && !change && this._value !== distExports$
|
|
11021
|
-
this._value = distExports$
|
|
9181
|
+
if (date && !change && this._value !== distExports$4.DateTime.format(date, 'YYYY-MM-DD')) {
|
|
9182
|
+
this._value = distExports$4.DateTime.format(date, 'YYYY-MM-DD');
|
|
11022
9183
|
if (date && this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value")) {
|
|
11023
9184
|
this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value").innerHTML = this._getDateStr();
|
|
11024
9185
|
}
|
|
@@ -11052,7 +9213,90 @@
|
|
|
11052
9213
|
return DatePickerControl;
|
|
11053
9214
|
}(Control);
|
|
11054
9215
|
|
|
11055
|
-
var dist$1 = {};
|
|
9216
|
+
var dist$1 = {exports: {}};
|
|
9217
|
+
|
|
9218
|
+
var hasRequiredDist$1;
|
|
9219
|
+
|
|
9220
|
+
function requireDist$1 () {
|
|
9221
|
+
if (hasRequiredDist$1) return dist$1.exports;
|
|
9222
|
+
hasRequiredDist$1 = 1;
|
|
9223
|
+
|
|
9224
|
+
var deepmerge = requireCjs();
|
|
9225
|
+
|
|
9226
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
9227
|
+
return protoProps && function(target, props) {
|
|
9228
|
+
for (var i = 0; i < props.length; i++) {
|
|
9229
|
+
var descriptor = props[i];
|
|
9230
|
+
descriptor.enumerable = descriptor.enumerable || false, descriptor.configurable = true,
|
|
9231
|
+
"value" in descriptor && (descriptor.writable = true), Object.defineProperty(target, descriptor.key, descriptor);
|
|
9232
|
+
}
|
|
9233
|
+
}(Constructor.prototype, protoProps), Constructor;
|
|
9234
|
+
}
|
|
9235
|
+
|
|
9236
|
+
var I18n = function() {
|
|
9237
|
+
function I18n(translations, options) {
|
|
9238
|
+
this._translations = {}, this._locale = null == options ? void 0 : options.defaultLocale,
|
|
9239
|
+
translations && (this._translations = translations, (null == options ? void 0 : options.defaultLocale) || (this._locale = Object.keys(translations)[0])),
|
|
9240
|
+
this.options = options || {};
|
|
9241
|
+
}
|
|
9242
|
+
var _proto = I18n.prototype;
|
|
9243
|
+
return _proto.t = function(scope, variables) {
|
|
9244
|
+
var value, translation = this._translations[this._locale];
|
|
9245
|
+
if (!translation) return "function" == typeof this.options.customizeMissing ? this.options.customizeMissing(scope, variables) : '[missing "' + this._locale + '" locale]';
|
|
9246
|
+
if ("string" == typeof scope && scope.includes(".") && !(scope in translation)) {
|
|
9247
|
+
var _this__findChainValue = this._findChainValue(translation, scope), v = _this__findChainValue[0];
|
|
9248
|
+
if (_this__findChainValue[1]) value = v; else {
|
|
9249
|
+
if (void 0 === (null == variables ? void 0 : variables.defaultvalue)) return "function" == typeof this.options.customizeMissing ? this.options.customizeMissing(scope, variables) : '[missing "' + this._locale + "." + scope + '" translation]';
|
|
9250
|
+
value = variables.defaultvalue;
|
|
9251
|
+
}
|
|
9252
|
+
} else if (scope in translation) value = translation[scope]; else {
|
|
9253
|
+
if (void 0 === (null == variables ? void 0 : variables.defaultvalue)) return "function" == typeof this.options.customizeMissing ? this.options.customizeMissing(scope, variables) : '[missing "' + this._locale + "." + scope + '" translation]';
|
|
9254
|
+
value = variables.defaultvalue;
|
|
9255
|
+
}
|
|
9256
|
+
return "string" == typeof value && variables && /\{\{\s*(\w+)\s*\}\}/.test(value) ? value.replace(/\{\{\s*(\w+)\s*\}\}/g, function(_, varName) {
|
|
9257
|
+
return String(variables[varName]) || "";
|
|
9258
|
+
}) : value;
|
|
9259
|
+
}, _proto.appendTranslations = function(translations) {
|
|
9260
|
+
this._translations = deepmerge(this._translations, translations, {
|
|
9261
|
+
clone: false
|
|
9262
|
+
}), this._locale || (this._locale = Object.keys(this._translations)[0]), this._onChange();
|
|
9263
|
+
}, _proto.switchLocale = function(locale) {
|
|
9264
|
+
locale in this._translations && (this._locale = locale, this._onChange());
|
|
9265
|
+
}, _proto.switchTranslation = function(locale) {
|
|
9266
|
+
this.switchLocale(locale);
|
|
9267
|
+
}, _proto.getCurrentLocale = function() {
|
|
9268
|
+
return this._locale;
|
|
9269
|
+
}, _proto.getCurrentTranslation = function() {
|
|
9270
|
+
return this._translations[this._locale];
|
|
9271
|
+
}, _proto.getVersion = function() {
|
|
9272
|
+
return "2.0.0";
|
|
9273
|
+
}, _proto._onChange = function() {
|
|
9274
|
+
return null == this.options.onChange ? void 0 : this.options.onChange.call(this.options, this);
|
|
9275
|
+
}, _proto._findChainValue = function(obj, path) {
|
|
9276
|
+
for (var paths = path.split("."), translation = obj, i = 0; i < paths.length; i++) {
|
|
9277
|
+
if (!(paths[i] in translation)) return [ void 0, false ];
|
|
9278
|
+
if (translation = translation[paths[i]], i + 1 === paths.length) return [ translation[paths[i]], true ];
|
|
9279
|
+
}
|
|
9280
|
+
return [ void 0, false ];
|
|
9281
|
+
}, _create_class(I18n, [ {
|
|
9282
|
+
key: "locale",
|
|
9283
|
+
get: function() {
|
|
9284
|
+
return this._locale;
|
|
9285
|
+
}
|
|
9286
|
+
}, {
|
|
9287
|
+
key: "translations",
|
|
9288
|
+
get: function() {
|
|
9289
|
+
return this._translations;
|
|
9290
|
+
}
|
|
9291
|
+
} ]), I18n;
|
|
9292
|
+
}();
|
|
9293
|
+
|
|
9294
|
+
I18n.VERSION = "2.0.0", dist$1.exports = I18n;
|
|
9295
|
+
return dist$1.exports;
|
|
9296
|
+
}
|
|
9297
|
+
|
|
9298
|
+
var distExports$1 = requireDist$1();
|
|
9299
|
+
var I18n = /*@__PURE__*/getDefaultExportFromCjs(distExports$1);
|
|
11056
9300
|
|
|
11057
9301
|
/**
|
|
11058
9302
|
* drag scroll support move and touch
|
|
@@ -11065,11 +9309,11 @@
|
|
|
11065
9309
|
*/
|
|
11066
9310
|
|
|
11067
9311
|
var dist;
|
|
11068
|
-
var hasRequiredDist
|
|
9312
|
+
var hasRequiredDist;
|
|
11069
9313
|
|
|
11070
|
-
function requireDist
|
|
11071
|
-
if (hasRequiredDist
|
|
11072
|
-
hasRequiredDist
|
|
9314
|
+
function requireDist () {
|
|
9315
|
+
if (hasRequiredDist) return dist;
|
|
9316
|
+
hasRequiredDist = 1;
|
|
11073
9317
|
|
|
11074
9318
|
/**
|
|
11075
9319
|
* 拖拽滚动状态
|
|
@@ -11508,22 +9752,15 @@
|
|
|
11508
9752
|
return dist;
|
|
11509
9753
|
}
|
|
11510
9754
|
|
|
9755
|
+
var distExports = requireDist();
|
|
9756
|
+
var DragScroll = /*@__PURE__*/getDefaultExportFromCjs(distExports);
|
|
9757
|
+
|
|
11511
9758
|
/*
|
|
11512
|
-
* @ezuikit/control-time-line
|
|
11513
|
-
* Copyright (c) 2026-
|
|
9759
|
+
* @ezuikit/control-time-line v2.0.0-beta.2
|
|
9760
|
+
* Copyright (c) 2026-05-03 Ezviz-OpenBiz
|
|
11514
9761
|
* Released under the MIT License.
|
|
11515
9762
|
*/
|
|
11516
|
-
|
|
11517
|
-
var hasRequiredDist;
|
|
11518
|
-
|
|
11519
|
-
function requireDist () {
|
|
11520
|
-
if (hasRequiredDist) return dist$1;
|
|
11521
|
-
hasRequiredDist = 1;
|
|
11522
|
-
var deepmerge=requireCjs(),I18n=requireDist$8(),Picker=requireDist$a(),utilsTools=requireDist$3(),DragScroll=requireDist$1(),delegate=requireDelegate(),_$TIMELINE_LOCALES$_={zh:{title:"包含{{len}}段录像",foldTitle:"{{len}}个录像"},en:{title:"Includes {{len}} {{unit}}",foldTitle:"{{len}} {{unit}}"}};function _create_class$2(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}var _$BASE_TIME_LINE_DEFAULT_OPTIONS$_={current:new Date,language:"zh",timeSections:[],readOnly:false,className:"",timeWidth:0,width:"100%",timePointColor:"#1890ff",timeTextColor:"#FFF",timeScaleColor:"#FFF",timeSectionColor:"rgba(24, 144, 255, 0.5)",timeAxisBgColor:"#000",onChange:function(){},onDragStart:function(){},onDragging:function(){},onDragEnd:function(){},onDestroy:function(){}},BaseTimeLine=function(){function BaseTimeLine(container,options){if(this._current=new Date,this._readOnly=false,this._width=0,this._height=0,this._destroyed=false,this._timeWidth=0,this._timeSections=[],this.$container=container,!container)throw new Error("container is required");var left,right;this.options=deepmerge(_$BASE_TIME_LINE_DEFAULT_OPTIONS$_,options,{clone:false}),this.options.timeSections&&Array.isArray(this.options.timeSections)&&(this._timeSections=this.options.timeSections),this.options.readOnly&&(this.readOnly=this.options.readOnly),this.options.className&&this.$container.classList.add(this.options.className),this.$container.style.position="relative",this.options.current&&(left=this.options.current,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)?this._current=this.options.current||new Date:this._current=new Date,this.i18n=new I18n(deepmerge(_$TIMELINE_LOCALES$_,this.options.locales||{},{clone:false}),{defaultLocale:this.options.language||"zh"}),this._timeWidth=this.options.timeWidth||0,this._resize(this.options.width||"100%",this.options.height);}var _proto=BaseTimeLine.prototype;return _proto.setReadOnly=function(readOnly){this.readOnly=readOnly;},_proto.update=function(current){this._current=current;},_proto.updateTimeSections=function(timeSections){timeSections&&Array.isArray(timeSections)&&(this._timeSections=timeSections);},_proto.resize=function(width,height){this._resize(width,height);},_proto._resize=function(width,height){var cssText="";/^\d+(\.\d+)?$/.test(width+"")?cssText+="width: "+width+"px;":width&&(cssText+="width: "+width+";"),/^\d+(\.\d+)?$/.test(height+"")?cssText+="height: "+height+"px;":height&&(cssText+="height: "+height+";"),this.$container&&(this.$container.style.cssText+=cssText),this._width=Math.floor(this.$container.clientWidth),this._height=Math.floor(this.$container.clientHeight);},_proto.setTimeWidth=function(timeWidth){[0,1,2,3,4,5].includes(timeWidth)&&(this._timeWidth=timeWidth);},_proto.destroy=function(){this._current=null,null==this.options.onDestroy||this.options.onDestroy.call(this.options),this._timeSections=[],this._readOnly=false,this._destroyed=true;},_create_class$2(BaseTimeLine,[{key:"current",get:function(){return this._current},set:function(current){this._current=current;}},{key:"readOnly",get:function(){return this._readOnly},set:function(readOnly){this._readOnly!==readOnly&&(this._readOnly=readOnly,this.$container.style.cursor=readOnly?"not-allowed":"pointer");}},{key:"timeSections",get:function(){return this._timeSections}},{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}},{key:"timeWidth",get:function(){return this._timeWidth}}]),BaseTimeLine}();BaseTimeLine.LOCALES=_$TIMELINE_LOCALES$_;var TimeLineUtil=function(){function TimeLineUtil(){}return TimeLineUtil.timeToSecond=function(time){var e=time.split(":");return 60*Number(e[0])*60+60*Number(e[1])+(Number(e[2])||0)},TimeLineUtil.minuteToTime=function(minute){var hour=Math.floor(minute/60),m=minute%60;return (hour>9?hour:"0"+hour)+":"+(m>9?m:"0"+m)},TimeLineUtil.timeToMinute=function(time){var e=time.split(":");return 60*Number(e[0])+Number(e[1])},TimeLineUtil.tranTimeToString=function(start,end){var _DateTime_toDate,_DateTime_toDate1,secondNum=Math.floor((null==(_DateTime_toDate=utilsTools.DateTime.toDate(end))?void 0:_DateTime_toDate.getTime())-(null==(_DateTime_toDate1=utilsTools.DateTime.toDate(start))?void 0:_DateTime_toDate1.getTime()))/1e3,second=secondNum%60,minute=Math.floor(secondNum/60);return (minute>0?utilsTools.DateTime.fillZero(minute)+"'":"0'")+utilsTools.DateTime.fillZero(second)+"''"},TimeLineUtil}(),_$TIMELINE_ICONS$__tip='<svg viewBox="0 0 57 24" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="tip">\n <path class="ez-time-line-icon-tip" fill-rule="evenodd" d="m4,0l44,0c2.2091,0 4,1.7909 4,4l0,3.8218l4.9399,3.3572c0.5839,0.3968 0.5839,1.2574 0,1.6542l-4.9399,3.3572l0,3.8096c0,2.2091 -1.7909,4 -4,4l-44,0c-2.2091,0 -4,-1.7909 -4,-4l0,-16c0,-2.2091 1.7909,-4 4,-4z"/>\n </svg>',_$TIMELINE_ICONS$__plus='\n <svg viewBox="0 0 16 16" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="plus">\n <path d="M0 0L10.6667 0" stroke="rgb(44,44,44)" stroke-linecap="round" stroke-width="1.5" transform="matrix(0,1,-1,0,8,2.66663)"/>\n <path d="M2.66669 8L13.3334 8" stroke="rgb(44,44,44)" stroke-linecap="round" stroke-width="1.5"/>\n </svg>\n ',_$TIMELINE_ICONS$__minus='\n <svg viewBox="0 0 16 16" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="minus">\n <path d="M2.66669 8L13.3334 8" stroke="rgb(44,44,44)" stroke-linecap="round" stroke-width="1.5"/>\n </svg>\n ',_$TIMELINE_ICONS$__close='\n <svg viewBox="0 0 24 24" fill="none" width="1em" height="1em" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="close">\n\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,0.707114,-0.707114,0.707099,6.34277,6.34326)" />\n\t\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,-0.707114,0.707114,0.707099,6.34277,17.6567)" />\n </svg>\n ',_$TIMELINE_ICONS$__pause='<svg viewBox="0 0 20 20" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="pause">\n\t\t <path d="M9.43914 2.47881L13.4688 8.4912C14.3594 9.81998 13.4071 11.6047 11.8074 11.6047L3.74811 11.6047C2.14849 11.6047 1.19616 9.81998 2.08675 8.4912L6.11641 2.47881C6.90863 1.2968 8.64693 1.2968 9.43914 2.47881Z" fill-rule="evenodd" transform="matrix(0,1,-1,0,16.5781,2.22229)" />\n </svg>\n ',_$TIMELINE_ICONS$__picture='\n <svg viewBox="0 0 19.1613 19.4583" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="picture">\n <path xmlns="http://www.w3.org/2000/svg" id="形状结合" d="M15.3276 2.63477L3.83173 2.63477C2.70848 2.63477 1.79541 3.55027 1.79541 4.68419L1.79541 14.7737C1.79541 15.9076 2.70848 16.8231 3.83173 16.8231L15.3276 16.8231C16.4504 16.8231 17.364 15.9074 17.364 14.7737L17.364 4.68419C17.364 3.55027 16.4509 2.63477 15.3276 2.63477ZM3.83247 3.851L15.3284 3.851C15.7936 3.851 16.1671 4.22551 16.1671 4.68429L16.1671 14.7738C16.1671 15.2323 15.7932 15.6071 15.3284 15.6071L3.83247 15.6071C3.36725 15.6071 2.99373 15.2326 2.99373 14.7738L2.99373 12.2622L6.7356 9.56381L6.78139 9.53916C6.84532 9.51493 6.91856 9.52524 6.9742 9.56947L13.2644 14.5698L13.3381 14.62C13.5918 14.7666 13.9197 14.7063 14.105 14.4658C14.3089 14.2014 14.263 13.8192 14.0026 13.6122L7.71239 8.61184L7.60526 8.5346C7.12945 8.22451 6.51026 8.23473 6.04222 8.57224L2.99373 10.7706L2.99373 4.68429C2.99373 4.22551 3.36725 3.851 3.83247 3.851ZM10.5794 7.29679C10.5794 6.06542 11.5624 5.0672 12.7749 5.0672C13.9875 5.0672 14.9705 6.06542 14.9705 7.29679C14.9705 8.52817 13.9875 9.52639 12.7749 9.52639C11.5624 9.52639 10.5794 8.52817 10.5794 7.29679ZM13.7722 7.2967C13.7722 6.73699 13.3254 6.28325 12.7742 6.28325C12.223 6.28325 11.7762 6.73699 11.7762 7.2967C11.7762 7.85642 12.223 8.31015 12.7742 8.31015C13.3254 8.31015 13.7722 7.85642 13.7722 7.2967Z" fill-rule="evenodd"/>\n </svg>\n ',TIME_WIDTH=[[1,10,10,"单位 1秒"],[60,20,5,"单位 1分钟"],[600,20,6,"单位 10分钟"],[3600,30,6,"单位 1小时"],[14400,40,2,"单位 4小时"],[43200,80,2,"单位 12小时"]],MOBILE_TIME_WIDTH=[[1,10,10,"单位 1分钟"],[10,20,5,"单位 10分钟"],[30,20,6,"单位 30分钟"],[60,30,6,"单位 1小时"],[120,40,2,"单位 2小时"],[240,80,2,"单位 4小时"]],__$IMAGE_LAZY_LOADER_DEFAULT_OPTIONS$__={targets:[],root:null,rootMargin:"0px",threshold:.1,loadingClass:"ez-lazy-image-loading",loadedClass:"ez-lazy-image-loaded",loadedErrorClass:"ez-lazy-image-error",onLoadError:function(){}},ImageLazyLoader=function(){function ImageLazyLoader(options){ void 0===options&&(options={}),this.options=Object.assign({},__$IMAGE_LAZY_LOADER_DEFAULT_OPTIONS$__,options),this._observer=null,this._init();}var _proto=ImageLazyLoader.prototype;return _proto._init=function(){var _this=this;ImageLazyLoader.isSupported&&(this._observer=new IntersectionObserver(function(entries){entries.forEach(function(entry){var _this__observer;entry.isIntersecting&&(_this._loadImage(entry.target),null==(_this__observer=_this._observer)||_this__observer.unobserve(entry.target));});},this.options)),this.addImages(this.options.targets);},_proto._loadImage=function(img){var _img_classList,_img_classList1,_img_classList2,_this=this;if(img&&!(null==(_img_classList=img.classList)?void 0:_img_classList.contains(this.options.loadingClass))&&!(null==(_img_classList1=img.classList)?void 0:_img_classList1.contains(this.options.loadedClass))&&!(null==(_img_classList2=img.classList)?void 0:_img_classList2.contains(this.options.loadedErrorClass))&&img.hasAttribute("data-src")){var _this1=this;img.classList.add(this.options.loadingClass);var tempImg=new Image;tempImg.onload=function(){img.src=img.dataset.src,img.classList.remove(_this.options.loadingClass),img.classList.add(_this.options.loadedClass),img.dispatchEvent(new Event("lazyloaded"));},tempImg.onerror=function(e){img.classList.remove(_this.options.loadingClass),img.classList.add(_this.options.loadedErrorClass),null==_this1.options.onLoadError||_this1.options.onLoadError.call(_this1.options,img);},tempImg.src=img.dataset.src;}},_proto.addImages=function(targets){var _this=this;(null==targets?void 0:targets.length)&&targets.forEach(function(target){var _this__observer;(null==target?void 0:target.hasAttribute("data-src"))&&(ImageLazyLoader.isSupported&&_this._observer?null==(_this__observer=_this._observer)||_this__observer.observe(target):_this._loadImage(target));});},_proto.destroy=function(){this._observer&&(this._observer.disconnect(),this._observer=null);},ImageLazyLoader}();function _create_class$1(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _extends$1(){return _extends$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends$1.apply(this,arguments)}function _set_prototype_of$1(o,p){return _set_prototype_of$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1(o,p)}ImageLazyLoader.isSupported="IntersectionObserver"in window;var _$MOBILE_TIME_LINE_DEFAULT_OPTIONS$_=Object.assign({},_$BASE_TIME_LINE_DEFAULT_OPTIONS$_,{height:400,width:"100%",timeWidth:0,readOnly:false,timePointColor:"#648FFC",timeTextColor:"#666666",timeScaleColor:"transparent",timeSectionColor:"#369FFF",timeAxisBgColor:"#BDCDFF",currentTimeBgColor:"#648FFC",currentTimeColor:"#FFFFFF",showTimeWidthBtn:true,showCoverFold:true}),MobileTimeLine=function(BaseTimeLine){function MobileTimeLine(container,options){var _this;return (_this=BaseTimeLine.call(this,container,deepmerge(_$MOBILE_TIME_LINE_DEFAULT_OPTIONS$_,options,{clone:false}))||this)._isTouchStart=false,_this._dragScroll=null,_this._moveStartX=0,_this._moveStartY=0,_this._imageLazyLoader=null,_this._imageLazyLoaderPicker=null,_this.state={start:"00:00:00",end:"24:00:00",current:null,timeArr:[],availTimeLine:[],index:0},_this._onImageError=_this._onImageError.bind(_this),_this._plusClick=_this._plusClick.bind(_this),_this._minusClick=_this._minusClick.bind(_this),_this._onPickerClose=_this._onPickerClose.bind(_this),_this._onClickItem=_this._onClickItem.bind(_this),_this._onClickCoverFold=_this._onClickCoverFold.bind(_this),_this._imageLazyLoader=new ImageLazyLoader({root:_this.$container,onLoadError:function(img){null==_this._onImageError||_this._onImageError.call(_this,img);}}),_this._render(),_this.options.timeSections&&Array.isArray(_this.options.timeSections)&&_this.updateTimeSections(_this.options.timeSections),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of$1(subClass,superClass);}(MobileTimeLine,BaseTimeLine);var _proto=MobileTimeLine.prototype;return _proto.setReadOnly=function(readOnly){BaseTimeLine.prototype.setReadOnly.call(this,readOnly),this._dragScroll&&(this._dragScroll.readonly=readOnly);},_proto.setTimeWidth=function(timeWidth){MOBILE_TIME_WIDTH[timeWidth]&&(BaseTimeLine.prototype.setTimeWidth.call(this,timeWidth),this._matchTimeDot());},_proto.updateTimeSections=function(timeSections,defaultIndex){BaseTimeLine.prototype.updateTimeSections.call(this,timeSections);var list=timeSections.map(function(record){return _extends$1({},record,{startTime:utilsTools.DateTime.format(record.startTime,"HH:mm:ss"),endTime:utilsTools.DateTime.format(record.endTime,"HH:mm:ss")})});if(list.length>0){ void 0===defaultIndex&&(defaultIndex=list.length-1);var current=this.state.current;this._setState({availTimeLine:list,start:list[defaultIndex].startTime,end:list[defaultIndex].endTime,current:null===current?list[defaultIndex].startTime:current}),this._matchTimeDot();}else this._setState({availTimeLine:[],current:utilsTools.DateTime.format(this.current||(new Date).getTime(),"HH:mm:ss")}),this._matchTimeDot();},_proto.update=function(time){var _this__dragScroll;time&&!(null==(_this__dragScroll=this._dragScroll)?void 0:_this__dragScroll.isDragging)&&(this._setState({current:utilsTools.DateTime.format(time,"HH:mm:ss")}),this._currentOffsetH());},_proto.destroy=function(){var _this__dragScroll;if(this._scrollTimer&&(clearInterval(this._scrollTimer),this._scrollTimer=null),this._$currentTime)try{this.$container.removeChild(this._$currentTime),this._$currentTime=null;}catch(error){}if(this._$itemContainer&&this._$itemList)try{this._$itemContainer.removeChild(this._$itemList),this._$itemList=null;}catch(error){}if(this._$itemContainer)try{this.$container.removeChild(this._$itemContainer),this._$itemContainer=null;}catch(error){}if(this._$op)try{this.$container.removeChild(this._$op),this._$op=null;}catch(error){}this._picker&&(this._picker.destroy(),this._picker=null),this._imageLazyLoader&&(this._imageLazyLoader.destroy(),this._imageLazyLoader=null),this._imageLazyLoaderPicker&&(this._imageLazyLoaderPicker.destroy(),this._imageLazyLoaderPicker=null),this._removeEventListener(),null==(_this__dragScroll=this._dragScroll)||_this__dragScroll.destroy(),this._dragScroll=null,BaseTimeLine.prototype.destroy.call(this);},_proto._setState=function(obj){var _this=this;Object.keys(obj).forEach(function(key){var _this__dragScroll,_this_timeSections_;"current"===key&&obj[key]?(_this._setCurrentDOM(obj[key]),_this.state.current===obj[key]||(null==(_this__dragScroll=_this._dragScroll)?void 0:_this__dragScroll.isDragging)||(_this.state[key]=obj[key],_this.current=new Date(utilsTools.DateTime.format((null==(_this_timeSections_=_this.timeSections[0])?void 0:_this_timeSections_.endTime)||(new Date).getTime(),"YYYY-MM-DD")+"T"+obj[key]),null==_this.options.onChange||_this.options.onChange.call(_this.options,_this.current))):_this.state[key]=obj[key];});},_proto._setCurrentDOM=function(time){this._$currentTime&&(this._$currentTime.querySelector(".ez-time-line-current-value").innerHTML=time);},_proto._matchTimeDot=function(){for(var scaleWidth=this._scaleWidth,timeArr=[],minute=TimeLineUtil.timeToMinute("24:00:00"),i=minute=Math.floor(minute/scaleWidth)*scaleWidth;i>=0;){var marginTop=0,marginBottom=0;i==minute&&(marginTop=70),0==i&&(marginBottom=this.$container.clientHeight-70);var time=TimeLineUtil.minuteToTime(i);timeArr.push({id:i,current:time,label:"a"+i,marginTop:marginTop,marginBottom:marginBottom,recArr:[],coverArr:this._filterTimeSectionsByTime(time)}),i-=scaleWidth;}this._setState({timeArr:timeArr}),this._matchRecTimeDot();},_proto._matchRecTimeDot=function(){var _this_state=this.state,availTimeLine=_this_state.availTimeLine,timeArr=_this_state.timeArr,scaleWidth=this._scaleWidth,len=availTimeLine.length;if(0===len)for(var j=0;j<timeArr.length;j++)timeArr[j].recArr=[];else {for(var k=0;k<timeArr.length;k++)timeArr[k].recArr=[];for(var i=0;i<len;i++){var stAvailPercent,etAvailPercent,temp=availTimeLine[i],st=TimeLineUtil.timeToSecond(temp.startTime),et=TimeLineUtil.timeToSecond(temp.endTime),stMinute=Math.floor(st/(60*scaleWidth))*scaleWidth;stAvailPercent=(st-60*stMinute)/scaleWidth;var etMinute=Math.floor(et/(60*scaleWidth))*scaleWidth;etAvailPercent=(et-60*etMinute)/scaleWidth;for(var j1=0;j1<timeArr.length;j1++)if(timeArr[j1].id==stMinute&&timeArr[j1].id==etMinute){var height=etAvailPercent-stAvailPercent,top=60-etAvailPercent;timeArr[j1].recArr.push({height:height,top:top});}else timeArr[j1].id==stMinute?timeArr[j1].recArr.push({height:60-stAvailPercent,top:0}):timeArr[j1].id==etMinute?timeArr[j1].recArr.push({height:etAvailPercent,top:60-etAvailPercent}):timeArr[j1].id>stMinute&&timeArr[j1].id<etMinute&&timeArr[j1].recArr.push({height:60,top:0});}}this._setState({timeArr:timeArr}),this._renderDateLine();},_proto._renderDateLine=function(){var _this=this,timeArr=this.state.timeArr,container=this._$itemList;container.innerHTML="",timeArr.forEach(function(item,index){var _this__imageLazyLoader,timeItemDOM=document.createElement("div");timeItemDOM.setAttribute("class","ez-time-line-time-scale-area"),item.marginTop&&(timeItemDOM.style.cssText+="margin-top: "+item.marginTop+"px;"),item.marginBottom&&(timeItemDOM.style.cssText+="margin-bottom: "+item.marginBottom+"px;"),timeItemDOM.style.cssText+="border-right-color: "+(_this.options.timeAxisBgColor||"rgba(189, 205, 255, 1)")+";",timeItemDOM.setAttribute("data-time",item.current),timeItemDOM.setAttribute("data-index",index+""),document.createElement("div").setAttribute("class","ez-time-line-scale");var timeItemHtml="";item.coverArr.length&&_this.options.showCoverFold&&(timeItemHtml+='\n <div class="ez-time-line-time-cover-fold '+(item.coverArr.length>1?"ez-time-line-time-cover-fold-multiple":"")+'"\n data-start="'+item.current+'">\n '+(item.coverArr.length>1?'<div class="ez-time-line-cover-fold-placeholder" style="color: #FFF"></div>':"")+'\n <div class="ez-time-line-time-cover-fold-img">\n <img data-src="'+_this._setImageScr(item.coverArr[0].coverPic)+'" class="ez-time-line-img"/>\n <span class="ez-time-line-time-cover-fold-len">\n '+(item.coverArr.length>1?_this.i18n.t("foldTitle",{len:item.coverArr.length,unit:"videos"}):""+utilsTools.DateTime.format(item.coverArr[0].startTime,"HH:mm"))+"\n </span>\n "+(1===item.coverArr.length?'<span class="ez-time-line-time-cover-fold-time">'+TimeLineUtil.tranTimeToString(item.coverArr[0].startTime,item.coverArr[0].endTime)+"</span>":"")+'\n <span class="ez-time-line-time-cover-fold-pause">'+_$TIMELINE_ICONS$__pause+"</span>\n </div>\n </div>"),item.recArr.forEach(function(i){timeItemHtml+='<div class="ez-time-line-time-unavail"\n style="height: '+i.height+"px;background-color:"+(_this.options.timeSectionColor||"#369FFF")+"; top: "+i.top+'px">\n </div>';}),timeItemHtml+="<div id="+item.label+' class="ez-time-line-time-label" style="color: '+(_this.options.timeTextColor||"#666")+'">'+item.current+"</div>",timeItemDOM.innerHTML=timeItemHtml,container.appendChild(timeItemDOM),item.coverArr.length&&_this.options.showCoverFold&&(null==(_this__imageLazyLoader=_this._imageLazyLoader)||_this__imageLazyLoader.addImages(container.querySelectorAll("img.ez-time-line-img")||[]));}),this._currentOffsetH();},_proto._currentOffsetH=function(){var current=this.state.current;if(current){var _this__dragScroll,y=(86400-TimeLineUtil.timeToSecond(current)||0)/this._scaleWidth;null==(_this__dragScroll=this._dragScroll)||_this__dragScroll.scrollToY(y+60,false);}},_proto._render=function(){var _this=this;if(this._$currentTime=document.createElement("div"),this._$currentTime.classList.add("ez-time-line-current"),this._$currentTime.innerHTML='<div class="ez-time-line-current-content" style="color: '+(this.options.currentTimeBgColor||"#648FFC")+'">\n <span class="ez-time-line-current-tip">'+_$TIMELINE_ICONS$__tip+'</span>\n <span class="ez-time-line-current-tip-line" style="background-color: '+(this.options.timePointColor||"#648FFC")+';"></span>\n <div class="ez-time-line-current-value" style="color: '+(this.options.currentTimeColor||"#FFFFFF")+'">00:00:00</div>\n </div>',this.$container.appendChild(this._$currentTime),this._$itemContainer=document.createElement("div"),this._$itemContainer.classList.add("ez-time-line-container"),this.$container.appendChild(this._$itemContainer),this._dragScroll=new DragScroll(this._$itemContainer,{hideScrollbar:true,onChange:function(state){var result=_this._offsetYToTime(state.y);result[1]!==_this.state.current&&_this._setCurrentDOM(result[0]>=86400?"23:59:59":result[1]);},onDragStart:function(e){_this._moveStartX=e.clientX,_this._moveStartY=e.clientY,null==_this.options.onDragStart||_this.options.onDragStart.call(_this.options,_this.state.current);},onDragging:function(){null==_this.options.onDragging||_this.options.onDragging.call(_this.options,_this.state.current);},onDragEnd:function(){var _this__dragScroll,result=_this._offsetYToTime(null==(_this__dragScroll=_this._dragScroll)?void 0:_this__dragScroll.currentY);result[1]!==_this.state.current&&_this._setState({current:result[0]>=86400?"23:59:59":result[1]}),null==_this.options.onDragEnd||_this.options.onDragEnd.call(_this.options,_this.state.current);}}),/\d/.test(this.options.height))this._$itemContainer.style.cssText+="height: "+this.options.height+"px";else if("string"==typeof this.options.height)this._$itemContainer.style.cssText+="height: "+this.options.height;else {var height=this.$container.clientHeight;this._$itemContainer.style.cssText+="height: "+height+"px";}this._$itemList=document.createElement("div"),this._$itemList.classList.add("ez-time-line-item"),this._dragScroll.$content.appendChild(this._$itemList),this.options.showTimeWidthBtn&&(this._$op=document.createElement("div"),this._$op.classList.add("ez-time-line-op"),this._$op.innerHTML='<span class="ez-time-line-op-wrapper"><span class="ez-time-line-icon-plus">'+_$TIMELINE_ICONS$__plus+'</span> <span class="ez-time-line-icon-minus">'+_$TIMELINE_ICONS$__minus+"</span></span>",this.$container.appendChild(this._$op)),this.options.showCoverFold&&(this._picker=new Picker(null,{isMobile:true,wrapClassName:"ez-time-line-picker",onOpenChange:function(isOpen){var _this_options_onPickerOpenChange,_this_options;null==(_this_options=_this.options)||null==(_this_options_onPickerOpenChange=_this_options.onPickerOpenChange)||_this_options_onPickerOpenChange.call(_this_options,isOpen);}}),this._imageLazyLoaderPicker=new ImageLazyLoader({root:this._picker.$body,onLoadError:function(img){null==_this._onImageError||_this._onImageError.call(_this,img);}})),this._addEventListener();},_proto._addEventListener=function(){var _this__$op_querySelector,_this__$op_querySelector1;this.options.showTimeWidthBtn&&this._$op&&(null==(_this__$op_querySelector=this._$op.querySelector(".ez-time-line-icon-plus"))||_this__$op_querySelector.addEventListener("click",this._plusClick,false),null==(_this__$op_querySelector1=this._$op.querySelector(".ez-time-line-icon-minus"))||_this__$op_querySelector1.addEventListener("click",this._minusClick,false));this._matchTimeDot(),this._picker&&(this._delegatePickerClose=delegate(this._picker.$body,".ez-time-line-picker-close","click",this._onPickerClose,false),this._delegateItemContent=delegate(this._picker.$body,".ez-time-line-picker-item-content","click",this._onClickItem,false),this._delegateCoverFold=delegate(this._$itemList,".ez-time-line-time-cover-fold","click",this._onClickCoverFold,false));},_proto._removeEventListener=function(){var _this__$op_querySelector,_this__$op_querySelector1,_this__picker_$body_querySelector,_this__picker_$body;this.options.showTimeWidthBtn&&this._$op&&(null==(_this__$op_querySelector=this._$op.querySelector(".ez-time-line-icon-plus"))||_this__$op_querySelector.removeEventListener("click",this._plusClick),null==(_this__$op_querySelector1=this._$op.querySelector(".ez-time-line-icon-minus"))||_this__$op_querySelector1.removeEventListener("click",this._minusClick));this._picker&&(null==(_this__picker_$body=this._picker.$body)||null==(_this__picker_$body_querySelector=_this__picker_$body.querySelector(".ez-time-line-picker-close"))||_this__picker_$body_querySelector.removeEventListener("click",this._onPickerClose),this._delegateItemContent&&(this._delegateItemContent.forEach(function(delegation){delegation.destroy();}),this._delegateItemContent=null),this._delegatePickerClose&&(this._delegatePickerClose.forEach(function(delegation){delegation.destroy();}),this._delegatePickerClose=null),this._delegateCoverFold&&(this._delegateCoverFold.forEach(function(delegation){delegation.destroy();}),this._delegateCoverFold=null));},_proto._plusClick=function(){var timeWidth=this.timeWidth+1;timeWidth>0&&timeWidth<MOBILE_TIME_WIDTH.length&&this.setTimeWidth(timeWidth);},_proto._minusClick=function(){var timeWidth=this.timeWidth-1;timeWidth>=0&&timeWidth<MOBILE_TIME_WIDTH.length&&this.setTimeWidth(Math.floor(timeWidth));},_proto._timeSectionsToGroupsByHour=function(list){var obj={};return list.forEach(function(item,index){var hour=utilsTools.DateTime.format(item.startTime,"HH");obj[+hour]?obj[+hour].push(_extends$1({},item,{_index:index})):obj[+hour]=[_extends$1({},item,{_index:index})];}),obj},_proto._filterTimeSectionsByTime=function(start){if(!start)return [];var startSecond=TimeLineUtil.timeToSecond(start+":00"),endSecond=TimeLineUtil.timeToSecond(start+":00")+60*this._scaleWidth;return this.timeSections.filter(function(item){var _$start=TimeLineUtil.timeToSecond(utilsTools.DateTime.format(item.startTime,"HH:mm:ss"));return _$start>=startSecond&&_$start<endSecond})},_proto._renderPickerContent=function(start){var _this__picker_innerHTML,_this__picker,_this__picker1,_this__picker2,_this__imageLazyLoaderPicker,_this=this,list=this._filterTimeSectionsByTime(start),hourGroups=this._timeSectionsToGroupsByHour(list);(null==(_this__picker=this._picker)||null==(_this__picker_innerHTML=_this__picker.innerHTML)||_this__picker_innerHTML.call(_this__picker,'<div class="ez-time-line-picker-container">\n <div class="ez-time-line-picker-header">\n <span class="ez-time-line-picker-close">'+_$TIMELINE_ICONS$__close+"</span>\n "+this.i18n.t("title",{len:list.length,unit:list.length>1?"videos":"video"})+'\n </div>\n <div class="ez-time-line-picker-content">\n <div class="ez-time-line-picker-list">\n '+Object.keys(hourGroups).reverse().map(function(key){return '<div class="ez-time-line-picker-item">\n <div class="ez-time-line-picker-item-title">'+key+':00</div>\n <div class="ez-time-line-picker-item-list">\n '+hourGroups[key].reverse().map(function(item){return '<div class="ez-time-line-picker-item-content"\n data-start="'+utilsTools.DateTime.format(item.startTime,"YYYYMMDDTHHmmssZ")+'"\n data-end="'+utilsTools.DateTime.format(item.endTime,"YYYYMMDDTHHmmssZ")+'"\n data-index="'+item._index+'">\n <span class="ez-time-line-picker-item-time">'+utilsTools.DateTime.format(item.startTime,"HH:mm")+'</span>\n <span class="ez-time-line-picker-item-duration">\n '+TimeLineUtil.tranTimeToString(item.startTime,item.endTime)+'\n </span>\n <img class="ez-time-line-picker-item-cover" data-src="'+_this._setImageScr(item.coverPic)+'"/>\n </div>'}).join("")+"\n </div>\n </div>"}).join("")+"\n </div>\n </div>\n </div>\n </div>"),null==(_this__picker1=this._picker)?void 0:_this__picker1.$body)&&(null==(_this__imageLazyLoaderPicker=this._imageLazyLoaderPicker)||_this__imageLazyLoaderPicker.addImages((null==(_this__picker2=this._picker)?void 0:_this__picker2.$body.querySelectorAll("img"))||[]));},_proto._onImageError=function(img){if(!img.hasAttribute("data-error")){var _img_parentNode,placeholder=document.createElement("div");placeholder.classList.add("ez-time-line-item-cover-placeholder"),placeholder.innerHTML=""+_$TIMELINE_ICONS$__picture,null==(_img_parentNode=img.parentNode)||_img_parentNode.appendChild(placeholder),img.setAttribute("data-error","true"),img.remove();}},_proto._onPickerClose=function(){this._picker&&(this._picker.open=false);},_proto._onClickItem=function(e){var _e_delegateTarget_getAttribute,_e_delegateTarget,index=null==(_e_delegateTarget=e.delegateTarget)||null==(_e_delegateTarget_getAttribute=_e_delegateTarget.getAttribute)?void 0:_e_delegateTarget_getAttribute.call(_e_delegateTarget,"data-index");this._picker&&(this._picker.open=false),null==this.options.onPickerSelect||this.options.onPickerSelect.call(this.options,this.timeSections[+index]);},_proto._onClickCoverFold=function(e){var _e_delegateTarget_parentElement_getAttribute,_e_delegateTarget_parentElement,_e_delegateTarget;e.preventDefault();var time=null==(_e_delegateTarget=e.delegateTarget)||null==(_e_delegateTarget_parentElement=_e_delegateTarget.parentElement)||null==(_e_delegateTarget_parentElement_getAttribute=_e_delegateTarget_parentElement.getAttribute)?void 0:_e_delegateTarget_parentElement_getAttribute.call(_e_delegateTarget_parentElement,"data-time"),moveX=Math.abs(this._moveStartX-e.clientX),moveY=Math.abs(this._moveStartY-e.clientY);this._picker&&time&&!(moveX>=1||moveY>=1)&&(this._renderPickerContent(time),this._picker.open=true);},_proto._setImageScr=function(src){if(src){var query="x=200&"+(this.options.coverQuery||"");return src+(src.includes("?")?"&":"?")+query}return ""},_proto._offsetYToTime=function(offsetY){var _this__dragScroll,y=offsetY;offsetY<60&&(y=60,null==(_this__dragScroll=this._dragScroll)||_this__dragScroll.scrollToY(y));var second=86400-Math.floor((y-60)*this._scaleWidth);return [second,utilsTools.DateTime.fillZero(Math.floor(second/3600))+":"+utilsTools.DateTime.fillZero(Math.floor(second%3600/60))+":"+utilsTools.DateTime.fillZero(second%60)]},_create_class$1(MobileTimeLine,[{key:"_scaleWidth",get:function(){return (MOBILE_TIME_WIDTH[this.timeWidth]||MOBILE_TIME_WIDTH[0])[0]}}]),MobileTimeLine}(BaseTimeLine);function isOverlap(a_start,a_end,b_start,b_end){return Math.max(a_start,b_start)<=Math.min(a_end,b_end)}function _create_class(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _extends(){return _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends.apply(this,arguments)}function _set_prototype_of(o,p){return _set_prototype_of=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of(o,p)}var _$TIMELINE_DEFAULT_OPTIONS$_={height:36,dpr:window.devicePixelRatio||2,scaleOffsetTop:4,showYearMonthDay:true},TimeLine=function(BaseTimeLine){function TimeLine(container,options){var _this;return (_this=BaseTimeLine.call(this,container,deepmerge(_$TIMELINE_DEFAULT_OPTIONS$_,options,{clone:true}))||this)._$canvas=null,_this._ctx=null,_this._timeWidthArray=TIME_WIDTH[0],_this._centerPositionX=0,_this._isMouseDown=false,_this._mousePosition=0,_this._oldTime=null,_this._isOver=false,_this._moved=false,_this._isCtrlKeyDown=false,_this._lastTouchDist=0,_this.$container=container,_this._mousemoveFun=_this._mousemoveFun.bind(_this),_this._mouseoverFun=_this._mouseoverFun.bind(_this),_this._mouseleaveFun=_this._mouseleaveFun.bind(_this),_this._mousedownFun=_this._mousedownFun.bind(_this),_this._mouseUpFun=_this._mouseUpFun.bind(_this),_this._mousewheelFun=_this._mousewheelFun.bind(_this),_this._touchstartFun=_this._touchstartFun.bind(_this),_this._touchmoveFun=_this._touchmoveFun.bind(_this),_this._touchendFun=_this._touchendFun.bind(_this),_this._ctrlKeyDownFun=_this._ctrlKeyDownFun.bind(_this),_this._ctrlKeyUpFun=_this._ctrlKeyUpFun.bind(_this),_this._init(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of(subClass,superClass);}(TimeLine,BaseTimeLine);var _proto=TimeLine.prototype;return _proto._init=function(){this._$canvas=document.createElement("canvas"),this._ctx=this._$canvas.getContext("2d"),this.readOnly||(this._$canvas.style.cssText+="cursor: pointer;"),this.$container.appendChild(this._$canvas),this.resize(this.width,this.height),this._update({current:this.current,timeWidth:this.timeWidth,timeSections:this.timeSections}),this._addEventListener();},_proto.resize=function(width,height){BaseTimeLine.prototype.resize.call(this,width,height),this._$canvas&&width&&(this._$canvas.width=this.width*this.options.dpr,this._$canvas.style.cssText+="width: "+this.width+"px;"),this._$canvas&&height&&(this._$canvas.height=this.height*this.options.dpr,this._$canvas.style.cssText+="height: "+this.height+"px;"),this._draw();},_proto.setTimeWidth=function(timeWidth){this._update({timeWidth:timeWidth});},_proto.updateTimeSections=function(timeSections){this._update({timeSections:timeSections});},_proto.update=function(time){time&&!this._isMouseDown&&this._update({current:utilsTools.DateTime.toDate(time)});},_proto._update=function(options){var left,right,_this__$canvas;(void 0===options&&(options={}),(null==options?void 0:options.current)&&(left=options.current,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)&&(this.current=options.current),(null==options?void 0:options.timeSections)&&BaseTimeLine.prototype.updateTimeSections.call(this,this._mergeTimeSections(options.timeSections)),"number"==typeof(null==options?void 0:options.timeWidth)&&(null==options?void 0:options.timeWidth)<TIME_WIDTH.length&&(BaseTimeLine.prototype.setTimeWidth.call(this,options.timeWidth),this._timeWidthArray=TIME_WIDTH[Math.floor(this.timeWidth)]),"number"==typeof(null==options?void 0:options.timeWidth)&&this._timeWidthArray)&&(this._timeWidthArray[3]&&(null==(_this__$canvas=this._$canvas)||_this__$canvas.setAttribute("data-title",this._timeWidthArray[3])));this._draw();},_proto.setReadOnly=function(readOnly){BaseTimeLine.prototype.setReadOnly.call(this,readOnly),this._$canvas&&(this._$canvas.style.cssText+="cursor: "+(readOnly?"not-allowed":"pointer"));},_proto.destroy=function(){if(this._removeEventListener(),this._$canvas)try{this.$container.removeChild(this._$canvas),this._$canvas=null;}catch(e){}BaseTimeLine.prototype.destroy.call(this);},_proto._draw=function(){this._ctx&&(this._ctx.fillStyle=this.options.timeAxisBgColor,this._ctx.fillRect(0,0,this.width*this.options.dpr,this.height*this.options.dpr)),this._drawSections(),this._drawScale();},_proto._drawScale=function(){var lineWidth=1*this.options.dpr;this._centerPositionX=parseInt(this.width*this.options.dpr/2+"");for(var centerPosition={x:this.width*this.options.dpr/2,y:this.height*this.options.dpr},curScaleTime=Math.floor(this.current.getTime()/1e3),offsetSecond=(curScaleTime-Math.floor(utilsTools.DateTime.toDate(utilsTools.DateTime.format(new Date(1e3*curScaleTime),"YYYY-MM-DD")).getTime()/1e3))%this._timeWidthArray[0],padding=this.height*this.options.dpr/20,spacing=this._curScaleSpacing*this.options.dpr,rightLastScaleTimeX=Math.floor(this._centerPositionX+(this._timeWidthArray[0]-offsetSecond)/this._timeWidthArray[0]*spacing),leftLastScaleTime=curScaleTime-offsetSecond,rightLastScaleTime=leftLastScaleTime+this._timeWidthArray[0],x=rightLastScaleTimeX-spacing;x>0;x-=spacing){0===(leftLastScaleTime-Math.floor(utilsTools.DateTime.toDate(utilsTools.DateTime.format(new Date(1e3*leftLastScaleTime),"YYYY-MM-DD")).getTime()/1e3))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x,padding,x,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(utilsTools.DateTime.format(new Date(1e3*leftLastScaleTime),"YYYY-MM-DD HH:mm:ss"),x,padding+(this.options.scaleOffsetTop+4+4)*this.options.dpr,"center")):this._drawSolidLine(x,padding,x,padding+this.options.scaleOffsetTop*this.options.dpr,lineWidth),leftLastScaleTime-=this._timeWidthArray[0];}for(var x1=rightLastScaleTimeX;x1<=this.width*this.options.dpr;x1+=spacing){0===(rightLastScaleTime-Math.floor(utilsTools.DateTime.toDate(utilsTools.DateTime.format(new Date(1e3*rightLastScaleTime),"YYYY-MM-DD")).getTime()/1e3))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x1,padding,x1,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(utilsTools.DateTime.format(new Date(1e3*rightLastScaleTime),"YYYY-MM-DD HH:mm:ss"),x1,padding+(this.options.scaleOffsetTop+4+4)*this.options.dpr,"center")):this._drawSolidLine(x1,padding,x1,padding+this.options.scaleOffsetTop*this.options.dpr,lineWidth),rightLastScaleTime+=this._timeWidthArray[0];}this._drawSolidLine(centerPosition.x,0,centerPosition.x,centerPosition.y,lineWidth,this.options.timePointColor);},_proto._drawSolidLine=function(startX,startY,endX,endY,lineWidth,color){this._ctx&&(this._ctx.save(),this._ctx.strokeStyle=null!=color?color:this.options.timeScaleColor,this._ctx.lineWidth=lineWidth,this._ctx.beginPath(),this._ctx.moveTo(startX,startY),this._ctx.lineTo(endX,endY),this._ctx.stroke(),this._ctx.restore());},_proto._drawTextString=function(text,x,y,align){if(this._ctx){var timeTexts=text.split(" ");this._ctx.font=12*this.options.dpr*1+"px serif",this._ctx.fillStyle=this.options.timeTextColor,this._ctx.textAlign=align||"left",this._timeWidthArray[0]%60==0&&(timeTexts[1]=timeTexts[1].replace(/:00$/,"")),this._ctx.fillText(timeTexts[1],x,y+8*this.options.dpr),!this.options.showYearMonthDay||"00:00:00"!==timeTexts[1]&&"00:00"!==timeTexts[1]&&this._timeWidthArray[0]*this._timeWidthArray[2]!==86400||(this._ctx.textAlign=align||"left",this._ctx.fillText(timeTexts[0],x,y+18*this.options.dpr));}},_proto._drawSections=function(){for(var timeArr=this.timeSections||[],i=0;i<timeArr.length;i++){var position=this._findPosition(timeArr[i]);this._ctx&&isOverlap(0,this.width*this.options.dpr,position.x1,position.x2)&&(this._ctx.fillStyle=this.options.timeSectionColor,this._ctx.fillRect(position.x1,0,position.x2-position.x1,this.height*this.options.dpr));}},_proto._findPosition=function(item){var x1=(parseInt((item.startTime-this.current.getTime())/1e3+"",10)/this._timeWidthArray[0]*this._curScaleSpacing+this.width/2)*this.options.dpr;return {x1:x1,x2:x1+parseInt((item.endTime-item.startTime)/1e3+"",10)/this._timeWidthArray[0]*this._curScaleSpacing*this.options.dpr}},_proto._mergeTimeSections=function(timeSections){if(0===timeSections.length)return timeSections;for(var merged=[(timeSections=timeSections.map(function(item){return 10===(item.startTime+"").length&&(item.startTime=1e3*item.startTime),10===(item.endTime+"").length&&(item.endTime=1e3*item.endTime),_extends({},item,{startTime:item.startTime,endTime:item.endTime})}))[0]],i=1;i<timeSections.length;i++){var prev=merged[merged.length-1],curr=timeSections[i];prev.endTime>=curr.startTime?prev.endTime=Math.max(prev.endTime,curr.endTime):merged.push(curr);}return merged},_proto._addEventListener=function(){this._$canvas&&(this._$canvas.addEventListener("mousemove",this._mousemoveFun),this._$canvas.addEventListener("mouseover",this._mouseoverFun),this._$canvas.addEventListener("mouseleave",this._mouseleaveFun),this._$canvas.addEventListener("mousedown",this._mousedownFun),this._$canvas.addEventListener("mouseup",this._mouseUpFun),this._$canvas.addEventListener("wheel",this._mousewheelFun),this.$container.addEventListener("wheel",function(e){e.preventDefault();},{passive:false}),this._$canvas.addEventListener("keydown",this._ctrlKeyDownFun),this._$canvas.addEventListener("keyup",this._ctrlKeyUpFun),document.addEventListener("keydown",this._ctrlKeyDownFun,false),document.addEventListener("keyup",this._ctrlKeyUpFun,false),this._$canvas.addEventListener("touchstart",this._touchstartFun,{passive:false}),this._$canvas.addEventListener("touchmove",this._touchmoveFun,{passive:false}),this._$canvas.addEventListener("touchend",this._touchendFun,{passive:false}));},_proto._removeEventListener=function(){this._$canvas&&(this._$canvas.removeEventListener("mousemove",this._mousemoveFun),this._$canvas.removeEventListener("mouseover",this._mouseoverFun),this._$canvas.removeEventListener("mouseleave",this._mouseleaveFun),this._$canvas.removeEventListener("mousedown",this._mousedownFun),this._$canvas.removeEventListener("mouseup",this._mouseUpFun),this._$canvas.removeEventListener("wheel",this._mousewheelFun),this._$canvas.removeEventListener("keydown",this._ctrlKeyDownFun),this._$canvas.removeEventListener("keyup",this._ctrlKeyUpFun),document.removeEventListener("keydown",this._ctrlKeyDownFun),document.removeEventListener("keyup",this._ctrlKeyUpFun),this._$canvas.removeEventListener("touchstart",this._touchstartFun),this._$canvas.removeEventListener("touchmove",this._touchmoveFun),this._$canvas.removeEventListener("touchend",this._touchendFun));},_proto._mousedownFun=function(e){this.readOnly||(this._isMouseDown=true,this._mousePosition=e.pageX,this._oldTime=this.current,null==this.options.onDragStart||this.options.onDragStart.call(this.options,this.current));},_proto._mouseoverFun=function(){this.readOnly||(this._isOver=true);},_proto._mouseleaveFun=function(e){this.readOnly||(this._isOver=false,this._moveEndOrTouchEndFun(e));},_proto._mouseUpFun=function(e){this._moveEndOrTouchEndFun(e);},_proto._mousemoveFun=function(e){if(!this.readOnly)if(this._isMouseDown&&this._isOver)this._moveUpdateFun(e.pageX);else {var left=parseInt(this.$container.offsetLeft+"",10);this._mousePosition=e.pageX-left,this._update();}},_proto._mousewheelFun=function(e){e.preventDefault(),this.readOnly;},_proto._ctrlKeyDownFun=function(e){(e.ctrlKey||"Control"===e.key)&&(this._isCtrlKeyDown=true);},_proto._ctrlKeyUpFun=function(e){(e.ctrlKey||"Control"===e.key)&&(this._isCtrlKeyDown=false);},_proto._getTouchDistance=function(touches){var touch1=touches[0],touch2=touches[1],dx=touch2.clientX-touch1.clientX,dy=touch2.clientY-touch1.clientY;return Math.sqrt(dx*dx+dy*dy)},_proto._touchstartFun=function(e){if(!this.readOnly)if(this._oldTime=this.current,this._isOver=true,1===e.touches.length){var touch=e.touches[0];this._isMouseDown=true,this._mousePosition=touch.clientX;}else 2===e.touches.length&&(this._lastTouchDist=this._getTouchDistance(e.touches));},_proto._touchmoveFun=function(e){if(e.preventDefault(),e.stopPropagation(),!this.readOnly)if(1===e.touches.length){var touch=e.touches[0];this._moveUpdateFun(touch.clientX);}else if(2===e.touches.length){this._getTouchDistance(e.touches);this._lastTouchDist;}},_proto._touchendFun=function(e){this.readOnly||this._moveEndOrTouchEndFun(e);},_proto._moveEndOrTouchEndFun=function(e){e.preventDefault(),this.readOnly||this._isMouseDown&&(this._isMouseDown=false,this._moved&&(this._moved=false,this._update({current:this.current}),this._oldTime=this.current,null==this.options.onDragEnd||this.options.onDragEnd.call(this.options,this.current,this._isOver)),this._isOver&&Math.abs(this._mousePosition-(e.pageX||0))>5&&(null==this.options.onChange||this.options.onChange.call(this.options,this.current)),this._mousePosition=0,this._lastTouchDist=0);},_proto._moveUpdateFun=function(x){var mouseOffset=this._mousePosition-x;if(0!==mouseOffset){if(this._oldTime){var currentTime=this._oldTime.getTime()+1e3*parseInt(mouseOffset/this._curScaleSpacing*this._timeWidthArray[0]+"",10);this._update({current:new Date(currentTime)}),null==this.options.onDragging||this.options.onDragging.call(this.options,new Date(currentTime));}this._moved=true;}},_create_class(TimeLine,[{key:"_curScaleSpacing",get:function(){var _this__timeWidthArray,_this__timeWidthArray1;return Math.floor((null==(_this__timeWidthArray=this._timeWidthArray)?void 0:_this__timeWidthArray[1])-(null==(_this__timeWidthArray1=this._timeWidthArray)?void 0:_this__timeWidthArray1[1])*+(this.timeWidth%1/2).toFixed(2))}}]),TimeLine}(BaseTimeLine);TimeLine.TIME_WIDTH=TIME_WIDTH,dist$1.BaseTimeLine=BaseTimeLine,dist$1.MobileTimeLine=MobileTimeLine,dist$1.TimeLine=TimeLine;
|
|
11523
|
-
return dist$1;
|
|
11524
|
-
}
|
|
11525
|
-
|
|
11526
|
-
var distExports = requireDist();
|
|
9763
|
+
var _$TIMELINE_LOCALES$_={zh:{title:"包含{{len}}段录像",foldTitle:"{{len}}个录像"},en:{title:"Includes {{len}} {{unit}}",foldTitle:"{{len}} {{unit}}"}};function _create_class$2(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}var _$BASE_TIME_LINE_DEFAULT_OPTIONS$_={current:new Date,language:"zh",timeSections:[],readOnly:false,className:"",timeWidth:0,width:"100%",timePointColor:"#1890ff",timeTextColor:"#FFF",timeScaleColor:"#FFF",timeSectionColor:"rgba(24, 144, 255, 0.5)",timeAxisBgColor:"#000",onChange:function(){},onDragStart:function(){},onDragging:function(){},onDragEnd:function(){},onDestroy:function(){}},BaseTimeLine=function(){function BaseTimeLine(container,options){if(this._current=new Date,this._readOnly=false,this._width=0,this._height=0,this._destroyed=false,this._timeWidth=0,this._timeSections=[],this.$container=container,!container)throw new Error("container is required");var left,right;this.options=deepmerge(_$BASE_TIME_LINE_DEFAULT_OPTIONS$_,options,{clone:false}),this.options.timeSections&&Array.isArray(this.options.timeSections)&&(this._timeSections=this.options.timeSections),this.options.readOnly&&(this.readOnly=this.options.readOnly),this.options.className&&this.$container.classList.add(this.options.className),this.$container.style.position="relative",this.options.current&&(left=this.options.current,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)?this._current=this.options.current||new Date:this._current=new Date,this.i18n=new I18n(deepmerge(_$TIMELINE_LOCALES$_,this.options.locales||{},{clone:false}),{defaultLocale:this.options.language||"zh"}),this._timeWidth=this.options.timeWidth||0,this._resize(this.options.width||"100%",this.options.height);}var _proto=BaseTimeLine.prototype;return _proto.setReadOnly=function(readOnly){this.readOnly=readOnly;},_proto.update=function(current){this._current=current;},_proto.updateTimeSections=function(timeSections){timeSections&&Array.isArray(timeSections)&&(this._timeSections=timeSections);},_proto.resize=function(width,height){this._resize(width,height);},_proto._resize=function(width,height){var cssText="";/^\d+(\.\d+)?$/.test(width+"")?cssText+="width: "+width+"px;":width&&(cssText+="width: "+width+";"),/^\d+(\.\d+)?$/.test(height+"")?cssText+="height: "+height+"px;":height&&(cssText+="height: "+height+";"),this.$container&&(this.$container.style.cssText+=cssText),this._width=Math.floor(this.$container.clientWidth),this._height=Math.floor(this.$container.clientHeight);},_proto.setTimeWidth=function(timeWidth){[0,1,2,3,4,5].includes(timeWidth)&&(this._timeWidth=timeWidth);},_proto.destroy=function(){this._current=null,null==this.options.onDestroy||this.options.onDestroy.call(this.options),this._timeSections=[],this._readOnly=false,this._destroyed=true;},_create_class$2(BaseTimeLine,[{key:"current",get:function(){return this._current},set:function(current){this._current=current;}},{key:"readOnly",get:function(){return this._readOnly},set:function(readOnly){this._readOnly!==readOnly&&(this._readOnly=readOnly,this.$container.style.cursor=readOnly?"not-allowed":"pointer");}},{key:"timeSections",get:function(){return this._timeSections}},{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}},{key:"timeWidth",get:function(){return this._timeWidth}}]),BaseTimeLine}();BaseTimeLine.LOCALES=_$TIMELINE_LOCALES$_;var TimeLineUtil=function(){function TimeLineUtil(){}return TimeLineUtil.timeToSecond=function(time){var e=time.split(":");return 60*Number(e[0])*60+60*Number(e[1])+(Number(e[2])||0)},TimeLineUtil.minuteToTime=function(minute){var hour=Math.floor(minute/60),m=minute%60;return (hour>9?hour:"0"+hour)+":"+(m>9?m:"0"+m)},TimeLineUtil.timeToMinute=function(time){var e=time.split(":");return 60*Number(e[0])+Number(e[1])},TimeLineUtil.tranTimeToString=function(start,end){var _DateTime_toDate,_DateTime_toDate1,secondNum=Math.floor((null==(_DateTime_toDate=distExports$4.DateTime.toDate(end))?void 0:_DateTime_toDate.getTime())-(null==(_DateTime_toDate1=distExports$4.DateTime.toDate(start))?void 0:_DateTime_toDate1.getTime()))/1e3,second=secondNum%60,minute=Math.floor(secondNum/60);return (minute>0?distExports$4.DateTime.fillZero(minute)+"'":"0'")+distExports$4.DateTime.fillZero(second)+"''"},TimeLineUtil}(),_$TIMELINE_ICONS$__tip='<svg viewBox="0 0 57 24" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="tip">\n <path class="ez-time-line-icon-tip" fill-rule="evenodd" d="m4,0l44,0c2.2091,0 4,1.7909 4,4l0,3.8218l4.9399,3.3572c0.5839,0.3968 0.5839,1.2574 0,1.6542l-4.9399,3.3572l0,3.8096c0,2.2091 -1.7909,4 -4,4l-44,0c-2.2091,0 -4,-1.7909 -4,-4l0,-16c0,-2.2091 1.7909,-4 4,-4z"/>\n </svg>',_$TIMELINE_ICONS$__plus='\n <svg viewBox="0 0 16 16" stroke="currentColor" fill="none" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="plus">\n <path d="M0 0L10.6667 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0,1,-1,0,8,2.66663)"/>\n <path d="M2.66669 8L13.3334 8" stroke-linecap="round" stroke-width="1.5"/>\n </svg>\n ',_$TIMELINE_ICONS$__minus='\n <svg viewBox="0 0 16 16" stroke="currentColor" fill="none" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="minus">\n <path d="M2.66669 8L13.3334 8" stroke-linecap="round" stroke-width="1.5"/>\n </svg>\n ',_$TIMELINE_ICONS$__close='\n <svg viewBox="0 0 24 24" fill="none" width="1em" height="1em" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="close">\n\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,0.707114,-0.707114,0.707099,6.34277,6.34326)" />\n\t\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,-0.707114,0.707114,0.707099,6.34277,17.6567)" />\n </svg>\n ',_$TIMELINE_ICONS$__pause='<svg viewBox="0 0 20 20" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="pause">\n\t\t <path d="M9.43914 2.47881L13.4688 8.4912C14.3594 9.81998 13.4071 11.6047 11.8074 11.6047L3.74811 11.6047C2.14849 11.6047 1.19616 9.81998 2.08675 8.4912L6.11641 2.47881C6.90863 1.2968 8.64693 1.2968 9.43914 2.47881Z" fill-rule="evenodd" transform="matrix(0,1,-1,0,16.5781,2.22229)" />\n </svg>\n ',_$TIMELINE_ICONS$__picture='\n <svg viewBox="0 0 19.1613 19.4583" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="picture">\n <path d="M15.3276 2.63477L3.83173 2.63477C2.70848 2.63477 1.79541 3.55027 1.79541 4.68419L1.79541 14.7737C1.79541 15.9076 2.70848 16.8231 3.83173 16.8231L15.3276 16.8231C16.4504 16.8231 17.364 15.9074 17.364 14.7737L17.364 4.68419C17.364 3.55027 16.4509 2.63477 15.3276 2.63477ZM3.83247 3.851L15.3284 3.851C15.7936 3.851 16.1671 4.22551 16.1671 4.68429L16.1671 14.7738C16.1671 15.2323 15.7932 15.6071 15.3284 15.6071L3.83247 15.6071C3.36725 15.6071 2.99373 15.2326 2.99373 14.7738L2.99373 12.2622L6.7356 9.56381L6.78139 9.53916C6.84532 9.51493 6.91856 9.52524 6.9742 9.56947L13.2644 14.5698L13.3381 14.62C13.5918 14.7666 13.9197 14.7063 14.105 14.4658C14.3089 14.2014 14.263 13.8192 14.0026 13.6122L7.71239 8.61184L7.60526 8.5346C7.12945 8.22451 6.51026 8.23473 6.04222 8.57224L2.99373 10.7706L2.99373 4.68429C2.99373 4.22551 3.36725 3.851 3.83247 3.851ZM10.5794 7.29679C10.5794 6.06542 11.5624 5.0672 12.7749 5.0672C13.9875 5.0672 14.9705 6.06542 14.9705 7.29679C14.9705 8.52817 13.9875 9.52639 12.7749 9.52639C11.5624 9.52639 10.5794 8.52817 10.5794 7.29679ZM13.7722 7.2967C13.7722 6.73699 13.3254 6.28325 12.7742 6.28325C12.223 6.28325 11.7762 6.73699 11.7762 7.2967C11.7762 7.85642 12.223 8.31015 12.7742 8.31015C13.3254 8.31015 13.7722 7.85642 13.7722 7.2967Z" fill-rule="evenodd"/>\n </svg>\n ',TIME_WIDTH=[[1,10,10,"单位 1秒"],[60,20,5,"单位 1分钟"],[600,20,6,"单位 10分钟"],[3600,30,6,"单位 1小时"],[14400,40,2,"单位 4小时"],[43200,80,2,"单位 12小时"]],MOBILE_TIME_WIDTH=[[1,10,10,"单位 1分钟"],[10,20,5,"单位 10分钟"],[30,20,6,"单位 30分钟"],[60,30,6,"单位 1小时"],[120,40,2,"单位 2小时"],[240,80,2,"单位 4小时"]],__$IMAGE_LAZY_LOADER_DEFAULT_OPTIONS$__={targets:[],root:null,rootMargin:"0px",threshold:.1,loadingClass:"ez-lazy-image-loading",loadedClass:"ez-lazy-image-loaded",loadedErrorClass:"ez-lazy-image-error",onLoadError:function(){}},ImageLazyLoader=function(){function ImageLazyLoader(options){ void 0===options&&(options={}),this.options=Object.assign({},__$IMAGE_LAZY_LOADER_DEFAULT_OPTIONS$__,options),this._observer=null,this._init();}var _proto=ImageLazyLoader.prototype;return _proto._init=function(){var _this=this;ImageLazyLoader.isSupported&&(this._observer=new IntersectionObserver(function(entries){entries.forEach(function(entry){var _this__observer;entry.isIntersecting&&(_this._loadImage(entry.target),null==(_this__observer=_this._observer)||_this__observer.unobserve(entry.target));});},this.options)),this.addImages(this.options.targets);},_proto._loadImage=function(img){var _img_classList,_img_classList1,_img_classList2,_this=this;if(img&&!(null==(_img_classList=img.classList)?void 0:_img_classList.contains(this.options.loadingClass))&&!(null==(_img_classList1=img.classList)?void 0:_img_classList1.contains(this.options.loadedClass))&&!(null==(_img_classList2=img.classList)?void 0:_img_classList2.contains(this.options.loadedErrorClass))&&img.hasAttribute("data-src")){var _this1=this;img.classList.add(this.options.loadingClass);var tempImg=new Image;tempImg.onload=function(){img.src=img.dataset.src,img.classList.remove(_this.options.loadingClass),img.classList.add(_this.options.loadedClass),img.dispatchEvent(new Event("lazyloaded"));},tempImg.onerror=function(e){img.classList.remove(_this.options.loadingClass),img.classList.add(_this.options.loadedErrorClass),null==_this1.options.onLoadError||_this1.options.onLoadError.call(_this1.options,img);},tempImg.src=img.dataset.src;}},_proto.addImages=function(targets){var _this=this;(null==targets?void 0:targets.length)&&targets.forEach(function(target){var _this__observer;(null==target?void 0:target.hasAttribute("data-src"))&&(ImageLazyLoader.isSupported&&_this._observer?null==(_this__observer=_this._observer)||_this__observer.observe(target):_this._loadImage(target));});},_proto.destroy=function(){this._observer&&(this._observer.disconnect(),this._observer=null);},ImageLazyLoader}();function _create_class$1(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _extends$1$1(){return _extends$1$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends$1$1.apply(this,arguments)}function _set_prototype_of$1$1(o,p){return _set_prototype_of$1$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1$1(o,p)}ImageLazyLoader.isSupported="IntersectionObserver"in window;var _$MOBILE_TIME_LINE_DEFAULT_OPTIONS$_=Object.assign({},_$BASE_TIME_LINE_DEFAULT_OPTIONS$_,{height:400,width:"100%",timeWidth:0,readOnly:false,timePointColor:"#648FFC",timeTextColor:"#666666",timeScaleColor:"transparent",timeSectionColor:"#369FFF",timeAxisBgColor:"#BDCDFF",currentTimeBgColor:"#648FFC",currentTimeColor:"#FFFFFF",showTimeWidthBtn:true,showCoverFold:true}),MobileTimeLine=function(BaseTimeLine){function MobileTimeLine(container,options){var _this;return (_this=BaseTimeLine.call(this,container,deepmerge(_$MOBILE_TIME_LINE_DEFAULT_OPTIONS$_,options,{clone:false}))||this)._isTouchStart=false,_this._dragScroll=null,_this._moveStartX=0,_this._moveStartY=0,_this._imageLazyLoader=null,_this._imageLazyLoaderPicker=null,_this.state={start:"00:00:00",end:"24:00:00",current:null,timeArr:[],availTimeLine:[],index:0},_this._onImageError=_this._onImageError.bind(_this),_this._plusClick=_this._plusClick.bind(_this),_this._minusClick=_this._minusClick.bind(_this),_this._onPickerClose=_this._onPickerClose.bind(_this),_this._onClickItem=_this._onClickItem.bind(_this),_this._onClickCoverFold=_this._onClickCoverFold.bind(_this),_this._imageLazyLoader=new ImageLazyLoader({root:_this.$container,onLoadError:function(img){null==_this._onImageError||_this._onImageError.call(_this,img);}}),_this._render(),_this.options.timeSections&&Array.isArray(_this.options.timeSections)&&_this.updateTimeSections(_this.options.timeSections),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of$1$1(subClass,superClass);}(MobileTimeLine,BaseTimeLine);var _proto=MobileTimeLine.prototype;return _proto.setReadOnly=function(readOnly){BaseTimeLine.prototype.setReadOnly.call(this,readOnly),this._dragScroll&&(this._dragScroll.readonly=readOnly);},_proto.setTimeWidth=function(timeWidth){MOBILE_TIME_WIDTH[timeWidth]&&(BaseTimeLine.prototype.setTimeWidth.call(this,timeWidth),this._matchTimeDot());},_proto.updateTimeSections=function(timeSections,defaultIndex){BaseTimeLine.prototype.updateTimeSections.call(this,timeSections);var list=timeSections.map(function(record){return _extends$1$1({},record,{startTime:distExports$4.DateTime.format(record.startTime,"HH:mm:ss"),endTime:distExports$4.DateTime.format(record.endTime,"HH:mm:ss")})});if(list.length>0){ void 0===defaultIndex&&(defaultIndex=list.length-1);var current=this.state.current;this._setState({availTimeLine:list,start:list[defaultIndex].startTime,end:list[defaultIndex].endTime,current:null===current?list[defaultIndex].startTime:current}),this._matchTimeDot();}else this._setState({availTimeLine:[],current:distExports$4.DateTime.format(this.current||(new Date).getTime(),"HH:mm:ss")}),this._matchTimeDot();},_proto.update=function(time){var _this__dragScroll;time&&!(null==(_this__dragScroll=this._dragScroll)?void 0:_this__dragScroll.isDragging)&&(this._setState({current:distExports$4.DateTime.format(time,"HH:mm:ss")}),this._currentOffsetH());},_proto.destroy=function(){var _this__dragScroll;if(this._scrollTimer&&(clearInterval(this._scrollTimer),this._scrollTimer=null),this._$currentTime)try{this.$container.removeChild(this._$currentTime),this._$currentTime=null;}catch(error){}if(this._$itemContainer&&this._$itemList)try{this._$itemContainer.removeChild(this._$itemList),this._$itemList=null;}catch(error){}if(this._$itemContainer)try{this.$container.removeChild(this._$itemContainer),this._$itemContainer=null;}catch(error){}if(this._$op)try{this.$container.removeChild(this._$op),this._$op=null;}catch(error){}this._picker&&(this._picker.destroy(),this._picker=null),this._imageLazyLoader&&(this._imageLazyLoader.destroy(),this._imageLazyLoader=null),this._imageLazyLoaderPicker&&(this._imageLazyLoaderPicker.destroy(),this._imageLazyLoaderPicker=null),this._removeEventListener(),null==(_this__dragScroll=this._dragScroll)||_this__dragScroll.destroy(),this._dragScroll=null,BaseTimeLine.prototype.destroy.call(this);},_proto._setState=function(obj){var _this=this;Object.keys(obj).forEach(function(key){var _this__dragScroll,_this_timeSections_;"current"===key&&obj[key]?(_this._setCurrentDOM(obj[key]),_this.state.current===obj[key]||(null==(_this__dragScroll=_this._dragScroll)?void 0:_this__dragScroll.isDragging)||(_this.state[key]=obj[key],_this.current=new Date(distExports$4.DateTime.format((null==(_this_timeSections_=_this.timeSections[0])?void 0:_this_timeSections_.endTime)||(new Date).getTime(),"YYYY-MM-DD")+"T"+obj[key]),null==_this.options.onChange||_this.options.onChange.call(_this.options,_this.current))):_this.state[key]=obj[key];});},_proto._setCurrentDOM=function(time){this._$currentTime&&(this._$currentTime.querySelector(".ez-time-line-current-value").innerHTML=time);},_proto._matchTimeDot=function(){for(var scaleWidth=this._scaleWidth,timeArr=[],minute=TimeLineUtil.timeToMinute("24:00:00"),i=minute=Math.floor(minute/scaleWidth)*scaleWidth;i>=0;){var marginTop=0,marginBottom=0;i==minute&&(marginTop=70),0==i&&(marginBottom=this.$container.clientHeight-70);var time=TimeLineUtil.minuteToTime(i);timeArr.push({id:i,current:time,label:"a"+i,marginTop:marginTop,marginBottom:marginBottom,recArr:[],coverArr:this._filterTimeSectionsByTime(time)}),i-=scaleWidth;}this._setState({timeArr:timeArr}),this._matchRecTimeDot();},_proto._matchRecTimeDot=function(){var _this_state=this.state,availTimeLine=_this_state.availTimeLine,timeArr=_this_state.timeArr,scaleWidth=this._scaleWidth,len=availTimeLine.length;if(0===len)for(var j=0;j<timeArr.length;j++)timeArr[j].recArr=[];else {for(var k=0;k<timeArr.length;k++)timeArr[k].recArr=[];for(var i=0;i<len;i++){var stAvailPercent,etAvailPercent,temp=availTimeLine[i],st=TimeLineUtil.timeToSecond(temp.startTime),et=TimeLineUtil.timeToSecond(temp.endTime),stMinute=Math.floor(st/(60*scaleWidth))*scaleWidth;stAvailPercent=(st-60*stMinute)/scaleWidth;var etMinute=Math.floor(et/(60*scaleWidth))*scaleWidth;etAvailPercent=(et-60*etMinute)/scaleWidth;for(var j1=0;j1<timeArr.length;j1++)if(timeArr[j1].id==stMinute&&timeArr[j1].id==etMinute){var height=etAvailPercent-stAvailPercent,top=60-etAvailPercent;timeArr[j1].recArr.push({height:height,top:top});}else timeArr[j1].id==stMinute?timeArr[j1].recArr.push({height:60-stAvailPercent,top:0}):timeArr[j1].id==etMinute?timeArr[j1].recArr.push({height:etAvailPercent,top:60-etAvailPercent}):timeArr[j1].id>stMinute&&timeArr[j1].id<etMinute&&timeArr[j1].recArr.push({height:60,top:0});}}this._setState({timeArr:timeArr}),this._renderDateLine();},_proto._renderDateLine=function(){var _this=this,timeArr=this.state.timeArr,container=this._$itemList;container.innerHTML="",timeArr.forEach(function(item,index){var _this__imageLazyLoader,timeItemDOM=document.createElement("div");timeItemDOM.setAttribute("class","ez-time-line-time-scale-area"),item.marginTop&&(timeItemDOM.style.cssText+="margin-top: "+item.marginTop+"px;"),item.marginBottom&&(timeItemDOM.style.cssText+="margin-bottom: "+item.marginBottom+"px;"),timeItemDOM.style.cssText+="border-right-color: "+(_this.options.timeAxisBgColor||"rgba(189, 205, 255, 1)")+";",timeItemDOM.setAttribute("data-time",item.current),timeItemDOM.setAttribute("data-index",index+""),document.createElement("div").setAttribute("class","ez-time-line-scale");var timeItemHtml="";item.coverArr.length&&_this.options.showCoverFold&&(timeItemHtml+='\n <div class="ez-time-line-time-cover-fold '+(item.coverArr.length>1?"ez-time-line-time-cover-fold-multiple":"")+'"\n data-start="'+item.current+'">\n '+(item.coverArr.length>1?'<div class="ez-time-line-cover-fold-placeholder" style="color: #FFF"></div>':"")+'\n <div class="ez-time-line-time-cover-fold-img">\n <img data-src="'+_this._setImageScr(item.coverArr[0].coverPic)+'" class="ez-time-line-img"/>\n <span class="ez-time-line-time-cover-fold-len">\n '+(item.coverArr.length>1?_this.i18n.t("foldTitle",{len:item.coverArr.length,unit:"videos"}):""+distExports$4.DateTime.format(item.coverArr[0].startTime,"HH:mm"))+"\n </span>\n "+(1===item.coverArr.length?'<span class="ez-time-line-time-cover-fold-time">'+TimeLineUtil.tranTimeToString(item.coverArr[0].startTime,item.coverArr[0].endTime)+"</span>":"")+'\n <span class="ez-time-line-time-cover-fold-pause">'+_$TIMELINE_ICONS$__pause+"</span>\n </div>\n </div>"),item.recArr.forEach(function(i){timeItemHtml+='<div class="ez-time-line-time-unavail"\n style="height: '+i.height+"px;background-color:"+(_this.options.timeSectionColor||"#369FFF")+"; top: "+i.top+'px">\n </div>';}),timeItemHtml+="<div id="+item.label+' class="ez-time-line-time-label" style="color: '+(_this.options.timeTextColor||"#666")+'">'+item.current+"</div>",timeItemDOM.innerHTML=timeItemHtml,container.appendChild(timeItemDOM),item.coverArr.length&&_this.options.showCoverFold&&(null==(_this__imageLazyLoader=_this._imageLazyLoader)||_this__imageLazyLoader.addImages(container.querySelectorAll("img.ez-time-line-img")||[]));}),this._currentOffsetH();},_proto._currentOffsetH=function(){var current=this.state.current;if(current){var _this__dragScroll,y=(86400-TimeLineUtil.timeToSecond(current)||0)/this._scaleWidth;null==(_this__dragScroll=this._dragScroll)||_this__dragScroll.scrollToY(y+60,false);}},_proto._render=function(){var _this=this;if(this._$currentTime=document.createElement("div"),this._$currentTime.classList.add("ez-time-line-current"),this._$currentTime.innerHTML='<div class="ez-time-line-current-content" style="color: '+(this.options.currentTimeBgColor||"#648FFC")+'">\n <span class="ez-time-line-current-tip">'+_$TIMELINE_ICONS$__tip+'</span>\n <span class="ez-time-line-current-tip-line" style="background-color: '+(this.options.timePointColor||"#648FFC")+';"></span>\n <div class="ez-time-line-current-value" style="color: '+(this.options.currentTimeColor||"#FFFFFF")+'">00:00:00</div>\n </div>',this.$container.appendChild(this._$currentTime),this._$itemContainer=document.createElement("div"),this._$itemContainer.classList.add("ez-time-line-container"),this.$container.appendChild(this._$itemContainer),this._dragScroll=new DragScroll(this._$itemContainer,{hideScrollbar:true,onChange:function(state){var result=_this._offsetYToTime(state.y);result[1]!==_this.state.current&&_this._setCurrentDOM(result[0]>=86400?"23:59:59":result[1]);},onDragStart:function(e){_this._moveStartX=e.clientX,_this._moveStartY=e.clientY,null==_this.options.onDragStart||_this.options.onDragStart.call(_this.options,_this.state.current);},onDragging:function(){null==_this.options.onDragging||_this.options.onDragging.call(_this.options,_this.state.current);},onDragEnd:function(){var _this__dragScroll,result=_this._offsetYToTime(null==(_this__dragScroll=_this._dragScroll)?void 0:_this__dragScroll.currentY);result[1]!==_this.state.current&&_this._setState({current:result[0]>=86400?"23:59:59":result[1]}),null==_this.options.onDragEnd||_this.options.onDragEnd.call(_this.options,_this.state.current);}}),/\d/.test(this.options.height))this._$itemContainer.style.cssText+="height: "+this.options.height+"px";else if("string"==typeof this.options.height)this._$itemContainer.style.cssText+="height: "+this.options.height;else {var height=this.$container.clientHeight;this._$itemContainer.style.cssText+="height: "+height+"px";}this._$itemList=document.createElement("div"),this._$itemList.classList.add("ez-time-line-item"),this._dragScroll.$content.appendChild(this._$itemList),this.options.showTimeWidthBtn&&(this._$op=document.createElement("div"),this._$op.classList.add("ez-time-line-op"),this._$op.innerHTML='<span class="ez-time-line-op-wrapper"><span class="ez-time-line-icon-plus">'+_$TIMELINE_ICONS$__plus+'</span> <span class="ez-time-line-icon-minus">'+_$TIMELINE_ICONS$__minus+"</span></span>",this.$container.appendChild(this._$op)),this.options.showCoverFold&&(this._picker=new Picker(null,{isMobile:true,wrapClassName:"ez-time-line-picker",onOpenChange:function(isOpen){var _this_options_onPickerOpenChange,_this_options;null==(_this_options=_this.options)||null==(_this_options_onPickerOpenChange=_this_options.onPickerOpenChange)||_this_options_onPickerOpenChange.call(_this_options,isOpen);}}),this._imageLazyLoaderPicker=new ImageLazyLoader({root:this._picker.$body,onLoadError:function(img){null==_this._onImageError||_this._onImageError.call(_this,img);}})),this._addEventListener();},_proto._addEventListener=function(){var _this__$op_querySelector,_this__$op_querySelector1;this.options.showTimeWidthBtn&&this._$op&&(null==(_this__$op_querySelector=this._$op.querySelector(".ez-time-line-icon-plus"))||_this__$op_querySelector.addEventListener("click",this._plusClick,false),null==(_this__$op_querySelector1=this._$op.querySelector(".ez-time-line-icon-minus"))||_this__$op_querySelector1.addEventListener("click",this._minusClick,false));this._matchTimeDot(),this._picker&&(this._delegatePickerClose=delegate(this._picker.$body,".ez-time-line-picker-close","click",this._onPickerClose,false),this._delegateItemContent=delegate(this._picker.$body,".ez-time-line-picker-item-content","click",this._onClickItem,false),this._delegateCoverFold=delegate(this._$itemList,".ez-time-line-time-cover-fold","click",this._onClickCoverFold,false));},_proto._removeEventListener=function(){var _this__$op_querySelector,_this__$op_querySelector1,_this__picker_$body_querySelector,_this__picker_$body;this.options.showTimeWidthBtn&&this._$op&&(null==(_this__$op_querySelector=this._$op.querySelector(".ez-time-line-icon-plus"))||_this__$op_querySelector.removeEventListener("click",this._plusClick),null==(_this__$op_querySelector1=this._$op.querySelector(".ez-time-line-icon-minus"))||_this__$op_querySelector1.removeEventListener("click",this._minusClick));this._picker&&(null==(_this__picker_$body=this._picker.$body)||null==(_this__picker_$body_querySelector=_this__picker_$body.querySelector(".ez-time-line-picker-close"))||_this__picker_$body_querySelector.removeEventListener("click",this._onPickerClose),this._delegateItemContent&&(this._delegateItemContent.forEach(function(delegation){delegation.destroy();}),this._delegateItemContent=null),this._delegatePickerClose&&(this._delegatePickerClose.forEach(function(delegation){delegation.destroy();}),this._delegatePickerClose=null),this._delegateCoverFold&&(this._delegateCoverFold.forEach(function(delegation){delegation.destroy();}),this._delegateCoverFold=null));},_proto._plusClick=function(){var timeWidth=this.timeWidth+1;timeWidth>0&&timeWidth<MOBILE_TIME_WIDTH.length&&this.setTimeWidth(timeWidth);},_proto._minusClick=function(){var timeWidth=this.timeWidth-1;timeWidth>=0&&timeWidth<MOBILE_TIME_WIDTH.length&&this.setTimeWidth(Math.floor(timeWidth));},_proto._timeSectionsToGroupsByHour=function(list){var obj={};return list.forEach(function(item,index){var hour=distExports$4.DateTime.format(item.startTime,"HH");obj[+hour]?obj[+hour].push(_extends$1$1({},item,{_index:index})):obj[+hour]=[_extends$1$1({},item,{_index:index})];}),obj},_proto._filterTimeSectionsByTime=function(start){if(!start)return [];var startSecond=TimeLineUtil.timeToSecond(start+":00"),endSecond=TimeLineUtil.timeToSecond(start+":00")+60*this._scaleWidth;return this.timeSections.filter(function(item){var _$start=TimeLineUtil.timeToSecond(distExports$4.DateTime.format(item.startTime,"HH:mm:ss"));return _$start>=startSecond&&_$start<endSecond})},_proto._renderPickerContent=function(start){var _this__picker_innerHTML,_this__picker,_this__picker1,_this__picker2,_this__imageLazyLoaderPicker,_this=this,list=this._filterTimeSectionsByTime(start),hourGroups=this._timeSectionsToGroupsByHour(list);(null==(_this__picker=this._picker)||null==(_this__picker_innerHTML=_this__picker.innerHTML)||_this__picker_innerHTML.call(_this__picker,'<div class="ez-time-line-picker-container">\n <div class="ez-time-line-picker-header">\n <span class="ez-time-line-picker-close">'+_$TIMELINE_ICONS$__close+"</span>\n "+this.i18n.t("title",{len:list.length,unit:list.length>1?"videos":"video"})+'\n </div>\n <div class="ez-time-line-picker-content">\n <div class="ez-time-line-picker-list">\n '+Object.keys(hourGroups).reverse().map(function(key){return '<div class="ez-time-line-picker-item">\n <div class="ez-time-line-picker-item-title">'+key+':00</div>\n <div class="ez-time-line-picker-item-list">\n '+hourGroups[key].reverse().map(function(item){return '<div class="ez-time-line-picker-item-content"\n data-start="'+distExports$4.DateTime.format(item.startTime,"YYYYMMDDTHHmmssZ")+'"\n data-end="'+distExports$4.DateTime.format(item.endTime,"YYYYMMDDTHHmmssZ")+'"\n data-index="'+item._index+'">\n <span class="ez-time-line-picker-item-time">'+distExports$4.DateTime.format(item.startTime,"HH:mm")+'</span>\n <span class="ez-time-line-picker-item-duration">\n '+TimeLineUtil.tranTimeToString(item.startTime,item.endTime)+'\n </span>\n <img class="ez-time-line-picker-item-cover" data-src="'+_this._setImageScr(item.coverPic)+'"/>\n </div>'}).join("")+"\n </div>\n </div>"}).join("")+"\n </div>\n </div>\n </div>\n </div>"),null==(_this__picker1=this._picker)?void 0:_this__picker1.$body)&&(null==(_this__imageLazyLoaderPicker=this._imageLazyLoaderPicker)||_this__imageLazyLoaderPicker.addImages((null==(_this__picker2=this._picker)?void 0:_this__picker2.$body.querySelectorAll("img"))||[]));},_proto._onImageError=function(img){if(!img.hasAttribute("data-error")){var _img_parentNode,placeholder=document.createElement("div");placeholder.classList.add("ez-time-line-item-cover-placeholder"),placeholder.innerHTML=""+_$TIMELINE_ICONS$__picture,null==(_img_parentNode=img.parentNode)||_img_parentNode.appendChild(placeholder),img.setAttribute("data-error","true"),img.remove();}},_proto._onPickerClose=function(){this._picker&&(this._picker.open=false);},_proto._onClickItem=function(e){var _e_delegateTarget_getAttribute,_e_delegateTarget,index=null==(_e_delegateTarget=e.delegateTarget)||null==(_e_delegateTarget_getAttribute=_e_delegateTarget.getAttribute)?void 0:_e_delegateTarget_getAttribute.call(_e_delegateTarget,"data-index");this._picker&&(this._picker.open=false),null==this.options.onPickerSelect||this.options.onPickerSelect.call(this.options,this.timeSections[+index]);},_proto._onClickCoverFold=function(e){var _e_delegateTarget_parentElement_getAttribute,_e_delegateTarget_parentElement,_e_delegateTarget;e.preventDefault();var time=null==(_e_delegateTarget=e.delegateTarget)||null==(_e_delegateTarget_parentElement=_e_delegateTarget.parentElement)||null==(_e_delegateTarget_parentElement_getAttribute=_e_delegateTarget_parentElement.getAttribute)?void 0:_e_delegateTarget_parentElement_getAttribute.call(_e_delegateTarget_parentElement,"data-time"),moveX=Math.abs(this._moveStartX-e.clientX),moveY=Math.abs(this._moveStartY-e.clientY);this._picker&&time&&!(moveX>=1||moveY>=1)&&(this._renderPickerContent(time),this._picker.open=true);},_proto._setImageScr=function(src){if(src){var query="x=200&"+(this.options.coverQuery||"");return src+(src.includes("?")?"&":"?")+query}return ""},_proto._offsetYToTime=function(offsetY){var _this__dragScroll,y=offsetY;offsetY<60&&(y=60,null==(_this__dragScroll=this._dragScroll)||_this__dragScroll.scrollToY(y));var second=86400-Math.floor((y-60)*this._scaleWidth);return [second,distExports$4.DateTime.fillZero(Math.floor(second/3600))+":"+distExports$4.DateTime.fillZero(Math.floor(second%3600/60))+":"+distExports$4.DateTime.fillZero(second%60)]},_create_class$1(MobileTimeLine,[{key:"_scaleWidth",get:function(){return (MOBILE_TIME_WIDTH[this.timeWidth]||MOBILE_TIME_WIDTH[0])[0]}}]),MobileTimeLine}(BaseTimeLine);function isOverlap(a_start,a_end,b_start,b_end){return Math.max(a_start,b_start)<=Math.min(a_end,b_end)}function _create_class$3(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _extends$5(){return _extends$5=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends$5.apply(this,arguments)}function _set_prototype_of$6(o,p){return _set_prototype_of$6=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$6(o,p)}var _$TIMELINE_DEFAULT_OPTIONS$_={height:36,dpr:window.devicePixelRatio||2,scaleOffsetTop:4,showYearMonthDay:true},TimeLine=function(BaseTimeLine){function TimeLine(container,options){var _this;return (_this=BaseTimeLine.call(this,container,deepmerge(_$TIMELINE_DEFAULT_OPTIONS$_,options,{clone:true}))||this)._$canvas=null,_this._ctx=null,_this._timeWidthArray=TIME_WIDTH[0],_this._centerPositionX=0,_this._isMouseDown=false,_this._mousePosition=0,_this._oldTime=null,_this._isOver=false,_this._moved=false,_this._isCtrlKeyDown=false,_this._lastTouchDist=0,_this.$container=container,_this._mousemoveFun=_this._mousemoveFun.bind(_this),_this._mouseoverFun=_this._mouseoverFun.bind(_this),_this._mouseleaveFun=_this._mouseleaveFun.bind(_this),_this._mousedownFun=_this._mousedownFun.bind(_this),_this._mouseUpFun=_this._mouseUpFun.bind(_this),_this._mousewheelFun=_this._mousewheelFun.bind(_this),_this._touchstartFun=_this._touchstartFun.bind(_this),_this._touchmoveFun=_this._touchmoveFun.bind(_this),_this._touchendFun=_this._touchendFun.bind(_this),_this._ctrlKeyDownFun=_this._ctrlKeyDownFun.bind(_this),_this._ctrlKeyUpFun=_this._ctrlKeyUpFun.bind(_this),_this._init(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of$6(subClass,superClass);}(TimeLine,BaseTimeLine);var _proto=TimeLine.prototype;return _proto._init=function(){this._$canvas=document.createElement("canvas"),this._ctx=this._$canvas.getContext("2d"),this.readOnly||(this._$canvas.style.cssText+="cursor: pointer;"),this.$container.appendChild(this._$canvas),this.resize(this.width,this.height),this._update({current:this.current,timeWidth:this.timeWidth,timeSections:this.timeSections}),this._addEventListener();},_proto.resize=function(width,height){BaseTimeLine.prototype.resize.call(this,width,height),this._$canvas&&width&&(this._$canvas.width=this.width*this.options.dpr,this._$canvas.style.cssText+="width: "+this.width+"px;"),this._$canvas&&height&&(this._$canvas.height=this.height*this.options.dpr,this._$canvas.style.cssText+="height: "+this.height+"px;"),this._draw();},_proto.setTimeWidth=function(timeWidth){this._update({timeWidth:timeWidth});},_proto.updateTimeSections=function(timeSections){this._update({timeSections:timeSections});},_proto.update=function(time){time&&!this._isMouseDown&&this._update({current:distExports$4.DateTime.toDate(time)});},_proto._update=function(options){var left,right,_this__$canvas;(void 0===options&&(options={}),(null==options?void 0:options.current)&&(left=options.current,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)&&(this.current=options.current),(null==options?void 0:options.timeSections)&&BaseTimeLine.prototype.updateTimeSections.call(this,this._mergeTimeSections(options.timeSections)),"number"==typeof(null==options?void 0:options.timeWidth)&&(null==options?void 0:options.timeWidth)<TIME_WIDTH.length&&(BaseTimeLine.prototype.setTimeWidth.call(this,options.timeWidth),this._timeWidthArray=TIME_WIDTH[Math.floor(this.timeWidth)]),"number"==typeof(null==options?void 0:options.timeWidth)&&this._timeWidthArray)&&(this._timeWidthArray[3]&&(null==(_this__$canvas=this._$canvas)||_this__$canvas.setAttribute("data-title",this._timeWidthArray[3])));this._draw();},_proto.setReadOnly=function(readOnly){BaseTimeLine.prototype.setReadOnly.call(this,readOnly),this._$canvas&&(this._$canvas.style.cssText+="cursor: "+(readOnly?"not-allowed":"pointer"));},_proto.destroy=function(){if(this._removeEventListener(),this._$canvas)try{this.$container.removeChild(this._$canvas),this._$canvas=null;}catch(e){}BaseTimeLine.prototype.destroy.call(this);},_proto._draw=function(){this._ctx&&(this._ctx.fillStyle=this.options.timeAxisBgColor,this._ctx.fillRect(0,0,this.width*this.options.dpr,this.height*this.options.dpr)),this._drawSections(),this._drawScale();},_proto._drawScale=function(){var lineWidth=1*this.options.dpr;this._centerPositionX=parseInt(this.width*this.options.dpr/2+"");for(var centerPosition={x:this.width*this.options.dpr/2,y:this.height*this.options.dpr},curScaleTime=Math.floor(this.current.getTime()/1e3),offsetSecond=(curScaleTime-Math.floor(distExports$4.DateTime.toDate(distExports$4.DateTime.format(new Date(1e3*curScaleTime),"YYYY-MM-DD")).getTime()/1e3))%this._timeWidthArray[0],padding=this.height*this.options.dpr/20,spacing=this._curScaleSpacing*this.options.dpr,rightLastScaleTimeX=Math.floor(this._centerPositionX+(this._timeWidthArray[0]-offsetSecond)/this._timeWidthArray[0]*spacing),leftLastScaleTime=curScaleTime-offsetSecond,rightLastScaleTime=leftLastScaleTime+this._timeWidthArray[0],x=rightLastScaleTimeX-spacing;x>0;x-=spacing){0===(leftLastScaleTime-Math.floor(distExports$4.DateTime.toDate(distExports$4.DateTime.format(new Date(1e3*leftLastScaleTime),"YYYY-MM-DD")).getTime()/1e3))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x,padding,x,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(distExports$4.DateTime.format(new Date(1e3*leftLastScaleTime),"YYYY-MM-DD HH:mm:ss"),x,padding+(this.options.scaleOffsetTop+4+4)*this.options.dpr,"center")):this._drawSolidLine(x,padding,x,padding+this.options.scaleOffsetTop*this.options.dpr,lineWidth),leftLastScaleTime-=this._timeWidthArray[0];}for(var x1=rightLastScaleTimeX;x1<=this.width*this.options.dpr;x1+=spacing){0===(rightLastScaleTime-Math.floor(distExports$4.DateTime.toDate(distExports$4.DateTime.format(new Date(1e3*rightLastScaleTime),"YYYY-MM-DD")).getTime()/1e3))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x1,padding,x1,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(distExports$4.DateTime.format(new Date(1e3*rightLastScaleTime),"YYYY-MM-DD HH:mm:ss"),x1,padding+(this.options.scaleOffsetTop+4+4)*this.options.dpr,"center")):this._drawSolidLine(x1,padding,x1,padding+this.options.scaleOffsetTop*this.options.dpr,lineWidth),rightLastScaleTime+=this._timeWidthArray[0];}this._drawSolidLine(centerPosition.x,0,centerPosition.x,centerPosition.y,lineWidth,this.options.timePointColor);},_proto._drawSolidLine=function(startX,startY,endX,endY,lineWidth,color){this._ctx&&(this._ctx.save(),this._ctx.strokeStyle=null!=color?color:this.options.timeScaleColor,this._ctx.lineWidth=lineWidth,this._ctx.beginPath(),this._ctx.moveTo(startX,startY),this._ctx.lineTo(endX,endY),this._ctx.stroke(),this._ctx.restore());},_proto._drawTextString=function(text,x,y,align){if(this._ctx){var timeTexts=text.split(" ");this._ctx.font=12*this.options.dpr*1+"px serif",this._ctx.fillStyle=this.options.timeTextColor,this._ctx.textAlign=align||"left",this._timeWidthArray[0]%60==0&&(timeTexts[1]=timeTexts[1].replace(/:00$/,"")),this._ctx.fillText(timeTexts[1],x,y+8*this.options.dpr),!this.options.showYearMonthDay||"00:00:00"!==timeTexts[1]&&"00:00"!==timeTexts[1]&&this._timeWidthArray[0]*this._timeWidthArray[2]!==86400||(this._ctx.textAlign=align||"left",this._ctx.fillText(timeTexts[0],x,y+18*this.options.dpr));}},_proto._drawSections=function(){for(var timeArr=this.timeSections||[],i=0;i<timeArr.length;i++){var position=this._findPosition(timeArr[i]);this._ctx&&isOverlap(0,this.width*this.options.dpr,position.x1,position.x2)&&(this._ctx.fillStyle=this.options.timeSectionColor,this._ctx.fillRect(position.x1,0,position.x2-position.x1,this.height*this.options.dpr));}},_proto._findPosition=function(item){var x1=(parseInt((item.startTime-this.current.getTime())/1e3+"",10)/this._timeWidthArray[0]*this._curScaleSpacing+this.width/2)*this.options.dpr;return {x1:x1,x2:x1+parseInt((item.endTime-item.startTime)/1e3+"",10)/this._timeWidthArray[0]*this._curScaleSpacing*this.options.dpr}},_proto._mergeTimeSections=function(timeSections){if(0===timeSections.length)return timeSections;for(var merged=[(timeSections=timeSections.map(function(item){return 10===(item.startTime+"").length&&(item.startTime=1e3*item.startTime),10===(item.endTime+"").length&&(item.endTime=1e3*item.endTime),_extends$5({},item,{startTime:item.startTime,endTime:item.endTime})}))[0]],i=1;i<timeSections.length;i++){var prev=merged[merged.length-1],curr=timeSections[i];prev.endTime>=curr.startTime?prev.endTime=Math.max(prev.endTime,curr.endTime):merged.push(curr);}return merged},_proto._addEventListener=function(){this._$canvas&&(this._$canvas.addEventListener("mousemove",this._mousemoveFun),this._$canvas.addEventListener("mouseover",this._mouseoverFun),this._$canvas.addEventListener("mouseleave",this._mouseleaveFun),this._$canvas.addEventListener("mousedown",this._mousedownFun),this._$canvas.addEventListener("mouseup",this._mouseUpFun),this._$canvas.addEventListener("wheel",this._mousewheelFun),this.$container.addEventListener("wheel",function(e){e.preventDefault();},{passive:false}),this._$canvas.addEventListener("keydown",this._ctrlKeyDownFun),this._$canvas.addEventListener("keyup",this._ctrlKeyUpFun),document.addEventListener("keydown",this._ctrlKeyDownFun,false),document.addEventListener("keyup",this._ctrlKeyUpFun,false),this._$canvas.addEventListener("touchstart",this._touchstartFun,{passive:false}),this._$canvas.addEventListener("touchmove",this._touchmoveFun,{passive:false}),this._$canvas.addEventListener("touchend",this._touchendFun,{passive:false}));},_proto._removeEventListener=function(){this._$canvas&&(this._$canvas.removeEventListener("mousemove",this._mousemoveFun),this._$canvas.removeEventListener("mouseover",this._mouseoverFun),this._$canvas.removeEventListener("mouseleave",this._mouseleaveFun),this._$canvas.removeEventListener("mousedown",this._mousedownFun),this._$canvas.removeEventListener("mouseup",this._mouseUpFun),this._$canvas.removeEventListener("wheel",this._mousewheelFun),this._$canvas.removeEventListener("keydown",this._ctrlKeyDownFun),this._$canvas.removeEventListener("keyup",this._ctrlKeyUpFun),document.removeEventListener("keydown",this._ctrlKeyDownFun),document.removeEventListener("keyup",this._ctrlKeyUpFun),this._$canvas.removeEventListener("touchstart",this._touchstartFun),this._$canvas.removeEventListener("touchmove",this._touchmoveFun),this._$canvas.removeEventListener("touchend",this._touchendFun));},_proto._mousedownFun=function(e){this.readOnly||(this._isMouseDown=true,this._mousePosition=e.pageX,this._oldTime=this.current,null==this.options.onDragStart||this.options.onDragStart.call(this.options,this.current));},_proto._mouseoverFun=function(){this.readOnly||(this._isOver=true);},_proto._mouseleaveFun=function(e){this.readOnly||(this._isOver=false,this._moveEndOrTouchEndFun(e));},_proto._mouseUpFun=function(e){this._moveEndOrTouchEndFun(e);},_proto._mousemoveFun=function(e){if(!this.readOnly)if(this._isMouseDown&&this._isOver)this._moveUpdateFun(e.pageX);else {var left=parseInt(this.$container.offsetLeft+"",10);this._mousePosition=e.pageX-left,this._update();}},_proto._mousewheelFun=function(e){e.preventDefault(),this.readOnly;},_proto._ctrlKeyDownFun=function(e){(e.ctrlKey||"Control"===e.key)&&(this._isCtrlKeyDown=true);},_proto._ctrlKeyUpFun=function(e){(e.ctrlKey||"Control"===e.key)&&(this._isCtrlKeyDown=false);},_proto._getTouchDistance=function(touches){var touch1=touches[0],touch2=touches[1],dx=touch2.clientX-touch1.clientX,dy=touch2.clientY-touch1.clientY;return Math.sqrt(dx*dx+dy*dy)},_proto._touchstartFun=function(e){if(!this.readOnly)if(this._oldTime=this.current,this._isOver=true,1===e.touches.length){var touch=e.touches[0];this._isMouseDown=true,this._mousePosition=touch.clientX;}else 2===e.touches.length&&(this._lastTouchDist=this._getTouchDistance(e.touches));},_proto._touchmoveFun=function(e){if(e.preventDefault(),e.stopPropagation(),!this.readOnly)if(1===e.touches.length){var touch=e.touches[0];this._moveUpdateFun(touch.clientX);}else if(2===e.touches.length){this._getTouchDistance(e.touches);this._lastTouchDist;}},_proto._touchendFun=function(e){this.readOnly||this._moveEndOrTouchEndFun(e);},_proto._moveEndOrTouchEndFun=function(e){e.preventDefault(),this.readOnly||this._isMouseDown&&(this._isMouseDown=false,this._moved&&(this._moved=false,this._update({current:this.current}),this._oldTime=this.current,null==this.options.onDragEnd||this.options.onDragEnd.call(this.options,this.current,this._isOver)),this._isOver&&Math.abs(this._mousePosition-(e.pageX||0))>5&&(null==this.options.onChange||this.options.onChange.call(this.options,this.current)),this._mousePosition=0,this._lastTouchDist=0);},_proto._moveUpdateFun=function(x){var mouseOffset=this._mousePosition-x;if(0!==mouseOffset){if(this._oldTime){var currentTime=this._oldTime.getTime()+1e3*parseInt(mouseOffset/this._curScaleSpacing*this._timeWidthArray[0]+"",10);this._update({current:new Date(currentTime)}),null==this.options.onDragging||this.options.onDragging.call(this.options,new Date(currentTime));}this._moved=true;}},_create_class$3(TimeLine,[{key:"_curScaleSpacing",get:function(){var _this__timeWidthArray,_this__timeWidthArray1;return Math.floor((null==(_this__timeWidthArray=this._timeWidthArray)?void 0:_this__timeWidthArray[1])-(null==(_this__timeWidthArray1=this._timeWidthArray)?void 0:_this__timeWidthArray1[1])*+(this.timeWidth%1/2).toFixed(2))}}]),TimeLine}(BaseTimeLine);TimeLine.TIME_WIDTH=TIME_WIDTH;
|
|
11527
9764
|
|
|
11528
9765
|
function _extends$4() {
|
|
11529
9766
|
_extends$4 = Object.assign || function(target) {
|
|
@@ -11624,17 +9861,17 @@
|
|
|
11624
9861
|
}
|
|
11625
9862
|
}
|
|
11626
9863
|
};
|
|
11627
|
-
if (distExports$
|
|
11628
|
-
this.timeLineUtil = new
|
|
9864
|
+
if (distExports$4.isMobile()) {
|
|
9865
|
+
this.timeLineUtil = new MobileTimeLine(this.$container, _timeLineOptions);
|
|
11629
9866
|
} else {
|
|
11630
|
-
this.timeLineUtil = new
|
|
9867
|
+
this.timeLineUtil = new TimeLine(this.$container, _timeLineOptions);
|
|
11631
9868
|
this._renderAddReduce();
|
|
11632
9869
|
}
|
|
11633
9870
|
(_this_timeLineUtil = this.timeLineUtil) == null ? void 0 : (_this_timeLineUtil_updateTimeSections = _this_timeLineUtil.updateTimeSections) == null ? void 0 : _this_timeLineUtil_updateTimeSections.call(_this_timeLineUtil, this.records);
|
|
11634
9871
|
this.timeLineUtil.update(new Date());
|
|
11635
9872
|
};
|
|
11636
9873
|
_proto.setWidth = function setWidth(width) {
|
|
11637
|
-
if (!distExports$
|
|
9874
|
+
if (!distExports$4.isMobile()) this.timeLineUtil.resize(width);
|
|
11638
9875
|
};
|
|
11639
9876
|
_proto._renderAddReduce = function _renderAddReduce() {
|
|
11640
9877
|
var _this = this;
|
|
@@ -12454,7 +10691,7 @@
|
|
|
12454
10691
|
props.height = Math.floor(theme.$container.clientHeight);
|
|
12455
10692
|
}
|
|
12456
10693
|
if (filterThemeData.header) {
|
|
12457
|
-
theme._header = new Header({
|
|
10694
|
+
theme._header = new Header$1({
|
|
12458
10695
|
getPopupContainer: function() {
|
|
12459
10696
|
return theme.$container;
|
|
12460
10697
|
},
|
|
@@ -12910,13 +11147,13 @@
|
|
|
12910
11147
|
_this._initOptions(options);
|
|
12911
11148
|
if (_this.options.type === 'ezopen') {
|
|
12912
11149
|
var _this_urlInfo_searchParams, _this_urlInfo;
|
|
12913
|
-
_this.urlInfo = distExports$
|
|
11150
|
+
_this.urlInfo = distExports$4.parseEzopenUrl(_this.options.url);
|
|
12914
11151
|
if ((_this_urlInfo = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams = _this_urlInfo.searchParams) == null ? void 0 : _this_urlInfo_searchParams.spaceId) {
|
|
12915
11152
|
_this.options.spaceId = _this.urlInfo.searchParams.spaceId;
|
|
12916
11153
|
}
|
|
12917
11154
|
if (_this.urlInfo.type === 'rec') {
|
|
12918
11155
|
var _this_urlInfo_searchParams1, _this_urlInfo1, _this_urlInfo_searchParams2, _this_urlInfo2;
|
|
12919
|
-
_this._seekDate = ((_this_urlInfo1 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams1 = _this_urlInfo1.searchParams) == null ? void 0 : _this_urlInfo_searchParams1.begin) ? distExports$
|
|
11156
|
+
_this._seekDate = ((_this_urlInfo1 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams1 = _this_urlInfo1.searchParams) == null ? void 0 : _this_urlInfo_searchParams1.begin) ? distExports$4.DateTime.toDate((_this_urlInfo2 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams2 = _this_urlInfo2.searchParams) == null ? void 0 : _this_urlInfo_searchParams2.begin) : distExports$4.DateTime.toDate(distExports$4.DateTime.format(new Date(), 'YYYY/MM/DD') + ' 00:00:00');
|
|
12920
11157
|
}
|
|
12921
11158
|
}
|
|
12922
11159
|
_this._getRecType(_this.options.url);
|
|
@@ -13223,7 +11460,7 @@
|
|
|
13223
11460
|
clone: false
|
|
13224
11461
|
});
|
|
13225
11462
|
// prettier-ignore
|
|
13226
|
-
this.i18n = new I18n(locales, {
|
|
11463
|
+
this.i18n = new I18n$1(locales, {
|
|
13227
11464
|
defaultLocale: language
|
|
13228
11465
|
});
|
|
13229
11466
|
// 默认清晰度列表
|
|
@@ -13691,7 +11928,7 @@
|
|
|
13691
11928
|
* @returns {"rec" | "cloudRecord" | "cloudRec" | ""} 录像类型, rec: 录像, cloudRec: 云录像, cloudRecord: 云录制
|
|
13692
11929
|
*/ _proto._getRecType = function _getRecType(url) {
|
|
13693
11930
|
if (this.options.type === 'ezopen' && /^ezopen:\/\//.test(url)) {
|
|
13694
|
-
var urlInfo = distExports$
|
|
11931
|
+
var urlInfo = distExports$4.parseEzopenUrl(url);
|
|
13695
11932
|
if (urlInfo.type === 'rec') {
|
|
13696
11933
|
var _urlInfo_searchParams;
|
|
13697
11934
|
if (urlInfo.recType === 'cloud' && (urlInfo == null ? void 0 : (_urlInfo_searchParams = urlInfo.searchParams) == null ? void 0 : _urlInfo_searchParams.busType) === '7') {
|
|
@@ -14156,7 +12393,7 @@
|
|
|
14156
12393
|
zh: zh,
|
|
14157
12394
|
en: en
|
|
14158
12395
|
};
|
|
14159
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '
|
|
12396
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.0.0-beta.1';
|
|
14160
12397
|
|
|
14161
12398
|
// 不要动这里的代码, 这个出口是为了编译成 umd 规范的文件
|
|
14162
12399
|
|