@ezuikit/player-theme 2.0.2-beta.1 → 2.0.2-beta.2
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/index.js +115 -605
- package/dist/index.mjs +116 -606
- package/dist/index.umd.js +465 -782
- package/dist/style.css +3 -2
- package/dist/style.js +2 -2
- package/dist/types/index.d.ts +67 -43
- package/package.json +6 -6
package/dist/index.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @ezuikit/player-theme v2.0.2-beta.
|
|
3
|
-
* Copyright (c) 2025-12-
|
|
2
|
+
* @ezuikit/player-theme v2.0.2-beta.2
|
|
3
|
+
* Copyright (c) 2025-12-08 Ezviz-OpenBiz
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
(function (global, factory) {
|
|
@@ -391,7 +391,8 @@
|
|
|
391
391
|
'speed',
|
|
392
392
|
'urlInfo',
|
|
393
393
|
'videoLevelList',
|
|
394
|
-
'videoLevel'
|
|
394
|
+
'videoLevel',
|
|
395
|
+
'recMonth'
|
|
395
396
|
];
|
|
396
397
|
/**
|
|
397
398
|
* 当移动端 picker 控件打开时需要关闭动画(定时器)
|
|
@@ -537,8 +538,9 @@
|
|
|
537
538
|
/** 全局全屏控件销毁 */ globalFullscreenDestroy: 'Control.globalFullscreenDestroy',
|
|
538
539
|
/** 日期面板展示隐藏变换 */ datePanelOpenChange: 'Control.datePanelOpenChange',
|
|
539
540
|
/** 日期改变 */ dateChange: 'Control.dateChange',
|
|
541
|
+
/** 日期改变 */ dateMonthChange: 'Control.dateMonthChange',
|
|
540
542
|
/** 日期销毁 */ dateDestroy: 'Control.datePanelDestroy',
|
|
541
|
-
/**
|
|
543
|
+
/** 时间轴拖动结束 */ timeLineChange: 'Control.timeLineChange',
|
|
542
544
|
/** 时间轴图片列表面板 */ timeLinePanelOpenChange: 'Control.timeLinePanelOpenChange',
|
|
543
545
|
/** 时间轴控件销毁 */ timeLineDestroy: 'Control.timeLineDestroy',
|
|
544
546
|
/** 主题控件挂载前 切换新的主题也会触发,如果想首次获取需要在 onInitializing 回调中进行监听 */ beforeMountControls: 'Control.beforeMountControls',
|
|
@@ -549,7 +551,7 @@
|
|
|
549
551
|
/** 加载控件销毁 */ loadingDestroy: 'Control.loadingDestroy',
|
|
550
552
|
/** 消息控件销毁 */ messageDestroy: 'Control.messageDestroy',
|
|
551
553
|
/** 播放器内容区域销毁 */ contentDestroy: 'Control.contentDestroy',
|
|
552
|
-
contentRerender: 'Control.contentRerender'
|
|
554
|
+
/** 播放器内容区域重新渲染 */ contentRerender: 'Control.contentRerender'
|
|
553
555
|
},
|
|
554
556
|
/**
|
|
555
557
|
* 主题控件相关
|
|
@@ -1472,8 +1474,8 @@
|
|
|
1472
1474
|
/**
|
|
1473
1475
|
* picker component for js framework, support mobile and pc
|
|
1474
1476
|
*
|
|
1475
|
-
* @skax/picker v1.1.
|
|
1476
|
-
* Copyright (c) 2025-
|
|
1477
|
+
* @skax/picker v1.1.7
|
|
1478
|
+
* Copyright (c) 2025-12-08 ShineShao <xiaoshaoqq@gmail.com>
|
|
1477
1479
|
*
|
|
1478
1480
|
* This source code is licensed under the MIT license found in the
|
|
1479
1481
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -1617,7 +1619,8 @@
|
|
|
1617
1619
|
trigger: 'click',
|
|
1618
1620
|
mouseLeaveDelay: 0.1,
|
|
1619
1621
|
mouseEnterDelay: 0.1,
|
|
1620
|
-
isMobile: false
|
|
1622
|
+
isMobile: false,
|
|
1623
|
+
triggerClose: false
|
|
1621
1624
|
};
|
|
1622
1625
|
/**
|
|
1623
1626
|
* Picker 弹窗, 支持 PC 和移动端
|
|
@@ -1673,6 +1676,7 @@
|
|
|
1673
1676
|
(_this__$popupContainer1 = this._$popupContainer) == null ? void 0 : _this__$popupContainer1.appendChild(this.$wrapperContent);
|
|
1674
1677
|
this._onContentClick = this._onContentClick.bind(this);
|
|
1675
1678
|
this._onShow = this._onShow.bind(this);
|
|
1679
|
+
this._onContainerClick = this._onContainerClick.bind(this);
|
|
1676
1680
|
this._onWrapperShow = this._onWrapperShow.bind(this);
|
|
1677
1681
|
this._onHide = this._onHide.bind(this);
|
|
1678
1682
|
this._onDocumentClick = this._onDocumentClick.bind(this);
|
|
@@ -1755,7 +1759,7 @@
|
|
|
1755
1759
|
var _this_$wrapperContent, _this_$container_removeEventListener, _this_$container, _this_$container_removeEventListener1, _this_$container1;
|
|
1756
1760
|
(_this_$wrapperContent = this.$wrapperContent) == null ? void 0 : _this_$wrapperContent.removeEventListener('click', this._onContentClick);
|
|
1757
1761
|
(_this_$container = this.$container) == null ? void 0 : (_this_$container_removeEventListener = _this_$container.removeEventListener) == null ? void 0 : _this_$container_removeEventListener.call(_this_$container, 'click', this._onContentClick);
|
|
1758
|
-
if (this._options.trigger === 'click') (_this_$container1 = this.$container) == null ? void 0 : (_this_$container_removeEventListener1 = _this_$container1.removeEventListener) == null ? void 0 : _this_$container_removeEventListener1.call(_this_$container1, 'click', this.
|
|
1762
|
+
if (this._options.trigger === 'click') (_this_$container1 = this.$container) == null ? void 0 : (_this_$container_removeEventListener1 = _this_$container1.removeEventListener) == null ? void 0 : _this_$container_removeEventListener1.call(_this_$container1, 'click', this._onContainerClick);
|
|
1759
1763
|
if (this._options.trigger === 'hover') {
|
|
1760
1764
|
var _this_$container_removeEventListener2, _this_$container2, _this_$container_removeEventListener3, _this_$container3, _this_$container_removeEventListener4, _this_$container4,
|
|
1761
1765
|
// prettier-ignore
|
|
@@ -1794,14 +1798,14 @@
|
|
|
1794
1798
|
var $popupContainerRect = this._$popupContainer.getBoundingClientRect();
|
|
1795
1799
|
// 容器的坐标 - 挂载的容器的坐标差
|
|
1796
1800
|
// prettier-ignore
|
|
1797
|
-
var containerLeft = $containerRect.left - $popupContainerRect.left;
|
|
1798
|
-
var containerRight = -($containerRect.right - $popupContainerRect.right);
|
|
1801
|
+
var containerLeft = Math.ceil($containerRect.left) - Math.ceil($popupContainerRect.left);
|
|
1802
|
+
var containerRight = -(Math.ceil($containerRect.right) - Math.ceil($popupContainerRect.right));
|
|
1799
1803
|
// prettier-ignore
|
|
1800
|
-
var containerTop = $containerRect.y - $popupContainerRect.y;
|
|
1801
|
-
var left = containerLeft + ($containerRect.width - $wrapperContentRect.width) / 2;
|
|
1804
|
+
var containerTop = Math.ceil($containerRect.y) - Math.ceil($popupContainerRect.y);
|
|
1805
|
+
var left = containerLeft + (Math.ceil($containerRect.width) - Math.ceil($wrapperContentRect.width)) / 2;
|
|
1802
1806
|
var right;
|
|
1803
|
-
var top = containerTop - $wrapperContentRect.height;
|
|
1804
|
-
var bottom = containerTop + $containerRect.height;
|
|
1807
|
+
var top = containerTop - Math.ceil($wrapperContentRect.height);
|
|
1808
|
+
var bottom = containerTop + Math.ceil($containerRect.height);
|
|
1805
1809
|
if (/^t/.test(this._options.placement)) {
|
|
1806
1810
|
var _this__options_offset, _this__options_offset1, _this__options_offset2;
|
|
1807
1811
|
switch (this._options.placement) {
|
|
@@ -1877,7 +1881,7 @@
|
|
|
1877
1881
|
this.$wrapperContent.addEventListener('click', this._onContentClick);
|
|
1878
1882
|
(_this_$container = this.$container) == null ? void 0 : (_this_$container_addEventListener = _this_$container.addEventListener) == null ? void 0 : _this_$container_addEventListener.call(_this_$container, 'click', this._onContentClick);
|
|
1879
1883
|
//
|
|
1880
|
-
if (this._options.trigger === 'click') (_this_$container1 = this.$container) == null ? void 0 : (_this_$container_addEventListener1 = _this_$container1.addEventListener) == null ? void 0 : _this_$container_addEventListener1.call(_this_$container1, 'click', this.
|
|
1884
|
+
if (this._options.trigger === 'click') (_this_$container1 = this.$container) == null ? void 0 : (_this_$container_addEventListener1 = _this_$container1.addEventListener) == null ? void 0 : _this_$container_addEventListener1.call(_this_$container1, 'click', this._onContainerClick);
|
|
1881
1885
|
if (this._options.trigger === 'hover') {
|
|
1882
1886
|
var _this_$container_addEventListener2, _this_$container2, _this_$container_addEventListener3, _this_$container3, _this_$container_addEventListener4, _this_$container4;
|
|
1883
1887
|
(_this_$container2 = this.$container) == null ? void 0 : (_this_$container_addEventListener2 = _this_$container2.addEventListener) == null ? void 0 : _this_$container_addEventListener2.call(_this_$container2, 'mouseenter', this._onShow);
|
|
@@ -1902,6 +1906,23 @@
|
|
|
1902
1906
|
pickerProvider.closeOther(e);
|
|
1903
1907
|
};
|
|
1904
1908
|
/**
|
|
1909
|
+
* $container click event
|
|
1910
|
+
* @param event - 鼠标点击事件
|
|
1911
|
+
* @returns
|
|
1912
|
+
*/
|
|
1913
|
+
_proto._onContainerClick = function _onContainerClick(event) {
|
|
1914
|
+
var _this_$wrapperContent_contains, _this_$wrapperContent;
|
|
1915
|
+
if (this._disabled) return;
|
|
1916
|
+
// wrapper contain
|
|
1917
|
+
var contain = ((_this_$wrapperContent = this.$wrapperContent) == null ? void 0 : (_this_$wrapperContent_contains = _this_$wrapperContent.contains) == null ? void 0 : _this_$wrapperContent_contains.call(_this_$wrapperContent, event.target)) || this.$wrapperContent === event.target;
|
|
1918
|
+
// open 状态下触发关闭
|
|
1919
|
+
if (this._options.triggerClose && this._options.trigger === 'click' && !contain) {
|
|
1920
|
+
this.open = !this.open;
|
|
1921
|
+
} else {
|
|
1922
|
+
this.open = true;
|
|
1923
|
+
}
|
|
1924
|
+
};
|
|
1925
|
+
/**
|
|
1905
1926
|
* 显示事件
|
|
1906
1927
|
*/
|
|
1907
1928
|
_proto._onShow = function _onShow() {
|
|
@@ -2040,145 +2061,153 @@
|
|
|
2040
2061
|
* Picker.VERSION; // 输出版本号
|
|
2041
2062
|
* ```
|
|
2042
2063
|
*/
|
|
2043
|
-
Picker.VERSION = '1.1.
|
|
2064
|
+
Picker.VERSION = '1.1.7';
|
|
2044
2065
|
|
|
2045
2066
|
dist$a = Picker;
|
|
2046
2067
|
return dist$a;
|
|
2047
2068
|
}
|
|
2048
2069
|
|
|
2049
|
-
var distExports$
|
|
2050
|
-
var Picker = /*@__PURE__*/getDefaultExportFromCjs(distExports$
|
|
2070
|
+
var distExports$7 = requireDist$a();
|
|
2071
|
+
var Picker = /*@__PURE__*/getDefaultExportFromCjs(distExports$7);
|
|
2072
|
+
|
|
2073
|
+
var delegate$2 = {exports: {}};
|
|
2051
2074
|
|
|
2052
2075
|
/*
|
|
2053
|
-
* delegate.js v4.0.
|
|
2054
|
-
* Copyright (c) 2025-11-
|
|
2076
|
+
* delegate.js v4.0.1
|
|
2077
|
+
* Copyright (c) 2025-11-23
|
|
2055
2078
|
* Released under the MIT License.
|
|
2056
2079
|
*/
|
|
2080
|
+
var delegate$1 = delegate$2.exports;
|
|
2081
|
+
|
|
2082
|
+
var hasRequiredDelegate;
|
|
2083
|
+
|
|
2084
|
+
function requireDelegate () {
|
|
2085
|
+
if (hasRequiredDelegate) return delegate$2.exports;
|
|
2086
|
+
hasRequiredDelegate = 1;
|
|
2087
|
+
(function (module, exports) {
|
|
2088
|
+
(function (global, factory) {
|
|
2089
|
+
module.exports = factory() ;
|
|
2090
|
+
})(delegate$1, (function () {
|
|
2091
|
+
var DOCUMENT_NODE_TYPE = 9;
|
|
2092
|
+
/**
|
|
2093
|
+
* A polyfill for Element.matches()
|
|
2094
|
+
*/ if (typeof Element !== "undefined" && !Element.prototype.matches) {
|
|
2095
|
+
var proto = Element.prototype;
|
|
2096
|
+
proto.matches = (proto == null ? void 0 : proto.matchesSelector) || (proto == null ? void 0 : proto.mozMatchesSelector) || (proto == null ? void 0 : proto.msMatchesSelector) || (proto == null ? void 0 : proto.oMatchesSelector) || (proto == null ? void 0 : proto.webkitMatchesSelector);
|
|
2097
|
+
}
|
|
2098
|
+
/**
|
|
2099
|
+
* Finds the closest parent that matches a selector.
|
|
2100
|
+
*
|
|
2101
|
+
* @param {Element} element
|
|
2102
|
+
* @param {string} selector
|
|
2103
|
+
* @return {Element}
|
|
2104
|
+
*/ function closest(element, selector) {
|
|
2105
|
+
while(element && element.nodeType !== DOCUMENT_NODE_TYPE){
|
|
2106
|
+
if (typeof element.matches === "function" && element.matches(selector)) {
|
|
2107
|
+
return element;
|
|
2108
|
+
}
|
|
2109
|
+
element = element.parentNode;
|
|
2110
|
+
}
|
|
2111
|
+
return null;
|
|
2112
|
+
}
|
|
2113
|
+
/**
|
|
2114
|
+
* Finds the closest parent that matches a selector.
|
|
2115
|
+
*
|
|
2116
|
+
* @param {Element} element
|
|
2117
|
+
* @param {string} selector
|
|
2118
|
+
* @return {Element}
|
|
2119
|
+
*/ function closestNative(element, selector) {
|
|
2120
|
+
return element && element.closest(selector);
|
|
2121
|
+
}
|
|
2122
|
+
var closest$1 = typeof Element.prototype.closest === "function" ? closestNative : closest;
|
|
2123
|
+
|
|
2124
|
+
/**
|
|
2125
|
+
* Delegates event to a selector.
|
|
2126
|
+
*
|
|
2127
|
+
* @param {Element} element
|
|
2128
|
+
* @param {string} selector
|
|
2129
|
+
* @param {string} type
|
|
2130
|
+
* @param {Function} callback
|
|
2131
|
+
* @param {boolean} useCapture
|
|
2132
|
+
* @return {Object}
|
|
2133
|
+
*/ // prettier-ignore
|
|
2134
|
+
function _delegate(element, selector, type, callback, useCapture) {
|
|
2135
|
+
// prettier-ignore
|
|
2136
|
+
var listenerFn = listener.apply(this, arguments);
|
|
2137
|
+
element.addEventListener(type, listenerFn, useCapture);
|
|
2138
|
+
return {
|
|
2139
|
+
destroy: function destroy() {
|
|
2140
|
+
element.removeEventListener(type, listenerFn, useCapture);
|
|
2141
|
+
}
|
|
2142
|
+
};
|
|
2143
|
+
}
|
|
2144
|
+
/**
|
|
2145
|
+
* Delegates event to a selector.
|
|
2146
|
+
*
|
|
2147
|
+
* @param {Element|string|Array} [elements]
|
|
2148
|
+
* @param {string | Element} selector
|
|
2149
|
+
* @param {string} type
|
|
2150
|
+
* @param {Function} callback
|
|
2151
|
+
* @param {boolean} useCapture
|
|
2152
|
+
* @return {Object}
|
|
2153
|
+
* @example
|
|
2154
|
+
* ```ts
|
|
2155
|
+
* const delegation = delegate(document.body, 'a', 'click', function (e) {})
|
|
2156
|
+
* // destroy (removeEventListener)
|
|
2157
|
+
* delegation.destroy();
|
|
2158
|
+
*
|
|
2159
|
+
* const delegation1 = delegate(".btn", "click", function (e) { console.log(e.delegateTarget)},false);
|
|
2160
|
+
* // destroy (removeEventListener)
|
|
2161
|
+
* delegation1.destroy();
|
|
2162
|
+
* ```
|
|
2163
|
+
*/ // prettier-ignore
|
|
2164
|
+
function delegate(elements, selector, type, callback, useCapture) {
|
|
2165
|
+
// Handle the regular Element usage
|
|
2166
|
+
if (typeof elements.addEventListener === "function") {
|
|
2167
|
+
return _delegate.apply(null, arguments);
|
|
2168
|
+
}
|
|
2169
|
+
// Handle Element-less usage, it defaults to global delegation
|
|
2170
|
+
if (typeof type === "function") {
|
|
2171
|
+
// Use `document` as the first parameter, then apply arguments
|
|
2172
|
+
// This is a short way to .unshift `arguments` without running into deoptimizations
|
|
2173
|
+
return _delegate.bind(null, document).apply(null, arguments);
|
|
2174
|
+
}
|
|
2175
|
+
// Handle Selector-based usage
|
|
2176
|
+
if (typeof elements === "string") {
|
|
2177
|
+
elements = document.querySelectorAll(elements);
|
|
2178
|
+
}
|
|
2179
|
+
// Handle Array-like based usage
|
|
2180
|
+
return Array.prototype.map.call(elements, function(element) {
|
|
2181
|
+
return _delegate(element, selector, type, callback, useCapture);
|
|
2182
|
+
});
|
|
2183
|
+
}
|
|
2184
|
+
/**
|
|
2185
|
+
* Finds closest match and invokes callback.
|
|
2186
|
+
*
|
|
2187
|
+
* @param {Element} element
|
|
2188
|
+
* @param {string} selector
|
|
2189
|
+
* @param {string} type
|
|
2190
|
+
* @param {Function} callback
|
|
2191
|
+
* @return {Function}
|
|
2192
|
+
*/ // prettier-ignore
|
|
2193
|
+
function listener(element, selector, type, callback) {
|
|
2194
|
+
return function(e) {
|
|
2195
|
+
e.delegateTarget = closest$1(e.target, selector);
|
|
2196
|
+
if (e.delegateTarget) {
|
|
2197
|
+
callback.call(element, e);
|
|
2198
|
+
}
|
|
2199
|
+
};
|
|
2200
|
+
}
|
|
2057
2201
|
|
|
2058
|
-
|
|
2059
|
-
var hasRequiredDist$9;
|
|
2060
|
-
|
|
2061
|
-
function requireDist$9 () {
|
|
2062
|
-
if (hasRequiredDist$9) return dist$9;
|
|
2063
|
-
hasRequiredDist$9 = 1;
|
|
2064
|
-
|
|
2065
|
-
const DOCUMENT_NODE_TYPE = 9;
|
|
2066
|
-
/**
|
|
2067
|
-
* A polyfill for Element.matches()
|
|
2068
|
-
*/ if (typeof Element !== "undefined" && !Element.prototype.matches) {
|
|
2069
|
-
const proto = Element.prototype;
|
|
2070
|
-
proto.matches = (proto == null ? void 0 : proto.matchesSelector) || (proto == null ? void 0 : proto.mozMatchesSelector) || (proto == null ? void 0 : proto.msMatchesSelector) || (proto == null ? void 0 : proto.oMatchesSelector) || (proto == null ? void 0 : proto.webkitMatchesSelector);
|
|
2071
|
-
}
|
|
2072
|
-
/**
|
|
2073
|
-
* Finds the closest parent that matches a selector.
|
|
2074
|
-
*
|
|
2075
|
-
* @param {Element} element
|
|
2076
|
-
* @param {string} selector
|
|
2077
|
-
* @return {Element}
|
|
2078
|
-
*/ function closest(element, selector) {
|
|
2079
|
-
while(element && element.nodeType !== DOCUMENT_NODE_TYPE){
|
|
2080
|
-
if (typeof element.matches === "function" && element.matches(selector)) {
|
|
2081
|
-
return element;
|
|
2082
|
-
}
|
|
2083
|
-
element = element.parentNode;
|
|
2084
|
-
}
|
|
2085
|
-
return null;
|
|
2086
|
-
}
|
|
2087
|
-
/**
|
|
2088
|
-
* Finds the closest parent that matches a selector.
|
|
2089
|
-
*
|
|
2090
|
-
* @param {Element} element
|
|
2091
|
-
* @param {string} selector
|
|
2092
|
-
* @return {Element}
|
|
2093
|
-
*/ function closestNative(element, selector) {
|
|
2094
|
-
return element && element.closest(selector);
|
|
2095
|
-
}
|
|
2096
|
-
var closest$1 = typeof Element.prototype.closest === "function" ? closestNative : closest;
|
|
2097
|
-
|
|
2098
|
-
/**
|
|
2099
|
-
* Delegates event to a selector.
|
|
2100
|
-
*
|
|
2101
|
-
* @param {Element} element
|
|
2102
|
-
* @param {string} selector
|
|
2103
|
-
* @param {string} type
|
|
2104
|
-
* @param {Function} callback
|
|
2105
|
-
* @param {boolean} useCapture
|
|
2106
|
-
* @return {Object}
|
|
2107
|
-
*/ // prettier-ignore
|
|
2108
|
-
function _delegate(element, selector, type, callback, useCapture) {
|
|
2109
|
-
// prettier-ignore
|
|
2110
|
-
const listenerFn = listener.apply(this, arguments);
|
|
2111
|
-
element.addEventListener(type, listenerFn, useCapture);
|
|
2112
|
-
return {
|
|
2113
|
-
destroy: function() {
|
|
2114
|
-
element.removeEventListener(type, listenerFn, useCapture);
|
|
2115
|
-
}
|
|
2116
|
-
};
|
|
2117
|
-
}
|
|
2118
|
-
/**
|
|
2119
|
-
* Delegates event to a selector.
|
|
2120
|
-
*
|
|
2121
|
-
* @param {Element|string|Array} [elements]
|
|
2122
|
-
* @param {string | Element} selector
|
|
2123
|
-
* @param {string} type
|
|
2124
|
-
* @param {Function} callback
|
|
2125
|
-
* @param {boolean} useCapture
|
|
2126
|
-
* @return {Object}
|
|
2127
|
-
* @example
|
|
2128
|
-
* ```ts
|
|
2129
|
-
* const delegation = delegate(document.body, 'a', 'click', function (e) {})
|
|
2130
|
-
* // destroy (removeEventListener)
|
|
2131
|
-
* delegation.destroy();
|
|
2132
|
-
*
|
|
2133
|
-
* const delegation1 = delegate(".btn", "click", function (e) { console.log(e.delegateTarget)},false);
|
|
2134
|
-
* // destroy (removeEventListener)
|
|
2135
|
-
* delegation1.destroy();
|
|
2136
|
-
* ```
|
|
2137
|
-
*/ // prettier-ignore
|
|
2138
|
-
function delegate(elements, selector, type, callback, useCapture) {
|
|
2139
|
-
// Handle the regular Element usage
|
|
2140
|
-
if (typeof elements.addEventListener === "function") {
|
|
2141
|
-
return _delegate.apply(null, arguments);
|
|
2142
|
-
}
|
|
2143
|
-
// Handle Element-less usage, it defaults to global delegation
|
|
2144
|
-
if (typeof type === "function") {
|
|
2145
|
-
// Use `document` as the first parameter, then apply arguments
|
|
2146
|
-
// This is a short way to .unshift `arguments` without running into deoptimizations
|
|
2147
|
-
return _delegate.bind(null, document).apply(null, arguments);
|
|
2148
|
-
}
|
|
2149
|
-
// Handle Selector-based usage
|
|
2150
|
-
if (typeof elements === "string") {
|
|
2151
|
-
elements = document.querySelectorAll(elements);
|
|
2152
|
-
}
|
|
2153
|
-
// Handle Array-like based usage
|
|
2154
|
-
return Array.prototype.map.call(elements, function(element) {
|
|
2155
|
-
return _delegate(element, selector, type, callback, useCapture);
|
|
2156
|
-
});
|
|
2157
|
-
}
|
|
2158
|
-
/**
|
|
2159
|
-
* Finds closest match and invokes callback.
|
|
2160
|
-
*
|
|
2161
|
-
* @param {Element} element
|
|
2162
|
-
* @param {string} selector
|
|
2163
|
-
* @param {string} type
|
|
2164
|
-
* @param {Function} callback
|
|
2165
|
-
* @return {Function}
|
|
2166
|
-
*/ // prettier-ignore
|
|
2167
|
-
function listener(element, selector, type, callback) {
|
|
2168
|
-
return function(e) {
|
|
2169
|
-
e.delegateTarget = closest$1(e.target, selector);
|
|
2170
|
-
if (e.delegateTarget) {
|
|
2171
|
-
callback.call(element, e);
|
|
2172
|
-
}
|
|
2173
|
-
};
|
|
2174
|
-
}
|
|
2202
|
+
return delegate;
|
|
2175
2203
|
|
|
2176
|
-
|
|
2177
|
-
|
|
2204
|
+
}));
|
|
2205
|
+
} (delegate$2));
|
|
2206
|
+
return delegate$2.exports;
|
|
2178
2207
|
}
|
|
2179
2208
|
|
|
2180
|
-
var
|
|
2181
|
-
var delegate = /*@__PURE__*/getDefaultExportFromCjs(
|
|
2209
|
+
var delegateExports = requireDelegate();
|
|
2210
|
+
var delegate = /*@__PURE__*/getDefaultExportFromCjs(delegateExports);
|
|
2182
2211
|
|
|
2183
2212
|
var cjs;
|
|
2184
2213
|
var hasRequiredCjs;
|
|
@@ -2324,25 +2353,25 @@
|
|
|
2324
2353
|
var cjsExports = requireCjs();
|
|
2325
2354
|
var deepmerge = /*@__PURE__*/getDefaultExportFromCjs(cjsExports);
|
|
2326
2355
|
|
|
2327
|
-
var dist$
|
|
2356
|
+
var dist$9 = {};
|
|
2328
2357
|
|
|
2329
2358
|
/*
|
|
2330
|
-
* @ezuikit/utils-tools v2.0.1
|
|
2359
|
+
* @ezuikit/utils-tools v2.0.1
|
|
2331
2360
|
* tools utils
|
|
2332
|
-
* Copyright (c) 2025-
|
|
2361
|
+
* Copyright (c) 2025-12-02 Ezviz-OpenBiz
|
|
2333
2362
|
* Released under the MIT License.
|
|
2334
2363
|
*/
|
|
2335
2364
|
|
|
2336
|
-
var hasRequiredDist$
|
|
2365
|
+
var hasRequiredDist$9;
|
|
2337
2366
|
|
|
2338
|
-
function requireDist$
|
|
2339
|
-
if (hasRequiredDist$
|
|
2340
|
-
hasRequiredDist$
|
|
2341
|
-
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};dist$
|
|
2342
|
-
return dist$
|
|
2367
|
+
function requireDist$9 () {
|
|
2368
|
+
if (hasRequiredDist$9) return dist$9;
|
|
2369
|
+
hasRequiredDist$9 = 1;
|
|
2370
|
+
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$9.DateTime=DateTime,dist$9.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$9.getQuery=getQuery,dist$9.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$9.isHttp=function(url){return /^http[s]?:\/\//.test(url)},dist$9.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$9.parseEzopenUrl=parseEzopenUrl,dist$9.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$9.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};
|
|
2371
|
+
return dist$9;
|
|
2343
2372
|
}
|
|
2344
2373
|
|
|
2345
|
-
var distExports$6 = requireDist$
|
|
2374
|
+
var distExports$6 = requireDist$9();
|
|
2346
2375
|
|
|
2347
2376
|
/**
|
|
2348
2377
|
* 节流函数
|
|
@@ -4056,13 +4085,13 @@
|
|
|
4056
4085
|
return Rec;
|
|
4057
4086
|
}(Control);
|
|
4058
4087
|
|
|
4059
|
-
var dist$
|
|
4088
|
+
var dist$8 = {exports: {}};
|
|
4060
4089
|
|
|
4061
|
-
var hasRequiredDist$
|
|
4090
|
+
var hasRequiredDist$8;
|
|
4062
4091
|
|
|
4063
|
-
function requireDist$
|
|
4064
|
-
if (hasRequiredDist$
|
|
4065
|
-
hasRequiredDist$
|
|
4092
|
+
function requireDist$8 () {
|
|
4093
|
+
if (hasRequiredDist$8) return dist$8.exports;
|
|
4094
|
+
hasRequiredDist$8 = 1;
|
|
4066
4095
|
|
|
4067
4096
|
var deepmerge = requireCjs();
|
|
4068
4097
|
|
|
@@ -4134,19 +4163,19 @@
|
|
|
4134
4163
|
} ]), I18n;
|
|
4135
4164
|
}();
|
|
4136
4165
|
|
|
4137
|
-
I18n.VERSION = "2.0.0", dist$
|
|
4138
|
-
return dist$
|
|
4166
|
+
I18n.VERSION = "2.0.0", dist$8.exports = I18n;
|
|
4167
|
+
return dist$8.exports;
|
|
4139
4168
|
}
|
|
4140
4169
|
|
|
4141
|
-
var distExports$5 = requireDist$
|
|
4170
|
+
var distExports$5 = requireDist$8();
|
|
4142
4171
|
var I18n = /*@__PURE__*/getDefaultExportFromCjs(distExports$5);
|
|
4143
4172
|
|
|
4144
|
-
var dist$
|
|
4145
|
-
var hasRequiredDist$
|
|
4173
|
+
var dist$7;
|
|
4174
|
+
var hasRequiredDist$7;
|
|
4146
4175
|
|
|
4147
|
-
function requireDist$
|
|
4148
|
-
if (hasRequiredDist$
|
|
4149
|
-
hasRequiredDist$
|
|
4176
|
+
function requireDist$7 () {
|
|
4177
|
+
if (hasRequiredDist$7) return dist$7;
|
|
4178
|
+
hasRequiredDist$7 = 1;
|
|
4150
4179
|
|
|
4151
4180
|
var _$LoggerStyle$_ = {
|
|
4152
4181
|
info: "",
|
|
@@ -4211,7 +4240,7 @@
|
|
|
4211
4240
|
|
|
4212
4241
|
var __$list$__ = [ "info", "log", "warn", "error" ];
|
|
4213
4242
|
|
|
4214
|
-
dist$
|
|
4243
|
+
dist$7 = function(options) {
|
|
4215
4244
|
var logger = new LoggerCls(options);
|
|
4216
4245
|
return new Proxy(logger, {
|
|
4217
4246
|
get: function(target, prop) {
|
|
@@ -4230,10 +4259,10 @@
|
|
|
4230
4259
|
}
|
|
4231
4260
|
});
|
|
4232
4261
|
};
|
|
4233
|
-
return dist$
|
|
4262
|
+
return dist$7;
|
|
4234
4263
|
}
|
|
4235
4264
|
|
|
4236
|
-
var distExports$4 = requireDist$
|
|
4265
|
+
var distExports$4 = requireDist$7();
|
|
4237
4266
|
var Logger = /*@__PURE__*/getDefaultExportFromCjs(distExports$4);
|
|
4238
4267
|
|
|
4239
4268
|
var zh = {
|
|
@@ -5664,11 +5693,11 @@
|
|
|
5664
5693
|
// 对讲
|
|
5665
5694
|
// =======================================================
|
|
5666
5695
|
theme.on(EVENTS.talkingChange, function(talking) {
|
|
5667
|
-
var _theme_controls_talkControl,
|
|
5696
|
+
var _theme_controls, _theme_controls_talkControl, _theme_controls1;
|
|
5668
5697
|
theme._talking = talking;
|
|
5669
|
-
if (talking !== ((
|
|
5670
|
-
var _theme_controls_talkControl1,
|
|
5671
|
-
(
|
|
5698
|
+
if (((_theme_controls = theme.controls) == null ? void 0 : _theme_controls.talkControl) && talking !== ((_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_talkControl = _theme_controls1.talkControl) == null ? void 0 : _theme_controls_talkControl.active)) {
|
|
5699
|
+
var _theme_controls_talkControl1, _theme_controls2;
|
|
5700
|
+
(_theme_controls2 = theme.controls) == null ? void 0 : (_theme_controls_talkControl1 = _theme_controls2.talkControl) == null ? void 0 : _theme_controls_talkControl1.emit(EVENTS.talkingChange, talking);
|
|
5672
5701
|
}
|
|
5673
5702
|
});
|
|
5674
5703
|
theme.on(EVENTS.talkVolumeChange, function(value) {
|
|
@@ -5698,14 +5727,14 @@
|
|
|
5698
5727
|
// 放大
|
|
5699
5728
|
// =======================================================
|
|
5700
5729
|
theme.on(EVENTS.zoomingChange, function(zooming) {
|
|
5701
|
-
var _theme_controls_zoomControl1,
|
|
5702
|
-
if (((_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_zoomControl1 =
|
|
5730
|
+
var _theme_controls1, _theme_controls_zoomControl1, _theme_controls2;
|
|
5731
|
+
if (((_theme_controls1 = theme.controls) == null ? void 0 : _theme_controls1.zoomControl) && ((_theme_controls2 = theme.controls) == null ? void 0 : (_theme_controls_zoomControl1 = _theme_controls2.zoomControl) == null ? void 0 : _theme_controls_zoomControl1.active) !== zooming) {
|
|
5703
5732
|
theme.controls.zoomControl.active = zooming;
|
|
5704
5733
|
}
|
|
5705
5734
|
});
|
|
5706
5735
|
theme.on(EVENTS.zoomChange, function(zoom) {
|
|
5707
|
-
var _theme_controls_zoomControl,
|
|
5708
|
-
if (((_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_zoomControl =
|
|
5736
|
+
var _theme_controls, _theme_controls_zoomControl, _theme_controls1;
|
|
5737
|
+
if (((_theme_controls = theme.controls) == null ? void 0 : _theme_controls.zoomControl) && ((_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_zoomControl = _theme_controls1.zoomControl) == null ? void 0 : _theme_controls_zoomControl.value) !== zoom) {
|
|
5709
5738
|
theme.controls.zoomControl.value = zoom;
|
|
5710
5739
|
}
|
|
5711
5740
|
});
|
|
@@ -5756,6 +5785,11 @@
|
|
|
5756
5785
|
(_theme_zoomUtil1 = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform1 = _theme_zoomUtil1.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform1.call(_theme_zoomUtil1, false);
|
|
5757
5786
|
}
|
|
5758
5787
|
});
|
|
5788
|
+
// 日期选择器
|
|
5789
|
+
theme == null ? void 0 : theme.on(EVENTS.control.dateMonthChange, function(dates) {
|
|
5790
|
+
var _theme_controls_dateControl_emit, _theme_controls_dateControl, _theme_controls;
|
|
5791
|
+
(_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_dateControl = _theme_controls.dateControl) == null ? void 0 : (_theme_controls_dateControl_emit = _theme_controls_dateControl.emit) == null ? void 0 : _theme_controls_dateControl_emit.call(_theme_controls_dateControl, EVENTS.control.dateMonthChange, dates);
|
|
5792
|
+
});
|
|
5759
5793
|
}
|
|
5760
5794
|
/**
|
|
5761
5795
|
* 控件向主题发现通信消息 control.on -> theme.emit ,仅用来转发控件的事件
|
|
@@ -5954,10 +5988,10 @@
|
|
|
5954
5988
|
theme.emit(EVENTS.control.timeLineChange, date);
|
|
5955
5989
|
});
|
|
5956
5990
|
theme.controls.timeLineControl.on(EVENTS.control.timeLinePanelOpenChange, function(open) {
|
|
5957
|
-
var _theme_controls_dateControl;
|
|
5958
|
-
if ((
|
|
5959
|
-
var
|
|
5960
|
-
(
|
|
5991
|
+
var _theme_controls_dateControl, _theme_controls;
|
|
5992
|
+
if ((_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_dateControl = _theme_controls.dateControl) == null ? void 0 : _theme_controls_dateControl.datePicker) {
|
|
5993
|
+
var _theme_controls_dateControl_datePicker, _theme_controls_dateControl1, _theme_controls1;
|
|
5994
|
+
(_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_dateControl1 = _theme_controls1.dateControl) == null ? void 0 : (_theme_controls_dateControl_datePicker = _theme_controls_dateControl1.datePicker) == null ? void 0 : _theme_controls_dateControl_datePicker.hide();
|
|
5961
5995
|
}
|
|
5962
5996
|
theme.emit(EVENTS.control.timeLinePanelOpenChange, open);
|
|
5963
5997
|
});
|
|
@@ -6246,12 +6280,12 @@
|
|
|
6246
6280
|
* Released under the MIT License.
|
|
6247
6281
|
*/
|
|
6248
6282
|
|
|
6249
|
-
var dist$
|
|
6250
|
-
var hasRequiredDist$
|
|
6283
|
+
var dist$6;
|
|
6284
|
+
var hasRequiredDist$6;
|
|
6251
6285
|
|
|
6252
|
-
function requireDist$
|
|
6253
|
-
if (hasRequiredDist$
|
|
6254
|
-
hasRequiredDist$
|
|
6286
|
+
function requireDist$6 () {
|
|
6287
|
+
if (hasRequiredDist$6) return dist$6;
|
|
6288
|
+
hasRequiredDist$6 = 1;
|
|
6255
6289
|
|
|
6256
6290
|
/**
|
|
6257
6291
|
* Zoom position
|
|
@@ -6958,11 +6992,11 @@
|
|
|
6958
6992
|
}();
|
|
6959
6993
|
Zoom.VERSION = '0.0.2';
|
|
6960
6994
|
|
|
6961
|
-
dist$
|
|
6962
|
-
return dist$
|
|
6995
|
+
dist$6 = Zoom;
|
|
6996
|
+
return dist$6;
|
|
6963
6997
|
}
|
|
6964
6998
|
|
|
6965
|
-
var distExports$3 = requireDist$
|
|
6999
|
+
var distExports$3 = requireDist$6();
|
|
6966
7000
|
var Zoom = /*@__PURE__*/getDefaultExportFromCjs(distExports$3);
|
|
6967
7001
|
|
|
6968
7002
|
function _extends$h() {
|
|
@@ -8038,9 +8072,9 @@
|
|
|
8038
8072
|
return CapturePicture;
|
|
8039
8073
|
}(Control);
|
|
8040
8074
|
|
|
8041
|
-
var dist$
|
|
8075
|
+
var dist$5 = {};
|
|
8042
8076
|
|
|
8043
|
-
var dist$
|
|
8077
|
+
var dist$4 = {};
|
|
8044
8078
|
|
|
8045
8079
|
/*
|
|
8046
8080
|
* @ezuikit/utils-tools v1.1.1-beta.1
|
|
@@ -8049,13 +8083,13 @@
|
|
|
8049
8083
|
* Released under the MIT License.
|
|
8050
8084
|
*/
|
|
8051
8085
|
|
|
8052
|
-
var hasRequiredDist$
|
|
8086
|
+
var hasRequiredDist$5;
|
|
8053
8087
|
|
|
8054
|
-
function requireDist$
|
|
8055
|
-
if (hasRequiredDist$
|
|
8056
|
-
hasRequiredDist$
|
|
8057
|
-
const getQuery=url=>{const query=url.split("?")[1],obj={};if(query){const vars=query.split("&");for(let i=0;i<vars.length;i++){const pair=vars[i].split("=");obj[pair[0]]=decodeURIComponent(pair[1]);}}return obj};function parseEzopenUrl(url){const obj={};if(/^ezopen:\/\//.test(url)){if(url.includes("@")){const 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;const 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 {}}const codec={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32};dist$
|
|
8058
|
-
return dist$
|
|
8088
|
+
function requireDist$5 () {
|
|
8089
|
+
if (hasRequiredDist$5) return dist$4;
|
|
8090
|
+
hasRequiredDist$5 = 1;
|
|
8091
|
+
const getQuery=url=>{const query=url.split("?")[1],obj={};if(query){const vars=query.split("&");for(let i=0;i<vars.length;i++){const pair=vars[i].split("=");obj[pair[0]]=decodeURIComponent(pair[1]);}}return obj};function parseEzopenUrl(url){const obj={};if(/^ezopen:\/\//.test(url)){if(url.includes("@")){const 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;const 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 {}}const codec={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32};dist$4.addVc=function(url){const vc=((arguments.length>1&&void 0!==arguments[1]?arguments[1]:["h264"])||["h264"]).reduce(((acc,key)=>(key=key.toLowerCase(),acc+(codec[key]||0))),0),host=url.split("?")[0];let query=url.split("?")[1];return query=(query||"").split("&").filter((item=>!/^vc=\d?/.test(item))).join("&"),query+=`${query?"&":""}vc=${vc}`,host+"?"+query},dist$4.getQuery=getQuery,dist$4.getStaticPath=function(path){let base=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const 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(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(((acc,_ref)=>{let[key,value]=_ref;return keys.includes(key)&&(acc[key]=value),acc}),{})},dist$4.switchEzopenUrl=function(url,options){let{type:type,recType:recType,search:search,definition:definition,channelNo:channelNo,deviceSerial:deviceSerial,validateCode:validateCode}=null!=options?options:{};const obj=parseEzopenUrl(url);if(search){const ns=Object.assign({},obj.searchParams,getQuery("?"+search.replace("?","")));search=Object.entries(ns).reduce(((acc,_ref)=>{let[key,value]=_ref;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}`};
|
|
8092
|
+
return dist$4;
|
|
8059
8093
|
}
|
|
8060
8094
|
|
|
8061
8095
|
/*
|
|
@@ -8064,14 +8098,14 @@
|
|
|
8064
8098
|
* Released under the MIT License.
|
|
8065
8099
|
*/
|
|
8066
8100
|
|
|
8067
|
-
var hasRequiredDist$
|
|
8101
|
+
var hasRequiredDist$4;
|
|
8068
8102
|
|
|
8069
|
-
function requireDist$
|
|
8070
|
-
if (hasRequiredDist$
|
|
8071
|
-
hasRequiredDist$
|
|
8103
|
+
function requireDist$4 () {
|
|
8104
|
+
if (hasRequiredDist$4) return dist$5;
|
|
8105
|
+
hasRequiredDist$4 = 1;
|
|
8072
8106
|
|
|
8073
8107
|
var deepmerge = requireCjs();
|
|
8074
|
-
var utilsTools = requireDist$
|
|
8108
|
+
var utilsTools = requireDist$5();
|
|
8075
8109
|
|
|
8076
8110
|
var en_US = {
|
|
8077
8111
|
GET_PTZ_STATUS: 'Get current PTZ status',
|
|
@@ -8991,13 +9025,13 @@
|
|
|
8991
9025
|
return Ptz;
|
|
8992
9026
|
}(BasePtz);
|
|
8993
9027
|
|
|
8994
|
-
dist$
|
|
8995
|
-
dist$
|
|
8996
|
-
dist$
|
|
8997
|
-
return dist$
|
|
9028
|
+
dist$5.BasePtz = BasePtz;
|
|
9029
|
+
dist$5.MobilePtz = MobilePtz;
|
|
9030
|
+
dist$5.Ptz = Ptz;
|
|
9031
|
+
return dist$5;
|
|
8998
9032
|
}
|
|
8999
9033
|
|
|
9000
|
-
var distExports$2 = requireDist$
|
|
9034
|
+
var distExports$2 = requireDist$4();
|
|
9001
9035
|
|
|
9002
9036
|
function _defineProperties$4(target, props) {
|
|
9003
9037
|
for(var i = 0; i < props.length; i++){
|
|
@@ -10148,9 +10182,7 @@
|
|
|
10148
10182
|
0.5,
|
|
10149
10183
|
1,
|
|
10150
10184
|
2,
|
|
10151
|
-
4
|
|
10152
|
-
8,
|
|
10153
|
-
16
|
|
10185
|
+
4
|
|
10154
10186
|
]; // 8, 16
|
|
10155
10187
|
var SPEED_DEFAULT_OPTIONS = {
|
|
10156
10188
|
/**
|
|
@@ -10210,540 +10242,24 @@
|
|
|
10210
10242
|
return Speed;
|
|
10211
10243
|
}(Select);
|
|
10212
10244
|
|
|
10245
|
+
var dist$3 = {};
|
|
10246
|
+
|
|
10213
10247
|
/*
|
|
10214
|
-
* @ezuikit/control-date-picker
|
|
10215
|
-
* Copyright (c) 2025-
|
|
10248
|
+
* @ezuikit/control-date-picker v1.0.2
|
|
10249
|
+
* Copyright (c) 2025-12-08 Ezviz-OpenBiz
|
|
10216
10250
|
* Released under the MIT License.
|
|
10217
10251
|
*/
|
|
10218
10252
|
|
|
10219
|
-
var
|
|
10220
|
-
var hasRequiredDist$2;
|
|
10253
|
+
var hasRequiredDist$3;
|
|
10221
10254
|
|
|
10222
|
-
function requireDist$
|
|
10223
|
-
if (hasRequiredDist$
|
|
10224
|
-
hasRequiredDist$
|
|
10255
|
+
function requireDist$3 () {
|
|
10256
|
+
if (hasRequiredDist$3) return dist$3;
|
|
10257
|
+
hasRequiredDist$3 = 1;
|
|
10258
|
+
var delegate=requireDelegate(),utilsTools=requireDist$9(),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)&&(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)&&(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;
|
|
10259
|
+
return dist$3;
|
|
10260
|
+
}
|
|
10225
10261
|
|
|
10226
|
-
|
|
10227
|
-
try {
|
|
10228
|
-
var info = gen[key](arg);
|
|
10229
|
-
var value = info.value;
|
|
10230
|
-
} catch (error) {
|
|
10231
|
-
reject(error);
|
|
10232
|
-
return;
|
|
10233
|
-
}
|
|
10234
|
-
if (info.done) {
|
|
10235
|
-
resolve(value);
|
|
10236
|
-
} else {
|
|
10237
|
-
Promise.resolve(value).then(_next, _throw);
|
|
10238
|
-
}
|
|
10239
|
-
}
|
|
10240
|
-
function _async_to_generator(fn) {
|
|
10241
|
-
return function() {
|
|
10242
|
-
var self = this, args = arguments;
|
|
10243
|
-
return new Promise(function(resolve, reject) {
|
|
10244
|
-
var gen = fn.apply(self, args);
|
|
10245
|
-
function _next(value) {
|
|
10246
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
10247
|
-
}
|
|
10248
|
-
function _throw(err) {
|
|
10249
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
10250
|
-
}
|
|
10251
|
-
_next(undefined);
|
|
10252
|
-
});
|
|
10253
|
-
};
|
|
10254
|
-
}
|
|
10255
|
-
function _ts_generator(thisArg, body) {
|
|
10256
|
-
var f, y, t, _ = {
|
|
10257
|
-
label: 0,
|
|
10258
|
-
sent: function() {
|
|
10259
|
-
if (t[0] & 1) throw t[1];
|
|
10260
|
-
return t[1];
|
|
10261
|
-
},
|
|
10262
|
-
trys: [],
|
|
10263
|
-
ops: []
|
|
10264
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
10265
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
10266
|
-
return this;
|
|
10267
|
-
}), g;
|
|
10268
|
-
function verb(n) {
|
|
10269
|
-
return function(v) {
|
|
10270
|
-
return step([
|
|
10271
|
-
n,
|
|
10272
|
-
v
|
|
10273
|
-
]);
|
|
10274
|
-
};
|
|
10275
|
-
}
|
|
10276
|
-
function step(op) {
|
|
10277
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
10278
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
10279
|
-
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;
|
|
10280
|
-
if (y = 0, t) op = [
|
|
10281
|
-
op[0] & 2,
|
|
10282
|
-
t.value
|
|
10283
|
-
];
|
|
10284
|
-
switch(op[0]){
|
|
10285
|
-
case 0:
|
|
10286
|
-
case 1:
|
|
10287
|
-
t = op;
|
|
10288
|
-
break;
|
|
10289
|
-
case 4:
|
|
10290
|
-
_.label++;
|
|
10291
|
-
return {
|
|
10292
|
-
value: op[1],
|
|
10293
|
-
done: false
|
|
10294
|
-
};
|
|
10295
|
-
case 5:
|
|
10296
|
-
_.label++;
|
|
10297
|
-
y = op[1];
|
|
10298
|
-
op = [
|
|
10299
|
-
0
|
|
10300
|
-
];
|
|
10301
|
-
continue;
|
|
10302
|
-
case 7:
|
|
10303
|
-
op = _.ops.pop();
|
|
10304
|
-
_.trys.pop();
|
|
10305
|
-
continue;
|
|
10306
|
-
default:
|
|
10307
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
10308
|
-
_ = 0;
|
|
10309
|
-
continue;
|
|
10310
|
-
}
|
|
10311
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
10312
|
-
_.label = op[1];
|
|
10313
|
-
break;
|
|
10314
|
-
}
|
|
10315
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
10316
|
-
_.label = t[1];
|
|
10317
|
-
t = op;
|
|
10318
|
-
break;
|
|
10319
|
-
}
|
|
10320
|
-
if (t && _.label < t[2]) {
|
|
10321
|
-
_.label = t[2];
|
|
10322
|
-
_.ops.push(op);
|
|
10323
|
-
break;
|
|
10324
|
-
}
|
|
10325
|
-
if (t[2]) _.ops.pop();
|
|
10326
|
-
_.trys.pop();
|
|
10327
|
-
continue;
|
|
10328
|
-
}
|
|
10329
|
-
op = body.call(thisArg, _);
|
|
10330
|
-
} catch (e) {
|
|
10331
|
-
op = [
|
|
10332
|
-
6,
|
|
10333
|
-
e
|
|
10334
|
-
];
|
|
10335
|
-
y = 0;
|
|
10336
|
-
} finally{
|
|
10337
|
-
f = t = 0;
|
|
10338
|
-
}
|
|
10339
|
-
if (op[0] & 5) throw op[1];
|
|
10340
|
-
return {
|
|
10341
|
-
value: op[0] ? op[1] : void 0,
|
|
10342
|
-
done: true
|
|
10343
|
-
};
|
|
10344
|
-
}
|
|
10345
|
-
}
|
|
10346
|
-
var AppendJS = /*#__PURE__*/ function() {
|
|
10347
|
-
function AppendJS() {}
|
|
10348
|
-
AppendJS.loadScript = function loadScript(src) {
|
|
10349
|
-
return _async_to_generator(function() {
|
|
10350
|
-
return _ts_generator(this, function(_state) {
|
|
10351
|
-
switch(_state.label){
|
|
10352
|
-
case 0:
|
|
10353
|
-
return [
|
|
10354
|
-
4,
|
|
10355
|
-
new Promise(function(resolve, reject) {
|
|
10356
|
-
if (AppendJS.LoadedScr.includes(src)) {
|
|
10357
|
-
return resolve(src);
|
|
10358
|
-
}
|
|
10359
|
-
if (AppendJS.LoadingScrQueue[src]) {
|
|
10360
|
-
return AppendJS.LoadingScrQueue[src].push(resolve);
|
|
10361
|
-
} else {
|
|
10362
|
-
AppendJS.LoadingScrQueue[src] = [
|
|
10363
|
-
resolve
|
|
10364
|
-
];
|
|
10365
|
-
}
|
|
10366
|
-
var link;
|
|
10367
|
-
if (src.includes('.js')) {
|
|
10368
|
-
link = document.createElement('script');
|
|
10369
|
-
link.src = src;
|
|
10370
|
-
link.async = true;
|
|
10371
|
-
} else if (src.includes('.css')) {
|
|
10372
|
-
link = document.createElement('link');
|
|
10373
|
-
link.rel = 'stylesheet';
|
|
10374
|
-
link.href = src;
|
|
10375
|
-
}
|
|
10376
|
-
link.onload = function() {
|
|
10377
|
-
AppendJS.LoadedScr.push(src);
|
|
10378
|
-
AppendJS.LoadingScrQueue[src].forEach(function(resolve) {
|
|
10379
|
-
return resolve(src);
|
|
10380
|
-
});
|
|
10381
|
-
AppendJS.LoadingScrQueue[src] = [];
|
|
10382
|
-
};
|
|
10383
|
-
link.onerror = function() {
|
|
10384
|
-
return reject(new Error('Failed to load ' + src));
|
|
10385
|
-
};
|
|
10386
|
-
document.head.appendChild(link);
|
|
10387
|
-
})
|
|
10388
|
-
];
|
|
10389
|
-
case 1:
|
|
10390
|
-
return [
|
|
10391
|
-
2,
|
|
10392
|
-
_state.sent()
|
|
10393
|
-
];
|
|
10394
|
-
}
|
|
10395
|
-
});
|
|
10396
|
-
})();
|
|
10397
|
-
};
|
|
10398
|
-
AppendJS.loadScriptsBatch = function loadScriptsBatch(srcArr) {
|
|
10399
|
-
return _async_to_generator(function() {
|
|
10400
|
-
return _ts_generator(this, function(_state) {
|
|
10401
|
-
switch(_state.label){
|
|
10402
|
-
case 0:
|
|
10403
|
-
return [
|
|
10404
|
-
4,
|
|
10405
|
-
Promise.all(srcArr.map(AppendJS.loadScript))
|
|
10406
|
-
];
|
|
10407
|
-
case 1:
|
|
10408
|
-
return [
|
|
10409
|
-
2,
|
|
10410
|
-
_state.sent()
|
|
10411
|
-
];
|
|
10412
|
-
}
|
|
10413
|
-
});
|
|
10414
|
-
})();
|
|
10415
|
-
};
|
|
10416
|
-
AppendJS.remove = function remove(src) {
|
|
10417
|
-
src.forEach(function(item) {
|
|
10418
|
-
var link = document.querySelector('script[src="' + item + '"]') || document.querySelector('link[href="' + item + '"]');
|
|
10419
|
-
if (link) {
|
|
10420
|
-
link.remove();
|
|
10421
|
-
}
|
|
10422
|
-
});
|
|
10423
|
-
};
|
|
10424
|
-
AppendJS.clear = function clear() {
|
|
10425
|
-
AppendJS.remove(AppendJS.LoadedScr);
|
|
10426
|
-
};
|
|
10427
|
-
return AppendJS;
|
|
10428
|
-
}();
|
|
10429
|
-
/** 已经加载完的js/css */ AppendJS.LoadedScr = [];
|
|
10430
|
-
/** 正在加载的js/css */ AppendJS.LoadingScrQueue = {};
|
|
10431
|
-
|
|
10432
|
-
function _defineProperties(target, props) {
|
|
10433
|
-
for(var i = 0; i < props.length; i++){
|
|
10434
|
-
var descriptor = props[i];
|
|
10435
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
10436
|
-
descriptor.configurable = true;
|
|
10437
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
10438
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
10439
|
-
}
|
|
10440
|
-
}
|
|
10441
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
10442
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
10443
|
-
return Constructor;
|
|
10444
|
-
}
|
|
10445
|
-
var DEFAULT_OPTIONS = {
|
|
10446
|
-
staticPath: '.',
|
|
10447
|
-
place: 'top-right',
|
|
10448
|
-
language: 'zh-CN',
|
|
10449
|
-
current: new Date(),
|
|
10450
|
-
maxDate: new Date()
|
|
10451
|
-
};
|
|
10452
|
-
/**
|
|
10453
|
-
* 日期选择器
|
|
10454
|
-
*/ var DatePicker = /*#__PURE__*/ function() {
|
|
10455
|
-
function DatePicker(container, options) {
|
|
10456
|
-
var _this = this;
|
|
10457
|
-
this._open = false;
|
|
10458
|
-
this._change = true;
|
|
10459
|
-
this.$container = container;
|
|
10460
|
-
this.options = Object.assign({}, DEFAULT_OPTIONS, options);
|
|
10461
|
-
this.options.staticPath = (this.options.staticPath || '').replace(/\/$/, '');
|
|
10462
|
-
if (this.options.current) {
|
|
10463
|
-
this._date = this.options.current;
|
|
10464
|
-
}
|
|
10465
|
-
this._init();
|
|
10466
|
-
this.$container.addEventListener('click', function() {
|
|
10467
|
-
if (_this._open) _this.hide();
|
|
10468
|
-
else _this.show();
|
|
10469
|
-
});
|
|
10470
|
-
document.body.addEventListener('click', function(e) {
|
|
10471
|
-
if (!_this.$container.contains(e.target)) {
|
|
10472
|
-
_this.hide();
|
|
10473
|
-
}
|
|
10474
|
-
});
|
|
10475
|
-
}
|
|
10476
|
-
var _proto = DatePicker.prototype;
|
|
10477
|
-
_proto._init = function _init() {
|
|
10478
|
-
var _this = this;
|
|
10479
|
-
// 因为挂载在行内,需要父标签设置 position: relative;
|
|
10480
|
-
this.$container.style.cssText += ";position: relative;";
|
|
10481
|
-
this.$container.classList.add("datepicker-inline-" + this.options.place);
|
|
10482
|
-
AppendJS.loadScriptsBatch([
|
|
10483
|
-
"" + this.options.staticPath + "/rec/jquery.min.js",
|
|
10484
|
-
"" + this.options.staticPath + "/rec/datepicker.min.css"
|
|
10485
|
-
]).then(function() {
|
|
10486
|
-
AppendJS.loadScriptsBatch([
|
|
10487
|
-
"" + _this.options.staticPath + "/rec/datepicker.js"
|
|
10488
|
-
]).then(function() {
|
|
10489
|
-
AppendJS.loadScriptsBatch([
|
|
10490
|
-
"" + _this.options.staticPath + "/rec/datepicker.zh-CN.js",
|
|
10491
|
-
"" + _this.options.staticPath + "/rec/datepicker.en-US.js"
|
|
10492
|
-
]).then(function() {
|
|
10493
|
-
window.$(_this.$container).datepicker({
|
|
10494
|
-
date: _this.options.current,
|
|
10495
|
-
language: _this.options.language,
|
|
10496
|
-
endDate: _this.options.maxDate,
|
|
10497
|
-
inline: true
|
|
10498
|
-
});
|
|
10499
|
-
_this.hide();
|
|
10500
|
-
window.$(_this.$container).on('pick.datepicker', function(e) {
|
|
10501
|
-
var _this__date, _this__date1, _this__date2, _this__date3, _this__date4, _this__date5;
|
|
10502
|
-
if (e.view === 'year' && ((_this__date = _this._date) == null ? void 0 : _this__date.getFullYear()) !== e.date.getFullYear()) {
|
|
10503
|
-
_this.options.onYearChange == null ? void 0 : _this.options.onYearChange.call(_this.options, e.date);
|
|
10504
|
-
} else if (e.view === 'month' && (((_this__date1 = _this._date) == null ? void 0 : _this__date1.getMonth()) !== e.date.getMonth() || ((_this__date2 = _this._date) == null ? void 0 : _this__date2.getFullYear()) !== e.date.getFullYear())) {
|
|
10505
|
-
_this.options.onMonthChange == null ? void 0 : _this.options.onMonthChange.call(_this.options, e.date);
|
|
10506
|
-
} else if ([
|
|
10507
|
-
'day',
|
|
10508
|
-
'pick'
|
|
10509
|
-
].includes(e.view || e.type) && (((_this__date3 = _this._date) == null ? void 0 : _this__date3.getDate()) !== e.date.getDate() || ((_this__date4 = _this._date) == null ? void 0 : _this__date4.getMonth()) !== e.date.getMonth() || ((_this__date5 = _this._date) == null ? void 0 : _this__date5.getFullYear()) !== e.date.getFullYear())) {
|
|
10510
|
-
if (_this._change) {
|
|
10511
|
-
_this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, e.date);
|
|
10512
|
-
}
|
|
10513
|
-
_this._date = new Date(e.date.getTime());
|
|
10514
|
-
}
|
|
10515
|
-
if (e.view === 'day') _this.hide();
|
|
10516
|
-
_this._change = true;
|
|
10517
|
-
});
|
|
10518
|
-
});
|
|
10519
|
-
});
|
|
10520
|
-
});
|
|
10521
|
-
};
|
|
10522
|
-
/**
|
|
10523
|
-
* 设置日期, change = true 时触发 onChange 事件
|
|
10524
|
-
*
|
|
10525
|
-
* @param date 设置的日期
|
|
10526
|
-
* @param change 是否触发 onChange 事件
|
|
10527
|
-
*/ _proto.setDate = function setDate(date, change) {
|
|
10528
|
-
if (change === void 0) change = true;
|
|
10529
|
-
var $datepicker = this.$container.querySelector(".datepicker-inline");
|
|
10530
|
-
if ($datepicker) {
|
|
10531
|
-
this._change = change;
|
|
10532
|
-
window.$(this.$container).datepicker('setDate', date);
|
|
10533
|
-
}
|
|
10534
|
-
};
|
|
10535
|
-
/**
|
|
10536
|
-
* 隐藏面板, 会触发 onPanelChange 事件
|
|
10537
|
-
*/ _proto.hide = function hide() {
|
|
10538
|
-
var $datepicker = this.$container.querySelector(".datepicker-inline");
|
|
10539
|
-
if ($datepicker) {
|
|
10540
|
-
if (this._open) {
|
|
10541
|
-
this._open = false;
|
|
10542
|
-
this.options.onPanelChange == null ? void 0 : this.options.onPanelChange.call(this.options, false, this._date);
|
|
10543
|
-
}
|
|
10544
|
-
$datepicker.classList.add('datepicker-hide');
|
|
10545
|
-
}
|
|
10546
|
-
};
|
|
10547
|
-
/**
|
|
10548
|
-
* 显示面板, 会触发 onPanelChange 事件
|
|
10549
|
-
*/ _proto.show = function show() {
|
|
10550
|
-
var $datepicker = this.$container.querySelector(".datepicker-inline");
|
|
10551
|
-
if ($datepicker) {
|
|
10552
|
-
var _window_$_datepicker, _window_$;
|
|
10553
|
-
if (!this._open) {
|
|
10554
|
-
this._open = true;
|
|
10555
|
-
this.options.onPanelChange == null ? void 0 : this.options.onPanelChange.call(this.options, true, this._date);
|
|
10556
|
-
}
|
|
10557
|
-
if (this._date) this.setDate(this._date, false);
|
|
10558
|
-
(_window_$_datepicker = (_window_$ = window.$(this.$container)).datepicker) == null ? void 0 : _window_$_datepicker.call(_window_$, 'showView');
|
|
10559
|
-
if (this.options.place === 'bottom-left') {
|
|
10560
|
-
$datepicker.style.cssText += "top: " + (this.$container.clientHeight + 10) + "px; bottom: auto; right: auto; left: 0px";
|
|
10561
|
-
} else {
|
|
10562
|
-
$datepicker.style.cssText += "bottom: " + (this.$container.clientHeight + 10) + "px; top: auto";
|
|
10563
|
-
}
|
|
10564
|
-
$datepicker.classList.remove('datepicker-hide');
|
|
10565
|
-
}
|
|
10566
|
-
};
|
|
10567
|
-
/**
|
|
10568
|
-
* 销毁
|
|
10569
|
-
*/ _proto.destroy = function destroy() {
|
|
10570
|
-
this.hide();
|
|
10571
|
-
this._date = undefined;
|
|
10572
|
-
window.$(this.$container).datepicker('destroy');
|
|
10573
|
-
// AppendJS.remove([
|
|
10574
|
-
// `${this.options.staticPath}/rec/jquery.min.js`,
|
|
10575
|
-
// `${this.options.staticPath}/rec/datepicker.min.css`,
|
|
10576
|
-
// `${this.options.staticPath}/rec/datepicker.js`,
|
|
10577
|
-
// `${this.options.staticPath}/rec/datepicker.zh-CN.js`,
|
|
10578
|
-
// `${this.options.staticPath}/rec/datepicker.en-US.js`,
|
|
10579
|
-
// ]);
|
|
10580
|
-
};
|
|
10581
|
-
_create_class(DatePicker, [
|
|
10582
|
-
{
|
|
10583
|
-
key: "date",
|
|
10584
|
-
get: /**
|
|
10585
|
-
* 获取日期
|
|
10586
|
-
*/ function get() {
|
|
10587
|
-
return this._date;
|
|
10588
|
-
}
|
|
10589
|
-
}
|
|
10590
|
-
]);
|
|
10591
|
-
return DatePicker;
|
|
10592
|
-
}();
|
|
10593
|
-
|
|
10594
|
-
dist$2 = DatePicker;
|
|
10595
|
-
return dist$2;
|
|
10596
|
-
}
|
|
10597
|
-
|
|
10598
|
-
var distExports$1 = requireDist$2();
|
|
10599
|
-
var DatePickerUtil = /*@__PURE__*/getDefaultExportFromCjs(distExports$1);
|
|
10600
|
-
|
|
10601
|
-
/**
|
|
10602
|
-
* @description 时间操作
|
|
10603
|
-
*/ var DateTime = /*#__PURE__*/ function() {
|
|
10604
|
-
function DateTime() {}
|
|
10605
|
-
/**
|
|
10606
|
-
* @description 时间格式化
|
|
10607
|
-
* @param {Date | number | string} date
|
|
10608
|
-
* @param {string} formatType 格式 'YYYY-MM-DD hh:mm:ss' 或 'YYYYMMDDhhmmss' 或 'YYYY/MM/DD hh:mm:ss' 或 'hh:mm:ss' 或 'YYYYMMDDThhmmssZ'
|
|
10609
|
-
* @param {number} timeZone 时区偏移量 默认 0
|
|
10610
|
-
*/ DateTime.formate = function formate(date, formatType, timeZone) {
|
|
10611
|
-
if (timeZone === void 0) timeZone = 0;
|
|
10612
|
-
var dateTime = date;
|
|
10613
|
-
if (typeof date === 'string') {
|
|
10614
|
-
dateTime = DateTime.strToDate(date);
|
|
10615
|
-
} else if (typeof date === 'number') {
|
|
10616
|
-
dateTime = new Date(date);
|
|
10617
|
-
}
|
|
10618
|
-
dateTime = new Date(dateTime.getTime() - timeZone * 3600 * 1000);
|
|
10619
|
-
var year = dateTime.getFullYear();
|
|
10620
|
-
var month = String(dateTime.getMonth() + 1).padStart(2, '0');
|
|
10621
|
-
var day = String(dateTime.getDate()).padStart(2, '0');
|
|
10622
|
-
var hours = String(dateTime.getHours()).padStart(2, '0');
|
|
10623
|
-
var minutes = String(dateTime.getMinutes()).padStart(2, '0');
|
|
10624
|
-
var seconds = String(dateTime.getSeconds()).padStart(2, '0');
|
|
10625
|
-
switch(formatType){
|
|
10626
|
-
case 'YYYY-MM-DD hh:mm:ss':
|
|
10627
|
-
return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
|
|
10628
|
-
case 'YYYYMMDDhhmmss':
|
|
10629
|
-
return "" + year + month + day + hours + minutes + seconds;
|
|
10630
|
-
case 'YYYY/MM/DD hh:mm:ss':
|
|
10631
|
-
return year + "/" + month + "/" + day + " " + hours + ":" + minutes + ":" + seconds;
|
|
10632
|
-
case 'YYYYMMDDThhmmssZ':
|
|
10633
|
-
return "" + year + month + day + "T" + hours + minutes + seconds + "Z";
|
|
10634
|
-
case 'YYYY/MM/DD':
|
|
10635
|
-
return year + "/" + month + "/" + day;
|
|
10636
|
-
case 'YYYYMMDD':
|
|
10637
|
-
return "" + year + month + day;
|
|
10638
|
-
case 'YYYY-MM-DD':
|
|
10639
|
-
return year + "-" + month + "-" + day;
|
|
10640
|
-
case 'YYYY':
|
|
10641
|
-
return "" + year;
|
|
10642
|
-
case 'MM':
|
|
10643
|
-
return "" + month;
|
|
10644
|
-
case 'DD':
|
|
10645
|
-
return "" + day;
|
|
10646
|
-
case 'hh:mm:ss':
|
|
10647
|
-
return hours + ":" + minutes + ":" + seconds;
|
|
10648
|
-
case 'hh':
|
|
10649
|
-
return "" + hours;
|
|
10650
|
-
case 'mm':
|
|
10651
|
-
return "" + minutes;
|
|
10652
|
-
case 'ss':
|
|
10653
|
-
return "" + seconds;
|
|
10654
|
-
default:
|
|
10655
|
-
throw new Error('Unsupported format type');
|
|
10656
|
-
}
|
|
10657
|
-
};
|
|
10658
|
-
/**
|
|
10659
|
-
* @description 对比两个时间的差值
|
|
10660
|
-
* @param {Date | string | number} date1
|
|
10661
|
-
* @param {Date | string | number} date2
|
|
10662
|
-
* @param {"year" | "month" | "day" | "hour" | "minute" | "second"} diffType
|
|
10663
|
-
*/ DateTime.diff = function diff(date1, date2, diffType) {
|
|
10664
|
-
/** @type {Date} */ var dateTime1 = date1;
|
|
10665
|
-
if (typeof date1 === 'string') {
|
|
10666
|
-
dateTime1 = DateTime.strToDate(date1);
|
|
10667
|
-
} else if (typeof date1 === 'number') {
|
|
10668
|
-
dateTime1 = new Date(date1);
|
|
10669
|
-
}
|
|
10670
|
-
/** @type {Date} */ var dateTime2 = date2;
|
|
10671
|
-
if (typeof date2 === 'string') {
|
|
10672
|
-
dateTime1 = DateTime.strToDate(date2);
|
|
10673
|
-
} else if (typeof date2 === 'number') {
|
|
10674
|
-
dateTime1 = new Date(date2);
|
|
10675
|
-
}
|
|
10676
|
-
var diffSecond = dateTime1.getTime() - dateTime2.getTime();
|
|
10677
|
-
// diff
|
|
10678
|
-
switch(diffType){
|
|
10679
|
-
case 'year':
|
|
10680
|
-
return dateTime1.getFullYear() - dateTime2.getFullYear();
|
|
10681
|
-
case 'month':
|
|
10682
|
-
// 计算总月份差
|
|
10683
|
-
// eslint-disable-next-line no-case-declarations
|
|
10684
|
-
var months = (dateTime1.getFullYear() - dateTime2.getFullYear()) * 12 + (dateTime1.getMonth() - dateTime2.getMonth());
|
|
10685
|
-
// 如果结束日的日期小于开始日的日期,则减去一个月
|
|
10686
|
-
if (dateTime1.getDate() < dateTime2.getDate()) {
|
|
10687
|
-
months--;
|
|
10688
|
-
}
|
|
10689
|
-
return months;
|
|
10690
|
-
case 'day':
|
|
10691
|
-
return diffSecond / 60 / 60 / 24;
|
|
10692
|
-
case 'hour':
|
|
10693
|
-
return diffSecond / 60 / 60;
|
|
10694
|
-
case 'minute':
|
|
10695
|
-
return diffSecond / 60;
|
|
10696
|
-
case 'second':
|
|
10697
|
-
return diffSecond;
|
|
10698
|
-
default:
|
|
10699
|
-
throw new Error('Unsupported diff type');
|
|
10700
|
-
}
|
|
10701
|
-
};
|
|
10702
|
-
DateTime.now = function now() {
|
|
10703
|
-
return Date.now();
|
|
10704
|
-
};
|
|
10705
|
-
/**
|
|
10706
|
-
*
|
|
10707
|
-
* @param {string} str 日期, 2025-04-10 10:10:10 或 2025/04/10 10:10:10 或 20250410101010 或 20250410T101010Z 或 秒 或 毫秒
|
|
10708
|
-
* @example
|
|
10709
|
-
* DateTime.strToDate("2025/04/10 10:10:10") // Date
|
|
10710
|
-
* DateTime.strToDate("2025-04-10 10:10:10") // Date
|
|
10711
|
-
* DateTime.strToDate("20250410101010") // Date
|
|
10712
|
-
* DateTime.strToDate("20250410T101010Z") // Date
|
|
10713
|
-
*/ DateTime.strToDate = function strToDate(str) {
|
|
10714
|
-
var time = (str + '').replace(/-/gi, '').replace(/:/gi, '').replace(/\//gi, '').replace(/ /gi, '').replace(/T|Z/gi, '');
|
|
10715
|
-
// 兼容
|
|
10716
|
-
if ((str + '').length === 10) {
|
|
10717
|
-
// 时间戳 秒
|
|
10718
|
-
return new Date(+str);
|
|
10719
|
-
} else if ((str + '').length === 13) {
|
|
10720
|
-
// 时间戳 毫秒
|
|
10721
|
-
return new Date(+str);
|
|
10722
|
-
}
|
|
10723
|
-
var year = time.slice(0, 4);
|
|
10724
|
-
var month = time.slice(4, 6);
|
|
10725
|
-
var day = time.slice(6, 8);
|
|
10726
|
-
var hour = time.slice(8, 10);
|
|
10727
|
-
var minute = time.slice(10, 12);
|
|
10728
|
-
var second = time.slice(12, 14);
|
|
10729
|
-
return new Date(year + '/' + month + '/' + day + ' ' + hour + ':' + minute + ':' + second);
|
|
10730
|
-
};
|
|
10731
|
-
/**
|
|
10732
|
-
* @description 补充十位
|
|
10733
|
-
* @param {number} num
|
|
10734
|
-
* @returns {string}
|
|
10735
|
-
* @example
|
|
10736
|
-
* DateTime.padStart(1) // "01"
|
|
10737
|
-
* DateTime.padStart(33) // "33"
|
|
10738
|
-
*/ DateTime.padStart = function padStart(num) {
|
|
10739
|
-
if (num < 10) {
|
|
10740
|
-
return '0' + num;
|
|
10741
|
-
} else {
|
|
10742
|
-
return num + '';
|
|
10743
|
-
}
|
|
10744
|
-
};
|
|
10745
|
-
return DateTime;
|
|
10746
|
-
}();
|
|
10262
|
+
var distExports$1 = requireDist$3();
|
|
10747
10263
|
|
|
10748
10264
|
function _extends$5() {
|
|
10749
10265
|
_extends$5 = Object.assign || function(target) {
|
|
@@ -10787,20 +10303,29 @@
|
|
|
10787
10303
|
function DatePickerControl(options) {
|
|
10788
10304
|
var _this;
|
|
10789
10305
|
var _this_options_props_urlInfo_searchParams, _this_options_props_urlInfo, _this_options_props;
|
|
10790
|
-
_this = Control.call(this, _extends$5({
|
|
10306
|
+
_this = Control.call(this, _extends$5({
|
|
10307
|
+
maxDate: new Date()
|
|
10308
|
+
}, options, {
|
|
10791
10309
|
tagName: 'span',
|
|
10792
10310
|
controlType: 'button',
|
|
10793
10311
|
classNameSuffix: 'date'
|
|
10794
10312
|
})) || this;
|
|
10795
10313
|
_this.options = options;
|
|
10796
|
-
_this._value = DateTime.
|
|
10314
|
+
_this._value = distExports$6.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');
|
|
10797
10315
|
_this._render();
|
|
10316
|
+
// 日期上的点
|
|
10317
|
+
_this.on(EVENTS.control.dateMonthChange, function(dates) {
|
|
10318
|
+
var _this_datePicker_updateBadges, _this_datePicker;
|
|
10319
|
+
(_this_datePicker = _this.datePicker) == null ? void 0 : (_this_datePicker_updateBadges = _this_datePicker.updateBadges) == null ? void 0 : _this_datePicker_updateBadges.call(_this_datePicker, dates);
|
|
10320
|
+
});
|
|
10798
10321
|
return _this;
|
|
10799
10322
|
}
|
|
10800
10323
|
var _proto = DatePickerControl.prototype;
|
|
10801
10324
|
_proto._render = function _render() {
|
|
10802
10325
|
var _this = this;
|
|
10803
|
-
|
|
10326
|
+
var _this_options_props;
|
|
10327
|
+
var isMobile1 = distExports$6.isMobile();
|
|
10328
|
+
if (isMobile1) {
|
|
10804
10329
|
var _this_locale;
|
|
10805
10330
|
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>";
|
|
10806
10331
|
} else {
|
|
@@ -10809,25 +10334,45 @@
|
|
|
10809
10334
|
title: (_this_locale1 = this.locale) == null ? void 0 : _this_locale1.BTN_CALENDAR
|
|
10810
10335
|
});
|
|
10811
10336
|
}
|
|
10812
|
-
this.
|
|
10813
|
-
|
|
10814
|
-
|
|
10337
|
+
this.datePicker = new distExports$1.DatePicker(this.$container, {
|
|
10338
|
+
isMobile: isMobile1,
|
|
10339
|
+
getPopupContainer: function() {
|
|
10340
|
+
return _this.$container;
|
|
10341
|
+
},
|
|
10342
|
+
mode: 'date',
|
|
10343
|
+
offset: [
|
|
10344
|
+
0,
|
|
10345
|
+
-10
|
|
10346
|
+
],
|
|
10347
|
+
badges: ((_this_options_props = this.options.props) == null ? void 0 : _this_options_props.recMonth) || [],
|
|
10348
|
+
language: this.options.language === 'zh' ? 'zh' : 'en',
|
|
10815
10349
|
current: new Date(this._value + ' 00:00:00'),
|
|
10816
|
-
|
|
10817
|
-
|
|
10818
|
-
|
|
10819
|
-
|
|
10820
|
-
|
|
10821
|
-
|
|
10350
|
+
placement: 'tr',
|
|
10351
|
+
triggerClose: true,
|
|
10352
|
+
disabledDate: function(date) {
|
|
10353
|
+
return date.getTime() > (_this.options.maxDate || new Date()).getTime();
|
|
10354
|
+
},
|
|
10355
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10356
|
+
onOk: function(date, _mode) {
|
|
10357
|
+
if (date && _this._value !== distExports$6.DateTime.format(date, 'YYYY-MM-DD') && isMobile1) {
|
|
10358
|
+
_this._value = distExports$6.DateTime.format(date, 'YYYY-MM-DD');
|
|
10359
|
+
_this.options.onOk == null ? void 0 : _this.options.onOk.call(_this.options, date);
|
|
10822
10360
|
_this.emit(EVENTS.control.dateChange, date);
|
|
10823
10361
|
if (date && _this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value")) {
|
|
10824
10362
|
_this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value").innerHTML = _this._getDateStr();
|
|
10825
10363
|
}
|
|
10826
10364
|
}
|
|
10827
10365
|
},
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10366
|
+
onChange: function(date, mode) {
|
|
10367
|
+
if (date && _this._value !== distExports$6.DateTime.format(date, 'YYYY-MM-DD') && !isMobile1 && mode === 'date') {
|
|
10368
|
+
_this._value = distExports$6.DateTime.format(date, 'YYYY-MM-DD');
|
|
10369
|
+
_this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, date);
|
|
10370
|
+
_this.emit(EVENTS.control.dateChange, date);
|
|
10371
|
+
}
|
|
10372
|
+
},
|
|
10373
|
+
onOpenChange: function(open) {
|
|
10374
|
+
_this.options.onPanelChange == null ? void 0 : _this.options.onPanelChange.call(_this.options, open, _this.datePicker.current);
|
|
10375
|
+
_this.emit(EVENTS.control.datePanelOpenChange, open, _this.datePicker.current);
|
|
10831
10376
|
}
|
|
10832
10377
|
});
|
|
10833
10378
|
};
|
|
@@ -10837,28 +10382,27 @@
|
|
|
10837
10382
|
* @param change 是否触发 onChange 事件
|
|
10838
10383
|
*/ _proto.setDate = function setDate(date, change) {
|
|
10839
10384
|
if (change === void 0) change = true;
|
|
10840
|
-
var
|
|
10841
|
-
(
|
|
10842
|
-
if (date && !change && this._value !== DateTime.
|
|
10843
|
-
this._value = DateTime.
|
|
10385
|
+
var _this_datePicker;
|
|
10386
|
+
(_this_datePicker = this.datePicker) == null ? void 0 : _this_datePicker.setCurrent(date, change);
|
|
10387
|
+
if (date && !change && this._value !== distExports$6.DateTime.format(date, 'YYYY-MM-DD')) {
|
|
10388
|
+
this._value = distExports$6.DateTime.format(date, 'YYYY-MM-DD');
|
|
10844
10389
|
if (date && this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value")) {
|
|
10845
10390
|
this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value").innerHTML = this._getDateStr();
|
|
10846
10391
|
}
|
|
10847
10392
|
}
|
|
10848
10393
|
};
|
|
10849
10394
|
_proto.reset = function reset() {
|
|
10850
|
-
|
|
10851
|
-
(_this_dataPickerUtil = this.dataPickerUtil) == null ? void 0 : _this_dataPickerUtil.hide();
|
|
10395
|
+
if (this.datePicker) this.datePicker.open = false;
|
|
10852
10396
|
Control.prototype.reset.call(this);
|
|
10853
10397
|
};
|
|
10854
10398
|
/**
|
|
10855
10399
|
* 销毁控件
|
|
10856
10400
|
* @override
|
|
10857
10401
|
*/ _proto.destroy = function destroy() {
|
|
10858
|
-
if (this.
|
|
10859
|
-
this.
|
|
10402
|
+
if (this.datePicker) {
|
|
10403
|
+
this.datePicker.destroy();
|
|
10860
10404
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
10861
|
-
this.
|
|
10405
|
+
this.datePicker = null;
|
|
10862
10406
|
}
|
|
10863
10407
|
Control.prototype.destroy.call(this);
|
|
10864
10408
|
};
|
|
@@ -10868,30 +10412,31 @@
|
|
|
10868
10412
|
};
|
|
10869
10413
|
/**
|
|
10870
10414
|
* 点击 Control 会触发
|
|
10415
|
+
* @overload super._onControlClick(e: Event)
|
|
10871
10416
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
10872
10417
|
Control.prototype._onControlClick.call(this, e);
|
|
10873
10418
|
};
|
|
10874
10419
|
return DatePickerControl;
|
|
10875
10420
|
}(Control);
|
|
10876
10421
|
|
|
10877
|
-
var dist$
|
|
10422
|
+
var dist$2 = {};
|
|
10878
10423
|
|
|
10879
10424
|
/**
|
|
10880
10425
|
* drag scroll support move and touch
|
|
10881
10426
|
*
|
|
10882
|
-
* @skax/drag-scroll v1.1.
|
|
10883
|
-
* Copyright (c) 2025-11-
|
|
10427
|
+
* @skax/drag-scroll v1.1.2
|
|
10428
|
+
* Copyright (c) 2025-11-22 ShineShao <xiaoshaoqq@gmail.com>
|
|
10884
10429
|
*
|
|
10885
10430
|
* This source code is licensed under the MIT license found in the
|
|
10886
10431
|
* LICENSE file in the root directory of this source tree.
|
|
10887
10432
|
*/
|
|
10888
10433
|
|
|
10889
|
-
var dist;
|
|
10890
|
-
var hasRequiredDist$
|
|
10434
|
+
var dist$1;
|
|
10435
|
+
var hasRequiredDist$2;
|
|
10891
10436
|
|
|
10892
|
-
function requireDist$
|
|
10893
|
-
if (hasRequiredDist$
|
|
10894
|
-
hasRequiredDist$
|
|
10437
|
+
function requireDist$2 () {
|
|
10438
|
+
if (hasRequiredDist$2) return dist$1;
|
|
10439
|
+
hasRequiredDist$2 = 1;
|
|
10895
10440
|
|
|
10896
10441
|
/**
|
|
10897
10442
|
* 拖拽滚动状态
|
|
@@ -11078,8 +10623,8 @@
|
|
|
11078
10623
|
this._addEventListeners();
|
|
11079
10624
|
// 初始化滚动条
|
|
11080
10625
|
this._updateScrollbar();
|
|
11081
|
-
|
|
11082
|
-
|
|
10626
|
+
// 弹性动画
|
|
10627
|
+
// this._animationId = requestAnimationFrame(this._animate.bind(this));
|
|
11083
10628
|
};
|
|
11084
10629
|
// ----------- 事件处理 ----------- //
|
|
11085
10630
|
/**
|
|
@@ -11326,23 +10871,151 @@
|
|
|
11326
10871
|
return DragScroll;
|
|
11327
10872
|
}();
|
|
11328
10873
|
|
|
11329
|
-
dist = DragScroll;
|
|
10874
|
+
dist$1 = DragScroll;
|
|
10875
|
+
return dist$1;
|
|
10876
|
+
}
|
|
10877
|
+
|
|
10878
|
+
/*
|
|
10879
|
+
* delegate.js v4.0.0
|
|
10880
|
+
* Copyright (c) 2025-11-09
|
|
10881
|
+
* Released under the MIT License.
|
|
10882
|
+
*/
|
|
10883
|
+
|
|
10884
|
+
var dist;
|
|
10885
|
+
var hasRequiredDist$1;
|
|
10886
|
+
|
|
10887
|
+
function requireDist$1 () {
|
|
10888
|
+
if (hasRequiredDist$1) return dist;
|
|
10889
|
+
hasRequiredDist$1 = 1;
|
|
10890
|
+
|
|
10891
|
+
const DOCUMENT_NODE_TYPE = 9;
|
|
10892
|
+
/**
|
|
10893
|
+
* A polyfill for Element.matches()
|
|
10894
|
+
*/ if (typeof Element !== "undefined" && !Element.prototype.matches) {
|
|
10895
|
+
const proto = Element.prototype;
|
|
10896
|
+
proto.matches = (proto == null ? void 0 : proto.matchesSelector) || (proto == null ? void 0 : proto.mozMatchesSelector) || (proto == null ? void 0 : proto.msMatchesSelector) || (proto == null ? void 0 : proto.oMatchesSelector) || (proto == null ? void 0 : proto.webkitMatchesSelector);
|
|
10897
|
+
}
|
|
10898
|
+
/**
|
|
10899
|
+
* Finds the closest parent that matches a selector.
|
|
10900
|
+
*
|
|
10901
|
+
* @param {Element} element
|
|
10902
|
+
* @param {string} selector
|
|
10903
|
+
* @return {Element}
|
|
10904
|
+
*/ function closest(element, selector) {
|
|
10905
|
+
while(element && element.nodeType !== DOCUMENT_NODE_TYPE){
|
|
10906
|
+
if (typeof element.matches === "function" && element.matches(selector)) {
|
|
10907
|
+
return element;
|
|
10908
|
+
}
|
|
10909
|
+
element = element.parentNode;
|
|
10910
|
+
}
|
|
10911
|
+
return null;
|
|
10912
|
+
}
|
|
10913
|
+
/**
|
|
10914
|
+
* Finds the closest parent that matches a selector.
|
|
10915
|
+
*
|
|
10916
|
+
* @param {Element} element
|
|
10917
|
+
* @param {string} selector
|
|
10918
|
+
* @return {Element}
|
|
10919
|
+
*/ function closestNative(element, selector) {
|
|
10920
|
+
return element && element.closest(selector);
|
|
10921
|
+
}
|
|
10922
|
+
var closest$1 = typeof Element.prototype.closest === "function" ? closestNative : closest;
|
|
10923
|
+
|
|
10924
|
+
/**
|
|
10925
|
+
* Delegates event to a selector.
|
|
10926
|
+
*
|
|
10927
|
+
* @param {Element} element
|
|
10928
|
+
* @param {string} selector
|
|
10929
|
+
* @param {string} type
|
|
10930
|
+
* @param {Function} callback
|
|
10931
|
+
* @param {boolean} useCapture
|
|
10932
|
+
* @return {Object}
|
|
10933
|
+
*/ // prettier-ignore
|
|
10934
|
+
function _delegate(element, selector, type, callback, useCapture) {
|
|
10935
|
+
// prettier-ignore
|
|
10936
|
+
const listenerFn = listener.apply(this, arguments);
|
|
10937
|
+
element.addEventListener(type, listenerFn, useCapture);
|
|
10938
|
+
return {
|
|
10939
|
+
destroy: function() {
|
|
10940
|
+
element.removeEventListener(type, listenerFn, useCapture);
|
|
10941
|
+
}
|
|
10942
|
+
};
|
|
10943
|
+
}
|
|
10944
|
+
/**
|
|
10945
|
+
* Delegates event to a selector.
|
|
10946
|
+
*
|
|
10947
|
+
* @param {Element|string|Array} [elements]
|
|
10948
|
+
* @param {string | Element} selector
|
|
10949
|
+
* @param {string} type
|
|
10950
|
+
* @param {Function} callback
|
|
10951
|
+
* @param {boolean} useCapture
|
|
10952
|
+
* @return {Object}
|
|
10953
|
+
* @example
|
|
10954
|
+
* ```ts
|
|
10955
|
+
* const delegation = delegate(document.body, 'a', 'click', function (e) {})
|
|
10956
|
+
* // destroy (removeEventListener)
|
|
10957
|
+
* delegation.destroy();
|
|
10958
|
+
*
|
|
10959
|
+
* const delegation1 = delegate(".btn", "click", function (e) { console.log(e.delegateTarget)},false);
|
|
10960
|
+
* // destroy (removeEventListener)
|
|
10961
|
+
* delegation1.destroy();
|
|
10962
|
+
* ```
|
|
10963
|
+
*/ // prettier-ignore
|
|
10964
|
+
function delegate(elements, selector, type, callback, useCapture) {
|
|
10965
|
+
// Handle the regular Element usage
|
|
10966
|
+
if (typeof elements.addEventListener === "function") {
|
|
10967
|
+
return _delegate.apply(null, arguments);
|
|
10968
|
+
}
|
|
10969
|
+
// Handle Element-less usage, it defaults to global delegation
|
|
10970
|
+
if (typeof type === "function") {
|
|
10971
|
+
// Use `document` as the first parameter, then apply arguments
|
|
10972
|
+
// This is a short way to .unshift `arguments` without running into deoptimizations
|
|
10973
|
+
return _delegate.bind(null, document).apply(null, arguments);
|
|
10974
|
+
}
|
|
10975
|
+
// Handle Selector-based usage
|
|
10976
|
+
if (typeof elements === "string") {
|
|
10977
|
+
elements = document.querySelectorAll(elements);
|
|
10978
|
+
}
|
|
10979
|
+
// Handle Array-like based usage
|
|
10980
|
+
return Array.prototype.map.call(elements, function(element) {
|
|
10981
|
+
return _delegate(element, selector, type, callback, useCapture);
|
|
10982
|
+
});
|
|
10983
|
+
}
|
|
10984
|
+
/**
|
|
10985
|
+
* Finds closest match and invokes callback.
|
|
10986
|
+
*
|
|
10987
|
+
* @param {Element} element
|
|
10988
|
+
* @param {string} selector
|
|
10989
|
+
* @param {string} type
|
|
10990
|
+
* @param {Function} callback
|
|
10991
|
+
* @return {Function}
|
|
10992
|
+
*/ // prettier-ignore
|
|
10993
|
+
function listener(element, selector, type, callback) {
|
|
10994
|
+
return function(e) {
|
|
10995
|
+
e.delegateTarget = closest$1(e.target, selector);
|
|
10996
|
+
if (e.delegateTarget) {
|
|
10997
|
+
callback.call(element, e);
|
|
10998
|
+
}
|
|
10999
|
+
};
|
|
11000
|
+
}
|
|
11001
|
+
|
|
11002
|
+
dist = delegate;
|
|
11330
11003
|
return dist;
|
|
11331
11004
|
}
|
|
11332
11005
|
|
|
11333
11006
|
/*
|
|
11334
|
-
* @ezuikit/control-time-line v1.0.
|
|
11335
|
-
* Copyright (c) 2025-
|
|
11007
|
+
* @ezuikit/control-time-line v1.0.4
|
|
11008
|
+
* Copyright (c) 2025-12-08 Ezviz-OpenBiz
|
|
11336
11009
|
* Released under the MIT License.
|
|
11337
11010
|
*/
|
|
11338
11011
|
|
|
11339
11012
|
var hasRequiredDist;
|
|
11340
11013
|
|
|
11341
11014
|
function requireDist () {
|
|
11342
|
-
if (hasRequiredDist) return dist$
|
|
11015
|
+
if (hasRequiredDist) return dist$2;
|
|
11343
11016
|
hasRequiredDist = 1;
|
|
11344
|
-
var deepmerge=requireCjs(),I18n=requireDist$7(),Picker=requireDist$a(),DragScroll=requireDist$1(),delegate=requireDist$9(),_$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.toDate=function(time){var left,right,date=null;return "string"==typeof time&&time.includes(":")?date=new Date(time):"string"!=typeof time&&"number"!=typeof time||!/\d/.test(time+"")||10!==(time+"").length?"string"!=typeof time&&"number"!=typeof time||!/\d/.test(time+"")||13!==(time+"").length?(left=time,date=(null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)?time:new Date):date=new Date(+time):date=new Date(1e3*+time),date},TimeLineUtil.formatDateToHHmmss=function(time){var date=TimeLineUtil.toDate(time);if(date){var h=date.getHours(),m=date.getMinutes(),s=date.getSeconds();return (h>9?h:"0"+h)+":"+(m>9?m:"0"+m)+":"+(s>9?s:"0"+s)}return "00:00:00"},TimeLineUtil.subTime=function(m){return +m>9?m+"":"0"+m},TimeLineUtil.tranTime=function(time,fmt){ void 0===fmt&&(fmt="YYYY-MM-DD HH:mm:ss");var newDate=TimeLineUtil.toDate(time);return newDate?"YYYY-MM-DD"===fmt?newDate.getFullYear()+"-"+TimeLineUtil.subTime(newDate.getMonth()+1)+"-"+TimeLineUtil.subTime(newDate.getDate()):"HH:mm:ss"===fmt?TimeLineUtil.subTime(newDate.getHours())+":"+TimeLineUtil.subTime(newDate.getMinutes())+":"+TimeLineUtil.subTime(newDate.getSeconds()):"HH"===fmt?TimeLineUtil.subTime(newDate.getHours()):"mm:ss"===fmt?TimeLineUtil.subTime(newDate.getMinutes())+":"+TimeLineUtil.subTime(newDate.getSeconds()):"HH:mm"===fmt?TimeLineUtil.subTime(newDate.getHours())+":"+TimeLineUtil.subTime(newDate.getMinutes()):"YYYYMMDDTHHmmssZ"===fmt?newDate.getFullYear()+""+TimeLineUtil.subTime(newDate.getMonth()+1)+TimeLineUtil.subTime(newDate.getDate())+"T"+TimeLineUtil.subTime(newDate.getHours())+TimeLineUtil.subTime(newDate.getMinutes())+TimeLineUtil.subTime(newDate.getSeconds())+"Z":newDate.getFullYear()+"-"+TimeLineUtil.subTime(newDate.getMonth()+1)+"-"+TimeLineUtil.subTime(newDate.getDate())+" "+TimeLineUtil.subTime(newDate.getHours())+":"+TimeLineUtil.subTime(newDate.getMinutes())+":"+TimeLineUtil.subTime(newDate.getSeconds()):""},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.isOverlap=function(a_start,a_end,b_start,b_end){return Math.max(a_start,b_start)<=Math.min(a_end,b_end)},TimeLineUtil.tranTimeToString=function(start,end){var _TimeLineUtil_toDate,_TimeLineUtil_toDate1,secondNum=Math.floor((null==(_TimeLineUtil_toDate=TimeLineUtil.toDate(end))?void 0:_TimeLineUtil_toDate.getTime())-(null==(_TimeLineUtil_toDate1=TimeLineUtil.toDate(start))?void 0:_TimeLineUtil_toDate1.getTime()))/1e3,second=secondNum%60,minute=Math.floor(secondNum/60);return (minute>0?TimeLineUtil.subTime(minute)+"'":"0'")+TimeLineUtil.subTime(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小时"]];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)}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}),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.state={start:"00:00:00",end:"24:00:00",current:null,timeArr:[],availTimeLine:[],index:0},_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._onImageError=_this._onImageError.bind(_this),_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:TimeLineUtil.formatDateToHHmmss(record.startTime),endTime:TimeLineUtil.formatDateToHHmmss(record.endTime)})});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:TimeLineUtil.formatDateToHHmmss(this.current||(new Date).getTime())}),this._matchTimeDot();},_proto.update=function(time){var _this__dragScroll;time&&!(null==(_this__dragScroll=this._dragScroll)?void 0:_this__dragScroll.isDragging)&&(this._setState({current:TimeLineUtil.tranTime(time,"HH:mm:ss")}),this._currentOffsetH());},_proto.destroy=function(){var _this__dragScroll,_this__picker_$body_querySelectorAll,_this__picker_$body;if(this._scrollTimer&&(clearInterval(this._scrollTimer),this._scrollTimer=null),this._$currentTime)try{this.$container.removeChild(this._$currentTime),this._$currentTime=null;}catch(error){}if(this._$itemList&&this._imageRemoveErrorEvent(this._$itemList.querySelectorAll("img.ez-time-line-img")||[]),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._imageRemoveErrorEvent((null==(_this__picker_$body=this._picker.$body)||null==(_this__picker_$body_querySelectorAll=_this__picker_$body.querySelectorAll)?void 0:_this__picker_$body_querySelectorAll.call(_this__picker_$body,"img"))||[]),this._picker.destroy(),this._picker=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(TimeLineUtil.tranTime((null==(_this_timeSections_=_this.timeSections[0])?void 0:_this_timeSections_.endTime)||(new Date).getTime(),"YYYY-MM-DD")+" "+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;this._imageRemoveErrorEvent(container.querySelectorAll("img.ez-time-line-img")||[]),container.innerHTML="",timeArr.forEach(function(item,index){var 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&&(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 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"}):""+TimeLineUtil.tranTime(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),_this._imageErrorEvent(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._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._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=TimeLineUtil.tranTime(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(TimeLineUtil.tranTime(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=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="'+TimeLineUtil.tranTime(item.startTime,"YYYYMMDDTHHmmssZ")+'"\n data-end="'+TimeLineUtil.tranTime(item.endTime,"YYYYMMDDTHHmmssZ")+'"\n data-index="'+item._index+'">\n <span class="ez-time-line-picker-item-time">'+TimeLineUtil.tranTime(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" 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)&&this._imageErrorEvent((null==(_this__picker2=this._picker)?void 0:_this__picker2.$body.querySelectorAll("img"))||[]);},_proto._imageErrorEvent=function(list){var _this=this;void 0===list&&(list=[]),Array.from(list).forEach(function(img){img.hasAttribute("data-error")||img.addEventListener("error",_this._onImageError);});},_proto._imageRemoveErrorEvent=function(list){var _this=this;void 0===list&&(list=[]),Array.from(list).forEach(function(img){img.removeEventListener("error",_this._onImageError);});},_proto._onImageError=function(e){var img=e.target;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.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,TimeLineUtil.subTime(Math.floor(second/3600))+":"+TimeLineUtil.subTime(Math.floor(second%3600/60))+":"+TimeLineUtil.subTime(second%60)]},_create_class$1(MobileTimeLine,[{key:"_scaleWidth",get:function(){return (MOBILE_TIME_WIDTH[this.timeWidth]||MOBILE_TIME_WIDTH[0])[0]}}]),MobileTimeLine}(BaseTimeLine);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:new Date(TimeLineUtil.tranTime(time,"YYYY-MM-DD HH:mm:ss"))});},_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(new Date(TimeLineUtil.tranTime(new Date(1e3*curScaleTime),"YYYY-MM-DD")+" 00:00:00").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(new Date(TimeLineUtil.tranTime(new Date(1e3*leftLastScaleTime),"YYYY-MM-DD")+" 00:00:00").getTime()/1e3))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x,padding,x,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(TimeLineUtil.tranTime(new Date(1e3*leftLastScaleTime)),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(new Date(TimeLineUtil.tranTime(new Date(1e3*rightLastScaleTime),"YYYY-MM-DD")+" 00:00:00").getTime()/1e3))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x1,padding,x1,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(TimeLineUtil.tranTime(new Date(1e3*rightLastScaleTime)),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&&TimeLineUtil.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;
|
|
11345
|
-
return dist$
|
|
11017
|
+
var deepmerge=requireCjs(),I18n=requireDist$8(),Picker=requireDist$a(),DragScroll=requireDist$2(),delegate=requireDist$1(),_$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.toDate=function(time){var left,right,date=null;return "string"==typeof time&&time.includes(":")?date=new Date(time):"string"!=typeof time&&"number"!=typeof time||!/\d/.test(time+"")||10!==(time+"").length?"string"!=typeof time&&"number"!=typeof time||!/\d/.test(time+"")||13!==(time+"").length?(left=time,date=(null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)?time:new Date):date=new Date(+time):date=new Date(1e3*+time),date},TimeLineUtil.formatDateToHHmmss=function(time){var date=TimeLineUtil.toDate(time);if(date){var h=date.getHours(),m=date.getMinutes(),s=date.getSeconds();return (h>9?h:"0"+h)+":"+(m>9?m:"0"+m)+":"+(s>9?s:"0"+s)}return "00:00:00"},TimeLineUtil.subTime=function(m){return +m>9?m+"":"0"+m},TimeLineUtil.tranTime=function(time,fmt){ void 0===fmt&&(fmt="YYYY-MM-DD HH:mm:ss");var newDate=TimeLineUtil.toDate(time);return newDate?"YYYY-MM-DD"===fmt?newDate.getFullYear()+"-"+TimeLineUtil.subTime(newDate.getMonth()+1)+"-"+TimeLineUtil.subTime(newDate.getDate()):"HH:mm:ss"===fmt?TimeLineUtil.subTime(newDate.getHours())+":"+TimeLineUtil.subTime(newDate.getMinutes())+":"+TimeLineUtil.subTime(newDate.getSeconds()):"HH"===fmt?TimeLineUtil.subTime(newDate.getHours()):"mm:ss"===fmt?TimeLineUtil.subTime(newDate.getMinutes())+":"+TimeLineUtil.subTime(newDate.getSeconds()):"HH:mm"===fmt?TimeLineUtil.subTime(newDate.getHours())+":"+TimeLineUtil.subTime(newDate.getMinutes()):"YYYYMMDDTHHmmssZ"===fmt?newDate.getFullYear()+""+TimeLineUtil.subTime(newDate.getMonth()+1)+TimeLineUtil.subTime(newDate.getDate())+"T"+TimeLineUtil.subTime(newDate.getHours())+TimeLineUtil.subTime(newDate.getMinutes())+TimeLineUtil.subTime(newDate.getSeconds())+"Z":newDate.getFullYear()+"-"+TimeLineUtil.subTime(newDate.getMonth()+1)+"-"+TimeLineUtil.subTime(newDate.getDate())+" "+TimeLineUtil.subTime(newDate.getHours())+":"+TimeLineUtil.subTime(newDate.getMinutes())+":"+TimeLineUtil.subTime(newDate.getSeconds()):""},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.isOverlap=function(a_start,a_end,b_start,b_end){return Math.max(a_start,b_start)<=Math.min(a_end,b_end)},TimeLineUtil.tranTimeToString=function(start,end){var _TimeLineUtil_toDate,_TimeLineUtil_toDate1,secondNum=Math.floor((null==(_TimeLineUtil_toDate=TimeLineUtil.toDate(end))?void 0:_TimeLineUtil_toDate.getTime())-(null==(_TimeLineUtil_toDate1=TimeLineUtil.toDate(start))?void 0:_TimeLineUtil_toDate1.getTime()))/1e3,second=secondNum%60,minute=Math.floor(secondNum/60);return (minute>0?TimeLineUtil.subTime(minute)+"'":"0'")+TimeLineUtil.subTime(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小时"]];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)}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.state={start:"00:00:00",end:"24:00:00",current:null,timeArr:[],availTimeLine:[],index:0},_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._onImageError=_this._onImageError.bind(_this),_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:TimeLineUtil.formatDateToHHmmss(record.startTime),endTime:TimeLineUtil.formatDateToHHmmss(record.endTime)})});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:TimeLineUtil.formatDateToHHmmss(this.current||(new Date).getTime())}),this._matchTimeDot();},_proto.update=function(time){var _this__dragScroll;time&&!(null==(_this__dragScroll=this._dragScroll)?void 0:_this__dragScroll.isDragging)&&(this._setState({current:TimeLineUtil.tranTime(time,"HH:mm:ss")}),this._currentOffsetH());},_proto.destroy=function(){var _this__dragScroll,_this__picker_$body_querySelectorAll,_this__picker_$body;if(this._scrollTimer&&(clearInterval(this._scrollTimer),this._scrollTimer=null),this._$currentTime)try{this.$container.removeChild(this._$currentTime),this._$currentTime=null;}catch(error){}if(this._$itemList&&this._imageRemoveErrorEvent(this._$itemList.querySelectorAll("img.ez-time-line-img")||[]),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._imageRemoveErrorEvent((null==(_this__picker_$body=this._picker.$body)||null==(_this__picker_$body_querySelectorAll=_this__picker_$body.querySelectorAll)?void 0:_this__picker_$body_querySelectorAll.call(_this__picker_$body,"img"))||[]),this._picker.destroy(),this._picker=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(TimeLineUtil.tranTime((null==(_this_timeSections_=_this.timeSections[0])?void 0:_this_timeSections_.endTime)||(new Date).getTime(),"YYYY-MM-DD")+" "+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;this._imageRemoveErrorEvent(container.querySelectorAll("img.ez-time-line-img")||[]),container.innerHTML="",timeArr.forEach(function(item,index){var 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 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"}):""+TimeLineUtil.tranTime(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),_this._imageErrorEvent(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._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._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=TimeLineUtil.tranTime(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(TimeLineUtil.tranTime(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=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="'+TimeLineUtil.tranTime(item.startTime,"YYYYMMDDTHHmmssZ")+'"\n data-end="'+TimeLineUtil.tranTime(item.endTime,"YYYYMMDDTHHmmssZ")+'"\n data-index="'+item._index+'">\n <span class="ez-time-line-picker-item-time">'+TimeLineUtil.tranTime(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" 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)&&this._imageErrorEvent((null==(_this__picker2=this._picker)?void 0:_this__picker2.$body.querySelectorAll("img"))||[]);},_proto._imageErrorEvent=function(list){var _this=this;void 0===list&&(list=[]),Array.from(list).forEach(function(img){img.hasAttribute("data-error")||img.addEventListener("error",_this._onImageError);});},_proto._imageRemoveErrorEvent=function(list){var _this=this;void 0===list&&(list=[]),Array.from(list).forEach(function(img){img.removeEventListener("error",_this._onImageError);});},_proto._onImageError=function(e){var img=e.target;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.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,TimeLineUtil.subTime(Math.floor(second/3600))+":"+TimeLineUtil.subTime(Math.floor(second%3600/60))+":"+TimeLineUtil.subTime(second%60)]},_create_class$1(MobileTimeLine,[{key:"_scaleWidth",get:function(){return (MOBILE_TIME_WIDTH[this.timeWidth]||MOBILE_TIME_WIDTH[0])[0]}}]),MobileTimeLine}(BaseTimeLine);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:new Date(TimeLineUtil.tranTime(time,"YYYY-MM-DD HH:mm:ss"))});},_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(new Date(TimeLineUtil.tranTime(new Date(1e3*curScaleTime),"YYYY-MM-DD")+" 00:00:00").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(new Date(TimeLineUtil.tranTime(new Date(1e3*leftLastScaleTime),"YYYY-MM-DD")+" 00:00:00").getTime()/1e3))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x,padding,x,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(TimeLineUtil.tranTime(new Date(1e3*leftLastScaleTime)),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(new Date(TimeLineUtil.tranTime(new Date(1e3*rightLastScaleTime),"YYYY-MM-DD")+" 00:00:00").getTime()/1e3))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x1,padding,x1,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(TimeLineUtil.tranTime(new Date(1e3*rightLastScaleTime)),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&&TimeLineUtil.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$2.BaseTimeLine=BaseTimeLine,dist$2.MobileTimeLine=MobileTimeLine,dist$2.TimeLine=TimeLine;
|
|
11018
|
+
return dist$2;
|
|
11346
11019
|
}
|
|
11347
11020
|
|
|
11348
11021
|
var distExports = requireDist();
|
|
@@ -12413,8 +12086,7 @@
|
|
|
12413
12086
|
return container;
|
|
12414
12087
|
},
|
|
12415
12088
|
language: theme.options.language,
|
|
12416
|
-
locales: theme.i18n.translations
|
|
12417
|
-
staticPath: theme.options.staticPath
|
|
12089
|
+
locales: theme.i18n.translations
|
|
12418
12090
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options["dateOptions"]) || {}, {
|
|
12419
12091
|
props: props
|
|
12420
12092
|
}));
|
|
@@ -12713,7 +12385,18 @@
|
|
|
12713
12385
|
*/ _this._footerMoreControl = null, /** 头部控件 @since 0.0.1 @private */ _this._header = null, /** 低部控件 @since 0.0.1 @private */ _this._footer = null, /** 回放底部时间轴 @since 0.0.1 @private */ _this._recFooter = null, /**
|
|
12714
12386
|
* 移动端扩展容器, 扩展的控件渲染在指定容器以外, 仅只用端适用, 为了可以放置大的控件和方便开发接入
|
|
12715
12387
|
* @private
|
|
12716
|
-
*/ _this._mobileExtend = null, /** @since 0.0.1 @private */ _this._interactiveResult = null, /** @since 0.0.1 @private */ _this._themeData = null, _this._fullscreen = null, _this.zoomUtil = null, /** 清除屏幕旋转 */ _this._cleanupOrientation = null, /** resizeObserver 监听销毁 */ _this._cleanUpResizeObserver = null, /** 容器的宽 */ _this._width = 0, /** 容器的高 */ _this._height = 0, /** 当前容器的全屏状态 true: 全屏, false: 非全屏 */ _this._isCurrentFullscreen = false, /** 屏幕旋转角度 0 | 90 | 180 | 270 */ _this._orientationAngle = 0, /** 是否播放中 @private */ _this._playing = false, /** 加载中 */ _this._loading = false, /** 音量 */ _this._volume = 0, /** 静音 */ _this._muted = false, /** 电子放大倍数 @private */ _this._zoom = 1, /** 放大中 true: 可缩放状态,false: 禁止缩放状态(不能缩放) @private */ _this._zooming = false, /** 录制中 @private */ _this._recording = false, /** 对讲中 @private */ _this._talking = false, /** 倍速 @private */ _this._speed = 1, /** 自定清晰度 @private */ _this._videoLevelAuto = false, /** 清晰度列表 */ _this.videoLevelList = [], /** 回放片段列表 */ _this.recordList = [], /** 窗口尺寸变化时,设置窗口超出隐藏,防止出现滚动条 */ _this._resizeOverflowTimer = null,
|
|
12388
|
+
*/ _this._mobileExtend = null, /** @since 0.0.1 @private */ _this._interactiveResult = null, /** @since 0.0.1 @private */ _this._themeData = null, _this._fullscreen = null, _this.zoomUtil = null, /** 清除屏幕旋转 */ _this._cleanupOrientation = null, /** resizeObserver 监听销毁 */ _this._cleanUpResizeObserver = null, /** 容器的宽 */ _this._width = 0, /** 容器的高 */ _this._height = 0, /** 当前容器的全屏状态 true: 全屏, false: 非全屏 */ _this._isCurrentFullscreen = false, /** 屏幕旋转角度 0 | 90 | 180 | 270 */ _this._orientationAngle = 0, /** 是否播放中 @private */ _this._playing = false, /** 加载中 */ _this._loading = false, /** 音量 */ _this._volume = 0, /** 静音 */ _this._muted = false, /** 电子放大倍数 @private */ _this._zoom = 1, /** 放大中 true: 可缩放状态,false: 禁止缩放状态(不能缩放) @private */ _this._zooming = false, /** 录制中 @private */ _this._recording = false, /** 对讲中 @private */ _this._talking = false, /** 倍速 @private */ _this._speed = 1, /** 自定清晰度 @private */ _this._videoLevelAuto = false, /** 清晰度列表 */ _this.videoLevelList = [], /** 回放片段列表 */ _this.recordList = [], /** 窗口尺寸变化时,设置窗口超出隐藏,防止出现滚动条 */ _this._resizeOverflowTimer = null, // /**
|
|
12389
|
+
// * 记录回放的月份
|
|
12390
|
+
// *
|
|
12391
|
+
// * key: {序列号}_{通道号}_{rec | cloud | cloudRecord} 比如:BC7799091_1_rec BC7799091_1_cloud BC7799091_1_cloudRecord
|
|
12392
|
+
// *
|
|
12393
|
+
// * value: 月份列表 比如 ["2025-12-01", "2025-12-02"]
|
|
12394
|
+
// * @private
|
|
12395
|
+
// */
|
|
12396
|
+
// _recMonthObj: Record<string, string[]> = {};
|
|
12397
|
+
/**
|
|
12398
|
+
* 录像回放的月份列表 @private
|
|
12399
|
+
*/ _this.recMonth = [], /** 清理 header/footer 动画 定时器 @private */ _this._onPauseTimingFunc = null, /** 销毁标识 @readonly */ _this.destroyed = false, /** 播放地址信息 */ _this.urlInfo = null, _this.scaleMode = 0;
|
|
12717
12400
|
_this._initOptions(options);
|
|
12718
12401
|
if (_this.options.type === 'ezopen') {
|
|
12719
12402
|
var _this_urlInfo_searchParams, _this_urlInfo;
|
|
@@ -12723,7 +12406,7 @@
|
|
|
12723
12406
|
}
|
|
12724
12407
|
if (_this.urlInfo.type === 'rec') {
|
|
12725
12408
|
var _this_urlInfo_searchParams1, _this_urlInfo1, _this_urlInfo_searchParams2, _this_urlInfo2;
|
|
12726
|
-
_this._seekDate = ((_this_urlInfo1 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams1 = _this_urlInfo1.searchParams) == null ? void 0 : _this_urlInfo_searchParams1.begin) ? DateTime.
|
|
12409
|
+
_this._seekDate = ((_this_urlInfo1 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams1 = _this_urlInfo1.searchParams) == null ? void 0 : _this_urlInfo_searchParams1.begin) ? distExports$6.DateTime.toDate((_this_urlInfo2 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams2 = _this_urlInfo2.searchParams) == null ? void 0 : _this_urlInfo_searchParams2.begin) : distExports$6.DateTime.toDate(distExports$6.DateTime.format(new Date(), 'YYYY/MM/DD') + ' 00:00:00');
|
|
12727
12410
|
}
|
|
12728
12411
|
}
|
|
12729
12412
|
_this._getRecType(_this.options.url);
|
|
@@ -13935,7 +13618,7 @@
|
|
|
13935
13618
|
zh: zh,
|
|
13936
13619
|
en: en
|
|
13937
13620
|
};
|
|
13938
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.0.2-beta.
|
|
13621
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.0.2-beta.2';
|
|
13939
13622
|
|
|
13940
13623
|
// 不要动这里的代码, 这个出口是为了编译成 umd 规范的文件
|
|
13941
13624
|
|