ddan-js 2.9.19 → 2.10.0
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/package.json +1 -16
- package/bin/tiny/hook.d.ts +0 -185
- package/bin/tiny/hook.esm.js +0 -1
- package/bin/tiny/hook.js +0 -1
- package/bin/tiny/store.d.ts +0 -9
- package/bin/tiny/utils.d.ts +0 -239
- package/bin/tiny/utils.esm.js +0 -1
- package/bin/tiny/utils.js +0 -1
- package/bin/tiny/web.d.ts +0 -114
- package/bin/tiny/web.esm.js +0 -1
- package/bin/tiny/web.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ddan-js",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ddan-js",
|
|
@@ -33,21 +33,6 @@
|
|
|
33
33
|
"import": "./bin/ddan-upload.mjs",
|
|
34
34
|
"require": "./bin/ddan-upload.js"
|
|
35
35
|
},
|
|
36
|
-
"./tiny/hook": {
|
|
37
|
-
"types": "./bin/tiny/hook.d.ts",
|
|
38
|
-
"import": "./bin/tiny/hook.esm.js",
|
|
39
|
-
"require": "./bin/tiny/hook.js"
|
|
40
|
-
},
|
|
41
|
-
"./tiny/utils": {
|
|
42
|
-
"types": "./bin/tiny/utils.d.ts",
|
|
43
|
-
"import": "./bin/tiny/utils.esm.js",
|
|
44
|
-
"require": "./bin/tiny/utils.js"
|
|
45
|
-
},
|
|
46
|
-
"./tiny/web": {
|
|
47
|
-
"types": "./bin/tiny/web.d.ts",
|
|
48
|
-
"import": "./bin/tiny/web.esm.js",
|
|
49
|
-
"require": "./bin/tiny/web.js"
|
|
50
|
-
},
|
|
51
36
|
"./*": "./*"
|
|
52
37
|
},
|
|
53
38
|
"files": [
|
package/bin/tiny/hook.d.ts
DELETED
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
declare const dHook: {
|
|
2
|
-
qs: {
|
|
3
|
-
parse: (qs: any, { sep, eq, max, multiple, uri, parseNumber, parseBoolean }?: {
|
|
4
|
-
sep?: string | undefined;
|
|
5
|
-
eq?: string | undefined;
|
|
6
|
-
max?: number | undefined;
|
|
7
|
-
multiple?: boolean | undefined;
|
|
8
|
-
uri?: boolean | undefined;
|
|
9
|
-
parseNumber?: boolean | undefined;
|
|
10
|
-
parseBoolean?: boolean | undefined;
|
|
11
|
-
}) => {};
|
|
12
|
-
stringify: (obj: any, { sep, eq, name, uri, cleanZero, cleanNull, cleanWhitespace }?: {
|
|
13
|
-
sep?: string | undefined;
|
|
14
|
-
eq?: string | undefined;
|
|
15
|
-
name?: null | undefined;
|
|
16
|
-
uri?: boolean | undefined;
|
|
17
|
-
cleanZero?: boolean | undefined;
|
|
18
|
-
cleanNull?: boolean | undefined;
|
|
19
|
-
cleanWhitespace?: boolean | undefined;
|
|
20
|
-
}) => string;
|
|
21
|
-
https: (url: string) => string;
|
|
22
|
-
parseUrl: (url: string) => {
|
|
23
|
-
pathname: string;
|
|
24
|
-
params: {};
|
|
25
|
-
route: string;
|
|
26
|
-
page: string;
|
|
27
|
-
name: string;
|
|
28
|
-
withoutExtension: string;
|
|
29
|
-
extname: string;
|
|
30
|
-
href: string;
|
|
31
|
-
url: string;
|
|
32
|
-
origin: string;
|
|
33
|
-
host: string;
|
|
34
|
-
protocol: string;
|
|
35
|
-
port: string;
|
|
36
|
-
query: string;
|
|
37
|
-
};
|
|
38
|
-
parsePath: (url: string) => {
|
|
39
|
-
route: string;
|
|
40
|
-
page: string;
|
|
41
|
-
name: string;
|
|
42
|
-
withoutExtension: string;
|
|
43
|
-
extname: string;
|
|
44
|
-
};
|
|
45
|
-
parseHost: (url: string) => import("..").Ddan.IHttpHost;
|
|
46
|
-
join: (...args: string[]) => string;
|
|
47
|
-
shExpMatch: (text: string, pattern: string) => boolean;
|
|
48
|
-
isLocalIpAddress: (addr: string) => boolean;
|
|
49
|
-
parseFileUrl: (url: string) => {
|
|
50
|
-
href: string;
|
|
51
|
-
file: string;
|
|
52
|
-
url: string;
|
|
53
|
-
protocol: string;
|
|
54
|
-
host: string;
|
|
55
|
-
query: string;
|
|
56
|
-
params: {};
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
singleton: <T>() => {
|
|
60
|
-
new (): {};
|
|
61
|
-
__instance__: any;
|
|
62
|
-
readonly Instance: T;
|
|
63
|
-
readonly I: T;
|
|
64
|
-
};
|
|
65
|
-
getset: <T_1 = any>(t?: T_1 | undefined) => import("..").Ddan.IGetset<T_1>;
|
|
66
|
-
random: (max: number) => number;
|
|
67
|
-
randomRange: (min: number, max: number) => number;
|
|
68
|
-
lerp: (start: number, end: number, t: number) => number;
|
|
69
|
-
randoms: (max: number, count?: number, repeat?: boolean) => number[];
|
|
70
|
-
strip: (num: string | number, digits?: number) => number;
|
|
71
|
-
float: (num: string | number, { digits, fixed }?: {
|
|
72
|
-
digits?: number | undefined;
|
|
73
|
-
fixed?: boolean | undefined;
|
|
74
|
-
}) => number;
|
|
75
|
-
radian2degree: (radians: number) => number;
|
|
76
|
-
degree2radian: (degrees: number) => number;
|
|
77
|
-
calcDataSize: (data: number) => {
|
|
78
|
-
gb: number;
|
|
79
|
-
mb: number;
|
|
80
|
-
kb: number;
|
|
81
|
-
b: number;
|
|
82
|
-
total: number;
|
|
83
|
-
desc: string;
|
|
84
|
-
};
|
|
85
|
-
toString: (value: any) => any;
|
|
86
|
-
startCase: (string: any) => any;
|
|
87
|
-
snakeCase: (string: any) => any;
|
|
88
|
-
kebabCase: (string: any) => any;
|
|
89
|
-
camelCase: (string: any) => any;
|
|
90
|
-
upperCase: (string: any) => any;
|
|
91
|
-
upperFirst: (string: any) => any;
|
|
92
|
-
lowerCase: (string: any) => any;
|
|
93
|
-
lowerFirst: (string: any) => any;
|
|
94
|
-
splitOnFirst: (string: any, separator: any) => string[];
|
|
95
|
-
parseValue: (value?: any, { number, boolean }?: {
|
|
96
|
-
number?: boolean | undefined;
|
|
97
|
-
boolean?: boolean | undefined;
|
|
98
|
-
}) => any;
|
|
99
|
-
replace: (source: string, rules: import("..").Ddan.IRegexRule | import("..").Ddan.IRegexRule[]) => string;
|
|
100
|
-
jsonFormat: (jsonString: string) => string;
|
|
101
|
-
toLines: (content: string, separator?: string | RegExp) => string[];
|
|
102
|
-
sleep: (ms?: number) => Promise<unknown>;
|
|
103
|
-
run: <T_2 = any>(task?: import("..").Ddan.PFunction<T_2> | undefined, wait?: number) => Promise<[any, undefined] | [null, T_2]>;
|
|
104
|
-
exec: (func: import("..").Ddan.Function, taskId?: string) => import("..").Ddan.PSafeResult<any>;
|
|
105
|
-
debounce: typeof import("../modules/hook/modules/debounce").default;
|
|
106
|
-
throttle: typeof import("../modules/hook/modules/throttle").default;
|
|
107
|
-
task: (param?: import("..").Ddan.Func1<any, any> | undefined) => import("../class/pipeTask").default;
|
|
108
|
-
mutex: typeof import("../modules/hook/modules/mutex").default;
|
|
109
|
-
polling: typeof import("../modules/hook/modules/polling").default;
|
|
110
|
-
pipe: (func: import("..").Ddan.Function, callback?: ((result: import("..").Ddan.SafeResult<any>) => void) | undefined) => import("../modules/hook/modules/pipeline").default;
|
|
111
|
-
pipeline: (max?: number) => import("../modules/hook/modules/pipeline").default;
|
|
112
|
-
safeTask: (func: import("..").Ddan.Function, callback?: ((result: import("..").Ddan.SafeResult<any>) => void) | undefined) => import("../modules/hook/modules/safeTask").default;
|
|
113
|
-
bezier1: (p0: import("..").Ddan.IPoint, p1: import("..").Ddan.IPoint, t: number) => import("..").Ddan.IPoint;
|
|
114
|
-
bezier2: (p0: import("..").Ddan.IPoint, p1: import("..").Ddan.IPoint, p2: import("..").Ddan.IPoint, t: number) => import("..").Ddan.IPoint;
|
|
115
|
-
bezier3: (p0: import("..").Ddan.IPoint, p1: import("..").Ddan.IPoint, p2: import("..").Ddan.IPoint, p3: import("..").Ddan.IPoint, t: number) => import("..").Ddan.IPoint;
|
|
116
|
-
bezier: (points: import("..").Ddan.IPoint[], t: number) => import("..").Ddan.IPoint;
|
|
117
|
-
bezierCurve: (points: import("..").Ddan.IPoint[], t: number) => import("..").Ddan.IPoint;
|
|
118
|
-
lerpAverage: (points: import("..").Ddan.IPoint[], step: number, type?: "" | "lerp") => number;
|
|
119
|
-
proportion: (start: number, end: number, current: number) => number;
|
|
120
|
-
logString: (data: any) => string;
|
|
121
|
-
logParse: (logStr: string) => string;
|
|
122
|
-
logRString: (data: any) => Promise<string>;
|
|
123
|
-
logRParse: (logStr: string) => Promise<string>;
|
|
124
|
-
to: <T_3 = any, U extends object = any>(promise: Promise<T_3>, errorExt?: object | undefined, fn?: import("..").Ddan.noop | undefined) => Promise<[null, T_3] | [U, undefined]>;
|
|
125
|
-
go: <T_4 = any>(task?: import("..").Ddan.PFunction<T_4> | undefined, fn?: import("..").Ddan.noop | undefined) => Promise<[any, undefined] | [null, T_4]>;
|
|
126
|
-
delay: (ms?: number) => Promise<unknown>;
|
|
127
|
-
safeRun: <T_5 = any>(func: any, fn?: import("..").Ddan.noop | undefined) => Promise<[any, undefined] | [null, T_5]>;
|
|
128
|
-
toError: (value: any) => any;
|
|
129
|
-
timeout: <T_6 = any>(task?: import("..").Ddan.PFunction<T_6> | undefined, ms?: number, desc?: string) => Promise<[any, undefined] | [null, T_6]>;
|
|
130
|
-
base64: {
|
|
131
|
-
encode: (input: string) => string;
|
|
132
|
-
decode: (base64Str: string) => string;
|
|
133
|
-
encodeByOss: (input: string) => string;
|
|
134
|
-
};
|
|
135
|
-
tea: {
|
|
136
|
-
TEAKey: string;
|
|
137
|
-
encrypt: (v: Uint32Array, teaKey: Uint32Array) => Uint32Array;
|
|
138
|
-
decrypt: (v: Uint32Array, teaKey: Uint32Array) => Uint32Array;
|
|
139
|
-
toTeaKey: (str: string) => Uint32Array;
|
|
140
|
-
encode: (plaintext: string, key: string) => string;
|
|
141
|
-
decode: (ciphertext: string, key: string) => string;
|
|
142
|
-
encodeBytes: (plainbytes: Uint8Array, key: string) => Uint8Array;
|
|
143
|
-
decodeBytes: (cipherbytes: Uint8Array, key: string) => Uint8Array;
|
|
144
|
-
};
|
|
145
|
-
uuid: (len?: number, radix?: number) => string;
|
|
146
|
-
guid: (len: number, prefix?: boolean, sep?: string) => string;
|
|
147
|
-
getHexString: (len: number) => string;
|
|
148
|
-
keyNumber: string;
|
|
149
|
-
keyLower: string;
|
|
150
|
-
keyUpper: string;
|
|
151
|
-
keyChars: string;
|
|
152
|
-
str2ab: (content?: string, base64?: boolean) => ArrayBuffer;
|
|
153
|
-
ab2str: (data: ArrayBuffer, base64?: boolean) => string;
|
|
154
|
-
utf8ToBase64: (str: string) => string;
|
|
155
|
-
base64ToUtf8: (base64Str: string) => string;
|
|
156
|
-
getRandomBytes: (length: number) => Uint8Array;
|
|
157
|
-
textEncode: (text: string) => Uint8Array;
|
|
158
|
-
textDecode: (buf: ArrayBufferLike) => string;
|
|
159
|
-
toDataUrl: (textOrBuf: string | ArrayBuffer, contentType?: string) => string;
|
|
160
|
-
md5: (input: string | Uint8Array) => string;
|
|
161
|
-
md5Base64: (input: string | Uint8Array) => string;
|
|
162
|
-
toBase64: (input?: string) => string;
|
|
163
|
-
fromBase64: (input?: string) => string;
|
|
164
|
-
bytesToBase64: (bytes: Uint8Array) => string;
|
|
165
|
-
base64ToBytes: (input?: string) => Uint8Array;
|
|
166
|
-
toUtf8: (content: string) => string;
|
|
167
|
-
fromUtf8: (utftext: string) => string;
|
|
168
|
-
toUtf8Bytes: (content: string) => Uint8Array;
|
|
169
|
-
fromUtf8Bytes: (utf8Bytes: Uint8Array) => string;
|
|
170
|
-
pkcs7Padding: (plaintext: Uint8Array, blockSize: number) => Uint8Array;
|
|
171
|
-
pkcs7Unpadding: (ciphertext: Uint8Array) => Uint8Array;
|
|
172
|
-
bytes2str: (bytes: Uint8Array) => string;
|
|
173
|
-
str2bytes: (str?: string) => Uint8Array;
|
|
174
|
-
str2hex: (str: string) => string;
|
|
175
|
-
hex2str: (hexstr: string) => string;
|
|
176
|
-
concatBytes: (...args: Uint8Array[]) => Uint8Array;
|
|
177
|
-
uint32ToBytes: (uint32: Uint32Array) => Uint8Array;
|
|
178
|
-
bytesToUint32: (bytes: Uint8Array) => Uint32Array;
|
|
179
|
-
hex2bytes: (hex: string) => Uint8Array;
|
|
180
|
-
bytes2hex: (bytes: Uint8Array) => string;
|
|
181
|
-
toUint32: (str: string) => Uint32Array;
|
|
182
|
-
fromUint32: (uint32: Uint32Array) => string;
|
|
183
|
-
flatten: <T_7>(data: T_7[], recursive?: boolean, list?: T_7[]) => T_7[];
|
|
184
|
-
};
|
|
185
|
-
export { dHook };
|
package/bin/tiny/hook.esm.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"crypto";var e={toUtf8:t=>{if(!t)return"";const e=t.replace(/\r\n/g,"\n");let r="";for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);n<128?r+=String.fromCharCode(n):n>127&&n<2048?(r+=String.fromCharCode(n>>6|192),r+=String.fromCharCode(63&n|128)):(r+=String.fromCharCode(n>>12|224),r+=String.fromCharCode(n>>6&63|128),r+=String.fromCharCode(63&n|128))}return r},fromUtf8:t=>{let e="",r=0;if(!t)return"";let n=0,o=0,s=0;for(;r<t.length;)n=t.charCodeAt(r),n<128?(e+=String.fromCharCode(n),r++):n>191&&n<224?(o=t.charCodeAt(r+1),e+=String.fromCharCode((31&n)<<6|63&o),r+=2):(o=t.charCodeAt(r+1),s=t.charCodeAt(r+2),e+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&s),r+=3);return e},toUtf8Bytes:t=>{if(!t)return new Uint8Array;const e=t.replace(/\r\n/g,"\n"),r=[];for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);n<128?r.push(n):n<2048?(r.push(n>>6|192),r.push(63&n|128)):(r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128))}return new Uint8Array(r)},fromUtf8Bytes:t=>{let e="",r=0;if(!t||t.length<=0)return"";for(;r<t.length;){let n=t[r];if(n<128)e+=String.fromCharCode(n),r++;else if(n>191&&n<224){const o=t[r+1];e+=String.fromCharCode((31&n)<<6|63&o),r+=2}else{const o=t[r+1],s=t[r+2];e+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&s),r+=3}}return e}};const r="object"==typeof global&&null!==global&&global.Object===Object&&global,n="object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis,o="object"==typeof self&&null!==self&&self.Object===Object&&self,s=n||r||o||Function("return this")(),i=s.Symbol,{toString:a,hasOwnProperty:u,propertyIsEnumerable:c}=Object.prototype,f=i?i.toStringTag:void 0;function l(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":f&&f in Object(t)?function(t){const e=u.call(t,f),r=t[f];let n=!1;try{t[f]=void 0,n=!0}catch(t){}const o=a.call(t);return n&&(e?t[f]=r:delete t[f]),o}(t):a.call(t)}var h={getTag:l,getType:function(t){return(l(t).match(/\w+/g)||["object","Undefined"])[1]||""},toString:a,hasOwnProperty:u,propertyIsEnumerable:c};const d="object"==typeof exports&&null!==exports&&!exports.nodeType&&exports,p=d&&"object"==typeof module&&null!==module&&!module.nodeType&&module,y=p&&p.exports===d&&r.process,g=(()=>{try{const t=p&&p.require&&p.require("util").types;return t||y&&y.binding&&y.binding("util")}catch(t){}})();var m="[object Function]",b="[object GeneratorFunction]",w="[object AsyncFunction]",A=9007199254740991;const _=/^(?:0|[1-9]\d*)$/,x=s?.Buffer?.isBuffer,S=/^\[object (?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)Array\]$/,v=g&&g.isTypedArray;function C(t){const e=typeof t;return null!=t&&("object"==e||"function"==e)}function j(t){return null!=t&&"object"==typeof t}const O=Array.isArray;function T(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=A}(t.length)&&!P(t)}function B(t){return j(t)&&T(t)}function P(t){var e=C(t)?h.getTag(t):"";return e===m||e===b||e===w}function E(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Object.prototype)}function M(t){return B(t)&&h.hasOwnProperty.call(t,"callee")&&(!h.propertyIsEnumerable.call(t,"callee")||"[object Arguments]"==h.toString.call(t))}const k="undefined"!=typeof window&&void 0!==window.document,U="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,$=v?t=>v(t):t=>j(t)&&S.test(h.getTag(t)),I="function"==typeof x?x:()=>!1;var D={is:function(t,e){return h.getTag(t)===`[object ${e}]`},isNumber:function(t){return"[object Number]"===h.getTag(t)},isString:function(t){return"string"==typeof t||!O(t)&&j(t)&&"[object String]"==h.getTag(t)},isObject:C,isObjectLike:j,isPlainObject:function(t){if(!j(t)||"[object Object]"!=h.getTag(t))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},isSymbol:function(t){return"symbol"==typeof t||j(t)&&"[object Symbol]"===h.getTag(t)},isFunction:P,isArray:O,isArrayLikeObject:B,isIndex:function(t,e){return!!(e=null==e?A:e)&&("number"==typeof t||_.test(t))&&t>-1&&t%1==0&&t<e},isArrayLike:T,isPrototype:E,isArguments:M,isPromise:function(t){return"[object Promise]"===(C(t)?h.getTag(t):"")},isBrowser:k,isNode:U,isBlobOrBuffer:t=>t instanceof Blob||t instanceof ArrayBuffer,isUint8Array:t=>t instanceof Uint8Array,isArrayBuffer:t=>t instanceof ArrayBuffer,isEmpty:t=>{if(null==t)return!0;if(T(t)&&(Array.isArray(t)||"string"==typeof t||"function"==typeof t.splice||I(t)||$(t)||M(t)))return!t.length;const e=h.getTag(t);if("[object Map]"===e||"[object Set]"===e)return!t.size;if(E(t))return!Object.keys(t).length;for(const e in t)if(h.hasOwnProperty.call(t,e))return!1;return!0}};const K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var N={toBase64:(t="")=>{let r,n,o,s,i,a,u,c="",f=0;for(t=e.toUtf8(t);f<t.length;)r=t.charCodeAt(f++),n=t.charCodeAt(f++),o=t.charCodeAt(f++),s=r>>2,i=(3&r)<<4|n>>4,a=(15&n)<<2|o>>6,u=63&o,isNaN(n)?a=u=64:isNaN(o)&&(u=64),c=c+K.charAt(s)+K.charAt(i)+K.charAt(a)+K.charAt(u);return c},fromBase64:(t="")=>{let r,n,o,s,i,a,u,c="",f=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");f<t.length;)s=K.indexOf(t.charAt(f++)),i=K.indexOf(t.charAt(f++)),a=K.indexOf(t.charAt(f++)),u=K.indexOf(t.charAt(f++)),r=s<<2|i>>4,n=(15&i)<<4|a>>2,o=(3&a)<<6|u,c+=String.fromCharCode(r),64!=a&&(c+=String.fromCharCode(n)),64!=u&&(c+=String.fromCharCode(o));return c=e.fromUtf8(c),c},bytesToBase64:t=>{let e,r,n,o,s,i,a,u="",c=0;if(!t||!D.isArrayLike(t)||!D.isUint8Array(t))return"";for(;c<t.length;)e=t[c++],r=t[c++],n=t[c++],o=e>>2,s=(3&e)<<4|r>>4,i=(15&r)<<2|n>>6,a=63&n,isNaN(r)?i=a=64:isNaN(n)&&(a=64),u=u+K.charAt(o)+K.charAt(s)+K.charAt(i)+K.charAt(a);return u},base64ToBytes:(t="")=>{let e,r,n,o,s,i,a,u=[],c=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");c<t.length;)o=K.indexOf(t.charAt(c++)),s=K.indexOf(t.charAt(c++)),i=K.indexOf(t.charAt(c++)),a=K.indexOf(t.charAt(c++)),e=o<<2|s>>4,r=(15&s)<<4|i>>2,n=(3&i)<<6|a,u.push(e),64!=i&&u.push(r),64!=a&&u.push(n);return new Uint8Array(u)}};function F(t){return Math.floor(Math.random()*t)}function L(t,e=10){return+parseFloat(Number(t).toExponential(e))}const R=180/Math.PI;var Z={random:F,randomRange:function(t,e){return Math.floor(Math.random()*(e-t+1)+t)},lerp:function(t,e,r){return t*(1-r)+e*r},randoms:function(t,e=1,r=!1){const n=[];for(;;){if(n.length>=e)break;if(!r&&n.length>=t)break;const o=F(t);r?n.push(o):n.includes(o)||n.push(o)}return n},strip:L,float:function(t,{digits:e=2,fixed:r=!1}={}){const n=L(t).toFixed(e);return r||!e?+n:+n.replace(/(\.[1-9]?)0+$/,"$1").replace(/\.$/,"")},radian2degree:function(t){return t*R},degree2radian:function(t){return t/R},calcDataSize:function(t){const e={gb:0,mb:0,kb:0,b:0,total:t,desc:""},r=[{name:"gb",divisor:1<<30},{name:"mb",divisor:1<<20},{name:"kb",divisor:1024},{name:"b",divisor:1}];for(const n of r){const r=Math.floor(t/n.divisor);e[n.name]=r,t-=r*n.divisor}return e.gb>0?e.desc=(e.gb+e.mb/1024).toFixed(2)+"GB":e.mb>0?e.desc=(e.mb+e.kb/1024).toFixed(2)+"MB":e.kb>0?e.desc=(e.kb+e.b/1024).toFixed(2)+"KB":e.desc=e.b+"B",e}};var W={bytes2str:t=>{if(!t||!D.isArrayLike(t))return"";return t.reduce(((t,e)=>t+String.fromCharCode(e)),"")},str2bytes:(t="")=>{const e=t,r=new Uint8Array(e.length);for(let t=0,n=e.length;t<n;t++)r[t]=e.charCodeAt(t);return r},str2hex:t=>{let e="";for(let r=0;r<t.length;r++)e+=t.charCodeAt(r).toString(16).padStart(2,"0");return e},hex2str:t=>{let e="";for(let r=0;r<t.length;r+=2)e+=String.fromCharCode(parseInt(t.substr(r,2),16));return e},concatBytes:(...t)=>{const e=t.reduce(((t,e)=>t+e.length),0),r=new Uint8Array(e);let n=0;for(const e of t)r.set(e,n),n+=e.length;return r},uint32ToBytes:t=>{const e=new Uint8Array(8);return e[0]=t[0]>>>24&255,e[1]=t[0]>>>16&255,e[2]=t[0]>>>8&255,e[3]=255&t[0],e[4]=t[1]>>>24&255,e[5]=t[1]>>>16&255,e[6]=t[1]>>>8&255,e[7]=255&t[1],e},bytesToUint32:t=>{const e=new Uint32Array(2);return e[0]=t[0]<<24|t[1]<<16|t[2]<<8|t[3],e[1]=t[4]<<24|t[5]<<16|t[6]<<8|t[7],e},hex2bytes:t=>{let e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++)e[r]=parseInt(t.substr(2*r,2),16);return e},bytes2hex:t=>Array.from(t).map((t=>t.toString(16).padStart(2,"0"))).join(""),toUint32:t=>{const e=Math.ceil(t.length/4),r=new Uint32Array(e);for(let n=0;n<e;n++)r[n]=t.charCodeAt(4*n)<<24|t.charCodeAt(4*n+1)<<16|t.charCodeAt(4*n+2)<<8|t.charCodeAt(4*n+3);return r},fromUint32:t=>{let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]>>>24&255,t[r]>>>16&255,t[r]>>>8&255,255&t[r]);return e.replace(/\0+$/,"")},flatten:function t(e,r=!1,n=[]){for(let o=0;o<e.length;o+=1){const s=e[o];r&&Array.isArray(s)?t(s,r,n):n.push(s)}return n}};var q={pkcs7Padding:(t,e)=>{const r=e-t.length%e,n=new Uint8Array(r).fill(r);return W.concatBytes(t,n)},pkcs7Unpadding:t=>{const e=t[t.length-1];return t.slice(0,-e)}};function z(t,e){return t<<e|t>>>32-e}function Q(t,e){let r,n,o,s,i;return o=2147483648&t,s=2147483648&e,r=1073741824&t,n=1073741824&e,i=(1073741823&t)+(1073741823&e),r&n?2147483648^i^o^s:r|n?1073741824&i?3221225472^i^o^s:1073741824^i^o^s:i^o^s}function H(t,e,r,n,o,s,i){return t=Q(t,Q(Q(function(t,e,r){return t&e|~t&r}(e,r,n),o),i)),Q(z(t,s),e)}function Y(t,e,r,n,o,s,i){return t=Q(t,Q(Q(function(t,e,r){return t&r|e&~r}(e,r,n),o),i)),Q(z(t,s),e)}function V(t,e,r,n,o,s,i){return t=Q(t,Q(Q(function(t,e,r){return t^e^r}(e,r,n),o),i)),Q(z(t,s),e)}function G(t,e,r,n,o,s,i){return t=Q(t,Q(Q(function(t,e,r){return e^(t|~r)}(e,r,n),o),i)),Q(z(t,s),e)}function J(t){let e,r,n="",o="";for(r=0;r<=3;r++)e=t>>>8*r&255,o="0"+e.toString(16),n+=o.substr(o.length-2,2);return n}function X(t){let e,r,n,o,s,i,a,u,c,f=[];for(f=function(t){let e;const r=t.length,n=r+8,o=16*((n-n%64)/64+1),s=Array(o-1).fill(0);let i=0,a=0;for(;a<r;)e=(a-a%4)/4,i=a%4*8,s[e]=s[e]|t[a]<<i,a++;return e=(a-a%4)/4,i=a%4*8,s[e]=s[e]|128<<i,s[o-2]=r<<3,s[o-1]=r>>>29,s}(t),i=1732584193,a=4023233417,u=2562383102,c=271733878,e=0;e<f.length;e+=16)r=i,n=a,o=u,s=c,i=H(i,a,u,c,f[e+0],7,3614090360),c=H(c,i,a,u,f[e+1],12,3905402710),u=H(u,c,i,a,f[e+2],17,606105819),a=H(a,u,c,i,f[e+3],22,3250441966),i=H(i,a,u,c,f[e+4],7,4118548399),c=H(c,i,a,u,f[e+5],12,1200080426),u=H(u,c,i,a,f[e+6],17,2821735955),a=H(a,u,c,i,f[e+7],22,4249261313),i=H(i,a,u,c,f[e+8],7,1770035416),c=H(c,i,a,u,f[e+9],12,2336552879),u=H(u,c,i,a,f[e+10],17,4294925233),a=H(a,u,c,i,f[e+11],22,2304563134),i=H(i,a,u,c,f[e+12],7,1804603682),c=H(c,i,a,u,f[e+13],12,4254626195),u=H(u,c,i,a,f[e+14],17,2792965006),a=H(a,u,c,i,f[e+15],22,1236535329),i=Y(i,a,u,c,f[e+1],5,4129170786),c=Y(c,i,a,u,f[e+6],9,3225465664),u=Y(u,c,i,a,f[e+11],14,643717713),a=Y(a,u,c,i,f[e+0],20,3921069994),i=Y(i,a,u,c,f[e+5],5,3593408605),c=Y(c,i,a,u,f[e+10],9,38016083),u=Y(u,c,i,a,f[e+15],14,3634488961),a=Y(a,u,c,i,f[e+4],20,3889429448),i=Y(i,a,u,c,f[e+9],5,568446438),c=Y(c,i,a,u,f[e+14],9,3275163606),u=Y(u,c,i,a,f[e+3],14,4107603335),a=Y(a,u,c,i,f[e+8],20,1163531501),i=Y(i,a,u,c,f[e+13],5,2850285829),c=Y(c,i,a,u,f[e+2],9,4243563512),u=Y(u,c,i,a,f[e+7],14,1735328473),a=Y(a,u,c,i,f[e+12],20,2368359562),i=V(i,a,u,c,f[e+5],4,4294588738),c=V(c,i,a,u,f[e+8],11,2272392833),u=V(u,c,i,a,f[e+11],16,1839030562),a=V(a,u,c,i,f[e+14],23,4259657740),i=V(i,a,u,c,f[e+1],4,2763975236),c=V(c,i,a,u,f[e+4],11,1272893353),u=V(u,c,i,a,f[e+7],16,4139469664),a=V(a,u,c,i,f[e+10],23,3200236656),i=V(i,a,u,c,f[e+13],4,681279174),c=V(c,i,a,u,f[e+0],11,3936430074),u=V(u,c,i,a,f[e+3],16,3572445317),a=V(a,u,c,i,f[e+6],23,76029189),i=V(i,a,u,c,f[e+9],4,3654602809),c=V(c,i,a,u,f[e+12],11,3873151461),u=V(u,c,i,a,f[e+15],16,530742520),a=V(a,u,c,i,f[e+2],23,3299628645),i=G(i,a,u,c,f[e+0],6,4096336452),c=G(c,i,a,u,f[e+7],10,1126891415),u=G(u,c,i,a,f[e+14],15,2878612391),a=G(a,u,c,i,f[e+5],21,4237533241),i=G(i,a,u,c,f[e+12],6,1700485571),c=G(c,i,a,u,f[e+3],10,2399980690),u=G(u,c,i,a,f[e+10],15,4293915773),a=G(a,u,c,i,f[e+1],21,2240044497),i=G(i,a,u,c,f[e+8],6,1873313359),c=G(c,i,a,u,f[e+15],10,4264355552),u=G(u,c,i,a,f[e+6],15,2734768916),a=G(a,u,c,i,f[e+13],21,1309151649),i=G(i,a,u,c,f[e+4],6,4149444226),c=G(c,i,a,u,f[e+11],10,3174756917),u=G(u,c,i,a,f[e+2],15,718787259),a=G(a,u,c,i,f[e+9],21,3951481745),i=Q(i,r),a=Q(a,n),u=Q(u,o),c=Q(c,s);return J(i)+J(a)+J(u)+J(c)}const tt=t=>{if("string"!=typeof t&&!(t instanceof Uint8Array))return"";return X("string"==typeof t?e.toUtf8Bytes(t):t)};var et={md5:tt,md5Base64:t=>{const e=tt(t);if(!e)return"";const r=W.hex2bytes(e);return N.bytesToBase64(r)}};const rt=(t,e=!1)=>{const r=new Uint8Array(t);return e?N.bytesToBase64(r):r.reduce(((t,e)=>t+String.fromCharCode(e)),"")};var nt={...W,...q,...e,...N,...et,str2ab:(t="",e=!1)=>{if(e)return N.base64ToBytes(t).buffer;{const e=new ArrayBuffer(t.length),r=new Uint8Array(e);for(let e=0,n=t.length;e<n;e++)r[e]=t.charCodeAt(e);return e}},ab2str:rt,utf8ToBase64:t=>D.isBrowser?btoa(t):Buffer.from(t,"utf-8").toString("base64"),base64ToUtf8:t=>D.isBrowser?atob(t):Buffer.from(t,"base64").toString("utf-8"),getRandomBytes:t=>{const e=new Uint8Array(t);for(let r=0;r<t;r++)e[r]=Z.random(256);return e},textEncode:t=>e.toUtf8Bytes(t),textDecode:t=>e.fromUtf8Bytes(new Uint8Array(t)),toDataUrl:(t,e="text/plain")=>t?"string"==typeof t?`data:${e};base64,`+N.toBase64(t):D.isArrayBuffer(t)?`data:${e};base64,`+rt(t,!0):"":""};const ot=NaN,st=/^\s+|\s+$/g,it=/^[-+]0x[0-9a-f]+$/i,at=/^0b[01]+$/i,ut=/^0o[0-7]+$/i,ct=parseInt,ft=1/0,lt=17976931348623157e292;function ht(t){if("number"==typeof t)return t;if(D.isSymbol(t))return ot;if(D.isObject(t)){const e="function"==typeof t.valueOf?t.valueOf():t;t=D.isObject(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(st,"");const e=at.test(t);return e||ut.test(t)?ct(t.slice(2),e?2:8):it.test(t)?ot:+t}function dt(t){return t?(t=ht(t))===ft||t===-ft?(t<0?-1:1)*lt:t==t?t:0:0===t?t:0}var pt={toNumber:ht,toFinite:dt,toInteger:function(t){var e=dt(t),r=e%1;return e==e?r?e-r:e:0}};const yt="Expected a function",gt=Math.max,mt=Math.min;function bt(t,e=300,r={}){let n,o,s,i,a,u,c=0,f=!1,l=!1,h=!0;if("function"!=typeof t)throw new TypeError(yt);function d(e){const r=n,s=o;return n=o=void 0,c=e,i=t.apply(s,r),i}function p(t){const r=t-u;return void 0===u||r>=e||r<0||l&&t-c>=s}function y(){const t=Date.now();if(p(t))return g(t);a=setTimeout(y,function(t){const r=e-(t-u);return l?mt(r,s-(t-c)):r}(t))}function g(t){return a=void 0,h&&n?d(t):(n=o=void 0,i)}function m(...t){const r=Date.now(),s=p(r);if(n=t,o=this,u=r,s){if(void 0===a)return function(t){return c=t,a=setTimeout(y,e),f?d(t):i}(u);if(l)return a=setTimeout(y,e),d(u)}return void 0===a&&(a=setTimeout(y,e)),i}return e=pt.toNumber(e)||0,D.isObject(r)&&(f=!!r.leading,l="maxWait"in r,s=l?gt(pt.toNumber(r.maxWait)||0,e):s,h="trailing"in r?!!r.trailing:h),m.cancel=function(){void 0!==a&&clearTimeout(a),c=0,n=u=o=a=void 0},m.flush=function(){return void 0===a?i:g(Date.now())},m.pending=function(){return void 0!==a},m}class wt{__list=[];constructor(t){this.push(t)}push(t){return t&&this.__list.push(t),this}clear(){return this.__list=[],this}_exec(t,e){let r;if(D.isFunction(t))r=t(e);else{if(D.isPromise(t))return t.then((t=>({...e,...t})));r=t}return D.isPromise(r)?r:Promise.resolve({...r,...e})}run(t){try{return this.__list.reduce(((t,e)=>t.then((t=>this._exec(e,t)))),Promise.resolve(t)).then((t=>[void 0,t])).catch((t=>[t,void 0]))}catch(t){return Promise.reject([t,void 0])}}}async function At(t,e,r){return t.then((t=>(r&&r(),[null,t]))).catch((t=>(e&&Object.assign(t,e),r&&r(),[t,void 0])))}const _t=(t,e)=>{try{let r;return r=D.isFunction(t)?t():t,At(Promise.resolve(r),void 0,e)}catch(t){return e&&e(),Promise.resolve([t,void 0])}},xt=t=>"string"==typeof(t="function"==typeof t?t():t)?new Error(t):t;var St={to:At,go:(t,e)=>_t(t,e),delay:(t=1e3)=>new Promise((e=>setTimeout(e,t))),safeRun:_t,toError:xt,timeout:(t,e=0,r="timeout")=>{if(e<=0)return _t(t);let n;function o(){n&&clearTimeout(n)}const s=new Promise((t=>{o(),n=setTimeout((()=>t([xt(r||"timeout"),void 0])),e)}));return Promise.race([_t(t,o),s])}};class vt{__value=void 0;set(t){this.__value=t}get(){return this.__value}}var Ct={singleton:function(){class t{static __instance__;constructor(){}static get Instance(){return t.__instance__||(t.__instance__=new this),t.__instance__}static get I(){return this.Instance}}return t},getset:function(t){const e=new vt;return void 0!==t&&e.set(t),e}};class jt{_func;_callback;constructor(t,e){this._func=t,this._callback=e}async run(){return St.safeRun(this._func).then((t=>{try{this._callback&&this._callback(t)}catch(t){console.log("[ddan] task",t)}finally{return t}}))}}class Ot{__list=[];__count=0;__max=1;constructor(t=1){this.__count=0,this.__max=t>0?t:1,this.clear()}push(t,e){const r=new jt(t,e);return this.__list.push(r),this._step(),this}clear(){return this.__list=[],this.__count=0,this}_step(){if(this.__list.length<=0)return;if(this.__count>=this.__max)return;const t=this.__list.shift();t?(this.__count+=1,t?.run().finally((()=>{try{this.__count>0&&(this.__count-=1),this._step()}catch(t){console.error("[ddan] pipepine step finally",t)}}))):this._step()}async whenAll(){for(;;){if(this.__count<=0)break;await St.delay(100),this._step()}return this.clear()}}class Tt extends(Ct.singleton()){__lockedMap=new Map;pipeline=new Ot;constructor(){super()}lock(t,e){if(!t||!e)return;const r=St.safeRun(e);return this.__lockedMap.set(t,r),r}unlock(t){t&&this.__lockedMap.has(t)&&this.__lockedMap.delete(t)}async exec(t,e){if(!t||!e)return St.safeRun(t);const r=this.__lockedMap.get(e);if(r)return r;const n=this.lock(e,t);if(!n)return St.safeRun(t);const o=await n;return this.unlock(e),o}}const Bt=t=>{try{const e=nt.ab2str(t,!0);return e.match(/.{1,64}/g)?.join("\n")||""}catch(t){return""}},Pt=(t="",e="PUBLIC KEY")=>`-----BEGIN ${e}-----\n${t}\n-----END ${e}-----`;var Et={RSAPublicKey:"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApiLWsPmoaiGdr02AmPYS\n4/VgxyJNNJSK2VICirXl4P8qAP3b/6GIs7Hwnsmmuj7gledJ0XiZodFjDNgQEZEG\nj4K9KX8NixcrJwnTQV5UebiERdj+64ihwqPVWo9dIOj43ZPJ8f4dritJv5tnQaBb\nb9zTkU3Ofzk1g8RU00Ith6quOGZcU2IWC4OQ+5YiZvzrCBKEvjFwK2OvGq43tI51\nGaZdI9H09jisypqefsMvv6esjEQQOtl+WGlI5fof7KZUt3dppvuDI4CYgeXIoKKL\n9T9qDl8F9aNSs3XHx32YyA7L1FraFD6PjqRjueIFp2emsXQcIMeMqqgVyV+4qb+0\nuwIDAQAB",RSAPrivateKey:"MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCmItaw+ahqIZ2v\nTYCY9hLj9WDHIk00lIrZUgKKteXg/yoA/dv/oYizsfCeyaa6PuCV50nReJmh0WMM\n2BARkQaPgr0pfw2LFysnCdNBXlR5uIRF2P7riKHCo9Vaj10g6Pjdk8nx/h2uK0m/\nm2dBoFtv3NORTc5/OTWDxFTTQi2Hqq44ZlxTYhYLg5D7liJm/OsIEoS+MXArY68a\nrje0jnUZpl0j0fT2OKzKmp5+wy+/p6yMRBA62X5YaUjl+h/splS3d2mm+4MjgJiB\n5cigoov1P2oOXwX1o1KzdcfHfZjIDsvUWtoUPo+OpGO54gWnZ6axdBwgx4yqqBXJ\nX7ipv7S7AgMBAAECggEAE1kuWLkSsJ2OoDpt9iJ+a7cJmNd5V1zPWOTwr9fkWFJP\nQYNPKlPVOFxKUivY84rcHAkuMyuQ9OQOXZISOQGDWpZW0mzeFmtR1r+Rr2S9gNmI\n6huOAL9OW306HUxiA7GuPhv2omy+Zyjac2q1WVLEI2B78Um2+WEfxuNIH7xu0gRR\nz/wluevMBQlv6hSeMESP6e9s2kB+FuM4bL7+1sexwS1TudKbHybujaiB8un9E2V3\nC9BkE6yf00Rhvii6Q4E4w3PFQfcBEFnjOD0S2Watx8GIbYjlYvtquy8Yj7OtyZB6\nw5sxyaYhKVVnkpGAbOgaCj94ABYF47VuwXr45I4PzQKBgQDp6svzD+QKlARjcWgO\nrH7UEpFX6m49G6Ib4c63xEg9+GesTgfDxoYxtXDKsC7I8OwMrmffJGbyfjaAvzmg\nicM3Y7kF6UPO9+q2mBRsyhoJSNONTeUVyoFSc+QDsVgndlTZIjqC5XLrONGaSPLJ\n7jJzqKhp3NQcpO8+xY0d7Efm1QKBgQC10fCNuF1LUTYgsWvvGxTiCCAIBurZmHU+\nGMb2Okfoco/P+QNl1jEba91AC7FudW3g/lRn0vTnDajlNoz2/CKunrTKN4/9lEBI\ntiwEOvhc5FtapRifSfrrNwFqPM+LijvOkcteWVhAUWCEP1eLmpnXGqfmZxnTaaVe\n5DyDgyAVTwKBgQDhEawfOQEANJ9sV2f6BnsZ7quuXcCoR3hZP5G5O8EO735BSesq\nsk/YcG4QeCjr6vQU15LWH552YH5srpHyJ9uP5gHW8DTwZZaPDhFJA8S9fjcfVP3B\nU9HO1fdknjTl83N8YPTPkZpbPZZfzyTcqrYclwFEqtfkn8YbLdW0Hu6n6QKBgDEv\njvS3uD1ExfDILlurptWSvx+Mx4F/1c+roj8/+u3t9+uaAIpPDE/PuTW3NBOens/r\n3WeM0QWkU1lWjYHPKY61jlDaARDnRxCkf3nRfhibCf+Wg/erar6wzagwtTCZf55d\nIHfwkYgsu4BrJkK02wMuydbxczIW9U6bTaeCFG7PAoGAN3oHYzTEBwZ7ZKv11QiQ\nEp/HeHBvD8fH/e1uVyBel4Co7NO5pV2s8qjS8+3+jxumKLNXCirjqwHo03YCdzxi\ncy4GFDsukHmDQ7FF9VC4QV0fJ0F7jGYE9nNZ+K9qwS5KrihOSBPxj0HptrF6TSOw\nBTSwr0byL3TC0m0StkSNKpo=",generateKeys:async t=>{try{const e=await t.generateKey({name:"RSA-OAEP",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-256"},!0,["encrypt","decrypt"]),r=await window.crypto.subtle.exportKey("spki",e.publicKey),n=Bt(r),o=Pt(n,"PUBLIC KEY"),s=await window.crypto.subtle.exportKey("pkcs8",e.privateKey),i=Bt(s);return{publicKey:n,publicKeyPem:o,privateKey:i,privateKeyPem:Pt(i,"PRIVATE KEY")}}catch(t){return console.error("generateKeys failed:",t),{publicKey:"",publicKeyPem:"",privateKey:"",privateKeyPem:""}}},format_pem_key:Pt,format_pem_content:Bt,encrypt:async(t,e,r)=>{try{const n=(new TextEncoder).encode(e),o=await t.importKey("spki",nt.str2ab(r,!0),{name:"RSA-OAEP",hash:"SHA-256"},!0,["encrypt"]),s=[];for(let e=0;e<n.length;e+=190){let r=n.slice(e,e+190),i=await t.encrypt({name:"RSA-OAEP"},o,r);s.push(new Uint8Array(i))}const i=nt.concatBytes(...s);return nt.bytesToBase64(i)}catch(t){return console.error("[debug] encrypt",t),""}},decrypt:async(t,e,r)=>{try{const n=nt.base64ToBytes(e),o=await t.importKey("pkcs8",nt.str2ab(r,!0),{name:"RSA-OAEP",hash:"SHA-256"},!0,["decrypt"]),s=[],i=256;for(let e=0;e<n.length;e+=i){let r=n.slice(e,e+i),a=await t.decrypt({name:"RSA-OAEP"},o,r);s.push(new Uint8Array(a))}const a=nt.concatBytes(...s);return(new TextDecoder).decode(a)}catch(t){return console.error("decrypt failed:",t),""}}};const Mt=()=>t.webcrypto.subtle;var kt=async t=>Et.encrypt(Mt(),t,Et.RSAPublicKey),Ut=async t=>Et.decrypt(Mt(),t,Et.RSAPrivateKey);const $t="undefined"!=typeof window?window.crypto.subtle:{};var It=async t=>Et.encrypt($t,t,Et.RSAPublicKey),Dt=async t=>Et.decrypt($t,t,Et.RSAPrivateKey);const Kt=2654435769,Nt=(t,e)=>{let r=0;for(let n=0;n<32;n++)r=r+Kt>>>0,t[0]=t[0]+((t[1]<<4)+e[0]^t[1]+r^(t[1]>>>5)+e[1])>>>0,t[1]=t[1]+((t[0]<<4)+e[2]^t[0]+r^(t[0]>>>5)+e[3])>>>0;return t},Ft=(t,e)=>{let r=3337565984;for(let n=0;n<32;n++)t[1]=t[1]-((t[0]<<4)+e[2]^t[0]+r^(t[0]>>>5)+e[3])>>>0,t[0]=t[0]-((t[1]<<4)+e[0]^t[1]+r^(t[1]>>>5)+e[1])>>>0,r=r-Kt>>>0;return t},Lt=t=>{const e=nt.str2bytes(t),r=new Uint32Array(4);return r[0]=e[0]<<24|e[1]<<16|e[2]<<8|e[3],r[1]=e[4]<<24|e[5]<<16|e[6]<<8|e[7],r[2]=e[8]<<24|e[9]<<16|e[10]<<8|e[11],r[3]=e[12]<<24|e[13]<<16|e[14]<<8|e[15],r},Rt=(t,e)=>{const r=nt.pkcs7Padding(t,8),n=Lt(e),o=[];for(let t=0;t<r.length;t+=8){const e=nt.bytesToUint32(r.slice(t,t+8)),s=Nt(e,n);o.push(nt.uint32ToBytes(s))}return nt.concatBytes(...o)},Zt=(t,e)=>{const r=Lt(e),n=[];for(let e=0;e<t.length;e+=8){const o=nt.bytesToUint32(t.slice(e,e+8)),s=Ft(o,r);n.push(nt.uint32ToBytes(s))}const o=nt.concatBytes(...n);return nt.pkcs7Unpadding(o)};var Wt={TEAKey:"33576f37387276645054657a6831686e454664424e5652456f47794835795942",encrypt:Nt,decrypt:Ft,toTeaKey:Lt,encode:(t,e)=>{const r=nt.textEncode(t),n=Rt(r,e);return nt.bytesToBase64(n)},decode:(t,e)=>{const r=nt.base64ToBytes(t),n=Zt(r,e);return nt.textDecode(n.buffer)},encodeBytes:Rt,decodeBytes:Zt};function qt(t,e,r){const{length:n}=t;return r=void 0===r?n:r,!e&&r>=n?t:function(t,e,r){let n=null==t?0:t.length;if(!n)return[];(e=null==e?0:e)<0&&(e=-e>n?0:n+e),(r=(r=void 0===r?n:r)>n?n:r)<0&&(r+=n),n=e>r?0:r-e>>>0,e>>>=0;let o=-1;const s=new Array(n);for(;++o<n;)s[o]=t[o+e];return s}(t,e,r)}const zt=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff\\ufe0e\\ufe0f]");function Qt(t){return zt.test(t)}const Ht="\\ud800-\\udfff",Yt=`[${Ht}]`,Vt="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]",Gt="\\ud83c[\\udffb-\\udfff]",Jt=`[^${Ht}]`,Xt="(?:\\ud83c[\\udde6-\\uddff]){2}",te="[\\ud800-\\udbff][\\udc00-\\udfff]",ee=`${`(?:${Vt}|${Gt})`}?`,re="[\\ufe0e\\ufe0f]?",ne=re+ee+`(?:\\u200d(?:${[Jt,Xt,te].join("|")})${re+ee})*`,oe=`(?:${[`${Jt}${Vt}?`,Vt,Xt,te,Yt].join("|")})`,se=RegExp(`${Gt}(?=${Gt})|${oe+ne}`,"g");function ie(t){return Qt(t)?function(t){return t.match(se)||[]}(t):function(t){return t.split("")}(t)}function ae(t){return e=>{if(!e)return"";const r=Qt(e)?ie(e):void 0,n=r?r[0]:e[0],o=r?qt(r,1).join(""):e.slice(1);return n[t]()+o}}const ue="\\ud800-\\udfff",ce="\\u2700-\\u27bf",fe="a-z\\xdf-\\xf6\\xf8-\\xff",le="A-Z\\xc0-\\xd6\\xd8-\\xde",he="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",de="['’]",pe=`[${he}]`,ye=`[${ce}]`,ge=`[${fe}]`,me=`[^${ue}${he+"\\d"+ce+fe+le}]`,be="(?:\\ud83c[\\udde6-\\uddff]){2}",we="[\\ud800-\\udbff][\\udc00-\\udfff]",Ae=`[${le}]`,_e=`(?:${ge}|${me})`,xe=`(?:${Ae}|${me})`,Se=`(?:${de}(?:d|ll|m|re|s|t|ve))?`,ve=`(?:${de}(?:D|LL|M|RE|S|T|VE))?`,Ce="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]|\\ud83c[\\udffb-\\udfff])?",je="[\\ufe0e\\ufe0f]?",Oe=je+Ce+`(?:\\u200d(?:${[`[^${ue}]`,be,we].join("|")})${je+Ce})*`,Te=`(?:${[ye,be,we].join("|")})${Oe}`,Be=RegExp([`${Ae}?${ge}+${Se}(?=${[pe,Ae,"$"].join("|")})`,`${xe}+${ve}(?=${[pe,Ae+_e,"$"].join("|")})`,`${Ae}?${_e}+${Se}`,`${Ae}+${ve}`,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",Te].join("|"),"g");const Pe=RegExp.prototype.test.bind(/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/),Ee=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Me(t,e){if(void 0===e){const e=Pe(t)?function(t){return t.match(Be)}(t):function(t){return t.match(Ee)}(t);return e||[]}return t.match(e)||[]}function ke(t){if(null==t)return"";if("string"==typeof t)return t;if(Array.isArray(t))return`${t.map((t=>null==t?t:ke(t)))}`;if(D.isSymbol(t))return t.toString();const e=`${t}`;return"0"==e&&1/t==-Infinity?"-0":e}const Ue=ae("toUpperCase"),$e=ae("toLowerCase");var Ie={toString:ke,startCase:t=>Me(`${t}`.replace(/['\u2019]/g,"")).reduce(((t,e,r)=>t+(r?" ":"")+Ue(e)),""),snakeCase:t=>Me(ke(t).replace(/['\u2019]/g,"")).reduce(((t,e,r)=>t+(r?"_":"")+e.toLowerCase()),""),kebabCase:t=>Me(ke(t).replace(/['\u2019]/g,"")).reduce(((t,e,r)=>t+(r?"-":"")+e.toLowerCase()),""),camelCase:t=>Me(ke(t).replace(/['\u2019]/g,"")).reduce(((t,e,r)=>(e=e.toLowerCase(),t+(r?Ue(e):e))),""),upperCase:t=>Me(ke(t).replace(/['\u2019]/g,"")).reduce(((t,e,r)=>t+(r?" ":"")+e.toUpperCase()),""),upperFirst:Ue,lowerCase:t=>Me(ke(t).replace(/['\u2019]/g,"")).reduce(((t,e,r)=>t+(r?" ":"")+e.toLowerCase()),""),lowerFirst:$e,splitOnFirst:(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===t||""===e)return[];const r=t.indexOf(e);return-1===r?[]:[t.slice(0,r),t.slice(r+e.length)]},parseValue:(t,{number:e=!1,boolean:r=!1}={})=>{let n=t;return t&&"string"==typeof t?(e&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?n=Number(t):!r||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(n="true"===t.toLowerCase()),n):n},replace:(t,e)=>{if(!t)return t;if(!e)return t;let r=t;return((Array.isArray(e)?e:[e])||[]).forEach((t=>{t.key&&t.value&&(r=r.replace(new RegExp(t.key,t.flag||""),t.value))})),r},jsonFormat:t=>{try{if(!t)return"";const e=JSON.parse(t);return JSON.stringify(e,null,2)}catch(e){return t}},toLines:(t,e="\n")=>t?t.split(e).map((t=>t.trim())).filter((t=>!!t)):[]};var De={logString:t=>{try{const e=JSON.stringify(t);return void 0===e?"":Wt.encode(e,nt.hex2str(Wt.TEAKey))}catch(t){return""}},logParse:t=>{try{if(!t)return"";const e=Wt.decode(t,nt.hex2str(Wt.TEAKey));return Ie.jsonFormat(e)}catch(t){return""}},logRString:async t=>{try{const e=JSON.stringify(t);if(void 0===e)return"";return D.isBrowser?await It(e):await kt(e)}catch(t){return""}},logRParse:async t=>{try{if(!t)return"";const e=D.isBrowser?await Dt(t):await Ut(t);return Ie.jsonFormat(e)}catch(t){return""}}};const Ke=(t,e,r)=>t*(1-r)+e*r,Ne=(t,e,r)=>t===e?0:(r-t)/(e-t),Fe=(t,e,r)=>({x:Ke(t.x,e.x,r),y:Ke(t.y,e.y,r)}),Le=(t,e,r,n)=>{const o=Fe(t,e,n),s=Fe(e,r,n);return Fe(o,s,n)},Re=(t,e)=>{if(1===t.length)return t[0];const r=[];for(let n=0;n<t.length-1;n++)r.push({x:(1-e)*t[n].x+e*t[n+1].x,y:(1-e)*t[n].y+e*t[n+1].y});return Re(r,e)},Ze=(t,e)=>{if(0===e||e===t)return 1;let r=1;for(let n=1;n<=e;n++)r=r*(t-n+1)/n;return r};var We={bezier1:Fe,bezier2:Le,bezier3:(t,e,r,n,o)=>{const s=Le(t,e,r,o),i=Le(e,r,n,o);return Fe(s,i,o)},bezier:Re,bezierCurve:(t,e)=>{const r=t.length-1;let n=0,o=0;for(let s=0;s<=r;s++){const i=Ze(r,s)*Math.pow(1-e,r-s)*Math.pow(e,s);n+=i*t[s].x,o+=i*t[s].y}return{x:n,y:o}},lerp:Ke,lerpAverage:(t,e,r="")=>{if(t.length<=0)return 0;if(1===t.length)return t[0].x;if(2===t.length)return Ke(t[0].y,t[1].y,.5);const n=[],o=t.slice().sort(((t,e)=>t.x-e.x)),s=o.length,i=o[0].x,a=o[s-1].x;for(let t=i;t<=a;t+=e){let e=0;for(let n=0;n<s-1;n++){const s=o[n],i=o[n+1];if(t>=s.x&&t<=i.x){if("lerp"===r){const r=Ne(s.x,i.x,t);e=Fe(s,i,r).y}else e=s.y;break}}t>o[s-1].x&&(e=o[s-1].y),n.push(e)}return n.reduce(((t,e)=>t+e),0)/n.length},proportion:Ne};var qe={...St,...De,...We,sleep:St.delay,run:async function(t,e=0){if(e<=0)return St.safeRun(t);const r=e>0?Date.now():0,n=await St.safeRun(t),o=Date.now()-r;return o<e&&await St.delay(e-o),n},exec:(t,e="")=>Tt.I.exec(t,e),debounce:bt,throttle:function(t,e=300,r={}){let n=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return D.isObject(r)&&(n=r.leading?!!r.leading:n,o=r.trailing?!!r.trailing:o),bt(t,e,{leading:n,maxWait:e,trailing:o})},task:t=>new wt(t),mutex:function(t){var e=null;return async function(...r){if((e=this||e||{}).__ddMutex)return!1;e.__ddMutex=!0;try{t&&await Promise.resolve(t.apply(this,r))}catch(t){console.log(t)}finally{e.__ddMutex=!1}}},polling:async function(t={}){const{func:e,interval:r=100,times:n=1e3}=t;let o=n;const s=r<1?100:r;do{if(!e)break;const[t,r]=await St.to(Promise.resolve(e()));if(t||!1===r)break;o>0&&o--,0!==o&&await St.delay(s)}while(-1===n||o>0)},pipe:(t,e)=>Tt.I.pipeline.push(t,e),pipeline:(t=1)=>new Ot(t),safeTask:(t,e)=>new jt(t,e)};var ze=(t,{number:e=!1,boolean:r=!1}={})=>{if(!t&&"object"!=typeof t)return t;for(const[n,o]of Object.entries(t))if("object"==typeof o&&null!==o)for(const[t,n]of Object.entries(o))o[t]=Ie.parseValue(n,{number:e,boolean:r});else t[n]=Ie.parseValue(o,{number:e,boolean:r});return t};const Qe=function(t,{sep:e="&",eq:r="=",max:n=1e3,multiple:o=!0,uri:s=!0,parseNumber:i=!1,parseBoolean:a=!1}={}){e=e||"&",r=r||"=";const u={};if("string"!=typeof t||0===t.length)return u;const c=/\+/g,f=n||1e3;let l=(t=t.split(e)).length;f>0&&l>f&&(l=f);for(let e=0;e<l;++e){let n,i,a,f,l=t[e].replace(c,"%20"),d=l.indexOf(r);d>=0?(n=l.substr(0,d),i=l.substr(d+1)):(n=l,i=""),a=s?decodeURIComponent(n):n,f=s?decodeURIComponent(i):i,h.hasOwnProperty.call(u,a)&&o?Array.isArray(u[a])?u[a].push(f):u[a]=[u[a],f]:u[a]=f}return ze(u,{number:i,boolean:a}),u},He=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Ye=function(t,e=!0){return e?encodeURIComponent(t):t},Ve=function(t,{cleanZero:e=!1,cleanNull:r=!1,cleanWhitespace:n=!1}={}){return!(!e||0!==t)||(!(!r||null!=t)||!(!n||"string"!=typeof t||""!==t.trim()))},Ge=/^(https?):\/\/([\w.\_\-]+)(?::(\d+))?/,Je=t=>{const e=(t||"").replace(/\\/g,"/").split("?")[0],r=e.match(/[\/]?([\w\_\-]+)[.]?[\w]*[?]?$/),n=r?r[1]:"",o=e.lastIndexOf("/")+1,s=e.substring(o),i=s.lastIndexOf("."),a=s.substring(0,i)||"",u=i>=0?s.substring(i):"";return{route:e.substring(0,o)||"",page:n,name:s,withoutExtension:a,extname:u}},Xe=t=>{const e={href:t,url:"",origin:"",protocol:"",host:"",port:"",query:""};if(!t)return e;const r=t.match(Ge);if(!r||r.length<4)return e;const n=r[3]||"",o=t.split("?");return e.url=o[0],e.origin=r[0],e.protocol=`${r[1]}:`,e.host=`${r[2]}${n?":"+n:""}`,e.port=n,e.query=o.length>1?o[1]:"",e},tr=(t,e)=>{if(t===e)return!0;if(!t)return!1;if(!e)return!1;if("*"===e)return!0;const r=e.replace(/\./g,"\\.").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^"+r+"$").test(t)};var er={parse:Qe,stringify:function(t,{sep:e="&",eq:r="=",name:n=null,uri:o=!0,cleanZero:s=!1,cleanNull:i=!1,cleanWhitespace:a=!1}={}){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(n){const u=Ye(He(n),o)+r,c=t[n];return Array.isArray(c)?c.map((function(t){return u+Ye(He(t),o)})).join(e):Ve(c,{cleanZero:s,cleanNull:i,cleanWhitespace:a})?"":u+Ye(He(c),o)})).filter(Boolean).join(e):n?Ye(He(n),o)+r+Ye(He(t),o):""},https:t=>t?t.replace(/^http[s]?/,"https"):t,parseUrl:t=>{const e=Xe(t),{origin:r="",url:n="",query:o=""}=e,s=Je(n),i=Qe(o,{multiple:!0,uri:!1});return{...e,...s,pathname:n.substring(n.indexOf(r||"")+r.length),params:i}},parsePath:Je,parseHost:Xe,join:(...t)=>{const e=[];let r=!1;return t.forEach((t=>{const n=t.trim();if(""===n)return;if(/^(\w+):\/\//.test(n))return e.length=0,e.push(n),void(r=!0);n.split("/").forEach((t=>{"."!==t&&""!==t&&(".."===t?e.length>0&&".."!==e[e.length-1]?e.pop():r||e.push(".."):e.push(t))}))})),e.join("/")},shExpMatch:tr,isLocalIpAddress:t=>!!t&&!!(tr(t,"127.0.0.1")||tr(t,"localhost")||tr(t,"192.168.*.*")),parseFileUrl:t=>{const e={href:t,file:"",url:"",protocol:"",host:"",query:"",params:{}};if(!t)return e;let r=t?t.replace(/\\/g,"/"):"";r.startsWith("file://")&&!r.startsWith("file:///")?r="file:///"+r.slice(7):r.startsWith("file:/")&&!r.startsWith("file:///")&&(r="file:///"+r.slice(6));const n=r.match(/^file:\/\/(?:([^\/\\]+))?(\/.*)?$/);if(!n||n.length<3)return e;e.protocol="file:";const o=n[1]||"",s=n[2]||"";e.host=o;const i=s.split("?");return e.url=e.protocol+`//${e.host}`+i[0],e.file=i[0],e.query=i.length>1?i[1]:"",e.params=Qe(e.query,{multiple:!0,uri:!1}),e}};const rr="0123456789",nr="abcdefghijklmnopqrstuvwxyz",or="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var sr={keyNumber:rr,keyLower:nr,keyUpper:or,keyChars:rr+nr+or};const ir=(t=0,e=0)=>{const r=sr.keyChars.split(""),n=[];let o;if(e=e||r.length,t)for(o=0;o<t;o++)n[o]=r[0|Math.random()*e];else{let t;for(n[8]=n[13]=n[18]=n[23]="-",n[14]="4",o=0;o<36;o++)n[o]||(t=0|16*Math.random(),n[o]=r[19==o?3&t|8:t])}return n.join("")};class ar{__map;__tagList;__eventId="";constructor(){this.__map=new Map,this.__tagList=[],this.__eventId=ir()}clear(){return this.__map.clear(),this}on(t,e,r=""){if(!t||!e)return this;let n=this.__map.get(t);return n||(n=new Set,this.__map.set(t,n)),n.add(e),r&&this.__tagList.push({name:t,listener:e,tag:r}),this}emit(t,...e){if(!t)return this;const r=this.__map.get(t);if(!r)return this;return[...r].forEach((t=>t&&t(...e))),this}off(t,e){if(!t||!e)return this;this.__tagList=this.__tagList.filter((r=>r.name!==t||r.listener!==e));const r=this.__map.get(t);return r?(r.delete(e),r.size<=0&&this.__map.delete(t),this):this}remove(t){return t?(this.__tagList=this.__tagList.filter((e=>e.name!==t)),this.__map.delete(t),this):this}removeByTag(t){if(!t)return this;return this.__tagList.filter((e=>e.tag===t)).forEach((t=>{this.off(t.name,t.listener)})),this.__tagList=this.__tagList.filter((e=>e.tag!==t)),this}once(t,e){const r=(...n)=>{e(...n),this.off(t,r)};return this.on(t,r),this}has(t){return this.__map.has(t)}}class ur{_loopTimer;_event=new ar;started=!1;interval=0;constructor(t=0){this.interval=t||500}start(){return this.started||(this.stop(),this._loopTimer=setInterval((()=>{this._handleLoop()}),this.interval),this.started=!0),this}stop(){return this._loopTimer?(clearInterval(this._loopTimer),this._loopTimer=0,this.started=!1,this):this}restart(){return this.stop(),this.start(),this}on(t){return this._event.on("frame",t),this}off(t){return t?(this._event.off("frame",t),this):this}_handleLoop(){this._event.emit("frame")}}var cr={oneDay:864e5,oneHour:36e5,oneMinute:6e4,oneSecond:1e3};class fr{date;timestamp=0;yyyy=0;yy="";M=0;MM="";d=0;dd="";h=0;hh="";m=0;mm="";s=0;ss="";S=0;SS="";SSS="";constructor(t){if(!t)return;const e="string"==typeof t||"number"==typeof t?new Date(t):t;e&&(this.date=e,this.timestamp=e.getTime(),this.toDate())}toDate(){return this.date?(this.yyyy=this.date.getFullYear(),this.yy=`${this.yyyy}`.substr(2),this.M=this.date.getMonth()+1,this.MM=(this.M<10?"0":"")+this.M,this.d=this.date.getDate(),this.dd=(this.d<10?"0":"")+this.d,this.h=this.date.getHours(),this.hh=(this.h<10?"0":"")+this.h,this.m=this.date.getMinutes(),this.mm=(this.m<10?"0":"")+this.m,this.s=this.date.getSeconds(),this.ss=(this.s<10?"0":"")+this.s,this.S=this.date.getMilliseconds(),this.SS=(this.S<10?"0":"")+this.S,this.SSS=this.S.toString().padStart(3,"0"),this):this}toCountdown(t=""){const e={countdown:0,timestamp:0,seconds:0,d:0,dd:"",h:0,hh:"",m:0,mm:"",s:0,ss:"",S:0,SS:"",SSS:"",desc:""};if(!this.timestamp)return e;e.timestamp=this.timestamp,e.countdown=Math.max(e.timestamp-Date.now(),0),e.seconds=Math.floor(e.countdown/cr.oneSecond);let r=e.countdown;e.d=Math.floor(r/cr.oneDay),e.dd=(e.d<10?"0":"")+e.d,r%=cr.oneDay,e.h=Math.floor(r/cr.oneHour),e.hh=(e.h<10?"0":"")+e.h,r%=cr.oneHour,e.m=Math.floor(r/cr.oneMinute),e.mm=(e.m<10?"0":"")+e.m,r%=cr.oneMinute,e.s=Math.floor(r/cr.oneSecond),e.ss=(e.s<10?"0":"")+e.s,r%=cr.oneSecond,e.S=r,e.SS=(e.S<10?"0":"")+e.S,e.SSS=e.S.toString().padStart(3,"0");let n=t;return n||(n=e.countdown>cr.oneHour?"hh:mm:ss":e.countdown>cr.oneMinute?"mm:ss":"ss"),e.desc=n.replace(/\bdd|d|hh|h|mm|m|ss|s|SSS|SS|S\b/g,(t=>e[t])),e}add(t=0){return t?(this.timestamp=this.timestamp+t,this.date=new Date(this.timestamp),this.toDate(),this):this}format(t="yyyy-MM-dd hh:mm:ss"){return t.replace(/\byyyy|yy|MM|M|dd|d|hh|h|mm|m|ss|s|SSS|SS|S\b/g,(t=>this[t]))}static get timezoneOffset(){return(new Date).getTimezoneOffset()/60}static getLocalTime(t=0){const e=new Date,r=e.getTime(),n=6e4*e.getTimezoneOffset();return new Date(r+n+36e5*t)}}const lr=(t,e="yyyy-MM-dd hh:mm:ss")=>{const r="string"==typeof t||"number"==typeof t?new Date(t):t;return r?hr(r).format(e):""},hr=t=>{const e="string"==typeof t||"number"==typeof t?new Date(t):t;return new fr(e||0)};function dr({year:t=0,month:e=0,date:r=0,hour:n=0,minute:o=0,second:s=0}){const i=`${t||"yyyy"}/${e||"MM"}/${r||"dd"} ${n}:${o}:${s}`;return new Date(lr(Date.now(),i)).getTime()}var pr={...cr,now:function(){return hr(new Date)},isToday:t=>t&&(new Date).toDateString()===new Date(t).toDateString(),parseTimestamp:dr,todayZero:()=>dr({}),format:lr,countdown:(t,e="")=>{const r="string"==typeof t||"number"==typeof t?new Date(t):t;if(!r)return"";return hr(r).toCountdown(e)},dtime:hr,loopFrame:(t=500)=>new ur(t),getTimezoneOffset:()=>fr.timezoneOffset,getLocalTime:fr.getLocalTime};const yr=t=>N.toBase64(t);var gr={encode:yr,decode:t=>N.fromBase64(t),encodeByOss:t=>yr(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")};var mr={...sr,base64:gr,tea:Wt,uuid:ir,guid:(t,e=!1,r="")=>{const n=ir(t||32);return e?pr.now().format("yyyyMMddhhmmss")+r+n:n},getHexString:t=>{const e=sr.keyChars;let r="";const n=e.length;for(let o=0;o<t;o++)r+=e.charAt(Math.floor(Math.random()*n));return r}};const br={...nt,...mr,...qe,...Ie,...Z,...Ct,qs:er};export{br as dHook};
|
package/bin/tiny/hook.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("crypto")):"function"==typeof define&&define.amd?define(["exports","crypto"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["d{hook}"]={},t.crypto$1)}(this,(function(t,e){"use strict";function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=r(e);var o={toUtf8:t=>{if(!t)return"";const e=t.replace(/\r\n/g,"\n");let r="";for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);n<128?r+=String.fromCharCode(n):n>127&&n<2048?(r+=String.fromCharCode(n>>6|192),r+=String.fromCharCode(63&n|128)):(r+=String.fromCharCode(n>>12|224),r+=String.fromCharCode(n>>6&63|128),r+=String.fromCharCode(63&n|128))}return r},fromUtf8:t=>{let e="",r=0;if(!t)return"";let n=0,o=0,s=0;for(;r<t.length;)n=t.charCodeAt(r),n<128?(e+=String.fromCharCode(n),r++):n>191&&n<224?(o=t.charCodeAt(r+1),e+=String.fromCharCode((31&n)<<6|63&o),r+=2):(o=t.charCodeAt(r+1),s=t.charCodeAt(r+2),e+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&s),r+=3);return e},toUtf8Bytes:t=>{if(!t)return new Uint8Array;const e=t.replace(/\r\n/g,"\n"),r=[];for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);n<128?r.push(n):n<2048?(r.push(n>>6|192),r.push(63&n|128)):(r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128))}return new Uint8Array(r)},fromUtf8Bytes:t=>{let e="",r=0;if(!t||t.length<=0)return"";for(;r<t.length;){let n=t[r];if(n<128)e+=String.fromCharCode(n),r++;else if(n>191&&n<224){const o=t[r+1];e+=String.fromCharCode((31&n)<<6|63&o),r+=2}else{const o=t[r+1],s=t[r+2];e+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&s),r+=3}}return e}};const s="object"==typeof global&&null!==global&&global.Object===Object&&global,i="object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis,a="object"==typeof self&&null!==self&&self.Object===Object&&self,u=i||s||a||Function("return this")(),c=u.Symbol,{toString:f,hasOwnProperty:l,propertyIsEnumerable:h}=Object.prototype,d=c?c.toStringTag:void 0;function p(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":d&&d in Object(t)?function(t){const e=l.call(t,d),r=t[d];let n=!1;try{t[d]=void 0,n=!0}catch(t){}const o=f.call(t);return n&&(e?t[d]=r:delete t[d]),o}(t):f.call(t)}var y={getTag:p,getType:function(t){return(p(t).match(/\w+/g)||["object","Undefined"])[1]||""},toString:f,hasOwnProperty:l,propertyIsEnumerable:h};const g="object"==typeof t&&null!==t&&!t.nodeType&&t,m=g&&"object"==typeof module&&null!==module&&!module.nodeType&&module,b=m&&m.exports===g&&s.process,w=(()=>{try{const t=m&&m.require&&m.require("util").types;return t||b&&b.binding&&b.binding("util")}catch(t){}})();var A="[object Function]",_="[object GeneratorFunction]",x="[object AsyncFunction]",S=9007199254740991;const v=/^(?:0|[1-9]\d*)$/,j=u?.Buffer?.isBuffer,C=/^\[object (?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)Array\]$/,O=w&&w.isTypedArray;function T(t){const e=typeof t;return null!=t&&("object"==e||"function"==e)}function B(t){return null!=t&&"object"==typeof t}const P=Array.isArray;function M(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=S}(t.length)&&!E(t)}function k(t){return B(t)&&M(t)}function E(t){var e=T(t)?y.getTag(t):"";return e===A||e===_||e===x}function U(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Object.prototype)}function $(t){return k(t)&&y.hasOwnProperty.call(t,"callee")&&(!y.propertyIsEnumerable.call(t,"callee")||"[object Arguments]"==y.toString.call(t))}const I="undefined"!=typeof window&&void 0!==window.document,D="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,K=O?t=>O(t):t=>B(t)&&C.test(y.getTag(t)),N="function"==typeof j?j:()=>!1;var F={is:function(t,e){return y.getTag(t)===`[object ${e}]`},isNumber:function(t){return"[object Number]"===y.getTag(t)},isString:function(t){return"string"==typeof t||!P(t)&&B(t)&&"[object String]"==y.getTag(t)},isObject:T,isObjectLike:B,isPlainObject:function(t){if(!B(t)||"[object Object]"!=y.getTag(t))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},isSymbol:function(t){return"symbol"==typeof t||B(t)&&"[object Symbol]"===y.getTag(t)},isFunction:E,isArray:P,isArrayLikeObject:k,isIndex:function(t,e){return!!(e=null==e?S:e)&&("number"==typeof t||v.test(t))&&t>-1&&t%1==0&&t<e},isArrayLike:M,isPrototype:U,isArguments:$,isPromise:function(t){return"[object Promise]"===(T(t)?y.getTag(t):"")},isBrowser:I,isNode:D,isBlobOrBuffer:t=>t instanceof Blob||t instanceof ArrayBuffer,isUint8Array:t=>t instanceof Uint8Array,isArrayBuffer:t=>t instanceof ArrayBuffer,isEmpty:t=>{if(null==t)return!0;if(M(t)&&(Array.isArray(t)||"string"==typeof t||"function"==typeof t.splice||N(t)||K(t)||$(t)))return!t.length;const e=y.getTag(t);if("[object Map]"===e||"[object Set]"===e)return!t.size;if(U(t))return!Object.keys(t).length;for(const e in t)if(y.hasOwnProperty.call(t,e))return!1;return!0}};const L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var R={toBase64:(t="")=>{let e,r,n,s,i,a,u,c="",f=0;for(t=o.toUtf8(t);f<t.length;)e=t.charCodeAt(f++),r=t.charCodeAt(f++),n=t.charCodeAt(f++),s=e>>2,i=(3&e)<<4|r>>4,a=(15&r)<<2|n>>6,u=63&n,isNaN(r)?a=u=64:isNaN(n)&&(u=64),c=c+L.charAt(s)+L.charAt(i)+L.charAt(a)+L.charAt(u);return c},fromBase64:(t="")=>{let e,r,n,s,i,a,u,c="",f=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");f<t.length;)s=L.indexOf(t.charAt(f++)),i=L.indexOf(t.charAt(f++)),a=L.indexOf(t.charAt(f++)),u=L.indexOf(t.charAt(f++)),e=s<<2|i>>4,r=(15&i)<<4|a>>2,n=(3&a)<<6|u,c+=String.fromCharCode(e),64!=a&&(c+=String.fromCharCode(r)),64!=u&&(c+=String.fromCharCode(n));return c=o.fromUtf8(c),c},bytesToBase64:t=>{let e,r,n,o,s,i,a,u="",c=0;if(!t||!F.isArrayLike(t)||!F.isUint8Array(t))return"";for(;c<t.length;)e=t[c++],r=t[c++],n=t[c++],o=e>>2,s=(3&e)<<4|r>>4,i=(15&r)<<2|n>>6,a=63&n,isNaN(r)?i=a=64:isNaN(n)&&(a=64),u=u+L.charAt(o)+L.charAt(s)+L.charAt(i)+L.charAt(a);return u},base64ToBytes:(t="")=>{let e,r,n,o,s,i,a,u=[],c=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");c<t.length;)o=L.indexOf(t.charAt(c++)),s=L.indexOf(t.charAt(c++)),i=L.indexOf(t.charAt(c++)),a=L.indexOf(t.charAt(c++)),e=o<<2|s>>4,r=(15&s)<<4|i>>2,n=(3&i)<<6|a,u.push(e),64!=i&&u.push(r),64!=a&&u.push(n);return new Uint8Array(u)}};function Z(t){return Math.floor(Math.random()*t)}function q(t,e=10){return+parseFloat(Number(t).toExponential(e))}const W=180/Math.PI;var z={random:Z,randomRange:function(t,e){return Math.floor(Math.random()*(e-t+1)+t)},lerp:function(t,e,r){return t*(1-r)+e*r},randoms:function(t,e=1,r=!1){const n=[];for(;;){if(n.length>=e)break;if(!r&&n.length>=t)break;const o=Z(t);r?n.push(o):n.includes(o)||n.push(o)}return n},strip:q,float:function(t,{digits:e=2,fixed:r=!1}={}){const n=q(t).toFixed(e);return r||!e?+n:+n.replace(/(\.[1-9]?)0+$/,"$1").replace(/\.$/,"")},radian2degree:function(t){return t*W},degree2radian:function(t){return t/W},calcDataSize:function(t){const e={gb:0,mb:0,kb:0,b:0,total:t,desc:""},r=[{name:"gb",divisor:1<<30},{name:"mb",divisor:1<<20},{name:"kb",divisor:1024},{name:"b",divisor:1}];for(const n of r){const r=Math.floor(t/n.divisor);e[n.name]=r,t-=r*n.divisor}return e.gb>0?e.desc=(e.gb+e.mb/1024).toFixed(2)+"GB":e.mb>0?e.desc=(e.mb+e.kb/1024).toFixed(2)+"MB":e.kb>0?e.desc=(e.kb+e.b/1024).toFixed(2)+"KB":e.desc=e.b+"B",e}};var Q={bytes2str:t=>{if(!t||!F.isArrayLike(t))return"";return t.reduce(((t,e)=>t+String.fromCharCode(e)),"")},str2bytes:(t="")=>{const e=t,r=new Uint8Array(e.length);for(let t=0,n=e.length;t<n;t++)r[t]=e.charCodeAt(t);return r},str2hex:t=>{let e="";for(let r=0;r<t.length;r++)e+=t.charCodeAt(r).toString(16).padStart(2,"0");return e},hex2str:t=>{let e="";for(let r=0;r<t.length;r+=2)e+=String.fromCharCode(parseInt(t.substr(r,2),16));return e},concatBytes:(...t)=>{const e=t.reduce(((t,e)=>t+e.length),0),r=new Uint8Array(e);let n=0;for(const e of t)r.set(e,n),n+=e.length;return r},uint32ToBytes:t=>{const e=new Uint8Array(8);return e[0]=t[0]>>>24&255,e[1]=t[0]>>>16&255,e[2]=t[0]>>>8&255,e[3]=255&t[0],e[4]=t[1]>>>24&255,e[5]=t[1]>>>16&255,e[6]=t[1]>>>8&255,e[7]=255&t[1],e},bytesToUint32:t=>{const e=new Uint32Array(2);return e[0]=t[0]<<24|t[1]<<16|t[2]<<8|t[3],e[1]=t[4]<<24|t[5]<<16|t[6]<<8|t[7],e},hex2bytes:t=>{let e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++)e[r]=parseInt(t.substr(2*r,2),16);return e},bytes2hex:t=>Array.from(t).map((t=>t.toString(16).padStart(2,"0"))).join(""),toUint32:t=>{const e=Math.ceil(t.length/4),r=new Uint32Array(e);for(let n=0;n<e;n++)r[n]=t.charCodeAt(4*n)<<24|t.charCodeAt(4*n+1)<<16|t.charCodeAt(4*n+2)<<8|t.charCodeAt(4*n+3);return r},fromUint32:t=>{let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]>>>24&255,t[r]>>>16&255,t[r]>>>8&255,255&t[r]);return e.replace(/\0+$/,"")},flatten:function t(e,r=!1,n=[]){for(let o=0;o<e.length;o+=1){const s=e[o];r&&Array.isArray(s)?t(s,r,n):n.push(s)}return n}};var H={pkcs7Padding:(t,e)=>{const r=e-t.length%e,n=new Uint8Array(r).fill(r);return Q.concatBytes(t,n)},pkcs7Unpadding:t=>{const e=t[t.length-1];return t.slice(0,-e)}};function Y(t,e){return t<<e|t>>>32-e}function V(t,e){let r,n,o,s,i;return o=2147483648&t,s=2147483648&e,r=1073741824&t,n=1073741824&e,i=(1073741823&t)+(1073741823&e),r&n?2147483648^i^o^s:r|n?1073741824&i?3221225472^i^o^s:1073741824^i^o^s:i^o^s}function G(t,e,r,n,o,s,i){return t=V(t,V(V(function(t,e,r){return t&e|~t&r}(e,r,n),o),i)),V(Y(t,s),e)}function J(t,e,r,n,o,s,i){return t=V(t,V(V(function(t,e,r){return t&r|e&~r}(e,r,n),o),i)),V(Y(t,s),e)}function X(t,e,r,n,o,s,i){return t=V(t,V(V(function(t,e,r){return t^e^r}(e,r,n),o),i)),V(Y(t,s),e)}function tt(t,e,r,n,o,s,i){return t=V(t,V(V(function(t,e,r){return e^(t|~r)}(e,r,n),o),i)),V(Y(t,s),e)}function et(t){let e,r,n="",o="";for(r=0;r<=3;r++)e=t>>>8*r&255,o="0"+e.toString(16),n+=o.substr(o.length-2,2);return n}function rt(t){let e,r,n,o,s,i,a,u,c,f=[];for(f=function(t){let e;const r=t.length,n=r+8,o=16*((n-n%64)/64+1),s=Array(o-1).fill(0);let i=0,a=0;for(;a<r;)e=(a-a%4)/4,i=a%4*8,s[e]=s[e]|t[a]<<i,a++;return e=(a-a%4)/4,i=a%4*8,s[e]=s[e]|128<<i,s[o-2]=r<<3,s[o-1]=r>>>29,s}(t),i=1732584193,a=4023233417,u=2562383102,c=271733878,e=0;e<f.length;e+=16)r=i,n=a,o=u,s=c,i=G(i,a,u,c,f[e+0],7,3614090360),c=G(c,i,a,u,f[e+1],12,3905402710),u=G(u,c,i,a,f[e+2],17,606105819),a=G(a,u,c,i,f[e+3],22,3250441966),i=G(i,a,u,c,f[e+4],7,4118548399),c=G(c,i,a,u,f[e+5],12,1200080426),u=G(u,c,i,a,f[e+6],17,2821735955),a=G(a,u,c,i,f[e+7],22,4249261313),i=G(i,a,u,c,f[e+8],7,1770035416),c=G(c,i,a,u,f[e+9],12,2336552879),u=G(u,c,i,a,f[e+10],17,4294925233),a=G(a,u,c,i,f[e+11],22,2304563134),i=G(i,a,u,c,f[e+12],7,1804603682),c=G(c,i,a,u,f[e+13],12,4254626195),u=G(u,c,i,a,f[e+14],17,2792965006),a=G(a,u,c,i,f[e+15],22,1236535329),i=J(i,a,u,c,f[e+1],5,4129170786),c=J(c,i,a,u,f[e+6],9,3225465664),u=J(u,c,i,a,f[e+11],14,643717713),a=J(a,u,c,i,f[e+0],20,3921069994),i=J(i,a,u,c,f[e+5],5,3593408605),c=J(c,i,a,u,f[e+10],9,38016083),u=J(u,c,i,a,f[e+15],14,3634488961),a=J(a,u,c,i,f[e+4],20,3889429448),i=J(i,a,u,c,f[e+9],5,568446438),c=J(c,i,a,u,f[e+14],9,3275163606),u=J(u,c,i,a,f[e+3],14,4107603335),a=J(a,u,c,i,f[e+8],20,1163531501),i=J(i,a,u,c,f[e+13],5,2850285829),c=J(c,i,a,u,f[e+2],9,4243563512),u=J(u,c,i,a,f[e+7],14,1735328473),a=J(a,u,c,i,f[e+12],20,2368359562),i=X(i,a,u,c,f[e+5],4,4294588738),c=X(c,i,a,u,f[e+8],11,2272392833),u=X(u,c,i,a,f[e+11],16,1839030562),a=X(a,u,c,i,f[e+14],23,4259657740),i=X(i,a,u,c,f[e+1],4,2763975236),c=X(c,i,a,u,f[e+4],11,1272893353),u=X(u,c,i,a,f[e+7],16,4139469664),a=X(a,u,c,i,f[e+10],23,3200236656),i=X(i,a,u,c,f[e+13],4,681279174),c=X(c,i,a,u,f[e+0],11,3936430074),u=X(u,c,i,a,f[e+3],16,3572445317),a=X(a,u,c,i,f[e+6],23,76029189),i=X(i,a,u,c,f[e+9],4,3654602809),c=X(c,i,a,u,f[e+12],11,3873151461),u=X(u,c,i,a,f[e+15],16,530742520),a=X(a,u,c,i,f[e+2],23,3299628645),i=tt(i,a,u,c,f[e+0],6,4096336452),c=tt(c,i,a,u,f[e+7],10,1126891415),u=tt(u,c,i,a,f[e+14],15,2878612391),a=tt(a,u,c,i,f[e+5],21,4237533241),i=tt(i,a,u,c,f[e+12],6,1700485571),c=tt(c,i,a,u,f[e+3],10,2399980690),u=tt(u,c,i,a,f[e+10],15,4293915773),a=tt(a,u,c,i,f[e+1],21,2240044497),i=tt(i,a,u,c,f[e+8],6,1873313359),c=tt(c,i,a,u,f[e+15],10,4264355552),u=tt(u,c,i,a,f[e+6],15,2734768916),a=tt(a,u,c,i,f[e+13],21,1309151649),i=tt(i,a,u,c,f[e+4],6,4149444226),c=tt(c,i,a,u,f[e+11],10,3174756917),u=tt(u,c,i,a,f[e+2],15,718787259),a=tt(a,u,c,i,f[e+9],21,3951481745),i=V(i,r),a=V(a,n),u=V(u,o),c=V(c,s);return et(i)+et(a)+et(u)+et(c)}const nt=t=>{if("string"!=typeof t&&!(t instanceof Uint8Array))return"";return rt("string"==typeof t?o.toUtf8Bytes(t):t)};var ot={md5:nt,md5Base64:t=>{const e=nt(t);if(!e)return"";const r=Q.hex2bytes(e);return R.bytesToBase64(r)}};const st=(t,e=!1)=>{const r=new Uint8Array(t);return e?R.bytesToBase64(r):r.reduce(((t,e)=>t+String.fromCharCode(e)),"")};var it={...Q,...H,...o,...R,...ot,str2ab:(t="",e=!1)=>{if(e)return R.base64ToBytes(t).buffer;{const e=new ArrayBuffer(t.length),r=new Uint8Array(e);for(let e=0,n=t.length;e<n;e++)r[e]=t.charCodeAt(e);return e}},ab2str:st,utf8ToBase64:t=>F.isBrowser?btoa(t):Buffer.from(t,"utf-8").toString("base64"),base64ToUtf8:t=>F.isBrowser?atob(t):Buffer.from(t,"base64").toString("utf-8"),getRandomBytes:t=>{const e=new Uint8Array(t);for(let r=0;r<t;r++)e[r]=z.random(256);return e},textEncode:t=>o.toUtf8Bytes(t),textDecode:t=>o.fromUtf8Bytes(new Uint8Array(t)),toDataUrl:(t,e="text/plain")=>t?"string"==typeof t?`data:${e};base64,`+R.toBase64(t):F.isArrayBuffer(t)?`data:${e};base64,`+st(t,!0):"":""};const at=NaN,ut=/^\s+|\s+$/g,ct=/^[-+]0x[0-9a-f]+$/i,ft=/^0b[01]+$/i,lt=/^0o[0-7]+$/i,ht=parseInt,dt=1/0,pt=17976931348623157e292;function yt(t){if("number"==typeof t)return t;if(F.isSymbol(t))return at;if(F.isObject(t)){const e="function"==typeof t.valueOf?t.valueOf():t;t=F.isObject(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(ut,"");const e=ft.test(t);return e||lt.test(t)?ht(t.slice(2),e?2:8):ct.test(t)?at:+t}function gt(t){return t?(t=yt(t))===dt||t===-dt?(t<0?-1:1)*pt:t==t?t:0:0===t?t:0}var mt={toNumber:yt,toFinite:gt,toInteger:function(t){var e=gt(t),r=e%1;return e==e?r?e-r:e:0}};const bt="Expected a function",wt=Math.max,At=Math.min;function _t(t,e=300,r={}){let n,o,s,i,a,u,c=0,f=!1,l=!1,h=!0;if("function"!=typeof t)throw new TypeError(bt);function d(e){const r=n,s=o;return n=o=void 0,c=e,i=t.apply(s,r),i}function p(t){const r=t-u;return void 0===u||r>=e||r<0||l&&t-c>=s}function y(){const t=Date.now();if(p(t))return g(t);a=setTimeout(y,function(t){const r=e-(t-u);return l?At(r,s-(t-c)):r}(t))}function g(t){return a=void 0,h&&n?d(t):(n=o=void 0,i)}function m(...t){const r=Date.now(),s=p(r);if(n=t,o=this,u=r,s){if(void 0===a)return function(t){return c=t,a=setTimeout(y,e),f?d(t):i}(u);if(l)return a=setTimeout(y,e),d(u)}return void 0===a&&(a=setTimeout(y,e)),i}return e=mt.toNumber(e)||0,F.isObject(r)&&(f=!!r.leading,l="maxWait"in r,s=l?wt(mt.toNumber(r.maxWait)||0,e):s,h="trailing"in r?!!r.trailing:h),m.cancel=function(){void 0!==a&&clearTimeout(a),c=0,n=u=o=a=void 0},m.flush=function(){return void 0===a?i:g(Date.now())},m.pending=function(){return void 0!==a},m}class xt{__list=[];constructor(t){this.push(t)}push(t){return t&&this.__list.push(t),this}clear(){return this.__list=[],this}_exec(t,e){let r;if(F.isFunction(t))r=t(e);else{if(F.isPromise(t))return t.then((t=>({...e,...t})));r=t}return F.isPromise(r)?r:Promise.resolve({...r,...e})}run(t){try{return this.__list.reduce(((t,e)=>t.then((t=>this._exec(e,t)))),Promise.resolve(t)).then((t=>[void 0,t])).catch((t=>[t,void 0]))}catch(t){return Promise.reject([t,void 0])}}}async function St(t,e,r){return t.then((t=>(r&&r(),[null,t]))).catch((t=>(e&&Object.assign(t,e),r&&r(),[t,void 0])))}const vt=(t,e)=>{try{let r;return r=F.isFunction(t)?t():t,St(Promise.resolve(r),void 0,e)}catch(t){return e&&e(),Promise.resolve([t,void 0])}},jt=t=>"string"==typeof(t="function"==typeof t?t():t)?new Error(t):t;var Ct={to:St,go:(t,e)=>vt(t,e),delay:(t=1e3)=>new Promise((e=>setTimeout(e,t))),safeRun:vt,toError:jt,timeout:(t,e=0,r="timeout")=>{if(e<=0)return vt(t);let n;function o(){n&&clearTimeout(n)}const s=new Promise((t=>{o(),n=setTimeout((()=>t([jt(r||"timeout"),void 0])),e)}));return Promise.race([vt(t,o),s])}};class Ot{__value=void 0;set(t){this.__value=t}get(){return this.__value}}var Tt={singleton:function(){class t{static __instance__;constructor(){}static get Instance(){return t.__instance__||(t.__instance__=new this),t.__instance__}static get I(){return this.Instance}}return t},getset:function(t){const e=new Ot;return void 0!==t&&e.set(t),e}};class Bt{_func;_callback;constructor(t,e){this._func=t,this._callback=e}async run(){return Ct.safeRun(this._func).then((t=>{try{this._callback&&this._callback(t)}catch(t){console.log("[ddan] task",t)}finally{return t}}))}}class Pt{__list=[];__count=0;__max=1;constructor(t=1){this.__count=0,this.__max=t>0?t:1,this.clear()}push(t,e){const r=new Bt(t,e);return this.__list.push(r),this._step(),this}clear(){return this.__list=[],this.__count=0,this}_step(){if(this.__list.length<=0)return;if(this.__count>=this.__max)return;const t=this.__list.shift();t?(this.__count+=1,t?.run().finally((()=>{try{this.__count>0&&(this.__count-=1),this._step()}catch(t){console.error("[ddan] pipepine step finally",t)}}))):this._step()}async whenAll(){for(;;){if(this.__count<=0)break;await Ct.delay(100),this._step()}return this.clear()}}class Mt extends(Tt.singleton()){__lockedMap=new Map;pipeline=new Pt;constructor(){super()}lock(t,e){if(!t||!e)return;const r=Ct.safeRun(e);return this.__lockedMap.set(t,r),r}unlock(t){t&&this.__lockedMap.has(t)&&this.__lockedMap.delete(t)}async exec(t,e){if(!t||!e)return Ct.safeRun(t);const r=this.__lockedMap.get(e);if(r)return r;const n=this.lock(e,t);if(!n)return Ct.safeRun(t);const o=await n;return this.unlock(e),o}}const kt=t=>{try{const e=it.ab2str(t,!0);return e.match(/.{1,64}/g)?.join("\n")||""}catch(t){return""}},Et=(t="",e="PUBLIC KEY")=>`-----BEGIN ${e}-----\n${t}\n-----END ${e}-----`;var Ut={RSAPublicKey:"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApiLWsPmoaiGdr02AmPYS\n4/VgxyJNNJSK2VICirXl4P8qAP3b/6GIs7Hwnsmmuj7gledJ0XiZodFjDNgQEZEG\nj4K9KX8NixcrJwnTQV5UebiERdj+64ihwqPVWo9dIOj43ZPJ8f4dritJv5tnQaBb\nb9zTkU3Ofzk1g8RU00Ith6quOGZcU2IWC4OQ+5YiZvzrCBKEvjFwK2OvGq43tI51\nGaZdI9H09jisypqefsMvv6esjEQQOtl+WGlI5fof7KZUt3dppvuDI4CYgeXIoKKL\n9T9qDl8F9aNSs3XHx32YyA7L1FraFD6PjqRjueIFp2emsXQcIMeMqqgVyV+4qb+0\nuwIDAQAB",RSAPrivateKey:"MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCmItaw+ahqIZ2v\nTYCY9hLj9WDHIk00lIrZUgKKteXg/yoA/dv/oYizsfCeyaa6PuCV50nReJmh0WMM\n2BARkQaPgr0pfw2LFysnCdNBXlR5uIRF2P7riKHCo9Vaj10g6Pjdk8nx/h2uK0m/\nm2dBoFtv3NORTc5/OTWDxFTTQi2Hqq44ZlxTYhYLg5D7liJm/OsIEoS+MXArY68a\nrje0jnUZpl0j0fT2OKzKmp5+wy+/p6yMRBA62X5YaUjl+h/splS3d2mm+4MjgJiB\n5cigoov1P2oOXwX1o1KzdcfHfZjIDsvUWtoUPo+OpGO54gWnZ6axdBwgx4yqqBXJ\nX7ipv7S7AgMBAAECggEAE1kuWLkSsJ2OoDpt9iJ+a7cJmNd5V1zPWOTwr9fkWFJP\nQYNPKlPVOFxKUivY84rcHAkuMyuQ9OQOXZISOQGDWpZW0mzeFmtR1r+Rr2S9gNmI\n6huOAL9OW306HUxiA7GuPhv2omy+Zyjac2q1WVLEI2B78Um2+WEfxuNIH7xu0gRR\nz/wluevMBQlv6hSeMESP6e9s2kB+FuM4bL7+1sexwS1TudKbHybujaiB8un9E2V3\nC9BkE6yf00Rhvii6Q4E4w3PFQfcBEFnjOD0S2Watx8GIbYjlYvtquy8Yj7OtyZB6\nw5sxyaYhKVVnkpGAbOgaCj94ABYF47VuwXr45I4PzQKBgQDp6svzD+QKlARjcWgO\nrH7UEpFX6m49G6Ib4c63xEg9+GesTgfDxoYxtXDKsC7I8OwMrmffJGbyfjaAvzmg\nicM3Y7kF6UPO9+q2mBRsyhoJSNONTeUVyoFSc+QDsVgndlTZIjqC5XLrONGaSPLJ\n7jJzqKhp3NQcpO8+xY0d7Efm1QKBgQC10fCNuF1LUTYgsWvvGxTiCCAIBurZmHU+\nGMb2Okfoco/P+QNl1jEba91AC7FudW3g/lRn0vTnDajlNoz2/CKunrTKN4/9lEBI\ntiwEOvhc5FtapRifSfrrNwFqPM+LijvOkcteWVhAUWCEP1eLmpnXGqfmZxnTaaVe\n5DyDgyAVTwKBgQDhEawfOQEANJ9sV2f6BnsZ7quuXcCoR3hZP5G5O8EO735BSesq\nsk/YcG4QeCjr6vQU15LWH552YH5srpHyJ9uP5gHW8DTwZZaPDhFJA8S9fjcfVP3B\nU9HO1fdknjTl83N8YPTPkZpbPZZfzyTcqrYclwFEqtfkn8YbLdW0Hu6n6QKBgDEv\njvS3uD1ExfDILlurptWSvx+Mx4F/1c+roj8/+u3t9+uaAIpPDE/PuTW3NBOens/r\n3WeM0QWkU1lWjYHPKY61jlDaARDnRxCkf3nRfhibCf+Wg/erar6wzagwtTCZf55d\nIHfwkYgsu4BrJkK02wMuydbxczIW9U6bTaeCFG7PAoGAN3oHYzTEBwZ7ZKv11QiQ\nEp/HeHBvD8fH/e1uVyBel4Co7NO5pV2s8qjS8+3+jxumKLNXCirjqwHo03YCdzxi\ncy4GFDsukHmDQ7FF9VC4QV0fJ0F7jGYE9nNZ+K9qwS5KrihOSBPxj0HptrF6TSOw\nBTSwr0byL3TC0m0StkSNKpo=",generateKeys:async t=>{try{const e=await t.generateKey({name:"RSA-OAEP",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-256"},!0,["encrypt","decrypt"]),r=await window.crypto.subtle.exportKey("spki",e.publicKey),n=kt(r),o=Et(n,"PUBLIC KEY"),s=await window.crypto.subtle.exportKey("pkcs8",e.privateKey),i=kt(s);return{publicKey:n,publicKeyPem:o,privateKey:i,privateKeyPem:Et(i,"PRIVATE KEY")}}catch(t){return console.error("generateKeys failed:",t),{publicKey:"",publicKeyPem:"",privateKey:"",privateKeyPem:""}}},format_pem_key:Et,format_pem_content:kt,encrypt:async(t,e,r)=>{try{const n=(new TextEncoder).encode(e),o=await t.importKey("spki",it.str2ab(r,!0),{name:"RSA-OAEP",hash:"SHA-256"},!0,["encrypt"]),s=[];for(let e=0;e<n.length;e+=190){let r=n.slice(e,e+190),i=await t.encrypt({name:"RSA-OAEP"},o,r);s.push(new Uint8Array(i))}const i=it.concatBytes(...s);return it.bytesToBase64(i)}catch(t){return console.error("[debug] encrypt",t),""}},decrypt:async(t,e,r)=>{try{const n=it.base64ToBytes(e),o=await t.importKey("pkcs8",it.str2ab(r,!0),{name:"RSA-OAEP",hash:"SHA-256"},!0,["decrypt"]),s=[],i=256;for(let e=0;e<n.length;e+=i){let r=n.slice(e,e+i),a=await t.decrypt({name:"RSA-OAEP"},o,r);s.push(new Uint8Array(a))}const a=it.concatBytes(...s);return(new TextDecoder).decode(a)}catch(t){return console.error("decrypt failed:",t),""}}};const $t=()=>n.default.webcrypto.subtle;var It=async t=>Ut.encrypt($t(),t,Ut.RSAPublicKey),Dt=async t=>Ut.decrypt($t(),t,Ut.RSAPrivateKey);const Kt="undefined"!=typeof window?window.crypto.subtle:{};var Nt=async t=>Ut.encrypt(Kt,t,Ut.RSAPublicKey),Ft=async t=>Ut.decrypt(Kt,t,Ut.RSAPrivateKey);const Lt=2654435769,Rt=(t,e)=>{let r=0;for(let n=0;n<32;n++)r=r+Lt>>>0,t[0]=t[0]+((t[1]<<4)+e[0]^t[1]+r^(t[1]>>>5)+e[1])>>>0,t[1]=t[1]+((t[0]<<4)+e[2]^t[0]+r^(t[0]>>>5)+e[3])>>>0;return t},Zt=(t,e)=>{let r=3337565984;for(let n=0;n<32;n++)t[1]=t[1]-((t[0]<<4)+e[2]^t[0]+r^(t[0]>>>5)+e[3])>>>0,t[0]=t[0]-((t[1]<<4)+e[0]^t[1]+r^(t[1]>>>5)+e[1])>>>0,r=r-Lt>>>0;return t},qt=t=>{const e=it.str2bytes(t),r=new Uint32Array(4);return r[0]=e[0]<<24|e[1]<<16|e[2]<<8|e[3],r[1]=e[4]<<24|e[5]<<16|e[6]<<8|e[7],r[2]=e[8]<<24|e[9]<<16|e[10]<<8|e[11],r[3]=e[12]<<24|e[13]<<16|e[14]<<8|e[15],r},Wt=(t,e)=>{const r=it.pkcs7Padding(t,8),n=qt(e),o=[];for(let t=0;t<r.length;t+=8){const e=it.bytesToUint32(r.slice(t,t+8)),s=Rt(e,n);o.push(it.uint32ToBytes(s))}return it.concatBytes(...o)},zt=(t,e)=>{const r=qt(e),n=[];for(let e=0;e<t.length;e+=8){const o=it.bytesToUint32(t.slice(e,e+8)),s=Zt(o,r);n.push(it.uint32ToBytes(s))}const o=it.concatBytes(...n);return it.pkcs7Unpadding(o)};var Qt={TEAKey:"33576f37387276645054657a6831686e454664424e5652456f47794835795942",encrypt:Rt,decrypt:Zt,toTeaKey:qt,encode:(t,e)=>{const r=it.textEncode(t),n=Wt(r,e);return it.bytesToBase64(n)},decode:(t,e)=>{const r=it.base64ToBytes(t),n=zt(r,e);return it.textDecode(n.buffer)},encodeBytes:Wt,decodeBytes:zt};function Ht(t,e,r){const{length:n}=t;return r=void 0===r?n:r,!e&&r>=n?t:function(t,e,r){let n=null==t?0:t.length;if(!n)return[];(e=null==e?0:e)<0&&(e=-e>n?0:n+e),(r=(r=void 0===r?n:r)>n?n:r)<0&&(r+=n),n=e>r?0:r-e>>>0,e>>>=0;let o=-1;const s=new Array(n);for(;++o<n;)s[o]=t[o+e];return s}(t,e,r)}const Yt=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff\\ufe0e\\ufe0f]");function Vt(t){return Yt.test(t)}const Gt="\\ud800-\\udfff",Jt=`[${Gt}]`,Xt="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]",te="\\ud83c[\\udffb-\\udfff]",ee=`[^${Gt}]`,re="(?:\\ud83c[\\udde6-\\uddff]){2}",ne="[\\ud800-\\udbff][\\udc00-\\udfff]",oe=`${`(?:${Xt}|${te})`}?`,se="[\\ufe0e\\ufe0f]?",ie=se+oe+`(?:\\u200d(?:${[ee,re,ne].join("|")})${se+oe})*`,ae=`(?:${[`${ee}${Xt}?`,Xt,re,ne,Jt].join("|")})`,ue=RegExp(`${te}(?=${te})|${ae+ie}`,"g");function ce(t){return Vt(t)?function(t){return t.match(ue)||[]}(t):function(t){return t.split("")}(t)}function fe(t){return e=>{if(!e)return"";const r=Vt(e)?ce(e):void 0,n=r?r[0]:e[0],o=r?Ht(r,1).join(""):e.slice(1);return n[t]()+o}}const le="\\ud800-\\udfff",he="\\u2700-\\u27bf",de="a-z\\xdf-\\xf6\\xf8-\\xff",pe="A-Z\\xc0-\\xd6\\xd8-\\xde",ye="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ge="['’]",me=`[${ye}]`,be=`[${he}]`,we=`[${de}]`,Ae=`[^${le}${ye+"\\d"+he+de+pe}]`,_e="(?:\\ud83c[\\udde6-\\uddff]){2}",xe="[\\ud800-\\udbff][\\udc00-\\udfff]",Se=`[${pe}]`,ve=`(?:${we}|${Ae})`,je=`(?:${Se}|${Ae})`,Ce=`(?:${ge}(?:d|ll|m|re|s|t|ve))?`,Oe=`(?:${ge}(?:D|LL|M|RE|S|T|VE))?`,Te="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]|\\ud83c[\\udffb-\\udfff])?",Be="[\\ufe0e\\ufe0f]?",Pe=Be+Te+`(?:\\u200d(?:${[`[^${le}]`,_e,xe].join("|")})${Be+Te})*`,Me=`(?:${[be,_e,xe].join("|")})${Pe}`,ke=RegExp([`${Se}?${we}+${Ce}(?=${[me,Se,"$"].join("|")})`,`${je}+${Oe}(?=${[me,Se+ve,"$"].join("|")})`,`${Se}?${ve}+${Ce}`,`${Se}+${Oe}`,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",Me].join("|"),"g");const Ee=RegExp.prototype.test.bind(/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/),Ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function $e(t,e){if(void 0===e){const e=Ee(t)?function(t){return t.match(ke)}(t):function(t){return t.match(Ue)}(t);return e||[]}return t.match(e)||[]}function Ie(t){if(null==t)return"";if("string"==typeof t)return t;if(Array.isArray(t))return`${t.map((t=>null==t?t:Ie(t)))}`;if(F.isSymbol(t))return t.toString();const e=`${t}`;return"0"==e&&1/t==-Infinity?"-0":e}const De=fe("toUpperCase"),Ke=fe("toLowerCase");var Ne={toString:Ie,startCase:t=>$e(`${t}`.replace(/['\u2019]/g,"")).reduce(((t,e,r)=>t+(r?" ":"")+De(e)),""),snakeCase:t=>$e(Ie(t).replace(/['\u2019]/g,"")).reduce(((t,e,r)=>t+(r?"_":"")+e.toLowerCase()),""),kebabCase:t=>$e(Ie(t).replace(/['\u2019]/g,"")).reduce(((t,e,r)=>t+(r?"-":"")+e.toLowerCase()),""),camelCase:t=>$e(Ie(t).replace(/['\u2019]/g,"")).reduce(((t,e,r)=>(e=e.toLowerCase(),t+(r?De(e):e))),""),upperCase:t=>$e(Ie(t).replace(/['\u2019]/g,"")).reduce(((t,e,r)=>t+(r?" ":"")+e.toUpperCase()),""),upperFirst:De,lowerCase:t=>$e(Ie(t).replace(/['\u2019]/g,"")).reduce(((t,e,r)=>t+(r?" ":"")+e.toLowerCase()),""),lowerFirst:Ke,splitOnFirst:(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===t||""===e)return[];const r=t.indexOf(e);return-1===r?[]:[t.slice(0,r),t.slice(r+e.length)]},parseValue:(t,{number:e=!1,boolean:r=!1}={})=>{let n=t;return t&&"string"==typeof t?(e&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?n=Number(t):!r||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(n="true"===t.toLowerCase()),n):n},replace:(t,e)=>{if(!t)return t;if(!e)return t;let r=t;return((Array.isArray(e)?e:[e])||[]).forEach((t=>{t.key&&t.value&&(r=r.replace(new RegExp(t.key,t.flag||""),t.value))})),r},jsonFormat:t=>{try{if(!t)return"";const e=JSON.parse(t);return JSON.stringify(e,null,2)}catch(e){return t}},toLines:(t,e="\n")=>t?t.split(e).map((t=>t.trim())).filter((t=>!!t)):[]};var Fe={logString:t=>{try{const e=JSON.stringify(t);return void 0===e?"":Qt.encode(e,it.hex2str(Qt.TEAKey))}catch(t){return""}},logParse:t=>{try{if(!t)return"";const e=Qt.decode(t,it.hex2str(Qt.TEAKey));return Ne.jsonFormat(e)}catch(t){return""}},logRString:async t=>{try{const e=JSON.stringify(t);if(void 0===e)return"";return F.isBrowser?await Nt(e):await It(e)}catch(t){return""}},logRParse:async t=>{try{if(!t)return"";const e=F.isBrowser?await Ft(t):await Dt(t);return Ne.jsonFormat(e)}catch(t){return""}}};const Le=(t,e,r)=>t*(1-r)+e*r,Re=(t,e,r)=>t===e?0:(r-t)/(e-t),Ze=(t,e,r)=>({x:Le(t.x,e.x,r),y:Le(t.y,e.y,r)}),qe=(t,e,r,n)=>{const o=Ze(t,e,n),s=Ze(e,r,n);return Ze(o,s,n)},We=(t,e)=>{if(1===t.length)return t[0];const r=[];for(let n=0;n<t.length-1;n++)r.push({x:(1-e)*t[n].x+e*t[n+1].x,y:(1-e)*t[n].y+e*t[n+1].y});return We(r,e)},ze=(t,e)=>{if(0===e||e===t)return 1;let r=1;for(let n=1;n<=e;n++)r=r*(t-n+1)/n;return r};var Qe={bezier1:Ze,bezier2:qe,bezier3:(t,e,r,n,o)=>{const s=qe(t,e,r,o),i=qe(e,r,n,o);return Ze(s,i,o)},bezier:We,bezierCurve:(t,e)=>{const r=t.length-1;let n=0,o=0;for(let s=0;s<=r;s++){const i=ze(r,s)*Math.pow(1-e,r-s)*Math.pow(e,s);n+=i*t[s].x,o+=i*t[s].y}return{x:n,y:o}},lerp:Le,lerpAverage:(t,e,r="")=>{if(t.length<=0)return 0;if(1===t.length)return t[0].x;if(2===t.length)return Le(t[0].y,t[1].y,.5);const n=[],o=t.slice().sort(((t,e)=>t.x-e.x)),s=o.length,i=o[0].x,a=o[s-1].x;for(let t=i;t<=a;t+=e){let e=0;for(let n=0;n<s-1;n++){const s=o[n],i=o[n+1];if(t>=s.x&&t<=i.x){if("lerp"===r){const r=Re(s.x,i.x,t);e=Ze(s,i,r).y}else e=s.y;break}}t>o[s-1].x&&(e=o[s-1].y),n.push(e)}return n.reduce(((t,e)=>t+e),0)/n.length},proportion:Re};var He={...Ct,...Fe,...Qe,sleep:Ct.delay,run:async function(t,e=0){if(e<=0)return Ct.safeRun(t);const r=e>0?Date.now():0,n=await Ct.safeRun(t),o=Date.now()-r;return o<e&&await Ct.delay(e-o),n},exec:(t,e="")=>Mt.I.exec(t,e),debounce:_t,throttle:function(t,e=300,r={}){let n=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return F.isObject(r)&&(n=r.leading?!!r.leading:n,o=r.trailing?!!r.trailing:o),_t(t,e,{leading:n,maxWait:e,trailing:o})},task:t=>new xt(t),mutex:function(t){var e=null;return async function(...r){if((e=this||e||{}).__ddMutex)return!1;e.__ddMutex=!0;try{t&&await Promise.resolve(t.apply(this,r))}catch(t){console.log(t)}finally{e.__ddMutex=!1}}},polling:async function(t={}){const{func:e,interval:r=100,times:n=1e3}=t;let o=n;const s=r<1?100:r;do{if(!e)break;const[t,r]=await Ct.to(Promise.resolve(e()));if(t||!1===r)break;o>0&&o--,0!==o&&await Ct.delay(s)}while(-1===n||o>0)},pipe:(t,e)=>Mt.I.pipeline.push(t,e),pipeline:(t=1)=>new Pt(t),safeTask:(t,e)=>new Bt(t,e)};var Ye=(t,{number:e=!1,boolean:r=!1}={})=>{if(!t&&"object"!=typeof t)return t;for(const[n,o]of Object.entries(t))if("object"==typeof o&&null!==o)for(const[t,n]of Object.entries(o))o[t]=Ne.parseValue(n,{number:e,boolean:r});else t[n]=Ne.parseValue(o,{number:e,boolean:r});return t};const Ve=function(t,{sep:e="&",eq:r="=",max:n=1e3,multiple:o=!0,uri:s=!0,parseNumber:i=!1,parseBoolean:a=!1}={}){e=e||"&",r=r||"=";const u={};if("string"!=typeof t||0===t.length)return u;const c=/\+/g,f=n||1e3;let l=(t=t.split(e)).length;f>0&&l>f&&(l=f);for(let e=0;e<l;++e){let n,i,a,f,l=t[e].replace(c,"%20"),h=l.indexOf(r);h>=0?(n=l.substr(0,h),i=l.substr(h+1)):(n=l,i=""),a=s?decodeURIComponent(n):n,f=s?decodeURIComponent(i):i,y.hasOwnProperty.call(u,a)&&o?Array.isArray(u[a])?u[a].push(f):u[a]=[u[a],f]:u[a]=f}return Ye(u,{number:i,boolean:a}),u},Ge=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Je=function(t,e=!0){return e?encodeURIComponent(t):t},Xe=function(t,{cleanZero:e=!1,cleanNull:r=!1,cleanWhitespace:n=!1}={}){return!(!e||0!==t)||(!(!r||null!=t)||!(!n||"string"!=typeof t||""!==t.trim()))},tr=/^(https?):\/\/([\w.\_\-]+)(?::(\d+))?/,er=t=>{const e=(t||"").replace(/\\/g,"/").split("?")[0],r=e.match(/[\/]?([\w\_\-]+)[.]?[\w]*[?]?$/),n=r?r[1]:"",o=e.lastIndexOf("/")+1,s=e.substring(o),i=s.lastIndexOf("."),a=s.substring(0,i)||"",u=i>=0?s.substring(i):"";return{route:e.substring(0,o)||"",page:n,name:s,withoutExtension:a,extname:u}},rr=t=>{const e={href:t,url:"",origin:"",protocol:"",host:"",port:"",query:""};if(!t)return e;const r=t.match(tr);if(!r||r.length<4)return e;const n=r[3]||"",o=t.split("?");return e.url=o[0],e.origin=r[0],e.protocol=`${r[1]}:`,e.host=`${r[2]}${n?":"+n:""}`,e.port=n,e.query=o.length>1?o[1]:"",e},nr=(t,e)=>{if(t===e)return!0;if(!t)return!1;if(!e)return!1;if("*"===e)return!0;const r=e.replace(/\./g,"\\.").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^"+r+"$").test(t)};var or={parse:Ve,stringify:function(t,{sep:e="&",eq:r="=",name:n=null,uri:o=!0,cleanZero:s=!1,cleanNull:i=!1,cleanWhitespace:a=!1}={}){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(n){const u=Je(Ge(n),o)+r,c=t[n];return Array.isArray(c)?c.map((function(t){return u+Je(Ge(t),o)})).join(e):Xe(c,{cleanZero:s,cleanNull:i,cleanWhitespace:a})?"":u+Je(Ge(c),o)})).filter(Boolean).join(e):n?Je(Ge(n),o)+r+Je(Ge(t),o):""},https:t=>t?t.replace(/^http[s]?/,"https"):t,parseUrl:t=>{const e=rr(t),{origin:r="",url:n="",query:o=""}=e,s=er(n),i=Ve(o,{multiple:!0,uri:!1});return{...e,...s,pathname:n.substring(n.indexOf(r||"")+r.length),params:i}},parsePath:er,parseHost:rr,join:(...t)=>{const e=[];let r=!1;return t.forEach((t=>{const n=t.trim();if(""===n)return;if(/^(\w+):\/\//.test(n))return e.length=0,e.push(n),void(r=!0);n.split("/").forEach((t=>{"."!==t&&""!==t&&(".."===t?e.length>0&&".."!==e[e.length-1]?e.pop():r||e.push(".."):e.push(t))}))})),e.join("/")},shExpMatch:nr,isLocalIpAddress:t=>!!t&&!!(nr(t,"127.0.0.1")||nr(t,"localhost")||nr(t,"192.168.*.*")),parseFileUrl:t=>{const e={href:t,file:"",url:"",protocol:"",host:"",query:"",params:{}};if(!t)return e;let r=t?t.replace(/\\/g,"/"):"";r.startsWith("file://")&&!r.startsWith("file:///")?r="file:///"+r.slice(7):r.startsWith("file:/")&&!r.startsWith("file:///")&&(r="file:///"+r.slice(6));const n=r.match(/^file:\/\/(?:([^\/\\]+))?(\/.*)?$/);if(!n||n.length<3)return e;e.protocol="file:";const o=n[1]||"",s=n[2]||"";e.host=o;const i=s.split("?");return e.url=e.protocol+`//${e.host}`+i[0],e.file=i[0],e.query=i.length>1?i[1]:"",e.params=Ve(e.query,{multiple:!0,uri:!1}),e}};const sr="0123456789",ir="abcdefghijklmnopqrstuvwxyz",ar="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var ur={keyNumber:sr,keyLower:ir,keyUpper:ar,keyChars:sr+ir+ar};const cr=(t=0,e=0)=>{const r=ur.keyChars.split(""),n=[];let o;if(e=e||r.length,t)for(o=0;o<t;o++)n[o]=r[0|Math.random()*e];else{let t;for(n[8]=n[13]=n[18]=n[23]="-",n[14]="4",o=0;o<36;o++)n[o]||(t=0|16*Math.random(),n[o]=r[19==o?3&t|8:t])}return n.join("")};class fr{__map;__tagList;__eventId="";constructor(){this.__map=new Map,this.__tagList=[],this.__eventId=cr()}clear(){return this.__map.clear(),this}on(t,e,r=""){if(!t||!e)return this;let n=this.__map.get(t);return n||(n=new Set,this.__map.set(t,n)),n.add(e),r&&this.__tagList.push({name:t,listener:e,tag:r}),this}emit(t,...e){if(!t)return this;const r=this.__map.get(t);if(!r)return this;return[...r].forEach((t=>t&&t(...e))),this}off(t,e){if(!t||!e)return this;this.__tagList=this.__tagList.filter((r=>r.name!==t||r.listener!==e));const r=this.__map.get(t);return r?(r.delete(e),r.size<=0&&this.__map.delete(t),this):this}remove(t){return t?(this.__tagList=this.__tagList.filter((e=>e.name!==t)),this.__map.delete(t),this):this}removeByTag(t){if(!t)return this;return this.__tagList.filter((e=>e.tag===t)).forEach((t=>{this.off(t.name,t.listener)})),this.__tagList=this.__tagList.filter((e=>e.tag!==t)),this}once(t,e){const r=(...n)=>{e(...n),this.off(t,r)};return this.on(t,r),this}has(t){return this.__map.has(t)}}class lr{_loopTimer;_event=new fr;started=!1;interval=0;constructor(t=0){this.interval=t||500}start(){return this.started||(this.stop(),this._loopTimer=setInterval((()=>{this._handleLoop()}),this.interval),this.started=!0),this}stop(){return this._loopTimer?(clearInterval(this._loopTimer),this._loopTimer=0,this.started=!1,this):this}restart(){return this.stop(),this.start(),this}on(t){return this._event.on("frame",t),this}off(t){return t?(this._event.off("frame",t),this):this}_handleLoop(){this._event.emit("frame")}}var hr={oneDay:864e5,oneHour:36e5,oneMinute:6e4,oneSecond:1e3};class dr{date;timestamp=0;yyyy=0;yy="";M=0;MM="";d=0;dd="";h=0;hh="";m=0;mm="";s=0;ss="";S=0;SS="";SSS="";constructor(t){if(!t)return;const e="string"==typeof t||"number"==typeof t?new Date(t):t;e&&(this.date=e,this.timestamp=e.getTime(),this.toDate())}toDate(){return this.date?(this.yyyy=this.date.getFullYear(),this.yy=`${this.yyyy}`.substr(2),this.M=this.date.getMonth()+1,this.MM=(this.M<10?"0":"")+this.M,this.d=this.date.getDate(),this.dd=(this.d<10?"0":"")+this.d,this.h=this.date.getHours(),this.hh=(this.h<10?"0":"")+this.h,this.m=this.date.getMinutes(),this.mm=(this.m<10?"0":"")+this.m,this.s=this.date.getSeconds(),this.ss=(this.s<10?"0":"")+this.s,this.S=this.date.getMilliseconds(),this.SS=(this.S<10?"0":"")+this.S,this.SSS=this.S.toString().padStart(3,"0"),this):this}toCountdown(t=""){const e={countdown:0,timestamp:0,seconds:0,d:0,dd:"",h:0,hh:"",m:0,mm:"",s:0,ss:"",S:0,SS:"",SSS:"",desc:""};if(!this.timestamp)return e;e.timestamp=this.timestamp,e.countdown=Math.max(e.timestamp-Date.now(),0),e.seconds=Math.floor(e.countdown/hr.oneSecond);let r=e.countdown;e.d=Math.floor(r/hr.oneDay),e.dd=(e.d<10?"0":"")+e.d,r%=hr.oneDay,e.h=Math.floor(r/hr.oneHour),e.hh=(e.h<10?"0":"")+e.h,r%=hr.oneHour,e.m=Math.floor(r/hr.oneMinute),e.mm=(e.m<10?"0":"")+e.m,r%=hr.oneMinute,e.s=Math.floor(r/hr.oneSecond),e.ss=(e.s<10?"0":"")+e.s,r%=hr.oneSecond,e.S=r,e.SS=(e.S<10?"0":"")+e.S,e.SSS=e.S.toString().padStart(3,"0");let n=t;return n||(n=e.countdown>hr.oneHour?"hh:mm:ss":e.countdown>hr.oneMinute?"mm:ss":"ss"),e.desc=n.replace(/\bdd|d|hh|h|mm|m|ss|s|SSS|SS|S\b/g,(t=>e[t])),e}add(t=0){return t?(this.timestamp=this.timestamp+t,this.date=new Date(this.timestamp),this.toDate(),this):this}format(t="yyyy-MM-dd hh:mm:ss"){return t.replace(/\byyyy|yy|MM|M|dd|d|hh|h|mm|m|ss|s|SSS|SS|S\b/g,(t=>this[t]))}static get timezoneOffset(){return(new Date).getTimezoneOffset()/60}static getLocalTime(t=0){const e=new Date,r=e.getTime(),n=6e4*e.getTimezoneOffset();return new Date(r+n+36e5*t)}}const pr=(t,e="yyyy-MM-dd hh:mm:ss")=>{const r="string"==typeof t||"number"==typeof t?new Date(t):t;return r?yr(r).format(e):""},yr=t=>{const e="string"==typeof t||"number"==typeof t?new Date(t):t;return new dr(e||0)};function gr({year:t=0,month:e=0,date:r=0,hour:n=0,minute:o=0,second:s=0}){const i=`${t||"yyyy"}/${e||"MM"}/${r||"dd"} ${n}:${o}:${s}`;return new Date(pr(Date.now(),i)).getTime()}var mr={...hr,now:function(){return yr(new Date)},isToday:t=>t&&(new Date).toDateString()===new Date(t).toDateString(),parseTimestamp:gr,todayZero:()=>gr({}),format:pr,countdown:(t,e="")=>{const r="string"==typeof t||"number"==typeof t?new Date(t):t;if(!r)return"";return yr(r).toCountdown(e)},dtime:yr,loopFrame:(t=500)=>new lr(t),getTimezoneOffset:()=>dr.timezoneOffset,getLocalTime:dr.getLocalTime};const br=t=>R.toBase64(t);var wr={encode:br,decode:t=>R.fromBase64(t),encodeByOss:t=>br(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")};var Ar={...ur,base64:wr,tea:Qt,uuid:cr,guid:(t,e=!1,r="")=>{const n=cr(t||32);return e?mr.now().format("yyyyMMddhhmmss")+r+n:n},getHexString:t=>{const e=ur.keyChars;let r="";const n=e.length;for(let o=0;o<t;o++)r+=e.charAt(Math.floor(Math.random()*n));return r}};const _r={...it,...Ar,...He,...Ne,...z,...Tt,qs:or};t.dHook=_r,Object.defineProperty(t,"__esModule",{value:!0})}));
|
package/bin/tiny/store.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import Store from '../class/store';
|
|
2
|
-
import Persist from '../class/persist';
|
|
3
|
-
declare const dStore: {
|
|
4
|
-
Store: typeof Store;
|
|
5
|
-
storeRef: (source: import("..").Ddan.IDStore, persistConfig?: import("..").Ddan.IDPersistConfig | undefined) => any;
|
|
6
|
-
Persist: typeof Persist;
|
|
7
|
-
persistConfig: (key: string, fields: string[], storage: import("..").Ddan.IStorage) => import("..").Ddan.IDPersistConfig;
|
|
8
|
-
};
|
|
9
|
-
export { dStore };
|