@gsc-basic/utils 1.4.1 → 1.4.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/dist/index.d.ts CHANGED
@@ -5,19 +5,19 @@ import ResizeObserver from "resize-observer-polyfill";
5
5
  import { Config } from "dompurify";
6
6
  import { MarkedExtension, MarkedOptions } from "marked";
7
7
  //#region src/core/string.d.ts
8
- declare function pascalCase(value: string): string;
8
+ export declare function pascalCase(value: string): string;
9
9
  /**
10
10
  * 在大多数情况下使用 lodash 的 `kebabCase`,
11
11
  * 但对包含数字的连续字母数字片段(例如 i18n、v2)保留为整体,避免被拆分为 i-18-n。
12
12
  * @param value 输入字符串
13
13
  * @returns 转换后的 kebab-case 字符串
14
14
  */
15
- declare function safeKebabCase(value?: string | null): string;
15
+ export declare function safeKebabCase(value?: string | null): string;
16
16
  //#endregion
17
17
  //#region src/core/common.d.ts
18
- declare const withInstall: (component: any, alias: string) => any;
19
- declare function getRawRoute(route: any): any;
20
- declare function openWindow(url: string, opt?: {
18
+ export declare const withInstall: (component: any, alias: string) => any;
19
+ export declare function getRawRoute(route: any): any;
20
+ export declare function openWindow(url: string, opt?: {
21
21
  target?: string;
22
22
  noopener?: boolean;
23
23
  noreferrer?: boolean;
@@ -34,7 +34,7 @@ declare function openWindow(url: string, opt?: {
34
34
  * - "replace": 用目标数组替换源数组。
35
35
  * @returns 合并后的对象。
36
36
  */
37
- declare function deepMerge(source: any, target: any, mergeArrays?: string): any;
37
+ export declare function deepMerge(source: any, target: any, mergeArrays?: string): any;
38
38
  /**
39
39
  * Add the object as a parameter to the URL
40
40
  * @param baseUrl url
@@ -45,12 +45,12 @@ declare function deepMerge(source: any, target: any, mergeArrays?: string): any;
45
45
  * setObjToUrlParams('www.baidu.com', obj)
46
46
  * ==>www.baidu.com?a=3&b=4&c=1,2
47
47
  */
48
- declare function setObjToUrlParams(baseUrl: string, obj: {
48
+ export declare function setObjToUrlParams(baseUrl: string, obj: {
49
49
  [x: string]: any;
50
50
  }): string;
51
- declare function unsetAllProperty(params: object): void;
52
- declare function createSearchReg(key: string): RegExp;
53
- declare function getActualWidthOfChars(text?: string, options?: {
51
+ export declare function unsetAllProperty(params: object): void;
52
+ export declare function createSearchReg(key: string): RegExp;
53
+ export declare function getActualWidthOfChars(text?: string, options?: {
54
54
  size?: number;
55
55
  family?: string;
56
56
  }): number;
@@ -69,9 +69,9 @@ type BEM = ReturnType<typeof createBEM>;
69
69
  * b('text', { disabled }) // 'button__text button__text--disabled'
70
70
  * b(['disabled', 'primary']) // 'button button--disabled button--primary'
71
71
  */
72
- declare function buildBEM(name: string): (el?: Mods, mods?: Mods) => string;
73
- declare function createBEM(name: string, prefixCls?: string): ((el?: Mods, mods?: Mods) => string)[];
74
- declare function createNamespace(name: string, prefixCls?: string): readonly [string, (el?: Mods, mods?: Mods) => string];
72
+ export declare function buildBEM(name: string): (el?: Mods, mods?: Mods) => string;
73
+ export declare function createBEM(name: string, prefixCls?: string): ((el?: Mods, mods?: Mods) => string)[];
74
+ export declare function createNamespace(name: string, prefixCls?: string): readonly [string, (el?: Mods, mods?: Mods) => string];
75
75
  //#endregion
76
76
  //#region src/core/cipher.d.ts
77
77
  interface AesGcmEncryptionParams {
@@ -84,14 +84,14 @@ interface Pbkdf2Params {
84
84
  iterations?: number;
85
85
  keyLength?: number;
86
86
  }
87
- declare function encodeBase64(value: string): string;
88
- declare function decodeBase64(value: string): string;
89
- declare function hashBySha256(value: string): string;
90
- declare function hashBySha512(value: string): string;
91
- declare function signByHmacSha256(value: string, key: string): string;
92
- declare function generateRandomKey(byteLength?: number): string;
93
- declare function deriveKeyByPbkdf2({ password, salt, iterations, keyLength }: Pbkdf2Params): Promise<string>;
94
- declare class AesGcmEncryption {
87
+ export declare function encodeBase64(value: string): string;
88
+ export declare function decodeBase64(value: string): string;
89
+ export declare function hashBySha256(value: string): string;
90
+ export declare function hashBySha512(value: string): string;
91
+ export declare function signByHmacSha256(value: string, key: string): string;
92
+ export declare function generateRandomKey(byteLength?: number): string;
93
+ export declare function deriveKeyByPbkdf2({ password, salt, iterations, keyLength }: Pbkdf2Params): Promise<string>;
94
+ export declare class AesGcmEncryption {
95
95
  private readonly key;
96
96
  private readonly additionalData?;
97
97
  constructor({ key, additionalData }: AesGcmEncryptionParams);
@@ -127,13 +127,13 @@ interface ViewportOffsetResult {
127
127
  */
128
128
  bottomIncludeBody: number;
129
129
  }
130
- declare function getBoundingClientRect(element: Element): DOMRect | number;
131
- declare function hasClass(el: HTMLElement, cls: string): boolean;
132
- declare function setCssVar(prop: string, val: string, dom: HTMLElement): {
130
+ export declare function getBoundingClientRect(element: Element): DOMRect | number;
131
+ export declare function hasClass(el: HTMLElement, cls: string): boolean;
132
+ export declare function setCssVar(prop: string, val: string, dom: HTMLElement): {
133
133
  prop: string;
134
134
  };
135
- declare function addClass(el: HTMLElement, cls: string): void;
136
- declare function removeClass(el: HTMLElement, cls: string): void;
135
+ export declare function addClass(el: HTMLElement, cls: string): void;
136
+ export declare function removeClass(el: HTMLElement, cls: string): void;
137
137
  /**
138
138
  * 获取当前元素的左上偏移
139
139
  * left:最左边的元素到文档左边的距离
@@ -143,21 +143,21 @@ declare function removeClass(el: HTMLElement, cls: string): void;
143
143
  * rightIncludeBody:文档最左边的元素到右边的距离
144
144
  * bottomIncludeBody:元素底部到文档底部的距离
145
145
  */
146
- declare function getViewportOffset(element: HTMLElement): ViewportOffsetResult | Record<string, number>;
147
- declare function hackCss(attr: string, value: any): any;
146
+ export declare function getViewportOffset(element: HTMLElement): ViewportOffsetResult | Record<string, number>;
147
+ export declare function hackCss(attr: string, value: any): any;
148
148
  type EventTarget = Element | HTMLElement | Document | Window;
149
149
  type EventListenerOrEventListenerObject = (evt: Event) => void | {
150
150
  handleEvent: (evt: Event) => void;
151
151
  };
152
152
  declare function on(element: EventTarget, event: string, handler: EventListenerOrEventListenerObject): void;
153
153
  declare function off(element: EventTarget, event: string, handler: EventListenerOrEventListenerObject): void;
154
- declare function useRafThrottle(fn: () => any): (...args: any[]) => void;
154
+ export declare function useRafThrottle(fn: () => any): (...args: any[]) => void;
155
155
  //#endregion
156
156
  //#region src/core/event.d.ts
157
- declare function addResizeListener(element: any, fn: () => any): void;
158
- declare function removeResizeListener(element: any, fn: () => any): void;
159
- declare function triggerWindowResize(): void;
160
- declare function addLocationListener(fn: () => void, options?: AddEventListenerOptions): {
157
+ export declare function addResizeListener(element: any, fn: () => any): void;
158
+ export declare function removeResizeListener(element: any, fn: () => any): void;
159
+ export declare function triggerWindowResize(): void;
160
+ export declare function addLocationListener(fn: () => void, options?: AddEventListenerOptions): {
161
161
  removeListener: () => void;
162
162
  };
163
163
  //#endregion
@@ -165,13 +165,13 @@ declare function addLocationListener(fn: () => void, options?: AddEventListenerO
165
165
  /**
166
166
  * @description: base64 to blob
167
167
  */
168
- declare function dataURLtoBlob(base64Buf: string): Blob;
168
+ export declare function dataURLtoBlob(base64Buf: string): Blob;
169
169
  /**
170
170
  * img url to base64
171
171
  * @param url
172
172
  */
173
- declare function urlToBase64(url: string, mineType?: string): Promise<string>;
174
- declare function downloadPercent(event: ProgressEvent): number;
173
+ export declare function urlToBase64(url: string, mineType?: string): Promise<string>;
174
+ export declare function downloadPercent(event: ProgressEvent): number;
175
175
  /**
176
176
  * Download online pictures
177
177
  * @param url
@@ -179,7 +179,7 @@ declare function downloadPercent(event: ProgressEvent): number;
179
179
  * @param mime
180
180
  * @param bom
181
181
  */
182
- declare function downloadByOnlineUrl(url: string, filename: string, mime?: string, bom?: BlobPart): void;
182
+ export declare function downloadByOnlineUrl(url: string, filename: string, mime?: string, bom?: BlobPart): void;
183
183
  /**
184
184
  * Download file based on base64
185
185
  * @param buf
@@ -187,7 +187,7 @@ declare function downloadByOnlineUrl(url: string, filename: string, mime?: strin
187
187
  * @param mime
188
188
  * @param bom
189
189
  */
190
- declare function downloadByBase64(buf: string, filename: string, mime?: string, bom?: BlobPart): void;
190
+ export declare function downloadByBase64(buf: string, filename: string, mime?: string, bom?: BlobPart): void;
191
191
  /**
192
192
  * Download according to the background interface file stream
193
193
  * @param {*} data
@@ -195,35 +195,35 @@ declare function downloadByBase64(buf: string, filename: string, mime?: string,
195
195
  * @param {*} mime
196
196
  * @param {*} bom
197
197
  */
198
- declare function downloadByData(data: BlobPart, filename: string, mime?: string, bom?: BlobPart): void;
198
+ export declare function downloadByData(data: BlobPart, filename: string, mime?: string, bom?: BlobPart): void;
199
199
  /**
200
200
  * Download file according to file address
201
201
  * @param {*} sUrl
202
202
  */
203
- declare function downloadByUrl({ url, target, fileName }: {
203
+ export declare function downloadByUrl({ url, target, fileName }: {
204
204
  url: string;
205
205
  target?: TargetContext;
206
206
  fileName?: string;
207
207
  }): boolean;
208
208
  //#endregion
209
209
  //#region src/core/is.d.ts
210
- declare function is(val: unknown, type: string): boolean;
211
- declare function isObject(val: any): boolean;
212
- declare function isUrl(path: string): boolean;
213
- declare function isIterableArray(val: any): boolean;
214
- declare function isPositiveInteger(num: any): boolean;
215
- declare function isNumeric(str: string): boolean;
216
- declare const isServer: boolean;
217
- declare const isClient: boolean;
218
- declare const isChrome: boolean;
219
- declare const isSafari: boolean;
220
- declare const isBrowser: boolean;
210
+ export declare function is(val: unknown, type: string): boolean;
211
+ export declare function isObject(val: any): boolean;
212
+ export declare function isUrl(path: string): boolean;
213
+ export declare function isIterableArray(val: any): boolean;
214
+ export declare function isPositiveInteger(num: any): boolean;
215
+ export declare function isNumeric(str: string): boolean;
216
+ export declare const isServer: boolean;
217
+ export declare const isClient: boolean;
218
+ export declare const isChrome: boolean;
219
+ export declare const isSafari: boolean;
220
+ export declare const isBrowser: boolean;
221
221
  /** Whether the environment support -webkit-line-clamp. */
222
- declare const isSupportNativeEllipsis: boolean;
222
+ export declare const isSupportNativeEllipsis: boolean;
223
223
  /** Whether the environment support ResizeObserver. */
224
- declare const isSupportResizeObserver: boolean;
225
- declare const isChineseText: (text: string) => boolean;
226
- declare const enableTransitions: () => boolean;
224
+ export declare const isSupportResizeObserver: boolean;
225
+ export declare const isChineseText: (text: string) => boolean;
226
+ export declare const enableTransitions: () => boolean;
227
227
  //#endregion
228
228
  //#region src/core/jsxHelper.d.ts
229
229
  interface InternalSlots {
@@ -232,13 +232,13 @@ interface InternalSlots {
232
232
  /**
233
233
  * @description: Get slot to prevent empty error
234
234
  */
235
- declare function getSlot(slots: Readonly<InternalSlots>, slot?: string, data?: any): any;
235
+ export declare function getSlot(slots: Readonly<InternalSlots>, slot?: string, data?: any): any;
236
236
  /**
237
237
  * extends slots
238
238
  * @param slots
239
239
  * @param excludeKeys
240
240
  */
241
- declare function extendSlots(slots: Readonly<InternalSlots>, excludeKeys?: string[]): any;
241
+ export declare function extendSlots(slots: Readonly<InternalSlots>, excludeKeys?: string[]): any;
242
242
  //#endregion
243
243
  //#region src/core/loadScript.d.ts
244
244
  declare function loadScript(src: string, { type }?: {
@@ -288,9 +288,9 @@ interface MatcherOptions {
288
288
  * @param {boolean} options.allPatterns 所有否定的模式不匹配,而任何正常模式至少匹配一次;否则,将视为不匹配条件
289
289
  * @returns an array of inputs filtered based on the patterns.
290
290
  */
291
- declare function matcher(inputs: string | string[], patterns: string | string[], options?: MatcherOptions): string[];
292
- declare function isMatch(inputs: string | string[], patterns: string | string[], options?: MatcherOptions): boolean;
293
- declare function escapeStringRegexp(value: string): string;
291
+ export declare function matcher(inputs: string | string[], patterns: string | string[], options?: MatcherOptions): string[];
292
+ export declare function isMatch(inputs: string | string[], patterns: string | string[], options?: MatcherOptions): boolean;
293
+ export declare function escapeStringRegexp(value: string): string;
294
294
  //#endregion
295
295
  //#region src/core/markdown.d.ts
296
296
  interface MarkdownHighlightOptions {
@@ -343,7 +343,7 @@ interface MarkdownRenderOptions {
343
343
  * });
344
344
  * ```
345
345
  */
346
- declare function renderMarkdown(text: string, options?: MarkdownRenderOptions): string;
346
+ export declare function renderMarkdown(text: string, options?: MarkdownRenderOptions): string;
347
347
  /**
348
348
  * 创建可复用的 Markdown 渲染器。
349
349
  * 适合在组件中多次调用时避免重复创建 Marked 实例。
@@ -362,7 +362,7 @@ declare function renderMarkdown(text: string, options?: MarkdownRenderOptions):
362
362
  * element.innerHTML = md.render(message2);
363
363
  * ```
364
364
  */
365
- declare function createMarkdownRenderer(options?: MarkdownRenderOptions): {
365
+ export declare function createMarkdownRenderer(options?: MarkdownRenderOptions): {
366
366
  render(text: string, overrideOptions?: MarkdownRenderOptions): string;
367
367
  };
368
368
  /**
@@ -380,10 +380,10 @@ declare function createMarkdownRenderer(options?: MarkdownRenderOptions): {
380
380
  * // => 'Hello bold text'
381
381
  * ```
382
382
  */
383
- declare function stripMarkdown(text: string): string;
383
+ export declare function stripMarkdown(text: string): string;
384
384
  //#endregion
385
385
  //#region src/core/regexp.d.ts
386
- declare const regexpMap: {
386
+ export declare const regexpMap: {
387
387
  mobile: RegExp;
388
388
  tel: RegExp;
389
389
  numAndLetter: RegExp;
@@ -413,25 +413,25 @@ interface TreeHelperConfig {
413
413
  children: string;
414
414
  pid: string;
415
415
  }
416
- declare function findNode<T = any>(tree: any, func: Fn, config?: Partial<TreeHelperConfig>): T | null;
417
- declare function findNodeAll<T = any>(tree: any, func: Fn, config?: Partial<TreeHelperConfig>): T[];
418
- declare function findPath<T = any>(tree: any, func: Fn, config?: Partial<TreeHelperConfig>): T | T[] | null;
419
- declare function findPathAll(tree: any, func: Fn, config?: Partial<TreeHelperConfig>): any[][];
416
+ export declare function findNode<T = any>(tree: any, func: Fn, config?: Partial<TreeHelperConfig>): T | null;
417
+ export declare function findNodeAll<T = any>(tree: any, func: Fn, config?: Partial<TreeHelperConfig>): T[];
418
+ export declare function findPath<T = any>(tree: any, func: Fn, config?: Partial<TreeHelperConfig>): T | T[] | null;
419
+ export declare function findPathAll(tree: any, func: Fn, config?: Partial<TreeHelperConfig>): any[][];
420
420
  declare function filter<T = any>(tree: T[], func: (n: T) => boolean, config?: Partial<TreeHelperConfig>): T[];
421
421
  declare function forEach<T = any>(tree: T[], func: (n: T) => any, config?: Partial<TreeHelperConfig>): void;
422
- declare function treeMap<T = any>(treeData: T[], opt: {
422
+ export declare function treeMap<T = any>(treeData: T[], opt: {
423
423
  children?: string;
424
424
  conversion: Fn;
425
425
  }): T[];
426
- declare function treeMapEach(data: any, { children, conversion }: {
426
+ export declare function treeMapEach(data: any, { children, conversion }: {
427
427
  children?: string;
428
428
  conversion: Fn;
429
429
  }): any;
430
430
  //#endregion
431
431
  //#region src/core/uuid.d.ts
432
- declare function buildUUID({ native }?: {
432
+ export declare function buildUUID({ native }?: {
433
433
  native?: boolean | undefined;
434
434
  }): string;
435
- declare function buildShortUUID(prefix?: string): string;
435
+ export declare function buildShortUUID(prefix?: string): string;
436
436
  //#endregion
437
- export { AesGcmEncryption, type AesGcmEncryptionParams, type BEM, type MarkdownHighlightOptions, type MarkdownRenderOptions, type Pbkdf2Params, ResizeObserver, addClass, addLocationListener, addResizeListener, buildBEM, buildShortUUID, buildUUID, createBEM, createMarkdownRenderer, createNamespace, createSearchReg, dataURLtoBlob, decodeBase64, deepMerge, deriveKeyByPbkdf2, off as domOffEvent, on as domOnEvent, downloadByBase64, downloadByData, downloadByOnlineUrl, downloadByUrl, downloadPercent, enableTransitions, encodeBase64, escapeStringRegexp, extendSlots, filter as filterTree, findNode, findNodeAll, findPath, findPathAll, forEach as forEachTree, generateRandomKey, getActualWidthOfChars, getBoundingClientRect, getRawRoute, getSlot, getViewportOffset, hackCss, hasClass, hashBySha256, hashBySha512, is, isBrowser, isChineseText, isChrome, isClient, isIterableArray, isMatch, isNumeric, isObject, isPositiveInteger, isSafari, isServer, isSupportNativeEllipsis, isSupportResizeObserver, isUrl, loadScript, matcher, openWindow, pascalCase, pathToRegexp, regexpMap, regexpToPath, removeClass, removeResizeListener, renderMarkdown, safeKebabCase, setCssVar, setObjToUrlParams, signByHmacSha256, stripMarkdown, titleCase, treeMap, treeMapEach, triggerWindowResize, unloadScript, unsetAllProperty, urlToBase64, useRafThrottle, withInstall };
437
+ export { type AesGcmEncryptionParams, type BEM, type MarkdownHighlightOptions, type MarkdownRenderOptions, type Pbkdf2Params, ResizeObserver, off as domOffEvent, on as domOnEvent, filter as filterTree, forEach as forEachTree, loadScript, pathToRegexp, regexpToPath, titleCase, unloadScript };
package/dist/index.js CHANGED
@@ -7,8 +7,8 @@ You shall not disclose such Confidential Information and shall use it only in
7
7
  accordance with the terms of the license agreement.
8
8
 
9
9
  --- Build Info ---
10
- Version: 1.4.0
11
- Build Time: 2026/8/11 15:54:40
12
- Build Commit: c255b74724ff9f2c34f4c4465088f1d72894ca44
10
+ Version: 1.4.1
11
+ Build Time: 2026/9/7 10:27:08
12
+ Build Commit: 6c6576331d6ac4b02ae9149236b3d981dd041ae7
13
13
  */
14
- import{titleCase as e}from"title-case";import{camelCase as t,intersectionWith as n,isArray as r,isEqual as i,isFunction as a,isNil as o,isPlainObject as s,kebabCase as c,mergeWith as l,round as u,unionWith as d,upperFirst as f}from"lodash-es";import{compile as p,pathToRegexp as ee}from"path-to-regexp";import{hmac as m}from"@noble/hashes/hmac.js";import{sha256 as h,sha512 as g}from"@noble/hashes/sha2.js";import{bytesToHex as _,utf8ToBytes as v}from"@noble/hashes/utils.js";import y from"resize-observer-polyfill";import b from"dompurify";import{Marked as x}from"marked";import{markedHighlight as S}from"marked-highlight";import{gfmHeadingId as te}from"marked-gfm-heading-id";import ne from"marked-alert";import{markedSmartypants as re}from"marked-smartypants";import C from"highlight.js/lib/core";import ie from"highlight.js/lib/languages/bash";import ae from"highlight.js/lib/languages/c";import oe from"highlight.js/lib/languages/cpp";import se from"highlight.js/lib/languages/css";import ce from"highlight.js/lib/languages/go";import le from"highlight.js/lib/languages/java";import ue from"highlight.js/lib/languages/javascript";import de from"highlight.js/lib/languages/json";import fe from"highlight.js/lib/languages/markdown";import pe from"highlight.js/lib/languages/php";import me from"highlight.js/lib/languages/plaintext";import he from"highlight.js/lib/languages/python";import ge from"highlight.js/lib/languages/rust";import _e from"highlight.js/lib/languages/scss";import ve from"highlight.js/lib/languages/sql";import ye from"highlight.js/lib/languages/typescript";import w from"highlight.js/lib/languages/xml";import be from"highlight.js/lib/languages/yaml";import{v4 as T}from"uuid";function xe(e){return f(t(e))}function Se(e){if(!e)return``;let t=c(e),n=e.replace(/[^A-Z0-9]/gi,``);if(n.length===t.replace(/-/g,``).length){let e=0,r=``;for(let i=0;i<t.length;i+=1){let a=t[i];if(a===`-`){let o=t[i-1],s=t[i+1],c=n[e],l=c&&c.toUpperCase()===c&&c.toLowerCase()!==c,u=i+1===t.length-1;if(o&&s&&/[a-z0-9]/.test(o)&&/[a-z0-9]/.test(s)&&(!/\d/.test(o)&&/\d/.test(s)||/\d/.test(o)&&!/\d/.test(s)&&!l||/\d/.test(o)&&!/\d/.test(s)&&l&&u))continue;r+=a}else r+=a,e+=1}t=r}return t}const E={mobile:/^(?:(?:\+|00)86)?1[3-9]\d{9}$/,tel:/^(?:(?:\d{3}-)?\d{8}|(?:\d{4}-)?\d{7,8})(?:-\d+)?$/,numAndLetter:/^[A-Z0-9]+$/i,password:/^\S*(?=\S{6,})(?=\S*\d)(?=\S*[A-Z])(?=\S*[a-z])(?=\S*[!@#$%^&*? ])\S+$/,email:/^[A-Z0-9._%+-\u4E00-\u9FA5]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,postalCode:/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/,identityCard:/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[12]\d|30|31)\d{3}[\dX]$/i,ip:/^((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(?::(?:\d|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5]))?$/,url:/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-][^!@#$%^&*?.\s]{0,64}\.)+[a-z]{2,6}\/?/,httpsUrl:/^https:\/\//,domain:/^([0-9a-z-]+\.)+([a-z]{2,})$/i,plateNumber:/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$/,md5:/^[a-f0-9]{32}$/i,base64:/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([\w!$&',()*+;=\-.~:@/?%\s]*?)\s*$/i,uuid:/^[a-f\d]{4}(?:[a-f\d]{4}-){4}[a-f\d]{12}$/i,version:/^\d+(?:\.\d+){2}$/,videoUrl:/^https?:\/\/(.+\/)+.+(\.(swf|avi|flv|mpg|rm|mov|wav|asf|3gp|mkv|rmvb|mp4))$/i,imageUrl:/^https?:\/\/(.+\/)+.+(\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i,chinese:/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/,itcode:/^[a-z]+\d*$/i,numeric:/^\d+$/},Ce=Object.prototype.toString;function D(e,t){return Ce.call(e)===`[object ${t}]`}function O(e){return e!==null&&D(e,`Object`)}function we(e){return E.url.test(e)}function k(e){return Array.isArray(e)&&e.length>0}function Te(e){return Number.isInteger(e)&&e>=0}function Ee(e){return E.numeric.test(e)}const A=typeof window>`u`,j=!A,M=j&&window.navigator.userAgent.toLowerCase().includes(`chrome`),N=j&&window.navigator.userAgent.toLowerCase().includes(`safari`),P=typeof window<`u`&&typeof document<`u`,De=P&&`webkitLineClamp`in document.body.style,Oe=P&&typeof ResizeObserver<`u`,ke=e=>E.chinese.test(e),Ae=()=>`startViewTransition`in document&&window.matchMedia(`(prefers-reduced-motion: no-preference)`).matches;function je(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function Me(e,t){if(e==null)return{};var n,r,i=je(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function F(e){"@babel/helpers - typeof";return F=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},F(e)}function Ne(e,t){if(F(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(F(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Pe(e){var t=Ne(e,`string`);return F(t)==`symbol`?t:t+``}function I(e,t,n){return(t=Pe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Fe(Object(n),!0).forEach(function(t){I(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Ie=[`matched`],Le=(e,t)=>{let n=e;return n.install=r=>{r.component(n.name||n.displayName,e),t&&(r.config.globalProperties[t]=e)},e};function Re(e){if(!e)return e;let{matched:t}=e;return L(L({},Me(e,Ie)),{},{matched:t?t.map(e=>({meta:e.meta,name:e.name,path:e.path})):void 0})}function ze(e,t={}){let{target:n=`__blank`,noopener:r=!0,noreferrer:i=!0}=t||{},a=[];r&&a.push(`noopener=yes`),i&&a.push(`noreferrer=yes`),window.open(e,n,a.join(`,`))}function Be(e,t,a=`replace`){return t?e?l(e,t,(e,t)=>{if(r(t)&&r(e))switch(a){case`union`:return d(e,t,i);case`intersection`:return n(e,t,i);case`concat`:return e.concat(t);case`replace`:return t;default:throw Error(`Unknown merge array strategy: ${a}`)}if(O(t)&&O(e))return Be(e,t,a)}):t:e}function Ve(e,t){if(!k(Object.keys(t)))return e;let n=``;for(let e in t){let r=t[e];n+=Array.isArray(r)?`${e}=${encodeURIComponent(r.join(`,`))}&`:`${e}=${encodeURIComponent(r)}&`}return n=n.replace(/&$/,``),/\?$/.test(e)?e+n:e.replace(/\/?$/,`?`)+n}function He(e){s(e)&&Object.keys(e).forEach(t=>{Reflect.deleteProperty(e,t)})}function Ue(e){return[`$`,`(`,`)`,`*`,`+`,`.`,`[`,`]`,`?`,`\\`,`^`,`{`,`}`,`|`].includes(e)?`\\${e}`:e}function We(e){let t=[``,...[...e].map(e=>Ue(e)),``].join(`.*`);return new RegExp(t,`i`)}function Ge(e=``,t={}){let{size:n=14,family:r=getComputedStyle(document.documentElement).getPropertyValue(`--vxe-font-family`)||`sans-serif`}=t,i=document.createElement(`canvas`).getContext(`2d`);i.font=`${n}px ${r}`;let a=i.measureText(e),o=Math.abs(a.actualBoundingBoxLeft)+Math.abs(a.actualBoundingBoxRight);return Math.ceil(Math.max(a.width,o))}function R(e,t){return t?typeof t==`string`?` ${e}--${t}`:Array.isArray(t)?t.reduce((t,n)=>t+R(e,n),``):Object.keys(t).reduce((n,r)=>n+(t[r]?R(e,r):``),``):``}function z(e){return(t,n)=>(t&&typeof t!=`string`&&(n=t,t=``),t=t?`${e}__${t}`:e,`${t}${R(t,n)}`)}function Ke(e,t=``){return[z(`${t}-${e}`)]}function qe(e,t=``){let n=`${t}-${e}`;return[n,z(n)]}function B(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function V(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){B(a,r,i,o,s,`next`,e)}function s(e){B(a,r,i,o,s,`throw`,e)}o(void 0)})}}const H=new TextEncoder,Je=new TextDecoder;function U(){var e;if(!((e=window.crypto)!=null&&e.subtle))throw Error(`Web Crypto API is not available in the current environment.`);return window.crypto}function W(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n)t+=String.fromCharCode(...e.subarray(r,r+n));return btoa(t)}function Ye(e){let t=atob(e);return Uint8Array.from(t,e=>e.charCodeAt(0))}function Xe(e){return W(H.encode(e))}function Ze(e){return Je.decode(Ye(e))}function Qe(e){return _(h(v(e)))}function $e(e){return _(g(v(e)))}function et(e,t){return _(m(h,v(t),v(e)))}function tt(e=32){if(!Number.isSafeInteger(e)||e<=0||e>65536)throw Error(`The key byte length must be an integer between 1 and 65536.`);return W(U().getRandomValues(new Uint8Array(e)))}function nt(e){return G.apply(this,arguments)}function G(){return G=V(function*({password:e,salt:t,iterations:n=6e5,keyLength:r=32}){if(!Number.isSafeInteger(n)||n<=0)throw Error(`PBKDF2 iterations must be a positive integer.`);if(!Number.isSafeInteger(r)||r<=0)throw Error(`The derived key length must be a positive integer.`);let i=U(),a=yield i.subtle.importKey(`raw`,H.encode(e),`PBKDF2`,!1,[`deriveBits`]),o=yield i.subtle.deriveBits({name:`PBKDF2`,hash:`SHA-256`,salt:H.encode(t),iterations:n},a,r*8);return W(new Uint8Array(o))}),G.apply(this,arguments)}var rt=class{constructor({key:e,additionalData:t}){I(this,`key`,void 0),I(this,`additionalData`,void 0),this.key=e,this.additionalData=t?H.encode(t):void 0}encrypt(e){var t=this;return V(function*(){let n=U(),r=n.getRandomValues(new Uint8Array(12)),i=yield n.subtle.encrypt(L({name:`AES-GCM`,iv:r},t.additionalData?{additionalData:t.additionalData}:{}),yield t.getKey(),H.encode(e)),a=new Uint8Array(i),o=new Uint8Array(12+a.length);return o.set(r),o.set(a,12),W(o)})()}decrypt(e){var t=this;return V(function*(){let n=Ye(e);if(n.length<=12)throw Error(`The AES-GCM payload is invalid.`);let r=yield U().subtle.decrypt(L({name:`AES-GCM`,iv:n.slice(0,12)},t.additionalData?{additionalData:t.additionalData}:{}),yield t.getKey(),n.slice(12));return Je.decode(r)})()}getKey(){var e=this;return V(function*(){return U().subtle.importKey(`raw`,h(v(e.key)),`AES-GCM`,!1,[`encrypt`,`decrypt`])})()}};const it=()=>document.documentElement;function at(e){return!e||!e.getBoundingClientRect?0:e.getBoundingClientRect()}function ot(e){return(e||``).replace(/^\s+|\s+$/g,``)}function K(e,t){if(!e||!t)return!1;if(t.includes(` `))throw Error(`className should not contain space.`);return e.classList?e.classList.contains(t):` ${e.className} `.includes(` ${t} `)}function st(e,t,n){return n||(n=it()),n.style.setProperty(e,t),{prop:t}}function ct(e,t){if(!e)return;let n=e.className,r=(t||``).split(` `);for(let t=0,i=r.length;t<i;t++){let i=r[t];i&&(e.classList?e.classList.add(i):K(e,i)||(n+=` ${i}`))}e.classList||(e.className=n)}function lt(e,t){if(!e||!t)return;let n=t.split(` `),r=` ${e.className} `;for(let t=0,i=n.length;t<i;t++){let i=n[t];i&&(e.classList?e.classList.remove(i):K(e,i)&&(r=r.replace(` ${i} `,` `)))}e.classList||(e.className=ot(r))}function ut(e){let t=document.documentElement,n=t.scrollLeft,r=t.scrollTop,i=t.clientLeft,a=t.clientTop,o=window.scrollX,s=window.scrollY,c=at(e);if(!c)return{};let{left:l,top:u,width:d,height:f}=c,p=(o||n)-(i||0),ee=(s||r)-(a||0),m=l+o,h=u+s,g=m-p,_=h-ee,v=window.document.documentElement.clientWidth,y=window.document.documentElement.clientHeight;return{left:g,top:_,right:v-d-g,bottom:y-f-_,rightIncludeBody:v-g,bottomIncludeBody:y-_}}function dt(e,t){let n=[`webkit`,`Moz`,`ms`,`OT`],r={};return n.forEach(n=>{r[`${n}${f(e)}`]=t}),L(L({},r),{},{[e]:t})}function ft(e,t,n){e&&t&&n&&e.addEventListener(t,n,!1)}function pt(e,t,n){e&&t&&n&&e.removeEventListener(t,n,!1)}function mt(e){let t=!1;return function(...n){t||(t=!0,window.requestAnimationFrame(()=>{e.apply(this,n),t=!1}))}}function ht(e){for(let t of e){let e=t.target.__resizeListeners__||[];e.length&&e.forEach(e=>{e()})}}function gt(e,t){A||(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new y(ht),e.__ro__.observe(e)),e.__resizeListeners__.push(t))}function _t(e,t){!e||!e.__resizeListeners__||(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||(e.__ro__.disconnect(),e.__ro__=null,e.__resizeListeners__=null))}function vt(){let e=new Event(`resize`,{bubbles:!0,cancelable:!0});window.dispatchEvent(e)}function yt(e,t={}){function n(e){let t=window.history[e];return function(...n){let r=new Event(e);return r.arguments=n,window.dispatchEvent(r),t.apply(this,n)}}return window.history.pushState=n(`pushState`),window.history.replaceState=n(`replaceState`),window.addEventListener(`popstate`,e,t),window.addEventListener(`hashchange`,e,t),window.addEventListener(`replaceState`,e,t),window.addEventListener(`pushState`,e,t),{removeListener:()=>{window.removeEventListener(`popstate`,e,t),window.removeEventListener(`hashchange`,e,t),window.removeEventListener(`replaceState`,e,t),window.removeEventListener(`pushState`,e,t)}}}function bt(e){let t=e.split(`,`),n=t[0].match(/:(.*?);/)[1],r=window.atob(t[1]),i=r.length,a=new Uint8Array(i);for(;i--;)a[i]=r.charCodeAt(i);return new Blob([a],{type:n})}function xt(e,t){return new Promise((n,r)=>{let i=document.createElement(`CANVAS`),a=i==null?void 0:i.getContext(`2d`),o=new Image;o.crossOrigin=``,o.onload=function(){if(!i||!a)return r();i.height=o.height,i.width=o.width,a.drawImage(o,0,0);let e=i.toDataURL(t||`image/png`);i=null,n(e)},o.src=e})}function St(e){let{loaded:t,total:n}=e;if(n<=0||o(n))return 0;let r=t/n;return u((r>1?1:r)*100)}function Ct(e,t,n,r){xt(e).then(e=>{wt(e,t,n,r)})}function wt(e,t,n,r){Tt(bt(e),t,n,r)}function Tt(e,t,n,r){let i=new Blob(r===void 0?[e]:[r,e],{type:n||`application/octet-stream`}),a=window.URL.createObjectURL(i),o=document.createElement(`a`);o.style.display=`none`,o.href=a,o.setAttribute(`download`,t),o.download===void 0&&o.setAttribute(`target`,`_blank`),document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(a)}function Et({url:e,target:t=`_blank`,fileName:n}){if(/iP/.test(window.navigator.userAgent))return!1;if(M||N){let t=document.createElement(`a`);return t.href=e,t.download=n||e.substring(e.lastIndexOf(`/`)+1,e.length),t.style.display=`none`,document.body.appendChild(t),t.click(),document.body.removeChild(t),!0}return e.includes(`?`)||(e+=`?download`),ze(e,{target:t}),!0}function Dt(e,t=`default`,n){if(!e||!Reflect.has(e,t)||!a(e[t]))return null;let r=e[t];return r?r(n):null}function Ot(e,t=[]){let n=Object.keys(e),r={};return n.forEach(n=>{if(t.includes(n))return null;r[n]=t=>Dt(e,n,t)}),r}function kt(e,{type:t=`text/javascript`}={}){return new Promise((n,r)=>{let i=!1,a=document.querySelector(`script[src="${e}"]`);if(!a)a=document.createElement(`script`),a.type=t,a.async=!0,a.src=e,i=!0;else if(a.hasAttribute(`data-loaded`)){n({el:a});return}a.addEventListener(`error`,r),a.addEventListener(`abort`,r),a.addEventListener(`load`,()=>{a.setAttribute(`data-loaded`,`true`),n({el:a})}),i&&document.head.appendChild(a)})}function At(e){return new Promise((t,n)=>{let r=document.querySelector(`script[src="${e}"]`);if(!r){n();return}document.head.removeChild(r),t()})}function jt(e,t,n){return It(e,t,n,!1)}function Mt(e,t,n){return It(e,t,n,!0).length>0}function Nt(e){return typeof e==`string`?e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`):e}const q=new Map;function Pt(e,t){if(!Array.isArray(e))switch(typeof e){case`string`:e=[e];break;case`undefined`:e=[];break;default:throw TypeError(`Expected '${t}' to be a string or an array, but got a type of '${typeof e}'`)}return e.filter(e=>{if(typeof e!=`string`){if(e===void 0)return!1;throw TypeError(`Expected '${t}' to be an array of strings, but found a type of '${typeof e}' in the array`)}return!0})}function Ft(e,t){t=L({caseSensitive:!1},t);let n=e+JSON.stringify(t);if(q.has(n))return q.get(n);let r=e[0]===`!`;r&&(e=e.slice(1)),e=Nt(e).replace(/\\\*/g,`[\\s\\S]*`);let i=RegExp(`^${e}$`,t.caseSensitive?``:`i`);return i.negated=r,q.set(n,i),i}function It(e,t,n,r){if(e=Pt(e,`inputs`),t=Pt(t,`patterns`),t.length===0)return[];let i=t.map(e=>Ft(e,n)),{allPatterns:a}=n||{},o=[];for(let t of e){let e,n=i.map(()=>!1);for(let[r,a]of i.entries())if(a.test(t)&&(n[r]=!0,e=!a.negated,!e))break;if(!(e===!1||e===void 0&&i.some(e=>!e.negated)||a&&n.some((e,t)=>!e&&!i[t].negated))&&(o.push(t),r))break}return o}C.registerLanguage(`bash`,ie),C.registerLanguage(`c`,ae),C.registerLanguage(`cpp`,oe),C.registerLanguage(`css`,se),C.registerLanguage(`go`,ce),C.registerLanguage(`java`,le),C.registerLanguage(`javascript`,ue),C.registerLanguage(`json`,de),C.registerLanguage(`markdown`,fe),C.registerLanguage(`php`,pe),C.registerLanguage(`plaintext`,me),C.registerLanguage(`python`,he),C.registerLanguage(`rust`,ge),C.registerLanguage(`scss`,_e),C.registerLanguage(`sql`,ve),C.registerLanguage(`typescript`,ye),C.registerLanguage(`xml`,w),C.registerLanguage(`html`,w),C.registerLanguage(`yaml`,be);const Lt={walkTokens(e){e.type===`text`&&(e.text=e.text.replace(/([\u2E80-\u2EFF\u3000-\u303F\u31C0-\u31EF\u3200-\u32FF\u3300-\u33FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF\uFE30-\uFE4F])\r?\n([\u2E80-\u2EFF\u3000-\u303F\u31C0-\u31EF\u3200-\u32FF\u3300-\u33FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF\uFE30-\uFE4F])/g,`$1$2`))}},Rt={breaks:!0,gfm:!0},zt={FORBID_TAGS:[`style`],FORBID_ATTR:[`style`]};function Bt(e,t){let n=C.getLanguage(t)?t:`plaintext`;return C.highlight(e,{language:n}).value}const J=S({langPrefix:`hljs-`,highlight:Bt}),Y=[te(),Lt,ne(),re(),J];function X(e){if((e==null?void 0:e.highlight)===!1&&!(e!=null&&e.extensions))return Y.filter(e=>e!==J);if((e==null?void 0:e.highlight)===!1)return[...Y.filter(e=>e!==J),...e.extensions||[]];if(e!=null&&e.highlight){let{langPrefix:t=`language-`,highlight:n}=e.highlight,r=S({langPrefix:t,highlight:n}),i=[...Y.filter(e=>e!==J),r];return e.extensions&&i.push(...e.extensions),i}let t=[...Y];return e!=null&&e.extensions&&t.push(...e.extensions),t}function Vt(e,t){if(!e)return``;let n=X(t),r=new x;r.use(...n);let i=r.parse(e,L(L({},Rt),t==null?void 0:t.marked));return b.sanitize(i,L(L({},zt),t==null?void 0:t.sanitize))}function Ht(e){let t=L(L({},Rt),e==null?void 0:e.marked),n=L(L({},zt),e==null?void 0:e.sanitize),r=X(e),i=new x;return i.use(...r),{render(e,r){if(!e)return``;let a=r!=null&&r.marked||(r==null?void 0:r.highlight)!==void 0||r!=null&&r.extensions?(()=>{let n=X(r),i=new x;return i.use(...n),i.parse(e,L(L({},t),r.marked))})():i.parse(e,t),o=r!=null&&r.sanitize?L(L({},n),r.sanitize):n;return b.sanitize(a,o)}}}function Ut(e){if(!e)return``;let t=Vt(e);return typeof DOMParser<`u`?new DOMParser().parseFromString(t,`text/html`).body.textContent||``:t.replace(/<[^>]*>/g,``)}const Wt={id:`id`,children:`children`,pid:`pid`},Z=e=>Object.assign({},Wt,e);function Gt(e,t,n={}){n=Z(n);let{children:r}=n,i=[...e];for(let e of i){if(t(e))return e;e[r]&&i.push(...e[r])}return null}function Kt(e,t,n={}){n=Z(n);let{children:r}=n,i=[...e],a=[];for(let e of i)t(e)&&a.push(e),e[r]&&i.push(...e[r]);return a}function qt(e,t,n={}){n=Z(n);let r=[],i=[...e],a=new Set,{children:o}=n;for(;i.length;){let e=i[0];if(a.has(e))r.pop(),i.shift();else if(a.add(e),e[o]&&i.unshift(...e[o]),r.push(e),t(e))return r}return null}function Jt(e,t,n={}){n=Z(n);let r=[],i=[...e],a=[],o=new Set,{children:s}=n;for(;i.length;){let e=i[0];o.has(e)?(r.pop(),i.shift()):(o.add(e),e[s]&&i.unshift(...e[s]),r.push(e),t(e)&&a.push([...r]))}return a}function Yt(e,t,n={}){n=Z(n);let r=n.children;function i(e){return e.map(e=>L({},e)).filter(e=>(e[r]=e[r]&&i(e[r]),t(e)||e[r]&&e[r].length))}return i(e)}function Xt(e,t,n={}){n=Z(n);let r=[...e],{children:i}=n;for(let e=0;e<r.length;e++){if(t(r[e]))return;i&&r[e][i]&&r.splice(e+1,0,...r[e][i])}}function Zt(e,t){return e.map(e=>Q(e,t))}function Q(e,{children:t=`children`,conversion:n}){let r=Array.isArray(e[t])&&e[t].length>0,i=n(e)||{};return r?L(L({},i),{},{[t]:e[t].map(e=>Q(e,{children:t,conversion:n}))}):L({},i)}function Qt({native:e=!0}={}){var t,n,r;return e?(t=(n=window.crypto)==null||(r=n.randomUUID)==null?void 0:r.call(n))==null?T():t:T()}let $=0;function $t(e=``){let t=Date.now(),n=Math.floor(Math.random()*1e9);return $++,`${e}_${n}${$}${String(t)}`}export{rt as AesGcmEncryption,y as ResizeObserver,ct as addClass,yt as addLocationListener,gt as addResizeListener,z as buildBEM,$t as buildShortUUID,Qt as buildUUID,Ke as createBEM,Ht as createMarkdownRenderer,qe as createNamespace,We as createSearchReg,bt as dataURLtoBlob,Ze as decodeBase64,Be as deepMerge,nt as deriveKeyByPbkdf2,pt as domOffEvent,ft as domOnEvent,wt as downloadByBase64,Tt as downloadByData,Ct as downloadByOnlineUrl,Et as downloadByUrl,St as downloadPercent,Ae as enableTransitions,Xe as encodeBase64,Nt as escapeStringRegexp,Ot as extendSlots,Yt as filterTree,Gt as findNode,Kt as findNodeAll,qt as findPath,Jt as findPathAll,Xt as forEachTree,tt as generateRandomKey,Ge as getActualWidthOfChars,at as getBoundingClientRect,Re as getRawRoute,Dt as getSlot,ut as getViewportOffset,dt as hackCss,K as hasClass,Qe as hashBySha256,$e as hashBySha512,D as is,P as isBrowser,ke as isChineseText,M as isChrome,j as isClient,k as isIterableArray,Mt as isMatch,Ee as isNumeric,O as isObject,Te as isPositiveInteger,N as isSafari,A as isServer,De as isSupportNativeEllipsis,Oe as isSupportResizeObserver,we as isUrl,kt as loadScript,jt as matcher,ze as openWindow,xe as pascalCase,ee as pathToRegexp,E as regexpMap,p as regexpToPath,lt as removeClass,_t as removeResizeListener,Vt as renderMarkdown,Se as safeKebabCase,st as setCssVar,Ve as setObjToUrlParams,et as signByHmacSha256,Ut as stripMarkdown,e as titleCase,Zt as treeMap,Q as treeMapEach,vt as triggerWindowResize,At as unloadScript,He as unsetAllProperty,xt as urlToBase64,mt as useRafThrottle,Le as withInstall};
14
+ import{titleCase as e}from"title-case";import{camelCase as t,intersectionWith as n,isArray as r,isEqual as i,isFunction as a,isNil as o,isPlainObject as s,kebabCase as c,mergeWith as l,round as u,unionWith as d,upperFirst as f}from"lodash-es";import{compile as p,pathToRegexp as ee}from"path-to-regexp";import{hmac as m}from"@noble/hashes/hmac.js";import{sha256 as h,sha512 as g}from"@noble/hashes/sha2.js";import{bytesToHex as _,utf8ToBytes as v}from"@noble/hashes/utils.js";import y from"resize-observer-polyfill";import b from"dompurify";import{Marked as x}from"marked";import{markedHighlight as S}from"marked-highlight";import{gfmHeadingId as te}from"marked-gfm-heading-id";import ne from"marked-alert";import{markedSmartypants as re}from"marked-smartypants";import C from"highlight.js/lib/core";import ie from"highlight.js/lib/languages/bash";import ae from"highlight.js/lib/languages/c";import oe from"highlight.js/lib/languages/cpp";import se from"highlight.js/lib/languages/css";import ce from"highlight.js/lib/languages/go";import le from"highlight.js/lib/languages/java";import ue from"highlight.js/lib/languages/javascript";import de from"highlight.js/lib/languages/json";import fe from"highlight.js/lib/languages/markdown";import pe from"highlight.js/lib/languages/php";import me from"highlight.js/lib/languages/plaintext";import he from"highlight.js/lib/languages/python";import ge from"highlight.js/lib/languages/rust";import _e from"highlight.js/lib/languages/scss";import ve from"highlight.js/lib/languages/sql";import ye from"highlight.js/lib/languages/typescript";import w from"highlight.js/lib/languages/xml";import be from"highlight.js/lib/languages/yaml";import{v4 as T}from"uuid";function xe(e){return f(t(e))}function Se(e){if(!e)return``;let t=c(e),n=e.replace(/[^A-Z0-9]/gi,``);if(n.length===t.replace(/-/g,``).length){let e=0,r=``;for(let i=0;i<t.length;i+=1){let a=t[i];if(a===`-`){let o=t[i-1],s=t[i+1],c=n[e],l=c&&c.toUpperCase()===c&&c.toLowerCase()!==c,u=i+1===t.length-1;if(o&&s&&/[a-z0-9]/.test(o)&&/[a-z0-9]/.test(s)&&(!/\d/.test(o)&&/\d/.test(s)||/\d/.test(o)&&!/\d/.test(s)&&!l||/\d/.test(o)&&!/\d/.test(s)&&l&&u))continue;r+=a}else r+=a,e+=1}t=r}return t}const E={mobile:/^(?:(?:\+|00)86)?1[3-9]\d{9}$/,tel:/^(?:(?:\d{3}-)?\d{8}|(?:\d{4}-)?\d{7,8})(?:-\d+)?$/,numAndLetter:/^[A-Z0-9]+$/i,password:/^\S*(?=\S{6,})(?=\S*\d)(?=\S*[A-Z])(?=\S*[a-z])(?=\S*[!@#$%^&*? ])\S+$/,email:/^[A-Z0-9._%+-\u4E00-\u9FA5]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,postalCode:/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/,identityCard:/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[12]\d|30|31)\d{3}[\dX]$/i,ip:/^((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(?::(?:\d|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5]))?$/,url:/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-][^!@#$%^&*?.\s]{0,64}\.)+[a-z]{2,6}\/?/,httpsUrl:/^https:\/\//,domain:/^([0-9a-z-]+\.)+([a-z]{2,})$/i,plateNumber:/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$/,md5:/^[a-f0-9]{32}$/i,base64:/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([\w!$&',()*+;=\-.~:@/?%\s]*?)\s*$/i,uuid:/^[a-f\d]{4}(?:[a-f\d]{4}-){4}[a-f\d]{12}$/i,version:/^\d+(?:\.\d+){2}$/,videoUrl:/^https?:\/\/(.+\/)+.+(\.(swf|avi|flv|mpg|rm|mov|wav|asf|3gp|mkv|rmvb|mp4))$/i,imageUrl:/^https?:\/\/(.+\/)+.+(\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i,chinese:/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/,itcode:/^[a-z]+\d*$/i,numeric:/^\d+$/},Ce=Object.prototype.toString;function D(e,t){return Ce.call(e)===`[object ${t}]`}function O(e){return e!==null&&D(e,`Object`)}function we(e){return E.url.test(e)}function k(e){return Array.isArray(e)&&e.length>0}function Te(e){return Number.isInteger(e)&&e>=0}function Ee(e){return E.numeric.test(e)}const A=typeof window>`u`,j=!A,M=j&&window.navigator.userAgent.toLowerCase().includes(`chrome`),N=j&&window.navigator.userAgent.toLowerCase().includes(`safari`),P=typeof window<`u`&&typeof document<`u`,De=P&&`webkitLineClamp`in document.body.style,Oe=P&&typeof ResizeObserver<`u`,ke=e=>E.chinese.test(e),Ae=()=>`startViewTransition`in document&&window.matchMedia(`(prefers-reduced-motion: no-preference)`).matches;function je(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function Me(e,t){if(e==null)return{};var n,r,i=je(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function F(e){"@babel/helpers - typeof";return F=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},F(e)}function Ne(e,t){if(F(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(F(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Pe(e){var t=Ne(e,`string`);return F(t)==`symbol`?t:t+``}function I(e,t,n){return(t=Pe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Fe(Object(n),!0).forEach(function(t){I(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Ie=[`matched`],Le=(e,t)=>{let n=e;return n.install=r=>{r.component(n.name||n.displayName,e),t&&(r.config.globalProperties[t]=e)},e};function Re(e){if(!e)return e;let{matched:t}=e;return L(L({},Me(e,Ie)),{},{matched:t?t.map(e=>({meta:e.meta,name:e.name,path:e.path})):void 0})}function ze(e,t={}){let{target:n=`__blank`,noopener:r=!0,noreferrer:i=!0}=t||{},a=[];r&&a.push(`noopener=yes`),i&&a.push(`noreferrer=yes`),window.open(e,n,a.join(`,`))}function Be(e,t,a=`replace`){return t?e?l(e,t,(e,t)=>{if(r(t)&&r(e))switch(a){case`union`:return d(e,t,i);case`intersection`:return n(e,t,i);case`concat`:return e.concat(t);case`replace`:return t;default:throw Error(`Unknown merge array strategy: ${a}`)}if(O(t)&&O(e))return Be(e,t,a)}):t:e}function Ve(e,t){if(!k(Object.keys(t)))return e;let n=``;for(let e in t){let r=t[e];n+=Array.isArray(r)?`${e}=${encodeURIComponent(r.join(`,`))}&`:`${e}=${encodeURIComponent(r)}&`}return n=n.replace(/&$/,``),/\?$/.test(e)?e+n:e.replace(/\/?$/,`?`)+n}function He(e){s(e)&&Object.keys(e).forEach(t=>{Reflect.deleteProperty(e,t)})}function Ue(e){return[`$`,`(`,`)`,`*`,`+`,`.`,`[`,`]`,`?`,`\\`,`^`,`{`,`}`,`|`].includes(e)?`\\${e}`:e}function We(e){let t=[``,...[...e].map(e=>Ue(e)),``].join(`.*`);return new RegExp(t,`i`)}function Ge(e=``,t={}){let{size:n=14,family:r=getComputedStyle(document.documentElement).getPropertyValue(`--vxe-font-family`)||`sans-serif`}=t,i=document.createElement(`canvas`).getContext(`2d`);i.font=`${n}px ${r}`;let a=i.measureText(e),o=Math.abs(a.actualBoundingBoxLeft)+Math.abs(a.actualBoundingBoxRight);return Math.ceil(Math.max(a.width,o))}function R(e,t){return t?typeof t==`string`?` ${e}--${t}`:Array.isArray(t)?t.reduce((t,n)=>t+R(e,n),``):Object.keys(t).reduce((n,r)=>n+(t[r]?R(e,r):``),``):``}function z(e){return(t,n)=>(t&&typeof t!=`string`&&(n=t,t=``),t=t?`${e}__${t}`:e,`${t}${R(t,n)}`)}function Ke(e,t=``){return[z(`${t}-${e}`)]}function qe(e,t=``){let n=`${t}-${e}`;return[n,z(n)]}function B(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function V(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){B(a,r,i,o,s,`next`,e)}function s(e){B(a,r,i,o,s,`throw`,e)}o(void 0)})}}const H=new TextEncoder,Je=new TextDecoder;function U(){var e;if(!((e=window.crypto)!=null&&e.subtle))throw Error(`Web Crypto API is not available in the current environment.`);return window.crypto}function W(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n)t+=String.fromCharCode(...e.subarray(r,r+n));return btoa(t)}function Ye(e){let t=atob(e);return Uint8Array.from(t,e=>e.charCodeAt(0))}function Xe(e){return W(H.encode(e))}function Ze(e){return Je.decode(Ye(e))}function Qe(e){return _(h(v(e)))}function $e(e){return _(g(v(e)))}function et(e,t){return _(m(h,v(t),v(e)))}function tt(e=32){if(!Number.isSafeInteger(e)||e<=0||e>65536)throw Error(`The key byte length must be an integer between 1 and 65536.`);return W(U().getRandomValues(new Uint8Array(e)))}function nt(e){return G.apply(this,arguments)}function G(){return G=V(function*({password:e,salt:t,iterations:n=6e5,keyLength:r=32}){if(!Number.isSafeInteger(n)||n<=0)throw Error(`PBKDF2 iterations must be a positive integer.`);if(!Number.isSafeInteger(r)||r<=0)throw Error(`The derived key length must be a positive integer.`);let i=U(),a=yield i.subtle.importKey(`raw`,H.encode(e),`PBKDF2`,!1,[`deriveBits`]),o=yield i.subtle.deriveBits({name:`PBKDF2`,hash:`SHA-256`,salt:H.encode(t),iterations:n},a,r*8);return W(new Uint8Array(o))}),G.apply(this,arguments)}var rt=class{constructor({key:e,additionalData:t}){I(this,`key`,void 0),I(this,`additionalData`,void 0),this.key=e,this.additionalData=t?H.encode(t):void 0}encrypt(e){var t=this;return V(function*(){let n=U(),r=n.getRandomValues(new Uint8Array(12)),i=yield n.subtle.encrypt(L({name:`AES-GCM`,iv:r},t.additionalData?{additionalData:t.additionalData}:{}),yield t.getKey(),H.encode(e)),a=new Uint8Array(i),o=new Uint8Array(12+a.length);return o.set(r),o.set(a,12),W(o)})()}decrypt(e){var t=this;return V(function*(){let n=Ye(e);if(n.length<=12)throw Error(`The AES-GCM payload is invalid.`);let r=yield U().subtle.decrypt(L({name:`AES-GCM`,iv:n.slice(0,12)},t.additionalData?{additionalData:t.additionalData}:{}),yield t.getKey(),n.slice(12));return Je.decode(r)})()}getKey(){var e=this;return V(function*(){return U().subtle.importKey(`raw`,h(v(e.key)),`AES-GCM`,!1,[`encrypt`,`decrypt`])})()}};const it=()=>document.documentElement;function at(e){return!e||!e.getBoundingClientRect?0:e.getBoundingClientRect()}function ot(e){return(e||``).replace(/^\s+|\s+$/g,``)}function K(e,t){if(!e||!t)return!1;if(t.includes(` `))throw Error(`className should not contain space.`);return e.classList?e.classList.contains(t):` ${e.className} `.includes(` ${t} `)}function st(e,t,n){return n||(n=it()),n.style.setProperty(e,t),{prop:t}}function ct(e,t){if(!e)return;let n=e.className,r=(t||``).split(` `);for(let t=0,i=r.length;t<i;t++){let i=r[t];i&&(e.classList?e.classList.add(i):K(e,i)||(n+=` ${i}`))}e.classList||(e.className=n)}function lt(e,t){if(!e||!t)return;let n=t.split(` `),r=` ${e.className} `;for(let t=0,i=n.length;t<i;t++){let i=n[t];i&&(e.classList?e.classList.remove(i):K(e,i)&&(r=r.replace(` ${i} `,` `)))}e.classList||(e.className=ot(r))}function ut(e){let t=document.documentElement,n=t.scrollLeft,r=t.scrollTop,i=t.clientLeft,a=t.clientTop,o=window.scrollX,s=window.scrollY,c=at(e);if(!c)return{};let{left:l,top:u,width:d,height:f}=c,p=(o||n)-(i||0),ee=(s||r)-(a||0),m=l+o,h=u+s,g=m-p,_=h-ee,v=window.document.documentElement.clientWidth,y=window.document.documentElement.clientHeight;return{left:g,top:_,right:v-d-g,bottom:y-f-_,rightIncludeBody:v-g,bottomIncludeBody:y-_}}function dt(e,t){let n=[`webkit`,`Moz`,`ms`,`OT`],r={};return n.forEach(n=>{r[`${n}${f(e)}`]=t}),L(L({},r),{},{[e]:t})}function ft(e,t,n){e&&t&&n&&e.addEventListener(t,n,!1)}function pt(e,t,n){e&&t&&n&&e.removeEventListener(t,n,!1)}function mt(e){let t=!1;return function(...n){t||(t=!0,window.requestAnimationFrame(()=>{e.apply(this,n),t=!1}))}}function ht(e){for(let t of e){let e=t.target.__resizeListeners__||[];e.length&&e.forEach(e=>{e()})}}function gt(e,t){A||(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new y(ht),e.__ro__.observe(e)),e.__resizeListeners__.push(t))}function _t(e,t){e&&e.__resizeListeners__&&(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||(e.__ro__.disconnect(),e.__ro__=null,e.__resizeListeners__=null))}function vt(){let e=new Event(`resize`,{bubbles:!0,cancelable:!0});window.dispatchEvent(e)}function yt(e,t={}){function n(e){let t=window.history[e];return function(...n){let r=new Event(e);return r.arguments=n,window.dispatchEvent(r),t.apply(this,n)}}return window.history.pushState=n(`pushState`),window.history.replaceState=n(`replaceState`),window.addEventListener(`popstate`,e,t),window.addEventListener(`hashchange`,e,t),window.addEventListener(`replaceState`,e,t),window.addEventListener(`pushState`,e,t),{removeListener:()=>{window.removeEventListener(`popstate`,e,t),window.removeEventListener(`hashchange`,e,t),window.removeEventListener(`replaceState`,e,t),window.removeEventListener(`pushState`,e,t)}}}function bt(e){let t=e.split(`,`),n=t[0].match(/:(.*?);/)[1],r=window.atob(t[1]),i=r.length,a=new Uint8Array(i);for(;i--;)a[i]=r.charCodeAt(i);return new Blob([a],{type:n})}function xt(e,t){return new Promise((n,r)=>{let i=document.createElement(`CANVAS`),a=i==null?void 0:i.getContext(`2d`),o=new Image;o.crossOrigin=``,o.onload=function(){if(!i||!a)return r();i.height=o.height,i.width=o.width,a.drawImage(o,0,0);let e=i.toDataURL(t||`image/png`);i=null,n(e)},o.src=e})}function St(e){let{loaded:t,total:n}=e;if(n<=0||o(n))return 0;let r=t/n;return u((r>1?1:r)*100)}function Ct(e,t,n,r){xt(e).then(e=>{wt(e,t,n,r)})}function wt(e,t,n,r){Tt(bt(e),t,n,r)}function Tt(e,t,n,r){let i=new Blob(r===void 0?[e]:[r,e],{type:n||`application/octet-stream`}),a=window.URL.createObjectURL(i),o=document.createElement(`a`);o.style.display=`none`,o.href=a,o.setAttribute(`download`,t),o.download===void 0&&o.setAttribute(`target`,`_blank`),document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(a)}function Et({url:e,target:t=`_blank`,fileName:n}){if(/iP/.test(window.navigator.userAgent))return!1;if(M||N){let t=document.createElement(`a`);return t.href=e,t.download=n||e.substring(e.lastIndexOf(`/`)+1,e.length),t.style.display=`none`,document.body.appendChild(t),t.click(),document.body.removeChild(t),!0}return e.includes(`?`)||(e+=`?download`),ze(e,{target:t}),!0}function Dt(e,t=`default`,n){if(!e||!Reflect.has(e,t)||!a(e[t]))return null;let r=e[t];return r?r(n):null}function Ot(e,t=[]){let n=Object.keys(e),r={};return n.forEach(n=>{if(t.includes(n))return null;r[n]=t=>Dt(e,n,t)}),r}function kt(e,{type:t=`text/javascript`}={}){return new Promise((n,r)=>{let i=!1,a=document.querySelector(`script[src="${e}"]`);if(!a)a=document.createElement(`script`),a.type=t,a.async=!0,a.src=e,i=!0;else if(a.hasAttribute(`data-loaded`)){n({el:a});return}a.addEventListener(`error`,r),a.addEventListener(`abort`,r),a.addEventListener(`load`,()=>{a.setAttribute(`data-loaded`,`true`),n({el:a})}),i&&document.head.appendChild(a)})}function At(e){return new Promise((t,n)=>{let r=document.querySelector(`script[src="${e}"]`);if(!r){n();return}document.head.removeChild(r),t()})}function jt(e,t,n){return It(e,t,n,!1)}function Mt(e,t,n){return It(e,t,n,!0).length>0}function Nt(e){return typeof e==`string`?e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`):e}const q=new Map;function Pt(e,t){if(!Array.isArray(e))switch(typeof e){case`string`:e=[e];break;case`undefined`:e=[];break;default:throw TypeError(`Expected '${t}' to be a string or an array, but got a type of '${typeof e}'`)}return e.filter(e=>{if(typeof e!=`string`){if(e===void 0)return!1;throw TypeError(`Expected '${t}' to be an array of strings, but found a type of '${typeof e}' in the array`)}return!0})}function Ft(e,t){t=L({caseSensitive:!1},t);let n=e+JSON.stringify(t);if(q.has(n))return q.get(n);let r=e[0]===`!`;r&&(e=e.slice(1)),e=Nt(e).replace(/\\\*/g,`[\\s\\S]*`);let i=RegExp(`^${e}$`,t.caseSensitive?``:`i`);return i.negated=r,q.set(n,i),i}function It(e,t,n,r){if(e=Pt(e,`inputs`),t=Pt(t,`patterns`),t.length===0)return[];let i=t.map(e=>Ft(e,n)),{allPatterns:a}=n||{},o=[];for(let t of e){let e,n=i.map(()=>!1);for(let[r,a]of i.entries())if(a.test(t)&&(n[r]=!0,e=!a.negated,!e))break;if(!(e===!1||e===void 0&&i.some(e=>!e.negated)||a&&n.some((e,t)=>!e&&!i[t].negated))&&(o.push(t),r))break}return o}C.registerLanguage(`bash`,ie),C.registerLanguage(`c`,ae),C.registerLanguage(`cpp`,oe),C.registerLanguage(`css`,se),C.registerLanguage(`go`,ce),C.registerLanguage(`java`,le),C.registerLanguage(`javascript`,ue),C.registerLanguage(`json`,de),C.registerLanguage(`markdown`,fe),C.registerLanguage(`php`,pe),C.registerLanguage(`plaintext`,me),C.registerLanguage(`python`,he),C.registerLanguage(`rust`,ge),C.registerLanguage(`scss`,_e),C.registerLanguage(`sql`,ve),C.registerLanguage(`typescript`,ye),C.registerLanguage(`xml`,w),C.registerLanguage(`html`,w),C.registerLanguage(`yaml`,be);const Lt={walkTokens(e){e.type===`text`&&(e.text=e.text.replace(/([\u2E80-\u2EFF\u3000-\u303F\u31C0-\u31EF\u3200-\u32FF\u3300-\u33FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF\uFE30-\uFE4F])\r?\n([\u2E80-\u2EFF\u3000-\u303F\u31C0-\u31EF\u3200-\u32FF\u3300-\u33FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF\uFE30-\uFE4F])/g,`$1$2`))}},Rt={breaks:!0,gfm:!0},zt={FORBID_TAGS:[`style`],FORBID_ATTR:[`style`]};function Bt(e,t){let n=C.getLanguage(t)?t:`plaintext`;return C.highlight(e,{language:n}).value}const J=S({langPrefix:`hljs-`,highlight:Bt}),Y=[te(),Lt,ne(),re(),J];function X(e){if((e==null?void 0:e.highlight)===!1&&!(e!=null&&e.extensions))return Y.filter(e=>e!==J);if((e==null?void 0:e.highlight)===!1)return[...Y.filter(e=>e!==J),...e.extensions||[]];if(e!=null&&e.highlight){let{langPrefix:t=`language-`,highlight:n}=e.highlight,r=S({langPrefix:t,highlight:n}),i=[...Y.filter(e=>e!==J),r];return e.extensions&&i.push(...e.extensions),i}let t=[...Y];return e!=null&&e.extensions&&t.push(...e.extensions),t}function Vt(e,t){if(!e)return``;let n=X(t),r=new x;r.use(...n);let i=r.parse(e,L(L({},Rt),t==null?void 0:t.marked));return b.sanitize(i,L(L({},zt),t==null?void 0:t.sanitize))}function Ht(e){let t=L(L({},Rt),e==null?void 0:e.marked),n=L(L({},zt),e==null?void 0:e.sanitize),r=X(e),i=new x;return i.use(...r),{render(e,r){if(!e)return``;let a=r!=null&&r.marked||(r==null?void 0:r.highlight)!==void 0||r!=null&&r.extensions?(()=>{let n=X(r),i=new x;return i.use(...n),i.parse(e,L(L({},t),r.marked))})():i.parse(e,t),o=r!=null&&r.sanitize?L(L({},n),r.sanitize):n;return b.sanitize(a,o)}}}function Ut(e){if(!e)return``;let t=Vt(e);return typeof DOMParser<`u`?new DOMParser().parseFromString(t,`text/html`).body.textContent||``:t.replace(/<[^>]*>/g,``)}const Wt={id:`id`,children:`children`,pid:`pid`},Z=e=>Object.assign({},Wt,e);function Gt(e,t,n={}){n=Z(n);let{children:r}=n,i=[...e];for(let e of i){if(t(e))return e;e[r]&&i.push(...e[r])}return null}function Kt(e,t,n={}){n=Z(n);let{children:r}=n,i=[...e],a=[];for(let e of i)t(e)&&a.push(e),e[r]&&i.push(...e[r]);return a}function qt(e,t,n={}){n=Z(n);let r=[],i=[...e],a=new Set,{children:o}=n;for(;i.length;){let e=i[0];if(a.has(e))r.pop(),i.shift();else if(a.add(e),e[o]&&i.unshift(...e[o]),r.push(e),t(e))return r}return null}function Jt(e,t,n={}){n=Z(n);let r=[],i=[...e],a=[],o=new Set,{children:s}=n;for(;i.length;){let e=i[0];o.has(e)?(r.pop(),i.shift()):(o.add(e),e[s]&&i.unshift(...e[s]),r.push(e),t(e)&&a.push([...r]))}return a}function Yt(e,t,n={}){n=Z(n);let r=n.children;function i(e){return e.map(e=>L({},e)).filter(e=>(e[r]=e[r]&&i(e[r]),t(e)||e[r]&&e[r].length))}return i(e)}function Xt(e,t,n={}){n=Z(n);let r=[...e],{children:i}=n;for(let e=0;e<r.length;e++){if(t(r[e]))return;i&&r[e][i]&&r.splice(e+1,0,...r[e][i])}}function Zt(e,t){return e.map(e=>Q(e,t))}function Q(e,{children:t=`children`,conversion:n}){let r=Array.isArray(e[t])&&e[t].length>0,i=n(e)||{};return r?L(L({},i),{},{[t]:e[t].map(e=>Q(e,{children:t,conversion:n}))}):L({},i)}function Qt({native:e=!0}={}){var t,n,r;return e?(t=(n=window.crypto)==null||(r=n.randomUUID)==null?void 0:r.call(n))==null?T():t:T()}let $=0;function $t(e=``){let t=Date.now(),n=Math.floor(Math.random()*1e9);return $++,`${e}_${n}${$}${String(t)}`}export{rt as AesGcmEncryption,y as ResizeObserver,ct as addClass,yt as addLocationListener,gt as addResizeListener,z as buildBEM,$t as buildShortUUID,Qt as buildUUID,Ke as createBEM,Ht as createMarkdownRenderer,qe as createNamespace,We as createSearchReg,bt as dataURLtoBlob,Ze as decodeBase64,Be as deepMerge,nt as deriveKeyByPbkdf2,pt as domOffEvent,ft as domOnEvent,wt as downloadByBase64,Tt as downloadByData,Ct as downloadByOnlineUrl,Et as downloadByUrl,St as downloadPercent,Ae as enableTransitions,Xe as encodeBase64,Nt as escapeStringRegexp,Ot as extendSlots,Yt as filterTree,Gt as findNode,Kt as findNodeAll,qt as findPath,Jt as findPathAll,Xt as forEachTree,tt as generateRandomKey,Ge as getActualWidthOfChars,at as getBoundingClientRect,Re as getRawRoute,Dt as getSlot,ut as getViewportOffset,dt as hackCss,K as hasClass,Qe as hashBySha256,$e as hashBySha512,D as is,P as isBrowser,ke as isChineseText,M as isChrome,j as isClient,k as isIterableArray,Mt as isMatch,Ee as isNumeric,O as isObject,Te as isPositiveInteger,N as isSafari,A as isServer,De as isSupportNativeEllipsis,Oe as isSupportResizeObserver,we as isUrl,kt as loadScript,jt as matcher,ze as openWindow,xe as pascalCase,ee as pathToRegexp,E as regexpMap,p as regexpToPath,lt as removeClass,_t as removeResizeListener,Vt as renderMarkdown,Se as safeKebabCase,st as setCssVar,Ve as setObjToUrlParams,et as signByHmacSha256,Ut as stripMarkdown,e as titleCase,Zt as treeMap,Q as treeMapEach,vt as triggerWindowResize,At as unloadScript,He as unsetAllProperty,xt as urlToBase64,mt as useRafThrottle,Le as withInstall};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gsc-basic/utils",
3
3
  "type": "module",
4
- "version": "1.4.1",
4
+ "version": "1.4.2",
5
5
  "description": "Web Dev Utils for GSC Basic Team",
6
6
  "author": "Lenovo SSG BASD <-GSC_Scaffolding_Support@lenovo.com>",
7
7
  "license": "LicenseRef-Proprietary",
@@ -33,10 +33,10 @@
33
33
  "lodash-es": "^4.18.1"
34
34
  },
35
35
  "dependencies": {
36
- "@noble/hashes": "^2.3.0",
37
- "dompurify": "^3.4.12",
38
- "highlight.js": "^11.11.1",
39
- "marked": "^18.0.7",
36
+ "@noble/hashes": "^2.4.0",
37
+ "dompurify": "^3.4.14",
38
+ "highlight.js": "^11.12.0",
39
+ "marked": "^18.0.11",
40
40
  "marked-alert": "^2.1.2",
41
41
  "marked-gfm-heading-id": "^4.1.4",
42
42
  "marked-highlight": "^2.2.4",
@@ -44,7 +44,7 @@
44
44
  "path-to-regexp": "^8.4.2",
45
45
  "resize-observer-polyfill": "^1.5.1",
46
46
  "title-case": "^4.3.2",
47
- "uuid": "^14.0.1"
47
+ "uuid": "^14.0.2"
48
48
  },
49
49
  "devDependencies": {
50
50
  "lodash-es": "^4.18.1"