@vtj/utils 0.13.9 → 0.13.11

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/index.cjs CHANGED
@@ -2,9 +2,9 @@
2
2
  * Copyright (c) 2025, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/utils
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.13.9
5
+ * @version 0.13.11
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
- */const gn="0.13.9";/**
7
+ */const gn="0.13.11";/**
8
8
  * @vue/shared v3.5.18
9
9
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
10
10
  * @license MIT
@@ -13,4 +13,4 @@
13
13
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[ct]=this[ct]={accessors:{}}).accessors,s=this.prototype;function o(i){const a=Q(i);r[a]||(Qr(s,i),r[a]=!0)}return l.isArray(t)?t.forEach(o):o(t),this}};j.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);l.reduceDescriptors(j.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});l.freezeMethods(j);function je(e,t){const n=this||oe,r=t||n,s=j.from(r.headers);let o=r.data;return l.forEach(e,function(a){o=a.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function Kt(e){return!!(e&&e.__CANCEL__)}function Y(e,t,n){w.call(this,e??"canceled",w.ERR_CANCELED,t,n),this.name="CanceledError"}l.inherits(Y,w,{__CANCEL__:!0});function Vt(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new w("Request failed with status code "+n.status,[w.ERR_BAD_REQUEST,w.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Zr(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function es(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),f=r[o];i||(i=c),n[s]=u,r[s]=c;let d=o,m=0;for(;d!==s;)m+=n[d++],d=d%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),c-i<t)return;const E=f&&c-f;return E?Math.round(m*1e3/E):void 0}}function ts(e,t){let n=0,r=1e3/t,s,o;const i=(c,f=Date.now())=>{n=f,s=null,o&&(clearTimeout(o),o=null),e.apply(null,c)};return[(...c)=>{const f=Date.now(),d=f-n;d>=r?i(c,f):(s=c,o||(o=setTimeout(()=>{o=null,i(s)},r-d)))},()=>s&&i(s)]}const me=(e,t,n=3)=>{let r=0;const s=es(50,250);return ts(o=>{const i=o.loaded,a=o.lengthComputable?o.total:void 0,u=i-r,c=s(u),f=i<=a;r=i;const d={loaded:i,total:a,progress:a?i/a:void 0,bytes:u,rate:c||void 0,estimated:c&&a&&f?(a-i)/c:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},lt=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ut=e=>(...t)=>l.asap(()=>e(...t)),ns=T.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,T.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(T.origin),T.navigator&&/(msie|trident)/i.test(T.navigator.userAgent)):()=>!0,rs=T.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const i=[e+"="+encodeURIComponent(t)];l.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),l.isString(r)&&i.push("path="+r),l.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function ss(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function os(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Xt(e,t,n){let r=!ss(t);return e&&(r||n==!1)?os(e,t):t}const ft=e=>e instanceof j?{...e}:e;function J(e,t){t=t||{};const n={};function r(c,f,d,m){return l.isPlainObject(c)&&l.isPlainObject(f)?l.merge.call({caseless:m},c,f):l.isPlainObject(f)?l.merge({},f):l.isArray(f)?f.slice():f}function s(c,f,d,m){if(l.isUndefined(f)){if(!l.isUndefined(c))return r(void 0,c,d,m)}else return r(c,f,d,m)}function o(c,f){if(!l.isUndefined(f))return r(void 0,f)}function i(c,f){if(l.isUndefined(f)){if(!l.isUndefined(c))return r(void 0,c)}else return r(void 0,f)}function a(c,f,d){if(d in t)return r(c,f);if(d in e)return r(void 0,c)}const u={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(c,f,d)=>s(ft(c),ft(f),d,!0)};return l.forEach(Object.keys(Object.assign({},e,t)),function(f){const d=u[f]||s,m=d(e[f],t[f],f);l.isUndefined(m)&&d!==a||(n[f]=m)}),n}const Yt=e=>{const t=J({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;t.headers=i=j.from(i),t.url=$t(Xt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let u;if(l.isFormData(n)){if(T.hasStandardBrowserEnv||T.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((u=i.getContentType())!==!1){const[c,...f]=u?u.split(";").map(d=>d.trim()).filter(Boolean):[];i.setContentType([c||"multipart/form-data",...f].join("; "))}}if(T.hasStandardBrowserEnv&&(r&&l.isFunction(r)&&(r=r(t)),r||r!==!1&&ns(t.url))){const c=s&&o&&rs.read(o);c&&i.set(s,c)}return t},is=typeof XMLHttpRequest<"u",as=is&&function(e){return new Promise(function(n,r){const s=Yt(e);let o=s.data;const i=j.from(s.headers).normalize();let{responseType:a,onUploadProgress:u,onDownloadProgress:c}=s,f,d,m,E,h;function g(){E&&E(),h&&h(),s.cancelToken&&s.cancelToken.unsubscribe(f),s.signal&&s.signal.removeEventListener("abort",f)}let p=new XMLHttpRequest;p.open(s.method.toUpperCase(),s.url,!0),p.timeout=s.timeout;function y(){if(!p)return;const b=j.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),A={data:!a||a==="text"||a==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:b,config:e,request:p};Vt(function(M){n(M),g()},function(M){r(M),g()},A),p=null}"onloadend"in p?p.onloadend=y:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(y)},p.onabort=function(){p&&(r(new w("Request aborted",w.ECONNABORTED,e,p)),p=null)},p.onerror=function(){r(new w("Network Error",w.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let v=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const A=s.transitional||Wt;s.timeoutErrorMessage&&(v=s.timeoutErrorMessage),r(new w(v,A.clarifyTimeoutError?w.ETIMEDOUT:w.ECONNABORTED,e,p)),p=null},o===void 0&&i.setContentType(null),"setRequestHeader"in p&&l.forEach(i.toJSON(),function(v,A){p.setRequestHeader(A,v)}),l.isUndefined(s.withCredentials)||(p.withCredentials=!!s.withCredentials),a&&a!=="json"&&(p.responseType=s.responseType),c&&([m,h]=me(c,!0),p.addEventListener("progress",m)),u&&p.upload&&([d,E]=me(u),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",E)),(s.cancelToken||s.signal)&&(f=b=>{p&&(r(!b||b.type?new Y(null,e,p):b),p.abort(),p=null)},s.cancelToken&&s.cancelToken.subscribe(f),s.signal&&(s.signal.aborted?f():s.signal.addEventListener("abort",f)));const S=Zr(s.url);if(S&&T.protocols.indexOf(S)===-1){r(new w("Unsupported protocol "+S+":",w.ERR_BAD_REQUEST,e));return}p.send(o||null)})},cs=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(c){if(!s){s=!0,a();const f=c instanceof Error?c:this.reason;r.abort(f instanceof w?f:new Y(f instanceof Error?f.message:f))}};let i=t&&setTimeout(()=>{i=null,o(new w(`timeout ${t} of ms exceeded`,w.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(o):c.removeEventListener("abort",o)}),e=null)};e.forEach(c=>c.addEventListener("abort",o));const{signal:u}=r;return u.unsubscribe=()=>l.asap(a),u}},ls=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},us=async function*(e,t){for await(const n of fs(e))yield*ls(n,t)},fs=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},dt=(e,t,n,r)=>{const s=us(e,t);let o=0,i,a=u=>{i||(i=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:c,value:f}=await s.next();if(c){a(),u.close();return}let d=f.byteLength;if(n){let m=o+=d;n(m)}u.enqueue(new Uint8Array(f))}catch(c){throw a(c),c}},cancel(u){return a(u),s.return()}},{highWaterMark:2})},_e=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Gt=_e&&typeof ReadableStream=="function",ds=_e&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Qt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},hs=Gt&&Qt(()=>{let e=!1;const t=new Request(T.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),ht=64*1024,qe=Gt&&Qt(()=>l.isReadableStream(new Response("").body)),ge={stream:qe&&(e=>e.body)};_e&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ge[t]&&(ge[t]=l.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new w(`Response type '${t}' is not supported`,w.ERR_NOT_SUPPORT,r)})})})(new Response);const ps=async e=>{if(e==null)return 0;if(l.isBlob(e))return e.size;if(l.isSpecCompliantForm(e))return(await new Request(T.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(l.isArrayBufferView(e)||l.isArrayBuffer(e))return e.byteLength;if(l.isURLSearchParams(e)&&(e=e+""),l.isString(e))return(await ds(e)).byteLength},ms=async(e,t)=>{const n=l.toFiniteNumber(e.getContentLength());return n??ps(t)},gs=_e&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:o,timeout:i,onDownloadProgress:a,onUploadProgress:u,responseType:c,headers:f,withCredentials:d="same-origin",fetchOptions:m}=Yt(e);c=c?(c+"").toLowerCase():"text";let E=cs([s,o&&o.toAbortSignal()],i),h;const g=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let p;try{if(u&&hs&&n!=="get"&&n!=="head"&&(p=await ms(f,r))!==0){let A=new Request(t,{method:"POST",body:r,duplex:"half"}),D;if(l.isFormData(r)&&(D=A.headers.get("content-type"))&&f.setContentType(D),A.body){const[M,ie]=lt(p,me(ut(u)));r=dt(A.body,ht,M,ie)}}l.isString(d)||(d=d?"include":"omit");const y="credentials"in Request.prototype;h=new Request(t,{...m,signal:E,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:y?d:void 0});let S=await fetch(h,m);const b=qe&&(c==="stream"||c==="response");if(qe&&(a||b&&g)){const A={};["status","statusText","headers"].forEach(nt=>{A[nt]=S[nt]});const D=l.toFiniteNumber(S.headers.get("content-length")),[M,ie]=a&&lt(D,me(ut(a),!0))||[];S=new Response(dt(S.body,ht,M,()=>{ie&&ie(),g&&g()}),A)}c=c||"text";let v=await ge[l.findKey(ge,c)||"text"](S,e);return!b&&g&&g(),await new Promise((A,D)=>{Vt(A,D,{data:v,headers:j.from(S.headers),status:S.status,statusText:S.statusText,config:e,request:h})})}catch(y){throw g&&g(),y&&y.name==="TypeError"&&/Load failed|fetch/i.test(y.message)?Object.assign(new w("Network Error",w.ERR_NETWORK,e,h),{cause:y.cause||y}):w.from(y,y&&y.code,e,h)}}),He={http:Lr,xhr:as,fetch:gs};l.forEach(He,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const pt=e=>`- ${e}`,ws=e=>l.isFunction(e)||e===null||e===!1,Zt={getAdapter:e=>{e=l.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o<t;o++){n=e[o];let i;if(r=n,!ws(n)&&(r=He[(i=String(n)).toLowerCase()],r===void 0))throw new w(`Unknown adapter '${i}'`);if(r)break;s[i||"#"+o]=r}if(!r){const o=Object.entries(s).map(([a,u])=>`adapter ${a} `+(u===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since :
14
14
  `+o.map(pt).join(`
15
15
  `):" "+pt(o[0]):"as no adapter specified";throw new w("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:He};function Le(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Y(null,e)}function mt(e){return Le(e),e.headers=j.from(e.headers),e.data=je.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Zt.getAdapter(e.adapter||oe.adapter)(e).then(function(r){return Le(e),r.data=je.call(e,e.transformResponse,r),r.headers=j.from(r.headers),r},function(r){return Kt(r)||(Le(e),r&&r.response&&(r.response.data=je.call(e,e.transformResponse,r.response),r.response.headers=j.from(r.response.headers))),Promise.reject(r)})}const en="1.10.0",Oe={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Oe[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const gt={};Oe.transitional=function(t,n,r){function s(o,i){return"[Axios v"+en+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,a)=>{if(t===!1)throw new w(s(i," has been removed"+(n?" in "+n:"")),w.ERR_DEPRECATED);return n&&!gt[i]&&(gt[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,a):!0}};Oe.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function ys(e,t,n){if(typeof e!="object")throw new w("options must be an object",w.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const a=e[o],u=a===void 0||i(a,o,e);if(u!==!0)throw new w("option "+o+" must be "+u,w.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new w("Unknown option "+o,w.ERR_BAD_OPTION)}}const he={assertOptions:ys,validators:Oe},U=he.validators;let H=class{constructor(t){this.defaults=t||{},this.interceptors={request:new at,response:new at}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
16
- `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=J(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&he.assertOptions(r,{silentJSONParsing:U.transitional(U.boolean),forcedJSONParsing:U.transitional(U.boolean),clarifyTimeoutError:U.transitional(U.boolean)},!1),s!=null&&(l.isFunction(s)?n.paramsSerializer={serialize:s}:he.assertOptions(s,{encode:U.function,serialize:U.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),he.assertOptions(n,{baseUrl:U.spelling("baseURL"),withXsrfToken:U.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&l.merge(o.common,o[n.method]);o&&l.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=j.concat(i,o);const a=[];let u=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(u=u&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const c=[];this.interceptors.response.forEach(function(g){c.push(g.fulfilled,g.rejected)});let f,d=0,m;if(!u){const h=[mt.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,c),m=h.length,f=Promise.resolve(n);d<m;)f=f.then(h[d++],h[d++]);return f}m=a.length;let E=n;for(d=0;d<m;){const h=a[d++],g=a[d++];try{E=h(E)}catch(p){g.call(this,p);break}}try{f=mt.call(this,E)}catch(h){return Promise.reject(h)}for(d=0,m=c.length;d<m;)f=f.then(c[d++],c[d++]);return f}getUri(t){t=J(this.defaults,t);const n=Xt(t.baseURL,t.url,t.allowAbsoluteUrls);return $t(n,t.params,t.paramsSerializer)}};l.forEach(["delete","get","head","options"],function(t){H.prototype[t]=function(n,r){return this.request(J(r||{},{method:t,url:n,data:(r||{}).data}))}});l.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,a){return this.request(J(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}H.prototype[t]=n(),H.prototype[t+"Form"]=n(!0)});let bs=class tn{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(a=>{r.subscribe(a),o=a}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,a){r.reason||(r.reason=new Y(o,i,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new tn(function(s){t=s}),cancel:t}}};function Rs(e){return function(n){return e.apply(null,n)}}function Es(e){return l.isObject(e)&&e.isAxiosError===!0}const Je={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Je).forEach(([e,t])=>{Je[t]=e});function nn(e){const t=new H(e),n=vt(H.prototype.request,t);return l.extend(n,H.prototype,t,{allOwnKeys:!0}),l.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return nn(J(e,s))},n}const _=nn(oe);_.Axios=H;_.CanceledError=Y;_.CancelToken=bs;_.isCancel=Kt;_.VERSION=en;_.toFormData=Se;_.AxiosError=w;_.Cancel=_.CanceledError;_.all=function(t){return Promise.all(t)};_.spread=Rs;_.isAxiosError=Es;_.mergeConfig=J;_.AxiosHeaders=j;_.formToJSON=e=>zt(l.isHTMLForm(e)?new FormData(e):e);_.getAdapter=Zt.getAdapter;_.HttpStatusCode=Je;_.default=_;const{Axios:uo,AxiosError:fo,CanceledError:ho,isCancel:po,CancelToken:mo,VERSION:go,all:wo,Cancel:yo,isAxiosError:bo,spread:Ro,toFormData:Eo,AxiosHeaders:So,HttpStatusCode:_o,formToJSON:Oo,getAdapter:To,mergeConfig:Ao}=_,Ss={form:"application/x-www-form-urlencoded",json:"application/json",data:"multipart/form-data"},_s=["put","post","patch"],$e="Local-Request-Id",Os=100,Ts=300;let rn=class{constructor(t={}){L(this,"axios");L(this,"settings");L(this,"records",{});L(this,"isLoading",!1);L(this,"stopSkipWarn");L(this,"showLoading");L(this,"showError");this.settings=Object.assign({type:"form"},t.settings||{});const n=O.omit(t,["settings","query"]);this.axios=_.create(O.merge({headers:{"Content-Type":"application/x-www-form-urlencoded"},timeout:120*1e3},n)),this.setupSkipWarn(this.settings),this.showLoading=O.debounce(this.openLoading.bind(this),Os),this.showError=O.throttle(this._showError.bind(this),Ts,{leading:!0,trailing:!1})}setConfig(t={}){this.settings=O.merge(this.settings,t.settings||{});const n=O.omit(t,["settings","query"]);this.axios.defaults=O.merge(this.axios.defaults,n),this.setupSkipWarn(this.settings)}cancel(t,n="请求已取消"){if(t){const r=this.records[t];if(!r)return;r.source.cancel(n)}else for(const r of Object.values(this.records))r.source.cancel(n)}createHeaders(t,n,r){const s=n.injectHeaders?typeof n.headers=="function"?n.headers(t,r,n):n.headers||{}:{},o={"Content-Type":Ss[n.type||"form"],...r.headers,...s};return n.skipWarn&&(o[$e]=t),o}isJsonType(t){return Object.entries(t).some(([n,r])=>n.toLowerCase()==="content-type"&&String(r).includes("application/json"))}toFormData(t,n="data"){if(t instanceof FormData||t instanceof URLSearchParams)return t;const r=n==="data"?new FormData:new URLSearchParams;return Object.entries(t).forEach(([s,o])=>{r.append(s,o)}),r}createSendData(t,n,r,s,o={}){const{type:i,skipWarn:a}=t,{name:u="skipWarn"}=a||{};let{data:c,params:f={},method:d="get"}=n;const m=s?{[u]:!0}:{};return _s.includes(d.toLowerCase())?(c=Object.assign(c||{},m),c=i!=="json"||!this.isJsonType(r)?this.toFormData(c,i):c,f={...o}):i==="form"?f={...c||{},...o,...m}:(c&&(i!=="json"||!this.isJsonType(r))&&(c=this.toFormData(c,i)),f={...o,...m}),{data:c,params:f}}createUrl(t){let{url:n,params:r}=t;if(n){let s=O.isUrl(n)?new URL(n).origin:"";const o=s?n.replace(s,""):n;try{const i=O.pathToRegexpCompile(o,{encode:encodeURIComponent});return s+i(r||{})}catch{console.warn("createUrl","pathToRegexpCompile error",n)}}return n}openLoading(t){const{loading:n,showLoading:r}=t;n&&r&&Object.keys(this.records).length>0&&(this.isLoading=!0,r())}closeLoading(t){const{loading:n,hideLoading:r}=t;if(!n)return;this.isLoading=!1;const s=Object.keys(this.records);r&&s.length===0&&(this.isLoading=!1,r())}_showError(t,n){const{failMessage:r,showError:s}=t;if(r&&s){const o=n?.response?.data,i=o?.message||o?.msg||n?.message||n?.msg||"未知错误";s(i,n)}}validResponse(t,n){const{validSuccess:r,validate:s}=t;return r&&s?!!s(n):!0}isSkipWarnResponse(t){return!!t.promise}send(t={},n=!1){const r=O.merge({},this.settings,t.settings||{}),s=t.query||{},o=O.omit(t,["settings","query"]),i=O.uuid(!1),a=_.CancelToken.source();this.records[i]={settings:r,config:o,source:a};const u=this.createUrl(o),c=this.createHeaders(i,r,o),{data:f,params:d}=this.createSendData(r,o,c,n,s);return this.showLoading(r),new Promise((m,E)=>{this.axios({cancelToken:a.token,...o,url:u,headers:c,data:f,params:d}).then(h=>this.isSkipWarnResponse(h)?m(h.promise):this.validResponse(r,h)?m(r.originResponse?h:h.data?.data):(this.showError(r,h.data),E(h.data))).catch(h=>(this.showError(r,h),E(h))).finally(()=>{delete this.records[i],this.closeLoading(r)})})}useResponse(t,n){const{response:r}=this.axios.interceptors,s=r.use(t,n);return()=>r.eject(s)}useRequest(t,n){const{request:r}=this.axios.interceptors,s=r.use(t,n);return()=>r.eject(s)}setupSkipWarn(t){if(this.stopSkipWarn&&(this.stopSkipWarn(),this.stopSkipWarn=void 0),!t.skipWarn)return;const{code:n,executor:r,callback:s,complete:o}=t.skipWarn;this.stopSkipWarn=this.useResponse(i=>{const u=(i.config.headers||{})[$e],c=this.records[u];if(!c)return i;const{data:f}=i;if(!f||typeof f!="object")return i;if(f?.code===n){s&&s(i);const d=new Promise(r).then(()=>this.send({...c.config,settings:c.settings},!0));d.catch(m=>m).finally(()=>{o&&o()}),i.promise=d}return i})}};function sn(e={}){const t=new rn(e),n=t.send.bind(t),r=t.cancel.bind(t),s=t.setConfig.bind(t),o=t.useRequest.bind(t),i=t.useResponse.bind(t);return Object.assign(n,{...t,instance:t,send:n,cancel:r,setConfig:s,useRequest:o,useResponse:i})}const on=sn({settings:{injectHeaders:!0,loading:!0,originResponse:!0}});function an(e){const t=typeof e=="string"?{url:e}:e;return(n,r)=>on.send(O.merge({},t,r||{},{data:n}))}function As(e){const t={};for(const[n,r]of Object.entries(e))t[n]=an(r);return t}function xs(e,t){const n=Ce(null),r=Ce(),s=Ce(!0);return e.then(o=>{n.value=t?t(o):o}).catch(o=>{r.value=o}).finally(()=>{s.value=!1}),{data:n,error:r,loading:s}}const V=typeof window<"u",Cs=e=>new Promise((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>{t(r.result)},r.onerror=s=>{n(s)}});function Ps(e){const t={};return e?(e.forEach((n,r)=>{t[r]=typeof n=="string"?decodeURIComponent(n):n}),t):{}}function js(e){const t=e.split(","),n=t[0].match(/:(.*?);/)?.[1],r=atob(t[1]);let s=r.length;const o=new Uint8Array(s);for(;s--;)o[s]=r.charCodeAt(s);return new Blob([o],{type:n})}function Ls(e,t){const n=e;return n.lastModified=Date.now(),n.lastModifiedDate=new Date,n.name=t,n}const vs=e=>V?window.requestAnimationFrame(e):setTimeout(e,16),Ns=e=>V?window.cancelAnimationFrame(e):clearTimeout(e);class cn{constructor(t={}){L(this,"options",{type:"cache",expired:0,prefix:"__VTJ_"});L(this,"caches",{});L(this,"types");this.types={local:V?window.localStorage:this.caches,session:V?window.sessionStorage:this.caches,cache:this.caches},this.config(t)}config(t={}){this.options=Object.assign(this.options,t)}save(t,n,r={}){const{type:s,expired:o,prefix:i}={...this.options,...r},a=Date.now(),u=i+t,c=this.types[s]||this.caches,f={value:n,timestamp:a,expired:o};c===this.caches?c[u]=f:c.setItem(u,JSON.stringify(f))}get(t,n={}){const{type:r,prefix:s}={...this.options,...n},o=s+t,i=this.types[r]||this.caches;let a;if(i===this.caches)a=i[o];else{const m=i.getItem(o);m&&(a=JSON.parse(m))}if(!a)return null;const{value:u,timestamp:c,expired:f}=a;return f>0&&c+f<Date.now()?(this.remove(t,n),null):u}remove(t,n={}){const{type:r,prefix:s}={...this.options,...n},o=this.types[r]||this.caches,i=s+t;o===this.caches?delete o[i]:o.removeItem(i)}clear(t={}){const{type:n}={...this.options,...t},r=this.types[n]||this.caches;r===this.caches?this.caches={}:r.clear()}}const Us=new cn;function ln(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Z={exports:{}},Fs=Z.exports,wt;function Ds(){return wt||(wt=1,function(e,t){(function(n,r){r(t,e)})(Fs,function(n,r){var s={timeout:5e3,jsonpCallback:"callback"};function o(){return"jsonp_"+Date.now()+"_"+Math.ceil(Math.random()*1e5)}function i(c){try{delete window[c]}catch{window[c]=void 0}}function a(c){var f=document.getElementById(c);f&&document.getElementsByTagName("head")[0].removeChild(f)}function u(c){var f=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],d=c,m=f.timeout||s.timeout,E=f.jsonpCallback||s.jsonpCallback,h=void 0;return new Promise(function(g,p){var y=f.jsonpCallbackFunction||o(),S=E+"_"+y;window[y]=function(v){g({ok:!0,json:function(){return Promise.resolve(v)}}),h&&clearTimeout(h),a(S),i(y)},d+=d.indexOf("?")===-1?"?":"&";var b=document.createElement("script");b.setAttribute("src",""+d+E+"="+y),f.charset&&b.setAttribute("charset",f.charset),f.nonce&&b.setAttribute("nonce",f.nonce),f.referrerPolicy&&b.setAttribute("referrerPolicy",f.referrerPolicy),f.crossorigin&&b.setAttribute("crossorigin","true"),b.id=S,document.getElementsByTagName("head")[0].appendChild(b),h=setTimeout(function(){p(new Error("JSONP request to "+c+" timed out")),i(y),a(S),window[y]=function(){i(y)}},m),b.onerror=function(){p(new Error("JSONP request to "+c+" failed")),i(y),a(S),h&&clearTimeout(h)}})}r.exports=u})}(Z,Z.exports)),Z.exports}var Bs=Ds();const Is=ln(Bs);function Ms(e){if(V){const{protocol:t,host:n,pathname:r}=location;return`${t}//${n}${e?r:""}`}else return null}function ks(e=""){const t=e.match(O.rURL);return t?t[0]:""}function un(e){const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push([n,encodeURIComponent(e[n])].join("="));return t.join("&")}function We(e,t,n){const r={};e=(e||location.search).replace(/^[^]*\?/,""),t=t||"&",n=n||"=";let s;const o=new RegExp("(?:^|\\"+t+")([^\\"+n+"\\"+t+"]+)(?:\\"+n+"([^\\"+t+"]*))?","g");for(;(s=o.exec(e))!==null;)s[1]!==e&&(r[decodeURIComponent(s[1])]=decodeURIComponent(s[2]||""));return r}function fn(e,t){t=typeof t=="string"?We(t):t;const n=e.split("?")[0],r=We(e),s=Object.assign({},r,t),o=un(s);return o?[n,o].join("?"):e}const qs=Object.freeze(Object.defineProperty({__proto__:null,append:fn,getCurrentHost:Ms,getHost:ks,parse:We,stringify:un},Symbol.toStringTag,{value:"Module"}));async function Hs(e,t={}){const{query:n={}}=t;e.includes("${")&&(e=O.template(e)(n||{}));const r=fn(e,n);return await(await Is(r,t)).json()}var ve,yt;function Js(){if(yt)return ve;yt=1,ve=function(s,o,i){var a=document.head||document.getElementsByTagName("head")[0],u=document.createElement("script");typeof o=="function"&&(i=o,o={}),o=o||{},i=i||function(){},u.type=o.type||"text/javascript",u.charset=o.charset||"utf8",u.async="async"in o?!!o.async:!0,u.src=s,o.attrs&&e(u,o.attrs),o.text&&(u.text=""+o.text);var c="onload"in u?t:n;c(u,i),u.onload||t(u,i),a.appendChild(u)};function e(r,s){for(var o in s)r.setAttribute(o,s[o])}function t(r,s){r.onload=function(){this.onerror=this.onload=null,s(null,r)},r.onerror=function(){this.onerror=this.onload=null,s(new Error("Failed to load "+this.src),r)}}function n(r,s){r.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,s(null,r))}}return ve}var $s=Js();const Ws=ln($s);function zs(e,t={}){return new Promise((n,r)=>{const{library:s}=t;Ws(e,t,(o,i)=>{o?r(o):n(s?window[s]:void 0)})})}const bt={debug:-1,log:0,info:0,warn:1,error:2},Ks=function(e,t,n,r){return function(...s){if(t&&bt[t]<=bt[e]&&console[e].apply&&(r==="*"||n.startsWith(r)))return console[e].apply(console,Vs(s,n))}};function Vs(e,t){return t!=="*"&&(typeof e[0]=="string"?e[0]=`[${t}] ${e[0]}`:e=["["+t+"]"].concat(e)),e}function Xs(e,t){if(!e)return{targetLevel:t.level,targetBizName:t.bizName};if(~e.indexOf(":")){const n=e.split(":");return{targetLevel:n[0],targetBizName:n[1]}}return{targetLevel:e,targetBizName:"*"}}const Ys={level:"warn",bizName:"*"};class dn{constructor(t){L(this,"config");L(this,"options");this.options={...Ys,...t};const n=typeof location<"u"?location:{},r=(/__(?:logConf|logLevel)__=([^#/&]*)/.exec(n.href)||[])[1];this.config=Xs(r,t)}_log(t){const{targetLevel:n,targetBizName:r}=this.config,{bizName:s}=this.options;return Ks(t,n,s,r)}debug(...t){return this._log("debug")(...t)}log(...t){return this._log("log")(...t)}info(...t){return this._log("info")(...t)}warn(...t){return this._log("warn")(...t)}error(...t){return this._log("error")(...t)}}function hn(e){return new dn(e)}const Gs=hn({level:"log",bizName:"VTJ"});/*! js-cookie v3.0.5 | MIT */function le(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var Qs={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function ze(e,t){function n(s,o,i){if(!(typeof document>"u")){i=le({},t,i),typeof i.expires=="number"&&(i.expires=new Date(Date.now()+i.expires*864e5)),i.expires&&(i.expires=i.expires.toUTCString()),s=encodeURIComponent(s).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var u in i)i[u]&&(a+="; "+u,i[u]!==!0&&(a+="="+i[u].split(";")[0]));return document.cookie=s+"="+e.write(o,s)+a}}function r(s){if(!(typeof document>"u"||arguments.length&&!s)){for(var o=document.cookie?document.cookie.split("; "):[],i={},a=0;a<o.length;a++){var u=o[a].split("="),c=u.slice(1).join("=");try{var f=decodeURIComponent(u[0]);if(i[f]=e.read(c,f),s===f)break}catch{}}return s?i[s]:i}}return Object.create({set:n,get:r,remove:function(s,o){n(s,"",le({},o,{expires:-1}))},withAttributes:function(s){return ze(this.converter,le({},this.attributes,s))},withConverter:function(s){return ze(le({},this.converter,s),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var et=ze(Qs,{path:"/"});function Zs(e,t,n){et.set(e,t,n)}function eo(e){return et.get(e)}function to(e,t){et.remove(e,t)}const no=Object.freeze(Object.defineProperty({__proto__:null,get:eo,remove:to,set:Zs},Symbol.toStringTag,{value:"Module"}));function ro(e,t=""){const n=document.createElement("a");n.download=t,n.href=e,n.target="_blank",n.click()}function tt(e,t="",n){const r=new Blob([e],{type:n}),s=document.createElement("a");s.download=t,s.style.display="none",s.href=URL.createObjectURL(r),s.click(),URL.revokeObjectURL(s.href)}async function so(e,t="",n){return fetch(e,{credentials:"include"}).then(async r=>{const s=await r.blob();return tt(s,t,n),s})}function oo(e,t=""){const n=JSON.stringify(e);tt(n,t,"application/json")}function io(){const e=navigator.userAgent;let t="Unknown",n="Unknown",r="Unknown",s="Unknown",o=!1;if(/Windows NT/i.test(e)){t="Windows";const a={"12.0":"12","11.0":"11","10.0":"10","6.3":"8.1","6.2":"8","6.1":"7","6.0":"Vista","5.2":"XP 64-bit","5.1":"XP"},u=e.match(/Windows NT (\d+\.\d+)/);u&&(n=a[u[1]]||u[1])}else if(/Mac OS X/i.test(e)){t="Mac OS";const a=e.match(/Mac OS X (\d+[._]\d+[._]?\d*)/);a&&(n=a[1].replace(/_/g,"."))}else if(/(iPhone|iPad|iPod)/i.test(e)){t="iOS";const a=e.match(/OS (\d+[_\.]\d+[_\.]?\d*)/);a&&(n=a[1].replace(/_/g,"."))}else if(/Android/i.test(e)){t="Android";const a=e.match(/Android (\d+\.\d+)/);a&&(n=a[1])}else/Linux/i.test(e)&&(t="Linux");const i=e.match(/(Edge|Edg|Edga|EdgA)\/(\d+)/i);if(i)r="Microsoft Edge",s=i[2];else{const a=e.match(/Firefox\/(\d+)/i);if(a)r="Firefox",s=a[1];else{const u=e.match(/(Opera|OPR)\/(\d+)/i);if(u)r="Opera",s=u[2];else{const c=e.match(/Chrome\/(\d+)/i);if(c)r="Chrome",s=c[1];else{const f=e.match(/Version\/(\d+\.\d+)/i);if(f&&/Safari/i.test(e))r="Safari",s=f[1];else{const d=e.match(/(MSIE |Trident.*rv:)(\d+)/i);d&&(r="Internet Explorer",s=d[2])}}}}}return o=/(iPhone|iPod|iPad|Android|Windows Phone|Mobile)/i.test(e)||["iOS","Android"].includes(t),/(iPad|Tablet|Android(?!.*Mobile))/i.test(e)&&(o=!0),{os:t,osVersion:n,browser:r,browserVersion:s,isMobile:o}}exports.LOCAL_REQUEST_ID=$e;exports.Logger=dn;exports.Request=rn;exports.Storage=cn;exports.VTJ_UTILS_VERSION=gn;exports.axios=_;exports.blobToFile=Ls;exports.cAF=Ns;exports.cookie=no;exports.createApi=an;exports.createApis=As;exports.createRequest=sn;exports.dataURLtoBlob=js;exports.downloadBlob=tt;exports.downloadJson=oo;exports.downloadRemoteFile=so;exports.downloadUrl=ro;exports.fileToBase64=Cs;exports.formDataToJson=Ps;exports.getClientInfo=io;exports.getLogger=hn;exports.isClient=V;exports.jsonp=Hs;exports.loadScript=zs;exports.logger=Gs;exports.rAF=vs;exports.request=on;exports.storage=Us;exports.url=qs;exports.useApi=xs;Object.keys(O).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>O[e]})});
16
+ `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=J(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&he.assertOptions(r,{silentJSONParsing:U.transitional(U.boolean),forcedJSONParsing:U.transitional(U.boolean),clarifyTimeoutError:U.transitional(U.boolean)},!1),s!=null&&(l.isFunction(s)?n.paramsSerializer={serialize:s}:he.assertOptions(s,{encode:U.function,serialize:U.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),he.assertOptions(n,{baseUrl:U.spelling("baseURL"),withXsrfToken:U.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&l.merge(o.common,o[n.method]);o&&l.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=j.concat(i,o);const a=[];let u=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(u=u&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const c=[];this.interceptors.response.forEach(function(g){c.push(g.fulfilled,g.rejected)});let f,d=0,m;if(!u){const h=[mt.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,c),m=h.length,f=Promise.resolve(n);d<m;)f=f.then(h[d++],h[d++]);return f}m=a.length;let E=n;for(d=0;d<m;){const h=a[d++],g=a[d++];try{E=h(E)}catch(p){g.call(this,p);break}}try{f=mt.call(this,E)}catch(h){return Promise.reject(h)}for(d=0,m=c.length;d<m;)f=f.then(c[d++],c[d++]);return f}getUri(t){t=J(this.defaults,t);const n=Xt(t.baseURL,t.url,t.allowAbsoluteUrls);return $t(n,t.params,t.paramsSerializer)}};l.forEach(["delete","get","head","options"],function(t){H.prototype[t]=function(n,r){return this.request(J(r||{},{method:t,url:n,data:(r||{}).data}))}});l.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,a){return this.request(J(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}H.prototype[t]=n(),H.prototype[t+"Form"]=n(!0)});let bs=class tn{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(a=>{r.subscribe(a),o=a}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,a){r.reason||(r.reason=new Y(o,i,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new tn(function(s){t=s}),cancel:t}}};function Rs(e){return function(n){return e.apply(null,n)}}function Es(e){return l.isObject(e)&&e.isAxiosError===!0}const Je={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Je).forEach(([e,t])=>{Je[t]=e});function nn(e){const t=new H(e),n=vt(H.prototype.request,t);return l.extend(n,H.prototype,t,{allOwnKeys:!0}),l.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return nn(J(e,s))},n}const _=nn(oe);_.Axios=H;_.CanceledError=Y;_.CancelToken=bs;_.isCancel=Kt;_.VERSION=en;_.toFormData=Se;_.AxiosError=w;_.Cancel=_.CanceledError;_.all=function(t){return Promise.all(t)};_.spread=Rs;_.isAxiosError=Es;_.mergeConfig=J;_.AxiosHeaders=j;_.formToJSON=e=>zt(l.isHTMLForm(e)?new FormData(e):e);_.getAdapter=Zt.getAdapter;_.HttpStatusCode=Je;_.default=_;const{Axios:uo,AxiosError:fo,CanceledError:ho,isCancel:po,CancelToken:mo,VERSION:go,all:wo,Cancel:yo,isAxiosError:bo,spread:Ro,toFormData:Eo,AxiosHeaders:So,HttpStatusCode:_o,formToJSON:Oo,getAdapter:To,mergeConfig:Ao}=_,Ss={form:"application/x-www-form-urlencoded",json:"application/json",data:"multipart/form-data"},_s=["put","post","patch"],$e="Local-Request-Id",Os=100,Ts=300;let rn=class{constructor(t={}){L(this,"axios");L(this,"settings");L(this,"records",{});L(this,"isLoading",!1);L(this,"stopSkipWarn");L(this,"showLoading");L(this,"showError");this.settings=Object.assign({type:"form"},t.settings||{});const n=O.omit(t,["settings","query"]);this.axios=_.create(O.merge({headers:{"Content-Type":"application/x-www-form-urlencoded"},timeout:120*1e3},n)),this.setupSkipWarn(this.settings),this.showLoading=O.debounce(this.openLoading.bind(this),Os),this.showError=O.throttle(this._showError.bind(this),Ts,{leading:!0,trailing:!1})}setConfig(t={}){this.settings=O.merge(this.settings,t.settings||{});const n=O.omit(t,["settings","query"]);this.axios.defaults=O.merge(this.axios.defaults,n),this.setupSkipWarn(this.settings)}cancel(t,n="请求已取消"){if(t){const r=this.records[t];if(!r)return;r.source.cancel(n)}else for(const r of Object.values(this.records))r.source.cancel(n)}createHeaders(t,n,r){const s=n.injectHeaders?typeof n.headers=="function"?n.headers(t,r,n):n.headers||{}:{},o={"Content-Type":Ss[n.type||"form"],...r.headers,...s};return n.skipWarn&&(o[$e]=t),o}isJsonType(t){return Object.entries(t).some(([n,r])=>n.toLowerCase()==="content-type"&&String(r).includes("application/json"))}toFormData(t,n="data"){if(t instanceof FormData||t instanceof URLSearchParams)return t;const r=n==="data"?new FormData:new URLSearchParams;return Object.entries(t).forEach(([s,o])=>{r.append(s,o)}),r}createSendData(t,n,r,s,o={}){const{type:i,skipWarn:a}=t,{name:u="skipWarn"}=a||{};let{data:c,params:f={},method:d="get"}=n;const m=s?{[u]:!0}:{};return _s.includes(d.toLowerCase())?(c=Object.assign(c||{},m),c=i!=="json"||!this.isJsonType(r)?this.toFormData(c,i):c,f={...o}):i==="form"?f={...c||{},...o,...m}:(c&&(i!=="json"||!this.isJsonType(r))&&(c=this.toFormData(c,i)),f={...o,...m}),{data:c,params:f}}createUrl(t){let{url:n,params:r}=t;if(n){let s=O.isUrl(n)?new URL(n).origin:"";const o=s?n.replace(s,""):n;try{const i=O.pathToRegexpCompile(o,{encode:encodeURIComponent});return s+i(r||{})}catch{console.warn("createUrl","pathToRegexpCompile error",n)}}return n}openLoading(t){const{loading:n,showLoading:r}=t;n&&r&&Object.keys(this.records).length>0&&(this.isLoading=!0,r())}closeLoading(t){const{loading:n,hideLoading:r}=t;if(!n)return;this.isLoading=!1;const s=Object.keys(this.records);r&&s.length===0&&(this.isLoading=!1,r())}_showError(t,n){const{failMessage:r,showError:s}=t;if(r&&s){const o=n?.response?.data,i=o?.message||o?.msg||n?.message||n?.msg||"未知错误";s(i,n)}}validResponse(t,n){const{validSuccess:r,validate:s}=t;return r&&s?!!s(n):!0}isSkipWarnResponse(t){return!!t.promise}send(t={},n=!1){const r=O.merge({},this.settings,t.settings||{}),s=t.query||{},o=O.omit(t,["settings","query"]),i=O.uuid(!1),a=_.CancelToken.source();this.records[i]={settings:r,config:o,source:a};const u=this.createUrl(o),c=this.createHeaders(i,r,o),{data:f,params:d}=this.createSendData(r,o,c,n,s);return this.showLoading(r),new Promise((m,E)=>{this.axios({cancelToken:a.token,...o,url:u,headers:c,data:f,params:d}).then(h=>this.isSkipWarnResponse(h)?m(h.promise):this.validResponse(r,h)?m(r.originResponse?h:h.data?.data):(this.showError(r,h.data),E(h.data))).catch(h=>(this.showError(r,h),E(h))).finally(()=>{delete this.records[i],this.closeLoading(r)})})}useResponse(t,n){const{response:r}=this.axios.interceptors,s=r.use(t,n);return()=>r.eject(s)}useRequest(t,n){const{request:r}=this.axios.interceptors,s=r.use(t,n);return()=>r.eject(s)}setupSkipWarn(t){if(this.stopSkipWarn&&(this.stopSkipWarn(),this.stopSkipWarn=void 0),!t.skipWarn)return;const{code:n,executor:r,callback:s,complete:o}=t.skipWarn;this.stopSkipWarn=this.useResponse(i=>{const u=(i.config.headers||{})[$e],c=this.records[u];if(!c)return i;const{data:f}=i;if(!f||typeof f!="object")return i;if(f?.code===n){s&&s(i);const d=new Promise(r).then(()=>this.send({...c.config,settings:c.settings},!0));d.catch(m=>m).finally(()=>{o&&o()}),i.promise=d}return i})}};function sn(e={}){const t=new rn(e),n=t.send.bind(t),r=t.cancel.bind(t),s=t.setConfig.bind(t),o=t.useRequest.bind(t),i=t.useResponse.bind(t);return Object.assign(n,{...t,instance:t,send:n,cancel:r,setConfig:s,useRequest:o,useResponse:i})}const on=sn({settings:{injectHeaders:!0,loading:!0,originResponse:!0}});function an(e){const t=typeof e=="string"?{url:e}:e;return(n,r)=>on.send(O.merge({},t,r||{},{data:n}))}function As(e){const t={};for(const[n,r]of Object.entries(e))t[n]=an(r);return t}function xs(e,t){const n=Ce(null),r=Ce(),s=Ce(!0);return e.then(o=>{n.value=t?t(o):o}).catch(o=>{r.value=o}).finally(()=>{s.value=!1}),{data:n,error:r,loading:s}}const V=typeof window<"u",Cs=e=>new Promise((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>{t(r.result)},r.onerror=s=>{n(s)}});function Ps(e){const t={};return e?(e.forEach((n,r)=>{t[r]=typeof n=="string"?decodeURIComponent(n):n}),t):{}}function js(e){const t=e.split(","),n=t[0].match(/:(.*?);/)?.[1],r=atob(t[1]);let s=r.length;const o=new Uint8Array(s);for(;s--;)o[s]=r.charCodeAt(s);return new Blob([o],{type:n})}function Ls(e,t){const n=e;return n.lastModified=Date.now(),n.lastModifiedDate=new Date,n.name=t,n}const vs=e=>V?window.requestAnimationFrame(e):setTimeout(e,16),Ns=e=>V?window.cancelAnimationFrame(e):clearTimeout(e);class cn{constructor(t={}){L(this,"options",{type:"cache",expired:0,prefix:"__VTJ_"});L(this,"caches",{});L(this,"types");this.types={local:V?window.localStorage:this.caches,session:V?window.sessionStorage:this.caches,cache:this.caches},this.config(t)}config(t={}){this.options=Object.assign(this.options,t)}save(t,n,r={}){const{type:s,expired:o,prefix:i}={...this.options,...r},a=Date.now(),u=i+t,c=this.types[s]||this.caches,f={value:n,timestamp:a,expired:o};c===this.caches?c[u]=f:c.setItem(u,JSON.stringify(f))}get(t,n={}){const{type:r,prefix:s}={...this.options,...n},o=s+t,i=this.types[r]||this.caches;let a;if(i===this.caches)a=i[o];else{const m=i.getItem(o);m&&(a=JSON.parse(m))}if(!a)return null;const{value:u,timestamp:c,expired:f}=a;return f>0&&c+f<Date.now()?(this.remove(t,n),null):u}remove(t,n={}){const{type:r,prefix:s}={...this.options,...n},o=this.types[r]||this.caches,i=s+t;o===this.caches?delete o[i]:o.removeItem(i)}clear(t={}){const{type:n}={...this.options,...t},r=this.types[n]||this.caches;r===this.caches?this.caches={}:r.clear()}}const Us=new cn;function ln(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Z={exports:{}},Fs=Z.exports,wt;function Ds(){return wt||(wt=1,(function(e,t){(function(n,r){r(t,e)})(Fs,function(n,r){var s={timeout:5e3,jsonpCallback:"callback"};function o(){return"jsonp_"+Date.now()+"_"+Math.ceil(Math.random()*1e5)}function i(c){try{delete window[c]}catch{window[c]=void 0}}function a(c){var f=document.getElementById(c);f&&document.getElementsByTagName("head")[0].removeChild(f)}function u(c){var f=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],d=c,m=f.timeout||s.timeout,E=f.jsonpCallback||s.jsonpCallback,h=void 0;return new Promise(function(g,p){var y=f.jsonpCallbackFunction||o(),S=E+"_"+y;window[y]=function(v){g({ok:!0,json:function(){return Promise.resolve(v)}}),h&&clearTimeout(h),a(S),i(y)},d+=d.indexOf("?")===-1?"?":"&";var b=document.createElement("script");b.setAttribute("src",""+d+E+"="+y),f.charset&&b.setAttribute("charset",f.charset),f.nonce&&b.setAttribute("nonce",f.nonce),f.referrerPolicy&&b.setAttribute("referrerPolicy",f.referrerPolicy),f.crossorigin&&b.setAttribute("crossorigin","true"),b.id=S,document.getElementsByTagName("head")[0].appendChild(b),h=setTimeout(function(){p(new Error("JSONP request to "+c+" timed out")),i(y),a(S),window[y]=function(){i(y)}},m),b.onerror=function(){p(new Error("JSONP request to "+c+" failed")),i(y),a(S),h&&clearTimeout(h)}})}r.exports=u})})(Z,Z.exports)),Z.exports}var Bs=Ds();const Is=ln(Bs);function Ms(e){if(V){const{protocol:t,host:n,pathname:r}=location;return`${t}//${n}${e?r:""}`}else return null}function ks(e=""){const t=e.match(O.rURL);return t?t[0]:""}function un(e){const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push([n,encodeURIComponent(e[n])].join("="));return t.join("&")}function We(e,t,n){const r={};e=(e||location.search).replace(/^[^]*\?/,""),t=t||"&",n=n||"=";let s;const o=new RegExp("(?:^|\\"+t+")([^\\"+n+"\\"+t+"]+)(?:\\"+n+"([^\\"+t+"]*))?","g");for(;(s=o.exec(e))!==null;)s[1]!==e&&(r[decodeURIComponent(s[1])]=decodeURIComponent(s[2]||""));return r}function fn(e,t){t=typeof t=="string"?We(t):t;const n=e.split("?")[0],r=We(e),s=Object.assign({},r,t),o=un(s);return o?[n,o].join("?"):e}const qs=Object.freeze(Object.defineProperty({__proto__:null,append:fn,getCurrentHost:Ms,getHost:ks,parse:We,stringify:un},Symbol.toStringTag,{value:"Module"}));async function Hs(e,t={}){const{query:n={}}=t;e.includes("${")&&(e=O.template(e)(n||{}));const r=fn(e,n);return await(await Is(r,t)).json()}var ve,yt;function Js(){if(yt)return ve;yt=1,ve=function(s,o,i){var a=document.head||document.getElementsByTagName("head")[0],u=document.createElement("script");typeof o=="function"&&(i=o,o={}),o=o||{},i=i||function(){},u.type=o.type||"text/javascript",u.charset=o.charset||"utf8",u.async="async"in o?!!o.async:!0,u.src=s,o.attrs&&e(u,o.attrs),o.text&&(u.text=""+o.text);var c="onload"in u?t:n;c(u,i),u.onload||t(u,i),a.appendChild(u)};function e(r,s){for(var o in s)r.setAttribute(o,s[o])}function t(r,s){r.onload=function(){this.onerror=this.onload=null,s(null,r)},r.onerror=function(){this.onerror=this.onload=null,s(new Error("Failed to load "+this.src),r)}}function n(r,s){r.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,s(null,r))}}return ve}var $s=Js();const Ws=ln($s);function zs(e,t={}){return new Promise((n,r)=>{const{library:s}=t;Ws(e,t,(o,i)=>{o?r(o):n(s?window[s]:void 0)})})}const bt={debug:-1,log:0,info:0,warn:1,error:2},Ks=function(e,t,n,r){return function(...s){if(t&&bt[t]<=bt[e]&&console[e].apply&&(r==="*"||n.startsWith(r)))return console[e].apply(console,Vs(s,n))}};function Vs(e,t){return t!=="*"&&(typeof e[0]=="string"?e[0]=`[${t}] ${e[0]}`:e=["["+t+"]"].concat(e)),e}function Xs(e,t){if(!e)return{targetLevel:t.level,targetBizName:t.bizName};if(~e.indexOf(":")){const n=e.split(":");return{targetLevel:n[0],targetBizName:n[1]}}return{targetLevel:e,targetBizName:"*"}}const Ys={level:"warn",bizName:"*"};class dn{constructor(t){L(this,"config");L(this,"options");this.options={...Ys,...t};const n=typeof location<"u"?location:{},r=(/__(?:logConf|logLevel)__=([^#/&]*)/.exec(n.href)||[])[1];this.config=Xs(r,t)}_log(t){const{targetLevel:n,targetBizName:r}=this.config,{bizName:s}=this.options;return Ks(t,n,s,r)}debug(...t){return this._log("debug")(...t)}log(...t){return this._log("log")(...t)}info(...t){return this._log("info")(...t)}warn(...t){return this._log("warn")(...t)}error(...t){return this._log("error")(...t)}}function hn(e){return new dn(e)}const Gs=hn({level:"log",bizName:"VTJ"});/*! js-cookie v3.0.5 | MIT */function le(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var Qs={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function ze(e,t){function n(s,o,i){if(!(typeof document>"u")){i=le({},t,i),typeof i.expires=="number"&&(i.expires=new Date(Date.now()+i.expires*864e5)),i.expires&&(i.expires=i.expires.toUTCString()),s=encodeURIComponent(s).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var u in i)i[u]&&(a+="; "+u,i[u]!==!0&&(a+="="+i[u].split(";")[0]));return document.cookie=s+"="+e.write(o,s)+a}}function r(s){if(!(typeof document>"u"||arguments.length&&!s)){for(var o=document.cookie?document.cookie.split("; "):[],i={},a=0;a<o.length;a++){var u=o[a].split("="),c=u.slice(1).join("=");try{var f=decodeURIComponent(u[0]);if(i[f]=e.read(c,f),s===f)break}catch{}}return s?i[s]:i}}return Object.create({set:n,get:r,remove:function(s,o){n(s,"",le({},o,{expires:-1}))},withAttributes:function(s){return ze(this.converter,le({},this.attributes,s))},withConverter:function(s){return ze(le({},this.converter,s),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var et=ze(Qs,{path:"/"});function Zs(e,t,n){et.set(e,t,n)}function eo(e){return et.get(e)}function to(e,t){et.remove(e,t)}const no=Object.freeze(Object.defineProperty({__proto__:null,get:eo,remove:to,set:Zs},Symbol.toStringTag,{value:"Module"}));function ro(e,t=""){const n=document.createElement("a");n.download=t,n.href=e,n.target="_blank",n.click()}function tt(e,t="",n){const r=new Blob([e],{type:n}),s=document.createElement("a");s.download=t,s.style.display="none",s.href=URL.createObjectURL(r),s.click(),URL.revokeObjectURL(s.href)}async function so(e,t="",n){return fetch(e,{credentials:"include"}).then(async r=>{const s=await r.blob();return tt(s,t,n),s})}function oo(e,t=""){const n=JSON.stringify(e);tt(n,t,"application/json")}function io(){const e=navigator.userAgent;let t="Unknown",n="Unknown",r="Unknown",s="Unknown",o=!1;if(/Windows NT/i.test(e)){t="Windows";const a={"12.0":"12","11.0":"11","10.0":"10","6.3":"8.1","6.2":"8","6.1":"7","6.0":"Vista","5.2":"XP 64-bit","5.1":"XP"},u=e.match(/Windows NT (\d+\.\d+)/);u&&(n=a[u[1]]||u[1])}else if(/Mac OS X/i.test(e)){t="Mac OS";const a=e.match(/Mac OS X (\d+[._]\d+[._]?\d*)/);a&&(n=a[1].replace(/_/g,"."))}else if(/(iPhone|iPad|iPod)/i.test(e)){t="iOS";const a=e.match(/OS (\d+[_\.]\d+[_\.]?\d*)/);a&&(n=a[1].replace(/_/g,"."))}else if(/Android/i.test(e)){t="Android";const a=e.match(/Android (\d+\.\d+)/);a&&(n=a[1])}else/Linux/i.test(e)&&(t="Linux");const i=e.match(/(Edge|Edg|Edga|EdgA)\/(\d+)/i);if(i)r="Microsoft Edge",s=i[2];else{const a=e.match(/Firefox\/(\d+)/i);if(a)r="Firefox",s=a[1];else{const u=e.match(/(Opera|OPR)\/(\d+)/i);if(u)r="Opera",s=u[2];else{const c=e.match(/Chrome\/(\d+)/i);if(c)r="Chrome",s=c[1];else{const f=e.match(/Version\/(\d+\.\d+)/i);if(f&&/Safari/i.test(e))r="Safari",s=f[1];else{const d=e.match(/(MSIE |Trident.*rv:)(\d+)/i);d&&(r="Internet Explorer",s=d[2])}}}}}return o=/(iPhone|iPod|iPad|Android|Windows Phone|Mobile)/i.test(e)||["iOS","Android"].includes(t),/(iPad|Tablet|Android(?!.*Mobile))/i.test(e)&&(o=!0),{os:t,osVersion:n,browser:r,browserVersion:s,isMobile:o}}exports.LOCAL_REQUEST_ID=$e;exports.Logger=dn;exports.Request=rn;exports.Storage=cn;exports.VTJ_UTILS_VERSION=gn;exports.axios=_;exports.blobToFile=Ls;exports.cAF=Ns;exports.cookie=no;exports.createApi=an;exports.createApis=As;exports.createRequest=sn;exports.dataURLtoBlob=js;exports.downloadBlob=tt;exports.downloadJson=oo;exports.downloadRemoteFile=so;exports.downloadUrl=ro;exports.fileToBase64=Cs;exports.formDataToJson=Ps;exports.getClientInfo=io;exports.getLogger=hn;exports.isClient=V;exports.jsonp=Hs;exports.loadScript=zs;exports.logger=Gs;exports.rAF=vs;exports.request=on;exports.storage=Us;exports.url=qs;exports.useApi=xs;Object.keys(O).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>O[e]})});