@gsc-basic/utils 1.0.2 → 1.0.4
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.cjs +1 -1381
- package/dist/index.js +1 -1275
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -1,1275 +1 @@
|
|
|
1
|
-
// src/common.js
|
|
2
|
-
import { isPlainObject, mergeWith, isArray, isEqual, intersectionWith, unionWith } from "lodash-es";
|
|
3
|
-
|
|
4
|
-
// src/regexp.js
|
|
5
|
-
var regexpMap = {
|
|
6
|
-
// 手机号(mobile phone)中国(宽松), 只要是13,14,15,16,17,18,19开头即可
|
|
7
|
-
mobile: /^(?:(?:\+|00)86)?1[3-9]\d{9}$/,
|
|
8
|
-
// 座机(tel phone)电话(国内),如: 0341-86091234
|
|
9
|
-
tel: /^(?:(?:\d{3}-)?\d{8}|(?:\d{4}-)?\d{7,8})(?:-\d+)?$/,
|
|
10
|
-
// 数字和字母组成
|
|
11
|
-
numAndLetter: /^[A-Z0-9]+$/i,
|
|
12
|
-
// 密码强度校验,最少6位,包括至少1个大写字母,1个小写字母,1个数字,1个特殊字符
|
|
13
|
-
password: /^\S*(?=\S{6,})(?=\S*\d)(?=\S*[A-Z])(?=\S*[a-z])(?=\S*[!@#$%^&*? ])\S+$/,
|
|
14
|
-
// email(支持中文邮箱)
|
|
15
|
-
email: /^[A-Z0-9\u4E00-\u9FA5]+@[\w-]+(?:\.[\w-]+)+$/i,
|
|
16
|
-
// 邮政编码(中国)
|
|
17
|
-
postalCode: /^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/,
|
|
18
|
-
// 身份证号(2代,18位数字),最后一位是校验位,可能为数字或字符X
|
|
19
|
-
identityCard: /^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[12]\d|30|31)\d{3}[\dX]$/i,
|
|
20
|
-
// IP地址--ip-v4[:端口]
|
|
21
|
-
ip: /^((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(?::(?:\d|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5]))?$/,
|
|
22
|
-
// URL
|
|
23
|
-
url: /^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-][^!@#$%^&*?.\s]{0,64}\.)+[a-z]{2,6}\/?/,
|
|
24
|
-
// 是否为https url
|
|
25
|
-
httpsUrl: /^https:\/\//,
|
|
26
|
-
// 域名(非网址, 不包含协议)
|
|
27
|
-
domain: /^([0-9a-z-]+\.)+([a-z]{2,})$/i,
|
|
28
|
-
// 车牌号(新能源+非新能源)
|
|
29
|
-
plateNumber: /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$/,
|
|
30
|
-
// md5格式(32位)
|
|
31
|
-
md5: /^[a-f0-9]{32}$/i,
|
|
32
|
-
// base64格式
|
|
33
|
-
base64: /^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([\w!$&',()*+;=\-.~:@/?%\s]*?)\s*$/i,
|
|
34
|
-
// GUID/UUID
|
|
35
|
-
uuid: /^[a-f\d]{4}(?:[a-f\d]{4}-){4}[a-f\d]{12}$/i,
|
|
36
|
-
// 版本号(version)格式必须为X.Y.Z
|
|
37
|
-
version: /^\d+(?:\.\d+){2}$/,
|
|
38
|
-
// 视频(video)链接地址(视频格式可按需增删)
|
|
39
|
-
videoUrl: /^https?:\/\/(.+\/)+.+(\.(swf|avi|flv|mpg|rm|mov|wav|asf|3gp|mkv|rmvb|mp4))$/i,
|
|
40
|
-
// 图片(image)链接地址(图片格式可按需增删)
|
|
41
|
-
imageUrl: /^https?:\/\/(.+\/)+.+(\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i,
|
|
42
|
-
// 中文
|
|
43
|
-
chinese: /^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/,
|
|
44
|
-
itcode: /^[a-z]+\d*$/i
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
// src/is.js
|
|
48
|
-
var toString = Object.prototype.toString;
|
|
49
|
-
function is(val, type) {
|
|
50
|
-
return toString.call(val) === `[object ${type}]`;
|
|
51
|
-
}
|
|
52
|
-
function isObject(val) {
|
|
53
|
-
return val !== null && is(val, "Object");
|
|
54
|
-
}
|
|
55
|
-
function isUrl(path) {
|
|
56
|
-
return regexpMap.url.test(path);
|
|
57
|
-
}
|
|
58
|
-
function isIterableArray(val) {
|
|
59
|
-
return Array.isArray(val) && val.length > 0;
|
|
60
|
-
}
|
|
61
|
-
function isPositiveInteger(num) {
|
|
62
|
-
return Number.isInteger(num) && num >= 0;
|
|
63
|
-
}
|
|
64
|
-
var isServer = typeof window === "undefined";
|
|
65
|
-
var isClient = !isServer;
|
|
66
|
-
var isChrome = isClient && window.navigator.userAgent.toLowerCase().includes("chrome");
|
|
67
|
-
var isSafari = isClient && window.navigator.userAgent.toLowerCase().includes("safari");
|
|
68
|
-
var isBrowser = typeof window !== "undefined" && typeof document !== "undefined";
|
|
69
|
-
var isSupportNativeEllipsis = isBrowser && typeof document.body.style.lineClamp !== "undefined";
|
|
70
|
-
var isSupportResizeObserver = isBrowser && typeof ResizeObserver !== "undefined";
|
|
71
|
-
var isChineseText = (text) => {
|
|
72
|
-
return regexpMap.chinese.test(text);
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
// src/common.js
|
|
76
|
-
var withInstall = (component, alias) => {
|
|
77
|
-
const comp = component;
|
|
78
|
-
comp.install = (app) => {
|
|
79
|
-
app.component(comp.name || comp.displayName, component);
|
|
80
|
-
if (alias) {
|
|
81
|
-
app.config.globalProperties[alias] = component;
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
return component;
|
|
85
|
-
};
|
|
86
|
-
function getRawRoute(route) {
|
|
87
|
-
if (!route) {
|
|
88
|
-
return route;
|
|
89
|
-
}
|
|
90
|
-
const { matched, ...opt } = route;
|
|
91
|
-
return {
|
|
92
|
-
...opt,
|
|
93
|
-
matched: matched ? matched.map((item) => ({
|
|
94
|
-
meta: item.meta,
|
|
95
|
-
name: item.name,
|
|
96
|
-
path: item.path
|
|
97
|
-
})) : void 0
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
function openWindow(url, opt) {
|
|
101
|
-
const { target = "__blank", noopener = true, noreferrer = true } = opt || {};
|
|
102
|
-
const feature = [];
|
|
103
|
-
noopener && feature.push("noopener=yes");
|
|
104
|
-
noreferrer && feature.push("noreferrer=yes");
|
|
105
|
-
window.open(url, target, feature.join(","));
|
|
106
|
-
}
|
|
107
|
-
function deepMerge(source, target, mergeArrays = "replace") {
|
|
108
|
-
if (!target) {
|
|
109
|
-
return source;
|
|
110
|
-
}
|
|
111
|
-
if (!source) {
|
|
112
|
-
return target;
|
|
113
|
-
}
|
|
114
|
-
return mergeWith(source, target, (sourceValue, targetValue) => {
|
|
115
|
-
if (isArray(targetValue) && isArray(sourceValue)) {
|
|
116
|
-
switch (mergeArrays) {
|
|
117
|
-
case "union":
|
|
118
|
-
return unionWith(sourceValue, targetValue, isEqual);
|
|
119
|
-
case "intersection":
|
|
120
|
-
return intersectionWith(sourceValue, targetValue, isEqual);
|
|
121
|
-
case "concat":
|
|
122
|
-
return sourceValue.concat(targetValue);
|
|
123
|
-
case "replace":
|
|
124
|
-
return targetValue;
|
|
125
|
-
default:
|
|
126
|
-
throw new Error(`Unknown merge array strategy: ${mergeArrays}`);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
if (isObject(targetValue) && isObject(sourceValue)) {
|
|
130
|
-
return deepMerge(sourceValue, targetValue, mergeArrays);
|
|
131
|
-
}
|
|
132
|
-
return void 0;
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
function getPopupContainer(node) {
|
|
136
|
-
return (node == null ? void 0 : node.parentNode) ?? document.body;
|
|
137
|
-
}
|
|
138
|
-
function setObjToUrlParams(baseUrl, obj) {
|
|
139
|
-
if (!isIterableArray(Object.keys(obj))) {
|
|
140
|
-
return baseUrl;
|
|
141
|
-
}
|
|
142
|
-
let parameters = "";
|
|
143
|
-
for (const key in obj) {
|
|
144
|
-
parameters += `${key}=${encodeURIComponent(obj[key])}&`;
|
|
145
|
-
}
|
|
146
|
-
parameters = parameters.replace(/&$/, "");
|
|
147
|
-
return /\?$/.test(baseUrl) ? baseUrl + parameters : baseUrl.replace(/\/?$/, "?") + parameters;
|
|
148
|
-
}
|
|
149
|
-
function unsetAllProperty(params) {
|
|
150
|
-
if (isPlainObject(params)) {
|
|
151
|
-
Object.keys(params).forEach((key) => {
|
|
152
|
-
Reflect.deleteProperty(params, key);
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
function transform(c) {
|
|
157
|
-
const code = ["$", "(", ")", "*", "+", ".", "[", "]", "?", "\\", "^", "{", "}", "|"];
|
|
158
|
-
return code.includes(c) ? `\\${c}` : c;
|
|
159
|
-
}
|
|
160
|
-
function createSearchReg(key) {
|
|
161
|
-
const keys = [...key].map((item) => transform(item));
|
|
162
|
-
const str = ["", ...keys, ""].join(".*");
|
|
163
|
-
return new RegExp(str, "i");
|
|
164
|
-
}
|
|
165
|
-
function getActualWidthOfChars(text = "", options = {}) {
|
|
166
|
-
const {
|
|
167
|
-
size = 14,
|
|
168
|
-
family = getComputedStyle(document.documentElement).getPropertyValue("--vxe-font-family") || "sans-serif"
|
|
169
|
-
} = options;
|
|
170
|
-
const canvas = document.createElement("canvas");
|
|
171
|
-
const ctx = canvas.getContext("2d");
|
|
172
|
-
ctx.font = `${size}px ${family}`;
|
|
173
|
-
const metrics = ctx.measureText(text);
|
|
174
|
-
const actual = Math.abs(metrics.actualBoundingBoxLeft) + Math.abs(metrics.actualBoundingBoxRight);
|
|
175
|
-
return Math.ceil(Math.max(metrics.width, actual));
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
// src/bem.js
|
|
179
|
-
function genBem(name, mods) {
|
|
180
|
-
if (!mods) {
|
|
181
|
-
return "";
|
|
182
|
-
}
|
|
183
|
-
if (typeof mods === "string") {
|
|
184
|
-
return ` ${name}--${mods}`;
|
|
185
|
-
}
|
|
186
|
-
if (Array.isArray(mods)) {
|
|
187
|
-
return mods.reduce((ret, item) => ret + genBem(name, item), "");
|
|
188
|
-
}
|
|
189
|
-
return Object.keys(mods).reduce((ret, key) => ret + (mods[key] ? genBem(name, key) : ""), "");
|
|
190
|
-
}
|
|
191
|
-
function buildBEM(name) {
|
|
192
|
-
return (el, mods) => {
|
|
193
|
-
if (el && typeof el !== "string") {
|
|
194
|
-
mods = el;
|
|
195
|
-
el = "";
|
|
196
|
-
}
|
|
197
|
-
el = el ? `${name}__${el}` : name;
|
|
198
|
-
return `${el}${genBem(el, mods)}`;
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
function createBEM(name, prefixCls = "gsc") {
|
|
202
|
-
return [buildBEM(`${prefixCls}-${name}`)];
|
|
203
|
-
}
|
|
204
|
-
function createNamespace(name, prefixCls = "gsc") {
|
|
205
|
-
const prefixedName = `${prefixCls}-${name}`;
|
|
206
|
-
return [prefixedName, buildBEM(prefixedName)];
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
// src/cipher.js
|
|
210
|
-
import { encrypt, decrypt } from "crypto-js/aes";
|
|
211
|
-
import UTF8, { parse } from "crypto-js/enc-utf8";
|
|
212
|
-
import pkcs7 from "crypto-js/pad-pkcs7";
|
|
213
|
-
import ECB from "crypto-js/mode-ecb";
|
|
214
|
-
import md5 from "crypto-js/md5";
|
|
215
|
-
import Base64 from "crypto-js/enc-base64";
|
|
216
|
-
var AesEncryption = class {
|
|
217
|
-
constructor(opt) {
|
|
218
|
-
const { key, iv } = opt;
|
|
219
|
-
if (key) {
|
|
220
|
-
this.key = parse(key);
|
|
221
|
-
}
|
|
222
|
-
if (iv) {
|
|
223
|
-
this.iv = parse(iv);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
get getOptions() {
|
|
227
|
-
return {
|
|
228
|
-
mode: ECB,
|
|
229
|
-
padding: pkcs7,
|
|
230
|
-
iv: this.iv
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
encryptByAES(cipherText) {
|
|
234
|
-
return encrypt(cipherText, this.key, this.getOptions).toString();
|
|
235
|
-
}
|
|
236
|
-
decryptByAES(cipherText) {
|
|
237
|
-
return decrypt(cipherText, this.key, this.getOptions).toString(UTF8);
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
function encryptByBase64(cipherText) {
|
|
241
|
-
return UTF8.parse(cipherText).toString(Base64);
|
|
242
|
-
}
|
|
243
|
-
function decodeByBase64(cipherText) {
|
|
244
|
-
return Base64.parse(cipherText).toString(UTF8);
|
|
245
|
-
}
|
|
246
|
-
function encryptByMd5(password) {
|
|
247
|
-
return md5(password).toString();
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
// src/domUtils.js
|
|
251
|
-
import { upperFirst } from "lodash-es";
|
|
252
|
-
var docEle = document.documentElement;
|
|
253
|
-
var enableTransitions = () => {
|
|
254
|
-
return "startViewTransition" in document && window.matchMedia("(prefers-reduced-motion: no-preference)").matches;
|
|
255
|
-
};
|
|
256
|
-
function getBoundingClientRect(element) {
|
|
257
|
-
if (!element || !element.getBoundingClientRect) {
|
|
258
|
-
return 0;
|
|
259
|
-
}
|
|
260
|
-
return element.getBoundingClientRect();
|
|
261
|
-
}
|
|
262
|
-
function trim(string) {
|
|
263
|
-
return (string || "").replace(/^\s+|\s+$/g, "");
|
|
264
|
-
}
|
|
265
|
-
function hasClass(el, cls) {
|
|
266
|
-
if (!el || !cls) {
|
|
267
|
-
return false;
|
|
268
|
-
}
|
|
269
|
-
if (cls.includes(" ")) {
|
|
270
|
-
throw new Error("className should not contain space.");
|
|
271
|
-
}
|
|
272
|
-
if (el.classList) {
|
|
273
|
-
return el.classList.contains(cls);
|
|
274
|
-
} else {
|
|
275
|
-
return ` ${el.className} `.includes(` ${cls} `);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
function setCssVar(prop, val, dom = docEle) {
|
|
279
|
-
dom.style.setProperty(prop, val);
|
|
280
|
-
}
|
|
281
|
-
function addClass(el, cls) {
|
|
282
|
-
if (!el) {
|
|
283
|
-
return;
|
|
284
|
-
}
|
|
285
|
-
let curClass = el.className;
|
|
286
|
-
const classes = (cls || "").split(" ");
|
|
287
|
-
for (let i = 0, j = classes.length; i < j; i++) {
|
|
288
|
-
const clsName = classes[i];
|
|
289
|
-
if (!clsName) {
|
|
290
|
-
continue;
|
|
291
|
-
}
|
|
292
|
-
if (el.classList) {
|
|
293
|
-
el.classList.add(clsName);
|
|
294
|
-
} else if (!hasClass(el, clsName)) {
|
|
295
|
-
curClass += ` ${clsName}`;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
if (!el.classList) {
|
|
299
|
-
el.className = curClass;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
function removeClass(el, cls) {
|
|
303
|
-
if (!el || !cls) {
|
|
304
|
-
return;
|
|
305
|
-
}
|
|
306
|
-
const classes = cls.split(" ");
|
|
307
|
-
let curClass = ` ${el.className} `;
|
|
308
|
-
for (let i = 0, j = classes.length; i < j; i++) {
|
|
309
|
-
const clsName = classes[i];
|
|
310
|
-
if (!clsName) {
|
|
311
|
-
continue;
|
|
312
|
-
}
|
|
313
|
-
if (el.classList) {
|
|
314
|
-
el.classList.remove(clsName);
|
|
315
|
-
} else if (hasClass(el, clsName)) {
|
|
316
|
-
curClass = curClass.replace(` ${clsName} `, " ");
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
if (!el.classList) {
|
|
320
|
-
el.className = trim(curClass);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
function getViewportOffset(element) {
|
|
324
|
-
const doc = document.documentElement;
|
|
325
|
-
const docScrollLeft = doc.scrollLeft;
|
|
326
|
-
const docScrollTop = doc.scrollTop;
|
|
327
|
-
const docClientLeft = doc.clientLeft;
|
|
328
|
-
const docClientTop = doc.clientTop;
|
|
329
|
-
const pageXOffset = window.scrollX;
|
|
330
|
-
const pageYOffset = window.scrollY;
|
|
331
|
-
const box = getBoundingClientRect(element);
|
|
332
|
-
const { left: retLeft, top: rectTop, width: rectWidth, height: rectHeight } = box;
|
|
333
|
-
const scrollLeft = (pageXOffset || docScrollLeft) - (docClientLeft || 0);
|
|
334
|
-
const scrollTop = (pageYOffset || docScrollTop) - (docClientTop || 0);
|
|
335
|
-
const offsetLeft = retLeft + pageXOffset;
|
|
336
|
-
const offsetTop = rectTop + pageYOffset;
|
|
337
|
-
const left = offsetLeft - scrollLeft;
|
|
338
|
-
const top = offsetTop - scrollTop;
|
|
339
|
-
const clientWidth = window.document.documentElement.clientWidth;
|
|
340
|
-
const clientHeight = window.document.documentElement.clientHeight;
|
|
341
|
-
return {
|
|
342
|
-
left,
|
|
343
|
-
top,
|
|
344
|
-
right: clientWidth - rectWidth - left,
|
|
345
|
-
bottom: clientHeight - rectHeight - top,
|
|
346
|
-
rightIncludeBody: clientWidth - left,
|
|
347
|
-
bottomIncludeBody: clientHeight - top
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
|
-
function hackCss(attr, value) {
|
|
351
|
-
const prefix = ["webkit", "Moz", "ms", "OT"];
|
|
352
|
-
const styleObj = {};
|
|
353
|
-
prefix.forEach((item) => {
|
|
354
|
-
styleObj[`${item}${upperFirst(attr)}`] = value;
|
|
355
|
-
});
|
|
356
|
-
return {
|
|
357
|
-
...styleObj,
|
|
358
|
-
[attr]: value
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
function on(element, event, handler) {
|
|
362
|
-
if (element && event && handler) {
|
|
363
|
-
element.addEventListener(event, handler, false);
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
function off(element, event, handler) {
|
|
367
|
-
if (element && event && handler) {
|
|
368
|
-
element.removeEventListener(event, handler, false);
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
function useRafThrottle(fn) {
|
|
372
|
-
let locked = false;
|
|
373
|
-
return function(...args) {
|
|
374
|
-
if (locked) {
|
|
375
|
-
return;
|
|
376
|
-
}
|
|
377
|
-
locked = true;
|
|
378
|
-
window.requestAnimationFrame(() => {
|
|
379
|
-
fn.apply(this, args);
|
|
380
|
-
locked = false;
|
|
381
|
-
});
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
// src/event.js
|
|
386
|
-
import ResizeObserver2 from "resize-observer-polyfill";
|
|
387
|
-
function resizeHandler(entries) {
|
|
388
|
-
for (const entry of entries) {
|
|
389
|
-
const listeners = entry.target.__resizeListeners__ || [];
|
|
390
|
-
if (listeners.length) {
|
|
391
|
-
listeners.forEach((fn) => {
|
|
392
|
-
fn();
|
|
393
|
-
});
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
function addResizeListener(element, fn) {
|
|
398
|
-
if (isServer) {
|
|
399
|
-
return;
|
|
400
|
-
}
|
|
401
|
-
if (!element.__resizeListeners__) {
|
|
402
|
-
element.__resizeListeners__ = [];
|
|
403
|
-
element.__ro__ = new ResizeObserver2(resizeHandler);
|
|
404
|
-
element.__ro__.observe(element);
|
|
405
|
-
}
|
|
406
|
-
element.__resizeListeners__.push(fn);
|
|
407
|
-
}
|
|
408
|
-
function removeResizeListener(element, fn) {
|
|
409
|
-
if (!element || !element.__resizeListeners__) {
|
|
410
|
-
return;
|
|
411
|
-
}
|
|
412
|
-
element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);
|
|
413
|
-
if (!element.__resizeListeners__.length) {
|
|
414
|
-
element.__ro__.disconnect();
|
|
415
|
-
element.__ro__ = null;
|
|
416
|
-
element.__resizeListeners__ = null;
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
function triggerWindowResize() {
|
|
420
|
-
const event = new Event("resize", { bubbles: true, cancelable: true });
|
|
421
|
-
window.dispatchEvent(event);
|
|
422
|
-
}
|
|
423
|
-
function addLocationListener(fn, options = {}) {
|
|
424
|
-
function addEvent(type) {
|
|
425
|
-
const original = window.history[type];
|
|
426
|
-
return function(...args) {
|
|
427
|
-
const e = new Event(type);
|
|
428
|
-
e.arguments = args;
|
|
429
|
-
window.dispatchEvent(e);
|
|
430
|
-
return original.apply(this, args);
|
|
431
|
-
};
|
|
432
|
-
}
|
|
433
|
-
;
|
|
434
|
-
window.history.pushState = addEvent("pushState");
|
|
435
|
-
window.history.replaceState = addEvent("replaceState");
|
|
436
|
-
window.addEventListener("popstate", fn, options);
|
|
437
|
-
window.addEventListener("hashchange", fn, options);
|
|
438
|
-
window.addEventListener("replaceState", fn, options);
|
|
439
|
-
window.addEventListener("pushState", fn, options);
|
|
440
|
-
return {
|
|
441
|
-
removeListener: () => {
|
|
442
|
-
window.removeEventListener("popstate", fn, options);
|
|
443
|
-
window.removeEventListener("hashchange", fn, options);
|
|
444
|
-
window.removeEventListener("replaceState", fn, options);
|
|
445
|
-
window.removeEventListener("pushState", fn, options);
|
|
446
|
-
}
|
|
447
|
-
};
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
// src/file.js
|
|
451
|
-
import { round, isNil } from "lodash-es";
|
|
452
|
-
function dataURLtoBlob(base64Buf) {
|
|
453
|
-
const arr = base64Buf.split(",");
|
|
454
|
-
const typeItem = arr[0];
|
|
455
|
-
const mime = typeItem.match(/:(.*?);/)[1];
|
|
456
|
-
const bstr = window.atob(arr[1]);
|
|
457
|
-
let n = bstr.length;
|
|
458
|
-
const u8arr = new Uint8Array(n);
|
|
459
|
-
while (n--) {
|
|
460
|
-
u8arr[n] = bstr.charCodeAt(n);
|
|
461
|
-
}
|
|
462
|
-
return new Blob([u8arr], { type: mime });
|
|
463
|
-
}
|
|
464
|
-
function urlToBase64(url, mineType) {
|
|
465
|
-
return new Promise((resolve, reject) => {
|
|
466
|
-
let canvas = document.createElement("CANVAS");
|
|
467
|
-
const ctx = canvas.getContext("2d");
|
|
468
|
-
const img = new Image();
|
|
469
|
-
img.crossOrigin = "";
|
|
470
|
-
img.onload = function() {
|
|
471
|
-
if (!canvas || !ctx) {
|
|
472
|
-
return reject();
|
|
473
|
-
}
|
|
474
|
-
canvas.height = img.height;
|
|
475
|
-
canvas.width = img.width;
|
|
476
|
-
ctx.drawImage(img, 0, 0);
|
|
477
|
-
const dataURL = canvas.toDataURL(mineType || "image/png");
|
|
478
|
-
canvas = null;
|
|
479
|
-
resolve(dataURL);
|
|
480
|
-
};
|
|
481
|
-
img.src = url;
|
|
482
|
-
});
|
|
483
|
-
}
|
|
484
|
-
function downloadPercent(event) {
|
|
485
|
-
const { loaded, total } = event;
|
|
486
|
-
if (total <= 0 || isNil(total)) {
|
|
487
|
-
return 0;
|
|
488
|
-
}
|
|
489
|
-
const percent = loaded / total;
|
|
490
|
-
return round((percent > 1 ? 1 : percent) * 100);
|
|
491
|
-
}
|
|
492
|
-
function downloadByOnlineUrl(url, filename, mime, bom) {
|
|
493
|
-
urlToBase64(url).then((base64) => {
|
|
494
|
-
downloadByBase64(base64, filename, mime, bom);
|
|
495
|
-
});
|
|
496
|
-
}
|
|
497
|
-
function downloadByBase64(buf, filename, mime, bom) {
|
|
498
|
-
const base64Buf = dataURLtoBlob(buf);
|
|
499
|
-
downloadByData(base64Buf, filename, mime, bom);
|
|
500
|
-
}
|
|
501
|
-
function downloadByData(data, filename, mime, bom) {
|
|
502
|
-
const blobData = typeof bom !== "undefined" ? [bom, data] : [data];
|
|
503
|
-
const blob = new Blob(blobData, { type: mime || "application/octet-stream" });
|
|
504
|
-
if (typeof window.navigator.msSaveBlob !== "undefined") {
|
|
505
|
-
window.navigator.msSaveBlob(blob, filename);
|
|
506
|
-
} else {
|
|
507
|
-
const blobURL = window.URL.createObjectURL(blob);
|
|
508
|
-
const tempLink = document.createElement("a");
|
|
509
|
-
tempLink.style.display = "none";
|
|
510
|
-
tempLink.href = blobURL;
|
|
511
|
-
tempLink.setAttribute("download", filename);
|
|
512
|
-
if (typeof tempLink.download === "undefined") {
|
|
513
|
-
tempLink.setAttribute("target", "_blank");
|
|
514
|
-
}
|
|
515
|
-
document.body.appendChild(tempLink);
|
|
516
|
-
tempLink.click();
|
|
517
|
-
document.body.removeChild(tempLink);
|
|
518
|
-
window.URL.revokeObjectURL(blobURL);
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
function downloadByUrl({ url, target = "_blank", fileName }) {
|
|
522
|
-
if (/iP/.test(window.navigator.userAgent)) {
|
|
523
|
-
return false;
|
|
524
|
-
}
|
|
525
|
-
if (isChrome || isSafari) {
|
|
526
|
-
const link = document.createElement("a");
|
|
527
|
-
link.href = url;
|
|
528
|
-
link.download = fileName || url.substring(url.lastIndexOf("/") + 1, url.length);
|
|
529
|
-
link.style.display = "none";
|
|
530
|
-
document.body.appendChild(link);
|
|
531
|
-
link.click();
|
|
532
|
-
document.body.removeChild(link);
|
|
533
|
-
return true;
|
|
534
|
-
}
|
|
535
|
-
if (!url.includes("?")) {
|
|
536
|
-
url += "?download";
|
|
537
|
-
}
|
|
538
|
-
openWindow(url, { target });
|
|
539
|
-
return true;
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
// src/highlightHtml.js
|
|
543
|
-
var getKeywordIndexList = (content, keyword, flags = "ig") => {
|
|
544
|
-
const reg = new RegExp(keyword, flags);
|
|
545
|
-
const res = content.matchAll(reg);
|
|
546
|
-
const arr = [...res];
|
|
547
|
-
const allIndexArr = arr.map((e) => ({
|
|
548
|
-
index: e.index,
|
|
549
|
-
subString: e["0"]
|
|
550
|
-
}));
|
|
551
|
-
return allIndexArr;
|
|
552
|
-
};
|
|
553
|
-
function humpToLine(name) {
|
|
554
|
-
return name.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
555
|
-
}
|
|
556
|
-
var renderNodeTag = (subStr, option) => {
|
|
557
|
-
const s = subStr;
|
|
558
|
-
if (!option) {
|
|
559
|
-
return s;
|
|
560
|
-
}
|
|
561
|
-
const { tagName = "mark", bgColor, color, style = {}, renderHighlightKeyword } = option;
|
|
562
|
-
if (typeof renderHighlightKeyword === "function") {
|
|
563
|
-
return renderHighlightKeyword(subStr);
|
|
564
|
-
}
|
|
565
|
-
style.backgroundColor = bgColor;
|
|
566
|
-
style.color = color;
|
|
567
|
-
const styleContent = Object.keys(style).map((k) => `${humpToLine(k)}:${style[k]}`).join(";");
|
|
568
|
-
const styleStr = `style="${styleContent}"`;
|
|
569
|
-
return `<${tagName} ${styleStr}>${s}</${tagName}>`;
|
|
570
|
-
};
|
|
571
|
-
var renderHighlightHtml = (content, list) => {
|
|
572
|
-
let str = "";
|
|
573
|
-
list.forEach((item) => {
|
|
574
|
-
const { start, end, option } = item;
|
|
575
|
-
const s = content.slice(start, end);
|
|
576
|
-
const subStr = renderNodeTag(s, option);
|
|
577
|
-
str += subStr;
|
|
578
|
-
item.subString = subStr;
|
|
579
|
-
});
|
|
580
|
-
return str;
|
|
581
|
-
};
|
|
582
|
-
var parseHighlightIndex = (content, keywords) => {
|
|
583
|
-
const result = [];
|
|
584
|
-
keywords.forEach((keywordOption) => {
|
|
585
|
-
let option = { keyword: "" };
|
|
586
|
-
if (typeof keywordOption === "string") {
|
|
587
|
-
option = { keyword: keywordOption };
|
|
588
|
-
} else {
|
|
589
|
-
option = keywordOption;
|
|
590
|
-
}
|
|
591
|
-
const { keyword, caseSensitive = true } = option;
|
|
592
|
-
const indexList = getKeywordIndexList(content, keyword, caseSensitive ? "g" : "gi");
|
|
593
|
-
const res = {
|
|
594
|
-
keyword,
|
|
595
|
-
indexList,
|
|
596
|
-
option
|
|
597
|
-
};
|
|
598
|
-
result.push(res);
|
|
599
|
-
});
|
|
600
|
-
return result;
|
|
601
|
-
};
|
|
602
|
-
var parseHighlightString = (content, keywords) => {
|
|
603
|
-
const result = parseHighlightIndex(content, keywords);
|
|
604
|
-
const splitList = [];
|
|
605
|
-
const findSplitIndex = (index, len) => {
|
|
606
|
-
for (let i = 0; i < splitList.length; i++) {
|
|
607
|
-
const cur = splitList[i];
|
|
608
|
-
if (index > cur.start && index < cur.end || index + len > cur.start && index + len < cur.end || cur.start > index && cur.start < index + len || cur.end > index && cur.end < index + len || index === cur.start && index + len === cur.end) {
|
|
609
|
-
return -1;
|
|
610
|
-
}
|
|
611
|
-
if (index + len <= cur.start) {
|
|
612
|
-
return i;
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
return splitList.length;
|
|
616
|
-
};
|
|
617
|
-
result.forEach(({ indexList, option }) => {
|
|
618
|
-
indexList.forEach((e) => {
|
|
619
|
-
const { index, subString } = e;
|
|
620
|
-
const item = {
|
|
621
|
-
start: index,
|
|
622
|
-
end: index + subString.length,
|
|
623
|
-
option
|
|
624
|
-
};
|
|
625
|
-
const splitIndex = findSplitIndex(index, subString.length);
|
|
626
|
-
if (splitIndex !== -1) {
|
|
627
|
-
splitList.splice(splitIndex, 0, item);
|
|
628
|
-
}
|
|
629
|
-
});
|
|
630
|
-
});
|
|
631
|
-
const list = [];
|
|
632
|
-
splitList.forEach((cur, i) => {
|
|
633
|
-
const { start, end } = cur;
|
|
634
|
-
const next = splitList[i + 1];
|
|
635
|
-
if (i === 0 && start > 0) {
|
|
636
|
-
list.push({ start: 0, end: start, subString: content.slice(0, start) });
|
|
637
|
-
}
|
|
638
|
-
list.push({ ...cur, subString: content.slice(start, end) });
|
|
639
|
-
if ((next == null ? void 0 : next.start) > end) {
|
|
640
|
-
list.push({
|
|
641
|
-
start: end,
|
|
642
|
-
end: next.start,
|
|
643
|
-
subString: content.slice(end, next.start)
|
|
644
|
-
});
|
|
645
|
-
}
|
|
646
|
-
if (i === splitList.length - 1 && end < content.length - 1) {
|
|
647
|
-
list.push({
|
|
648
|
-
start: end,
|
|
649
|
-
end: content.length - 1,
|
|
650
|
-
subString: content.slice(end, content.length)
|
|
651
|
-
});
|
|
652
|
-
}
|
|
653
|
-
});
|
|
654
|
-
return list;
|
|
655
|
-
};
|
|
656
|
-
var highlightHtml = (content, keywords) => {
|
|
657
|
-
const splitList = parseHighlightString(content, keywords);
|
|
658
|
-
return {
|
|
659
|
-
highText: renderHighlightHtml(content, splitList),
|
|
660
|
-
highList: splitList
|
|
661
|
-
};
|
|
662
|
-
};
|
|
663
|
-
|
|
664
|
-
// src/ifActivity.js
|
|
665
|
-
import { clearInterval, clearTimeout, setInterval, setTimeout } from "worker-timers";
|
|
666
|
-
var STATUS_ACTIVE = "active";
|
|
667
|
-
var STATUS_IDLE = "idle";
|
|
668
|
-
var STATUS_HIDDEN = "hidden";
|
|
669
|
-
var DOC_HIDDEN;
|
|
670
|
-
var VISIBILITY_CHANGE_EVENT;
|
|
671
|
-
var setListener;
|
|
672
|
-
var store = {};
|
|
673
|
-
var Events = {
|
|
674
|
-
attach(event, callback) {
|
|
675
|
-
if (!store[event]) {
|
|
676
|
-
store[event] = [];
|
|
677
|
-
}
|
|
678
|
-
store[event].push(callback);
|
|
679
|
-
},
|
|
680
|
-
fire(event, args = []) {
|
|
681
|
-
if (store[event]) {
|
|
682
|
-
store[event].forEach((callback) => {
|
|
683
|
-
callback(...args);
|
|
684
|
-
});
|
|
685
|
-
}
|
|
686
|
-
},
|
|
687
|
-
remove(event, callback) {
|
|
688
|
-
if (!callback) {
|
|
689
|
-
Reflect.deleteProperty(store, event);
|
|
690
|
-
}
|
|
691
|
-
if (store[event]) {
|
|
692
|
-
store[event] = store[event].filter((savedCallback) => {
|
|
693
|
-
return callback !== savedCallback;
|
|
694
|
-
});
|
|
695
|
-
}
|
|
696
|
-
},
|
|
697
|
-
dom(element, event, callback) {
|
|
698
|
-
if (!setListener) {
|
|
699
|
-
if (element.addEventListener) {
|
|
700
|
-
setListener = (el, ev, fn) => {
|
|
701
|
-
return el.addEventListener(ev, fn, false);
|
|
702
|
-
};
|
|
703
|
-
} else if (typeof element.attachEvent === "function") {
|
|
704
|
-
setListener = (el, ev, fn) => {
|
|
705
|
-
return el.attachEvent(`on${ev}`, fn, false);
|
|
706
|
-
};
|
|
707
|
-
} else {
|
|
708
|
-
setListener = (el, ev, fn) => {
|
|
709
|
-
return el[`on${ev}`] = fn;
|
|
710
|
-
};
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
return setListener(element, event, callback);
|
|
714
|
-
}
|
|
715
|
-
};
|
|
716
|
-
var Timer = class {
|
|
717
|
-
constructor(activity, seconds, callback) {
|
|
718
|
-
this.activity = activity;
|
|
719
|
-
this.seconds = seconds;
|
|
720
|
-
this.callback = callback;
|
|
721
|
-
this.stopped = false;
|
|
722
|
-
this.start();
|
|
723
|
-
this.activity.on("statusChanged", (data) => {
|
|
724
|
-
if (this.stopped === false) {
|
|
725
|
-
if (data.status === STATUS_ACTIVE) {
|
|
726
|
-
this.start();
|
|
727
|
-
} else {
|
|
728
|
-
this.pause();
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
});
|
|
732
|
-
}
|
|
733
|
-
start() {
|
|
734
|
-
this.stopped = false;
|
|
735
|
-
clearInterval(this.token);
|
|
736
|
-
this.token = setInterval(this.callback, this.seconds * 1e3);
|
|
737
|
-
}
|
|
738
|
-
stop() {
|
|
739
|
-
this.stopped = true;
|
|
740
|
-
clearInterval(this.token);
|
|
741
|
-
}
|
|
742
|
-
resume() {
|
|
743
|
-
this.start();
|
|
744
|
-
}
|
|
745
|
-
pause() {
|
|
746
|
-
this.stop();
|
|
747
|
-
}
|
|
748
|
-
};
|
|
749
|
-
var IfActivity = class {
|
|
750
|
-
constructor() {
|
|
751
|
-
this.status = STATUS_ACTIVE;
|
|
752
|
-
this.timers = [];
|
|
753
|
-
this.idleTime = 3e4;
|
|
754
|
-
this.isLegacyModeOn = false;
|
|
755
|
-
if (document.hidden !== void 0) {
|
|
756
|
-
DOC_HIDDEN = "hidden";
|
|
757
|
-
VISIBILITY_CHANGE_EVENT = "visibilitychange";
|
|
758
|
-
} else if (document.mozHidden !== void 0) {
|
|
759
|
-
DOC_HIDDEN = "mozHidden";
|
|
760
|
-
VISIBILITY_CHANGE_EVENT = "mozvisibilitychange";
|
|
761
|
-
} else if (document.msHidden !== void 0) {
|
|
762
|
-
DOC_HIDDEN = "msHidden";
|
|
763
|
-
VISIBILITY_CHANGE_EVENT = "msvisibilitychange";
|
|
764
|
-
} else if (document.webkitHidden !== void 0) {
|
|
765
|
-
DOC_HIDDEN = "webkitHidden";
|
|
766
|
-
VISIBILITY_CHANGE_EVENT = "webkitvisibilitychange";
|
|
767
|
-
}
|
|
768
|
-
if (DOC_HIDDEN === void 0) {
|
|
769
|
-
this.legacyMode();
|
|
770
|
-
} else {
|
|
771
|
-
const trackChange = () => {
|
|
772
|
-
if (document[DOC_HIDDEN]) {
|
|
773
|
-
this.blur();
|
|
774
|
-
} else {
|
|
775
|
-
this.focus();
|
|
776
|
-
}
|
|
777
|
-
};
|
|
778
|
-
trackChange();
|
|
779
|
-
Events.dom(document, VISIBILITY_CHANGE_EVENT, trackChange);
|
|
780
|
-
}
|
|
781
|
-
this.startIdleTimer();
|
|
782
|
-
this.trackIdleStatus();
|
|
783
|
-
}
|
|
784
|
-
legacyMode() {
|
|
785
|
-
if (this.isLegacyModeOn) {
|
|
786
|
-
return;
|
|
787
|
-
}
|
|
788
|
-
Events.dom(window, "blur", () => {
|
|
789
|
-
return this.blur();
|
|
790
|
-
});
|
|
791
|
-
Events.dom(window, "focus", () => {
|
|
792
|
-
return this.focus();
|
|
793
|
-
});
|
|
794
|
-
this.isLegacyModeOn = true;
|
|
795
|
-
}
|
|
796
|
-
startIdleTimer(event) {
|
|
797
|
-
if (event instanceof MouseEvent && event.movementX === 0 && event.movementY === 0) {
|
|
798
|
-
return;
|
|
799
|
-
}
|
|
800
|
-
this.timers.map(clearTimeout);
|
|
801
|
-
this.timers.length = 0;
|
|
802
|
-
if (this.status === STATUS_IDLE) {
|
|
803
|
-
this.wakeUp();
|
|
804
|
-
}
|
|
805
|
-
this.idleStartedTime = +/* @__PURE__ */ new Date();
|
|
806
|
-
this.timers.push(
|
|
807
|
-
setTimeout(() => {
|
|
808
|
-
if (this.status === STATUS_ACTIVE || this.status === STATUS_HIDDEN) {
|
|
809
|
-
return this.idle();
|
|
810
|
-
}
|
|
811
|
-
}, this.idleTime)
|
|
812
|
-
);
|
|
813
|
-
}
|
|
814
|
-
trackIdleStatus() {
|
|
815
|
-
Events.dom(document, "mousemove", this.startIdleTimer.bind(this));
|
|
816
|
-
Events.dom(document, "mousedown", this.startIdleTimer.bind(this));
|
|
817
|
-
Events.dom(document, "keyup", this.startIdleTimer.bind(this));
|
|
818
|
-
Events.dom(document, "touchstart", this.startIdleTimer.bind(this));
|
|
819
|
-
Events.dom(window, "scroll", this.startIdleTimer.bind(this));
|
|
820
|
-
this.focus(this.startIdleTimer.bind(this));
|
|
821
|
-
}
|
|
822
|
-
on(event, callback) {
|
|
823
|
-
Events.attach(event, callback);
|
|
824
|
-
return this;
|
|
825
|
-
}
|
|
826
|
-
// will remove events
|
|
827
|
-
off(event, callback) {
|
|
828
|
-
Events.remove(event, callback);
|
|
829
|
-
return this;
|
|
830
|
-
}
|
|
831
|
-
setIdleDuration(seconds) {
|
|
832
|
-
this.idleTime = seconds * 1e3;
|
|
833
|
-
this.startIdleTimer();
|
|
834
|
-
return this;
|
|
835
|
-
}
|
|
836
|
-
getIdleDuration() {
|
|
837
|
-
return this.idleTime;
|
|
838
|
-
}
|
|
839
|
-
getIdleInfo() {
|
|
840
|
-
const now = +/* @__PURE__ */ new Date();
|
|
841
|
-
let res;
|
|
842
|
-
if (this.status === STATUS_IDLE) {
|
|
843
|
-
res = {
|
|
844
|
-
isIdle: true,
|
|
845
|
-
idleFor: now - this.idleStartedTime,
|
|
846
|
-
timeLeft: 0,
|
|
847
|
-
timeLeftPer: 100
|
|
848
|
-
};
|
|
849
|
-
} else {
|
|
850
|
-
const timeLeft = this.idleStartedTime + this.idleTime - now;
|
|
851
|
-
res = {
|
|
852
|
-
isIdle: false,
|
|
853
|
-
idleFor: now - this.idleStartedTime,
|
|
854
|
-
timeLeft,
|
|
855
|
-
timeLeftPer: Number.parseFloat((100 - timeLeft * 100 / this.idleTime).toFixed(2))
|
|
856
|
-
};
|
|
857
|
-
}
|
|
858
|
-
return res;
|
|
859
|
-
}
|
|
860
|
-
idle(callback) {
|
|
861
|
-
if (callback) {
|
|
862
|
-
this.on("idle", callback);
|
|
863
|
-
} else {
|
|
864
|
-
this.status = STATUS_IDLE;
|
|
865
|
-
Events.fire("idle");
|
|
866
|
-
Events.fire("statusChanged", [{ status: this.status }]);
|
|
867
|
-
}
|
|
868
|
-
return this;
|
|
869
|
-
}
|
|
870
|
-
blur(callback) {
|
|
871
|
-
if (callback) {
|
|
872
|
-
this.on("blur", callback);
|
|
873
|
-
} else {
|
|
874
|
-
this.status = STATUS_HIDDEN;
|
|
875
|
-
Events.fire("blur");
|
|
876
|
-
Events.fire("statusChanged", [{ status: this.status }]);
|
|
877
|
-
}
|
|
878
|
-
return this;
|
|
879
|
-
}
|
|
880
|
-
focus(callback) {
|
|
881
|
-
if (callback) {
|
|
882
|
-
this.on("focus", callback);
|
|
883
|
-
} else if (this.status !== STATUS_ACTIVE) {
|
|
884
|
-
this.status = STATUS_ACTIVE;
|
|
885
|
-
Events.fire("focus");
|
|
886
|
-
Events.fire("wakeUp");
|
|
887
|
-
Events.fire("statusChanged", [{ status: this.status }]);
|
|
888
|
-
}
|
|
889
|
-
return this;
|
|
890
|
-
}
|
|
891
|
-
wakeUp(callback) {
|
|
892
|
-
if (callback) {
|
|
893
|
-
this.on("wakeUp", callback);
|
|
894
|
-
} else if (this.status !== STATUS_ACTIVE) {
|
|
895
|
-
this.status = STATUS_ACTIVE;
|
|
896
|
-
Events.fire("wakeUp");
|
|
897
|
-
Events.fire("statusChanged", [{ status: this.status }]);
|
|
898
|
-
}
|
|
899
|
-
return this;
|
|
900
|
-
}
|
|
901
|
-
// 页面活跃时执行定时器
|
|
902
|
-
onEvery(seconds, callback) {
|
|
903
|
-
return new Timer(this, seconds, callback);
|
|
904
|
-
}
|
|
905
|
-
now(check) {
|
|
906
|
-
if (check !== void 0) {
|
|
907
|
-
return this.status === check;
|
|
908
|
-
}
|
|
909
|
-
return this.status === STATUS_ACTIVE;
|
|
910
|
-
}
|
|
911
|
-
};
|
|
912
|
-
|
|
913
|
-
// src/jsxHelper.js
|
|
914
|
-
import { isFunction } from "lodash-es";
|
|
915
|
-
function getSlot(slots, slot = "default", data) {
|
|
916
|
-
if (!slots || !Reflect.has(slots, slot)) {
|
|
917
|
-
return null;
|
|
918
|
-
}
|
|
919
|
-
if (!isFunction(slots[slot])) {
|
|
920
|
-
return null;
|
|
921
|
-
}
|
|
922
|
-
const slotFn = slots[slot];
|
|
923
|
-
if (!slotFn) {
|
|
924
|
-
return null;
|
|
925
|
-
}
|
|
926
|
-
return slotFn(data);
|
|
927
|
-
}
|
|
928
|
-
function extendSlots(slots, excludeKeys = []) {
|
|
929
|
-
const slotKeys = Object.keys(slots);
|
|
930
|
-
const ret = {};
|
|
931
|
-
slotKeys.forEach((key) => {
|
|
932
|
-
if (excludeKeys.includes(key)) {
|
|
933
|
-
return null;
|
|
934
|
-
}
|
|
935
|
-
ret[key] = (data) => getSlot(slots, key, data);
|
|
936
|
-
});
|
|
937
|
-
return ret;
|
|
938
|
-
}
|
|
939
|
-
|
|
940
|
-
// src/loadScript.js
|
|
941
|
-
function loadScript(src, { type = "text/javascript" } = {}) {
|
|
942
|
-
return new Promise((resolve, reject) => {
|
|
943
|
-
let shouldAppend = false;
|
|
944
|
-
let el = document.querySelector(`script[src="${src}"]`);
|
|
945
|
-
if (!el) {
|
|
946
|
-
el = document.createElement("script");
|
|
947
|
-
el.type = type;
|
|
948
|
-
el.async = true;
|
|
949
|
-
el.src = src;
|
|
950
|
-
shouldAppend = true;
|
|
951
|
-
} else if (el.hasAttribute("data-loaded")) {
|
|
952
|
-
resolve({ el });
|
|
953
|
-
return;
|
|
954
|
-
}
|
|
955
|
-
el.addEventListener("error", reject);
|
|
956
|
-
el.addEventListener("abort", reject);
|
|
957
|
-
el.addEventListener("load", () => {
|
|
958
|
-
el.setAttribute("data-loaded", true);
|
|
959
|
-
resolve({ el });
|
|
960
|
-
});
|
|
961
|
-
if (shouldAppend) {
|
|
962
|
-
document.head.appendChild(el);
|
|
963
|
-
}
|
|
964
|
-
});
|
|
965
|
-
}
|
|
966
|
-
function unloadScript(src) {
|
|
967
|
-
return new Promise((resolve, reject) => {
|
|
968
|
-
const el = document.querySelector(`script[src="${src}"]`);
|
|
969
|
-
if (!el) {
|
|
970
|
-
reject();
|
|
971
|
-
return;
|
|
972
|
-
}
|
|
973
|
-
document.head.removeChild(el);
|
|
974
|
-
resolve();
|
|
975
|
-
});
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
// src/matcher.js
|
|
979
|
-
function matcher(inputs, patterns, options) {
|
|
980
|
-
return baseMatcher(inputs, patterns, options, false);
|
|
981
|
-
}
|
|
982
|
-
function isMatch(inputs, patterns, options) {
|
|
983
|
-
return baseMatcher(inputs, patterns, options, true).length > 0;
|
|
984
|
-
}
|
|
985
|
-
function escapeStringRegexp(value) {
|
|
986
|
-
if (typeof value !== "string") {
|
|
987
|
-
return value;
|
|
988
|
-
}
|
|
989
|
-
return value.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
990
|
-
}
|
|
991
|
-
var regexpCache = /* @__PURE__ */ new Map();
|
|
992
|
-
function sanitizeArray(input, inputName) {
|
|
993
|
-
if (!Array.isArray(input)) {
|
|
994
|
-
switch (typeof input) {
|
|
995
|
-
case "string":
|
|
996
|
-
input = [input];
|
|
997
|
-
break;
|
|
998
|
-
case "undefined":
|
|
999
|
-
input = [];
|
|
1000
|
-
break;
|
|
1001
|
-
default:
|
|
1002
|
-
throw new TypeError(
|
|
1003
|
-
`Expected '${inputName}' to be a string or an array, but got a type of '${typeof input}'`
|
|
1004
|
-
);
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
return input.filter((string) => {
|
|
1008
|
-
if (typeof string !== "string") {
|
|
1009
|
-
if (typeof string === "undefined") {
|
|
1010
|
-
return false;
|
|
1011
|
-
}
|
|
1012
|
-
throw new TypeError(
|
|
1013
|
-
`Expected '${inputName}' to be an array of strings, but found a type of '${typeof string}' in the array`
|
|
1014
|
-
);
|
|
1015
|
-
}
|
|
1016
|
-
return true;
|
|
1017
|
-
});
|
|
1018
|
-
}
|
|
1019
|
-
function makeRegexp(pattern, options) {
|
|
1020
|
-
options = {
|
|
1021
|
-
caseSensitive: false,
|
|
1022
|
-
...options
|
|
1023
|
-
};
|
|
1024
|
-
const cacheKey = pattern + JSON.stringify(options);
|
|
1025
|
-
if (regexpCache.has(cacheKey)) {
|
|
1026
|
-
return regexpCache.get(cacheKey);
|
|
1027
|
-
}
|
|
1028
|
-
const negated = pattern[0] === "!";
|
|
1029
|
-
if (negated) {
|
|
1030
|
-
pattern = pattern.slice(1);
|
|
1031
|
-
}
|
|
1032
|
-
pattern = escapeStringRegexp(pattern).replace(/\\\*/g, "[\\s\\S]*");
|
|
1033
|
-
const regexp = new RegExp(`^${pattern}$`, options.caseSensitive ? "" : "i");
|
|
1034
|
-
regexp.negated = negated;
|
|
1035
|
-
regexpCache.set(cacheKey, regexp);
|
|
1036
|
-
return regexp;
|
|
1037
|
-
}
|
|
1038
|
-
function baseMatcher(inputs, patterns, options, firstMatchOnly) {
|
|
1039
|
-
inputs = sanitizeArray(inputs, "inputs");
|
|
1040
|
-
patterns = sanitizeArray(patterns, "patterns");
|
|
1041
|
-
if (patterns.length === 0) {
|
|
1042
|
-
return [];
|
|
1043
|
-
}
|
|
1044
|
-
patterns = patterns.map((pattern) => makeRegexp(pattern, options));
|
|
1045
|
-
const { allPatterns } = options || {};
|
|
1046
|
-
const result = [];
|
|
1047
|
-
for (const input of inputs) {
|
|
1048
|
-
let matches;
|
|
1049
|
-
const didFit = [...patterns].fill(false);
|
|
1050
|
-
for (const [index, pattern] of patterns.entries()) {
|
|
1051
|
-
if (pattern.test(input)) {
|
|
1052
|
-
didFit[index] = true;
|
|
1053
|
-
matches = !pattern.negated;
|
|
1054
|
-
if (!matches) {
|
|
1055
|
-
break;
|
|
1056
|
-
}
|
|
1057
|
-
}
|
|
1058
|
-
}
|
|
1059
|
-
if (!(matches === false || matches === void 0 && patterns.some((pattern) => !pattern.negated) || allPatterns && didFit.some((yes, index) => !yes && !patterns[index].negated))) {
|
|
1060
|
-
result.push(input);
|
|
1061
|
-
if (firstMatchOnly) {
|
|
1062
|
-
break;
|
|
1063
|
-
}
|
|
1064
|
-
}
|
|
1065
|
-
}
|
|
1066
|
-
return result;
|
|
1067
|
-
}
|
|
1068
|
-
|
|
1069
|
-
// src/treeHelper.js
|
|
1070
|
-
var DEFAULT_CONFIG = {
|
|
1071
|
-
id: "id",
|
|
1072
|
-
children: "children",
|
|
1073
|
-
pid: "pid"
|
|
1074
|
-
};
|
|
1075
|
-
var getConfig = (config) => Object.assign({}, DEFAULT_CONFIG, config);
|
|
1076
|
-
function findNode(tree, func, config = {}) {
|
|
1077
|
-
config = getConfig(config);
|
|
1078
|
-
const { children } = config;
|
|
1079
|
-
const list = [...tree];
|
|
1080
|
-
for (const node of list) {
|
|
1081
|
-
if (func(node)) {
|
|
1082
|
-
return node;
|
|
1083
|
-
}
|
|
1084
|
-
node[children] && list.push(...node[children]);
|
|
1085
|
-
}
|
|
1086
|
-
return null;
|
|
1087
|
-
}
|
|
1088
|
-
function findNodeAll(tree, func, config = {}) {
|
|
1089
|
-
config = getConfig(config);
|
|
1090
|
-
const { children } = config;
|
|
1091
|
-
const list = [...tree];
|
|
1092
|
-
const result = [];
|
|
1093
|
-
for (const node of list) {
|
|
1094
|
-
func(node) && result.push(node);
|
|
1095
|
-
node[children] && list.push(...node[children]);
|
|
1096
|
-
}
|
|
1097
|
-
return result;
|
|
1098
|
-
}
|
|
1099
|
-
function findPath(tree, func, config = {}) {
|
|
1100
|
-
config = getConfig(config);
|
|
1101
|
-
const path = [];
|
|
1102
|
-
const list = [...tree];
|
|
1103
|
-
const visitedSet = /* @__PURE__ */ new Set();
|
|
1104
|
-
const { children } = config;
|
|
1105
|
-
while (list.length) {
|
|
1106
|
-
const node = list[0];
|
|
1107
|
-
if (visitedSet.has(node)) {
|
|
1108
|
-
path.pop();
|
|
1109
|
-
list.shift();
|
|
1110
|
-
} else {
|
|
1111
|
-
visitedSet.add(node);
|
|
1112
|
-
node[children] && list.unshift(...node[children]);
|
|
1113
|
-
path.push(node);
|
|
1114
|
-
if (func(node)) {
|
|
1115
|
-
return path;
|
|
1116
|
-
}
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
|
-
return null;
|
|
1120
|
-
}
|
|
1121
|
-
function findPathAll(tree, func, config = {}) {
|
|
1122
|
-
config = getConfig(config);
|
|
1123
|
-
const path = [];
|
|
1124
|
-
const list = [...tree];
|
|
1125
|
-
const result = [];
|
|
1126
|
-
const visitedSet = /* @__PURE__ */ new Set();
|
|
1127
|
-
const { children } = config;
|
|
1128
|
-
while (list.length) {
|
|
1129
|
-
const node = list[0];
|
|
1130
|
-
if (visitedSet.has(node)) {
|
|
1131
|
-
path.pop();
|
|
1132
|
-
list.shift();
|
|
1133
|
-
} else {
|
|
1134
|
-
visitedSet.add(node);
|
|
1135
|
-
node[children] && list.unshift(...node[children]);
|
|
1136
|
-
path.push(node);
|
|
1137
|
-
func(node) && result.push([...path]);
|
|
1138
|
-
}
|
|
1139
|
-
}
|
|
1140
|
-
return result;
|
|
1141
|
-
}
|
|
1142
|
-
function filter(tree, func, config = {}) {
|
|
1143
|
-
config = getConfig(config);
|
|
1144
|
-
const children = config.children;
|
|
1145
|
-
function listFilter(list) {
|
|
1146
|
-
return list.map((node) => ({ ...node })).filter((node) => {
|
|
1147
|
-
node[children] = node[children] && listFilter(node[children]);
|
|
1148
|
-
return func(node) || node[children] && node[children].length;
|
|
1149
|
-
});
|
|
1150
|
-
}
|
|
1151
|
-
return listFilter(tree);
|
|
1152
|
-
}
|
|
1153
|
-
function forEach(tree, func, config = {}) {
|
|
1154
|
-
config = getConfig(config);
|
|
1155
|
-
const list = [...tree];
|
|
1156
|
-
const { children } = config;
|
|
1157
|
-
for (let i = 0; i < list.length; i++) {
|
|
1158
|
-
if (func(list[i])) {
|
|
1159
|
-
return;
|
|
1160
|
-
}
|
|
1161
|
-
children && list[i][children] && list.splice(i + 1, 0, ...list[i][children]);
|
|
1162
|
-
}
|
|
1163
|
-
}
|
|
1164
|
-
function treeMap(treeData, opt) {
|
|
1165
|
-
return treeData.map((item) => treeMapEach(item, opt));
|
|
1166
|
-
}
|
|
1167
|
-
function treeMapEach(data, { children = "children", conversion }) {
|
|
1168
|
-
const haveChildren = Array.isArray(data[children]) && data[children].length > 0;
|
|
1169
|
-
const conversionData = conversion(data) || {};
|
|
1170
|
-
if (haveChildren) {
|
|
1171
|
-
return {
|
|
1172
|
-
...conversionData,
|
|
1173
|
-
[children]: data[children].map(
|
|
1174
|
-
(i) => treeMapEach(i, {
|
|
1175
|
-
children,
|
|
1176
|
-
conversion
|
|
1177
|
-
})
|
|
1178
|
-
)
|
|
1179
|
-
};
|
|
1180
|
-
} else {
|
|
1181
|
-
return {
|
|
1182
|
-
...conversionData
|
|
1183
|
-
};
|
|
1184
|
-
}
|
|
1185
|
-
}
|
|
1186
|
-
|
|
1187
|
-
// src/uuid.js
|
|
1188
|
-
import { v4 as uuidV4 } from "uuid";
|
|
1189
|
-
function buildUUID({ native = true } = {}) {
|
|
1190
|
-
var _a, _b;
|
|
1191
|
-
if (!native) {
|
|
1192
|
-
return uuidV4();
|
|
1193
|
-
}
|
|
1194
|
-
return ((_b = (_a = window.crypto) == null ? void 0 : _a.randomUUID) == null ? void 0 : _b.call(_a)) ?? uuidV4();
|
|
1195
|
-
}
|
|
1196
|
-
var unique = 0;
|
|
1197
|
-
function buildShortUUID(prefix = "") {
|
|
1198
|
-
const time = Date.now();
|
|
1199
|
-
const random = Math.floor(Math.random() * 1e9);
|
|
1200
|
-
unique++;
|
|
1201
|
-
return `${prefix}_${random}${unique}${String(time)}`;
|
|
1202
|
-
}
|
|
1203
|
-
export {
|
|
1204
|
-
AesEncryption,
|
|
1205
|
-
IfActivity,
|
|
1206
|
-
addClass,
|
|
1207
|
-
addLocationListener,
|
|
1208
|
-
addResizeListener,
|
|
1209
|
-
buildBEM,
|
|
1210
|
-
buildShortUUID,
|
|
1211
|
-
buildUUID,
|
|
1212
|
-
createBEM,
|
|
1213
|
-
createNamespace,
|
|
1214
|
-
createSearchReg,
|
|
1215
|
-
dataURLtoBlob,
|
|
1216
|
-
decodeByBase64,
|
|
1217
|
-
deepMerge,
|
|
1218
|
-
off as domOffEvent,
|
|
1219
|
-
on as domOnEvent,
|
|
1220
|
-
downloadByBase64,
|
|
1221
|
-
downloadByData,
|
|
1222
|
-
downloadByOnlineUrl,
|
|
1223
|
-
downloadByUrl,
|
|
1224
|
-
downloadPercent,
|
|
1225
|
-
enableTransitions,
|
|
1226
|
-
encryptByBase64,
|
|
1227
|
-
encryptByMd5,
|
|
1228
|
-
escapeStringRegexp,
|
|
1229
|
-
extendSlots,
|
|
1230
|
-
filter as filterTree,
|
|
1231
|
-
findNode,
|
|
1232
|
-
findNodeAll,
|
|
1233
|
-
findPath,
|
|
1234
|
-
findPathAll,
|
|
1235
|
-
forEach as forEachTree,
|
|
1236
|
-
getActualWidthOfChars,
|
|
1237
|
-
getBoundingClientRect,
|
|
1238
|
-
getPopupContainer,
|
|
1239
|
-
getRawRoute,
|
|
1240
|
-
getSlot,
|
|
1241
|
-
getViewportOffset,
|
|
1242
|
-
hackCss,
|
|
1243
|
-
hasClass,
|
|
1244
|
-
highlightHtml,
|
|
1245
|
-
is,
|
|
1246
|
-
isBrowser,
|
|
1247
|
-
isChineseText,
|
|
1248
|
-
isChrome,
|
|
1249
|
-
isClient,
|
|
1250
|
-
isIterableArray,
|
|
1251
|
-
isMatch,
|
|
1252
|
-
isObject,
|
|
1253
|
-
isPositiveInteger,
|
|
1254
|
-
isSafari,
|
|
1255
|
-
isServer,
|
|
1256
|
-
isSupportNativeEllipsis,
|
|
1257
|
-
isSupportResizeObserver,
|
|
1258
|
-
isUrl,
|
|
1259
|
-
loadScript,
|
|
1260
|
-
matcher,
|
|
1261
|
-
openWindow,
|
|
1262
|
-
regexpMap,
|
|
1263
|
-
removeClass,
|
|
1264
|
-
removeResizeListener,
|
|
1265
|
-
setCssVar,
|
|
1266
|
-
setObjToUrlParams,
|
|
1267
|
-
treeMap,
|
|
1268
|
-
treeMapEach,
|
|
1269
|
-
triggerWindowResize,
|
|
1270
|
-
unloadScript,
|
|
1271
|
-
unsetAllProperty,
|
|
1272
|
-
urlToBase64,
|
|
1273
|
-
useRafThrottle,
|
|
1274
|
-
withInstall
|
|
1275
|
-
};
|
|
1
|
+
function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}function o(e,t,n){if(t)i(e.prototype,t);if(n)i(e,n);return e}function a(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function s(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function u(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var i=true;var o=false;var a,s;try{for(n=n.call(e);!(i=(a=n.next()).done);i=true){r.push(a.value);if(t&&r.length===t)break}}catch(e){o=true;s=e}finally{try{if(!i&&n["return"]!=null)n["return"]()}finally{if(o)throw s}}return r}function f(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){a(e,t,n[t])})}return e}function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function p(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{h(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function v(e,t){if(e==null)return{};var n=y(e,t);var r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++){r=o[i];if(t.indexOf(r)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,r))continue;n[r]=e[r]}}return n}function y(e,t){if(e==null)return{};var n={};var r=Object.keys(e);var i,o;for(o=0;o<r.length;o++){i=r[o];if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}function m(e,n){return t(e)||c(e,n)||b(e,n)||f()}function g(e){return n(e)||u(e)||b(e)||d()}function w(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function b(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}var _=Object.create;var S=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var O=function(e){return(typeof require==="undefined"?"undefined":w(require))<"u"?require:(typeof Proxy==="undefined"?"undefined":w(Proxy))<"u"?new Proxy(e,{get:function(e,t){return((typeof require==="undefined"?"undefined":w(require))<"u"?require:e)[t]}}):e}(function(e){if((typeof require==="undefined"?"undefined":w(require))<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var C=function(e,t){return function(){return e&&(t=e(e=0)),t}};var A=function(e,t){return function(){return t||e((t={exports:{}}).exports,t),t.exports}};var D=function(e,t,n,r){var i=true,o=false,a=undefined;if(t&&(typeof t==="undefined"?"undefined":w(t))=="object"||typeof t=="function")try{var s=function(){var i=c.value;!B.call(e,i)&&i!==n&&S(e,i,{get:function(){return t[i]},enumerable:!(r=x(t,i))||r.enumerable})};for(var u=k(t)[Symbol.iterator](),c;!(i=(c=u.next()).done);i=true)s()}catch(e){o=true;a=e}finally{try{if(!i&&u.return!=null){u.return()}}finally{if(o){throw a}}}return e};var z=function(e,t,n){return n=e!=null?_(E(e)):{},D(t||!e||!e.__esModule?S(n,"default",{value:e,enumerable:!0}):n,e)};var j=C(function(){});var L=A(function(e,t){j();(function(n,r){(typeof e==="undefined"?"undefined":w(e))=="object"?t.exports=e=r():typeof define=="function"&&define.amd?define([],r):n.CryptoJS=r()})(e,function(){var e=e||function(e,t){var n;if((typeof window==="undefined"?"undefined":w(window))<"u"&&window.crypto&&(n=window.crypto),(typeof self==="undefined"?"undefined":w(self))<"u"&&self.crypto&&(n=self.crypto),(typeof globalThis==="undefined"?"undefined":w(globalThis))<"u"&&globalThis.crypto&&(n=globalThis.crypto),!n&&(typeof window==="undefined"?"undefined":w(window))<"u"&&window.msCrypto&&(n=window.msCrypto),!n&&(typeof global==="undefined"?"undefined":w(global))<"u"&&global.crypto&&(n=global.crypto),!n&&typeof O=="function")try{n=O("crypto")}catch(e){}var r=function e(){if(n){if(typeof n.getRandomValues=="function")try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if(typeof n.randomBytes=="function")try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),o={},a=o.lib={},s=a.Base=function(){return{extend:function e(e){var t=i(this);return e&&t.mixIn(e),(!t.hasOwnProperty("init")||this.init===t.init)&&(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function e(){var e=this.extend();return e.init.apply(e,arguments),e},init:function e(){},mixIn:function e(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function e(){return this.init.prototype.extend(this)}}}(),u=a.WordArray=s.extend({init:function e(e,n){e=this.words=e||[],n!=t?this.sigBytes=n:this.sigBytes=e.length*4},toString:function e(e){return(e||f).stringify(this)},concat:function e(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var a=n[o>>>2]>>>24-o%4*8&255;t[r+o>>>2]|=a<<24-(r+o)%4*8}else for(var s=0;s<i;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function t(){var t=this.words,n=this.sigBytes;t[n>>>2]&=0xffffffff<<32-n%4*8,t.length=e.ceil(n/4)},clone:function e(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function e(e){for(var t=[],n=0;n<e;n+=4)t.push(r());return new u.init(t,e)}}),c=o.enc={},f=c.Hex={stringify:function e(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((o&15).toString(16))}return r.join("")},parse:function e(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(n,t/2)}},d=c.Latin1={stringify:function e(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function e(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(e.charCodeAt(r)&255)<<24-r%4*8;return new u.init(n,t)}},l=c.Utf8={stringify:function e(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function e(e){return d.parse(unescape(encodeURIComponent(e)))}},h=a.BufferedBlockAlgorithm=s.extend({reset:function e(){this._data=new u.init,this._nDataBytes=0},_append:function e(e){typeof e=="string"&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function t(t){var n,r=this._data,i=r.words,o=r.sigBytes,a=this.blockSize,s=a*4,c=o/s;t?c=e.ceil(c):c=e.max((c|0)-this._minBufferSize,0);var f=c*a,d=e.min(f*4,o);if(f){for(var l=0;l<f;l+=a)this._doProcessBlock(i,l);n=i.splice(0,f),r.sigBytes-=d}return new u.init(n,d)},clone:function e(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),p=a.Hasher=h.extend({cfg:s.extend(),init:function e(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function e(){h.reset.call(this),this._doReset()},update:function e(e){return this._append(e),this._process(),this},finalize:function e(e){e&&this._append(e);var t=this._doFinalize();return t},blockSize:512/32,_createHelper:function e(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function e(e){return function(t,n){return new v.HMAC.init(e,n).finalize(t)}}}),v=o.algo={};return o}(Math);return e})});var P=A(function(e,t){j();(function(n,r){(typeof e==="undefined"?"undefined":w(e))=="object"?t.exports=e=r(L()):typeof define=="function"&&define.amd?define(["./core"],r):r(n.CryptoJS)})(e,function(e){return function(){var t=e,n=t.lib,r=n.WordArray,i=t.enc,o=i.Base64={stringify:function e(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],o=0;o<n;o+=3)for(var a=t[o>>>2]>>>24-o%4*8&255,s=t[o+1>>>2]>>>24-(o+1)%4*8&255,u=t[o+2>>>2]>>>24-(o+2)%4*8&255,c=a<<16|s<<8|u,f=0;f<4&&o+f*.75<n;f++)i.push(r.charAt(c>>>6*(3-f)&63));var d=r.charAt(64);if(d)for(;i.length%4;)i.push(d);return i.join("")},parse:function e(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var i=0;i<n.length;i++)r[n.charCodeAt(i)]=i}var o=n.charAt(64);if(o){var s=e.indexOf(o);s!==-1&&(t=s)}return a(e,t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function a(e,t,n){for(var i=[],o=0,a=0;a<t;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2,u=n[e.charCodeAt(a)]>>>6-a%4*2,c=s|u;i[o>>>2]|=c<<24-o%4*8,o++}return r.create(i,o)}}(),e.enc.Base64})});var F=A(function(e,t){j();(function(n,r){(typeof e==="undefined"?"undefined":w(e))=="object"?t.exports=e=r(L()):typeof define=="function"&&define.amd?define(["./core"],r):r(n.CryptoJS)})(e,function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,o=r.Hasher,a=n.algo,s=[];(function(){for(var e=0;e<64;e++)s[e]=t.abs(t.sin(e+1))*0x100000000|0})();var u=a.MD5=o.extend({_doReset:function e(){this._hash=new i.init([0x67452301,0xefcdab89,0x98badcfe,0x10325476])},_doProcessBlock:function e(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=(i<<8|i>>>24)&0xff00ff|(i<<24|i>>>8)&0xff00ff00}var o=this._hash.words,a=e[t+0],u=e[t+1],h=e[t+2],p=e[t+3],v=e[t+4],y=e[t+5],m=e[t+6],g=e[t+7],w=e[t+8],b=e[t+9],_=e[t+10],S=e[t+11],x=e[t+12],k=e[t+13],E=e[t+14],B=e[t+15],O=o[0],C=o[1],A=o[2],D=o[3];O=c(O,C,A,D,a,7,s[0]),D=c(D,O,C,A,u,12,s[1]),A=c(A,D,O,C,h,17,s[2]),C=c(C,A,D,O,p,22,s[3]),O=c(O,C,A,D,v,7,s[4]),D=c(D,O,C,A,y,12,s[5]),A=c(A,D,O,C,m,17,s[6]),C=c(C,A,D,O,g,22,s[7]),O=c(O,C,A,D,w,7,s[8]),D=c(D,O,C,A,b,12,s[9]),A=c(A,D,O,C,_,17,s[10]),C=c(C,A,D,O,S,22,s[11]),O=c(O,C,A,D,x,7,s[12]),D=c(D,O,C,A,k,12,s[13]),A=c(A,D,O,C,E,17,s[14]),C=c(C,A,D,O,B,22,s[15]),O=f(O,C,A,D,u,5,s[16]),D=f(D,O,C,A,m,9,s[17]),A=f(A,D,O,C,S,14,s[18]),C=f(C,A,D,O,a,20,s[19]),O=f(O,C,A,D,y,5,s[20]),D=f(D,O,C,A,_,9,s[21]),A=f(A,D,O,C,B,14,s[22]),C=f(C,A,D,O,v,20,s[23]),O=f(O,C,A,D,b,5,s[24]),D=f(D,O,C,A,E,9,s[25]),A=f(A,D,O,C,p,14,s[26]),C=f(C,A,D,O,w,20,s[27]),O=f(O,C,A,D,k,5,s[28]),D=f(D,O,C,A,h,9,s[29]),A=f(A,D,O,C,g,14,s[30]),C=f(C,A,D,O,x,20,s[31]),O=d(O,C,A,D,y,4,s[32]),D=d(D,O,C,A,w,11,s[33]),A=d(A,D,O,C,S,16,s[34]),C=d(C,A,D,O,E,23,s[35]),O=d(O,C,A,D,u,4,s[36]),D=d(D,O,C,A,v,11,s[37]),A=d(A,D,O,C,g,16,s[38]),C=d(C,A,D,O,_,23,s[39]),O=d(O,C,A,D,k,4,s[40]),D=d(D,O,C,A,a,11,s[41]),A=d(A,D,O,C,p,16,s[42]),C=d(C,A,D,O,m,23,s[43]),O=d(O,C,A,D,b,4,s[44]),D=d(D,O,C,A,x,11,s[45]),A=d(A,D,O,C,B,16,s[46]),C=d(C,A,D,O,h,23,s[47]),O=l(O,C,A,D,a,6,s[48]),D=l(D,O,C,A,g,10,s[49]),A=l(A,D,O,C,E,15,s[50]),C=l(C,A,D,O,y,21,s[51]),O=l(O,C,A,D,x,6,s[52]),D=l(D,O,C,A,p,10,s[53]),A=l(A,D,O,C,_,15,s[54]),C=l(C,A,D,O,u,21,s[55]),O=l(O,C,A,D,w,6,s[56]),D=l(D,O,C,A,B,10,s[57]),A=l(A,D,O,C,m,15,s[58]),C=l(C,A,D,O,k,21,s[59]),O=l(O,C,A,D,v,6,s[60]),D=l(D,O,C,A,S,10,s[61]),A=l(A,D,O,C,h,15,s[62]),C=l(C,A,D,O,b,21,s[63]),o[0]=o[0]+O|0,o[1]=o[1]+C|0,o[2]=o[2]+A|0,o[3]=o[3]+D|0},_doFinalize:function e(){var e=this._data,n=e.words,r=this._nDataBytes*8,i=e.sigBytes*8;n[i>>>5]|=128<<24-i%32;var o=t.floor(r/0x100000000),a=r;n[(i+64>>>9<<4)+15]=(o<<8|o>>>24)&0xff00ff|(o<<24|o>>>8)&0xff00ff00,n[(i+64>>>9<<4)+14]=(a<<8|a>>>24)&0xff00ff|(a<<24|a>>>8)&0xff00ff00,e.sigBytes=(n.length+1)*4,this._process();for(var s=this._hash,u=s.words,c=0;c<4;c++){var f=u[c];u[c]=(f<<8|f>>>24)&0xff00ff|(f<<24|f>>>8)&0xff00ff00}return s},clone:function e(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,n,r,i,o,a){var s=e+(t&n|~t&r)+i+a;return(s<<o|s>>>32-o)+t}function f(e,t,n,r,i,o,a){var s=e+(t&r|n&~r)+i+a;return(s<<o|s>>>32-o)+t}function d(e,t,n,r,i,o,a){var s=e+(t^n^r)+i+a;return(s<<o|s>>>32-o)+t}function l(e,t,n,r,i,o,a){var s=e+(n^(t|~r))+i+a;return(s<<o|s>>>32-o)+t}n.MD5=o._createHelper(u),n.HmacMD5=o._createHmacHelper(u)}(Math),e.MD5})});var M=A(function(e,t){j();(function(n,r){(typeof e==="undefined"?"undefined":w(e))=="object"?t.exports=e=r(L()):typeof define=="function"&&define.amd?define(["./core"],r):r(n.CryptoJS)})(e,function(e){return function(){var t=e,n=t.lib,r=n.WordArray,i=n.Hasher,o=t.algo,a=[],s=o.SHA1=i.extend({_doReset:function e(){this._hash=new r.init([0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0])},_doProcessBlock:function e(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],s=n[3],u=n[4],c=0;c<80;c++){if(c<16)a[c]=e[t+c]|0;else{var f=a[c-3]^a[c-8]^a[c-14]^a[c-16];a[c]=f<<1|f>>>31}var d=(r<<5|r>>>27)+u+a[c];c<20?d+=(i&o|~i&s)+0x5a827999:c<40?d+=(i^o^s)+0x6ed9eba1:c<60?d+=(i&o|i&s|o&s)-0x70e44324:d+=(i^o^s)-0x359d3e2a,u=s,s=o,o=i<<30|i>>>2,i=r,r=d}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+u|0},_doFinalize:function e(){var e=this._data,t=e.words,n=this._nDataBytes*8,r=e.sigBytes*8;return t[r>>>5]|=128<<24-r%32,t[(r+64>>>9<<4)+14]=Math.floor(n/0x100000000),t[(r+64>>>9<<4)+15]=n,e.sigBytes=t.length*4,this._process(),this._hash},clone:function e(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)}(),e.SHA1})});var R=A(function(e,t){j();(function(n,r){(typeof e==="undefined"?"undefined":w(e))=="object"?t.exports=e=r(L()):typeof define=="function"&&define.amd?define(["./core"],r):r(n.CryptoJS)})(e,function(e){(function(){var t=e,n=t.lib,r=n.Base,i=t.enc,o=i.Utf8,a=t.algo,s=a.HMAC=r.extend({init:function e(e,t){e=this._hasher=new e.init,typeof t=="string"&&(t=o.parse(t));var n=e.blockSize,r=n*4;t.sigBytes>r&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),a=this._iKey=t.clone(),s=i.words,u=a.words,c=0;c<n;c++)s[c]^=0x5c5c5c5c,u[c]^=0x36363636;i.sigBytes=a.sigBytes=r,this.reset()},reset:function e(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function e(e){return this._hasher.update(e),this},finalize:function e(e){var t=this._hasher,n=t.finalize(e);t.reset();var r=t.finalize(this._oKey.clone().concat(n));return r}})})()})});var I=A(function(e,t){j();(function(n,r,i){(typeof e==="undefined"?"undefined":w(e))=="object"?t.exports=e=r(L(),M(),R()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],r):r(n.CryptoJS)})(e,function(e){return function(){var t=e,n=t.lib,r=n.Base,i=n.WordArray,o=t.algo,a=o.MD5,s=o.EvpKDF=r.extend({cfg:r.extend({keySize:128/32,hasher:a,iterations:1}),init:function e(e){this.cfg=this.cfg.extend(e)},compute:function e(e,t){for(var n,r=this.cfg,o=r.hasher.create(),a=i.create(),s=a.words,u=r.keySize,c=r.iterations;s.length<u;){n&&o.update(n),n=o.update(e).finalize(t),o.reset();for(var f=1;f<c;f++)n=o.finalize(n),o.reset();a.concat(n)}return a.sigBytes=u*4,a}});t.EvpKDF=function(e,t,n){return s.create(n).compute(e,t)}}(),e.EvpKDF})});var T=A(function(e,t){j();(function(n,r,i){(typeof e==="undefined"?"undefined":w(e))=="object"?t.exports=e=r(L(),I()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],r):r(n.CryptoJS)})(e,function(e){e.lib.Cipher||function(t){var n=e,r=n.lib,i=r.Base,o=r.WordArray,a=r.BufferedBlockAlgorithm,s=n.enc,u=s.Utf8,c=s.Base64,f=n.algo,d=f.EvpKDF,l=r.Cipher=a.extend({cfg:i.extend(),createEncryptor:function e(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function e(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function e(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function e(){a.reset.call(this),this._doReset()},process:function e(e){return this._append(e),this._process()},finalize:function e(e){e&&this._append(e);var t=this._doFinalize();return t},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return typeof e=="string"?B:x}return function(t){return{encrypt:function n(n,r,i){return e(r).encrypt(t,n,r,i)},decrypt:function n(n,r,i){return e(r).decrypt(t,n,r,i)}}}}()}),h=r.StreamCipher=l.extend({_doFinalize:function e(){var e=this._process(!0);return e},blockSize:1}),p=n.mode={},v=r.BlockCipherMode=i.extend({createEncryptor:function e(e,t){return this.Encryptor.create(e,t)},createDecryptor:function e(e,t){return this.Decryptor.create(e,t)},init:function e(e,t){this._cipher=e,this._iv=t}}),y=p.CBC=function(){var e=v.extend();e.Encryptor=e.extend({processBlock:function e(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),e.Decryptor=e.extend({processBlock:function e(e,t){var r=this._cipher,i=r.blockSize,o=e.slice(t,t+i);r.decryptBlock(e,t),n.call(this,e,t,i),this._prevBlock=o}});function n(e,n,r){var i,o=this._iv;o?(i=o,this._iv=t):i=this._prevBlock;for(var a=0;a<r;a++)e[n+a]^=i[a]}return e}(),m=n.pad={},g=m.Pkcs7={pad:function e(e,t){for(var n=t*4,r=n-e.sigBytes%n,i=r<<24|r<<16|r<<8|r,a=[],s=0;s<r;s+=4)a.push(i);var u=o.create(a,r);e.concat(u)},unpad:function e(e){var t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}},w=r.BlockCipher=l.extend({cfg:l.cfg.extend({mode:y,padding:g}),reset:function e(){var e;l.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function e(e,t){this._mode.processBlock(e,t)},_doFinalize:function e(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:128/32}),b=r.CipherParams=i.extend({init:function e(e){this.mixIn(e)},toString:function e(e){return(e||this.formatter).stringify(this)}}),_=n.format={},S=_.OpenSSL={stringify:function e(e){var t,n=e.ciphertext,r=e.salt;return r?t=o.create([0x53616c74,0x65645f5f]).concat(r).concat(n):t=n,t.toString(c)},parse:function e(e){var t,n=c.parse(e),r=n.words;return r[0]==0x53616c74&&r[1]==0x65645f5f&&(t=o.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),b.create({ciphertext:n,salt:t})}},x=r.SerializableCipher=i.extend({cfg:i.extend({format:S}),encrypt:function e(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r),o=i.finalize(t),a=i.cfg;return b.create({ciphertext:o,key:n,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function e(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=e.createDecryptor(n,r).finalize(t.ciphertext);return i},_parse:function e(e,t){return typeof e=="string"?t.parse(e,this):e}}),k=n.kdf={},E=k.OpenSSL={execute:function e(e,t,n,r,i){if(r||(r=o.random(64/8)),i)var a=d.create({keySize:t+n,hasher:i}).compute(e,r);else var a=d.create({keySize:t+n}).compute(e,r);var s=o.create(a.words.slice(t),n*4);return a.sigBytes=t*4,b.create({key:a,iv:s,salt:r})}},B=r.PasswordBasedCipher=x.extend({cfg:x.cfg.extend({kdf:E}),encrypt:function e(e,t,n,r){r=this.cfg.extend(r);var i=r.kdf.execute(n,e.keySize,e.ivSize,r.salt,r.hasher);r.iv=i.iv;var o=x.encrypt.call(this,e,t,i.key,r);return o.mixIn(i),o},decrypt:function e(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=r.kdf.execute(n,e.keySize,e.ivSize,t.salt,r.hasher);r.iv=i.iv;var o=x.decrypt.call(this,e,t,i.key,r);return o}})}()})});var U=A(function(e,t){j();(function(n,r,i){(typeof e==="undefined"?"undefined":w(e))=="object"?t.exports=e=r(L(),P(),F(),I(),T()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],r):r(n.CryptoJS)})(e,function(e){return function(){var t=e,n=t.lib,r=n.BlockCipher,i=t.algo,o=[],a=[],s=[],u=[],c=[],f=[],d=[],l=[],h=[],p=[];(function(){for(var e=[],t=0;t<256;t++)t<128?e[t]=t<<1:e[t]=t<<1^283;for(var n=0,r=0,t=0;t<256;t++){var i=r^r<<1^r<<2^r<<3^r<<4;i=i>>>8^i&255^99,o[n]=i,a[i]=n;var v=e[n],y=e[v],m=e[y],g=e[i]*257^i*0x1010100;s[n]=g<<24|g>>>8,u[n]=g<<16|g>>>16,c[n]=g<<8|g>>>24,f[n]=g;var g=m*0x1010101^y*65537^v*257^n*0x1010100;d[i]=g<<24|g>>>8,l[i]=g<<16|g>>>16,h[i]=g<<8|g>>>24,p[i]=g,n?(n=v^e[e[e[m^v]]],r^=e[e[r]]):n=r=1}})();var v=[0,1,2,4,8,16,32,64,128,27,54],y=i.AES=r.extend({_doReset:function e(){var e;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var t=this._keyPriorReset=this._key,n=t.words,r=t.sigBytes/4,i=this._nRounds=r+6,a=(i+1)*4,s=this._keySchedule=[],u=0;u<a;u++)u<r?s[u]=n[u]:(e=s[u-1],u%r?r>6&&u%r==4&&(e=o[e>>>24]<<24|o[e>>>16&255]<<16|o[e>>>8&255]<<8|o[e&255]):(e=e<<8|e>>>24,e=o[e>>>24]<<24|o[e>>>16&255]<<16|o[e>>>8&255]<<8|o[e&255],e^=v[u/r|0]<<24),s[u]=s[u-r]^e);for(var c=this._invKeySchedule=[],f=0;f<a;f++){var u=a-f;if(f%4)var e=s[u];else var e=s[u-4];f<4||u<=4?c[f]=e:c[f]=d[o[e>>>24]]^l[o[e>>>16&255]]^h[o[e>>>8&255]]^p[o[e&255]]}}},encryptBlock:function e(e,t){this._doCryptBlock(e,t,this._keySchedule,s,u,c,f,o)},decryptBlock:function e(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,d,l,h,p,a);var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function e(e,t,n,r,i,o,a,s){for(var u=this._nRounds,c=e[t]^n[0],f=e[t+1]^n[1],d=e[t+2]^n[2],l=e[t+3]^n[3],h=4,p=1;p<u;p++){var v=r[c>>>24]^i[f>>>16&255]^o[d>>>8&255]^a[l&255]^n[h++],y=r[f>>>24]^i[d>>>16&255]^o[l>>>8&255]^a[c&255]^n[h++],m=r[d>>>24]^i[l>>>16&255]^o[c>>>8&255]^a[f&255]^n[h++],g=r[l>>>24]^i[c>>>16&255]^o[f>>>8&255]^a[d&255]^n[h++];c=v,f=y,d=m,l=g}var v=(s[c>>>24]<<24|s[f>>>16&255]<<16|s[d>>>8&255]<<8|s[l&255])^n[h++],y=(s[f>>>24]<<24|s[d>>>16&255]<<16|s[l>>>8&255]<<8|s[c&255])^n[h++],m=(s[d>>>24]<<24|s[l>>>16&255]<<16|s[c>>>8&255]<<8|s[f&255])^n[h++],g=(s[l>>>24]<<24|s[c>>>16&255]<<16|s[f>>>8&255]<<8|s[d&255])^n[h++];e[t]=v,e[t+1]=y,e[t+2]=m,e[t+3]=g},keySize:256/32});t.AES=r._createHelper(y)}(),e.AES})});var H=A(function(e,t){j();(function(n,r){(typeof e==="undefined"?"undefined":w(e))=="object"?t.exports=e=r(L()):typeof define=="function"&&define.amd?define(["./core"],r):r(n.CryptoJS)})(e,function(e){return e.enc.Utf8})});var $=A(function(e,t){j();(function(n,r,i){(typeof e==="undefined"?"undefined":w(e))=="object"?t.exports=e=r(L(),T()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],r):r(n.CryptoJS)})(e,function(e){return e.pad.Pkcs7})});var N=A(function(e,t){j();(function(n,r,i){(typeof e==="undefined"?"undefined":w(e))=="object"?t.exports=e=r(L(),T()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],r):r(n.CryptoJS)})(e,function(e){return e.mode.ECB=function(){var t=e.lib.BlockCipherMode.extend();return t.Encryptor=t.extend({processBlock:function e(e,t){this._cipher.encryptBlock(e,t)}}),t.Decryptor=t.extend({processBlock:function e(e,t){this._cipher.decryptBlock(e,t)}}),t}(),e.mode.ECB})});j();j();import{isPlainObject as J,mergeWith as q,isArray as W,isEqual as K,intersectionWith as X,unionWith as V}from"lodash-es";j();j();var Z={mobile:/^(?:(?:\+|00)86)?1[3-9]\d{9}$/,tel:/^(?:(?:\d{3}-)?\d{8}|(?:\d{4}-)?\d{7,8})(?:-\d+)?$/,numAndLetter:/^[A-Z0-9]+$/i,password:/^\S*(?=\S{6,})(?=\S*\d)(?=\S*[A-Z])(?=\S*[a-z])(?=\S*[!@#$%^&*? ])\S+$/,email:/^[A-Z0-9\u4E00-\u9FA5]+@[\w-]+(?:\.[\w-]+)+$/i,postalCode:/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/,identityCard:/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[12]\d|30|31)\d{3}[\dX]$/i,ip:/^((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(?::(?:\d|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5]))?$/,url:/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-][^!@#$%^&*?.\s]{0,64}\.)+[a-z]{2,6}\/?/,httpsUrl:/^https:\/\//,domain:/^([0-9a-z-]+\.)+([a-z]{2,})$/i,plateNumber:/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$/,md5:/^[a-f0-9]{32}$/i,base64:/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([\w!$&',()*+;=\-.~:@/?%\s]*?)\s*$/i,uuid:/^[a-f\d]{4}(?:[a-f\d]{4}-){4}[a-f\d]{12}$/i,version:/^\d+(?:\.\d+){2}$/,videoUrl:/^https?:\/\/(.+\/)+.+(\.(swf|avi|flv|mpg|rm|mov|wav|asf|3gp|mkv|rmvb|mp4))$/i,imageUrl:/^https?:\/\/(.+\/)+.+(\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i,chinese:/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/,itcode:/^[a-z]+\d*$/i};var Y=Object.prototype.toString;function Q(e,t){return Y.call(e)==="[object ".concat(t,"]")}function G(e){return e!==null&&Q(e,"Object")}function ee(e){return Z.url.test(e)}function et(e){return Array.isArray(e)&&e.length>0}function en(e){return Number.isInteger(e)&&e>=0}var er=(typeof window==="undefined"?"undefined":w(window))>"u",ei=!er,eo=ei&&window.navigator.userAgent.toLowerCase().includes("chrome"),ea=ei&&window.navigator.userAgent.toLowerCase().includes("safari"),es=(typeof window==="undefined"?"undefined":w(window))<"u"&&(typeof document==="undefined"?"undefined":w(document))<"u",eu=es&&w(document.body.style.lineClamp)<"u",ec=es&&(typeof ResizeObserver==="undefined"?"undefined":w(ResizeObserver))<"u",ef=function(e){return Z.chinese.test(e)};var ed=function(e,t){var n=e;return n.install=function(r){r.component(n.name||n.displayName,e),t&&(r.config.globalProperties[t]=e)},e};function el(e){if(!e)return e;var t=e.matched,n=v(e,["matched"]);return p(l({},n),{matched:t?t.map(function(e){return{meta:e.meta,name:e.name,path:e.path}}):void 0})}function eh(e,t){var n=t||{},r=n.target,i=r===void 0?"__blank":r,o=n.noopener,a=o===void 0?!0:o,s=n.noreferrer,u=s===void 0?!0:s,c=[];a&&c.push("noopener=yes"),u&&c.push("noreferrer=yes"),window.open(e,i,c.join(","))}function ep(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"replace";return t?e?q(e,t,function(e,t){if(W(t)&&W(e))switch(n){case"union":return V(e,t,K);case"intersection":return X(e,t,K);case"concat":return e.concat(t);case"replace":return t;default:throw new Error("Unknown merge array strategy: ".concat(n))}if(G(t)&&G(e))return ep(e,t,n)}):t:e}function ev(e){var t;return(t=e===null||e===void 0?void 0:e.parentNode)!==null&&t!==void 0?t:document.body}function ey(e,t){if(!et(Object.keys(t)))return e;var n="";for(var r in t)n+="".concat(r,"=").concat(encodeURIComponent(t[r]),"&");return n=n.replace(/&$/,""),/\?$/.test(e)?e+n:e.replace(/\/?$/,"?")+n}function em(e){J(e)&&Object.keys(e).forEach(function(t){Reflect.deleteProperty(e,t)})}function eg(e){return["$","(",")","*","+",".","[","]","?","\\","^","{","}","|"].includes(e)?"\\".concat(e):e}function ew(e){var t=[""].concat(g(g(e).map(function(e){return eg(e)})),[""]).join(".*");return new RegExp(t,"i")}function eb(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var n=t.size,r=n===void 0?14:n,i=t.family,o=i===void 0?getComputedStyle(document.documentElement).getPropertyValue("--vxe-font-family")||"sans-serif":i,a=document.createElement("canvas").getContext("2d");a.font="".concat(r,"px ").concat(o);var s=a.measureText(e),u=Math.abs(s.actualBoundingBoxLeft)+Math.abs(s.actualBoundingBoxRight);return Math.ceil(Math.max(s.width,u))}j();function e_(e,t){return t?typeof t=="string"?" ".concat(e,"--").concat(t):Array.isArray(t)?t.reduce(function(t,n){return t+e_(e,n)},""):Object.keys(t).reduce(function(n,r){return n+(t[r]?e_(e,r):"")},""):""}function eS(e){return function(t,n){return t&&typeof t!="string"&&(n=t,t=""),t=t?"".concat(e,"__").concat(t):e,"".concat(t).concat(e_(t,n))}}function ex(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"gsc";return[eS("".concat(t,"-").concat(e))]}function ek(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"gsc";var n="".concat(t,"-").concat(e);return[n,eS(n)]}j();var eE=z(U(),1),eB=z(H(),1),eO=z($(),1),eC=z(N(),1),eA=z(F(),1),eD=z(P(),1),ez=/*#__PURE__*/function(){"use strict";function e(t){r(this,e);var n=t.key,i=t.iv;n&&(this.key=(0,eB.parse)(n)),i&&(this.iv=(0,eB.parse)(i))}o(e,[{key:"getOptions",get:function e(){return{mode:eC.default,padding:eO.default,iv:this.iv}}},{key:"encryptByAES",value:function e(e){return(0,eE.encrypt)(e,this.key,this.getOptions).toString()}},{key:"decryptByAES",value:function e(e){return(0,eE.decrypt)(e,this.key,this.getOptions).toString(eB.default)}}]);return e}();function ej(e){return eB.default.parse(e).toString(eD.default)}function eL(e){return eD.default.parse(e).toString(eB.default)}function eP(e){return(0,eA.default)(e).toString()}j();import{upperFirst as eF}from"lodash-es";var eM=function(){return document.documentElement},eR=function(){return"startViewTransition"in document&&window.matchMedia("(prefers-reduced-motion: no-preference)").matches};function eI(e){return!e||!e.getBoundingClientRect?0:e.getBoundingClientRect()}function eT(e){return(e||"").replace(/^\s+|\s+$/g,"")}function eU(e,t){if(!e||!t)return!1;if(t.includes(" "))throw new Error("className should not contain space.");return e.classList?e.classList.contains(t):" ".concat(e.className," ").includes(" ".concat(t," "))}function eH(e,t,n){n||(n=eM()),n.style.setProperty(e,t)}function e$(e,t){if(!e)return;var n=e.className,r=(t||"").split(" ");for(var i=0,o=r.length;i<o;i++){var a=r[i];a&&(e.classList?e.classList.add(a):eU(e,a)||(n+=" ".concat(a)))}e.classList||(e.className=n)}function eN(e,t){if(!e||!t)return;var n=t.split(" "),r=" ".concat(e.className," ");for(var i=0,o=n.length;i<o;i++){var a=n[i];a&&(e.classList?e.classList.remove(a):eU(e,a)&&(r=r.replace(" ".concat(a," ")," ")))}e.classList||(e.className=eT(r))}function eJ(e){var t=document.documentElement,n=t.scrollLeft,r=t.scrollTop,i=t.clientLeft,o=t.clientTop,a=window.scrollX,s=window.scrollY,u=eI(e),c=u.left,f=u.top,d=u.width,l=u.height,h=(a||n)-(i||0),p=(s||r)-(o||0),v=c+a,y=f+s,m=v-h,g=y-p,w=window.document.documentElement.clientWidth,b=window.document.documentElement.clientHeight;return{left:m,top:g,right:w-d-m,bottom:b-l-g,rightIncludeBody:w-m,bottomIncludeBody:b-g}}function eq(e,t){var n=["webkit","Moz","ms","OT"],r={};return n.forEach(function(n){r["".concat(n).concat(eF(e))]=t}),p(l({},r),a({},e,t))}function eW(e,t,n){e&&t&&n&&e.addEventListener(t,n,!1)}function eK(e,t,n){e&&t&&n&&e.removeEventListener(t,n,!1)}function eX(e){var t=!1;return function(){var n=this;for(var r=arguments.length,i=new Array(r),o=0;o<r;o++){i[o]=arguments[o]}t||(t=!0,window.requestAnimationFrame(function(){e.apply(n,i),t=!1}))}}j();import eV from"resize-observer-polyfill";function eZ(e){var t=true,n=false,r=undefined;try{for(var i=e[Symbol.iterator](),o;!(t=(o=i.next()).done);t=true){var a=o.value;var s=a.target.__resizeListeners__||[];s.length&&s.forEach(function(e){e()})}}catch(e){n=true;r=e}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}}}function eY(e,t){er||(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new eV(eZ),e.__ro__.observe(e)),e.__resizeListeners__.push(t))}function eQ(e,t){!e||!e.__resizeListeners__||(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||(e.__ro__.disconnect(),e.__ro__=null,e.__resizeListeners__=null))}function eG(){var e=new Event("resize",{bubbles:!0,cancelable:!0});window.dispatchEvent(e)}function e0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};function n(e){var t=window.history[e];return function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++){r[i]=arguments[i]}var o=new Event(e);return o.arguments=r,window.dispatchEvent(o),t.apply(this,r)}}return window.history.pushState=n("pushState"),window.history.replaceState=n("replaceState"),window.addEventListener("popstate",e,t),window.addEventListener("hashchange",e,t),window.addEventListener("replaceState",e,t),window.addEventListener("pushState",e,t),{removeListener:function(){window.removeEventListener("popstate",e,t),window.removeEventListener("hashchange",e,t),window.removeEventListener("replaceState",e,t),window.removeEventListener("pushState",e,t)}}}j();import{round as e1,isNil as e2}from"lodash-es";function e4(e){var t=e.split(","),n=t[0].match(/:(.*?);/)[1],r=window.atob(t[1]),i=r.length,o=new Uint8Array(i);for(;i--;)o[i]=r.charCodeAt(i);return new Blob([o],{type:n})}function e5(e,t){return new Promise(function(n,r){var i=document.createElement("CANVAS"),o=i.getContext("2d"),a=new Image;a.crossOrigin="",a.onload=function(){if(!i||!o)return r();i.height=a.height,i.width=a.width,o.drawImage(a,0,0);var e=i.toDataURL(t||"image/png");i=null,n(e)},a.src=e})}function e6(e){var t=e.loaded,n=e.total;if(n<=0||e2(n))return 0;var r=t/n;return e1((r>1?1:r)*100)}function e8(e,t,n,r){e5(e).then(function(e){e3(e,t,n,r)})}function e3(e,t,n,r){var i=e4(e);e9(i,t,n,r)}function e9(e,t,n,r){var i=(typeof r==="undefined"?"undefined":w(r))<"u"?[r,e]:[e],o=new Blob(i,{type:n||"application/octet-stream"});if(w(window.navigator.msSaveBlob)<"u")window.navigator.msSaveBlob(o,t);else{var a=window.URL.createObjectURL(o),s=document.createElement("a");s.style.display="none",s.href=a,s.setAttribute("download",t),w(s.download)>"u"&&s.setAttribute("target","_blank"),document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(a)}}function e7(e){var t=e.url,n=e.target,r=n===void 0?"_blank":n,i=e.fileName;if(/iP/.test(window.navigator.userAgent))return!1;if(eo||ea){var o=document.createElement("a");return o.href=t,o.download=i||t.substring(t.lastIndexOf("/")+1,t.length),o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o),!0}return t.includes("?")||(t+="?download"),eh(t,{target:r}),!0}j();var te=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"ig";var r=new RegExp(t,n);return g(e.matchAll(r)).map(function(e){return{index:e.index,subString:e[0]}})};function tt(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}var tn=function(e,t){var n=e;if(!t)return n;var r=t.tagName,i=r===void 0?"mark":r,o=t.bgColor,a=t.color,s=t.style,u=s===void 0?{}:s,c=t.renderHighlightKeyword;if(typeof c=="function")return c(e);u.backgroundColor=o,u.color=a;var f='style="'.concat(Object.keys(u).map(function(e){return"".concat(tt(e),":").concat(u[e])}).join(";"),'"');return"<".concat(i," ").concat(f,">").concat(n,"</").concat(i,">")},tr=function(e,t){var n="";return t.forEach(function(t){var r=t.start,i=t.end,o=t.option,a=e.slice(r,i),s=tn(a,o);n+=s,t.subString=s}),n},ti=function(e,t){var n=[];return t.forEach(function(t){var r={keyword:""};typeof t=="string"?r={keyword:t}:r=t;var i=r.keyword,o=r.caseSensitive,a=o===void 0?!0:o,s=te(e,i,a?"g":"gi"),u={keyword:i,indexList:s,option:r};n.push(u)}),n},to=function(e,t){var n=ti(e,t),r=[],i=function(e,t){for(var n=0;n<r.length;n++){var i=r[n];if(e>i.start&&e<i.end||e+t>i.start&&e+t<i.end||i.start>e&&i.start<e+t||i.end>e&&i.end<e+t||e===i.start&&e+t===i.end)return-1;if(e+t<=i.start)return n}return r.length};n.forEach(function(e){var t=e.indexList,n=e.option;t.forEach(function(e){var t=e.index,o=e.subString,a={start:t,end:t+o.length,option:n},s=i(t,o.length);s!==-1&&r.splice(s,0,a)})});var o=[];return r.forEach(function(t,n){var i=t.start,a=t.end,s=r[n+1];n===0&&i>0&&o.push({start:0,end:i,subString:e.slice(0,i)}),o.push(p(l({},t),{subString:e.slice(i,a)})),(s===null||s===void 0?void 0:s.start)>a&&o.push({start:a,end:s.start,subString:e.slice(a,s.start)}),n===r.length-1&&a<e.length-1&&o.push({start:a,end:e.length-1,subString:e.slice(a,e.length)})}),o},ta=function(e,t){var n=to(e,t);return{highText:tr(e,n),highList:n}};j();import{clearInterval as ts,clearTimeout as tu,setInterval as tc,setTimeout as tf}from"worker-timers";var td="active",tl="idle",th="hidden",tp,tv,ty,tm={},tg={attach:function e(e,t){tm[e]||(tm[e]=[]),tm[e].push(t)},fire:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];tm[e]&&tm[e].forEach(function(e){e.apply(void 0,g(t))})},remove:function e(e,t){t||Reflect.deleteProperty(tm,e),tm[e]&&(tm[e]=tm[e].filter(function(e){return t!==e}))},dom:function e(e,t,n){return ty||(e.addEventListener?ty=function(e,t,n){return e.addEventListener(t,n,!1)}:typeof e.attachEvent=="function"?ty=function(e,t,n){return e.attachEvent("on".concat(t),n,!1)}:ty=function(e,t,n){return e["on".concat(t)]=n}),ty(e,t,n)}},tw=/*#__PURE__*/function(){"use strict";function e(t,n,i){var o=this;r(this,e);this.activity=t,this.seconds=n,this.callback=i,this.stopped=!1,this.start(),this.activity.on("statusChanged",function(e){o.stopped===!1&&(e.status===td?o.start():o.pause())})}o(e,[{key:"start",value:function e(){this.stopped=!1,ts(this.token),this.token=tc(this.callback,this.seconds*1e3)}},{key:"stop",value:function e(){this.stopped=!0,ts(this.token)}},{key:"resume",value:function e(){this.start()}},{key:"pause",value:function e(){this.stop()}}]);return e}(),tb=/*#__PURE__*/function(){"use strict";function e(){var t=this;r(this,e);if(this.status=td,this.timers=[],this.idleTime=3e4,this.isLegacyModeOn=!1,document.hidden!==void 0?(tp="hidden",tv="visibilitychange"):document.mozHidden!==void 0?(tp="mozHidden",tv="mozvisibilitychange"):document.msHidden!==void 0?(tp="msHidden",tv="msvisibilitychange"):document.webkitHidden!==void 0&&(tp="webkitHidden",tv="webkitvisibilitychange"),tp===void 0)this.legacyMode();else{var n=function(){document[tp]?t.blur():t.focus()};n(),tg.dom(document,tv,n)}this.startIdleTimer(),this.trackIdleStatus()}o(e,[{key:"legacyMode",value:function e(){var e=this;this.isLegacyModeOn||(tg.dom(window,"blur",function(){return e.blur()}),tg.dom(window,"focus",function(){return e.focus()}),this.isLegacyModeOn=!0)}},{key:"startIdleTimer",value:function e(e){var t=this;s(e,MouseEvent)&&e.movementX===0&&e.movementY===0||(this.timers.map(tu),this.timers.length=0,this.status===tl&&this.wakeUp(),this.idleStartedTime=+new Date,this.timers.push(tf(function(){if(t.status===td||t.status===th)return t.idle()},this.idleTime)))}},{key:"trackIdleStatus",value:function e(){tg.dom(document,"mousemove",this.startIdleTimer.bind(this)),tg.dom(document,"mousedown",this.startIdleTimer.bind(this)),tg.dom(document,"keyup",this.startIdleTimer.bind(this)),tg.dom(document,"touchstart",this.startIdleTimer.bind(this)),tg.dom(window,"scroll",this.startIdleTimer.bind(this)),this.focus(this.startIdleTimer.bind(this))}},{key:"on",value:function e(e,t){return tg.attach(e,t),this}},{key:"off",value:function e(e,t){return tg.remove(e,t),this}},{key:"setIdleDuration",value:function e(e){return this.idleTime=e*1e3,this.startIdleTimer(),this}},{key:"getIdleDuration",value:function e(){return this.idleTime}},{key:"getIdleInfo",value:function e(){var e=+new Date,t;if(this.status===tl)t={isIdle:!0,idleFor:e-this.idleStartedTime,timeLeft:0,timeLeftPer:100};else{var n=this.idleStartedTime+this.idleTime-e;t={isIdle:!1,idleFor:e-this.idleStartedTime,timeLeft:n,timeLeftPer:Number.parseFloat((100-n*100/this.idleTime).toFixed(2))}}return t}},{key:"idle",value:function e(e){return e?this.on("idle",e):(this.status=tl,tg.fire("idle"),tg.fire("statusChanged",[{status:this.status}])),this}},{key:"blur",value:function e(e){return e?this.on("blur",e):(this.status=th,tg.fire("blur"),tg.fire("statusChanged",[{status:this.status}])),this}},{key:"focus",value:function e(e){return e?this.on("focus",e):this.status!==td&&(this.status=td,tg.fire("focus"),tg.fire("wakeUp"),tg.fire("statusChanged",[{status:this.status}])),this}},{key:"wakeUp",value:function e(e){return e?this.on("wakeUp",e):this.status!==td&&(this.status=td,tg.fire("wakeUp"),tg.fire("statusChanged",[{status:this.status}])),this}},{key:"onEvery",value:function e(e,t){return new tw(this,e,t)}},{key:"now",value:function e(e){return e!==void 0?this.status===e:this.status===td}}]);return e}();j();import{isFunction as t_}from"lodash-es";function tS(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"default",n=arguments.length>2?arguments[2]:void 0;if(!e||!Reflect.has(e,t)||!t_(e[t]))return null;var r=e[t];return r?r(n):null}function tx(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];var n=Object.keys(e),r={};return n.forEach(function(n){if(t.includes(n))return null;r[n]=function(t){return tS(e,n,t)}}),r}j();function tk(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.type,r=n===void 0?"text/javascript":n;return new Promise(function(t,n){var i=!1,o=document.querySelector('script[src="'.concat(e,'"]'));if(!o)o=document.createElement("script"),o.type=r,o.async=!0,o.src=e,i=!0;else if(o.hasAttribute("data-loaded")){t({el:o});return}o.addEventListener("error",n),o.addEventListener("abort",n),o.addEventListener("load",function(){o.setAttribute("data-loaded",!0),t({el:o})}),i&&document.head.appendChild(o)})}function tE(e){return new Promise(function(t,n){var r=document.querySelector('script[src="'.concat(e,'"]'));if(!r){n();return}document.head.removeChild(r),t()})}j();function tB(e,t,n){return tj(e,t,n,!1)}function tO(e,t,n){return tj(e,t,n,!0).length>0}function tC(e){return typeof e!="string"?e:e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var tA=new Map;function tD(e,t){if(!Array.isArray(e))switch(typeof e==="undefined"?"undefined":w(e)){case"string":e=[e];break;case"undefined":e=[];break;default:throw new TypeError("Expected '".concat(t,"' to be a string or an array, but got a type of '").concat(typeof e==="undefined"?"undefined":w(e),"'"))}return e.filter(function(e){if(typeof e!="string"){if((typeof e==="undefined"?"undefined":w(e))>"u")return!1;throw new TypeError("Expected '".concat(t,"' to be an array of strings, but found a type of '").concat(typeof e==="undefined"?"undefined":w(e),"' in the array"))}return!0})}function tz(e,t){t=l({caseSensitive:!1},t);var n=e+JSON.stringify(t);if(tA.has(n))return tA.get(n);var r=e[0]==="!";r&&(e=e.slice(1)),e=tC(e).replace(/\\\*/g,"[\\s\\S]*");var i=new RegExp("^".concat(e,"$"),t.caseSensitive?"":"i");return i.negated=r,tA.set(n,i),i}function tj(e,t,n,r){if(e=tD(e,"inputs"),t=tD(t,"patterns"),t.length===0)return[];t=t.map(function(e){return tz(e,n)});var i=n||{},o=i.allPatterns,a=[];var s=true,u=false,c=undefined;try{for(var f=e[Symbol.iterator](),d;!(s=(d=f.next()).done);s=true){var l=d.value;var h=void 0,p=g(t).fill(!1);var v=true,y=false,w=undefined;try{for(var b=t.entries()[Symbol.iterator](),_;!(v=(_=b.next()).done);v=true){var S=m(_.value,2),x=S[0],k=S[1];if(k.test(l)&&(p[x]=!0,h=!k.negated,!h))break}}catch(e){y=true;w=e}finally{try{if(!v&&b.return!=null){b.return()}}finally{if(y){throw w}}}if(!(h===!1||h===void 0&&t.some(function(e){return!e.negated})||o&&p.some(function(e,n){return!e&&!t[n].negated}))&&(a.push(l),r))break}}catch(e){u=true;c=e}finally{try{if(!s&&f.return!=null){f.return()}}finally{if(u){throw c}}}return a}j();var tL={id:"id",children:"children",pid:"pid"},tP=function(e){return Object.assign({},tL,e)};function tF(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};n=tP(n);var r=n.children,i=g(e);var o=true,a=false,s=undefined;try{for(var u=i[Symbol.iterator](),c;!(o=(c=u.next()).done);o=true){var f=c.value;var d;if(t(f))return f;f[r]&&(d=i).push.apply(d,g(f[r]))}}catch(e){a=true;s=e}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw s}}}return null}function tM(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r;n=tP(n);var i=n.children,o=g(e),a=[];var s=true,u=false,c=undefined;try{for(var f=o[Symbol.iterator](),d;!(s=(d=f.next()).done);s=true){var l=d.value;t(l)&&a.push(l),l[i]&&(r=o).push.apply(r,g(l[i]))}}catch(e){u=true;c=e}finally{try{if(!s&&f.return!=null){f.return()}}finally{if(u){throw c}}}return a}function tR(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};n=tP(n);var r=[],i=g(e),o=new Set,a=n.children;for(;i.length;){var s;var u=i[0];if(o.has(u))r.pop(),i.shift();else if(o.add(u),u[a]&&(s=i).unshift.apply(s,g(u[a])),r.push(u),t(u))return r}return null}function tI(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};n=tP(n);var r=[],i=g(e),o=[],a=new Set,s=n.children;for(;i.length;){var u;var c=i[0];a.has(c)?(r.pop(),i.shift()):(a.add(c),c[s]&&(u=i).unshift.apply(u,g(c[s])),r.push(c),t(c)&&o.push(g(r)))}return o}function tT(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};n=tP(n);var r=n.children;function i(e){return e.map(function(e){return l({},e)}).filter(function(e){return e[r]=e[r]&&i(e[r]),t(e)||e[r]&&e[r].length})}return i(e)}function tU(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};n=tP(n);var r=g(e),i=n.children;for(var o=0;o<r.length;o++){var a;if(t(r[o]))return;i&&r[o][i]&&(a=r).splice.apply(a,[o+1,0].concat(g(r[o][i])))}}function tH(e,t){return e.map(function(e){return t$(e,t)})}function t$(e,t){var n=t.children,r=n===void 0?"children":n,i=t.conversion;var o=Array.isArray(e[r])&&e[r].length>0,s=i(e)||{};return o?p(l({},s),a({},r,e[r].map(function(e){return t$(e,{children:r,conversion:i})}))):l({},s)}j();import{v4 as tN}from"uuid";function tJ(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.native,n=t===void 0?!0:t;var r,i;var o;return n?(o=(i=window.crypto)===null||i===void 0?void 0:(r=i.randomUUID)===null||r===void 0?void 0:r.call(i))!==null&&o!==void 0?o:tN():tN()}var tq=0;function tW(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";var t=Date.now(),n=Math.floor(Math.random()*1e9);return tq++,"".concat(e,"_").concat(n).concat(tq).concat(String(t))}export{ez as AesEncryption,tb as IfActivity,eV as ResizeObserver,e$ as addClass,e0 as addLocationListener,eY as addResizeListener,eS as buildBEM,tW as buildShortUUID,tJ as buildUUID,ex as createBEM,ek as createNamespace,ew as createSearchReg,e4 as dataURLtoBlob,eL as decodeByBase64,ep as deepMerge,eK as domOffEvent,eW as domOnEvent,e3 as downloadByBase64,e9 as downloadByData,e8 as downloadByOnlineUrl,e7 as downloadByUrl,e6 as downloadPercent,eR as enableTransitions,ej as encryptByBase64,eP as encryptByMd5,tC as escapeStringRegexp,tx as extendSlots,tT as filterTree,tF as findNode,tM as findNodeAll,tR as findPath,tI as findPathAll,tU as forEachTree,eb as getActualWidthOfChars,eI as getBoundingClientRect,ev as getPopupContainer,el as getRawRoute,tS as getSlot,eJ as getViewportOffset,eq as hackCss,eU as hasClass,ta as highlightHtml,Q as is,es as isBrowser,ef as isChineseText,eo as isChrome,ei as isClient,et as isIterableArray,tO as isMatch,G as isObject,en as isPositiveInteger,ea as isSafari,er as isServer,eu as isSupportNativeEllipsis,ec as isSupportResizeObserver,ee as isUrl,tk as loadScript,tB as matcher,eh as openWindow,Z as regexpMap,eN as removeClass,eQ as removeResizeListener,eH as setCssVar,ey as setObjToUrlParams,tH as treeMap,t$ as treeMapEach,eG as triggerWindowResize,tE as unloadScript,em as unsetAllProperty,e5 as urlToBase64,eX as useRafThrottle,ed as withInstall};
|