@lntvow/utils 4.2.14 → 4.2.15
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var he=Object.create;var U=Object.defineProperty;var we=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var $e=Object.getPrototypeOf,Ae=Object.prototype.hasOwnProperty;var Re=(e,t)=>{for(var r in t)U(e,r,{get:t[r],enumerable:!0})},fe=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Oe(t))!Ae.call(e,o)&&o!==r&&U(e,o,{get:()=>t[o],enumerable:!(n=we(t,o))||n.enumerable});return e};var B=(e,t,r)=>(r=e!=null?he($e(e)):{},fe(t||!e||!e.__esModule?U(r,"default",{value:e,enumerable:!0}):r,e)),Te=e=>fe(U({},"__esModule",{value:!0}),e);var At={};Re(At,{UtilsError:()=>L,base64Decode:()=>Me,base64Encode:()=>De,castArray:()=>P,compose:()=>Pe,composeRight:()=>Ne,debounce:()=>ke,debugWarn:()=>ne,debugWarnInvalidTypeMessage:()=>_e,decimalToBinary:()=>Ee,deepClone:()=>I,deepMerge:()=>Ie,deprecated:()=>Ye,generateRandomArray:()=>ze,generateRandomColor:()=>qe,generateRandomDate:()=>G,generateRandomEmail:()=>ye,generateRandomFloat:()=>nt,generateRandomIdCard:()=>ot,generateRandomMobilePhone:()=>it,generateRandomStringFromSource:()=>z,getRandomInt:()=>p,getRandomItem:()=>w,getRandomString:()=>$,getRandomUrl:()=>at,hasChanged:()=>je,hasCircularReference:()=>oe,isArray:()=>d,isBoolean:()=>x,isDate:()=>Z,isDateString:()=>se,isDef:()=>Se,isEmail:()=>yt,isEmptyString:()=>xt,isFloat:()=>st,isFunction:()=>_,isIdCard:()=>ht,isInteger:()=>pt,isMap:()=>X,isMobilePhone:()=>wt,isNegativeFloat:()=>ct,isNegativeInteger:()=>dt,isNil:()=>re,isNonNegativeFloat:()=>ft,isNonNegativeInteger:()=>gt,isNonPositiveFloat:()=>ut,isNonPositiveInteger:()=>bt,isNull:()=>v,isNumber:()=>y,isObject:()=>S,isObjectLike:()=>K,isPlainObject:()=>h,isPositiveFloat:()=>mt,isPositiveInteger:()=>lt,isPromise:()=>te,isRegExp:()=>ee,isSet:()=>J,isString:()=>j,isStringNumber:()=>Ot,isSymbol:()=>Q,isURL:()=>$t,isUndef:()=>c,objectToString:()=>ce,omit:()=>Ge,pick:()=>ie,qs:()=>ge,qsStringify:()=>Le,throttle:()=>Be,throwError:()=>a,throwErrorInvalidTypeMessage:()=>Ke,toTypeString:()=>M,toTypeValue:()=>H,withRetry:()=>He});module.exports=Te(At);function S(e){let t=typeof e;return e!==null&&(t==="object"||t==="function")}function K(e){return e!==null&&typeof e=="object"}var ce=Object.prototype.toString,M=e=>ce.call(e),H=e=>M(e).slice(8,-1),j=e=>typeof e=="string",y=e=>typeof e=="number"&&Number.isFinite(e),x=e=>typeof e=="boolean",v=e=>e===null,c=e=>e===void 0,Q=e=>typeof e=="symbol",d=Array.isArray,_=e=>typeof e=="function",X=e=>M(e)==="[object Map]",J=e=>M(e)==="[object Set]",Z=e=>M(e)==="[object Date]",ee=e=>M(e)==="[object RegExp]",te=e=>K(e)&&_(e?.then)&&_(e?.catch),re=e=>e==null,Se=e=>e!=null,je=(e,t)=>e!==t;function h(e){return M(e)==="[object Object]"}function P(e){return d(e)?e:[e]}function Ee(e){let t=[],r,n="";for(;e>0;)r=Math.floor(e%2),t.push(r),e=Math.floor(e/2);for(;t.length>0;)n+=t.pop().toString();return n}var ue="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function De(e){let t="",r="";for(let o=0;o<e.length;o++)r+=e[o].charCodeAt(0).toString(2).padStart(8,"0");for(let o=0;o<r.length;o+=6)t+=ue[Number.parseInt(r.slice(o,o+6).padEnd(6,"0"),2)];let n=t.length%4;return n!==0&&(t+="=".repeat(4-n)),t}function Me(e){let t="",r="";for(let n=0;n<e.length&&e[n]!=="=";n++)r+=ue.indexOf(e[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let o=Number.parseInt(r.slice(n,n+8),2);o&&(t+=String.fromCharCode(o))}return t}function Pe(...e){return e.reduce((t,r)=>function(...n){return r(t(...n))})}function Ne(...e){return e.reduce((t,r)=>function(...n){return t(r(...n))})}function ke(e,t=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}function I(e){let t=new WeakMap;function r(n){if(!K(n))return n;if(Z(n))return new Date(n);if(ee(n))return new RegExp(n);if(te(n))return n;if(t.has(n))return t.get(n);if(X(n)){let s=new Map;return t.set(n,s),n.forEach((u,g)=>s.set(r(g),r(u))),s}if(J(n)){let s=new Set;return t.set(n,s),n.forEach(u=>s.add(r(u))),s}let o=d(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));t.set(n,o);let f=Object.getOwnPropertyDescriptors(n);for(let s of Reflect.ownKeys(f)){let u=f[s];u.get||u.set?Object.defineProperty(o,s,u):Object.defineProperty(o,s,{...u,value:r(u.value)})}return o}return r(e)}function Ie(e,t,r={}){return le(pe(e,r),pe(t,r),r)}function le(e,t,r){return d(e)?Fe(e,t,r):Ce(e,t,r)}function Ce(e,t,r){if(!h(t))return t;let n=Object.getOwnPropertyDescriptors(t);return Reflect.ownKeys(t).forEach(o=>{(h(e[o])||d(e[o]))&&(h(t[o])||d(t[o]))?e[o]=le(e[o],t[o],r):Object.defineProperty(e,o,n[o])}),e}function Fe(e,t,r){let{mergeStrategy:n="replace"}=r;if(d(t))switch(n){case"merge":return e.concat(t);case"replace":return t;default:return t}return t}function pe(e,t){let{deepClone:r=!0}=t;return r?I(e):e}var L=class extends Error{constructor(t,r="Utils"){super(t),this.name=r}};function a(e,t){throw new L(`[${e}] ${t}`)}function ne(e,t){let r=j(e)?new L(`[${e}] ${t}`,"UtilsWarn"):e;console.warn(r)}var Ye=({from:e,replacement:t,version:r,type:n="API"})=>{ne(`${n}`,`${e} is about to be deprecated in version ${r}, please use ${t} instead.`)};function Ke(e,t,r,n){let o=`Invalid params: type check failed for params "${t}". Expected ${r}, got ${H(n)} with value ${n}.`;a(e,o)}function _e(e,t,r,n){let o=`Invalid params: type check failed for params "${t}". Expected ${r}, got ${H(n)} with value ${n}.`;ne(e,o)}var V=(e,t,...r)=>{if(!t)return;let n=r.length===0?"":r.length===1?r[0]:r;console[e](`[Log] ${t}:`,n)},W=(e,...t)=>{V("info",e,...t)};W.info=(e,...t)=>{V("info",e,...t)};W.error=(e,...t)=>{V("error",e,...t)};W.warn=(e,...t)=>{V("warn",e,...t)};typeof globalThis<"u"&&(globalThis.log=W);function Le(e,t={}){Ue(t);let{encode:r=!0,encodeValuesOnly:n=!1,arrayFormat:o="indices",encodeDotInKeys:f=!1,skipNulls:s=!1,strictNullHandling:u=!1,commaRoundTrip:g=!1,allowEmptyArrays:N=!1,addQueryPrefix:A=!1,delimiter:k="&"}=t,O=t.allowDots??!1;f&&c(t.allowDots)&&(O=!0);let b=[],T=m=>r&&!n?encodeURIComponent(m):m,F=m=>r?encodeURIComponent(m):m;function Y(m,l){if(!c(l)){if(v(l)){if(s)return;b.push(`${T(m)}${u?"":"="}`);return}if(d(l)){if(l.length===0){N&&b.push(`${T(m)}[]`);return}if(o==="comma"){let E=n?l.map(F).join(","):F(l.join(","));if(l.length===1&&v(l[0])){if(s)return;b.push(`${T(m)}${g?"[]":""}${u?"":"="}`)}else l.length===1?b.push(`${T(m)}${g?"[]":""}=${E}`):b.push(`${T(m)}=${E}`);return}l.forEach((E,C)=>{let D=m;o==="indices"?D=`${m}[${C}]`:o==="brackets"&&(D=`${m}[]`),Y(D,E)});return}if(S(l)){Object.keys(l).forEach(E=>{let C=m;f&&(C=C.replace(/\./g,"%2E"));let D=E;O?(f&&(D=D.replace(/\./g,"%2E")),Y(`${C}.${D}`,l[E])):Y(`${C}[${D}]`,l[E])});return}b.push(`${T(m)}=${F(l)}`)}}if(!S(e))return"";oe(e)&&a("stringify","Input object contains circular references, cannot stringify"),d(e)?e.forEach((m,l)=>Y(`${l}`,m)):Object.keys(e).forEach(m=>Y(m,e[m]));let q=b.join(k);return A&&q?`?${q}`:q}function Ue(e={}){h(e)||a("stringify",'"options" must be a plain object'),!c(e.encode)&&!x(e.encode)&&a("stringify",'"encode" must be a boolean'),!c(e.encodeValuesOnly)&&!x(e.encodeValuesOnly)&&a("stringify",'"encodeValuesOnly" must be a boolean'),!c(e.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(e.arrayFormat)&&a("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!c(e.allowDots)&&!x(e.allowDots)&&a("stringify",'"allowDots" must be a boolean'),!c(e.skipNulls)&&!x(e.skipNulls)&&a("stringify",'"skipNulls" must be a boolean'),!c(e.strictNullHandling)&&!x(e.strictNullHandling)&&a("stringify",'"strictNullHandling" must be a boolean'),!c(e.addQueryPrefix)&&!x(e.addQueryPrefix)&&a("stringify",'"addQueryPrefix" must be a boolean'),!c(e.delimiter)&&!j(e.delimiter)&&a("stringify",'"delimiter" must be a string'),!c(e.encodeDotInKeys)&&!x(e.encodeDotInKeys)&&a("stringify",'"encodeDotInKeys" must be a boolean'),!c(e.commaRoundTrip)&&!x(e.commaRoundTrip)&&a("stringify",'"commaRoundTrip" must be a boolean'),!c(e.allowEmptyArrays)&&!x(e.allowEmptyArrays)&&a("stringify",'"allowEmptyArrays" must be a boolean')}var ge={stringify:e=>(S(e)||a("stringify","Input must be an object"),new URLSearchParams(e).toString()),parse:e=>(j(e)||a("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(e).entries())),appendQueryString:(e,t)=>{let r=ge.stringify(t);return e.includes("?")?e.endsWith("?")||e.endsWith("&")?`${e}${r}`:`${e}&${r}`:`${e}?${r}`}};function Be(e,t=500){let r=null;return function(...n){if(re(r))return r=Date.now(),e.apply(this,n);let o=Date.now();if(o-r>=t)return r=o,e.apply(this,n)}}function He(e){ve(e);let{fn:t,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:o=!1,signal:f}=e,s,u=f?new Promise((N,A)=>{let k=()=>A(de());f.addEventListener("abort",k),s=()=>f.removeEventListener("abort",k)}):null;return new Promise((N,A)=>{(async()=>{for(let O=1;O<=r;O++){if(f?.aborted)return A(de());try{let b=await Promise.race(u?[t(),u]:[t()]);return N(b)}catch(b){let T=o?n*2**(O-1):n;if(log("withRetry",`Attempt ${O}/${r} failed. Retrying in ${T}ms...`),b instanceof Error&&b.name==="AbortError"||O===r)return A(b);await new Promise(F=>setTimeout(F,T))}}})()}).finally(()=>s?.())}function ve(e){h(e)||a("withRetry",'"Options" must be an object'),typeof e.fn!="function"&&a("withRetry",'"fn" must be a function that returns a Promise'),!c(e.maxAttempts)&&(!Number.isInteger(e.maxAttempts)||e.maxAttempts<1)&&a("withRetry",'"maxAttempts" must be a positive integer'),!c(e.retryDelay)&&(!y(e.retryDelay)||e.retryDelay<0)&&a("withRetry",'"retryDelay" must be a non-negative number'),!c(e.enableExponentialBackoff)&&!x(e.enableExponentialBackoff)&&a("withRetry",'"enableExponentialBackoff" must be a boolean'),!c(e.signal)&&typeof e.signal!="object"&&a("withRetry",'"signal" must be an AbortSignal')}var Ve="The operation was aborted";function de(e=Ve){let t=new Error(e);return t.name="AbortError",t}function oe(e){S(e)||a("hasCircularReference",'"obj" must be a object');let t=new Set;function r(n){if(S(n)){if(t.has(n))return!0;t.add(n);for(let o of Object.keys(n))if(r(n[o]))return!0;t.delete(n)}return!1}return r(e)}function ie(e,t,r={}){let{includeProto:n=!1,includeSymbols:o=!0,includeNonEnum:f=!1}=r,s={};return h(e)&&P(t).forEach(g=>{Q(g)&&!o||!(n?g in e:Object.hasOwn(e,g))||!f&&(n?We(e,g):Object.getOwnPropertyDescriptor(e,g))?.enumerable===!1||(s[g]=I(e[g]))}),s}function We(e,t){let r=e;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function Ge(e,t){if(!h(e))return{};let r=I(e),n=P(t),o=Object.keys(r).filter(f=>!n.includes(f));return ie(r,o)}function ze(e,t){return(!y(e)||e<=0)&&a("generateRandomArray","num must be greater than 0"),_(t)||a("generateRandomArray","cb must be a function"),Array.from({length:e}).fill(0).map((r,n)=>t(r,n))}function qe(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}var R=B(require("dayjs"),1),be=B(require("dayjs/plugin/customParseFormat.js"),1);function w(e){return e[Math.floor(Math.random()*e.length)]}function p(e={}){y(e)&&(e={max:e});let{min:t=1,max:r=w(Xe())}=e;Qe(t,r);let n=Math.ceil(t),o=Math.floor(r);return Math.floor(Math.random()*(o-n+1)+n)}function Qe(e,t){let r=Math.ceil(e),n=Math.floor(t);Number.isSafeInteger(r)||a("getRandomInt",`The minimum value Math.ceil(${e}) should be a safe integer`),Number.isSafeInteger(n)||a("getRandomInt",`The maximum value Math.floor(${t}) should be a safe integer`),n<r&&(t>=e&&a("getRandomInt",`No integer value found between ${e} and ${t}`),a("getRandomInt",`The maximum value ${t} should be greater than the minimum value ${e}`))}function Xe(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((e,t)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,t+1);return Number(r)})}R.default.extend(be.default);function G(e={}){let{start:t="1800-01-01 00:00:00",end:r=(0,R.default)().format("YYYY-MM-DD HH:mm:ss"),format:n="YYYY-MM-DD HH:mm:ss"}=e;(!(0,R.default)(t).isValid()||!(0,R.default)(r).isValid())&&a("generateRandomDate","start and end parameters must be valid date format");let o=(0,R.default)(t).year(),f=(0,R.default)(r).year(),s=p({min:o,max:f}),u=p({min:1,max:12}),g=p({min:1,max:31}),N=p(23),A=p(59),k=p(59),O=(0,R.default)(`${s}-${u}-${g} ${N}:${A}:${k}`);return O.isBefore((0,R.default)(t))||O.isAfter((0,R.default)(r))?G(e):O.format(n)}function $(e={}){let t=Ze(e),r=et(t);tt(r);let{length:n}=t;rt(n.min,n.max);let o=p(n),f=t.prefix||"";for(let s=0;s<o;s++)f+=r.charAt(Math.floor(Math.random()*r.length));return f+(t.suffix||"")}var Je=16,ae=1;function Ze(e){let t=y(e);return{lowerCase:!0,upperCase:!0,number:!0,...t?{}:e,length:t?{max:e,min:e}:y(e.length)?{max:e.length,min:e.length}:{max:Je,min:ae,...e.length},extra:t?[]:[...new Set(P(e.extra||[]))]}}function et(e){let t="";return e.lowerCase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.upperCase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.number&&(t+="0123456789"),t+=P(e.extra).join(""),t}function tt(e){e.length===0&&a("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function rt(e,t){Number.isInteger(e)||a("getRandomString","min must be an integer"),Number.isInteger(t)||a("getRandomString","max must be an integer"),e<ae&&a("getRandomString",`Minimum length cannot be less than ${ae}`),t<e&&a("getRandomString","Maximum length cannot be less than minimum length")}function ye(){let e=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],t=`${$(1)}${$({length:p({max:30,min:1})})}${$(1)}@${w(e)}`;return/\.{2,}/.test(t)?ye():t}function nt(e={}){y(e)&&(e={max:e});let{min:t=0,max:r=1,fractionDigits:n=2}=e;if(t===r)return t;if(t>r)throw new Error(`Maximum value ${r} should be greater than minimum value ${t}`);return Math.random()*(r-t)+t}function z(e,t){(!y(e)||e<=0)&&a("generateRandomStringFromSource","num must be greater than 0"),(!d(t)||t.length===0)&&a("generateRandomStringFromSource","source cannot be empty array");let r="";for(let n=0;n<e;n++)r+=w(t);return r}function ot(){let e=p({min:1e5,max:999999}),t=[0,1,2,3,4,5,6,7,8,9];return[e,G({format:"YYYYMMDD"}),z(3,t),z(1,[...t,"X","x"])].join("")}function it(){return w(["13","14","15","16","17","18","19"])+p(999999999).toString().padEnd(9,"0")}function at(){let e=["http://","https://"],t=[".com",".net",".org",".cn",".top"],r=[`?name=${$({length:{min:4,max:8}})}`,`?id=${p()}`,`?page=${$({length:{min:2,max:4}})}`,`?query=${$({length:{min:5,max:6}})}`,`?search=${$({length:{min:1,max:4}})}`,`?token=${$({length:{min:16,max:16}})}`];return`${w(e)}${$({length:{min:5,max:25}})}${w(t)}${w(r)}`}function st(e){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(e)}function mt(e){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function ft(e){return/^(?:0|[1-9]\d*)\.\d+$/.test(e)}function ct(e){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function ut(e){return/^-(?:0|[1-9]\d*)\.\d+$/.test(e)}function pt(e){return/^-?(?:0|[1-9]\d*)$/.test(e)}function lt(e){return/^[1-9]\d*$/.test(e)}function gt(e){return/^(?:0|[1-9]\d*)$/.test(e)&&!Object.is(e,-0)}function dt(e){return/^-[1-9]\d*$/.test(e)}function bt(e){return/^-(?:0|[1-9]\d*)$/.test(e)||Object.is(e,-0)}var xe=B(require("dayjs"),1);function se(e,t="YYYY-MM-DD HH:mm:ss"){return(0,xe.default)(e,t,!0).isValid()}function yt(e){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(e)}function xt(e){return e===""}var me=B(require("dayjs"),1);function ht(e){if(!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/i.test(e))return!1;let r=e.slice(6,14);return se(r,"YYYYMMDD")&&(0,me.default)(r,"YYYYMMDD").isBefore((0,me.default)())}function wt(e){return/^1[3-9]\d{9}$/.test(e)}var Ot=e=>{if(!j(e)||!/^-?\d+(?:\.\d+)?$/.test(e))return!1;let r=Number(e);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};function $t(e){return/^https?:\/\/\S+$/i.test(e)}0&&(module.exports={UtilsError,base64Decode,base64Encode,castArray,compose,composeRight,debounce,debugWarn,debugWarnInvalidTypeMessage,decimalToBinary,deepClone,deepMerge,deprecated,generateRandomArray,generateRandomColor,generateRandomDate,generateRandomEmail,generateRandomFloat,generateRandomIdCard,generateRandomMobilePhone,generateRandomStringFromSource,getRandomInt,getRandomItem,getRandomString,getRandomUrl,hasChanged,hasCircularReference,isArray,isBoolean,isDate,isDateString,isDef,isEmail,isEmptyString,isFloat,isFunction,isIdCard,isInteger,isMap,isMobilePhone,isNegativeFloat,isNegativeInteger,isNil,isNonNegativeFloat,isNonNegativeInteger,isNonPositiveFloat,isNonPositiveInteger,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPositiveFloat,isPositiveInteger,isPromise,isRegExp,isSet,isString,isStringNumber,isSymbol,isURL,isUndef,objectToString,omit,pick,qs,qsStringify,throttle,throwError,throwErrorInvalidTypeMessage,toTypeString,toTypeValue,withRetry});
|
|
1
|
+
"use strict";var xe=Object.create;var U=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var we=Object.getOwnPropertyNames;var Oe=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Ae=(e,t)=>{for(var r in t)U(e,r,{get:t[r],enumerable:!0})},me=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of we(t))!Re.call(e,o)&&o!==r&&U(e,o,{get:()=>t[o],enumerable:!(n=he(t,o))||n.enumerable});return e};var B=(e,t,r)=>(r=e!=null?xe(Oe(e)):{},me(t||!e||!e.__esModule?U(r,"default",{value:e,enumerable:!0}):r,e)),Se=e=>me(U({},"__esModule",{value:!0}),e);var wt={};Ae(wt,{UtilsError:()=>L,base64Decode:()=>Me,base64Encode:()=>De,castArray:()=>N,compose:()=>Ne,composeRight:()=>Pe,debounce:()=>ke,debugWarn:()=>Ye,decimalToBinary:()=>Ee,deepClone:()=>I,deepMerge:()=>Ie,generateRandomArray:()=>st,generateRandomColor:()=>mt,generateRandomDate:()=>G,generateRandomEmail:()=>ye,generateRandomFloat:()=>bt,generateRandomIdCard:()=>yt,generateRandomMobilePhone:()=>xt,generateRandomStringFromSource:()=>v,getRandomInt:()=>p,getRandomItem:()=>w,getRandomString:()=>R,getRandomUrl:()=>ht,hasChanged:()=>Te,hasCircularReference:()=>re,isArray:()=>d,isBoolean:()=>x,isDate:()=>J,isDateString:()=>ie,isDef:()=>je,isEmail:()=>tt,isEmptyString:()=>rt,isFloat:()=>Ge,isFunction:()=>_,isIdCard:()=>nt,isInteger:()=>Xe,isMap:()=>Q,isMobilePhone:()=>ot,isNegativeFloat:()=>qe,isNegativeInteger:()=>Ze,isNil:()=>te,isNonNegativeFloat:()=>ze,isNonNegativeInteger:()=>oe,isNonPositiveFloat:()=>Qe,isNonPositiveInteger:()=>et,isNull:()=>H,isNumber:()=>y,isObject:()=>j,isObjectLike:()=>K,isPlainObject:()=>h,isPositiveFloat:()=>ve,isPositiveInteger:()=>Je,isPromise:()=>ee,isRegExp:()=>Z,isSet:()=>X,isString:()=>T,isStringNumber:()=>it,isSymbol:()=>q,isURL:()=>at,isUndef:()=>c,objectToString:()=>fe,omit:()=>We,pick:()=>ne,qs:()=>le,qsStringify:()=>Ke,throttle:()=>Le,throwError:()=>a,toTypeString:()=>M,toTypeValue:()=>$e,withRetry:()=>Ue});module.exports=Se(wt);function j(e){let t=typeof e;return e!==null&&(t==="object"||t==="function")}function K(e){return e!==null&&typeof e=="object"}var fe=Object.prototype.toString,M=e=>fe.call(e),$e=e=>M(e).slice(8,-1),T=e=>typeof e=="string",y=e=>typeof e=="number"&&Number.isFinite(e),x=e=>typeof e=="boolean",H=e=>e===null,c=e=>e===void 0,q=e=>typeof e=="symbol",d=Array.isArray,_=e=>typeof e=="function",Q=e=>M(e)==="[object Map]",X=e=>M(e)==="[object Set]",J=e=>M(e)==="[object Date]",Z=e=>M(e)==="[object RegExp]",ee=e=>K(e)&&_(e?.then)&&_(e?.catch),te=e=>e==null,je=e=>e!=null,Te=(e,t)=>e!==t;function h(e){return M(e)==="[object Object]"}function N(e){return d(e)?e:[e]}function Ee(e){let t=[],r,n="";for(;e>0;)r=Math.floor(e%2),t.push(r),e=Math.floor(e/2);for(;t.length>0;)n+=t.pop().toString();return n}var ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function De(e){let t="",r="";for(let o=0;o<e.length;o++)r+=e[o].charCodeAt(0).toString(2).padStart(8,"0");for(let o=0;o<r.length;o+=6)t+=ce[Number.parseInt(r.slice(o,o+6).padEnd(6,"0"),2)];let n=t.length%4;return n!==0&&(t+="=".repeat(4-n)),t}function Me(e){let t="",r="";for(let n=0;n<e.length&&e[n]!=="=";n++)r+=ce.indexOf(e[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let o=Number.parseInt(r.slice(n,n+8),2);o&&(t+=String.fromCharCode(o))}return t}function Ne(...e){return e.reduce((t,r)=>function(...n){return r(t(...n))})}function Pe(...e){return e.reduce((t,r)=>function(...n){return t(r(...n))})}function ke(e,t=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}function I(e){let t=new WeakMap;function r(n){if(!K(n))return n;if(J(n))return new Date(n);if(Z(n))return new RegExp(n);if(ee(n))return n;if(t.has(n))return t.get(n);if(Q(n)){let s=new Map;return t.set(n,s),n.forEach((u,g)=>s.set(r(g),r(u))),s}if(X(n)){let s=new Set;return t.set(n,s),n.forEach(u=>s.add(r(u))),s}let o=d(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));t.set(n,o);let f=Object.getOwnPropertyDescriptors(n);for(let s of Reflect.ownKeys(f)){let u=f[s];u.get||u.set?Object.defineProperty(o,s,u):Object.defineProperty(o,s,{...u,value:r(u.value)})}return o}return r(e)}function Ie(e,t,r={}){return pe(ue(e,r),ue(t,r),r)}function pe(e,t,r){return d(e)?Fe(e,t,r):Ce(e,t,r)}function Ce(e,t,r){if(!h(t))return t;let n=Object.getOwnPropertyDescriptors(t);return Reflect.ownKeys(t).forEach(o=>{(h(e[o])||d(e[o]))&&(h(t[o])||d(t[o]))?e[o]=pe(e[o],t[o],r):Object.defineProperty(e,o,n[o])}),e}function Fe(e,t,r){let{mergeStrategy:n="replace"}=r;if(d(t))switch(n){case"merge":return e.concat(t);case"replace":return t;default:return t}return t}function ue(e,t){let{deepClone:r=!0}=t;return r?I(e):e}var L=class extends Error{constructor(t,r="Utils"){super(t),this.name=r}};function a(e,t){throw new L(`[${e}] ${t}`)}function Ye(e,t){let r=T(e)?new L(`[${e}] ${t}`,"UtilsWarn"):e;console.warn(r)}var V=(e,t,...r)=>{if(!t)return;let n=r.length===0?"":r.length===1?r[0]:r;console[e](`[Log] ${t}:`,n)},W=(e,...t)=>{V("info",e,...t)};W.info=(e,...t)=>{V("info",e,...t)};W.error=(e,...t)=>{V("error",e,...t)};W.warn=(e,...t)=>{V("warn",e,...t)};typeof globalThis<"u"&&(globalThis.log=W);function Ke(e,t={}){_e(t);let{encode:r=!0,encodeValuesOnly:n=!1,arrayFormat:o="indices",encodeDotInKeys:f=!1,skipNulls:s=!1,strictNullHandling:u=!1,commaRoundTrip:g=!1,allowEmptyArrays:P=!1,addQueryPrefix:A=!1,delimiter:k="&"}=t,O=t.allowDots??!1;f&&c(t.allowDots)&&(O=!0);let b=[],$=m=>r&&!n?encodeURIComponent(m):m,F=m=>r?encodeURIComponent(m):m;function Y(m,l){if(!c(l)){if(H(l)){if(s)return;b.push(`${$(m)}${u?"":"="}`);return}if(d(l)){if(l.length===0){P&&b.push(`${$(m)}[]`);return}if(o==="comma"){let E=n?l.map(F).join(","):F(l.join(","));if(l.length===1&&H(l[0])){if(s)return;b.push(`${$(m)}${g?"[]":""}${u?"":"="}`)}else l.length===1?b.push(`${$(m)}${g?"[]":""}=${E}`):b.push(`${$(m)}=${E}`);return}l.forEach((E,C)=>{let D=m;o==="indices"?D=`${m}[${C}]`:o==="brackets"&&(D=`${m}[]`),Y(D,E)});return}if(j(l)){Object.keys(l).forEach(E=>{let C=m;f&&(C=C.replace(/\./g,"%2E"));let D=E;O?(f&&(D=D.replace(/\./g,"%2E")),Y(`${C}.${D}`,l[E])):Y(`${C}[${D}]`,l[E])});return}b.push(`${$(m)}=${F(l)}`)}}if(!j(e))return"";re(e)&&a("stringify","Input object contains circular references, cannot stringify"),d(e)?e.forEach((m,l)=>Y(`${l}`,m)):Object.keys(e).forEach(m=>Y(m,e[m]));let z=b.join(k);return A&&z?`?${z}`:z}function _e(e={}){h(e)||a("stringify",'"options" must be a plain object'),!c(e.encode)&&!x(e.encode)&&a("stringify",'"encode" must be a boolean'),!c(e.encodeValuesOnly)&&!x(e.encodeValuesOnly)&&a("stringify",'"encodeValuesOnly" must be a boolean'),!c(e.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(e.arrayFormat)&&a("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!c(e.allowDots)&&!x(e.allowDots)&&a("stringify",'"allowDots" must be a boolean'),!c(e.skipNulls)&&!x(e.skipNulls)&&a("stringify",'"skipNulls" must be a boolean'),!c(e.strictNullHandling)&&!x(e.strictNullHandling)&&a("stringify",'"strictNullHandling" must be a boolean'),!c(e.addQueryPrefix)&&!x(e.addQueryPrefix)&&a("stringify",'"addQueryPrefix" must be a boolean'),!c(e.delimiter)&&!T(e.delimiter)&&a("stringify",'"delimiter" must be a string'),!c(e.encodeDotInKeys)&&!x(e.encodeDotInKeys)&&a("stringify",'"encodeDotInKeys" must be a boolean'),!c(e.commaRoundTrip)&&!x(e.commaRoundTrip)&&a("stringify",'"commaRoundTrip" must be a boolean'),!c(e.allowEmptyArrays)&&!x(e.allowEmptyArrays)&&a("stringify",'"allowEmptyArrays" must be a boolean')}var le={stringify:e=>(j(e)||a("stringify","Input must be an object"),new URLSearchParams(e).toString()),parse:e=>(T(e)||a("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(e).entries())),appendQueryString:(e,t)=>{let r=le.stringify(t);return e.includes("?")?e.endsWith("?")||e.endsWith("&")?`${e}${r}`:`${e}&${r}`:`${e}?${r}`}};function Le(e,t=500){let r=null;return function(...n){if(te(r))return r=Date.now(),e.apply(this,n);let o=Date.now();if(o-r>=t)return r=o,e.apply(this,n)}}function Ue(e){Be(e);let{fn:t,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:o=!1,signal:f}=e,s,u=f?new Promise((P,A)=>{let k=()=>A(ge());f.addEventListener("abort",k),s=()=>f.removeEventListener("abort",k)}):null;return new Promise((P,A)=>{(async()=>{for(let O=1;O<=r;O++){if(f?.aborted)return A(ge());try{let b=await Promise.race(u?[t(),u]:[t()]);return P(b)}catch(b){let $=o?n*2**(O-1):n;if(log("withRetry",`Attempt ${O}/${r} failed. Retrying in ${$}ms...`),b instanceof Error&&b.name==="AbortError"||O===r)return A(b);await new Promise(F=>setTimeout(F,$))}}})()}).finally(()=>s?.())}function Be(e){h(e)||a("withRetry",'"Options" must be an object'),typeof e.fn!="function"&&a("withRetry",'"fn" must be a function that returns a Promise'),!c(e.maxAttempts)&&(!Number.isInteger(e.maxAttempts)||e.maxAttempts<1)&&a("withRetry",'"maxAttempts" must be a positive integer'),!c(e.retryDelay)&&(!y(e.retryDelay)||e.retryDelay<0)&&a("withRetry",'"retryDelay" must be a non-negative number'),!c(e.enableExponentialBackoff)&&!x(e.enableExponentialBackoff)&&a("withRetry",'"enableExponentialBackoff" must be a boolean'),!c(e.signal)&&typeof e.signal!="object"&&a("withRetry",'"signal" must be an AbortSignal')}var He="The operation was aborted";function ge(e=He){let t=new Error(e);return t.name="AbortError",t}function re(e){j(e)||a("hasCircularReference",'"obj" must be a object');let t=new Set;function r(n){if(j(n)){if(t.has(n))return!0;t.add(n);for(let o of Object.keys(n))if(r(n[o]))return!0;t.delete(n)}return!1}return r(e)}function ne(e,t,r={}){let{includeProto:n=!1,includeSymbols:o=!0,includeNonEnum:f=!1}=r,s={};return h(e)&&N(t).forEach(g=>{q(g)&&!o||!(n?g in e:Object.hasOwn(e,g))||!f&&(n?Ve(e,g):Object.getOwnPropertyDescriptor(e,g))?.enumerable===!1||(s[g]=I(e[g]))}),s}function Ve(e,t){let r=e;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function We(e,t){if(!h(e))return{};let r=I(e),n=N(t),o=Object.keys(r).filter(f=>!n.includes(f));return ne(r,o)}function Ge(e){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(e)}function ve(e){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function ze(e){return/^(?:0|[1-9]\d*)\.\d+$/.test(e)}function qe(e){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function Qe(e){return/^-(?:0|[1-9]\d*)\.\d+$/.test(e)}function Xe(e){return/^-?(?:0|[1-9]\d*)$/.test(e)}function Je(e){return/^[1-9]\d*$/.test(e)}function oe(e){return/^(?:0|[1-9]\d*)$/.test(e)&&!Object.is(e,-0)}function Ze(e){return/^-[1-9]\d*$/.test(e)}function et(e){return/^-(?:0|[1-9]\d*)$/.test(e)||Object.is(e,-0)}var de=B(require("dayjs"),1);function ie(e,t="YYYY-MM-DD HH:mm:ss"){return(0,de.default)(e,t,!0).isValid()}function tt(e){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(e)}function rt(e){return e===""}var ae=B(require("dayjs"),1);function nt(e){if(!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/i.test(e))return!1;let r=e.slice(6,14);return ie(r,"YYYYMMDD")&&(0,ae.default)(r,"YYYYMMDD").isBefore((0,ae.default)())}function ot(e){return/^1[3-9]\d{9}$/.test(e)}var it=e=>{if(!T(e)||!/^-?\d+(?:\.\d+)?$/.test(e))return!1;let r=Number(e);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};function at(e){return/^https?:\/\/\S+$/i.test(e)}function st(e,t){return(!y(e)||!oe(e.toString()))&&a("generateRandomArray","num must be greater than 0"),_(t)||a("generateRandomArray","cb must be a function"),Array.from({length:e},()=>t())}function mt(){return`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`}var S=B(require("dayjs"),1),be=B(require("dayjs/plugin/customParseFormat.js"),1);function w(e){return e[Math.floor(Math.random()*e.length)]}function p(e={}){y(e)&&(e={max:e});let{min:t=1,max:r=w(ct())}=e;ft(t,r);let n=Math.ceil(t),o=Math.floor(r);return Math.floor(Math.random()*(o-n+1)+n)}function ft(e,t){let r=Math.ceil(e),n=Math.floor(t);Number.isSafeInteger(r)||a("getRandomInt",`The minimum value Math.ceil(${e}) should be a safe integer`),Number.isSafeInteger(n)||a("getRandomInt",`The maximum value Math.floor(${t}) should be a safe integer`),n<r&&(t>=e&&a("getRandomInt",`No integer value found between ${e} and ${t}`),a("getRandomInt",`The maximum value ${t} should be greater than the minimum value ${e}`))}function ct(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((e,t)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,t+1);return Number(r)})}S.default.extend(be.default);function G(e={}){let{start:t="1800-01-01 00:00:00",end:r=(0,S.default)().format("YYYY-MM-DD HH:mm:ss"),format:n="YYYY-MM-DD HH:mm:ss"}=e;(!(0,S.default)(t).isValid()||!(0,S.default)(r).isValid())&&a("generateRandomDate","start and end parameters must be valid date format");let o=(0,S.default)(t).year(),f=(0,S.default)(r).year(),s=p({min:o,max:f}),u=p({min:1,max:12}),g=p({min:1,max:31}),P=p(23),A=p(59),k=p(59),O=(0,S.default)(`${s}-${u}-${g} ${P}:${A}:${k}`);return O.isBefore((0,S.default)(t))||O.isAfter((0,S.default)(r))?G(e):O.format(n)}function R(e={}){let t=pt(e),r=lt(t);gt(r);let{length:n}=t;dt(n.min,n.max);let o=p(n),f=t.prefix||"";for(let s=0;s<o;s++)f+=r.charAt(Math.floor(Math.random()*r.length));return f+(t.suffix||"")}var ut=16,se=1;function pt(e){let t=y(e);return{lowerCase:!0,upperCase:!0,number:!0,...t?{}:e,length:t?{max:e,min:e}:y(e.length)?{max:e.length,min:e.length}:{max:ut,min:se,...e.length},extra:t?[]:[...new Set(N(e.extra||[]))]}}function lt(e){let t="";return e.lowerCase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.upperCase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.number&&(t+="0123456789"),t+=N(e.extra).join(""),t}function gt(e){e.length===0&&a("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function dt(e,t){Number.isInteger(e)||a("getRandomString","min must be an integer"),Number.isInteger(t)||a("getRandomString","max must be an integer"),e<se&&a("getRandomString",`Minimum length cannot be less than ${se}`),t<e&&a("getRandomString","Maximum length cannot be less than minimum length")}function ye(){let e=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],t=`${R(1)}${R({length:p({max:30,min:1})})}${R(1)}@${w(e)}`;return/\.{2,}/.test(t)?ye():t}function bt(e={}){y(e)&&(e={max:e});let{min:t=0,max:r=1,fractionDigits:n=2}=e;if(t===r)return t;if(t>r)throw new Error(`Maximum value ${r} should be greater than minimum value ${t}`);let o=Math.random()*(r-t)+t;return Number(o.toFixed(n))}function v(e,t){(!y(e)||e<=0)&&a("generateRandomStringFromSource","num must be greater than 0"),(!d(t)||t.length===0)&&a("generateRandomStringFromSource","source cannot be empty array");let r="";for(let n=0;n<e;n++)r+=w(t);return r}function yt(){let e=p({min:1e5,max:999999}),t=[0,1,2,3,4,5,6,7,8,9];return[e,G({format:"YYYYMMDD"}),v(3,t),v(1,[...t,"X","x"])].join("")}function xt(){return w(["13","14","15","16","17","18","19"])+p(999999999).toString().padEnd(9,"0")}function ht(){let e=["http://","https://"],t=[".com",".net",".org",".cn",".top"],r=[`?name=${R({length:{min:4,max:8}})}`,`?id=${p()}`,`?page=${R({length:{min:2,max:4}})}`,`?query=${R({length:{min:5,max:6}})}`,`?search=${R({length:{min:1,max:4}})}`,`?token=${R({length:{min:16,max:16}})}`];return`${w(e)}${R({length:{min:5,max:25}})}${w(t)}${w(r)}`}0&&(module.exports={UtilsError,base64Decode,base64Encode,castArray,compose,composeRight,debounce,debugWarn,decimalToBinary,deepClone,deepMerge,generateRandomArray,generateRandomColor,generateRandomDate,generateRandomEmail,generateRandomFloat,generateRandomIdCard,generateRandomMobilePhone,generateRandomStringFromSource,getRandomInt,getRandomItem,getRandomString,getRandomUrl,hasChanged,hasCircularReference,isArray,isBoolean,isDate,isDateString,isDef,isEmail,isEmptyString,isFloat,isFunction,isIdCard,isInteger,isMap,isMobilePhone,isNegativeFloat,isNegativeInteger,isNil,isNonNegativeFloat,isNonNegativeInteger,isNonPositiveFloat,isNonPositiveInteger,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPositiveFloat,isPositiveInteger,isPromise,isRegExp,isSet,isString,isStringNumber,isSymbol,isURL,isUndef,objectToString,omit,pick,qs,qsStringify,throttle,throwError,toTypeString,toTypeValue,withRetry});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var tt=Object.create;var Ne=Object.defineProperty;var rt=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var ot=Object.getPrototypeOf,it=Object.prototype.hasOwnProperty;var st=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ie=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var at=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of nt(t))!it.call(e,s)&&s!==r&&Ne(e,s,{get:()=>t[s],enumerable:!(n=rt(t,s))||n.enumerable});return e};var de=(e,t,r)=>(r=e!=null?tt(ot(e)):{},at(t||!e||!e.__esModule?Ne(r,"default",{value:e,enumerable:!0}):r,e));import At from"path";import{fileURLToPath as jt}from"url";var o=st(()=>{"use strict"});var $e=Ie((Ae,Re)=>{"use strict";o();(function(e,t){typeof Ae=="object"&&typeof Re<"u"?Re.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(Ae,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",s="second",M="minute",y="hour",S="day",x="week",v="month",L="quarter",N="year",P="date",I="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,T={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(c){var a=["th","st","nd","rd"],i=c%100;return"["+c+(a[(i-20)%10]||a[i]||a[0])+"]"}},A=function(c,a,i){var u=String(c);return!u||u.length>=a?c:""+Array(a+1-u.length).join(i)+c},O={s:A,z:function(c){var a=-c.utcOffset(),i=Math.abs(a),u=Math.floor(i/60),f=i%60;return(a<=0?"+":"-")+A(u,2,"0")+":"+A(f,2,"0")},m:function c(a,i){if(a.date()<i.date())return-c(i,a);var u=12*(i.year()-a.year())+(i.month()-a.month()),f=a.clone().add(u,v),d=i-f<0,g=a.clone().add(u+(d?-1:1),v);return+(-(u+(i-f)/(d?f-g:g-f))||0)},a:function(c){return c<0?Math.ceil(c)||0:Math.floor(c)},p:function(c){return{M:v,y:N,w:x,d:S,D:P,h:y,m:M,s,ms:n,Q:L}[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(c){return c===void 0}},D="en",k={};k[D]=T;var F="$isDayjsObject",Y=function(c){return c instanceof K||!(!c||!c[F])},W=function c(a,i,u){var f;if(!a)return D;if(typeof a=="string"){var d=a.toLowerCase();k[d]&&(f=d),i&&(k[d]=i,f=d);var g=a.split("-");if(!f&&g.length>1)return c(g[0])}else{var b=a.name;k[b]=a,f=b}return!u&&f&&(D=f),f||!u&&D},R=function(c,a){if(Y(c))return c.clone();var i=typeof a=="object"?a:{};return i.date=c,i.args=arguments,new K(i)},$=O;$.l=W,$.i=Y,$.w=function(c,a){return R(c,{locale:a.$L,utc:a.$u,x:a.$x,$offset:a.$offset})};var K=function(){function c(i){this.$L=W(i.locale,null,!0),this.parse(i),this.$x=this.$x||i.x||{},this[F]=!0}var a=c.prototype;return a.parse=function(i){this.$d=function(u){var f=u.date,d=u.utc;if(f===null)return new Date(NaN);if($.u(f))return new Date;if(f instanceof Date)return new Date(f);if(typeof f=="string"&&!/Z$/i.test(f)){var g=f.match(m);if(g){var b=g[2]-1||0,j=(g[7]||"0").substring(0,3);return d?new Date(Date.UTC(g[1],b,g[3]||1,g[4]||0,g[5]||0,g[6]||0,j)):new Date(g[1],b,g[3]||1,g[4]||0,g[5]||0,g[6]||0,j)}}return new Date(f)}(i),this.init()},a.init=function(){var i=this.$d;this.$y=i.getFullYear(),this.$M=i.getMonth(),this.$D=i.getDate(),this.$W=i.getDay(),this.$H=i.getHours(),this.$m=i.getMinutes(),this.$s=i.getSeconds(),this.$ms=i.getMilliseconds()},a.$utils=function(){return $},a.isValid=function(){return this.$d.toString()!==I},a.isSame=function(i,u){var f=R(i);return this.startOf(u)<=f&&f<=this.endOf(u)},a.isAfter=function(i,u){return R(i)<this.startOf(u)},a.isBefore=function(i,u){return this.endOf(u)<R(i)},a.$g=function(i,u,f){return $.u(i)?this[u]:this.set(f,i)},a.unix=function(){return Math.floor(this.valueOf()/1e3)},a.valueOf=function(){return this.$d.getTime()},a.startOf=function(i,u){var f=this,d=!!$.u(u)||u,g=$.p(i),b=function(ee,H){var G=$.w(f.$u?Date.UTC(f.$y,H,ee):new Date(f.$y,H,ee),f);return d?G:G.endOf(S)},j=function(ee,H){return $.w(f.toDate()[ee].apply(f.toDate("s"),(d?[0,0,0,0]:[23,59,59,999]).slice(H)),f)},E=this.$W,C=this.$M,z=this.$D,oe="set"+(this.$u?"UTC":"");switch(g){case N:return d?b(1,0):b(31,11);case v:return d?b(1,C):b(0,C+1);case x:var re=this.$locale().weekStart||0,fe=(E<re?E+7:E)-re;return b(d?z-fe:z+(6-fe),C);case S:case P:return j(oe+"Hours",0);case y:return j(oe+"Minutes",1);case M:return j(oe+"Seconds",2);case s:return j(oe+"Milliseconds",3);default:return this.clone()}},a.endOf=function(i){return this.startOf(i,!1)},a.$set=function(i,u){var f,d=$.p(i),g="set"+(this.$u?"UTC":""),b=(f={},f[S]=g+"Date",f[P]=g+"Date",f[v]=g+"Month",f[N]=g+"FullYear",f[y]=g+"Hours",f[M]=g+"Minutes",f[s]=g+"Seconds",f[n]=g+"Milliseconds",f)[d],j=d===S?this.$D+(u-this.$W):u;if(d===v||d===N){var E=this.clone().set(P,1);E.$d[b](j),E.init(),this.$d=E.set(P,Math.min(this.$D,E.daysInMonth())).$d}else b&&this.$d[b](j);return this.init(),this},a.set=function(i,u){return this.clone().$set(i,u)},a.get=function(i){return this[$.p(i)]()},a.add=function(i,u){var f,d=this;i=Number(i);var g=$.p(u),b=function(C){var z=R(d);return $.w(z.date(z.date()+Math.round(C*i)),d)};if(g===v)return this.set(v,this.$M+i);if(g===N)return this.set(N,this.$y+i);if(g===S)return b(1);if(g===x)return b(7);var j=(f={},f[M]=t,f[y]=r,f[s]=e,f)[g]||1,E=this.$d.getTime()+i*j;return $.w(E,this)},a.subtract=function(i,u){return this.add(-1*i,u)},a.format=function(i){var u=this,f=this.$locale();if(!this.isValid())return f.invalidDate||I;var d=i||"YYYY-MM-DDTHH:mm:ssZ",g=$.z(this),b=this.$H,j=this.$m,E=this.$M,C=f.weekdays,z=f.months,oe=f.meridiem,re=function(H,G,ne,ie){return H&&(H[G]||H(u,d))||ne[G].slice(0,ie)},fe=function(H){return $.s(b%12||12,H,"0")},ee=oe||function(H,G,ne){var ie=H<12?"AM":"PM";return ne?ie.toLowerCase():ie};return d.replace(w,function(H,G){return G||function(ne){switch(ne){case"YY":return String(u.$y).slice(-2);case"YYYY":return $.s(u.$y,4,"0");case"M":return E+1;case"MM":return $.s(E+1,2,"0");case"MMM":return re(f.monthsShort,E,z,3);case"MMMM":return re(z,E);case"D":return u.$D;case"DD":return $.s(u.$D,2,"0");case"d":return String(u.$W);case"dd":return re(f.weekdaysMin,u.$W,C,2);case"ddd":return re(f.weekdaysShort,u.$W,C,3);case"dddd":return C[u.$W];case"H":return String(b);case"HH":return $.s(b,2,"0");case"h":return fe(1);case"hh":return fe(2);case"a":return ee(b,j,!0);case"A":return ee(b,j,!1);case"m":return String(j);case"mm":return $.s(j,2,"0");case"s":return String(u.$s);case"ss":return $.s(u.$s,2,"0");case"SSS":return $.s(u.$ms,3,"0");case"Z":return g}return null}(H)||g.replace(":","")})},a.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},a.diff=function(i,u,f){var d,g=this,b=$.p(u),j=R(i),E=(j.utcOffset()-this.utcOffset())*t,C=this-j,z=function(){return $.m(g,j)};switch(b){case N:d=z()/12;break;case v:d=z();break;case L:d=z()/3;break;case x:d=(C-E)/6048e5;break;case S:d=(C-E)/864e5;break;case y:d=C/r;break;case M:d=C/t;break;case s:d=C/e;break;default:d=C}return f?d:$.a(d)},a.daysInMonth=function(){return this.endOf(v).$D},a.$locale=function(){return k[this.$L]},a.locale=function(i,u){if(!i)return this.$L;var f=this.clone(),d=W(i,u,!0);return d&&(f.$L=d),f},a.clone=function(){return $.w(this.$d,this)},a.toDate=function(){return new Date(this.valueOf())},a.toJSON=function(){return this.isValid()?this.toISOString():null},a.toISOString=function(){return this.$d.toISOString()},a.toString=function(){return this.$d.toUTCString()},c}(),V=K.prototype;return R.prototype=V,[["$ms",n],["$s",s],["$m",M],["$H",y],["$W",S],["$M",v],["$y",N],["$D",P]].forEach(function(c){V[c[1]]=function(a){return this.$g(a,c[0],c[1])}}),R.extend=function(c,a){return c.$i||(c(a,K,R),c.$i=!0),R},R.locale=W,R.isDayjs=Y,R.unix=function(c){return R(1e3*c)},R.en=k[D],R.Ls=k,R.p={},R})});var Xe=Ie((je,Ee)=>{"use strict";o();(function(e,t){typeof je=="object"&&typeof Ee<"u"?Ee.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_customParseFormat=t()})(je,function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,s=/\d\d?/,M=/\d*[^-_:/,()\s\d]+/,y={},S=function(m){return(m=+m)+(m>68?1900:2e3)},x=function(m){return function(w){this[m]=+w}},v=[/[+-]\d\d:?(\d\d)?|Z/,function(m){(this.zone||(this.zone={})).offset=function(w){if(!w||w==="Z")return 0;var T=w.match(/([+-]|\d\d)/g),A=60*T[1]+(+T[2]||0);return A===0?0:T[0]==="+"?-A:A}(m)}],L=function(m){var w=y[m];return w&&(w.indexOf?w:w.s.concat(w.f))},N=function(m,w){var T,A=y.meridiem;if(A){for(var O=1;O<=24;O+=1)if(m.indexOf(A(O,0,w))>-1){T=O>12;break}}else T=m===(w?"pm":"PM");return T},P={A:[M,function(m){this.afternoon=N(m,!1)}],a:[M,function(m){this.afternoon=N(m,!0)}],Q:[r,function(m){this.month=3*(m-1)+1}],S:[r,function(m){this.milliseconds=100*+m}],SS:[n,function(m){this.milliseconds=10*+m}],SSS:[/\d{3}/,function(m){this.milliseconds=+m}],s:[s,x("seconds")],ss:[s,x("seconds")],m:[s,x("minutes")],mm:[s,x("minutes")],H:[s,x("hours")],h:[s,x("hours")],HH:[s,x("hours")],hh:[s,x("hours")],D:[s,x("day")],DD:[n,x("day")],Do:[M,function(m){var w=y.ordinal,T=m.match(/\d+/);if(this.day=T[0],w)for(var A=1;A<=31;A+=1)w(A).replace(/\[|\]/g,"")===m&&(this.day=A)}],w:[s,x("week")],ww:[n,x("week")],M:[s,x("month")],MM:[n,x("month")],MMM:[M,function(m){var w=L("months"),T=(L("monthsShort")||w.map(function(A){return A.slice(0,3)})).indexOf(m)+1;if(T<1)throw new Error;this.month=T%12||T}],MMMM:[M,function(m){var w=L("months").indexOf(m)+1;if(w<1)throw new Error;this.month=w%12||w}],Y:[/[+-]?\d+/,x("year")],YY:[n,function(m){this.year=S(m)}],YYYY:[/\d{4}/,x("year")],Z:v,ZZ:v};function I(m){var w,T;w=m,T=y&&y.formats;for(var A=(m=w.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(R,$,K){var V=K&&K.toUpperCase();return $||T[K]||e[K]||T[V].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(c,a,i){return a||i.slice(1)})})).match(t),O=A.length,D=0;D<O;D+=1){var k=A[D],F=P[k],Y=F&&F[0],W=F&&F[1];A[D]=W?{regex:Y,parser:W}:k.replace(/^\[|\]$/g,"")}return function(R){for(var $={},K=0,V=0;K<O;K+=1){var c=A[K];if(typeof c=="string")V+=c.length;else{var a=c.regex,i=c.parser,u=R.slice(V),f=a.exec(u)[0];i.call($,f),R=R.replace(f,"")}}return function(d){var g=d.afternoon;if(g!==void 0){var b=d.hours;g?b<12&&(d.hours+=12):b===12&&(d.hours=0),delete d.afternoon}}($),$}}return function(m,w,T){T.p.customParseFormat=!0,m&&m.parseTwoDigitYear&&(S=m.parseTwoDigitYear);var A=w.prototype,O=A.parse;A.parse=function(D){var k=D.date,F=D.utc,Y=D.args;this.$u=F;var W=Y[1];if(typeof W=="string"){var R=Y[2]===!0,$=Y[3]===!0,K=R||$,V=Y[2];$&&(V=Y[2]),y=this.$locale(),!R&&V&&(y=T.Ls[V]),this.$d=function(u,f,d,g){try{if(["x","X"].indexOf(f)>-1)return new Date((f==="X"?1e3:1)*u);var b=I(f)(u),j=b.year,E=b.month,C=b.day,z=b.hours,oe=b.minutes,re=b.seconds,fe=b.milliseconds,ee=b.zone,H=b.week,G=new Date,ne=C||(j||E?1:G.getDate()),ie=j||G.getFullYear(),le=0;j&&!E||(le=E>0?E-1:G.getMonth());var pe,we=z||0,Me=oe||0,Oe=re||0,De=fe||0;return ee?new Date(Date.UTC(ie,le,ne,we,Me,Oe,De+60*ee.offset*1e3)):d?new Date(Date.UTC(ie,le,ne,we,Me,Oe,De)):(pe=new Date(ie,le,ne,we,Me,Oe,De),H&&(pe=g(pe).week(H).toDate()),pe)}catch{return new Date("")}}(k,W,F,T),this.init(),V&&V!==!0&&(this.$L=this.locale(V).$L),K&&k!=this.format(W)&&(this.$d=new Date("")),y={}}else if(W instanceof Array)for(var c=W.length,a=1;a<=c;a+=1){Y[1]=W[a-1];var i=T.apply(this,Y);if(i.isValid()){this.$d=i.$d,this.$L=i.$L,this.init();break}a===c&&(this.$d=new Date(""))}else O.call(this,D)}}})});o();o();o();o();o();function se(e){let t=typeof e;return e!==null&&(t==="object"||t==="function")}o();function ge(e){return e!==null&&typeof e=="object"}o();o();var ft=Object.prototype.toString,ue=e=>ft.call(e),Se=e=>ue(e).slice(8,-1),ae=e=>typeof e=="string",Z=e=>typeof e=="number"&&Number.isFinite(e),Q=e=>typeof e=="boolean",Te=e=>e===null,_=e=>e===void 0,_e=e=>typeof e=="symbol",B=Array.isArray,he=e=>typeof e=="function",Ce=e=>ue(e)==="[object Map]",Le=e=>ue(e)==="[object Set]",Fe=e=>ue(e)==="[object Date]",He=e=>ue(e)==="[object RegExp]",Ue=e=>ge(e)&&he(e?.then)&&he(e?.catch),Ke=e=>e==null,It=e=>e!=null,_t=(e,t)=>e!==t;function X(e){return ue(e)==="[object Object]"}function ce(e){return B(e)?e:[e]}o();o();o();o();function tr(e){let t=[],r,n="";for(;e>0;)r=Math.floor(e%2),t.push(r),e=Math.floor(e/2);for(;t.length>0;)n+=t.pop().toString();return n}var We="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function rr(e){let t="",r="";for(let s=0;s<e.length;s++)r+=e[s].charCodeAt(0).toString(2).padStart(8,"0");for(let s=0;s<r.length;s+=6)t+=We[Number.parseInt(r.slice(s,s+6).padEnd(6,"0"),2)];let n=t.length%4;return n!==0&&(t+="=".repeat(4-n)),t}function nr(e){let t="",r="";for(let n=0;n<e.length&&e[n]!=="=";n++)r+=We.indexOf(e[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let s=Number.parseInt(r.slice(n,n+8),2);s&&(t+=String.fromCharCode(s))}return t}o();function sr(...e){return e.reduce((t,r)=>function(...n){return r(t(...n))})}function ar(...e){return e.reduce((t,r)=>function(...n){return t(r(...n))})}o();function cr(e,t=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}o();function me(e){let t=new WeakMap;function r(n){if(!ge(n))return n;if(Fe(n))return new Date(n);if(He(n))return new RegExp(n);if(Ue(n))return n;if(t.has(n))return t.get(n);if(Ce(n)){let y=new Map;return t.set(n,y),n.forEach((S,x)=>y.set(r(x),r(S))),y}if(Le(n)){let y=new Set;return t.set(n,y),n.forEach(S=>y.add(r(S))),y}let s=B(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));t.set(n,s);let M=Object.getOwnPropertyDescriptors(n);for(let y of Reflect.ownKeys(M)){let S=M[y];S.get||S.set?Object.defineProperty(s,y,S):Object.defineProperty(s,y,{...S,value:r(S.value)})}return s}return r(e)}o();function br(e,t,r={}){return ze(Ve(e,r),Ve(t,r),r)}function ze(e,t,r){return B(e)?ct(e,t,r):ut(e,t,r)}function ut(e,t,r){if(!X(t))return t;let n=Object.getOwnPropertyDescriptors(t);return Reflect.ownKeys(t).forEach(s=>{(X(e[s])||B(e[s]))&&(X(t[s])||B(t[s]))?e[s]=ze(e[s],t[s],r):Object.defineProperty(e,s,n[s])}),e}function ct(e,t,r){let{mergeStrategy:n="replace"}=r;if(B(t))switch(n){case"merge":return e.concat(t);case"replace":return t;default:return t}return t}function Ve(e,t){let{deepClone:r=!0}=t;return r?me(e):e}o();var ye=class extends Error{constructor(t,r="Utils"){super(t),this.name=r}};function h(e,t){throw new ye(`[${e}] ${t}`)}function Be(e,t){let r=ae(e)?new ye(`[${e}] ${t}`,"UtilsWarn"):e;console.warn(r)}var Mr=({from:e,replacement:t,version:r,type:n="API"})=>{Be(`${n}`,`${e} is about to be deprecated in version ${r}, please use ${t} instead.`)};function Or(e,t,r,n){let s=`Invalid params: type check failed for params "${t}". Expected ${r}, got ${Se(n)} with value ${n}.`;h(e,s)}function Dr(e,t,r,n){let s=`Invalid params: type check failed for params "${t}". Expected ${r}, got ${Se(n)} with value ${n}.`;Be(e,s)}o();var be=(e,t,...r)=>{if(!t)return;let n=r.length===0?"":r.length===1?r[0]:r;console[e](`[Log] ${t}:`,n)},xe=(e,...t)=>{be("info",e,...t)};xe.info=(e,...t)=>{be("info",e,...t)};xe.error=(e,...t)=>{be("error",e,...t)};xe.warn=(e,...t)=>{be("warn",e,...t)};typeof globalThis<"u"&&(globalThis.log=xe);o();function vr(e,t={}){mt(t);let{encode:r=!0,encodeValuesOnly:n=!1,arrayFormat:s="indices",encodeDotInKeys:M=!1,skipNulls:y=!1,strictNullHandling:S=!1,commaRoundTrip:x=!1,allowEmptyArrays:v=!1,addQueryPrefix:L=!1,delimiter:N="&"}=t,P=t.allowDots??!1;M&&_(t.allowDots)&&(P=!0);let I=[],m=O=>r&&!n?encodeURIComponent(O):O,w=O=>r?encodeURIComponent(O):O;function T(O,D){if(!_(D)){if(Te(D)){if(y)return;I.push(`${m(O)}${S?"":"="}`);return}if(B(D)){if(D.length===0){v&&I.push(`${m(O)}[]`);return}if(s==="comma"){let k=n?D.map(w).join(","):w(D.join(","));if(D.length===1&&Te(D[0])){if(y)return;I.push(`${m(O)}${x?"[]":""}${S?"":"="}`)}else D.length===1?I.push(`${m(O)}${x?"[]":""}=${k}`):I.push(`${m(O)}=${k}`);return}D.forEach((k,F)=>{let Y=O;s==="indices"?Y=`${O}[${F}]`:s==="brackets"&&(Y=`${O}[]`),T(Y,k)});return}if(se(D)){Object.keys(D).forEach(k=>{let F=O;M&&(F=F.replace(/\./g,"%2E"));let Y=k;P?(M&&(Y=Y.replace(/\./g,"%2E")),T(`${F}.${Y}`,D[k])):T(`${F}[${Y}]`,D[k])});return}I.push(`${m(O)}=${w(D)}`)}}if(!se(e))return"";Ze(e)&&h("stringify","Input object contains circular references, cannot stringify"),B(e)?e.forEach((O,D)=>T(`${D}`,O)):Object.keys(e).forEach(O=>T(O,e[O]));let A=I.join(N);return L&&A?`?${A}`:A}function mt(e={}){X(e)||h("stringify",'"options" must be a plain object'),!_(e.encode)&&!Q(e.encode)&&h("stringify",'"encode" must be a boolean'),!_(e.encodeValuesOnly)&&!Q(e.encodeValuesOnly)&&h("stringify",'"encodeValuesOnly" must be a boolean'),!_(e.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(e.arrayFormat)&&h("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!_(e.allowDots)&&!Q(e.allowDots)&&h("stringify",'"allowDots" must be a boolean'),!_(e.skipNulls)&&!Q(e.skipNulls)&&h("stringify",'"skipNulls" must be a boolean'),!_(e.strictNullHandling)&&!Q(e.strictNullHandling)&&h("stringify",'"strictNullHandling" must be a boolean'),!_(e.addQueryPrefix)&&!Q(e.addQueryPrefix)&&h("stringify",'"addQueryPrefix" must be a boolean'),!_(e.delimiter)&&!ae(e.delimiter)&&h("stringify",'"delimiter" must be a string'),!_(e.encodeDotInKeys)&&!Q(e.encodeDotInKeys)&&h("stringify",'"encodeDotInKeys" must be a boolean'),!_(e.commaRoundTrip)&&!Q(e.commaRoundTrip)&&h("stringify",'"commaRoundTrip" must be a boolean'),!_(e.allowEmptyArrays)&&!Q(e.allowEmptyArrays)&&h("stringify",'"allowEmptyArrays" must be a boolean')}o();var lt={stringify:e=>(se(e)||h("stringify","Input must be an object"),new URLSearchParams(e).toString()),parse:e=>(ae(e)||h("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(e).entries())),appendQueryString:(e,t)=>{let r=lt.stringify(t);return e.includes("?")?e.endsWith("?")||e.endsWith("&")?`${e}${r}`:`${e}&${r}`:`${e}?${r}`}};o();function Lr(e,t=500){let r=null;return function(...n){if(Ke(r))return r=Date.now(),e.apply(this,n);let s=Date.now();if(s-r>=t)return r=s,e.apply(this,n)}}o();o();function Br(e){pt(e);let{fn:t,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:s=!1,signal:M}=e,y,S=M?new Promise((v,L)=>{let N=()=>L(Ge());M.addEventListener("abort",N),y=()=>M.removeEventListener("abort",N)}):null;return new Promise((v,L)=>{(async()=>{for(let P=1;P<=r;P++){if(M?.aborted)return L(Ge());try{let I=await Promise.race(S?[t(),S]:[t()]);return v(I)}catch(I){let m=s?n*2**(P-1):n;if(log("withRetry",`Attempt ${P}/${r} failed. Retrying in ${m}ms...`),I instanceof Error&&I.name==="AbortError"||P===r)return L(I);await new Promise(w=>setTimeout(w,m))}}})()}).finally(()=>y?.())}function pt(e){X(e)||h("withRetry",'"Options" must be an object'),typeof e.fn!="function"&&h("withRetry",'"fn" must be a function that returns a Promise'),!_(e.maxAttempts)&&(!Number.isInteger(e.maxAttempts)||e.maxAttempts<1)&&h("withRetry",'"maxAttempts" must be a positive integer'),!_(e.retryDelay)&&(!Z(e.retryDelay)||e.retryDelay<0)&&h("withRetry",'"retryDelay" must be a non-negative number'),!_(e.enableExponentialBackoff)&&!Q(e.enableExponentialBackoff)&&h("withRetry",'"enableExponentialBackoff" must be a boolean'),!_(e.signal)&&typeof e.signal!="object"&&h("withRetry",'"signal" must be an AbortSignal')}var dt="The operation was aborted";function Ge(e=dt){let t=new Error(e);return t.name="AbortError",t}function Ze(e){se(e)||h("hasCircularReference",'"obj" must be a object');let t=new Set;function r(n){if(se(n)){if(t.has(n))return!0;t.add(n);for(let s of Object.keys(n))if(r(n[s]))return!0;t.delete(n)}return!1}return r(e)}o();o();function Qe(e,t,r={}){let{includeProto:n=!1,includeSymbols:s=!0,includeNonEnum:M=!1}=r,y={};return X(e)&&ce(t).forEach(x=>{_e(x)&&!s||!(n?x in e:Object.hasOwn(e,x))||!M&&(n?gt(e,x):Object.getOwnPropertyDescriptor(e,x))?.enumerable===!1||(y[x]=me(e[x]))}),y}function gt(e,t){let r=e;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function Dn(e,t){if(!X(e))return{};let r=me(e),n=ce(t),s=Object.keys(r).filter(M=>!n.includes(M));return Qe(r,s)}o();o();function Pn(e,t){return(!Z(e)||e<=0)&&h("generateRandomArray","num must be greater than 0"),he(t)||h("generateRandomArray","cb must be a function"),Array.from({length:e}).fill(0).map((r,n)=>t(r,n))}o();function _n(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}o();var te=de($e(),1),qe=de(Xe(),1);o();o();function q(e){return e[Math.floor(Math.random()*e.length)]}function U(e={}){Z(e)&&(e={max:e});let{min:t=1,max:r=q(yt())}=e;ht(t,r);let n=Math.ceil(t),s=Math.floor(r);return Math.floor(Math.random()*(s-n+1)+n)}function ht(e,t){let r=Math.ceil(e),n=Math.floor(t);Number.isSafeInteger(r)||h("getRandomInt",`The minimum value Math.ceil(${e}) should be a safe integer`),Number.isSafeInteger(n)||h("getRandomInt",`The maximum value Math.floor(${t}) should be a safe integer`),n<r&&(t>=e&&h("getRandomInt",`No integer value found between ${e} and ${t}`),h("getRandomInt",`The maximum value ${t} should be greater than the minimum value ${e}`))}function yt(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((e,t)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,t+1);return Number(r)})}te.default.extend(qe.default);function ve(e={}){let{start:t="1800-01-01 00:00:00",end:r=(0,te.default)().format("YYYY-MM-DD HH:mm:ss"),format:n="YYYY-MM-DD HH:mm:ss"}=e;(!(0,te.default)(t).isValid()||!(0,te.default)(r).isValid())&&h("generateRandomDate","start and end parameters must be valid date format");let s=(0,te.default)(t).year(),M=(0,te.default)(r).year(),y=U({min:s,max:M}),S=U({min:1,max:12}),x=U({min:1,max:31}),v=U(23),L=U(59),N=U(59),P=(0,te.default)(`${y}-${S}-${x} ${v}:${L}:${N}`);return P.isBefore((0,te.default)(t))||P.isAfter((0,te.default)(r))?ve(e):P.format(n)}o();o();function J(e={}){let t=xt(e),r=$t(t);wt(r);let{length:n}=t;Mt(n.min,n.max);let s=U(n),M=t.prefix||"";for(let y=0;y<s;y++)M+=r.charAt(Math.floor(Math.random()*r.length));return M+(t.suffix||"")}var bt=16,ke=1;function xt(e){let t=Z(e);return{lowerCase:!0,upperCase:!0,number:!0,...t?{}:e,length:t?{max:e,min:e}:Z(e.length)?{max:e.length,min:e.length}:{max:bt,min:ke,...e.length},extra:t?[]:[...new Set(ce(e.extra||[]))]}}function $t(e){let t="";return e.lowerCase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.upperCase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.number&&(t+="0123456789"),t+=ce(e.extra).join(""),t}function wt(e){e.length===0&&h("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function Mt(e,t){Number.isInteger(e)||h("getRandomString","min must be an integer"),Number.isInteger(t)||h("getRandomString","max must be an integer"),e<ke&&h("getRandomString",`Minimum length cannot be less than ${ke}`),t<e&&h("getRandomString","Maximum length cannot be less than minimum length")}function Ot(){let e=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],t=`${J(1)}${J({length:U({max:30,min:1})})}${J(1)}@${q(e)}`;return/\.{2,}/.test(t)?Ot():t}o();function mo(e={}){Z(e)&&(e={max:e});let{min:t=0,max:r=1,fractionDigits:n=2}=e;if(t===r)return t;if(t>r)throw new Error(`Maximum value ${r} should be greater than minimum value ${t}`);return Math.random()*(r-t)+t}o();o();function Ye(e,t){(!Z(e)||e<=0)&&h("generateRandomStringFromSource","num must be greater than 0"),(!B(t)||t.length===0)&&h("generateRandomStringFromSource","source cannot be empty array");let r="";for(let n=0;n<e;n++)r+=q(t);return r}function Oo(){let e=U({min:1e5,max:999999}),t=[0,1,2,3,4,5,6,7,8,9];return[e,ve({format:"YYYYMMDD"}),Ye(3,t),Ye(1,[...t,"X","x"])].join("")}o();function Ro(){return q(["13","14","15","16","17","18","19"])+U(999999999).toString().padEnd(9,"0")}o();function Po(){let e=["http://","https://"],t=[".com",".net",".org",".cn",".top"],r=[`?name=${J({length:{min:4,max:8}})}`,`?id=${U()}`,`?page=${J({length:{min:2,max:4}})}`,`?query=${J({length:{min:5,max:6}})}`,`?search=${J({length:{min:1,max:4}})}`,`?token=${J({length:{min:16,max:16}})}`];return`${q(e)}${J({length:{min:5,max:25}})}${q(t)}${q(r)}`}o();o();o();o();o();function ti(e){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(e)}function ri(e){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function ni(e){return/^(?:0|[1-9]\d*)\.\d+$/.test(e)}function oi(e){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function ii(e){return/^-(?:0|[1-9]\d*)\.\d+$/.test(e)}o();function fi(e){return/^-?(?:0|[1-9]\d*)$/.test(e)}function ui(e){return/^[1-9]\d*$/.test(e)}function ci(e){return/^(?:0|[1-9]\d*)$/.test(e)&&!Object.is(e,-0)}function mi(e){return/^-[1-9]\d*$/.test(e)}function li(e){return/^-(?:0|[1-9]\d*)$/.test(e)||Object.is(e,-0)}o();var Je=de($e(),1);function et(e,t="YYYY-MM-DD HH:mm:ss"){return(0,Je.default)(e,t,!0).isValid()}o();function yi(e){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(e)}o();function $i(e){return e===""}o();var Pe=de($e(),1);function Di(e){if(!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/i.test(e))return!1;let r=e.slice(6,14);return et(r,"YYYYMMDD")&&(0,Pe.default)(r,"YYYYMMDD").isBefore((0,Pe.default)())}o();function Ai(e){return/^1[3-9]\d{9}$/.test(e)}o();var vi=e=>{if(!ae(e)||!/^-?\d+(?:\.\d+)?$/.test(e))return!1;let r=Number(e);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};o();function Pi(e){return/^https?:\/\/\S+$/i.test(e)}export{ye as UtilsError,nr as base64Decode,rr as base64Encode,ce as castArray,sr as compose,ar as composeRight,cr as debounce,Be as debugWarn,Dr as debugWarnInvalidTypeMessage,tr as decimalToBinary,me as deepClone,br as deepMerge,Mr as deprecated,Pn as generateRandomArray,_n as generateRandomColor,ve as generateRandomDate,Ot as generateRandomEmail,mo as generateRandomFloat,Oo as generateRandomIdCard,Ro as generateRandomMobilePhone,Ye as generateRandomStringFromSource,U as getRandomInt,q as getRandomItem,J as getRandomString,Po as getRandomUrl,_t as hasChanged,Ze as hasCircularReference,B as isArray,Q as isBoolean,Fe as isDate,et as isDateString,It as isDef,yi as isEmail,$i as isEmptyString,ti as isFloat,he as isFunction,Di as isIdCard,fi as isInteger,Ce as isMap,Ai as isMobilePhone,oi as isNegativeFloat,mi as isNegativeInteger,Ke as isNil,ni as isNonNegativeFloat,ci as isNonNegativeInteger,ii as isNonPositiveFloat,li as isNonPositiveInteger,Te as isNull,Z as isNumber,se as isObject,ge as isObjectLike,X as isPlainObject,ri as isPositiveFloat,ui as isPositiveInteger,Ue as isPromise,He as isRegExp,Le as isSet,ae as isString,vi as isStringNumber,_e as isSymbol,Pi as isURL,_ as isUndef,ft as objectToString,Dn as omit,Qe as pick,lt as qs,vr as qsStringify,Lr as throttle,h as throwError,Or as throwErrorInvalidTypeMessage,ue as toTypeString,Se as toTypeValue,Br as withRetry};
|
|
1
|
+
var te=Object.create;var Nt=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var ne=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty;var ie=(t,e)=>()=>(t&&(e=t(t=0)),e);var Pt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var se=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of re(e))!oe.call(t,s)&&s!==r&&Nt(t,s,{get:()=>e[s],enumerable:!(o=ee(e,s))||o.enumerable});return t};var dt=(t,e,r)=>(r=t!=null?te(ne(t)):{},se(e||!t||!t.__esModule?Nt(r,"default",{value:t,enumerable:!0}):r,t));import Ae from"path";import{fileURLToPath as Re}from"url";var n=ie(()=>{"use strict"});var $t=Pt((At,Tt)=>{"use strict";n();(function(t,e){typeof At=="object"&&typeof Tt<"u"?Tt.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(At,function(){"use strict";var t=1e3,e=6e4,r=36e5,o="millisecond",s="second",M="minute",y="hour",S="day",x="week",v="month",L="quarter",P="year",N="date",I="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,A={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(c){var a=["th","st","nd","rd"],i=c%100;return"["+c+(a[(i-20)%10]||a[i]||a[0])+"]"}},T=function(c,a,i){var u=String(c);return!u||u.length>=a?c:""+Array(a+1-u.length).join(i)+c},O={s:T,z:function(c){var a=-c.utcOffset(),i=Math.abs(a),u=Math.floor(i/60),f=i%60;return(a<=0?"+":"-")+T(u,2,"0")+":"+T(f,2,"0")},m:function c(a,i){if(a.date()<i.date())return-c(i,a);var u=12*(i.year()-a.year())+(i.month()-a.month()),f=a.clone().add(u,v),d=i-f<0,g=a.clone().add(u+(d?-1:1),v);return+(-(u+(i-f)/(d?f-g:g-f))||0)},a:function(c){return c<0?Math.ceil(c)||0:Math.floor(c)},p:function(c){return{M:v,y:P,w:x,d:S,D:N,h:y,m:M,s,ms:o,Q:L}[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(c){return c===void 0}},D="en",k={};k[D]=A;var F="$isDayjsObject",Y=function(c){return c instanceof K||!(!c||!c[F])},W=function c(a,i,u){var f;if(!a)return D;if(typeof a=="string"){var d=a.toLowerCase();k[d]&&(f=d),i&&(k[d]=i,f=d);var g=a.split("-");if(!f&&g.length>1)return c(g[0])}else{var b=a.name;k[b]=a,f=b}return!u&&f&&(D=f),f||!u&&D},R=function(c,a){if(Y(c))return c.clone();var i=typeof a=="object"?a:{};return i.date=c,i.args=arguments,new K(i)},$=O;$.l=W,$.i=Y,$.w=function(c,a){return R(c,{locale:a.$L,utc:a.$u,x:a.$x,$offset:a.$offset})};var K=function(){function c(i){this.$L=W(i.locale,null,!0),this.parse(i),this.$x=this.$x||i.x||{},this[F]=!0}var a=c.prototype;return a.parse=function(i){this.$d=function(u){var f=u.date,d=u.utc;if(f===null)return new Date(NaN);if($.u(f))return new Date;if(f instanceof Date)return new Date(f);if(typeof f=="string"&&!/Z$/i.test(f)){var g=f.match(m);if(g){var b=g[2]-1||0,j=(g[7]||"0").substring(0,3);return d?new Date(Date.UTC(g[1],b,g[3]||1,g[4]||0,g[5]||0,g[6]||0,j)):new Date(g[1],b,g[3]||1,g[4]||0,g[5]||0,g[6]||0,j)}}return new Date(f)}(i),this.init()},a.init=function(){var i=this.$d;this.$y=i.getFullYear(),this.$M=i.getMonth(),this.$D=i.getDate(),this.$W=i.getDay(),this.$H=i.getHours(),this.$m=i.getMinutes(),this.$s=i.getSeconds(),this.$ms=i.getMilliseconds()},a.$utils=function(){return $},a.isValid=function(){return this.$d.toString()!==I},a.isSame=function(i,u){var f=R(i);return this.startOf(u)<=f&&f<=this.endOf(u)},a.isAfter=function(i,u){return R(i)<this.startOf(u)},a.isBefore=function(i,u){return this.endOf(u)<R(i)},a.$g=function(i,u,f){return $.u(i)?this[u]:this.set(f,i)},a.unix=function(){return Math.floor(this.valueOf()/1e3)},a.valueOf=function(){return this.$d.getTime()},a.startOf=function(i,u){var f=this,d=!!$.u(u)||u,g=$.p(i),b=function(tt,H){var G=$.w(f.$u?Date.UTC(f.$y,H,tt):new Date(f.$y,H,tt),f);return d?G:G.endOf(S)},j=function(tt,H){return $.w(f.toDate()[tt].apply(f.toDate("s"),(d?[0,0,0,0]:[23,59,59,999]).slice(H)),f)},E=this.$W,C=this.$M,B=this.$D,ot="set"+(this.$u?"UTC":"");switch(g){case P:return d?b(1,0):b(31,11);case v:return d?b(1,C):b(0,C+1);case x:var rt=this.$locale().weekStart||0,ft=(E<rt?E+7:E)-rt;return b(d?B-ft:B+(6-ft),C);case S:case N:return j(ot+"Hours",0);case y:return j(ot+"Minutes",1);case M:return j(ot+"Seconds",2);case s:return j(ot+"Milliseconds",3);default:return this.clone()}},a.endOf=function(i){return this.startOf(i,!1)},a.$set=function(i,u){var f,d=$.p(i),g="set"+(this.$u?"UTC":""),b=(f={},f[S]=g+"Date",f[N]=g+"Date",f[v]=g+"Month",f[P]=g+"FullYear",f[y]=g+"Hours",f[M]=g+"Minutes",f[s]=g+"Seconds",f[o]=g+"Milliseconds",f)[d],j=d===S?this.$D+(u-this.$W):u;if(d===v||d===P){var E=this.clone().set(N,1);E.$d[b](j),E.init(),this.$d=E.set(N,Math.min(this.$D,E.daysInMonth())).$d}else b&&this.$d[b](j);return this.init(),this},a.set=function(i,u){return this.clone().$set(i,u)},a.get=function(i){return this[$.p(i)]()},a.add=function(i,u){var f,d=this;i=Number(i);var g=$.p(u),b=function(C){var B=R(d);return $.w(B.date(B.date()+Math.round(C*i)),d)};if(g===v)return this.set(v,this.$M+i);if(g===P)return this.set(P,this.$y+i);if(g===S)return b(1);if(g===x)return b(7);var j=(f={},f[M]=e,f[y]=r,f[s]=t,f)[g]||1,E=this.$d.getTime()+i*j;return $.w(E,this)},a.subtract=function(i,u){return this.add(-1*i,u)},a.format=function(i){var u=this,f=this.$locale();if(!this.isValid())return f.invalidDate||I;var d=i||"YYYY-MM-DDTHH:mm:ssZ",g=$.z(this),b=this.$H,j=this.$m,E=this.$M,C=f.weekdays,B=f.months,ot=f.meridiem,rt=function(H,G,nt,it){return H&&(H[G]||H(u,d))||nt[G].slice(0,it)},ft=function(H){return $.s(b%12||12,H,"0")},tt=ot||function(H,G,nt){var it=H<12?"AM":"PM";return nt?it.toLowerCase():it};return d.replace(w,function(H,G){return G||function(nt){switch(nt){case"YY":return String(u.$y).slice(-2);case"YYYY":return $.s(u.$y,4,"0");case"M":return E+1;case"MM":return $.s(E+1,2,"0");case"MMM":return rt(f.monthsShort,E,B,3);case"MMMM":return rt(B,E);case"D":return u.$D;case"DD":return $.s(u.$D,2,"0");case"d":return String(u.$W);case"dd":return rt(f.weekdaysMin,u.$W,C,2);case"ddd":return rt(f.weekdaysShort,u.$W,C,3);case"dddd":return C[u.$W];case"H":return String(b);case"HH":return $.s(b,2,"0");case"h":return ft(1);case"hh":return ft(2);case"a":return tt(b,j,!0);case"A":return tt(b,j,!1);case"m":return String(j);case"mm":return $.s(j,2,"0");case"s":return String(u.$s);case"ss":return $.s(u.$s,2,"0");case"SSS":return $.s(u.$ms,3,"0");case"Z":return g}return null}(H)||g.replace(":","")})},a.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},a.diff=function(i,u,f){var d,g=this,b=$.p(u),j=R(i),E=(j.utcOffset()-this.utcOffset())*e,C=this-j,B=function(){return $.m(g,j)};switch(b){case P:d=B()/12;break;case v:d=B();break;case L:d=B()/3;break;case x:d=(C-E)/6048e5;break;case S:d=(C-E)/864e5;break;case y:d=C/r;break;case M:d=C/e;break;case s:d=C/t;break;default:d=C}return f?d:$.a(d)},a.daysInMonth=function(){return this.endOf(v).$D},a.$locale=function(){return k[this.$L]},a.locale=function(i,u){if(!i)return this.$L;var f=this.clone(),d=W(i,u,!0);return d&&(f.$L=d),f},a.clone=function(){return $.w(this.$d,this)},a.toDate=function(){return new Date(this.valueOf())},a.toJSON=function(){return this.isValid()?this.toISOString():null},a.toISOString=function(){return this.$d.toISOString()},a.toString=function(){return this.$d.toUTCString()},c}(),z=K.prototype;return R.prototype=z,[["$ms",o],["$s",s],["$m",M],["$H",y],["$W",S],["$M",v],["$y",P],["$D",N]].forEach(function(c){z[c[1]]=function(a){return this.$g(a,c[0],c[1])}}),R.extend=function(c,a){return c.$i||(c(a,K,R),c.$i=!0),R},R.locale=W,R.isDayjs=Y,R.unix=function(c){return R(1e3*c)},R.en=k[D],R.Ls=k,R.p={},R})});var qt=Pt((jt,Et)=>{"use strict";n();(function(t,e){typeof jt=="object"&&typeof Et<"u"?Et.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_customParseFormat=e()})(jt,function(){"use strict";var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,o=/\d\d/,s=/\d\d?/,M=/\d*[^-_:/,()\s\d]+/,y={},S=function(m){return(m=+m)+(m>68?1900:2e3)},x=function(m){return function(w){this[m]=+w}},v=[/[+-]\d\d:?(\d\d)?|Z/,function(m){(this.zone||(this.zone={})).offset=function(w){if(!w||w==="Z")return 0;var A=w.match(/([+-]|\d\d)/g),T=60*A[1]+(+A[2]||0);return T===0?0:A[0]==="+"?-T:T}(m)}],L=function(m){var w=y[m];return w&&(w.indexOf?w:w.s.concat(w.f))},P=function(m,w){var A,T=y.meridiem;if(T){for(var O=1;O<=24;O+=1)if(m.indexOf(T(O,0,w))>-1){A=O>12;break}}else A=m===(w?"pm":"PM");return A},N={A:[M,function(m){this.afternoon=P(m,!1)}],a:[M,function(m){this.afternoon=P(m,!0)}],Q:[r,function(m){this.month=3*(m-1)+1}],S:[r,function(m){this.milliseconds=100*+m}],SS:[o,function(m){this.milliseconds=10*+m}],SSS:[/\d{3}/,function(m){this.milliseconds=+m}],s:[s,x("seconds")],ss:[s,x("seconds")],m:[s,x("minutes")],mm:[s,x("minutes")],H:[s,x("hours")],h:[s,x("hours")],HH:[s,x("hours")],hh:[s,x("hours")],D:[s,x("day")],DD:[o,x("day")],Do:[M,function(m){var w=y.ordinal,A=m.match(/\d+/);if(this.day=A[0],w)for(var T=1;T<=31;T+=1)w(T).replace(/\[|\]/g,"")===m&&(this.day=T)}],w:[s,x("week")],ww:[o,x("week")],M:[s,x("month")],MM:[o,x("month")],MMM:[M,function(m){var w=L("months"),A=(L("monthsShort")||w.map(function(T){return T.slice(0,3)})).indexOf(m)+1;if(A<1)throw new Error;this.month=A%12||A}],MMMM:[M,function(m){var w=L("months").indexOf(m)+1;if(w<1)throw new Error;this.month=w%12||w}],Y:[/[+-]?\d+/,x("year")],YY:[o,function(m){this.year=S(m)}],YYYY:[/\d{4}/,x("year")],Z:v,ZZ:v};function I(m){var w,A;w=m,A=y&&y.formats;for(var T=(m=w.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(R,$,K){var z=K&&K.toUpperCase();return $||A[K]||t[K]||A[z].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(c,a,i){return a||i.slice(1)})})).match(e),O=T.length,D=0;D<O;D+=1){var k=T[D],F=N[k],Y=F&&F[0],W=F&&F[1];T[D]=W?{regex:Y,parser:W}:k.replace(/^\[|\]$/g,"")}return function(R){for(var $={},K=0,z=0;K<O;K+=1){var c=T[K];if(typeof c=="string")z+=c.length;else{var a=c.regex,i=c.parser,u=R.slice(z),f=a.exec(u)[0];i.call($,f),R=R.replace(f,"")}}return function(d){var g=d.afternoon;if(g!==void 0){var b=d.hours;g?b<12&&(d.hours+=12):b===12&&(d.hours=0),delete d.afternoon}}($),$}}return function(m,w,A){A.p.customParseFormat=!0,m&&m.parseTwoDigitYear&&(S=m.parseTwoDigitYear);var T=w.prototype,O=T.parse;T.parse=function(D){var k=D.date,F=D.utc,Y=D.args;this.$u=F;var W=Y[1];if(typeof W=="string"){var R=Y[2]===!0,$=Y[3]===!0,K=R||$,z=Y[2];$&&(z=Y[2]),y=this.$locale(),!R&&z&&(y=A.Ls[z]),this.$d=function(u,f,d,g){try{if(["x","X"].indexOf(f)>-1)return new Date((f==="X"?1e3:1)*u);var b=I(f)(u),j=b.year,E=b.month,C=b.day,B=b.hours,ot=b.minutes,rt=b.seconds,ft=b.milliseconds,tt=b.zone,H=b.week,G=new Date,nt=C||(j||E?1:G.getDate()),it=j||G.getFullYear(),lt=0;j&&!E||(lt=E>0?E-1:G.getMonth());var pt,wt=B||0,Mt=ot||0,Ot=rt||0,Dt=ft||0;return tt?new Date(Date.UTC(it,lt,nt,wt,Mt,Ot,Dt+60*tt.offset*1e3)):d?new Date(Date.UTC(it,lt,nt,wt,Mt,Ot,Dt)):(pt=new Date(it,lt,nt,wt,Mt,Ot,Dt),H&&(pt=g(pt).week(H).toDate()),pt)}catch{return new Date("")}}(k,W,F,A),this.init(),z&&z!==!0&&(this.$L=this.locale(z).$L),K&&k!=this.format(W)&&(this.$d=new Date("")),y={}}else if(W instanceof Array)for(var c=W.length,a=1;a<=c;a+=1){Y[1]=W[a-1];var i=A.apply(this,Y);if(i.isValid()){this.$d=i.$d,this.$L=i.$L,this.init();break}a===c&&(this.$d=new Date(""))}else O.call(this,D)}}})});n();n();n();n();n();function st(t){let e=typeof t;return t!==null&&(e==="object"||e==="function")}n();function gt(t){return t!==null&&typeof t=="object"}n();n();var ae=Object.prototype.toString,ut=t=>ae.call(t),Pe=t=>ut(t).slice(8,-1),at=t=>typeof t=="string",Z=t=>typeof t=="number"&&Number.isFinite(t),Q=t=>typeof t=="boolean",St=t=>t===null,_=t=>t===void 0,It=t=>typeof t=="symbol",V=Array.isArray,ht=t=>typeof t=="function",_t=t=>ut(t)==="[object Map]",Ct=t=>ut(t)==="[object Set]",Lt=t=>ut(t)==="[object Date]",Ft=t=>ut(t)==="[object RegExp]",Ht=t=>gt(t)&&ht(t?.then)&&ht(t?.catch),Ut=t=>t==null,Ie=t=>t!=null,_e=(t,e)=>t!==e;function X(t){return ut(t)==="[object Object]"}function ct(t){return V(t)?t:[t]}n();n();n();n();function er(t){let e=[],r,o="";for(;t>0;)r=Math.floor(t%2),e.push(r),t=Math.floor(t/2);for(;e.length>0;)o+=e.pop().toString();return o}var Kt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function rr(t){let e="",r="";for(let s=0;s<t.length;s++)r+=t[s].charCodeAt(0).toString(2).padStart(8,"0");for(let s=0;s<r.length;s+=6)e+=Kt[Number.parseInt(r.slice(s,s+6).padEnd(6,"0"),2)];let o=e.length%4;return o!==0&&(e+="=".repeat(4-o)),e}function nr(t){let e="",r="";for(let o=0;o<t.length&&t[o]!=="=";o++)r+=Kt.indexOf(t[o]).toString(2).padStart(6,"0");for(let o=0;o<r.length;o+=8){let s=Number.parseInt(r.slice(o,o+8),2);s&&(e+=String.fromCharCode(s))}return e}n();function sr(...t){return t.reduce((e,r)=>function(...o){return r(e(...o))})}function ar(...t){return t.reduce((e,r)=>function(...o){return e(r(...o))})}n();function cr(t,e=500){let r=null;return function(...o){r&&clearTimeout(r),r=setTimeout(()=>{t.apply(this,o)},e)}}n();function mt(t){let e=new WeakMap;function r(o){if(!gt(o))return o;if(Lt(o))return new Date(o);if(Ft(o))return new RegExp(o);if(Ht(o))return o;if(e.has(o))return e.get(o);if(_t(o)){let y=new Map;return e.set(o,y),o.forEach((S,x)=>y.set(r(x),r(S))),y}if(Ct(o)){let y=new Set;return e.set(o,y),o.forEach(S=>y.add(r(S))),y}let s=V(o)?Object.setPrototypeOf([],Object.getPrototypeOf(o)):Object.create(Object.getPrototypeOf(o));e.set(o,s);let M=Object.getOwnPropertyDescriptors(o);for(let y of Reflect.ownKeys(M)){let S=M[y];S.get||S.set?Object.defineProperty(s,y,S):Object.defineProperty(s,y,{...S,value:r(S.value)})}return s}return r(t)}n();function br(t,e,r={}){return zt(Wt(t,r),Wt(e,r),r)}function zt(t,e,r){return V(t)?ue(t,e,r):fe(t,e,r)}function fe(t,e,r){if(!X(e))return e;let o=Object.getOwnPropertyDescriptors(e);return Reflect.ownKeys(e).forEach(s=>{(X(t[s])||V(t[s]))&&(X(e[s])||V(e[s]))?t[s]=zt(t[s],e[s],r):Object.defineProperty(t,s,o[s])}),t}function ue(t,e,r){let{mergeStrategy:o="replace"}=r;if(V(e))switch(o){case"merge":return t.concat(e);case"replace":return e;default:return e}return e}function Wt(t,e){let{deepClone:r=!0}=e;return r?mt(t):t}n();var yt=class extends Error{constructor(e,r="Utils"){super(e),this.name=r}};function h(t,e){throw new yt(`[${t}] ${e}`)}function Mr(t,e){let r=at(t)?new yt(`[${t}] ${e}`,"UtilsWarn"):t;console.warn(r)}n();var bt=(t,e,...r)=>{if(!e)return;let o=r.length===0?"":r.length===1?r[0]:r;console[t](`[Log] ${e}:`,o)},xt=(t,...e)=>{bt("info",t,...e)};xt.info=(t,...e)=>{bt("info",t,...e)};xt.error=(t,...e)=>{bt("error",t,...e)};xt.warn=(t,...e)=>{bt("warn",t,...e)};typeof globalThis<"u"&&(globalThis.log=xt);n();function jr(t,e={}){ce(e);let{encode:r=!0,encodeValuesOnly:o=!1,arrayFormat:s="indices",encodeDotInKeys:M=!1,skipNulls:y=!1,strictNullHandling:S=!1,commaRoundTrip:x=!1,allowEmptyArrays:v=!1,addQueryPrefix:L=!1,delimiter:P="&"}=e,N=e.allowDots??!1;M&&_(e.allowDots)&&(N=!0);let I=[],m=O=>r&&!o?encodeURIComponent(O):O,w=O=>r?encodeURIComponent(O):O;function A(O,D){if(!_(D)){if(St(D)){if(y)return;I.push(`${m(O)}${S?"":"="}`);return}if(V(D)){if(D.length===0){v&&I.push(`${m(O)}[]`);return}if(s==="comma"){let k=o?D.map(w).join(","):w(D.join(","));if(D.length===1&&St(D[0])){if(y)return;I.push(`${m(O)}${x?"[]":""}${S?"":"="}`)}else D.length===1?I.push(`${m(O)}${x?"[]":""}=${k}`):I.push(`${m(O)}=${k}`);return}D.forEach((k,F)=>{let Y=O;s==="indices"?Y=`${O}[${F}]`:s==="brackets"&&(Y=`${O}[]`),A(Y,k)});return}if(st(D)){Object.keys(D).forEach(k=>{let F=O;M&&(F=F.replace(/\./g,"%2E"));let Y=k;N?(M&&(Y=Y.replace(/\./g,"%2E")),A(`${F}.${Y}`,D[k])):A(`${F}[${Y}]`,D[k])});return}I.push(`${m(O)}=${w(D)}`)}}if(!st(t))return"";Bt(t)&&h("stringify","Input object contains circular references, cannot stringify"),V(t)?t.forEach((O,D)=>A(`${D}`,O)):Object.keys(t).forEach(O=>A(O,t[O]));let T=I.join(P);return L&&T?`?${T}`:T}function ce(t={}){X(t)||h("stringify",'"options" must be a plain object'),!_(t.encode)&&!Q(t.encode)&&h("stringify",'"encode" must be a boolean'),!_(t.encodeValuesOnly)&&!Q(t.encodeValuesOnly)&&h("stringify",'"encodeValuesOnly" must be a boolean'),!_(t.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(t.arrayFormat)&&h("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!_(t.allowDots)&&!Q(t.allowDots)&&h("stringify",'"allowDots" must be a boolean'),!_(t.skipNulls)&&!Q(t.skipNulls)&&h("stringify",'"skipNulls" must be a boolean'),!_(t.strictNullHandling)&&!Q(t.strictNullHandling)&&h("stringify",'"strictNullHandling" must be a boolean'),!_(t.addQueryPrefix)&&!Q(t.addQueryPrefix)&&h("stringify",'"addQueryPrefix" must be a boolean'),!_(t.delimiter)&&!at(t.delimiter)&&h("stringify",'"delimiter" must be a string'),!_(t.encodeDotInKeys)&&!Q(t.encodeDotInKeys)&&h("stringify",'"encodeDotInKeys" must be a boolean'),!_(t.commaRoundTrip)&&!Q(t.commaRoundTrip)&&h("stringify",'"commaRoundTrip" must be a boolean'),!_(t.allowEmptyArrays)&&!Q(t.allowEmptyArrays)&&h("stringify",'"allowEmptyArrays" must be a boolean')}n();var me={stringify:t=>(st(t)||h("stringify","Input must be an object"),new URLSearchParams(t).toString()),parse:t=>(at(t)||h("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(t).entries())),appendQueryString:(t,e)=>{let r=me.stringify(e);return t.includes("?")?t.endsWith("?")||t.endsWith("&")?`${t}${r}`:`${t}&${r}`:`${t}?${r}`}};n();function _r(t,e=500){let r=null;return function(...o){if(Ut(r))return r=Date.now(),t.apply(this,o);let s=Date.now();if(s-r>=e)return r=s,t.apply(this,o)}}n();n();function zr(t){le(t);let{fn:e,maxAttempts:r=3,retryDelay:o=1e3,enableExponentialBackoff:s=!1,signal:M}=t,y,S=M?new Promise((v,L)=>{let P=()=>L(Vt());M.addEventListener("abort",P),y=()=>M.removeEventListener("abort",P)}):null;return new Promise((v,L)=>{(async()=>{for(let N=1;N<=r;N++){if(M?.aborted)return L(Vt());try{let I=await Promise.race(S?[e(),S]:[e()]);return v(I)}catch(I){let m=s?o*2**(N-1):o;if(log("withRetry",`Attempt ${N}/${r} failed. Retrying in ${m}ms...`),I instanceof Error&&I.name==="AbortError"||N===r)return L(I);await new Promise(w=>setTimeout(w,m))}}})()}).finally(()=>y?.())}function le(t){X(t)||h("withRetry",'"Options" must be an object'),typeof t.fn!="function"&&h("withRetry",'"fn" must be a function that returns a Promise'),!_(t.maxAttempts)&&(!Number.isInteger(t.maxAttempts)||t.maxAttempts<1)&&h("withRetry",'"maxAttempts" must be a positive integer'),!_(t.retryDelay)&&(!Z(t.retryDelay)||t.retryDelay<0)&&h("withRetry",'"retryDelay" must be a non-negative number'),!_(t.enableExponentialBackoff)&&!Q(t.enableExponentialBackoff)&&h("withRetry",'"enableExponentialBackoff" must be a boolean'),!_(t.signal)&&typeof t.signal!="object"&&h("withRetry",'"signal" must be an AbortSignal')}var pe="The operation was aborted";function Vt(t=pe){let e=new Error(t);return e.name="AbortError",e}function Bt(t){st(t)||h("hasCircularReference",'"obj" must be a object');let e=new Set;function r(o){if(st(o)){if(e.has(o))return!0;e.add(o);for(let s of Object.keys(o))if(r(o[s]))return!0;e.delete(o)}return!1}return r(t)}n();n();function Zt(t,e,r={}){let{includeProto:o=!1,includeSymbols:s=!0,includeNonEnum:M=!1}=r,y={};return X(t)&&ct(e).forEach(x=>{It(x)&&!s||!(o?x in t:Object.hasOwn(t,x))||!M&&(o?de(t,x):Object.getOwnPropertyDescriptor(t,x))?.enumerable===!1||(y[x]=mt(t[x]))}),y}function de(t,e){let r=t;for(;r!==null;){let o=Object.getOwnPropertyDescriptor(r,e);if(o)return o;r=Object.getPrototypeOf(r)}}function Mn(t,e){if(!X(t))return{};let r=mt(t),o=ct(e),s=Object.keys(r).filter(M=>!o.includes(M));return Zt(r,s)}n();n();n();n();n();function vn(t){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(t)}function kn(t){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function Yn(t){return/^(?:0|[1-9]\d*)\.\d+$/.test(t)}function Nn(t){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function Pn(t){return/^-(?:0|[1-9]\d*)\.\d+$/.test(t)}n();function Cn(t){return/^-?(?:0|[1-9]\d*)$/.test(t)}function Ln(t){return/^[1-9]\d*$/.test(t)}function Gt(t){return/^(?:0|[1-9]\d*)$/.test(t)&&!Object.is(t,-0)}function Fn(t){return/^-[1-9]\d*$/.test(t)}function Hn(t){return/^-(?:0|[1-9]\d*)$/.test(t)||Object.is(t,-0)}n();var Qt=dt($t(),1);function Xt(t,e="YYYY-MM-DD HH:mm:ss"){return(0,Qt.default)(t,e,!0).isValid()}n();function Vn(t){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t)}n();function Qn(t){return t===""}n();var Rt=dt($t(),1);function to(t){if(!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/i.test(t))return!1;let r=t.slice(6,14);return Xt(r,"YYYYMMDD")&&(0,Rt.default)(r,"YYYYMMDD").isBefore((0,Rt.default)())}n();function no(t){return/^1[3-9]\d{9}$/.test(t)}n();var ao=t=>{if(!at(t)||!/^-?\d+(?:\.\d+)?$/.test(t))return!1;let r=Number(t);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};n();function co(t){return/^https?:\/\/\S+$/i.test(t)}function jo(t,e){return(!Z(t)||!Gt(t.toString()))&&h("generateRandomArray","num must be greater than 0"),ht(e)||h("generateRandomArray","cb must be a function"),Array.from({length:t},()=>e())}n();function ko(){return`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`}n();var et=dt($t(),1),Jt=dt(qt(),1);n();n();function q(t){return t[Math.floor(Math.random()*t.length)]}function U(t={}){Z(t)&&(t={max:t});let{min:e=1,max:r=q(he())}=t;ge(e,r);let o=Math.ceil(e),s=Math.floor(r);return Math.floor(Math.random()*(s-o+1)+o)}function ge(t,e){let r=Math.ceil(t),o=Math.floor(e);Number.isSafeInteger(r)||h("getRandomInt",`The minimum value Math.ceil(${t}) should be a safe integer`),Number.isSafeInteger(o)||h("getRandomInt",`The maximum value Math.floor(${e}) should be a safe integer`),o<r&&(e>=t&&h("getRandomInt",`No integer value found between ${t} and ${e}`),h("getRandomInt",`The maximum value ${e} should be greater than the minimum value ${t}`))}function he(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((t,e)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,e+1);return Number(r)})}et.default.extend(Jt.default);function vt(t={}){let{start:e="1800-01-01 00:00:00",end:r=(0,et.default)().format("YYYY-MM-DD HH:mm:ss"),format:o="YYYY-MM-DD HH:mm:ss"}=t;(!(0,et.default)(e).isValid()||!(0,et.default)(r).isValid())&&h("generateRandomDate","start and end parameters must be valid date format");let s=(0,et.default)(e).year(),M=(0,et.default)(r).year(),y=U({min:s,max:M}),S=U({min:1,max:12}),x=U({min:1,max:31}),v=U(23),L=U(59),P=U(59),N=(0,et.default)(`${y}-${S}-${x} ${v}:${L}:${P}`);return N.isBefore((0,et.default)(e))||N.isAfter((0,et.default)(r))?vt(t):N.format(o)}n();n();function J(t={}){let e=be(t),r=xe(e);$e(r);let{length:o}=e;we(o.min,o.max);let s=U(o),M=e.prefix||"";for(let y=0;y<s;y++)M+=r.charAt(Math.floor(Math.random()*r.length));return M+(e.suffix||"")}var ye=16,kt=1;function be(t){let e=Z(t);return{lowerCase:!0,upperCase:!0,number:!0,...e?{}:t,length:e?{max:t,min:t}:Z(t.length)?{max:t.length,min:t.length}:{max:ye,min:kt,...t.length},extra:e?[]:[...new Set(ct(t.extra||[]))]}}function xe(t){let e="";return t.lowerCase&&(e+="abcdefghijklmnopqrstuvwxyz"),t.upperCase&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.number&&(e+="0123456789"),e+=ct(t.extra).join(""),e}function $e(t){t.length===0&&h("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function we(t,e){Number.isInteger(t)||h("getRandomString","min must be an integer"),Number.isInteger(e)||h("getRandomString","max must be an integer"),t<kt&&h("getRandomString",`Minimum length cannot be less than ${kt}`),e<t&&h("getRandomString","Maximum length cannot be less than minimum length")}function Me(){let t=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],e=`${J(1)}${J({length:U({max:30,min:1})})}${J(1)}@${q(t)}`;return/\.{2,}/.test(e)?Me():e}n();function ii(t={}){Z(t)&&(t={max:t});let{min:e=0,max:r=1,fractionDigits:o=2}=t;if(e===r)return e;if(e>r)throw new Error(`Maximum value ${r} should be greater than minimum value ${e}`);let s=Math.random()*(r-e)+e;return Number(s.toFixed(o))}n();n();function Yt(t,e){(!Z(t)||t<=0)&&h("generateRandomStringFromSource","num must be greater than 0"),(!V(e)||e.length===0)&&h("generateRandomStringFromSource","source cannot be empty array");let r="";for(let o=0;o<t;o++)r+=q(e);return r}function hi(){let t=U({min:1e5,max:999999}),e=[0,1,2,3,4,5,6,7,8,9];return[t,vt({format:"YYYYMMDD"}),Yt(3,e),Yt(1,[...e,"X","x"])].join("")}n();function wi(){return q(["13","14","15","16","17","18","19"])+U(999999999).toString().padEnd(9,"0")}n();function Ti(){let t=["http://","https://"],e=[".com",".net",".org",".cn",".top"],r=[`?name=${J({length:{min:4,max:8}})}`,`?id=${U()}`,`?page=${J({length:{min:2,max:4}})}`,`?query=${J({length:{min:5,max:6}})}`,`?search=${J({length:{min:1,max:4}})}`,`?token=${J({length:{min:16,max:16}})}`];return`${q(t)}${J({length:{min:5,max:25}})}${q(e)}${q(r)}`}n();n();export{yt as UtilsError,nr as base64Decode,rr as base64Encode,ct as castArray,sr as compose,ar as composeRight,cr as debounce,Mr as debugWarn,er as decimalToBinary,mt as deepClone,br as deepMerge,jo as generateRandomArray,ko as generateRandomColor,vt as generateRandomDate,Me as generateRandomEmail,ii as generateRandomFloat,hi as generateRandomIdCard,wi as generateRandomMobilePhone,Yt as generateRandomStringFromSource,U as getRandomInt,q as getRandomItem,J as getRandomString,Ti as getRandomUrl,_e as hasChanged,Bt as hasCircularReference,V as isArray,Q as isBoolean,Lt as isDate,Xt as isDateString,Ie as isDef,Vn as isEmail,Qn as isEmptyString,vn as isFloat,ht as isFunction,to as isIdCard,Cn as isInteger,_t as isMap,no as isMobilePhone,Nn as isNegativeFloat,Fn as isNegativeInteger,Ut as isNil,Yn as isNonNegativeFloat,Gt as isNonNegativeInteger,Pn as isNonPositiveFloat,Hn as isNonPositiveInteger,St as isNull,Z as isNumber,st as isObject,gt as isObjectLike,X as isPlainObject,kn as isPositiveFloat,Ln as isPositiveInteger,Ht as isPromise,Ft as isRegExp,Ct as isSet,at as isString,ao as isStringNumber,It as isSymbol,co as isURL,_ as isUndef,ae as objectToString,Mn as omit,Zt as pick,me as qs,jr as qsStringify,_r as throttle,h as throwError,ut as toTypeString,Pe as toTypeValue,zr as withRetry};
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
type Arrayable<T> = T | T[];
|
|
5
5
|
/**
|
|
6
6
|
* Extracts the type of an item from an array.
|
|
7
|
-
* @template T The array type.
|
|
8
|
-
* @returns The type of the array's items.
|
|
9
7
|
*/
|
|
10
8
|
type ArrayItem<T> = T extends (infer U)[] ? U : never;
|
|
11
9
|
/**
|
|
@@ -22,67 +20,86 @@ type AnyObject = Record<PropertyKey, any>;
|
|
|
22
20
|
type StringNumber = string | number;
|
|
23
21
|
|
|
24
22
|
/**
|
|
25
|
-
* Converts a non-array value to an array
|
|
23
|
+
* Converts a non-array value to an array or returns the array as-is.
|
|
24
|
+
*
|
|
25
|
+
* This utility function takes any value and ensures it becomes an array. If the input
|
|
26
|
+
* is already an array, it returns the original array unchanged. If the input is not
|
|
27
|
+
* an array, it wraps the value in a new array.
|
|
28
|
+
*
|
|
26
29
|
* @example
|
|
30
|
+
* castArray(1) // => [1]
|
|
31
|
+
* castArray('hello') // => ['hello']
|
|
32
|
+
* castArray(null) // => [null]
|
|
27
33
|
*
|
|
28
|
-
*
|
|
34
|
+
* @example
|
|
35
|
+
* castArray([1, 2, 3]) // => [1, 2, 3]
|
|
36
|
+
* castArray(['a', 'b']) // => ['a', 'b']
|
|
29
37
|
*
|
|
30
|
-
*
|
|
38
|
+
* @returns Returns an array containing the input value, or the original array if already an array
|
|
31
39
|
*/
|
|
32
40
|
declare function castArray<T>(target: Arrayable<T>): T[];
|
|
33
41
|
|
|
34
42
|
/**
|
|
35
|
-
*
|
|
36
|
-
* @returns Returns `true` if `value` is an object, otherwise `false`.
|
|
37
|
-
* @example
|
|
43
|
+
* Checks if a value is of the Object type in JavaScript.
|
|
38
44
|
*
|
|
39
|
-
*
|
|
45
|
+
* This utility determines whether a value is an object type, which includes
|
|
46
|
+
* objects, arrays, and functions. It excludes null (which technically has
|
|
47
|
+
* typeof 'object' in JavaScript) and primitive values.
|
|
40
48
|
*
|
|
41
|
-
*
|
|
49
|
+
* @example
|
|
50
|
+
* isObject({}) // => true
|
|
51
|
+
* isObject([1, 2, 3]) // => true
|
|
52
|
+
* isObject(function() {}) // => true
|
|
42
53
|
*
|
|
43
|
-
*
|
|
54
|
+
* @example
|
|
55
|
+
* isObject(null) // => false
|
|
56
|
+
* isObject(undefined) // => false
|
|
57
|
+
* isObject('string') // => false
|
|
44
58
|
*
|
|
45
|
-
*
|
|
59
|
+
* @returns Returns `true` if the value is an object, otherwise `false`
|
|
46
60
|
*/
|
|
47
61
|
declare function isObject(value: unknown): value is AnyObject;
|
|
48
62
|
|
|
49
63
|
/**
|
|
50
|
-
*
|
|
51
|
-
* and the result of `typeof` is "object".
|
|
64
|
+
* Checks if a value is object-like (non-null object type).
|
|
52
65
|
*
|
|
53
|
-
*
|
|
66
|
+
* This utility determines whether a value is object-like, meaning it's not null
|
|
67
|
+
* and has a typeof result of "object". Unlike `isObject`, this function excludes
|
|
68
|
+
* functions, treating only pure objects and arrays as object-like.
|
|
54
69
|
*
|
|
55
|
-
* @returns Returns `true` if `value` is a general object, otherwise `false`.
|
|
56
70
|
* @example
|
|
71
|
+
* isObjectLike({}) // => true
|
|
72
|
+
* isObjectLike([1, 2, 3]) // => true
|
|
73
|
+
* isObjectLike(new Date()) // => true
|
|
57
74
|
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* isObjectLike(
|
|
61
|
-
*
|
|
62
|
-
* isObjectLike(function() {}) => false
|
|
75
|
+
* @example
|
|
76
|
+
* isObjectLike(function() {}) // => false
|
|
77
|
+
* isObjectLike(null) // => false
|
|
78
|
+
* isObjectLike('string') // => false
|
|
63
79
|
*
|
|
64
|
-
*
|
|
80
|
+
* @returns Returns `true` if the value is object-like, otherwise `false`
|
|
65
81
|
*/
|
|
66
82
|
declare function isObjectLike(value: unknown): value is AnyObject;
|
|
67
83
|
|
|
68
84
|
/**
|
|
69
|
-
* Checks if a value is a plain object.
|
|
70
|
-
* or constructed using `Object.create(null)`. It includes objects created by `class` or constructors,
|
|
71
|
-
* as long as their internal type is `[object Object]`. It excludes arrays, functions, and other built-in objects.
|
|
85
|
+
* Checks if a value is a plain object.
|
|
72
86
|
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* isPlainObject([1, 2, 3]) => false
|
|
87
|
+
* This utility determines whether a value is a plain object, defined as an object
|
|
88
|
+
* created by the `{}` syntax, `Object.create(null)`, or class constructors that
|
|
89
|
+
* maintain the `[object Object]` internal type. It excludes arrays, functions,
|
|
90
|
+
* and other built-in objects like Date, RegExp, etc.
|
|
79
91
|
*
|
|
80
|
-
*
|
|
92
|
+
* @example
|
|
93
|
+
* isPlainObject({ x: 0, y: 0 }) // => true
|
|
94
|
+
* isPlainObject(Object.create(null)) // => true
|
|
95
|
+
* isPlainObject(new class Foo {}()) // => true
|
|
81
96
|
*
|
|
82
|
-
*
|
|
97
|
+
* @example
|
|
98
|
+
* isPlainObject([1, 2, 3]) // => false
|
|
99
|
+
* isPlainObject(null) // => false
|
|
100
|
+
* isPlainObject(new Date()) // => false
|
|
83
101
|
*
|
|
84
|
-
*
|
|
85
|
-
* isPlainObject(new Foo()) => true
|
|
102
|
+
* @returns Returns `true` if the value is a plain object, otherwise `false`
|
|
86
103
|
*/
|
|
87
104
|
declare function isPlainObject(value: unknown): value is AnyObject;
|
|
88
105
|
|
|
@@ -92,110 +109,109 @@ declare function isPlainObject(value: unknown): value is AnyObject;
|
|
|
92
109
|
declare const objectToString: () => string;
|
|
93
110
|
/**
|
|
94
111
|
* Converts a value to its type string representation
|
|
95
|
-
*
|
|
112
|
+
*
|
|
96
113
|
* @returns The type string of the value (e.g., "[object Object]")
|
|
97
114
|
*/
|
|
98
115
|
declare const toTypeString: (value: unknown) => string;
|
|
99
116
|
/**
|
|
100
117
|
* Extracts the type name from the type string
|
|
101
|
-
*
|
|
118
|
+
*
|
|
102
119
|
* @returns The type name (e.g., "Object", "Array")
|
|
103
120
|
*/
|
|
104
121
|
declare const toTypeValue: (value: unknown) => string;
|
|
105
122
|
/**
|
|
106
123
|
* Checks if a value is a string
|
|
107
|
-
*
|
|
124
|
+
*
|
|
108
125
|
* @returns `true` if the value is a string, otherwise `false`
|
|
109
126
|
*/
|
|
110
127
|
declare const isString: (val: unknown) => val is string;
|
|
111
128
|
/**
|
|
112
129
|
* Checks if a value is a valid number (excluding NaN and Infinity).
|
|
113
|
-
*
|
|
130
|
+
*
|
|
114
131
|
* @returns `true` if the value is a finite number, otherwise `false`
|
|
115
132
|
*/
|
|
116
133
|
declare const isNumber: (val: unknown) => val is number;
|
|
117
134
|
/**
|
|
118
135
|
* Checks if a value is a boolean
|
|
119
|
-
*
|
|
136
|
+
*
|
|
120
137
|
* @returns `true` if the value is a boolean, otherwise `false`
|
|
121
138
|
*/
|
|
122
139
|
declare const isBoolean: (val: unknown) => val is boolean;
|
|
123
140
|
/**
|
|
124
141
|
* Checks if a value is null
|
|
125
|
-
*
|
|
142
|
+
*
|
|
126
143
|
* @returns `true` if the value is null, otherwise `false`
|
|
127
144
|
*/
|
|
128
145
|
declare const isNull: (val: unknown) => val is null;
|
|
129
146
|
/**
|
|
130
147
|
* Checks if a value is undefined
|
|
131
|
-
*
|
|
148
|
+
*
|
|
132
149
|
* @returns `true` if the value is undefined, otherwise `false`
|
|
133
150
|
*/
|
|
134
151
|
declare const isUndef: (val: unknown) => val is undefined;
|
|
135
152
|
/**
|
|
136
153
|
* Checks if a value is a symbol
|
|
137
|
-
*
|
|
154
|
+
*
|
|
138
155
|
* @returns `true` if the value is a symbol, otherwise `false`
|
|
139
156
|
*/
|
|
140
157
|
declare const isSymbol: (val: unknown) => val is symbol;
|
|
141
158
|
/**
|
|
142
159
|
* Checks if a value is an array
|
|
143
|
-
*
|
|
160
|
+
*
|
|
144
161
|
* @returns `true` if the value is an array, otherwise `false`
|
|
145
162
|
*/
|
|
146
163
|
declare const isArray: (arg: any) => arg is any[];
|
|
147
164
|
/**
|
|
148
165
|
* Checks if a value is a function
|
|
149
|
-
*
|
|
166
|
+
*
|
|
150
167
|
* @returns `true` if the value is a function, otherwise `false`
|
|
151
168
|
*/
|
|
152
169
|
declare const isFunction: (val: unknown) => val is Function;
|
|
153
170
|
/**
|
|
154
171
|
* Checks if a value is a Map
|
|
155
|
-
*
|
|
172
|
+
*
|
|
156
173
|
* @returns `true` if the value is a Map, otherwise `false`
|
|
157
174
|
*/
|
|
158
175
|
declare const isMap: (val: unknown) => val is Map<any, any>;
|
|
159
176
|
/**
|
|
160
177
|
* Checks if a value is a Set
|
|
161
|
-
*
|
|
178
|
+
*
|
|
162
179
|
* @returns `true` if the value is a Set, otherwise `false`
|
|
163
180
|
*/
|
|
164
181
|
declare const isSet: (val: unknown) => val is Set<any>;
|
|
165
182
|
/**
|
|
166
183
|
* Checks if a value is a Date
|
|
167
|
-
*
|
|
184
|
+
*
|
|
168
185
|
* @returns `true` if the value is a Date, otherwise `false`
|
|
169
186
|
*/
|
|
170
187
|
declare const isDate: (val: unknown) => val is Date;
|
|
171
188
|
/**
|
|
172
189
|
* Checks if a value is a RegExp
|
|
173
|
-
*
|
|
190
|
+
*
|
|
174
191
|
* @returns `true` if the value is a RegExp, otherwise `false`
|
|
175
192
|
*/
|
|
176
193
|
declare const isRegExp: (val: unknown) => val is RegExp;
|
|
177
194
|
/**
|
|
178
195
|
* Checks if a value is a Promise
|
|
179
|
-
*
|
|
196
|
+
*
|
|
180
197
|
* @returns `true` if the value is a Promise, otherwise `false`
|
|
181
198
|
*/
|
|
182
199
|
declare const isPromise: <T = any>(val: unknown) => val is Promise<T>;
|
|
183
200
|
/**
|
|
184
201
|
* Checks if a value is undefined or null
|
|
185
|
-
*
|
|
202
|
+
*
|
|
186
203
|
* @returns `true` if the value is undefined or null, otherwise `false`
|
|
187
204
|
*/
|
|
188
205
|
declare const isNil: (val: unknown) => val is undefined | null;
|
|
189
206
|
/**
|
|
190
207
|
* Checks if a value is defined (not undefined or null)
|
|
191
|
-
*
|
|
208
|
+
*
|
|
192
209
|
* @returns `true` if the value is defined, otherwise `false`
|
|
193
210
|
*/
|
|
194
211
|
declare const isDef: <T>(val: T) => val is NonNullable<T>;
|
|
195
212
|
/**
|
|
196
213
|
* Checks if two values are different
|
|
197
|
-
*
|
|
198
|
-
* @param newValue The new value
|
|
214
|
+
*
|
|
199
215
|
* @returns `true` if the values are different, otherwise `false`
|
|
200
216
|
*/
|
|
201
217
|
declare const hasChanged: (oldValue: unknown, newValue: unknown) => boolean;
|
|
@@ -225,27 +241,32 @@ declare const hasChanged: (oldValue: unknown, newValue: unknown) => boolean;
|
|
|
225
241
|
declare function hasCircularReference(obj: AnyObject): boolean;
|
|
226
242
|
|
|
227
243
|
/**
|
|
228
|
-
*
|
|
229
|
-
* @param target The target object
|
|
230
|
-
* @param properties The properties to exclude
|
|
231
|
-
* @module
|
|
232
|
-
* @example
|
|
244
|
+
* Creates a new object with specified properties excluded from the original object.
|
|
233
245
|
*
|
|
234
|
-
*
|
|
246
|
+
* This utility removes specific properties from an object and returns a new object
|
|
247
|
+
* containing all other properties. It supports both single property names and arrays
|
|
248
|
+
* of property names, creating a deep clone to prevent reference sharing.
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* omit({ a: 1, b: 2, c: 3 }, 'a') // => { b: 2, c: 3 }
|
|
252
|
+
* omit({ a: 1, b: 2, c: 3 }, ['a', 'b']) // => { c: 3 }
|
|
235
253
|
*
|
|
236
|
-
*
|
|
254
|
+
* @returns Returns a new object without the specified properties
|
|
237
255
|
*/
|
|
238
256
|
declare function omit<T extends object, K extends keyof T>(target: T, properties: Arrayable<K>): Omit<T, K>;
|
|
239
257
|
|
|
240
258
|
/**
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
259
|
+
* Creates a new object with only the specified properties from the original object.
|
|
260
|
+
*
|
|
261
|
+
* This utility extracts specific properties from an object and returns a new object
|
|
262
|
+
* containing only those properties. It supports both single property names and arrays
|
|
263
|
+
* of property names, with optional deep cloning to prevent reference sharing.
|
|
245
264
|
*
|
|
246
|
-
*
|
|
265
|
+
* @example
|
|
266
|
+
* pick({ a: 1, b: 2, c: 3 }, 'a') // => { a: 1 }
|
|
267
|
+
* pick({ a: 1, b: 2, c: 3 }, ['a', 'b']) // => { a: 1, b: 2 }
|
|
247
268
|
*
|
|
248
|
-
*
|
|
269
|
+
* @returns Returns a new object with only the specified properties
|
|
249
270
|
*/
|
|
250
271
|
declare function pick<T extends object, K extends keyof T>(target: T, properties: Arrayable<K>, options?: PickOptions): Pick<T, K>;
|
|
251
272
|
interface PickOptions {
|
|
@@ -267,21 +288,53 @@ interface PickOptions {
|
|
|
267
288
|
}
|
|
268
289
|
|
|
269
290
|
/**
|
|
270
|
-
*
|
|
271
|
-
*
|
|
272
|
-
*
|
|
273
|
-
|
|
291
|
+
* Generates an array of specified length with elements created by a callback function.
|
|
292
|
+
*
|
|
293
|
+
* This utility creates an array by calling the provided callback function the specified number of times.
|
|
294
|
+
* Each element in the array is the result of invoking the callback function. The callback is called
|
|
295
|
+
* independently for each element, allowing for dynamic generation of array contents.
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* generateRandomArray(4, () => 1) // => [1, 1, 1, 1]
|
|
299
|
+
* generateRandomArray(3, () => Math.random()) // => [0.123, 0.456, 0.789]
|
|
300
|
+
* generateRandomArray(2, () => new Date()) // => [Date, Date]
|
|
301
|
+
*
|
|
302
|
+
* @returns Returns an array of length `num` with elements created by calling `cb`
|
|
303
|
+
*
|
|
304
|
+
* @throws {Error} When `num` is not a non-negative integer
|
|
305
|
+
* @throws {Error} When `cb` is not a function
|
|
306
|
+
*/
|
|
307
|
+
declare function generateRandomArray<T>(num: number, cb: () => T): T[];
|
|
274
308
|
|
|
275
309
|
/**
|
|
276
|
-
*
|
|
277
|
-
*
|
|
278
|
-
*
|
|
310
|
+
* Generates a random hex color string in the format '#RRGGBB'.
|
|
311
|
+
*
|
|
312
|
+
* This utility creates a random color by generating a random integer between 0 and 0xFFFFFF,
|
|
313
|
+
* then converting it to a 6-digit hexadecimal string. The result is always a valid CSS color value.
|
|
314
|
+
*
|
|
315
|
+
* @example
|
|
316
|
+
* generateRandomColor() // => '#f36a38'
|
|
317
|
+
* generateRandomColor() // => '#00ffcc'
|
|
318
|
+
* generateRandomColor() // => '#123456'
|
|
319
|
+
*
|
|
320
|
+
* @returns Returns a string representing a random color in hex format, always starting with '#'.
|
|
321
|
+
*/
|
|
279
322
|
declare function generateRandomColor(): string;
|
|
280
323
|
|
|
281
324
|
/**
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
325
|
+
* Generates a random date within a specified time range.
|
|
326
|
+
*
|
|
327
|
+
* This utility creates random dates between start and end boundaries with customizable
|
|
328
|
+
* date formatting. It intelligently handles date validation and ensures the generated
|
|
329
|
+
* date falls within the specified range while respecting calendar constraints.
|
|
330
|
+
*
|
|
331
|
+
* @example
|
|
332
|
+
* generateRandomDate() // => '2021-07-01 08:51:34'
|
|
333
|
+
* generateRandomDate({ start: '2020-01-01' }) // => '2022-03-15 14:23:45'
|
|
334
|
+
* generateRandomDate({ format: 'YYYY-MM-DD' }) // => '2021-11-28'
|
|
335
|
+
*
|
|
336
|
+
* @returns Returns a randomly generated date string in the specified format
|
|
337
|
+
*/
|
|
285
338
|
declare function generateRandomDate(options?: GenerateRandomDate): string;
|
|
286
339
|
interface GenerateRandomDate {
|
|
287
340
|
/**
|
|
@@ -302,15 +355,35 @@ interface GenerateRandomDate {
|
|
|
302
355
|
}
|
|
303
356
|
|
|
304
357
|
/**
|
|
305
|
-
*
|
|
306
|
-
*
|
|
358
|
+
* Generates a random email address with realistic formatting.
|
|
359
|
+
*
|
|
360
|
+
* This utility creates random email addresses using common email providers
|
|
361
|
+
* and ensures proper email format validation. The generated emails have
|
|
362
|
+
* random usernames and are selected from a pool of realistic domains.
|
|
363
|
+
*
|
|
364
|
+
* @example
|
|
365
|
+
* generateRandomEmail() // => 'lZtJqMl0dyTO3WDGzFDO@gmail.com'
|
|
366
|
+
* generateRandomEmail() // => 'Kj9mP2xQ@outlook.com.cn'
|
|
367
|
+
* generateRandomEmail() // => 'abc123@qq.com'
|
|
368
|
+
*
|
|
369
|
+
* @returns Returns a randomly generated email address string
|
|
307
370
|
*/
|
|
308
371
|
declare function generateRandomEmail(): string;
|
|
309
372
|
|
|
310
373
|
/**
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
*
|
|
374
|
+
* Generates a random floating-point number within a specified range.
|
|
375
|
+
*
|
|
376
|
+
* This utility creates random float values between minimum and maximum boundaries
|
|
377
|
+
* with support for precision control. It accepts either a simple maximum value
|
|
378
|
+
* or a configuration object with detailed range and precision settings.
|
|
379
|
+
*
|
|
380
|
+
* @example
|
|
381
|
+
* generateRandomFloat() // => 0.35
|
|
382
|
+
* generateRandomFloat(10) // => 7.23 (between 0 and 10)
|
|
383
|
+
* generateRandomFloat({ min: 1, max: 5 }) // => 3.47 (between 1 and 5)
|
|
384
|
+
*
|
|
385
|
+
* @returns Returns a random floating-point number within the specified range
|
|
386
|
+
*/
|
|
314
387
|
declare function generateRandomFloat(options?: GenerateRandomFloat): number;
|
|
315
388
|
type GenerateRandomFloat = number | {
|
|
316
389
|
/**
|
|
@@ -331,34 +404,68 @@ type GenerateRandomFloat = number | {
|
|
|
331
404
|
};
|
|
332
405
|
|
|
333
406
|
/**
|
|
334
|
-
*
|
|
335
|
-
*
|
|
407
|
+
* Generates a random Chinese ID card number with valid format.
|
|
408
|
+
*
|
|
409
|
+
* This utility creates random Chinese identity card numbers following the
|
|
410
|
+
* standard 18-digit format. The generated numbers include area codes, birth dates,
|
|
411
|
+
* sequence numbers, and check digits, maintaining the structural validity of real ID numbers.
|
|
412
|
+
*
|
|
413
|
+
* @example
|
|
414
|
+
* generateRandomIdCard() // => '410304200210165258'
|
|
415
|
+
* generateRandomIdCard() // => '11010519901215002X'
|
|
416
|
+
* generateRandomIdCard() // => '330106198512234567'
|
|
417
|
+
*
|
|
418
|
+
* @returns Returns a randomly generated Chinese ID card number string
|
|
336
419
|
*/
|
|
337
420
|
declare function generateRandomIdCard(): string;
|
|
338
421
|
|
|
339
422
|
/**
|
|
340
|
-
*
|
|
341
|
-
*
|
|
423
|
+
* Generates a random Chinese mobile phone number with valid prefix.
|
|
424
|
+
*
|
|
425
|
+
* This utility creates random Chinese mobile phone numbers using authentic
|
|
426
|
+
* carrier prefixes (13x, 14x, 15x, 16x, 17x, 18x, 19x) followed by random
|
|
427
|
+
* digits to form complete 11-digit phone numbers.
|
|
428
|
+
*
|
|
429
|
+
* @example
|
|
430
|
+
* generateRandomMobilePhone() // => '13012345678'
|
|
431
|
+
* generateRandomMobilePhone() // => '18598765432'
|
|
432
|
+
* generateRandomMobilePhone() // => '15611223344'
|
|
433
|
+
*
|
|
434
|
+
* @returns Returns a randomly generated Chinese mobile phone number string
|
|
342
435
|
*/
|
|
343
436
|
declare function generateRandomMobilePhone(): string;
|
|
344
437
|
|
|
345
438
|
/**
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
*
|
|
439
|
+
* Generates a random string by selecting characters from a provided source array.
|
|
440
|
+
*
|
|
441
|
+
* This utility creates a string of specified length by randomly selecting items from
|
|
442
|
+
* the source array. Each character in the result is independently chosen, allowing
|
|
443
|
+
* for repetition of characters from the source.
|
|
444
|
+
*
|
|
445
|
+
* @example
|
|
446
|
+
* generateRandomStringFromSource(4, ['1', 'b', 'c', 'd', 'e']) // => 'dea1'
|
|
447
|
+
* generateRandomStringFromSource(6, ['a', 'b', 'c']) // => 'abcabc'
|
|
448
|
+
*
|
|
449
|
+
* @returns Returns a string composed of randomly selected characters from the source
|
|
450
|
+
*
|
|
451
|
+
* @throws {Error} When `num` is not greater than 0
|
|
452
|
+
* @throws {Error} When `source` is not a non-empty array
|
|
453
|
+
*/
|
|
350
454
|
declare function generateRandomStringFromSource(num: number, source: (number | string)[]): string;
|
|
351
455
|
|
|
352
456
|
/**
|
|
353
|
-
*
|
|
354
|
-
*
|
|
355
|
-
* @example
|
|
457
|
+
* Generates a random integer within a specified range.
|
|
356
458
|
*
|
|
357
|
-
*
|
|
459
|
+
* This utility generates random integers with flexible range specification. It accepts
|
|
460
|
+
* either a simple maximum value or an options object with min/max boundaries.
|
|
461
|
+
* The function ensures the generated number is inclusive of both boundaries.
|
|
358
462
|
*
|
|
359
|
-
*
|
|
463
|
+
* @example
|
|
464
|
+
* getRandomInt() // => 217342 (random large integer)
|
|
465
|
+
* getRandomInt(100) // => 35 (between 1 and 100)
|
|
466
|
+
* getRandomInt({ min: 1, max: 100 }) // => 42 (between 1 and 100)
|
|
360
467
|
*
|
|
361
|
-
*
|
|
468
|
+
* @returns Returns a random integer within the specified range (inclusive)
|
|
362
469
|
*/
|
|
363
470
|
declare function getRandomInt(options?: Options$1): number;
|
|
364
471
|
type Options$1 = {
|
|
@@ -380,15 +487,33 @@ type Options$1 = {
|
|
|
380
487
|
| number;
|
|
381
488
|
|
|
382
489
|
/**
|
|
383
|
-
*
|
|
384
|
-
*
|
|
490
|
+
* Selects a random item from an array.
|
|
491
|
+
*
|
|
492
|
+
* This utility randomly picks one element from the provided array using
|
|
493
|
+
* a uniform distribution. Each element has an equal probability of being selected.
|
|
494
|
+
*
|
|
495
|
+
* @example
|
|
496
|
+
* getRandomItem([0, 1, 2, 3, 4]) // => 2
|
|
497
|
+
* getRandomItem(['a', 'b', 'c']) // => 'b'
|
|
498
|
+
* getRandomItem([{ id: 1 }, { id: 2 }]) // => { id: 1 }
|
|
499
|
+
*
|
|
500
|
+
* @returns Returns a randomly selected item from the array
|
|
385
501
|
*/
|
|
386
502
|
declare function getRandomItem<T>(list: T[]): T;
|
|
387
503
|
|
|
388
504
|
/**
|
|
389
|
-
*
|
|
505
|
+
* Generates a random string with customizable character sets and length.
|
|
390
506
|
*
|
|
391
|
-
*
|
|
507
|
+
* This utility creates random strings using a combination of uppercase letters,
|
|
508
|
+
* lowercase letters, numbers, and optional extra characters. It supports flexible
|
|
509
|
+
* configuration including length ranges, prefixes, suffixes, and character set customization.
|
|
510
|
+
*
|
|
511
|
+
* @example
|
|
512
|
+
* getRandomString() // => 'lZtJqMl0dyTO3WDG'
|
|
513
|
+
* getRandomString({ length: 8 }) // => 'Kj9mP2xQ'
|
|
514
|
+
* getRandomString({ prefix: 'user_', length: 6 }) // => 'user_Abc123'
|
|
515
|
+
*
|
|
516
|
+
* @returns Returns a randomly generated string based on the specified options
|
|
392
517
|
*/
|
|
393
518
|
declare function getRandomString(options?: Options): string;
|
|
394
519
|
type Options = {
|
|
@@ -443,44 +568,109 @@ type Options = {
|
|
|
443
568
|
| number;
|
|
444
569
|
|
|
445
570
|
/**
|
|
446
|
-
*
|
|
571
|
+
* Generates a random URL string with realistic structure.
|
|
572
|
+
*
|
|
573
|
+
* This utility creates random URLs with authentic components including protocols,
|
|
574
|
+
* domain names, top-level domains, and query parameters. The generated URLs
|
|
575
|
+
* follow standard web address conventions with various parameter combinations.
|
|
447
576
|
*
|
|
448
|
-
* @example
|
|
577
|
+
* @example
|
|
578
|
+
* getRandomUrl() // => 'https://06hcfsdjubH.cn?name=aB3x'
|
|
579
|
+
* getRandomUrl() // => 'http://mywebsite.com?id=12345'
|
|
580
|
+
* getRandomUrl() // => 'https://example.org?token=a1b2c3d4e5f6g7h8'
|
|
581
|
+
*
|
|
582
|
+
* @returns Returns a randomly generated URL string
|
|
449
583
|
*/
|
|
450
584
|
declare function getRandomUrl(): string;
|
|
451
585
|
|
|
452
586
|
/**
|
|
453
|
-
*
|
|
454
|
-
*
|
|
587
|
+
* Converts a decimal number to its binary representation.
|
|
588
|
+
*
|
|
589
|
+
* This utility transforms a decimal number into a binary string using the standard
|
|
590
|
+
* division-by-2 algorithm. The function uses a stack-based approach to ensure
|
|
591
|
+
* the correct order of binary digits in the result.
|
|
592
|
+
*
|
|
593
|
+
* @example
|
|
594
|
+
* decimalToBinary(233) // => '11101001'
|
|
595
|
+
* decimalToBinary(10) // => '1010'
|
|
596
|
+
* decimalToBinary(0) // => ''
|
|
597
|
+
*
|
|
598
|
+
* @returns Returns the binary representation as a string
|
|
455
599
|
*/
|
|
456
600
|
declare function decimalToBinary(decNumber: number): string;
|
|
457
601
|
/**
|
|
458
|
-
* Base64
|
|
459
|
-
*
|
|
602
|
+
* Encodes a string to Base64 format.
|
|
603
|
+
*
|
|
604
|
+
* This utility converts a string into its Base64 encoded representation using
|
|
605
|
+
* the standard Base64 character set. The function handles UTF-8 characters
|
|
606
|
+
* and applies proper padding as required by the Base64 specification.
|
|
607
|
+
*
|
|
608
|
+
* @example
|
|
609
|
+
* base64Encode('hello') // => 'aGVsbG8='
|
|
610
|
+
* base64Encode('Hi there!') // => 'SGkgdGhlcmUh'
|
|
611
|
+
* base64Encode('') // => ''
|
|
612
|
+
*
|
|
613
|
+
* @returns Returns the Base64 encoded string
|
|
460
614
|
*/
|
|
461
615
|
declare function base64Encode(str: string): string;
|
|
462
616
|
/**
|
|
463
|
-
* Base64
|
|
464
|
-
*
|
|
617
|
+
* Decodes a Base64 encoded string back to its original format.
|
|
618
|
+
*
|
|
619
|
+
* This utility converts a Base64 encoded string back to its original text representation.
|
|
620
|
+
* The function handles standard Base64 padding and properly reconstructs the original
|
|
621
|
+
* characters from the encoded binary data.
|
|
622
|
+
*
|
|
623
|
+
* @example
|
|
624
|
+
* base64Decode('aGVsbG8=') // => 'hello'
|
|
625
|
+
* base64Decode('SGkgdGhlcmUh') // => 'Hi there!'
|
|
626
|
+
* base64Decode('') // => ''
|
|
627
|
+
*
|
|
628
|
+
* @returns Returns the decoded original string
|
|
465
629
|
*/
|
|
466
630
|
declare function base64Decode(str: string): string;
|
|
467
631
|
|
|
468
632
|
/**
|
|
469
|
-
*
|
|
470
|
-
*
|
|
633
|
+
* Composes multiple functions into a single function, executing them from left to right.
|
|
634
|
+
*
|
|
635
|
+
* This utility creates a new function that represents the composition of the provided functions.
|
|
636
|
+
* The output of each function is passed as input to the next function in the sequence.
|
|
637
|
+
*
|
|
638
|
+
* @example
|
|
639
|
+
* const add = (x: number) => x + 1
|
|
640
|
+
* const multiply = (x: number) => x * 2
|
|
641
|
+
* const composed = compose(add, multiply)
|
|
642
|
+
* composed(5) // => 12 (5 + 1 = 6, then 6 * 2 = 12)
|
|
643
|
+
*
|
|
644
|
+
* @returns Returns the composed function
|
|
471
645
|
*/
|
|
472
646
|
declare function compose(...fns: ((...args: any[]) => any)[]): (...args: any[]) => any;
|
|
473
647
|
/**
|
|
474
|
-
*
|
|
475
|
-
*
|
|
648
|
+
* Composes multiple functions into a single function, executing them from right to left.
|
|
649
|
+
*
|
|
650
|
+
* This utility creates a new function that represents the composition of the provided functions
|
|
651
|
+
* in reverse order. The output of each function is passed as input to the previous function.
|
|
652
|
+
*
|
|
653
|
+
* @example
|
|
654
|
+
* const add = (x: number) => x + 1
|
|
655
|
+
* const multiply = (x: number) => x * 2
|
|
656
|
+
* const composed = composeRight(add, multiply)
|
|
657
|
+
* composed(5) // => 11 (5 * 2 = 10, then 10 + 1 = 11)
|
|
658
|
+
*
|
|
659
|
+
* @returns Returns the composed function
|
|
476
660
|
*/
|
|
477
661
|
declare function composeRight(...fns: ((...args: any[]) => any)[]): (...args: any[]) => any;
|
|
478
662
|
|
|
479
663
|
/**
|
|
480
|
-
*
|
|
481
|
-
*
|
|
482
|
-
*
|
|
483
|
-
*
|
|
664
|
+
* Creates a debounced function that delays invoking the provided function until after the specified time period has elapsed since the last time it was called.
|
|
665
|
+
*
|
|
666
|
+
* This utility prevents a function from being called too frequently by delaying its execution.
|
|
667
|
+
* Each new call resets the delay timer, ensuring the function only executes after the specified
|
|
668
|
+
* wait period of inactivity.
|
|
669
|
+
*
|
|
670
|
+
* @example
|
|
671
|
+
* debounce(() => console.log('debounce'), 500)
|
|
672
|
+
*
|
|
673
|
+
* @returns Returns the debounced function
|
|
484
674
|
*/
|
|
485
675
|
declare function debounce(target: Function, wait?: number): (...args: any[]) => void;
|
|
486
676
|
|
|
@@ -543,21 +733,57 @@ interface DeepMergeOptions {
|
|
|
543
733
|
mergeStrategy?: 'merge' | 'replace';
|
|
544
734
|
}
|
|
545
735
|
|
|
736
|
+
/**
|
|
737
|
+
* Custom error class for utility functions.
|
|
738
|
+
*
|
|
739
|
+
* This error class extends the native Error class and provides a consistent
|
|
740
|
+
* way to throw errors with a specific scope or context name.
|
|
741
|
+
*/
|
|
546
742
|
declare class UtilsError extends Error {
|
|
547
743
|
constructor(m: string, name?: string);
|
|
548
744
|
}
|
|
745
|
+
/**
|
|
746
|
+
* Throws a formatted error with scope information.
|
|
747
|
+
*
|
|
748
|
+
* This utility creates and throws a UtilsError with a formatted message
|
|
749
|
+
* that includes the scope context for better debugging and error tracking.
|
|
750
|
+
*
|
|
751
|
+
* @example
|
|
752
|
+
* throwError('validation', 'Invalid input') // throws Error: [validation] Invalid input
|
|
753
|
+
*
|
|
754
|
+
* @throws {UtilsError} Always throws an error with the formatted message
|
|
755
|
+
*/
|
|
549
756
|
declare function throwError(scope: string, message: string): void;
|
|
757
|
+
/**
|
|
758
|
+
* Logs a warning message to the console.
|
|
759
|
+
*
|
|
760
|
+
* This utility function provides a flexible way to log warnings, accepting either
|
|
761
|
+
* an Error object directly or scope and message parameters to create a warning.
|
|
762
|
+
* It outputs the warning to the console for debugging purposes.
|
|
763
|
+
*
|
|
764
|
+
* @example
|
|
765
|
+
* debugWarn('validation', 'Deprecated API usage')
|
|
766
|
+
* debugWarn(new Error('Something went wrong'))
|
|
767
|
+
*
|
|
768
|
+
* @returns No return value - outputs warning to console
|
|
769
|
+
*/
|
|
550
770
|
declare function debugWarn(err: Error): void;
|
|
551
771
|
declare function debugWarn(scope: string, message: string): void;
|
|
552
|
-
declare const deprecated: ({ from, replacement, version, type, }: {
|
|
553
|
-
from: string;
|
|
554
|
-
replacement: string;
|
|
555
|
-
version: string;
|
|
556
|
-
type?: "API";
|
|
557
|
-
}) => void;
|
|
558
|
-
declare function throwErrorInvalidTypeMessage(scope: string, key: string, type: string, value: unknown): void;
|
|
559
|
-
declare function debugWarnInvalidTypeMessage(scope: string, key: string, type: string, value: unknown): void;
|
|
560
772
|
|
|
773
|
+
/**
|
|
774
|
+
* Logs informational messages with consistent formatting.
|
|
775
|
+
*
|
|
776
|
+
* This utility provides a standardized logging interface that formats messages
|
|
777
|
+
* with a '[Log]' prefix and the provided name. Supports multiple arguments
|
|
778
|
+
* that will be displayed as context information.
|
|
779
|
+
*
|
|
780
|
+
* @example
|
|
781
|
+
* log('API', 'Request completed')
|
|
782
|
+
* log('User', { id: 1, name: 'John' })
|
|
783
|
+
* log('Debug', 'value1', 'value2', { extra: 'data' })
|
|
784
|
+
*
|
|
785
|
+
* @returns No return value - outputs directly to console
|
|
786
|
+
*/
|
|
561
787
|
declare const log: {
|
|
562
788
|
(name: unknown, ...arg: unknown[]): void;
|
|
563
789
|
info(name: unknown, ...arg: unknown[]): void;
|
|
@@ -803,10 +1029,16 @@ declare const qs: {
|
|
|
803
1029
|
};
|
|
804
1030
|
|
|
805
1031
|
/**
|
|
806
|
-
*
|
|
807
|
-
*
|
|
808
|
-
*
|
|
809
|
-
*
|
|
1032
|
+
* Creates a throttled function that only invokes the provided function at most once per specified time period.
|
|
1033
|
+
*
|
|
1034
|
+
* This utility limits the rate at which a function can fire. When the throttled function is called,
|
|
1035
|
+
* it will invoke the original function immediately if it hasn't been called within the wait period.
|
|
1036
|
+
* Subsequent calls within the wait period are ignored until the period expires.
|
|
1037
|
+
*
|
|
1038
|
+
* @example
|
|
1039
|
+
* throttle(() => console.log('hello world'), 500)
|
|
1040
|
+
*
|
|
1041
|
+
* @returns Returns the throttled function
|
|
810
1042
|
*/
|
|
811
1043
|
declare function throttle(target: Function, wait?: number): (...args: any[]) => any;
|
|
812
1044
|
|
|
@@ -1152,7 +1384,6 @@ declare function isEmail(val: string): boolean;
|
|
|
1152
1384
|
* isEmptyString(undefined) // => false (undefined value)
|
|
1153
1385
|
* isEmptyString(0) // => false (number zero)
|
|
1154
1386
|
*
|
|
1155
|
-
* @param val - The value to check for empty string
|
|
1156
1387
|
* @returns Returns `true` if the value is exactly an empty string, `false` otherwise
|
|
1157
1388
|
*/
|
|
1158
1389
|
declare function isEmptyString(val: unknown): val is "";
|
|
@@ -1174,7 +1405,6 @@ declare function isEmptyString(val: unknown): val is "";
|
|
|
1174
1405
|
* isIdCard('11010519491231002') // => false (incorrect length)
|
|
1175
1406
|
* isIdCard('110105199202300021') // => false (invalid date - Feb 30th)
|
|
1176
1407
|
*
|
|
1177
|
-
* @param val - The string to validate as a Chinese ID card number
|
|
1178
1408
|
* @returns Returns `true` if the string is a valid Chinese ID card number, `false` otherwise
|
|
1179
1409
|
*/
|
|
1180
1410
|
declare function isIdCard(val: string): boolean;
|
|
@@ -1247,4 +1477,4 @@ declare const isStringNumber: (val: string) => boolean;
|
|
|
1247
1477
|
*/
|
|
1248
1478
|
declare function isURL(val: string): boolean;
|
|
1249
1479
|
|
|
1250
|
-
export { type AnyObject, type ArrayItem, type Arrayable, type DeepMergeOptions, type PlainObject, type StringNumber, type StringifyOptions, UtilsError, type WithRetryOptions, base64Decode, base64Encode, castArray, compose, composeRight, debounce, debugWarn,
|
|
1480
|
+
export { type AnyObject, type ArrayItem, type Arrayable, type DeepMergeOptions, type PlainObject, type StringNumber, type StringifyOptions, UtilsError, type WithRetryOptions, base64Decode, base64Encode, castArray, compose, composeRight, debounce, debugWarn, decimalToBinary, deepClone, deepMerge, generateRandomArray, generateRandomColor, generateRandomDate, generateRandomEmail, generateRandomFloat, generateRandomIdCard, generateRandomMobilePhone, generateRandomStringFromSource, getRandomInt, getRandomItem, getRandomString, getRandomUrl, hasChanged, hasCircularReference, isArray, isBoolean, isDate, isDateString, isDef, isEmail, isEmptyString, isFloat, isFunction, isIdCard, isInteger, isMap, isMobilePhone, isNegativeFloat, isNegativeInteger, isNil, isNonNegativeFloat, isNonNegativeInteger, isNonPositiveFloat, isNonPositiveInteger, isNull, isNumber, isObject, isObjectLike, isPlainObject, isPositiveFloat, isPositiveInteger, isPromise, isRegExp, isSet, isString, isStringNumber, isSymbol, isURL, isUndef, objectToString, omit, pick, qs, qsStringify, throttle, throwError, toTypeString, toTypeValue, withRetry };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* @ts-self-types="./esm-bundler.d.ts" */
|
|
2
|
-
function D(e){let t=typeof e;return e!==null&&(t==="object"||t==="function")}function _(e){return e!==null&&typeof e=="object"}var pe=Object.prototype.toString,k=e=>pe.call(e),V=e=>k(e).slice(8,-1),M=e=>typeof e=="string",x=e=>typeof e=="number"&&Number.isFinite(e),w=e=>typeof e=="boolean",W=e=>e===null,u=e=>e===void 0,Q=e=>typeof e=="symbol",y=Array.isArray,L=e=>typeof e=="function",X=e=>k(e)==="[object Map]",J=e=>k(e)==="[object Set]",Z=e=>k(e)==="[object Date]",ee=e=>k(e)==="[object RegExp]",te=e=>_(e)&&L(e?.then)&&L(e?.catch),re=e=>e==null,Ce=e=>e!=null,Fe=(e,t)=>e!==t;function O(e){return k(e)==="[object Object]"}function I(e){return y(e)?e:[e]}function et(e){let t=[],r,n="";for(;e>0;)r=Math.floor(e%2),t.push(r),e=Math.floor(e/2);for(;t.length>0;)n+=t.pop().toString();return n}var ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function tt(e){let t="",r="";for(let o=0;o<e.length;o++)r+=e[o].charCodeAt(0).toString(2).padStart(8,"0");for(let o=0;o<r.length;o+=6)t+=ne[Number.parseInt(r.slice(o,o+6).padEnd(6,"0"),2)];let n=t.length%4;return n!==0&&(t+="=".repeat(4-n)),t}function rt(e){let t="",r="";for(let n=0;n<e.length&&e[n]!=="=";n++)r+=ne.indexOf(e[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let o=Number.parseInt(r.slice(n,n+8),2);o&&(t+=String.fromCharCode(o))}return t}function it(...e){return e.reduce((t,r)=>function(...n){return r(t(...n))})}function at(...e){return e.reduce((t,r)=>function(...n){return t(r(...n))})}function ft(e,t=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}function F(e){let t=new WeakMap;function r(n){if(!_(n))return n;if(Z(n))return new Date(n);if(ee(n))return new RegExp(n);if(te(n))return n;if(t.has(n))return t.get(n);if(X(n)){let m=new Map;return t.set(n,m),n.forEach((p,d)=>m.set(r(d),r(p))),m}if(J(n)){let m=new Set;return t.set(n,m),n.forEach(p=>m.add(r(p))),m}let o=y(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));t.set(n,o);let c=Object.getOwnPropertyDescriptors(n);for(let m of Reflect.ownKeys(c)){let p=c[m];p.get||p.set?Object.defineProperty(o,m,p):Object.defineProperty(o,m,{...p,value:r(p.value)})}return o}return r(e)}function yt(e,t,r={}){return ie(oe(e,r),oe(t,r),r)}function ie(e,t,r){return y(e)?ge(e,t,r):le(e,t,r)}function le(e,t,r){if(!O(t))return t;let n=Object.getOwnPropertyDescriptors(t);return Reflect.ownKeys(t).forEach(o=>{(O(e[o])||y(e[o]))&&(O(t[o])||y(t[o]))?e[o]=ie(e[o],t[o],r):Object.defineProperty(e,o,n[o])}),e}function ge(e,t,r){let{mergeStrategy:n="replace"}=r;if(y(t))switch(n){case"merge":return e.concat(t);case"replace":return t;default:return t}return t}function oe(e,t){let{deepClone:r=!0}=t;return r?F(e):e}var U=class extends Error{constructor(t,r="Utils"){super(t),this.name=r}};function s(e,t){throw new U(`[${e}] ${t}`)}function ae(e,t){let r=M(e)?new U(`[${e}] ${t}`,"UtilsWarn"):e;console.warn(r)}var Ot=({from:e,replacement:t,version:r,type:n="API"})=>{ae(`${n}`,`${e} is about to be deprecated in version ${r}, please use ${t} instead.`)};function $t(e,t,r,n){let o=`Invalid params: type check failed for params "${t}". Expected ${r}, got ${V(n)} with value ${n}.`;s(e,o)}function At(e,t,r,n){let o=`Invalid params: type check failed for params "${t}". Expected ${r}, got ${V(n)} with value ${n}.`;ae(e,o)}var B=(e,t,...r)=>{if(!t)return;let n=r.length===0?"":r.length===1?r[0]:r;console[e](`[Log] ${t}:`,n)},H=(e,...t)=>{B("info",e,...t)};H.info=(e,...t)=>{B("info",e,...t)};H.error=(e,...t)=>{B("error",e,...t)};H.warn=(e,...t)=>{B("warn",e,...t)};typeof globalThis<"u"&&(globalThis.log=H);function Mt(e,t={}){de(t);let{encode:r=!0,encodeValuesOnly:n=!1,arrayFormat:o="indices",encodeDotInKeys:c=!1,skipNulls:m=!1,strictNullHandling:p=!1,commaRoundTrip:d=!1,allowEmptyArrays:P=!1,addQueryPrefix:R=!1,delimiter:N="&"}=t,h=t.allowDots??!1;c&&u(t.allowDots)&&(h=!0);let b=[],T=f=>r&&!n?encodeURIComponent(f):f,Y=f=>r?encodeURIComponent(f):f;function K(f,l){if(!u(l)){if(W(l)){if(m)return;b.push(`${T(f)}${p?"":"="}`);return}if(y(l)){if(l.length===0){P&&b.push(`${T(f)}[]`);return}if(o==="comma"){let j=n?l.map(Y).join(","):Y(l.join(","));if(l.length===1&&W(l[0])){if(m)return;b.push(`${T(f)}${d?"[]":""}${p?"":"="}`)}else l.length===1?b.push(`${T(f)}${d?"[]":""}=${j}`):b.push(`${T(f)}=${j}`);return}l.forEach((j,C)=>{let E=f;o==="indices"?E=`${f}[${C}]`:o==="brackets"&&(E=`${f}[]`),K(E,j)});return}if(D(l)){Object.keys(l).forEach(j=>{let C=f;c&&(C=C.replace(/\./g,"%2E"));let E=j;h?(c&&(E=E.replace(/\./g,"%2E")),K(`${C}.${E}`,l[j])):K(`${C}[${E}]`,l[j])});return}b.push(`${T(f)}=${Y(l)}`)}}if(!D(e))return"";se(e)&&s("stringify","Input object contains circular references, cannot stringify"),y(e)?e.forEach((f,l)=>K(`${l}`,f)):Object.keys(e).forEach(f=>K(f,e[f]));let v=b.join(N);return R&&v?`?${v}`:v}function de(e={}){O(e)||s("stringify",'"options" must be a plain object'),!u(e.encode)&&!w(e.encode)&&s("stringify",'"encode" must be a boolean'),!u(e.encodeValuesOnly)&&!w(e.encodeValuesOnly)&&s("stringify",'"encodeValuesOnly" must be a boolean'),!u(e.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(e.arrayFormat)&&s("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!u(e.allowDots)&&!w(e.allowDots)&&s("stringify",'"allowDots" must be a boolean'),!u(e.skipNulls)&&!w(e.skipNulls)&&s("stringify",'"skipNulls" must be a boolean'),!u(e.strictNullHandling)&&!w(e.strictNullHandling)&&s("stringify",'"strictNullHandling" must be a boolean'),!u(e.addQueryPrefix)&&!w(e.addQueryPrefix)&&s("stringify",'"addQueryPrefix" must be a boolean'),!u(e.delimiter)&&!M(e.delimiter)&&s("stringify",'"delimiter" must be a string'),!u(e.encodeDotInKeys)&&!w(e.encodeDotInKeys)&&s("stringify",'"encodeDotInKeys" must be a boolean'),!u(e.commaRoundTrip)&&!w(e.commaRoundTrip)&&s("stringify",'"commaRoundTrip" must be a boolean'),!u(e.allowEmptyArrays)&&!w(e.allowEmptyArrays)&&s("stringify",'"allowEmptyArrays" must be a boolean')}var be={stringify:e=>(D(e)||s("stringify","Input must be an object"),new URLSearchParams(e).toString()),parse:e=>(M(e)||s("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(e).entries())),appendQueryString:(e,t)=>{let r=be.stringify(t);return e.includes("?")?e.endsWith("?")||e.endsWith("&")?`${e}${r}`:`${e}&${r}`:`${e}?${r}`}};function Kt(e,t=500){let r=null;return function(...n){if(re(r))return r=Date.now(),e.apply(this,n);let o=Date.now();if(o-r>=t)return r=o,e.apply(this,n)}}function Wt(e){ye(e);let{fn:t,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:o=!1,signal:c}=e,m,p=c?new Promise((P,R)=>{let N=()=>R(me());c.addEventListener("abort",N),m=()=>c.removeEventListener("abort",N)}):null;return new Promise((P,R)=>{(async()=>{for(let h=1;h<=r;h++){if(c?.aborted)return R(me());try{let b=await Promise.race(p?[t(),p]:[t()]);return P(b)}catch(b){let T=o?n*2**(h-1):n;if(log("withRetry",`Attempt ${h}/${r} failed. Retrying in ${T}ms...`),b instanceof Error&&b.name==="AbortError"||h===r)return R(b);await new Promise(Y=>setTimeout(Y,T))}}})()}).finally(()=>m?.())}function ye(e){O(e)||s("withRetry",'"Options" must be an object'),typeof e.fn!="function"&&s("withRetry",'"fn" must be a function that returns a Promise'),!u(e.maxAttempts)&&(!Number.isInteger(e.maxAttempts)||e.maxAttempts<1)&&s("withRetry",'"maxAttempts" must be a positive integer'),!u(e.retryDelay)&&(!x(e.retryDelay)||e.retryDelay<0)&&s("withRetry",'"retryDelay" must be a non-negative number'),!u(e.enableExponentialBackoff)&&!w(e.enableExponentialBackoff)&&s("withRetry",'"enableExponentialBackoff" must be a boolean'),!u(e.signal)&&typeof e.signal!="object"&&s("withRetry",'"signal" must be an AbortSignal')}var xe="The operation was aborted";function me(e=xe){let t=new Error(e);return t.name="AbortError",t}function se(e){D(e)||s("hasCircularReference",'"obj" must be a object');let t=new Set;function r(n){if(D(n)){if(t.has(n))return!0;t.add(n);for(let o of Object.keys(n))if(r(n[o]))return!0;t.delete(n)}return!1}return r(e)}function fe(e,t,r={}){let{includeProto:n=!1,includeSymbols:o=!0,includeNonEnum:c=!1}=r,m={};return O(e)&&I(t).forEach(d=>{Q(d)&&!o||!(n?d in e:Object.hasOwn(e,d))||!c&&(n?he(e,d):Object.getOwnPropertyDescriptor(e,d))?.enumerable===!1||(m[d]=F(e[d]))}),m}function he(e,t){let r=e;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function $r(e,t){if(!O(e))return{};let r=F(e),n=I(t),o=Object.keys(r).filter(c=>!n.includes(c));return fe(r,o)}function Nr(e,t){return(!x(e)||e<=0)&&s("generateRandomArray","num must be greater than 0"),L(t)||s("generateRandomArray","cb must be a function"),Array.from({length:e}).fill(0).map((r,n)=>t(r,n))}function Cr(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}import S from"dayjs";import $e from"dayjs/plugin/customParseFormat.js";function $(e){return e[Math.floor(Math.random()*e.length)]}function g(e={}){x(e)&&(e={max:e});let{min:t=1,max:r=$(Oe())}=e;we(t,r);let n=Math.ceil(t),o=Math.floor(r);return Math.floor(Math.random()*(o-n+1)+n)}function we(e,t){let r=Math.ceil(e),n=Math.floor(t);Number.isSafeInteger(r)||s("getRandomInt",`The minimum value Math.ceil(${e}) should be a safe integer`),Number.isSafeInteger(n)||s("getRandomInt",`The maximum value Math.floor(${t}) should be a safe integer`),n<r&&(t>=e&&s("getRandomInt",`No integer value found between ${e} and ${t}`),s("getRandomInt",`The maximum value ${t} should be greater than the minimum value ${e}`))}function Oe(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((e,t)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,t+1);return Number(r)})}S.extend($e);function G(e={}){let{start:t="1800-01-01 00:00:00",end:r=S().format("YYYY-MM-DD HH:mm:ss"),format:n="YYYY-MM-DD HH:mm:ss"}=e;(!S(t).isValid()||!S(r).isValid())&&s("generateRandomDate","start and end parameters must be valid date format");let o=S(t).year(),c=S(r).year(),m=g({min:o,max:c}),p=g({min:1,max:12}),d=g({min:1,max:31}),P=g(23),R=g(59),N=g(59),h=S(`${m}-${p}-${d} ${P}:${R}:${N}`);return h.isBefore(S(t))||h.isAfter(S(r))?G(e):h.format(n)}function A(e={}){let t=Re(e),r=Te(t);Se(r);let{length:n}=t;je(n.min,n.max);let o=g(n),c=t.prefix||"";for(let m=0;m<o;m++)c+=r.charAt(Math.floor(Math.random()*r.length));return c+(t.suffix||"")}var Ae=16,z=1;function Re(e){let t=x(e);return{lowerCase:!0,upperCase:!0,number:!0,...t?{}:e,length:t?{max:e,min:e}:x(e.length)?{max:e.length,min:e.length}:{max:Ae,min:z,...e.length},extra:t?[]:[...new Set(I(e.extra||[]))]}}function Te(e){let t="";return e.lowerCase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.upperCase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.number&&(t+="0123456789"),t+=I(e.extra).join(""),t}function Se(e){e.length===0&&s("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function je(e,t){Number.isInteger(e)||s("getRandomString","min must be an integer"),Number.isInteger(t)||s("getRandomString","max must be an integer"),e<z&&s("getRandomString",`Minimum length cannot be less than ${z}`),t<e&&s("getRandomString","Maximum length cannot be less than minimum length")}function Ee(){let e=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],t=`${A(1)}${A({length:g({max:30,min:1})})}${A(1)}@${$(e)}`;return/\.{2,}/.test(t)?Ee():t}function cn(e={}){x(e)&&(e={max:e});let{min:t=0,max:r=1,fractionDigits:n=2}=e;if(t===r)return t;if(t>r)throw new Error(`Maximum value ${r} should be greater than minimum value ${t}`);return Math.random()*(r-t)+t}function q(e,t){(!x(e)||e<=0)&&s("generateRandomStringFromSource","num must be greater than 0"),(!y(t)||t.length===0)&&s("generateRandomStringFromSource","source cannot be empty array");let r="";for(let n=0;n<e;n++)r+=$(t);return r}function On(){let e=g({min:1e5,max:999999}),t=[0,1,2,3,4,5,6,7,8,9];return[e,G({format:"YYYYMMDD"}),q(3,t),q(1,[...t,"X","x"])].join("")}function Sn(){return $(["13","14","15","16","17","18","19"])+g(999999999).toString().padEnd(9,"0")}function Nn(){let e=["http://","https://"],t=[".com",".net",".org",".cn",".top"],r=[`?name=${A({length:{min:4,max:8}})}`,`?id=${g()}`,`?page=${A({length:{min:2,max:4}})}`,`?query=${A({length:{min:5,max:6}})}`,`?search=${A({length:{min:1,max:4}})}`,`?token=${A({length:{min:16,max:16}})}`];return`${$(e)}${A({length:{min:5,max:25}})}${$(t)}${$(r)}`}function Zn(e){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(e)}function eo(e){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function to(e){return/^(?:0|[1-9]\d*)\.\d+$/.test(e)}function ro(e){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function no(e){return/^-(?:0|[1-9]\d*)\.\d+$/.test(e)}function ao(e){return/^-?(?:0|[1-9]\d*)$/.test(e)}function so(e){return/^[1-9]\d*$/.test(e)}function mo(e){return/^(?:0|[1-9]\d*)$/.test(e)&&!Object.is(e,-0)}function fo(e){return/^-[1-9]\d*$/.test(e)}function co(e){return/^-(?:0|[1-9]\d*)$/.test(e)||Object.is(e,-0)}import De from"dayjs";function ce(e,t="YYYY-MM-DD HH:mm:ss"){return De(e,t,!0).isValid()}function yo(e){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(e)}function wo(e){return e===""}import ue from"dayjs";function To(e){if(!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/i.test(e))return!1;let r=e.slice(6,14);return ce(r,"YYYYMMDD")&&ue(r,"YYYYMMDD").isBefore(ue())}function Eo(e){return/^1[3-9]\d{9}$/.test(e)}var No=e=>{if(!M(e)||!/^-?\d+(?:\.\d+)?$/.test(e))return!1;let r=Number(e);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};function Co(e){return/^https?:\/\/\S+$/i.test(e)}export{U as UtilsError,rt as base64Decode,tt as base64Encode,I as castArray,it as compose,at as composeRight,ft as debounce,ae as debugWarn,At as debugWarnInvalidTypeMessage,et as decimalToBinary,F as deepClone,yt as deepMerge,Ot as deprecated,Nr as generateRandomArray,Cr as generateRandomColor,G as generateRandomDate,Ee as generateRandomEmail,cn as generateRandomFloat,On as generateRandomIdCard,Sn as generateRandomMobilePhone,q as generateRandomStringFromSource,g as getRandomInt,$ as getRandomItem,A as getRandomString,Nn as getRandomUrl,Fe as hasChanged,se as hasCircularReference,y as isArray,w as isBoolean,Z as isDate,ce as isDateString,Ce as isDef,yo as isEmail,wo as isEmptyString,Zn as isFloat,L as isFunction,To as isIdCard,ao as isInteger,X as isMap,Eo as isMobilePhone,ro as isNegativeFloat,fo as isNegativeInteger,re as isNil,to as isNonNegativeFloat,mo as isNonNegativeInteger,no as isNonPositiveFloat,co as isNonPositiveInteger,W as isNull,x as isNumber,D as isObject,_ as isObjectLike,O as isPlainObject,eo as isPositiveFloat,so as isPositiveInteger,te as isPromise,ee as isRegExp,J as isSet,M as isString,No as isStringNumber,Q as isSymbol,Co as isURL,u as isUndef,pe as objectToString,$r as omit,fe as pick,be as qs,Mt as qsStringify,Kt as throttle,s as throwError,$t as throwErrorInvalidTypeMessage,k as toTypeString,V as toTypeValue,Wt as withRetry};
|
|
2
|
+
function D(e){let t=typeof e;return e!==null&&(t==="object"||t==="function")}function _(e){return e!==null&&typeof e=="object"}var ue=Object.prototype.toString,k=e=>ue.call(e),Ie=e=>k(e).slice(8,-1),M=e=>typeof e=="string",x=e=>typeof e=="number"&&Number.isFinite(e),w=e=>typeof e=="boolean",W=e=>e===null,u=e=>e===void 0,q=e=>typeof e=="symbol",y=Array.isArray,L=e=>typeof e=="function",Q=e=>k(e)==="[object Map]",X=e=>k(e)==="[object Set]",J=e=>k(e)==="[object Date]",Z=e=>k(e)==="[object RegExp]",ee=e=>_(e)&&L(e?.then)&&L(e?.catch),te=e=>e==null,Ce=e=>e!=null,Fe=(e,t)=>e!==t;function O(e){return k(e)==="[object Object]"}function I(e){return y(e)?e:[e]}function et(e){let t=[],r,n="";for(;e>0;)r=Math.floor(e%2),t.push(r),e=Math.floor(e/2);for(;t.length>0;)n+=t.pop().toString();return n}var re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function tt(e){let t="",r="";for(let a=0;a<e.length;a++)r+=e[a].charCodeAt(0).toString(2).padStart(8,"0");for(let a=0;a<r.length;a+=6)t+=re[Number.parseInt(r.slice(a,a+6).padEnd(6,"0"),2)];let n=t.length%4;return n!==0&&(t+="=".repeat(4-n)),t}function rt(e){let t="",r="";for(let n=0;n<e.length&&e[n]!=="=";n++)r+=re.indexOf(e[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let a=Number.parseInt(r.slice(n,n+8),2);a&&(t+=String.fromCharCode(a))}return t}function it(...e){return e.reduce((t,r)=>function(...n){return r(t(...n))})}function at(...e){return e.reduce((t,r)=>function(...n){return t(r(...n))})}function ft(e,t=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}function F(e){let t=new WeakMap;function r(n){if(!_(n))return n;if(J(n))return new Date(n);if(Z(n))return new RegExp(n);if(ee(n))return n;if(t.has(n))return t.get(n);if(Q(n)){let m=new Map;return t.set(n,m),n.forEach((p,d)=>m.set(r(d),r(p))),m}if(X(n)){let m=new Set;return t.set(n,m),n.forEach(p=>m.add(r(p))),m}let a=y(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));t.set(n,a);let c=Object.getOwnPropertyDescriptors(n);for(let m of Reflect.ownKeys(c)){let p=c[m];p.get||p.set?Object.defineProperty(a,m,p):Object.defineProperty(a,m,{...p,value:r(p.value)})}return a}return r(e)}function yt(e,t,r={}){return oe(ne(e,r),ne(t,r),r)}function oe(e,t,r){return y(e)?le(e,t,r):pe(e,t,r)}function pe(e,t,r){if(!O(t))return t;let n=Object.getOwnPropertyDescriptors(t);return Reflect.ownKeys(t).forEach(a=>{(O(e[a])||y(e[a]))&&(O(t[a])||y(t[a]))?e[a]=oe(e[a],t[a],r):Object.defineProperty(e,a,n[a])}),e}function le(e,t,r){let{mergeStrategy:n="replace"}=r;if(y(t))switch(n){case"merge":return e.concat(t);case"replace":return t;default:return t}return t}function ne(e,t){let{deepClone:r=!0}=t;return r?F(e):e}var U=class extends Error{constructor(t,r="Utils"){super(t),this.name=r}};function s(e,t){throw new U(`[${e}] ${t}`)}function Ot(e,t){let r=M(e)?new U(`[${e}] ${t}`,"UtilsWarn"):e;console.warn(r)}var B=(e,t,...r)=>{if(!t)return;let n=r.length===0?"":r.length===1?r[0]:r;console[e](`[Log] ${t}:`,n)},H=(e,...t)=>{B("info",e,...t)};H.info=(e,...t)=>{B("info",e,...t)};H.error=(e,...t)=>{B("error",e,...t)};H.warn=(e,...t)=>{B("warn",e,...t)};typeof globalThis<"u"&&(globalThis.log=H);function Et(e,t={}){ge(t);let{encode:r=!0,encodeValuesOnly:n=!1,arrayFormat:a="indices",encodeDotInKeys:c=!1,skipNulls:m=!1,strictNullHandling:p=!1,commaRoundTrip:d=!1,allowEmptyArrays:N=!1,addQueryPrefix:S=!1,delimiter:P="&"}=t,h=t.allowDots??!1;c&&u(t.allowDots)&&(h=!0);let b=[],$=f=>r&&!n?encodeURIComponent(f):f,Y=f=>r?encodeURIComponent(f):f;function K(f,l){if(!u(l)){if(W(l)){if(m)return;b.push(`${$(f)}${p?"":"="}`);return}if(y(l)){if(l.length===0){N&&b.push(`${$(f)}[]`);return}if(a==="comma"){let T=n?l.map(Y).join(","):Y(l.join(","));if(l.length===1&&W(l[0])){if(m)return;b.push(`${$(f)}${d?"[]":""}${p?"":"="}`)}else l.length===1?b.push(`${$(f)}${d?"[]":""}=${T}`):b.push(`${$(f)}=${T}`);return}l.forEach((T,C)=>{let E=f;a==="indices"?E=`${f}[${C}]`:a==="brackets"&&(E=`${f}[]`),K(E,T)});return}if(D(l)){Object.keys(l).forEach(T=>{let C=f;c&&(C=C.replace(/\./g,"%2E"));let E=T;h?(c&&(E=E.replace(/\./g,"%2E")),K(`${C}.${E}`,l[T])):K(`${C}[${E}]`,l[T])});return}b.push(`${$(f)}=${Y(l)}`)}}if(!D(e))return"";ie(e)&&s("stringify","Input object contains circular references, cannot stringify"),y(e)?e.forEach((f,l)=>K(`${l}`,f)):Object.keys(e).forEach(f=>K(f,e[f]));let V=b.join(P);return S&&V?`?${V}`:V}function ge(e={}){O(e)||s("stringify",'"options" must be a plain object'),!u(e.encode)&&!w(e.encode)&&s("stringify",'"encode" must be a boolean'),!u(e.encodeValuesOnly)&&!w(e.encodeValuesOnly)&&s("stringify",'"encodeValuesOnly" must be a boolean'),!u(e.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(e.arrayFormat)&&s("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!u(e.allowDots)&&!w(e.allowDots)&&s("stringify",'"allowDots" must be a boolean'),!u(e.skipNulls)&&!w(e.skipNulls)&&s("stringify",'"skipNulls" must be a boolean'),!u(e.strictNullHandling)&&!w(e.strictNullHandling)&&s("stringify",'"strictNullHandling" must be a boolean'),!u(e.addQueryPrefix)&&!w(e.addQueryPrefix)&&s("stringify",'"addQueryPrefix" must be a boolean'),!u(e.delimiter)&&!M(e.delimiter)&&s("stringify",'"delimiter" must be a string'),!u(e.encodeDotInKeys)&&!w(e.encodeDotInKeys)&&s("stringify",'"encodeDotInKeys" must be a boolean'),!u(e.commaRoundTrip)&&!w(e.commaRoundTrip)&&s("stringify",'"commaRoundTrip" must be a boolean'),!u(e.allowEmptyArrays)&&!w(e.allowEmptyArrays)&&s("stringify",'"allowEmptyArrays" must be a boolean')}var de={stringify:e=>(D(e)||s("stringify","Input must be an object"),new URLSearchParams(e).toString()),parse:e=>(M(e)||s("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(e).entries())),appendQueryString:(e,t)=>{let r=de.stringify(t);return e.includes("?")?e.endsWith("?")||e.endsWith("&")?`${e}${r}`:`${e}&${r}`:`${e}?${r}`}};function Ft(e,t=500){let r=null;return function(...n){if(te(r))return r=Date.now(),e.apply(this,n);let a=Date.now();if(a-r>=t)return r=a,e.apply(this,n)}}function Vt(e){be(e);let{fn:t,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:a=!1,signal:c}=e,m,p=c?new Promise((N,S)=>{let P=()=>S(ae());c.addEventListener("abort",P),m=()=>c.removeEventListener("abort",P)}):null;return new Promise((N,S)=>{(async()=>{for(let h=1;h<=r;h++){if(c?.aborted)return S(ae());try{let b=await Promise.race(p?[t(),p]:[t()]);return N(b)}catch(b){let $=a?n*2**(h-1):n;if(log("withRetry",`Attempt ${h}/${r} failed. Retrying in ${$}ms...`),b instanceof Error&&b.name==="AbortError"||h===r)return S(b);await new Promise(Y=>setTimeout(Y,$))}}})()}).finally(()=>m?.())}function be(e){O(e)||s("withRetry",'"Options" must be an object'),typeof e.fn!="function"&&s("withRetry",'"fn" must be a function that returns a Promise'),!u(e.maxAttempts)&&(!Number.isInteger(e.maxAttempts)||e.maxAttempts<1)&&s("withRetry",'"maxAttempts" must be a positive integer'),!u(e.retryDelay)&&(!x(e.retryDelay)||e.retryDelay<0)&&s("withRetry",'"retryDelay" must be a non-negative number'),!u(e.enableExponentialBackoff)&&!w(e.enableExponentialBackoff)&&s("withRetry",'"enableExponentialBackoff" must be a boolean'),!u(e.signal)&&typeof e.signal!="object"&&s("withRetry",'"signal" must be an AbortSignal')}var ye="The operation was aborted";function ae(e=ye){let t=new Error(e);return t.name="AbortError",t}function ie(e){D(e)||s("hasCircularReference",'"obj" must be a object');let t=new Set;function r(n){if(D(n)){if(t.has(n))return!0;t.add(n);for(let a of Object.keys(n))if(r(n[a]))return!0;t.delete(n)}return!1}return r(e)}function se(e,t,r={}){let{includeProto:n=!1,includeSymbols:a=!0,includeNonEnum:c=!1}=r,m={};return O(e)&&I(t).forEach(d=>{q(d)&&!a||!(n?d in e:Object.hasOwn(e,d))||!c&&(n?xe(e,d):Object.getOwnPropertyDescriptor(e,d))?.enumerable===!1||(m[d]=F(e[d]))}),m}function xe(e,t){let r=e;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function wr(e,t){if(!O(e))return{};let r=F(e),n=I(t),a=Object.keys(r).filter(c=>!n.includes(c));return se(r,a)}function Dr(e){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(e)}function Mr(e){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function Nr(e){return/^(?:0|[1-9]\d*)\.\d+$/.test(e)}function Pr(e){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function kr(e){return/^-(?:0|[1-9]\d*)\.\d+$/.test(e)}function Fr(e){return/^-?(?:0|[1-9]\d*)$/.test(e)}function Yr(e){return/^[1-9]\d*$/.test(e)}function me(e){return/^(?:0|[1-9]\d*)$/.test(e)&&!Object.is(e,-0)}function Kr(e){return/^-[1-9]\d*$/.test(e)}function _r(e){return/^-(?:0|[1-9]\d*)$/.test(e)||Object.is(e,-0)}import he from"dayjs";function fe(e,t="YYYY-MM-DD HH:mm:ss"){return he(e,t,!0).isValid()}function Wr(e){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(e)}function zr(e){return e===""}import ce from"dayjs";function Zr(e){if(!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/i.test(e))return!1;let r=e.slice(6,14);return fe(r,"YYYYMMDD")&&ce(r,"YYYYMMDD").isBefore(ce())}function rn(e){return/^1[3-9]\d{9}$/.test(e)}var sn=e=>{if(!M(e)||!/^-?\d+(?:\.\d+)?$/.test(e))return!1;let r=Number(e);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};function cn(e){return/^https?:\/\/\S+$/i.test(e)}function En(e,t){return(!x(e)||!me(e.toString()))&&s("generateRandomArray","num must be greater than 0"),L(t)||s("generateRandomArray","cb must be a function"),Array.from({length:e},()=>t())}function Nn(){return`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`}import j from"dayjs";import Re from"dayjs/plugin/customParseFormat.js";function R(e){return e[Math.floor(Math.random()*e.length)]}function g(e={}){x(e)&&(e={max:e});let{min:t=1,max:r=R(Oe())}=e;we(t,r);let n=Math.ceil(t),a=Math.floor(r);return Math.floor(Math.random()*(a-n+1)+n)}function we(e,t){let r=Math.ceil(e),n=Math.floor(t);Number.isSafeInteger(r)||s("getRandomInt",`The minimum value Math.ceil(${e}) should be a safe integer`),Number.isSafeInteger(n)||s("getRandomInt",`The maximum value Math.floor(${t}) should be a safe integer`),n<r&&(t>=e&&s("getRandomInt",`No integer value found between ${e} and ${t}`),s("getRandomInt",`The maximum value ${t} should be greater than the minimum value ${e}`))}function Oe(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((e,t)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,t+1);return Number(r)})}j.extend(Re);function G(e={}){let{start:t="1800-01-01 00:00:00",end:r=j().format("YYYY-MM-DD HH:mm:ss"),format:n="YYYY-MM-DD HH:mm:ss"}=e;(!j(t).isValid()||!j(r).isValid())&&s("generateRandomDate","start and end parameters must be valid date format");let a=j(t).year(),c=j(r).year(),m=g({min:a,max:c}),p=g({min:1,max:12}),d=g({min:1,max:31}),N=g(23),S=g(59),P=g(59),h=j(`${m}-${p}-${d} ${N}:${S}:${P}`);return h.isBefore(j(t))||h.isAfter(j(r))?G(e):h.format(n)}function A(e={}){let t=Se(e),r=$e(t);je(r);let{length:n}=t;Te(n.min,n.max);let a=g(n),c=t.prefix||"";for(let m=0;m<a;m++)c+=r.charAt(Math.floor(Math.random()*r.length));return c+(t.suffix||"")}var Ae=16,v=1;function Se(e){let t=x(e);return{lowerCase:!0,upperCase:!0,number:!0,...t?{}:e,length:t?{max:e,min:e}:x(e.length)?{max:e.length,min:e.length}:{max:Ae,min:v,...e.length},extra:t?[]:[...new Set(I(e.extra||[]))]}}function $e(e){let t="";return e.lowerCase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.upperCase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.number&&(t+="0123456789"),t+=I(e.extra).join(""),t}function je(e){e.length===0&&s("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function Te(e,t){Number.isInteger(e)||s("getRandomString","min must be an integer"),Number.isInteger(t)||s("getRandomString","max must be an integer"),e<v&&s("getRandomString",`Minimum length cannot be less than ${v}`),t<e&&s("getRandomString","Maximum length cannot be less than minimum length")}function Ee(){let e=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],t=`${A(1)}${A({length:g({max:30,min:1})})}${A(1)}@${R(e)}`;return/\.{2,}/.test(t)?Ee():t}function io(e={}){x(e)&&(e={max:e});let{min:t=0,max:r=1,fractionDigits:n=2}=e;if(t===r)return t;if(t>r)throw new Error(`Maximum value ${r} should be greater than minimum value ${t}`);let a=Math.random()*(r-t)+t;return Number(a.toFixed(n))}function z(e,t){(!x(e)||e<=0)&&s("generateRandomStringFromSource","num must be greater than 0"),(!y(t)||t.length===0)&&s("generateRandomStringFromSource","source cannot be empty array");let r="";for(let n=0;n<e;n++)r+=R(t);return r}function yo(){let e=g({min:1e5,max:999999}),t=[0,1,2,3,4,5,6,7,8,9];return[e,G({format:"YYYYMMDD"}),z(3,t),z(1,[...t,"X","x"])].join("")}function Ro(){return R(["13","14","15","16","17","18","19"])+g(999999999).toString().padEnd(9,"0")}function Eo(){let e=["http://","https://"],t=[".com",".net",".org",".cn",".top"],r=[`?name=${A({length:{min:4,max:8}})}`,`?id=${g()}`,`?page=${A({length:{min:2,max:4}})}`,`?query=${A({length:{min:5,max:6}})}`,`?search=${A({length:{min:1,max:4}})}`,`?token=${A({length:{min:16,max:16}})}`];return`${R(e)}${A({length:{min:5,max:25}})}${R(t)}${R(r)}`}export{U as UtilsError,rt as base64Decode,tt as base64Encode,I as castArray,it as compose,at as composeRight,ft as debounce,Ot as debugWarn,et as decimalToBinary,F as deepClone,yt as deepMerge,En as generateRandomArray,Nn as generateRandomColor,G as generateRandomDate,Ee as generateRandomEmail,io as generateRandomFloat,yo as generateRandomIdCard,Ro as generateRandomMobilePhone,z as generateRandomStringFromSource,g as getRandomInt,R as getRandomItem,A as getRandomString,Eo as getRandomUrl,Fe as hasChanged,ie as hasCircularReference,y as isArray,w as isBoolean,J as isDate,fe as isDateString,Ce as isDef,Wr as isEmail,zr as isEmptyString,Dr as isFloat,L as isFunction,Zr as isIdCard,Fr as isInteger,Q as isMap,rn as isMobilePhone,Pr as isNegativeFloat,Kr as isNegativeInteger,te as isNil,Nr as isNonNegativeFloat,me as isNonNegativeInteger,kr as isNonPositiveFloat,_r as isNonPositiveInteger,W as isNull,x as isNumber,D as isObject,_ as isObjectLike,O as isPlainObject,Mr as isPositiveFloat,Yr as isPositiveInteger,ee as isPromise,Z as isRegExp,X as isSet,M as isString,sn as isStringNumber,q as isSymbol,cn as isURL,u as isUndef,ue as objectToString,wr as omit,se as pick,de as qs,Et as qsStringify,Ft as throttle,s as throwError,k as toTypeString,Ie as toTypeValue,Vt as withRetry};
|
package/dist/utils.global.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var lntvowUtils=(()=>{var re=Object.create;var pt=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var ie=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var Wt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ae=(t,e)=>{for(var r in e)pt(t,r,{get:e[r],enumerable:!0})},Vt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of oe(e))!se.call(t,i)&&i!==r&&pt(t,i,{get:()=>e[i],enumerable:!(n=ne(e,i))||n.enumerable});return t};var gt=(t,e,r)=>(r=t!=null?re(ie(t)):{},Vt(e||!t||!t.__esModule?pt(r,"default",{value:t,enumerable:!0}):r,t)),fe=t=>Vt(pt({},"__esModule",{value:!0}),t);var $t=Wt((Ct,_t)=>{"use strict";(function(t,e){typeof Ct=="object"&&typeof _t<"u"?_t.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(Ct,function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",x="minute",p="hour",M="day",h="week",R="month",C="quarter",Y="year",v="date",P="Invalid Date",c=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,O={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(u){var s=["th","st","nd","rd"],o=u%100;return"["+u+(s[(o-20)%10]||s[o]||s[0])+"]"}},D=function(u,s,o){var f=String(u);return!f||f.length>=s?u:""+Array(s+1-f.length).join(o)+u},$={s:D,z:function(u){var s=-u.utcOffset(),o=Math.abs(s),f=Math.floor(o/60),a=o%60;return(s<=0?"+":"-")+D(f,2,"0")+":"+D(a,2,"0")},m:function u(s,o){if(s.date()<o.date())return-u(o,s);var f=12*(o.year()-s.year())+(o.month()-s.month()),a=s.clone().add(f,R),m=o-a<0,d=s.clone().add(f+(m?-1:1),R);return+(-(f+(o-a)/(m?a-d:d-a))||0)},a:function(u){return u<0?Math.ceil(u)||0:Math.floor(u)},p:function(u){return{M:R,y:Y,w:h,d:M,D:v,h:p,m:x,s:i,ms:n,Q:C}[u]||String(u||"").toLowerCase().replace(/s$/,"")},u:function(u){return u===void 0}},w="en",j={};j[w]=O;var _="$isDayjsObject",E=function(u){return u instanceof F||!(!u||!u[_])},K=function u(s,o,f){var a;if(!s)return w;if(typeof s=="string"){var m=s.toLowerCase();j[m]&&(a=m),o&&(j[m]=o,a=m);var d=s.split("-");if(!a&&d.length>1)return u(d[0])}else{var g=s.name;j[g]=s,a=g}return!f&&a&&(w=a),a||!f&&w},S=function(u,s){if(E(u))return u.clone();var o=typeof s=="object"?s:{};return o.date=u,o.args=arguments,new F(o)},y=$;y.l=K,y.i=E,y.w=function(u,s){return S(u,{locale:s.$L,utc:s.$u,x:s.$x,$offset:s.$offset})};var F=function(){function u(o){this.$L=K(o.locale,null,!0),this.parse(o),this.$x=this.$x||o.x||{},this[_]=!0}var s=u.prototype;return s.parse=function(o){this.$d=function(f){var a=f.date,m=f.utc;if(a===null)return new Date(NaN);if(y.u(a))return new Date;if(a instanceof Date)return new Date(a);if(typeof a=="string"&&!/Z$/i.test(a)){var d=a.match(c);if(d){var g=d[2]-1||0,A=(d[7]||"0").substring(0,3);return m?new Date(Date.UTC(d[1],g,d[3]||1,d[4]||0,d[5]||0,d[6]||0,A)):new Date(d[1],g,d[3]||1,d[4]||0,d[5]||0,d[6]||0,A)}}return new Date(a)}(o),this.init()},s.init=function(){var o=this.$d;this.$y=o.getFullYear(),this.$M=o.getMonth(),this.$D=o.getDate(),this.$W=o.getDay(),this.$H=o.getHours(),this.$m=o.getMinutes(),this.$s=o.getSeconds(),this.$ms=o.getMilliseconds()},s.$utils=function(){return y},s.isValid=function(){return this.$d.toString()!==P},s.isSame=function(o,f){var a=S(o);return this.startOf(f)<=a&&a<=this.endOf(f)},s.isAfter=function(o,f){return S(o)<this.startOf(f)},s.isBefore=function(o,f){return this.endOf(f)<S(o)},s.$g=function(o,f,a){return y.u(o)?this[f]:this.set(a,o)},s.unix=function(){return Math.floor(this.valueOf()/1e3)},s.valueOf=function(){return this.$d.getTime()},s.startOf=function(o,f){var a=this,m=!!y.u(f)||f,d=y.p(o),g=function(X,L){var G=y.w(a.$u?Date.UTC(a.$y,L,X):new Date(a.$y,L,X),a);return m?G:G.endOf(M)},A=function(X,L){return y.w(a.toDate()[X].apply(a.toDate("s"),(m?[0,0,0,0]:[23,59,59,999]).slice(L)),a)},T=this.$W,N=this.$M,W=this.$D,nt="set"+(this.$u?"UTC":"");switch(d){case Y:return m?g(1,0):g(31,11);case R:return m?g(1,N):g(0,N+1);case h:var J=this.$locale().weekStart||0,at=(T<J?T+7:T)-J;return g(m?W-at:W+(6-at),N);case M:case v:return A(nt+"Hours",0);case p:return A(nt+"Minutes",1);case x:return A(nt+"Seconds",2);case i:return A(nt+"Milliseconds",3);default:return this.clone()}},s.endOf=function(o){return this.startOf(o,!1)},s.$set=function(o,f){var a,m=y.p(o),d="set"+(this.$u?"UTC":""),g=(a={},a[M]=d+"Date",a[v]=d+"Date",a[R]=d+"Month",a[Y]=d+"FullYear",a[p]=d+"Hours",a[x]=d+"Minutes",a[i]=d+"Seconds",a[n]=d+"Milliseconds",a)[m],A=m===M?this.$D+(f-this.$W):f;if(m===R||m===Y){var T=this.clone().set(v,1);T.$d[g](A),T.init(),this.$d=T.set(v,Math.min(this.$D,T.daysInMonth())).$d}else g&&this.$d[g](A);return this.init(),this},s.set=function(o,f){return this.clone().$set(o,f)},s.get=function(o){return this[y.p(o)]()},s.add=function(o,f){var a,m=this;o=Number(o);var d=y.p(f),g=function(N){var W=S(m);return y.w(W.date(W.date()+Math.round(N*o)),m)};if(d===R)return this.set(R,this.$M+o);if(d===Y)return this.set(Y,this.$y+o);if(d===M)return g(1);if(d===h)return g(7);var A=(a={},a[x]=e,a[p]=r,a[i]=t,a)[d]||1,T=this.$d.getTime()+o*A;return y.w(T,this)},s.subtract=function(o,f){return this.add(-1*o,f)},s.format=function(o){var f=this,a=this.$locale();if(!this.isValid())return a.invalidDate||P;var m=o||"YYYY-MM-DDTHH:mm:ssZ",d=y.z(this),g=this.$H,A=this.$m,T=this.$M,N=a.weekdays,W=a.months,nt=a.meridiem,J=function(L,G,tt,ot){return L&&(L[G]||L(f,m))||tt[G].slice(0,ot)},at=function(L){return y.s(g%12||12,L,"0")},X=nt||function(L,G,tt){var ot=L<12?"AM":"PM";return tt?ot.toLowerCase():ot};return m.replace(b,function(L,G){return G||function(tt){switch(tt){case"YY":return String(f.$y).slice(-2);case"YYYY":return y.s(f.$y,4,"0");case"M":return T+1;case"MM":return y.s(T+1,2,"0");case"MMM":return J(a.monthsShort,T,W,3);case"MMMM":return J(W,T);case"D":return f.$D;case"DD":return y.s(f.$D,2,"0");case"d":return String(f.$W);case"dd":return J(a.weekdaysMin,f.$W,N,2);case"ddd":return J(a.weekdaysShort,f.$W,N,3);case"dddd":return N[f.$W];case"H":return String(g);case"HH":return y.s(g,2,"0");case"h":return at(1);case"hh":return at(2);case"a":return X(g,A,!0);case"A":return X(g,A,!1);case"m":return String(A);case"mm":return y.s(A,2,"0");case"s":return String(f.$s);case"ss":return y.s(f.$s,2,"0");case"SSS":return y.s(f.$ms,3,"0");case"Z":return d}return null}(L)||d.replace(":","")})},s.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},s.diff=function(o,f,a){var m,d=this,g=y.p(f),A=S(o),T=(A.utcOffset()-this.utcOffset())*e,N=this-A,W=function(){return y.m(d,A)};switch(g){case Y:m=W()/12;break;case R:m=W();break;case C:m=W()/3;break;case h:m=(N-T)/6048e5;break;case M:m=(N-T)/864e5;break;case p:m=N/r;break;case x:m=N/e;break;case i:m=N/t;break;default:m=N}return a?m:y.a(m)},s.daysInMonth=function(){return this.endOf(R).$D},s.$locale=function(){return j[this.$L]},s.locale=function(o,f){if(!o)return this.$L;var a=this.clone(),m=K(o,f,!0);return m&&(a.$L=m),a},s.clone=function(){return y.w(this.$d,this)},s.toDate=function(){return new Date(this.valueOf())},s.toJSON=function(){return this.isValid()?this.toISOString():null},s.toISOString=function(){return this.$d.toISOString()},s.toString=function(){return this.$d.toUTCString()},u}(),U=F.prototype;return S.prototype=U,[["$ms",n],["$s",i],["$m",x],["$H",p],["$W",M],["$M",R],["$y",Y],["$D",v]].forEach(function(u){U[u[1]]=function(s){return this.$g(s,u[0],u[1])}}),S.extend=function(u,s){return u.$i||(u(s,F,S),u.$i=!0),S},S.locale=K,S.isDayjs=E,S.unix=function(u){return S(1e3*u)},S.en=j[w],S.Ls=j,S.p={},S})});var qt=Wt((Lt,Ft)=>{"use strict";(function(t,e){typeof Lt=="object"&&typeof Ft<"u"?Ft.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_customParseFormat=e()})(Lt,function(){"use strict";var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,i=/\d\d?/,x=/\d*[^-_:/,()\s\d]+/,p={},M=function(c){return(c=+c)+(c>68?1900:2e3)},h=function(c){return function(b){this[c]=+b}},R=[/[+-]\d\d:?(\d\d)?|Z/,function(c){(this.zone||(this.zone={})).offset=function(b){if(!b||b==="Z")return 0;var O=b.match(/([+-]|\d\d)/g),D=60*O[1]+(+O[2]||0);return D===0?0:O[0]==="+"?-D:D}(c)}],C=function(c){var b=p[c];return b&&(b.indexOf?b:b.s.concat(b.f))},Y=function(c,b){var O,D=p.meridiem;if(D){for(var $=1;$<=24;$+=1)if(c.indexOf(D($,0,b))>-1){O=$>12;break}}else O=c===(b?"pm":"PM");return O},v={A:[x,function(c){this.afternoon=Y(c,!1)}],a:[x,function(c){this.afternoon=Y(c,!0)}],Q:[r,function(c){this.month=3*(c-1)+1}],S:[r,function(c){this.milliseconds=100*+c}],SS:[n,function(c){this.milliseconds=10*+c}],SSS:[/\d{3}/,function(c){this.milliseconds=+c}],s:[i,h("seconds")],ss:[i,h("seconds")],m:[i,h("minutes")],mm:[i,h("minutes")],H:[i,h("hours")],h:[i,h("hours")],HH:[i,h("hours")],hh:[i,h("hours")],D:[i,h("day")],DD:[n,h("day")],Do:[x,function(c){var b=p.ordinal,O=c.match(/\d+/);if(this.day=O[0],b)for(var D=1;D<=31;D+=1)b(D).replace(/\[|\]/g,"")===c&&(this.day=D)}],w:[i,h("week")],ww:[n,h("week")],M:[i,h("month")],MM:[n,h("month")],MMM:[x,function(c){var b=C("months"),O=(C("monthsShort")||b.map(function(D){return D.slice(0,3)})).indexOf(c)+1;if(O<1)throw new Error;this.month=O%12||O}],MMMM:[x,function(c){var b=C("months").indexOf(c)+1;if(b<1)throw new Error;this.month=b%12||b}],Y:[/[+-]?\d+/,h("year")],YY:[n,function(c){this.year=M(c)}],YYYY:[/\d{4}/,h("year")],Z:R,ZZ:R};function P(c){var b,O;b=c,O=p&&p.formats;for(var D=(c=b.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(S,y,F){var U=F&&F.toUpperCase();return y||O[F]||t[F]||O[U].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(u,s,o){return s||o.slice(1)})})).match(e),$=D.length,w=0;w<$;w+=1){var j=D[w],_=v[j],E=_&&_[0],K=_&&_[1];D[w]=K?{regex:E,parser:K}:j.replace(/^\[|\]$/g,"")}return function(S){for(var y={},F=0,U=0;F<$;F+=1){var u=D[F];if(typeof u=="string")U+=u.length;else{var s=u.regex,o=u.parser,f=S.slice(U),a=s.exec(f)[0];o.call(y,a),S=S.replace(a,"")}}return function(m){var d=m.afternoon;if(d!==void 0){var g=m.hours;d?g<12&&(m.hours+=12):g===12&&(m.hours=0),delete m.afternoon}}(y),y}}return function(c,b,O){O.p.customParseFormat=!0,c&&c.parseTwoDigitYear&&(M=c.parseTwoDigitYear);var D=b.prototype,$=D.parse;D.parse=function(w){var j=w.date,_=w.utc,E=w.args;this.$u=_;var K=E[1];if(typeof K=="string"){var S=E[2]===!0,y=E[3]===!0,F=S||y,U=E[2];y&&(U=E[2]),p=this.$locale(),!S&&U&&(p=O.Ls[U]),this.$d=function(f,a,m,d){try{if(["x","X"].indexOf(a)>-1)return new Date((a==="X"?1e3:1)*f);var g=P(a)(f),A=g.year,T=g.month,N=g.day,W=g.hours,nt=g.minutes,J=g.seconds,at=g.milliseconds,X=g.zone,L=g.week,G=new Date,tt=N||(A||T?1:G.getDate()),ot=A||G.getFullYear(),lt=0;A&&!T||(lt=T>0?T-1:G.getMonth());var dt,Ot=W||0,Dt=nt||0,St=J||0,At=at||0;return X?new Date(Date.UTC(ot,lt,tt,Ot,Dt,St,At+60*X.offset*1e3)):m?new Date(Date.UTC(ot,lt,tt,Ot,Dt,St,At)):(dt=new Date(ot,lt,tt,Ot,Dt,St,At),L&&(dt=d(dt).week(L).toDate()),dt)}catch{return new Date("")}}(j,K,_,O),this.init(),U&&U!==!0&&(this.$L=this.locale(U).$L),F&&j!=this.format(K)&&(this.$d=new Date("")),p={}}else if(K instanceof Array)for(var u=K.length,s=1;s<=u;s+=1){E[1]=K[s-1];var o=O.apply(this,E);if(o.isValid()){this.$d=o.$d,this.$L=o.$L,this.init();break}s===u&&(this.$d=new Date(""))}else $.call(this,w)}}})});var sr={};ae(sr,{UtilsError:()=>mt,base64Decode:()=>de,base64Encode:()=>le,castArray:()=>st,compose:()=>pe,composeRight:()=>ge,debounce:()=>he,debugWarn:()=>Pt,debugWarnInvalidTypeMessage:()=>Me,decimalToBinary:()=>me,deepClone:()=>ft,deepMerge:()=>ye,deprecated:()=>$e,generateRandomArray:()=>ve,generateRandomColor:()=>ke,generateRandomDate:()=>wt,generateRandomEmail:()=>te,generateRandomFloat:()=>Fe,generateRandomIdCard:()=>He,generateRandomMobilePhone:()=>Ke,generateRandomStringFromSource:()=>Mt,getRandomInt:()=>I,getRandomItem:()=>Z,getRandomString:()=>Q,getRandomUrl:()=>Ue,hasChanged:()=>ce,hasCircularReference:()=>Nt,isArray:()=>H,isBoolean:()=>z,isDate:()=>Et,isDateString:()=>Kt,isDef:()=>ue,isEmail:()=>tr,isEmptyString:()=>er,isFloat:()=>We,isFunction:()=>ct,isIdCard:()=>rr,isInteger:()=>Ge,isMap:()=>Rt,isMobilePhone:()=>nr,isNegativeFloat:()=>Be,isNegativeInteger:()=>qe,isNil:()=>Yt,isNonNegativeFloat:()=>ze,isNonNegativeInteger:()=>Xe,isNonPositiveFloat:()=>Ze,isNonPositiveInteger:()=>Je,isNull:()=>yt,isNumber:()=>V,isObject:()=>et,isObjectLike:()=>ut,isPlainObject:()=>B,isPositiveFloat:()=>Ve,isPositiveInteger:()=>Qe,isPromise:()=>kt,isRegExp:()=>vt,isSet:()=>jt,isString:()=>rt,isStringNumber:()=>or,isSymbol:()=>Tt,isURL:()=>ir,isUndef:()=>k,objectToString:()=>zt,omit:()=>Ee,pick:()=>It,qs:()=>Qt,qsStringify:()=>Oe,throttle:()=>Se,throwError:()=>l,throwErrorInvalidTypeMessage:()=>we,toTypeString:()=>it,toTypeValue:()=>ht,withRetry:()=>Ae});function et(t){let e=typeof t;return t!==null&&(e==="object"||e==="function")}function ut(t){return t!==null&&typeof t=="object"}var zt=Object.prototype.toString,it=t=>zt.call(t),ht=t=>it(t).slice(8,-1),rt=t=>typeof t=="string",V=t=>typeof t=="number"&&Number.isFinite(t),z=t=>typeof t=="boolean",yt=t=>t===null,k=t=>t===void 0,Tt=t=>typeof t=="symbol",H=Array.isArray,ct=t=>typeof t=="function",Rt=t=>it(t)==="[object Map]",jt=t=>it(t)==="[object Set]",Et=t=>it(t)==="[object Date]",vt=t=>it(t)==="[object RegExp]",kt=t=>ut(t)&&ct(t?.then)&&ct(t?.catch),Yt=t=>t==null,ue=t=>t!=null,ce=(t,e)=>t!==e;function B(t){return it(t)==="[object Object]"}function st(t){return H(t)?t:[t]}function me(t){let e=[],r,n="";for(;t>0;)r=Math.floor(t%2),e.push(r),t=Math.floor(t/2);for(;e.length>0;)n+=e.pop().toString();return n}var Bt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function le(t){let e="",r="";for(let i=0;i<t.length;i++)r+=t[i].charCodeAt(0).toString(2).padStart(8,"0");for(let i=0;i<r.length;i+=6)e+=Bt[Number.parseInt(r.slice(i,i+6).padEnd(6,"0"),2)];let n=e.length%4;return n!==0&&(e+="=".repeat(4-n)),e}function de(t){let e="",r="";for(let n=0;n<t.length&&t[n]!=="=";n++)r+=Bt.indexOf(t[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let i=Number.parseInt(r.slice(n,n+8),2);i&&(e+=String.fromCharCode(i))}return e}function pe(...t){return t.reduce((e,r)=>function(...n){return r(e(...n))})}function ge(...t){return t.reduce((e,r)=>function(...n){return e(r(...n))})}function he(t,e=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{t.apply(this,n)},e)}}function ft(t){let e=new WeakMap;function r(n){if(!ut(n))return n;if(Et(n))return new Date(n);if(vt(n))return new RegExp(n);if(kt(n))return n;if(e.has(n))return e.get(n);if(Rt(n)){let p=new Map;return e.set(n,p),n.forEach((M,h)=>p.set(r(h),r(M))),p}if(jt(n)){let p=new Set;return e.set(n,p),n.forEach(M=>p.add(r(M))),p}let i=H(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));e.set(n,i);let x=Object.getOwnPropertyDescriptors(n);for(let p of Reflect.ownKeys(x)){let M=x[p];M.get||M.set?Object.defineProperty(i,p,M):Object.defineProperty(i,p,{...M,value:r(M.value)})}return i}return r(t)}function ye(t,e,r={}){return Gt(Zt(t,r),Zt(e,r),r)}function Gt(t,e,r){return H(t)?xe(t,e,r):be(t,e,r)}function be(t,e,r){if(!B(e))return e;let n=Object.getOwnPropertyDescriptors(e);return Reflect.ownKeys(e).forEach(i=>{(B(t[i])||H(t[i]))&&(B(e[i])||H(e[i]))?t[i]=Gt(t[i],e[i],r):Object.defineProperty(t,i,n[i])}),t}function xe(t,e,r){let{mergeStrategy:n="replace"}=r;if(H(e))switch(n){case"merge":return t.concat(e);case"replace":return e;default:return e}return e}function Zt(t,e){let{deepClone:r=!0}=e;return r?ft(t):t}var mt=class extends Error{constructor(e,r="Utils"){super(e),this.name=r}};function l(t,e){throw new mt(`[${t}] ${e}`)}function Pt(t,e){let r=rt(t)?new mt(`[${t}] ${e}`,"UtilsWarn"):t;console.warn(r)}var $e=({from:t,replacement:e,version:r,type:n="API"})=>{Pt(`${n}`,`${t} is about to be deprecated in version ${r}, please use ${e} instead.`)};function we(t,e,r,n){let i=`Invalid params: type check failed for params "${e}". Expected ${r}, got ${ht(n)} with value ${n}.`;l(t,i)}function Me(t,e,r,n){let i=`Invalid params: type check failed for params "${e}". Expected ${r}, got ${ht(n)} with value ${n}.`;Pt(t,i)}var bt=(t,e,...r)=>{if(!e)return;let n=r.length===0?"":r.length===1?r[0]:r;console[t](`[Log] ${e}:`,n)},xt=(t,...e)=>{bt("info",t,...e)};xt.info=(t,...e)=>{bt("info",t,...e)};xt.error=(t,...e)=>{bt("error",t,...e)};xt.warn=(t,...e)=>{bt("warn",t,...e)};typeof globalThis<"u"&&(globalThis.log=xt);function Oe(t,e={}){De(e);let{encode:r=!0,encodeValuesOnly:n=!1,arrayFormat:i="indices",encodeDotInKeys:x=!1,skipNulls:p=!1,strictNullHandling:M=!1,commaRoundTrip:h=!1,allowEmptyArrays:R=!1,addQueryPrefix:C=!1,delimiter:Y="&"}=e,v=e.allowDots??!1;x&&k(e.allowDots)&&(v=!0);let P=[],c=$=>r&&!n?encodeURIComponent($):$,b=$=>r?encodeURIComponent($):$;function O($,w){if(!k(w)){if(yt(w)){if(p)return;P.push(`${c($)}${M?"":"="}`);return}if(H(w)){if(w.length===0){R&&P.push(`${c($)}[]`);return}if(i==="comma"){let j=n?w.map(b).join(","):b(w.join(","));if(w.length===1&&yt(w[0])){if(p)return;P.push(`${c($)}${h?"[]":""}${M?"":"="}`)}else w.length===1?P.push(`${c($)}${h?"[]":""}=${j}`):P.push(`${c($)}=${j}`);return}w.forEach((j,_)=>{let E=$;i==="indices"?E=`${$}[${_}]`:i==="brackets"&&(E=`${$}[]`),O(E,j)});return}if(et(w)){Object.keys(w).forEach(j=>{let _=$;x&&(_=_.replace(/\./g,"%2E"));let E=j;v?(x&&(E=E.replace(/\./g,"%2E")),O(`${_}.${E}`,w[j])):O(`${_}[${E}]`,w[j])});return}P.push(`${c($)}=${b(w)}`)}}if(!et(t))return"";Nt(t)&&l("stringify","Input object contains circular references, cannot stringify"),H(t)?t.forEach(($,w)=>O(`${w}`,$)):Object.keys(t).forEach($=>O($,t[$]));let D=P.join(Y);return C&&D?`?${D}`:D}function De(t={}){B(t)||l("stringify",'"options" must be a plain object'),!k(t.encode)&&!z(t.encode)&&l("stringify",'"encode" must be a boolean'),!k(t.encodeValuesOnly)&&!z(t.encodeValuesOnly)&&l("stringify",'"encodeValuesOnly" must be a boolean'),!k(t.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(t.arrayFormat)&&l("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!k(t.allowDots)&&!z(t.allowDots)&&l("stringify",'"allowDots" must be a boolean'),!k(t.skipNulls)&&!z(t.skipNulls)&&l("stringify",'"skipNulls" must be a boolean'),!k(t.strictNullHandling)&&!z(t.strictNullHandling)&&l("stringify",'"strictNullHandling" must be a boolean'),!k(t.addQueryPrefix)&&!z(t.addQueryPrefix)&&l("stringify",'"addQueryPrefix" must be a boolean'),!k(t.delimiter)&&!rt(t.delimiter)&&l("stringify",'"delimiter" must be a string'),!k(t.encodeDotInKeys)&&!z(t.encodeDotInKeys)&&l("stringify",'"encodeDotInKeys" must be a boolean'),!k(t.commaRoundTrip)&&!z(t.commaRoundTrip)&&l("stringify",'"commaRoundTrip" must be a boolean'),!k(t.allowEmptyArrays)&&!z(t.allowEmptyArrays)&&l("stringify",'"allowEmptyArrays" must be a boolean')}var Qt={stringify:t=>(et(t)||l("stringify","Input must be an object"),new URLSearchParams(t).toString()),parse:t=>(rt(t)||l("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(t).entries())),appendQueryString:(t,e)=>{let r=Qt.stringify(e);return t.includes("?")?t.endsWith("?")||t.endsWith("&")?`${t}${r}`:`${t}&${r}`:`${t}?${r}`}};function Se(t,e=500){let r=null;return function(...n){if(Yt(r))return r=Date.now(),t.apply(this,n);let i=Date.now();if(i-r>=e)return r=i,t.apply(this,n)}}function Ae(t){Te(t);let{fn:e,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:i=!1,signal:x}=t,p,M=x?new Promise((R,C)=>{let Y=()=>C(Xt());x.addEventListener("abort",Y),p=()=>x.removeEventListener("abort",Y)}):null;return new Promise((R,C)=>{(async()=>{for(let v=1;v<=r;v++){if(x?.aborted)return C(Xt());try{let P=await Promise.race(M?[e(),M]:[e()]);return R(P)}catch(P){let c=i?n*2**(v-1):n;if(log("withRetry",`Attempt ${v}/${r} failed. Retrying in ${c}ms...`),P instanceof Error&&P.name==="AbortError"||v===r)return C(P);await new Promise(b=>setTimeout(b,c))}}})()}).finally(()=>p?.())}function Te(t){B(t)||l("withRetry",'"Options" must be an object'),typeof t.fn!="function"&&l("withRetry",'"fn" must be a function that returns a Promise'),!k(t.maxAttempts)&&(!Number.isInteger(t.maxAttempts)||t.maxAttempts<1)&&l("withRetry",'"maxAttempts" must be a positive integer'),!k(t.retryDelay)&&(!V(t.retryDelay)||t.retryDelay<0)&&l("withRetry",'"retryDelay" must be a non-negative number'),!k(t.enableExponentialBackoff)&&!z(t.enableExponentialBackoff)&&l("withRetry",'"enableExponentialBackoff" must be a boolean'),!k(t.signal)&&typeof t.signal!="object"&&l("withRetry",'"signal" must be an AbortSignal')}var Re="The operation was aborted";function Xt(t=Re){let e=new Error(t);return e.name="AbortError",e}function Nt(t){et(t)||l("hasCircularReference",'"obj" must be a object');let e=new Set;function r(n){if(et(n)){if(e.has(n))return!0;e.add(n);for(let i of Object.keys(n))if(r(n[i]))return!0;e.delete(n)}return!1}return r(t)}function It(t,e,r={}){let{includeProto:n=!1,includeSymbols:i=!0,includeNonEnum:x=!1}=r,p={};return B(t)&&st(e).forEach(h=>{Tt(h)&&!i||!(n?h in t:Object.hasOwn(t,h))||!x&&(n?je(t,h):Object.getOwnPropertyDescriptor(t,h))?.enumerable===!1||(p[h]=ft(t[h]))}),p}function je(t,e){let r=t;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function Ee(t,e){if(!B(t))return{};let r=ft(t),n=st(e),i=Object.keys(r).filter(x=>!n.includes(x));return It(r,i)}function ve(t,e){return(!V(t)||t<=0)&&l("generateRandomArray","num must be greater than 0"),ct(e)||l("generateRandomArray","cb must be a function"),Array.from({length:t}).fill(0).map((r,n)=>e(r,n))}function ke(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}var q=gt($t(),1),Jt=gt(qt(),1);function Z(t){return t[Math.floor(Math.random()*t.length)]}function I(t={}){V(t)&&(t={max:t});let{min:e=1,max:r=Z(Pe())}=t;Ye(e,r);let n=Math.ceil(e),i=Math.floor(r);return Math.floor(Math.random()*(i-n+1)+n)}function Ye(t,e){let r=Math.ceil(t),n=Math.floor(e);Number.isSafeInteger(r)||l("getRandomInt",`The minimum value Math.ceil(${t}) should be a safe integer`),Number.isSafeInteger(n)||l("getRandomInt",`The maximum value Math.floor(${e}) should be a safe integer`),n<r&&(e>=t&&l("getRandomInt",`No integer value found between ${t} and ${e}`),l("getRandomInt",`The maximum value ${e} should be greater than the minimum value ${t}`))}function Pe(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((t,e)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,e+1);return Number(r)})}q.default.extend(Jt.default);function wt(t={}){let{start:e="1800-01-01 00:00:00",end:r=(0,q.default)().format("YYYY-MM-DD HH:mm:ss"),format:n="YYYY-MM-DD HH:mm:ss"}=t;(!(0,q.default)(e).isValid()||!(0,q.default)(r).isValid())&&l("generateRandomDate","start and end parameters must be valid date format");let i=(0,q.default)(e).year(),x=(0,q.default)(r).year(),p=I({min:i,max:x}),M=I({min:1,max:12}),h=I({min:1,max:31}),R=I(23),C=I(59),Y=I(59),v=(0,q.default)(`${p}-${M}-${h} ${R}:${C}:${Y}`);return v.isBefore((0,q.default)(e))||v.isAfter((0,q.default)(r))?wt(t):v.format(n)}function Q(t={}){let e=Ie(t),r=Ce(e);_e(r);let{length:n}=e;Le(n.min,n.max);let i=I(n),x=e.prefix||"";for(let p=0;p<i;p++)x+=r.charAt(Math.floor(Math.random()*r.length));return x+(e.suffix||"")}var Ne=16,Ht=1;function Ie(t){let e=V(t);return{lowerCase:!0,upperCase:!0,number:!0,...e?{}:t,length:e?{max:t,min:t}:V(t.length)?{max:t.length,min:t.length}:{max:Ne,min:Ht,...t.length},extra:e?[]:[...new Set(st(t.extra||[]))]}}function Ce(t){let e="";return t.lowerCase&&(e+="abcdefghijklmnopqrstuvwxyz"),t.upperCase&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.number&&(e+="0123456789"),e+=st(t.extra).join(""),e}function _e(t){t.length===0&&l("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function Le(t,e){Number.isInteger(t)||l("getRandomString","min must be an integer"),Number.isInteger(e)||l("getRandomString","max must be an integer"),t<Ht&&l("getRandomString",`Minimum length cannot be less than ${Ht}`),e<t&&l("getRandomString","Maximum length cannot be less than minimum length")}function te(){let t=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],e=`${Q(1)}${Q({length:I({max:30,min:1})})}${Q(1)}@${Z(t)}`;return/\.{2,}/.test(e)?te():e}function Fe(t={}){V(t)&&(t={max:t});let{min:e=0,max:r=1,fractionDigits:n=2}=t;if(e===r)return e;if(e>r)throw new Error(`Maximum value ${r} should be greater than minimum value ${e}`);return Math.random()*(r-e)+e}function Mt(t,e){(!V(t)||t<=0)&&l("generateRandomStringFromSource","num must be greater than 0"),(!H(e)||e.length===0)&&l("generateRandomStringFromSource","source cannot be empty array");let r="";for(let n=0;n<t;n++)r+=Z(e);return r}function He(){let t=I({min:1e5,max:999999}),e=[0,1,2,3,4,5,6,7,8,9];return[t,wt({format:"YYYYMMDD"}),Mt(3,e),Mt(1,[...e,"X","x"])].join("")}function Ke(){return Z(["13","14","15","16","17","18","19"])+I(999999999).toString().padEnd(9,"0")}function Ue(){let t=["http://","https://"],e=[".com",".net",".org",".cn",".top"],r=[`?name=${Q({length:{min:4,max:8}})}`,`?id=${I()}`,`?page=${Q({length:{min:2,max:4}})}`,`?query=${Q({length:{min:5,max:6}})}`,`?search=${Q({length:{min:1,max:4}})}`,`?token=${Q({length:{min:16,max:16}})}`];return`${Z(t)}${Q({length:{min:5,max:25}})}${Z(e)}${Z(r)}`}function We(t){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(t)}function Ve(t){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function ze(t){return/^(?:0|[1-9]\d*)\.\d+$/.test(t)}function Be(t){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function Ze(t){return/^-(?:0|[1-9]\d*)\.\d+$/.test(t)}function Ge(t){return/^-?(?:0|[1-9]\d*)$/.test(t)}function Qe(t){return/^[1-9]\d*$/.test(t)}function Xe(t){return/^(?:0|[1-9]\d*)$/.test(t)&&!Object.is(t,-0)}function qe(t){return/^-[1-9]\d*$/.test(t)}function Je(t){return/^-(?:0|[1-9]\d*)$/.test(t)||Object.is(t,-0)}var ee=gt($t(),1);function Kt(t,e="YYYY-MM-DD HH:mm:ss"){return(0,ee.default)(t,e,!0).isValid()}function tr(t){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t)}function er(t){return t===""}var Ut=gt($t(),1);function rr(t){if(!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/i.test(t))return!1;let r=t.slice(6,14);return Kt(r,"YYYYMMDD")&&(0,Ut.default)(r,"YYYYMMDD").isBefore((0,Ut.default)())}function nr(t){return/^1[3-9]\d{9}$/.test(t)}var or=t=>{if(!rt(t)||!/^-?\d+(?:\.\d+)?$/.test(t))return!1;let r=Number(t);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};function ir(t){return/^https?:\/\/\S+$/i.test(t)}return fe(sr);})();
|
|
1
|
+
"use strict";var lntvowUtils=(()=>{var ee=Object.create;var pt=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty;var Ut=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),se=(t,e)=>{for(var r in e)pt(t,r,{get:e[r],enumerable:!0})},Wt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ne(e))!ie.call(t,i)&&i!==r&&pt(t,i,{get:()=>e[i],enumerable:!(n=re(e,i))||n.enumerable});return t};var gt=(t,e,r)=>(r=t!=null?ee(oe(t)):{},Wt(e||!t||!t.__esModule?pt(r,"default",{value:t,enumerable:!0}):r,t)),ae=t=>Wt(pt({},"__esModule",{value:!0}),t);var xt=Ut((It,_t)=>{"use strict";(function(t,e){typeof It=="object"&&typeof _t<"u"?_t.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(It,function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",x="minute",p="hour",M="day",h="week",R="month",_="quarter",Y="year",v="date",N="Invalid Date",c=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,O={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(u){var s=["th","st","nd","rd"],o=u%100;return"["+u+(s[(o-20)%10]||s[o]||s[0])+"]"}},D=function(u,s,o){var f=String(u);return!f||f.length>=s?u:""+Array(s+1-f.length).join(o)+u},$={s:D,z:function(u){var s=-u.utcOffset(),o=Math.abs(s),f=Math.floor(o/60),a=o%60;return(s<=0?"+":"-")+D(f,2,"0")+":"+D(a,2,"0")},m:function u(s,o){if(s.date()<o.date())return-u(o,s);var f=12*(o.year()-s.year())+(o.month()-s.month()),a=s.clone().add(f,R),m=o-a<0,l=s.clone().add(f+(m?-1:1),R);return+(-(f+(o-a)/(m?a-l:l-a))||0)},a:function(u){return u<0?Math.ceil(u)||0:Math.floor(u)},p:function(u){return{M:R,y:Y,w:h,d:M,D:v,h:p,m:x,s:i,ms:n,Q:_}[u]||String(u||"").toLowerCase().replace(/s$/,"")},u:function(u){return u===void 0}},w="en",j={};j[w]=O;var C="$isDayjsObject",E=function(u){return u instanceof F||!(!u||!u[C])},K=function u(s,o,f){var a;if(!s)return w;if(typeof s=="string"){var m=s.toLowerCase();j[m]&&(a=m),o&&(j[m]=o,a=m);var l=s.split("-");if(!a&&l.length>1)return u(l[0])}else{var g=s.name;j[g]=s,a=g}return!f&&a&&(w=a),a||!f&&w},S=function(u,s){if(E(u))return u.clone();var o=typeof s=="object"?s:{};return o.date=u,o.args=arguments,new F(o)},y=$;y.l=K,y.i=E,y.w=function(u,s){return S(u,{locale:s.$L,utc:s.$u,x:s.$x,$offset:s.$offset})};var F=function(){function u(o){this.$L=K(o.locale,null,!0),this.parse(o),this.$x=this.$x||o.x||{},this[C]=!0}var s=u.prototype;return s.parse=function(o){this.$d=function(f){var a=f.date,m=f.utc;if(a===null)return new Date(NaN);if(y.u(a))return new Date;if(a instanceof Date)return new Date(a);if(typeof a=="string"&&!/Z$/i.test(a)){var l=a.match(c);if(l){var g=l[2]-1||0,A=(l[7]||"0").substring(0,3);return m?new Date(Date.UTC(l[1],g,l[3]||1,l[4]||0,l[5]||0,l[6]||0,A)):new Date(l[1],g,l[3]||1,l[4]||0,l[5]||0,l[6]||0,A)}}return new Date(a)}(o),this.init()},s.init=function(){var o=this.$d;this.$y=o.getFullYear(),this.$M=o.getMonth(),this.$D=o.getDate(),this.$W=o.getDay(),this.$H=o.getHours(),this.$m=o.getMinutes(),this.$s=o.getSeconds(),this.$ms=o.getMilliseconds()},s.$utils=function(){return y},s.isValid=function(){return this.$d.toString()!==N},s.isSame=function(o,f){var a=S(o);return this.startOf(f)<=a&&a<=this.endOf(f)},s.isAfter=function(o,f){return S(o)<this.startOf(f)},s.isBefore=function(o,f){return this.endOf(f)<S(o)},s.$g=function(o,f,a){return y.u(o)?this[f]:this.set(a,o)},s.unix=function(){return Math.floor(this.valueOf()/1e3)},s.valueOf=function(){return this.$d.getTime()},s.startOf=function(o,f){var a=this,m=!!y.u(f)||f,l=y.p(o),g=function(X,L){var G=y.w(a.$u?Date.UTC(a.$y,L,X):new Date(a.$y,L,X),a);return m?G:G.endOf(M)},A=function(X,L){return y.w(a.toDate()[X].apply(a.toDate("s"),(m?[0,0,0,0]:[23,59,59,999]).slice(L)),a)},T=this.$W,P=this.$M,W=this.$D,nt="set"+(this.$u?"UTC":"");switch(l){case Y:return m?g(1,0):g(31,11);case R:return m?g(1,P):g(0,P+1);case h:var J=this.$locale().weekStart||0,at=(T<J?T+7:T)-J;return g(m?W-at:W+(6-at),P);case M:case v:return A(nt+"Hours",0);case p:return A(nt+"Minutes",1);case x:return A(nt+"Seconds",2);case i:return A(nt+"Milliseconds",3);default:return this.clone()}},s.endOf=function(o){return this.startOf(o,!1)},s.$set=function(o,f){var a,m=y.p(o),l="set"+(this.$u?"UTC":""),g=(a={},a[M]=l+"Date",a[v]=l+"Date",a[R]=l+"Month",a[Y]=l+"FullYear",a[p]=l+"Hours",a[x]=l+"Minutes",a[i]=l+"Seconds",a[n]=l+"Milliseconds",a)[m],A=m===M?this.$D+(f-this.$W):f;if(m===R||m===Y){var T=this.clone().set(v,1);T.$d[g](A),T.init(),this.$d=T.set(v,Math.min(this.$D,T.daysInMonth())).$d}else g&&this.$d[g](A);return this.init(),this},s.set=function(o,f){return this.clone().$set(o,f)},s.get=function(o){return this[y.p(o)]()},s.add=function(o,f){var a,m=this;o=Number(o);var l=y.p(f),g=function(P){var W=S(m);return y.w(W.date(W.date()+Math.round(P*o)),m)};if(l===R)return this.set(R,this.$M+o);if(l===Y)return this.set(Y,this.$y+o);if(l===M)return g(1);if(l===h)return g(7);var A=(a={},a[x]=e,a[p]=r,a[i]=t,a)[l]||1,T=this.$d.getTime()+o*A;return y.w(T,this)},s.subtract=function(o,f){return this.add(-1*o,f)},s.format=function(o){var f=this,a=this.$locale();if(!this.isValid())return a.invalidDate||N;var m=o||"YYYY-MM-DDTHH:mm:ssZ",l=y.z(this),g=this.$H,A=this.$m,T=this.$M,P=a.weekdays,W=a.months,nt=a.meridiem,J=function(L,G,tt,ot){return L&&(L[G]||L(f,m))||tt[G].slice(0,ot)},at=function(L){return y.s(g%12||12,L,"0")},X=nt||function(L,G,tt){var ot=L<12?"AM":"PM";return tt?ot.toLowerCase():ot};return m.replace(b,function(L,G){return G||function(tt){switch(tt){case"YY":return String(f.$y).slice(-2);case"YYYY":return y.s(f.$y,4,"0");case"M":return T+1;case"MM":return y.s(T+1,2,"0");case"MMM":return J(a.monthsShort,T,W,3);case"MMMM":return J(W,T);case"D":return f.$D;case"DD":return y.s(f.$D,2,"0");case"d":return String(f.$W);case"dd":return J(a.weekdaysMin,f.$W,P,2);case"ddd":return J(a.weekdaysShort,f.$W,P,3);case"dddd":return P[f.$W];case"H":return String(g);case"HH":return y.s(g,2,"0");case"h":return at(1);case"hh":return at(2);case"a":return X(g,A,!0);case"A":return X(g,A,!1);case"m":return String(A);case"mm":return y.s(A,2,"0");case"s":return String(f.$s);case"ss":return y.s(f.$s,2,"0");case"SSS":return y.s(f.$ms,3,"0");case"Z":return l}return null}(L)||l.replace(":","")})},s.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},s.diff=function(o,f,a){var m,l=this,g=y.p(f),A=S(o),T=(A.utcOffset()-this.utcOffset())*e,P=this-A,W=function(){return y.m(l,A)};switch(g){case Y:m=W()/12;break;case R:m=W();break;case _:m=W()/3;break;case h:m=(P-T)/6048e5;break;case M:m=(P-T)/864e5;break;case p:m=P/r;break;case x:m=P/e;break;case i:m=P/t;break;default:m=P}return a?m:y.a(m)},s.daysInMonth=function(){return this.endOf(R).$D},s.$locale=function(){return j[this.$L]},s.locale=function(o,f){if(!o)return this.$L;var a=this.clone(),m=K(o,f,!0);return m&&(a.$L=m),a},s.clone=function(){return y.w(this.$d,this)},s.toDate=function(){return new Date(this.valueOf())},s.toJSON=function(){return this.isValid()?this.toISOString():null},s.toISOString=function(){return this.$d.toISOString()},s.toString=function(){return this.$d.toUTCString()},u}(),U=F.prototype;return S.prototype=U,[["$ms",n],["$s",i],["$m",x],["$H",p],["$W",M],["$M",R],["$y",Y],["$D",v]].forEach(function(u){U[u[1]]=function(s){return this.$g(s,u[0],u[1])}}),S.extend=function(u,s){return u.$i||(u(s,F,S),u.$i=!0),S},S.locale=K,S.isDayjs=E,S.unix=function(u){return S(1e3*u)},S.en=j[w],S.Ls=j,S.p={},S})});var qt=Ut((Ft,Ht)=>{"use strict";(function(t,e){typeof Ft=="object"&&typeof Ht<"u"?Ht.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_customParseFormat=e()})(Ft,function(){"use strict";var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,i=/\d\d?/,x=/\d*[^-_:/,()\s\d]+/,p={},M=function(c){return(c=+c)+(c>68?1900:2e3)},h=function(c){return function(b){this[c]=+b}},R=[/[+-]\d\d:?(\d\d)?|Z/,function(c){(this.zone||(this.zone={})).offset=function(b){if(!b||b==="Z")return 0;var O=b.match(/([+-]|\d\d)/g),D=60*O[1]+(+O[2]||0);return D===0?0:O[0]==="+"?-D:D}(c)}],_=function(c){var b=p[c];return b&&(b.indexOf?b:b.s.concat(b.f))},Y=function(c,b){var O,D=p.meridiem;if(D){for(var $=1;$<=24;$+=1)if(c.indexOf(D($,0,b))>-1){O=$>12;break}}else O=c===(b?"pm":"PM");return O},v={A:[x,function(c){this.afternoon=Y(c,!1)}],a:[x,function(c){this.afternoon=Y(c,!0)}],Q:[r,function(c){this.month=3*(c-1)+1}],S:[r,function(c){this.milliseconds=100*+c}],SS:[n,function(c){this.milliseconds=10*+c}],SSS:[/\d{3}/,function(c){this.milliseconds=+c}],s:[i,h("seconds")],ss:[i,h("seconds")],m:[i,h("minutes")],mm:[i,h("minutes")],H:[i,h("hours")],h:[i,h("hours")],HH:[i,h("hours")],hh:[i,h("hours")],D:[i,h("day")],DD:[n,h("day")],Do:[x,function(c){var b=p.ordinal,O=c.match(/\d+/);if(this.day=O[0],b)for(var D=1;D<=31;D+=1)b(D).replace(/\[|\]/g,"")===c&&(this.day=D)}],w:[i,h("week")],ww:[n,h("week")],M:[i,h("month")],MM:[n,h("month")],MMM:[x,function(c){var b=_("months"),O=(_("monthsShort")||b.map(function(D){return D.slice(0,3)})).indexOf(c)+1;if(O<1)throw new Error;this.month=O%12||O}],MMMM:[x,function(c){var b=_("months").indexOf(c)+1;if(b<1)throw new Error;this.month=b%12||b}],Y:[/[+-]?\d+/,h("year")],YY:[n,function(c){this.year=M(c)}],YYYY:[/\d{4}/,h("year")],Z:R,ZZ:R};function N(c){var b,O;b=c,O=p&&p.formats;for(var D=(c=b.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(S,y,F){var U=F&&F.toUpperCase();return y||O[F]||t[F]||O[U].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(u,s,o){return s||o.slice(1)})})).match(e),$=D.length,w=0;w<$;w+=1){var j=D[w],C=v[j],E=C&&C[0],K=C&&C[1];D[w]=K?{regex:E,parser:K}:j.replace(/^\[|\]$/g,"")}return function(S){for(var y={},F=0,U=0;F<$;F+=1){var u=D[F];if(typeof u=="string")U+=u.length;else{var s=u.regex,o=u.parser,f=S.slice(U),a=s.exec(f)[0];o.call(y,a),S=S.replace(a,"")}}return function(m){var l=m.afternoon;if(l!==void 0){var g=m.hours;l?g<12&&(m.hours+=12):g===12&&(m.hours=0),delete m.afternoon}}(y),y}}return function(c,b,O){O.p.customParseFormat=!0,c&&c.parseTwoDigitYear&&(M=c.parseTwoDigitYear);var D=b.prototype,$=D.parse;D.parse=function(w){var j=w.date,C=w.utc,E=w.args;this.$u=C;var K=E[1];if(typeof K=="string"){var S=E[2]===!0,y=E[3]===!0,F=S||y,U=E[2];y&&(U=E[2]),p=this.$locale(),!S&&U&&(p=O.Ls[U]),this.$d=function(f,a,m,l){try{if(["x","X"].indexOf(a)>-1)return new Date((a==="X"?1e3:1)*f);var g=N(a)(f),A=g.year,T=g.month,P=g.day,W=g.hours,nt=g.minutes,J=g.seconds,at=g.milliseconds,X=g.zone,L=g.week,G=new Date,tt=P||(A||T?1:G.getDate()),ot=A||G.getFullYear(),lt=0;A&&!T||(lt=T>0?T-1:G.getMonth());var dt,Mt=W||0,Ot=nt||0,Dt=J||0,St=at||0;return X?new Date(Date.UTC(ot,lt,tt,Mt,Ot,Dt,St+60*X.offset*1e3)):m?new Date(Date.UTC(ot,lt,tt,Mt,Ot,Dt,St)):(dt=new Date(ot,lt,tt,Mt,Ot,Dt,St),L&&(dt=l(dt).week(L).toDate()),dt)}catch{return new Date("")}}(j,K,C,O),this.init(),U&&U!==!0&&(this.$L=this.locale(U).$L),F&&j!=this.format(K)&&(this.$d=new Date("")),p={}}else if(K instanceof Array)for(var u=K.length,s=1;s<=u;s+=1){E[1]=K[s-1];var o=O.apply(this,E);if(o.isValid()){this.$d=o.$d,this.$L=o.$L,this.init();break}s===u&&(this.$d=new Date(""))}else $.call(this,w)}}})});var nr={};se(nr,{UtilsError:()=>mt,base64Decode:()=>de,base64Encode:()=>le,castArray:()=>st,compose:()=>pe,composeRight:()=>ge,debounce:()=>he,debugWarn:()=>$e,decimalToBinary:()=>me,deepClone:()=>ft,deepMerge:()=>ye,generateRandomArray:()=>We,generateRandomColor:()=>ze,generateRandomDate:()=>$t,generateRandomEmail:()=>te,generateRandomFloat:()=>Je,generateRandomIdCard:()=>tr,generateRandomMobilePhone:()=>er,generateRandomStringFromSource:()=>wt,getRandomInt:()=>I,getRandomItem:()=>Z,getRandomString:()=>Q,getRandomUrl:()=>rr,hasChanged:()=>ce,hasCircularReference:()=>Yt,isArray:()=>H,isBoolean:()=>B,isDate:()=>jt,isDateString:()=>Ct,isDef:()=>ue,isEmail:()=>Ce,isEmptyString:()=>Le,isFloat:()=>je,isFunction:()=>ct,isIdCard:()=>Fe,isInteger:()=>Ne,isMap:()=>Tt,isMobilePhone:()=>He,isNegativeFloat:()=>ke,isNegativeInteger:()=>Ie,isNil:()=>kt,isNonNegativeFloat:()=>ve,isNonNegativeInteger:()=>Pt,isNonPositiveFloat:()=>Ye,isNonPositiveInteger:()=>_e,isNull:()=>ht,isNumber:()=>z,isObject:()=>et,isObjectLike:()=>ut,isPlainObject:()=>V,isPositiveFloat:()=>Ee,isPositiveInteger:()=>Pe,isPromise:()=>vt,isRegExp:()=>Et,isSet:()=>Rt,isString:()=>rt,isStringNumber:()=>Ke,isSymbol:()=>At,isURL:()=>Ue,isUndef:()=>k,objectToString:()=>zt,omit:()=>Re,pick:()=>Nt,qs:()=>Gt,qsStringify:()=>we,throttle:()=>Oe,throwError:()=>d,toTypeString:()=>it,toTypeValue:()=>fe,withRetry:()=>De});function et(t){let e=typeof t;return t!==null&&(e==="object"||e==="function")}function ut(t){return t!==null&&typeof t=="object"}var zt=Object.prototype.toString,it=t=>zt.call(t),fe=t=>it(t).slice(8,-1),rt=t=>typeof t=="string",z=t=>typeof t=="number"&&Number.isFinite(t),B=t=>typeof t=="boolean",ht=t=>t===null,k=t=>t===void 0,At=t=>typeof t=="symbol",H=Array.isArray,ct=t=>typeof t=="function",Tt=t=>it(t)==="[object Map]",Rt=t=>it(t)==="[object Set]",jt=t=>it(t)==="[object Date]",Et=t=>it(t)==="[object RegExp]",vt=t=>ut(t)&&ct(t?.then)&&ct(t?.catch),kt=t=>t==null,ue=t=>t!=null,ce=(t,e)=>t!==e;function V(t){return it(t)==="[object Object]"}function st(t){return H(t)?t:[t]}function me(t){let e=[],r,n="";for(;t>0;)r=Math.floor(t%2),e.push(r),t=Math.floor(t/2);for(;e.length>0;)n+=e.pop().toString();return n}var Bt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function le(t){let e="",r="";for(let i=0;i<t.length;i++)r+=t[i].charCodeAt(0).toString(2).padStart(8,"0");for(let i=0;i<r.length;i+=6)e+=Bt[Number.parseInt(r.slice(i,i+6).padEnd(6,"0"),2)];let n=e.length%4;return n!==0&&(e+="=".repeat(4-n)),e}function de(t){let e="",r="";for(let n=0;n<t.length&&t[n]!=="=";n++)r+=Bt.indexOf(t[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let i=Number.parseInt(r.slice(n,n+8),2);i&&(e+=String.fromCharCode(i))}return e}function pe(...t){return t.reduce((e,r)=>function(...n){return r(e(...n))})}function ge(...t){return t.reduce((e,r)=>function(...n){return e(r(...n))})}function he(t,e=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{t.apply(this,n)},e)}}function ft(t){let e=new WeakMap;function r(n){if(!ut(n))return n;if(jt(n))return new Date(n);if(Et(n))return new RegExp(n);if(vt(n))return n;if(e.has(n))return e.get(n);if(Tt(n)){let p=new Map;return e.set(n,p),n.forEach((M,h)=>p.set(r(h),r(M))),p}if(Rt(n)){let p=new Set;return e.set(n,p),n.forEach(M=>p.add(r(M))),p}let i=H(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));e.set(n,i);let x=Object.getOwnPropertyDescriptors(n);for(let p of Reflect.ownKeys(x)){let M=x[p];M.get||M.set?Object.defineProperty(i,p,M):Object.defineProperty(i,p,{...M,value:r(M.value)})}return i}return r(t)}function ye(t,e,r={}){return Zt(Vt(t,r),Vt(e,r),r)}function Zt(t,e,r){return H(t)?xe(t,e,r):be(t,e,r)}function be(t,e,r){if(!V(e))return e;let n=Object.getOwnPropertyDescriptors(e);return Reflect.ownKeys(e).forEach(i=>{(V(t[i])||H(t[i]))&&(V(e[i])||H(e[i]))?t[i]=Zt(t[i],e[i],r):Object.defineProperty(t,i,n[i])}),t}function xe(t,e,r){let{mergeStrategy:n="replace"}=r;if(H(e))switch(n){case"merge":return t.concat(e);case"replace":return e;default:return e}return e}function Vt(t,e){let{deepClone:r=!0}=e;return r?ft(t):t}var mt=class extends Error{constructor(e,r="Utils"){super(e),this.name=r}};function d(t,e){throw new mt(`[${t}] ${e}`)}function $e(t,e){let r=rt(t)?new mt(`[${t}] ${e}`,"UtilsWarn"):t;console.warn(r)}var yt=(t,e,...r)=>{if(!e)return;let n=r.length===0?"":r.length===1?r[0]:r;console[t](`[Log] ${e}:`,n)},bt=(t,...e)=>{yt("info",t,...e)};bt.info=(t,...e)=>{yt("info",t,...e)};bt.error=(t,...e)=>{yt("error",t,...e)};bt.warn=(t,...e)=>{yt("warn",t,...e)};typeof globalThis<"u"&&(globalThis.log=bt);function we(t,e={}){Me(e);let{encode:r=!0,encodeValuesOnly:n=!1,arrayFormat:i="indices",encodeDotInKeys:x=!1,skipNulls:p=!1,strictNullHandling:M=!1,commaRoundTrip:h=!1,allowEmptyArrays:R=!1,addQueryPrefix:_=!1,delimiter:Y="&"}=e,v=e.allowDots??!1;x&&k(e.allowDots)&&(v=!0);let N=[],c=$=>r&&!n?encodeURIComponent($):$,b=$=>r?encodeURIComponent($):$;function O($,w){if(!k(w)){if(ht(w)){if(p)return;N.push(`${c($)}${M?"":"="}`);return}if(H(w)){if(w.length===0){R&&N.push(`${c($)}[]`);return}if(i==="comma"){let j=n?w.map(b).join(","):b(w.join(","));if(w.length===1&&ht(w[0])){if(p)return;N.push(`${c($)}${h?"[]":""}${M?"":"="}`)}else w.length===1?N.push(`${c($)}${h?"[]":""}=${j}`):N.push(`${c($)}=${j}`);return}w.forEach((j,C)=>{let E=$;i==="indices"?E=`${$}[${C}]`:i==="brackets"&&(E=`${$}[]`),O(E,j)});return}if(et(w)){Object.keys(w).forEach(j=>{let C=$;x&&(C=C.replace(/\./g,"%2E"));let E=j;v?(x&&(E=E.replace(/\./g,"%2E")),O(`${C}.${E}`,w[j])):O(`${C}[${E}]`,w[j])});return}N.push(`${c($)}=${b(w)}`)}}if(!et(t))return"";Yt(t)&&d("stringify","Input object contains circular references, cannot stringify"),H(t)?t.forEach(($,w)=>O(`${w}`,$)):Object.keys(t).forEach($=>O($,t[$]));let D=N.join(Y);return _&&D?`?${D}`:D}function Me(t={}){V(t)||d("stringify",'"options" must be a plain object'),!k(t.encode)&&!B(t.encode)&&d("stringify",'"encode" must be a boolean'),!k(t.encodeValuesOnly)&&!B(t.encodeValuesOnly)&&d("stringify",'"encodeValuesOnly" must be a boolean'),!k(t.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(t.arrayFormat)&&d("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!k(t.allowDots)&&!B(t.allowDots)&&d("stringify",'"allowDots" must be a boolean'),!k(t.skipNulls)&&!B(t.skipNulls)&&d("stringify",'"skipNulls" must be a boolean'),!k(t.strictNullHandling)&&!B(t.strictNullHandling)&&d("stringify",'"strictNullHandling" must be a boolean'),!k(t.addQueryPrefix)&&!B(t.addQueryPrefix)&&d("stringify",'"addQueryPrefix" must be a boolean'),!k(t.delimiter)&&!rt(t.delimiter)&&d("stringify",'"delimiter" must be a string'),!k(t.encodeDotInKeys)&&!B(t.encodeDotInKeys)&&d("stringify",'"encodeDotInKeys" must be a boolean'),!k(t.commaRoundTrip)&&!B(t.commaRoundTrip)&&d("stringify",'"commaRoundTrip" must be a boolean'),!k(t.allowEmptyArrays)&&!B(t.allowEmptyArrays)&&d("stringify",'"allowEmptyArrays" must be a boolean')}var Gt={stringify:t=>(et(t)||d("stringify","Input must be an object"),new URLSearchParams(t).toString()),parse:t=>(rt(t)||d("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(t).entries())),appendQueryString:(t,e)=>{let r=Gt.stringify(e);return t.includes("?")?t.endsWith("?")||t.endsWith("&")?`${t}${r}`:`${t}&${r}`:`${t}?${r}`}};function Oe(t,e=500){let r=null;return function(...n){if(kt(r))return r=Date.now(),t.apply(this,n);let i=Date.now();if(i-r>=e)return r=i,t.apply(this,n)}}function De(t){Se(t);let{fn:e,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:i=!1,signal:x}=t,p,M=x?new Promise((R,_)=>{let Y=()=>_(Qt());x.addEventListener("abort",Y),p=()=>x.removeEventListener("abort",Y)}):null;return new Promise((R,_)=>{(async()=>{for(let v=1;v<=r;v++){if(x?.aborted)return _(Qt());try{let N=await Promise.race(M?[e(),M]:[e()]);return R(N)}catch(N){let c=i?n*2**(v-1):n;if(log("withRetry",`Attempt ${v}/${r} failed. Retrying in ${c}ms...`),N instanceof Error&&N.name==="AbortError"||v===r)return _(N);await new Promise(b=>setTimeout(b,c))}}})()}).finally(()=>p?.())}function Se(t){V(t)||d("withRetry",'"Options" must be an object'),typeof t.fn!="function"&&d("withRetry",'"fn" must be a function that returns a Promise'),!k(t.maxAttempts)&&(!Number.isInteger(t.maxAttempts)||t.maxAttempts<1)&&d("withRetry",'"maxAttempts" must be a positive integer'),!k(t.retryDelay)&&(!z(t.retryDelay)||t.retryDelay<0)&&d("withRetry",'"retryDelay" must be a non-negative number'),!k(t.enableExponentialBackoff)&&!B(t.enableExponentialBackoff)&&d("withRetry",'"enableExponentialBackoff" must be a boolean'),!k(t.signal)&&typeof t.signal!="object"&&d("withRetry",'"signal" must be an AbortSignal')}var Ae="The operation was aborted";function Qt(t=Ae){let e=new Error(t);return e.name="AbortError",e}function Yt(t){et(t)||d("hasCircularReference",'"obj" must be a object');let e=new Set;function r(n){if(et(n)){if(e.has(n))return!0;e.add(n);for(let i of Object.keys(n))if(r(n[i]))return!0;e.delete(n)}return!1}return r(t)}function Nt(t,e,r={}){let{includeProto:n=!1,includeSymbols:i=!0,includeNonEnum:x=!1}=r,p={};return V(t)&&st(e).forEach(h=>{At(h)&&!i||!(n?h in t:Object.hasOwn(t,h))||!x&&(n?Te(t,h):Object.getOwnPropertyDescriptor(t,h))?.enumerable===!1||(p[h]=ft(t[h]))}),p}function Te(t,e){let r=t;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function Re(t,e){if(!V(t))return{};let r=ft(t),n=st(e),i=Object.keys(r).filter(x=>!n.includes(x));return Nt(r,i)}function je(t){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(t)}function Ee(t){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function ve(t){return/^(?:0|[1-9]\d*)\.\d+$/.test(t)}function ke(t){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function Ye(t){return/^-(?:0|[1-9]\d*)\.\d+$/.test(t)}function Ne(t){return/^-?(?:0|[1-9]\d*)$/.test(t)}function Pe(t){return/^[1-9]\d*$/.test(t)}function Pt(t){return/^(?:0|[1-9]\d*)$/.test(t)&&!Object.is(t,-0)}function Ie(t){return/^-[1-9]\d*$/.test(t)}function _e(t){return/^-(?:0|[1-9]\d*)$/.test(t)||Object.is(t,-0)}var Xt=gt(xt(),1);function Ct(t,e="YYYY-MM-DD HH:mm:ss"){return(0,Xt.default)(t,e,!0).isValid()}function Ce(t){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t)}function Le(t){return t===""}var Lt=gt(xt(),1);function Fe(t){if(!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/i.test(t))return!1;let r=t.slice(6,14);return Ct(r,"YYYYMMDD")&&(0,Lt.default)(r,"YYYYMMDD").isBefore((0,Lt.default)())}function He(t){return/^1[3-9]\d{9}$/.test(t)}var Ke=t=>{if(!rt(t)||!/^-?\d+(?:\.\d+)?$/.test(t))return!1;let r=Number(t);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};function Ue(t){return/^https?:\/\/\S+$/i.test(t)}function We(t,e){return(!z(t)||!Pt(t.toString()))&&d("generateRandomArray","num must be greater than 0"),ct(e)||d("generateRandomArray","cb must be a function"),Array.from({length:t},()=>e())}function ze(){return`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`}var q=gt(xt(),1),Jt=gt(qt(),1);function Z(t){return t[Math.floor(Math.random()*t.length)]}function I(t={}){z(t)&&(t={max:t});let{min:e=1,max:r=Z(Ve())}=t;Be(e,r);let n=Math.ceil(e),i=Math.floor(r);return Math.floor(Math.random()*(i-n+1)+n)}function Be(t,e){let r=Math.ceil(t),n=Math.floor(e);Number.isSafeInteger(r)||d("getRandomInt",`The minimum value Math.ceil(${t}) should be a safe integer`),Number.isSafeInteger(n)||d("getRandomInt",`The maximum value Math.floor(${e}) should be a safe integer`),n<r&&(e>=t&&d("getRandomInt",`No integer value found between ${t} and ${e}`),d("getRandomInt",`The maximum value ${e} should be greater than the minimum value ${t}`))}function Ve(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((t,e)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,e+1);return Number(r)})}q.default.extend(Jt.default);function $t(t={}){let{start:e="1800-01-01 00:00:00",end:r=(0,q.default)().format("YYYY-MM-DD HH:mm:ss"),format:n="YYYY-MM-DD HH:mm:ss"}=t;(!(0,q.default)(e).isValid()||!(0,q.default)(r).isValid())&&d("generateRandomDate","start and end parameters must be valid date format");let i=(0,q.default)(e).year(),x=(0,q.default)(r).year(),p=I({min:i,max:x}),M=I({min:1,max:12}),h=I({min:1,max:31}),R=I(23),_=I(59),Y=I(59),v=(0,q.default)(`${p}-${M}-${h} ${R}:${_}:${Y}`);return v.isBefore((0,q.default)(e))||v.isAfter((0,q.default)(r))?$t(t):v.format(n)}function Q(t={}){let e=Ge(t),r=Qe(e);Xe(r);let{length:n}=e;qe(n.min,n.max);let i=I(n),x=e.prefix||"";for(let p=0;p<i;p++)x+=r.charAt(Math.floor(Math.random()*r.length));return x+(e.suffix||"")}var Ze=16,Kt=1;function Ge(t){let e=z(t);return{lowerCase:!0,upperCase:!0,number:!0,...e?{}:t,length:e?{max:t,min:t}:z(t.length)?{max:t.length,min:t.length}:{max:Ze,min:Kt,...t.length},extra:e?[]:[...new Set(st(t.extra||[]))]}}function Qe(t){let e="";return t.lowerCase&&(e+="abcdefghijklmnopqrstuvwxyz"),t.upperCase&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.number&&(e+="0123456789"),e+=st(t.extra).join(""),e}function Xe(t){t.length===0&&d("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function qe(t,e){Number.isInteger(t)||d("getRandomString","min must be an integer"),Number.isInteger(e)||d("getRandomString","max must be an integer"),t<Kt&&d("getRandomString",`Minimum length cannot be less than ${Kt}`),e<t&&d("getRandomString","Maximum length cannot be less than minimum length")}function te(){let t=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],e=`${Q(1)}${Q({length:I({max:30,min:1})})}${Q(1)}@${Z(t)}`;return/\.{2,}/.test(e)?te():e}function Je(t={}){z(t)&&(t={max:t});let{min:e=0,max:r=1,fractionDigits:n=2}=t;if(e===r)return e;if(e>r)throw new Error(`Maximum value ${r} should be greater than minimum value ${e}`);let i=Math.random()*(r-e)+e;return Number(i.toFixed(n))}function wt(t,e){(!z(t)||t<=0)&&d("generateRandomStringFromSource","num must be greater than 0"),(!H(e)||e.length===0)&&d("generateRandomStringFromSource","source cannot be empty array");let r="";for(let n=0;n<t;n++)r+=Z(e);return r}function tr(){let t=I({min:1e5,max:999999}),e=[0,1,2,3,4,5,6,7,8,9];return[t,$t({format:"YYYYMMDD"}),wt(3,e),wt(1,[...e,"X","x"])].join("")}function er(){return Z(["13","14","15","16","17","18","19"])+I(999999999).toString().padEnd(9,"0")}function rr(){let t=["http://","https://"],e=[".com",".net",".org",".cn",".top"],r=[`?name=${Q({length:{min:4,max:8}})}`,`?id=${I()}`,`?page=${Q({length:{min:2,max:4}})}`,`?query=${Q({length:{min:5,max:6}})}`,`?search=${Q({length:{min:1,max:4}})}`,`?token=${Q({length:{min:16,max:16}})}`];return`${Z(t)}${Q({length:{min:5,max:25}})}${Z(e)}${Z(r)}`}return ae(nr);})();
|