import { unref as Dt, getCurrentScope as vt, onScopeDispose as It, ref as te, watch as Ae } from "vue";
import { encryption as Bt } from "@das-fed/utils/atob";
import { getConfig as _e } from "@das-fed/utils/config";
import { getAccessToken as H, removeAccessToken as jt, setAccessToken as qt, getAccessTokenInfo as fe } from "@das-fed/utils/token-tools";
import { appendQueryParams as nt } from "@das-fed/utils/common-tools";
import { removeProcessEngineToken as Mt, setProcessEngineToken as Ht } from "@das-fed/utils/process-engine-info";
import { setPersonalInfo as rt } from "@das-fed/utils/common-info/set-personal-info";
function ot(e, t) {
  return function() {
    return e.apply(t, arguments);
  };
}
const { toString: $t } = Object.prototype, { getPrototypeOf: xe } = Object, { iterator: oe, toStringTag: st } = Symbol, se = /* @__PURE__ */ ((e) => (t) => {
  const n = $t.call(t);
  return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), x = (e) => (e = e.toLowerCase(), (t) => se(t) === e), ie = (e) => (t) => typeof t === e, { isArray: v } = Array, $ = ie("undefined");
function J(e) {
  return e !== null && !$(e) && e.constructor !== null && !$(e.constructor) && A(e.constructor.isBuffer) && e.constructor.isBuffer(e);
}
const it = x("ArrayBuffer");
function zt(e) {
  let t;
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && it(e.buffer), t;
}
const Jt = ie("string"), A = ie("function"), at = ie("number"), V = (e) => e !== null && typeof e == "object", Vt = (e) => e === !0 || e === !1, Z = (e) => {
  if (se(e) !== "object")
    return !1;
  const t = xe(e);
  return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(st in e) && !(oe in e);
}, Wt = (e) => {
  if (!V(e) || J(e))
    return !1;
  try {
    return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
  } catch {
    return !1;
  }
}, Kt = x("Date"), Qt = x("File"), Xt = x("Blob"), Gt = x("FileList"), Zt = (e) => V(e) && A(e.pipe), Yt = (e) => {
  let t;
  return e && (typeof FormData == "function" && e instanceof FormData || A(e.append) && ((t = se(e)) === "formdata" || // detect form-data instance
  t === "object" && A(e.toString) && e.toString() === "[object FormData]"));
}, en = x("URLSearchParams"), [tn, nn, rn, on] = ["ReadableStream", "Request", "Response", "Headers"].map(x), sn = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function W(e, t, { allOwnKeys: n = !1 } = {}) {
  if (e === null || typeof e > "u")
    return;
  let r, o;
  if (typeof e != "object" && (e = [e]), v(e))
    for (r = 0, o = e.length; r < o; r++)
      t.call(null, e[r], r, e);
  else {
    if (J(e))
      return;
    const s = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = s.length;
    let c;
    for (r = 0; r < i; r++)
      c = s[r], t.call(null, e[c], c, e);
  }
}
function ct(e, t) {
  if (J(e))
    return null;
  t = t.toLowerCase();
  const n = Object.keys(e);
  let r = n.length, o;
  for (; r-- > 0; )
    if (o = n[r], t === o.toLowerCase())
      return o;
  return null;
}
const U = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, ut = (e) => !$(e) && e !== U;
function ye() {
  const { caseless: e } = ut(this) && this || {}, t = {}, n = (r, o) => {
    const s = e && ct(t, o) || o;
    Z(t[s]) && Z(r) ? t[s] = ye(t[s], r) : Z(r) ? t[s] = ye({}, r) : v(r) ? t[s] = r.slice() : t[s] = r;
  };
  for (let r = 0, o = arguments.length; r < o; r++)
    arguments[r] && W(arguments[r], n);
  return t;
}
const an = (e, t, n, { allOwnKeys: r } = {}) => (W(t, (o, s) => {
  n && A(o) ? e[s] = ot(o, n) : e[s] = o;
}, { allOwnKeys: r }), e), cn = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), un = (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);
}, ln = (e, t, n, r) => {
  let o, s, i;
  const c = {};
  if (t = t || {}, e == null) return t;
  do {
    for (o = Object.getOwnPropertyNames(e), s = o.length; s-- > 0; )
      i = o[s], (!r || r(i, e, t)) && !c[i] && (t[i] = e[i], c[i] = !0);
    e = n !== !1 && xe(e);
  } while (e && (!n || n(e, t)) && e !== Object.prototype);
  return t;
}, fn = (e, t, n) => {
  e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
  const r = e.indexOf(t, n);
  return r !== -1 && r === n;
}, dn = (e) => {
  if (!e) return null;
  if (v(e)) return e;
  let t = e.length;
  if (!at(t)) return null;
  const n = new Array(t);
  for (; t-- > 0; )
    n[t] = e[t];
  return n;
}, pn = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && xe(Uint8Array)), hn = (e, t) => {
  const r = (e && e[oe]).call(e);
  let o;
  for (; (o = r.next()) && !o.done; ) {
    const s = o.value;
    t.call(e, s[0], s[1]);
  }
}, mn = (e, t) => {
  let n;
  const r = [];
  for (; (n = e.exec(t)) !== null; )
    r.push(n);
  return r;
}, yn = x("HTMLFormElement"), wn = (e) => e.toLowerCase().replace(
  /[-_\s]([a-z\d])(\w*)/g,
  function(n, r, o) {
    return r.toUpperCase() + o;
  }
), Ue = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), gn = x("RegExp"), lt = (e, t) => {
  const n = Object.getOwnPropertyDescriptors(e), r = {};
  W(n, (o, s) => {
    let i;
    (i = t(o, s, e)) !== !1 && (r[s] = i || o);
  }), Object.defineProperties(e, r);
}, bn = (e) => {
  lt(e, (t, n) => {
    if (A(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
      return !1;
    const r = e[n];
    if (A(r)) {
      if (t.enumerable = !1, "writable" in t) {
        t.writable = !1;
        return;
      }
      t.set || (t.set = () => {
        throw Error("Can not rewrite read-only method '" + n + "'");
      });
    }
  });
}, En = (e, t) => {
  const n = {}, r = (o) => {
    o.forEach((s) => {
      n[s] = !0;
    });
  };
  return v(e) ? r(e) : r(String(e).split(t)), n;
}, Sn = () => {
}, Rn = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
function Tn(e) {
  return !!(e && A(e.append) && e[st] === "FormData" && e[oe]);
}
const On = (e) => {
  const t = new Array(10), n = (r, o) => {
    if (V(r)) {
      if (t.indexOf(r) >= 0)
        return;
      if (J(r))
        return r;
      if (!("toJSON" in r)) {
        t[o] = r;
        const s = v(r) ? [] : {};
        return W(r, (i, c) => {
          const f = n(i, o + 1);
          !$(f) && (s[c] = f);
        }), t[o] = void 0, s;
      }
    }
    return r;
  };
  return n(e, 0);
}, An = x("AsyncFunction"), _n = (e) => e && (V(e) || A(e)) && A(e.then) && A(e.catch), ft = ((e, t) => e ? setImmediate : t ? ((n, r) => (U.addEventListener("message", ({ source: o, data: s }) => {
  o === U && s === n && r.length && r.shift()();
}, !1), (o) => {
  r.push(o), U.postMessage(n, "*");
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
  typeof setImmediate == "function",
  A(U.postMessage)
), xn = typeof queueMicrotask < "u" ? queueMicrotask.bind(U) : typeof process < "u" && process.nextTick || ft, kn = (e) => e != null && A(e[oe]), a = {
  isArray: v,
  isArrayBuffer: it,
  isBuffer: J,
  isFormData: Yt,
  isArrayBufferView: zt,
  isString: Jt,
  isNumber: at,
  isBoolean: Vt,
  isObject: V,
  isPlainObject: Z,
  isEmptyObject: Wt,
  isReadableStream: tn,
  isRequest: nn,
  isResponse: rn,
  isHeaders: on,
  isUndefined: $,
  isDate: Kt,
  isFile: Qt,
  isBlob: Xt,
  isRegExp: gn,
  isFunction: A,
  isStream: Zt,
  isURLSearchParams: en,
  isTypedArray: pn,
  isFileList: Gt,
  forEach: W,
  merge: ye,
  extend: an,
  trim: sn,
  stripBOM: cn,
  inherits: un,
  toFlatObject: ln,
  kindOf: se,
  kindOfTest: x,
  endsWith: fn,
  toArray: dn,
  forEachEntry: hn,
  matchAll: mn,
  isHTMLForm: yn,
  hasOwnProperty: Ue,
  hasOwnProp: Ue,
  // an alias to avoid ESLint no-prototype-builtins detection
  reduceDescriptors: lt,
  freezeMethods: bn,
  toObjectSet: En,
  toCamelCase: wn,
  noop: Sn,
  toFiniteNumber: Rn,
  findKey: ct,
  global: U,
  isContextDefined: ut,
  isSpecCompliantForm: Tn,
  toJSONObject: On,
  isAsyncFn: An,
  isThenable: _n,
  setImmediate: ft,
  asap: xn,
  isIterable: kn
};
function y(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);
}
a.inherits(y, Error, {
  toJSON: function() {
    return {
      // Standard
      message: this.message,
      name: this.name,
      // Microsoft
      description: this.description,
      number: this.number,
      // Mozilla
      fileName: this.fileName,
      lineNumber: this.lineNumber,
      columnNumber: this.columnNumber,
      stack: this.stack,
      // Axios
      config: a.toJSONObject(this.config),
      code: this.code,
      status: this.status
    };
  }
});
const dt = y.prototype, pt = {};
[
  "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"
  // eslint-disable-next-line func-names
].forEach((e) => {
  pt[e] = { value: e };
});
Object.defineProperties(y, pt);
Object.defineProperty(dt, "isAxiosError", { value: !0 });
y.from = (e, t, n, r, o, s) => {
  const i = Object.create(dt);
  return a.toFlatObject(e, i, function(f) {
    return f !== Error.prototype;
  }, (c) => c !== "isAxiosError"), y.call(i, e.message, t, n, r, o), i.cause = e, i.name = e.name, s && Object.assign(i, s), i;
};
const Cn = null;
function we(e) {
  return a.isPlainObject(e) || a.isArray(e);
}
function ht(e) {
  return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
}
function Ne(e, t, n) {
  return e ? e.concat(t).map(function(o, s) {
    return o = ht(o), !n && s ? "[" + o + "]" : o;
  }).join(n ? "." : "") : t;
}
function Pn(e) {
  return a.isArray(e) && !e.some(we);
}
const Ln = a.toFlatObject(a, {}, null, function(t) {
  return /^is[A-Z]/.test(t);
});
function ae(e, t, n) {
  if (!a.isObject(e))
    throw new TypeError("target must be an object");
  t = t || new FormData(), n = a.toFlatObject(n, {
    metaTokens: !0,
    dots: !1,
    indexes: !1
  }, !1, function(m, h) {
    return !a.isUndefined(h[m]);
  });
  const r = n.metaTokens, o = n.visitor || u, s = n.dots, i = n.indexes, f = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
  if (!a.isFunction(o))
    throw new TypeError("visitor must be a function");
  function l(p) {
    if (p === null) return "";
    if (a.isDate(p))
      return p.toISOString();
    if (a.isBoolean(p))
      return p.toString();
    if (!f && a.isBlob(p))
      throw new y("Blob is not supported. Use a Buffer instead.");
    return a.isArrayBuffer(p) || a.isTypedArray(p) ? f && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
  }
  function u(p, m, h) {
    let E = p;
    if (p && !h && typeof p == "object") {
      if (a.endsWith(m, "{}"))
        m = r ? m : m.slice(0, -2), p = JSON.stringify(p);
      else if (a.isArray(p) && Pn(p) || (a.isFileList(p) || a.endsWith(m, "[]")) && (E = a.toArray(p)))
        return m = ht(m), E.forEach(function(R, C) {
          !(a.isUndefined(R) || R === null) && t.append(
            // eslint-disable-next-line no-nested-ternary
            i === !0 ? Ne([m], C, s) : i === null ? m : m + "[]",
            l(R)
          );
        }), !1;
    }
    return we(p) ? !0 : (t.append(Ne(h, m, s), l(p)), !1);
  }
  const d = [], w = Object.assign(Ln, {
    defaultVisitor: u,
    convertValue: l,
    isVisitable: we
  });
  function g(p, m) {
    if (!a.isUndefined(p)) {
      if (d.indexOf(p) !== -1)
        throw Error("Circular reference detected in " + m.join("."));
      d.push(p), a.forEach(p, function(E, S) {
        (!(a.isUndefined(E) || E === null) && o.call(
          t,
          E,
          a.isString(S) ? S.trim() : S,
          m,
          w
        )) === !0 && g(E, m ? m.concat(S) : [S]);
      }), d.pop();
    }
  }
  if (!a.isObject(e))
    throw new TypeError("data must be an object");
  return g(e), t;
}
function Fe(e) {
  const t = {
    "!": "%21",
    "'": "%27",
    "(": "%28",
    ")": "%29",
    "~": "%7E",
    "%20": "+",
    "%00": "\0"
  };
  return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
    return t[r];
  });
}
function ke(e, t) {
  this._pairs = [], e && ae(e, this, t);
}
const mt = ke.prototype;
mt.append = function(t, n) {
  this._pairs.push([t, n]);
};
mt.toString = function(t) {
  const n = t ? function(r) {
    return t.call(this, r, Fe);
  } : Fe;
  return this._pairs.map(function(o) {
    return n(o[0]) + "=" + n(o[1]);
  }, "").join("&");
};
function Un(e) {
  return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
}
function yt(e, t, n) {
  if (!t)
    return e;
  const r = n && n.encode || Un;
  a.isFunction(n) && (n = {
    serialize: n
  });
  const o = n && n.serialize;
  let s;
  if (o ? s = o(t, n) : s = a.isURLSearchParams(t) ? t.toString() : new ke(t, n).toString(r), s) {
    const i = e.indexOf("#");
    i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + s;
  }
  return e;
}
class De {
  constructor() {
    this.handlers = [];
  }
  /**
   * Add a new interceptor to the stack
   *
   * @param {Function} fulfilled The function to handle `then` for a `Promise`
   * @param {Function} rejected The function to handle `reject` for a `Promise`
   *
   * @return {Number} An ID used to remove interceptor later
   */
  use(t, n, r) {
    return this.handlers.push({
      fulfilled: t,
      rejected: n,
      synchronous: r ? r.synchronous : !1,
      runWhen: r ? r.runWhen : null
    }), this.handlers.length - 1;
  }
  /**
   * Remove an interceptor from the stack
   *
   * @param {Number} id The ID that was returned by `use`
   *
   * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
   */
  eject(t) {
    this.handlers[t] && (this.handlers[t] = null);
  }
  /**
   * Clear all interceptors from the stack
   *
   * @returns {void}
   */
  clear() {
    this.handlers && (this.handlers = []);
  }
  /**
   * Iterate over all the registered interceptors
   *
   * This method is particularly useful for skipping over any
   * interceptors that may have become `null` calling `eject`.
   *
   * @param {Function} fn The function to call for each interceptor
   *
   * @returns {void}
   */
  forEach(t) {
    a.forEach(this.handlers, function(r) {
      r !== null && t(r);
    });
  }
}
const wt = {
  silentJSONParsing: !0,
  forcedJSONParsing: !0,
  clarifyTimeoutError: !1
}, Nn = typeof URLSearchParams < "u" ? URLSearchParams : ke, Fn = typeof FormData < "u" ? FormData : null, Dn = typeof Blob < "u" ? Blob : null, vn = {
  isBrowser: !0,
  classes: {
    URLSearchParams: Nn,
    FormData: Fn,
    Blob: Dn
  },
  protocols: ["http", "https", "file", "blob", "url", "data"]
}, Ce = typeof window < "u" && typeof document < "u", ge = typeof navigator == "object" && navigator || void 0, In = Ce && (!ge || ["ReactNative", "NativeScript", "NS"].indexOf(ge.product) < 0), Bn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", jn = Ce && window.location.href || "http://localhost", qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  hasBrowserEnv: Ce,
  hasStandardBrowserEnv: In,
  hasStandardBrowserWebWorkerEnv: Bn,
  navigator: ge,
  origin: jn
}, Symbol.toStringTag, { value: "Module" })), T = {
  ...qn,
  ...vn
};
function Mn(e, t) {
  return ae(e, new T.classes.URLSearchParams(), {
    visitor: function(n, r, o, s) {
      return T.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
    },
    ...t
  });
}
function Hn(e) {
  return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
}
function $n(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;
}
function gt(e) {
  function t(n, r, o, s) {
    let i = n[s++];
    if (i === "__proto__") return !0;
    const c = Number.isFinite(+i), f = s >= n.length;
    return i = !i && a.isArray(o) ? o.length : i, f ? (a.hasOwnProp(o, i) ? o[i] = [o[i], r] : o[i] = r, !c) : ((!o[i] || !a.isObject(o[i])) && (o[i] = []), t(n, r, o[i], s) && a.isArray(o[i]) && (o[i] = $n(o[i])), !c);
  }
  if (a.isFormData(e) && a.isFunction(e.entries)) {
    const n = {};
    return a.forEachEntry(e, (r, o) => {
      t(Hn(r), o, n, 0);
    }), n;
  }
  return null;
}
function zn(e, t, n) {
  if (a.isString(e))
    try {
      return (t || JSON.parse)(e), a.trim(e);
    } catch (r) {
      if (r.name !== "SyntaxError")
        throw r;
    }
  return (n || JSON.stringify)(e);
}
const K = {
  transitional: wt,
  adapter: ["xhr", "http", "fetch"],
  transformRequest: [function(t, n) {
    const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, s = a.isObject(t);
    if (s && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
      return o ? JSON.stringify(gt(t)) : t;
    if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t) || a.isReadableStream(t))
      return t;
    if (a.isArrayBufferView(t))
      return t.buffer;
    if (a.isURLSearchParams(t))
      return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
    let c;
    if (s) {
      if (r.indexOf("application/x-www-form-urlencoded") > -1)
        return Mn(t, this.formSerializer).toString();
      if ((c = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
        const f = this.env && this.env.FormData;
        return ae(
          c ? { "files[]": t } : t,
          f && new f(),
          this.formSerializer
        );
      }
    }
    return s || o ? (n.setContentType("application/json", !1), zn(t)) : t;
  }],
  transformResponse: [function(t) {
    const n = this.transitional || K.transitional, r = n && n.forcedJSONParsing, o = this.responseType === "json";
    if (a.isResponse(t) || a.isReadableStream(t))
      return t;
    if (t && a.isString(t) && (r && !this.responseType || o)) {
      const i = !(n && n.silentJSONParsing) && o;
      try {
        return JSON.parse(t);
      } catch (c) {
        if (i)
          throw c.name === "SyntaxError" ? y.from(c, y.ERR_BAD_RESPONSE, this, null, this.response) : c;
      }
    }
    return t;
  }],
  /**
   * A timeout in milliseconds to abort a request. If set to 0 (default) a
   * timeout is not created.
   */
  timeout: 0,
  xsrfCookieName: "XSRF-TOKEN",
  xsrfHeaderName: "X-XSRF-TOKEN",
  maxContentLength: -1,
  maxBodyLength: -1,
  env: {
    FormData: T.classes.FormData,
    Blob: T.classes.Blob
  },
  validateStatus: function(t) {
    return t >= 200 && t < 300;
  },
  headers: {
    common: {
      Accept: "application/json, text/plain, */*",
      "Content-Type": void 0
    }
  }
};
a.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
  K.headers[e] = {};
});
const Jn = a.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"
]), Vn = (e) => {
  const t = {};
  let n, r, o;
  return e && e.split(`
`).forEach(function(i) {
    o = i.indexOf(":"), n = i.substring(0, o).trim().toLowerCase(), r = i.substring(o + 1).trim(), !(!n || t[n] && Jn[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
  }), t;
}, ve = Symbol("internals");
function B(e) {
  return e && String(e).trim().toLowerCase();
}
function Y(e) {
  return e === !1 || e == null ? e : a.isArray(e) ? e.map(Y) : String(e);
}
function Wn(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;
}
const Kn = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
function de(e, t, n, r, o) {
  if (a.isFunction(r))
    return r.call(this, t, n);
  if (o && (t = n), !!a.isString(t)) {
    if (a.isString(r))
      return t.indexOf(r) !== -1;
    if (a.isRegExp(r))
      return r.test(t);
  }
}
function Qn(e) {
  return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
}
function Xn(e, t) {
  const n = a.toCamelCase(" " + t);
  ["get", "set", "has"].forEach((r) => {
    Object.defineProperty(e, r + n, {
      value: function(o, s, i) {
        return this[r].call(this, t, o, s, i);
      },
      configurable: !0
    });
  });
}
let _ = class {
  constructor(t) {
    t && this.set(t);
  }
  set(t, n, r) {
    const o = this;
    function s(c, f, l) {
      const u = B(f);
      if (!u)
        throw new Error("header name must be a non-empty string");
      const d = a.findKey(o, u);
      (!d || o[d] === void 0 || l === !0 || l === void 0 && o[d] !== !1) && (o[d || f] = Y(c));
    }
    const i = (c, f) => a.forEach(c, (l, u) => s(l, u, f));
    if (a.isPlainObject(t) || t instanceof this.constructor)
      i(t, n);
    else if (a.isString(t) && (t = t.trim()) && !Kn(t))
      i(Vn(t), n);
    else if (a.isObject(t) && a.isIterable(t)) {
      let c = {}, f, l;
      for (const u of t) {
        if (!a.isArray(u))
          throw TypeError("Object iterator must return a key-value pair");
        c[l = u[0]] = (f = c[l]) ? a.isArray(f) ? [...f, u[1]] : [f, u[1]] : u[1];
      }
      i(c, n);
    } else
      t != null && s(n, t, r);
    return this;
  }
  get(t, n) {
    if (t = B(t), t) {
      const r = a.findKey(this, t);
      if (r) {
        const o = this[r];
        if (!n)
          return o;
        if (n === !0)
          return Wn(o);
        if (a.isFunction(n))
          return n.call(this, o, r);
        if (a.isRegExp(n))
          return n.exec(o);
        throw new TypeError("parser must be boolean|regexp|function");
      }
    }
  }
  has(t, n) {
    if (t = B(t), t) {
      const r = a.findKey(this, t);
      return !!(r && this[r] !== void 0 && (!n || de(this, this[r], r, n)));
    }
    return !1;
  }
  delete(t, n) {
    const r = this;
    let o = !1;
    function s(i) {
      if (i = B(i), i) {
        const c = a.findKey(r, i);
        c && (!n || de(r, r[c], c, n)) && (delete r[c], o = !0);
      }
    }
    return a.isArray(t) ? t.forEach(s) : s(t), o;
  }
  clear(t) {
    const n = Object.keys(this);
    let r = n.length, o = !1;
    for (; r--; ) {
      const s = n[r];
      (!t || de(this, this[s], s, t, !0)) && (delete this[s], o = !0);
    }
    return o;
  }
  normalize(t) {
    const n = this, r = {};
    return a.forEach(this, (o, s) => {
      const i = a.findKey(r, s);
      if (i) {
        n[i] = Y(o), delete n[s];
        return;
      }
      const c = t ? Qn(s) : String(s).trim();
      c !== s && delete n[s], n[c] = Y(o), r[c] = !0;
    }), this;
  }
  concat(...t) {
    return this.constructor.concat(this, ...t);
  }
  toJSON(t) {
    const n = /* @__PURE__ */ Object.create(null);
    return a.forEach(this, (r, o) => {
      r != null && r !== !1 && (n[o] = t && a.isArray(r) ? r.join(", ") : r);
    }), n;
  }
  [Symbol.iterator]() {
    return Object.entries(this.toJSON())[Symbol.iterator]();
  }
  toString() {
    return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
`);
  }
  getSetCookie() {
    return this.get("set-cookie") || [];
  }
  get [Symbol.toStringTag]() {
    return "AxiosHeaders";
  }
  static from(t) {
    return t instanceof this ? t : new this(t);
  }
  static concat(t, ...n) {
    const r = new this(t);
    return n.forEach((o) => r.set(o)), r;
  }
  static accessor(t) {
    const r = (this[ve] = this[ve] = {
      accessors: {}
    }).accessors, o = this.prototype;
    function s(i) {
      const c = B(i);
      r[c] || (Xn(o, i), r[c] = !0);
    }
    return a.isArray(t) ? t.forEach(s) : s(t), this;
  }
};
_.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
a.reduceDescriptors(_.prototype, ({ value: e }, t) => {
  let n = t[0].toUpperCase() + t.slice(1);
  return {
    get: () => e,
    set(r) {
      this[n] = r;
    }
  };
});
a.freezeMethods(_);
function pe(e, t) {
  const n = this || K, r = t || n, o = _.from(r.headers);
  let s = r.data;
  return a.forEach(e, function(c) {
    s = c.call(n, s, o.normalize(), t ? t.status : void 0);
  }), o.normalize(), s;
}
function bt(e) {
  return !!(e && e.__CANCEL__);
}
function I(e, t, n) {
  y.call(this, e ?? "canceled", y.ERR_CANCELED, t, n), this.name = "CanceledError";
}
a.inherits(I, y, {
  __CANCEL__: !0
});
function Et(e, t, n) {
  const r = n.config.validateStatus;
  !n.status || !r || r(n.status) ? e(n) : t(new y(
    "Request failed with status code " + n.status,
    [y.ERR_BAD_REQUEST, y.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
    n.config,
    n.request,
    n
  ));
}
function Gn(e) {
  const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
  return t && t[1] || "";
}
function Zn(e, t) {
  e = e || 10;
  const n = new Array(e), r = new Array(e);
  let o = 0, s = 0, i;
  return t = t !== void 0 ? t : 1e3, function(f) {
    const l = Date.now(), u = r[s];
    i || (i = l), n[o] = f, r[o] = l;
    let d = s, w = 0;
    for (; d !== o; )
      w += n[d++], d = d % e;
    if (o = (o + 1) % e, o === s && (s = (s + 1) % e), l - i < t)
      return;
    const g = u && l - u;
    return g ? Math.round(w * 1e3 / g) : void 0;
  };
}
function Yn(e, t) {
  let n = 0, r = 1e3 / t, o, s;
  const i = (l, u = Date.now()) => {
    n = u, o = null, s && (clearTimeout(s), s = null), e(...l);
  };
  return [(...l) => {
    const u = Date.now(), d = u - n;
    d >= r ? i(l, u) : (o = l, s || (s = setTimeout(() => {
      s = null, i(o);
    }, r - d)));
  }, () => o && i(o)];
}
const ne = (e, t, n = 3) => {
  let r = 0;
  const o = Zn(50, 250);
  return Yn((s) => {
    const i = s.loaded, c = s.lengthComputable ? s.total : void 0, f = i - r, l = o(f), u = i <= c;
    r = i;
    const d = {
      loaded: i,
      total: c,
      progress: c ? i / c : void 0,
      bytes: f,
      rate: l || void 0,
      estimated: l && c && u ? (c - i) / l : void 0,
      event: s,
      lengthComputable: c != null,
      [t ? "download" : "upload"]: !0
    };
    e(d);
  }, n);
}, Ie = (e, t) => {
  const n = e != null;
  return [(r) => t[0]({
    lengthComputable: n,
    total: e,
    loaded: r
  }), t[1]];
}, Be = (e) => (...t) => a.asap(() => e(...t)), er = T.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, T.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
  new URL(T.origin),
  T.navigator && /(msie|trident)/i.test(T.navigator.userAgent)
) : () => !0, tr = T.hasStandardBrowserEnv ? (
  // Standard browser envs support document.cookie
  {
    write(e, t, n, r, o, s) {
      const i = [e + "=" + encodeURIComponent(t)];
      a.isNumber(n) && i.push("expires=" + new Date(n).toGMTString()), a.isString(r) && i.push("path=" + r), a.isString(o) && i.push("domain=" + o), s === !0 && i.push("secure"), document.cookie = i.join("; ");
    },
    read(e) {
      const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
      return t ? decodeURIComponent(t[3]) : null;
    },
    remove(e) {
      this.write(e, "", Date.now() - 864e5);
    }
  }
) : (
  // Non-standard browser env (web workers, react-native) lack needed support.
  {
    write() {
    },
    read() {
      return null;
    },
    remove() {
    }
  }
);
function nr(e) {
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
}
function rr(e, t) {
  return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
}
function St(e, t, n) {
  let r = !nr(t);
  return e && (r || n == !1) ? rr(e, t) : t;
}
const je = (e) => e instanceof _ ? { ...e } : e;
function F(e, t) {
  t = t || {};
  const n = {};
  function r(l, u, d, w) {
    return a.isPlainObject(l) && a.isPlainObject(u) ? a.merge.call({ caseless: w }, l, u) : a.isPlainObject(u) ? a.merge({}, u) : a.isArray(u) ? u.slice() : u;
  }
  function o(l, u, d, w) {
    if (a.isUndefined(u)) {
      if (!a.isUndefined(l))
        return r(void 0, l, d, w);
    } else return r(l, u, d, w);
  }
  function s(l, u) {
    if (!a.isUndefined(u))
      return r(void 0, u);
  }
  function i(l, u) {
    if (a.isUndefined(u)) {
      if (!a.isUndefined(l))
        return r(void 0, l);
    } else return r(void 0, u);
  }
  function c(l, u, d) {
    if (d in t)
      return r(l, u);
    if (d in e)
      return r(void 0, l);
  }
  const f = {
    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: c,
    headers: (l, u, d) => o(je(l), je(u), d, !0)
  };
  return a.forEach(Object.keys({ ...e, ...t }), function(u) {
    const d = f[u] || o, w = d(e[u], t[u], u);
    a.isUndefined(w) && d !== c || (n[u] = w);
  }), n;
}
const Rt = (e) => {
  const t = F({}, e);
  let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: s, headers: i, auth: c } = t;
  t.headers = i = _.from(i), t.url = yt(St(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), c && i.set(
    "Authorization",
    "Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
  );
  let f;
  if (a.isFormData(n)) {
    if (T.hasStandardBrowserEnv || T.hasStandardBrowserWebWorkerEnv)
      i.setContentType(void 0);
    else if ((f = i.getContentType()) !== !1) {
      const [l, ...u] = f ? f.split(";").map((d) => d.trim()).filter(Boolean) : [];
      i.setContentType([l || "multipart/form-data", ...u].join("; "));
    }
  }
  if (T.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && er(t.url))) {
    const l = o && s && tr.read(s);
    l && i.set(o, l);
  }
  return t;
}, or = typeof XMLHttpRequest < "u", sr = or && function(e) {
  return new Promise(function(n, r) {
    const o = Rt(e);
    let s = o.data;
    const i = _.from(o.headers).normalize();
    let { responseType: c, onUploadProgress: f, onDownloadProgress: l } = o, u, d, w, g, p;
    function m() {
      g && g(), p && p(), o.cancelToken && o.cancelToken.unsubscribe(u), o.signal && o.signal.removeEventListener("abort", u);
    }
    let h = new XMLHttpRequest();
    h.open(o.method.toUpperCase(), o.url, !0), h.timeout = o.timeout;
    function E() {
      if (!h)
        return;
      const R = _.from(
        "getAllResponseHeaders" in h && h.getAllResponseHeaders()
      ), O = {
        data: !c || c === "text" || c === "json" ? h.responseText : h.response,
        status: h.status,
        statusText: h.statusText,
        headers: R,
        config: e,
        request: h
      };
      Et(function(L) {
        n(L), m();
      }, function(L) {
        r(L), m();
      }, O), h = null;
    }
    "onloadend" in h ? h.onloadend = E : h.onreadystatechange = function() {
      !h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(E);
    }, h.onabort = function() {
      h && (r(new y("Request aborted", y.ECONNABORTED, e, h)), h = null);
    }, h.onerror = function() {
      r(new y("Network Error", y.ERR_NETWORK, e, h)), h = null;
    }, h.ontimeout = function() {
      let C = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
      const O = o.transitional || wt;
      o.timeoutErrorMessage && (C = o.timeoutErrorMessage), r(new y(
        C,
        O.clarifyTimeoutError ? y.ETIMEDOUT : y.ECONNABORTED,
        e,
        h
      )), h = null;
    }, s === void 0 && i.setContentType(null), "setRequestHeader" in h && a.forEach(i.toJSON(), function(C, O) {
      h.setRequestHeader(O, C);
    }), a.isUndefined(o.withCredentials) || (h.withCredentials = !!o.withCredentials), c && c !== "json" && (h.responseType = o.responseType), l && ([w, p] = ne(l, !0), h.addEventListener("progress", w)), f && h.upload && ([d, g] = ne(f), h.upload.addEventListener("progress", d), h.upload.addEventListener("loadend", g)), (o.cancelToken || o.signal) && (u = (R) => {
      h && (r(!R || R.type ? new I(null, e, h) : R), h.abort(), h = null);
    }, o.cancelToken && o.cancelToken.subscribe(u), o.signal && (o.signal.aborted ? u() : o.signal.addEventListener("abort", u)));
    const S = Gn(o.url);
    if (S && T.protocols.indexOf(S) === -1) {
      r(new y("Unsupported protocol " + S + ":", y.ERR_BAD_REQUEST, e));
      return;
    }
    h.send(s || null);
  });
}, ir = (e, t) => {
  const { length: n } = e = e ? e.filter(Boolean) : [];
  if (t || n) {
    let r = new AbortController(), o;
    const s = function(l) {
      if (!o) {
        o = !0, c();
        const u = l instanceof Error ? l : this.reason;
        r.abort(u instanceof y ? u : new I(u instanceof Error ? u.message : u));
      }
    };
    let i = t && setTimeout(() => {
      i = null, s(new y(`timeout ${t} of ms exceeded`, y.ETIMEDOUT));
    }, t);
    const c = () => {
      e && (i && clearTimeout(i), i = null, e.forEach((l) => {
        l.unsubscribe ? l.unsubscribe(s) : l.removeEventListener("abort", s);
      }), e = null);
    };
    e.forEach((l) => l.addEventListener("abort", s));
    const { signal: f } = r;
    return f.unsubscribe = () => a.asap(c), f;
  }
}, ar = function* (e, t) {
  let n = e.byteLength;
  if (n < t) {
    yield e;
    return;
  }
  let r = 0, o;
  for (; r < n; )
    o = r + t, yield e.slice(r, o), r = o;
}, cr = async function* (e, t) {
  for await (const n of ur(e))
    yield* ar(n, t);
}, ur = async function* (e) {
  if (e[Symbol.asyncIterator]) {
    yield* e;
    return;
  }
  const t = e.getReader();
  try {
    for (; ; ) {
      const { done: n, value: r } = await t.read();
      if (n)
        break;
      yield r;
    }
  } finally {
    await t.cancel();
  }
}, qe = (e, t, n, r) => {
  const o = cr(e, t);
  let s = 0, i, c = (f) => {
    i || (i = !0, r && r(f));
  };
  return new ReadableStream({
    async pull(f) {
      try {
        const { done: l, value: u } = await o.next();
        if (l) {
          c(), f.close();
          return;
        }
        let d = u.byteLength;
        if (n) {
          let w = s += d;
          n(w);
        }
        f.enqueue(new Uint8Array(u));
      } catch (l) {
        throw c(l), l;
      }
    },
    cancel(f) {
      return c(f), o.return();
    }
  }, {
    highWaterMark: 2
  });
}, ce = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", Tt = ce && typeof ReadableStream == "function", lr = ce && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), Ot = (e, ...t) => {
  try {
    return !!e(...t);
  } catch {
    return !1;
  }
}, fr = Tt && Ot(() => {
  let e = !1;
  const t = new Request(T.origin, {
    body: new ReadableStream(),
    method: "POST",
    get duplex() {
      return e = !0, "half";
    }
  }).headers.has("Content-Type");
  return e && !t;
}), Me = 64 * 1024, be = Tt && Ot(() => a.isReadableStream(new Response("").body)), re = {
  stream: be && ((e) => e.body)
};
ce && ((e) => {
  ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
    !re[t] && (re[t] = a.isFunction(e[t]) ? (n) => n[t]() : (n, r) => {
      throw new y(`Response type '${t}' is not supported`, y.ERR_NOT_SUPPORT, r);
    });
  });
})(new Response());
const dr = async (e) => {
  if (e == null)
    return 0;
  if (a.isBlob(e))
    return e.size;
  if (a.isSpecCompliantForm(e))
    return (await new Request(T.origin, {
      method: "POST",
      body: e
    }).arrayBuffer()).byteLength;
  if (a.isArrayBufferView(e) || a.isArrayBuffer(e))
    return e.byteLength;
  if (a.isURLSearchParams(e) && (e = e + ""), a.isString(e))
    return (await lr(e)).byteLength;
}, pr = async (e, t) => {
  const n = a.toFiniteNumber(e.getContentLength());
  return n ?? dr(t);
}, hr = ce && (async (e) => {
  let {
    url: t,
    method: n,
    data: r,
    signal: o,
    cancelToken: s,
    timeout: i,
    onDownloadProgress: c,
    onUploadProgress: f,
    responseType: l,
    headers: u,
    withCredentials: d = "same-origin",
    fetchOptions: w
  } = Rt(e);
  l = l ? (l + "").toLowerCase() : "text";
  let g = ir([o, s && s.toAbortSignal()], i), p;
  const m = g && g.unsubscribe && (() => {
    g.unsubscribe();
  });
  let h;
  try {
    if (f && fr && n !== "get" && n !== "head" && (h = await pr(u, r)) !== 0) {
      let O = new Request(t, {
        method: "POST",
        body: r,
        duplex: "half"
      }), P;
      if (a.isFormData(r) && (P = O.headers.get("content-type")) && u.setContentType(P), O.body) {
        const [L, Q] = Ie(
          h,
          ne(Be(f))
        );
        r = qe(O.body, Me, L, Q);
      }
    }
    a.isString(d) || (d = d ? "include" : "omit");
    const E = "credentials" in Request.prototype;
    p = new Request(t, {
      ...w,
      signal: g,
      method: n.toUpperCase(),
      headers: u.normalize().toJSON(),
      body: r,
      duplex: "half",
      credentials: E ? d : void 0
    });
    let S = await fetch(p, w);
    const R = be && (l === "stream" || l === "response");
    if (be && (c || R && m)) {
      const O = {};
      ["status", "statusText", "headers"].forEach((Le) => {
        O[Le] = S[Le];
      });
      const P = a.toFiniteNumber(S.headers.get("content-length")), [L, Q] = c && Ie(
        P,
        ne(Be(c), !0)
      ) || [];
      S = new Response(
        qe(S.body, Me, L, () => {
          Q && Q(), m && m();
        }),
        O
      );
    }
    l = l || "text";
    let C = await re[a.findKey(re, l) || "text"](S, e);
    return !R && m && m(), await new Promise((O, P) => {
      Et(O, P, {
        data: C,
        headers: _.from(S.headers),
        status: S.status,
        statusText: S.statusText,
        config: e,
        request: p
      });
    });
  } catch (E) {
    throw m && m(), E && E.name === "TypeError" && /Load failed|fetch/i.test(E.message) ? Object.assign(
      new y("Network Error", y.ERR_NETWORK, e, p),
      {
        cause: E.cause || E
      }
    ) : y.from(E, E && E.code, e, p);
  }
}), Ee = {
  http: Cn,
  xhr: sr,
  fetch: hr
};
a.forEach(Ee, (e, t) => {
  if (e) {
    try {
      Object.defineProperty(e, "name", { value: t });
    } catch {
    }
    Object.defineProperty(e, "adapterName", { value: t });
  }
});
const He = (e) => `- ${e}`, mr = (e) => a.isFunction(e) || e === null || e === !1, At = {
  getAdapter: (e) => {
    e = a.isArray(e) ? e : [e];
    const { length: t } = e;
    let n, r;
    const o = {};
    for (let s = 0; s < t; s++) {
      n = e[s];
      let i;
      if (r = n, !mr(n) && (r = Ee[(i = String(n)).toLowerCase()], r === void 0))
        throw new y(`Unknown adapter '${i}'`);
      if (r)
        break;
      o[i || "#" + s] = r;
    }
    if (!r) {
      const s = Object.entries(o).map(
        ([c, f]) => `adapter ${c} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
      );
      let i = t ? s.length > 1 ? `since :
` + s.map(He).join(`
`) : " " + He(s[0]) : "as no adapter specified";
      throw new y(
        "There is no suitable adapter to dispatch the request " + i,
        "ERR_NOT_SUPPORT"
      );
    }
    return r;
  },
  adapters: Ee
};
function he(e) {
  if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
    throw new I(null, e);
}
function $e(e) {
  return he(e), e.headers = _.from(e.headers), e.data = pe.call(
    e,
    e.transformRequest
  ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), At.getAdapter(e.adapter || K.adapter)(e).then(function(r) {
    return he(e), r.data = pe.call(
      e,
      e.transformResponse,
      r
    ), r.headers = _.from(r.headers), r;
  }, function(r) {
    return bt(r) || (he(e), r && r.response && (r.response.data = pe.call(
      e,
      e.transformResponse,
      r.response
    ), r.response.headers = _.from(r.response.headers))), Promise.reject(r);
  });
}
const _t = "1.11.0", ue = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
  ue[e] = function(r) {
    return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
  };
});
const ze = {};
ue.transitional = function(t, n, r) {
  function o(s, i) {
    return "[Axios v" + _t + "] Transitional option '" + s + "'" + i + (r ? ". " + r : "");
  }
  return (s, i, c) => {
    if (t === !1)
      throw new y(
        o(i, " has been removed" + (n ? " in " + n : "")),
        y.ERR_DEPRECATED
      );
    return n && !ze[i] && (ze[i] = !0), t ? t(s, i, c) : !0;
  };
};
ue.spelling = function(t) {
  return (n, r) => !0;
};
function yr(e, t, n) {
  if (typeof e != "object")
    throw new y("options must be an object", y.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 c = e[s], f = c === void 0 || i(c, s, e);
      if (f !== !0)
        throw new y("option " + s + " must be " + f, y.ERR_BAD_OPTION_VALUE);
      continue;
    }
    if (n !== !0)
      throw new y("Unknown option " + s, y.ERR_BAD_OPTION);
  }
}
const ee = {
  assertOptions: yr,
  validators: ue
}, k = ee.validators;
let N = class {
  constructor(t) {
    this.defaults = t || {}, this.interceptors = {
      request: new De(),
      response: new De()
    };
  }
  /**
   * Dispatch a request
   *
   * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
   * @param {?Object} config
   *
   * @returns {Promise} The Promise to be fulfilled
   */
  async request(t, n) {
    try {
      return await this._request(t, n);
    } catch (r) {
      if (r instanceof Error) {
        let o = {};
        Error.captureStackTrace ? Error.captureStackTrace(o) : o = new Error();
        const s = o.stack ? o.stack.replace(/^.+\n/, "") : "";
        try {
          r.stack ? s && !String(r.stack).endsWith(s.replace(/^.+\n.+\n/, "")) && (r.stack += `
` + s) : r.stack = s;
        } catch {
        }
      }
      throw r;
    }
  }
  _request(t, n) {
    typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = F(this.defaults, n);
    const { transitional: r, paramsSerializer: o, headers: s } = n;
    r !== void 0 && ee.assertOptions(r, {
      silentJSONParsing: k.transitional(k.boolean),
      forcedJSONParsing: k.transitional(k.boolean),
      clarifyTimeoutError: k.transitional(k.boolean)
    }, !1), o != null && (a.isFunction(o) ? n.paramsSerializer = {
      serialize: o
    } : ee.assertOptions(o, {
      encode: k.function,
      serialize: k.function
    }, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), ee.assertOptions(n, {
      baseUrl: k.spelling("baseURL"),
      withXsrfToken: k.spelling("withXSRFToken")
    }, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
    let i = s && a.merge(
      s.common,
      s[n.method]
    );
    s && a.forEach(
      ["delete", "get", "head", "post", "put", "patch", "common"],
      (p) => {
        delete s[p];
      }
    ), n.headers = _.concat(i, s);
    const c = [];
    let f = !0;
    this.interceptors.request.forEach(function(m) {
      typeof m.runWhen == "function" && m.runWhen(n) === !1 || (f = f && m.synchronous, c.unshift(m.fulfilled, m.rejected));
    });
    const l = [];
    this.interceptors.response.forEach(function(m) {
      l.push(m.fulfilled, m.rejected);
    });
    let u, d = 0, w;
    if (!f) {
      const p = [$e.bind(this), void 0];
      for (p.unshift(...c), p.push(...l), w = p.length, u = Promise.resolve(n); d < w; )
        u = u.then(p[d++], p[d++]);
      return u;
    }
    w = c.length;
    let g = n;
    for (d = 0; d < w; ) {
      const p = c[d++], m = c[d++];
      try {
        g = p(g);
      } catch (h) {
        m.call(this, h);
        break;
      }
    }
    try {
      u = $e.call(this, g);
    } catch (p) {
      return Promise.reject(p);
    }
    for (d = 0, w = l.length; d < w; )
      u = u.then(l[d++], l[d++]);
    return u;
  }
  getUri(t) {
    t = F(this.defaults, t);
    const n = St(t.baseURL, t.url, t.allowAbsoluteUrls);
    return yt(n, t.params, t.paramsSerializer);
  }
};
a.forEach(["delete", "get", "head", "options"], function(t) {
  N.prototype[t] = function(n, r) {
    return this.request(F(r || {}, {
      method: t,
      url: n,
      data: (r || {}).data
    }));
  };
});
a.forEach(["post", "put", "patch"], function(t) {
  function n(r) {
    return function(s, i, c) {
      return this.request(F(c || {}, {
        method: t,
        headers: r ? {
          "Content-Type": "multipart/form-data"
        } : {},
        url: s,
        data: i
      }));
    };
  }
  N.prototype[t] = n(), N.prototype[t + "Form"] = n(!0);
});
let wr = class xt {
  constructor(t) {
    if (typeof t != "function")
      throw new TypeError("executor must be a function.");
    let n;
    this.promise = new Promise(function(s) {
      n = s;
    });
    const r = this;
    this.promise.then((o) => {
      if (!r._listeners) return;
      let s = r._listeners.length;
      for (; s-- > 0; )
        r._listeners[s](o);
      r._listeners = null;
    }), this.promise.then = (o) => {
      let s;
      const i = new Promise((c) => {
        r.subscribe(c), s = c;
      }).then(o);
      return i.cancel = function() {
        r.unsubscribe(s);
      }, i;
    }, t(function(s, i, c) {
      r.reason || (r.reason = new I(s, i, c), n(r.reason));
    });
  }
  /**
   * Throws a `CanceledError` if cancellation has been requested.
   */
  throwIfRequested() {
    if (this.reason)
      throw this.reason;
  }
  /**
   * Subscribe to the cancel signal
   */
  subscribe(t) {
    if (this.reason) {
      t(this.reason);
      return;
    }
    this._listeners ? this._listeners.push(t) : this._listeners = [t];
  }
  /**
   * Unsubscribe from the cancel signal
   */
  unsubscribe(t) {
    if (!this._listeners)
      return;
    const n = this._listeners.indexOf(t);
    n !== -1 && this._listeners.splice(n, 1);
  }
  toAbortSignal() {
    const t = new AbortController(), n = (r) => {
      t.abort(r);
    };
    return this.subscribe(n), t.signal.unsubscribe = () => this.unsubscribe(n), t.signal;
  }
  /**
   * Returns an object that contains a new `CancelToken` and a function that, when called,
   * cancels the `CancelToken`.
   */
  static source() {
    let t;
    return {
      token: new xt(function(o) {
        t = o;
      }),
      cancel: t
    };
  }
};
function gr(e) {
  return function(n) {
    return e.apply(null, n);
  };
}
function br(e) {
  return a.isObject(e) && e.isAxiosError === !0;
}
const Se = {
  Continue: 100,
  SwitchingProtocols: 101,
  Processing: 102,
  EarlyHints: 103,
  Ok: 200,
  Created: 201,
  Accepted: 202,
  NonAuthoritativeInformation: 203,
  NoContent: 204,
  ResetContent: 205,
  PartialContent: 206,
  MultiStatus: 207,
  AlreadyReported: 208,
  ImUsed: 226,
  MultipleChoices: 300,
  MovedPermanently: 301,
  Found: 302,
  SeeOther: 303,
  NotModified: 304,
  UseProxy: 305,
  Unused: 306,
  TemporaryRedirect: 307,
  PermanentRedirect: 308,
  BadRequest: 400,
  Unauthorized: 401,
  PaymentRequired: 402,
  Forbidden: 403,
  NotFound: 404,
  MethodNotAllowed: 405,
  NotAcceptable: 406,
  ProxyAuthenticationRequired: 407,
  RequestTimeout: 408,
  Conflict: 409,
  Gone: 410,
  LengthRequired: 411,
  PreconditionFailed: 412,
  PayloadTooLarge: 413,
  UriTooLong: 414,
  UnsupportedMediaType: 415,
  RangeNotSatisfiable: 416,
  ExpectationFailed: 417,
  ImATeapot: 418,
  MisdirectedRequest: 421,
  UnprocessableEntity: 422,
  Locked: 423,
  FailedDependency: 424,
  TooEarly: 425,
  UpgradeRequired: 426,
  PreconditionRequired: 428,
  TooManyRequests: 429,
  RequestHeaderFieldsTooLarge: 431,
  UnavailableForLegalReasons: 451,
  InternalServerError: 500,
  NotImplemented: 501,
  BadGateway: 502,
  ServiceUnavailable: 503,
  GatewayTimeout: 504,
  HttpVersionNotSupported: 505,
  VariantAlsoNegotiates: 506,
  InsufficientStorage: 507,
  LoopDetected: 508,
  NotExtended: 510,
  NetworkAuthenticationRequired: 511
};
Object.entries(Se).forEach(([e, t]) => {
  Se[t] = e;
});
function kt(e) {
  const t = new N(e), n = ot(N.prototype.request, t);
  return a.extend(n, N.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
    return kt(F(e, o));
  }, n;
}
const b = kt(K);
b.Axios = N;
b.CanceledError = I;
b.CancelToken = wr;
b.isCancel = bt;
b.VERSION = _t;
b.toFormData = ae;
b.AxiosError = y;
b.Cancel = b.CanceledError;
b.all = function(t) {
  return Promise.all(t);
};
b.spread = gr;
b.isAxiosError = br;
b.mergeConfig = F;
b.AxiosHeaders = _;
b.formToJSON = (e) => gt(a.isHTMLForm(e) ? new FormData(e) : e);
b.getAdapter = At.getAdapter;
b.HttpStatusCode = Se;
b.default = b;
const {
  Axios: Zr,
  AxiosError: Yr,
  CanceledError: eo,
  isCancel: to,
  CancelToken: no,
  VERSION: ro,
  all: oo,
  Cancel: so,
  isAxiosError: io,
  spread: ao,
  toFormData: co,
  AxiosHeaders: uo,
  HttpStatusCode: lo,
  formToJSON: fo,
  getAdapter: po,
  mergeConfig: ho
} = b;
/*! js-cookie v3.0.5 | MIT */
function X(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t];
    for (var r in n)
      e[r] = n[r];
  }
  return e;
}
var Er = {
  read: function(e) {
    return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
  },
  write: function(e) {
    return encodeURIComponent(e).replace(
      /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
      decodeURIComponent
    );
  }
};
function Re(e, t) {
  function n(o, s, i) {
    if (!(typeof document > "u")) {
      i = X({}, t, i), typeof i.expires == "number" && (i.expires = new Date(Date.now() + i.expires * 864e5)), i.expires && (i.expires = i.expires.toUTCString()), o = encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
      var c = "";
      for (var f in i)
        i[f] && (c += "; " + f, i[f] !== !0 && (c += "=" + i[f].split(";")[0]));
      return document.cookie = o + "=" + e.write(s, o) + c;
    }
  }
  function r(o) {
    if (!(typeof document > "u" || arguments.length && !o)) {
      for (var s = document.cookie ? document.cookie.split("; ") : [], i = {}, c = 0; c < s.length; c++) {
        var f = s[c].split("="), l = f.slice(1).join("=");
        try {
          var u = decodeURIComponent(f[0]);
          if (i[u] = e.read(l, u), o === u)
            break;
        } catch {
        }
      }
      return o ? i[o] : i;
    }
  }
  return Object.create(
    {
      set: n,
      get: r,
      remove: function(o, s) {
        n(
          o,
          "",
          X({}, s, {
            expires: -1
          })
        );
      },
      withAttributes: function(o) {
        return Re(this.converter, X({}, this.attributes, o));
      },
      withConverter: function(o) {
        return Re(X({}, this.converter, o), this.attributes);
      }
    },
    {
      attributes: { value: Object.freeze(t) },
      converter: { value: Object.freeze(e) }
    }
  );
}
var Sr = Re(Er, { path: "/" }), Je;
const Ct = typeof window < "u", Rr = (e) => typeof e == "string", Ve = () => +Date.now(), Te = () => {
};
Ct && ((Je = window == null ? void 0 : window.navigator) != null && Je.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
function Pe(e) {
  return typeof e == "function" ? e() : Dt(e);
}
function Tr(e, t) {
  function n(...r) {
    return new Promise((o, s) => {
      Promise.resolve(e(() => t.apply(this, r), { fn: t, thisArg: this, args: r })).then(o).catch(s);
    });
  }
  return n;
}
function Or(e, t = !0, n = !0, r = !1) {
  let o = 0, s, i = !0, c = Te, f;
  const l = () => {
    s && (clearTimeout(s), s = void 0, c(), c = Te);
  };
  return (d) => {
    const w = Pe(e), g = Date.now() - o, p = () => f = d();
    return l(), w <= 0 ? (o = Date.now(), p()) : (g > w && (n || !i) ? (o = Date.now(), p()) : t && (f = new Promise((m, h) => {
      c = r ? h : m, s = setTimeout(() => {
        o = Date.now(), i = !0, m(p()), l();
      }, Math.max(0, w - g));
    })), !n && !s && (s = setTimeout(() => i = !0, w)), i = !1, f);
  };
}
function Ar(e) {
  return e;
}
function _r(e) {
  return vt() ? (It(e), !0) : !1;
}
function xr(e) {
  var t;
  const n = Pe(e);
  return (t = n == null ? void 0 : n.$el) != null ? t : n;
}
const Pt = Ct ? window : void 0;
function We(...e) {
  let t, n, r, o;
  if (Rr(e[0]) || Array.isArray(e[0]) ? ([n, r, o] = e, t = Pt) : [t, n, r, o] = e, !t)
    return Te;
  Array.isArray(n) || (n = [n]), Array.isArray(r) || (r = [r]);
  const s = [], i = () => {
    s.forEach((u) => u()), s.length = 0;
  }, c = (u, d, w, g) => (u.addEventListener(d, w, g), () => u.removeEventListener(d, w, g)), f = Ae(() => [xr(t), Pe(o)], ([u, d]) => {
    i(), u && s.push(...n.flatMap((w) => r.map((g) => c(u, w, g, d))));
  }, { immediate: !0, flush: "post" }), l = () => {
    f(), i();
  };
  return _r(l), l;
}
const Ke = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Qe = "__vueuse_ssr_handlers__";
Ke[Qe] = Ke[Qe] || {};
const kr = ["mousemove", "mousedown", "resize", "keydown", "touchstart", "wheel"], Cr = 6e4;
function Pr(e = Cr, t = {}) {
  const {
    initialState: n = !1,
    listenForVisibilityChange: r = !0,
    events: o = kr,
    window: s = Pt,
    eventFilter: i = Or(50)
  } = t, c = te(n), f = te(Ve());
  let l;
  const u = Tr(i, () => {
    c.value = !1, f.value = Ve(), clearTimeout(l), l = setTimeout(() => c.value = !0, e);
  });
  if (s) {
    const d = s.document;
    for (const w of o)
      We(s, w, u, { passive: !0 });
    r && We(d, "visibilitychange", () => {
      d.hidden || u();
    });
  }
  return l = setTimeout(() => c.value = !0, e), { idle: c, lastActive: f };
}
var Xe;
(function(e) {
  e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
})(Xe || (Xe = {}));
var Lr = Object.defineProperty, Ge = Object.getOwnPropertySymbols, Ur = Object.prototype.hasOwnProperty, Nr = Object.prototype.propertyIsEnumerable, Ze = (e, t, n) => t in e ? Lr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Fr = (e, t) => {
  for (var n in t || (t = {}))
    Ur.call(t, n) && Ze(e, n, t[n]);
  if (Ge)
    for (var n of Ge(t))
      Nr.call(t, n) && Ze(e, n, t[n]);
  return e;
};
const Dr = {
  easeInSine: [0.12, 0, 0.39, 0],
  easeOutSine: [0.61, 1, 0.88, 1],
  easeInOutSine: [0.37, 0, 0.63, 1],
  easeInQuad: [0.11, 0, 0.5, 0],
  easeOutQuad: [0.5, 1, 0.89, 1],
  easeInOutQuad: [0.45, 0, 0.55, 1],
  easeInCubic: [0.32, 0, 0.67, 0],
  easeOutCubic: [0.33, 1, 0.68, 1],
  easeInOutCubic: [0.65, 0, 0.35, 1],
  easeInQuart: [0.5, 0, 0.75, 0],
  easeOutQuart: [0.25, 1, 0.5, 1],
  easeInOutQuart: [0.76, 0, 0.24, 1],
  easeInQuint: [0.64, 0, 0.78, 0],
  easeOutQuint: [0.22, 1, 0.36, 1],
  easeInOutQuint: [0.83, 0, 0.17, 1],
  easeInExpo: [0.7, 0, 0.84, 0],
  easeOutExpo: [0.16, 1, 0.3, 1],
  easeInOutExpo: [0.87, 0, 0.13, 1],
  easeInCirc: [0.55, 0, 1, 0.45],
  easeOutCirc: [0, 0.55, 0.45, 1],
  easeInOutCirc: [0.85, 0, 0.15, 1],
  easeInBack: [0.36, 0, 0.66, -0.56],
  easeOutBack: [0.34, 1.56, 0.64, 1],
  easeInOutBack: [0.68, -0.6, 0.32, 1.6]
};
Fr({
  linear: Ar
}, Dr);
let Oe;
const Lt = { triggerProxySso: "triggerProxySso" }, vr = () => {
  Oe = (e) => {
    var n;
    const { origin: t } = new URL(location.href);
    (n = window.top) == null || n.postMessage(
      { type: Lt.triggerProxySso, data: { ...e || {}, redirect_uri: `${t}/` } },
      t
    );
  };
}, Ir = (e) => {
  window.top === window.self && window.addEventListener("message", (t) => {
    const { type: n, data: r } = t.data;
    n === Lt.triggerProxySso && (e == null || e(r));
  });
};
window.top !== window.self && vr();
let Ut = (e = 21) => {
  let t = "", n = crypto.getRandomValues(new Uint8Array(e));
  for (; e--; ) {
    let r = n[e] & 63;
    r < 36 ? t += r.toString(36) : r < 62 ? t += (r - 26).toString(36).toUpperCase() : r < 63 ? t += "_" : t += "-";
  }
  return t;
};
const G = (e) => new URL(location.href).searchParams.get(e), D = {
  oauth: "/api/justauth/oauth-server/v1/visitor/oauth/authorize",
  // 重定向到登录页
  logoutCurpage: "/api/justauth/oauth-server/v1/visitor/logout-curpage",
  // 清除登录信息
  token: "/api/justauth/oauth-server/v1/visitor/oauth/token"
  // 通过code获取token
}, { baseURL: Ye, noRedireLogin: Br = !1 } = _e(), q = location.origin + "/home", M = {
  response_type: "code",
  scope: "sever",
  client_id: "sys",
  client_secret: Bt("das123"),
  state: +/* @__PURE__ */ new Date()
}, et = (e) => {
  const t = new URL(window.location.href), n = new URLSearchParams(t.search);
  e.forEach((r) => {
    n.delete(r);
  }), t.search = n.toString(), window.history.replaceState({}, "", t);
}, Nt = te(!1), Ft = (e) => {
  if (e <= 0) return;
  const { idle: t } = Pr(e);
  Ae(
    () => t.value,
    (n) => {
      n === !0 && (Nt.value = !0);
    }
  );
};
localStorage.getItem("idelTime") && Ft(Number(localStorage.getItem("idelTime")));
let tt = "";
const jr = async () => {
  const e = G("code") || "", t = G("redirect_url") || "/", n = G("kingdee_token") || "", r = G("loginType") || "";
  if (r && localStorage.setItem("loginType", r), !e) return H();
  if (e === tt)
    return et(["code", "state", "kingdee_token", "redirect_url"]), window.__isAutoCloseApp = !1, window.location.replace(decodeURIComponent(t)), H();
  tt = e, et(["code", "state", "kingdee_token", "redirect_url"]);
  let o = {};
  const s = {
    grant_type: "authorization_code",
    code: e,
    client_id: M.client_id,
    client_secret: M.client_secret,
    redirect_uri: r ? nt(q, { loginType: r }) : q,
    timestamp: (/* @__PURE__ */ new Date()).getTime(),
    nonce: Ut()
  };
  n && (sessionStorage.setItem("kingdee_token", n), s.redirect_uri = `${s.redirect_uri}?kingdee_token=${n}`);
  try {
    await b.create().get(D.token, { baseURL: Ye });
  } catch {
  }
  try {
    o = await b.create().post(
      D.token,
      {},
      {
        baseURL: Ye,
        params: s,
        headers: {
          "Content-Type": "application/x-www-form-urlencoded",
          "csrf-token": Sr.get("csrf-token")
        }
      }
    );
    const { access_token: i = "", expires_in: c = 0, refresh_token: f = "", refresh_exp: l = 0 } = o.data, u = {
      accessToken: i,
      accessTokenExpiredAt: +/* @__PURE__ */ new Date() + Number(c) * 1e3,
      refreshToken: f,
      info: o.data
    };
    z().save(u), await rt(i);
    const d = Number(l) - (/* @__PURE__ */ new Date()).getTime();
    return d && d > 0 && (Ft(d), d && localStorage.setItem("idelTime", d.toString())), t && (window.__isAutoCloseApp = !1, window.location.replace(decodeURIComponent(t))), i;
  } catch {
    return le({ ...M, redirect_uri: q });
  }
}, j = te(!1), mo = async (e) => {
  if (e.public) return "";
  if (Nt.value)
    return le({ ...M, redirect_uri: q });
  if (j.value)
    return await new Promise(async (r) => {
      Ae(
        () => j.value,
        (o) => {
          if (!o) {
            const s = H();
            r(s);
          }
        }
      );
    });
  const { accessTokenExpiredAt: t } = z().getData();
  let n = H();
  j.value = !0;
  try {
    typeof t == "number" && t > 0 && +/* @__PURE__ */ new Date() + 6e4 > t && (n = await Hr(M)), n = await jr(), j.value = !1;
  } catch {
    j.value = !1;
  }
  return n;
}, qr = () => {
  let e = !1;
  return localStorage.getItem("thirdLogouSource") === "zhongshen" && (e = !0), e;
}, Mr = (e) => {
  if (localStorage.getItem("thirdLogouSource") === "zhongshen") {
    const r = `https://iam.shenyejituan.com:443/idp/profile/OAUTH2/Redirect/GLO?redirctToUrl=${encodeURIComponent(e)}&entityId=AIoT&redirectToLogin=true`;
    localStorage.removeItem("thirdLogouSource"), location.href = r;
  }
};
let me = !1;
const le = (e) => {
  if (!Br && !me) {
    me = !0;
    try {
      const t = { ...e }, n = localStorage.getItem("loginType") || "";
      n && (t.redirect_uri = nt(t.redirect_uri, { loginType: n }));
      const { baseURL: r, ssoLocale: o } = _e();
      if (Oe) return Oe(t);
      t.logout = "true", o && (t.locale = "locale");
      const s = new URLSearchParams();
      Object.entries(t).forEach(([f, l]) => {
        f !== "client_secret" && s.set(f, String(l));
      });
      const i = s.toString(), c = `${r}${D.oauth}?${i}`;
      if (localStorage.removeItem("idelTime"), sessionStorage.clear(), z().remove(), qr())
        Mr(c);
      else {
        try {
          b.create().get(D.logoutCurpage, { baseURL: r });
        } catch {
        }
        window.__isAutoCloseApp = !1, location.replace(c);
      }
    } finally {
      me = !1;
    }
  }
};
Ir(le);
const Hr = async (e) => {
  const { baseURL: t } = _e(), { refreshToken: n } = z().getData();
  try {
    await b.create().get(D.token, { baseURL: t });
  } catch {
  }
  try {
    const r = await b.create().post(
      D.token,
      {},
      {
        baseURL: t,
        params: {
          refresh_token: n,
          grant_type: "refresh_token",
          client_id: e.client_id,
          client_secret: e.client_secret,
          timestamp: (/* @__PURE__ */ new Date()).getTime(),
          nonce: Ut()
        }
      }
    ), { access_token: o = "", expires_in: s = 0, refresh_token: i = "" } = r.data, c = {
      accessToken: o,
      accessTokenExpiredAt: +/* @__PURE__ */ new Date() + Number(s) * 1e3,
      refreshToken: i,
      info: r.data
    };
    return z().save(c), await rt(o), o;
  } catch {
    return le({ ...e, redirect_uri: q });
  }
}, z = () => ({
  getData: () => ({
    accessToken: H(),
    accessTokenExpiredAt: fe("accessTokenExpiredAt") ? Number(fe("accessTokenExpiredAt")) : "",
    refreshToken: fe("refreshToken")
  }),
  save: (e) => {
    qt(e.accessToken ?? "", {
      accessTokenExpiredAt: e.accessTokenExpiredAt,
      refreshToken: e.refreshToken
    }), Ht(e);
  },
  remove: () => {
    jt(), Mt();
  }
});
export {
  G as getQuery,
  mo as getToken,
  jr as getTokenFromCode,
  M as getTokenParams,
  le as login,
  q as real_uri,
  z as tokenStorage
};
