"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=(e,t)=>{const s=/^[0-9]+$/;if(!s.test(e)||!s.test(e))throw new Error("参数错啦!");const r=e.split(""),o=t.split(""),n=[];let c=0;for(;r.length||o.length;){const i=r.pop()||0,a=o.pop()||0;let l=Number(i)+Number(a)+c;l>9?(c=1,l%=10):c=0,n.unshift(l)}return n.join("")},_=(e,t)=>e.filter(function(s){const r=e.filter(o=>s.id===o[t]);return s.children=r.length>0?r:[],s[t]===0}),x=e=>{const t=e.split(","),s=t[0].match(/:(.*?);/),r=atob(t[1]);let o=r.length;const n=new Uint8Array(o);for(;o--;)n[o]=r.charCodeAt(o);return new Blob([n],{type:s[1]})},E=(e,t)=>{const s=e.split(","),r=s[0].match(/:(.*?);/),o=atob(s[1]);let n=o.length;const c=new Uint8Array(n);for(;n--;)c[n]=o.charCodeAt(n);return new File([c],t,{type:r[1]})},M=(e,t)=>{const s=new FileReader;s.readAsDataURL(e),s.onload=r=>{t(r.target.result)}},B=(e,t=!1)=>{const s=/([-_]+(\w))/g;return e.replace(s,(r,o)=>(t||(o=o.replace(/[-_]+/g,"")),o?o.toUpperCase():""))},y=e=>{const t=e.charCodeAt(0);return t>=65&&t<=90||t>=97&&t<=122},F=e=>{if(!y(e))throw new Error("参数错了!");return e.charAt(0).toUpperCase()+e.slice(1)},O=e=>{let t=2;if(e=e.toString().replace(/,/g,""),e=e.replace(/^0+/,""),e=="")return"零";if(isNaN(parseInt(e)))return"错误:金额不是合法的数值!";let s="";const r="";e.length>1&&(e.indexOf("-")==0&&(e=e.replace("-",""),s="负"),e.indexOf("+")==0&&(e=e.replace("+","")));let o="",n="",c,i,a,l,f,h,g;const u=typeof t>"u"||t==null||Number(t)<0||Number(t)>5,d=e.split(".");if(d.length>1){o=d[0],n=d[1],u&&(t=n.length>5?5:n.length);let p=+("0."+n);p*=Math.pow(10,t),p=Math.round(Math.abs(p)),p/=Math.pow(10,t);const b=p.toString().split(".");Number(b[0])==1&&(o=(Number(o)+1).toString()),b.length>1?n=b[1]:n=""}else o=e,n="",u&&(t=0);if(o.length>44)return"错误:数值过大!整数位长【"+o.length.toString()+"】超过了上限!";const m=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],A=["","拾","佰","仟"],T=["","万","亿","兆","京","垓","杼","穰","沟","涧","正"],v=["角","分","厘","毫","丝"];if(c="",Number(o)>0)for(i=0,a=0;a0&&(c+=m[0]),i=0,c+=m[Number(f)]+A[g]),g==0&&i<4&&(c+=T[h]);for(a=0;a{const s=new FileReader;s.readAsDataURL(e),s.onload=r=>{t(r.target.result)}},$=()=>{const e=navigator.userAgent.toLowerCase();return 0<=e.indexOf("msie")?{type:"IE",version:Number(e.match(/msie ([\d]+)/)[1])}:e.match(/trident\/.+?rv:(([\d.]+))/)?{type:"IE",version:11}:0<=e.indexOf("edge")?{type:"Edge",version:Number(e.match(/edge\/([\d]+)/)[1])}:0<=e.indexOf("firefox")?{type:"Firefox",version:Number(e.match(/firefox\/([\d]+)/)[1])}:0<=e.indexOf("chrome")?{type:"Chrome",version:Number(e.match(/chrome\/([\d]+)/)[1])}:0<=e.indexOf("opera")?{type:"Opera",version:Number(e.match(/opera.([\d]+)/)[1])}:0<=e.indexOf("Safari")?{type:"Safari",version:Number(e.match(/version\/([\d]+)/)[1])}:{type:e,version:-1}},D=(e,t,s)=>{let r=document.createElement("canvas");const o=r.getContext("2d"),n=new Image;n.crossOrigin="Anonymous",n.src=e+"?timeStamp="+new Date().getTime(),n.onload=function(){r.height=n.height,r.width=n.width,o.drawImage(n,0,0,n.width,n.height);const c=r.toDataURL(s||`image/${s||"png"}`);t&&t(c),r=null}},P=e=>{if(typeof e=="string")try{const t=JSON.parse(e);return!!(typeof t=="object"&&t)}catch{return!1}return!1},k=()=>!!window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i),L=e=>typeof e=="function"&&/native code/.test(e),U=e=>/^[1-9][0-9]{5}$/.test(e.toString()),I=e=>typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e>"u"||e===null,W=e=>I(e)||typeof e=="symbol",j=e=>/^(https:\/\/|http:\/\/|ftp:\/\/|rtsp:\/\/|mms:\/\/)?[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+[/=?%\-&_~`@[\]':+!]*([^<>""])*$/.test(e),Z=()=>!!window.navigator.userAgent.toLowerCase().match(/micromessenger/i),R=()=>{const e=window.navigator.userAgent.toLowerCase();return!!e.match(/micromessenger/i)&&!!e.match(/wxwork/i)},J=(e,t)=>{const s=/^[0-9]+$/;if(!s.test(e)||!s.test(t))throw new Error("参数错啦!");if(!e||!t||e==="0"||t==="0")return"0";const r=[],o=e.split("").reverse(),n=t.split("").reverse();for(let i=0;i=10&&(r[i]=a%10,r[i+1]+=a/10)}return r.reverse().join("")},X=e=>{const t=typeof e=="number"?String(e):e,s=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],r=["仟","佰","拾",""],o=["万","亿","兆","京","垓","秭","穰","沟","涧","正","载","极","恒河沙","阿僧祗","那由他","不可思议","无量","大数"];let n=Math.ceil(t.length/4),c=t.length%4||4,i;const a=[],l=[];let f="";for(;n>0;){if(f){i=t.slice(c,c+4),c+=4;for(let h=0;h0?(h===0?f+=o[n-1]+s[i[h]]+r[h]:f+="零"+s[i[h]]+r[h],a.length=0):f+=s[i[h]]+r[h],h===i.length-1&&n>1&&(f+=o[n-2]);else{h===0&&a.length>0&&l.length===0?(f+=o[n-1],a.length=0,a.push(i[h])):l.length>0?n==1?f+="":a.length=0:a.push(i[h]),h===i.length-1&&a.length===4&&n!==1&&(n===1?(l.length=0,a.length=0,f+=o[n-1]):l.push(i[h]));continue}--n}else{i=t.slice(0,c);const h=i.length;for(let g=0;g0?(f+="零"+s[i[g]]+r[4-h+g],g===h-1&&n>1&&(f+=o[n-2]),a.length=0):(f+=s[i[g]]+r[4-h+g],g===h-1&&n>1&&(f+=o[n-2]));else{if(h==1){f+=s[i[g]];break}a.push(i[g]);continue}}return f}},Y=(e,t,s,r)=>{const o=(e+"").replace(/[^0-9+-Ee.]/g,""),n=isFinite(+o)?+o:0,c=isFinite(+t)?Math.abs(t):2,i=typeof r>"u"?",":r,a=typeof s>"u"?".":s;let l;l=(c?((g,u)=>{const d=Math.pow(10,u);return""+Math.ceil(g*d)/d})(n,c):""+Math.round(n)).split(".");const h=/(-?\d+)(\d{3})/;for(;h.test(l[0]);)l[0]=l[0].replace(h,"$1"+i+"$2");return(l[1]||"").length{const s=e.split("."),r=t.split("."),o=Math.max(s.length,r.length);for(;s.lengthi)return 1;if(c{const s=/^[0-9]+$/;if(!s.test(e)||!s.test(t))throw new Error("参数错啦!");if(e===t)return"0";function r(l,f){return l.length=0;l--)a=parseInt(e[l])-c-parseInt(t[l]),a<0?(i=10+a+i,c=1):(i=a+i,c=0);return i=(o?"-":"")+i.replace(/^0+/,""),i},G=e=>{const t=[];return C(e,t),t},C=(e,t)=>{for(let s=0;s{if(!e||e&&typeof e!="string")throw new Error("请正确传入邮箱地址!");return(t||/^([a-zA-Z0-9]+[_|_|.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|_|.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/).test(e)},K=(e,t)=>{if(!e||e&&typeof e!="string")throw new Error("请正确传入统一征信码!");return(t||/^[^_IOZSVa-z\W]{2}\d{6}[^_IOZSVa-z\W]{10}$/g).test(e)},V={11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江 ",31:"上海",32:"江苏",33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",42:"湖北 ",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",51:"四川",52:"贵州",53:"云南",54:"西藏 ",61:"陕西",62:"甘肃",63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外 "},ee=e=>/(^\d{15}$)|(^\d{17}(\d|X)$)/.test(e),te=e=>{const t=e.substr(0,2);return V[t]==null},ne=e=>{const t=e.length;if(t===15){const s=/^(\d{6})(\d{2})(\d{2})(\d{2})(\d{3})$/,r=e.match(s),o=r&&r[2],n=r&&r[3],c=r&&r[4],i=new Date("19"+o+"/"+n+"/"+c);return w("19"+o,n,c,i)}if(t===18){const s=/^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$/,r=e.match(s),o=r&&r[2],n=r&&r[3],c=r&&r[4],i=new Date(o+"/"+n+"/"+c);return w(o,n,c,i)}return!1},w=(e,t,s,r)=>{const n=new Date().getFullYear();if(r.getFullYear()==e&&r.getMonth()+1==t&&r.getDate()==s){const c=n-e;return c>=3&&c<=150}return!1},re=e=>{if(e=N(e),e.length===18){const s=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2],r=["1","0","X","9","8","7","6","5","4","3","2"];let o=0,n;for(n=0;n<17;n++)o+=e.substr(n,1)*s[n];return r[o%11]==e.substr(17,1)}return!1},N=e=>{if(e.length===15){const t=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2],s=["1","0","X","9","8","7","6","5","4","3","2"];let r=0,o;for(e=e.substr(0,6)+"19"+e.substr(6,e.length-6),o=0;o<17;o++)r+=e.substr(o,1)*t[o];return e+=s[r%11],e}return e},oe=e=>{const t=N(e);return parseInt(t.charAt(16))===1||parseInt(t.charAt(16))===0},se=e=>ee(e)&&te(e)&&ne(e)&&re(e)&&oe(e),ie=(e,t)=>{if(!e||e&&typeof e!="string")throw new Error("请正确传入号码!");return(t||/^((0\d{2,3}(-)?\d{7,8})|(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8})$/).test(e)};exports.add=S;exports.arrayToTree=_;exports.base64ToBlob=x;exports.base64ToFile=E;exports.blobToBase64=M;exports.camelize=B;exports.capitalize=F;exports.cashNumberToChinese=O;exports.fileToBase64=z;exports.getExplorerInfo=$;exports.imageToBase64=D;exports.isEnglish=y;exports.isJson=P;exports.isMobile=k;exports.isNative=L;exports.isPostCode=U;exports.isPrimitive=W;exports.isStatic=I;exports.isUrl=j;exports.isWechat=Z;exports.isWorkWechat=R;exports.multiplication=J;exports.numberToChinese=X;exports.onThousandsSeprate=Y;exports.onVersionCompare=q;exports.subtraction=Q;exports.treeToArray=G;exports.validateEmail=H;exports.validateIdNumber=se;exports.validateIdentifyNumber=K;exports.validatePhoneNumber=ie;