@lntvow/utils 4.0.22 → 4.0.24
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 nt=Object.create;var A=Object.defineProperty;var rt=Object.getOwnPropertyDescriptor;var ot=Object.getOwnPropertyNames;var it=Object.getPrototypeOf,st=Object.prototype.hasOwnProperty;var at=(t,e)=>{for(var n in e)A(t,n,{get:e[n],enumerable:!0})},H=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ot(e))!st.call(t,o)&&o!==n&&A(t,o,{get:()=>e[o],enumerable:!(r=rt(e,o))||r.enumerable});return t};var D=(t,e,n)=>(n=t!=null?nt(it(t)):{},H(e||!t||!t.__esModule?A(n,"default",{value:t,enumerable:!0}):n,t)),mt=t=>H(A({},"__esModule",{value:!0}),t);var we={};at(we,{base64Decode:()=>bt,base64Encode:()=>xt,castArray:()=>y,compose:()=>yt,composeRight:()=>ht,debounce:()=>Ot,debugWarn:()=>_,debugWarnInvalidTypeMessage:()=>Rt,decimalToBinary:()=>dt,deepClone:()=>O,deepMerge:()=>U,deprecated:()=>jt,error:()=>St,generateRandomArray:()=>Yt,generateRandomColor:()=>Ut,generateRandomDate:()=>T,generateRandomEmail:()=>Q,generateRandomFloat:()=>Gt,generateRandomIdCard:()=>qt,generateRandomMobilePhone:()=>Bt,generateRandomStringFromSource:()=>k,getRandomInt:()=>a,getRandomItem:()=>p,getRandomString:()=>g,getRandomUrl:()=>Vt,hasChanged:()=>lt,isArray:()=>u,isBoolean:()=>pt,isChineseString:()=>ie,isDate:()=>F,isDateString:()=>tt,isDef:()=>gt,isEmail:()=>ye,isEmptyString:()=>he,isEnglishAphabet:()=>Qt,isFloat:()=>se,isFunction:()=>$,isIdCard:()=>Oe,isInteger:()=>fe,isLowerCase:()=>ne,isLowerCaseAndNumber:()=>re,isLowerCaseAndNumberAndChinese:()=>oe,isMap:()=>N,isMobilePhone:()=>xe,isNegativeFloat:()=>ce,isNegativeInteger:()=>le,isNonNegativeFloat:()=>me,isNonNegativeInteger:()=>ge,isNonPositiveFloat:()=>pe,isNonPositiveInteger:()=>de,isNull:()=>ft,isNumber:()=>f,isNumberOrNumberString:()=>Xt,isObject:()=>ct,isObjectLike:()=>w,isPlainObject:()=>x,isPositiveFloat:()=>ae,isPositiveInteger:()=>ue,isPromise:()=>Y,isRegExp:()=>v,isSet:()=>C,isString:()=>I,isSymbol:()=>P,isUndef:()=>h,isUndefined:()=>ut,isUpperCase:()=>Jt,isUpperCaseAndNumber:()=>te,isUpperCaseAndNumberAndChinese:()=>ee,isUrl:()=>be,objectToString:()=>Z,omit:()=>vt,pick:()=>L,qs:()=>Et,throttle:()=>Dt,throwError:()=>s,throwErrorInvalidTypeMessage:()=>Mt,toTypeString:()=>b,toTypeValue:()=>S,validatorChineseOrEnglish:()=>Pt,validatorChineseOrEnglishOrNumber:()=>It,validatorUppercaseOrNumbersOrSpecial:()=>Nt,validatorUppercaseOrNumbersOrUnderline:()=>Ct,warn:()=>At});module.exports=mt(we);function ct(t){let e=typeof t;return t!==null&&(e==="object"||e==="function")}function w(t){return t!==null&&typeof t=="object"}var Z=Object.prototype.toString,b=t=>Z.call(t),S=t=>b(t).slice(8,-1),I=t=>typeof t=="string",f=t=>typeof t=="number"&&Number.isFinite(t),pt=t=>typeof t=="boolean",ft=t=>t===null,ut=t=>t===void 0,P=t=>typeof t=="symbol",u=Array.isArray,$=t=>typeof t=="function",N=t=>b(t)==="[object Map]",C=t=>b(t)==="[object Set]",F=t=>b(t)==="[object Date]",v=t=>b(t)==="[object RegExp]",Y=t=>w(t)&&$(t?.then)&&$(t?.catch),h=t=>t==null,gt=t=>t!=null,lt=(t,e)=>t!==e;function x(t){return b(t)==="[object Object]"}function y(t){return u(t)?t:[t]}function dt(t){let e=[],n,r="";for(;t>0;)n=Math.floor(t%2),e.push(n),t=Math.floor(t/2);for(;e.length>0;)r+=e.pop().toString();return r}var G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function xt(t){let e="",n="";for(let o=0;o<t.length;o++)n+=t[o].charCodeAt(0).toString(2).padStart(8,"0");for(let o=0;o<n.length;o+=6)e+=G[parseInt(n.slice(o,o+6).padEnd(6,"0"),2)];let r=e.length%4;return r!==0&&(e+="=".repeat(4-r)),e}function bt(t){let e="",n="";for(let r=0;r<t.length&&t[r]!=="=";r++)n+=G.indexOf(t[r]).toString(2).padStart(6,"0");for(let r=0;r<n.length;r+=8){let o=parseInt(n.slice(r,r+8),2);o&&(e+=String.fromCharCode(o))}return e}function yt(...t){return t.reduce((e,n)=>function(...r){return n(e(...r))})}function ht(...t){return t.reduce((e,n)=>function(...r){return e(n(...r))})}function Ot(t,e=500){let n=null;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>{t.apply(this,r)},e)}}function O(t){let e=new WeakMap;function n(r){if(!w(r))return r;if(F(r))return new Date(r);if(v(r))return new RegExp(r);if(Y(r))return r;if(e.has(r))return e.get(r);if(N(r)){let i=new Map;return e.set(r,i),r.forEach((c,l)=>i.set(n(l),n(c))),i}if(C(r)){let i=new Set;return e.set(r,i),r.forEach(c=>i.add(n(c))),i}let o=u(r)?Object.setPrototypeOf([],Object.getPrototypeOf(r)):Object.create(Object.getPrototypeOf(r));e.set(r,o);let m=Object.getOwnPropertyDescriptors(r);for(let i of Reflect.ownKeys(m)){let c=m[i];c.get||c.set?Object.defineProperty(o,i,c):Object.defineProperty(o,i,{...c,value:n(c.value)})}return o}return n(t)}function U(t,e,n={}){return B(q(t,n),q(e,n),n)}function B(t,e,n){return u(t)?$t(t,e,n):wt(t,e,n)}function wt(t,e,n){if(!x(e))return e;let r=Object.getOwnPropertyDescriptors(e);return Reflect.ownKeys(e).forEach(o=>{(x(t[o])||u(t[o]))&&(x(e[o])||u(e[o]))?t[o]=B(t[o],e[o],n):Object.defineProperty(t,o,r[o])}),t}function $t(t,e,n){let{mergeStrategy:r="replace"}=n;if(u(e))switch(r){case"merge":return t.concat(e);case"replace":return e;default:return e}return e}function q(t,e){let{deepClone:n=!0}=e;return n?O(t):t}var j=class extends Error{constructor(e,n="Utils"){super(e),this.name=n}};function s(t,e){throw new j(`[${t}] ${e}`)}function _(t,e){let n=I(t)?new j(`[${t}] ${e}`,"UtilsWarn"):t;console.warn(n)}function At(...t){console.warn(...t)}function St(...t){console.error(...t)}var jt=({from:t,replacement:e,version:n,type:r="API"})=>{_(`${r}`,`${t} is about to be deprecated in version ${n}, please use ${e} instead.`)};function Mt(t,e,n,r){let o=`Invalid params: type check failed for params "${e}". Expected ${n}, got ${S(r)} with value ${r}.`;s(t,o)}function Rt(t,e,n,r){let o=`Invalid params: type check failed for params "${e}". Expected ${n}, got ${S(r)} with value ${r}.`;_(t,o)}var M=(t,e,...n)=>{if(!e)return;let r=n.length===0?"":n.length===1?n[0]:n;console[t](`[Log] ${e}:`,r)},R=(t,...e)=>{M("info",t,...e)};R.info=(t,...e)=>{M("info",t,...e)};R.error=(t,...e)=>{M("error",t,...e)};R.warn=(t,...e)=>{M("warn",t,...e)};typeof globalThis<"u"&&(globalThis.log=R);function Tt(t,e){let{decode:n=!0}=e||{},r={};t.startsWith("?")&&(t=t.slice(1)),t.includes("?")&&(t=t.slice(t.indexOf("?")+1));let o=t.split("&").filter(Boolean);for(let m of o){let[i,c]=m.split("=");r[i]=n?decodeURIComponent(c):c}return r}function V(t,e){let{encode:n=!0}=e||{},r=[];for(let o in t){let m=t[o];r.push(`${o}=${n?encodeURIComponent(m):m}`)}return r.join("&")}function kt(t,e,n){let r=U({encode:!0},{...n}),o=V(e,r);return t.includes("?")?t.endsWith("?")||t.endsWith("&")?`${t}${o}`:`${t}&${o}`:`${t}?${o}`}var Et={parse:Tt,stringify:V,appendQueryString:kt};function Dt(t,e=500){let n=null;return function(...r){if(h(n))return n=Date.now(),t.apply(this,r);let o=Date.now();if(o-n>=e)return n=o,t.apply(this,r)}}function It(t){return!h(t)&&/^[\dA-Z\u4E00-\u9FA5]+$/i.test(t)}function Pt(t){return!h(t)&&/^[A-Z\u4E00-\u9FA5]+$/i.test(t)}function Nt(t){return!h(t)&&/^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(t)}function Ct(t){return/^[\dA-Z_]+$/.test(t)}function L(t,e,n={}){let{includeProto:r=!1,includeSymbols:o=!0,includeNonEnum:m=!1}=n,i={};return x(t)&&y(e).forEach(l=>{P(l)&&!o||!(r?l in t:Object.hasOwn(t,l))||!m&&(r?Ft(t,l):Object.getOwnPropertyDescriptor(t,l))?.enumerable===!1||(i[l]=O(t[l]))}),i}function Ft(t,e){let n=t;for(;n!==null;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function vt(t,e){if(!x(t))return{};let n=O(t),r=y(e),o=Object.keys(n).filter(m=>!r.includes(m));return L(n,o)}function Yt(t,e){return(!f(t)||t<=0)&&s("generateRandomArray","num \u5FC5\u987B\u5927\u4E8E0"),$(e)||s("generateRandomArray","cb \u5FC5\u987B\u662F\u51FD\u6570"),Array.from({length:t}).fill(0).map((n,r)=>e(n,r))}function Ut(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}var d=D(require("dayjs"),1),X=D(require("dayjs/plugin/customParseFormat.js"),1);function p(t){return t[Math.floor(Math.random()*t.length)]}function a(t={}){f(t)&&(t={max:t});let{min:e=1,max:n=p(Lt())}=t;_t(e,n);let r=Math.ceil(e),o=Math.floor(n);return Math.floor(Math.random()*(o-r+1)+r)}function _t(t,e){let n=Math.ceil(t),r=Math.floor(e);Number.isSafeInteger(n)||s("getRandomInt",`The minimum value Math.ceil(${t}) should be a safe integer`),Number.isSafeInteger(r)||s("getRandomInt",`The maximum value Math.floor(${e}) should be a safe integer`),r<n&&(e>=t&&s("getRandomInt",`No integer value found between ${t} and ${e}`),s("getRandomInt",`The maximum value ${e} should be greater than the minimum value ${t}`))}function Lt(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((t,e)=>{let n=Number.MAX_SAFE_INTEGER.toString().slice(0,e+1);return Number(n)})}d.default.extend(X.default);function T(t={}){let{start:e="1800-01-01 00:00:00",end:n=(0,d.default)().format("YYYY-MM-DD HH:mm:ss"),format:r="YYYY-MM-DD HH:mm:ss"}=t;(!(0,d.default)(e).isValid()||!(0,d.default)(n).isValid())&&s("generateRandomDate","start end \u53C2\u6570\u5FC5\u987B\u662F\u5408\u6CD5\u7684\u65F6\u95F4\u683C\u5F0F");let o=(0,d.default)(e).year(),m=(0,d.default)(n).year(),i=a({min:o,max:m}),c=a({min:1,max:12}),l=a({min:1,max:31}),z=a(23),W=a(59),et=a(59),E=(0,d.default)(`${i}-${c}-${l} ${z}:${W}:${et}`);return E.isBefore((0,d.default)(e))||E.isAfter((0,d.default)(n))?T(t):E.format(r)}function g(t={}){let e=zt(t),n=Wt(e);Ht(n);let{length:r}=e;Zt(r.min,r.max);let o=a(r),m=e.prefix||"";for(let i=0;i<o;i++)m+=n.charAt(Math.floor(Math.random()*n.length));return m+(e.suffix||"")}var Kt=16,K=1;function zt(t){let e=f(t);return{lowerCase:!0,upperCase:!0,number:!0,...e?{}:t,length:e?{max:t,min:t}:f(t.length)?{max:t.length,min:t.length}:{max:Kt,min:K,...t.length},extra:e?[]:[...new Set(y(t.extra||[]))]}}function Wt(t){let e="";return t.lowerCase&&(e+="abcdefghijklmnopqrstuvwxyz"),t.upperCase&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.number&&(e+="0123456789"),e+=y(t.extra).join(""),e}function Ht(t){t.length===0&&s("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function Zt(t,e){Number.isInteger(t)||s("getRandomString","min must be an integer"),Number.isInteger(e)||s("getRandomString","max must be an integer"),t<K&&s("getRandomString",`Minimum length cannot be less than ${K}`),e<t&&s("getRandomString","Maximum length cannot be less than minimum length")}function Q(){let t=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],e=`${g(1)}${g({length:a({max:30,min:1})})}${g(1)}@${p(t)}`;return/\.{2,}/.test(e)?Q():e}function Gt(t={}){f(t)&&(t={max:t});let{min:e=0,max:n=1,fractionDigits:r=2}=t;if(e===n)return e;if(e>n)throw new Error(`\u6700\u5927\u503C ${n} \u5E94\u5927\u4E8E\u6700\u5C0F\u503C ${e}`);return Math.random()*(n-e)+e}function k(t,e){(!f(t)||t<=0)&&s("generateRandomStringFromSource","num \u5FC5\u987B\u5927\u4E8E0"),(!u(e)||e.length===0)&&s("generateRandomStringFromSource","source \u4E0D\u80FD\u4E3A\u7A7A\u6570\u7EC4");let n="";for(let r=0;r<t;r++)n+=p(e);return n}function qt(){let t=a({min:1e5,max:999999}),e=[0,1,2,3,4,5,6,7,8,9];return[t,T({format:"YYYYMMDD"}),k(3,e),k(1,[...e,"X","x"])].join("")}function Bt(){return p(["13","14","15","16","17","18","19"])+a(999999999).toString().padEnd(9,"0")}function Vt(){let t=["http://","https://"],e=[".com",".net",".org",".cn",".top"],n=[`?name=${g({length:{min:4,max:8}})}`,`?id=${a()}`,`?page=${g({length:{min:2,max:4}})}`,`?query=${g({length:{min:5,max:6}})}`,`?search=${g({length:{min:1,max:4}})}`,`?token=${g({length:{min:16,max:16}})}`];return`${p(t)}${g({length:{min:5,max:25}})}${p(e)}${p(n)}`}function Xt(t){return/^\d+$/.test(t)}function Qt(t){return/^[A-Z]+$/i.test(t)}function Jt(t){return/^[A-Z]+$/.test(t)}function te(t){return/^[\dA-Z]+$/.test(t)}function ee(t){return/^[\dA-Z\u4E00-\u9FA5]+$/.test(t)}function ne(t){return/^[a-z]+$/.test(t)}function re(t){return/^[\da-z]+$/.test(t)}function oe(t){return/^[\da-z\u4E00-\u9FA5]+$/.test(t)}function ie(t){return/^[\u4E00-\u9FA5]+$/.test(t)}function se(t){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(t)}function ae(t){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function me(t){return/^(?:0|[1-9]\d*)\.\d+$/.test(t)}function ce(t){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function pe(t){return/^-(?:0|[1-9]\d*)\.\d+$/.test(t)}function fe(t){return/^-?(?:0|[1-9]\d*)$/.test(t)}function ue(t){return/^[1-9]\d*$/.test(t)}function ge(t){return/^(?:0|[1-9]\d*)$/.test(t)&&!Object.is(t,-0)}function le(t){return/^-[1-9]\d*$/.test(t)}function de(t){return/^-(?:0|[1-9]\d*)$/.test(t)||Object.is(t,-0)}var J=D(require("dayjs"),1);function xe(t){return/^1[3-9]\d{9}$/.test(t)}function be(t){return/^https?:\/\/\S+$/i.test(t)}function ye(t){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t)}function he(t){return t===""}function tt(t,e="YYYY-MM-DD HH:mm:ss"){return(0,J.default)(t,e,!0).isValid()}function Oe(t){return/^[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)&&tt(t.slice(6,14),"YYYYMMDD")}0&&(module.exports={base64Decode,base64Encode,castArray,compose,composeRight,debounce,debugWarn,debugWarnInvalidTypeMessage,decimalToBinary,deepClone,deepMerge,deprecated,error,generateRandomArray,generateRandomColor,generateRandomDate,generateRandomEmail,generateRandomFloat,generateRandomIdCard,generateRandomMobilePhone,generateRandomStringFromSource,getRandomInt,getRandomItem,getRandomString,getRandomUrl,hasChanged,isArray,isBoolean,isChineseString,isDate,isDateString,isDef,isEmail,isEmptyString,isEnglishAphabet,isFloat,isFunction,isIdCard,isInteger,isLowerCase,isLowerCaseAndNumber,isLowerCaseAndNumberAndChinese,isMap,isMobilePhone,isNegativeFloat,isNegativeInteger,isNonNegativeFloat,isNonNegativeInteger,isNonPositiveFloat,isNonPositiveInteger,isNull,isNumber,isNumberOrNumberString,isObject,isObjectLike,isPlainObject,isPositiveFloat,isPositiveInteger,isPromise,isRegExp,isSet,isString,isSymbol,isUndef,isUndefined,isUpperCase,isUpperCaseAndNumber,isUpperCaseAndNumberAndChinese,isUrl,objectToString,omit,pick,qs,throttle,throwError,throwErrorInvalidTypeMessage,toTypeString,toTypeValue,validatorChineseOrEnglish,validatorChineseOrEnglishOrNumber,validatorUppercaseOrNumbersOrSpecial,validatorUppercaseOrNumbersOrUnderline,warn});
|
|
1
|
+
"use strict";var ne=Object.create;var S=Object.defineProperty;var oe=Object.getOwnPropertyDescriptor;var ie=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,ae=Object.prototype.hasOwnProperty;var me=(e,t)=>{for(var r in t)S(e,r,{get:t[r],enumerable:!0})},Z=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ie(t))!ae.call(e,o)&&o!==r&&S(e,o,{get:()=>t[o],enumerable:!(n=oe(t,o))||n.enumerable});return e};var D=(e,t,r)=>(r=e!=null?ne(se(e)):{},Z(t||!e||!e.__esModule?S(r,"default",{value:e,enumerable:!0}):r,e)),ce=e=>Z(S({},"__esModule",{value:!0}),e);var $t={};me($t,{base64Decode:()=>ye,base64Encode:()=>be,castArray:()=>h,compose:()=>he,composeRight:()=>Oe,debounce:()=>we,debugWarn:()=>_,debugWarnInvalidTypeMessage:()=>Me,decimalToBinary:()=>xe,deepClone:()=>w,deepMerge:()=>K,deprecated:()=>Re,error:()=>je,generateRandomArray:()=>Ue,generateRandomColor:()=>Ke,generateRandomDate:()=>k,generateRandomEmail:()=>J,generateRandomFloat:()=>qe,generateRandomIdCard:()=>Be,generateRandomMobilePhone:()=>Ve,generateRandomStringFromSource:()=>E,getRandomInt:()=>m,getRandomItem:()=>f,getRandomString:()=>l,getRandomUrl:()=>Xe,hasChanged:()=>de,isArray:()=>g,isBoolean:()=>fe,isChineseString:()=>st,isDate:()=>v,isDateString:()=>te,isDef:()=>le,isEmail:()=>ht,isEmptyString:()=>Ot,isEnglishAphabet:()=>Je,isFloat:()=>at,isFunction:()=>A,isIdCard:()=>wt,isInteger:()=>ut,isLowerCase:()=>nt,isLowerCaseAndNumber:()=>ot,isLowerCaseAndNumberAndChinese:()=>it,isMap:()=>C,isMobilePhone:()=>bt,isNegativeFloat:()=>pt,isNegativeInteger:()=>dt,isNonNegativeFloat:()=>ct,isNonNegativeInteger:()=>lt,isNonPositiveFloat:()=>ft,isNonPositiveInteger:()=>xt,isNull:()=>ue,isNumber:()=>u,isNumberOrNumberString:()=>Qe,isObject:()=>pe,isObjectLike:()=>$,isPlainObject:()=>b,isPositiveFloat:()=>mt,isPositiveInteger:()=>gt,isPromise:()=>U,isRegExp:()=>Y,isSet:()=>F,isString:()=>I,isSymbol:()=>N,isUndef:()=>O,isUndefined:()=>ge,isUpperCase:()=>et,isUpperCaseAndNumber:()=>tt,isUpperCaseAndNumberAndChinese:()=>rt,isUrl:()=>yt,objectToString:()=>G,omit:()=>Ye,pick:()=>L,qs:()=>Pe,throttle:()=>De,throwError:()=>a,throwErrorInvalidTypeMessage:()=>Te,toTypeString:()=>y,toTypeValue:()=>j,validatorChineseOrEnglish:()=>Ne,validatorChineseOrEnglishOrNumber:()=>Ie,validatorUppercaseOrNumbersOrSpecial:()=>Ce,validatorUppercaseOrNumbersOrUnderline:()=>Fe,warn:()=>Se});module.exports=ce($t);function pe(e){let t=typeof e;return e!==null&&(t==="object"||t==="function")}function $(e){return e!==null&&typeof e=="object"}var G=Object.prototype.toString,y=e=>G.call(e),j=e=>y(e).slice(8,-1),I=e=>typeof e=="string",u=e=>typeof e=="number"&&Number.isFinite(e),fe=e=>typeof e=="boolean",ue=e=>e===null,ge=e=>e===void 0,N=e=>typeof e=="symbol",g=Array.isArray,A=e=>typeof e=="function",C=e=>y(e)==="[object Map]",F=e=>y(e)==="[object Set]",v=e=>y(e)==="[object Date]",Y=e=>y(e)==="[object RegExp]",U=e=>$(e)&&A(e?.then)&&A(e?.catch),O=e=>e==null,le=e=>e!=null,de=(e,t)=>e!==t;function b(e){return y(e)==="[object Object]"}function h(e){return g(e)?e:[e]}function xe(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 q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function be(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+=q[parseInt(r.slice(o,o+6).padEnd(6,"0"),2)];let n=t.length%4;return n!==0&&(t+="=".repeat(4-n)),t}function ye(e){let t="",r="";for(let n=0;n<e.length&&e[n]!=="=";n++)r+=q.indexOf(e[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let o=parseInt(r.slice(n,n+8),2);o&&(t+=String.fromCharCode(o))}return t}function he(...e){return e.reduce((t,r)=>function(...n){return r(t(...n))})}function Oe(...e){return e.reduce((t,r)=>function(...n){return t(r(...n))})}function we(e,t=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}function w(e){let t=new WeakMap;function r(n){if(!$(n))return n;if(v(n))return new Date(n);if(Y(n))return new RegExp(n);if(U(n))return n;if(t.has(n))return t.get(n);if(C(n)){let s=new Map;return t.set(n,s),n.forEach((p,d)=>s.set(r(d),r(p))),s}if(F(n)){let s=new Set;return t.set(n,s),n.forEach(p=>s.add(r(p))),s}let o=g(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));t.set(n,o);let c=Object.getOwnPropertyDescriptors(n);for(let s of Reflect.ownKeys(c)){let p=c[s];p.get||p.set?Object.defineProperty(o,s,p):Object.defineProperty(o,s,{...p,value:r(p.value)})}return o}return r(e)}function K(e,t,r={}){return V(B(e,r),B(t,r),r)}function V(e,t,r){return g(e)?Ae(e,t,r):$e(e,t,r)}function $e(e,t,r){if(!b(t))return t;let n=Object.getOwnPropertyDescriptors(t);return Reflect.ownKeys(t).forEach(o=>{(b(e[o])||g(e[o]))&&(b(t[o])||g(t[o]))?e[o]=V(e[o],t[o],r):Object.defineProperty(e,o,n[o])}),e}function Ae(e,t,r){let{mergeStrategy:n="replace"}=r;if(g(t))switch(n){case"merge":return e.concat(t);case"replace":return t;default:return t}return t}function B(e,t){let{deepClone:r=!0}=t;return r?w(e):e}var R=class extends Error{constructor(t,r="Utils"){super(t),this.name=r}};function a(e,t){throw new R(`[${e}] ${t}`)}function _(e,t){let r=I(e)?new R(`[${e}] ${t}`,"UtilsWarn"):e;console.warn(r)}function Se(...e){console.warn(...e)}function je(...e){console.error(...e)}var Re=({from:e,replacement:t,version:r,type:n="API"})=>{_(`${n}`,`${e} is about to be deprecated in version ${r}, please use ${t} instead.`)};function Te(e,t,r,n){let o=`Invalid params: type check failed for params "${t}". Expected ${r}, got ${j(n)} with value ${n}.`;a(e,o)}function Me(e,t,r,n){let o=`Invalid params: type check failed for params "${t}". Expected ${r}, got ${j(n)} with value ${n}.`;_(e,o)}var T=(e,t,...r)=>{if(!t)return;let n=r.length===0?"":r.length===1?r[0]:r;console[e](`[Log] ${t}:`,n)},M=(e,...t)=>{T("info",e,...t)};M.info=(e,...t)=>{T("info",e,...t)};M.error=(e,...t)=>{T("error",e,...t)};M.warn=(e,...t)=>{T("warn",e,...t)};typeof globalThis<"u"&&(globalThis.log=M);function ke(e,t){let{decode:r=!0}=t||{},n={};e.startsWith("?")&&(e=e.slice(1)),e.includes("?")&&(e=e.slice(e.indexOf("?")+1));let o=e.split("&").filter(Boolean);for(let c of o){let[s,p]=c.split("=");n[s]=r?decodeURIComponent(p):p}return n}function X(e,t){let{encode:r=!0}=t||{},n=[];for(let o in e){let c=e[o];n.push(`${o}=${r?encodeURIComponent(c):c}`)}return n.join("&")}function Ee(e,t,r){let n=K({encode:!0},{...r}),o=X(t,n);return e.includes("?")?e.endsWith("?")||e.endsWith("&")?`${e}${o}`:`${e}&${o}`:`${e}?${o}`}var Pe={parse:ke,stringify:X,appendQueryString:Ee};function De(e,t=500){let r=null;return function(...n){if(O(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 Ie(e){return!O(e)&&/^[\dA-Z\u4E00-\u9FA5]+$/i.test(e)}function Ne(e){return!O(e)&&/^[A-Z\u4E00-\u9FA5]+$/i.test(e)}function Ce(e){return!O(e)&&/^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(e)}function Fe(e){return/^[\dA-Z_]+$/.test(e)}function L(e,t,r={}){let{includeProto:n=!1,includeSymbols:o=!0,includeNonEnum:c=!1}=r,s={};return b(e)&&h(t).forEach(d=>{N(d)&&!o||!(n?d in e:Object.hasOwn(e,d))||!c&&(n?ve(e,d):Object.getOwnPropertyDescriptor(e,d))?.enumerable===!1||(s[d]=w(e[d]))}),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 Ye(e,t){if(!b(e))return{};let r=w(e),n=h(t),o=Object.keys(r).filter(c=>!n.includes(c));return L(r,o)}function Ue(e,t){return(!u(e)||e<=0)&&a("generateRandomArray","num \u5FC5\u987B\u5927\u4E8E0"),A(t)||a("generateRandomArray","cb \u5FC5\u987B\u662F\u51FD\u6570"),Array.from({length:e}).fill(0).map((r,n)=>t(r,n))}function Ke(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}var x=D(require("dayjs"),1),Q=D(require("dayjs/plugin/customParseFormat.js"),1);function f(e){return e[Math.floor(Math.random()*e.length)]}function m(e={}){u(e)&&(e={max:e});let{min:t=1,max:r=f(Le())}=e;_e(t,r);let n=Math.ceil(t),o=Math.floor(r);return Math.floor(Math.random()*(o-n+1)+n)}function _e(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 Le(){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)})}x.default.extend(Q.default);function k(e={}){let{start:t="1800-01-01 00:00:00",end:r=(0,x.default)().format("YYYY-MM-DD HH:mm:ss"),format:n="YYYY-MM-DD HH:mm:ss"}=e;(!(0,x.default)(t).isValid()||!(0,x.default)(r).isValid())&&a("generateRandomDate","start end \u53C2\u6570\u5FC5\u987B\u662F\u5408\u6CD5\u7684\u65F6\u95F4\u683C\u5F0F");let o=(0,x.default)(t).year(),c=(0,x.default)(r).year(),s=m({min:o,max:c}),p=m({min:1,max:12}),d=m({min:1,max:31}),W=m(23),H=m(59),re=m(59),P=(0,x.default)(`${s}-${p}-${d} ${W}:${H}:${re}`);return P.isBefore((0,x.default)(t))||P.isAfter((0,x.default)(r))?k(e):P.format(n)}function l(e={}){let t=We(e),r=He(t);Ze(r);let{length:n}=t;Ge(n.min,n.max);let o=m(n),c=t.prefix||"";for(let s=0;s<o;s++)c+=r.charAt(Math.floor(Math.random()*r.length));return c+(t.suffix||"")}var ze=16,z=1;function We(e){let t=u(e);return{lowerCase:!0,upperCase:!0,number:!0,...t?{}:e,length:t?{max:e,min:e}:u(e.length)?{max:e.length,min:e.length}:{max:ze,min:z,...e.length},extra:t?[]:[...new Set(h(e.extra||[]))]}}function He(e){let t="";return e.lowerCase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.upperCase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.number&&(t+="0123456789"),t+=h(e.extra).join(""),t}function Ze(e){e.length===0&&a("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function Ge(e,t){Number.isInteger(e)||a("getRandomString","min must be an integer"),Number.isInteger(t)||a("getRandomString","max must be an integer"),e<z&&a("getRandomString",`Minimum length cannot be less than ${z}`),t<e&&a("getRandomString","Maximum length cannot be less than minimum length")}function J(){let e=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],t=`${l(1)}${l({length:m({max:30,min:1})})}${l(1)}@${f(e)}`;return/\.{2,}/.test(t)?J():t}function qe(e={}){u(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(`\u6700\u5927\u503C ${r} \u5E94\u5927\u4E8E\u6700\u5C0F\u503C ${t}`);return Math.random()*(r-t)+t}function E(e,t){(!u(e)||e<=0)&&a("generateRandomStringFromSource","num \u5FC5\u987B\u5927\u4E8E0"),(!g(t)||t.length===0)&&a("generateRandomStringFromSource","source \u4E0D\u80FD\u4E3A\u7A7A\u6570\u7EC4");let r="";for(let n=0;n<e;n++)r+=f(t);return r}function Be(){let e=m({min:1e5,max:999999}),t=[0,1,2,3,4,5,6,7,8,9];return[e,k({format:"YYYYMMDD"}),E(3,t),E(1,[...t,"X","x"])].join("")}function Ve(){return f(["13","14","15","16","17","18","19"])+m(999999999).toString().padEnd(9,"0")}function Xe(){let e=["http://","https://"],t=[".com",".net",".org",".cn",".top"],r=[`?name=${l({length:{min:4,max:8}})}`,`?id=${m()}`,`?page=${l({length:{min:2,max:4}})}`,`?query=${l({length:{min:5,max:6}})}`,`?search=${l({length:{min:1,max:4}})}`,`?token=${l({length:{min:16,max:16}})}`];return`${f(e)}${l({length:{min:5,max:25}})}${f(t)}${f(r)}`}function Qe(e){return/^\d+$/.test(e)}function Je(e){return/^[A-Z]+$/i.test(e)}function et(e){return/^[A-Z]+$/.test(e)}function tt(e){return/^[\dA-Z]+$/.test(e)}function rt(e){return/^[\dA-Z\u4E00-\u9FA5]+$/.test(e)}function nt(e){return/^[a-z]+$/.test(e)}function ot(e){return/^[\da-z]+$/.test(e)}function it(e){return/^[\da-z\u4E00-\u9FA5]+$/.test(e)}function st(e){return/^[\u4E00-\u9FA5]+$/.test(e)}function at(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 ct(e){return/^(?:0|[1-9]\d*)\.\d+$/.test(e)}function pt(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 ut(e){return/^-?(?:0|[1-9]\d*)$/.test(e)}function gt(e){return/^[1-9]\d*$/.test(e)}function lt(e){return/^(?:0|[1-9]\d*)$/.test(e)&&!Object.is(e,-0)}function dt(e){return/^-[1-9]\d*$/.test(e)}function xt(e){return/^-(?:0|[1-9]\d*)$/.test(e)||Object.is(e,-0)}var ee=D(require("dayjs"),1);function bt(e){return/^1[3-9]\d{9}$/.test(e)}function yt(e){return/^https?:\/\/\S+$/i.test(e)}function ht(e){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(e)}function Ot(e){return e===""}function te(e,t="YYYY-MM-DD HH:mm:ss"){return(0,ee.default)(e,t,!0).isValid()}function wt(e){return/^[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)&&te(e.slice(6,14),"YYYYMMDD")}0&&(module.exports={base64Decode,base64Encode,castArray,compose,composeRight,debounce,debugWarn,debugWarnInvalidTypeMessage,decimalToBinary,deepClone,deepMerge,deprecated,error,generateRandomArray,generateRandomColor,generateRandomDate,generateRandomEmail,generateRandomFloat,generateRandomIdCard,generateRandomMobilePhone,generateRandomStringFromSource,getRandomInt,getRandomItem,getRandomString,getRandomUrl,hasChanged,isArray,isBoolean,isChineseString,isDate,isDateString,isDef,isEmail,isEmptyString,isEnglishAphabet,isFloat,isFunction,isIdCard,isInteger,isLowerCase,isLowerCaseAndNumber,isLowerCaseAndNumberAndChinese,isMap,isMobilePhone,isNegativeFloat,isNegativeInteger,isNonNegativeFloat,isNonNegativeInteger,isNonPositiveFloat,isNonPositiveInteger,isNull,isNumber,isNumberOrNumberString,isObject,isObjectLike,isPlainObject,isPositiveFloat,isPositiveInteger,isPromise,isRegExp,isSet,isString,isSymbol,isUndef,isUndefined,isUpperCase,isUpperCaseAndNumber,isUpperCaseAndNumberAndChinese,isUrl,objectToString,omit,pick,qs,throttle,throwError,throwErrorInvalidTypeMessage,toTypeString,toTypeValue,validatorChineseOrEnglish,validatorChineseOrEnglishOrNumber,validatorUppercaseOrNumbersOrSpecial,validatorUppercaseOrNumbersOrUnderline,warn});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var Kt=Object.create;var At=Object.defineProperty;var Vt=Object.getOwnPropertyDescriptor;var Xt=Object.getOwnPropertyNames;var qt=Object.getPrototypeOf,Bt=Object.prototype.hasOwnProperty;var Tt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Gt=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Xt(e))!Bt.call(t,i)&&i!==n&&At(t,i,{get:()=>e[i],enumerable:!(r=Vt(e,i))||r.enumerable});return t};var xt=(t,e,n)=>(n=t!=null?Kt(qt(t)):{},Gt(e||!t||!t.__esModule?At(n,"default",{value:t,enumerable:!0}):n,t));var Mt=Tt((bt,$t)=>{"use strict";(function(t,e){typeof bt=="object"&&typeof $t<"u"?$t.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(bt,function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",y="minute",l="hour",b="day",h="week",A="month",X="quarter",I="year",L="date",it="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|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(c){var s=["th","st","nd","rd"],o=c%100;return"["+c+(s[(o-20)%10]||s[o]||s[0])+"]"}},M=function(c,s,o){var u=String(c);return!u||u.length>=s?c:""+Array(s+1-u.length).join(o)+c},H={s:M,z:function(c){var s=-c.utcOffset(),o=Math.abs(s),u=Math.floor(o/60),a=o%60;return(s<=0?"+":"-")+M(u,2,"0")+":"+M(a,2,"0")},m:function c(s,o){if(s.date()<o.date())return-c(o,s);var u=12*(o.year()-s.year())+(o.month()-s.month()),a=s.clone().add(u,A),f=o-a<0,m=s.clone().add(u+(f?-1:1),A);return+(-(u+(o-a)/(f?a-m:m-a))||0)},a:function(c){return c<0?Math.ceil(c)||0:Math.floor(c)},p:function(c){return{M:A,y:I,w:h,d:b,D:L,h:l,m:y,s:i,ms:r,Q:X}[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(c){return c===void 0}},j="en",N={};N[j]=O;var z="$isDayjsObject",P=function(c){return c instanceof Y||!(!c||!c[z])},R=function c(s,o,u){var a;if(!s)return j;if(typeof s=="string"){var f=s.toLowerCase();N[f]&&(a=f),o&&(N[f]=o,a=f);var m=s.split("-");if(!a&&m.length>1)return c(m[0])}else{var d=s.name;N[d]=s,a=d}return!u&&a&&(j=a),a||!u&&j},$=function(c,s){if(P(c))return c.clone();var o=typeof s=="object"?s:{};return o.date=c,o.args=arguments,new Y(o)},g=H;g.l=R,g.i=P,g.w=function(c,s){return $(c,{locale:s.$L,utc:s.$u,x:s.$x,$offset:s.$offset})};var Y=function(){function c(o){this.$L=R(o.locale,null,!0),this.parse(o),this.$x=this.$x||o.x||{},this[z]=!0}var s=c.prototype;return s.parse=function(o){this.$d=function(u){var a=u.date,f=u.utc;if(a===null)return new Date(NaN);if(g.u(a))return new Date;if(a instanceof Date)return new Date(a);if(typeof a=="string"&&!/Z$/i.test(a)){var m=a.match(p);if(m){var d=m[2]-1||0,w=(m[7]||"0").substring(0,3);return f?new Date(Date.UTC(m[1],d,m[3]||1,m[4]||0,m[5]||0,m[6]||0,w)):new Date(m[1],d,m[3]||1,m[4]||0,m[5]||0,m[6]||0,w)}}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 g},s.isValid=function(){return this.$d.toString()!==it},s.isSame=function(o,u){var a=$(o);return this.startOf(u)<=a&&a<=this.endOf(u)},s.isAfter=function(o,u){return $(o)<this.startOf(u)},s.isBefore=function(o,u){return this.endOf(u)<$(o)},s.$g=function(o,u,a){return g.u(o)?this[u]:this.set(a,o)},s.unix=function(){return Math.floor(this.valueOf()/1e3)},s.valueOf=function(){return this.$d.getTime()},s.startOf=function(o,u){var a=this,f=!!g.u(u)||u,m=g.p(o),d=function(K,T){var _=g.w(a.$u?Date.UTC(a.$y,T,K):new Date(a.$y,T,K),a);return f?_:_.endOf(b)},w=function(K,T){return g.w(a.toDate()[K].apply(a.toDate("s"),(f?[0,0,0,0]:[23,59,59,999]).slice(T)),a)},S=this.$W,v=this.$M,C=this.$D,G="set"+(this.$u?"UTC":"");switch(m){case I:return f?d(1,0):d(31,11);case A:return f?d(1,v):d(0,v+1);case h:var q=this.$locale().weekStart||0,tt=(S<q?S+7:S)-q;return d(f?C-tt:C+(6-tt),v);case b:case L:return w(G+"Hours",0);case l:return w(G+"Minutes",1);case y:return w(G+"Seconds",2);case i:return w(G+"Milliseconds",3);default:return this.clone()}},s.endOf=function(o){return this.startOf(o,!1)},s.$set=function(o,u){var a,f=g.p(o),m="set"+(this.$u?"UTC":""),d=(a={},a[b]=m+"Date",a[L]=m+"Date",a[A]=m+"Month",a[I]=m+"FullYear",a[l]=m+"Hours",a[y]=m+"Minutes",a[i]=m+"Seconds",a[r]=m+"Milliseconds",a)[f],w=f===b?this.$D+(u-this.$W):u;if(f===A||f===I){var S=this.clone().set(L,1);S.$d[d](w),S.init(),this.$d=S.set(L,Math.min(this.$D,S.daysInMonth())).$d}else d&&this.$d[d](w);return this.init(),this},s.set=function(o,u){return this.clone().$set(o,u)},s.get=function(o){return this[g.p(o)]()},s.add=function(o,u){var a,f=this;o=Number(o);var m=g.p(u),d=function(v){var C=$(f);return g.w(C.date(C.date()+Math.round(v*o)),f)};if(m===A)return this.set(A,this.$M+o);if(m===I)return this.set(I,this.$y+o);if(m===b)return d(1);if(m===h)return d(7);var w=(a={},a[y]=e,a[l]=n,a[i]=t,a)[m]||1,S=this.$d.getTime()+o*w;return g.w(S,this)},s.subtract=function(o,u){return this.add(-1*o,u)},s.format=function(o){var u=this,a=this.$locale();if(!this.isValid())return a.invalidDate||it;var f=o||"YYYY-MM-DDTHH:mm:ssZ",m=g.z(this),d=this.$H,w=this.$m,S=this.$M,v=a.weekdays,C=a.months,G=a.meridiem,q=function(T,_,B,J){return T&&(T[_]||T(u,f))||B[_].slice(0,J)},tt=function(T){return g.s(d%12||12,T,"0")},K=G||function(T,_,B){var J=T<12?"AM":"PM";return B?J.toLowerCase():J};return f.replace(x,function(T,_){return _||function(B){switch(B){case"YY":return String(u.$y).slice(-2);case"YYYY":return g.s(u.$y,4,"0");case"M":return S+1;case"MM":return g.s(S+1,2,"0");case"MMM":return q(a.monthsShort,S,C,3);case"MMMM":return q(C,S);case"D":return u.$D;case"DD":return g.s(u.$D,2,"0");case"d":return String(u.$W);case"dd":return q(a.weekdaysMin,u.$W,v,2);case"ddd":return q(a.weekdaysShort,u.$W,v,3);case"dddd":return v[u.$W];case"H":return String(d);case"HH":return g.s(d,2,"0");case"h":return tt(1);case"hh":return tt(2);case"a":return K(d,w,!0);case"A":return K(d,w,!1);case"m":return String(w);case"mm":return g.s(w,2,"0");case"s":return String(u.$s);case"ss":return g.s(u.$s,2,"0");case"SSS":return g.s(u.$ms,3,"0");case"Z":return m}return null}(T)||m.replace(":","")})},s.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},s.diff=function(o,u,a){var f,m=this,d=g.p(u),w=$(o),S=(w.utcOffset()-this.utcOffset())*e,v=this-w,C=function(){return g.m(m,w)};switch(d){case I:f=C()/12;break;case A:f=C();break;case X:f=C()/3;break;case h:f=(v-S)/6048e5;break;case b:f=(v-S)/864e5;break;case l:f=v/n;break;case y:f=v/e;break;case i:f=v/t;break;default:f=v}return a?f:g.a(f)},s.daysInMonth=function(){return this.endOf(A).$D},s.$locale=function(){return N[this.$L]},s.locale=function(o,u){if(!o)return this.$L;var a=this.clone(),f=R(o,u,!0);return f&&(a.$L=f),a},s.clone=function(){return g.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()},c}(),E=Y.prototype;return $.prototype=E,[["$ms",r],["$s",i],["$m",y],["$H",l],["$W",b],["$M",A],["$y",I],["$D",L]].forEach(function(c){E[c[1]]=function(s){return this.$g(s,c[0],c[1])}}),$.extend=function(c,s){return c.$i||(c(s,Y,$),c.$i=!0),$},$.locale=R,$.isDayjs=P,$.unix=function(c){return $(1e3*c)},$.en=N[j],$.Ls=N,$.p={},$})});var Zt=Tt((wt,Ot)=>{"use strict";(function(t,e){typeof wt=="object"&&typeof Ot<"u"?Ot.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_customParseFormat=e()})(wt,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,n=/\d/,r=/\d\d/,i=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,l={},b=function(p){return(p=+p)+(p>68?1900:2e3)},h=function(p){return function(x){this[p]=+x}},A=[/[+-]\d\d:?(\d\d)?|Z/,function(p){(this.zone||(this.zone={})).offset=function(x){if(!x||x==="Z")return 0;var O=x.match(/([+-]|\d\d)/g),M=60*O[1]+(+O[2]||0);return M===0?0:O[0]==="+"?-M:M}(p)}],X=function(p){var x=l[p];return x&&(x.indexOf?x:x.s.concat(x.f))},I=function(p,x){var O,M=l.meridiem;if(M){for(var H=1;H<=24;H+=1)if(p.indexOf(M(H,0,x))>-1){O=H>12;break}}else O=p===(x?"pm":"PM");return O},L={A:[y,function(p){this.afternoon=I(p,!1)}],a:[y,function(p){this.afternoon=I(p,!0)}],Q:[n,function(p){this.month=3*(p-1)+1}],S:[n,function(p){this.milliseconds=100*+p}],SS:[r,function(p){this.milliseconds=10*+p}],SSS:[/\d{3}/,function(p){this.milliseconds=+p}],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:[r,h("day")],Do:[y,function(p){var x=l.ordinal,O=p.match(/\d+/);if(this.day=O[0],x)for(var M=1;M<=31;M+=1)x(M).replace(/\[|\]/g,"")===p&&(this.day=M)}],w:[i,h("week")],ww:[r,h("week")],M:[i,h("month")],MM:[r,h("month")],MMM:[y,function(p){var x=X("months"),O=(X("monthsShort")||x.map(function(M){return M.slice(0,3)})).indexOf(p)+1;if(O<1)throw new Error;this.month=O%12||O}],MMMM:[y,function(p){var x=X("months").indexOf(p)+1;if(x<1)throw new Error;this.month=x%12||x}],Y:[/[+-]?\d+/,h("year")],YY:[r,function(p){this.year=b(p)}],YYYY:[/\d{4}/,h("year")],Z:A,ZZ:A};function it(p){var x,O;x=p,O=l&&l.formats;for(var M=(p=x.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function($,g,Y){var E=Y&&Y.toUpperCase();return g||O[Y]||t[Y]||O[E].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(c,s,o){return s||o.slice(1)})})).match(e),H=M.length,j=0;j<H;j+=1){var N=M[j],z=L[N],P=z&&z[0],R=z&&z[1];M[j]=R?{regex:P,parser:R}:N.replace(/^\[|\]$/g,"")}return function($){for(var g={},Y=0,E=0;Y<H;Y+=1){var c=M[Y];if(typeof c=="string")E+=c.length;else{var s=c.regex,o=c.parser,u=$.slice(E),a=s.exec(u)[0];o.call(g,a),$=$.replace(a,"")}}return function(f){var m=f.afternoon;if(m!==void 0){var d=f.hours;m?d<12&&(f.hours+=12):d===12&&(f.hours=0),delete f.afternoon}}(g),g}}return function(p,x,O){O.p.customParseFormat=!0,p&&p.parseTwoDigitYear&&(b=p.parseTwoDigitYear);var M=x.prototype,H=M.parse;M.parse=function(j){var N=j.date,z=j.utc,P=j.args;this.$u=z;var R=P[1];if(typeof R=="string"){var $=P[2]===!0,g=P[3]===!0,Y=$||g,E=P[2];g&&(E=P[2]),l=this.$locale(),!$&&E&&(l=O.Ls[E]),this.$d=function(u,a,f,m){try{if(["x","X"].indexOf(a)>-1)return new Date((a==="X"?1e3:1)*u);var d=it(a)(u),w=d.year,S=d.month,v=d.day,C=d.hours,G=d.minutes,q=d.seconds,tt=d.milliseconds,K=d.zone,T=d.week,_=new Date,B=v||(w||S?1:_.getDate()),J=w||_.getFullYear(),st=0;w&&!S||(st=S>0?S-1:_.getMonth());var at,dt=C||0,lt=G||0,gt=q||0,ht=tt||0;return K?new Date(Date.UTC(J,st,B,dt,lt,gt,ht+60*K.offset*1e3)):f?new Date(Date.UTC(J,st,B,dt,lt,gt,ht)):(at=new Date(J,st,B,dt,lt,gt,ht),T&&(at=m(at).week(T).toDate()),at)}catch{return new Date("")}}(N,R,z,O),this.init(),E&&E!==!0&&(this.$L=this.locale(E).$L),Y&&N!=this.format(R)&&(this.$d=new Date("")),l={}}else if(R instanceof Array)for(var c=R.length,s=1;s<=c;s+=1){P[1]=R[s-1];var o=O.apply(this,P);if(o.isValid()){this.$d=o.$d,this.$L=o.$L,this.init();break}s===c&&(this.$d=new Date(""))}else H.call(this,j)}}})});function ge(t){let e=typeof t;return t!==null&&(e==="object"||e==="function")}function ut(t){return t!==null&&typeof t=="object"}var Jt=Object.prototype.toString,et=t=>Jt.call(t),yt=t=>et(t).slice(8,-1),kt=t=>typeof t=="string",U=t=>typeof t=="number"&&Number.isFinite(t),be=t=>typeof t=="boolean",$e=t=>t===null,Me=t=>t===void 0,jt=t=>typeof t=="symbol",Z=Array.isArray,ct=t=>typeof t=="function",Yt=t=>et(t)==="[object Map]",Rt=t=>et(t)==="[object Set]",Et=t=>et(t)==="[object Date]",Ct=t=>et(t)==="[object RegExp]",It=t=>ut(t)&&ct(t?.then)&&ct(t?.catch),rt=t=>t==null,we=t=>t!=null,Oe=(t,e)=>t!==e;function Q(t){return et(t)==="[object Object]"}function nt(t){return Z(t)?t:[t]}function Ne(t){let e=[],n,r="";for(;t>0;)n=Math.floor(t%2),e.push(n),t=Math.floor(t/2);for(;e.length>0;)r+=e.pop().toString();return r}var Nt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Pe(t){let e="",n="";for(let i=0;i<t.length;i++)n+=t[i].charCodeAt(0).toString(2).padStart(8,"0");for(let i=0;i<n.length;i+=6)e+=Nt[parseInt(n.slice(i,i+6).padEnd(6,"0"),2)];let r=e.length%4;return r!==0&&(e+="=".repeat(4-r)),e}function Le(t){let e="",n="";for(let r=0;r<t.length&&t[r]!=="=";r++)n+=Nt.indexOf(t[r]).toString(2).padStart(6,"0");for(let r=0;r<n.length;r+=8){let i=parseInt(n.slice(r,r+8),2);i&&(e+=String.fromCharCode(i))}return e}function Fe(...t){return t.reduce((e,n)=>function(...r){return n(e(...r))})}function He(...t){return t.reduce((e,n)=>function(...r){return e(n(...r))})}function Ze(t,e=500){let n=null;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>{t.apply(this,r)},e)}}function ot(t){let e=new WeakMap;function n(r){if(!ut(r))return r;if(Et(r))return new Date(r);if(Ct(r))return new RegExp(r);if(It(r))return r;if(e.has(r))return e.get(r);if(Yt(r)){let l=new Map;return e.set(r,l),r.forEach((b,h)=>l.set(n(h),n(b))),l}if(Rt(r)){let l=new Set;return e.set(r,l),r.forEach(b=>l.add(n(b))),l}let i=Z(r)?Object.setPrototypeOf([],Object.getPrototypeOf(r)):Object.create(Object.getPrototypeOf(r));e.set(r,i);let y=Object.getOwnPropertyDescriptors(r);for(let l of Reflect.ownKeys(y)){let b=y[l];b.get||b.set?Object.defineProperty(i,l,b):Object.defineProperty(i,l,{...b,value:n(b.value)})}return i}return n(t)}function Lt(t,e,n={}){return _t(Pt(t,n),Pt(e,n),n)}function _t(t,e,n){return Z(t)?te(t,e,n):Qt(t,e,n)}function Qt(t,e,n){if(!Q(e))return e;let r=Object.getOwnPropertyDescriptors(e);return Reflect.ownKeys(e).forEach(i=>{(Q(t[i])||Z(t[i]))&&(Q(e[i])||Z(e[i]))?t[i]=_t(t[i],e[i],n):Object.defineProperty(t,i,r[i])}),t}function te(t,e,n){let{mergeStrategy:r="replace"}=n;if(Z(e))switch(r){case"merge":return t.concat(e);case"replace":return e;default:return e}return e}function Pt(t,e){let{deepClone:n=!0}=e;return n?ot(t):t}var ft=class extends Error{constructor(e,n="Utils"){super(e),this.name=n}};function D(t,e){throw new ft(`[${t}] ${e}`)}function Ft(t,e){let n=kt(t)?new ft(`[${t}] ${e}`,"UtilsWarn"):t;console.warn(n)}function Ge(...t){console.warn(...t)}function Je(...t){console.error(...t)}var Qe=({from:t,replacement:e,version:n,type:r="API"})=>{Ft(`${r}`,`${t} is about to be deprecated in version ${n}, please use ${e} instead.`)};function tn(t,e,n,r){let i=`Invalid params: type check failed for params "${e}". Expected ${n}, got ${yt(r)} with value ${r}.`;D(t,i)}function en(t,e,n,r){let i=`Invalid params: type check failed for params "${e}". Expected ${n}, got ${yt(r)} with value ${r}.`;Ft(t,i)}var mt=(t,e,...n)=>{if(!e)return;let r=n.length===0?"":n.length===1?n[0]:n;console[t](`[Log] ${e}:`,r)},pt=(t,...e)=>{mt("info",t,...e)};pt.info=(t,...e)=>{mt("info",t,...e)};pt.error=(t,...e)=>{mt("error",t,...e)};pt.warn=(t,...e)=>{mt("warn",t,...e)};typeof globalThis<"u"&&(globalThis.log=pt);function ee(t,e){let{decode:n=!0}=e||{},r={};t.startsWith("?")&&(t=t.slice(1)),t.includes("?")&&(t=t.slice(t.indexOf("?")+1));let i=t.split("&").filter(Boolean);for(let y of i){let[l,b]=y.split("=");r[l]=n?decodeURIComponent(b):b}return r}function Ht(t,e){let{encode:n=!0}=e||{},r=[];for(let i in t){let y=t[i];r.push(`${i}=${n?encodeURIComponent(y):y}`)}return r.join("&")}function ne(t,e,n){let r=Lt({encode:!0},{...n}),i=Ht(e,r);return t.includes("?")?t.endsWith("?")||t.endsWith("&")?`${t}${i}`:`${t}&${i}`:`${t}?${i}`}var on={parse:ee,stringify:Ht,appendQueryString:ne};function un(t,e=500){let n=null;return function(...r){if(rt(n))return n=Date.now(),t.apply(this,r);let i=Date.now();if(i-n>=e)return n=i,t.apply(this,r)}}function mn(t){return!rt(t)&&/^[\dA-Z\u4E00-\u9FA5]+$/i.test(t)}function pn(t){return!rt(t)&&/^[A-Z\u4E00-\u9FA5]+$/i.test(t)}function dn(t){return!rt(t)&&/^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(t)}function ln(t){return/^[\dA-Z_]+$/.test(t)}function Ut(t,e,n={}){let{includeProto:r=!1,includeSymbols:i=!0,includeNonEnum:y=!1}=n,l={};return Q(t)&&nt(e).forEach(h=>{jt(h)&&!i||!(r?h in t:Object.hasOwn(t,h))||!y&&(r?re(t,h):Object.getOwnPropertyDescriptor(t,h))?.enumerable===!1||(l[h]=ot(t[h]))}),l}function re(t,e){let n=t;for(;n!==null;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function In(t,e){if(!Q(t))return{};let n=ot(t),r=nt(e),i=Object.keys(n).filter(y=>!r.includes(y));return Ut(n,i)}function Un(t,e){return(!U(t)||t<=0)&&D("generateRandomArray","num \u5FC5\u987B\u5927\u4E8E0"),ct(e)||D("generateRandomArray","cb \u5FC5\u987B\u662F\u51FD\u6570"),Array.from({length:t}).fill(0).map((n,r)=>e(n,r))}function Wn(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}var V=xt(Mt(),1),Wt=xt(Zt(),1);function F(t){return t[Math.floor(Math.random()*t.length)]}function k(t={}){U(t)&&(t={max:t});let{min:e=1,max:n=F(ie())}=t;oe(e,n);let r=Math.ceil(e),i=Math.floor(n);return Math.floor(Math.random()*(i-r+1)+r)}function oe(t,e){let n=Math.ceil(t),r=Math.floor(e);Number.isSafeInteger(n)||D("getRandomInt",`The minimum value Math.ceil(${t}) should be a safe integer`),Number.isSafeInteger(r)||D("getRandomInt",`The maximum value Math.floor(${e}) should be a safe integer`),r<n&&(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 ie(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((t,e)=>{let n=Number.MAX_SAFE_INTEGER.toString().slice(0,e+1);return Number(n)})}V.default.extend(Wt.default);function St(t={}){let{start:e="1800-01-01 00:00:00",end:n=(0,V.default)().format("YYYY-MM-DD HH:mm:ss"),format:r="YYYY-MM-DD HH:mm:ss"}=t;(!(0,V.default)(e).isValid()||!(0,V.default)(n).isValid())&&D("generateRandomDate","start end \u53C2\u6570\u5FC5\u987B\u662F\u5408\u6CD5\u7684\u65F6\u95F4\u683C\u5F0F");let i=(0,V.default)(e).year(),y=(0,V.default)(n).year(),l=k({min:i,max:y}),b=k({min:1,max:12}),h=k({min:1,max:31}),A=k(23),X=k(59),I=k(59),L=(0,V.default)(`${l}-${b}-${h} ${A}:${X}:${I}`);return L.isBefore((0,V.default)(e))||L.isAfter((0,V.default)(n))?St(t):L.format(r)}function W(t={}){let e=ae(t),n=ue(e);ce(n);let{length:r}=e;fe(r.min,r.max);let i=k(r),y=e.prefix||"";for(let l=0;l<i;l++)y+=n.charAt(Math.floor(Math.random()*n.length));return y+(e.suffix||"")}var se=16,Dt=1;function ae(t){let e=U(t);return{lowerCase:!0,upperCase:!0,number:!0,...e?{}:t,length:e?{max:t,min:t}:U(t.length)?{max:t.length,min:t.length}:{max:se,min:Dt,...t.length},extra:e?[]:[...new Set(nt(t.extra||[]))]}}function ue(t){let e="";return t.lowerCase&&(e+="abcdefghijklmnopqrstuvwxyz"),t.upperCase&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.number&&(e+="0123456789"),e+=nt(t.extra).join(""),e}function ce(t){t.length===0&&D("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function fe(t,e){Number.isInteger(t)||D("getRandomString","min must be an integer"),Number.isInteger(e)||D("getRandomString","max must be an integer"),t<Dt&&D("getRandomString",`Minimum length cannot be less than ${Dt}`),e<t&&D("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=`${W(1)}${W({length:k({max:30,min:1})})}${W(1)}@${F(t)}`;return/\.{2,}/.test(e)?me():e}function fr(t={}){U(t)&&(t={max:t});let{min:e=0,max:n=1,fractionDigits:r=2}=t;if(e===n)return e;if(e>n)throw new Error(`\u6700\u5927\u503C ${n} \u5E94\u5927\u4E8E\u6700\u5C0F\u503C ${e}`);return Math.random()*(n-e)+e}function vt(t,e){(!U(t)||t<=0)&&D("generateRandomStringFromSource","num \u5FC5\u987B\u5927\u4E8E0"),(!Z(e)||e.length===0)&&D("generateRandomStringFromSource","source \u4E0D\u80FD\u4E3A\u7A7A\u6570\u7EC4");let n="";for(let r=0;r<t;r++)n+=F(e);return n}function br(){let t=k({min:1e5,max:999999}),e=[0,1,2,3,4,5,6,7,8,9];return[t,St({format:"YYYYMMDD"}),vt(3,e),vt(1,[...e,"X","x"])].join("")}function Or(){return F(["13","14","15","16","17","18","19"])+k(999999999).toString().padEnd(9,"0")}function Tr(){let t=["http://","https://"],e=[".com",".net",".org",".cn",".top"],n=[`?name=${W({length:{min:4,max:8}})}`,`?id=${k()}`,`?page=${W({length:{min:2,max:4}})}`,`?query=${W({length:{min:5,max:6}})}`,`?search=${W({length:{min:1,max:4}})}`,`?token=${W({length:{min:16,max:16}})}`];return`${F(t)}${W({length:{min:5,max:25}})}${F(e)}${F(n)}`}function Wr(t){return/^\d+$/.test(t)}function zr(t){return/^[A-Z]+$/i.test(t)}function Kr(t){return/^[A-Z]+$/.test(t)}function Vr(t){return/^[\dA-Z]+$/.test(t)}function Xr(t){return/^[\dA-Z\u4E00-\u9FA5]+$/.test(t)}function qr(t){return/^[a-z]+$/.test(t)}function Br(t){return/^[\da-z]+$/.test(t)}function Gr(t){return/^[\da-z\u4E00-\u9FA5]+$/.test(t)}function Jr(t){return/^[\u4E00-\u9FA5]+$/.test(t)}function to(t){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(t)}function eo(t){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function no(t){return/^(?:0|[1-9]\d*)\.\d+$/.test(t)}function ro(t){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function oo(t){return/^-(?:0|[1-9]\d*)\.\d+$/.test(t)}function so(t){return/^-?(?:0|[1-9]\d*)$/.test(t)}function ao(t){return/^[1-9]\d*$/.test(t)}function uo(t){return/^(?:0|[1-9]\d*)$/.test(t)&&!Object.is(t,-0)}function co(t){return/^-[1-9]\d*$/.test(t)}function fo(t){return/^-(?:0|[1-9]\d*)$/.test(t)||Object.is(t,-0)}var zt=xt(Mt(),1);function po(t){return/^1[3-9]\d{9}$/.test(t)}function lo(t){return/^https?:\/\/\S+$/i.test(t)}function go(t){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t)}function ho(t){return t===""}function pe(t,e="YYYY-MM-DD HH:mm:ss"){return(0,zt.default)(t,e,!0).isValid()}function xo(t){return/^[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)&&pe(t.slice(6,14),"YYYYMMDD")}export{Le as base64Decode,Pe as base64Encode,nt as castArray,Fe as compose,He as composeRight,Ze as debounce,Ft as debugWarn,en as debugWarnInvalidTypeMessage,Ne as decimalToBinary,ot as deepClone,Lt as deepMerge,Qe as deprecated,Je as error,Un as generateRandomArray,Wn as generateRandomColor,St as generateRandomDate,me as generateRandomEmail,fr as generateRandomFloat,br as generateRandomIdCard,Or as generateRandomMobilePhone,vt as generateRandomStringFromSource,k as getRandomInt,F as getRandomItem,W as getRandomString,Tr as getRandomUrl,Oe as hasChanged,Z as isArray,be as isBoolean,Jr as isChineseString,Et as isDate,pe as isDateString,we as isDef,go as isEmail,ho as isEmptyString,zr as isEnglishAphabet,to as isFloat,ct as isFunction,xo as isIdCard,so as isInteger,qr as isLowerCase,Br as isLowerCaseAndNumber,Gr as isLowerCaseAndNumberAndChinese,Yt as isMap,po as isMobilePhone,ro as isNegativeFloat,co as isNegativeInteger,no as isNonNegativeFloat,uo as isNonNegativeInteger,oo as isNonPositiveFloat,fo as isNonPositiveInteger,$e as isNull,U as isNumber,Wr as isNumberOrNumberString,ge as isObject,ut as isObjectLike,Q as isPlainObject,eo as isPositiveFloat,ao as isPositiveInteger,It as isPromise,Ct as isRegExp,Rt as isSet,kt as isString,jt as isSymbol,rt as isUndef,Me as isUndefined,Kr as isUpperCase,Vr as isUpperCaseAndNumber,Xr as isUpperCaseAndNumberAndChinese,lo as isUrl,Jt as objectToString,In as omit,Ut as pick,on as qs,un as throttle,D as throwError,tn as throwErrorInvalidTypeMessage,et as toTypeString,yt as toTypeValue,pn as validatorChineseOrEnglish,mn as validatorChineseOrEnglishOrNumber,dn as validatorUppercaseOrNumbersOrSpecial,ln as validatorUppercaseOrNumbersOrUnderline,Ge as warn};
|
|
1
|
+
var qt=Object.create;var jt=Object.defineProperty;var Bt=Object.getOwnPropertyDescriptor;var Gt=Object.getOwnPropertyNames;var Jt=Object.getPrototypeOf,Qt=Object.prototype.hasOwnProperty;var te=(t,e)=>()=>(t&&(e=t(t=0)),e);var Yt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var ee=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Gt(e))!Qt.call(t,s)&&s!==n&&jt(t,s,{get:()=>e[s],enumerable:!(r=Bt(e,s))||r.enumerable});return t};var $t=(t,e,n)=>(n=t!=null?qt(Jt(t)):{},ee(e||!t||!t.__esModule?jt(n,"default",{value:t,enumerable:!0}):n,t));import $e from"path";import{fileURLToPath as we}from"url";var o=te(()=>{"use strict"});var St=Yt((wt,Ot)=>{"use strict";o();(function(t,e){typeof wt=="object"&&typeof Ot<"u"?Ot.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(wt,function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",s="second",M="minute",y="hour",w="day",b="week",j="month",G="quarter",_="year",U="date",ut="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,$=/\[([^\]]+)]|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(f){var a=["th","st","nd","rd"],i=f%100;return"["+f+(a[(i-20)%10]||a[i]||a[0])+"]"}},S=function(f,a,i){var c=String(f);return!c||c.length>=a?f:""+Array(a+1-c.length).join(i)+f},W={s:S,z:function(f){var a=-f.utcOffset(),i=Math.abs(a),c=Math.floor(i/60),u=i%60;return(a<=0?"+":"-")+S(c,2,"0")+":"+S(u,2,"0")},m:function f(a,i){if(a.date()<i.date())return-f(i,a);var c=12*(i.year()-a.year())+(i.month()-a.month()),u=a.clone().add(c,j),m=i-u<0,p=a.clone().add(c+(m?-1:1),j);return+(-(c+(i-u)/(m?u-p:p-u))||0)},a:function(f){return f<0?Math.ceil(f)||0:Math.floor(f)},p:function(f){return{M:j,y:_,w:b,d:w,D:U,h:y,m:M,s,ms:r,Q:G}[f]||String(f||"").toLowerCase().replace(/s$/,"")},u:function(f){return f===void 0}},E="en",L={};L[E]=A;var X="$isDayjsObject",F=function(f){return f instanceof C||!(!f||!f[X])},P=function f(a,i,c){var u;if(!a)return E;if(typeof a=="string"){var m=a.toLowerCase();L[m]&&(u=m),i&&(L[m]=i,u=m);var p=a.split("-");if(!u&&p.length>1)return f(p[0])}else{var h=a.name;L[h]=a,u=h}return!c&&u&&(E=u),u||!c&&E},O=function(f,a){if(F(f))return f.clone();var i=typeof a=="object"?a:{};return i.date=f,i.args=arguments,new C(i)},x=W;x.l=P,x.i=F,x.w=function(f,a){return O(f,{locale:a.$L,utc:a.$u,x:a.$x,$offset:a.$offset})};var C=function(){function f(i){this.$L=P(i.locale,null,!0),this.parse(i),this.$x=this.$x||i.x||{},this[X]=!0}var a=f.prototype;return a.parse=function(i){this.$d=function(c){var u=c.date,m=c.utc;if(u===null)return new Date(NaN);if(x.u(u))return new Date;if(u instanceof Date)return new Date(u);if(typeof u=="string"&&!/Z$/i.test(u)){var p=u.match(g);if(p){var h=p[2]-1||0,D=(p[7]||"0").substring(0,3);return m?new Date(Date.UTC(p[1],h,p[3]||1,p[4]||0,p[5]||0,p[6]||0,D)):new Date(p[1],h,p[3]||1,p[4]||0,p[5]||0,p[6]||0,D)}}return new Date(u)}(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 x},a.isValid=function(){return this.$d.toString()!==ut},a.isSame=function(i,c){var u=O(i);return this.startOf(c)<=u&&u<=this.endOf(c)},a.isAfter=function(i,c){return O(i)<this.startOf(c)},a.isBefore=function(i,c){return this.endOf(c)<O(i)},a.$g=function(i,c,u){return x.u(i)?this[c]:this.set(u,i)},a.unix=function(){return Math.floor(this.valueOf()/1e3)},a.valueOf=function(){return this.$d.getTime()},a.startOf=function(i,c){var u=this,m=!!x.u(c)||c,p=x.p(i),h=function(q,Y){var H=x.w(u.$u?Date.UTC(u.$y,Y,q):new Date(u.$y,Y,q),u);return m?H:H.endOf(w)},D=function(q,Y){return x.w(u.toDate()[q].apply(u.toDate("s"),(m?[0,0,0,0]:[23,59,59,999]).slice(Y)),u)},v=this.$W,k=this.$M,N=this.$D,tt="set"+(this.$u?"UTC":"");switch(p){case _:return m?h(1,0):h(31,11);case j:return m?h(1,k):h(0,k+1);case b:var J=this.$locale().weekStart||0,rt=(v<J?v+7:v)-J;return h(m?N-rt:N+(6-rt),k);case w:case U:return D(tt+"Hours",0);case y:return D(tt+"Minutes",1);case M:return D(tt+"Seconds",2);case s:return D(tt+"Milliseconds",3);default:return this.clone()}},a.endOf=function(i){return this.startOf(i,!1)},a.$set=function(i,c){var u,m=x.p(i),p="set"+(this.$u?"UTC":""),h=(u={},u[w]=p+"Date",u[U]=p+"Date",u[j]=p+"Month",u[_]=p+"FullYear",u[y]=p+"Hours",u[M]=p+"Minutes",u[s]=p+"Seconds",u[r]=p+"Milliseconds",u)[m],D=m===w?this.$D+(c-this.$W):c;if(m===j||m===_){var v=this.clone().set(U,1);v.$d[h](D),v.init(),this.$d=v.set(U,Math.min(this.$D,v.daysInMonth())).$d}else h&&this.$d[h](D);return this.init(),this},a.set=function(i,c){return this.clone().$set(i,c)},a.get=function(i){return this[x.p(i)]()},a.add=function(i,c){var u,m=this;i=Number(i);var p=x.p(c),h=function(k){var N=O(m);return x.w(N.date(N.date()+Math.round(k*i)),m)};if(p===j)return this.set(j,this.$M+i);if(p===_)return this.set(_,this.$y+i);if(p===w)return h(1);if(p===b)return h(7);var D=(u={},u[M]=e,u[y]=n,u[s]=t,u)[p]||1,v=this.$d.getTime()+i*D;return x.w(v,this)},a.subtract=function(i,c){return this.add(-1*i,c)},a.format=function(i){var c=this,u=this.$locale();if(!this.isValid())return u.invalidDate||ut;var m=i||"YYYY-MM-DDTHH:mm:ssZ",p=x.z(this),h=this.$H,D=this.$m,v=this.$M,k=u.weekdays,N=u.months,tt=u.meridiem,J=function(Y,H,Q,et){return Y&&(Y[H]||Y(c,m))||Q[H].slice(0,et)},rt=function(Y){return x.s(h%12||12,Y,"0")},q=tt||function(Y,H,Q){var et=Y<12?"AM":"PM";return Q?et.toLowerCase():et};return m.replace($,function(Y,H){return H||function(Q){switch(Q){case"YY":return String(c.$y).slice(-2);case"YYYY":return x.s(c.$y,4,"0");case"M":return v+1;case"MM":return x.s(v+1,2,"0");case"MMM":return J(u.monthsShort,v,N,3);case"MMMM":return J(N,v);case"D":return c.$D;case"DD":return x.s(c.$D,2,"0");case"d":return String(c.$W);case"dd":return J(u.weekdaysMin,c.$W,k,2);case"ddd":return J(u.weekdaysShort,c.$W,k,3);case"dddd":return k[c.$W];case"H":return String(h);case"HH":return x.s(h,2,"0");case"h":return rt(1);case"hh":return rt(2);case"a":return q(h,D,!0);case"A":return q(h,D,!1);case"m":return String(D);case"mm":return x.s(D,2,"0");case"s":return String(c.$s);case"ss":return x.s(c.$s,2,"0");case"SSS":return x.s(c.$ms,3,"0");case"Z":return p}return null}(Y)||p.replace(":","")})},a.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},a.diff=function(i,c,u){var m,p=this,h=x.p(c),D=O(i),v=(D.utcOffset()-this.utcOffset())*e,k=this-D,N=function(){return x.m(p,D)};switch(h){case _:m=N()/12;break;case j:m=N();break;case G:m=N()/3;break;case b:m=(k-v)/6048e5;break;case w:m=(k-v)/864e5;break;case y:m=k/n;break;case M:m=k/e;break;case s:m=k/t;break;default:m=k}return u?m:x.a(m)},a.daysInMonth=function(){return this.endOf(j).$D},a.$locale=function(){return L[this.$L]},a.locale=function(i,c){if(!i)return this.$L;var u=this.clone(),m=P(i,c,!0);return m&&(u.$L=m),u},a.clone=function(){return x.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()},f}(),I=C.prototype;return O.prototype=I,[["$ms",r],["$s",s],["$m",M],["$H",y],["$W",w],["$M",j],["$y",_],["$D",U]].forEach(function(f){I[f[1]]=function(a){return this.$g(a,f[0],f[1])}}),O.extend=function(f,a){return f.$i||(f(a,C,O),f.$i=!0),O},O.locale=P,O.isDayjs=F,O.unix=function(f){return O(1e3*f)},O.en=L[E],O.Ls=L,O.p={},O})});var Kt=Yt((Dt,At)=>{"use strict";o();(function(t,e){typeof Dt=="object"&&typeof At<"u"?At.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_customParseFormat=e()})(Dt,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,n=/\d/,r=/\d\d/,s=/\d\d?/,M=/\d*[^-_:/,()\s\d]+/,y={},w=function(g){return(g=+g)+(g>68?1900:2e3)},b=function(g){return function($){this[g]=+$}},j=[/[+-]\d\d:?(\d\d)?|Z/,function(g){(this.zone||(this.zone={})).offset=function($){if(!$||$==="Z")return 0;var A=$.match(/([+-]|\d\d)/g),S=60*A[1]+(+A[2]||0);return S===0?0:A[0]==="+"?-S:S}(g)}],G=function(g){var $=y[g];return $&&($.indexOf?$:$.s.concat($.f))},_=function(g,$){var A,S=y.meridiem;if(S){for(var W=1;W<=24;W+=1)if(g.indexOf(S(W,0,$))>-1){A=W>12;break}}else A=g===($?"pm":"PM");return A},U={A:[M,function(g){this.afternoon=_(g,!1)}],a:[M,function(g){this.afternoon=_(g,!0)}],Q:[n,function(g){this.month=3*(g-1)+1}],S:[n,function(g){this.milliseconds=100*+g}],SS:[r,function(g){this.milliseconds=10*+g}],SSS:[/\d{3}/,function(g){this.milliseconds=+g}],s:[s,b("seconds")],ss:[s,b("seconds")],m:[s,b("minutes")],mm:[s,b("minutes")],H:[s,b("hours")],h:[s,b("hours")],HH:[s,b("hours")],hh:[s,b("hours")],D:[s,b("day")],DD:[r,b("day")],Do:[M,function(g){var $=y.ordinal,A=g.match(/\d+/);if(this.day=A[0],$)for(var S=1;S<=31;S+=1)$(S).replace(/\[|\]/g,"")===g&&(this.day=S)}],w:[s,b("week")],ww:[r,b("week")],M:[s,b("month")],MM:[r,b("month")],MMM:[M,function(g){var $=G("months"),A=(G("monthsShort")||$.map(function(S){return S.slice(0,3)})).indexOf(g)+1;if(A<1)throw new Error;this.month=A%12||A}],MMMM:[M,function(g){var $=G("months").indexOf(g)+1;if($<1)throw new Error;this.month=$%12||$}],Y:[/[+-]?\d+/,b("year")],YY:[r,function(g){this.year=w(g)}],YYYY:[/\d{4}/,b("year")],Z:j,ZZ:j};function ut(g){var $,A;$=g,A=y&&y.formats;for(var S=(g=$.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(O,x,C){var I=C&&C.toUpperCase();return x||A[C]||t[C]||A[I].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(f,a,i){return a||i.slice(1)})})).match(e),W=S.length,E=0;E<W;E+=1){var L=S[E],X=U[L],F=X&&X[0],P=X&&X[1];S[E]=P?{regex:F,parser:P}:L.replace(/^\[|\]$/g,"")}return function(O){for(var x={},C=0,I=0;C<W;C+=1){var f=S[C];if(typeof f=="string")I+=f.length;else{var a=f.regex,i=f.parser,c=O.slice(I),u=a.exec(c)[0];i.call(x,u),O=O.replace(u,"")}}return function(m){var p=m.afternoon;if(p!==void 0){var h=m.hours;p?h<12&&(m.hours+=12):h===12&&(m.hours=0),delete m.afternoon}}(x),x}}return function(g,$,A){A.p.customParseFormat=!0,g&&g.parseTwoDigitYear&&(w=g.parseTwoDigitYear);var S=$.prototype,W=S.parse;S.parse=function(E){var L=E.date,X=E.utc,F=E.args;this.$u=X;var P=F[1];if(typeof P=="string"){var O=F[2]===!0,x=F[3]===!0,C=O||x,I=F[2];x&&(I=F[2]),y=this.$locale(),!O&&I&&(y=A.Ls[I]),this.$d=function(c,u,m,p){try{if(["x","X"].indexOf(u)>-1)return new Date((u==="X"?1e3:1)*c);var h=ut(u)(c),D=h.year,v=h.month,k=h.day,N=h.hours,tt=h.minutes,J=h.seconds,rt=h.milliseconds,q=h.zone,Y=h.week,H=new Date,Q=k||(D||v?1:H.getDate()),et=D||H.getFullYear(),ct=0;D&&!v||(ct=v>0?v-1:H.getMonth());var ft,ht=N||0,yt=tt||0,xt=J||0,bt=rt||0;return q?new Date(Date.UTC(et,ct,Q,ht,yt,xt,bt+60*q.offset*1e3)):m?new Date(Date.UTC(et,ct,Q,ht,yt,xt,bt)):(ft=new Date(et,ct,Q,ht,yt,xt,bt),Y&&(ft=p(ft).week(Y).toDate()),ft)}catch{return new Date("")}}(L,P,X,A),this.init(),I&&I!==!0&&(this.$L=this.locale(I).$L),C&&L!=this.format(P)&&(this.$d=new Date("")),y={}}else if(P instanceof Array)for(var f=P.length,a=1;a<=f;a+=1){F[1]=P[a-1];var i=A.apply(this,F);if(i.isValid()){this.$d=i.$d,this.$L=i.$L,this.init();break}a===f&&(this.$d=new Date(""))}else W.call(this,E)}}})});o();o();o();o();o();function Se(t){let e=typeof t;return t!==null&&(e==="object"||e==="function")}o();function mt(t){return t!==null&&typeof t=="object"}o();o();var ne=Object.prototype.toString,ot=t=>ne.call(t),Mt=t=>ot(t).slice(8,-1),Rt=t=>typeof t=="string",z=t=>typeof t=="number"&&Number.isFinite(t),je=t=>typeof t=="boolean",Ye=t=>t===null,Re=t=>t===void 0,Et=t=>typeof t=="symbol",K=Array.isArray,pt=t=>typeof t=="function",Ct=t=>ot(t)==="[object Map]",Pt=t=>ot(t)==="[object Set]",It=t=>ot(t)==="[object Date]",Nt=t=>ot(t)==="[object RegExp]",_t=t=>mt(t)&&pt(t?.then)&&pt(t?.catch),st=t=>t==null,Ee=t=>t!=null,Ce=(t,e)=>t!==e;function nt(t){return ot(t)==="[object Object]"}function it(t){return K(t)?t:[t]}o();o();o();o();o();function Je(t){let e=[],n,r="";for(;t>0;)n=Math.floor(t%2),e.push(n),t=Math.floor(t/2);for(;e.length>0;)r+=e.pop().toString();return r}var Lt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Qe(t){let e="",n="";for(let s=0;s<t.length;s++)n+=t[s].charCodeAt(0).toString(2).padStart(8,"0");for(let s=0;s<n.length;s+=6)e+=Lt[parseInt(n.slice(s,s+6).padEnd(6,"0"),2)];let r=e.length%4;return r!==0&&(e+="=".repeat(4-r)),e}function tn(t){let e="",n="";for(let r=0;r<t.length&&t[r]!=="=";r++)n+=Lt.indexOf(t[r]).toString(2).padStart(6,"0");for(let r=0;r<n.length;r+=8){let s=parseInt(n.slice(r,r+8),2);s&&(e+=String.fromCharCode(s))}return e}o();function rn(...t){return t.reduce((e,n)=>function(...r){return n(e(...r))})}function on(...t){return t.reduce((e,n)=>function(...r){return e(n(...r))})}o();function un(t,e=500){let n=null;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>{t.apply(this,r)},e)}}o();function at(t){let e=new WeakMap;function n(r){if(!mt(r))return r;if(It(r))return new Date(r);if(Nt(r))return new RegExp(r);if(_t(r))return r;if(e.has(r))return e.get(r);if(Ct(r)){let y=new Map;return e.set(r,y),r.forEach((w,b)=>y.set(n(b),n(w))),y}if(Pt(r)){let y=new Set;return e.set(r,y),r.forEach(w=>y.add(n(w))),y}let s=K(r)?Object.setPrototypeOf([],Object.getPrototypeOf(r)):Object.create(Object.getPrototypeOf(r));e.set(r,s);let M=Object.getOwnPropertyDescriptors(r);for(let y of Reflect.ownKeys(M)){let w=M[y];w.get||w.set?Object.defineProperty(s,y,w):Object.defineProperty(s,y,{...w,value:n(w.value)})}return s}return n(t)}o();function Ut(t,e,n={}){return Ht(Ft(t,n),Ft(e,n),n)}function Ht(t,e,n){return K(t)?oe(t,e,n):re(t,e,n)}function re(t,e,n){if(!nt(e))return e;let r=Object.getOwnPropertyDescriptors(e);return Reflect.ownKeys(e).forEach(s=>{(nt(t[s])||K(t[s]))&&(nt(e[s])||K(e[s]))?t[s]=Ht(t[s],e[s],n):Object.defineProperty(t,s,r[s])}),t}function oe(t,e,n){let{mergeStrategy:r="replace"}=n;if(K(e))switch(r){case"merge":return t.concat(e);case"replace":return e;default:return e}return e}function Ft(t,e){let{deepClone:n=!0}=e;return n?at(t):t}o();var dt=class extends Error{constructor(e,n="Utils"){super(e),this.name=n}};function T(t,e){throw new dt(`[${t}] ${e}`)}function Zt(t,e){let n=Rt(t)?new dt(`[${t}] ${e}`,"UtilsWarn"):t;console.warn(n)}function bn(...t){console.warn(...t)}function $n(...t){console.error(...t)}var Mn=({from:t,replacement:e,version:n,type:r="API"})=>{Zt(`${r}`,`${t} is about to be deprecated in version ${n}, please use ${e} instead.`)};function wn(t,e,n,r){let s=`Invalid params: type check failed for params "${e}". Expected ${n}, got ${Mt(r)} with value ${r}.`;T(t,s)}function On(t,e,n,r){let s=`Invalid params: type check failed for params "${e}". Expected ${n}, got ${Mt(r)} with value ${r}.`;Zt(t,s)}o();var lt=(t,e,...n)=>{if(!e)return;let r=n.length===0?"":n.length===1?n[0]:n;console[t](`[Log] ${e}:`,r)},gt=(t,...e)=>{lt("info",t,...e)};gt.info=(t,...e)=>{lt("info",t,...e)};gt.error=(t,...e)=>{lt("error",t,...e)};gt.warn=(t,...e)=>{lt("warn",t,...e)};typeof globalThis<"u"&&(globalThis.log=gt);o();function ie(t,e){let{decode:n=!0}=e||{},r={};t.startsWith("?")&&(t=t.slice(1)),t.includes("?")&&(t=t.slice(t.indexOf("?")+1));let s=t.split("&").filter(Boolean);for(let M of s){let[y,w]=M.split("=");r[y]=n?decodeURIComponent(w):w}return r}function Wt(t,e){let{encode:n=!0}=e||{},r=[];for(let s in t){let M=t[s];r.push(`${s}=${n?encodeURIComponent(M):M}`)}return r.join("&")}function se(t,e,n){let r=Ut({encode:!0},{...n}),s=Wt(e,r);return t.includes("?")?t.endsWith("?")||t.endsWith("&")?`${t}${s}`:`${t}&${s}`:`${t}?${s}`}var Tn={parse:ie,stringify:Wt,appendQueryString:se};o();function Rn(t,e=500){let n=null;return function(...r){if(st(n))return n=Date.now(),t.apply(this,r);let s=Date.now();if(s-n>=e)return n=s,t.apply(this,r)}}o();function In(t){return!st(t)&&/^[\dA-Z\u4E00-\u9FA5]+$/i.test(t)}function Nn(t){return!st(t)&&/^[A-Z\u4E00-\u9FA5]+$/i.test(t)}function _n(t){return!st(t)&&/^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(t)}function Ln(t){return/^[\dA-Z_]+$/.test(t)}function zt(t,e,n={}){let{includeProto:r=!1,includeSymbols:s=!0,includeNonEnum:M=!1}=n,y={};return nt(t)&&it(e).forEach(b=>{Et(b)&&!s||!(r?b in t:Object.hasOwn(t,b))||!M&&(r?ae(t,b):Object.getOwnPropertyDescriptor(t,b))?.enumerable===!1||(y[b]=at(t[b]))}),y}function ae(t,e){let n=t;for(;n!==null;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function cr(t,e){if(!nt(t))return{};let n=at(t),r=it(e),s=Object.keys(n).filter(M=>!r.includes(M));return zt(n,s)}o();o();function xr(t,e){return(!z(t)||t<=0)&&T("generateRandomArray","num \u5FC5\u987B\u5927\u4E8E0"),pt(e)||T("generateRandomArray","cb \u5FC5\u987B\u662F\u51FD\u6570"),Array.from({length:t}).fill(0).map((n,r)=>e(n,r))}o();function Mr(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}o();var B=$t(St(),1),Vt=$t(Kt(),1);o();o();function Z(t){return t[Math.floor(Math.random()*t.length)]}function R(t={}){z(t)&&(t={max:t});let{min:e=1,max:n=Z(ce())}=t;ue(e,n);let r=Math.ceil(e),s=Math.floor(n);return Math.floor(Math.random()*(s-r+1)+r)}function ue(t,e){let n=Math.ceil(t),r=Math.floor(e);Number.isSafeInteger(n)||T("getRandomInt",`The minimum value Math.ceil(${t}) should be a safe integer`),Number.isSafeInteger(r)||T("getRandomInt",`The maximum value Math.floor(${e}) should be a safe integer`),r<n&&(e>=t&&T("getRandomInt",`No integer value found between ${t} and ${e}`),T("getRandomInt",`The maximum value ${e} should be greater than the minimum value ${t}`))}function ce(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((t,e)=>{let n=Number.MAX_SAFE_INTEGER.toString().slice(0,e+1);return Number(n)})}B.default.extend(Vt.default);function vt(t={}){let{start:e="1800-01-01 00:00:00",end:n=(0,B.default)().format("YYYY-MM-DD HH:mm:ss"),format:r="YYYY-MM-DD HH:mm:ss"}=t;(!(0,B.default)(e).isValid()||!(0,B.default)(n).isValid())&&T("generateRandomDate","start end \u53C2\u6570\u5FC5\u987B\u662F\u5408\u6CD5\u7684\u65F6\u95F4\u683C\u5F0F");let s=(0,B.default)(e).year(),M=(0,B.default)(n).year(),y=R({min:s,max:M}),w=R({min:1,max:12}),b=R({min:1,max:31}),j=R(23),G=R(59),_=R(59),U=(0,B.default)(`${y}-${w}-${b} ${j}:${G}:${_}`);return U.isBefore((0,B.default)(e))||U.isAfter((0,B.default)(n))?vt(t):U.format(r)}o();o();function V(t={}){let e=me(t),n=pe(e);de(n);let{length:r}=e;le(r.min,r.max);let s=R(r),M=e.prefix||"";for(let y=0;y<s;y++)M+=n.charAt(Math.floor(Math.random()*n.length));return M+(e.suffix||"")}var fe=16,Tt=1;function me(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:fe,min:Tt,...t.length},extra:e?[]:[...new Set(it(t.extra||[]))]}}function pe(t){let e="";return t.lowerCase&&(e+="abcdefghijklmnopqrstuvwxyz"),t.upperCase&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.number&&(e+="0123456789"),e+=it(t.extra).join(""),e}function de(t){t.length===0&&T("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function le(t,e){Number.isInteger(t)||T("getRandomString","min must be an integer"),Number.isInteger(e)||T("getRandomString","max must be an integer"),t<Tt&&T("getRandomString",`Minimum length cannot be less than ${Tt}`),e<t&&T("getRandomString","Maximum length cannot be less than minimum length")}function ge(){let t=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],e=`${V(1)}${V({length:R({max:30,min:1})})}${V(1)}@${Z(t)}`;return/\.{2,}/.test(e)?ge():e}o();function qr(t={}){z(t)&&(t={max:t});let{min:e=0,max:n=1,fractionDigits:r=2}=t;if(e===n)return e;if(e>n)throw new Error(`\u6700\u5927\u503C ${n} \u5E94\u5927\u4E8E\u6700\u5C0F\u503C ${e}`);return Math.random()*(n-e)+e}o();o();function kt(t,e){(!z(t)||t<=0)&&T("generateRandomStringFromSource","num \u5FC5\u987B\u5927\u4E8E0"),(!K(e)||e.length===0)&&T("generateRandomStringFromSource","source \u4E0D\u80FD\u4E3A\u7A7A\u6570\u7EC4");let n="";for(let r=0;r<t;r++)n+=Z(e);return n}function so(){let t=R({min:1e5,max:999999}),e=[0,1,2,3,4,5,6,7,8,9];return[t,vt({format:"YYYYMMDD"}),kt(3,e),kt(1,[...e,"X","x"])].join("")}o();function mo(){return Z(["13","14","15","16","17","18","19"])+R(999999999).toString().padEnd(9,"0")}o();function xo(){let t=["http://","https://"],e=[".com",".net",".org",".cn",".top"],n=[`?name=${V({length:{min:4,max:8}})}`,`?id=${R()}`,`?page=${V({length:{min:2,max:4}})}`,`?query=${V({length:{min:5,max:6}})}`,`?search=${V({length:{min:1,max:4}})}`,`?token=${V({length:{min:16,max:16}})}`];return`${Z(t)}${V({length:{min:5,max:25}})}${Z(e)}${Z(n)}`}o();o();o();o();function _o(t){return/^\d+$/.test(t)}function Lo(t){return/^[A-Z]+$/i.test(t)}function Fo(t){return/^[A-Z]+$/.test(t)}function Uo(t){return/^[\dA-Z]+$/.test(t)}function Ho(t){return/^[\dA-Z\u4E00-\u9FA5]+$/.test(t)}function Zo(t){return/^[a-z]+$/.test(t)}function Wo(t){return/^[\da-z]+$/.test(t)}function zo(t){return/^[\da-z\u4E00-\u9FA5]+$/.test(t)}function Ko(t){return/^[\u4E00-\u9FA5]+$/.test(t)}o();function qo(t){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(t)}function Bo(t){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function Go(t){return/^(?:0|[1-9]\d*)\.\d+$/.test(t)}function Jo(t){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function Qo(t){return/^-(?:0|[1-9]\d*)\.\d+$/.test(t)}o();function ni(t){return/^-?(?:0|[1-9]\d*)$/.test(t)}function ri(t){return/^[1-9]\d*$/.test(t)}function oi(t){return/^(?:0|[1-9]\d*)$/.test(t)&&!Object.is(t,-0)}function ii(t){return/^-[1-9]\d*$/.test(t)}function si(t){return/^-(?:0|[1-9]\d*)$/.test(t)||Object.is(t,-0)}o();var Xt=$t(St(),1);function ci(t){return/^1[3-9]\d{9}$/.test(t)}function fi(t){return/^https?:\/\/\S+$/i.test(t)}function mi(t){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t)}function pi(t){return t===""}function he(t,e="YYYY-MM-DD HH:mm:ss"){return(0,Xt.default)(t,e,!0).isValid()}function di(t){return/^[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)&&he(t.slice(6,14),"YYYYMMDD")}export{tn as base64Decode,Qe as base64Encode,it as castArray,rn as compose,on as composeRight,un as debounce,Zt as debugWarn,On as debugWarnInvalidTypeMessage,Je as decimalToBinary,at as deepClone,Ut as deepMerge,Mn as deprecated,$n as error,xr as generateRandomArray,Mr as generateRandomColor,vt as generateRandomDate,ge as generateRandomEmail,qr as generateRandomFloat,so as generateRandomIdCard,mo as generateRandomMobilePhone,kt as generateRandomStringFromSource,R as getRandomInt,Z as getRandomItem,V as getRandomString,xo as getRandomUrl,Ce as hasChanged,K as isArray,je as isBoolean,Ko as isChineseString,It as isDate,he as isDateString,Ee as isDef,mi as isEmail,pi as isEmptyString,Lo as isEnglishAphabet,qo as isFloat,pt as isFunction,di as isIdCard,ni as isInteger,Zo as isLowerCase,Wo as isLowerCaseAndNumber,zo as isLowerCaseAndNumberAndChinese,Ct as isMap,ci as isMobilePhone,Jo as isNegativeFloat,ii as isNegativeInteger,Go as isNonNegativeFloat,oi as isNonNegativeInteger,Qo as isNonPositiveFloat,si as isNonPositiveInteger,Ye as isNull,z as isNumber,_o as isNumberOrNumberString,Se as isObject,mt as isObjectLike,nt as isPlainObject,Bo as isPositiveFloat,ri as isPositiveInteger,_t as isPromise,Nt as isRegExp,Pt as isSet,Rt as isString,Et as isSymbol,st as isUndef,Re as isUndefined,Fo as isUpperCase,Uo as isUpperCaseAndNumber,Ho as isUpperCaseAndNumberAndChinese,fi as isUrl,ne as objectToString,cr as omit,zt as pick,Tn as qs,Rn as throttle,T as throwError,wn as throwErrorInvalidTypeMessage,ot as toTypeString,Mt as toTypeValue,Nn as validatorChineseOrEnglish,In as validatorChineseOrEnglishOrNumber,_n as validatorUppercaseOrNumbersOrSpecial,Ln as validatorUppercaseOrNumbersOrUnderline,bn as warn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* @ts-self-types="./esm-bundler.d.ts" */
|
|
2
|
-
function ft(t){let e=typeof t;return t!==null&&(e==="object"||e==="function")}function w(t){return t!==null&&typeof t=="object"}var q=Object.prototype.toString,b=t=>q.call(t),R=t=>b(t).slice(8,-1),P=t=>typeof t=="string",u=t=>typeof t=="number"&&Number.isFinite(t),dt=t=>typeof t=="boolean",xt=t=>t===null,bt=t=>t===void 0,N=t=>typeof t=="symbol",g=Array.isArray,$=t=>typeof t=="function",C=t=>b(t)==="[object Map]",F=t=>b(t)==="[object Set]",v=t=>b(t)==="[object Date]",Y=t=>b(t)==="[object RegExp]",U=t=>w(t)&&$(t?.then)&&$(t?.catch),h=t=>t==null,yt=t=>t!=null,ht=(t,e)=>t!==e;function x(t){return b(t)==="[object Object]"}function y(t){return g(t)?t:[t]}function It(t){let e=[],n,r="";for(;t>0;)n=Math.floor(t%2),e.push(n),t=Math.floor(t/2);for(;e.length>0;)r+=e.pop().toString();return r}var _="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Pt(t){let e="",n="";for(let o=0;o<t.length;o++)n+=t[o].charCodeAt(0).toString(2).padStart(8,"0");for(let o=0;o<n.length;o+=6)e+=_[parseInt(n.slice(o,o+6).padEnd(6,"0"),2)];let r=e.length%4;return r!==0&&(e+="=".repeat(4-r)),e}function Nt(t){let e="",n="";for(let r=0;r<t.length&&t[r]!=="=";r++)n+=_.indexOf(t[r]).toString(2).padStart(6,"0");for(let r=0;r<n.length;r+=8){let o=parseInt(n.slice(r,r+8),2);o&&(e+=String.fromCharCode(o))}return e}function Ft(...t){return t.reduce((e,n)=>function(...r){return n(e(...r))})}function vt(...t){return t.reduce((e,n)=>function(...r){return e(n(...r))})}function Ut(t,e=500){let n=null;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>{t.apply(this,r)},e)}}function O(t){let e=new WeakMap;function n(r){if(!w(r))return r;if(v(r))return new Date(r);if(Y(r))return new RegExp(r);if(U(r))return r;if(e.has(r))return e.get(r);if(C(r)){let i=new Map;return e.set(r,i),r.forEach((c,f)=>i.set(n(f),n(c))),i}if(F(r)){let i=new Set;return e.set(r,i),r.forEach(c=>i.add(n(c))),i}let o=g(r)?Object.setPrototypeOf([],Object.getPrototypeOf(r)):Object.create(Object.getPrototypeOf(r));e.set(r,o);let m=Object.getOwnPropertyDescriptors(r);for(let i of Reflect.ownKeys(m)){let c=m[i];c.get||c.set?Object.defineProperty(o,i,c):Object.defineProperty(o,i,{...c,value:n(c.value)})}return o}return n(t)}function K(t,e,n={}){return z(L(t,n),L(e,n),n)}function z(t,e,n){return g(t)?V(t,e,n):B(t,e,n)}function B(t,e,n){if(!x(e))return e;let r=Object.getOwnPropertyDescriptors(e);return Reflect.ownKeys(e).forEach(o=>{(x(t[o])||g(t[o]))&&(x(e[o])||g(e[o]))?t[o]=z(t[o],e[o],n):Object.defineProperty(t,o,r[o])}),t}function V(t,e,n){let{mergeStrategy:r="replace"}=n;if(g(e))switch(r){case"merge":return t.concat(e);case"replace":return e;default:return e}return e}function L(t,e){let{deepClone:n=!0}=e;return n?O(t):t}var A=class extends Error{constructor(e,n="Utils"){super(e),this.name=n}};function s(t,e){throw new A(`[${t}] ${e}`)}function W(t,e){let n=P(t)?new A(`[${t}] ${e}`,"UtilsWarn"):t;console.warn(n)}function Gt(...t){console.warn(...t)}function qt(...t){console.error(...t)}var Bt=({from:t,replacement:e,version:n,type:r="API"})=>{W(`${r}`,`${t} is about to be deprecated in version ${n}, please use ${e} instead.`)};function Vt(t,e,n,r){let o=`Invalid params: type check failed for params "${e}". Expected ${n}, got ${R(r)} with value ${r}.`;s(t,o)}function Xt(t,e,n,r){let o=`Invalid params: type check failed for params "${e}". Expected ${n}, got ${R(r)} with value ${r}.`;W(t,o)}var S=(t,e,...n)=>{if(!e)return;let r=n.length===0?"":n.length===1?n[0]:n;console[t](`[Log] ${e}:`,r)},j=(t,...e)=>{S("info",t,...e)};j.info=(t,...e)=>{S("info",t,...e)};j.error=(t,...e)=>{S("error",t,...e)};j.warn=(t,...e)=>{S("warn",t,...e)};typeof globalThis<"u"&&(globalThis.log=j);function X(t,e){let{decode:n=!0}=e||{},r={};t.startsWith("?")&&(t=t.slice(1)),t.includes("?")&&(t=t.slice(t.indexOf("?")+1));let o=t.split("&").filter(Boolean);for(let m of o){let[i,c]=m.split("=");r[i]=n?decodeURIComponent(c):c}return r}function H(t,e){let{encode:n=!0}=e||{},r=[];for(let o in t){let m=t[o];r.push(`${o}=${n?encodeURIComponent(m):m}`)}return r.join("&")}function Q(t,e,n){let r=K({encode:!0},{...n}),o=H(e,r);return t.includes("?")?t.endsWith("?")||t.endsWith("&")?`${t}${o}`:`${t}&${o}`:`${t}?${o}`}var te={parse:X,stringify:H,appendQueryString:Q};function re(t,e=500){let n=null;return function(...r){if(h(n))return n=Date.now(),t.apply(this,r);let o=Date.now();if(o-n>=e)return n=o,t.apply(this,r)}}function se(t){return!h(t)&&/^[\dA-Z\u4E00-\u9FA5]+$/i.test(t)}function ae(t){return!h(t)&&/^[A-Z\u4E00-\u9FA5]+$/i.test(t)}function me(t){return!h(t)&&/^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(t)}function ce(t){return/^[\dA-Z_]+$/.test(t)}function Z(t,e,n={}){let{includeProto:r=!1,includeSymbols:o=!0,includeNonEnum:m=!1}=n,i={};return x(t)&&y(e).forEach(f=>{N(f)&&!o||!(r?f in t:Object.hasOwn(t,f))||!m&&(r?J(t,f):Object.getOwnPropertyDescriptor(t,f))?.enumerable===!1||(i[f]=O(t[f]))}),i}function J(t,e){let n=t;for(;n!==null;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function Ee(t,e){if(!x(t))return{};let n=O(t),r=y(e),o=Object.keys(n).filter(m=>!r.includes(m));return Z(n,o)}function ve(t,e){return(!u(t)||t<=0)&&s("generateRandomArray","num \u5FC5\u987B\u5927\u4E8E0"),$(e)||s("generateRandomArray","cb \u5FC5\u987B\u662F\u51FD\u6570"),Array.from({length:t}).fill(0).map((n,r)=>e(n,r))}function Ue(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}import d from"dayjs";import nt from"dayjs/plugin/customParseFormat.js";function p(t){return t[Math.floor(Math.random()*t.length)]}function a(t={}){u(t)&&(t={max:t});let{min:e=1,max:n=p(et())}=t;tt(e,n);let r=Math.ceil(e),o=Math.floor(n);return Math.floor(Math.random()*(o-r+1)+r)}function tt(t,e){let n=Math.ceil(t),r=Math.floor(e);Number.isSafeInteger(n)||s("getRandomInt",`The minimum value Math.ceil(${t}) should be a safe integer`),Number.isSafeInteger(r)||s("getRandomInt",`The maximum value Math.floor(${e}) should be a safe integer`),r<n&&(e>=t&&s("getRandomInt",`No integer value found between ${t} and ${e}`),s("getRandomInt",`The maximum value ${e} should be greater than the minimum value ${t}`))}function et(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((t,e)=>{let n=Number.MAX_SAFE_INTEGER.toString().slice(0,e+1);return Number(n)})}d.extend(nt);function T(t={}){let{start:e="1800-01-01 00:00:00",end:n=d().format("YYYY-MM-DD HH:mm:ss"),format:r="YYYY-MM-DD HH:mm:ss"}=t;(!d(e).isValid()||!d(n).isValid())&&s("generateRandomDate","start end \u53C2\u6570\u5FC5\u987B\u662F\u5408\u6CD5\u7684\u65F6\u95F4\u683C\u5F0F");let o=d(e).year(),m=d(n).year(),i=a({min:o,max:m}),c=a({min:1,max:12}),f=a({min:1,max:31}),D=a(23),I=a(59),G=a(59),M=d(`${i}-${c}-${f} ${D}:${I}:${G}`);return M.isBefore(d(e))||M.isAfter(d(n))?T(t):M.format(r)}function l(t={}){let e=ot(t),n=it(e);st(n);let{length:r}=e;at(r.min,r.max);let o=a(r),m=e.prefix||"";for(let i=0;i<o;i++)m+=n.charAt(Math.floor(Math.random()*n.length));return m+(e.suffix||"")}var rt=16,k=1;function ot(t){let e=u(t);return{lowerCase:!0,upperCase:!0,number:!0,...e?{}:t,length:e?{max:t,min:t}:u(t.length)?{max:t.length,min:t.length}:{max:rt,min:k,...t.length},extra:e?[]:[...new Set(y(t.extra||[]))]}}function it(t){let e="";return t.lowerCase&&(e+="abcdefghijklmnopqrstuvwxyz"),t.upperCase&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.number&&(e+="0123456789"),e+=y(t.extra).join(""),e}function st(t){t.length===0&&s("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function at(t,e){Number.isInteger(t)||s("getRandomString","min must be an integer"),Number.isInteger(e)||s("getRandomString","max must be an integer"),t<k&&s("getRandomString",`Minimum length cannot be less than ${k}`),e<t&&s("getRandomString","Maximum length cannot be less than minimum length")}function mt(){let t=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],e=`${l(1)}${l({length:a({max:30,min:1})})}${l(1)}@${p(t)}`;return/\.{2,}/.test(e)?mt():e}function mn(t={}){u(t)&&(t={max:t});let{min:e=0,max:n=1,fractionDigits:r=2}=t;if(e===n)return e;if(e>n)throw new Error(`\u6700\u5927\u503C ${n} \u5E94\u5927\u4E8E\u6700\u5C0F\u503C ${e}`);return Math.random()*(n-e)+e}function E(t,e){(!u(t)||t<=0)&&s("generateRandomStringFromSource","num \u5FC5\u987B\u5927\u4E8E0"),(!g(e)||e.length===0)&&s("generateRandomStringFromSource","source \u4E0D\u80FD\u4E3A\u7A7A\u6570\u7EC4");let n="";for(let r=0;r<t;r++)n+=p(e);return n}function bn(){let t=a({min:1e5,max:999999}),e=[0,1,2,3,4,5,6,7,8,9];return[t,T({format:"YYYYMMDD"}),E(3,e),E(1,[...e,"X","x"])].join("")}function wn(){return p(["13","14","15","16","17","18","19"])+a(999999999).toString().padEnd(9,"0")}function Mn(){let t=["http://","https://"],e=[".com",".net",".org",".cn",".top"],n=[`?name=${l({length:{min:4,max:8}})}`,`?id=${a()}`,`?page=${l({length:{min:2,max:4}})}`,`?query=${l({length:{min:5,max:6}})}`,`?search=${l({length:{min:1,max:4}})}`,`?token=${l({length:{min:16,max:16}})}`];return`${p(t)}${l({length:{min:5,max:25}})}${p(e)}${p(n)}`}function Kn(t){return/^\d+$/.test(t)}function zn(t){return/^[A-Z]+$/i.test(t)}function Wn(t){return/^[A-Z]+$/.test(t)}function Hn(t){return/^[\dA-Z]+$/.test(t)}function Zn(t){return/^[\dA-Z\u4E00-\u9FA5]+$/.test(t)}function Gn(t){return/^[a-z]+$/.test(t)}function qn(t){return/^[\da-z]+$/.test(t)}function Bn(t){return/^[\da-z\u4E00-\u9FA5]+$/.test(t)}function Vn(t){return/^[\u4E00-\u9FA5]+$/.test(t)}function Qn(t){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(t)}function Jn(t){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function tr(t){return/^(?:0|[1-9]\d*)\.\d+$/.test(t)}function er(t){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function nr(t){return/^-(?:0|[1-9]\d*)\.\d+$/.test(t)}function or(t){return/^-?(?:0|[1-9]\d*)$/.test(t)}function ir(t){return/^[1-9]\d*$/.test(t)}function sr(t){return/^(?:0|[1-9]\d*)$/.test(t)&&!Object.is(t,-0)}function ar(t){return/^-[1-9]\d*$/.test(t)}function mr(t){return/^-(?:0|[1-9]\d*)$/.test(t)||Object.is(t,-0)}import ct from"dayjs";function fr(t){return/^1[3-9]\d{9}$/.test(t)}function ur(t){return/^https?:\/\/\S+$/i.test(t)}function gr(t){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t)}function lr(t){return t===""}function pt(t,e="YYYY-MM-DD HH:mm:ss"){return ct(t,e,!0).isValid()}function dr(t){return/^[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)&&pt(t.slice(6,14),"YYYYMMDD")}export{Nt as base64Decode,Pt as base64Encode,y as castArray,Ft as compose,vt as composeRight,Ut as debounce,W as debugWarn,Xt as debugWarnInvalidTypeMessage,It as decimalToBinary,O as deepClone,K as deepMerge,Bt as deprecated,qt as error,ve as generateRandomArray,Ue as generateRandomColor,T as generateRandomDate,mt as generateRandomEmail,mn as generateRandomFloat,bn as generateRandomIdCard,wn as generateRandomMobilePhone,E as generateRandomStringFromSource,a as getRandomInt,p as getRandomItem,l as getRandomString,Mn as getRandomUrl,ht as hasChanged,g as isArray,dt as isBoolean,Vn as isChineseString,v as isDate,pt as isDateString,yt as isDef,gr as isEmail,lr as isEmptyString,zn as isEnglishAphabet,Qn as isFloat,$ as isFunction,dr as isIdCard,or as isInteger,Gn as isLowerCase,qn as isLowerCaseAndNumber,Bn as isLowerCaseAndNumberAndChinese,C as isMap,fr as isMobilePhone,er as isNegativeFloat,ar as isNegativeInteger,tr as isNonNegativeFloat,sr as isNonNegativeInteger,nr as isNonPositiveFloat,mr as isNonPositiveInteger,xt as isNull,u as isNumber,Kn as isNumberOrNumberString,ft as isObject,w as isObjectLike,x as isPlainObject,Jn as isPositiveFloat,ir as isPositiveInteger,U as isPromise,Y as isRegExp,F as isSet,P as isString,N as isSymbol,h as isUndef,bt as isUndefined,Wn as isUpperCase,Hn as isUpperCaseAndNumber,Zn as isUpperCaseAndNumberAndChinese,ur as isUrl,q as objectToString,Ee as omit,Z as pick,te as qs,re as throttle,s as throwError,Vt as throwErrorInvalidTypeMessage,b as toTypeString,R as toTypeValue,ae as validatorChineseOrEnglish,se as validatorChineseOrEnglishOrNumber,me as validatorUppercaseOrNumbersOrSpecial,ce as validatorUppercaseOrNumbersOrUnderline,Gt as warn};
|
|
2
|
+
function ge(e){let t=typeof e;return e!==null&&(t==="object"||t==="function")}function A(e){return e!==null&&typeof e=="object"}var V=Object.prototype.toString,h=e=>V.call(e),k=e=>h(e).slice(8,-1),C=e=>typeof e=="string",l=e=>typeof e=="number"&&Number.isFinite(e),he=e=>typeof e=="boolean",Oe=e=>e===null,we=e=>e===void 0,F=e=>typeof e=="symbol",d=Array.isArray,S=e=>typeof e=="function",v=e=>h(e)==="[object Map]",Y=e=>h(e)==="[object Set]",U=e=>h(e)==="[object Date]",K=e=>h(e)==="[object RegExp]",_=e=>A(e)&&S(e?.then)&&S(e?.catch),w=e=>e==null,$e=e=>e!=null,Ae=(e,t)=>e!==t;function y(e){return h(e)==="[object Object]"}function O(e){return d(e)?e:[e]}function _e(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 L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Le(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+=L[parseInt(r.slice(o,o+6).padEnd(6,"0"),2)];let n=t.length%4;return n!==0&&(t+="=".repeat(4-n)),t}function ze(e){let t="",r="";for(let n=0;n<e.length&&e[n]!=="=";n++)r+=L.indexOf(e[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let o=parseInt(r.slice(n,n+8),2);o&&(t+=String.fromCharCode(o))}return t}function Ze(...e){return e.reduce((t,r)=>function(...n){return r(t(...n))})}function Ge(...e){return e.reduce((t,r)=>function(...n){return t(r(...n))})}function Ve(e,t=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}function $(e){let t=new WeakMap;function r(n){if(!A(n))return n;if(U(n))return new Date(n);if(K(n))return new RegExp(n);if(_(n))return n;if(t.has(n))return t.get(n);if(v(n)){let a=new Map;return t.set(n,a),n.forEach((f,g)=>a.set(r(g),r(f))),a}if(Y(n)){let a=new Set;return t.set(n,a),n.forEach(f=>a.add(r(f))),a}let o=d(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));t.set(n,o);let p=Object.getOwnPropertyDescriptors(n);for(let a of Reflect.ownKeys(p)){let f=p[a];f.get||f.set?Object.defineProperty(o,a,f):Object.defineProperty(o,a,{...f,value:r(f.value)})}return o}return r(e)}function W(e,t,r={}){return H(z(e,r),z(t,r),r)}function H(e,t,r){return d(e)?Q(e,t,r):X(e,t,r)}function X(e,t,r){if(!y(t))return t;let n=Object.getOwnPropertyDescriptors(t);return Reflect.ownKeys(t).forEach(o=>{(y(e[o])||d(e[o]))&&(y(t[o])||d(t[o]))?e[o]=H(e[o],t[o],r):Object.defineProperty(e,o,n[o])}),e}function Q(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 z(e,t){let{deepClone:r=!0}=t;return r?$(e):e}var j=class extends Error{constructor(t,r="Utils"){super(t),this.name=r}};function m(e,t){throw new j(`[${e}] ${t}`)}function Z(e,t){let r=C(e)?new j(`[${e}] ${t}`,"UtilsWarn"):e;console.warn(r)}function at(...e){console.warn(...e)}function mt(...e){console.error(...e)}var ct=({from:e,replacement:t,version:r,type:n="API"})=>{Z(`${n}`,`${e} is about to be deprecated in version ${r}, please use ${t} instead.`)};function pt(e,t,r,n){let o=`Invalid params: type check failed for params "${t}". Expected ${r}, got ${k(n)} with value ${n}.`;m(e,o)}function ft(e,t,r,n){let o=`Invalid params: type check failed for params "${t}". Expected ${r}, got ${k(n)} with value ${n}.`;Z(e,o)}var R=(e,t,...r)=>{if(!t)return;let n=r.length===0?"":r.length===1?r[0]:r;console[e](`[Log] ${t}:`,n)},T=(e,...t)=>{R("info",e,...t)};T.info=(e,...t)=>{R("info",e,...t)};T.error=(e,...t)=>{R("error",e,...t)};T.warn=(e,...t)=>{R("warn",e,...t)};typeof globalThis<"u"&&(globalThis.log=T);function J(e,t){let{decode:r=!0}=t||{},n={};e.startsWith("?")&&(e=e.slice(1)),e.includes("?")&&(e=e.slice(e.indexOf("?")+1));let o=e.split("&").filter(Boolean);for(let p of o){let[a,f]=p.split("=");n[a]=r?decodeURIComponent(f):f}return n}function G(e,t){let{encode:r=!0}=t||{},n=[];for(let o in e){let p=e[o];n.push(`${o}=${r?encodeURIComponent(p):p}`)}return n.join("&")}function ee(e,t,r){let n=W({encode:!0},{...r}),o=G(t,n);return e.includes("?")?e.endsWith("?")||e.endsWith("&")?`${e}${o}`:`${e}&${o}`:`${e}?${o}`}var xt={parse:J,stringify:G,appendQueryString:ee};function Ot(e,t=500){let r=null;return function(...n){if(w(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 St(e){return!w(e)&&/^[\dA-Z\u4E00-\u9FA5]+$/i.test(e)}function jt(e){return!w(e)&&/^[A-Z\u4E00-\u9FA5]+$/i.test(e)}function Rt(e){return!w(e)&&/^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(e)}function Tt(e){return/^[\dA-Z_]+$/.test(e)}function q(e,t,r={}){let{includeProto:n=!1,includeSymbols:o=!0,includeNonEnum:p=!1}=r,a={};return y(e)&&O(t).forEach(g=>{F(g)&&!o||!(n?g in e:Object.hasOwn(e,g))||!p&&(n?te(e,g):Object.getOwnPropertyDescriptor(e,g))?.enumerable===!1||(a[g]=$(e[g]))}),a}function te(e,t){let r=e;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function Xt(e,t){if(!y(e))return{};let r=$(e),n=O(t),o=Object.keys(r).filter(p=>!n.includes(p));return q(r,o)}function sr(e,t){return(!l(e)||e<=0)&&m("generateRandomArray","num \u5FC5\u987B\u5927\u4E8E0"),S(t)||m("generateRandomArray","cb \u5FC5\u987B\u662F\u51FD\u6570"),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 b from"dayjs";import oe from"dayjs/plugin/customParseFormat.js";function u(e){return e[Math.floor(Math.random()*e.length)]}function c(e={}){l(e)&&(e={max:e});let{min:t=1,max:r=u(ne())}=e;re(t,r);let n=Math.ceil(t),o=Math.floor(r);return Math.floor(Math.random()*(o-n+1)+n)}function re(e,t){let r=Math.ceil(e),n=Math.floor(t);Number.isSafeInteger(r)||m("getRandomInt",`The minimum value Math.ceil(${e}) should be a safe integer`),Number.isSafeInteger(n)||m("getRandomInt",`The maximum value Math.floor(${t}) should be a safe integer`),n<r&&(t>=e&&m("getRandomInt",`No integer value found between ${e} and ${t}`),m("getRandomInt",`The maximum value ${t} should be greater than the minimum value ${e}`))}function ne(){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)})}b.extend(oe);function E(e={}){let{start:t="1800-01-01 00:00:00",end:r=b().format("YYYY-MM-DD HH:mm:ss"),format:n="YYYY-MM-DD HH:mm:ss"}=e;(!b(t).isValid()||!b(r).isValid())&&m("generateRandomDate","start end \u53C2\u6570\u5FC5\u987B\u662F\u5408\u6CD5\u7684\u65F6\u95F4\u683C\u5F0F");let o=b(t).year(),p=b(r).year(),a=c({min:o,max:p}),f=c({min:1,max:12}),g=c({min:1,max:31}),I=c(23),N=c(59),B=c(59),M=b(`${a}-${f}-${g} ${I}:${N}:${B}`);return M.isBefore(b(t))||M.isAfter(b(r))?E(e):M.format(n)}function x(e={}){let t=se(e),r=ae(t);me(r);let{length:n}=t;ce(n.min,n.max);let o=c(n),p=t.prefix||"";for(let a=0;a<o;a++)p+=r.charAt(Math.floor(Math.random()*r.length));return p+(t.suffix||"")}var ie=16,P=1;function se(e){let t=l(e);return{lowerCase:!0,upperCase:!0,number:!0,...t?{}:e,length:t?{max:e,min:e}:l(e.length)?{max:e.length,min:e.length}:{max:ie,min:P,...e.length},extra:t?[]:[...new Set(O(e.extra||[]))]}}function ae(e){let t="";return e.lowerCase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.upperCase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.number&&(t+="0123456789"),t+=O(e.extra).join(""),t}function me(e){e.length===0&&m("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function ce(e,t){Number.isInteger(e)||m("getRandomString","min must be an integer"),Number.isInteger(t)||m("getRandomString","max must be an integer"),e<P&&m("getRandomString",`Minimum length cannot be less than ${P}`),t<e&&m("getRandomString","Maximum length cannot be less than minimum length")}function pe(){let e=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],t=`${x(1)}${x({length:c({max:30,min:1})})}${x(1)}@${u(e)}`;return/\.{2,}/.test(t)?pe():t}function vr(e={}){l(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(`\u6700\u5927\u503C ${r} \u5E94\u5927\u4E8E\u6700\u5C0F\u503C ${t}`);return Math.random()*(r-t)+t}function D(e,t){(!l(e)||e<=0)&&m("generateRandomStringFromSource","num \u5FC5\u987B\u5927\u4E8E0"),(!d(t)||t.length===0)&&m("generateRandomStringFromSource","source \u4E0D\u80FD\u4E3A\u7A7A\u6570\u7EC4");let r="";for(let n=0;n<e;n++)r+=u(t);return r}function qr(){let e=c({min:1e5,max:999999}),t=[0,1,2,3,4,5,6,7,8,9];return[e,E({format:"YYYYMMDD"}),D(3,t),D(1,[...t,"X","x"])].join("")}function Jr(){return u(["13","14","15","16","17","18","19"])+c(999999999).toString().padEnd(9,"0")}function sn(){let e=["http://","https://"],t=[".com",".net",".org",".cn",".top"],r=[`?name=${x({length:{min:4,max:8}})}`,`?id=${c()}`,`?page=${x({length:{min:2,max:4}})}`,`?query=${x({length:{min:5,max:6}})}`,`?search=${x({length:{min:1,max:4}})}`,`?token=${x({length:{min:16,max:16}})}`];return`${u(e)}${x({length:{min:5,max:25}})}${u(t)}${u(r)}`}function Rn(e){return/^\d+$/.test(e)}function Tn(e){return/^[A-Z]+$/i.test(e)}function Mn(e){return/^[A-Z]+$/.test(e)}function kn(e){return/^[\dA-Z]+$/.test(e)}function En(e){return/^[\dA-Z\u4E00-\u9FA5]+$/.test(e)}function Pn(e){return/^[a-z]+$/.test(e)}function Dn(e){return/^[\da-z]+$/.test(e)}function In(e){return/^[\da-z\u4E00-\u9FA5]+$/.test(e)}function Nn(e){return/^[\u4E00-\u9FA5]+$/.test(e)}function vn(e){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(e)}function Yn(e){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function Un(e){return/^(?:0|[1-9]\d*)\.\d+$/.test(e)}function Kn(e){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function _n(e){return/^-(?:0|[1-9]\d*)\.\d+$/.test(e)}function Wn(e){return/^-?(?:0|[1-9]\d*)$/.test(e)}function Hn(e){return/^[1-9]\d*$/.test(e)}function Zn(e){return/^(?:0|[1-9]\d*)$/.test(e)&&!Object.is(e,-0)}function Gn(e){return/^-[1-9]\d*$/.test(e)}function qn(e){return/^-(?:0|[1-9]\d*)$/.test(e)||Object.is(e,-0)}import fe from"dayjs";function Qn(e){return/^1[3-9]\d{9}$/.test(e)}function Jn(e){return/^https?:\/\/\S+$/i.test(e)}function eo(e){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(e)}function to(e){return e===""}function ue(e,t="YYYY-MM-DD HH:mm:ss"){return fe(e,t,!0).isValid()}function ro(e){return/^[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)&&ue(e.slice(6,14),"YYYYMMDD")}export{ze as base64Decode,Le as base64Encode,O as castArray,Ze as compose,Ge as composeRight,Ve as debounce,Z as debugWarn,ft as debugWarnInvalidTypeMessage,_e as decimalToBinary,$ as deepClone,W as deepMerge,ct as deprecated,mt as error,sr as generateRandomArray,cr as generateRandomColor,E as generateRandomDate,pe as generateRandomEmail,vr as generateRandomFloat,qr as generateRandomIdCard,Jr as generateRandomMobilePhone,D as generateRandomStringFromSource,c as getRandomInt,u as getRandomItem,x as getRandomString,sn as getRandomUrl,Ae as hasChanged,d as isArray,he as isBoolean,Nn as isChineseString,U as isDate,ue as isDateString,$e as isDef,eo as isEmail,to as isEmptyString,Tn as isEnglishAphabet,vn as isFloat,S as isFunction,ro as isIdCard,Wn as isInteger,Pn as isLowerCase,Dn as isLowerCaseAndNumber,In as isLowerCaseAndNumberAndChinese,v as isMap,Qn as isMobilePhone,Kn as isNegativeFloat,Gn as isNegativeInteger,Un as isNonNegativeFloat,Zn as isNonNegativeInteger,_n as isNonPositiveFloat,qn as isNonPositiveInteger,Oe as isNull,l as isNumber,Rn as isNumberOrNumberString,ge as isObject,A as isObjectLike,y as isPlainObject,Yn as isPositiveFloat,Hn as isPositiveInteger,_ as isPromise,K as isRegExp,Y as isSet,C as isString,F as isSymbol,w as isUndef,we as isUndefined,Mn as isUpperCase,kn as isUpperCaseAndNumber,En as isUpperCaseAndNumberAndChinese,Jn as isUrl,V as objectToString,Xt as omit,q as pick,xt as qs,Ot as throttle,m as throwError,pt as throwErrorInvalidTypeMessage,h as toTypeString,k as toTypeValue,jt as validatorChineseOrEnglish,St as validatorChineseOrEnglishOrNumber,Rt as validatorUppercaseOrNumbersOrSpecial,Tt as validatorUppercaseOrNumbersOrUnderline,at as warn};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lntvow/utils",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.24",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "TypeScript utilities",
|
|
6
6
|
"keywords": [
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@commitlint/cli": "^19.8.1",
|
|
33
33
|
"@commitlint/config-conventional": "^19.8.1",
|
|
34
|
-
"@lntvow/eslint-config": "^9.25.
|
|
34
|
+
"@lntvow/eslint-config": "^9.25.1",
|
|
35
35
|
"@types/node": "^24.0.3",
|
|
36
36
|
"@vitest/coverage-v8": "^3.2.4",
|
|
37
37
|
"@vitest/ui": "^3.2.4",
|