@impui/imp 1.0.12 → 1.0.14
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.es.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{urltool as e,date as t,extend as n,getAndWaitCache as r,loadjs as o,getLog as s,type as i,message as a,isBoolean as c,cache as l}from"@impui/com";import*as u from"@impui/com/layer";import{event as d}from"@impui/com/event";import{urltool as f}from"@impui/com/url";import{getLog as h}from"@impui/com/log";import{cache as m}from"@impui/com/cache";import{extend as g}from"@impui/com/core";import{iframeReq as p,get as y}from"@impui/com/req";const w=e.getDomainJson(),b={allsr:"https://impsr.5see.com",debugDomain:"zjyx1.com",isLocalhost:!1,localConfig:null};let _=null;const O={allconfig:"/npm/allconfig.min.js",apiurl:"/npm/apiurl.min.js"},v=t.getTimestamp(),E={config:v,bubble:v,dress:v,gift:v,template:v},S=()=>{if(_)return _;_=b,"undefined"!=typeof __impconfig__&&(_=n(!0,{},b,__impconfig__));for(const e in O)_[e]=_.allsr+O[e];return _};"localhost"===w.main&&(w.main=S().debugDomain,w.mainhost=S().debugDomain,w.port="",w.name=w.mainhost.split(".")[0],w.protocol="https:");const R=()=>n(!0,{},E,window.codever),L=async()=>{if(window.allconfig)return window.allconfig.domainsitetype;return(await r("config_allconfig",async()=>(await o(S().allconfig),window.allconfig))).domainsitetype},x=async()=>{const e=(await L())["localhost"===w.main?S().debugDomain:w.main];return e||{}},P=async()=>await r("config_simplify",async()=>{const e=await k("config_simplify");await o(e);const t=window.sconfig;return delete window.sconfig,t}),T=async()=>await r("config_full",async()=>{console.log("getConfig");const e=await k("config");await o(e);const t=S();let r=window.config;return delete window.config,r.npm=r.allsr+"/npm/",t.isLocalhost&&t.localConfig&&(r=n(!0,{},r,t.localConfig)),r}),k=async e=>{const t=await x();var n=t.res||"sr",r=t.resHost||w.mainhost;return`${w.protocol+"//"+n+"."+r}/live/webSkins_site/${t.sitetype}/config/${e}.js`},U=async()=>await r("config_apiurl",async()=>await o(S().apiurl,{extend:n,config:await T()}));(()=>{const e=globalThis,t=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!e.fs){let n="";e.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,t){n+=r.decode(t);const o=n.lastIndexOf("\n");return-1!=o&&(console.log(n.substr(0,o)),n=n.substr(o+1)),t.length},write(e,n,r,o,s,i){if(0!==r||o!==n.length||null!==s)return void i(t());i(null,this.writeSync(e,n))},chmod(e,n,r){r(t())},chown(e,n,r,o){o(t())},close(e,n){n(t())},fchmod(e,n,r){r(t())},fchown(e,n,r,o){o(t())},fstat(e,n){n(t())},fsync(e,t){t(null)},ftruncate(e,n,r){r(t())},lchown(e,n,r,o){o(t())},link(e,n,r){r(t())},lstat(e,n){n(t())},mkdir(e,n,r){r(t())},open(e,n,r,o){o(t())},read(e,n,r,o,s,i){i(t())},readdir(e,n){n(t())},readlink(e,n){n(t())},rename(e,n,r){r(t())},rmdir(e,n){n(t())},stat(e,n){n(t())},symlink(e,n,r){r(t())},truncate(e,n,r){r(t())},unlink(e,n){n(t())},utimes(e,n,r,o){o(t())}}}if(e.process||(e.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw t()},pid:-1,ppid:-1,umask(){throw t()},cwd(){throw t()},chdir(){throw t()}}),!e.crypto){const t=require("node:crypto");e.crypto={getRandomValues(e){t.randomFillSync(e)}}}e.performance||(e.performance={now(){const[e,t]=process.hrtime();return 1e3*e+t/1e6}}),e.TextEncoder||(e.TextEncoder=require("node:util").TextEncoder),e.TextDecoder||(e.TextDecoder=require("node:util").TextDecoder);const n=new TextEncoder("utf-8"),r=new TextDecoder("utf-8");let o=new DataView(new ArrayBuffer(8));var s=[];const i={};e.Go=class{constructor(){this._callbackTimeouts=/* @__PURE__ */new Map,this._nextCallbackTimeoutID=1;const e=()=>new DataView(this._inst.exports.memory.buffer),t=e=>{o.setBigInt64(0,e,!0);const t=o.getFloat64(0,!0);if(0===t)return;if(!isNaN(t))return t;const n=0xffffffffn&e;return this._values[n]},a=n=>{let r=e().getBigUint64(n,!0);return t(r)},c=e=>{const t=0x7FF80000n;if("number"==typeof e)return isNaN(e)?t<<32n:0===e?t<<32n|1n:(o.setFloat64(0,e,!0),o.getBigInt64(0,!0));switch(e){case void 0:return 0n;case null:return t<<32n|2n;case!0:return t<<32n|3n;case!1:return t<<32n|4n}let n=this._ids.get(e);void 0===n&&(n=this._idPool.pop(),void 0===n&&(n=BigInt(this._values.length)),this._values[n]=e,this._goRefCounts[n]=0,this._ids.set(e,n)),this._goRefCounts[n]++;let r=1n;switch(typeof e){case"string":r=2n;break;case"symbol":r=3n;break;case"function":r=4n}return n|(t|r)<<32n},l=(t,n)=>{let r=c(n);e().setBigUint64(t,r,!0)},u=(e,t,n)=>new Uint8Array(this._inst.exports.memory.buffer,e,t),d=(e,t,n)=>{const r=new Array(t);for(let o=0;o<t;o++)r[o]=a(e+8*o);return r},f=(e,t)=>r.decode(new DataView(this._inst.exports.memory.buffer,e,t)),h=Date.now()-performance.now();this.importObject={wasi_snapshot_preview1:{fd_write:function(t,n,o,i){let a=0;if(1==t)for(let c=0;c<o;c++){let t=n+8*c,o=e().getUint32(t+0,!0),i=e().getUint32(t+4,!0);a+=i;for(let n=0;n<i;n++){let t=e().getUint8(o+n);if(13==t);else if(10==t){let e=r.decode(new Uint8Array(s));s=[],console.log(e)}else s.push(t)}}else console.error("invalid file descriptor:",t);return e().setUint32(i,a,!0),0},fd_close:()=>0,fd_fdstat_get:()=>0,fd_seek:()=>0,proc_exit:e=>{throw this.exited=!0,this.exitCode=e,this._resolveExitPromise(),i},random_get:(e,t)=>(crypto.getRandomValues(u(e,t)),0)},gojs:{"runtime.ticks":()=>BigInt(1e6*(h+performance.now())),"runtime.sleepTicks":e=>{setTimeout(()=>{if(!this.exited)try{this._inst.exports.go_scheduler()}catch(e){if(e!==i)throw e}},Number(e)/1e6)},"syscall/js.finalizeRef":e=>{const t=0xffffffffn&e;if(void 0!==this._goRefCounts?.[t]){if(this._goRefCounts[t]--,0===this._goRefCounts[t]){const e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}}else console.error("syscall/js.finalizeRef: unknown id",t)},"syscall/js.stringVal":(e,t)=>{const n=f(e>>>=0,t);return c(n)},"syscall/js.valueGet":(e,n,r)=>{let o=f(n,r),s=t(e),i=Reflect.get(s,o);return c(i)},"syscall/js.valueSet":(e,n,r,o)=>{const s=t(e),i=f(n,r),a=t(o);Reflect.set(s,i,a)},"syscall/js.valueDelete":(e,n,r)=>{const o=t(e),s=f(n,r);Reflect.deleteProperty(o,s)},"syscall/js.valueIndex":(e,n)=>c(Reflect.get(t(e),n)),"syscall/js.valueSetIndex":(e,n,r)=>{Reflect.set(t(e),n,t(r))},"syscall/js.valueCall":(n,r,o,s,i,a,c)=>{const u=t(r),h=f(o,s),m=d(i,a);try{const t=Reflect.get(u,h);l(n,Reflect.apply(t,u,m)),e().setUint8(n+8,1)}catch(g){l(n,g),e().setUint8(n+8,0)}},"syscall/js.valueInvoke":(n,r,o,s,i)=>{try{const i=t(r),a=d(o,s);l(n,Reflect.apply(i,void 0,a)),e().setUint8(n+8,1)}catch(a){l(n,a),e().setUint8(n+8,0)}},"syscall/js.valueNew":(n,r,o,s,i)=>{const a=t(r),c=d(o,s);try{l(n,Reflect.construct(a,c)),e().setUint8(n+8,1)}catch(u){l(n,u),e().setUint8(n+8,0)}},"syscall/js.valueLength":e=>t(e).length,"syscall/js.valuePrepareString":(r,o)=>{const s=String(t(o)),i=n.encode(s);l(r,i),e().setInt32(r+8,i.length,!0)},"syscall/js.valueLoadString":(e,n,r,o)=>{const s=t(e);u(n,r).set(s)},"syscall/js.valueInstanceOf":(e,n)=>t(e)instanceof t(n),"syscall/js.copyBytesToGo":(n,r,o,s,i)=>{let a=n,c=n+4;const l=u(r,o),d=t(i);if(!(d instanceof Uint8Array||d instanceof Uint8ClampedArray))return void e().setUint8(c,0);const f=d.subarray(0,l.length);l.set(f),e().setUint32(a,f.length,!0),e().setUint8(c,1)},"syscall/js.copyBytesToJS":(n,r,o,s,i)=>{let a=n,c=n+4;const l=t(r),d=u(o,s);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray))return void e().setUint8(c,0);const f=d.subarray(0,l.length);l.set(f),e().setUint32(a,f.length,!0),e().setUint8(c,1)}}},this.importObject.env=this.importObject.gojs}async run(t){if(this._inst=t,this._values=[NaN,0,null,!0,!1,e,this],this._goRefCounts=[],this._ids=/* @__PURE__ */new Map,this._idPool=[],this.exited=!1,this.exitCode=0,this._inst.exports._start){let e=new Promise((e,t)=>{this._resolveExitPromise=e});try{this._inst.exports._start()}catch(n){if(n!==i)throw n}return await e,this.exitCode}this._inst.exports._initialize()}_resume(){if(this.exited)throw new Error("Go program has already exited");try{this._inst.exports.resume()}catch(e){if(e!==i)throw e}this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const t=this;return function(){const n={id:e,this:this,args:arguments};return t._pendingEvent=n,t._resume(),n.result}}}})();const C=Go,A={},j=(await T()).allsr+"/plug/gotool/lib/imptool.wasm",N=await s(),B=async function(){return console.warn("⚠️ 降级方案已启用"),{encrypt:function(){throw new Error("❌ 降级方案未实现:encrypt方法")},parseRes:async function(e,t){try{if("true"!==e.headers["res-encrypt"])return e;const t={data:e.data},n=await U(),r=await axios.post(n.parseRes,{res:encodeURIComponent(JSON.stringify(t)),config:null});return e.data=JSON.parse(r.data),e}catch(n){console.error("❌ 降级方案请求接口失败:",n)}},parseServer:function(){throw new Error("❌ 降级方案未实现:parseServer方法")}}};const I=new class{constructor(e){this.isbase=e===j,this.url=e}async#e(){if(!this.url){const e=await T();this.url=e.allsr+"plug/gotool/lib/imptool.wasm"}return this.url}async#t(e,t){return async function(e,t,n=!1){try{const r=new C;N("=== WASM加载调试开始 ==="),N("URL:",e),N("UserAgent:",navigator.userAgent);const o=await fetch(e+t);N("✅ 响应状态:",o.status);const s=await o.arrayBuffer();N("✅ ArrayBuffer大小:",s.byteLength,"bytes");const i=new Uint8Array(s.slice(0,4));N("🔍 WASM文件头:",Array.from(i)),N("🔍 Go importObject结构:",Object.keys(r.importObject)),r.importObject.go&&N("🔍 GoJS导入键:",Object.keys(r.importObject.go)),N("🚀 开始WebAssembly.instantiate...");const a=await WebAssembly.instantiate(s,r.importObject);if(N("✅ WebAssembly实例化成功"),N("🚀 开始go.run..."),r.run(a.instance),N("✅ go.run执行完成"),window.goCrypto){const e=window.goCrypto;return delete window.goCrypto,N("✅ goCrypto加载成功"),e}if(n)return await B();throw console.warn("❌ window.goCrypto未定义,进入诊断模式"),await loadGoWasmWithDiagnosis(e),new Error("❌ window.goCrypto未定义")}catch(r){throw console.error("💥 完整错误堆栈:",r),console.error("错误名称:",r.name),console.error("错误信息:",r.message),r}}(e=e||await this.#e(),t,this.isbase)}async getRunTimes(e=!1){const t=await this.#e();if(!e&&A[t])return A[t];const n=R(),r=n.config?"?d="+n.config:"",o=await this.#t(t,r),s={};if(o)for(let i in o)s[i]=o[i];return A[t]=s,s}async init(){return this.getRunTimes()}async run(e,t){const n=await this.getRunTimes();return n[e]||console.error(`[${e}] 方法不在默认wasm中!`),n[e].apply(null,t)}}(j);function D(e,t){return function(){return e.apply(t,arguments)}}const{toString:F}=Object.prototype,{getPrototypeOf:M}=Object,{iterator:q,toStringTag:W}=Symbol,z=/* @__PURE__ */(e=>t=>{const n=F.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(/* @__PURE__ */Object.create(null)),G=e=>(e=e.toLowerCase(),t=>z(t)===e),K=e=>t=>typeof t===e,{isArray:H}=Array,J=K("undefined");function $(e){return null!==e&&!J(e)&&null!==e.constructor&&!J(e.constructor)&&Z(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const V=G("ArrayBuffer");const X=K("string"),Z=K("function"),Q=K("number"),Y=e=>null!==e&&"object"==typeof e,ee=e=>{if("object"!==z(e))return!1;const t=M(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||W in e||q in e)},te=G("Date"),ne=G("File"),re=G("Blob"),oe=G("FileList"),se=G("URLSearchParams"),[ie,ae,ce,le]=["ReadableStream","Request","Response","Headers"].map(G);function ue(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),H(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if($(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function de(e,t){if($(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const fe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,he=e=>!J(e)&&e!==fe;const me=/* @__PURE__ */(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&M(Uint8Array)),ge=G("HTMLFormElement"),pe=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ye=G("RegExp"),we=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ue(n,(n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)}),Object.defineProperties(e,r)};const be=G("AsyncFunction"),_e=(Oe="function"==typeof setImmediate,ve=Z(fe.postMessage),Oe?setImmediate:ve?(Ee=`axios@${Math.random()}`,Se=[],fe.addEventListener("message",({source:e,data:t})=>{e===fe&&t===Ee&&Se.length&&Se.shift()()},!1),e=>{Se.push(e),fe.postMessage(Ee,"*")}):e=>setTimeout(e));var Oe,ve,Ee,Se;const Re="undefined"!=typeof queueMicrotask?queueMicrotask.bind(fe):"undefined"!=typeof process&&process.nextTick||_e,Le={isArray:H,isArrayBuffer:V,isBuffer:$,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Z(e.append)&&("formdata"===(t=z(e))||"object"===t&&Z(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&V(e.buffer),t},isString:X,isNumber:Q,isBoolean:e=>!0===e||!1===e,isObject:Y,isPlainObject:ee,isEmptyObject:e=>{if(!Y(e)||$(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(t){return!1}},isReadableStream:ie,isRequest:ae,isResponse:ce,isHeaders:le,isUndefined:J,isDate:te,isFile:ne,isBlob:re,isRegExp:ye,isFunction:Z,isStream:e=>Y(e)&&Z(e.pipe),isURLSearchParams:se,isTypedArray:me,isFileList:oe,forEach:ue,merge:function e(){const{caseless:t,skipUndefined:n}=he(this)&&this||{},r={},o=(o,s)=>{const i=t&&de(r,s)||s;ee(r[i])&&ee(o)?r[i]=e(r[i],o):ee(o)?r[i]=e({},o):H(o)?r[i]=o.slice():n&&J(o)||(r[i]=o)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&ue(arguments[s],o);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(ue(t,(t,r)=>{n&&Z(t)?e[r]=D(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,i;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],r&&!r(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==n&&M(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:z,kindOfTest:G,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(H(e))return e;let t=e.length;if(!Q(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[q]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:ge,hasOwnProperty:pe,hasOwnProp:pe,reduceDescriptors:we,freezeMethods:e=>{we(e,(t,n)=>{if(Z(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];Z(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return H(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:de,global:fe,isContextDefined:he,isSpecCompliantForm:function(e){return!!(e&&Z(e.append)&&"FormData"===e[W]&&e[q])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Y(e)){if(t.indexOf(e)>=0)return;if($(e))return e;if(!("toJSON"in e)){t[r]=e;const o=H(e)?[]:{};return ue(e,(e,t)=>{const s=n(e,r+1);!J(s)&&(o[t]=s)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:be,isThenable:e=>e&&(Y(e)||Z(e))&&Z(e.then)&&Z(e.catch),setImmediate:_e,asap:Re,isIterable:e=>null!=e&&Z(e[q])};function xe(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}Le.inherits(xe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Le.toJSONObject(this.config),code:this.code,status:this.status}}});const Pe=xe.prototype,Te={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Te[e]={value:e}}),Object.defineProperties(xe,Te),Object.defineProperty(Pe,"isAxiosError",{value:!0}),xe.from=(e,t,n,r,o,s)=>{const i=Object.create(Pe);Le.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return xe.call(i,a,c,n,r,o),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",s&&Object.assign(i,s),i};function ke(e){return Le.isPlainObject(e)||Le.isArray(e)}function Ue(e){return Le.endsWith(e,"[]")?e.slice(0,-2):e}function Ce(e,t,n){return e?e.concat(t).map(function(e,t){return e=Ue(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Ae=Le.toFlatObject(Le,{},null,function(e){return/^is[A-Z]/.test(e)});function je(e,t,n){if(!Le.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Le.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Le.isUndefined(t[e])})).metaTokens,o=n.visitor||l,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Le.isSpecCompliantForm(t);if(!Le.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Le.isDate(e))return e.toISOString();if(Le.isBoolean(e))return e.toString();if(!a&&Le.isBlob(e))throw new xe("Blob is not supported. Use a Buffer instead.");return Le.isArrayBuffer(e)||Le.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(Le.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Le.isArray(e)&&function(e){return Le.isArray(e)&&!e.some(ke)}(e)||(Le.isFileList(e)||Le.endsWith(n,"[]"))&&(a=Le.toArray(e)))return n=Ue(n),a.forEach(function(e,r){!Le.isUndefined(e)&&null!==e&&t.append(!0===i?Ce([n],r,s):null===i?n:n+"[]",c(e))}),!1;return!!ke(e)||(t.append(Ce(o,n,s),c(e)),!1)}const u=[],d=Object.assign(Ae,{defaultVisitor:l,convertValue:c,isVisitable:ke});if(!Le.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Le.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),Le.forEach(n,function(n,s){!0===(!(Le.isUndefined(n)||null===n)&&o.call(t,n,Le.isString(s)?s.trim():s,r,d))&&e(n,r?r.concat(s):[s])}),u.pop()}}(e),t}function Ne(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Be(e,t){this._pairs=[],e&&je(e,this,t)}const Ie=Be.prototype;function De(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Fe(e,t,n){if(!t)return e;const r=n&&n.encode||De;Le.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(s=o?o(t,n):Le.isURLSearchParams(t)?t.toString():new Be(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}Ie.append=function(e,t){this._pairs.push([e,t])},Ie.toString=function(e){const t=e?function(t){return e.call(this,t,Ne)}:Ne;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class Me{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Le.forEach(this.handlers,function(t){null!==t&&e(t)})}}const qe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},We={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Be,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ze="undefined"!=typeof window&&"undefined"!=typeof document,Ge="object"==typeof navigator&&navigator||void 0,Ke=ze&&(!Ge||["ReactNative","NativeScript","NS"].indexOf(Ge.product)<0),He="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Je=ze&&window.location.href||"http://localhost",$e={.../* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,hasBrowserEnv:ze,hasStandardBrowserEnv:Ke,hasStandardBrowserWebWorkerEnv:He,navigator:Ge,origin:Je},Symbol.toStringTag,{value:"Module"})),...We};function Ve(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&Le.isArray(r)?r.length:s,a)return Le.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&Le.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&Le.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i}if(Le.isFormData(e)&&Le.isFunction(e.entries)){const n={};return Le.forEachEntry(e,(e,r)=>{t(function(e){return Le.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const Xe={transitional:qe,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Le.isObject(e);o&&Le.isHTMLForm(e)&&(e=new FormData(e));if(Le.isFormData(e))return r?JSON.stringify(Ve(e)):e;if(Le.isArrayBuffer(e)||Le.isBuffer(e)||Le.isStream(e)||Le.isFile(e)||Le.isBlob(e)||Le.isReadableStream(e))return e;if(Le.isArrayBufferView(e))return e.buffer;if(Le.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return je(e,new $e.classes.URLSearchParams,{visitor:function(e,t,n,r){return $e.isNode&&Le.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=Le.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return je(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(Le.isString(e))try{return(t||JSON.parse)(e),Le.trim(e)}catch(r){if("SyntaxError"!==r.name)throw r}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Xe.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Le.isResponse(e)||Le.isReadableStream(e))return e;if(e&&Le.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(o){if(n){if("SyntaxError"===o.name)throw xe.from(o,xe.ERR_BAD_RESPONSE,this,null,this.response);throw o}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:$e.classes.FormData,Blob:$e.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Le.forEach(["delete","get","head","post","put","patch"],e=>{Xe.headers[e]={}});const Ze=Le.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Qe=Symbol("internals");function Ye(e){return e&&String(e).trim().toLowerCase()}function et(e){return!1===e||null==e?e:Le.isArray(e)?e.map(et):String(e)}function tt(e,t,n,r,o){return Le.isFunction(r)?r.call(this,t,n):(o&&(t=n),Le.isString(t)?Le.isString(r)?-1!==t.indexOf(r):Le.isRegExp(r)?r.test(t):void 0:void 0)}let nt=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Ye(t);if(!o)throw new Error("header name must be a non-empty string");const s=Le.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=et(e))}const s=(e,t)=>Le.forEach(e,(e,n)=>o(e,n,t));if(Le.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(Le.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Ze[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(Le.isObject(e)&&Le.isIterable(e)){let n,r,o={};for(const t of e){if(!Le.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?Le.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}s(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=Ye(e)){const n=Le.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=/* @__PURE__ */Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Le.isFunction(t))return t.call(this,e,n);if(Le.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ye(e)){const n=Le.findKey(this,e);return!(!n||void 0===this[n]||t&&!tt(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Ye(e)){const o=Le.findKey(n,e);!o||t&&!tt(0,n[o],o,t)||(delete n[o],r=!0)}}return Le.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!tt(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Le.forEach(this,(r,o)=>{const s=Le.findKey(n,o);if(s)return t[s]=et(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();i!==o&&delete t[o],t[i]=et(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=/* @__PURE__ */Object.create(null);return Le.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Le.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Qe]=this[Qe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Ye(e);t[r]||(!function(e,t){const n=Le.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return Le.isArray(e)?e.forEach(r):r(e),this}};function rt(e,t){const n=this||Xe,r=t||n,o=nt.from(r.headers);let s=r.data;return Le.forEach(e,function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function ot(e){return!(!e||!e.__CANCEL__)}function st(e,t,n){xe.call(this,null==e?"canceled":e,xe.ERR_CANCELED,t,n),this.name="CanceledError"}function it(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new xe("Request failed with status code "+n.status,[xe.ERR_BAD_REQUEST,xe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}nt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Le.reduceDescriptors(nt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Le.freezeMethods(nt),Le.inherits(st,xe,{__CANCEL__:!0});const at=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];o||(o=c),n[s]=a,r[s]=c;let u=i,d=0;for(;u!==s;)d+=n[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const f=l&&c-l;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(e,t){let n,r,o=0,s=1e3/t;const i=(t,s=Date.now())=>{o=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},s-a)))},()=>n&&i(n)]}(n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=s-r,c=o(a);r=s;e({loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},ct=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},lt=e=>(...t)=>Le.asap(()=>e(...t)),ut=$e.hasStandardBrowserEnv?/* @__PURE__ */((e,t)=>n=>(n=new URL(n,$e.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL($e.origin),$e.navigator&&/(msie|trident)/i.test($e.navigator.userAgent)):()=>!0,dt=$e.hasStandardBrowserEnv?{write(e,t,n,r,o,s,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];Le.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Le.isString(r)&&a.push(`path=${r}`),Le.isString(o)&&a.push(`domain=${o}`),!0===s&&a.push("secure"),Le.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function ft(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const ht=e=>e instanceof nt?{...e}:e;function mt(e,t){t=t||{};const n={};function r(e,t,n,r){return Le.isPlainObject(e)&&Le.isPlainObject(t)?Le.merge.call({caseless:r},e,t):Le.isPlainObject(t)?Le.merge({},t):Le.isArray(t)?t.slice():t}function o(e,t,n,o){return Le.isUndefined(t)?Le.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!Le.isUndefined(t))return r(void 0,t)}function i(e,t){return Le.isUndefined(t)?Le.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,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:(e,t,n)=>o(ht(e),ht(t),0,!0)};return Le.forEach(Object.keys({...e,...t}),function(r){const s=c[r]||o,i=s(e[r],t[r],r);Le.isUndefined(i)&&s!==a||(n[r]=i)}),n}const gt=e=>{const t=mt({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;if(t.headers=i=nt.from(i),t.url=Fe(ft(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Le.isFormData(n))if($e.hasStandardBrowserEnv||$e.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(Le.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&i.set(e,n)})}if($e.hasStandardBrowserEnv&&(r&&Le.isFunction(r)&&(r=r(t)),r||!1!==r&&ut(t.url))){const e=o&&s&&dt.read(s);e&&i.set(o,e)}return t},pt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=gt(e);let o=r.data;const s=nt.from(r.headers).normalize();let i,a,c,l,u,{responseType:d,onUploadProgress:f,onDownloadProgress:h}=r;function m(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let g=new XMLHttpRequest;function p(){if(!g)return;const r=nt.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());it(function(e){t(e),m()},function(e){n(e),m()},{data:d&&"text"!==d&&"json"!==d?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=p:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(p)},g.onabort=function(){g&&(n(new xe("Request aborted",xe.ECONNABORTED,e,g)),g=null)},g.onerror=function(t){const r=new xe(t&&t.message?t.message:"Network Error",xe.ERR_NETWORK,e,g);r.event=t||null,n(r),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||qe;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new xe(t,o.clarifyTimeoutError?xe.ETIMEDOUT:xe.ECONNABORTED,e,g)),g=null},void 0===o&&s.setContentType(null),"setRequestHeader"in g&&Le.forEach(s.toJSON(),function(e,t){g.setRequestHeader(t,e)}),Le.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),d&&"json"!==d&&(g.responseType=r.responseType),h&&([c,u]=at(h,!0),g.addEventListener("progress",c)),f&&g.upload&&([a,l]=at(f),g.upload.addEventListener("progress",a),g.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{g&&(n(!t||t.type?new st(null,e,g):t),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===$e.protocols.indexOf(y)?n(new xe("Unsupported protocol "+y+":",xe.ERR_BAD_REQUEST,e)):g.send(o||null)})},yt=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof xe?t:new st(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,o(new xe(`timeout ${t} of ms exceeded`,xe.ETIMEDOUT))},t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>Le.asap(i),a}},wt=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},bt=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},_t=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of bt(e))yield*wt(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(t){throw a(t),t}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:Ot}=Le,vt=(({Request:e,Response:t})=>({Request:e,Response:t}))(Le.global),{ReadableStream:Et,TextEncoder:St}=Le.global,Rt=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},Lt=e=>{e=Le.merge.call({skipUndefined:!0},vt,e);const{fetch:t,Request:n,Response:r}=e,o=t?Ot(t):"function"==typeof fetch,s=Ot(n),i=Ot(r);if(!o)return!1;const a=o&&Ot(Et),c=o&&("function"==typeof St?/* @__PURE__ */(e=>t=>e.encode(t))(new St):async e=>new Uint8Array(await new n(e).arrayBuffer())),l=s&&a&&Rt(()=>{let e=!1;const t=new n($e.origin,{body:new Et,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),u=i&&a&&Rt(()=>Le.isReadableStream(new r("").body)),d={stream:u&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new xe(`Response type '${e}' is not supported`,xe.ERR_NOT_SUPPORT,n)})});const f=async(e,t)=>{const r=Le.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(Le.isBlob(e))return e.size;if(Le.isSpecCompliantForm(e)){const t=new n($e.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Le.isArrayBufferView(e)||Le.isArrayBuffer(e)?e.byteLength:(Le.isURLSearchParams(e)&&(e+=""),Le.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:i,data:a,signal:c,cancelToken:h,timeout:m,onDownloadProgress:g,onUploadProgress:p,responseType:y,headers:w,withCredentials:b="same-origin",fetchOptions:_}=gt(e),O=t||fetch;y=y?(y+"").toLowerCase():"text";let v=yt([c,h&&h.toAbortSignal()],m),E=null;const S=v&&v.unsubscribe&&(()=>{v.unsubscribe()});let R;try{if(p&&l&&"get"!==i&&"head"!==i&&0!==(R=await f(w,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if(Le.isFormData(a)&&(e=t.headers.get("content-type"))&&w.setContentType(e),t.body){const[e,n]=ct(R,at(lt(p)));a=_t(t.body,65536,e,n)}}Le.isString(b)||(b=b?"include":"omit");const t=s&&"credentials"in n.prototype,c={..._,signal:v,method:i.toUpperCase(),headers:w.normalize().toJSON(),body:a,duplex:"half",credentials:t?b:void 0};E=s&&new n(o,c);let h=await(s?O(E,_):O(o,c));const m=u&&("stream"===y||"response"===y);if(u&&(g||m&&S)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=h[t]});const t=Le.toFiniteNumber(h.headers.get("content-length")),[n,o]=g&&ct(t,at(lt(g),!0))||[];h=new r(_t(h.body,65536,n,()=>{o&&o(),S&&S()}),e)}y=y||"text";let L=await d[Le.findKey(d,y)||"text"](h,e);return!m&&S&&S(),await new Promise((t,n)=>{it(t,n,{data:L,headers:nt.from(h.headers),status:h.status,statusText:h.statusText,config:e,request:E})})}catch(L){if(S&&S(),L&&"TypeError"===L.name&&/Load failed|fetch/i.test(L.message))throw Object.assign(new xe("Network Error",xe.ERR_NETWORK,e,E),{cause:L.cause||L});throw xe.from(L,L&&L.code,e,E)}}},xt=/* @__PURE__ */new Map,Pt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let i,a,c=s.length,l=xt;for(;c--;)i=s[c],a=l.get(i),void 0===a&&l.set(i,a=c?/* @__PURE__ */new Map:Lt(t)),l=a;return a};Pt();const Tt={http:null,xhr:pt,fetch:{get:Pt}};Le.forEach(Tt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}});const kt=e=>`- ${e}`,Ut=e=>Le.isFunction(e)||null===e||!1===e;const Ct={getAdapter:function(e,t){e=Le.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let i=0;i<n;i++){let n;if(r=e[i],o=r,!Ut(r)&&(o=Tt[(n=String(r)).toLowerCase()],void 0===o))throw new xe(`Unknown adapter '${n}'`);if(o&&(Le.isFunction(o)||(o=o.get(t))))break;s[n||"#"+i]=o}if(!o){const e=Object.entries(s).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new xe("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(kt).join("\n"):" "+kt(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o},adapters:Tt};function At(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new st(null,e)}function jt(e){At(e),e.headers=nt.from(e.headers),e.data=rt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Ct.getAdapter(e.adapter||Xe.adapter,e)(e).then(function(t){return At(e),t.data=rt.call(e,e.transformResponse,t),t.headers=nt.from(t.headers),t},function(t){return ot(t)||(At(e),t&&t.response&&(t.response.data=rt.call(e,e.transformResponse,t.response),t.response.headers=nt.from(t.response.headers))),Promise.reject(t)})}const Nt="1.13.2",Bt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Bt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const It={};Bt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Nt+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new xe(r(o," has been removed"+(t?" in "+t:"")),xe.ERR_DEPRECATED);return t&&!It[o]&&(It[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}},Bt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Dt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new xe("options must be an object",xe.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new xe("option "+s+" must be "+n,xe.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new xe("Unknown option "+s,xe.ERR_BAD_OPTION)}},validators:Bt},Ft=Dt.validators;let Mt=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Me,response:new Me}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";try{n.stack?t&&!String(n.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+t):n.stack=t}catch(r){}}throw n}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=mt(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Dt.assertOptions(n,{silentJSONParsing:Ft.transitional(Ft.boolean),forcedJSONParsing:Ft.transitional(Ft.boolean),clarifyTimeoutError:Ft.transitional(Ft.boolean)},!1),null!=r&&(Le.isFunction(r)?t.paramsSerializer={serialize:r}:Dt.assertOptions(r,{encode:Ft.function,serialize:Ft.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Dt.assertOptions(t,{baseUrl:Ft.spelling("baseURL"),withXsrfToken:Ft.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&Le.merge(o.common,o[t.method]);o&&Le.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=nt.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,d=0;if(!a){const e=[jt.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=i.length;let f=t;for(;d<u;){const e=i[d++],t=i[d++];try{f=e(f)}catch(h){t.call(this,h);break}}try{l=jt.call(this,f)}catch(h){return Promise.reject(h)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return Fe(ft((e=mt(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};Le.forEach(["delete","get","head","options"],function(e){Mt.prototype[e]=function(t,n){return this.request(mt(n||{},{method:e,url:t,data:(n||{}).data}))}}),Le.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(mt(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Mt.prototype[e]=t(),Mt.prototype[e+"Form"]=t(!0)});const qt={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(qt).forEach(([e,t])=>{qt[t]=e});const Wt=function e(t){const n=new Mt(t),r=D(Mt.prototype.request,n);return Le.extend(r,Mt.prototype,n,{allOwnKeys:!0}),Le.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(mt(t,n))},r}(Xe);Wt.Axios=Mt,Wt.CanceledError=st,Wt.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new st(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},Wt.isCancel=ot,Wt.VERSION=Nt,Wt.toFormData=je,Wt.AxiosError=xe,Wt.Cancel=Wt.CanceledError,Wt.all=function(e){return Promise.all(e)},Wt.spread=function(e){return function(t){return e.apply(null,t)}},Wt.isAxiosError=function(e){return Le.isObject(e)&&!0===e.isAxiosError},Wt.mergeConfig=mt,Wt.AxiosHeaders=nt,Wt.formToJSON=e=>Ve(Le.isHTMLForm(e)?new FormData(e):e),Wt.getAdapter=Ct.getAdapter,Wt.HttpStatusCode=qt,Wt.default=Wt;const{Axios:zt,AxiosError:Gt,CanceledError:Kt,isCancel:Ht,CancelToken:Jt,VERSION:$t,all:Vt,Cancel:Xt,isAxiosError:Zt,spread:Qt,toFormData:Yt,AxiosHeaders:en,HttpStatusCode:tn,formToJSON:nn,getAdapter:rn,mergeConfig:on}=Wt,sn=f.getPar,an=function(e,t){var n,r={v:"1.0.1",Device:0,SourceDevice:parseInt(sn("Device")||-1)};t&&(r._tui_source=((n=sn("_tui_source")||sn("from")||sn("source"))||(n=m.get("_tui_source")),n));var o=window.pdata||window.axiosData||window.reqData||{};return e=g(!0,r,o,e)},cn=function(e,t,n){return n=an(n,t),e=f.addPars(n,e)},ln=await h(),un="imp_sign",dn="imp_useridx";f.getPar("useridx");var fn={error:0,success:1,ServerSignError:2,jumpTo:100,window:101,alert:150,msg:160,noMoney:170,noRealName:234,nologin:666};Wt.codeEnum=fn,Wt.defaults.baseURL="",Wt.defaults.withCredentials=!0,Wt.defaults.crossDomain=!0,Wt.defaults.dataType="json",Wt.saveLogin=function(e,t){ln.debug("写入sign:",t),m.set(un,t),e&&m.set(dn,e)},Wt.interceptors.request.use(async function(e){ln.debug("请求拦截",e),function(e,t,n){var r;"post"===e.method?(e.data=e.data||{},r=e.data):(e.params=e.params||{},r=e.params),n&&(r[t]=n)}(e,"_tui_source",f.getPar("_tui_source")||f.getPar("from")||f.getPar("source")),cn(e.url),"post"===e.method&&(e.data=f.jsonto(e.data).substring(1));const t=await d.runM("login","getLogin",[null,!0]);return t&&(e.headers[un]=t.sign,e.headers[dn]=m.get(dn)),e},function(e){return Promise.reject(e)}),Wt.interceptors.response.use(async function(e){if(e.data&&"true"==e.headers["res-encrypt"]){const t=await Promise.all([I.init(),T()]),n=t[0],r=await n.parseRes(e,t[1]);null==r&&window.debug&&console.warn("响应数据解析异常",r),e=r||e}if(i.isString(e.data)){const t=new Error("接口:"+e.config.url+"返回了纯字符串数据:"+e.data);return Promise.reject(t)}switch(ln.debug("响应拦截 -> "+e.config.url+"\n",e),e.data.__source=e,(e=e.data).codeEnum=fn,e.isSuccess=function(t){return e.code!==fn.success&&(t||u.msg(e.msg)),e.code===fn.success},e.code){case fn.success:return Promise.resolve(e);case fn.jumpTo:return void(location.href=e.data);case fn.window:return!1!==Promise.resolve(e)&&window.open(e.data),Promise.reject(e);case fn.alert:case fn.msg:return u.msg(e.msg),Promise.reject(e);case fn.noRealName:return impall.showReal_name();case fn.ServerSignError:case fn.nologin:if(e.__source.config.isTwice)return d.runM("login","noLogin",[e]),Promise.resolve(e);const t=function(){return ln.debug("检测到未登录返回,发起验证登录之后,重新再请求一遍"),e.__source.config.isTwice=!0,e.__source.config.data=f.toData(e.__source.config.data),Wt(e.__source.config)};return await d.runM("login","checkLogin"),t()}return Promise.resolve(e)},function(e){return Promise.reject(e)});var hn=Wt.get;Wt.get=function(e,t,n){return(n=n||{}).params=t,hn(e,n)};const mn=await T(),gn=await s();class pn{constructor(){this.loginDomain=window.loginDomain="localhost"===location.hostname&&S().isLocalhost?"https://localhost:44360":mn.domainLogin,this.ver="v1.0.0",this.loginTime=21600,this.prefix="IMP_PLUG_LOGIN_",this.initUrls(),this.initKeys(),this.initEventKeys(),this.bindEvents(),this.iframeBox=null,this.iframe=null,this.iframeBg=null,this.autoLogin={},this.exitLogin={},this.threeLoginWin=null,this.isTempCheck=e.getPar(this.keys.url_tempSignKey)&&e.getPar(this.keys.url_tempUseridxKey),window.login=this}initUrls(){this.urls={login:cn(this.loginDomain+"/index.html",!0),reg:cn(this.loginDomain+"/index.html?type=reg",!0),loginPage:cn(this.loginDomain+"/loginPage.html",!0),regPage:cn(this.loginDomain+"/regPage.html",!0),autoLogin:cn(this.loginDomain+"/"+this.ver+"/user/autoLogin"),checkSSOLogin:cn(this.loginDomain+"/"+this.ver+"/user/checkSSOLogin"),checkLoginPage:cn(this.loginDomain+"/"+this.ver+"/user/checkLoginPage"),CheckLoginByCode:cn(this.loginDomain+"/"+this.ver+"/user/CheckLoginByCode"),exitLogin:this.loginDomain+"/"+this.ver+"/user/exitLogin",userInfo:this.loginDomain+"/"+this.ver+"/user/UserInfo",writeCookies:"/ashx/member/CheckSSOWriteCookie.ashx",webLoginOut:"/ajax/logout.aspx"}}initKeys(){const e=e=>this.prefix+e;this.keys={msg_loginReturn:e("loginReturn"),msg_close:e("close"),msg_goto:e("goto"),msg_autoSize:e("autoSize"),msg_getSize:e("getSize"),cache_loginSave:e("loginSave"),cache_userInfo:e("userInfo"),checkLogin_code:"code",loginStatus:"__login_status",loginResult:"__login_result",url_tempSignKey:"sign",url_tempUseridxKey:"useridx"}}initEventKeys(){const e=e=>this.prefix+e;this.eventKeys={nologin:e("login"),closeThreeLogin:e("close_login_three")}}bindEvents(){a.on(this.keys.msg_close,()=>{gn.debug("关闭登录框"),this.close()}),a.on(this.keys.msg_goto,e=>{this.handlePageTransition(e)}),a.on(this.keys.msg_autoSize,e=>{this.handleAutoSize(e)}),a.on(this.keys.msg_loginReturn,async e=>{await this.dealwithLoginRes(e)}),a.on(this.eventKeys.closeThreeLogin,e=>{this.save(e),this.closeThreeLoginWin()})}handlePageTransition(e){if(!this.iframe)return;this.iframe.classList.remove("IMP_PLUG_LOGIN_animateIn"),this.iframe.classList.add("IMP_PLUG_LOGIN_animateOut");const t=()=>{this.iframe.src=e.url,this.iframe.classList.remove("IMP_PLUG_LOGIN_animateOut"),this.iframe.removeEventListener("transitionend",t)};this.iframe.addEventListener("transitionend",t)}handleAutoSize(e){this.iframe&&(gn.debug("登录框尺寸适配",e),this.iframe.width=e.width,this.iframe.height=e.height,this.iframe.classList.add("IMP_PLUG_LOGIN_animateIn"),this.iframeBg.classList.add("IMP_PLUG_LOGIN_animateIn"))}runAutoLoginCallback(e,t){this.autoLogin.callbacks&&0!==this.autoLogin.callbacks.length&&(this.autoLogin.callbacks.forEach(t=>{if(c(e))t.ok&&t.ok(e);else{const n=this.getLogin(e);t.ok&&t.ok(n&&n.code===Wt.codeEnum.success)}}),this.autoLogin.iframe&&this.autoLogin.iframe.remove(),this.autoLogin.window&&this.autoLogin.window.close(),this.autoLogin={},e&&this.close())}async dealwithLoginRes(t){if(gn.debug("登录消息返回",t),t.isok=t.code===Wt.codeEnum.success,1!==t.code)return this.clear(),void this.runAutoLoginCallback(t);if(t.sign&&8===t.sign.length)this.save(t);else{e.delParsUpUrl([this.keys.url_tempSignKey,this.keys.url_tempUseridxKey]),l.set(this.keys.cache_loginSave,t,this.loginTime),Wt.saveLogin(t.useridx,t.sign);try{await Wt.get(this.urls.writeCookies,null,null,"text")}finally{this.runAutoLoginCallback(t)}}}save(e){const t=e.__source?.headers?.[e.sign]||e.data?.headers?.[e.sign]||e.sign,n=e.useridx||e.data?.___useridx;a.send(this.keys.msg_loginReturn,{code:e.code,msg:e.msg,sign:t,useridx:n})}clear(){l.remove(this.keys.cache_loginSave),l.remove(this.keys.cache_userInfo),l.remove(this.keys.cache_userInfo+"_more"),l.remove(this.keys.cache_userInfo+"_simplify")}onLoginOK(e,t){this.autoLogin.callbacks||(this.autoLogin.callbacks=[]),this.autoLogin.callbacks.push({ok:e,no:t})}create(e){const t=n(!0,{url:"",name:"",option:null},e);this.createIframeBox(),this.createIframe(t),this.applyStyles(t.option||{}),this.appendToDocument()}createIframeBox(){this.iframeBox=document.createElement("div"),this.iframeBox.className="IMP_PLUG_LOGIN_box";const e=parseFloat(window.getComputedStyle(document.documentElement).zoom);e<1&&(this.iframeBox.style.zoom=(1/e).toFixed(2)),this.iframe=document.createElement("iframe"),this.iframeBg=document.createElement("div")}createIframe(e){this.iframe.id=this.iframe.name=e.name,this.iframe.src=e.url;const t=e.option||{};this.iframe.width=t.width||400,this.iframe.height=t.height||400,this.iframe.scrolling=t.scrolling||"no",this.iframe.marginWidth=t.marginWidth||"0",this.iframe.marginHeight=t.marginHeight||"0",this.iframe.frameBorder=t.frameBorder||"0"}applyStyles(e){Object.assign(this.iframe.style,{zIndex:3e3,position:"fixed",borderRadius:e.radius||"none",opacity:0}),Object.assign(this.iframeBg.style,{position:"fixed",backgroundColor:"#6f6f6f80",width:"100%",height:"100%",top:0,left:0,opacity:0}),this.applyPosition(e.offset||"center"),this.applyAnimation(e)}applyPosition(e){const t={center:{top:"50%",left:"50%",transform:"translate(-50%, -50%)"},top:{top:"5%",left:"50%",transform:"translateX(-50%)"},bottom:{bottom:"5%",left:"50%",transform:"translateX(-50%)"},lt:{top:"5%",left:"5%"},lb:{bottom:"5%",left:"5%"},rt:{top:"5%",right:"5%"},rb:{bottom:"5%",right:"5%"}},n=t[e]||t.center;Object.assign(this.iframe.style,n)}applyAnimation(e){const t=e.animTime||300;this.iframe.style.transition=`opacity ${t}ms`,this.iframeBg.style.transition=`opacity ${t}ms`,this.createAnimationStyles(e.anime||0)}createAnimationStyles(e){const t={0:".IMP_PLUG_LOGIN_animateIn{opacity:1 !important;} .IMP_PLUG_LOGIN_animateOut{opacity:0 !important;}"},n=t[e]||t[0],r=document.createElement("style");r.id="IMP_PLUG_LOGIN_animateCss";try{r.appendChild(document.createTextNode(n))}catch(o){r.styleSheet.cssText=n}document.head.appendChild(r)}appendToDocument(){this.iframeBox.append(this.iframe),this.iframeBox.append(this.iframeBg),document.body.append(this.iframeBox)}istop(){return parent===window}close(){if(!this.istop())return;const e=()=>{this.iframeBox&&(this.iframeBox.remove(),this.iframeBox=null),this.autoLogin.iframe&&this.autoLogin.iframe.remove();const e=document.getElementById("IMP_PLUG_LOGIN_animateCss");e&&e.remove()};this.iframeBg&&(this.iframeBg.classList.remove("IMP_PLUG_LOGIN_animateIn"),this.iframeBg.classList.add("IMP_PLUG_LOGIN_animateOut")),this.iframe?(this.iframe.classList.remove("IMP_PLUG_LOGIN_animateIn"),this.iframe.classList.add("IMP_PLUG_LOGIN_animateOut"),this.iframe.addEventListener("transitionend",e,{once:!0})):e()}autoSize(e,t){a.send(this.keys.msg_autoSize,{width:e||document.body.scrollWidth,height:t||document.body.scrollHeight})}open(e=!1){if(this.iframeBox)return Promise.resolve();const t=new Promise((e,t)=>{this.onLoginOK(e,t),this.istop()?this.create({url:this.urls.login,name:"signIn",option:{radius:"4px"}}):a.send(this.keys.msg_goto,{url:this.urls.login})});return e?t:t.then(()=>location.reload())}openPage(){const t=e.getPar("sourceurl")||location.href,n=e.addPar("sourceurl",unescape(t),this.urls.loginPage);location.href=n}openReg(e=!1){if(this.iframeBox)return Promise.resolve();const t=new Promise((e,t)=>{this.onLoginOK(e,t),this.istop()?this.create({url:this.urls.reg,name:"signIn",option:{radius:"4px"}}):a.send(this.keys.msg_goto,{url:this.urls.reg})});return e?t:t.then(()=>location.reload())}openRegPage(){const t=e.getPar("sourceurl")||location.href,n=e.addPar("sourceurl",unescape(t),this.urls.regPage);location.href=n}threeLogin(e,t){return new Promise((n,r)=>{this.closeThreeLoginWin(),this.onLoginOK(n,r);const o=cn(`/v1.0.0/user/OpenThreeLogin?type=${e}`,t);this.threeLoginWin=window.open(o)})}closeThreeLoginWin(){this.threeLoginWin&&(this.threeLoginWin.close(),this.threeLoginWin=null)}getWechatCode(){const t=e.getPar("__login_code");if(!t){const e=`${this.loginDomain}/v1.0.0/user/OpenThreeLogin?type=wechatcode&redirect_uri=${encodeURIComponent(location.href)}`;location.href=e}return t}getLogin(e,t=!1){const n=e||l.get(this.keys.cache_loginSave);return n?(t||delete n.sign,n):null}getUser(e,t=!1,n=!1){"function"!=typeof e&&(n=t,t=e,e=null);const r=new Promise((e,r)=>{const o=this.keys.cache_userInfo+"_"+(t?"more":"simplify");if(!n){const t=l.get(o);if(t)return void e(t)}Wt.get(this.urls.userInfo,{more:t?1:0}).then(t=>{1===t.code?(l.set(o,t.data,this.loginTime),e(t.data)):r(t)})});return e?r.then(e):r}islogin(){return!!this.getLogin()}async check(){return!(this.isTempCheck||!this.islogin())||this.checkZ()}checkZ(){return new Promise((t,n)=>{if(!this.autoLogin.iframe&&!this.autoLogin.window){let t=this.urls.autoLogin;t=e.addPars({sign:e.getPar(this.keys.url_tempSignKey),useridx:e.getPar(this.keys.url_tempUseridxKey)},t),this.autoLogin.iframe=this.getIframeUrl(t,this.keys.msg_loginReturn),this.autoLogin.callbacks=[]}this.autoLogin.callbacks.push({ok:t,no:()=>{t(!1)}})})}checkPage(){return new Promise((t,n)=>{const r=e.getPar(this.keys.checkLogin_code),o=parseInt(e.getPar(this.keys.loginStatus)||-1);gn.debug("checkLogin_code:",r),0===o?(e.delParsUpUrl([this.keys.loginStatus]),n("用户未登录!")):o&&r?Wt.get(this.urls.CheckLoginByCode,{code:r}).then(r=>{1===r.code?(e.delParsUpUrl([this.keys.checkLogin_code,this.keys.loginStatus]),this.save(r.data),t(r)):n()}):Wt.get(this.urls.checkSSOLogin).then(n=>{if(1===n.code)this.getUser().then(t);else{let t=e.addPars({redirect_uri:encodeURIComponent(location.href)},this.urls.checkLoginPage);location.href=t}})})}res(t){const n=decodeURIComponent(e.getPar(this.keys.loginResult)||"");if(n){const r=JSON.parse(n);t?.(r),e.delParsUpUrl([this.keys.loginResult])}}exit(e=!1){return gn.debug("退出登录!"),this.exitLogin.Promise||(this.exitLogin.Promise=new Promise(e=>{p.get(this.urls.exitLogin).then(t=>{y(this.urls.webLoginOut,null,()=>{e(t)},"text"),this.clear(),this.exitLogin={}})}),e||(this.exitLogin.Promise=this.exitLogin.Promise.then(()=>{location.reload()}))),this.exitLogin.Promise}getIframeUrl(t,n){const r=document.createElement("iframe");Object.assign(r.style,{position:"absolute",width:"1px",height:"1px",top:"-100px"}),r.dataset.flag=9513,n&&(t=e.addPar("post_msg_name",n,t)),r.src=t;let o,s=!1;const i=()=>{r.removeEventListener("error",a),clearTimeout(o)},a=e=>{s||(s=!0,i(),r.remove(),this.runAutoLoginCallback(!1))};return r.addEventListener("load",e=>{console.log("iframe loaded",e),s||(s=!0,i(),console.log("缓存数据已保存"))},{once:!0}),r.addEventListener("error",a,{once:!0}),o=setTimeout(()=>{a()},1e4),document.body.append(r),r}onNoLogin(e){d?d.on(this.eventKeys.nologin,e):console.warn("事件模块event未加载,事件相关功能不可用!")}runNoLogin(e){return d?Promise.resolve(d.run(this.eventKeys.nologin,e)):(console.warn("事件模块event未加载,事件相关功能不可用!"),Promise.resolve())}writeXhr(e){if(!e)return console.warn("xhr不能为空!"),e;const t=this.getLogin(null,!0);return t&&(e.withCredentials=!0,e.setRequestHeader("imp_sign",t.sign),e.setRequestHeader("imp_useridx",t.useridx)),e}debug(...e){console&&console.debug&&console.debug(...e)}}const yn=new pn;export{pn as Login,Wt as axios,L as getAllConfig,U as getApiurl,R as getCodeVer,T as getConfig,x as getDomainConfig,S as getEvnConfig,P as getSimplifyConfig,I as gotool,cn as handleUrl,yn as login};
|
|
1
|
+
import{urltool as e,date as t,extend as n,getAndWaitCache as r,loadjs as o,getLog as s,bufferToBase64 as i,base64ToBuffer as a,type as c,message as l,isBoolean as u,cache as d}from"@impui/com";import*as f from"@impui/com/layer";import{event as h}from"@impui/com/event";import{urltool as m}from"@impui/com/url";import{getLog as g}from"@impui/com/log";import{cache as p}from"@impui/com/cache";import{extend as y}from"@impui/com/core";import{iframeReq as w,get as b}from"@impui/com/req";const _=e.getDomainJson(),O={allsr:"https://impsr.5see.com",debugDomain:"zjyx1.com",isLocalhost:!1,localConfig:null};let v=null;const E={allconfig:"/npm/allconfig.min.js",apiurl:"/npm/apiurl.min.js"},S=t.getTimestamp(),R={config:S,bubble:S,dress:S,gift:S,template:S},L=()=>{if(v)return v;v=O,"undefined"!=typeof __impconfig__&&(v=n(!0,{},O,__impconfig__));for(const e in E)v[e]=v.allsr+E[e];return v};"localhost"===_.main&&(_.main=L().debugDomain,_.mainhost=L().debugDomain,_.port="",_.name=_.mainhost.split(".")[0],_.protocol="https:");const x=()=>n(!0,{},R,window.codever),P=async()=>{if(window.allconfig)return window.allconfig.domainsitetype;return(await r("config_allconfig",async()=>(await o(L().allconfig),window.allconfig))).domainsitetype},T=async()=>{const e=(await P())["localhost"===_.main?L().debugDomain:_.main];return e||{}},k=async()=>await r("config_simplify",async()=>{const e=await C("config_simplify");await o(e);const t=window.sconfig;return delete window.sconfig,t}),U=async()=>await r("config_full",async()=>{console.log("getConfig");const e=await C("config");await o(e);const t=L();let r=window.config;return delete window.config,r.npm=r.allsr+"/npm/",t.isLocalhost&&t.localConfig&&(r=n(!0,{},r,t.localConfig)),r}),C=async e=>{const t=await T();var n=t.res||"sr",r=t.resHost||_.mainhost;return`${_.protocol+"//"+n+"."+r}/live/webSkins_site/${t.sitetype}/config/${e}.js`},A=async()=>await r("config_apiurl",async()=>await o(L().apiurl,{extend:n,config:await U()}));(()=>{const e=globalThis,t=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!e.fs){let n="";e.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,t){n+=r.decode(t);const o=n.lastIndexOf("\n");return-1!=o&&(console.log(n.substr(0,o)),n=n.substr(o+1)),t.length},write(e,n,r,o,s,i){if(0!==r||o!==n.length||null!==s)return void i(t());i(null,this.writeSync(e,n))},chmod(e,n,r){r(t())},chown(e,n,r,o){o(t())},close(e,n){n(t())},fchmod(e,n,r){r(t())},fchown(e,n,r,o){o(t())},fstat(e,n){n(t())},fsync(e,t){t(null)},ftruncate(e,n,r){r(t())},lchown(e,n,r,o){o(t())},link(e,n,r){r(t())},lstat(e,n){n(t())},mkdir(e,n,r){r(t())},open(e,n,r,o){o(t())},read(e,n,r,o,s,i){i(t())},readdir(e,n){n(t())},readlink(e,n){n(t())},rename(e,n,r){r(t())},rmdir(e,n){n(t())},stat(e,n){n(t())},symlink(e,n,r){r(t())},truncate(e,n,r){r(t())},unlink(e,n){n(t())},utimes(e,n,r,o){o(t())}}}if(e.process||(e.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw t()},pid:-1,ppid:-1,umask(){throw t()},cwd(){throw t()},chdir(){throw t()}}),!e.crypto){const t=require("node:crypto");e.crypto={getRandomValues(e){t.randomFillSync(e)}}}e.performance||(e.performance={now(){const[e,t]=process.hrtime();return 1e3*e+t/1e6}}),e.TextEncoder||(e.TextEncoder=require("node:util").TextEncoder),e.TextDecoder||(e.TextDecoder=require("node:util").TextDecoder);const n=new TextEncoder("utf-8"),r=new TextDecoder("utf-8");let o=new DataView(new ArrayBuffer(8));var s=[];const i={};e.Go=class{constructor(){this._callbackTimeouts=/* @__PURE__ */new Map,this._nextCallbackTimeoutID=1;const e=()=>new DataView(this._inst.exports.memory.buffer),t=e=>{o.setBigInt64(0,e,!0);const t=o.getFloat64(0,!0);if(0===t)return;if(!isNaN(t))return t;const n=0xffffffffn&e;return this._values[n]},a=n=>{let r=e().getBigUint64(n,!0);return t(r)},c=e=>{const t=0x7FF80000n;if("number"==typeof e)return isNaN(e)?t<<32n:0===e?t<<32n|1n:(o.setFloat64(0,e,!0),o.getBigInt64(0,!0));switch(e){case void 0:return 0n;case null:return t<<32n|2n;case!0:return t<<32n|3n;case!1:return t<<32n|4n}let n=this._ids.get(e);void 0===n&&(n=this._idPool.pop(),void 0===n&&(n=BigInt(this._values.length)),this._values[n]=e,this._goRefCounts[n]=0,this._ids.set(e,n)),this._goRefCounts[n]++;let r=1n;switch(typeof e){case"string":r=2n;break;case"symbol":r=3n;break;case"function":r=4n}return n|(t|r)<<32n},l=(t,n)=>{let r=c(n);e().setBigUint64(t,r,!0)},u=(e,t,n)=>new Uint8Array(this._inst.exports.memory.buffer,e,t),d=(e,t,n)=>{const r=new Array(t);for(let o=0;o<t;o++)r[o]=a(e+8*o);return r},f=(e,t)=>r.decode(new DataView(this._inst.exports.memory.buffer,e,t)),h=Date.now()-performance.now();this.importObject={wasi_snapshot_preview1:{fd_write:function(t,n,o,i){let a=0;if(1==t)for(let c=0;c<o;c++){let t=n+8*c,o=e().getUint32(t+0,!0),i=e().getUint32(t+4,!0);a+=i;for(let n=0;n<i;n++){let t=e().getUint8(o+n);if(13==t);else if(10==t){let e=r.decode(new Uint8Array(s));s=[],console.log(e)}else s.push(t)}}else console.error("invalid file descriptor:",t);return e().setUint32(i,a,!0),0},fd_close:()=>0,fd_fdstat_get:()=>0,fd_seek:()=>0,proc_exit:e=>{throw this.exited=!0,this.exitCode=e,this._resolveExitPromise(),i},random_get:(e,t)=>(crypto.getRandomValues(u(e,t)),0)},gojs:{"runtime.ticks":()=>BigInt(1e6*(h+performance.now())),"runtime.sleepTicks":e=>{setTimeout(()=>{if(!this.exited)try{this._inst.exports.go_scheduler()}catch(e){if(e!==i)throw e}},Number(e)/1e6)},"syscall/js.finalizeRef":e=>{const t=0xffffffffn&e;if(void 0!==this._goRefCounts?.[t]){if(this._goRefCounts[t]--,0===this._goRefCounts[t]){const e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}}else console.error("syscall/js.finalizeRef: unknown id",t)},"syscall/js.stringVal":(e,t)=>{const n=f(e>>>=0,t);return c(n)},"syscall/js.valueGet":(e,n,r)=>{let o=f(n,r),s=t(e),i=Reflect.get(s,o);return c(i)},"syscall/js.valueSet":(e,n,r,o)=>{const s=t(e),i=f(n,r),a=t(o);Reflect.set(s,i,a)},"syscall/js.valueDelete":(e,n,r)=>{const o=t(e),s=f(n,r);Reflect.deleteProperty(o,s)},"syscall/js.valueIndex":(e,n)=>c(Reflect.get(t(e),n)),"syscall/js.valueSetIndex":(e,n,r)=>{Reflect.set(t(e),n,t(r))},"syscall/js.valueCall":(n,r,o,s,i,a,c)=>{const u=t(r),h=f(o,s),m=d(i,a);try{const t=Reflect.get(u,h);l(n,Reflect.apply(t,u,m)),e().setUint8(n+8,1)}catch(g){l(n,g),e().setUint8(n+8,0)}},"syscall/js.valueInvoke":(n,r,o,s,i)=>{try{const i=t(r),a=d(o,s);l(n,Reflect.apply(i,void 0,a)),e().setUint8(n+8,1)}catch(a){l(n,a),e().setUint8(n+8,0)}},"syscall/js.valueNew":(n,r,o,s,i)=>{const a=t(r),c=d(o,s);try{l(n,Reflect.construct(a,c)),e().setUint8(n+8,1)}catch(u){l(n,u),e().setUint8(n+8,0)}},"syscall/js.valueLength":e=>t(e).length,"syscall/js.valuePrepareString":(r,o)=>{const s=String(t(o)),i=n.encode(s);l(r,i),e().setInt32(r+8,i.length,!0)},"syscall/js.valueLoadString":(e,n,r,o)=>{const s=t(e);u(n,r).set(s)},"syscall/js.valueInstanceOf":(e,n)=>t(e)instanceof t(n),"syscall/js.copyBytesToGo":(n,r,o,s,i)=>{let a=n,c=n+4;const l=u(r,o),d=t(i);if(!(d instanceof Uint8Array||d instanceof Uint8ClampedArray))return void e().setUint8(c,0);const f=d.subarray(0,l.length);l.set(f),e().setUint32(a,f.length,!0),e().setUint8(c,1)},"syscall/js.copyBytesToJS":(n,r,o,s,i)=>{let a=n,c=n+4;const l=t(r),d=u(o,s);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray))return void e().setUint8(c,0);const f=d.subarray(0,l.length);l.set(f),e().setUint32(a,f.length,!0),e().setUint8(c,1)}}},this.importObject.env=this.importObject.gojs}async run(t){if(this._inst=t,this._values=[NaN,0,null,!0,!1,e,this],this._goRefCounts=[],this._ids=/* @__PURE__ */new Map,this._idPool=[],this.exited=!1,this.exitCode=0,this._inst.exports._start){let e=new Promise((e,t)=>{this._resolveExitPromise=e});try{this._inst.exports._start()}catch(n){if(n!==i)throw n}return await e,this.exitCode}this._inst.exports._initialize()}_resume(){if(this.exited)throw new Error("Go program has already exited");try{this._inst.exports.resume()}catch(e){if(e!==i)throw e}this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const t=this;return function(){const n={id:e,this:this,args:arguments};return t._pendingEvent=n,t._resume(),n.result}}}})();const j=Go,N={},B=(await U()).allsr+"/plug/gotool/lib/imptool.wasm",I=await s(),D=async function(){return console.warn("⚠️ 降级方案已启用"),{encrypt:function(){throw new Error("❌ 降级方案未实现:encrypt方法")},parseRes:async function(e,t){try{if("true"!==e.headers["res-encrypt"])return e;const t={data:e.data},n=await A(),r=await axios.post(n.parseRes,{res:encodeURIComponent(JSON.stringify(t)),config:null});return e.data=JSON.parse(r.data),e}catch(n){console.error("❌ 降级方案请求接口失败:",n)}},parseServer:function(){throw new Error("❌ 降级方案未实现:parseServer方法")}}};const F=new class{constructor(e){this.isbase=e===B,this.url=e}async#e(){if(!this.url){const e=await U();this.url=e.allsr+"plug/gotool/lib/imptool.wasm"}return this.url}async#t(e,t){return async function(e,t,n=!1){try{const o=new j;I("=== WASM加载调试开始 ==="),I("URL:",e),I("UserAgent:",navigator.userAgent);const s=await r(e,async()=>{const n=await fetch(e+t);I("✅ 响应状态:",n.status);const r=await n.arrayBuffer();return I("✅ ArrayBuffer大小:",r.byteLength,"bytes"),i(r,{type:"application/wasm"})}),c=await a(s),l=new Uint8Array(c.slice(0,4));I("🔍 WASM文件头:",Array.from(l)),I("🔍 Go importObject结构:",Object.keys(o.importObject)),o.importObject.go&&I("🔍 GoJS导入键:",Object.keys(o.importObject.go)),I("🚀 开始WebAssembly.instantiate...");const u=await WebAssembly.instantiate(c,o.importObject);if(I("✅ WebAssembly实例化成功"),I("🚀 开始go.run..."),o.run(u.instance),I("✅ go.run执行完成"),window.goCrypto){const e=window.goCrypto;return delete window.goCrypto,I("✅ goCrypto加载成功"),e}if(n)return await D();throw console.warn("❌ window.goCrypto未定义,进入诊断模式"),await loadGoWasmWithDiagnosis(e),new Error("❌ window.goCrypto未定义")}catch(o){throw console.error("💥 完整错误堆栈:",o),console.error("错误名称:",o.name),console.error("错误信息:",o.message),o}}(e=e||await this.#e(),t,this.isbase)}async getRunTimes(e=!1){const t=await this.#e();if(!e&&N[t])return N[t];const n=x(),r=n.config?"?d="+n.config:"",o=await this.#t(t,r),s={};if(o)for(let i in o)s[i]=o[i];return N[t]=s,s}async init(){return this.getRunTimes()}async run(e,t){const n=await this.getRunTimes();return n[e]||console.error(`[${e}] 方法不在默认wasm中!`),n[e].apply(null,t)}}(B);function M(e,t){return function(){return e.apply(t,arguments)}}const{toString:q}=Object.prototype,{getPrototypeOf:W}=Object,{iterator:z,toStringTag:G}=Symbol,K=/* @__PURE__ */(e=>t=>{const n=q.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(/* @__PURE__ */Object.create(null)),H=e=>(e=e.toLowerCase(),t=>K(t)===e),J=e=>t=>typeof t===e,{isArray:$}=Array,V=J("undefined");function X(e){return null!==e&&!V(e)&&null!==e.constructor&&!V(e.constructor)&&Y(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Z=H("ArrayBuffer");const Q=J("string"),Y=J("function"),ee=J("number"),te=e=>null!==e&&"object"==typeof e,ne=e=>{if("object"!==K(e))return!1;const t=W(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||G in e||z in e)},re=H("Date"),oe=H("File"),se=H("Blob"),ie=H("FileList"),ae=H("URLSearchParams"),[ce,le,ue,de]=["ReadableStream","Request","Response","Headers"].map(H);function fe(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),$(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(X(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function he(e,t){if(X(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const me="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ge=e=>!V(e)&&e!==me;const pe=/* @__PURE__ */(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&W(Uint8Array)),ye=H("HTMLFormElement"),we=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),be=H("RegExp"),_e=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};fe(n,(n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)}),Object.defineProperties(e,r)};const Oe=H("AsyncFunction"),ve=(Ee="function"==typeof setImmediate,Se=Y(me.postMessage),Ee?setImmediate:Se?(Re=`axios@${Math.random()}`,Le=[],me.addEventListener("message",({source:e,data:t})=>{e===me&&t===Re&&Le.length&&Le.shift()()},!1),e=>{Le.push(e),me.postMessage(Re,"*")}):e=>setTimeout(e));var Ee,Se,Re,Le;const xe="undefined"!=typeof queueMicrotask?queueMicrotask.bind(me):"undefined"!=typeof process&&process.nextTick||ve,Pe={isArray:$,isArrayBuffer:Z,isBuffer:X,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Y(e.append)&&("formdata"===(t=K(e))||"object"===t&&Y(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Z(e.buffer),t},isString:Q,isNumber:ee,isBoolean:e=>!0===e||!1===e,isObject:te,isPlainObject:ne,isEmptyObject:e=>{if(!te(e)||X(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(t){return!1}},isReadableStream:ce,isRequest:le,isResponse:ue,isHeaders:de,isUndefined:V,isDate:re,isFile:oe,isBlob:se,isRegExp:be,isFunction:Y,isStream:e=>te(e)&&Y(e.pipe),isURLSearchParams:ae,isTypedArray:pe,isFileList:ie,forEach:fe,merge:function e(){const{caseless:t,skipUndefined:n}=ge(this)&&this||{},r={},o=(o,s)=>{const i=t&&he(r,s)||s;ne(r[i])&&ne(o)?r[i]=e(r[i],o):ne(o)?r[i]=e({},o):$(o)?r[i]=o.slice():n&&V(o)||(r[i]=o)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&fe(arguments[s],o);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(fe(t,(t,r)=>{n&&Y(t)?e[r]=M(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,i;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],r&&!r(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==n&&W(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:K,kindOfTest:H,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if($(e))return e;let t=e.length;if(!ee(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[z]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:ye,hasOwnProperty:we,hasOwnProp:we,reduceDescriptors:_e,freezeMethods:e=>{_e(e,(t,n)=>{if(Y(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];Y(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return $(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:he,global:me,isContextDefined:ge,isSpecCompliantForm:function(e){return!!(e&&Y(e.append)&&"FormData"===e[G]&&e[z])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(te(e)){if(t.indexOf(e)>=0)return;if(X(e))return e;if(!("toJSON"in e)){t[r]=e;const o=$(e)?[]:{};return fe(e,(e,t)=>{const s=n(e,r+1);!V(s)&&(o[t]=s)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:Oe,isThenable:e=>e&&(te(e)||Y(e))&&Y(e.then)&&Y(e.catch),setImmediate:ve,asap:xe,isIterable:e=>null!=e&&Y(e[z])};function Te(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}Pe.inherits(Te,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Pe.toJSONObject(this.config),code:this.code,status:this.status}}});const ke=Te.prototype,Ue={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Ue[e]={value:e}}),Object.defineProperties(Te,Ue),Object.defineProperty(ke,"isAxiosError",{value:!0}),Te.from=(e,t,n,r,o,s)=>{const i=Object.create(ke);Pe.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return Te.call(i,a,c,n,r,o),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",s&&Object.assign(i,s),i};function Ce(e){return Pe.isPlainObject(e)||Pe.isArray(e)}function Ae(e){return Pe.endsWith(e,"[]")?e.slice(0,-2):e}function je(e,t,n){return e?e.concat(t).map(function(e,t){return e=Ae(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Ne=Pe.toFlatObject(Pe,{},null,function(e){return/^is[A-Z]/.test(e)});function Be(e,t,n){if(!Pe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Pe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Pe.isUndefined(t[e])})).metaTokens,o=n.visitor||l,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Pe.isSpecCompliantForm(t);if(!Pe.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Pe.isDate(e))return e.toISOString();if(Pe.isBoolean(e))return e.toString();if(!a&&Pe.isBlob(e))throw new Te("Blob is not supported. Use a Buffer instead.");return Pe.isArrayBuffer(e)||Pe.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(Pe.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Pe.isArray(e)&&function(e){return Pe.isArray(e)&&!e.some(Ce)}(e)||(Pe.isFileList(e)||Pe.endsWith(n,"[]"))&&(a=Pe.toArray(e)))return n=Ae(n),a.forEach(function(e,r){!Pe.isUndefined(e)&&null!==e&&t.append(!0===i?je([n],r,s):null===i?n:n+"[]",c(e))}),!1;return!!Ce(e)||(t.append(je(o,n,s),c(e)),!1)}const u=[],d=Object.assign(Ne,{defaultVisitor:l,convertValue:c,isVisitable:Ce});if(!Pe.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Pe.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),Pe.forEach(n,function(n,s){!0===(!(Pe.isUndefined(n)||null===n)&&o.call(t,n,Pe.isString(s)?s.trim():s,r,d))&&e(n,r?r.concat(s):[s])}),u.pop()}}(e),t}function Ie(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function De(e,t){this._pairs=[],e&&Be(e,this,t)}const Fe=De.prototype;function Me(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function qe(e,t,n){if(!t)return e;const r=n&&n.encode||Me;Pe.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(s=o?o(t,n):Pe.isURLSearchParams(t)?t.toString():new De(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}Fe.append=function(e,t){this._pairs.push([e,t])},Fe.toString=function(e){const t=e?function(t){return e.call(this,t,Ie)}:Ie;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class We{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Pe.forEach(this.handlers,function(t){null!==t&&e(t)})}}const ze={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ge={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:De,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Ke="undefined"!=typeof window&&"undefined"!=typeof document,He="object"==typeof navigator&&navigator||void 0,Je=Ke&&(!He||["ReactNative","NativeScript","NS"].indexOf(He.product)<0),$e="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ve=Ke&&window.location.href||"http://localhost",Xe={.../* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,hasBrowserEnv:Ke,hasStandardBrowserEnv:Je,hasStandardBrowserWebWorkerEnv:$e,navigator:He,origin:Ve},Symbol.toStringTag,{value:"Module"})),...Ge};function Ze(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&Pe.isArray(r)?r.length:s,a)return Pe.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&Pe.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&Pe.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i}if(Pe.isFormData(e)&&Pe.isFunction(e.entries)){const n={};return Pe.forEachEntry(e,(e,r)=>{t(function(e){return Pe.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const Qe={transitional:ze,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Pe.isObject(e);o&&Pe.isHTMLForm(e)&&(e=new FormData(e));if(Pe.isFormData(e))return r?JSON.stringify(Ze(e)):e;if(Pe.isArrayBuffer(e)||Pe.isBuffer(e)||Pe.isStream(e)||Pe.isFile(e)||Pe.isBlob(e)||Pe.isReadableStream(e))return e;if(Pe.isArrayBufferView(e))return e.buffer;if(Pe.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Be(e,new Xe.classes.URLSearchParams,{visitor:function(e,t,n,r){return Xe.isNode&&Pe.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=Pe.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Be(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(Pe.isString(e))try{return(t||JSON.parse)(e),Pe.trim(e)}catch(r){if("SyntaxError"!==r.name)throw r}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Qe.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Pe.isResponse(e)||Pe.isReadableStream(e))return e;if(e&&Pe.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(o){if(n){if("SyntaxError"===o.name)throw Te.from(o,Te.ERR_BAD_RESPONSE,this,null,this.response);throw o}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Xe.classes.FormData,Blob:Xe.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Pe.forEach(["delete","get","head","post","put","patch"],e=>{Qe.headers[e]={}});const Ye=Pe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),et=Symbol("internals");function tt(e){return e&&String(e).trim().toLowerCase()}function nt(e){return!1===e||null==e?e:Pe.isArray(e)?e.map(nt):String(e)}function rt(e,t,n,r,o){return Pe.isFunction(r)?r.call(this,t,n):(o&&(t=n),Pe.isString(t)?Pe.isString(r)?-1!==t.indexOf(r):Pe.isRegExp(r)?r.test(t):void 0:void 0)}let ot=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=tt(t);if(!o)throw new Error("header name must be a non-empty string");const s=Pe.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=nt(e))}const s=(e,t)=>Pe.forEach(e,(e,n)=>o(e,n,t));if(Pe.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(Pe.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Ye[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(Pe.isObject(e)&&Pe.isIterable(e)){let n,r,o={};for(const t of e){if(!Pe.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?Pe.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}s(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=tt(e)){const n=Pe.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=/* @__PURE__ */Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Pe.isFunction(t))return t.call(this,e,n);if(Pe.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=tt(e)){const n=Pe.findKey(this,e);return!(!n||void 0===this[n]||t&&!rt(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=tt(e)){const o=Pe.findKey(n,e);!o||t&&!rt(0,n[o],o,t)||(delete n[o],r=!0)}}return Pe.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!rt(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Pe.forEach(this,(r,o)=>{const s=Pe.findKey(n,o);if(s)return t[s]=nt(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();i!==o&&delete t[o],t[i]=nt(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=/* @__PURE__ */Object.create(null);return Pe.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Pe.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[et]=this[et]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=tt(e);t[r]||(!function(e,t){const n=Pe.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return Pe.isArray(e)?e.forEach(r):r(e),this}};function st(e,t){const n=this||Qe,r=t||n,o=ot.from(r.headers);let s=r.data;return Pe.forEach(e,function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function it(e){return!(!e||!e.__CANCEL__)}function at(e,t,n){Te.call(this,null==e?"canceled":e,Te.ERR_CANCELED,t,n),this.name="CanceledError"}function ct(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Te("Request failed with status code "+n.status,[Te.ERR_BAD_REQUEST,Te.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}ot.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Pe.reduceDescriptors(ot.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Pe.freezeMethods(ot),Pe.inherits(at,Te,{__CANCEL__:!0});const lt=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];o||(o=c),n[s]=a,r[s]=c;let u=i,d=0;for(;u!==s;)d+=n[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const f=l&&c-l;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(e,t){let n,r,o=0,s=1e3/t;const i=(t,s=Date.now())=>{o=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},s-a)))},()=>n&&i(n)]}(n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=s-r,c=o(a);r=s;e({loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},ut=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},dt=e=>(...t)=>Pe.asap(()=>e(...t)),ft=Xe.hasStandardBrowserEnv?/* @__PURE__ */((e,t)=>n=>(n=new URL(n,Xe.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Xe.origin),Xe.navigator&&/(msie|trident)/i.test(Xe.navigator.userAgent)):()=>!0,ht=Xe.hasStandardBrowserEnv?{write(e,t,n,r,o,s,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];Pe.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Pe.isString(r)&&a.push(`path=${r}`),Pe.isString(o)&&a.push(`domain=${o}`),!0===s&&a.push("secure"),Pe.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function mt(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const gt=e=>e instanceof ot?{...e}:e;function pt(e,t){t=t||{};const n={};function r(e,t,n,r){return Pe.isPlainObject(e)&&Pe.isPlainObject(t)?Pe.merge.call({caseless:r},e,t):Pe.isPlainObject(t)?Pe.merge({},t):Pe.isArray(t)?t.slice():t}function o(e,t,n,o){return Pe.isUndefined(t)?Pe.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!Pe.isUndefined(t))return r(void 0,t)}function i(e,t){return Pe.isUndefined(t)?Pe.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,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:(e,t,n)=>o(gt(e),gt(t),0,!0)};return Pe.forEach(Object.keys({...e,...t}),function(r){const s=c[r]||o,i=s(e[r],t[r],r);Pe.isUndefined(i)&&s!==a||(n[r]=i)}),n}const yt=e=>{const t=pt({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;if(t.headers=i=ot.from(i),t.url=qe(mt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Pe.isFormData(n))if(Xe.hasStandardBrowserEnv||Xe.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(Pe.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&i.set(e,n)})}if(Xe.hasStandardBrowserEnv&&(r&&Pe.isFunction(r)&&(r=r(t)),r||!1!==r&&ft(t.url))){const e=o&&s&&ht.read(s);e&&i.set(o,e)}return t},wt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=yt(e);let o=r.data;const s=ot.from(r.headers).normalize();let i,a,c,l,u,{responseType:d,onUploadProgress:f,onDownloadProgress:h}=r;function m(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let g=new XMLHttpRequest;function p(){if(!g)return;const r=ot.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());ct(function(e){t(e),m()},function(e){n(e),m()},{data:d&&"text"!==d&&"json"!==d?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=p:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(p)},g.onabort=function(){g&&(n(new Te("Request aborted",Te.ECONNABORTED,e,g)),g=null)},g.onerror=function(t){const r=new Te(t&&t.message?t.message:"Network Error",Te.ERR_NETWORK,e,g);r.event=t||null,n(r),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||ze;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Te(t,o.clarifyTimeoutError?Te.ETIMEDOUT:Te.ECONNABORTED,e,g)),g=null},void 0===o&&s.setContentType(null),"setRequestHeader"in g&&Pe.forEach(s.toJSON(),function(e,t){g.setRequestHeader(t,e)}),Pe.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),d&&"json"!==d&&(g.responseType=r.responseType),h&&([c,u]=lt(h,!0),g.addEventListener("progress",c)),f&&g.upload&&([a,l]=lt(f),g.upload.addEventListener("progress",a),g.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{g&&(n(!t||t.type?new at(null,e,g):t),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===Xe.protocols.indexOf(y)?n(new Te("Unsupported protocol "+y+":",Te.ERR_BAD_REQUEST,e)):g.send(o||null)})},bt=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Te?t:new at(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,o(new Te(`timeout ${t} of ms exceeded`,Te.ETIMEDOUT))},t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>Pe.asap(i),a}},_t=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},Ot=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},vt=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of Ot(e))yield*_t(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(t){throw a(t),t}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:Et}=Pe,St=(({Request:e,Response:t})=>({Request:e,Response:t}))(Pe.global),{ReadableStream:Rt,TextEncoder:Lt}=Pe.global,xt=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},Pt=e=>{e=Pe.merge.call({skipUndefined:!0},St,e);const{fetch:t,Request:n,Response:r}=e,o=t?Et(t):"function"==typeof fetch,s=Et(n),i=Et(r);if(!o)return!1;const a=o&&Et(Rt),c=o&&("function"==typeof Lt?/* @__PURE__ */(e=>t=>e.encode(t))(new Lt):async e=>new Uint8Array(await new n(e).arrayBuffer())),l=s&&a&&xt(()=>{let e=!1;const t=new n(Xe.origin,{body:new Rt,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),u=i&&a&&xt(()=>Pe.isReadableStream(new r("").body)),d={stream:u&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Te(`Response type '${e}' is not supported`,Te.ERR_NOT_SUPPORT,n)})});const f=async(e,t)=>{const r=Pe.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(Pe.isBlob(e))return e.size;if(Pe.isSpecCompliantForm(e)){const t=new n(Xe.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Pe.isArrayBufferView(e)||Pe.isArrayBuffer(e)?e.byteLength:(Pe.isURLSearchParams(e)&&(e+=""),Pe.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:i,data:a,signal:c,cancelToken:h,timeout:m,onDownloadProgress:g,onUploadProgress:p,responseType:y,headers:w,withCredentials:b="same-origin",fetchOptions:_}=yt(e),O=t||fetch;y=y?(y+"").toLowerCase():"text";let v=bt([c,h&&h.toAbortSignal()],m),E=null;const S=v&&v.unsubscribe&&(()=>{v.unsubscribe()});let R;try{if(p&&l&&"get"!==i&&"head"!==i&&0!==(R=await f(w,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if(Pe.isFormData(a)&&(e=t.headers.get("content-type"))&&w.setContentType(e),t.body){const[e,n]=ut(R,lt(dt(p)));a=vt(t.body,65536,e,n)}}Pe.isString(b)||(b=b?"include":"omit");const t=s&&"credentials"in n.prototype,c={..._,signal:v,method:i.toUpperCase(),headers:w.normalize().toJSON(),body:a,duplex:"half",credentials:t?b:void 0};E=s&&new n(o,c);let h=await(s?O(E,_):O(o,c));const m=u&&("stream"===y||"response"===y);if(u&&(g||m&&S)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=h[t]});const t=Pe.toFiniteNumber(h.headers.get("content-length")),[n,o]=g&&ut(t,lt(dt(g),!0))||[];h=new r(vt(h.body,65536,n,()=>{o&&o(),S&&S()}),e)}y=y||"text";let L=await d[Pe.findKey(d,y)||"text"](h,e);return!m&&S&&S(),await new Promise((t,n)=>{ct(t,n,{data:L,headers:ot.from(h.headers),status:h.status,statusText:h.statusText,config:e,request:E})})}catch(L){if(S&&S(),L&&"TypeError"===L.name&&/Load failed|fetch/i.test(L.message))throw Object.assign(new Te("Network Error",Te.ERR_NETWORK,e,E),{cause:L.cause||L});throw Te.from(L,L&&L.code,e,E)}}},Tt=/* @__PURE__ */new Map,kt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let i,a,c=s.length,l=Tt;for(;c--;)i=s[c],a=l.get(i),void 0===a&&l.set(i,a=c?/* @__PURE__ */new Map:Pt(t)),l=a;return a};kt();const Ut={http:null,xhr:wt,fetch:{get:kt}};Pe.forEach(Ut,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}});const Ct=e=>`- ${e}`,At=e=>Pe.isFunction(e)||null===e||!1===e;const jt={getAdapter:function(e,t){e=Pe.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let i=0;i<n;i++){let n;if(r=e[i],o=r,!At(r)&&(o=Ut[(n=String(r)).toLowerCase()],void 0===o))throw new Te(`Unknown adapter '${n}'`);if(o&&(Pe.isFunction(o)||(o=o.get(t))))break;s[n||"#"+i]=o}if(!o){const e=Object.entries(s).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new Te("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Ct).join("\n"):" "+Ct(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o},adapters:Ut};function Nt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new at(null,e)}function Bt(e){Nt(e),e.headers=ot.from(e.headers),e.data=st.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return jt.getAdapter(e.adapter||Qe.adapter,e)(e).then(function(t){return Nt(e),t.data=st.call(e,e.transformResponse,t),t.headers=ot.from(t.headers),t},function(t){return it(t)||(Nt(e),t&&t.response&&(t.response.data=st.call(e,e.transformResponse,t.response),t.response.headers=ot.from(t.response.headers))),Promise.reject(t)})}const It="1.13.2",Dt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Dt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Ft={};Dt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+It+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new Te(r(o," has been removed"+(t?" in "+t:"")),Te.ERR_DEPRECATED);return t&&!Ft[o]&&(Ft[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}},Dt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Mt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Te("options must be an object",Te.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new Te("option "+s+" must be "+n,Te.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Te("Unknown option "+s,Te.ERR_BAD_OPTION)}},validators:Dt},qt=Mt.validators;let Wt=class{constructor(e){this.defaults=e||{},this.interceptors={request:new We,response:new We}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";try{n.stack?t&&!String(n.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+t):n.stack=t}catch(r){}}throw n}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=pt(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Mt.assertOptions(n,{silentJSONParsing:qt.transitional(qt.boolean),forcedJSONParsing:qt.transitional(qt.boolean),clarifyTimeoutError:qt.transitional(qt.boolean)},!1),null!=r&&(Pe.isFunction(r)?t.paramsSerializer={serialize:r}:Mt.assertOptions(r,{encode:qt.function,serialize:qt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Mt.assertOptions(t,{baseUrl:qt.spelling("baseURL"),withXsrfToken:qt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&Pe.merge(o.common,o[t.method]);o&&Pe.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=ot.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,d=0;if(!a){const e=[Bt.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=i.length;let f=t;for(;d<u;){const e=i[d++],t=i[d++];try{f=e(f)}catch(h){t.call(this,h);break}}try{l=Bt.call(this,f)}catch(h){return Promise.reject(h)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return qe(mt((e=pt(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};Pe.forEach(["delete","get","head","options"],function(e){Wt.prototype[e]=function(t,n){return this.request(pt(n||{},{method:e,url:t,data:(n||{}).data}))}}),Pe.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(pt(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Wt.prototype[e]=t(),Wt.prototype[e+"Form"]=t(!0)});const zt={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(zt).forEach(([e,t])=>{zt[t]=e});const Gt=function e(t){const n=new Wt(t),r=M(Wt.prototype.request,n);return Pe.extend(r,Wt.prototype,n,{allOwnKeys:!0}),Pe.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(pt(t,n))},r}(Qe);Gt.Axios=Wt,Gt.CanceledError=at,Gt.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new at(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},Gt.isCancel=it,Gt.VERSION=It,Gt.toFormData=Be,Gt.AxiosError=Te,Gt.Cancel=Gt.CanceledError,Gt.all=function(e){return Promise.all(e)},Gt.spread=function(e){return function(t){return e.apply(null,t)}},Gt.isAxiosError=function(e){return Pe.isObject(e)&&!0===e.isAxiosError},Gt.mergeConfig=pt,Gt.AxiosHeaders=ot,Gt.formToJSON=e=>Ze(Pe.isHTMLForm(e)?new FormData(e):e),Gt.getAdapter=jt.getAdapter,Gt.HttpStatusCode=zt,Gt.default=Gt;const{Axios:Kt,AxiosError:Ht,CanceledError:Jt,isCancel:$t,CancelToken:Vt,VERSION:Xt,all:Zt,Cancel:Qt,isAxiosError:Yt,spread:en,toFormData:tn,AxiosHeaders:nn,HttpStatusCode:rn,formToJSON:on,getAdapter:sn,mergeConfig:an}=Gt,cn=m.getPar,ln=function(e,t){var n,r={v:"1.0.1",Device:0,SourceDevice:parseInt(cn("Device")||-1)};t&&(r._tui_source=((n=cn("_tui_source")||cn("from")||cn("source"))||(n=p.get("_tui_source")),n));var o=window.pdata||window.axiosData||window.reqData||{};return e=y(!0,r,o,e)},un=function(e,t,n){return n=ln(n,t),e=m.addPars(n,e)},dn=await g(),fn="imp_sign",hn="imp_useridx";m.getPar("useridx");var mn={error:0,success:1,ServerSignError:2,jumpTo:100,window:101,alert:150,msg:160,noMoney:170,noRealName:234,nologin:666};Gt.codeEnum=mn,Gt.defaults.baseURL="",Gt.defaults.withCredentials=!0,Gt.defaults.crossDomain=!0,Gt.defaults.dataType="json",Gt.saveLogin=function(e,t){dn.debug("写入sign:",t),p.set(fn,t),e&&p.set(hn,e)},Gt.interceptors.request.use(async function(e){dn.debug("请求拦截",e),function(e,t,n){var r;"post"===e.method?(e.data=e.data||{},r=e.data):(e.params=e.params||{},r=e.params),n&&(r[t]=n)}(e,"_tui_source",m.getPar("_tui_source")||m.getPar("from")||m.getPar("source")),un(e.url),"post"===e.method&&(e.data=m.jsonto(e.data).substring(1));const t=await h.runM("login","getLogin",[null,!0]);return t&&(e.headers[fn]=t.sign,e.headers[hn]=p.get(hn)),e},function(e){return Promise.reject(e)}),Gt.interceptors.response.use(async function(e){if(e.data&&"true"==e.headers["res-encrypt"]){const t=await Promise.all([F.init(),U()]),n=t[0],r=await n.parseRes(e,t[1]);null==r&&window.debug&&console.warn("响应数据解析异常",r),e=r||e}if(c.isString(e.data)){const t=new Error("接口:"+e.config.url+"返回了纯字符串数据:"+e.data);return Promise.reject(t)}switch(dn.debug("响应拦截 -> "+e.config.url+"\n",e),e.data.__source=e,(e=e.data).codeEnum=mn,e.isSuccess=function(t){return e.code!==mn.success&&(t||f.msg(e.msg)),e.code===mn.success},e.code){case mn.success:return Promise.resolve(e);case mn.jumpTo:return void(location.href=e.data);case mn.window:return!1!==Promise.resolve(e)&&window.open(e.data),Promise.reject(e);case mn.alert:case mn.msg:return f.msg(e.msg),Promise.reject(e);case mn.noRealName:return impall.showReal_name();case mn.ServerSignError:case mn.nologin:if(e.__source.config.isTwice)return h.runM("login","noLogin",[e]),Promise.resolve(e);const t=function(){return dn.debug("检测到未登录返回,发起验证登录之后,重新再请求一遍"),e.__source.config.isTwice=!0,e.__source.config.data=m.toData(e.__source.config.data),Gt(e.__source.config)};return await h.runM("login","checkLogin"),t()}return Promise.resolve(e)},function(e){return Promise.reject(e)});var gn=Gt.get;Gt.get=function(e,t,n){return(n=n||{}).params=t,gn(e,n)};const pn=await U(),yn=await s();class wn{constructor(){this.loginDomain=window.loginDomain="localhost"===location.hostname&&L().isLocalhost?"https://localhost:44360":pn.domainLogin,this.ver="v1.0.0",this.loginTime=21600,this.prefix="IMP_PLUG_LOGIN_",this.initUrls(),this.initKeys(),this.initEventKeys(),this.bindEvents(),this.iframeBox=null,this.iframe=null,this.iframeBg=null,this.autoLogin={},this.exitLogin={},this.threeLoginWin=null,this.isTempCheck=e.getPar(this.keys.url_tempSignKey)&&e.getPar(this.keys.url_tempUseridxKey),window.login=this}initUrls(){this.urls={login:un(this.loginDomain+"/index.html",!0),reg:un(this.loginDomain+"/index.html?type=reg",!0),loginPage:un(this.loginDomain+"/loginPage.html",!0),regPage:un(this.loginDomain+"/regPage.html",!0),autoLogin:un(this.loginDomain+"/"+this.ver+"/user/autoLogin"),checkSSOLogin:un(this.loginDomain+"/"+this.ver+"/user/checkSSOLogin"),checkLoginPage:un(this.loginDomain+"/"+this.ver+"/user/checkLoginPage"),CheckLoginByCode:un(this.loginDomain+"/"+this.ver+"/user/CheckLoginByCode"),exitLogin:this.loginDomain+"/"+this.ver+"/user/exitLogin",userInfo:this.loginDomain+"/"+this.ver+"/user/UserInfo",writeCookies:"/ashx/member/CheckSSOWriteCookie.ashx",webLoginOut:"/ajax/logout.aspx"}}initKeys(){const e=e=>this.prefix+e;this.keys={msg_loginReturn:e("loginReturn"),msg_close:e("close"),msg_goto:e("goto"),msg_autoSize:e("autoSize"),msg_getSize:e("getSize"),cache_loginSave:e("loginSave"),cache_userInfo:e("userInfo"),checkLogin_code:"code",loginStatus:"__login_status",loginResult:"__login_result",url_tempSignKey:"sign",url_tempUseridxKey:"useridx"}}initEventKeys(){const e=e=>this.prefix+e;this.eventKeys={nologin:e("login"),closeThreeLogin:e("close_login_three")}}bindEvents(){l.on(this.keys.msg_close,()=>{yn.debug("关闭登录框"),this.close()}),l.on(this.keys.msg_goto,e=>{this.handlePageTransition(e)}),l.on(this.keys.msg_autoSize,e=>{this.handleAutoSize(e)}),l.on(this.keys.msg_loginReturn,async e=>{await this.dealwithLoginRes(e)}),l.on(this.eventKeys.closeThreeLogin,e=>{this.save(e),this.closeThreeLoginWin()})}handlePageTransition(e){if(!this.iframe)return;this.iframe.classList.remove("IMP_PLUG_LOGIN_animateIn"),this.iframe.classList.add("IMP_PLUG_LOGIN_animateOut");const t=()=>{this.iframe.src=e.url,this.iframe.classList.remove("IMP_PLUG_LOGIN_animateOut"),this.iframe.removeEventListener("transitionend",t)};this.iframe.addEventListener("transitionend",t)}handleAutoSize(e){this.iframe&&(yn.debug("登录框尺寸适配",e),this.iframe.width=e.width,this.iframe.height=e.height,this.iframe.classList.add("IMP_PLUG_LOGIN_animateIn"),this.iframeBg.classList.add("IMP_PLUG_LOGIN_animateIn"))}runAutoLoginCallback(e,t){this.autoLogin.callbacks&&0!==this.autoLogin.callbacks.length&&(this.autoLogin.callbacks.forEach(t=>{if(u(e))t.ok&&t.ok(e);else{const n=this.getLogin(e);t.ok&&t.ok(n&&n.code===Gt.codeEnum.success)}}),this.autoLogin.iframe&&this.autoLogin.iframe.remove(),this.autoLogin.window&&this.autoLogin.window.close(),this.autoLogin={},e&&this.close())}async dealwithLoginRes(t){if(yn.debug("登录消息返回",t),t.isok=t.code===Gt.codeEnum.success,1!==t.code)return this.clear(),void this.runAutoLoginCallback(t);if(t.sign&&8===t.sign.length)this.save(t);else{e.delParsUpUrl([this.keys.url_tempSignKey,this.keys.url_tempUseridxKey]),d.set(this.keys.cache_loginSave,t,this.loginTime),Gt.saveLogin(t.useridx,t.sign);try{await Gt.get(this.urls.writeCookies,null,null,"text")}finally{this.runAutoLoginCallback(t)}}}save(e){const t=e.__source?.headers?.[e.sign]||e.data?.headers?.[e.sign]||e.sign,n=e.useridx||e.data?.___useridx;l.send(this.keys.msg_loginReturn,{code:e.code,msg:e.msg,sign:t,useridx:n})}clear(){d.remove(this.keys.cache_loginSave),d.remove(this.keys.cache_userInfo),d.remove(this.keys.cache_userInfo+"_more"),d.remove(this.keys.cache_userInfo+"_simplify")}onLoginOK(e,t){this.autoLogin.callbacks||(this.autoLogin.callbacks=[]),this.autoLogin.callbacks.push({ok:e,no:t})}create(e){const t=n(!0,{url:"",name:"",option:null},e);this.createIframeBox(),this.createIframe(t),this.applyStyles(t.option||{}),this.appendToDocument()}createIframeBox(){this.iframeBox=document.createElement("div"),this.iframeBox.className="IMP_PLUG_LOGIN_box";const e=parseFloat(window.getComputedStyle(document.documentElement).zoom);e<1&&(this.iframeBox.style.zoom=(1/e).toFixed(2)),this.iframe=document.createElement("iframe"),this.iframeBg=document.createElement("div")}createIframe(e){this.iframe.id=this.iframe.name=e.name,this.iframe.src=e.url;const t=e.option||{};this.iframe.width=t.width||400,this.iframe.height=t.height||400,this.iframe.scrolling=t.scrolling||"no",this.iframe.marginWidth=t.marginWidth||"0",this.iframe.marginHeight=t.marginHeight||"0",this.iframe.frameBorder=t.frameBorder||"0"}applyStyles(e){Object.assign(this.iframe.style,{zIndex:3e3,position:"fixed",borderRadius:e.radius||"none",opacity:0}),Object.assign(this.iframeBg.style,{position:"fixed",backgroundColor:"#6f6f6f80",width:"100%",height:"100%",top:0,left:0,opacity:0}),this.applyPosition(e.offset||"center"),this.applyAnimation(e)}applyPosition(e){const t={center:{top:"50%",left:"50%",transform:"translate(-50%, -50%)"},top:{top:"5%",left:"50%",transform:"translateX(-50%)"},bottom:{bottom:"5%",left:"50%",transform:"translateX(-50%)"},lt:{top:"5%",left:"5%"},lb:{bottom:"5%",left:"5%"},rt:{top:"5%",right:"5%"},rb:{bottom:"5%",right:"5%"}},n=t[e]||t.center;Object.assign(this.iframe.style,n)}applyAnimation(e){const t=e.animTime||300;this.iframe.style.transition=`opacity ${t}ms`,this.iframeBg.style.transition=`opacity ${t}ms`,this.createAnimationStyles(e.anime||0)}createAnimationStyles(e){const t={0:".IMP_PLUG_LOGIN_animateIn{opacity:1 !important;} .IMP_PLUG_LOGIN_animateOut{opacity:0 !important;}"},n=t[e]||t[0],r=document.createElement("style");r.id="IMP_PLUG_LOGIN_animateCss";try{r.appendChild(document.createTextNode(n))}catch(o){r.styleSheet.cssText=n}document.head.appendChild(r)}appendToDocument(){this.iframeBox.append(this.iframe),this.iframeBox.append(this.iframeBg),document.body.append(this.iframeBox)}istop(){return parent===window}close(){if(!this.istop())return;const e=()=>{this.iframeBox&&(this.iframeBox.remove(),this.iframeBox=null),this.autoLogin.iframe&&this.autoLogin.iframe.remove();const e=document.getElementById("IMP_PLUG_LOGIN_animateCss");e&&e.remove()};this.iframeBg&&(this.iframeBg.classList.remove("IMP_PLUG_LOGIN_animateIn"),this.iframeBg.classList.add("IMP_PLUG_LOGIN_animateOut")),this.iframe?(this.iframe.classList.remove("IMP_PLUG_LOGIN_animateIn"),this.iframe.classList.add("IMP_PLUG_LOGIN_animateOut"),this.iframe.addEventListener("transitionend",e,{once:!0})):e()}autoSize(e,t){l.send(this.keys.msg_autoSize,{width:e||document.body.scrollWidth,height:t||document.body.scrollHeight})}open(e=!1){if(this.iframeBox)return Promise.resolve();const t=new Promise((e,t)=>{this.onLoginOK(e,t),this.istop()?this.create({url:this.urls.login,name:"signIn",option:{radius:"4px"}}):l.send(this.keys.msg_goto,{url:this.urls.login})});return e?t:t.then(()=>location.reload())}openPage(){const t=e.getPar("sourceurl")||location.href,n=e.addPar("sourceurl",unescape(t),this.urls.loginPage);location.href=n}openReg(e=!1){if(this.iframeBox)return Promise.resolve();const t=new Promise((e,t)=>{this.onLoginOK(e,t),this.istop()?this.create({url:this.urls.reg,name:"signIn",option:{radius:"4px"}}):l.send(this.keys.msg_goto,{url:this.urls.reg})});return e?t:t.then(()=>location.reload())}openRegPage(){const t=e.getPar("sourceurl")||location.href,n=e.addPar("sourceurl",unescape(t),this.urls.regPage);location.href=n}threeLogin(e,t){return new Promise((n,r)=>{this.closeThreeLoginWin(),this.onLoginOK(n,r);const o=un(`/v1.0.0/user/OpenThreeLogin?type=${e}`,t);this.threeLoginWin=window.open(o)})}closeThreeLoginWin(){this.threeLoginWin&&(this.threeLoginWin.close(),this.threeLoginWin=null)}getWechatCode(){const t=e.getPar("__login_code");if(!t){const e=`${this.loginDomain}/v1.0.0/user/OpenThreeLogin?type=wechatcode&redirect_uri=${encodeURIComponent(location.href)}`;location.href=e}return t}getLogin(e,t=!1){const n=e||d.get(this.keys.cache_loginSave);return n?(t||delete n.sign,n):null}getUser(e,t=!1,n=!1){"function"!=typeof e&&(n=t,t=e,e=null);const r=new Promise((e,r)=>{const o=this.keys.cache_userInfo+"_"+(t?"more":"simplify");if(!n){const t=d.get(o);if(t)return void e(t)}Gt.get(this.urls.userInfo,{more:t?1:0}).then(t=>{1===t.code?(d.set(o,t.data,this.loginTime),e(t.data)):r(t)})});return e?r.then(e):r}islogin(){return!!this.getLogin()}async check(){return!(this.isTempCheck||!this.islogin())||this.checkZ()}checkZ(){return new Promise((t,n)=>{if(!this.autoLogin.iframe&&!this.autoLogin.window){let t=this.urls.autoLogin;t=e.addPars({sign:e.getPar(this.keys.url_tempSignKey),useridx:e.getPar(this.keys.url_tempUseridxKey)},t),this.autoLogin.iframe=this.getIframeUrl(t,this.keys.msg_loginReturn),this.autoLogin.callbacks=[]}this.autoLogin.callbacks.push({ok:t,no:()=>{t(!1)}})})}checkPage(){return new Promise((t,n)=>{const r=e.getPar(this.keys.checkLogin_code),o=parseInt(e.getPar(this.keys.loginStatus)||-1);yn.debug("checkLogin_code:",r),0===o?(e.delParsUpUrl([this.keys.loginStatus]),n("用户未登录!")):o&&r?Gt.get(this.urls.CheckLoginByCode,{code:r}).then(r=>{1===r.code?(e.delParsUpUrl([this.keys.checkLogin_code,this.keys.loginStatus]),this.save(r.data),t(r)):n()}):Gt.get(this.urls.checkSSOLogin).then(n=>{if(1===n.code)this.getUser().then(t);else{let t=e.addPars({redirect_uri:encodeURIComponent(location.href)},this.urls.checkLoginPage);location.href=t}})})}res(t){const n=decodeURIComponent(e.getPar(this.keys.loginResult)||"");if(n){const r=JSON.parse(n);t?.(r),e.delParsUpUrl([this.keys.loginResult])}}exit(e=!1){return yn.debug("退出登录!"),this.exitLogin.Promise||(this.exitLogin.Promise=new Promise(e=>{w.get(this.urls.exitLogin).then(t=>{b(this.urls.webLoginOut,null,()=>{e(t)},"text"),this.clear(),this.exitLogin={}})}),e||(this.exitLogin.Promise=this.exitLogin.Promise.then(()=>{location.reload()}))),this.exitLogin.Promise}getIframeUrl(t,n){const r=document.createElement("iframe");Object.assign(r.style,{position:"absolute",width:"1px",height:"1px",top:"-100px"}),r.dataset.flag=9513,n&&(t=e.addPar("post_msg_name",n,t)),r.src=t;let o,s=!1;const i=()=>{r.removeEventListener("error",a),clearTimeout(o)},a=e=>{s||(s=!0,i(),r.remove(),this.runAutoLoginCallback(!1))};return r.addEventListener("load",e=>{console.log("iframe loaded",e),s||(s=!0,i(),console.log("缓存数据已保存"))},{once:!0}),r.addEventListener("error",a,{once:!0}),o=setTimeout(()=>{a()},1e4),document.body.append(r),r}onNoLogin(e){h?h.on(this.eventKeys.nologin,e):console.warn("事件模块event未加载,事件相关功能不可用!")}runNoLogin(e){return h?Promise.resolve(h.run(this.eventKeys.nologin,e)):(console.warn("事件模块event未加载,事件相关功能不可用!"),Promise.resolve())}writeXhr(e){if(!e)return console.warn("xhr不能为空!"),e;const t=this.getLogin(null,!0);return t&&(e.withCredentials=!0,e.setRequestHeader("imp_sign",t.sign),e.setRequestHeader("imp_useridx",t.useridx)),e}debug(...e){console&&console.debug&&console.debug(...e)}}const bn=new wn;export{wn as Login,Gt as axios,P as getAllConfig,A as getApiurl,x as getCodeVer,U as getConfig,T as getDomainConfig,L as getEvnConfig,k as getSimplifyConfig,F as gotool,un as handleUrl,bn as login};
|