util-helpers 4.21.0 → 4.21.1

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,2 +1,2 @@
1
- !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).utilHelpers={})}(this,(function(e){"use strict";var r=Object.prototype.toString,t="undefined"!=typeof Symbol?Symbol.prototype:void 0,n=Math.min,o=Number.isFinite,i="object"==typeof globalThis&&globalThis,a="object"==typeof global&&global,u="object"==typeof self&&self,c=Number.MAX_SAFE_INTEGER||9007199254740991,l=Number.MIN_SAFE_INTEGER||-9007199254740991,d="[object Number]",s="[object String]",f="[object Symbol]",v="[object Blob]";function p(e){return Array.isArray(e)}function h(e){var r=typeof e;return null!=e&&("object"===r||"function"===r)}function g(e){return"symbol"==typeof e||r.call(e)===f}var b=/^0b[01]+$/i,y=/^0o[0-7]+$/i,m=/^[-+]0x[0-9a-f]+$/i;function w(e){if("number"==typeof e)return e;if(g(e))return NaN;if(h(e)&&(e=Number(e)),"string"!=typeof e)return 0===e?e:+e;e=e.trim();var r=b.test(e);return r||y.test(e)?parseInt(e.slice(2),r?2:8):m.test(e)?NaN:+e}var x=t?t.toString:void 0;function N(e){if("string"==typeof e)return e;if(p(e))return"".concat(e.map(N));if(g(e))return x?x.call(e):"";var r=""+e;return"0"==r&&1/e==-1/0?"-0":r}function A(e){return null==e?"":N(e)}var E="undefined"!=typeof Blob;function C(e){return!!(E&&e instanceof Blob)||r.call(e)===v}var F=i&&globalThis.Object===Object&&globalThis,M=a&&global.Object===Object&&global,R=u&&self.Object===Object&&self,S=F||M||R||Function("return this")();function j(e){return"number"==typeof e||r.call(e)===d}function T(e){return j(e)&&S.isNaN(e)}function O(e){return h(e)&&"function"==typeof e.then}function P(e,r,t){void 0===t&&(t=0);var i=Math[e];if(r=w(r),t=n(function(e){var r=w(e);if(!r||r===1/0||r===-1/0)return r==r?r:0;var t=r%1;return t?r-t:r}(t),292),0===t||!function(e){return o?o(e):"number"==typeof e&&S.isFinite(e)}(r))return i(r);var a=A(r).split("e");return+((a=A(r=i(+(a[0]+"e"+(a[1]?+a[1]+t:t)))).split("e"))[0]+"e"+(a[1]?+a[1]-t:-t))}function B(e,r){return P("round",e,r)}var $=/^1[3456789]\d{9}$/;var k=/^(0\d{2,3}-)?([2-9]\d{6,7})(-\d{1,6})?$/;var L=/^\d{6}$/;var I=/^[1-9]\d{5}(19|20)?\d{2}((0[1-9])|(1[012]))(([0-2][1-9])|10|20|30|31)\d{3}(\d|X)?$/i;var U=/^[\da-z]+([-._]?[\da-z]+)*@[\da-z]+([-.]?[\da-z]+)*(\.[a-z]{2,})+$/i;var z=/^[1-9]\d{4,10}$/;var D=/^[a-z]([-_a-z0-9]{5,19})+$/i;var W=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([A-Z0-9]{4}[A-Z0-9挂学警港澳]{1})|([A-Z0-9]{5}[DF])|([DF][A-Z0-9]{5}))$/;var Z=/^[1-9]\d{9,20}$/,X=/^\d{8,30}$/;var H=/^[\dA-HJ-NPQRTUWXY]{2}\d{6}[\dA-HJ-NPQRTUWXY]{10}$/,q="0123456789ABCDEFGHJKLMNPQRTUWXY".split("");var _={disableWarning:!0};function G(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];_.disableWarning||console.warn.apply(void 0,e)}var Q=/[\d]/,V=/[a-z]/,Y=/[A-Z]/,J=/[\d|a-z]/gi;function K(e){return e.indexOf("\\x")>-1||e.indexOf("\\u")>-1}function ee(e,r){void 0===r&&(r={});var t=r.level,n=void 0===t?2:t,o=r.ignoreCase,i=void 0!==o&&o,a=r.special,u=void 0===a?"\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E":a,c=e;"string"!=typeof e&&(G("[validatePassword] value must be a string."),c="");var l,d=0,s=(l=c,Q.test(l)),f=function(e){return V.test(e)}(c),v=function(e){return Y.test(e)}(c),p=function(e,r){if(!r||!e)return!1;var t=e.replace(J,"");if(!t)return!1;var n=K(r)?new RegExp("[".concat(r,"]")):null;if(n)return n.test(t);var o=!1;return t.split("").some((function(e){return r.indexOf(e)>-1&&(o=!0),o})),o}(c,u),h=function(e,r){if(!e)return!1;var t=e.replace(J,"");if(!t)return!1;if(!r)return!0;var n=K(r)?new RegExp("[^".concat(r,"]")):null;if(n)return n.test(t);var o=!1;return t.split("").some((function(e){return-1===r.indexOf(e)&&(o=!0),o})),o}(c,u);return s&&(d+=1),i?(f||v)&&(d+=1):(f&&(d+=1),v&&(d+=1)),p&&(d+=1),{validated:d>=n&&!h,level:d,containes:{number:s,lowerCaseLetter:f,upperCaseLetter:v,specialCharacter:p,unallowableCharacter:h}}}var re=/^((e[\da-z])|(de)|(se)|(pe)|([khm][\da-z]))[\da-z]{7}$/i;var te="[一-龥]",ne=te+"+",oe="^"+te+"+$",ie="(?:"+te+"|"+"[麦-鿯]"+"|"+"[㐀-䶵]"+"|"+"[𠀀-𪛖]"+"|"+"[𪜀-𫜴]"+"|"+"[𫝀-𫠝]"+"|"+"[𫠠-𬺡]"+"|"+"[𬺰-𮯠]"+")",ae=ie+"+",ue="^"+ie+"+$",ce=RegExp.prototype.hasOwnProperty("unicode");var le=/^((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;var de=/^((([0-9A-F]{1,4}:){7}([0-9A-F]{1,4}|:))|(([0-9A-F]{1,4}:){6}(:[0-9A-F]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3})|:))|(([0-9A-F]{1,4}:){5}(((:[0-9A-F]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3})|:))|(([0-9A-F]{1,4}:){4}(((:[0-9A-F]{1,4}){1,3})|((:[0-9A-F]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(([0-9A-F]{1,4}:){3}(((:[0-9A-F]{1,4}){1,4})|((:[0-9A-F]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(([0-9A-F]{1,4}:){2}(((:[0-9A-F]{1,4}){1,5})|((:[0-9A-F]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(([0-9A-F]{1,4}:){1}(((:[0-9A-F]{1,4}){1,6})|((:[0-9A-F]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(:(((:[0-9A-F]{1,4}){1,7})|((:[0-9A-F]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:)))(%.+)?$/i;var se="localhost|(([^\\s:\\/]+?\\.)+?[^\\s:\\/]+)",fe=":\\d+",ve="\\/.*",pe="\\?.*",he=new RegExp("^".concat("[\\w-.]+:\\/\\/","(?:").concat("[-;:&=\\+\\$,\\w]+@",")?(?:").concat(se,")(?:").concat(fe,")?(?:").concat(ve,")*(?:").concat(pe,")?(?:").concat("#.*",")?$")),ge=new RegExp("^(?:".concat(se,")(?:").concat(fe,")?(?:").concat(ve,")*(?:").concat(pe,")?(?:").concat("#.*",")?$"));function be(e){var r=A(e);return he.test(r)||ge.test(r)}var ye=/^\d{15}$/;var me=/^[hm]{1}([0-9]{10}|[0-9]{8})$/i;var we=/^\d{8}$/i,xe=/^[\da-z]{10,12}$/i;var Ne=/^[A-Z]{6}[A-Z\d]{2}(?:[A-Z\d]{3})?$/;var Ae=function(){return Ae=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},Ae.apply(this,arguments)};function Ee(e,r,t,n){return new(t||(t=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function u(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var r;e.done?o(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(a,u)}c((n=n.apply(e,r||[])).next())}))}function Ce(e,r){var t,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(c){return function(u){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(t=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,n=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=r.call(e,a)}catch(e){u=[6,e],n=0}finally{t=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}function Fe(e){var r="function"==typeof Symbol&&Symbol.iterator,t=r&&e[r],n=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function Me(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var n,o,i=t.call(e),a=[];try{for(;(void 0===r||r-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a}function Re(e,r,t){if(t||2===arguments.length)for(var n,o=0,i=r.length;o<i;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return e.concat(n||Array.prototype.slice.call(r))}function Se(e){var t;return!function(e){return"string"==typeof e||r.call(e)===s}(e)?t=g(e)?Number.NaN:j(e)?e:Number(e):""===(t=e.trim())?t=Number(t):T(Number(t))&&(t=Number.NaN),T(t)?Number.NaN:t}function je(e){return/\d+\.?\d*e[+-]*\d+/i.test(e)}function Te(e,r){return void 0===r&&(r=12),+parseFloat(e.toPrecision(r))}function Oe(e){var r=e.toString().split(/e/i),t=(r[0].split(".")[1]||"").length-+(r[1]||0);return t>0?t:0}function Pe(e){var r=String(e);if(!je(r))return Number(r.replace(".",""));var t=Oe(e);return t>0?Te(+e*Math.pow(10,t)):+e}function Be(e){(+e>c||+e<l)&&G("".concat(e," is beyond boundary when transfer to integer, the results may not be accurate"))}function $e(e){var r=/^([+-])?(0+)([0-9.]+)$/.exec(e);return r?(r[1]||"")+("."===r[3][0]?"0"+r[3]:r[3]):e}"function"==typeof SuppressedError&&SuppressedError;var ke=/^[+-]?\d*\.?\d*$/;var Le,Ie,Ue,ze=["零","一","二","三","四","五","六","七","八","九"],De=["","十","百","千"],We=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],Ze=["","拾","佰","仟"];function Xe(e){for(var r="",t="",n=!1,o=0;e>0;){var i=e%10;0==i?n&&(n=!1,t=Le[i]+t):(n=!0,r=Le[i],t=(r+=Ie[o])+t),o++,e=Math.floor(e/10)}return t}function He(e){for(var r=e+"",t="",n=0,o=r.length;n<o;n++)t+=Le[parseInt(r[n])];return t}function qe(e,r){void 0===r&&(r={});var t=r.spaceMark,n=void 0===t?" ":t,o=r.precision,i=void 0===o?2:o,a="number"!=typeof e?Number(e):e;if(0===a||T(a))return"0".concat(n,"B");var u=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],c=Math.floor(Math.log(a)/Math.log(1024));return u[c]?"".concat(Number((a/Math.pow(1024,c)).toFixed(i))).concat(n).concat(u[c]):a+""}var _e=/^(?<province>\d{2})(?<city>\d{2})(?<area>\d{2})(?<year>(?:\d{2})?\d{2})(?<month>\d{2})(?<day>\d{2})\d{2}(?<gender>\d)(?:\d|X)?$/i,Ge=[["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","台湾省"],["83","台湾省"],["81","香港特别行政区"],["82","澳门特别行政区"]];var Qe={arrayBuffer:"readAsArrayBuffer",binaryString:"readAsBinaryString",dataURL:"readAsDataURL",text:"readAsText"};function Ve(e,r){void 0===r&&(r="dataURL");var t=Qe[r];return t||(t=Qe.dataURL),new Promise((function(r,n){var o=new FileReader;o[t](e),o.onload=function(){return r(o.result)},o.onerror=function(e){return n(e)}}))}function Ye(e){for(var r=e.split(","),t=r[0].substring(5).split(";"),n=t[0],o=(-1!==t.indexOf("base64")?atob:decodeURIComponent)(r[1]),i=o.length,a=new Uint8Array(i);i--;)a[i]=o.charCodeAt(i);return new Blob([a],{type:n})}function Je(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var t=e[0],n=void 0===e[1]?1:e[1],o=e.slice(2);if(o.length>0)return Je.apply(void 0,[Je(t,n)].concat(o));if(t=Se(t),n=Se(n),T(t)||T(n))return Number.NaN;var i=Pe(t),a=Pe(n),u=Oe(t)+Oe(n),c=i*a;return Be(c),c/Math.pow(10,u)}function Ke(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var t=e[0],n=void 0===e[1]?1:e[1],o=e.slice(2);if(o.length>0)return Ke.apply(void 0,[Ke(t,n)].concat(o));if(t=Se(t),n=Se(n),T(t)||T(n))return Number.NaN;var i=Pe(t),a=Pe(n);return Be(i),Be(a),Je(i/a,Te(Math.pow(10,Oe(n)-Oe(t))))}function er(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var t=e[0],n=void 0===e[1]?0:e[1],o=e.slice(2);if(o.length>0)return er.apply(void 0,[er(t,n)].concat(o));if(t=Math.abs(B(t)),n=Math.abs(B(n)),T(t)||T(n))return Number.NaN;if(0===t&&0===n)return 0;if(0===t)return n;if(0===n)return t;var i=n;for(t<n&&(i=t,t=n,n=i);i;)i=t%n,t=n,n=i;return w(t)}var rr,tr="undefined"!=typeof URL,nr=Object.keys,or=tr?URL.createObjectURL:(rr="",function(){return rr}),ir=tr?URL.revokeObjectURL:function(){};function ar(e,r){var t=r||{},n=t.method,o=void 0===n?"get":n,i=t.data,a=void 0===i?null:i,u=t.timeout,c=t.headers,l=t.withCredentials,d=void 0!==l&&l,s=t.async,f=void 0===s||s,v=t.user,p=void 0===v?null:v,h=t.password,g=void 0===h?null:h,b=t.responseType,y=t.onReadyStateChange,m=t.onLoadStart,w=t.onProgress,x=t.onAbort,N=t.onTimeout,A=t.onError,E=t.onLoad,C=t.onLoadEnd;return new Promise((function(r,t){var n=new XMLHttpRequest;n.open(o.toLowerCase(),e,f,p,g),y&&(n.onreadystatechange=y),"number"==typeof u&&u>0&&(n.timeout=u),n.withCredentials=d,b&&(n.responseType=b),"object"==typeof c&&nr(c).map((function(e){n.setRequestHeader(e,c[e])}));var i,l=function(e){return function(r){t(r),null==e||e.call(n,r)}},s={loadstart:m,progress:w,abort:l(x),timeout:l(N),error:l(A),load:(i=E,function(e){r(e),null==i||i.call(n,e)}),loadend:C};nr(s).map((function(e){var r=s[e];r&&n.addEventListener(e,r)})),n.send(a)}))}var ur,cr,lr,dr,sr,fr,vr=[200,304];function pr(e,r){return new Promise((function(t,n){C(e)?t(e):ar(e,Ae({responseType:"blob"},r)).then((function(r){var o=r.target.status;if(-1!==vr.indexOf(o))t(r.target.response);else{var i=new Error("The file does not support get requests, responseStatus ".concat(o,", '").concat(e,"'."));console.error(i),n(i)}})).catch((function(e){console.error(new Error("Failed to request file. ".concat(e))),n(e)}))}))}function hr(e,r,t){return void 0===r&&(r=!0),new Promise((function(n,o){r&&ur===e&&cr?n(cr):pr(e,t).then((function(t){var i=or(t),a=new Image;a.onload=function(){ir(i);var o={blob:t,image:a};r&&(ur=e,cr=o),n(o)},a.onerror=function(r){ir(i),console.error("[loadImageWithBlob] The image load failed, '".concat(e,"'.")),o(r)},a.src=i})).catch(o)}))}function gr(e,r){void 0===r&&(r="");var t=document.createElement("a");t.href=e,t.style.display="none",t.setAttribute("download",r),t.addEventListener("click",(function e(r){r.stopPropagation(),t.removeEventListener("click",e)})),document.body.appendChild(t),t.click(),document.body.removeChild(t)}var br="abcdefghijklmnopqrstuvwxyz",yr="0123456789"+br+br.toUpperCase();function mr(e,r,t){for(void 0===t&&(t="");e-- >0;){return mr(e,r,t+r[Math.floor(Math.random()*r.length)])}return t}function wr(e,r){var t=r.childrenField,n=void 0===t?"children":t,o=r.emptyChildrenValue,i=void 0===o?"none":o;e.forEach((function(e){e[n].length<=0?"null"===i?e[n]=null:delete e[n]:wr(e[n],r)}))}function xr(e,r,t,n){var o,i;if(void 0===n&&(n=[]),!p(e))return[];try{for(var a=Fe(e),u=a.next();!u.done;u=a.next()){var c=u.value;if(n.push(c),r(c))return n;if(h(c)){var l=c[t];if(p(l)&&l.length>0){var d=xr(l,r,t,n);if(d.length>0)return d}}n.pop()}}catch(e){o={error:e}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}return[]}e.VERSION="4.21.0",e.ajax=ar,e.blobToDataURL=function(e){return Ve(e)},e.bytesToSize=qe,e.calculateCursorPosition=function(e,r,t,n,o){void 0===o&&(o={});var i=o.placeholderChar,a=void 0===i?" ":i,u=o.maskReg,c=void 0===u?/\D/g:u,l=o.type,d=A(r),s=A(t),f=p(a)?a:[a],v=s.length-d.length,h=e;if(v>0){var g=s.substring(h-v,h).replace(c,"").length;h-=v-g;for(var b=0;g>0;)-1!==f.indexOf(n.charAt(h-g+b))?b++:g--;h+=b}return("mobile"===l&&(4===h||9===h)||"bankCard"===l&&h>0&&h%5==0)&&(h-=1),h},e.compressImage=function(e,r){return void 0===r&&(r={}),new Promise((function(t,n){var o=r.width,i=r.height,a=r.rotate,u=r.offset,c=void 0===u?[0,0]:u,l=r.cacheImage,d=void 0===l||l,s=r.background,f=void 0===s?"#fff":s,v=r.canvasWidth,p=r.canvasHeight,h=r.format,g=void 0===h?"blob":h,b=r.type,y=void 0===b?"image/jpeg":b,m=r.quality,x=void 0===m?.8:m,N=r.beforeCompress,A=r.beforeDraw,E=r.afterDraw,C=r.ajaxOptions;hr(e,d,C).then((function(e){var u=e.image,l=e.blob,d=w(o),s=w(i),h=w(x);d&&(u.width=d),s&&(u.height=s),null==N||N({image:u,blob:l},r);var b=document.createElement("canvas"),m=b.getContext("2d"),C={image:u,blob:l,canvas:b,context:m},F=w("function"==typeof v?v(C,r):v),M=w("function"==typeof p?p(C,r):p);b.width=F||u.width,b.height=M||u.height,f&&"none"!==f&&(m.fillStyle=f,m.fillRect(0,0,b.width,b.height));var R=[0,0];void 0!==a&&(m.translate(u.width/2,u.height/2),R=[-u.width/2,-u.height/2],m.rotate(a*Math.PI/180));var S="function"==typeof c?c(C,r):c;null==A||A(C,r),m.drawImage(u,R[0]+w(S[0]),R[1]+w(S[1]),u.width,u.height),null==E||E(C,r),"blob"===g?function(e,r,t){return new Promise((function(n){e.toBlob((function(e){n(e)}),r,t)}))}(b,y,h).then(t).catch(n):t(b.toDataURL(y,h))})).catch(n)}))},e.dataURLToBlob=Ye,e.divide=Ke,e.download=function e(r,t){return Ee(this,void 0,void 0,(function(){var n,o,i,a,u,c,l,d,s,f,v,p,h;return Ce(this,(function(g){switch(g.label){case 0:return n="object"==typeof t?t:{},"string"==typeof t&&(n.fileName=t),o=n.fileName,i=n.type,a=n.dataType,u=n.transformRequest,c=n.transformResponse,"string"!=typeof r?[3,8]:a||!/^blob:.*?\/.*/.test(r)?[3,1]:(gr(r,o),[2,Promise.resolve()]);case 1:return a||!/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(r)?[3,2]:(l=Ye(r),[3,7]);case 2:return"url"===a||!a&&be(r)?(d=function(e){var r="function"==typeof c?c(e):e;return O(r)?r:Promise.resolve(r)},[4,function(e){var r="function"==typeof u?u(e):e;return O(r)?r:Promise.resolve(r)}({responseType:"blob"})]):[3,6];case 3:return s=g.sent(),[4,ar(r,s)];case 4:return f=g.sent(),[4,d(f.target.response)];case 5:return v=g.sent(),p=o||r.split("?")[0].split("#")[0].split("/").pop(),[2,e(v,{fileName:p,type:i||(C(v)?v.type:void 0)})];case 6:l=new Blob([r],{type:i||"text/plain"}),g.label=7;case 7:return[3,9];case 8:r instanceof Blob&&(l=r),g.label=9;case 9:return l||(l=new Blob([r],{type:i})),navigator.msSaveBlob?navigator.msSaveBlob(l,o||"download"):(gr(h=or(l),o),ir(h)),[2,Promise.resolve()]}}))}))},e.fileReader=Ve,e.filterTree=function e(r,t,n,o){void 0===n&&(n="children"),void 0===o&&(o="spread");var i=[];return p(r)?(r.forEach((function(r){var a=r;if(h(r)&&(a="spread"===o?Ae({},r):r),t(a)){if(h(a)){var u=a[n];p(u)&&u.length>0&&(a[n]=e(u,t,n,o))}i.push(a)}})),i):i},e.findTreeNode=function(e,r,t){var n,o;void 0===t&&(t="children");var i,a=[];if(!p(e))return i;try{for(var u=Fe(e),c=u.next();!c.done;c=u.next()){var l=c.value;for(a.push(l);a.length;){var d=a.pop();if(r(d)){i=d;break}if(h(d)){var s=d[t];p(s)&&s.length>0&&s.forEach((function(e){a.push(e)}))}}if(i)break}}catch(e){n={error:e}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}return i},e.findTreeNodes=function(e,r,t){var n,o;void 0===t&&(t="children");var i=[],a=[];if(!p(e))return a;try{for(var u=Fe(e),c=u.next();!c.done;c=u.next()){var l=c.value;for(i.push(l);i.length;){var d=i.pop();if(r(d)&&a.push(d),h(d)){var s=d[t];p(s)&&s.length>0&&s.forEach((function(e){i.push(e)}))}}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}return a},e.findTreeSelect=function(e,r,t){return void 0===t&&(t="children"),xr(e,r,t)},e.formatBankCard=function(e,r){void 0===e&&(e=""),void 0===r&&(r={});var t=r.char,n=void 0===t?" ":t,o=r.length,i=void 0===o?4:o,a="spaceMark"in r?r.spaceMark:n,u=new RegExp("(.{".concat(i,"})"),"g"),c=new RegExp("".concat(a),"g"),l=A(e).replace(c,""),d=l.replace(u,"$1".concat(a));return l.length%i==0?d.substring(0,d.length-1):d},e.formatMobile=function(e,r){void 0===e&&(e=""),void 0===r&&(r={});var t=r.char,n=void 0===t?" ":t,o="spaceMark"in r?r.spaceMark:n,i=new RegExp(o,"g"),a=A(e).replace(i,"").substring(0,11);return a.length>7?a.replace(/^(...)(....)/g,"$1".concat(o,"$2").concat(o)):a.length>3?a.replace(/^(...)/g,"$1".concat(o)):a},e.formatMoney=function(e,r){void 0===e&&(e=""),void 0===r&&(r={});var t=r.precision,n=void 0===t?2:t,o=r.symbol,i=r.thousand,a=void 0===i?",":i,u=r.decimal,c=void 0===u?".":u;if(!function(e){return"number"!=typeof e&&"string"!=typeof e||"number"==typeof e&&T(e)||"string"==typeof e&&(!ke.test(e)&&!je(e)||""===e)?(G("".concat(e," invalid parameter.")),!1):("number"==typeof e&&Be(e),!0)}(e))return"";if("number"==typeof e&&!isFinite(e))return e+"";"number"!=typeof n||T(n)||n<0?n=2:n>10&&(n=10),o="string"==typeof o?o:"",a="string"==typeof a?a:",",c="string"==typeof c?c:".";var l=function(e){var r,t=String(e);if(!je(t))return e;var n=t.toLowerCase().split("e"),o=n.pop(),i=Math.abs(o),a=o/i,u=n[0].split(".");if(-1===a){var c=$e(u[0]);if(c.length>i){var l=c.length-i,d=u[1]||"";r=c.slice(0,l),("0"!==c.slice(l)||d)&&(r+="."+c.slice(l)+d)}else r="0."+new Array(i-c.length+1).join("0")+u.join("")}else r=i-(d=u[1]||"").length<0?$e(u[0]+d.substring(0,i))+"."+d.substring(i):u.join("")+new Array(i-d.length+1).join("0");return $e(r)}(e)+"",d=Me(l.split("."),2),s=d[0],f=d[1];return o+function(e,r){var t="";e="+"===(e=$e(e))[0]?e.substring(1):e;for(var n=Number(e)<0?"-":"",o=n?e.substring(1).split("").reverse():e.split("").reverse(),i=0;i<o.length;i++)t+=o[i]+((i+1)%3==0&&i+1!==o.length?r:"");return n+t.split("").reverse().join("")}(s,a)+function(e,r,t){if(0===r)return"";var n="";return n=e&&Number(e)>0?parseFloat("0."+e).toFixed(r).substring(2):(0).toFixed(r).substring(2),t+n}(f,n,c)},e.gcd=er,e.getFileBlob=pr,e.getImageInfo=function(e,r,t){return void 0===r&&(r=!0),new Promise((function(n,o){r&&lr===e&&dr?n(dr):hr(e,!1,t).then((function(t){var o,i,a,u=t.image,c=t.blob,l=u.width,d=u.height,s={width:l,height:d,contrast:(o=l,i=d,a=er(o,i),"".concat(Ke(B(o),a),":").concat(Ke(B(i),a))),measure:"".concat(l," × ").concat(d," px"),size:qe(c.size),bytes:c.size,image:u,blob:c};r&&(lr=e,dr=s),n(s)})).catch(o)}))},e.isBankCard=function(e,r){void 0===r&&(r={});var t=r.loose,n=void 0!==t&&t,o=r.luhn,i=void 0!==o&&o,a=A(e),u=n?X.test(a):Z.test(a);if(u&&i){var c=a.substring(0,a.length-1);return a[a.length-1]===String(function(e){for(var r=(e+"").replace(/\D/g,"").split("").reverse(),t=0,n=0;n<r.length;n++){var o=parseInt(r[n]);t+=n%2==0?2*o-(o>4?9:0):o}var i=t%10;return 0!==i?10-i:0}(c))}return u},e.isBusinessLicense=function(e,r){void 0===r&&(r={});var t=A(e),n=r.loose,o=void 0!==n&&n,i=r.checkCode,a=!o&&(void 0===i||i),u=ye.test(t);if(!a||!u)return u;var c=t.substring(0,14),l=t.substring(t.length-1),d=function(e){for(var r=10,t=0;t<14;t++){var n=(r+Number(e[t]))%10;r=2*(n=0===n?10:n)%11}return 1===r?0:11-r}(c);return l===String(d)},e.isChinese=function(e,r){void 0===r&&(r={});var t=r.loose,n=void 0!==t&&t,o=r.useExtend,i=void 0!==o&&o,a=A(e),u=i&&ce;return new RegExp(u?n?ae:ue:n?ne:oe,u?"u":void 0).test(a)},e.isEmail=function(e){var r=A(e);return U.test(r)},e.isHMCard=function(e){var r=A(e);return me.test(r)},e.isIPv4=function(e){var r=A(e);return le.test(r)},e.isIPv6=function(e){var r=A(e);return de.test(r)},e.isIdCard=function(e,r){void 0===r&&(r={});var t=r.loose,n=void 0!==t&&t,o=r.checkCode,i=void 0===o||o,a=A(e);return 15===a.length&&n?I.test(a):!(18!==a.length||!I.test(a))&&(!i||function(e){var r,t;for(t=r=0;r<17;r++)t+=Math.pow(2,17-r)%11*Number(e[r]);var n=(12-t%11)%11;return n<10?n===Number(e[17]):"X"===e[17].toUpperCase()}(a))},e.isMobile=function(e){var r=A(e);return $.test(r)},e.isPassport=function(e){var r=A(e);return re.test(r)},e.isPassword=function(e,r){void 0===r&&(r={});var t=r.level,n=void 0===t?2:t,o=r.ignoreCase,i=void 0!==o&&o,a=r.special;return ee(e,{level:n,ignoreCase:i,special:void 0===a?"\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E":a}).validated},e.isPostcode=function(e){var r=A(e);return L.test(r)},e.isPromiseLike=function(e){return O(e)},e.isQQ=function(e){var r=A(e);return z.test(r)},e.isSocialCreditCode=function(e,r){void 0===r&&(r={});var t=A(e),n=r.loose,o=void 0!==n&&n,i=r.checkCode,a=!o&&(void 0===i||i),u=H.test(t);if(!a||!u)return u;var c=t.substring(0,17),l=t.substring(t.length-1),d=function(e){for(var r=0,t=function(t){var n=q.findIndex((function(r){return r===e[t]})),o=Math.pow(3,t)%31;r+=n*o},n=0;n<17;n++)t(n);var o=r%31;return q[0!==o?31-o:0]}(c);return l===d},e.isSwiftCode=function(e){var r=A(e);return Ne.test(r)},e.isTWCard=function(e,r){void 0===r&&(r={});var t=r.loose,n=void 0!==t&&t,o=A(e);return!!we.test(o)||!!n&&xe.test(o)},e.isTelephone=function(e){var r=A(e);return k.test(r)},e.isUrl=be,e.isValidNumber=function(e,r){var t;return void 0===r&&(r=!1),"number"==typeof(t=r?"string"==typeof e&&""!==e?Number(e):e:"number"==typeof e?e:g(e)?Number.NaN:Number(e))&&!T(t)},e.isVehicle=function(e){var r=A(e);return W.test(r)},e.isWX=function(e){var r=A(e);return D.test(r)},e.lcm=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var t=e.map((function(e){return Math.abs(B(e))}));return 1===t.length&&(t=t.concat([1])),Ke(t.indexOf(0)>-1?0:Je.apply(void 0,Re([],Me(t),!1)),er.apply(void 0,Re([],Me(t),!1)))},e.listToTree=function(e,r){void 0===r&&(r={});var t=r.keyField,n=void 0===t?"id":t,o=r.parentField,i=void 0===o?"pid":o,a=r.childrenField,u=void 0===a?"children":a,c=r.emptyChildrenValue,l=void 0===c?"none":c,d=r.nodeAssign,s=void 0===d?"spread":d,f=[],v={};return p(e)?(e.forEach((function(e){if(h(e)){var r="spread"===s?Ae({},e):e,t=r[n],o=r[i];v[t]?r[u]=v[t]:r[u]=v[t]=[],o?v[o]?v[o].push(r):v[o]=[r]:f.push(r)}})),"array"!==l&&wr(f,r),f):f},e.loadImage=function(e,r){return void 0===r&&(r=!0),new Promise((function(t,n){if(r&&sr===e&&fr)t(fr);else{var o=C(e),i=o?or(e):e,a=new Image;o||(a.crossOrigin="anonymous"),a.onload=function(){o&&ir(i),r&&(sr=e,fr=a),t(a)},a.onerror=function(r){o&&ir(i),console.error("[loadImage] The image load failed, '".concat(e,"'.")),n(r)},a.src=i}}))},e.loadImageWithBlob=hr,e.loadScript=function(e,r){return new Promise((function(t,n){var o=document.head,i=document.createElement("script"),a=r||{},u=a.attrs,c=a.destroyOnError,l=void 0===c||c,d=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t}(a,["attrs","destroyOnError"]),s=Ae(Ae({async:!0,type:"text/javascript"},d),{src:e});for(var f in s)"onload"!==f&&"onerror"!==f&&(i[f]=s[f]);"object"==typeof u&&nr(u).forEach((function(e){i.setAttribute(e,u[e])})),i.onload=function(e){var r;this.onerror=this.onload=null,null===(r=s.onload)||void 0===r||r.call(this,e),t(i)},i.onerror=function(e){var r;this.onerror=this.onload=null,null===(r=s.onerror)||void 0===r||r.call(this,e),l&&o.removeChild(i),n(new URIError("Failed to load "+this.src))},o.appendChild(i)}))},e.minus=function e(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=r[0],o=void 0===r[1]?0:r[1],i=r.slice(2);if(i.length>0)return e.apply(void 0,[e(n,o)].concat(i));if(n=Se(n),o=Se(o),T(n)||T(o))return Number.NaN;var a=Math.pow(10,Math.max(Oe(n),Oe(o)));return(Je(n,a)-Je(o,a))/a},e.normalizeString=function(e){return A(e)},e.numberToChinese=function(e,r){void 0===r&&(r={});var t=r.big5,n=void 0!==t&&t,o=r.unit,i=void 0===o||o,a=r.zero,u=void 0===a?"":a,c=r.negative,l=void 0===c?"负":c,d=r.unitConfig,s=void 0===d?{}:d,f=r.decimal,v=void 0===f?"":f;if("number"!=typeof e||T(e))return G("参数错误 ".concat(e,",请传入数字")),"";Be(e),n?(Le=We.slice(),Ie=Ze.slice(),v=v||"點"):(Le=ze.slice(),Ie=De.slice(),v=v||"点");var p=(null==s?void 0:s.w)||"万",h=(null==s?void 0:s.y)||"亿";Ue=["",p,h,p+h],u&&(Le[0]=u);var g,b=e<0?l:"",y=Math.abs(e);g=i?function(e){var r=Math.floor(e),t=0,n="",o="",i=!1;if(0===r)return Le[0];for(;r>0;){var a=r%1e4;i&&(o=Le[0]+o),n=Xe(a),o=(n+=0!==a?Ue[t]:Ue[0])+o,i=a<1e3&&a>0,r=Math.floor(r/1e4),t++}return o}(y):He(Math.floor(y));var m=function(e){var r=e+"",t=r.indexOf("."),n="";return t>-1&&(n=He(r.slice(t+1))),n}(y);return m?"".concat(b).concat(g).concat(v).concat(m):"".concat(b).concat(g)},e.padZero=function(e,r){void 0===r&&(r=2);var t=A(e),n=t.length;return("number"!=typeof r||r<0)&&(r=0),n<r?"0".repeat(r-n)+t:t},e.parseIdCard=function(e){var r=_e.exec(e);if(!r)return null;var t=r.groups||{province:r[1],city:r[2],area:r[3],year:r[4],month:r[5],day:r[6],gender:r[7]},n=Ge.find((function(e){return e[0]===t.province}));if(!n)return null;var o="".concat(t.year,"-").concat(t.month,"-").concat(t.day),i=Number(t.gender)%2==0?"女":"男";return{province:n[1],birthday:o,gender:i,origin:t}},e.plus=function e(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=r[0],o=void 0===r[1]?0:r[1],i=r.slice(2);if(i.length>0)return e.apply(void 0,[e(n,o)].concat(i));if(n=Se(n),o=Se(o),T(n)||T(o))return Number.NaN;var a=Math.pow(10,Math.max(Oe(n),Oe(o)));return(Je(n,a)+Je(o,a))/a},e.randomString=function(e,r){void 0===e&&(e=0);var t="string"==typeof r&&r?r:yr;return mr(w(e),t)},e.replaceChar=function(e,r){void 0===e&&(e=""),void 0===r&&(r={});var t=r.char,n=void 0===t?"*":t,o=r.exclude,i=r.start,a=void 0===i?3:i,u=r.end,c=void 0===u?-4:u,l=r.repeat,d=A(e),s=d.length;if(Math.abs(a)>=s)return d;if((a=a>=0?a:s+a)>=(c=c>=0?c:s+c))return d;var f=d.substring(a,c);if(o){var v=new RegExp("[^".concat(o,"]"),"g");f=f.replace(v,n)}else l="number"==typeof l&&l>=0?l:f.length,f=n.repeat(l);return d.substring(0,a)+f+d.substring(c)},e.round=function(e,r){return void 0===r&&(r=0),B(e,r)},e.safeDate=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];var n="string"==typeof e?e.replace(/[\\.-]/g,"/"):e;return r&&r.length>0?new(Date.bind.apply(Date,Re([void 0,n],Me(r),!1))):void 0===n?new Date:new Date(n)},e.setDataURLPrefix=function(e,r,t){return void 0===r&&(r="image/png"),void 0===t&&(t=!0),"data:".concat(r).concat(t?";base64":"",",").concat(e)},e.setDisableWarning=function(e){_.disableWarning=!!e},e.strlen=function(e){for(var r=A(e),t=0,n=0;n<r.length;n++){var o=r.charCodeAt(n);o>=1&&o<=126||65376<=o&&o<=65439?t++:t+=2}return t},e.times=Je,e.transformFieldNames=function(e,r,t,n){return void 0===n&&(n="spread"),p(e)?e.length<=0?[]:function e(o){return o.map((function(o){if(!h(o))return o;var i="spread"===n?Ae({},o):o,a=[];return t&&p(i[t])&&i[t].length>0&&(i[t]=e(i[t].slice())),nr(r).forEach((function(e){var t=r[e];t in i&&(i[e]=i[t],a.push(t))})),a.length>0&&a.forEach((function(e){delete i[e]})),i}))}(e.slice()):e},e.treeToList=function(e,r){var t=[];return p(e)?(function e(n){n.forEach((function(n){if(h(n)){var o=Ae({},n);t.push(o),o[r]&&(p(o[r])&&o[r].length>0&&e(o[r]),delete o[r])}else t.push(n)}))}(e),t):t},e.validatePassword=ee,e.version="4.21.0",e.waitTime=function(e){return void 0===e&&(e=1e3),void 0===(r=e)&&(r=1e3),new Promise((function(e){setTimeout(e,r)}));var r}}));
1
+ !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).utilHelpers={})}(this,(function(e){"use strict";var r=Object.prototype.toString,t="undefined"!=typeof Symbol?Symbol.prototype:void 0,n=Math.min,o=Number.isFinite,i="object"==typeof globalThis&&globalThis,a="object"==typeof global&&global,u="object"==typeof self&&self,c=Number.MAX_SAFE_INTEGER||9007199254740991,l=Number.MIN_SAFE_INTEGER||-9007199254740991,d="[object Number]",s="[object String]",f="[object Symbol]",v="[object Blob]";function p(e){return Array.isArray(e)}function h(e){var r=typeof e;return"function"===r||"object"===r&&!!e}function g(e){return r.call(e)}function b(e){return"symbol"==typeof e||g(e)===f}var y=/^0b[01]+$/i,m=/^0o[0-7]+$/i,w=/^[-+]0x[0-9a-f]+$/i;function x(e){if("number"==typeof e)return e;if(b(e))return NaN;if(h(e)&&(e=Number(e)),"string"!=typeof e)return 0===e?e:+e;e=e.trim();var r=y.test(e);return r||m.test(e)?parseInt(e.slice(2),r?2:8):w.test(e)?NaN:+e}var N=t?t.toString:void 0;function A(e){if("string"==typeof e)return e;if(p(e))return""+e.map(A);if(b(e))return N?N.call(e):"";var r=""+e;return"0"===r&&1/e==-1/0?"-0":r}function E(e){return function(e){return null==e}(e)?"":A(e)}var C="undefined"!=typeof Blob;function F(e){return!!(C&&e instanceof Blob)||g(e)===v}var M=i&&globalThis.Object===Object&&globalThis,R=a&&global.Object===Object&&global,S=u&&self.Object===Object&&self,j=M||R||S||Function("return this")();function O(e){return"number"==typeof e||g(e)===d}function T(e){return O(e)&&j.isNaN(e)}function P(e){return h(e)&&"function"==typeof e.then}function B(e,r,t){void 0===t&&(t=0);var i=Math[e];if(r=x(r),t=n(function(e){var r=x(e);if(!r||r===1/0||r===-1/0)return r==r?r:0;var t=r%1;return t?r-t:r}(t),292),0===t||!function(e){return o?o(e):"number"==typeof e&&j.isFinite(e)}(r))return i(r);var a=E(r).split("e");return+((a=E(r=i(+(a[0]+"e"+(a[1]?+a[1]+t:t)))).split("e"))[0]+"e"+(a[1]?+a[1]-t:-t))}function $(e,r){return B("round",e,r)}var k=/^1[3456789]\d{9}$/;var I=/^(0\d{2,3}-)?([2-9]\d{6,7})(-\d{1,6})?$/;var L=/^\d{6}$/;var U=/^[1-9]\d{5}(19|20)?\d{2}((0[1-9])|(1[012]))(([0-2][1-9])|10|20|30|31)\d{3}(\d|X)?$/i;var z=/^[\da-z]+([-._]?[\da-z]+)*@[\da-z]+([-.]?[\da-z]+)*(\.[a-z]{2,})+$/i;var D=/^[1-9]\d{4,10}$/;var W=/^[a-z]([-_a-z0-9]{5,19})+$/i;var Z=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([A-Z0-9]{4}[A-Z0-9挂学警港澳]{1})|([A-Z0-9]{5}[DF])|([DF][A-Z0-9]{5}))$/;var X=/^[1-9]\d{9,20}$/,H=/^\d{8,30}$/;var q=/^[\dA-HJ-NPQRTUWXY]{2}\d{6}[\dA-HJ-NPQRTUWXY]{10}$/,_="0123456789ABCDEFGHJKLMNPQRTUWXY".split("");var G={disableWarning:!0};function Q(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];G.disableWarning||console.warn.apply(void 0,e)}var V=/[\d]/,Y=/[a-z]/,J=/[A-Z]/,K=/[\d|a-z]/gi;function ee(e){return e.indexOf("\\x")>-1||e.indexOf("\\u")>-1}function re(e,r){void 0===r&&(r={});var t=r.level,n=void 0===t?2:t,o=r.ignoreCase,i=void 0!==o&&o,a=r.special,u=void 0===a?"\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E":a,c=e;"string"!=typeof e&&(Q("[validatePassword] value must be a string."),c="");var l,d=0,s=(l=c,V.test(l)),f=function(e){return Y.test(e)}(c),v=function(e){return J.test(e)}(c),p=function(e,r){if(!r||!e)return!1;var t=e.replace(K,"");if(!t)return!1;var n=ee(r)?new RegExp("[".concat(r,"]")):null;if(n)return n.test(t);var o=!1;return t.split("").some((function(e){return r.indexOf(e)>-1&&(o=!0),o})),o}(c,u),h=function(e,r){if(!e)return!1;var t=e.replace(K,"");if(!t)return!1;if(!r)return!0;var n=ee(r)?new RegExp("[^".concat(r,"]")):null;if(n)return n.test(t);var o=!1;return t.split("").some((function(e){return-1===r.indexOf(e)&&(o=!0),o})),o}(c,u);return s&&(d+=1),i?(f||v)&&(d+=1):(f&&(d+=1),v&&(d+=1)),p&&(d+=1),{validated:d>=n&&!h,level:d,containes:{number:s,lowerCaseLetter:f,upperCaseLetter:v,specialCharacter:p,unallowableCharacter:h}}}var te=/^((e[\da-z])|(de)|(se)|(pe)|([khm][\da-z]))[\da-z]{7}$/i;var ne="[一-龥]",oe=ne+"+",ie="^"+ne+"+$",ae="(?:"+ne+"|"+"[麦-鿯]"+"|"+"[㐀-䶵]"+"|"+"[𠀀-𪛖]"+"|"+"[𪜀-𫜴]"+"|"+"[𫝀-𫠝]"+"|"+"[𫠠-𬺡]"+"|"+"[𬺰-𮯠]"+")",ue=ae+"+",ce="^"+ae+"+$",le=RegExp.prototype.hasOwnProperty("unicode");var de=/^((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;var se=/^((([0-9A-F]{1,4}:){7}([0-9A-F]{1,4}|:))|(([0-9A-F]{1,4}:){6}(:[0-9A-F]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3})|:))|(([0-9A-F]{1,4}:){5}(((:[0-9A-F]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3})|:))|(([0-9A-F]{1,4}:){4}(((:[0-9A-F]{1,4}){1,3})|((:[0-9A-F]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(([0-9A-F]{1,4}:){3}(((:[0-9A-F]{1,4}){1,4})|((:[0-9A-F]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(([0-9A-F]{1,4}:){2}(((:[0-9A-F]{1,4}){1,5})|((:[0-9A-F]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(([0-9A-F]{1,4}:){1}(((:[0-9A-F]{1,4}){1,6})|((:[0-9A-F]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(:(((:[0-9A-F]{1,4}){1,7})|((:[0-9A-F]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:)))(%.+)?$/i;var fe="localhost|(([^\\s:\\/]+?\\.)+?[^\\s:\\/]+)",ve=":\\d+",pe="\\/.*",he="\\?.*",ge=new RegExp("^".concat("[\\w-.]+:\\/\\/","(?:").concat("[-;:&=\\+\\$,\\w]+@",")?(?:").concat(fe,")(?:").concat(ve,")?(?:").concat(pe,")*(?:").concat(he,")?(?:").concat("#.*",")?$")),be=new RegExp("^(?:".concat(fe,")(?:").concat(ve,")?(?:").concat(pe,")*(?:").concat(he,")?(?:").concat("#.*",")?$"));function ye(e){var r=E(e);return ge.test(r)||be.test(r)}var me=/^\d{15}$/;var we=/^[hm]{1}([0-9]{10}|[0-9]{8})$/i;var xe=/^\d{8}$/i,Ne=/^[\da-z]{10,12}$/i;var Ae=/^[A-Z]{6}[A-Z\d]{2}(?:[A-Z\d]{3})?$/;var Ee=function(){return Ee=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},Ee.apply(this,arguments)};function Ce(e,r,t,n){return new(t||(t=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function u(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var r;e.done?o(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(a,u)}c((n=n.apply(e,r||[])).next())}))}function Fe(e,r){var t,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(c){return function(u){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(t=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,n=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=r.call(e,a)}catch(e){u=[6,e],n=0}finally{t=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}function Me(e){var r="function"==typeof Symbol&&Symbol.iterator,t=r&&e[r],n=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function Re(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var n,o,i=t.call(e),a=[];try{for(;(void 0===r||r-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a}function Se(e,r,t){if(t||2===arguments.length)for(var n,o=0,i=r.length;o<i;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return e.concat(n||Array.prototype.slice.call(r))}function je(e){var r;return!function(e){return"string"==typeof e||g(e)===s}(e)?r=b(e)?Number.NaN:O(e)?e:Number(e):""===(r=e.trim())?r=Number(r):T(Number(r))&&(r=Number.NaN),T(r)?Number.NaN:r}function Oe(e){return/\d+\.?\d*e[+-]*\d+/i.test(e)}function Te(e,r){return void 0===r&&(r=12),+parseFloat(e.toPrecision(r))}function Pe(e){var r=e.toString().split(/e/i),t=(r[0].split(".")[1]||"").length-+(r[1]||0);return t>0?t:0}function Be(e){var r=String(e);if(!Oe(r))return Number(r.replace(".",""));var t=Pe(e);return t>0?Te(+e*Math.pow(10,t)):+e}function $e(e){(+e>c||+e<l)&&Q("".concat(e," is beyond boundary when transfer to integer, the results may not be accurate"))}function ke(e){var r=/^([+-])?(0+)([0-9.]+)$/.exec(e);return r?(r[1]||"")+("."===r[3][0]?"0"+r[3]:r[3]):e}"function"==typeof SuppressedError&&SuppressedError;var Ie=/^[+-]?\d*\.?\d*$/;var Le,Ue,ze,De=["零","一","二","三","四","五","六","七","八","九"],We=["","十","百","千"],Ze=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],Xe=["","拾","佰","仟"];function He(e){for(var r="",t="",n=!1,o=0;e>0;){var i=e%10;0==i?n&&(n=!1,t=Le[i]+t):(n=!0,r=Le[i],t=(r+=Ue[o])+t),o++,e=Math.floor(e/10)}return t}function qe(e){for(var r=e+"",t="",n=0,o=r.length;n<o;n++)t+=Le[parseInt(r[n])];return t}function _e(e,r){void 0===r&&(r={});var t=r.spaceMark,n=void 0===t?" ":t,o=r.precision,i=void 0===o?2:o,a="number"!=typeof e?Number(e):e;if(0===a||T(a))return"0".concat(n,"B");var u=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],c=Math.floor(Math.log(a)/Math.log(1024));return u[c]?"".concat(Number((a/Math.pow(1024,c)).toFixed(i))).concat(n).concat(u[c]):a+""}var Ge=/^(?<province>\d{2})(?<city>\d{2})(?<area>\d{2})(?<year>(?:\d{2})?\d{2})(?<month>\d{2})(?<day>\d{2})\d{2}(?<gender>\d)(?:\d|X)?$/i,Qe=[["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","台湾省"],["83","台湾省"],["81","香港特别行政区"],["82","澳门特别行政区"]];var Ve={arrayBuffer:"readAsArrayBuffer",binaryString:"readAsBinaryString",dataURL:"readAsDataURL",text:"readAsText"};function Ye(e,r){void 0===r&&(r="dataURL");var t=Ve[r];return t||(t=Ve.dataURL),new Promise((function(r,n){var o=new FileReader;o[t](e),o.onload=function(){return r(o.result)},o.onerror=function(e){return n(e)}}))}function Je(e){for(var r=e.split(","),t=r[0].substring(5).split(";"),n=t[0],o=(-1!==t.indexOf("base64")?atob:decodeURIComponent)(r[1]),i=o.length,a=new Uint8Array(i);i--;)a[i]=o.charCodeAt(i);return new Blob([a],{type:n})}function Ke(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var t=e[0],n=void 0===e[1]?1:e[1],o=e.slice(2);if(o.length>0)return Ke.apply(void 0,[Ke(t,n)].concat(o));if(t=je(t),n=je(n),T(t)||T(n))return Number.NaN;var i=Be(t),a=Be(n),u=Pe(t)+Pe(n),c=i*a;return $e(c),c/Math.pow(10,u)}function er(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var t=e[0],n=void 0===e[1]?1:e[1],o=e.slice(2);if(o.length>0)return er.apply(void 0,[er(t,n)].concat(o));if(t=je(t),n=je(n),T(t)||T(n))return Number.NaN;var i=Be(t),a=Be(n);return $e(i),$e(a),Ke(i/a,Te(Math.pow(10,Pe(n)-Pe(t))))}function rr(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var t=e[0],n=void 0===e[1]?0:e[1],o=e.slice(2);if(o.length>0)return rr.apply(void 0,[rr(t,n)].concat(o));if(t=Math.abs($(t)),n=Math.abs($(n)),T(t)||T(n))return Number.NaN;if(0===t&&0===n)return 0;if(0===t)return n;if(0===n)return t;var i=n;for(t<n&&(i=t,t=n,n=i);i;)i=t%n,t=n,n=i;return x(t)}var tr,nr="undefined"!=typeof URL,or=Object.keys,ir=nr?URL.createObjectURL:(tr="",function(){return tr}),ar=nr?URL.revokeObjectURL:function(){};function ur(e,r){var t=r||{},n=t.method,o=void 0===n?"get":n,i=t.data,a=void 0===i?null:i,u=t.timeout,c=t.headers,l=t.withCredentials,d=void 0!==l&&l,s=t.async,f=void 0===s||s,v=t.user,p=void 0===v?null:v,h=t.password,g=void 0===h?null:h,b=t.responseType,y=t.onReadyStateChange,m=t.onLoadStart,w=t.onProgress,x=t.onAbort,N=t.onTimeout,A=t.onError,E=t.onLoad,C=t.onLoadEnd;return new Promise((function(r,t){var n=new XMLHttpRequest;n.open(o.toLowerCase(),e,f,p,g),y&&(n.onreadystatechange=y),"number"==typeof u&&u>0&&(n.timeout=u),n.withCredentials=d,b&&(n.responseType=b),"object"==typeof c&&or(c).map((function(e){n.setRequestHeader(e,c[e])}));var i,l=function(e){return function(r){t(r),null==e||e.call(n,r)}},s={loadstart:m,progress:w,abort:l(x),timeout:l(N),error:l(A),load:(i=E,function(e){r(e),null==i||i.call(n,e)}),loadend:C};or(s).map((function(e){var r=s[e];r&&n.addEventListener(e,r)})),n.send(a)}))}var cr,lr,dr,sr,fr,vr,pr=[200,304];function hr(e,r){return new Promise((function(t,n){F(e)?t(e):ur(e,Ee({responseType:"blob"},r)).then((function(r){var o=r.target.status;if(-1!==pr.indexOf(o))t(r.target.response);else{var i=new Error("The file does not support get requests, responseStatus ".concat(o,", '").concat(e,"'."));console.error(i),n(i)}})).catch((function(e){console.error(new Error("Failed to request file. ".concat(e))),n(e)}))}))}function gr(e,r,t){return void 0===r&&(r=!0),new Promise((function(n,o){r&&cr===e&&lr?n(lr):hr(e,t).then((function(t){var i=ir(t),a=new Image;a.onload=function(){var o={blob:t,image:a};r&&(cr=e,lr=o),n(o)},a.onerror=function(r){ar(i),console.error("[loadImageWithBlob] The image load failed, '".concat(e,"'.")),o(r)},a.src=i})).catch(o)}))}function br(e,r){void 0===r&&(r="");var t=document.createElement("a");t.href=e,t.style.display="none",t.setAttribute("download",r),t.addEventListener("click",(function e(r){r.stopPropagation(),t.removeEventListener("click",e)})),document.body.appendChild(t),t.click(),document.body.removeChild(t)}var yr="abcdefghijklmnopqrstuvwxyz",mr="0123456789"+yr+yr.toUpperCase();function wr(e,r,t){for(void 0===t&&(t="");e-- >0;){return wr(e,r,t+r[Math.floor(Math.random()*r.length)])}return t}function xr(e,r){var t=r.childrenField,n=void 0===t?"children":t,o=r.emptyChildrenValue,i=void 0===o?"none":o;e.forEach((function(e){e[n].length<=0?"null"===i?e[n]=null:delete e[n]:xr(e[n],r)}))}function Nr(e,r,t,n){var o,i;if(void 0===n&&(n=[]),!p(e))return[];try{for(var a=Me(e),u=a.next();!u.done;u=a.next()){var c=u.value;if(n.push(c),r(c))return n;if(h(c)){var l=c[t];if(p(l)&&l.length>0){var d=Nr(l,r,t,n);if(d.length>0)return d}}n.pop()}}catch(e){o={error:e}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}return[]}e.VERSION="4.21.1",e.ajax=ur,e.blobToDataURL=function(e){return Ye(e)},e.bytesToSize=_e,e.calculateCursorPosition=function(e,r,t,n,o){void 0===o&&(o={});var i=o.placeholderChar,a=void 0===i?" ":i,u=o.maskReg,c=void 0===u?/\D/g:u,l=o.type,d=E(r),s=E(t),f=p(a)?a:[a],v=s.length-d.length,h=e;if(v>0){var g=s.substring(h-v,h).replace(c,"").length;h-=v-g;for(var b=0;g>0;)-1!==f.indexOf(n.charAt(h-g+b))?b++:g--;h+=b}return("mobile"===l&&(4===h||9===h)||"bankCard"===l&&h>0&&h%5==0)&&(h-=1),h},e.compressImage=function(e,r){return void 0===r&&(r={}),new Promise((function(t,n){var o=r.width,i=r.height,a=r.rotate,u=r.offset,c=void 0===u?[0,0]:u,l=r.cacheImage,d=void 0===l||l,s=r.background,f=void 0===s?"#fff":s,v=r.canvasWidth,p=r.canvasHeight,h=r.format,g=void 0===h?"blob":h,b=r.type,y=void 0===b?"image/jpeg":b,m=r.quality,w=void 0===m?.8:m,N=r.beforeCompress,A=r.beforeDraw,E=r.afterDraw,C=r.ajaxOptions;gr(e,d,C).then((function(e){var u=e.image,l=e.blob,d=x(o),s=x(i),h=x(w);d&&(u.width=d),s&&(u.height=s),null==N||N({image:u,blob:l},r);var b=document.createElement("canvas"),m=b.getContext("2d"),C={image:u,blob:l,canvas:b,context:m},F=x("function"==typeof v?v(C,r):v),M=x("function"==typeof p?p(C,r):p);b.width=F||u.width,b.height=M||u.height,f&&"none"!==f&&(m.fillStyle=f,m.fillRect(0,0,b.width,b.height));var R=[0,0];void 0!==a&&(m.translate(u.width/2,u.height/2),R=[-u.width/2,-u.height/2],m.rotate(a*Math.PI/180));var S="function"==typeof c?c(C,r):c;null==A||A(C,r);var j=R[0]+x(S[0]),O=R[1]+x(S[1]);m.drawImage(u,j,O,u.width,u.height),"image/png"===y&&(m.globalCompositeOperation="destination-in",m.drawImage(u,j,O,u.width,u.height)),null==E||E(C,r),"blob"===g?function(e,r,t){return new Promise((function(n){e.toBlob((function(e){n(e)}),r,t)}))}(b,y,h).then(t).catch(n):t(b.toDataURL(y,h))})).catch(n)}))},e.dataURLToBlob=Je,e.divide=er,e.download=function e(r,t){return Ce(this,void 0,void 0,(function(){var n,o,i,a,u,c,l,d,s,f,v,p,h;return Fe(this,(function(g){switch(g.label){case 0:return n="object"==typeof t?t:{},"string"==typeof t&&(n.fileName=t),o=n.fileName,i=n.type,a=n.dataType,u=n.transformRequest,c=n.transformResponse,"string"!=typeof r?[3,8]:a||!/^blob:.*?\/.*/.test(r)?[3,1]:(br(r,o),[2,Promise.resolve()]);case 1:return a||!/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(r)?[3,2]:(l=Je(r),[3,7]);case 2:return"url"===a||!a&&ye(r)?(d=function(e){var r="function"==typeof c?c(e):e;return P(r)?r:Promise.resolve(r)},[4,function(e){var r="function"==typeof u?u(e):e;return P(r)?r:Promise.resolve(r)}({responseType:"blob"})]):[3,6];case 3:return s=g.sent(),[4,ur(r,s)];case 4:return f=g.sent(),[4,d(f.target.response)];case 5:return v=g.sent(),p=o||r.split("?")[0].split("#")[0].split("/").pop(),[2,e(v,{fileName:p,type:i||(F(v)?v.type:void 0)})];case 6:l=new Blob([r],{type:i||"text/plain"}),g.label=7;case 7:return[3,9];case 8:r instanceof Blob&&(l=r),g.label=9;case 9:return l||(l=new Blob([r],{type:i})),navigator.msSaveBlob?navigator.msSaveBlob(l,o||"download"):(br(h=ir(l),o),ar(h)),[2,Promise.resolve()]}}))}))},e.fileReader=Ye,e.filterTree=function e(r,t,n,o){void 0===n&&(n="children"),void 0===o&&(o="spread");var i=[];return p(r)?(r.forEach((function(r){var a=r;if(h(r)&&(a="spread"===o?Ee({},r):r),t(a)){if(h(a)){var u=a[n];p(u)&&u.length>0&&(a[n]=e(u,t,n,o))}i.push(a)}})),i):i},e.findTreeNode=function(e,r,t){var n,o;void 0===t&&(t="children");var i,a=[];if(!p(e))return i;try{for(var u=Me(e),c=u.next();!c.done;c=u.next()){var l=c.value;for(a.push(l);a.length;){var d=a.pop();if(r(d)){i=d;break}if(h(d)){var s=d[t];p(s)&&s.length>0&&s.forEach((function(e){a.push(e)}))}}if(i)break}}catch(e){n={error:e}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}return i},e.findTreeNodes=function(e,r,t){var n,o;void 0===t&&(t="children");var i=[],a=[];if(!p(e))return a;try{for(var u=Me(e),c=u.next();!c.done;c=u.next()){var l=c.value;for(i.push(l);i.length;){var d=i.pop();if(r(d)&&a.push(d),h(d)){var s=d[t];p(s)&&s.length>0&&s.forEach((function(e){i.push(e)}))}}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}return a},e.findTreeSelect=function(e,r,t){return void 0===t&&(t="children"),Nr(e,r,t)},e.formatBankCard=function(e,r){void 0===e&&(e=""),void 0===r&&(r={});var t=r.char,n=void 0===t?" ":t,o=r.length,i=void 0===o?4:o,a="spaceMark"in r?r.spaceMark:n,u=new RegExp("(.{".concat(i,"})"),"g"),c=new RegExp("".concat(a),"g"),l=E(e).replace(c,""),d=l.replace(u,"$1".concat(a));return l.length%i==0?d.substring(0,d.length-1):d},e.formatMobile=function(e,r){void 0===e&&(e=""),void 0===r&&(r={});var t=r.char,n=void 0===t?" ":t,o="spaceMark"in r?r.spaceMark:n,i=new RegExp(o,"g"),a=E(e).replace(i,"").substring(0,11);return a.length>7?a.replace(/^(...)(....)/g,"$1".concat(o,"$2").concat(o)):a.length>3?a.replace(/^(...)/g,"$1".concat(o)):a},e.formatMoney=function(e,r){void 0===e&&(e=""),void 0===r&&(r={});var t=r.precision,n=void 0===t?2:t,o=r.symbol,i=r.thousand,a=void 0===i?",":i,u=r.decimal,c=void 0===u?".":u;if(!function(e){return"number"!=typeof e&&"string"!=typeof e||"number"==typeof e&&T(e)||"string"==typeof e&&(!Ie.test(e)&&!Oe(e)||""===e)?(Q("".concat(e," invalid parameter.")),!1):("number"==typeof e&&$e(e),!0)}(e))return"";if("number"==typeof e&&!isFinite(e))return e+"";"number"!=typeof n||T(n)||n<0?n=2:n>10&&(n=10),o="string"==typeof o?o:"",a="string"==typeof a?a:",",c="string"==typeof c?c:".";var l=function(e){var r,t=String(e);if(!Oe(t))return e;var n=t.toLowerCase().split("e"),o=n.pop(),i=Math.abs(o),a=o/i,u=n[0].split(".");if(-1===a){var c=ke(u[0]);if(c.length>i){var l=c.length-i,d=u[1]||"";r=c.slice(0,l),("0"!==c.slice(l)||d)&&(r+="."+c.slice(l)+d)}else r="0."+new Array(i-c.length+1).join("0")+u.join("")}else r=i-(d=u[1]||"").length<0?ke(u[0]+d.substring(0,i))+"."+d.substring(i):u.join("")+new Array(i-d.length+1).join("0");return ke(r)}(e)+"",d=Re(l.split("."),2),s=d[0],f=d[1];return o+function(e,r){var t="";e="+"===(e=ke(e))[0]?e.substring(1):e;for(var n=Number(e)<0?"-":"",o=n?e.substring(1).split("").reverse():e.split("").reverse(),i=0;i<o.length;i++)t+=o[i]+((i+1)%3==0&&i+1!==o.length?r:"");return n+t.split("").reverse().join("")}(s,a)+function(e,r,t){if(0===r)return"";var n="";return n=e&&Number(e)>0?parseFloat("0."+e).toFixed(r).substring(2):(0).toFixed(r).substring(2),t+n}(f,n,c)},e.gcd=rr,e.getFileBlob=hr,e.getImageInfo=function(e,r,t){return void 0===r&&(r=!0),new Promise((function(n,o){r&&dr===e&&sr?n(sr):gr(e,!1,t).then((function(t){var o,i,a,u=t.image,c=t.blob,l=u.width,d=u.height,s={width:l,height:d,contrast:(o=l,i=d,a=rr(o,i),"".concat(er($(o),a),":").concat(er($(i),a))),measure:"".concat(l," × ").concat(d," px"),size:_e(c.size),bytes:c.size,image:u,blob:c};r&&(dr=e,sr=s),n(s)})).catch(o)}))},e.isBankCard=function(e,r){void 0===r&&(r={});var t=r.loose,n=void 0!==t&&t,o=r.luhn,i=void 0!==o&&o,a=E(e),u=n?H.test(a):X.test(a);if(u&&i){var c=a.substring(0,a.length-1);return a[a.length-1]===String(function(e){for(var r=(e+"").replace(/\D/g,"").split("").reverse(),t=0,n=0;n<r.length;n++){var o=parseInt(r[n]);t+=n%2==0?2*o-(o>4?9:0):o}var i=t%10;return 0!==i?10-i:0}(c))}return u},e.isBusinessLicense=function(e,r){void 0===r&&(r={});var t=E(e),n=r.loose,o=void 0!==n&&n,i=r.checkCode,a=!o&&(void 0===i||i),u=me.test(t);if(!a||!u)return u;var c=t.substring(0,14),l=t.substring(t.length-1),d=function(e){for(var r=10,t=0;t<14;t++){var n=(r+Number(e[t]))%10;r=2*(n=0===n?10:n)%11}return 1===r?0:11-r}(c);return l===String(d)},e.isChinese=function(e,r){void 0===r&&(r={});var t=r.loose,n=void 0!==t&&t,o=r.useExtend,i=void 0!==o&&o,a=E(e),u=i&&le;return new RegExp(u?n?ue:ce:n?oe:ie,u?"u":void 0).test(a)},e.isEmail=function(e){var r=E(e);return z.test(r)},e.isHMCard=function(e){var r=E(e);return we.test(r)},e.isIPv4=function(e){var r=E(e);return de.test(r)},e.isIPv6=function(e){var r=E(e);return se.test(r)},e.isIdCard=function(e,r){void 0===r&&(r={});var t=r.loose,n=void 0!==t&&t,o=r.checkCode,i=void 0===o||o,a=E(e);return 15===a.length&&n?U.test(a):!(18!==a.length||!U.test(a))&&(!i||function(e){var r,t;for(t=r=0;r<17;r++)t+=Math.pow(2,17-r)%11*Number(e[r]);var n=(12-t%11)%11;return n<10?n===Number(e[17]):"X"===e[17].toUpperCase()}(a))},e.isMobile=function(e){var r=E(e);return k.test(r)},e.isPassport=function(e){var r=E(e);return te.test(r)},e.isPassword=function(e,r){void 0===r&&(r={});var t=r.level,n=void 0===t?2:t,o=r.ignoreCase,i=void 0!==o&&o,a=r.special;return re(e,{level:n,ignoreCase:i,special:void 0===a?"\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E":a}).validated},e.isPostcode=function(e){var r=E(e);return L.test(r)},e.isPromiseLike=function(e){return P(e)},e.isQQ=function(e){var r=E(e);return D.test(r)},e.isSocialCreditCode=function(e,r){void 0===r&&(r={});var t=E(e),n=r.loose,o=void 0!==n&&n,i=r.checkCode,a=!o&&(void 0===i||i),u=q.test(t);if(!a||!u)return u;var c=t.substring(0,17),l=t.substring(t.length-1),d=function(e){for(var r=0,t=function(t){var n=_.findIndex((function(r){return r===e[t]})),o=Math.pow(3,t)%31;r+=n*o},n=0;n<17;n++)t(n);var o=r%31;return _[0!==o?31-o:0]}(c);return l===d},e.isSwiftCode=function(e){var r=E(e);return Ae.test(r)},e.isTWCard=function(e,r){void 0===r&&(r={});var t=r.loose,n=void 0!==t&&t,o=E(e);return!!xe.test(o)||!!n&&Ne.test(o)},e.isTelephone=function(e){var r=E(e);return I.test(r)},e.isUrl=ye,e.isValidNumber=function(e,r){var t;return void 0===r&&(r=!1),"number"==typeof(t=r?"string"==typeof e&&""!==e?Number(e):e:"number"==typeof e?e:b(e)?Number.NaN:Number(e))&&!T(t)},e.isVehicle=function(e){var r=E(e);return Z.test(r)},e.isWX=function(e){var r=E(e);return W.test(r)},e.lcm=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var t=e.map((function(e){return Math.abs($(e))}));return 1===t.length&&(t=t.concat([1])),er(t.indexOf(0)>-1?0:Ke.apply(void 0,Se([],Re(t),!1)),rr.apply(void 0,Se([],Re(t),!1)))},e.listToTree=function(e,r){void 0===r&&(r={});var t=r.keyField,n=void 0===t?"id":t,o=r.parentField,i=void 0===o?"pid":o,a=r.childrenField,u=void 0===a?"children":a,c=r.emptyChildrenValue,l=void 0===c?"none":c,d=r.nodeAssign,s=void 0===d?"spread":d,f=[],v={};return p(e)?(e.forEach((function(e){if(h(e)){var r="spread"===s?Ee({},e):e,t=r[n],o=r[i];v[t]?r[u]=v[t]:r[u]=v[t]=[],o?v[o]?v[o].push(r):v[o]=[r]:f.push(r)}})),"array"!==l&&xr(f,r),f):f},e.loadImage=function(e,r){return void 0===r&&(r=!0),new Promise((function(t,n){if(r&&fr===e&&vr)t(vr);else{var o=F(e),i=o?ir(e):e,a=new Image;o||(a.crossOrigin="anonymous"),a.onload=function(){r&&(fr=e,vr=a),t(a)},a.onerror=function(r){o&&ar(i),console.error("[loadImage] The image load failed, '".concat(e,"'.")),n(r)},a.src=i}}))},e.loadImageWithBlob=gr,e.loadScript=function(e,r){return new Promise((function(t,n){var o=document.head,i=document.createElement("script"),a=r||{},u=a.attrs,c=a.destroyOnError,l=void 0===c||c,d=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t}(a,["attrs","destroyOnError"]),s=Ee(Ee({async:!0,type:"text/javascript"},d),{src:e});for(var f in s)"onload"!==f&&"onerror"!==f&&(i[f]=s[f]);"object"==typeof u&&or(u).forEach((function(e){i.setAttribute(e,u[e])})),i.onload=function(e){var r;this.onerror=this.onload=null,null===(r=s.onload)||void 0===r||r.call(this,e),t(i)},i.onerror=function(e){var r;this.onerror=this.onload=null,null===(r=s.onerror)||void 0===r||r.call(this,e),l&&o.removeChild(i),n(new URIError("Failed to load "+this.src))},o.appendChild(i)}))},e.minus=function e(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=r[0],o=void 0===r[1]?0:r[1],i=r.slice(2);if(i.length>0)return e.apply(void 0,[e(n,o)].concat(i));if(n=je(n),o=je(o),T(n)||T(o))return Number.NaN;var a=Math.pow(10,Math.max(Pe(n),Pe(o)));return(Ke(n,a)-Ke(o,a))/a},e.normalizeString=function(e){return E(e)},e.numberToChinese=function(e,r){void 0===r&&(r={});var t=r.big5,n=void 0!==t&&t,o=r.unit,i=void 0===o||o,a=r.zero,u=void 0===a?"":a,c=r.negative,l=void 0===c?"负":c,d=r.unitConfig,s=void 0===d?{}:d,f=r.decimal,v=void 0===f?"":f;if("number"!=typeof e||T(e))return Q("参数错误 ".concat(e,",请传入数字")),"";$e(e),n?(Le=Ze.slice(),Ue=Xe.slice(),v=v||"點"):(Le=De.slice(),Ue=We.slice(),v=v||"点");var p=(null==s?void 0:s.w)||"万",h=(null==s?void 0:s.y)||"亿";ze=["",p,h,p+h],u&&(Le[0]=u);var g,b=e<0?l:"",y=Math.abs(e);g=i?function(e){var r=Math.floor(e),t=0,n="",o="",i=!1;if(0===r)return Le[0];for(;r>0;){var a=r%1e4;i&&(o=Le[0]+o),n=He(a),o=(n+=0!==a?ze[t]:ze[0])+o,i=a<1e3&&a>0,r=Math.floor(r/1e4),t++}return o}(y):qe(Math.floor(y));var m=function(e){var r=e+"",t=r.indexOf("."),n="";return t>-1&&(n=qe(r.slice(t+1))),n}(y);return m?"".concat(b).concat(g).concat(v).concat(m):"".concat(b).concat(g)},e.padZero=function(e,r){void 0===r&&(r=2);var t=E(e),n=t.length;return("number"!=typeof r||r<0)&&(r=0),n<r?"0".repeat(r-n)+t:t},e.parseIdCard=function(e){var r=Ge.exec(e);if(!r)return null;var t=r.groups||{province:r[1],city:r[2],area:r[3],year:r[4],month:r[5],day:r[6],gender:r[7]},n=Qe.find((function(e){return e[0]===t.province}));if(!n)return null;var o="".concat(t.year,"-").concat(t.month,"-").concat(t.day),i=Number(t.gender)%2==0?"女":"男";return{province:n[1],birthday:o,gender:i,origin:t}},e.plus=function e(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=r[0],o=void 0===r[1]?0:r[1],i=r.slice(2);if(i.length>0)return e.apply(void 0,[e(n,o)].concat(i));if(n=je(n),o=je(o),T(n)||T(o))return Number.NaN;var a=Math.pow(10,Math.max(Pe(n),Pe(o)));return(Ke(n,a)+Ke(o,a))/a},e.randomString=function(e,r){void 0===e&&(e=0);var t="string"==typeof r&&r?r:mr;return wr(x(e),t)},e.replaceChar=function(e,r){void 0===e&&(e=""),void 0===r&&(r={});var t=r.char,n=void 0===t?"*":t,o=r.exclude,i=r.start,a=void 0===i?3:i,u=r.end,c=void 0===u?-4:u,l=r.repeat,d=E(e),s=d.length;if(Math.abs(a)>=s)return d;if((a=a>=0?a:s+a)>=(c=c>=0?c:s+c))return d;var f=d.substring(a,c);if(o){var v=new RegExp("[^".concat(o,"]"),"g");f=f.replace(v,n)}else l="number"==typeof l&&l>=0?l:f.length,f=n.repeat(l);return d.substring(0,a)+f+d.substring(c)},e.round=function(e,r){return void 0===r&&(r=0),$(e,r)},e.safeDate=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];var n="string"==typeof e?e.replace(/[\\.-]/g,"/"):e;return r&&r.length>0?new(Date.bind.apply(Date,Se([void 0,n],Re(r),!1))):void 0===n?new Date:new Date(n)},e.setDataURLPrefix=function(e,r,t){return void 0===r&&(r="image/png"),void 0===t&&(t=!0),"data:".concat(r).concat(t?";base64":"",",").concat(e)},e.setDisableWarning=function(e){G.disableWarning=!!e},e.strlen=function(e){for(var r=E(e),t=0,n=0;n<r.length;n++){var o=r.charCodeAt(n);o>=1&&o<=126||65376<=o&&o<=65439?t++:t+=2}return t},e.times=Ke,e.transformFieldNames=function(e,r,t,n){return void 0===n&&(n="spread"),p(e)?e.length<=0?[]:function e(o){return o.map((function(o){if(!h(o))return o;var i="spread"===n?Ee({},o):o,a=[];return t&&p(i[t])&&i[t].length>0&&(i[t]=e(i[t].slice())),or(r).forEach((function(e){var t=r[e];t in i&&(i[e]=i[t],a.push(t))})),a.length>0&&a.forEach((function(e){delete i[e]})),i}))}(e.slice()):e},e.treeToList=function(e,r){var t=[];return p(e)?(function e(n){n.forEach((function(n){if(h(n)){var o=Ee({},n);t.push(o),o[r]&&(p(o[r])&&o[r].length>0&&e(o[r]),delete o[r])}else t.push(n)}))}(e),t):t},e.validatePassword=re,e.version="4.21.1",e.waitTime=function(e){return void 0===e&&(e=1e3),void 0===(r=e)&&(r=1e3),new Promise((function(e){setTimeout(e,r)}));var r}}));
2
2
  //# sourceMappingURL=util-helpers.min.js.map