gis-common 4.4.5 → 4.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constant/CaseType.d.ts +8 -0
- package/dist/constant/ErrorType.d.ts +1 -1
- package/dist/constant/index.d.ts +1 -0
- package/dist/gis-common.es.js +44 -35
- package/dist/gis-common.umd.js +1 -1
- package/dist/utils/FileUtil.d.ts +0 -8
- package/dist/utils/GeoUtil.d.ts +1 -0
- package/dist/utils/MessageUtil.d.ts +1 -1
- package/dist/utils/StringUtil.d.ts +4 -4
- package/package.json +1 -1
|
@@ -6,7 +6,6 @@ declare enum ErrorType {
|
|
|
6
6
|
PROCESS_TIMEOUT = "\u4EFB\u52A1\u5904\u7406\u8D85\u65F6",
|
|
7
7
|
AUTH_VERIFY_ERROR = "\u6743\u9650\u9A8C\u8BC1\u5931\u8D25",
|
|
8
8
|
INSTANCE_DUPLICATE = "\u5B9E\u4F8B\u4E3A\u5355\u4F8B\u6A21\u5F0F\uFF0C\u4E0D\u5141\u8BB8\u91CD\u590D\u6784\u5EFA",
|
|
9
|
-
JSON_PARSE_ERROR = "JSON\u89E3\u6790\u5931\u8D25\uFF0C\u683C\u5F0F\u6709\u8BEF",
|
|
10
9
|
STRING_CHECK_LOSS = "\u5B57\u7B26\u4E32\u7F3A\u5C11\u5173\u952E\u5B57",
|
|
11
10
|
PARAMETER_ERROR = "\u9A8C\u8BC1\u53C2\u6570\u7C7B\u578B\u5931\u8D25",
|
|
12
11
|
PARAMETER_ERROR_ARRAY = "\u9A8C\u8BC1\u53C2\u6570\u7C7B\u578B\u5931\u8D25\uFF0C\u5FC5\u987B\u662F\u6570\u7EC4",
|
|
@@ -20,6 +19,7 @@ declare enum ErrorType {
|
|
|
20
19
|
DATA_ERROR = "\u683C\u5F0F\u7C7B\u578B\u9A8C\u8BC1\u5931\u8D25",
|
|
21
20
|
DATA_ERROR_COORDINATE = "\u683C\u5F0F\u7C7B\u578B\u9A8C\u8BC1\u5931\u8D25\uFF0C\u5FC5\u987B\u662F\u5750\u6807",
|
|
22
21
|
DATA_ERROR_COLOR = "\u683C\u5F0F\u7C7B\u578B\u9A8C\u8BC1\u5931\u8D25\uFF0C\u5FC5\u987B\u662F\u989C\u8272\u4EE3\u7801",
|
|
22
|
+
DATA_ERROR_JSON = "JSON\u89E3\u6790\u5931\u8D25\uFF0C\u683C\u5F0F\u6709\u8BEF",
|
|
23
23
|
DATA_ERROR_GEOJSON = "\u683C\u5F0F\u7C7B\u578B\u9A8C\u8BC1\u5931\u8D25\uFF0C\u5FC5\u987B\u662FGeoJSON",
|
|
24
24
|
REQUEST_ERROR = "\u8BF7\u6C42\u8D44\u6E90\u5931\u8D25",
|
|
25
25
|
REQUEST_ERROR_CROSS = "\u4E0D\u5141\u8BB8\u8DE8\u7AD9\u70B9\u8BBF\u95EE\u8D44\u6E90",
|
package/dist/constant/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export { default as EventType } from './EventType';
|
|
|
2
2
|
export { default as ErrorType } from './ErrorType';
|
|
3
3
|
export { default as LayerType } from './LayerType';
|
|
4
4
|
export { default as FormType } from './FormType';
|
|
5
|
+
export { default as CaseType } from './CaseType';
|
|
5
6
|
export * from './GraphicTypes';
|
package/dist/gis-common.es.js
CHANGED
|
@@ -3,7 +3,6 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
|
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
var _a;
|
|
5
5
|
import { connect } from "mqtt-browser";
|
|
6
|
-
import { Message } from "element-ui";
|
|
7
6
|
var EventType = /* @__PURE__ */ ((EventType2) => {
|
|
8
7
|
EventType2["MAP_RENDER"] = "mapRender";
|
|
9
8
|
EventType2["MAP_READY"] = "mapReady";
|
|
@@ -36,7 +35,6 @@ var ErrorType = /* @__PURE__ */ ((ErrorType2) => {
|
|
|
36
35
|
ErrorType2["PROCESS_TIMEOUT"] = "任务处理超时";
|
|
37
36
|
ErrorType2["AUTH_VERIFY_ERROR"] = "权限验证失败";
|
|
38
37
|
ErrorType2["INSTANCE_DUPLICATE"] = "实例为单例模式,不允许重复构建";
|
|
39
|
-
ErrorType2["JSON_PARSE_ERROR"] = "JSON解析失败,格式有误";
|
|
40
38
|
ErrorType2["STRING_CHECK_LOSS"] = "字符串缺少关键字";
|
|
41
39
|
ErrorType2["PARAMETER_ERROR"] = "验证参数类型失败";
|
|
42
40
|
ErrorType2["PARAMETER_ERROR_ARRAY"] = "验证参数类型失败,必须是数组";
|
|
@@ -50,6 +48,7 @@ var ErrorType = /* @__PURE__ */ ((ErrorType2) => {
|
|
|
50
48
|
ErrorType2["DATA_ERROR"] = "格式类型验证失败";
|
|
51
49
|
ErrorType2["DATA_ERROR_COORDINATE"] = "格式类型验证失败,必须是坐标";
|
|
52
50
|
ErrorType2["DATA_ERROR_COLOR"] = "格式类型验证失败,必须是颜色代码";
|
|
51
|
+
ErrorType2["DATA_ERROR_JSON"] = "JSON解析失败,格式有误";
|
|
53
52
|
ErrorType2["DATA_ERROR_GEOJSON"] = "格式类型验证失败,必须是GeoJSON";
|
|
54
53
|
ErrorType2["REQUEST_ERROR"] = "请求资源失败";
|
|
55
54
|
ErrorType2["REQUEST_ERROR_CROSS"] = "不允许跨站点访问资源";
|
|
@@ -75,6 +74,14 @@ var FormType = /* @__PURE__ */ ((FormType2) => {
|
|
|
75
74
|
FormType2[FormType2["DETAIL"] = 2] = "DETAIL";
|
|
76
75
|
return FormType2;
|
|
77
76
|
})(FormType || {});
|
|
77
|
+
var CaseType = /* @__PURE__ */ ((CaseType2) => {
|
|
78
|
+
CaseType2[CaseType2["REVERSE_CASE"] = 0] = "REVERSE_CASE";
|
|
79
|
+
CaseType2[CaseType2["UPPER_CAMEL_CASE"] = 1] = "UPPER_CAMEL_CASE";
|
|
80
|
+
CaseType2[CaseType2["LOWER_CAMEL_CASE"] = 2] = "LOWER_CAMEL_CASE";
|
|
81
|
+
CaseType2[CaseType2["UPPER_CASE"] = 3] = "UPPER_CASE";
|
|
82
|
+
CaseType2[CaseType2["LOWER_CASE"] = 4] = "LOWER_CASE";
|
|
83
|
+
return CaseType2;
|
|
84
|
+
})(CaseType || {});
|
|
78
85
|
var GraphicType = /* @__PURE__ */ ((GraphicType2) => {
|
|
79
86
|
GraphicType2["POINT"] = "Point";
|
|
80
87
|
GraphicType2["POLYLINE"] = "Polyline";
|
|
@@ -377,7 +384,7 @@ const Util = {
|
|
|
377
384
|
return str.replace(templateRe, (match, key) => {
|
|
378
385
|
const value = data[key];
|
|
379
386
|
if (value === void 0) {
|
|
380
|
-
throw new Error(`${ErrorType.
|
|
387
|
+
throw new Error(`${ErrorType.DATA_ERROR_JSON}: ${match}`);
|
|
381
388
|
} else if (typeof value === "function") {
|
|
382
389
|
return value(data);
|
|
383
390
|
} else {
|
|
@@ -1055,7 +1062,7 @@ const ObjectUtil = {
|
|
|
1055
1062
|
if (Util.isEmpty(str)) return {};
|
|
1056
1063
|
if (Util.isObject(str)) return str;
|
|
1057
1064
|
} catch (error) {
|
|
1058
|
-
throw new Error(ErrorType.
|
|
1065
|
+
throw new Error(ErrorType.DATA_ERROR_JSON + " -> " + str);
|
|
1059
1066
|
}
|
|
1060
1067
|
}
|
|
1061
1068
|
};
|
|
@@ -1567,6 +1574,7 @@ const AjaxUtil = {
|
|
|
1567
1574
|
}
|
|
1568
1575
|
};
|
|
1569
1576
|
class GeoUtil {
|
|
1577
|
+
// 地球赤道半径
|
|
1570
1578
|
/**
|
|
1571
1579
|
* 判断给定的经纬度是否合法
|
|
1572
1580
|
*
|
|
@@ -1575,7 +1583,7 @@ class GeoUtil {
|
|
|
1575
1583
|
* @returns 如果经纬度合法,返回true;否则返回false
|
|
1576
1584
|
*/
|
|
1577
1585
|
static isLnglat(lng, lat) {
|
|
1578
|
-
return Util.isNumber(lng) && Util.isNumber(lat) && !!(+lat
|
|
1586
|
+
return Util.isNumber(lng) && Util.isNumber(lat) && !!(+lat >= -90 && +lat <= 90 && +lng >= -180 && +lng <= 180);
|
|
1579
1587
|
}
|
|
1580
1588
|
/**
|
|
1581
1589
|
* 计算两哥平面坐标点间的距离
|
|
@@ -1786,9 +1794,9 @@ class GeoUtil {
|
|
|
1786
1794
|
* @returns 返回包含转换后的经度lng和纬度lat的对象
|
|
1787
1795
|
*/
|
|
1788
1796
|
static mercatorTolonlat(x, y) {
|
|
1789
|
-
const
|
|
1790
|
-
|
|
1791
|
-
const lat =
|
|
1797
|
+
const earthRadius = this.R_EQU;
|
|
1798
|
+
const lng = x / earthRadius * (180 / Math.PI);
|
|
1799
|
+
const lat = Math.atan(Math.exp(y / earthRadius)) * (180 / Math.PI) * 2 - 90;
|
|
1792
1800
|
return { lng, lat };
|
|
1793
1801
|
}
|
|
1794
1802
|
/**
|
|
@@ -1799,7 +1807,7 @@ class GeoUtil {
|
|
|
1799
1807
|
* @returns 墨卡托坐标对象,包含x和y属性
|
|
1800
1808
|
*/
|
|
1801
1809
|
static lonlatToMercator(lng, lat) {
|
|
1802
|
-
var earthRad =
|
|
1810
|
+
var earthRad = this.R_EQU;
|
|
1803
1811
|
const x = lng * Math.PI / 180 * earthRad;
|
|
1804
1812
|
var a = lat * Math.PI / 180;
|
|
1805
1813
|
const y = earthRad / 2 * Math.log((1 + Math.sin(a)) / (1 - Math.sin(a)));
|
|
@@ -1820,6 +1828,8 @@ class GeoUtil {
|
|
|
1820
1828
|
}
|
|
1821
1829
|
__publicField(GeoUtil, "toRadian", Math.PI / 180);
|
|
1822
1830
|
__publicField(GeoUtil, "R", 6371393);
|
|
1831
|
+
// 地球平均半径
|
|
1832
|
+
__publicField(GeoUtil, "R_EQU", 6378137);
|
|
1823
1833
|
const TYPES = ["Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon"];
|
|
1824
1834
|
const GeoJsonUtil = {
|
|
1825
1835
|
/**
|
|
@@ -3155,14 +3165,6 @@ const FileUtil = {
|
|
|
3155
3165
|
const blob = new Blob([byteArray], { type: mimeString });
|
|
3156
3166
|
return blob;
|
|
3157
3167
|
},
|
|
3158
|
-
/**
|
|
3159
|
-
* 将图片的URL转换为Base64编码
|
|
3160
|
-
*
|
|
3161
|
-
* @param url 图片的URL地址
|
|
3162
|
-
* @param width 图片的宽度,默认为图片原始宽度
|
|
3163
|
-
* @param height 图片的高度,默认为图片原始高度
|
|
3164
|
-
* @returns 返回Promise对象,解析后得到包含Base64编码数据的对象
|
|
3165
|
-
*/
|
|
3166
3168
|
/**
|
|
3167
3169
|
* 将base64字符串转换为文件对象
|
|
3168
3170
|
*
|
|
@@ -3235,11 +3237,18 @@ const FileUtil = {
|
|
|
3235
3237
|
URL.revokeObjectURL(objectURL);
|
|
3236
3238
|
resolve((_a2 = e.target) == null ? void 0 : _a2.result);
|
|
3237
3239
|
};
|
|
3240
|
+
reader.onerror = function(error) {
|
|
3241
|
+
reject(error);
|
|
3242
|
+
};
|
|
3238
3243
|
}
|
|
3239
3244
|
};
|
|
3245
|
+
xhr.onerror = function(error) {
|
|
3246
|
+
reject(error);
|
|
3247
|
+
};
|
|
3240
3248
|
} catch (error) {
|
|
3241
3249
|
reject(error);
|
|
3242
3250
|
}
|
|
3251
|
+
xhr.send();
|
|
3243
3252
|
});
|
|
3244
3253
|
}
|
|
3245
3254
|
};
|
|
@@ -3266,7 +3275,6 @@ class MessageUtil {
|
|
|
3266
3275
|
* @returns 无返回值
|
|
3267
3276
|
*/
|
|
3268
3277
|
static msg(type, message, options = {}) {
|
|
3269
|
-
Message({ type, message });
|
|
3270
3278
|
if (this.isMute) return;
|
|
3271
3279
|
const typename = Util.decodeDict(type, "success", "恭喜", "error", "发生错误", "warning", "警告", "info", "友情提示") + ":";
|
|
3272
3280
|
this.speechSynthesisUtterance.text = typename + message;
|
|
@@ -3446,26 +3454,18 @@ const StringUtil = {
|
|
|
3446
3454
|
* 转换字符串大小写
|
|
3447
3455
|
*
|
|
3448
3456
|
* @param str 待转换的字符串
|
|
3449
|
-
* @param type 转换类型,可选值为
|
|
3457
|
+
* @param type 转换类型,可选值为 0-4,默认为 4
|
|
3458
|
+
* 0:字母大小写反转
|
|
3450
3459
|
* 1:首字母大写,其余小写
|
|
3451
3460
|
* 2:首字母小写,其余大写
|
|
3452
|
-
* 3
|
|
3453
|
-
* 4
|
|
3454
|
-
* 5:全部小写
|
|
3461
|
+
* 3:全部大写
|
|
3462
|
+
* 4:全部小写
|
|
3455
3463
|
* @returns 转换后的字符串
|
|
3456
3464
|
*/
|
|
3457
3465
|
changeCase(str, type) {
|
|
3458
|
-
type = type ||
|
|
3466
|
+
type = type || CaseType.LOWER_CASE;
|
|
3459
3467
|
switch (type) {
|
|
3460
|
-
case
|
|
3461
|
-
return str.replace(/\b\w+\b/g, function(word) {
|
|
3462
|
-
return word.substring(0, 1).toUpperCase() + word.substring(1).toLowerCase();
|
|
3463
|
-
});
|
|
3464
|
-
case 2:
|
|
3465
|
-
return str.replace(/\b\w+\b/g, function(word) {
|
|
3466
|
-
return word.substring(0, 1).toLowerCase() + word.substring(1).toUpperCase();
|
|
3467
|
-
});
|
|
3468
|
-
case 3:
|
|
3468
|
+
case CaseType.REVERSE_CASE:
|
|
3469
3469
|
return str.split("").map(function(word) {
|
|
3470
3470
|
if (/[a-z]/.test(word)) {
|
|
3471
3471
|
return word.toUpperCase();
|
|
@@ -3473,9 +3473,17 @@ const StringUtil = {
|
|
|
3473
3473
|
return word.toLowerCase();
|
|
3474
3474
|
}
|
|
3475
3475
|
}).join("");
|
|
3476
|
-
case
|
|
3476
|
+
case CaseType.UPPER_CAMEL_CASE:
|
|
3477
|
+
return str.replace(/\b\w+\b/g, function(word) {
|
|
3478
|
+
return word.substring(0, 1).toUpperCase() + word.substring(1).toLowerCase();
|
|
3479
|
+
});
|
|
3480
|
+
case CaseType.LOWER_CAMEL_CASE:
|
|
3481
|
+
return str.replace(/\b\w+\b/g, function(word) {
|
|
3482
|
+
return word.substring(0, 1).toLowerCase() + word.substring(1).toUpperCase();
|
|
3483
|
+
});
|
|
3484
|
+
case CaseType.UPPER_CASE:
|
|
3477
3485
|
return str.toUpperCase();
|
|
3478
|
-
case
|
|
3486
|
+
case CaseType.LOWER_CASE:
|
|
3479
3487
|
return str.toLowerCase();
|
|
3480
3488
|
default:
|
|
3481
3489
|
return str;
|
|
@@ -3703,7 +3711,7 @@ const _MqttClient = class _MqttClient extends EventDispatcher {
|
|
|
3703
3711
|
try {
|
|
3704
3712
|
data = ObjectUtil.parse(dataString);
|
|
3705
3713
|
} catch (error) {
|
|
3706
|
-
throw new Error(ErrorType.
|
|
3714
|
+
throw new Error(ErrorType.DATA_ERROR_JSON);
|
|
3707
3715
|
}
|
|
3708
3716
|
this.dispatchEvent({
|
|
3709
3717
|
type: EventType.MQTT_MESSAGE,
|
|
@@ -3959,6 +3967,7 @@ export {
|
|
|
3959
3967
|
AudioPlayer,
|
|
3960
3968
|
BrowserUtil,
|
|
3961
3969
|
CanvasDrawer,
|
|
3970
|
+
CaseType,
|
|
3962
3971
|
Color,
|
|
3963
3972
|
Cookie,
|
|
3964
3973
|
CoordsUtil,
|
package/dist/gis-common.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("mqtt-browser"),require("element-ui")):"function"==typeof define&&define.amd?define(["exports","mqtt-browser","element-ui"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["gis-common"]={},t.mqttBrowser,t.elementUi)}(this,(function(t,e,n){"use strict";var s,r=Object.defineProperty,i=(t,e,n)=>((t,e,n)=>e in t?r(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n)(t,"symbol"!=typeof e?e+"":e,n),o=(t=>(t.MAP_RENDER="mapRender",t.MAP_READY="mapReady",t.MOUSE_CLICK="click",t.MOUSE_DOUBLE_CLICK="dblclick",t.MOUSE_MOVE="mousemove",t.MOUSE_IN="mousein",t.MOUSE_OUT="mouseout",t.MOUSE_RIGHT_CLICK="mouseRightClick",t.KEY_DOWN="keyDown",t.KEY_UP="keyUp",t.DRAW_ACTIVE="drawActive",t.DRAW_MOVE="drawMove",t.DRAW_COMPLETE="drawComplete",t.MQTT_CONNECT="mqttConnect",t.MQTT_ERROR="mqttError",t.MQTT_MESSAGE="mqttMessage",t.MQTT_CLOSE="mqttClose",t.WEB_SOCKET_CONNECT="webSocketConnect",t.WEB_SOCKET_ERROR="webSocketError",t.WEB_SOCKET_MESSAGE="webSocketMessage",t.WEB_SOCKET_CLOSE="webSocketClose",t))(o||{}),a=(t=>(t.LOGIN_EXPIRED="登录信息过期,请重新登录",t.INTERNAL_ERROR="内部错误",t.NETWORK_ERROR="请求失败,请检查网络是否已连接",t.PROCESS_FAIL="任务处理失败",t.PROCESS_TIMEOUT="任务处理超时",t.AUTH_VERIFY_ERROR="权限验证失败",t.INSTANCE_DUPLICATE="实例为单例模式,不允许重复构建",t.JSON_PARSE_ERROR="JSON解析失败,格式有误",t.STRING_CHECK_LOSS="字符串缺少关键字",t.PARAMETER_ERROR="验证参数类型失败",t.PARAMETER_ERROR_ARRAY="验证参数类型失败,必须是数组",t.PARAMETER_ERROR_STRING="验证参数类型失败,必须是字符",t.PARAMETER_ERROR_FUNCTION="验证参数类型失败,必须是函数",t.PARAMETER_ERROR_OBJECT="验证参数类型失败,必须是对象",t.PARAMETER_ERROR_INTEGER="验证参数类型失败,必须是整型",t.PARAMETER_ERROR_NUMBER="验证参数类型失败,必须是数值",t.PARAMETER_ERROR_LACK="验证参数类型失败,必须非空",t.PARAMETER_ERROR_ENUM="验证参数类型失败,必须是指定的值",t.DATA_ERROR="格式类型验证失败",t.DATA_ERROR_COORDINATE="格式类型验证失败,必须是坐标",t.DATA_ERROR_COLOR="格式类型验证失败,必须是颜色代码",t.DATA_ERROR_GEOJSON="格式类型验证失败,必须是GeoJSON",t.REQUEST_ERROR="请求资源失败",t.REQUEST_ERROR_CROSS="不允许跨站点访问资源",t.REQUEST_ERROR_TIMEOUT="请求超时,请检查网络",t.REQUEST_ERROR_NOT_FOUND="请求资源不存在",t.REQUEST_ERROR_FORBIDDEN="请求资源禁止访问",t.REQUEST_ERROR_EMPTY="请求数据记录为空",t))(a||{}),l=(t=>(t[t.SUPER_MAP_IMAGES=0]="SUPER_MAP_IMAGES",t[t.SUPER_MAP_DATA=1]="SUPER_MAP_DATA",t[t.ARC_GIS_MAP_IMAGES=2]="ARC_GIS_MAP_IMAGES",t[t.ARC_GIS_MAP_DATA=3]="ARC_GIS_MAP_DATA",t[t.OSGB_LAYER=4]="OSGB_LAYER",t[t.S3M_GROUP=5]="S3M_GROUP",t[t.TERRAIN_LAYER=6]="TERRAIN_LAYER",t))(l||{}),c=(t=>(t[t.ADD=0]="ADD",t[t.MODIFY=1]="MODIFY",t[t.DETAIL=2]="DETAIL",t))(c||{}),h=(t=>(t.POINT="Point",t.POLYLINE="Polyline",t.POLYGON="Polygon",t.RECTANGLE="Rectangle",t.BILLBOARD="Billboard",t.CYLINDER="Cylinder",t.ELLIPSOID="Ellipsoid",t.LABEL="Label",t.MODEL="Model",t.WALL="Wall",t.CIRCLE="Circle",t))(h||{}),u=(t=>(t[t.SOLID=0]="SOLID",t.DASH="10,5",t.DOT="3",t.DASHDOT="10,3,3,3",t.DASHDOTDOT="10,3,3,3,3,3",t))(u||{}),d=(t=>(t[t.DISTANCE=0]="DISTANCE",t[t.AREA=1]="AREA",t[t.HEIGHT=2]="HEIGHT",t[t.ANGLE=3]="ANGLE",t))(d||{});const g={getDataType:t=>Object.prototype.toString.call(t).slice(8,-1),asArray(t){return this.isEmpty(t)?[]:Array.isArray(t)?t:[t]},asNumber:t=>Number.isNaN(Number(t))?0:Number(t),asString(t){if(this.isEmpty(t))return"";switch(this.getDataType(t)){case"Object":case"Array":return JSON.stringify(t);default:return t}},isEmpty(t){if(null==t)return!0;switch(this.getDataType(t)){case"String":return""===t.trim();case"Array":return!t.length;case"Object":return!Object.keys(t).length;case"Boolean":return!t;default:return!1}},json2form(t){const e=new FormData;return this.isEmpty(t)||Object.keys(t).forEach((n=>{e.append(n,t[n]instanceof Object?JSON.stringify(t[n]):t[n])})),e},guid(){const t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return t()+t()+t()+t()+t()+t()+t()+t()},decodeDict(...t){let e="";if(t.length>1){const n=t.slice(1,t.length%2==0?t.length-1:t.length);for(let s=0;s<n.length;s+=2){const r=n[s];t[0]===r&&(e=n[s+1])}e||t.length%2!=0||(e=t[t.length-1])}else e=t[0];return e},extend(t,...e){let n,s,r,i;for(s=0,r=e.length;s<r;s++)for(n in i=e[s],i)t[n]=i[n];return t},convertToTree2(t,e="id",n="parentId",s="children"){const r=[];function i(o){const a=t.filter((t=>t[n]===o[e])).map((t=>(r.some((n=>n[e]===t[e]))||i(t),t)));a.length>0&&(o[s]=a)}return t.forEach((s=>{t.some((t=>t[n]===s[e]))||(i(s),r.push(s))})),r},asyncLoadScript:t=>new Promise(((e,n)=>{try{const s=document.querySelector(`script[src="${t}"]`);s&&s.remove();const r=document.createElement("script");r.type="text/javascript",r.src=t,"readyState"in r?r.onreadystatechange=function(){"complete"!==r.readyState&&"loaded"!==r.readyState||e(r)}:(r.onload=function(){e(r)},r.onerror=function(){n(new Error("Script failed to load for URL: "+t))}),document.body.appendChild(r)}catch(s){n(s)}})),loadStyle(t){t.forEach((t=>{const e=document.querySelector(`link[href="${t}"]`);e&&e.remove();const n=document.createElement("link");n.href=t,n.rel="stylesheet",n.type="text/css",n.onerror=function(){console.error(`Style loading failed for URL: ${t}`)},document.head.appendChild(n)}))},template:(t,e)=>t.replace(/\{ *([\w_-]+) *\}/g,((t,n)=>{const s=e[n];if(void 0===s)throw new Error(`${a.JSON_PARSE_ERROR}: ${t}`);return"function"==typeof s?s(e):s})),deleteEmptyProperty(t){return Object.fromEntries(Object.keys(t).filter((e=>!this.isEmpty(t[e]))).map((e=>[e,t[e]])))},deepAssign(t,...e){"object"==typeof t&&null!==t||(t={});for(const n of e)if("object"==typeof n&&null!==n)for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&("object"==typeof n[e]&&null!==n[e]?(t[e]||(t[e]=Array.isArray(n[e])?[]:{}),this.deepAssign(t[e],n[e])):t[e]=n[e]);return t},handleCopyValue(t){if(navigator.clipboard&&window.isSecureContext)return navigator.clipboard.writeText(t);{const e=document.createElement("textarea");return e.style.position="fixed",e.style.top=e.style.left="-100vh",e.style.opacity="0",e.value=t,document.body.appendChild(e),e.focus(),e.select(),new Promise(((t,n)=>{try{document.execCommand("copy"),t()}catch(s){n(new Error("copy failed"))}finally{e.remove()}}))}},isArray:t=>Array.isArray(t),isObject:t=>"object"==typeof t&&null!==t,isNil:t=>void 0===t||"undefined"===t||null===t||"null"===t,isNumber:t=>"number"==typeof t&&!isNaN(t)||"string"==typeof t&&Number.isFinite(+t),isInteger:t=>parseInt(t)===t,isFunction(t){return!this.isNil(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)},isElement:t=>"object"==typeof t&&1===t.nodeType,checheVersion:(t,e)=>t.replace(/[^0-9]/gi,"")<e.replace(/[^0-9]/gi,"")},p={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,randInt:(t,e)=>t+Math.floor(Math.random()*(e-t+1)),randFloat:(t,e)=>t+Math.random()*(e-t),deg2Rad(t){return t*this.DEG2RAD},rad2Deg(t){return t*this.RAD2DEG},round:(t,e=2)=>g.isNumber(t)?Math.round(Number(t)*Math.pow(10,e))/Math.pow(10,e):0,clamp:(t,e,n)=>Math.max(e,Math.min(n,t))},f={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class m{constructor(t,e,n,s){i(this,"_r"),i(this,"_g"),i(this,"_b"),i(this,"_alpha"),this._validateColorChannel(t),this._validateColorChannel(e),this._validateColorChannel(n),this._r=t,this._g=e,this._b=n,this._alpha=p.clamp(s||1,0,1)}_validateColorChannel(t){if(t<0||t>255)throw new Error("Color channel must be between 0 and 255.")}toString(){return`rgba(${this._r}, ${this._g}, ${this._b}, ${this._alpha})`}toJson(){return{r:this._r,g:this._g,b:this._b,a:this._alpha}}get rgba(){return`rgba(${this._r}, ${this._g}, ${this._b}, ${this._alpha})`}get hex(){return m.rgb2hex(this._r,this._g,this._b,this._alpha)}setAlpha(t){return this._alpha=p.clamp(t,0,1),this}setRgb(t,e,n){return this._validateColorChannel(t),this._validateColorChannel(e),this._validateColorChannel(n),this._r=t,this._g=e,this._b=n,this}static fromRgba(t){const e=t.match(/^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([\d.]+))?\s*\)$/);if(!e)throw new Error("Invalid RGBA color value");const n=parseInt(e[1],10),s=parseInt(e[2],10),r=parseInt(e[3],10),i=e[5]?parseFloat(e[5]):1;return new m(n,s,r,i)}static fromHex(t,e=1){const n=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,((t,e,n,s)=>e+e+n+n+s+s)),s=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);if(!s)throw new Error("Invalid HEX color value");const r=parseInt(s[1],16),i=parseInt(s[2],16),o=parseInt(s[3],16);return new m(r,i,o,e)}static fromHsl(t){const e=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(t);if(!e)throw new Error("Invalid HSL color value");const n=parseInt(e[1],10)/360,s=parseInt(e[2],10)/100,r=parseInt(e[3],10)/100,i=e[4]?parseFloat(e[4]):1;function o(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}let a,l,c;if(0===s)a=l=c=r;else{const t=r<.5?r*(1+s):r+s-r*s,e=2*r-t;a=o(e,t,n+1/3),l=o(e,t,n),c=o(e,t,n-1/3)}return new m(Math.round(255*a),Math.round(255*l),Math.round(255*c),i)}static fromName(t){const e=f[t];if(!e)throw new Error(`Invalid color name: ${t}`);return new m(e[0],e[1],e[2],e.length>3?e[3]:1)}static from(t){if(this.isRgb(t))return this.fromRgba(t);if(this.isHex(t))return this.fromHex(t);if(this.isHsl(t))return this.fromHsl(t);if(Object.keys(f).map((t=>t.toString())).includes(t))return this.fromName(t);throw new Error("Invalid color value")}static rgb2hex(t,e,n,s){var r="#"+((1<<24)+(t<<16)+(e<<8)+n).toString(16).slice(1);if(void 0!==s){return r+Math.round(255*s).toString(16).padStart(2,"0")}return r}static isHex(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)}static isRgb(t){return/^rgba?\s*\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*(,\s*[\d.]+)?\s*\)$/.test(t)}static isHsl(t){return/^(hsl|hsla)\(\d+,\s*[\d.]+%,\s*[\d.]+%(,\s*[\d.]+)?\)$/.test(t)}static isColor(t){return this.isHex(t)||this.isRgb(t)||this.isHsl(t)}static random(){let t=Math.floor(256*Math.random()),e=Math.floor(256*Math.random()),n=Math.floor(256*Math.random()),s=Math.random();return new m(t,e,n,s)}}class y{constructor(t){if(i(this,"ctx",null),"string"==typeof t&&!(t=document.querySelector("#"+t)))throw new Error("Element not found");if(!(t instanceof HTMLElement))throw new Error("Element is not an HTMLElement");{const e=t;if(!e.getContext)throw new Error("getContext is not available on this element");this.ctx=e.getContext("2d")}}drawLine({x:t,y:e},{x:n,y:s},r={}){if(!this.ctx)throw new Error("Canvas context is null or undefined");this.ctx.beginPath();const i=r.width||1,o=r.color||"#000";this.ctx.lineWidth=i,this.ctx.strokeStyle=o,this.ctx.moveTo(t,e),this.ctx.lineTo(n,s),this.ctx.stroke()}drawArc({x:t,y:e},n,s,r,i,o,a){if(!this.ctx)throw new Error("Canvas context is null or undefined");o?(this.ctx.fillStyle=a,this.ctx.beginPath(),this.ctx.arc(t,e,n,p.deg2Rad(s),p.deg2Rad(r),i),this.ctx.fill()):(this.ctx.strokeStyle=a,this.ctx.beginPath(),this.ctx.arc(t,e,n,p.deg2Rad(s),p.deg2Rad(r),i),this.ctx.stroke())}drawImage({x:t,y:e},n){const s=new Image;s.src=n,s.onload=()=>{const n=s.width,r=s.height;if(!this.ctx)throw new Error("Canvas context is null");this.ctx.drawImage(s,t,e,-n/2,-r/2)}}drawText({x:t,y:e},n,s){if(!this.ctx)throw new Error("Canvas context is null or undefined");this.ctx.font=s.font||"10px sans-serif",this.ctx.strokeStyle=s.color||"#000",this.ctx.lineWidth=2,this.ctx.strokeText(n,t,e)}static createCanvas(t=1,e=1){const n=document.createElement("canvas");return t&&(n.width=t),e&&(n.height=e),n}}class E{constructor(){i(this,"_listeners",{}),i(this,"_mutex",{}),i(this,"_context")}addEventListener(t,e,n,s){this._context=n;const r=this._mutex,i=this._listeners;return void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&(s&&(r[t]=e),i[t].push(e)),this}hasEventListener(t,e){if(null===this._listeners||void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const n=this._listeners[t];if(this._mutex[t]===e&&(this._mutex[t]=null),void 0!==n){const t=n.map((t=>t.toString())).indexOf(e.toString());-1!==t&&n.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);if(void 0!==this._mutex[t.type]){const e=n.find((e=>e===this._mutex[t.type]));if(e)return void e.call(this._context||this,t)}for(let e=0,s=n.length;e<s;e++){const s=n[e];"function"==typeof s&&s.call(this._context||this,t)}}}removeAllListener(){this._mutex={};for(const t in this._listeners)this._listeners[t]=[]}on(t,e,n,s){return this.addEventListener.call(this,t,e,n,s)}off(t,e){return this.removeEventListener.call(this,t,e)}}const w={deepClone(t){function e(){}return e.prototype=t,new e},isEqual:(t,e)=>JSON.stringify(t)===JSON.stringify(e),parse(t){try{if("string"==typeof t&&(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]")))return JSON.parse(t);if(g.isEmpty(t))return{};if(g.isObject(t))return t}catch(e){throw new Error(a.JSON_PARSE_ERROR+" -> "+t)}}};class R extends Map{isEmpty(){return 0===this.size}_values(){return Array.from(this.values())}_keys(){return Array.from(this.keys())}_entries(){return Array.from(this.entries())}static fromEntries(t=[]){const e=new R;return t.forEach((t=>{Array.isArray(t)&&2===t.length&&e.set(t[0],t[1])})),e}static fromJson(t){const e=w.parse(t);return new R(Object.entries(e))}}const M={emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",createCircle(t,e={}){const n=e.lineWidth||1,s=y.createCanvas(2*t,2*t),r=s.getContext("2d");return r.beginPath(),r.fillStyle=e.fillColor||"#f00",r.strokeStyle=e.color||"#f00",r.lineWidth=n,r.arc(t,t,t,0,2*Math.PI),r.stroke(),r.fill(),s.toDataURL("image/png")},createRectangle(t,e,n={}){const s=n.lineWidth||1,r=y.createCanvas(t,e),i=r.getContext("2d");return i.fillStyle=n.fillColor||"#f00",i.strokeStyle=n.color||"#f00",i.lineWidth=s,i.beginPath(),i.stroke(),i.fillRect(0,0,t,e),r.toDataURL("image/png")},getBase64(t){let e,n;if(t instanceof HTMLCanvasElement)n=t;else{void 0===e&&(e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),e.width=t.width,e.height=t.height;const s=e.getContext("2d");t instanceof ImageData?s.putImageData(t,0,0):t instanceof Image&&s.drawImage(t,0,0,t.width,t.height),n=e}return n.width>2048||n.height>2048?(console.warn("ImageUtil.getDataURL: Image converted to jpg for performance reasons",t),n.toDataURL("image/jpeg",.6)):n.toDataURL("image/png")},getBase64FromUrl(t){return new Promise(((e,n)=>{let s=new Image;s.setAttribute("crossOrigin","Anonymous"),s.src=t,s.onload=()=>{let t=this.getBase64(s);e(t)},s.onerror=n}))},parseBase64(t){let e=new RegExp("data:(?<type>.*?);base64,(?<data>.*)").exec(t);return e&&e.groups?{type:e.groups.type,ext:e.groups.type.split("/").slice(-1)[0],data:e.groups.data}:null},async copyImage(t){try{const e=await this.getBase64FromUrl(t),n=this.parseBase64(e);if(!n)throw new Error("Failed to parse base64 data.");let s=n.type,r=atob(n.data),i=new ArrayBuffer(r.length),o=new Uint8Array(i);for(let t=0;t<r.length;t++)o[t]=r.charCodeAt(t);let a=new Blob([i],{type:s});await navigator.clipboard.write([new ClipboardItem({[s]:a})])}catch(e){console.error("Failed to copy image to clipboard:",e)}}},A={jsonp(t,e){const n="_jsonp_"+g.guid(),s=document.getElementsByTagName("head")[0];t.includes("?")?t+="&callback="+n:t+="?callback="+n;let r=document.createElement("script");r.type="text/javascript",r.src=t,window[n]=function(t){e(null,t),s.removeChild(r),r=null,delete window[n]},s.appendChild(r)},get(t,e={},n){if(g.isFunction(e)){const t=n;n=e,e=t}const s=this._getClient(n);if(s.open("GET",t,!0),e){for(const t in e.headers)s.setRequestHeader(t,e.headers[t]);s.withCredentials="include"===e.credentials,e.responseType&&(s.responseType=e.responseType)}return s.send(null),s},post(t,e={},n){let s;if("string"!=typeof t?(n=e.cb,s=e.postData,delete(e={...e}).cb,delete e.postData,t=e.url):("function"==typeof e&&(n=e,e={}),s=e.postData),!n)throw new Error("Callback function is required");const r=this._getClient(n);return r.open("POST",t,!0),e.headers=e.headers||{},e.headers["Content-Type"]||(e.headers["Content-Type"]="application/x-www-form-urlencoded"),Object.keys(e.headers).forEach((t=>{r.setRequestHeader(t,e.headers[t])})),"string"!=typeof s&&(s=JSON.stringify(s)),r.send(s),r},_wrapCallback:(t,e)=>function(){if(4===t.readyState)if(200===t.status)if("arraybuffer"===t.responseType){0===t.response.byteLength?e(new Error("http status 200 returned without content.")):e(null,{data:t.response,cacheControl:t.getResponseHeader("Cache-Control"),expires:t.getResponseHeader("Expires"),contentType:t.getResponseHeader("Content-Type")})}else e(null,t.responseText);else e(new Error(t.statusText+","+t.status))},_getClient(t){let e=null;try{e=new XMLHttpRequest}catch(n){throw new Error("XMLHttpRequest not supported.")}return e&&(e.onreadystatechange=this._wrapCallback(e,t)),e},getArrayBuffer(t,e,n){if(g.isFunction(e)){const t=n;n=e,e=t}return e||(e={}),e.responseType="arraybuffer",this.get(t,e,n)},getImage(t,e,n){return this.getArrayBuffer(e,n,((e,n)=>{if(e)t.onerror&&t.onerror(e);else if(n){const e=window.URL||window.webkitURL,s=t.onload;t.onload=()=>{s&&s(),e.revokeObjectURL(t.src)};const r=new Blob([new Uint8Array(n.data)],{type:n.contentType});t.cacheControl=n.cacheControl,t.expires=n.expires,t.src=n.data.byteLength?e.createObjectURL(r):M.emptyImageUrl}}))},getJSON(t,e,n){if(g.isFunction(e)){const t=n;n=e,e=t}const s=function(t,e){const s=e?w.parse(e):null;n&&n(t,s)};return e&&e.jsonp?this.jsonp(t,s):this.get(t,e,s)}};class b{static isLnglat(t,e){return g.isNumber(t)&&g.isNumber(e)&&!!(+e>-90&&+e<90&&+t>-180&&+t<180)}static distance(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}static distanceByPoints(t,e){const{lng:n,lat:s}=t,{lng:r,lat:i}=e;let o=Math.cos(s*Math.PI/180)*Math.cos(i*Math.PI/180)*Math.cos((n-r)*Math.PI/180)+Math.sin(s*Math.PI/180)*Math.sin(i*Math.PI/180);o>1&&(o=1),o<-1&&(o=-1);return 6371e3*Math.acos(o)}static formatLnglat(t,e){let n="";function s(t){const e=Math.floor(t),n=Math.floor(60*(t-e));return`${e}°${n}′${(3600*(t-e)-60*n).toFixed(2)}″`}return this.isLnglat(t,e)?n=s(t)+","+s(e):isNaN(t)?isNaN(e)||(n=s(e)):n=s(t),n}static transformLnglat(t,e){function n(t){let e=/[sw]/i.test(t)?-1:1;const n=t.match(/[\d.]+/g)||[];let s=0;for(let r=0;r<n.length;r++)s+=parseFloat(n[r])/e,e*=60;return s}if(t&&e)return{lng:n(t),lat:n(e)}}static rayCasting(t,e){for(var n=t.x,s=t.y,r=!1,i=0,o=e.length,a=o-1;i<o;a=i,i++){var l=e[i].x,c=e[i].y,h=e[a].x,u=e[a].y;if(l===n&&c===s||h===n&&u===s)return"on";if(c<s&&u>=s||c>=s&&u<s){var d=l+(s-c)*(h-l)/(u-c);if(d===n)return"on";d>n&&(r=!r)}}return r?"in":"out"}static rotatePoint(t,e,n){return{x:(t.x-e.x)*Math.cos(Math.PI/180*-n)-(t.y-e.y)*Math.sin(Math.PI/180*-n)+e.x,y:(t.x-e.x)*Math.sin(Math.PI/180*-n)+(t.y-e.y)*Math.cos(Math.PI/180*-n)+e.y}}static calcBearAndDis(t,e){const{x:n,y:s}=t,{x:r,y:i}=e,o=r-n,a=i-s,l=Math.sqrt(o*o+a*a);return{angle:(Math.atan2(a,o)*(180/Math.PI)+360+90)%360,distance:l}}static calcBearAndDisByPoints(t,e){var n=1*t.lat,s=1*t.lng,r=1*e.lat,i=1*e.lng,o=Math.sin((i-s)*this.toRadian)*Math.cos(r*this.toRadian),a=Math.cos(n*this.toRadian)*Math.sin(r*this.toRadian)-Math.sin(n*this.toRadian)*Math.cos(r*this.toRadian)*Math.cos((i-s)*this.toRadian),l=Math.atan2(o,a)*(180/Math.PI),c=(r-n)*this.toRadian,h=(i-s)*this.toRadian,u=Math.sin(c/2)*Math.sin(c/2)+Math.cos(n*this.toRadian)*Math.cos(r*this.toRadian)*Math.sin(h/2)*Math.sin(h/2),d=2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u));return{angle:l,distance:this.R*d}}static distanceToSegment(t,e,n){const s=t.x,r=t.y,i=e.x,o=e.y,a=n.x,l=n.y,c=(a-i)*(s-i)+(l-o)*(r-o);if(c<=0)return Math.sqrt((s-i)*(s-i)+(r-o)*(r-o));const h=(a-i)*(a-i)+(l-o)*(l-o);if(c>=h)return Math.sqrt((s-a)*(s-a)+(r-l)*(r-l));const u=c/h,d=i+(a-i)*u,g=o+(l-o)*u;return Math.sqrt((s-d)*(s-d)+(r-g)*(r-g))}static calcPointByBearAndDis(t,e,n){const s=p.deg2Rad(1*t.lat),r=p.deg2Rad(1*t.lng),i=n/this.R;e=p.deg2Rad(e);const o=Math.asin(Math.sin(s)*Math.cos(i)+Math.cos(s)*Math.sin(i)*Math.cos(e)),a=r+Math.atan2(Math.sin(e)*Math.sin(i)*Math.cos(s),Math.cos(i)-Math.sin(s)*Math.sin(o));return{lat:p.rad2Deg(o),lng:p.rad2Deg(a)}}static mercatorTolonlat(t,e){var n=e/20037508.34*180;return{lng:t/20037508.34*180,lat:180/Math.PI*(2*Math.atan(Math.exp(n*Math.PI/180))-Math.PI/2)}}static lonlatToMercator(t,e){var n=6378137;const s=t*Math.PI/180*n;var r=e*Math.PI/180;return{x:s,y:3189068.5*Math.log((1+Math.sin(r))/(1-Math.sin(r)))}}static interpolate({x:t,y:e,z:n=0},{x:s,y:r,z:i=0},o){return{x:t+(s-t)*o,y:e+(r-e)*o,z:n+(i-n)*o}}}i(b,"toRadian",Math.PI/180),i(b,"R",6371393);const S=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],x={getGeoJsonType:t=>t.geometry?t.geometry.type:null,isGeoJson(t){const e=this.getGeoJsonType(t);if(e)for(let n=0,s=S.length;n<s;n++)if(S[n]===e)return!0;return!1},isGeoJsonPolygon(t){const e=this.getGeoJsonType(t);return!(!e||e!==S[4]&&e!==S[5])},isGeoJsonLine(t){const e=this.getGeoJsonType(t);return!(!e||e!==S[2]&&e!==S[3])},isGeoJsonPoint(t){const e=this.getGeoJsonType(t);return!(!e||e!==S[0]&&e!==S[1])},isGeoJsonMulti(t){const e=this.getGeoJsonType(t);return!!(e&&e.indexOf("Multi")>-1)},getGeoJsonCoordinates:t=>t.geometry?t.geometry.coordinates:[],getGeoJsonCenter(t,e){const n=this.getGeoJsonType(t);if(!n||!t.geometry)return null;const s=t.geometry.coordinates;if(!s)return null;let r=0,i=0,o=0;switch(n){case"Point":r=s[0],i=s[1],o++;break;case"MultiPoint":case"LineString":for(let t=0,e=s.length;t<e;t++)r+=s[t][0],i+=s[t][1],o++;break;case"MultiLineString":case"Polygon":for(let t=0,e=s.length;t<e;t++)for(let n=0,a=s[t].length;n<a;n++)r+=s[t][n][0],i+=s[t][n][1],o++;break;case"MultiPolygon":for(let t=0,e=s.length;t<e;t++)for(let n=0,a=s[t].length;n<a;n++)for(let e=0,l=s[t][n].length;e<l;e++)r+=s[t][n][e][0],i+=s[t][n][e][1],o++}const a=r/o,l=i/o;return e?(e.x=a,e.y=l,e):{x:a,y:l}},spliteGeoJsonMulti(t){const e=this.getGeoJsonType(t);if(!e||!t.geometry)return null;const n=t.geometry,s=t.properties||{},r=n.coordinates;if(!r)return null;const i=[];let o;switch(e){case"MultiPoint":o="Point";break;case"MultiLineString":o="LineString";break;case"MultiPolygon":o="Polygon"}if(o)for(let a=0,l=r.length;a<l;a++)i.push({type:"Feature",geometry:{type:o,coordinates:r[a]},properties:s});else i.push(t);return i},getGeoJsonByCoordinates(t){if(!Array.isArray(t))throw Error("coordinates 参数格式错误");let e;if(2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1])e="Point";else if(Array.isArray(t[0])&&2===t[0].length)e="LineString";else{if(!Array.isArray(t[0])||!Array.isArray(t[0][0]))throw Error("coordinates 参数格式错误");{const n=t[0];if(n[0].join(",")===n[n.length-1].join(","))e="Polygon";else{if(!(t.length>1))throw Error("coordinates 参数格式错误");e="MultiPolygon"}}}return{type:"Feature",geometry:{type:e,coordinates:t}}}},_={getException(t,e){const n=function(){Error.call(this,e),this.name=t,this.message=e,this.stack=(new Error).stack};return Error&&(n.__proto__=Error),(n.prototype=Object.create(Error&&Error.prototype)).constructor=n,n},throwException(t){throw new(this.getException("Exception",t))(t)},throwColorException(t){throw new(this.getException("ColorException",a.DATA_ERROR_COLOR+" -> "+(t||"")))(t)},throwCoordinateException(t){throw new(this.getException("CoordinateException",a.DATA_ERROR_COORDINATE+" -> "+(t||"")))(t)},throwGeoJsonException(t){throw new(this.getException("GeoJsonException",a.DATA_ERROR_GEOJSON+" -> "+(t||"")))(t)},throwEmptyException(t){throw new(this.getException("EmptyException",a.PARAMETER_ERROR_LACK+" -> "+(t||"")))(t)},throwIntegerException(t){throw new(this.getException("IntegerException",a.PARAMETER_ERROR_INTEGER+" -> "+(t||"")))(t)},throwNumberException(t){throw new(this.getException("NumberException",a.PARAMETER_ERROR_NUMBER+" -> "+(t||"")))(t)},throwArrayException(t){throw new(this.getException("ArrayException",a.PARAMETER_ERROR_ARRAY+" -> "+(t||"")))(t)},throwFunctionException(t){throw new(this.getException("FunctionException",a.PARAMETER_ERROR_FUNCTION+" -> "+(t||"")))(t)},throwProcessException(t){throw new(this.getException("ProcessException",a.PROCESS_FAIL+" -> "+(t||"")))(t)},throwNetworkException(t){throw new(this.getException("NetworkException",a.REQUEST_ERROR_TIMEOUT+" -> "+(t||"")))(t)}},v={assertEmpty(...t){t.forEach((t=>{g.isEmpty(t)&&_.throwEmptyException(t)}))},assertInteger(...t){t.forEach((t=>{g.isInteger(t)||_.throwIntegerException(t)}))},assertNumber(...t){t.forEach((t=>{g.isNumber(t)||_.throwNumberException(t)}))},assertArray(...t){t.forEach((t=>{g.isArray(t)||_.throwArrayException(t)}))},assertFunction(...t){t.forEach((t=>{g.isFunction(t)||_.throwFunctionException(t)}))},assertColor(...t){t.forEach((t=>{m.isColor(t)||_.throwColorException(t)}))},assertLnglat(...t){t.forEach((t=>{b.isLnglat(t.lng,t.lat)||_.throwCoordinateException(JSON.stringify(t))}))},assertGeoJson(...t){t.forEach((t=>{x.isGeoJson(t)||_.throwGeoJsonException(t)}))},assertContain(t,...e){let n=!1;for(let s=0,r=e.length||0;s<r;s++)n=t.indexOf(e[s])>=0;if(n)throw Error(a.STRING_CHECK_LOSS+" -> "+t)},assertStartWith(t,e){if(!t.startsWith(e))throw Error("字符串"+t+"开头不是 -> "+e)},assertEndWith(t,e){if(!t.endsWith(e))throw Error("字符串"+t+"结尾不是 -> "+e)}},C=Object.create(Array);C.prototype.groupBy=function(t){var e={};return this.forEach((function(n){var s=JSON.stringify(t(n));e[s]=e[s]||[],e[s].push(n)})),Object.keys(e).map((t=>e[t]))},C.prototype.distinct=function(t=t=>t){const e=[],n={};return this.forEach((s=>{const r=t(s),i=String(r);n[i]||(n[i]=!0,e.push(s))})),e},C.prototype.max=function(){return Math.max.apply({},this)},C.prototype.min=function(){return Math.min.apply({},this)},C.prototype.sum=function(){return this.length>0?this.reduce(((t=0,e=0)=>t+e)):0},C.prototype.avg=function(){return this.length?this.sum()/this.length:0},C.prototype.desc=function(t=t=>t){return this.sort(((e,n)=>t(n)-t(e)))},C.prototype.asc=function(t=t=>t){return this.sort(((e,n)=>t(e)-t(n)))},C.prototype.random=function(){return this[Math.floor(Math.random()*this.length)]},C.prototype.remove=function(t){const e=this.indexOf(t);return e>-1&&this.splice(e,1),this};const O={create:t=>[...new Array(t).keys()],union(...t){let e=[];return t.forEach((t=>{Array.isArray(t)&&(e=e.concat(t.filter((t=>!e.includes(t)))))})),e},intersection(...t){let e=t[0]||[];return t.forEach((t=>{Array.isArray(t)&&(e=e.filter((e=>t.includes(e))))})),e},unionAll:(...t)=>[...t].flat().filter((t=>!!t)),difference(...t){return 0===t.length?[]:this.union(...t).filter((e=>!this.intersection(...t).includes(e)))},zhSort:(t,e=t=>t,n)=>(t.sort((function(t,s){return n?e(t).localeCompare(e(s),"zh"):e(s).localeCompare(e(t),"zh")})),t)};class T{static getSystem(){var t,e,n,s,r,i,o,a,l;const c=this.userAgent||(null==(t=this.navigator)?void 0:t.userAgent);let h="",u="";if(c.includes("Android")||c.includes("Adr"))h="Android",u=(null==(e=c.match(/Android ([\d.]+);/))?void 0:e[1])||"";else if(c.includes("CrOS"))h="Chromium OS",u=(null==(n=c.match(/MSIE ([\d.]+)/))?void 0:n[1])||(null==(s=c.match(/rv:([\d.]+)/))?void 0:s[1])||"";else if(c.includes("Linux")||c.includes("X11"))h="Linux",u=(null==(r=c.match(/Linux ([\d.]+)/))?void 0:r[1])||"";else if(c.includes("Ubuntu"))h="Ubuntu",u=(null==(i=c.match(/Ubuntu ([\d.]+)/))?void 0:i[1])||"";else if(c.includes("Windows")){let t=(null==(o=c.match(/^Mozilla\/\d.0 \(Windows NT ([\d.]+)[;)].*$/))?void 0:o[1])||"",e={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};h="Windows",u=t in e?e[t]:t}else c.includes("like Mac OS X")?(h="IOS",u=(null==(a=c.match(/OS ([\d_]+) like/))?void 0:a[1].replace(/_/g,"."))||""):c.includes("Macintosh")&&(h="macOS",u=(null==(l=c.match(/Mac OS X -?([\d_]+)/))?void 0:l[1].replace(/_/g,"."))||"");return{type:h,version:u}}static getExplorer(){var t;const e=this.userAgent||(null==(t=this.navigator)?void 0:t.userAgent);let n="",s="";if(/MSIE|Trident/.test(e)){let t=/MSIE\s(\d+\.\d+)/.exec(e)||/rv:(\d+\.\d+)/.exec(e);t&&(n="IE",s=t[1])}else if(/Edge/.test(e)){let t=/Edge\/(\d+\.\d+)/.exec(e);t&&(n="Edge",s=t[1])}else if(/Chrome/.test(e)&&/Google Inc/.test(this.navigator.vendor)){let t=/Chrome\/(\d+\.\d+)/.exec(e);t&&(n="Chrome",s=t[1])}else if(/Firefox/.test(e)){let t=/Firefox\/(\d+\.\d+)/.exec(e);t&&(n="Firefox",s=t[1])}else if(/Safari/.test(e)&&/Apple Computer/.test(this.navigator.vendor)){let t=/Version\/(\d+\.\d+)([^S]*)(Safari)/.exec(e);t&&(n="Safari",s=t[1])}return{type:n,version:s}}static switchFullScreen(t){if(t){const t=document.documentElement;t.requestFullscreen?t.requestFullscreen():"msRequestFullscreen"in t?t.msRequestFullscreen():"mozRequestFullScreen"in t?t.mozRequestFullScreen():"webkitRequestFullscreen"in t&&t.webkitRequestFullscreen()}else document.exitFullscreen?document.exitFullscreen():"msExitFullscreen"in document?document.msExitFullscreen():"mozCancelFullScreen"in document?document.mozCancelFullScreen():"webkitExitFullscreen"in document&&document.webkitExitFullscreen()}static isSupportWebGL(){if(!(null==this?void 0:this.document))return!1;const t=this.document.createElement("canvas"),e=t.getContext("webgl")||t.getContext("experimental-webgl");return e&&e instanceof WebGLRenderingContext}static getGPU(){let t="",e="";if(null==this?void 0:this.document){let n=this.document.createElement("canvas"),s=n.getContext("webgl")||n.getContext("experimental-webgl");if(s instanceof WebGLRenderingContext){let n=s.getExtension("WEBGL_debug_renderer_info");if(n){let r=s.getParameter(n.UNMASKED_RENDERER_WEBGL);t=(r.match(/ANGLE \((.+?),/)||[])[1]||"",e=(r.match(/, (.+?) (\(|vs_)/)||[])[1]||""}}}return{type:t,model:e}}static getLanguage(){var t,e;let n=(null==(t=this.navigator)?void 0:t.language)||(null==(e=this.navigator)?void 0:e.userLanguage);if("string"!=typeof n)return"";let s=n.split("-");return s[1]&&(s[1]=s[1].toUpperCase()),s.join("_")}static getTimeZone(){var t,e;return null==(e=null==(t=null==Intl?void 0:Intl.DateTimeFormat())?void 0:t.resolvedOptions())?void 0:e.timeZone}static async getScreenFPS(){return new Promise((function(t){let e=0,n=1,s=[],r=function(i){if(e>0)if(n<12)s.push(i-e),e=i,n++,requestAnimationFrame(r);else{s.sort(),s=s.slice(1,11);let e=s.reduce(((t,e)=>t+e));const n=10*Math.round(1e4/e/10);t(n)}else e=i,requestAnimationFrame(r)};requestAnimationFrame(r)}))}static async getIPAddress(){const t=/\b((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/,e=/\b(?:[A-F0-9]{1,4}:){7}[A-F0-9]{1,4}\b/i;let n=window.RTCPeerConnection||window.mozRTCPeerConnection||window.webkitRTCPeerConnection;const s=new Set,r=n=>{var r;const i=null==(r=null==n?void 0:n.candidate)?void 0:r.candidate;if(i)for(const o of[t,e]){const t=i.match(o);t&&s.add(t[0])}};return new Promise((function(t,e){const i=new n({iceServers:[{urls:"stun:stun.l.google.com:19302"},{urls:"stun:stun.services.mozilla.com"}]});i.addEventListener("icecandidate",r),i.createDataChannel(""),i.createOffer().then((t=>i.setLocalDescription(t)),e);let o,a=20,l=function(){try{i.removeEventListener("icecandidate",r),i.close()}catch{}o&&clearInterval(o)};o=window.setInterval((function(){let e=[...s];e.length?(l(),t(e[0])):a?a--:(l(),t(""))}),100)}))}static async getNetwork(){var t,e;let n="unknown",s=null==(t=this.navigator)?void 0:t.connection;return s&&(n=s.type||s.effectiveType,"2"!=n&&"unknown"!=n||(n="wifi")),{network:n,isOnline:(null==(e=this.navigator)?void 0:e.onLine)||!1,ip:await this.getIPAddress()}}}i(T,"document",null==window?void 0:window.document),i(T,"navigator",null==window?void 0:window.navigator),i(T,"userAgent",null==(s=null==window?void 0:window.navigator)?void 0:s.userAgent),i(T,"screen",null==window?void 0:window.screen);class I{static delta(t,e){const n=6378245,s=.006693421622965943;let r=this.transformLat(e-105,t-35),i=this.transformLon(e-105,t-35);const o=t/180*this.PI;let a=Math.sin(o);a=1-s*a*a;const l=Math.sqrt(a);return r=180*r/(n*(1-s)/(a*l)*this.PI),i=180*i/(n/l*Math.cos(o)*this.PI),{lat:r,lng:i}}static outOfChina(t,e){return t<72.004||t>137.8347||(e<.8293||e>55.8271)}static gcjEncrypt(t,e){if(this.outOfChina(t,e))return{lat:t,lng:e};const n=this.delta(t,e);return{lat:t+n.lat,lng:e+n.lng}}static gcjDecrypt(t,e){if(this.outOfChina(t,e))return{lat:t,lng:e};const n=this.delta(t,e);return{lat:t-n.lat,lng:e-n.lng}}static gcjDecryptExact(t,e){let n=.01,s=.01,r=t-n,i=e-s,o=t+n,a=e+s,l=0,c=0,h=0;for(;;){l=(r+o)/2,c=(i+a)/2;const u=this.gcjEncrypt(l,c);if(n=u.lat-t,s=u.lng-e,Math.abs(n)<1e-9&&Math.abs(s)<1e-9)break;if(n>0?o=l:r=l,s>0?a=c:i=c,++h>1e4)break}return{lat:l,lng:c}}static bdEncrypt(t,e){const n=e,s=t,r=Math.sqrt(n*n+s*s)+2e-5*Math.sin(s*this.XPI),i=Math.atan2(s,n)+3e-6*Math.cos(n*this.XPI),o=r*Math.cos(i)+.0065;return{lat:r*Math.sin(i)+.006,lng:o}}static bdDecrypt(t,e){const n=e-.0065,s=t-.006,r=Math.sqrt(n*n+s*s)-2e-5*Math.sin(s*this.XPI),i=Math.atan2(s,n)-3e-6*Math.cos(n*this.XPI),o=r*Math.cos(i);return{lat:r*Math.sin(i),lng:o}}static mercatorEncrypt(t,e){const n=20037508.34*e/180;let s=Math.log(Math.tan((90+t)*this.PI/360))/(this.PI/180);return s=20037508.34*s/180,{lat:s,lng:n}}static mercatorDecrypt(t,e){const n=e/20037508.34*180;let s=t/20037508.34*180;return s=180/this.PI*(2*Math.atan(Math.exp(s*this.PI/180))-this.PI/2),{lat:s,lng:n}}static transformLat(t,e){let n=2*t-100+3*e+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*this.PI)+20*Math.sin(2*t*this.PI))/3,n+=2*(20*Math.sin(e*this.PI)+40*Math.sin(e/3*this.PI))/3,n+=2*(160*Math.sin(e/12*this.PI)+320*Math.sin(e*this.PI/30))/3,n}static transformLon(t,e){let n=300+t+2*e+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*this.PI)+20*Math.sin(2*t*this.PI))/3,n+=2*(20*Math.sin(t*this.PI)+40*Math.sin(t/3*this.PI))/3,n+=2*(150*Math.sin(t/12*this.PI)+300*Math.sin(t/30*this.PI))/3,n}static random({x:t,y:e},{x:n,y:s}){return{x:Math.random()*(n-t)+t,y:Math.random()*(s-e)+e}}static deCompose(t,e,n){const s=[];if(t instanceof Array&&!(t[0]instanceof Array))e(t);else if(t instanceof Array&&t[0]instanceof Array)for(let r=0;r<t.length;r++){const i=t[r];if(!g.isNil(i))if(i[0]instanceof Array){const t=n?this.deCompose(i,(t=>e(t)),n):this.deCompose(i,(t=>e(t)));s.push(t)}else{const t=n?e.call(n,i):e(i);s.push(t)}}return s}}i(I,"PI",3.141592653589793),i(I,"XPI",52.35987755982988);const D=Object.create(Date);D.prototype.format=function(t="yyyy-MM-dd hh:mm:ss"){const e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"H+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)));for(const n in e){const s=new RegExp("("+n+")","g");s.test(t)&&(t=t.replace(s,(t=>(1===t.length?e[n]:("00"+e[n]).substr((""+e[n]).length)).toString())))}return t},D.prototype.addDate=function(t,e){const n=new Date(this);switch(t){case"y":n.setFullYear(this.getFullYear()+e);break;case"q":n.setMonth(this.getMonth()+3*e);break;case"M":n.setMonth(this.getMonth()+e);break;case"w":n.setDate(this.getDate()+7*e);break;case"d":default:n.setDate(this.getDate()+e);break;case"h":n.setHours(this.getHours()+e);break;case"m":n.setMinutes(this.getMinutes()+e);break;case"s":n.setSeconds(this.getSeconds()+e)}return n};class P{static parseDate(t){if("string"==typeof t){var e=t.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) *$/);if(e&&e.length>3)return new Date(parseInt(e[1]),parseInt(e[2])-1,parseInt(e[3]));if((e=t.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) +(\d{1,2}):(\d{1,2}):(\d{1,2}) *$/))&&e.length>6)return new Date(parseInt(e[1]),parseInt(e[2])-1,parseInt(e[3]),parseInt(e[4]),parseInt(e[5]),parseInt(e[6]));if((e=t.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) +(\d{1,2}):(\d{1,2}):(\d{1,2})\.(\d{1,9}) *$/))&&e.length>7)return new Date(parseInt(e[1]),parseInt(e[2])-1,parseInt(e[3]),parseInt(e[4]),parseInt(e[5]),parseInt(e[6]),parseInt(e[7]))}return null}static formatDateInterval(t,e){const n=new Date(t),s=new Date(e).getTime()-n.getTime(),r=Math.floor(s/864e5),i=s%864e5,o=Math.floor(i/36e5),a=i%36e5,l=Math.floor(a/6e4),c=a%6e4,h=Math.round(c/1e3);let u="";return r>0&&(u+=r+"天"),o>0&&(u+=o+"时"),l>0&&(u+=l+"分"),h>0&&(u+=h+"秒"),0===r&&0===o&&0===l&&0===h&&(u="少于1秒"),u}static formatterCounter(t){const e=function(t){return(t>10?"":"0")+(t||0)},n=t%3600,s=n%60;return`${e(Math.floor(t/3600))}:${e(Math.floor(n/60))}:${e(Math.round(s))}`}static sleep(t){}}function L(t){return function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).split(/\s+/)}i(P,"lastMonthDate",new Date((new Date).getFullYear(),(new Date).getMonth()-1,1)),i(P,"thisMonthDate",new Date((new Date).getFullYear(),(new Date).getMonth(),1)),i(P,"nextMonthDate",new Date((new Date).getFullYear(),(new Date).getMonth()+1,1)),i(P,"lastWeekDate",new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+1-7-(new Date).getDay())),i(P,"thisWeekDate",new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+1-(new Date).getDay())),i(P,"nextWeekDate",new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+1+7-(new Date).getDay())),i(P,"lastDayDate",new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()-1)),i(P,"thisDayDate",new Date((new Date).setHours(0,0,0,0))),i(P,"nextDayDate",new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+1));const k={getStyle(t,e){var n;let s=t.style[e];if(!s||"auto"===s){const r=null==(n=document.defaultView)?void 0:n.getComputedStyle(t,null);s=r?r[e]:null,"auto"===s&&(s=null)}return s},create(t,e,n){const s=document.createElement(t);return s.className=e||"",n&&n.appendChild(s),s},remove(t){const e=t.parentNode;e&&e.removeChild(t)},empty(t){for(;t.firstChild;)t.removeChild(t.firstChild)},toFront(t){const e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)},toBack(t){const e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)},getClass:t=>((null==t?void 0:t.host)||t).className.toString(),hasClass(t,e){var n;if(null==(n=t.classList)?void 0:n.contains(e))return!0;const s=this.getClass(t);return s.length>0&&new RegExp(`(^|\\s)${e}(\\s|$)`).test(s)},addClass(t,e){if(void 0!==t.classList){const n=L(e);for(let e=0,s=n.length;e<s;e++)t.classList.add(n[e])}else if(!this.hasClass(t,e)){const n=this.getClass(t);this.setClass(t,(n?n+" ":"")+e)}},removeClass(t,e){if(void 0!==t.classList){L(e).forEach((e=>t.classList.remove(e)))}else this.setClass(t,(" "+this.getClass(t)+" ").replace(" "+e+" "," ").trim())},setClass(t,e){"classList"in t&&(t.classList.value="",e.split(" ").forEach((e=>t.classList.add(e))))},parseFromString:t=>(new DOMParser).parseFromString(t,"text/xml").children[0]},N={convertBase64ToBlob(t){const e=t.split(",")[0].split(":")[1].split(";")[0],n=atob(t.split(",")[1]),s=new Array(n.length);for(let i=0;i<n.length;i++)s[i]=n.charCodeAt(i);const r=new Uint8Array(s);return new Blob([r],{type:e})},convertBase64ToFile(t,e){const n=t.split(","),s=n[0].match(/:(.*?);/),r=s?s[1]:"image/png",i=atob(n[1]),o=new Uint8Array(i.length);for(let a=0;a<i.length;a++)o[a]=i.charCodeAt(a);return new File([o],e,{type:r})},downloadFromFile(t,e){if("object"==typeof t)if(t instanceof Blob)t=URL.createObjectURL(t);else{const e=JSON.stringify(t),n=new Blob([e],{type:"text/json"});t=window.URL.createObjectURL(n)}else if("string"==typeof t&&-1===t.indexOf("http")){const e=new Blob([t],{type:"text/json"});t=window.URL.createObjectURL(e)}var n=document.createElement("a");n.href=t,n.download=e||"",n.click(),window.URL.revokeObjectURL(n.href)},readFileFromUrl:(t,e)=>new Promise(((n,s)=>{const r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="blob";const i=e.split(".");try{r.onload=function(){if(this.status>=200&&this.status<300){const t=r.response,s=URL.createObjectURL(t),o=new File([t],e,{type:i[1],lastModified:(new Date).getTime()}),a=new FileReader;a.readAsArrayBuffer(o),a.onload=function(t){var e;URL.revokeObjectURL(s),n(null==(e=t.target)?void 0:e.result)}}}}catch(o){s(o)}}))};class U{static resetWarned(){this.warned={}}static changeVoice(){this.isMute=!!Number(!this.isMute),localStorage.setItem("mute",Number(this.isMute).toString())}static _call(t,e,n){this.warned[e]||(t(e,n),this.warned[e]=!0)}static msg(t,e,s={}){if(n.Message({type:t,message:e}),this.isMute)return;const r=g.decodeDict(t,"success","恭喜","error","发生错误","warning","警告","info","友情提示")+":";this.speechSynthesisUtterance.text=r+e,this.speechSynthesisUtterance.lang=s.lang||"zh-CN",this.speechSynthesisUtterance.volume=s.volume||1,this.speechSynthesisUtterance.rate=s.rate||1,this.speechSynthesisUtterance.pitch=s.pitch||1,this.speechSynthesis.speak(this.speechSynthesisUtterance)}static stop(t){this.speechSynthesisUtterance.text=t,this.speechSynthesis.cancel()}static warning(t,e={}){"development"===process.env.NODE_ENV&&void 0!==console&&console.warn(`Warning: %c${t}`,"color:#E6A23C;font-weight: bold;"),this.msg("warning",t,e)}static warningOnce(t,e={}){this._call(this.warning.bind(this),t,e)}static info(t,e={}){"development"===process.env.NODE_ENV&&void 0!==console&&console.info(`Info: %c${t}`,"color:#909399;font-weight: bold;"),this.msg("info",t,e)}static infoOnce(t,e={}){this._call(this.info.bind(this),t,e)}static error(t,e={}){"development"===process.env.NODE_ENV&&void 0!==console&&console.error(`Error: %c${t}`,"color:#F56C6C;font-weight: bold;"),this.msg("error",t,e)}static errorOnce(t,e={}){this._call(this.error.bind(this),t,e)}static success(t,e={}){"development"===process.env.NODE_ENV&&void 0!==console&&console.log(`Success: %c${t}`,"color:#67C23A;font-weight: bold;"),this.msg("success",t,e)}static successOnce(t,e={}){this._call(this.success.bind(this),t,e)}}i(U,"warned",{}),i(U,"isMute",!!Number(localStorage.getItem("mute"))||!1),i(U,"speechSynthesis",window.speechSynthesis),i(U,"speechSynthesisUtterance",new SpeechSynthesisUtterance);const F={debounce(t,e,n=!0){let s,r,i=null;const o=()=>{const a=Date.now()-s;a<e&&a>0?i=setTimeout(o,e-a):(i=null,n||(r=t.apply(this,undefined)))};return(...a)=>{s=Date.now();const l=n&&!i;return i||(i=setTimeout(o,e)),l&&(r=t.apply(this,a),i||(a=null)),r}},throttle(t,e,n=1){let s=0,r=null;return(...i)=>{if(1===n){const n=Date.now();n-s>=e&&(t.apply(this,i),s=n)}else 2===n&&(r||(r=setTimeout((()=>{r=null,t.apply(this,i)}),e)))}},memoize(t){const e=new Map;return(...n)=>{const s=JSON.stringify(n);if(e.has(s))return e.get(s);{const r=t.apply(this,n);return e.set(s,r),r}}},recurve(t,e=500,n=5e3){let s=0;setTimeout((()=>{s++,s<Math.floor(n/e)&&(t.call(this),setTimeout(this.recurve.bind(this,t,e,n),e))}),e)},once(t){let e=!1;return function(...n){if(!e)return e=!0,t(...n)}}},G={changeCase(t,e){switch(e=e||4){case 1:return t.replace(/\b\w+\b/g,(function(t){return t.substring(0,1).toUpperCase()+t.substring(1).toLowerCase()}));case 2:return t.replace(/\b\w+\b/g,(function(t){return t.substring(0,1).toLowerCase()+t.substring(1).toUpperCase()}));case 3:return t.split("").map((function(t){return/[a-z]/.test(t)?t.toUpperCase():t.toLowerCase()})).join("");case 4:return t.toUpperCase();case 5:return t.toLowerCase();default:return t}},getByteLength:t=>t.replace(/[\u0391-\uFFE5]/g,"aa").length,subStringByte(t,e,n){var s=/[^\x00-\xff]/g;if(t.replace(s,"mm").length<=n)return t;for(var r=Math.floor(n/2);r<t.length;r++){let i=t.substring(e,r);if(i.replace(s,"mm").length>=n)return i}return t},string2Bytes(t){const e=[];let n;const s=t.length;for(let r=0;r<s;r++)n=t.charCodeAt(r),n>=65536&&n<=1114111?(e.push(n>>18&7|240),e.push(n>>12&63|128),e.push(n>>6&63|128),e.push(63&n|128)):n>=2048&&n<=65535?(e.push(n>>12&15|224),e.push(n>>6&63|128),e.push(63&n|128)):n>=128&&n<=2047?(e.push(n>>6&31|192),e.push(63&n|128)):e.push(255&n);return new Uint8Array(e)},bytes2String(t){if("string"==typeof t)return t;let e="";const n=t;for(let s=0;s<n.length;s++){const t=n[s].toString(2),r=t.match(/^1+?(?=0)/);if(r&&8==t.length){const t=r[0].length;let i=n[s].toString(2).slice(7-t);for(let e=1;e<t;e++)i+=n[e+s].toString(2).slice(2);e+=String.fromCharCode(parseInt(i,2)),s+=t-1}else e+=String.fromCharCode(n[s])}return e}},$={json2Query(t){var e=[];for(var n in t)if(t.hasOwnProperty(n)){var s=n,r=t[n];e.push(encodeURIComponent(s)+"="+encodeURIComponent(r))}return e.join("&")},query2Json(t=window.location.href,e=!0){const n=/([^&=]+)=([\w\W]*?)(&|$|#)/g,{search:s,hash:r}=new URL(t),i=[s,r];let o={};for(let a=0;a<i.length;a++){const t=i[a];if(t){const s=t.replace(/#|\//g,"").split("?");if(s.length>1)for(let t=1;t<s.length;t++){let r;for(;r=n.exec(s[t]);)o[r[1]]=e?decodeURIComponent(r[2]):r[2]}}}return o}},B={isUrl:t=>/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(t),isPhone:t=>/^1[3|4|5|6|7|8|9][0-9]{9}$/.test(t),isTel:t=>/^(0\d{2,3}-\d{7,8})(-\d{1,4})?$/.test(t),isStrongPwd:t=>/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,20}$/.test(t),isEmail:t=>/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t),isIP:t=>/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(t),isEnglish:t=>/^[a-zA-Z]+$/.test(t),isChinese:t=>/^[\u4E00-\u9FA5]+$/.test(t),isHTML:t=>/<("[^"]*"|'[^']*'|[^'">])*>/.test(t),isXML:t=>/^([a-zA-Z]+-?)+[a-zA-Z0-9]+\\.[x|X][m|M][l|L]$/.test(t),isIDCard:t=>/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(t)},j=class t extends E{constructor(n=`ws://${window.document.domain}:20007/mqtt`,s={}){super(),i(this,"state"),i(this,"url"),i(this,"context"),i(this,"options"),i(this,"client"),i(this,"topics"),this.context=g.extend(t.defaultContext,s),this.options={connectTimeout:this.context.MQTT_TIMEOUTM,clientId:g.guid(),username:this.context.MQTT_USERNAME,password:this.context.MQTT_PASSWORD,clean:!0},this.url=n,this.client=e.connect(this.url,this.options),this._onConnect(),this._onMessage(),this.state=1,this.topics=[]}_onConnect(){this.client.on("connect",(()=>{this.state=2,console.log("链接mqtt成功==>"+this.url),this.dispatchEvent({type:o.MQTT_CONNECT,message:this})})),this.client.on("error",(t=>{console.log("链接mqtt报错",t),this.state=0,this.dispatchEvent({type:o.MQTT_ERROR,message:this}),this.client.end(),this.client.reconnect()}))}_onMessage(){this.client.on("message",((t,e)=>{let n=e,s="";e instanceof Uint8Array&&(n=e.toString());try{s=w.parse(n)}catch(r){throw new Error(a.JSON_PARSE_ERROR)}this.dispatchEvent({type:o.MQTT_MESSAGE,message:{topic:t,data:s}})}))}sendMsg(t,e){if(this.client.connected)return this.client.publish(t,e,{qos:1,retain:!0}),this;console.error("客户端未连接")}subscribe(t){return 2===this.state?this.client.subscribe(t,{qos:1},((e,n)=>{e instanceof Error?console.error("订阅失败==>"+t,e):(this.topics=O.union(this.topics,t),console.log("订阅成功==>"+t))})):this.addEventListener(o.MQTT_CONNECT,(e=>{this.client.subscribe(t,{qos:1},((e,n)=>{e instanceof Error?console.error("订阅失败==>"+t,e):(this.topics=O.union(this.topics,t),console.log("订阅成功==>"+t))}))})),this}unsubscribe(t){return this.client.unsubscribe(t,{qos:1},((e,n)=>{e instanceof Error?console.error(`取消订阅失败==>${t}`,e):(this.topics=O.difference(this.topics,t),console.log(`取消订阅成功==>${t}`))})),this}unsubscribeAll(){return this.unsubscribe(this.topics),this}unconnect(){this.client.end(),this.client=null,this.dispatchEvent({type:o.MQTT_CLOSE,message:null}),console.log("断开mqtt成功==>"+this.url)}};i(j,"defaultContext",{MQTT_USERNAME:"iRVMS-WEB",MQTT_PASSWORD:"novasky888",MQTT_TIMEOUTM:2e4});let q=j;const W=class t{static setLocal(t,e=null,n={}){var s=this._getPrefixedKey(t,n);try{const{expires:t}=n,r={data:e};t&&(r.expires=t),window.localStorage.setItem(s,JSON.stringify(r))}catch(r){console&&console.warn(`Storage didn't successfully save the '{"${t}": "${e}"}' pair, because the Storage is full.`)}}static setSession(t,e=null,n={}){var s=this._getPrefixedKey(t,n);try{const{expires:t}=n,r={data:e};t&&(r.expires=t),window.sessionStorage.setItem(s,JSON.stringify(r))}catch(r){console&&console.warn(`Storage didn't successfully save the '{"${t}": "${e}"}' pair, because the Storage is full.`)}}static getLocal(t,e,n){var s,r=this._getPrefixedKey(t,n);try{s=JSON.parse(window.localStorage.getItem(r)||"")}catch(i){s=window.localStorage[r]?{data:window.localStorage.getItem(r)}:null}if(!s)return e;if("object"==typeof s&&void 0!==s.data){const t=s.expires;return t&&Date.now()>t?e:s.data}}static getSession(t,e,n){var s,r=this._getPrefixedKey(t,n);try{s=JSON.parse(window.sessionStorage.getItem(r)||"")}catch(i){s=window.sessionStorage[r]?{data:window.sessionStorage.getItem(r)}:null}if(!s)return e;if("object"==typeof s&&void 0!==s.data){const t=s.expires;return t&&Date.now()>t?e:s.data}}static localkeys(){const e=[];var n=Object.keys(window.localStorage);return 0===t.prefix.length?n:(n.forEach((function(n){-1!==n.indexOf(t.prefix)&&e.push(n.replace(t.prefix,""))})),e)}static sessionkeys(){const e=[];var n=Object.keys(window.sessionStorage);return 0===t.prefix.length?n:(n.forEach((function(n){-1!==n.indexOf(t.prefix)&&e.push(n.replace(t.prefix,""))})),e)}static getAllLocal(e){var n=t.localkeys();if(e){const s=[];return n.forEach((n=>{if(e.includes(n)){const e={};e[n]=t.getLocal(n,null,null),s.push(e)}})),s}return n.map((e=>t.getLocal(e,null,null)))}static getAllSession(e){var n=t.sessionkeys();if(e){const s=[];return n.forEach((n=>{if(e.includes(n)){const e={};e[n]=t.getSession(n,null,null),s.push(e)}})),s}return n.map((e=>t.getSession(e,null,null)))}static remove(t,e){var n=this._getPrefixedKey(t,e);window.sessionStorage.removeItem(n),window.localStorage.removeItem(n)}static clearLocal(e){t.prefix.length?this.localkeys().forEach((t=>{window.localStorage.removeItem(this._getPrefixedKey(t,e))})):window.localStorage.clear()}static clearSession(e){t.prefix.length?this.sessionkeys().forEach((t=>{window.sessionStorage.removeItem(this._getPrefixedKey(t,e))})):window.sessionStorage.clear()}};i(W,"prefix",""),i(W,"_getPrefixedKey",(function(t,e){return(e=e||{}).noPrefix?t:W.prefix+t}));let J=W;t.AjaxUtil=A,t.ArrayUtil=O,t.AssertUtil=v,t.AudioPlayer=class{constructor(t){i(this,"audio"),this.audio=new Audio,this.audio.src=t}play(){!this.muted&&this.audio.play()}pause(){this.audio.pause()}get muted(){return this.audio.muted}set muted(t){this.audio.muted=t}},t.BrowserUtil=T,t.CanvasDrawer=y,t.Color=m,t.Cookie=class{static set(t,e,n=30){if("string"!=typeof t||"number"!=typeof n)throw new Error("Invalid arguments");const s=new Date;s.setTime(s.getTime()+24*n*60*60*1e3),document.cookie=`${t}=${encodeURIComponent(e)};expires=${s.toUTCString()}`}static remove(t){var e=new Date;e.setTime(e.getTime()-1);var n=this.get(t);null!=n&&(document.cookie=t+"="+n+";expires="+e.toUTCString())}static get(t){var e=document.cookie.match(new RegExp("(^| )"+t+"=([^;]*)(;|$)"));return null!=e?e[2]:""}},t.CoordsUtil=I,t.DateUtil=P,t.DomUtil=k,t.ErrorType=a,t.EventDispatcher=E,t.EventType=o,t.ExceptionUtil=_,t.FileUtil=N,t.FormType=c,t.GeoJsonUtil=x,t.GeoUtil=b,t.GraphicType=h,t.HashMap=R,t.ImageUtil=M,t.LayerType=l,t.LineSymbol=u,t.MathUtil=p,t.MeasureMode=d,t.MessageUtil=U,t.MqttClient=q,t.ObjectUtil=w,t.OptimizeUtil=F,t.Storage=J,t.StringUtil=G,t.UrlUtil=$,t.Util=g,t.ValidateUtil=B,t.WebSocketClient=class extends E{constructor(t="ws://127.0.0.1:10088"){super(),i(this,"maxCheckTimes",10),i(this,"url"),i(this,"checkTimes",0),i(this,"connectStatus",!1),i(this,"client",null),this.maxCheckTimes=10,this.url=t,this.checkTimes=0,this.connect(),this.connCheckStatus(this.maxCheckTimes)}connect(){if(this.disconnect(),this.url)try{const t=this;console.info("创建ws连接>>>"+this.url),this.client=new WebSocket(this.url),this.client&&(this.client.onopen=function(e){t.dispatchEvent({type:o.WEB_SOCKET_CONNECT,message:e})},this.client.onmessage=function(e){t.connectStatus=!0,t.dispatchEvent({type:o.WEB_SOCKET_MESSAGE,message:e})},this.client.onclose=function(e){t.dispatchEvent({type:o.WEB_SOCKET_CLOSE,message:e})},this.checkTimes===this.maxCheckTimes&&(this.client.onerror=function(e){t.dispatchEvent({type:o.WEB_SOCKET_ERROR,message:e})}))}catch(t){console.error("创建ws连接失败"+this.url+":"+t)}}disconnect(){if(this.client)try{console.log("ws断开连接"+this.url),this.client.close(),this.client=null}catch(t){this.client=null}}connCheckStatus(t){this.checkTimes>t||setTimeout((()=>{this.checkTimes++,this.state!==WebSocket.CONNECTING&&this.state!==WebSocket.OPEN&&this.connect(),this.connCheckStatus(t)}),2e3)}send(t){return this.client&&this.state===WebSocket.OPEN?(this.client.send(t),!0):(console.error(this.url+"消息发送失败:"+t),this)}heartbeat(){setTimeout((()=>{this.state===WebSocket.OPEN&&this.send("HeartBeat"),console.log("HeartBeat,"+this.url),setTimeout(this.heartbeat,3e4)}),1e3)}get state(){var t;return null==(t=this.client)?void 0:t.readyState}},Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("mqtt-browser")):"function"==typeof define&&define.amd?define(["exports","mqtt-browser"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["gis-common"]={},t.mqttBrowser)}(this,(function(t,e){"use strict";var n,s=Object.defineProperty,r=(t,e,n)=>((t,e,n)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n)(t,"symbol"!=typeof e?e+"":e,n),i=(t=>(t.MAP_RENDER="mapRender",t.MAP_READY="mapReady",t.MOUSE_CLICK="click",t.MOUSE_DOUBLE_CLICK="dblclick",t.MOUSE_MOVE="mousemove",t.MOUSE_IN="mousein",t.MOUSE_OUT="mouseout",t.MOUSE_RIGHT_CLICK="mouseRightClick",t.KEY_DOWN="keyDown",t.KEY_UP="keyUp",t.DRAW_ACTIVE="drawActive",t.DRAW_MOVE="drawMove",t.DRAW_COMPLETE="drawComplete",t.MQTT_CONNECT="mqttConnect",t.MQTT_ERROR="mqttError",t.MQTT_MESSAGE="mqttMessage",t.MQTT_CLOSE="mqttClose",t.WEB_SOCKET_CONNECT="webSocketConnect",t.WEB_SOCKET_ERROR="webSocketError",t.WEB_SOCKET_MESSAGE="webSocketMessage",t.WEB_SOCKET_CLOSE="webSocketClose",t))(i||{}),o=(t=>(t.LOGIN_EXPIRED="登录信息过期,请重新登录",t.INTERNAL_ERROR="内部错误",t.NETWORK_ERROR="请求失败,请检查网络是否已连接",t.PROCESS_FAIL="任务处理失败",t.PROCESS_TIMEOUT="任务处理超时",t.AUTH_VERIFY_ERROR="权限验证失败",t.INSTANCE_DUPLICATE="实例为单例模式,不允许重复构建",t.STRING_CHECK_LOSS="字符串缺少关键字",t.PARAMETER_ERROR="验证参数类型失败",t.PARAMETER_ERROR_ARRAY="验证参数类型失败,必须是数组",t.PARAMETER_ERROR_STRING="验证参数类型失败,必须是字符",t.PARAMETER_ERROR_FUNCTION="验证参数类型失败,必须是函数",t.PARAMETER_ERROR_OBJECT="验证参数类型失败,必须是对象",t.PARAMETER_ERROR_INTEGER="验证参数类型失败,必须是整型",t.PARAMETER_ERROR_NUMBER="验证参数类型失败,必须是数值",t.PARAMETER_ERROR_LACK="验证参数类型失败,必须非空",t.PARAMETER_ERROR_ENUM="验证参数类型失败,必须是指定的值",t.DATA_ERROR="格式类型验证失败",t.DATA_ERROR_COORDINATE="格式类型验证失败,必须是坐标",t.DATA_ERROR_COLOR="格式类型验证失败,必须是颜色代码",t.DATA_ERROR_JSON="JSON解析失败,格式有误",t.DATA_ERROR_GEOJSON="格式类型验证失败,必须是GeoJSON",t.REQUEST_ERROR="请求资源失败",t.REQUEST_ERROR_CROSS="不允许跨站点访问资源",t.REQUEST_ERROR_TIMEOUT="请求超时,请检查网络",t.REQUEST_ERROR_NOT_FOUND="请求资源不存在",t.REQUEST_ERROR_FORBIDDEN="请求资源禁止访问",t.REQUEST_ERROR_EMPTY="请求数据记录为空",t))(o||{}),a=(t=>(t[t.SUPER_MAP_IMAGES=0]="SUPER_MAP_IMAGES",t[t.SUPER_MAP_DATA=1]="SUPER_MAP_DATA",t[t.ARC_GIS_MAP_IMAGES=2]="ARC_GIS_MAP_IMAGES",t[t.ARC_GIS_MAP_DATA=3]="ARC_GIS_MAP_DATA",t[t.OSGB_LAYER=4]="OSGB_LAYER",t[t.S3M_GROUP=5]="S3M_GROUP",t[t.TERRAIN_LAYER=6]="TERRAIN_LAYER",t))(a||{}),l=(t=>(t[t.ADD=0]="ADD",t[t.MODIFY=1]="MODIFY",t[t.DETAIL=2]="DETAIL",t))(l||{}),c=(t=>(t[t.REVERSE_CASE=0]="REVERSE_CASE",t[t.UPPER_CAMEL_CASE=1]="UPPER_CAMEL_CASE",t[t.LOWER_CAMEL_CASE=2]="LOWER_CAMEL_CASE",t[t.UPPER_CASE=3]="UPPER_CASE",t[t.LOWER_CASE=4]="LOWER_CASE",t))(c||{}),h=(t=>(t.POINT="Point",t.POLYLINE="Polyline",t.POLYGON="Polygon",t.RECTANGLE="Rectangle",t.BILLBOARD="Billboard",t.CYLINDER="Cylinder",t.ELLIPSOID="Ellipsoid",t.LABEL="Label",t.MODEL="Model",t.WALL="Wall",t.CIRCLE="Circle",t))(h||{}),u=(t=>(t[t.SOLID=0]="SOLID",t.DASH="10,5",t.DOT="3",t.DASHDOT="10,3,3,3",t.DASHDOTDOT="10,3,3,3,3,3",t))(u||{}),d=(t=>(t[t.DISTANCE=0]="DISTANCE",t[t.AREA=1]="AREA",t[t.HEIGHT=2]="HEIGHT",t[t.ANGLE=3]="ANGLE",t))(d||{});const g={getDataType:t=>Object.prototype.toString.call(t).slice(8,-1),asArray(t){return this.isEmpty(t)?[]:Array.isArray(t)?t:[t]},asNumber:t=>Number.isNaN(Number(t))?0:Number(t),asString(t){if(this.isEmpty(t))return"";switch(this.getDataType(t)){case"Object":case"Array":return JSON.stringify(t);default:return t}},isEmpty(t){if(null==t)return!0;switch(this.getDataType(t)){case"String":return""===t.trim();case"Array":return!t.length;case"Object":return!Object.keys(t).length;case"Boolean":return!t;default:return!1}},json2form(t){const e=new FormData;return this.isEmpty(t)||Object.keys(t).forEach((n=>{e.append(n,t[n]instanceof Object?JSON.stringify(t[n]):t[n])})),e},guid(){const t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return t()+t()+t()+t()+t()+t()+t()+t()},decodeDict(...t){let e="";if(t.length>1){const n=t.slice(1,t.length%2==0?t.length-1:t.length);for(let s=0;s<n.length;s+=2){const r=n[s];t[0]===r&&(e=n[s+1])}e||t.length%2!=0||(e=t[t.length-1])}else e=t[0];return e},extend(t,...e){let n,s,r,i;for(s=0,r=e.length;s<r;s++)for(n in i=e[s],i)t[n]=i[n];return t},convertToTree2(t,e="id",n="parentId",s="children"){const r=[];function i(o){const a=t.filter((t=>t[n]===o[e])).map((t=>(r.some((n=>n[e]===t[e]))||i(t),t)));a.length>0&&(o[s]=a)}return t.forEach((s=>{t.some((t=>t[n]===s[e]))||(i(s),r.push(s))})),r},asyncLoadScript:t=>new Promise(((e,n)=>{try{const s=document.querySelector(`script[src="${t}"]`);s&&s.remove();const r=document.createElement("script");r.type="text/javascript",r.src=t,"readyState"in r?r.onreadystatechange=function(){"complete"!==r.readyState&&"loaded"!==r.readyState||e(r)}:(r.onload=function(){e(r)},r.onerror=function(){n(new Error("Script failed to load for URL: "+t))}),document.body.appendChild(r)}catch(s){n(s)}})),loadStyle(t){t.forEach((t=>{const e=document.querySelector(`link[href="${t}"]`);e&&e.remove();const n=document.createElement("link");n.href=t,n.rel="stylesheet",n.type="text/css",n.onerror=function(){console.error(`Style loading failed for URL: ${t}`)},document.head.appendChild(n)}))},template:(t,e)=>t.replace(/\{ *([\w_-]+) *\}/g,((t,n)=>{const s=e[n];if(void 0===s)throw new Error(`${o.DATA_ERROR_JSON}: ${t}`);return"function"==typeof s?s(e):s})),deleteEmptyProperty(t){return Object.fromEntries(Object.keys(t).filter((e=>!this.isEmpty(t[e]))).map((e=>[e,t[e]])))},deepAssign(t,...e){"object"==typeof t&&null!==t||(t={});for(const n of e)if("object"==typeof n&&null!==n)for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&("object"==typeof n[e]&&null!==n[e]?(t[e]||(t[e]=Array.isArray(n[e])?[]:{}),this.deepAssign(t[e],n[e])):t[e]=n[e]);return t},handleCopyValue(t){if(navigator.clipboard&&window.isSecureContext)return navigator.clipboard.writeText(t);{const e=document.createElement("textarea");return e.style.position="fixed",e.style.top=e.style.left="-100vh",e.style.opacity="0",e.value=t,document.body.appendChild(e),e.focus(),e.select(),new Promise(((t,n)=>{try{document.execCommand("copy"),t()}catch(s){n(new Error("copy failed"))}finally{e.remove()}}))}},isArray:t=>Array.isArray(t),isObject:t=>"object"==typeof t&&null!==t,isNil:t=>void 0===t||"undefined"===t||null===t||"null"===t,isNumber:t=>"number"==typeof t&&!isNaN(t)||"string"==typeof t&&Number.isFinite(+t),isInteger:t=>parseInt(t)===t,isFunction(t){return!this.isNil(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)},isElement:t=>"object"==typeof t&&1===t.nodeType,checheVersion:(t,e)=>t.replace(/[^0-9]/gi,"")<e.replace(/[^0-9]/gi,"")},p={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,randInt:(t,e)=>t+Math.floor(Math.random()*(e-t+1)),randFloat:(t,e)=>t+Math.random()*(e-t),deg2Rad(t){return t*this.DEG2RAD},rad2Deg(t){return t*this.RAD2DEG},round:(t,e=2)=>g.isNumber(t)?Math.round(Number(t)*Math.pow(10,e))/Math.pow(10,e):0,clamp:(t,e,n)=>Math.max(e,Math.min(n,t))},f={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class m{constructor(t,e,n,s){r(this,"_r"),r(this,"_g"),r(this,"_b"),r(this,"_alpha"),this._validateColorChannel(t),this._validateColorChannel(e),this._validateColorChannel(n),this._r=t,this._g=e,this._b=n,this._alpha=p.clamp(s||1,0,1)}_validateColorChannel(t){if(t<0||t>255)throw new Error("Color channel must be between 0 and 255.")}toString(){return`rgba(${this._r}, ${this._g}, ${this._b}, ${this._alpha})`}toJson(){return{r:this._r,g:this._g,b:this._b,a:this._alpha}}get rgba(){return`rgba(${this._r}, ${this._g}, ${this._b}, ${this._alpha})`}get hex(){return m.rgb2hex(this._r,this._g,this._b,this._alpha)}setAlpha(t){return this._alpha=p.clamp(t,0,1),this}setRgb(t,e,n){return this._validateColorChannel(t),this._validateColorChannel(e),this._validateColorChannel(n),this._r=t,this._g=e,this._b=n,this}static fromRgba(t){const e=t.match(/^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([\d.]+))?\s*\)$/);if(!e)throw new Error("Invalid RGBA color value");const n=parseInt(e[1],10),s=parseInt(e[2],10),r=parseInt(e[3],10),i=e[5]?parseFloat(e[5]):1;return new m(n,s,r,i)}static fromHex(t,e=1){const n=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,((t,e,n,s)=>e+e+n+n+s+s)),s=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);if(!s)throw new Error("Invalid HEX color value");const r=parseInt(s[1],16),i=parseInt(s[2],16),o=parseInt(s[3],16);return new m(r,i,o,e)}static fromHsl(t){const e=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(t);if(!e)throw new Error("Invalid HSL color value");const n=parseInt(e[1],10)/360,s=parseInt(e[2],10)/100,r=parseInt(e[3],10)/100,i=e[4]?parseFloat(e[4]):1;function o(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}let a,l,c;if(0===s)a=l=c=r;else{const t=r<.5?r*(1+s):r+s-r*s,e=2*r-t;a=o(e,t,n+1/3),l=o(e,t,n),c=o(e,t,n-1/3)}return new m(Math.round(255*a),Math.round(255*l),Math.round(255*c),i)}static fromName(t){const e=f[t];if(!e)throw new Error(`Invalid color name: ${t}`);return new m(e[0],e[1],e[2],e.length>3?e[3]:1)}static from(t){if(this.isRgb(t))return this.fromRgba(t);if(this.isHex(t))return this.fromHex(t);if(this.isHsl(t))return this.fromHsl(t);if(Object.keys(f).map((t=>t.toString())).includes(t))return this.fromName(t);throw new Error("Invalid color value")}static rgb2hex(t,e,n,s){var r="#"+((1<<24)+(t<<16)+(e<<8)+n).toString(16).slice(1);if(void 0!==s){return r+Math.round(255*s).toString(16).padStart(2,"0")}return r}static isHex(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)}static isRgb(t){return/^rgba?\s*\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*(,\s*[\d.]+)?\s*\)$/.test(t)}static isHsl(t){return/^(hsl|hsla)\(\d+,\s*[\d.]+%,\s*[\d.]+%(,\s*[\d.]+)?\)$/.test(t)}static isColor(t){return this.isHex(t)||this.isRgb(t)||this.isHsl(t)}static random(){let t=Math.floor(256*Math.random()),e=Math.floor(256*Math.random()),n=Math.floor(256*Math.random()),s=Math.random();return new m(t,e,n,s)}}class E{constructor(t){if(r(this,"ctx",null),"string"==typeof t&&!(t=document.querySelector("#"+t)))throw new Error("Element not found");if(!(t instanceof HTMLElement))throw new Error("Element is not an HTMLElement");{const e=t;if(!e.getContext)throw new Error("getContext is not available on this element");this.ctx=e.getContext("2d")}}drawLine({x:t,y:e},{x:n,y:s},r={}){if(!this.ctx)throw new Error("Canvas context is null or undefined");this.ctx.beginPath();const i=r.width||1,o=r.color||"#000";this.ctx.lineWidth=i,this.ctx.strokeStyle=o,this.ctx.moveTo(t,e),this.ctx.lineTo(n,s),this.ctx.stroke()}drawArc({x:t,y:e},n,s,r,i,o,a){if(!this.ctx)throw new Error("Canvas context is null or undefined");o?(this.ctx.fillStyle=a,this.ctx.beginPath(),this.ctx.arc(t,e,n,p.deg2Rad(s),p.deg2Rad(r),i),this.ctx.fill()):(this.ctx.strokeStyle=a,this.ctx.beginPath(),this.ctx.arc(t,e,n,p.deg2Rad(s),p.deg2Rad(r),i),this.ctx.stroke())}drawImage({x:t,y:e},n){const s=new Image;s.src=n,s.onload=()=>{const n=s.width,r=s.height;if(!this.ctx)throw new Error("Canvas context is null");this.ctx.drawImage(s,t,e,-n/2,-r/2)}}drawText({x:t,y:e},n,s){if(!this.ctx)throw new Error("Canvas context is null or undefined");this.ctx.font=s.font||"10px sans-serif",this.ctx.strokeStyle=s.color||"#000",this.ctx.lineWidth=2,this.ctx.strokeText(n,t,e)}static createCanvas(t=1,e=1){const n=document.createElement("canvas");return t&&(n.width=t),e&&(n.height=e),n}}class y{constructor(){r(this,"_listeners",{}),r(this,"_mutex",{}),r(this,"_context")}addEventListener(t,e,n,s){this._context=n;const r=this._mutex,i=this._listeners;return void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&(s&&(r[t]=e),i[t].push(e)),this}hasEventListener(t,e){if(null===this._listeners||void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const n=this._listeners[t];if(this._mutex[t]===e&&(this._mutex[t]=null),void 0!==n){const t=n.map((t=>t.toString())).indexOf(e.toString());-1!==t&&n.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);if(void 0!==this._mutex[t.type]){const e=n.find((e=>e===this._mutex[t.type]));if(e)return void e.call(this._context||this,t)}for(let e=0,s=n.length;e<s;e++){const s=n[e];"function"==typeof s&&s.call(this._context||this,t)}}}removeAllListener(){this._mutex={};for(const t in this._listeners)this._listeners[t]=[]}on(t,e,n,s){return this.addEventListener.call(this,t,e,n,s)}off(t,e){return this.removeEventListener.call(this,t,e)}}const w={deepClone(t){function e(){}return e.prototype=t,new e},isEqual:(t,e)=>JSON.stringify(t)===JSON.stringify(e),parse(t){try{if("string"==typeof t&&(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]")))return JSON.parse(t);if(g.isEmpty(t))return{};if(g.isObject(t))return t}catch(e){throw new Error(o.DATA_ERROR_JSON+" -> "+t)}}};class R extends Map{isEmpty(){return 0===this.size}_values(){return Array.from(this.values())}_keys(){return Array.from(this.keys())}_entries(){return Array.from(this.entries())}static fromEntries(t=[]){const e=new R;return t.forEach((t=>{Array.isArray(t)&&2===t.length&&e.set(t[0],t[1])})),e}static fromJson(t){const e=w.parse(t);return new R(Object.entries(e))}}const M={emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",createCircle(t,e={}){const n=e.lineWidth||1,s=E.createCanvas(2*t,2*t),r=s.getContext("2d");return r.beginPath(),r.fillStyle=e.fillColor||"#f00",r.strokeStyle=e.color||"#f00",r.lineWidth=n,r.arc(t,t,t,0,2*Math.PI),r.stroke(),r.fill(),s.toDataURL("image/png")},createRectangle(t,e,n={}){const s=n.lineWidth||1,r=E.createCanvas(t,e),i=r.getContext("2d");return i.fillStyle=n.fillColor||"#f00",i.strokeStyle=n.color||"#f00",i.lineWidth=s,i.beginPath(),i.stroke(),i.fillRect(0,0,t,e),r.toDataURL("image/png")},getBase64(t){let e,n;if(t instanceof HTMLCanvasElement)n=t;else{void 0===e&&(e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),e.width=t.width,e.height=t.height;const s=e.getContext("2d");t instanceof ImageData?s.putImageData(t,0,0):t instanceof Image&&s.drawImage(t,0,0,t.width,t.height),n=e}return n.width>2048||n.height>2048?(console.warn("ImageUtil.getDataURL: Image converted to jpg for performance reasons",t),n.toDataURL("image/jpeg",.6)):n.toDataURL("image/png")},getBase64FromUrl(t){return new Promise(((e,n)=>{let s=new Image;s.setAttribute("crossOrigin","Anonymous"),s.src=t,s.onload=()=>{let t=this.getBase64(s);e(t)},s.onerror=n}))},parseBase64(t){let e=new RegExp("data:(?<type>.*?);base64,(?<data>.*)").exec(t);return e&&e.groups?{type:e.groups.type,ext:e.groups.type.split("/").slice(-1)[0],data:e.groups.data}:null},async copyImage(t){try{const e=await this.getBase64FromUrl(t),n=this.parseBase64(e);if(!n)throw new Error("Failed to parse base64 data.");let s=n.type,r=atob(n.data),i=new ArrayBuffer(r.length),o=new Uint8Array(i);for(let t=0;t<r.length;t++)o[t]=r.charCodeAt(t);let a=new Blob([i],{type:s});await navigator.clipboard.write([new ClipboardItem({[s]:a})])}catch(e){console.error("Failed to copy image to clipboard:",e)}}},A={jsonp(t,e){const n="_jsonp_"+g.guid(),s=document.getElementsByTagName("head")[0];t.includes("?")?t+="&callback="+n:t+="?callback="+n;let r=document.createElement("script");r.type="text/javascript",r.src=t,window[n]=function(t){e(null,t),s.removeChild(r),r=null,delete window[n]},s.appendChild(r)},get(t,e={},n){if(g.isFunction(e)){const t=n;n=e,e=t}const s=this._getClient(n);if(s.open("GET",t,!0),e){for(const t in e.headers)s.setRequestHeader(t,e.headers[t]);s.withCredentials="include"===e.credentials,e.responseType&&(s.responseType=e.responseType)}return s.send(null),s},post(t,e={},n){let s;if("string"!=typeof t?(n=e.cb,s=e.postData,delete(e={...e}).cb,delete e.postData,t=e.url):("function"==typeof e&&(n=e,e={}),s=e.postData),!n)throw new Error("Callback function is required");const r=this._getClient(n);return r.open("POST",t,!0),e.headers=e.headers||{},e.headers["Content-Type"]||(e.headers["Content-Type"]="application/x-www-form-urlencoded"),Object.keys(e.headers).forEach((t=>{r.setRequestHeader(t,e.headers[t])})),"string"!=typeof s&&(s=JSON.stringify(s)),r.send(s),r},_wrapCallback:(t,e)=>function(){if(4===t.readyState)if(200===t.status)if("arraybuffer"===t.responseType){0===t.response.byteLength?e(new Error("http status 200 returned without content.")):e(null,{data:t.response,cacheControl:t.getResponseHeader("Cache-Control"),expires:t.getResponseHeader("Expires"),contentType:t.getResponseHeader("Content-Type")})}else e(null,t.responseText);else e(new Error(t.statusText+","+t.status))},_getClient(t){let e=null;try{e=new XMLHttpRequest}catch(n){throw new Error("XMLHttpRequest not supported.")}return e&&(e.onreadystatechange=this._wrapCallback(e,t)),e},getArrayBuffer(t,e,n){if(g.isFunction(e)){const t=n;n=e,e=t}return e||(e={}),e.responseType="arraybuffer",this.get(t,e,n)},getImage(t,e,n){return this.getArrayBuffer(e,n,((e,n)=>{if(e)t.onerror&&t.onerror(e);else if(n){const e=window.URL||window.webkitURL,s=t.onload;t.onload=()=>{s&&s(),e.revokeObjectURL(t.src)};const r=new Blob([new Uint8Array(n.data)],{type:n.contentType});t.cacheControl=n.cacheControl,t.expires=n.expires,t.src=n.data.byteLength?e.createObjectURL(r):M.emptyImageUrl}}))},getJSON(t,e,n){if(g.isFunction(e)){const t=n;n=e,e=t}const s=function(t,e){const s=e?w.parse(e):null;n&&n(t,s)};return e&&e.jsonp?this.jsonp(t,s):this.get(t,e,s)}};class S{static isLnglat(t,e){return g.isNumber(t)&&g.isNumber(e)&&!!(+e>=-90&&+e<=90&&+t>=-180&&+t<=180)}static distance(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}static distanceByPoints(t,e){const{lng:n,lat:s}=t,{lng:r,lat:i}=e;let o=Math.cos(s*Math.PI/180)*Math.cos(i*Math.PI/180)*Math.cos((n-r)*Math.PI/180)+Math.sin(s*Math.PI/180)*Math.sin(i*Math.PI/180);o>1&&(o=1),o<-1&&(o=-1);return 6371e3*Math.acos(o)}static formatLnglat(t,e){let n="";function s(t){const e=Math.floor(t),n=Math.floor(60*(t-e));return`${e}°${n}′${(3600*(t-e)-60*n).toFixed(2)}″`}return this.isLnglat(t,e)?n=s(t)+","+s(e):isNaN(t)?isNaN(e)||(n=s(e)):n=s(t),n}static transformLnglat(t,e){function n(t){let e=/[sw]/i.test(t)?-1:1;const n=t.match(/[\d.]+/g)||[];let s=0;for(let r=0;r<n.length;r++)s+=parseFloat(n[r])/e,e*=60;return s}if(t&&e)return{lng:n(t),lat:n(e)}}static rayCasting(t,e){for(var n=t.x,s=t.y,r=!1,i=0,o=e.length,a=o-1;i<o;a=i,i++){var l=e[i].x,c=e[i].y,h=e[a].x,u=e[a].y;if(l===n&&c===s||h===n&&u===s)return"on";if(c<s&&u>=s||c>=s&&u<s){var d=l+(s-c)*(h-l)/(u-c);if(d===n)return"on";d>n&&(r=!r)}}return r?"in":"out"}static rotatePoint(t,e,n){return{x:(t.x-e.x)*Math.cos(Math.PI/180*-n)-(t.y-e.y)*Math.sin(Math.PI/180*-n)+e.x,y:(t.x-e.x)*Math.sin(Math.PI/180*-n)+(t.y-e.y)*Math.cos(Math.PI/180*-n)+e.y}}static calcBearAndDis(t,e){const{x:n,y:s}=t,{x:r,y:i}=e,o=r-n,a=i-s,l=Math.sqrt(o*o+a*a);return{angle:(Math.atan2(a,o)*(180/Math.PI)+360+90)%360,distance:l}}static calcBearAndDisByPoints(t,e){var n=1*t.lat,s=1*t.lng,r=1*e.lat,i=1*e.lng,o=Math.sin((i-s)*this.toRadian)*Math.cos(r*this.toRadian),a=Math.cos(n*this.toRadian)*Math.sin(r*this.toRadian)-Math.sin(n*this.toRadian)*Math.cos(r*this.toRadian)*Math.cos((i-s)*this.toRadian),l=Math.atan2(o,a)*(180/Math.PI),c=(r-n)*this.toRadian,h=(i-s)*this.toRadian,u=Math.sin(c/2)*Math.sin(c/2)+Math.cos(n*this.toRadian)*Math.cos(r*this.toRadian)*Math.sin(h/2)*Math.sin(h/2),d=2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u));return{angle:l,distance:this.R*d}}static distanceToSegment(t,e,n){const s=t.x,r=t.y,i=e.x,o=e.y,a=n.x,l=n.y,c=(a-i)*(s-i)+(l-o)*(r-o);if(c<=0)return Math.sqrt((s-i)*(s-i)+(r-o)*(r-o));const h=(a-i)*(a-i)+(l-o)*(l-o);if(c>=h)return Math.sqrt((s-a)*(s-a)+(r-l)*(r-l));const u=c/h,d=i+(a-i)*u,g=o+(l-o)*u;return Math.sqrt((s-d)*(s-d)+(r-g)*(r-g))}static calcPointByBearAndDis(t,e,n){const s=p.deg2Rad(1*t.lat),r=p.deg2Rad(1*t.lng),i=n/this.R;e=p.deg2Rad(e);const o=Math.asin(Math.sin(s)*Math.cos(i)+Math.cos(s)*Math.sin(i)*Math.cos(e)),a=r+Math.atan2(Math.sin(e)*Math.sin(i)*Math.cos(s),Math.cos(i)-Math.sin(s)*Math.sin(o));return{lat:p.rad2Deg(o),lng:p.rad2Deg(a)}}static mercatorTolonlat(t,e){const n=this.R_EQU;return{lng:t/n*(180/Math.PI),lat:Math.atan(Math.exp(e/n))*(180/Math.PI)*2-90}}static lonlatToMercator(t,e){var n=this.R_EQU;const s=t*Math.PI/180*n;var r=e*Math.PI/180;return{x:s,y:n/2*Math.log((1+Math.sin(r))/(1-Math.sin(r)))}}static interpolate({x:t,y:e,z:n=0},{x:s,y:r,z:i=0},o){return{x:t+(s-t)*o,y:e+(r-e)*o,z:n+(i-n)*o}}}r(S,"toRadian",Math.PI/180),r(S,"R",6371393),r(S,"R_EQU",6378137);const _=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],b={getGeoJsonType:t=>t.geometry?t.geometry.type:null,isGeoJson(t){const e=this.getGeoJsonType(t);if(e)for(let n=0,s=_.length;n<s;n++)if(_[n]===e)return!0;return!1},isGeoJsonPolygon(t){const e=this.getGeoJsonType(t);return!(!e||e!==_[4]&&e!==_[5])},isGeoJsonLine(t){const e=this.getGeoJsonType(t);return!(!e||e!==_[2]&&e!==_[3])},isGeoJsonPoint(t){const e=this.getGeoJsonType(t);return!(!e||e!==_[0]&&e!==_[1])},isGeoJsonMulti(t){const e=this.getGeoJsonType(t);return!!(e&&e.indexOf("Multi")>-1)},getGeoJsonCoordinates:t=>t.geometry?t.geometry.coordinates:[],getGeoJsonCenter(t,e){const n=this.getGeoJsonType(t);if(!n||!t.geometry)return null;const s=t.geometry.coordinates;if(!s)return null;let r=0,i=0,o=0;switch(n){case"Point":r=s[0],i=s[1],o++;break;case"MultiPoint":case"LineString":for(let t=0,e=s.length;t<e;t++)r+=s[t][0],i+=s[t][1],o++;break;case"MultiLineString":case"Polygon":for(let t=0,e=s.length;t<e;t++)for(let n=0,a=s[t].length;n<a;n++)r+=s[t][n][0],i+=s[t][n][1],o++;break;case"MultiPolygon":for(let t=0,e=s.length;t<e;t++)for(let n=0,a=s[t].length;n<a;n++)for(let e=0,l=s[t][n].length;e<l;e++)r+=s[t][n][e][0],i+=s[t][n][e][1],o++}const a=r/o,l=i/o;return e?(e.x=a,e.y=l,e):{x:a,y:l}},spliteGeoJsonMulti(t){const e=this.getGeoJsonType(t);if(!e||!t.geometry)return null;const n=t.geometry,s=t.properties||{},r=n.coordinates;if(!r)return null;const i=[];let o;switch(e){case"MultiPoint":o="Point";break;case"MultiLineString":o="LineString";break;case"MultiPolygon":o="Polygon"}if(o)for(let a=0,l=r.length;a<l;a++)i.push({type:"Feature",geometry:{type:o,coordinates:r[a]},properties:s});else i.push(t);return i},getGeoJsonByCoordinates(t){if(!Array.isArray(t))throw Error("coordinates 参数格式错误");let e;if(2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1])e="Point";else if(Array.isArray(t[0])&&2===t[0].length)e="LineString";else{if(!Array.isArray(t[0])||!Array.isArray(t[0][0]))throw Error("coordinates 参数格式错误");{const n=t[0];if(n[0].join(",")===n[n.length-1].join(","))e="Polygon";else{if(!(t.length>1))throw Error("coordinates 参数格式错误");e="MultiPolygon"}}}return{type:"Feature",geometry:{type:e,coordinates:t}}}},x={getException(t,e){const n=function(){Error.call(this,e),this.name=t,this.message=e,this.stack=(new Error).stack};return Error&&(n.__proto__=Error),(n.prototype=Object.create(Error&&Error.prototype)).constructor=n,n},throwException(t){throw new(this.getException("Exception",t))(t)},throwColorException(t){throw new(this.getException("ColorException",o.DATA_ERROR_COLOR+" -> "+(t||"")))(t)},throwCoordinateException(t){throw new(this.getException("CoordinateException",o.DATA_ERROR_COORDINATE+" -> "+(t||"")))(t)},throwGeoJsonException(t){throw new(this.getException("GeoJsonException",o.DATA_ERROR_GEOJSON+" -> "+(t||"")))(t)},throwEmptyException(t){throw new(this.getException("EmptyException",o.PARAMETER_ERROR_LACK+" -> "+(t||"")))(t)},throwIntegerException(t){throw new(this.getException("IntegerException",o.PARAMETER_ERROR_INTEGER+" -> "+(t||"")))(t)},throwNumberException(t){throw new(this.getException("NumberException",o.PARAMETER_ERROR_NUMBER+" -> "+(t||"")))(t)},throwArrayException(t){throw new(this.getException("ArrayException",o.PARAMETER_ERROR_ARRAY+" -> "+(t||"")))(t)},throwFunctionException(t){throw new(this.getException("FunctionException",o.PARAMETER_ERROR_FUNCTION+" -> "+(t||"")))(t)},throwProcessException(t){throw new(this.getException("ProcessException",o.PROCESS_FAIL+" -> "+(t||"")))(t)},throwNetworkException(t){throw new(this.getException("NetworkException",o.REQUEST_ERROR_TIMEOUT+" -> "+(t||"")))(t)}},C={assertEmpty(...t){t.forEach((t=>{g.isEmpty(t)&&x.throwEmptyException(t)}))},assertInteger(...t){t.forEach((t=>{g.isInteger(t)||x.throwIntegerException(t)}))},assertNumber(...t){t.forEach((t=>{g.isNumber(t)||x.throwNumberException(t)}))},assertArray(...t){t.forEach((t=>{g.isArray(t)||x.throwArrayException(t)}))},assertFunction(...t){t.forEach((t=>{g.isFunction(t)||x.throwFunctionException(t)}))},assertColor(...t){t.forEach((t=>{m.isColor(t)||x.throwColorException(t)}))},assertLnglat(...t){t.forEach((t=>{S.isLnglat(t.lng,t.lat)||x.throwCoordinateException(JSON.stringify(t))}))},assertGeoJson(...t){t.forEach((t=>{b.isGeoJson(t)||x.throwGeoJsonException(t)}))},assertContain(t,...e){let n=!1;for(let s=0,r=e.length||0;s<r;s++)n=t.indexOf(e[s])>=0;if(n)throw Error(o.STRING_CHECK_LOSS+" -> "+t)},assertStartWith(t,e){if(!t.startsWith(e))throw Error("字符串"+t+"开头不是 -> "+e)},assertEndWith(t,e){if(!t.endsWith(e))throw Error("字符串"+t+"结尾不是 -> "+e)}},v=Object.create(Array);v.prototype.groupBy=function(t){var e={};return this.forEach((function(n){var s=JSON.stringify(t(n));e[s]=e[s]||[],e[s].push(n)})),Object.keys(e).map((t=>e[t]))},v.prototype.distinct=function(t=t=>t){const e=[],n={};return this.forEach((s=>{const r=t(s),i=String(r);n[i]||(n[i]=!0,e.push(s))})),e},v.prototype.max=function(){return Math.max.apply({},this)},v.prototype.min=function(){return Math.min.apply({},this)},v.prototype.sum=function(){return this.length>0?this.reduce(((t=0,e=0)=>t+e)):0},v.prototype.avg=function(){return this.length?this.sum()/this.length:0},v.prototype.desc=function(t=t=>t){return this.sort(((e,n)=>t(n)-t(e)))},v.prototype.asc=function(t=t=>t){return this.sort(((e,n)=>t(e)-t(n)))},v.prototype.random=function(){return this[Math.floor(Math.random()*this.length)]},v.prototype.remove=function(t){const e=this.indexOf(t);return e>-1&&this.splice(e,1),this};const O={create:t=>[...new Array(t).keys()],union(...t){let e=[];return t.forEach((t=>{Array.isArray(t)&&(e=e.concat(t.filter((t=>!e.includes(t)))))})),e},intersection(...t){let e=t[0]||[];return t.forEach((t=>{Array.isArray(t)&&(e=e.filter((e=>t.includes(e))))})),e},unionAll:(...t)=>[...t].flat().filter((t=>!!t)),difference(...t){return 0===t.length?[]:this.union(...t).filter((e=>!this.intersection(...t).includes(e)))},zhSort:(t,e=t=>t,n)=>(t.sort((function(t,s){return n?e(t).localeCompare(e(s),"zh"):e(s).localeCompare(e(t),"zh")})),t)};class T{static getSystem(){var t,e,n,s,r,i,o,a,l;const c=this.userAgent||(null==(t=this.navigator)?void 0:t.userAgent);let h="",u="";if(c.includes("Android")||c.includes("Adr"))h="Android",u=(null==(e=c.match(/Android ([\d.]+);/))?void 0:e[1])||"";else if(c.includes("CrOS"))h="Chromium OS",u=(null==(n=c.match(/MSIE ([\d.]+)/))?void 0:n[1])||(null==(s=c.match(/rv:([\d.]+)/))?void 0:s[1])||"";else if(c.includes("Linux")||c.includes("X11"))h="Linux",u=(null==(r=c.match(/Linux ([\d.]+)/))?void 0:r[1])||"";else if(c.includes("Ubuntu"))h="Ubuntu",u=(null==(i=c.match(/Ubuntu ([\d.]+)/))?void 0:i[1])||"";else if(c.includes("Windows")){let t=(null==(o=c.match(/^Mozilla\/\d.0 \(Windows NT ([\d.]+)[;)].*$/))?void 0:o[1])||"",e={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};h="Windows",u=t in e?e[t]:t}else c.includes("like Mac OS X")?(h="IOS",u=(null==(a=c.match(/OS ([\d_]+) like/))?void 0:a[1].replace(/_/g,"."))||""):c.includes("Macintosh")&&(h="macOS",u=(null==(l=c.match(/Mac OS X -?([\d_]+)/))?void 0:l[1].replace(/_/g,"."))||"");return{type:h,version:u}}static getExplorer(){var t;const e=this.userAgent||(null==(t=this.navigator)?void 0:t.userAgent);let n="",s="";if(/MSIE|Trident/.test(e)){let t=/MSIE\s(\d+\.\d+)/.exec(e)||/rv:(\d+\.\d+)/.exec(e);t&&(n="IE",s=t[1])}else if(/Edge/.test(e)){let t=/Edge\/(\d+\.\d+)/.exec(e);t&&(n="Edge",s=t[1])}else if(/Chrome/.test(e)&&/Google Inc/.test(this.navigator.vendor)){let t=/Chrome\/(\d+\.\d+)/.exec(e);t&&(n="Chrome",s=t[1])}else if(/Firefox/.test(e)){let t=/Firefox\/(\d+\.\d+)/.exec(e);t&&(n="Firefox",s=t[1])}else if(/Safari/.test(e)&&/Apple Computer/.test(this.navigator.vendor)){let t=/Version\/(\d+\.\d+)([^S]*)(Safari)/.exec(e);t&&(n="Safari",s=t[1])}return{type:n,version:s}}static switchFullScreen(t){if(t){const t=document.documentElement;t.requestFullscreen?t.requestFullscreen():"msRequestFullscreen"in t?t.msRequestFullscreen():"mozRequestFullScreen"in t?t.mozRequestFullScreen():"webkitRequestFullscreen"in t&&t.webkitRequestFullscreen()}else document.exitFullscreen?document.exitFullscreen():"msExitFullscreen"in document?document.msExitFullscreen():"mozCancelFullScreen"in document?document.mozCancelFullScreen():"webkitExitFullscreen"in document&&document.webkitExitFullscreen()}static isSupportWebGL(){if(!(null==this?void 0:this.document))return!1;const t=this.document.createElement("canvas"),e=t.getContext("webgl")||t.getContext("experimental-webgl");return e&&e instanceof WebGLRenderingContext}static getGPU(){let t="",e="";if(null==this?void 0:this.document){let n=this.document.createElement("canvas"),s=n.getContext("webgl")||n.getContext("experimental-webgl");if(s instanceof WebGLRenderingContext){let n=s.getExtension("WEBGL_debug_renderer_info");if(n){let r=s.getParameter(n.UNMASKED_RENDERER_WEBGL);t=(r.match(/ANGLE \((.+?),/)||[])[1]||"",e=(r.match(/, (.+?) (\(|vs_)/)||[])[1]||""}}}return{type:t,model:e}}static getLanguage(){var t,e;let n=(null==(t=this.navigator)?void 0:t.language)||(null==(e=this.navigator)?void 0:e.userLanguage);if("string"!=typeof n)return"";let s=n.split("-");return s[1]&&(s[1]=s[1].toUpperCase()),s.join("_")}static getTimeZone(){var t,e;return null==(e=null==(t=null==Intl?void 0:Intl.DateTimeFormat())?void 0:t.resolvedOptions())?void 0:e.timeZone}static async getScreenFPS(){return new Promise((function(t){let e=0,n=1,s=[],r=function(i){if(e>0)if(n<12)s.push(i-e),e=i,n++,requestAnimationFrame(r);else{s.sort(),s=s.slice(1,11);let e=s.reduce(((t,e)=>t+e));const n=10*Math.round(1e4/e/10);t(n)}else e=i,requestAnimationFrame(r)};requestAnimationFrame(r)}))}static async getIPAddress(){const t=/\b((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/,e=/\b(?:[A-F0-9]{1,4}:){7}[A-F0-9]{1,4}\b/i;let n=window.RTCPeerConnection||window.mozRTCPeerConnection||window.webkitRTCPeerConnection;const s=new Set,r=n=>{var r;const i=null==(r=null==n?void 0:n.candidate)?void 0:r.candidate;if(i)for(const o of[t,e]){const t=i.match(o);t&&s.add(t[0])}};return new Promise((function(t,e){const i=new n({iceServers:[{urls:"stun:stun.l.google.com:19302"},{urls:"stun:stun.services.mozilla.com"}]});i.addEventListener("icecandidate",r),i.createDataChannel(""),i.createOffer().then((t=>i.setLocalDescription(t)),e);let o,a=20,l=function(){try{i.removeEventListener("icecandidate",r),i.close()}catch{}o&&clearInterval(o)};o=window.setInterval((function(){let e=[...s];e.length?(l(),t(e[0])):a?a--:(l(),t(""))}),100)}))}static async getNetwork(){var t,e;let n="unknown",s=null==(t=this.navigator)?void 0:t.connection;return s&&(n=s.type||s.effectiveType,"2"!=n&&"unknown"!=n||(n="wifi")),{network:n,isOnline:(null==(e=this.navigator)?void 0:e.onLine)||!1,ip:await this.getIPAddress()}}}r(T,"document",null==window?void 0:window.document),r(T,"navigator",null==window?void 0:window.navigator),r(T,"userAgent",null==(n=null==window?void 0:window.navigator)?void 0:n.userAgent),r(T,"screen",null==window?void 0:window.screen);class I{static delta(t,e){const n=6378245,s=.006693421622965943;let r=this.transformLat(e-105,t-35),i=this.transformLon(e-105,t-35);const o=t/180*this.PI;let a=Math.sin(o);a=1-s*a*a;const l=Math.sqrt(a);return r=180*r/(n*(1-s)/(a*l)*this.PI),i=180*i/(n/l*Math.cos(o)*this.PI),{lat:r,lng:i}}static outOfChina(t,e){return t<72.004||t>137.8347||(e<.8293||e>55.8271)}static gcjEncrypt(t,e){if(this.outOfChina(t,e))return{lat:t,lng:e};const n=this.delta(t,e);return{lat:t+n.lat,lng:e+n.lng}}static gcjDecrypt(t,e){if(this.outOfChina(t,e))return{lat:t,lng:e};const n=this.delta(t,e);return{lat:t-n.lat,lng:e-n.lng}}static gcjDecryptExact(t,e){let n=.01,s=.01,r=t-n,i=e-s,o=t+n,a=e+s,l=0,c=0,h=0;for(;;){l=(r+o)/2,c=(i+a)/2;const u=this.gcjEncrypt(l,c);if(n=u.lat-t,s=u.lng-e,Math.abs(n)<1e-9&&Math.abs(s)<1e-9)break;if(n>0?o=l:r=l,s>0?a=c:i=c,++h>1e4)break}return{lat:l,lng:c}}static bdEncrypt(t,e){const n=e,s=t,r=Math.sqrt(n*n+s*s)+2e-5*Math.sin(s*this.XPI),i=Math.atan2(s,n)+3e-6*Math.cos(n*this.XPI),o=r*Math.cos(i)+.0065;return{lat:r*Math.sin(i)+.006,lng:o}}static bdDecrypt(t,e){const n=e-.0065,s=t-.006,r=Math.sqrt(n*n+s*s)-2e-5*Math.sin(s*this.XPI),i=Math.atan2(s,n)-3e-6*Math.cos(n*this.XPI),o=r*Math.cos(i);return{lat:r*Math.sin(i),lng:o}}static mercatorEncrypt(t,e){const n=20037508.34*e/180;let s=Math.log(Math.tan((90+t)*this.PI/360))/(this.PI/180);return s=20037508.34*s/180,{lat:s,lng:n}}static mercatorDecrypt(t,e){const n=e/20037508.34*180;let s=t/20037508.34*180;return s=180/this.PI*(2*Math.atan(Math.exp(s*this.PI/180))-this.PI/2),{lat:s,lng:n}}static transformLat(t,e){let n=2*t-100+3*e+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*this.PI)+20*Math.sin(2*t*this.PI))/3,n+=2*(20*Math.sin(e*this.PI)+40*Math.sin(e/3*this.PI))/3,n+=2*(160*Math.sin(e/12*this.PI)+320*Math.sin(e*this.PI/30))/3,n}static transformLon(t,e){let n=300+t+2*e+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*this.PI)+20*Math.sin(2*t*this.PI))/3,n+=2*(20*Math.sin(t*this.PI)+40*Math.sin(t/3*this.PI))/3,n+=2*(150*Math.sin(t/12*this.PI)+300*Math.sin(t/30*this.PI))/3,n}static random({x:t,y:e},{x:n,y:s}){return{x:Math.random()*(n-t)+t,y:Math.random()*(s-e)+e}}static deCompose(t,e,n){const s=[];if(t instanceof Array&&!(t[0]instanceof Array))e(t);else if(t instanceof Array&&t[0]instanceof Array)for(let r=0;r<t.length;r++){const i=t[r];if(!g.isNil(i))if(i[0]instanceof Array){const t=n?this.deCompose(i,(t=>e(t)),n):this.deCompose(i,(t=>e(t)));s.push(t)}else{const t=n?e.call(n,i):e(i);s.push(t)}}return s}}r(I,"PI",3.141592653589793),r(I,"XPI",52.35987755982988);const D=Object.create(Date);D.prototype.format=function(t="yyyy-MM-dd hh:mm:ss"){const e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"H+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)));for(const n in e){const s=new RegExp("("+n+")","g");s.test(t)&&(t=t.replace(s,(t=>(1===t.length?e[n]:("00"+e[n]).substr((""+e[n]).length)).toString())))}return t},D.prototype.addDate=function(t,e){const n=new Date(this);switch(t){case"y":n.setFullYear(this.getFullYear()+e);break;case"q":n.setMonth(this.getMonth()+3*e);break;case"M":n.setMonth(this.getMonth()+e);break;case"w":n.setDate(this.getDate()+7*e);break;case"d":default:n.setDate(this.getDate()+e);break;case"h":n.setHours(this.getHours()+e);break;case"m":n.setMinutes(this.getMinutes()+e);break;case"s":n.setSeconds(this.getSeconds()+e)}return n};class P{static parseDate(t){if("string"==typeof t){var e=t.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) *$/);if(e&&e.length>3)return new Date(parseInt(e[1]),parseInt(e[2])-1,parseInt(e[3]));if((e=t.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) +(\d{1,2}):(\d{1,2}):(\d{1,2}) *$/))&&e.length>6)return new Date(parseInt(e[1]),parseInt(e[2])-1,parseInt(e[3]),parseInt(e[4]),parseInt(e[5]),parseInt(e[6]));if((e=t.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) +(\d{1,2}):(\d{1,2}):(\d{1,2})\.(\d{1,9}) *$/))&&e.length>7)return new Date(parseInt(e[1]),parseInt(e[2])-1,parseInt(e[3]),parseInt(e[4]),parseInt(e[5]),parseInt(e[6]),parseInt(e[7]))}return null}static formatDateInterval(t,e){const n=new Date(t),s=new Date(e).getTime()-n.getTime(),r=Math.floor(s/864e5),i=s%864e5,o=Math.floor(i/36e5),a=i%36e5,l=Math.floor(a/6e4),c=a%6e4,h=Math.round(c/1e3);let u="";return r>0&&(u+=r+"天"),o>0&&(u+=o+"时"),l>0&&(u+=l+"分"),h>0&&(u+=h+"秒"),0===r&&0===o&&0===l&&0===h&&(u="少于1秒"),u}static formatterCounter(t){const e=function(t){return(t>10?"":"0")+(t||0)},n=t%3600,s=n%60;return`${e(Math.floor(t/3600))}:${e(Math.floor(n/60))}:${e(Math.round(s))}`}static sleep(t){}}function L(t){return function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).split(/\s+/)}r(P,"lastMonthDate",new Date((new Date).getFullYear(),(new Date).getMonth()-1,1)),r(P,"thisMonthDate",new Date((new Date).getFullYear(),(new Date).getMonth(),1)),r(P,"nextMonthDate",new Date((new Date).getFullYear(),(new Date).getMonth()+1,1)),r(P,"lastWeekDate",new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+1-7-(new Date).getDay())),r(P,"thisWeekDate",new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+1-(new Date).getDay())),r(P,"nextWeekDate",new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+1+7-(new Date).getDay())),r(P,"lastDayDate",new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()-1)),r(P,"thisDayDate",new Date((new Date).setHours(0,0,0,0))),r(P,"nextDayDate",new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+1));const k={getStyle(t,e){var n;let s=t.style[e];if(!s||"auto"===s){const r=null==(n=document.defaultView)?void 0:n.getComputedStyle(t,null);s=r?r[e]:null,"auto"===s&&(s=null)}return s},create(t,e,n){const s=document.createElement(t);return s.className=e||"",n&&n.appendChild(s),s},remove(t){const e=t.parentNode;e&&e.removeChild(t)},empty(t){for(;t.firstChild;)t.removeChild(t.firstChild)},toFront(t){const e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)},toBack(t){const e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)},getClass:t=>((null==t?void 0:t.host)||t).className.toString(),hasClass(t,e){var n;if(null==(n=t.classList)?void 0:n.contains(e))return!0;const s=this.getClass(t);return s.length>0&&new RegExp(`(^|\\s)${e}(\\s|$)`).test(s)},addClass(t,e){if(void 0!==t.classList){const n=L(e);for(let e=0,s=n.length;e<s;e++)t.classList.add(n[e])}else if(!this.hasClass(t,e)){const n=this.getClass(t);this.setClass(t,(n?n+" ":"")+e)}},removeClass(t,e){if(void 0!==t.classList){L(e).forEach((e=>t.classList.remove(e)))}else this.setClass(t,(" "+this.getClass(t)+" ").replace(" "+e+" "," ").trim())},setClass(t,e){"classList"in t&&(t.classList.value="",e.split(" ").forEach((e=>t.classList.add(e))))},parseFromString:t=>(new DOMParser).parseFromString(t,"text/xml").children[0]},N={convertBase64ToBlob(t){const e=t.split(",")[0].split(":")[1].split(";")[0],n=atob(t.split(",")[1]),s=new Array(n.length);for(let i=0;i<n.length;i++)s[i]=n.charCodeAt(i);const r=new Uint8Array(s);return new Blob([r],{type:e})},convertBase64ToFile(t,e){const n=t.split(","),s=n[0].match(/:(.*?);/),r=s?s[1]:"image/png",i=atob(n[1]),o=new Uint8Array(i.length);for(let a=0;a<i.length;a++)o[a]=i.charCodeAt(a);return new File([o],e,{type:r})},downloadFromFile(t,e){if("object"==typeof t)if(t instanceof Blob)t=URL.createObjectURL(t);else{const e=JSON.stringify(t),n=new Blob([e],{type:"text/json"});t=window.URL.createObjectURL(n)}else if("string"==typeof t&&-1===t.indexOf("http")){const e=new Blob([t],{type:"text/json"});t=window.URL.createObjectURL(e)}var n=document.createElement("a");n.href=t,n.download=e||"",n.click(),window.URL.revokeObjectURL(n.href)},readFileFromUrl:(t,e)=>new Promise(((n,s)=>{const r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="blob";const i=e.split(".");try{r.onload=function(){if(this.status>=200&&this.status<300){const t=r.response,o=URL.createObjectURL(t),a=new File([t],e,{type:i[1],lastModified:(new Date).getTime()}),l=new FileReader;l.readAsArrayBuffer(a),l.onload=function(t){var e;URL.revokeObjectURL(o),n(null==(e=t.target)?void 0:e.result)},l.onerror=function(t){s(t)}}},r.onerror=function(t){s(t)}}catch(o){s(o)}r.send()}))};class U{static resetWarned(){this.warned={}}static changeVoice(){this.isMute=!!Number(!this.isMute),localStorage.setItem("mute",Number(this.isMute).toString())}static _call(t,e,n){this.warned[e]||(t(e,n),this.warned[e]=!0)}static msg(t,e,n={}){if(this.isMute)return;const s=g.decodeDict(t,"success","恭喜","error","发生错误","warning","警告","info","友情提示")+":";this.speechSynthesisUtterance.text=s+e,this.speechSynthesisUtterance.lang=n.lang||"zh-CN",this.speechSynthesisUtterance.volume=n.volume||1,this.speechSynthesisUtterance.rate=n.rate||1,this.speechSynthesisUtterance.pitch=n.pitch||1,this.speechSynthesis.speak(this.speechSynthesisUtterance)}static stop(t){this.speechSynthesisUtterance.text=t,this.speechSynthesis.cancel()}static warning(t,e={}){"development"===process.env.NODE_ENV&&void 0!==console&&console.warn(`Warning: %c${t}`,"color:#E6A23C;font-weight: bold;"),this.msg("warning",t,e)}static warningOnce(t,e={}){this._call(this.warning.bind(this),t,e)}static info(t,e={}){"development"===process.env.NODE_ENV&&void 0!==console&&console.info(`Info: %c${t}`,"color:#909399;font-weight: bold;"),this.msg("info",t,e)}static infoOnce(t,e={}){this._call(this.info.bind(this),t,e)}static error(t,e={}){"development"===process.env.NODE_ENV&&void 0!==console&&console.error(`Error: %c${t}`,"color:#F56C6C;font-weight: bold;"),this.msg("error",t,e)}static errorOnce(t,e={}){this._call(this.error.bind(this),t,e)}static success(t,e={}){"development"===process.env.NODE_ENV&&void 0!==console&&console.log(`Success: %c${t}`,"color:#67C23A;font-weight: bold;"),this.msg("success",t,e)}static successOnce(t,e={}){this._call(this.success.bind(this),t,e)}}r(U,"warned",{}),r(U,"isMute",!!Number(localStorage.getItem("mute"))||!1),r(U,"speechSynthesis",window.speechSynthesis),r(U,"speechSynthesisUtterance",new SpeechSynthesisUtterance);const F={debounce(t,e,n=!0){let s,r,i=null;const o=()=>{const a=Date.now()-s;a<e&&a>0?i=setTimeout(o,e-a):(i=null,n||(r=t.apply(this,undefined)))};return(...a)=>{s=Date.now();const l=n&&!i;return i||(i=setTimeout(o,e)),l&&(r=t.apply(this,a),i||(a=null)),r}},throttle(t,e,n=1){let s=0,r=null;return(...i)=>{if(1===n){const n=Date.now();n-s>=e&&(t.apply(this,i),s=n)}else 2===n&&(r||(r=setTimeout((()=>{r=null,t.apply(this,i)}),e)))}},memoize(t){const e=new Map;return(...n)=>{const s=JSON.stringify(n);if(e.has(s))return e.get(s);{const r=t.apply(this,n);return e.set(s,r),r}}},recurve(t,e=500,n=5e3){let s=0;setTimeout((()=>{s++,s<Math.floor(n/e)&&(t.call(this),setTimeout(this.recurve.bind(this,t,e,n),e))}),e)},once(t){let e=!1;return function(...n){if(!e)return e=!0,t(...n)}}},G={changeCase(t,e){switch(e=e||c.LOWER_CASE){case c.REVERSE_CASE:return t.split("").map((function(t){return/[a-z]/.test(t)?t.toUpperCase():t.toLowerCase()})).join("");case c.UPPER_CAMEL_CASE:return t.replace(/\b\w+\b/g,(function(t){return t.substring(0,1).toUpperCase()+t.substring(1).toLowerCase()}));case c.LOWER_CAMEL_CASE:return t.replace(/\b\w+\b/g,(function(t){return t.substring(0,1).toLowerCase()+t.substring(1).toUpperCase()}));case c.UPPER_CASE:return t.toUpperCase();case c.LOWER_CASE:return t.toLowerCase();default:return t}},getByteLength:t=>t.replace(/[\u0391-\uFFE5]/g,"aa").length,subStringByte(t,e,n){var s=/[^\x00-\xff]/g;if(t.replace(s,"mm").length<=n)return t;for(var r=Math.floor(n/2);r<t.length;r++){let i=t.substring(e,r);if(i.replace(s,"mm").length>=n)return i}return t},string2Bytes(t){const e=[];let n;const s=t.length;for(let r=0;r<s;r++)n=t.charCodeAt(r),n>=65536&&n<=1114111?(e.push(n>>18&7|240),e.push(n>>12&63|128),e.push(n>>6&63|128),e.push(63&n|128)):n>=2048&&n<=65535?(e.push(n>>12&15|224),e.push(n>>6&63|128),e.push(63&n|128)):n>=128&&n<=2047?(e.push(n>>6&31|192),e.push(63&n|128)):e.push(255&n);return new Uint8Array(e)},bytes2String(t){if("string"==typeof t)return t;let e="";const n=t;for(let s=0;s<n.length;s++){const t=n[s].toString(2),r=t.match(/^1+?(?=0)/);if(r&&8==t.length){const t=r[0].length;let i=n[s].toString(2).slice(7-t);for(let e=1;e<t;e++)i+=n[e+s].toString(2).slice(2);e+=String.fromCharCode(parseInt(i,2)),s+=t-1}else e+=String.fromCharCode(n[s])}return e}},$={json2Query(t){var e=[];for(var n in t)if(t.hasOwnProperty(n)){var s=n,r=t[n];e.push(encodeURIComponent(s)+"="+encodeURIComponent(r))}return e.join("&")},query2Json(t=window.location.href,e=!0){const n=/([^&=]+)=([\w\W]*?)(&|$|#)/g,{search:s,hash:r}=new URL(t),i=[s,r];let o={};for(let a=0;a<i.length;a++){const t=i[a];if(t){const s=t.replace(/#|\//g,"").split("?");if(s.length>1)for(let t=1;t<s.length;t++){let r;for(;r=n.exec(s[t]);)o[r[1]]=e?decodeURIComponent(r[2]):r[2]}}}return o}},B={isUrl:t=>/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(t),isPhone:t=>/^1[3|4|5|6|7|8|9][0-9]{9}$/.test(t),isTel:t=>/^(0\d{2,3}-\d{7,8})(-\d{1,4})?$/.test(t),isStrongPwd:t=>/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,20}$/.test(t),isEmail:t=>/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t),isIP:t=>/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(t),isEnglish:t=>/^[a-zA-Z]+$/.test(t),isChinese:t=>/^[\u4E00-\u9FA5]+$/.test(t),isHTML:t=>/<("[^"]*"|'[^']*'|[^'">])*>/.test(t),isXML:t=>/^([a-zA-Z]+-?)+[a-zA-Z0-9]+\\.[x|X][m|M][l|L]$/.test(t),isIDCard:t=>/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(t)},j=class t extends y{constructor(n=`ws://${window.document.domain}:20007/mqtt`,s={}){super(),r(this,"state"),r(this,"url"),r(this,"context"),r(this,"options"),r(this,"client"),r(this,"topics"),this.context=g.extend(t.defaultContext,s),this.options={connectTimeout:this.context.MQTT_TIMEOUTM,clientId:g.guid(),username:this.context.MQTT_USERNAME,password:this.context.MQTT_PASSWORD,clean:!0},this.url=n,this.client=e.connect(this.url,this.options),this._onConnect(),this._onMessage(),this.state=1,this.topics=[]}_onConnect(){this.client.on("connect",(()=>{this.state=2,console.log("链接mqtt成功==>"+this.url),this.dispatchEvent({type:i.MQTT_CONNECT,message:this})})),this.client.on("error",(t=>{console.log("链接mqtt报错",t),this.state=0,this.dispatchEvent({type:i.MQTT_ERROR,message:this}),this.client.end(),this.client.reconnect()}))}_onMessage(){this.client.on("message",((t,e)=>{let n=e,s="";e instanceof Uint8Array&&(n=e.toString());try{s=w.parse(n)}catch(r){throw new Error(o.DATA_ERROR_JSON)}this.dispatchEvent({type:i.MQTT_MESSAGE,message:{topic:t,data:s}})}))}sendMsg(t,e){if(this.client.connected)return this.client.publish(t,e,{qos:1,retain:!0}),this;console.error("客户端未连接")}subscribe(t){return 2===this.state?this.client.subscribe(t,{qos:1},((e,n)=>{e instanceof Error?console.error("订阅失败==>"+t,e):(this.topics=O.union(this.topics,t),console.log("订阅成功==>"+t))})):this.addEventListener(i.MQTT_CONNECT,(e=>{this.client.subscribe(t,{qos:1},((e,n)=>{e instanceof Error?console.error("订阅失败==>"+t,e):(this.topics=O.union(this.topics,t),console.log("订阅成功==>"+t))}))})),this}unsubscribe(t){return this.client.unsubscribe(t,{qos:1},((e,n)=>{e instanceof Error?console.error(`取消订阅失败==>${t}`,e):(this.topics=O.difference(this.topics,t),console.log(`取消订阅成功==>${t}`))})),this}unsubscribeAll(){return this.unsubscribe(this.topics),this}unconnect(){this.client.end(),this.client=null,this.dispatchEvent({type:i.MQTT_CLOSE,message:null}),console.log("断开mqtt成功==>"+this.url)}};r(j,"defaultContext",{MQTT_USERNAME:"iRVMS-WEB",MQTT_PASSWORD:"novasky888",MQTT_TIMEOUTM:2e4});let q=j;const W=class t{static setLocal(t,e=null,n={}){var s=this._getPrefixedKey(t,n);try{const{expires:t}=n,r={data:e};t&&(r.expires=t),window.localStorage.setItem(s,JSON.stringify(r))}catch(r){console&&console.warn(`Storage didn't successfully save the '{"${t}": "${e}"}' pair, because the Storage is full.`)}}static setSession(t,e=null,n={}){var s=this._getPrefixedKey(t,n);try{const{expires:t}=n,r={data:e};t&&(r.expires=t),window.sessionStorage.setItem(s,JSON.stringify(r))}catch(r){console&&console.warn(`Storage didn't successfully save the '{"${t}": "${e}"}' pair, because the Storage is full.`)}}static getLocal(t,e,n){var s,r=this._getPrefixedKey(t,n);try{s=JSON.parse(window.localStorage.getItem(r)||"")}catch(i){s=window.localStorage[r]?{data:window.localStorage.getItem(r)}:null}if(!s)return e;if("object"==typeof s&&void 0!==s.data){const t=s.expires;return t&&Date.now()>t?e:s.data}}static getSession(t,e,n){var s,r=this._getPrefixedKey(t,n);try{s=JSON.parse(window.sessionStorage.getItem(r)||"")}catch(i){s=window.sessionStorage[r]?{data:window.sessionStorage.getItem(r)}:null}if(!s)return e;if("object"==typeof s&&void 0!==s.data){const t=s.expires;return t&&Date.now()>t?e:s.data}}static localkeys(){const e=[];var n=Object.keys(window.localStorage);return 0===t.prefix.length?n:(n.forEach((function(n){-1!==n.indexOf(t.prefix)&&e.push(n.replace(t.prefix,""))})),e)}static sessionkeys(){const e=[];var n=Object.keys(window.sessionStorage);return 0===t.prefix.length?n:(n.forEach((function(n){-1!==n.indexOf(t.prefix)&&e.push(n.replace(t.prefix,""))})),e)}static getAllLocal(e){var n=t.localkeys();if(e){const s=[];return n.forEach((n=>{if(e.includes(n)){const e={};e[n]=t.getLocal(n,null,null),s.push(e)}})),s}return n.map((e=>t.getLocal(e,null,null)))}static getAllSession(e){var n=t.sessionkeys();if(e){const s=[];return n.forEach((n=>{if(e.includes(n)){const e={};e[n]=t.getSession(n,null,null),s.push(e)}})),s}return n.map((e=>t.getSession(e,null,null)))}static remove(t,e){var n=this._getPrefixedKey(t,e);window.sessionStorage.removeItem(n),window.localStorage.removeItem(n)}static clearLocal(e){t.prefix.length?this.localkeys().forEach((t=>{window.localStorage.removeItem(this._getPrefixedKey(t,e))})):window.localStorage.clear()}static clearSession(e){t.prefix.length?this.sessionkeys().forEach((t=>{window.sessionStorage.removeItem(this._getPrefixedKey(t,e))})):window.sessionStorage.clear()}};r(W,"prefix",""),r(W,"_getPrefixedKey",(function(t,e){return(e=e||{}).noPrefix?t:W.prefix+t}));let J=W;t.AjaxUtil=A,t.ArrayUtil=O,t.AssertUtil=C,t.AudioPlayer=class{constructor(t){r(this,"audio"),this.audio=new Audio,this.audio.src=t}play(){!this.muted&&this.audio.play()}pause(){this.audio.pause()}get muted(){return this.audio.muted}set muted(t){this.audio.muted=t}},t.BrowserUtil=T,t.CanvasDrawer=E,t.CaseType=c,t.Color=m,t.Cookie=class{static set(t,e,n=30){if("string"!=typeof t||"number"!=typeof n)throw new Error("Invalid arguments");const s=new Date;s.setTime(s.getTime()+24*n*60*60*1e3),document.cookie=`${t}=${encodeURIComponent(e)};expires=${s.toUTCString()}`}static remove(t){var e=new Date;e.setTime(e.getTime()-1);var n=this.get(t);null!=n&&(document.cookie=t+"="+n+";expires="+e.toUTCString())}static get(t){var e=document.cookie.match(new RegExp("(^| )"+t+"=([^;]*)(;|$)"));return null!=e?e[2]:""}},t.CoordsUtil=I,t.DateUtil=P,t.DomUtil=k,t.ErrorType=o,t.EventDispatcher=y,t.EventType=i,t.ExceptionUtil=x,t.FileUtil=N,t.FormType=l,t.GeoJsonUtil=b,t.GeoUtil=S,t.GraphicType=h,t.HashMap=R,t.ImageUtil=M,t.LayerType=a,t.LineSymbol=u,t.MathUtil=p,t.MeasureMode=d,t.MessageUtil=U,t.MqttClient=q,t.ObjectUtil=w,t.OptimizeUtil=F,t.Storage=J,t.StringUtil=G,t.UrlUtil=$,t.Util=g,t.ValidateUtil=B,t.WebSocketClient=class extends y{constructor(t="ws://127.0.0.1:10088"){super(),r(this,"maxCheckTimes",10),r(this,"url"),r(this,"checkTimes",0),r(this,"connectStatus",!1),r(this,"client",null),this.maxCheckTimes=10,this.url=t,this.checkTimes=0,this.connect(),this.connCheckStatus(this.maxCheckTimes)}connect(){if(this.disconnect(),this.url)try{const t=this;console.info("创建ws连接>>>"+this.url),this.client=new WebSocket(this.url),this.client&&(this.client.onopen=function(e){t.dispatchEvent({type:i.WEB_SOCKET_CONNECT,message:e})},this.client.onmessage=function(e){t.connectStatus=!0,t.dispatchEvent({type:i.WEB_SOCKET_MESSAGE,message:e})},this.client.onclose=function(e){t.dispatchEvent({type:i.WEB_SOCKET_CLOSE,message:e})},this.checkTimes===this.maxCheckTimes&&(this.client.onerror=function(e){t.dispatchEvent({type:i.WEB_SOCKET_ERROR,message:e})}))}catch(t){console.error("创建ws连接失败"+this.url+":"+t)}}disconnect(){if(this.client)try{console.log("ws断开连接"+this.url),this.client.close(),this.client=null}catch(t){this.client=null}}connCheckStatus(t){this.checkTimes>t||setTimeout((()=>{this.checkTimes++,this.state!==WebSocket.CONNECTING&&this.state!==WebSocket.OPEN&&this.connect(),this.connCheckStatus(t)}),2e3)}send(t){return this.client&&this.state===WebSocket.OPEN?(this.client.send(t),!0):(console.error(this.url+"消息发送失败:"+t),this)}heartbeat(){setTimeout((()=>{this.state===WebSocket.OPEN&&this.send("HeartBeat"),console.log("HeartBeat,"+this.url),setTimeout(this.heartbeat,3e4)}),1e3)}get state(){var t;return null==(t=this.client)?void 0:t.readyState}},Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/utils/FileUtil.d.ts
CHANGED
|
@@ -6,14 +6,6 @@ declare const _default: {
|
|
|
6
6
|
* @returns 转换后的Blob对象
|
|
7
7
|
*/
|
|
8
8
|
convertBase64ToBlob(data: string): Blob;
|
|
9
|
-
/**
|
|
10
|
-
* 将图片的URL转换为Base64编码
|
|
11
|
-
*
|
|
12
|
-
* @param url 图片的URL地址
|
|
13
|
-
* @param width 图片的宽度,默认为图片原始宽度
|
|
14
|
-
* @param height 图片的高度,默认为图片原始高度
|
|
15
|
-
* @returns 返回Promise对象,解析后得到包含Base64编码数据的对象
|
|
16
|
-
*/
|
|
17
9
|
/**
|
|
18
10
|
* 将base64字符串转换为文件对象
|
|
19
11
|
*
|
package/dist/utils/GeoUtil.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { MessageType } from 'element-ui/types/message';
|
|
2
1
|
interface VoiceOptions {
|
|
3
2
|
lang?: string;
|
|
4
3
|
volume?: number;
|
|
5
4
|
rate?: number;
|
|
6
5
|
pitch?: number;
|
|
7
6
|
}
|
|
7
|
+
type MessageType = 'warning' | 'info' | 'success' | 'error';
|
|
8
8
|
export default class MessageUtil {
|
|
9
9
|
private static warned;
|
|
10
10
|
private static isMute;
|
|
@@ -3,12 +3,12 @@ declare const _default: {
|
|
|
3
3
|
* 转换字符串大小写
|
|
4
4
|
*
|
|
5
5
|
* @param str 待转换的字符串
|
|
6
|
-
* @param type 转换类型,可选值为
|
|
6
|
+
* @param type 转换类型,可选值为 0-4,默认为 4
|
|
7
|
+
* 0:字母大小写反转
|
|
7
8
|
* 1:首字母大写,其余小写
|
|
8
9
|
* 2:首字母小写,其余大写
|
|
9
|
-
* 3
|
|
10
|
-
* 4
|
|
11
|
-
* 5:全部小写
|
|
10
|
+
* 3:全部大写
|
|
11
|
+
* 4:全部小写
|
|
12
12
|
* @returns 转换后的字符串
|
|
13
13
|
*/
|
|
14
14
|
changeCase(str: string, type: number): string;
|