util-helpers 4.23.0 → 5.0.0
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.
- package/dist/util-helpers.js +159 -322
- package/dist/util-helpers.js.map +1 -1
- package/dist/util-helpers.min.js +1 -1
- package/dist/util-helpers.min.js.map +1 -1
- package/esm/VERSION.js +1 -1
- package/esm/compressImage.js +2 -2
- package/esm/formatBankCard.js +3 -5
- package/esm/formatMobile.js +4 -6
- package/esm/getImageInfo.js +14 -47
- package/esm/index.js +0 -8
- package/esm/isBusinessLicense.js +1 -2
- package/esm/isSocialCreditCode.js +1 -3
- package/esm/loadImage.js +17 -44
- package/esm/loadImageWithBlob.js +17 -45
- package/lib/VERSION.js +1 -1
- package/lib/compressImage.js +2 -2
- package/lib/formatBankCard.js +3 -5
- package/lib/formatMobile.js +4 -6
- package/lib/getImageInfo.js +14 -47
- package/lib/index.js +1 -9
- package/lib/isBusinessLicense.js +1 -2
- package/lib/isSocialCreditCode.js +1 -3
- package/lib/loadImage.js +16 -43
- package/lib/loadImageWithBlob.js +16 -44
- package/package.json +11 -11
- package/types/AsyncMemo.d.ts +2 -2
- package/types/ajax.d.ts +2 -2
- package/types/calculateCursorPosition.d.ts +2 -2
- package/types/compressImage.d.ts +3 -5
- package/types/dataURLToBlob.d.ts +1 -1
- package/types/download.d.ts +3 -3
- package/types/fileReader.d.ts +1 -1
- package/types/formatBankCard.d.ts +1 -3
- package/types/formatMobile.d.ts +0 -2
- package/types/gcd.d.ts +1 -1
- package/types/getImageInfo.d.ts +1 -2
- package/types/index.d.ts +2 -10
- package/types/isBankCard.d.ts +1 -1
- package/types/isBusinessLicense.d.ts +1 -3
- package/types/isChinese.d.ts +3 -3
- package/types/isHMCard.d.ts +1 -1
- package/types/isIdCard.d.ts +2 -2
- package/types/isPassport.d.ts +1 -1
- package/types/isPassword.d.ts +1 -1
- package/types/isSocialCreditCode.d.ts +1 -3
- package/types/isSwiftCode.d.ts +1 -1
- package/types/isTWCard.d.ts +1 -1
- package/types/isUrl.d.ts +1 -1
- package/types/isVehicle.d.ts +1 -1
- package/types/lcm.d.ts +1 -1
- package/types/loadImage.d.ts +1 -10
- package/types/loadImageWithBlob.d.ts +3 -5
- package/types/numberToChinese.d.ts +1 -1
- package/types/parseIdCard.d.ts +1 -1
- package/types/safeDate.d.ts +1 -1
- package/types/setDataURLPrefix.d.ts +2 -2
- package/types/validatePassword.d.ts +1 -1
- package/esm/blobToDataURL.js +0 -7
- package/esm/isPromiseLike.js +0 -7
- package/esm/normalizeString.js +0 -7
- package/esm/utils/Cache.js +0 -47
- package/esm/waitTime.js +0 -8
- package/lib/blobToDataURL.js +0 -9
- package/lib/isPromiseLike.js +0 -9
- package/lib/normalizeString.js +0 -9
- package/lib/utils/Cache.js +0 -49
- package/lib/waitTime.js +0 -10
- package/types/blobToDataURL.d.ts +0 -29
- package/types/isPromiseLike.d.ts +0 -19
- package/types/normalizeString.d.ts +0 -26
- package/types/utils/Cache.d.ts +0 -14
- package/types/waitTime.d.ts +0 -24
package/dist/util-helpers.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).utilHelpers={})}(this,(function(t){"use strict";var e=void 0,r="undefined",n="object",o=Object.prototype,i=o.toString,a=o.hasOwnProperty,c=o.propertyIsEnumerable,u=Object.getOwnPropertySymbols,s=Object.getPrototypeOf,f=Object.keys,l=Function.prototype.toString,d=typeof Symbol!==r?Symbol.prototype:e,h=Math.min,p=Math.max,v=Math.random,y=Math.floor,g=Math.ceil,m=Number.isFinite,b=typeof globalThis===n&&globalThis,w=typeof global===n&&global,x=typeof self===n&&self,O=Number.MAX_SAFE_INTEGER||9007199254740991,k=Number.MIN_SAFE_INTEGER||-9007199254740991,C="[object Number]",E="[object String]",N="[object Symbol]",j=["Function","AsyncFunction","GeneratorFunction","Proxy"].map((function(t){return"[object "+t+"]"})),A="[object Blob]";function R(t){return Array.isArray(t)}function S(t){var e=typeof t;return"function"===e||"object"===e&&!!t}function T(t){return i.call(t)}function P(t){return"symbol"==typeof t||T(t)===N}var F=/^0b[01]+$/i,M=/^0o[0-7]+$/i,_=/^[-+]0x[0-9a-f]+$/i;function I(t){if("number"==typeof t)return t;if(P(t))return NaN;if(S(t)&&(t=Number(t)),"string"!=typeof t)return 0===t?t:+t;t=t.trim();var e=F.test(t);return e||M.test(t)?parseInt(t.slice(2),e?2:8):_.test(t)?NaN:+t}function L(t){return t}function B(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=O}(t.length)&&!function(t){if("function"==typeof t)return!0;var e=T(t);return j.some((function(t){return t===e}))}(t)}var $=17976931348623157e292;function D(t){return t?(t=I(t))===1/0||t===-1/0?(t<0?-1:1)*$:t==t?t:0:0===t?t:0}function U(t,e){void 0===t&&(t=0),void 0===e&&(e=1),t=D(t),e=D(e);var r=g(h(t,e)||0),n=y(p(t,e)||0);if(r>n){var o=r;r=n,n=o}return y(r+v()*(n-r+1))}function V(t){return S(t)?f(t).concat(function(t){return u&&null!==t?u(t).filter((function(e){return c.call(t,e)})):[]}(t)):[]}var z,W=(z=1,function(t,e){void 0===e&&(e=L);for(var r=!B(t)&&V(t),n=(r||t).length,o=0;o>=0&&o<n;){var i=r?r[o]:o;if(!1===e(t[i],i,t))break;o+=z}return t});function Z(t){return"number"==typeof t||T(t)===C}var H=d?d.toString:e;function X(t){if("string"==typeof t)return t;if(R(t))return""+t.map(X);if(P(t))return H?H.call(t):"";var e=""+t;return"0"===e&&1/t==-1/0?"-0":e}function K(t){return function(t){return null==t}(t)?"":X(t)}var q=typeof Blob!==r;function G(t){return!!(q&&t instanceof Blob)||T(t)===A}var J=l.call(Object);function Q(t){if(!function(t){return null!==t&&"object"==typeof t}(t)||"[object Object]"!==T(t))return!1;var e=s(Object(t));if(null===e)return!0;var r=a.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&l.call(r)===J}var Y=b&&globalThis.Object===Object&&globalThis,tt=w&&global.Object===Object&&global,et=x&&self.Object===Object&&self,rt=Y||tt||et||Function("return this")();function nt(t){return Z(t)&&rt.isNaN(t)}function ot(t){return S(t)&&"function"==typeof t.then}function it(t){return"string"==typeof t||T(t)===E}function at(t,e,r){void 0===r&&(r=0);var n=Math[t];if(e=I(e),r=h(function(t){var e=I(t);if(!e||e===1/0||e===-1/0)return e==e?e:0;var r=e%1;return r?e-r:e}(r),292),0===r||!function(t){return m?m(t):"number"==typeof t&&rt.isFinite(t)}(e))return n(e);var o=K(e).split("e");return+((o=K(e=n(+(o[0]+"e"+(o[1]?+o[1]+r:r)))).split("e"))[0]+"e"+(o[1]?+o[1]-r:-r))}function ct(t,e){return at("round",t,e)}var ut=0;var st=/^1[3456789]\d{9}$/;var ft=/^(0\d{2,3}-)?([2-9]\d{6,7})(-\d{1,6})?$/;var lt=/^\d{6}$/;var dt=/^[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 ht=/^[\da-z]+([-._]?[\da-z]+)*@[\da-z]+([-.]?[\da-z]+)*(\.[a-z]{2,})+$/i;var pt=/^[1-9]\d{4,10}$/;var vt=/^[a-z]([-_a-z0-9]{5,19})+$/i;var yt=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领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 gt=/^[1-9]\d{9,20}$/,mt=/^\d{8,30}$/;var bt=/^[\dA-HJ-NPQRTUWXY]{2}\d{6}[\dA-HJ-NPQRTUWXY]{10}$/,wt="0123456789ABCDEFGHJKLMNPQRTUWXY".split("");var xt={disableWarning:!0};function Ot(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];xt.disableWarning||console.warn.apply(void 0,t)}var kt=/\d/,Ct=/[a-z]/,Et=/[A-Z]/,Nt=/[\d|a-z]/gi;function jt(t){return t.indexOf("\\x")>-1||t.indexOf("\\u")>-1}function At(t,e){void 0===e&&(e={});var r=e.level,n=void 0===r?2:r,o=e.ignoreCase,i=void 0!==o&&o,a=e.special,c=void 0===a?"\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E":a,u=t;"string"!=typeof t&&(Ot("[validatePassword] value must be a string."),u="");var s=0,f=kt.test(u),l=Ct.test(u),d=Et.test(u),h=function(t,e){if(!e||!t)return!1;var r=t.replace(Nt,"");if(!r)return!1;var n=jt(e)?new RegExp("[".concat(e,"]")):null;if(n)return n.test(r);var o=!1;return r.split("").some((function(t){return e.indexOf(t)>-1&&(o=!0),o})),o}(u,c),p=function(t,e){if(!t)return!1;var r=t.replace(Nt,"");if(!r)return!1;if(!e)return!0;var n=jt(e)?new RegExp("[^".concat(e,"]")):null;if(n)return n.test(r);var o=!1;return r.split("").some((function(t){return-1===e.indexOf(t)&&(o=!0),o})),o}(u,c);return f&&(s+=1),i?(l||d)&&(s+=1):(l&&(s+=1),d&&(s+=1)),h&&(s+=1),{validated:s>=n&&!p,level:s,containes:{number:f,lowerCaseLetter:l,upperCaseLetter:d,specialCharacter:h,unallowableCharacter:p}}}var Rt=/^((e[\da-z])|(de)|(se)|(pe)|([khm][\da-z]))[\da-z]{7}$/i;var St,Tt="undefined"!=typeof URL,Pt=void 0,Ft=Object.keys,Mt=Object.values,_t=Tt?URL.createObjectURL:(St="",function(){return St}),It=Tt?URL.revokeObjectURL:function(){},Lt={chineseBasic:"[一-龥]",chineseExtend:"[麦-鿿]",chineseExtend2:"[豈-龎]",chineseExtendA:"[㐀-䶿]",chineseExtendB:"[𠀀-𪛟]",chineseExtendC:"[𪜀-𫜸]",chineseExtendD:"[𫝀-𫠝]",chineseExtendE:"[𫠠-𬺡]",chineseExtendF:"[𬺰-𮯠]",chineseExtendG:"[𰀀-𱍊]",chineseExtendH:"[𱍐-𲎯]",chineseExtendI:"[-]"},Bt=Lt.chineseBasic+"+",$t="^"+Lt.chineseBasic+"+$",Dt="(?:"+Mt(Lt).join("|")+")",Ut=Dt+"+",Vt="^"+Dt+"+$",zt=RegExp.prototype.hasOwnProperty("unicode");var Wt=/^((\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 Zt=/^((([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 Ht="localhost|(([^\\s:\\/]+?\\.)+?[^\\s:\\/]+)",Xt=":\\d+",Kt="\\/.*",qt="\\?.*",Gt=new RegExp("^".concat("[\\w-.]+:\\/\\/","(?:").concat("[-;:&=\\+\\$,\\w]+@",")?(?:").concat(Ht,")(?:").concat(Xt,")?(?:").concat(Kt,")*(?:").concat(qt,")?(?:").concat("#.*",")?$")),Jt=new RegExp("^(?:".concat(Ht,")(?:").concat(Xt,")?(?:").concat(Kt,")*(?:").concat(qt,")?(?:").concat("#.*",")?$"));function Qt(t){var e=K(t);return Gt.test(e)||Jt.test(e)}var Yt=/^\d{15}$/;var te=/^[hm]{1}([0-9]{10}|[0-9]{8})$/i;var ee=/^\d{8}$/i,re=/^[\da-z]{10,12}$/i;var ne=/^[A-Z]{6}[A-Z\d]{2}(?:[A-Z\d]{3})?$/;function oe(t,e){var r;return void 0===e&&(e=!1),"number"==typeof(r=e?"string"==typeof t&&""!==t?Number(t):t:"number"==typeof t?t:P(t)?Number.NaN:Number(t))&&!nt(r)}var ie=function(t,e){return ie=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},ie(t,e)};function ae(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}ie(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var ce=function(){return ce=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ce.apply(this,arguments)};function ue(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function c(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){t.done?o(t.value):function(t){return t instanceof r?t:new r((function(e){e(t)}))}(t.value).then(a,c)}u((n=n.apply(t,e||[])).next())}))}function se(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=e.call(t,a)}catch(t){c=[6,t],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}function fe(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function le(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function de(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var he=/^[-+]?0[b|o|x]\d+/i,pe=/^\.\d+/;function ve(t){var e;return it(t)?""===(e=t.trim())?e=Number(e):he.test(e)||pe.test(e)?e=I(e):nt(Number(e))&&(e=Number.NaN):e=P(t)?Number.NaN:Z(t)?t:Number(t),nt(e)?Number.NaN:e}function ye(t,e){return void 0===e&&(e=12),+parseFloat(t.toPrecision(e))}function ge(t){var e=t.toString().split(/e/i),r=(e[0].split(".")[1]||"").length-+(e[1]||0);return r>0?r:0}function me(t){var e=String(t);if(!function(t){return/\d+\.?\d*e[+-]*\d+/i.test(t)}(e))return Number(e.replace(".",""));var r=ge(t);return r>0?ye(+t*Math.pow(10,r)):+t}function be(t){(+t>O||+t<k)&&Ot("".concat(t," is beyond boundary when transfer to integer, the results may not be accurate"))}var we,xe,Oe,ke=["零","一","二","三","四","五","六","七","八","九"],Ce=["","十","百","千"],Ee=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],Ne=["","拾","佰","仟"];function je(t){for(var e="",r="",n=!1,o=0;t>0;){var i=t%10;0==i?n&&(n=!1,r=we[i]+r):(n=!0,e=we[i],r=(e+=xe[o])+r),o++,t=Math.floor(t/10)}return r}function Ae(t){for(var e=t+"",r="",n=0,o=e.length;n<o;n++)r+=we[parseInt(e[n])];return r}function Re(t,e){void 0===e&&(e={});var r=e.spaceMark,n=void 0===r?" ":r,o=e.precision,i=void 0===o?2:o,a="number"!=typeof t?Number(t):t;if(0===a||nt(a))return"0".concat(n,"B");var c=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],u=Math.floor(Math.log(a)/Math.log(1024));return c[u]?"".concat(Number((a/Math.pow(1024,u)).toFixed(i))).concat(n).concat(c[u]):a+""}var Se=/^(?<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,Te=[["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 Pe={arrayBuffer:"readAsArrayBuffer",binaryString:"readAsBinaryString",dataURL:"readAsDataURL",text:"readAsText"},Fe=function(t,e){void 0===e&&(e="dataURL");var r=Pe[e];return r||(r=Pe.dataURL),new Promise((function(e,n){var o=new FileReader;o[r](t),o.onload=function(){return e(o.result)},o.onerror=function(t){return n(t)}}))};function Me(t){for(var e=t.split(","),r=e[0].substring(5).split(";"),n=r[0],o=(-1!==r.indexOf("base64")?atob:decodeURIComponent)(e[1]),i=o.length,a=new Uint8Array(i);i--;)a[i]=o.charCodeAt(i);return new Blob([a],{type:n})}var _e=function(t,e,r){if(void 0===r&&(r=!0),Q(t)){var n={};return W(t,(function(t,o){var i=r&&(Q(t)||R(t))?_e(t,e):e(t,o);n[o]=i})),n}if(R(t)){var o=[];return W(t,(function(t,n){var i=r&&(Q(t)||R(t))?_e(t,e):e(t,n);o.push(i)})),o}return t};function Ie(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=void 0===t[1]?1:t[1],o=t.slice(2);if(o.length>0)return Ie.apply(void 0,[Ie(r,n)].concat(o));if(r=ve(r),n=ve(n),nt(r)||nt(n))return Number.NaN;var i=me(r),a=me(n),c=ge(r)+ge(n),u=i*a;return be(u),u/Math.pow(10,c)}function Le(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=void 0===t[1]?1:t[1],o=t.slice(2);if(o.length>0)return Le.apply(void 0,[Le(r,n)].concat(o));if(r=ve(r),n=ve(n),nt(r)||nt(n))return Number.NaN;var i=me(r),a=me(n);return be(i),be(a),Ie(i/a,ye(Math.pow(10,ge(n)-ge(r))))}function Be(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=void 0===t[1]?0:t[1],o=t.slice(2);if(o.length>0)return Be.apply(void 0,[Be(r,n)].concat(o));if(r=Math.abs(ct(r)),n=Math.abs(ct(n)),nt(r)||nt(n))return Number.NaN;if(0===r&&0===n)return 0;if(0===r)return n;if(0===n)return r;var i=n;for(r<n&&(i=r,r=n,n=i);i;)i=r%n,r=n,n=i;return I(r)}function $e(t,e){var r=e||{},n=r.method,o=void 0===n?"get":n,i=r.data,a=void 0===i?null:i,c=r.timeout,u=r.headers,s=r.withCredentials,f=void 0!==s&&s,l=r.async,d=void 0===l||l,h=r.user,p=void 0===h?null:h,v=r.password,y=void 0===v?null:v,g=r.responseType,m=r.onReadyStateChange,b=r.onLoadStart,w=r.onProgress,x=r.onAbort,O=r.onTimeout,k=r.onError,C=r.onLoad,E=r.onLoadEnd;return new Promise((function(e,r){var n=new XMLHttpRequest;n.open(o.toLowerCase(),t,d,p,y),m&&(n.onreadystatechange=m),"number"==typeof c&&c>0&&(n.timeout=c),n.withCredentials=f,g&&(n.responseType=g),"object"==typeof u&&Ft(u).map((function(t){n.setRequestHeader(t,u[t])}));var i,s=function(t){return function(e){r(e),null==t||t.call(n,e)}},l={loadstart:b,progress:w,abort:s(x),timeout:s(O),error:s(k),load:(i=C,function(t){e(t),null==i||i.call(n,t)}),loadend:E};Ft(l).map((function(t){var e=l[t];e&&n.addEventListener(t,e)})),n.send(a)}))}var De=[200,304];function Ue(t,e){return new Promise((function(r,n){G(t)?r(t):$e(t,ce({responseType:"blob"},e)).then((function(e){var o=e.target.status;if(-1!==De.indexOf(o))r(e.target.response);else{var i=new Error("The file does not support get requests, responseStatus ".concat(o,", '").concat(t,"'."));console.error(i),n(i)}})).catch((function(t){console.error(new Error("Failed to request file. ".concat(t))),n(t)}))}))}var Ve=function(){function t(){this.handlers={}}return t.prototype.eventNames=function(){var t,e=(null===(t=Object.getOwnPropertySymbols)||void 0===t?void 0:t.call(Object,this.handlers))||[];return Object.keys(this.handlers).concat(e)},t.prototype.rawListeners=function(t){var e=this.handlers[t];return e?e.map((function(t){return t.raw})):[]},t.prototype.listeners=function(t){var e=this.handlers[t];return e?e.map((function(t){return t.wrap})):[]},t.prototype.hasListener=function(t,e){return this.rawListeners(t).some((function(t){return t===e}))},t.prototype._on=function(t,e,r,n,o){void 0===n&&(n=null),void 0===o&&(o=1);var i={raw:e,wrap:r,context:n};if(this.handlers[t]){var a=1===o?"push":"unshift";this.handlers[t][a](i)}else this.handlers[t]=[i];return this},t.prototype.prependListener=function(t,e,r){return this._on(t,e,e,r,0)},t.prototype.on=function(t,e,r){return this._on(t,e,e,r)},t.prototype._wrapOnce=function(t,e,r){var n=this;void 0===r&&(r=null);var o=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];e.apply(r,i),n.off(t,o)};return o},t.prototype.once=function(t,e,r){var n=this._wrapOnce(t,e,r);return this._on(t,e,n,r)},t.prototype.prependOnceListener=function(t,e,r){var n=this._wrapOnce(t,e,r);return this._on(t,e,n,r,0)},t.prototype.off=function(t,e){var r=this.handlers[t];if(r)if(e){var n=r.findIndex((function(t){return t.wrap===e||t.raw===e}));-1!==n&&r.splice(n,1)}else delete this.handlers[t];return this},t.prototype.offAll=function(){return this.handlers={},this},t.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=this.handlers[t];return!!(n&&n.length>0)&&(n.forEach((function(t){t.wrap.apply(t.context,e)})),!0)},t}(),ze=function(t){function e(e){var r=t.call(this)||this;return r.data=[],r.options=ce({max:10},e),r}return ae(e,t),e.prototype.has=function(t){return!!this.data.find((function(e){return e.k===t}))},e.prototype.get=function(t){var e;return null===(e=this.data.find((function(e){return e.k===t})))||void 0===e?void 0:e.v},e.prototype.checkLimit=function(){var t=this;if(0!==this.options.max){var e=this.data.length-this.options.max;if(e>=0){var r=this.data.splice(0,e+1);W(r,(function(e){t.emit("del",e.v,e.k)}))}}},e.prototype.set=function(t,e){var r={k:t,v:e};if(this.has(t)){var n=this.data.findIndex((function(e){return e.k===t}));this.data.splice(n,1,r)}else this.checkLimit(),this.data.push(r)},e}(Ve),We=new ze({max:1});function Ze(t,e,r){void 0===e&&(e=!0);var n={useCache:"object"==typeof e?!1!==e.useCache:!1!==e,autoRevokeOnDel:"object"==typeof e?!1!==e.autoRevokeOnDel:!!e};return new Promise((function(e,o){n.useCache&&We.has(t)?e(We.get(t).data):Ue(t,r).then((function(r){var i=_t(r),a=new Image;a.onload=function(){var o={blob:r,image:a};n.useCache&&We.set(t,{data:o,r:n.autoRevokeOnDel}),e(o)},a.onerror=function(e){It(i),console.error("[loadImageWithBlob] The image load failed, '".concat(t,"'.")),o(e)},a.src=i})).catch(o)}))}We.on("del",(function(t){if(t.r)try{It(t.data.image.src)}catch(t){}}));function He(t,e){void 0===e&&(e="");var r=document.createElement("a");r.href=t,r.style.display="none",r.setAttribute("download",e),r.addEventListener("click",(function t(e){e.stopPropagation(),r.removeEventListener("click",t)})),document.body.appendChild(r),r.click(),document.body.removeChild(r)}var Xe=new ze({max:1});Xe.on("del",(function(t){if(t.r)try{It(t.data.image.src)}catch(t){}}));var Ke=new ze({max:1});Ke.on("del",(function(t){if(t.r)try{It(t.data.src)}catch(t){}}));var qe="abcdefghijklmnopqrstuvwxyz",Ge={number:"0123456789",lower:qe,upper:qe.toUpperCase()},Je=Ge.number+Ge.lower+Ge.upper;function Qe(t,e,r){for(void 0===r&&(r="");t-- >0;){return Qe(t,e,r+e[U(0,e.length-1)])}return r}function Ye(t,e){var r=e.childrenField,n=void 0===r?"children":r,o=e.emptyChildrenValue,i=void 0===o?"none":o;t.forEach((function(t){t[n].length<=0?"null"===i?t[n]=null:delete t[n]:Ye(t[n],e)}))}function tr(t,e,r,n){var o,i;if(void 0===n&&(n=[]),!R(t))return[];try{for(var a=fe(t),c=a.next();!c.done;c=a.next()){var u=c.value;if(n.push(u),e(u))return n;if(S(u)){var s=u[r];if(R(s)&&s.length>0){var f=tr(s,e,r,n);if(f.length>0)return f}}n.pop()}}catch(t){o={error:t}}finally{try{c&&!c.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}return[]}var er=1;function rr(){return"".concat(Math.random().toString(16).substring(2,8),"_").concat(er++)}var nr="undefined"!=typeof window&&"object"==typeof window&&window.window===window,or={},ir=function(){function t(t){void 0===t&&(t="default"),this.scope=t,or[this.scope]||(or[this.scope]={}),this.data=or[this.scope]}return t.prototype.getItem=function(t){return t in this.data?this.data[t]:null},t.prototype.setItem=function(t,e){this.data[t]=e},t.prototype.removeItem=function(t){delete this.data[t]},t.prototype.clear=function(){or[this.scope]={},this.data=or[this.scope]},t}(),ar=function(){function t(t,e){void 0===e&&(e={});var r=!!t&&function(t){try{var e="object"==typeof t&&null!==t&&!!t.setItem&&!!t.getItem&&!!t.removeItem;if(e){var r=rr();if(t.setItem(r,"1"),"1"!==t.getItem(r))return!1;t.removeItem(r)}return e}catch(e){return console.error("[cache2] ".concat(t," is not supported. The default memory cache will be used.")),!1}}(t);this.options=ce({needParsed:r},e),this.storage=r?t:new ir(this.options.memoryScope)}return t.prototype.get=function(t){var e=this.storage.getItem(t);return this.options.needParsed?function(t,e){try{return JSON.parse(t,e)}catch(e){return t}}(e,this.options.reviver):e},t.prototype.set=function(t,e){this.storage.setItem(t,this.options.needParsed?function(t,e){return JSON.stringify(t,e)}(e,this.options.replacer):e)},t.prototype.del=function(t){this.storage.removeItem(t)},t.prototype.clear=function(){"function"==typeof this.storage.clear&&this.storage.clear()},t}(),cr=function(t){function e(e,r){var n,o=t.call(this)||this,i="default";return"string"==typeof e?i=e:"object"==typeof e&&(n=e),n||"object"!=typeof r||(n=r),o.options=ce({max:-1,stdTTL:0,maxStrategy:"limited",checkperiod:0,prefix:"cache2_"},n),o.storage=new ar(o.options.storage,ce({memoryScope:i},n)),o.cacheKey=(o.options.prefix||"")+(i||"")||rr(),o.startCheckperiod(),o}return ae(e,t),e.prototype._check=function(t,e){var r=!0;return 0!==e.t&&e.t<Date.now()&&(r=!1,this.del(t),this.emit("expired",t,e.v)),r},e.prototype._wrap=function(t,e){var r=Date.now(),n="number"==typeof e?e:this.options.stdTTL;return{v:t,t:n>0?r+n:0,n:r}},e.prototype._isLimited=function(t){return this.options.max>-1&&t>=this.options.max},e.prototype._getReplaceKey=function(t,e){var r=t[0];return t.forEach((function(t){(e[t].t<e[r].t||e[t].t===e[r].t&&e[t].n<e[r].n)&&(r=t)})),r},Object.defineProperty(e.prototype,"cacheValues",{get:function(){return this.storage.get(this.cacheKey)||{}},enumerable:!1,configurable:!0}),e.prototype.setCacheValues=function(t){this.storage.set(this.cacheKey,t)},e.prototype.get=function(t){var e=this.cacheValues[t];if(e&&this._check(t,e))return e.v},e.prototype.mget=function(t){var e=this,r={};if(!Array.isArray(t))return r;var n=this.cacheValues;return t.forEach((function(t){var o=n[t];o&&e._check(t,o)&&(r[t]=o.v)})),r},e.prototype.getAll=function(){var t=Object.keys(this.cacheValues);return this.mget(t)},e.prototype.set=function(t,e,r){if(0===this.options.max)return!1;var n=this.cacheValues,o=Object.keys(n);if(!n[t]&&this._isLimited(o.length)){var i=this.keys();if(this._isLimited(i.length)){if("replaced"!==this.options.maxStrategy)return!1;var a=this._getReplaceKey(i,n);this.del(a)}}return n[t]=this._wrap(e,r),this.setCacheValues(n),this.emit("set",t,n[t].v),!0},e.prototype.mset=function(t){var e=this,r=!0;return t.forEach((function(t){var n=e.set(t.key,t.value,t.ttl);r&&!n&&(r=!1)})),r},e.prototype.del=function(t){var e=this,r=this.cacheValues,n=0;return(Array.isArray(t)?t:[t]).forEach((function(t){if(r[t]){n++;var o=r[t];delete r[t],e.emit("del",t,o.v)}})),n>0&&this.setCacheValues(r),n},e.prototype.clear=function(){this.storage.del(this.cacheKey)},e.prototype.keys=function(){var t=this,e=this.cacheValues;return Object.keys(e).filter((function(r){return t._check(r,e[r])}))},e.prototype.has=function(t){var e=this.cacheValues[t];return!(!e||!this._check(t,e))},e.prototype.take=function(t){var e,r=this.cacheValues[t];return r&&this._check(t,r)&&(e=r.v,this.del(t)),e},e.prototype.ttl=function(t,e){var r=this.cacheValues,n=r[t];return!(!n||!this._check(t,n))&&(r[t]=this._wrap(n.v,e),!0)},e.prototype.getTtl=function(t){var e=this.cacheValues,r=e[t];if(r&&this._check(t,r))return e[t].t},e.prototype.getLastModified=function(t){var e=this.cacheValues,r=e[t];if(r&&this._check(t,r))return e[t].n},e.prototype.startCheckperiod=function(){var t=this;this.keys(),this.options.checkperiod>0&&(clearTimeout(this._checkTimeout),this._checkTimeout=setTimeout((function(){t.startCheckperiod()}),this.options.checkperiod))},e.prototype.stopCheckperiod=function(){clearTimeout(this._checkTimeout)},e}(Ve);new ar(nr?window.localStorage:void 0),new ar(nr?window.sessionStorage:void 0);var ur=function(){function t(t){var e;this.promiseCache={},this.cache=new cr((e=++ut,K("uh_async_memo")+e),t)}return t.prototype.run=function(t,e,r){var n=this;if(!e||!it(e))return t();var o=ce({persisted:!0},r);if(o.persisted){var i=this.cache.get(e);if(i)return Promise.resolve(i)}return this.promiseCache[e]||(this.promiseCache[e]=t().then((function(t){return delete n.promiseCache[e],n.cache.set(e,t,o.ttl),t})).catch((function(t){return delete n.promiseCache[e],Promise.reject(t)}))),this.promiseCache[e]},t}();t.AsyncMemo=ur,t.VERSION="4.23.0",t.ajax=$e,t.blobToDataURL=function(t){return Fe(t)},t.bytesToSize=Re,t.calculateCursorPosition=function(t,e,r,n,o){void 0===o&&(o={});var i=o.placeholderChar,a=void 0===i?" ":i,c=o.maskReg,u=void 0===c?/\D/g:c,s=o.type,f=K(e),l=K(r),d=R(a)?a:[a],h=l.length-f.length,p=t;if(h>0){var v=l.substring(p-h,p).replace(u,"").length;p-=h-v;for(var y=0;v>0;)-1!==d.indexOf(n.charAt(p-v+y))?y++:v--;p+=y}return("mobile"===s&&(4===p||9===p)||"bankCard"===s&&p>0&&p%5==0)&&(p-=1),p},t.compressImage=function(t,e){return void 0===e&&(e={}),new Promise((function(r,n){var o=e.width,i=e.height,a=e.rotate,c=e.offset,u=void 0===c?[0,0]:c,s=e.cacheImage,f=void 0===s||s,l=e.background,d=void 0===l?"#fff":l,h=e.canvasWidth,p=e.canvasHeight,v=e.format,y=void 0===v?"blob":v,g=e.type,m=void 0===g?"image/jpeg":g,b=e.quality,w=void 0===b?.8:b,x=e.beforeCompress,O=e.beforeDraw,k=e.afterDraw,C=e.ajaxOptions;Ze(t,f,C).then((function(t){var c=t.image,s=t.blob,f=I(o),l=I(i),v=I(w);f&&(c.width=f),l&&(c.height=l),null==x||x({image:c,blob:s},e);var g=document.createElement("canvas"),b=g.getContext("2d"),C={image:c,blob:s,canvas:g,context:b},E=I("function"==typeof h?h(C,e):h),N=I("function"==typeof p?p(C,e):p);g.width=E||c.width,g.height=N||c.height;var j="none"===d||"transparent"===d;j?b.clearRect(0,0,g.width,g.height):(b.fillStyle=d,b.fillRect(0,0,g.width,g.height));var A=[0,0];a!==Pt&&(b.translate(c.width/2,c.height/2),A=[-c.width/2,-c.height/2],b.rotate(a*Math.PI/180));var R="function"==typeof u?u(C,e):u;null==O||O(C,e);var S=A[0]+I(R[0]),T=A[1]+I(R[1]);b.drawImage(c,S,T,c.width,c.height),"image/png"===m&&j&&(b.globalCompositeOperation="destination-in",b.drawImage(c,S,T,c.width,c.height)),null==k||k(C,e),"blob"===y?function(t,e,r){return new Promise((function(n){t.toBlob((function(t){n(t)}),e,r)}))}(g,m,v).then(r).catch(n):r(g.toDataURL(m,v))})).catch(n)}))},t.dataURLToBlob=Me,t.divide=Le,t.download=function t(e,r){return ue(this,void 0,void 0,(function(){var n,o,i,a,c,u,s,f,l,d,h,p,v;return se(this,(function(y){switch(y.label){case 0:return n="object"==typeof r?r:{},"string"==typeof r&&(n.fileName=r),o=n.fileName,i=n.type,a=n.dataType,c=n.transformRequest,u=n.transformResponse,"string"!=typeof e?[3,8]:a||!/^blob:.*?\/.*/.test(e)?[3,1]:(He(e,o),[2,Promise.resolve()]);case 1:return a||!/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(e)?[3,2]:(s=Me(e),[3,7]);case 2:return"url"===a||!a&&Qt(e)?(f=function(t){var e="function"==typeof u?u(t):t;return ot(e)?e:Promise.resolve(e)},[4,function(t){var e="function"==typeof c?c(t):t;return ot(e)?e:Promise.resolve(e)}({responseType:"blob"})]):[3,6];case 3:return l=y.sent(),[4,$e(e,l)];case 4:return d=y.sent(),[4,f(d.target.response)];case 5:return h=y.sent(),p=o||e.split("?")[0].split("#")[0].split("/").pop(),[2,t(h,{fileName:p,type:i||(G(h)?h.type:Pt)})];case 6:s=new Blob([e],{type:i||"text/plain"}),y.label=7;case 7:return[3,9];case 8:e instanceof Blob&&(s=e),y.label=9;case 9:return s||(s=new Blob([e],{type:i})),navigator.msSaveBlob?navigator.msSaveBlob(s,o||"download"):(He(v=_t(s),o),It(v)),[2,Promise.resolve()]}}))}))},t.fileReader=Fe,t.filterTree=function t(e,r,n,o){void 0===n&&(n="children"),void 0===o&&(o="spread");var i=[];return R(e)?(e.forEach((function(e){var a=e;if(S(e)&&(a="spread"===o?ce({},e):e),r(a)){if(S(a)){var c=a[n];R(c)&&c.length>0&&(a[n]=t(c,r,n,o))}i.push(a)}})),i):i},t.findTreeNode=function(t,e,r){var n,o;void 0===r&&(r="children");var i,a=[];if(!R(t))return i;try{for(var c=fe(t),u=c.next();!u.done;u=c.next()){var s=u.value;for(a.push(s);a.length;){var f=a.pop();if(e(f)){i=f;break}if(S(f)){var l=f[r];R(l)&&l.length>0&&l.forEach((function(t){a.push(t)}))}}if(i)break}}catch(t){n={error:t}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}return i},t.findTreeNodes=function(t,e,r){var n,o;void 0===r&&(r="children");var i=[],a=[];if(!R(t))return a;try{for(var c=fe(t),u=c.next();!u.done;u=c.next()){var s=u.value;for(i.push(s);i.length;){var f=i.pop();if(e(f)&&a.push(f),S(f)){var l=f[r];R(l)&&l.length>0&&l.forEach((function(t){i.push(t)}))}}}}catch(t){n={error:t}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}return a},t.findTreeSelect=function(t,e,r){return void 0===r&&(r="children"),tr(t,e,r)},t.formatBankCard=function(t,e){void 0===t&&(t=""),void 0===e&&(e={});var r=e.char,n=void 0===r?" ":r,o=e.length,i=void 0===o?4:o,a="spaceMark"in e?e.spaceMark:n,c=new RegExp("(.{".concat(i,"})"),"g"),u=new RegExp("".concat(a),"g"),s=K(t).replace(u,""),f=s.replace(c,"$1".concat(a));return s.length%i==0?f.substring(0,f.length-1):f},t.formatMobile=function(t,e){void 0===t&&(t=""),void 0===e&&(e={});var r=e.char,n=void 0===r?" ":r,o="spaceMark"in e?e.spaceMark:n,i=new RegExp(o,"g"),a=K(t).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},t.formatMoney=function(t,e){void 0===t&&(t=""),void 0===e&&(e={});var r=e.precision,n=void 0===r?2:r,o=e.symbol,i=e.thousand,a=void 0===i?",":i,c=e.decimal,u=void 0===c?".":c;if(!function(t){return oe(t)?("number"==typeof t&&be(t),!0):(Ot("".concat(t," invalid parameter.")),!1)}(t))return"";if("number"==typeof t&&!isFinite(t))return t+"";"number"!=typeof n||nt(n)||n<0?n=2:n>10&&(n=10),o="string"==typeof o?o:"",a="string"==typeof a?a:",",u="string"==typeof u?u:".";var s=le((ve(t)+"").split("."),2),f=s[0],l=s[1];return o+function(t,e){var r,n,o="";t="+"===(t=(n=/^([+-])?(0+)([0-9.]+)$/.exec(r=t))?(n[1]||"")+("."===n[3][0]?"0"+n[3]:n[3]):r)[0]?t.substring(1):t;for(var i=Number(t)<0?"-":"",a=i?t.substring(1).split("").reverse():t.split("").reverse(),c=0;c<a.length;c++)o+=a[c]+((c+1)%3==0&&c+1!==a.length?e:"");return i+o.split("").reverse().join("")}(f,a)+function(t,e,r){if(0===e)return"";var n="";return n=t&&Number(t)>0?parseFloat("0."+t).toFixed(e).substring(2):(0).toFixed(e).substring(2),r+n}(l,n,u)},t.gcd=Be,t.getFileBlob=Ue,t.getImageInfo=function(t,e,r){void 0===e&&(e=!0);var n={useCache:"object"==typeof e?!1!==e.useCache:!1!==e,autoRevokeOnDel:"object"==typeof e?!1!==e.autoRevokeOnDel:!!e};return new Promise((function(e,o){n.useCache&&Xe.has(t)?e(Xe.get(t).data):Ze(t,!1,r).then((function(r){var o,i,a,c=r.image,u=r.blob,s=c.width,f=c.height,l={width:s,height:f,contrast:(o=s,i=f,a=Be(o,i),"".concat(Le(ct(o),a),":").concat(Le(ct(i),a))),measure:"".concat(s," × ").concat(f," px"),size:Re(u.size),bytes:u.size,image:c,blob:u};n.useCache&&Xe.set(t,{data:l,r:n.autoRevokeOnDel}),e(l)})).catch(o)}))},t.isBankCard=function(t,e){void 0===e&&(e={});var r=e.loose,n=void 0!==r&&r,o=e.luhn,i=void 0!==o&&o,a=K(t),c=n?mt.test(a):gt.test(a);if(c&&i){var u=a.substring(0,a.length-1);return a[a.length-1]===String(function(t){for(var e=(t+"").replace(/\D/g,"").split("").reverse(),r=0,n=0;n<e.length;n++){var o=parseInt(e[n]);r+=n%2==0?2*o-(o>4?9:0):o}var i=r%10;return 0!==i?10-i:0}(u))}return c},t.isBusinessLicense=function(t,e){void 0===e&&(e={});var r=K(t),n=e.loose,o=void 0!==n&&n,i=e.checkCode,a=!o&&(void 0===i||i),c=Yt.test(r);if(!a||!c)return c;var u=r.substring(0,14),s=r.substring(r.length-1),f=function(t){for(var e=10,r=0;r<14;r++){var n=(e+Number(t[r]))%10;e=2*(n=0===n?10:n)%11}return 1===e?0:11-e}(u);return s===String(f)},t.isChinese=function(t,e){void 0===e&&(e={});var r=e.loose,n=void 0!==r&&r,o=e.useExtend,i=void 0!==o&&o,a=K(t),c=i&&zt;return new RegExp(c?n?Ut:Vt:n?Bt:$t,c?"u":Pt).test(a)},t.isEmail=function(t){var e=K(t);return ht.test(e)},t.isHMCard=function(t){var e=K(t);return te.test(e)},t.isIPv4=function(t){var e=K(t);return Wt.test(e)},t.isIPv6=function(t){var e=K(t);return Zt.test(e)},t.isIdCard=function(t,e){void 0===e&&(e={});var r=e.loose,n=void 0!==r&&r,o=e.checkCode,i=void 0===o||o,a=K(t);return 15===a.length&&n?dt.test(a):!(18!==a.length||!dt.test(a))&&(!i||function(t){var e,r;for(r=e=0;e<17;e++)r+=Math.pow(2,17-e)%11*Number(t[e]);var n=(12-r%11)%11;return n<10?n===Number(t[17]):"X"===t[17].toUpperCase()}(a))},t.isMobile=function(t){var e=K(t);return st.test(e)},t.isPassport=function(t){var e=K(t);return Rt.test(e)},t.isPassword=function(t,e){void 0===e&&(e={});var r=e.level,n=void 0===r?2:r,o=e.ignoreCase,i=void 0!==o&&o,a=e.special;return At(t,{level:n,ignoreCase:i,special:void 0===a?"\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E":a}).validated},t.isPostcode=function(t){var e=K(t);return lt.test(e)},t.isPromiseLike=function(t){return ot(t)},t.isQQ=function(t){var e=K(t);return pt.test(e)},t.isSocialCreditCode=function(t,e){void 0===e&&(e={});var r=K(t),n=e.loose,o=void 0!==n&&n,i=e.checkCode,a=!o&&(void 0===i||i),c=bt.test(r);if(!a||!c)return c;var u=r.substring(0,17),s=r.substring(r.length-1),f=function(t){for(var e=0,r=function(r){var n=wt.findIndex((function(e){return e===t[r]})),o=Math.pow(3,r)%31;e+=n*o},n=0;n<17;n++)r(n);var o=e%31;return wt[0!==o?31-o:0]}(u);return s===f},t.isSwiftCode=function(t){var e=K(t);return ne.test(e)},t.isTWCard=function(t,e){void 0===e&&(e={});var r=e.loose,n=void 0!==r&&r,o=K(t);return!!ee.test(o)||!!n&&re.test(o)},t.isTelephone=function(t){var e=K(t);return ft.test(e)},t.isUrl=Qt,t.isValidNumber=oe,t.isVehicle=function(t){var e=K(t);return yt.test(e)},t.isWX=function(t){var e=K(t);return vt.test(e)},t.lcm=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.map((function(t){return Math.abs(ct(t))}));return 1===r.length&&(r=r.concat([1])),Le(r.indexOf(0)>-1?0:Ie.apply(void 0,de([],le(r),!1)),Be.apply(void 0,de([],le(r),!1)))},t.listToTree=function(t,e){void 0===e&&(e={});var r=e.keyField,n=void 0===r?"id":r,o=e.parentField,i=void 0===o?"pid":o,a=e.childrenField,c=void 0===a?"children":a,u=e.emptyChildrenValue,s=void 0===u?"none":u,f=e.nodeAssign,l=void 0===f?"spread":f,d=[],h={};return R(t)?(t.forEach((function(t){if(S(t)){var e="spread"===l?ce({},t):t,r=e[n],o=e[i];h[r]?e[c]=h[r]:e[c]=h[r]=[],o?h[o]?h[o].push(e):h[o]=[e]:d.push(e)}})),"array"!==s&&Ye(d,e),d):d},t.loadImage=function(t,e){void 0===e&&(e=!0);var r={useCache:"object"==typeof e?!1!==e.useCache:!1!==e,autoRevokeOnDel:"object"==typeof e?!1!==e.autoRevokeOnDel:!!e};return new Promise((function(e,n){if(r.useCache&&Ke.has(t))e(Ke.get(t).data);else{var o=G(t),i=o?_t(t):t,a=new Image;o||(a.crossOrigin="anonymous"),a.onload=function(){r.useCache&&Ke.set(t,{data:a,r:r.autoRevokeOnDel}),e(a)},a.onerror=function(e){o&&It(i),console.error("[loadImage] The image load failed, '".concat(t,"'.")),n(e)},a.src=i}}))},t.loadImageWithBlob=Ze,t.loadScript=function(t,e){return new Promise((function(r,n){var o=document.head,i=document.createElement("script"),a=e||{},c=a.attrs,u=a.destroyOnError,s=void 0===u||u,f=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}(a,["attrs","destroyOnError"]),l=ce(ce({async:!0,type:"text/javascript"},f),{src:t});for(var d in l)"onload"!==d&&"onerror"!==d&&(i[d]=l[d]);"object"==typeof c&&Ft(c).forEach((function(t){i.setAttribute(t,c[t])})),i.onload=function(t){var e;this.onerror=this.onload=null,null===(e=l.onload)||void 0===e||e.call(this,t),r(i)},i.onerror=function(t){var e;this.onerror=this.onload=null,null===(e=l.onerror)||void 0===e||e.call(this,t),s&&o.removeChild(i),n(new URIError("Failed to load "+this.src))},o.appendChild(i)}))},t.minus=function t(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=e[0],o=void 0===e[1]?0:e[1],i=e.slice(2);if(i.length>0)return t.apply(void 0,[t(n,o)].concat(i));if(n=ve(n),o=ve(o),nt(n)||nt(o))return Number.NaN;var a=Math.pow(10,Math.max(ge(n),ge(o)));return(Ie(n,a)-Ie(o,a))/a},t.normalizeString=function(t){return K(t)},t.numberToChinese=function(t,e){void 0===e&&(e={});var r=e.big5,n=void 0!==r&&r,o=e.unit,i=void 0===o||o,a=e.zero,c=void 0===a?"":a,u=e.negative,s=void 0===u?"负":u,f=e.unitConfig,l=void 0===f?{}:f,d=e.decimal,h=void 0===d?"":d;if("number"!=typeof t||nt(t))return Ot("参数错误 ".concat(t,",请传入数字")),"";be(t),n?(we=Ee.slice(),xe=Ne.slice(),h=h||"點"):(we=ke.slice(),xe=Ce.slice(),h=h||"点");var p=(null==l?void 0:l.w)||"万",v=(null==l?void 0:l.y)||"亿";Oe=["",p,v,p+v],c&&(we[0]=c);var y,g=t<0?s:"",m=Math.abs(t);y=i?function(t){var e=Math.floor(t),r=0,n="",o="",i=!1;if(0===e)return we[0];for(;e>0;){var a=e%1e4;i&&(o=we[0]+o),n=je(a),o=(n+=0!==a?Oe[r]:Oe[0])+o,i=a<1e3&&a>0,e=Math.floor(e/1e4),r++}return o}(m):Ae(Math.floor(m));var b=function(t){var e=t+"",r=e.indexOf("."),n="";return r>-1&&(n=Ae(e.slice(r+1))),n}(m);return b?"".concat(g).concat(y).concat(h).concat(b):"".concat(g).concat(y)},t.padZero=function(t,e){void 0===e&&(e=2);var r=K(t),n=r.length;return("number"!=typeof e||e<0)&&(e=0),n<e?"0".repeat(e-n)+r:r},t.parseIdCard=function(t){var e=Se.exec(t);if(!e)return null;var r=e.groups||{province:e[1],city:e[2],area:e[3],year:e[4],month:e[5],day:e[6],gender:e[7]},n=Te.find((function(t){return t[0]===r.province}));if(!n)return null;var o="".concat(r.year,"-").concat(r.month,"-").concat(r.day),i=Number(r.gender)%2==0?"女":"男";return{province:n[1],birthday:o,gender:i,origin:r}},t.plus=function t(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=e[0],o=void 0===e[1]?0:e[1],i=e.slice(2);if(i.length>0)return t.apply(void 0,[t(n,o)].concat(i));if(n=ve(n),o=ve(o),nt(n)||nt(o))return Number.NaN;var a=Math.pow(10,Math.max(ge(n),ge(o)));return(Ie(n,a)+Ie(o,a))/a},t.randomString=function(t,e){var r;return void 0===t&&(t=0),r="string"!=typeof e?Je:Ge[e]?Ge[e]:e,Qe(I(t),r)},t.replaceChar=function(t,e){void 0===t&&(t=""),void 0===e&&(e={});var r=e.char,n=void 0===r?"*":r,o=e.exclude,i=e.start,a=void 0===i?3:i,c=e.end,u=void 0===c?-4:c,s=e.repeat,f=K(t),l=f.length;if(Math.abs(a)>=l)return f;if((a=a>=0?a:l+a)>=(u=u>=0?u:l+u))return f;var d=f.substring(a,u);if(o){var h=new RegExp("[^".concat(o,"]"),"g");d=d.replace(h,n)}else s="number"==typeof s&&s>=0?s:d.length,d=n.repeat(s);return f.substring(0,a)+d+f.substring(u)},t.round=function(t,e){return void 0===e&&(e=0),ct(t,e)},t.safeDate=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n="string"==typeof t?t.replace(/[\\.-]/g,"/"):t;return e&&e.length>0?new(Date.bind.apply(Date,de([void 0,n],le(e),!1))):void 0===n?new Date:new Date(n)},t.setDataURLPrefix=function(t,e,r){return void 0===e&&(e="image/png"),void 0===r&&(r=!0),"data:".concat(e).concat(r?";base64":"",",").concat(t)},t.setDisableWarning=function(t){xt.disableWarning=!!t},t.strlen=function(t){for(var e=K(t),r=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);o>=1&&o<=126||65376<=o&&o<=65439?r++:r+=2}return r},t.times=Ie,t.transformFieldNames=function(t,e,r,n){return void 0===n&&(n="spread"),R(t)?t.length<=0?[]:function t(o){return o.map((function(o){if(!S(o))return o;var i="spread"===n?ce({},o):o,a=[];r&&R(i[r])&&i[r].length>0&&(i[r]=t(i[r].slice()));var c=Ft(e);return c.forEach((function(t){var r=e[t];r in i&&(i[t]=i[r],-1===c.indexOf(r)&&a.push(r))})),a.length>0&&a.forEach((function(t){delete i[t]})),i}))}(t.slice()):t},t.transformObjectValue=_e,t.treeToList=function(t,e){var r=[];return R(t)?(function t(n){n.forEach((function(n){if(S(n)){var o=ce({},n);r.push(o),o[e]&&(R(o[e])&&o[e].length>0&&t(o[e]),delete o[e])}else r.push(n)}))}(t),r):r},t.validatePassword=At,t.version="4.23.0",t.waitTime=function(t){return void 0===t&&(t=1e3),void 0===(e=t)&&(e=1e3),new Promise((function(t){setTimeout(t,e)}));var e}}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).utilHelpers={})}(this,(function(t){"use strict";var e=void 0,r="undefined",n="object",o=Object.prototype,i=o.toString,a=o.hasOwnProperty,c=o.propertyIsEnumerable,u=Object.getOwnPropertySymbols,s=Object.getPrototypeOf,f=Object.keys,l=Function.prototype.toString,d=typeof Symbol!==r?Symbol.prototype:e,p=Math.min,h=Math.max,v=Math.random,y=Math.floor,g=Math.ceil,b=Number.isFinite,m=typeof globalThis===n&&globalThis,w=typeof global===n&&global,x=typeof self===n&&self,O=Number.MAX_SAFE_INTEGER||9007199254740991,E=Number.MIN_SAFE_INTEGER||-9007199254740991,N="[object Number]",A="[object String]",j="[object Symbol]",C=["Function","AsyncFunction","GeneratorFunction","Proxy"].map((function(t){return"[object "+t+"]"})),k="[object Blob]";function S(t){return Array.isArray(t)}function F(t){var e=typeof t;return"function"===e||"object"===e&&!!t}function T(t){return i.call(t)}function P(t){return"symbol"==typeof t||T(t)===j}var _=/^0b[01]+$/i,M=/^0o[0-7]+$/i,I=/^[-+]0x[0-9a-f]+$/i;function R(t){if("number"==typeof t)return t;if(P(t))return NaN;if(F(t)&&(t=Number(t)),"string"!=typeof t)return 0===t?t:+t;t=t.trim();var e=_.test(t);return e||M.test(t)?parseInt(t.slice(2),e?2:8):I.test(t)?NaN:+t}function B(t){return t}function L(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=O}(t.length)&&!function(t){if("function"==typeof t)return!0;var e=T(t);return C.some((function(t){return t===e}))}(t)}var $=17976931348623157e292;function U(t){return t?(t=R(t))===1/0||t===-1/0?(t<0?-1:1)*$:t==t?t:0:0===t?t:0}function V(t,e){void 0===t&&(t=0),void 0===e&&(e=1),t=U(t),e=U(e);var r=g(p(t,e)||0),n=y(h(t,e)||0);if(r>n){var o=r;r=n,n=o}return y(r+v()*(n-r+1))}function z(t){return F(t)?f(t).concat(function(t){return u&&null!==t?u(t).filter((function(e){return c.call(t,e)})):[]}(t)):[]}var D,W=(D=1,function(t,e){void 0===e&&(e=B);for(var r=!L(t)&&z(t),n=(r||t).length,o=0;o>=0&&o<n;){var i=r?r[o]:o;if(!1===e(t[i],i,t))break;o+=D}return t});function Z(t){return"number"==typeof t||T(t)===N}var H=d?d.toString:e;function X(t){if("string"==typeof t)return t;if(S(t))return""+t.map(X);if(P(t))return H?H.call(t):"";var e=""+t;return"0"===e&&1/t==-1/0?"-0":e}function K(t){return function(t){return null==t}(t)?"":X(t)}var q=typeof Blob!==r;function G(t){return!!(q&&t instanceof Blob)||T(t)===k}var J=l.call(Object);function Q(t){if(!function(t){return null!==t&&"object"==typeof t}(t)||"[object Object]"!==T(t))return!1;var e=s(Object(t));if(null===e)return!0;var r=a.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&l.call(r)===J}var Y=m&&globalThis.Object===Object&&globalThis,tt=w&&global.Object===Object&&global,et=x&&self.Object===Object&&self,rt=Y||tt||et||Function("return this")();function nt(t){return Z(t)&&rt.isNaN(t)}function ot(t){return F(t)&&"function"==typeof t.then}function it(t){return"string"==typeof t||T(t)===A}function at(t,e,r){void 0===r&&(r=0);var n=Math[t];if(e=R(e),r=p(function(t){var e=R(t);if(!e||e===1/0||e===-1/0)return e==e?e:0;var r=e%1;return r?e-r:e}(r),292),0===r||!function(t){return b?b(t):"number"==typeof t&&rt.isFinite(t)}(e))return n(e);var o=K(e).split("e");return+((o=K(e=n(+(o[0]+"e"+(o[1]?+o[1]+r:r)))).split("e"))[0]+"e"+(o[1]?+o[1]-r:-r))}function ct(t,e){return at("round",t,e)}var ut=0;var st=/^1[3456789]\d{9}$/;var ft=/^(0\d{2,3}-)?([2-9]\d{6,7})(-\d{1,6})?$/;var lt=/^\d{6}$/;var dt=/^[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 pt=/^[\da-z]+([-._]?[\da-z]+)*@[\da-z]+([-.]?[\da-z]+)*(\.[a-z]{2,})+$/i;var ht=/^[1-9]\d{4,10}$/;var vt=/^[a-z]([-_a-z0-9]{5,19})+$/i;var yt=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领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 gt=/^[1-9]\d{9,20}$/,bt=/^\d{8,30}$/;var mt=/^[\dA-HJ-NPQRTUWXY]{2}\d{6}[\dA-HJ-NPQRTUWXY]{10}$/,wt="0123456789ABCDEFGHJKLMNPQRTUWXY".split("");var xt={disableWarning:!0};function Ot(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];xt.disableWarning||console.warn.apply(void 0,t)}var Et=/\d/,Nt=/[a-z]/,At=/[A-Z]/,jt=/[\d|a-z]/gi;function Ct(t){return t.indexOf("\\x")>-1||t.indexOf("\\u")>-1}function kt(t,e){void 0===e&&(e={});var r=e.level,n=void 0===r?2:r,o=e.ignoreCase,i=void 0!==o&&o,a=e.special,c=void 0===a?"\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E":a,u=t;"string"!=typeof t&&(Ot("[validatePassword] value must be a string."),u="");var s=0,f=Et.test(u),l=Nt.test(u),d=At.test(u),p=function(t,e){if(!e||!t)return!1;var r=t.replace(jt,"");if(!r)return!1;var n=Ct(e)?new RegExp("[".concat(e,"]")):null;if(n)return n.test(r);var o=!1;return r.split("").some((function(t){return e.indexOf(t)>-1&&(o=!0),o})),o}(u,c),h=function(t,e){if(!t)return!1;var r=t.replace(jt,"");if(!r)return!1;if(!e)return!0;var n=Ct(e)?new RegExp("[^".concat(e,"]")):null;if(n)return n.test(r);var o=!1;return r.split("").some((function(t){return-1===e.indexOf(t)&&(o=!0),o})),o}(u,c);return f&&(s+=1),i?(l||d)&&(s+=1):(l&&(s+=1),d&&(s+=1)),p&&(s+=1),{validated:s>=n&&!h,level:s,containes:{number:f,lowerCaseLetter:l,upperCaseLetter:d,specialCharacter:p,unallowableCharacter:h}}}var St=/^((e[\da-z])|(de)|(se)|(pe)|([khm][\da-z]))[\da-z]{7}$/i;var Ft,Tt="undefined"!=typeof URL,Pt=void 0,_t=Object.keys,Mt=Object.values,It=Tt?URL.createObjectURL:(Ft="",function(){return Ft}),Rt=Tt?URL.revokeObjectURL:function(){},Bt={chineseBasic:"[一-龥]",chineseExtend:"[麦-鿿]",chineseExtend2:"[豈-龎]",chineseExtendA:"[㐀-䶿]",chineseExtendB:"[𠀀-𪛟]",chineseExtendC:"[𪜀-𫜸]",chineseExtendD:"[𫝀-𫠝]",chineseExtendE:"[𫠠-𬺡]",chineseExtendF:"[𬺰-𮯠]",chineseExtendG:"[𰀀-𱍊]",chineseExtendH:"[𱍐-𲎯]",chineseExtendI:"[-]"},Lt=Bt.chineseBasic+"+",$t="^"+Bt.chineseBasic+"+$",Ut="(?:"+Mt(Bt).join("|")+")",Vt=Ut+"+",zt="^"+Ut+"+$",Dt=RegExp.prototype.hasOwnProperty("unicode");var Wt=/^((\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 Zt=/^((([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 Ht="localhost|(([^\\s:\\/]+?\\.)+?[^\\s:\\/]+)",Xt=":\\d+",Kt="\\/.*",qt="\\?.*",Gt=new RegExp("^".concat("[\\w-.]+:\\/\\/","(?:").concat("[-;:&=\\+\\$,\\w]+@",")?(?:").concat(Ht,")(?:").concat(Xt,")?(?:").concat(Kt,")*(?:").concat(qt,")?(?:").concat("#.*",")?$")),Jt=new RegExp("^(?:".concat(Ht,")(?:").concat(Xt,")?(?:").concat(Kt,")*(?:").concat(qt,")?(?:").concat("#.*",")?$"));function Qt(t){var e=K(t);return Gt.test(e)||Jt.test(e)}var Yt=/^\d{15}$/;var te=/^[hm]{1}([0-9]{10}|[0-9]{8})$/i;var ee=/^\d{8}$/i,re=/^[\da-z]{10,12}$/i;var ne=/^[A-Z]{6}[A-Z\d]{2}(?:[A-Z\d]{3})?$/;function oe(t,e){var r;return void 0===e&&(e=!1),"number"==typeof(r=e?"string"==typeof t&&""!==t?Number(t):t:"number"==typeof t?t:P(t)?Number.NaN:Number(t))&&!nt(r)}var ie=function(t,e){return ie=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},ie(t,e)};var ae=function(){return ae=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ae.apply(this,arguments)};function ce(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function c(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){t.done?o(t.value):function(t){return t instanceof r?t:new r((function(e){e(t)}))}(t.value).then(a,c)}u((n=n.apply(t,e||[])).next())}))}function ue(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=e.call(t,a)}catch(t){c=[6,t],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}function se(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function fe(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function le(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var de=/^[-+]?0[b|o|x]\d+/i,pe=/^\.\d+/;function he(t){var e;return it(t)?""===(e=t.trim())?e=Number(e):de.test(e)||pe.test(e)?e=R(e):nt(Number(e))&&(e=Number.NaN):e=P(t)?Number.NaN:Z(t)?t:Number(t),nt(e)?Number.NaN:e}function ve(t,e){return void 0===e&&(e=12),+parseFloat(t.toPrecision(e))}function ye(t){var e=t.toString().split(/e/i),r=(e[0].split(".")[1]||"").length-+(e[1]||0);return r>0?r:0}function ge(t){var e=String(t);if(!function(t){return/\d+\.?\d*e[+-]*\d+/i.test(t)}(e))return Number(e.replace(".",""));var r=ye(t);return r>0?ve(+t*Math.pow(10,r)):+t}function be(t){(+t>O||+t<E)&&Ot("".concat(t," is beyond boundary when transfer to integer, the results may not be accurate"))}var me,we,xe,Oe=["零","一","二","三","四","五","六","七","八","九"],Ee=["","十","百","千"],Ne=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],Ae=["","拾","佰","仟"];function je(t){for(var e="",r="",n=!1,o=0;t>0;){var i=t%10;0==i?n&&(n=!1,r=me[i]+r):(n=!0,e=me[i],r=(e+=we[o])+r),o++,t=Math.floor(t/10)}return r}function Ce(t){for(var e=t+"",r="",n=0,o=e.length;n<o;n++)r+=me[parseInt(e[n])];return r}function ke(t,e){void 0===e&&(e={});var r=e.spaceMark,n=void 0===r?" ":r,o=e.precision,i=void 0===o?2:o,a="number"!=typeof t?Number(t):t;if(0===a||nt(a))return"0".concat(n,"B");var c=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],u=Math.floor(Math.log(a)/Math.log(1024));return c[u]?"".concat(Number((a/Math.pow(1024,u)).toFixed(i))).concat(n).concat(c[u]):a+""}var Se=/^(?<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,Fe=[["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 Te={arrayBuffer:"readAsArrayBuffer",binaryString:"readAsBinaryString",dataURL:"readAsDataURL",text:"readAsText"};function Pe(t){for(var e=t.split(","),r=e[0].substring(5).split(";"),n=r[0],o=(-1!==r.indexOf("base64")?atob:decodeURIComponent)(e[1]),i=o.length,a=new Uint8Array(i);i--;)a[i]=o.charCodeAt(i);return new Blob([a],{type:n})}var _e=function(t,e,r){if(void 0===r&&(r=!0),Q(t)){var n={};return W(t,(function(t,o){var i=r&&(Q(t)||S(t))?_e(t,e):e(t,o);n[o]=i})),n}if(S(t)){var o=[];return W(t,(function(t,n){var i=r&&(Q(t)||S(t))?_e(t,e):e(t,n);o.push(i)})),o}return t};function Me(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=void 0===t[1]?1:t[1],o=t.slice(2);if(o.length>0)return Me.apply(void 0,[Me(r,n)].concat(o));if(r=he(r),n=he(n),nt(r)||nt(n))return Number.NaN;var i=ge(r),a=ge(n),c=ye(r)+ye(n),u=i*a;return be(u),u/Math.pow(10,c)}function Ie(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=void 0===t[1]?1:t[1],o=t.slice(2);if(o.length>0)return Ie.apply(void 0,[Ie(r,n)].concat(o));if(r=he(r),n=he(n),nt(r)||nt(n))return Number.NaN;var i=ge(r),a=ge(n);return be(i),be(a),Me(i/a,ve(Math.pow(10,ye(n)-ye(r))))}function Re(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=void 0===t[1]?0:t[1],o=t.slice(2);if(o.length>0)return Re.apply(void 0,[Re(r,n)].concat(o));if(r=Math.abs(ct(r)),n=Math.abs(ct(n)),nt(r)||nt(n))return Number.NaN;if(0===r&&0===n)return 0;if(0===r)return n;if(0===n)return r;var i=n;for(r<n&&(i=r,r=n,n=i);i;)i=r%n,r=n,n=i;return R(r)}function Be(t,e){var r=e||{},n=r.method,o=void 0===n?"get":n,i=r.data,a=void 0===i?null:i,c=r.timeout,u=r.headers,s=r.withCredentials,f=void 0!==s&&s,l=r.async,d=void 0===l||l,p=r.user,h=void 0===p?null:p,v=r.password,y=void 0===v?null:v,g=r.responseType,b=r.onReadyStateChange,m=r.onLoadStart,w=r.onProgress,x=r.onAbort,O=r.onTimeout,E=r.onError,N=r.onLoad,A=r.onLoadEnd;return new Promise((function(e,r){var n=new XMLHttpRequest;n.open(o.toLowerCase(),t,d,h,y),b&&(n.onreadystatechange=b),"number"==typeof c&&c>0&&(n.timeout=c),n.withCredentials=f,g&&(n.responseType=g),"object"==typeof u&&_t(u).map((function(t){n.setRequestHeader(t,u[t])}));var i,s=function(t){return function(e){r(e),null==t||t.call(n,e)}},l={loadstart:m,progress:w,abort:s(x),timeout:s(O),error:s(E),load:(i=N,function(t){e(t),null==i||i.call(n,t)}),loadend:A};_t(l).map((function(t){var e=l[t];e&&n.addEventListener(t,e)})),n.send(a)}))}var Le=[200,304];function $e(t,e){return new Promise((function(r,n){G(t)?r(t):Be(t,ae({responseType:"blob"},e)).then((function(e){var o=e.target.status;if(-1!==Le.indexOf(o))r(e.target.response);else{var i=new Error("The file does not support get requests, responseStatus ".concat(o,", '").concat(t,"'."));console.error(i),n(i)}})).catch((function(t){console.error(new Error("Failed to request file. ".concat(t))),n(t)}))}))}function Ue(t,e){return new Promise((function(r,n){$e(t,e).then((function(e){var o=It(e),i=new Image;i.onload=function(){r({blob:e,image:i})},i.onerror=function(e){Rt(o),console.error("[loadImageWithBlob] The image load failed, '".concat(t,"'.")),n(e)},i.src=o})).catch(n)}))}function Ve(t,e){void 0===e&&(e="");var r=document.createElement("a");r.href=t,r.style.display="none",r.setAttribute("download",e),r.addEventListener("click",(function t(e){e.stopPropagation(),r.removeEventListener("click",t)})),document.body.appendChild(r),r.click(),document.body.removeChild(r)}var ze="abcdefghijklmnopqrstuvwxyz",De={number:"0123456789",lower:ze,upper:ze.toUpperCase()},We=De.number+De.lower+De.upper;function Ze(t,e,r){for(void 0===r&&(r="");t-- >0;){return Ze(t,e,r+e[V(0,e.length-1)])}return r}function He(t,e){var r=e.childrenField,n=void 0===r?"children":r,o=e.emptyChildrenValue,i=void 0===o?"none":o;t.forEach((function(t){t[n].length<=0?"null"===i?t[n]=null:delete t[n]:He(t[n],e)}))}function Xe(t,e,r,n){var o,i;if(void 0===n&&(n=[]),!S(t))return[];try{for(var a=se(t),c=a.next();!c.done;c=a.next()){var u=c.value;if(n.push(u),e(u))return n;if(F(u)){var s=u[r];if(S(s)&&s.length>0){var f=Xe(s,e,r,n);if(f.length>0)return f}}n.pop()}}catch(t){o={error:t}}finally{try{c&&!c.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}return[]}var Ke=function(){function t(){this.handlers={}}return t.prototype.eventNames=function(){var t,e=(null===(t=Object.getOwnPropertySymbols)||void 0===t?void 0:t.call(Object,this.handlers))||[];return Object.keys(this.handlers).concat(e)},t.prototype.rawListeners=function(t){var e=this.handlers[t];return e?e.map((function(t){return t.raw})):[]},t.prototype.listeners=function(t){var e=this.handlers[t];return e?e.map((function(t){return t.wrap})):[]},t.prototype.hasListener=function(t,e){return this.rawListeners(t).some((function(t){return t===e}))},t.prototype._on=function(t,e,r,n,o){void 0===n&&(n=null),void 0===o&&(o=1);var i={raw:e,wrap:r,context:n};if(this.handlers[t]){var a=1===o?"push":"unshift";this.handlers[t][a](i)}else this.handlers[t]=[i];return this},t.prototype.prependListener=function(t,e,r){return this._on(t,e,e,r,0)},t.prototype.on=function(t,e,r){return this._on(t,e,e,r)},t.prototype._wrapOnce=function(t,e,r){var n=this;void 0===r&&(r=null);var o=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];e.apply(r,i),n.off(t,o)};return o},t.prototype.once=function(t,e,r){var n=this._wrapOnce(t,e,r);return this._on(t,e,n,r)},t.prototype.prependOnceListener=function(t,e,r){var n=this._wrapOnce(t,e,r);return this._on(t,e,n,r,0)},t.prototype.off=function(t,e){var r=this.handlers[t];if(r)if(e){var n=r.findIndex((function(t){return t.wrap===e||t.raw===e}));-1!==n&&r.splice(n,1)}else delete this.handlers[t];return this},t.prototype.offAll=function(){return this.handlers={},this},t.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=this.handlers[t];return!!(n&&n.length>0)&&(n.forEach((function(t){t.wrap.apply(t.context,e)})),!0)},t}();var qe=1;function Ge(){return"".concat(Math.random().toString(16).substring(2,8),"_").concat(qe++)}var Je="undefined"!=typeof window&&"object"==typeof window&&window.window===window,Qe={},Ye=function(){function t(t){void 0===t&&(t="default"),this.scope=t,Qe[this.scope]||(Qe[this.scope]={}),this.data=Qe[this.scope]}return t.prototype.getItem=function(t){return t in this.data?this.data[t]:null},t.prototype.setItem=function(t,e){this.data[t]=e},t.prototype.removeItem=function(t){delete this.data[t]},t.prototype.clear=function(){Qe[this.scope]={},this.data=Qe[this.scope]},t}(),tr=function(){function t(t,e){void 0===e&&(e={});var r=!!t&&function(t){try{var e="object"==typeof t&&null!==t&&!!t.setItem&&!!t.getItem&&!!t.removeItem;if(e){var r=Ge();if(t.setItem(r,"1"),"1"!==t.getItem(r))return!1;t.removeItem(r)}return e}catch(e){return console.error("[cache2] ".concat(t," is not supported. The default memory cache will be used.")),!1}}(t);this.options=ae({needParsed:r},e),this.storage=r?t:new Ye(this.options.memoryScope)}return t.prototype.get=function(t){var e=this.storage.getItem(t);return this.options.needParsed?function(t,e){try{return JSON.parse(t,e)}catch(e){return t}}(e,this.options.reviver):e},t.prototype.set=function(t,e){this.storage.setItem(t,this.options.needParsed?function(t,e){return JSON.stringify(t,e)}(e,this.options.replacer):e)},t.prototype.del=function(t){this.storage.removeItem(t)},t.prototype.clear=function(){"function"==typeof this.storage.clear&&this.storage.clear()},t}(),er=function(t){function e(e,r){var n,o=t.call(this)||this,i="default";return"string"==typeof e?i=e:"object"==typeof e&&(n=e),n||"object"!=typeof r||(n=r),o.options=ae({max:-1,stdTTL:0,maxStrategy:"limited",checkperiod:0,prefix:"cache2_"},n),o.storage=new tr(o.options.storage,ae({memoryScope:i},n)),o.cacheKey=(o.options.prefix||"")+(i||"")||Ge(),o.startCheckperiod(),o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}ie(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype._check=function(t,e){var r=!0;return 0!==e.t&&e.t<Date.now()&&(r=!1,this.del(t),this.emit("expired",t,e.v)),r},e.prototype._wrap=function(t,e){var r=Date.now(),n="number"==typeof e?e:this.options.stdTTL;return{v:t,t:n>0?r+n:0,n:r}},e.prototype._isLimited=function(t){return this.options.max>-1&&t>=this.options.max},e.prototype._getReplaceKey=function(t,e){var r=t[0];return t.forEach((function(t){(e[t].t<e[r].t||e[t].t===e[r].t&&e[t].n<e[r].n)&&(r=t)})),r},Object.defineProperty(e.prototype,"cacheValues",{get:function(){return this.storage.get(this.cacheKey)||{}},enumerable:!1,configurable:!0}),e.prototype.setCacheValues=function(t){this.storage.set(this.cacheKey,t)},e.prototype.get=function(t){var e=this.cacheValues[t];if(e&&this._check(t,e))return e.v},e.prototype.mget=function(t){var e=this,r={};if(!Array.isArray(t))return r;var n=this.cacheValues;return t.forEach((function(t){var o=n[t];o&&e._check(t,o)&&(r[t]=o.v)})),r},e.prototype.getAll=function(){var t=Object.keys(this.cacheValues);return this.mget(t)},e.prototype.set=function(t,e,r){if(0===this.options.max)return!1;var n=this.cacheValues,o=Object.keys(n);if(!n[t]&&this._isLimited(o.length)){var i=this.keys();if(this._isLimited(i.length)){if("replaced"!==this.options.maxStrategy)return!1;var a=this._getReplaceKey(i,n);this.del(a)}}return n[t]=this._wrap(e,r),this.setCacheValues(n),this.emit("set",t,n[t].v),!0},e.prototype.mset=function(t){var e=this,r=!0;return t.forEach((function(t){var n=e.set(t.key,t.value,t.ttl);r&&!n&&(r=!1)})),r},e.prototype.del=function(t){var e=this,r=this.cacheValues,n=0;return(Array.isArray(t)?t:[t]).forEach((function(t){if(r[t]){n++;var o=r[t];delete r[t],e.emit("del",t,o.v)}})),n>0&&this.setCacheValues(r),n},e.prototype.clear=function(){this.storage.del(this.cacheKey)},e.prototype.keys=function(){var t=this,e=this.cacheValues;return Object.keys(e).filter((function(r){return t._check(r,e[r])}))},e.prototype.has=function(t){var e=this.cacheValues[t];return!(!e||!this._check(t,e))},e.prototype.take=function(t){var e,r=this.cacheValues[t];return r&&this._check(t,r)&&(e=r.v,this.del(t)),e},e.prototype.ttl=function(t,e){var r=this.cacheValues,n=r[t];return!(!n||!this._check(t,n))&&(r[t]=this._wrap(n.v,e),!0)},e.prototype.getTtl=function(t){var e=this.cacheValues,r=e[t];if(r&&this._check(t,r))return e[t].t},e.prototype.getLastModified=function(t){var e=this.cacheValues,r=e[t];if(r&&this._check(t,r))return e[t].n},e.prototype.startCheckperiod=function(){var t=this;this.keys(),this.options.checkperiod>0&&(clearTimeout(this._checkTimeout),this._checkTimeout=setTimeout((function(){t.startCheckperiod()}),this.options.checkperiod))},e.prototype.stopCheckperiod=function(){clearTimeout(this._checkTimeout)},e}(Ke);new tr(Je?window.localStorage:void 0),new tr(Je?window.sessionStorage:void 0);var rr=function(){function t(t){var e;this.promiseCache={},this.cache=new er((e=++ut,K("uh_async_memo")+e),t)}return t.prototype.run=function(t,e,r){var n=this;if(!e||!it(e))return t();var o=ae({persisted:!0},r);if(o.persisted){var i=this.cache.get(e);if(i)return Promise.resolve(i)}return this.promiseCache[e]||(this.promiseCache[e]=t().then((function(t){return delete n.promiseCache[e],n.cache.set(e,t,o.ttl),t})).catch((function(t){return delete n.promiseCache[e],Promise.reject(t)}))),this.promiseCache[e]},t}();t.AsyncMemo=rr,t.VERSION="5.0.0",t.ajax=Be,t.bytesToSize=ke,t.calculateCursorPosition=function(t,e,r,n,o){void 0===o&&(o={});var i=o.placeholderChar,a=void 0===i?" ":i,c=o.maskReg,u=void 0===c?/\D/g:c,s=o.type,f=K(e),l=K(r),d=S(a)?a:[a],p=l.length-f.length,h=t;if(p>0){var v=l.substring(h-p,h).replace(u,"").length;h-=p-v;for(var y=0;v>0;)-1!==d.indexOf(n.charAt(h-v+y))?y++:v--;h+=y}return("mobile"===s&&(4===h||9===h)||"bankCard"===s&&h>0&&h%5==0)&&(h-=1),h},t.compressImage=function(t,e){return void 0===e&&(e={}),new Promise((function(r,n){var o=e.width,i=e.height,a=e.rotate,c=e.offset,u=void 0===c?[0,0]:c,s=e.background,f=void 0===s?"#fff":s,l=e.canvasWidth,d=e.canvasHeight,p=e.format,h=void 0===p?"blob":p,v=e.type,y=void 0===v?"image/jpeg":v,g=e.quality,b=void 0===g?.8:g,m=e.beforeCompress,w=e.beforeDraw,x=e.afterDraw,O=e.ajaxOptions;Ue(t,O).then((function(t){var c=t.image,s=t.blob,p=R(o),v=R(i),g=R(b);p&&(c.width=p),v&&(c.height=v),null==m||m({image:c,blob:s},e);var O=document.createElement("canvas"),E=O.getContext("2d"),N={image:c,blob:s,canvas:O,context:E},A=R("function"==typeof l?l(N,e):l),j=R("function"==typeof d?d(N,e):d);O.width=A||c.width,O.height=j||c.height;var C="none"===f||"transparent"===f;C?E.clearRect(0,0,O.width,O.height):(E.fillStyle=f,E.fillRect(0,0,O.width,O.height));var k=[0,0];a!==Pt&&(E.translate(c.width/2,c.height/2),k=[-c.width/2,-c.height/2],E.rotate(a*Math.PI/180));var S="function"==typeof u?u(N,e):u;null==w||w(N,e);var F=k[0]+R(S[0]),T=k[1]+R(S[1]);E.drawImage(c,F,T,c.width,c.height),"image/png"===y&&C&&(E.globalCompositeOperation="destination-in",E.drawImage(c,F,T,c.width,c.height)),null==x||x(N,e),"blob"===h?function(t,e,r){return new Promise((function(n){t.toBlob((function(t){n(t)}),e,r)}))}(O,y,g).then(r).catch(n):r(O.toDataURL(y,g))})).catch(n)}))},t.dataURLToBlob=Pe,t.divide=Ie,t.download=function t(e,r){return ce(this,void 0,void 0,(function(){var n,o,i,a,c,u,s,f,l,d,p,h,v;return ue(this,(function(y){switch(y.label){case 0:return n="object"==typeof r?r:{},"string"==typeof r&&(n.fileName=r),o=n.fileName,i=n.type,a=n.dataType,c=n.transformRequest,u=n.transformResponse,"string"!=typeof e?[3,8]:a||!/^blob:.*?\/.*/.test(e)?[3,1]:(Ve(e,o),[2,Promise.resolve()]);case 1:return a||!/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(e)?[3,2]:(s=Pe(e),[3,7]);case 2:return"url"===a||!a&&Qt(e)?(f=function(t){var e="function"==typeof u?u(t):t;return ot(e)?e:Promise.resolve(e)},[4,function(t){var e="function"==typeof c?c(t):t;return ot(e)?e:Promise.resolve(e)}({responseType:"blob"})]):[3,6];case 3:return l=y.sent(),[4,Be(e,l)];case 4:return d=y.sent(),[4,f(d.target.response)];case 5:return p=y.sent(),h=o||e.split("?")[0].split("#")[0].split("/").pop(),[2,t(p,{fileName:h,type:i||(G(p)?p.type:Pt)})];case 6:s=new Blob([e],{type:i||"text/plain"}),y.label=7;case 7:return[3,9];case 8:e instanceof Blob&&(s=e),y.label=9;case 9:return s||(s=new Blob([e],{type:i})),navigator.msSaveBlob?navigator.msSaveBlob(s,o||"download"):(Ve(v=It(s),o),Rt(v)),[2,Promise.resolve()]}}))}))},t.fileReader=function(t,e){void 0===e&&(e="dataURL");var r=Te[e];return r||(r=Te.dataURL),new Promise((function(e,n){var o=new FileReader;o[r](t),o.onload=function(){return e(o.result)},o.onerror=function(t){return n(t)}}))},t.filterTree=function t(e,r,n,o){void 0===n&&(n="children"),void 0===o&&(o="spread");var i=[];return S(e)?(e.forEach((function(e){var a=e;if(F(e)&&(a="spread"===o?ae({},e):e),r(a)){if(F(a)){var c=a[n];S(c)&&c.length>0&&(a[n]=t(c,r,n,o))}i.push(a)}})),i):i},t.findTreeNode=function(t,e,r){var n,o;void 0===r&&(r="children");var i,a=[];if(!S(t))return i;try{for(var c=se(t),u=c.next();!u.done;u=c.next()){var s=u.value;for(a.push(s);a.length;){var f=a.pop();if(e(f)){i=f;break}if(F(f)){var l=f[r];S(l)&&l.length>0&&l.forEach((function(t){a.push(t)}))}}if(i)break}}catch(t){n={error:t}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}return i},t.findTreeNodes=function(t,e,r){var n,o;void 0===r&&(r="children");var i=[],a=[];if(!S(t))return a;try{for(var c=se(t),u=c.next();!u.done;u=c.next()){var s=u.value;for(i.push(s);i.length;){var f=i.pop();if(e(f)&&a.push(f),F(f)){var l=f[r];S(l)&&l.length>0&&l.forEach((function(t){i.push(t)}))}}}}catch(t){n={error:t}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}return a},t.findTreeSelect=function(t,e,r){return void 0===r&&(r="children"),Xe(t,e,r)},t.formatBankCard=function(t,e){void 0===t&&(t="");var r=e||{},n=r.spaceMark,o=void 0===n?" ":n,i=r.length,a=void 0===i?4:i,c=new RegExp("(.{".concat(a,"})"),"g"),u=new RegExp("".concat(o),"g"),s=K(t).replace(u,""),f=s.replace(c,"$1".concat(o));return s.length%a==0?f.substring(0,f.length-1):f},t.formatMobile=function(t,e){void 0===t&&(t="");var r=(e||{}).spaceMark,n=void 0===r?" ":r,o=new RegExp(n,"g"),i=K(t).replace(o,"").substring(0,11);return i.length>7?i.replace(/^(...)(....)/g,"$1".concat(n,"$2").concat(n)):i.length>3?i.replace(/^(...)/g,"$1".concat(n)):i},t.formatMoney=function(t,e){void 0===t&&(t=""),void 0===e&&(e={});var r=e.precision,n=void 0===r?2:r,o=e.symbol,i=e.thousand,a=void 0===i?",":i,c=e.decimal,u=void 0===c?".":c;if(!function(t){return oe(t)?("number"==typeof t&&be(t),!0):(Ot("".concat(t," invalid parameter.")),!1)}(t))return"";if("number"==typeof t&&!isFinite(t))return t+"";"number"!=typeof n||nt(n)||n<0?n=2:n>10&&(n=10),o="string"==typeof o?o:"",a="string"==typeof a?a:",",u="string"==typeof u?u:".";var s=fe((he(t)+"").split("."),2),f=s[0],l=s[1];return o+function(t,e){var r,n,o="";t="+"===(t=(n=/^([+-])?(0+)([0-9.]+)$/.exec(r=t))?(n[1]||"")+("."===n[3][0]?"0"+n[3]:n[3]):r)[0]?t.substring(1):t;for(var i=Number(t)<0?"-":"",a=i?t.substring(1).split("").reverse():t.split("").reverse(),c=0;c<a.length;c++)o+=a[c]+((c+1)%3==0&&c+1!==a.length?e:"");return i+o.split("").reverse().join("")}(f,a)+function(t,e,r){if(0===e)return"";var n="";return n=t&&Number(t)>0?parseFloat("0."+t).toFixed(e).substring(2):(0).toFixed(e).substring(2),r+n}(l,n,u)},t.gcd=Re,t.getFileBlob=$e,t.getImageInfo=function(t,e){return Ue(t,e).then((function(t){var e,r,n,o=t.image,i=t.blob,a=o.width,c=o.height;return{width:a,height:c,contrast:(e=a,r=c,n=Re(e,r),"".concat(Ie(ct(e),n),":").concat(Ie(ct(r),n))),measure:"".concat(a," × ").concat(c," px"),size:ke(i.size),bytes:i.size,image:o,blob:i}}))},t.isBankCard=function(t,e){void 0===e&&(e={});var r=e.loose,n=void 0!==r&&r,o=e.luhn,i=void 0!==o&&o,a=K(t),c=n?bt.test(a):gt.test(a);if(c&&i){var u=a.substring(0,a.length-1);return a[a.length-1]===String(function(t){for(var e=(t+"").replace(/\D/g,"").split("").reverse(),r=0,n=0;n<e.length;n++){var o=parseInt(e[n]);r+=n%2==0?2*o-(o>4?9:0):o}var i=r%10;return 0!==i?10-i:0}(u))}return c},t.isBusinessLicense=function(t,e){void 0===e&&(e={});var r=K(t),n=e.checkCode,o=void 0===n||n,i=Yt.test(r);if(!o||!i)return i;var a=r.substring(0,14),c=r.substring(r.length-1),u=function(t){for(var e=10,r=0;r<14;r++){var n=(e+Number(t[r]))%10;e=2*(n=0===n?10:n)%11}return 1===e?0:11-e}(a);return c===String(u)},t.isChinese=function(t,e){void 0===e&&(e={});var r=e.loose,n=void 0!==r&&r,o=e.useExtend,i=void 0!==o&&o,a=K(t),c=i&&Dt;return new RegExp(c?n?Vt:zt:n?Lt:$t,c?"u":Pt).test(a)},t.isEmail=function(t){var e=K(t);return pt.test(e)},t.isHMCard=function(t){var e=K(t);return te.test(e)},t.isIPv4=function(t){var e=K(t);return Wt.test(e)},t.isIPv6=function(t){var e=K(t);return Zt.test(e)},t.isIdCard=function(t,e){void 0===e&&(e={});var r=e.loose,n=void 0!==r&&r,o=e.checkCode,i=void 0===o||o,a=K(t);return 15===a.length&&n?dt.test(a):!(18!==a.length||!dt.test(a))&&(!i||function(t){var e,r;for(r=e=0;e<17;e++)r+=Math.pow(2,17-e)%11*Number(t[e]);var n=(12-r%11)%11;return n<10?n===Number(t[17]):"X"===t[17].toUpperCase()}(a))},t.isMobile=function(t){var e=K(t);return st.test(e)},t.isPassport=function(t){var e=K(t);return St.test(e)},t.isPassword=function(t,e){void 0===e&&(e={});var r=e.level,n=void 0===r?2:r,o=e.ignoreCase,i=void 0!==o&&o,a=e.special;return kt(t,{level:n,ignoreCase:i,special:void 0===a?"\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E":a}).validated},t.isPostcode=function(t){var e=K(t);return lt.test(e)},t.isQQ=function(t){var e=K(t);return ht.test(e)},t.isSocialCreditCode=function(t,e){var r=K(t),n=(e||{}).checkCode,o=void 0===n||n,i=mt.test(r);if(!o||!i)return i;var a=r.substring(0,17),c=r.substring(r.length-1),u=function(t){for(var e=0,r=function(r){var n=wt.findIndex((function(e){return e===t[r]})),o=Math.pow(3,r)%31;e+=n*o},n=0;n<17;n++)r(n);var o=e%31;return wt[0!==o?31-o:0]}(a);return c===u},t.isSwiftCode=function(t){var e=K(t);return ne.test(e)},t.isTWCard=function(t,e){void 0===e&&(e={});var r=e.loose,n=void 0!==r&&r,o=K(t);return!!ee.test(o)||!!n&&re.test(o)},t.isTelephone=function(t){var e=K(t);return ft.test(e)},t.isUrl=Qt,t.isValidNumber=oe,t.isVehicle=function(t){var e=K(t);return yt.test(e)},t.isWX=function(t){var e=K(t);return vt.test(e)},t.lcm=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.map((function(t){return Math.abs(ct(t))}));return 1===r.length&&(r=r.concat([1])),Ie(r.indexOf(0)>-1?0:Me.apply(void 0,le([],fe(r),!1)),Re.apply(void 0,le([],fe(r),!1)))},t.listToTree=function(t,e){void 0===e&&(e={});var r=e.keyField,n=void 0===r?"id":r,o=e.parentField,i=void 0===o?"pid":o,a=e.childrenField,c=void 0===a?"children":a,u=e.emptyChildrenValue,s=void 0===u?"none":u,f=e.nodeAssign,l=void 0===f?"spread":f,d=[],p={};return S(t)?(t.forEach((function(t){if(F(t)){var e="spread"===l?ae({},t):t,r=e[n],o=e[i];p[r]?e[c]=p[r]:e[c]=p[r]=[],o?p[o]?p[o].push(e):p[o]=[e]:d.push(e)}})),"array"!==s&&He(d,e),d):d},t.loadImage=function(t){return new Promise((function(e,r){var n=G(t),o=n?It(t):t,i=new Image;n||(i.crossOrigin="anonymous"),i.onload=function(){e(i)},i.onerror=function(e){n&&Rt(o),console.error("[loadImage] The image load failed, '".concat(t,"'.")),r(e)},i.src=o}))},t.loadImageWithBlob=Ue,t.loadScript=function(t,e){return new Promise((function(r,n){var o=document.head,i=document.createElement("script"),a=e||{},c=a.attrs,u=a.destroyOnError,s=void 0===u||u,f=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}(a,["attrs","destroyOnError"]),l=ae(ae({async:!0,type:"text/javascript"},f),{src:t});for(var d in l)"onload"!==d&&"onerror"!==d&&(i[d]=l[d]);"object"==typeof c&&_t(c).forEach((function(t){i.setAttribute(t,c[t])})),i.onload=function(t){var e;this.onerror=this.onload=null,null===(e=l.onload)||void 0===e||e.call(this,t),r(i)},i.onerror=function(t){var e;this.onerror=this.onload=null,null===(e=l.onerror)||void 0===e||e.call(this,t),s&&o.removeChild(i),n(new URIError("Failed to load "+this.src))},o.appendChild(i)}))},t.minus=function t(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=e[0],o=void 0===e[1]?0:e[1],i=e.slice(2);if(i.length>0)return t.apply(void 0,[t(n,o)].concat(i));if(n=he(n),o=he(o),nt(n)||nt(o))return Number.NaN;var a=Math.pow(10,Math.max(ye(n),ye(o)));return(Me(n,a)-Me(o,a))/a},t.numberToChinese=function(t,e){void 0===e&&(e={});var r=e.big5,n=void 0!==r&&r,o=e.unit,i=void 0===o||o,a=e.zero,c=void 0===a?"":a,u=e.negative,s=void 0===u?"负":u,f=e.unitConfig,l=void 0===f?{}:f,d=e.decimal,p=void 0===d?"":d;if("number"!=typeof t||nt(t))return Ot("参数错误 ".concat(t,",请传入数字")),"";be(t),n?(me=Ne.slice(),we=Ae.slice(),p=p||"點"):(me=Oe.slice(),we=Ee.slice(),p=p||"点");var h=(null==l?void 0:l.w)||"万",v=(null==l?void 0:l.y)||"亿";xe=["",h,v,h+v],c&&(me[0]=c);var y,g=t<0?s:"",b=Math.abs(t);y=i?function(t){var e=Math.floor(t),r=0,n="",o="",i=!1;if(0===e)return me[0];for(;e>0;){var a=e%1e4;i&&(o=me[0]+o),n=je(a),o=(n+=0!==a?xe[r]:xe[0])+o,i=a<1e3&&a>0,e=Math.floor(e/1e4),r++}return o}(b):Ce(Math.floor(b));var m=function(t){var e=t+"",r=e.indexOf("."),n="";return r>-1&&(n=Ce(e.slice(r+1))),n}(b);return m?"".concat(g).concat(y).concat(p).concat(m):"".concat(g).concat(y)},t.padZero=function(t,e){void 0===e&&(e=2);var r=K(t),n=r.length;return("number"!=typeof e||e<0)&&(e=0),n<e?"0".repeat(e-n)+r:r},t.parseIdCard=function(t){var e=Se.exec(t);if(!e)return null;var r=e.groups||{province:e[1],city:e[2],area:e[3],year:e[4],month:e[5],day:e[6],gender:e[7]},n=Fe.find((function(t){return t[0]===r.province}));if(!n)return null;var o="".concat(r.year,"-").concat(r.month,"-").concat(r.day),i=Number(r.gender)%2==0?"女":"男";return{province:n[1],birthday:o,gender:i,origin:r}},t.plus=function t(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=e[0],o=void 0===e[1]?0:e[1],i=e.slice(2);if(i.length>0)return t.apply(void 0,[t(n,o)].concat(i));if(n=he(n),o=he(o),nt(n)||nt(o))return Number.NaN;var a=Math.pow(10,Math.max(ye(n),ye(o)));return(Me(n,a)+Me(o,a))/a},t.randomString=function(t,e){var r;return void 0===t&&(t=0),r="string"!=typeof e?We:De[e]?De[e]:e,Ze(R(t),r)},t.replaceChar=function(t,e){void 0===t&&(t=""),void 0===e&&(e={});var r=e.char,n=void 0===r?"*":r,o=e.exclude,i=e.start,a=void 0===i?3:i,c=e.end,u=void 0===c?-4:c,s=e.repeat,f=K(t),l=f.length;if(Math.abs(a)>=l)return f;if((a=a>=0?a:l+a)>=(u=u>=0?u:l+u))return f;var d=f.substring(a,u);if(o){var p=new RegExp("[^".concat(o,"]"),"g");d=d.replace(p,n)}else s="number"==typeof s&&s>=0?s:d.length,d=n.repeat(s);return f.substring(0,a)+d+f.substring(u)},t.round=function(t,e){return void 0===e&&(e=0),ct(t,e)},t.safeDate=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n="string"==typeof t?t.replace(/[\\.-]/g,"/"):t;return e&&e.length>0?new(Date.bind.apply(Date,le([void 0,n],fe(e),!1))):void 0===n?new Date:new Date(n)},t.setDataURLPrefix=function(t,e,r){return void 0===e&&(e="image/png"),void 0===r&&(r=!0),"data:".concat(e).concat(r?";base64":"",",").concat(t)},t.setDisableWarning=function(t){xt.disableWarning=!!t},t.strlen=function(t){for(var e=K(t),r=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);o>=1&&o<=126||65376<=o&&o<=65439?r++:r+=2}return r},t.times=Me,t.transformFieldNames=function(t,e,r,n){return void 0===n&&(n="spread"),S(t)?t.length<=0?[]:function t(o){return o.map((function(o){if(!F(o))return o;var i="spread"===n?ae({},o):o,a=[];r&&S(i[r])&&i[r].length>0&&(i[r]=t(i[r].slice()));var c=_t(e);return c.forEach((function(t){var r=e[t];r in i&&(i[t]=i[r],-1===c.indexOf(r)&&a.push(r))})),a.length>0&&a.forEach((function(t){delete i[t]})),i}))}(t.slice()):t},t.transformObjectValue=_e,t.treeToList=function(t,e){var r=[];return S(t)?(function t(n){n.forEach((function(n){if(F(n)){var o=ae({},n);r.push(o),o[e]&&(S(o[e])&&o[e].length>0&&t(o[e]),delete o[e])}else r.push(n)}))}(t),r):r},t.validatePassword=kt}));
|
|
2
2
|
//# sourceMappingURL=util-helpers.min.js.map
|