const form={validation:function(a,b){for(let c of b){let b=c.name,d=c.rule,e=c.msg;if(b&&d&&0!==d.length&&e&&0!==e.length)for(let c=0,f=d.length;c=c.length)throw new Error("range\u503C\u4F20\u5165\u6709\u8BEF\uFF01")}catch(a){return"range\u503C\u4F20\u5165\u6709\u8BEF\uFF01"}i=!form._isRange(a[b],c[0],c[1]);break;case"minLength":i=!form._minLength(a[b],h);break;case"maxLength":i=!form._maxLength(a[b],h);break;default:}if(i)return g}}return""},_isNullOrEmpty:function(a){return!(null!==a&&""!==a&&a!==void 0)},_isMobile:function(a){return /^(?:13\d|14\d|15\d|16\d|17\d|18\d|19\d)\d{5}(\d{3}|\*{3})$/.test(a)},_isEmail:function(a){return /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(a)},_isCarNo:function(a){const b=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/,c=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;return 7===a.length?c.test(a):8===a.length&&b.test(a)},_isIdCard:function(a){let b=a;if(15==b.length)return this.__isValidityBrithBy15IdCard;if(18==b.length){let a=b.split("");return!!(this.__isValidityBrithBy18IdCard(b)&&this.__isTrueValidateCodeBy18IdCard(a))}return!1},__isTrueValidateCodeBy18IdCard:function(a){let b=0,c=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2,1];"x"==a[17].toLowerCase()&&(a[17]=10);for(let d=0;17>d;d++)b+=c[d]*a[d];let d=b%11;return!(a[17]!=[1,0,10,9,8,7,6,5,4,3,2][d])},__isValidityBrithBy18IdCard:function(a){let b=a.substring(6,10),c=a.substring(10,12),d=a.substring(12,14),e=new Date(b,parseFloat(c)-1,parseFloat(d));return e.getFullYear()==parseFloat(b)&&e.getMonth()==parseFloat(c)-1&&e.getDate()==parseFloat(d)},__isValidityBrithBy15IdCard:function(a){let b=a.substring(6,8),c=a.substring(8,10),d=a.substring(10,12),e=new Date(b,parseFloat(c)-1,parseFloat(d));return e.getYear()==parseFloat(b)&&e.getMonth()==parseFloat(c)-1&&e.getDate()==parseFloat(d)},_isAmount:function(a){return /^([0-9]*[.]?[0-9])[0-9]{0,1}$/.test(a)},_isNum:function(a){return /^[0-9]+$/.test(a)},_isChinese:function(a){let b=/.*[\u4e00-\u9fa5]+.*$/;return""!==a&&b.test(a)&&!form._isSpecial(a)&&!form._isEmoji(a)},_isEnglish:function(a){return /^[a-zA-Z]*$/.test(a)},_isEnAndNo:function(a){return /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,20}$/.test(a)},_isEnOrNo:function(a){let b=/.*[\u4e00-\u9fa5]+.*$/,c=!0;return(b.test(a)||form._isSpecial(a)||form._isEmoji(a))&&(c=!1),c},_isSpecial:function(a){let b=/[`~!@#$%^&*()_+<>?:"{},.\/;'[\]]/im,c=/[·!#¥(——):;“”‘、,|《。》?、【】[\]]/im;return!!(b.test(a)||c.test(a))},_isEmoji:function(a){return /\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/g.test(a)},_isDate:function(a){const b=/^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$/;return b.test(a)},_isUrl:function(a){return /^((https?|ftp|file):\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/.test(a)},_isSame:function(a,b){return a===b},_isRange:function(a,b,c){return!(b||0==b||c||0==c)||(b||0==b?c||0==c?a>=b&&a<=c:a>=b:a<=c)},_minLength:function(a,b){return a.length>=+b},_maxLength:function(a,b){return a.length<=+b}};module.exports={validation:form.validation};