hsja_tools
Version:
前端公共工具库 内置lodash-es 封装多个常用业务场景工具 致力提升开发效率 多点时间摸鱼
3 lines (2 loc) • 39 kB
JavaScript
(function(u,w){typeof exports=="object"&&typeof module<"u"?w(exports):typeof define=="function"&&define.amd?define(["exports"],w):(u=typeof globalThis<"u"?globalThis:u||self,w(u.HsjaTools={}))})(this,function(u){"use strict";var w=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof w<"u"&&w,S={searchParams:"URLSearchParams"in w,iterable:"Symbol"in w&&"iterator"in Symbol,blob:"FileReader"in w&&"Blob"in w&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in w,arrayBuffer:"ArrayBuffer"in w};function tr(t){return t&&DataView.prototype.isPrototypeOf(t)}if(S.arrayBuffer)var er=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],rr=ArrayBuffer.isView||function(t){return t&&er.indexOf(Object.prototype.toString.call(t))>-1};function nt(t){if(typeof t!="string"&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||t==="")throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function Tt(t){return typeof t!="string"&&(t=String(t)),t}function wt(t){var e={next:function(){var r=t.shift();return{done:r===void 0,value:r}}};return S.iterable&&(e[Symbol.iterator]=function(){return e}),e}function F(t){this.map={},t instanceof F?t.forEach(function(e,r){this.append(r,e)},this):Array.isArray(t)?t.forEach(function(e){this.append(e[0],e[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}F.prototype.append=function(t,e){t=nt(t),e=Tt(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},F.prototype.delete=function(t){delete this.map[nt(t)]},F.prototype.get=function(t){return t=nt(t),this.has(t)?this.map[t]:null},F.prototype.has=function(t){return this.map.hasOwnProperty(nt(t))},F.prototype.set=function(t,e){this.map[nt(t)]=Tt(e)},F.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},F.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),wt(t)},F.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),wt(t)},F.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),wt(t)},S.iterable&&(F.prototype[Symbol.iterator]=F.prototype.entries);function _t(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function Yt(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function nr(t){var e=new FileReader,r=Yt(e);return e.readAsArrayBuffer(t),r}function ir(t){var e=new FileReader,r=Yt(e);return e.readAsText(t),r}function or(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}function Vt(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function Wt(){return this.bodyUsed=!1,this._initBody=function(t){this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?typeof t=="string"?this._bodyText=t:S.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:S.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:S.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():S.arrayBuffer&&S.blob&&tr(t)?(this._bodyArrayBuffer=Vt(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):S.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||rr(t))?this._bodyArrayBuffer=Vt(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||(typeof t=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):S.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},S.blob&&(this.blob=function(){var t=_t(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var t=_t(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(nr)}),this.text=function(){var t=_t(this);if(t)return t;if(this._bodyBlob)return ir(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(or(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},S.formData&&(this.formData=function(){return this.text().then(fr)}),this.json=function(){return this.text().then(JSON.parse)},this}var ar=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function sr(t){var e=t.toUpperCase();return ar.indexOf(e)>-1?e:t}function z(t,e){if(!(this instanceof z))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e=e||{};var r=e.body;if(t instanceof z){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new F(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,!r&&t._bodyInit!=null&&(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new F(e.headers)),this.method=sr(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),(this.method==="GET"||this.method==="HEAD")&&(e.cache==="no-store"||e.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var s=/\?/;this.url+=(s.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}z.prototype.clone=function(){return new z(this,{body:this._bodyInit})};function fr(t){var e=new FormData;return t.trim().split("&").forEach(function(r){if(r){var n=r.split("="),s=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(s),decodeURIComponent(i))}}),e}function ur(t){var e=new F,r=t.replace(/\r?\n[\t ]+/g," ");return r.split("\r").map(function(n){return n.indexOf(`
`)===0?n.substr(1,n.length):n}).forEach(function(n){var s=n.split(":"),i=s.shift().trim();if(i){var h=s.join(":").trim();e.append(i,h)}}),e}Wt.call(z.prototype);function P(t,e){if(!(this instanceof P))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=e.status===void 0?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText===void 0?"":""+e.statusText,this.headers=new F(e.headers),this.url=e.url||"",this._initBody(t)}Wt.call(P.prototype),P.prototype.clone=function(){return new P(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new F(this.headers),url:this.url})},P.error=function(){var t=new P(null,{status:0,statusText:""});return t.type="error",t};var cr=[301,302,303,307,308];P.redirect=function(t,e){if(cr.indexOf(e)===-1)throw new RangeError("Invalid status code");return new P(null,{status:e,headers:{location:t}})};var G=w.DOMException;try{new G}catch{G=function(e,r){this.message=e,this.name=r;var n=Error(e);this.stack=n.stack},G.prototype=Object.create(Error.prototype),G.prototype.constructor=G}function Zt(t,e){return new Promise(function(r,n){var s=new z(t,e);if(s.signal&&s.signal.aborted)return n(new G("Aborted","AbortError"));var i=new XMLHttpRequest;function h(){i.abort()}i.onload=function(){var b={status:i.status,statusText:i.statusText,headers:ur(i.getAllResponseHeaders()||"")};b.url="responseURL"in i?i.responseURL:b.headers.get("X-Request-URL");var v="response"in i?i.response:i.responseText;setTimeout(function(){r(new P(v,b))},0)},i.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},i.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},i.onabort=function(){setTimeout(function(){n(new G("Aborted","AbortError"))},0)};function p(b){try{return b===""&&w.location.href?w.location.href:b}catch{return b}}i.open(s.method,p(s.url),!0),s.credentials==="include"?i.withCredentials=!0:s.credentials==="omit"&&(i.withCredentials=!1),"responseType"in i&&(S.blob?i.responseType="blob":S.arrayBuffer&&s.headers.get("Content-Type")&&s.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(i.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof F)?Object.getOwnPropertyNames(e.headers).forEach(function(b){i.setRequestHeader(b,Tt(e.headers[b]))}):s.headers.forEach(function(b,v){i.setRequestHeader(v,b)}),s.signal&&(s.signal.addEventListener("abort",h),i.onreadystatechange=function(){i.readyState===4&&s.signal.removeEventListener("abort",h)}),i.send(typeof s._bodyInit>"u"?null:s._bodyInit)})}Zt.polyfill=!0,w.fetch||(w.fetch=Zt,w.Headers=F,w.Request=z,w.Response=P);var dr=Array.isArray;const yt=dr;function hr(t){return yt(t)||{}.toString.call(t)==="[object Array]"}function B(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function lr(){this.__data__=[],this.size=0}function Ft(t,e){return t===e||t!==t&&e!==e}function bt(t,e){for(var r=t.length;r--;)if(Ft(t[r][0],e))return r;return-1}var yr=Array.prototype,br=yr.splice;function pr(t){var e=this.__data__,r=bt(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():br.call(e,r,1),--this.size,!0}function gr(t){var e=this.__data__,r=bt(e,t);return r<0?void 0:e[r][1]}function mr(t){return bt(this.__data__,t)>-1}function $r(t,e){var r=this.__data__,n=bt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function U(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}U.prototype.clear=lr,U.prototype.delete=pr,U.prototype.get=gr,U.prototype.has=mr,U.prototype.set=$r;function Ar(){this.__data__=new U,this.size=0}function vr(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Tr(t){return this.__data__.get(t)}function wr(t){return this.__data__.has(t)}var _r=typeof global=="object"&&global&&global.Object===Object&&global;const qt=_r;var Fr=typeof self=="object"&&self&&self.Object===Object&&self,Dr=qt||Fr||Function("return this")();const I=Dr;var Or=I.Symbol;const X=Or;var Kt=Object.prototype,jr=Kt.hasOwnProperty,Sr=Kt.toString,it=X?X.toStringTag:void 0;function Er(t){var e=jr.call(t,it),r=t[it];try{t[it]=void 0;var n=!0}catch{}var s=Sr.call(t);return n&&(e?t[it]=r:delete t[it]),s}var Mr=Object.prototype,Pr=Mr.toString;function Ir(t){return Pr.call(t)}var Cr="[object Null]",Br="[object Undefined]",Jt=X?X.toStringTag:void 0;function Y(t){return t==null?t===void 0?Br:Cr:Jt&&Jt in Object(t)?Er(t):Ir(t)}var Ur="[object AsyncFunction]",Lr="[object Function]",Nr="[object GeneratorFunction]",Rr="[object Proxy]";function kt(t){if(!B(t))return!1;var e=Y(t);return e==Lr||e==Nr||e==Ur||e==Rr}var xr=I["__core-js_shared__"];const Dt=xr;var Xt=function(){var t=/[^.]+$/.exec(Dt&&Dt.keys&&Dt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Hr(t){return!!Xt&&Xt in t}var zr=Function.prototype,Gr=zr.toString;function V(t){if(t!=null){try{return Gr.call(t)}catch{}try{return t+""}catch{}}return""}var Yr=/[\\^$.*+?()[\]{}|]/g,Vr=/^\[object .+?Constructor\]$/,Wr=Function.prototype,Zr=Object.prototype,qr=Wr.toString,Kr=Zr.hasOwnProperty,Jr=RegExp("^"+qr.call(Kr).replace(Yr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function kr(t){if(!B(t)||Hr(t))return!1;var e=kt(t)?Jr:Vr;return e.test(V(t))}function Xr(t,e){return t==null?void 0:t[e]}function W(t,e){var r=Xr(t,e);return kr(r)?r:void 0}var Qr=W(I,"Map");const ot=Qr;var tn=W(Object,"create");const at=tn;function en(){this.__data__=at?at(null):{},this.size=0}function rn(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var nn="__lodash_hash_undefined__",on=Object.prototype,an=on.hasOwnProperty;function sn(t){var e=this.__data__;if(at){var r=e[t];return r===nn?void 0:r}return an.call(e,t)?e[t]:void 0}var fn=Object.prototype,un=fn.hasOwnProperty;function cn(t){var e=this.__data__;return at?e[t]!==void 0:un.call(e,t)}var dn="__lodash_hash_undefined__";function hn(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=at&&e===void 0?dn:e,this}function Z(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Z.prototype.clear=en,Z.prototype.delete=rn,Z.prototype.get=sn,Z.prototype.has=cn,Z.prototype.set=hn;function ln(){this.size=0,this.__data__={hash:new Z,map:new(ot||U),string:new Z}}function yn(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function pt(t,e){var r=t.__data__;return yn(e)?r[typeof e=="string"?"string":"hash"]:r.map}function bn(t){var e=pt(this,t).delete(t);return this.size-=e?1:0,e}function pn(t){return pt(this,t).get(t)}function gn(t){return pt(this,t).has(t)}function mn(t,e){var r=pt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function Q(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Q.prototype.clear=ln,Q.prototype.delete=bn,Q.prototype.get=pn,Q.prototype.has=gn,Q.prototype.set=mn;var $n=200;function An(t,e){var r=this.__data__;if(r instanceof U){var n=r.__data__;if(!ot||n.length<$n-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Q(n)}return r.set(t,e),this.size=r.size,this}function tt(t){var e=this.__data__=new U(t);this.size=e.size}tt.prototype.clear=Ar,tt.prototype.delete=vr,tt.prototype.get=Tr,tt.prototype.has=wr,tt.prototype.set=An;function vn(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var Tn=function(){try{var t=W(Object,"defineProperty");return t({},"",{}),t}catch{}}();const Qt=Tn;function te(t,e,r){e=="__proto__"&&Qt?Qt(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var wn=Object.prototype,_n=wn.hasOwnProperty;function ee(t,e,r){var n=t[e];(!(_n.call(t,e)&&Ft(n,r))||r===void 0&&!(e in t))&&te(t,e,r)}function gt(t,e,r,n){var s=!r;r||(r={});for(var i=-1,h=e.length;++i<h;){var p=e[i],b=n?n(r[p],t[p],p,r,t):void 0;b===void 0&&(b=t[p]),s?te(r,p,b):ee(r,p,b)}return r}function Fn(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function q(t){return t!=null&&typeof t=="object"}var Dn="[object Arguments]";function re(t){return q(t)&&Y(t)==Dn}var ne=Object.prototype,On=ne.hasOwnProperty,jn=ne.propertyIsEnumerable,Sn=re(function(){return arguments}())?re:function(t){return q(t)&&On.call(t,"callee")&&!jn.call(t,"callee")};const En=Sn;function Mn(){return!1}var ie=typeof u=="object"&&u&&!u.nodeType&&u,oe=ie&&typeof module=="object"&&module&&!module.nodeType&&module,Pn=oe&&oe.exports===ie,ae=Pn?I.Buffer:void 0,In=ae?ae.isBuffer:void 0,Cn=In||Mn;const se=Cn;var Bn=9007199254740991,Un=/^(?:0|[1-9]\d*)$/;function fe(t,e){var r=typeof t;return e=e==null?Bn:e,!!e&&(r=="number"||r!="symbol"&&Un.test(t))&&t>-1&&t%1==0&&t<e}var Ln=9007199254740991;function ue(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Ln}var Nn="[object Arguments]",Rn="[object Array]",xn="[object Boolean]",Hn="[object Date]",zn="[object Error]",Gn="[object Function]",Yn="[object Map]",Vn="[object Number]",Wn="[object Object]",Zn="[object RegExp]",qn="[object Set]",Kn="[object String]",Jn="[object WeakMap]",kn="[object ArrayBuffer]",Xn="[object DataView]",Qn="[object Float32Array]",ti="[object Float64Array]",ei="[object Int8Array]",ri="[object Int16Array]",ni="[object Int32Array]",ii="[object Uint8Array]",oi="[object Uint8ClampedArray]",ai="[object Uint16Array]",si="[object Uint32Array]",A={};A[Qn]=A[ti]=A[ei]=A[ri]=A[ni]=A[ii]=A[oi]=A[ai]=A[si]=!0,A[Nn]=A[Rn]=A[kn]=A[xn]=A[Xn]=A[Hn]=A[zn]=A[Gn]=A[Yn]=A[Vn]=A[Wn]=A[Zn]=A[qn]=A[Kn]=A[Jn]=!1;function fi(t){return q(t)&&ue(t.length)&&!!A[Y(t)]}function Ot(t){return function(e){return t(e)}}var ce=typeof u=="object"&&u&&!u.nodeType&&u,st=ce&&typeof module=="object"&&module&&!module.nodeType&&module,ui=st&&st.exports===ce,jt=ui&&qt.process,ci=function(){try{var t=st&&st.require&&st.require("util").types;return t||jt&&jt.binding&&jt.binding("util")}catch{}}();const et=ci;var de=et&&et.isTypedArray,di=de?Ot(de):fi;const hi=di;var li=Object.prototype,yi=li.hasOwnProperty;function he(t,e){var r=yt(t),n=!r&&En(t),s=!r&&!n&&se(t),i=!r&&!n&&!s&&hi(t),h=r||n||s||i,p=h?Fn(t.length,String):[],b=p.length;for(var v in t)(e||yi.call(t,v))&&!(h&&(v=="length"||s&&(v=="offset"||v=="parent")||i&&(v=="buffer"||v=="byteLength"||v=="byteOffset")||fe(v,b)))&&p.push(v);return p}var bi=Object.prototype;function St(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||bi;return t===r}function le(t,e){return function(r){return t(e(r))}}var pi=le(Object.keys,Object);const gi=pi;var mi=Object.prototype,$i=mi.hasOwnProperty;function Ai(t){if(!St(t))return gi(t);var e=[];for(var r in Object(t))$i.call(t,r)&&r!="constructor"&&e.push(r);return e}function Et(t){return t!=null&&ue(t.length)&&!kt(t)}function Mt(t){return Et(t)?he(t):Ai(t)}function vi(t,e){return t&>(e,Mt(e),t)}function Ti(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var wi=Object.prototype,_i=wi.hasOwnProperty;function Fi(t){if(!B(t))return Ti(t);var e=St(t),r=[];for(var n in t)n=="constructor"&&(e||!_i.call(t,n))||r.push(n);return r}function Pt(t){return Et(t)?he(t,!0):Fi(t)}function Di(t,e){return t&>(e,Pt(e),t)}var ye=typeof u=="object"&&u&&!u.nodeType&&u,be=ye&&typeof module=="object"&&module&&!module.nodeType&&module,Oi=be&&be.exports===ye,pe=Oi?I.Buffer:void 0,ge=pe?pe.allocUnsafe:void 0;function ji(t,e){if(e)return t.slice();var r=t.length,n=ge?ge(r):new t.constructor(r);return t.copy(n),n}function Si(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}function Ei(t,e){for(var r=-1,n=t==null?0:t.length,s=0,i=[];++r<n;){var h=t[r];e(h,r,t)&&(i[s++]=h)}return i}function me(){return[]}var Mi=Object.prototype,Pi=Mi.propertyIsEnumerable,$e=Object.getOwnPropertySymbols,Ii=$e?function(t){return t==null?[]:(t=Object(t),Ei($e(t),function(e){return Pi.call(t,e)}))}:me;const It=Ii;function Ci(t,e){return gt(t,It(t),e)}function Ae(t,e){for(var r=-1,n=e.length,s=t.length;++r<n;)t[s+r]=e[r];return t}var Bi=le(Object.getPrototypeOf,Object);const ve=Bi;var Ui=Object.getOwnPropertySymbols,Li=Ui?function(t){for(var e=[];t;)Ae(e,It(t)),t=ve(t);return e}:me;const Te=Li;function Ni(t,e){return gt(t,Te(t),e)}function we(t,e,r){var n=e(t);return yt(t)?n:Ae(n,r(t))}function Ri(t){return we(t,Mt,It)}function xi(t){return we(t,Pt,Te)}var Hi=W(I,"DataView");const Ct=Hi;var zi=W(I,"Promise");const Bt=zi;var Gi=W(I,"Set");const Ut=Gi;var Yi=W(I,"WeakMap");const Lt=Yi;var _e="[object Map]",Vi="[object Object]",Fe="[object Promise]",De="[object Set]",Oe="[object WeakMap]",je="[object DataView]",Wi=V(Ct),Zi=V(ot),qi=V(Bt),Ki=V(Ut),Ji=V(Lt),K=Y;(Ct&&K(new Ct(new ArrayBuffer(1)))!=je||ot&&K(new ot)!=_e||Bt&&K(Bt.resolve())!=Fe||Ut&&K(new Ut)!=De||Lt&&K(new Lt)!=Oe)&&(K=function(t){var e=Y(t),r=e==Vi?t.constructor:void 0,n=r?V(r):"";if(n)switch(n){case Wi:return je;case Zi:return _e;case qi:return Fe;case Ki:return De;case Ji:return Oe}return e});const Nt=K;var ki=Object.prototype,Xi=ki.hasOwnProperty;function Qi(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Xi.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var to=I.Uint8Array;const Se=to;function Rt(t){var e=new t.constructor(t.byteLength);return new Se(e).set(new Se(t)),e}function eo(t,e){var r=e?Rt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var ro=/\w*$/;function no(t){var e=new t.constructor(t.source,ro.exec(t));return e.lastIndex=t.lastIndex,e}var Ee=X?X.prototype:void 0,Me=Ee?Ee.valueOf:void 0;function io(t){return Me?Object(Me.call(t)):{}}function oo(t,e){var r=e?Rt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var ao="[object Boolean]",so="[object Date]",fo="[object Map]",uo="[object Number]",co="[object RegExp]",ho="[object Set]",lo="[object String]",yo="[object Symbol]",bo="[object ArrayBuffer]",po="[object DataView]",go="[object Float32Array]",mo="[object Float64Array]",$o="[object Int8Array]",Ao="[object Int16Array]",vo="[object Int32Array]",To="[object Uint8Array]",wo="[object Uint8ClampedArray]",_o="[object Uint16Array]",Fo="[object Uint32Array]";function Do(t,e,r){var n=t.constructor;switch(e){case bo:return Rt(t);case ao:case so:return new n(+t);case po:return eo(t,r);case go:case mo:case $o:case Ao:case vo:case To:case wo:case _o:case Fo:return oo(t,r);case fo:return new n;case uo:case lo:return new n(t);case co:return no(t);case ho:return new n;case yo:return io(t)}}var Pe=Object.create,Oo=function(){function t(){}return function(e){if(!B(e))return{};if(Pe)return Pe(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const jo=Oo;function So(t){return typeof t.constructor=="function"&&!St(t)?jo(ve(t)):{}}var Eo="[object Map]";function Mo(t){return q(t)&&Nt(t)==Eo}var Ie=et&&et.isMap,Po=Ie?Ot(Ie):Mo;const Io=Po;var Co="[object Set]";function Bo(t){return q(t)&&Nt(t)==Co}var Ce=et&&et.isSet,Uo=Ce?Ot(Ce):Bo;const Lo=Uo;var No=1,Ro=2,xo=4,Be="[object Arguments]",Ho="[object Array]",zo="[object Boolean]",Go="[object Date]",Yo="[object Error]",Ue="[object Function]",Vo="[object GeneratorFunction]",Wo="[object Map]",Zo="[object Number]",Le="[object Object]",qo="[object RegExp]",Ko="[object Set]",Jo="[object String]",ko="[object Symbol]",Xo="[object WeakMap]",Qo="[object ArrayBuffer]",ta="[object DataView]",ea="[object Float32Array]",ra="[object Float64Array]",na="[object Int8Array]",ia="[object Int16Array]",oa="[object Int32Array]",aa="[object Uint8Array]",sa="[object Uint8ClampedArray]",fa="[object Uint16Array]",ua="[object Uint32Array]",$={};$[Be]=$[Ho]=$[Qo]=$[ta]=$[zo]=$[Go]=$[ea]=$[ra]=$[na]=$[ia]=$[oa]=$[Wo]=$[Zo]=$[Le]=$[qo]=$[Ko]=$[Jo]=$[ko]=$[aa]=$[sa]=$[fa]=$[ua]=!0,$[Yo]=$[Ue]=$[Xo]=!1;function mt(t,e,r,n,s,i){var h,p=e&No,b=e&Ro,v=e&xo;if(r&&(h=s?r(t,n,s,i):r(t)),h!==void 0)return h;if(!B(t))return t;var J=yt(t);if(J){if(h=Qi(t),!p)return Si(t,h)}else{var D=Nt(t),ut=D==Ue||D==Vo;if(se(t))return ji(t,p);if(D==Le||D==Be||ut&&!s){if(h=b||ut?{}:So(t),!p)return b?Ni(t,Di(h,t)):Ci(t,vi(h,t))}else{if(!$[D])return s?t:{};h=Do(t,D,p)}}i||(i=new tt);var M=i.get(t);if(M)return M;i.set(t,h),Lo(t)?t.forEach(function(C){h.add(mt(C,e,r,C,t,i))}):Io(t)&&t.forEach(function(C,L){h.set(L,mt(C,e,r,L,t,i))});var R=v?b?xi:Ri:b?Pt:Mt,ct=J?void 0:R(t);return vn(ct||t,function(C,L){ct&&(L=C,C=t[L]),ee(h,L,mt(C,e,r,L,t,i))}),h}var ca=1,da=4;function ha(t){return mt(t,ca|da)}function Ne(t){return B(t)&&!Array.isArray(t)}function la(t){return ha(t)}var ya="[object Number]";function ba(t){return typeof t=="number"||q(t)&&Y(t)==ya}var pa=/\s/;function ga(t){for(var e=t.length;e--&&pa.test(t.charAt(e)););return e}var ma=/^\s+/;function $a(t){return t&&t.slice(0,ga(t)+1).replace(ma,"")}var Aa="[object Symbol]";function va(t){return typeof t=="symbol"||q(t)&&Y(t)==Aa}var Re=0/0,Ta=/^[-+]0x[0-9a-f]+$/i,wa=/^0b[01]+$/i,_a=/^0o[0-7]+$/i,Fa=parseInt;function xe(t){if(typeof t=="number")return t;if(va(t))return Re;if(B(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=B(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=$a(t);var r=wa.test(t);return r||_a.test(t)?Fa(t.slice(2),r?2:8):Ta.test(t)?Re:+t}var He=1/0,Da=17976931348623157e292;function ft(t){if(!t)return t===0?t:0;if(t=xe(t),t===He||t===-He){var e=t<0?-1:1;return e*Da}return t===t?t:0}function Oa(t){var e=ft(t),r=e%1;return e===e?r?e-r:e:0}function ja(t){return typeof t=="number"&&t==Oa(t)}function Sa(t){return ba(t)}function Ea(t){return ja(t)}var Ma=Math.max,Pa=Math.min;function Ia(t,e,r){return t>=Pa(e,r)&&t<Ma(e,r)}function Ca(t,e,r){return e=ft(e),r===void 0?(r=e,e=0):r=ft(r),t=xe(t),Ia(t,e,r)}var Ba=Math.floor,Ua=Math.random;function La(t,e){return t+Ba(Ua()*(e-t+1))}function Na(t,e,r){if(!B(r))return!1;var n=typeof e;return(n=="number"?Et(r)&&fe(e,r.length):n=="string"&&e in r)?Ft(r[e],t):!1}var Ra=parseFloat,xa=Math.min,Ha=Math.random;function za(t,e,r){if(r&&typeof r!="boolean"&&Na(t,e,r)&&(e=r=void 0),r===void 0&&(typeof e=="boolean"?(r=e,e=void 0):typeof t=="boolean"&&(r=t,t=void 0)),t===void 0&&e===void 0?(t=0,e=1):(t=ft(t),e===void 0?(e=t,t=0):e=ft(e)),t>e){var n=t;t=e,e=n}if(r||t%1||e%1){var s=Ha();return xa(t+s*(e-t+Ra("1e-"+((s+"").length-1))),e)}return La(t,e)}function ze(t,e=0,r){return Ca(t,e,r)}function Ga(t=0,e=1,r){return za(t,e,r)}function Ya(t="330400",e="f9e1a05e3c9c043be842fdad9040a8a6",r="base"){return new Promise((n,s)=>{if(!e){console.error("\u7F3A\u5C11\u9AD8\u5FB7key"),s("\u7F3A\u5C11\u9AD8\u5FB7key");return}if(!t){console.error("\u7F3A\u5C11\u57CE\u5E02\u7F16\u7801"),s("\u7F3A\u5C11\u57CE\u5E02\u7F16\u7801");return}fetch(`https://restapi.amap.com/v3/weather/weatherInfo?city=${t}&key=${e}&extensions=${r}`).then(i=>i.json()).then(i=>{const{infocode:h,info:p,count:b}=i;h==="10000"?b>0?n(r==="base"?i.lives[0]:i.forecasts[0]):s("\u65E0\u6570\u636E"):(console.error(p),s(p))}).catch(i=>{s(i)})})}var Va=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ge={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Va,function(){var r=1e3,n=6e4,s=36e5,i="millisecond",h="second",p="minute",b="hour",v="day",J="week",D="month",ut="quarter",M="year",R="date",ct="Invalid Date",C=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,L=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,ps={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},Ht=function(y,f,o){var c=String(y);return!c||c.length>=f?y:""+Array(f+1-c.length).join(o)+y},gs={s:Ht,z:function(y){var f=-y.utcOffset(),o=Math.abs(f),c=Math.floor(o/60),a=o%60;return(f<=0?"+":"-")+Ht(c,2,"0")+":"+Ht(a,2,"0")},m:function y(f,o){if(f.date()<o.date())return-y(o,f);var c=12*(o.year()-f.year())+(o.month()-f.month()),a=f.clone().add(c,D),l=o-a<0,d=f.clone().add(c+(l?-1:1),D);return+(-(c+(o-a)/(l?a-d:d-a))||0)},a:function(y){return y<0?Math.ceil(y)||0:Math.floor(y)},p:function(y){return{M:D,y:M,w:J,d:v,D:R,h:b,m:p,s:h,ms:i,Q:ut}[y]||String(y||"").toLowerCase().replace(/s$/,"")},u:function(y){return y===void 0}},dt="en",k={};k[dt]=ps;var zt=function(y){return y instanceof At},$t=function y(f,o,c){var a;if(!f)return dt;if(typeof f=="string"){var l=f.toLowerCase();k[l]&&(a=l),o&&(k[l]=o,a=l);var d=f.split("-");if(!a&&d.length>1)return y(d[0])}else{var g=f.name;k[g]=f,a=g}return!c&&a&&(dt=a),a||!c&&dt},O=function(y,f){if(zt(y))return y.clone();var o=typeof f=="object"?f:{};return o.date=y,o.args=arguments,new At(o)},m=gs;m.l=$t,m.i=zt,m.w=function(y,f){return O(y,{locale:f.$L,utc:f.$u,x:f.$x,$offset:f.$offset})};var At=function(){function y(o){this.$L=$t(o.locale,null,!0),this.parse(o)}var f=y.prototype;return f.parse=function(o){this.$d=function(c){var a=c.date,l=c.utc;if(a===null)return new Date(NaN);if(m.u(a))return new Date;if(a instanceof Date)return new Date(a);if(typeof a=="string"&&!/Z$/i.test(a)){var d=a.match(C);if(d){var g=d[2]-1||0,_=(d[7]||"0").substring(0,3);return l?new Date(Date.UTC(d[1],g,d[3]||1,d[4]||0,d[5]||0,d[6]||0,_)):new Date(d[1],g,d[3]||1,d[4]||0,d[5]||0,d[6]||0,_)}}return new Date(a)}(o),this.$x=o.x||{},this.init()},f.init=function(){var o=this.$d;this.$y=o.getFullYear(),this.$M=o.getMonth(),this.$D=o.getDate(),this.$W=o.getDay(),this.$H=o.getHours(),this.$m=o.getMinutes(),this.$s=o.getSeconds(),this.$ms=o.getMilliseconds()},f.$utils=function(){return m},f.isValid=function(){return this.$d.toString()!==ct},f.isSame=function(o,c){var a=O(o);return this.startOf(c)<=a&&a<=this.endOf(c)},f.isAfter=function(o,c){return O(o)<this.startOf(c)},f.isBefore=function(o,c){return this.endOf(c)<O(o)},f.$g=function(o,c,a){return m.u(o)?this[c]:this.set(a,o)},f.unix=function(){return Math.floor(this.valueOf()/1e3)},f.valueOf=function(){return this.$d.getTime()},f.startOf=function(o,c){var a=this,l=!!m.u(c)||c,d=m.p(o),g=function(rt,E){var H=m.w(a.$u?Date.UTC(a.$y,E,rt):new Date(a.$y,E,rt),a);return l?H:H.endOf(v)},_=function(rt,E){return m.w(a.toDate()[rt].apply(a.toDate("s"),(l?[0,0,0,0]:[23,59,59,999]).slice(E)),a)},T=this.$W,j=this.$M,x=this.$D,N="set"+(this.$u?"UTC":"");switch(d){case M:return l?g(1,0):g(31,11);case D:return l?g(1,j):g(0,j+1);case J:var ht=this.$locale().weekStart||0,lt=(T<ht?T+7:T)-ht;return g(l?x-lt:x+(6-lt),j);case v:case R:return _(N+"Hours",0);case b:return _(N+"Minutes",1);case p:return _(N+"Seconds",2);case h:return _(N+"Milliseconds",3);default:return this.clone()}},f.endOf=function(o){return this.startOf(o,!1)},f.$set=function(o,c){var a,l=m.p(o),d="set"+(this.$u?"UTC":""),g=(a={},a[v]=d+"Date",a[R]=d+"Date",a[D]=d+"Month",a[M]=d+"FullYear",a[b]=d+"Hours",a[p]=d+"Minutes",a[h]=d+"Seconds",a[i]=d+"Milliseconds",a)[l],_=l===v?this.$D+(c-this.$W):c;if(l===D||l===M){var T=this.clone().set(R,1);T.$d[g](_),T.init(),this.$d=T.set(R,Math.min(this.$D,T.daysInMonth())).$d}else g&&this.$d[g](_);return this.init(),this},f.set=function(o,c){return this.clone().$set(o,c)},f.get=function(o){return this[m.p(o)]()},f.add=function(o,c){var a,l=this;o=Number(o);var d=m.p(c),g=function(j){var x=O(l);return m.w(x.date(x.date()+Math.round(j*o)),l)};if(d===D)return this.set(D,this.$M+o);if(d===M)return this.set(M,this.$y+o);if(d===v)return g(1);if(d===J)return g(7);var _=(a={},a[p]=n,a[b]=s,a[h]=r,a)[d]||1,T=this.$d.getTime()+o*_;return m.w(T,this)},f.subtract=function(o,c){return this.add(-1*o,c)},f.format=function(o){var c=this,a=this.$locale();if(!this.isValid())return a.invalidDate||ct;var l=o||"YYYY-MM-DDTHH:mm:ssZ",d=m.z(this),g=this.$H,_=this.$m,T=this.$M,j=a.weekdays,x=a.months,N=function(E,H,Gt,vt){return E&&(E[H]||E(c,l))||Gt[H].slice(0,vt)},ht=function(E){return m.s(g%12||12,E,"0")},lt=a.meridiem||function(E,H,Gt){var vt=E<12?"AM":"PM";return Gt?vt.toLowerCase():vt},rt={YY:String(this.$y).slice(-2),YYYY:this.$y,M:T+1,MM:m.s(T+1,2,"0"),MMM:N(a.monthsShort,T,x,3),MMMM:N(x,T),D:this.$D,DD:m.s(this.$D,2,"0"),d:String(this.$W),dd:N(a.weekdaysMin,this.$W,j,2),ddd:N(a.weekdaysShort,this.$W,j,3),dddd:j[this.$W],H:String(g),HH:m.s(g,2,"0"),h:ht(1),hh:ht(2),a:lt(g,_,!0),A:lt(g,_,!1),m:String(_),mm:m.s(_,2,"0"),s:String(this.$s),ss:m.s(this.$s,2,"0"),SSS:m.s(this.$ms,3,"0"),Z:d};return l.replace(L,function(E,H){return H||rt[E]||d.replace(":","")})},f.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},f.diff=function(o,c,a){var l,d=m.p(c),g=O(o),_=(g.utcOffset()-this.utcOffset())*n,T=this-g,j=m.m(this,g);return j=(l={},l[M]=j/12,l[D]=j,l[ut]=j/3,l[J]=(T-_)/6048e5,l[v]=(T-_)/864e5,l[b]=T/s,l[p]=T/n,l[h]=T/r,l)[d]||T,a?j:m.a(j)},f.daysInMonth=function(){return this.endOf(D).$D},f.$locale=function(){return k[this.$L]},f.locale=function(o,c){if(!o)return this.$L;var a=this.clone(),l=$t(o,c,!0);return l&&(a.$L=l),a},f.clone=function(){return m.w(this.$d,this)},f.toDate=function(){return new Date(this.valueOf())},f.toJSON=function(){return this.isValid()?this.toISOString():null},f.toISOString=function(){return this.$d.toISOString()},f.toString=function(){return this.$d.toUTCString()},y}(),Qe=At.prototype;return O.prototype=Qe,[["$ms",i],["$s",h],["$m",p],["$H",b],["$W",v],["$M",D],["$y",M],["$D",R]].forEach(function(y){Qe[y[1]]=function(f){return this.$g(f,y[0],y[1])}}),O.extend=function(y,f){return y.$i||(y(f,At,O),y.$i=!0),O},O.locale=$t,O.isDayjs=zt,O.unix=function(y){return O(1e3*y)},O.en=k[dt],O.Ls=k,O.p={},O})})(Ge);const xt=Ge.exports,Wa=xt;function Za(t,e="YYYY-MM-DD"){return Ve(t)&&xt(t).format(e)}function Ye(t="YYYY-MM-DD"){return xt().format(t)}function qa(t="YYYY-MM-DD HH:mm:ss"){return Ye(t)}function Ve(t){return/^\d{4}([/:-\S])(1[0-2]|0?[1-9])\1(0?[1-9]|[1-2]\d|30|31) (?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$/.test(t)}function Ka(t,e){if(!t)throw new Error("regExp regexp \u53C2\u6570\u4E3A\u7A7A");return new RegExp(t,"g").test(e)}function Ja(t){return Ze(t)&&ze(t,0,201)}function ka(t){return/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$/.test(t)}function We(t){return/^\d+$/.test(t)}function Ze(t){return We(t)&&t>0}function Xa(t){return/^-[1-9]\d*$/.test(t)}function Qa(t){return/^(-?[1-9]\d*\.\d+|-?0\.\d*[1-9])$/.test(t)}function ts(t){return/^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(t)}function es(t){return/^((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(?::(?:[0-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$/.test(t)}function rs(t){return/(^(?:(?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$)|(^\[(?:(?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))\](?::(?:[0-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$)/i.test(t)}function ns(t){return/^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/.test(t)}function is(t){return/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/.test(t)}function os(t){return/^[a-zA-Z]+$/.test(t)}function as(t){return/^[A-Za-z0-9]+$/.test(t)}function qe(t){return/^(?:(?:\+|00)86)?1\d{10}$/.test(t)}function Ke(t){return/^(?:(?:\d{3}-)?\d{8}|^(?:\d{4}-)?\d{7,8})(?:-\d+)?$/.test(t)}function ss(t){return qe(t)||Ke(t)}function fs(t){return/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/.test(t)}function us(t){return/^-?\d+(,\d{3})*(\.\d{1,2})?$/.test(t)}function cs(t){return/(?:^[1-9]([0-9]+)?(?:\.[0-9]{1,2})?$)|(?:^(?:0)$)|(?:^[0-9]\.[0-9](?:[0-9])?$)/.test(t)}function ds(t,e=.5){return new TextEncoder().encode(t).length<=e*1024*1024}function Je(t,e=10){if(!t.size)throw new Error("checkFileSize \u4E0D\u662FFile\u6587\u4EF6\u7C7B\u578B");return t.size<=e*1024*1024}function ke(t){return t=t.toLowerCase(),/^.+(\.(gif|png|jpg|jpeg|webp|bmp))$/i.test(t)}function Xe(t){return t=t.toLowerCase(),/^.+(\.(mp4|flv))$/i.test(t)}function hs(t,e="attachment;filename*=utf-8''"){if(!t.data)throw new Error("fileDownload \u53C2\u6570\u683C\u5F0F\u9519\u8BEF");const r=new Blob([t.data],{type:t.data.type}),n=document.createElement("a"),s=window.URL.createObjectURL(r);let i=t.headers["content-disposition"].replaceAll(e,"");i=i||new Date().getTime(),n.href=s,n.download=decodeURIComponent(i),n.click(),window.URL.revokeObjectURL(s)}function ls(t,e){if(!t)throw new Error("hrefDownload src\u53C2\u6570\u5FC5\u4F20");fetch(t,{credentials:"include"}).then(r=>r.blob()).then(r=>{const n=new Blob([r],{type:r.type}),s=document.createElement("a"),i=window.URL.createObjectURL(n);s.href=i,e?(e.includes(".")||(e=e+t.substr(t.lastIndexOf("."))),s.download=e):s.download=t.substr(t.lastIndexOf("/")+1),s.click(),window.URL.revokeObjectURL(i)}).catch(r=>{console.error(r)})}function ys(t,e="image",r={},n=10){return new Promise((s,i)=>{switch(e){case"image":ke(t.name)||i("\u8BF7\u4E0A\u4F20\u6B63\u786E\u7684\u6587\u4EF6\u683C\u5F0F");break;case"video":Xe(t.name)||i("\u8BF7\u4E0A\u4F20\u6B63\u786E\u7684\u6587\u4EF6\u683C\u5F0F");break}n&&(Je(t,n)||i(`\u6587\u4EF6\u5927\u5C0F\u8D85\u8FC7${n}mb`));const h=new FormData;if(h.append("file",t),Ne(r))for(const p in r)h.append(p,r[p]);s(h)})}function bs(){if(!window.location)throw new Error("window.location \u4E0D\u5B58\u5728 \u8BF7\u786E\u4FDD\u6D4F\u89C8\u5668\u73AF\u5883");return window.location}u.checkContentSize=ds,u.checkFileSize=Je,u.cloneDeep=la,u.dateFormat=Za,u.dayjs=Wa,u.fileDownload=hs,u.fileFormDataCreate=ys,u.getDate=Ye,u.getDateTime=qa,u.getLocation=bs,u.getWeather=Ya,u.hrefDownload=ls,u.inRange=ze,u.isAge=Ja,u.isArray=hr,u.isCarNumber=ka,u.isChinese=is,u.isDate=Ve,u.isEmail=ts,u.isFloatingNumber=Qa,u.isGreaterThanZero=Ze,u.isIdNumber=ns,u.isImageType=ke,u.isInteger=Ea,u.isIpV4=es,u.isIpV6=rs,u.isLetter=os,u.isLetterAndNumber=as,u.isNegativeZero=Xa,u.isNumber=Sa,u.isNumberAndMoney=cs,u.isNumberAndMoneyThousandSplit=us,u.isObject=Ne,u.isPhone=qe,u.isPhoneOrTelPhone=ss,u.isPositiveInteger=We,u.isTelPhone=Ke,u.isUrl=fs,u.isVideoType=Xe,u.random=Ga,u.regExp=Ka,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});