mazey 5.10.1 → 5.10.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/README.md +38 -7
- package/README.zh-CN.md +35 -7
- package/lib/index.cjs.js +2 -2
- package/lib/index.d.ts +50 -20
- package/lib/index.esm.js +2 -2
- package/lib/mazey.min.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -108,7 +108,9 @@ There are some examples maintained by hand below. For more information, please c
|
|
|
108
108
|
- [debounce](#debounce)
|
|
109
109
|
- [throttle](#throttle)
|
|
110
110
|
- [convertCamelToKebab](#convertcameltokebab)
|
|
111
|
-
- [
|
|
111
|
+
- [convertCamelToSnake](#convertcameltosnake)
|
|
112
|
+
- [convertSnakeToCamel](#convertsnaketocamel)
|
|
113
|
+
- [formatPercentage](#formatpercentage)
|
|
112
114
|
- [toJavaScriptGlobalName](#tojavascriptglobalname)
|
|
113
115
|
- [derivePackageMetadata](#derivepackagemetadata)
|
|
114
116
|
- [URL](#url)
|
|
@@ -890,15 +892,18 @@ a-b-c
|
|
|
890
892
|
a-b-c
|
|
891
893
|
```
|
|
892
894
|
|
|
893
|
-
####
|
|
895
|
+
#### convertCamelToSnake
|
|
894
896
|
|
|
895
|
-
|
|
897
|
+
Insert an underscore before each uppercase ASCII letter, lowercase the result,
|
|
898
|
+
and remove one leading underscore. `XMLParser` becomes `x_m_l_parser`.
|
|
899
|
+
Other existing underscores are preserved. `convertCamelToUnder` remains a
|
|
900
|
+
deprecated direct alias; `camelCase2Underscore` remains available.
|
|
896
901
|
|
|
897
902
|
Usage:
|
|
898
903
|
|
|
899
904
|
```javascript
|
|
900
|
-
const ret1 =
|
|
901
|
-
const ret2 =
|
|
905
|
+
const ret1 = convertCamelToSnake("ABC");
|
|
906
|
+
const ret2 = convertCamelToSnake("aBC");
|
|
902
907
|
console.log(ret1);
|
|
903
908
|
console.log(ret2);
|
|
904
909
|
```
|
|
@@ -910,6 +915,32 @@ a_b_c
|
|
|
910
915
|
a_b_c
|
|
911
916
|
```
|
|
912
917
|
|
|
918
|
+
#### convertSnakeToCamel
|
|
919
|
+
|
|
920
|
+
Replace `_` followed by a lowercase ASCII letter with its uppercase letter.
|
|
921
|
+
Other underscores and characters remain unchanged. `convertUnderToCamel`
|
|
922
|
+
remains a deprecated direct alias.
|
|
923
|
+
|
|
924
|
+
```javascript
|
|
925
|
+
convertSnakeToCamel("a_b_c"); // "aBC"
|
|
926
|
+
convertSnakeToCamel("a__b_"); // "a_B_"
|
|
927
|
+
```
|
|
928
|
+
|
|
929
|
+
#### formatPercentage
|
|
930
|
+
|
|
931
|
+
Multiply a numeric ratio by 100 and append `%`. Precision defaults to `0`.
|
|
932
|
+
Falsy precision uses `Math.floor`, including for negative values; truthy
|
|
933
|
+
precision uses native `toFixed`, preserving trailing zeros, floating-point
|
|
934
|
+
behavior, and exceptions for unsupported precision. `floatToPercent` remains
|
|
935
|
+
a deprecated direct alias.
|
|
936
|
+
|
|
937
|
+
```javascript
|
|
938
|
+
formatPercentage(0.129); // "12%"
|
|
939
|
+
formatPercentage(-0.129); // "-13%"
|
|
940
|
+
formatPercentage(0.125, 1); // "12.5%"
|
|
941
|
+
formatPercentage(0.12, 2); // "12.00%"
|
|
942
|
+
```
|
|
943
|
+
|
|
913
944
|
#### toJavaScriptGlobalName
|
|
914
945
|
|
|
915
946
|
Convert text to a deterministic uppercase ASCII identifier suitable for an
|
|
@@ -1496,7 +1527,7 @@ The dates may be supported structured date strings, millisecond timestamps, or `
|
|
|
1496
1527
|
Number input is a decimal ratio, so `0.202` represents `20.2%`. String input is a percentage value, so `"20.2%"` and `"20.2"` both represent `20.2%`; strict scientific notation such as `"2.02e1%"` is also accepted. The returned CAGR is an unrounded decimal ratio.
|
|
1497
1528
|
|
|
1498
1529
|
```javascript
|
|
1499
|
-
import { calculateCAGR,
|
|
1530
|
+
import { calculateCAGR, formatPercentage } from "mazey";
|
|
1500
1531
|
|
|
1501
1532
|
const cagr = calculateCAGR(
|
|
1502
1533
|
"2022-04-01",
|
|
@@ -1506,7 +1537,7 @@ const cagr = calculateCAGR(
|
|
|
1506
1537
|
|
|
1507
1538
|
console.log({
|
|
1508
1539
|
cagr,
|
|
1509
|
-
percentage:
|
|
1540
|
+
percentage: formatPercentage(cagr, 2),
|
|
1510
1541
|
});
|
|
1511
1542
|
```
|
|
1512
1543
|
|
package/README.zh-CN.md
CHANGED
|
@@ -92,7 +92,9 @@ isNumber(z, { isInfinityAsNumber: true }); // 输出: true
|
|
|
92
92
|
- [debounce](#debounce)
|
|
93
93
|
- [throttle](#throttle)
|
|
94
94
|
- [convertCamelToKebab](#convertcameltokebab)
|
|
95
|
-
- [
|
|
95
|
+
- [convertCamelToSnake](#convertcameltosnake)
|
|
96
|
+
- [convertSnakeToCamel](#convertsnaketocamel)
|
|
97
|
+
- [formatPercentage](#formatpercentage)
|
|
96
98
|
- [toJavaScriptGlobalName](#tojavascriptglobalname)
|
|
97
99
|
- [URL](#url)
|
|
98
100
|
- [getQueryParam](#getqueryparam)
|
|
@@ -599,15 +601,17 @@ a-b-c
|
|
|
599
601
|
a-b-c
|
|
600
602
|
```
|
|
601
603
|
|
|
602
|
-
####
|
|
604
|
+
#### convertCamelToSnake
|
|
603
605
|
|
|
604
|
-
|
|
606
|
+
在每个 ASCII 大写字母前插入下划线,将结果转换为小写,并删除第一个前导下划线。
|
|
607
|
+
`XMLParser` 转换为 `x_m_l_parser`,其余已有下划线保留。
|
|
608
|
+
`convertCamelToUnder` 保留为弃用的直接别名,`camelCase2Underscore` 仍可使用。
|
|
605
609
|
|
|
606
610
|
用法:
|
|
607
611
|
|
|
608
612
|
```javascript
|
|
609
|
-
const ret1 =
|
|
610
|
-
const ret2 =
|
|
613
|
+
const ret1 = convertCamelToSnake("ABC");
|
|
614
|
+
const ret2 = convertCamelToSnake("aBC");
|
|
611
615
|
console.log(ret1);
|
|
612
616
|
console.log(ret2);
|
|
613
617
|
```
|
|
@@ -619,6 +623,30 @@ a_b_c
|
|
|
619
623
|
a_b_c
|
|
620
624
|
```
|
|
621
625
|
|
|
626
|
+
#### convertSnakeToCamel
|
|
627
|
+
|
|
628
|
+
将下划线及其后的 ASCII 小写字母替换为大写字母,其他字符保持不变。
|
|
629
|
+
`convertUnderToCamel` 保留为弃用的直接别名。
|
|
630
|
+
|
|
631
|
+
```javascript
|
|
632
|
+
convertSnakeToCamel("a_b_c"); // "aBC"
|
|
633
|
+
convertSnakeToCamel("a__b_"); // "a_B_"
|
|
634
|
+
```
|
|
635
|
+
|
|
636
|
+
#### formatPercentage
|
|
637
|
+
|
|
638
|
+
将数值比率乘以 100 并添加 `%`。小数位数默认为 `0`。
|
|
639
|
+
小数位数为假值时使用 `Math.floor`,负数也向下取整;为真值时使用原生 `toFixed`,
|
|
640
|
+
保留末尾零、浮点数行为,以及不支持的小数位数导致的异常。
|
|
641
|
+
`floatToPercent` 保留为弃用的直接别名。
|
|
642
|
+
|
|
643
|
+
```javascript
|
|
644
|
+
formatPercentage(0.129); // "12%"
|
|
645
|
+
formatPercentage(-0.129); // "-13%"
|
|
646
|
+
formatPercentage(0.125, 1); // "12.5%"
|
|
647
|
+
formatPercentage(0.12, 2); // "12.00%"
|
|
648
|
+
```
|
|
649
|
+
|
|
622
650
|
#### toJavaScriptGlobalName
|
|
623
651
|
|
|
624
652
|
将文本转换为确定的、全大写的 ASCII JavaScript 标识符。该标识符适合作为 IIFE 全局名称。函数会将无效字符替换为下划线。结果以数字开头时,函数会添加下划线前缀。
|
|
@@ -1097,7 +1125,7 @@ CAGR = (1 + totalReturnRate)^(365 / durationInDays) - 1
|
|
|
1097
1125
|
数值输入使用十进制比率,因此 `0.202` 表示 `20.2%`。字符串输入使用百分比数值,因此 `"20.2%"` 和 `"20.2"` 都表示 `20.2%`;也支持 `"2.02e1%"` 这类严格的科学记数法。返回的 CAGR 是未经舍入的十进制比率。
|
|
1098
1126
|
|
|
1099
1127
|
```javascript
|
|
1100
|
-
import { calculateCAGR,
|
|
1128
|
+
import { calculateCAGR, formatPercentage } from "mazey";
|
|
1101
1129
|
|
|
1102
1130
|
const cagr = calculateCAGR(
|
|
1103
1131
|
"2022-04-01",
|
|
@@ -1107,7 +1135,7 @@ const cagr = calculateCAGR(
|
|
|
1107
1135
|
|
|
1108
1136
|
console.log({
|
|
1109
1137
|
cagr,
|
|
1110
|
-
percentage:
|
|
1138
|
+
percentage: formatPercentage(cagr, 2),
|
|
1111
1139
|
});
|
|
1112
1140
|
```
|
|
1113
1141
|
|
package/lib/index.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Mazey v5.10.
|
|
2
|
+
* Mazey v5.10.2 https://github.com/chengchuu/mazey
|
|
3
3
|
* (c) 2018-2026 Cheng
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
"use strict";function e(e){try{return Date.prototype.getTime.call(e)}catch(e){return null}}const t=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2})(?::(\d{2}))?)?$/,n=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:\d{2})$/;function r(e,t,n,r,o,i,s=0,a=!1){const c=new Date(0);return a?(c.setUTCFullYear(e,t-1,n),c.setUTCHours(r,o,i,s),Number.isFinite(c.getTime())&&c.getUTCFullYear()===e&&c.getUTCMonth()===t-1&&c.getUTCDate()===n&&c.getUTCHours()===r&&c.getUTCMinutes()===o&&c.getUTCSeconds()===i&&c.getUTCMilliseconds()===s):(c.setFullYear(e,t-1,n),c.setHours(r,o,i,s),Number.isFinite(c.getTime())&&c.getFullYear()===e&&c.getMonth()===t-1&&c.getDate()===n&&c.getHours()===r&&c.getMinutes()===o&&c.getSeconds()===i&&c.getMilliseconds()===s)}function o(e,t,n,r,o,i,s=0){const a=new Date(0);return a.setFullYear(e,t-1,n),a.setHours(r,o,i,s),a}function i(i){if("number"==typeof i){const e=new Date(i);return Number.isFinite(i)&&Number.isFinite(e.getTime())?e:null}if("object"==typeof i&&null!==i){const t=e(i);return null!==t&&Number.isFinite(t)?new Date(t):null}if("string"!=typeof i)return null;const s=i.trim();if(!s)return null;const a=t.exec(s);if(a){const[e,t,n,i="0",s="0",c="0"]=a.slice(1),[u,l,f,p,d,m]=[e,t,n,i,s,c].map(Number);return r(u,l,f,p,d,m)?o(u,l,f,p,d,m):null}const c=n.exec(s);if(!c)return null;const[u,l,f,p,d,m="0",g="",h]=c.slice(1),y=Number(`${g}00`.slice(0,3));if(!r(Number(u),Number(l),Number(f),Number(p),Number(d),Number(m),y,!0))return null;if("Z"!==h){const e=Number(h.slice(1,3)),t=Number(h.slice(4,6));if(e>23||t>59)return null}return function(e,t,n,r,o,i,s,a){const c=new Date(0);if(c.setUTCFullYear(e,t-1,n),c.setUTCHours(r,o,i,s),"Z"===a)return c;const u="+"===a[0]?1:-1,l=60*Number(a.slice(1,3))+Number(a.slice(4,6));return new Date(c.getTime()-u*l*60*1e3)}(Number(u),Number(l),Number(f),Number(p),Number(d),Number(m),y,h)}const s=/^(\d{4,})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/;function a(e,t){const n=String(e);return n.length>=t?n:`${"0".repeat(t-n.length)}${n}`}const c={type:"d"};function u(e){return"string"==typeof e&&/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(e)?e.replace(" ","T"):e}function l(e=0,t=0,n=c){n=Object.assign({},c,n);const{type:r}=n;"number"==typeof e&&Number.isFinite(e)||(e=new Date(u(e)).getTime()),"number"==typeof t&&Number.isFinite(t)||(t=new Date(u(t)).getTime());const o=Number(t)-Number(e);let i="",[s,a,l,p]=new Array(4).fill(0);if(o>=0)switch(s=Math.floor(o/1e3/60/60/24),a=Math.floor(o/1e3/60/60),l=Math.floor(o/1e3/60),p=Math.floor(o/1e3),r){case"d":i=s;break;case"text":s=Math.floor(o/1e3/60/60/24),a=Math.floor(o/1e3/60/60%24),l=Math.floor(o/1e3/60%60),p=Math.floor(o/1e3%60),i=[{value:s,unit:"day"},{value:a,unit:"hour"},{value:l,unit:"minute"},{value:p,unit:"second"}].filter(({value:e})=>e>0).map(({value:e,unit:t})=>f(e,t)).join(" ")||f(0,"second");break;default:i=p}return i}function f(e,t){const n=Math.round(10*e)/10;return`${n} ${1===n?t:`${t}s`}`}function p(e,t){const n=Math.max(1,Math.round(e));return`about ${n} ${t}${1===n?"":"s"}`}function d(e,t="yyyy-MM-dd"){void 0===e&&(e=new Date);const n=new Date(e);if(!Number.isFinite(n.getTime()))throw new RangeError("Invalid date");const r=n.getHours(),o={yyyy:n.getFullYear(),MM:n.getMonth()+1,dd:n.getDate()<10?"0"+n.getDate():n.getDate(),HH:r<10?"0"+r:r,hh:(r%12||12)<10?"0"+(r%12||12):r%12||12,mm:n.getMinutes()<10?"0"+n.getMinutes():n.getMinutes(),ss:n.getSeconds()<10?"0"+n.getSeconds():n.getSeconds(),a:r<12?"AM":"PM"};let i=t||"yyyy-MM-dd";return Object.keys(o).forEach(e=>{let t=o[e];"MM"===e&&Number(t)<=9&&(t=`0${t}`),i=i.split(e).join(String(t))}),i}function m(e,t){const n=e.length,r=t.length;if(0===n||0===r)return 0;const o=Array.from({length:n},()=>new Array(r).fill(0));let i=0;for(let s=0;s<n;++s)for(let n=0;n<r;++n)if(e[s]===t[n]){let e=0;s>0&&n>0&&(e=o[s-1][n-1]),o[s][n]=e+1,i=Math.max(i,o[s][n])}return i}function g(e,t){const n=e.length,r=t.length;if(0===n||0===r)return 0;const o=Array.from({length:n},()=>new Array(r).fill(0));for(let i=0;i<n;++i)for(let n=0;n<r;++n)if(e[i]===t[n]){let e=0;i>0&&n>0&&(e=o[i-1][n-1]),o[i][n]=e+1}else{let[e,t]=[0,0];n>0&&(e=o[i][n-1]),i>0&&(t=o[i-1][n]),o[i][n]=Math.max(e,t)}return o[n-1][r-1]}function h(e){return Math.random()<e}const y=Function.prototype.toString.call(Object);function w(e,t,n){const r=Object.getOwnPropertyDescriptor(t,n)?.get;if(!r)return!1;try{return r.call(e),!0}catch(e){return!1}}function b(e){return null===e||"object"!=typeof e?e:x(e,new WeakMap)}function x(t,n){if(null===t||"object"!=typeof t)return t;const r=t,o=n.get(r);if(void 0!==o)return o;const i=e(r);if(null!==i){const e=new Date(i);return n.set(r,e),e}const s=function(e){const t=Object.getOwnPropertyDescriptor(RegExp.prototype,"source")?.get;if(!t)return null;try{return t.call(e)}catch(e){return null}}(r);if(null!==s){const e=t,o=new RegExp(s,function(e){return e.flags}(e));return o.lastIndex=e.lastIndex,n.set(r,o),o}if("undefined"!=typeof ArrayBuffer&&w(r,ArrayBuffer.prototype,"byteLength")){const e=ArrayBuffer.prototype.slice.call(t,0);return n.set(r,e),e}if("undefined"!=typeof SharedArrayBuffer&&w(r,SharedArrayBuffer.prototype,"byteLength")){const e=SharedArrayBuffer.prototype.slice.call(t,0);return n.set(r,e),e}if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)){const e=x(t.buffer,n),o="undefined"!=typeof DataView&&w(r,DataView.prototype,"byteLength")?new DataView(e,t.byteOffset,t.byteLength):new t.constructor(e,t.byteOffset,t.length);return n.set(r,o),o}if("undefined"!=typeof Map&&w(r,Map.prototype,"size")){const e=new Map;return n.set(r,e),Map.prototype.forEach.call(t,(t,r)=>{e.set(x(r,n),x(t,n))}),e}if("undefined"!=typeof Set&&w(r,Set.prototype,"size")){const e=new Set;return n.set(r,e),Set.prototype.forEach.call(t,t=>{e.add(x(t,n))}),e}const a=Array.isArray(t),c=Object.getPrototypeOf(t),u=function(e){const t=Object.getPrototypeOf(e);if(null===t)return!0;const n=Object.hasOwn(t,"constructor")?t.constructor:null;return"function"==typeof n&&Function.prototype.toString.call(n)===y}(r),l=!a&&!u&&function(e){const t=Object.getPrototypeOf(e),n=t?.constructor;return"function"==typeof n&&-1===Function.prototype.toString.call(n).indexOf("[native code]")}(r);if(!a&&!u&&!l)return n.set(r,t),t;const f=a?new Array(t.length):Object.create(l?Object.prototype:c);return n.set(r,f),function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}(r).forEach(e=>{if(a&&"length"===e)return;const t=Object.getOwnPropertyDescriptor(r,e);t&&("value"in t&&(t.value=x(t.value,n)),Object.defineProperty(f,e,t))}),f}function v(e){const t=e.replace(/([A-Z])/g,"-$1").toLowerCase();return"-"===t[0]?t.substring(1):t}function E(e){const t=e.replace(/([A-Z])/g,"_$1").toLowerCase();return"_"===t[0]?t.substring(1):t}function T(e){return E(e)}function S(e){if("string"!=typeof e)throw new TypeError("value must be a string");const t=e.replace(/[^A-Za-z0-9_$]/g,"_").toUpperCase();return/^[A-Za-z_$]/.test(t)?t:`_${t}`}function A(e){if("string"!=typeof e)return!1;try{return JSON.parse(e),!0}catch(e){}return!1}function N(e=5){if(!Number.isFinite(e)||e<=0)return"";e=Math.floor(e);let t="";for(;e--;)t+=Math.floor(10*Math.random());return t}function C(e=5){return N(e)}function $(e=3){const[t,n]=[Date.now(),C(e||3)];return t+n}function O(e,t={}){const{isNaNAsNumber:n=!1,isInfinityAsNumber:r=!1,isUnFiniteAsNumber:o=!1,integer:i=!1,min:s,max:a}=t;return"number"==typeof e&&(!(!0!==r&&!0!==o&&!isFinite(e))&&(!(!n&&isNaN(e))&&((void 0===s||"number"==typeof s&&!Number.isNaN(s))&&((void 0===a||"number"==typeof a&&!Number.isNaN(a))&&(!(void 0!==s&&void 0!==a&&s>a)&&(!(!0===i&&!Number.isInteger(e))&&((void 0===s&&void 0===a||!Number.isNaN(e))&&!(void 0!==s&&e<s||void 0!==a&&e>a))))))))}function _(e,...t){let n=null;return e&&"function"==typeof e&&(n=e(...t)),n}function j(e,...t){return _(e,...t)}function M(e){let t=!1;return Array.isArray(e)&&e.length&&(t=!0),t}function D(e){const t=Boolean(e),n="object"==typeof e,r="[object Object]"===Object.prototype.toString.call(e);return t&&n&&r}function L(e){return"boolean"==typeof e}function k(e){return null==e}function P(e){if(!e)return"";const t=new RegExp("\\n","g");return e.replace(t,"<br />")}function F(e,t={}){const{removeNewLine:n=!1}=t;let r="";return e&&(r=e.replace(/<\/?.+?>/g,""),n&&(r=r.replace(/[\r\n]/g,""))),r}function R(e){const t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/[&<>"'/]/g,e=>t[e])}const U=R;function z(e){const t={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/(&|<|>|"|'|/)/g,e=>t[e])}const I=z;function B(e,t,n={hasDot:!1,dotText:"..."}){if(n=Object.assign({hasDot:!1,dotText:"..."},n),""!=e&&e){let r=0,o="";const i=/[^\x00-\xff]/g;let s="";const a=e.replace(i,"**").length;for(let n=0;n<a&&(s=e.charAt(n).toString(),null!=s.match(i)?r+=2:r++,!(r>t));n++)o+=s;return n.hasDot&&a>t&&(o+=n.dotText),o}return""}const H=B;function q(e,t,n=!1){return B(e,t,{hasDot:n})}const W=["B","KB","MB","GB","TB"];function V(e,t={}){const{base:n=1024,fractionDigits:r=1,invalidValue:o=""}=t;if(!Number.isFinite(e)||e<0||1e3!==n&&1024!==n||!Number.isInteger(r)||r<0||r>20)return o;let i=e,s=0;for(;i>=n&&s<W.length-1;)i/=n,s+=1;return 0===s?`${Number(i.toFixed(r))} ${W[s]}`:`${i.toFixed(r)} ${W[s]}`}function Y(e){return/^1\d{10}$/.test(e)}const Z=Y,J=Y;async function Q(e){return new Promise(t=>{setTimeout(()=>{t(e)},e)})}let G="";function K(e,t){const n=e[t];if(void 0!==n&&"string"!=typeof n)throw new TypeError(`manifest.${t} must be a string when provided`);return n}function X(e){if(void 0===e)return{name:""};if("string"==typeof e)return{name:e.trim()};if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("manifest.author must be a string or object");const t=e,n={name:""};for(const e of["name","email","url"]){const r=t[e];if(void 0!==r&&"string"!=typeof r)throw new TypeError(`manifest.author.${e} must be a string when provided`);if("string"==typeof r){const t=r.trim();("name"===e||t)&&(n[e]=t)}}return n}function ee(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}}function te(e){const t=e.indexOf("#"),n=-1===t?e:e.slice(0,t),r=n.indexOf("?"),o=/^(?:[a-z][a-z\d+.-]*:)?\/\//i.test(n)||"/"===n.charAt(0),i=-1===r?o?"":n:n.slice(r+1);return i?i.split("&").reduce((e,t)=>{if(!t||-1===t.indexOf("="))return e;const n=t.indexOf("=");return e.push([ee(t.slice(0,n)),ee(t.slice(n+1))]),e},[]):[]}function ne(e,t){return te(e).filter(([e])=>e===t).map(([,e])=>e)}const re=/^(?=.{1,39}$)(?!.*--)[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$/,oe=/^(?=.{1,100}$)(?!\.{1,2}$)[A-Za-z0-9_.-]+$/;function ie(){return new Error("The value does not identify one supported GitHub repository")}function se(e,t){const n=t.replace(/\.git$/i,"");if(!re.test(e)||!oe.test(n))throw ie();const r=`${e}/${n}`;return{owner:e,name:n,slug:r,url:`https://github.com/${r}`}}function ae(e){return void 0===e||Number(e)<=65535}function ce(e){const t=e.split(".");return 4===t.length&&t.every(e=>/^\d{1,3}$/.test(e)&&(1===e.length||"0"!==e.charAt(0))&&Number(e)<=255)}function ue(e){const t=e.split("::");if(t.length>2)return!1;const n=2===t.length;let r=[];t.forEach(e=>{e&&(r=r.concat(e.split(":")))});let o=0;for(let e=0;e<r.length;e++){const t=r[e];if(-1!==t.indexOf(".")){if(e!==r.length-1||!ce(t))return!1;o+=2}else{if(!/^[0-9a-f]{1,4}$/i.test(t))return!1;o+=1}}return n?o<8:8===o}function le(e){const t=e.match(/^\[([0-9a-f:.]+)\]$/i);if(t)return ue(t[1]);if("."===e.charAt(e.length-1)&&(e=e.slice(0,-1)),ce(e))return!0;const n=e.split(".");return!(n.length<2||n.some(e=>!e||!/^[a-z\d-]+$/i.test(e)||"-"===e.charAt(0)||"-"===e.charAt(e.length-1)))&&!/^\d+$/.test(n[n.length-1])}function fe(e,t={strict:!0}){if("string"!=typeof e||!e||e.trim()!==e)return!1;const n=/^https?:\/\/[^/\\]/i.test(e),r=/^\/\/[^/\\]/.test(e);if(!n&&(t.strict||!r))return!1;const o=r?`http:${e}`:e;if(!function(e){const t=e.match(/^https?:\/\/([^/?#]+)(?:[/?#][^\s<>"`]*)?$/i);if(!t||-1!==t[1].indexOf("@"))return!1;const n=t[1],r=n.match(/^\[([0-9a-f:.]+)\](?::(\d*))?$/i);if(r)return ue(r[1])&&ae(r[2]);const o=n.match(/^([^:]+)(?::(\d*))?$/);return!(!o||!ae(o[2]))&&le(o[1])}(o))return!1;try{const e=new URL(o);return("http:"===e.protocol||"https:"===e.protocol)&&le(e.hostname)&&!e.username&&!e.password}catch(e){return!1}}function pe(e){let t="";if("string"!=typeof e||""==e)return t;const n=e.split(/[?#]/,1)[0],r=/\.[^/]+$/.exec(n);return r?(r[0].length>1&&(t=r[0].substring(1)),t):t}const de=pe;function me(e){return e.replace(/^http:/,"https:")}const ge={enabled:!0,isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",isStringifyObject:!1,logFn:()=>{},errorFn:()=>{}};function he(e="",t={...ge}){const{enabled:n,isClosed:r,showWrap:o,showDate:i,locales:s,isStringifyObject:a,logFn:c,errorFn:u}=Object.assign({...ge},t);let l=n;!0===r&&(ye.warn("The options.isClosed is deprecated. Please use options.enabled instead."),l=!1);const f=Object.create(null),p=()=>(new Date).toLocaleDateString(s,{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"});return["log","info","warn","error"].forEach(t=>{f[t]=function(...n){if(!l)return;let r=e,s=e;if("string"==typeof e&&e.length>=2){const t=e.length;r=":"===e[t-1]?e.substring(0,t-1):e}o&&console.log(`--- ${r} - begin ---`),i&&(s=e?`${p()} ${e}`:`${p()}`),a&&(n=n.map(e=>D(e)?JSON.stringify(e):e)),e||i?console[t](s,...n):console[t](...n),"log"===t&&c(),"error"===t&&u(),o&&console.log(`--- ${r} - end ---`)}}),f}const ye=he("[Mazey]"),we=he("",{showDate:!0,locales:"zh-CN",isStringifyObject:!0});function be(e,t){if(!e)return void ye.error("The element is not exist.");if(Array.isArray(t))return void t.forEach(t=>{t&&e.classList.add(t)});if(!t)return;const n=e.className,r=n.split(/\s+/);for(let e=0;e<r.length;e++)if(r[e]===t)return;let o="",i="";""!==n&&(o=" "),i=n+o+t,e.className=i}function xe(e,t={id:""}){if(!e)return!1;const n=document.createDocumentFragment();let r=null,o="";const i=document.createElement("style");return t.id?(o=`${t.id}`,r=document.getElementById(o),r?r.innerHTML=e:(i.setAttribute("id",t.id),i.innerHTML=e,n.appendChild(i),document.head.appendChild(n))):(i.innerHTML=e,n.appendChild(i),document.head.appendChild(n)),!0}const ve=xe;function Ee(){const e=window.jQuery||window.$;if(e){const t=e("img");return!(!t||!t.length)&&(t.each(function(){const t=e(this);if(!t)return;const n=t.attr("src");if(!(n&&"string"==typeof n&&n.length))return;const r=n.match(/[?&]width=([0-9]+[a-z%]*)/),o=n.match(/[?&]height=([0-9]+[a-z%]*)/);r&&M(r)&&r[1]&&t.width(r[1]),o&&M(o)&&o[1]&&t.height(o[1])}),!0)}{const e=document.getElementsByTagName("img");if(e.length>0)return Array.from(e).forEach(function(e){const t=e;if(!t)return;const n=t.getAttribute("src");if(!(n&&"string"==typeof n&&n.length))return;const r=n.match(/[?&]width=([0-9]+[a-z%]*)/),o=n.match(/[?&]height=([0-9]+[a-z%]*)/);r&&M(r)&&r[1]&&(t.style.width=r[1]),o&&M(o)&&o[1]&&(t.style.height=o[1])}),!0}return!1}function Te(e,t){let n="";return t&&t.length>0&&(n=t.join(";")+";"),`${e}{${n}}`}const Se=Te;function Ae(e,t={}){if("string"!=typeof e)return!1;const n=e.trim();if(!n)return!0===t.allowEmpty;const r=t.root||("undefined"==typeof document?null:document);if(!r)return!1;try{return r.querySelector(n),!0}catch(e){return!1}}function Ne(e){return Boolean(e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName&&"function"==typeof e.getAttribute)}const Ce=new WeakMap,$e=new WeakMap,Oe={button:"inline-block",input:"inline-block",select:"inline-block",textarea:"inline-block",table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell",li:"list-item",summary:"list-item"},_e=new Set(["address","article","aside","blockquote","body","dd","details","dialog","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","main","nav","ol","p","pre","section","ul"]);function je(e){if(!Ne(e))return null;const t=e.style;return t&&"string"==typeof t.display?e:null}function Me(e){const t=new Set,n=e=>{const n=je(e);n&&t.add(n)};if("string"==typeof e){if("undefined"==typeof document)return[];try{document.querySelectorAll(e).forEach(n)}catch(e){return[]}return Array.from(t)}const r=je(e);if(r)return[r];if(!e||"object"!=typeof e)return[];if("function"==typeof e[Symbol.iterator]){for(const t of e)n(t);return Array.from(t)}const o=e.length;if(!Number.isSafeInteger(o)||o<0)return[];for(let t=0;t<o;t+=1)n(e[t]);return Array.from(t)}function De(e){const t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e).display:null}function Le(e){const t=e.ownerDocument,n=e.localName.toLowerCase();let r=$e.get(t);r||(r=new Map,$e.set(t,r));const o=e.namespaceURI||"",i=`${o}:${n}`,s=r.get(i);if(s)return s;let a="";const c="http://www.w3.org/1999/xhtml"===o&&n.includes("-"),u=t.body||t.documentElement;if(u&&!c){const e=o&&"http://www.w3.org/1999/xhtml"!==o?t.createElementNS(o,n):t.createElement(n);u.appendChild(e);try{a=De(e)||""}finally{u.removeChild(e)}}return a&&"none"!==a||(a=function(e){return Oe[e]?Oe[e]:_e.has(e)?"block":"inline"}(n)),r.set(i,a),a}function ke(e){return Me(e).forEach(e=>{"none"!==De(e)&&"none"!==e.style.display&&Ce.set(e,e.style.display),e.style.display="none"}),e}function Pe(e){return Me(e).forEach(e=>{Ce.has(e)?(e.style.display=Ce.get(e),Ce.delete(e)):"none"===e.style.display&&(e.style.display=""),""===e.style.display&&"none"===De(e)&&(e.style.display=Le(e))}),e}function Fe(){const e=window.MAZEY_DEFINE_LISTENERS;if(e&&"object"==typeof e)return e;const t=Object.create(null);return window.MAZEY_DEFINE_LISTENERS=t,t}function Re(e,t){const n=Fe();Array.isArray(n[e])||Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:[],writable:!0}),"function"==typeof t&&n[e].push(t)}const Ue=Re;function ze(e,t){const n=Fe()[e];if(Array.isArray(n)){const e=n.slice();for(let n=0,r=e.length;n<r;n++)"function"==typeof e[n]&&(void 0===t?e[n]():e[n](t))}}function Ie(e,t=null){if(e){const n=JSON.stringify(t);sessionStorage.setItem(e,void 0===n?"null":n)}}function Be(e){let t=null;if(e){const n=sessionStorage.getItem(e);if(n)try{t=JSON.parse(n)}catch(e){t=n}}return t}function He(e,t=null){if(e){const n=JSON.stringify(t);localStorage.setItem(e,void 0===n?"null":n)}}function qe(e){let t=null;if(e){const n=localStorage.getItem(e);if(n)try{t=JSON.parse(n)}catch(e){t=n}}return t}const We=Ie,Ve=Be,Ye=He,Ze=qe,Je="__mazey_cookie_name_encoded__-",Qe="__mazey_cookie_value_encoded__-";function Ge(e){return`${Qe}${encodeURIComponent(e)}`}function Ke(e){const t=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/.test(e),n=0===e.indexOf(Je)||0===e.indexOf(Qe);return t&&!n?e:function(e){return`${Je}${encodeURIComponent(e)}`}(e)}function Xe(e){const t=Ke(e);return t!==e?[t,e]:[e]}function et(e){const t=e+"=",n=document.cookie.split(";");for(let e=0;e<n.length;e++){const r=n[e].trim();if(0===r.indexOf(t))return r.substring(t.length)}}function tt(e){const t=Xe(e),n="1"===et(Ge(e));for(let e=0;e<t.length;e++){const r=et(t[e]);if(void 0!==r){if(n)try{return decodeURIComponent(r)}catch(e){return r}return r}}return""}function nt(e){const t=Xe(e),n=t.concat(Ge(e)),r=new Date;r.setTime(r.getTime()-1);const o=t.some(e=>void 0!==et(e));return n.forEach((e,t)=>{if(n.indexOf(e)===t&&void 0!==et(e)){[`${e}=; expires=${r.toUTCString()}`,`${e}=; expires=${r.toUTCString()}; path=/`].forEach(e=>{document.cookie=e;const t=location.hostname;if(-1!==t.indexOf(".")){const n=t.split(".");for(let t=0;t<n.length;t++)document.cookie=`${e}; domain=.${n.slice(t).join(".")}`}})}}),o&&n.every(e=>void 0===et(e))}function rt(e,t={id:""}){const{id:n}=t;return new Promise((t,r)=>{const o=document.createElement("link");let i=!1;const s=()=>{o.onload=null,o.onerror=null};o.rel="stylesheet",o.type="text/css",o.href=e,void 0!==n&&(o.id=n),o.onload=()=>{i||(i=!0,s(),t("loaded"))},o.onerror=()=>{i||(i=!0,s(),r(new Error(`Failed to load CSS: ${e}`)))},document.head.appendChild(o)})}const ot={id:"",callback:function(){},timeout:5e3,isDefer:!1,isAsync:!1,isCrossOrigin:!1,attributes:null,cssUrl:""};function it(e,t={...ot}){const{id:n,callback:r,timeout:o,isDefer:i,isAsync:s,isCrossOrigin:a,attributes:c,cssUrl:u}=Object.assign({...ot},t);if(u){const t=function(e,t){if(!t)return"";if(fe(t))return t;try{const n=new URL(e,location.href);return new URL(t,n).href}catch(n){const r=e.split("/");return r.pop(),`${r.join("/")}/${t}`}}(e,u);t&&rt(t).catch(e=>{console.error(`Failed to load CSS from ${t}: ${e?.message}`)})}return new Promise((t,u)=>{const l=document.createElement("script");let f=!1,p=null;const d=()=>{l.onload=null,l.onerror=null,null!==p&&(clearTimeout(p),p=null)},m=e=>{f||(f=!0,d(),u(e))};l.type="text/javascript",l.defer=Boolean(i),l.async=Boolean(s),a&&(l.crossOrigin="anonymous"),n&&(l.id=n),c&&Object.keys(c).forEach(e=>{l.setAttribute(e,c[e])}),l.onload=()=>{if(!f){f=!0,d();try{j(r),t("loaded")}catch(e){u(e)}}},l.onerror=()=>m(new Error(`Failed to load script: ${e}`)),l.src=e,o&&(p=setTimeout(()=>m(new Error("timeout")),o));const g=document.getElementsByTagName("script")[0];if(g?.parentNode)g.parentNode.insertBefore(l,g);else{(document.head||document.body||document.documentElement).appendChild(l)}})}const st=new Map;function at(e){if("undefined"==typeof window)return!1;let t=[];const n=window.PerformanceObserver;return!!n&&(M(n.supportedEntryTypes)&&(t=n.supportedEntryTypes),t.includes(e))}async function ct(){return at("paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-contentful-paint"===e.name);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"paint",buffered:!0})}):0}async function ut(){return at("paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-paint"===e.name);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"paint",buffered:!0})}):0}function lt(e,t=e.userAgent.trim().toLowerCase()){return/\bmacintosh\b/.test(t)&&"macintel"===e.platform.toLowerCase()&&e.maxTouchPoints>1}const ft=Object.freeze(["adsbot-google","ahrefsbot","amazonbot","applebot","baiduspider","bingbot","bingpreview","bytespider","ccbot","chatgpt-user","claudebot","discordbot","dotbot","duckduckbot","facebookexternalhit","facebot","google-inspectiontool","googlebot","googleother","gptbot","linkedinbot","mediapartners-google","mj12bot","perplexitybot","petalbot","semrushbot","slackbot","slurp","storebot-google","telegrambot","twitterbot","whatsapp","yandexbot"]),pt=Object.freeze(["headlesschrome","phantomjs","slimerjs","selenium","puppeteer","playwright"]);function dt(){try{return"undefined"==typeof navigator?null:navigator}catch(e){return null}}function mt(){const e=dt();if(!e)return{userAgent:"",platform:"",maxTouchPoints:0};let t="",n="",r=0;try{const n=e.userAgent;t="string"==typeof n?n:""}catch(e){return{userAgent:"",platform:"",maxTouchPoints:0}}try{const t=e.platform;n="string"==typeof t?t:""}catch(e){n=""}try{const t=e.maxTouchPoints;r=Number.isFinite(t)?t:0}catch(e){r=0}return{userAgent:t,platform:n,maxTouchPoints:r}}function gt(e){const t=e.userAgent.trim().toLowerCase();return t?/\bandroid\b|\badr\b/.test(t)?"android":/\bios\b|\biphone\b|\bipad\b|\bipod\b|\biwatch\b/.test(t)||lt(e,t)?"ios":/\bwindows\b|\bwin32\b|\bwin64\b|\bwow32\b|\bwow64\b/.test(t)?"windows":/\bmacintosh\b|\bmacintel\b|\bmac os x\b/.test(t)?"macos":/\blinux\b/.test(t)?"linux":"":""}function ht(e){const t=e.userAgent.trim().toLowerCase();if(!t)return"";if(/\biwatch\b|\bapple watch\b/.test(t))return"";if(/\bipad\b|\btablet\b/.test(t)||lt(e,t))return"tablet";const n=gt(e);return"android"===n?/\bmobile\b/.test(t)?"mobile":"tablet":"ios"===n&&/\biphone\b|\bipod\b/.test(t)?"mobile":"windows"===n||"macos"===n||"linux"===n||/\bcros\b/.test(t)?"desktop":/\bmobile\b/.test(t)?"mobile":""}function yt(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");return ht(void 0!==e?{userAgent:e,platform:"",maxTouchPoints:0}:mt())}function wt(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");return gt(void 0!==e?{userAgent:e,platform:"",maxTouchPoints:0}:mt())}function bt(e,t){const n=e.trim().toLowerCase();return t.some(e=>n.includes(e))}function xt(e){if(void 0===e)return function(){try{return"undefined"==typeof window||"undefined"==typeof navigator?null:{window:window,navigator:navigator,document:"undefined"==typeof document?void 0:document}}catch(e){return null}}();if(null===e||"object"!=typeof e||Array.isArray(e))return null;try{const t=e.window,n=e.navigator,r=e.document;return null===t||"object"!=typeof t||null===n||"object"!=typeof n||void 0!==r&&(null===r||"object"!=typeof r)?null:{window:t,navigator:n,document:r}}catch(e){return null}}function vt(){if(window.MAZEY_BROWSER_INFO&&"object"==typeof window.MAZEY_BROWSER_INFO)return window.MAZEY_BROWSER_INFO;let e={engine:"",engineVs:"",platform:"",supporter:"",supporterVs:"",system:"",systemVs:"",shell:"",shellVs:"",appleType:"",colorScheme:""};try{const t=mt(),n=t.userAgent.toLowerCase();if(!n)return e;const r=e=>e.test(n),o=e=>{let t="";const r=n.match(e);return r&&M(r)&&(t=r.toString(),t=t.replace(/[^0-9|_.]/g,""),t=t.replace(/_/g,".")),t},i=gt(t);let s="";"ios"===i&&(r(/ipad/g)?s="ipad":r(/iphone/g)?s="iphone":r(/iwatch/g)?s="iwatch":r(/ipod/g)?s="ipod":"macintel"===t.platform.toLowerCase()&&t.maxTouchPoints>1&&(s="ipad")),e={...e,system:i,appleType:s};let a="";"windows"===i?r(/windows nt 5.0|windows 2000/g)?a="2000":r(/windows nt 5.1|windows xp/g)?a="xp":r(/windows nt 5.2|windows 2003/g)?a="2003":r(/windows nt 6.0|windows vista/g)?a="vista":r(/windows nt 6.1|windows 7/g)?a="7":r(/windows nt 6.2|windows 8/g)?a="8":r(/windows nt 6.3|windows 8.1/g)?a="8.1":r(/windows nt 10.0|windows 10/g)&&(a="10"):"macos"===i?a=o(/os x [\d._]+/g):"android"===i?a=o(/android [\d._]+/g):"ios"===i&&(a=o(/os [\d._]+/g)),e={...e,systemVs:a};let c="";"windows"===i||"macos"===i||"linux"===i?c="desktop":("android"===i||"ios"===i||r(/mobile/g))&&(c="mobile"),e={...e,platform:c};let u="",l="";r(/applewebkit/g)?(u="webkit",r(/edg(?:a|ios)?\//g)||r(/edge\//g)?l="edge":r(/opr/g)?l="opera":r(/chrome/g)?l="chrome":r(/safari/g)&&(l="safari")):r(/gecko/g)&&r(/firefox/g)?(u="gecko",l="firefox"):r(/presto/g)?(u="presto",l="opera"):r(/trident|compatible|msie/g)&&(u="trident",l="iexplore"),e={...e,engine:u,supporter:l};let f="";"webkit"===u?f=o(/applewebkit\/[\d._]+/g):"gecko"===u?f=o(/gecko\/[\d._]+/g):"presto"===u?f=o(/presto\/[\d._]+/g):"trident"===u&&(f=o(/trident\/[\d._]+/g)),e={...e,engineVs:f};let p="";"chrome"===l?p=o(/chrome\/[\d._]+/g):"safari"===l?p=o(/version\/[\d._]+/g):"firefox"===l?p=o(/firefox\/[\d._]+/g):"opera"===l?p=o(/opr\/[\d._]+/g):"iexplore"===l?p=o(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===l&&(p=o(/(?:edge|edg|edga|edgios)\/[\d._]+/g)),e={...e,supporterVs:p};let d="",m="";r(/micromessenger/g)?(d="wechat",m=o(/micromessenger\/[\d._]+/g)):r(/qqbrowser/g)?(d="qq_browser",m=o(/qqbrowser\/[\d._]+/g)):r(/\sqq/g)?d="qq_app":r(/ucbrowser/g)?(d="uc",m=o(/ucbrowser\/[\d._]+/g)):r(/qihu 360se/g)?d="360":r(/2345explorer/g)?(d="2345",m=o(/2345explorer\/[\d._]+/g)):r(/metasr/g)?d="sougou":r(/lbbrowser/g)?d="liebao":r(/maxthon/g)?(d="maxthon",m=o(/maxthon\/[\d._]+/g)):r(/biliapp/g)&&(d="bilibili"),e={...e,shell:d,shellVs:m};let g="";if(window.matchMedia){const e=window.matchMedia("(prefers-color-scheme: dark)"),t=window.matchMedia("(prefers-color-scheme: light)");e.matches?g="dark":t.matches&&(g="light")}return e={...e,colorScheme:g},window.MAZEY_BROWSER_INFO=e,e}catch(t){return ye.warn(t),e}}function Et(e="",t="-"){const n=vt(),r=[];return["system","platform","engine","supporter","shell","appleType"].forEach(o=>{const i=n[o];if(i){let n="";e&&e.length>0&&(n=`${e}${t}`),r.push(`${n}${i}`)}}),r}const Tt=Et;let St="";function At(e){if("string"!=typeof e||""===e.trim())throw new TypeError("storageKey must be a non-empty string.")}function Nt(e){if("undefined"==typeof window)return null;try{return new URL(window.location.href).searchParams.get(e)}catch(e){return null}}function Ct(e){if("undefined"==typeof window)return null;try{const t=window.localStorage;return t&&"function"==typeof t.getItem?t.getItem(e):null}catch(e){return null}}function $t(e,t){if("undefined"==typeof window)return!1;try{const n=window.localStorage;return!(!n||"function"!=typeof n.setItem)&&(n.setItem(e,t),!0)}catch(e){return!1}}const Ot=Object.freeze({system:"System",light:"Light",dark:"Dark"});function _t(e){return"light"===e||"dark"===e}function jt(){if("undefined"==typeof window)return null;try{const e=window.matchMedia;return"function"!=typeof e?null:e.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){return null}}function Mt(e,t){return{value:e,label:Ot[t]}}function Dt(e){const t=e.split("-");if(!/^[a-z]{2,8}$/i.test(t[0]))return null;const n=[t[0].toLowerCase()];let r=1;if(r<t.length&&/^[a-z]{4}$/i.test(t[r])){const e=t[r].toLowerCase();n.push(`${e[0].toUpperCase()}${e.slice(1)}`),r++}for(r<t.length&&(/^[a-z]{2}$/i.test(t[r])||/^\d{3}$/.test(t[r]))&&(n.push(/^[a-z]{2}$/i.test(t[r])?t[r].toUpperCase():t[r]),r++);r<t.length;r++){const e=t[r];if(!/^(?:[a-z0-9]{5,8}|\d[a-z0-9]{3})$/i.test(e))return null;n.push(e.toLowerCase())}return n.join("-")}function Lt(e){if("string"!=typeof e)return null;const t=e.trim().replace(/_/g,"-");if(!t)return null;if("undefined"!=typeof Intl)try{const e=Intl,n=e.getCanonicalLocales;if("function"==typeof n){const r=n.call(e,t)[0];return"string"==typeof r&&r?r:null}}catch(e){return e instanceof RangeError||"object"==typeof e&&null!==e&&"name"in e&&"RangeError"===e.name?null:Dt(t)}return Dt(t)}function kt(e){if("undefined"==typeof Intl)return e;try{const t=Intl.DisplayNames;if("function"!=typeof t)return e;const n=new t([e],{type:"language"}).of(e);return"string"==typeof n&&n.trim()?n:e}catch(t){return e}}function Pt(e){return{value:e,label:kt(e)}}exports.addClass=be,exports.addEvent=Ue,exports.addStyle=ve,exports.assignDefined=function(e,...t){return t.forEach(t=>{void 0!==t&&Object.keys(t).forEach(n=>{const r=t[n];if(void 0!==r){const t=e;"__proto__"!==n||Object.hasOwn(e,n)?t[n]=r:Object.defineProperty(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0})}})}),e},exports.calLongestCommonSubsequence=function(e,t){return g(e,t)},exports.calLongestCommonSubstring=function(e,t){return m(e,t)},exports.calculateAspectRatio=function(e,t){if(!Number.isSafeInteger(e))throw new TypeError("width must be a safe integer.");if(!Number.isSafeInteger(t))throw new TypeError("height must be a safe integer.");if(e<=0||t<=0)throw new RangeError("width and height must be greater than zero.");const n=function(e,t){for(;0!==t;){const n=e%t;e=t,t=n}return e}(e,t);return`${e/n}x${t/n}`},exports.calculateCAGR=function(e,t,n){const r=i(e);if(!r)throw new TypeError("startDate must be a valid date.");const o=i(t);if(!o)throw new TypeError("endDate must be a valid date.");const s=o.getTime()-r.getTime();if(s<=0)throw new RangeError("endDate must be later than startDate.");const a=function(e){if("number"==typeof e){if(!Number.isFinite(e))throw new TypeError("totalReturnRate must be a finite number or percentage string.");return e}if("string"!=typeof e)throw new TypeError("totalReturnRate must be a finite number or percentage string.");const t=e.trim();if(!t)throw new TypeError("totalReturnRate must not be empty.");const n=t.endsWith("%")?t.slice(0,-1).trim():t;if(!n)throw new TypeError("totalReturnRate must be a valid percentage string.");const r=Number(n);if(!Number.isFinite(r))throw new TypeError("totalReturnRate must be a valid percentage string.");return r/100}(n);if(a<=-1)throw new RangeError("totalReturnRate must be greater than -1.");const c=s/864e5,u=Math.pow(1+a,365/c)-1;if(!Number.isFinite(u))throw new RangeError("calculated CAGR must be finite.");return u},exports.camelCase2Underscore=T,exports.camelCaseToKebabCase=function(e){return v(e)},exports.cancelBubble=function(e){e.stopPropagation()},exports.clearHTML=function(e,t={}){return F(e,t)},exports.clearHtml=function(e,t={}){return F(e,t)},exports.convert10To26=function(e){if(!Number.isFinite(e)||e<=0)return"";e=Math.floor(e);let t="";for(;e>0;){let n=e%26;0===n&&(n=26),t=String.fromCharCode(n+96)+t,e=(e-n)/26}return t},exports.convertCamelToKebab=v,exports.convertCamelToUnder=E,exports.convertHttpToHttps=me,exports.convertKebabToCamel=function(e){const t=e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());return t.endsWith("-")?t.slice(0,-1):t},exports.convertObjectToQuery=function(e){return e&&0===Object.keys(e).length?"":`?${Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}`},exports.convertToHtmlBreaks=P,exports.convertUnderToCamel=function(e){return e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase())},exports.createCSSRule=Te,exports.cutCHSString=function(e,t,n=!1){return q(e,t,n)},exports.cutZHString=H,exports.debounce=function(e,t,n){let r=null,o=null,i=null,s=null,a=null;const c=function(){const u=Date.now()-i;u<t&&u>=0?o=setTimeout(c,t-u):(o=null,n||(a=e.apply(r,s),o||(r=s=null)))};return function(...u){r=this,s=u,i=Date.now();const l=n&&!o;return o||(o=setTimeout(c,t)),l&&(a=e.apply(r,s),r=s=null),a}},exports.deepCopy=b,exports.deepCopyObject=function(e){return b(e)},exports.deepFreeze=function e(t){return!t||"object"!=typeof t||Object.isFrozen(t)||(Object.freeze(t),Object.values(t).forEach(e)),t},exports.delCookie=function(e){nt(e)},exports.derivePackageMetadata=function(e,t={}){if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("manifest must be an object");if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError("options must be an object when provided");const n=e;if("string"!=typeof n.name||!n.name.trim())throw new TypeError("manifest.name must be a non-empty string");const r=n.name.trim(),o=function(e){if(/\s/.test(e))throw new TypeError("manifest.name must not contain whitespace");if(e.startsWith("@")){const t=e.split("/");if(2!==t.length||t[0].length<2||!t[1])throw new TypeError("manifest.name must be a valid scoped package name");return t[1]}if(e.includes("/"))throw new TypeError("manifest.name must be an unscoped or scoped package name");return e}(r),i=t.packageManager??"npm";if("npm"!==i&&"pnpm"!==i&&"yarn"!==i)throw new TypeError('packageManager must be "npm", "pnpm", or "yarn"');const s="npm"===i?"npm install":`${i} add`;return{name:r,version:K(n,"version"),description:K(n,"description"),license:K(n,"license"),author:X(n.author),unscopedName:o,iifeGlobal:S(o),installCommand:`${s} ${r}`}},exports.detectVisitorType=function(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");const t=void 0===e?function(){const e=dt();if(!e)return"";try{const t=e.userAgent;return"string"==typeof t?t:""}catch(e){return""}}():e;return bt(t,ft)?"crawler":bt(t,pt)||function(){const e=dt();if(!e)return!1;try{return!0===e.webdriver}catch(e){return!1}}()?"automation":"unknown"},exports.doFn=j,exports.escapeHTML=R,exports.escapeHtmlAttribute=function(e,t={}){if("string"!=typeof e)throw new TypeError("value must be a string.");const n=t.preserveEntities?/&(?!(?:#[0-9]+|#x[0-9a-f]+|[a-z][a-z0-9]+);)/gi:/&/g,r={"<":"<",">":">",'"':""","'":"'"};return e.replace(n,"&").replace(/[<>"']/g,e=>r[e])},exports.extractElementText=function(e,t={}){const{excludeSelector:n="",replaceImagesWithAlt:r=!0,normalizeWhitespace:o=!0}=t,i=e.cloneNode(!0);r&&Array.from(i.querySelectorAll("img[alt]")).forEach(e=>{const t=e.getAttribute("alt")||"";e.parentNode?.replaceChild(i.ownerDocument.createTextNode(t),e)});const s=n.trim();s&&Ae(s,{root:i})&&Array.from(i.querySelectorAll(s)).forEach(e=>e.parentNode?.removeChild(e));const a=i.innerText||i.textContent||"";return o?a.replace(/\u00a0/g," ").replace(/\s+/g," ").trim():a},exports.fireEvent=ze,exports.floatFixed=function(e,t=0){return parseFloat(String(e)).toFixed(t)},exports.floatToPercent=function(e,t=0){let n="";return n=t?(100*e).toFixed(t):String(Math.floor(100*e)),`${n}%`},exports.formatByteSize=V,exports.formatDate=d,exports.formatDistanceToNow=function(e){const t=i(e);if(!t)return"";const n=6e4,r=36e5,o=864e5,s=Math.abs(t.getTime()-Date.now());return s<3e4?"less than a minute":s<9e4?"about 1 minute":s<27e5?p(s/n,"minute"):s<54e5?"about 1 hour":s<864e5?p(s/r,"hour"):s<1512e5?"about 1 day":s<30*o?p(s/o,"day"):s<45*o?"about 1 month":s<365*o?p(s/(30*o),"month"):s<545*o?"about 1 year":p(s/(365*o),"year")},exports.formatDurationFromMs=function(e){const t=(Number.isFinite(e)?Math.max(e,0):0)/1e3;return t>=86400?f(t/24/60/60,"day"):t>=3600?f(t/60/60,"hour"):t>=60?f(t/60,"minute"):f(t,"second")},exports.formatLocalDateTime=function(t,n={}){const r="object"==typeof t&&null!==t?e(t):null;if(null===r)throw new TypeError("date must be a Date");if(!Number.isFinite(r))throw new RangeError("Invalid date");const o=n.precision??"minute";if("minute"!==o&&"second"!==o&&"millisecond"!==o)throw new TypeError("precision must be minute, second, or millisecond");const i=new Date(r),s=i.getFullYear();if(s<1)throw new RangeError("Date year must be greater than zero");const c=[a(s,4),a(i.getMonth()+1,2),a(i.getDate(),2)].join("-"),u=[a(i.getHours(),2),a(i.getMinutes(),2)];"minute"!==o&&u.push(a(i.getSeconds(),2));let l=`${c}T${u.join(":")}`;return"millisecond"===o&&(l+=`.${a(i.getMilliseconds(),3)}`),l},exports.genBrowserAttrs=Tt,exports.genCustomConsole=he,exports.genHashCode=function(e){let t,n,r=0;for(t=0;t<e.length;t++)n=e.charCodeAt(t),r=(r<<5)-r+n,r|=0;return r},exports.genRndNumString=N,exports.genStyleString=Se,exports.genUniqueNumString=$,exports.generateCalendarVersion=function(e){return d(void 0===e?new Date:new Date(e instanceof Date?e.getTime():e),"yyyy.MMdd.HHmmss").split(".").map(e=>String(Number(e))).join(".")},exports.generateRndNum=C,exports.generateUniqueNum=function(e=3){return $(e)},exports.getAllQueryParams=function(e=""){""===e&&(e=location.search);const t={};return te(e).forEach(([e,n])=>{Object.hasOwn(t,e)||Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0})}),t},exports.getBrowserClassNames=Et,exports.getBrowserInfo=vt,exports.getCLS=async function(){return at("layout-shift")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().reduce((e,t)=>{let n=0;return O(t.value)&&(n=t.value),e+n},0);t.disconnect(),e(r)});t.observe({type:"layout-shift",buffered:!0})}):0},exports.getCookie=tt,exports.getCurrentVersion=function(){return"v4"},exports.getDateDifference=l,exports.getDefineListeners=Fe,exports.getDomain=function(e,t=["hostname"]){try{const n=new URL(e,document.baseURI);return t.reduce((e,t)=>e+=n[t],"")}catch(n){const r=document.createElement("a");return r.href=e,t.reduce((e,t)=>e+=r[t],"")}},exports.getFCP=ct,exports.getFID=async function(){return at("first-input")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-input"===e.entryType);if(r){t.disconnect();const n=r.processingStart;e(n?Math.round(r.processingStart-r.startTime):0)}});t.observe({type:"first-input",buffered:!0})}):0},exports.getFP=ut,exports.getFileSize=function(e,t={}){return V(e,t)},exports.getFriendlyInterval=function(e=0,t=0,n=c){return l(e,t,n)},exports.getHashQueryParam=function(e){const t=location.hash.split("?");return 1===t.length?"":ne(`?${t.slice(1).join("?")}`,e)[0]||""},exports.getLCP=async function(){return at("largest-contentful-paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"largest-contentful-paint"===e.entryType);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"largest-contentful-paint",buffered:!0})}):0},exports.getLocalJSON=qe,exports.getLocalStorage=Ze,exports.getPageMeta=function(e){const t=document.getElementsByTagName("meta");for(let n=0;n<t.length;n++)if(t[n].getAttribute("name")===e)return t[n].getAttribute("content")||"";return""},exports.getPerformance=async function(e=!1){if(!at("navigation"))return Promise.reject(new Error("navigation is not supported"));const t=window.performance;if(!t||"function"!=typeof t.getEntriesByType)return Promise.reject(new Error("performance is not supported"));let n;const r=new Promise(e=>{[n]=[e]}),o=t.getEntriesByType("navigation");if(!M(o))return Promise.reject(new Error("NavigationTiming is not supported"));const i=o[0];let[s,a,c,u,l,f,p,d,m,g,h,y,w,b,x,v,E,S,A]=new Array(19).fill(0);({decodedBodySize:S,encodedBodySize:A}=i),({unloadEventEnd:s,unloadEventStart:a,redirectEnd:c,redirectStart:u,domainLookupEnd:l,domainLookupStart:f,connectEnd:p,connectStart:d,secureConnectionStart:m,responseStart:g,requestStart:h,responseEnd:y,domContentLoadedEventStart:w,loadEventStart:b,loadEventEnd:x,startTime:v,fetchStart:E}=i);let N=0;if(O(v))N=v;else{if(!O(E))return Promise.reject(new Error("startTime, navigationStart or fetchStart are required"));N=E}const[C,$]=await Promise.all([ut(),ct()]);function _(){({decodedBodySize:S,encodedBodySize:A}=i),({unloadEventEnd:s,unloadEventStart:a,redirectEnd:c,redirectStart:u,domainLookupEnd:l,domainLookupStart:f,connectEnd:p,connectStart:d,secureConnectionStart:m,responseStart:g,requestStart:h,responseEnd:y,domContentLoadedEventStart:w,loadEventStart:b,loadEventEnd:x,startTime:v,fetchStart:E}=i),O(v)?N=v:O(E)&&(N=E);const t={source:"PerformanceNavigationTiming",os:j(),osVersion:D(),deviceType:L(),network:k(),screenDirection:P(),unloadTime:s-a,redirectTime:c-u,dnsTime:l-f,tcpTime:p-d,sslTime:F(p,m),responseTime:g-h,downloadTime:y-g,firstPaintTime:C,firstContentfulPaintTime:$,domReadyTime:w-N,onloadTime:b-N,whiteTime:g-N,renderTime:x-N,decodedBodySize:S,encodedBodySize:A};Object.keys(t).forEach(e=>{O(t[e])&&(t[e]<0?t[e]=0:t[e]=Math.round(t[e]))}),O(t.whiteTime)&&t.whiteTime>t.onloadTime&&(t.whiteTime=0);const r={};e||Object.keys(t).forEach(e=>{r[T(e)]=t[e]}),Object.keys(r).length?n(r):n(t)}function j(){let e;return e=navigator.userAgent.indexOf("Android")>-1?"android":navigator.userAgent.indexOf("iPhone")>-1?"ios":navigator.userAgent.indexOf("Windows Phone")>-1?"wp":"others",e}function D(){let e="";const t=navigator.userAgent,n=t.indexOf("Android")>-1,r=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),o=navigator.userAgent.split(";");if(o.length<2)return e;const i=o[1];return i?(n&&(e=(i.match(/\d+\.\d+/g)||[])[0]),r&&(e=(i.match(/(\d+)_(\d+)_?(\d+)?/)||[])[0]),e||(e=""),e):e}function L(){let e;const t=navigator.userAgent.toLowerCase(),n=t.match(/(ipad)/i)&&"ipad",r=t.match(/iphone os/i)&&"iphone os",o=t.match(/midp/i)&&"midp",i=t.match(/rv:1.2.3.4/i)&&"rv:1.2.3.4",s=t.match(/ucweb/i)&&"ucweb",a=t.match(/android/i)&&"android",c=t.match(/windows ce/i)&&"windows ce",u=t.match(/windows mobile/i)&&"windows mobile";return e=n||r||o||i||s||a||c||u?r||o||i||s||a||c||u?"phone":n?"ipad":void 0:"pc",e||(e=""),e}function k(){let e="";const t=window.navigator;if(t.connection&&t.connection.effectiveType)switch(t.connection.effectiveType){case"wifi":e="wifi";break;case"4g":e="4g";break;case"2g":e="2g";break;case"3g":e="3g";break;case"ethernet":e="ethernet";break;case"default":e=void 0}return e||(e=""),e}function P(){let e="";return window.screen&&window.screen.orientation&&"number"==typeof window.screen.orientation.angle&&(180!==window.screen.orientation.angle&&0!==window.screen.orientation.angle||(e="|"),90!==window.screen.orientation.angle&&-90!==window.screen.orientation.angle||(e="-")),e}function F(e,t){let n=0;return t&&(n=e-t),n}return O(x)&&x>0?_():"complete"===document.readyState?window.setTimeout(_,0):window.addEventListener("load",function e(){window.removeEventListener("load",e),window.setTimeout(function(){_()},0)}),r},exports.getQueryParam=function(e){return ne(location.search,e)[0]||""},exports.getScriptQueryParam=function(e,t=""){t||(t=".js");const n=document.querySelectorAll("script[src]");for(let r=0;r<n.length;r++){const o=n[r].getAttribute("src");if(o&&-1!==o.indexOf(t)){const t=ne(o,e)[0];if(void 0!==t)return t}}return""},exports.getSessionJSON=Be,exports.getSessionStorage=Ve,exports.getSystemTheme=jt,exports.getTTFB=async function(){if(!at("navigation"))return 0;if(!window.performance||!window.performance.getEntriesByType)return 0;const e=window.performance.getEntriesByType("navigation")[0];let t=0;return e?(t=e.responseStart-e.requestStart,Math.round(t)):0},exports.getURLPathExtension=pe,exports.getUrlFileType=de,exports.getUrlHost=function(e){!fe(e)&&fe(e,{strict:!1})&&e.startsWith("//")&&(e="https:"+e);try{return new URL(e).host}catch(e){return""}},exports.getUrlParam=function(e,t,n={}){const r=ne(e,t);return n.returnArray?r:r.length?r[0]:null},exports.getUrlPath=function(e){!fe(e)&&fe(e,{strict:!1})&&e.startsWith("//")&&(e="https:"+e);try{return new URL(e).pathname}catch(e){return""}},exports.hasClass=function(e,t){if(!e)return ye.error("The element is not exist."),!1;const n=e.className.split(/\s+/);for(let e=0;e<n.length;e++)if(n[e]===t)return!0;return!1},exports.hide=function(e){return ke(e)},exports.hideElements=ke,exports.inRate=function(e){return h(e)},exports.injectStyle=xe,exports.invokeEvent=function(e,t){ze(e,t)},exports.invokeFn=_,exports.isAndroid=function(e){return"android"===wt(e)},exports.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},exports.isBool=L,exports.isBoolean=function(e){return L(e)},exports.isBrowser=function(){if(G)return"browser"===G;const e="undefined"!=typeof window;return e&&(G="browser"),e},exports.isCNMobileNumber=Y,exports.isDesktop=function(e){return"desktop"===yt(e)},exports.isFunction=function(e){return"function"==typeof e},exports.isHit=function(e){return h(e)},exports.isIOS=function(e){return"ios"===wt(e)},exports.isJSONString=A,exports.isJsonString=function(e){return A(e)},exports.isLinux=function(e){return"linux"===wt(e)},exports.isMacOS=function(e){return"macos"===wt(e)},exports.isMobile=J,exports.isNonEmptyArray=M,exports.isNonEmptyObject=function(e){return!!D(e)&&0!==Object.keys(e).length},exports.isNullish=k,exports.isNumber=O,exports.isPhone=function(e){return"mobile"===yt(e)},exports.isPureObject=D,exports.isSafePWAEnv=function(e={}){try{if(null===e||"object"!=typeof e||Array.isArray(e))return!1;const t=e.requireManifest,n=e.scope,r=e.environment;if(void 0!==t&&"boolean"!=typeof t||void 0!==n&&"string"!=typeof n)return!1;const o=xt(r);if(!o)return!1;const{window:i,navigator:s,document:a}=o,c=s.serviceWorker;if(!0!==i.isSecureContext||null===c||"object"!=typeof c)return!1;if(void 0!==n&&!function(e,t){const n=e.trim();if(!n||/[?#]/.test(n))return!1;try{const e=new URL(t.location.href),r=new URL(n,e);if(r.origin!==e.origin||""!==r.search||""!==r.hash)return!1;if(e.pathname===r.pathname)return!0;const o=r.pathname.endsWith("/")?r.pathname:`${r.pathname}/`;return e.pathname.startsWith(o)}catch(e){return!1}}(n,i))return!1;if(!1===t)return!0;if(!a)return!1;const u=a.querySelector('link[rel~="manifest"][href]');return Boolean(u?.getAttribute("href")?.trim())}catch(e){return!1}},exports.isStandalonePWA=function(e={}){let t;try{if(null===e||"object"!=typeof e||Array.isArray(e))return!1;t=e.environment}catch(e){return!1}const n=xt(t);if(!n)return!1;const{window:r,navigator:o}=n;try{const e=r.matchMedia;if("function"==typeof e&&e.call(r,"(display-mode: standalone)").matches)return!0}catch(e){}try{return!0===o.standalone}catch(e){return!1}},exports.isString=function(e){return"string"==typeof e},exports.isSupportWebp=function(){return St?Promise.resolve("webp"===St):new Promise(e=>{const t=new Image;t.onload=()=>{const n=t.width>0&&t.height>0;St=n?"webp":"no-webp",e(n)},t.onerror=()=>{St="no-webp",e(!1)},t.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="})},exports.isSupportedEntryType=at,exports.isTablet=function(e){return"tablet"===yt(e)},exports.isThisHour=function(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()&&t.getHours()===n.getHours()},exports.isThisMonth=function(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()},exports.isThisWeek=function(e){const t=i(e);if(!t)return!1;const n=new Date,r=(n.getDay()+6)%7;n.setHours(0,0,0,0),n.setDate(n.getDate()-r);const o=new Date(n.getTime());o.setDate(o.getDate()+7);const s=t.getTime();return s>=n.getTime()&&s<o.getTime()},exports.isThisYear=function(e){const t=i(e);return null!==t&&t.getFullYear()===(new Date).getFullYear()},exports.isToday=function(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()},exports.isUdfOrNul=function(e){return k(e)},exports.isValidCssSelector=Ae,exports.isValidData=function(e,t,n){if(null===e||"object"!=typeof e)return!1;let r=e;for(const e of t){if(null===r||"object"!=typeof r&&"function"!=typeof r||!Object.hasOwn(r,e))return!1;r=r[e]}return r===n},exports.isValidDate=function(e){return null!==i(e)},exports.isValidEmail=function(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},exports.isValidHttpUrl=fe,exports.isValidPhoneNumber=Z,exports.isValidUrl=function(e){return/^[a-zA-Z0-9]+:\/\/[-a-zA-Z0-9@:%._+~#=]{1,256}\b([-a-zA-Z0-9\u4E00-\u9FA5\u3002\uff1b\uff0c\uff1a\u201c\u201d\uff08\uff09\u3001\uff1f\u300a\u300b()!@:%_+.~#?&//=]*)$/.test(e)},exports.isWindows=function(e){return"windows"===wt(e)},exports.listenMediaQueryChanges=function(e,t){if("function"!=typeof t)throw new TypeError("listener must be a function");if(null===e)return()=>{};if("object"!=typeof e)throw new TypeError("media must be a MediaQueryList or null");const n=e.addEventListener,r=e.removeEventListener;let o=null;if("function"==typeof n&&"function"==typeof r){const i=t;n.call(e,"change",i),o=()=>r.call(e,"change",i)}let i=!1;return()=>{i||(i=!0,o?.())}},exports.loadCSS=rt,exports.loadImage=function(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=e})},exports.loadScript=it,exports.loadScriptIfUndefined=function(e,t){if(window[e])return Promise.resolve("defined");let n=st.get(e);const r=n?.get(t);if(r)return r;n||(n=new Map,st.set(e,n));const o=()=>{n?.delete(t),0===n?.size&&st.delete(e)},i=it(t).then(e=>(o(),e),e=>{throw o(),e});return n.set(t,i),i},exports.longestComSubsequence=g,exports.longestComSubstring=m,exports.mNow=function(){return Date.now()},exports.mTrim=function(e){return e.trim()},exports.mazeyCon=ye,exports.newLine=function(e){return P(e)},exports.onEvent=Re,exports.onURLChange=function(e,t={}){const{fireOnInit:n=!0}=t,r=history;let o=location.href;const i=[],s=t=>{const n=location.href;if(n===o&&"load"!==t)return;const r=o;o=n,e({url:n,oldUrl:r,trigger:t})},a=()=>s("popstate"),c=()=>s("hashchange");window.addEventListener("popstate",a),window.addEventListener("hashchange",c),i.push(()=>window.removeEventListener("popstate",a)),i.push(()=>window.removeEventListener("hashchange",c)),r.__mazeyUrlChangePatched__||(r.__mazeyUrlChangePatched__=!0,r.__mazeyUrlChangeSubscribers__=new Set,r.__mazeyRawPushState__=history.pushState.bind(history),r.__mazeyRawReplaceState__=history.replaceState.bind(history),history.pushState=function(...e){r.__mazeyRawPushState__(...e),r.__mazeyUrlChangeSubscribers__.forEach(e=>e("pushState"))},history.replaceState=function(...e){r.__mazeyRawReplaceState__(...e),r.__mazeyUrlChangeSubscribers__.forEach(e=>e("replaceState"))});const u=e=>s(e);return r.__mazeyUrlChangeSubscribers__.add(u),i.push(()=>r.__mazeyUrlChangeSubscribers__.delete(u)),n&&s("load"),()=>{i.forEach(e=>e())}},exports.parseGitHubRepository=function(e){if("string"!=typeof e)throw new TypeError("value must be a string");const t=e.trim();if(!t||/[%\\?#]/.test(t)||function(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<=31||127===n)return!0}return!1}(t))throw ie();const n=t.match(/^(?:github:)?([^/:\s]+)\/([^/\s]+)$/i);if(n)return se(n[1],n[2]);const r=t.match(/^git@([^:\s]+):([^/\s]+)\/([^/\s]+)$/);if(r&&"github.com"===r[1].toLowerCase())return se(r[2],r[3]);const o=t.replace(/^git\+(?=(?:git|ssh|https?):\/\/)/i,""),i=o.match(/^[a-z][a-z\d+.-]*:\/\/([^/?#]+)/i);if(!i||/(^|\/)\.{1,2}(?:\/|$)/.test(o.slice(i[0].length)))throw ie();if(-1!==i[1].slice(i[1].lastIndexOf("@")+1).indexOf(":"))throw ie();let s;try{s=new URL(o)}catch(e){throw ie()}const a=s.protocol.toLowerCase(),c=s.hostname.toLowerCase().replace(/^www\./,"");if(!["git:","ssh:","http:","https:"].includes(a)||"github.com"!==c||""!==s.username&&"git"!==s.username||""!==s.password||""!==s.search||""!==s.hash)throw ie();const u=s.pathname.match(/^\/([^/]+)\/([^/]+)\/?$/);if(!u)throw ie();return se(u[1],u[2])},exports.parseJsonSafe=function(e,t=null){try{return JSON.parse(e)}catch(e){return t}},exports.parseLocalDateTime=function(e){if("string"!=typeof e)return null;const t=s.exec(e);if(!t)return null;const[n,i,a,c,u,l="0",f=""]=t.slice(1),p=Number(n),d=Number(i),m=Number(a),g=Number(c),h=Number(u),y=Number(l),w=Number(`${f}00`.slice(0,3));return p<1||!r(p,d,m,g,h,y,w)?null:o(p,d,m,g,h,y,w)},exports.randomBoolean=h,exports.removeClass=function(e,t){if(!e)return void ye.error("The element is not exist.");let n;n=" "+e.className+" ",n=n.replace(/(\s+)/gi," "),n=n.replace(" "+t+" "," "),n=n.replace(/(^\s+)|(\s+$)/g,""),e.className=n},exports.removeCookie=nt,exports.removeEvent=function(e,t){const n=Fe(),r=n[e];if("string"==typeof e&&Array.isArray(r))if("function"==typeof t){for(let o=0,i=r.length;o<i;o++)if(r[o]===t){n[e].splice(o,1);break}}else delete n[e]},exports.removeHTML=F,exports.removeHtml=function(e,t={}){return F(e,t)},exports.repeatUntilConditionMet=function(e,t={},n=e=>!0===e){const{interval:r=1e3,times:o=10,context:i,args:s}=t;if("function"!=typeof e)return void console.error("Expected a function.");if(!Number.isFinite(r)||r<0)return void console.error("Expected a non-negative number for interval.");if(!Number.isFinite(o)||o<0)return void console.error("Expected a non-negative number for times.");if(0===o)return;let a=0;const c=()=>{setTimeout(async()=>{const t=await e.apply(i,s);n(t)||++a>=o||c()},r)};c()},exports.replaceHttp=function(e){return me(e)},exports.resolveElementTarget=function(e,t){if(void 0===e)return Ne(t.defaultElement)?t.defaultElement:null;let n=t.unwrap?t.unwrap(e):e;if(null==n)return null;if("string"==typeof n)try{return t.root.querySelector(n)}catch(e){return null}return"object"==typeof n&&"$el"in n&&(n=n.$el),Ne(n)?n:null},exports.resolveLanguagePreference=function(e){At(e);const t=Lt(Nt("lang"));if(t)return Pt(t);const n=Lt(Ct(e));return Pt(n||(Lt(function(){if("undefined"==typeof window||"undefined"==typeof navigator)return null;try{return"string"==typeof navigator.language?navigator.language:null}catch(e){return null}}())??"en"))},exports.resolveThemePreference=function(e){At(e);const t=Nt(e);if(_t(t))return Mt(t,t);const n=Ct(e);if(_t(n))return Mt(n,n);const r=jt();return"system"===n&&r||r?Mt(r,"system"):Mt("light","light")},exports.sanitizeInput=U,exports.setClass=function(e,t){be(e,t)},exports.setCookie=function(e,t,n,r){let o;if(n){const e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),o="; expires="+e.toUTCString()}else o="";const i=function(e){let t=!0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(!(33===r||r>=35&&r<=43||r>=45&&r<=58||r>=60&&r<=91||r>=93&&r<=126)){t=!1;break}}return{isEncoded:!t,value:t?e:encodeURIComponent(e)}}(t),s=Ke(e),a=i.isEncoded?"1":"",c=i.isEncoded?o:"; expires=Thu, 01 Jan 1970 00:00:00 GMT",u=[`${s}=${i.value}${o}; path=/`,`${Ge(e)}=${a}${c}; path=/`],l=e=>{const t=e?`; domain=${e}`:"";u.forEach(e=>{document.cookie=`${e}${t}`})},f=location.hostname;if(r)l(r);else if(-1===f.indexOf("."))l();else{const n=f.split(".");n.shift();l("."+n.join(".")),tt(e)!==t&&l(`.${f}`)}},exports.setImgSizeBySrc=Ee,exports.setImgWidHeiBySrc=function(){return Ee()},exports.setLanguagePreference=function(e,t){At(e);const n=Lt(t);if(!n)throw new TypeError("language must be a valid language tag.");return $t(e,n)},exports.setLocalJSON=He,exports.setLocalStorage=Ye,exports.setSessionJSON=Ie,exports.setSessionStorage=We,exports.setThemePreference=function(e,t){if(At(e),!function(e){return"system"===e||_t(e)}(t))throw new TypeError('value must be "system", "light", or "dark".');return $t(e,t)},exports.sha256Hex=async function(e){const t="undefined"==typeof crypto?null:crypto;if(!t?.subtle||"function"!=typeof t.subtle.digest)throw new Error("Web Crypto API is not available.");let n=e;if("string"==typeof e){if("undefined"==typeof TextEncoder)throw new Error("TextEncoder is not available.");n=(new TextEncoder).encode(e)}const r=await t.subtle.digest("SHA-256",n);let o="";const i=new Uint8Array(r);for(let e=0;e<i.length;e++){const t=i[e].toString(16);o+=1===t.length?`0${t}`:t}return o},exports.show=function(e){return Pe(e)},exports.showElements=Pe,exports.sleep=async function(e){return Q(e)},exports.subYears=function(t,n){const r="number"==typeof t?t:"object"==typeof t&&null!==t?e(t):null,o=new Date(r??NaN),i="number"==typeof n?n<0?Math.ceil(n):Math.floor(n):NaN;if(!Number.isFinite(o.getTime())||!Number.isFinite(i))return new Date(NaN);if(0===i)return o;const s=o.getMonth(),a=o.getDate(),c=o.getFullYear()-i,u=new Date(o.getTime());return u.setFullYear(c,s+1,0),a>=u.getDate()?u:(o.setFullYear(c,s,a),o)},exports.throttle=function(e,t,n={}){n=Object.assign({},n);let r=null,o=null,i=null,[s,a]=[null,0];const c=function(){a=!1===n.leading?0:Date.now(),i=null,s=e.apply(this,o),i||(r=o=null)};return function(...u){const l=Date.now();a||!1!==n.leading||(a=l);const f=t-(l-a);return r=this,o=u,f<=0||f>t?(i&&(clearTimeout(i),i=null),a=l,s=e.apply(r,o),i||(r=o=null)):i||!1===n.trailing||(i=setTimeout(c.bind(r),f)),s}},exports.timeCon=we,exports.toJavaScriptGlobalName=S,exports.truncateByWeightedLength=B,exports.truncateZHString=q,exports.unescapeHTML=z,exports.unsanitize=function(e){return z(e)},exports.unsanitizeInput=I,exports.updateQueryParam=function(e,t,n){const r=e.indexOf("#"),o=-1===r?"":e.slice(r),i=-1===r?e:e.slice(0,r),s=i.indexOf("?"),a=-1===s?i:i.slice(0,s),c=-1===s?"":i.slice(s+1),u=encodeURIComponent(t),l=encodeURIComponent(n);let f=!1;const p=(c?c.split("&").filter(Boolean):[]).reduce((e,n)=>{const r=n.indexOf("=");return ee(-1===r?n:n.slice(0,r))===t?f||(e.push(`${u}=${l}`),f=!0):e.push(n),e},[]);return f||p.push(`${u}=${l}`),`${a}?${p.join("&")}${o}`},exports.waitTime=Q,exports.watchServiceWorkerUpdates=function(e,t,n){if(null===e||"object"!=typeof e||"function"!=typeof e.addEventListener||"function"!=typeof e.removeEventListener)throw new TypeError("registration must support event listeners");if(null===t||"object"!=typeof t||"function"!=typeof t.addEventListener||"function"!=typeof t.removeEventListener)throw new TypeError("container must support event listeners");if(null===n||"object"!=typeof n||"function"!=typeof n.onUpdateAvailable||void 0!==n.onControllerChange&&"function"!=typeof n.onControllerChange)throw new TypeError("callbacks must provide onUpdateAvailable");let r=!1,o=null,i=null,s=!1,a=!1;const c=e=>{r||i===e||(i=e,n.onUpdateAvailable(e))},u=()=>{!r&&"installed"===o?.state&&t.controller&&c(o)},l=()=>{r||(o?.removeEventListener("statechange",u),o=e.installing,o?.addEventListener("statechange",u),u())},f=()=>{r||n.onControllerChange?.()},p=()=>{if(s){try{e.removeEventListener("updatefound",l)}catch(e){}s=!1}try{o?.removeEventListener("statechange",u)}catch(e){}if(a){try{t.removeEventListener("controllerchange",f)}catch(e){}a=!1}};try{e.addEventListener("updatefound",l),s=!0,t.addEventListener("controllerchange",f),a=!0,e.waiting&&t.controller&&c(e.waiting),e.installing&&l()}catch(e){throw r=!0,p(),o=null,i=null,e}return{activateWaiting(e={type:"SKIP_WAITING"}){if(r||!i)return!1;try{return i.postMessage(e),!0}catch(e){return!1}},dispose(){r||(r=!0,p(),o=null,i=null)}}},exports.windowLoaded=function(e=3e4){return new Promise((t,n)=>{let r=null;const o=()=>{window.removeEventListener("load",i),null!==r&&(clearTimeout(r),r=null)},i=()=>{o(),t("load")};"complete"!==document.readyState?(window.addEventListener("load",i),r=setTimeout(()=>{o(),n(new Error("timeout"))},e)):t("complete")})},exports.zAxiosIsValidRes=function(e,t={validStatusRange:[200,300],validCode:[0]}){const n=t||{},{validStatusRange:r=[200,300],validCode:o=[0]}=n;2!==r.length&&console.error("valid validStatusRange is required");let i=!1;if(e&&e.status&&2===r.length&&e.status>=r[0]&&e.status<r[1]){const t=e.data;t&&o.includes(t.code)&&(i=!0)}return i};
|
|
6
|
+
"use strict";function e(e){try{return Date.prototype.getTime.call(e)}catch(e){return null}}const t=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2})(?::(\d{2}))?)?$/,n=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:\d{2})$/;function r(e,t,n,r,o,i,s=0,a=!1){const c=new Date(0);return a?(c.setUTCFullYear(e,t-1,n),c.setUTCHours(r,o,i,s),Number.isFinite(c.getTime())&&c.getUTCFullYear()===e&&c.getUTCMonth()===t-1&&c.getUTCDate()===n&&c.getUTCHours()===r&&c.getUTCMinutes()===o&&c.getUTCSeconds()===i&&c.getUTCMilliseconds()===s):(c.setFullYear(e,t-1,n),c.setHours(r,o,i,s),Number.isFinite(c.getTime())&&c.getFullYear()===e&&c.getMonth()===t-1&&c.getDate()===n&&c.getHours()===r&&c.getMinutes()===o&&c.getSeconds()===i&&c.getMilliseconds()===s)}function o(e,t,n,r,o,i,s=0){const a=new Date(0);return a.setFullYear(e,t-1,n),a.setHours(r,o,i,s),a}function i(i){if("number"==typeof i){const e=new Date(i);return Number.isFinite(i)&&Number.isFinite(e.getTime())?e:null}if("object"==typeof i&&null!==i){const t=e(i);return null!==t&&Number.isFinite(t)?new Date(t):null}if("string"!=typeof i)return null;const s=i.trim();if(!s)return null;const a=t.exec(s);if(a){const[e,t,n,i="0",s="0",c="0"]=a.slice(1),[u,l,f,p,d,m]=[e,t,n,i,s,c].map(Number);return r(u,l,f,p,d,m)?o(u,l,f,p,d,m):null}const c=n.exec(s);if(!c)return null;const[u,l,f,p,d,m="0",g="",h]=c.slice(1),y=Number(`${g}00`.slice(0,3));if(!r(Number(u),Number(l),Number(f),Number(p),Number(d),Number(m),y,!0))return null;if("Z"!==h){const e=Number(h.slice(1,3)),t=Number(h.slice(4,6));if(e>23||t>59)return null}return function(e,t,n,r,o,i,s,a){const c=new Date(0);if(c.setUTCFullYear(e,t-1,n),c.setUTCHours(r,o,i,s),"Z"===a)return c;const u="+"===a[0]?1:-1,l=60*Number(a.slice(1,3))+Number(a.slice(4,6));return new Date(c.getTime()-u*l*60*1e3)}(Number(u),Number(l),Number(f),Number(p),Number(d),Number(m),y,h)}const s=/^(\d{4,})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/;function a(e,t){const n=String(e);return n.length>=t?n:`${"0".repeat(t-n.length)}${n}`}const c={type:"d"};function u(e){return"string"==typeof e&&/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(e)?e.replace(" ","T"):e}function l(e=0,t=0,n=c){n=Object.assign({},c,n);const{type:r}=n;"number"==typeof e&&Number.isFinite(e)||(e=new Date(u(e)).getTime()),"number"==typeof t&&Number.isFinite(t)||(t=new Date(u(t)).getTime());const o=Number(t)-Number(e);let i="",[s,a,l,p]=new Array(4).fill(0);if(o>=0)switch(s=Math.floor(o/1e3/60/60/24),a=Math.floor(o/1e3/60/60),l=Math.floor(o/1e3/60),p=Math.floor(o/1e3),r){case"d":i=s;break;case"text":s=Math.floor(o/1e3/60/60/24),a=Math.floor(o/1e3/60/60%24),l=Math.floor(o/1e3/60%60),p=Math.floor(o/1e3%60),i=[{value:s,unit:"day"},{value:a,unit:"hour"},{value:l,unit:"minute"},{value:p,unit:"second"}].filter(({value:e})=>e>0).map(({value:e,unit:t})=>f(e,t)).join(" ")||f(0,"second");break;default:i=p}return i}function f(e,t){const n=Math.round(10*e)/10;return`${n} ${1===n?t:`${t}s`}`}function p(e,t){const n=Math.max(1,Math.round(e));return`about ${n} ${t}${1===n?"":"s"}`}function d(e,t="yyyy-MM-dd"){void 0===e&&(e=new Date);const n=new Date(e);if(!Number.isFinite(n.getTime()))throw new RangeError("Invalid date");const r=n.getHours(),o={yyyy:n.getFullYear(),MM:n.getMonth()+1,dd:n.getDate()<10?"0"+n.getDate():n.getDate(),HH:r<10?"0"+r:r,hh:(r%12||12)<10?"0"+(r%12||12):r%12||12,mm:n.getMinutes()<10?"0"+n.getMinutes():n.getMinutes(),ss:n.getSeconds()<10?"0"+n.getSeconds():n.getSeconds(),a:r<12?"AM":"PM"};let i=t||"yyyy-MM-dd";return Object.keys(o).forEach(e=>{let t=o[e];"MM"===e&&Number(t)<=9&&(t=`0${t}`),i=i.split(e).join(String(t))}),i}function m(e,t){const n=e.length,r=t.length;if(0===n||0===r)return 0;const o=Array.from({length:n},()=>new Array(r).fill(0));let i=0;for(let s=0;s<n;++s)for(let n=0;n<r;++n)if(e[s]===t[n]){let e=0;s>0&&n>0&&(e=o[s-1][n-1]),o[s][n]=e+1,i=Math.max(i,o[s][n])}return i}function g(e,t){const n=e.length,r=t.length;if(0===n||0===r)return 0;const o=Array.from({length:n},()=>new Array(r).fill(0));for(let i=0;i<n;++i)for(let n=0;n<r;++n)if(e[i]===t[n]){let e=0;i>0&&n>0&&(e=o[i-1][n-1]),o[i][n]=e+1}else{let[e,t]=[0,0];n>0&&(e=o[i][n-1]),i>0&&(t=o[i-1][n]),o[i][n]=Math.max(e,t)}return o[n-1][r-1]}function h(e){return Math.random()<e}const y=Function.prototype.toString.call(Object);function w(e,t,n){const r=Object.getOwnPropertyDescriptor(t,n)?.get;if(!r)return!1;try{return r.call(e),!0}catch(e){return!1}}function b(e){return null===e||"object"!=typeof e?e:x(e,new WeakMap)}function x(t,n){if(null===t||"object"!=typeof t)return t;const r=t,o=n.get(r);if(void 0!==o)return o;const i=e(r);if(null!==i){const e=new Date(i);return n.set(r,e),e}const s=function(e){const t=Object.getOwnPropertyDescriptor(RegExp.prototype,"source")?.get;if(!t)return null;try{return t.call(e)}catch(e){return null}}(r);if(null!==s){const e=t,o=new RegExp(s,function(e){return e.flags}(e));return o.lastIndex=e.lastIndex,n.set(r,o),o}if("undefined"!=typeof ArrayBuffer&&w(r,ArrayBuffer.prototype,"byteLength")){const e=ArrayBuffer.prototype.slice.call(t,0);return n.set(r,e),e}if("undefined"!=typeof SharedArrayBuffer&&w(r,SharedArrayBuffer.prototype,"byteLength")){const e=SharedArrayBuffer.prototype.slice.call(t,0);return n.set(r,e),e}if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)){const e=x(t.buffer,n),o="undefined"!=typeof DataView&&w(r,DataView.prototype,"byteLength")?new DataView(e,t.byteOffset,t.byteLength):new t.constructor(e,t.byteOffset,t.length);return n.set(r,o),o}if("undefined"!=typeof Map&&w(r,Map.prototype,"size")){const e=new Map;return n.set(r,e),Map.prototype.forEach.call(t,(t,r)=>{e.set(x(r,n),x(t,n))}),e}if("undefined"!=typeof Set&&w(r,Set.prototype,"size")){const e=new Set;return n.set(r,e),Set.prototype.forEach.call(t,t=>{e.add(x(t,n))}),e}const a=Array.isArray(t),c=Object.getPrototypeOf(t),u=function(e){const t=Object.getPrototypeOf(e);if(null===t)return!0;const n=Object.hasOwn(t,"constructor")?t.constructor:null;return"function"==typeof n&&Function.prototype.toString.call(n)===y}(r),l=!a&&!u&&function(e){const t=Object.getPrototypeOf(e),n=t?.constructor;return"function"==typeof n&&-1===Function.prototype.toString.call(n).indexOf("[native code]")}(r);if(!a&&!u&&!l)return n.set(r,t),t;const f=a?new Array(t.length):Object.create(l?Object.prototype:c);return n.set(r,f),function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}(r).forEach(e=>{if(a&&"length"===e)return;const t=Object.getOwnPropertyDescriptor(r,e);t&&("value"in t&&(t.value=x(t.value,n)),Object.defineProperty(f,e,t))}),f}function v(e){const t=e.replace(/([A-Z])/g,"-$1").toLowerCase();return"-"===t[0]?t.substring(1):t}function E(e){const t=e.replace(/([A-Z])/g,"_$1").toLowerCase();return"_"===t[0]?t.substring(1):t}const T=E;function S(e){return e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase())}const A=S;function N(e){if("string"!=typeof e)throw new TypeError("value must be a string");const t=e.replace(/[^A-Za-z0-9_$]/g,"_").toUpperCase();return/^[A-Za-z_$]/.test(t)?t:`_${t}`}function C(e){if("string"!=typeof e)return!1;try{return JSON.parse(e),!0}catch(e){}return!1}function $(e=5){if(!Number.isFinite(e)||e<=0)return"";e=Math.floor(e);let t="";for(;e--;)t+=Math.floor(10*Math.random());return t}function O(e=5){return $(e)}function _(e=3){const[t,n]=[Date.now(),O(e||3)];return t+n}function j(e,t=0){let n="";return n=t?(100*e).toFixed(t):String(Math.floor(100*e)),`${n}%`}const M=j;function D(e,t={}){const{isNaNAsNumber:n=!1,isInfinityAsNumber:r=!1,isUnFiniteAsNumber:o=!1,integer:i=!1,min:s,max:a}=t;return"number"==typeof e&&(!(!0!==r&&!0!==o&&!isFinite(e))&&(!(!n&&isNaN(e))&&((void 0===s||"number"==typeof s&&!Number.isNaN(s))&&((void 0===a||"number"==typeof a&&!Number.isNaN(a))&&(!(void 0!==s&&void 0!==a&&s>a)&&(!(!0===i&&!Number.isInteger(e))&&((void 0===s&&void 0===a||!Number.isNaN(e))&&!(void 0!==s&&e<s||void 0!==a&&e>a))))))))}function L(e,...t){let n=null;return e&&"function"==typeof e&&(n=e(...t)),n}function k(e,...t){return L(e,...t)}function P(e){let t=!1;return Array.isArray(e)&&e.length&&(t=!0),t}function F(e){const t=Boolean(e),n="object"==typeof e,r="[object Object]"===Object.prototype.toString.call(e);return t&&n&&r}function R(e){return"boolean"==typeof e}function U(e){return null==e}function z(e){if(!e)return"";const t=new RegExp("\\n","g");return e.replace(t,"<br />")}function I(e,t={}){const{removeNewLine:n=!1}=t;let r="";return e&&(r=e.replace(/<\/?.+?>/g,""),n&&(r=r.replace(/[\r\n]/g,""))),r}function B(e){const t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/[&<>"'/]/g,e=>t[e])}const H=B;function q(e){const t={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/(&|<|>|"|'|/)/g,e=>t[e])}const W=q;function V(e,t,n={hasDot:!1,dotText:"..."}){if(n=Object.assign({hasDot:!1,dotText:"..."},n),""!=e&&e){let r=0,o="";const i=/[^\x00-\xff]/g;let s="";const a=e.replace(i,"**").length;for(let n=0;n<a&&(s=e.charAt(n).toString(),null!=s.match(i)?r+=2:r++,!(r>t));n++)o+=s;return n.hasDot&&a>t&&(o+=n.dotText),o}return""}const Y=V;function Z(e,t,n=!1){return V(e,t,{hasDot:n})}const J=["B","KB","MB","GB","TB"];function Q(e,t={}){const{base:n=1024,fractionDigits:r=1,invalidValue:o=""}=t;if(!Number.isFinite(e)||e<0||1e3!==n&&1024!==n||!Number.isInteger(r)||r<0||r>20)return o;let i=e,s=0;for(;i>=n&&s<J.length-1;)i/=n,s+=1;return 0===s?`${Number(i.toFixed(r))} ${J[s]}`:`${i.toFixed(r)} ${J[s]}`}function G(e){return/^1\d{10}$/.test(e)}const K=G,X=G;async function ee(e){return new Promise(t=>{setTimeout(()=>{t(e)},e)})}let te="";function ne(e,t){const n=e[t];if(void 0!==n&&"string"!=typeof n)throw new TypeError(`manifest.${t} must be a string when provided`);return n}function re(e){if(void 0===e)return{name:""};if("string"==typeof e)return{name:e.trim()};if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("manifest.author must be a string or object");const t=e,n={name:""};for(const e of["name","email","url"]){const r=t[e];if(void 0!==r&&"string"!=typeof r)throw new TypeError(`manifest.author.${e} must be a string when provided`);if("string"==typeof r){const t=r.trim();("name"===e||t)&&(n[e]=t)}}return n}function oe(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}}function ie(e){const t=e.indexOf("#"),n=-1===t?e:e.slice(0,t),r=n.indexOf("?"),o=/^(?:[a-z][a-z\d+.-]*:)?\/\//i.test(n)||"/"===n.charAt(0),i=-1===r?o?"":n:n.slice(r+1);return i?i.split("&").reduce((e,t)=>{if(!t||-1===t.indexOf("="))return e;const n=t.indexOf("=");return e.push([oe(t.slice(0,n)),oe(t.slice(n+1))]),e},[]):[]}function se(e,t){return ie(e).filter(([e])=>e===t).map(([,e])=>e)}const ae=/^(?=.{1,39}$)(?!.*--)[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$/,ce=/^(?=.{1,100}$)(?!\.{1,2}$)[A-Za-z0-9_.-]+$/;function ue(){return new Error("The value does not identify one supported GitHub repository")}function le(e,t){const n=t.replace(/\.git$/i,"");if(!ae.test(e)||!ce.test(n))throw ue();const r=`${e}/${n}`;return{owner:e,name:n,slug:r,url:`https://github.com/${r}`}}function fe(e){return void 0===e||Number(e)<=65535}function pe(e){const t=e.split(".");return 4===t.length&&t.every(e=>/^\d{1,3}$/.test(e)&&(1===e.length||"0"!==e.charAt(0))&&Number(e)<=255)}function de(e){const t=e.split("::");if(t.length>2)return!1;const n=2===t.length;let r=[];t.forEach(e=>{e&&(r=r.concat(e.split(":")))});let o=0;for(let e=0;e<r.length;e++){const t=r[e];if(-1!==t.indexOf(".")){if(e!==r.length-1||!pe(t))return!1;o+=2}else{if(!/^[0-9a-f]{1,4}$/i.test(t))return!1;o+=1}}return n?o<8:8===o}function me(e){const t=e.match(/^\[([0-9a-f:.]+)\]$/i);if(t)return de(t[1]);if("."===e.charAt(e.length-1)&&(e=e.slice(0,-1)),pe(e))return!0;const n=e.split(".");return!(n.length<2||n.some(e=>!e||!/^[a-z\d-]+$/i.test(e)||"-"===e.charAt(0)||"-"===e.charAt(e.length-1)))&&!/^\d+$/.test(n[n.length-1])}function ge(e,t={strict:!0}){if("string"!=typeof e||!e||e.trim()!==e)return!1;const n=/^https?:\/\/[^/\\]/i.test(e),r=/^\/\/[^/\\]/.test(e);if(!n&&(t.strict||!r))return!1;const o=r?`http:${e}`:e;if(!function(e){const t=e.match(/^https?:\/\/([^/?#]+)(?:[/?#][^\s<>"`]*)?$/i);if(!t||-1!==t[1].indexOf("@"))return!1;const n=t[1],r=n.match(/^\[([0-9a-f:.]+)\](?::(\d*))?$/i);if(r)return de(r[1])&&fe(r[2]);const o=n.match(/^([^:]+)(?::(\d*))?$/);return!(!o||!fe(o[2]))&&me(o[1])}(o))return!1;try{const e=new URL(o);return("http:"===e.protocol||"https:"===e.protocol)&&me(e.hostname)&&!e.username&&!e.password}catch(e){return!1}}function he(e){let t="";if("string"!=typeof e||""==e)return t;const n=e.split(/[?#]/,1)[0],r=/\.[^/]+$/.exec(n);return r?(r[0].length>1&&(t=r[0].substring(1)),t):t}const ye=he;function we(e){return e.replace(/^http:/,"https:")}const be={enabled:!0,isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",isStringifyObject:!1,logFn:()=>{},errorFn:()=>{}};function xe(e="",t={...be}){const{enabled:n,isClosed:r,showWrap:o,showDate:i,locales:s,isStringifyObject:a,logFn:c,errorFn:u}=Object.assign({...be},t);let l=n;!0===r&&(ve.warn("The options.isClosed is deprecated. Please use options.enabled instead."),l=!1);const f=Object.create(null),p=()=>(new Date).toLocaleDateString(s,{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"});return["log","info","warn","error"].forEach(t=>{f[t]=function(...n){if(!l)return;let r=e,s=e;if("string"==typeof e&&e.length>=2){const t=e.length;r=":"===e[t-1]?e.substring(0,t-1):e}o&&console.log(`--- ${r} - begin ---`),i&&(s=e?`${p()} ${e}`:`${p()}`),a&&(n=n.map(e=>F(e)?JSON.stringify(e):e)),e||i?console[t](s,...n):console[t](...n),"log"===t&&c(),"error"===t&&u(),o&&console.log(`--- ${r} - end ---`)}}),f}const ve=xe("[Mazey]"),Ee=xe("",{showDate:!0,locales:"zh-CN",isStringifyObject:!0});function Te(e,t){if(!e)return void ve.error("The element is not exist.");if(Array.isArray(t))return void t.forEach(t=>{t&&e.classList.add(t)});if(!t)return;const n=e.className,r=n.split(/\s+/);for(let e=0;e<r.length;e++)if(r[e]===t)return;let o="",i="";""!==n&&(o=" "),i=n+o+t,e.className=i}function Se(e,t={id:""}){if(!e)return!1;const n=document.createDocumentFragment();let r=null,o="";const i=document.createElement("style");return t.id?(o=`${t.id}`,r=document.getElementById(o),r?r.innerHTML=e:(i.setAttribute("id",t.id),i.innerHTML=e,n.appendChild(i),document.head.appendChild(n))):(i.innerHTML=e,n.appendChild(i),document.head.appendChild(n)),!0}const Ae=Se;function Ne(){const e=window.jQuery||window.$;if(e){const t=e("img");return!(!t||!t.length)&&(t.each(function(){const t=e(this);if(!t)return;const n=t.attr("src");if(!(n&&"string"==typeof n&&n.length))return;const r=n.match(/[?&]width=([0-9]+[a-z%]*)/),o=n.match(/[?&]height=([0-9]+[a-z%]*)/);r&&P(r)&&r[1]&&t.width(r[1]),o&&P(o)&&o[1]&&t.height(o[1])}),!0)}{const e=document.getElementsByTagName("img");if(e.length>0)return Array.from(e).forEach(function(e){const t=e;if(!t)return;const n=t.getAttribute("src");if(!(n&&"string"==typeof n&&n.length))return;const r=n.match(/[?&]width=([0-9]+[a-z%]*)/),o=n.match(/[?&]height=([0-9]+[a-z%]*)/);r&&P(r)&&r[1]&&(t.style.width=r[1]),o&&P(o)&&o[1]&&(t.style.height=o[1])}),!0}return!1}function Ce(e,t){let n="";return t&&t.length>0&&(n=t.join(";")+";"),`${e}{${n}}`}const $e=Ce;function Oe(e,t={}){if("string"!=typeof e)return!1;const n=e.trim();if(!n)return!0===t.allowEmpty;const r=t.root||("undefined"==typeof document?null:document);if(!r)return!1;try{return r.querySelector(n),!0}catch(e){return!1}}function _e(e){return Boolean(e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName&&"function"==typeof e.getAttribute)}const je=new WeakMap,Me=new WeakMap,De={button:"inline-block",input:"inline-block",select:"inline-block",textarea:"inline-block",table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell",li:"list-item",summary:"list-item"},Le=new Set(["address","article","aside","blockquote","body","dd","details","dialog","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","main","nav","ol","p","pre","section","ul"]);function ke(e){if(!_e(e))return null;const t=e.style;return t&&"string"==typeof t.display?e:null}function Pe(e){const t=new Set,n=e=>{const n=ke(e);n&&t.add(n)};if("string"==typeof e){if("undefined"==typeof document)return[];try{document.querySelectorAll(e).forEach(n)}catch(e){return[]}return Array.from(t)}const r=ke(e);if(r)return[r];if(!e||"object"!=typeof e)return[];if("function"==typeof e[Symbol.iterator]){for(const t of e)n(t);return Array.from(t)}const o=e.length;if(!Number.isSafeInteger(o)||o<0)return[];for(let t=0;t<o;t+=1)n(e[t]);return Array.from(t)}function Fe(e){const t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e).display:null}function Re(e){const t=e.ownerDocument,n=e.localName.toLowerCase();let r=Me.get(t);r||(r=new Map,Me.set(t,r));const o=e.namespaceURI||"",i=`${o}:${n}`,s=r.get(i);if(s)return s;let a="";const c="http://www.w3.org/1999/xhtml"===o&&n.includes("-"),u=t.body||t.documentElement;if(u&&!c){const e=o&&"http://www.w3.org/1999/xhtml"!==o?t.createElementNS(o,n):t.createElement(n);u.appendChild(e);try{a=Fe(e)||""}finally{u.removeChild(e)}}return a&&"none"!==a||(a=function(e){return De[e]?De[e]:Le.has(e)?"block":"inline"}(n)),r.set(i,a),a}function Ue(e){return Pe(e).forEach(e=>{"none"!==Fe(e)&&"none"!==e.style.display&&je.set(e,e.style.display),e.style.display="none"}),e}function ze(e){return Pe(e).forEach(e=>{je.has(e)?(e.style.display=je.get(e),je.delete(e)):"none"===e.style.display&&(e.style.display=""),""===e.style.display&&"none"===Fe(e)&&(e.style.display=Re(e))}),e}function Ie(){const e=window.MAZEY_DEFINE_LISTENERS;if(e&&"object"==typeof e)return e;const t=Object.create(null);return window.MAZEY_DEFINE_LISTENERS=t,t}function Be(e,t){const n=Ie();Array.isArray(n[e])||Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:[],writable:!0}),"function"==typeof t&&n[e].push(t)}const He=Be;function qe(e,t){const n=Ie()[e];if(Array.isArray(n)){const e=n.slice();for(let n=0,r=e.length;n<r;n++)"function"==typeof e[n]&&(void 0===t?e[n]():e[n](t))}}function We(e,t=null){if(e){const n=JSON.stringify(t);sessionStorage.setItem(e,void 0===n?"null":n)}}function Ve(e){let t=null;if(e){const n=sessionStorage.getItem(e);if(n)try{t=JSON.parse(n)}catch(e){t=n}}return t}function Ye(e,t=null){if(e){const n=JSON.stringify(t);localStorage.setItem(e,void 0===n?"null":n)}}function Ze(e){let t=null;if(e){const n=localStorage.getItem(e);if(n)try{t=JSON.parse(n)}catch(e){t=n}}return t}const Je=We,Qe=Ve,Ge=Ye,Ke=Ze,Xe="__mazey_cookie_name_encoded__-",et="__mazey_cookie_value_encoded__-";function tt(e){return`${et}${encodeURIComponent(e)}`}function nt(e){const t=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/.test(e),n=0===e.indexOf(Xe)||0===e.indexOf(et);return t&&!n?e:function(e){return`${Xe}${encodeURIComponent(e)}`}(e)}function rt(e){const t=nt(e);return t!==e?[t,e]:[e]}function ot(e){const t=e+"=",n=document.cookie.split(";");for(let e=0;e<n.length;e++){const r=n[e].trim();if(0===r.indexOf(t))return r.substring(t.length)}}function it(e){const t=rt(e),n="1"===ot(tt(e));for(let e=0;e<t.length;e++){const r=ot(t[e]);if(void 0!==r){if(n)try{return decodeURIComponent(r)}catch(e){return r}return r}}return""}function st(e){const t=rt(e),n=t.concat(tt(e)),r=new Date;r.setTime(r.getTime()-1);const o=t.some(e=>void 0!==ot(e));return n.forEach((e,t)=>{if(n.indexOf(e)===t&&void 0!==ot(e)){[`${e}=; expires=${r.toUTCString()}`,`${e}=; expires=${r.toUTCString()}; path=/`].forEach(e=>{document.cookie=e;const t=location.hostname;if(-1!==t.indexOf(".")){const n=t.split(".");for(let t=0;t<n.length;t++)document.cookie=`${e}; domain=.${n.slice(t).join(".")}`}})}}),o&&n.every(e=>void 0===ot(e))}function at(e,t={id:""}){const{id:n}=t;return new Promise((t,r)=>{const o=document.createElement("link");let i=!1;const s=()=>{o.onload=null,o.onerror=null};o.rel="stylesheet",o.type="text/css",o.href=e,void 0!==n&&(o.id=n),o.onload=()=>{i||(i=!0,s(),t("loaded"))},o.onerror=()=>{i||(i=!0,s(),r(new Error(`Failed to load CSS: ${e}`)))},document.head.appendChild(o)})}const ct={id:"",callback:function(){},timeout:5e3,isDefer:!1,isAsync:!1,isCrossOrigin:!1,attributes:null,cssUrl:""};function ut(e,t={...ct}){const{id:n,callback:r,timeout:o,isDefer:i,isAsync:s,isCrossOrigin:a,attributes:c,cssUrl:u}=Object.assign({...ct},t);if(u){const t=function(e,t){if(!t)return"";if(ge(t))return t;try{const n=new URL(e,location.href);return new URL(t,n).href}catch(n){const r=e.split("/");return r.pop(),`${r.join("/")}/${t}`}}(e,u);t&&at(t).catch(e=>{console.error(`Failed to load CSS from ${t}: ${e?.message}`)})}return new Promise((t,u)=>{const l=document.createElement("script");let f=!1,p=null;const d=()=>{l.onload=null,l.onerror=null,null!==p&&(clearTimeout(p),p=null)},m=e=>{f||(f=!0,d(),u(e))};l.type="text/javascript",l.defer=Boolean(i),l.async=Boolean(s),a&&(l.crossOrigin="anonymous"),n&&(l.id=n),c&&Object.keys(c).forEach(e=>{l.setAttribute(e,c[e])}),l.onload=()=>{if(!f){f=!0,d();try{k(r),t("loaded")}catch(e){u(e)}}},l.onerror=()=>m(new Error(`Failed to load script: ${e}`)),l.src=e,o&&(p=setTimeout(()=>m(new Error("timeout")),o));const g=document.getElementsByTagName("script")[0];if(g?.parentNode)g.parentNode.insertBefore(l,g);else{(document.head||document.body||document.documentElement).appendChild(l)}})}const lt=new Map;function ft(e){if("undefined"==typeof window)return!1;let t=[];const n=window.PerformanceObserver;return!!n&&(P(n.supportedEntryTypes)&&(t=n.supportedEntryTypes),t.includes(e))}async function pt(){return ft("paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-contentful-paint"===e.name);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"paint",buffered:!0})}):0}async function dt(){return ft("paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-paint"===e.name);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"paint",buffered:!0})}):0}function mt(e,t=e.userAgent.trim().toLowerCase()){return/\bmacintosh\b/.test(t)&&"macintel"===e.platform.toLowerCase()&&e.maxTouchPoints>1}const gt=Object.freeze(["adsbot-google","ahrefsbot","amazonbot","applebot","baiduspider","bingbot","bingpreview","bytespider","ccbot","chatgpt-user","claudebot","discordbot","dotbot","duckduckbot","facebookexternalhit","facebot","google-inspectiontool","googlebot","googleother","gptbot","linkedinbot","mediapartners-google","mj12bot","perplexitybot","petalbot","semrushbot","slackbot","slurp","storebot-google","telegrambot","twitterbot","whatsapp","yandexbot"]),ht=Object.freeze(["headlesschrome","phantomjs","slimerjs","selenium","puppeteer","playwright"]);function yt(){try{return"undefined"==typeof navigator?null:navigator}catch(e){return null}}function wt(){const e=yt();if(!e)return{userAgent:"",platform:"",maxTouchPoints:0};let t="",n="",r=0;try{const n=e.userAgent;t="string"==typeof n?n:""}catch(e){return{userAgent:"",platform:"",maxTouchPoints:0}}try{const t=e.platform;n="string"==typeof t?t:""}catch(e){n=""}try{const t=e.maxTouchPoints;r=Number.isFinite(t)?t:0}catch(e){r=0}return{userAgent:t,platform:n,maxTouchPoints:r}}function bt(e){const t=e.userAgent.trim().toLowerCase();return t?/\bandroid\b|\badr\b/.test(t)?"android":/\bios\b|\biphone\b|\bipad\b|\bipod\b|\biwatch\b/.test(t)||mt(e,t)?"ios":/\bwindows\b|\bwin32\b|\bwin64\b|\bwow32\b|\bwow64\b/.test(t)?"windows":/\bmacintosh\b|\bmacintel\b|\bmac os x\b/.test(t)?"macos":/\blinux\b/.test(t)?"linux":"":""}function xt(e){const t=e.userAgent.trim().toLowerCase();if(!t)return"";if(/\biwatch\b|\bapple watch\b/.test(t))return"";if(/\bipad\b|\btablet\b/.test(t)||mt(e,t))return"tablet";const n=bt(e);return"android"===n?/\bmobile\b/.test(t)?"mobile":"tablet":"ios"===n&&/\biphone\b|\bipod\b/.test(t)?"mobile":"windows"===n||"macos"===n||"linux"===n||/\bcros\b/.test(t)?"desktop":/\bmobile\b/.test(t)?"mobile":""}function vt(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");return xt(void 0!==e?{userAgent:e,platform:"",maxTouchPoints:0}:wt())}function Et(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");return bt(void 0!==e?{userAgent:e,platform:"",maxTouchPoints:0}:wt())}function Tt(e,t){const n=e.trim().toLowerCase();return t.some(e=>n.includes(e))}function St(e){if(void 0===e)return function(){try{return"undefined"==typeof window||"undefined"==typeof navigator?null:{window:window,navigator:navigator,document:"undefined"==typeof document?void 0:document}}catch(e){return null}}();if(null===e||"object"!=typeof e||Array.isArray(e))return null;try{const t=e.window,n=e.navigator,r=e.document;return null===t||"object"!=typeof t||null===n||"object"!=typeof n||void 0!==r&&(null===r||"object"!=typeof r)?null:{window:t,navigator:n,document:r}}catch(e){return null}}function At(){if(window.MAZEY_BROWSER_INFO&&"object"==typeof window.MAZEY_BROWSER_INFO)return window.MAZEY_BROWSER_INFO;let e={engine:"",engineVs:"",platform:"",supporter:"",supporterVs:"",system:"",systemVs:"",shell:"",shellVs:"",appleType:"",colorScheme:""};try{const t=wt(),n=t.userAgent.toLowerCase();if(!n)return e;const r=e=>e.test(n),o=e=>{let t="";const r=n.match(e);return r&&P(r)&&(t=r.toString(),t=t.replace(/[^0-9|_.]/g,""),t=t.replace(/_/g,".")),t},i=bt(t);let s="";"ios"===i&&(r(/ipad/g)?s="ipad":r(/iphone/g)?s="iphone":r(/iwatch/g)?s="iwatch":r(/ipod/g)?s="ipod":"macintel"===t.platform.toLowerCase()&&t.maxTouchPoints>1&&(s="ipad")),e={...e,system:i,appleType:s};let a="";"windows"===i?r(/windows nt 5.0|windows 2000/g)?a="2000":r(/windows nt 5.1|windows xp/g)?a="xp":r(/windows nt 5.2|windows 2003/g)?a="2003":r(/windows nt 6.0|windows vista/g)?a="vista":r(/windows nt 6.1|windows 7/g)?a="7":r(/windows nt 6.2|windows 8/g)?a="8":r(/windows nt 6.3|windows 8.1/g)?a="8.1":r(/windows nt 10.0|windows 10/g)&&(a="10"):"macos"===i?a=o(/os x [\d._]+/g):"android"===i?a=o(/android [\d._]+/g):"ios"===i&&(a=o(/os [\d._]+/g)),e={...e,systemVs:a};let c="";"windows"===i||"macos"===i||"linux"===i?c="desktop":("android"===i||"ios"===i||r(/mobile/g))&&(c="mobile"),e={...e,platform:c};let u="",l="";r(/applewebkit/g)?(u="webkit",r(/edg(?:a|ios)?\//g)||r(/edge\//g)?l="edge":r(/opr/g)?l="opera":r(/chrome/g)?l="chrome":r(/safari/g)&&(l="safari")):r(/gecko/g)&&r(/firefox/g)?(u="gecko",l="firefox"):r(/presto/g)?(u="presto",l="opera"):r(/trident|compatible|msie/g)&&(u="trident",l="iexplore"),e={...e,engine:u,supporter:l};let f="";"webkit"===u?f=o(/applewebkit\/[\d._]+/g):"gecko"===u?f=o(/gecko\/[\d._]+/g):"presto"===u?f=o(/presto\/[\d._]+/g):"trident"===u&&(f=o(/trident\/[\d._]+/g)),e={...e,engineVs:f};let p="";"chrome"===l?p=o(/chrome\/[\d._]+/g):"safari"===l?p=o(/version\/[\d._]+/g):"firefox"===l?p=o(/firefox\/[\d._]+/g):"opera"===l?p=o(/opr\/[\d._]+/g):"iexplore"===l?p=o(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===l&&(p=o(/(?:edge|edg|edga|edgios)\/[\d._]+/g)),e={...e,supporterVs:p};let d="",m="";r(/micromessenger/g)?(d="wechat",m=o(/micromessenger\/[\d._]+/g)):r(/qqbrowser/g)?(d="qq_browser",m=o(/qqbrowser\/[\d._]+/g)):r(/\sqq/g)?d="qq_app":r(/ucbrowser/g)?(d="uc",m=o(/ucbrowser\/[\d._]+/g)):r(/qihu 360se/g)?d="360":r(/2345explorer/g)?(d="2345",m=o(/2345explorer\/[\d._]+/g)):r(/metasr/g)?d="sougou":r(/lbbrowser/g)?d="liebao":r(/maxthon/g)?(d="maxthon",m=o(/maxthon\/[\d._]+/g)):r(/biliapp/g)&&(d="bilibili"),e={...e,shell:d,shellVs:m};let g="";if(window.matchMedia){const e=window.matchMedia("(prefers-color-scheme: dark)"),t=window.matchMedia("(prefers-color-scheme: light)");e.matches?g="dark":t.matches&&(g="light")}return e={...e,colorScheme:g},window.MAZEY_BROWSER_INFO=e,e}catch(t){return ve.warn(t),e}}function Nt(e="",t="-"){const n=At(),r=[];return["system","platform","engine","supporter","shell","appleType"].forEach(o=>{const i=n[o];if(i){let n="";e&&e.length>0&&(n=`${e}${t}`),r.push(`${n}${i}`)}}),r}const Ct=Nt;let $t="";function Ot(e){if("string"!=typeof e||""===e.trim())throw new TypeError("storageKey must be a non-empty string.")}function _t(e){if("undefined"==typeof window)return null;try{return new URL(window.location.href).searchParams.get(e)}catch(e){return null}}function jt(e){if("undefined"==typeof window)return null;try{const t=window.localStorage;return t&&"function"==typeof t.getItem?t.getItem(e):null}catch(e){return null}}function Mt(e,t){if("undefined"==typeof window)return!1;try{const n=window.localStorage;return!(!n||"function"!=typeof n.setItem)&&(n.setItem(e,t),!0)}catch(e){return!1}}const Dt=Object.freeze({system:"System",light:"Light",dark:"Dark"});function Lt(e){return"light"===e||"dark"===e}function kt(){if("undefined"==typeof window)return null;try{const e=window.matchMedia;return"function"!=typeof e?null:e.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){return null}}function Pt(e,t){return{value:e,label:Dt[t]}}function Ft(e){const t=e.split("-");if(!/^[a-z]{2,8}$/i.test(t[0]))return null;const n=[t[0].toLowerCase()];let r=1;if(r<t.length&&/^[a-z]{4}$/i.test(t[r])){const e=t[r].toLowerCase();n.push(`${e[0].toUpperCase()}${e.slice(1)}`),r++}for(r<t.length&&(/^[a-z]{2}$/i.test(t[r])||/^\d{3}$/.test(t[r]))&&(n.push(/^[a-z]{2}$/i.test(t[r])?t[r].toUpperCase():t[r]),r++);r<t.length;r++){const e=t[r];if(!/^(?:[a-z0-9]{5,8}|\d[a-z0-9]{3})$/i.test(e))return null;n.push(e.toLowerCase())}return n.join("-")}function Rt(e){if("string"!=typeof e)return null;const t=e.trim().replace(/_/g,"-");if(!t)return null;if("undefined"!=typeof Intl)try{const e=Intl,n=e.getCanonicalLocales;if("function"==typeof n){const r=n.call(e,t)[0];return"string"==typeof r&&r?r:null}}catch(e){return e instanceof RangeError||"object"==typeof e&&null!==e&&"name"in e&&"RangeError"===e.name?null:Ft(t)}return Ft(t)}function Ut(e){if("undefined"==typeof Intl)return e;try{const t=Intl.DisplayNames;if("function"!=typeof t)return e;const n=new t([e],{type:"language"}).of(e);return"string"==typeof n&&n.trim()?n:e}catch(t){return e}}function zt(e){return{value:e,label:Ut(e)}}exports.addClass=Te,exports.addEvent=He,exports.addStyle=Ae,exports.assignDefined=function(e,...t){return t.forEach(t=>{void 0!==t&&Object.keys(t).forEach(n=>{const r=t[n];if(void 0!==r){const t=e;"__proto__"!==n||Object.hasOwn(e,n)?t[n]=r:Object.defineProperty(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0})}})}),e},exports.calLongestCommonSubsequence=function(e,t){return g(e,t)},exports.calLongestCommonSubstring=function(e,t){return m(e,t)},exports.calculateAspectRatio=function(e,t){if(!Number.isSafeInteger(e))throw new TypeError("width must be a safe integer.");if(!Number.isSafeInteger(t))throw new TypeError("height must be a safe integer.");if(e<=0||t<=0)throw new RangeError("width and height must be greater than zero.");const n=function(e,t){for(;0!==t;){const n=e%t;e=t,t=n}return e}(e,t);return`${e/n}x${t/n}`},exports.calculateCAGR=function(e,t,n){const r=i(e);if(!r)throw new TypeError("startDate must be a valid date.");const o=i(t);if(!o)throw new TypeError("endDate must be a valid date.");const s=o.getTime()-r.getTime();if(s<=0)throw new RangeError("endDate must be later than startDate.");const a=function(e){if("number"==typeof e){if(!Number.isFinite(e))throw new TypeError("totalReturnRate must be a finite number or percentage string.");return e}if("string"!=typeof e)throw new TypeError("totalReturnRate must be a finite number or percentage string.");const t=e.trim();if(!t)throw new TypeError("totalReturnRate must not be empty.");const n=t.endsWith("%")?t.slice(0,-1).trim():t;if(!n)throw new TypeError("totalReturnRate must be a valid percentage string.");const r=Number(n);if(!Number.isFinite(r))throw new TypeError("totalReturnRate must be a valid percentage string.");return r/100}(n);if(a<=-1)throw new RangeError("totalReturnRate must be greater than -1.");const c=s/864e5,u=Math.pow(1+a,365/c)-1;if(!Number.isFinite(u))throw new RangeError("calculated CAGR must be finite.");return u},exports.camelCase2Underscore=function(e){return E(e)},exports.camelCaseToKebabCase=function(e){return v(e)},exports.cancelBubble=function(e){e.stopPropagation()},exports.clearHTML=function(e,t={}){return I(e,t)},exports.clearHtml=function(e,t={}){return I(e,t)},exports.convert10To26=function(e){if(!Number.isFinite(e)||e<=0)return"";e=Math.floor(e);let t="";for(;e>0;){let n=e%26;0===n&&(n=26),t=String.fromCharCode(n+96)+t,e=(e-n)/26}return t},exports.convertCamelToKebab=v,exports.convertCamelToSnake=E,exports.convertCamelToUnder=T,exports.convertHttpToHttps=we,exports.convertKebabToCamel=function(e){const t=e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());return t.endsWith("-")?t.slice(0,-1):t},exports.convertObjectToQuery=function(e){return e&&0===Object.keys(e).length?"":`?${Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}`},exports.convertSnakeToCamel=S,exports.convertToHtmlBreaks=z,exports.convertUnderToCamel=A,exports.createCSSRule=Ce,exports.cutCHSString=function(e,t,n=!1){return Z(e,t,n)},exports.cutZHString=Y,exports.debounce=function(e,t,n){let r=null,o=null,i=null,s=null,a=null;const c=function(){const u=Date.now()-i;u<t&&u>=0?o=setTimeout(c,t-u):(o=null,n||(a=e.apply(r,s),o||(r=s=null)))};return function(...u){r=this,s=u,i=Date.now();const l=n&&!o;return o||(o=setTimeout(c,t)),l&&(a=e.apply(r,s),r=s=null),a}},exports.deepCopy=b,exports.deepCopyObject=function(e){return b(e)},exports.deepFreeze=function e(t){return!t||"object"!=typeof t||Object.isFrozen(t)||(Object.freeze(t),Object.values(t).forEach(e)),t},exports.delCookie=function(e){st(e)},exports.derivePackageMetadata=function(e,t={}){if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("manifest must be an object");if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError("options must be an object when provided");const n=e;if("string"!=typeof n.name||!n.name.trim())throw new TypeError("manifest.name must be a non-empty string");const r=n.name.trim(),o=function(e){if(/\s/.test(e))throw new TypeError("manifest.name must not contain whitespace");if(e.startsWith("@")){const t=e.split("/");if(2!==t.length||t[0].length<2||!t[1])throw new TypeError("manifest.name must be a valid scoped package name");return t[1]}if(e.includes("/"))throw new TypeError("manifest.name must be an unscoped or scoped package name");return e}(r),i=t.packageManager??"npm";if("npm"!==i&&"pnpm"!==i&&"yarn"!==i)throw new TypeError('packageManager must be "npm", "pnpm", or "yarn"');const s="npm"===i?"npm install":`${i} add`;return{name:r,version:ne(n,"version"),description:ne(n,"description"),license:ne(n,"license"),author:re(n.author),unscopedName:o,iifeGlobal:N(o),installCommand:`${s} ${r}`}},exports.detectVisitorType=function(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");const t=void 0===e?function(){const e=yt();if(!e)return"";try{const t=e.userAgent;return"string"==typeof t?t:""}catch(e){return""}}():e;return Tt(t,gt)?"crawler":Tt(t,ht)||function(){const e=yt();if(!e)return!1;try{return!0===e.webdriver}catch(e){return!1}}()?"automation":"unknown"},exports.doFn=k,exports.escapeHTML=B,exports.escapeHtmlAttribute=function(e,t={}){if("string"!=typeof e)throw new TypeError("value must be a string.");const n=t.preserveEntities?/&(?!(?:#[0-9]+|#x[0-9a-f]+|[a-z][a-z0-9]+);)/gi:/&/g,r={"<":"<",">":">",'"':""","'":"'"};return e.replace(n,"&").replace(/[<>"']/g,e=>r[e])},exports.extractElementText=function(e,t={}){const{excludeSelector:n="",replaceImagesWithAlt:r=!0,normalizeWhitespace:o=!0}=t,i=e.cloneNode(!0);r&&Array.from(i.querySelectorAll("img[alt]")).forEach(e=>{const t=e.getAttribute("alt")||"";e.parentNode?.replaceChild(i.ownerDocument.createTextNode(t),e)});const s=n.trim();s&&Oe(s,{root:i})&&Array.from(i.querySelectorAll(s)).forEach(e=>e.parentNode?.removeChild(e));const a=i.innerText||i.textContent||"";return o?a.replace(/\u00a0/g," ").replace(/\s+/g," ").trim():a},exports.fireEvent=qe,exports.floatFixed=function(e,t=0){return parseFloat(String(e)).toFixed(t)},exports.floatToPercent=M,exports.formatByteSize=Q,exports.formatDate=d,exports.formatDistanceToNow=function(e){const t=i(e);if(!t)return"";const n=6e4,r=36e5,o=864e5,s=Math.abs(t.getTime()-Date.now());return s<3e4?"less than a minute":s<9e4?"about 1 minute":s<27e5?p(s/n,"minute"):s<54e5?"about 1 hour":s<864e5?p(s/r,"hour"):s<1512e5?"about 1 day":s<30*o?p(s/o,"day"):s<45*o?"about 1 month":s<365*o?p(s/(30*o),"month"):s<545*o?"about 1 year":p(s/(365*o),"year")},exports.formatDurationFromMs=function(e){const t=(Number.isFinite(e)?Math.max(e,0):0)/1e3;return t>=86400?f(t/24/60/60,"day"):t>=3600?f(t/60/60,"hour"):t>=60?f(t/60,"minute"):f(t,"second")},exports.formatLocalDateTime=function(t,n={}){const r="object"==typeof t&&null!==t?e(t):null;if(null===r)throw new TypeError("date must be a Date");if(!Number.isFinite(r))throw new RangeError("Invalid date");const o=n.precision??"minute";if("minute"!==o&&"second"!==o&&"millisecond"!==o)throw new TypeError("precision must be minute, second, or millisecond");const i=new Date(r),s=i.getFullYear();if(s<1)throw new RangeError("Date year must be greater than zero");const c=[a(s,4),a(i.getMonth()+1,2),a(i.getDate(),2)].join("-"),u=[a(i.getHours(),2),a(i.getMinutes(),2)];"minute"!==o&&u.push(a(i.getSeconds(),2));let l=`${c}T${u.join(":")}`;return"millisecond"===o&&(l+=`.${a(i.getMilliseconds(),3)}`),l},exports.formatPercentage=j,exports.genBrowserAttrs=Ct,exports.genCustomConsole=xe,exports.genHashCode=function(e){let t,n,r=0;for(t=0;t<e.length;t++)n=e.charCodeAt(t),r=(r<<5)-r+n,r|=0;return r},exports.genRndNumString=$,exports.genStyleString=$e,exports.genUniqueNumString=_,exports.generateCalendarVersion=function(e){return d(void 0===e?new Date:new Date(e instanceof Date?e.getTime():e),"yyyy.MMdd.HHmmss").split(".").map(e=>String(Number(e))).join(".")},exports.generateRndNum=O,exports.generateUniqueNum=function(e=3){return _(e)},exports.getAllQueryParams=function(e=""){""===e&&(e=location.search);const t={};return ie(e).forEach(([e,n])=>{Object.hasOwn(t,e)||Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0})}),t},exports.getBrowserClassNames=Nt,exports.getBrowserInfo=At,exports.getCLS=async function(){return ft("layout-shift")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().reduce((e,t)=>{let n=0;return D(t.value)&&(n=t.value),e+n},0);t.disconnect(),e(r)});t.observe({type:"layout-shift",buffered:!0})}):0},exports.getCookie=it,exports.getCurrentVersion=function(){return"v4"},exports.getDateDifference=l,exports.getDefineListeners=Ie,exports.getDomain=function(e,t=["hostname"]){try{const n=new URL(e,document.baseURI);return t.reduce((e,t)=>e+=n[t],"")}catch(n){const r=document.createElement("a");return r.href=e,t.reduce((e,t)=>e+=r[t],"")}},exports.getFCP=pt,exports.getFID=async function(){return ft("first-input")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-input"===e.entryType);if(r){t.disconnect();const n=r.processingStart;e(n?Math.round(r.processingStart-r.startTime):0)}});t.observe({type:"first-input",buffered:!0})}):0},exports.getFP=dt,exports.getFileSize=function(e,t={}){return Q(e,t)},exports.getFriendlyInterval=function(e=0,t=0,n=c){return l(e,t,n)},exports.getHashQueryParam=function(e){const t=location.hash.split("?");return 1===t.length?"":se(`?${t.slice(1).join("?")}`,e)[0]||""},exports.getLCP=async function(){return ft("largest-contentful-paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"largest-contentful-paint"===e.entryType);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"largest-contentful-paint",buffered:!0})}):0},exports.getLocalJSON=Ze,exports.getLocalStorage=Ke,exports.getPageMeta=function(e){const t=document.getElementsByTagName("meta");for(let n=0;n<t.length;n++)if(t[n].getAttribute("name")===e)return t[n].getAttribute("content")||"";return""},exports.getPerformance=async function(e=!1){if(!ft("navigation"))return Promise.reject(new Error("navigation is not supported"));const t=window.performance;if(!t||"function"!=typeof t.getEntriesByType)return Promise.reject(new Error("performance is not supported"));let n;const r=new Promise(e=>{[n]=[e]}),o=t.getEntriesByType("navigation");if(!P(o))return Promise.reject(new Error("NavigationTiming is not supported"));const i=o[0];let[s,a,c,u,l,f,p,d,m,g,h,y,w,b,x,v,T,S,A]=new Array(19).fill(0);({decodedBodySize:S,encodedBodySize:A}=i),({unloadEventEnd:s,unloadEventStart:a,redirectEnd:c,redirectStart:u,domainLookupEnd:l,domainLookupStart:f,connectEnd:p,connectStart:d,secureConnectionStart:m,responseStart:g,requestStart:h,responseEnd:y,domContentLoadedEventStart:w,loadEventStart:b,loadEventEnd:x,startTime:v,fetchStart:T}=i);let N=0;if(D(v))N=v;else{if(!D(T))return Promise.reject(new Error("startTime, navigationStart or fetchStart are required"));N=T}const[C,$]=await Promise.all([dt(),pt()]);function O(){({decodedBodySize:S,encodedBodySize:A}=i),({unloadEventEnd:s,unloadEventStart:a,redirectEnd:c,redirectStart:u,domainLookupEnd:l,domainLookupStart:f,connectEnd:p,connectStart:d,secureConnectionStart:m,responseStart:g,requestStart:h,responseEnd:y,domContentLoadedEventStart:w,loadEventStart:b,loadEventEnd:x,startTime:v,fetchStart:T}=i),D(v)?N=v:D(T)&&(N=T);const t={source:"PerformanceNavigationTiming",os:_(),osVersion:j(),deviceType:M(),network:L(),screenDirection:k(),unloadTime:s-a,redirectTime:c-u,dnsTime:l-f,tcpTime:p-d,sslTime:F(p,m),responseTime:g-h,downloadTime:y-g,firstPaintTime:C,firstContentfulPaintTime:$,domReadyTime:w-N,onloadTime:b-N,whiteTime:g-N,renderTime:x-N,decodedBodySize:S,encodedBodySize:A};Object.keys(t).forEach(e=>{D(t[e])&&(t[e]<0?t[e]=0:t[e]=Math.round(t[e]))}),D(t.whiteTime)&&t.whiteTime>t.onloadTime&&(t.whiteTime=0);const r={};e||Object.keys(t).forEach(e=>{r[E(e)]=t[e]}),Object.keys(r).length?n(r):n(t)}function _(){let e;return e=navigator.userAgent.indexOf("Android")>-1?"android":navigator.userAgent.indexOf("iPhone")>-1?"ios":navigator.userAgent.indexOf("Windows Phone")>-1?"wp":"others",e}function j(){let e="";const t=navigator.userAgent,n=t.indexOf("Android")>-1,r=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),o=navigator.userAgent.split(";");if(o.length<2)return e;const i=o[1];return i?(n&&(e=(i.match(/\d+\.\d+/g)||[])[0]),r&&(e=(i.match(/(\d+)_(\d+)_?(\d+)?/)||[])[0]),e||(e=""),e):e}function M(){let e;const t=navigator.userAgent.toLowerCase(),n=t.match(/(ipad)/i)&&"ipad",r=t.match(/iphone os/i)&&"iphone os",o=t.match(/midp/i)&&"midp",i=t.match(/rv:1.2.3.4/i)&&"rv:1.2.3.4",s=t.match(/ucweb/i)&&"ucweb",a=t.match(/android/i)&&"android",c=t.match(/windows ce/i)&&"windows ce",u=t.match(/windows mobile/i)&&"windows mobile";return e=n||r||o||i||s||a||c||u?r||o||i||s||a||c||u?"phone":n?"ipad":void 0:"pc",e||(e=""),e}function L(){let e="";const t=window.navigator;if(t.connection&&t.connection.effectiveType)switch(t.connection.effectiveType){case"wifi":e="wifi";break;case"4g":e="4g";break;case"2g":e="2g";break;case"3g":e="3g";break;case"ethernet":e="ethernet";break;case"default":e=void 0}return e||(e=""),e}function k(){let e="";return window.screen&&window.screen.orientation&&"number"==typeof window.screen.orientation.angle&&(180!==window.screen.orientation.angle&&0!==window.screen.orientation.angle||(e="|"),90!==window.screen.orientation.angle&&-90!==window.screen.orientation.angle||(e="-")),e}function F(e,t){let n=0;return t&&(n=e-t),n}return D(x)&&x>0?O():"complete"===document.readyState?window.setTimeout(O,0):window.addEventListener("load",function e(){window.removeEventListener("load",e),window.setTimeout(function(){O()},0)}),r},exports.getQueryParam=function(e){return se(location.search,e)[0]||""},exports.getScriptQueryParam=function(e,t=""){t||(t=".js");const n=document.querySelectorAll("script[src]");for(let r=0;r<n.length;r++){const o=n[r].getAttribute("src");if(o&&-1!==o.indexOf(t)){const t=se(o,e)[0];if(void 0!==t)return t}}return""},exports.getSessionJSON=Ve,exports.getSessionStorage=Qe,exports.getSystemTheme=kt,exports.getTTFB=async function(){if(!ft("navigation"))return 0;if(!window.performance||!window.performance.getEntriesByType)return 0;const e=window.performance.getEntriesByType("navigation")[0];let t=0;return e?(t=e.responseStart-e.requestStart,Math.round(t)):0},exports.getURLPathExtension=he,exports.getUrlFileType=ye,exports.getUrlHost=function(e){!ge(e)&&ge(e,{strict:!1})&&e.startsWith("//")&&(e="https:"+e);try{return new URL(e).host}catch(e){return""}},exports.getUrlParam=function(e,t,n={}){const r=se(e,t);return n.returnArray?r:r.length?r[0]:null},exports.getUrlPath=function(e){!ge(e)&&ge(e,{strict:!1})&&e.startsWith("//")&&(e="https:"+e);try{return new URL(e).pathname}catch(e){return""}},exports.hasClass=function(e,t){if(!e)return ve.error("The element is not exist."),!1;const n=e.className.split(/\s+/);for(let e=0;e<n.length;e++)if(n[e]===t)return!0;return!1},exports.hide=function(e){return Ue(e)},exports.hideElements=Ue,exports.inRate=function(e){return h(e)},exports.injectStyle=Se,exports.invokeEvent=function(e,t){qe(e,t)},exports.invokeFn=L,exports.isAndroid=function(e){return"android"===Et(e)},exports.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},exports.isBool=R,exports.isBoolean=function(e){return R(e)},exports.isBrowser=function(){if(te)return"browser"===te;const e="undefined"!=typeof window;return e&&(te="browser"),e},exports.isCNMobileNumber=G,exports.isDesktop=function(e){return"desktop"===vt(e)},exports.isFunction=function(e){return"function"==typeof e},exports.isHit=function(e){return h(e)},exports.isIOS=function(e){return"ios"===Et(e)},exports.isJSONString=C,exports.isJsonString=function(e){return C(e)},exports.isLinux=function(e){return"linux"===Et(e)},exports.isMacOS=function(e){return"macos"===Et(e)},exports.isMobile=X,exports.isNonEmptyArray=P,exports.isNonEmptyObject=function(e){return!!F(e)&&0!==Object.keys(e).length},exports.isNullish=U,exports.isNumber=D,exports.isPhone=function(e){return"mobile"===vt(e)},exports.isPureObject=F,exports.isSafePWAEnv=function(e={}){try{if(null===e||"object"!=typeof e||Array.isArray(e))return!1;const t=e.requireManifest,n=e.scope,r=e.environment;if(void 0!==t&&"boolean"!=typeof t||void 0!==n&&"string"!=typeof n)return!1;const o=St(r);if(!o)return!1;const{window:i,navigator:s,document:a}=o,c=s.serviceWorker;if(!0!==i.isSecureContext||null===c||"object"!=typeof c)return!1;if(void 0!==n&&!function(e,t){const n=e.trim();if(!n||/[?#]/.test(n))return!1;try{const e=new URL(t.location.href),r=new URL(n,e);if(r.origin!==e.origin||""!==r.search||""!==r.hash)return!1;if(e.pathname===r.pathname)return!0;const o=r.pathname.endsWith("/")?r.pathname:`${r.pathname}/`;return e.pathname.startsWith(o)}catch(e){return!1}}(n,i))return!1;if(!1===t)return!0;if(!a)return!1;const u=a.querySelector('link[rel~="manifest"][href]');return Boolean(u?.getAttribute("href")?.trim())}catch(e){return!1}},exports.isStandalonePWA=function(e={}){let t;try{if(null===e||"object"!=typeof e||Array.isArray(e))return!1;t=e.environment}catch(e){return!1}const n=St(t);if(!n)return!1;const{window:r,navigator:o}=n;try{const e=r.matchMedia;if("function"==typeof e&&e.call(r,"(display-mode: standalone)").matches)return!0}catch(e){}try{return!0===o.standalone}catch(e){return!1}},exports.isString=function(e){return"string"==typeof e},exports.isSupportWebp=function(){return $t?Promise.resolve("webp"===$t):new Promise(e=>{const t=new Image;t.onload=()=>{const n=t.width>0&&t.height>0;$t=n?"webp":"no-webp",e(n)},t.onerror=()=>{$t="no-webp",e(!1)},t.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="})},exports.isSupportedEntryType=ft,exports.isTablet=function(e){return"tablet"===vt(e)},exports.isThisHour=function(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()&&t.getHours()===n.getHours()},exports.isThisMonth=function(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()},exports.isThisWeek=function(e){const t=i(e);if(!t)return!1;const n=new Date,r=(n.getDay()+6)%7;n.setHours(0,0,0,0),n.setDate(n.getDate()-r);const o=new Date(n.getTime());o.setDate(o.getDate()+7);const s=t.getTime();return s>=n.getTime()&&s<o.getTime()},exports.isThisYear=function(e){const t=i(e);return null!==t&&t.getFullYear()===(new Date).getFullYear()},exports.isToday=function(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()},exports.isUdfOrNul=function(e){return U(e)},exports.isValidCssSelector=Oe,exports.isValidData=function(e,t,n){if(null===e||"object"!=typeof e)return!1;let r=e;for(const e of t){if(null===r||"object"!=typeof r&&"function"!=typeof r||!Object.hasOwn(r,e))return!1;r=r[e]}return r===n},exports.isValidDate=function(e){return null!==i(e)},exports.isValidEmail=function(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},exports.isValidHttpUrl=ge,exports.isValidPhoneNumber=K,exports.isValidUrl=function(e){return/^[a-zA-Z0-9]+:\/\/[-a-zA-Z0-9@:%._+~#=]{1,256}\b([-a-zA-Z0-9\u4E00-\u9FA5\u3002\uff1b\uff0c\uff1a\u201c\u201d\uff08\uff09\u3001\uff1f\u300a\u300b()!@:%_+.~#?&//=]*)$/.test(e)},exports.isWindows=function(e){return"windows"===Et(e)},exports.listenMediaQueryChanges=function(e,t){if("function"!=typeof t)throw new TypeError("listener must be a function");if(null===e)return()=>{};if("object"!=typeof e)throw new TypeError("media must be a MediaQueryList or null");const n=e.addEventListener,r=e.removeEventListener;let o=null;if("function"==typeof n&&"function"==typeof r){const i=t;n.call(e,"change",i),o=()=>r.call(e,"change",i)}let i=!1;return()=>{i||(i=!0,o?.())}},exports.loadCSS=at,exports.loadImage=function(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=e})},exports.loadScript=ut,exports.loadScriptIfUndefined=function(e,t){if(window[e])return Promise.resolve("defined");let n=lt.get(e);const r=n?.get(t);if(r)return r;n||(n=new Map,lt.set(e,n));const o=()=>{n?.delete(t),0===n?.size&<.delete(e)},i=ut(t).then(e=>(o(),e),e=>{throw o(),e});return n.set(t,i),i},exports.longestComSubsequence=g,exports.longestComSubstring=m,exports.mNow=function(){return Date.now()},exports.mTrim=function(e){return e.trim()},exports.mazeyCon=ve,exports.newLine=function(e){return z(e)},exports.onEvent=Be,exports.onURLChange=function(e,t={}){const{fireOnInit:n=!0}=t,r=history;let o=location.href;const i=[],s=t=>{const n=location.href;if(n===o&&"load"!==t)return;const r=o;o=n,e({url:n,oldUrl:r,trigger:t})},a=()=>s("popstate"),c=()=>s("hashchange");window.addEventListener("popstate",a),window.addEventListener("hashchange",c),i.push(()=>window.removeEventListener("popstate",a)),i.push(()=>window.removeEventListener("hashchange",c)),r.__mazeyUrlChangePatched__||(r.__mazeyUrlChangePatched__=!0,r.__mazeyUrlChangeSubscribers__=new Set,r.__mazeyRawPushState__=history.pushState.bind(history),r.__mazeyRawReplaceState__=history.replaceState.bind(history),history.pushState=function(...e){r.__mazeyRawPushState__(...e),r.__mazeyUrlChangeSubscribers__.forEach(e=>e("pushState"))},history.replaceState=function(...e){r.__mazeyRawReplaceState__(...e),r.__mazeyUrlChangeSubscribers__.forEach(e=>e("replaceState"))});const u=e=>s(e);return r.__mazeyUrlChangeSubscribers__.add(u),i.push(()=>r.__mazeyUrlChangeSubscribers__.delete(u)),n&&s("load"),()=>{i.forEach(e=>e())}},exports.parseGitHubRepository=function(e){if("string"!=typeof e)throw new TypeError("value must be a string");const t=e.trim();if(!t||/[%\\?#]/.test(t)||function(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<=31||127===n)return!0}return!1}(t))throw ue();const n=t.match(/^(?:github:)?([^/:\s]+)\/([^/\s]+)$/i);if(n)return le(n[1],n[2]);const r=t.match(/^git@([^:\s]+):([^/\s]+)\/([^/\s]+)$/);if(r&&"github.com"===r[1].toLowerCase())return le(r[2],r[3]);const o=t.replace(/^git\+(?=(?:git|ssh|https?):\/\/)/i,""),i=o.match(/^[a-z][a-z\d+.-]*:\/\/([^/?#]+)/i);if(!i||/(^|\/)\.{1,2}(?:\/|$)/.test(o.slice(i[0].length)))throw ue();if(-1!==i[1].slice(i[1].lastIndexOf("@")+1).indexOf(":"))throw ue();let s;try{s=new URL(o)}catch(e){throw ue()}const a=s.protocol.toLowerCase(),c=s.hostname.toLowerCase().replace(/^www\./,"");if(!["git:","ssh:","http:","https:"].includes(a)||"github.com"!==c||""!==s.username&&"git"!==s.username||""!==s.password||""!==s.search||""!==s.hash)throw ue();const u=s.pathname.match(/^\/([^/]+)\/([^/]+)\/?$/);if(!u)throw ue();return le(u[1],u[2])},exports.parseJsonSafe=function(e,t=null){try{return JSON.parse(e)}catch(e){return t}},exports.parseLocalDateTime=function(e){if("string"!=typeof e)return null;const t=s.exec(e);if(!t)return null;const[n,i,a,c,u,l="0",f=""]=t.slice(1),p=Number(n),d=Number(i),m=Number(a),g=Number(c),h=Number(u),y=Number(l),w=Number(`${f}00`.slice(0,3));return p<1||!r(p,d,m,g,h,y,w)?null:o(p,d,m,g,h,y,w)},exports.randomBoolean=h,exports.removeClass=function(e,t){if(!e)return void ve.error("The element is not exist.");let n;n=" "+e.className+" ",n=n.replace(/(\s+)/gi," "),n=n.replace(" "+t+" "," "),n=n.replace(/(^\s+)|(\s+$)/g,""),e.className=n},exports.removeCookie=st,exports.removeEvent=function(e,t){const n=Ie(),r=n[e];if("string"==typeof e&&Array.isArray(r))if("function"==typeof t){for(let o=0,i=r.length;o<i;o++)if(r[o]===t){n[e].splice(o,1);break}}else delete n[e]},exports.removeHTML=I,exports.removeHtml=function(e,t={}){return I(e,t)},exports.repeatUntilConditionMet=function(e,t={},n=e=>!0===e){const{interval:r=1e3,times:o=10,context:i,args:s}=t;if("function"!=typeof e)return void console.error("Expected a function.");if(!Number.isFinite(r)||r<0)return void console.error("Expected a non-negative number for interval.");if(!Number.isFinite(o)||o<0)return void console.error("Expected a non-negative number for times.");if(0===o)return;let a=0;const c=()=>{setTimeout(async()=>{const t=await e.apply(i,s);n(t)||++a>=o||c()},r)};c()},exports.replaceHttp=function(e){return we(e)},exports.resolveElementTarget=function(e,t){if(void 0===e)return _e(t.defaultElement)?t.defaultElement:null;let n=t.unwrap?t.unwrap(e):e;if(null==n)return null;if("string"==typeof n)try{return t.root.querySelector(n)}catch(e){return null}return"object"==typeof n&&"$el"in n&&(n=n.$el),_e(n)?n:null},exports.resolveLanguagePreference=function(e){Ot(e);const t=Rt(_t("lang"));if(t)return zt(t);const n=Rt(jt(e));return zt(n||(Rt(function(){if("undefined"==typeof window||"undefined"==typeof navigator)return null;try{return"string"==typeof navigator.language?navigator.language:null}catch(e){return null}}())??"en"))},exports.resolveThemePreference=function(e){Ot(e);const t=_t(e);if(Lt(t))return Pt(t,t);const n=jt(e);if(Lt(n))return Pt(n,n);const r=kt();return"system"===n&&r||r?Pt(r,"system"):Pt("light","light")},exports.sanitizeInput=H,exports.setClass=function(e,t){Te(e,t)},exports.setCookie=function(e,t,n,r){let o;if(n){const e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),o="; expires="+e.toUTCString()}else o="";const i=function(e){let t=!0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(!(33===r||r>=35&&r<=43||r>=45&&r<=58||r>=60&&r<=91||r>=93&&r<=126)){t=!1;break}}return{isEncoded:!t,value:t?e:encodeURIComponent(e)}}(t),s=nt(e),a=i.isEncoded?"1":"",c=i.isEncoded?o:"; expires=Thu, 01 Jan 1970 00:00:00 GMT",u=[`${s}=${i.value}${o}; path=/`,`${tt(e)}=${a}${c}; path=/`],l=e=>{const t=e?`; domain=${e}`:"";u.forEach(e=>{document.cookie=`${e}${t}`})},f=location.hostname;if(r)l(r);else if(-1===f.indexOf("."))l();else{const n=f.split(".");n.shift();l("."+n.join(".")),it(e)!==t&&l(`.${f}`)}},exports.setImgSizeBySrc=Ne,exports.setImgWidHeiBySrc=function(){return Ne()},exports.setLanguagePreference=function(e,t){Ot(e);const n=Rt(t);if(!n)throw new TypeError("language must be a valid language tag.");return Mt(e,n)},exports.setLocalJSON=Ye,exports.setLocalStorage=Ge,exports.setSessionJSON=We,exports.setSessionStorage=Je,exports.setThemePreference=function(e,t){if(Ot(e),!function(e){return"system"===e||Lt(e)}(t))throw new TypeError('value must be "system", "light", or "dark".');return Mt(e,t)},exports.sha256Hex=async function(e){const t="undefined"==typeof crypto?null:crypto;if(!t?.subtle||"function"!=typeof t.subtle.digest)throw new Error("Web Crypto API is not available.");let n=e;if("string"==typeof e){if("undefined"==typeof TextEncoder)throw new Error("TextEncoder is not available.");n=(new TextEncoder).encode(e)}const r=await t.subtle.digest("SHA-256",n);let o="";const i=new Uint8Array(r);for(let e=0;e<i.length;e++){const t=i[e].toString(16);o+=1===t.length?`0${t}`:t}return o},exports.show=function(e){return ze(e)},exports.showElements=ze,exports.sleep=async function(e){return ee(e)},exports.subYears=function(t,n){const r="number"==typeof t?t:"object"==typeof t&&null!==t?e(t):null,o=new Date(r??NaN),i="number"==typeof n?n<0?Math.ceil(n):Math.floor(n):NaN;if(!Number.isFinite(o.getTime())||!Number.isFinite(i))return new Date(NaN);if(0===i)return o;const s=o.getMonth(),a=o.getDate(),c=o.getFullYear()-i,u=new Date(o.getTime());return u.setFullYear(c,s+1,0),a>=u.getDate()?u:(o.setFullYear(c,s,a),o)},exports.throttle=function(e,t,n={}){n=Object.assign({},n);let r=null,o=null,i=null,[s,a]=[null,0];const c=function(){a=!1===n.leading?0:Date.now(),i=null,s=e.apply(this,o),i||(r=o=null)};return function(...u){const l=Date.now();a||!1!==n.leading||(a=l);const f=t-(l-a);return r=this,o=u,f<=0||f>t?(i&&(clearTimeout(i),i=null),a=l,s=e.apply(r,o),i||(r=o=null)):i||!1===n.trailing||(i=setTimeout(c.bind(r),f)),s}},exports.timeCon=Ee,exports.toJavaScriptGlobalName=N,exports.truncateByWeightedLength=V,exports.truncateZHString=Z,exports.unescapeHTML=q,exports.unsanitize=function(e){return q(e)},exports.unsanitizeInput=W,exports.updateQueryParam=function(e,t,n){const r=e.indexOf("#"),o=-1===r?"":e.slice(r),i=-1===r?e:e.slice(0,r),s=i.indexOf("?"),a=-1===s?i:i.slice(0,s),c=-1===s?"":i.slice(s+1),u=encodeURIComponent(t),l=encodeURIComponent(n);let f=!1;const p=(c?c.split("&").filter(Boolean):[]).reduce((e,n)=>{const r=n.indexOf("=");return oe(-1===r?n:n.slice(0,r))===t?f||(e.push(`${u}=${l}`),f=!0):e.push(n),e},[]);return f||p.push(`${u}=${l}`),`${a}?${p.join("&")}${o}`},exports.waitTime=ee,exports.watchServiceWorkerUpdates=function(e,t,n){if(null===e||"object"!=typeof e||"function"!=typeof e.addEventListener||"function"!=typeof e.removeEventListener)throw new TypeError("registration must support event listeners");if(null===t||"object"!=typeof t||"function"!=typeof t.addEventListener||"function"!=typeof t.removeEventListener)throw new TypeError("container must support event listeners");if(null===n||"object"!=typeof n||"function"!=typeof n.onUpdateAvailable||void 0!==n.onControllerChange&&"function"!=typeof n.onControllerChange)throw new TypeError("callbacks must provide onUpdateAvailable");let r=!1,o=null,i=null,s=!1,a=!1;const c=e=>{r||i===e||(i=e,n.onUpdateAvailable(e))},u=()=>{!r&&"installed"===o?.state&&t.controller&&c(o)},l=()=>{r||(o?.removeEventListener("statechange",u),o=e.installing,o?.addEventListener("statechange",u),u())},f=()=>{r||n.onControllerChange?.()},p=()=>{if(s){try{e.removeEventListener("updatefound",l)}catch(e){}s=!1}try{o?.removeEventListener("statechange",u)}catch(e){}if(a){try{t.removeEventListener("controllerchange",f)}catch(e){}a=!1}};try{e.addEventListener("updatefound",l),s=!0,t.addEventListener("controllerchange",f),a=!0,e.waiting&&t.controller&&c(e.waiting),e.installing&&l()}catch(e){throw r=!0,p(),o=null,i=null,e}return{activateWaiting(e={type:"SKIP_WAITING"}){if(r||!i)return!1;try{return i.postMessage(e),!0}catch(e){return!1}},dispose(){r||(r=!0,p(),o=null,i=null)}}},exports.windowLoaded=function(e=3e4){return new Promise((t,n)=>{let r=null;const o=()=>{window.removeEventListener("load",i),null!==r&&(clearTimeout(r),r=null)},i=()=>{o(),t("load")};"complete"!==document.readyState?(window.addEventListener("load",i),r=setTimeout(()=>{o(),n(new Error("timeout"))},e)):t("complete")})},exports.zAxiosIsValidRes=function(e,t={validStatusRange:[200,300],validCode:[0]}){const n=t||{},{validStatusRange:r=[200,300],validCode:o=[0]}=n;2!==r.length&&console.error("valid validStatusRange is required");let i=!1;if(e&&e.status&&2===r.length&&e.status>=r[0]&&e.status<r[1]){const t=e.data;t&&o.includes(t.code)&&(i=!0)}return i};
|