@visactor/vutils 0.19.1 → 0.19.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/common/array.js +2 -2
- package/cjs/common/array.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.min.js +1 -1
- package/es/common/array.js +2 -2
- package/es/common/array.js.map +1 -1
- package/package.json +4 -4
package/cjs/common/array.js
CHANGED
|
@@ -34,7 +34,7 @@ const maxInArray = (arr, compareFn) => {
|
|
|
34
34
|
let max = arr[0];
|
|
35
35
|
for (let i = 1; i < arr.length; i++) {
|
|
36
36
|
const value = arr[i];
|
|
37
|
-
(null !== (_a = null == compareFn ? void 0 : compareFn(value, max)) && void 0 !== _a ? _a : value - max > 0
|
|
37
|
+
(null !== (_a = null == compareFn ? void 0 : compareFn(value, max)) && void 0 !== _a ? _a : value - max) > 0 && (max = value);
|
|
38
38
|
}
|
|
39
39
|
return max;
|
|
40
40
|
};
|
|
@@ -47,7 +47,7 @@ const minInArray = (arr, compareFn) => {
|
|
|
47
47
|
let min = arr[0];
|
|
48
48
|
for (let i = 1; i < arr.length; i++) {
|
|
49
49
|
const value = arr[i];
|
|
50
|
-
(null !== (_a = null == compareFn ? void 0 : compareFn(value, min)) && void 0 !== _a ? _a : value - min < 0
|
|
50
|
+
(null !== (_a = null == compareFn ? void 0 : compareFn(value, min)) && void 0 !== _a ? _a : value - min) < 0 && (min = value);
|
|
51
51
|
}
|
|
52
52
|
return min;
|
|
53
53
|
};
|
package/cjs/common/array.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/common/array.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAgC;AAChC,gEAAwC;AACxC,wDAAgC;AAOhC,SAAgB,KAAK,CAAI,GAAa;IACpC,IAAI,IAAA,iBAAO,EAAC,GAAG,CAAC,EAAE;QAChB,OAAO,IAAA,iBAAO,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;KACnC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AALD,sBAKC;AAOD,SAAgB,IAAI,CAAI,GAAY;IAClC,IAAI,IAAA,qBAAW,EAAC,GAAG,CAAC,EAAE;QACpB,MAAM,GAAG,GAAG,GAAqB,CAAC;QAClC,OAAO,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;KAC5B;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAND,oBAMC;AAOM,MAAM,IAAI,GAAG,CAAC,GAAa,EAAE,EAAE;IACpC,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,EAAE;QACnB,OAAO,CAAC,CAAC;KACV;IACD,OAAQ,IAAI,CAAC,GAAG,CAAY,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AACxC,CAAC,CAAC;AALW,QAAA,IAAI,QAKf;AAQK,MAAM,UAAU,GAAG,CAAI,GAAQ,EAAE,SAAkC,EAAiB,EAAE;;IAC3F,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;QACpB,OAAO,SAAS,CAAC;KAClB;IACD,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAG,KAAK,EAAE,GAAG,CAAC,mCAAK,KAAgB,GAAI,GAAc,GAAG,CAAC,EAAE;
|
|
1
|
+
{"version":3,"sources":["../src/common/array.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAgC;AAChC,gEAAwC;AACxC,wDAAgC;AAOhC,SAAgB,KAAK,CAAI,GAAa;IACpC,IAAI,IAAA,iBAAO,EAAC,GAAG,CAAC,EAAE;QAChB,OAAO,IAAA,iBAAO,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;KACnC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AALD,sBAKC;AAOD,SAAgB,IAAI,CAAI,GAAY;IAClC,IAAI,IAAA,qBAAW,EAAC,GAAG,CAAC,EAAE;QACpB,MAAM,GAAG,GAAG,GAAqB,CAAC;QAClC,OAAO,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;KAC5B;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAND,oBAMC;AAOM,MAAM,IAAI,GAAG,CAAC,GAAa,EAAE,EAAE;IACpC,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,EAAE;QACnB,OAAO,CAAC,CAAC;KACV;IACD,OAAQ,IAAI,CAAC,GAAG,CAAY,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AACxC,CAAC,CAAC;AALW,QAAA,IAAI,QAKf;AAQK,MAAM,UAAU,GAAG,CAAI,GAAQ,EAAE,SAAkC,EAAiB,EAAE;;IAC3F,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;QACpB,OAAO,SAAS,CAAC;KAClB;IACD,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,CAAC,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAG,KAAK,EAAE,GAAG,CAAC,mCAAK,KAAgB,GAAI,GAAc,CAAC,GAAG,CAAC,EAAE;YACxE,GAAG,GAAG,KAAK,CAAC;SACb;KACF;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAZW,QAAA,UAAU,cAYrB;AAQK,MAAM,UAAU,GAAG,CAAI,GAAQ,EAAE,SAAkC,EAAiB,EAAE;;IAC3F,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;QACpB,OAAO,SAAS,CAAC;KAClB;IACD,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,CAAC,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAG,KAAK,EAAE,GAAG,CAAC,mCAAK,KAAgB,GAAI,GAAc,CAAC,GAAG,CAAC,EAAE;YACxE,GAAG,GAAG,KAAK,CAAC;SACb;KACF;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAZW,QAAA,UAAU,cAYrB;AAQF,SAAgB,UAAU,CAAC,CAAM,EAAE,CAAM;IACvC,IAAI,CAAC,IAAA,iBAAO,EAAC,CAAC,CAAC,IAAI,CAAC,IAAA,iBAAO,EAAC,CAAC,CAAC,EAAE;QAC9B,OAAO,KAAK,CAAC;KACd;IACD,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE;QACzB,OAAO,KAAK,CAAC;KACd;IACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACjC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;YACjB,OAAO,KAAK,CAAC;SACd;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAbD,gCAaC;AAOD,SAAgB,SAAS,CAAI,GAAY;IACvC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAA,iBAAO,EAAC,GAAG,CAAC,EAAE;QACzB,OAAO,GAAG,CAAC;KACZ;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACzC,CAAC;AALD,8BAKC;AAGD,SAAgB,YAAY,CAAI,GAAQ,EAAE,SAAuB,IAAI,CAAC,MAAM;IAC1E,IAAI,CAAC,CAAC;IACN,IAAI,CAAC,CAAC;IACN,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAEnB,OAAO,CAAC,EAAE;QACR,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;QAC7B,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QACb,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QAChB,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;KACZ;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAZD,oCAYC;AAOD,SAAgB,YAAY,CAAC,GAAQ;IACnC,IAAI,CAAC,IAAA,iBAAO,EAAC,GAAG,CAAC,EAAE;QACjB,OAAO,CAAC,GAAG,CAAC,CAAC;KACd;IACD,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE;QACvB,MAAM,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;KACrC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AATD,oCASC","file":"array.js","sourcesContent":["import isArray from './isArray';\nimport isArrayLike from './isArrayLike';\nimport isValid from './isValid';\n\n/**\n * 将传入数据转换为数组格式\n * @param arr 入参。\n * @returns 数组\n */\nexport function array<T>(arr?: T | T[]): T[] {\n if (isValid(arr)) {\n return isArray(arr) ? arr : [arr];\n }\n return [];\n}\n\n/**\n * 获取数组的最后一个值,如果传入的参数为非数组,则返回 undefined\n * @param val any\n * @returns\n */\nexport function last<T>(val: T | T[]): T | undefined {\n if (isArrayLike(val)) {\n const arr = val as ArrayLike<any>;\n return arr[arr.length - 1];\n }\n return undefined;\n}\n\n/**\n * 获取数组第一项与最后一项的差值,如果数组为空\b则返回 0\n * @param arr\n * @returns\n */\nexport const span = (arr: number[]) => {\n if (arr.length <= 1) {\n return 0;\n }\n return (last(arr) as number) - arr[0];\n};\n\n/**\n * 获取数组中的最大值\n * @param arr 数组\n * @param compareFn 比较函数,返回正数表示 a > b,返回负数表示 a < b,返回 0 表示相等\n * @returns\n */\nexport const maxInArray = <T>(arr: T[], compareFn?: (a: T, b: T) => number): T | undefined => {\n if (arr.length === 0) {\n return undefined;\n }\n let max = arr[0];\n for (let i = 1; i < arr.length; i++) {\n const value = arr[i];\n if ((compareFn?.(value, max) ?? (value as number) - (max as number)) > 0) {\n max = value;\n }\n }\n return max;\n};\n\n/**\n * 获取数组中的最小值\n * @param arr 数组\n * @param compareFn 比较函数,返回正数表示 a > b,返回负数表示 a < b,返回 0 表示相等\n * @returns\n */\nexport const minInArray = <T>(arr: T[], compareFn?: (a: T, b: T) => number): T | undefined => {\n if (arr.length === 0) {\n return undefined;\n }\n let min = arr[0];\n for (let i = 1; i < arr.length; i++) {\n const value = arr[i];\n if ((compareFn?.(value, min) ?? (value as number) - (min as number)) < 0) {\n min = value;\n }\n }\n return min;\n};\n\n/**\n * 判断两个数组是否相同\n * @param a\n * @param b\n * @returns\n */\nexport function arrayEqual(a: any, b: any): boolean {\n if (!isArray(a) || !isArray(b)) {\n return false;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * 封装并返回无重复的数组\n * @param arr\n * @returns\n */\nexport function uniqArray<T>(arr: T | T[]): T | T[] {\n if (!arr || !isArray(arr)) {\n return arr;\n }\n return Array.from(new Set(array(arr)));\n}\n\n// Based on http://jsfromhell.com/array/shuffle\nexport function shuffleArray<T>(arr: T[], random: () => number = Math.random): T[] {\n let j;\n let x;\n let i = arr.length;\n\n while (i) {\n j = Math.floor(random() * i);\n x = arr[--i];\n arr[i] = arr[j];\n arr[j] = x;\n }\n return arr;\n}\n\n/**\n * 展开多层数组,非数组内容将变为 [input]\n * @param arr\n * @returns\n */\nexport function flattenArray(arr: any): any[] {\n if (!isArray(arr)) {\n return [arr];\n }\n const result = [];\n for (const value of arr) {\n result.push(...flattenArray(value));\n }\n return result;\n}\n"]}
|
package/dist/index.js
CHANGED
|
@@ -875,7 +875,7 @@
|
|
|
875
875
|
let max = arr[0];
|
|
876
876
|
for (let i = 1; i < arr.length; i++) {
|
|
877
877
|
const value = arr[i];
|
|
878
|
-
if ((_a = compareFn === null || compareFn === void 0 ? void 0 : compareFn(value, max)) !== null && _a !== void 0 ? _a : value - max > 0) {
|
|
878
|
+
if (((_a = compareFn === null || compareFn === void 0 ? void 0 : compareFn(value, max)) !== null && _a !== void 0 ? _a : value - max) > 0) {
|
|
879
879
|
max = value;
|
|
880
880
|
}
|
|
881
881
|
}
|
|
@@ -889,7 +889,7 @@
|
|
|
889
889
|
let min = arr[0];
|
|
890
890
|
for (let i = 1; i < arr.length; i++) {
|
|
891
891
|
const value = arr[i];
|
|
892
|
-
if ((_a = compareFn === null || compareFn === void 0 ? void 0 : compareFn(value, min)) !== null && _a !== void 0 ? _a : value - min < 0) {
|
|
892
|
+
if (((_a = compareFn === null || compareFn === void 0 ? void 0 : compareFn(value, min)) !== null && _a !== void 0 ? _a : value - min) < 0) {
|
|
893
893
|
min = value;
|
|
894
894
|
}
|
|
895
895
|
}
|
package/dist/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VUtils={})}(this,(function(t){"use strict";function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var u={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,u="~";function n(){}function r(t,e,u){this.fn=t,this.context=e,this.once=u||!1}function i(t,e,n,i,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new r(n,i||t,s),D=u?u+e:e;return t._events[D]?t._events[D].fn?t._events[D]=[t._events[D],o]:t._events[D].push(o):(t._events[D]=o,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(u=!1)),o.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(u?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=u?u+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,i=n.length,s=new Array(i);r<i;r++)s[r]=n[r].fn;return s},o.prototype.listenerCount=function(t){var e=u?u+t:t,n=this._events[e];return n?n.fn?1:n.length:0},o.prototype.emit=function(t,e,n,r,i,s){var o=u?u+t:t;if(!this._events[o])return!1;var D,a,h=this._events[o],l=arguments.length;if(h.fn){switch(h.once&&this.removeListener(t,h.fn,void 0,!0),l){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,e),!0;case 3:return h.fn.call(h.context,e,n),!0;case 4:return h.fn.call(h.context,e,n,r),!0;case 5:return h.fn.call(h.context,e,n,r,i),!0;case 6:return h.fn.call(h.context,e,n,r,i,s),!0}for(a=1,D=new Array(l-1);a<l;a++)D[a-1]=arguments[a];h.fn.apply(h.context,D)}else{var c,f=h.length;for(a=0;a<f;a++)switch(h[a].once&&this.removeListener(t,h[a].fn,void 0,!0),l){case 1:h[a].fn.call(h[a].context);break;case 2:h[a].fn.call(h[a].context,e);break;case 3:h[a].fn.call(h[a].context,e,n);break;case 4:h[a].fn.call(h[a].context,e,n,r);break;default:if(!D)for(c=1,D=new Array(l-1);c<l;c++)D[c-1]=arguments[c];h[a].fn.apply(h[a].context,D)}}return!0},o.prototype.on=function(t,e,u){return i(this,t,e,u,!1)},o.prototype.once=function(t,e,u){return i(this,t,e,u,!0)},o.prototype.removeListener=function(t,e,n,r){var i=u?u+t:t;if(!this._events[i])return this;if(!e)return s(this,i),this;var o=this._events[i];if(o.fn)o.fn!==e||r&&!o.once||n&&o.context!==n||s(this,i);else{for(var D=0,a=[],h=o.length;D<h;D++)(o[D].fn!==e||r&&!o[D].once||n&&o[D].context!==n)&&a.push(o[D]);a.length?this._events[i]=1===a.length?a[0]:a:s(this,i)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=u?u+t:t,this._events[e]&&s(this,e)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=u,o.EventEmitter=o,t.exports=o}(u);var n=e(u.exports);const r=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`,i=(t,e=!1)=>e?"boolean"==typeof t:!0===t||!1===t||r(t,"Boolean"),s=t=>"function"==typeof t,o=t=>null==t,D=t=>null!=t,a=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e},h=t=>"object"==typeof t&&null!==t,l=function(t){if(!h(t)||!r(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},c=(t,e=!1)=>{const u=typeof t;return e?"string"===u:"string"===u||r(t,"String")},f=t=>Array.isArray?Array.isArray(t):r(t,"Array"),F=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)},d=t=>r(t,"Date"),g=(t,e=!1)=>{const u=typeof t;return e?"number"===u:"number"===u||r(t,"Number")},m=t=>g(t)&&Number.isFinite(t),C=t=>r(t,"RegExp"),p=Object.prototype,y=Object.prototype.hasOwnProperty;const x=Object.prototype.hasOwnProperty;function E(t,e,u=!1,n=!1){if(e){if(t===e)return;if(D(e)&&"object"==typeof e){const r=Object(e),i=[];for(const t in r)i.push(t);let{length:s}=i,o=-1;for(;s--;){const s=i[++o];!D(r[s])||"object"!=typeof r[s]||n&&f(t[s])?B(t,s,r[s]):M(t,e,s,u,n)}}}}function M(t,e,u,n=!1,r=!1){const i=t[u],s=e[u];let o=e[u],D=!0;if(f(s)){if(n)o=[];else if(f(i))o=i;else if(F(i)){o=new Array(i.length);let t=-1;const e=i.length;for(;++t<e;)o[t]=i[t]}}else l(s)?(o=null!=i?i:{},"function"!=typeof i&&"object"==typeof i||(o={})):D=!1;D&&E(o,s,n,r),B(t,u,o)}function B(t,e,u){(void 0!==u&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],u)||void 0===u&&!(e in t))&&(t[e]=u)}const b=Object.prototype.hasOwnProperty;function v(t){return Object.prototype.toString.call(t)}function A(t){return Object.keys(t)}function w(t,e){return t===e?0!==t||0!==e||1/t==1/e:t!=t&&e!=e}function S(t){return f(t)?t.length:a(t)?Object.keys(t).length:0}function T(t){if(!t)return[];if(Object.keys)return Object.keys(t);const e=[];for(const u in t)t.hasOwnProperty(u)&&e.push(u);return e}function _(t,e,u){const n=T(e);for(let r=0;r<n.length;r++){const i=n[r];(u?null!=e[i]:null==t[i])&&(t[i]=e[i])}return t}function L(t){return D(t)?f(t)?t:[t]:[]}function N(t){if(F(t)){return t[t.length-1]}}function k(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function I(t){return Number(t)}function U(t,e,u=I){const n=t.length;if(!n)return;if(e<=0||n<2)return u(t[0],0,t);if(e>=1)return u(t[n-1],n-1,t);const r=(n-1)*e,i=Math.floor(r),s=u(t[i],i,t);return s+(u(t[i+1],i+1,t)-s)*(r-i)}const H="undefined"!=typeof console;function O(t,e,u){const n=[e].concat([].slice.call(u));H&&console[t].apply(console,n)}var R;t.LoggerLevel=void 0,(R=t.LoggerLevel||(t.LoggerLevel={}))[R.None=0]="None",R[R.Error=1]="Error",R[R.Warn=2]="Warn",R[R.Info=3]="Info",R[R.Debug=4]="Debug";class P{static getInstance(t,e){return P._instance&&g(t)?P._instance.level(t):P._instance||(P._instance=new P(t,e)),P._instance}static setInstance(t){return P._instance=t}static setInstanceLevel(t){P._instance?P._instance.level(t):P._instance=new P(t)}static clearInstance(){P._instance=null}constructor(e=t.LoggerLevel.None,u){this._onErrorHandler=[],this._level=e,this._method=u}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(...t){this._onErrorHandler.forEach((e=>e(...t)))}canLogInfo(){return this._level>=t.LoggerLevel.Info}canLogDebug(){return this._level>=t.LoggerLevel.Debug}canLogError(){return this._level>=t.LoggerLevel.Error}canLogWarn(){return this._level>=t.LoggerLevel.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(...e){var u;return this._level>=t.LoggerLevel.Error&&(this._onErrorHandler.length?this.callErrorHandler(...e):O(null!==(u=this._method)&&void 0!==u?u:"error","ERROR",e)),this}warn(...e){return this._level>=t.LoggerLevel.Warn&&O(this._method||"warn","WARN",e),this}info(...e){return this._level>=t.LoggerLevel.Info&&O(this._method||"log","INFO",e),this}debug(...e){return this._level>=t.LoggerLevel.Debug&&O(this._method||"log","DEBUG",e),this}}P._instance=null;const z=(t,e,u)=>{let n=t,r=e;for(;n<r;){const t=Math.floor((n+r)/2);u(t)>=0?r=t:n=t+1}return n};function W(t,e){let u,n=0,r=0,i=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(u=e-r,r+=u/++n,i+=u*(e-r));else{let s=-1;for(let o of t)null!=(o=e(o,++s,t))&&(o=+o)>=o&&(u=o-r,r+=u/++n,i+=u*(o-r))}return n>1?i/(n-1):0}const j=Math.sqrt(50),Y=Math.sqrt(10),q=Math.sqrt(2);const V=1e-10,G=1e-10;function $(t,e,u=G,n=V){const r=n,i=u*Math.max(t,e);return Math.abs(t-e)<=Math.max(r,i)}const X=(t,e=0)=>{let u="",n=e-1;for(;n>=0;)u=`${u}${t}`,n-=1;return u},Z=(t,e,u=" ",n="right")=>{const r=u,i=t+"",s=e-i.length;return s<=0?i:"left"===n?X(r,s)+i:"center"===n?X(r,Math.floor(s/2))+i+X(r,Math.ceil(s/2)):i+X(r,s)},J=function(t,e,u){return t<e?e:t>u?u:t};let Q=!1;try{Q="function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){Q=!1}function K(t,e,u){let n,r,i,s,o,D,h=0,l=!1,c=!1,f=!0;const F=!e&&0!==e&&Q;if("function"!=typeof t)throw new TypeError("Expected a function");function d(e){const u=n,i=r;return n=r=void 0,h=e,s=t.apply(i,u),s}function g(t,e){return F?(cancelAnimationFrame(o),requestAnimationFrame(t)):setTimeout(t,e)}function C(t){const u=t-D;return void 0===D||u>=e||u<0||c&&t-h>=i}function p(){const t=Date.now();if(C(t))return y(t);o=g(p,function(t){const u=t-h,n=e-(t-D);return c?Math.min(n,i-u):n}(t))}function y(t){return o=void 0,f&&n?d(t):(n=r=void 0,s)}function x(...t){const u=Date.now(),i=C(u);if(n=t,r=this,D=u,i){if(void 0===o)return function(t){return h=t,o=g(p,e),l?d(t):s}(D);if(c)return o=g(p,e),d(D)}return void 0===o&&(o=g(p,e)),s}return e=+e||0,a(u)&&(l=!!u.leading,c="maxWait"in u,c&&(i=Math.max(m(u.maxWait)?u.maxWait:0,e)),f="trailing"in u?!!u.trailing:f),x.cancel=function(){void 0!==o&&function(t){if(F)return cancelAnimationFrame(t);clearTimeout(t)}(o),h=0,n=D=r=o=void 0},x.flush=function(){return void 0===o?s:y(Date.now())},x.pending=function(){return void 0!==o},x}function tt(t,e){return u=>t*(1-u)+e*u}Q=!1;const et=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ut=new RegExp(et.source,"g");const nt=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function rt(t){if(t instanceof Date)return t;if(c(t)){const e=nt.exec(t);if(!e)return new Date(NaN);if(!e[8])return new Date(+e[1],+(e[2]||1)-1,+e[3]||1,+e[4]||0,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0);let u=+e[4]||0;return"Z"!==e[8].toUpperCase()&&(u-=+e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,u,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0))}return o(t)?new Date(NaN):new Date(Math.round(t))}class it{}const st=1e-12,ot=Math.PI,Dt=ot/2,at=2*ot,ht=2*Math.PI,lt=Math.abs,ct=Math.atan2,ft=Math.cos,Ft=Math.max,dt=Math.min,gt=Math.sin,mt=Math.sqrt,Ct=Math.pow;function pt(t,e,u){const n=u.x-e.x,r=u.y-e.y,i=t.x-e.x,s=t.y-e.y;return Math.abs(n*s-i*r)/Math.sqrt(n*n+r*r)}function yt(t,e){return t[0]*e[1]-t[1]*e[0]}function xt(t,e){return t.x*e.y-t.y*e.x}function Et(t,e){let u=0;for(let n=0;n<t.length;++n)u+=t[n]*e[n];return u}function Mt(t,e){return lt(t[0]-e[0])+lt(t[1]-e[1])<st}function Bt(t,e=10){return Math.round(t*e)/e}function bt(t){const e=t.toString().split(/[eE]/),u=(e[0].split(".")[1]||"").length-(+e[1]||0);return u>0?u:0}class vt{constructor(t=0,e=0,u,n){this.x=0,this.y=0,this.x=t,this.y=e,this.x1=u,this.y1=n}clone(){return new vt(this.x,this.y)}copyFrom(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.x=t,this.y=e,this}add(t){return g(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return g(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}multi(t){throw new Error("暂不支持")}div(t){throw new Error("暂不支持")}}class At{static distancePP(t,e){return mt(Ct(t.x-e.x,2)+Ct(t.y-e.y,2))}static distanceNN(t,e,u,n){return mt(Ct(t-u,2)+Ct(e-n,2))}static distancePN(t,e,u){return mt(Ct(e-t.x,2)+Ct(u-t.y,2))}static pointAtPP(t,e,u){return new vt((e.x-t.x)*u+t.x,(e.y-t.y)*u+t.y)}}class wt{constructor(t=0,e=0,u,n){this.r=0,this.theta=0,this.r=t,this.theta=e,this.r1=u,this.theta1=n}clone(){return new wt(this.r,this.theta)}copyFrom(t){return this.r=t.r,this.theta=t.theta,this.r1=t.r1,this.theta1=t.theta1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.r=t,this.theta=e,this}}function St(t){return t*(Math.PI/180)}function Tt(t){return 180*t/Math.PI}const _t=(t=0)=>{if(t<0)for(;t<-at;)t+=at;else if(t>0)for(;t>at;)t-=at;return t},Lt=_t,Nt=(t=0)=>t>360||t<-360?t%360:t,kt=Nt;function It(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function Ut(t,e){const u=Math.abs(e-t);if(u>=2*Math.PI||2*Math.PI-u<1e-6)return[0,Math.PI/2,Math.PI,1.5*Math.PI];const n=It(Math.min(t,e)),r=n+u,i=[n,r];let s=Math.floor(n/Math.PI)*Math.PI/2;for(;s<r;)s>n&&i.push(s),s+=Math.PI/2;return i}function Ht(t,e,u){t[0]=e[0]-u[0],t[1]=e[1]-u[1]}function Ot(t,e,u,n){let r=t[0],i=e[0],s=u[0],o=n[0];return i<r&&([r,i]=[i,r]),o<s&&([o,s]=[s,o]),!(i<s||o<r)&&(r=t[1],i=e[1],s=u[1],o=n[1],i<r&&([r,i]=[i,r]),o<s&&([o,s]=[s,o]),!(i<s||o<r))}var Rt;t.InnerBBox=void 0,(Rt=t.InnerBBox||(t.InnerBBox={}))[Rt.NONE=0]="NONE",Rt[Rt.BBOX1=1]="BBOX1",Rt[Rt.BBOX2=2]="BBOX2";const Pt=(t,e,u)=>{let n=t.x1,r=t.x2,i=t.y1,s=t.y2,o=e.x1,D=e.x2,a=e.y1,h=e.y2;return u&&(n>r&&([n,r]=[r,n]),i>s&&([i,s]=[s,i]),o>D&&([o,D]=[D,o]),a>h&&([a,h]=[h,a])),{x11:n,x12:r,y11:i,y12:s,x21:o,x22:D,y21:a,y22:h}};function zt(t,e,u){if(!e)return!0;if(!u)return t.x>=e.x1&&t.x<=e.x2&&t.y>=e.y1&&t.y<=e.y2;let n=e.x1,r=e.x2,i=e.y1,s=e.y2;return n>r&&([n,r]=[r,n]),i>s&&([i,s]=[s,i]),t.x>=n&&t.x<=r&&t.y>=i&&t.y<=s}function Wt(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function jt({x:t,y:e},u,n={x:0,y:0}){return{x:(t-n.x)*Math.cos(u)-(e-n.y)*Math.sin(u)+n.x,y:(t-n.x)*Math.sin(u)+(e-n.y)*Math.cos(u)+n.y}}function Yt(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function qt(t,e){const u=e?St(t.angle):t.angle,n=Yt(t);return[jt({x:t.x1,y:t.y1},u,n),jt({x:t.x2,y:t.y1},u,n),jt({x:t.x2,y:t.y2},u,n),jt({x:t.x1,y:t.y2},u,n)]}function Vt(t,e,u=!1,n){const r=qt(t,u),i=qt(e,u),s=(t,e)=>[e.x-t.x,e.y-t.y];n&&(n.save(),n.fillStyle="red",n.globalAlpha=.6,r.forEach(((t,e)=>{0===e?n.moveTo(t.x,t.y):n.lineTo(t.x,t.y)})),n.fill(),n.restore(),n.save(),n.fillStyle="green",n.globalAlpha=.6,i.forEach(((t,e)=>{0===e?n.moveTo(t.x,t.y):n.lineTo(t.x,t.y)})),n.fill(),n.restore());const o=Yt(t),D=Yt(e);n&&n.fillRect(o.x,o.y,2,2),n&&n.fillRect(D.x,D.y,2,2);const a=s(o,D),h=s(r[0],r[1]),l=s(r[1],r[2]),c=s(i[0],i[1]),f=s(i[1],i[2]),F=u?St(t.angle):t.angle;let d=u?St(90-t.angle):t.angle+Dt;const g=u?St(e.angle):e.angle;let m=u?St(90-e.angle):e.angle+Dt;d>ht&&(d-=ht),m>ht&&(m-=ht);const C=(t,e,u,n)=>{const r=[Math.cos(e),Math.sin(e)];return t+(Wt(r,u)+Wt(r,n))/2>Wt(r,a)};return C((t.x2-t.x1)/2,F,c,f)&&C((t.y2-t.y1)/2,d,c,f)&&C((e.x2-e.x1)/2,g,h,l)&&C((e.y2-e.y1)/2,m,h,l)}let Gt,$t,Xt,Zt,Jt,Qt,Kt,te,ee,ue,ne,re;function ie(t,e,u=3,n=!1){let r=t.x1,i=t.x2,s=t.y1,o=t.y2,D=e.x1,a=e.x2,h=e.y1,l=e.y2;if(n){let t;r>i&&(t=r,r=i,i=t),s>o&&(t=s,s=o,o=t),D>a&&(t=D,D=a,a=t),h>l&&(t=h,h=l,l=t)}if(r>=a||i<=D||s>=l||o<=h)return[t,e];const c=(i-r+2*u)*(o-s+2*u),f=(a-D+2*u)*(l-h+2*u),F=Math.min(r,D),d=Math.min(s,h),g=Math.max(i,a),m=Math.max(o,l);return c+f>(g-F)*(m-d)?[{x1:F,x2:g,y1:d,y2:m}]:[t,e]}const se={x:0,y:0},oe={x:0,y:0};function De(t,e,u,n){return pt(t,e,u)<=n/2&&ce(t,e,u)}const ae={x:0,y:0},he={x:0,y:0},le={x:0,y:0};function ce(t,e,u){return ae.x=e.x-t.x,ae.y=e.y-t.y,he.x=u.x-t.x,he.y=u.y-t.y,le.x=e.y-u.y,le.y=u.x-e.x,xt(ae,le)*xt(he,le)<0}class fe{constructor(t){this.canvas=t,t&&(this.ctx=t.getContext("2d"))}setCanvas(t){this.canvas=t,t&&(this.ctx=t.getContext("2d"))}measureText(t){return this.canvas?this.measureTextByCanvas(t):(console.warn("[warn] no canvas, measureText might be not accurate"),this.estimate(t))}measureTextByCanvas(t){return this.ctx?(this.ctx.font=function({fontStyle:t,fontVariant:e,fontWeight:u,fontSize:n,fontFamily:r}){return(t?t+" ":"")+(e?e+" ":"")+(u?u+" ":"")+(n||12)+"px "+(r||"sans-serif")}(t),{width:this.ctx.measureText(t.text).width,height:t.fontSize}):(console.error("[error!!!]measureTextByCanvas can not be called without canvas"),{width:-1,height:t.fontSize})}estimate({text:t,fontSize:e}){let u=0,n=0;for(let e=0;e<t.length;e++)t.charCodeAt(e)<128?u++:n++;return{width:~~(.8*u*e+n*e),height:e}}static getDefaultUtils(t){return fe.instance||(fe.instance=new fe(t)),fe.instance}}const Fe=1e-8;function de(t,e,u,n,r){for(let i=0,s=r[r.length-1];i<r.length;i++){const o=r[i];if(Ot([t,e],[u,n],[o.x,o.y],[s.x,s.y]))return!0;s=o}return!1}function ge(t,e,u){let n=0,r=t[0];if(!r)return!1;for(let i=1;i<t.length;i++){const s=t[i];n+=me(r.x,r.y,s.x,s.y,e,u),r=s}const i=t[0];return Ce(r.x,i.x)&&Ce(r.y,i.y)||(n+=me(r.x,r.y,i.x,i.y,e,u)),0!==n}function me(t,e,u,n,r,i){if(i>e&&i>n||i<e&&i<n)return 0;if(n===e)return 0;const s=(i-e)/(n-e);let o=n<e?1:-1;1!==s&&0!==s||(o=n<e?.5:-.5);const D=s*(u-t)+t;return D===r?1/0:D>r?o:0}function Ce(t,e){return Math.abs(t-e)<Fe}const pe=t=>{if("string"!=typeof t)throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(ye(),"")},ye=({onlyFirst:t=!1}={})=>{const e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")},xe=t=>{let e=t.charCodeAt(0),u=2===t.length?t.charCodeAt(1):0,n=e;return 55296<=e&&e<=56319&&56320<=u&&u<=57343&&(e&=1023,u&=1023,n=e<<10|u,n+=65536),12288===n||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":8361===n||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||172===n||175===n||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":161===n||164===n||167<=n&&n<=168||170===n||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||198===n||208===n||215<=n&&n<=216||222<=n&&n<=225||230===n||232<=n&&n<=234||236<=n&&n<=237||240===n||242<=n&&n<=243||247<=n&&n<=250||252===n||254===n||257===n||273===n||275===n||283===n||294<=n&&n<=295||299===n||305<=n&&n<=307||312===n||319<=n&&n<=322||324===n||328<=n&&n<=331||333===n||338<=n&&n<=339||358<=n&&n<=359||363===n||462===n||464===n||466===n||468===n||470===n||472===n||474===n||476===n||593===n||609===n||708===n||711===n||713<=n&&n<=715||717===n||720===n||728<=n&&n<=731||733===n||735===n||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||1025===n||1040<=n&&n<=1103||1105===n||8208===n||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||8240===n||8242<=n&&n<=8243||8245===n||8251===n||8254===n||8308===n||8319===n||8321<=n&&n<=8324||8364===n||8451===n||8453===n||8457===n||8467===n||8470===n||8481<=n&&n<=8482||8486===n||8491===n||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||8585===n||8592<=n&&n<=8601||8632<=n&&n<=8633||8658===n||8660===n||8679===n||8704===n||8706<=n&&n<=8707||8711<=n&&n<=8712||8715===n||8719===n||8721===n||8725===n||8730===n||8733<=n&&n<=8736||8739===n||8741===n||8743<=n&&n<=8748||8750===n||8756<=n&&n<=8759||8764<=n&&n<=8765||8776===n||8780===n||8786===n||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||8853===n||8857===n||8869===n||8895===n||8978===n||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||9675===n||9678<=n&&n<=9681||9698<=n&&n<=9701||9711===n||9733<=n&&n<=9734||9737===n||9742<=n&&n<=9743||9748<=n&&n<=9749||9756===n||9758===n||9792===n||9794===n||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||9839===n||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||9955===n||9960<=n&&n<=9983||10045===n||10071===n||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||65533===n||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"},Ee=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function Me(t,e={},u){u||(u=1);const{fontStyle:n=e.fontStyle,fontVariant:r=e.fontVariant,fontWeight:i=e.fontWeight,fontSize:s=e.fontSize,fontFamily:o=e.fontFamily}=t;return(n?n+" ":"")+(r?r+" ":"")+(i?i+" ":"")+s*u+"px "+(o||"sans-serif")}class Be{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=t,this._userSpec=null!=e?e:{},this.textSpec=this._initSpec(),D(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=D(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(o(this._canvas)&&(D(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),o(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&D(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),o(this._context)&&D(this._canvas)){const t=this._canvas.getContext("2d");D(t)&&(t.save(),t.font=Me(this.textSpec),this._contextSaved=!0,this._context=t)}return!o(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,u;const{defaultFontParams:n={}}=this._option,{fontStyle:r=n.fontStyle,fontVariant:i=n.fontVariant,fontWeight:s=(null!==(t=n.fontWeight)&&void 0!==t?t:"normal"),fontSize:o=(null!==(e=n.fontSize)&&void 0!==e?e:12),fontFamily:D=(null!==(u=n.fontFamily)&&void 0!==u?u:"sans-serif"),align:a,textAlign:h=(null!=a?a:"center"),baseline:l,textBaseline:f=(null!=l?l:"middle"),ellipsis:F,limit:d}=this._userSpec;let{lineHeight:g=o}=this._userSpec;if(c(g)&&"%"===g[g.length-1]){const t=Number.parseFloat(g.substring(0,g.length-1))/100;g=o*t}return{fontStyle:r,fontVariant:i,fontFamily:D,fontSize:o,fontWeight:s,textAlign:h,textBaseline:f,ellipsis:F,limit:d,lineHeight:g}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){if(o(t))return{width:0,height:0};if(o(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:u,fontWeight:n,textAlign:r,textBaseline:i,ellipsis:s,limit:D,lineHeight:a}=this.textSpec;let h;try{const o=this._option.getTextBounds({text:t,fontFamily:e,fontSize:u,fontWeight:n,textAlign:r,textBaseline:i,ellipsis:!!s,maxLineWidth:D||1/0,lineHeight:a});h={width:o.width(),height:o.height()}}catch(e){this._notSupportVRender=!0,h=this.measureWithNaiveCanvas(t)}return h}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const u=this._context.measureText(t),{fontSize:n,lineHeight:r}=this.textSpec;return{width:u.width,height:null!==(e=r)&&void 0!==e?e:n,fontBoundingBoxAscent:u.fontBoundingBoxAscent,fontBoundingBoxDescent:u.fontBoundingBoxDescent}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let u=0;u<t.length;u++){const n=t[u];let r=this._measureSpecialChar(n);o(r)&&Be.NUMBERS_CHAR_SET.includes(n)&&(r=this._measureNumberChar()),o(r)&&["F","W"].includes(xe(n))&&(r=this._measureFullSizeChar()),o(r)&&(r=this._measureLetterChar()),e.width+=r.width,e.height=Math.max(e.height,r.height),!o(r.fontBoundingBoxAscent)&&(e.fontBoundingBoxAscent=r.fontBoundingBoxAscent),!o(r.fontBoundingBoxDescent)&&(e.fontBoundingBoxDescent=r.fontBoundingBoxDescent)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){var e;const u={width:0,height:0},{fontSize:n,lineHeight:r}=this.textSpec;for(let e=0;e<t.length;e++){const r=t[e],i=["F","W"].includes(xe(r))?1:.53;u.width+=i*n}return u.height=null!==(e=r)&&void 0!==e?e:n,u}_measureReduce(t,e){var u;const{fontSize:n,lineHeight:r}=this.textSpec,i={width:0,height:0};if(o(t))return i;if(f(t)){const s=t.filter(D).map((t=>t.toString()));return 0===s.length?i:1===s.length?e(s[0]):{width:s.reduce(((t,u)=>Math.max(t,e(u).width)),0),height:s.length*((null!==(u=r)&&void 0!==u?u:n)+1)+1}}return e(t.toString())}_measureNumberChar(){if(o(this._numberCharSize)){const t=this._standardMethod(Be.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/Be.NUMBERS_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._numberCharSize}_measureFullSizeChar(){return o(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(Be.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(o(this._letterCharSize)){const t=this._standardMethod(Be.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/Be.ALPHABET_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._letterCharSize}_measureSpecialChar(t){return D(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){D(this._canvas)&&(this._canvas=null),D(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}Be.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Be.NUMBERS_CHAR_SET="0123456789",Be.FULL_SIZE_CHAR="字";function be(t,e,u){const{x1:n,y1:r,x2:i,y2:s}=e;return u.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(u.e,u.f),e):(t.clear(),t.add(u.a*n+u.c*r+u.e,u.b*n+u.d*r+u.f),t.add(u.a*i+u.c*r+u.e,u.b*i+u.d*r+u.f),t.add(u.a*i+u.c*s+u.e,u.b*i+u.d*s+u.f),t.add(u.a*n+u.c*s+u.e,u.b*n+u.d*s+u.f),e)}class ve{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new ve(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(t=0,e=0,u=0,n=0){return this.x1=t,this.y1=e,this.x2=u,this.y2=n,this}set(t=0,e=0,u=0,n=0){return u<t?(this.x2=t,this.x1=u):(this.x1=t,this.x2=u),n<e?(this.y2=e,this.y1=n):(this.y1=e,this.y2=n),this}add(t=0,e=0){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(t=0){return f(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(t=0,e=0){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(t=0,e=0,u=0){const n=this.rotatedPoints(t,e,u);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])}scale(t=0,e=0,u=0,n=0){const r=this.scalePoints(t,e,u,n);return this.clear().add(r[0],r[1]).add(r[2],r[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(t=0,e=0){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(t=0){return this.x1*=t,this.x2*=t,this}scaleY(t=0){return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return be(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,u){const{x1:n,y1:r,x2:i,y2:s}=this,o=Math.cos(t),D=Math.sin(t),a=e-e*o+u*D,h=u-e*D-u*o;return[o*n-D*r+a,D*n+o*r+h,o*n-D*s+a,D*n+o*s+h,o*i-D*r+a,D*i+o*r+h,o*i-D*s+a,D*i+o*s+h]}scalePoints(t,e,u,n){const{x1:r,y1:i,x2:s,y2:o}=this;return[t*r+(1-t)*u,e*i+(1-e)*n,t*s+(1-t)*u,e*o+(1-e)*n]}}class Ae{constructor(t=1,e=0,u=0,n=1,r=0,i=0){this.a=t,this.b=e,this.c=u,this.d=n,this.e=r,this.f=i}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,u,n,r,i){return!(this.e!==r||this.f!==i||this.a!==t||this.d!==n||this.b!==e||this.c!==u)}setValue(t,e,u,n,r,i){return this.a=t,this.b=e,this.c=u,this.d=n,this.e=r,this.f=i,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,u=this.c,n=this.d,r=this.e,i=this.f,s=new Ae,o=t*n-e*u;return s.a=n/o,s.b=-e/o,s.c=-u/o,s.d=t/o,s.e=(u*i-n*r)/o,s.f=-(t*i-e*r)/o,s}rotate(t){const e=Math.cos(t),u=Math.sin(t),n=this.a*e+this.c*u,r=this.b*e+this.d*u,i=this.a*-u+this.c*e,s=this.b*-u+this.d*e;return this.a=n,this.b=r,this.c=i,this.d=s,this}rotateByCenter(t,e,u){const n=Math.cos(t),r=Math.sin(t),i=(1-n)*e+r*u,s=(1-n)*u-r*e,o=n*this.a-r*this.b,D=r*this.a+n*this.b,a=n*this.c-r*this.d,h=r*this.c+n*this.d,l=n*this.e-r*this.f+i,c=r*this.e+n*this.f+s;return this.a=o,this.b=D,this.c=a,this.d=h,this.e=l,this.f=c,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,u,n,r,i){return this.multiply(t,e,u,n,r,i),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:u,d:n,e:r,f:i}=this;return this.a=e,this.b=t,this.c=n,this.d=u,this.e=i,this.f=r,this}multiply(t,e,u,n,r,i){const s=this.a,o=this.b,D=this.c,a=this.d,h=s*t+D*e,l=o*t+a*e,c=s*u+D*n,f=o*u+a*n,F=s*r+D*i+this.e,d=o*r+a*i+this.f;return this.a=h,this.b=l,this.c=c,this.d=f,this.e=F,this.f=d,this}interpolate(t,e){const u=new Ae;return u.a=this.a+(t.a-this.a)*e,u.b=this.b+(t.b-this.b)*e,u.c=this.c+(t.c-this.c)*e,u.d=this.d+(t.d-this.d)*e,u.e=this.e+(t.e-this.e)*e,u.f=this.f+(t.f-this.f)*e,u}transformPoint(t,e){const{a:u,b:n,c:r,d:i,e:s,f:o}=this,D=u*i-n*r,a=i/D,h=-n/D,l=-r/D,c=u/D,f=(r*o-i*s)/D,F=-(u*o-n*s)/D,{x:d,y:g}=t;e.x=d*a+g*l+f,e.y=d*h+g*c+F}onlyTranslate(t=1){return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new Ae(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,u=this.c,n=this.d,r=t*n-e*u,i={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const s=Math.sqrt(t*t+e*e);i.rotateDeg=e>0?Math.acos(t/s):-Math.acos(t/s),i.scaleX=s,i.scaleY=r/s,i.skewX=(t*u+e*n)/r,i.skewY=0}else if(0!==u||0!==n){const s=Math.sqrt(u*u+n*n);i.rotateDeg=Math.PI/2-(n>0?Math.acos(-u/s):-Math.acos(u/s)),i.scaleX=r/s,i.scaleY=s,i.skewX=0,i.skewY=(t*u+e*n)/r}return i.rotateDeg=Tt(i.rotateDeg),i}}function we(t,e,u){e/=100,u/=100;const n=(1-Math.abs(2*u-1))*e,r=n*(1-Math.abs(t/60%2-1)),i=u-n/2;let s=0,o=0,D=0;return 0<=t&&t<60?(s=n,o=r,D=0):60<=t&&t<120?(s=r,o=n,D=0):120<=t&&t<180?(s=0,o=n,D=r):180<=t&&t<240?(s=0,o=r,D=n):240<=t&&t<300?(s=r,o=0,D=n):300<=t&&t<360&&(s=n,o=0,D=r),s=Math.round(255*(s+i)),o=Math.round(255*(o+i)),D=Math.round(255*(D+i)),{r:s,g:o,b:D}}function Se(t,e,u){t/=255,e/=255,u/=255;const n=Math.min(t,e,u),r=Math.max(t,e,u),i=r-n;let s=0,o=0,D=0;return s=0===i?0:r===t?(e-u)/i%6:r===e?(u-t)/i+2:(t-e)/i+4,s=Math.round(60*s),s<0&&(s+=360),D=(r+n)/2,o=0===i?0:i/(1-Math.abs(2*D-1)),o=+(100*o).toFixed(1),D=+(100*D).toFixed(1),{h:s,s:o,l:D}}const Te=/^#([0-9a-f]{3,8})$/,_e={transparent:4294967040},Le={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Ne(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function ke(t){return g(t)?new Re(t>>16,t>>8&255,255&t,1):f(t)?new Re(t[0],t[1],t[2]):new Re(255,255,255)}function Ie(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Ue(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const He=(t,e)=>{const u=Te.exec(t);if(e||u){const t=parseInt(u[1],16),e=u[1].length;return 3===e?new Re((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?ke(t):8===e?new Re(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class Oe{static Brighter(t,e=1){return 1===e?t:new Oe(t).brighter(e).toRGBA()}static SetOpacity(t,e=1){return 1===e?t:new Oe(t).setOpacity(e).toRGBA()}static getColorBrightness(t,e="hsl"){const u=t instanceof Oe?t:new Oe(t);switch(e){case"hsv":default:return u.getHSVBrightness();case"hsl":return u.getHSLBrightness();case"lum":return u.getLuminance();case"lum2":return u.getLuminance2();case"lum3":return u.getLuminance3()}}static parseColorString(t){if(D(_e[t]))return function(t){return g(t)?new Re(t>>>24,t>>>16&255,t>>>8&255,255&t):f(t)?new Re(t[0],t[1],t[2],t[3]):new Re(255,255,255,1)}(_e[t]);if(D(Le[t]))return ke(Le[t]);const e=`${t}`.trim().toLowerCase(),u=He(e);if(void 0!==u)return u;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new Re(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const t=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),u=we(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new Re(u.r,u.g,u.b,parseFloat(t[3]))}}constructor(t){const e=Oe.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new Re(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:u,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(u*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t))),this}add(t){const{r:e,g:u,b:n}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,u+t.color.g),this.color.b+=Math.min(255,n+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:u,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(u*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,u){const n=this.color.opacity,r=Se(this.color.r,this.color.g,this.color.b),i=we(o(t)?r.h:J(t,0,360),o(e)?r.s:e>=0&&e<=1?100*e:e,o(u)?r.l:u<=1&&u>=0?100*u:u);return this.color=new Re(i.r,i.g,i.b,n),this}setRGB(t,e,u){return!o(t)&&(this.color.r=t),!o(e)&&(this.color.g=e),!o(u)&&(this.color.b=u),this}setHex(t){const e=`${t}`.trim().toLowerCase(),u=He(e,!0);return null!=u?u:this}setColorName(t){const e=Le[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(t=1){return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}clone(){return new Oe(this.color.toString())}copyGammaToLinear(t,e=2){return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t,e=2){const u=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,u),this.color.g=Math.pow(t.color.g,u),this.color.b=Math.pow(t.color.b,u),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=Ie(t.color.r),this.color.g=Ie(t.color.g),this.color.b=Ie(t.color.b),this}copyLinearToSRGB(t){return this.color.r=Ue(t.color.r),this.color.g=Ue(t.color.g),this.color.b=Ue(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class Re{constructor(t,e,u,n){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+u)?255:Math.max(0,Math.min(255,+u)),D(n)?this.opacity=isNaN(+n)?1:Math.max(0,Math.min(1,+n)):this.opacity=1}formatHex(){return`#${Ne(this.r)+Ne(this.g)+Ne(this.b)+(1===this.opacity?"":Ne(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:u,l:n}=Se(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${u}%,${n}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}function Pe(t){let e="",u="",n="";const r="#"===t[0]?1:0;for(let i=r;i<t.length;i++)"#"!==t[i]&&(i<r+2?e+=t[i]:i<r+4?u+=t[i]:i<r+6&&(n+=t[i]));return[parseInt(e,16),parseInt(u,16),parseInt(n,16)]}function ze(t,e,u){return Number((1<<24)+(t<<16)+(e<<8)+u).toString(16).slice(1)}function We(t,e){const u=t.r,n=e.r,r=t.g,i=e.g,s=t.b,o=e.b,D=t.opacity,a=e.opacity;return t=>{const e=Math.round(u*(1-t)+n*t),h=Math.round(r*(1-t)+i*t),l=Math.round(s*(1-t)+o*t);return new Re(e,h,l,D*(1-t)+a*t)}}var je=Object.freeze({__proto__:null,Color:Oe,DEFAULT_COLORS:Le,RGB:Re,hexToRgb:Pe,hslToRgb:we,interpolateRgb:We,rgbToHex:ze,rgbToHsl:Se});function Ye(t){return t?"getUTCFullYear":"getFullYear"}function qe(t){return t?"getUTCMonth":"getMonth"}function Ve(t){return t?"getUTCDate":"getDate"}function Ge(t){return t?"getUTCHours":"getHours"}function $e(t){return t?"getUTCMinutes":"getMinutes"}function Xe(t){return t?"getUTCSeconds":"getSeconds"}function Ze(t){return t?"getUTCMilliseconds":"getMilliseconds"}const Je=1e3,Qe=6e4,Ke=36e5,tu=24*Ke,eu=t=>(t.setMonth(0,1),t.setHours(0,0,0,0),t),uu=(t,e)=>(t.setFullYear(t.getFullYear()+e),t),nu=(t,e)=>e.getFullYear()-t.getFullYear(),ru=t=>t.getFullYear(),iu=t=>(t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0),t),su=(t,e)=>(t.setUTCFullYear(t.getUTCFullYear()+e),t),ou=(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),Du=t=>t.getUTCFullYear(),au=t=>(t.setDate(1),t.setHours(0,0,0,0),t),hu=(t,e)=>(t.setMonth(t.getMonth()+e),t),lu=(t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear()),cu=t=>t.getMonth(),fu=t=>(t.setUTCDate(1),t.setUTCHours(0,0,0,0),t),Fu=(t,e)=>(t.setUTCMonth(t.getUTCMonth()+e),t),du=(t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear()),gu=t=>t.getUTCMonth(),mu=t=>(t.setHours(0,0,0,0),t),Cu=(t,e)=>(t.setDate(t.getDate()+e),t),pu=(t,e)=>(+e-+t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Qe)/tu,yu=t=>t.getDate()-1,xu=t=>(t.setUTCHours(0,0,0,0),t),Eu=(t,e)=>(t.setUTCDate(t.getUTCDate()+e),t),Mu=(t,e)=>(+e-+t)/tu,Bu=t=>t.getUTCDate()-1,bu=t=>(t.setTime(+t-t.getMilliseconds()-t.getSeconds()*Je-t.getMinutes()*Qe),t),vu=(t,e)=>(t.setHours(t.getHours()+e),t),Au=(t,e)=>(+e-+t)/Ke,wu=t=>t.getHours(),Su=t=>(t.setTime(+t-t.getUTCMilliseconds()-t.getUTCSeconds()*Je-t.getUTCMinutes()*Qe),t),Tu=(t,e)=>(t.setUTCHours(t.getUTCHours()+e),t),_u=t=>t.getUTCHours(),Lu=t=>(t.setTime(+t-t.getMilliseconds()-t.getSeconds()*Je),t),Nu=(t,e)=>(t.setMinutes(t.getMinutes()+e),t),ku=(t,e)=>(+e-+t)/Qe,Iu=t=>t.getMinutes(),Uu=t=>(t.setTime(+t-t.getUTCMilliseconds()-t.getUTCSeconds()*Je),t),Hu=(t,e)=>(t.setUTCMinutes(t.getUTCMinutes()+e),t),Ou=t=>t.getUTCMinutes(),Ru=t=>(t.setTime(+t-t.getMilliseconds()),t),Pu=(t,e)=>(t.setSeconds(t.getSeconds()+e),t),zu=(t,e)=>(+e-+t)/Je,Wu=t=>t.getSeconds(),ju=t=>(t.setTime(+t-t.getUTCMilliseconds()),t),Yu=(t,e)=>(t.setUTCSeconds(t.getUTCSeconds()+e),t),qu=t=>t.getUTCSeconds(),Vu=t=>t,Gu=(t,e)=>(t.setTime(+t+e),t),$u=(t,e)=>+e-+t,Xu=(t,e)=>u=>{const n=new Date(+u-1);return e(n,1),t(n),n},Zu=(t,e)=>(u,n)=>{const r=new Date,i=new Date;return r.setTime(+u),i.setTime(+n),t(r),t(i),Math.floor(e(r,i))};function Ju(t){const{x:e,y:u}=t.getBoundingClientRect();return{x:e,y:u}}const Qu=t=>t.getBoundingClientRect().width/t.offsetWidth,Ku=t=>t.getBoundingClientRect().height/t.offsetHeight;var tn=6371008.8,en={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*tn,kilometers:6371.0088,kilometres:6371.0088,meters:tn,metres:tn,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:tn/1852,radians:1,yards:6967335.223679999};const un=1e-10;function nn(t,e){for(let u=0;u<e.length;++u)if(At.distancePP(t,e[u])>e[u].radius+un)return!1;return!0}function rn(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function sn(t,e){const u=At.distancePP(t,e),n=t.radius,r=e.radius;if(u>=n+r||u<=Math.abs(n-r))return[];const i=(n*n-r*r+u*u)/(2*u),s=Math.sqrt(n*n-i*i),o=t.x+i*(e.x-t.x)/u,D=t.y+i*(e.y-t.y)/u,a=-(e.y-t.y)*(s/u),h=-(e.x-t.x)*(s/u);return[{x:o+a,y:D-h},{x:o-a,y:D+h}]}function on(t){const e={x:0,y:0};for(let u=0;u<t.length;++u)e.x+=t[u].x,e.y+=t[u].y;return e.x/=t.length,e.y/=t.length,e}class Dn{static getInstance(){return Dn.instance||(Dn.instance=new Dn),Dn.instance}constructor(){this.locale_shortWeekdays=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],this.locale_periods=["AM","PM"],this.locale_weekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],this.locale_shortMonths=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],this.numberRe=/^\s*\d+/,this.pads={"-":"",_:" ",0:"0"},this.requoteRe=/[\\^$*+?|[\]().{}]/g,this.locale_months=["January","February","March","April","May","June","July","August","September","October","November","December"],this.formatShortWeekday=t=>this.locale_shortWeekdays[t.getDay()],this.formatWeekday=t=>this.locale_weekdays[t.getDay()],this.formatShortMonth=t=>this.locale_shortMonths[t.getMonth()],this.formatMonth=t=>this.locale_months[t.getMonth()],this.formatDayOfMonth=(t,e)=>this.pad(t.getDate(),e,2),this.formatHour24=(t,e)=>this.pad(t.getHours(),e,2),this.formatHour12=(t,e)=>this.pad(t.getHours()%12||12,e,2),this.formatMilliseconds=(t,e)=>this.pad(t.getMilliseconds(),e,3),this.formatMonthNumber=(t,e)=>this.pad(t.getMonth()+1,e,2),this.formatMinutes=(t,e)=>this.pad(t.getMinutes(),e,2),this.formatPeriod=t=>this.locale_periods[+(t.getHours()>=12)],this.formatSeconds=(t,e)=>this.pad(t.getSeconds(),e,2),this.formatFullYear=(t,e)=>this.pad(t.getFullYear()%1e4,e,4),this.formatUTCShortWeekday=t=>this.locale_shortWeekdays[t.getUTCDay()],this.formatUTCWeekday=t=>this.locale_weekdays[t.getUTCDay()],this.formatUTCShortMonth=t=>this.locale_shortMonths[t.getUTCMonth()],this.formatUTCMonth=t=>this.locale_months[t.getUTCMonth()],this.formatUTCDayOfMonth=(t,e)=>this.pad(t.getUTCDate(),e,2),this.formatUTCHour24=(t,e)=>this.pad(t.getUTCHours(),e,2),this.formatUTCHour12=(t,e)=>this.pad(t.getUTCHours()%12||12,e,2),this.formatUTCMilliseconds=(t,e)=>this.pad(t.getUTCMilliseconds(),e,3),this.formatUTCMonthNumber=(t,e)=>this.pad(t.getUTCMonth()+1,e,2),this.formatUTCMinutes=(t,e)=>this.pad(t.getUTCMinutes(),e,2),this.formatUTCPeriod=t=>this.locale_periods[+(t.getUTCHours()>=12)],this.formatUTCSeconds=(t,e)=>this.pad(t.getUTCSeconds(),e,2),this.formatUTCFullYear=(t,e)=>this.pad(t.getUTCFullYear()%1e4,e,4),this.formats={a:this.formatShortWeekday,A:this.formatWeekday,b:this.formatShortMonth,B:this.formatMonth,d:this.formatDayOfMonth,e:this.formatDayOfMonth,H:this.formatHour24,I:this.formatHour12,L:this.formatMilliseconds,m:this.formatMonthNumber,M:this.formatMinutes,p:this.formatPeriod,S:this.formatSeconds,Y:this.formatFullYear},this.utcFormats={a:this.formatUTCShortWeekday,A:this.formatUTCWeekday,b:this.formatUTCShortMonth,B:this.formatUTCMonth,d:this.formatUTCDayOfMonth,e:this.formatUTCDayOfMonth,H:this.formatUTCHour24,I:this.formatUTCHour12,L:this.formatUTCMilliseconds,m:this.formatUTCMonthNumber,M:this.formatUTCMinutes,p:this.formatUTCPeriod,S:this.formatUTCSeconds,Y:this.formatUTCFullYear},this.parseShortWeekday=(t,e,u)=>{const n=this.shortWeekdayRe.exec(e.slice(u));return n?(t.w=this.shortWeekdayLookup.get(n[0].toLowerCase()),u+n[0].length):-1},this.parseWeekday=(t,e,u)=>{const n=this.weekdayRe.exec(e.slice(u));return n?(t.w=this.weekdayLookup.get(n[0].toLowerCase()),u+n[0].length):-1},this.parseShortMonth=(t,e,u)=>{const n=this.shortMonthRe.exec(e.slice(u));return n?(t.m=this.shortMonthLookup.get(n[0].toLowerCase()),u+n[0].length):-1},this.parseMonth=(t,e,u)=>{const n=this.monthRe.exec(e.slice(u));return n?(t.m=this.monthLookup.get(n[0].toLowerCase()),u+n[0].length):-1},this.parseDayOfMonth=(t,e,u)=>{const n=this.numberRe.exec(e.slice(u,u+2));return n?(t.d=+n[0],u+n[0].length):-1},this.parseHour24=(t,e,u)=>{const n=this.numberRe.exec(e.slice(u,u+2));return n?(t.H=+n[0],u+n[0].length):-1},this.parseMilliseconds=(t,e,u)=>{const n=this.numberRe.exec(e.slice(u,u+3));return n?(t.L=+n[0],u+n[0].length):-1},this.parseMonthNumber=(t,e,u)=>{const n=this.numberRe.exec(e.slice(u,u+2));return n?(t.m=n-1,u+n[0].length):-1},this.parseMinutes=(t,e,u)=>{const n=this.numberRe.exec(e.slice(u,u+2));return n?(t.M=+n[0],u+n[0].length):-1},this.parsePeriod=(t,e,u)=>{const n=this.periodRe.exec(e.slice(u));return n?(t.p=this.periodLookup.get(n[0].toLowerCase()),u+n[0].length):-1},this.parseSeconds=(t,e,u)=>{const n=this.numberRe.exec(e.slice(u,u+2));return n?(t.S=+n[0],u+n[0].length):-1},this.parseFullYear=(t,e,u)=>{const n=this.numberRe.exec(e.slice(u,u+4));return n?(t.y=+n[0],u+n[0].length):-1},this.parses={a:this.parseShortWeekday,A:this.parseWeekday,b:this.parseShortMonth,B:this.parseMonth,d:this.parseDayOfMonth,e:this.parseDayOfMonth,H:this.parseHour24,I:this.parseHour24,L:this.parseMilliseconds,m:this.parseMonthNumber,M:this.parseMinutes,p:this.parsePeriod,S:this.parseSeconds,Y:this.parseFullYear},this.timeFormat=(t,e)=>this.newFormat(t,this.formats)(new Date(this.getFullTimeStamp(e))),this.timeUTCFormat=(t,e)=>this.newFormat(t,this.utcFormats)(new Date(this.getFullTimeStamp(e))),this.timeParse=(t,e)=>this.newParse(t,!1)(e+""),this.requoteF=this.requote.bind(this),this.periodRe=this.formatRe(this.locale_periods),this.periodLookup=this.formatLookup(this.locale_periods),this.weekdayRe=this.formatRe(this.locale_weekdays),this.weekdayLookup=this.formatLookup(this.locale_weekdays),this.shortWeekdayRe=this.formatRe(this.locale_shortWeekdays),this.shortWeekdayLookup=this.formatLookup(this.locale_shortWeekdays),this.monthRe=this.formatRe(this.locale_months),this.monthLookup=this.formatLookup(this.locale_months),this.shortMonthRe=this.formatRe(this.locale_shortMonths),this.shortMonthLookup=this.formatLookup(this.locale_shortMonths)}requote(t){return t.replace(this.requoteRe,"\\$&")}localDate(t){if(0<=t.y&&t.y<100){const e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}utcDate(t){if(0<=t.y&&t.y<100){const e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}newDate(t,e,u){return{y:t,m:e,d:u,H:0,M:0,S:0,L:0}}formatRe(t){return new RegExp("^(?:"+t.map(this.requoteF).join("|")+")","i")}formatLookup(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}pad(t,e,u){const n=t<0?"-":"",r=(n?-t:t)+"",i=r.length;return n+(i<u?new Array(u-i+1).join(e)+r:r)}parseSpecifier(t,e,u,n){let r=0;const i=e.length,s=u.length;let o,D;for(;r<i;){if(n>=s)return-1;if(o=e.charCodeAt(r++),37===o){if(o=e.charAt(r++),D=this.parses[o in this.pads?e.charAt(r++):o],!D||(n=D(t,u,n))<0)return-1}else if(o!==u.charCodeAt(n++))return-1}return n}newParse(t,e){const u=this;return function(n){const r=u.newDate(1900,void 0,1);return u.parseSpecifier(r,t,n+="",0)!==n.length?null:"Q"in r?new Date(r.Q):"s"in r?new Date(1e3*r.s+("L"in r?r.L:0)):(e&&!("Z"in r)&&(r.Z=0),"p"in r&&(r.H=r.H%12+12*r.p),void 0===r.m&&(r.m="q"in r?r.q:0),"Z"in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,u.utcDate(r)):u.localDate(r))}}newFormat(t,e){const u=this;return function(n){const r=[];let i=-1,s=0;const o=t.length;let D,a,h;for(n instanceof Date||(n=new Date(+n));++i<o;)37===t.charCodeAt(i)&&(r.push(t.slice(s,i)),(a=u.pads[D=t.charAt(++i)])?D=t.charAt(++i):a="e"===D?" ":"0",h=e[D],D=h(n,a),r.push(D),s=i+1);return r.push(t.slice(s,i)),r.join("")}}getFullTimeStamp(t){const e=parseInt(t+"",10);return 10===String(e).length?1e3*e:e}}function an(t,e){const u=e?t.toExponential(e-1):t.toExponential(),n=u.indexOf("e");if(n<0)return null;const r=u.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+u.slice(n+1)]}let hn;function ln(t,e){const u=an(t,e);if(!u)return t+"";const n=u[0],r=u[1];return r<0?"0."+new Array(-r).join("0")+n:n.length>r+1?n.slice(0,r+1)+"."+n.slice(r+1):n+new Array(r-n.length+2).join("0")}class cn{constructor(t={}){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}toString(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type}}const fn=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Fn(t){let e;if(e=fn.exec(t))return new cn({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]});P.getInstance().error("invalid format: "+t)}const dn=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];class gn{constructor(){var t,e;this.locale={thousands:",",grouping:[3],currency:["$",""]},this.group=void 0===this.locale.grouping||void 0===this.locale.thousands?t=>t:(t=[...this.locale.grouping].map(Number),e=`${this.locale.thousands}`,function(u,n){let r=u.length;const i=[];let s=0,o=t[0],D=0;for(;r>0&&o>0&&(D+o+1>n&&(o=Math.max(1,n-D)),i.push(u.substring(r-=o,r+o)),!((D+=o+1)>n));)o=t[s=(s+1)%t.length];return i.reverse().join(e)}),this.currencyPrefix=void 0===this.locale.currency?"":this.locale.currency[0]+"",this.currencySuffix=void 0===this.locale.currency?"":this.locale.currency[1]+"",this.decimal=void 0===this.locale.decimal?".":this.locale.decimal+"",this.numerals=void 0===this.locale.numerals?t=>t:pn([...this.locale.numerals].map(String)),this.percent=void 0===this.locale.percent?"%":this.locale.percent+"",this.minus=void 0===this.locale.minus?"−":this.locale.minus+"",this.nan=void 0===this.locale.nan?"NaN":this.locale.nan+"",this.formatter=t=>this.newFormat(t),this.format=(t,e)=>this.formatter(t)(e),this.formatPrefix=(t,e)=>this._formatPrefix(t,e)}static getInstance(){return gn.instance||(gn.instance=new gn),gn.instance}newFormat(t){const e=Fn(t);let u=e.fill,n=e.align;const r=e.sign,i=e.symbol;let s=e.zero;const o=e.width;let D=e.comma,a=e.precision,h=e.trim,l=e.type;"n"===l?(D=!0,l="g"):mn[l]||(void 0===a&&(a=12),h=!0,l="g"),(s||"0"===u&&"="===n)&&(s=!0,u="0",n="=");const c="$"===i?this.currencyPrefix:"#"===i&&/[boxX]/.test(l)?"0"+l.toLowerCase():"",f="$"===i?this.currencySuffix:/[%p]/.test(l)?this.percent:"",F=mn[l],d=/[defgprstz%]/.test(l);a=void 0===a?6:/[gprs]/.test(l)?Math.max(1,Math.min(21,a)):Math.max(0,Math.min(20,a));const{nan:g,minus:m,decimal:C,group:p,numerals:y}=this;function x(t){let e,i,x,E=c,M=f,B=t;if("c"===l)M=F(B)+M,B="";else{B=+B;let t=B<0||1/B<0;if(B=isNaN(B)?g:F(Math.abs(B),a),h&&(B=function(t){const e=t.length;let u,n=-1;t:for(let r=1;r<e;++r)switch(t[r]){case".":n=u=r;break;case"0":0===n&&(n=r),u=r;break;default:if(!+t[r])break t;n>0&&(n=0)}return n>0?t.slice(0,n)+t.slice(u+1):t}(B)),t&&0==+B&&"+"!==r&&(t=!1),E=(t?"("===r?r:m:"-"===r||"("===r?"":r)+E,M=("s"===l?dn[8+hn/3]:"")+M+(t&&"("===r?")":""),d)for(e=-1,i=B.length;++e<i;)if(x=B.charCodeAt(e),48>x||x>57){M=(46===x?C+B.slice(e+1):B.slice(e))+M,B=B.slice(0,e);break}}D&&!s&&(B=p(B,1/0));let b=E.length+B.length+M.length,v=b<o?new Array(o-b+1).join(u):"";switch(D&&s&&(B=p(v+B,v.length?o-M.length:1/0),v=""),n){case"<":B=E+B+M+v;break;case"=":B=E+v+B+M;break;case"^":B=v.slice(0,b=v.length>>1)+E+B+M+v.slice(b);break;default:B=v+E+B+M}return y(B)}return x.toString=function(){return t+""},x}_formatPrefix(t,e){const u=Fn(t);u.type="f";const n=this.newFormat(u.toString()),r=3*Math.max(-8,Math.min(8,Math.floor(Cn(e)/3))),i=Math.pow(10,-r),s=dn[8+r/3];return function(t){return n(i*t)+s}}}const mn={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},f:(t,e)=>t.toFixed(e),e:(t,e)=>t.toExponential(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>ln(100*t,e),r:ln,s:function(t,e){const u=an(t,e);if(!u)return t+"";const n=u[0],r=u[1],i=r-(hn=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,s=n.length;return i===s?n:i>s?n+new Array(i-s+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+an(t,Math.max(0,e+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16),t:(t,e)=>Number.isInteger(t)?t.toFixed(2):Math.floor(t*Math.pow(10,e))/Math.pow(10,e)+"",z:(t,e)=>t%1==0?t+"":t.toFixed(e)};function Cn(t){const e=an(Math.abs(t));return e?e[1]:NaN}function pn(t){return function(e){return e.replace(/[0-9]/g,(e=>t[+e]))}}function yn(t){const e=new Array(t);for(let u=0;u<t;++u)e[u]=0;return e}function xn(t){return Math.sqrt(Et(t,t))}function En(t,e,u){for(let n=0;n<e.length;++n)t[n]=e[n]*u}function Mn(t,e,u,n,r){for(let i=0;i<t.length;++i)t[i]=e*u[i]+n*r[i]}function Bn(t,e,u,n,r,i,s){const o=u.fx,D=Et(u.fxprime,e);let a=o,h=o,l=D,c=0;function f(h,c,f){for(let F=0;F<16;++F)if(r=(h+c)/2,Mn(n.x,1,u.x,r,e),a=n.fx=t(n.x,n.fxprime),l=Et(n.fxprime,e),a>o+i*r*D||a>=f)c=r;else{if(Math.abs(l)<=-s*D)return r;l*(c-h)>=0&&(c=h),h=r,f=a}return 0}r=r||1,i=i||1e-6,s=s||.1;for(let F=0;F<10;++F){if(Mn(n.x,1,u.x,r,e),a=n.fx=t(n.x,n.fxprime),l=Et(n.fxprime,e),a>o+i*r*D||F&&a>=h)return f(c,r,h);if(Math.abs(l)<=-s*D)return r;if(l>=0)return f(r,c,a);h=a,c=r,r*=2}return r}t.AABBBounds=class extends ve{},t.Bounds=ve,t.Color=Oe,t.ColorUtil=je,t.DAY=tu,t.DEFAULT_COLORS=Le,t.EventEmitter=n,t.FormatSpecifier=cn,t.GraphicUtil=fe,t.HOUR=Ke,t.HashTable=class{constructor(){this.items={},this.itemList=[]}get type(){return"xhHashTable"}set(t,e){const u=new it;u.key=t,u.value=e;let n=this.itemList.length;return this.has(t)&&(n=this.items[t].index),u.index=n,this.itemList[n]=u,this.items[t]=u,u}clear(){this.items={},this.itemList=[]}del(t){if(this.has(t)){const e=this.items[t].index;e>-1&&this.itemList.splice(e,1),delete this.items[t],this.resetIndex()}}delFrom(t){for(let e=t+1;e<this.count();e++){const t=this.itemList[e].key;delete this.items[t]}this.itemList.splice(t+1,this.count()-t),this.resetIndex()}resetIndex(){this.foreachHashv(((t,e)=>{const u=this.itemList.indexOf(e);this.items[t].index=u}))}has(t){return t in this.items}get(t){return this.has(t)?this.items[t].value:null}count(){return this.itemList.length}all(){return this.itemList.map((t=>t.value))}first(){return this.itemList[0].value}last(){return this.itemList[this.itemList.length-1].value}getByIndex(t){return this.itemList[t].value}getKeyByIndex(t){return this.itemList[t].key}foreach(t){for(const e in this.items){if(!1===t(e,this.items[e].value))return!1}return!0}foreachHashv(t){for(const e in this.items){if(!1===t(e,this.items[e]))return!1}return!0}hasValue(t){for(const e in this.items)if(this.items[e].value===t)return!0;return!1}indexOf(t){return this.has(t)?this.items[t].index:-1}insertAt(t,e,u){const n=new it;n.index=t,n.key=u,n.value=e,this.itemList.splice(t,0,n),this.items[u]=n,this.resetIndex()}sort(t){return this.itemList.sort(((e,u)=>t(e.value,u.value)))}toArray(){return this.itemList.slice(0,this.itemList.length).map((t=>t.value))}push(t){t.foreach(((t,e)=>{this.set(t,e)}))}mapKey(){const t=[];for(const e in this.items)t.push(e);return t}toImmutableMap(){}},t.HashValue=it,t.LRU=class{constructor(){this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}clearCache(t,e){const{CLEAN_THRESHOLD:u=this.CLEAN_THRESHOLD,L_TIME:n=this.L_TIME,R_COUNT:r=this.R_COUNT}=e;if(t.size<u)return 0;let i=0;const s=e=>{i++,t.delete(e)},o=Date.now();return t.forEach(((t,e)=>{if(t.timestamp.length<r)return s(e);let u=0;for(;o-t.timestamp[t.timestamp.length-1-u]<n&&(u++,!(u>=r)););if(u<r)return s(e);for(;o-t.timestamp[0]>n;)t.timestamp.shift()})),i}addLimitedTimestamp(t,e,u){const{R_TIMESTAMP_MAX_SIZE:n=this.R_TIMESTAMP_MAX_SIZE}=u;t.timestamp.length>n&&t.timestamp.shift(),t.timestamp.push(e)}clearTimeStamp(t,e){const{L_TIME:u=this.L_TIME}=e,n=Date.now();t.forEach((t=>{for(;n-t.timestamp[0]>u;)t.timestamp.shift()}))}clearItemTimestamp(t,e){const{L_TIME:u=this.L_TIME}=e,n=Date.now();for(;n-t.timestamp[0]>u;)t.timestamp.shift()}},t.Logger=P,t.MINUTE=Qe,t.MONTH=26784e5,t.Matrix=Ae,t.NEWTON_ITERATIONS=4,t.NEWTON_MIN_SLOPE=.001,t.NumberUtil=gn,t.OBBBounds=class extends ve{constructor(t,e=0){super(t),t&&(this.angle=e)}intersects(t){return Vt(this,t)}setValue(t=0,e=0,u=0,n=0,r=0){return super.setValue(t,e,u,n),this.angle=r,this}},t.Point=vt,t.PointService=At,t.PolarPoint=wt,t.RGB=Re,t.SECOND=Je,t.SMALL=un,t.SUBDIVISION_MAX_ITERATIONS=10,t.SUBDIVISION_PRECISION=1e-7,t.TextMeasure=Be,t.TimeUtil=Dn,t.YEAR=31536e6,t.abs=lt,t.acos=function(t){return t>1?0:t<-1?ot:Math.acos(t)},t.array=L,t.arrayEqual=function(t,e){if(!f(t)||!f(e))return!1;if(t.length!==e.length)return!1;for(let u=0;u<t.length;u++)if(t[u]!==e[u])return!1;return!0},t.ascending=k,t.asin=function(t){return t>=1?Dt:t<=-1?-Dt:Math.asin(t)},t.atan2=ct,t.baseMerge=E,t.binaryFuzzySearch=(t,e)=>z(0,t.length,(u=>e(t[u]))),t.binaryFuzzySearchInNumberRange=z,t.bisect=function(t,e,u=0,n){for(o(n)&&(n=t.length);u<n;){const r=u+n>>>1;k(t[r],e)>0?n=r:u=r+1}return u},t.calculateAnchorOfArc=(t,e)=>{const{startAngle:u,endAngle:n,innerRadius:r,outerRadius:i}=t;let s=(u+n)/2,o=(r+i)/2;switch(e){case"inner-start":s=u,o=r;break;case"outer-start":s=u,o=i;break;case"inner-end":s=n,o=r;break;case"outer-end":s=n,o=i;break;case"inner-middle":o=r;break;case"outer-middle":o=i}return{angle:s,radius:o}},t.calculateAnchorOfBounds=(t,e)=>{const{x1:u,x2:n,y1:r,y2:i}=t,s=Math.abs(n-u),o=Math.abs(i-r);let D=(u+n)/2,a=(r+i)/2,h=0,l=0;switch(e){case"top":case"inside-top":l=-.5;break;case"bottom":case"inside-bottom":l=.5;break;case"left":case"inside-left":h=-.5;break;case"right":case"inside-right":h=.5;break;case"top-right":h=.5,l=-.5;break;case"top-left":h=-.5,l=-.5;break;case"bottom-right":h=.5,l=.5;break;case"bottom-left":h=-.5,l=.5}return D+=h*s,a+=l*o,{x:D,y:a}},t.calculateMaxRadius=function(t,e,u,n){const{x:r,y:i}=e,s=Ut(u,n),{width:o,height:D}=t,a=[];return s.forEach((t=>{const e=Math.sin(t),u=Math.cos(t);1===e?a.push(D-i):-1===e?a.push(i):1===u?a.push(o-r):-1===u?a.push(r):(e>0?a.push(Math.abs((D-i)/e)):a.push(Math.abs(i/e)),u>0?a.push(Math.abs((o-r)/u)):a.push(Math.abs(r/u)))})),Math.min.apply(null,a)},t.cartesianToPolar=function(t,e={x:0,y:0},u=0,n=2*Math.PI){const{x:r,y:i}=t,{x:s,y:o}=e;let D=r-s,a=i-o;const h=Math.sqrt(D*D+a*a);if(0===h)return{radius:0,angle:0};D/=h,a/=h;let l=Math.atan2(a,D);if(l<u)for(;l<=u;)l+=2*Math.PI;if(l>n)for(;l>=n;)l-=2*Math.PI;return{radius:h,angle:l}},t.circleArea=rn,t.circleCircleIntersection=sn,t.circleOverlap=function(t,e,u){if(u>=t+e)return 0;if(u<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const n=e-(u*u-t*t+e*e)/(2*u);return rn(t,t-(u*u-e*e+t*t)/(2*u))+rn(e,n)},t.clamp=J,t.clampAngleByDegree=kt,t.clampAngleByRadian=Lt,t.clampDegree=Nt,t.clampRadian=_t,t.clampRange=(t,e,u)=>{let[n,r]=t;r<n&&(n=t[1],r=t[0]);const i=r-n;return i>=u-e?[e,u]:(n=Math.min(Math.max(n,e),u-i),[n,n+i])},t.clamper=function(t,e){let u;return t>e&&(u=t,t=e,e=u),u=>Math.max(t,Math.min(e,u))},t.clone=function(t,e=!1,u=0,n=void 0){const r=[],i=[];return void 0===e&&(e=!0),void 0===u&&(u=1/0),function t(u,s){if(null===u)return null;if(0===s)return u;let o;if("object"!=typeof u)return u;if(f(u)?o=[]:C(u)?(o=new RegExp(u.source,function(t){let e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}(u)),u.lastIndex&&(o.lastIndex=u.lastIndex)):o=d(u)?new Date(u.getTime()):void 0===n?Object.create(Object.getPrototypeOf(u)):Object.create(n),e){const t=r.indexOf(u);if(-1!==t)return i[t];r.push(u),i.push(o)}for(const e in u)o[e]=t(u[e],s-1);return o}(t,u)},t.cloneDeep=function t(e,u,n){let r;if(!D(e)||"object"!=typeof e||u&&u(e))return e;const s=f(e),o=e.length;r=s?new Array(o):"object"==typeof e?{}:i(e)||g(e)||c(e)?e:d(e)?new Date(+e):void 0;const a=s?void 0:Object.keys(Object(e));let h=-1;if(r)for(;++h<(a||e).length;){const i=a?a[h]:h,s=e[i];n&&n.includes(i.toString())?r[i]=s:r[i]=t(s,u,n)}return r},t.computeQuadrant=function(t){return(t=It(t))>0&&t<=Math.PI/2?2:t>Math.PI/2&&t<=Math.PI?3:t>Math.PI&&t<=3*Math.PI/2?4:1},t.conjugateGradient=function(t,e,u){let n={x:e.slice(),fx:0,fxprime:e.slice()},r={x:e.slice(),fx:0,fxprime:e.slice()};const i=e.slice();let s,o=1;const D=(u=u||{}).maxIterations||20*e.length;n.fx=t(n.x,n.fxprime);const a=n.fxprime.slice();En(a,n.fxprime,-1);for(let e=0;e<D;++e){if(o=Bn(t,a,n,r,o),u.history&&u.history.push({x:n.x.slice(),fx:n.fx,fxprime:n.fxprime.slice(),alpha:o}),o){Mn(i,1,r.fxprime,-1,n.fxprime);const t=Et(n.fxprime,n.fxprime);Mn(a,Math.max(0,Et(i,r.fxprime)/t),a,-1,r.fxprime),s=n,n=r,r=s}else En(a,n.fxprime,-1);if(xn(n.fxprime)<=1e-5)break}return u.history&&u.history.push({x:n.x.slice(),fx:n.fx,fxprime:n.fxprime.slice(),alpha:o}),n},t.constant=t=>s(t)?t:()=>t,t.containedInCircles=nn,t.cos=ft,t.crossProduct=yt,t.crossProductPoint=xt,t.dateGetterName=Ve,t.dateSetterName=function(t){return t?"setUTCDate":"setDate"},t.dayCount=pu,t.dayField=yu,t.dayFloor=mu,t.dayOffset=Cu,t.debounce=K,t.defaults=_,t.degreeToRadian=St,t.destination=function(t,e,u,n={}){const r=St(t[0]),i=St(t[1]),s=St(u),o=function(t,e){void 0===e&&(e="kilometers");var u=en[e];if(!u)throw new Error(e+" units is invalid");return t/u}(e,n.units),D=Math.asin(Math.sin(i)*Math.cos(o)+Math.cos(i)*Math.sin(o)*Math.cos(s));return{x:Tt(r+Math.atan2(Math.sin(s)*Math.sin(o)*Math.cos(i),Math.cos(o)-Math.sin(i)*Math.sin(D))),y:Tt(D)}},t.deviation=function(t,e){const u=W(t,e);return u?Math.sqrt(u):u},t.dotProduct=Et,t.eastAsianCharacterInfo=xe,t.epsilon=st,t.exponent=Cn,t.findBoundaryAngles=Ut,t.findZeroOfFunction=function(t,e,u,n){var r,i;const s=null!==(r=null==n?void 0:n.maxIterations)&&void 0!==r?r:100,o=null!==(i=null==n?void 0:n.tolerance)&&void 0!==i?i:1e-10,D=t(e),a=t(u);let h=u-e;if(D*a>0){return P.getInstance().error("Initial bisect points must have opposite signs"),NaN}if(0===D)return e;if(0===a)return u;for(let u=0;u<s;++u){h/=2;const u=e+h,n=t(u);if(n*D>=0&&(e=u),Math.abs(h)<o||0===n)return u}return e+h},t.fixPrecision=Bt,t.flattenArray=function t(e){if(!f(e))return[e];const u=[];for(const n of e)u.push(...t(n));return u},t.formatNumerals=pn,t.formatSpecifier=Fn,t.formatTypes=mn,t.fullYearGetterName=Ye,t.fullYearSetterName=function(t){return t?"setUTCFullYear":"setFullYear"},t.fuzzyEqualNumber=function(t,e){return lt(t-e)<st},t.fuzzyEqualVec=Mt,t.gemv=function(t,e,u){for(let n=0;n<t.length;++n)t[n]=Et(e[n],u)},t.generateCeil=Xu,t.generateCount=Zu,t.generateStepInterval=(t,{floor:e,offset:u,field:n,count:r})=>{const i=Math.floor(t);if(!Number.isFinite(i)||i<=0)return null;if(i<=1)return{floor:e,offset:u,ceil:Xu(e,u)};const s=Zu(e,r),o=n?t=>n(t)%i==0:t=>s(0,t)%i==0,D=t=>{if(!Number.isNaN(+t))for(e(t);!o(t);)t.setTime(+t-1),e(t);return t},a=(t,e)=>{if(!Number.isNaN(+t))if(i<0)for(;++e<=0;)for(u(t,-1);!o(t);)u(t,-1);else for(;--e>=0;)for(u(t,1);!o(t);)u(t,1);return t};return{floor:D,offset:a,ceil:Xu(D,a)}},t.get=(t,e,u)=>{const n=c(e)?e.split("."):e;for(let e=0;e<n.length;e++)t=t?t[n[e]]:void 0;return void 0===t?u:t},t.getAABBFromPoints=function(t){return Gt=1/0,$t=1/0,Xt=-1/0,Zt=-1/0,t.forEach((t=>{Gt>t.x&&(Gt=t.x),Xt<t.x&&(Xt=t.x),$t>t.y&&($t=t.y),Zt<t.y&&(Zt=t.y)})),{x1:Gt,y1:$t,x2:Xt,y2:Zt}},t.getAngleByPoint=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},t.getCenter=on,t.getContainerSize=function(t,e=0,u=0){if(!t)return{width:e,height:u};let n;try{n=null===window||void 0===window?void 0:window.getComputedStyle}catch(t){n=()=>({})}const r=n(t);if(/^(\d*\.?\d+)(px)$/.exec(r.width)){const n=parseFloat(r.width)-parseFloat(r.paddingLeft)-parseFloat(r.paddingRight)||t.clientWidth-1,i=parseFloat(r.height)-parseFloat(r.paddingTop)-parseFloat(r.paddingBottom)||t.clientHeight-1;return{width:n<=0?e:n,height:i<=0?u:i}}return{width:e,height:u}},t.getContextFont=Me,t.getDecimalPlaces=bt,t.getElementAbsolutePosition=Ju,t.getElementRelativePosition=function(t,e){const u=Ju(t),n=Ju(e);return{x:u.x-n.x,y:u.y-n.y}},t.getFormatFromValue=function(t,e){const u=rt(t),n=u[qe(e)]()+1,r=u[Ve(e)](),i=u[Ge(e)](),s=u[$e(e)](),o=u[Xe(e)](),D=0===u[Ze(e)](),a=D&&0===o,h=a&&0===s,l=h&&0===i,c=l&&1===r;return c&&1===n?"YYYY":c?"YYYY-MM":l?"YYYY-MM-DD":h?"HH":a?"HH:mm":D?"HH:mm:ss":"HH:mm:ss SSS"},t.getIntersectPoint=function(t,e,u,n){if(!Ot(t,e,u,n))return!1;const r=[0,0],i=[0,0],s=[0,0];if(Ht(r,e,t),Ht(i,n,u),Mt(r,i))return!0;Ht(s,u,t);const o=yt(s,i)/yt(r,i);return o>=0&&o<=1&&[t[0]+r[0]*o,t[1]+r[1]*o]},t.getIntervalOptions=(t,e)=>"year"===t&&e?{floor:iu,offset:su,count:ou,field:Du}:"month"===t&&e?{floor:fu,offset:Fu,count:du,field:gu}:"day"===t&&e?{floor:xu,offset:Eu,count:Mu,field:Bu}:"hour"===t&&e?{floor:Su,offset:Tu,count:Au,field:_u}:"minute"===t&&e?{floor:Uu,offset:Hu,count:ku,field:Ou}:"second"===t&&e?{floor:ju,offset:Yu,count:zu,field:qu}:"year"===t?{floor:eu,offset:uu,count:nu,field:ru}:"month"===t?{floor:au,offset:hu,count:lu,field:cu}:"day"===t?{floor:mu,offset:Cu,count:pu,field:yu}:"hour"===t?{floor:bu,offset:vu,count:Au,field:wu}:"minute"===t?{floor:Lu,offset:Nu,count:ku,field:Iu}:"second"===t?{floor:Ru,offset:Pu,count:zu,field:Wu}:{floor:Vu,offset:Gu,count:$u},t.getOBBFromLine=function(t,e,u){return Jt=e.x-t.x,Qt=e.y-t.y,Kt=Qt,te=-Jt,ne=ee=Math.sqrt(Kt*Kt+te*te),re=u,Kt/=ee,te/=ee,ue=u/2,Jt=ue*Kt,Qt=ue*te,{point1:{x:t.x+Jt,y:t.y+Qt},point2:{x:t.x-Jt,y:t.y-Qt},point3:{x:e.x+Jt,y:e.y+Qt},point4:{x:e.x-Jt,y:e.y-Qt},width:ne,height:re,left:Math.min(t.x,e.x)-Math.abs(Jt),top:Math.min(t.y,e.y)-Math.abs(Qt)}},t.getRectIntersect=function(t,e,u){if(null===t)return e;if(null===e)return t;const{x11:n,x12:r,y11:i,y12:s,x21:o,x22:D,y21:a,y22:h}=Pt(t,e,u);return n>=D||r<=o||i>=h||s<=a?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(n,o),y1:Math.max(i,a),x2:Math.min(r,D),y2:Math.min(s,h)}},t.getScale=t=>t.offsetWidth>0?Qu(t):Ku(t),t.getScaleX=Qu,t.getScaleY=Ku,t.getScrollLeft=t=>{var e,u,n;return t===(null===(e=null===globalThis||void 0===globalThis?void 0:globalThis.document)||void 0===e?void 0:e.body)?(null===(n=null===(u=null===globalThis||void 0===globalThis?void 0:globalThis.document)||void 0===u?void 0:u.documentElement)||void 0===n?void 0:n.scrollLeft)||t.scrollLeft:"html"===t.tagName.toLowerCase()?0:t.scrollLeft},t.getScrollTop=t=>{var e,u,n;return t===(null===(e=null===globalThis||void 0===globalThis?void 0:globalThis.document)||void 0===e?void 0:e.body)?(null===(n=null===(u=null===globalThis||void 0===globalThis?void 0:globalThis.document)||void 0===u?void 0:u.documentElement)||void 0===n?void 0:n.scrollTop)||t.scrollTop:"html"===t.tagName.toLowerCase()?0:t.scrollTop},t.getTimeFormatter=function(t,e){return u=>{const n=rt(u),r=n[Ye(e)](),i=n[qe(e)]()+1,s=Math.floor((i-1)/3)+1,o=n[Ve(e)](),D=n["get"+(e?"UTC":"")+"Day"](),a=n[Ge(e)](),h=(a-1)%12+1,l=n[$e(e)](),c=n[Xe(e)](),f=n[Ze(e)]();return(t||"").replace(/YYYY/g,Z(r+"",4,"0","left")).replace(/yyyy/g,r+"").replace(/yy/g,r%100+"").replace(/Q/g,s+"").replace(/MM/g,Z(i,2,"0","left")).replace(/M/g,i+"").replace(/dd/g,Z(o,2,"0","left")).replace(/d/g,o+"").replace(/e/g,D+"").replace(/HH/g,Z(a,2,"0","left")).replace(/H/g,a+"").replace(/hh/g,Z(h+"",2,"0","left")).replace(/h/g,h+"").replace(/mm/g,Z(l,2,"0","left")).replace(/m/g,l+"").replace(/ss/g,Z(c,2,"0","left")).replace(/s/g,c+"").replace(/SSS/g,Z(f,3,"0","left")).replace(/S/g,f+"")}},t.halfPi=Dt,t.has=(t,e)=>null!=t&&x.call(t,e),t.hasParentElement=function(t,e){let u=t.parentNode;for(;null!==u;){if(u===e)return!0;u=u.parentNode}return!1},t.hexToRgb=Pe,t.hourCount=Au,t.hourField=wu,t.hourFloor=bu,t.hourOffset=vu,t.hoursGetterName=Ge,t.hoursSetterName=function(t){return t?"setUTCHours":"setHours"},t.hslToRgb=we,t.interpolateDate=function(t,e){const u=t.valueOf(),n=e.valueOf(),r=new Date;return t=>(r.setTime(u*(1-t)+n*t),r)},t.interpolateNumber=tt,t.interpolateNumberRound=function(t,e){return function(u){return Math.round(t*(1-u)+e*u)}},t.interpolateRgb=We,t.interpolateString=function(t,e){let u,n,r,i=et.lastIndex=ut.lastIndex=0,s=-1;const o=[],D=[];for(t+="",e+="";(u=et.exec(t))&&(n=ut.exec(e));)(r=n.index)>i&&(r=e.slice(i,r),o[s]?o[s]+=r:o[++s]=r),(u=u[0])===(n=n[0])?o[s]?o[s]+=n:o[++s]=n:(o[++s]=null,D.push({i:s,x:tt(u,n)})),i=ut.lastIndex;return i<e.length&&(r=e.slice(i),o[s]?o[s]+=r:o[++s]=r),o.length<2?D[0]?function(t){return function(e){return t(e)+""}}(D[0].x):function(t){return function(){return t}}(e):(e=D.length,function(t){for(let u,n=0;n<e;++n)o[(u=D[n]).i]=u.x(t);return o.join("")})},t.intersectionArea=function(t,e){const u=function(t){const e=[];for(let u=0;u<t.length;++u)for(let n=u+1;n<t.length;++n){const r=sn(t[u],t[n]);for(let t=0;t<r.length;++t){const i=r[t];i.parentIndex=[u,n],e.push(i)}}return e}(t),n=u.filter((function(e){return nn(e,t)}));let r=0,i=0;const s=[];if(n.length>1){const e=on(n);for(let t=0;t<n.length;++t){const u=n[t];u.angle=Math.atan2(u.x-e.x,u.y-e.y)}n.sort((function(t,e){return e.angle-t.angle}));let u=n[n.length-1];for(let e=0;e<n.length;++e){const o=n[e];i+=(u.x+o.x)*(o.y-u.y);const D={x:(o.x+u.x)/2,y:(o.y+u.y)/2};let a=null;for(let e=0;e<o.parentIndex.length;++e)if(u.parentIndex.indexOf(o.parentIndex[e])>-1){const n=t[o.parentIndex[e]],r=Math.atan2(o.x-n.x,o.y-n.y),i=Math.atan2(u.x-n.x,u.y-n.y);let s=i-r;s<0&&(s+=2*Math.PI);const h=i-s/2;let l=At.distancePP(D,{x:n.x+n.radius*Math.sin(h),y:n.y+n.radius*Math.cos(h)});l>2*n.radius&&(l=2*n.radius),(null===a||a.width>l)&&(a={circle:n,width:l,p1:o,p2:u})}null!==a&&(s.push(a),r+=rn(a.circle.radius,a.width),u=o)}}else{let e=t[0];for(let u=1;u<t.length;++u)t[u].radius<e.radius&&(e=t[u]);let u=!1;for(let n=0;n<t.length;++n)if(At.distancePP(t[n],e)>Math.abs(e.radius-t[n].radius)){u=!0;break}u?r=i=0:(r=e.radius*e.radius*Math.PI,s.push({circle:e,p1:{x:e.x,y:e.y+e.radius},p2:{x:e.x-un,y:e.y+e.radius},width:2*e.radius}))}return i/=2,e&&(e.area=r+i,e.arcArea=r,e.polygonArea=i,e.arcs=s,e.innerPoints=n,e.intersectionPoints=u),r+i},t.isArray=f,t.isArrayLike=F,t.isBase64=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t),t.isBoolean=i,t.isDate=d,t.isEmpty=function(t){if(o(t))return!0;if(F(t))return!t.length;const e=(t=>({}.toString.call(t).replace(/^\[object /,"").replace(/]$/,"")))(t);if("Map"===e||"Set"===e)return!t.size;if(function(t){const e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||p)}(t))return!Object.keys(t).length;for(const e in t)if(y.call(t,e))return!1;return!0},t.isEqual=function t(e,u,n){if(e===u)return!0;if(typeof e!=typeof u)return!1;if(null==e||null==u)return!1;if(Number.isNaN(e)&&Number.isNaN(u))return!0;if(v(e)!==v(u))return!1;if(s(e))return!!(null==n?void 0:n.skipFunction);if("object"!=typeof e)return!1;if(f(e)){if(e.length!==u.length)return!1;for(let r=e.length-1;r>=0;r--)if(!t(e[r],u[r],n))return!1;return!0}if(!l(e))return!1;const r=A(e),i=A(u);if(r.length!==i.length)return!1;r.sort(),i.sort();for(let t=r.length-1;t>=0;t--)if(r[t]!=i[t])return!1;for(let i=r.length-1;i>=0;i--){const s=r[i];if(!t(e[s],u[s],n))return!1}return!0},t.isFunction=s,t.isGreater=function(t,e,u,n){return t>e&&!$(t,e,u,n)},t.isHTMLElement=function(t){try{return t instanceof Element}catch(e){const u=["children","innerHTML","classList","setAttribute","tagName","getBoundingClientRect"],n=Object.keys(t);return u.every((t=>n.includes(t)))}},t.isIntersect=Ot,t.isLess=function(t,e,u,n){return t<e&&!$(t,e,u,n)},t.isNil=o,t.isNull=t=>null===t,t.isNumber=g,t.isNumberClose=$,t.isNumeric=t=>"string"==typeof t&&(!isNaN(Number(t))&&!isNaN(parseFloat(t))),t.isObject=a,t.isObjectLike=h,t.isPlainObject=l,t.isPointInLine=me,t.isPointInPolygon=function(t,e){if(!t)return!1;if(!e)return!1;const u="Feature"===(n=e).type?n.geometry:n;var n;const r=u.type,i=e.bbox;let s=u.coordinates;if(i&&!0===zt(t,{x1:i[0],x2:i[1],y1:i[1],y2:i[3]},!0))return!1;"Polygon"===r&&(s=[s]);let o=!1;for(let e=0;e<s.length;++e)for(let u=0;u<s[e].length;++u){if(ge(s[e][u].map((t=>({x:t[0],y:t[1]}))),t.x,t.y))return o=!0,o}return o},t.isRectIntersect=function(t,e,u){if(t&&e){if(!u)return!(t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1);const{x11:n,x12:r,y11:i,y12:s,x21:o,x22:D,y21:a,y22:h}=Pt(t,e,!0);return!(n>D||r<o||i>h||s<a)}return!0},t.isRegExp=C,t.isRotateAABBIntersect=Vt,t.isShallowEqual=function(t,e){if(w(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;if(f(t)!==f(e))return!1;if(S(t)!==S(e))return!1;let u=!0;return Object.keys(t).forEach((n=>!!w(t[n],e[n])||(u=!1,u))),u},t.isString=c,t.isType=r,t.isUndefined=t=>void 0===t,t.isValid=D,t.isValidNumber=m,t.isValidUrl=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t),t.keys=T,t.last=N,t.lengthFromPointToLine=pt,t.lineIntersectPolygon=de,t.lowerCamelCaseToMiddle=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase(),t.lowerFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},t.max=Ft,t.maxInArray=(t,e)=>{var u;if(0===t.length)return;let n=t[0];for(let r=1;r<t.length;r++){const i=t[r];(null!==(u=null==e?void 0:e(i,n))&&void 0!==u?u:i-n>0)&&(n=i)}return n},t.median=(t,e)=>{let u=t;return!0!==e&&(u=t.sort(k)),U(u,.5)},t.memoize=t=>{let e=null,u=null;return(...n)=>(e&&n.every(((t,u)=>t===e[u]))||(e=n,u=t(...n)),u)},t.merge=function(t,...e){let u=-1;const n=e.length;for(;++u<n;){E(t,e[u],!0)}return t},t.mergeAABB=function(t){const e=[];return function t(u,n){const r=[];n.forEach((t=>{let e;(e=ie(u,t)).length>1?r.push(t):u=e[0]})),e.push(u),r.length&&t(r[0],r.slice(1))}(t[0],t.slice(1)),e},t.millisecondsCount=$u,t.millisecondsFloor=Vu,t.millisecondsGetterName=Ze,t.millisecondsOffset=Gu,t.millisecondsSetterName=function(t){return t?"setUTCMilliseconds":"setMilliseconds"},t.min=dt,t.minInArray=(t,e)=>{var u;if(0===t.length)return;let n=t[0];for(let r=1;r<t.length;r++){const i=t[r];(null!==(u=null==e?void 0:e(i,n))&&void 0!==u?u:i-n<0)&&(n=i)}return n},t.minuteCount=ku,t.minuteField=Iu,t.minuteFloor=Lu,t.minuteOffset=Nu,t.minutesGetterName=$e,t.minutesSetterName=function(t){return t?"setUTCMinutes":"setMinutes"},t.mixin=function(t,e,u=!0){if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames){const n=Object.getOwnPropertyNames(e);for(let r=0;r<n.length;r++){const i=n[r];"constructor"!==i&&(u?null!=e[i]:null==t[i])&&(t[i]=e[i])}}else _(t,e,u)},t.monthCount=lu,t.monthField=cu,t.monthFloor=au,t.monthGetterName=qe,t.monthOffset=hu,t.monthSetterName=function(t){return t?"setUTCMonth":"setMonth"},t.nelderMead=function(t,e,u){const n=(u=u||{}).maxIterations||200*e.length,r=u.nonZeroDelta||1.05,i=u.zeroDelta||.001,s=u.minErrorDelta||1e-6,o=u.minErrorDelta||1e-5,D=void 0!==u.rho?u.rho:1,a=void 0!==u.chi?u.chi:2,h=void 0!==u.psi?u.psi:-.5,l=void 0!==u.sigma?u.sigma:.5;let c;const f=e.length,F=new Array(f+1);F[0]=e,F[0].fx=t(e),F[0].id=0;for(let u=0;u<f;++u){const n=e.slice();n[u]=n[u]?n[u]*r:i,F[u+1]=n,F[u+1].fx=t(n),F[u+1].id=u+1}function d(t){for(let e=0;e<t.length;e++)F[f][e]=t[e];F[f].fx=t.fx}const g=function(t,e){return t.fx-e.fx},m=e.slice(),C=e.slice(),p=e.slice(),y=e.slice();for(let e=0;e<n;++e){if(F.sort(g),u.history){const t=F.map((function(t){const e=t.slice();return e.fx=t.fx,e.id=t.id,e}));t.sort((function(t,e){return t.id-e.id})),u.history.push({x:F[0].slice(),fx:F[0].fx,simplex:t})}c=0;for(let t=0;t<f;++t)c=Math.max(c,Math.abs(F[0][t]-F[1][t]));if(Math.abs(F[0].fx-F[f].fx)<s&&c<o)break;for(let t=0;t<f;++t){m[t]=0;for(let e=0;e<f;++e)m[t]+=F[e][t];m[t]/=f}const e=F[f];if(Mn(C,1+D,m,-D,e),C.fx=t(C),C.fx<F[0].fx)Mn(y,1+a,m,-a,e),y.fx=t(y),y.fx<C.fx?d(y):d(C);else if(C.fx>=F[f-1].fx){let u=!1;if(C.fx>e.fx?(Mn(p,1+h,m,-h,e),p.fx=t(p),p.fx<e.fx?d(p):u=!0):(Mn(p,1-h*D,m,h*D,e),p.fx=t(p),p.fx<C.fx?d(p):u=!0),u){if(l>=1)break;for(let e=1;e<F.length;++e)Mn(F[e],1-l,F[0],l,F[e]),F[e].fx=t(F[e])}}else d(C)}return F.sort(g),{fx:F[0].fx,x:F[0]}},t.norm2=xn,t.normalTransform=function(t,e,u,n,r,i,s,o){const D=e.a,a=e.b,h=e.c,l=e.d,c=e.e,f=e.f,F=ft(s),d=gt(s);let g,m;o?(g=o[0],m=o[1]):(g=u,m=n);const C=g-u,p=m-n,y=D*F+h*d,x=a*F+l*d,E=h*F-D*d,M=l*F-a*d;t.a=r*y,t.b=r*x,t.c=i*E,t.d=i*M,t.e=c+D*g+h*m-y*C-E*p,t.f=f+a*g+l*m-x*C-M*p},t.normalizeAngle=It,t.normalizePadding=function(t){if(m(t))return[t,t,t,t];if(f(t)){const e=t.length;if(1===e){const e=t[0];return[e,e,e,e]}if(2===e){const[e,u]=t;return[e,u,e,u]}if(3===e){const[e,u,n]=t;return[e,u,n,u]}if(4===e)return t}if(a(t)){const{top:e=0,right:u=0,bottom:n=0,left:r=0}=t;return[e,u,n,r]}return[0,0,0,0]},t.numberSpecifierReg=fn,t.pad=Z,t.parseUint8ToImageData=(t,e,u)=>{const n=new Uint8ClampedArray(t),r=new Uint8ClampedArray(t.length);for(let t=u-1;t>=0;t--)for(let i=0;i<e;i++){const s=t*e*4+4*i,o=(u-t)*e*4+4*i;r[o]=n[s],r[o+1]=n[s+1],r[o+2]=n[s+2],r[o+3]=n[s+3]}return new ImageData(r,e,u)},t.pi=ot,t.pi2=ht,t.pick=function(t,e){if(!t||!l(t))return t;const u={};return e.forEach((e=>{b.call(t,e)&&(u[e]=t[e])})),u},t.pickWithout=function(t,e){if(!t||!l(t))return t;const u={};return Object.keys(t).forEach((n=>{const r=t[n];let i=!1;e.forEach((t=>{(c(t)&&t===n||t instanceof RegExp&&n.match(t))&&(i=!0)})),i||(u[n]=r)})),u},t.pointAt=function(t,e,u,n,r){let i=u,s=n;return"number"==typeof t&&"number"==typeof u&&(i=(1-r)*t+r*u),"number"==typeof e&&"number"==typeof n&&(s=(1-r)*e+r*n),{x:i,y:s}},t.pointBetweenLine=ce,t.pointInAABB=function(t,e){return zt(t,e,!1)},t.pointInLine=De,t.pointInOBB=function(t,e){return se.x=(e.point1.x+e.point2.x)/2,se.y=(e.point1.y+e.point2.y)/2,oe.x=(e.point3.x+e.point4.x)/2,oe.y=(e.point3.y+e.point4.y)/2,De(t,se,oe,e.height)},t.pointInRect=zt,t.polarToCartesian=function(t,e,u){return e?{x:t.x+e*Math.cos(u),y:t.y+e*Math.sin(u)}:{x:t.x,y:t.y}},t.polygonContainPoint=ge,t.polygonIntersectPolygon=function(t,e){for(let u=0;u<e.length;u++){if(ge(t,e[u].x,e[u].y))return!0;if(u>0&&de(e[u-1].x,e[u-1].y,e[u].x,e[u].y,t))return!0}return!1},t.pow=Ct,t.precisionAdd=function(t,e){return Bt(t+e,10**Math.max(bt(t),bt(e)))},t.precisionSub=function(t,e){return Bt(t-e,10**Math.max(bt(t),bt(e)))},t.quantileSorted=U,t.radianToDegree=Tt,t.range=function(t,e,u){D(e)||(e=t,t=0),D(u)||(u=1);let n=-1;const r=0|Math.max(0,Math.ceil((e-t)/u)),i=new Array(r);for(;++n<r;)i[n]=t+n*u;return i},t.rectInsideAnotherRect=function(e,u,n){if(!e||!u)return t.InnerBBox.NONE;const{x11:r,x12:i,y11:s,y12:o,x21:D,x22:a,y21:h,y22:l}=Pt(e,u,n);return r>D&&i<a&&s>h&&o<l?t.InnerBBox.BBOX1:D>r&&a<i&&h>s&&l<o?t.InnerBBox.BBOX2:t.InnerBBox.NONE},t.rgbToHex=ze,t.rgbToHsl=Se,t.rotatePoint=jt,t.scale=En,t.secondCount=zu,t.secondField=Wu,t.secondFloor=Ru,t.secondOffset=Pu,t.secondsGetterName=Xe,t.secondsSetterName=function(t){return t?"setUTCSeconds":"setSeconds"},t.seedRandom=function(t){return parseFloat("0."+Math.sin(t).toString().substring(6))},t.shuffleArray=function(t,e=Math.random){let u,n,r=t.length;for(;r;)u=Math.floor(e()*r),n=t[--r],t[r]=t[u],t[u]=n;return t},t.sin=gt,t.span=t=>t.length<=1?0:N(t)-t[0],t.sqrt=mt,t.stringWidth=function(t,e=!0){if("string"!=typeof t||0===t.length)return 0;if(0===(t=pe(t)).length)return 0;t=t.replace(Ee()," ");const u=e?1:2;let n=0;for(const e of t){const t=e.codePointAt(0);if(t<=31||t>=127&&t<=159)continue;if(t>=768&&t<=879)continue;switch(xe(e)){case"F":case"W":n+=2;break;case"A":n+=u;break;default:n+=1}}return n},t.styleStringToObject=(t="")=>{const e={};return t.split(";").forEach((t=>{if(t){const u=t.split(":");if(2===u.length){const t=u[0].trim(),n=u[1].trim();t&&n&&(e[t]=n)}}})),e},t.substitute=function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,((t,u)=>"\\"===t.charAt(0)?t.slice(1):void 0===e[u]?"":e[u])):t},t.tau=at,t.throttle=function(t,e,u){let n=!0,r=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return a(u)&&(n="leading"in u?!!u.leading:n,r="trailing"in u?!!u.trailing:r),K(t,e,{leading:n,trailing:r,maxWait:e})},t.tickStep=function(t,e,u){const n=Math.abs(e-t)/Math.max(0,u);let r=Math.pow(10,Math.floor(Math.log(n)/Math.LN10));const i=n/r;return i>=j?r*=10:i>=Y?r*=5:i>=q&&(r*=2),e<t?-r:r},t.toCamelCase=function(t){return t.replace(/-([a-z])/g,((t,e)=>e.toUpperCase()))},t.toDate=rt,t.toNumber=I,t.toValidNumber=function(t){if(m(t))return t;const e=+t;return m(e)?e:0},t.transformBounds=function(t,e,u,n,r,i,s){if(!(lt(n)<=st||lt(r)<=st)){if(1!==n&&t.scaleX(n),1!==r&&t.scaleY(r),isFinite(i)&&Math.abs(i)>st){let e=0,u=0;void 0!==s&&(e=s[0],u=s[1]),t.rotate(i,e,u)}t.translate(e,u)}},t.transformBoundsWithMatrix=be,t.truncate=(t,e,u="right",n)=>{const r=o(n)?"…":n,i=t+"",s=i.length,D=Math.max(0,e-r.length);return s<=e?i:"left"===u?r+i.slice(s-D):"center"===u?i.slice(0,Math.ceil(D/2))+r+i.slice(s-Math.floor(D/2)):i.slice(0,D)+r},t.unionAABB=ie,t.uniqArray=function(t){return t&&f(t)?Array.from(new Set(L(t))):t},t.upperFirst=function(t){return t.charAt(0).toUpperCase()+t.substring(1)},t.utcDayCount=Mu,t.utcDayField=Bu,t.utcDayFloor=xu,t.utcDayOffset=Eu,t.utcHourField=_u,t.utcHourFloor=Su,t.utcHourOffset=Tu,t.utcMinuteField=Ou,t.utcMinuteFloor=Uu,t.utcMinuteOffset=Hu,t.utcMonthCount=du,t.utcMonthField=gu,t.utcMonthFloor=fu,t.utcMonthOffset=Fu,t.utcSecondField=qu,t.utcSecondFloor=ju,t.utcSecondOffset=Yu,t.utcYearCount=ou,t.utcYearField=Du,t.utcYearFloor=iu,t.utcYearOffset=su,t.uuid=(t,e)=>{const u="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[];let r;if(e=e||u.length,t)for(r=0;r<t;r++)n[r]=u[0|Math.random()*e];else{let t;for(n[8]=n[13]=n[18]=n[23]="-",n[14]="4",r=0;r<36;r++)n[r]||(t=0|16*Math.random(),n[r]=u[19===r?3&t|8:t])}return n.join("")},t.variance=W,t.weightedSum=Mn,t.yearCount=nu,t.yearField=ru,t.yearFloor=eu,t.yearOffset=uu,t.zeros=yn,t.zerosM=function(t,e){return yn(t).map((function(){return yn(e)}))}}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VUtils={})}(this,(function(t){"use strict";function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var u={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,u="~";function n(){}function r(t,e,u){this.fn=t,this.context=e,this.once=u||!1}function i(t,e,n,i,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new r(n,i||t,s),D=u?u+e:e;return t._events[D]?t._events[D].fn?t._events[D]=[t._events[D],o]:t._events[D].push(o):(t._events[D]=o,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(u=!1)),o.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(u?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=u?u+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,i=n.length,s=new Array(i);r<i;r++)s[r]=n[r].fn;return s},o.prototype.listenerCount=function(t){var e=u?u+t:t,n=this._events[e];return n?n.fn?1:n.length:0},o.prototype.emit=function(t,e,n,r,i,s){var o=u?u+t:t;if(!this._events[o])return!1;var D,a,h=this._events[o],l=arguments.length;if(h.fn){switch(h.once&&this.removeListener(t,h.fn,void 0,!0),l){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,e),!0;case 3:return h.fn.call(h.context,e,n),!0;case 4:return h.fn.call(h.context,e,n,r),!0;case 5:return h.fn.call(h.context,e,n,r,i),!0;case 6:return h.fn.call(h.context,e,n,r,i,s),!0}for(a=1,D=new Array(l-1);a<l;a++)D[a-1]=arguments[a];h.fn.apply(h.context,D)}else{var c,f=h.length;for(a=0;a<f;a++)switch(h[a].once&&this.removeListener(t,h[a].fn,void 0,!0),l){case 1:h[a].fn.call(h[a].context);break;case 2:h[a].fn.call(h[a].context,e);break;case 3:h[a].fn.call(h[a].context,e,n);break;case 4:h[a].fn.call(h[a].context,e,n,r);break;default:if(!D)for(c=1,D=new Array(l-1);c<l;c++)D[c-1]=arguments[c];h[a].fn.apply(h[a].context,D)}}return!0},o.prototype.on=function(t,e,u){return i(this,t,e,u,!1)},o.prototype.once=function(t,e,u){return i(this,t,e,u,!0)},o.prototype.removeListener=function(t,e,n,r){var i=u?u+t:t;if(!this._events[i])return this;if(!e)return s(this,i),this;var o=this._events[i];if(o.fn)o.fn!==e||r&&!o.once||n&&o.context!==n||s(this,i);else{for(var D=0,a=[],h=o.length;D<h;D++)(o[D].fn!==e||r&&!o[D].once||n&&o[D].context!==n)&&a.push(o[D]);a.length?this._events[i]=1===a.length?a[0]:a:s(this,i)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=u?u+t:t,this._events[e]&&s(this,e)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=u,o.EventEmitter=o,t.exports=o}(u);var n=e(u.exports);const r=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`,i=(t,e=!1)=>e?"boolean"==typeof t:!0===t||!1===t||r(t,"Boolean"),s=t=>"function"==typeof t,o=t=>null==t,D=t=>null!=t,a=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e},h=t=>"object"==typeof t&&null!==t,l=function(t){if(!h(t)||!r(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},c=(t,e=!1)=>{const u=typeof t;return e?"string"===u:"string"===u||r(t,"String")},f=t=>Array.isArray?Array.isArray(t):r(t,"Array"),F=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)},d=t=>r(t,"Date"),g=(t,e=!1)=>{const u=typeof t;return e?"number"===u:"number"===u||r(t,"Number")},m=t=>g(t)&&Number.isFinite(t),C=t=>r(t,"RegExp"),p=Object.prototype,y=Object.prototype.hasOwnProperty;const x=Object.prototype.hasOwnProperty;function E(t,e,u=!1,n=!1){if(e){if(t===e)return;if(D(e)&&"object"==typeof e){const r=Object(e),i=[];for(const t in r)i.push(t);let{length:s}=i,o=-1;for(;s--;){const s=i[++o];!D(r[s])||"object"!=typeof r[s]||n&&f(t[s])?B(t,s,r[s]):M(t,e,s,u,n)}}}}function M(t,e,u,n=!1,r=!1){const i=t[u],s=e[u];let o=e[u],D=!0;if(f(s)){if(n)o=[];else if(f(i))o=i;else if(F(i)){o=new Array(i.length);let t=-1;const e=i.length;for(;++t<e;)o[t]=i[t]}}else l(s)?(o=null!=i?i:{},"function"!=typeof i&&"object"==typeof i||(o={})):D=!1;D&&E(o,s,n,r),B(t,u,o)}function B(t,e,u){(void 0!==u&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],u)||void 0===u&&!(e in t))&&(t[e]=u)}const b=Object.prototype.hasOwnProperty;function v(t){return Object.prototype.toString.call(t)}function A(t){return Object.keys(t)}function w(t,e){return t===e?0!==t||0!==e||1/t==1/e:t!=t&&e!=e}function S(t){return f(t)?t.length:a(t)?Object.keys(t).length:0}function T(t){if(!t)return[];if(Object.keys)return Object.keys(t);const e=[];for(const u in t)t.hasOwnProperty(u)&&e.push(u);return e}function _(t,e,u){const n=T(e);for(let r=0;r<n.length;r++){const i=n[r];(u?null!=e[i]:null==t[i])&&(t[i]=e[i])}return t}function L(t){return D(t)?f(t)?t:[t]:[]}function N(t){if(F(t)){return t[t.length-1]}}function k(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function I(t){return Number(t)}function U(t,e,u=I){const n=t.length;if(!n)return;if(e<=0||n<2)return u(t[0],0,t);if(e>=1)return u(t[n-1],n-1,t);const r=(n-1)*e,i=Math.floor(r),s=u(t[i],i,t);return s+(u(t[i+1],i+1,t)-s)*(r-i)}const H="undefined"!=typeof console;function O(t,e,u){const n=[e].concat([].slice.call(u));H&&console[t].apply(console,n)}var R;t.LoggerLevel=void 0,(R=t.LoggerLevel||(t.LoggerLevel={}))[R.None=0]="None",R[R.Error=1]="Error",R[R.Warn=2]="Warn",R[R.Info=3]="Info",R[R.Debug=4]="Debug";class P{static getInstance(t,e){return P._instance&&g(t)?P._instance.level(t):P._instance||(P._instance=new P(t,e)),P._instance}static setInstance(t){return P._instance=t}static setInstanceLevel(t){P._instance?P._instance.level(t):P._instance=new P(t)}static clearInstance(){P._instance=null}constructor(e=t.LoggerLevel.None,u){this._onErrorHandler=[],this._level=e,this._method=u}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(...t){this._onErrorHandler.forEach((e=>e(...t)))}canLogInfo(){return this._level>=t.LoggerLevel.Info}canLogDebug(){return this._level>=t.LoggerLevel.Debug}canLogError(){return this._level>=t.LoggerLevel.Error}canLogWarn(){return this._level>=t.LoggerLevel.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(...e){var u;return this._level>=t.LoggerLevel.Error&&(this._onErrorHandler.length?this.callErrorHandler(...e):O(null!==(u=this._method)&&void 0!==u?u:"error","ERROR",e)),this}warn(...e){return this._level>=t.LoggerLevel.Warn&&O(this._method||"warn","WARN",e),this}info(...e){return this._level>=t.LoggerLevel.Info&&O(this._method||"log","INFO",e),this}debug(...e){return this._level>=t.LoggerLevel.Debug&&O(this._method||"log","DEBUG",e),this}}P._instance=null;const z=(t,e,u)=>{let n=t,r=e;for(;n<r;){const t=Math.floor((n+r)/2);u(t)>=0?r=t:n=t+1}return n};function W(t,e){let u,n=0,r=0,i=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(u=e-r,r+=u/++n,i+=u*(e-r));else{let s=-1;for(let o of t)null!=(o=e(o,++s,t))&&(o=+o)>=o&&(u=o-r,r+=u/++n,i+=u*(o-r))}return n>1?i/(n-1):0}const j=Math.sqrt(50),Y=Math.sqrt(10),q=Math.sqrt(2);const V=1e-10,G=1e-10;function $(t,e,u=G,n=V){const r=n,i=u*Math.max(t,e);return Math.abs(t-e)<=Math.max(r,i)}const X=(t,e=0)=>{let u="",n=e-1;for(;n>=0;)u=`${u}${t}`,n-=1;return u},Z=(t,e,u=" ",n="right")=>{const r=u,i=t+"",s=e-i.length;return s<=0?i:"left"===n?X(r,s)+i:"center"===n?X(r,Math.floor(s/2))+i+X(r,Math.ceil(s/2)):i+X(r,s)},J=function(t,e,u){return t<e?e:t>u?u:t};let Q=!1;try{Q="function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){Q=!1}function K(t,e,u){let n,r,i,s,o,D,h=0,l=!1,c=!1,f=!0;const F=!e&&0!==e&&Q;if("function"!=typeof t)throw new TypeError("Expected a function");function d(e){const u=n,i=r;return n=r=void 0,h=e,s=t.apply(i,u),s}function g(t,e){return F?(cancelAnimationFrame(o),requestAnimationFrame(t)):setTimeout(t,e)}function C(t){const u=t-D;return void 0===D||u>=e||u<0||c&&t-h>=i}function p(){const t=Date.now();if(C(t))return y(t);o=g(p,function(t){const u=t-h,n=e-(t-D);return c?Math.min(n,i-u):n}(t))}function y(t){return o=void 0,f&&n?d(t):(n=r=void 0,s)}function x(...t){const u=Date.now(),i=C(u);if(n=t,r=this,D=u,i){if(void 0===o)return function(t){return h=t,o=g(p,e),l?d(t):s}(D);if(c)return o=g(p,e),d(D)}return void 0===o&&(o=g(p,e)),s}return e=+e||0,a(u)&&(l=!!u.leading,c="maxWait"in u,c&&(i=Math.max(m(u.maxWait)?u.maxWait:0,e)),f="trailing"in u?!!u.trailing:f),x.cancel=function(){void 0!==o&&function(t){if(F)return cancelAnimationFrame(t);clearTimeout(t)}(o),h=0,n=D=r=o=void 0},x.flush=function(){return void 0===o?s:y(Date.now())},x.pending=function(){return void 0!==o},x}function tt(t,e){return u=>t*(1-u)+e*u}Q=!1;const et=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ut=new RegExp(et.source,"g");const nt=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function rt(t){if(t instanceof Date)return t;if(c(t)){const e=nt.exec(t);if(!e)return new Date(NaN);if(!e[8])return new Date(+e[1],+(e[2]||1)-1,+e[3]||1,+e[4]||0,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0);let u=+e[4]||0;return"Z"!==e[8].toUpperCase()&&(u-=+e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,u,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0))}return o(t)?new Date(NaN):new Date(Math.round(t))}class it{}const st=1e-12,ot=Math.PI,Dt=ot/2,at=2*ot,ht=2*Math.PI,lt=Math.abs,ct=Math.atan2,ft=Math.cos,Ft=Math.max,dt=Math.min,gt=Math.sin,mt=Math.sqrt,Ct=Math.pow;function pt(t,e,u){const n=u.x-e.x,r=u.y-e.y,i=t.x-e.x,s=t.y-e.y;return Math.abs(n*s-i*r)/Math.sqrt(n*n+r*r)}function yt(t,e){return t[0]*e[1]-t[1]*e[0]}function xt(t,e){return t.x*e.y-t.y*e.x}function Et(t,e){let u=0;for(let n=0;n<t.length;++n)u+=t[n]*e[n];return u}function Mt(t,e){return lt(t[0]-e[0])+lt(t[1]-e[1])<st}function Bt(t,e=10){return Math.round(t*e)/e}function bt(t){const e=t.toString().split(/[eE]/),u=(e[0].split(".")[1]||"").length-(+e[1]||0);return u>0?u:0}class vt{constructor(t=0,e=0,u,n){this.x=0,this.y=0,this.x=t,this.y=e,this.x1=u,this.y1=n}clone(){return new vt(this.x,this.y)}copyFrom(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.x=t,this.y=e,this}add(t){return g(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return g(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}multi(t){throw new Error("暂不支持")}div(t){throw new Error("暂不支持")}}class At{static distancePP(t,e){return mt(Ct(t.x-e.x,2)+Ct(t.y-e.y,2))}static distanceNN(t,e,u,n){return mt(Ct(t-u,2)+Ct(e-n,2))}static distancePN(t,e,u){return mt(Ct(e-t.x,2)+Ct(u-t.y,2))}static pointAtPP(t,e,u){return new vt((e.x-t.x)*u+t.x,(e.y-t.y)*u+t.y)}}class wt{constructor(t=0,e=0,u,n){this.r=0,this.theta=0,this.r=t,this.theta=e,this.r1=u,this.theta1=n}clone(){return new wt(this.r,this.theta)}copyFrom(t){return this.r=t.r,this.theta=t.theta,this.r1=t.r1,this.theta1=t.theta1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.r=t,this.theta=e,this}}function St(t){return t*(Math.PI/180)}function Tt(t){return 180*t/Math.PI}const _t=(t=0)=>{if(t<0)for(;t<-at;)t+=at;else if(t>0)for(;t>at;)t-=at;return t},Lt=_t,Nt=(t=0)=>t>360||t<-360?t%360:t,kt=Nt;function It(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function Ut(t,e){const u=Math.abs(e-t);if(u>=2*Math.PI||2*Math.PI-u<1e-6)return[0,Math.PI/2,Math.PI,1.5*Math.PI];const n=It(Math.min(t,e)),r=n+u,i=[n,r];let s=Math.floor(n/Math.PI)*Math.PI/2;for(;s<r;)s>n&&i.push(s),s+=Math.PI/2;return i}function Ht(t,e,u){t[0]=e[0]-u[0],t[1]=e[1]-u[1]}function Ot(t,e,u,n){let r=t[0],i=e[0],s=u[0],o=n[0];return i<r&&([r,i]=[i,r]),o<s&&([o,s]=[s,o]),!(i<s||o<r)&&(r=t[1],i=e[1],s=u[1],o=n[1],i<r&&([r,i]=[i,r]),o<s&&([o,s]=[s,o]),!(i<s||o<r))}var Rt;t.InnerBBox=void 0,(Rt=t.InnerBBox||(t.InnerBBox={}))[Rt.NONE=0]="NONE",Rt[Rt.BBOX1=1]="BBOX1",Rt[Rt.BBOX2=2]="BBOX2";const Pt=(t,e,u)=>{let n=t.x1,r=t.x2,i=t.y1,s=t.y2,o=e.x1,D=e.x2,a=e.y1,h=e.y2;return u&&(n>r&&([n,r]=[r,n]),i>s&&([i,s]=[s,i]),o>D&&([o,D]=[D,o]),a>h&&([a,h]=[h,a])),{x11:n,x12:r,y11:i,y12:s,x21:o,x22:D,y21:a,y22:h}};function zt(t,e,u){if(!e)return!0;if(!u)return t.x>=e.x1&&t.x<=e.x2&&t.y>=e.y1&&t.y<=e.y2;let n=e.x1,r=e.x2,i=e.y1,s=e.y2;return n>r&&([n,r]=[r,n]),i>s&&([i,s]=[s,i]),t.x>=n&&t.x<=r&&t.y>=i&&t.y<=s}function Wt(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function jt({x:t,y:e},u,n={x:0,y:0}){return{x:(t-n.x)*Math.cos(u)-(e-n.y)*Math.sin(u)+n.x,y:(t-n.x)*Math.sin(u)+(e-n.y)*Math.cos(u)+n.y}}function Yt(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function qt(t,e){const u=e?St(t.angle):t.angle,n=Yt(t);return[jt({x:t.x1,y:t.y1},u,n),jt({x:t.x2,y:t.y1},u,n),jt({x:t.x2,y:t.y2},u,n),jt({x:t.x1,y:t.y2},u,n)]}function Vt(t,e,u=!1,n){const r=qt(t,u),i=qt(e,u),s=(t,e)=>[e.x-t.x,e.y-t.y];n&&(n.save(),n.fillStyle="red",n.globalAlpha=.6,r.forEach(((t,e)=>{0===e?n.moveTo(t.x,t.y):n.lineTo(t.x,t.y)})),n.fill(),n.restore(),n.save(),n.fillStyle="green",n.globalAlpha=.6,i.forEach(((t,e)=>{0===e?n.moveTo(t.x,t.y):n.lineTo(t.x,t.y)})),n.fill(),n.restore());const o=Yt(t),D=Yt(e);n&&n.fillRect(o.x,o.y,2,2),n&&n.fillRect(D.x,D.y,2,2);const a=s(o,D),h=s(r[0],r[1]),l=s(r[1],r[2]),c=s(i[0],i[1]),f=s(i[1],i[2]),F=u?St(t.angle):t.angle;let d=u?St(90-t.angle):t.angle+Dt;const g=u?St(e.angle):e.angle;let m=u?St(90-e.angle):e.angle+Dt;d>ht&&(d-=ht),m>ht&&(m-=ht);const C=(t,e,u,n)=>{const r=[Math.cos(e),Math.sin(e)];return t+(Wt(r,u)+Wt(r,n))/2>Wt(r,a)};return C((t.x2-t.x1)/2,F,c,f)&&C((t.y2-t.y1)/2,d,c,f)&&C((e.x2-e.x1)/2,g,h,l)&&C((e.y2-e.y1)/2,m,h,l)}let Gt,$t,Xt,Zt,Jt,Qt,Kt,te,ee,ue,ne,re;function ie(t,e,u=3,n=!1){let r=t.x1,i=t.x2,s=t.y1,o=t.y2,D=e.x1,a=e.x2,h=e.y1,l=e.y2;if(n){let t;r>i&&(t=r,r=i,i=t),s>o&&(t=s,s=o,o=t),D>a&&(t=D,D=a,a=t),h>l&&(t=h,h=l,l=t)}if(r>=a||i<=D||s>=l||o<=h)return[t,e];const c=(i-r+2*u)*(o-s+2*u),f=(a-D+2*u)*(l-h+2*u),F=Math.min(r,D),d=Math.min(s,h),g=Math.max(i,a),m=Math.max(o,l);return c+f>(g-F)*(m-d)?[{x1:F,x2:g,y1:d,y2:m}]:[t,e]}const se={x:0,y:0},oe={x:0,y:0};function De(t,e,u,n){return pt(t,e,u)<=n/2&&ce(t,e,u)}const ae={x:0,y:0},he={x:0,y:0},le={x:0,y:0};function ce(t,e,u){return ae.x=e.x-t.x,ae.y=e.y-t.y,he.x=u.x-t.x,he.y=u.y-t.y,le.x=e.y-u.y,le.y=u.x-e.x,xt(ae,le)*xt(he,le)<0}class fe{constructor(t){this.canvas=t,t&&(this.ctx=t.getContext("2d"))}setCanvas(t){this.canvas=t,t&&(this.ctx=t.getContext("2d"))}measureText(t){return this.canvas?this.measureTextByCanvas(t):(console.warn("[warn] no canvas, measureText might be not accurate"),this.estimate(t))}measureTextByCanvas(t){return this.ctx?(this.ctx.font=function({fontStyle:t,fontVariant:e,fontWeight:u,fontSize:n,fontFamily:r}){return(t?t+" ":"")+(e?e+" ":"")+(u?u+" ":"")+(n||12)+"px "+(r||"sans-serif")}(t),{width:this.ctx.measureText(t.text).width,height:t.fontSize}):(console.error("[error!!!]measureTextByCanvas can not be called without canvas"),{width:-1,height:t.fontSize})}estimate({text:t,fontSize:e}){let u=0,n=0;for(let e=0;e<t.length;e++)t.charCodeAt(e)<128?u++:n++;return{width:~~(.8*u*e+n*e),height:e}}static getDefaultUtils(t){return fe.instance||(fe.instance=new fe(t)),fe.instance}}const Fe=1e-8;function de(t,e,u,n,r){for(let i=0,s=r[r.length-1];i<r.length;i++){const o=r[i];if(Ot([t,e],[u,n],[o.x,o.y],[s.x,s.y]))return!0;s=o}return!1}function ge(t,e,u){let n=0,r=t[0];if(!r)return!1;for(let i=1;i<t.length;i++){const s=t[i];n+=me(r.x,r.y,s.x,s.y,e,u),r=s}const i=t[0];return Ce(r.x,i.x)&&Ce(r.y,i.y)||(n+=me(r.x,r.y,i.x,i.y,e,u)),0!==n}function me(t,e,u,n,r,i){if(i>e&&i>n||i<e&&i<n)return 0;if(n===e)return 0;const s=(i-e)/(n-e);let o=n<e?1:-1;1!==s&&0!==s||(o=n<e?.5:-.5);const D=s*(u-t)+t;return D===r?1/0:D>r?o:0}function Ce(t,e){return Math.abs(t-e)<Fe}const pe=t=>{if("string"!=typeof t)throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(ye(),"")},ye=({onlyFirst:t=!1}={})=>{const e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")},xe=t=>{let e=t.charCodeAt(0),u=2===t.length?t.charCodeAt(1):0,n=e;return 55296<=e&&e<=56319&&56320<=u&&u<=57343&&(e&=1023,u&=1023,n=e<<10|u,n+=65536),12288===n||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":8361===n||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||172===n||175===n||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":161===n||164===n||167<=n&&n<=168||170===n||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||198===n||208===n||215<=n&&n<=216||222<=n&&n<=225||230===n||232<=n&&n<=234||236<=n&&n<=237||240===n||242<=n&&n<=243||247<=n&&n<=250||252===n||254===n||257===n||273===n||275===n||283===n||294<=n&&n<=295||299===n||305<=n&&n<=307||312===n||319<=n&&n<=322||324===n||328<=n&&n<=331||333===n||338<=n&&n<=339||358<=n&&n<=359||363===n||462===n||464===n||466===n||468===n||470===n||472===n||474===n||476===n||593===n||609===n||708===n||711===n||713<=n&&n<=715||717===n||720===n||728<=n&&n<=731||733===n||735===n||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||1025===n||1040<=n&&n<=1103||1105===n||8208===n||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||8240===n||8242<=n&&n<=8243||8245===n||8251===n||8254===n||8308===n||8319===n||8321<=n&&n<=8324||8364===n||8451===n||8453===n||8457===n||8467===n||8470===n||8481<=n&&n<=8482||8486===n||8491===n||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||8585===n||8592<=n&&n<=8601||8632<=n&&n<=8633||8658===n||8660===n||8679===n||8704===n||8706<=n&&n<=8707||8711<=n&&n<=8712||8715===n||8719===n||8721===n||8725===n||8730===n||8733<=n&&n<=8736||8739===n||8741===n||8743<=n&&n<=8748||8750===n||8756<=n&&n<=8759||8764<=n&&n<=8765||8776===n||8780===n||8786===n||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||8853===n||8857===n||8869===n||8895===n||8978===n||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||9675===n||9678<=n&&n<=9681||9698<=n&&n<=9701||9711===n||9733<=n&&n<=9734||9737===n||9742<=n&&n<=9743||9748<=n&&n<=9749||9756===n||9758===n||9792===n||9794===n||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||9839===n||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||9955===n||9960<=n&&n<=9983||10045===n||10071===n||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||65533===n||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"},Ee=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function Me(t,e={},u){u||(u=1);const{fontStyle:n=e.fontStyle,fontVariant:r=e.fontVariant,fontWeight:i=e.fontWeight,fontSize:s=e.fontSize,fontFamily:o=e.fontFamily}=t;return(n?n+" ":"")+(r?r+" ":"")+(i?i+" ":"")+s*u+"px "+(o||"sans-serif")}class Be{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=t,this._userSpec=null!=e?e:{},this.textSpec=this._initSpec(),D(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=D(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(o(this._canvas)&&(D(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),o(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&D(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),o(this._context)&&D(this._canvas)){const t=this._canvas.getContext("2d");D(t)&&(t.save(),t.font=Me(this.textSpec),this._contextSaved=!0,this._context=t)}return!o(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,u;const{defaultFontParams:n={}}=this._option,{fontStyle:r=n.fontStyle,fontVariant:i=n.fontVariant,fontWeight:s=(null!==(t=n.fontWeight)&&void 0!==t?t:"normal"),fontSize:o=(null!==(e=n.fontSize)&&void 0!==e?e:12),fontFamily:D=(null!==(u=n.fontFamily)&&void 0!==u?u:"sans-serif"),align:a,textAlign:h=(null!=a?a:"center"),baseline:l,textBaseline:f=(null!=l?l:"middle"),ellipsis:F,limit:d}=this._userSpec;let{lineHeight:g=o}=this._userSpec;if(c(g)&&"%"===g[g.length-1]){const t=Number.parseFloat(g.substring(0,g.length-1))/100;g=o*t}return{fontStyle:r,fontVariant:i,fontFamily:D,fontSize:o,fontWeight:s,textAlign:h,textBaseline:f,ellipsis:F,limit:d,lineHeight:g}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){if(o(t))return{width:0,height:0};if(o(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:u,fontWeight:n,textAlign:r,textBaseline:i,ellipsis:s,limit:D,lineHeight:a}=this.textSpec;let h;try{const o=this._option.getTextBounds({text:t,fontFamily:e,fontSize:u,fontWeight:n,textAlign:r,textBaseline:i,ellipsis:!!s,maxLineWidth:D||1/0,lineHeight:a});h={width:o.width(),height:o.height()}}catch(e){this._notSupportVRender=!0,h=this.measureWithNaiveCanvas(t)}return h}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const u=this._context.measureText(t),{fontSize:n,lineHeight:r}=this.textSpec;return{width:u.width,height:null!==(e=r)&&void 0!==e?e:n,fontBoundingBoxAscent:u.fontBoundingBoxAscent,fontBoundingBoxDescent:u.fontBoundingBoxDescent}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let u=0;u<t.length;u++){const n=t[u];let r=this._measureSpecialChar(n);o(r)&&Be.NUMBERS_CHAR_SET.includes(n)&&(r=this._measureNumberChar()),o(r)&&["F","W"].includes(xe(n))&&(r=this._measureFullSizeChar()),o(r)&&(r=this._measureLetterChar()),e.width+=r.width,e.height=Math.max(e.height,r.height),!o(r.fontBoundingBoxAscent)&&(e.fontBoundingBoxAscent=r.fontBoundingBoxAscent),!o(r.fontBoundingBoxDescent)&&(e.fontBoundingBoxDescent=r.fontBoundingBoxDescent)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){var e;const u={width:0,height:0},{fontSize:n,lineHeight:r}=this.textSpec;for(let e=0;e<t.length;e++){const r=t[e],i=["F","W"].includes(xe(r))?1:.53;u.width+=i*n}return u.height=null!==(e=r)&&void 0!==e?e:n,u}_measureReduce(t,e){var u;const{fontSize:n,lineHeight:r}=this.textSpec,i={width:0,height:0};if(o(t))return i;if(f(t)){const s=t.filter(D).map((t=>t.toString()));return 0===s.length?i:1===s.length?e(s[0]):{width:s.reduce(((t,u)=>Math.max(t,e(u).width)),0),height:s.length*((null!==(u=r)&&void 0!==u?u:n)+1)+1}}return e(t.toString())}_measureNumberChar(){if(o(this._numberCharSize)){const t=this._standardMethod(Be.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/Be.NUMBERS_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._numberCharSize}_measureFullSizeChar(){return o(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(Be.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(o(this._letterCharSize)){const t=this._standardMethod(Be.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/Be.ALPHABET_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._letterCharSize}_measureSpecialChar(t){return D(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){D(this._canvas)&&(this._canvas=null),D(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}Be.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Be.NUMBERS_CHAR_SET="0123456789",Be.FULL_SIZE_CHAR="字";function be(t,e,u){const{x1:n,y1:r,x2:i,y2:s}=e;return u.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(u.e,u.f),e):(t.clear(),t.add(u.a*n+u.c*r+u.e,u.b*n+u.d*r+u.f),t.add(u.a*i+u.c*r+u.e,u.b*i+u.d*r+u.f),t.add(u.a*i+u.c*s+u.e,u.b*i+u.d*s+u.f),t.add(u.a*n+u.c*s+u.e,u.b*n+u.d*s+u.f),e)}class ve{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new ve(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(t=0,e=0,u=0,n=0){return this.x1=t,this.y1=e,this.x2=u,this.y2=n,this}set(t=0,e=0,u=0,n=0){return u<t?(this.x2=t,this.x1=u):(this.x1=t,this.x2=u),n<e?(this.y2=e,this.y1=n):(this.y1=e,this.y2=n),this}add(t=0,e=0){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(t=0){return f(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(t=0,e=0){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(t=0,e=0,u=0){const n=this.rotatedPoints(t,e,u);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])}scale(t=0,e=0,u=0,n=0){const r=this.scalePoints(t,e,u,n);return this.clear().add(r[0],r[1]).add(r[2],r[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(t=0,e=0){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(t=0){return this.x1*=t,this.x2*=t,this}scaleY(t=0){return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return be(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,u){const{x1:n,y1:r,x2:i,y2:s}=this,o=Math.cos(t),D=Math.sin(t),a=e-e*o+u*D,h=u-e*D-u*o;return[o*n-D*r+a,D*n+o*r+h,o*n-D*s+a,D*n+o*s+h,o*i-D*r+a,D*i+o*r+h,o*i-D*s+a,D*i+o*s+h]}scalePoints(t,e,u,n){const{x1:r,y1:i,x2:s,y2:o}=this;return[t*r+(1-t)*u,e*i+(1-e)*n,t*s+(1-t)*u,e*o+(1-e)*n]}}class Ae{constructor(t=1,e=0,u=0,n=1,r=0,i=0){this.a=t,this.b=e,this.c=u,this.d=n,this.e=r,this.f=i}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,u,n,r,i){return!(this.e!==r||this.f!==i||this.a!==t||this.d!==n||this.b!==e||this.c!==u)}setValue(t,e,u,n,r,i){return this.a=t,this.b=e,this.c=u,this.d=n,this.e=r,this.f=i,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,u=this.c,n=this.d,r=this.e,i=this.f,s=new Ae,o=t*n-e*u;return s.a=n/o,s.b=-e/o,s.c=-u/o,s.d=t/o,s.e=(u*i-n*r)/o,s.f=-(t*i-e*r)/o,s}rotate(t){const e=Math.cos(t),u=Math.sin(t),n=this.a*e+this.c*u,r=this.b*e+this.d*u,i=this.a*-u+this.c*e,s=this.b*-u+this.d*e;return this.a=n,this.b=r,this.c=i,this.d=s,this}rotateByCenter(t,e,u){const n=Math.cos(t),r=Math.sin(t),i=(1-n)*e+r*u,s=(1-n)*u-r*e,o=n*this.a-r*this.b,D=r*this.a+n*this.b,a=n*this.c-r*this.d,h=r*this.c+n*this.d,l=n*this.e-r*this.f+i,c=r*this.e+n*this.f+s;return this.a=o,this.b=D,this.c=a,this.d=h,this.e=l,this.f=c,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,u,n,r,i){return this.multiply(t,e,u,n,r,i),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:u,d:n,e:r,f:i}=this;return this.a=e,this.b=t,this.c=n,this.d=u,this.e=i,this.f=r,this}multiply(t,e,u,n,r,i){const s=this.a,o=this.b,D=this.c,a=this.d,h=s*t+D*e,l=o*t+a*e,c=s*u+D*n,f=o*u+a*n,F=s*r+D*i+this.e,d=o*r+a*i+this.f;return this.a=h,this.b=l,this.c=c,this.d=f,this.e=F,this.f=d,this}interpolate(t,e){const u=new Ae;return u.a=this.a+(t.a-this.a)*e,u.b=this.b+(t.b-this.b)*e,u.c=this.c+(t.c-this.c)*e,u.d=this.d+(t.d-this.d)*e,u.e=this.e+(t.e-this.e)*e,u.f=this.f+(t.f-this.f)*e,u}transformPoint(t,e){const{a:u,b:n,c:r,d:i,e:s,f:o}=this,D=u*i-n*r,a=i/D,h=-n/D,l=-r/D,c=u/D,f=(r*o-i*s)/D,F=-(u*o-n*s)/D,{x:d,y:g}=t;e.x=d*a+g*l+f,e.y=d*h+g*c+F}onlyTranslate(t=1){return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new Ae(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,u=this.c,n=this.d,r=t*n-e*u,i={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const s=Math.sqrt(t*t+e*e);i.rotateDeg=e>0?Math.acos(t/s):-Math.acos(t/s),i.scaleX=s,i.scaleY=r/s,i.skewX=(t*u+e*n)/r,i.skewY=0}else if(0!==u||0!==n){const s=Math.sqrt(u*u+n*n);i.rotateDeg=Math.PI/2-(n>0?Math.acos(-u/s):-Math.acos(u/s)),i.scaleX=r/s,i.scaleY=s,i.skewX=0,i.skewY=(t*u+e*n)/r}return i.rotateDeg=Tt(i.rotateDeg),i}}function we(t,e,u){e/=100,u/=100;const n=(1-Math.abs(2*u-1))*e,r=n*(1-Math.abs(t/60%2-1)),i=u-n/2;let s=0,o=0,D=0;return 0<=t&&t<60?(s=n,o=r,D=0):60<=t&&t<120?(s=r,o=n,D=0):120<=t&&t<180?(s=0,o=n,D=r):180<=t&&t<240?(s=0,o=r,D=n):240<=t&&t<300?(s=r,o=0,D=n):300<=t&&t<360&&(s=n,o=0,D=r),s=Math.round(255*(s+i)),o=Math.round(255*(o+i)),D=Math.round(255*(D+i)),{r:s,g:o,b:D}}function Se(t,e,u){t/=255,e/=255,u/=255;const n=Math.min(t,e,u),r=Math.max(t,e,u),i=r-n;let s=0,o=0,D=0;return s=0===i?0:r===t?(e-u)/i%6:r===e?(u-t)/i+2:(t-e)/i+4,s=Math.round(60*s),s<0&&(s+=360),D=(r+n)/2,o=0===i?0:i/(1-Math.abs(2*D-1)),o=+(100*o).toFixed(1),D=+(100*D).toFixed(1),{h:s,s:o,l:D}}const Te=/^#([0-9a-f]{3,8})$/,_e={transparent:4294967040},Le={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Ne(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function ke(t){return g(t)?new Re(t>>16,t>>8&255,255&t,1):f(t)?new Re(t[0],t[1],t[2]):new Re(255,255,255)}function Ie(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Ue(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const He=(t,e)=>{const u=Te.exec(t);if(e||u){const t=parseInt(u[1],16),e=u[1].length;return 3===e?new Re((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?ke(t):8===e?new Re(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class Oe{static Brighter(t,e=1){return 1===e?t:new Oe(t).brighter(e).toRGBA()}static SetOpacity(t,e=1){return 1===e?t:new Oe(t).setOpacity(e).toRGBA()}static getColorBrightness(t,e="hsl"){const u=t instanceof Oe?t:new Oe(t);switch(e){case"hsv":default:return u.getHSVBrightness();case"hsl":return u.getHSLBrightness();case"lum":return u.getLuminance();case"lum2":return u.getLuminance2();case"lum3":return u.getLuminance3()}}static parseColorString(t){if(D(_e[t]))return function(t){return g(t)?new Re(t>>>24,t>>>16&255,t>>>8&255,255&t):f(t)?new Re(t[0],t[1],t[2],t[3]):new Re(255,255,255,1)}(_e[t]);if(D(Le[t]))return ke(Le[t]);const e=`${t}`.trim().toLowerCase(),u=He(e);if(void 0!==u)return u;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new Re(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const t=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),u=we(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new Re(u.r,u.g,u.b,parseFloat(t[3]))}}constructor(t){const e=Oe.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new Re(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:u,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(u*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t))),this}add(t){const{r:e,g:u,b:n}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,u+t.color.g),this.color.b+=Math.min(255,n+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:u,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(u*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,u){const n=this.color.opacity,r=Se(this.color.r,this.color.g,this.color.b),i=we(o(t)?r.h:J(t,0,360),o(e)?r.s:e>=0&&e<=1?100*e:e,o(u)?r.l:u<=1&&u>=0?100*u:u);return this.color=new Re(i.r,i.g,i.b,n),this}setRGB(t,e,u){return!o(t)&&(this.color.r=t),!o(e)&&(this.color.g=e),!o(u)&&(this.color.b=u),this}setHex(t){const e=`${t}`.trim().toLowerCase(),u=He(e,!0);return null!=u?u:this}setColorName(t){const e=Le[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(t=1){return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}clone(){return new Oe(this.color.toString())}copyGammaToLinear(t,e=2){return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t,e=2){const u=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,u),this.color.g=Math.pow(t.color.g,u),this.color.b=Math.pow(t.color.b,u),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=Ie(t.color.r),this.color.g=Ie(t.color.g),this.color.b=Ie(t.color.b),this}copyLinearToSRGB(t){return this.color.r=Ue(t.color.r),this.color.g=Ue(t.color.g),this.color.b=Ue(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class Re{constructor(t,e,u,n){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+u)?255:Math.max(0,Math.min(255,+u)),D(n)?this.opacity=isNaN(+n)?1:Math.max(0,Math.min(1,+n)):this.opacity=1}formatHex(){return`#${Ne(this.r)+Ne(this.g)+Ne(this.b)+(1===this.opacity?"":Ne(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:u,l:n}=Se(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${u}%,${n}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}function Pe(t){let e="",u="",n="";const r="#"===t[0]?1:0;for(let i=r;i<t.length;i++)"#"!==t[i]&&(i<r+2?e+=t[i]:i<r+4?u+=t[i]:i<r+6&&(n+=t[i]));return[parseInt(e,16),parseInt(u,16),parseInt(n,16)]}function ze(t,e,u){return Number((1<<24)+(t<<16)+(e<<8)+u).toString(16).slice(1)}function We(t,e){const u=t.r,n=e.r,r=t.g,i=e.g,s=t.b,o=e.b,D=t.opacity,a=e.opacity;return t=>{const e=Math.round(u*(1-t)+n*t),h=Math.round(r*(1-t)+i*t),l=Math.round(s*(1-t)+o*t);return new Re(e,h,l,D*(1-t)+a*t)}}var je=Object.freeze({__proto__:null,Color:Oe,DEFAULT_COLORS:Le,RGB:Re,hexToRgb:Pe,hslToRgb:we,interpolateRgb:We,rgbToHex:ze,rgbToHsl:Se});function Ye(t){return t?"getUTCFullYear":"getFullYear"}function qe(t){return t?"getUTCMonth":"getMonth"}function Ve(t){return t?"getUTCDate":"getDate"}function Ge(t){return t?"getUTCHours":"getHours"}function $e(t){return t?"getUTCMinutes":"getMinutes"}function Xe(t){return t?"getUTCSeconds":"getSeconds"}function Ze(t){return t?"getUTCMilliseconds":"getMilliseconds"}const Je=1e3,Qe=6e4,Ke=36e5,tu=24*Ke,eu=t=>(t.setMonth(0,1),t.setHours(0,0,0,0),t),uu=(t,e)=>(t.setFullYear(t.getFullYear()+e),t),nu=(t,e)=>e.getFullYear()-t.getFullYear(),ru=t=>t.getFullYear(),iu=t=>(t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0),t),su=(t,e)=>(t.setUTCFullYear(t.getUTCFullYear()+e),t),ou=(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),Du=t=>t.getUTCFullYear(),au=t=>(t.setDate(1),t.setHours(0,0,0,0),t),hu=(t,e)=>(t.setMonth(t.getMonth()+e),t),lu=(t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear()),cu=t=>t.getMonth(),fu=t=>(t.setUTCDate(1),t.setUTCHours(0,0,0,0),t),Fu=(t,e)=>(t.setUTCMonth(t.getUTCMonth()+e),t),du=(t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear()),gu=t=>t.getUTCMonth(),mu=t=>(t.setHours(0,0,0,0),t),Cu=(t,e)=>(t.setDate(t.getDate()+e),t),pu=(t,e)=>(+e-+t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Qe)/tu,yu=t=>t.getDate()-1,xu=t=>(t.setUTCHours(0,0,0,0),t),Eu=(t,e)=>(t.setUTCDate(t.getUTCDate()+e),t),Mu=(t,e)=>(+e-+t)/tu,Bu=t=>t.getUTCDate()-1,bu=t=>(t.setTime(+t-t.getMilliseconds()-t.getSeconds()*Je-t.getMinutes()*Qe),t),vu=(t,e)=>(t.setHours(t.getHours()+e),t),Au=(t,e)=>(+e-+t)/Ke,wu=t=>t.getHours(),Su=t=>(t.setTime(+t-t.getUTCMilliseconds()-t.getUTCSeconds()*Je-t.getUTCMinutes()*Qe),t),Tu=(t,e)=>(t.setUTCHours(t.getUTCHours()+e),t),_u=t=>t.getUTCHours(),Lu=t=>(t.setTime(+t-t.getMilliseconds()-t.getSeconds()*Je),t),Nu=(t,e)=>(t.setMinutes(t.getMinutes()+e),t),ku=(t,e)=>(+e-+t)/Qe,Iu=t=>t.getMinutes(),Uu=t=>(t.setTime(+t-t.getUTCMilliseconds()-t.getUTCSeconds()*Je),t),Hu=(t,e)=>(t.setUTCMinutes(t.getUTCMinutes()+e),t),Ou=t=>t.getUTCMinutes(),Ru=t=>(t.setTime(+t-t.getMilliseconds()),t),Pu=(t,e)=>(t.setSeconds(t.getSeconds()+e),t),zu=(t,e)=>(+e-+t)/Je,Wu=t=>t.getSeconds(),ju=t=>(t.setTime(+t-t.getUTCMilliseconds()),t),Yu=(t,e)=>(t.setUTCSeconds(t.getUTCSeconds()+e),t),qu=t=>t.getUTCSeconds(),Vu=t=>t,Gu=(t,e)=>(t.setTime(+t+e),t),$u=(t,e)=>+e-+t,Xu=(t,e)=>u=>{const n=new Date(+u-1);return e(n,1),t(n),n},Zu=(t,e)=>(u,n)=>{const r=new Date,i=new Date;return r.setTime(+u),i.setTime(+n),t(r),t(i),Math.floor(e(r,i))};function Ju(t){const{x:e,y:u}=t.getBoundingClientRect();return{x:e,y:u}}const Qu=t=>t.getBoundingClientRect().width/t.offsetWidth,Ku=t=>t.getBoundingClientRect().height/t.offsetHeight;var tn=6371008.8,en={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*tn,kilometers:6371.0088,kilometres:6371.0088,meters:tn,metres:tn,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:tn/1852,radians:1,yards:6967335.223679999};const un=1e-10;function nn(t,e){for(let u=0;u<e.length;++u)if(At.distancePP(t,e[u])>e[u].radius+un)return!1;return!0}function rn(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function sn(t,e){const u=At.distancePP(t,e),n=t.radius,r=e.radius;if(u>=n+r||u<=Math.abs(n-r))return[];const i=(n*n-r*r+u*u)/(2*u),s=Math.sqrt(n*n-i*i),o=t.x+i*(e.x-t.x)/u,D=t.y+i*(e.y-t.y)/u,a=-(e.y-t.y)*(s/u),h=-(e.x-t.x)*(s/u);return[{x:o+a,y:D-h},{x:o-a,y:D+h}]}function on(t){const e={x:0,y:0};for(let u=0;u<t.length;++u)e.x+=t[u].x,e.y+=t[u].y;return e.x/=t.length,e.y/=t.length,e}class Dn{static getInstance(){return Dn.instance||(Dn.instance=new Dn),Dn.instance}constructor(){this.locale_shortWeekdays=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],this.locale_periods=["AM","PM"],this.locale_weekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],this.locale_shortMonths=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],this.numberRe=/^\s*\d+/,this.pads={"-":"",_:" ",0:"0"},this.requoteRe=/[\\^$*+?|[\]().{}]/g,this.locale_months=["January","February","March","April","May","June","July","August","September","October","November","December"],this.formatShortWeekday=t=>this.locale_shortWeekdays[t.getDay()],this.formatWeekday=t=>this.locale_weekdays[t.getDay()],this.formatShortMonth=t=>this.locale_shortMonths[t.getMonth()],this.formatMonth=t=>this.locale_months[t.getMonth()],this.formatDayOfMonth=(t,e)=>this.pad(t.getDate(),e,2),this.formatHour24=(t,e)=>this.pad(t.getHours(),e,2),this.formatHour12=(t,e)=>this.pad(t.getHours()%12||12,e,2),this.formatMilliseconds=(t,e)=>this.pad(t.getMilliseconds(),e,3),this.formatMonthNumber=(t,e)=>this.pad(t.getMonth()+1,e,2),this.formatMinutes=(t,e)=>this.pad(t.getMinutes(),e,2),this.formatPeriod=t=>this.locale_periods[+(t.getHours()>=12)],this.formatSeconds=(t,e)=>this.pad(t.getSeconds(),e,2),this.formatFullYear=(t,e)=>this.pad(t.getFullYear()%1e4,e,4),this.formatUTCShortWeekday=t=>this.locale_shortWeekdays[t.getUTCDay()],this.formatUTCWeekday=t=>this.locale_weekdays[t.getUTCDay()],this.formatUTCShortMonth=t=>this.locale_shortMonths[t.getUTCMonth()],this.formatUTCMonth=t=>this.locale_months[t.getUTCMonth()],this.formatUTCDayOfMonth=(t,e)=>this.pad(t.getUTCDate(),e,2),this.formatUTCHour24=(t,e)=>this.pad(t.getUTCHours(),e,2),this.formatUTCHour12=(t,e)=>this.pad(t.getUTCHours()%12||12,e,2),this.formatUTCMilliseconds=(t,e)=>this.pad(t.getUTCMilliseconds(),e,3),this.formatUTCMonthNumber=(t,e)=>this.pad(t.getUTCMonth()+1,e,2),this.formatUTCMinutes=(t,e)=>this.pad(t.getUTCMinutes(),e,2),this.formatUTCPeriod=t=>this.locale_periods[+(t.getUTCHours()>=12)],this.formatUTCSeconds=(t,e)=>this.pad(t.getUTCSeconds(),e,2),this.formatUTCFullYear=(t,e)=>this.pad(t.getUTCFullYear()%1e4,e,4),this.formats={a:this.formatShortWeekday,A:this.formatWeekday,b:this.formatShortMonth,B:this.formatMonth,d:this.formatDayOfMonth,e:this.formatDayOfMonth,H:this.formatHour24,I:this.formatHour12,L:this.formatMilliseconds,m:this.formatMonthNumber,M:this.formatMinutes,p:this.formatPeriod,S:this.formatSeconds,Y:this.formatFullYear},this.utcFormats={a:this.formatUTCShortWeekday,A:this.formatUTCWeekday,b:this.formatUTCShortMonth,B:this.formatUTCMonth,d:this.formatUTCDayOfMonth,e:this.formatUTCDayOfMonth,H:this.formatUTCHour24,I:this.formatUTCHour12,L:this.formatUTCMilliseconds,m:this.formatUTCMonthNumber,M:this.formatUTCMinutes,p:this.formatUTCPeriod,S:this.formatUTCSeconds,Y:this.formatUTCFullYear},this.parseShortWeekday=(t,e,u)=>{const n=this.shortWeekdayRe.exec(e.slice(u));return n?(t.w=this.shortWeekdayLookup.get(n[0].toLowerCase()),u+n[0].length):-1},this.parseWeekday=(t,e,u)=>{const n=this.weekdayRe.exec(e.slice(u));return n?(t.w=this.weekdayLookup.get(n[0].toLowerCase()),u+n[0].length):-1},this.parseShortMonth=(t,e,u)=>{const n=this.shortMonthRe.exec(e.slice(u));return n?(t.m=this.shortMonthLookup.get(n[0].toLowerCase()),u+n[0].length):-1},this.parseMonth=(t,e,u)=>{const n=this.monthRe.exec(e.slice(u));return n?(t.m=this.monthLookup.get(n[0].toLowerCase()),u+n[0].length):-1},this.parseDayOfMonth=(t,e,u)=>{const n=this.numberRe.exec(e.slice(u,u+2));return n?(t.d=+n[0],u+n[0].length):-1},this.parseHour24=(t,e,u)=>{const n=this.numberRe.exec(e.slice(u,u+2));return n?(t.H=+n[0],u+n[0].length):-1},this.parseMilliseconds=(t,e,u)=>{const n=this.numberRe.exec(e.slice(u,u+3));return n?(t.L=+n[0],u+n[0].length):-1},this.parseMonthNumber=(t,e,u)=>{const n=this.numberRe.exec(e.slice(u,u+2));return n?(t.m=n-1,u+n[0].length):-1},this.parseMinutes=(t,e,u)=>{const n=this.numberRe.exec(e.slice(u,u+2));return n?(t.M=+n[0],u+n[0].length):-1},this.parsePeriod=(t,e,u)=>{const n=this.periodRe.exec(e.slice(u));return n?(t.p=this.periodLookup.get(n[0].toLowerCase()),u+n[0].length):-1},this.parseSeconds=(t,e,u)=>{const n=this.numberRe.exec(e.slice(u,u+2));return n?(t.S=+n[0],u+n[0].length):-1},this.parseFullYear=(t,e,u)=>{const n=this.numberRe.exec(e.slice(u,u+4));return n?(t.y=+n[0],u+n[0].length):-1},this.parses={a:this.parseShortWeekday,A:this.parseWeekday,b:this.parseShortMonth,B:this.parseMonth,d:this.parseDayOfMonth,e:this.parseDayOfMonth,H:this.parseHour24,I:this.parseHour24,L:this.parseMilliseconds,m:this.parseMonthNumber,M:this.parseMinutes,p:this.parsePeriod,S:this.parseSeconds,Y:this.parseFullYear},this.timeFormat=(t,e)=>this.newFormat(t,this.formats)(new Date(this.getFullTimeStamp(e))),this.timeUTCFormat=(t,e)=>this.newFormat(t,this.utcFormats)(new Date(this.getFullTimeStamp(e))),this.timeParse=(t,e)=>this.newParse(t,!1)(e+""),this.requoteF=this.requote.bind(this),this.periodRe=this.formatRe(this.locale_periods),this.periodLookup=this.formatLookup(this.locale_periods),this.weekdayRe=this.formatRe(this.locale_weekdays),this.weekdayLookup=this.formatLookup(this.locale_weekdays),this.shortWeekdayRe=this.formatRe(this.locale_shortWeekdays),this.shortWeekdayLookup=this.formatLookup(this.locale_shortWeekdays),this.monthRe=this.formatRe(this.locale_months),this.monthLookup=this.formatLookup(this.locale_months),this.shortMonthRe=this.formatRe(this.locale_shortMonths),this.shortMonthLookup=this.formatLookup(this.locale_shortMonths)}requote(t){return t.replace(this.requoteRe,"\\$&")}localDate(t){if(0<=t.y&&t.y<100){const e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}utcDate(t){if(0<=t.y&&t.y<100){const e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}newDate(t,e,u){return{y:t,m:e,d:u,H:0,M:0,S:0,L:0}}formatRe(t){return new RegExp("^(?:"+t.map(this.requoteF).join("|")+")","i")}formatLookup(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}pad(t,e,u){const n=t<0?"-":"",r=(n?-t:t)+"",i=r.length;return n+(i<u?new Array(u-i+1).join(e)+r:r)}parseSpecifier(t,e,u,n){let r=0;const i=e.length,s=u.length;let o,D;for(;r<i;){if(n>=s)return-1;if(o=e.charCodeAt(r++),37===o){if(o=e.charAt(r++),D=this.parses[o in this.pads?e.charAt(r++):o],!D||(n=D(t,u,n))<0)return-1}else if(o!==u.charCodeAt(n++))return-1}return n}newParse(t,e){const u=this;return function(n){const r=u.newDate(1900,void 0,1);return u.parseSpecifier(r,t,n+="",0)!==n.length?null:"Q"in r?new Date(r.Q):"s"in r?new Date(1e3*r.s+("L"in r?r.L:0)):(e&&!("Z"in r)&&(r.Z=0),"p"in r&&(r.H=r.H%12+12*r.p),void 0===r.m&&(r.m="q"in r?r.q:0),"Z"in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,u.utcDate(r)):u.localDate(r))}}newFormat(t,e){const u=this;return function(n){const r=[];let i=-1,s=0;const o=t.length;let D,a,h;for(n instanceof Date||(n=new Date(+n));++i<o;)37===t.charCodeAt(i)&&(r.push(t.slice(s,i)),(a=u.pads[D=t.charAt(++i)])?D=t.charAt(++i):a="e"===D?" ":"0",h=e[D],D=h(n,a),r.push(D),s=i+1);return r.push(t.slice(s,i)),r.join("")}}getFullTimeStamp(t){const e=parseInt(t+"",10);return 10===String(e).length?1e3*e:e}}function an(t,e){const u=e?t.toExponential(e-1):t.toExponential(),n=u.indexOf("e");if(n<0)return null;const r=u.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+u.slice(n+1)]}let hn;function ln(t,e){const u=an(t,e);if(!u)return t+"";const n=u[0],r=u[1];return r<0?"0."+new Array(-r).join("0")+n:n.length>r+1?n.slice(0,r+1)+"."+n.slice(r+1):n+new Array(r-n.length+2).join("0")}class cn{constructor(t={}){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}toString(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type}}const fn=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Fn(t){let e;if(e=fn.exec(t))return new cn({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]});P.getInstance().error("invalid format: "+t)}const dn=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];class gn{constructor(){var t,e;this.locale={thousands:",",grouping:[3],currency:["$",""]},this.group=void 0===this.locale.grouping||void 0===this.locale.thousands?t=>t:(t=[...this.locale.grouping].map(Number),e=`${this.locale.thousands}`,function(u,n){let r=u.length;const i=[];let s=0,o=t[0],D=0;for(;r>0&&o>0&&(D+o+1>n&&(o=Math.max(1,n-D)),i.push(u.substring(r-=o,r+o)),!((D+=o+1)>n));)o=t[s=(s+1)%t.length];return i.reverse().join(e)}),this.currencyPrefix=void 0===this.locale.currency?"":this.locale.currency[0]+"",this.currencySuffix=void 0===this.locale.currency?"":this.locale.currency[1]+"",this.decimal=void 0===this.locale.decimal?".":this.locale.decimal+"",this.numerals=void 0===this.locale.numerals?t=>t:pn([...this.locale.numerals].map(String)),this.percent=void 0===this.locale.percent?"%":this.locale.percent+"",this.minus=void 0===this.locale.minus?"−":this.locale.minus+"",this.nan=void 0===this.locale.nan?"NaN":this.locale.nan+"",this.formatter=t=>this.newFormat(t),this.format=(t,e)=>this.formatter(t)(e),this.formatPrefix=(t,e)=>this._formatPrefix(t,e)}static getInstance(){return gn.instance||(gn.instance=new gn),gn.instance}newFormat(t){const e=Fn(t);let u=e.fill,n=e.align;const r=e.sign,i=e.symbol;let s=e.zero;const o=e.width;let D=e.comma,a=e.precision,h=e.trim,l=e.type;"n"===l?(D=!0,l="g"):mn[l]||(void 0===a&&(a=12),h=!0,l="g"),(s||"0"===u&&"="===n)&&(s=!0,u="0",n="=");const c="$"===i?this.currencyPrefix:"#"===i&&/[boxX]/.test(l)?"0"+l.toLowerCase():"",f="$"===i?this.currencySuffix:/[%p]/.test(l)?this.percent:"",F=mn[l],d=/[defgprstz%]/.test(l);a=void 0===a?6:/[gprs]/.test(l)?Math.max(1,Math.min(21,a)):Math.max(0,Math.min(20,a));const{nan:g,minus:m,decimal:C,group:p,numerals:y}=this;function x(t){let e,i,x,E=c,M=f,B=t;if("c"===l)M=F(B)+M,B="";else{B=+B;let t=B<0||1/B<0;if(B=isNaN(B)?g:F(Math.abs(B),a),h&&(B=function(t){const e=t.length;let u,n=-1;t:for(let r=1;r<e;++r)switch(t[r]){case".":n=u=r;break;case"0":0===n&&(n=r),u=r;break;default:if(!+t[r])break t;n>0&&(n=0)}return n>0?t.slice(0,n)+t.slice(u+1):t}(B)),t&&0==+B&&"+"!==r&&(t=!1),E=(t?"("===r?r:m:"-"===r||"("===r?"":r)+E,M=("s"===l?dn[8+hn/3]:"")+M+(t&&"("===r?")":""),d)for(e=-1,i=B.length;++e<i;)if(x=B.charCodeAt(e),48>x||x>57){M=(46===x?C+B.slice(e+1):B.slice(e))+M,B=B.slice(0,e);break}}D&&!s&&(B=p(B,1/0));let b=E.length+B.length+M.length,v=b<o?new Array(o-b+1).join(u):"";switch(D&&s&&(B=p(v+B,v.length?o-M.length:1/0),v=""),n){case"<":B=E+B+M+v;break;case"=":B=E+v+B+M;break;case"^":B=v.slice(0,b=v.length>>1)+E+B+M+v.slice(b);break;default:B=v+E+B+M}return y(B)}return x.toString=function(){return t+""},x}_formatPrefix(t,e){const u=Fn(t);u.type="f";const n=this.newFormat(u.toString()),r=3*Math.max(-8,Math.min(8,Math.floor(Cn(e)/3))),i=Math.pow(10,-r),s=dn[8+r/3];return function(t){return n(i*t)+s}}}const mn={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},f:(t,e)=>t.toFixed(e),e:(t,e)=>t.toExponential(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>ln(100*t,e),r:ln,s:function(t,e){const u=an(t,e);if(!u)return t+"";const n=u[0],r=u[1],i=r-(hn=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,s=n.length;return i===s?n:i>s?n+new Array(i-s+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+an(t,Math.max(0,e+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16),t:(t,e)=>Number.isInteger(t)?t.toFixed(2):Math.floor(t*Math.pow(10,e))/Math.pow(10,e)+"",z:(t,e)=>t%1==0?t+"":t.toFixed(e)};function Cn(t){const e=an(Math.abs(t));return e?e[1]:NaN}function pn(t){return function(e){return e.replace(/[0-9]/g,(e=>t[+e]))}}function yn(t){const e=new Array(t);for(let u=0;u<t;++u)e[u]=0;return e}function xn(t){return Math.sqrt(Et(t,t))}function En(t,e,u){for(let n=0;n<e.length;++n)t[n]=e[n]*u}function Mn(t,e,u,n,r){for(let i=0;i<t.length;++i)t[i]=e*u[i]+n*r[i]}function Bn(t,e,u,n,r,i,s){const o=u.fx,D=Et(u.fxprime,e);let a=o,h=o,l=D,c=0;function f(h,c,f){for(let F=0;F<16;++F)if(r=(h+c)/2,Mn(n.x,1,u.x,r,e),a=n.fx=t(n.x,n.fxprime),l=Et(n.fxprime,e),a>o+i*r*D||a>=f)c=r;else{if(Math.abs(l)<=-s*D)return r;l*(c-h)>=0&&(c=h),h=r,f=a}return 0}r=r||1,i=i||1e-6,s=s||.1;for(let F=0;F<10;++F){if(Mn(n.x,1,u.x,r,e),a=n.fx=t(n.x,n.fxprime),l=Et(n.fxprime,e),a>o+i*r*D||F&&a>=h)return f(c,r,h);if(Math.abs(l)<=-s*D)return r;if(l>=0)return f(r,c,a);h=a,c=r,r*=2}return r}t.AABBBounds=class extends ve{},t.Bounds=ve,t.Color=Oe,t.ColorUtil=je,t.DAY=tu,t.DEFAULT_COLORS=Le,t.EventEmitter=n,t.FormatSpecifier=cn,t.GraphicUtil=fe,t.HOUR=Ke,t.HashTable=class{constructor(){this.items={},this.itemList=[]}get type(){return"xhHashTable"}set(t,e){const u=new it;u.key=t,u.value=e;let n=this.itemList.length;return this.has(t)&&(n=this.items[t].index),u.index=n,this.itemList[n]=u,this.items[t]=u,u}clear(){this.items={},this.itemList=[]}del(t){if(this.has(t)){const e=this.items[t].index;e>-1&&this.itemList.splice(e,1),delete this.items[t],this.resetIndex()}}delFrom(t){for(let e=t+1;e<this.count();e++){const t=this.itemList[e].key;delete this.items[t]}this.itemList.splice(t+1,this.count()-t),this.resetIndex()}resetIndex(){this.foreachHashv(((t,e)=>{const u=this.itemList.indexOf(e);this.items[t].index=u}))}has(t){return t in this.items}get(t){return this.has(t)?this.items[t].value:null}count(){return this.itemList.length}all(){return this.itemList.map((t=>t.value))}first(){return this.itemList[0].value}last(){return this.itemList[this.itemList.length-1].value}getByIndex(t){return this.itemList[t].value}getKeyByIndex(t){return this.itemList[t].key}foreach(t){for(const e in this.items){if(!1===t(e,this.items[e].value))return!1}return!0}foreachHashv(t){for(const e in this.items){if(!1===t(e,this.items[e]))return!1}return!0}hasValue(t){for(const e in this.items)if(this.items[e].value===t)return!0;return!1}indexOf(t){return this.has(t)?this.items[t].index:-1}insertAt(t,e,u){const n=new it;n.index=t,n.key=u,n.value=e,this.itemList.splice(t,0,n),this.items[u]=n,this.resetIndex()}sort(t){return this.itemList.sort(((e,u)=>t(e.value,u.value)))}toArray(){return this.itemList.slice(0,this.itemList.length).map((t=>t.value))}push(t){t.foreach(((t,e)=>{this.set(t,e)}))}mapKey(){const t=[];for(const e in this.items)t.push(e);return t}toImmutableMap(){}},t.HashValue=it,t.LRU=class{constructor(){this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}clearCache(t,e){const{CLEAN_THRESHOLD:u=this.CLEAN_THRESHOLD,L_TIME:n=this.L_TIME,R_COUNT:r=this.R_COUNT}=e;if(t.size<u)return 0;let i=0;const s=e=>{i++,t.delete(e)},o=Date.now();return t.forEach(((t,e)=>{if(t.timestamp.length<r)return s(e);let u=0;for(;o-t.timestamp[t.timestamp.length-1-u]<n&&(u++,!(u>=r)););if(u<r)return s(e);for(;o-t.timestamp[0]>n;)t.timestamp.shift()})),i}addLimitedTimestamp(t,e,u){const{R_TIMESTAMP_MAX_SIZE:n=this.R_TIMESTAMP_MAX_SIZE}=u;t.timestamp.length>n&&t.timestamp.shift(),t.timestamp.push(e)}clearTimeStamp(t,e){const{L_TIME:u=this.L_TIME}=e,n=Date.now();t.forEach((t=>{for(;n-t.timestamp[0]>u;)t.timestamp.shift()}))}clearItemTimestamp(t,e){const{L_TIME:u=this.L_TIME}=e,n=Date.now();for(;n-t.timestamp[0]>u;)t.timestamp.shift()}},t.Logger=P,t.MINUTE=Qe,t.MONTH=26784e5,t.Matrix=Ae,t.NEWTON_ITERATIONS=4,t.NEWTON_MIN_SLOPE=.001,t.NumberUtil=gn,t.OBBBounds=class extends ve{constructor(t,e=0){super(t),t&&(this.angle=e)}intersects(t){return Vt(this,t)}setValue(t=0,e=0,u=0,n=0,r=0){return super.setValue(t,e,u,n),this.angle=r,this}},t.Point=vt,t.PointService=At,t.PolarPoint=wt,t.RGB=Re,t.SECOND=Je,t.SMALL=un,t.SUBDIVISION_MAX_ITERATIONS=10,t.SUBDIVISION_PRECISION=1e-7,t.TextMeasure=Be,t.TimeUtil=Dn,t.YEAR=31536e6,t.abs=lt,t.acos=function(t){return t>1?0:t<-1?ot:Math.acos(t)},t.array=L,t.arrayEqual=function(t,e){if(!f(t)||!f(e))return!1;if(t.length!==e.length)return!1;for(let u=0;u<t.length;u++)if(t[u]!==e[u])return!1;return!0},t.ascending=k,t.asin=function(t){return t>=1?Dt:t<=-1?-Dt:Math.asin(t)},t.atan2=ct,t.baseMerge=E,t.binaryFuzzySearch=(t,e)=>z(0,t.length,(u=>e(t[u]))),t.binaryFuzzySearchInNumberRange=z,t.bisect=function(t,e,u=0,n){for(o(n)&&(n=t.length);u<n;){const r=u+n>>>1;k(t[r],e)>0?n=r:u=r+1}return u},t.calculateAnchorOfArc=(t,e)=>{const{startAngle:u,endAngle:n,innerRadius:r,outerRadius:i}=t;let s=(u+n)/2,o=(r+i)/2;switch(e){case"inner-start":s=u,o=r;break;case"outer-start":s=u,o=i;break;case"inner-end":s=n,o=r;break;case"outer-end":s=n,o=i;break;case"inner-middle":o=r;break;case"outer-middle":o=i}return{angle:s,radius:o}},t.calculateAnchorOfBounds=(t,e)=>{const{x1:u,x2:n,y1:r,y2:i}=t,s=Math.abs(n-u),o=Math.abs(i-r);let D=(u+n)/2,a=(r+i)/2,h=0,l=0;switch(e){case"top":case"inside-top":l=-.5;break;case"bottom":case"inside-bottom":l=.5;break;case"left":case"inside-left":h=-.5;break;case"right":case"inside-right":h=.5;break;case"top-right":h=.5,l=-.5;break;case"top-left":h=-.5,l=-.5;break;case"bottom-right":h=.5,l=.5;break;case"bottom-left":h=-.5,l=.5}return D+=h*s,a+=l*o,{x:D,y:a}},t.calculateMaxRadius=function(t,e,u,n){const{x:r,y:i}=e,s=Ut(u,n),{width:o,height:D}=t,a=[];return s.forEach((t=>{const e=Math.sin(t),u=Math.cos(t);1===e?a.push(D-i):-1===e?a.push(i):1===u?a.push(o-r):-1===u?a.push(r):(e>0?a.push(Math.abs((D-i)/e)):a.push(Math.abs(i/e)),u>0?a.push(Math.abs((o-r)/u)):a.push(Math.abs(r/u)))})),Math.min.apply(null,a)},t.cartesianToPolar=function(t,e={x:0,y:0},u=0,n=2*Math.PI){const{x:r,y:i}=t,{x:s,y:o}=e;let D=r-s,a=i-o;const h=Math.sqrt(D*D+a*a);if(0===h)return{radius:0,angle:0};D/=h,a/=h;let l=Math.atan2(a,D);if(l<u)for(;l<=u;)l+=2*Math.PI;if(l>n)for(;l>=n;)l-=2*Math.PI;return{radius:h,angle:l}},t.circleArea=rn,t.circleCircleIntersection=sn,t.circleOverlap=function(t,e,u){if(u>=t+e)return 0;if(u<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const n=e-(u*u-t*t+e*e)/(2*u);return rn(t,t-(u*u-e*e+t*t)/(2*u))+rn(e,n)},t.clamp=J,t.clampAngleByDegree=kt,t.clampAngleByRadian=Lt,t.clampDegree=Nt,t.clampRadian=_t,t.clampRange=(t,e,u)=>{let[n,r]=t;r<n&&(n=t[1],r=t[0]);const i=r-n;return i>=u-e?[e,u]:(n=Math.min(Math.max(n,e),u-i),[n,n+i])},t.clamper=function(t,e){let u;return t>e&&(u=t,t=e,e=u),u=>Math.max(t,Math.min(e,u))},t.clone=function(t,e=!1,u=0,n=void 0){const r=[],i=[];return void 0===e&&(e=!0),void 0===u&&(u=1/0),function t(u,s){if(null===u)return null;if(0===s)return u;let o;if("object"!=typeof u)return u;if(f(u)?o=[]:C(u)?(o=new RegExp(u.source,function(t){let e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}(u)),u.lastIndex&&(o.lastIndex=u.lastIndex)):o=d(u)?new Date(u.getTime()):void 0===n?Object.create(Object.getPrototypeOf(u)):Object.create(n),e){const t=r.indexOf(u);if(-1!==t)return i[t];r.push(u),i.push(o)}for(const e in u)o[e]=t(u[e],s-1);return o}(t,u)},t.cloneDeep=function t(e,u,n){let r;if(!D(e)||"object"!=typeof e||u&&u(e))return e;const s=f(e),o=e.length;r=s?new Array(o):"object"==typeof e?{}:i(e)||g(e)||c(e)?e:d(e)?new Date(+e):void 0;const a=s?void 0:Object.keys(Object(e));let h=-1;if(r)for(;++h<(a||e).length;){const i=a?a[h]:h,s=e[i];n&&n.includes(i.toString())?r[i]=s:r[i]=t(s,u,n)}return r},t.computeQuadrant=function(t){return(t=It(t))>0&&t<=Math.PI/2?2:t>Math.PI/2&&t<=Math.PI?3:t>Math.PI&&t<=3*Math.PI/2?4:1},t.conjugateGradient=function(t,e,u){let n={x:e.slice(),fx:0,fxprime:e.slice()},r={x:e.slice(),fx:0,fxprime:e.slice()};const i=e.slice();let s,o=1;const D=(u=u||{}).maxIterations||20*e.length;n.fx=t(n.x,n.fxprime);const a=n.fxprime.slice();En(a,n.fxprime,-1);for(let e=0;e<D;++e){if(o=Bn(t,a,n,r,o),u.history&&u.history.push({x:n.x.slice(),fx:n.fx,fxprime:n.fxprime.slice(),alpha:o}),o){Mn(i,1,r.fxprime,-1,n.fxprime);const t=Et(n.fxprime,n.fxprime);Mn(a,Math.max(0,Et(i,r.fxprime)/t),a,-1,r.fxprime),s=n,n=r,r=s}else En(a,n.fxprime,-1);if(xn(n.fxprime)<=1e-5)break}return u.history&&u.history.push({x:n.x.slice(),fx:n.fx,fxprime:n.fxprime.slice(),alpha:o}),n},t.constant=t=>s(t)?t:()=>t,t.containedInCircles=nn,t.cos=ft,t.crossProduct=yt,t.crossProductPoint=xt,t.dateGetterName=Ve,t.dateSetterName=function(t){return t?"setUTCDate":"setDate"},t.dayCount=pu,t.dayField=yu,t.dayFloor=mu,t.dayOffset=Cu,t.debounce=K,t.defaults=_,t.degreeToRadian=St,t.destination=function(t,e,u,n={}){const r=St(t[0]),i=St(t[1]),s=St(u),o=function(t,e){void 0===e&&(e="kilometers");var u=en[e];if(!u)throw new Error(e+" units is invalid");return t/u}(e,n.units),D=Math.asin(Math.sin(i)*Math.cos(o)+Math.cos(i)*Math.sin(o)*Math.cos(s));return{x:Tt(r+Math.atan2(Math.sin(s)*Math.sin(o)*Math.cos(i),Math.cos(o)-Math.sin(i)*Math.sin(D))),y:Tt(D)}},t.deviation=function(t,e){const u=W(t,e);return u?Math.sqrt(u):u},t.dotProduct=Et,t.eastAsianCharacterInfo=xe,t.epsilon=st,t.exponent=Cn,t.findBoundaryAngles=Ut,t.findZeroOfFunction=function(t,e,u,n){var r,i;const s=null!==(r=null==n?void 0:n.maxIterations)&&void 0!==r?r:100,o=null!==(i=null==n?void 0:n.tolerance)&&void 0!==i?i:1e-10,D=t(e),a=t(u);let h=u-e;if(D*a>0){return P.getInstance().error("Initial bisect points must have opposite signs"),NaN}if(0===D)return e;if(0===a)return u;for(let u=0;u<s;++u){h/=2;const u=e+h,n=t(u);if(n*D>=0&&(e=u),Math.abs(h)<o||0===n)return u}return e+h},t.fixPrecision=Bt,t.flattenArray=function t(e){if(!f(e))return[e];const u=[];for(const n of e)u.push(...t(n));return u},t.formatNumerals=pn,t.formatSpecifier=Fn,t.formatTypes=mn,t.fullYearGetterName=Ye,t.fullYearSetterName=function(t){return t?"setUTCFullYear":"setFullYear"},t.fuzzyEqualNumber=function(t,e){return lt(t-e)<st},t.fuzzyEqualVec=Mt,t.gemv=function(t,e,u){for(let n=0;n<t.length;++n)t[n]=Et(e[n],u)},t.generateCeil=Xu,t.generateCount=Zu,t.generateStepInterval=(t,{floor:e,offset:u,field:n,count:r})=>{const i=Math.floor(t);if(!Number.isFinite(i)||i<=0)return null;if(i<=1)return{floor:e,offset:u,ceil:Xu(e,u)};const s=Zu(e,r),o=n?t=>n(t)%i==0:t=>s(0,t)%i==0,D=t=>{if(!Number.isNaN(+t))for(e(t);!o(t);)t.setTime(+t-1),e(t);return t},a=(t,e)=>{if(!Number.isNaN(+t))if(i<0)for(;++e<=0;)for(u(t,-1);!o(t);)u(t,-1);else for(;--e>=0;)for(u(t,1);!o(t);)u(t,1);return t};return{floor:D,offset:a,ceil:Xu(D,a)}},t.get=(t,e,u)=>{const n=c(e)?e.split("."):e;for(let e=0;e<n.length;e++)t=t?t[n[e]]:void 0;return void 0===t?u:t},t.getAABBFromPoints=function(t){return Gt=1/0,$t=1/0,Xt=-1/0,Zt=-1/0,t.forEach((t=>{Gt>t.x&&(Gt=t.x),Xt<t.x&&(Xt=t.x),$t>t.y&&($t=t.y),Zt<t.y&&(Zt=t.y)})),{x1:Gt,y1:$t,x2:Xt,y2:Zt}},t.getAngleByPoint=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},t.getCenter=on,t.getContainerSize=function(t,e=0,u=0){if(!t)return{width:e,height:u};let n;try{n=null===window||void 0===window?void 0:window.getComputedStyle}catch(t){n=()=>({})}const r=n(t);if(/^(\d*\.?\d+)(px)$/.exec(r.width)){const n=parseFloat(r.width)-parseFloat(r.paddingLeft)-parseFloat(r.paddingRight)||t.clientWidth-1,i=parseFloat(r.height)-parseFloat(r.paddingTop)-parseFloat(r.paddingBottom)||t.clientHeight-1;return{width:n<=0?e:n,height:i<=0?u:i}}return{width:e,height:u}},t.getContextFont=Me,t.getDecimalPlaces=bt,t.getElementAbsolutePosition=Ju,t.getElementRelativePosition=function(t,e){const u=Ju(t),n=Ju(e);return{x:u.x-n.x,y:u.y-n.y}},t.getFormatFromValue=function(t,e){const u=rt(t),n=u[qe(e)]()+1,r=u[Ve(e)](),i=u[Ge(e)](),s=u[$e(e)](),o=u[Xe(e)](),D=0===u[Ze(e)](),a=D&&0===o,h=a&&0===s,l=h&&0===i,c=l&&1===r;return c&&1===n?"YYYY":c?"YYYY-MM":l?"YYYY-MM-DD":h?"HH":a?"HH:mm":D?"HH:mm:ss":"HH:mm:ss SSS"},t.getIntersectPoint=function(t,e,u,n){if(!Ot(t,e,u,n))return!1;const r=[0,0],i=[0,0],s=[0,0];if(Ht(r,e,t),Ht(i,n,u),Mt(r,i))return!0;Ht(s,u,t);const o=yt(s,i)/yt(r,i);return o>=0&&o<=1&&[t[0]+r[0]*o,t[1]+r[1]*o]},t.getIntervalOptions=(t,e)=>"year"===t&&e?{floor:iu,offset:su,count:ou,field:Du}:"month"===t&&e?{floor:fu,offset:Fu,count:du,field:gu}:"day"===t&&e?{floor:xu,offset:Eu,count:Mu,field:Bu}:"hour"===t&&e?{floor:Su,offset:Tu,count:Au,field:_u}:"minute"===t&&e?{floor:Uu,offset:Hu,count:ku,field:Ou}:"second"===t&&e?{floor:ju,offset:Yu,count:zu,field:qu}:"year"===t?{floor:eu,offset:uu,count:nu,field:ru}:"month"===t?{floor:au,offset:hu,count:lu,field:cu}:"day"===t?{floor:mu,offset:Cu,count:pu,field:yu}:"hour"===t?{floor:bu,offset:vu,count:Au,field:wu}:"minute"===t?{floor:Lu,offset:Nu,count:ku,field:Iu}:"second"===t?{floor:Ru,offset:Pu,count:zu,field:Wu}:{floor:Vu,offset:Gu,count:$u},t.getOBBFromLine=function(t,e,u){return Jt=e.x-t.x,Qt=e.y-t.y,Kt=Qt,te=-Jt,ne=ee=Math.sqrt(Kt*Kt+te*te),re=u,Kt/=ee,te/=ee,ue=u/2,Jt=ue*Kt,Qt=ue*te,{point1:{x:t.x+Jt,y:t.y+Qt},point2:{x:t.x-Jt,y:t.y-Qt},point3:{x:e.x+Jt,y:e.y+Qt},point4:{x:e.x-Jt,y:e.y-Qt},width:ne,height:re,left:Math.min(t.x,e.x)-Math.abs(Jt),top:Math.min(t.y,e.y)-Math.abs(Qt)}},t.getRectIntersect=function(t,e,u){if(null===t)return e;if(null===e)return t;const{x11:n,x12:r,y11:i,y12:s,x21:o,x22:D,y21:a,y22:h}=Pt(t,e,u);return n>=D||r<=o||i>=h||s<=a?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(n,o),y1:Math.max(i,a),x2:Math.min(r,D),y2:Math.min(s,h)}},t.getScale=t=>t.offsetWidth>0?Qu(t):Ku(t),t.getScaleX=Qu,t.getScaleY=Ku,t.getScrollLeft=t=>{var e,u,n;return t===(null===(e=null===globalThis||void 0===globalThis?void 0:globalThis.document)||void 0===e?void 0:e.body)?(null===(n=null===(u=null===globalThis||void 0===globalThis?void 0:globalThis.document)||void 0===u?void 0:u.documentElement)||void 0===n?void 0:n.scrollLeft)||t.scrollLeft:"html"===t.tagName.toLowerCase()?0:t.scrollLeft},t.getScrollTop=t=>{var e,u,n;return t===(null===(e=null===globalThis||void 0===globalThis?void 0:globalThis.document)||void 0===e?void 0:e.body)?(null===(n=null===(u=null===globalThis||void 0===globalThis?void 0:globalThis.document)||void 0===u?void 0:u.documentElement)||void 0===n?void 0:n.scrollTop)||t.scrollTop:"html"===t.tagName.toLowerCase()?0:t.scrollTop},t.getTimeFormatter=function(t,e){return u=>{const n=rt(u),r=n[Ye(e)](),i=n[qe(e)]()+1,s=Math.floor((i-1)/3)+1,o=n[Ve(e)](),D=n["get"+(e?"UTC":"")+"Day"](),a=n[Ge(e)](),h=(a-1)%12+1,l=n[$e(e)](),c=n[Xe(e)](),f=n[Ze(e)]();return(t||"").replace(/YYYY/g,Z(r+"",4,"0","left")).replace(/yyyy/g,r+"").replace(/yy/g,r%100+"").replace(/Q/g,s+"").replace(/MM/g,Z(i,2,"0","left")).replace(/M/g,i+"").replace(/dd/g,Z(o,2,"0","left")).replace(/d/g,o+"").replace(/e/g,D+"").replace(/HH/g,Z(a,2,"0","left")).replace(/H/g,a+"").replace(/hh/g,Z(h+"",2,"0","left")).replace(/h/g,h+"").replace(/mm/g,Z(l,2,"0","left")).replace(/m/g,l+"").replace(/ss/g,Z(c,2,"0","left")).replace(/s/g,c+"").replace(/SSS/g,Z(f,3,"0","left")).replace(/S/g,f+"")}},t.halfPi=Dt,t.has=(t,e)=>null!=t&&x.call(t,e),t.hasParentElement=function(t,e){let u=t.parentNode;for(;null!==u;){if(u===e)return!0;u=u.parentNode}return!1},t.hexToRgb=Pe,t.hourCount=Au,t.hourField=wu,t.hourFloor=bu,t.hourOffset=vu,t.hoursGetterName=Ge,t.hoursSetterName=function(t){return t?"setUTCHours":"setHours"},t.hslToRgb=we,t.interpolateDate=function(t,e){const u=t.valueOf(),n=e.valueOf(),r=new Date;return t=>(r.setTime(u*(1-t)+n*t),r)},t.interpolateNumber=tt,t.interpolateNumberRound=function(t,e){return function(u){return Math.round(t*(1-u)+e*u)}},t.interpolateRgb=We,t.interpolateString=function(t,e){let u,n,r,i=et.lastIndex=ut.lastIndex=0,s=-1;const o=[],D=[];for(t+="",e+="";(u=et.exec(t))&&(n=ut.exec(e));)(r=n.index)>i&&(r=e.slice(i,r),o[s]?o[s]+=r:o[++s]=r),(u=u[0])===(n=n[0])?o[s]?o[s]+=n:o[++s]=n:(o[++s]=null,D.push({i:s,x:tt(u,n)})),i=ut.lastIndex;return i<e.length&&(r=e.slice(i),o[s]?o[s]+=r:o[++s]=r),o.length<2?D[0]?function(t){return function(e){return t(e)+""}}(D[0].x):function(t){return function(){return t}}(e):(e=D.length,function(t){for(let u,n=0;n<e;++n)o[(u=D[n]).i]=u.x(t);return o.join("")})},t.intersectionArea=function(t,e){const u=function(t){const e=[];for(let u=0;u<t.length;++u)for(let n=u+1;n<t.length;++n){const r=sn(t[u],t[n]);for(let t=0;t<r.length;++t){const i=r[t];i.parentIndex=[u,n],e.push(i)}}return e}(t),n=u.filter((function(e){return nn(e,t)}));let r=0,i=0;const s=[];if(n.length>1){const e=on(n);for(let t=0;t<n.length;++t){const u=n[t];u.angle=Math.atan2(u.x-e.x,u.y-e.y)}n.sort((function(t,e){return e.angle-t.angle}));let u=n[n.length-1];for(let e=0;e<n.length;++e){const o=n[e];i+=(u.x+o.x)*(o.y-u.y);const D={x:(o.x+u.x)/2,y:(o.y+u.y)/2};let a=null;for(let e=0;e<o.parentIndex.length;++e)if(u.parentIndex.indexOf(o.parentIndex[e])>-1){const n=t[o.parentIndex[e]],r=Math.atan2(o.x-n.x,o.y-n.y),i=Math.atan2(u.x-n.x,u.y-n.y);let s=i-r;s<0&&(s+=2*Math.PI);const h=i-s/2;let l=At.distancePP(D,{x:n.x+n.radius*Math.sin(h),y:n.y+n.radius*Math.cos(h)});l>2*n.radius&&(l=2*n.radius),(null===a||a.width>l)&&(a={circle:n,width:l,p1:o,p2:u})}null!==a&&(s.push(a),r+=rn(a.circle.radius,a.width),u=o)}}else{let e=t[0];for(let u=1;u<t.length;++u)t[u].radius<e.radius&&(e=t[u]);let u=!1;for(let n=0;n<t.length;++n)if(At.distancePP(t[n],e)>Math.abs(e.radius-t[n].radius)){u=!0;break}u?r=i=0:(r=e.radius*e.radius*Math.PI,s.push({circle:e,p1:{x:e.x,y:e.y+e.radius},p2:{x:e.x-un,y:e.y+e.radius},width:2*e.radius}))}return i/=2,e&&(e.area=r+i,e.arcArea=r,e.polygonArea=i,e.arcs=s,e.innerPoints=n,e.intersectionPoints=u),r+i},t.isArray=f,t.isArrayLike=F,t.isBase64=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t),t.isBoolean=i,t.isDate=d,t.isEmpty=function(t){if(o(t))return!0;if(F(t))return!t.length;const e=(t=>({}.toString.call(t).replace(/^\[object /,"").replace(/]$/,"")))(t);if("Map"===e||"Set"===e)return!t.size;if(function(t){const e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||p)}(t))return!Object.keys(t).length;for(const e in t)if(y.call(t,e))return!1;return!0},t.isEqual=function t(e,u,n){if(e===u)return!0;if(typeof e!=typeof u)return!1;if(null==e||null==u)return!1;if(Number.isNaN(e)&&Number.isNaN(u))return!0;if(v(e)!==v(u))return!1;if(s(e))return!!(null==n?void 0:n.skipFunction);if("object"!=typeof e)return!1;if(f(e)){if(e.length!==u.length)return!1;for(let r=e.length-1;r>=0;r--)if(!t(e[r],u[r],n))return!1;return!0}if(!l(e))return!1;const r=A(e),i=A(u);if(r.length!==i.length)return!1;r.sort(),i.sort();for(let t=r.length-1;t>=0;t--)if(r[t]!=i[t])return!1;for(let i=r.length-1;i>=0;i--){const s=r[i];if(!t(e[s],u[s],n))return!1}return!0},t.isFunction=s,t.isGreater=function(t,e,u,n){return t>e&&!$(t,e,u,n)},t.isHTMLElement=function(t){try{return t instanceof Element}catch(e){const u=["children","innerHTML","classList","setAttribute","tagName","getBoundingClientRect"],n=Object.keys(t);return u.every((t=>n.includes(t)))}},t.isIntersect=Ot,t.isLess=function(t,e,u,n){return t<e&&!$(t,e,u,n)},t.isNil=o,t.isNull=t=>null===t,t.isNumber=g,t.isNumberClose=$,t.isNumeric=t=>"string"==typeof t&&(!isNaN(Number(t))&&!isNaN(parseFloat(t))),t.isObject=a,t.isObjectLike=h,t.isPlainObject=l,t.isPointInLine=me,t.isPointInPolygon=function(t,e){if(!t)return!1;if(!e)return!1;const u="Feature"===(n=e).type?n.geometry:n;var n;const r=u.type,i=e.bbox;let s=u.coordinates;if(i&&!0===zt(t,{x1:i[0],x2:i[1],y1:i[1],y2:i[3]},!0))return!1;"Polygon"===r&&(s=[s]);let o=!1;for(let e=0;e<s.length;++e)for(let u=0;u<s[e].length;++u){if(ge(s[e][u].map((t=>({x:t[0],y:t[1]}))),t.x,t.y))return o=!0,o}return o},t.isRectIntersect=function(t,e,u){if(t&&e){if(!u)return!(t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1);const{x11:n,x12:r,y11:i,y12:s,x21:o,x22:D,y21:a,y22:h}=Pt(t,e,!0);return!(n>D||r<o||i>h||s<a)}return!0},t.isRegExp=C,t.isRotateAABBIntersect=Vt,t.isShallowEqual=function(t,e){if(w(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;if(f(t)!==f(e))return!1;if(S(t)!==S(e))return!1;let u=!0;return Object.keys(t).forEach((n=>!!w(t[n],e[n])||(u=!1,u))),u},t.isString=c,t.isType=r,t.isUndefined=t=>void 0===t,t.isValid=D,t.isValidNumber=m,t.isValidUrl=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t),t.keys=T,t.last=N,t.lengthFromPointToLine=pt,t.lineIntersectPolygon=de,t.lowerCamelCaseToMiddle=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase(),t.lowerFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},t.max=Ft,t.maxInArray=(t,e)=>{var u;if(0===t.length)return;let n=t[0];for(let r=1;r<t.length;r++){const i=t[r];(null!==(u=null==e?void 0:e(i,n))&&void 0!==u?u:i-n)>0&&(n=i)}return n},t.median=(t,e)=>{let u=t;return!0!==e&&(u=t.sort(k)),U(u,.5)},t.memoize=t=>{let e=null,u=null;return(...n)=>(e&&n.every(((t,u)=>t===e[u]))||(e=n,u=t(...n)),u)},t.merge=function(t,...e){let u=-1;const n=e.length;for(;++u<n;){E(t,e[u],!0)}return t},t.mergeAABB=function(t){const e=[];return function t(u,n){const r=[];n.forEach((t=>{let e;(e=ie(u,t)).length>1?r.push(t):u=e[0]})),e.push(u),r.length&&t(r[0],r.slice(1))}(t[0],t.slice(1)),e},t.millisecondsCount=$u,t.millisecondsFloor=Vu,t.millisecondsGetterName=Ze,t.millisecondsOffset=Gu,t.millisecondsSetterName=function(t){return t?"setUTCMilliseconds":"setMilliseconds"},t.min=dt,t.minInArray=(t,e)=>{var u;if(0===t.length)return;let n=t[0];for(let r=1;r<t.length;r++){const i=t[r];(null!==(u=null==e?void 0:e(i,n))&&void 0!==u?u:i-n)<0&&(n=i)}return n},t.minuteCount=ku,t.minuteField=Iu,t.minuteFloor=Lu,t.minuteOffset=Nu,t.minutesGetterName=$e,t.minutesSetterName=function(t){return t?"setUTCMinutes":"setMinutes"},t.mixin=function(t,e,u=!0){if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames){const n=Object.getOwnPropertyNames(e);for(let r=0;r<n.length;r++){const i=n[r];"constructor"!==i&&(u?null!=e[i]:null==t[i])&&(t[i]=e[i])}}else _(t,e,u)},t.monthCount=lu,t.monthField=cu,t.monthFloor=au,t.monthGetterName=qe,t.monthOffset=hu,t.monthSetterName=function(t){return t?"setUTCMonth":"setMonth"},t.nelderMead=function(t,e,u){const n=(u=u||{}).maxIterations||200*e.length,r=u.nonZeroDelta||1.05,i=u.zeroDelta||.001,s=u.minErrorDelta||1e-6,o=u.minErrorDelta||1e-5,D=void 0!==u.rho?u.rho:1,a=void 0!==u.chi?u.chi:2,h=void 0!==u.psi?u.psi:-.5,l=void 0!==u.sigma?u.sigma:.5;let c;const f=e.length,F=new Array(f+1);F[0]=e,F[0].fx=t(e),F[0].id=0;for(let u=0;u<f;++u){const n=e.slice();n[u]=n[u]?n[u]*r:i,F[u+1]=n,F[u+1].fx=t(n),F[u+1].id=u+1}function d(t){for(let e=0;e<t.length;e++)F[f][e]=t[e];F[f].fx=t.fx}const g=function(t,e){return t.fx-e.fx},m=e.slice(),C=e.slice(),p=e.slice(),y=e.slice();for(let e=0;e<n;++e){if(F.sort(g),u.history){const t=F.map((function(t){const e=t.slice();return e.fx=t.fx,e.id=t.id,e}));t.sort((function(t,e){return t.id-e.id})),u.history.push({x:F[0].slice(),fx:F[0].fx,simplex:t})}c=0;for(let t=0;t<f;++t)c=Math.max(c,Math.abs(F[0][t]-F[1][t]));if(Math.abs(F[0].fx-F[f].fx)<s&&c<o)break;for(let t=0;t<f;++t){m[t]=0;for(let e=0;e<f;++e)m[t]+=F[e][t];m[t]/=f}const e=F[f];if(Mn(C,1+D,m,-D,e),C.fx=t(C),C.fx<F[0].fx)Mn(y,1+a,m,-a,e),y.fx=t(y),y.fx<C.fx?d(y):d(C);else if(C.fx>=F[f-1].fx){let u=!1;if(C.fx>e.fx?(Mn(p,1+h,m,-h,e),p.fx=t(p),p.fx<e.fx?d(p):u=!0):(Mn(p,1-h*D,m,h*D,e),p.fx=t(p),p.fx<C.fx?d(p):u=!0),u){if(l>=1)break;for(let e=1;e<F.length;++e)Mn(F[e],1-l,F[0],l,F[e]),F[e].fx=t(F[e])}}else d(C)}return F.sort(g),{fx:F[0].fx,x:F[0]}},t.norm2=xn,t.normalTransform=function(t,e,u,n,r,i,s,o){const D=e.a,a=e.b,h=e.c,l=e.d,c=e.e,f=e.f,F=ft(s),d=gt(s);let g,m;o?(g=o[0],m=o[1]):(g=u,m=n);const C=g-u,p=m-n,y=D*F+h*d,x=a*F+l*d,E=h*F-D*d,M=l*F-a*d;t.a=r*y,t.b=r*x,t.c=i*E,t.d=i*M,t.e=c+D*g+h*m-y*C-E*p,t.f=f+a*g+l*m-x*C-M*p},t.normalizeAngle=It,t.normalizePadding=function(t){if(m(t))return[t,t,t,t];if(f(t)){const e=t.length;if(1===e){const e=t[0];return[e,e,e,e]}if(2===e){const[e,u]=t;return[e,u,e,u]}if(3===e){const[e,u,n]=t;return[e,u,n,u]}if(4===e)return t}if(a(t)){const{top:e=0,right:u=0,bottom:n=0,left:r=0}=t;return[e,u,n,r]}return[0,0,0,0]},t.numberSpecifierReg=fn,t.pad=Z,t.parseUint8ToImageData=(t,e,u)=>{const n=new Uint8ClampedArray(t),r=new Uint8ClampedArray(t.length);for(let t=u-1;t>=0;t--)for(let i=0;i<e;i++){const s=t*e*4+4*i,o=(u-t)*e*4+4*i;r[o]=n[s],r[o+1]=n[s+1],r[o+2]=n[s+2],r[o+3]=n[s+3]}return new ImageData(r,e,u)},t.pi=ot,t.pi2=ht,t.pick=function(t,e){if(!t||!l(t))return t;const u={};return e.forEach((e=>{b.call(t,e)&&(u[e]=t[e])})),u},t.pickWithout=function(t,e){if(!t||!l(t))return t;const u={};return Object.keys(t).forEach((n=>{const r=t[n];let i=!1;e.forEach((t=>{(c(t)&&t===n||t instanceof RegExp&&n.match(t))&&(i=!0)})),i||(u[n]=r)})),u},t.pointAt=function(t,e,u,n,r){let i=u,s=n;return"number"==typeof t&&"number"==typeof u&&(i=(1-r)*t+r*u),"number"==typeof e&&"number"==typeof n&&(s=(1-r)*e+r*n),{x:i,y:s}},t.pointBetweenLine=ce,t.pointInAABB=function(t,e){return zt(t,e,!1)},t.pointInLine=De,t.pointInOBB=function(t,e){return se.x=(e.point1.x+e.point2.x)/2,se.y=(e.point1.y+e.point2.y)/2,oe.x=(e.point3.x+e.point4.x)/2,oe.y=(e.point3.y+e.point4.y)/2,De(t,se,oe,e.height)},t.pointInRect=zt,t.polarToCartesian=function(t,e,u){return e?{x:t.x+e*Math.cos(u),y:t.y+e*Math.sin(u)}:{x:t.x,y:t.y}},t.polygonContainPoint=ge,t.polygonIntersectPolygon=function(t,e){for(let u=0;u<e.length;u++){if(ge(t,e[u].x,e[u].y))return!0;if(u>0&&de(e[u-1].x,e[u-1].y,e[u].x,e[u].y,t))return!0}return!1},t.pow=Ct,t.precisionAdd=function(t,e){return Bt(t+e,10**Math.max(bt(t),bt(e)))},t.precisionSub=function(t,e){return Bt(t-e,10**Math.max(bt(t),bt(e)))},t.quantileSorted=U,t.radianToDegree=Tt,t.range=function(t,e,u){D(e)||(e=t,t=0),D(u)||(u=1);let n=-1;const r=0|Math.max(0,Math.ceil((e-t)/u)),i=new Array(r);for(;++n<r;)i[n]=t+n*u;return i},t.rectInsideAnotherRect=function(e,u,n){if(!e||!u)return t.InnerBBox.NONE;const{x11:r,x12:i,y11:s,y12:o,x21:D,x22:a,y21:h,y22:l}=Pt(e,u,n);return r>D&&i<a&&s>h&&o<l?t.InnerBBox.BBOX1:D>r&&a<i&&h>s&&l<o?t.InnerBBox.BBOX2:t.InnerBBox.NONE},t.rgbToHex=ze,t.rgbToHsl=Se,t.rotatePoint=jt,t.scale=En,t.secondCount=zu,t.secondField=Wu,t.secondFloor=Ru,t.secondOffset=Pu,t.secondsGetterName=Xe,t.secondsSetterName=function(t){return t?"setUTCSeconds":"setSeconds"},t.seedRandom=function(t){return parseFloat("0."+Math.sin(t).toString().substring(6))},t.shuffleArray=function(t,e=Math.random){let u,n,r=t.length;for(;r;)u=Math.floor(e()*r),n=t[--r],t[r]=t[u],t[u]=n;return t},t.sin=gt,t.span=t=>t.length<=1?0:N(t)-t[0],t.sqrt=mt,t.stringWidth=function(t,e=!0){if("string"!=typeof t||0===t.length)return 0;if(0===(t=pe(t)).length)return 0;t=t.replace(Ee()," ");const u=e?1:2;let n=0;for(const e of t){const t=e.codePointAt(0);if(t<=31||t>=127&&t<=159)continue;if(t>=768&&t<=879)continue;switch(xe(e)){case"F":case"W":n+=2;break;case"A":n+=u;break;default:n+=1}}return n},t.styleStringToObject=(t="")=>{const e={};return t.split(";").forEach((t=>{if(t){const u=t.split(":");if(2===u.length){const t=u[0].trim(),n=u[1].trim();t&&n&&(e[t]=n)}}})),e},t.substitute=function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,((t,u)=>"\\"===t.charAt(0)?t.slice(1):void 0===e[u]?"":e[u])):t},t.tau=at,t.throttle=function(t,e,u){let n=!0,r=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return a(u)&&(n="leading"in u?!!u.leading:n,r="trailing"in u?!!u.trailing:r),K(t,e,{leading:n,trailing:r,maxWait:e})},t.tickStep=function(t,e,u){const n=Math.abs(e-t)/Math.max(0,u);let r=Math.pow(10,Math.floor(Math.log(n)/Math.LN10));const i=n/r;return i>=j?r*=10:i>=Y?r*=5:i>=q&&(r*=2),e<t?-r:r},t.toCamelCase=function(t){return t.replace(/-([a-z])/g,((t,e)=>e.toUpperCase()))},t.toDate=rt,t.toNumber=I,t.toValidNumber=function(t){if(m(t))return t;const e=+t;return m(e)?e:0},t.transformBounds=function(t,e,u,n,r,i,s){if(!(lt(n)<=st||lt(r)<=st)){if(1!==n&&t.scaleX(n),1!==r&&t.scaleY(r),isFinite(i)&&Math.abs(i)>st){let e=0,u=0;void 0!==s&&(e=s[0],u=s[1]),t.rotate(i,e,u)}t.translate(e,u)}},t.transformBoundsWithMatrix=be,t.truncate=(t,e,u="right",n)=>{const r=o(n)?"…":n,i=t+"",s=i.length,D=Math.max(0,e-r.length);return s<=e?i:"left"===u?r+i.slice(s-D):"center"===u?i.slice(0,Math.ceil(D/2))+r+i.slice(s-Math.floor(D/2)):i.slice(0,D)+r},t.unionAABB=ie,t.uniqArray=function(t){return t&&f(t)?Array.from(new Set(L(t))):t},t.upperFirst=function(t){return t.charAt(0).toUpperCase()+t.substring(1)},t.utcDayCount=Mu,t.utcDayField=Bu,t.utcDayFloor=xu,t.utcDayOffset=Eu,t.utcHourField=_u,t.utcHourFloor=Su,t.utcHourOffset=Tu,t.utcMinuteField=Ou,t.utcMinuteFloor=Uu,t.utcMinuteOffset=Hu,t.utcMonthCount=du,t.utcMonthField=gu,t.utcMonthFloor=fu,t.utcMonthOffset=Fu,t.utcSecondField=qu,t.utcSecondFloor=ju,t.utcSecondOffset=Yu,t.utcYearCount=ou,t.utcYearField=Du,t.utcYearFloor=iu,t.utcYearOffset=su,t.uuid=(t,e)=>{const u="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[];let r;if(e=e||u.length,t)for(r=0;r<t;r++)n[r]=u[0|Math.random()*e];else{let t;for(n[8]=n[13]=n[18]=n[23]="-",n[14]="4",r=0;r<36;r++)n[r]||(t=0|16*Math.random(),n[r]=u[19===r?3&t|8:t])}return n.join("")},t.variance=W,t.weightedSum=Mn,t.yearCount=nu,t.yearField=ru,t.yearFloor=eu,t.yearOffset=uu,t.zeros=yn,t.zerosM=function(t,e){return yn(t).map((function(){return yn(e)}))}}));
|
package/es/common/array.js
CHANGED
|
@@ -22,7 +22,7 @@ export const maxInArray = (arr, compareFn) => {
|
|
|
22
22
|
let max = arr[0];
|
|
23
23
|
for (let i = 1; i < arr.length; i++) {
|
|
24
24
|
const value = arr[i];
|
|
25
|
-
(null !== (_a = null == compareFn ? void 0 : compareFn(value, max)) && void 0 !== _a ? _a : value - max > 0
|
|
25
|
+
(null !== (_a = null == compareFn ? void 0 : compareFn(value, max)) && void 0 !== _a ? _a : value - max) > 0 && (max = value);
|
|
26
26
|
}
|
|
27
27
|
return max;
|
|
28
28
|
};
|
|
@@ -33,7 +33,7 @@ export const minInArray = (arr, compareFn) => {
|
|
|
33
33
|
let min = arr[0];
|
|
34
34
|
for (let i = 1; i < arr.length; i++) {
|
|
35
35
|
const value = arr[i];
|
|
36
|
-
(null !== (_a = null == compareFn ? void 0 : compareFn(value, min)) && void 0 !== _a ? _a : value - min < 0
|
|
36
|
+
(null !== (_a = null == compareFn ? void 0 : compareFn(value, min)) && void 0 !== _a ? _a : value - min) < 0 && (min = value);
|
|
37
37
|
}
|
|
38
38
|
return min;
|
|
39
39
|
};
|
package/es/common/array.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/common/array.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,OAAO,MAAM,WAAW,CAAC;AAOhC,MAAM,UAAU,KAAK,CAAI,GAAa;IACpC,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE;QAChB,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;KACnC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAOD,MAAM,UAAU,IAAI,CAAI,GAAY;IAClC,IAAI,WAAW,CAAC,GAAG,CAAC,EAAE;QACpB,MAAM,GAAG,GAAG,GAAqB,CAAC;QAClC,OAAO,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;KAC5B;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAOD,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,GAAa,EAAE,EAAE;IACpC,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,EAAE;QACnB,OAAO,CAAC,CAAC;KACV;IACD,OAAQ,IAAI,CAAC,GAAG,CAAY,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AACxC,CAAC,CAAC;AAQF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAI,GAAQ,EAAE,SAAkC,EAAiB,EAAE;;IAC3F,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;QACpB,OAAO,SAAS,CAAC;KAClB;IACD,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAG,KAAK,EAAE,GAAG,CAAC,mCAAK,KAAgB,GAAI,GAAc,GAAG,CAAC,EAAE;
|
|
1
|
+
{"version":3,"sources":["../src/common/array.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,OAAO,MAAM,WAAW,CAAC;AAOhC,MAAM,UAAU,KAAK,CAAI,GAAa;IACpC,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE;QAChB,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;KACnC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAOD,MAAM,UAAU,IAAI,CAAI,GAAY;IAClC,IAAI,WAAW,CAAC,GAAG,CAAC,EAAE;QACpB,MAAM,GAAG,GAAG,GAAqB,CAAC;QAClC,OAAO,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;KAC5B;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAOD,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,GAAa,EAAE,EAAE;IACpC,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,EAAE;QACnB,OAAO,CAAC,CAAC;KACV;IACD,OAAQ,IAAI,CAAC,GAAG,CAAY,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AACxC,CAAC,CAAC;AAQF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAI,GAAQ,EAAE,SAAkC,EAAiB,EAAE;;IAC3F,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;QACpB,OAAO,SAAS,CAAC;KAClB;IACD,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,CAAC,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAG,KAAK,EAAE,GAAG,CAAC,mCAAK,KAAgB,GAAI,GAAc,CAAC,GAAG,CAAC,EAAE;YACxE,GAAG,GAAG,KAAK,CAAC;SACb;KACF;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAQF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAI,GAAQ,EAAE,SAAkC,EAAiB,EAAE;;IAC3F,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;QACpB,OAAO,SAAS,CAAC;KAClB;IACD,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,CAAC,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAG,KAAK,EAAE,GAAG,CAAC,mCAAK,KAAgB,GAAI,GAAc,CAAC,GAAG,CAAC,EAAE;YACxE,GAAG,GAAG,KAAK,CAAC;SACb;KACF;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAQF,MAAM,UAAU,UAAU,CAAC,CAAM,EAAE,CAAM;IACvC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QAC9B,OAAO,KAAK,CAAC;KACd;IACD,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE;QACzB,OAAO,KAAK,CAAC;KACd;IACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACjC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;YACjB,OAAO,KAAK,CAAC;SACd;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAOD,MAAM,UAAU,SAAS,CAAI,GAAY;IACvC,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QACzB,OAAO,GAAG,CAAC;KACZ;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACzC,CAAC;AAGD,MAAM,UAAU,YAAY,CAAI,GAAQ,EAAE,SAAuB,IAAI,CAAC,MAAM;IAC1E,IAAI,CAAC,CAAC;IACN,IAAI,CAAC,CAAC;IACN,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAEnB,OAAO,CAAC,EAAE;QACR,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;QAC7B,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QACb,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QAChB,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;KACZ;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAOD,MAAM,UAAU,YAAY,CAAC,GAAQ;IACnC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QACjB,OAAO,CAAC,GAAG,CAAC,CAAC;KACd;IACD,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE;QACvB,MAAM,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;KACrC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","file":"array.js","sourcesContent":["import isArray from './isArray';\nimport isArrayLike from './isArrayLike';\nimport isValid from './isValid';\n\n/**\n * 将传入数据转换为数组格式\n * @param arr 入参。\n * @returns 数组\n */\nexport function array<T>(arr?: T | T[]): T[] {\n if (isValid(arr)) {\n return isArray(arr) ? arr : [arr];\n }\n return [];\n}\n\n/**\n * 获取数组的最后一个值,如果传入的参数为非数组,则返回 undefined\n * @param val any\n * @returns\n */\nexport function last<T>(val: T | T[]): T | undefined {\n if (isArrayLike(val)) {\n const arr = val as ArrayLike<any>;\n return arr[arr.length - 1];\n }\n return undefined;\n}\n\n/**\n * 获取数组第一项与最后一项的差值,如果数组为空\b则返回 0\n * @param arr\n * @returns\n */\nexport const span = (arr: number[]) => {\n if (arr.length <= 1) {\n return 0;\n }\n return (last(arr) as number) - arr[0];\n};\n\n/**\n * 获取数组中的最大值\n * @param arr 数组\n * @param compareFn 比较函数,返回正数表示 a > b,返回负数表示 a < b,返回 0 表示相等\n * @returns\n */\nexport const maxInArray = <T>(arr: T[], compareFn?: (a: T, b: T) => number): T | undefined => {\n if (arr.length === 0) {\n return undefined;\n }\n let max = arr[0];\n for (let i = 1; i < arr.length; i++) {\n const value = arr[i];\n if ((compareFn?.(value, max) ?? (value as number) - (max as number)) > 0) {\n max = value;\n }\n }\n return max;\n};\n\n/**\n * 获取数组中的最小值\n * @param arr 数组\n * @param compareFn 比较函数,返回正数表示 a > b,返回负数表示 a < b,返回 0 表示相等\n * @returns\n */\nexport const minInArray = <T>(arr: T[], compareFn?: (a: T, b: T) => number): T | undefined => {\n if (arr.length === 0) {\n return undefined;\n }\n let min = arr[0];\n for (let i = 1; i < arr.length; i++) {\n const value = arr[i];\n if ((compareFn?.(value, min) ?? (value as number) - (min as number)) < 0) {\n min = value;\n }\n }\n return min;\n};\n\n/**\n * 判断两个数组是否相同\n * @param a\n * @param b\n * @returns\n */\nexport function arrayEqual(a: any, b: any): boolean {\n if (!isArray(a) || !isArray(b)) {\n return false;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * 封装并返回无重复的数组\n * @param arr\n * @returns\n */\nexport function uniqArray<T>(arr: T | T[]): T | T[] {\n if (!arr || !isArray(arr)) {\n return arr;\n }\n return Array.from(new Set(array(arr)));\n}\n\n// Based on http://jsfromhell.com/array/shuffle\nexport function shuffleArray<T>(arr: T[], random: () => number = Math.random): T[] {\n let j;\n let x;\n let i = arr.length;\n\n while (i) {\n j = Math.floor(random() * i);\n x = arr[--i];\n arr[i] = arr[j];\n arr[j] = x;\n }\n return arr;\n}\n\n/**\n * 展开多层数组,非数组内容将变为 [input]\n * @param arr\n * @returns\n */\nexport function flattenArray(arr: any): any[] {\n if (!isArray(arr)) {\n return [arr];\n }\n const result = [];\n for (const value of arr) {\n result.push(...flattenArray(value));\n }\n return result;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visactor/vutils",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.2",
|
|
4
4
|
"main": "cjs/index.js",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"types": "es/index.d.ts",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"@types/jest": "~29.5.0",
|
|
28
28
|
"typescript": "4.9.5",
|
|
29
29
|
"@types/node": "*",
|
|
30
|
-
"@internal/eslint-config": "0.0.1",
|
|
31
30
|
"@internal/jest-config": "0.0.1",
|
|
32
|
-
"@internal/
|
|
33
|
-
"@internal/
|
|
31
|
+
"@internal/bundler": "0.0.1",
|
|
32
|
+
"@internal/eslint-config": "0.0.1",
|
|
33
|
+
"@internal/ts-config": "0.0.1"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"eventemitter3": "^4.0.7",
|